@golstats/gsc-reports 1.0.86 → 1.0.87

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.
Files changed (28) hide show
  1. package/README.md +2 -2
  2. package/dist/{FilterConditions-55d68355-DMqzcKBO-Dsva57Z5-DGGQbyqc.js → FilterConditions-55d68355-DMqzcKBO-BLPIiHO6-CQmKaiCJ.js} +1 -1
  3. package/dist/{FilterField-59a73e38-CNaE03Ge-DoVl6t0F-9HWoGn8h.js → FilterField-59a73e38-CNaE03Ge-DdQcSyPO-BLqlz6tT.js} +1 -1
  4. package/dist/{FilterSubcategories-a9b32cc9-_h5FCZ4r-ChNV-mxz-TFHmlF8S.js → FilterSubcategories-a9b32cc9-_h5FCZ4r-C_xvbUqF-IMIfzIML.js} +1 -1
  5. package/dist/css/fonts.css +83 -83
  6. package/dist/gsc-reports.css +1 -1
  7. package/dist/gsc-reports.es.js +1 -1
  8. package/dist/gsc-reports.umd.js +6 -6
  9. package/dist/images/cancha-horizontal.jpg +0 -0
  10. package/dist/images/canchaRPH.svg +30 -0
  11. package/dist/{index-jr8PN3sh.js → index-DC4e43X9.js} +431 -431
  12. package/package.json +2 -2
  13. package/src/components/elementsTemplates/ModalConfigurarContenido.vue +1343 -1343
  14. package/src/components/elementsTemplates/ModalDeleteTemplate.vue +249 -249
  15. package/src/components/elementsTemplates/ModalSoloEscritorio.vue +83 -83
  16. package/src/components/elementsTemplates/ModalduplicateTemplate.vue +300 -300
  17. package/src/components/elementsTemplates/TooltipReportOptions.vue +97 -97
  18. package/src/components/elementsTemplates/TooltipTemplateOptions.vue +168 -168
  19. package/src/components/filters.vue +935 -935
  20. package/src/components/template-report-maker/CoverSelector.vue +165 -165
  21. package/src/components/template-report-maker/ReportView.vue +66 -66
  22. package/src/components/thumbnails-reports/AnalisisPostMatchType1.vue +741 -741
  23. package/src/components/thumbnails-reports/AnalisisPostMatchType2.vue +743 -743
  24. package/src/components/thumbnails-reports/AnalisisPrematchType3.vue +173 -173
  25. package/src/components/thumbnails-reports/AnalisisPrematchType4.vue +173 -173
  26. package/src/index.js +4 -4
  27. package/src/types.d.ts +45 -45
  28. package/src/utils/dateUtils.js +52 -52
@@ -4115,7 +4115,7 @@ __p += '`),Bo&&(Na+=`' +
4115
4115
  function print() { __p += __j.call(arguments, '') }
4116
4116
  `:`;
4117
4117
  `)+Na+`return __p
4118
- }`;var ko=_p(function(){return hi(Fr,fi+"return "+Na).apply(i,an)});if(ko.source=Na,rn(ko))throw ko;return ko}function pf(Se){return ge(Se).toLowerCase()}function m0(Se){return ge(Se).toUpperCase()}function Ry(Se,Ae,yt){if(Se=ge(Se),Se&&(yt||Ae===i))return xu(Se);if(!Se||!(Ae=Tu(Ae)))return Se;var Zt=cs(Se),mr=cs(Ae),Fr=Pd(Zt,mr),an=Go(Zt,mr)+1;return Ed(Zt,Fr,an).join("")}function hf(Se,Ae,yt){if(Se=ge(Se),Se&&(yt||Ae===i))return Se.slice(0,pu(Se)+1);if(!Se||!(Ae=Tu(Ae)))return Se;var Zt=cs(Se),mr=Go(Zt,cs(Ae))+1;return Ed(Zt,0,mr).join("")}function My(Se,Ae,yt){if(Se=ge(Se),Se&&(yt||Ae===i))return Se.replace(gt,"");if(!Se||!(Ae=Tu(Ae)))return Se;var Zt=cs(Se),mr=Pd(Zt,cs(Ae));return Ed(Zt,mr).join("")}function jy(Se,Ae){var yt=z,Zt=L;if(Xn(Ae)){var mr="separator"in Ae?Ae.separator:mr;yt="length"in Ae?oi(Ae.length):yt,Zt="omission"in Ae?Tu(Ae.omission):Zt}Se=ge(Se);var Fr=Se.length;if(Os(Se)){var an=cs(Se);Fr=an.length}if(yt>=Fr)return Se;var hn=yt-nl(Zt);if(hn<1)return Zt;var zn=an?Ed(an,0,hn).join(""):Se.slice(0,hn);if(mr===i)return zn+Zt;if(an&&(hn+=zn.length-hn),_i(mr)){if(Se.slice(hn).search(mr)){var xa,wa=zn;for(mr.global||(mr=Tc(mr.source,ge(wt.exec(mr))+"g")),mr.lastIndex=0;xa=mr.exec(wa);)var Na=xa.index;zn=zn.slice(0,Na===i?hn:Na)}}else if(Se.indexOf(Tu(mr),hn)!=hn){var Ya=zn.lastIndexOf(mr);Ya>-1&&(zn=zn.slice(0,Ya))}return zn+Zt}function Wy(Se){return Se=ge(Se),Se&&nt.test(Se)?Se.replace(Ke,hu):Se}var Ky=Sh(function(Se,Ae,yt){return Se+(yt?" ":"")+Ae.toUpperCase()}),$f=oy("toUpperCase");function Is(Se,Ae,yt){return Se=ge(Se),Ae=yt?i:Ae,Ae===i?rl(Se)?Cl(Se):mo(Se):Se.match(Ae)||[]}var _p=xi(function(Se,Ae){try{return Ri(Se,i,Ae)}catch(yt){return rn(yt)?yt:new ui(yt)}}),y0=Yu(function(Se,Ae){return Ka(Ae,function(yt){yt=Zi(yt),we(Se,yt,Do(Se[yt],Se))}),Se});function jd(Se){var Ae=Se==null?0:Se.length,yt=wi();return Se=Ae?Ti(Se,function(Zt){if(typeof Zt[1]!="function")throw new gs(m);return[yt(Zt[0]),Zt[1]]}):[],xi(function(Zt){for(var mr=-1;++mr<Ae;){var Fr=Se[mr];if(Ri(Fr[0],this,Zt))return Ri(Fr[1],this,Zt)}})}function vg(Se){return ot(Xe(Se,_))}function em(Se){return function(){return Se}}function fl(Se,Ae){return Se==null||Se!==Se?Ae:Se}var lc=Gp(),nd=Gp(!0);function ls(Se){return Se}function Vu(Se){return Wi(typeof Se=="function"?Se:Xe(Se,_))}function Wd(Se){return Ai(Xe(Se,_))}function g0(Se,Ae){return Bi(Se,Xe(Ae,_))}var R2=xi(function(Se,Ae){return function(yt){return jn(yt,Se,Ae)}}),M2=xi(function(Se,Ae){return function(yt){return jn(Se,yt,Ae)}});function v0(Se,Ae,yt){var Zt=ba(Ae),mr=Hr(Ae,Zt);yt==null&&!(Xn(Ae)&&(mr.length||!Zt.length))&&(yt=Ae,Ae=Se,Se=this,mr=Hr(Ae,ba(Ae)));var Fr=!(Xn(yt)&&"chain"in yt)||!!yt.chain,an=bn(Se);return Ka(mr,function(hn){var zn=Ae[hn];Se[hn]=zn,an&&(Se.prototype[hn]=function(){var xa=this.__chain__;if(Fr||xa){var wa=Se(this.__wrapped__),Na=wa.__actions__=jc(this.__actions__);return Na.push({func:zn,args:arguments,thisArg:Se}),wa.__chain__=xa,wa}return zn.apply(Se,zs([this.value()],arguments))})}),Se}function bg(){return Ln._===this&&(Ln._=El),this}function ap(){}function j2(Se){return Se=oi(Se),xi(function(Ae){return qo(Ae,Se)})}var xg=Vf(Ti),wg=Vf(yl),W2=Vf(Ns);function K2(Se){return Zh(Se)?Zl(Zi(Se)):Tl(Se)}function _g(Se){return function(Ae){return Se==null?i:tn(Se,Ae)}}var A2=fp(),I2=fp(!0);function b0(){return[]}function Ay(){return!1}function x0(){return{}}function X2(){return""}function Iy(){return!0}function X5(Se,Ae){if(Se=oi(Se),Se<1||Se>R)return[];var yt=X,Zt=mi(Se,X);Ae=wi(Ae),Se-=X;for(var mr=Yc(Zt,Ae);++yt<Se;)Ae(yt);return mr}function D2(Se){return st(Se)?Ti(Se,Zi):Ii(Se)?[Se]:jc($h(ge(Se)))}function D5(Se){var Ae=++is;return ge(Se)+Ae}var J5=hp(function(Se,Ae){return Se+Ae},0),B5=mp("ceil"),G5=hp(function(Se,Ae){return Se/Ae},1),Z5=mp("floor");function H5(Se){return Se&&Se.length?Ct(Se,ls,qn):i}function Y5(Se,Ae){return Se&&Se.length?Ct(Se,wi(Ae,2),qn):i}function Q5(Se){return zl(Se,ls)}function Sp(Se,Ae){return zl(Se,wi(Ae,2))}function Xy(Se){return Se&&Se.length?Ct(Se,ls,Ki):i}function J2(Se,Ae){return Se&&Se.length?Ct(Se,wi(Ae,2),Ki):i}var w0=hp(function(Se,Ae){return Se*Ae},1),B2=mp("round"),LPe=hp(function(Se,Ae){return Se-Ae},0);function UPe(Se){return Se&&Se.length?cu(Se,ls):0}function qPe(Se,Ae){return Se&&Se.length?cu(Se,wi(Ae,2)):0}return dr.after=s0,dr.ary=Ss,dr.assign=Me,dr.assignIn=He,dr.assignInWith=$e,dr.assignWith=ft,dr.at=bt,dr.before=Hf,dr.bind=Do,dr.bindAll=y0,dr.bindKey=l0,dr.castArray=cf,dr.chain=su,dr.chunk=Pu,dr.compact=Zm,dr.concat=gy,dr.cond=jd,dr.conforms=vg,dr.constant=em,dr.countBy=Cy,dr.create=Mt,dr.curry=Yf,dr.curryRight=c0,dr.debounce=u0,dr.defaults=Xt,dr.defaultsDeep=$t,dr.defer=Fy,dr.delay=d0,dr.difference=ig,dr.differenceBy=vy,dr.differenceWith=og,dr.drop=sg,dr.dropRight=tf,dr.dropRightWhile=by,dr.dropWhile=lg,dr.fill=cg,dr.filter=mg,dr.flatMap=a0,dr.flatMapDeep=bp,dr.flatMapDepth=sf,dr.flatten=$p,dr.flattenDeep=xy,dr.flattenDepth=wy,dr.flip=tp,dr.flow=lc,dr.flowRight=nd,dr.fromPairs=F2,dr.functions=Sn,dr.functionsIn=on,dr.groupBy=Xf,dr.initial=Hm,dr.intersection=Ef,dr.intersectionBy=au,dr.intersectionWith=rf,dr.invert=Ra,dr.invertBy=Qa,dr.invokeMap=Md,dr.iteratee=Vu,dr.keyBy=xp,dr.keys=ba,dr.keysIn=Ma,dr.map=lf,dr.mapKeys=Xa,dr.mapValues=Pa,dr.matches=Wd,dr.matchesProperty=g0,dr.memoize=Ac,dr.merge=ua,dr.mergeWith=Da,dr.method=R2,dr.methodOf=M2,dr.mixin=v0,dr.negate=Uh,dr.nthArg=j2,dr.omit=Ba,dr.omitBy=ci,dr.once=$s,dr.orderBy=o0,dr.over=xg,dr.overArgs=qh,dr.overEvery=wg,dr.overSome=W2,dr.partial=$u,dr.partialRight=zh,dr.partition=yg,dr.pick=To,dr.pickBy=bo,dr.property=K2,dr.propertyOf=_g,dr.pull=eh,dr.pullAll=bc,dr.pullAllBy=Ff,dr.pullAllWith=Rf,dr.pullAt=ou,dr.range=A2,dr.rangeRight=I2,dr.rearg=Ch,dr.reject=Jf,dr.remove=Sy,dr.rest=Ph,dr.reverse=Mf,dr.sampleSize=Bf,dr.set=Ic,dr.setWith=dl,dr.shuffle=Gf,dr.slice=af,dr.sortBy=Zf,dr.sortedUniq=th,dr.sortedUniqBy=xc,dr.split=rd,dr.spread=ih,dr.tail=e0,dr.take=t0,dr.takeRight=Ty,dr.takeRightWhile=pg,dr.takeWhile=ky,dr.tap=n0,dr.throttle=pd,dr.thru=Fd,dr.toArray=Ll,dr.toPairs=Ks,dr.toPairsIn=wc,dr.toPath=D2,dr.toPlainObject=J,dr.transform=ic,dr.unary=p0,dr.union=Ny,dr.unionBy=Vy,dr.unionWith=Oy,dr.uniq=hg,dr.uniqBy=fg,dr.uniqWith=Ly,dr.unset=Ts,dr.unzip=rh,dr.unzipWith=Qu,dr.update=ys,dr.updateWith=Jl,dr.values=Qo,dr.valuesIn=pl,dr.without=r0,dr.words=Is,dr.wrap=Nu,dr.xor=Oh,dr.xorBy=jf,dr.xorWith=Wf,dr.zip=Kf,dr.zipObject=Af,dr.zipObjectDeep=nh,dr.zipWith=Uy,dr.entries=Ks,dr.entriesIn=wc,dr.extend=He,dr.extendWith=$e,v0(dr,dr),dr.add=J5,dr.attempt=_p,dr.camelCase=ks,dr.capitalize=qs,dr.ceil=B5,dr.clamp=oc,dr.clone=Ol,dr.cloneDeep=h0,dr.cloneDeepWith=M,dr.cloneWith=rp,dr.conformsTo=Z,dr.deburr=ro,dr.defaultTo=fl,dr.divide=G5,dr.endsWith=hl,dr.eq=pe,dr.escape=sc,dr.escapeRegExp=As,dr.every=Py,dr.find=of,dr.findIndex=ug,dr.findKey=ar,dr.findLast=If,dr.findLastIndex=Pf,dr.findLastKey=pr,dr.floor=Z5,dr.forEach=Vo,dr.forEachRight=i0,dr.forIn=kr,dr.forInRight=br,dr.forOwn=jr,dr.forOwnRight=Dr,dr.get=mn,dr.gt=Ne,dr.gte=De,dr.has=Jn,dr.hasIn=Sa,dr.head=_y,dr.identity=ls,dr.includes=Rd,dr.indexOf=dg,dr.inRange=Xc,dr.invoke=za,dr.isArguments=Ye,dr.isArray=st,dr.isArrayBuffer=Ot,dr.isArrayLike=Kt,dr.isArrayLikeObject=er,dr.isBoolean=nr,dr.isBuffer=lr,dr.isDate=vr,dr.isElement=fr,dr.isEmpty=Er,dr.isEqual=Kr,dr.isEqualWith=ln,dr.isError=rn,dr.isFinite=Tn,dr.isFunction=bn,dr.isInteger=Rn,dr.isLength=Dn,dr.isMap=ca,dr.isMatch=Va,dr.isMatchWith=Fa,dr.isNaN=di,dr.isNative=Ga,dr.isNil=$a,dr.isNull=ii,dr.isNumber=Ia,dr.isObject=Xn,dr.isObjectLike=ha,dr.isPlainObject=Ci,dr.isRegExp=_i,dr.isSafeInteger=Co,dr.isSet=ri,dr.isString=eo,dr.isSymbol=Ii,dr.isTypedArray=to,dr.isUndefined=jo,dr.isWeakMap=Po,dr.isWeakSet=Ms,dr.join=Nh,dr.kebabCase=ed,dr.last=iu,dr.lastIndexOf=Kc,dr.lowerCase=np,dr.lowerFirst=Dc,dr.lt=Jo,dr.lte=js,dr.max=H5,dr.maxBy=Y5,dr.mean=Q5,dr.meanBy=Sp,dr.min=Xy,dr.minBy=J2,dr.stubArray=b0,dr.stubFalse=Ay,dr.stubObject=x0,dr.stubString=X2,dr.stubTrue=Iy,dr.multiply=w0,dr.nth=nf,dr.noConflict=bg,dr.noop=ap,dr.now=dd,dr.pad=xo,dr.padEnd=ss,dr.padStart=Fu,dr.parseInt=td,dr.random=_c,dr.reduce=gg,dr.reduceRight=Df,dr.repeat=Qf,dr.replace=f0,dr.result=Ws,dr.round=B2,dr.runInContext=yn,dr.sample=Ey,dr.size=ep,dr.snakeCase=uf,dr.some=wp,dr.sortedIndex=Vl,dr.sortedIndexBy=Ym,dr.sortedIndexOf=Vh,dr.sortedLastIndex=zo,dr.sortedLastIndexBy=Qm,dr.sortedLastIndexOf=$m,dr.startCase=Eh,dr.startsWith=Ru,dr.subtract=LPe,dr.sum=UPe,dr.sumBy=qPe,dr.template=df,dr.times=X5,dr.toFinite=Yo,dr.toInteger=oi,dr.toLength=Dl,dr.toLower=pf,dr.toNumber=Q,dr.toSafeInteger=se,dr.toString=ge,dr.toUpper=m0,dr.trim=Ry,dr.trimEnd=hf,dr.trimStart=My,dr.truncate=jy,dr.unescape=Wy,dr.uniqueId=D5,dr.upperCase=Ky,dr.upperFirst=$f,dr.each=Vo,dr.eachRight=i0,dr.first=_y,v0(dr,(function(){var Se={};return Ar(dr,function(Ae,yt){Vi.call(dr.prototype,yt)||(Se[yt]=Ae)}),Se})(),{chain:!1}),dr.VERSION=k,Ka(["bind","bindKey","curry","curryRight","partial","partialRight"],function(Se){dr[Se].placeholder=dr}),Ka(["drop","take"],function(Se,Ae){si.prototype[Se]=function(yt){yt=yt===i?1:qi(oi(yt),0);var Zt=this.__filtered__&&!Ae?new si(this):this.clone();return Zt.__filtered__?Zt.__takeCount__=mi(yt,Zt.__takeCount__):Zt.__views__.push({size:mi(yt,X),type:Se+(Zt.__dir__<0?"Right":"")}),Zt},si.prototype[Se+"Right"]=function(yt){return this.reverse()[Se](yt).reverse()}}),Ka(["filter","map","takeWhile"],function(Se,Ae){var yt=Ae+1,Zt=yt==N||yt==T;si.prototype[Se]=function(mr){var Fr=this.clone();return Fr.__iteratees__.push({iteratee:wi(mr,3),type:yt}),Fr.__filtered__=Fr.__filtered__||Zt,Fr}}),Ka(["head","last"],function(Se,Ae){var yt="take"+(Ae?"Right":"");si.prototype[Se]=function(){return this[yt](1).value()[0]}}),Ka(["initial","tail"],function(Se,Ae){var yt="drop"+(Ae?"":"Right");si.prototype[Se]=function(){return this.__filtered__?new si(this):this[yt](1)}}),si.prototype.compact=function(){return this.filter(ls)},si.prototype.find=function(Se){return this.filter(Se).head()},si.prototype.findLast=function(Se){return this.reverse().find(Se)},si.prototype.invokeMap=xi(function(Se,Ae){return typeof Se=="function"?new si(this):this.map(function(yt){return jn(yt,Se,Ae)})}),si.prototype.reject=function(Se){return this.filter(Uh(wi(Se)))},si.prototype.slice=function(Se,Ae){Se=oi(Se);var yt=this;return yt.__filtered__&&(Se>0||Ae<0)?new si(yt):(Se<0?yt=yt.takeRight(-Se):Se&&(yt=yt.drop(Se)),Ae!==i&&(Ae=oi(Ae),yt=Ae<0?yt.dropRight(-Ae):yt.take(Ae-Se)),yt)},si.prototype.takeRightWhile=function(Se){return this.reverse().takeWhile(Se).reverse()},si.prototype.toArray=function(){return this.take(X)},Ar(si.prototype,function(Se,Ae){var yt=/^(?:filter|find|map|reject)|While$/.test(Ae),Zt=/^(?:head|last)$/.test(Ae),mr=dr[Zt?"take"+(Ae=="last"?"Right":""):Ae],Fr=Zt||/^find/.test(Ae);mr&&(dr.prototype[Ae]=function(){var an=this.__wrapped__,hn=Zt?[1]:arguments,zn=an instanceof si,xa=hn[0],wa=zn||st(an),Na=function(Eo){var Bo=mr.apply(dr,zs([Eo],hn));return Zt&&Ya?Bo[0]:Bo};wa&&yt&&typeof xa=="function"&&xa.length!=1&&(zn=wa=!1);var Ya=this.__chain__,fi=!!this.__actions__.length,Pi=Fr&&!Ya,ko=zn&&!fi;if(!Fr&&wa){an=ko?an:new si(this);var Ei=Se.apply(an,hn);return Ei.__actions__.push({func:Fd,args:[Na],thisArg:i}),new _o(Ei,Ya)}return Pi&&ko?Se.apply(this,hn):(Ei=this.thru(Na),Pi?Zt?Ei.value()[0]:Ei.value():Ei)})}),Ka(["pop","push","shift","sort","splice","unshift"],function(Se){var Ae=il[Se],yt=/^(?:push|sort|unshift)$/.test(Se)?"tap":"thru",Zt=/^(?:pop|shift)$/.test(Se);dr.prototype[Se]=function(){var mr=arguments;if(Zt&&!this.__chain__){var Fr=this.value();return Ae.apply(st(Fr)?Fr:[],mr)}return this[yt](function(an){return Ae.apply(st(an)?an:[],mr)})}}),Ar(si.prototype,function(Se,Ae){var yt=dr[Ae];if(yt){var Zt=yt.name+"";Vi.call(Xi,Zt)||(Xi[Zt]=[]),Xi[Zt].push({name:Ae,func:yt})}}),Xi[Xh(i,p).name]=[{name:"wrapper",func:i}],si.prototype.clone=hs,si.prototype.reverse=yu,si.prototype.value=Oa,dr.prototype.at=Eu,dr.prototype.chain=ah,dr.prototype.commit=Lh,dr.prototype.next=gp,dr.prototype.plant=ud,dr.prototype.reverse=qy,dr.prototype.toJSON=dr.prototype.valueOf=dr.prototype.value=zy,dr.prototype.first=dr.prototype.head,Ko&&(dr.prototype[Ko]=vp),dr}),al=$l();ka?((ka.exports=al)._=al,Hn._=al):Ln._=al}).call(Ewe)})(l2,l2.exports)),l2.exports}var w5=Fwe();const Rwe=["x","y"],Mwe=["fill"],jwe={fill:"white","font-size":"8",x:"9.5",y:"10","font-family":"Montserrat-Regular","dominant-baseline":"middle","text-anchor":"middle"},c2={__name:"ChalkboardMarker",props:{x:Number,y:Number,color:String,jersey:Number,orientation:{type:String,default:"vertical"}},setup(e){return(a,i)=>(r.openBlock(),r.createElementBlock("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",x:`${e.x}%`,y:`${e.y}%`},[i[0]||(i[0]=r.createElementVNode("path",{opacity:"0.8",d:"M19.0921 9.65161C19.0921 4.54754 14.838 0.406006 9.59065 0.406006C4.34332 0.406006 0.09375 4.54754 0.09375 9.65161C0.09375 14.7557 4.34785 18.8972 9.59065 18.8972C14.8334 18.8972 19.0875 14.7557 19.0875 9.65161H19.0921Z",fill:"white"},null,-1)),r.createElementVNode("path",{d:"M9.58983 17.4931C14.0383 17.4931 17.6445 13.9824 17.6445 9.6516C17.6445 5.32084 14.0383 1.81006 9.58983 1.81006C5.14136 1.81006 1.53516 5.32084 1.53516 9.6516C1.53516 13.9824 5.14136 17.4931 9.58983 17.4931Z",fill:e.color},null,8,Mwe),i[1]||(i[1]=r.createElementVNode("path",{style:{"mix-blend-mode":"multiply"},opacity:"1",d:"M18.2312 20.0011C18.2312 21.4228 14.2719 22.5708 9.38741 22.5708C4.50291 22.5708 0.539062 21.4184 0.539062 20.0011C0.539062 18.5838 4.49837 17.4314 9.38288 17.4314C14.2674 17.4314 18.2267 18.5838 18.2267 20.0011H18.2312Z",fill:"url(#paint0_radial_249_64014)"},null,-1)),r.createElementVNode("text",jwe,r.toDisplayString(e.jersey),1),i[2]||(i[2]=r.createElementVNode("defs",null,[r.createElementVNode("radialGradient",{id:"paint0_radial_249_64014",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.76498 20.0631) scale(8.68186 2.33162)"},[r.createElementVNode("stop",{"stop-color":"#808080"}),r.createElementVNode("stop",{offset:"1","stop-color":"#CCCBCB","stop-opacity":"0"})])],-1))],8,Rwe))}},Wwe=["x","y"],Kwe=["fill"],Awe=["href"],LN={__name:"ChalkboardMarkerLogo",props:{x:Number,y:Number,color:{type:String,default:"#FFFFFF"},logo:String,orientation:{type:String,default:"vertical"}},setup(e){return(a,i)=>(r.openBlock(),r.createElementBlock("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",x:`${e.x}%`,y:`${e.y}%`},[i[0]||(i[0]=r.createElementVNode("path",{opacity:"0.8",d:"M19.0921 9.65161C19.0921 4.54754 14.838 0.406006 9.59065 0.406006C4.34332 0.406006 0.09375 4.54754 0.09375 9.65161C0.09375 14.7557 4.34785 18.8972 9.59065 18.8972C14.8334 18.8972 19.0875 14.7557 19.0875 9.65161H19.0921Z",fill:"white"},null,-1)),r.createElementVNode("path",{d:"M9.58983 17.4931C14.0383 17.4931 17.6445 13.9824 17.6445 9.6516C17.6445 5.32084 14.0383 1.81006 9.58983 1.81006C5.14136 1.81006 1.53516 5.32084 1.53516 9.6516C1.53516 13.9824 5.14136 17.4931 9.58983 17.4931Z",fill:e.color},null,8,Kwe),i[1]||(i[1]=r.createElementVNode("path",{style:{"mix-blend-mode":"multiply"},opacity:"1",d:"M18.2312 20.0011C18.2312 21.4228 14.2719 22.5708 9.38741 22.5708C4.50291 22.5708 0.539062 21.4184 0.539062 20.0011C0.539062 18.5838 4.49837 17.4314 9.38288 17.4314C14.2674 17.4314 18.2267 18.5838 18.2267 20.0011H18.2312Z",fill:"url(#paint0_radial_249_64014)"},null,-1)),e.logo?(r.openBlock(),r.createElementBlock("image",{key:0,href:e.logo,x:"2",y:"2",width:"16",height:"16",preserveAspectRatio:"xMidYMid meet"},null,8,Awe)):r.createCommentVNode("",!0),i[2]||(i[2]=r.createElementVNode("defs",null,[r.createElementVNode("radialGradient",{id:"paint0_radial_249_64014",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.76498 20.0631) scale(8.68186 2.33162)"},[r.createElementVNode("stop",{"stop-color":"#808080"}),r.createElementVNode("stop",{offset:"1","stop-color":"#CCCBCB","stop-opacity":"0"})])],-1))],8,Wwe))}},Iwe=["id"],Xwe=["fill"],UN={__name:"ChalkboardGraphic",props:{orientation:{type:String,required:!0},id:{type:String,required:!0},uniqueId:{type:String,required:!0}},setup(e){return(a,i)=>(r.openBlock(),r.createElementBlock("g",{id:e.id,class:r.normalizeClass(e.orientation)},[r.createElementVNode("rect",{opacity:"1",height:"411",width:"256",fill:`url(#${e.uniqueId}-fieldBackground)`},null,8,Xwe),i[0]||(i[0]=r.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="256" height="411" viewBox="0 0 256 411" fill="none"><rect x="0.53125" y="0.5" width="254.03" height="410" stroke="#fff"></rect><rect x="15.5312" y="14.5" width="224" height="382" stroke="#fff"></rect><rect x="69.5312" y="14.5" width="116" height="53" stroke="#fff"></rect><rect x="96.5312" y="14.5" width="62" height="29" stroke="#fff"></rect><rect x="69.5312" y="343.5" width="116" height="53" stroke="#fff"></rect><rect x="96.5312" y="367.5" width="62" height="29" stroke="#fff"></rect><path d="M15.5312 205.5H240.031" stroke="#fff"></path><circle cx="128.031" cy="206" r="36.5" stroke="#fff"></circle></svg>',1))],10,Iwe))}},Dwe=["viewBox"],Jwe=["viewBox"],Bwe=["id"],Gwe=["id"],Zwe=["fill"],Hwe=["id"],Ywe=["id"],Qwe=["id"],$we=["id"],e5e=["id","onMouseover","onClick"],t5e=["x1","y1","x2","y2","stroke"],r5e=["x1","y1","x2","y2","stroke","marker-end"],n5e={class:"is-pointer",transform:"translate(-11, -11)"},a5e={key:0,class:"is-pointer",transform:"translate(-11, -11)"},i5e=["id","onMouseover","onClick"],o5e=["x1","y1","x2","y2","stroke","marker-end"],s5e={class:"is-pointer",transform:"translate(-11, -11)"},l5e=["id","onMouseover","onClick"],c5e={class:"tooltip-data__title"},u5e={class:"tooltip-data__player"},d5e={class:"tooltip-data__content"},p5e={class:"tooltip-data__content"},h5e=["src"],f5e={key:0,class:"tooltip-data__content"},m5e={key:1,class:"tooltip-data__content"},y5e={class:"tooltip-data__button-play-container"},g5e={class:"tooltip-data__button-play"},Z0=250/2,qN="https://golstatsimages.blob.core.windows.net/teams-80/",v5e={__name:"XgChalkboard",props:{areLogsVisible:{type:Boolean,default:!1},plays:{type:Array,require:!0},categories:{type:Array,required:!0},players:{type:Array,required:!0},games:{type:Array,default:()=>[]},team:{type:Number,default:0},playValuesIndex:{type:Object,required:!0},analysisType:{type:String,required:!1},sectionType:{type:String,required:!1,default:"team"},orientation:{type:String,required:!1,default:"horizontal"},canPlayVideos:{type:Boolean,default:!0},isAssistZoneVisible:{type:Boolean,default:!1},componentWidth:{type:Number,default:600},isTooltipAvailable:{type:Boolean,default:!1},uniqueId:{type:String,required:!0}},emits:["openmedia","change-xg","change-total-plays"],setup(e,{emit:a}){let i=null;const k=r.ref(null),j=r.ref(null);r.defineComponent({Tooltip:NN,ChalkboardMarker:c2,ChalkboardMarkerLogo:LN,ChalkboardGraphic:UN});const g=a,m=e,n=r.ref(!1),f=r.ref("red"),l=r.ref({x:0,y:0,visible:!1}),t=r.ref({playerName:"",minute:0,rivalLogo:"",categoryName:"",category:"",xGi:0,xGf:0,isOwnGoal:!1}),_=r.ref(!1),b=r.computed(()=>m.componentWidth<565),v=r.computed(()=>m.orientation==="horizontal"?m.componentWidth>384?"0 0 411 256":"0 0 784 490":m.componentWidth>384?"0 0 256 411":"0 0 490 784"),h=r.computed(()=>m.componentWidth<384),o=r.computed(()=>m.sectionType==="team"?[0,1,2,8]:X.value.position_id===1?[]:[0,3,4,10]),s=r.computed(()=>m.plays.map(H=>({playId:H[m.playValuesIndex.playId],gameId:H[m.playValuesIndex.gameId],teamId:H[m.playValuesIndex.teamId],playerId:H[m.playValuesIndex.playerId],momentOfPlay:H[m.playValuesIndex.momentOfPlay],categoryId:H[m.playValuesIndex.categoryId],categoryType:H[m.playValuesIndex.categoryType],matchLapse:H[m.playValuesIndex.matchLapse],section:H[m.playValuesIndex.section],matchResult:H[m.playValuesIndex.matchResult],playingAs:H[m.playValuesIndex.playingAs],total:H[m.playValuesIndex.total],x1:m.orientation==="horizontal"?100-H[m.playValuesIndex.coordinate1Y]*100:H[m.playValuesIndex.coordinate1X]*100,y1:m.orientation==="horizontal"?H[m.playValuesIndex.coordinate1X]*100:H[m.playValuesIndex.coordinate1Y]*100,x2:m.orientation==="horizontal"?100-H[m.playValuesIndex.coordinate2Y]*100:H[m.playValuesIndex.coordinate2X]*100,y2:m.orientation==="horizontal"?H[m.playValuesIndex.coordinate2X]*100:H[m.playValuesIndex.coordinate2Y]*100,x3:m.orientation==="horizontal"?100-H[m.playValuesIndex.coordinate3Y]*100:H[m.playValuesIndex.coordinate3X]*100,y3:m.orientation==="horizontal"?H[m.playValuesIndex.coordinate3X]*100:H[m.playValuesIndex.coordinate3Y]*100,xGi:H[m.playValuesIndex.xGi],xGf:H[m.playValuesIndex.xGf]}))),p=r.computed(()=>m.categories.map((H,ne)=>({id:ne,name:H.name,singleName:H.singleName,negative:H.negative||!1,color:H.color,points:H.points,numPoints:H.points.length,categories:H.categories,invert:H.invert||[]}))),c=r.computed(()=>m.isAssistZoneVisible?m.analysisType==="offensive"?2:3:1),d=r.computed(()=>{const H=p.value.filter(({numPoints:ne})=>ne===1).map(ne=>ne.categories).flat();return[...new Set(H)]}),x=r.computed(()=>{const H=p.value.filter(ne=>ne.numPoints===2).map(ne=>ne.categories).flat();return[...new Set(H)]}),w=r.computed(()=>{const H=p.value.filter(ne=>ne.numPoints===3).map(ne=>ne.categories).flat();return[...new Set(H)]}),S=r.computed(()=>{let H=d.value;return s.value.filter(ne=>C(H,ne)).reduce((ne,B)=>{let re=p.value.find($=>C($.categories,B)),ee=m.players.find($=>$.player_id===B.playerId),Y=m.games.find($=>$?$.gameId===B.gameId||$.game_id===B.gameId:void 0);if(re&&ee&&Y){let $={category:re.id,categoryName:re.name,categorySingleName:re.singleName,color:re.color,playId:B.playId,player:B.playerId,playerName:ee?ee.player_name||ee.name:"",playerImage:ee?ee.player_photo||ee.photo:"",jersey:ee&&(ee.jersey||ee.jersey_number)||"",matchlapse:B.matchLapse,x1:re.invert.includes(B.categoryId)?100-B[`x${re.points[0]}`]:B[`x${re.points[0]}`],y1:re.invert.includes(B.categoryId)?100-B[`y${re.points[0]}`]:B[`y${re.points[0]}`],momentOfPlay:B.momentOfPlay,rivalLogo:q(Y,B)};m.analysisType==="offensive"&&o.value.includes(re.id)&&($.xGi=B.xGi,$.xGf=B.xGf),ne.push($)}return ne},[])}),V=r.computed(()=>{let H=x.value;return s.value.filter(ne=>C(H,ne)).reduce((ne,B)=>{let re=p.value.find($=>C($.categories,B)),ee=m.players.find($=>$.player_id===B.playerId),Y=m.games.find($=>$?$.gameId===B.gameId||$.game_id===B.gameId:void 0);if(re&&ee&&Y){let $={category:re.id,categoryName:re.name,categorySingleName:re.singleName,arrowColor:re.negative?f.value:re.color,arrowMarkerColor:re.negative?`url(#${m.uniqueId}-arrow-negative)`:`url(#${m.uniqueId}-arrow-${re.id})`,markerColor:re.color,playId:B.playId,player:B.playerId,playerName:ee?ee.player_name||ee.name:"",playerImage:ee?ee.player_photo||ee.photo:"",jersey:ee&&(ee.jersey||ee.jersey_number)||"",matchlapse:B.matchLapse,x1:re.invert.includes(B.categoryId)?100-B[`x${re.points[0]}`]:B[`x${re.points[0]}`],y1:re.invert.includes(B.categoryId)?100-B[`y${re.points[0]}`]:B[`y${re.points[0]}`],x2:re.invert.includes(B.categoryId)?100-B[`x${re.points[1]}`]:B[`x${re.points[1]}`],y2:re.invert.includes(B.categoryId)?100-B[`y${re.points[1]}`]:B[`y${re.points[1]}`],momentOfPlay:B.momentOfPlay,rivalLogo:q(Y,B)};m.analysisType==="offensive"&&o.value.includes(re.id)&&($.xGi=B.xGi,$.xGf=B.xGf),ne.push($)}return ne},[])}),O=r.computed(()=>{let H=w.value;return s.value.filter(ne=>C(H,ne)).reduce((ne,B)=>{let re=p.value.find($=>C($.categories,B)),ee=m.players.find($=>$.player_id===B.playerId),Y=m.games.find($=>$?$.gameId===B.gameId||$.game_id===B.gameId:void 0);if(re&&ee&&Y){let $={category:re.id,categoryName:re.name,categorySingleName:re.singleName,arrowColor:re.negative?f.value:re.color,arrowMarkerColor:re.negative?`url(#${m.uniqueId}-arrow-negative)`:`url(#${m.uniqueId}-arrow-${re.id})`,markerColor:re.color,playId:B.playId,player:B.playerId,playerName:ee?ee.player_name||ee.name:"",playerImage:ee?ee.player_photo||ee.photo:"",jersey:ee&&(ee.jersey||ee.jersey_number)||"",matchlapse:B.matchLapse,x1:re.invert.includes(B.categoryId)?100-B[`x${re.points[0]}`]:B[`x${re.points[0]}`],y1:re.invert.includes(B.categoryId)?100-B[`y${re.points[0]}`]:B[`y${re.points[0]}`],x2:re.invert.includes(B.categoryId)?100-B[`x${re.points[1]}`]:B[`x${re.points[1]}`],y2:re.invert.includes(B.categoryId)?100-B[`y${re.points[1]}`]:B[`y${re.points[1]}`],x3:re.invert.includes(B.categoryId)?100-B[`x${re.points[2]}`]:B[`x${re.points[2]}`],y3:re.invert.includes(B.categoryId)?100-B[`y${re.points[2]}`]:B[`y${re.points[2]}`],momentOfPlay:B.momentOfPlay,rivalLogo:q(Y,B)};re.id===0&&m.analysisType==="offensive"&&B.teamId?$.isOwnGoal=m.team!==B.teamId:re.id===0&&m.analysisType==="defensive"&&B.teamId?$.isOwnGoal=m.team===B.teamId:$.isOwnGoal=!1,m.analysisType==="offensive"&&o.value.includes(re.id)&&($.xGi=B.xGi,$.xGf=B.xGf),ne.push($)}return ne},[])}),U=()=>{!j.value||j.value.contains(event.target)||(h.value&&(n.value||z()),n.value=!1)},z=()=>{l.value.visible=!1},L=(H,ne,B=null)=>{const re=s.value.find(ue=>ue.playId===H.playId),ee=B!==null?m.categories[B].name:H.categoryName;let Y={};const $=m.categories.find(ue=>ue.id===H.category),le=$?$.categories:[];if(ne===2&&!h.value){const ue=m.sectionType==="team"&&m.analysisType==="defensive"&&ee.includes("recibidos");Y={seasonId:selectedSeasonIdFilterOptions.value,categoryIds:le,categorySingleName:"",mainSectionType:1,playListType:m.sectionType==="team"?3:2,matchResult:selectedGameResultsFilterOptions.value,playData:re||null,gameIds:selectedGamesIdsFilterOptions.value,isRivalSubject:ue,avoidCategorySingleName:ue,advancedFilter:{playListTitle:ee,mainCategoryId:{},playingAs:selectedPlayingAsFilterOptions.value?[selectedPlayingAsFilterOptions.value]:[1,2],timeSections:selectedGameTimePeriodsFilterOptions.value,fieldSections:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]}}}if(ne===1){const ue=m.sectionType==="team"&&ee.includes("recibidos");Y={seasonId:selectedSeasonIdFilterOptions.value,categoryIds:le,categorySingleName:"",mainSectionType:1,playListType:m.sectionType==="team"?3:2,gameIds:selectedGamesIdsFilterOptions.value,matchResult:selectedGameResultsFilterOptions.value,playData:re||null,isRivalSubject:ue,avoidCategorySingleName:ue,advancedFilter:{playListTitle:ee,mainCategoryId:{},playingAs:selectedPlayingAsFilterOptions.value?[selectedPlayingAsFilterOptions.value]:[1,2],timeSections:selectedGameTimePeriodsFilterOptions.value,fieldSections:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]}}}const ie=m.sectionType==="team";ne===1?ie&&teamId.value?(Y.playerIds=[],Y.teamId=teamId.value):ie||(Y.playerIds=re?[re.playerId]:null,Y.teamId=0):h.value||(ie&&teamId.value?(Y.playerIds=[],Y.teamId=teamId.value):ie||(Y.playerIds=re?[re.playerId]:null,Y.teamId=0)),ne===1?g("openmedia",Y):h.value||g("openmedia",Y)},C=(H,ne)=>H.find(B=>{let re=0;if(typeof B=="string"){if(ne.teamId)return re=Number(B.split("_").shift()),re===ne.categoryId&&ne.teamId!==m.team}else return ne.teamId?B===ne.categoryId&&m.team===ne.teamId:B===ne.categoryId;return!1}),q=(H,ne)=>{if(m.sectionType==="team"){const re=H.homeTeamId===m.team||H.home_team?H.home_team:H.visiting_team;return`${qN}${re}.png`}const B=ne.playingAs===1?H.visiting_team:H.home_team;return`${qN}${B}.png`},N=()=>{if(window.ResizeObserver)i=new ResizeObserver(()=>{_.value=k.value&&k.value.clientWidth>524}),i.observe(k.value);else throw new Error("Resize observer not supported!")};function P(){b.value&&L(T.value.play,T.value.type)}const T=r.ref({play:null,type:null}),E=(H,ne,B)=>{m.isTooltipAvailable&&(n.value=!0,b.value?(T.value={play:ne,type:B},t.value.category=ne.category,t.value.playerName=ne.playerName||"",t.value.playerImage=ne.playerImage||"",t.value.minute=parseInt(ne.momentOfPlay.split(":")[0])||"",t.value.rivalLogo=ne.rivalLogo||"",t.value.categoryName=ne.categoryName||"",t.value.xGi=String(ne.xGi),t.value.xGf=String(ne.xGf),t.value.isOwnGoal=ne.isOwnGoal,l.value.x=H.layerX<Z0+5?5:H.layerX+Z0>k.value.clientWidth?k.value.clientWidth-Z0*2-5:H.layerX,l.value.y=H.layerY+20,l.value.visible=!0):L(ne,B))},R=(H,ne,B)=>{m.isTooltipAvailable&&(T.value={play:ne,type:B},b.value||(t.value.category=ne.category,t.value.playerName=ne.playerName||"",t.value.playerImage=ne.playerImage||"",t.value.minute=parseInt(ne.momentOfPlay.split(":")[0])||"",t.value.rivalLogo=ne.rivalLogo||"",t.value.categoryName=ne.categoryName||"",t.value.xGi=String(ne.xGi),t.value.xGf=String(ne.xGf),t.value.isOwnGoal=ne.isOwnGoal,l.value.x=H.layerX<Z0+5?5:H.layerX+Z0>k.value.clientWidth?k.value.clientWidth-Z0*2-5:H.layerX,l.value.y=H.layerY+20,l.value.visible=!0))},W=()=>{h.value||(l.value.visible=!1)},K=()=>{h.value&&(l.value.visible=!1)},X=r.ref({}),D=r.computed(()=>{const H=w5.groupBy(S.value,"momentOfPlay"),ne=w5.groupBy(V.value,"momentOfPlay"),B=w5.groupBy(O.value,"momentOfPlay");return{playsByMoment1:H,playsByMoment2:ne,playsByMoment3:B}});return r.watch(()=>D.value,H=>{const ne={...H.playsByMoment1,...H.playsByMoment2,...H.playsByMoment3};let B=0;Object.entries(ne).forEach(le=>{o.value.includes(le[1][0].category)&&!le.isOwnGoal&&(B+=Number(le[1][0].xGf))});let re=Object.keys(H.playsByMoment1).length,ee=Object.keys(H.playsByMoment2).length,Y=Object.keys(H.playsByMoment3).length;const $=re+ee+Y;g("change-xg",B),g("change-total-plays",$)},{immediate:!0}),r.onMounted(()=>{document.addEventListener("click",U),N()}),r.onBeforeUnmount(()=>{document.removeEventListener("click",U),i&&(i.disconnect(),i=null)}),(H,ne)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"soccerChalkboard",ref:k,class:r.normalizeClass(["chalkboard__container",e.orientation]),onMouseleave:K},[(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:v.value,"xmlns:xlink":"http://www.w3.org/1999/xlink",class:"soccer-chalkboard"},[(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:e.orientation==="horizontal"?"0 0 411 256":"0 0 256 411","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"svg-soccer-chalkboard"},[r.createElementVNode("defs",null,[r.createElementVNode("marker",{id:`${e.uniqueId}-arrow-negative`,viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"6",markerHeight:"6",markerUnits:"strokeWidth",orient:"auto"},[...ne[0]||(ne[0]=[r.createElementVNode("path",{d:"M 0 0 L 10 5 L 0 10 z","stroke-width":"2",fill:"red"},null,-1)])],8,Bwe),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.value,B=>(r.openBlock(),r.createElementBlock("marker",{key:`${e.uniqueId}-arrow-color-${B.id}`,id:`${e.uniqueId}-arrow-${B.id}`,viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"6",markerHeight:"6",markerUnits:"strokeWidth",orient:"auto"},[r.createElementVNode("path",{d:"M 0 0 L 10 5 L 0 10 z","stroke-width":"2",fill:B.color},null,8,Zwe)],8,Gwe))),128)),r.createElementVNode("pattern",{id:`${e.uniqueId}-fieldBackground`,width:"1",height:"1",viewBox:"0 0 100 100",preserveAspectRatio:"none"},[c.value===1?(r.openBlock(),r.createElementBlock("image",{key:0,"xlink:href":Uwe,width:"100",height:"100",preserveAspectRatio:"none",id:`${e.uniqueId}-image2`},null,8,Ywe)):c.value===2?(r.openBlock(),r.createElementBlock("image",{key:1,"xlink:href":qwe,width:"100",height:"100",preserveAspectRatio:"none",id:`${e.uniqueId}-image2`},null,8,Qwe)):c.value===3?(r.openBlock(),r.createElementBlock("image",{key:2,"xlink:href":zwe,width:"100",height:"100",preserveAspectRatio:"none",id:`${e.uniqueId}-image2`},null,8,$we)):r.createCommentVNode("",!0)],8,Hwe)]),r.createVNode(UN,{id:"soccer-field",orientation:e.orientation,"unique-id":e.uniqueId},null,8,["orientation","unique-id"]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(O.value,B=>(r.openBlock(),r.createElementBlock("g",{key:B.id,id:`play-${B.playId}`,onMouseover:re=>R(re,B,2),onMouseleave:W,onClick:re=>E(re,B,2)},[r.createElementVNode("line",{x1:`${B.x1}%`,y1:`${B.y1}%`,x2:`${B.x2}%`,y2:`${B.y2}%`,stroke:B.arrowColor,"stroke-width":"2"},null,8,t5e),r.createElementVNode("line",{x1:`${B.x2}%`,y1:`${B.y2}%`,x2:`${B.x3}%`,y2:`${B.y3}%`,stroke:B.arrowColor,"stroke-width":"2","marker-end":`${B.arrowMarkerColor}`},null,8,r5e),r.createElementVNode("g",n5e,[r.createVNode(c2,{jersey:B.jersey,color:B.markerColor,x:B.x1,y:B.y1,orientation:e.orientation},null,8,["jersey","color","x","y","orientation"])]),B.categoryName==="Atajadas"||B.categoryName==="Goles recibidos"?(r.openBlock(),r.createElementBlock("g",a5e,[r.createVNode(LN,{color:"#FFFFFF",logo:B.rivalLogo,x:B.x2,y:B.y2,orientation:e.orientation},null,8,["logo","x","y","orientation"])])):r.createCommentVNode("",!0)],40,e5e))),128)),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(V.value,B=>(r.openBlock(),r.createElementBlock("g",{key:B.id,id:`play-${B.playId}`,onMouseover:re=>R(re,B,2),onMouseleave:W,onClick:re=>E(re,B,2)},[r.createElementVNode("line",{x1:`${B.x1}%`,y1:`${B.y1}%`,x2:`${B.x2}%`,y2:`${B.y2}%`,"stroke-width":"2",stroke:B.arrowColor,"marker-end":`${B.arrowMarkerColor}`},null,8,o5e),r.createElementVNode("g",s5e,[r.createVNode(c2,{jersey:B.jersey,color:B.markerColor,x:B.x1,y:B.y1},null,8,["jersey","color","x","y"])])],40,i5e))),128)),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.value,B=>(r.openBlock(),r.createElementBlock("g",{key:B.id,id:`play-${B.playId}`,class:"is-pointer",onMouseover:re=>R(re,B,2),onMouseleave:W,onClick:re=>E(re,B,2),transform:"translate(-11, -11)"},[r.createVNode(c2,{x:B.x1,y:B.y1,jersey:B.jersey,color:B.color},null,8,["x","y","jersey","color"])],40,l5e))),128))],8,Jwe))],8,Dwe)),r.createVNode(NN,{"play-data":l.value,"is-mobile-device":b.value},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["tooltip-data",e.orientation])},[r.createElementVNode("p",c5e,r.toDisplayString(t.value.isOwnGoal?t.value.categoryName=="Goles recibidos"?t.value.categoryName:"Autogol":t.value.categoryName),1),r.createElementVNode("div",u5e,[r.createElementVNode("span",null,r.toDisplayString(t.value.playerName),1),r.createElementVNode("div",{class:"tooltip-data__player-image",style:r.normalizeStyle(`background-image: url(${t.value.playerImage})`)},null,4)]),r.createElementVNode("div",d5e,[r.createElementVNode("span",null,"Minuto: "+r.toDisplayString(t.value.minute),1)]),r.createElementVNode("div",p5e,[r.createElementVNode("span",null,"Rival: "+r.toDisplayString(t.value.rivalName),1),r.createElementVNode("img",{src:t.value.rivalLogo,width:"25",style:{"vertical-align":"middle"}},null,8,h5e)]),/^[+]?([0-1]+(?:[\.][0-9]*)?|\.[0-9]+)$/.test(t.value.xGi)&&t.value.xGi<=1&&!t.value.isOwnGoal?(r.openBlock(),r.createElementBlock("div",f5e,[ne[1]||(ne[1]=r.createElementVNode("span",{class:"bold"},"xGi:",-1)),r.createTextVNode(" "+r.toDisplayString(r.unref(VN)(Number(t.value.xGi),4)),1)])):r.createCommentVNode("",!0),/^[+]?([0-1]+(?:[\.][0-9]*)?|\.[0-9]+)$/.test(t.value.xGf)&&t.value.xGf<=1&&!t.value.isOwnGoal?(r.openBlock(),r.createElementBlock("div",m5e,[ne[2]||(ne[2]=r.createElementVNode("span",{class:"bold"},"xGf:",-1)),r.createTextVNode(" "+r.toDisplayString(r.unref(VN)(Number(t.value.xGf),4)),1)])):r.createCommentVNode("",!0),r.withDirectives(r.createElementVNode("div",y5e,[r.createElementVNode("div",g5e,[r.createElementVNode("div",{role:"button",class:"tooltip-data__button-play__button",onClick:r.withModifiers(P,["stop","prevent"])},[...ne[3]||(ne[3]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 10 10",fill:"none"},[r.createElementVNode("path",{d:"M3.0492 8.92004C2.9831 8.88243 2.92785 8.82624 2.88941 8.75753C2.85097 8.68882 2.83079 8.61018 2.83106 8.53011V1.46888C2.83115 1.38908 2.85146 1.3108 2.88982 1.24236C2.92819 1.17392 2.98318 1.11788 3.04895 1.08019C3.11472 1.0425 3.18881 1.02458 3.26334 1.02832C3.33788 1.03206 3.41007 1.05733 3.47225 1.10145L8.4249 4.63248C8.48147 4.67271 8.52786 4.72726 8.55995 4.79129C8.59204 4.85533 8.60883 4.92685 8.60883 4.9995C8.60883 5.07214 8.59204 5.14367 8.55995 5.2077C8.52786 5.27173 8.48147 5.32629 8.4249 5.36651L3.47225 8.89838C3.41016 8.94259 3.33803 8.96796 3.26352 8.97177C3.18902 8.97559 3.11495 8.95771 3.0492 8.92004ZM3.24397 8.53095L8.19663 4.99991L3.24397 8.53095Z",fill:"#CBEE6B"})],-1)])]),ne[4]||(ne[4]=r.createElementVNode("div",null,"Ver video",-1))])],512),[[r.vShow,b.value]])],2)]),_:1},8,["play-data","is-mobile-device"])],34))}},b5e=x5(v5e,[["__scopeId","data-v-f8def76d"]]);function x5e(e){return e.reduce((a,i,k)=>(a[i]=k,a),{})}const w5e=["playId","gameId","teamId","playerId","momentOfPlay","categoryId","categoryType","matchLapse","section","matchResult","playingAs","total","coordinate1X","coordinate1Y","coordinate2X","coordinate2Y","coordinate3X","coordinate3Y","xGi","xGf"];let _5=null;function _5e(){return _5||(_5=x5e(w5e)),_5}const S5e={class:"chalkboard-profile__field"},T5e={class:"chalkboard-profile__field__events"},k5e={key:0,class:"how-many-games-text"},N5e={__name:"GSC-LastTouch",props:{categories:{type:Array,default:()=>[{name:"Goles",color:"#336DFF",points:[1,2,3],categories:[12,55,"35_r","54_r"],invert:[35,54],negative:!1,translationKey:"chalkboard.offensive.team.goals",singleName:"Gol",isDefaultSelected:!0}]},seasonId:{type:Number,default:2010},isPreMatch:{type:Boolean,default:!1},howManyGames:{type:Number,default:1},analysisType:{type:String,default:"offensive"},sectionType:{type:String,default:"team"},orientation:{type:String,default:"vertical"},isFull:{type:Boolean,default:!1},isTotalXgfVisible:{type:Boolean,default:!0},canPlayVideos:{type:Boolean,default:!1},teamIdForAnalysis:{type:Number,default:1},isAssistZoneVisible:{type:Boolean,default:!1},gamesIdsForAnalysis:{type:Array,default:()=>[]},gameDateUTC:{type:String,default:""},token:{type:String,default:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"},isTemplateMode:{type:Boolean,default:!1},isHomeTeamForAnalysis:{type:Boolean,default:!0}},emits:["openmedia"],setup(e,{emit:a}){let i=null;const k=a,j=e,g=r.ref(null),m=r.ref(1200),n=r.ref(0),f=r.ref("vertical");r.ref({});const l=r.ref(0),t=r.ref(0),_=r.ref([]),b=r.ref([]),v=r.ref([]),h=r.ref(`chalkboard-profile-${Math.random().toString(36).substring(2,11)}`),o=r.computed(()=>!1),s=r.computed(()=>j.teamIdForAnalysis),p=r.computed(()=>({"--font-size-events":m.value<220?"9px":"12px"}));r.computed(()=>[1,2,3]),r.computed(()=>[1,2,3,4,5,6]),r.computed(()=>[1,2]);const c=r.computed(()=>_5e()),d=r.computed(()=>[...j.categories]),x=r.computed(()=>j.categories.reduce((P,T)=>(Array.isArray(T.categories)&&P.push(...T.categories),P),[])),w=r.computed(()=>j.howManyGames===0?"Todos los partidos":j.howManyGames===1?"Último partido":`Últimos ${j.howManyGames} partidos`);r.watch(()=>j.categories,()=>{N()},{deep:!0}),r.watch(()=>j.analysisType,(P,T)=>{P!==T&&N()});function S(){i=new ResizeObserver(P=>{for(const T of P)m.value=T.contentRect.width}),i.observe(g.value)}function V(P){l.value=P}function O(P){t.value=P}r.onMounted(()=>{S()});function U(P){k("openmedia",P)}async function z(){try{const P=`https://d2oco6mqmc.execute-api.us-west-2.amazonaws.com/prod/teamsBySeason/${j.seasonId}`;return(await(await fetch(P,{headers:{Authorization:j.token}})).json()).teams||[]}catch(P){console.error("Error al obtener los equipos por temporada:",P)}}async function L(){try{const P=`https://pa3kubpuhg.execute-api.us-west-2.amazonaws.com/prod/playersByTeamAndSeason/${j.seasonId}/`,T=await(await fetch(P,{headers:{Authorization:j.token}})).json();return(T==null?void 0:T.reduce((E,R)=>(R.players&&Array.isArray(R.players)&&E.push(...R.players),E),[]))||[]}catch(P){console.error("Error al obtener los jugadores por temporada:",P)}}async function C(){try{const P=`https://8tvo5bp9ai.execute-api.us-west-2.amazonaws.com/prod/gamesBySeason/${j.seasonId}`;return(await(await fetch(P,{headers:{Authorization:j.token}})).json()).games||[]}catch(P){console.error("Error al obtener los partidos por temporada:",P)}}async function q(){try{const P=j.gamesIdsForAnalysis.length?j.gamesIdsForAnalysis.reduce((X,D,H)=>(X+=`&game_id=${D}`,X),""):"",T=x.value.reduce((X,D,H)=>(X+=H===0?`category_id=${D}`:`&category_id=${D}`,X),""),E=j.analysisType==="offensive"?2:3,R=j.gameDateUTC?`&date_time_utc=${j.gameDateUTC}`:"",W=`https://mabnn9axgb.execute-api.us-west-2.amazonaws.com/prod/seasons/${j.seasonId}/stats?team_id=${j.teamIdForAnalysis}${P}&${T}&analysis_type=${E}&is_chalkboard=true${R}`,K=await(await fetch(W,{headers:{Authorization:j.token}})).json();return Object.values(K).reduce((X,D)=>(D&&Array.isArray(D)&&X.push(...D),X),[])}catch(P){console.error("Error al obtener las estadísticas del equipo por temporada:",P)}}async function N(){try{const P=[];P.push(z),P.push(L),P.push(C),P.push(q);const[T,E,R,W]=await Promise.all(P.map(K=>K()));_.value=j.isTemplateMode?W.slice(0,3):W,b.value=E,v.value=R}catch(P){console.error("Error al llenar los datos del chalkboard:",P)}}return r.onMounted(async()=>{try{S(),await N()}catch(P){console.error("Error al cargar los datos del chalkboard:",P)}}),(P,T)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"chalkboardProfile",ref:g,class:"chalkboard-profile",style:r.normalizeStyle(p.value)},[r.createElementVNode("div",S5e,[(r.openBlock(),r.createBlock(b5e,{plays:_.value,categories:d.value,players:b.value,games:v.value,team:s.value,"play-values-index":c.value,"analysis-type":e.analysisType,"section-type":e.sectionType,orientation:f.value,key:n.value,"can-play-videos":e.canPlayVideos,"is-assist-zone-visible":e.isAssistZoneVisible,"component-width":m.value,"unique-id":h.value,"are-logs-visible":o.value,onOpenmedia:U,onChangeTotalPlays:V,onChangeXg:O},null,8,["plays","categories","players","games","team","play-values-index","analysis-type","section-type","orientation","can-play-videos","is-assist-zone-visible","component-width","unique-id","are-logs-visible"])),r.createElementVNode("div",T5e,[e.isTotalXgfVisible&&e.analysisType==="offensive"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createTextVNode(" xG: "+r.toDisplayString(t.value.toFixed(2))+" ",1),T[0]||(T[0]=r.createElementVNode("span",{class:"chalkboard-profile__field__events__separator"}," | ",-1))],64)):r.createCommentVNode("",!0),r.createTextVNode(" Eventos totales: "+r.toDisplayString(l.value),1)]),e.isPreMatch?(r.openBlock(),r.createElementBlock("div",k5e,r.toDisplayString(w.value),1)):r.createCommentVNode("",!0)])],4))}},zN=x5(N5e,[["__scopeId","data-v-e0f96979"]]),V5e={class:"tooltip-options"},O5e={__name:"TooltipOptions",props:{optionsType:{type:String,default:"page"}},emits:["close-tooltip","change-sort","delete-page","edit","clone","delete"],setup(e,{emit:a}){const i=e,k=a,j=r.computed(()=>i.optionsType==="page");function g(){k("close-tooltip")}function m(n){k(n),g()}return(n,f)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:"tooltip-overlay",onClick:g}),r.createElementVNode("div",V5e,[r.createElementVNode("ul",null,[j.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("li",{class:"option",onClick:f[0]||(f[0]=l=>m("change-sort"))},[...f[4]||(f[4]=[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),r.createTextVNode(" Cambiar orden ",-1)])]),r.createElementVNode("li",{class:"option",onClick:f[1]||(f[1]=l=>m("delete-page"))},[...f[5]||(f[5]=[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),r.createTextVNode(" Eliminar ",-1)])])],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("li",{class:"option",onClick:f[2]||(f[2]=l=>m("edit"))},[...f[6]||(f[6]=[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),r.createTextVNode(" Editar ",-1)])]),r.createElementVNode("li",{class:"option",onClick:f[3]||(f[3]=l=>m("delete"))},[...f[7]||(f[7]=[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),r.createTextVNode(" Eliminar ",-1)])])],64))])])],64))}},CN=Bc(O5e,[["__scopeId","data-v-998e2429"]]),L5e={class:"report-view"},U5e={class:"report-view__header"},q5e={key:0,class:"report-view__header__logo"},z5e=["src"],C5e={class:"report-view__header__name"},P5e={class:"report-view__content"},E5e={__name:"ReportView",props:{view:{type:Object,default:()=>({title:"View Title"})},isEmpty:{type:Boolean,default:!1},isTemplateMode:{type:Boolean,default:!1},game:{type:Object,default:()=>null},isHomeTeam:{type:Boolean,default:!0},isFilterVisible:{type:Boolean,default:!1},viewId:{type:Number,default:0},isPostMatch:{type:Boolean,default:!1}},emits:["edit","delete"],setup(e,{emit:a}){const i=e,k=r.ref(!1),j=a,g=[1,2,3,4,6,8,14,13],m=r.computed(()=>!g.includes(i.viewId)),n=r.computed(()=>{if(i.game){const o=i.isHomeTeam?i.game.homeTeam:i.game.awayTeam;if(o&&o.logo)return o.logo}return""}),f=r.computed(()=>{const o=i.view.coreView;return o?o.id===9?i.view.w<4?i.view.title.replace("Mapeo de ",""):i.view.title:o.id===6?t(i.view):o.id===13?_(i.view):i.view.title:i.view.title}),l=new Map([[1,"último"],[2,"penúltimo"],[3,"antepenúltimo"]]);function t(o){return i.isPostMatch?o.title:`${o.title} ${l.get(o.componentProps.gameNumber)+" partido"||""}`}function _(o){try{if(!o)return"Tabla por Categoría";const s=o.dynamicFilters||[];if(!Array.isArray(s)||s.length<2)return"Tabla por Categoría";const p=s[1]||[],c=s[0]||2;if(p&&p.length>0){const d=[{value:[213,214,215,216],label:"Pases acertados por lapsos"},{value:[217],label:"Pases filtrados por lapsos"},{value:[218,219,220,221],label:"Pases no acertados por lapsos"},{value:[485,486,487,488],label:"Balones recuperados en disputa por lapsos"},{value:[489,490,491,492],label:"Balones recuperados sin disputa por lapsos"},{value:[496,497,498,499],label:"Balones perdidos en disputa por lapsos"},{value:[500,501,502,503],label:"Balones perdidos sin disputa por lapsos"},{value:[12,55,"35_r","54_r"],label:"Goles por lapsos"},{value:[511,512],label:c==2?"Tiros a gol totales por lapsos":"Tiros a gol recibidos totales por lapsos"},{value:[537,540,544,547],label:c==2?"Tiros a gol a destino por lapsos":"Tiros a gol recibidos a destino por lapsos"},{value:[13],label:c==2?"Centros por izquierda por lapsos":"Centros por derecha recibidos por lapsos"},{value:[25],label:c==2?"Centros por derecha por lapsos":"Centros por izquierda recibidos por lapsos"},{value:[11],label:"Balones ganados en área rival por lapsos"},{value:[607,608,12,55,"35_r","54_r"],label:"Oportunidad de gol por lapsos"},{value:["40_r"],label:"Goles recibidos por lapsos"},{value:["487_r","488_r","491_r","492_r"],label:"Balones recuperados en cancha rival por lapsos"},{value:["485_r","486_r","489_r","490_r"],label:"Balones recuperados en cancha propia por lapsos"}],x=(w,S)=>{if(w.length!==S.length)return!1;const V=[...w].sort(),O=[...S].sort();return V.every((U,z)=>U===O[z])};for(const w of d)if(x(p,w.value))return w.label}return"Tabla por Categoría"}catch(s){return console.error("Error en getTableCategoryTitle:",s),"Tabla por Categoría"}}function b(){h(),j("edit")}function v(){h(),j("delete")}function h(){k.value=!1}return(o,s)=>(r.openBlock(),r.createElementBlock("div",L5e,[r.createElementVNode("div",U5e,[k.value?(r.openBlock(),r.createBlock(CN,{key:0,"options-type":"view",onClick:s[0]||(s[0]=r.withModifiers(p=>k.value=!1,["self"])),onMouseleave:s[1]||(s[1]=p=>k.value=!1),onCloseTooltip:h,onEdit:b,onDelete:v})):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"report-view__header__team-and-name",style:r.normalizeStyle(e.isTemplateMode?{"max-width":"80%"}:{"max-width":"100%"})},[n.value&&m.value?(r.openBlock(),r.createElementBlock("div",q5e,[r.createElementVNode("img",{src:n.value,alt:""},null,8,z5e)])):r.createCommentVNode("",!0),r.createElementVNode("div",C5e,r.toDisplayString(f.value),1)],4),r.withDirectives(r.createElementVNode("div",{role:"button",class:"report-view__header__actions",onClick:s[2]||(s[2]=p=>k.value=!0)},[...s[3]||(s[3]=[r.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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)])],512),[[r.vShow,e.isTemplateMode&&!e.isFilterVisible]])]),r.createElementVNode("div",P5e,[r.createElementVNode("div",{class:r.normalizeClass({"field-possession-component":e.viewId===8,"timeline-component":e.viewId===4,"field-data-by-zones-component":e.viewId===9})},[r.renderSlot(o.$slots,"default",{},void 0,!0)],2)])]))}},F5e=Bc(E5e,[["__scopeId","data-v-150c2e28"]]);function R5e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u2={exports:{}},PN;function M5e(){if(PN)return u2.exports;PN=1;function e(){}return e.prototype={on:function(a,i,k){var j=this.e||(this.e={});return(j[a]||(j[a]=[])).push({fn:i,ctx:k}),this},once:function(a,i,k){var j=this;function g(){j.off(a,g),i.apply(k,arguments)}return g._=i,this.on(a,g,k)},emit:function(a){var i=[].slice.call(arguments,1),k=((this.e||(this.e={}))[a]||[]).slice(),j=0,g=k.length;for(j;j<g;j++)k[j].fn.apply(k[j].ctx,i);return this},off:function(a,i){var k=this.e||(this.e={}),j=k[a],g=[];if(j&&i)for(var m=0,n=j.length;m<n;m++)j[m].fn!==i&&j[m].fn._!==i&&g.push(j[m]);return g.length?k[a]=g:delete k[a],this}},u2.exports=e,u2.exports.TinyEmitter=e,u2.exports}var S5,EN;function j5e(){if(EN)return S5;EN=1;var e=M5e();return S5=new e,S5}var W5e=j5e();const qa=R5e(W5e);function K5e(e,a,i,k,j){const g=(...m)=>(console.warn("gridstack.js: Function `"+i+"` is deprecated in "+j+" and has been replaced with `"+k+"`. It will be **removed** in a future release"),a.apply(e,m));return g.prototype=a.prototype,g}class Yn{static getElements(a,i=document){if(typeof a=="string"){const k="getElementById"in i?i:void 0;if(k&&!isNaN(+a[0])){const g=k.getElementById(a);return g?[g]:[]}let j=i.querySelectorAll(a);return!j.length&&a[0]!=="."&&a[0]!=="#"&&(j=i.querySelectorAll("."+a),j.length||(j=i.querySelectorAll("#"+a))),Array.from(j)}return[a]}static getElement(a,i=document){if(typeof a=="string"){const k="getElementById"in i?i:void 0;if(!a.length)return null;if(k&&a[0]==="#")return k.getElementById(a.substring(1));if(a[0]==="#"||a[0]==="."||a[0]==="[")return i.querySelector(a);if(k&&!isNaN(+a[0]))return k.getElementById(a);let j=i.querySelector(a);return k&&!j&&(j=k.getElementById(a)),j||(j=i.querySelector("."+a)),j}return a}static lazyLoad(a){var i,k;return a.lazyLoad||((k=(i=a.grid)==null?void 0:i.opts)==null?void 0:k.lazyLoad)&&a.lazyLoad!==!1}static createDiv(a,i){const k=document.createElement("div");return a.forEach(j=>{j&&k.classList.add(j)}),i==null||i.appendChild(k),k}static shouldSizeToContent(a,i=!1){return(a==null?void 0:a.grid)&&(i?a.sizeToContent===!0||a.grid.opts.sizeToContent===!0&&a.sizeToContent===void 0:!!a.sizeToContent||a.grid.opts.sizeToContent&&a.sizeToContent!==!1)}static isIntercepted(a,i){return!(a.y>=i.y+i.h||a.y+a.h<=i.y||a.x+a.w<=i.x||a.x>=i.x+i.w)}static isTouching(a,i){return Yn.isIntercepted(a,{x:i.x-.5,y:i.y-.5,w:i.w+1,h:i.h+1})}static areaIntercept(a,i){const k=a.x>i.x?a.x:i.x,j=a.x+a.w<i.x+i.w?a.x+a.w:i.x+i.w;if(j<=k)return 0;const g=a.y>i.y?a.y:i.y,m=a.y+a.h<i.y+i.h?a.y+a.h:i.y+i.h;return m<=g?0:(j-k)*(m-g)}static area(a){return a.w*a.h}static sort(a,i=1){return a.sort((k,j)=>{const g=i*((k.y??1e4)-(j.y??1e4));return g===0?i*((k.x??1e4)-(j.x??1e4)):g})}static find(a,i){return i?a.find(k=>k.id===i):void 0}static toBool(a){return typeof a=="boolean"?a:typeof a=="string"?(a=a.toLowerCase(),!(a===""||a==="no"||a==="false"||a==="0")):!!a}static toNumber(a){return a===null||a.length===0?void 0:Number(a)}static parseHeight(a){let i,k="px";if(typeof a=="string")if(a==="auto"||a==="")i=0;else{const j=a.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!j)throw new Error(`Invalid height val = ${a}`);k=j[2]||"px",i=parseFloat(j[1])}else i=a;return{h:i,unit:k}}static defaults(a,...i){return i.forEach(k=>{for(const j in k){if(!k.hasOwnProperty(j))return;a[j]===null||a[j]===void 0?a[j]=k[j]:typeof k[j]=="object"&&typeof a[j]=="object"&&Yn.defaults(a[j],k[j])}}),a}static same(a,i){if(typeof a!="object")return a==i;if(typeof a!=typeof i||Object.keys(a).length!==Object.keys(i).length)return!1;for(const k in a)if(a[k]!==i[k])return!1;return!0}static copyPos(a,i,k=!1){return i.x!==void 0&&(a.x=i.x),i.y!==void 0&&(a.y=i.y),i.w!==void 0&&(a.w=i.w),i.h!==void 0&&(a.h=i.h),k&&(i.minW&&(a.minW=i.minW),i.minH&&(a.minH=i.minH),i.maxW&&(a.maxW=i.maxW),i.maxH&&(a.maxH=i.maxH)),a}static samePos(a,i){return a&&i&&a.x===i.x&&a.y===i.y&&(a.w||1)===(i.w||1)&&(a.h||1)===(i.h||1)}static sanitizeMinMax(a){a.minW||delete a.minW,a.minH||delete a.minH,a.maxW||delete a.maxW,a.maxH||delete a.maxH}static removeInternalAndSame(a,i){if(!(typeof a!="object"||typeof i!="object"))for(let k in a){const j=a[k],g=i[k];k[0]==="_"||j===g?delete a[k]:j&&typeof j=="object"&&g!==void 0&&(Yn.removeInternalAndSame(j,g),Object.keys(j).length||delete a[k])}}static removeInternalForSave(a,i=!0){for(let k in a)(k[0]==="_"||a[k]===null||a[k]===void 0)&&delete a[k];delete a.grid,i&&delete a.el,a.autoPosition||delete a.autoPosition,a.noResize||delete a.noResize,a.noMove||delete a.noMove,a.locked||delete a.locked,(a.w===1||a.w===a.minW)&&delete a.w,(a.h===1||a.h===a.minH)&&delete a.h}static throttle(a,i){let k=!1;return(...j)=>{k||(k=!0,setTimeout(()=>{a(...j),k=!1},i))}}static removePositioningStyles(a){const i=a.style;i.position&&i.removeProperty("position"),i.left&&i.removeProperty("left"),i.top&&i.removeProperty("top"),i.width&&i.removeProperty("width"),i.height&&i.removeProperty("height")}static getScrollElement(a){if(!a)return document.scrollingElement||document.documentElement;const i=getComputedStyle(a);return/(auto|scroll)/.test(i.overflow+i.overflowY)?a:Yn.getScrollElement(a.parentElement)}static updateScrollPosition(a,i,k){const j=Yn.getScrollElement(a);if(!j)return;const g=a.getBoundingClientRect(),m=j.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,f=g.bottom-Math.min(m.bottom,n),l=g.top-Math.max(m.top,0),t=j.scrollTop;l<0&&k<0?a.offsetHeight>m.height?j.scrollTop+=k:j.scrollTop+=Math.abs(l)>Math.abs(k)?k:l:f>0&&k>0&&(a.offsetHeight>m.height?j.scrollTop+=k:j.scrollTop+=f>k?k:f),i.top+=j.scrollTop-t}static updateScrollResize(a,i,k){const j=Yn.getScrollElement(i),g=j.clientHeight,m=j===Yn.getScrollElement()?0:j.getBoundingClientRect().top,n=a.clientY-m,f=n<k,l=n>g-k;f?j.scrollBy({behavior:"smooth",top:n-k}):l&&j.scrollBy({behavior:"smooth",top:k-(g-n)})}static clone(a){return a==null||typeof a!="object"?a:a instanceof Array?[...a]:{...a}}static cloneDeep(a){const i=["parentGrid","el","grid","subGrid","engine"],k=Yn.clone(a);for(const j in k)k.hasOwnProperty(j)&&typeof k[j]=="object"&&j.substring(0,2)!=="__"&&!i.find(g=>g===j)&&(k[j]=Yn.cloneDeep(a[j]));return k}static cloneNode(a){const i=a.cloneNode(!0);return i.removeAttribute("id"),i}static appendTo(a,i){let k;typeof i=="string"?k=Yn.getElement(i):k=i,k&&k.appendChild(a)}static addElStyles(a,i){if(i instanceof Object)for(const k in i)i.hasOwnProperty(k)&&(Array.isArray(i[k])?i[k].forEach(j=>{a.style[k]=j}):a.style[k]=i[k])}static initEvent(a,i){const k={type:i.type},j={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:i.target?i.target:a.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(g=>k[g]=a[g]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(g=>k[g]=a[g]),{...k,...j}}static simulateMouseEvent(a,i,k){const j=a,g=new MouseEvent(i,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:a.screenX,screenY:a.screenY,clientX:a.clientX,clientY:a.clientY,ctrlKey:j.ctrlKey??!1,altKey:j.altKey??!1,shiftKey:j.shiftKey??!1,metaKey:j.metaKey??!1,button:0,relatedTarget:a.target});(k||a.target).dispatchEvent(g)}static getValuesFromTransformedElement(a){const i=document.createElement("div");Yn.addElStyles(i,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),a.appendChild(i);const k=i.getBoundingClientRect();return a.removeChild(i),i.remove(),{xScale:1/k.width,yScale:1/k.height,xOffset:k.left,yOffset:k.top}}static swap(a,i,k){if(!a)return;const j=a[i];a[i]=a[k],a[k]=j}static canBeRotated(a){var i;return!(!a||a.w===a.h||a.locked||a.noResize||(i=a.grid)!=null&&i.opts.disableResize||a.minW&&a.minW===a.maxW||a.minH&&a.minH===a.maxH)}}class Mh{constructor(a={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=a.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=a.maxRow,this._float=a.float,this.nodes=a.nodes||[],this.onChange=a.onChange}batchUpdate(a=!0,i=!0){return!!this.batchMode===a?this:(this.batchMode=a,a?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,i&&this._packNodes(),this._notify()),this)}_useEntireRowArea(a,i){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!a._moving||a._skipDown||i.y<=a.y)}_fixCollisions(a,i=a,k,j={}){if(this.sortNodes(-1),k=k||this.collide(a,i),!k)return!1;if(a._moving&&!j.nested&&!this.float&&this.swap(a,k))return!0;let g=i;!this._loading&&this._useEntireRowArea(a,i)&&(g={x:0,w:this.column,y:i.y,h:i.h},k=this.collide(a,g,j.skip));let m=!1;const n={nested:!0,pack:!1};let f=0;for(;k=k||this.collide(a,g,j.skip);){if(f++>this.nodes.length*2)throw new Error("Infinite collide check");let l;if(k.locked||this._loading||a._moving&&!a._skipDown&&i.y>a.y&&!this.float&&(!this.collide(k,{...k,y:a.y},a)||!this.collide(k,{...k,y:i.y-k.h},a))){a._skipDown=a._skipDown||i.y>a.y;const t={...i,y:k.y+k.h,...n};l=this._loading&&Yn.samePos(a,t)?!0:this.moveNode(a,t),(k.locked||this._loading)&&l?Yn.copyPos(i,a):!k.locked&&l&&j.pack&&(this._packNodes(),i.y=k.y+k.h,Yn.copyPos(a,i)),m=m||l}else l=this.moveNode(k,{...k,y:i.y+i.h,skip:a,...n});if(!l)return m;k=void 0}return m}collide(a,i=a,k){const j=a._id,g=k==null?void 0:k._id;return this.nodes.find(m=>m._id!==j&&m._id!==g&&Yn.isIntercepted(m,i))}collideAll(a,i=a,k){const j=a._id,g=k==null?void 0:k._id;return this.nodes.filter(m=>m._id!==j&&m._id!==g&&Yn.isIntercepted(m,i))}directionCollideCoverage(a,i,k){if(!i.rect||!a._rect)return;const j=a._rect,g={...i.rect};g.y>j.y?(g.h+=g.y-j.y,g.y=j.y):g.h+=j.y-g.y,g.x>j.x?(g.w+=g.x-j.x,g.x=j.x):g.w+=j.x-g.x;let m,n=.5;for(let f of k){if(f.locked||!f._rect)break;const l=f._rect;let t=Number.MAX_VALUE,_=Number.MAX_VALUE;j.y<l.y?t=(g.y+g.h-l.y)/l.h:j.y+j.h>l.y+l.h&&(t=(l.y+l.h-g.y)/l.h),j.x<l.x?_=(g.x+g.w-l.x)/l.w:j.x+j.w>l.x+l.w&&(_=(l.x+l.w-g.x)/l.w);const b=Math.min(_,t);b>n&&(n=b,m=f)}return i.collide=m,m}cacheRects(a,i,k,j,g,m){return this.nodes.forEach(n=>n._rect={y:n.y*i+k,x:n.x*a+m,w:n.w*a-m-j,h:n.h*i-k-g}),this}swap(a,i){if(!i||i.locked||!a||a.locked)return!1;function k(){const g=i.x,m=i.y;return i.x=a.x,i.y=a.y,a.h!=i.h?(a.x=g,a.y=i.y+i.h):a.w!=i.w?(a.x=i.x+i.w,a.y=m):(a.x=g,a.y=m),a._dirty=i._dirty=!0,!0}let j;if(a.w===i.w&&a.h===i.h&&(a.x===i.x||a.y===i.y)&&(j=Yn.isTouching(a,i)))return k();if(j!==!1){if(a.w===i.w&&a.x===i.x&&(j||(j=Yn.isTouching(a,i)))){if(i.y<a.y){const g=a;a=i,i=g}return k()}if(j!==!1){if(a.h===i.h&&a.y===i.y&&(j||(j=Yn.isTouching(a,i)))){if(i.x<a.x){const g=a;a=i,i=g}return k()}return!1}}}isAreaEmpty(a,i,k,j){const g={x:a||0,y:i||0,w:k||1,h:j||1};return!this.collide(g)}compact(a="compact",i=!0){if(this.nodes.length===0)return this;i&&this.sortNodes();const k=this.batchMode;k||this.batchUpdate();const j=this._inColumnResize;j||(this._inColumnResize=!0);const g=this.nodes;return this.nodes=[],g.forEach((m,n,f)=>{let l;m.locked||(m.autoPosition=!0,a==="list"&&n&&(l=f[n-1])),this.addNode(m,!1,l)}),j||delete this._inColumnResize,k||this.batchUpdate(!1),this}set float(a){this._float!==a&&(this._float=a||!1,a||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(a=1){return this.nodes=Yn.sort(this.nodes,a),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(a=>{if(a._updating||a._orig===void 0||a.y===a._orig.y)return;let i=a.y;for(;i>a._orig.y;)--i,this.collide(a,{x:a.x,y:i,w:a.w,h:a.h})||(a._dirty=!0,a.y=i)}):this.nodes.forEach((a,i)=>{if(!a.locked)for(;a.y>0;){const k=i===0?0:a.y-1;if(!(i===0||!this.collide(a,{x:a.x,y:k,w:a.w,h:a.h})))break;a._dirty=a.y!==k,a.y=k}}),this)}prepareNode(a,i){a._id=a._id??Mh._idSeq++;const k=a.id;if(k){let g=1;for(;this.nodes.find(m=>m.id===a.id&&m!==a);)a.id=k+"_"+g++}(a.x===void 0||a.y===void 0||a.x===null||a.y===null)&&(a.autoPosition=!0);const j={x:0,y:0,w:1,h:1};return Yn.defaults(a,j),a.autoPosition||delete a.autoPosition,a.noResize||delete a.noResize,a.noMove||delete a.noMove,Yn.sanitizeMinMax(a),typeof a.x=="string"&&(a.x=Number(a.x)),typeof a.y=="string"&&(a.y=Number(a.y)),typeof a.w=="string"&&(a.w=Number(a.w)),typeof a.h=="string"&&(a.h=Number(a.h)),isNaN(a.x)&&(a.x=j.x,a.autoPosition=!0),isNaN(a.y)&&(a.y=j.y,a.autoPosition=!0),isNaN(a.w)&&(a.w=j.w),isNaN(a.h)&&(a.h=j.h),this.nodeBoundFix(a,i),a}nodeBoundFix(a,i){const k=a._orig||Yn.copyPos({},a);if(a.maxW&&(a.w=Math.min(a.w||1,a.maxW)),a.maxH&&(a.h=Math.min(a.h||1,a.maxH)),a.minW&&(a.w=Math.max(a.w||1,a.minW)),a.minH&&(a.h=Math.max(a.h||1,a.minH)),(a.x||0)+(a.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&a._id!=null&&this.findCacheLayout(a,this.defaultColumn)===-1){const j={...a};j.autoPosition||j.x===void 0?(delete j.x,delete j.y):j.x=Math.min(this.defaultColumn-1,j.x),j.w=Math.min(this.defaultColumn,j.w||1),this.cacheOneLayout(j,this.defaultColumn)}return a.w>this.column?a.w=this.column:a.w<1&&(a.w=1),this.maxRow&&a.h>this.maxRow?a.h=this.maxRow:a.h<1&&(a.h=1),a.x<0&&(a.x=0),a.y<0&&(a.y=0),a.x+a.w>this.column&&(i?a.w=this.column-a.x:a.x=this.column-a.w),this.maxRow&&a.y+a.h>this.maxRow&&(i?a.h=this.maxRow-a.y:a.y=this.maxRow-a.h),Yn.samePos(a,k)||(a._dirty=!0),this}getDirtyNodes(a){return a?this.nodes.filter(i=>i._dirty&&!Yn.samePos(i,i._orig)):this.nodes.filter(i=>i._dirty)}_notify(a){if(this.batchMode||!this.onChange)return this;const i=(a||[]).concat(this.getDirtyNodes());return this.onChange(i),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(a=>{delete a._dirty,delete a._lastTried}),this)}saveInitial(){return this.nodes.forEach(a=>{a._orig=Yn.copyPos({},a),delete a._dirty}),this._hasLocked=this.nodes.some(a=>a.locked),this}restoreInitial(){return this.nodes.forEach(a=>{!a._orig||Yn.samePos(a,a._orig)||(Yn.copyPos(a,a._orig),a._dirty=!0)}),this._notify(),this}findEmptyPosition(a,i=this.nodes,k=this.column,j){const g=j?j.y*k+(j.x+j.w):0;let m=!1;for(let n=g;!m;++n){const f=n%k,l=Math.floor(n/k);if(f+a.w>k)continue;const t={x:f,y:l,w:a.w,h:a.h};i.find(_=>Yn.isIntercepted(t,_))||((a.x!==f||a.y!==l)&&(a._dirty=!0),a.x=f,a.y=l,delete a.autoPosition,m=!0)}return m}addNode(a,i=!1,k){const j=this.nodes.find(m=>m._id===a._id);if(j)return j;this._inColumnResize?this.nodeBoundFix(a):this.prepareNode(a),delete a._temporaryRemoved,delete a._removeDOM;let g;return a.autoPosition&&this.findEmptyPosition(a,this.nodes,this.column,k)&&(delete a.autoPosition,g=!0),this.nodes.push(a),i&&this.addedNodes.push(a),g||this._fixCollisions(a),this.batchMode||this._packNodes()._notify(),a}removeNode(a,i=!0,k=!1){return this.nodes.find(j=>j._id===a._id)?(k&&this.removedNodes.push(a),i&&(a._removeDOM=!0),this.nodes=this.nodes.filter(j=>j._id!==a._id),a._isAboutToRemove||this._packNodes(),this._notify([a]),this):this}removeAll(a=!0,i=!0){if(delete this._layouts,!this.nodes.length)return this;a&&this.nodes.forEach(j=>j._removeDOM=!0);const k=this.nodes;return this.removedNodes=i?k:[],this.nodes=[],this._notify(k)}moveNodeCheck(a,i){if(!this.changedPosConstrain(a,i))return!1;if(i.pack=!0,!this.maxRow)return this.moveNode(a,i);let k;const j=new Mh({column:this.column,float:this.float,nodes:this.nodes.map(m=>m._id===a._id?(k={...m},k):{...m})});if(!k)return!1;const g=j.moveNode(k,i)&&j.getRow()<=Math.max(this.getRow(),this.maxRow);if(!g&&!i.resizing&&i.collide){const m=i.collide.el.gridstackNode;if(this.swap(a,m))return this._notify(),!0}return g?(j.nodes.filter(m=>m._dirty).forEach(m=>{const n=this.nodes.find(f=>f._id===m._id);n&&(Yn.copyPos(n,m),n._dirty=!0)}),this._notify(),!0):!1}willItFit(a){if(delete a._willFitPos,!this.maxRow)return!0;const i=new Mh({column:this.column,float:this.float,nodes:this.nodes.map(j=>({...j}))}),k={...a};return this.cleanupNode(k),delete k.el,delete k._id,delete k.content,delete k.grid,i.addNode(k),i.getRow()<=this.maxRow?(a._willFitPos=Yn.copyPos({},k),!0):!1}changedPosConstrain(a,i){return i.w=i.w||a.w,i.h=i.h||a.h,a.x!==i.x||a.y!==i.y?!0:(a.maxW&&(i.w=Math.min(i.w,a.maxW)),a.maxH&&(i.h=Math.min(i.h,a.maxH)),a.minW&&(i.w=Math.max(i.w,a.minW)),a.minH&&(i.h=Math.max(i.h,a.minH)),a.w!==i.w||a.h!==i.h)}moveNode(a,i){var k,j;if(!a||!i)return!1;let g;i.pack===void 0&&!this.batchMode&&(g=i.pack=!0),typeof i.x!="number"&&(i.x=a.x),typeof i.y!="number"&&(i.y=a.y),typeof i.w!="number"&&(i.w=a.w),typeof i.h!="number"&&(i.h=a.h);const m=a.w!==i.w||a.h!==i.h,n=Yn.copyPos({},a,!0);if(Yn.copyPos(n,i),this.nodeBoundFix(n,m),Yn.copyPos(i,n),!i.forceCollide&&Yn.samePos(a,i))return!1;const f=Yn.copyPos({},a),l=this.collideAll(a,n,i.skip);let t=!0;if(l.length){const _=a._moving&&!i.nested;let b=_?this.directionCollideCoverage(a,i,l):l[0];if(_&&b&&(j=(k=a.grid)==null?void 0:k.opts)!=null&&j.subGridDynamic&&!a.grid._isTemp){const v=Yn.areaIntercept(i.rect,b._rect),h=Yn.area(i.rect),o=Yn.area(b._rect);v/(h<o?h:o)>.8&&(b.grid.makeSubGrid(b.el,void 0,a),b=void 0)}b?t=!this._fixCollisions(a,n,b,i):(t=!1,g&&delete i.pack)}return t&&!Yn.samePos(a,n)&&(a._dirty=!0,Yn.copyPos(a,n)),i.pack&&this._packNodes()._notify(),!Yn.samePos(a,f)}getRow(){return this.nodes.reduce((a,i)=>Math.max(a,i.y+i.h),0)}beginUpdate(a){return a._updating||(a._updating=!0,delete a._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const a=this.nodes.find(i=>i._updating);return a&&(delete a._updating,delete a._skipDown),this}save(a=!0,i,k){var j;const g=((j=this._layouts)==null?void 0:j.length)||0;let m;g&&(k?k!==this.column&&(m=this._layouts[k]):this.column!==g-1&&(m=this._layouts[g-1]));const n=[];return this.sortNodes(),this.nodes.forEach(f=>{const l=m==null?void 0:m.find(_=>_._id===f._id),t={...f,...l||{}};Yn.removeInternalForSave(t,!a),i&&i(f,t),n.push(t)}),n}layoutsNodesChange(a){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((i,k)=>{if(!i||k===this.column)return this;if(k<this.column)this._layouts[k]=void 0;else{const j=k/this.column;a.forEach(g=>{if(!g._orig)return;const m=i.find(n=>n._id===g._id);m&&(m.y>=0&&g.y!==g._orig.y&&(m.y+=g.y-g._orig.y),g.x!==g._orig.x&&(m.x=Math.round(g.x*j)),g.w!==g._orig.w&&(m.w=Math.round(g.w*j)))})}}),this)}columnChanged(a,i,k="moveScale"){var j;if(!this.nodes.length||!i||a===i)return this;const g=k==="compact"||k==="list";g&&this.sortNodes(1),i<a&&this.cacheLayout(this.nodes,a),this.batchUpdate();let m=[],n=g?this.nodes:Yn.sort(this.nodes,-1);if(i>a&&this._layouts){const f=this._layouts[i]||[],l=this._layouts.length-1;!f.length&&a!==l&&(j=this._layouts[l])!=null&&j.length&&(a=l,this._layouts[l].forEach(t=>{const _=n.find(b=>b._id===t._id);_&&(!g&&!t.autoPosition&&(_.x=t.x??_.x,_.y=t.y??_.y),_.w=t.w??_.w,(t.x==null||t.y===void 0)&&(_.autoPosition=!0))})),f.forEach(t=>{const _=n.findIndex(b=>b._id===t._id);if(_!==-1){const b=n[_];if(g){b.w=t.w;return}(t.autoPosition||isNaN(t.x)||isNaN(t.y))&&this.findEmptyPosition(t,m),t.autoPosition||(b.x=t.x??b.x,b.y=t.y??b.y,b.w=t.w??b.w,m.push(b)),n.splice(_,1)}})}if(g)this.compact(k,!1);else{if(n.length)if(typeof k=="function")k(i,a,m,n);else{const f=g||k==="none"?1:i/a,l=k==="move"||k==="moveScale",t=k==="scale"||k==="moveScale";n.forEach(_=>{_.x=i===1?0:l?Math.round(_.x*f):Math.min(_.x,i-1),_.w=i===1||a===1?1:t?Math.round(_.w*f)||1:Math.min(_.w,i),m.push(_)}),n=[]}m=Yn.sort(m,-1),this._inColumnResize=!0,this.nodes=[],m.forEach(f=>{this.addNode(f,!1),delete f._orig})}return this.nodes.forEach(f=>delete f._orig),this.batchUpdate(!1,!g),delete this._inColumnResize,this}cacheLayout(a,i,k=!1){const j=[];return a.forEach((g,m)=>{if(g._id===void 0){const n=g.id?this.nodes.find(f=>f.id===g.id):void 0;g._id=(n==null?void 0:n._id)??Mh._idSeq++}j[m]={x:g.x,y:g.y,w:g.w,_id:g._id}}),this._layouts=k?[]:this._layouts||[],this._layouts[i]=j,this}cacheOneLayout(a,i){a._id=a._id??Mh._idSeq++;const k={x:a.x,y:a.y,w:a.w,_id:a._id};(a.autoPosition||a.x===void 0)&&(delete k.x,delete k.y,a.autoPosition&&(k.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[i]=this._layouts[i]||[];const j=this.findCacheLayout(a,i);return j===-1?this._layouts[i].push(k):this._layouts[i][j]=k,this}findCacheLayout(a,i){var k,j;return((j=(k=this._layouts)==null?void 0:k[i])==null?void 0:j.findIndex(g=>g._id===a._id))??-1}removeNodeFromLayoutCache(a){if(this._layouts)for(let i=0;i<this._layouts.length;i++){const k=this.findCacheLayout(a,i);k!==-1&&this._layouts[i].splice(k,1)}}cleanupNode(a){for(const i in a)i[0]==="_"&&i!=="_id"&&delete a[i];return this}}Mh._idSeq=0;const Id={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};class Fi{}const Kp=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class bh{}function d2(e,a){e.touches.length>1||(e.cancelable&&e.preventDefault(),Yn.simulateMouseEvent(e.changedTouches[0],a))}function FN(e,a){e.cancelable&&e.preventDefault(),Yn.simulateMouseEvent(e,a)}function p2(e){bh.touchHandled||(bh.touchHandled=!0,d2(e,"mousedown"))}function h2(e){bh.touchHandled&&d2(e,"mousemove")}function f2(e){if(!bh.touchHandled)return;bh.pointerLeaveTimeout&&(window.clearTimeout(bh.pointerLeaveTimeout),delete bh.pointerLeaveTimeout);const a=!!Fi.dragElement;d2(e,"mouseup"),a||d2(e,"click"),bh.touchHandled=!1}function m2(e){e.pointerType!=="mouse"&&e.target.releasePointerCapture(e.pointerId)}function RN(e){Fi.dragElement&&e.pointerType!=="mouse"&&FN(e,"mouseenter")}function MN(e){Fi.dragElement&&e.pointerType!=="mouse"&&(bh.pointerLeaveTimeout=window.setTimeout(()=>{delete bh.pointerLeaveTimeout,FN(e,"mouseleave")},10))}class y2{constructor(a,i,k){this.host=a,this.dir=i,this.option=k,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){const a=this.el=document.createElement("div");return a.classList.add("ui-resizable-handle"),a.classList.add(`${y2.prefix}${this.dir}`),a.style.zIndex="100",a.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),Kp&&(this.el.addEventListener("touchstart",p2),this.el.addEventListener("pointerdown",m2)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Kp&&(this.el.removeEventListener("touchstart",p2),this.el.removeEventListener("pointerdown",m2)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(a){this.mouseDownEvent=a,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Kp&&(this.el.addEventListener("touchmove",h2),this.el.addEventListener("touchend",f2)),a.stopPropagation(),a.preventDefault()}_mouseMove(a){const i=this.mouseDownEvent;this.moving?this._triggerEvent("move",a):Math.abs(a.x-i.x)+Math.abs(a.y-i.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",a),document.addEventListener("keydown",this._keyEvent)),a.stopPropagation()}_mouseUp(a){this.moving&&(this._triggerEvent("stop",a),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Kp&&(this.el.removeEventListener("touchmove",h2),this.el.removeEventListener("touchend",f2)),delete this.moving,delete this.mouseDownEvent,a.stopPropagation(),a.preventDefault()}_keyEvent(a){var i,k;a.key==="Escape"&&((k=(i=this.host.gridstackNode)==null?void 0:i.grid)==null||k.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(a,i){return this.option[a]&&this.option[a](i),this}}y2.prefix="ui-resizable-";class T5{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(a,i){this._eventRegister[a]=i}off(a){delete this._eventRegister[a]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(a,i){if(!this.disabled&&this._eventRegister&&this._eventRegister[a])return this._eventRegister[a](i)}}class K1 extends T5{constructor(a,i={}){super(),this.el=a,this.option=i,this.rectScale={x:1,y:1},this._ui=()=>{const k=this.el.parentElement.getBoundingClientRect(),j={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},g=this.temporalRect||j;return{position:{left:(g.left-k.left)*this.rectScale.x,top:(g.top-k.top)*this.rectScale.y},size:{width:g.width*this.rectScale.x,height:g.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(a,i){super.on(a,i)}off(a){super.off(a)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(a){const i=a.handles&&a.handles!==this.option.handles,k=a.autoHide&&a.autoHide!==this.option.autoHide;return Object.keys(a).forEach(j=>this.option[j]=a[j]),i&&(this._removeHandlers(),this._setupHandlers()),k&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(a){return a?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),Fi.overResizeElement===this&&delete Fi.overResizeElement),this}_mouseOver(a){Fi.overResizeElement||Fi.dragElement||(Fi.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(a){Fi.overResizeElement===this&&(delete Fi.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(a=>a.trim()).map(a=>new y2(this.el,a,{start:i=>{this._resizeStart(i)},stop:i=>{this._resizeStop(i)},move:i=>{this._resizing(i,a)}})),this}_resizeStart(a){this.sizeToContent=Yn.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=Yn.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=a,this._setupHelper(),this._applyChange();const i=Yn.initEvent(a,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(i,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",i),this}_resizing(a,i){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(a,i),this._applyChange();const k=Yn.initEvent(a,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(k,this._ui()),this.triggerEvent("resize",k),this}_resizeStop(a){const i=Yn.initEvent(a,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(i),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",i),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=K1._originStyleProp.map(k=>this.el.style[k]),this.parentOriginStylePosition=this.el.parentElement.style.position;const a=this.el.parentElement,i=Yn.getValuesFromTransformedElement(a);return this.rectScale={x:i.xScale,y:i.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return K1._originStyleProp.forEach((a,i)=>{this.el.style[a]=this.elOriginStyleVal[i]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(a,i){const k=this.startEvent,j={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},g=a.clientX-k.clientX,m=this.sizeToContent?0:a.clientY-k.clientY;let n,f;i.indexOf("e")>-1?j.width+=g:i.indexOf("w")>-1&&(j.width-=g,j.left+=g,n=!0),i.indexOf("s")>-1?j.height+=m:i.indexOf("n")>-1&&(j.height-=m,j.top+=m,f=!0);const l=this._constrainSize(j.width,j.height,n,f);return Math.round(j.width)!==Math.round(l.width)&&(i.indexOf("w")>-1&&(j.left+=j.width-l.width),j.width=l.width),Math.round(j.height)!==Math.round(l.height)&&(i.indexOf("n")>-1&&(j.top+=j.height-l.height),j.height=l.height),j}_constrainSize(a,i,k,j){const g=this.option,m=(k?g.maxWidthMoveLeft:g.maxWidth)||Number.MAX_SAFE_INTEGER,n=g.minWidth/this.rectScale.x||a,f=(j?g.maxHeightMoveUp:g.maxHeight)||Number.MAX_SAFE_INTEGER,l=g.minHeight/this.rectScale.y||i,t=Math.min(m,Math.max(n,a)),_=Math.min(f,Math.max(l,i));return{width:t,height:_}}_applyChange(){let a={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const i=this.el.parentElement,{left:k,top:j}=i.getBoundingClientRect();a={left:k,top:j,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(i=>{const k=this.temporalRect[i],j=i==="width"||i==="left"?this.rectScale.x:i==="height"||i==="top"?this.rectScale.y:1;this.el.style[i]=(k-a[i])*j+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(a=>a.destroy()),delete this.handlers,this}}K1._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const A5e='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class A1 extends T5{constructor(a,i={}){var k;super(),this.el=a,this.option=i,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const j=(k=i==null?void 0:i.handle)==null?void 0:k.substring(1),g=a.gridstackNode;this.dragEls=!j||a.classList.contains(j)?[a]:g!=null&&g.subGrid?[a.querySelector(i.handle)||a]:Array.from(a.querySelectorAll(i.handle)),this.dragEls.length===0&&(this.dragEls=[a]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(a,i){super.on(a,i)}off(a){super.off(a)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(a=>{a.addEventListener("mousedown",this._mouseDown),Kp&&(a.addEventListener("touchstart",p2),a.addEventListener("pointerdown",m2))}),this.el.classList.remove("ui-draggable-disabled"))}disable(a=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(i=>{i.removeEventListener("mousedown",this._mouseDown),Kp&&(i.removeEventListener("touchstart",p2),i.removeEventListener("pointerdown",m2))}),a||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(a){return Object.keys(a).forEach(i=>this.option[i]=a[i]),this}_mouseDown(a){if(!Fi.mouseHandled)return a.button!==0||!this.dragEls.find(i=>i===a.target)&&a.target.closest(A5e)||this.option.cancel&&a.target.closest(this.option.cancel)||(this.mouseDownEvent=a,delete this.dragging,delete Fi.dragElement,delete Fi.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Kp&&(a.currentTarget.addEventListener("touchmove",h2),a.currentTarget.addEventListener("touchend",f2)),a.preventDefault(),document.activeElement&&document.activeElement.blur(),Fi.mouseHandled=!0),!0}_callDrag(a){if(!this.dragging)return;const i=Yn.initEvent(a,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(i,this.ui()),this.triggerEvent("drag",i)}_mouseMove(a){var i;const k=this.mouseDownEvent;if(this.lastDrag=a,this.dragging)if(this._dragFollow(a),Fi.pauseDrag){const j=Number.isInteger(Fi.pauseDrag)?Fi.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(a),j)}else this._callDrag(a);else if(Math.abs(a.x-k.x)+Math.abs(a.y-k.y)>3){this.dragging=!0,Fi.dragElement=this;const j=(i=this.el.gridstackNode)==null?void 0:i.grid;j?Fi.dropElement=j.el.ddElement.ddDroppable:delete Fi.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=Yn.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(a,this.el,this.helperContainment),this._setupHelperStyle(a);const g=Yn.initEvent(a,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(g,this.ui()),this.triggerEvent("dragstart",g),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(a){var i,k;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Kp&&a.currentTarget&&(a.currentTarget.removeEventListener("touchmove",h2,!0),a.currentTarget.removeEventListener("touchend",f2,!0)),this.dragging){delete this.dragging,(i=this.el.gridstackNode)==null||delete i._origRotate,document.removeEventListener("keydown",this._keyEvent),((k=Fi.dropElement)==null?void 0:k.el)===this.el.parentElement&&delete Fi.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const j=Yn.initEvent(a,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(j),this.triggerEvent("dragstop",j),Fi.dropElement&&Fi.dropElement.drop(a)}delete this.helper,delete this.mouseDownEvent,delete Fi.dragElement,delete Fi.dropElement,delete Fi.mouseHandled,a.preventDefault()}_keyEvent(a){var i,k;const j=this.el.gridstackNode,g=(j==null?void 0:j.grid)||((k=(i=Fi.dropElement)==null?void 0:i.el)==null?void 0:k.gridstack);if(a.key==="Escape")j&&j._origRotate&&(j._orig=j._origRotate,delete j._origRotate),g==null||g.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(j&&g&&(a.key==="r"||a.key==="R")){if(!Yn.canBeRotated(j))return;j._origRotate=j._origRotate||{...j._orig},delete j._moving,g.setAnimation(!1).rotate(j.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),j._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,j.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",Yn.swap(j._orig,"w","h"),delete j._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let a=this.el;return typeof this.option.helper=="function"?a=this.option.helper(this.el):this.option.helper==="clone"&&(a=Yn.cloneNode(this.el)),a.parentElement||Yn.appendTo(a,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=A1.originStyleProp.map(i=>this.el.style[i]),a}_setupHelperStyle(a){var i,k;this.helper.classList.add("ui-draggable-dragging"),(k=(i=this.el.gridstackNode)==null?void 0:i.grid)==null||k.el.classList.add("grid-stack-dragging");const j=this.helper.style;return j.pointerEvents="none",j.width=this.dragOffset.width+"px",j.height=this.dragOffset.height+"px",j.willChange="left, top",j.position="fixed",this._dragFollow(a),j.transition="none",setTimeout(()=>{this.helper&&(j.transition=null)},0),this}_removeHelperStyle(){var a,i,k;this.helper.classList.remove("ui-draggable-dragging"),(i=(a=this.el.gridstackNode)==null?void 0:a.grid)==null||i.el.classList.remove("grid-stack-dragging");const j=(k=this.helper)==null?void 0:k.gridstackNode;if(!(j!=null&&j._isAboutToRemove)&&this.dragElementOriginStyle){const g=this.helper,m=this.dragElementOriginStyle.transition||null;g.style.transition=this.dragElementOriginStyle.transition="none",A1.originStyleProp.forEach(n=>g.style[n]=this.dragElementOriginStyle[n]||null),setTimeout(()=>g.style.transition=m,50)}return delete this.dragElementOriginStyle,this}_dragFollow(a){const i={left:0,top:0},k=this.helper.style,j=this.dragOffset;k.left=(a.clientX+j.offsetLeft-i.left)*this.dragTransform.xScale+"px",k.top=(a.clientY+j.offsetTop-i.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(a,i,k){let j=0,g=0;k&&(j=this.dragTransform.xOffset,g=this.dragTransform.yOffset);const m=i.getBoundingClientRect();return{left:m.left,top:m.top,offsetLeft:-a.clientX+m.left-j,offsetTop:-a.clientY+m.top-g,width:m.width*this.dragTransform.xScale,height:m.height*this.dragTransform.yScale}}ui(){const a=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect();return{position:{top:(i.top-a.top)*this.dragTransform.yScale,left:(i.left-a.left)*this.dragTransform.xScale}}}}A1.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class I5e extends T5{constructor(a,i={}){super(),this.el=a,this.option=i,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(a,i){super.on(a,i)}off(a){super.off(a)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),Kp&&(this.el.addEventListener("pointerenter",RN),this.el.addEventListener("pointerleave",MN)))}disable(a=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),a||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),Kp&&(this.el.removeEventListener("pointerenter",RN),this.el.removeEventListener("pointerleave",MN)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(a){return Object.keys(a).forEach(i=>this.option[i]=a[i]),this._setupAccept(),this}_mouseEnter(a){if(!Fi.dragElement||!this._canDrop(Fi.dragElement.el))return;a.preventDefault(),a.stopPropagation(),Fi.dropElement&&Fi.dropElement!==this&&Fi.dropElement._mouseLeave(a,!0),Fi.dropElement=this;const i=Yn.initEvent(a,{target:this.el,type:"dropover"});this.option.over&&this.option.over(i,this._ui(Fi.dragElement)),this.triggerEvent("dropover",i),this.el.classList.add("ui-droppable-over")}_mouseLeave(a,i=!1){var k;if(!Fi.dragElement||Fi.dropElement!==this)return;a.preventDefault(),a.stopPropagation();const j=Yn.initEvent(a,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(j,this._ui(Fi.dragElement)),this.triggerEvent("dropout",j),Fi.dropElement===this&&(delete Fi.dropElement,!i)){let g,m=this.el.parentElement;for(;!g&&m;)g=(k=m.ddElement)==null?void 0:k.ddDroppable,m=m.parentElement;g&&g._mouseEnter(a)}}drop(a){a.preventDefault();const i=Yn.initEvent(a,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(i,this._ui(Fi.dragElement)),this.triggerEvent("drop",i)}_canDrop(a){return a&&(!this.accept||this.accept(a))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=a=>a.classList.contains(this.option.accept)||a.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(a){return{draggable:a.el,...a.ui()}}}class k5{static init(a){return a.ddElement||(a.ddElement=new k5(a)),a.ddElement}constructor(a){this.el=a}on(a,i){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(a)>-1?this.ddDraggable.on(a,i):this.ddDroppable&&["drop","dropover","dropout"].indexOf(a)>-1?this.ddDroppable.on(a,i):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(a)>-1&&this.ddResizable.on(a,i),this}off(a){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(a)>-1?this.ddDraggable.off(a):this.ddDroppable&&["drop","dropover","dropout"].indexOf(a)>-1?this.ddDroppable.off(a):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(a)>-1&&this.ddResizable.off(a),this}setupDraggable(a){return this.ddDraggable?this.ddDraggable.updateOption(a):this.ddDraggable=new A1(this.el,a),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(a){return this.ddResizable?this.ddResizable.updateOption(a):this.ddResizable=new K1(this.el,a),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(a){return this.ddDroppable?this.ddDroppable.updateOption(a):this.ddDroppable=new I5e(this.el,a),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class X5e{resizable(a,i,k,j){return this._getDDElements(a,i).forEach(g=>{if(i==="disable"||i==="enable")g.ddResizable&&g.ddResizable[i]();else if(i==="destroy")g.ddResizable&&g.cleanResizable();else if(i==="option")g.setupResizable({[k]:j});else{const m=g.el.gridstackNode.grid;let n=g.el.getAttribute("gs-resize-handles")||m.opts.resizable.handles||"e,s,se";n==="all"&&(n="n,e,s,w,se,sw,ne,nw");const f=!m.opts.alwaysShowResizeHandle;g.setupResizable({...m.opts.resizable,handles:n,autoHide:f,start:i.start,stop:i.stop,resize:i.resize})}}),this}draggable(a,i,k,j){return this._getDDElements(a,i).forEach(g=>{if(i==="disable"||i==="enable")g.ddDraggable&&g.ddDraggable[i]();else if(i==="destroy")g.ddDraggable&&g.cleanDraggable();else if(i==="option")g.setupDraggable({[k]:j});else{const m=g.el.gridstackNode.grid;g.setupDraggable({...m.opts.draggable,start:i.start,stop:i.stop,drag:i.drag})}}),this}dragIn(a,i){return this._getDDElements(a).forEach(k=>k.setupDraggable(i)),this}droppable(a,i,k,j){return typeof i.accept=="function"&&!i._accept&&(i._accept=i.accept,i.accept=g=>i._accept(g)),this._getDDElements(a,i).forEach(g=>{i==="disable"||i==="enable"?g.ddDroppable&&g.ddDroppable[i]():i==="destroy"?g.ddDroppable&&g.cleanDroppable():i==="option"?g.setupDroppable({[k]:j}):g.setupDroppable(i)}),this}isDroppable(a){var i;return!!((i=a==null?void 0:a.ddElement)!=null&&i.ddDroppable&&!a.ddElement.ddDroppable.disabled)}isDraggable(a){var i;return!!((i=a==null?void 0:a.ddElement)!=null&&i.ddDraggable&&!a.ddElement.ddDraggable.disabled)}isResizable(a){var i;return!!((i=a==null?void 0:a.ddElement)!=null&&i.ddResizable&&!a.ddElement.ddResizable.disabled)}on(a,i,k){return this._getDDElements(a).forEach(j=>j.on(i,g=>{k(g,Fi.dragElement?Fi.dragElement.el:g.target,Fi.dragElement?Fi.dragElement.helper:null)})),this}off(a,i){return this._getDDElements(a).forEach(k=>k.off(i)),this}_getDDElements(a,i){const k=a.gridstack||i!=="destroy"&&i!=="disable",j=Yn.getElements(a);return j.length?j.map(g=>g.ddElement||(k?k5.init(g):null)).filter(g=>g):[]}}/*!
4118
+ }`;var ko=_p(function(){return hi(Fr,fi+"return "+Na).apply(i,an)});if(ko.source=Na,rn(ko))throw ko;return ko}function pf(Se){return ge(Se).toLowerCase()}function m0(Se){return ge(Se).toUpperCase()}function Ry(Se,Ae,yt){if(Se=ge(Se),Se&&(yt||Ae===i))return xu(Se);if(!Se||!(Ae=Tu(Ae)))return Se;var Zt=cs(Se),mr=cs(Ae),Fr=Pd(Zt,mr),an=Go(Zt,mr)+1;return Ed(Zt,Fr,an).join("")}function hf(Se,Ae,yt){if(Se=ge(Se),Se&&(yt||Ae===i))return Se.slice(0,pu(Se)+1);if(!Se||!(Ae=Tu(Ae)))return Se;var Zt=cs(Se),mr=Go(Zt,cs(Ae))+1;return Ed(Zt,0,mr).join("")}function My(Se,Ae,yt){if(Se=ge(Se),Se&&(yt||Ae===i))return Se.replace(gt,"");if(!Se||!(Ae=Tu(Ae)))return Se;var Zt=cs(Se),mr=Pd(Zt,cs(Ae));return Ed(Zt,mr).join("")}function jy(Se,Ae){var yt=z,Zt=L;if(Xn(Ae)){var mr="separator"in Ae?Ae.separator:mr;yt="length"in Ae?oi(Ae.length):yt,Zt="omission"in Ae?Tu(Ae.omission):Zt}Se=ge(Se);var Fr=Se.length;if(Os(Se)){var an=cs(Se);Fr=an.length}if(yt>=Fr)return Se;var hn=yt-nl(Zt);if(hn<1)return Zt;var zn=an?Ed(an,0,hn).join(""):Se.slice(0,hn);if(mr===i)return zn+Zt;if(an&&(hn+=zn.length-hn),_i(mr)){if(Se.slice(hn).search(mr)){var xa,wa=zn;for(mr.global||(mr=Tc(mr.source,ge(wt.exec(mr))+"g")),mr.lastIndex=0;xa=mr.exec(wa);)var Na=xa.index;zn=zn.slice(0,Na===i?hn:Na)}}else if(Se.indexOf(Tu(mr),hn)!=hn){var Ya=zn.lastIndexOf(mr);Ya>-1&&(zn=zn.slice(0,Ya))}return zn+Zt}function Wy(Se){return Se=ge(Se),Se&&nt.test(Se)?Se.replace(Ke,hu):Se}var Ky=Sh(function(Se,Ae,yt){return Se+(yt?" ":"")+Ae.toUpperCase()}),$f=oy("toUpperCase");function Is(Se,Ae,yt){return Se=ge(Se),Ae=yt?i:Ae,Ae===i?rl(Se)?Cl(Se):mo(Se):Se.match(Ae)||[]}var _p=xi(function(Se,Ae){try{return Ri(Se,i,Ae)}catch(yt){return rn(yt)?yt:new ui(yt)}}),y0=Yu(function(Se,Ae){return Ka(Ae,function(yt){yt=Zi(yt),we(Se,yt,Do(Se[yt],Se))}),Se});function jd(Se){var Ae=Se==null?0:Se.length,yt=wi();return Se=Ae?Ti(Se,function(Zt){if(typeof Zt[1]!="function")throw new gs(m);return[yt(Zt[0]),Zt[1]]}):[],xi(function(Zt){for(var mr=-1;++mr<Ae;){var Fr=Se[mr];if(Ri(Fr[0],this,Zt))return Ri(Fr[1],this,Zt)}})}function vg(Se){return ot(Xe(Se,_))}function em(Se){return function(){return Se}}function fl(Se,Ae){return Se==null||Se!==Se?Ae:Se}var lc=Gp(),nd=Gp(!0);function ls(Se){return Se}function Vu(Se){return Wi(typeof Se=="function"?Se:Xe(Se,_))}function Wd(Se){return Ai(Xe(Se,_))}function g0(Se,Ae){return Bi(Se,Xe(Ae,_))}var R2=xi(function(Se,Ae){return function(yt){return jn(yt,Se,Ae)}}),M2=xi(function(Se,Ae){return function(yt){return jn(Se,yt,Ae)}});function v0(Se,Ae,yt){var Zt=ba(Ae),mr=Hr(Ae,Zt);yt==null&&!(Xn(Ae)&&(mr.length||!Zt.length))&&(yt=Ae,Ae=Se,Se=this,mr=Hr(Ae,ba(Ae)));var Fr=!(Xn(yt)&&"chain"in yt)||!!yt.chain,an=bn(Se);return Ka(mr,function(hn){var zn=Ae[hn];Se[hn]=zn,an&&(Se.prototype[hn]=function(){var xa=this.__chain__;if(Fr||xa){var wa=Se(this.__wrapped__),Na=wa.__actions__=jc(this.__actions__);return Na.push({func:zn,args:arguments,thisArg:Se}),wa.__chain__=xa,wa}return zn.apply(Se,zs([this.value()],arguments))})}),Se}function bg(){return Ln._===this&&(Ln._=El),this}function ap(){}function j2(Se){return Se=oi(Se),xi(function(Ae){return qo(Ae,Se)})}var xg=Vf(Ti),wg=Vf(yl),W2=Vf(Ns);function K2(Se){return Zh(Se)?Zl(Zi(Se)):Tl(Se)}function _g(Se){return function(Ae){return Se==null?i:tn(Se,Ae)}}var A2=fp(),I2=fp(!0);function b0(){return[]}function Ay(){return!1}function x0(){return{}}function X2(){return""}function Iy(){return!0}function X5(Se,Ae){if(Se=oi(Se),Se<1||Se>R)return[];var yt=X,Zt=mi(Se,X);Ae=wi(Ae),Se-=X;for(var mr=Yc(Zt,Ae);++yt<Se;)Ae(yt);return mr}function D2(Se){return st(Se)?Ti(Se,Zi):Ii(Se)?[Se]:jc($h(ge(Se)))}function D5(Se){var Ae=++is;return ge(Se)+Ae}var J5=hp(function(Se,Ae){return Se+Ae},0),B5=mp("ceil"),G5=hp(function(Se,Ae){return Se/Ae},1),Z5=mp("floor");function H5(Se){return Se&&Se.length?Ct(Se,ls,qn):i}function Y5(Se,Ae){return Se&&Se.length?Ct(Se,wi(Ae,2),qn):i}function Q5(Se){return zl(Se,ls)}function Sp(Se,Ae){return zl(Se,wi(Ae,2))}function Xy(Se){return Se&&Se.length?Ct(Se,ls,Ki):i}function J2(Se,Ae){return Se&&Se.length?Ct(Se,wi(Ae,2),Ki):i}var w0=hp(function(Se,Ae){return Se*Ae},1),B2=mp("round"),LPe=hp(function(Se,Ae){return Se-Ae},0);function UPe(Se){return Se&&Se.length?cu(Se,ls):0}function qPe(Se,Ae){return Se&&Se.length?cu(Se,wi(Ae,2)):0}return dr.after=s0,dr.ary=Ss,dr.assign=Me,dr.assignIn=He,dr.assignInWith=$e,dr.assignWith=ft,dr.at=bt,dr.before=Hf,dr.bind=Do,dr.bindAll=y0,dr.bindKey=l0,dr.castArray=cf,dr.chain=su,dr.chunk=Pu,dr.compact=Zm,dr.concat=gy,dr.cond=jd,dr.conforms=vg,dr.constant=em,dr.countBy=Cy,dr.create=Mt,dr.curry=Yf,dr.curryRight=c0,dr.debounce=u0,dr.defaults=Xt,dr.defaultsDeep=$t,dr.defer=Fy,dr.delay=d0,dr.difference=ig,dr.differenceBy=vy,dr.differenceWith=og,dr.drop=sg,dr.dropRight=tf,dr.dropRightWhile=by,dr.dropWhile=lg,dr.fill=cg,dr.filter=mg,dr.flatMap=a0,dr.flatMapDeep=bp,dr.flatMapDepth=sf,dr.flatten=$p,dr.flattenDeep=xy,dr.flattenDepth=wy,dr.flip=tp,dr.flow=lc,dr.flowRight=nd,dr.fromPairs=F2,dr.functions=Sn,dr.functionsIn=on,dr.groupBy=Xf,dr.initial=Hm,dr.intersection=Ef,dr.intersectionBy=au,dr.intersectionWith=rf,dr.invert=Ra,dr.invertBy=Qa,dr.invokeMap=Md,dr.iteratee=Vu,dr.keyBy=xp,dr.keys=ba,dr.keysIn=Ma,dr.map=lf,dr.mapKeys=Xa,dr.mapValues=Pa,dr.matches=Wd,dr.matchesProperty=g0,dr.memoize=Ac,dr.merge=ua,dr.mergeWith=Da,dr.method=R2,dr.methodOf=M2,dr.mixin=v0,dr.negate=Uh,dr.nthArg=j2,dr.omit=Ba,dr.omitBy=ci,dr.once=$s,dr.orderBy=o0,dr.over=xg,dr.overArgs=qh,dr.overEvery=wg,dr.overSome=W2,dr.partial=$u,dr.partialRight=zh,dr.partition=yg,dr.pick=To,dr.pickBy=bo,dr.property=K2,dr.propertyOf=_g,dr.pull=eh,dr.pullAll=bc,dr.pullAllBy=Ff,dr.pullAllWith=Rf,dr.pullAt=ou,dr.range=A2,dr.rangeRight=I2,dr.rearg=Ch,dr.reject=Jf,dr.remove=Sy,dr.rest=Ph,dr.reverse=Mf,dr.sampleSize=Bf,dr.set=Ic,dr.setWith=dl,dr.shuffle=Gf,dr.slice=af,dr.sortBy=Zf,dr.sortedUniq=th,dr.sortedUniqBy=xc,dr.split=rd,dr.spread=ih,dr.tail=e0,dr.take=t0,dr.takeRight=Ty,dr.takeRightWhile=pg,dr.takeWhile=ky,dr.tap=n0,dr.throttle=pd,dr.thru=Fd,dr.toArray=Ll,dr.toPairs=Ks,dr.toPairsIn=wc,dr.toPath=D2,dr.toPlainObject=J,dr.transform=ic,dr.unary=p0,dr.union=Ny,dr.unionBy=Vy,dr.unionWith=Oy,dr.uniq=hg,dr.uniqBy=fg,dr.uniqWith=Ly,dr.unset=Ts,dr.unzip=rh,dr.unzipWith=Qu,dr.update=ys,dr.updateWith=Jl,dr.values=Qo,dr.valuesIn=pl,dr.without=r0,dr.words=Is,dr.wrap=Nu,dr.xor=Oh,dr.xorBy=jf,dr.xorWith=Wf,dr.zip=Kf,dr.zipObject=Af,dr.zipObjectDeep=nh,dr.zipWith=Uy,dr.entries=Ks,dr.entriesIn=wc,dr.extend=He,dr.extendWith=$e,v0(dr,dr),dr.add=J5,dr.attempt=_p,dr.camelCase=ks,dr.capitalize=qs,dr.ceil=B5,dr.clamp=oc,dr.clone=Ol,dr.cloneDeep=h0,dr.cloneDeepWith=M,dr.cloneWith=rp,dr.conformsTo=Z,dr.deburr=ro,dr.defaultTo=fl,dr.divide=G5,dr.endsWith=hl,dr.eq=pe,dr.escape=sc,dr.escapeRegExp=As,dr.every=Py,dr.find=of,dr.findIndex=ug,dr.findKey=ar,dr.findLast=If,dr.findLastIndex=Pf,dr.findLastKey=pr,dr.floor=Z5,dr.forEach=Vo,dr.forEachRight=i0,dr.forIn=kr,dr.forInRight=br,dr.forOwn=jr,dr.forOwnRight=Dr,dr.get=mn,dr.gt=Ne,dr.gte=De,dr.has=Jn,dr.hasIn=Sa,dr.head=_y,dr.identity=ls,dr.includes=Rd,dr.indexOf=dg,dr.inRange=Xc,dr.invoke=za,dr.isArguments=Ye,dr.isArray=st,dr.isArrayBuffer=Ot,dr.isArrayLike=Kt,dr.isArrayLikeObject=er,dr.isBoolean=nr,dr.isBuffer=lr,dr.isDate=vr,dr.isElement=fr,dr.isEmpty=Er,dr.isEqual=Kr,dr.isEqualWith=ln,dr.isError=rn,dr.isFinite=Tn,dr.isFunction=bn,dr.isInteger=Rn,dr.isLength=Dn,dr.isMap=ca,dr.isMatch=Va,dr.isMatchWith=Fa,dr.isNaN=di,dr.isNative=Ga,dr.isNil=$a,dr.isNull=ii,dr.isNumber=Ia,dr.isObject=Xn,dr.isObjectLike=ha,dr.isPlainObject=Ci,dr.isRegExp=_i,dr.isSafeInteger=Co,dr.isSet=ri,dr.isString=eo,dr.isSymbol=Ii,dr.isTypedArray=to,dr.isUndefined=jo,dr.isWeakMap=Po,dr.isWeakSet=Ms,dr.join=Nh,dr.kebabCase=ed,dr.last=iu,dr.lastIndexOf=Kc,dr.lowerCase=np,dr.lowerFirst=Dc,dr.lt=Jo,dr.lte=js,dr.max=H5,dr.maxBy=Y5,dr.mean=Q5,dr.meanBy=Sp,dr.min=Xy,dr.minBy=J2,dr.stubArray=b0,dr.stubFalse=Ay,dr.stubObject=x0,dr.stubString=X2,dr.stubTrue=Iy,dr.multiply=w0,dr.nth=nf,dr.noConflict=bg,dr.noop=ap,dr.now=dd,dr.pad=xo,dr.padEnd=ss,dr.padStart=Fu,dr.parseInt=td,dr.random=_c,dr.reduce=gg,dr.reduceRight=Df,dr.repeat=Qf,dr.replace=f0,dr.result=Ws,dr.round=B2,dr.runInContext=yn,dr.sample=Ey,dr.size=ep,dr.snakeCase=uf,dr.some=wp,dr.sortedIndex=Vl,dr.sortedIndexBy=Ym,dr.sortedIndexOf=Vh,dr.sortedLastIndex=zo,dr.sortedLastIndexBy=Qm,dr.sortedLastIndexOf=$m,dr.startCase=Eh,dr.startsWith=Ru,dr.subtract=LPe,dr.sum=UPe,dr.sumBy=qPe,dr.template=df,dr.times=X5,dr.toFinite=Yo,dr.toInteger=oi,dr.toLength=Dl,dr.toLower=pf,dr.toNumber=Q,dr.toSafeInteger=se,dr.toString=ge,dr.toUpper=m0,dr.trim=Ry,dr.trimEnd=hf,dr.trimStart=My,dr.truncate=jy,dr.unescape=Wy,dr.uniqueId=D5,dr.upperCase=Ky,dr.upperFirst=$f,dr.each=Vo,dr.eachRight=i0,dr.first=_y,v0(dr,(function(){var Se={};return Ar(dr,function(Ae,yt){Vi.call(dr.prototype,yt)||(Se[yt]=Ae)}),Se})(),{chain:!1}),dr.VERSION=k,Ka(["bind","bindKey","curry","curryRight","partial","partialRight"],function(Se){dr[Se].placeholder=dr}),Ka(["drop","take"],function(Se,Ae){si.prototype[Se]=function(yt){yt=yt===i?1:qi(oi(yt),0);var Zt=this.__filtered__&&!Ae?new si(this):this.clone();return Zt.__filtered__?Zt.__takeCount__=mi(yt,Zt.__takeCount__):Zt.__views__.push({size:mi(yt,X),type:Se+(Zt.__dir__<0?"Right":"")}),Zt},si.prototype[Se+"Right"]=function(yt){return this.reverse()[Se](yt).reverse()}}),Ka(["filter","map","takeWhile"],function(Se,Ae){var yt=Ae+1,Zt=yt==N||yt==T;si.prototype[Se]=function(mr){var Fr=this.clone();return Fr.__iteratees__.push({iteratee:wi(mr,3),type:yt}),Fr.__filtered__=Fr.__filtered__||Zt,Fr}}),Ka(["head","last"],function(Se,Ae){var yt="take"+(Ae?"Right":"");si.prototype[Se]=function(){return this[yt](1).value()[0]}}),Ka(["initial","tail"],function(Se,Ae){var yt="drop"+(Ae?"":"Right");si.prototype[Se]=function(){return this.__filtered__?new si(this):this[yt](1)}}),si.prototype.compact=function(){return this.filter(ls)},si.prototype.find=function(Se){return this.filter(Se).head()},si.prototype.findLast=function(Se){return this.reverse().find(Se)},si.prototype.invokeMap=xi(function(Se,Ae){return typeof Se=="function"?new si(this):this.map(function(yt){return jn(yt,Se,Ae)})}),si.prototype.reject=function(Se){return this.filter(Uh(wi(Se)))},si.prototype.slice=function(Se,Ae){Se=oi(Se);var yt=this;return yt.__filtered__&&(Se>0||Ae<0)?new si(yt):(Se<0?yt=yt.takeRight(-Se):Se&&(yt=yt.drop(Se)),Ae!==i&&(Ae=oi(Ae),yt=Ae<0?yt.dropRight(-Ae):yt.take(Ae-Se)),yt)},si.prototype.takeRightWhile=function(Se){return this.reverse().takeWhile(Se).reverse()},si.prototype.toArray=function(){return this.take(X)},Ar(si.prototype,function(Se,Ae){var yt=/^(?:filter|find|map|reject)|While$/.test(Ae),Zt=/^(?:head|last)$/.test(Ae),mr=dr[Zt?"take"+(Ae=="last"?"Right":""):Ae],Fr=Zt||/^find/.test(Ae);mr&&(dr.prototype[Ae]=function(){var an=this.__wrapped__,hn=Zt?[1]:arguments,zn=an instanceof si,xa=hn[0],wa=zn||st(an),Na=function(Eo){var Bo=mr.apply(dr,zs([Eo],hn));return Zt&&Ya?Bo[0]:Bo};wa&&yt&&typeof xa=="function"&&xa.length!=1&&(zn=wa=!1);var Ya=this.__chain__,fi=!!this.__actions__.length,Pi=Fr&&!Ya,ko=zn&&!fi;if(!Fr&&wa){an=ko?an:new si(this);var Ei=Se.apply(an,hn);return Ei.__actions__.push({func:Fd,args:[Na],thisArg:i}),new _o(Ei,Ya)}return Pi&&ko?Se.apply(this,hn):(Ei=this.thru(Na),Pi?Zt?Ei.value()[0]:Ei.value():Ei)})}),Ka(["pop","push","shift","sort","splice","unshift"],function(Se){var Ae=il[Se],yt=/^(?:push|sort|unshift)$/.test(Se)?"tap":"thru",Zt=/^(?:pop|shift)$/.test(Se);dr.prototype[Se]=function(){var mr=arguments;if(Zt&&!this.__chain__){var Fr=this.value();return Ae.apply(st(Fr)?Fr:[],mr)}return this[yt](function(an){return Ae.apply(st(an)?an:[],mr)})}}),Ar(si.prototype,function(Se,Ae){var yt=dr[Ae];if(yt){var Zt=yt.name+"";Vi.call(Xi,Zt)||(Xi[Zt]=[]),Xi[Zt].push({name:Ae,func:yt})}}),Xi[Xh(i,p).name]=[{name:"wrapper",func:i}],si.prototype.clone=hs,si.prototype.reverse=yu,si.prototype.value=Oa,dr.prototype.at=Eu,dr.prototype.chain=ah,dr.prototype.commit=Lh,dr.prototype.next=gp,dr.prototype.plant=ud,dr.prototype.reverse=qy,dr.prototype.toJSON=dr.prototype.valueOf=dr.prototype.value=zy,dr.prototype.first=dr.prototype.head,Ko&&(dr.prototype[Ko]=vp),dr}),al=$l();ka?((ka.exports=al)._=al,Hn._=al):Ln._=al}).call(Ewe)})(l2,l2.exports)),l2.exports}var w5=Fwe();const Rwe=["x","y"],Mwe=["fill"],jwe={fill:"white","font-size":"8",x:"9.5",y:"10","font-family":"Montserrat-Regular","dominant-baseline":"middle","text-anchor":"middle"},c2={__name:"ChalkboardMarker",props:{x:Number,y:Number,color:String,jersey:Number,orientation:{type:String,default:"vertical"}},setup(e){return(a,i)=>(r.openBlock(),r.createElementBlock("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",x:`${e.x}%`,y:`${e.y}%`},[i[0]||(i[0]=r.createElementVNode("path",{opacity:"0.8",d:"M19.0921 9.65161C19.0921 4.54754 14.838 0.406006 9.59065 0.406006C4.34332 0.406006 0.09375 4.54754 0.09375 9.65161C0.09375 14.7557 4.34785 18.8972 9.59065 18.8972C14.8334 18.8972 19.0875 14.7557 19.0875 9.65161H19.0921Z",fill:"white"},null,-1)),r.createElementVNode("path",{d:"M9.58983 17.4931C14.0383 17.4931 17.6445 13.9824 17.6445 9.6516C17.6445 5.32084 14.0383 1.81006 9.58983 1.81006C5.14136 1.81006 1.53516 5.32084 1.53516 9.6516C1.53516 13.9824 5.14136 17.4931 9.58983 17.4931Z",fill:e.color},null,8,Mwe),i[1]||(i[1]=r.createElementVNode("path",{style:{"mix-blend-mode":"multiply"},opacity:"1",d:"M18.2312 20.0011C18.2312 21.4228 14.2719 22.5708 9.38741 22.5708C4.50291 22.5708 0.539062 21.4184 0.539062 20.0011C0.539062 18.5838 4.49837 17.4314 9.38288 17.4314C14.2674 17.4314 18.2267 18.5838 18.2267 20.0011H18.2312Z",fill:"url(#paint0_radial_249_64014)"},null,-1)),r.createElementVNode("text",jwe,r.toDisplayString(e.jersey),1),i[2]||(i[2]=r.createElementVNode("defs",null,[r.createElementVNode("radialGradient",{id:"paint0_radial_249_64014",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.76498 20.0631) scale(8.68186 2.33162)"},[r.createElementVNode("stop",{"stop-color":"#808080"}),r.createElementVNode("stop",{offset:"1","stop-color":"#CCCBCB","stop-opacity":"0"})])],-1))],8,Rwe))}},Wwe=["x","y"],Kwe=["fill"],Awe=["href"],LN={__name:"ChalkboardMarkerLogo",props:{x:Number,y:Number,color:{type:String,default:"#FFFFFF"},logo:String,orientation:{type:String,default:"vertical"}},setup(e){return(a,i)=>(r.openBlock(),r.createElementBlock("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",x:`${e.x}%`,y:`${e.y}%`},[i[0]||(i[0]=r.createElementVNode("path",{opacity:"0.8",d:"M19.0921 9.65161C19.0921 4.54754 14.838 0.406006 9.59065 0.406006C4.34332 0.406006 0.09375 4.54754 0.09375 9.65161C0.09375 14.7557 4.34785 18.8972 9.59065 18.8972C14.8334 18.8972 19.0875 14.7557 19.0875 9.65161H19.0921Z",fill:"white"},null,-1)),r.createElementVNode("path",{d:"M9.58983 17.4931C14.0383 17.4931 17.6445 13.9824 17.6445 9.6516C17.6445 5.32084 14.0383 1.81006 9.58983 1.81006C5.14136 1.81006 1.53516 5.32084 1.53516 9.6516C1.53516 13.9824 5.14136 17.4931 9.58983 17.4931Z",fill:e.color},null,8,Kwe),i[1]||(i[1]=r.createElementVNode("path",{style:{"mix-blend-mode":"multiply"},opacity:"1",d:"M18.2312 20.0011C18.2312 21.4228 14.2719 22.5708 9.38741 22.5708C4.50291 22.5708 0.539062 21.4184 0.539062 20.0011C0.539062 18.5838 4.49837 17.4314 9.38288 17.4314C14.2674 17.4314 18.2267 18.5838 18.2267 20.0011H18.2312Z",fill:"url(#paint0_radial_249_64014)"},null,-1)),e.logo?(r.openBlock(),r.createElementBlock("image",{key:0,href:e.logo,x:"2",y:"2",width:"16",height:"16",preserveAspectRatio:"xMidYMid meet"},null,8,Awe)):r.createCommentVNode("",!0),i[2]||(i[2]=r.createElementVNode("defs",null,[r.createElementVNode("radialGradient",{id:"paint0_radial_249_64014",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.76498 20.0631) scale(8.68186 2.33162)"},[r.createElementVNode("stop",{"stop-color":"#808080"}),r.createElementVNode("stop",{offset:"1","stop-color":"#CCCBCB","stop-opacity":"0"})])],-1))],8,Wwe))}},Iwe=["id"],Xwe=["fill"],UN={__name:"ChalkboardGraphic",props:{orientation:{type:String,required:!0},id:{type:String,required:!0},uniqueId:{type:String,required:!0}},setup(e){return(a,i)=>(r.openBlock(),r.createElementBlock("g",{id:e.id,class:r.normalizeClass(e.orientation)},[r.createElementVNode("rect",{opacity:"1",height:"411",width:"256",fill:`url(#${e.uniqueId}-fieldBackground)`},null,8,Xwe),i[0]||(i[0]=r.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="256" height="411" viewBox="0 0 256 411" fill="none"><rect x="0.53125" y="0.5" width="254.03" height="410" stroke="#fff"></rect><rect x="15.5312" y="14.5" width="224" height="382" stroke="#fff"></rect><rect x="69.5312" y="14.5" width="116" height="53" stroke="#fff"></rect><rect x="96.5312" y="14.5" width="62" height="29" stroke="#fff"></rect><rect x="69.5312" y="343.5" width="116" height="53" stroke="#fff"></rect><rect x="96.5312" y="367.5" width="62" height="29" stroke="#fff"></rect><path d="M15.5312 205.5H240.031" stroke="#fff"></path><circle cx="128.031" cy="206" r="36.5" stroke="#fff"></circle></svg>',1))],10,Iwe))}},Dwe=["viewBox"],Jwe=["viewBox"],Bwe=["id"],Gwe=["id"],Zwe=["fill"],Hwe=["id"],Ywe=["id"],Qwe=["id"],$we=["id"],e5e=["id","onMouseover","onClick"],t5e=["x1","y1","x2","y2","stroke"],r5e=["x1","y1","x2","y2","stroke","marker-end"],n5e={class:"is-pointer",transform:"translate(-11, -11)"},a5e={key:0,class:"is-pointer",transform:"translate(-11, -11)"},i5e=["id","onMouseover","onClick"],o5e=["x1","y1","x2","y2","stroke","marker-end"],s5e={class:"is-pointer",transform:"translate(-11, -11)"},l5e=["id","onMouseover","onClick"],c5e={class:"tooltip-data__title"},u5e={class:"tooltip-data__player"},d5e={class:"tooltip-data__content"},p5e={class:"tooltip-data__content"},h5e=["src"],f5e={key:0,class:"tooltip-data__content"},m5e={key:1,class:"tooltip-data__content"},y5e={class:"tooltip-data__button-play-container"},g5e={class:"tooltip-data__button-play"},Z0=250/2,qN="https://golstatsimages.blob.core.windows.net/teams-80/",v5e={__name:"XgChalkboard",props:{areLogsVisible:{type:Boolean,default:!1},plays:{type:Array,require:!0},categories:{type:Array,required:!0},players:{type:Array,required:!0},games:{type:Array,default:()=>[]},team:{type:Number,default:0},playValuesIndex:{type:Object,required:!0},analysisType:{type:String,required:!1},sectionType:{type:String,required:!1,default:"team"},orientation:{type:String,required:!1,default:"horizontal"},canPlayVideos:{type:Boolean,default:!0},isAssistZoneVisible:{type:Boolean,default:!1},componentWidth:{type:Number,default:600},isTooltipAvailable:{type:Boolean,default:!1},uniqueId:{type:String,required:!0}},emits:["openmedia","change-xg","change-total-plays"],setup(e,{emit:a}){let i=null;const k=r.ref(null),j=r.ref(null);r.defineComponent({Tooltip:NN,ChalkboardMarker:c2,ChalkboardMarkerLogo:LN,ChalkboardGraphic:UN});const g=a,m=e,n=r.ref(!1),f=r.ref("red"),l=r.ref({x:0,y:0,visible:!1}),t=r.ref({playerName:"",minute:0,rivalLogo:"",categoryName:"",category:"",xGi:0,xGf:0,isOwnGoal:!1}),_=r.ref(!1),b=r.computed(()=>m.componentWidth<565),v=r.computed(()=>m.orientation==="horizontal"?m.componentWidth>384?"0 0 411 256":"0 0 784 490":m.componentWidth>384?"0 0 256 411":"0 0 490 784"),h=r.computed(()=>m.componentWidth<384),o=r.computed(()=>m.sectionType==="team"?[0,1,2,8]:X.value.position_id===1?[]:[0,3,4,10]),s=r.computed(()=>m.plays.map(H=>({playId:H[m.playValuesIndex.playId],gameId:H[m.playValuesIndex.gameId],teamId:H[m.playValuesIndex.teamId],playerId:H[m.playValuesIndex.playerId],momentOfPlay:H[m.playValuesIndex.momentOfPlay],categoryId:H[m.playValuesIndex.categoryId],categoryType:H[m.playValuesIndex.categoryType],matchLapse:H[m.playValuesIndex.matchLapse],section:H[m.playValuesIndex.section],matchResult:H[m.playValuesIndex.matchResult],playingAs:H[m.playValuesIndex.playingAs],total:H[m.playValuesIndex.total],x1:m.orientation==="horizontal"?100-H[m.playValuesIndex.coordinate1Y]*100:H[m.playValuesIndex.coordinate1X]*100,y1:m.orientation==="horizontal"?H[m.playValuesIndex.coordinate1X]*100:H[m.playValuesIndex.coordinate1Y]*100,x2:m.orientation==="horizontal"?100-H[m.playValuesIndex.coordinate2Y]*100:H[m.playValuesIndex.coordinate2X]*100,y2:m.orientation==="horizontal"?H[m.playValuesIndex.coordinate2X]*100:H[m.playValuesIndex.coordinate2Y]*100,x3:m.orientation==="horizontal"?100-H[m.playValuesIndex.coordinate3Y]*100:H[m.playValuesIndex.coordinate3X]*100,y3:m.orientation==="horizontal"?H[m.playValuesIndex.coordinate3X]*100:H[m.playValuesIndex.coordinate3Y]*100,xGi:H[m.playValuesIndex.xGi],xGf:H[m.playValuesIndex.xGf]}))),p=r.computed(()=>m.categories.map((H,ne)=>({id:ne,name:H.name,singleName:H.singleName,negative:H.negative||!1,color:H.color,points:H.points,numPoints:H.points.length,categories:H.categories,invert:H.invert||[]}))),c=r.computed(()=>m.isAssistZoneVisible?m.analysisType==="offensive"?2:3:1),d=r.computed(()=>{const H=p.value.filter(({numPoints:ne})=>ne===1).map(ne=>ne.categories).flat();return[...new Set(H)]}),x=r.computed(()=>{const H=p.value.filter(ne=>ne.numPoints===2).map(ne=>ne.categories).flat();return[...new Set(H)]}),w=r.computed(()=>{const H=p.value.filter(ne=>ne.numPoints===3).map(ne=>ne.categories).flat();return[...new Set(H)]}),S=r.computed(()=>{let H=d.value;return s.value.filter(ne=>C(H,ne)).reduce((ne,B)=>{let re=p.value.find($=>C($.categories,B)),ee=m.players.find($=>$.player_id===B.playerId),Y=m.games.find($=>$?$.gameId===B.gameId||$.game_id===B.gameId:void 0);if(re&&ee&&Y){let $={category:re.id,categoryName:re.name,categorySingleName:re.singleName,color:re.color,playId:B.playId,player:B.playerId,playerName:ee?ee.player_name||ee.name:"",playerImage:ee?ee.player_photo||ee.photo:"",jersey:ee&&(ee.jersey||ee.jersey_number)||"",matchlapse:B.matchLapse,x1:re.invert.includes(B.categoryId)?100-B[`x${re.points[0]}`]:B[`x${re.points[0]}`],y1:re.invert.includes(B.categoryId)?100-B[`y${re.points[0]}`]:B[`y${re.points[0]}`],momentOfPlay:B.momentOfPlay,rivalLogo:q(Y,B)};m.analysisType==="offensive"&&o.value.includes(re.id)&&($.xGi=B.xGi,$.xGf=B.xGf),ne.push($)}return ne},[])}),V=r.computed(()=>{let H=x.value;return s.value.filter(ne=>C(H,ne)).reduce((ne,B)=>{let re=p.value.find($=>C($.categories,B)),ee=m.players.find($=>$.player_id===B.playerId),Y=m.games.find($=>$?$.gameId===B.gameId||$.game_id===B.gameId:void 0);if(re&&ee&&Y){let $={category:re.id,categoryName:re.name,categorySingleName:re.singleName,arrowColor:re.negative?f.value:re.color,arrowMarkerColor:re.negative?`url(#${m.uniqueId}-arrow-negative)`:`url(#${m.uniqueId}-arrow-${re.id})`,markerColor:re.color,playId:B.playId,player:B.playerId,playerName:ee?ee.player_name||ee.name:"",playerImage:ee?ee.player_photo||ee.photo:"",jersey:ee&&(ee.jersey||ee.jersey_number)||"",matchlapse:B.matchLapse,x1:re.invert.includes(B.categoryId)?100-B[`x${re.points[0]}`]:B[`x${re.points[0]}`],y1:re.invert.includes(B.categoryId)?100-B[`y${re.points[0]}`]:B[`y${re.points[0]}`],x2:re.invert.includes(B.categoryId)?100-B[`x${re.points[1]}`]:B[`x${re.points[1]}`],y2:re.invert.includes(B.categoryId)?100-B[`y${re.points[1]}`]:B[`y${re.points[1]}`],momentOfPlay:B.momentOfPlay,rivalLogo:q(Y,B)};m.analysisType==="offensive"&&o.value.includes(re.id)&&($.xGi=B.xGi,$.xGf=B.xGf),ne.push($)}return ne},[])}),O=r.computed(()=>{let H=w.value;return s.value.filter(ne=>C(H,ne)).reduce((ne,B)=>{let re=p.value.find($=>C($.categories,B)),ee=m.players.find($=>$.player_id===B.playerId),Y=m.games.find($=>$?$.gameId===B.gameId||$.game_id===B.gameId:void 0);if(re&&ee&&Y){let $={category:re.id,categoryName:re.name,categorySingleName:re.singleName,arrowColor:re.negative?f.value:re.color,arrowMarkerColor:re.negative?`url(#${m.uniqueId}-arrow-negative)`:`url(#${m.uniqueId}-arrow-${re.id})`,markerColor:re.color,playId:B.playId,player:B.playerId,playerName:ee?ee.player_name||ee.name:"",playerImage:ee?ee.player_photo||ee.photo:"",jersey:ee&&(ee.jersey||ee.jersey_number)||"",matchlapse:B.matchLapse,x1:re.invert.includes(B.categoryId)?100-B[`x${re.points[0]}`]:B[`x${re.points[0]}`],y1:re.invert.includes(B.categoryId)?100-B[`y${re.points[0]}`]:B[`y${re.points[0]}`],x2:re.invert.includes(B.categoryId)?100-B[`x${re.points[1]}`]:B[`x${re.points[1]}`],y2:re.invert.includes(B.categoryId)?100-B[`y${re.points[1]}`]:B[`y${re.points[1]}`],x3:re.invert.includes(B.categoryId)?100-B[`x${re.points[2]}`]:B[`x${re.points[2]}`],y3:re.invert.includes(B.categoryId)?100-B[`y${re.points[2]}`]:B[`y${re.points[2]}`],momentOfPlay:B.momentOfPlay,rivalLogo:q(Y,B)};re.id===0&&m.analysisType==="offensive"&&B.teamId?$.isOwnGoal=m.team!==B.teamId:re.id===0&&m.analysisType==="defensive"&&B.teamId?$.isOwnGoal=m.team===B.teamId:$.isOwnGoal=!1,m.analysisType==="offensive"&&o.value.includes(re.id)&&($.xGi=B.xGi,$.xGf=B.xGf),ne.push($)}return ne},[])}),U=()=>{!j.value||j.value.contains(event.target)||(h.value&&(n.value||z()),n.value=!1)},z=()=>{l.value.visible=!1},L=(H,ne,B=null)=>{const re=s.value.find(ue=>ue.playId===H.playId),ee=B!==null?m.categories[B].name:H.categoryName;let Y={};const $=m.categories.find(ue=>ue.id===H.category),le=$?$.categories:[];if(ne===2&&!h.value){const ue=m.sectionType==="team"&&m.analysisType==="defensive"&&ee.includes("recibidos");Y={seasonId:selectedSeasonIdFilterOptions.value,categoryIds:le,categorySingleName:"",mainSectionType:1,playListType:m.sectionType==="team"?3:2,matchResult:selectedGameResultsFilterOptions.value,playData:re||null,gameIds:selectedGamesIdsFilterOptions.value,isRivalSubject:ue,avoidCategorySingleName:ue,advancedFilter:{playListTitle:ee,mainCategoryId:{},playingAs:selectedPlayingAsFilterOptions.value?[selectedPlayingAsFilterOptions.value]:[1,2],timeSections:selectedGameTimePeriodsFilterOptions.value,fieldSections:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]}}}if(ne===1){const ue=m.sectionType==="team"&&ee.includes("recibidos");Y={seasonId:selectedSeasonIdFilterOptions.value,categoryIds:le,categorySingleName:"",mainSectionType:1,playListType:m.sectionType==="team"?3:2,gameIds:selectedGamesIdsFilterOptions.value,matchResult:selectedGameResultsFilterOptions.value,playData:re||null,isRivalSubject:ue,avoidCategorySingleName:ue,advancedFilter:{playListTitle:ee,mainCategoryId:{},playingAs:selectedPlayingAsFilterOptions.value?[selectedPlayingAsFilterOptions.value]:[1,2],timeSections:selectedGameTimePeriodsFilterOptions.value,fieldSections:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]}}}const ie=m.sectionType==="team";ne===1?ie&&teamId.value?(Y.playerIds=[],Y.teamId=teamId.value):ie||(Y.playerIds=re?[re.playerId]:null,Y.teamId=0):h.value||(ie&&teamId.value?(Y.playerIds=[],Y.teamId=teamId.value):ie||(Y.playerIds=re?[re.playerId]:null,Y.teamId=0)),ne===1?g("openmedia",Y):h.value||g("openmedia",Y)},C=(H,ne)=>H.find(B=>{let re=0;if(typeof B=="string"){if(ne.teamId)return re=Number(B.split("_").shift()),re===ne.categoryId&&ne.teamId!==m.team}else return ne.teamId?B===ne.categoryId&&m.team===ne.teamId:B===ne.categoryId;return!1}),q=(H,ne)=>{if(m.sectionType==="team"){const re=H.homeTeamId===m.team||H.home_team===m.team?H.visiting_team:H.home_team;return`${qN}${re}.png`}const B=ne.playingAs===1?H.visiting_team:H.home_team;return`${qN}${B}.png`},N=()=>{if(window.ResizeObserver)i=new ResizeObserver(()=>{_.value=k.value&&k.value.clientWidth>524}),i.observe(k.value);else throw new Error("Resize observer not supported!")};function P(){b.value&&L(T.value.play,T.value.type)}const T=r.ref({play:null,type:null}),E=(H,ne,B)=>{m.isTooltipAvailable&&(n.value=!0,b.value?(T.value={play:ne,type:B},t.value.category=ne.category,t.value.playerName=ne.playerName||"",t.value.playerImage=ne.playerImage||"",t.value.minute=parseInt(ne.momentOfPlay.split(":")[0])||"",t.value.rivalLogo=ne.rivalLogo||"",t.value.categoryName=ne.categoryName||"",t.value.xGi=String(ne.xGi),t.value.xGf=String(ne.xGf),t.value.isOwnGoal=ne.isOwnGoal,l.value.x=H.layerX<Z0+5?5:H.layerX+Z0>k.value.clientWidth?k.value.clientWidth-Z0*2-5:H.layerX,l.value.y=H.layerY+20,l.value.visible=!0):L(ne,B))},R=(H,ne,B)=>{m.isTooltipAvailable&&(T.value={play:ne,type:B},b.value||(t.value.category=ne.category,t.value.playerName=ne.playerName||"",t.value.playerImage=ne.playerImage||"",t.value.minute=parseInt(ne.momentOfPlay.split(":")[0])||"",t.value.rivalLogo=ne.rivalLogo||"",t.value.categoryName=ne.categoryName||"",t.value.xGi=String(ne.xGi),t.value.xGf=String(ne.xGf),t.value.isOwnGoal=ne.isOwnGoal,l.value.x=H.layerX<Z0+5?5:H.layerX+Z0>k.value.clientWidth?k.value.clientWidth-Z0*2-5:H.layerX,l.value.y=H.layerY+20,l.value.visible=!0))},W=()=>{h.value||(l.value.visible=!1)},K=()=>{h.value&&(l.value.visible=!1)},X=r.ref({}),D=r.computed(()=>{const H=w5.groupBy(S.value,"momentOfPlay"),ne=w5.groupBy(V.value,"momentOfPlay"),B=w5.groupBy(O.value,"momentOfPlay");return{playsByMoment1:H,playsByMoment2:ne,playsByMoment3:B}});return r.watch(()=>D.value,H=>{const ne={...H.playsByMoment1,...H.playsByMoment2,...H.playsByMoment3};let B=0;Object.entries(ne).forEach(le=>{o.value.includes(le[1][0].category)&&!le.isOwnGoal&&(B+=Number(le[1][0].xGf))});let re=Object.keys(H.playsByMoment1).length,ee=Object.keys(H.playsByMoment2).length,Y=Object.keys(H.playsByMoment3).length;const $=re+ee+Y;g("change-xg",B),g("change-total-plays",$)},{immediate:!0}),r.onMounted(()=>{document.addEventListener("click",U),N()}),r.onBeforeUnmount(()=>{document.removeEventListener("click",U),i&&(i.disconnect(),i=null)}),(H,ne)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"soccerChalkboard",ref:k,class:r.normalizeClass(["chalkboard__container",e.orientation]),onMouseleave:K},[(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:v.value,"xmlns:xlink":"http://www.w3.org/1999/xlink",class:"soccer-chalkboard"},[(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:e.orientation==="horizontal"?"0 0 411 256":"0 0 256 411","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"svg-soccer-chalkboard"},[r.createElementVNode("defs",null,[r.createElementVNode("marker",{id:`${e.uniqueId}-arrow-negative`,viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"6",markerHeight:"6",markerUnits:"strokeWidth",orient:"auto"},[...ne[0]||(ne[0]=[r.createElementVNode("path",{d:"M 0 0 L 10 5 L 0 10 z","stroke-width":"2",fill:"red"},null,-1)])],8,Bwe),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.value,B=>(r.openBlock(),r.createElementBlock("marker",{key:`${e.uniqueId}-arrow-color-${B.id}`,id:`${e.uniqueId}-arrow-${B.id}`,viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"6",markerHeight:"6",markerUnits:"strokeWidth",orient:"auto"},[r.createElementVNode("path",{d:"M 0 0 L 10 5 L 0 10 z","stroke-width":"2",fill:B.color},null,8,Zwe)],8,Gwe))),128)),r.createElementVNode("pattern",{id:`${e.uniqueId}-fieldBackground`,width:"1",height:"1",viewBox:"0 0 100 100",preserveAspectRatio:"none"},[c.value===1?(r.openBlock(),r.createElementBlock("image",{key:0,"xlink:href":Uwe,width:"100",height:"100",preserveAspectRatio:"none",id:`${e.uniqueId}-image2`},null,8,Ywe)):c.value===2?(r.openBlock(),r.createElementBlock("image",{key:1,"xlink:href":qwe,width:"100",height:"100",preserveAspectRatio:"none",id:`${e.uniqueId}-image2`},null,8,Qwe)):c.value===3?(r.openBlock(),r.createElementBlock("image",{key:2,"xlink:href":zwe,width:"100",height:"100",preserveAspectRatio:"none",id:`${e.uniqueId}-image2`},null,8,$we)):r.createCommentVNode("",!0)],8,Hwe)]),r.createVNode(UN,{id:"soccer-field",orientation:e.orientation,"unique-id":e.uniqueId},null,8,["orientation","unique-id"]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(O.value,B=>(r.openBlock(),r.createElementBlock("g",{key:B.id,id:`play-${B.playId}`,onMouseover:re=>R(re,B,2),onMouseleave:W,onClick:re=>E(re,B,2)},[r.createElementVNode("line",{x1:`${B.x1}%`,y1:`${B.y1}%`,x2:`${B.x2}%`,y2:`${B.y2}%`,stroke:B.arrowColor,"stroke-width":"2"},null,8,t5e),r.createElementVNode("line",{x1:`${B.x2}%`,y1:`${B.y2}%`,x2:`${B.x3}%`,y2:`${B.y3}%`,stroke:B.arrowColor,"stroke-width":"2","marker-end":`${B.arrowMarkerColor}`},null,8,r5e),r.createElementVNode("g",n5e,[r.createVNode(c2,{jersey:B.jersey,color:B.markerColor,x:B.x1,y:B.y1,orientation:e.orientation},null,8,["jersey","color","x","y","orientation"])]),B.categoryName==="Atajadas"||B.categoryName==="Goles recibidos"?(r.openBlock(),r.createElementBlock("g",a5e,[r.createVNode(LN,{color:"#FFFFFF",logo:B.rivalLogo,x:B.x2,y:B.y2,orientation:e.orientation},null,8,["logo","x","y","orientation"])])):r.createCommentVNode("",!0)],40,e5e))),128)),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(V.value,B=>(r.openBlock(),r.createElementBlock("g",{key:B.id,id:`play-${B.playId}`,onMouseover:re=>R(re,B,2),onMouseleave:W,onClick:re=>E(re,B,2)},[r.createElementVNode("line",{x1:`${B.x1}%`,y1:`${B.y1}%`,x2:`${B.x2}%`,y2:`${B.y2}%`,"stroke-width":"2",stroke:B.arrowColor,"marker-end":`${B.arrowMarkerColor}`},null,8,o5e),r.createElementVNode("g",s5e,[r.createVNode(c2,{jersey:B.jersey,color:B.markerColor,x:B.x1,y:B.y1},null,8,["jersey","color","x","y"])])],40,i5e))),128)),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.value,B=>(r.openBlock(),r.createElementBlock("g",{key:B.id,id:`play-${B.playId}`,class:"is-pointer",onMouseover:re=>R(re,B,2),onMouseleave:W,onClick:re=>E(re,B,2),transform:"translate(-11, -11)"},[r.createVNode(c2,{x:B.x1,y:B.y1,jersey:B.jersey,color:B.color},null,8,["x","y","jersey","color"])],40,l5e))),128))],8,Jwe))],8,Dwe)),r.createVNode(NN,{"play-data":l.value,"is-mobile-device":b.value},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["tooltip-data",e.orientation])},[r.createElementVNode("p",c5e,r.toDisplayString(t.value.isOwnGoal?t.value.categoryName=="Goles recibidos"?t.value.categoryName:"Autogol":t.value.categoryName),1),r.createElementVNode("div",u5e,[r.createElementVNode("span",null,r.toDisplayString(t.value.playerName),1),r.createElementVNode("div",{class:"tooltip-data__player-image",style:r.normalizeStyle(`background-image: url(${t.value.playerImage})`)},null,4)]),r.createElementVNode("div",d5e,[r.createElementVNode("span",null,"Minuto: "+r.toDisplayString(t.value.minute),1)]),r.createElementVNode("div",p5e,[r.createElementVNode("span",null,"Rival: "+r.toDisplayString(t.value.rivalName),1),r.createElementVNode("img",{src:t.value.rivalLogo,width:"25",style:{"vertical-align":"middle"}},null,8,h5e)]),/^[+]?([0-1]+(?:[\.][0-9]*)?|\.[0-9]+)$/.test(t.value.xGi)&&t.value.xGi<=1&&!t.value.isOwnGoal?(r.openBlock(),r.createElementBlock("div",f5e,[ne[1]||(ne[1]=r.createElementVNode("span",{class:"bold"},"xGi:",-1)),r.createTextVNode(" "+r.toDisplayString(r.unref(VN)(Number(t.value.xGi),4)),1)])):r.createCommentVNode("",!0),/^[+]?([0-1]+(?:[\.][0-9]*)?|\.[0-9]+)$/.test(t.value.xGf)&&t.value.xGf<=1&&!t.value.isOwnGoal?(r.openBlock(),r.createElementBlock("div",m5e,[ne[2]||(ne[2]=r.createElementVNode("span",{class:"bold"},"xGf:",-1)),r.createTextVNode(" "+r.toDisplayString(r.unref(VN)(Number(t.value.xGf),4)),1)])):r.createCommentVNode("",!0),r.withDirectives(r.createElementVNode("div",y5e,[r.createElementVNode("div",g5e,[r.createElementVNode("div",{role:"button",class:"tooltip-data__button-play__button",onClick:r.withModifiers(P,["stop","prevent"])},[...ne[3]||(ne[3]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 10 10",fill:"none"},[r.createElementVNode("path",{d:"M3.0492 8.92004C2.9831 8.88243 2.92785 8.82624 2.88941 8.75753C2.85097 8.68882 2.83079 8.61018 2.83106 8.53011V1.46888C2.83115 1.38908 2.85146 1.3108 2.88982 1.24236C2.92819 1.17392 2.98318 1.11788 3.04895 1.08019C3.11472 1.0425 3.18881 1.02458 3.26334 1.02832C3.33788 1.03206 3.41007 1.05733 3.47225 1.10145L8.4249 4.63248C8.48147 4.67271 8.52786 4.72726 8.55995 4.79129C8.59204 4.85533 8.60883 4.92685 8.60883 4.9995C8.60883 5.07214 8.59204 5.14367 8.55995 5.2077C8.52786 5.27173 8.48147 5.32629 8.4249 5.36651L3.47225 8.89838C3.41016 8.94259 3.33803 8.96796 3.26352 8.97177C3.18902 8.97559 3.11495 8.95771 3.0492 8.92004ZM3.24397 8.53095L8.19663 4.99991L3.24397 8.53095Z",fill:"#CBEE6B"})],-1)])]),ne[4]||(ne[4]=r.createElementVNode("div",null,"Ver video",-1))])],512),[[r.vShow,b.value]])],2)]),_:1},8,["play-data","is-mobile-device"])],34))}},b5e=x5(v5e,[["__scopeId","data-v-b2b844bf"]]);function x5e(e){return e.reduce((a,i,k)=>(a[i]=k,a),{})}const w5e=["playId","gameId","teamId","playerId","momentOfPlay","categoryId","categoryType","matchLapse","section","matchResult","playingAs","total","coordinate1X","coordinate1Y","coordinate2X","coordinate2Y","coordinate3X","coordinate3Y","xGi","xGf"];let _5=null;function _5e(){return _5||(_5=x5e(w5e)),_5}const S5e={class:"chalkboard-profile__field"},T5e={class:"chalkboard-profile__field__events"},k5e={key:0,class:"how-many-games-text"},N5e={__name:"GSC-LastTouch",props:{categories:{type:Array,default:()=>[{name:"Goles",color:"#336DFF",points:[1,2,3],categories:[12,55,"35_r","54_r"],invert:[35,54],negative:!1,translationKey:"chalkboard.offensive.team.goals",singleName:"Gol",isDefaultSelected:!0}]},seasonId:{type:Number,default:2010},isPreMatch:{type:Boolean,default:!1},howManyGames:{type:Number,default:1},analysisType:{type:String,default:"offensive"},sectionType:{type:String,default:"team"},orientation:{type:String,default:"vertical"},isFull:{type:Boolean,default:!1},isTotalXgfVisible:{type:Boolean,default:!0},canPlayVideos:{type:Boolean,default:!1},teamIdForAnalysis:{type:Number,default:1},isAssistZoneVisible:{type:Boolean,default:!1},gamesIdsForAnalysis:{type:Array,default:()=>[]},gameDateUTC:{type:String,default:""},token:{type:String,default:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"},isTemplateMode:{type:Boolean,default:!1},isHomeTeamForAnalysis:{type:Boolean,default:!0}},emits:["openmedia"],setup(e,{emit:a}){let i=null;const k=a,j=e,g=r.ref(null),m=r.ref(1200),n=r.ref(0),f=r.ref("vertical");r.ref({});const l=r.ref(0),t=r.ref(0),_=r.ref([]),b=r.ref([]),v=r.ref([]),h=r.ref(`chalkboard-profile-${Math.random().toString(36).substring(2,11)}`),o=r.computed(()=>!1),s=r.computed(()=>j.teamIdForAnalysis),p=r.computed(()=>({"--font-size-events":m.value<220?"9px":"12px"}));r.computed(()=>[1,2,3]),r.computed(()=>[1,2,3,4,5,6]),r.computed(()=>[1,2]);const c=r.computed(()=>_5e()),d=r.computed(()=>[...j.categories]),x=r.computed(()=>j.categories.reduce((P,T)=>(Array.isArray(T.categories)&&P.push(...T.categories),P),[])),w=r.computed(()=>j.howManyGames===0?"Todos los partidos":j.howManyGames===1?"Último partido":`Últimos ${j.howManyGames} partidos`);r.watch(()=>j.categories,()=>{N()},{deep:!0}),r.watch(()=>j.analysisType,(P,T)=>{P!==T&&N()});function S(){i=new ResizeObserver(P=>{for(const T of P)m.value=T.contentRect.width}),i.observe(g.value)}function V(P){l.value=P}function O(P){t.value=P}r.onMounted(()=>{S()});function U(P){k("openmedia",P)}async function z(){try{const P=`https://d2oco6mqmc.execute-api.us-west-2.amazonaws.com/prod/teamsBySeason/${j.seasonId}`;return(await(await fetch(P,{headers:{Authorization:j.token}})).json()).teams||[]}catch(P){console.error("Error al obtener los equipos por temporada:",P)}}async function L(){try{const P=`https://pa3kubpuhg.execute-api.us-west-2.amazonaws.com/prod/playersByTeamAndSeason/${j.seasonId}/`,T=await(await fetch(P,{headers:{Authorization:j.token}})).json();return(T==null?void 0:T.reduce((E,R)=>(R.players&&Array.isArray(R.players)&&E.push(...R.players),E),[]))||[]}catch(P){console.error("Error al obtener los jugadores por temporada:",P)}}async function C(){try{const P=`https://8tvo5bp9ai.execute-api.us-west-2.amazonaws.com/prod/gamesBySeason/${j.seasonId}`;return(await(await fetch(P,{headers:{Authorization:j.token}})).json()).games||[]}catch(P){console.error("Error al obtener los partidos por temporada:",P)}}async function q(){try{const P=j.gamesIdsForAnalysis.length?j.gamesIdsForAnalysis.reduce((X,D,H)=>(X+=`&game_id=${D}`,X),""):"",T=x.value.reduce((X,D,H)=>(X+=H===0?`category_id=${D}`:`&category_id=${D}`,X),""),E=j.analysisType==="offensive"?2:3,R=j.gameDateUTC?`&date_time_utc=${j.gameDateUTC}`:"",W=`https://mabnn9axgb.execute-api.us-west-2.amazonaws.com/prod/seasons/${j.seasonId}/stats?team_id=${j.teamIdForAnalysis}${P}&${T}&analysis_type=${E}&is_chalkboard=true${R}`,K=await(await fetch(W,{headers:{Authorization:j.token}})).json();return Object.values(K).reduce((X,D)=>(D&&Array.isArray(D)&&X.push(...D),X),[])}catch(P){console.error("Error al obtener las estadísticas del equipo por temporada:",P)}}async function N(){try{const P=[];P.push(z),P.push(L),P.push(C),P.push(q);const[T,E,R,W]=await Promise.all(P.map(K=>K()));_.value=j.isTemplateMode?W.slice(0,3):W,b.value=E,v.value=R}catch(P){console.error("Error al llenar los datos del chalkboard:",P)}}return r.onMounted(async()=>{try{S(),await N()}catch(P){console.error("Error al cargar los datos del chalkboard:",P)}}),(P,T)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"chalkboardProfile",ref:g,class:"chalkboard-profile",style:r.normalizeStyle(p.value)},[r.createElementVNode("div",S5e,[(r.openBlock(),r.createBlock(b5e,{plays:_.value,categories:d.value,players:b.value,games:v.value,team:s.value,"play-values-index":c.value,"analysis-type":e.analysisType,"section-type":e.sectionType,orientation:f.value,key:n.value,"can-play-videos":e.canPlayVideos,"is-assist-zone-visible":e.isAssistZoneVisible,"component-width":m.value,"unique-id":h.value,"are-logs-visible":o.value,onOpenmedia:U,onChangeTotalPlays:V,onChangeXg:O},null,8,["plays","categories","players","games","team","play-values-index","analysis-type","section-type","orientation","can-play-videos","is-assist-zone-visible","component-width","unique-id","are-logs-visible"])),r.createElementVNode("div",T5e,[e.isTotalXgfVisible&&e.analysisType==="offensive"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createTextVNode(" xG: "+r.toDisplayString(t.value.toFixed(2))+" ",1),T[0]||(T[0]=r.createElementVNode("span",{class:"chalkboard-profile__field__events__separator"}," | ",-1))],64)):r.createCommentVNode("",!0),r.createTextVNode(" Eventos totales: "+r.toDisplayString(l.value),1)]),e.isPreMatch?(r.openBlock(),r.createElementBlock("div",k5e,r.toDisplayString(w.value),1)):r.createCommentVNode("",!0)])],4))}},zN=x5(N5e,[["__scopeId","data-v-e0f96979"]]),V5e={class:"tooltip-options"},O5e={__name:"TooltipOptions",props:{optionsType:{type:String,default:"page"}},emits:["close-tooltip","change-sort","delete-page","edit","clone","delete"],setup(e,{emit:a}){const i=e,k=a,j=r.computed(()=>i.optionsType==="page");function g(){k("close-tooltip")}function m(n){k(n),g()}return(n,f)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:"tooltip-overlay",onClick:g}),r.createElementVNode("div",V5e,[r.createElementVNode("ul",null,[j.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("li",{class:"option",onClick:f[0]||(f[0]=l=>m("change-sort"))},[...f[4]||(f[4]=[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),r.createTextVNode(" Cambiar orden ",-1)])]),r.createElementVNode("li",{class:"option",onClick:f[1]||(f[1]=l=>m("delete-page"))},[...f[5]||(f[5]=[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),r.createTextVNode(" Eliminar ",-1)])])],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("li",{class:"option",onClick:f[2]||(f[2]=l=>m("edit"))},[...f[6]||(f[6]=[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),r.createTextVNode(" Editar ",-1)])]),r.createElementVNode("li",{class:"option",onClick:f[3]||(f[3]=l=>m("delete"))},[...f[7]||(f[7]=[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),r.createTextVNode(" Eliminar ",-1)])])],64))])])],64))}},CN=Bc(O5e,[["__scopeId","data-v-998e2429"]]),L5e={class:"report-view"},U5e={class:"report-view__header"},q5e={key:0,class:"report-view__header__logo"},z5e=["src"],C5e={class:"report-view__header__name"},P5e={class:"report-view__content"},E5e={__name:"ReportView",props:{view:{type:Object,default:()=>({title:"View Title"})},isEmpty:{type:Boolean,default:!1},isTemplateMode:{type:Boolean,default:!1},game:{type:Object,default:()=>null},isHomeTeam:{type:Boolean,default:!0},isFilterVisible:{type:Boolean,default:!1},viewId:{type:Number,default:0},isPostMatch:{type:Boolean,default:!1}},emits:["edit","delete"],setup(e,{emit:a}){const i=e,k=r.ref(!1),j=a,g=[1,2,3,4,6,8,14,13],m=r.computed(()=>!g.includes(i.viewId)),n=r.computed(()=>{if(i.game){const o=i.isHomeTeam?i.game.homeTeam:i.game.awayTeam;if(o&&o.logo)return o.logo}return""}),f=r.computed(()=>{const o=i.view.coreView;return o?o.id===9?i.view.w<4?i.view.title.replace("Mapeo de ",""):i.view.title:o.id===6?t(i.view):o.id===13?_(i.view):i.view.title:i.view.title}),l=new Map([[1,"último"],[2,"penúltimo"],[3,"antepenúltimo"]]);function t(o){return i.isPostMatch?o.title:`${o.title} ${l.get(o.componentProps.gameNumber)+" partido"||""}`}function _(o){try{if(!o)return"Tabla por Categoría";const s=o.dynamicFilters||[];if(!Array.isArray(s)||s.length<2)return"Tabla por Categoría";const p=s[1]||[],c=s[0]||2;if(p&&p.length>0){const d=[{value:[213,214,215,216],label:"Pases acertados por lapsos"},{value:[217],label:"Pases filtrados por lapsos"},{value:[218,219,220,221],label:"Pases no acertados por lapsos"},{value:[485,486,487,488],label:"Balones recuperados en disputa por lapsos"},{value:[489,490,491,492],label:"Balones recuperados sin disputa por lapsos"},{value:[496,497,498,499],label:"Balones perdidos en disputa por lapsos"},{value:[500,501,502,503],label:"Balones perdidos sin disputa por lapsos"},{value:[12,55,"35_r","54_r"],label:"Goles por lapsos"},{value:[511,512],label:c==2?"Tiros a gol totales por lapsos":"Tiros a gol recibidos totales por lapsos"},{value:[537,540,544,547],label:c==2?"Tiros a gol a destino por lapsos":"Tiros a gol recibidos a destino por lapsos"},{value:[13],label:c==2?"Centros por izquierda por lapsos":"Centros por derecha recibidos por lapsos"},{value:[25],label:c==2?"Centros por derecha por lapsos":"Centros por izquierda recibidos por lapsos"},{value:[11],label:"Balones ganados en área rival por lapsos"},{value:[607,608,12,55,"35_r","54_r"],label:"Oportunidad de gol por lapsos"},{value:["40_r"],label:"Goles recibidos por lapsos"},{value:["487_r","488_r","491_r","492_r"],label:"Balones recuperados en cancha rival por lapsos"},{value:["485_r","486_r","489_r","490_r"],label:"Balones recuperados en cancha propia por lapsos"}],x=(w,S)=>{if(w.length!==S.length)return!1;const V=[...w].sort(),O=[...S].sort();return V.every((U,z)=>U===O[z])};for(const w of d)if(x(p,w.value))return w.label}return"Tabla por Categoría"}catch(s){return console.error("Error en getTableCategoryTitle:",s),"Tabla por Categoría"}}function b(){h(),j("edit")}function v(){h(),j("delete")}function h(){k.value=!1}return(o,s)=>(r.openBlock(),r.createElementBlock("div",L5e,[r.createElementVNode("div",U5e,[k.value?(r.openBlock(),r.createBlock(CN,{key:0,"options-type":"view",onClick:s[0]||(s[0]=r.withModifiers(p=>k.value=!1,["self"])),onMouseleave:s[1]||(s[1]=p=>k.value=!1),onCloseTooltip:h,onEdit:b,onDelete:v})):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"report-view__header__team-and-name",style:r.normalizeStyle(e.isTemplateMode?{"max-width":"80%"}:{"max-width":"100%"})},[n.value&&m.value?(r.openBlock(),r.createElementBlock("div",q5e,[r.createElementVNode("img",{src:n.value,alt:""},null,8,z5e)])):r.createCommentVNode("",!0),r.createElementVNode("div",C5e,r.toDisplayString(f.value),1)],4),r.withDirectives(r.createElementVNode("div",{role:"button",class:"report-view__header__actions",onClick:s[2]||(s[2]=p=>k.value=!0)},[...s[3]||(s[3]=[r.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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)])],512),[[r.vShow,e.isTemplateMode&&!e.isFilterVisible]])]),r.createElementVNode("div",P5e,[r.createElementVNode("div",{class:r.normalizeClass({"field-possession-component":e.viewId===8,"timeline-component":e.viewId===4,"field-data-by-zones-component":e.viewId===9})},[r.renderSlot(o.$slots,"default",{},void 0,!0)],2)])]))}},F5e=Bc(E5e,[["__scopeId","data-v-150c2e28"]]);function R5e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u2={exports:{}},PN;function M5e(){if(PN)return u2.exports;PN=1;function e(){}return e.prototype={on:function(a,i,k){var j=this.e||(this.e={});return(j[a]||(j[a]=[])).push({fn:i,ctx:k}),this},once:function(a,i,k){var j=this;function g(){j.off(a,g),i.apply(k,arguments)}return g._=i,this.on(a,g,k)},emit:function(a){var i=[].slice.call(arguments,1),k=((this.e||(this.e={}))[a]||[]).slice(),j=0,g=k.length;for(j;j<g;j++)k[j].fn.apply(k[j].ctx,i);return this},off:function(a,i){var k=this.e||(this.e={}),j=k[a],g=[];if(j&&i)for(var m=0,n=j.length;m<n;m++)j[m].fn!==i&&j[m].fn._!==i&&g.push(j[m]);return g.length?k[a]=g:delete k[a],this}},u2.exports=e,u2.exports.TinyEmitter=e,u2.exports}var S5,EN;function j5e(){if(EN)return S5;EN=1;var e=M5e();return S5=new e,S5}var W5e=j5e();const qa=R5e(W5e);function K5e(e,a,i,k,j){const g=(...m)=>(console.warn("gridstack.js: Function `"+i+"` is deprecated in "+j+" and has been replaced with `"+k+"`. It will be **removed** in a future release"),a.apply(e,m));return g.prototype=a.prototype,g}class Yn{static getElements(a,i=document){if(typeof a=="string"){const k="getElementById"in i?i:void 0;if(k&&!isNaN(+a[0])){const g=k.getElementById(a);return g?[g]:[]}let j=i.querySelectorAll(a);return!j.length&&a[0]!=="."&&a[0]!=="#"&&(j=i.querySelectorAll("."+a),j.length||(j=i.querySelectorAll("#"+a))),Array.from(j)}return[a]}static getElement(a,i=document){if(typeof a=="string"){const k="getElementById"in i?i:void 0;if(!a.length)return null;if(k&&a[0]==="#")return k.getElementById(a.substring(1));if(a[0]==="#"||a[0]==="."||a[0]==="[")return i.querySelector(a);if(k&&!isNaN(+a[0]))return k.getElementById(a);let j=i.querySelector(a);return k&&!j&&(j=k.getElementById(a)),j||(j=i.querySelector("."+a)),j}return a}static lazyLoad(a){var i,k;return a.lazyLoad||((k=(i=a.grid)==null?void 0:i.opts)==null?void 0:k.lazyLoad)&&a.lazyLoad!==!1}static createDiv(a,i){const k=document.createElement("div");return a.forEach(j=>{j&&k.classList.add(j)}),i==null||i.appendChild(k),k}static shouldSizeToContent(a,i=!1){return(a==null?void 0:a.grid)&&(i?a.sizeToContent===!0||a.grid.opts.sizeToContent===!0&&a.sizeToContent===void 0:!!a.sizeToContent||a.grid.opts.sizeToContent&&a.sizeToContent!==!1)}static isIntercepted(a,i){return!(a.y>=i.y+i.h||a.y+a.h<=i.y||a.x+a.w<=i.x||a.x>=i.x+i.w)}static isTouching(a,i){return Yn.isIntercepted(a,{x:i.x-.5,y:i.y-.5,w:i.w+1,h:i.h+1})}static areaIntercept(a,i){const k=a.x>i.x?a.x:i.x,j=a.x+a.w<i.x+i.w?a.x+a.w:i.x+i.w;if(j<=k)return 0;const g=a.y>i.y?a.y:i.y,m=a.y+a.h<i.y+i.h?a.y+a.h:i.y+i.h;return m<=g?0:(j-k)*(m-g)}static area(a){return a.w*a.h}static sort(a,i=1){return a.sort((k,j)=>{const g=i*((k.y??1e4)-(j.y??1e4));return g===0?i*((k.x??1e4)-(j.x??1e4)):g})}static find(a,i){return i?a.find(k=>k.id===i):void 0}static toBool(a){return typeof a=="boolean"?a:typeof a=="string"?(a=a.toLowerCase(),!(a===""||a==="no"||a==="false"||a==="0")):!!a}static toNumber(a){return a===null||a.length===0?void 0:Number(a)}static parseHeight(a){let i,k="px";if(typeof a=="string")if(a==="auto"||a==="")i=0;else{const j=a.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!j)throw new Error(`Invalid height val = ${a}`);k=j[2]||"px",i=parseFloat(j[1])}else i=a;return{h:i,unit:k}}static defaults(a,...i){return i.forEach(k=>{for(const j in k){if(!k.hasOwnProperty(j))return;a[j]===null||a[j]===void 0?a[j]=k[j]:typeof k[j]=="object"&&typeof a[j]=="object"&&Yn.defaults(a[j],k[j])}}),a}static same(a,i){if(typeof a!="object")return a==i;if(typeof a!=typeof i||Object.keys(a).length!==Object.keys(i).length)return!1;for(const k in a)if(a[k]!==i[k])return!1;return!0}static copyPos(a,i,k=!1){return i.x!==void 0&&(a.x=i.x),i.y!==void 0&&(a.y=i.y),i.w!==void 0&&(a.w=i.w),i.h!==void 0&&(a.h=i.h),k&&(i.minW&&(a.minW=i.minW),i.minH&&(a.minH=i.minH),i.maxW&&(a.maxW=i.maxW),i.maxH&&(a.maxH=i.maxH)),a}static samePos(a,i){return a&&i&&a.x===i.x&&a.y===i.y&&(a.w||1)===(i.w||1)&&(a.h||1)===(i.h||1)}static sanitizeMinMax(a){a.minW||delete a.minW,a.minH||delete a.minH,a.maxW||delete a.maxW,a.maxH||delete a.maxH}static removeInternalAndSame(a,i){if(!(typeof a!="object"||typeof i!="object"))for(let k in a){const j=a[k],g=i[k];k[0]==="_"||j===g?delete a[k]:j&&typeof j=="object"&&g!==void 0&&(Yn.removeInternalAndSame(j,g),Object.keys(j).length||delete a[k])}}static removeInternalForSave(a,i=!0){for(let k in a)(k[0]==="_"||a[k]===null||a[k]===void 0)&&delete a[k];delete a.grid,i&&delete a.el,a.autoPosition||delete a.autoPosition,a.noResize||delete a.noResize,a.noMove||delete a.noMove,a.locked||delete a.locked,(a.w===1||a.w===a.minW)&&delete a.w,(a.h===1||a.h===a.minH)&&delete a.h}static throttle(a,i){let k=!1;return(...j)=>{k||(k=!0,setTimeout(()=>{a(...j),k=!1},i))}}static removePositioningStyles(a){const i=a.style;i.position&&i.removeProperty("position"),i.left&&i.removeProperty("left"),i.top&&i.removeProperty("top"),i.width&&i.removeProperty("width"),i.height&&i.removeProperty("height")}static getScrollElement(a){if(!a)return document.scrollingElement||document.documentElement;const i=getComputedStyle(a);return/(auto|scroll)/.test(i.overflow+i.overflowY)?a:Yn.getScrollElement(a.parentElement)}static updateScrollPosition(a,i,k){const j=Yn.getScrollElement(a);if(!j)return;const g=a.getBoundingClientRect(),m=j.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,f=g.bottom-Math.min(m.bottom,n),l=g.top-Math.max(m.top,0),t=j.scrollTop;l<0&&k<0?a.offsetHeight>m.height?j.scrollTop+=k:j.scrollTop+=Math.abs(l)>Math.abs(k)?k:l:f>0&&k>0&&(a.offsetHeight>m.height?j.scrollTop+=k:j.scrollTop+=f>k?k:f),i.top+=j.scrollTop-t}static updateScrollResize(a,i,k){const j=Yn.getScrollElement(i),g=j.clientHeight,m=j===Yn.getScrollElement()?0:j.getBoundingClientRect().top,n=a.clientY-m,f=n<k,l=n>g-k;f?j.scrollBy({behavior:"smooth",top:n-k}):l&&j.scrollBy({behavior:"smooth",top:k-(g-n)})}static clone(a){return a==null||typeof a!="object"?a:a instanceof Array?[...a]:{...a}}static cloneDeep(a){const i=["parentGrid","el","grid","subGrid","engine"],k=Yn.clone(a);for(const j in k)k.hasOwnProperty(j)&&typeof k[j]=="object"&&j.substring(0,2)!=="__"&&!i.find(g=>g===j)&&(k[j]=Yn.cloneDeep(a[j]));return k}static cloneNode(a){const i=a.cloneNode(!0);return i.removeAttribute("id"),i}static appendTo(a,i){let k;typeof i=="string"?k=Yn.getElement(i):k=i,k&&k.appendChild(a)}static addElStyles(a,i){if(i instanceof Object)for(const k in i)i.hasOwnProperty(k)&&(Array.isArray(i[k])?i[k].forEach(j=>{a.style[k]=j}):a.style[k]=i[k])}static initEvent(a,i){const k={type:i.type},j={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:i.target?i.target:a.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(g=>k[g]=a[g]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(g=>k[g]=a[g]),{...k,...j}}static simulateMouseEvent(a,i,k){const j=a,g=new MouseEvent(i,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:a.screenX,screenY:a.screenY,clientX:a.clientX,clientY:a.clientY,ctrlKey:j.ctrlKey??!1,altKey:j.altKey??!1,shiftKey:j.shiftKey??!1,metaKey:j.metaKey??!1,button:0,relatedTarget:a.target});(k||a.target).dispatchEvent(g)}static getValuesFromTransformedElement(a){const i=document.createElement("div");Yn.addElStyles(i,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),a.appendChild(i);const k=i.getBoundingClientRect();return a.removeChild(i),i.remove(),{xScale:1/k.width,yScale:1/k.height,xOffset:k.left,yOffset:k.top}}static swap(a,i,k){if(!a)return;const j=a[i];a[i]=a[k],a[k]=j}static canBeRotated(a){var i;return!(!a||a.w===a.h||a.locked||a.noResize||(i=a.grid)!=null&&i.opts.disableResize||a.minW&&a.minW===a.maxW||a.minH&&a.minH===a.maxH)}}class Mh{constructor(a={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=a.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=a.maxRow,this._float=a.float,this.nodes=a.nodes||[],this.onChange=a.onChange}batchUpdate(a=!0,i=!0){return!!this.batchMode===a?this:(this.batchMode=a,a?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,i&&this._packNodes(),this._notify()),this)}_useEntireRowArea(a,i){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!a._moving||a._skipDown||i.y<=a.y)}_fixCollisions(a,i=a,k,j={}){if(this.sortNodes(-1),k=k||this.collide(a,i),!k)return!1;if(a._moving&&!j.nested&&!this.float&&this.swap(a,k))return!0;let g=i;!this._loading&&this._useEntireRowArea(a,i)&&(g={x:0,w:this.column,y:i.y,h:i.h},k=this.collide(a,g,j.skip));let m=!1;const n={nested:!0,pack:!1};let f=0;for(;k=k||this.collide(a,g,j.skip);){if(f++>this.nodes.length*2)throw new Error("Infinite collide check");let l;if(k.locked||this._loading||a._moving&&!a._skipDown&&i.y>a.y&&!this.float&&(!this.collide(k,{...k,y:a.y},a)||!this.collide(k,{...k,y:i.y-k.h},a))){a._skipDown=a._skipDown||i.y>a.y;const t={...i,y:k.y+k.h,...n};l=this._loading&&Yn.samePos(a,t)?!0:this.moveNode(a,t),(k.locked||this._loading)&&l?Yn.copyPos(i,a):!k.locked&&l&&j.pack&&(this._packNodes(),i.y=k.y+k.h,Yn.copyPos(a,i)),m=m||l}else l=this.moveNode(k,{...k,y:i.y+i.h,skip:a,...n});if(!l)return m;k=void 0}return m}collide(a,i=a,k){const j=a._id,g=k==null?void 0:k._id;return this.nodes.find(m=>m._id!==j&&m._id!==g&&Yn.isIntercepted(m,i))}collideAll(a,i=a,k){const j=a._id,g=k==null?void 0:k._id;return this.nodes.filter(m=>m._id!==j&&m._id!==g&&Yn.isIntercepted(m,i))}directionCollideCoverage(a,i,k){if(!i.rect||!a._rect)return;const j=a._rect,g={...i.rect};g.y>j.y?(g.h+=g.y-j.y,g.y=j.y):g.h+=j.y-g.y,g.x>j.x?(g.w+=g.x-j.x,g.x=j.x):g.w+=j.x-g.x;let m,n=.5;for(let f of k){if(f.locked||!f._rect)break;const l=f._rect;let t=Number.MAX_VALUE,_=Number.MAX_VALUE;j.y<l.y?t=(g.y+g.h-l.y)/l.h:j.y+j.h>l.y+l.h&&(t=(l.y+l.h-g.y)/l.h),j.x<l.x?_=(g.x+g.w-l.x)/l.w:j.x+j.w>l.x+l.w&&(_=(l.x+l.w-g.x)/l.w);const b=Math.min(_,t);b>n&&(n=b,m=f)}return i.collide=m,m}cacheRects(a,i,k,j,g,m){return this.nodes.forEach(n=>n._rect={y:n.y*i+k,x:n.x*a+m,w:n.w*a-m-j,h:n.h*i-k-g}),this}swap(a,i){if(!i||i.locked||!a||a.locked)return!1;function k(){const g=i.x,m=i.y;return i.x=a.x,i.y=a.y,a.h!=i.h?(a.x=g,a.y=i.y+i.h):a.w!=i.w?(a.x=i.x+i.w,a.y=m):(a.x=g,a.y=m),a._dirty=i._dirty=!0,!0}let j;if(a.w===i.w&&a.h===i.h&&(a.x===i.x||a.y===i.y)&&(j=Yn.isTouching(a,i)))return k();if(j!==!1){if(a.w===i.w&&a.x===i.x&&(j||(j=Yn.isTouching(a,i)))){if(i.y<a.y){const g=a;a=i,i=g}return k()}if(j!==!1){if(a.h===i.h&&a.y===i.y&&(j||(j=Yn.isTouching(a,i)))){if(i.x<a.x){const g=a;a=i,i=g}return k()}return!1}}}isAreaEmpty(a,i,k,j){const g={x:a||0,y:i||0,w:k||1,h:j||1};return!this.collide(g)}compact(a="compact",i=!0){if(this.nodes.length===0)return this;i&&this.sortNodes();const k=this.batchMode;k||this.batchUpdate();const j=this._inColumnResize;j||(this._inColumnResize=!0);const g=this.nodes;return this.nodes=[],g.forEach((m,n,f)=>{let l;m.locked||(m.autoPosition=!0,a==="list"&&n&&(l=f[n-1])),this.addNode(m,!1,l)}),j||delete this._inColumnResize,k||this.batchUpdate(!1),this}set float(a){this._float!==a&&(this._float=a||!1,a||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(a=1){return this.nodes=Yn.sort(this.nodes,a),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(a=>{if(a._updating||a._orig===void 0||a.y===a._orig.y)return;let i=a.y;for(;i>a._orig.y;)--i,this.collide(a,{x:a.x,y:i,w:a.w,h:a.h})||(a._dirty=!0,a.y=i)}):this.nodes.forEach((a,i)=>{if(!a.locked)for(;a.y>0;){const k=i===0?0:a.y-1;if(!(i===0||!this.collide(a,{x:a.x,y:k,w:a.w,h:a.h})))break;a._dirty=a.y!==k,a.y=k}}),this)}prepareNode(a,i){a._id=a._id??Mh._idSeq++;const k=a.id;if(k){let g=1;for(;this.nodes.find(m=>m.id===a.id&&m!==a);)a.id=k+"_"+g++}(a.x===void 0||a.y===void 0||a.x===null||a.y===null)&&(a.autoPosition=!0);const j={x:0,y:0,w:1,h:1};return Yn.defaults(a,j),a.autoPosition||delete a.autoPosition,a.noResize||delete a.noResize,a.noMove||delete a.noMove,Yn.sanitizeMinMax(a),typeof a.x=="string"&&(a.x=Number(a.x)),typeof a.y=="string"&&(a.y=Number(a.y)),typeof a.w=="string"&&(a.w=Number(a.w)),typeof a.h=="string"&&(a.h=Number(a.h)),isNaN(a.x)&&(a.x=j.x,a.autoPosition=!0),isNaN(a.y)&&(a.y=j.y,a.autoPosition=!0),isNaN(a.w)&&(a.w=j.w),isNaN(a.h)&&(a.h=j.h),this.nodeBoundFix(a,i),a}nodeBoundFix(a,i){const k=a._orig||Yn.copyPos({},a);if(a.maxW&&(a.w=Math.min(a.w||1,a.maxW)),a.maxH&&(a.h=Math.min(a.h||1,a.maxH)),a.minW&&(a.w=Math.max(a.w||1,a.minW)),a.minH&&(a.h=Math.max(a.h||1,a.minH)),(a.x||0)+(a.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&a._id!=null&&this.findCacheLayout(a,this.defaultColumn)===-1){const j={...a};j.autoPosition||j.x===void 0?(delete j.x,delete j.y):j.x=Math.min(this.defaultColumn-1,j.x),j.w=Math.min(this.defaultColumn,j.w||1),this.cacheOneLayout(j,this.defaultColumn)}return a.w>this.column?a.w=this.column:a.w<1&&(a.w=1),this.maxRow&&a.h>this.maxRow?a.h=this.maxRow:a.h<1&&(a.h=1),a.x<0&&(a.x=0),a.y<0&&(a.y=0),a.x+a.w>this.column&&(i?a.w=this.column-a.x:a.x=this.column-a.w),this.maxRow&&a.y+a.h>this.maxRow&&(i?a.h=this.maxRow-a.y:a.y=this.maxRow-a.h),Yn.samePos(a,k)||(a._dirty=!0),this}getDirtyNodes(a){return a?this.nodes.filter(i=>i._dirty&&!Yn.samePos(i,i._orig)):this.nodes.filter(i=>i._dirty)}_notify(a){if(this.batchMode||!this.onChange)return this;const i=(a||[]).concat(this.getDirtyNodes());return this.onChange(i),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(a=>{delete a._dirty,delete a._lastTried}),this)}saveInitial(){return this.nodes.forEach(a=>{a._orig=Yn.copyPos({},a),delete a._dirty}),this._hasLocked=this.nodes.some(a=>a.locked),this}restoreInitial(){return this.nodes.forEach(a=>{!a._orig||Yn.samePos(a,a._orig)||(Yn.copyPos(a,a._orig),a._dirty=!0)}),this._notify(),this}findEmptyPosition(a,i=this.nodes,k=this.column,j){const g=j?j.y*k+(j.x+j.w):0;let m=!1;for(let n=g;!m;++n){const f=n%k,l=Math.floor(n/k);if(f+a.w>k)continue;const t={x:f,y:l,w:a.w,h:a.h};i.find(_=>Yn.isIntercepted(t,_))||((a.x!==f||a.y!==l)&&(a._dirty=!0),a.x=f,a.y=l,delete a.autoPosition,m=!0)}return m}addNode(a,i=!1,k){const j=this.nodes.find(m=>m._id===a._id);if(j)return j;this._inColumnResize?this.nodeBoundFix(a):this.prepareNode(a),delete a._temporaryRemoved,delete a._removeDOM;let g;return a.autoPosition&&this.findEmptyPosition(a,this.nodes,this.column,k)&&(delete a.autoPosition,g=!0),this.nodes.push(a),i&&this.addedNodes.push(a),g||this._fixCollisions(a),this.batchMode||this._packNodes()._notify(),a}removeNode(a,i=!0,k=!1){return this.nodes.find(j=>j._id===a._id)?(k&&this.removedNodes.push(a),i&&(a._removeDOM=!0),this.nodes=this.nodes.filter(j=>j._id!==a._id),a._isAboutToRemove||this._packNodes(),this._notify([a]),this):this}removeAll(a=!0,i=!0){if(delete this._layouts,!this.nodes.length)return this;a&&this.nodes.forEach(j=>j._removeDOM=!0);const k=this.nodes;return this.removedNodes=i?k:[],this.nodes=[],this._notify(k)}moveNodeCheck(a,i){if(!this.changedPosConstrain(a,i))return!1;if(i.pack=!0,!this.maxRow)return this.moveNode(a,i);let k;const j=new Mh({column:this.column,float:this.float,nodes:this.nodes.map(m=>m._id===a._id?(k={...m},k):{...m})});if(!k)return!1;const g=j.moveNode(k,i)&&j.getRow()<=Math.max(this.getRow(),this.maxRow);if(!g&&!i.resizing&&i.collide){const m=i.collide.el.gridstackNode;if(this.swap(a,m))return this._notify(),!0}return g?(j.nodes.filter(m=>m._dirty).forEach(m=>{const n=this.nodes.find(f=>f._id===m._id);n&&(Yn.copyPos(n,m),n._dirty=!0)}),this._notify(),!0):!1}willItFit(a){if(delete a._willFitPos,!this.maxRow)return!0;const i=new Mh({column:this.column,float:this.float,nodes:this.nodes.map(j=>({...j}))}),k={...a};return this.cleanupNode(k),delete k.el,delete k._id,delete k.content,delete k.grid,i.addNode(k),i.getRow()<=this.maxRow?(a._willFitPos=Yn.copyPos({},k),!0):!1}changedPosConstrain(a,i){return i.w=i.w||a.w,i.h=i.h||a.h,a.x!==i.x||a.y!==i.y?!0:(a.maxW&&(i.w=Math.min(i.w,a.maxW)),a.maxH&&(i.h=Math.min(i.h,a.maxH)),a.minW&&(i.w=Math.max(i.w,a.minW)),a.minH&&(i.h=Math.max(i.h,a.minH)),a.w!==i.w||a.h!==i.h)}moveNode(a,i){var k,j;if(!a||!i)return!1;let g;i.pack===void 0&&!this.batchMode&&(g=i.pack=!0),typeof i.x!="number"&&(i.x=a.x),typeof i.y!="number"&&(i.y=a.y),typeof i.w!="number"&&(i.w=a.w),typeof i.h!="number"&&(i.h=a.h);const m=a.w!==i.w||a.h!==i.h,n=Yn.copyPos({},a,!0);if(Yn.copyPos(n,i),this.nodeBoundFix(n,m),Yn.copyPos(i,n),!i.forceCollide&&Yn.samePos(a,i))return!1;const f=Yn.copyPos({},a),l=this.collideAll(a,n,i.skip);let t=!0;if(l.length){const _=a._moving&&!i.nested;let b=_?this.directionCollideCoverage(a,i,l):l[0];if(_&&b&&(j=(k=a.grid)==null?void 0:k.opts)!=null&&j.subGridDynamic&&!a.grid._isTemp){const v=Yn.areaIntercept(i.rect,b._rect),h=Yn.area(i.rect),o=Yn.area(b._rect);v/(h<o?h:o)>.8&&(b.grid.makeSubGrid(b.el,void 0,a),b=void 0)}b?t=!this._fixCollisions(a,n,b,i):(t=!1,g&&delete i.pack)}return t&&!Yn.samePos(a,n)&&(a._dirty=!0,Yn.copyPos(a,n)),i.pack&&this._packNodes()._notify(),!Yn.samePos(a,f)}getRow(){return this.nodes.reduce((a,i)=>Math.max(a,i.y+i.h),0)}beginUpdate(a){return a._updating||(a._updating=!0,delete a._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const a=this.nodes.find(i=>i._updating);return a&&(delete a._updating,delete a._skipDown),this}save(a=!0,i,k){var j;const g=((j=this._layouts)==null?void 0:j.length)||0;let m;g&&(k?k!==this.column&&(m=this._layouts[k]):this.column!==g-1&&(m=this._layouts[g-1]));const n=[];return this.sortNodes(),this.nodes.forEach(f=>{const l=m==null?void 0:m.find(_=>_._id===f._id),t={...f,...l||{}};Yn.removeInternalForSave(t,!a),i&&i(f,t),n.push(t)}),n}layoutsNodesChange(a){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((i,k)=>{if(!i||k===this.column)return this;if(k<this.column)this._layouts[k]=void 0;else{const j=k/this.column;a.forEach(g=>{if(!g._orig)return;const m=i.find(n=>n._id===g._id);m&&(m.y>=0&&g.y!==g._orig.y&&(m.y+=g.y-g._orig.y),g.x!==g._orig.x&&(m.x=Math.round(g.x*j)),g.w!==g._orig.w&&(m.w=Math.round(g.w*j)))})}}),this)}columnChanged(a,i,k="moveScale"){var j;if(!this.nodes.length||!i||a===i)return this;const g=k==="compact"||k==="list";g&&this.sortNodes(1),i<a&&this.cacheLayout(this.nodes,a),this.batchUpdate();let m=[],n=g?this.nodes:Yn.sort(this.nodes,-1);if(i>a&&this._layouts){const f=this._layouts[i]||[],l=this._layouts.length-1;!f.length&&a!==l&&(j=this._layouts[l])!=null&&j.length&&(a=l,this._layouts[l].forEach(t=>{const _=n.find(b=>b._id===t._id);_&&(!g&&!t.autoPosition&&(_.x=t.x??_.x,_.y=t.y??_.y),_.w=t.w??_.w,(t.x==null||t.y===void 0)&&(_.autoPosition=!0))})),f.forEach(t=>{const _=n.findIndex(b=>b._id===t._id);if(_!==-1){const b=n[_];if(g){b.w=t.w;return}(t.autoPosition||isNaN(t.x)||isNaN(t.y))&&this.findEmptyPosition(t,m),t.autoPosition||(b.x=t.x??b.x,b.y=t.y??b.y,b.w=t.w??b.w,m.push(b)),n.splice(_,1)}})}if(g)this.compact(k,!1);else{if(n.length)if(typeof k=="function")k(i,a,m,n);else{const f=g||k==="none"?1:i/a,l=k==="move"||k==="moveScale",t=k==="scale"||k==="moveScale";n.forEach(_=>{_.x=i===1?0:l?Math.round(_.x*f):Math.min(_.x,i-1),_.w=i===1||a===1?1:t?Math.round(_.w*f)||1:Math.min(_.w,i),m.push(_)}),n=[]}m=Yn.sort(m,-1),this._inColumnResize=!0,this.nodes=[],m.forEach(f=>{this.addNode(f,!1),delete f._orig})}return this.nodes.forEach(f=>delete f._orig),this.batchUpdate(!1,!g),delete this._inColumnResize,this}cacheLayout(a,i,k=!1){const j=[];return a.forEach((g,m)=>{if(g._id===void 0){const n=g.id?this.nodes.find(f=>f.id===g.id):void 0;g._id=(n==null?void 0:n._id)??Mh._idSeq++}j[m]={x:g.x,y:g.y,w:g.w,_id:g._id}}),this._layouts=k?[]:this._layouts||[],this._layouts[i]=j,this}cacheOneLayout(a,i){a._id=a._id??Mh._idSeq++;const k={x:a.x,y:a.y,w:a.w,_id:a._id};(a.autoPosition||a.x===void 0)&&(delete k.x,delete k.y,a.autoPosition&&(k.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[i]=this._layouts[i]||[];const j=this.findCacheLayout(a,i);return j===-1?this._layouts[i].push(k):this._layouts[i][j]=k,this}findCacheLayout(a,i){var k,j;return((j=(k=this._layouts)==null?void 0:k[i])==null?void 0:j.findIndex(g=>g._id===a._id))??-1}removeNodeFromLayoutCache(a){if(this._layouts)for(let i=0;i<this._layouts.length;i++){const k=this.findCacheLayout(a,i);k!==-1&&this._layouts[i].splice(k,1)}}cleanupNode(a){for(const i in a)i[0]==="_"&&i!=="_id"&&delete a[i];return this}}Mh._idSeq=0;const Id={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};class Fi{}const Kp=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class bh{}function d2(e,a){e.touches.length>1||(e.cancelable&&e.preventDefault(),Yn.simulateMouseEvent(e.changedTouches[0],a))}function FN(e,a){e.cancelable&&e.preventDefault(),Yn.simulateMouseEvent(e,a)}function p2(e){bh.touchHandled||(bh.touchHandled=!0,d2(e,"mousedown"))}function h2(e){bh.touchHandled&&d2(e,"mousemove")}function f2(e){if(!bh.touchHandled)return;bh.pointerLeaveTimeout&&(window.clearTimeout(bh.pointerLeaveTimeout),delete bh.pointerLeaveTimeout);const a=!!Fi.dragElement;d2(e,"mouseup"),a||d2(e,"click"),bh.touchHandled=!1}function m2(e){e.pointerType!=="mouse"&&e.target.releasePointerCapture(e.pointerId)}function RN(e){Fi.dragElement&&e.pointerType!=="mouse"&&FN(e,"mouseenter")}function MN(e){Fi.dragElement&&e.pointerType!=="mouse"&&(bh.pointerLeaveTimeout=window.setTimeout(()=>{delete bh.pointerLeaveTimeout,FN(e,"mouseleave")},10))}class y2{constructor(a,i,k){this.host=a,this.dir=i,this.option=k,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){const a=this.el=document.createElement("div");return a.classList.add("ui-resizable-handle"),a.classList.add(`${y2.prefix}${this.dir}`),a.style.zIndex="100",a.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),Kp&&(this.el.addEventListener("touchstart",p2),this.el.addEventListener("pointerdown",m2)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Kp&&(this.el.removeEventListener("touchstart",p2),this.el.removeEventListener("pointerdown",m2)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(a){this.mouseDownEvent=a,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Kp&&(this.el.addEventListener("touchmove",h2),this.el.addEventListener("touchend",f2)),a.stopPropagation(),a.preventDefault()}_mouseMove(a){const i=this.mouseDownEvent;this.moving?this._triggerEvent("move",a):Math.abs(a.x-i.x)+Math.abs(a.y-i.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",a),document.addEventListener("keydown",this._keyEvent)),a.stopPropagation()}_mouseUp(a){this.moving&&(this._triggerEvent("stop",a),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Kp&&(this.el.removeEventListener("touchmove",h2),this.el.removeEventListener("touchend",f2)),delete this.moving,delete this.mouseDownEvent,a.stopPropagation(),a.preventDefault()}_keyEvent(a){var i,k;a.key==="Escape"&&((k=(i=this.host.gridstackNode)==null?void 0:i.grid)==null||k.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(a,i){return this.option[a]&&this.option[a](i),this}}y2.prefix="ui-resizable-";class T5{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(a,i){this._eventRegister[a]=i}off(a){delete this._eventRegister[a]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(a,i){if(!this.disabled&&this._eventRegister&&this._eventRegister[a])return this._eventRegister[a](i)}}class K1 extends T5{constructor(a,i={}){super(),this.el=a,this.option=i,this.rectScale={x:1,y:1},this._ui=()=>{const k=this.el.parentElement.getBoundingClientRect(),j={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},g=this.temporalRect||j;return{position:{left:(g.left-k.left)*this.rectScale.x,top:(g.top-k.top)*this.rectScale.y},size:{width:g.width*this.rectScale.x,height:g.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(a,i){super.on(a,i)}off(a){super.off(a)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(a){const i=a.handles&&a.handles!==this.option.handles,k=a.autoHide&&a.autoHide!==this.option.autoHide;return Object.keys(a).forEach(j=>this.option[j]=a[j]),i&&(this._removeHandlers(),this._setupHandlers()),k&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(a){return a?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),Fi.overResizeElement===this&&delete Fi.overResizeElement),this}_mouseOver(a){Fi.overResizeElement||Fi.dragElement||(Fi.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(a){Fi.overResizeElement===this&&(delete Fi.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(a=>a.trim()).map(a=>new y2(this.el,a,{start:i=>{this._resizeStart(i)},stop:i=>{this._resizeStop(i)},move:i=>{this._resizing(i,a)}})),this}_resizeStart(a){this.sizeToContent=Yn.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=Yn.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=a,this._setupHelper(),this._applyChange();const i=Yn.initEvent(a,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(i,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",i),this}_resizing(a,i){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(a,i),this._applyChange();const k=Yn.initEvent(a,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(k,this._ui()),this.triggerEvent("resize",k),this}_resizeStop(a){const i=Yn.initEvent(a,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(i),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",i),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=K1._originStyleProp.map(k=>this.el.style[k]),this.parentOriginStylePosition=this.el.parentElement.style.position;const a=this.el.parentElement,i=Yn.getValuesFromTransformedElement(a);return this.rectScale={x:i.xScale,y:i.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return K1._originStyleProp.forEach((a,i)=>{this.el.style[a]=this.elOriginStyleVal[i]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(a,i){const k=this.startEvent,j={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},g=a.clientX-k.clientX,m=this.sizeToContent?0:a.clientY-k.clientY;let n,f;i.indexOf("e")>-1?j.width+=g:i.indexOf("w")>-1&&(j.width-=g,j.left+=g,n=!0),i.indexOf("s")>-1?j.height+=m:i.indexOf("n")>-1&&(j.height-=m,j.top+=m,f=!0);const l=this._constrainSize(j.width,j.height,n,f);return Math.round(j.width)!==Math.round(l.width)&&(i.indexOf("w")>-1&&(j.left+=j.width-l.width),j.width=l.width),Math.round(j.height)!==Math.round(l.height)&&(i.indexOf("n")>-1&&(j.top+=j.height-l.height),j.height=l.height),j}_constrainSize(a,i,k,j){const g=this.option,m=(k?g.maxWidthMoveLeft:g.maxWidth)||Number.MAX_SAFE_INTEGER,n=g.minWidth/this.rectScale.x||a,f=(j?g.maxHeightMoveUp:g.maxHeight)||Number.MAX_SAFE_INTEGER,l=g.minHeight/this.rectScale.y||i,t=Math.min(m,Math.max(n,a)),_=Math.min(f,Math.max(l,i));return{width:t,height:_}}_applyChange(){let a={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const i=this.el.parentElement,{left:k,top:j}=i.getBoundingClientRect();a={left:k,top:j,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(i=>{const k=this.temporalRect[i],j=i==="width"||i==="left"?this.rectScale.x:i==="height"||i==="top"?this.rectScale.y:1;this.el.style[i]=(k-a[i])*j+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(a=>a.destroy()),delete this.handlers,this}}K1._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const A5e='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class A1 extends T5{constructor(a,i={}){var k;super(),this.el=a,this.option=i,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const j=(k=i==null?void 0:i.handle)==null?void 0:k.substring(1),g=a.gridstackNode;this.dragEls=!j||a.classList.contains(j)?[a]:g!=null&&g.subGrid?[a.querySelector(i.handle)||a]:Array.from(a.querySelectorAll(i.handle)),this.dragEls.length===0&&(this.dragEls=[a]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(a,i){super.on(a,i)}off(a){super.off(a)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(a=>{a.addEventListener("mousedown",this._mouseDown),Kp&&(a.addEventListener("touchstart",p2),a.addEventListener("pointerdown",m2))}),this.el.classList.remove("ui-draggable-disabled"))}disable(a=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(i=>{i.removeEventListener("mousedown",this._mouseDown),Kp&&(i.removeEventListener("touchstart",p2),i.removeEventListener("pointerdown",m2))}),a||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(a){return Object.keys(a).forEach(i=>this.option[i]=a[i]),this}_mouseDown(a){if(!Fi.mouseHandled)return a.button!==0||!this.dragEls.find(i=>i===a.target)&&a.target.closest(A5e)||this.option.cancel&&a.target.closest(this.option.cancel)||(this.mouseDownEvent=a,delete this.dragging,delete Fi.dragElement,delete Fi.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Kp&&(a.currentTarget.addEventListener("touchmove",h2),a.currentTarget.addEventListener("touchend",f2)),a.preventDefault(),document.activeElement&&document.activeElement.blur(),Fi.mouseHandled=!0),!0}_callDrag(a){if(!this.dragging)return;const i=Yn.initEvent(a,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(i,this.ui()),this.triggerEvent("drag",i)}_mouseMove(a){var i;const k=this.mouseDownEvent;if(this.lastDrag=a,this.dragging)if(this._dragFollow(a),Fi.pauseDrag){const j=Number.isInteger(Fi.pauseDrag)?Fi.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(a),j)}else this._callDrag(a);else if(Math.abs(a.x-k.x)+Math.abs(a.y-k.y)>3){this.dragging=!0,Fi.dragElement=this;const j=(i=this.el.gridstackNode)==null?void 0:i.grid;j?Fi.dropElement=j.el.ddElement.ddDroppable:delete Fi.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=Yn.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(a,this.el,this.helperContainment),this._setupHelperStyle(a);const g=Yn.initEvent(a,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(g,this.ui()),this.triggerEvent("dragstart",g),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(a){var i,k;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Kp&&a.currentTarget&&(a.currentTarget.removeEventListener("touchmove",h2,!0),a.currentTarget.removeEventListener("touchend",f2,!0)),this.dragging){delete this.dragging,(i=this.el.gridstackNode)==null||delete i._origRotate,document.removeEventListener("keydown",this._keyEvent),((k=Fi.dropElement)==null?void 0:k.el)===this.el.parentElement&&delete Fi.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const j=Yn.initEvent(a,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(j),this.triggerEvent("dragstop",j),Fi.dropElement&&Fi.dropElement.drop(a)}delete this.helper,delete this.mouseDownEvent,delete Fi.dragElement,delete Fi.dropElement,delete Fi.mouseHandled,a.preventDefault()}_keyEvent(a){var i,k;const j=this.el.gridstackNode,g=(j==null?void 0:j.grid)||((k=(i=Fi.dropElement)==null?void 0:i.el)==null?void 0:k.gridstack);if(a.key==="Escape")j&&j._origRotate&&(j._orig=j._origRotate,delete j._origRotate),g==null||g.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(j&&g&&(a.key==="r"||a.key==="R")){if(!Yn.canBeRotated(j))return;j._origRotate=j._origRotate||{...j._orig},delete j._moving,g.setAnimation(!1).rotate(j.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),j._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,j.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",Yn.swap(j._orig,"w","h"),delete j._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let a=this.el;return typeof this.option.helper=="function"?a=this.option.helper(this.el):this.option.helper==="clone"&&(a=Yn.cloneNode(this.el)),a.parentElement||Yn.appendTo(a,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=A1.originStyleProp.map(i=>this.el.style[i]),a}_setupHelperStyle(a){var i,k;this.helper.classList.add("ui-draggable-dragging"),(k=(i=this.el.gridstackNode)==null?void 0:i.grid)==null||k.el.classList.add("grid-stack-dragging");const j=this.helper.style;return j.pointerEvents="none",j.width=this.dragOffset.width+"px",j.height=this.dragOffset.height+"px",j.willChange="left, top",j.position="fixed",this._dragFollow(a),j.transition="none",setTimeout(()=>{this.helper&&(j.transition=null)},0),this}_removeHelperStyle(){var a,i,k;this.helper.classList.remove("ui-draggable-dragging"),(i=(a=this.el.gridstackNode)==null?void 0:a.grid)==null||i.el.classList.remove("grid-stack-dragging");const j=(k=this.helper)==null?void 0:k.gridstackNode;if(!(j!=null&&j._isAboutToRemove)&&this.dragElementOriginStyle){const g=this.helper,m=this.dragElementOriginStyle.transition||null;g.style.transition=this.dragElementOriginStyle.transition="none",A1.originStyleProp.forEach(n=>g.style[n]=this.dragElementOriginStyle[n]||null),setTimeout(()=>g.style.transition=m,50)}return delete this.dragElementOriginStyle,this}_dragFollow(a){const i={left:0,top:0},k=this.helper.style,j=this.dragOffset;k.left=(a.clientX+j.offsetLeft-i.left)*this.dragTransform.xScale+"px",k.top=(a.clientY+j.offsetTop-i.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(a,i,k){let j=0,g=0;k&&(j=this.dragTransform.xOffset,g=this.dragTransform.yOffset);const m=i.getBoundingClientRect();return{left:m.left,top:m.top,offsetLeft:-a.clientX+m.left-j,offsetTop:-a.clientY+m.top-g,width:m.width*this.dragTransform.xScale,height:m.height*this.dragTransform.yScale}}ui(){const a=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect();return{position:{top:(i.top-a.top)*this.dragTransform.yScale,left:(i.left-a.left)*this.dragTransform.xScale}}}}A1.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class I5e extends T5{constructor(a,i={}){super(),this.el=a,this.option=i,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(a,i){super.on(a,i)}off(a){super.off(a)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),Kp&&(this.el.addEventListener("pointerenter",RN),this.el.addEventListener("pointerleave",MN)))}disable(a=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),a||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),Kp&&(this.el.removeEventListener("pointerenter",RN),this.el.removeEventListener("pointerleave",MN)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(a){return Object.keys(a).forEach(i=>this.option[i]=a[i]),this._setupAccept(),this}_mouseEnter(a){if(!Fi.dragElement||!this._canDrop(Fi.dragElement.el))return;a.preventDefault(),a.stopPropagation(),Fi.dropElement&&Fi.dropElement!==this&&Fi.dropElement._mouseLeave(a,!0),Fi.dropElement=this;const i=Yn.initEvent(a,{target:this.el,type:"dropover"});this.option.over&&this.option.over(i,this._ui(Fi.dragElement)),this.triggerEvent("dropover",i),this.el.classList.add("ui-droppable-over")}_mouseLeave(a,i=!1){var k;if(!Fi.dragElement||Fi.dropElement!==this)return;a.preventDefault(),a.stopPropagation();const j=Yn.initEvent(a,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(j,this._ui(Fi.dragElement)),this.triggerEvent("dropout",j),Fi.dropElement===this&&(delete Fi.dropElement,!i)){let g,m=this.el.parentElement;for(;!g&&m;)g=(k=m.ddElement)==null?void 0:k.ddDroppable,m=m.parentElement;g&&g._mouseEnter(a)}}drop(a){a.preventDefault();const i=Yn.initEvent(a,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(i,this._ui(Fi.dragElement)),this.triggerEvent("drop",i)}_canDrop(a){return a&&(!this.accept||this.accept(a))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=a=>a.classList.contains(this.option.accept)||a.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(a){return{draggable:a.el,...a.ui()}}}class k5{static init(a){return a.ddElement||(a.ddElement=new k5(a)),a.ddElement}constructor(a){this.el=a}on(a,i){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(a)>-1?this.ddDraggable.on(a,i):this.ddDroppable&&["drop","dropover","dropout"].indexOf(a)>-1?this.ddDroppable.on(a,i):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(a)>-1&&this.ddResizable.on(a,i),this}off(a){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(a)>-1?this.ddDraggable.off(a):this.ddDroppable&&["drop","dropover","dropout"].indexOf(a)>-1?this.ddDroppable.off(a):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(a)>-1&&this.ddResizable.off(a),this}setupDraggable(a){return this.ddDraggable?this.ddDraggable.updateOption(a):this.ddDraggable=new A1(this.el,a),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(a){return this.ddResizable?this.ddResizable.updateOption(a):this.ddResizable=new K1(this.el,a),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(a){return this.ddDroppable?this.ddDroppable.updateOption(a):this.ddDroppable=new I5e(this.el,a),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class X5e{resizable(a,i,k,j){return this._getDDElements(a,i).forEach(g=>{if(i==="disable"||i==="enable")g.ddResizable&&g.ddResizable[i]();else if(i==="destroy")g.ddResizable&&g.cleanResizable();else if(i==="option")g.setupResizable({[k]:j});else{const m=g.el.gridstackNode.grid;let n=g.el.getAttribute("gs-resize-handles")||m.opts.resizable.handles||"e,s,se";n==="all"&&(n="n,e,s,w,se,sw,ne,nw");const f=!m.opts.alwaysShowResizeHandle;g.setupResizable({...m.opts.resizable,handles:n,autoHide:f,start:i.start,stop:i.stop,resize:i.resize})}}),this}draggable(a,i,k,j){return this._getDDElements(a,i).forEach(g=>{if(i==="disable"||i==="enable")g.ddDraggable&&g.ddDraggable[i]();else if(i==="destroy")g.ddDraggable&&g.cleanDraggable();else if(i==="option")g.setupDraggable({[k]:j});else{const m=g.el.gridstackNode.grid;g.setupDraggable({...m.opts.draggable,start:i.start,stop:i.stop,drag:i.drag})}}),this}dragIn(a,i){return this._getDDElements(a).forEach(k=>k.setupDraggable(i)),this}droppable(a,i,k,j){return typeof i.accept=="function"&&!i._accept&&(i._accept=i.accept,i.accept=g=>i._accept(g)),this._getDDElements(a,i).forEach(g=>{i==="disable"||i==="enable"?g.ddDroppable&&g.ddDroppable[i]():i==="destroy"?g.ddDroppable&&g.cleanDroppable():i==="option"?g.setupDroppable({[k]:j}):g.setupDroppable(i)}),this}isDroppable(a){var i;return!!((i=a==null?void 0:a.ddElement)!=null&&i.ddDroppable&&!a.ddElement.ddDroppable.disabled)}isDraggable(a){var i;return!!((i=a==null?void 0:a.ddElement)!=null&&i.ddDraggable&&!a.ddElement.ddDraggable.disabled)}isResizable(a){var i;return!!((i=a==null?void 0:a.ddElement)!=null&&i.ddResizable&&!a.ddElement.ddResizable.disabled)}on(a,i,k){return this._getDDElements(a).forEach(j=>j.on(i,g=>{k(g,Fi.dragElement?Fi.dragElement.el:g.target,Fi.dragElement?Fi.dragElement.helper:null)})),this}off(a,i){return this._getDDElements(a).forEach(k=>k.off(i)),this}_getDDElements(a,i){const k=a.gridstack||i!=="destroy"&&i!=="disable",j=Yn.getElements(a);return j.length?j.map(g=>g.ddElement||(k?k5.init(g):null)).filter(g=>g):[]}}/*!
4119
4119
  * GridStack 12.3.2
4120
4120
  * https://gridstackjs.com/
4121
4121
  *
@@ -4123,25 +4123,25 @@ function print() { __p += __j.call(arguments, '') }
4123
4123
  * see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
4124
4124
  */const ad=new X5e;class vi{static init(a={},i=".grid-stack"){if(typeof document>"u")return null;const k=vi.getGridElement(i);return k?(k.gridstack||(k.gridstack=new vi(k,Yn.cloneDeep(a))),k.gridstack):(console.error(typeof i=="string"?'GridStack.initAll() no grid was found with selector "'+i+`" - element missing or wrong selector ?
4125
4125
  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={},i=".grid-stack"){const k=[];return typeof document>"u"||(vi.getGridElements(i).forEach(j=>{j.gridstack||(j.gridstack=new vi(j,Yn.cloneDeep(a))),k.push(j.gridstack)}),k.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+i+`" - element missing or wrong selector ?
4126
- Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),k}static addGrid(a,i={}){if(!a)return null;let k=a;if(k.gridstack){const j=k.gridstack;return i&&(j.opts={...j.opts,...i}),i.children!==void 0&&j.load(i.children),j}return(!a.classList.contains("grid-stack")||vi.addRemoveCB)&&(vi.addRemoveCB?k=vi.addRemoveCB(a,i,!0,!0):k=Yn.createDiv(["grid-stack",i.class],a)),vi.init(i,k)}static registerEngine(a){vi.engineClass=a}get placeholder(){if(!this._placeholder){this._placeholder=Yn.createDiv([this.opts.placeholderClass,Id.itemClass,this.opts.itemClass]);const a=Yn.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(a.textContent=this.opts.placeholderText)}return this._placeholder}constructor(a,i={}){var k;this.el=a,this.opts=i,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},a.gridstack=this,this.opts=i=i||{},a.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),i.row&&(i.minRow=i.maxRow=i.row,delete i.row);const j=Yn.toNumber(a.getAttribute("gs-row"));i.column==="auto"&&delete i.column,i.alwaysShowResizeHandle!==void 0&&(i._alwaysShowResizeHandle=i.alwaysShowResizeHandle);const g=i.columnOpts;if(g){const t=g.breakpoints;!g.columnWidth&&!(t!=null&&t.length)?delete i.columnOpts:(g.columnMax=g.columnMax||12,(t==null?void 0:t.length)>1&&t.sort((_,b)=>(b.w||0)-(_.w||0)))}const m={...Yn.cloneDeep(Id),column:Yn.toNumber(a.getAttribute("gs-column"))||Id.column,minRow:j||Yn.toNumber(a.getAttribute("gs-min-row"))||Id.minRow,maxRow:j||Yn.toNumber(a.getAttribute("gs-max-row"))||Id.maxRow,staticGrid:Yn.toBool(a.getAttribute("gs-static"))||Id.staticGrid,sizeToContent:Yn.toBool(a.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(i.handleClass?"."+i.handleClass:i.handle?i.handle:"")||Id.draggable.handle},removableOptions:{accept:i.itemClass||Id.removableOptions.accept,decline:Id.removableOptions.decline}};a.getAttribute("gs-animate")&&(m.animate=Yn.toBool(a.getAttribute("gs-animate"))),i=Yn.defaults(i,m),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(i),i.rtl==="auto"&&(i.rtl=a.style.direction==="rtl"),i.rtl&&this.el.classList.add("grid-stack-rtl");const n=this.el.closest("."+Id.itemClass),f=n==null?void 0:n.gridstackNode;if(f&&(f.subGrid=this,this.parentGridNode=f,this.el.classList.add("grid-stack-nested"),f.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=i.cellHeight==="auto",this._isAutoCellHeight||i.cellHeight==="initial")this.cellHeight(void 0);else{typeof i.cellHeight=="number"&&i.cellHeightUnit&&i.cellHeightUnit!==Id.cellHeightUnit&&(i.cellHeight=i.cellHeight+i.cellHeightUnit,delete i.cellHeightUnit);const t=i.cellHeight;delete i.cellHeight,this.cellHeight(t)}i.alwaysShowResizeHandle==="mobile"&&(i.alwaysShowResizeHandle=Kp),this._setStaticClass();const l=i.engineClass||vi.engineClass||Mh;if(this.engine=new l({column:this.getColumn(),float:i.float,maxRow:i.maxRow,onChange:t=>{t.forEach(_=>{const b=_.el;b&&(_._removeDOM?(b&&b.remove(),delete _._removeDOM):this._writePosAttr(b,_))}),this._updateContainerHeight()}}),i.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(t=>this._prepareElement(t)),delete this.engine._loading,this.batchUpdate(!1)),i.children){const t=i.children;delete i.children,t.length&&this.load(t)}this.setAnimation(),i.subGridDynamic&&!Fi.pauseDrag&&(Fi.pauseDrag=!0),((k=i.draggable)==null?void 0:k.pause)!==void 0&&(Fi.pauseDrag=i.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 i,k=a;if(k.grid=this,k.el?i=k.el:vi.addRemoveCB?i=vi.addRemoveCB(this.el,a,!0,!1):i=this.createWidgetDivs(k),!i)return;if(k=i.gridstackNode,k&&i.parentElement===this.el&&this.engine.nodes.find(g=>g._id===k._id))return i;const j=this._readAttr(i);return Yn.defaults(a,j),this.engine.prepareNode(a),this.el.appendChild(i),this.makeWidget(i,a),i}createWidgetDivs(a){const i=Yn.createDiv(["grid-stack-item",this.opts.itemClass]),k=Yn.createDiv(["grid-stack-item-content"],i);return Yn.lazyLoad(a)?a.visibleObservable||(a.visibleObservable=new IntersectionObserver(([j])=>{var g,m;j.isIntersecting&&((g=a.visibleObservable)==null||g.disconnect(),delete a.visibleObservable,vi.renderCB(k,a),(m=a.grid)==null||m.prepareDragDrop(a.el))}),window.setTimeout(()=>{var j;return(j=a.visibleObservable)==null?void 0:j.observe(i)})):vi.renderCB(k,a),i}makeSubGrid(a,i,k,j=!0){var g,m,n;let f=a.gridstackNode;if(f||(f=this.makeWidget(a).gridstackNode),(g=f.subGrid)!=null&&g.el)return f.subGrid;let l,t=this;for(;t&&!l;)l=(m=t.opts)==null?void 0:m.subGridOpts,t=(n=t.parentGridNode)==null?void 0:n.grid;i=Yn.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...l||{},...i||f.subGridOpts||{}}),f.subGridOpts=i;let _;i.column==="auto"&&(_=!0,i.column=Math.max(f.w||1,(k==null?void 0:k.w)||1),delete i.columnOpts);let b=f.el.querySelector(".grid-stack-item-content"),v,h;if(j&&(this._removeDD(f.el),h={...f,x:0,y:0},Yn.removeInternalForSave(h),delete h.subGridOpts,f.content&&(h.content=f.content,delete f.content),vi.addRemoveCB?v=vi.addRemoveCB(this.el,h,!0,!1):(v=Yn.createDiv(["grid-stack-item"]),v.appendChild(b),b=Yn.createDiv(["grid-stack-item-content"],f.el)),this.prepareDragDrop(f.el)),k){const s=_?i.column:f.w,p=f.h+k.h,c=f.el.style;c.transition="none",this.update(f.el,{w:s,h:p}),setTimeout(()=>c.transition=null)}const o=f.subGrid=vi.addGrid(b,i);return k!=null&&k._moving&&(o._isTemp=!0),_&&(o._autoColumn=!0),j&&o.makeWidget(v,h),k&&(k._moving?window.setTimeout(()=>Yn.simulateMouseEvent(k._event,"mouseenter",o.el),0):o.makeWidget(f.el,f)),this.resizeToContentCheck(!1,f),o}removeAsSubGrid(a){var i;const k=(i=this.parentGridNode)==null?void 0:i.grid;k&&(k.batchUpdate(),k.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(j=>{j.x+=this.parentGridNode.x,j.y+=this.parentGridNode.y,k.makeWidget(j.el,j)}),k.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,a&&window.setTimeout(()=>Yn.simulateMouseEvent(a._event,"mouseenter",k.el),0))}save(a=!0,i=!1,k=vi.saveCB,j){const g=this.engine.save(a,k,j);if(g.forEach(m=>{var n;if(a&&m.el&&!m.subGrid&&!k){const f=m.el.querySelector(".grid-stack-item-content");m.content=f==null?void 0:f.innerHTML,m.content||delete m.content}else if(!a&&!k&&delete m.content,(n=m.subGrid)!=null&&n.el){const f=m.w||m.subGrid.getColumn(),l=m.subGrid.save(a,i,k,f);m.subGridOpts=i?l:{children:l},delete m.subGrid}delete m.el}),i){const m=Yn.cloneDeep(this.opts);m.marginBottom===m.marginTop&&m.marginRight===m.marginLeft&&m.marginTop===m.marginRight&&(m.margin=m.marginTop,delete m.marginTop,delete m.marginRight,delete m.marginBottom,delete m.marginLeft),m.rtl===(this.el.style.direction==="rtl")&&(m.rtl="auto"),this._isAutoCellHeight&&(m.cellHeight="auto"),this._autoColumn&&(m.column="auto");const n=m._alwaysShowResizeHandle;return delete m._alwaysShowResizeHandle,n!==void 0?m.alwaysShowResizeHandle=n:delete m.alwaysShowResizeHandle,Yn.removeInternalAndSame(m,Id),m.children=g,m}return g}load(a,i=vi.addRemoveCB||!0){a=Yn.cloneDeep(a);const k=this.getColumn();a.forEach(t=>{t.w=t.w||t.minW||1,t.h=t.h||t.minH||1}),a=Yn.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>k&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=a,this.engine.columnChanged(j,k,this.responseLayout),a=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(a,j,!0));const g=vi.addRemoveCB;typeof i=="function"&&(vi.addRemoveCB=i);const m=[];this.batchUpdate();const n=!this.engine.nodes.length,f=n&&this.opts.animate;f&&this.setAnimation(!1),!n&&i&&[...this.engine.nodes].forEach(t=>{t.id&&(Yn.find(a,t.id)||(vi.addRemoveCB&&vi.addRemoveCB(this.el,t,!1,!1),m.push(t),this.removeWidget(t.el,!0,!1)))}),this.engine._loading=!0;const l=[];return this.engine.nodes=this.engine.nodes.filter(t=>Yn.find(a,t.id)?(l.push(t),!1):!0),a.forEach(t=>{var _;const b=Yn.find(l,t.id);if(b){if(Yn.shouldSizeToContent(b)&&(t.h=b.h),this.engine.nodeBoundFix(t),(t.autoPosition||t.x===void 0||t.y===void 0)&&(t.w=t.w||b.w,t.h=t.h||b.h,this.engine.findEmptyPosition(t)),this.engine.nodes.push(b),Yn.samePos(b,t)&&this.engine.nodes.length>1&&(this.moveNode(b,{...t,forceCollide:!0}),Yn.copyPos(t,b)),this.update(b.el,t),(_=t.subGridOpts)!=null&&_.children){const v=b.el.querySelector(".grid-stack");v&&v.gridstack&&v.gridstack.load(t.subGridOpts.children)}}else i&&this.addWidget(t)}),delete this.engine._loading,this.engine.removedNodes=m,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,g?vi.addRemoveCB=g:delete vi.addRemoveCB,f&&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 i=this.el.querySelector("."+this.opts.itemClass);if(i){const j=Yn.toNumber(i.getAttribute("gs-h"))||1;return Math.round(i.offsetHeight/j)}const k=parseInt(this.el.getAttribute("gs-current-row"));return k?Math.round(this.el.getBoundingClientRect().height/k):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 k=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;a=this.cellWidth()+k}const i=Yn.parseHeight(a);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h?this:(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.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 i;return a&&(i=this.opts.columnOpts)!=null&&i.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var a,i;const k=this.opts.columnOpts;if(!k||!k.columnWidth&&!((a=k.breakpoints)!=null&&a.length))return!1;const j=this.getColumn();let g=j;const m=this._widthOrContainer(!0);if(k.columnWidth)g=Math.min(Math.round(m/k.columnWidth)||1,k.columnMax);else{g=k.columnMax;let n=0;for(;n<k.breakpoints.length&&m<=k.breakpoints[n].w;)g=k.breakpoints[n++].c||j}if(g!==j){const n=(i=k.breakpoints)==null?void 0:i.find(f=>f.c===g);return this.column(g,(n==null?void 0:n.layout)||k.layout),!0}return!1}compact(a="compact",i=!0){return this.engine.compact(a,i),this._triggerChangeEvent(),this}column(a,i="moveScale"){if(!a||a<1||this.opts.column===a)return this;const k=this.getColumn();return this.opts.column=a,this.engine?(this.engine.column=a,this.el.classList.remove("gs-"+k),this._updateColumnVar(),this.engine.columnChanged(k,a,i),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=i,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 i;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,(i=this._placeholder)==null||delete i.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,i=!1){const k=this.el.getBoundingClientRect();let j;i?j={top:k.top+document.documentElement.scrollTop,left:k.left}:j={top:this.el.offsetTop,left:this.el.offsetLeft};const g=a.left-j.left,m=a.top-j.top,n=k.width/this.getColumn(),f=k.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(g/n),y:Math.floor(m/f)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(a,i,k,j){return this.engine.isAreaEmpty(a,i,k,j)}makeWidget(a,i){const k=vi.getElement(a);if(!k||k.gridstackNode)return k;k.parentElement||this.el.appendChild(k),this._prepareElement(k,!0,i);const j=k.gridstackNode;this._updateContainerHeight(),j.subGridOpts&&this.makeSubGrid(k,j.subGridOpts,void 0,!1);let g;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(g=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),g&&delete this._ignoreLayoutsNodeChange,k}on(a,i){return a.indexOf(" ")!==-1?(a.split(" ").forEach(k=>this.on(k,i)),this):(a==="change"||a==="added"||a==="removed"||a==="enable"||a==="disable"?(a==="enable"||a==="disable"?this._gsEventHandler[a]=k=>i(k):this._gsEventHandler[a]=k=>{k.detail&&i(k,k.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]=i:console.error("GridStack.on("+a+") event not supported"),this)}off(a){return a.indexOf(" ")!==-1?(a.split(" ").forEach(i=>this.off(i)),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,i=!0,k=!0){return a?(vi.getElements(a).forEach(j=>{if(j.parentElement&&j.parentElement!==this.el)return;let g=j.gridstackNode;g||(g=this.engine.nodes.find(m=>j===m.el)),g&&(i&&vi.addRemoveCB&&vi.addRemoveCB(this.el,g,!1,!1),delete j.gridstackNode,this._removeDD(j),this.engine.removeNode(g,i,k),i&&j.parentElement&&j.remove())}),k&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(a=!0,i=!0){return this.engine.nodes.forEach(k=>{a&&vi.addRemoveCB&&vi.addRemoveCB(this.el,k,!1,!1),delete k.el.gridstackNode,this.opts.staticGrid||this._removeDD(k.el)}),this.engine.removeAll(a,i),i&&this._triggerRemoveEvent(),this}setAnimation(a=this.opts.animate,i){return i?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,i=!0,k=!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&&k&&j.subGrid.setStatic(a,i,k)}),i&&this._setStaticClass(),this)}updateOptions(a){var i;const k=this.opts;return a===k?this:(a.acceptWidgets!==void 0&&(k.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!==k.class&&(k.class&&this.el.classList.remove(k.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?(k.minRow=k.maxRow=k.row=a.row,this._updateContainerHeight()):(a.minRow!==void 0&&(k.minRow=a.minRow,this._updateContainerHeight()),a.maxRow!==void 0&&(k.maxRow=a.maxRow)),(i=a.children)!=null&&i.length&&this.load(a.children),this)}update(a,i){return vi.getElements(a).forEach(k=>{var j;const g=k==null?void 0:k.gridstackNode;if(!g)return;const m={...Yn.copyPos({},g),...Yn.cloneDeep(i)};this.engine.nodeBoundFix(m),delete m.autoPosition;const n=["x","y","w","h"];let f;if(n.some(_=>m[_]!==void 0&&m[_]!==g[_])&&(f={},n.forEach(_=>{f[_]=m[_]!==void 0?m[_]:g[_],delete m[_]})),!f&&(m.minW||m.minH||m.maxW||m.maxH)&&(f={}),m.content!==void 0){const _=k.querySelector(".grid-stack-item-content");_&&_.textContent!==m.content&&(g.content=m.content,vi.renderCB(_,m),(j=g.subGrid)!=null&&j.el&&(_.appendChild(g.subGrid.el),g.subGrid._updateContainerHeight())),delete m.content}let l=!1,t=!1;for(const _ in m)_[0]!=="_"&&g[_]!==m[_]&&(g[_]=m[_],l=!0,t=t||!this.opts.staticGrid&&(_==="noResize"||_==="noMove"||_==="locked"));if(Yn.sanitizeMinMax(g),f){const _=f.w!==void 0&&f.w!==g.w;this.moveNode(g,f),_&&g.subGrid?g.subGrid.onResize(this.hasAnimationCSS()?g.w:void 0):this.resizeToContentCheck(_,g),delete g._orig}(f||l)&&this._writeAttr(k,g),t&&this.prepareDragDrop(g.el),vi.updateCB&&vi.updateCB(g)}),this}moveNode(a,i){const k=a._updating;k||this.engine.cleanNodes().beginUpdate(a),this.engine.moveNode(a,i),this._updateContainerHeight(),k||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(a){var i,k;if(!a||(a.classList.remove("size-to-content-max"),!a.clientHeight))return;const j=a.gridstackNode;if(!j)return;const g=j.grid;if(!g||a.parentElement!==g.el)return;const m=g.getCellHeight(!0);if(!m)return;let n=j.h?j.h*m:a.clientHeight,f;if(j.resizeToContentParent&&(f=a.querySelector(j.resizeToContentParent)),f||(f=a.querySelector(vi.resizeToContentParent)),!f)return;const l=a.clientHeight-f.clientHeight,t=j.h?j.h*m-l:f.clientHeight;let _;if(j.subGrid){_=j.subGrid.getRow()*j.subGrid.getCellHeight(!0);const h=j.subGrid.el.getBoundingClientRect(),o=a.getBoundingClientRect();_+=h.top-o.top}else{if((k=(i=j.subGridOpts)==null?void 0:i.children)!=null&&k.length)return;{const h=f.firstElementChild;if(!h){console.error(`Error: GridStack.resizeToContent() widget id:${j.id} '${vi.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}_=h.getBoundingClientRect().height||t}}if(t===_)return;n+=_-t;let b=Math.ceil(n/m);const v=Number.isInteger(j.sizeToContent)?j.sizeToContent:0;v&&b>v&&(b=v,a.classList.add("size-to-content-max")),j.minH&&b<j.minH?b=j.minH:j.maxH&&b>j.maxH&&(b=j.maxH),b!==j.h&&(g._ignoreLayoutsNodeChange=!0,g.moveNode(j,{h:b}),delete g._ignoreLayoutsNodeChange)}resizeToContentCBCheck(a){vi.resizeToContentCB?vi.resizeToContentCB(a):this.resizeToContent(a)}rotate(a,i){return vi.getElements(a).forEach(k=>{const j=k.gridstackNode;if(!Yn.canBeRotated(j))return;const g={w:j.h,h:j.w,minH:j.minW,minW:j.minH,maxH:j.maxW,maxW:j.maxH};if(i){const n=i.left>0?Math.floor(i.left/this.cellWidth()):0,f=i.top>0?Math.floor(i.top/this.opts.cellHeight):0;g.x=j.x+n-(j.h-(f+1)),g.y=j.y+f-n}Object.keys(g).forEach(n=>{g[n]===void 0&&delete g[n]});const m=j._orig;this.update(k,g),j._orig=m}),this}margin(a){if(!(typeof a=="string"&&a.split(" ").length>1)){const i=Yn.parseHeight(a);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.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 i=arguments;let k=0,j={x:i[k++],y:i[k++],w:i[k++],h:i[k++],autoPosition:i[k++]};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(k=>{delete k._dirty});const i=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",i)}return this}_triggerRemoveEvent(){var a;if(this.engine.batchMode)return this;if((a=this.engine.removedNodes)!=null&&a.length){const i=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",i)}return this}_triggerEvent(a,i){const k=i?new CustomEvent(a,{bubbles:!1,detail:i}):new Event(a);let j=this;for(;j.parentGridNode;)j=j.parentGridNode.grid;return j.el.dispatchEvent(k),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const a=this.parentGridNode;let i=this.getRow()+this._extraDragRow;const k=this.opts.cellHeight,j=this.opts.cellHeightUnit;if(!k)return this;if(!a&&!this.opts.minRow){const g=Yn.parseHeight(getComputedStyle(this.el).minHeight);if(g.h>0&&g.unit===j){const m=Math.floor(g.h/k);i<m&&(i=m)}}return this.el.setAttribute("gs-current-row",String(i)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),i&&(this.el.style[a?"minHeight":"height"]=i*k+j),a&&Yn.shouldSizeToContent(a)&&a.grid.resizeToContentCBCheck(a.el),this}_prepareElement(a,i=!1,k){k=k||this._readAttr(a),a.gridstackNode=k,k.el=a,k.grid=this,k=this.engine.addNode(k,i),this._writeAttr(a,k),a.classList.add(Id.itemClass,this.opts.itemClass);const j=Yn.shouldSizeToContent(k);return j?a.classList.add("size-to-content"):a.classList.remove("size-to-content"),j&&this.resizeToContentCheck(!1,k),Yn.lazyLoad(k)||this.prepareDragDrop(k.el),this}_writePosAttr(a,i){return(!i._moving&&!i._resizing||this._placeholder===a)&&(a.style.top=i.y?i.y===1?"var(--gs-cell-height)":`calc(${i.y} * var(--gs-cell-height))`:null,a.style.left=i.x?i.x===1?"var(--gs-column-width)":`calc(${i.x} * var(--gs-column-width))`:null,a.style.width=i.w>1?`calc(${i.w} * var(--gs-column-width))`:null,a.style.height=i.h>1?`calc(${i.h} * var(--gs-cell-height))`:null),i.x>0?a.setAttribute("gs-x",String(i.x)):a.removeAttribute("gs-x"),i.y>0?a.setAttribute("gs-y",String(i.y)):a.removeAttribute("gs-y"),i.w>1?a.setAttribute("gs-w",String(i.w)):a.removeAttribute("gs-w"),i.h>1?a.setAttribute("gs-h",String(i.h)):a.removeAttribute("gs-h"),this}_writeAttr(a,i){if(!i)return this;this._writePosAttr(a,i);const k={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const j in k)i[j]?a.setAttribute(k[j],String(i[j])):a.removeAttribute(k[j]);return this}_readAttr(a,i=!0){const k={};k.x=Yn.toNumber(a.getAttribute("gs-x")),k.y=Yn.toNumber(a.getAttribute("gs-y")),k.w=Yn.toNumber(a.getAttribute("gs-w")),k.h=Yn.toNumber(a.getAttribute("gs-h")),k.autoPosition=Yn.toBool(a.getAttribute("gs-auto-position")),k.noResize=Yn.toBool(a.getAttribute("gs-no-resize")),k.noMove=Yn.toBool(a.getAttribute("gs-no-move")),k.locked=Yn.toBool(a.getAttribute("gs-locked"));const j=a.getAttribute("gs-size-to-content");j&&(j==="true"||j==="false"?k.sizeToContent=Yn.toBool(j):k.sizeToContent=parseInt(j,10)),k.id=a.getAttribute("gs-id"),k.maxW=Yn.toNumber(a.getAttribute("gs-max-w")),k.minW=Yn.toNumber(a.getAttribute("gs-min-w")),k.maxH=Yn.toNumber(a.getAttribute("gs-max-h")),k.minH=Yn.toNumber(a.getAttribute("gs-min-h")),i&&(k.w===1&&a.removeAttribute("gs-w"),k.h===1&&a.removeAttribute("gs-h"),k.maxW&&a.removeAttribute("gs-max-w"),k.minW&&a.removeAttribute("gs-min-w"),k.maxH&&a.removeAttribute("gs-max-h"),k.minH&&a.removeAttribute("gs-min-h"));for(const g in k){if(!k.hasOwnProperty(g))return;!k[g]&&k[g]!==0&&g!=="sizeToContent"&&delete k[g]}return k}_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=(i=>(i=this.el)==null?void 0:i.clientWidth)()){if(!a||this.prevWidth===a)return;this.prevWidth=a,this.batchUpdate();let i=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),i=!0):i=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(k=>{k.subGrid&&k.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(i),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(a=!1,i=void 0){if(this.engine){if(a&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,i),this.animationDelay);if(i)Yn.shouldSizeToContent(i)&&this.resizeToContentCBCheck(i.el);else if(this.engine.nodes.some(k=>Yn.shouldSizeToContent(k))){const k=[...this.engine.nodes];this.batchUpdate(),k.forEach(j=>{Yn.shouldSizeToContent(j)&&this.resizeToContentCBCheck(j.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,i?[i]:this.engine.nodes)}}_updateResizeEvent(a=!1){const i=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(k=>k.sizeToContent));return!a&&i&&!this.resizeObserver?(this._sizeThrottle=Yn.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(a||!i)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(a=".grid-stack-item"){return Yn.getElement(a)}static getElements(a=".grid-stack-item"){return Yn.getElements(a)}static getGridElement(a){return vi.getElement(a)}static getGridElements(a){return Yn.getElements(a)}_initMargin(){let a,i=0,k=[];typeof this.opts.margin=="string"&&(k=this.opts.margin.split(" ")),k.length===2?(this.opts.marginTop=this.opts.marginBottom=k[0],this.opts.marginLeft=this.opts.marginRight=k[1]):k.length===4?(this.opts.marginTop=k[0],this.opts.marginRight=k[1],this.opts.marginBottom=k[2],this.opts.marginLeft=k[3]):(a=Yn.parseHeight(this.opts.margin),this.opts.marginUnit=a.unit,i=this.opts.margin=a.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(g=>{this.opts[g]===void 0?this.opts[g]=i:(a=Yn.parseHeight(this.opts[g]),this.opts[g]=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 ad}static setupDragIn(a,i,k,j=document){(i==null?void 0:i.pause)!==void 0&&(Fi.pauseDrag=i.pause),i={appendTo:"body",helper:"clone",...i||{}},(typeof a=="string"?Yn.getElements(a,j):a).forEach((g,m)=>{ad.isDraggable(g)||ad.dragIn(g,i),k!=null&&k[m]&&(g.gridstackNode=k[m])})}movable(a,i){return this.opts.staticGrid?this:(vi.getElements(a).forEach(k=>{const j=k.gridstackNode;j&&(i?delete j.noMove:j.noMove=!0,this.prepareDragDrop(j.el))}),this)}resizable(a,i){return this.opts.staticGrid?this:(vi.getElements(a).forEach(k=>{const j=k.gridstackNode;j&&(i?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,i=!0){return this.opts.staticGrid?this:(a?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(k=>{this.prepareDragDrop(k.el),k.subGrid&&i&&k.subGrid.enableMove(a,i)}),this)}enableResize(a,i=!0){return this.opts.staticGrid?this:(a?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(k=>{this.prepareDragDrop(k.el),k.subGrid&&i&&k.subGrid.enableResize(a,i)}),this)}cancelDrag(){var a;const i=(a=this._placeholder)==null?void 0:a.gridstackNode;i&&(i._isExternal?(i._isAboutToRemove=!0,this.engine.removeNode(i)):i._isAboutToRemove&&vi._itemRemoving(i.el,!1),this.engine.restoreInitial())}_removeDD(a){return ad.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 ad.droppable(this.el,"destroy"),this;let a,i;const k=(j,g,m)=>{var n;m=m||g;const f=m.gridstackNode;if(!f)return;if(!((n=f.grid)!=null&&n.el)){m.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const v=m.getBoundingClientRect();m.style.left=v.x+(this.dragTransform.xScale-1)*(j.clientX-v.x)/this.dragTransform.xScale+"px",m.style.top=v.y+(this.dragTransform.yScale-1)*(j.clientY-v.y)/this.dragTransform.yScale+"px",m.style.transformOrigin="0px 0px"}let{top:l,left:t}=m.getBoundingClientRect();const _=this.el.getBoundingClientRect();t-=_.left,l-=_.top;const b={position:{top:l*this.dragTransform.xScale,left:t*this.dragTransform.yScale}};if(f._temporaryRemoved){if(f.x=Math.max(0,Math.round(t/i)),f.y=Math.max(0,Math.round(l/a)),delete f.autoPosition,this.engine.nodeBoundFix(f),!this.engine.willItFit(f)){if(f.autoPosition=!0,!this.engine.willItFit(f)){ad.off(g,"drag");return}f._willFitPos&&(Yn.copyPos(f,f._willFitPos),delete f._willFitPos)}this._onStartMoving(m,j,b,f,i,a)}else this._dragOrResize(m,j,b,f,i,a)};return ad.droppable(this.el,{accept:j=>{const g=j.gridstackNode||this._readAttr(j,!1);if((g==null?void 0:g.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let m=!0;if(typeof this.opts.acceptWidgets=="function")m=this.opts.acceptWidgets(j);else{const n=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;m=j.matches(n)}if(m&&g&&this.opts.maxRow){const n={w:g.w,h:g.h,minW:g.minW,minH:g.minH};m=this.engine.willItFit(n)}return m}}).on(this.el,"dropover",(j,g,m)=>{let n=(m==null?void 0:m.gridstackNode)||g.gridstackNode;if((n==null?void 0:n.grid)===this&&!n._temporaryRemoved)return!1;if(n!=null&&n._sidebarOrig&&(n.w=n._sidebarOrig.w,n.h=n._sidebarOrig.h),n!=null&&n.grid&&n.grid!==this&&!n._temporaryRemoved&&n.grid._leave(g,m),m=m||g,i=this.cellWidth(),a=this.getCellHeight(!0),!n){const t=m.getAttribute("data-gs-widget")||m.getAttribute("gridstacknode");if(t){try{n=JSON.parse(t)}catch{console.error("Gridstack dropover: Bad JSON format: ",t)}m.removeAttribute("data-gs-widget"),m.removeAttribute("gridstacknode")}n||(n=this._readAttr(m)),n._sidebarOrig={w:n.w,h:n.h}}n.grid||(n.el||(n={...n}),n._isExternal=!0,m.gridstackNode=n);const f=n.w||Math.round(m.offsetWidth/i)||1,l=n.h||Math.round(m.offsetHeight/a)||1;return n.grid&&n.grid!==this?(g._gridstackNodeOrig||(g._gridstackNodeOrig=n),g.gridstackNode=n={...n,w:f,h:l,grid:this},delete n.x,delete n.y,this.engine.cleanupNode(n).nodeBoundFix(n),n._initDD=n._isExternal=n._temporaryRemoved=!0):(n.w=f,n.h=l,n._temporaryRemoved=!0),vi._itemRemoving(n.el,!1),ad.on(g,"drag",k),k(j,g,m),!1}).on(this.el,"dropout",(j,g,m)=>{const n=(m==null?void 0:m.gridstackNode)||g.gridstackNode;return n&&(!n.grid||n.grid===this)&&(this._leave(g,m),this._isTemp&&this.removeAsSubGrid(n)),!1}).on(this.el,"drop",(j,g,m)=>{var n,f,l;const t=(m==null?void 0:m.gridstackNode)||g.gridstackNode;if((t==null?void 0:t.grid)===this&&!t._isExternal)return!1;const _=!!this.placeholder.parentElement,b=g!==m;this.placeholder.remove(),delete this.placeholder.gridstackNode,_&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const v=g._gridstackNodeOrig;if(delete g._gridstackNodeOrig,_&&v!=null&&v.grid&&v.grid!==this){const o=v.grid;o.engine.removeNodeFromLayoutCache(v),o.engine.removedNodes.push(v),o._triggerRemoveEvent()._triggerChangeEvent(),o.parentGridNode&&!o.engine.nodes.length&&o.opts.subGridDynamic&&o.removeAsSubGrid()}if(!t||(_&&(this.engine.cleanupNode(t),t.grid=this),(n=t.grid)==null||delete n._isTemp,ad.off(g,"drag"),m!==g?(m.remove(),g=m):g.remove(),this._removeDD(g),!_))return!1;const h=(l=(f=t.subGrid)==null?void 0:f.el)==null?void 0:l.gridstack;return Yn.copyPos(t,this._readAttr(this.placeholder)),Yn.removePositioningStyles(g),b&&(t.content||t.subGridOpts||vi.addRemoveCB)?(delete t.el,g=this.addWidget(t)):(this._prepareElement(g,!0,t),this.el.appendChild(g),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"},v&&v.grid?v:void 0,t),!1}),this}static _itemRemoving(a,i){if(!a)return;const k=a?a.gridstackNode:void 0;!(k!=null&&k.grid)||a.classList.contains(k.grid.opts.removableOptions.decline)||(i?k._isAboutToRemove=!0:delete k._isAboutToRemove,i?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&&!ad.isDroppable(a)&&ad.droppable(a,this.opts.removableOptions).on(a,"dropover",(i,k)=>vi._itemRemoving(k,!0)).on(a,"dropout",(i,k)=>vi._itemRemoving(k,!1)),this):this}prepareDragDrop(a,i=!1){const k=a==null?void 0:a.gridstackNode;if(!k)return;const j=k.noMove||this.opts.disableDrag,g=k.noResize||this.opts.disableResize,m=this.opts.staticGrid||j&&g;if((i||m)&&(k._initDD&&(this._removeDD(a),delete k._initDD),m&&a.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!i))return this;if(!k._initDD){let n,f;const l=(b,v)=>{this.triggerEvent(b,b.target),n=this.cellWidth(),f=this.getCellHeight(!0),this._onStartMoving(a,b,v,k,n,f)},t=(b,v)=>{this._dragOrResize(a,b,v,k,n,f)},_=b=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete k._moving,delete k._resizing,delete k._event,delete k._lastTried;const v=k.w!==k._orig.w,h=b.target;if(!(!h.gridstackNode||h.gridstackNode.grid!==this)){if(k.el=h,k._isAboutToRemove){const o=a.gridstackNode.grid;o._gsEventHandler[b.type]&&o._gsEventHandler[b.type](b,h),o.engine.nodes.push(k),o.removeWidget(a,!0,!0)}else Yn.removePositioningStyles(h),k._temporaryRemoved?(this._writePosAttr(h,k),this.engine.addNode(k)):this._writePosAttr(h,k),this.triggerEvent(b,h);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),b.type==="resizestop"&&(Number.isInteger(k.sizeToContent)&&(k.sizeToContent=k.h),this.resizeToContentCheck(v,k))}};ad.draggable(a,{start:l,stop:_,drag:t}).resizable(a,{start:l,stop:_,resize:t}),k._initDD=!0}return ad.draggable(a,j?"disable":"enable").resizable(a,g?"disable":"enable"),this}_onStartMoving(a,i,k,j,g,m){var n;if(this.engine.cleanNodes().beginUpdate(j),this._writePosAttr(this.placeholder,j),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=j,(n=j.grid)!=null&&n.el)this.dragTransform=Yn.getValuesFromTransformedElement(a);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const f=this.placeholder.closest(".grid-stack");this.dragTransform=Yn.getValuesFromTransformedElement(f)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(j.el=this.placeholder,j._lastUiPosition=k.position,j._prevYPix=k.position.top,j._moving=i.type==="dragstart",j._resizing=i.type==="resizestart",delete j._lastTried,i.type==="dropover"&&j._temporaryRemoved&&(this.engine.addNode(j),j._moving=!0),this.engine.cacheRects(g,m,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),i.type==="resizestart"){const f=this.getColumn()-j.x,l=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-j.y;ad.resizable(a,"option","minWidth",g*Math.min(j.minW||1,f)).resizable(a,"option","minHeight",m*Math.min(j.minH||1,l)).resizable(a,"option","maxWidth",g*Math.min(j.maxW||Number.MAX_SAFE_INTEGER,f)).resizable(a,"option","maxWidthMoveLeft",g*Math.min(j.maxW||Number.MAX_SAFE_INTEGER,j.x+j.w)).resizable(a,"option","maxHeight",m*Math.min(j.maxH||Number.MAX_SAFE_INTEGER,l)).resizable(a,"option","maxHeightMoveUp",m*Math.min(j.maxH||Number.MAX_SAFE_INTEGER,j.y+j.h))}}_dragOrResize(a,i,k,j,g,m){const n={...j._orig};let f,l=this.opts.marginLeft,t=this.opts.marginRight,_=this.opts.marginTop,b=this.opts.marginBottom;const v=Math.round(m*.1),h=Math.round(g*.1);if(l=Math.min(l,h),t=Math.min(t,h),_=Math.min(_,v),b=Math.min(b,v),i.type==="drag"){if(j._temporaryRemoved)return;const s=k.position.top-j._prevYPix;j._prevYPix=k.position.top,this.opts.draggable.scroll!==!1&&Yn.updateScrollPosition(a,k.position,s);const p=k.position.left+(k.position.left>j._lastUiPosition.left?-t:l),c=k.position.top+(k.position.top>j._lastUiPosition.top?-b:_);n.x=Math.round(p/g),n.y=Math.round(c/m);const d=this._extraDragRow;if(this.engine.collide(j,n)){const x=this.getRow();let w=Math.max(0,n.y+j.h-x);this.opts.maxRow&&x+w>this.opts.maxRow&&(w=Math.max(0,this.opts.maxRow-x)),this._extraDragRow=w}else this._extraDragRow=0;if(this._extraDragRow!==d&&this._updateContainerHeight(),j.x===n.x&&j.y===n.y)return}else if(i.type==="resize"){if(n.x<0||(Yn.updateScrollResize(i,a,m),n.w=Math.round((k.size.width-l)/g),n.h=Math.round((k.size.height-_)/m),j.w===n.w&&j.h===n.h)||j._lastTried&&j._lastTried.w===n.w&&j._lastTried.h===n.h)return;const s=k.position.left+l,p=k.position.top+_;n.x=Math.round(s/g),n.y=Math.round(p/m),f=!0}j._event=i,j._lastTried=n;const o={x:k.position.left+l,y:k.position.top+_,w:(k.size?k.size.width:j.w*g)-l-t,h:(k.size?k.size.height:j.h*m)-_-b};if(this.engine.moveNodeCheck(j,{...n,cellWidth:g,cellHeight:m,rect:o,resizing:f})){j._lastUiPosition=k.position,this.engine.cacheRects(g,m,_,t,b,l),delete j._skipDown,f&&j.subGrid&&j.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const s=i.target;j._sidebarOrig||this._writePosAttr(s,j),this.triggerEvent(i,s)}}triggerEvent(a,i){let k=this;for(;k.parentGridNode;)k=k.parentGridNode.grid;k._gsEventHandler[a.type]&&k._gsEventHandler[a.type](a,i)}_leave(a,i){i=i||a;const k=i.gridstackNode;if(!k||(i.style.transform=i.style.transformOrigin=null,ad.off(a,"drag"),k._temporaryRemoved))return;k._temporaryRemoved=!0,this.engine.removeNode(k),k.el=k._isExternal&&i?i:a;const j=k._sidebarOrig;k._isExternal&&this.engine.cleanupNode(k),k._sidebarOrig=j,this.opts.removable===!0&&vi._itemRemoving(a,!0),a._gridstackNodeOrig?(a.gridstackNode=a._gridstackNodeOrig,delete a._gridstackNodeOrig):k._isExternal&&this.engine.restoreInitial()}commit(){return K5e(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}vi.renderCB=(e,a)=>{e&&a!=null&&a.content&&(e.textContent=a.content)},vi.resizeToContentParent=".grid-stack-item-content",vi.Utils=Yn,vi.Engine=Mh,vi.GDRev="12.3.2";const D5e=[{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}],jh=e=>D5e.find(a=>a.id===e),Wh=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 H0{constructor(a,i=[],k,j=null,g=!1,m=!1,n=null,f=null,l=null){Tp(this,"id",""),Tp(this,"childViews",[]),Tp(this,"viewId",0),Tp(this,"dynamicFilters",null),Tp(this,"componentSpecificFilters",new Map),Tp(this,"isPostMatch",!1),Tp(this,"isTemplateMode",!1),Tp(this,"filtresJSON",null),Tp(this,"token",null),Tp(this,"_isUpdating",!1),Tp(this,"filters",null),this.id=a,this.viewId=k,this.childViews=i,this.dynamicFilters=j,this.isPostMatch=g,this.isTemplateMode=m,this.filtresJSON=n,this.token=f,this.filters=l,this.componentSpecificFilters=new Map}resetClass(){this.childViews.forEach(a=>{a.view.filterAndViewsContainer=new H0(this.id,[a],this.viewId,this.dynamicFilters,this.isPostMatch,this.isTemplateMode,this.filtresJSON,this.token,this.filters)})}hasEventTypeId(a,i){return!a||!Array.isArray(a)?!1:a.some(k=>k&&k.event_type_id===i)}hasCategoryId(a,i){return!a||!Array.isArray(a)?!1:a.some(k=>k&&k.category_id===i)}getId(){return this.id}setViewId(a){this.viewId=a}setFiltersJSON(a){this.filtresJSON=a}setDynamicFilters(a,i=null){i?this.componentSpecificFilters.set(i,[...a]):this.dynamicFilters=a}setFilters(a){this.filters=a}getComponentDynamicFilters(a){return a&&this.componentSpecificFilters.has(a)?this.componentSpecificFilters.get(a):this.dynamicFilters}getAllComponentFilters(){return this.componentSpecificFilters}debugComponentFilters(){}static debugAllComponentFilters(){}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)}addLastTouch(a){if(a.view.componentProps&&this.filters){let i=null;const k=this.filters.selectedCategories.map(g=>g.value),j=this.filters.selectedTeam.value;if(j===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(f=>{f.view.componentProps.isHomeTeamForAnalysis=!0,f.view.isHomeTeam=!0,f.view.filterMultiple&&(f.view.filterMultiple.isHomeTeam=!0)});const g=this.getHomeTeamViews(),m=this.getAwayTeamViews();let n=!0;for(let f=0;f<k.length;f++){i=k[f];const l=g.find(_=>_.view.componentProps.categories[0].name===i.name),t=m.find(_=>_.view.componentProps.categories[0].name===i.name);if(!l||!t){n=!l;break}}n?this.childViews.length===0?(a.view.componentProps.categories=[i],a.view.componentProps.analysisType=this.filters.selectedGamePhase.name,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,a.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,a.view.title=i.name,a.view.titleShort=i.name,a.view.isHomeTeam=!0,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:i,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):this.childViews.reduce((f,l,t,_)=>{let b={categories:l.view.componentProps.categories,analysisType:l.view.componentProps.analysisType,isAssistZoneVisible:this.filters.isAssistZoneVisible,howManyGames:this.filters.howManyGamesSelected.value,title:l.view.title,isHomeTeamForAnalysis:l.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:l.view.isHomeTeam};return f&&(f.isHomeTeam&&!l.view.isHomeTeam?(l.view.componentProps.categories=[i],l.view.componentProps.analysisType=this.filters.selectedGamePhase.name,l.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,l.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,l.view.componentProps.isHomeTeamForAnalysis=!0,l.view.title=i.name,a.view.titleShort=i.name,l.view.isHomeTeam=!0,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:i,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):!f.isHomeTeam&&!l.view.isHomeTeam&&(l.view.componentProps.categories=f.categories,l.view.componentProps.analysisType=f.analysisType,l.view.componentProps.isHomeTeamForAnalysis=f.isHomeTeamForAnalysis,l.view.componentProps.isAssistZoneVisible=f.isAssistZoneVisible,l.view.componentProps.howManyGames=f.howManyGames,l.view.title=f.title,l.view.titleShort=f.titleShort,l.view.isHomeTeam=f.isHomeTeam,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:l.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}),t===_.length-1&&(a.view.componentProps.categories=b.categories,a.view.componentProps.analysisType=b.analysisType,a.view.componentProps.isHomeTeamForAnalysis=b.isHomeTeamForAnalysis,a.view.componentProps.isAssistZoneVisible=b.isAssistZoneVisible,a.view.componentProps.howManyGames=b.howManyGames,a.view.title=b.title,a.view.titleShort=b.titleShort,a.view.isHomeTeam=b.isHomeTeam,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:a.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})),b},null):(a.view.componentProps.categories=[i],a.view.componentProps.analysisType=this.filters.selectedGamePhase.name,a.view.componentProps.isHomeTeamForAnalysis=!1,a.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,a.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,a.view.title=i.name,a.view.titleShort=i.name,a.view.isHomeTeam=!1,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:i,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})}else{const g=j===1,m=g?this.getHomeTeamViews():this.getAwayTeamViews();a.view.componentProps.isHomeTeamForAnalysis=g,a.view.isHomeTeam=g;for(let n=0;n<k.length;n++){const f=k[n];if(!m.find(l=>l.view.componentProps.categories[0].name===f.name)){a.view.componentProps.categories=[f],a.view.componentProps.analysisType=this.filters.selectedGamePhase.name,a.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,a.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,a.view.title=f.name,a.view.titleShort=f.name,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:f,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible};break}}}}}addView(a,i=!1){var k,j,g,m,n,f,l,t,_,b;if(a.view.filterAndViewsContainer=this,qa.emit("component-added-to-container",this),this.viewId===5&&a.view.componentProps&&!i&&(a.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,a.view.filterMultiple={isHomeTeam:a.view.componentProps.preMatchType===1}),this.viewId===15&&a.view.componentProps&&!i&&(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&&!i&&(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&&!i){const v=this.getComponentDynamicFilters(a.view.id),h=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const o=h[0]===1?"offensive":"defensive",s=h[1]===1;a.view.componentProps.analysisType=o,a.view.componentProps.isHomeTeamForAnalysis=s,a.isHomeTeam=s,a.view.filterMultiple={isHomeTeam:s},qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:h})}if(this.viewId===1&&a.view.componentProps&&!i){const v=this.dynamicFilters[0]||[];if(v&&v.length>0){let h;if(Array.isArray(v)){const s=this.childViews.map(c=>{var d;return(d=c.view.componentProps)==null?void 0:d.type}).filter(c=>c!==void 0),p=v.filter(c=>!s.includes(c));p.length>0?h=p[0]:h=v[0]}else h=v;const o=Wh.get(this.viewId);a.view.componentProps.type=h,a.view.componentProps.default=!1,a.view.title=`Comparativa ${o[h]}`,a.view.filterMultiple={category:h}}}if(this.viewId===9&&a.view.componentProps&&!i){const v=this.dynamicFilters[0].map(p=>p.join("-"));let h="";const o=this.dynamicFilters[1],s=Wh.get(this.viewId);if(o===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(w=>{w.view.componentProps.isHomeTeamForAnalysis=!0,w.view.isHomeTeam=!0,w.view.filterMultiple&&(w.view.filterMultiple.isHomeTeam=!0)});let p=null;const c=this.getHomeTeamViews(),d=this.getAwayTeamViews();let x=!0;for(let w=0;w<v.length;w++){h=v[w],p=s.analysisTypes.get(v[w]);const S=c.find(O=>O.view.componentProps.analysisType===p.analysisType),V=d.find(O=>O.view.componentProps.analysisType===p.analysisType);if(!S||!V){x=!S;break}}x?this.childViews.length===0?(a.view.componentProps.analysisType=p.analysisType,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.title=p.title,a.view.titleShort=p.titleShort,a.view.isHomeTeam=!0,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:h.split("-").map(w=>parseInt(w))}):this.childViews.reduce((w,S,V,O)=>{let U={analysisType:S.view.componentProps.analysisType,title:S.view.title,isHomeTeamForAnalysis:S.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:S.view.isHomeTeam};return w&&(w.isHomeTeam&&!S.view.isHomeTeam?(S.view.componentProps.analysisType=p.analysisType,S.view.componentProps.isHomeTeamForAnalysis=!0,S.view.title=p.title,a.view.titleShort=p.titleShort,S.view.isHomeTeam=!0,S.view.filterMultiple={isHomeTeam:S.view.isHomeTeam,categoryIds:h.split("-").map(z=>parseInt(z))}):!w.isHomeTeam&&!S.view.isHomeTeam&&(S.view.componentProps.analysisType=w.analysisType,S.view.componentProps.isHomeTeamForAnalysis=w.isHomeTeamForAnalysis,S.view.title=w.title,S.view.titleShort=w.titleShort,S.view.isHomeTeam=w.isHomeTeam,S.view.filterMultiple={isHomeTeam:S.view.isHomeTeam,categoryIds:h.split("-").map(z=>parseInt(z))}),V===O.length-1&&(a.view.componentProps.analysisType=U.analysisType,a.view.componentProps.isHomeTeamForAnalysis=U.isHomeTeamForAnalysis,a.view.title=U.title,a.view.titleShort=U.titleShort,a.view.isHomeTeam=U.isHomeTeam,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:h.split("-").map(z=>parseInt(z))})),U},null):(a.view.componentProps.analysisType=p.analysisType,a.view.componentProps.isHomeTeamForAnalysis=!1,a.view.title=p.title,a.view.titleShort=p.titleShort,a.view.isHomeTeam=!1,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:h.split("-").map(w=>parseInt(w))})}else{const p=o===1,c=p?this.getHomeTeamViews():this.getAwayTeamViews();a.view.componentProps.isHomeTeamForAnalysis=p,a.view.isHomeTeam=p;for(let d=0;d<v.length;d++){const x=s.analysisTypes.get(v[d]);if(!c.find(w=>w.view.componentProps.analysisType===x.analysisType)){a.view.componentProps.analysisType=x.analysisType,a.view.title=x.title,a.view.titleShort=x.titleShort,a.view.filterMultiple={categoryIds:v[d].split("-").map(w=>parseInt(w)),isHomeTeam:a.view.isHomeTeam};break}}}}if(this.viewId===2&&!i&&a.view.componentProps){const v=this.getComponentDynamicFilters(a.view.id),h=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id),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 o=this.dynamicFilters[0]||[];let s=null;if(Array.isArray(o)){if(o.length>0){const d=this.childViews.map(w=>{var S;const V=(S=w.view.componentProps)==null?void 0:S.categoryView;return V&&V.length>0?V[0].id:null}).filter(w=>w!==null),x=o.filter(w=>!d.includes(w));x.length>0&&(s=x[0])}}else{const d=o;d&&(this.childViews.find(x=>{var w;const S=(w=x.view.componentProps)==null?void 0:w.categoryView;return S&&S.length>0&&S[0].id===d})||(s=d))}let p=null;if(s)try{p=jh(s)}catch{}const c=h&&h.length>1?h[1]:1;a.view.filterMultiple={categoryId:s,teamType:c},a.view.componentProps.categoryView=p?[{id:s,name:p.name}]:s?[{id:s,name:`Category ${s}`}]:[{id:0,name:"Category"}]}if(this.viewId===8&&a.view.componentProps&&!i&&a.view.game&&(a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0),a.view.componentProps.areInactiveVisible=this.dynamicFilters[0]||!1,a.view.componentProps.game=(k=a.view)==null?void 0:k.game,a.view.componentProps.teamSelected={teamId:(g=(j=a.view)==null?void 0:j.game)==null?void 0:g.home_team},a.view.componentProps.isDefault=!1,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:this.dynamicFilters})),this.viewId===13&&a.view.componentProps&&!i&&(a.view.componentProps.isdefault=!0,a.view.componentProps.seasonid=2010,a.view.teamids=[1,2],a.view.componentProps.categoryids=[20,2],a.view.componentProps.teamsshow=[1,2],a.view.componentProps.analysistype=1,a.view.componentProps.gameid="",a.view.componentProps.teams=[],a.view.componentProps.game=""),this.viewId===15&&a.view.componentProps&&!i&&(a.view.componentProps.isdefault=!0,a.view.componentProps.view=1,a.view.numitems=3,a.view.typegame=1,a.view.componentProps.token=this.token,a.view.componentProps.data={season:2010,type:2,team:14}),this.viewId===14&&a.view.componentProps&&!i&&(a.view.componentProps.isReports=!0,a.view.componentProps.isDefault=!0,a.view.componentProps.type=0,a.view.componentProps.typeView=1,a.view.componentProps.showVideos=!1,a.view.componentProps.currentSeason=2010,a.view.componentProps.localTeam=2,a.view.componentProps.awayTeam=1),this.viewId===6&&a.view.componentProps&&!i){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const v=this.getComponentDynamicFilters(a.view.id),h=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const o=h&&h.length>0?h[0]:[];if(o&&o.length>0){let s=0;for(const p of o)if(!this.childViews.find(c=>c.view.componentProps.gameNumber===p)){s=p;break}s&&(a.view.componentProps.gameNumber=s,a.view.filterMultiple={gameNumber:s})}qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:h})}if(this.viewId===3&&a.view.componentProps&&!i&&a.view.game){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const v=this.getComponentDynamicFilters(a.view.id),h=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const o=h&&h.length>0?h[0]:!1;a.view.componentProps.desplegable=o,a.view.componentProps.key=o,a.view.componentProps.game=(m=a.view)==null?void 0:m.game,a.view.componentProps.defaultShields=!1,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:h})}if(this.viewId===4&&a.view.componentProps&&!i&&a.view.game){if(a.view.componentProps._isReactive||(a.view.componentProps=r.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=(f=(n=a.view)==null?void 0:n.game)==null?void 0:f.game_id,a.view.componentProps.homeTeam=(t=(l=a.view)==null?void 0:l.game)==null?void 0:t.home_team,a.view.componentProps.awayTeam=(b=(_=a.view)==null?void 0:_.game)==null?void 0:b.visiting_team;const o=this.getComponentDynamicFilters(a.view.id),s=o||this.dynamicFilters;!o&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const p=s&&s.length>0?s[0]:[],c=this.hasEventTypeId(p,1),d=this.hasCategoryId(p,8),x=this.hasCategoryId(p,9),w=this.hasEventTypeId(p,3);a.view.componentProps.goals=c,a.view.componentProps.yellowCards=d,a.view.componentProps.redCards=x,a.view.componentProps.substitutions=w}const v=this.getComponentDynamicFilters(a.view.id)||this.dynamicFilters,h=v&&v.length>0?v[0]:[];a.view.componentProps.selectedEvents=h,a.view.componentProps.key=h.length>0,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:v})}this.viewId===16&&this.addLastTouch(a),this.childViews.push(a),qa.emit("view-added")}getHowManyViewsToAdd(a,i=null){if(this.viewId===5||this.viewId===14||this.viewId===13||this.viewId===15)return 1;if(this.viewId===6){const k=a[0];return k===2||k===3?k:1}if(this.viewId===4)return a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0?1:0;if(this.viewId===9){const k=a[0],j=a[1];if(j===1||j===2){const g=j===1?this.getHomeTeamViews():this.getAwayTeamViews();return k.length-g.length}else return k*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===16&&i){const k=i.selectedCategories||[],j=i.selectedTeam.value;if(j===1||j===2){const g=j===1?this.getHomeTeamViews():this.getAwayTeamViews();return k.length-g.length}else return k.length*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===2){const k=a[0]||[],j=a[1]||1;if(!k||k.length===0)return 0;if(Array.isArray(k)){const g=this.childViews.map(m=>{var n;const f=(n=m.view.componentProps)==null?void 0:n.categoryView;return f&&f.length>0?f[0].id:null}).filter(m=>m!==null);return k.filter(m=>!g.includes(m)).length}else{const g=k;return this.childViews.find(m=>{var n,f;const l=(n=m.view.componentProps)==null?void 0:n.categoryView,t=((f=m.view.filterMultiple)==null?void 0:f.teamType)||1;return l&&l.length>0&&l[0].id===g&&t===j})?0:1}}if(this.viewId===1){const k=a[0]||[];if(!k||k.length===0)return 0;if(Array.isArray(k)){const j=this.childViews.map(g=>{var m;return(m=g.view.componentProps)==null?void 0:m.type}).filter(g=>g!==void 0);return k.filter(g=>!j.includes(g)).length}else{const j=k;return this.childViews.find(g=>{var m;return((m=g.view.componentProps)==null?void 0:m.type)===j})?0:1}}return 0}getRequiresAddView(a,i){if(this.viewId===5)return a[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===15)return 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 k=a[0];return k?k.length>this.childViews.length:this.childViews.length===0}if(this.viewId===4){const k=a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0;return this.childViews.length===0&&k}if(this.viewId===9)return this.getRequiresAddViewMultipleAndBothTeams(a);if(this.viewId===16&&i){const k=[i.selectedCategories,i.selectedTeam.value];return this.getRequiresAddViewMultipleAndBothTeams(k,i.totalCategoriesSelected)}if(this.viewId===1){const k=a[0]||[];if(!k||k.length===0)return!1;if(Array.isArray(k)){const j=this.childViews.map(g=>{var m;return(m=g.view.componentProps)==null?void 0:m.type}).filter(g=>g!==void 0);return k.filter(g=>!j.includes(g)).length>0}else{const j=k;return!this.childViews.find(g=>{var m;return((m=g.view.componentProps)==null?void 0:m.type)===j})}}if(this.viewId===2){const k=a[0]||[];if(Array.isArray(k)){if(k.length>0){const j=this.childViews.map(g=>{var m;const n=(m=g.view.componentProps)==null?void 0:m.categoryView;return n&&n.length>0?n[0].id:null}).filter(g=>g!==null);return k.filter(g=>!j.includes(g)).length>0}return!1}else{const j=k,g=a[1]||1;return j?!this.childViews.find(m=>{var n,f;const l=(n=m.view.componentProps)==null?void 0:n.categoryView,t=((f=m.view.filterMultiple)==null?void 0:f.teamType)||1;return l&&l.length>0&&l[0].id===j&&t===g}):!1}}return this.viewId===8||this.viewId===3||this.viewId===14?this.childViews.length===0:!1}getRequiresAddViewMultipleAndBothTeams(a,i=null){const k=this.childViews.filter(l=>l.view.isHomeTeam),j=this.childViews.filter(l=>!l.view.isHomeTeam),g=i||a[0].length,m=a[1],n=g*(m===1||m===2?1:2),f=m===3?k.length+j.length:k.length||j.length;return n>f}getRequiresLessViews(a){if(this.viewId===5)return a[0]!==3&&this.childViews.length>1;if(this.viewId===15)return a[0]!==3&&this.childViews.length>1;if(this.viewId===6){const i=a[0];return i===2||i===3}return this.viewId,!1}updateSummary({dynamicFilters:a}){const i=this.childViews[0],k=document.querySelector(`[gs-id="${i.view.id}"]`),j=i.grid;if(i&&k&&j){const g=a[0],m=`min_column${g?"_2":""}`,n=`min_row${g?"_2":""}`,f=`max_column${g?"_2":""}`,l=`max_row${g?"_2":""}`,t=`colspan${g?"_2":""}`,_=`rowspan${g?"_2":""}`,b=i.view.coreView[t],v=i.view.coreView[_],h=i.view.coreView[m],o=i.view.coreView[n],s=i.view.coreView[f],p=i.view.coreView[l];i.view.w=b,i.view.h=v,i.view.maxWidth=s,i.view.maxHeight=p,i.view.minWidth=h,i.view.minHeight=o,k.setAttribute("gs-w",b),k.setAttribute("gs-h",v),k.setAttribute("gs-max-w",s),k.setAttribute("gs-max-h",p),k.setAttribute("gs-min-w",h),k.setAttribute("gs-min-h",o),j.update(k,{h:v,w:b,"gs-max-h":p,"gs-max-w":s,"gs-min-h":o,"gs-min-w":h})}}updateFilters(a){this.filters=a,this.viewId===16&&this.updateLastTouchFilters(a)}updateDynamicFilters(a,i=null){if(!this._isUpdating){this._isUpdating=!0,i?this.componentSpecificFilters.set(i,[...a]):this.dynamicFilters=a,qa.emit("component-added-to-container",this);try{if(this.viewId===5){const k=a[0]||1;if(k<3)if(this.childViews.length===1){const j=this.childViews[0];j.view.componentProps&&(j.view.componentProps.preMatchType=k,j.view.filterMultiple={isHomeTeam:j.view.componentProps.preMatchType===1})}else{const j=this.childViews.pop(),g=j.grid,m=j.page,n=document.querySelector(`[gs-id="${j.view.id}"]`);if(g&&n&&(g.removeWidget(n),m)){const l=m.items.findIndex(t=>t.id===j.view.id);l!==-1&&m.items.splice(l,1)}const f=this.childViews[0];f.view.componentProps&&(f.view.componentProps.preMatchType=k,f.view.filterMultiple={isHomeTeam:f.view.componentProps.preMatchType})}else this.childViews.forEach((j,g)=>{j.view.componentProps.preMatchType=g+1,j.view.filterMultiple={isHomeTeam:j.view.componentProps.preMatchType}})}if(this.viewId===15){const k=a[0]||1;if(i){const j=this.childViews.find(g=>g.view.id===i);j&&j.view.componentProps&&(j.view.componentProps.preMatchType=k,j.view.filterMultiple={isHomeTeam:k===1})}else if(k<3){if(this.childViews.length===1){const j=this.childViews[0];j.view.componentProps&&(j.view.componentProps.preMatchType=k,j.view.filterMultiple={isHomeTeam:k===1})}else if(this.childViews.length>1){for(;this.childViews.length>1;){const g=this.childViews.pop(),m=g.grid,n=g.page,f=document.querySelector(`[gs-id="${g.view.id}"]`);if(m&&f&&(m.removeWidget(f),n)){const l=n.items.findIndex(t=>t.id===g.view.id);l!==-1&&n.items.splice(l,1)}}const j=this.childViews[0];j.view.componentProps&&(j.view.componentProps.preMatchType=k,j.view.filterMultiple={isHomeTeam:k===1})}}else if(this.childViews.length===2)this.childViews.forEach((j,g)=>{j.view.componentProps&&(j.view.componentProps.preMatchType=g+1,j.view.filterMultiple={isHomeTeam:g===0})});else if(this.childViews.length<2)this.childViews.forEach((j,g)=>{j.view.componentProps&&(j.view.componentProps.preMatchType=g+1,j.view.filterMultiple={isHomeTeam:g===0})});else{for(;this.childViews.length>2;){const j=this.childViews.pop(),g=j.grid,m=j.page,n=document.querySelector(`[gs-id="${j.view.id}"]`);if(g&&n&&(g.removeWidget(n),m)){const f=m.items.findIndex(l=>l.id===j.view.id);f!==-1&&m.items.splice(f,1)}}this.childViews.forEach((j,g)=>{j.view.componentProps&&(j.view.componentProps.preMatchType=g+1,j.view.filterMultiple={isHomeTeam:g===0})})}}if(this.viewId===10){const k=a[0]||1;if(k<3)if(this.childViews.length===1){const j=this.childViews[0];j.view.componentProps&&(j.view.componentProps.isHomeTeamForAnalysis=k===1,j.view.filterMultiple={isHomeTeam:j.view.componentProps.isHomeTeamForAnalysis})}else{const j=this.childViews.pop(),g=j.grid,m=j.page,n=document.querySelector(`[gs-id="${j.view.id}"]`);if(g&&n&&(g.removeWidget(n),m)){const l=m.items.findIndex(t=>t.id===j.view.id);l!==-1&&m.items.splice(l,1)}const f=this.childViews[0];f.view.componentProps&&(f.view.componentProps.isHomeTeamForAnalysis=k===1,f.view.filterMultiple={isHomeTeam:f.view.componentProps.isHomeTeamForAnalysis})}else this.childViews.forEach((j,g)=>{j.view.componentProps.isHomeTeamForAnalysis=g%2===0,j.view.filterMultiple={isHomeTeam:j.view.componentProps.isHomeTeamForAnalysis}})}if(this.viewId===7){const k=a[1];if(k===3)this.childViews.forEach((j,g)=>{j.view.componentProps.isHomeTeamForAnalysis=g%2===0,j.view.isHomeTeam=g%2===0,j.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",j.view.filterMultiple={isHomeTeam:j.view.isHomeTeam}});else{const j=k===1;if(this.childViews.length>0){const g=this.childViews[0];g.view.componentProps.isHomeTeamForAnalysis=j,g.view.isHomeTeam=j,g.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",g.view.filterMultiple={isHomeTeam:j},this.childViews.length>1&&this.removeChildView(this.childViews[1])}}}if(this.viewId===9){const k=a[0],j=a[1];if(j===3){if(this.childViews.length>k.length){const g=k.map(m=>{const n=m.join("-");return Wh.get(this.viewId).analysisTypes.get(n).analysisType});this.childViews.reduce((m,n)=>(g.includes(n.view.componentProps.analysisType)||m.push(n.view.componentProps.analysisType),m),[]).forEach(m=>{const n=this.childViews.findIndex(f=>f.view.componentProps.analysisType===m);if(n!==-1){const f=this.childViews[n];this.removeChildView(f)}})}}else{const g=j===1,m=this.getHomeTeamViews(),n=this.getAwayTeamViews();if(g&&m.length===0)n.forEach(f=>{f.view.componentProps.isHomeTeamForAnalysis=g,f.view.isHomeTeam=g,f.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}});else if(!g&&n.length===0)m.forEach(f=>{f.view.componentProps.isHomeTeamForAnalysis=g,f.view.isHomeTeam=g,f.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}});else if(m.length===n.length)g||m.forEach(f=>{f.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}}),(g?n:m).forEach(f=>{this.removeChildView(f)});else{const f=g?this.getHomeTeamViews():this.getAwayTeamViews();if(f.length>k.length){const l=k.map(t=>{const _=t.join("-");return Wh.get(this.viewId).analysisTypes.get(_).analysisType});f.forEach(t=>{l.includes(t.view.componentProps.analysisType)?t.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}:this.removeChildView(t)})}else f.forEach(l=>{l.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}})}}}if(this.viewId===2){const k=a[0]||[];if(Array.isArray(k)){const j=this.childViews.map(g=>{var m,n;const f=(m=g.view.componentProps)==null?void 0:m.categoryView,l=((n=g.view.filterMultiple)==null?void 0:n.teamType)||1,t=f&&f.length>0?f[0].id:null;return t?{categoryId:t,teamType:l,viewId:g.view.id}:null}).filter(g=>g!==null);if(i){const g=this.childViews.find(m=>m.view.id===i);if(g){const m=a[1]||1,n=k[0];if(n){let f=null;try{f=jh(n)}catch{}g.view.filterMultiple={categoryId:n,teamType:m},g.view.componentProps.game&&(m===1?g.view.componentProps.teamView=g.view.componentProps.game.homeTeam.team_id:m===2?g.view.componentProps.teamView=g.view.componentProps.game.awayTeam.team_id:g.view.componentProps.teamView=0),g.view.componentProps.categoryView=f?[{id:n,name:f.name}]:[{id:n,name:`Category ${n}`}]}}}if(!i){const g=a[1]||1;this.childViews.forEach(m=>{var n;const f=(n=m.view.componentProps)==null?void 0:n.categoryView;if(f&&f.length>0){const l=f[0].id;k.includes(l)&&(m.view.filterMultiple={categoryId:l,teamType:g})}})}if(j.map(g=>g.categoryId).filter(g=>!k.includes(g)).forEach(g=>{this.childViews.filter(m=>{var n;const f=(n=m.view.componentProps)==null?void 0:n.categoryView;return f&&f.length>0&&f[0].id===g}).forEach(m=>{this.removeChildView(m),qa.emit("component-removed",{viewId:m.view.id,categoryId:g})})}),i){const g=k[0];if(g){const m=this.childViews.find(n=>n.view.id===i);if(m){let n=null;try{n=jh(g)}catch{}const f=a[1]||1;m.view.filterMultiple={categoryId:g,teamType:f},m.view.componentProps.game&&(m.view.componentProps.teamView=f===2?m.view.componentProps.game.awayTeam.team_id:f===1?m.view.componentProps.game.homeTeam.team_id:0),m.view.componentProps.categoryView=n?[{id:g,name:n.name}]:[{id:g,name:`Category ${g}`}]}}}}else{const j=k;if(j&&i){const g=this.childViews.find(m=>m.view.id===i);if(g){let m=null;try{m=jh(j)}catch{}const n=a[1]||1;g.view.filterMultiple={categoryId:j,teamType:n},g.view.componentProps.game&&(g.view.componentProps.teamView=n===2?g.view.componentProps.game.awayTeam.team_id:n===1?g.view.componentProps.game.homeTeam.team_id:0),g.view.componentProps.categoryView=m?[{id:j,name:m.name}]:[{id:j,name:`Category ${j}`}]}}}}if(this.viewId===8){const k=a[0]||!1;this.childViews.forEach(j=>{j.view.componentProps&&(j.view.componentProps._isReactive||(j.view.componentProps=r.reactive(j.view.componentProps),j.view.componentProps._isReactive=!0),j.view.componentProps.areInactiveVisible=k,j.view.componentProps.key=k,qa.emit("component-props-updated",{viewId:j.view.id,componentProps:j.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:j.view.id,dynamicFilters:a}))})}if(this.viewId===1){const k=a[0]||[];if(i){this.setDynamicFilters(a,i);const j=this.childViews.find(g=>g.view.id===i);j&&this.updateComparative(j,a)}else if(this.childViews.reduce((j,g)=>(k.includes(g.view.componentProps.type)||j.push(g.view.componentProps.type),j),[]).forEach(j=>{const g=this.childViews.findIndex(m=>m.view.componentProps.type===j);if(g!==-1){for(let m=g;m<this.childViews.length;m++){const n=this.childViews[m+1],f=this.childViews[m];n&&(f.view.componentProps.type=n.view.componentProps.type,f.view.title=n.view.title)}this.removeChildView(this.childViews[this.childViews.length-1])}}),Array.isArray(k))this.childViews.length>0&&k.length>0&&this.childViews.forEach((j,g)=>{if(j.view.componentProps&&g<k.length){const m=k[g],n=Wh.get(this.viewId);j.view.componentProps.type=m,j.view.componentProps.default=!1,j.view.title=`Comparativa ${n[m]}`,j.view.filterMultiple={category:m}}});else{const j=k;if(j&&this.childViews.length>0){const g=this.childViews[0];if(g.view.componentProps){const m=Wh.get(this.viewId);g.view.componentProps.type=j,g.view.componentProps.default=!1,g.view.title=`Comparativa ${m[j]}`,g.view.filterMultiple={category:j}}}}}if(this.viewId===6){const k=a[0]||[];if(i){this.setDynamicFilters(a,i);const j=this.childViews.find(g=>g.view.id===i);j&&this.updateGSCLineupsReports(j,a)}else{if(Array.isArray(k))if(k.length===0)for(;this.childViews.length>0;)this.removeChildView(this.childViews[0]);else this.childViews.reduce((j,g)=>(k.includes(g.view.componentProps.gameNumber)||j.push(g.view.componentProps.gameNumber),j),[]).forEach(j=>{const g=this.childViews.findIndex(m=>m.view.componentProps.gameNumber===j);if(g!==-1){for(let m=g;m<this.childViews.length;m++){const n=this.childViews[m+1],f=this.childViews[m];n&&(f.view.componentProps.gameNumber=n.view.componentProps.gameNumber,f.view.filterMultiple={gameNumber:n.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=r.reactive(j.view.componentProps),j.view.componentProps._isReactive=!0),qa.emit("component-props-updated",{viewId:j.view.id,componentProps:j.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:j.view.id,dynamicFilters:a}))})}}if(this.viewId===3){if(i){this.setDynamicFilters(a,i);const k=this.childViews.find(j=>j.view.id===i);k&&this.updateMatchSummary(k,a)}else{const k=a[0]||!1;this.childViews.forEach(j=>{j.view.componentProps&&(j.view.componentProps._isReactive||(j.view.componentProps=r.reactive(j.view.componentProps),j.view.componentProps._isReactive=!0),j.view.componentProps.desplegable=k,j.view.componentProps.key=k,qa.emit("component-props-updated",{viewId:j.view.id,componentProps:j.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:j.view.id,dynamicFilters:a}))})}this.updateSummary({dynamicFilters:a})}if(this.viewId===13){const k=a[1]||[];if(i){this.setDynamicFilters(a,i);const j=this.childViews.find(g=>g.view.id===i);j&&(j.view.componentProps&&(j.view.componentProps.categoryids=k,j.view.componentProps.analysistype=a[0]||1,j.view.componentProps.teamsshow=a[2]==1?[1]:a[2]==2?[2]:[1,2],j.view.dynamicFilters=a,j.view._updateKey=Date.now()),qa.emit("component-props-updated",{viewId:j.view.id,componentProps:j.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:j.view.id,dynamicFilters:a}))}else this.childViews.forEach(j=>{j.view.componentProps&&(j.view.componentProps._isReactive||(j.view.componentProps=r.reactive(j.view.componentProps),j.view.componentProps._isReactive=!0),j.view.componentProps.categoryids=k,j.view.componentProps.analysistype=a[0]||1,j.view.componentProps.teamsshow=a[2]==1?[1]:a[2]==2?[2]:[1,2],j.view.dynamicFilters=a,j.view._updateKey=Date.now(),qa.emit("component-props-updated",{viewId:j.view.id,componentProps:j.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:j.view.id,dynamicFilters:a}))})}else if(this.viewId===15){const k=a[0]||1,j=a[3]!==void 0?a[3]:typeof a[1]=="number"?a[1]:null;if(i){this.setDynamicFilters(a,i);const g=this.childViews.find(m=>m.view.id===i);g&&g.view.componentProps&&(g.view.componentProps.analysistype=k,j!==null&&(g.view.componentProps.numitems=j),g.view.dynamicFilters=a,g.view._updateKey=Date.now(),qa.emit("component-props-updated",{viewId:g.view.id,componentProps:g.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:g.view.id,dynamicFilters:a}))}else this.childViews.forEach(g=>{g.view.componentProps&&(g.view.componentProps._isReactive||(g.view.componentProps=r.reactive(g.view.componentProps),g.view.componentProps._isReactive=!0),g.view.componentProps.analysistype=k,j!==null&&(g.view.componentProps.numitems=j),g.view.dynamicFilters=a,g.view._updateKey=Date.now(),qa.emit("component-props-updated",{viewId:g.view.id,componentProps:g.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:g.view.id,dynamicFilters:a}))})}if(this.viewId===4){const k=a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0;if(i){const j=this.childViews.find(g=>g.view.id===i);j&&j.view.componentProps.selectedEvents}else if(!k&&this.childViews.length>0)this.childViews.forEach(j=>{this.removeChildView(j)});else if(k&&this.childViews.length===0){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};qa.emit("add-view",j)}else this.childViews.forEach(j=>{this.updateTimeline(j,a)})}}finally{this._isUpdating=!1}}}removeAllChildViews(){[...this.childViews].forEach(a=>{this.removeChildView(a)})}removeChildView(a,i=!1){const k=this.childViews.findIndex(j=>j.view.id===a.view.id);if(k!==-1){const j=this.childViews[k];this.childViews.splice(k,1),j.view.id&&this.componentSpecificFilters.delete(j.view.id);const g=j.grid,m=j.page,n=document.querySelector(`[gs-id="${j.view.id}"]`);if(g&&n&&(g.removeWidget(n),m&&!i)){const f=m.items.findIndex(l=>l.id===j.view.id);f!==-1&&(m.items.splice(f,1),m.items.length===0&&qa.emit("empty-page",m))}}}updateView({view:a,dynamicFilters:i,filtersJSON:k,filters:j}){this.setFiltersJSON(k),this.dynamicFilters=i;const g=this.childViews.find(m=>{var n;return((n=m.view)==null?void 0:n.id)===a.view.id});if(g){g.view.filtersJSON=k,g.view.coreView&&(g.view.coreView.filtersJSON=k);let m=i;if(this.viewId===4){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===8){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===3){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n),this.updateSummary({dynamicFilters:m})}else if(this.viewId===1){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===6){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===7){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===9){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}this.viewId===5?this.updateVolumetricField(g,m):this.viewId===7?this.updateGoalData(g,m):this.viewId===9?this.updateFieldDataByZones(g,i):this.viewId===10?this.updateXg(g,m):this.viewId===3?this.updateMatchSummary(g,m):this.viewId===4?this.updateTimeline(g,m):this.viewId===8?this.updateFieldPosesion(g,m):this.viewId===1?this.updateComparative(g,m):this.viewId===2?this.updateGSCtops(g,m):this.viewId===6?this.updateGSCLineupsReports(g,m):this.viewId===16&&this.updateLastTouchSingle(g,j)}}updateComparative(a,i){if(a.view.componentProps){const k=i[0]||[];if(k&&k.length>0){let j;if(Array.isArray(k)){const m=this.childViews.findIndex(n=>n.view.id===a.view.id);m>=0&&m<k.length?j=k[m]:j=k[0]}else j=k;const g=Wh.get(this.viewId);a.view.componentProps.type=j,a.view.componentProps.default=!1,a.view.title=`Comparativa ${g[j]}`,a.view.filterMultiple={category:j}}qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i})}}updateVolumetricField(a,i){if(a.view.componentProps){const k=i[0]||1;a.view.isHomeTeam=k===1,a.view.componentProps.preMatchType=k,a.view.filterMultiple={isHomeTeam:k},qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i}),qa.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateGoalData(a,i){if(a.view.componentProps){const k=i[0]===1?"offensive":"defensive",j=i[1]===1;a.view.componentProps.analysisType=k,a.view.componentProps.isHomeTeamForAnalysis=j,a.view.isHomeTeam=j,a.view.filterMultiple={isHomeTeam:j},qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i}),qa.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateFieldDataByZones(a,i){if(a.view.componentProps){const k=i[0],j=i[1]===1;if(a.view.componentProps.isHomeTeamForAnalysis=j,a.view.isHomeTeam=j,a.view.filterMultiple={categoryIds:k,isHomeTeam:j},k&&k.length){const g=k.join("-"),m=Wh.get(this.viewId).analysisTypes.get(g);m&&(a.view.componentProps.analysisType=m.analysisType,a.view.title=m.title,a.view.titleShort=m.titleShort)}}}updateXg(a,i){const k=i[0]===1;a.view.componentProps&&(a.view.isHomeTeam=k,a.view.componentProps.isHomeTeamForAnalysis=k,a.view.filtersJSON=this.filtresJSON,a.view.filterMultiple={isHomeTeam:k})}updateMatchSummary(a,i){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const k=i&&i.length>0?i[0]:!1;a.view.componentProps.desplegable=k,a.view.componentProps.key=k,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i})}}updateTimeline(a,i){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const k=this.getComponentDynamicFilters(a.view.id)||i,j=k&&k.length>0?k[0]:[];a.view.componentProps.selectedEvents=j,a.view.componentProps.key=j.length>0;const g=this.hasEventTypeId(j,1),m=this.hasCategoryId(j,8),n=this.hasCategoryId(j,9),f=this.hasEventTypeId(j,3);a.view.componentProps.goals=g,a.view.componentProps.yellowCards=m,a.view.componentProps.redCards=n,a.view.componentProps.substitutions=f,a.view.componentProps._updateKey=Date.now(),qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:k}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:k}),qa.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateFieldPosesion(a,i){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const k=i&&i.length>0?i[0]:!1;a.view.componentProps.areInactiveVisible=k,a.view.componentProps.key=k,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i})}}updateGSCtops(a,i){if(a.view.componentProps){const k=i[0]||[];if(Array.isArray(k)){if(k.length>0){const j=k[0];let g=null;try{g=jh(j)}catch(n){console.warn("Error getting category by ID:",n)}const m=i[1]||1;a.view.filterMultiple={categoryId:j,teamType:m},a.view.componentProps.game&&(m===1?a.view.componentProps.teamView=a.view.componentProps.game.homeTeam.team_id:m===2?a.view.componentProps.teamView=a.view.componentProps.game.awayTeam.team_id:a.view.componentProps.teamView=0),a.view.componentProps.categoryView=g?[{id:j,name:g.name}]:[{id:j,name:`Category ${j}`}]}}else{const j=k;if(j){let g=null;try{g=jh(j)}catch(n){console.warn("Error getting category by ID:",n)}const m=i[1]||1;a.view.filterMultiple={categoryId:j,teamType:m},a.view.componentProps.game&&(m===1?a.view.componentProps.teamView=a.view.componentProps.game.homeTeam.team_id:m===2?a.view.componentProps.teamView=a.view.componentProps.game.awayTeam.team_id:a.view.componentProps.teamView=0),a.view.componentProps.categoryView=g?[{id:j,name:g.name}]:[{id:j,name:`Category ${j}`}]}}}}updateGSCLineupsReports(a,i){if(a.view.componentProps){const k=i[0]||[];if(Array.isArray(k)){if(k.length>0){const j=k[0];a.view.filterMultiple={gameNumber:j},a.view.componentProps.gameNumber=j}}else{const j=k;j&&(a.view.filterMultiple={gameNumber:j},a.view.componentProps.gameNumber=j)}qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i}),qa.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}getCategoryIdFromAnalysisType(a,i){if(!a||!i)return null;for(const k of i){const j=k.join("-"),g=Wh.get(this.viewId);if(g&&g.analysisTypes){const m=g.analysisTypes.get(j);if(m&&m.analysisType===a)return k[0]||null}}return null}updateLastTouchFilters(){if(!this.filters){console.warn("No filters available in updateLastTouchFilters");return}this.childViews.forEach(j=>{j.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,j.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,j.view.filterMultiple.howManyGamesSelected=this.filters.howManyGamesSelected,j.view.filterMultiple.isAssistZoneVisible=this.filters.isAssistZoneVisible});const a=this.filters.selectedCategories.map(j=>j.value),i=a.map(j=>j.name),k=this.filters.selectedTeam.value;if(k===3)this.childViews.length>a&&this.childViews.reduce((j,g)=>(i.includes(g.view.componentProps.categories[0].name)||j.push(g.view.componentProps.categories[0].name),j),[]).forEach(j=>{const g=this.childViews.findIndex(m=>m.view.componentProps.categories[0].name===j);if(g!==-1){const m=this.childViews[g];this.removeChildView(m)}});else{const j=k===1,g=this.getHomeTeamViews(),m=this.getAwayTeamViews();if(j&&g.length===0)m.forEach(n=>{n.view.componentProps.isHomeTeamForAnalysis=j,n.view.isHomeTeam=j,n.view.filterMultiple.isHomeTeam=j});else if(!j&&m.length===0)g.forEach(n=>{n.view.componentProps.isHomeTeamForAnalysis=j,n.view.isHomeTeam=j,n.view.filterMultiple.isHomeTeam=j});else if(g.length===m.length)j||g.forEach(n=>{n.view.componentProps.isHomeTeamForAnalysis=j,n.view.isHomeTeam=j,n.view.filterMultiple.isHomeTeam=j}),(j?m:g).forEach(n=>{this.removeChildView(n)});else{const n=j?this.getHomeTeamViews():this.getAwayTeamViews();if(n.length>a.length){const f=a.map(l=>l.name);n.forEach(l=>{f.includes(l.view.componentProps.categories[0].name)?l.view.filterMultiple.isHomeTeam=j:this.removeChildView(l)})}else n.forEach(f=>{f.view.filterMultiple.isHomeTeam=j})}}}updateLastTouchSingle(a,i){if(a.view.componentProps){const k=i.selectedTeam.value===1,j=i.selectedCategory.value;a.view.isHomeTeam=k,a.view.componentProps.isHomeTeamForAnalysis=k,a.view.componentProps.categories=[j],a.view.componentProps.analysisType=i.selectedGamePhase.name,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.componentProps.isAssistZoneVisible=i.isAssistZoneVisible,a.view.componentProps.howManyGames=i.howManyGamesSelected.value,a.view.title=j.name,a.view.titleShort=j.name,a.view.isHomeTeam=k,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:j,selectedGamePhase:i.selectedGamePhase,howManyGamesSelected:i.howManyGamesSelected,isAssistZoneVisible:i.isAssistZoneVisible}}}}const J5e={class:"template-page__header"},B5e={class:"template-page__header__name"},G5e=["value"],Z5e={class:"template-page__header__details"},H5e={class:"template-page__header__details__teams"},Y5e={class:"template-page__header__details__teams__team"},Q5e={key:0,class:"template-page__header__details__teams__team__logo"},$5e=["src"],e_e={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t_e={class:"template-page__header__details__teams__team"},r_e={key:0,class:"template-page__header__details__teams__team__logo"},n_e=["src"],a_e={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i_e={class:"template-page__content"},o_e=["id"],s_e=["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"],l_e=r.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(e,{emit:a}){var i,k,j;const g=r.ref(null);let m=null;const n=e,f=r.ref(!1),l=a,t=r.computed(()=>n.page.items.reduce((W,K)=>(W.set(K.id,K),W),new Map)),_=r.computed(()=>{var W,K,X,D;return n.game&&n.game.homeTeam&&n.game.awayTeam?{homeTeam:{name:((W=n.game.homeTeam)==null?void 0:W.acronym)||"LOC",logo:((K=n.game.homeTeam)==null?void 0:K.logo)||null},awayTeam:{name:((X=n.game.awayTeam)==null?void 0:X.acronym)||"VIS",logo:((D=n.game.awayTeam)==null?void 0:D.logo)||null}}:{homeTeam:{name:"LOC"},awayTeam:{name:"VIS"}}});let b=null,v=null,h=!1,o=null,s=!1;const p=()=>{s=!0},c=()=>{s=!1};function d(){s||(h=!0,o&&clearTimeout(o),o=setTimeout(()=>{h=!1},150))}function x(){const W={root:null,rootMargin:"0px",threshold:.7};b=new IntersectionObserver(D=>{D.forEach(H=>{if(h){v&&clearTimeout(v),v=setTimeout(()=>{l("intersection-changed",H.isIntersecting)},100);return}v&&clearTimeout(v),v=setTimeout(()=>{l("intersection-changed",H.isIntersecting)},50)})},W);const K=g.value;K&&b.observe(K);const X=document.querySelector(".container-main");X&&X.addEventListener("scroll",d,{passive:!0}),document.addEventListener("programmatic-scroll-start",p),document.addEventListener("programmatic-scroll-end",c)}function w(W){n.page.title=W.target.value,l("view-changed")}const S={game_id:0,season_id:0,prematch:!1},V={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:[]}},O=new Map([[5,{component:KT,componentName:"GSCVolumetricField",props:{isGamePreMatch:!n.isPostMatch,areTeamsVisible:!1,isTitleVisible:!1,isGhostEffect:n.isTemplateMode,isTemplateMode:n.isTemplateMode,preMatchType:1}}],[2,{component:q4,componentName:"GscTopPlayer",props:{categoryView:[{id:0,name:"Category"}],gamed:n.game?n.game.id:V.gameId,game:n.game,season:n.game?(i=n==null?void 0:n.game)==null?void 0:i.season_id:V.seasonId,teamView:0,useDummyData:n.isTemplateMode}}],[8,{component:Pk,componentName:"FieldPosesion",props:{widthSection:600,game:V,teamSelected:{teamId:0},areInactiveVisible:!0,showTitle:!1,isDefault:!0,key:!1}}],[6,{component:M8,componentName:"GSCLineupsReports",props:{selectedOption:n.isPostMatch?"Postmatch":"Prematch",game:S,gamehome:S,gameaway:S}}],[3,{component:Rk,componentName:"GSCMatchSummary",props:{game:V,defaultShields:!0,desplegable:!1}}],[4,{component:w7,componentName:"GSCTimelineReports",props:{key:!0,isDefault:!0,gameId:V.gameId,homeTeam:V.homeTeam.team_id,awayTeam:V.awayTeam.team_id,token:n.token,goals:!0,yellowCards:!0,redCards:!0,substitutions:!0}}],[7,{component:N9,componentName:"GSCGoalData",props:{game:n.game,isHomeTeamForAnalysis:!0,canInteract:!1,canPlayVideos:!1,isPreMatch:!n.isPostMatch,analysisType:1}}],[9,{component:j8,componentName:"GSCFieldDataByZones",props:{game:n.game,isHomeTeamForAnalysis:!0,analysisType:"successfulPasses",canPlayVideos:!1,isPreMatch:!n.isPostMatch,negative:!0}}],[10,{component:t5,componentName:"GSCGameXg",props:{game:n.game,isHomeTeamForAnalysis:!0,isPostMatch:n.isPostMatch}}],[13,{component:HS,componentName:"GSCTimelapseTable",props:{isdefault:!0,seasonId:n.game?(k=n==null?void 0:n.game)==null?void 0:k.season_id:0,teamsIds:[8,13],categoryIds:[20,2],analysisType:1,teamsshow:[1],gameId:90401,teams:[{id:8,name:"MAZ",logo:"https://golstatsimages.blob.core.windows.net/teams-80/8.png"},{id:13,name:"SNL",logo:"https://golstatsimages.blob.core.windows.net/teams-80/13.png"}]}}],[14,{component:lS,componentName:"GSCGeneraltable",props:{isReports:!0,isDefault:!0,type:0,typeView:1,tournament:1,currentSeasonId:2010,showVideos:!1,localTeam:2,awayTeam:1}}],[15,{component:kN,componentName:"GSCStrengths",props:{token:n.token,view:1,numitems:3,typegame:1,isdefault:!0,data:{player:35240,season:1772,type:2,team:14}}}],[10,{component:t5,componentName:"GSCGameXg",props:{game:n.game,isHomeTeamForAnalysis:!0,isPostMatch:n.isPostMatch}}],[1,{component:S9,componentName:"GSCComparativeReports",props:{gameId:n.game?n.game.id:"",homeLogo:n.game?n.game.homeTeam.logo:"",awayLogo:n.game?n.game.awayTeam.logo:"",seasonId:n.game?(j=n==null?void 0:n.game)==null?void 0:j.season_id:0,typeGame:n.isPostMatch,type:"stoppedBall",default:n.isTemplateMode}}],[16,{component:zN,componentName:"GSCLastTouch",props:{categories:[{name:"Goles",color:"#336DFF",points:[1,2,3],categories:[12,55,"35_r","54_r"],invert:[35,54],negative:!1,translationKey:"chalkboard.offensive.team.goals",singleName:"Gol",isDefaultSelected:!0}],gameIdsForAnalysis:[],isAssistZoneVisible:!1,seasonId:2010,analysisType:"offensive",teamIdForAnalysis:17,gameDataUTC:"2025-11-08T03:00:00Z",isHomeTeamForAnalysis:!0,isTemplateMode:n.isTemplateMode,isPreMatch:!n.isPostMatch}}]]);function U(W){if(W)if(typeof W=="string"){let K=null;switch(W){case"GSCVolumetricField":K=KT;break;case"GSCGoalData":K=N9;break;case"GscTopPlayer":K=q4;break;case"FieldPosesion":K=Pk;break;case"GSCLineupsReports":K=M8;break;case"GSCMatchSummary":K=Rk;break;case"GSCTimelineReports":K=w7;break;case"GSCFieldDataByZones":K=j8;break;case"GSCGeneraltable":K=lS;break;case"GSCTimelapseTable":K=HS;break;case"GSCGameXg":K=t5;break;case"GSCComparativeReports":K=S9;break;case"GSCStrengths":K=kN;break;case"GSCLastTouch":K=zN;break;default:K=null}return K}else return W;return null}function z({pageId:W,view:K,filterAndWidgetContainer:X,applyMinimumSize:D=!1,dynamicFilters:H=[],filters:ne=null}){if(n.page.id===W&&m){let B=!1;K.id===3&&(B=H[0]);const re=`min_column${B?"_2":""}`,ee=`min_row${B?"_2":""}`,Y=`colspan${B?"_2":""}`,$=`rowspan${B?"_2":""}`,le={w:D?K[re]:K[Y],h:D?K[ee]:K[$]};if(m.willItFit(0,0,le.w,le.h,!0)){const ie=m.addWidget(le),ue=Number(ie.getAttribute("gs-x")||0),he=Number(ie.getAttribute("gs-y")||0);m.removeWidget(ie);const ae=O.get(K.id),de=r.reactive({...JSON.parse(JSON.stringify(ae.props))||{},_isReactive:!0}),ce=r.reactive({pageId:W,grid:m,page:n.page,view:{name:K.name,title:K.title,key:Date.now()-7*Math.random(),id:`w-${String(Date.now())}`,x:ue,y:he,w:le.w,h:le.h,maxWidth:K.max_column,maxHeight:K.max_row,minWidth:K.min_column,minHeight:K.min_row,componentName:ae.componentName,componentProps:de,pageId:W,coreView:K}});X.addView(ce),qa.emit("add-page-view",ce)}else qa.emit("add-page-and-view",{pageId:W,view:K,filterAndWidgetContainer:X})}}function L(W){if(m){const K=document.querySelector(`[gs-id="${W.id}"]`);K&&(m.removeWidget(K),l("delete-view",W))}}function C(W){if(!W.filterAndViewsContainer&&W.coreView){const K=new H0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[W],W.coreView.id,W.dynamicFilters||[],n.isPostMatch,n.isTemplateMode,W.filtersJSON,null,W.filters);W.filterAndViewsContainer=K}l("edit-view",W)}function q(){l("delete-page",n.page)}function N(){qa.emit("change-sort",n.page)}function P(W){if(h)return;const K=n.page.items.find(X=>X.id===W.itemId||X.id===W.viewId);K&&(Object.assign(K.componentProps,W.componentProps),K._updateKey=Date.now())}function T(W){if(h)return;const K=n.page.items.find(X=>X.id===W.viewId);K&&(Object.assign(K.componentProps,W.componentProps),K._updateKey=Date.now())}function E(W){if(h)return;const K=n.page.items.find(X=>X.id===W.viewId);K&&(Object.assign(K.componentProps,W.componentProps||{}),K._updateKey=Date.now())}const R=function(){qa.off("add-view",z),qa.off("force-component-update",P),qa.off("component-props-updated",T),qa.off("dynamic-filters-changed",E);const W=document.querySelector(".container-main");W&&W.removeEventListener("scroll",d),v&&clearTimeout(v),o&&clearTimeout(o)};return qa.on("add-view",z),qa.on("force-component-update",P),qa.on("component-props-updated",T),qa.on("dynamic-filters-changed",E),r.onMounted(async()=>{await r.nextTick(),m=vi.init({column:12,row:12,maxRow:12,cellHeight:60,float:!0,resizable:{handles:"e, se, s, sw, w"}},`#grid-stack-${n.id}`),m.on("change",(W,K)=>{const X=K[0];if(X){const D=t.value.get(X.id);D&&(D.x=X.x,D.y=X.y,D.w=X.w,D.h=X.h,l("view-changed"))}}),x(),n.page.grid=m,n.page.offListeners=R}),r.onUnmounted(()=>{b&&b.disconnect(),R(),v&&clearTimeout(v),o&&clearTimeout(o),document.removeEventListener("programmatic-scroll-start",p),document.removeEventListener("programmatic-scroll-end",c)}),(W,K)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"templatePage",ref:g,class:"template-page"},[r.createElementVNode("div",J5e,[f.value?(r.openBlock(),r.createBlock(CN,{key:0,"options-type":"page",onClick:K[0]||(K[0]=r.withModifiers(X=>f.value=!1,["self"])),onMouseleave:K[1]||(K[1]=X=>f.value=!1),onCloseTooltip:K[2]||(K[2]=X=>f.value=!1),onDeletePage:q,onChangeSort:N})):r.createCommentVNode("",!0),r.createElementVNode("div",B5e,[K[4]||(K[4]=r.createElementVNode("div",null,[r.createElementVNode("svg",{width:"19",height:"21",viewBox:"0 0 19 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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)),K[5]||(K[5]=r.createElementVNode("div",{class:"separator"},null,-1)),r.createElementVNode("input",{value:e.page.title,type:"text",class:"page-title-input",onclick:"this.select()",onInput:w},null,40,G5e)]),r.createElementVNode("div",Z5e,[r.createElementVNode("div",H5e,[r.createElementVNode("div",Y5e,[_.value.homeTeam.logo?(r.openBlock(),r.createElementBlock("div",Q5e,[r.createElementVNode("img",{src:_.value.homeTeam.logo,alt:"Home Team Logo",width:"25",height:"25"},null,8,$5e)])):(r.openBlock(),r.createElementBlock("svg",e_e,[...K[6]||(K[6]=[r.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.createElementVNode("span",null,r.toDisplayString(_.value.homeTeam.name),1)]),K[8]||(K[8]=r.createElementVNode("div",{class:"template-page__header__details__teams__vs"}," VS ",-1)),r.createElementVNode("div",t_e,[r.createElementVNode("span",null,r.toDisplayString(_.value.awayTeam.name),1),_.value.awayTeam.logo?(r.openBlock(),r.createElementBlock("div",r_e,[r.createElementVNode("img",{src:_.value.awayTeam.logo,alt:"Away Team Logo",width:"25",height:"25"},null,8,n_e)])):(r.openBlock(),r.createElementBlock("svg",a_e,[...K[7]||(K[7]=[r.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)])]))])]),e.isTemplateMode&&!e.isFilterVisible?(r.openBlock(),r.createElementBlock("div",{key:0,class:"template-page__header__details__options",onClick:K[3]||(K[3]=X=>f.value=!0)},[...K[9]||(K[9]=[r.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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)])])):r.createCommentVNode("",!0)])]),r.createElementVNode("div",i_e,[r.createElementVNode("div",{id:`grid-stack-${e.id}`,class:"grid-stack"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.page.items,X=>{var D,H,ne;return r.openBlock(),r.createElementBlock("div",{class:"grid-stack-item",key:X.key,"gs-id":X.id,"gs-x":X.x,"gs-y":X.y,"gs-w":X.w,"gs-h":X.h,"gs-max-w":X.maxWidth,"gs-max-h":X.maxHeight,"gs-min-w":X.minWidth,"gs-min-h":X.minHeight,"gs-no-resize":!e.isTemplateMode,"gs-no-move":!n.isTemplateMode,"gs-auto-position":X.x===0&&X.y===0},[r.createElementVNode("div",{class:r.normalizeClass(["grid-stack-item-content",{"is-selected":X.isSelected}])},[r.createVNode(F5e,{view:X,"is-template-mode":e.isTemplateMode,"is-post-match":e.isPostMatch,game:e.game,lastGames:e.lastGames,"is-home-team":(D=X.componentProps)!=null&&D.preMatchType?((H=X.componentProps)==null?void 0:H.preMatchType)===1:X.isHomeTeam,"is-filter-visible":e.isFilterVisible,"view-id":((ne=X==null?void 0:X.coreView)==null?void 0:ne.id)||0,onEdit:B=>C(X),onDelete:B=>L(X)},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(U(X.componentName)),r.mergeProps({ref_for:!0},X.componentProps,{key:`${X.id}-${X._updateKey||0}`}),null,16))]),_:2},1032,["view","is-template-mode","is-post-match","game","lastGames","is-home-team","is-filter-visible","view-id","onEdit","onDelete"])],2)],8,s_e)}),128))],8,o_e)])],512))}}),c_e=Bc(l_e,[["__scopeId","data-v-d2aac648"]]),u_e={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},d_e={key:0,class:"cover__main-logo cover__main-logo__home"},p_e={key:0,class:"team-logo"},h_e=["src"],f_e={key:1,width:"575",height:"675",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m_e=["fill"],y_e={key:1,class:"cover__main-logo cover__main-logo__away"},g_e={key:0,class:"team-logo"},v_e=["src"],b_e={key:1,width:"575",height:"575",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},x_e=["fill"],w_e={class:"cover__title-subtitle"},__e={class:"cover__title-subtitle__title"},S_e={class:"cover__title-subtitle__subtitle"},T_e={key:2,class:"cover-type-one"},k_e={class:"team-info-one"},N_e={class:"team-data"},V_e={key:0,class:"team-logo"},O_e=["src"],L_e={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},U_e=["fill","opacity"],q_e={class:"team-name"},z_e={key:0,class:"team-events"},C_e={class:"score-one"},P_e={key:0},E_e={class:"team-info-one"},F_e={class:"team-data"},R_e={key:0,class:"team-logo"},M_e=["src"],j_e={key:1,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},W_e=["fill","opacity"],K_e={class:"team-name"},A_e={key:0,class:"team-events"},I_e={key:3,class:"cover-type-two"},X_e={class:"team-data"},D_e={class:"team-info"},J_e={key:0,class:"team-logo"},B_e=["src"],G_e={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Z_e=["fill","opacity"],H_e={key:2,class:"team-score-two"},Y_e={key:0,class:"team-goals"},Q_e={class:"team-data"},$_e={class:"team-info"},eSe={key:0,class:"team-score-two"},tSe={key:1,class:"team-logo"},rSe=["src"],nSe={key:2,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},aSe=["fill","opacity"],iSe={key:0,class:"team-goals"},oSe={__name:"CoverPage",props:{game:{type:Object,default:()=>null},coverId:{type:Number,default:1},isPostMatch:{type:Boolean,default:!0}},emits:["intersection-changed"],setup(e,{emit:a}){const i=e,k=a,j=r.ref(null),g=r.computed(()=>[1,2].includes(i.coverId)),m=r.computed(()=>[1,3].includes(i.coverId)),n=r.computed(()=>i.coverId===1?{homeTeam:"#1558CC",awayTeam:"#0046BF",opacity:1}:i.coverId===3?{homeTeam:"#000A1A",awayTeam:"#000A1A",opacity:.4}:{homeTeam:"#576883",awayTeam:"#576883",opacity:.4}),f=r.computed(()=>i.game&&i.game.score?i.game.score:["0","0"]),l=r.computed(()=>{var U,z,L,C,q,N,P,T;if(i.game&&i.game.homeTeam&&i.game.awayTeam){const E={homeTeam:{name:((U=i.game.homeTeam)==null?void 0:U.acronym)||"LOC",logo:((z=i.game.homeTeam)==null?void 0:z.logo)||null},awayTeam:{name:((L=i.game.awayTeam)==null?void 0:L.acronym)||"VIS",logo:((C=i.game.awayTeam)==null?void 0:C.logo)||null}};return g.value?(E.homeTeam.goalsMinutes=o(i.game.minutes.home_goals_minutes),E.homeTeam.totalYellowCards=((q=i.game.minutes.home_yellow_cards_minutes)==null?void 0:q.length)||0,E.homeTeam.totalRedCards=((N=i.game.minutes.home_red_cards_minutes)==null?void 0:N.length)||0,E.awayTeam.goalsMinutes=o(i.game.minutes.visiting_goals_minutes),E.awayTeam.totalYellowCards=((P=i.game.minutes.away_yellow_cards_minutes)==null?void 0:P.length)||0,E.awayTeam.totalRedCards=((T=i.game.minutes.away_red_cards_minutes)==null?void 0:T.length)||0):(E.homeTeam.goalsEvents=h(i.game.report_minutes.home_goals_minutes),E.awayTeam.goalsEvents=h(i.game.report_minutes.visiting_goals_minutes)),E}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=r.computed(()=>({"--background-image":m.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":i.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-one":i.isPostMatch?"100%":"fit-content","--grid-template-columns-type-two":i.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-two":i.isPostMatch?"100%":"fit-content"})),_=r.computed(()=>i.isPostMatch?"Postmatch":"Prematch"),b=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],v=r.computed(()=>{if(i.game){let U=u_e[i.game.matchday_abbreviation];U||(U=i.game.matchday_abbreviation.replace("M","J"));const[z,L,C]=i.game.date.split("-");return`${U} - ${C} ${b[Number(L)-1]}, ${z}`}return"Jornada - Día 00 Mes"});function h(U){return!U||!Array.isArray(U)||U.length===0?"":U.map(z=>{const L=z.split(", ");let C=L[0].replace("'","");C=C.replace("+",""),C=C.replace("’","");const q=C.split(" "),{strings:N,numbers:P}=q.reduce((R,W)=>(isNaN(Number(W))?R.strings.push(W):R.numbers.push(W),R),{strings:[],numbers:[]}),T=N.join(" "),E=P.length===1?`${P[0]}'`:`${P[0]}' ${P.slice(1).join(" + ")}'`;return{playerName:T,goalTime:L.length===1?E:`${E}, ${L.reduce((R,W,K)=>K===0?R:`${R}${W}${K<L.length-1?", ":""}`,"")}`}})}function o(U){return!U||!Array.isArray(U)||U.length===0?"":U.reduce((z,L,C)=>{const q=L.split(" ");let N="";return q.length===3?N=q[2]:q.length===5&&(N=`${q[2]} ${q[3]} ${q[4]}`),N&&(z+=`${N}${C<U.length-1?", ":""}`),z},"")}let s=null,p=null,c=!1,d=null,x=!1;const w=()=>{x=!0},S=()=>{x=!1};function V(){x||(c=!0,d&&clearTimeout(d),d=setTimeout(()=>{c=!1},150))}function O(){const U={root:null,rootMargin:"0px",threshold:.7};s=new IntersectionObserver(C=>{C.forEach(q=>{if(c){p&&clearTimeout(p),p=setTimeout(()=>{k("intersection-changed",q.isIntersecting)},100);return}p&&clearTimeout(p),p=setTimeout(()=>{k("intersection-changed",q.isIntersecting)},50)})},U);const z=j.value;z&&s.observe(z);const L=document.querySelector(".container-main");L&&L.addEventListener("scroll",V,{passive:!0}),document.addEventListener("programmatic-scroll-start",w),document.addEventListener("programmatic-scroll-end",S)}return r.onMounted(()=>{O()}),r.onUnmounted(()=>{s&&s.disconnect();const U=document.querySelector(".container-main");U&&U.removeEventListener("scroll",V),document.removeEventListener("programmatic-scroll-start",w),document.removeEventListener("programmatic-scroll-end",S),p&&clearTimeout(p),d&&clearTimeout(d)}),(U,z)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"coverPage",ref:j,class:"cover",style:r.normalizeStyle(t.value)},[g.value?(r.openBlock(),r.createElementBlock("div",d_e,[l.value.homeTeam.logo?(r.openBlock(),r.createElementBlock("div",p_e,[r.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,h_e)])):(r.openBlock(),r.createElementBlock("svg",f_e,[r.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:n.value.homeTeam},null,8,m_e)]))])):r.createCommentVNode("",!0),g.value?(r.openBlock(),r.createElementBlock("div",y_e,[l.value.awayTeam.logo?(r.openBlock(),r.createElementBlock("div",g_e,[r.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,v_e)])):(r.openBlock(),r.createElementBlock("svg",b_e,[r.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:n.value.awayTeam},null,8,x_e)]))])):r.createCommentVNode("",!0),r.createElementVNode("div",w_e,[r.createElementVNode("div",__e,[z[0]||(z[0]=r.createElementVNode("div",null,"Análisis",-1)),r.createElementVNode("div",null,r.toDisplayString(_.value),1)]),r.createElementVNode("div",S_e,r.toDisplayString(v.value),1)]),g.value?(r.openBlock(),r.createElementBlock("div",T_e,[r.createElementVNode("div",k_e,[r.createElementVNode("div",N_e,[l.value.homeTeam.logo?(r.openBlock(),r.createElementBlock("div",V_e,[r.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,O_e)])):(r.openBlock(),r.createElementBlock("svg",L_e,[r.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:n.value.homeTeam,opacity:n.value.opacity},null,8,U_e)])),r.createElementVNode("div",q_e,r.toDisplayString(l.value.homeTeam.name),1)]),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",z_e,[z[1]||(z[1]=r.createStaticVNode('<svg class="ball" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1)),r.createElementVNode("div",null,r.toDisplayString(l.value.homeTeam.goalsMinutes),1),z[2]||(z[2]=r.createElementVNode("div",{class:"separator"},null,-1)),z[3]||(z[3]=r.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),r.createElementVNode("div",null,r.toDisplayString(l.value.homeTeam.totalYellowCards),1),z[4]||(z[4]=r.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),r.createElementVNode("div",null,r.toDisplayString(l.value.homeTeam.totalRedCards),1)])):r.createCommentVNode("",!0)]),r.createElementVNode("div",C_e,[e.isPostMatch?(r.openBlock(),r.createElementBlock("div",P_e,r.toDisplayString(f.value[0])+" : "+r.toDisplayString(f.value[1]),1)):r.createCommentVNode("",!0)]),r.createElementVNode("div",E_e,[r.createElementVNode("div",F_e,[l.value.awayTeam.logo?(r.openBlock(),r.createElementBlock("div",R_e,[r.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,M_e)])):(r.openBlock(),r.createElementBlock("svg",j_e,[r.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:n.value.awayTeam,opacity:n.value.opacity},null,8,W_e)])),r.createElementVNode("div",K_e,r.toDisplayString(l.value.awayTeam.name),1)]),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",A_e,[r.createElementVNode("div",null,r.toDisplayString(l.value.awayTeam.totalYellowCards),1),z[5]||(z[5]=r.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),r.createElementVNode("div",null,r.toDisplayString(l.value.awayTeam.totalRedCards),1),z[6]||(z[6]=r.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),z[7]||(z[7]=r.createElementVNode("div",{class:"separator"},null,-1)),r.createElementVNode("div",null,r.toDisplayString(l.value.awayTeam.goalsMinutes),1),z[8]||(z[8]=r.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1))])):r.createCommentVNode("",!0)])])):(r.openBlock(),r.createElementBlock("div",I_e,[r.createElementVNode("div",X_e,[r.createElementVNode("div",D_e,[l.value.homeTeam.logo?(r.openBlock(),r.createElementBlock("div",J_e,[r.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,B_e)])):(r.openBlock(),r.createElementBlock("svg",G_e,[r.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:n.value.homeTeam,opacity:n.value.opacity},null,8,Z_e)])),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",H_e,r.toDisplayString(f.value[0]),1)):r.createCommentVNode("",!0)]),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",Y_e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value.homeTeam.goalsEvents,(L,C)=>(r.openBlock(),r.createElementBlock("div",{key:`goal-${C}`,class:"goal"},[r.createElementVNode("div",null,r.toDisplayString(L.playerName),1),z[9]||(z[9]=r.createElementVNode("div",{class:"bullet"},null,-1)),r.createElementVNode("div",null,r.toDisplayString(L.goalTime),1),z[10]||(z[10]=r.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1))]))),128))])):r.createCommentVNode("",!0)]),z[13]||(z[13]=r.createElementVNode("div",{class:"separator"},null,-1)),r.createElementVNode("div",Q_e,[r.createElementVNode("div",$_e,[e.isPostMatch?(r.openBlock(),r.createElementBlock("div",eSe,r.toDisplayString(f.value[1]),1)):r.createCommentVNode("",!0),l.value.awayTeam.logo?(r.openBlock(),r.createElementBlock("div",tSe,[r.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,rSe)])):(r.openBlock(),r.createElementBlock("svg",nSe,[r.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:n.value.awayTeam,opacity:n.value.opacity},null,8,aSe)]))]),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",iSe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value.awayTeam.goalsEvents,(L,C)=>(r.openBlock(),r.createElementBlock("div",{key:`goal-a-${C}`,class:"goal"},[z[11]||(z[11]=r.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1)),r.createElementVNode("div",null,r.toDisplayString(L.goalTime),1),z[12]||(z[12]=r.createElementVNode("div",{class:"bullet"},null,-1)),r.createElementVNode("div",null,r.toDisplayString(L.playerName),1)]))),128))])):r.createCommentVNode("",!0)])]))],4))}},sSe=Bc(oSe,[["__scopeId","data-v-6680cbcf"]]),lSe={class:"table-category-filters"},cSe={key:0,class:"custom-radio-group filter-inline"},uSe={class:"radio-label"},dSe={class:"radio-options"},pSe=["name","value","onUpdate:modelValue","onClick"],hSe=["data-filter-type","onClick","onMousedown","onMouseup"],fSe={class:"select-display"},mSe={class:"select-label"},ySe={key:0,class:"dropdown-menu type-menu simple-select-menu"},gSe={class:"simple-select-scroll-area"},vSe=["onClick"],bSe={class:"option-content"},xSe={class:"option-title"},wSe={key:0,class:"option-checkmark"},_Se={key:2,class:"filter-separator"},SSe={__name:"TableCategoryFilters",props:{filters:{type:Array,default:()=>[]},initialValues:{type:Array,default:()=>[]},isEditMode:{type:Boolean,default:!1},componentId:{type:Number,default:13}},emits:["filters-changed","filter-updated"],setup(e,{expose:a,emit:i}){const k=e,j=i,g=r.ref([]);let m=null;const n=(x,w)=>{if(!w)return!0;for(let S=0;S<x.length;S++)if(!f(x[S],w[S]))return!0;return!1},f=(x,w)=>{if(Array.isArray(x)&&Array.isArray(w)){if(x.length!==w.length)return!1;for(let S=0;S<x.length;S++)if(x[S]!==w[S])return!1;return!0}return x===w},l=r.ref(null),t=r.ref([]);let _=!1,b=null;const v=()=>{b=null},h=()=>{setTimeout(()=>{_=!1},1e3)},o=(x,w=!0)=>{if(k.filters&&k.filters[0]&&k.filters[1]&&k.filters[1].options){const S=k.filters[0].options,V=k.filters[1].options;x!=null?S.findIndex(O=>O.value===x)!==-1&&V[x]?(t.value=V[x],w&&!(()=>{const O=g.value[1];return O==null?!1:Array.isArray(O)?O.length>0:O!==""})()&&!_&&t.value.length>0&&(g.value[1]=t.value[0].value,r.nextTick(()=>{}))):(t.value=[],g.value[1]=null):(t.value=[],g.value[1]=null)}},s=()=>{k.initialValues&&k.initialValues.length>0?g.value=[...k.initialValues]:g.value=k.filters.map(x=>{var w,S,V,O;return x.type==="select"?[]:x.type==="check"?!1:x.type==="radio-button"?((S=(w=x.options)==null?void 0:w[0])==null?void 0:S.value)||null:x.type==="select-simple"&&((O=(V=x.options)==null?void 0:V[0])==null?void 0:O.value)||null}),k.componentId===13&&g.value.some(x=>x!=null&&(Array.isArray(x)?x.length>0:x!==!1&&x!==""))&&(m=[...g.value],j("filters-changed",{componentId:k.componentId,filters:g.value,timestamp:new Date().toISOString()}))};s(),setTimeout(()=>{r.nextTick(()=>{if(g.value[0]!==null&&g.value[0]!==void 0&&!_){const x=!(()=>{const w=g.value[1];return w==null?!1:Array.isArray(w)?w.length>0:w!==""})();o(g.value[0],x)}})},300),r.watch(()=>k.initialValues,x=>{const w=!f(g.value,x),S=x&&x.length>0&&!_&&w,V=k.isEditMode&&_;S&&!V?g.value=[...x]:_?b&&b.length>0&&(g.value=[...b]):V&&b&&b.length>0&&(g.value=[...b])},{deep:!0}),r.watch(()=>k.isEditMode,(x,w)=>{w===!0&&x===!1&&v()},{immediate:!0}),r.watch(g,(x,w)=>{x.some(S=>S!=null&&(Array.isArray(S)?S.length>0:S!==!1&&S!==""))&&n(x,m)&&(m=[...x],j("filters-changed",{componentId:k.componentId,filters:x,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),r.watch(()=>g.value[0],(x,w)=>{x!==w&&w!==void 0?o(x,!0):w===void 0&&x!==null&&x!==void 0&&o(x,!1)},{immediate:!0}),r.watch(()=>g.value,(x,w)=>{k.filters.map((S,V)=>S.type==="radio-button"?V:-1).filter(S=>S!==-1).forEach(S=>{})},{deep:!0}),r.watch(t,()=>{},{deep:!0});const p=x=>{l.value===x?l.value=null:l.value=x},c=(x,w)=>{if(_=!0,h(),g.value[x]=w,(x===0||x===1)&&(b=[...g.value]),l.value=null,x===0){g.value[1]!==void 0&&(g.value[1]=null);const S=_;_=!1,o(w,!0),_=S,g.value[1]!==null&&g.value[1]!==void 0&&(b=[...g.value])}},d=()=>{_=!0,setTimeout(()=>{_=!1},1e3)};return a({getCurrentValues:()=>g.value,initializeValues:s}),(x,w)=>(r.openBlock(),r.createElementBlock("div",lSe,[e.filters&&e.filters.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.filters,(S,V)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:V},[S.type==="radio-button"?(r.openBlock(),r.createElementBlock("div",cSe,[r.createElementVNode("div",uSe,r.toDisplayString(S.label),1),r.createElementVNode("div",dSe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.options,O=>(r.openBlock(),r.createElementBlock("label",{key:O.value,class:r.normalizeClass(["radio-option-card",{active:g.value[V]===O.value}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"table-radio-"+V,value:O.value,"onUpdate:modelValue":U=>g.value[V]=U,onChange:w[0]||(w[0]=()=>{d()}),onClick:U=>console.log("Click en radio button",V,O.value,"Valor actual:",g.value[V])},null,40,pSe),[[r.vModelRadio,g.value[V]]]),r.createElementVNode("span",null,r.toDisplayString(O.label),1)],2))),128))])])):S.type==="select-simple"?(r.openBlock(),r.createElementBlock("div",{key:1,class:"custom-select dynamic-select filter-inline","data-filter-type":S.type,onClick:r.withModifiers(O=>p(V),["stop"]),onMousedown:O=>console.log("Mouse down en selector",V),onMouseup:O=>console.log("Mouse up en selector",V)},[r.createElementVNode("div",fSe,[w[2]||(w[2]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),r.createElementVNode("span",mSe,r.toDisplayString(S.label||"Tipo de análisis"),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:l.value===V}])},[...w[1]||(w[1]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),l.value===V?(r.openBlock(),r.createElementBlock("div",ySe,[r.createElementVNode("div",gSe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(V===1?t.value:S.options,O=>(r.openBlock(),r.createElementBlock("div",{key:O.value,class:r.normalizeClass(["option-card simple-select-option",{active:f(g.value[V],O.value)}]),onClick:r.withModifiers(U=>c(V,O.value),["stop"])},[r.createElementVNode("div",bSe,[r.createElementVNode("div",xSe,r.toDisplayString(O.label),1)]),f(g.value[V],O.value)?(r.openBlock(),r.createElementBlock("div",wSe,[...w[3]||(w[3]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):r.createCommentVNode("",!0)],10,vSe))),128))])])):r.createCommentVNode("",!0)],40,hSe)):r.createCommentVNode("",!0),V===1&&e.filters.length>2?(r.openBlock(),r.createElementBlock("div",_Se)):r.createCommentVNode("",!0)],64))),128))],2)):r.createCommentVNode("",!0)]))}},TSe=Bc(SSe,[["__scopeId","data-v-9d00f072"]]),kSe={class:"strengths-filters"},NSe={key:0,class:"custom-radio-group filter-inline"},VSe={class:"radio-label"},OSe={class:"radio-options"},LSe=["name","value","onUpdate:modelValue"],USe={class:"filter-inline select-with-label"},qSe=["data-filter-type","onClick"],zSe={class:"select-display"},CSe={class:"select-label"},PSe={key:0,class:"dropdown-menu type-menu simple-select-menu"},ESe={class:"simple-select-scroll-area"},FSe=["onClick"],RSe={class:"option-content"},MSe={class:"option-title"},jSe={key:0,class:"option-checkmark"},WSe={key:2,class:"filter-separator"},KSe={__name:"StrengthsFilters",props:{filters:{type:Array,default:()=>[]},initialValues:{type:Array,default:()=>[]},isEditMode:{type:Boolean,default:!1},componentId:{type:Number,default:15}},emits:["filters-changed","filter-updated"],setup(e,{expose:a,emit:i}){const k=e,j=i,g=r.ref([]);let m=null;const n=r.ref(null),f=r.ref([]);let l=!1,t=null;const _=(p,c)=>{if(Array.isArray(p)&&Array.isArray(c)){if(p.length!==c.length)return!1;for(let d=0;d<p.length;d++)if(p[d]!==c[d])return!1;return!0}return p===c},b=(p,c=!0)=>{if(k.filters&&k.filters[0]&&k.filters[1]&&k.filters[1].options){const d=k.filters[0].options,x=k.filters[1].options;p!=null?d.findIndex(w=>w.value===p)!==-1&&x[p]?(f.value=x[p],c&&!(()=>{const w=g.value[1];return w==null?!1:Array.isArray(w)?w.length>0:w!==""})()&&!l&&f.value.length>0&&(g.value[1]=f.value[0].value,r.nextTick(()=>{}))):(f.value=[],g.value[1]=null):(f.value=[],g.value[1]=null)}},v=()=>{if(k.initialValues&&k.initialValues.length>0){const c=k.initialValues.length>0&&(typeof k.initialValues[0]=="number"||typeof k.initialValues[0]=="boolean"||k.initialValues[0]===null||Array.isArray(k.initialValues[0]));console.log("StrengthsFilters initializeValues - isSimpleFormat:",c),c?(console.log("StrengthsFilters initializeValues - Usando formato simple, valores:",k.initialValues),g.value=[...k.initialValues]):k.isEditMode?g.value=k.filters.map((d,x)=>{var w,S,V,O,U,z,L,C,q,N;const P=k.initialValues[x];if(console.log(`StrengthsFilters initializeValues - filter[${x}]:`,d==null?void 0:d.type,"filterData:",P),!P)return console.log(`StrengthsFilters initializeValues - No hay filterData para índice ${x}, usando valor por defecto`),d.type==="select"?[]:d.type==="check"?!1:d.type==="radio-button"?((S=(w=d.options)==null?void 0:w[0])==null?void 0:S.value)||null:d.type==="select-simple"&&((O=(V=d.options)==null?void 0:V[0])==null?void 0:O.value)||null;if(d.type==="radio-button"&&P.selectedOption){console.log("StrengthsFilters initializeValues - filterData.selectedOption: ",P.selectedOption,"index:",x);const T=P.selectedOption.value;return console.log("StrengthsFilters initializeValues - selectedValue extraído:",T),T}else{if(d.type==="radio-button"&&!P.selectedOption)return console.log("StrengthsFilters initializeValues - filterData NO tiene selectedOption:",P,"index:",x),P.selectedValue!==void 0?(console.log("StrengthsFilters initializeValues - Usando selectedValue:",P.selectedValue),P.selectedValue):(console.log("StrengthsFilters initializeValues - Usando valor por defecto del filter"),((z=(U=d.options)==null?void 0:U[0])==null?void 0:z.value)||null);if(d.type==="select-simple"&&P.selectedValue!==void 0)return Array.isArray(P.selectedValue)?P.selectedValue[0]:P.selectedValue;if(d.type==="select"&&P.selectedOptions)return P.selectedOptions.map(T=>T.value);if(d.type==="check"&&P.isChecked!==void 0)return P.isChecked}return P.selectedValue!==void 0?P.selectedValue:d.type==="select"?[]:d.type==="check"?!1:d.type==="radio-button"?((C=(L=d.options)==null?void 0:L[0])==null?void 0:C.value)||null:d.type==="select-simple"&&((N=(q=d.options)==null?void 0:q[0])==null?void 0:N.value)||null}):g.value=[...k.initialValues]}else g.value=k.filters.map(c=>{var d,x,w,S;return c.type==="select"?[]:c.type==="check"?!1:c.type==="radio-button"?((x=(d=c.options)==null?void 0:d[0])==null?void 0:x.value)||null:c.type==="select-simple"&&((S=(w=c.options)==null?void 0:w[0])==null?void 0:S.value)||null});console.log("StrengthsFilters initializeValues - selectedValues.value final:",g.value);const p=g.value.some(c=>c!=null&&(Array.isArray(c)?c.length>0:c!==!1&&c!==""));console.log("StrengthsFilters initializeValues - hasValidValues:",p),p&&(m=[...g.value],j("filters-changed",{componentId:k.componentId,filters:g.value,timestamp:new Date().toISOString()}))};v(),setTimeout(()=>{r.nextTick(()=>{if(g.value[0]!==null&&g.value[0]!==void 0&&!l){const p=!(()=>{const c=g.value[1];return c==null?!1:Array.isArray(c)?c.length>0:c!==""})();b(g.value[0],p)}})},300),r.watch(()=>k.initialValues,(p,c)=>{if(!p||p.length===0)return;console.log("StrengthsFilters watch initialValues - newValues:",p),console.log("StrengthsFilters watch initialValues - oldValues:",c),console.log("StrengthsFilters watch initialValues - props.isEditMode:",k.isEditMode),console.log("StrengthsFilters watch initialValues - isUserInteracting:",l);const d=p.length>0&&(typeof p[0]=="number"||typeof p[0]=="boolean"||p[0]===null||Array.isArray(p[0]));console.log("StrengthsFilters watch initialValues - isSimpleFormat:",d);const x=!_(g.value,p),w=p&&p.length>0&&!l&&x,S=k.isEditMode&&l;console.log("StrengthsFilters watch initialValues - valuesAreDifferent:",x,"shouldUpdate:",w,"isEditModeProtection:",S),w&&!S?d?(console.log("StrengthsFilters watch initialValues - Usando formato simple, valores:",p),g.value=[...p]):k.isEditMode?g.value=k.filters.map((V,O)=>{const U=p[O];if(!U)return console.log("StrengthsFilters watch initialValues - No hay filterData para índice",O),g.value[O];if(V.type==="radio-button"&&U.selectedOption){console.log("StrengthsFilters watch initialValues - filterData.selectedOption: ",U.selectedOption,"index:",O);const z=U.selectedOption.value;return console.log("StrengthsFilters watch initialValues - selectedValue extraído:",z),z}else{if(V.type==="select-simple"&&U.selectedValue!==void 0)return Array.isArray(U.selectedValue)?U.selectedValue[0]:U.selectedValue;if(V.type==="select"&&U.selectedOptions)return U.selectedOptions.map(z=>z.value);if(V.type==="check"&&U.isChecked!==void 0)return U.isChecked}return U.selectedValue!==void 0?U.selectedValue:g.value[O]}):g.value=[...p]:l?t&&t.length>0&&(g.value=[...t]):S&&t&&t.length>0&&(g.value=[...t])},{deep:!0}),r.watch(()=>k.isEditMode,(p,c)=>{c===!0&&p===!1&&(t=null)},{immediate:!0}),r.watch(g,p=>{p.some(c=>c!=null&&(Array.isArray(c)?c.length>0:c!==!1&&c!==""))&&(()=>{if(!m)return!0;for(let c=0;c<p.length;c++)if(!_(p[c],m[c]))return!0;return!1})()&&(m=[...p],j("filters-changed",{componentId:k.componentId,filters:p,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),r.watch(()=>g.value[0],(p,c)=>{p!==c&&c!==void 0?b(p,!0):c===void 0&&p!==null&&p!==void 0&&b(p,!1)},{immediate:!0});const h=p=>{n.value===p?n.value=null:n.value=p},o=(p,c)=>{if(l=!0,setTimeout(()=>{l=!1},1e3),g.value[p]=c,(p===0||p===1)&&(t=[...g.value]),n.value=null,p===0){g.value[1]!==void 0&&(g.value[1]=null);const d=l;l=!1,b(c,!0),l=d,g.value[1]!==null&&g.value[1]!==void 0&&(t=[...g.value])}},s=()=>{l=!0,setTimeout(()=>{l=!1},400)};return a({getCurrentValues:()=>g.value,initializeValues:v}),(p,c)=>(r.openBlock(),r.createElementBlock("div",kSe,[e.filters&&e.filters.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.filters,(d,x)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:x},[d.type==="radio-button"?(r.openBlock(),r.createElementBlock("div",NSe,[r.createElementVNode("div",VSe,r.toDisplayString(d.label),1),r.createElementVNode("div",OSe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.options,w=>(r.openBlock(),r.createElementBlock("label",{key:w.value,class:r.normalizeClass(["radio-option-card",{active:g.value[x]===w.value}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"strengths-radio-"+x,value:w.value,"onUpdate:modelValue":S=>g.value[x]=S,onChange:s},null,40,LSe),[[r.vModelRadio,g.value[x]]]),r.createElementVNode("span",null,r.toDisplayString(w.label),1)],2))),128))])])):d.type==="select-simple"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[c[4]||(c[4]=r.createElementVNode("div",{class:"filter-separator"},null,-1)),r.createElementVNode("div",USe,[c[3]||(c[3]=r.createElementVNode("div",{class:"radio-label"},"Mostrar: ",-1)),r.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":d.type,onClick:r.withModifiers(w=>h(x),["stop"])},[r.createElementVNode("div",zSe,[c[1]||(c[1]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),r.createElementVNode("span",CSe,r.toDisplayString(d.label||"Tipo de análisis"),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:n.value===x}])},[...c[0]||(c[0]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),n.value===x?(r.openBlock(),r.createElementBlock("div",PSe,[r.createElementVNode("div",ESe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.options,w=>(r.openBlock(),r.createElementBlock("div",{key:w.value,class:r.normalizeClass(["option-card simple-select-option",{active:_(g.value[x],w.value)}]),onClick:r.withModifiers(S=>o(x,w.value),["stop"])},[r.createElementVNode("div",RSe,[r.createElementVNode("div",MSe,r.toDisplayString(w.label),1)]),_(g.value[x],w.value)?(r.openBlock(),r.createElementBlock("div",jSe,[...c[2]||(c[2]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):r.createCommentVNode("",!0)],10,FSe))),128))])])):r.createCommentVNode("",!0)],8,qSe)])],64)):r.createCommentVNode("",!0),x===1&&e.filters.length>2?(r.openBlock(),r.createElementBlock("div",WSe)):r.createCommentVNode("",!0)],64))),128))],2)):r.createCommentVNode("",!0)]))}},ASe=Bc(KSe,[["__scopeId","data-v-4c3876bd"]]),ISe=(e,a)=>{const i=e.__vccOpts||e;for(const[k,j]of a)i[k]=j;return i},XSe={key:1},DSe={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},JSe=["fill"],BSe={key:0,class:"checkbox__teams"},GSe={class:"checkbox__teams__logo"},ZSe=["src"],HSe={class:"checkbox__teams__logo"},YSe=["src"],QSe={__name:"GSC-Checkbox",props:{width:{type:String,default:"fit-content"},height:{type:String,default:"fit-content"},label:{type:String,default:""},labelWhiteSpace:{type:String,default:"normal"},labelColor:{type:String,default:"white"},fontFamily:{type:String,default:"sans-serif"},labelFontSize:{type:String,default:"12px"},modelValue:{type:Boolean,default:!1},justifyContent:{type:String,default:"flex-start"},alignItems:{type:String,default:"center"},boxBackgroundColor:{type:String,default:"#CBEE6B"},boxValueColor:{type:String,default:"#0d1d29"},boxValue:{type:[String,Number],default:""},boxPosition:{type:String,default:"left",validator(e){return["left","right","top","bottom"].includes(e)}},boxMarginTop:{type:String,default:"0.2em"},boxWidthAndHeight:{type:String,default:"16px"},boxBorderColor:{type:String,default:"#969da2"},boxBorderWidth:{type:String,default:"2px"},boxBorderRadius:{type:String,default:"4px"},boxValueFontSize:{type:String,default:"10px"},boxValueFontFamily:{type:String,default:"sans-serif"},avoidInteraction:{type:Boolean,default:!1},avoidToCheck:{type:Boolean,default:!1},isBoxOnly:{type:Boolean,default:!1},teamsIds:{type:Array,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:a}){const i=e;r.useCssVars(l=>({"7bd9d47b":e.width,"34dc7ddc":e.height}));const k=r.ref(!1),j=r.computed(()=>{const l={color:i.boxValueColor,"font-family":i.fontFamily,height:i.boxWidthAndHeight,width:i.boxWidthAndHeight,minWidth:i.boxWidthAndHeight,"border-radius":i.boxBorderRadius,"margin-top":i.boxMarginTop};return k.value?(l["background-color"]=i.boxBackgroundColor,l.border=`solid ${i.boxBorderWidth} ${i.boxBackgroundColor}`):l.border=`solid ${i.boxBorderWidth} ${i.boxBorderColor}`,l}),g=r.computed(()=>({"font-family":i.boxValueFontFamily,"font-size":i.boxValueFontSize,color:i.boxValueColor,"line-height":1})),m=r.computed(()=>{const l={color:i.labelColor,"font-family":i.fontFamily,"font-size":i.labelFontSize,"white-space":i.labelWhiteSpace,"text-align":i.boxPosition==="top"||i.boxPosition==="bottom"?"center":i.boxPosition};return(i.boxPosition==="left"||i.boxPosition==="right")&&(l[`margin-${i.boxPosition}`]=i.isBoxOnly?"0":i.teamsIds?"8px":"10px"),l});r.watch(()=>i.modelValue,l=>{l!==k.value&&(k.value=l)},{immediate:!0});function n(){i.avoidInteraction||!k.value&&i.avoidToCheck||(k.value=!k.value,a("update:modelValue",k.value))}function f(l){return`${{}.TEAM_LOGOS_URL||"https://golstatsimages.blob.core.windows.net/teams-80/"}${l}.png`}return(l,t)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["checkbox",`box-${e.boxPosition}`]),onClick:n},[r.createElementVNode("div",{class:"checkbox__box",style:r.normalizeStyle(j.value)},[k.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[i.boxValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:"checkbox__box__value",style:r.normalizeStyle(g.value)},r.toDisplayString(e.boxValue),5)):(r.openBlock(),r.createElementBlock("div",XSe,[(r.openBlock(),r.createElementBlock("svg",DSe,[r.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:e.boxValueColor},null,8,JSe)]))]))],64)):r.createCommentVNode("",!0)],4),e.teamsIds&&e.teamsIds.length?(r.openBlock(),r.createElementBlock("div",BSe,[r.createElementVNode("div",GSe,[r.createElementVNode("img",{src:f(e.teamsIds[0]),alt:""},null,8,ZSe)]),r.createElementVNode("div",HSe,[r.createElementVNode("img",{src:f(e.teamsIds[1]),alt:""},null,8,YSe)])])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"checkbox__label",style:r.normalizeStyle(m.value)},r.toDisplayString(e.label),5)],2))}},jN=ISe(QSe,[["__scopeId","data-v-b6f124d8"]]),$Se=(e,a)=>{const i=e.__vccOpts||e;for(const[k,j]of a)i[k]=j;return i},N5={props:{type:{type:Number,default:0},value:{type:Boolean,default:!1},textValue:String,icon:String,iconPosition:{type:String,default:"left"},iconSize:String,fontColor:{type:String,default:"#FFFFFF"},textDecoration:String,fontSize:{type:String,default:"16px"},fontSizeStat:{type:String,default:"16px"},fontStyle:String,fontFamily:{type:String,default:"Poppins-Regular"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},borderRadius:{type:String,default:"0px"},borderType:{type:String,default:"solid"},borderWidth:{type:Number,default:0},borderWidthBtn:{type:String,default:"2px"},borderColor:String,backgroundColor:{type:String,default:"none"},activeBackgroundColor:{type:String,default:"#000000"},activeBorderWidth:{type:Number,default:2},activeBorderType:{type:String,default:"solid"},activeBorderColor:{type:String,default:"#cbee6b"},activeColorText:{type:String,default:"#FFFFFF"},cursorType:{type:String,default:"default"},typeOnOff:{type:Boolean,default:!1},textCategory:String,textStat:String,marginLeftStat:{type:String,default:"15%"}},watch:{value:{deep:!0,immediate:!0,handler(e){this.status=e}}},data(){return{status:!1}},computed:{customStyle(){return{height:this.height,width:this.width,backgroundColor:this.backgroundColor,borderRadius:this.borderRadius,border:`${this.borderType} ${this.borderWidth}px ${this.borderColor}`,color:this.fontColor,textDecoration:this.textDecoration,cursor:this.cursorType,fontSize:this.fontSize,fontStyle:this.fontStyle,fontFamily:`${this.fontFamily} !important`}},customActive(){return{backgroundColor:this.activeBackgroundColor,color:this.activeColorText,border:`${this.activeBorderType} ${this.activeBorderWidth}px ${this.activeBorderColor}`}}},methods:{btnClick(e){this.$emit("click",e),this.typeOnOff&&(this.status=!this.status,this.$emit("status",this.status))}}},WN=()=>{r.useCssVars(e=>({"9d01acb4":e.height,"14e95081":e.borderWidthBtn,"38fec285":e.borderType,34353510:e.borderColor,"20d20dc6":e.borderRadius,17130967:e.width,"4ccb7d36":e.backgroundColor,"5d1e86a2":e.cursorType,ce65d4a2:e.fontSize,fe4ac47a:e.fontStyle,f98e44dc:e.fontFamily,"93b87770":e.marginLeftStat,c7f7beba:e.fontSizeStat}))},KN=N5.setup;N5.setup=KN?(e,a)=>(WN(),KN(e,a)):WN;const eTe=e=>(r.pushScopeId("data-v-f3ee6b2b"),e=e(),r.popScopeId(),e),tTe=["src"],rTe={key:1,class:"text"},nTe=["src"],aTe={class:"stats"},iTe=eTe(()=>r.createElementVNode("img",{class:"iconstats",src:"https://golstatsimages.blob.core.windows.net/todoelfut/playdes.png"},null,-1)),oTe={class:"numstats"},sTe={class:"leyend"};function lTe(e,a,i,k,j,g){return r.openBlock(),r.createElementBlock("div",null,[i.type==0?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["button",j.status&&i.typeOnOff&&"button-active"]),style:r.normalizeStyle([g.customStyle,j.status&&i.typeOnOff&&g.customActive]),onClick:a[0]||(a[0]=(...m)=>g.btnClick&&g.btnClick(...m))},[i.icon&&i.iconPosition.toLowerCase()==="left"?(r.openBlock(),r.createElementBlock("img",{key:0,class:"icon",style:r.normalizeStyle({width:i.iconSize}),src:i.icon},null,12,tTe)):r.createCommentVNode("",!0),i.textValue?(r.openBlock(),r.createElementBlock("div",rTe,r.toDisplayString(i.textValue),1)):r.createCommentVNode("",!0),i.icon&&i.iconPosition.toLowerCase()==="right"?(r.openBlock(),r.createElementBlock("img",{key:2,class:"icon",style:r.normalizeStyle({width:i.iconSize}),src:i.icon},null,12,nTe)):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0),i.type==1?(r.openBlock(),r.createElementBlock("div",{key:1,class:"button-target",onClick:a[1]||(a[1]=(...m)=>g.btnClick&&g.btnClick(...m))},[r.createElementVNode("div",aTe,[iTe,r.createElementVNode("div",oTe,r.toDisplayString(i.textStat),1)]),r.createElementVNode("div",sTe,r.toDisplayString(i.textCategory),1)])):r.createCommentVNode("",!0)])}const cTe=$Se(N5,[["render",lTe],["__scopeId","data-v-f3ee6b2b"]]),uTe={class:"gsc-dropdown__main-container__item-selected"},dTe=["height","width"],pTe=["stroke"],hTe={key:1,width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fTe=["fill"],mTe={class:"gsc-dropdown__items-container"},yTe=["onClick"],gTe={key:0,class:"gsc-dropdown__items-footer"},g2={__name:"GSC-Dropdown",props:{modelValue:{type:[Object,Number,String],default:()=>null},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},fontSize:{type:String,default:"14px"},borderRadius:{type:Number,default:5},arrowHeight:{type:Number,default:24},arrowWidth:{type:Number,default:24},borderType:{type:String,default:"solid",validator:function(e){return["solid","dotted","dashed"].includes(e)}},borderWidth:{type:Number,default:1},borderColor:{type:String,default:"black"},backgroundColor:{type:String,default:"grey"},color:{type:String,default:"black"},arrowColor:{type:String,default:"#CBEE6B"},items:{type:Array,default:()=>[]},defaultItemByIndex:{type:Number,default:0},defaultItemByProp:{type:Object,default:null,validator:e=>["propName","value"].every(a=>a in e)},listBackgroundColor:{type:String,default:"white"},hoverBackgroundColor:{type:String,default:"#f1f1f1"},listMarginTop:{type:String,default:"0"},listContainerPadding:{type:String,default:"0"},listItemPadding:{type:String,default:"10px 12px"},listItemMargin:{type:String,default:"0"},listHeight:{type:String,default:"fit-content"},listItemSelectedColor:{type:String,default:"white"},listItemSelectedBackgroundColor:{type:String,default:"#399cfd"},listItemColor:{type:String,default:"black"},listBorderRadius:{type:String,default:"0"},listBorderColor:{type:String,default:""},listBorderWidth:{type:Number,default:1},listItemBorderRadius:{type:String,default:"0"},listAlignment:{type:String,default:"left"},isListSameWidth:{type:Boolean,default:!1},isMultipleOption:{type:Boolean,default:!1},footerBorderColor:{type:String,default:"#626970"},footerBorderWidth:{type:Number,default:1},isFooterVisible:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},onlyFirstTime:{type:Boolean,default:!1},iconType:{type:Number,default:1,validator:function(e){return[1,2].includes(e)}}},emits:["input","click-ready","update:modelValue"],setup(e,{emit:a}){const i=e,k=r.ref({}),j=r.ref(null),g=r.ref(i.isMultipleOption?-1:0),m=r.ref(!1);r.watch(()=>i.items,(v,h)=>{if(!i.modelValue&&(!i.onlyFirstTime||!h||!h.length)&&v&&v.length){if(i.defaultItemByProp){const o=i.items.findIndex(s=>s[i.defaultItemByProp.propName]===i.defaultItemByProp.value);o!==-1?(g.value=o,k.value=v[o]):(g.value=0,k.value=v[0])}else k.value=v[i.defaultItemByIndex];a("input",k.value)}},{immediate:!0}),r.watch(()=>i.modelValue,v=>{if(v){const h=i.items.findIndex(o=>typeof v=="object"?JSON.stringify(o)===JSON.stringify(v):o===v);h!==-1&&(g.value=h,k.value=i.items[h],a("update:modelValue",k.value))}},{immediate:!0});const n=r.computed(()=>({height:i.height,width:i.width,backgroundColor:i.backgroundColor,borderRadius:`${i.borderRadius}px`,border:`${i.borderType} ${i.borderWidth}px ${i.borderColor}`,color:i.color,"--hover-background-color":i.hoverBackgroundColor,"--list-container-padding":i.listContainerPadding,"--list-item-padding":i.listItemPadding,"--list-item-margin":i.listItemMargin,"--list-background-color":i.listBackgroundColor,"--list-height":i.listHeight,"--list-item-border-radius":i.listItemBorderRadius,"--list-item-selected-color":i.listItemSelectedColor,"--list-item-selected-background-color":i.listItemSelectedBackgroundColor,"--list-item-color":i.listItemColor,"--list-border-radius":`${i.listBorderRadius}`,"--list-border-color":i.listBorderColor,"--list-width":i.isListSameWidth?i.width:"fit-content","--list-border-width":`${i.listBorderWidth}px`,"--list-margin-top":i.listMarginTop,"--list-left":i.listAlignment==="left"?"0":"auto","--list-right":i.listAlignment==="right"?"0":"auto","--footer-border":`${i.footerBorderWidth}px solid ${i.footerBorderColor}`,"--dropdown-opacity":i.isDisabled?"0.5":"1","--dropdown-cursor":i.isDisabled?"not-allowed":"pointer","--dropdown-font-size":i.fontSize?i.fontSize:"14px"})),f=r.computed(()=>({height:`${i.arrowHeight}px`,width:`${i.arrowWidth}px`}));function l(){i.isDisabled||(m.value=!m.value)}function t(v){j.value&&!j.value.contains(v.target)&&(m.value=!1)}function _(v,h){i.isMultipleOption?g.value=-1:(g.value=h,m.value=!1),k.value=v,a("input",k.value),a("update:modelValue",k.value)}function b(){m.value=!1,a("click-ready")}return r.onMounted(()=>{document.addEventListener("click",t)}),r.onBeforeMount(()=>{document.removeEventListener("click",t)}),(v,h)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"dropDown",ref:j,class:"gsc-dropdown",style:r.normalizeStyle(n.value)},[r.createElementVNode("div",{class:"gsc-dropdown__main-container",style:r.normalizeStyle({"padding-right":`${e.arrowWidth+8}px`}),onClick:l},[r.createElementVNode("div",uTe,[r.renderSlot(v.$slots,"default",{selectedItem:k.value})]),r.createElementVNode("div",{class:r.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":m.value}]),style:r.normalizeStyle(f.value)},[e.iconType===1?(r.openBlock(),r.createElementBlock("svg",{key:0,height:e.arrowHeight,width:e.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M18.394 9.13501L13.1302 14.3988C12.5086 15.0204 11.4914 15.0204 10.8697 14.3988L5.60596 9.13501",stroke:e.arrowColor},null,8,pTe)],8,dTe)):(r.openBlock(),r.createElementBlock("svg",hTe,[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 2.62045L6.86193 0.167368C7.12228 -0.0557892 7.54439 -0.0557892 7.80474 0.167368C8.06509 0.390524 8.06509 0.752333 7.80474 0.97549L4.4714 3.83263C4.21105 4.05579 3.78895 4.05579 3.5286 3.83263L0.195262 0.97549C-0.0650874 0.752333 -0.0650874 0.390524 0.195262 0.167368C0.455612 -0.0557892 0.877722 -0.0557892 1.13807 0.167368L4 2.62045Z",fill:e.arrowColor},null,8,fTe)]))],6)],4),r.createVNode(r.Transition,null,{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",mTe,[r.createElementVNode("div",null,[r.createElementVNode("div",{class:"gsc-dropdown__items",style:r.normalizeStyle({"margin-top":`${i.borderWidth}px`})},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.items,(o,s)=>(r.openBlock(),r.createElementBlock("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["gsc-dropdown__items__item",{selected:s===g.value}]),key:s,onClick:p=>_(o,s)},[r.renderSlot(v.$slots,"availableItem",{item:o})],10,yTe)),[[r.vShow,!o.isHidden]])]))),256))],4),e.isFooterVisible?(r.openBlock(),r.createElementBlock("div",gTe,[r.createVNode(r.unref(cTe),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:b})])):r.createCommentVNode("",!0)])],512),[[r.vShow,m.value]])]),_:3})],4))}},AN={borderType:"solid",listBackgroundColor:"#2E3B46",listBorderColor:"rgba(255, 255, 255, 0.2)",listBorderRadius:"5px",height:"38px",borderWidth:.8,borderColor:"rgba(255, 255, 255, 0.2)",backgroundColor:"#2E3B46",color:"white",listItemColor:"white",listItemSelectedBackgroundColor:"#2E3B46",arrowColor:"#fff",width:"100%",listHeight:"200px",isListSameWidth:!1,isFooterVisible:!1,hoverBackgroundColor:"#2E3B46",iconType:2},vTe=[{label:"Goles recibidos",value:{name:"Goles recibidos",color:"#336DFF",points:[1,2,3],categories:[40],invert:[57,326,56,60,59,55],negative:!1,translationKey:"chalkboard.defensive.team.goals_received",singleName:"Gol recibido"}},{label:"Tiros a gol recibidos",value:{name:"Tiros a gol recibidos",color:"#7ED321",points:[1,2,3],categories:["510_r"],invert:[510],negative:!1,translationKey:"chalkboard.defensive.team.shots_on_goal_received",singleName:"Tiro a gol recibido"}},{label:"Tiros a gol recibidos (portería)",value:{name:"Tiros a gol recibidos (portería)",color:"#990BFF",points:[1,2,3],categories:["537_r","540_r","544_r","547_r"],invert:[537,540,544,547],negative:!1,translationKey:"chalkboard.defensive.team.shots_on_goal_received",singleName:"Tiro a gol recibido"}},{label:"Centros totales recibidos",value:{name:"Centros totales recibidos",color:"#FF9226",points:[1,2,3],categories:["13_r","25_r"],invert:[13,25],negative:!1,translationKey:"chalkboard.defensive.team.total_centers_received",singleName:"Centro recibido"}},{label:"Centros acertados por el rival",value:{name:"Centros acertados por el rival",color:"#28A3B2",points:[1,2,3],categories:["98_r","101_r","104_r","105_r","109_r","112_r","115_r","116_r"],invert:[98,101,104,105,109,112,115,116],negative:!1,translationKey:"chalkboard.defensive.team.successful_centers_by_opponent",singleName:"Centro acertado"}},{label:"Fuera de lugar provocados",value:{name:"Fuera de lugar provocados",color:"#00DD00",points:[1,2,3],categories:["33_r"],invert:[33],negative:!1,translationKey:"chalkboard.defensive.team.offsides_caused",singleName:"Fuera de lugar"}},{label:"Balones recuperados (en disputa)",value:{name:"Balones recuperados (en disputa)",color:"#FF3399",points:[1,2,3],categories:[483],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.balls_recovered_in_challenge",singleName:"Balón recuperado",isDefaultSelected:!0}},{label:"Balones recuperados (sin disputa)",value:{name:"Balones recuperados (sin disputa)",color:"#B4005A",points:[1,2,3],categories:[484],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.balls_recovered_without_challenge",singleName:"Balón recuperado"}},{label:"1 vs 1 exitosos defensivos",value:{name:"1 vs 1 exitosos defensivos",color:"#3A3838",points:[1],categories:[5],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.successful_1_on_1",singleName:"1 vs 1 defensivo"}},{label:"1 vs 1 no exitosos defensivos",value:{name:"1 vs 1 no exitosos defensivos",color:"#008B31",points:[1],categories:[209],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.unsuccessful_1_on_1",singleName:"1 vs 1 defensivo"}},{label:"Balones ganados en área propia",value:{name:"Balones ganados en área propia",color:"#305496",points:[1,2],categories:[23],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.balls_won_own_penalty_box",singleName:"Balón ganado"}},{label:"Juego aéreo resto del campo",value:{name:"Juego aéreo resto del campo",color:"#FF8A4C",points:[1,2,3],categories:[24],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.arial_game_rest_pitch",singleName:"Juego aéreo"}},{label:"Barridas",value:{name:"Barridas",color:"#700000",points:[1],categories:[518],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.slide_tackles",singleName:"Barrida"}},{label:"Rechaces",value:{name:"Rechaces",color:"#CC0000",points:[1,2,3],categories:[34],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.clearances",singleName:"Rechace"}}],bTe=[{label:"Goles",value:{name:"Goles",color:"#336DFF",points:[1,2,3],categories:[12,55,"35_r","54_r"],invert:[35,54],negative:!1,translationKey:"chalkboard.offensive.team.goals",singleName:"Gol",isDefaultSelected:!0}},{label:"Tiros a gol",value:{name:"Tiros a gol",color:"#7ED321",points:[1,2,3],categories:[510],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.shots_on_goal",singleName:"Tiro a gol",isDefaultSelected:!1}},{label:"Tiros a gol (portería)",value:{name:"Tiros a gol (portería)",color:"#990BFF",points:[1,2,3],categories:[537,540,544,547],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.shots_on_goal_2",singleName:"Tiro a gol (portería)",isDefaultSelected:!1}},{label:"Centros totales",value:{name:"Centros totales",color:"#FF9226",points:[1,2,3],categories:[13,25],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.center_crosses",singleName:"Centro",isDefaultSelected:!1}},{label:"Centros acertados",value:{name:"Centros acertados",color:"#28A3B2",points:[1,2,3],categories:[98,101,104,105,109,112,115,116],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.successful_center_crosses",singleName:"Centro acertado",isDefaultSelected:!1}},{label:"Balones ganados en área rival",value:{name:"Balones ganados en área rival",color:"#FF0092",points:[1,2],categories:[11],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.balls_won_opponent_penalty_box",singleName:"Balón ganado",isDefaultSelected:!1}},{label:"1vs1 exitosos ofensivos",value:{name:"1vs1 exitosos ofensivos",color:"#3A3838",points:[1],categories:[4],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.successful_1_on_1_attacking",singleName:"1 vs 1 ofensivo",isDefaultSelected:!1}},{label:"1vs1 no exitosos ofensivos",value:{name:"1vs1 no exitosos ofensivos",color:"#008B31",points:[1],categories:[208],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.unsuccessful_1_on_1_attacking",singleName:"1 vs 1 ofensivo",isDefaultSelected:!1}},{label:"Remates con cabeza",value:{name:"Remates con cabeza",color:"#B4005A",points:[1,2,3],categories:[330,331,333,334,423,424,343,344],invert:[],negative:!1,translationKey:"",singleName:"Remate con cabeza",isDefaultSelected:!1}},{label:"Balón perdido en disputa",value:{name:"Balón perdido en disputa",color:"#9C08B0",points:[1,2,3],categories:[494],invert:[],negative:!1,translationKey:"",singleName:"Balón perdido en disputa",isDefaultSelected:!1}},{label:"Balón perdido sin disputa",value:{name:"Balón perdido sin disputa",color:"#700000",points:[1,2,3],categories:[495],invert:[],negative:!1,translationKey:"",singleName:"Balón perdido sin disputa",isDefaultSelected:!1}}],xTe={class:"last-touch"},wTe={class:"selected-item"},_Te={class:"available-item"},STe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},TTe={class:"selected-item"},kTe={class:"available-item"},NTe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},VTe={key:1},OTe={class:"selected-item"},LTe={class:"available-item"},UTe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qTe={class:"last-touch__how-many-games"},zTe={class:"selected-item"},CTe={class:"available-item"},PTe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ETe={__name:"FilterLastTouch",props:{viewConfig:{type:Object,default:()=>({})},isEditMode:{type:Boolean,default:!1},defaultFilters:{type:Object,default:()=>null},isPostMatch:{type:Boolean,default:!0}},emits:["change","remove-views"],setup(e,{emit:a}){const i=e,k=a,j=r.ref([{label:"Ofensivo",value:2,name:"offensive"},{label:"Defensivo",value:3,name:"defensive"}]),g=r.ref({id:0,name:"Fases de juego",value:null}),m=r.ref(!1),n=r.ref([{id:1,name:"Último partido",value:1},{id:3,name:"Últimos 3 partidos",value:3},{id:0,name:"Todos mis partidos",value:0}]),f=r.ref(i.defaultFilters?null:n.value[0]),l=r.ref(null),t=r.computed(()=>({...AN})),_=r.computed(()=>({...AN,isFooterVisible:!i.isEditMode,isMultipleOption:!i.isEditMode})),b=r.computed(()=>{const K=[];return v.value.options.forEach(X=>{X.forEach(D=>{K.push(D)})}),K}),v=r.ref(null),h=r.ref(null),o=r.ref(null),s=r.ref(null);r.watch(()=>i.viewConfig,K=>{K.filters&&(v.value||p(),h.value||c(),o.value||d(),s.value||V())},{immediate:!0});function p(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="categories");K&&K.options&&(v.value={label:K.label,options:Object.entries(K.options).reduce((X,[D,H])=>(X.set(Number(D),H),X),new Map)})}v.value={label:"Tipo de jugada",options:new Map([[2,bTe],[3,vTe]])}}function c(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="gamePhases");if(K){h.value={label:K.label,options:K.options};return}}h.value={label:"Fases de juego",options:j.value}}function d(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="teamRadios");if(K){o.value={options:K.options},q(null,K.options[0]);return}}o.value={label:"Equipo",options:i.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]},q(null,o.value.options[0])}const x=r.ref(i.defaultFilters?null:o.value.options[0]),w=r.ref(i.defaultFilters?null:h.value.options[0]),S=r.ref(i.defaultFilters?null:v.value.options.get(w.value.value)[0]);function V(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="assistZoneCheckbox");if(K){s.value={label:K.label},N(K.value);return}}s.value={label:"Zona de asistencia"}}const O=r.computed(()=>{const K={selectedGamePhase:w.value,selectedTeam:x.value,isAssistZoneVisible:m.value,howManyGamesSelected:f.value};return i.isEditMode?(K.selectedCategory=S.value,K.totalCategoriesSelected=1):(K.selectedCategories=l.value,K.totalCategoriesSelected=0,v.value.options.forEach(X=>{X.forEach(D=>{D.isSelected&&(K.totalCategoriesSelected+=1)})})),K}),U=r.computed(()=>w.value?v.value.options.get(w.value.value)||[]:[]);r.watch(()=>O.value,K=>{z()&&(console.log("before emit change:",{areAllFiltersFilled:z(),filters:K,view:i.viewConfig}),k("change",{areAllFiltersFilled:z(),filters:K,view:i.viewConfig}))},{deep:!0});function z(){return w.value&&(i.isEditMode&&S.value||!i.isEditMode&&l.value&&l.value.length)&&x.value&&f.value}function L(K){w.value=K,T(null)}function C(K){x.value=K}function q(K,X){console.log("onChangeRadio:",X.value)}function N(K){m.value=K}function P(K){f.value=K}function T(K){S.value=K}function E(K,X){X.isSelected=K,l.value=b.value.filter(D=>D.isSelected)}function R(){i.defaultFilters&&(m.value=i.defaultFilters.isAssistZoneVisible,f.value=n.value.find(K=>K.value===i.defaultFilters.howManyGamesSelected.value)||n.value[0],w.value=h.value.options.find(K=>K.value===i.defaultFilters.selectedGamePhase.value)||h.value.options[0],x.value=o.value.options.find(K=>K.value===(i.defaultFilters.isHomeTeam?1:2))||o.value.options[0],S.value=v.value.options.get(w.value.value).find(K=>K.value.name===i.defaultFilters.selectedCategory.name)||v.value.options.get(w.value.value)[0])}function W(){U.value.forEach(K=>{K.isSelected=!1}),m.value=!1,f.value=n.value[0],w.value=null,x.value=null,S.value=null,l.value=null}return r.onBeforeUnmount(()=>{W()}),r.onMounted(()=>{setTimeout(()=>{R()},500)}),(K,X)=>(r.openBlock(),r.createElementBlock("div",xTe,[r.createVNode(r.unref(g2),r.mergeProps(t.value,{items:h.value.options,"model-value":w.value,"onUpdate:modelValue":L}),{default:r.withCtx(()=>[r.createElementVNode("div",wTe,[X[0]||(X[0]=r.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),r.createElementVNode("div",null,r.toDisplayString(w.value?w.value.label:h.value.label||g.value.name),1)])]),availableItem:r.withCtx(({item:D})=>[r.createElementVNode("div",_Te,[r.createElementVNode("div",null,r.toDisplayString(D.label),1),r.createElementVNode("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("svg",STe,[...X[1]||(X[1]=[r.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[r.vShow,w.value&&w.value.label===D.label]])])])]),_:1},16,["items","model-value"]),r.createVNode(r.unref(g2),r.mergeProps(_.value,{items:U.value,"model-value":S.value,"onUpdate:modelValue":T}),{default:r.withCtx(()=>[r.createElementVNode("div",TTe,[X[2]||(X[2]=r.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),r.createElementVNode("div",null,r.toDisplayString(v.value.label),1)])]),availableItem:r.withCtx(({item:D})=>[r.createElementVNode("div",kTe,[e.isEditMode?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("div",null,r.toDisplayString(D.label),1),r.createElementVNode("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("svg",NTe,[...X[3]||(X[3]=[r.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[r.vShow,S.value&&S.value.label===D.label]])])],64)):(r.openBlock(),r.createElementBlock("div",VTe,[r.createVNode(r.unref(jN),{"model-value":D.isSelected,label:D.label,"onUpdate:modelValue":H=>E(H,D)},null,8,["model-value","label","onUpdate:modelValue"])]))])]),_:1},16,["items","model-value"]),r.createVNode(r.unref(g2),r.mergeProps(t.value,{items:o.value.options,"model-value":x.value,"onUpdate:modelValue":C}),{default:r.withCtx(()=>[r.createElementVNode("div",OTe,[X[4]||(X[4]=r.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),r.createElementVNode("div",null,r.toDisplayString(x.value?x.value.label:o.value.label),1)])]),availableItem:r.withCtx(({item:D})=>[r.createElementVNode("div",LTe,[r.createElementVNode("div",null,r.toDisplayString(D.label),1),r.createElementVNode("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("svg",UTe,[...X[5]||(X[5]=[r.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[r.vShow,x.value&&x.value.label===D.label]])])])]),_:1},16,["items","model-value"]),r.createVNode(r.unref(jN),{"model-value":m.value,label:s.value.label,"onUpdate:modelValue":N},null,8,["model-value","label"]),r.withDirectives(r.createElementVNode("div",qTe,[r.createVNode(r.unref(g2),r.mergeProps(t.value,{items:n.value,"model-value":f.value,"onUpdate:modelValue":P}),{default:r.withCtx(()=>[r.createElementVNode("div",zTe,[X[6]||(X[6]=r.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),r.createElementVNode("div",null,r.toDisplayString(f.value?f.value.name:"Seleccione"),1)])]),availableItem:r.withCtx(({item:D})=>[r.createElementVNode("div",CTe,[r.createElementVNode("div",null,r.toDisplayString(D.name),1),r.createElementVNode("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("svg",PTe,[...X[7]||(X[7]=[r.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[r.vShow,f.value&&f.value.name===D.name]])])])]),_:1},16,["items","model-value"])],512),[[r.vShow,!e.isPostMatch]])]))}},FTe=Bc(ETe,[["__scopeId","data-v-b006bd89"]]),RTe={class:"resultados-filter"},MTe={class:"filter-checkboxes"},jTe=["checked","onChange"],WTe={class:"checkbox-label"},KTe={class:"filter-actions"},ATe={__name:"ResultadosFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:a}){const i=e,k=a,j=r.computed(()=>i.option.filters||[{label:"Iba ganando",value:"winning"},{label:"Iba perdiendo",value:"losing"},{label:"Iba empatado",value:"tied"}]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let b=[...g.value];_?b.includes(t)||b.push(t):b=b.filter(v=>v!==t),k("update-selection",{optionIndex:i.optionIndex,values:b})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",RTe,[r.createElementVNode("div",MTe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,b=>(r.openBlock(),r.createElementBlock("label",{key:b.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(b.value),onChange:r.withModifiers(v=>n(b.value,v.target.checked),["stop"])},null,40,jTe),r.createElementVNode("span",WTe,r.toDisplayString(b.label),1)]))),128))]),r.createElementVNode("div",KTe,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},v2=Bc(ATe,[["__scopeId","data-v-ee47f41d"]]),ITe={class:"detalles-filter"},XTe={class:"filter-checkboxes"},DTe=["checked","onChange"],JTe={class:"checkbox-label"},BTe={class:"filter-actions"},GTe={__name:"DetallesFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:a}){const i=e,k=a,j=r.computed(()=>i.option.filters||[]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let b=[...g.value];_?b.includes(t)||b.push(t):b=b.filter(v=>v!==t),k("update-selection",{optionIndex:i.optionIndex,values:b})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",ITe,[r.createElementVNode("div",XTe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,b=>(r.openBlock(),r.createElementBlock("label",{key:b.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(b.value),onChange:r.withModifiers(v=>n(b.value,v.target.checked),["stop"])},null,40,DTe),r.createElementVNode("span",JTe,r.toDisplayString(b.label),1)]))),128))]),r.createElementVNode("div",BTe,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},V5=Bc(GTe,[["__scopeId","data-v-09e05b4d"]]),ZTe={class:"como-fue-cobrado-filter"},HTe={class:"filter-checkboxes"},YTe=["checked","onChange"],QTe={class:"checkbox-label"},$Te={class:"filter-actions"},e6e={__name:"ComoFueCobradoFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:a}){const i=e,k=a,j=r.computed(()=>i.option.filters||[]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let b=[...g.value];_?b.includes(t)||b.push(t):b=b.filter(v=>v!==t),k("update-selection",{optionIndex:i.optionIndex,values:b})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",ZTe,[r.createElementVNode("div",HTe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,b=>(r.openBlock(),r.createElementBlock("label",{key:b.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(b.value),onChange:r.withModifiers(v=>n(b.value,v.target.checked),["stop"])},null,40,YTe),r.createElementVNode("span",QTe,r.toDisplayString(b.label),1)]))),128))]),r.createElementVNode("div",$Te,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},b2=Bc(e6e,[["__scopeId","data-v-7223d52b"]]),t6e={class:"zona-filter"},r6e={class:"filter-checkboxes"},n6e=["checked","onChange"],a6e={class:"checkbox-label"},i6e={class:"filter-actions"},o6e={__name:"ZonaFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:a}){const i=e,k=a,j=r.computed(()=>i.option.filters||[]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let b=[...g.value];_?b.includes(t)||b.push(t):b=b.filter(v=>v!==t),k("update-selection",{optionIndex:i.optionIndex,values:b})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",t6e,[r.createElementVNode("div",r6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,b=>(r.openBlock(),r.createElementBlock("label",{key:b.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(b.value),onChange:r.withModifiers(v=>n(b.value,v.target.checked),["stop"])},null,40,n6e),r.createElementVNode("span",a6e,r.toDisplayString(b.label),1)]))),128))]),r.createElementVNode("div",i6e,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},O5=Bc(o6e,[["__scopeId","data-v-e9f52eaa"]]),s6e={class:"que-sucedio-filter"},l6e={class:"filter-checkboxes"},c6e=["checked","onChange"],u6e={class:"checkbox-label"},d6e={class:"filter-actions"},p6e={__name:"QueSucedioFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:a}){const i=e,k=a,j=r.computed(()=>i.option.filters||[]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let b=[...g.value];_?b.includes(t)||b.push(t):b=b.filter(v=>v!==t),k("update-selection",{optionIndex:i.optionIndex,values:b})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",s6e,[r.createElementVNode("div",l6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,b=>(r.openBlock(),r.createElementBlock("label",{key:b.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(b.value),onChange:r.withModifiers(v=>n(b.value,v.target.checked),["stop"])},null,40,c6e),r.createElementVNode("span",u6e,r.toDisplayString(b.label),1)]))),128))]),r.createElementVNode("div",d6e,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},I1=Bc(p6e,[["__scopeId","data-v-0d58f7d2"]]),h6e={class:"advanced-select-accordion"},f6e=["onClick"],m6e={class:"accordion-header-left"},y6e={class:"accordion-icon"},g6e=["src","alt"],v6e={class:"accordion-title"},b6e={class:"accordion-header-right"},x6e={key:0,class:"accordion-badge"},w6e={key:0,class:"accordion-content"},_6e={class:"accordion-footer"},S6e={__name:"AdvancedSelectAccordion",props:{filter:{type:Object,required:!0},filterIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","close"],setup(e,{emit:a}){const i=e,k=a,j=r.ref({}),g=_=>{j.value[_]?j.value[_]=!1:(Object.keys(j.value).forEach(b=>{j.value[b]=!1}),j.value[_]=!0)},m=_=>{const b=i.filter.options[_];if(!b||!b.filters)return 0;const v=i.selectedValues[i.filterIndex];if(!v||!v[_])return 0;const h=v[_];return Array.isArray(h)?h.length:0},n=(_,b)=>_.icon?_.icon:`https://golstatsimages.blob.core.windows.net/todoelfut/f${b+1}.png`,f=_=>{const b={resultados:v2,detalles:V5,"como-fue-cobrado":b2,"como fue cobrado":b2,zona:O5,"que-sucedio":I1,"qué sucedió":I1,"que sucedio":I1},v=typeof _.value=="string"?_.value:String(_.value||""),h=typeof _.label=="string"?_.label:String(_.label||""),o=v.toLowerCase().trim(),s=h.toLowerCase().trim();if(o&&b[o])return b[o];if(s&&b[s])return b[s];const p=s.replace(/\s+/g,"-").replace(/[¿?]/g,"").replace(/[áéíóú]/g,c=>({á:"a",é:"e",í:"i",ó:"o",ú:"u"})[c]||c);return p&&b[p]?b[p]:v2},l=_=>{k("update-selection",{filterIndex:i.filterIndex,optionIndex:_.optionIndex,values:_.values})},t=()=>{k("close")};return(_,b)=>(r.openBlock(),r.createElementBlock("div",h6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.filter.options,(v,h)=>(r.openBlock(),r.createElementBlock("div",{key:v.value||h,class:"accordion-item"},[r.createElementVNode("div",{class:"accordion-header",onClick:r.withModifiers(o=>g(h),["stop"])},[r.createElementVNode("div",m6e,[r.createElementVNode("span",y6e,[r.createElementVNode("img",{src:n(v,h),alt:v.label},null,8,g6e)]),r.createElementVNode("span",v6e,r.toDisplayString(v.label),1)]),r.createElementVNode("div",b6e,[m(h)>0?(r.openBlock(),r.createElementBlock("span",x6e,r.toDisplayString(m(h)),1)):r.createCommentVNode("",!0),r.createElementVNode("span",{class:r.normalizeClass(["accordion-chevron",{open:j.value[h]}])},[...b[0]||(b[0]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)])],8,f6e),r.createVNode(r.Transition,{name:"accordion"},{default:r.withCtx(()=>[j.value[h]?(r.openBlock(),r.createElementBlock("div",w6e,[f(v)===v2?(r.openBlock(),r.createBlock(v2,{key:0,option:v,"filter-index":e.filterIndex,"option-index":h,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):f(v)===V5?(r.openBlock(),r.createBlock(V5,{key:1,option:v,"filter-index":e.filterIndex,"option-index":h,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):f(v)===b2?(r.openBlock(),r.createBlock(b2,{key:2,option:v,"filter-index":e.filterIndex,"option-index":h,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):f(v)===O5?(r.openBlock(),r.createBlock(O5,{key:3,option:v,"filter-index":e.filterIndex,"option-index":h,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):f(v)===I1?(r.openBlock(),r.createBlock(I1,{key:4,option:v,"filter-index":e.filterIndex,"option-index":h,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),_:2},1024)]))),128)),r.createElementVNode("div",_6e,[b[1]||(b[1]=r.createElementVNode("div",{class:"footer-separator"},null,-1)),r.createElementVNode("button",{class:"btn-done-footer",onClick:r.withModifiers(t,["stop"])}," Listo ")])]))}},T6e=Bc(S6e,[["__scopeId","data-v-2f340951"]]),k6e={class:"corners-zone-filters"},N6e={key:0,class:"custom-radio-group"},V6e={class:"radio-label"},O6e={class:"radio-options"},L6e=["name","value","onUpdate:modelValue"],U6e={key:0,class:"filter-separator"},q6e={class:"filter-inline select-with-label"},z6e=["data-filter-type","onClick"],C6e={class:"select-display"},P6e={class:"select-label"},E6e={key:0,class:"dropdown-menu type-menu simple-select-menu"},F6e={class:"simple-select-scroll-area"},R6e=["onClick"],M6e={class:"option-content"},j6e={class:"option-title"},W6e={key:0,class:"option-checkmark"},K6e={class:"switch-group"},A6e={class:"switch-label"},I6e={key:0,class:"switch-text switch-text-left"},X6e=["onClick"],D6e={key:1,class:"switch-text switch-text-right"},J6e={key:0,class:"filter-separator"},B6e={key:3,class:"filter-inline advanced-select-wrapper"},G6e=["data-filter-type","onClick"],Z6e={class:"select-display"},H6e={class:"select-label"},Y6e={key:0,class:"dropdown-menu type-menu advanced-select-menu"},Q6e={class:"advanced-select-content"},$6e={__name:"CornersZoneFilters",props:{filters:{type:Array,default:()=>[]},initialValues:{type:Array,default:()=>[]},isEditMode:{type:Boolean,default:!1},componentId:{type:Number,default:17},viewConfig:{type:Object,default:()=>({})},defaultFilters:{type:Object,default:()=>null}},emits:["filters-changed","filter-updated","change","remove-views"],setup(e,{expose:a,emit:i}){const k=e,j=i,g=r.ref([]);let m=null;const n=r.ref(null),f=r.ref(null),l=r.ref([]);let t=!1,_=null;const b=(U,z)=>{if(Array.isArray(U)&&Array.isArray(z)){if(U.length!==z.length)return!1;for(let L=0;L<U.length;L++)if(U[L]!==z[L])return!1;return!0}return U===z},v=(U,z=!0)=>{if(k.filters&&k.filters[0]&&k.filters[1]&&k.filters[1].options){const L=k.filters[0].options,C=k.filters[1].options;U!=null?L.findIndex(q=>q.value===U)!==-1&&C[U]?(l.value=C[U],z&&!(()=>{const q=g.value[1];return q==null?!1:Array.isArray(q)?q.length>0:q!==""})()&&!t&&l.value.length>0&&(g.value[1]=l.value[0].value,r.nextTick(()=>{}))):(l.value=[],g.value[1]=null):(l.value=[],g.value[1]=null)}},h=()=>{k.initialValues&&k.initialValues.length>0?k.initialValues.length>0&&(typeof k.initialValues[0]=="number"||typeof k.initialValues[0]=="boolean"||k.initialValues[0]===null||Array.isArray(k.initialValues[0]))?g.value=[...k.initialValues]:k.isEditMode?g.value=k.filters.map((U,z)=>{var L,C,q,N,P,T,E,R,W,K;const X=k.initialValues[z];return X?U.type==="radio-button"&&X.selectedOption?X.selectedOption.value:U.type==="radio-button"&&!X.selectedOption?X.selectedValue!==void 0?X.selectedValue:((T=(P=U.options)==null?void 0:P[0])==null?void 0:T.value)||null:U.type==="select-simple"&&X.selectedValue!==void 0?Array.isArray(X.selectedValue)?X.selectedValue[0]:X.selectedValue:U.type==="select"&&X.selectedOptions?X.selectedOptions.map(D=>D.value):U.type==="check"&&X.isChecked!==void 0?X.isChecked:X.selectedValue!==void 0?X.selectedValue:U.type==="select"?[]:U.type==="check"||U.type==="switch"?!1:U.type==="radio-button"?((R=(E=U.options)==null?void 0:E[0])==null?void 0:R.value)||null:U.type==="select-simple"?((K=(W=U.options)==null?void 0:W[0])==null?void 0:K.value)||null:U.type==="advanced-select"?{}:null:U.type==="select"?[]:U.type==="check"||U.type==="switch"?!1:U.type==="radio-button"?((C=(L=U.options)==null?void 0:L[0])==null?void 0:C.value)||null:U.type==="select-simple"&&((N=(q=U.options)==null?void 0:q[0])==null?void 0:N.value)||null}):g.value=[...k.initialValues]:g.value=k.filters.map(U=>{var z,L,C,q;return U.type==="select"?[]:U.type==="check"||U.type==="switch"?!1:U.type==="radio-button"?((L=(z=U.options)==null?void 0:z[0])==null?void 0:L.value)||null:U.type==="select-simple"?((q=(C=U.options)==null?void 0:C[0])==null?void 0:q.value)||null:U.type==="advanced-select"?{}:null}),g.value.some(U=>U!=null&&(Array.isArray(U)?U.length>0:typeof U=="object"&&!Array.isArray(U)?Object.keys(U).length>0:U!==!1&&U!==""))&&(m=[...g.value],j("filters-changed",{componentId:k.componentId,filters:g.value,timestamp:new Date().toISOString()}))};h(),setTimeout(()=>{r.nextTick(()=>{if(g.value[0]!==null&&g.value[0]!==void 0&&!t){const U=!(()=>{const z=g.value[1];return z==null?!1:Array.isArray(z)?z.length>0:z!==""})();v(g.value[0],U)}})},300),r.watch(()=>k.initialValues,U=>{if(!U||U.length===0)return;const z=U.length>0&&(typeof U[0]=="number"||typeof U[0]=="boolean"||U[0]===null||Array.isArray(U[0])),L=!b(g.value,U),C=U&&U.length>0&&!t&&L,q=k.isEditMode&&t;C&&!q?z?g.value=[...U]:k.isEditMode?g.value=k.filters.map((N,P)=>{const T=U[P];return T?N.type==="radio-button"&&T.selectedOption?T.selectedOption.value:N.type==="select-simple"&&T.selectedValue!==void 0?Array.isArray(T.selectedValue)?T.selectedValue[0]:T.selectedValue:N.type==="select"&&T.selectedOptions?T.selectedOptions.map(E=>E.value):N.type==="check"&&T.isChecked!==void 0||N.type==="switch"&&T.isChecked!==void 0?T.isChecked:N.type==="switch"&&T.selectedValue!==void 0||N.type==="advanced-select"&&T.selectedValue!==void 0||T.selectedValue!==void 0?T.selectedValue:g.value[P]:g.value[P]}):g.value=[...U]:t?_&&_.length>0&&(g.value=[..._]):q&&_&&_.length>0&&(g.value=[..._])},{deep:!0}),r.watch(()=>k.isEditMode,(U,z)=>{z===!0&&U===!1&&(_=null)},{immediate:!0}),r.watch(g,U=>{U.some(z=>z!=null&&(Array.isArray(z)?z.length>0:typeof z=="object"&&!Array.isArray(z)?Object.keys(z).length>0:z!==!1&&z!==""))&&(()=>{if(!m)return!0;for(let z=0;z<U.length;z++)if(!b(U[z],m[z]))return!0;return!1})()&&(m=[...U],j("filters-changed",{componentId:k.componentId,filters:U,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),r.watch(()=>g.value[0],(U,z)=>{U!==z&&z!==void 0?v(U,!0):z===void 0&&U!==null&&U!==void 0&&v(U,!1)},{immediate:!0});const o=U=>{n.value===U?n.value=null:(n.value=U,f.value=null)},s=U=>{f.value===U?f.value=null:(f.value=U,n.value=null)},p=(U,z)=>{if(t=!0,setTimeout(()=>{t=!1},1e3),g.value[U]=z,(U===0||U===1)&&(_=[...g.value]),n.value=null,U===0){g.value[1]!==void 0&&(g.value[1]=null);const L=t;t=!1,v(z,!0),t=L,g.value[1]!==null&&g.value[1]!==void 0&&(_=[...g.value])}},c=()=>{t=!0,setTimeout(()=>{t=!1},400)},d=U=>{t=!0,setTimeout(()=>{t=!1},400),g.value[U]=!g.value[U]},x=U=>{t=!0,setTimeout(()=>{t=!1},400),g.value[U.filterIndex]||(g.value[U.filterIndex]={}),g.value[U.filterIndex][U.optionIndex]=U.values},w=()=>g.value,S=(U,z)=>{const L=g.value[z];if(L==null)return null;if(z===1&&l.value.length>0){const C=l.value.find(q=>q.value===L);return C?C.label:null}if(U.options&&Array.isArray(U.options)){const C=U.options.find(q=>q.value===L);return C?C.label:null}return null},V=(U,z)=>{const L=g.value[z];if(!L||typeof L!="object"||Array.isArray(L))return null;const C=Object.values(L).reduce((q,N)=>Array.isArray(N)&&N.length>0?q+N.length:q,0);return C>0?`${C} seleccionado${C>1?"s":""}`:null},O=U=>{const z=U.target,L=z.closest(".advanced-select-dropdown"),C=z.closest(".custom-select.dynamic-select");!L&&!C&&(f.value=null,n.value=null)};return r.onMounted(()=>{document.addEventListener("click",O)}),r.onUnmounted(()=>{document.removeEventListener("click",O)}),a({getCurrentValues:w,initializeValues:h}),(U,z)=>(r.openBlock(),r.createElementBlock("div",k6e,[e.filters&&e.filters.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.filters,(L,C)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:C},[L.type==="radio-button"?(r.openBlock(),r.createElementBlock("div",N6e,[r.createElementVNode("div",V6e,r.toDisplayString(L.label),1),r.createElementVNode("div",O6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(L.options,q=>(r.openBlock(),r.createElementBlock("label",{key:q.value,class:r.normalizeClass(["radio-option-card",{active:g.value[C]===q.value}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"corners-zone-radio-"+C,value:q.value,"onUpdate:modelValue":N=>g.value[C]=N,onChange:c},null,40,L6e),[[r.vModelRadio,g.value[C]]]),r.createElementVNode("span",null,r.toDisplayString(q.label),1)],2))),128))])])):L.type==="select-simple"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[C==2?(r.openBlock(),r.createElementBlock("div",U6e)):r.createCommentVNode("",!0),r.createElementVNode("div",q6e,[r.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":L.type,onClick:r.withModifiers(q=>o(C),["stop"])},[r.createElementVNode("div",C6e,[z[1]||(z[1]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),r.createElementVNode("span",P6e,r.toDisplayString(S(L,C)||L.label_2||L.label||"Tipo de análisis"),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:n.value===C}])},[...z[0]||(z[0]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),n.value===C?(r.openBlock(),r.createElementBlock("div",E6e,[r.createElementVNode("div",F6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C===1?l.value:L.options,q=>(r.openBlock(),r.createElementBlock("div",{key:q.value,class:r.normalizeClass(["option-card simple-select-option",{active:b(g.value[C],q.value)}]),onClick:r.withModifiers(N=>p(C,q.value),["stop"])},[r.createElementVNode("div",M6e,[r.createElementVNode("div",j6e,r.toDisplayString(q.label),1)]),b(g.value[C],q.value)?(r.openBlock(),r.createElementBlock("div",W6e,[...z[2]||(z[2]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):r.createCommentVNode("",!0)],10,R6e))),128))])])):r.createCommentVNode("",!0)],8,z6e)])],64)):L.type==="switch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createElementVNode("div",K6e,[r.createElementVNode("label",A6e,[L.label_1?(r.openBlock(),r.createElementBlock("span",I6e,r.toDisplayString(L.label_1),1)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"switch",onClick:q=>d(C)},[r.createElementVNode("div",{class:r.normalizeClass(["switch-track",{"switch-on":g.value[C]}])},[r.createElementVNode("div",{class:r.normalizeClass(["switch-thumb",{on:g.value[C]}])},null,2)],2)],8,X6e),L.label_2?(r.openBlock(),r.createElementBlock("span",D6e,r.toDisplayString(L.label_2),1)):r.createCommentVNode("",!0)])]),C>=0?(r.openBlock(),r.createElementBlock("div",J6e)):r.createCommentVNode("",!0)],64)):L.type==="advanced-select"?(r.openBlock(),r.createElementBlock("div",B6e,[r.createElementVNode("div",{class:"custom-select dynamic-select filter-inline advanced-select-dropdown","data-filter-type":L.type,onClick:r.withModifiers(q=>s(C),["stop"])},[r.createElementVNode("div",Z6e,[z[4]||(z[4]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),r.createElementVNode("span",H6e,r.toDisplayString(V(L,C)||L.label||"Seleccionar"),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:f.value===C}])},[...z[3]||(z[3]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),f.value===C?(r.openBlock(),r.createElementBlock("div",Y6e,[r.createElementVNode("div",Q6e,[r.createVNode(T6e,{filter:L,"filter-index":C,"selected-values":g.value,onUpdateSelection:x,onClose:q=>s(C)},null,8,["filter","filter-index","selected-values","onClose"])])])):r.createCommentVNode("",!0)],8,G6e)])):r.createCommentVNode("",!0)],64))),128))],2)):r.createCommentVNode("",!0)]))}},e4e=Bc($6e,[["__scopeId","data-v-0748a244"]]),t4e={class:"floating-bar"},r4e={class:"tab active"},n4e={class:"select-display"},a4e={class:"select-icon"},i4e=["src"],o4e={key:1,src:"https://golstatsimages.blob.core.windows.net/images-library/vector2.png",alt:"icono",class:"option-img-default"},s4e={key:0,class:"select-placeholder select-label"},l4e={key:1,class:"select-label"},c4e={key:0,class:"dropdown-menu field-menu"},u4e=["onClick"],d4e={class:"option-icon"},p4e=["src","data-hover-src"],h4e={class:"option-content"},f4e={class:"option-title"},m4e={key:0,class:"option-description"},y4e={class:"select-display"},g4e={class:"select-icon"},v4e=["src"],b4e=["src"],x4e={class:"select-label"},w4e={key:0,class:"dropdown-menu type-menu type-menu-grid"},_4e={class:"option-grid"},S4e=["onClick"],T4e={class:"option-grid-title"},k4e={class:"option-grid-icon"},N4e=["src"],V4e={key:1,class:"filter-separator"},O4e=["onClick"],L4e={class:"select-display"},U4e={key:0,class:"badge-categorias"},q4e={key:0,class:"dropdown-menu type-menu multi-select-menu"},z4e={class:"multi-select-scroll-area"},C4e={class:"select-all-checkbox"},P4e=["checked","indeterminate","onChange"],E4e={class:"option-checkbox"},F4e=["checked","onChange"],R4e=["onClick"],M4e={class:"option-title"},j4e={class:"multi-select-footer"},W4e={key:1,class:"custom-radio-group filter-inline"},K4e={class:"radio-label"},A4e={class:"radio-options"},I4e=["name","value","onUpdate:modelValue","disabled","onChange"],X4e={key:2,class:"check-group filter-inline"},D4e=["onUpdate:modelValue","checked"],J4e=["data-filter-type","onClick"],B4e={class:"select-display"},G4e={key:0,class:"dropdown-menu type-menu simple-select-menu"},Z4e={class:"simple-select-scroll-area"},H4e=["onMouseenter","onClick"],Y4e={class:"option-content"},Q4e={class:"option-title"},$4e={key:0,class:"option-checkmark"},eke={key:4,class:"filter-separator"},tke=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(e,{expose:a,emit:i}){const k=e,j=i,g=r.ref(new Map),m=r.ref([]);let n=null,f=null,l=null;const t=r.ref(!1),_=r.ref(!1),b=r.ref(!1),v=r.ref(!1),h=r.ref(!1),o=r.ref(!1),s=r.computed(()=>m.value),p=r.ref(null),c=r.computed(()=>s.value[p.value]||null),d=r.computed(()=>{var me;const qe=((me=c.value)==null?void 0:me.views)||[];return q(qe)}),x=r.ref(null),w=r.computed(()=>d.value.find(me=>me.id===x.value)||null),S=r.ref([]),V=r.computed(()=>{var me,qe;return t.value?((me=w.value)==null?void 0:me.filters_edition_mode)||[]:((qe=w.value)==null?void 0:qe.filters)||[]});r.watch(t,me=>{me||(_.value=!1)}),r.watch(w,me=>{var qe,Re;if(!me){S.value=[];return}const Ke=me.id===6&&k.isPostMatch,rt=me.id===14;if(!Array.isArray(V.value)&&!Ke&&!rt){S.value=[];return}v.value||(Ke||rt?S.value=[]:S.value=V.value.map((nt,pt)=>{var _t,St,jt,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut,kt,vt,wt,Vt,at,Qe;if(nt.type==="select"){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt){if(xt.selectedOptions&&Array.isArray(xt.selectedOptions))return xt.selectedOptions.map(Ft=>Ft.value);if(xt.selectedValue&&Array.isArray(xt.selectedValue))return xt.selectedValue.length>0&&xt.selectedValue[0]&&typeof xt.selectedValue[0]=="object"?je(xt.selectedValue):xt.selectedValue}}return me.id===4&&nt.options&&Array.isArray(nt.options)?nt.options.map(xt=>xt.value):[]}else if(nt.type==="radio-button"){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt&&xt.selectedOption){let Ft=xt.selectedOption.value;if(me.id===15&&pt===0&&Ft===3&&((St=(_t=f==null?void 0:f.view)==null?void 0:_t.filterMultiple)==null?void 0:St.isHomeTeam)!==void 0){const Rt=f.view.filterMultiple.isHomeTeam;typeof Rt=="boolean"?Ft=Rt?1:2:typeof Rt=="number"&&(Ft=Rt===1?1:2)}return Ft}}if(me.id===7&&t.value&&f!=null&&f.view){if(pt===0&&(jt=f.view.componentProps)!=null&&jt.analysisType)return f.view.componentProps.analysisType==="offensive"?1:2;if(pt===1&&((It=f.view.filterMultiple)==null?void 0:It.isHomeTeam)!==void 0)return f.view.filterMultiple.isHomeTeam?1:2}return((lt=(Jt=nt.options)==null?void 0:Jt[0])==null?void 0:lt.value)??null}else if(nt.type==="select-simple"){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt&&xt.selectedValue!==void 0){let Ft;return me.id===2&&(dt=(tt=f==null?void 0:f.view)==null?void 0:tt.filterMultiple)!=null&&dt.categoryId?Ft=f.view.filterMultiple.categoryId:me.id===1&&(Et=(gt=f==null?void 0:f.view)==null?void 0:gt.filterMultiple)!=null&&Et.category?Ft=f.view.filterMultiple.category:me.id===6&&(it=(Lt=f==null?void 0:f.view)==null?void 0:Lt.filterMultiple)!=null&&it.gameNumber?Ft=f.view.filterMultiple.gameNumber:Ft=Array.isArray(xt.selectedValue)?xt.selectedValue[0]:xt.selectedValue,Ft}}if(me.id===2&&t.value&&f!=null&&f.view){if(n&&f.view.id){const xt=n.getComponentDynamicFilters(f.view.id);if(xt&&xt[pt]!==void 0)return xt[pt]}if(f.view.filterMultiple){if(nt.type==="select-simple"&&f.view.filterMultiple.categoryId){const xt=f.view.filterMultiple.categoryId;return(nt.options||[]).find(Ft=>Ft.value==xt),xt}if(nt.type==="radio-button"&&f.view.filterMultiple.teamType!==void 0){const xt=f.view.filterMultiple.teamType;return(nt.options||[]).find(Ft=>Ft.value==xt),xt}}}if(me.id===1&&t.value&&(ct=f==null?void 0:f.view)!=null&&ct.filterMultiple&&f.view.filterMultiple.category){const xt=f.view.filterMultiple.category;return(nt.options||[]).find(Ft=>Ft.value==xt),xt}if(me.id===9&&t.value&&(Ge=f==null?void 0:f.view)!=null&&Ge.filterMultiple&&nt.type==="select-simple"&&f.view.filterMultiple.categoryIds){const xt=Array.isArray(f.view.filterMultiple.categoryIds)?f.view.filterMultiple.categoryIds:[f.view.filterMultiple.categoryIds],Ft=(nt.options||[]).filter(Rt=>Array.isArray(Rt.value)?Pe(Rt.value,xt):xt.includes(Rt.value));return Ft.length>0?Ft[0].value:xt}if(me.id===6&&t.value&&(ut=f==null?void 0:f.view)!=null&&ut.filterMultiple&&f.view.filterMultiple.gameNumber){const xt=f.view.filterMultiple.gameNumber;return(nt.options||[]).find(Ft=>Ft.value==xt),xt}if(me.id===5&&t.value&&(kt=f==null?void 0:f.view)!=null&&kt.filterMultiple&&f.view.filterMultiple.isHomeTeam!==void 0){const xt=f.view.filterMultiple.isHomeTeam;let Ft;if(typeof xt=="boolean"?Ft=xt?1:2:typeof xt=="number"?Ft=xt===1?1:2:Ft=1,(nt.options||[]).find(Rt=>Rt.value==Ft),nt.type==="radio-button"&&(nt.label==="Equipo"||nt.label==="Team"||nt.label==="Equipo seleccionado"))return Ft}if(me.id===15&&t.value&&(vt=f==null?void 0:f.view)!=null&&vt.filterMultiple&&f.view.filterMultiple.isHomeTeam!==void 0&&nt.type==="radio-button"&&pt===0){const xt=f.view.filterMultiple.isHomeTeam;let Ft;if(typeof xt=="boolean"?Ft=xt?1:2:typeof xt=="number"?Ft=xt===1?1:2:Ft=1,(nt.options||[]).find(Rt=>Rt.value==Ft))return Ft}if(me.id===9&&t.value&&(wt=f==null?void 0:f.view)!=null&&wt.filterMultiple&&nt.type==="radio-button"&&f.view.filterMultiple.isHomeTeam!==void 0){const xt=f.view.filterMultiple.isHomeTeam?1:2,Ft=((Vt=nt.options)==null?void 0:Vt.map(Rt=>Rt.value))||[];return Ft.includes(xt)?xt:Ft[0]||1}return((Qe=(at=nt.options)==null?void 0:at[0])==null?void 0:Qe.value)??null}else if(nt.type==="check"){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt&&xt.isChecked!==void 0)return xt.isChecked}if(me.id===8)return!0;if(me.id===3){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt&&xt.isChecked!==void 0)return xt.isChecked}return!1}return!1}return null}),!((qe=me.name)!=null&&qe.toLowerCase().includes("tops players")||(Re=me.title)!=null&&Re.toLowerCase().includes("tops players"))&&(!t.value||Ke)&&r.nextTick(()=>{var nt,pt;me.id===4&&t.value&&(nt=f==null?void 0:f.view)!=null&&nt.id&&n&&n.setDynamicFilters(S.value,f.view.id),me.id===3&&t.value&&(pt=f==null?void 0:f.view)!=null&&pt.id&&n&&n.setDynamicFilters(S.value,f.view.id),ae()}))},{immediate:!0}),r.watch(()=>n,me=>{me&&me.dynamicFilters&&Array.isArray(me.dynamicFilters)&&(v.value=!0,S.value=[...me.dynamicFilters],r.nextTick(()=>{v.value=!1}))},{deep:!0}),r.watch(()=>n==null?void 0:n.dynamicFilters,me=>{if(me&&Array.isArray(me)){if(h.value)return;v.value=!0,S.value=[...me],r.nextTick(()=>{v.value=!1})}},{deep:!0}),r.watch(()=>w.value,me=>{if(t.value&&l&&me&&me.filters){if(v.value||o.value)return;if(me.id===3){if(h.value||o.value)return;const qe=l.dynamicFilters.find(Re=>Re.filterType==="check");qe&&qe.isChecked!==void 0&&S.value&&S.value.length>0&&(h.value=!0,S.value[0]=qe.isChecked,r.nextTick(()=>{S.value=[...S.value],h.value=!1}))}setTimeout(()=>{(!S.value||S.value.length===0)&&(Be(),Ee(),ve()),me.id===4&&ze()},100)}},{deep:!0}),r.watch(()=>{var me;return(me=w.value)==null?void 0:me.id},me=>{if(t.value&&l&&me===4){if(v.value||o.value)return;setTimeout(()=>{ze()},200)}}),r.watch(()=>S.value,me=>{if(t.value&&l&&me&&me.length>0){if(v.value||h.value||o.value)return;setTimeout(()=>{var qe;ke()&&(Be(),Ee(),ve(),((qe=w.value)==null?void 0:qe.id)===4&&ze())},50)}},{deep:!0});function O(me,qe){var Re,Ke,rt,nt,pt;const _t=S.value[me];if((Re=w.value)==null||Re.id,(Ke=w.value)==null||Ke.id,Array.isArray(_t)){if(((rt=w.value)==null?void 0:rt.id)===4&&me===0){const St=_t.some(jt=>{if(qe.category_id&&qe.event_type_id){if(jt.category_id&&jt.event_type_id)return jt.category_id===qe.category_id&&jt.event_type_id===qe.event_type_id;if(jt.event_type_id&&!jt.category_id)return jt.event_type_id===qe.event_type_id;if(jt.category_id&&!jt.event_type_id)return jt.category_id===qe.category_id}else{if(qe.event_type_id)return jt.event_type_id===qe.event_type_id;if(qe.category_id)return jt.category_id===qe.category_id}return JSON.stringify(jt)===JSON.stringify(qe)});return(nt=w.value)==null||nt.id,St}return _t.includes(qe)}else if(_t!=null)return(pt=w.value)==null||pt.id,_t===qe;return!1}function U(me,qe){var Re,Ke,rt;const nt=(Ke=(Re=w.value)==null?void 0:Re.filters)==null?void 0:Ke[me];if((nt==null?void 0:nt.type)==="select-simple"){ie(me,qe);return}Array.isArray(S.value[me])||(S.value[me]=[]);const pt=S.value[me];let _t=-1;((rt=w.value)==null?void 0:rt.id)===4&&me===0?_t=pt.findIndex(St=>qe.category_id&&qe.event_type_id?St.category_id===qe.category_id&&St.event_type_id===qe.event_type_id:qe.event_type_id?St.event_type_id===qe.event_type_id:qe.category_id?St.category_id===qe.category_id:!1):_t=pt.indexOf(qe),_t>-1?pt.splice(_t,1):pt.push(qe),t.value&&Ue(),ae()}function z(me){var qe,Re;const Ke=S.value[me],rt=(Re=(qe=w.value)==null?void 0:qe.filters)==null?void 0:Re[me];return(rt==null?void 0:rt.type)==="select-simple"||!rt||!rt.options||!Array.isArray(Ke)?!1:Ke.length===rt.options.length}function L(me){var qe,Re;const Ke=S.value[me],rt=(Re=(qe=w.value)==null?void 0:qe.filters)==null?void 0:Re[me];return(rt==null?void 0:rt.type)==="select-simple"||!rt||!rt.options||!Array.isArray(Ke)?!1:Ke.length>0&&Ke.length<rt.options.length}function C(){var me;return!(((me=w.value)==null?void 0:me.id)===6&&k.isPostMatch)}function q(me){return!me||!Array.isArray(me)?me:me.filter(qe=>{const Re=(qe.name||qe.title||"").toLowerCase();return k.isPostMatch?!0:!["resumen general","timeline","datos relevantes"].some(Ke=>Re.includes(Ke))})}function N(){var me,qe;const Re=((qe=(me=c.value)==null?void 0:me.name)==null?void 0:qe.toLowerCase())||"";return Re.includes("cancha")||Re.includes("volumétrica")||Re.includes("volumetric")}function P(me,qe){if(!t.value||!N())return!1;const Re=String(me||"").toLowerCase(),Ke=String(qe||"").toLowerCase();return Re.includes("ambos")||Ke.includes("ambos")}function T(me){var qe,Re;const Ke=(Re=(qe=w.value)==null?void 0:qe.filters)==null?void 0:Re[me];if(!Ke||!Ke.options)return;const rt=Ke.options.map(nt=>nt.value);Array.isArray(S.value[me])||(S.value[me]=[]),z(me)?S.value[me]=[]:S.value[me]=[...rt],K.value=me,ae()}const E=r.ref("ambos"),R=r.ref(!1),W=r.ref(!1),K=r.ref(null),X=r.ref(null);function D(me,qe=!1){const Re="https://golstatsimages.blob.core.windows.net/images-library/",Ke="https://golstatsimages.blob.core.windows.net/reports-images/",rt={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"},nt=Object.keys(rt).find(pt=>me==null?void 0:me.toLowerCase().includes(pt.toLowerCase()));if(nt){const pt=rt[nt],_t=qe?"":"-def";return nt.toLowerCase().includes("tabla")?`${Ke}${pt}${_t}@2x.png`:`${Re}${pt}${_t}@2x.png`}return`${Re}icn_default${qe?"":"-def"}.png`}function H(){return c.value?c.value.name:"Tipo de vista"}function ne(){return w.value?w.value.name||w.value.title:"Visualización"}function B(){t.value||(R.value=!R.value,R.value&&(W.value=!1,r.nextTick(()=>{Le()})))}function re(){t.value||c.value&&(W.value=!W.value,W.value&&(R.value=!1))}function ee(me){t.value||(p.value=me,R.value=!1,x.value=null,ae())}function Y(me){var qe,Re;t.value||(x.value=me.id,W.value=!1,(qe=me.name)!=null&&qe.toLowerCase().includes("tops players")||(Re=me.title)==null||Re.toLowerCase().includes("tops players"))}function $(me){var qe;K.value=K.value===me?null:me,((qe=w.value)==null?void 0:qe.id)===4&&t.value&&me===0&&setTimeout(()=>{S.value=[...S.value]},50)}function le(me){X.value=X.value===me?null:me}function ie(me,qe){var Re,Ke,rt,nt,pt;if(((Re=w.value)==null?void 0:Re.id)===2){const _t=V.value.findIndex(St=>St.type==="select-simple"&&St.label==="Tipo de análisis");me===_t?S.value[0]=qe:S.value[me]=qe}else if(((Ke=w.value)==null?void 0:Ke.id)===1)S.value[0]=qe;else if(((rt=w.value)==null?void 0:rt.id)===6)S.value[0]=qe;else if(((nt=w.value)==null?void 0:nt.id)===9)if(me===0){Array.isArray(qe)?S.value[me]=qe:S.value[me]=[qe];const _t=((pt=V.value[me])==null?void 0:pt.options)||[],St=Array.isArray(qe)?qe:[qe],jt=_t.find(It=>Array.isArray(It.value)?Pe(It.value,St):St.includes(It.value));jt?S.value[me]=jt.value:S.value[me]=St}else S.value[me]=qe;else S.value[me]=qe;X.value=null,t.value&&Ue(),ae()}function ue(me){me.target.closest(".custom-select")||(R.value=!1,W.value=!1,X.value=null)}const he=[16];function ae(){var me,qe,Re,Ke,rt,nt,pt,_t,St,jt,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut;if(he.includes((me=w.value)==null?void 0:me.id)||v.value)return;let kt=[],vt=[];w.value&&Array.isArray(V.value)&&V.value.forEach((Qe,xt)=>{if(Qe.type==="select"&&Qe.label==="Tipo de análisis"&&Qe.id===2){const Ft=S.value[xt]||[];Array.isArray(Ft)&&Ft.length>0&&(kt=Ft.map(Rt=>{var qt;const Ht=(qt=Qe.options)==null?void 0:qt.find(At=>At.value===Rt);return{value:Rt,label:(Ht==null?void 0:Ht.label)||Rt}}))}});const wt=((qe=w.value)==null?void 0:qe.id)===4;if(w.value&&Array.isArray(w.value.filters)&&w.value.filters.some(Qe=>Qe.type==="select"&&Qe.label==="Tipo de análisis"&&Qe.id===2)&&kt.length===0&&!wt)return;if(wt&&S.value&&S.value.length>0){const Qe=S.value[0];Array.isArray(Qe)&&Qe.length>0}vt=((Re=V.value)==null?void 0:Re.map((Qe,xt)=>{var Ft,Rt,qt,Ht;const At=S.value[xt];let Yt=Qe.id||`filter_${xt}`;return((Ft=w.value)==null?void 0:Ft.id)===3&&t.value&&(Rt=f==null?void 0:f.view)!=null&&Rt.id&&(Yt=`filter_${xt}_component_${f.view.id}`),{filterId:Yt,filterType:Qe.type,filterLabel:Qe.label,filterIcon:Qe.icon||null,selectedValue:At,selectedOptions:Qe.type==="select"&&Array.isArray(At)&&At.length>0?At.map(Bt=>{var Gt;const or=(Gt=Qe.options)==null?void 0:Gt.find(sr=>sr.value===Bt);return{value:Bt,label:(or==null?void 0:or.label)||Bt,icon:(or==null?void 0:or.icon)||null}}):null,selectedOption:Qe.type==="radio-button"&&At!=null?{value:At,label:((Ht=(qt=Qe.options)==null?void 0:qt.find(Bt=>Bt.value===At))==null?void 0:Ht.label)||At}:null,isChecked:Qe.type==="check"?At:null}}))||[];const Vt={mainSelector:{id:((Ke=c.value)==null?void 0:Ke.id)||null,name:((rt=c.value)==null?void 0:rt.name)||null,url:((nt=c.value)==null?void 0:nt.url)||null},viewSelector:{id:((pt=w.value)==null?void 0:pt.id)||null,name:((_t=w.value)==null?void 0:_t.name)||((St=w.value)==null?void 0:St.title)||null,url:((jt=w.value)==null?void 0:jt.url)||null},team:E.value,dynamicFilters:vt,categoriasSeleccionadas:kt,timestamp:new Date().toISOString(),summary:{mainSelected:!!c.value,viewSelected:!!w.value,totalDynamicFilters:((It=V.value)==null?void 0:It.length)||0,activeFilters:((Jt=V.value)==null?void 0:Jt.filter((Qe,xt)=>{const Ft=S.value[xt];return Array.isArray(Ft)?Ft.length>0:Ft!=null&&Ft!==!1}).length)||0}},at={main:c.value,view:w.value,team:E.value,dynamicFilters:S.value,filtersJSON:Vt,filterAndViewsContainer:n,viewToEdit:f};if(j("filters-changed",at),t.value&&f){if(l=Vt,((lt=w.value)==null?void 0:lt.id)===2){const Qe=l.dynamicFilters.findIndex(xt=>xt.filterType==="select-simple"&&xt.filterLabel==="Tipo de análisis");Qe!==-1&&(dt=(tt=f.view)==null?void 0:tt.filterMultiple)!=null&&dt.categoryId&&(l.dynamicFilters[Qe].selectedValue=f.view.filterMultiple.categoryId)}if(((gt=w.value)==null?void 0:gt.id)===1){const Qe=l.dynamicFilters.findIndex(xt=>xt.filterType==="select-simple"&&xt.filterLabel==="Tipo de análisis");Qe!==-1&&(Lt=(Et=f.view)==null?void 0:Et.filterMultiple)!=null&&Lt.category&&(l.dynamicFilters[Qe].selectedValue=f.view.filterMultiple.category)}}if(((it=w.value)==null?void 0:it.id)===6&&t.value&&(ct=f==null?void 0:f.view)!=null&&ct.filterMultiple&&f.view.filterMultiple.gameNumber&&l){const Qe=l.dynamicFilters.findIndex(xt=>xt.filterType==="select-simple"&&xt.filterLabel==="Número de juego");Qe!==-1&&(ut=(Ge=f.view)==null?void 0:Ge.filterMultiple)!=null&&ut.gameNumber&&(l.dynamicFilters[Qe].selectedValue=f.view.filterMultiple.gameNumber)}n&&!t.value?n.setDynamicFilters(S.value):n&&t.value}function de(){f=null,l=null,n=null,p.value=null,x.value=null,E.value="ambos",S.value=[],R.value=!1,W.value=!1,K.value=null,X.value=null,t.value=!1,_.value=!1,b.value=!1}function ce(me){if(me&&me.dynamicFilters){if(h.value)return;Array.isArray(me.dynamicFilters)&&me.dynamicFilters.length>0&&(v.value=!0,S.value=[...me.dynamicFilters],r.nextTick(()=>{v.value=!1}))}}function ye(me){if(t.value=!0,me.mainSelector&&me.mainSelector.id){const qe=m.value.findIndex(Re=>Re.id===me.mainSelector.id);qe!==-1&&(p.value=qe)}me.viewSelector&&me.viewSelector.id&&c.value&&c.value.views.findIndex(qe=>qe.id===me.viewSelector.id)!==-1&&(x.value=me.viewSelector.id),me.dynamicFilters&&Array.isArray(me.dynamicFilters)&&r.nextTick(()=>{setTimeout(()=>{var qe,Re,Ke,rt,nt,pt,_t,St,jt,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut,kt,vt;if(w.value&&V.value){if(v.value)return;if(h.value=!0,me.dynamicFilters.forEach((wt,Vt)=>{var at,Qe,xt,Ft,Rt,qt,Ht,At,Yt,Bt,Gt,or,sr;if(Vt<V.value.length){const Ur=V.value[Vt];if(((at=w.value)==null?void 0:at.id)===3&&t.value,Ur.type==="check"){const zr=wt.isChecked;typeof zr=="boolean"&&(S.value[Vt]=zr)}else if(Ur.type==="select"&&wt.selectedOptions){const zr=wt.selectedOptions.map(Lr=>Lr.value);S.value[Vt]=zr}else if(Ur.type==="select"&&wt.selectedValue&&Array.isArray(wt.selectedValue))if(wt.selectedValue.length>0&&wt.selectedValue[0]&&typeof wt.selectedValue[0]=="object"){const zr=je(wt.selectedValue);S.value[Vt]=zr}else S.value[Vt]=wt.selectedValue;else if(Ur.type==="radio-button"&&wt.selectedOption)S.value[Vt]=wt.selectedOption.value;else if(Ur.type==="select-simple"&&wt.selectedValue!==void 0){let zr;((Qe=w.value)==null?void 0:Qe.id)===2&&(Ft=(xt=f==null?void 0:f.view)==null?void 0:xt.filterMultiple)!=null&&Ft.categoryId?zr=f.view.filterMultiple.categoryId:((Rt=w.value)==null?void 0:Rt.id)===1&&(Ht=(qt=f==null?void 0:f.view)==null?void 0:qt.filterMultiple)!=null&&Ht.category?zr=f.view.filterMultiple.category:((At=w.value)==null?void 0:At.id)===6&&(Bt=(Yt=f==null?void 0:f.view)==null?void 0:Yt.filterMultiple)!=null&&Bt.gameNumber?zr=f.view.filterMultiple.gameNumber:((Gt=w.value)==null?void 0:Gt.id)===9&&(sr=(or=f==null?void 0:f.view)==null?void 0:or.filterMultiple)!=null&&sr.categoryIds?zr=f.view.filterMultiple.categoryIds:zr=Array.isArray(wt.selectedValue)?wt.selectedValue[0]:wt.selectedValue,S.value[Vt]=zr}}}),((qe=w.value)==null?void 0:qe.id)===3&&t.value,((Re=w.value)==null?void 0:Re.id)===2&&t.value&&(Ke=f==null?void 0:f.view)!=null&&Ke.filterMultiple){if(f.view.filterMultiple.categoryId){const wt=V.value.findIndex(Vt=>Vt.type==="select-simple"&&Vt.label==="Tipo de análisis");if(wt!==-1){const Vt=f.view.filterMultiple.categoryId;if(S.value[0]=Vt,f.view.componentProps&&Vt){let at=`Category ${Vt}`,Qe=null;try{Qe=jh(Vt),Qe&&(at=Qe.name)}catch{const xt=V.value.findIndex(Ft=>Ft.type==="select-simple"&&Ft.label==="Tipo de análisis");if(xt!==-1){const Ft=(((rt=V.value[xt])==null?void 0:rt.options)||[]).find(Rt=>Rt.value==Vt);Ft&&(at=Ft.label)}}f.view.componentProps.categoryView=[{id:Vt,name:at}]}(((nt=V.value[wt])==null?void 0:nt.options)||[]).find(at=>at.value==Vt),r.nextTick(()=>{S.value=[...S.value]})}}if(f.view.filterMultiple.teamType!==void 0){const wt=V.value.findIndex(Vt=>Vt.type==="radio-button");if(wt!==-1){const Vt=f.view.filterMultiple.teamType;S.value[wt]=Vt,(((pt=V.value[wt])==null?void 0:pt.options)||[]).find(at=>at.value==Vt),r.nextTick(()=>{S.value=[...S.value]})}}}if(((_t=w.value)==null?void 0:_t.id)===9&&t.value&&(St=f==null?void 0:f.view)!=null&&St.filterMultiple){if(f.view.filterMultiple.categoryIds){const wt=V.value.findIndex(Vt=>Vt.type==="select-simple");if(wt!==-1){const Vt=Array.isArray(f.view.filterMultiple.categoryIds)?f.view.filterMultiple.categoryIds:[f.view.filterMultiple.categoryIds];S.value[0]=Vt;const at=(((jt=V.value[wt])==null?void 0:jt.options)||[]).filter(xt=>Array.isArray(xt.value)?Pe(xt.value,Vt):Vt.includes(xt.value));if(at.length>0){const xt=at[0].value;S.value[wt]=xt}else S.value[wt]=Vt;const Qe=S.value[wt];Pe(Qe,Vt),r.nextTick(()=>{S.value=[...S.value]})}}if(f.view.filterMultiple.isHomeTeam!==void 0){const wt=V.value.findIndex(Vt=>Vt.type==="radio-button");if(wt!==-1){const Vt=f.view.filterMultiple.isHomeTeam;let at;typeof Vt=="boolean"?at=Vt?1:2:typeof Vt=="number"?at=Vt===1?1:2:at=1,S.value[wt]=at,(((It=V.value[wt])==null?void 0:It.options)||[]).find(Qe=>Qe.value==at),r.nextTick(()=>{S.value=[...S.value]})}}}if(((Jt=w.value)==null?void 0:Jt.id)===1&&t.value&&(lt=f==null?void 0:f.view)!=null&&lt.filterMultiple&&f.view.filterMultiple.category){const wt=V.value.findIndex(Vt=>Vt.type==="select-simple"&&Vt.label==="Tipo de análisis");if(wt!==-1){const Vt=f.view.filterMultiple.category;S.value[0]=Vt,f.view.componentProps&&Vt&&(f.view.componentProps.type=Vt),(((tt=V.value[wt])==null?void 0:tt.options)||[]).find(at=>at.value==Vt),r.nextTick(()=>{S.value=[...S.value]})}}if(((dt=w.value)==null?void 0:dt.id)===6&&t.value&&(gt=f==null?void 0:f.view)!=null&&gt.filterMultiple&&f.view.filterMultiple.gameNumber){const wt=V.value.findIndex(Vt=>Vt.type==="select-simple"&&Vt.label==="Número de juego");if(wt!==-1){const Vt=f.view.filterMultiple.gameNumber;S.value[0]=Vt,f.view.componentProps&&Vt&&(f.view.componentProps.gameNumber=Vt),(((Et=V.value[wt])==null?void 0:Et.options)||[]).find(at=>at.value==Vt),r.nextTick(()=>{S.value=[...S.value]})}}if(((Lt=w.value)==null?void 0:Lt.id)===7&&t.value&&f!=null&&f.view){if((it=f.view.componentProps)!=null&&it.analysisType&&V.value.length>0&&((ct=V.value[0])==null?void 0:ct.type)==="radio-button"){const wt=f.view.componentProps.analysisType==="offensive"?1:2;S.value[0]=wt}if(((Ge=f.view.filterMultiple)==null?void 0:Ge.isHomeTeam)!==void 0){const wt=V.value.findIndex(Vt=>Vt.type==="radio-button"&&Vt.label==="Equipo");if(wt!==-1){const Vt=f.view.filterMultiple.isHomeTeam?1:2;S.value[1]=Vt}else if(V.value.length>1&&((ut=V.value[1])==null?void 0:ut.type)==="radio-button"){const Vt=f.view.filterMultiple.isHomeTeam,at=Vt?1:2;S.value[1]=at,f.view.componentProps&&(f.view.componentProps.isHomeTeamForAnalysis=Vt),(((kt=V.value[1])==null?void 0:kt.options)||[]).find(Qe=>Qe.value==at),r.nextTick(()=>{S.value=[...S.value]})}if(wt!==-1&&f.view.componentProps){const Vt=f.view.filterMultiple.isHomeTeam,at=Vt?1:2;f.view.componentProps.isHomeTeamForAnalysis=Vt,(((vt=V.value[wt])==null?void 0:vt.options)||[]).find(Qe=>Qe.value==at),r.nextTick(()=>{S.value=[...S.value]})}}}r.nextTick(()=>{h.value=!1})}},100)})}function xe(){var me,qe,Re,Ke,rt,nt,pt,_t,St,jt;return{mainSelector:{id:((me=c.value)==null?void 0:me.id)||null,name:((qe=c.value)==null?void 0:qe.name)||null,url:((Re=c.value)==null?void 0:Re.url)||null},viewSelector:{id:((Ke=w.value)==null?void 0:Ke.id)||null,name:((rt=w.value)==null?void 0:rt.name)||((nt=w.value)==null?void 0:nt.title)||null,url:((pt=w.value)==null?void 0:pt.url)||null},team:E.value,dynamicFilters:((_t=V.value)==null?void 0:_t.map((It,Jt)=>{var lt,tt;const dt=S.value[Jt];return{filterId:It.id||`filter_${Jt}`,filterType:It.type,filterLabel:It.label,filterIcon:It.icon||null,selectedValue:dt,selectedOptions:It.type==="select"&&Array.isArray(dt)&&dt.length>0?dt.map(gt=>{var Et;const Lt=(Et=It.options)==null?void 0:Et.find(it=>it.value===gt);return{value:gt,label:(Lt==null?void 0:Lt.label)||gt,icon:(Lt==null?void 0:Lt.icon)||null}}):null,selectedOption:It.type==="radio-button"&&dt?{value:dt,label:((tt=(lt=It.options)==null?void 0:lt.find(gt=>gt.value===dt))==null?void 0:tt.label)||dt}:null,isChecked:It.type==="check"?dt:null}}))||[],timestamp:new Date().toISOString(),summary:{mainSelected:!!c.value,viewSelected:!!w.value,totalDynamicFilters:((St=V.value)==null?void 0:St.length)||0,activeFilters:((jt=V.value)==null?void 0:jt.filter((It,Jt)=>{const lt=S.value[Jt];return Array.isArray(lt)?lt.length>0:lt!=null&&lt!==!1}).length)||0}}}a({getCurrentFiltersJSON:xe});function be(){de(),j("close",n)}function Te(){_.value=!1,be()}function Oe(){b.value&&(qa.emit("filters-cancelled",n),b.value=!1),_.value=!1,be()}r.onMounted(async()=>{document.addEventListener("click",ue),r.nextTick(()=>{Le()});const me="https://fb78a14uud.execute-api.us-east-2.amazonaws.com/qa/views";try{const qe=await(await fetch(me,{headers:{Authorization:`${k.token}`}})).json();m.value=qe.data||[],g.value.clear(),m.value&&(g.value=m.value.reduce((Re,Ke)=>(Ke.views&&Array.isArray(Ke.views)&&Ke.views.forEach(rt=>{rt.filters&&Array.isArray(rt.filters)&&Re.set(rt.id,rt)}),Re),new Map))}catch(qe){console.error("Error al obtener datos:",qe)}});function Le(){document.querySelectorAll(".field-menu .option-card").forEach(me=>{const qe=me.querySelector(".option-img");if(!qe||!qe.dataset.hoverSrc)return;const Re=qe.src,Ke=qe.dataset.hoverSrc;me.addEventListener("mouseenter",()=>{qe.src=Ke}),me.addEventListener("mouseleave",()=>{qe.src=Re})})}r.onUnmounted(()=>{document.removeEventListener("click",ue)}),qa.on("set-filter-and-views-container",me=>{n=me,me&&ce(me)}),qa.on("view-added",()=>{_.value=!0,b.value=!0}),qa.on("component-added-to-container",me=>{(!t.value||n&&me.id===n.id)&&ce(me)}),qa.on("edit-view",me=>{var qe,Re,Ke,rt,nt,pt,_t,St,jt,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut;f=me,n=((qe=me.view)==null?void 0:qe.filterAndViewsContainer)||null,l=null;const kt=[(Ke=(Re=me.view)==null?void 0:Re.coreView)==null?void 0:Ke.filtersJSON,(rt=me.view)==null?void 0:rt.filtersJSON,(nt=me.coreView)==null?void 0:nt.filtersJSON,me.filtersJSON,(_t=(pt=me.view)==null?void 0:pt.componentProps)==null?void 0:_t.filtersJSON];for(const vt of kt)if(vt){l=vt;break}if(n&&(n.viewId===4||n.viewId===8||n.viewId===3||n.viewId===1||n.viewId===2||n.viewId===13)&&(St=me.view)!=null&&St.id){const vt=n.getComponentDynamicFilters(me.view.id);if(vt){let wt="Unknown";n.viewId===4?wt="Timeline":n.viewId===8?wt="FieldPosesion":n.viewId===3?wt="GSCMatchSummary":n.viewId===1?wt="GSCComparativeReports":n.viewId===2?wt="GscTopPlayer":n.viewId===13&&(wt="GSCTimelapseTable"),l&&(n.viewId===13?l={...l,dynamicFilters:vt}:l={...l,dynamicFilters:vt.map((Vt,at)=>Array.isArray(Vt)?{selectedValue:Vt,selectedOptions:Vt.map(Qe=>({value:Qe,label:Qe}))}:typeof Vt=="boolean"?{isChecked:Vt}:wt==="GSCComparativeReports"&&at===0?{selectedValue:Vt,selectedOptions:[{value:Vt,label:Vt}]}:wt==="GscTopPlayer"&&at===0?{selectedValue:Vt,selectedOptions:[{value:Vt,label:Vt}]}:wt==="GscTopPlayer"&&at===1?{selectedOption:{value:Vt,label:Vt}}:{selectedOption:{value:Vt,label:Vt}})})}}if(n&&n.viewId===2&&(jt=me.view)!=null&&jt.filterMultiple){if(me.view.filterMultiple.categoryId&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select-simple"&&wt.filterLabel==="Tipo de análisis");vt!==-1&&(l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:me.view.filterMultiple.categoryId,selectedOptions:[{value:me.view.filterMultiple.categoryId,label:`Category ${me.view.filterMultiple.categoryId}`}]})}if(me.view.filterMultiple.teamType!==void 0&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="radio-button");if(vt!==-1){const wt=me.view.filterMultiple.teamType,Vt=wt===1?"Mi equipo":wt===2?"Rival":wt===3?"Ambos":"Equipo";l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:wt,label:Vt}}}}}if(n&&n.viewId===1&&(It=me.view)!=null&&It.filterMultiple&&me.view.filterMultiple.category&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select-simple"&&wt.filterLabel==="Tipo de análisis");vt!==-1&&(l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:me.view.filterMultiple.category,selectedOptions:[{value:me.view.filterMultiple.category,label:me.view.filterMultiple.category}]})}if(n&&n.viewId===9&&(Jt=me.view)!=null&&Jt.filterMultiple){if(me.view.filterMultiple.categoryIds&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select"&&wt.filterLabel==="Tipo de análisis");if(vt!==-1){const wt=Array.isArray(me.view.filterMultiple.categoryIds)?me.view.filterMultiple.categoryIds:[me.view.filterMultiple.categoryIds];l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:wt,selectedOptions:wt.map(Qe=>({value:Qe,label:`Category ${Qe}`}))};const Vt=me.view.filterMultiple.categoryIds;Pe(Vt,wt);const at=(((lt=V.value[vt])==null?void 0:lt.options)||[]).filter(Qe=>Array.isArray(Qe.value)?Pe(Qe.value,wt):wt.includes(Qe.value));if(at.length>0){const Qe=at[0];l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:Qe.value,selectedOptions:[Qe]}}}}if(me.view.filterMultiple.isHomeTeam!==void 0&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="radio-button");if(vt!==-1){const wt=me.view.filterMultiple.isHomeTeam;let Vt,at;typeof wt=="boolean"?(Vt=wt?1:2,at=wt?"Mi equipo":"Rival"):typeof wt=="number"?(Vt=wt===1?1:2,at=wt===1?"Mi equipo":"Rival"):(Vt=1,at="Mi equipo"),l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Vt,label:at}}}}}if(n&&n.viewId===6&&(tt=me.view)!=null&&tt.filterMultiple&&me.view.filterMultiple.gameNumber&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select-simple"&&wt.filterLabel==="Número de juego");vt!==-1&&(l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:me.view.filterMultiple.gameNumber,selectedOptions:[{value:me.view.filterMultiple.gameNumber,label:`Juego ${me.view.filterMultiple.gameNumber}`}]})}if(n&&n.viewId===7&&me.view&&l){if((dt=me.view.componentProps)!=null&&dt.analysisType){const vt=l.dynamicFilters.findIndex((wt,Vt)=>wt.filterType==="radio-button"&&Vt===0);if(vt!==-1){const wt=me.view.componentProps.analysisType,Vt=wt==="offensive"?1:2,at=wt==="offensive"?"A favor":"En contra";l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Vt,label:at}}}}if(((gt=me.view.filterMultiple)==null?void 0:gt.isHomeTeam)!==void 0){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="radio-button"&&wt.filterLabel==="Equipo");if(vt!==-1){const wt=me.view.filterMultiple.isHomeTeam,Vt=wt?1:2,at=wt?"Equipo propio":"Equipo rival";l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Vt,label:at}}}}}if(n&&n.viewId===10&&(Et=me.view)!=null&&Et.filterMultiple&&((it=(Lt=f==null?void 0:f.view)==null?void 0:Lt.coreView)==null?void 0:it.id)===10){const vt=me.view.componentProps.isHomeTeamForAnalysis?{label:"Equipo propio",value:1}:{label:"Rival",value:2};l&&(l.dynamicFilters[0]={...l.dynamicFilters[0],selectedOption:vt})}if(n&&n.viewId===15&&(ct=me.view)!=null&&ct.id){const vt=n.getComponentDynamicFilters(me.view.id);if(vt&&l)l={...l,dynamicFilters:vt.map((wt,Vt)=>{var at,Qe;if(Vt===0){let xt=wt;if(wt===3&&((Qe=(at=me.view)==null?void 0:at.filterMultiple)==null?void 0:Qe.isHomeTeam)!==void 0){const Ft=me.view.filterMultiple.isHomeTeam;typeof Ft=="boolean"?xt=Ft?1:2:typeof Ft=="number"&&(xt=Ft===1?1:2)}return{selectedOption:{value:xt,label:xt===1?"Mi equipo":"Rival"}}}else if(Vt===1)return{selectedValue:wt,selectedOptions:[{value:wt,label:`${wt} fortalezas`}]};return typeof wt=="number"?{selectedValue:wt}:{selectedOption:{value:wt,label:String(wt)}}})};else if((Ge=me.view)!=null&&Ge.filterMultiple&&l&&me.view.filterMultiple.isHomeTeam!==void 0){const wt=l.dynamicFilters.findIndex(Vt=>Vt.filterType==="radio-button"&&Vt.filterLabel==="Mi equipo");if(wt!==-1){const Vt=me.view.filterMultiple.isHomeTeam;let at,Qe;typeof Vt=="boolean"?(at=Vt?1:2,Qe=Vt?"Local":"Visitante"):typeof Vt=="number"?(at=Vt===1?1:2,Qe=Vt===1?"Local":"Visitante"):(at=1,Qe="Local"),l.dynamicFilters[wt]={...l.dynamicFilters[wt],selectedOption:{value:at,label:Qe}}}}}if(n&&n.viewId===5&&(ut=me.view)!=null&&ut.filterMultiple&&me.view.filterMultiple.isHomeTeam!==void 0&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="radio-button"&&wt.filterLabel==="Equipo");if(vt!==-1){const wt=me.view.filterMultiple.isHomeTeam;let Vt,at;typeof wt=="boolean"?(Vt=wt?1:2,at=wt?"Equipo propio":"Equipo rival"):typeof wt=="number"?(Vt=wt===1?1:2,at=wt===1?"Equipo propio":"Equipo rival"):(Vt=1,at="Equipo propio"),l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Vt,label:at}}}else{const wt=l.dynamicFilters.findIndex(Vt=>Vt.filterType==="radio-button");if(wt!==-1){const Vt=me.view.filterMultiple.isHomeTeam;let at,Qe;typeof Vt=="boolean"?(at=Vt?1:2,Qe=Vt?"Equipo propio":"Equipo rival"):typeof Vt=="number"?(at=Vt===1?1:2,Qe=Vt===1?"Equipo propio":"Equipo rival"):(at=1,Qe="Equipo propio"),l.dynamicFilters[wt]={...l.dynamicFilters[wt],selectedOption:{value:at,label:Qe}}}}}l&&ye(l),_.value=!0});function _e(){K.value=null}function Ce(me,qe){var Re;(Re=w.value)==null||Re.id}function Pe(me,qe){if(!Array.isArray(me)||!Array.isArray(qe)||me.length!==qe.length)return!1;const Re=[...me].sort((rt,nt)=>rt-nt),Ke=[...qe].sort((rt,nt)=>rt-nt);return JSON.stringify(Re)===JSON.stringify(Ke)}function Be(){if(t.value&&l&&l.dynamicFilters){if(o.value||v.value)return;o.value=!0,h.value=!0,l.dynamicFilters.forEach((me,qe)=>{var Re;if(me&&(Re=V.value)!=null&&Re[qe]){const Ke=V.value[qe];if(Ke.type==="check"&&me.isChecked!==void 0)S.value[qe]=me.isChecked;else if(Ke.type==="select"&&me.selectedOptions){const rt=me.selectedOptions.map(nt=>nt.value);S.value[qe]=rt}else Ke.type==="select"&&me.selectedValue&&Array.isArray(me.selectedValue)&&(S.value[qe]=me.selectedValue)}}),r.nextTick(()=>{h.value=!1,o.value=!1})}}function ze(){var me;if(t.value&&l&&l.dynamicFilters&&((me=w.value)==null?void 0:me.id)===4){if(o.value||v.value)return;o.value=!0,h.value=!0,l.dynamicFilters.forEach((qe,Re)=>{var Ke,rt;if(qe&&((rt=(Ke=V.value)==null?void 0:Ke[Re])==null?void 0:rt.type)==="select"){if(qe.selectedOptions){const nt=qe.selectedOptions.map(pt=>pt.value);S.value[Re]=nt}else if(qe.selectedValue&&Array.isArray(qe.selectedValue))if(qe.selectedValue.length>0&&qe.selectedValue[0]&&typeof qe.selectedValue[0]=="object"){const nt=je(qe.selectedValue);S.value[Re]=nt}else S.value[Re]=qe.selectedValue}}),setTimeout(()=>{var qe;if(S.value=[...S.value],(qe=f==null?void 0:f.view)!=null&&qe.componentProps&&S.value&&S.value.length>0){const Re=S.value[0];if(Array.isArray(Re)&&Re.length>0){const Ke=Re.some(_t=>_t.event_type_id===1||typeof _t=="string"&&_t.includes("1")),rt=Re.some(_t=>_t.category_id===8||typeof _t=="string"&&_t.includes("8")),nt=Re.some(_t=>_t.category_id===9||typeof _t=="string"&&_t.includes("9")),pt=Re.some(_t=>_t.event_type_id===3||typeof _t=="string"&&_t.includes("3"));f.view.componentProps.selectedEvents=Re,f.view.componentProps.goals=Ke,f.view.componentProps.yellowCards=rt,f.view.componentProps.redCards=nt,f.view.componentProps.substitutions=pt,f.view.componentProps.key=Re.length>0,f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps})}}},200),r.nextTick(()=>{h.value=!1,o.value=!1})}}function je(me){return!Array.isArray(me)||me.length===0?[]:me.map(qe=>{if(qe&&typeof qe=="object"){if(qe.event_type_id!==void 0||qe.category_id!==void 0)return{event_type_id:qe.event_type_id,category_id:qe.category_id,...qe.name&&{name:qe.name},...qe.label&&{label:qe.label}};if(qe.value&&typeof qe.value=="object")return{event_type_id:qe.value.event_type_id,category_id:qe.value.category_id,...qe.value.name&&{name:qe.value.name},...qe.value.label&&{label:qe.value.label}};if(typeof qe=="string"&&qe.includes("-")){const[Re,Ke]=qe.split("-");return{category_id:parseInt(Re),event_type_id:parseInt(Ke)}}}if(typeof qe=="string")if(qe.includes("-")){const[Re,Ke]=qe.split("-");return{category_id:parseInt(Re),event_type_id:parseInt(Ke)}}else{const Re=parseInt(qe);if(!isNaN(Re))return{event_type_id:Re}}return qe})}function Ee(){var me,qe,Re,Ke,rt,nt,pt,_t,St,jt,It,Jt,lt,tt;if(t.value&&l&&l.dynamicFilters&&V.value){if(o.value||v.value)return;if(o.value=!0,h.value=!0,l.dynamicFilters.forEach((dt,gt)=>{var Et,Lt,it,ct,Ge,ut,kt,vt,wt,Vt,at;if(dt&&((Et=V.value[gt])==null?void 0:Et.type)==="select"){if(dt.selectedOptions){const Qe=dt.selectedOptions.map(xt=>xt.value);S.value[gt]=Qe}else if(dt.selectedValue&&Array.isArray(dt.selectedValue))if(dt.selectedValue.length>0&&dt.selectedValue[0]&&typeof dt.selectedValue[0]=="object"){const Qe=je(dt.selectedValue);S.value[gt]=Qe}else S.value[gt]=dt.selectedValue}else if(dt&&((Lt=V.value[gt])==null?void 0:Lt.type)==="select-simple"&&dt.selectedValue!==void 0){let Qe;((it=w.value)==null?void 0:it.id)===2&&(Ge=(ct=f==null?void 0:f.view)==null?void 0:ct.filterMultiple)!=null&&Ge.categoryId?Qe=f.view.filterMultiple.categoryId:((ut=w.value)==null?void 0:ut.id)===1&&(vt=(kt=f==null?void 0:f.view)==null?void 0:kt.filterMultiple)!=null&&vt.category?Qe=f.view.filterMultiple.category:((wt=w.value)==null?void 0:wt.id)===6&&(at=(Vt=f==null?void 0:f.view)==null?void 0:Vt.filterMultiple)!=null&&at.gameNumber?Qe=f.view.filterMultiple.gameNumber:Qe=Array.isArray(dt.selectedValue)?dt.selectedValue[0]:dt.selectedValue,S.value[gt]=Qe}}),((me=w.value)==null?void 0:me.id)===4&&setTimeout(()=>{var dt;if(S.value=[...S.value],(dt=f==null?void 0:f.view)!=null&&dt.componentProps&&S.value&&S.value.length>0){const gt=S.value[0];if(Array.isArray(gt)&&gt.length>0){const Et=gt.some(Ge=>Ge.event_type_id===1||typeof Ge=="string"&&Ge.includes("1")),Lt=gt.some(Ge=>Ge.category_id===8||typeof Ge=="string"&&Ge.includes("8")),it=gt.some(Ge=>Ge.category_id===9||typeof Ge=="string"&&Ge.includes("9")),ct=gt.some(Ge=>Ge.event_type_id===3||typeof Ge=="string"&&Ge.includes("3"));f.view.componentProps.selectedEvents=gt,f.view.componentProps.goals=Et,f.view.componentProps.yellowCards=Lt,f.view.componentProps.redCards=it,f.view.componentProps.substitutions=ct,f.view.componentProps.key=gt.length>0,f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps})}}},100),((qe=w.value)==null?void 0:qe.id)===2&&(Re=f==null?void 0:f.view)!=null&&Re.filterMultiple){if(f.view.filterMultiple.categoryId){const dt=V.value.findIndex(gt=>gt.type==="select-simple"&&gt.label==="Tipo de análisis");if(dt!==-1){const gt=f.view.filterMultiple.categoryId;if(S.value[0]=gt,f.view.componentProps&&gt){let Et=`Category ${gt}`,Lt=null;try{Lt=jh(gt),Lt&&(Et=Lt.name)}catch{const it=V.value.findIndex(ct=>ct.type==="select-simple"&&ct.label==="Tipo de análisis");if(it!==-1){const ct=(((Ke=V.value[it])==null?void 0:Ke.options)||[]).find(Ge=>Ge.value==gt);ct&&(Et=ct.label)}}f.view.componentProps.categoryView=[{id:gt,name:Et}]}(((rt=V.value[dt])==null?void 0:rt.options)||[]).find(Et=>Et.value==gt),r.nextTick(()=>{S.value=[...S.value]})}}if(f.view.filterMultiple.teamType!==void 0){const dt=V.value.findIndex(gt=>gt.type==="radio-button");if(dt!==-1){const gt=f.view.filterMultiple.teamType;S.value[dt]=gt,(((nt=V.value[dt])==null?void 0:nt.options)||[]).find(Et=>Et.value==gt),r.nextTick(()=>{S.value=[...S.value]})}}}if(((pt=w.value)==null?void 0:pt.id)===1&&(_t=f==null?void 0:f.view)!=null&&_t.filterMultiple&&f.view.filterMultiple.category&&V.value.findIndex(dt=>dt.type==="select-simple"&&dt.label==="Tipo de análisis")!==-1){const dt=f.view.filterMultiple.category;S.value[0]=dt,f.view.componentProps&&dt&&(f.view.componentProps.type=dt),r.nextTick(()=>{S.value=[...S.value]})}if(((St=w.value)==null?void 0:St.id)===6&&(jt=f==null?void 0:f.view)!=null&&jt.filterMultiple&&f.view.filterMultiple.gameNumber&&V.value.findIndex(dt=>dt.type==="select-simple"&&dt.label==="Número de juego")!==-1){const dt=f.view.filterMultiple.gameNumber;S.value[0]=dt,f.view.componentProps&&dt&&(f.view.componentProps.gameNumber=dt),r.nextTick(()=>{S.value=[...S.value]})}if(((It=w.value)==null?void 0:It.id)===5&&(Jt=f==null?void 0:f.view)!=null&&Jt.filterMultiple&&f.view.filterMultiple.isHomeTeam!==void 0)if(V.value.findIndex(dt=>dt.type==="radio-button"&&dt.label==="Equipo")!==-1){const dt=f.view.filterMultiple.isHomeTeam;let gt;typeof dt=="boolean"?gt=dt?1:2:typeof dt=="number"?gt=dt===1?1:2:gt=1,S.value[0]=gt,f.view.componentProps&&dt!==void 0&&(f.view.componentProps.isHomeTeamForAnalysis=dt===1),r.nextTick(()=>{S.value=[...S.value]})}else{const dt=V.value.findIndex(gt=>gt.type==="radio-button");if(dt!==-1){const gt=f.view.filterMultiple.isHomeTeam;let Et;typeof gt=="boolean"?Et=gt?1:2:typeof gt=="number"?Et=gt===1?1:2:Et=1,S.value[dt]=Et,f.view.componentProps&&gt!==void 0&&(f.view.componentProps.preMatchType=gt),r.nextTick(()=>{S.value=[...S.value]})}}if(((lt=w.value)==null?void 0:lt.id)===15&&(tt=f==null?void 0:f.view)!=null&&tt.filterMultiple&&f.view.filterMultiple.isHomeTeam!==void 0){const dt=V.value.findIndex(gt=>gt.type==="radio-button");if(dt!==-1){const gt=f.view.filterMultiple.isHomeTeam;console.log("Strengths forceRadioFilterUpdate - isHomeTeam:",gt,"type:",typeof gt);let Et;typeof gt=="boolean"?Et=gt?1:2:typeof gt=="number"?Et=gt===1?1:2:Et=1,console.log("Strengths forceRadioFilterUpdate - teamValue calculado:",Et,"teamFilterIndex:",dt),S.value[dt]=Et,f.view.componentProps&&gt!==void 0&&(f.view.componentProps.preMatchType=Et),r.nextTick(()=>{S.value=[...S.value],console.log("Strengths forceRadioFilterUpdate - dynamicFilters.value después:",S.value)})}else{const gt=V.value.findIndex(Et=>Et.type==="radio-button");if(gt!==-1){const Et=f.view.filterMultiple.isHomeTeam;let Lt;typeof Et=="boolean"?Lt=Et?1:2:typeof Et=="number"?Lt=Et===1?1:2:Lt=1,S.value[gt]=Lt,f.view.componentProps&&Et!==void 0&&(f.view.componentProps.preMatchType=Lt),r.nextTick(()=>{S.value=[...S.value]})}}}r.nextTick(()=>{h.value=!1,o.value=!1})}}function ve(){if(!o.value&&t.value&&l&&l.dynamicFilters&&V.value){if(v.value)return;o.value=!0,h.value=!0,l.dynamicFilters.forEach((me,qe)=>{var Re;if(me&&((Re=V.value[qe])==null?void 0:Re.type)==="radio-button"&&me.selectedOption&&me.selectedOption.value!==void 0){const Ke=me.selectedOption.value;S.value[qe]=Ke}}),r.nextTick(()=>{h.value=!1,o.value=!1})}}function Ue(){var me,qe,Re,Ke,rt,nt,pt,_t,St,jt,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut,kt,vt,wt,Vt,at,Qe,xt,Ft,Rt,qt,Ht;if(n&&t.value&&f){if(v.value)return;if(h.value=!0,((me=w.value)==null?void 0:me.id)===4){if(n.setDynamicFilters(S.value,(qe=f.view)==null?void 0:qe.id),n.updateDynamicFilters(S.value,(Re=f.view)==null?void 0:Re.id),f.view.componentProps&&S.value&&S.value.length>0){const At=S.value[0];if(Array.isArray(At)&&At.length>0){const Yt=At.some(sr=>sr.event_type_id===1||typeof sr=="string"&&sr.includes("1")),Bt=At.some(sr=>sr.category_id===8||typeof sr=="string"&&sr.includes("8")),Gt=At.some(sr=>sr.category_id===9||typeof sr=="string"&&sr.includes("9")),or=At.some(sr=>sr.event_type_id===3||typeof sr=="string"&&sr.includes("3"));f.view.componentProps.selectedEvents=At,f.view.componentProps.goals=Yt,f.view.componentProps.yellowCards=Bt,f.view.componentProps.redCards=Gt,f.view.componentProps.substitutions=or,f.view.componentProps.key=At.length>0,f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps})}}}else if(((Ke=w.value)==null?void 0:Ke.id)===8)n.setDynamicFilters(S.value,(rt=f.view)==null?void 0:rt.id),n.updateDynamicFilters(S.value,(nt=f.view)==null?void 0:nt.id);else if(((pt=w.value)==null?void 0:pt.id)===3)n.setDynamicFilters(S.value,(_t=f.view)==null?void 0:_t.id),n.updateDynamicFilters(S.value,(St=f.view)==null?void 0:St.id);else if(((jt=w.value)==null?void 0:jt.id)===13){const At=(It=f.view)==null?void 0:It.id;n.setDynamicFilters(S.value,At),n.updateDynamicFilters(S.value,At),f.view.componentProps&&(f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps}))}else if(((Jt=w.value)==null?void 0:Jt.id)===15){const At=(lt=f.view)==null?void 0:lt.id;if(n.setDynamicFilters(S.value,At),n.updateDynamicFilters(S.value,At),f.view.componentProps){const Yt=Array.isArray(S.value)&&S.value[3]!==void 0?S.value[3]:null;Yt!==null&&(f.view.componentProps.numitems=Yt),f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps})}}else if(((tt=w.value)==null?void 0:tt.id)===2){n.setDynamicFilters(S.value,(dt=f.view)==null?void 0:dt.id),n.updateDynamicFilters(S.value,(gt=f.view)==null?void 0:gt.id);const At=S.value[0];if(At!==void 0&&(f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.categoryId,f.view.filterMultiple.categoryId=At,f.view.componentProps)){let Bt=`Category ${At}`,Gt=null;try{Gt=jh(At),Gt&&(Bt=Gt.name)}catch{const or=V.value.findIndex(sr=>sr.type==="select-simple"&&sr.label==="Tipo de análisis");if(or!==-1){const sr=(((Et=V.value[or])==null?void 0:Et.options)||[]).find(Ur=>Ur.value==At);sr&&(Bt=sr.label)}}f.view.componentProps.categoryView=[{id:At,name:Bt}],qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple})}const Yt=S.value[1];Yt!==void 0&&(f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.teamType,f.view.filterMultiple.teamType=Yt,f.view.componentProps&&f.view.componentProps.game&&(Yt===1?f.view.componentProps.teamView=f.view.componentProps.game.homeTeam.team_id:Yt===2?f.view.componentProps.teamView=f.view.componentProps.game.awayTeam.team_id:f.view.componentProps.teamView=0),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}))}else if(((Lt=w.value)==null?void 0:Lt.id)===1){n.setDynamicFilters(S.value,(it=f.view)==null?void 0:it.id),n.updateDynamicFilters(S.value,(ct=f.view)==null?void 0:ct.id);const At=S.value[0];At!==void 0&&(f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.category,f.view.filterMultiple.category=At,f.view.componentProps&&(f.view.componentProps.type=At),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}))}else if(((Ge=w.value)==null?void 0:Ge.id)===6){n.setDynamicFilters(S.value,(ut=f.view)==null?void 0:ut.id),n.updateDynamicFilters(S.value,(kt=f.view)==null?void 0:kt.id);const At=S.value[0];At!==void 0&&(f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.gameNumber,f.view.filterMultiple.gameNumber=At,f.view.componentProps&&(f.view.componentProps.gameNumber=At,f.view._updateKey,f.view._updateKey=Date.now()),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}),qa.emit("dynamic-filters-changed",{containerViewId:(vt=w.value)==null?void 0:vt.id,viewId:f.view.id,dynamicFilters:S.value}),qa.emit("component-props-updated",{viewId:f.view.id,componentProps:f.view.componentProps,dynamicFilters:S.value}),r.nextTick(()=>{f.view.componentProps&&(f.view.componentProps={...f.view.componentProps})}))}else if(((wt=w.value)==null?void 0:wt.id)===7){n.setDynamicFilters(S.value,(Vt=f.view)==null?void 0:Vt.id),n.updateDynamicFilters(S.value,(at=f.view)==null?void 0:at.id);const At=S.value[0],Yt=S.value[1];if(At!==void 0&&f.view.componentProps){const Bt=At===1?"offensive":"defensive";f.view.componentProps.analysisType=Bt}if(Yt!==void 0){f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.isHomeTeam;const Bt=Yt===1;f.view.filterMultiple.isHomeTeam=Bt,f.view.componentProps&&(f.view.componentProps.isHomeTeamForAnalysis=Bt,f.view._updateKey,f.view._updateKey=Date.now()),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}),qa.emit("dynamic-filters-changed",{containerViewId:(Qe=w.value)==null?void 0:Qe.id,viewId:f.view.id,dynamicFilters:S.value}),qa.emit("component-props-updated",{viewId:f.view.id,componentProps:f.view.componentProps,dynamicFilters:S.value}),r.nextTick(()=>{f.view.componentProps&&(f.view.componentProps={...f.view.componentProps})})}}else if(((xt=w.value)==null?void 0:xt.id)===5){n.setDynamicFilters(S.value,(Ft=f.view)==null?void 0:Ft.id),n.updateDynamicFilters(S.value,(Rt=f.view)==null?void 0:Rt.id);const At=S.value[0];if(At!==void 0){f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.isHomeTeam;const Yt=At===1?1:2;f.view.filterMultiple.isHomeTeam=Yt,f.view.componentProps&&(f.view.componentProps.isHomeTeamForAnalysis=Yt===1,f.view._updateKey,f.view._updateKey=Date.now()),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}),qa.emit("dynamic-filters-changed",{containerViewId:(qt=w.value)==null?void 0:qt.id,viewId:f.view.id,dynamicFilters:S.value}),qa.emit("component-props-updated",{viewId:f.view.id,componentProps:f.view.componentProps,dynamicFilters:S.value}),r.nextTick(()=>{f.view.componentProps&&(f.view.componentProps={...f.view.componentProps})})}}else((Ht=w.value)==null?void 0:Ht.id)===9||(n.setDynamicFilters(S.value),n.updateDynamicFilters(S.value));r.nextTick(()=>{h.value=!1})}}function ke(){var me,qe;if(!l||!l.dynamicFilters||!V.value)return!1;for(let Re=0;Re<l.dynamicFilters.length;Re++){const Ke=l.dynamicFilters[Re],rt=V.value[Re],nt=S.value[Re];if(!(!Ke||!rt)){if(rt.type==="check"){if(Ke.isChecked!==nt)return!0}else if(rt.type==="radio-button"){if(((me=Ke.selectedOption)==null?void 0:me.value)!==nt)return!0}else if(rt.type==="select"){const pt=((qe=Ke.selectedOptions)==null?void 0:qe.map(St=>St.value))||Ke.selectedValue||[],_t=Array.isArray(nt)?nt:[];if(JSON.stringify(pt)!==JSON.stringify(_t))return!0}}}return!1}function Je(me){var qe,Re,Ke,rt,nt,pt,_t,St,jt,It,Jt,lt,tt,dt,gt,Et;if(S.value=me.filters,n){const Lt=((qe=f==null?void 0:f.view)==null?void 0:qe.id)||null;n.setDynamicFilters(S.value,Lt),n.updateDynamicFilters(S.value,Lt)}if(t.value&&f&&(qa.emit("activate-save-button"),qa.emit("force-component-update",{itemId:((Re=f==null?void 0:f.view)==null?void 0:Re.id)||null,componentProps:f.view.componentProps}),qa.emit("dynamic-filters-changed",{containerViewId:((Ke=f==null?void 0:f.view)==null?void 0:Ke.id)||null,viewId:((rt=f==null?void 0:f.view)==null?void 0:rt.id)||null,dynamicFilters:S.value}),qa.emit("dynamic-filters-changed",{containerViewId:((nt=f==null?void 0:f.view)==null?void 0:nt.id)||null,viewId:((pt=f==null?void 0:f.view)==null?void 0:pt.id)||null,dynamicFilters:S.value}),r.nextTick(()=>{f.view.componentProps&&(f.view.componentProps={...f.view.componentProps})})),!t.value&&n&&((_t=w.value)==null?void 0:_t.id)===15&&n.getRequiresAddView(S.value)){n.setDynamicFilters(S.value),j("filters-changed",{main:c.value,view:w.value,team:E.value,dynamicFilters:S.value,filtersJSON:{mainSelector:{id:((St=c.value)==null?void 0:St.id)||null,name:((jt=c.value)==null?void 0:jt.name)||null,url:((It=c.value)==null?void 0:It.url)||null},viewSelector:{id:((Jt=w.value)==null?void 0:Jt.id)||null,name:((lt=w.value)==null?void 0:lt.name)||((tt=w.value)==null?void 0:tt.title)||null,url:((dt=w.value)==null?void 0:dt.url)||null},team:E.value,dynamicFilters:S.value,timestamp:new Date().toISOString(),summary:{mainSelected:!!c.value,viewSelected:!!w.value,totalDynamicFilters:((gt=V.value)==null?void 0:gt.length)||0,activeFilters:((Et=V.value)==null?void 0:Et.filter((Lt,it)=>{const ct=S.value[it];return Array.isArray(ct)?ct.length>0:ct!=null&&ct!==!1}).length)||0}},filterAndViewsContainer:n,viewToEdit:f}),ae();return}Ue()}function Fe(me){me.filterIndex!==void 0&&me.value!==void 0&&(S.value[me.filterIndex]=me.value,t.value&&Ue(),ae())}function Ie(){Oe()}function Ze(me){var qe,Re,Ke,rt,nt,pt,_t;const St={mainSelector:{id:((qe=c.value)==null?void 0:qe.id)||null,name:((Re=c.value)==null?void 0:Re.name)||null,url:((Ke=c.value)==null?void 0:Ke.url)||null},viewSelector:{id:((rt=w.value)==null?void 0:rt.id)||null,name:((nt=w.value)==null?void 0:nt.name)||((pt=w.value)==null?void 0:pt.title)||null,url:((_t=w.value)==null?void 0:_t.url)||null}};j("filters-changed",{filters:me.filters,view:me.view,viewToEdit:f,filterAndViewsContainer:n,filtersJSON:St,isAltMode:!0})}function et(me){return JSON.parse(JSON.stringify(me))}return(me,qe)=>(r.openBlock(),r.createElementBlock("div",t4e,[r.createElementVNode("button",r4e,r.toDisplayString(t.value?"Editando visualización":"Nueva visualización"),1),r.createElementVNode("div",{class:r.normalizeClass(["custom-select main-select",{disabled:t.value}]),onClick:B},[r.createElementVNode("div",n4e,[r.createElementVNode("span",a4e,[c.value?(r.openBlock(),r.createElementBlock("img",{key:0,src:D(c.value.name,!1),alt:"icono",class:"option-img"},null,8,i4e)):(r.openBlock(),r.createElementBlock("img",o4e))]),c.value?(r.openBlock(),r.createElementBlock("span",l4e,r.toDisplayString(H()),1)):(r.openBlock(),r.createElementBlock("span",s4e,"Tipo de vista")),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:R.value}])},[...qe[5]||(qe[5]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),R.value?(r.openBlock(),r.createElementBlock("div",c4e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,(Re,Ke)=>(r.openBlock(),r.createElementBlock("div",{key:Re.id,class:r.normalizeClass(["option-card",{active:p.value===Ke}]),onClick:r.withModifiers(rt=>ee(Ke),["stop"])},[r.createElementVNode("div",d4e,[r.createElementVNode("img",{src:D(Re.name,!1),"data-hover-src":D(Re.name,!0),alt:"icono",class:"option-img-34"},null,8,p4e)]),r.createElementVNode("div",h4e,[r.createElementVNode("div",f4e,r.toDisplayString(Re.name),1),Re.description?(r.openBlock(),r.createElementBlock("div",m4e,r.toDisplayString(Re.description),1)):r.createCommentVNode("",!0)])],10,u4e))),128))])):r.createCommentVNode("",!0)],2),c.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["custom-select second-select",{disabled:t.value}]),onClick:re},[r.createElementVNode("div",y4e,[r.createElementVNode("span",g4e,[w.value?(r.openBlock(),r.createElementBlock("img",{key:0,src:w.value.url,alt:"icono",class:"option-img-graph2"},null,8,v4e)):c.value?(r.openBlock(),r.createElementBlock("img",{key:1,src:D(c.value.name,!1),alt:"icono",class:"option-img"},null,8,b4e)):r.createCommentVNode("",!0)]),r.createElementVNode("span",x4e,r.toDisplayString(ne()),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:W.value}])},[...qe[6]||(qe[6]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),W.value&&c.value?(r.openBlock(),r.createElementBlock("div",w4e,[r.createElementVNode("div",_4e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.value,Re=>(r.openBlock(),r.createElementBlock("div",{key:Re.id,class:r.normalizeClass(["option-card-grid",{active:x.value===Re.id}]),onClick:r.withModifiers(Ke=>Y(Re),["stop"])},[r.createElementVNode("div",T4e,r.toDisplayString(Re.name||Re.title),1),r.createElementVNode("div",k4e,[r.createElementVNode("img",{src:Re.url,alt:"icono",class:"option-img-grid"},null,8,N4e)])],10,S4e))),128))])])):r.createCommentVNode("",!0)],2)):r.createCommentVNode("",!0),w.value?(r.openBlock(),r.createElementBlock("div",V4e)):r.createCommentVNode("",!0),w.value&&w.value.id===13?(r.openBlock(),r.createBlock(TSe,{key:2,filters:V.value,"initial-values":t.value?r.unref(l).dynamicFilters:S.value,"is-edit-mode":t.value,"component-id":13,onFiltersChanged:Je,onFilterUpdated:Fe},null,8,["filters","initial-values","is-edit-mode"])):w.value&&w.value.id===16?(r.openBlock(),r.createBlock(FTe,{key:3,"view-config":et(g.value.get(16)),"default-filters":r.unref(f)?r.unref(f).view.filterMultiple:null,"is-edit-mode":!!r.unref(f),"is-post-match":e.isPostMatch,onChange:Ze,onRemoveViews:Ie},null,8,["view-config","default-filters","is-edit-mode","is-post-match"])):w.value&&w.value.id===15?(r.openBlock(),r.createBlock(ASe,{key:4,filters:V.value,"initial-values":t.value?r.unref(l).dynamicFilters:S.value,"is-edit-mode":t.value,"component-id":15,onFiltersChanged:Je,onFilterUpdated:Fe},null,8,["filters","initial-values","is-edit-mode"])):w.value&&w.value.id===17?(r.openBlock(),r.createBlock(e4e,{key:5,filters:V.value,"initial-values":t.value?r.unref(l).dynamicFilters:S.value,"is-edit-mode":t.value,"component-id":17,"view-config":et(g.value.get(17)),"default-filters":r.unref(f)?r.unref(f).view.filterMultiple:null,onFiltersChanged:Je,onFilterUpdated:Fe,onChange:Ze,onRemoveViews:Ie},null,8,["filters","initial-values","is-edit-mode","view-config","default-filters"])):w.value&&V.value&&C()?(r.openBlock(),r.createElementBlock("div",{key:6,class:r.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":V.value.length>=2}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(V.value,(Re,Ke)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:Ke},[Re.type==="select"?(r.openBlock(),r.createElementBlock("div",{key:0,class:"custom-select dynamic-select filter-inline",onClick:r.withModifiers(rt=>$(Ke),["stop"])},[r.createElementVNode("div",L4e,[qe[8]||(qe[8]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),qe[9]||(qe[9]=r.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),Array.isArray(S.value[Ke])&&S.value[Ke].length>0?(r.openBlock(),r.createElementBlock("span",U4e,r.toDisplayString(S.value[Ke].length),1)):r.createCommentVNode("",!0),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:K.value===Ke}])},[...qe[7]||(qe[7]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),K.value===Ke?(r.openBlock(),r.createElementBlock("div",q4e,[r.createElementVNode("div",z4e,[r.createElementVNode("div",{class:"multi-select-header",onClick:qe[1]||(qe[1]=r.withModifiers(()=>{},["stop"]))},[r.createElementVNode("label",C4e,[r.createElementVNode("input",{type:"checkbox",checked:z(Ke),indeterminate:L(Ke),onChange:r.withModifiers(rt=>T(Ke),["stop"]),onClick:qe[0]||(qe[0]=r.withModifiers(()=>{},["stop"]))},null,40,P4e),qe[10]||(qe[10]=r.createElementVNode("span",{class:"select-all-label"},"Agregar todas",-1))])]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Re.options,rt=>(r.openBlock(),r.createElementBlock("div",{key:rt.value,class:r.normalizeClass(["option-card multi-select-option",{active:O(Ke,rt.value)}]),onClick:qe[2]||(qe[2]=r.withModifiers(()=>{},["stop"]))},[r.createElementVNode("div",E4e,[r.createElementVNode("input",{type:"checkbox",checked:O(Ke,rt.value),onChange:r.withModifiers(nt=>U(Ke,rt.value),["stop"])},null,40,F4e)]),r.createElementVNode("div",{class:"option-content",onClick:nt=>U(Ke,rt.value)},[r.createElementVNode("div",M4e,r.toDisplayString(rt.label),1)],8,R4e)],2))),128))]),r.createElementVNode("div",j4e,[r.createElementVNode("button",{class:"btn-listo",onClick:qe[3]||(qe[3]=r.withModifiers(rt=>_e(),["stop"]))},"Listo")])])):r.createCommentVNode("",!0)],8,O4e)):Re.type==="radio-button"?(r.openBlock(),r.createElementBlock("div",W4e,[r.createElementVNode("div",K4e,r.toDisplayString(Re.label),1),r.createElementVNode("div",A4e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Re.options,rt=>(r.openBlock(),r.createElementBlock("label",{key:rt.value,class:r.normalizeClass(["radio-option-card",{active:S.value[Ke]===rt.value}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"dynamic-radio-"+Ke,value:rt.value,"onUpdate:modelValue":nt=>S.value[Ke]=nt,disabled:P(rt.value,rt.label),onChange:()=>{var nt,pt,_t;if(((nt=w.value.value)==null?void 0:nt.id)===9&&t.value.value&&(_t=(pt=r.unref(f))==null?void 0:pt.view)!=null&&_t.filterMultiple){const St=S.value[Ke]===1;r.unref(f).view.filterMultiple.isHomeTeam=St}t.value.value&&Ue(),ae()}},null,40,I4e),[[r.vModelRadio,S.value[Ke]]]),r.createElementVNode("span",null,r.toDisplayString(rt.label),1)],2))),128))])])):Re.type==="check"?(r.openBlock(),r.createElementBlock("div",X4e,[r.createElementVNode("label",null,[r.withDirectives(r.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":rt=>S.value[Ke]=rt,checked:S.value[Ke],onChange:qe[4]||(qe[4]=()=>{t.value.value&&Ue(),ae()})},null,40,D4e),[[r.vModelCheckbox,S.value[Ke]]]),r.createTextVNode(" "+r.toDisplayString(Re.label),1)])])):Re.type==="select-simple"?(r.openBlock(),r.createElementBlock("div",{key:3,class:"custom-select dynamic-select filter-inline","data-filter-type":Re.type,onClick:r.withModifiers(rt=>le(Ke),["stop"])},[r.createElementVNode("div",B4e,[qe[12]||(qe[12]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),qe[13]||(qe[13]=r.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:X.value===Ke}])},[...qe[11]||(qe[11]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),X.value===Ke?(r.openBlock(),r.createElementBlock("div",G4e,[r.createElementVNode("div",Z4e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Re.options,rt=>(r.openBlock(),r.createElementBlock("div",{key:rt.value,class:r.normalizeClass(["option-card simple-select-option",{active:S.value[Ke]===rt.value}]),onMouseenter:nt=>Ce(Ke,rt.value),onClick:r.withModifiers(nt=>ie(Ke,rt.value),["stop"])},[r.createElementVNode("div",Y4e,[r.createElementVNode("div",Q4e,r.toDisplayString(rt.label),1)]),S.value[Ke]===rt.value?(r.openBlock(),r.createElementBlock("div",$4e,[...qe[14]||(qe[14]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):r.createCommentVNode("",!0)],42,H4e))),128))])])):r.createCommentVNode("",!0)],8,J4e)):r.createCommentVNode("",!0),Ke===1&&V.value.length>2?(r.openBlock(),r.createElementBlock("div",eke)):r.createCommentVNode("",!0)],64))),128))],2)):r.createCommentVNode("",!0),t.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("button",{key:7,class:"cancel-btn",onClick:Oe},"Cancelar")),_.value?(r.openBlock(),r.createElementBlock("button",{key:8,class:"ok-btn",onClick:Te},"OK")):r.createCommentVNode("",!0)]))}}),rke=Bc(tke,[["__scopeId","data-v-8d571c54"]]),nke={key:0,class:"modal-simple"},ake={class:"modal-simple__content"},ike={class:"modal-simple__content__header"},oke={class:"modal-simple__content__body"},ske={class:"modal-simple__content__footer"},lke={__name:"ModalSimple",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(a,i)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[e.modelValue?(r.openBlock(),r.createElementBlock("div",nke,[r.createElementVNode("div",ake,[r.createElementVNode("div",ike,[r.renderSlot(a.$slots,"header",{},void 0,!0)]),r.createElementVNode("div",oke,[r.renderSlot(a.$slots,"body",{},void 0,!0)]),r.createElementVNode("div",ske,[r.renderSlot(a.$slots,"footer",{},void 0,!0)])])])):r.createCommentVNode("",!0)]))}},cke=Bc(lke,[["__scopeId","data-v-1cc4f590"]]),uke={class:"footer"},dke={__name:"ModalCautionClose",props:{value:{type:Boolean,default:!1}},emits:["update:modelValue","action"],setup(e,{emit:a}){const i=a;function k(g){i("update:modelValue",g)}function j(g){i("action",g),i("update:modelValue",!1)}return(g,m)=>(r.openBlock(),r.createBlock(cke,{"modle-value":e.value,"onUpdate:modelValue":k},{header:r.withCtx(()=>[...m[2]||(m[2]=[r.createElementVNode("div",{class:"header"},"Descartar template",-1)])]),body:r.withCtx(()=>[...m[3]||(m[3]=[r.createElementVNode("div",{class:"body"},"¿Estás seguro que deseas abandonar el proceso?",-1)])]),footer:r.withCtx(()=>[r.createElementVNode("div",uke,[r.createElementVNode("div",{role:"button",class:"btn btn-cancel",onClick:m[0]||(m[0]=n=>j(!1))}," Seguir editando "),r.createElementVNode("div",{role:"button",class:"btn btn-confirm",onClick:m[1]||(m[1]=n=>j(!0))}," Descartar ")])]),_:1},8,["modle-value"]))}},pke=Bc(dke,[["__scopeId","data-v-ed9b5088"]]),hke={key:0,class:"modal-simple"},fke={__name:"ModalChangesSaved",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(a,i)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,null,{default:r.withCtx(()=>[e.modelValue?(r.openBlock(),r.createElementBlock("div",hke,[...i[0]||(i[0]=[r.createElementVNode("div",{class:"modal-simple__content"},[r.createElementVNode("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.createElementVNode("path",{d:"M29.3333 5.33203L16 18.6787L12 14.6787",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"})]),r.createElementVNode("div",{class:"modal-simple__content__text"}," Los cambios se han guardado correctamente ")],-1)])])):r.createCommentVNode("",!0)]),_:1})]))}},mke=Bc(fke,[["__scopeId","data-v-2bc30783"]]),yke={class:"template-maker__header"},gke={key:0,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},vke={class:"template-maker__content"},bke={class:"template-maker__content__main"},xke={id:"containerMain",class:"container-main"},wke={class:"template-maker__content__main__cover-selector"},_ke=["id"],Ske={class:"page-indicator"},Tke={class:"page-indicator__index"},kke=["onClick"],Nke=["onClick"],Vke={key:0,class:"template-maker__content__main__footer"},Oke={class:"template-maker__content__main__footer__paginator"},Lke={class:"template-maker__content__main__footer__paginator__nav"},Uke={class:"template-maker__content__main__footer__paginator__numbers"},qke=["onClick"],zke={__name:"GSC-TemplateReportMaker",props:{token:{type:String,default:""},userTeamId:{type:Number,default:0}},emits:["close"],setup(e,{expose:a,emit:i}){const k=new Map,j=r.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:{}}]}]),g=r.ref(null),m=r.ref(0),n=r.ref(!1),f=r.ref(null),l=r.ref(null),t=r.ref(!0),_=r.ref(!1),b=r.ref(!1),v=r.ref(0),h=r.ref(!1),o=r.ref(null),s=r.ref(new Map),p=r.ref(null),c=r.ref(null),d=r.ref(!1),x=r.ref(!1),w=r.ref(!1),S=new Map,V=r.computed(()=>({"--overflow-y-template-maker":_.value?"scroll":"hidden","--height-container-main":_.value?"fit-content":"calc(100vh - 64px)","--margin-bottom-container-main":(_.value,"0")})),O=r.computed(()=>m.value+1);r.watch(()=>n.value,_e=>{const Ce=document.getElementById("app");_e?(m.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 U(_e){return _e<10?`0${_e}`:_e}async function z({templateId:_e,userId:Ce}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Ce}/templates/${_e}`,{method:"GET",headers:{Authorization:$.token}})).json()).data}catch(Pe){console.error("Error fetching template by ID:",Pe)}}async function L({reportId:_e,userId:Ce}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Ce}/reports/${_e}`,{method:"GET",headers:{Authorization:$.token}})).json()).data}catch(Pe){console.error("Error fetching report by ID:",Pe)}}let C=0;function q(_e){g.value=_e,C>0&&(d.value=!0),C++}function N(_e){_e&&ue(null,!0)}let P=null;function T(_e,Ce){let Pe=_e.getBoundingClientRect(),Be={height:_e.clientHeight,width:_e.clientWidth},ze=Ce.getBoundingClientRect();if(!(ze.top>=Pe.top&&ze.bottom<=Pe.top+Be.height)){const je=ze.top-Pe.top,Ee=ze.bottom-Pe.bottom;Math.abs(je)<Math.abs(Ee)?_e.scrollTop+=je:_e.scrollTop+=Ee}}function E(_e,Ce){let Pe=_e.getBoundingClientRect();const Be=Ce.getBoundingClientRect().top-Pe.top;_e.scrollTop+=Be}function R(_e,Ce=!1){const Pe={title:`Page ${j.value.length+1}`,id:`p-${Date.now()}`,items:[]};if(xe(),_e!==void 0&&_e>=-1?j.value.splice(_e+1,0,Pe):j.value.push(Pe),r.nextTick(()=>{const Be=j.value.findIndex(je=>je.id===Pe.id),ze=document.getElementById(`page-${Be+1}`);P||(P=document.getElementById("containerMain")),ze&&P?T(P,ze):console.error("Page element or container main element not found")}),Ce)return Pe;d.value=!0}function W(_e){if(_e<0||_e>j.value.length)return;m.value=_e;const Ce=document.getElementById(`page-${_e}`);if(P||(P=document.getElementById("containerMain")),Ce&&P){const Pe=new CustomEvent("programmatic-scroll-start");document.dispatchEvent(Pe),E(P,Ce),setTimeout(()=>{const Be=new CustomEvent("programmatic-scroll-end");document.dispatchEvent(Be)},300)}else console.error("Page element or container main element not found")}function K(_e){p.value=_e,h.value=!0}function X(_e,Ce){const Pe=Ce+1;_e&&m.value!==Pe&&(m.value=Pe)}function D(_e){h.value=!0,qa.emit("edit-view",{view:_e})}async function H({templateReportId:_e,userId:Ce,isTemplateMode:Pe}){try{return Pe?z({templateId:_e,userId:Ce}):L({reportId:_e,userId:Ce})}catch(Be){throw new Error("Error fetching template or report by ID: "+Be.message)}}function ne(){C=0,h.value=!1,m.value=0,p.value=null,c.value=null,s.value.clear(),P=null}async function B(_e){if(ne(),t.value=_e.isTemplateMode,_.value=!!_e.isPDFMode,_e.isPDFMode?f.value=await L({reportId:_e.reportId,userId:_e.userId}):(f.value=_e.template,f.value=await H({templateReportId:_e.template.id,userId:_e.template.user_id,isTemplateMode:_e.isTemplateMode})),!f.value)return;f.value&&f.value.game&&(f.value.game=ie(f.value.game)),l.value=JSON.parse(JSON.stringify(f.value)),b.value=f.value.template_type===2;const Ce=f.value.pages.find(Pe=>Pe.is_front_page);v.value=Ce?Ce.type:1,n.value=!0,j.value=f.value.pages.reduce((Pe,Be,ze)=>{if(!Be.is_front_page){Be.name||(Be.name="");const je=ze,Ee={originalPage:JSON.parse(JSON.stringify(Be)),title:Be.name,id:`p-${Date.now()-ze*9}`,items:[],components:Be.components};Be.components&&Be.components.length>0&&(Ee.items=Be.components.map((ve,Ue)=>{const ke=new H0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],ve.coreView.id,ve.dynamicFilters,b.value,t.value,ve.filtersJSON||null,$.token,ve.filters),Je={originalComponent:JSON.parse(JSON.stringify(ve)),title:ve.title,shortTitle:ve.shortTitle||ve.title,game:f.value.game,idAux:ve.id,id:`w-${Date.now()-Ue*7}`,x:ve.column,y:ve.row,w:ve.colspan,h:ve.rowspan,maxWidth:ve.max_column,maxHeight:ve.max_row,minWidth:ve.min_column,minHeight:ve.min_row,noResize:!t.value,noMove:!t.value,coreView:ve.coreView||null,isTemplateMode:t.value,componentName:ve.componentName,componentProps:Y({currentProps:ve.componentProps,coreView:ve.coreView,isTemplateMode:t.value,templateToEdit:f.value,filterMultiple:ve.filterMultiple||null,game:f.value.game||null,dynamicFilters:ve.dynamicFilters,page:je,componentId:Ue})||{},filterMultiple:ve.filterMultiple,isHomeTeam:ee({game:f.value.game,isTemplateMode:t.value,currentIsHomeTeam:ve.isHomeTeam||ve.componentProps.isHomeTeamForAnalysis}),filtersJSON:ve.filtersJSON||null,dynamicFilters:ve.dynamicFilters||[],filterAndViewsContainer:ke},Fe=r.reactive({view:Je});return ke.addView(Fe,!0),s.value.set(ke.getId(),ke),Je})),Pe.push(Ee)}return Pe},[])}function re({game:_e,isTemplateMode:Ce}){const Pe=_e&&_e.homeTeam&&_e.awayTeam&&(_e.homeTeam.team_id===$.userTeamId||_e.awayTeam.team_id===$.userTeamId);return{isUserTeamHome:Pe&&_e.homeTeam.team_id===$.userTeamId,requiresUserTeamAdjustment:Pe&&!Ce}}function ee({game:_e,isTemplateMode:Ce,currentIsHomeTeam:Pe}){const{isUserTeamHome:Be,requiresUserTeamAdjustment:ze}=re({game:_e,isTemplateMode:Ce});return ze?Pe?Be:!Be:Pe}function Y({currentProps:_e,coreView:Ce,templateToEdit:Pe,isTemplateMode:Be,filterMultiple:ze,game:je,dynamicFilters:Ee,page:ve,componentId:Ue}){if(!_e||!Ce)return _e||{};const{isUserTeamHome:ke,requiresUserTeamAdjustment:Je}=re({game:je,isTemplateMode:Be}),Fe={..._e};if(Ce.id===5&&(Fe.isGhostEffect=Be,Je)){const Ie=Fe.preMatchType===1;Fe.preMatchType=Ie?ke?1:2:ke?2:1}if(Ce.id===7&&Je){const Ie=Fe.isHomeTeamForAnalysis;Fe.isHomeTeamForAnalysis=Ie?ke:!ke}if(Ce.id===9&&Je){const Ie=Fe.isHomeTeamForAnalysis;Fe.isHomeTeamForAnalysis=Ie?ke:!ke}if(Ce.id===16){if(!Be&&Je){const Ie=Fe.isHomeTeamForAnalysis;Fe.isHomeTeamForAnalysis=Ie?ke:!ke}if(!Be){Fe.isPreMatch=!b.value,Fe.isTemplateMode=Be,Fe.seasonId=Pe.season_id,Fe.teamIdForAnalysis=Fe.isHomeTeamForAnalysis?Pe.game.home_team:Pe.game.visiting_team;const Ie=Fe.isHomeTeamForAnalysis?Pe.last_games.last_home_games:Pe.last_games.last_visiting_games;b.value?Fe.gamesIdsForAnalysis=[Pe.game.game_id]:Fe.howManyGames?Fe.gamesIdsForAnalysis=Ie.slice(0,Fe.howManyGames).map(Ze=>Ze.game_id):(Fe.gamesIdsForAnalysis=[],Fe.gameDataUTC=Pe.game.date_time_utc)}if(!Be){Fe.isTemplateMode=Be,Fe.seasonId=Pe.season_id,Fe.teamIdForAnalysis=Fe.isHomeTeamForAnalysis?Pe.game.home_team:Pe.game.visiting_team;const Ie=Fe.isHomeTeamForAnalysis?Pe.last_games.last_home_games:Pe.last_games.last_visiting_games;b.value?Fe.gamesIdsForAnalysis=[Pe.game.game_id]:Fe.howManyGames?Fe.gamesIdsForAnalysis=Ie.slice(0,Fe.howManyGames).map(Ze=>Ze.game_id):(Fe.gamesIdsForAnalysis=[],Fe.gameDataUTC=Pe.game.date_time_utc)}}if(Ce.id===10&&Je){const Ie=Fe.isHomeTeamForAnalysis;Fe.isHomeTeamForAnalysis=Ie?ke:!ke}if(Ce.id===1&&(Fe.gameId=je?je.id:"",Fe.homeLogo=je?je.homeTeam.logo:"",Fe.awayLogo=je?je.awayTeam.logo:"",Fe.seasonId=je?je.season_id:0,Fe.default=Be),Ce.id===6&&(Fe.game=je||"",Fe.lastGames=Pe.last_games,Fe.selectedOption=Pe.template_type===2?"Postmatch":"Prematch"),Ce.id===13&&(Fe.isdefault=Be,Fe.seasonid=je?je.seasonId:2010,Fe.datetimeutc=je?Pe.template_type===1?je?je.date_time_utc:"":null:"",Fe.teamids=je?[je.home_team,je.visiting_team]:[1,2],Fe.categoryids=Ee?Ee[1]:[20,2],Fe.teamsshow=je?Ee?Ee[2]==1?[je.home_team]:Ee[2]==2?[je.visiting_team]:[je.home_team,je.visiting_team]:[1,2]:[1,2],Fe.analysistype=Ee?Ee[0]:[],Fe.gameid=Pe.template_type===1?null:je?je.id:"",Fe.teams=je?[{id:je.home_team,name:je.home_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+je.home_team+".png"},{id:je.visiting_team,name:je.visiting_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+je.visiting_team+".png"}]:[]),Ce.id===15&&(Fe.view=1,Fe.token=$.token,Fe.numitems=Ee?Ee[1]:3,Fe.isdefault=Be,Fe.reportid=Pe!=null&&Pe.id?Pe.id:0,Fe.userid=Pe!=null&&Pe.user_id?Pe.user_id:0,Fe.page=ve+1,Fe.typegame=b.value?2:1,Fe.componentid=Ue+1,Fe.data={season:je?je.seasonId:2010,type:2,game:je?je.id:0,team:je?je.home_team:2}),Ce.id===14&&(Fe.isReports=!0,Fe.isDefault=Be,Fe.type=Pe.tournament_type==1?1:0,Fe.typeView=1,Fe.tournament=Pe.tournament_id,Fe.currentSeason=je?je.season_id:0,Fe.currentSeasonId=je?je.season_id:0,Fe.showVideos=!1,Fe.localTeam=je?je.home_team:0,Fe.awayTeam=je?je.visiting_team:0),Ce.id===3&&(Fe.defaultShields=Be),Ce.id===2){let Ie=!0,Ze=0,et=0;je&&(Ie=Pe.main_team==je.home_team||Pe.main_team==je.visiting_team,Ze=Ie?Pe.main_team==(je==null?void 0:je.home_team)?je==null?void 0:je.home_team:je==null?void 0:je.visiting_team:je==null?void 0:je.home_team,et=Ie?Pe.main_team==(je==null?void 0:je.home_team)?je==null?void 0:je.visiting_team:je==null?void 0:je.home_team:je==null?void 0:je.visiting_team),Fe.gamed=je?je.id:"",Fe.game=je||"",Fe.season=je?je.season_id:0,Fe.teamView=ze.teamType==3?0:ze.teamType==1?Ze:et,Fe.useDummyData=Be}return Ce.id===8&&(Fe.teamSelected=je?{teamId:je.home_team}:1,Fe.isDefault=Be),Ce.id===4&&(Fe.gameId=je?je.id:"",Fe.isDefault=Be,Fe.homeTeam=je?je==null?void 0:je.home_team:"",Fe.awayTeam=je?je==null?void 0:je.visiting_team:""),je&&(Fe.game=je),Fe}const $=e,le=i;r.watch(()=>$.token,(_e,Ce)=>{},{immediate:!0}),a({show:B}),qa.on("add-page-view",_e=>{k.set(_e.view.id,_e.view);const Ce=j.value.find(Pe=>Pe.id===_e.pageId);Ce&&(Ce.items||(Ce.items=[]),Ce.items.push(_e.view),r.nextTick(()=>{const Pe=document.querySelector(`[gs-id="${_e.view.id}"]`);_e.grid.makeWidget(Pe)}))}),qa.on("add-page-and-view",_e=>{const Ce=j.value.findIndex(Pe=>Pe.id===_e.pageId);if(Ce>-1){const Pe=R(Ce,!0);setTimeout(()=>{qa.emit("add-view",{pageId:Pe.id,view:_e.view,filterAndWidgetContainer:_e.filterAndWidgetContainer}),c.value&&(Pe.stepBackPage=c.value),c.value=Pe},500)}else console.error("Page not found for adding view:",_e.pageId)}),qa.on("empty-page",_e=>{h.value&&p.value&&p.value.id===_e.id||(be(_e),c.value&&c.value.id===_e.id&&(c.value.stepBackPage?c.value=c.value.stepBackPage:c.value=null))}),qa.on("filters-cancelled",_e=>{_e&&_e.removeAllChildViews()}),qa.on("activate-save-button",()=>{d.value=!0});function ie(_e){return{..._e,gameId:_e.game_id,id:_e.game_id,seasonId:_e.season_id,status:_e.game_status,homeTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${_e.home_team}.png`,team_id:_e.home_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${_e.home_team}.png`,colloquial_name:_e.home_team_name,acronym:_e.home_team_acronym,team_name:_e.home_team_name},awayTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${_e.visiting_team}.png`,team_id:_e.visiting_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${_e.visiting_team}.png`,colloquial_name:_e.visiting_team_name,acronym:_e.visiting_team_acronym,team_name:_e.visiting_team_name}}}function ue(_e,Ce=!1){Ce||!t.value?(n.value=!1,ne(),le("close")):d.value?x.value=!0:(n.value=!1,ne(),le("close"))}function he(){o.value=null,h.value=!1}function ae({page:_e,view:Ce,applyMinimumSize:Pe=!1}){const Be=_e.grid;if(!_e||!Ce||!Be)return null;const ze=Pe?{w:Ce.min_column,h:Ce.min_row}:{w:Ce.colspan,h:Ce.rowspan},je=Be.willItFit(0,0,ze.w,ze.h,!0);return je?{willFit:je,applyMinimumSize:Pe}:Pe?null:ae({page:_e,view:Ce,applyMinimumSize:!0})}const de=new Set([9]);function ce(_e){var Ce,Pe,Be,ze,je,Ee,ve,Ue,ke,Je,Fe,Ie,Ze,et;if(_e.dynamicFilters&&_e.dynamicFilters.length>0&&_e.viewToEdit&&_e.viewToEdit.view){const me=_e.viewToEdit.view.id;j.value.forEach(qe=>{qe.items.forEach(Re=>{Re.id===me&&Re.coreView&&Re.coreView.id===3&&(Re.componentProps.desplegable=_e.dynamicFilters[0]||!1,Re.componentProps.key=_e.dynamicFilters[0]||!1,r.nextTick(()=>{qa.emit("force-component-update",{itemId:Re.id,componentProps:Re.componentProps})}))})})}if(_e.viewToEdit){if(!_e.viewToEdit.view.filterAndViewsContainer){const me=new H0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[_e.viewToEdit],((Ce=_e.viewToEdit.view.coreView)==null?void 0:Ce.id)||_e.viewToEdit.view.id,_e.dynamicFilters||[],b.value,t.value,_e.filtersJSON,$.token,_e.filters);_e.viewToEdit.view.filterAndViewsContainer=me}_e.viewToEdit.view.filterAndViewsContainer.updateView({view:_e.viewToEdit,dynamicFilters:_e.dynamicFilters||[],filtersJSON:_e.filtersJSON||null,filters:_e.filters}),d.value=!0}else if(_e.view){_e.view.id&&_e.filterAndViewsContainer&&_e.view.id!==_e.filterAndViewsContainer.viewId&&(_e.filterAndViewsContainer.removeAllChildViews(),_e.filterAndViewsContainer.setViewId(_e.view.id),_e.filterAndViewsContainer.setFiltersJSON(_e.filtersJSON||null)),_e.view.id&&de.has(_e.view.id)&&_e.dynamicFilters[0]&&_e.dynamicFilters[0].length===0&&_e.filterAndViewsContainer&&(_e.filterAndViewsContainer.updateDynamicFilters(_e.dynamicFilters,(Be=(Pe=_e.viewToEdit)==null?void 0:Pe.view)==null?void 0:Be.id),d.value=!0);const me=c.value||p.value,qe=ae({page:me,view:_e.view,applyMinimumSize:!1});_e.view.filtersJSON=_e.filtersJSON||null;const Re=_e.filterAndViewsContainer,Ke=j.value.findIndex(rt=>rt.id===me.id);if(Re){const rt=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters,_e.filters);if(((ze=_e.view)==null?void 0:ze.id)===15){const nt=(je=_e.filterAndViewsContainer)==null?void 0:je.getId();if(nt&&S.has(nt)){const pt=S.get(nt);clearTimeout(pt),S.delete(nt)}}if(rt){if(Re.setFilters(_e.filters),Re.setDynamicFilters(_e.dynamicFilters),qe||Ke===j.value.length-1){qa.emit("add-view",{pageId:me.id,view:_e.view,filterAndWidgetContainer:Re,avoidWillFit:!1,applyMinimumSize:qe?qe.applyMinimumSize:!1,dynamicFilters:_e.dynamicFilters,filters:_e.filters}),_e.filterAndViewsContainer.updateDynamicFilters(_e.dynamicFilters,(ve=(Ee=_e.viewToEdit)==null?void 0:Ee.view)==null?void 0:ve.id),d.value=!0;let nt=null;if(((Ue=_e.view)==null?void 0:Ue.id)===15?(r.nextTick(()=>{var pt;const _t=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters,_e.filters),St=(pt=_e.dynamicFilters)==null?void 0:pt[0];if(console.log("onFiltersChanged nextTick - stillRequiresAddView:",_t,"childViews.length:",_e.filterAndViewsContainer.childViews.length,"currentFilterValue:",St),St!==3){console.log("onFiltersChanged nextTick - El filtro cambió, cancelando. Valor actual:",St);return}_t&&(console.log("onFiltersChanged nextTick - llamando recursivamente para crear siguiente componente"),ce(_e))}),nt=setTimeout(()=>{var pt,_t;const St=(pt=_e.filterAndViewsContainer)==null?void 0:pt.getId();St&&S.delete(St);const jt=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters),It=(_t=_e.dynamicFilters)==null?void 0:_t[0];if(console.log("onFiltersChanged setTimeout (backup) - stillRequiresAddView:",jt,"childViews.length:",_e.filterAndViewsContainer.childViews.length,"currentFilterValue:",It),It!==3){console.log("onFiltersChanged setTimeout (backup) - El filtro cambió, cancelando. Valor actual:",It);return}jt&&(console.log("onFiltersChanged setTimeout (backup) - llamando recursivamente para crear siguiente componente"),ce(_e))},200)):nt=setTimeout(()=>{const pt=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters,_e.filters);console.log("onFiltersChanged setTimeout - stillRequiresAddView:",pt,"childViews.length:",_e.filterAndViewsContainer.childViews.length),pt?(console.log("onFiltersChanged - llamando recursivamente para crear siguiente componente"),ce(_e)):console.log("onFiltersChanged - no more views needed, stopping recursion")},1e3),((ke=_e.view)==null?void 0:ke.id)===15&&nt){const pt=(Je=_e.filterAndViewsContainer)==null?void 0:Je.getId();pt&&S.set(pt,nt)}}}else _e.isAltMode?_e.viewToEdit||_e.filterAndViewsContainer.updateFilters(_e.filters,(Ie=(Fe=_e.viewToEdit)==null?void 0:Fe.view)==null?void 0:Ie.id):_e.filterAndViewsContainer.updateDynamicFilters(_e.dynamicFilters,(et=(Ze=_e.viewToEdit)==null?void 0:Ze.view)==null?void 0:et.id),d.value=!0}else if(qe||Ke===j.value.length-1){const rt=new H0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],_e.view.id,_e.dynamicFilters,b.value,t.value,_e.filtersJSON,$.token,_e.filters);qa.emit("set-filter-and-views-container",rt),s.value.set(rt.getId(),rt),_e.dynamicFilters&&Array.isArray(_e.dynamicFilters[0])?(_e.filterAndViewsContainer=rt,ce(_e)):qa.emit("add-view",{pageId:me.id,view:_e.view,filterAndWidgetContainer:rt,avoidWillFit:!1,applyMinimumSize:qe?qe.applyMinimumSize:!1,dynamicFilters:_e.dynamicFilters,filters:_e.filters}),d.value=!0}}}async function ye(){if(d.value)try{const _e=[{is_front_page:!0,template_type:g.value.isPostMatch?2:1,type:g.value.id},...j.value.map(Pe=>({columns:Pe.originalPage?Pe.originalPage.columns:12,rows:Pe.originalPage?Pe.originalPage.rows:12,gap:Pe.originalPage?Pe.originalPage.gap:10,name:Pe.title,width:Pe.originalPage?Pe.originalPage.width:968,height:Pe.originalPage?Pe.originalPage.height:702,components:Pe.items.reduce((Be,ze)=>(ze.isDeleted||Be.push({min_column:ze.minWidth,min_row:ze.minHeight,max_column:ze.maxWidth,max_row:ze.maxHeight,column:ze.x,row:ze.y,colspan:ze.w,rowspan:ze.h,name:ze.name,title:ze.title,titleShort:ze.titleShort||ze.title,dynamicFilters:ze.filterAndViewsContainer.getComponentDynamicFilters(ze.id)||ze.filterAndViewsContainer.getDynamicFilters()||[],coreView:ze.coreView||null,componentName:ze.componentName,componentProps:ze.componentProps||{},isHomeTeam:ze.isHomeTeam||ze.componentProps.isHomeTeamForAnalysis,filterMultiple:ze.filterMultiple}),Be),[])}))],Ce=await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${f.value.user_id}/templates/${f.value.id}/pages`,{method:"PATCH",headers:{Authorization:$.token},body:JSON.stringify({pages:_e})});w.value=!0,await Ce.json(),d.value=!1,setTimeout(()=>{w.value=!1},2e3)}catch(_e){console.error("Error saving template:",_e)}}function xe(){j.value.forEach(_e=>{_e.offListeners&&_e.offListeners()})}function be(_e){const Ce=j.value.findIndex(Pe=>Pe.id===_e.id);Ce>-1&&(xe(),j.value=j.value.filter(Pe=>Pe.id!==_e.id),m.value>=Ce&&(m.value=Math.max(0,m.value-1)),d.value=!0)}function Te(){d.value=!0}function Oe(_e){const Ce=j.value.find(Pe=>Pe.items.some(Be=>Be.id===_e.id));if(Ce){const Pe=Ce.items.find(Be=>Be.id===_e.id);Pe&&(Pe.isDeleted=!0,d.value=!0)}}function Le(_e){}return(_e,Ce)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(pke,{modelValue:x.value,"onUpdate:modelValue":Ce[0]||(Ce[0]=Pe=>x.value=Pe),onAction:N},null,8,["modelValue"]),r.createVNode(mke,{"model-value":w.value},null,8,["model-value"]),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[n.value&&f.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"template-maker",style:r.normalizeStyle(V.value)},[r.withDirectives(r.createVNode(rke,{token:e.token,view:o.value,"is-post-match":b.value,onClose:he,onFiltersChanged:ce},null,8,["token","view","is-post-match"]),[[r.vShow,t.value&&h.value]]),r.createElementVNode("div",yke,[r.createTextVNode(r.toDisplayString(f.value?f.value.name:"Nuevo template")+" ",1),r.createElementVNode("div",{class:"template-maker__header__close",onClick:ue},[_.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("svg",gke,[...Ce[6]||(Ce[6]=[r.createElementVNode("path",{d:"M1.33398 1.33398L14.6673 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),r.createElementVNode("path",{d:"M14.666 1.33398L1.33268 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))])]),r.createElementVNode("div",vke,[Ce[13]||(Ce[13]=r.createElementVNode("div",{class:"template-maker__content__sidebar"},null,-1)),r.createElementVNode("div",bke,[r.createElementVNode("div",xke,[r.createElementVNode("div",wke,[r.withDirectives(r.createVNode($V,{"is-post-match":b.value,"initial-cover-id":v.value,onSelectCover:q},null,8,["is-post-match","initial-cover-id"]),[[r.vShow,t.value]])]),(r.openBlock(),r.createElementBlock("div",{class:"template-maker__content__main__pages",key:j.value.length},[g.value?(r.openBlock(),r.createBlock(sSe,{key:0,id:"page-0",game:f.value.game||null,"cover-id":g.value.id,"is-post-match":g.value.isPostMatch,onIntersectionChanged:Ce[1]||(Ce[1]=Pe=>X(Pe,-1))},null,8,["game","cover-id","is-post-match"])):r.createCommentVNode("",!0),t.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:"new-items-buttons",style:r.normalizeStyle({"margin-bottom":j.value.length===0?"30px":"0"})},[h.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"new-items-buttons__add-page new-item-button",onClick:Ce[2]||(Ce[2]=Pe=>R(-1))},[...Ce[7]||(Ce[7]=[r.createElementVNode("div",null,"+ Nueva página",-1),r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]))],4)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,(Pe,Be)=>(r.openBlock(),r.createElementBlock("div",{key:Be,id:`page-${Be+1}`,class:"template-maker__content__main__pages__page"},[r.createElementVNode("div",Ske,[r.createElementVNode("div",Tke,"Pag "+r.toDisplayString(U(Be+2)),1)]),g.value?(r.openBlock(),r.createBlock(c_e,{key:0,page:Pe,"is-template-mode":t.value,"is-post-match":g.value.isPostMatch,game:f.value.game||null,lastGames:f.value.lastGames||[],"is-filter-visible":h.value,onEditView:D,onIntersectionChanged:ze=>X(ze,Be),onChangeSort:Le,onDeletePage:be,onViewChanged:Te,onDeleteView:Oe},null,8,["page","is-template-mode","is-post-match","game","lastGames","is-filter-visible","onIntersectionChanged"])):r.createCommentVNode("",!0),t.value&&!h.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:"new-items-buttons",style:r.normalizeStyle({"margin-bottom":Be+1===j.value.length?"30px":"0","margin-top":"10px"})},[r.createElementVNode("div",{class:"new-items-buttons__add-page new-item-button",onClick:ze=>R(Be)},[...Ce[8]||(Ce[8]=[r.createElementVNode("div",null,"+ Nueva página",-1),r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,kke),r.createElementVNode("div",{class:"new-items-buttons__add-item new-item-button",onClick:ze=>K(Pe)},[...Ce[9]||(Ce[9]=[r.createElementVNode("div",null,"+ Agregar gráfico",-1),r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M12 13.3346V6.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{d:"M8 13.3346V2.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{d:"M4 13.332V9.33203",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,Nke)],4)):r.createCommentVNode("",!0)],8,_ke))),128))]))]),_.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Vke,[r.createElementVNode("div",Oke,[r.createElementVNode("div",Lke,[r.createElementVNode("div",null,"Páginas "+r.toDisplayString(O.value),1),r.createElementVNode("div",{class:r.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:m.value<=0}]),onClick:Ce[3]||(Ce[3]=Pe=>m.value>0&&W(m.value-1))},[...Ce[10]||(Ce[10]=[r.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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),r.createElementVNode("div",{class:r.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:m.value>=j.value.length}]),onClick:Ce[4]||(Ce[4]=Pe=>m.value<j.value.length&&W(m.value+1))},[...Ce[11]||(Ce[11]=[r.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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)]),r.createElementVNode("div",Uke,[r.createElementVNode("div",{role:"button",class:r.normalizeClass({active:m.value===0}),onClick:Ce[5]||(Ce[5]=Pe=>W(0))},r.toDisplayString(U(1)),3),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,(Pe,Be)=>(r.openBlock(),r.createElementBlock("div",{role:"button",key:Be,class:r.normalizeClass({active:Be+1===m.value}),onClick:ze=>W(Be+1)},r.toDisplayString(U(Be+2)),11,qke))),128))])]),t.value?(r.openBlock(),r.createElementBlock("div",{key:0,role:"button",class:r.normalizeClass(["template-maker__content__main__footer__save save-button",{disabled:!d.value}]),onClick:ye},[...Ce[12]||(Ce[12]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.createElementVNode("path",{d:"M11.3346 14.0013V8.66797H4.66797V14.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{d:"M4.66797 2V5.33333H10.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1),r.createElementVNode("div",null,"Guardar",-1)])],2)):r.createCommentVNode("",!0)]))])])],4)):r.createCommentVNode("",!0)]))],64))}},Cke=Bc(zke,[["__scopeId","data-v-a1be59f5"]]);function IN(e,a){return function(){return e.apply(a,arguments)}}const{toString:Pke}=Object.prototype,{getPrototypeOf:L5}=Object,{iterator:x2,toStringTag:XN}=Symbol,w2=(e=>a=>{const i=Pke.call(a);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Ap=e=>(e=e.toLowerCase(),a=>w2(a)===e),_2=e=>a=>typeof a===e,{isArray:Y0}=Array,Q0=_2("undefined");function X1(e){return e!==null&&!Q0(e)&&e.constructor!==null&&!Q0(e.constructor)&&zd(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const DN=Ap("ArrayBuffer");function Eke(e){let a;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?a=ArrayBuffer.isView(e):a=e&&e.buffer&&DN(e.buffer),a}const Fke=_2("string"),zd=_2("function"),JN=_2("number"),D1=e=>e!==null&&typeof e=="object",Rke=e=>e===!0||e===!1,S2=e=>{if(w2(e)!=="object")return!1;const a=L5(e);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(XN in e)&&!(x2 in e)},Mke=e=>{if(!D1(e)||X1(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},jke=Ap("Date"),Wke=Ap("File"),Kke=Ap("Blob"),Ake=Ap("FileList"),Ike=e=>D1(e)&&zd(e.pipe),Xke=e=>{let a;return e&&(typeof FormData=="function"&&e instanceof FormData||zd(e.append)&&((a=w2(e))==="formdata"||a==="object"&&zd(e.toString)&&e.toString()==="[object FormData]"))},Dke=Ap("URLSearchParams"),[Jke,Bke,Gke,Zke]=["ReadableStream","Request","Response","Headers"].map(Ap),Hke=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function J1(e,a,{allOwnKeys:i=!1}={}){if(e===null||typeof e>"u")return;let k,j;if(typeof e!="object"&&(e=[e]),Y0(e))for(k=0,j=e.length;k<j;k++)a.call(null,e[k],k,e);else{if(X1(e))return;const g=i?Object.getOwnPropertyNames(e):Object.keys(e),m=g.length;let n;for(k=0;k<m;k++)n=g[k],a.call(null,e[n],n,e)}}function BN(e,a){if(X1(e))return null;a=a.toLowerCase();const i=Object.keys(e);let k=i.length,j;for(;k-- >0;)if(j=i[k],a===j.toLowerCase())return j;return null}const zm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,GN=e=>!Q0(e)&&e!==zm;function U5(){const{caseless:e,skipUndefined:a}=GN(this)&&this||{},i={},k=(j,g)=>{const m=e&&BN(i,g)||g;S2(i[m])&&S2(j)?i[m]=U5(i[m],j):S2(j)?i[m]=U5({},j):Y0(j)?i[m]=j.slice():(!a||!Q0(j))&&(i[m]=j)};for(let j=0,g=arguments.length;j<g;j++)arguments[j]&&J1(arguments[j],k);return i}const Yke=(e,a,i,{allOwnKeys:k}={})=>(J1(a,(j,g)=>{i&&zd(j)?e[g]=IN(j,i):e[g]=j},{allOwnKeys:k}),e),Qke=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),$ke=(e,a,i,k)=>{e.prototype=Object.create(a.prototype,k),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:a.prototype}),i&&Object.assign(e.prototype,i)},e7e=(e,a,i,k)=>{let j,g,m;const n={};if(a=a||{},e==null)return a;do{for(j=Object.getOwnPropertyNames(e),g=j.length;g-- >0;)m=j[g],(!k||k(m,e,a))&&!n[m]&&(a[m]=e[m],n[m]=!0);e=i!==!1&&L5(e)}while(e&&(!i||i(e,a))&&e!==Object.prototype);return a},t7e=(e,a,i)=>{e=String(e),(i===void 0||i>e.length)&&(i=e.length),i-=a.length;const k=e.indexOf(a,i);return k!==-1&&k===i},r7e=e=>{if(!e)return null;if(Y0(e))return e;let a=e.length;if(!JN(a))return null;const i=new Array(a);for(;a-- >0;)i[a]=e[a];return i},n7e=(e=>a=>e&&a instanceof e)(typeof Uint8Array<"u"&&L5(Uint8Array)),a7e=(e,a)=>{const k=(e&&e[x2]).call(e);let j;for(;(j=k.next())&&!j.done;){const g=j.value;a.call(e,g[0],g[1])}},i7e=(e,a)=>{let i;const k=[];for(;(i=e.exec(a))!==null;)k.push(i);return k},o7e=Ap("HTMLFormElement"),s7e=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,k,j){return k.toUpperCase()+j}),ZN=(({hasOwnProperty:e})=>(a,i)=>e.call(a,i))(Object.prototype),l7e=Ap("RegExp"),HN=(e,a)=>{const i=Object.getOwnPropertyDescriptors(e),k={};J1(i,(j,g)=>{let m;(m=a(j,g,e))!==!1&&(k[g]=m||j)}),Object.defineProperties(e,k)},c7e=e=>{HN(e,(a,i)=>{if(zd(e)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const k=e[i];if(zd(k)){if(a.enumerable=!1,"writable"in a){a.writable=!1;return}a.set||(a.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},u7e=(e,a)=>{const i={},k=j=>{j.forEach(g=>{i[g]=!0})};return Y0(e)?k(e):k(String(e).split(a)),i},d7e=()=>{},p7e=(e,a)=>e!=null&&Number.isFinite(e=+e)?e:a;function h7e(e){return!!(e&&zd(e.append)&&e[XN]==="FormData"&&e[x2])}const f7e=e=>{const a=new Array(10),i=(k,j)=>{if(D1(k)){if(a.indexOf(k)>=0)return;if(X1(k))return k;if(!("toJSON"in k)){a[j]=k;const g=Y0(k)?[]:{};return J1(k,(m,n)=>{const f=i(m,j+1);!Q0(f)&&(g[n]=f)}),a[j]=void 0,g}}return k};return i(e,0)},m7e=Ap("AsyncFunction"),y7e=e=>e&&(D1(e)||zd(e))&&zd(e.then)&&zd(e.catch),YN=((e,a)=>e?setImmediate:a?((i,k)=>(zm.addEventListener("message",({source:j,data:g})=>{j===zm&&g===i&&k.length&&k.shift()()},!1),j=>{k.push(j),zm.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",zd(zm.postMessage)),g7e=typeof queueMicrotask<"u"?queueMicrotask.bind(zm):typeof process<"u"&&process.nextTick||YN,Qn={isArray:Y0,isArrayBuffer:DN,isBuffer:X1,isFormData:Xke,isArrayBufferView:Eke,isString:Fke,isNumber:JN,isBoolean:Rke,isObject:D1,isPlainObject:S2,isEmptyObject:Mke,isReadableStream:Jke,isRequest:Bke,isResponse:Gke,isHeaders:Zke,isUndefined:Q0,isDate:jke,isFile:Wke,isBlob:Kke,isRegExp:l7e,isFunction:zd,isStream:Ike,isURLSearchParams:Dke,isTypedArray:n7e,isFileList:Ake,forEach:J1,merge:U5,extend:Yke,trim:Hke,stripBOM:Qke,inherits:$ke,toFlatObject:e7e,kindOf:w2,kindOfTest:Ap,endsWith:t7e,toArray:r7e,forEachEntry:a7e,matchAll:i7e,isHTMLForm:o7e,hasOwnProperty:ZN,hasOwnProp:ZN,reduceDescriptors:HN,freezeMethods:c7e,toObjectSet:u7e,toCamelCase:s7e,noop:d7e,toFiniteNumber:p7e,findKey:BN,global:zm,isContextDefined:GN,isSpecCompliantForm:h7e,toJSONObject:f7e,isAsyncFn:m7e,isThenable:y7e,setImmediate:YN,asap:g7e,isIterable:e=>e!=null&&zd(e[x2])};function fo(e,a,i,k,j){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",a&&(this.code=a),i&&(this.config=i),k&&(this.request=k),j&&(this.response=j,this.status=j.status?j.status:null)}Qn.inherits(fo,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 QN=fo.prototype,$N={};["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(e=>{$N[e]={value:e}}),Object.defineProperties(fo,$N),Object.defineProperty(QN,"isAxiosError",{value:!0}),fo.from=(e,a,i,k,j,g)=>{const m=Object.create(QN);Qn.toFlatObject(e,m,function(t){return t!==Error.prototype},l=>l!=="isAxiosError");const n=e&&e.message?e.message:"Error",f=a==null&&e?e.code:a;return fo.call(m,n,f,i,k,j),e&&m.cause==null&&Object.defineProperty(m,"cause",{value:e,configurable:!0}),m.name=e&&e.name||"Error",g&&Object.assign(m,g),m};const v7e=null;function q5(e){return Qn.isPlainObject(e)||Qn.isArray(e)}function eV(e){return Qn.endsWith(e,"[]")?e.slice(0,-2):e}function tV(e,a,i){return e?e.concat(a).map(function(j,g){return j=eV(j),!i&&g?"["+j+"]":j}).join(i?".":""):a}function b7e(e){return Qn.isArray(e)&&!e.some(q5)}const x7e=Qn.toFlatObject(Qn,{},null,function(a){return/^is[A-Z]/.test(a)});function T2(e,a,i){if(!Qn.isObject(e))throw new TypeError("target must be an object");a=a||new FormData,i=Qn.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(o,s){return!Qn.isUndefined(s[o])});const k=i.metaTokens,j=i.visitor||t,g=i.dots,m=i.indexes,f=(i.Blob||typeof Blob<"u"&&Blob)&&Qn.isSpecCompliantForm(a);if(!Qn.isFunction(j))throw new TypeError("visitor must be a function");function l(h){if(h===null)return"";if(Qn.isDate(h))return h.toISOString();if(Qn.isBoolean(h))return h.toString();if(!f&&Qn.isBlob(h))throw new fo("Blob is not supported. Use a Buffer instead.");return Qn.isArrayBuffer(h)||Qn.isTypedArray(h)?f&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function t(h,o,s){let p=h;if(h&&!s&&typeof h=="object"){if(Qn.endsWith(o,"{}"))o=k?o:o.slice(0,-2),h=JSON.stringify(h);else if(Qn.isArray(h)&&b7e(h)||(Qn.isFileList(h)||Qn.endsWith(o,"[]"))&&(p=Qn.toArray(h)))return o=eV(o),p.forEach(function(d,x){!(Qn.isUndefined(d)||d===null)&&a.append(m===!0?tV([o],x,g):m===null?o:o+"[]",l(d))}),!1}return q5(h)?!0:(a.append(tV(s,o,g),l(h)),!1)}const _=[],b=Object.assign(x7e,{defaultVisitor:t,convertValue:l,isVisitable:q5});function v(h,o){if(!Qn.isUndefined(h)){if(_.indexOf(h)!==-1)throw Error("Circular reference detected in "+o.join("."));_.push(h),Qn.forEach(h,function(p,c){(!(Qn.isUndefined(p)||p===null)&&j.call(a,p,Qn.isString(c)?c.trim():c,o,b))===!0&&v(p,o?o.concat(c):[c])}),_.pop()}}if(!Qn.isObject(e))throw new TypeError("data must be an object");return v(e),a}function rV(e){const a={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(k){return a[k]})}function z5(e,a){this._pairs=[],e&&T2(e,this,a)}const nV=z5.prototype;nV.append=function(a,i){this._pairs.push([a,i])},nV.toString=function(a){const i=a?function(k){return a.call(this,k,rV)}:rV;return this._pairs.map(function(j){return i(j[0])+"="+i(j[1])},"").join("&")};function w7e(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function aV(e,a,i){if(!a)return e;const k=i&&i.encode||w7e;Qn.isFunction(i)&&(i={serialize:i});const j=i&&i.serialize;let g;if(j?g=j(a,i):g=Qn.isURLSearchParams(a)?a.toString():new z5(a,i).toString(k),g){const m=e.indexOf("#");m!==-1&&(e=e.slice(0,m)),e+=(e.indexOf("?")===-1?"?":"&")+g}return e}class iV{constructor(){this.handlers=[]}use(a,i,k){return this.handlers.push({fulfilled:a,rejected:i,synchronous:k?k.synchronous:!1,runWhen:k?k.runWhen:null}),this.handlers.length-1}eject(a){this.handlers[a]&&(this.handlers[a]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(a){Qn.forEach(this.handlers,function(k){k!==null&&a(k)})}}const oV={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_7e={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:z5,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},C5=typeof window<"u"&&typeof document<"u",P5=typeof navigator=="object"&&navigator||void 0,S7e=C5&&(!P5||["ReactNative","NativeScript","NS"].indexOf(P5.product)<0),T7e=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",k7e=C5&&window.location.href||"http://localhost",Gu={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:C5,hasStandardBrowserEnv:S7e,hasStandardBrowserWebWorkerEnv:T7e,navigator:P5,origin:k7e},Symbol.toStringTag,{value:"Module"})),..._7e};function N7e(e,a){return T2(e,new Gu.classes.URLSearchParams,{visitor:function(i,k,j,g){return Gu.isNode&&Qn.isBuffer(i)?(this.append(k,i.toString("base64")),!1):g.defaultVisitor.apply(this,arguments)},...a})}function V7e(e){return Qn.matchAll(/\w+|\[(\w*)]/g,e).map(a=>a[0]==="[]"?"":a[1]||a[0])}function O7e(e){const a={},i=Object.keys(e);let k;const j=i.length;let g;for(k=0;k<j;k++)g=i[k],a[g]=e[g];return a}function sV(e){function a(i,k,j,g){let m=i[g++];if(m==="__proto__")return!0;const n=Number.isFinite(+m),f=g>=i.length;return m=!m&&Qn.isArray(j)?j.length:m,f?(Qn.hasOwnProp(j,m)?j[m]=[j[m],k]:j[m]=k,!n):((!j[m]||!Qn.isObject(j[m]))&&(j[m]=[]),a(i,k,j[m],g)&&Qn.isArray(j[m])&&(j[m]=O7e(j[m])),!n)}if(Qn.isFormData(e)&&Qn.isFunction(e.entries)){const i={};return Qn.forEachEntry(e,(k,j)=>{a(V7e(k),j,i,0)}),i}return null}function L7e(e,a,i){if(Qn.isString(e))try{return(a||JSON.parse)(e),Qn.trim(e)}catch(k){if(k.name!=="SyntaxError")throw k}return(i||JSON.stringify)(e)}const B1={transitional:oV,adapter:["xhr","http","fetch"],transformRequest:[function(a,i){const k=i.getContentType()||"",j=k.indexOf("application/json")>-1,g=Qn.isObject(a);if(g&&Qn.isHTMLForm(a)&&(a=new FormData(a)),Qn.isFormData(a))return j?JSON.stringify(sV(a)):a;if(Qn.isArrayBuffer(a)||Qn.isBuffer(a)||Qn.isStream(a)||Qn.isFile(a)||Qn.isBlob(a)||Qn.isReadableStream(a))return a;if(Qn.isArrayBufferView(a))return a.buffer;if(Qn.isURLSearchParams(a))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),a.toString();let n;if(g){if(k.indexOf("application/x-www-form-urlencoded")>-1)return N7e(a,this.formSerializer).toString();if((n=Qn.isFileList(a))||k.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return T2(n?{"files[]":a}:a,f&&new f,this.formSerializer)}}return g||j?(i.setContentType("application/json",!1),L7e(a)):a}],transformResponse:[function(a){const i=this.transitional||B1.transitional,k=i&&i.forcedJSONParsing,j=this.responseType==="json";if(Qn.isResponse(a)||Qn.isReadableStream(a))return a;if(a&&Qn.isString(a)&&(k&&!this.responseType||j)){const m=!(i&&i.silentJSONParsing)&&j;try{return JSON.parse(a,this.parseReviver)}catch(n){if(m)throw n.name==="SyntaxError"?fo.from(n,fo.ERR_BAD_RESPONSE,this,null,this.response):n}}return a}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Gu.classes.FormData,Blob:Gu.classes.Blob},validateStatus:function(a){return a>=200&&a<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Qn.forEach(["delete","get","head","post","put","patch"],e=>{B1.headers[e]={}});const U7e=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"]),q7e=e=>{const a={};let i,k,j;return e&&e.split(`
4126
+ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),k}static addGrid(a,i={}){if(!a)return null;let k=a;if(k.gridstack){const j=k.gridstack;return i&&(j.opts={...j.opts,...i}),i.children!==void 0&&j.load(i.children),j}return(!a.classList.contains("grid-stack")||vi.addRemoveCB)&&(vi.addRemoveCB?k=vi.addRemoveCB(a,i,!0,!0):k=Yn.createDiv(["grid-stack",i.class],a)),vi.init(i,k)}static registerEngine(a){vi.engineClass=a}get placeholder(){if(!this._placeholder){this._placeholder=Yn.createDiv([this.opts.placeholderClass,Id.itemClass,this.opts.itemClass]);const a=Yn.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(a.textContent=this.opts.placeholderText)}return this._placeholder}constructor(a,i={}){var k;this.el=a,this.opts=i,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},a.gridstack=this,this.opts=i=i||{},a.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),i.row&&(i.minRow=i.maxRow=i.row,delete i.row);const j=Yn.toNumber(a.getAttribute("gs-row"));i.column==="auto"&&delete i.column,i.alwaysShowResizeHandle!==void 0&&(i._alwaysShowResizeHandle=i.alwaysShowResizeHandle);const g=i.columnOpts;if(g){const t=g.breakpoints;!g.columnWidth&&!(t!=null&&t.length)?delete i.columnOpts:(g.columnMax=g.columnMax||12,(t==null?void 0:t.length)>1&&t.sort((_,b)=>(b.w||0)-(_.w||0)))}const m={...Yn.cloneDeep(Id),column:Yn.toNumber(a.getAttribute("gs-column"))||Id.column,minRow:j||Yn.toNumber(a.getAttribute("gs-min-row"))||Id.minRow,maxRow:j||Yn.toNumber(a.getAttribute("gs-max-row"))||Id.maxRow,staticGrid:Yn.toBool(a.getAttribute("gs-static"))||Id.staticGrid,sizeToContent:Yn.toBool(a.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(i.handleClass?"."+i.handleClass:i.handle?i.handle:"")||Id.draggable.handle},removableOptions:{accept:i.itemClass||Id.removableOptions.accept,decline:Id.removableOptions.decline}};a.getAttribute("gs-animate")&&(m.animate=Yn.toBool(a.getAttribute("gs-animate"))),i=Yn.defaults(i,m),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(i),i.rtl==="auto"&&(i.rtl=a.style.direction==="rtl"),i.rtl&&this.el.classList.add("grid-stack-rtl");const n=this.el.closest("."+Id.itemClass),f=n==null?void 0:n.gridstackNode;if(f&&(f.subGrid=this,this.parentGridNode=f,this.el.classList.add("grid-stack-nested"),f.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=i.cellHeight==="auto",this._isAutoCellHeight||i.cellHeight==="initial")this.cellHeight(void 0);else{typeof i.cellHeight=="number"&&i.cellHeightUnit&&i.cellHeightUnit!==Id.cellHeightUnit&&(i.cellHeight=i.cellHeight+i.cellHeightUnit,delete i.cellHeightUnit);const t=i.cellHeight;delete i.cellHeight,this.cellHeight(t)}i.alwaysShowResizeHandle==="mobile"&&(i.alwaysShowResizeHandle=Kp),this._setStaticClass();const l=i.engineClass||vi.engineClass||Mh;if(this.engine=new l({column:this.getColumn(),float:i.float,maxRow:i.maxRow,onChange:t=>{t.forEach(_=>{const b=_.el;b&&(_._removeDOM?(b&&b.remove(),delete _._removeDOM):this._writePosAttr(b,_))}),this._updateContainerHeight()}}),i.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(t=>this._prepareElement(t)),delete this.engine._loading,this.batchUpdate(!1)),i.children){const t=i.children;delete i.children,t.length&&this.load(t)}this.setAnimation(),i.subGridDynamic&&!Fi.pauseDrag&&(Fi.pauseDrag=!0),((k=i.draggable)==null?void 0:k.pause)!==void 0&&(Fi.pauseDrag=i.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 i,k=a;if(k.grid=this,k.el?i=k.el:vi.addRemoveCB?i=vi.addRemoveCB(this.el,a,!0,!1):i=this.createWidgetDivs(k),!i)return;if(k=i.gridstackNode,k&&i.parentElement===this.el&&this.engine.nodes.find(g=>g._id===k._id))return i;const j=this._readAttr(i);return Yn.defaults(a,j),this.engine.prepareNode(a),this.el.appendChild(i),this.makeWidget(i,a),i}createWidgetDivs(a){const i=Yn.createDiv(["grid-stack-item",this.opts.itemClass]),k=Yn.createDiv(["grid-stack-item-content"],i);return Yn.lazyLoad(a)?a.visibleObservable||(a.visibleObservable=new IntersectionObserver(([j])=>{var g,m;j.isIntersecting&&((g=a.visibleObservable)==null||g.disconnect(),delete a.visibleObservable,vi.renderCB(k,a),(m=a.grid)==null||m.prepareDragDrop(a.el))}),window.setTimeout(()=>{var j;return(j=a.visibleObservable)==null?void 0:j.observe(i)})):vi.renderCB(k,a),i}makeSubGrid(a,i,k,j=!0){var g,m,n;let f=a.gridstackNode;if(f||(f=this.makeWidget(a).gridstackNode),(g=f.subGrid)!=null&&g.el)return f.subGrid;let l,t=this;for(;t&&!l;)l=(m=t.opts)==null?void 0:m.subGridOpts,t=(n=t.parentGridNode)==null?void 0:n.grid;i=Yn.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...l||{},...i||f.subGridOpts||{}}),f.subGridOpts=i;let _;i.column==="auto"&&(_=!0,i.column=Math.max(f.w||1,(k==null?void 0:k.w)||1),delete i.columnOpts);let b=f.el.querySelector(".grid-stack-item-content"),v,h;if(j&&(this._removeDD(f.el),h={...f,x:0,y:0},Yn.removeInternalForSave(h),delete h.subGridOpts,f.content&&(h.content=f.content,delete f.content),vi.addRemoveCB?v=vi.addRemoveCB(this.el,h,!0,!1):(v=Yn.createDiv(["grid-stack-item"]),v.appendChild(b),b=Yn.createDiv(["grid-stack-item-content"],f.el)),this.prepareDragDrop(f.el)),k){const s=_?i.column:f.w,p=f.h+k.h,c=f.el.style;c.transition="none",this.update(f.el,{w:s,h:p}),setTimeout(()=>c.transition=null)}const o=f.subGrid=vi.addGrid(b,i);return k!=null&&k._moving&&(o._isTemp=!0),_&&(o._autoColumn=!0),j&&o.makeWidget(v,h),k&&(k._moving?window.setTimeout(()=>Yn.simulateMouseEvent(k._event,"mouseenter",o.el),0):o.makeWidget(f.el,f)),this.resizeToContentCheck(!1,f),o}removeAsSubGrid(a){var i;const k=(i=this.parentGridNode)==null?void 0:i.grid;k&&(k.batchUpdate(),k.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(j=>{j.x+=this.parentGridNode.x,j.y+=this.parentGridNode.y,k.makeWidget(j.el,j)}),k.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,a&&window.setTimeout(()=>Yn.simulateMouseEvent(a._event,"mouseenter",k.el),0))}save(a=!0,i=!1,k=vi.saveCB,j){const g=this.engine.save(a,k,j);if(g.forEach(m=>{var n;if(a&&m.el&&!m.subGrid&&!k){const f=m.el.querySelector(".grid-stack-item-content");m.content=f==null?void 0:f.innerHTML,m.content||delete m.content}else if(!a&&!k&&delete m.content,(n=m.subGrid)!=null&&n.el){const f=m.w||m.subGrid.getColumn(),l=m.subGrid.save(a,i,k,f);m.subGridOpts=i?l:{children:l},delete m.subGrid}delete m.el}),i){const m=Yn.cloneDeep(this.opts);m.marginBottom===m.marginTop&&m.marginRight===m.marginLeft&&m.marginTop===m.marginRight&&(m.margin=m.marginTop,delete m.marginTop,delete m.marginRight,delete m.marginBottom,delete m.marginLeft),m.rtl===(this.el.style.direction==="rtl")&&(m.rtl="auto"),this._isAutoCellHeight&&(m.cellHeight="auto"),this._autoColumn&&(m.column="auto");const n=m._alwaysShowResizeHandle;return delete m._alwaysShowResizeHandle,n!==void 0?m.alwaysShowResizeHandle=n:delete m.alwaysShowResizeHandle,Yn.removeInternalAndSame(m,Id),m.children=g,m}return g}load(a,i=vi.addRemoveCB||!0){a=Yn.cloneDeep(a);const k=this.getColumn();a.forEach(t=>{t.w=t.w||t.minW||1,t.h=t.h||t.minH||1}),a=Yn.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>k&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=a,this.engine.columnChanged(j,k,this.responseLayout),a=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(a,j,!0));const g=vi.addRemoveCB;typeof i=="function"&&(vi.addRemoveCB=i);const m=[];this.batchUpdate();const n=!this.engine.nodes.length,f=n&&this.opts.animate;f&&this.setAnimation(!1),!n&&i&&[...this.engine.nodes].forEach(t=>{t.id&&(Yn.find(a,t.id)||(vi.addRemoveCB&&vi.addRemoveCB(this.el,t,!1,!1),m.push(t),this.removeWidget(t.el,!0,!1)))}),this.engine._loading=!0;const l=[];return this.engine.nodes=this.engine.nodes.filter(t=>Yn.find(a,t.id)?(l.push(t),!1):!0),a.forEach(t=>{var _;const b=Yn.find(l,t.id);if(b){if(Yn.shouldSizeToContent(b)&&(t.h=b.h),this.engine.nodeBoundFix(t),(t.autoPosition||t.x===void 0||t.y===void 0)&&(t.w=t.w||b.w,t.h=t.h||b.h,this.engine.findEmptyPosition(t)),this.engine.nodes.push(b),Yn.samePos(b,t)&&this.engine.nodes.length>1&&(this.moveNode(b,{...t,forceCollide:!0}),Yn.copyPos(t,b)),this.update(b.el,t),(_=t.subGridOpts)!=null&&_.children){const v=b.el.querySelector(".grid-stack");v&&v.gridstack&&v.gridstack.load(t.subGridOpts.children)}}else i&&this.addWidget(t)}),delete this.engine._loading,this.engine.removedNodes=m,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,g?vi.addRemoveCB=g:delete vi.addRemoveCB,f&&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 i=this.el.querySelector("."+this.opts.itemClass);if(i){const j=Yn.toNumber(i.getAttribute("gs-h"))||1;return Math.round(i.offsetHeight/j)}const k=parseInt(this.el.getAttribute("gs-current-row"));return k?Math.round(this.el.getBoundingClientRect().height/k):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 k=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;a=this.cellWidth()+k}const i=Yn.parseHeight(a);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h?this:(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.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 i;return a&&(i=this.opts.columnOpts)!=null&&i.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var a,i;const k=this.opts.columnOpts;if(!k||!k.columnWidth&&!((a=k.breakpoints)!=null&&a.length))return!1;const j=this.getColumn();let g=j;const m=this._widthOrContainer(!0);if(k.columnWidth)g=Math.min(Math.round(m/k.columnWidth)||1,k.columnMax);else{g=k.columnMax;let n=0;for(;n<k.breakpoints.length&&m<=k.breakpoints[n].w;)g=k.breakpoints[n++].c||j}if(g!==j){const n=(i=k.breakpoints)==null?void 0:i.find(f=>f.c===g);return this.column(g,(n==null?void 0:n.layout)||k.layout),!0}return!1}compact(a="compact",i=!0){return this.engine.compact(a,i),this._triggerChangeEvent(),this}column(a,i="moveScale"){if(!a||a<1||this.opts.column===a)return this;const k=this.getColumn();return this.opts.column=a,this.engine?(this.engine.column=a,this.el.classList.remove("gs-"+k),this._updateColumnVar(),this.engine.columnChanged(k,a,i),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=i,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 i;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,(i=this._placeholder)==null||delete i.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,i=!1){const k=this.el.getBoundingClientRect();let j;i?j={top:k.top+document.documentElement.scrollTop,left:k.left}:j={top:this.el.offsetTop,left:this.el.offsetLeft};const g=a.left-j.left,m=a.top-j.top,n=k.width/this.getColumn(),f=k.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(g/n),y:Math.floor(m/f)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(a,i,k,j){return this.engine.isAreaEmpty(a,i,k,j)}makeWidget(a,i){const k=vi.getElement(a);if(!k||k.gridstackNode)return k;k.parentElement||this.el.appendChild(k),this._prepareElement(k,!0,i);const j=k.gridstackNode;this._updateContainerHeight(),j.subGridOpts&&this.makeSubGrid(k,j.subGridOpts,void 0,!1);let g;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(g=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),g&&delete this._ignoreLayoutsNodeChange,k}on(a,i){return a.indexOf(" ")!==-1?(a.split(" ").forEach(k=>this.on(k,i)),this):(a==="change"||a==="added"||a==="removed"||a==="enable"||a==="disable"?(a==="enable"||a==="disable"?this._gsEventHandler[a]=k=>i(k):this._gsEventHandler[a]=k=>{k.detail&&i(k,k.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]=i:console.error("GridStack.on("+a+") event not supported"),this)}off(a){return a.indexOf(" ")!==-1?(a.split(" ").forEach(i=>this.off(i)),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,i=!0,k=!0){return a?(vi.getElements(a).forEach(j=>{if(j.parentElement&&j.parentElement!==this.el)return;let g=j.gridstackNode;g||(g=this.engine.nodes.find(m=>j===m.el)),g&&(i&&vi.addRemoveCB&&vi.addRemoveCB(this.el,g,!1,!1),delete j.gridstackNode,this._removeDD(j),this.engine.removeNode(g,i,k),i&&j.parentElement&&j.remove())}),k&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(a=!0,i=!0){return this.engine.nodes.forEach(k=>{a&&vi.addRemoveCB&&vi.addRemoveCB(this.el,k,!1,!1),delete k.el.gridstackNode,this.opts.staticGrid||this._removeDD(k.el)}),this.engine.removeAll(a,i),i&&this._triggerRemoveEvent(),this}setAnimation(a=this.opts.animate,i){return i?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,i=!0,k=!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&&k&&j.subGrid.setStatic(a,i,k)}),i&&this._setStaticClass(),this)}updateOptions(a){var i;const k=this.opts;return a===k?this:(a.acceptWidgets!==void 0&&(k.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!==k.class&&(k.class&&this.el.classList.remove(k.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?(k.minRow=k.maxRow=k.row=a.row,this._updateContainerHeight()):(a.minRow!==void 0&&(k.minRow=a.minRow,this._updateContainerHeight()),a.maxRow!==void 0&&(k.maxRow=a.maxRow)),(i=a.children)!=null&&i.length&&this.load(a.children),this)}update(a,i){return vi.getElements(a).forEach(k=>{var j;const g=k==null?void 0:k.gridstackNode;if(!g)return;const m={...Yn.copyPos({},g),...Yn.cloneDeep(i)};this.engine.nodeBoundFix(m),delete m.autoPosition;const n=["x","y","w","h"];let f;if(n.some(_=>m[_]!==void 0&&m[_]!==g[_])&&(f={},n.forEach(_=>{f[_]=m[_]!==void 0?m[_]:g[_],delete m[_]})),!f&&(m.minW||m.minH||m.maxW||m.maxH)&&(f={}),m.content!==void 0){const _=k.querySelector(".grid-stack-item-content");_&&_.textContent!==m.content&&(g.content=m.content,vi.renderCB(_,m),(j=g.subGrid)!=null&&j.el&&(_.appendChild(g.subGrid.el),g.subGrid._updateContainerHeight())),delete m.content}let l=!1,t=!1;for(const _ in m)_[0]!=="_"&&g[_]!==m[_]&&(g[_]=m[_],l=!0,t=t||!this.opts.staticGrid&&(_==="noResize"||_==="noMove"||_==="locked"));if(Yn.sanitizeMinMax(g),f){const _=f.w!==void 0&&f.w!==g.w;this.moveNode(g,f),_&&g.subGrid?g.subGrid.onResize(this.hasAnimationCSS()?g.w:void 0):this.resizeToContentCheck(_,g),delete g._orig}(f||l)&&this._writeAttr(k,g),t&&this.prepareDragDrop(g.el),vi.updateCB&&vi.updateCB(g)}),this}moveNode(a,i){const k=a._updating;k||this.engine.cleanNodes().beginUpdate(a),this.engine.moveNode(a,i),this._updateContainerHeight(),k||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(a){var i,k;if(!a||(a.classList.remove("size-to-content-max"),!a.clientHeight))return;const j=a.gridstackNode;if(!j)return;const g=j.grid;if(!g||a.parentElement!==g.el)return;const m=g.getCellHeight(!0);if(!m)return;let n=j.h?j.h*m:a.clientHeight,f;if(j.resizeToContentParent&&(f=a.querySelector(j.resizeToContentParent)),f||(f=a.querySelector(vi.resizeToContentParent)),!f)return;const l=a.clientHeight-f.clientHeight,t=j.h?j.h*m-l:f.clientHeight;let _;if(j.subGrid){_=j.subGrid.getRow()*j.subGrid.getCellHeight(!0);const h=j.subGrid.el.getBoundingClientRect(),o=a.getBoundingClientRect();_+=h.top-o.top}else{if((k=(i=j.subGridOpts)==null?void 0:i.children)!=null&&k.length)return;{const h=f.firstElementChild;if(!h){console.error(`Error: GridStack.resizeToContent() widget id:${j.id} '${vi.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}_=h.getBoundingClientRect().height||t}}if(t===_)return;n+=_-t;let b=Math.ceil(n/m);const v=Number.isInteger(j.sizeToContent)?j.sizeToContent:0;v&&b>v&&(b=v,a.classList.add("size-to-content-max")),j.minH&&b<j.minH?b=j.minH:j.maxH&&b>j.maxH&&(b=j.maxH),b!==j.h&&(g._ignoreLayoutsNodeChange=!0,g.moveNode(j,{h:b}),delete g._ignoreLayoutsNodeChange)}resizeToContentCBCheck(a){vi.resizeToContentCB?vi.resizeToContentCB(a):this.resizeToContent(a)}rotate(a,i){return vi.getElements(a).forEach(k=>{const j=k.gridstackNode;if(!Yn.canBeRotated(j))return;const g={w:j.h,h:j.w,minH:j.minW,minW:j.minH,maxH:j.maxW,maxW:j.maxH};if(i){const n=i.left>0?Math.floor(i.left/this.cellWidth()):0,f=i.top>0?Math.floor(i.top/this.opts.cellHeight):0;g.x=j.x+n-(j.h-(f+1)),g.y=j.y+f-n}Object.keys(g).forEach(n=>{g[n]===void 0&&delete g[n]});const m=j._orig;this.update(k,g),j._orig=m}),this}margin(a){if(!(typeof a=="string"&&a.split(" ").length>1)){const i=Yn.parseHeight(a);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.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 i=arguments;let k=0,j={x:i[k++],y:i[k++],w:i[k++],h:i[k++],autoPosition:i[k++]};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(k=>{delete k._dirty});const i=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",i)}return this}_triggerRemoveEvent(){var a;if(this.engine.batchMode)return this;if((a=this.engine.removedNodes)!=null&&a.length){const i=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",i)}return this}_triggerEvent(a,i){const k=i?new CustomEvent(a,{bubbles:!1,detail:i}):new Event(a);let j=this;for(;j.parentGridNode;)j=j.parentGridNode.grid;return j.el.dispatchEvent(k),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const a=this.parentGridNode;let i=this.getRow()+this._extraDragRow;const k=this.opts.cellHeight,j=this.opts.cellHeightUnit;if(!k)return this;if(!a&&!this.opts.minRow){const g=Yn.parseHeight(getComputedStyle(this.el).minHeight);if(g.h>0&&g.unit===j){const m=Math.floor(g.h/k);i<m&&(i=m)}}return this.el.setAttribute("gs-current-row",String(i)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),i&&(this.el.style[a?"minHeight":"height"]=i*k+j),a&&Yn.shouldSizeToContent(a)&&a.grid.resizeToContentCBCheck(a.el),this}_prepareElement(a,i=!1,k){k=k||this._readAttr(a),a.gridstackNode=k,k.el=a,k.grid=this,k=this.engine.addNode(k,i),this._writeAttr(a,k),a.classList.add(Id.itemClass,this.opts.itemClass);const j=Yn.shouldSizeToContent(k);return j?a.classList.add("size-to-content"):a.classList.remove("size-to-content"),j&&this.resizeToContentCheck(!1,k),Yn.lazyLoad(k)||this.prepareDragDrop(k.el),this}_writePosAttr(a,i){return(!i._moving&&!i._resizing||this._placeholder===a)&&(a.style.top=i.y?i.y===1?"var(--gs-cell-height)":`calc(${i.y} * var(--gs-cell-height))`:null,a.style.left=i.x?i.x===1?"var(--gs-column-width)":`calc(${i.x} * var(--gs-column-width))`:null,a.style.width=i.w>1?`calc(${i.w} * var(--gs-column-width))`:null,a.style.height=i.h>1?`calc(${i.h} * var(--gs-cell-height))`:null),i.x>0?a.setAttribute("gs-x",String(i.x)):a.removeAttribute("gs-x"),i.y>0?a.setAttribute("gs-y",String(i.y)):a.removeAttribute("gs-y"),i.w>1?a.setAttribute("gs-w",String(i.w)):a.removeAttribute("gs-w"),i.h>1?a.setAttribute("gs-h",String(i.h)):a.removeAttribute("gs-h"),this}_writeAttr(a,i){if(!i)return this;this._writePosAttr(a,i);const k={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const j in k)i[j]?a.setAttribute(k[j],String(i[j])):a.removeAttribute(k[j]);return this}_readAttr(a,i=!0){const k={};k.x=Yn.toNumber(a.getAttribute("gs-x")),k.y=Yn.toNumber(a.getAttribute("gs-y")),k.w=Yn.toNumber(a.getAttribute("gs-w")),k.h=Yn.toNumber(a.getAttribute("gs-h")),k.autoPosition=Yn.toBool(a.getAttribute("gs-auto-position")),k.noResize=Yn.toBool(a.getAttribute("gs-no-resize")),k.noMove=Yn.toBool(a.getAttribute("gs-no-move")),k.locked=Yn.toBool(a.getAttribute("gs-locked"));const j=a.getAttribute("gs-size-to-content");j&&(j==="true"||j==="false"?k.sizeToContent=Yn.toBool(j):k.sizeToContent=parseInt(j,10)),k.id=a.getAttribute("gs-id"),k.maxW=Yn.toNumber(a.getAttribute("gs-max-w")),k.minW=Yn.toNumber(a.getAttribute("gs-min-w")),k.maxH=Yn.toNumber(a.getAttribute("gs-max-h")),k.minH=Yn.toNumber(a.getAttribute("gs-min-h")),i&&(k.w===1&&a.removeAttribute("gs-w"),k.h===1&&a.removeAttribute("gs-h"),k.maxW&&a.removeAttribute("gs-max-w"),k.minW&&a.removeAttribute("gs-min-w"),k.maxH&&a.removeAttribute("gs-max-h"),k.minH&&a.removeAttribute("gs-min-h"));for(const g in k){if(!k.hasOwnProperty(g))return;!k[g]&&k[g]!==0&&g!=="sizeToContent"&&delete k[g]}return k}_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=(i=>(i=this.el)==null?void 0:i.clientWidth)()){if(!a||this.prevWidth===a)return;this.prevWidth=a,this.batchUpdate();let i=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),i=!0):i=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(k=>{k.subGrid&&k.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(i),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(a=!1,i=void 0){if(this.engine){if(a&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,i),this.animationDelay);if(i)Yn.shouldSizeToContent(i)&&this.resizeToContentCBCheck(i.el);else if(this.engine.nodes.some(k=>Yn.shouldSizeToContent(k))){const k=[...this.engine.nodes];this.batchUpdate(),k.forEach(j=>{Yn.shouldSizeToContent(j)&&this.resizeToContentCBCheck(j.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,i?[i]:this.engine.nodes)}}_updateResizeEvent(a=!1){const i=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(k=>k.sizeToContent));return!a&&i&&!this.resizeObserver?(this._sizeThrottle=Yn.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(a||!i)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(a=".grid-stack-item"){return Yn.getElement(a)}static getElements(a=".grid-stack-item"){return Yn.getElements(a)}static getGridElement(a){return vi.getElement(a)}static getGridElements(a){return Yn.getElements(a)}_initMargin(){let a,i=0,k=[];typeof this.opts.margin=="string"&&(k=this.opts.margin.split(" ")),k.length===2?(this.opts.marginTop=this.opts.marginBottom=k[0],this.opts.marginLeft=this.opts.marginRight=k[1]):k.length===4?(this.opts.marginTop=k[0],this.opts.marginRight=k[1],this.opts.marginBottom=k[2],this.opts.marginLeft=k[3]):(a=Yn.parseHeight(this.opts.margin),this.opts.marginUnit=a.unit,i=this.opts.margin=a.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(g=>{this.opts[g]===void 0?this.opts[g]=i:(a=Yn.parseHeight(this.opts[g]),this.opts[g]=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 ad}static setupDragIn(a,i,k,j=document){(i==null?void 0:i.pause)!==void 0&&(Fi.pauseDrag=i.pause),i={appendTo:"body",helper:"clone",...i||{}},(typeof a=="string"?Yn.getElements(a,j):a).forEach((g,m)=>{ad.isDraggable(g)||ad.dragIn(g,i),k!=null&&k[m]&&(g.gridstackNode=k[m])})}movable(a,i){return this.opts.staticGrid?this:(vi.getElements(a).forEach(k=>{const j=k.gridstackNode;j&&(i?delete j.noMove:j.noMove=!0,this.prepareDragDrop(j.el))}),this)}resizable(a,i){return this.opts.staticGrid?this:(vi.getElements(a).forEach(k=>{const j=k.gridstackNode;j&&(i?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,i=!0){return this.opts.staticGrid?this:(a?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(k=>{this.prepareDragDrop(k.el),k.subGrid&&i&&k.subGrid.enableMove(a,i)}),this)}enableResize(a,i=!0){return this.opts.staticGrid?this:(a?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(k=>{this.prepareDragDrop(k.el),k.subGrid&&i&&k.subGrid.enableResize(a,i)}),this)}cancelDrag(){var a;const i=(a=this._placeholder)==null?void 0:a.gridstackNode;i&&(i._isExternal?(i._isAboutToRemove=!0,this.engine.removeNode(i)):i._isAboutToRemove&&vi._itemRemoving(i.el,!1),this.engine.restoreInitial())}_removeDD(a){return ad.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 ad.droppable(this.el,"destroy"),this;let a,i;const k=(j,g,m)=>{var n;m=m||g;const f=m.gridstackNode;if(!f)return;if(!((n=f.grid)!=null&&n.el)){m.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const v=m.getBoundingClientRect();m.style.left=v.x+(this.dragTransform.xScale-1)*(j.clientX-v.x)/this.dragTransform.xScale+"px",m.style.top=v.y+(this.dragTransform.yScale-1)*(j.clientY-v.y)/this.dragTransform.yScale+"px",m.style.transformOrigin="0px 0px"}let{top:l,left:t}=m.getBoundingClientRect();const _=this.el.getBoundingClientRect();t-=_.left,l-=_.top;const b={position:{top:l*this.dragTransform.xScale,left:t*this.dragTransform.yScale}};if(f._temporaryRemoved){if(f.x=Math.max(0,Math.round(t/i)),f.y=Math.max(0,Math.round(l/a)),delete f.autoPosition,this.engine.nodeBoundFix(f),!this.engine.willItFit(f)){if(f.autoPosition=!0,!this.engine.willItFit(f)){ad.off(g,"drag");return}f._willFitPos&&(Yn.copyPos(f,f._willFitPos),delete f._willFitPos)}this._onStartMoving(m,j,b,f,i,a)}else this._dragOrResize(m,j,b,f,i,a)};return ad.droppable(this.el,{accept:j=>{const g=j.gridstackNode||this._readAttr(j,!1);if((g==null?void 0:g.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let m=!0;if(typeof this.opts.acceptWidgets=="function")m=this.opts.acceptWidgets(j);else{const n=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;m=j.matches(n)}if(m&&g&&this.opts.maxRow){const n={w:g.w,h:g.h,minW:g.minW,minH:g.minH};m=this.engine.willItFit(n)}return m}}).on(this.el,"dropover",(j,g,m)=>{let n=(m==null?void 0:m.gridstackNode)||g.gridstackNode;if((n==null?void 0:n.grid)===this&&!n._temporaryRemoved)return!1;if(n!=null&&n._sidebarOrig&&(n.w=n._sidebarOrig.w,n.h=n._sidebarOrig.h),n!=null&&n.grid&&n.grid!==this&&!n._temporaryRemoved&&n.grid._leave(g,m),m=m||g,i=this.cellWidth(),a=this.getCellHeight(!0),!n){const t=m.getAttribute("data-gs-widget")||m.getAttribute("gridstacknode");if(t){try{n=JSON.parse(t)}catch{console.error("Gridstack dropover: Bad JSON format: ",t)}m.removeAttribute("data-gs-widget"),m.removeAttribute("gridstacknode")}n||(n=this._readAttr(m)),n._sidebarOrig={w:n.w,h:n.h}}n.grid||(n.el||(n={...n}),n._isExternal=!0,m.gridstackNode=n);const f=n.w||Math.round(m.offsetWidth/i)||1,l=n.h||Math.round(m.offsetHeight/a)||1;return n.grid&&n.grid!==this?(g._gridstackNodeOrig||(g._gridstackNodeOrig=n),g.gridstackNode=n={...n,w:f,h:l,grid:this},delete n.x,delete n.y,this.engine.cleanupNode(n).nodeBoundFix(n),n._initDD=n._isExternal=n._temporaryRemoved=!0):(n.w=f,n.h=l,n._temporaryRemoved=!0),vi._itemRemoving(n.el,!1),ad.on(g,"drag",k),k(j,g,m),!1}).on(this.el,"dropout",(j,g,m)=>{const n=(m==null?void 0:m.gridstackNode)||g.gridstackNode;return n&&(!n.grid||n.grid===this)&&(this._leave(g,m),this._isTemp&&this.removeAsSubGrid(n)),!1}).on(this.el,"drop",(j,g,m)=>{var n,f,l;const t=(m==null?void 0:m.gridstackNode)||g.gridstackNode;if((t==null?void 0:t.grid)===this&&!t._isExternal)return!1;const _=!!this.placeholder.parentElement,b=g!==m;this.placeholder.remove(),delete this.placeholder.gridstackNode,_&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const v=g._gridstackNodeOrig;if(delete g._gridstackNodeOrig,_&&v!=null&&v.grid&&v.grid!==this){const o=v.grid;o.engine.removeNodeFromLayoutCache(v),o.engine.removedNodes.push(v),o._triggerRemoveEvent()._triggerChangeEvent(),o.parentGridNode&&!o.engine.nodes.length&&o.opts.subGridDynamic&&o.removeAsSubGrid()}if(!t||(_&&(this.engine.cleanupNode(t),t.grid=this),(n=t.grid)==null||delete n._isTemp,ad.off(g,"drag"),m!==g?(m.remove(),g=m):g.remove(),this._removeDD(g),!_))return!1;const h=(l=(f=t.subGrid)==null?void 0:f.el)==null?void 0:l.gridstack;return Yn.copyPos(t,this._readAttr(this.placeholder)),Yn.removePositioningStyles(g),b&&(t.content||t.subGridOpts||vi.addRemoveCB)?(delete t.el,g=this.addWidget(t)):(this._prepareElement(g,!0,t),this.el.appendChild(g),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"},v&&v.grid?v:void 0,t),!1}),this}static _itemRemoving(a,i){if(!a)return;const k=a?a.gridstackNode:void 0;!(k!=null&&k.grid)||a.classList.contains(k.grid.opts.removableOptions.decline)||(i?k._isAboutToRemove=!0:delete k._isAboutToRemove,i?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&&!ad.isDroppable(a)&&ad.droppable(a,this.opts.removableOptions).on(a,"dropover",(i,k)=>vi._itemRemoving(k,!0)).on(a,"dropout",(i,k)=>vi._itemRemoving(k,!1)),this):this}prepareDragDrop(a,i=!1){const k=a==null?void 0:a.gridstackNode;if(!k)return;const j=k.noMove||this.opts.disableDrag,g=k.noResize||this.opts.disableResize,m=this.opts.staticGrid||j&&g;if((i||m)&&(k._initDD&&(this._removeDD(a),delete k._initDD),m&&a.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!i))return this;if(!k._initDD){let n,f;const l=(b,v)=>{this.triggerEvent(b,b.target),n=this.cellWidth(),f=this.getCellHeight(!0),this._onStartMoving(a,b,v,k,n,f)},t=(b,v)=>{this._dragOrResize(a,b,v,k,n,f)},_=b=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete k._moving,delete k._resizing,delete k._event,delete k._lastTried;const v=k.w!==k._orig.w,h=b.target;if(!(!h.gridstackNode||h.gridstackNode.grid!==this)){if(k.el=h,k._isAboutToRemove){const o=a.gridstackNode.grid;o._gsEventHandler[b.type]&&o._gsEventHandler[b.type](b,h),o.engine.nodes.push(k),o.removeWidget(a,!0,!0)}else Yn.removePositioningStyles(h),k._temporaryRemoved?(this._writePosAttr(h,k),this.engine.addNode(k)):this._writePosAttr(h,k),this.triggerEvent(b,h);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),b.type==="resizestop"&&(Number.isInteger(k.sizeToContent)&&(k.sizeToContent=k.h),this.resizeToContentCheck(v,k))}};ad.draggable(a,{start:l,stop:_,drag:t}).resizable(a,{start:l,stop:_,resize:t}),k._initDD=!0}return ad.draggable(a,j?"disable":"enable").resizable(a,g?"disable":"enable"),this}_onStartMoving(a,i,k,j,g,m){var n;if(this.engine.cleanNodes().beginUpdate(j),this._writePosAttr(this.placeholder,j),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=j,(n=j.grid)!=null&&n.el)this.dragTransform=Yn.getValuesFromTransformedElement(a);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const f=this.placeholder.closest(".grid-stack");this.dragTransform=Yn.getValuesFromTransformedElement(f)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(j.el=this.placeholder,j._lastUiPosition=k.position,j._prevYPix=k.position.top,j._moving=i.type==="dragstart",j._resizing=i.type==="resizestart",delete j._lastTried,i.type==="dropover"&&j._temporaryRemoved&&(this.engine.addNode(j),j._moving=!0),this.engine.cacheRects(g,m,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),i.type==="resizestart"){const f=this.getColumn()-j.x,l=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-j.y;ad.resizable(a,"option","minWidth",g*Math.min(j.minW||1,f)).resizable(a,"option","minHeight",m*Math.min(j.minH||1,l)).resizable(a,"option","maxWidth",g*Math.min(j.maxW||Number.MAX_SAFE_INTEGER,f)).resizable(a,"option","maxWidthMoveLeft",g*Math.min(j.maxW||Number.MAX_SAFE_INTEGER,j.x+j.w)).resizable(a,"option","maxHeight",m*Math.min(j.maxH||Number.MAX_SAFE_INTEGER,l)).resizable(a,"option","maxHeightMoveUp",m*Math.min(j.maxH||Number.MAX_SAFE_INTEGER,j.y+j.h))}}_dragOrResize(a,i,k,j,g,m){const n={...j._orig};let f,l=this.opts.marginLeft,t=this.opts.marginRight,_=this.opts.marginTop,b=this.opts.marginBottom;const v=Math.round(m*.1),h=Math.round(g*.1);if(l=Math.min(l,h),t=Math.min(t,h),_=Math.min(_,v),b=Math.min(b,v),i.type==="drag"){if(j._temporaryRemoved)return;const s=k.position.top-j._prevYPix;j._prevYPix=k.position.top,this.opts.draggable.scroll!==!1&&Yn.updateScrollPosition(a,k.position,s);const p=k.position.left+(k.position.left>j._lastUiPosition.left?-t:l),c=k.position.top+(k.position.top>j._lastUiPosition.top?-b:_);n.x=Math.round(p/g),n.y=Math.round(c/m);const d=this._extraDragRow;if(this.engine.collide(j,n)){const x=this.getRow();let w=Math.max(0,n.y+j.h-x);this.opts.maxRow&&x+w>this.opts.maxRow&&(w=Math.max(0,this.opts.maxRow-x)),this._extraDragRow=w}else this._extraDragRow=0;if(this._extraDragRow!==d&&this._updateContainerHeight(),j.x===n.x&&j.y===n.y)return}else if(i.type==="resize"){if(n.x<0||(Yn.updateScrollResize(i,a,m),n.w=Math.round((k.size.width-l)/g),n.h=Math.round((k.size.height-_)/m),j.w===n.w&&j.h===n.h)||j._lastTried&&j._lastTried.w===n.w&&j._lastTried.h===n.h)return;const s=k.position.left+l,p=k.position.top+_;n.x=Math.round(s/g),n.y=Math.round(p/m),f=!0}j._event=i,j._lastTried=n;const o={x:k.position.left+l,y:k.position.top+_,w:(k.size?k.size.width:j.w*g)-l-t,h:(k.size?k.size.height:j.h*m)-_-b};if(this.engine.moveNodeCheck(j,{...n,cellWidth:g,cellHeight:m,rect:o,resizing:f})){j._lastUiPosition=k.position,this.engine.cacheRects(g,m,_,t,b,l),delete j._skipDown,f&&j.subGrid&&j.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const s=i.target;j._sidebarOrig||this._writePosAttr(s,j),this.triggerEvent(i,s)}}triggerEvent(a,i){let k=this;for(;k.parentGridNode;)k=k.parentGridNode.grid;k._gsEventHandler[a.type]&&k._gsEventHandler[a.type](a,i)}_leave(a,i){i=i||a;const k=i.gridstackNode;if(!k||(i.style.transform=i.style.transformOrigin=null,ad.off(a,"drag"),k._temporaryRemoved))return;k._temporaryRemoved=!0,this.engine.removeNode(k),k.el=k._isExternal&&i?i:a;const j=k._sidebarOrig;k._isExternal&&this.engine.cleanupNode(k),k._sidebarOrig=j,this.opts.removable===!0&&vi._itemRemoving(a,!0),a._gridstackNodeOrig?(a.gridstackNode=a._gridstackNodeOrig,delete a._gridstackNodeOrig):k._isExternal&&this.engine.restoreInitial()}commit(){return K5e(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}vi.renderCB=(e,a)=>{e&&a!=null&&a.content&&(e.textContent=a.content)},vi.resizeToContentParent=".grid-stack-item-content",vi.Utils=Yn,vi.Engine=Mh,vi.GDRev="12.3.2";const D5e=[{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}],jh=e=>D5e.find(a=>a.id===e),Wh=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 H0{constructor(a,i=[],k,j=null,g=!1,m=!1,n=null,f=null,l=null){Tp(this,"id",""),Tp(this,"childViews",[]),Tp(this,"viewId",0),Tp(this,"dynamicFilters",null),Tp(this,"componentSpecificFilters",new Map),Tp(this,"isPostMatch",!1),Tp(this,"isTemplateMode",!1),Tp(this,"filtresJSON",null),Tp(this,"token",null),Tp(this,"_isUpdating",!1),Tp(this,"filters",null),this.id=a,this.viewId=k,this.childViews=i,this.dynamicFilters=j,this.isPostMatch=g,this.isTemplateMode=m,this.filtresJSON=n,this.token=f,this.filters=l,this.componentSpecificFilters=new Map}resetClass(){this.childViews.forEach(a=>{a.view.filterAndViewsContainer=new H0(this.id,[a],this.viewId,this.dynamicFilters,this.isPostMatch,this.isTemplateMode,this.filtresJSON,this.token,this.filters)})}hasEventTypeId(a,i){return!a||!Array.isArray(a)?!1:a.some(k=>k&&k.event_type_id===i)}hasCategoryId(a,i){return!a||!Array.isArray(a)?!1:a.some(k=>k&&k.category_id===i)}getId(){return this.id}setViewId(a){this.viewId=a}setFiltersJSON(a){this.filtresJSON=a}setDynamicFilters(a,i=null){i?this.componentSpecificFilters.set(i,[...a]):this.dynamicFilters=a}setFilters(a){this.filters=a}getComponentDynamicFilters(a){return a&&this.componentSpecificFilters.has(a)?this.componentSpecificFilters.get(a):this.dynamicFilters}getAllComponentFilters(){return this.componentSpecificFilters}debugComponentFilters(){}static debugAllComponentFilters(){}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)}addLastTouch(a){if(a.view.componentProps&&this.filters){let i=null;const k=this.filters.selectedCategories.map(g=>g.value),j=this.filters.selectedTeam.value;if(j===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(f=>{f.view.componentProps.isHomeTeamForAnalysis=!0,f.view.isHomeTeam=!0,f.view.filterMultiple&&(f.view.filterMultiple.isHomeTeam=!0)});const g=this.getHomeTeamViews(),m=this.getAwayTeamViews();let n=!0;for(let f=0;f<k.length;f++){i=k[f];const l=g.find(_=>_.view.componentProps.categories[0].name===i.name),t=m.find(_=>_.view.componentProps.categories[0].name===i.name);if(!l||!t){n=!l;break}}n?this.childViews.length===0?(a.view.componentProps.categories=[i],a.view.componentProps.analysisType=this.filters.selectedGamePhase.name,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,a.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,a.view.title=i.name,a.view.titleShort=i.name,a.view.isHomeTeam=!0,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:i,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):this.childViews.reduce((f,l,t,_)=>{let b={categories:l.view.componentProps.categories,analysisType:l.view.componentProps.analysisType,isAssistZoneVisible:this.filters.isAssistZoneVisible,howManyGames:this.filters.howManyGamesSelected.value,title:l.view.title,isHomeTeamForAnalysis:l.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:l.view.isHomeTeam};return f&&(f.isHomeTeam&&!l.view.isHomeTeam?(l.view.componentProps.categories=[i],l.view.componentProps.analysisType=this.filters.selectedGamePhase.name,l.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,l.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,l.view.componentProps.isHomeTeamForAnalysis=!0,l.view.title=i.name,a.view.titleShort=i.name,l.view.isHomeTeam=!0,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:i,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):!f.isHomeTeam&&!l.view.isHomeTeam&&(l.view.componentProps.categories=f.categories,l.view.componentProps.analysisType=f.analysisType,l.view.componentProps.isHomeTeamForAnalysis=f.isHomeTeamForAnalysis,l.view.componentProps.isAssistZoneVisible=f.isAssistZoneVisible,l.view.componentProps.howManyGames=f.howManyGames,l.view.title=f.title,l.view.titleShort=f.titleShort,l.view.isHomeTeam=f.isHomeTeam,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:l.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}),t===_.length-1&&(a.view.componentProps.categories=b.categories,a.view.componentProps.analysisType=b.analysisType,a.view.componentProps.isHomeTeamForAnalysis=b.isHomeTeamForAnalysis,a.view.componentProps.isAssistZoneVisible=b.isAssistZoneVisible,a.view.componentProps.howManyGames=b.howManyGames,a.view.title=b.title,a.view.titleShort=b.titleShort,a.view.isHomeTeam=b.isHomeTeam,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:a.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})),b},null):(a.view.componentProps.categories=[i],a.view.componentProps.analysisType=this.filters.selectedGamePhase.name,a.view.componentProps.isHomeTeamForAnalysis=!1,a.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,a.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,a.view.title=i.name,a.view.titleShort=i.name,a.view.isHomeTeam=!1,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:i,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})}else{const g=j===1,m=g?this.getHomeTeamViews():this.getAwayTeamViews();a.view.componentProps.isHomeTeamForAnalysis=g,a.view.isHomeTeam=g;for(let n=0;n<k.length;n++){const f=k[n];if(!m.find(l=>l.view.componentProps.categories[0].name===f.name)){a.view.componentProps.categories=[f],a.view.componentProps.analysisType=this.filters.selectedGamePhase.name,a.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,a.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,a.view.title=f.name,a.view.titleShort=f.name,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:f,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible};break}}}}}addView(a,i=!1){var k,j,g,m,n,f,l,t,_,b;if(a.view.filterAndViewsContainer=this,qa.emit("component-added-to-container",this),this.viewId===5&&a.view.componentProps&&!i&&(a.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,a.view.filterMultiple={isHomeTeam:a.view.componentProps.preMatchType===1}),this.viewId===15&&a.view.componentProps&&!i&&(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&&!i&&(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&&!i){const v=this.getComponentDynamicFilters(a.view.id),h=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const o=h[0]===1?"offensive":"defensive",s=h[1]===1;a.view.componentProps.analysisType=o,a.view.componentProps.isHomeTeamForAnalysis=s,a.isHomeTeam=s,a.view.filterMultiple={isHomeTeam:s},qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:h})}if(this.viewId===1&&a.view.componentProps&&!i){const v=this.dynamicFilters[0]||[];if(v&&v.length>0){let h;if(Array.isArray(v)){const s=this.childViews.map(c=>{var d;return(d=c.view.componentProps)==null?void 0:d.type}).filter(c=>c!==void 0),p=v.filter(c=>!s.includes(c));p.length>0?h=p[0]:h=v[0]}else h=v;const o=Wh.get(this.viewId);a.view.componentProps.type=h,a.view.componentProps.default=!1,a.view.title=`Comparativa ${o[h]}`,a.view.filterMultiple={category:h}}}if(this.viewId===9&&a.view.componentProps&&!i){const v=this.dynamicFilters[0].map(p=>p.join("-"));let h="";const o=this.dynamicFilters[1],s=Wh.get(this.viewId);if(o===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(w=>{w.view.componentProps.isHomeTeamForAnalysis=!0,w.view.isHomeTeam=!0,w.view.filterMultiple&&(w.view.filterMultiple.isHomeTeam=!0)});let p=null;const c=this.getHomeTeamViews(),d=this.getAwayTeamViews();let x=!0;for(let w=0;w<v.length;w++){h=v[w],p=s.analysisTypes.get(v[w]);const S=c.find(O=>O.view.componentProps.analysisType===p.analysisType),V=d.find(O=>O.view.componentProps.analysisType===p.analysisType);if(!S||!V){x=!S;break}}x?this.childViews.length===0?(a.view.componentProps.analysisType=p.analysisType,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.title=p.title,a.view.titleShort=p.titleShort,a.view.isHomeTeam=!0,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:h.split("-").map(w=>parseInt(w))}):this.childViews.reduce((w,S,V,O)=>{let U={analysisType:S.view.componentProps.analysisType,title:S.view.title,isHomeTeamForAnalysis:S.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:S.view.isHomeTeam};return w&&(w.isHomeTeam&&!S.view.isHomeTeam?(S.view.componentProps.analysisType=p.analysisType,S.view.componentProps.isHomeTeamForAnalysis=!0,S.view.title=p.title,a.view.titleShort=p.titleShort,S.view.isHomeTeam=!0,S.view.filterMultiple={isHomeTeam:S.view.isHomeTeam,categoryIds:h.split("-").map(z=>parseInt(z))}):!w.isHomeTeam&&!S.view.isHomeTeam&&(S.view.componentProps.analysisType=w.analysisType,S.view.componentProps.isHomeTeamForAnalysis=w.isHomeTeamForAnalysis,S.view.title=w.title,S.view.titleShort=w.titleShort,S.view.isHomeTeam=w.isHomeTeam,S.view.filterMultiple={isHomeTeam:S.view.isHomeTeam,categoryIds:h.split("-").map(z=>parseInt(z))}),V===O.length-1&&(a.view.componentProps.analysisType=U.analysisType,a.view.componentProps.isHomeTeamForAnalysis=U.isHomeTeamForAnalysis,a.view.title=U.title,a.view.titleShort=U.titleShort,a.view.isHomeTeam=U.isHomeTeam,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:h.split("-").map(z=>parseInt(z))})),U},null):(a.view.componentProps.analysisType=p.analysisType,a.view.componentProps.isHomeTeamForAnalysis=!1,a.view.title=p.title,a.view.titleShort=p.titleShort,a.view.isHomeTeam=!1,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:h.split("-").map(w=>parseInt(w))})}else{const p=o===1,c=p?this.getHomeTeamViews():this.getAwayTeamViews();a.view.componentProps.isHomeTeamForAnalysis=p,a.view.isHomeTeam=p;for(let d=0;d<v.length;d++){const x=s.analysisTypes.get(v[d]);if(!c.find(w=>w.view.componentProps.analysisType===x.analysisType)){a.view.componentProps.analysisType=x.analysisType,a.view.title=x.title,a.view.titleShort=x.titleShort,a.view.filterMultiple={categoryIds:v[d].split("-").map(w=>parseInt(w)),isHomeTeam:a.view.isHomeTeam};break}}}}if(this.viewId===2&&!i&&a.view.componentProps){const v=this.getComponentDynamicFilters(a.view.id),h=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id),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 o=this.dynamicFilters[0]||[];let s=null;if(Array.isArray(o)){if(o.length>0){const d=this.childViews.map(w=>{var S;const V=(S=w.view.componentProps)==null?void 0:S.categoryView;return V&&V.length>0?V[0].id:null}).filter(w=>w!==null),x=o.filter(w=>!d.includes(w));x.length>0&&(s=x[0])}}else{const d=o;d&&(this.childViews.find(x=>{var w;const S=(w=x.view.componentProps)==null?void 0:w.categoryView;return S&&S.length>0&&S[0].id===d})||(s=d))}let p=null;if(s)try{p=jh(s)}catch{}const c=h&&h.length>1?h[1]:1;a.view.filterMultiple={categoryId:s,teamType:c},a.view.componentProps.categoryView=p?[{id:s,name:p.name}]:s?[{id:s,name:`Category ${s}`}]:[{id:0,name:"Category"}]}if(this.viewId===8&&a.view.componentProps&&!i&&a.view.game&&(a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0),a.view.componentProps.areInactiveVisible=this.dynamicFilters[0]||!1,a.view.componentProps.game=(k=a.view)==null?void 0:k.game,a.view.componentProps.teamSelected={teamId:(g=(j=a.view)==null?void 0:j.game)==null?void 0:g.home_team},a.view.componentProps.isDefault=!1,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:this.dynamicFilters})),this.viewId===13&&a.view.componentProps&&!i&&(a.view.componentProps.isdefault=!0,a.view.componentProps.seasonid=2010,a.view.teamids=[1,2],a.view.componentProps.categoryids=[20,2],a.view.componentProps.teamsshow=[1,2],a.view.componentProps.analysistype=1,a.view.componentProps.gameid="",a.view.componentProps.teams=[],a.view.componentProps.game=""),this.viewId===15&&a.view.componentProps&&!i&&(a.view.componentProps.isdefault=!0,a.view.componentProps.view=1,a.view.numitems=3,a.view.typegame=1,a.view.componentProps.token=this.token,a.view.componentProps.data={season:2010,type:2,team:14}),this.viewId===14&&a.view.componentProps&&!i&&(a.view.componentProps.isReports=!0,a.view.componentProps.isDefault=!0,a.view.componentProps.type=0,a.view.componentProps.typeView=1,a.view.componentProps.showVideos=!1,a.view.componentProps.currentSeason=2010,a.view.componentProps.localTeam=2,a.view.componentProps.awayTeam=1),this.viewId===6&&a.view.componentProps&&!i){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const v=this.getComponentDynamicFilters(a.view.id),h=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const o=h&&h.length>0?h[0]:[];if(o&&o.length>0){let s=0;for(const p of o)if(!this.childViews.find(c=>c.view.componentProps.gameNumber===p)){s=p;break}s&&(a.view.componentProps.gameNumber=s,a.view.filterMultiple={gameNumber:s})}qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:h})}if(this.viewId===3&&a.view.componentProps&&!i&&a.view.game){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const v=this.getComponentDynamicFilters(a.view.id),h=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const o=h&&h.length>0?h[0]:!1;a.view.componentProps.desplegable=o,a.view.componentProps.key=o,a.view.componentProps.game=(m=a.view)==null?void 0:m.game,a.view.componentProps.defaultShields=!1,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:h})}if(this.viewId===4&&a.view.componentProps&&!i&&a.view.game){if(a.view.componentProps._isReactive||(a.view.componentProps=r.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=(f=(n=a.view)==null?void 0:n.game)==null?void 0:f.game_id,a.view.componentProps.homeTeam=(t=(l=a.view)==null?void 0:l.game)==null?void 0:t.home_team,a.view.componentProps.awayTeam=(b=(_=a.view)==null?void 0:_.game)==null?void 0:b.visiting_team;const o=this.getComponentDynamicFilters(a.view.id),s=o||this.dynamicFilters;!o&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const p=s&&s.length>0?s[0]:[],c=this.hasEventTypeId(p,1),d=this.hasCategoryId(p,8),x=this.hasCategoryId(p,9),w=this.hasEventTypeId(p,3);a.view.componentProps.goals=c,a.view.componentProps.yellowCards=d,a.view.componentProps.redCards=x,a.view.componentProps.substitutions=w}const v=this.getComponentDynamicFilters(a.view.id)||this.dynamicFilters,h=v&&v.length>0?v[0]:[];a.view.componentProps.selectedEvents=h,a.view.componentProps.key=h.length>0,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:v})}this.viewId===16&&this.addLastTouch(a),this.childViews.push(a),qa.emit("view-added")}getHowManyViewsToAdd(a,i=null){if(this.viewId===5||this.viewId===14||this.viewId===13||this.viewId===15)return 1;if(this.viewId===6){const k=a[0];return k===2||k===3?k:1}if(this.viewId===4)return a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0?1:0;if(this.viewId===9){const k=a[0],j=a[1];if(j===1||j===2){const g=j===1?this.getHomeTeamViews():this.getAwayTeamViews();return k.length-g.length}else return k*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===16&&i){const k=i.selectedCategories||[],j=i.selectedTeam.value;if(j===1||j===2){const g=j===1?this.getHomeTeamViews():this.getAwayTeamViews();return k.length-g.length}else return k.length*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===2){const k=a[0]||[],j=a[1]||1;if(!k||k.length===0)return 0;if(Array.isArray(k)){const g=this.childViews.map(m=>{var n;const f=(n=m.view.componentProps)==null?void 0:n.categoryView;return f&&f.length>0?f[0].id:null}).filter(m=>m!==null);return k.filter(m=>!g.includes(m)).length}else{const g=k;return this.childViews.find(m=>{var n,f;const l=(n=m.view.componentProps)==null?void 0:n.categoryView,t=((f=m.view.filterMultiple)==null?void 0:f.teamType)||1;return l&&l.length>0&&l[0].id===g&&t===j})?0:1}}if(this.viewId===1){const k=a[0]||[];if(!k||k.length===0)return 0;if(Array.isArray(k)){const j=this.childViews.map(g=>{var m;return(m=g.view.componentProps)==null?void 0:m.type}).filter(g=>g!==void 0);return k.filter(g=>!j.includes(g)).length}else{const j=k;return this.childViews.find(g=>{var m;return((m=g.view.componentProps)==null?void 0:m.type)===j})?0:1}}return 0}getRequiresAddView(a,i){if(this.viewId===5)return a[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===15)return 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 k=a[0];return k?k.length>this.childViews.length:this.childViews.length===0}if(this.viewId===4){const k=a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0;return this.childViews.length===0&&k}if(this.viewId===9)return this.getRequiresAddViewMultipleAndBothTeams(a);if(this.viewId===16&&i){const k=[i.selectedCategories,i.selectedTeam.value];return this.getRequiresAddViewMultipleAndBothTeams(k,i.totalCategoriesSelected)}if(this.viewId===1){const k=a[0]||[];if(!k||k.length===0)return!1;if(Array.isArray(k)){const j=this.childViews.map(g=>{var m;return(m=g.view.componentProps)==null?void 0:m.type}).filter(g=>g!==void 0);return k.filter(g=>!j.includes(g)).length>0}else{const j=k;return!this.childViews.find(g=>{var m;return((m=g.view.componentProps)==null?void 0:m.type)===j})}}if(this.viewId===2){const k=a[0]||[];if(Array.isArray(k)){if(k.length>0){const j=this.childViews.map(g=>{var m;const n=(m=g.view.componentProps)==null?void 0:m.categoryView;return n&&n.length>0?n[0].id:null}).filter(g=>g!==null);return k.filter(g=>!j.includes(g)).length>0}return!1}else{const j=k,g=a[1]||1;return j?!this.childViews.find(m=>{var n,f;const l=(n=m.view.componentProps)==null?void 0:n.categoryView,t=((f=m.view.filterMultiple)==null?void 0:f.teamType)||1;return l&&l.length>0&&l[0].id===j&&t===g}):!1}}return this.viewId===8||this.viewId===3||this.viewId===14?this.childViews.length===0:!1}getRequiresAddViewMultipleAndBothTeams(a,i=null){const k=this.childViews.filter(l=>l.view.isHomeTeam),j=this.childViews.filter(l=>!l.view.isHomeTeam),g=i||a[0].length,m=a[1],n=g*(m===1||m===2?1:2),f=m===3?k.length+j.length:k.length||j.length;return n>f}getRequiresLessViews(a){if(this.viewId===5)return a[0]!==3&&this.childViews.length>1;if(this.viewId===15)return a[0]!==3&&this.childViews.length>1;if(this.viewId===6){const i=a[0];return i===2||i===3}return this.viewId,!1}updateSummary({dynamicFilters:a}){const i=this.childViews[0],k=document.querySelector(`[gs-id="${i.view.id}"]`),j=i.grid;if(i&&k&&j){const g=a[0],m=`min_column${g?"_2":""}`,n=`min_row${g?"_2":""}`,f=`max_column${g?"_2":""}`,l=`max_row${g?"_2":""}`,t=`colspan${g?"_2":""}`,_=`rowspan${g?"_2":""}`,b=i.view.coreView[t],v=i.view.coreView[_],h=i.view.coreView[m],o=i.view.coreView[n],s=i.view.coreView[f],p=i.view.coreView[l];i.view.w=b,i.view.h=v,i.view.maxWidth=s,i.view.maxHeight=p,i.view.minWidth=h,i.view.minHeight=o,k.setAttribute("gs-w",b),k.setAttribute("gs-h",v),k.setAttribute("gs-max-w",s),k.setAttribute("gs-max-h",p),k.setAttribute("gs-min-w",h),k.setAttribute("gs-min-h",o),j.update(k,{h:v,w:b,"gs-max-h":p,"gs-max-w":s,"gs-min-h":o,"gs-min-w":h})}}updateFilters(a){this.filters=a,this.viewId===16&&this.updateLastTouchFilters(a)}updateDynamicFilters(a,i=null){if(!this._isUpdating){this._isUpdating=!0,i?this.componentSpecificFilters.set(i,[...a]):this.dynamicFilters=a,qa.emit("component-added-to-container",this);try{if(this.viewId===5){const k=a[0]||1;if(k<3)if(this.childViews.length===1){const j=this.childViews[0];j.view.componentProps&&(j.view.componentProps.preMatchType=k,j.view.filterMultiple={isHomeTeam:j.view.componentProps.preMatchType===1})}else{const j=this.childViews.pop(),g=j.grid,m=j.page,n=document.querySelector(`[gs-id="${j.view.id}"]`);if(g&&n&&(g.removeWidget(n),m)){const l=m.items.findIndex(t=>t.id===j.view.id);l!==-1&&m.items.splice(l,1)}const f=this.childViews[0];f.view.componentProps&&(f.view.componentProps.preMatchType=k,f.view.filterMultiple={isHomeTeam:f.view.componentProps.preMatchType})}else this.childViews.forEach((j,g)=>{j.view.componentProps.preMatchType=g+1,j.view.filterMultiple={isHomeTeam:j.view.componentProps.preMatchType}})}if(this.viewId===15){const k=a[0]||1;if(i){const j=this.childViews.find(g=>g.view.id===i);j&&j.view.componentProps&&(j.view.componentProps.preMatchType=k,j.view.filterMultiple={isHomeTeam:k===1})}else if(k<3){if(this.childViews.length===1){const j=this.childViews[0];j.view.componentProps&&(j.view.componentProps.preMatchType=k,j.view.filterMultiple={isHomeTeam:k===1})}else if(this.childViews.length>1){for(;this.childViews.length>1;){const g=this.childViews.pop(),m=g.grid,n=g.page,f=document.querySelector(`[gs-id="${g.view.id}"]`);if(m&&f&&(m.removeWidget(f),n)){const l=n.items.findIndex(t=>t.id===g.view.id);l!==-1&&n.items.splice(l,1)}}const j=this.childViews[0];j.view.componentProps&&(j.view.componentProps.preMatchType=k,j.view.filterMultiple={isHomeTeam:k===1})}}else if(this.childViews.length===2)this.childViews.forEach((j,g)=>{j.view.componentProps&&(j.view.componentProps.preMatchType=g+1,j.view.filterMultiple={isHomeTeam:g===0})});else if(this.childViews.length<2)this.childViews.forEach((j,g)=>{j.view.componentProps&&(j.view.componentProps.preMatchType=g+1,j.view.filterMultiple={isHomeTeam:g===0})});else{for(;this.childViews.length>2;){const j=this.childViews.pop(),g=j.grid,m=j.page,n=document.querySelector(`[gs-id="${j.view.id}"]`);if(g&&n&&(g.removeWidget(n),m)){const f=m.items.findIndex(l=>l.id===j.view.id);f!==-1&&m.items.splice(f,1)}}this.childViews.forEach((j,g)=>{j.view.componentProps&&(j.view.componentProps.preMatchType=g+1,j.view.filterMultiple={isHomeTeam:g===0})})}}if(this.viewId===10){const k=a[0]||1;if(k<3)if(this.childViews.length===1){const j=this.childViews[0];j.view.componentProps&&(j.view.componentProps.isHomeTeamForAnalysis=k===1,j.view.filterMultiple={isHomeTeam:j.view.componentProps.isHomeTeamForAnalysis})}else{const j=this.childViews.pop(),g=j.grid,m=j.page,n=document.querySelector(`[gs-id="${j.view.id}"]`);if(g&&n&&(g.removeWidget(n),m)){const l=m.items.findIndex(t=>t.id===j.view.id);l!==-1&&m.items.splice(l,1)}const f=this.childViews[0];f.view.componentProps&&(f.view.componentProps.isHomeTeamForAnalysis=k===1,f.view.filterMultiple={isHomeTeam:f.view.componentProps.isHomeTeamForAnalysis})}else this.childViews.forEach((j,g)=>{j.view.componentProps.isHomeTeamForAnalysis=g%2===0,j.view.filterMultiple={isHomeTeam:j.view.componentProps.isHomeTeamForAnalysis}})}if(this.viewId===7){const k=a[1];if(k===3)this.childViews.forEach((j,g)=>{j.view.componentProps.isHomeTeamForAnalysis=g%2===0,j.view.isHomeTeam=g%2===0,j.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",j.view.filterMultiple={isHomeTeam:j.view.isHomeTeam}});else{const j=k===1;if(this.childViews.length>0){const g=this.childViews[0];g.view.componentProps.isHomeTeamForAnalysis=j,g.view.isHomeTeam=j,g.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",g.view.filterMultiple={isHomeTeam:j},this.childViews.length>1&&this.removeChildView(this.childViews[1])}}}if(this.viewId===9){const k=a[0],j=a[1];if(j===3){if(this.childViews.length>k.length){const g=k.map(m=>{const n=m.join("-");return Wh.get(this.viewId).analysisTypes.get(n).analysisType});this.childViews.reduce((m,n)=>(g.includes(n.view.componentProps.analysisType)||m.push(n.view.componentProps.analysisType),m),[]).forEach(m=>{const n=this.childViews.findIndex(f=>f.view.componentProps.analysisType===m);if(n!==-1){const f=this.childViews[n];this.removeChildView(f)}})}}else{const g=j===1,m=this.getHomeTeamViews(),n=this.getAwayTeamViews();if(g&&m.length===0)n.forEach(f=>{f.view.componentProps.isHomeTeamForAnalysis=g,f.view.isHomeTeam=g,f.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}});else if(!g&&n.length===0)m.forEach(f=>{f.view.componentProps.isHomeTeamForAnalysis=g,f.view.isHomeTeam=g,f.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}});else if(m.length===n.length)g||m.forEach(f=>{f.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}}),(g?n:m).forEach(f=>{this.removeChildView(f)});else{const f=g?this.getHomeTeamViews():this.getAwayTeamViews();if(f.length>k.length){const l=k.map(t=>{const _=t.join("-");return Wh.get(this.viewId).analysisTypes.get(_).analysisType});f.forEach(t=>{l.includes(t.view.componentProps.analysisType)?t.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}:this.removeChildView(t)})}else f.forEach(l=>{l.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}})}}}if(this.viewId===2){const k=a[0]||[];if(Array.isArray(k)){const j=this.childViews.map(g=>{var m,n;const f=(m=g.view.componentProps)==null?void 0:m.categoryView,l=((n=g.view.filterMultiple)==null?void 0:n.teamType)||1,t=f&&f.length>0?f[0].id:null;return t?{categoryId:t,teamType:l,viewId:g.view.id}:null}).filter(g=>g!==null);if(i){const g=this.childViews.find(m=>m.view.id===i);if(g){const m=a[1]||1,n=k[0];if(n){let f=null;try{f=jh(n)}catch{}g.view.filterMultiple={categoryId:n,teamType:m},g.view.componentProps.game&&(m===1?g.view.componentProps.teamView=g.view.componentProps.game.homeTeam.team_id:m===2?g.view.componentProps.teamView=g.view.componentProps.game.awayTeam.team_id:g.view.componentProps.teamView=0),g.view.componentProps.categoryView=f?[{id:n,name:f.name}]:[{id:n,name:`Category ${n}`}]}}}if(!i){const g=a[1]||1;this.childViews.forEach(m=>{var n;const f=(n=m.view.componentProps)==null?void 0:n.categoryView;if(f&&f.length>0){const l=f[0].id;k.includes(l)&&(m.view.filterMultiple={categoryId:l,teamType:g})}})}if(j.map(g=>g.categoryId).filter(g=>!k.includes(g)).forEach(g=>{this.childViews.filter(m=>{var n;const f=(n=m.view.componentProps)==null?void 0:n.categoryView;return f&&f.length>0&&f[0].id===g}).forEach(m=>{this.removeChildView(m),qa.emit("component-removed",{viewId:m.view.id,categoryId:g})})}),i){const g=k[0];if(g){const m=this.childViews.find(n=>n.view.id===i);if(m){let n=null;try{n=jh(g)}catch{}const f=a[1]||1;m.view.filterMultiple={categoryId:g,teamType:f},m.view.componentProps.game&&(m.view.componentProps.teamView=f===2?m.view.componentProps.game.awayTeam.team_id:f===1?m.view.componentProps.game.homeTeam.team_id:0),m.view.componentProps.categoryView=n?[{id:g,name:n.name}]:[{id:g,name:`Category ${g}`}]}}}}else{const j=k;if(j&&i){const g=this.childViews.find(m=>m.view.id===i);if(g){let m=null;try{m=jh(j)}catch{}const n=a[1]||1;g.view.filterMultiple={categoryId:j,teamType:n},g.view.componentProps.game&&(g.view.componentProps.teamView=n===2?g.view.componentProps.game.awayTeam.team_id:n===1?g.view.componentProps.game.homeTeam.team_id:0),g.view.componentProps.categoryView=m?[{id:j,name:m.name}]:[{id:j,name:`Category ${j}`}]}}}}if(this.viewId===8){const k=a[0]||!1;this.childViews.forEach(j=>{j.view.componentProps&&(j.view.componentProps._isReactive||(j.view.componentProps=r.reactive(j.view.componentProps),j.view.componentProps._isReactive=!0),j.view.componentProps.areInactiveVisible=k,j.view.componentProps.key=k,qa.emit("component-props-updated",{viewId:j.view.id,componentProps:j.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:j.view.id,dynamicFilters:a}))})}if(this.viewId===1){const k=a[0]||[];if(i){this.setDynamicFilters(a,i);const j=this.childViews.find(g=>g.view.id===i);j&&this.updateComparative(j,a)}else if(this.childViews.reduce((j,g)=>(k.includes(g.view.componentProps.type)||j.push(g.view.componentProps.type),j),[]).forEach(j=>{const g=this.childViews.findIndex(m=>m.view.componentProps.type===j);if(g!==-1){for(let m=g;m<this.childViews.length;m++){const n=this.childViews[m+1],f=this.childViews[m];n&&(f.view.componentProps.type=n.view.componentProps.type,f.view.title=n.view.title)}this.removeChildView(this.childViews[this.childViews.length-1])}}),Array.isArray(k))this.childViews.length>0&&k.length>0&&this.childViews.forEach((j,g)=>{if(j.view.componentProps&&g<k.length){const m=k[g],n=Wh.get(this.viewId);j.view.componentProps.type=m,j.view.componentProps.default=!1,j.view.title=`Comparativa ${n[m]}`,j.view.filterMultiple={category:m}}});else{const j=k;if(j&&this.childViews.length>0){const g=this.childViews[0];if(g.view.componentProps){const m=Wh.get(this.viewId);g.view.componentProps.type=j,g.view.componentProps.default=!1,g.view.title=`Comparativa ${m[j]}`,g.view.filterMultiple={category:j}}}}}if(this.viewId===6){const k=a[0]||[];if(i){this.setDynamicFilters(a,i);const j=this.childViews.find(g=>g.view.id===i);j&&this.updateGSCLineupsReports(j,a)}else{if(Array.isArray(k))if(k.length===0)for(;this.childViews.length>0;)this.removeChildView(this.childViews[0]);else this.childViews.reduce((j,g)=>(k.includes(g.view.componentProps.gameNumber)||j.push(g.view.componentProps.gameNumber),j),[]).forEach(j=>{const g=this.childViews.findIndex(m=>m.view.componentProps.gameNumber===j);if(g!==-1){for(let m=g;m<this.childViews.length;m++){const n=this.childViews[m+1],f=this.childViews[m];n&&(f.view.componentProps.gameNumber=n.view.componentProps.gameNumber,f.view.filterMultiple={gameNumber:n.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=r.reactive(j.view.componentProps),j.view.componentProps._isReactive=!0),qa.emit("component-props-updated",{viewId:j.view.id,componentProps:j.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:j.view.id,dynamicFilters:a}))})}}if(this.viewId===3){if(i){this.setDynamicFilters(a,i);const k=this.childViews.find(j=>j.view.id===i);k&&this.updateMatchSummary(k,a)}else{const k=a[0]||!1;this.childViews.forEach(j=>{j.view.componentProps&&(j.view.componentProps._isReactive||(j.view.componentProps=r.reactive(j.view.componentProps),j.view.componentProps._isReactive=!0),j.view.componentProps.desplegable=k,j.view.componentProps.key=k,qa.emit("component-props-updated",{viewId:j.view.id,componentProps:j.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:j.view.id,dynamicFilters:a}))})}this.updateSummary({dynamicFilters:a})}if(this.viewId===13){const k=a[1]||[];if(i){this.setDynamicFilters(a,i);const j=this.childViews.find(g=>g.view.id===i);j&&(j.view.componentProps&&(j.view.componentProps.categoryids=k,j.view.componentProps.analysistype=a[0]||1,j.view.componentProps.teamsshow=a[2]==1?[1]:a[2]==2?[2]:[1,2],j.view.dynamicFilters=a,j.view._updateKey=Date.now()),qa.emit("component-props-updated",{viewId:j.view.id,componentProps:j.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:j.view.id,dynamicFilters:a}))}else this.childViews.forEach(j=>{j.view.componentProps&&(j.view.componentProps._isReactive||(j.view.componentProps=r.reactive(j.view.componentProps),j.view.componentProps._isReactive=!0),j.view.componentProps.categoryids=k,j.view.componentProps.analysistype=a[0]||1,j.view.componentProps.teamsshow=a[2]==1?[1]:a[2]==2?[2]:[1,2],j.view.dynamicFilters=a,j.view._updateKey=Date.now(),qa.emit("component-props-updated",{viewId:j.view.id,componentProps:j.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:j.view.id,dynamicFilters:a}))})}else if(this.viewId===15){const k=a[0]||1,j=a[3]!==void 0?a[3]:typeof a[1]=="number"?a[1]:null;if(i){this.setDynamicFilters(a,i);const g=this.childViews.find(m=>m.view.id===i);g&&g.view.componentProps&&(g.view.componentProps.analysistype=k,j!==null&&(g.view.componentProps.numitems=j),g.view.dynamicFilters=a,g.view._updateKey=Date.now(),qa.emit("component-props-updated",{viewId:g.view.id,componentProps:g.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:g.view.id,dynamicFilters:a}))}else this.childViews.forEach(g=>{g.view.componentProps&&(g.view.componentProps._isReactive||(g.view.componentProps=r.reactive(g.view.componentProps),g.view.componentProps._isReactive=!0),g.view.componentProps.analysistype=k,j!==null&&(g.view.componentProps.numitems=j),g.view.dynamicFilters=a,g.view._updateKey=Date.now(),qa.emit("component-props-updated",{viewId:g.view.id,componentProps:g.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:g.view.id,dynamicFilters:a}))})}if(this.viewId===4){const k=a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0;if(i){const j=this.childViews.find(g=>g.view.id===i);j&&j.view.componentProps.selectedEvents}else if(!k&&this.childViews.length>0)this.childViews.forEach(j=>{this.removeChildView(j)});else if(k&&this.childViews.length===0){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};qa.emit("add-view",j)}else this.childViews.forEach(j=>{this.updateTimeline(j,a)})}}finally{this._isUpdating=!1}}}removeAllChildViews(){[...this.childViews].forEach(a=>{this.removeChildView(a)})}removeChildView(a,i=!1){const k=this.childViews.findIndex(j=>j.view.id===a.view.id);if(k!==-1){const j=this.childViews[k];this.childViews.splice(k,1),j.view.id&&this.componentSpecificFilters.delete(j.view.id);const g=j.grid,m=j.page,n=document.querySelector(`[gs-id="${j.view.id}"]`);if(g&&n&&(g.removeWidget(n),m&&!i)){const f=m.items.findIndex(l=>l.id===j.view.id);f!==-1&&(m.items.splice(f,1),m.items.length===0&&qa.emit("empty-page",m))}}}updateView({view:a,dynamicFilters:i,filtersJSON:k,filters:j}){this.setFiltersJSON(k),this.dynamicFilters=i;const g=this.childViews.find(m=>{var n;return((n=m.view)==null?void 0:n.id)===a.view.id});if(g){g.view.filtersJSON=k,g.view.coreView&&(g.view.coreView.filtersJSON=k);let m=i;if(this.viewId===4){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===8){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===3){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n),this.updateSummary({dynamicFilters:m})}else if(this.viewId===1){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===6){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===7){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===9){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}this.viewId===5?this.updateVolumetricField(g,m):this.viewId===7?this.updateGoalData(g,m):this.viewId===9?this.updateFieldDataByZones(g,i):this.viewId===10?this.updateXg(g,m):this.viewId===3?this.updateMatchSummary(g,m):this.viewId===4?this.updateTimeline(g,m):this.viewId===8?this.updateFieldPosesion(g,m):this.viewId===1?this.updateComparative(g,m):this.viewId===2?this.updateGSCtops(g,m):this.viewId===6?this.updateGSCLineupsReports(g,m):this.viewId===16&&this.updateLastTouchSingle(g,j)}}updateComparative(a,i){if(a.view.componentProps){const k=i[0]||[];if(k&&k.length>0){let j;if(Array.isArray(k)){const m=this.childViews.findIndex(n=>n.view.id===a.view.id);m>=0&&m<k.length?j=k[m]:j=k[0]}else j=k;const g=Wh.get(this.viewId);a.view.componentProps.type=j,a.view.componentProps.default=!1,a.view.title=`Comparativa ${g[j]}`,a.view.filterMultiple={category:j}}qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i})}}updateVolumetricField(a,i){if(a.view.componentProps){const k=i[0]||1;a.view.isHomeTeam=k===1,a.view.componentProps.preMatchType=k,a.view.filterMultiple={isHomeTeam:k},qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i}),qa.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateGoalData(a,i){if(a.view.componentProps){const k=i[0]===1?"offensive":"defensive",j=i[1]===1;a.view.componentProps.analysisType=k,a.view.componentProps.isHomeTeamForAnalysis=j,a.view.isHomeTeam=j,a.view.filterMultiple={isHomeTeam:j},qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i}),qa.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateFieldDataByZones(a,i){if(a.view.componentProps){const k=i[0],j=i[1]===1;if(a.view.componentProps.isHomeTeamForAnalysis=j,a.view.isHomeTeam=j,a.view.filterMultiple={categoryIds:k,isHomeTeam:j},k&&k.length){const g=k.join("-"),m=Wh.get(this.viewId).analysisTypes.get(g);m&&(a.view.componentProps.analysisType=m.analysisType,a.view.title=m.title,a.view.titleShort=m.titleShort)}}}updateXg(a,i){const k=i[0]===1;a.view.componentProps&&(a.view.isHomeTeam=k,a.view.componentProps.isHomeTeamForAnalysis=k,a.view.filtersJSON=this.filtresJSON,a.view.filterMultiple={isHomeTeam:k})}updateMatchSummary(a,i){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const k=i&&i.length>0?i[0]:!1;a.view.componentProps.desplegable=k,a.view.componentProps.key=k,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i})}}updateTimeline(a,i){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const k=this.getComponentDynamicFilters(a.view.id)||i,j=k&&k.length>0?k[0]:[];a.view.componentProps.selectedEvents=j,a.view.componentProps.key=j.length>0;const g=this.hasEventTypeId(j,1),m=this.hasCategoryId(j,8),n=this.hasCategoryId(j,9),f=this.hasEventTypeId(j,3);a.view.componentProps.goals=g,a.view.componentProps.yellowCards=m,a.view.componentProps.redCards=n,a.view.componentProps.substitutions=f,a.view.componentProps._updateKey=Date.now(),qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:k}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:k}),qa.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateFieldPosesion(a,i){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const k=i&&i.length>0?i[0]:!1;a.view.componentProps.areInactiveVisible=k,a.view.componentProps.key=k,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i})}}updateGSCtops(a,i){if(a.view.componentProps){const k=i[0]||[];if(Array.isArray(k)){if(k.length>0){const j=k[0];let g=null;try{g=jh(j)}catch(n){console.warn("Error getting category by ID:",n)}const m=i[1]||1;a.view.filterMultiple={categoryId:j,teamType:m},a.view.componentProps.game&&(m===1?a.view.componentProps.teamView=a.view.componentProps.game.homeTeam.team_id:m===2?a.view.componentProps.teamView=a.view.componentProps.game.awayTeam.team_id:a.view.componentProps.teamView=0),a.view.componentProps.categoryView=g?[{id:j,name:g.name}]:[{id:j,name:`Category ${j}`}]}}else{const j=k;if(j){let g=null;try{g=jh(j)}catch(n){console.warn("Error getting category by ID:",n)}const m=i[1]||1;a.view.filterMultiple={categoryId:j,teamType:m},a.view.componentProps.game&&(m===1?a.view.componentProps.teamView=a.view.componentProps.game.homeTeam.team_id:m===2?a.view.componentProps.teamView=a.view.componentProps.game.awayTeam.team_id:a.view.componentProps.teamView=0),a.view.componentProps.categoryView=g?[{id:j,name:g.name}]:[{id:j,name:`Category ${j}`}]}}}}updateGSCLineupsReports(a,i){if(a.view.componentProps){const k=i[0]||[];if(Array.isArray(k)){if(k.length>0){const j=k[0];a.view.filterMultiple={gameNumber:j},a.view.componentProps.gameNumber=j}}else{const j=k;j&&(a.view.filterMultiple={gameNumber:j},a.view.componentProps.gameNumber=j)}qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i}),qa.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}getCategoryIdFromAnalysisType(a,i){if(!a||!i)return null;for(const k of i){const j=k.join("-"),g=Wh.get(this.viewId);if(g&&g.analysisTypes){const m=g.analysisTypes.get(j);if(m&&m.analysisType===a)return k[0]||null}}return null}updateLastTouchFilters(){if(!this.filters){console.warn("No filters available in updateLastTouchFilters");return}this.childViews.forEach(j=>{j.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,j.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,j.view.filterMultiple.howManyGamesSelected=this.filters.howManyGamesSelected,j.view.filterMultiple.isAssistZoneVisible=this.filters.isAssistZoneVisible});const a=this.filters.selectedCategories.map(j=>j.value),i=a.map(j=>j.name),k=this.filters.selectedTeam.value;if(k===3)this.childViews.length>a&&this.childViews.reduce((j,g)=>(i.includes(g.view.componentProps.categories[0].name)||j.push(g.view.componentProps.categories[0].name),j),[]).forEach(j=>{const g=this.childViews.findIndex(m=>m.view.componentProps.categories[0].name===j);if(g!==-1){const m=this.childViews[g];this.removeChildView(m)}});else{const j=k===1,g=this.getHomeTeamViews(),m=this.getAwayTeamViews();if(j&&g.length===0)m.forEach(n=>{n.view.componentProps.isHomeTeamForAnalysis=j,n.view.isHomeTeam=j,n.view.filterMultiple.isHomeTeam=j});else if(!j&&m.length===0)g.forEach(n=>{n.view.componentProps.isHomeTeamForAnalysis=j,n.view.isHomeTeam=j,n.view.filterMultiple.isHomeTeam=j});else if(g.length===m.length)j||g.forEach(n=>{n.view.componentProps.isHomeTeamForAnalysis=j,n.view.isHomeTeam=j,n.view.filterMultiple.isHomeTeam=j}),(j?m:g).forEach(n=>{this.removeChildView(n)});else{const n=j?this.getHomeTeamViews():this.getAwayTeamViews();if(n.length>a.length){const f=a.map(l=>l.name);n.forEach(l=>{f.includes(l.view.componentProps.categories[0].name)?l.view.filterMultiple.isHomeTeam=j:this.removeChildView(l)})}else n.forEach(f=>{f.view.filterMultiple.isHomeTeam=j})}}}updateLastTouchSingle(a,i){if(a.view.componentProps){const k=i.selectedTeam.value===1,j=i.selectedCategory.value;a.view.isHomeTeam=k,a.view.componentProps.isHomeTeamForAnalysis=k,a.view.componentProps.categories=[j],a.view.componentProps.analysisType=i.selectedGamePhase.name,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.componentProps.isAssistZoneVisible=i.isAssistZoneVisible,a.view.componentProps.howManyGames=i.howManyGamesSelected.value,a.view.title=j.name,a.view.titleShort=j.name,a.view.isHomeTeam=k,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:j,selectedGamePhase:i.selectedGamePhase,howManyGamesSelected:i.howManyGamesSelected,isAssistZoneVisible:i.isAssistZoneVisible}}}}const J5e={class:"template-page__header"},B5e={class:"template-page__header__name"},G5e=["value"],Z5e={class:"template-page__header__details"},H5e={class:"template-page__header__details__teams"},Y5e={class:"template-page__header__details__teams__team"},Q5e={key:0,class:"template-page__header__details__teams__team__logo"},$5e=["src"],e_e={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t_e={class:"template-page__header__details__teams__team"},r_e={key:0,class:"template-page__header__details__teams__team__logo"},n_e=["src"],a_e={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i_e={class:"template-page__content"},o_e=["id"],s_e=["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"],l_e=r.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(e,{emit:a}){var i,k,j;const g=r.ref(null);let m=null;const n=e,f=r.ref(!1),l=a,t=r.computed(()=>n.page.items.reduce((W,K)=>(W.set(K.id,K),W),new Map)),_=r.computed(()=>{var W,K,X,D;return n.game&&n.game.homeTeam&&n.game.awayTeam?{homeTeam:{name:((W=n.game.homeTeam)==null?void 0:W.acronym)||"LOC",logo:((K=n.game.homeTeam)==null?void 0:K.logo)||null},awayTeam:{name:((X=n.game.awayTeam)==null?void 0:X.acronym)||"VIS",logo:((D=n.game.awayTeam)==null?void 0:D.logo)||null}}:{homeTeam:{name:"LOC"},awayTeam:{name:"VIS"}}});let b=null,v=null,h=!1,o=null,s=!1;const p=()=>{s=!0},c=()=>{s=!1};function d(){s||(h=!0,o&&clearTimeout(o),o=setTimeout(()=>{h=!1},150))}function x(){const W={root:null,rootMargin:"0px",threshold:.7};b=new IntersectionObserver(D=>{D.forEach(H=>{if(h){v&&clearTimeout(v),v=setTimeout(()=>{l("intersection-changed",H.isIntersecting)},100);return}v&&clearTimeout(v),v=setTimeout(()=>{l("intersection-changed",H.isIntersecting)},50)})},W);const K=g.value;K&&b.observe(K);const X=document.querySelector(".container-main");X&&X.addEventListener("scroll",d,{passive:!0}),document.addEventListener("programmatic-scroll-start",p),document.addEventListener("programmatic-scroll-end",c)}function w(W){n.page.title=W.target.value,l("view-changed")}const S={game_id:0,season_id:0,prematch:!1},V={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:[]}},O=new Map([[5,{component:KT,componentName:"GSCVolumetricField",props:{isGamePreMatch:!n.isPostMatch,areTeamsVisible:!1,isTitleVisible:!1,isGhostEffect:n.isTemplateMode,isTemplateMode:n.isTemplateMode,preMatchType:1}}],[2,{component:q4,componentName:"GscTopPlayer",props:{categoryView:[{id:0,name:"Category"}],gamed:n.game?n.game.id:V.gameId,game:n.game,season:n.game?(i=n==null?void 0:n.game)==null?void 0:i.season_id:V.seasonId,teamView:0,useDummyData:n.isTemplateMode}}],[8,{component:Pk,componentName:"FieldPosesion",props:{widthSection:600,game:V,teamSelected:{teamId:0},areInactiveVisible:!0,showTitle:!1,isDefault:!0,key:!1}}],[6,{component:M8,componentName:"GSCLineupsReports",props:{selectedOption:n.isPostMatch?"Postmatch":"Prematch",game:S,gamehome:S,gameaway:S}}],[3,{component:Rk,componentName:"GSCMatchSummary",props:{game:V,defaultShields:!0,desplegable:!1}}],[4,{component:w7,componentName:"GSCTimelineReports",props:{key:!0,isDefault:!0,gameId:V.gameId,homeTeam:V.homeTeam.team_id,awayTeam:V.awayTeam.team_id,token:n.token,goals:!0,yellowCards:!0,redCards:!0,substitutions:!0}}],[7,{component:N9,componentName:"GSCGoalData",props:{game:n.game,isHomeTeamForAnalysis:!0,canInteract:!1,canPlayVideos:!1,isPreMatch:!n.isPostMatch,analysisType:1}}],[9,{component:j8,componentName:"GSCFieldDataByZones",props:{game:n.game,isHomeTeamForAnalysis:!0,analysisType:"successfulPasses",canPlayVideos:!1,isPreMatch:!n.isPostMatch,negative:!0}}],[10,{component:t5,componentName:"GSCGameXg",props:{game:n.game,isHomeTeamForAnalysis:!0,isPostMatch:n.isPostMatch}}],[13,{component:HS,componentName:"GSCTimelapseTable",props:{isdefault:!0,seasonId:n.game?(k=n==null?void 0:n.game)==null?void 0:k.season_id:0,teamsIds:[8,13],categoryIds:[20,2],analysisType:1,teamsshow:[1],gameId:90401,teams:[{id:8,name:"MAZ",logo:"https://golstatsimages.blob.core.windows.net/teams-80/8.png"},{id:13,name:"SNL",logo:"https://golstatsimages.blob.core.windows.net/teams-80/13.png"}]}}],[14,{component:lS,componentName:"GSCGeneraltable",props:{isReports:!0,isDefault:!0,type:0,typeView:1,tournament:1,currentSeasonId:2010,showVideos:!1,localTeam:2,awayTeam:1}}],[15,{component:kN,componentName:"GSCStrengths",props:{token:n.token,view:1,numitems:3,typegame:1,isdefault:!0,data:{player:35240,season:1772,type:2,team:14}}}],[10,{component:t5,componentName:"GSCGameXg",props:{game:n.game,isHomeTeamForAnalysis:!0,isPostMatch:n.isPostMatch}}],[1,{component:S9,componentName:"GSCComparativeReports",props:{gameId:n.game?n.game.id:"",homeLogo:n.game?n.game.homeTeam.logo:"",awayLogo:n.game?n.game.awayTeam.logo:"",seasonId:n.game?(j=n==null?void 0:n.game)==null?void 0:j.season_id:0,typeGame:n.isPostMatch,type:"stoppedBall",default:n.isTemplateMode}}],[16,{component:zN,componentName:"GSCLastTouch",props:{categories:[{name:"Goles",color:"#336DFF",points:[1,2,3],categories:[12,55,"35_r","54_r"],invert:[35,54],negative:!1,translationKey:"chalkboard.offensive.team.goals",singleName:"Gol",isDefaultSelected:!0}],gameIdsForAnalysis:[],isAssistZoneVisible:!1,seasonId:2010,analysisType:"offensive",teamIdForAnalysis:17,gameDataUTC:"2025-11-08T03:00:00Z",isHomeTeamForAnalysis:!0,isTemplateMode:n.isTemplateMode,isPreMatch:!n.isPostMatch}}]]);function U(W){if(W)if(typeof W=="string"){let K=null;switch(W){case"GSCVolumetricField":K=KT;break;case"GSCGoalData":K=N9;break;case"GscTopPlayer":K=q4;break;case"FieldPosesion":K=Pk;break;case"GSCLineupsReports":K=M8;break;case"GSCMatchSummary":K=Rk;break;case"GSCTimelineReports":K=w7;break;case"GSCFieldDataByZones":K=j8;break;case"GSCGeneraltable":K=lS;break;case"GSCTimelapseTable":K=HS;break;case"GSCGameXg":K=t5;break;case"GSCComparativeReports":K=S9;break;case"GSCStrengths":K=kN;break;case"GSCLastTouch":K=zN;break;default:K=null}return K}else return W;return null}function z({pageId:W,view:K,filterAndWidgetContainer:X,applyMinimumSize:D=!1,dynamicFilters:H=[],filters:ne=null}){if(n.page.id===W&&m){let B=!1;K.id===3&&(B=H[0]);const re=`min_column${B?"_2":""}`,ee=`min_row${B?"_2":""}`,Y=`colspan${B?"_2":""}`,$=`rowspan${B?"_2":""}`,le={w:D?K[re]:K[Y],h:D?K[ee]:K[$]};if(m.willItFit(0,0,le.w,le.h,!0)){const ie=m.addWidget(le),ue=Number(ie.getAttribute("gs-x")||0),he=Number(ie.getAttribute("gs-y")||0);m.removeWidget(ie);const ae=O.get(K.id),de=r.reactive({...JSON.parse(JSON.stringify(ae.props))||{},_isReactive:!0}),ce=r.reactive({pageId:W,grid:m,page:n.page,view:{name:K.name,title:K.title,key:Date.now()-7*Math.random(),id:`w-${String(Date.now())}`,x:ue,y:he,w:le.w,h:le.h,maxWidth:K.max_column,maxHeight:K.max_row,minWidth:K.min_column,minHeight:K.min_row,componentName:ae.componentName,componentProps:de,pageId:W,coreView:K}});X.addView(ce),qa.emit("add-page-view",ce)}else qa.emit("add-page-and-view",{pageId:W,view:K,filterAndWidgetContainer:X})}}function L(W){if(m){const K=document.querySelector(`[gs-id="${W.id}"]`);K&&(m.removeWidget(K),l("delete-view",W))}}function C(W){if(!W.filterAndViewsContainer&&W.coreView){const K=new H0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[W],W.coreView.id,W.dynamicFilters||[],n.isPostMatch,n.isTemplateMode,W.filtersJSON,null,W.filters);W.filterAndViewsContainer=K}l("edit-view",W)}function q(){l("delete-page",n.page)}function N(){qa.emit("change-sort",n.page)}function P(W){if(h)return;const K=n.page.items.find(X=>X.id===W.itemId||X.id===W.viewId);K&&(Object.assign(K.componentProps,W.componentProps),K._updateKey=Date.now())}function T(W){if(h)return;const K=n.page.items.find(X=>X.id===W.viewId);K&&(Object.assign(K.componentProps,W.componentProps),K._updateKey=Date.now())}function E(W){if(h)return;const K=n.page.items.find(X=>X.id===W.viewId);K&&(Object.assign(K.componentProps,W.componentProps||{}),K._updateKey=Date.now())}const R=function(){qa.off("add-view",z),qa.off("force-component-update",P),qa.off("component-props-updated",T),qa.off("dynamic-filters-changed",E);const W=document.querySelector(".container-main");W&&W.removeEventListener("scroll",d),v&&clearTimeout(v),o&&clearTimeout(o)};return qa.on("add-view",z),qa.on("force-component-update",P),qa.on("component-props-updated",T),qa.on("dynamic-filters-changed",E),r.onMounted(async()=>{await r.nextTick(),m=vi.init({column:12,row:12,maxRow:12,cellHeight:60,float:!0,resizable:{handles:"e, se, s, sw, w"}},`#grid-stack-${n.id}`),m.on("change",(W,K)=>{const X=K[0];if(X){const D=t.value.get(X.id);D&&(D.x=X.x,D.y=X.y,D.w=X.w,D.h=X.h,l("view-changed"))}}),x(),n.page.grid=m,n.page.offListeners=R}),r.onUnmounted(()=>{b&&b.disconnect(),R(),v&&clearTimeout(v),o&&clearTimeout(o),document.removeEventListener("programmatic-scroll-start",p),document.removeEventListener("programmatic-scroll-end",c)}),(W,K)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"templatePage",ref:g,class:"template-page"},[r.createElementVNode("div",J5e,[f.value?(r.openBlock(),r.createBlock(CN,{key:0,"options-type":"page",onClick:K[0]||(K[0]=r.withModifiers(X=>f.value=!1,["self"])),onMouseleave:K[1]||(K[1]=X=>f.value=!1),onCloseTooltip:K[2]||(K[2]=X=>f.value=!1),onDeletePage:q,onChangeSort:N})):r.createCommentVNode("",!0),r.createElementVNode("div",B5e,[K[4]||(K[4]=r.createElementVNode("div",null,[r.createElementVNode("svg",{width:"19",height:"21",viewBox:"0 0 19 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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)),K[5]||(K[5]=r.createElementVNode("div",{class:"separator"},null,-1)),r.createElementVNode("input",{value:e.page.title,type:"text",class:"page-title-input",onclick:"this.select()",onInput:w},null,40,G5e)]),r.createElementVNode("div",Z5e,[r.createElementVNode("div",H5e,[r.createElementVNode("div",Y5e,[_.value.homeTeam.logo?(r.openBlock(),r.createElementBlock("div",Q5e,[r.createElementVNode("img",{src:_.value.homeTeam.logo,alt:"Home Team Logo",width:"25",height:"25"},null,8,$5e)])):(r.openBlock(),r.createElementBlock("svg",e_e,[...K[6]||(K[6]=[r.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.createElementVNode("span",null,r.toDisplayString(_.value.homeTeam.name),1)]),K[8]||(K[8]=r.createElementVNode("div",{class:"template-page__header__details__teams__vs"}," VS ",-1)),r.createElementVNode("div",t_e,[r.createElementVNode("span",null,r.toDisplayString(_.value.awayTeam.name),1),_.value.awayTeam.logo?(r.openBlock(),r.createElementBlock("div",r_e,[r.createElementVNode("img",{src:_.value.awayTeam.logo,alt:"Away Team Logo",width:"25",height:"25"},null,8,n_e)])):(r.openBlock(),r.createElementBlock("svg",a_e,[...K[7]||(K[7]=[r.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)])]))])]),e.isTemplateMode&&!e.isFilterVisible?(r.openBlock(),r.createElementBlock("div",{key:0,class:"template-page__header__details__options",onClick:K[3]||(K[3]=X=>f.value=!0)},[...K[9]||(K[9]=[r.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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)])])):r.createCommentVNode("",!0)])]),r.createElementVNode("div",i_e,[r.createElementVNode("div",{id:`grid-stack-${e.id}`,class:"grid-stack"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.page.items,X=>{var D,H,ne;return r.openBlock(),r.createElementBlock("div",{class:"grid-stack-item",key:X.key,"gs-id":X.id,"gs-x":X.x,"gs-y":X.y,"gs-w":X.w,"gs-h":X.h,"gs-max-w":X.maxWidth,"gs-max-h":X.maxHeight,"gs-min-w":X.minWidth,"gs-min-h":X.minHeight,"gs-no-resize":!e.isTemplateMode,"gs-no-move":!n.isTemplateMode,"gs-auto-position":X.x===0&&X.y===0},[r.createElementVNode("div",{class:r.normalizeClass(["grid-stack-item-content",{"is-selected":X.isSelected}])},[r.createVNode(F5e,{view:X,"is-template-mode":e.isTemplateMode,"is-post-match":e.isPostMatch,game:e.game,lastGames:e.lastGames,"is-home-team":(D=X.componentProps)!=null&&D.preMatchType?((H=X.componentProps)==null?void 0:H.preMatchType)===1:X.isHomeTeam,"is-filter-visible":e.isFilterVisible,"view-id":((ne=X==null?void 0:X.coreView)==null?void 0:ne.id)||0,onEdit:B=>C(X),onDelete:B=>L(X)},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(U(X.componentName)),r.mergeProps({ref_for:!0},X.componentProps,{key:`${X.id}-${X._updateKey||0}`}),null,16))]),_:2},1032,["view","is-template-mode","is-post-match","game","lastGames","is-home-team","is-filter-visible","view-id","onEdit","onDelete"])],2)],8,s_e)}),128))],8,o_e)])],512))}}),c_e=Bc(l_e,[["__scopeId","data-v-d2aac648"]]),u_e={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},d_e={key:0,class:"cover__main-logo cover__main-logo__home"},p_e={key:0,class:"team-logo"},h_e=["src"],f_e={key:1,width:"575",height:"675",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m_e=["fill"],y_e={key:1,class:"cover__main-logo cover__main-logo__away"},g_e={key:0,class:"team-logo"},v_e=["src"],b_e={key:1,width:"575",height:"575",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},x_e=["fill"],w_e={class:"cover__title-subtitle"},__e={class:"cover__title-subtitle__title"},S_e={class:"cover__title-subtitle__subtitle"},T_e={key:2,class:"cover-type-one"},k_e={class:"team-info-one"},N_e={class:"team-data"},V_e={key:0,class:"team-logo"},O_e=["src"],L_e={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},U_e=["fill","opacity"],q_e={class:"team-name"},z_e={key:0,class:"team-events"},C_e={class:"score-one"},P_e={key:0},E_e={class:"team-info-one"},F_e={class:"team-data"},R_e={key:0,class:"team-logo"},M_e=["src"],j_e={key:1,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},W_e=["fill","opacity"],K_e={class:"team-name"},A_e={key:0,class:"team-events"},I_e={key:3,class:"cover-type-two"},X_e={class:"team-data"},D_e={class:"team-info"},J_e={key:0,class:"team-logo"},B_e=["src"],G_e={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Z_e=["fill","opacity"],H_e={key:2,class:"team-score-two"},Y_e={key:0,class:"team-goals"},Q_e={class:"team-data"},$_e={class:"team-info"},eSe={key:0,class:"team-score-two"},tSe={key:1,class:"team-logo"},rSe=["src"],nSe={key:2,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},aSe=["fill","opacity"],iSe={key:0,class:"team-goals"},oSe={__name:"CoverPage",props:{game:{type:Object,default:()=>null},coverId:{type:Number,default:1},isPostMatch:{type:Boolean,default:!0}},emits:["intersection-changed"],setup(e,{emit:a}){const i=e,k=a,j=r.ref(null),g=r.computed(()=>[1,2].includes(i.coverId)),m=r.computed(()=>[1,3].includes(i.coverId)),n=r.computed(()=>i.coverId===1?{homeTeam:"#1558CC",awayTeam:"#0046BF",opacity:1}:i.coverId===3?{homeTeam:"#000A1A",awayTeam:"#000A1A",opacity:.4}:{homeTeam:"#576883",awayTeam:"#576883",opacity:.4}),f=r.computed(()=>i.game&&i.game.score?i.game.score:["0","0"]),l=r.computed(()=>{var U,z,L,C,q,N,P,T;if(i.game&&i.game.homeTeam&&i.game.awayTeam){const E={homeTeam:{name:((U=i.game.homeTeam)==null?void 0:U.acronym)||"LOC",logo:((z=i.game.homeTeam)==null?void 0:z.logo)||null},awayTeam:{name:((L=i.game.awayTeam)==null?void 0:L.acronym)||"VIS",logo:((C=i.game.awayTeam)==null?void 0:C.logo)||null}};return g.value?(E.homeTeam.goalsMinutes=o(i.game.minutes.home_goals_minutes),E.homeTeam.totalYellowCards=((q=i.game.minutes.home_yellow_cards_minutes)==null?void 0:q.length)||0,E.homeTeam.totalRedCards=((N=i.game.minutes.home_red_cards_minutes)==null?void 0:N.length)||0,E.awayTeam.goalsMinutes=o(i.game.minutes.visiting_goals_minutes),E.awayTeam.totalYellowCards=((P=i.game.minutes.away_yellow_cards_minutes)==null?void 0:P.length)||0,E.awayTeam.totalRedCards=((T=i.game.minutes.away_red_cards_minutes)==null?void 0:T.length)||0):(E.homeTeam.goalsEvents=h(i.game.report_minutes.home_goals_minutes),E.awayTeam.goalsEvents=h(i.game.report_minutes.visiting_goals_minutes)),E}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=r.computed(()=>({"--background-image":m.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":i.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-one":i.isPostMatch?"100%":"fit-content","--grid-template-columns-type-two":i.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-two":i.isPostMatch?"100%":"fit-content"})),_=r.computed(()=>i.isPostMatch?"Postmatch":"Prematch"),b=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],v=r.computed(()=>{if(i.game){let U=u_e[i.game.matchday_abbreviation];U||(U=i.game.matchday_abbreviation.replace("M","J"));const[z,L,C]=i.game.date.split("-");return`${U} - ${C} ${b[Number(L)-1]}, ${z}`}return"Jornada - Día 00 Mes"});function h(U){return!U||!Array.isArray(U)||U.length===0?"":U.map(z=>{const L=z.split(", ");let C=L[0].replace("'","");C=C.replace("+",""),C=C.replace("’","");const q=C.split(" "),{strings:N,numbers:P}=q.reduce((R,W)=>(isNaN(Number(W))?R.strings.push(W):R.numbers.push(W),R),{strings:[],numbers:[]}),T=N.join(" "),E=P.length===1?`${P[0]}'`:`${P[0]}' ${P.slice(1).join(" + ")}'`;return{playerName:T,goalTime:L.length===1?E:`${E}, ${L.reduce((R,W,K)=>K===0?R:`${R}${W}${K<L.length-1?", ":""}`,"")}`}})}function o(U){return!U||!Array.isArray(U)||U.length===0?"":U.reduce((z,L,C)=>{const q=L.split(" ");let N="";return q.length===3?N=q[2]:q.length===5&&(N=`${q[2]} ${q[3]} ${q[4]}`),N&&(z+=`${N}${C<U.length-1?", ":""}`),z},"")}let s=null,p=null,c=!1,d=null,x=!1;const w=()=>{x=!0},S=()=>{x=!1};function V(){x||(c=!0,d&&clearTimeout(d),d=setTimeout(()=>{c=!1},150))}function O(){const U={root:null,rootMargin:"0px",threshold:.7};s=new IntersectionObserver(C=>{C.forEach(q=>{if(c){p&&clearTimeout(p),p=setTimeout(()=>{k("intersection-changed",q.isIntersecting)},100);return}p&&clearTimeout(p),p=setTimeout(()=>{k("intersection-changed",q.isIntersecting)},50)})},U);const z=j.value;z&&s.observe(z);const L=document.querySelector(".container-main");L&&L.addEventListener("scroll",V,{passive:!0}),document.addEventListener("programmatic-scroll-start",w),document.addEventListener("programmatic-scroll-end",S)}return r.onMounted(()=>{O()}),r.onUnmounted(()=>{s&&s.disconnect();const U=document.querySelector(".container-main");U&&U.removeEventListener("scroll",V),document.removeEventListener("programmatic-scroll-start",w),document.removeEventListener("programmatic-scroll-end",S),p&&clearTimeout(p),d&&clearTimeout(d)}),(U,z)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"coverPage",ref:j,class:"cover",style:r.normalizeStyle(t.value)},[g.value?(r.openBlock(),r.createElementBlock("div",d_e,[l.value.homeTeam.logo?(r.openBlock(),r.createElementBlock("div",p_e,[r.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,h_e)])):(r.openBlock(),r.createElementBlock("svg",f_e,[r.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:n.value.homeTeam},null,8,m_e)]))])):r.createCommentVNode("",!0),g.value?(r.openBlock(),r.createElementBlock("div",y_e,[l.value.awayTeam.logo?(r.openBlock(),r.createElementBlock("div",g_e,[r.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,v_e)])):(r.openBlock(),r.createElementBlock("svg",b_e,[r.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:n.value.awayTeam},null,8,x_e)]))])):r.createCommentVNode("",!0),r.createElementVNode("div",w_e,[r.createElementVNode("div",__e,[z[0]||(z[0]=r.createElementVNode("div",null,"Análisis",-1)),r.createElementVNode("div",null,r.toDisplayString(_.value),1)]),r.createElementVNode("div",S_e,r.toDisplayString(v.value),1)]),g.value?(r.openBlock(),r.createElementBlock("div",T_e,[r.createElementVNode("div",k_e,[r.createElementVNode("div",N_e,[l.value.homeTeam.logo?(r.openBlock(),r.createElementBlock("div",V_e,[r.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,O_e)])):(r.openBlock(),r.createElementBlock("svg",L_e,[r.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:n.value.homeTeam,opacity:n.value.opacity},null,8,U_e)])),r.createElementVNode("div",q_e,r.toDisplayString(l.value.homeTeam.name),1)]),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",z_e,[z[1]||(z[1]=r.createStaticVNode('<svg class="ball" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1)),r.createElementVNode("div",null,r.toDisplayString(l.value.homeTeam.goalsMinutes),1),z[2]||(z[2]=r.createElementVNode("div",{class:"separator"},null,-1)),z[3]||(z[3]=r.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),r.createElementVNode("div",null,r.toDisplayString(l.value.homeTeam.totalYellowCards),1),z[4]||(z[4]=r.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),r.createElementVNode("div",null,r.toDisplayString(l.value.homeTeam.totalRedCards),1)])):r.createCommentVNode("",!0)]),r.createElementVNode("div",C_e,[e.isPostMatch?(r.openBlock(),r.createElementBlock("div",P_e,r.toDisplayString(f.value[0])+" : "+r.toDisplayString(f.value[1]),1)):r.createCommentVNode("",!0)]),r.createElementVNode("div",E_e,[r.createElementVNode("div",F_e,[l.value.awayTeam.logo?(r.openBlock(),r.createElementBlock("div",R_e,[r.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,M_e)])):(r.openBlock(),r.createElementBlock("svg",j_e,[r.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:n.value.awayTeam,opacity:n.value.opacity},null,8,W_e)])),r.createElementVNode("div",K_e,r.toDisplayString(l.value.awayTeam.name),1)]),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",A_e,[r.createElementVNode("div",null,r.toDisplayString(l.value.awayTeam.totalYellowCards),1),z[5]||(z[5]=r.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),r.createElementVNode("div",null,r.toDisplayString(l.value.awayTeam.totalRedCards),1),z[6]||(z[6]=r.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),z[7]||(z[7]=r.createElementVNode("div",{class:"separator"},null,-1)),r.createElementVNode("div",null,r.toDisplayString(l.value.awayTeam.goalsMinutes),1),z[8]||(z[8]=r.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1))])):r.createCommentVNode("",!0)])])):(r.openBlock(),r.createElementBlock("div",I_e,[r.createElementVNode("div",X_e,[r.createElementVNode("div",D_e,[l.value.homeTeam.logo?(r.openBlock(),r.createElementBlock("div",J_e,[r.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,B_e)])):(r.openBlock(),r.createElementBlock("svg",G_e,[r.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:n.value.homeTeam,opacity:n.value.opacity},null,8,Z_e)])),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",H_e,r.toDisplayString(f.value[0]),1)):r.createCommentVNode("",!0)]),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",Y_e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value.homeTeam.goalsEvents,(L,C)=>(r.openBlock(),r.createElementBlock("div",{key:`goal-${C}`,class:"goal"},[r.createElementVNode("div",null,r.toDisplayString(L.playerName),1),z[9]||(z[9]=r.createElementVNode("div",{class:"bullet"},null,-1)),r.createElementVNode("div",null,r.toDisplayString(L.goalTime),1),z[10]||(z[10]=r.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1))]))),128))])):r.createCommentVNode("",!0)]),z[13]||(z[13]=r.createElementVNode("div",{class:"separator"},null,-1)),r.createElementVNode("div",Q_e,[r.createElementVNode("div",$_e,[e.isPostMatch?(r.openBlock(),r.createElementBlock("div",eSe,r.toDisplayString(f.value[1]),1)):r.createCommentVNode("",!0),l.value.awayTeam.logo?(r.openBlock(),r.createElementBlock("div",tSe,[r.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,rSe)])):(r.openBlock(),r.createElementBlock("svg",nSe,[r.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:n.value.awayTeam,opacity:n.value.opacity},null,8,aSe)]))]),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",iSe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value.awayTeam.goalsEvents,(L,C)=>(r.openBlock(),r.createElementBlock("div",{key:`goal-a-${C}`,class:"goal"},[z[11]||(z[11]=r.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></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-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1)),r.createElementVNode("div",null,r.toDisplayString(L.goalTime),1),z[12]||(z[12]=r.createElementVNode("div",{class:"bullet"},null,-1)),r.createElementVNode("div",null,r.toDisplayString(L.playerName),1)]))),128))])):r.createCommentVNode("",!0)])]))],4))}},sSe=Bc(oSe,[["__scopeId","data-v-6680cbcf"]]),lSe={class:"table-category-filters"},cSe={key:0,class:"custom-radio-group filter-inline"},uSe={class:"radio-label"},dSe={class:"radio-options"},pSe=["name","value","onUpdate:modelValue","onClick"],hSe=["data-filter-type","onClick","onMousedown","onMouseup"],fSe={class:"select-display"},mSe={class:"select-label"},ySe={key:0,class:"dropdown-menu type-menu simple-select-menu"},gSe={class:"simple-select-scroll-area"},vSe=["onClick"],bSe={class:"option-content"},xSe={class:"option-title"},wSe={key:0,class:"option-checkmark"},_Se={key:2,class:"filter-separator"},SSe={__name:"TableCategoryFilters",props:{filters:{type:Array,default:()=>[]},initialValues:{type:Array,default:()=>[]},isEditMode:{type:Boolean,default:!1},componentId:{type:Number,default:13}},emits:["filters-changed","filter-updated"],setup(e,{expose:a,emit:i}){const k=e,j=i,g=r.ref([]);let m=null;const n=(x,w)=>{if(!w)return!0;for(let S=0;S<x.length;S++)if(!f(x[S],w[S]))return!0;return!1},f=(x,w)=>{if(Array.isArray(x)&&Array.isArray(w)){if(x.length!==w.length)return!1;for(let S=0;S<x.length;S++)if(x[S]!==w[S])return!1;return!0}return x===w},l=r.ref(null),t=r.ref([]);let _=!1,b=null;const v=()=>{b=null},h=()=>{setTimeout(()=>{_=!1},1e3)},o=(x,w=!0)=>{if(k.filters&&k.filters[0]&&k.filters[1]&&k.filters[1].options){const S=k.filters[0].options,V=k.filters[1].options;x!=null?S.findIndex(O=>O.value===x)!==-1&&V[x]?(t.value=V[x],w&&!(()=>{const O=g.value[1];return O==null?!1:Array.isArray(O)?O.length>0:O!==""})()&&!_&&t.value.length>0&&(g.value[1]=t.value[0].value,r.nextTick(()=>{}))):(t.value=[],g.value[1]=null):(t.value=[],g.value[1]=null)}},s=()=>{k.initialValues&&k.initialValues.length>0?g.value=[...k.initialValues]:g.value=k.filters.map(x=>{var w,S,V,O;return x.type==="select"?[]:x.type==="check"?!1:x.type==="radio-button"?((S=(w=x.options)==null?void 0:w[0])==null?void 0:S.value)||null:x.type==="select-simple"&&((O=(V=x.options)==null?void 0:V[0])==null?void 0:O.value)||null}),k.componentId===13&&g.value.some(x=>x!=null&&(Array.isArray(x)?x.length>0:x!==!1&&x!==""))&&(m=[...g.value],j("filters-changed",{componentId:k.componentId,filters:g.value,timestamp:new Date().toISOString()}))};s(),setTimeout(()=>{r.nextTick(()=>{if(g.value[0]!==null&&g.value[0]!==void 0&&!_){const x=!(()=>{const w=g.value[1];return w==null?!1:Array.isArray(w)?w.length>0:w!==""})();o(g.value[0],x)}})},300),r.watch(()=>k.initialValues,x=>{const w=!f(g.value,x),S=x&&x.length>0&&!_&&w,V=k.isEditMode&&_;S&&!V?g.value=[...x]:_?b&&b.length>0&&(g.value=[...b]):V&&b&&b.length>0&&(g.value=[...b])},{deep:!0}),r.watch(()=>k.isEditMode,(x,w)=>{w===!0&&x===!1&&v()},{immediate:!0}),r.watch(g,(x,w)=>{x.some(S=>S!=null&&(Array.isArray(S)?S.length>0:S!==!1&&S!==""))&&n(x,m)&&(m=[...x],j("filters-changed",{componentId:k.componentId,filters:x,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),r.watch(()=>g.value[0],(x,w)=>{x!==w&&w!==void 0?o(x,!0):w===void 0&&x!==null&&x!==void 0&&o(x,!1)},{immediate:!0}),r.watch(()=>g.value,(x,w)=>{k.filters.map((S,V)=>S.type==="radio-button"?V:-1).filter(S=>S!==-1).forEach(S=>{})},{deep:!0}),r.watch(t,()=>{},{deep:!0});const p=x=>{l.value===x?l.value=null:l.value=x},c=(x,w)=>{if(_=!0,h(),g.value[x]=w,(x===0||x===1)&&(b=[...g.value]),l.value=null,x===0){g.value[1]!==void 0&&(g.value[1]=null);const S=_;_=!1,o(w,!0),_=S,g.value[1]!==null&&g.value[1]!==void 0&&(b=[...g.value])}},d=()=>{_=!0,setTimeout(()=>{_=!1},1e3)};return a({getCurrentValues:()=>g.value,initializeValues:s}),(x,w)=>(r.openBlock(),r.createElementBlock("div",lSe,[e.filters&&e.filters.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.filters,(S,V)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:V},[S.type==="radio-button"?(r.openBlock(),r.createElementBlock("div",cSe,[r.createElementVNode("div",uSe,r.toDisplayString(S.label),1),r.createElementVNode("div",dSe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.options,O=>(r.openBlock(),r.createElementBlock("label",{key:O.value,class:r.normalizeClass(["radio-option-card",{active:g.value[V]===O.value}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"table-radio-"+V,value:O.value,"onUpdate:modelValue":U=>g.value[V]=U,onChange:w[0]||(w[0]=()=>{d()}),onClick:U=>console.log("Click en radio button",V,O.value,"Valor actual:",g.value[V])},null,40,pSe),[[r.vModelRadio,g.value[V]]]),r.createElementVNode("span",null,r.toDisplayString(O.label),1)],2))),128))])])):S.type==="select-simple"?(r.openBlock(),r.createElementBlock("div",{key:1,class:"custom-select dynamic-select filter-inline","data-filter-type":S.type,onClick:r.withModifiers(O=>p(V),["stop"]),onMousedown:O=>console.log("Mouse down en selector",V),onMouseup:O=>console.log("Mouse up en selector",V)},[r.createElementVNode("div",fSe,[w[2]||(w[2]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),r.createElementVNode("span",mSe,r.toDisplayString(S.label||"Tipo de análisis"),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:l.value===V}])},[...w[1]||(w[1]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),l.value===V?(r.openBlock(),r.createElementBlock("div",ySe,[r.createElementVNode("div",gSe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(V===1?t.value:S.options,O=>(r.openBlock(),r.createElementBlock("div",{key:O.value,class:r.normalizeClass(["option-card simple-select-option",{active:f(g.value[V],O.value)}]),onClick:r.withModifiers(U=>c(V,O.value),["stop"])},[r.createElementVNode("div",bSe,[r.createElementVNode("div",xSe,r.toDisplayString(O.label),1)]),f(g.value[V],O.value)?(r.openBlock(),r.createElementBlock("div",wSe,[...w[3]||(w[3]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):r.createCommentVNode("",!0)],10,vSe))),128))])])):r.createCommentVNode("",!0)],40,hSe)):r.createCommentVNode("",!0),V===1&&e.filters.length>2?(r.openBlock(),r.createElementBlock("div",_Se)):r.createCommentVNode("",!0)],64))),128))],2)):r.createCommentVNode("",!0)]))}},TSe=Bc(SSe,[["__scopeId","data-v-9d00f072"]]),kSe={class:"strengths-filters"},NSe={key:0,class:"custom-radio-group filter-inline"},VSe={class:"radio-label"},OSe={class:"radio-options"},LSe=["name","value","onUpdate:modelValue"],USe={class:"filter-inline select-with-label"},qSe=["data-filter-type","onClick"],zSe={class:"select-display"},CSe={class:"select-label"},PSe={key:0,class:"dropdown-menu type-menu simple-select-menu"},ESe={class:"simple-select-scroll-area"},FSe=["onClick"],RSe={class:"option-content"},MSe={class:"option-title"},jSe={key:0,class:"option-checkmark"},WSe={key:2,class:"filter-separator"},KSe={__name:"StrengthsFilters",props:{filters:{type:Array,default:()=>[]},initialValues:{type:Array,default:()=>[]},isEditMode:{type:Boolean,default:!1},componentId:{type:Number,default:15}},emits:["filters-changed","filter-updated"],setup(e,{expose:a,emit:i}){const k=e,j=i,g=r.ref([]);let m=null;const n=r.ref(null),f=r.ref([]);let l=!1,t=null;const _=(p,c)=>{if(Array.isArray(p)&&Array.isArray(c)){if(p.length!==c.length)return!1;for(let d=0;d<p.length;d++)if(p[d]!==c[d])return!1;return!0}return p===c},b=(p,c=!0)=>{if(k.filters&&k.filters[0]&&k.filters[1]&&k.filters[1].options){const d=k.filters[0].options,x=k.filters[1].options;p!=null?d.findIndex(w=>w.value===p)!==-1&&x[p]?(f.value=x[p],c&&!(()=>{const w=g.value[1];return w==null?!1:Array.isArray(w)?w.length>0:w!==""})()&&!l&&f.value.length>0&&(g.value[1]=f.value[0].value,r.nextTick(()=>{}))):(f.value=[],g.value[1]=null):(f.value=[],g.value[1]=null)}},v=()=>{if(k.initialValues&&k.initialValues.length>0){const c=k.initialValues.length>0&&(typeof k.initialValues[0]=="number"||typeof k.initialValues[0]=="boolean"||k.initialValues[0]===null||Array.isArray(k.initialValues[0]));console.log("StrengthsFilters initializeValues - isSimpleFormat:",c),c?(console.log("StrengthsFilters initializeValues - Usando formato simple, valores:",k.initialValues),g.value=[...k.initialValues]):k.isEditMode?g.value=k.filters.map((d,x)=>{var w,S,V,O,U,z,L,C,q,N;const P=k.initialValues[x];if(console.log(`StrengthsFilters initializeValues - filter[${x}]:`,d==null?void 0:d.type,"filterData:",P),!P)return console.log(`StrengthsFilters initializeValues - No hay filterData para índice ${x}, usando valor por defecto`),d.type==="select"?[]:d.type==="check"?!1:d.type==="radio-button"?((S=(w=d.options)==null?void 0:w[0])==null?void 0:S.value)||null:d.type==="select-simple"&&((O=(V=d.options)==null?void 0:V[0])==null?void 0:O.value)||null;if(d.type==="radio-button"&&P.selectedOption){console.log("StrengthsFilters initializeValues - filterData.selectedOption: ",P.selectedOption,"index:",x);const T=P.selectedOption.value;return console.log("StrengthsFilters initializeValues - selectedValue extraído:",T),T}else{if(d.type==="radio-button"&&!P.selectedOption)return console.log("StrengthsFilters initializeValues - filterData NO tiene selectedOption:",P,"index:",x),P.selectedValue!==void 0?(console.log("StrengthsFilters initializeValues - Usando selectedValue:",P.selectedValue),P.selectedValue):(console.log("StrengthsFilters initializeValues - Usando valor por defecto del filter"),((z=(U=d.options)==null?void 0:U[0])==null?void 0:z.value)||null);if(d.type==="select-simple"&&P.selectedValue!==void 0)return Array.isArray(P.selectedValue)?P.selectedValue[0]:P.selectedValue;if(d.type==="select"&&P.selectedOptions)return P.selectedOptions.map(T=>T.value);if(d.type==="check"&&P.isChecked!==void 0)return P.isChecked}return P.selectedValue!==void 0?P.selectedValue:d.type==="select"?[]:d.type==="check"?!1:d.type==="radio-button"?((C=(L=d.options)==null?void 0:L[0])==null?void 0:C.value)||null:d.type==="select-simple"&&((N=(q=d.options)==null?void 0:q[0])==null?void 0:N.value)||null}):g.value=[...k.initialValues]}else g.value=k.filters.map(c=>{var d,x,w,S;return c.type==="select"?[]:c.type==="check"?!1:c.type==="radio-button"?((x=(d=c.options)==null?void 0:d[0])==null?void 0:x.value)||null:c.type==="select-simple"&&((S=(w=c.options)==null?void 0:w[0])==null?void 0:S.value)||null});console.log("StrengthsFilters initializeValues - selectedValues.value final:",g.value);const p=g.value.some(c=>c!=null&&(Array.isArray(c)?c.length>0:c!==!1&&c!==""));console.log("StrengthsFilters initializeValues - hasValidValues:",p),p&&(m=[...g.value],j("filters-changed",{componentId:k.componentId,filters:g.value,timestamp:new Date().toISOString()}))};v(),setTimeout(()=>{r.nextTick(()=>{if(g.value[0]!==null&&g.value[0]!==void 0&&!l){const p=!(()=>{const c=g.value[1];return c==null?!1:Array.isArray(c)?c.length>0:c!==""})();b(g.value[0],p)}})},300),r.watch(()=>k.initialValues,(p,c)=>{if(!p||p.length===0)return;console.log("StrengthsFilters watch initialValues - newValues:",p),console.log("StrengthsFilters watch initialValues - oldValues:",c),console.log("StrengthsFilters watch initialValues - props.isEditMode:",k.isEditMode),console.log("StrengthsFilters watch initialValues - isUserInteracting:",l);const d=p.length>0&&(typeof p[0]=="number"||typeof p[0]=="boolean"||p[0]===null||Array.isArray(p[0]));console.log("StrengthsFilters watch initialValues - isSimpleFormat:",d);const x=!_(g.value,p),w=p&&p.length>0&&!l&&x,S=k.isEditMode&&l;console.log("StrengthsFilters watch initialValues - valuesAreDifferent:",x,"shouldUpdate:",w,"isEditModeProtection:",S),w&&!S?d?(console.log("StrengthsFilters watch initialValues - Usando formato simple, valores:",p),g.value=[...p]):k.isEditMode?g.value=k.filters.map((V,O)=>{const U=p[O];if(!U)return console.log("StrengthsFilters watch initialValues - No hay filterData para índice",O),g.value[O];if(V.type==="radio-button"&&U.selectedOption){console.log("StrengthsFilters watch initialValues - filterData.selectedOption: ",U.selectedOption,"index:",O);const z=U.selectedOption.value;return console.log("StrengthsFilters watch initialValues - selectedValue extraído:",z),z}else{if(V.type==="select-simple"&&U.selectedValue!==void 0)return Array.isArray(U.selectedValue)?U.selectedValue[0]:U.selectedValue;if(V.type==="select"&&U.selectedOptions)return U.selectedOptions.map(z=>z.value);if(V.type==="check"&&U.isChecked!==void 0)return U.isChecked}return U.selectedValue!==void 0?U.selectedValue:g.value[O]}):g.value=[...p]:l?t&&t.length>0&&(g.value=[...t]):S&&t&&t.length>0&&(g.value=[...t])},{deep:!0}),r.watch(()=>k.isEditMode,(p,c)=>{c===!0&&p===!1&&(t=null)},{immediate:!0}),r.watch(g,p=>{p.some(c=>c!=null&&(Array.isArray(c)?c.length>0:c!==!1&&c!==""))&&(()=>{if(!m)return!0;for(let c=0;c<p.length;c++)if(!_(p[c],m[c]))return!0;return!1})()&&(m=[...p],j("filters-changed",{componentId:k.componentId,filters:p,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),r.watch(()=>g.value[0],(p,c)=>{p!==c&&c!==void 0?b(p,!0):c===void 0&&p!==null&&p!==void 0&&b(p,!1)},{immediate:!0});const h=p=>{n.value===p?n.value=null:n.value=p},o=(p,c)=>{if(l=!0,setTimeout(()=>{l=!1},1e3),g.value[p]=c,(p===0||p===1)&&(t=[...g.value]),n.value=null,p===0){g.value[1]!==void 0&&(g.value[1]=null);const d=l;l=!1,b(c,!0),l=d,g.value[1]!==null&&g.value[1]!==void 0&&(t=[...g.value])}},s=()=>{l=!0,setTimeout(()=>{l=!1},400)};return a({getCurrentValues:()=>g.value,initializeValues:v}),(p,c)=>(r.openBlock(),r.createElementBlock("div",kSe,[e.filters&&e.filters.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.filters,(d,x)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:x},[d.type==="radio-button"?(r.openBlock(),r.createElementBlock("div",NSe,[r.createElementVNode("div",VSe,r.toDisplayString(d.label),1),r.createElementVNode("div",OSe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.options,w=>(r.openBlock(),r.createElementBlock("label",{key:w.value,class:r.normalizeClass(["radio-option-card",{active:g.value[x]===w.value}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"strengths-radio-"+x,value:w.value,"onUpdate:modelValue":S=>g.value[x]=S,onChange:s},null,40,LSe),[[r.vModelRadio,g.value[x]]]),r.createElementVNode("span",null,r.toDisplayString(w.label),1)],2))),128))])])):d.type==="select-simple"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[c[4]||(c[4]=r.createElementVNode("div",{class:"filter-separator"},null,-1)),r.createElementVNode("div",USe,[c[3]||(c[3]=r.createElementVNode("div",{class:"radio-label"},"Mostrar: ",-1)),r.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":d.type,onClick:r.withModifiers(w=>h(x),["stop"])},[r.createElementVNode("div",zSe,[c[1]||(c[1]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),r.createElementVNode("span",CSe,r.toDisplayString(d.label||"Tipo de análisis"),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:n.value===x}])},[...c[0]||(c[0]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),n.value===x?(r.openBlock(),r.createElementBlock("div",PSe,[r.createElementVNode("div",ESe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.options,w=>(r.openBlock(),r.createElementBlock("div",{key:w.value,class:r.normalizeClass(["option-card simple-select-option",{active:_(g.value[x],w.value)}]),onClick:r.withModifiers(S=>o(x,w.value),["stop"])},[r.createElementVNode("div",RSe,[r.createElementVNode("div",MSe,r.toDisplayString(w.label),1)]),_(g.value[x],w.value)?(r.openBlock(),r.createElementBlock("div",jSe,[...c[2]||(c[2]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):r.createCommentVNode("",!0)],10,FSe))),128))])])):r.createCommentVNode("",!0)],8,qSe)])],64)):r.createCommentVNode("",!0),x===1&&e.filters.length>2?(r.openBlock(),r.createElementBlock("div",WSe)):r.createCommentVNode("",!0)],64))),128))],2)):r.createCommentVNode("",!0)]))}},ASe=Bc(KSe,[["__scopeId","data-v-4c3876bd"]]),ISe=(e,a)=>{const i=e.__vccOpts||e;for(const[k,j]of a)i[k]=j;return i},XSe={key:1},DSe={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},JSe=["fill"],BSe={key:0,class:"checkbox__teams"},GSe={class:"checkbox__teams__logo"},ZSe=["src"],HSe={class:"checkbox__teams__logo"},YSe=["src"],QSe={__name:"GSC-Checkbox",props:{width:{type:String,default:"fit-content"},height:{type:String,default:"fit-content"},label:{type:String,default:""},labelWhiteSpace:{type:String,default:"normal"},labelColor:{type:String,default:"white"},fontFamily:{type:String,default:"sans-serif"},labelFontSize:{type:String,default:"12px"},modelValue:{type:Boolean,default:!1},justifyContent:{type:String,default:"flex-start"},alignItems:{type:String,default:"center"},boxBackgroundColor:{type:String,default:"#CBEE6B"},boxValueColor:{type:String,default:"#0d1d29"},boxValue:{type:[String,Number],default:""},boxPosition:{type:String,default:"left",validator(e){return["left","right","top","bottom"].includes(e)}},boxMarginTop:{type:String,default:"0.2em"},boxWidthAndHeight:{type:String,default:"16px"},boxBorderColor:{type:String,default:"#969da2"},boxBorderWidth:{type:String,default:"2px"},boxBorderRadius:{type:String,default:"4px"},boxValueFontSize:{type:String,default:"10px"},boxValueFontFamily:{type:String,default:"sans-serif"},avoidInteraction:{type:Boolean,default:!1},avoidToCheck:{type:Boolean,default:!1},isBoxOnly:{type:Boolean,default:!1},teamsIds:{type:Array,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:a}){const i=e;r.useCssVars(l=>({"7bd9d47b":e.width,"34dc7ddc":e.height}));const k=r.ref(!1),j=r.computed(()=>{const l={color:i.boxValueColor,"font-family":i.fontFamily,height:i.boxWidthAndHeight,width:i.boxWidthAndHeight,minWidth:i.boxWidthAndHeight,"border-radius":i.boxBorderRadius,"margin-top":i.boxMarginTop};return k.value?(l["background-color"]=i.boxBackgroundColor,l.border=`solid ${i.boxBorderWidth} ${i.boxBackgroundColor}`):l.border=`solid ${i.boxBorderWidth} ${i.boxBorderColor}`,l}),g=r.computed(()=>({"font-family":i.boxValueFontFamily,"font-size":i.boxValueFontSize,color:i.boxValueColor,"line-height":1})),m=r.computed(()=>{const l={color:i.labelColor,"font-family":i.fontFamily,"font-size":i.labelFontSize,"white-space":i.labelWhiteSpace,"text-align":i.boxPosition==="top"||i.boxPosition==="bottom"?"center":i.boxPosition};return(i.boxPosition==="left"||i.boxPosition==="right")&&(l[`margin-${i.boxPosition}`]=i.isBoxOnly?"0":i.teamsIds?"8px":"10px"),l});r.watch(()=>i.modelValue,l=>{l!==k.value&&(k.value=l)},{immediate:!0});function n(){i.avoidInteraction||!k.value&&i.avoidToCheck||(k.value=!k.value,a("update:modelValue",k.value))}function f(l){return`${{}.TEAM_LOGOS_URL||"https://golstatsimages.blob.core.windows.net/teams-80/"}${l}.png`}return(l,t)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["checkbox",`box-${e.boxPosition}`]),onClick:n},[r.createElementVNode("div",{class:"checkbox__box",style:r.normalizeStyle(j.value)},[k.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[i.boxValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:"checkbox__box__value",style:r.normalizeStyle(g.value)},r.toDisplayString(e.boxValue),5)):(r.openBlock(),r.createElementBlock("div",XSe,[(r.openBlock(),r.createElementBlock("svg",DSe,[r.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:e.boxValueColor},null,8,JSe)]))]))],64)):r.createCommentVNode("",!0)],4),e.teamsIds&&e.teamsIds.length?(r.openBlock(),r.createElementBlock("div",BSe,[r.createElementVNode("div",GSe,[r.createElementVNode("img",{src:f(e.teamsIds[0]),alt:""},null,8,ZSe)]),r.createElementVNode("div",HSe,[r.createElementVNode("img",{src:f(e.teamsIds[1]),alt:""},null,8,YSe)])])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"checkbox__label",style:r.normalizeStyle(m.value)},r.toDisplayString(e.label),5)],2))}},jN=ISe(QSe,[["__scopeId","data-v-b6f124d8"]]),$Se=(e,a)=>{const i=e.__vccOpts||e;for(const[k,j]of a)i[k]=j;return i},N5={props:{type:{type:Number,default:0},value:{type:Boolean,default:!1},textValue:String,icon:String,iconPosition:{type:String,default:"left"},iconSize:String,fontColor:{type:String,default:"#FFFFFF"},textDecoration:String,fontSize:{type:String,default:"16px"},fontSizeStat:{type:String,default:"16px"},fontStyle:String,fontFamily:{type:String,default:"Poppins-Regular"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},borderRadius:{type:String,default:"0px"},borderType:{type:String,default:"solid"},borderWidth:{type:Number,default:0},borderWidthBtn:{type:String,default:"2px"},borderColor:String,backgroundColor:{type:String,default:"none"},activeBackgroundColor:{type:String,default:"#000000"},activeBorderWidth:{type:Number,default:2},activeBorderType:{type:String,default:"solid"},activeBorderColor:{type:String,default:"#cbee6b"},activeColorText:{type:String,default:"#FFFFFF"},cursorType:{type:String,default:"default"},typeOnOff:{type:Boolean,default:!1},textCategory:String,textStat:String,marginLeftStat:{type:String,default:"15%"}},watch:{value:{deep:!0,immediate:!0,handler(e){this.status=e}}},data(){return{status:!1}},computed:{customStyle(){return{height:this.height,width:this.width,backgroundColor:this.backgroundColor,borderRadius:this.borderRadius,border:`${this.borderType} ${this.borderWidth}px ${this.borderColor}`,color:this.fontColor,textDecoration:this.textDecoration,cursor:this.cursorType,fontSize:this.fontSize,fontStyle:this.fontStyle,fontFamily:`${this.fontFamily} !important`}},customActive(){return{backgroundColor:this.activeBackgroundColor,color:this.activeColorText,border:`${this.activeBorderType} ${this.activeBorderWidth}px ${this.activeBorderColor}`}}},methods:{btnClick(e){this.$emit("click",e),this.typeOnOff&&(this.status=!this.status,this.$emit("status",this.status))}}},WN=()=>{r.useCssVars(e=>({"9d01acb4":e.height,"14e95081":e.borderWidthBtn,"38fec285":e.borderType,34353510:e.borderColor,"20d20dc6":e.borderRadius,17130967:e.width,"4ccb7d36":e.backgroundColor,"5d1e86a2":e.cursorType,ce65d4a2:e.fontSize,fe4ac47a:e.fontStyle,f98e44dc:e.fontFamily,"93b87770":e.marginLeftStat,c7f7beba:e.fontSizeStat}))},KN=N5.setup;N5.setup=KN?(e,a)=>(WN(),KN(e,a)):WN;const eTe=e=>(r.pushScopeId("data-v-f3ee6b2b"),e=e(),r.popScopeId(),e),tTe=["src"],rTe={key:1,class:"text"},nTe=["src"],aTe={class:"stats"},iTe=eTe(()=>r.createElementVNode("img",{class:"iconstats",src:"https://golstatsimages.blob.core.windows.net/todoelfut/playdes.png"},null,-1)),oTe={class:"numstats"},sTe={class:"leyend"};function lTe(e,a,i,k,j,g){return r.openBlock(),r.createElementBlock("div",null,[i.type==0?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["button",j.status&&i.typeOnOff&&"button-active"]),style:r.normalizeStyle([g.customStyle,j.status&&i.typeOnOff&&g.customActive]),onClick:a[0]||(a[0]=(...m)=>g.btnClick&&g.btnClick(...m))},[i.icon&&i.iconPosition.toLowerCase()==="left"?(r.openBlock(),r.createElementBlock("img",{key:0,class:"icon",style:r.normalizeStyle({width:i.iconSize}),src:i.icon},null,12,tTe)):r.createCommentVNode("",!0),i.textValue?(r.openBlock(),r.createElementBlock("div",rTe,r.toDisplayString(i.textValue),1)):r.createCommentVNode("",!0),i.icon&&i.iconPosition.toLowerCase()==="right"?(r.openBlock(),r.createElementBlock("img",{key:2,class:"icon",style:r.normalizeStyle({width:i.iconSize}),src:i.icon},null,12,nTe)):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0),i.type==1?(r.openBlock(),r.createElementBlock("div",{key:1,class:"button-target",onClick:a[1]||(a[1]=(...m)=>g.btnClick&&g.btnClick(...m))},[r.createElementVNode("div",aTe,[iTe,r.createElementVNode("div",oTe,r.toDisplayString(i.textStat),1)]),r.createElementVNode("div",sTe,r.toDisplayString(i.textCategory),1)])):r.createCommentVNode("",!0)])}const cTe=$Se(N5,[["render",lTe],["__scopeId","data-v-f3ee6b2b"]]),uTe={class:"gsc-dropdown__main-container__item-selected"},dTe=["height","width"],pTe=["stroke"],hTe={key:1,width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fTe=["fill"],mTe={class:"gsc-dropdown__items-container"},yTe=["onClick"],gTe={key:0,class:"gsc-dropdown__items-footer"},g2={__name:"GSC-Dropdown",props:{modelValue:{type:[Object,Number,String],default:()=>null},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},fontSize:{type:String,default:"14px"},borderRadius:{type:Number,default:5},arrowHeight:{type:Number,default:24},arrowWidth:{type:Number,default:24},borderType:{type:String,default:"solid",validator:function(e){return["solid","dotted","dashed"].includes(e)}},borderWidth:{type:Number,default:1},borderColor:{type:String,default:"black"},backgroundColor:{type:String,default:"grey"},color:{type:String,default:"black"},arrowColor:{type:String,default:"#CBEE6B"},items:{type:Array,default:()=>[]},defaultItemByIndex:{type:Number,default:0},defaultItemByProp:{type:Object,default:null,validator:e=>["propName","value"].every(a=>a in e)},listBackgroundColor:{type:String,default:"white"},hoverBackgroundColor:{type:String,default:"#f1f1f1"},listMarginTop:{type:String,default:"0"},listContainerPadding:{type:String,default:"0"},listItemPadding:{type:String,default:"10px 12px"},listItemMargin:{type:String,default:"0"},listHeight:{type:String,default:"fit-content"},listItemSelectedColor:{type:String,default:"white"},listItemSelectedBackgroundColor:{type:String,default:"#399cfd"},listItemColor:{type:String,default:"black"},listBorderRadius:{type:String,default:"0"},listBorderColor:{type:String,default:""},listBorderWidth:{type:Number,default:1},listItemBorderRadius:{type:String,default:"0"},listAlignment:{type:String,default:"left"},isListSameWidth:{type:Boolean,default:!1},isMultipleOption:{type:Boolean,default:!1},footerBorderColor:{type:String,default:"#626970"},footerBorderWidth:{type:Number,default:1},isFooterVisible:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},onlyFirstTime:{type:Boolean,default:!1},iconType:{type:Number,default:1,validator:function(e){return[1,2].includes(e)}}},emits:["input","click-ready","update:modelValue"],setup(e,{emit:a}){const i=e,k=r.ref({}),j=r.ref(null),g=r.ref(i.isMultipleOption?-1:0),m=r.ref(!1);r.watch(()=>i.items,(v,h)=>{if(!i.modelValue&&(!i.onlyFirstTime||!h||!h.length)&&v&&v.length){if(i.defaultItemByProp){const o=i.items.findIndex(s=>s[i.defaultItemByProp.propName]===i.defaultItemByProp.value);o!==-1?(g.value=o,k.value=v[o]):(g.value=0,k.value=v[0])}else k.value=v[i.defaultItemByIndex];a("input",k.value)}},{immediate:!0}),r.watch(()=>i.modelValue,v=>{if(v){const h=i.items.findIndex(o=>typeof v=="object"?JSON.stringify(o)===JSON.stringify(v):o===v);h!==-1&&(g.value=h,k.value=i.items[h],a("update:modelValue",k.value))}},{immediate:!0});const n=r.computed(()=>({height:i.height,width:i.width,backgroundColor:i.backgroundColor,borderRadius:`${i.borderRadius}px`,border:`${i.borderType} ${i.borderWidth}px ${i.borderColor}`,color:i.color,"--hover-background-color":i.hoverBackgroundColor,"--list-container-padding":i.listContainerPadding,"--list-item-padding":i.listItemPadding,"--list-item-margin":i.listItemMargin,"--list-background-color":i.listBackgroundColor,"--list-height":i.listHeight,"--list-item-border-radius":i.listItemBorderRadius,"--list-item-selected-color":i.listItemSelectedColor,"--list-item-selected-background-color":i.listItemSelectedBackgroundColor,"--list-item-color":i.listItemColor,"--list-border-radius":`${i.listBorderRadius}`,"--list-border-color":i.listBorderColor,"--list-width":i.isListSameWidth?i.width:"fit-content","--list-border-width":`${i.listBorderWidth}px`,"--list-margin-top":i.listMarginTop,"--list-left":i.listAlignment==="left"?"0":"auto","--list-right":i.listAlignment==="right"?"0":"auto","--footer-border":`${i.footerBorderWidth}px solid ${i.footerBorderColor}`,"--dropdown-opacity":i.isDisabled?"0.5":"1","--dropdown-cursor":i.isDisabled?"not-allowed":"pointer","--dropdown-font-size":i.fontSize?i.fontSize:"14px"})),f=r.computed(()=>({height:`${i.arrowHeight}px`,width:`${i.arrowWidth}px`}));function l(){i.isDisabled||(m.value=!m.value)}function t(v){j.value&&!j.value.contains(v.target)&&(m.value=!1)}function _(v,h){i.isMultipleOption?g.value=-1:(g.value=h,m.value=!1),k.value=v,a("input",k.value),a("update:modelValue",k.value)}function b(){m.value=!1,a("click-ready")}return r.onMounted(()=>{document.addEventListener("click",t)}),r.onBeforeMount(()=>{document.removeEventListener("click",t)}),(v,h)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"dropDown",ref:j,class:"gsc-dropdown",style:r.normalizeStyle(n.value)},[r.createElementVNode("div",{class:"gsc-dropdown__main-container",style:r.normalizeStyle({"padding-right":`${e.arrowWidth+8}px`}),onClick:l},[r.createElementVNode("div",uTe,[r.renderSlot(v.$slots,"default",{selectedItem:k.value})]),r.createElementVNode("div",{class:r.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":m.value}]),style:r.normalizeStyle(f.value)},[e.iconType===1?(r.openBlock(),r.createElementBlock("svg",{key:0,height:e.arrowHeight,width:e.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M18.394 9.13501L13.1302 14.3988C12.5086 15.0204 11.4914 15.0204 10.8697 14.3988L5.60596 9.13501",stroke:e.arrowColor},null,8,pTe)],8,dTe)):(r.openBlock(),r.createElementBlock("svg",hTe,[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 2.62045L6.86193 0.167368C7.12228 -0.0557892 7.54439 -0.0557892 7.80474 0.167368C8.06509 0.390524 8.06509 0.752333 7.80474 0.97549L4.4714 3.83263C4.21105 4.05579 3.78895 4.05579 3.5286 3.83263L0.195262 0.97549C-0.0650874 0.752333 -0.0650874 0.390524 0.195262 0.167368C0.455612 -0.0557892 0.877722 -0.0557892 1.13807 0.167368L4 2.62045Z",fill:e.arrowColor},null,8,fTe)]))],6)],4),r.createVNode(r.Transition,null,{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",mTe,[r.createElementVNode("div",null,[r.createElementVNode("div",{class:"gsc-dropdown__items",style:r.normalizeStyle({"margin-top":`${i.borderWidth}px`})},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.items,(o,s)=>(r.openBlock(),r.createElementBlock("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["gsc-dropdown__items__item",{selected:s===g.value}]),key:s,onClick:p=>_(o,s)},[r.renderSlot(v.$slots,"availableItem",{item:o})],10,yTe)),[[r.vShow,!o.isHidden]])]))),256))],4),e.isFooterVisible?(r.openBlock(),r.createElementBlock("div",gTe,[r.createVNode(r.unref(cTe),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:b})])):r.createCommentVNode("",!0)])],512),[[r.vShow,m.value]])]),_:3})],4))}},AN={borderType:"solid",listBackgroundColor:"#2E3B46",listBorderColor:"rgba(255, 255, 255, 0.2)",listBorderRadius:"5px",height:"38px",borderWidth:.8,borderColor:"rgba(255, 255, 255, 0.2)",backgroundColor:"#2E3B46",color:"white",listItemColor:"white",listItemSelectedBackgroundColor:"#2E3B46",arrowColor:"#fff",width:"100%",listHeight:"200px",isListSameWidth:!1,isFooterVisible:!1,hoverBackgroundColor:"#2E3B46",iconType:2},vTe=[{label:"Goles recibidos",value:{name:"Goles recibidos",color:"#336DFF",points:[1,2,3],categories:[40],invert:[57,326,56,60,59,55],negative:!1,translationKey:"chalkboard.defensive.team.goals_received",singleName:"Gol recibido"}},{label:"Tiros a gol recibidos",value:{name:"Tiros a gol recibidos",color:"#7ED321",points:[1,2,3],categories:["510_r"],invert:[510],negative:!1,translationKey:"chalkboard.defensive.team.shots_on_goal_received",singleName:"Tiro a gol recibido"}},{label:"Tiros a gol recibidos (portería)",value:{name:"Tiros a gol recibidos (portería)",color:"#990BFF",points:[1,2,3],categories:["537_r","540_r","544_r","547_r"],invert:[537,540,544,547],negative:!1,translationKey:"chalkboard.defensive.team.shots_on_goal_received",singleName:"Tiro a gol recibido"}},{label:"Centros totales recibidos",value:{name:"Centros totales recibidos",color:"#FF9226",points:[1,2,3],categories:["13_r","25_r"],invert:[13,25],negative:!1,translationKey:"chalkboard.defensive.team.total_centers_received",singleName:"Centro recibido"}},{label:"Centros acertados por el rival",value:{name:"Centros acertados por el rival",color:"#28A3B2",points:[1,2,3],categories:["98_r","101_r","104_r","105_r","109_r","112_r","115_r","116_r"],invert:[98,101,104,105,109,112,115,116],negative:!1,translationKey:"chalkboard.defensive.team.successful_centers_by_opponent",singleName:"Centro acertado"}},{label:"Fuera de lugar provocados",value:{name:"Fuera de lugar provocados",color:"#00DD00",points:[1,2,3],categories:["33_r"],invert:[33],negative:!1,translationKey:"chalkboard.defensive.team.offsides_caused",singleName:"Fuera de lugar"}},{label:"Balones recuperados (en disputa)",value:{name:"Balones recuperados (en disputa)",color:"#FF3399",points:[1,2,3],categories:[483],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.balls_recovered_in_challenge",singleName:"Balón recuperado",isDefaultSelected:!0}},{label:"Balones recuperados (sin disputa)",value:{name:"Balones recuperados (sin disputa)",color:"#B4005A",points:[1,2,3],categories:[484],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.balls_recovered_without_challenge",singleName:"Balón recuperado"}},{label:"1 vs 1 exitosos defensivos",value:{name:"1 vs 1 exitosos defensivos",color:"#3A3838",points:[1],categories:[5],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.successful_1_on_1",singleName:"1 vs 1 defensivo"}},{label:"1 vs 1 no exitosos defensivos",value:{name:"1 vs 1 no exitosos defensivos",color:"#008B31",points:[1],categories:[209],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.unsuccessful_1_on_1",singleName:"1 vs 1 defensivo"}},{label:"Balones ganados en área propia",value:{name:"Balones ganados en área propia",color:"#305496",points:[1,2],categories:[23],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.balls_won_own_penalty_box",singleName:"Balón ganado"}},{label:"Juego aéreo resto del campo",value:{name:"Juego aéreo resto del campo",color:"#FF8A4C",points:[1,2,3],categories:[24],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.arial_game_rest_pitch",singleName:"Juego aéreo"}},{label:"Barridas",value:{name:"Barridas",color:"#700000",points:[1],categories:[518],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.slide_tackles",singleName:"Barrida"}},{label:"Rechaces",value:{name:"Rechaces",color:"#CC0000",points:[1,2,3],categories:[34],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.clearances",singleName:"Rechace"}}],bTe=[{label:"Goles",value:{name:"Goles",color:"#336DFF",points:[1,2,3],categories:[12,55,"35_r","54_r"],invert:[35,54],negative:!1,translationKey:"chalkboard.offensive.team.goals",singleName:"Gol",isDefaultSelected:!0}},{label:"Tiros a gol",value:{name:"Tiros a gol",color:"#7ED321",points:[1,2,3],categories:[510],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.shots_on_goal",singleName:"Tiro a gol",isDefaultSelected:!1}},{label:"Tiros a gol (portería)",value:{name:"Tiros a gol (portería)",color:"#990BFF",points:[1,2,3],categories:[537,540,544,547],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.shots_on_goal_2",singleName:"Tiro a gol (portería)",isDefaultSelected:!1}},{label:"Centros totales",value:{name:"Centros totales",color:"#FF9226",points:[1,2,3],categories:[13,25],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.center_crosses",singleName:"Centro",isDefaultSelected:!1}},{label:"Centros acertados",value:{name:"Centros acertados",color:"#28A3B2",points:[1,2,3],categories:[98,101,104,105,109,112,115,116],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.successful_center_crosses",singleName:"Centro acertado",isDefaultSelected:!1}},{label:"Balones ganados en área rival",value:{name:"Balones ganados en área rival",color:"#FF0092",points:[1,2],categories:[11],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.balls_won_opponent_penalty_box",singleName:"Balón ganado",isDefaultSelected:!1}},{label:"1vs1 exitosos ofensivos",value:{name:"1vs1 exitosos ofensivos",color:"#3A3838",points:[1],categories:[4],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.successful_1_on_1_attacking",singleName:"1 vs 1 ofensivo",isDefaultSelected:!1}},{label:"1vs1 no exitosos ofensivos",value:{name:"1vs1 no exitosos ofensivos",color:"#008B31",points:[1],categories:[208],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.unsuccessful_1_on_1_attacking",singleName:"1 vs 1 ofensivo",isDefaultSelected:!1}},{label:"Remates con cabeza",value:{name:"Remates con cabeza",color:"#B4005A",points:[1,2,3],categories:[330,331,333,334,423,424,343,344],invert:[],negative:!1,translationKey:"",singleName:"Remate con cabeza",isDefaultSelected:!1}},{label:"Balón perdido en disputa",value:{name:"Balón perdido en disputa",color:"#9C08B0",points:[1,2,3],categories:[494],invert:[],negative:!1,translationKey:"",singleName:"Balón perdido en disputa",isDefaultSelected:!1}},{label:"Balón perdido sin disputa",value:{name:"Balón perdido sin disputa",color:"#700000",points:[1,2,3],categories:[495],invert:[],negative:!1,translationKey:"",singleName:"Balón perdido sin disputa",isDefaultSelected:!1}}],xTe={class:"last-touch"},wTe={class:"selected-item"},_Te={class:"available-item"},STe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},TTe={class:"selected-item"},kTe={class:"available-item"},NTe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},VTe={key:1},OTe={class:"selected-item"},LTe={class:"available-item"},UTe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qTe={class:"last-touch__how-many-games"},zTe={class:"selected-item"},CTe={class:"available-item"},PTe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ETe={__name:"FilterLastTouch",props:{viewConfig:{type:Object,default:()=>({})},isEditMode:{type:Boolean,default:!1},defaultFilters:{type:Object,default:()=>null},isPostMatch:{type:Boolean,default:!0}},emits:["change","remove-views"],setup(e,{emit:a}){const i=e,k=a,j=r.ref([{label:"Ofensivo",value:2,name:"offensive"},{label:"Defensivo",value:3,name:"defensive"}]),g=r.ref({id:0,name:"Fases de juego",value:null}),m=r.ref(!1),n=r.ref([{id:1,name:"Último partido",value:1},{id:3,name:"Últimos 3 partidos",value:3},{id:0,name:"Todos mis partidos",value:0}]),f=r.ref(i.defaultFilters?null:n.value[0]),l=r.ref(null),t=r.computed(()=>({...AN})),_=r.computed(()=>({...AN,isFooterVisible:!i.isEditMode,isMultipleOption:!i.isEditMode})),b=r.computed(()=>{const K=[];return v.value.options.forEach(X=>{X.forEach(D=>{K.push(D)})}),K}),v=r.ref(null),h=r.ref(null),o=r.ref(null),s=r.ref(null);r.watch(()=>i.viewConfig,K=>{K.filters&&(v.value||p(),h.value||c(),o.value||d(),s.value||V())},{immediate:!0});function p(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="categories");K&&K.options&&(v.value={label:K.label,options:Object.entries(K.options).reduce((X,[D,H])=>(X.set(Number(D),H),X),new Map)})}v.value={label:"Tipo de jugada",options:new Map([[2,bTe],[3,vTe]])}}function c(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="gamePhases");if(K){h.value={label:K.label,options:K.options};return}}h.value={label:"Fases de juego",options:j.value}}function d(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="teamRadios");if(K){o.value={options:K.options},q(null,K.options[0]);return}}o.value={label:"Equipo",options:i.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]},q(null,o.value.options[0])}const x=r.ref(i.defaultFilters?null:o.value.options[0]),w=r.ref(i.defaultFilters?null:h.value.options[0]),S=r.ref(i.defaultFilters?null:v.value.options.get(w.value.value)[0]);function V(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="assistZoneCheckbox");if(K){s.value={label:K.label},N(K.value);return}}s.value={label:"Zona de asistencia"}}const O=r.computed(()=>{const K={selectedGamePhase:w.value,selectedTeam:x.value,isAssistZoneVisible:m.value,howManyGamesSelected:f.value};return i.isEditMode?(K.selectedCategory=S.value,K.totalCategoriesSelected=1):(K.selectedCategories=l.value,K.totalCategoriesSelected=0,v.value.options.forEach(X=>{X.forEach(D=>{D.isSelected&&(K.totalCategoriesSelected+=1)})})),K}),U=r.computed(()=>w.value?v.value.options.get(w.value.value)||[]:[]);r.watch(()=>O.value,K=>{z()&&(console.log("before emit change:",{areAllFiltersFilled:z(),filters:K,view:i.viewConfig}),k("change",{areAllFiltersFilled:z(),filters:K,view:i.viewConfig}))},{deep:!0});function z(){return w.value&&(i.isEditMode&&S.value||!i.isEditMode&&l.value&&l.value.length)&&x.value&&f.value}function L(K){w.value=K,T(null)}function C(K){x.value=K}function q(K,X){console.log("onChangeRadio:",X.value)}function N(K){m.value=K}function P(K){f.value=K}function T(K){S.value=K}function E(K,X){X.isSelected=K,l.value=b.value.filter(D=>D.isSelected)}function R(){i.defaultFilters&&(m.value=i.defaultFilters.isAssistZoneVisible,f.value=n.value.find(K=>K.value===i.defaultFilters.howManyGamesSelected.value)||n.value[0],w.value=h.value.options.find(K=>K.value===i.defaultFilters.selectedGamePhase.value)||h.value.options[0],x.value=o.value.options.find(K=>K.value===(i.defaultFilters.isHomeTeam?1:2))||o.value.options[0],S.value=v.value.options.get(w.value.value).find(K=>K.value.name===i.defaultFilters.selectedCategory.name)||v.value.options.get(w.value.value)[0])}function W(){U.value.forEach(K=>{K.isSelected=!1}),m.value=!1,f.value=n.value[0],w.value=null,x.value=null,S.value=null,l.value=null}return r.onBeforeUnmount(()=>{W()}),r.onMounted(()=>{setTimeout(()=>{R()},500)}),(K,X)=>(r.openBlock(),r.createElementBlock("div",xTe,[r.createVNode(r.unref(g2),r.mergeProps(t.value,{items:h.value.options,"model-value":w.value,"onUpdate:modelValue":L}),{default:r.withCtx(()=>[r.createElementVNode("div",wTe,[X[0]||(X[0]=r.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),r.createElementVNode("div",null,r.toDisplayString(w.value?w.value.label:h.value.label||g.value.name),1)])]),availableItem:r.withCtx(({item:D})=>[r.createElementVNode("div",_Te,[r.createElementVNode("div",null,r.toDisplayString(D.label),1),r.createElementVNode("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("svg",STe,[...X[1]||(X[1]=[r.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[r.vShow,w.value&&w.value.label===D.label]])])])]),_:1},16,["items","model-value"]),r.createVNode(r.unref(g2),r.mergeProps(_.value,{items:U.value,"model-value":S.value,"onUpdate:modelValue":T}),{default:r.withCtx(()=>[r.createElementVNode("div",TTe,[X[2]||(X[2]=r.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),r.createElementVNode("div",null,r.toDisplayString(v.value.label),1)])]),availableItem:r.withCtx(({item:D})=>[r.createElementVNode("div",kTe,[e.isEditMode?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("div",null,r.toDisplayString(D.label),1),r.createElementVNode("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("svg",NTe,[...X[3]||(X[3]=[r.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[r.vShow,S.value&&S.value.label===D.label]])])],64)):(r.openBlock(),r.createElementBlock("div",VTe,[r.createVNode(r.unref(jN),{"model-value":D.isSelected,label:D.label,"onUpdate:modelValue":H=>E(H,D)},null,8,["model-value","label","onUpdate:modelValue"])]))])]),_:1},16,["items","model-value"]),r.createVNode(r.unref(g2),r.mergeProps(t.value,{items:o.value.options,"model-value":x.value,"onUpdate:modelValue":C}),{default:r.withCtx(()=>[r.createElementVNode("div",OTe,[X[4]||(X[4]=r.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),r.createElementVNode("div",null,r.toDisplayString(x.value?x.value.label:o.value.label),1)])]),availableItem:r.withCtx(({item:D})=>[r.createElementVNode("div",LTe,[r.createElementVNode("div",null,r.toDisplayString(D.label),1),r.createElementVNode("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("svg",UTe,[...X[5]||(X[5]=[r.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[r.vShow,x.value&&x.value.label===D.label]])])])]),_:1},16,["items","model-value"]),r.createVNode(r.unref(jN),{"model-value":m.value,label:s.value.label,"onUpdate:modelValue":N},null,8,["model-value","label"]),r.withDirectives(r.createElementVNode("div",qTe,[r.createVNode(r.unref(g2),r.mergeProps(t.value,{items:n.value,"model-value":f.value,"onUpdate:modelValue":P}),{default:r.withCtx(()=>[r.createElementVNode("div",zTe,[X[6]||(X[6]=r.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),r.createElementVNode("div",null,r.toDisplayString(f.value?f.value.name:"Seleccione"),1)])]),availableItem:r.withCtx(({item:D})=>[r.createElementVNode("div",CTe,[r.createElementVNode("div",null,r.toDisplayString(D.name),1),r.createElementVNode("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("svg",PTe,[...X[7]||(X[7]=[r.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[r.vShow,f.value&&f.value.name===D.name]])])])]),_:1},16,["items","model-value"])],512),[[r.vShow,!e.isPostMatch]])]))}},FTe=Bc(ETe,[["__scopeId","data-v-b006bd89"]]),RTe={class:"resultados-filter"},MTe={class:"filter-checkboxes"},jTe=["checked","onChange"],WTe={class:"checkbox-label"},KTe={class:"filter-actions"},ATe={__name:"ResultadosFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:a}){const i=e,k=a,j=r.computed(()=>i.option.filters||[{label:"Iba ganando",value:"winning"},{label:"Iba perdiendo",value:"losing"},{label:"Iba empatado",value:"tied"}]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let b=[...g.value];_?b.includes(t)||b.push(t):b=b.filter(v=>v!==t),k("update-selection",{optionIndex:i.optionIndex,values:b})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",RTe,[r.createElementVNode("div",MTe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,b=>(r.openBlock(),r.createElementBlock("label",{key:b.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(b.value),onChange:r.withModifiers(v=>n(b.value,v.target.checked),["stop"])},null,40,jTe),r.createElementVNode("span",WTe,r.toDisplayString(b.label),1)]))),128))]),r.createElementVNode("div",KTe,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},v2=Bc(ATe,[["__scopeId","data-v-1fba7a5d"]]),ITe={class:"detalles-filter"},XTe={class:"filter-checkboxes"},DTe=["checked","onChange"],JTe={class:"checkbox-label"},BTe={class:"filter-actions"},GTe={__name:"DetallesFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:a}){const i=e,k=a,j=r.computed(()=>i.option.filters||[]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let b=[...g.value];_?b.includes(t)||b.push(t):b=b.filter(v=>v!==t),k("update-selection",{optionIndex:i.optionIndex,values:b})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",ITe,[r.createElementVNode("div",XTe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,b=>(r.openBlock(),r.createElementBlock("label",{key:b.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(b.value),onChange:r.withModifiers(v=>n(b.value,v.target.checked),["stop"])},null,40,DTe),r.createElementVNode("span",JTe,r.toDisplayString(b.label),1)]))),128))]),r.createElementVNode("div",BTe,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},V5=Bc(GTe,[["__scopeId","data-v-175921a6"]]),ZTe={class:"como-fue-cobrado-filter"},HTe={class:"filter-checkboxes"},YTe=["checked","onChange"],QTe={class:"checkbox-label"},$Te={class:"filter-actions"},e6e={__name:"ComoFueCobradoFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:a}){const i=e,k=a,j=r.computed(()=>i.option.filters||[]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let b=[...g.value];_?b.includes(t)||b.push(t):b=b.filter(v=>v!==t),k("update-selection",{optionIndex:i.optionIndex,values:b})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",ZTe,[r.createElementVNode("div",HTe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,b=>(r.openBlock(),r.createElementBlock("label",{key:b.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(b.value),onChange:r.withModifiers(v=>n(b.value,v.target.checked),["stop"])},null,40,YTe),r.createElementVNode("span",QTe,r.toDisplayString(b.label),1)]))),128))]),r.createElementVNode("div",$Te,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},b2=Bc(e6e,[["__scopeId","data-v-905a2961"]]),t6e={class:"zona-filter"},r6e={class:"filter-checkboxes"},n6e=["checked","onChange"],a6e={class:"checkbox-label"},i6e={class:"filter-actions"},o6e={__name:"ZonaFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:a}){const i=e,k=a,j=r.computed(()=>i.option.filters||[]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let b=[...g.value];_?b.includes(t)||b.push(t):b=b.filter(v=>v!==t),k("update-selection",{optionIndex:i.optionIndex,values:b})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",t6e,[r.createElementVNode("div",r6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,b=>(r.openBlock(),r.createElementBlock("label",{key:b.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(b.value),onChange:r.withModifiers(v=>n(b.value,v.target.checked),["stop"])},null,40,n6e),r.createElementVNode("span",a6e,r.toDisplayString(b.label),1)]))),128))]),r.createElementVNode("div",i6e,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},O5=Bc(o6e,[["__scopeId","data-v-6fb0c545"]]),s6e={class:"que-sucedio-filter"},l6e={class:"filter-checkboxes"},c6e=["checked","onChange"],u6e={class:"checkbox-label"},d6e={class:"filter-actions"},p6e={__name:"QueSucedioFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:a}){const i=e,k=a,j=r.computed(()=>i.option.filters||[]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let b=[...g.value];_?b.includes(t)||b.push(t):b=b.filter(v=>v!==t),k("update-selection",{optionIndex:i.optionIndex,values:b})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",s6e,[r.createElementVNode("div",l6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,b=>(r.openBlock(),r.createElementBlock("label",{key:b.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(b.value),onChange:r.withModifiers(v=>n(b.value,v.target.checked),["stop"])},null,40,c6e),r.createElementVNode("span",u6e,r.toDisplayString(b.label),1)]))),128))]),r.createElementVNode("div",d6e,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},I1=Bc(p6e,[["__scopeId","data-v-ecc3baf0"]]),h6e={class:"advanced-select-accordion"},f6e=["onClick"],m6e={class:"accordion-header-left"},y6e={class:"accordion-icon"},g6e=["src","alt"],v6e={class:"accordion-title"},b6e={class:"accordion-header-right"},x6e={key:0,class:"accordion-badge"},w6e={key:0,class:"accordion-content"},_6e={class:"accordion-footer"},S6e={__name:"AdvancedSelectAccordion",props:{filter:{type:Object,required:!0},filterIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","close"],setup(e,{emit:a}){const i=e,k=a,j=r.ref({}),g=_=>{j.value[_]?j.value[_]=!1:(Object.keys(j.value).forEach(b=>{j.value[b]=!1}),j.value[_]=!0)},m=_=>{const b=i.filter.options[_];if(!b||!b.filters)return 0;const v=i.selectedValues[i.filterIndex];if(!v||!v[_])return 0;const h=v[_];return Array.isArray(h)?h.length:0},n=(_,b)=>_.icon?_.icon:`https://golstatsimages.blob.core.windows.net/todoelfut/f${b+1}.png`,f=_=>{const b={resultados:v2,detalles:V5,"como-fue-cobrado":b2,"como fue cobrado":b2,zona:O5,"que-sucedio":I1,"qué sucedió":I1,"que sucedio":I1},v=typeof _.value=="string"?_.value:String(_.value||""),h=typeof _.label=="string"?_.label:String(_.label||""),o=v.toLowerCase().trim(),s=h.toLowerCase().trim();if(o&&b[o])return b[o];if(s&&b[s])return b[s];const p=s.replace(/\s+/g,"-").replace(/[¿?]/g,"").replace(/[áéíóú]/g,c=>({á:"a",é:"e",í:"i",ó:"o",ú:"u"})[c]||c);return p&&b[p]?b[p]:v2},l=_=>{k("update-selection",{filterIndex:i.filterIndex,optionIndex:_.optionIndex,values:_.values})},t=()=>{k("close")};return(_,b)=>(r.openBlock(),r.createElementBlock("div",h6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.filter.options,(v,h)=>(r.openBlock(),r.createElementBlock("div",{key:v.value||h,class:"accordion-item"},[r.createElementVNode("div",{class:"accordion-header",onClick:r.withModifiers(o=>g(h),["stop"])},[r.createElementVNode("div",m6e,[r.createElementVNode("span",y6e,[r.createElementVNode("img",{src:n(v,h),alt:v.label},null,8,g6e)]),r.createElementVNode("span",v6e,r.toDisplayString(v.label),1)]),r.createElementVNode("div",b6e,[m(h)>0?(r.openBlock(),r.createElementBlock("span",x6e,r.toDisplayString(m(h)),1)):r.createCommentVNode("",!0),r.createElementVNode("span",{class:r.normalizeClass(["accordion-chevron",{open:j.value[h]}])},[...b[0]||(b[0]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)])],8,f6e),r.createVNode(r.Transition,{name:"accordion"},{default:r.withCtx(()=>[j.value[h]?(r.openBlock(),r.createElementBlock("div",w6e,[f(v)===v2?(r.openBlock(),r.createBlock(v2,{key:0,option:v,"filter-index":e.filterIndex,"option-index":h,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):f(v)===V5?(r.openBlock(),r.createBlock(V5,{key:1,option:v,"filter-index":e.filterIndex,"option-index":h,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):f(v)===b2?(r.openBlock(),r.createBlock(b2,{key:2,option:v,"filter-index":e.filterIndex,"option-index":h,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):f(v)===O5?(r.openBlock(),r.createBlock(O5,{key:3,option:v,"filter-index":e.filterIndex,"option-index":h,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):f(v)===I1?(r.openBlock(),r.createBlock(I1,{key:4,option:v,"filter-index":e.filterIndex,"option-index":h,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),_:2},1024)]))),128)),r.createElementVNode("div",_6e,[b[1]||(b[1]=r.createElementVNode("div",{class:"footer-separator"},null,-1)),r.createElementVNode("button",{class:"btn-done-footer",onClick:r.withModifiers(t,["stop"])}," Listo ")])]))}},T6e=Bc(S6e,[["__scopeId","data-v-941aab18"]]),k6e={class:"corners-zone-filters"},N6e={key:0,class:"custom-radio-group"},V6e={class:"radio-label"},O6e={class:"radio-options"},L6e=["name","value","onUpdate:modelValue"],U6e={key:0,class:"filter-separator"},q6e={class:"filter-inline select-with-label"},z6e=["data-filter-type","onClick"],C6e={class:"select-display"},P6e={class:"select-label"},E6e={key:0,class:"dropdown-menu type-menu simple-select-menu"},F6e={class:"simple-select-scroll-area"},R6e=["onClick"],M6e={class:"option-content"},j6e={class:"option-title"},W6e={key:0,class:"option-checkmark"},K6e={class:"switch-group"},A6e={class:"switch-label"},I6e={key:0,class:"switch-text switch-text-left"},X6e=["onClick"],D6e={key:1,class:"switch-text switch-text-right"},J6e={key:0,class:"filter-separator"},B6e={key:3,class:"filter-inline advanced-select-wrapper"},G6e=["data-filter-type","onClick"],Z6e={class:"select-display"},H6e={class:"select-label"},Y6e={key:0,class:"dropdown-menu type-menu advanced-select-menu"},Q6e={class:"advanced-select-content"},$6e={__name:"CornersZoneFilters",props:{filters:{type:Array,default:()=>[]},initialValues:{type:Array,default:()=>[]},isEditMode:{type:Boolean,default:!1},componentId:{type:Number,default:17},viewConfig:{type:Object,default:()=>({})},defaultFilters:{type:Object,default:()=>null}},emits:["filters-changed","filter-updated","change","remove-views"],setup(e,{expose:a,emit:i}){const k=e,j=i,g=r.ref([]);let m=null;const n=r.ref(null),f=r.ref(null),l=r.ref([]);let t=!1,_=null;const b=(U,z)=>{if(Array.isArray(U)&&Array.isArray(z)){if(U.length!==z.length)return!1;for(let L=0;L<U.length;L++)if(U[L]!==z[L])return!1;return!0}return U===z},v=(U,z=!0)=>{if(k.filters&&k.filters[0]&&k.filters[1]&&k.filters[1].options){const L=k.filters[0].options,C=k.filters[1].options;U!=null?L.findIndex(q=>q.value===U)!==-1&&C[U]?(l.value=C[U],z&&!(()=>{const q=g.value[1];return q==null?!1:Array.isArray(q)?q.length>0:q!==""})()&&!t&&l.value.length>0&&(g.value[1]=l.value[0].value,r.nextTick(()=>{}))):(l.value=[],g.value[1]=null):(l.value=[],g.value[1]=null)}},h=()=>{k.initialValues&&k.initialValues.length>0?k.initialValues.length>0&&(typeof k.initialValues[0]=="number"||typeof k.initialValues[0]=="boolean"||k.initialValues[0]===null||Array.isArray(k.initialValues[0]))?g.value=[...k.initialValues]:k.isEditMode?g.value=k.filters.map((U,z)=>{var L,C,q,N,P,T,E,R,W,K;const X=k.initialValues[z];return X?U.type==="radio-button"&&X.selectedOption?X.selectedOption.value:U.type==="radio-button"&&!X.selectedOption?X.selectedValue!==void 0?X.selectedValue:((T=(P=U.options)==null?void 0:P[0])==null?void 0:T.value)||null:U.type==="select-simple"&&X.selectedValue!==void 0?Array.isArray(X.selectedValue)?X.selectedValue[0]:X.selectedValue:U.type==="select"&&X.selectedOptions?X.selectedOptions.map(D=>D.value):U.type==="check"&&X.isChecked!==void 0?X.isChecked:X.selectedValue!==void 0?X.selectedValue:U.type==="select"?[]:U.type==="check"||U.type==="switch"?!1:U.type==="radio-button"?((R=(E=U.options)==null?void 0:E[0])==null?void 0:R.value)||null:U.type==="select-simple"?((K=(W=U.options)==null?void 0:W[0])==null?void 0:K.value)||null:U.type==="advanced-select"?{}:null:U.type==="select"?[]:U.type==="check"||U.type==="switch"?!1:U.type==="radio-button"?((C=(L=U.options)==null?void 0:L[0])==null?void 0:C.value)||null:U.type==="select-simple"&&((N=(q=U.options)==null?void 0:q[0])==null?void 0:N.value)||null}):g.value=[...k.initialValues]:g.value=k.filters.map(U=>{var z,L,C,q;return U.type==="select"?[]:U.type==="check"||U.type==="switch"?!1:U.type==="radio-button"?((L=(z=U.options)==null?void 0:z[0])==null?void 0:L.value)||null:U.type==="select-simple"?((q=(C=U.options)==null?void 0:C[0])==null?void 0:q.value)||null:U.type==="advanced-select"?{}:null}),g.value.some(U=>U!=null&&(Array.isArray(U)?U.length>0:typeof U=="object"&&!Array.isArray(U)?Object.keys(U).length>0:U!==!1&&U!==""))&&(m=[...g.value],j("filters-changed",{componentId:k.componentId,filters:g.value,timestamp:new Date().toISOString()}))};h(),setTimeout(()=>{r.nextTick(()=>{if(g.value[0]!==null&&g.value[0]!==void 0&&!t){const U=!(()=>{const z=g.value[1];return z==null?!1:Array.isArray(z)?z.length>0:z!==""})();v(g.value[0],U)}})},300),r.watch(()=>k.initialValues,U=>{if(!U||U.length===0)return;const z=U.length>0&&(typeof U[0]=="number"||typeof U[0]=="boolean"||U[0]===null||Array.isArray(U[0])),L=!b(g.value,U),C=U&&U.length>0&&!t&&L,q=k.isEditMode&&t;C&&!q?z?g.value=[...U]:k.isEditMode?g.value=k.filters.map((N,P)=>{const T=U[P];return T?N.type==="radio-button"&&T.selectedOption?T.selectedOption.value:N.type==="select-simple"&&T.selectedValue!==void 0?Array.isArray(T.selectedValue)?T.selectedValue[0]:T.selectedValue:N.type==="select"&&T.selectedOptions?T.selectedOptions.map(E=>E.value):N.type==="check"&&T.isChecked!==void 0||N.type==="switch"&&T.isChecked!==void 0?T.isChecked:N.type==="switch"&&T.selectedValue!==void 0||N.type==="advanced-select"&&T.selectedValue!==void 0||T.selectedValue!==void 0?T.selectedValue:g.value[P]:g.value[P]}):g.value=[...U]:t?_&&_.length>0&&(g.value=[..._]):q&&_&&_.length>0&&(g.value=[..._])},{deep:!0}),r.watch(()=>k.isEditMode,(U,z)=>{z===!0&&U===!1&&(_=null)},{immediate:!0}),r.watch(g,U=>{U.some(z=>z!=null&&(Array.isArray(z)?z.length>0:typeof z=="object"&&!Array.isArray(z)?Object.keys(z).length>0:z!==!1&&z!==""))&&(()=>{if(!m)return!0;for(let z=0;z<U.length;z++)if(!b(U[z],m[z]))return!0;return!1})()&&(m=[...U],j("filters-changed",{componentId:k.componentId,filters:U,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),r.watch(()=>g.value[0],(U,z)=>{U!==z&&z!==void 0?v(U,!0):z===void 0&&U!==null&&U!==void 0&&v(U,!1)},{immediate:!0});const o=U=>{n.value===U?n.value=null:(n.value=U,f.value=null)},s=U=>{f.value===U?f.value=null:(f.value=U,n.value=null)},p=(U,z)=>{if(t=!0,setTimeout(()=>{t=!1},1e3),g.value[U]=z,(U===0||U===1)&&(_=[...g.value]),n.value=null,U===0){g.value[1]!==void 0&&(g.value[1]=null);const L=t;t=!1,v(z,!0),t=L,g.value[1]!==null&&g.value[1]!==void 0&&(_=[...g.value])}},c=()=>{t=!0,setTimeout(()=>{t=!1},400)},d=U=>{t=!0,setTimeout(()=>{t=!1},400),g.value[U]=!g.value[U]},x=U=>{t=!0,setTimeout(()=>{t=!1},400),g.value[U.filterIndex]||(g.value[U.filterIndex]={}),g.value[U.filterIndex][U.optionIndex]=U.values},w=()=>g.value,S=(U,z)=>{const L=g.value[z];if(L==null)return null;if(z===1&&l.value.length>0){const C=l.value.find(q=>q.value===L);return C?C.label:null}if(U.options&&Array.isArray(U.options)){const C=U.options.find(q=>q.value===L);return C?C.label:null}return null},V=(U,z)=>{const L=g.value[z];if(!L||typeof L!="object"||Array.isArray(L))return null;const C=Object.values(L).reduce((q,N)=>Array.isArray(N)&&N.length>0?q+N.length:q,0);return C>0?`${C} seleccionado${C>1?"s":""}`:null},O=U=>{const z=U.target,L=z.closest(".advanced-select-dropdown"),C=z.closest(".custom-select.dynamic-select");!L&&!C&&(f.value=null,n.value=null)};return r.onMounted(()=>{document.addEventListener("click",O)}),r.onUnmounted(()=>{document.removeEventListener("click",O)}),a({getCurrentValues:w,initializeValues:h}),(U,z)=>(r.openBlock(),r.createElementBlock("div",k6e,[e.filters&&e.filters.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.filters,(L,C)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:C},[L.type==="radio-button"?(r.openBlock(),r.createElementBlock("div",N6e,[r.createElementVNode("div",V6e,r.toDisplayString(L.label),1),r.createElementVNode("div",O6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(L.options,q=>(r.openBlock(),r.createElementBlock("label",{key:q.value,class:r.normalizeClass(["radio-option-card",{active:g.value[C]===q.value}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"corners-zone-radio-"+C,value:q.value,"onUpdate:modelValue":N=>g.value[C]=N,onChange:c},null,40,L6e),[[r.vModelRadio,g.value[C]]]),r.createElementVNode("span",null,r.toDisplayString(q.label),1)],2))),128))])])):L.type==="select-simple"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[C==2?(r.openBlock(),r.createElementBlock("div",U6e)):r.createCommentVNode("",!0),r.createElementVNode("div",q6e,[r.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":L.type,onClick:r.withModifiers(q=>o(C),["stop"])},[r.createElementVNode("div",C6e,[z[1]||(z[1]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),r.createElementVNode("span",P6e,r.toDisplayString(S(L,C)||L.label_2||L.label||"Tipo de análisis"),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:n.value===C}])},[...z[0]||(z[0]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),n.value===C?(r.openBlock(),r.createElementBlock("div",E6e,[r.createElementVNode("div",F6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C===1?l.value:L.options,q=>(r.openBlock(),r.createElementBlock("div",{key:q.value,class:r.normalizeClass(["option-card simple-select-option",{active:b(g.value[C],q.value)}]),onClick:r.withModifiers(N=>p(C,q.value),["stop"])},[r.createElementVNode("div",M6e,[r.createElementVNode("div",j6e,r.toDisplayString(q.label),1)]),b(g.value[C],q.value)?(r.openBlock(),r.createElementBlock("div",W6e,[...z[2]||(z[2]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):r.createCommentVNode("",!0)],10,R6e))),128))])])):r.createCommentVNode("",!0)],8,z6e)])],64)):L.type==="switch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createElementVNode("div",K6e,[r.createElementVNode("label",A6e,[L.label_1?(r.openBlock(),r.createElementBlock("span",I6e,r.toDisplayString(L.label_1),1)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"switch",onClick:q=>d(C)},[r.createElementVNode("div",{class:r.normalizeClass(["switch-track",{"switch-on":g.value[C]}])},[r.createElementVNode("div",{class:r.normalizeClass(["switch-thumb",{on:g.value[C]}])},null,2)],2)],8,X6e),L.label_2?(r.openBlock(),r.createElementBlock("span",D6e,r.toDisplayString(L.label_2),1)):r.createCommentVNode("",!0)])]),C>=0?(r.openBlock(),r.createElementBlock("div",J6e)):r.createCommentVNode("",!0)],64)):L.type==="advanced-select"?(r.openBlock(),r.createElementBlock("div",B6e,[r.createElementVNode("div",{class:"custom-select dynamic-select filter-inline advanced-select-dropdown","data-filter-type":L.type,onClick:r.withModifiers(q=>s(C),["stop"])},[r.createElementVNode("div",Z6e,[z[4]||(z[4]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),r.createElementVNode("span",H6e,r.toDisplayString(V(L,C)||L.label||"Seleccionar"),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:f.value===C}])},[...z[3]||(z[3]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),f.value===C?(r.openBlock(),r.createElementBlock("div",Y6e,[r.createElementVNode("div",Q6e,[r.createVNode(T6e,{filter:L,"filter-index":C,"selected-values":g.value,onUpdateSelection:x,onClose:q=>s(C)},null,8,["filter","filter-index","selected-values","onClose"])])])):r.createCommentVNode("",!0)],8,G6e)])):r.createCommentVNode("",!0)],64))),128))],2)):r.createCommentVNode("",!0)]))}},e4e=Bc($6e,[["__scopeId","data-v-65027e1a"]]),t4e={class:"floating-bar"},r4e={class:"tab active"},n4e={class:"select-display"},a4e={class:"select-icon"},i4e=["src"],o4e={key:1,src:"https://golstatsimages.blob.core.windows.net/images-library/vector2.png",alt:"icono",class:"option-img-default"},s4e={key:0,class:"select-placeholder select-label"},l4e={key:1,class:"select-label"},c4e={key:0,class:"dropdown-menu field-menu"},u4e=["onClick"],d4e={class:"option-icon"},p4e=["src","data-hover-src"],h4e={class:"option-content"},f4e={class:"option-title"},m4e={key:0,class:"option-description"},y4e={class:"select-display"},g4e={class:"select-icon"},v4e=["src"],b4e=["src"],x4e={class:"select-label"},w4e={key:0,class:"dropdown-menu type-menu type-menu-grid"},_4e={class:"option-grid"},S4e=["onClick"],T4e={class:"option-grid-title"},k4e={class:"option-grid-icon"},N4e=["src"],V4e={key:1,class:"filter-separator"},O4e=["onClick"],L4e={class:"select-display"},U4e={key:0,class:"badge-categorias"},q4e={key:0,class:"dropdown-menu type-menu multi-select-menu"},z4e={class:"multi-select-scroll-area"},C4e={class:"select-all-checkbox"},P4e=["checked","indeterminate","onChange"],E4e={class:"option-checkbox"},F4e=["checked","onChange"],R4e=["onClick"],M4e={class:"option-title"},j4e={class:"multi-select-footer"},W4e={key:1,class:"custom-radio-group filter-inline"},K4e={class:"radio-label"},A4e={class:"radio-options"},I4e=["name","value","onUpdate:modelValue","disabled","onChange"],X4e={key:2,class:"check-group filter-inline"},D4e=["onUpdate:modelValue","checked"],J4e=["data-filter-type","onClick"],B4e={class:"select-display"},G4e={key:0,class:"dropdown-menu type-menu simple-select-menu"},Z4e={class:"simple-select-scroll-area"},H4e=["onMouseenter","onClick"],Y4e={class:"option-content"},Q4e={class:"option-title"},$4e={key:0,class:"option-checkmark"},eke={key:4,class:"filter-separator"},tke=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(e,{expose:a,emit:i}){const k=e,j=i,g=r.ref(new Map),m=r.ref([]);let n=null,f=null,l=null;const t=r.ref(!1),_=r.ref(!1),b=r.ref(!1),v=r.ref(!1),h=r.ref(!1),o=r.ref(!1),s=r.computed(()=>m.value),p=r.ref(null),c=r.computed(()=>s.value[p.value]||null),d=r.computed(()=>{var me;const qe=((me=c.value)==null?void 0:me.views)||[];return q(qe)}),x=r.ref(null),w=r.computed(()=>d.value.find(me=>me.id===x.value)||null),S=r.ref([]),V=r.computed(()=>{var me,qe;return t.value?((me=w.value)==null?void 0:me.filters_edition_mode)||[]:((qe=w.value)==null?void 0:qe.filters)||[]});r.watch(t,me=>{me||(_.value=!1)}),r.watch(w,me=>{var qe,Re;if(!me){S.value=[];return}const Ke=me.id===6&&k.isPostMatch,rt=me.id===14;if(!Array.isArray(V.value)&&!Ke&&!rt){S.value=[];return}v.value||(Ke||rt?S.value=[]:S.value=V.value.map((nt,pt)=>{var _t,St,jt,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut,kt,vt,wt,Vt,at,Qe;if(nt.type==="select"){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt){if(xt.selectedOptions&&Array.isArray(xt.selectedOptions))return xt.selectedOptions.map(Ft=>Ft.value);if(xt.selectedValue&&Array.isArray(xt.selectedValue))return xt.selectedValue.length>0&&xt.selectedValue[0]&&typeof xt.selectedValue[0]=="object"?je(xt.selectedValue):xt.selectedValue}}return me.id===4&&nt.options&&Array.isArray(nt.options)?nt.options.map(xt=>xt.value):[]}else if(nt.type==="radio-button"){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt&&xt.selectedOption){let Ft=xt.selectedOption.value;if(me.id===15&&pt===0&&Ft===3&&((St=(_t=f==null?void 0:f.view)==null?void 0:_t.filterMultiple)==null?void 0:St.isHomeTeam)!==void 0){const Rt=f.view.filterMultiple.isHomeTeam;typeof Rt=="boolean"?Ft=Rt?1:2:typeof Rt=="number"&&(Ft=Rt===1?1:2)}return Ft}}if(me.id===7&&t.value&&f!=null&&f.view){if(pt===0&&(jt=f.view.componentProps)!=null&&jt.analysisType)return f.view.componentProps.analysisType==="offensive"?1:2;if(pt===1&&((It=f.view.filterMultiple)==null?void 0:It.isHomeTeam)!==void 0)return f.view.filterMultiple.isHomeTeam?1:2}return((lt=(Jt=nt.options)==null?void 0:Jt[0])==null?void 0:lt.value)??null}else if(nt.type==="select-simple"){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt&&xt.selectedValue!==void 0){let Ft;return me.id===2&&(dt=(tt=f==null?void 0:f.view)==null?void 0:tt.filterMultiple)!=null&&dt.categoryId?Ft=f.view.filterMultiple.categoryId:me.id===1&&(Et=(gt=f==null?void 0:f.view)==null?void 0:gt.filterMultiple)!=null&&Et.category?Ft=f.view.filterMultiple.category:me.id===6&&(it=(Lt=f==null?void 0:f.view)==null?void 0:Lt.filterMultiple)!=null&&it.gameNumber?Ft=f.view.filterMultiple.gameNumber:Ft=Array.isArray(xt.selectedValue)?xt.selectedValue[0]:xt.selectedValue,Ft}}if(me.id===2&&t.value&&f!=null&&f.view){if(n&&f.view.id){const xt=n.getComponentDynamicFilters(f.view.id);if(xt&&xt[pt]!==void 0)return xt[pt]}if(f.view.filterMultiple){if(nt.type==="select-simple"&&f.view.filterMultiple.categoryId){const xt=f.view.filterMultiple.categoryId;return(nt.options||[]).find(Ft=>Ft.value==xt),xt}if(nt.type==="radio-button"&&f.view.filterMultiple.teamType!==void 0){const xt=f.view.filterMultiple.teamType;return(nt.options||[]).find(Ft=>Ft.value==xt),xt}}}if(me.id===1&&t.value&&(ct=f==null?void 0:f.view)!=null&&ct.filterMultiple&&f.view.filterMultiple.category){const xt=f.view.filterMultiple.category;return(nt.options||[]).find(Ft=>Ft.value==xt),xt}if(me.id===9&&t.value&&(Ge=f==null?void 0:f.view)!=null&&Ge.filterMultiple&&nt.type==="select-simple"&&f.view.filterMultiple.categoryIds){const xt=Array.isArray(f.view.filterMultiple.categoryIds)?f.view.filterMultiple.categoryIds:[f.view.filterMultiple.categoryIds],Ft=(nt.options||[]).filter(Rt=>Array.isArray(Rt.value)?Pe(Rt.value,xt):xt.includes(Rt.value));return Ft.length>0?Ft[0].value:xt}if(me.id===6&&t.value&&(ut=f==null?void 0:f.view)!=null&&ut.filterMultiple&&f.view.filterMultiple.gameNumber){const xt=f.view.filterMultiple.gameNumber;return(nt.options||[]).find(Ft=>Ft.value==xt),xt}if(me.id===5&&t.value&&(kt=f==null?void 0:f.view)!=null&&kt.filterMultiple&&f.view.filterMultiple.isHomeTeam!==void 0){const xt=f.view.filterMultiple.isHomeTeam;let Ft;if(typeof xt=="boolean"?Ft=xt?1:2:typeof xt=="number"?Ft=xt===1?1:2:Ft=1,(nt.options||[]).find(Rt=>Rt.value==Ft),nt.type==="radio-button"&&(nt.label==="Equipo"||nt.label==="Team"||nt.label==="Equipo seleccionado"))return Ft}if(me.id===15&&t.value&&(vt=f==null?void 0:f.view)!=null&&vt.filterMultiple&&f.view.filterMultiple.isHomeTeam!==void 0&&nt.type==="radio-button"&&pt===0){const xt=f.view.filterMultiple.isHomeTeam;let Ft;if(typeof xt=="boolean"?Ft=xt?1:2:typeof xt=="number"?Ft=xt===1?1:2:Ft=1,(nt.options||[]).find(Rt=>Rt.value==Ft))return Ft}if(me.id===9&&t.value&&(wt=f==null?void 0:f.view)!=null&&wt.filterMultiple&&nt.type==="radio-button"&&f.view.filterMultiple.isHomeTeam!==void 0){const xt=f.view.filterMultiple.isHomeTeam?1:2,Ft=((Vt=nt.options)==null?void 0:Vt.map(Rt=>Rt.value))||[];return Ft.includes(xt)?xt:Ft[0]||1}return((Qe=(at=nt.options)==null?void 0:at[0])==null?void 0:Qe.value)??null}else if(nt.type==="check"){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt&&xt.isChecked!==void 0)return xt.isChecked}if(me.id===8)return!0;if(me.id===3){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt&&xt.isChecked!==void 0)return xt.isChecked}return!1}return!1}return null}),!((qe=me.name)!=null&&qe.toLowerCase().includes("tops players")||(Re=me.title)!=null&&Re.toLowerCase().includes("tops players"))&&(!t.value||Ke)&&r.nextTick(()=>{var nt,pt;me.id===4&&t.value&&(nt=f==null?void 0:f.view)!=null&&nt.id&&n&&n.setDynamicFilters(S.value,f.view.id),me.id===3&&t.value&&(pt=f==null?void 0:f.view)!=null&&pt.id&&n&&n.setDynamicFilters(S.value,f.view.id),ae()}))},{immediate:!0}),r.watch(()=>n,me=>{me&&me.dynamicFilters&&Array.isArray(me.dynamicFilters)&&(v.value=!0,S.value=[...me.dynamicFilters],r.nextTick(()=>{v.value=!1}))},{deep:!0}),r.watch(()=>n==null?void 0:n.dynamicFilters,me=>{if(me&&Array.isArray(me)){if(h.value)return;v.value=!0,S.value=[...me],r.nextTick(()=>{v.value=!1})}},{deep:!0}),r.watch(()=>w.value,me=>{if(t.value&&l&&me&&me.filters){if(v.value||o.value)return;if(me.id===3){if(h.value||o.value)return;const qe=l.dynamicFilters.find(Re=>Re.filterType==="check");qe&&qe.isChecked!==void 0&&S.value&&S.value.length>0&&(h.value=!0,S.value[0]=qe.isChecked,r.nextTick(()=>{S.value=[...S.value],h.value=!1}))}setTimeout(()=>{(!S.value||S.value.length===0)&&(Be(),Ee(),ve()),me.id===4&&ze()},100)}},{deep:!0}),r.watch(()=>{var me;return(me=w.value)==null?void 0:me.id},me=>{if(t.value&&l&&me===4){if(v.value||o.value)return;setTimeout(()=>{ze()},200)}}),r.watch(()=>S.value,me=>{if(t.value&&l&&me&&me.length>0){if(v.value||h.value||o.value)return;setTimeout(()=>{var qe;ke()&&(Be(),Ee(),ve(),((qe=w.value)==null?void 0:qe.id)===4&&ze())},50)}},{deep:!0});function O(me,qe){var Re,Ke,rt,nt,pt;const _t=S.value[me];if((Re=w.value)==null||Re.id,(Ke=w.value)==null||Ke.id,Array.isArray(_t)){if(((rt=w.value)==null?void 0:rt.id)===4&&me===0){const St=_t.some(jt=>{if(qe.category_id&&qe.event_type_id){if(jt.category_id&&jt.event_type_id)return jt.category_id===qe.category_id&&jt.event_type_id===qe.event_type_id;if(jt.event_type_id&&!jt.category_id)return jt.event_type_id===qe.event_type_id;if(jt.category_id&&!jt.event_type_id)return jt.category_id===qe.category_id}else{if(qe.event_type_id)return jt.event_type_id===qe.event_type_id;if(qe.category_id)return jt.category_id===qe.category_id}return JSON.stringify(jt)===JSON.stringify(qe)});return(nt=w.value)==null||nt.id,St}return _t.includes(qe)}else if(_t!=null)return(pt=w.value)==null||pt.id,_t===qe;return!1}function U(me,qe){var Re,Ke,rt;const nt=(Ke=(Re=w.value)==null?void 0:Re.filters)==null?void 0:Ke[me];if((nt==null?void 0:nt.type)==="select-simple"){ie(me,qe);return}Array.isArray(S.value[me])||(S.value[me]=[]);const pt=S.value[me];let _t=-1;((rt=w.value)==null?void 0:rt.id)===4&&me===0?_t=pt.findIndex(St=>qe.category_id&&qe.event_type_id?St.category_id===qe.category_id&&St.event_type_id===qe.event_type_id:qe.event_type_id?St.event_type_id===qe.event_type_id:qe.category_id?St.category_id===qe.category_id:!1):_t=pt.indexOf(qe),_t>-1?pt.splice(_t,1):pt.push(qe),t.value&&Ue(),ae()}function z(me){var qe,Re;const Ke=S.value[me],rt=(Re=(qe=w.value)==null?void 0:qe.filters)==null?void 0:Re[me];return(rt==null?void 0:rt.type)==="select-simple"||!rt||!rt.options||!Array.isArray(Ke)?!1:Ke.length===rt.options.length}function L(me){var qe,Re;const Ke=S.value[me],rt=(Re=(qe=w.value)==null?void 0:qe.filters)==null?void 0:Re[me];return(rt==null?void 0:rt.type)==="select-simple"||!rt||!rt.options||!Array.isArray(Ke)?!1:Ke.length>0&&Ke.length<rt.options.length}function C(){var me;return!(((me=w.value)==null?void 0:me.id)===6&&k.isPostMatch)}function q(me){return!me||!Array.isArray(me)?me:me.filter(qe=>{const Re=(qe.name||qe.title||"").toLowerCase();return k.isPostMatch?!0:!["resumen general","timeline","datos relevantes"].some(Ke=>Re.includes(Ke))})}function N(){var me,qe;const Re=((qe=(me=c.value)==null?void 0:me.name)==null?void 0:qe.toLowerCase())||"";return Re.includes("cancha")||Re.includes("volumétrica")||Re.includes("volumetric")}function P(me,qe){if(!t.value||!N())return!1;const Re=String(me||"").toLowerCase(),Ke=String(qe||"").toLowerCase();return Re.includes("ambos")||Ke.includes("ambos")}function T(me){var qe,Re;const Ke=(Re=(qe=w.value)==null?void 0:qe.filters)==null?void 0:Re[me];if(!Ke||!Ke.options)return;const rt=Ke.options.map(nt=>nt.value);Array.isArray(S.value[me])||(S.value[me]=[]),z(me)?S.value[me]=[]:S.value[me]=[...rt],K.value=me,ae()}const E=r.ref("ambos"),R=r.ref(!1),W=r.ref(!1),K=r.ref(null),X=r.ref(null);function D(me,qe=!1){const Re="https://golstatsimages.blob.core.windows.net/images-library/",Ke="https://golstatsimages.blob.core.windows.net/reports-images/",rt={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"},nt=Object.keys(rt).find(pt=>me==null?void 0:me.toLowerCase().includes(pt.toLowerCase()));if(nt){const pt=rt[nt],_t=qe?"":"-def";return nt.toLowerCase().includes("tabla")?`${Ke}${pt}${_t}@2x.png`:`${Re}${pt}${_t}@2x.png`}return`${Re}icn_default${qe?"":"-def"}.png`}function H(){return c.value?c.value.name:"Tipo de vista"}function ne(){return w.value?w.value.name||w.value.title:"Visualización"}function B(){t.value||(R.value=!R.value,R.value&&(W.value=!1,r.nextTick(()=>{Le()})))}function re(){t.value||c.value&&(W.value=!W.value,W.value&&(R.value=!1))}function ee(me){t.value||(p.value=me,R.value=!1,x.value=null,ae())}function Y(me){var qe,Re;t.value||(x.value=me.id,W.value=!1,(qe=me.name)!=null&&qe.toLowerCase().includes("tops players")||(Re=me.title)==null||Re.toLowerCase().includes("tops players"))}function $(me){var qe;K.value=K.value===me?null:me,((qe=w.value)==null?void 0:qe.id)===4&&t.value&&me===0&&setTimeout(()=>{S.value=[...S.value]},50)}function le(me){X.value=X.value===me?null:me}function ie(me,qe){var Re,Ke,rt,nt,pt;if(((Re=w.value)==null?void 0:Re.id)===2){const _t=V.value.findIndex(St=>St.type==="select-simple"&&St.label==="Tipo de análisis");me===_t?S.value[0]=qe:S.value[me]=qe}else if(((Ke=w.value)==null?void 0:Ke.id)===1)S.value[0]=qe;else if(((rt=w.value)==null?void 0:rt.id)===6)S.value[0]=qe;else if(((nt=w.value)==null?void 0:nt.id)===9)if(me===0){Array.isArray(qe)?S.value[me]=qe:S.value[me]=[qe];const _t=((pt=V.value[me])==null?void 0:pt.options)||[],St=Array.isArray(qe)?qe:[qe],jt=_t.find(It=>Array.isArray(It.value)?Pe(It.value,St):St.includes(It.value));jt?S.value[me]=jt.value:S.value[me]=St}else S.value[me]=qe;else S.value[me]=qe;X.value=null,t.value&&Ue(),ae()}function ue(me){me.target.closest(".custom-select")||(R.value=!1,W.value=!1,X.value=null)}const he=[16];function ae(){var me,qe,Re,Ke,rt,nt,pt,_t,St,jt,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut;if(he.includes((me=w.value)==null?void 0:me.id)||v.value)return;let kt=[],vt=[];w.value&&Array.isArray(V.value)&&V.value.forEach((Qe,xt)=>{if(Qe.type==="select"&&Qe.label==="Tipo de análisis"&&Qe.id===2){const Ft=S.value[xt]||[];Array.isArray(Ft)&&Ft.length>0&&(kt=Ft.map(Rt=>{var qt;const Ht=(qt=Qe.options)==null?void 0:qt.find(At=>At.value===Rt);return{value:Rt,label:(Ht==null?void 0:Ht.label)||Rt}}))}});const wt=((qe=w.value)==null?void 0:qe.id)===4;if(w.value&&Array.isArray(w.value.filters)&&w.value.filters.some(Qe=>Qe.type==="select"&&Qe.label==="Tipo de análisis"&&Qe.id===2)&&kt.length===0&&!wt)return;if(wt&&S.value&&S.value.length>0){const Qe=S.value[0];Array.isArray(Qe)&&Qe.length>0}vt=((Re=V.value)==null?void 0:Re.map((Qe,xt)=>{var Ft,Rt,qt,Ht;const At=S.value[xt];let Yt=Qe.id||`filter_${xt}`;return((Ft=w.value)==null?void 0:Ft.id)===3&&t.value&&(Rt=f==null?void 0:f.view)!=null&&Rt.id&&(Yt=`filter_${xt}_component_${f.view.id}`),{filterId:Yt,filterType:Qe.type,filterLabel:Qe.label,filterIcon:Qe.icon||null,selectedValue:At,selectedOptions:Qe.type==="select"&&Array.isArray(At)&&At.length>0?At.map(Bt=>{var Gt;const or=(Gt=Qe.options)==null?void 0:Gt.find(sr=>sr.value===Bt);return{value:Bt,label:(or==null?void 0:or.label)||Bt,icon:(or==null?void 0:or.icon)||null}}):null,selectedOption:Qe.type==="radio-button"&&At!=null?{value:At,label:((Ht=(qt=Qe.options)==null?void 0:qt.find(Bt=>Bt.value===At))==null?void 0:Ht.label)||At}:null,isChecked:Qe.type==="check"?At:null}}))||[];const Vt={mainSelector:{id:((Ke=c.value)==null?void 0:Ke.id)||null,name:((rt=c.value)==null?void 0:rt.name)||null,url:((nt=c.value)==null?void 0:nt.url)||null},viewSelector:{id:((pt=w.value)==null?void 0:pt.id)||null,name:((_t=w.value)==null?void 0:_t.name)||((St=w.value)==null?void 0:St.title)||null,url:((jt=w.value)==null?void 0:jt.url)||null},team:E.value,dynamicFilters:vt,categoriasSeleccionadas:kt,timestamp:new Date().toISOString(),summary:{mainSelected:!!c.value,viewSelected:!!w.value,totalDynamicFilters:((It=V.value)==null?void 0:It.length)||0,activeFilters:((Jt=V.value)==null?void 0:Jt.filter((Qe,xt)=>{const Ft=S.value[xt];return Array.isArray(Ft)?Ft.length>0:Ft!=null&&Ft!==!1}).length)||0}},at={main:c.value,view:w.value,team:E.value,dynamicFilters:S.value,filtersJSON:Vt,filterAndViewsContainer:n,viewToEdit:f};if(j("filters-changed",at),t.value&&f){if(l=Vt,((lt=w.value)==null?void 0:lt.id)===2){const Qe=l.dynamicFilters.findIndex(xt=>xt.filterType==="select-simple"&&xt.filterLabel==="Tipo de análisis");Qe!==-1&&(dt=(tt=f.view)==null?void 0:tt.filterMultiple)!=null&&dt.categoryId&&(l.dynamicFilters[Qe].selectedValue=f.view.filterMultiple.categoryId)}if(((gt=w.value)==null?void 0:gt.id)===1){const Qe=l.dynamicFilters.findIndex(xt=>xt.filterType==="select-simple"&&xt.filterLabel==="Tipo de análisis");Qe!==-1&&(Lt=(Et=f.view)==null?void 0:Et.filterMultiple)!=null&&Lt.category&&(l.dynamicFilters[Qe].selectedValue=f.view.filterMultiple.category)}}if(((it=w.value)==null?void 0:it.id)===6&&t.value&&(ct=f==null?void 0:f.view)!=null&&ct.filterMultiple&&f.view.filterMultiple.gameNumber&&l){const Qe=l.dynamicFilters.findIndex(xt=>xt.filterType==="select-simple"&&xt.filterLabel==="Número de juego");Qe!==-1&&(ut=(Ge=f.view)==null?void 0:Ge.filterMultiple)!=null&&ut.gameNumber&&(l.dynamicFilters[Qe].selectedValue=f.view.filterMultiple.gameNumber)}n&&!t.value?n.setDynamicFilters(S.value):n&&t.value}function de(){f=null,l=null,n=null,p.value=null,x.value=null,E.value="ambos",S.value=[],R.value=!1,W.value=!1,K.value=null,X.value=null,t.value=!1,_.value=!1,b.value=!1}function ce(me){if(me&&me.dynamicFilters){if(h.value)return;Array.isArray(me.dynamicFilters)&&me.dynamicFilters.length>0&&(v.value=!0,S.value=[...me.dynamicFilters],r.nextTick(()=>{v.value=!1}))}}function ye(me){if(t.value=!0,me.mainSelector&&me.mainSelector.id){const qe=m.value.findIndex(Re=>Re.id===me.mainSelector.id);qe!==-1&&(p.value=qe)}me.viewSelector&&me.viewSelector.id&&c.value&&c.value.views.findIndex(qe=>qe.id===me.viewSelector.id)!==-1&&(x.value=me.viewSelector.id),me.dynamicFilters&&Array.isArray(me.dynamicFilters)&&r.nextTick(()=>{setTimeout(()=>{var qe,Re,Ke,rt,nt,pt,_t,St,jt,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut,kt,vt;if(w.value&&V.value){if(v.value)return;if(h.value=!0,me.dynamicFilters.forEach((wt,Vt)=>{var at,Qe,xt,Ft,Rt,qt,Ht,At,Yt,Bt,Gt,or,sr;if(Vt<V.value.length){const Ur=V.value[Vt];if(((at=w.value)==null?void 0:at.id)===3&&t.value,Ur.type==="check"){const zr=wt.isChecked;typeof zr=="boolean"&&(S.value[Vt]=zr)}else if(Ur.type==="select"&&wt.selectedOptions){const zr=wt.selectedOptions.map(Lr=>Lr.value);S.value[Vt]=zr}else if(Ur.type==="select"&&wt.selectedValue&&Array.isArray(wt.selectedValue))if(wt.selectedValue.length>0&&wt.selectedValue[0]&&typeof wt.selectedValue[0]=="object"){const zr=je(wt.selectedValue);S.value[Vt]=zr}else S.value[Vt]=wt.selectedValue;else if(Ur.type==="radio-button"&&wt.selectedOption)S.value[Vt]=wt.selectedOption.value;else if(Ur.type==="select-simple"&&wt.selectedValue!==void 0){let zr;((Qe=w.value)==null?void 0:Qe.id)===2&&(Ft=(xt=f==null?void 0:f.view)==null?void 0:xt.filterMultiple)!=null&&Ft.categoryId?zr=f.view.filterMultiple.categoryId:((Rt=w.value)==null?void 0:Rt.id)===1&&(Ht=(qt=f==null?void 0:f.view)==null?void 0:qt.filterMultiple)!=null&&Ht.category?zr=f.view.filterMultiple.category:((At=w.value)==null?void 0:At.id)===6&&(Bt=(Yt=f==null?void 0:f.view)==null?void 0:Yt.filterMultiple)!=null&&Bt.gameNumber?zr=f.view.filterMultiple.gameNumber:((Gt=w.value)==null?void 0:Gt.id)===9&&(sr=(or=f==null?void 0:f.view)==null?void 0:or.filterMultiple)!=null&&sr.categoryIds?zr=f.view.filterMultiple.categoryIds:zr=Array.isArray(wt.selectedValue)?wt.selectedValue[0]:wt.selectedValue,S.value[Vt]=zr}}}),((qe=w.value)==null?void 0:qe.id)===3&&t.value,((Re=w.value)==null?void 0:Re.id)===2&&t.value&&(Ke=f==null?void 0:f.view)!=null&&Ke.filterMultiple){if(f.view.filterMultiple.categoryId){const wt=V.value.findIndex(Vt=>Vt.type==="select-simple"&&Vt.label==="Tipo de análisis");if(wt!==-1){const Vt=f.view.filterMultiple.categoryId;if(S.value[0]=Vt,f.view.componentProps&&Vt){let at=`Category ${Vt}`,Qe=null;try{Qe=jh(Vt),Qe&&(at=Qe.name)}catch{const xt=V.value.findIndex(Ft=>Ft.type==="select-simple"&&Ft.label==="Tipo de análisis");if(xt!==-1){const Ft=(((rt=V.value[xt])==null?void 0:rt.options)||[]).find(Rt=>Rt.value==Vt);Ft&&(at=Ft.label)}}f.view.componentProps.categoryView=[{id:Vt,name:at}]}(((nt=V.value[wt])==null?void 0:nt.options)||[]).find(at=>at.value==Vt),r.nextTick(()=>{S.value=[...S.value]})}}if(f.view.filterMultiple.teamType!==void 0){const wt=V.value.findIndex(Vt=>Vt.type==="radio-button");if(wt!==-1){const Vt=f.view.filterMultiple.teamType;S.value[wt]=Vt,(((pt=V.value[wt])==null?void 0:pt.options)||[]).find(at=>at.value==Vt),r.nextTick(()=>{S.value=[...S.value]})}}}if(((_t=w.value)==null?void 0:_t.id)===9&&t.value&&(St=f==null?void 0:f.view)!=null&&St.filterMultiple){if(f.view.filterMultiple.categoryIds){const wt=V.value.findIndex(Vt=>Vt.type==="select-simple");if(wt!==-1){const Vt=Array.isArray(f.view.filterMultiple.categoryIds)?f.view.filterMultiple.categoryIds:[f.view.filterMultiple.categoryIds];S.value[0]=Vt;const at=(((jt=V.value[wt])==null?void 0:jt.options)||[]).filter(xt=>Array.isArray(xt.value)?Pe(xt.value,Vt):Vt.includes(xt.value));if(at.length>0){const xt=at[0].value;S.value[wt]=xt}else S.value[wt]=Vt;const Qe=S.value[wt];Pe(Qe,Vt),r.nextTick(()=>{S.value=[...S.value]})}}if(f.view.filterMultiple.isHomeTeam!==void 0){const wt=V.value.findIndex(Vt=>Vt.type==="radio-button");if(wt!==-1){const Vt=f.view.filterMultiple.isHomeTeam;let at;typeof Vt=="boolean"?at=Vt?1:2:typeof Vt=="number"?at=Vt===1?1:2:at=1,S.value[wt]=at,(((It=V.value[wt])==null?void 0:It.options)||[]).find(Qe=>Qe.value==at),r.nextTick(()=>{S.value=[...S.value]})}}}if(((Jt=w.value)==null?void 0:Jt.id)===1&&t.value&&(lt=f==null?void 0:f.view)!=null&&lt.filterMultiple&&f.view.filterMultiple.category){const wt=V.value.findIndex(Vt=>Vt.type==="select-simple"&&Vt.label==="Tipo de análisis");if(wt!==-1){const Vt=f.view.filterMultiple.category;S.value[0]=Vt,f.view.componentProps&&Vt&&(f.view.componentProps.type=Vt),(((tt=V.value[wt])==null?void 0:tt.options)||[]).find(at=>at.value==Vt),r.nextTick(()=>{S.value=[...S.value]})}}if(((dt=w.value)==null?void 0:dt.id)===6&&t.value&&(gt=f==null?void 0:f.view)!=null&&gt.filterMultiple&&f.view.filterMultiple.gameNumber){const wt=V.value.findIndex(Vt=>Vt.type==="select-simple"&&Vt.label==="Número de juego");if(wt!==-1){const Vt=f.view.filterMultiple.gameNumber;S.value[0]=Vt,f.view.componentProps&&Vt&&(f.view.componentProps.gameNumber=Vt),(((Et=V.value[wt])==null?void 0:Et.options)||[]).find(at=>at.value==Vt),r.nextTick(()=>{S.value=[...S.value]})}}if(((Lt=w.value)==null?void 0:Lt.id)===7&&t.value&&f!=null&&f.view){if((it=f.view.componentProps)!=null&&it.analysisType&&V.value.length>0&&((ct=V.value[0])==null?void 0:ct.type)==="radio-button"){const wt=f.view.componentProps.analysisType==="offensive"?1:2;S.value[0]=wt}if(((Ge=f.view.filterMultiple)==null?void 0:Ge.isHomeTeam)!==void 0){const wt=V.value.findIndex(Vt=>Vt.type==="radio-button"&&Vt.label==="Equipo");if(wt!==-1){const Vt=f.view.filterMultiple.isHomeTeam?1:2;S.value[1]=Vt}else if(V.value.length>1&&((ut=V.value[1])==null?void 0:ut.type)==="radio-button"){const Vt=f.view.filterMultiple.isHomeTeam,at=Vt?1:2;S.value[1]=at,f.view.componentProps&&(f.view.componentProps.isHomeTeamForAnalysis=Vt),(((kt=V.value[1])==null?void 0:kt.options)||[]).find(Qe=>Qe.value==at),r.nextTick(()=>{S.value=[...S.value]})}if(wt!==-1&&f.view.componentProps){const Vt=f.view.filterMultiple.isHomeTeam,at=Vt?1:2;f.view.componentProps.isHomeTeamForAnalysis=Vt,(((vt=V.value[wt])==null?void 0:vt.options)||[]).find(Qe=>Qe.value==at),r.nextTick(()=>{S.value=[...S.value]})}}}r.nextTick(()=>{h.value=!1})}},100)})}function xe(){var me,qe,Re,Ke,rt,nt,pt,_t,St,jt;return{mainSelector:{id:((me=c.value)==null?void 0:me.id)||null,name:((qe=c.value)==null?void 0:qe.name)||null,url:((Re=c.value)==null?void 0:Re.url)||null},viewSelector:{id:((Ke=w.value)==null?void 0:Ke.id)||null,name:((rt=w.value)==null?void 0:rt.name)||((nt=w.value)==null?void 0:nt.title)||null,url:((pt=w.value)==null?void 0:pt.url)||null},team:E.value,dynamicFilters:((_t=V.value)==null?void 0:_t.map((It,Jt)=>{var lt,tt;const dt=S.value[Jt];return{filterId:It.id||`filter_${Jt}`,filterType:It.type,filterLabel:It.label,filterIcon:It.icon||null,selectedValue:dt,selectedOptions:It.type==="select"&&Array.isArray(dt)&&dt.length>0?dt.map(gt=>{var Et;const Lt=(Et=It.options)==null?void 0:Et.find(it=>it.value===gt);return{value:gt,label:(Lt==null?void 0:Lt.label)||gt,icon:(Lt==null?void 0:Lt.icon)||null}}):null,selectedOption:It.type==="radio-button"&&dt?{value:dt,label:((tt=(lt=It.options)==null?void 0:lt.find(gt=>gt.value===dt))==null?void 0:tt.label)||dt}:null,isChecked:It.type==="check"?dt:null}}))||[],timestamp:new Date().toISOString(),summary:{mainSelected:!!c.value,viewSelected:!!w.value,totalDynamicFilters:((St=V.value)==null?void 0:St.length)||0,activeFilters:((jt=V.value)==null?void 0:jt.filter((It,Jt)=>{const lt=S.value[Jt];return Array.isArray(lt)?lt.length>0:lt!=null&&lt!==!1}).length)||0}}}a({getCurrentFiltersJSON:xe});function be(){de(),j("close",n)}function Te(){_.value=!1,be()}function Oe(){b.value&&(qa.emit("filters-cancelled",n),b.value=!1),_.value=!1,be()}r.onMounted(async()=>{document.addEventListener("click",ue),r.nextTick(()=>{Le()});const me="https://fb78a14uud.execute-api.us-east-2.amazonaws.com/qa/views";try{const qe=await(await fetch(me,{headers:{Authorization:`${k.token}`}})).json();m.value=qe.data||[],g.value.clear(),m.value&&(g.value=m.value.reduce((Re,Ke)=>(Ke.views&&Array.isArray(Ke.views)&&Ke.views.forEach(rt=>{rt.filters&&Array.isArray(rt.filters)&&Re.set(rt.id,rt)}),Re),new Map))}catch(qe){console.error("Error al obtener datos:",qe)}});function Le(){document.querySelectorAll(".field-menu .option-card").forEach(me=>{const qe=me.querySelector(".option-img");if(!qe||!qe.dataset.hoverSrc)return;const Re=qe.src,Ke=qe.dataset.hoverSrc;me.addEventListener("mouseenter",()=>{qe.src=Ke}),me.addEventListener("mouseleave",()=>{qe.src=Re})})}r.onUnmounted(()=>{document.removeEventListener("click",ue)}),qa.on("set-filter-and-views-container",me=>{n=me,me&&ce(me)}),qa.on("view-added",()=>{_.value=!0,b.value=!0}),qa.on("component-added-to-container",me=>{(!t.value||n&&me.id===n.id)&&ce(me)}),qa.on("edit-view",me=>{var qe,Re,Ke,rt,nt,pt,_t,St,jt,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut;f=me,n=((qe=me.view)==null?void 0:qe.filterAndViewsContainer)||null,l=null;const kt=[(Ke=(Re=me.view)==null?void 0:Re.coreView)==null?void 0:Ke.filtersJSON,(rt=me.view)==null?void 0:rt.filtersJSON,(nt=me.coreView)==null?void 0:nt.filtersJSON,me.filtersJSON,(_t=(pt=me.view)==null?void 0:pt.componentProps)==null?void 0:_t.filtersJSON];for(const vt of kt)if(vt){l=vt;break}if(n&&(n.viewId===4||n.viewId===8||n.viewId===3||n.viewId===1||n.viewId===2||n.viewId===13)&&(St=me.view)!=null&&St.id){const vt=n.getComponentDynamicFilters(me.view.id);if(vt){let wt="Unknown";n.viewId===4?wt="Timeline":n.viewId===8?wt="FieldPosesion":n.viewId===3?wt="GSCMatchSummary":n.viewId===1?wt="GSCComparativeReports":n.viewId===2?wt="GscTopPlayer":n.viewId===13&&(wt="GSCTimelapseTable"),l&&(n.viewId===13?l={...l,dynamicFilters:vt}:l={...l,dynamicFilters:vt.map((Vt,at)=>Array.isArray(Vt)?{selectedValue:Vt,selectedOptions:Vt.map(Qe=>({value:Qe,label:Qe}))}:typeof Vt=="boolean"?{isChecked:Vt}:wt==="GSCComparativeReports"&&at===0?{selectedValue:Vt,selectedOptions:[{value:Vt,label:Vt}]}:wt==="GscTopPlayer"&&at===0?{selectedValue:Vt,selectedOptions:[{value:Vt,label:Vt}]}:wt==="GscTopPlayer"&&at===1?{selectedOption:{value:Vt,label:Vt}}:{selectedOption:{value:Vt,label:Vt}})})}}if(n&&n.viewId===2&&(jt=me.view)!=null&&jt.filterMultiple){if(me.view.filterMultiple.categoryId&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select-simple"&&wt.filterLabel==="Tipo de análisis");vt!==-1&&(l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:me.view.filterMultiple.categoryId,selectedOptions:[{value:me.view.filterMultiple.categoryId,label:`Category ${me.view.filterMultiple.categoryId}`}]})}if(me.view.filterMultiple.teamType!==void 0&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="radio-button");if(vt!==-1){const wt=me.view.filterMultiple.teamType,Vt=wt===1?"Mi equipo":wt===2?"Rival":wt===3?"Ambos":"Equipo";l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:wt,label:Vt}}}}}if(n&&n.viewId===1&&(It=me.view)!=null&&It.filterMultiple&&me.view.filterMultiple.category&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select-simple"&&wt.filterLabel==="Tipo de análisis");vt!==-1&&(l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:me.view.filterMultiple.category,selectedOptions:[{value:me.view.filterMultiple.category,label:me.view.filterMultiple.category}]})}if(n&&n.viewId===9&&(Jt=me.view)!=null&&Jt.filterMultiple){if(me.view.filterMultiple.categoryIds&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select"&&wt.filterLabel==="Tipo de análisis");if(vt!==-1){const wt=Array.isArray(me.view.filterMultiple.categoryIds)?me.view.filterMultiple.categoryIds:[me.view.filterMultiple.categoryIds];l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:wt,selectedOptions:wt.map(Qe=>({value:Qe,label:`Category ${Qe}`}))};const Vt=me.view.filterMultiple.categoryIds;Pe(Vt,wt);const at=(((lt=V.value[vt])==null?void 0:lt.options)||[]).filter(Qe=>Array.isArray(Qe.value)?Pe(Qe.value,wt):wt.includes(Qe.value));if(at.length>0){const Qe=at[0];l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:Qe.value,selectedOptions:[Qe]}}}}if(me.view.filterMultiple.isHomeTeam!==void 0&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="radio-button");if(vt!==-1){const wt=me.view.filterMultiple.isHomeTeam;let Vt,at;typeof wt=="boolean"?(Vt=wt?1:2,at=wt?"Mi equipo":"Rival"):typeof wt=="number"?(Vt=wt===1?1:2,at=wt===1?"Mi equipo":"Rival"):(Vt=1,at="Mi equipo"),l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Vt,label:at}}}}}if(n&&n.viewId===6&&(tt=me.view)!=null&&tt.filterMultiple&&me.view.filterMultiple.gameNumber&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select-simple"&&wt.filterLabel==="Número de juego");vt!==-1&&(l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:me.view.filterMultiple.gameNumber,selectedOptions:[{value:me.view.filterMultiple.gameNumber,label:`Juego ${me.view.filterMultiple.gameNumber}`}]})}if(n&&n.viewId===7&&me.view&&l){if((dt=me.view.componentProps)!=null&&dt.analysisType){const vt=l.dynamicFilters.findIndex((wt,Vt)=>wt.filterType==="radio-button"&&Vt===0);if(vt!==-1){const wt=me.view.componentProps.analysisType,Vt=wt==="offensive"?1:2,at=wt==="offensive"?"A favor":"En contra";l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Vt,label:at}}}}if(((gt=me.view.filterMultiple)==null?void 0:gt.isHomeTeam)!==void 0){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="radio-button"&&wt.filterLabel==="Equipo");if(vt!==-1){const wt=me.view.filterMultiple.isHomeTeam,Vt=wt?1:2,at=wt?"Equipo propio":"Equipo rival";l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Vt,label:at}}}}}if(n&&n.viewId===10&&(Et=me.view)!=null&&Et.filterMultiple&&((it=(Lt=f==null?void 0:f.view)==null?void 0:Lt.coreView)==null?void 0:it.id)===10){const vt=me.view.componentProps.isHomeTeamForAnalysis?{label:"Equipo propio",value:1}:{label:"Rival",value:2};l&&(l.dynamicFilters[0]={...l.dynamicFilters[0],selectedOption:vt})}if(n&&n.viewId===15&&(ct=me.view)!=null&&ct.id){const vt=n.getComponentDynamicFilters(me.view.id);if(vt&&l)l={...l,dynamicFilters:vt.map((wt,Vt)=>{var at,Qe;if(Vt===0){let xt=wt;if(wt===3&&((Qe=(at=me.view)==null?void 0:at.filterMultiple)==null?void 0:Qe.isHomeTeam)!==void 0){const Ft=me.view.filterMultiple.isHomeTeam;typeof Ft=="boolean"?xt=Ft?1:2:typeof Ft=="number"&&(xt=Ft===1?1:2)}return{selectedOption:{value:xt,label:xt===1?"Mi equipo":"Rival"}}}else if(Vt===1)return{selectedValue:wt,selectedOptions:[{value:wt,label:`${wt} fortalezas`}]};return typeof wt=="number"?{selectedValue:wt}:{selectedOption:{value:wt,label:String(wt)}}})};else if((Ge=me.view)!=null&&Ge.filterMultiple&&l&&me.view.filterMultiple.isHomeTeam!==void 0){const wt=l.dynamicFilters.findIndex(Vt=>Vt.filterType==="radio-button"&&Vt.filterLabel==="Mi equipo");if(wt!==-1){const Vt=me.view.filterMultiple.isHomeTeam;let at,Qe;typeof Vt=="boolean"?(at=Vt?1:2,Qe=Vt?"Local":"Visitante"):typeof Vt=="number"?(at=Vt===1?1:2,Qe=Vt===1?"Local":"Visitante"):(at=1,Qe="Local"),l.dynamicFilters[wt]={...l.dynamicFilters[wt],selectedOption:{value:at,label:Qe}}}}}if(n&&n.viewId===5&&(ut=me.view)!=null&&ut.filterMultiple&&me.view.filterMultiple.isHomeTeam!==void 0&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="radio-button"&&wt.filterLabel==="Equipo");if(vt!==-1){const wt=me.view.filterMultiple.isHomeTeam;let Vt,at;typeof wt=="boolean"?(Vt=wt?1:2,at=wt?"Equipo propio":"Equipo rival"):typeof wt=="number"?(Vt=wt===1?1:2,at=wt===1?"Equipo propio":"Equipo rival"):(Vt=1,at="Equipo propio"),l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Vt,label:at}}}else{const wt=l.dynamicFilters.findIndex(Vt=>Vt.filterType==="radio-button");if(wt!==-1){const Vt=me.view.filterMultiple.isHomeTeam;let at,Qe;typeof Vt=="boolean"?(at=Vt?1:2,Qe=Vt?"Equipo propio":"Equipo rival"):typeof Vt=="number"?(at=Vt===1?1:2,Qe=Vt===1?"Equipo propio":"Equipo rival"):(at=1,Qe="Equipo propio"),l.dynamicFilters[wt]={...l.dynamicFilters[wt],selectedOption:{value:at,label:Qe}}}}}l&&ye(l),_.value=!0});function _e(){K.value=null}function Ce(me,qe){var Re;(Re=w.value)==null||Re.id}function Pe(me,qe){if(!Array.isArray(me)||!Array.isArray(qe)||me.length!==qe.length)return!1;const Re=[...me].sort((rt,nt)=>rt-nt),Ke=[...qe].sort((rt,nt)=>rt-nt);return JSON.stringify(Re)===JSON.stringify(Ke)}function Be(){if(t.value&&l&&l.dynamicFilters){if(o.value||v.value)return;o.value=!0,h.value=!0,l.dynamicFilters.forEach((me,qe)=>{var Re;if(me&&(Re=V.value)!=null&&Re[qe]){const Ke=V.value[qe];if(Ke.type==="check"&&me.isChecked!==void 0)S.value[qe]=me.isChecked;else if(Ke.type==="select"&&me.selectedOptions){const rt=me.selectedOptions.map(nt=>nt.value);S.value[qe]=rt}else Ke.type==="select"&&me.selectedValue&&Array.isArray(me.selectedValue)&&(S.value[qe]=me.selectedValue)}}),r.nextTick(()=>{h.value=!1,o.value=!1})}}function ze(){var me;if(t.value&&l&&l.dynamicFilters&&((me=w.value)==null?void 0:me.id)===4){if(o.value||v.value)return;o.value=!0,h.value=!0,l.dynamicFilters.forEach((qe,Re)=>{var Ke,rt;if(qe&&((rt=(Ke=V.value)==null?void 0:Ke[Re])==null?void 0:rt.type)==="select"){if(qe.selectedOptions){const nt=qe.selectedOptions.map(pt=>pt.value);S.value[Re]=nt}else if(qe.selectedValue&&Array.isArray(qe.selectedValue))if(qe.selectedValue.length>0&&qe.selectedValue[0]&&typeof qe.selectedValue[0]=="object"){const nt=je(qe.selectedValue);S.value[Re]=nt}else S.value[Re]=qe.selectedValue}}),setTimeout(()=>{var qe;if(S.value=[...S.value],(qe=f==null?void 0:f.view)!=null&&qe.componentProps&&S.value&&S.value.length>0){const Re=S.value[0];if(Array.isArray(Re)&&Re.length>0){const Ke=Re.some(_t=>_t.event_type_id===1||typeof _t=="string"&&_t.includes("1")),rt=Re.some(_t=>_t.category_id===8||typeof _t=="string"&&_t.includes("8")),nt=Re.some(_t=>_t.category_id===9||typeof _t=="string"&&_t.includes("9")),pt=Re.some(_t=>_t.event_type_id===3||typeof _t=="string"&&_t.includes("3"));f.view.componentProps.selectedEvents=Re,f.view.componentProps.goals=Ke,f.view.componentProps.yellowCards=rt,f.view.componentProps.redCards=nt,f.view.componentProps.substitutions=pt,f.view.componentProps.key=Re.length>0,f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps})}}},200),r.nextTick(()=>{h.value=!1,o.value=!1})}}function je(me){return!Array.isArray(me)||me.length===0?[]:me.map(qe=>{if(qe&&typeof qe=="object"){if(qe.event_type_id!==void 0||qe.category_id!==void 0)return{event_type_id:qe.event_type_id,category_id:qe.category_id,...qe.name&&{name:qe.name},...qe.label&&{label:qe.label}};if(qe.value&&typeof qe.value=="object")return{event_type_id:qe.value.event_type_id,category_id:qe.value.category_id,...qe.value.name&&{name:qe.value.name},...qe.value.label&&{label:qe.value.label}};if(typeof qe=="string"&&qe.includes("-")){const[Re,Ke]=qe.split("-");return{category_id:parseInt(Re),event_type_id:parseInt(Ke)}}}if(typeof qe=="string")if(qe.includes("-")){const[Re,Ke]=qe.split("-");return{category_id:parseInt(Re),event_type_id:parseInt(Ke)}}else{const Re=parseInt(qe);if(!isNaN(Re))return{event_type_id:Re}}return qe})}function Ee(){var me,qe,Re,Ke,rt,nt,pt,_t,St,jt,It,Jt,lt,tt;if(t.value&&l&&l.dynamicFilters&&V.value){if(o.value||v.value)return;if(o.value=!0,h.value=!0,l.dynamicFilters.forEach((dt,gt)=>{var Et,Lt,it,ct,Ge,ut,kt,vt,wt,Vt,at;if(dt&&((Et=V.value[gt])==null?void 0:Et.type)==="select"){if(dt.selectedOptions){const Qe=dt.selectedOptions.map(xt=>xt.value);S.value[gt]=Qe}else if(dt.selectedValue&&Array.isArray(dt.selectedValue))if(dt.selectedValue.length>0&&dt.selectedValue[0]&&typeof dt.selectedValue[0]=="object"){const Qe=je(dt.selectedValue);S.value[gt]=Qe}else S.value[gt]=dt.selectedValue}else if(dt&&((Lt=V.value[gt])==null?void 0:Lt.type)==="select-simple"&&dt.selectedValue!==void 0){let Qe;((it=w.value)==null?void 0:it.id)===2&&(Ge=(ct=f==null?void 0:f.view)==null?void 0:ct.filterMultiple)!=null&&Ge.categoryId?Qe=f.view.filterMultiple.categoryId:((ut=w.value)==null?void 0:ut.id)===1&&(vt=(kt=f==null?void 0:f.view)==null?void 0:kt.filterMultiple)!=null&&vt.category?Qe=f.view.filterMultiple.category:((wt=w.value)==null?void 0:wt.id)===6&&(at=(Vt=f==null?void 0:f.view)==null?void 0:Vt.filterMultiple)!=null&&at.gameNumber?Qe=f.view.filterMultiple.gameNumber:Qe=Array.isArray(dt.selectedValue)?dt.selectedValue[0]:dt.selectedValue,S.value[gt]=Qe}}),((me=w.value)==null?void 0:me.id)===4&&setTimeout(()=>{var dt;if(S.value=[...S.value],(dt=f==null?void 0:f.view)!=null&&dt.componentProps&&S.value&&S.value.length>0){const gt=S.value[0];if(Array.isArray(gt)&&gt.length>0){const Et=gt.some(Ge=>Ge.event_type_id===1||typeof Ge=="string"&&Ge.includes("1")),Lt=gt.some(Ge=>Ge.category_id===8||typeof Ge=="string"&&Ge.includes("8")),it=gt.some(Ge=>Ge.category_id===9||typeof Ge=="string"&&Ge.includes("9")),ct=gt.some(Ge=>Ge.event_type_id===3||typeof Ge=="string"&&Ge.includes("3"));f.view.componentProps.selectedEvents=gt,f.view.componentProps.goals=Et,f.view.componentProps.yellowCards=Lt,f.view.componentProps.redCards=it,f.view.componentProps.substitutions=ct,f.view.componentProps.key=gt.length>0,f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps})}}},100),((qe=w.value)==null?void 0:qe.id)===2&&(Re=f==null?void 0:f.view)!=null&&Re.filterMultiple){if(f.view.filterMultiple.categoryId){const dt=V.value.findIndex(gt=>gt.type==="select-simple"&&gt.label==="Tipo de análisis");if(dt!==-1){const gt=f.view.filterMultiple.categoryId;if(S.value[0]=gt,f.view.componentProps&&gt){let Et=`Category ${gt}`,Lt=null;try{Lt=jh(gt),Lt&&(Et=Lt.name)}catch{const it=V.value.findIndex(ct=>ct.type==="select-simple"&&ct.label==="Tipo de análisis");if(it!==-1){const ct=(((Ke=V.value[it])==null?void 0:Ke.options)||[]).find(Ge=>Ge.value==gt);ct&&(Et=ct.label)}}f.view.componentProps.categoryView=[{id:gt,name:Et}]}(((rt=V.value[dt])==null?void 0:rt.options)||[]).find(Et=>Et.value==gt),r.nextTick(()=>{S.value=[...S.value]})}}if(f.view.filterMultiple.teamType!==void 0){const dt=V.value.findIndex(gt=>gt.type==="radio-button");if(dt!==-1){const gt=f.view.filterMultiple.teamType;S.value[dt]=gt,(((nt=V.value[dt])==null?void 0:nt.options)||[]).find(Et=>Et.value==gt),r.nextTick(()=>{S.value=[...S.value]})}}}if(((pt=w.value)==null?void 0:pt.id)===1&&(_t=f==null?void 0:f.view)!=null&&_t.filterMultiple&&f.view.filterMultiple.category&&V.value.findIndex(dt=>dt.type==="select-simple"&&dt.label==="Tipo de análisis")!==-1){const dt=f.view.filterMultiple.category;S.value[0]=dt,f.view.componentProps&&dt&&(f.view.componentProps.type=dt),r.nextTick(()=>{S.value=[...S.value]})}if(((St=w.value)==null?void 0:St.id)===6&&(jt=f==null?void 0:f.view)!=null&&jt.filterMultiple&&f.view.filterMultiple.gameNumber&&V.value.findIndex(dt=>dt.type==="select-simple"&&dt.label==="Número de juego")!==-1){const dt=f.view.filterMultiple.gameNumber;S.value[0]=dt,f.view.componentProps&&dt&&(f.view.componentProps.gameNumber=dt),r.nextTick(()=>{S.value=[...S.value]})}if(((It=w.value)==null?void 0:It.id)===5&&(Jt=f==null?void 0:f.view)!=null&&Jt.filterMultiple&&f.view.filterMultiple.isHomeTeam!==void 0)if(V.value.findIndex(dt=>dt.type==="radio-button"&&dt.label==="Equipo")!==-1){const dt=f.view.filterMultiple.isHomeTeam;let gt;typeof dt=="boolean"?gt=dt?1:2:typeof dt=="number"?gt=dt===1?1:2:gt=1,S.value[0]=gt,f.view.componentProps&&dt!==void 0&&(f.view.componentProps.isHomeTeamForAnalysis=dt===1),r.nextTick(()=>{S.value=[...S.value]})}else{const dt=V.value.findIndex(gt=>gt.type==="radio-button");if(dt!==-1){const gt=f.view.filterMultiple.isHomeTeam;let Et;typeof gt=="boolean"?Et=gt?1:2:typeof gt=="number"?Et=gt===1?1:2:Et=1,S.value[dt]=Et,f.view.componentProps&&gt!==void 0&&(f.view.componentProps.preMatchType=gt),r.nextTick(()=>{S.value=[...S.value]})}}if(((lt=w.value)==null?void 0:lt.id)===15&&(tt=f==null?void 0:f.view)!=null&&tt.filterMultiple&&f.view.filterMultiple.isHomeTeam!==void 0){const dt=V.value.findIndex(gt=>gt.type==="radio-button");if(dt!==-1){const gt=f.view.filterMultiple.isHomeTeam;console.log("Strengths forceRadioFilterUpdate - isHomeTeam:",gt,"type:",typeof gt);let Et;typeof gt=="boolean"?Et=gt?1:2:typeof gt=="number"?Et=gt===1?1:2:Et=1,console.log("Strengths forceRadioFilterUpdate - teamValue calculado:",Et,"teamFilterIndex:",dt),S.value[dt]=Et,f.view.componentProps&&gt!==void 0&&(f.view.componentProps.preMatchType=Et),r.nextTick(()=>{S.value=[...S.value],console.log("Strengths forceRadioFilterUpdate - dynamicFilters.value después:",S.value)})}else{const gt=V.value.findIndex(Et=>Et.type==="radio-button");if(gt!==-1){const Et=f.view.filterMultiple.isHomeTeam;let Lt;typeof Et=="boolean"?Lt=Et?1:2:typeof Et=="number"?Lt=Et===1?1:2:Lt=1,S.value[gt]=Lt,f.view.componentProps&&Et!==void 0&&(f.view.componentProps.preMatchType=Lt),r.nextTick(()=>{S.value=[...S.value]})}}}r.nextTick(()=>{h.value=!1,o.value=!1})}}function ve(){if(!o.value&&t.value&&l&&l.dynamicFilters&&V.value){if(v.value)return;o.value=!0,h.value=!0,l.dynamicFilters.forEach((me,qe)=>{var Re;if(me&&((Re=V.value[qe])==null?void 0:Re.type)==="radio-button"&&me.selectedOption&&me.selectedOption.value!==void 0){const Ke=me.selectedOption.value;S.value[qe]=Ke}}),r.nextTick(()=>{h.value=!1,o.value=!1})}}function Ue(){var me,qe,Re,Ke,rt,nt,pt,_t,St,jt,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut,kt,vt,wt,Vt,at,Qe,xt,Ft,Rt,qt,Ht;if(n&&t.value&&f){if(v.value)return;if(h.value=!0,((me=w.value)==null?void 0:me.id)===4){if(n.setDynamicFilters(S.value,(qe=f.view)==null?void 0:qe.id),n.updateDynamicFilters(S.value,(Re=f.view)==null?void 0:Re.id),f.view.componentProps&&S.value&&S.value.length>0){const At=S.value[0];if(Array.isArray(At)&&At.length>0){const Yt=At.some(sr=>sr.event_type_id===1||typeof sr=="string"&&sr.includes("1")),Bt=At.some(sr=>sr.category_id===8||typeof sr=="string"&&sr.includes("8")),Gt=At.some(sr=>sr.category_id===9||typeof sr=="string"&&sr.includes("9")),or=At.some(sr=>sr.event_type_id===3||typeof sr=="string"&&sr.includes("3"));f.view.componentProps.selectedEvents=At,f.view.componentProps.goals=Yt,f.view.componentProps.yellowCards=Bt,f.view.componentProps.redCards=Gt,f.view.componentProps.substitutions=or,f.view.componentProps.key=At.length>0,f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps})}}}else if(((Ke=w.value)==null?void 0:Ke.id)===8)n.setDynamicFilters(S.value,(rt=f.view)==null?void 0:rt.id),n.updateDynamicFilters(S.value,(nt=f.view)==null?void 0:nt.id);else if(((pt=w.value)==null?void 0:pt.id)===3)n.setDynamicFilters(S.value,(_t=f.view)==null?void 0:_t.id),n.updateDynamicFilters(S.value,(St=f.view)==null?void 0:St.id);else if(((jt=w.value)==null?void 0:jt.id)===13){const At=(It=f.view)==null?void 0:It.id;n.setDynamicFilters(S.value,At),n.updateDynamicFilters(S.value,At),f.view.componentProps&&(f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps}))}else if(((Jt=w.value)==null?void 0:Jt.id)===15){const At=(lt=f.view)==null?void 0:lt.id;if(n.setDynamicFilters(S.value,At),n.updateDynamicFilters(S.value,At),f.view.componentProps){const Yt=Array.isArray(S.value)&&S.value[3]!==void 0?S.value[3]:null;Yt!==null&&(f.view.componentProps.numitems=Yt),f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps})}}else if(((tt=w.value)==null?void 0:tt.id)===2){n.setDynamicFilters(S.value,(dt=f.view)==null?void 0:dt.id),n.updateDynamicFilters(S.value,(gt=f.view)==null?void 0:gt.id);const At=S.value[0];if(At!==void 0&&(f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.categoryId,f.view.filterMultiple.categoryId=At,f.view.componentProps)){let Bt=`Category ${At}`,Gt=null;try{Gt=jh(At),Gt&&(Bt=Gt.name)}catch{const or=V.value.findIndex(sr=>sr.type==="select-simple"&&sr.label==="Tipo de análisis");if(or!==-1){const sr=(((Et=V.value[or])==null?void 0:Et.options)||[]).find(Ur=>Ur.value==At);sr&&(Bt=sr.label)}}f.view.componentProps.categoryView=[{id:At,name:Bt}],qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple})}const Yt=S.value[1];Yt!==void 0&&(f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.teamType,f.view.filterMultiple.teamType=Yt,f.view.componentProps&&f.view.componentProps.game&&(Yt===1?f.view.componentProps.teamView=f.view.componentProps.game.homeTeam.team_id:Yt===2?f.view.componentProps.teamView=f.view.componentProps.game.awayTeam.team_id:f.view.componentProps.teamView=0),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}))}else if(((Lt=w.value)==null?void 0:Lt.id)===1){n.setDynamicFilters(S.value,(it=f.view)==null?void 0:it.id),n.updateDynamicFilters(S.value,(ct=f.view)==null?void 0:ct.id);const At=S.value[0];At!==void 0&&(f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.category,f.view.filterMultiple.category=At,f.view.componentProps&&(f.view.componentProps.type=At),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}))}else if(((Ge=w.value)==null?void 0:Ge.id)===6){n.setDynamicFilters(S.value,(ut=f.view)==null?void 0:ut.id),n.updateDynamicFilters(S.value,(kt=f.view)==null?void 0:kt.id);const At=S.value[0];At!==void 0&&(f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.gameNumber,f.view.filterMultiple.gameNumber=At,f.view.componentProps&&(f.view.componentProps.gameNumber=At,f.view._updateKey,f.view._updateKey=Date.now()),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}),qa.emit("dynamic-filters-changed",{containerViewId:(vt=w.value)==null?void 0:vt.id,viewId:f.view.id,dynamicFilters:S.value}),qa.emit("component-props-updated",{viewId:f.view.id,componentProps:f.view.componentProps,dynamicFilters:S.value}),r.nextTick(()=>{f.view.componentProps&&(f.view.componentProps={...f.view.componentProps})}))}else if(((wt=w.value)==null?void 0:wt.id)===7){n.setDynamicFilters(S.value,(Vt=f.view)==null?void 0:Vt.id),n.updateDynamicFilters(S.value,(at=f.view)==null?void 0:at.id);const At=S.value[0],Yt=S.value[1];if(At!==void 0&&f.view.componentProps){const Bt=At===1?"offensive":"defensive";f.view.componentProps.analysisType=Bt}if(Yt!==void 0){f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.isHomeTeam;const Bt=Yt===1;f.view.filterMultiple.isHomeTeam=Bt,f.view.componentProps&&(f.view.componentProps.isHomeTeamForAnalysis=Bt,f.view._updateKey,f.view._updateKey=Date.now()),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}),qa.emit("dynamic-filters-changed",{containerViewId:(Qe=w.value)==null?void 0:Qe.id,viewId:f.view.id,dynamicFilters:S.value}),qa.emit("component-props-updated",{viewId:f.view.id,componentProps:f.view.componentProps,dynamicFilters:S.value}),r.nextTick(()=>{f.view.componentProps&&(f.view.componentProps={...f.view.componentProps})})}}else if(((xt=w.value)==null?void 0:xt.id)===5){n.setDynamicFilters(S.value,(Ft=f.view)==null?void 0:Ft.id),n.updateDynamicFilters(S.value,(Rt=f.view)==null?void 0:Rt.id);const At=S.value[0];if(At!==void 0){f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.isHomeTeam;const Yt=At===1?1:2;f.view.filterMultiple.isHomeTeam=Yt,f.view.componentProps&&(f.view.componentProps.isHomeTeamForAnalysis=Yt===1,f.view._updateKey,f.view._updateKey=Date.now()),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}),qa.emit("dynamic-filters-changed",{containerViewId:(qt=w.value)==null?void 0:qt.id,viewId:f.view.id,dynamicFilters:S.value}),qa.emit("component-props-updated",{viewId:f.view.id,componentProps:f.view.componentProps,dynamicFilters:S.value}),r.nextTick(()=>{f.view.componentProps&&(f.view.componentProps={...f.view.componentProps})})}}else((Ht=w.value)==null?void 0:Ht.id)===9||(n.setDynamicFilters(S.value),n.updateDynamicFilters(S.value));r.nextTick(()=>{h.value=!1})}}function ke(){var me,qe;if(!l||!l.dynamicFilters||!V.value)return!1;for(let Re=0;Re<l.dynamicFilters.length;Re++){const Ke=l.dynamicFilters[Re],rt=V.value[Re],nt=S.value[Re];if(!(!Ke||!rt)){if(rt.type==="check"){if(Ke.isChecked!==nt)return!0}else if(rt.type==="radio-button"){if(((me=Ke.selectedOption)==null?void 0:me.value)!==nt)return!0}else if(rt.type==="select"){const pt=((qe=Ke.selectedOptions)==null?void 0:qe.map(St=>St.value))||Ke.selectedValue||[],_t=Array.isArray(nt)?nt:[];if(JSON.stringify(pt)!==JSON.stringify(_t))return!0}}}return!1}function Je(me){var qe,Re,Ke,rt,nt,pt,_t,St,jt,It,Jt,lt,tt,dt,gt,Et;if(S.value=me.filters,n){const Lt=((qe=f==null?void 0:f.view)==null?void 0:qe.id)||null;n.setDynamicFilters(S.value,Lt),n.updateDynamicFilters(S.value,Lt)}if(t.value&&f&&(qa.emit("activate-save-button"),qa.emit("force-component-update",{itemId:((Re=f==null?void 0:f.view)==null?void 0:Re.id)||null,componentProps:f.view.componentProps}),qa.emit("dynamic-filters-changed",{containerViewId:((Ke=f==null?void 0:f.view)==null?void 0:Ke.id)||null,viewId:((rt=f==null?void 0:f.view)==null?void 0:rt.id)||null,dynamicFilters:S.value}),qa.emit("dynamic-filters-changed",{containerViewId:((nt=f==null?void 0:f.view)==null?void 0:nt.id)||null,viewId:((pt=f==null?void 0:f.view)==null?void 0:pt.id)||null,dynamicFilters:S.value}),r.nextTick(()=>{f.view.componentProps&&(f.view.componentProps={...f.view.componentProps})})),!t.value&&n&&((_t=w.value)==null?void 0:_t.id)===15&&n.getRequiresAddView(S.value)){n.setDynamicFilters(S.value),j("filters-changed",{main:c.value,view:w.value,team:E.value,dynamicFilters:S.value,filtersJSON:{mainSelector:{id:((St=c.value)==null?void 0:St.id)||null,name:((jt=c.value)==null?void 0:jt.name)||null,url:((It=c.value)==null?void 0:It.url)||null},viewSelector:{id:((Jt=w.value)==null?void 0:Jt.id)||null,name:((lt=w.value)==null?void 0:lt.name)||((tt=w.value)==null?void 0:tt.title)||null,url:((dt=w.value)==null?void 0:dt.url)||null},team:E.value,dynamicFilters:S.value,timestamp:new Date().toISOString(),summary:{mainSelected:!!c.value,viewSelected:!!w.value,totalDynamicFilters:((gt=V.value)==null?void 0:gt.length)||0,activeFilters:((Et=V.value)==null?void 0:Et.filter((Lt,it)=>{const ct=S.value[it];return Array.isArray(ct)?ct.length>0:ct!=null&&ct!==!1}).length)||0}},filterAndViewsContainer:n,viewToEdit:f}),ae();return}Ue()}function Fe(me){me.filterIndex!==void 0&&me.value!==void 0&&(S.value[me.filterIndex]=me.value,t.value&&Ue(),ae())}function Ie(){Oe()}function Ze(me){var qe,Re,Ke,rt,nt,pt,_t;const St={mainSelector:{id:((qe=c.value)==null?void 0:qe.id)||null,name:((Re=c.value)==null?void 0:Re.name)||null,url:((Ke=c.value)==null?void 0:Ke.url)||null},viewSelector:{id:((rt=w.value)==null?void 0:rt.id)||null,name:((nt=w.value)==null?void 0:nt.name)||((pt=w.value)==null?void 0:pt.title)||null,url:((_t=w.value)==null?void 0:_t.url)||null}};j("filters-changed",{filters:me.filters,view:me.view,viewToEdit:f,filterAndViewsContainer:n,filtersJSON:St,isAltMode:!0})}function et(me){return JSON.parse(JSON.stringify(me))}return(me,qe)=>(r.openBlock(),r.createElementBlock("div",t4e,[r.createElementVNode("button",r4e,r.toDisplayString(t.value?"Editando visualización":"Nueva visualización"),1),r.createElementVNode("div",{class:r.normalizeClass(["custom-select main-select",{disabled:t.value}]),onClick:B},[r.createElementVNode("div",n4e,[r.createElementVNode("span",a4e,[c.value?(r.openBlock(),r.createElementBlock("img",{key:0,src:D(c.value.name,!1),alt:"icono",class:"option-img"},null,8,i4e)):(r.openBlock(),r.createElementBlock("img",o4e))]),c.value?(r.openBlock(),r.createElementBlock("span",l4e,r.toDisplayString(H()),1)):(r.openBlock(),r.createElementBlock("span",s4e,"Tipo de vista")),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:R.value}])},[...qe[5]||(qe[5]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),R.value?(r.openBlock(),r.createElementBlock("div",c4e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,(Re,Ke)=>(r.openBlock(),r.createElementBlock("div",{key:Re.id,class:r.normalizeClass(["option-card",{active:p.value===Ke}]),onClick:r.withModifiers(rt=>ee(Ke),["stop"])},[r.createElementVNode("div",d4e,[r.createElementVNode("img",{src:D(Re.name,!1),"data-hover-src":D(Re.name,!0),alt:"icono",class:"option-img-34"},null,8,p4e)]),r.createElementVNode("div",h4e,[r.createElementVNode("div",f4e,r.toDisplayString(Re.name),1),Re.description?(r.openBlock(),r.createElementBlock("div",m4e,r.toDisplayString(Re.description),1)):r.createCommentVNode("",!0)])],10,u4e))),128))])):r.createCommentVNode("",!0)],2),c.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["custom-select second-select",{disabled:t.value}]),onClick:re},[r.createElementVNode("div",y4e,[r.createElementVNode("span",g4e,[w.value?(r.openBlock(),r.createElementBlock("img",{key:0,src:w.value.url,alt:"icono",class:"option-img-graph2"},null,8,v4e)):c.value?(r.openBlock(),r.createElementBlock("img",{key:1,src:D(c.value.name,!1),alt:"icono",class:"option-img"},null,8,b4e)):r.createCommentVNode("",!0)]),r.createElementVNode("span",x4e,r.toDisplayString(ne()),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:W.value}])},[...qe[6]||(qe[6]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),W.value&&c.value?(r.openBlock(),r.createElementBlock("div",w4e,[r.createElementVNode("div",_4e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.value,Re=>(r.openBlock(),r.createElementBlock("div",{key:Re.id,class:r.normalizeClass(["option-card-grid",{active:x.value===Re.id}]),onClick:r.withModifiers(Ke=>Y(Re),["stop"])},[r.createElementVNode("div",T4e,r.toDisplayString(Re.name||Re.title),1),r.createElementVNode("div",k4e,[r.createElementVNode("img",{src:Re.url,alt:"icono",class:"option-img-grid"},null,8,N4e)])],10,S4e))),128))])])):r.createCommentVNode("",!0)],2)):r.createCommentVNode("",!0),w.value?(r.openBlock(),r.createElementBlock("div",V4e)):r.createCommentVNode("",!0),w.value&&w.value.id===13?(r.openBlock(),r.createBlock(TSe,{key:2,filters:V.value,"initial-values":t.value?r.unref(l).dynamicFilters:S.value,"is-edit-mode":t.value,"component-id":13,onFiltersChanged:Je,onFilterUpdated:Fe},null,8,["filters","initial-values","is-edit-mode"])):w.value&&w.value.id===16?(r.openBlock(),r.createBlock(FTe,{key:3,"view-config":et(g.value.get(16)),"default-filters":r.unref(f)?r.unref(f).view.filterMultiple:null,"is-edit-mode":!!r.unref(f),"is-post-match":e.isPostMatch,onChange:Ze,onRemoveViews:Ie},null,8,["view-config","default-filters","is-edit-mode","is-post-match"])):w.value&&w.value.id===15?(r.openBlock(),r.createBlock(ASe,{key:4,filters:V.value,"initial-values":t.value?r.unref(l).dynamicFilters:S.value,"is-edit-mode":t.value,"component-id":15,onFiltersChanged:Je,onFilterUpdated:Fe},null,8,["filters","initial-values","is-edit-mode"])):w.value&&w.value.id===17?(r.openBlock(),r.createBlock(e4e,{key:5,filters:V.value,"initial-values":t.value?r.unref(l).dynamicFilters:S.value,"is-edit-mode":t.value,"component-id":17,"view-config":et(g.value.get(17)),"default-filters":r.unref(f)?r.unref(f).view.filterMultiple:null,onFiltersChanged:Je,onFilterUpdated:Fe,onChange:Ze,onRemoveViews:Ie},null,8,["filters","initial-values","is-edit-mode","view-config","default-filters"])):w.value&&V.value&&C()?(r.openBlock(),r.createElementBlock("div",{key:6,class:r.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":V.value.length>=2}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(V.value,(Re,Ke)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:Ke},[Re.type==="select"?(r.openBlock(),r.createElementBlock("div",{key:0,class:"custom-select dynamic-select filter-inline",onClick:r.withModifiers(rt=>$(Ke),["stop"])},[r.createElementVNode("div",L4e,[qe[8]||(qe[8]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),qe[9]||(qe[9]=r.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),Array.isArray(S.value[Ke])&&S.value[Ke].length>0?(r.openBlock(),r.createElementBlock("span",U4e,r.toDisplayString(S.value[Ke].length),1)):r.createCommentVNode("",!0),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:K.value===Ke}])},[...qe[7]||(qe[7]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),K.value===Ke?(r.openBlock(),r.createElementBlock("div",q4e,[r.createElementVNode("div",z4e,[r.createElementVNode("div",{class:"multi-select-header",onClick:qe[1]||(qe[1]=r.withModifiers(()=>{},["stop"]))},[r.createElementVNode("label",C4e,[r.createElementVNode("input",{type:"checkbox",checked:z(Ke),indeterminate:L(Ke),onChange:r.withModifiers(rt=>T(Ke),["stop"]),onClick:qe[0]||(qe[0]=r.withModifiers(()=>{},["stop"]))},null,40,P4e),qe[10]||(qe[10]=r.createElementVNode("span",{class:"select-all-label"},"Agregar todas",-1))])]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Re.options,rt=>(r.openBlock(),r.createElementBlock("div",{key:rt.value,class:r.normalizeClass(["option-card multi-select-option",{active:O(Ke,rt.value)}]),onClick:qe[2]||(qe[2]=r.withModifiers(()=>{},["stop"]))},[r.createElementVNode("div",E4e,[r.createElementVNode("input",{type:"checkbox",checked:O(Ke,rt.value),onChange:r.withModifiers(nt=>U(Ke,rt.value),["stop"])},null,40,F4e)]),r.createElementVNode("div",{class:"option-content",onClick:nt=>U(Ke,rt.value)},[r.createElementVNode("div",M4e,r.toDisplayString(rt.label),1)],8,R4e)],2))),128))]),r.createElementVNode("div",j4e,[r.createElementVNode("button",{class:"btn-listo",onClick:qe[3]||(qe[3]=r.withModifiers(rt=>_e(),["stop"]))},"Listo")])])):r.createCommentVNode("",!0)],8,O4e)):Re.type==="radio-button"?(r.openBlock(),r.createElementBlock("div",W4e,[r.createElementVNode("div",K4e,r.toDisplayString(Re.label),1),r.createElementVNode("div",A4e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Re.options,rt=>(r.openBlock(),r.createElementBlock("label",{key:rt.value,class:r.normalizeClass(["radio-option-card",{active:S.value[Ke]===rt.value}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"dynamic-radio-"+Ke,value:rt.value,"onUpdate:modelValue":nt=>S.value[Ke]=nt,disabled:P(rt.value,rt.label),onChange:()=>{var nt,pt,_t;if(((nt=w.value.value)==null?void 0:nt.id)===9&&t.value.value&&(_t=(pt=r.unref(f))==null?void 0:pt.view)!=null&&_t.filterMultiple){const St=S.value[Ke]===1;r.unref(f).view.filterMultiple.isHomeTeam=St}t.value.value&&Ue(),ae()}},null,40,I4e),[[r.vModelRadio,S.value[Ke]]]),r.createElementVNode("span",null,r.toDisplayString(rt.label),1)],2))),128))])])):Re.type==="check"?(r.openBlock(),r.createElementBlock("div",X4e,[r.createElementVNode("label",null,[r.withDirectives(r.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":rt=>S.value[Ke]=rt,checked:S.value[Ke],onChange:qe[4]||(qe[4]=()=>{t.value.value&&Ue(),ae()})},null,40,D4e),[[r.vModelCheckbox,S.value[Ke]]]),r.createTextVNode(" "+r.toDisplayString(Re.label),1)])])):Re.type==="select-simple"?(r.openBlock(),r.createElementBlock("div",{key:3,class:"custom-select dynamic-select filter-inline","data-filter-type":Re.type,onClick:r.withModifiers(rt=>le(Ke),["stop"])},[r.createElementVNode("div",B4e,[qe[12]||(qe[12]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),qe[13]||(qe[13]=r.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:X.value===Ke}])},[...qe[11]||(qe[11]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),X.value===Ke?(r.openBlock(),r.createElementBlock("div",G4e,[r.createElementVNode("div",Z4e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Re.options,rt=>(r.openBlock(),r.createElementBlock("div",{key:rt.value,class:r.normalizeClass(["option-card simple-select-option",{active:S.value[Ke]===rt.value}]),onMouseenter:nt=>Ce(Ke,rt.value),onClick:r.withModifiers(nt=>ie(Ke,rt.value),["stop"])},[r.createElementVNode("div",Y4e,[r.createElementVNode("div",Q4e,r.toDisplayString(rt.label),1)]),S.value[Ke]===rt.value?(r.openBlock(),r.createElementBlock("div",$4e,[...qe[14]||(qe[14]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):r.createCommentVNode("",!0)],42,H4e))),128))])])):r.createCommentVNode("",!0)],8,J4e)):r.createCommentVNode("",!0),Ke===1&&V.value.length>2?(r.openBlock(),r.createElementBlock("div",eke)):r.createCommentVNode("",!0)],64))),128))],2)):r.createCommentVNode("",!0),t.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("button",{key:7,class:"cancel-btn",onClick:Oe},"Cancelar")),_.value?(r.openBlock(),r.createElementBlock("button",{key:8,class:"ok-btn",onClick:Te},"OK")):r.createCommentVNode("",!0)]))}}),rke=Bc(tke,[["__scopeId","data-v-8d571c54"]]),nke={key:0,class:"modal-simple"},ake={class:"modal-simple__content"},ike={class:"modal-simple__content__header"},oke={class:"modal-simple__content__body"},ske={class:"modal-simple__content__footer"},lke={__name:"ModalSimple",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(a,i)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[e.modelValue?(r.openBlock(),r.createElementBlock("div",nke,[r.createElementVNode("div",ake,[r.createElementVNode("div",ike,[r.renderSlot(a.$slots,"header",{},void 0,!0)]),r.createElementVNode("div",oke,[r.renderSlot(a.$slots,"body",{},void 0,!0)]),r.createElementVNode("div",ske,[r.renderSlot(a.$slots,"footer",{},void 0,!0)])])])):r.createCommentVNode("",!0)]))}},cke=Bc(lke,[["__scopeId","data-v-1cc4f590"]]),uke={class:"footer"},dke={__name:"ModalCautionClose",props:{value:{type:Boolean,default:!1}},emits:["update:modelValue","action"],setup(e,{emit:a}){const i=a;function k(g){i("update:modelValue",g)}function j(g){i("action",g),i("update:modelValue",!1)}return(g,m)=>(r.openBlock(),r.createBlock(cke,{"modle-value":e.value,"onUpdate:modelValue":k},{header:r.withCtx(()=>[...m[2]||(m[2]=[r.createElementVNode("div",{class:"header"},"Descartar template",-1)])]),body:r.withCtx(()=>[...m[3]||(m[3]=[r.createElementVNode("div",{class:"body"},"¿Estás seguro que deseas abandonar el proceso?",-1)])]),footer:r.withCtx(()=>[r.createElementVNode("div",uke,[r.createElementVNode("div",{role:"button",class:"btn btn-cancel",onClick:m[0]||(m[0]=n=>j(!1))}," Seguir editando "),r.createElementVNode("div",{role:"button",class:"btn btn-confirm",onClick:m[1]||(m[1]=n=>j(!0))}," Descartar ")])]),_:1},8,["modle-value"]))}},pke=Bc(dke,[["__scopeId","data-v-ed9b5088"]]),hke={key:0,class:"modal-simple"},fke={__name:"ModalChangesSaved",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(a,i)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,null,{default:r.withCtx(()=>[e.modelValue?(r.openBlock(),r.createElementBlock("div",hke,[...i[0]||(i[0]=[r.createElementVNode("div",{class:"modal-simple__content"},[r.createElementVNode("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.createElementVNode("path",{d:"M29.3333 5.33203L16 18.6787L12 14.6787",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"})]),r.createElementVNode("div",{class:"modal-simple__content__text"}," Los cambios se han guardado correctamente ")],-1)])])):r.createCommentVNode("",!0)]),_:1})]))}},mke=Bc(fke,[["__scopeId","data-v-2bc30783"]]),yke={class:"template-maker__header"},gke={key:0,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},vke={class:"template-maker__content"},bke={class:"template-maker__content__main"},xke={id:"containerMain",class:"container-main"},wke={class:"template-maker__content__main__cover-selector"},_ke=["id"],Ske={class:"page-indicator"},Tke={class:"page-indicator__index"},kke=["onClick"],Nke=["onClick"],Vke={key:0,class:"template-maker__content__main__footer"},Oke={class:"template-maker__content__main__footer__paginator"},Lke={class:"template-maker__content__main__footer__paginator__nav"},Uke={class:"template-maker__content__main__footer__paginator__numbers"},qke=["onClick"],zke={__name:"GSC-TemplateReportMaker",props:{token:{type:String,default:""},userTeamId:{type:Number,default:0}},emits:["close"],setup(e,{expose:a,emit:i}){const k=new Map,j=r.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:{}}]}]),g=r.ref(null),m=r.ref(0),n=r.ref(!1),f=r.ref(null),l=r.ref(null),t=r.ref(!0),_=r.ref(!1),b=r.ref(!1),v=r.ref(0),h=r.ref(!1),o=r.ref(null),s=r.ref(new Map),p=r.ref(null),c=r.ref(null),d=r.ref(!1),x=r.ref(!1),w=r.ref(!1),S=new Map,V=r.computed(()=>({"--overflow-y-template-maker":_.value?"scroll":"hidden","--height-container-main":_.value?"fit-content":"calc(100vh - 64px)","--margin-bottom-container-main":(_.value,"0")})),O=r.computed(()=>m.value+1);r.watch(()=>n.value,_e=>{const Ce=document.getElementById("app");_e?(m.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 U(_e){return _e<10?`0${_e}`:_e}async function z({templateId:_e,userId:Ce}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Ce}/templates/${_e}`,{method:"GET",headers:{Authorization:$.token}})).json()).data}catch(Pe){console.error("Error fetching template by ID:",Pe)}}async function L({reportId:_e,userId:Ce}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Ce}/reports/${_e}`,{method:"GET",headers:{Authorization:$.token}})).json()).data}catch(Pe){console.error("Error fetching report by ID:",Pe)}}let C=0;function q(_e){g.value=_e,C>0&&(d.value=!0),C++}function N(_e){_e&&ue(null,!0)}let P=null;function T(_e,Ce){let Pe=_e.getBoundingClientRect(),Be={height:_e.clientHeight,width:_e.clientWidth},ze=Ce.getBoundingClientRect();if(!(ze.top>=Pe.top&&ze.bottom<=Pe.top+Be.height)){const je=ze.top-Pe.top,Ee=ze.bottom-Pe.bottom;Math.abs(je)<Math.abs(Ee)?_e.scrollTop+=je:_e.scrollTop+=Ee}}function E(_e,Ce){let Pe=_e.getBoundingClientRect();const Be=Ce.getBoundingClientRect().top-Pe.top;_e.scrollTop+=Be}function R(_e,Ce=!1){const Pe={title:`Page ${j.value.length+1}`,id:`p-${Date.now()}`,items:[]};if(xe(),_e!==void 0&&_e>=-1?j.value.splice(_e+1,0,Pe):j.value.push(Pe),r.nextTick(()=>{const Be=j.value.findIndex(je=>je.id===Pe.id),ze=document.getElementById(`page-${Be+1}`);P||(P=document.getElementById("containerMain")),ze&&P?T(P,ze):console.error("Page element or container main element not found")}),Ce)return Pe;d.value=!0}function W(_e){if(_e<0||_e>j.value.length)return;m.value=_e;const Ce=document.getElementById(`page-${_e}`);if(P||(P=document.getElementById("containerMain")),Ce&&P){const Pe=new CustomEvent("programmatic-scroll-start");document.dispatchEvent(Pe),E(P,Ce),setTimeout(()=>{const Be=new CustomEvent("programmatic-scroll-end");document.dispatchEvent(Be)},300)}else console.error("Page element or container main element not found")}function K(_e){p.value=_e,h.value=!0}function X(_e,Ce){const Pe=Ce+1;_e&&m.value!==Pe&&(m.value=Pe)}function D(_e){h.value=!0,qa.emit("edit-view",{view:_e})}async function H({templateReportId:_e,userId:Ce,isTemplateMode:Pe}){try{return Pe?z({templateId:_e,userId:Ce}):L({reportId:_e,userId:Ce})}catch(Be){throw new Error("Error fetching template or report by ID: "+Be.message)}}function ne(){C=0,h.value=!1,m.value=0,p.value=null,c.value=null,s.value.clear(),P=null}async function B(_e){if(ne(),t.value=_e.isTemplateMode,_.value=!!_e.isPDFMode,_e.isPDFMode?f.value=await L({reportId:_e.reportId,userId:_e.userId}):(f.value=_e.template,f.value=await H({templateReportId:_e.template.id,userId:_e.template.user_id,isTemplateMode:_e.isTemplateMode})),!f.value)return;f.value&&f.value.game&&(f.value.game=ie(f.value.game)),l.value=JSON.parse(JSON.stringify(f.value)),b.value=f.value.template_type===2;const Ce=f.value.pages.find(Pe=>Pe.is_front_page);v.value=Ce?Ce.type:1,n.value=!0,j.value=f.value.pages.reduce((Pe,Be,ze)=>{if(!Be.is_front_page){Be.name||(Be.name="");const je=ze,Ee={originalPage:JSON.parse(JSON.stringify(Be)),title:Be.name,id:`p-${Date.now()-ze*9}`,items:[],components:Be.components};Be.components&&Be.components.length>0&&(Ee.items=Be.components.map((ve,Ue)=>{const ke=new H0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],ve.coreView.id,ve.dynamicFilters,b.value,t.value,ve.filtersJSON||null,$.token,ve.filters),Je={originalComponent:JSON.parse(JSON.stringify(ve)),title:ve.title,shortTitle:ve.shortTitle||ve.title,game:f.value.game,idAux:ve.id,id:`w-${Date.now()-Ue*7}`,x:ve.column,y:ve.row,w:ve.colspan,h:ve.rowspan,maxWidth:ve.max_column,maxHeight:ve.max_row,minWidth:ve.min_column,minHeight:ve.min_row,noResize:!t.value,noMove:!t.value,coreView:ve.coreView||null,isTemplateMode:t.value,componentName:ve.componentName,componentProps:Y({currentProps:ve.componentProps,coreView:ve.coreView,isTemplateMode:t.value,templateToEdit:f.value,filterMultiple:ve.filterMultiple||null,game:f.value.game||null,dynamicFilters:ve.dynamicFilters,page:je,componentId:Ue})||{},filterMultiple:ve.filterMultiple,isHomeTeam:ee({game:f.value.game,isTemplateMode:t.value,currentIsHomeTeam:ve.isHomeTeam||ve.componentProps.isHomeTeamForAnalysis}),filtersJSON:ve.filtersJSON||null,dynamicFilters:ve.dynamicFilters||[],filterAndViewsContainer:ke},Fe=r.reactive({view:Je});return ke.addView(Fe,!0),s.value.set(ke.getId(),ke),Je})),Pe.push(Ee)}return Pe},[])}function re({game:_e,isTemplateMode:Ce}){const Pe=_e&&_e.homeTeam&&_e.awayTeam&&(_e.homeTeam.team_id===$.userTeamId||_e.awayTeam.team_id===$.userTeamId);return{isUserTeamHome:Pe&&_e.homeTeam.team_id===$.userTeamId,requiresUserTeamAdjustment:Pe&&!Ce}}function ee({game:_e,isTemplateMode:Ce,currentIsHomeTeam:Pe}){const{isUserTeamHome:Be,requiresUserTeamAdjustment:ze}=re({game:_e,isTemplateMode:Ce});return ze?Pe?Be:!Be:Pe}function Y({currentProps:_e,coreView:Ce,templateToEdit:Pe,isTemplateMode:Be,filterMultiple:ze,game:je,dynamicFilters:Ee,page:ve,componentId:Ue}){if(!_e||!Ce)return _e||{};const{isUserTeamHome:ke,requiresUserTeamAdjustment:Je}=re({game:je,isTemplateMode:Be}),Fe={..._e};if(Ce.id===5&&(Fe.isGhostEffect=Be,Je)){const Ie=Fe.preMatchType===1;Fe.preMatchType=Ie?ke?1:2:ke?2:1}if(Ce.id===7&&Je){const Ie=Fe.isHomeTeamForAnalysis;Fe.isHomeTeamForAnalysis=Ie?ke:!ke}if(Ce.id===9&&Je){const Ie=Fe.isHomeTeamForAnalysis;Fe.isHomeTeamForAnalysis=Ie?ke:!ke}if(Ce.id===16){if(!Be&&Je){const Ie=Fe.isHomeTeamForAnalysis;Fe.isHomeTeamForAnalysis=Ie?ke:!ke}if(!Be){Fe.isPreMatch=!b.value,Fe.isTemplateMode=Be,Fe.seasonId=Pe.season_id,Fe.teamIdForAnalysis=Fe.isHomeTeamForAnalysis?Pe.game.home_team:Pe.game.visiting_team;const Ie=Fe.isHomeTeamForAnalysis?Pe.last_games.last_home_games:Pe.last_games.last_visiting_games;b.value?Fe.gamesIdsForAnalysis=[Pe.game.game_id]:Fe.howManyGames?Fe.gamesIdsForAnalysis=Ie.slice(0,Fe.howManyGames).map(Ze=>Ze.game_id):(Fe.gamesIdsForAnalysis=[],Fe.gameDataUTC=Pe.game.date_time_utc)}if(!Be){Fe.isTemplateMode=Be,Fe.seasonId=Pe.season_id,Fe.teamIdForAnalysis=Fe.isHomeTeamForAnalysis?Pe.game.home_team:Pe.game.visiting_team;const Ie=Fe.isHomeTeamForAnalysis?Pe.last_games.last_home_games:Pe.last_games.last_visiting_games;b.value?Fe.gamesIdsForAnalysis=[Pe.game.game_id]:Fe.howManyGames?Fe.gamesIdsForAnalysis=Ie.slice(0,Fe.howManyGames).map(Ze=>Ze.game_id):(Fe.gamesIdsForAnalysis=[],Fe.gameDataUTC=Pe.game.date_time_utc)}}if(Ce.id===10&&Je){const Ie=Fe.isHomeTeamForAnalysis;Fe.isHomeTeamForAnalysis=Ie?ke:!ke}if(Ce.id===1&&(Fe.gameId=je?je.id:"",Fe.homeLogo=je?je.homeTeam.logo:"",Fe.awayLogo=je?je.awayTeam.logo:"",Fe.seasonId=je?je.season_id:0,Fe.default=Be),Ce.id===6&&(Fe.game=je||"",Fe.lastGames=Pe.last_games,Fe.selectedOption=Pe.template_type===2?"Postmatch":"Prematch"),Ce.id===13&&(Fe.isdefault=Be,Fe.seasonid=je?je.seasonId:2010,Fe.datetimeutc=je?Pe.template_type===1?je?je.date_time_utc:"":null:"",Fe.teamids=je?[je.home_team,je.visiting_team]:[1,2],Fe.categoryids=Ee?Ee[1]:[20,2],Fe.teamsshow=je?Ee?Ee[2]==1?[je.home_team]:Ee[2]==2?[je.visiting_team]:[je.home_team,je.visiting_team]:[1,2]:[1,2],Fe.analysistype=Ee?Ee[0]:[],Fe.gameid=Pe.template_type===1?null:je?je.id:"",Fe.teams=je?[{id:je.home_team,name:je.home_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+je.home_team+".png"},{id:je.visiting_team,name:je.visiting_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+je.visiting_team+".png"}]:[]),Ce.id===15&&(Fe.view=1,Fe.token=$.token,Fe.numitems=Ee?Ee[1]:3,Fe.isdefault=Be,Fe.reportid=Pe!=null&&Pe.id?Pe.id:0,Fe.userid=Pe!=null&&Pe.user_id?Pe.user_id:0,Fe.page=ve+1,Fe.typegame=b.value?2:1,Fe.componentid=Ue+1,Fe.data={season:je?je.seasonId:2010,type:2,game:je?je.id:0,team:je?je.home_team:2}),Ce.id===14&&(Fe.isReports=!0,Fe.isDefault=Be,Fe.type=Pe.tournament_type==1?1:0,Fe.typeView=1,Fe.tournament=Pe.tournament_id,Fe.currentSeason=je?je.season_id:0,Fe.currentSeasonId=je?je.season_id:0,Fe.showVideos=!1,Fe.localTeam=je?je.home_team:0,Fe.awayTeam=je?je.visiting_team:0),Ce.id===3&&(Fe.defaultShields=Be),Ce.id===2){let Ie=!0,Ze=0,et=0;je&&(Ie=Pe.main_team==je.home_team||Pe.main_team==je.visiting_team,Ze=Ie?Pe.main_team==(je==null?void 0:je.home_team)?je==null?void 0:je.home_team:je==null?void 0:je.visiting_team:je==null?void 0:je.home_team,et=Ie?Pe.main_team==(je==null?void 0:je.home_team)?je==null?void 0:je.visiting_team:je==null?void 0:je.home_team:je==null?void 0:je.visiting_team),Fe.gamed=je?je.id:"",Fe.game=je||"",Fe.season=je?je.season_id:0,Fe.teamView=ze.teamType==3?0:ze.teamType==1?Ze:et,Fe.useDummyData=Be}return Ce.id===8&&(Fe.teamSelected=je?{teamId:je.home_team}:1,Fe.isDefault=Be),Ce.id===4&&(Fe.gameId=je?je.id:"",Fe.isDefault=Be,Fe.homeTeam=je?je==null?void 0:je.home_team:"",Fe.awayTeam=je?je==null?void 0:je.visiting_team:""),je&&(Fe.game=je),Fe}const $=e,le=i;r.watch(()=>$.token,(_e,Ce)=>{},{immediate:!0}),a({show:B}),qa.on("add-page-view",_e=>{k.set(_e.view.id,_e.view);const Ce=j.value.find(Pe=>Pe.id===_e.pageId);Ce&&(Ce.items||(Ce.items=[]),Ce.items.push(_e.view),r.nextTick(()=>{const Pe=document.querySelector(`[gs-id="${_e.view.id}"]`);_e.grid.makeWidget(Pe)}))}),qa.on("add-page-and-view",_e=>{const Ce=j.value.findIndex(Pe=>Pe.id===_e.pageId);if(Ce>-1){const Pe=R(Ce,!0);setTimeout(()=>{qa.emit("add-view",{pageId:Pe.id,view:_e.view,filterAndWidgetContainer:_e.filterAndWidgetContainer}),c.value&&(Pe.stepBackPage=c.value),c.value=Pe},500)}else console.error("Page not found for adding view:",_e.pageId)}),qa.on("empty-page",_e=>{h.value&&p.value&&p.value.id===_e.id||(be(_e),c.value&&c.value.id===_e.id&&(c.value.stepBackPage?c.value=c.value.stepBackPage:c.value=null))}),qa.on("filters-cancelled",_e=>{_e&&_e.removeAllChildViews()}),qa.on("activate-save-button",()=>{d.value=!0});function ie(_e){return{..._e,gameId:_e.game_id,id:_e.game_id,seasonId:_e.season_id,status:_e.game_status,homeTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${_e.home_team}.png`,team_id:_e.home_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${_e.home_team}.png`,colloquial_name:_e.home_team_name,acronym:_e.home_team_acronym,team_name:_e.home_team_name},awayTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${_e.visiting_team}.png`,team_id:_e.visiting_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${_e.visiting_team}.png`,colloquial_name:_e.visiting_team_name,acronym:_e.visiting_team_acronym,team_name:_e.visiting_team_name}}}function ue(_e,Ce=!1){Ce||!t.value?(n.value=!1,ne(),le("close")):d.value?x.value=!0:(n.value=!1,ne(),le("close"))}function he(){o.value=null,h.value=!1}function ae({page:_e,view:Ce,applyMinimumSize:Pe=!1}){const Be=_e.grid;if(!_e||!Ce||!Be)return null;const ze=Pe?{w:Ce.min_column,h:Ce.min_row}:{w:Ce.colspan,h:Ce.rowspan},je=Be.willItFit(0,0,ze.w,ze.h,!0);return je?{willFit:je,applyMinimumSize:Pe}:Pe?null:ae({page:_e,view:Ce,applyMinimumSize:!0})}const de=new Set([9]);function ce(_e){var Ce,Pe,Be,ze,je,Ee,ve,Ue,ke,Je,Fe,Ie,Ze,et;if(_e.dynamicFilters&&_e.dynamicFilters.length>0&&_e.viewToEdit&&_e.viewToEdit.view){const me=_e.viewToEdit.view.id;j.value.forEach(qe=>{qe.items.forEach(Re=>{Re.id===me&&Re.coreView&&Re.coreView.id===3&&(Re.componentProps.desplegable=_e.dynamicFilters[0]||!1,Re.componentProps.key=_e.dynamicFilters[0]||!1,r.nextTick(()=>{qa.emit("force-component-update",{itemId:Re.id,componentProps:Re.componentProps})}))})})}if(_e.viewToEdit){if(!_e.viewToEdit.view.filterAndViewsContainer){const me=new H0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[_e.viewToEdit],((Ce=_e.viewToEdit.view.coreView)==null?void 0:Ce.id)||_e.viewToEdit.view.id,_e.dynamicFilters||[],b.value,t.value,_e.filtersJSON,$.token,_e.filters);_e.viewToEdit.view.filterAndViewsContainer=me}_e.viewToEdit.view.filterAndViewsContainer.updateView({view:_e.viewToEdit,dynamicFilters:_e.dynamicFilters||[],filtersJSON:_e.filtersJSON||null,filters:_e.filters}),d.value=!0}else if(_e.view){_e.view.id&&_e.filterAndViewsContainer&&_e.view.id!==_e.filterAndViewsContainer.viewId&&(_e.filterAndViewsContainer.removeAllChildViews(),_e.filterAndViewsContainer.setViewId(_e.view.id),_e.filterAndViewsContainer.setFiltersJSON(_e.filtersJSON||null)),_e.view.id&&de.has(_e.view.id)&&_e.dynamicFilters[0]&&_e.dynamicFilters[0].length===0&&_e.filterAndViewsContainer&&(_e.filterAndViewsContainer.updateDynamicFilters(_e.dynamicFilters,(Be=(Pe=_e.viewToEdit)==null?void 0:Pe.view)==null?void 0:Be.id),d.value=!0);const me=c.value||p.value,qe=ae({page:me,view:_e.view,applyMinimumSize:!1});_e.view.filtersJSON=_e.filtersJSON||null;const Re=_e.filterAndViewsContainer,Ke=j.value.findIndex(rt=>rt.id===me.id);if(Re){const rt=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters,_e.filters);if(((ze=_e.view)==null?void 0:ze.id)===15){const nt=(je=_e.filterAndViewsContainer)==null?void 0:je.getId();if(nt&&S.has(nt)){const pt=S.get(nt);clearTimeout(pt),S.delete(nt)}}if(rt){if(Re.setFilters(_e.filters),Re.setDynamicFilters(_e.dynamicFilters),qe||Ke===j.value.length-1){qa.emit("add-view",{pageId:me.id,view:_e.view,filterAndWidgetContainer:Re,avoidWillFit:!1,applyMinimumSize:qe?qe.applyMinimumSize:!1,dynamicFilters:_e.dynamicFilters,filters:_e.filters}),_e.filterAndViewsContainer.updateDynamicFilters(_e.dynamicFilters,(ve=(Ee=_e.viewToEdit)==null?void 0:Ee.view)==null?void 0:ve.id),d.value=!0;let nt=null;if(((Ue=_e.view)==null?void 0:Ue.id)===15?(r.nextTick(()=>{var pt;const _t=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters,_e.filters),St=(pt=_e.dynamicFilters)==null?void 0:pt[0];if(console.log("onFiltersChanged nextTick - stillRequiresAddView:",_t,"childViews.length:",_e.filterAndViewsContainer.childViews.length,"currentFilterValue:",St),St!==3){console.log("onFiltersChanged nextTick - El filtro cambió, cancelando. Valor actual:",St);return}_t&&(console.log("onFiltersChanged nextTick - llamando recursivamente para crear siguiente componente"),ce(_e))}),nt=setTimeout(()=>{var pt,_t;const St=(pt=_e.filterAndViewsContainer)==null?void 0:pt.getId();St&&S.delete(St);const jt=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters),It=(_t=_e.dynamicFilters)==null?void 0:_t[0];if(console.log("onFiltersChanged setTimeout (backup) - stillRequiresAddView:",jt,"childViews.length:",_e.filterAndViewsContainer.childViews.length,"currentFilterValue:",It),It!==3){console.log("onFiltersChanged setTimeout (backup) - El filtro cambió, cancelando. Valor actual:",It);return}jt&&(console.log("onFiltersChanged setTimeout (backup) - llamando recursivamente para crear siguiente componente"),ce(_e))},200)):nt=setTimeout(()=>{const pt=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters,_e.filters);console.log("onFiltersChanged setTimeout - stillRequiresAddView:",pt,"childViews.length:",_e.filterAndViewsContainer.childViews.length),pt?(console.log("onFiltersChanged - llamando recursivamente para crear siguiente componente"),ce(_e)):console.log("onFiltersChanged - no more views needed, stopping recursion")},1e3),((ke=_e.view)==null?void 0:ke.id)===15&&nt){const pt=(Je=_e.filterAndViewsContainer)==null?void 0:Je.getId();pt&&S.set(pt,nt)}}}else _e.isAltMode?_e.viewToEdit||_e.filterAndViewsContainer.updateFilters(_e.filters,(Ie=(Fe=_e.viewToEdit)==null?void 0:Fe.view)==null?void 0:Ie.id):_e.filterAndViewsContainer.updateDynamicFilters(_e.dynamicFilters,(et=(Ze=_e.viewToEdit)==null?void 0:Ze.view)==null?void 0:et.id),d.value=!0}else if(qe||Ke===j.value.length-1){const rt=new H0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],_e.view.id,_e.dynamicFilters,b.value,t.value,_e.filtersJSON,$.token,_e.filters);qa.emit("set-filter-and-views-container",rt),s.value.set(rt.getId(),rt),_e.dynamicFilters&&Array.isArray(_e.dynamicFilters[0])?(_e.filterAndViewsContainer=rt,ce(_e)):qa.emit("add-view",{pageId:me.id,view:_e.view,filterAndWidgetContainer:rt,avoidWillFit:!1,applyMinimumSize:qe?qe.applyMinimumSize:!1,dynamicFilters:_e.dynamicFilters,filters:_e.filters}),d.value=!0}}}async function ye(){if(d.value)try{const _e=[{is_front_page:!0,template_type:g.value.isPostMatch?2:1,type:g.value.id},...j.value.map(Pe=>({columns:Pe.originalPage?Pe.originalPage.columns:12,rows:Pe.originalPage?Pe.originalPage.rows:12,gap:Pe.originalPage?Pe.originalPage.gap:10,name:Pe.title,width:Pe.originalPage?Pe.originalPage.width:968,height:Pe.originalPage?Pe.originalPage.height:702,components:Pe.items.reduce((Be,ze)=>(ze.isDeleted||Be.push({min_column:ze.minWidth,min_row:ze.minHeight,max_column:ze.maxWidth,max_row:ze.maxHeight,column:ze.x,row:ze.y,colspan:ze.w,rowspan:ze.h,name:ze.name,title:ze.title,titleShort:ze.titleShort||ze.title,dynamicFilters:ze.filterAndViewsContainer.getComponentDynamicFilters(ze.id)||ze.filterAndViewsContainer.getDynamicFilters()||[],coreView:ze.coreView||null,componentName:ze.componentName,componentProps:ze.componentProps||{},isHomeTeam:ze.isHomeTeam||ze.componentProps.isHomeTeamForAnalysis,filterMultiple:ze.filterMultiple}),Be),[])}))],Ce=await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${f.value.user_id}/templates/${f.value.id}/pages`,{method:"PATCH",headers:{Authorization:$.token},body:JSON.stringify({pages:_e})});w.value=!0,await Ce.json(),d.value=!1,setTimeout(()=>{w.value=!1},2e3)}catch(_e){console.error("Error saving template:",_e)}}function xe(){j.value.forEach(_e=>{_e.offListeners&&_e.offListeners()})}function be(_e){const Ce=j.value.findIndex(Pe=>Pe.id===_e.id);Ce>-1&&(xe(),j.value=j.value.filter(Pe=>Pe.id!==_e.id),m.value>=Ce&&(m.value=Math.max(0,m.value-1)),d.value=!0)}function Te(){d.value=!0}function Oe(_e){const Ce=j.value.find(Pe=>Pe.items.some(Be=>Be.id===_e.id));if(Ce){const Pe=Ce.items.find(Be=>Be.id===_e.id);Pe&&(Pe.isDeleted=!0,d.value=!0)}}function Le(_e){}return(_e,Ce)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(pke,{modelValue:x.value,"onUpdate:modelValue":Ce[0]||(Ce[0]=Pe=>x.value=Pe),onAction:N},null,8,["modelValue"]),r.createVNode(mke,{"model-value":w.value},null,8,["model-value"]),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[n.value&&f.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"template-maker",style:r.normalizeStyle(V.value)},[r.withDirectives(r.createVNode(rke,{token:e.token,view:o.value,"is-post-match":b.value,onClose:he,onFiltersChanged:ce},null,8,["token","view","is-post-match"]),[[r.vShow,t.value&&h.value]]),r.createElementVNode("div",yke,[r.createTextVNode(r.toDisplayString(f.value?f.value.name:"Nuevo template")+" ",1),r.createElementVNode("div",{class:"template-maker__header__close",onClick:ue},[_.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("svg",gke,[...Ce[6]||(Ce[6]=[r.createElementVNode("path",{d:"M1.33398 1.33398L14.6673 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),r.createElementVNode("path",{d:"M14.666 1.33398L1.33268 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))])]),r.createElementVNode("div",vke,[Ce[13]||(Ce[13]=r.createElementVNode("div",{class:"template-maker__content__sidebar"},null,-1)),r.createElementVNode("div",bke,[r.createElementVNode("div",xke,[r.createElementVNode("div",wke,[r.withDirectives(r.createVNode($V,{"is-post-match":b.value,"initial-cover-id":v.value,onSelectCover:q},null,8,["is-post-match","initial-cover-id"]),[[r.vShow,t.value]])]),(r.openBlock(),r.createElementBlock("div",{class:"template-maker__content__main__pages",key:j.value.length},[g.value?(r.openBlock(),r.createBlock(sSe,{key:0,id:"page-0",game:f.value.game||null,"cover-id":g.value.id,"is-post-match":g.value.isPostMatch,onIntersectionChanged:Ce[1]||(Ce[1]=Pe=>X(Pe,-1))},null,8,["game","cover-id","is-post-match"])):r.createCommentVNode("",!0),t.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:"new-items-buttons",style:r.normalizeStyle({"margin-bottom":j.value.length===0?"30px":"0"})},[h.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"new-items-buttons__add-page new-item-button",onClick:Ce[2]||(Ce[2]=Pe=>R(-1))},[...Ce[7]||(Ce[7]=[r.createElementVNode("div",null,"+ Nueva página",-1),r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]))],4)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,(Pe,Be)=>(r.openBlock(),r.createElementBlock("div",{key:Be,id:`page-${Be+1}`,class:"template-maker__content__main__pages__page"},[r.createElementVNode("div",Ske,[r.createElementVNode("div",Tke,"Pag "+r.toDisplayString(U(Be+2)),1)]),g.value?(r.openBlock(),r.createBlock(c_e,{key:0,page:Pe,"is-template-mode":t.value,"is-post-match":g.value.isPostMatch,game:f.value.game||null,lastGames:f.value.lastGames||[],"is-filter-visible":h.value,onEditView:D,onIntersectionChanged:ze=>X(ze,Be),onChangeSort:Le,onDeletePage:be,onViewChanged:Te,onDeleteView:Oe},null,8,["page","is-template-mode","is-post-match","game","lastGames","is-filter-visible","onIntersectionChanged"])):r.createCommentVNode("",!0),t.value&&!h.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:"new-items-buttons",style:r.normalizeStyle({"margin-bottom":Be+1===j.value.length?"30px":"0","margin-top":"10px"})},[r.createElementVNode("div",{class:"new-items-buttons__add-page new-item-button",onClick:ze=>R(Be)},[...Ce[8]||(Ce[8]=[r.createElementVNode("div",null,"+ Nueva página",-1),r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,kke),r.createElementVNode("div",{class:"new-items-buttons__add-item new-item-button",onClick:ze=>K(Pe)},[...Ce[9]||(Ce[9]=[r.createElementVNode("div",null,"+ Agregar gráfico",-1),r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M12 13.3346V6.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{d:"M8 13.3346V2.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{d:"M4 13.332V9.33203",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,Nke)],4)):r.createCommentVNode("",!0)],8,_ke))),128))]))]),_.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Vke,[r.createElementVNode("div",Oke,[r.createElementVNode("div",Lke,[r.createElementVNode("div",null,"Páginas "+r.toDisplayString(O.value),1),r.createElementVNode("div",{class:r.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:m.value<=0}]),onClick:Ce[3]||(Ce[3]=Pe=>m.value>0&&W(m.value-1))},[...Ce[10]||(Ce[10]=[r.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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),r.createElementVNode("div",{class:r.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:m.value>=j.value.length}]),onClick:Ce[4]||(Ce[4]=Pe=>m.value<j.value.length&&W(m.value+1))},[...Ce[11]||(Ce[11]=[r.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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)]),r.createElementVNode("div",Uke,[r.createElementVNode("div",{role:"button",class:r.normalizeClass({active:m.value===0}),onClick:Ce[5]||(Ce[5]=Pe=>W(0))},r.toDisplayString(U(1)),3),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,(Pe,Be)=>(r.openBlock(),r.createElementBlock("div",{role:"button",key:Be,class:r.normalizeClass({active:Be+1===m.value}),onClick:ze=>W(Be+1)},r.toDisplayString(U(Be+2)),11,qke))),128))])]),t.value?(r.openBlock(),r.createElementBlock("div",{key:0,role:"button",class:r.normalizeClass(["template-maker__content__main__footer__save save-button",{disabled:!d.value}]),onClick:ye},[...Ce[12]||(Ce[12]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.createElementVNode("path",{d:"M11.3346 14.0013V8.66797H4.66797V14.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{d:"M4.66797 2V5.33333H10.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1),r.createElementVNode("div",null,"Guardar",-1)])],2)):r.createCommentVNode("",!0)]))])])],4)):r.createCommentVNode("",!0)]))],64))}},Cke=Bc(zke,[["__scopeId","data-v-a1be59f5"]]);function IN(e,a){return function(){return e.apply(a,arguments)}}const{toString:Pke}=Object.prototype,{getPrototypeOf:L5}=Object,{iterator:x2,toStringTag:XN}=Symbol,w2=(e=>a=>{const i=Pke.call(a);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Ap=e=>(e=e.toLowerCase(),a=>w2(a)===e),_2=e=>a=>typeof a===e,{isArray:Y0}=Array,Q0=_2("undefined");function X1(e){return e!==null&&!Q0(e)&&e.constructor!==null&&!Q0(e.constructor)&&zd(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const DN=Ap("ArrayBuffer");function Eke(e){let a;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?a=ArrayBuffer.isView(e):a=e&&e.buffer&&DN(e.buffer),a}const Fke=_2("string"),zd=_2("function"),JN=_2("number"),D1=e=>e!==null&&typeof e=="object",Rke=e=>e===!0||e===!1,S2=e=>{if(w2(e)!=="object")return!1;const a=L5(e);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(XN in e)&&!(x2 in e)},Mke=e=>{if(!D1(e)||X1(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},jke=Ap("Date"),Wke=Ap("File"),Kke=Ap("Blob"),Ake=Ap("FileList"),Ike=e=>D1(e)&&zd(e.pipe),Xke=e=>{let a;return e&&(typeof FormData=="function"&&e instanceof FormData||zd(e.append)&&((a=w2(e))==="formdata"||a==="object"&&zd(e.toString)&&e.toString()==="[object FormData]"))},Dke=Ap("URLSearchParams"),[Jke,Bke,Gke,Zke]=["ReadableStream","Request","Response","Headers"].map(Ap),Hke=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function J1(e,a,{allOwnKeys:i=!1}={}){if(e===null||typeof e>"u")return;let k,j;if(typeof e!="object"&&(e=[e]),Y0(e))for(k=0,j=e.length;k<j;k++)a.call(null,e[k],k,e);else{if(X1(e))return;const g=i?Object.getOwnPropertyNames(e):Object.keys(e),m=g.length;let n;for(k=0;k<m;k++)n=g[k],a.call(null,e[n],n,e)}}function BN(e,a){if(X1(e))return null;a=a.toLowerCase();const i=Object.keys(e);let k=i.length,j;for(;k-- >0;)if(j=i[k],a===j.toLowerCase())return j;return null}const zm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,GN=e=>!Q0(e)&&e!==zm;function U5(){const{caseless:e,skipUndefined:a}=GN(this)&&this||{},i={},k=(j,g)=>{const m=e&&BN(i,g)||g;S2(i[m])&&S2(j)?i[m]=U5(i[m],j):S2(j)?i[m]=U5({},j):Y0(j)?i[m]=j.slice():(!a||!Q0(j))&&(i[m]=j)};for(let j=0,g=arguments.length;j<g;j++)arguments[j]&&J1(arguments[j],k);return i}const Yke=(e,a,i,{allOwnKeys:k}={})=>(J1(a,(j,g)=>{i&&zd(j)?e[g]=IN(j,i):e[g]=j},{allOwnKeys:k}),e),Qke=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),$ke=(e,a,i,k)=>{e.prototype=Object.create(a.prototype,k),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:a.prototype}),i&&Object.assign(e.prototype,i)},e7e=(e,a,i,k)=>{let j,g,m;const n={};if(a=a||{},e==null)return a;do{for(j=Object.getOwnPropertyNames(e),g=j.length;g-- >0;)m=j[g],(!k||k(m,e,a))&&!n[m]&&(a[m]=e[m],n[m]=!0);e=i!==!1&&L5(e)}while(e&&(!i||i(e,a))&&e!==Object.prototype);return a},t7e=(e,a,i)=>{e=String(e),(i===void 0||i>e.length)&&(i=e.length),i-=a.length;const k=e.indexOf(a,i);return k!==-1&&k===i},r7e=e=>{if(!e)return null;if(Y0(e))return e;let a=e.length;if(!JN(a))return null;const i=new Array(a);for(;a-- >0;)i[a]=e[a];return i},n7e=(e=>a=>e&&a instanceof e)(typeof Uint8Array<"u"&&L5(Uint8Array)),a7e=(e,a)=>{const k=(e&&e[x2]).call(e);let j;for(;(j=k.next())&&!j.done;){const g=j.value;a.call(e,g[0],g[1])}},i7e=(e,a)=>{let i;const k=[];for(;(i=e.exec(a))!==null;)k.push(i);return k},o7e=Ap("HTMLFormElement"),s7e=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,k,j){return k.toUpperCase()+j}),ZN=(({hasOwnProperty:e})=>(a,i)=>e.call(a,i))(Object.prototype),l7e=Ap("RegExp"),HN=(e,a)=>{const i=Object.getOwnPropertyDescriptors(e),k={};J1(i,(j,g)=>{let m;(m=a(j,g,e))!==!1&&(k[g]=m||j)}),Object.defineProperties(e,k)},c7e=e=>{HN(e,(a,i)=>{if(zd(e)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const k=e[i];if(zd(k)){if(a.enumerable=!1,"writable"in a){a.writable=!1;return}a.set||(a.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},u7e=(e,a)=>{const i={},k=j=>{j.forEach(g=>{i[g]=!0})};return Y0(e)?k(e):k(String(e).split(a)),i},d7e=()=>{},p7e=(e,a)=>e!=null&&Number.isFinite(e=+e)?e:a;function h7e(e){return!!(e&&zd(e.append)&&e[XN]==="FormData"&&e[x2])}const f7e=e=>{const a=new Array(10),i=(k,j)=>{if(D1(k)){if(a.indexOf(k)>=0)return;if(X1(k))return k;if(!("toJSON"in k)){a[j]=k;const g=Y0(k)?[]:{};return J1(k,(m,n)=>{const f=i(m,j+1);!Q0(f)&&(g[n]=f)}),a[j]=void 0,g}}return k};return i(e,0)},m7e=Ap("AsyncFunction"),y7e=e=>e&&(D1(e)||zd(e))&&zd(e.then)&&zd(e.catch),YN=((e,a)=>e?setImmediate:a?((i,k)=>(zm.addEventListener("message",({source:j,data:g})=>{j===zm&&g===i&&k.length&&k.shift()()},!1),j=>{k.push(j),zm.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",zd(zm.postMessage)),g7e=typeof queueMicrotask<"u"?queueMicrotask.bind(zm):typeof process<"u"&&process.nextTick||YN,Qn={isArray:Y0,isArrayBuffer:DN,isBuffer:X1,isFormData:Xke,isArrayBufferView:Eke,isString:Fke,isNumber:JN,isBoolean:Rke,isObject:D1,isPlainObject:S2,isEmptyObject:Mke,isReadableStream:Jke,isRequest:Bke,isResponse:Gke,isHeaders:Zke,isUndefined:Q0,isDate:jke,isFile:Wke,isBlob:Kke,isRegExp:l7e,isFunction:zd,isStream:Ike,isURLSearchParams:Dke,isTypedArray:n7e,isFileList:Ake,forEach:J1,merge:U5,extend:Yke,trim:Hke,stripBOM:Qke,inherits:$ke,toFlatObject:e7e,kindOf:w2,kindOfTest:Ap,endsWith:t7e,toArray:r7e,forEachEntry:a7e,matchAll:i7e,isHTMLForm:o7e,hasOwnProperty:ZN,hasOwnProp:ZN,reduceDescriptors:HN,freezeMethods:c7e,toObjectSet:u7e,toCamelCase:s7e,noop:d7e,toFiniteNumber:p7e,findKey:BN,global:zm,isContextDefined:GN,isSpecCompliantForm:h7e,toJSONObject:f7e,isAsyncFn:m7e,isThenable:y7e,setImmediate:YN,asap:g7e,isIterable:e=>e!=null&&zd(e[x2])};function fo(e,a,i,k,j){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",a&&(this.code=a),i&&(this.config=i),k&&(this.request=k),j&&(this.response=j,this.status=j.status?j.status:null)}Qn.inherits(fo,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 QN=fo.prototype,$N={};["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(e=>{$N[e]={value:e}}),Object.defineProperties(fo,$N),Object.defineProperty(QN,"isAxiosError",{value:!0}),fo.from=(e,a,i,k,j,g)=>{const m=Object.create(QN);Qn.toFlatObject(e,m,function(t){return t!==Error.prototype},l=>l!=="isAxiosError");const n=e&&e.message?e.message:"Error",f=a==null&&e?e.code:a;return fo.call(m,n,f,i,k,j),e&&m.cause==null&&Object.defineProperty(m,"cause",{value:e,configurable:!0}),m.name=e&&e.name||"Error",g&&Object.assign(m,g),m};const v7e=null;function q5(e){return Qn.isPlainObject(e)||Qn.isArray(e)}function eV(e){return Qn.endsWith(e,"[]")?e.slice(0,-2):e}function tV(e,a,i){return e?e.concat(a).map(function(j,g){return j=eV(j),!i&&g?"["+j+"]":j}).join(i?".":""):a}function b7e(e){return Qn.isArray(e)&&!e.some(q5)}const x7e=Qn.toFlatObject(Qn,{},null,function(a){return/^is[A-Z]/.test(a)});function T2(e,a,i){if(!Qn.isObject(e))throw new TypeError("target must be an object");a=a||new FormData,i=Qn.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(o,s){return!Qn.isUndefined(s[o])});const k=i.metaTokens,j=i.visitor||t,g=i.dots,m=i.indexes,f=(i.Blob||typeof Blob<"u"&&Blob)&&Qn.isSpecCompliantForm(a);if(!Qn.isFunction(j))throw new TypeError("visitor must be a function");function l(h){if(h===null)return"";if(Qn.isDate(h))return h.toISOString();if(Qn.isBoolean(h))return h.toString();if(!f&&Qn.isBlob(h))throw new fo("Blob is not supported. Use a Buffer instead.");return Qn.isArrayBuffer(h)||Qn.isTypedArray(h)?f&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function t(h,o,s){let p=h;if(h&&!s&&typeof h=="object"){if(Qn.endsWith(o,"{}"))o=k?o:o.slice(0,-2),h=JSON.stringify(h);else if(Qn.isArray(h)&&b7e(h)||(Qn.isFileList(h)||Qn.endsWith(o,"[]"))&&(p=Qn.toArray(h)))return o=eV(o),p.forEach(function(d,x){!(Qn.isUndefined(d)||d===null)&&a.append(m===!0?tV([o],x,g):m===null?o:o+"[]",l(d))}),!1}return q5(h)?!0:(a.append(tV(s,o,g),l(h)),!1)}const _=[],b=Object.assign(x7e,{defaultVisitor:t,convertValue:l,isVisitable:q5});function v(h,o){if(!Qn.isUndefined(h)){if(_.indexOf(h)!==-1)throw Error("Circular reference detected in "+o.join("."));_.push(h),Qn.forEach(h,function(p,c){(!(Qn.isUndefined(p)||p===null)&&j.call(a,p,Qn.isString(c)?c.trim():c,o,b))===!0&&v(p,o?o.concat(c):[c])}),_.pop()}}if(!Qn.isObject(e))throw new TypeError("data must be an object");return v(e),a}function rV(e){const a={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(k){return a[k]})}function z5(e,a){this._pairs=[],e&&T2(e,this,a)}const nV=z5.prototype;nV.append=function(a,i){this._pairs.push([a,i])},nV.toString=function(a){const i=a?function(k){return a.call(this,k,rV)}:rV;return this._pairs.map(function(j){return i(j[0])+"="+i(j[1])},"").join("&")};function w7e(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function aV(e,a,i){if(!a)return e;const k=i&&i.encode||w7e;Qn.isFunction(i)&&(i={serialize:i});const j=i&&i.serialize;let g;if(j?g=j(a,i):g=Qn.isURLSearchParams(a)?a.toString():new z5(a,i).toString(k),g){const m=e.indexOf("#");m!==-1&&(e=e.slice(0,m)),e+=(e.indexOf("?")===-1?"?":"&")+g}return e}class iV{constructor(){this.handlers=[]}use(a,i,k){return this.handlers.push({fulfilled:a,rejected:i,synchronous:k?k.synchronous:!1,runWhen:k?k.runWhen:null}),this.handlers.length-1}eject(a){this.handlers[a]&&(this.handlers[a]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(a){Qn.forEach(this.handlers,function(k){k!==null&&a(k)})}}const oV={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_7e={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:z5,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},C5=typeof window<"u"&&typeof document<"u",P5=typeof navigator=="object"&&navigator||void 0,S7e=C5&&(!P5||["ReactNative","NativeScript","NS"].indexOf(P5.product)<0),T7e=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",k7e=C5&&window.location.href||"http://localhost",Gu={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:C5,hasStandardBrowserEnv:S7e,hasStandardBrowserWebWorkerEnv:T7e,navigator:P5,origin:k7e},Symbol.toStringTag,{value:"Module"})),..._7e};function N7e(e,a){return T2(e,new Gu.classes.URLSearchParams,{visitor:function(i,k,j,g){return Gu.isNode&&Qn.isBuffer(i)?(this.append(k,i.toString("base64")),!1):g.defaultVisitor.apply(this,arguments)},...a})}function V7e(e){return Qn.matchAll(/\w+|\[(\w*)]/g,e).map(a=>a[0]==="[]"?"":a[1]||a[0])}function O7e(e){const a={},i=Object.keys(e);let k;const j=i.length;let g;for(k=0;k<j;k++)g=i[k],a[g]=e[g];return a}function sV(e){function a(i,k,j,g){let m=i[g++];if(m==="__proto__")return!0;const n=Number.isFinite(+m),f=g>=i.length;return m=!m&&Qn.isArray(j)?j.length:m,f?(Qn.hasOwnProp(j,m)?j[m]=[j[m],k]:j[m]=k,!n):((!j[m]||!Qn.isObject(j[m]))&&(j[m]=[]),a(i,k,j[m],g)&&Qn.isArray(j[m])&&(j[m]=O7e(j[m])),!n)}if(Qn.isFormData(e)&&Qn.isFunction(e.entries)){const i={};return Qn.forEachEntry(e,(k,j)=>{a(V7e(k),j,i,0)}),i}return null}function L7e(e,a,i){if(Qn.isString(e))try{return(a||JSON.parse)(e),Qn.trim(e)}catch(k){if(k.name!=="SyntaxError")throw k}return(i||JSON.stringify)(e)}const B1={transitional:oV,adapter:["xhr","http","fetch"],transformRequest:[function(a,i){const k=i.getContentType()||"",j=k.indexOf("application/json")>-1,g=Qn.isObject(a);if(g&&Qn.isHTMLForm(a)&&(a=new FormData(a)),Qn.isFormData(a))return j?JSON.stringify(sV(a)):a;if(Qn.isArrayBuffer(a)||Qn.isBuffer(a)||Qn.isStream(a)||Qn.isFile(a)||Qn.isBlob(a)||Qn.isReadableStream(a))return a;if(Qn.isArrayBufferView(a))return a.buffer;if(Qn.isURLSearchParams(a))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),a.toString();let n;if(g){if(k.indexOf("application/x-www-form-urlencoded")>-1)return N7e(a,this.formSerializer).toString();if((n=Qn.isFileList(a))||k.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return T2(n?{"files[]":a}:a,f&&new f,this.formSerializer)}}return g||j?(i.setContentType("application/json",!1),L7e(a)):a}],transformResponse:[function(a){const i=this.transitional||B1.transitional,k=i&&i.forcedJSONParsing,j=this.responseType==="json";if(Qn.isResponse(a)||Qn.isReadableStream(a))return a;if(a&&Qn.isString(a)&&(k&&!this.responseType||j)){const m=!(i&&i.silentJSONParsing)&&j;try{return JSON.parse(a,this.parseReviver)}catch(n){if(m)throw n.name==="SyntaxError"?fo.from(n,fo.ERR_BAD_RESPONSE,this,null,this.response):n}}return a}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Gu.classes.FormData,Blob:Gu.classes.Blob},validateStatus:function(a){return a>=200&&a<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Qn.forEach(["delete","get","head","post","put","patch"],e=>{B1.headers[e]={}});const U7e=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"]),q7e=e=>{const a={};let i,k,j;return e&&e.split(`
4127
4127
  `).forEach(function(m){j=m.indexOf(":"),i=m.substring(0,j).trim().toLowerCase(),k=m.substring(j+1).trim(),!(!i||a[i]&&U7e[i])&&(i==="set-cookie"?a[i]?a[i].push(k):a[i]=[k]:a[i]=a[i]?a[i]+", "+k:k)}),a},lV=Symbol("internals");function G1(e){return e&&String(e).trim().toLowerCase()}function k2(e){return e===!1||e==null?e:Qn.isArray(e)?e.map(k2):String(e)}function z7e(e){const a=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let k;for(;k=i.exec(e);)a[k[1]]=k[2];return a}const C7e=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function E5(e,a,i,k,j){if(Qn.isFunction(k))return k.call(this,a,i);if(j&&(a=i),!!Qn.isString(a)){if(Qn.isString(k))return a.indexOf(k)!==-1;if(Qn.isRegExp(k))return k.test(a)}}function P7e(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(a,i,k)=>i.toUpperCase()+k)}function E7e(e,a){const i=Qn.toCamelCase(" "+a);["get","set","has"].forEach(k=>{Object.defineProperty(e,k+i,{value:function(j,g,m){return this[k].call(this,a,j,g,m)},configurable:!0})})}let Cd=class{constructor(a){a&&this.set(a)}set(a,i,k){const j=this;function g(n,f,l){const t=G1(f);if(!t)throw new Error("header name must be a non-empty string");const _=Qn.findKey(j,t);(!_||j[_]===void 0||l===!0||l===void 0&&j[_]!==!1)&&(j[_||f]=k2(n))}const m=(n,f)=>Qn.forEach(n,(l,t)=>g(l,t,f));if(Qn.isPlainObject(a)||a instanceof this.constructor)m(a,i);else if(Qn.isString(a)&&(a=a.trim())&&!C7e(a))m(q7e(a),i);else if(Qn.isObject(a)&&Qn.isIterable(a)){let n={},f,l;for(const t of a){if(!Qn.isArray(t))throw TypeError("Object iterator must return a key-value pair");n[l=t[0]]=(f=n[l])?Qn.isArray(f)?[...f,t[1]]:[f,t[1]]:t[1]}m(n,i)}else a!=null&&g(i,a,k);return this}get(a,i){if(a=G1(a),a){const k=Qn.findKey(this,a);if(k){const j=this[k];if(!i)return j;if(i===!0)return z7e(j);if(Qn.isFunction(i))return i.call(this,j,k);if(Qn.isRegExp(i))return i.exec(j);throw new TypeError("parser must be boolean|regexp|function")}}}has(a,i){if(a=G1(a),a){const k=Qn.findKey(this,a);return!!(k&&this[k]!==void 0&&(!i||E5(this,this[k],k,i)))}return!1}delete(a,i){const k=this;let j=!1;function g(m){if(m=G1(m),m){const n=Qn.findKey(k,m);n&&(!i||E5(k,k[n],n,i))&&(delete k[n],j=!0)}}return Qn.isArray(a)?a.forEach(g):g(a),j}clear(a){const i=Object.keys(this);let k=i.length,j=!1;for(;k--;){const g=i[k];(!a||E5(this,this[g],g,a,!0))&&(delete this[g],j=!0)}return j}normalize(a){const i=this,k={};return Qn.forEach(this,(j,g)=>{const m=Qn.findKey(k,g);if(m){i[m]=k2(j),delete i[g];return}const n=a?P7e(g):String(g).trim();n!==g&&delete i[g],i[n]=k2(j),k[n]=!0}),this}concat(...a){return this.constructor.concat(this,...a)}toJSON(a){const i=Object.create(null);return Qn.forEach(this,(k,j)=>{k!=null&&k!==!1&&(i[j]=a&&Qn.isArray(k)?k.join(", "):k)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([a,i])=>a+": "+i).join(`
4128
4128
  `)}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,...i){const k=new this(a);return i.forEach(j=>k.set(j)),k}static accessor(a){const k=(this[lV]=this[lV]={accessors:{}}).accessors,j=this.prototype;function g(m){const n=G1(m);k[n]||(E7e(j,m),k[n]=!0)}return Qn.isArray(a)?a.forEach(g):g(a),this}};Cd.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Qn.reduceDescriptors(Cd.prototype,({value:e},a)=>{let i=a[0].toUpperCase()+a.slice(1);return{get:()=>e,set(k){this[i]=k}}}),Qn.freezeMethods(Cd);function F5(e,a){const i=this||B1,k=a||i,j=Cd.from(k.headers);let g=k.data;return Qn.forEach(e,function(n){g=n.call(i,g,j.normalize(),a?a.status:void 0)}),j.normalize(),g}function cV(e){return!!(e&&e.__CANCEL__)}function $0(e,a,i){fo.call(this,e??"canceled",fo.ERR_CANCELED,a,i),this.name="CanceledError"}Qn.inherits($0,fo,{__CANCEL__:!0});function uV(e,a,i){const k=i.config.validateStatus;!i.status||!k||k(i.status)?e(i):a(new fo("Request failed with status code "+i.status,[fo.ERR_BAD_REQUEST,fo.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function F7e(e){const a=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return a&&a[1]||""}function R7e(e,a){e=e||10;const i=new Array(e),k=new Array(e);let j=0,g=0,m;return a=a!==void 0?a:1e3,function(f){const l=Date.now(),t=k[g];m||(m=l),i[j]=f,k[j]=l;let _=g,b=0;for(;_!==j;)b+=i[_++],_=_%e;if(j=(j+1)%e,j===g&&(g=(g+1)%e),l-m<a)return;const v=t&&l-t;return v?Math.round(b*1e3/v):void 0}}function M7e(e,a){let i=0,k=1e3/a,j,g;const m=(l,t=Date.now())=>{i=t,j=null,g&&(clearTimeout(g),g=null),e(...l)};return[(...l)=>{const t=Date.now(),_=t-i;_>=k?m(l,t):(j=l,g||(g=setTimeout(()=>{g=null,m(j)},k-_)))},()=>j&&m(j)]}const N2=(e,a,i=3)=>{let k=0;const j=R7e(50,250);return M7e(g=>{const m=g.loaded,n=g.lengthComputable?g.total:void 0,f=m-k,l=j(f),t=m<=n;k=m;const _={loaded:m,total:n,progress:n?m/n:void 0,bytes:f,rate:l||void 0,estimated:l&&n&&t?(n-m)/l:void 0,event:g,lengthComputable:n!=null,[a?"download":"upload"]:!0};e(_)},i)},dV=(e,a)=>{const i=e!=null;return[k=>a[0]({lengthComputable:i,total:e,loaded:k}),a[1]]},pV=e=>(...a)=>Qn.asap(()=>e(...a)),j7e=Gu.hasStandardBrowserEnv?((e,a)=>i=>(i=new URL(i,Gu.origin),e.protocol===i.protocol&&e.host===i.host&&(a||e.port===i.port)))(new URL(Gu.origin),Gu.navigator&&/(msie|trident)/i.test(Gu.navigator.userAgent)):()=>!0,W7e=Gu.hasStandardBrowserEnv?{write(e,a,i,k,j,g,m){if(typeof document>"u")return;const n=[`${e}=${encodeURIComponent(a)}`];Qn.isNumber(i)&&n.push(`expires=${new Date(i).toUTCString()}`),Qn.isString(k)&&n.push(`path=${k}`),Qn.isString(j)&&n.push(`domain=${j}`),g===!0&&n.push("secure"),Qn.isString(m)&&n.push(`SameSite=${m}`),document.cookie=n.join("; ")},read(e){if(typeof document>"u")return null;const a=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return a?decodeURIComponent(a[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function K7e(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function A7e(e,a){return a?e.replace(/\/?\/$/,"")+"/"+a.replace(/^\/+/,""):e}function hV(e,a,i){let k=!K7e(a);return e&&(k||i==!1)?A7e(e,a):a}const fV=e=>e instanceof Cd?{...e}:e;function Cm(e,a){a=a||{};const i={};function k(l,t,_,b){return Qn.isPlainObject(l)&&Qn.isPlainObject(t)?Qn.merge.call({caseless:b},l,t):Qn.isPlainObject(t)?Qn.merge({},t):Qn.isArray(t)?t.slice():t}function j(l,t,_,b){if(Qn.isUndefined(t)){if(!Qn.isUndefined(l))return k(void 0,l,_,b)}else return k(l,t,_,b)}function g(l,t){if(!Qn.isUndefined(t))return k(void 0,t)}function m(l,t){if(Qn.isUndefined(t)){if(!Qn.isUndefined(l))return k(void 0,l)}else return k(void 0,t)}function n(l,t,_){if(_ in a)return k(l,t);if(_ in e)return k(void 0,l)}const f={url:g,method:g,data:g,baseURL:m,transformRequest:m,transformResponse:m,paramsSerializer:m,timeout:m,timeoutMessage:m,withCredentials:m,withXSRFToken:m,adapter:m,responseType:m,xsrfCookieName:m,xsrfHeaderName:m,onUploadProgress:m,onDownloadProgress:m,decompress:m,maxContentLength:m,maxBodyLength:m,beforeRedirect:m,transport:m,httpAgent:m,httpsAgent:m,cancelToken:m,socketPath:m,responseEncoding:m,validateStatus:n,headers:(l,t,_)=>j(fV(l),fV(t),_,!0)};return Qn.forEach(Object.keys({...e,...a}),function(t){const _=f[t]||j,b=_(e[t],a[t],t);Qn.isUndefined(b)&&_!==n||(i[t]=b)}),i}const mV=e=>{const a=Cm({},e);let{data:i,withXSRFToken:k,xsrfHeaderName:j,xsrfCookieName:g,headers:m,auth:n}=a;if(a.headers=m=Cd.from(m),a.url=aV(hV(a.baseURL,a.url,a.allowAbsoluteUrls),e.params,e.paramsSerializer),n&&m.set("Authorization","Basic "+btoa((n.username||"")+":"+(n.password?unescape(encodeURIComponent(n.password)):""))),Qn.isFormData(i)){if(Gu.hasStandardBrowserEnv||Gu.hasStandardBrowserWebWorkerEnv)m.setContentType(void 0);else if(Qn.isFunction(i.getHeaders)){const f=i.getHeaders(),l=["content-type","content-length"];Object.entries(f).forEach(([t,_])=>{l.includes(t.toLowerCase())&&m.set(t,_)})}}if(Gu.hasStandardBrowserEnv&&(k&&Qn.isFunction(k)&&(k=k(a)),k||k!==!1&&j7e(a.url))){const f=j&&g&&W7e.read(g);f&&m.set(j,f)}return a},I7e=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(i,k){const j=mV(e);let g=j.data;const m=Cd.from(j.headers).normalize();let{responseType:n,onUploadProgress:f,onDownloadProgress:l}=j,t,_,b,v,h;function o(){v&&v(),h&&h(),j.cancelToken&&j.cancelToken.unsubscribe(t),j.signal&&j.signal.removeEventListener("abort",t)}let s=new XMLHttpRequest;s.open(j.method.toUpperCase(),j.url,!0),s.timeout=j.timeout;function p(){if(!s)return;const d=Cd.from("getAllResponseHeaders"in s&&s.getAllResponseHeaders()),w={data:!n||n==="text"||n==="json"?s.responseText:s.response,status:s.status,statusText:s.statusText,headers:d,config:e,request:s};uV(function(V){i(V),o()},function(V){k(V),o()},w),s=null}"onloadend"in s?s.onloadend=p:s.onreadystatechange=function(){!s||s.readyState!==4||s.status===0&&!(s.responseURL&&s.responseURL.indexOf("file:")===0)||setTimeout(p)},s.onabort=function(){s&&(k(new fo("Request aborted",fo.ECONNABORTED,e,s)),s=null)},s.onerror=function(x){const w=x&&x.message?x.message:"Network Error",S=new fo(w,fo.ERR_NETWORK,e,s);S.event=x||null,k(S),s=null},s.ontimeout=function(){let x=j.timeout?"timeout of "+j.timeout+"ms exceeded":"timeout exceeded";const w=j.transitional||oV;j.timeoutErrorMessage&&(x=j.timeoutErrorMessage),k(new fo(x,w.clarifyTimeoutError?fo.ETIMEDOUT:fo.ECONNABORTED,e,s)),s=null},g===void 0&&m.setContentType(null),"setRequestHeader"in s&&Qn.forEach(m.toJSON(),function(x,w){s.setRequestHeader(w,x)}),Qn.isUndefined(j.withCredentials)||(s.withCredentials=!!j.withCredentials),n&&n!=="json"&&(s.responseType=j.responseType),l&&([b,h]=N2(l,!0),s.addEventListener("progress",b)),f&&s.upload&&([_,v]=N2(f),s.upload.addEventListener("progress",_),s.upload.addEventListener("loadend",v)),(j.cancelToken||j.signal)&&(t=d=>{s&&(k(!d||d.type?new $0(null,e,s):d),s.abort(),s=null)},j.cancelToken&&j.cancelToken.subscribe(t),j.signal&&(j.signal.aborted?t():j.signal.addEventListener("abort",t)));const c=F7e(j.url);if(c&&Gu.protocols.indexOf(c)===-1){k(new fo("Unsupported protocol "+c+":",fo.ERR_BAD_REQUEST,e));return}s.send(g||null)})},X7e=(e,a)=>{const{length:i}=e=e?e.filter(Boolean):[];if(a||i){let k=new AbortController,j;const g=function(l){if(!j){j=!0,n();const t=l instanceof Error?l:this.reason;k.abort(t instanceof fo?t:new $0(t instanceof Error?t.message:t))}};let m=a&&setTimeout(()=>{m=null,g(new fo(`timeout ${a} of ms exceeded`,fo.ETIMEDOUT))},a);const n=()=>{e&&(m&&clearTimeout(m),m=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(g):l.removeEventListener("abort",g)}),e=null)};e.forEach(l=>l.addEventListener("abort",g));const{signal:f}=k;return f.unsubscribe=()=>Qn.asap(n),f}},D7e=function*(e,a){let i=e.byteLength;if(i<a){yield e;return}let k=0,j;for(;k<i;)j=k+a,yield e.slice(k,j),k=j},J7e=async function*(e,a){for await(const i of B7e(e))yield*D7e(i,a)},B7e=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const a=e.getReader();try{for(;;){const{done:i,value:k}=await a.read();if(i)break;yield k}}finally{await a.cancel()}},yV=(e,a,i,k)=>{const j=J7e(e,a);let g=0,m,n=f=>{m||(m=!0,k&&k(f))};return new ReadableStream({async pull(f){try{const{done:l,value:t}=await j.next();if(l){n(),f.close();return}let _=t.byteLength;if(i){let b=g+=_;i(b)}f.enqueue(new Uint8Array(t))}catch(l){throw n(l),l}},cancel(f){return n(f),j.return()}},{highWaterMark:2})},gV=64*1024,{isFunction:V2}=Qn,G7e=(({Request:e,Response:a})=>({Request:e,Response:a}))(Qn.global),{ReadableStream:vV,TextEncoder:bV}=Qn.global,xV=(e,...a)=>{try{return!!e(...a)}catch{return!1}},Z7e=e=>{e=Qn.merge.call({skipUndefined:!0},G7e,e);const{fetch:a,Request:i,Response:k}=e,j=a?V2(a):typeof fetch=="function",g=V2(i),m=V2(k);if(!j)return!1;const n=j&&V2(vV),f=j&&(typeof bV=="function"?(h=>o=>h.encode(o))(new bV):async h=>new Uint8Array(await new i(h).arrayBuffer())),l=g&&n&&xV(()=>{let h=!1;const o=new i(Gu.origin,{body:new vV,method:"POST",get duplex(){return h=!0,"half"}}).headers.has("Content-Type");return h&&!o}),t=m&&n&&xV(()=>Qn.isReadableStream(new k("").body)),_={stream:t&&(h=>h.body)};j&&["text","arrayBuffer","blob","formData","stream"].forEach(h=>{!_[h]&&(_[h]=(o,s)=>{let p=o&&o[h];if(p)return p.call(o);throw new fo(`Response type '${h}' is not supported`,fo.ERR_NOT_SUPPORT,s)})});const b=async h=>{if(h==null)return 0;if(Qn.isBlob(h))return h.size;if(Qn.isSpecCompliantForm(h))return(await new i(Gu.origin,{method:"POST",body:h}).arrayBuffer()).byteLength;if(Qn.isArrayBufferView(h)||Qn.isArrayBuffer(h))return h.byteLength;if(Qn.isURLSearchParams(h)&&(h=h+""),Qn.isString(h))return(await f(h)).byteLength},v=async(h,o)=>{const s=Qn.toFiniteNumber(h.getContentLength());return s??b(o)};return async h=>{let{url:o,method:s,data:p,signal:c,cancelToken:d,timeout:x,onDownloadProgress:w,onUploadProgress:S,responseType:V,headers:O,withCredentials:U="same-origin",fetchOptions:z}=mV(h),L=a||fetch;V=V?(V+"").toLowerCase():"text";let C=X7e([c,d&&d.toAbortSignal()],x),q=null;const N=C&&C.unsubscribe&&(()=>{C.unsubscribe()});let P;try{if(S&&l&&s!=="get"&&s!=="head"&&(P=await v(O,p))!==0){let X=new i(o,{method:"POST",body:p,duplex:"half"}),D;if(Qn.isFormData(p)&&(D=X.headers.get("content-type"))&&O.setContentType(D),X.body){const[H,ne]=dV(P,N2(pV(S)));p=yV(X.body,gV,H,ne)}}Qn.isString(U)||(U=U?"include":"omit");const T=g&&"credentials"in i.prototype,E={...z,signal:C,method:s.toUpperCase(),headers:O.normalize().toJSON(),body:p,duplex:"half",credentials:T?U:void 0};q=g&&new i(o,E);let R=await(g?L(q,z):L(o,E));const W=t&&(V==="stream"||V==="response");if(t&&(w||W&&N)){const X={};["status","statusText","headers"].forEach(B=>{X[B]=R[B]});const D=Qn.toFiniteNumber(R.headers.get("content-length")),[H,ne]=w&&dV(D,N2(pV(w),!0))||[];R=new k(yV(R.body,gV,H,()=>{ne&&ne(),N&&N()}),X)}V=V||"text";let K=await _[Qn.findKey(_,V)||"text"](R,h);return!W&&N&&N(),await new Promise((X,D)=>{uV(X,D,{data:K,headers:Cd.from(R.headers),status:R.status,statusText:R.statusText,config:h,request:q})})}catch(T){throw N&&N(),T&&T.name==="TypeError"&&/Load failed|fetch/i.test(T.message)?Object.assign(new fo("Network Error",fo.ERR_NETWORK,h,q),{cause:T.cause||T}):fo.from(T,T&&T.code,h,q)}}},H7e=new Map,wV=e=>{let a=e&&e.env||{};const{fetch:i,Request:k,Response:j}=a,g=[k,j,i];let m=g.length,n=m,f,l,t=H7e;for(;n--;)f=g[n],l=t.get(f),l===void 0&&t.set(f,l=n?new Map:Z7e(a)),t=l;return l};wV();const R5={http:v7e,xhr:I7e,fetch:{get:wV}};Qn.forEach(R5,(e,a)=>{if(e){try{Object.defineProperty(e,"name",{value:a})}catch{}Object.defineProperty(e,"adapterName",{value:a})}});const _V=e=>`- ${e}`,Y7e=e=>Qn.isFunction(e)||e===null||e===!1;function Q7e(e,a){e=Qn.isArray(e)?e:[e];const{length:i}=e;let k,j;const g={};for(let m=0;m<i;m++){k=e[m];let n;if(j=k,!Y7e(k)&&(j=R5[(n=String(k)).toLowerCase()],j===void 0))throw new fo(`Unknown adapter '${n}'`);if(j&&(Qn.isFunction(j)||(j=j.get(a))))break;g[n||"#"+m]=j}if(!j){const m=Object.entries(g).map(([f,l])=>`adapter ${f} `+(l===!1?"is not supported by the environment":"is not available in the build"));let n=i?m.length>1?`since :
4129
4129
  `+m.map(_V).join(`
4130
4130
  `):" "+_V(m[0]):"as no adapter specified";throw new fo("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return j}const SV={getAdapter:Q7e,adapters:R5};function M5(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new $0(null,e)}function TV(e){return M5(e),e.headers=Cd.from(e.headers),e.data=F5.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),SV.getAdapter(e.adapter||B1.adapter,e)(e).then(function(k){return M5(e),k.data=F5.call(e,e.transformResponse,k),k.headers=Cd.from(k.headers),k},function(k){return cV(k)||(M5(e),k&&k.response&&(k.response.data=F5.call(e,e.transformResponse,k.response),k.response.headers=Cd.from(k.response.headers))),Promise.reject(k)})}const kV="1.13.2",O2={};["object","boolean","number","function","string","symbol"].forEach((e,a)=>{O2[e]=function(k){return typeof k===e||"a"+(a<1?"n ":" ")+e}});const NV={};O2.transitional=function(a,i,k){function j(g,m){return"[Axios v"+kV+"] Transitional option '"+g+"'"+m+(k?". "+k:"")}return(g,m,n)=>{if(a===!1)throw new fo(j(m," has been removed"+(i?" in "+i:"")),fo.ERR_DEPRECATED);return i&&!NV[m]&&(NV[m]=!0,console.warn(j(m," has been deprecated since v"+i+" and will be removed in the near future"))),a?a(g,m,n):!0}},O2.spelling=function(a){return(i,k)=>(console.warn(`${k} is likely a misspelling of ${a}`),!0)};function $7e(e,a,i){if(typeof e!="object")throw new fo("options must be an object",fo.ERR_BAD_OPTION_VALUE);const k=Object.keys(e);let j=k.length;for(;j-- >0;){const g=k[j],m=a[g];if(m){const n=e[g],f=n===void 0||m(n,g,e);if(f!==!0)throw new fo("option "+g+" must be "+f,fo.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new fo("Unknown option "+g,fo.ERR_BAD_OPTION)}}const L2={assertOptions:$7e,validators:O2},xh=L2.validators;let Pm=class{constructor(a){this.defaults=a||{},this.interceptors={request:new iV,response:new iV}}async request(a,i){try{return await this._request(a,i)}catch(k){if(k instanceof Error){let j={};Error.captureStackTrace?Error.captureStackTrace(j):j=new Error;const g=j.stack?j.stack.replace(/^.+\n/,""):"";try{k.stack?g&&!String(k.stack).endsWith(g.replace(/^.+\n.+\n/,""))&&(k.stack+=`
4131
- `+g):k.stack=g}catch{}}throw k}}_request(a,i){typeof a=="string"?(i=i||{},i.url=a):i=a||{},i=Cm(this.defaults,i);const{transitional:k,paramsSerializer:j,headers:g}=i;k!==void 0&&L2.assertOptions(k,{silentJSONParsing:xh.transitional(xh.boolean),forcedJSONParsing:xh.transitional(xh.boolean),clarifyTimeoutError:xh.transitional(xh.boolean)},!1),j!=null&&(Qn.isFunction(j)?i.paramsSerializer={serialize:j}:L2.assertOptions(j,{encode:xh.function,serialize:xh.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),L2.assertOptions(i,{baseUrl:xh.spelling("baseURL"),withXsrfToken:xh.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let m=g&&Qn.merge(g.common,g[i.method]);g&&Qn.forEach(["delete","get","head","post","put","patch","common"],h=>{delete g[h]}),i.headers=Cd.concat(m,g);const n=[];let f=!0;this.interceptors.request.forEach(function(o){typeof o.runWhen=="function"&&o.runWhen(i)===!1||(f=f&&o.synchronous,n.unshift(o.fulfilled,o.rejected))});const l=[];this.interceptors.response.forEach(function(o){l.push(o.fulfilled,o.rejected)});let t,_=0,b;if(!f){const h=[TV.bind(this),void 0];for(h.unshift(...n),h.push(...l),b=h.length,t=Promise.resolve(i);_<b;)t=t.then(h[_++],h[_++]);return t}b=n.length;let v=i;for(;_<b;){const h=n[_++],o=n[_++];try{v=h(v)}catch(s){o.call(this,s);break}}try{t=TV.call(this,v)}catch(h){return Promise.reject(h)}for(_=0,b=l.length;_<b;)t=t.then(l[_++],l[_++]);return t}getUri(a){a=Cm(this.defaults,a);const i=hV(a.baseURL,a.url,a.allowAbsoluteUrls);return aV(i,a.params,a.paramsSerializer)}};Qn.forEach(["delete","get","head","options"],function(a){Pm.prototype[a]=function(i,k){return this.request(Cm(k||{},{method:a,url:i,data:(k||{}).data}))}}),Qn.forEach(["post","put","patch"],function(a){function i(k){return function(g,m,n){return this.request(Cm(n||{},{method:a,headers:k?{"Content-Type":"multipart/form-data"}:{},url:g,data:m}))}}Pm.prototype[a]=i(),Pm.prototype[a+"Form"]=i(!0)});let e8e=class DV{constructor(a){if(typeof a!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(g){i=g});const k=this;this.promise.then(j=>{if(!k._listeners)return;let g=k._listeners.length;for(;g-- >0;)k._listeners[g](j);k._listeners=null}),this.promise.then=j=>{let g;const m=new Promise(n=>{k.subscribe(n),g=n}).then(j);return m.cancel=function(){k.unsubscribe(g)},m},a(function(g,m,n){k.reason||(k.reason=new $0(g,m,n),i(k.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(a){if(this.reason){a(this.reason);return}this._listeners?this._listeners.push(a):this._listeners=[a]}unsubscribe(a){if(!this._listeners)return;const i=this._listeners.indexOf(a);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const a=new AbortController,i=k=>{a.abort(k)};return this.subscribe(i),a.signal.unsubscribe=()=>this.unsubscribe(i),a.signal}static source(){let a;return{token:new DV(function(j){a=j}),cancel:a}}};function t8e(e){return function(i){return e.apply(null,i)}}function r8e(e){return Qn.isObject(e)&&e.isAxiosError===!0}const j5={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(j5).forEach(([e,a])=>{j5[a]=e});function VV(e){const a=new Pm(e),i=IN(Pm.prototype.request,a);return Qn.extend(i,Pm.prototype,a,{allOwnKeys:!0}),Qn.extend(i,a,null,{allOwnKeys:!0}),i.create=function(j){return VV(Cm(e,j))},i}const es=VV(B1);es.Axios=Pm,es.CanceledError=$0,es.CancelToken=e8e,es.isCancel=cV,es.VERSION=kV,es.toFormData=T2,es.AxiosError=fo,es.Cancel=es.CanceledError,es.all=function(a){return Promise.all(a)},es.spread=t8e,es.isAxiosError=r8e,es.mergeConfig=Cm,es.AxiosHeaders=Cd,es.formToJSON=e=>sV(Qn.isHTMLForm(e)?new FormData(e):e),es.getAdapter=SV.getAdapter,es.HttpStatusCode=j5,es.default=es;const{Axios:GFe,AxiosError:ZFe,CanceledError:HFe,isCancel:YFe,CancelToken:QFe,VERSION:$Fe,all:eRe,Cancel:tRe,isAxiosError:rRe,spread:nRe,toFormData:aRe,AxiosHeaders:iRe,HttpStatusCode:oRe,formToJSON:sRe,getAdapter:lRe,mergeConfig:cRe}=es,ml=(e,a)=>{const i=e.__vccOpts||e;for(const[k,j]of a)i[k]=j;return i},Z1=e=>(r.pushScopeId("data-v-137412ab"),e=e(),r.popScopeId(),e),n8e={class:"tooltip-template-options"},a8e=Z1(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-report.svg",alt:"Generar reporte",class:"icon"},null,-1)),i8e=Z1(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1)),o8e=Z1(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-edit.svg",alt:"Editar template",class:"icon"},null,-1)),s8e=Z1(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-duplicate.svg",alt:"Duplicar template",class:"icon"},null,-1)),l8e=Z1(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1)),c8e=ml({__name:"TooltipTemplateOptions",props:{canEdit:{type:Boolean,default:!0}},emits:["generar-reporte","renombrar","editar","duplicar","eliminar"],setup(e,{emit:a}){return(i,k)=>(r.openBlock(),r.createElementBlock("div",n8e,[r.createElementVNode("ul",null,[r.createElementVNode("li",{class:"option",onClick:k[0]||(k[0]=j=>i.$emit("generar-reporte"))},[a8e,r.createTextVNode(" Generar reporte ")]),e.canEdit?(r.openBlock(),r.createElementBlock("li",{key:0,class:"option",onClick:k[1]||(k[1]=j=>i.$emit("renombrar"))},[i8e,r.createTextVNode(" Renombrar template ")])):r.createCommentVNode("",!0),e.canEdit?(r.openBlock(),r.createElementBlock("li",{key:1,class:"option",onClick:k[2]||(k[2]=j=>i.$emit("editar"))},[o8e,r.createTextVNode(" Editar template ")])):r.createCommentVNode("",!0),r.createElementVNode("li",{class:"option",onClick:k[3]||(k[3]=j=>i.$emit("duplicar"))},[s8e,r.createTextVNode(" Duplicar template ")]),e.canEdit?(r.openBlock(),r.createElementBlock("li",{key:2,class:"option",onClick:k[4]||(k[4]=j=>i.$emit("eliminar"))},[l8e,r.createTextVNode(" Eliminar template ")])):r.createCommentVNode("",!0)])]))}},[["__scopeId","data-v-137412ab"]]),U2=e=>(r.pushScopeId("data-v-8520e810"),e=e(),r.popScopeId(),e),u8e={class:"template-card postpartido",style:{position:"relative"}},d8e=[U2(()=>r.createElementVNode("span",null,null,-1)),U2(()=>r.createElementVNode("span",null,null,-1)),U2(()=>r.createElementVNode("span",null,null,-1))],p8e={key:0,class:"template-img-placeholder",style:{position:"relative"}},h8e={key:0,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-01.jpg",alt:"Template Prematch Type 1",class:"template-img"},f8e={key:1,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-01.jpg",alt:"Template Postmatch Type 1",class:"template-img"},m8e={key:2,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-02.jpg",alt:"Template Prematch Type 2",class:"template-img"},y8e={key:3,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-02.jpg",alt:"Template Postmatch Type 2",class:"template-img"},g8e={key:4,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-03.jpg",alt:"Template Prematch Type 3",class:"template-img"},v8e={key:5,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-03.jpg",alt:"Template Postmatch Type 3",class:"template-img"},b8e={key:6,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-04.jpg",alt:"Template Prematch Type 4",class:"template-img"},x8e={key:7,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-04.jpg",alt:"Template Postmatch Type 4",class:"template-img"},w8e={key:8,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumb1.png",alt:"Template Default",class:"template-img"},_8e={class:"inner-card-postpartido"},S8e={class:"postpartido-footer"},T8e={class:"postpartido-version"},k8e={class:"postpartido-status"},N8e=U2(()=>r.createElementVNode("span",{class:"tipo-label"},"Tipo:",-1)),V8e={class:"tipo-value"},O8e=ml({__name:"TemplateItem",props:{template:{type:Object,required:!0},userId:{type:Number,required:!0}},emits:["generar-reporte","renombrar","duplicar","eliminar","edit-template"],setup(e,{emit:a}){const i=e,k=a,j=r.ref(!1),g=r.computed(()=>i.userId===i.template.user_id);function m(){j.value=!1,k("generar-reporte")}function n(){j.value=!1;const b=i.template.name||"";k("renombrar",b)}function f(){j.value=!1,k("edit-template",i.template)}function l(){j.value=!1;const b=i.template.name||"";k("duplicar",b)}function t(){j.value=!1,k("eliminar",i.template)}function _(b){}return(b,v)=>(r.openBlock(),r.createElementBlock("div",u8e,[r.createElementVNode("div",{class:"three-dots",onClick:v[0]||(v[0]=r.withModifiers(h=>j.value=!j.value,["stop"]))},d8e),e.template.pages&&e.template.pages[0]?(r.openBlock(),r.createElementBlock("div",p8e,[e.template.template_type===1&&e.template.pages[0].type==1?(r.openBlock(),r.createElementBlock("img",h8e)):e.template.template_type===2&&e.template.pages[0].type==1?(r.openBlock(),r.createElementBlock("img",f8e)):e.template.template_type===1&&e.template.pages[0].type==2?(r.openBlock(),r.createElementBlock("img",m8e)):e.template.template_type===2&&e.template.pages[0].type==2?(r.openBlock(),r.createElementBlock("img",y8e)):e.template.template_type===1&&e.template.pages[0].type==3?(r.openBlock(),r.createElementBlock("img",g8e)):e.template.template_type===2&&e.template.pages[0].type==3?(r.openBlock(),r.createElementBlock("img",v8e)):e.template.template_type===1&&e.template.pages[0].type==4?(r.openBlock(),r.createElementBlock("img",b8e)):e.template.template_type===2&&e.template.pages[0].type==4?(r.openBlock(),r.createElementBlock("img",x8e)):(r.openBlock(),r.createElementBlock("img",w8e))])):r.createCommentVNode("",!0),r.createElementVNode("div",_8e,[r.createElementVNode("div",S8e,[r.createElementVNode("div",T8e,r.toDisplayString(e.template.name),1),r.createElementVNode("div",k8e,[N8e,r.createElementVNode("span",V8e," "+r.toDisplayString(e.template.template_type==1?"Prepartido":"Postpartido"),1)]),r.createElementVNode("button",{class:"postpartido-btn",onClick:v[1]||(v[1]=h=>k("generar-reporte"))},"Generar reporte")])]),j.value?(r.openBlock(),r.createBlock(c8e,{key:1,"can-edit":g.value,onClick:v[2]||(v[2]=r.withModifiers(h=>j.value=!1,["self"])),onMouseleave:v[3]||(v[3]=h=>j.value=!1),onGenerarReporte:m,onRenombrar:n,onEditar:f,onDuplicar:l,onEliminar:t,onToggleAutogen:_},null,8,["can-edit"])):r.createCommentVNode("",!0),j.value?(r.openBlock(),r.createElementBlock("div",{key:2,class:"tooltip-overlay",onClick:v[4]||(v[4]=h=>j.value=!1)})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-8520e810"]]),ey=e=>(r.pushScopeId("data-v-a34cf1b5"),e=e(),r.popScopeId(),e),L8e={class:"modal-overlay"},U8e={class:"modal-content"},q8e=[ey(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],z8e=ey(()=>r.createElementVNode("div",{class:"modal-header"},[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-editar-withe.svg",class:"icon-title",alt:"icon"}),r.createElementVNode("span",{class:"modal-title"},"Crear Template")],-1)),C8e=ey(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),P8e={class:"modal-body"},E8e=ey(()=>r.createElementVNode("div",{class:"modal-label"},"Define el tipo de análisis para tu template:",-1)),F8e={class:"radio-group"},R8e=ey(()=>r.createElementVNode("div",{class:"modal-label"},"Agrega un nombre a tu template:",-1)),M8e=["disabled"],j8e={key:0,class:"error-message"},W8e=ey(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),K8e={class:"modal-footer"},A8e=["disabled"],I8e=["disabled"],X8e=["disabled"],D8e={key:0,class:"loading-spinner"},J8e={key:1},OV=ml({__name:"ModalCreateTemplate",props:{token:{type:String,required:!0},team:{type:Number,required:!0}},emits:["close","template-created","open-modal-new-template"],setup(e,{emit:a}){const i=e,k=a,j=r.ref(1),g=r.ref("pre"),m=r.ref(""),n=r.ref(!1),f=r.ref(""),l=async()=>{var t;if(!(m.value.trim().length<3)){n.value=!0,f.value="";try{const _={name:m.value.trim(),team_id:i.team,template_type:g.value==="pre"?1:2},v=await es.create({headers:{Authorization:`${i.token}`}}).post("https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates",_);k("template-created",v.data),k("open-modal-new-template",(t=v.data)==null?void 0:t.data),k("close")}catch(_){console.error("Error al guardar template:",_),_.response&&_.response.status===409&&(f.value="Ya existe un template con el mismo nombre")}finally{n.value=!1}}};return r.onMounted(()=>{document.body.style.overflow="hidden"}),r.onUnmounted(()=>{document.body.style.overflow=""}),(t,_)=>(r.openBlock(),r.createElementBlock("div",L8e,[r.createElementVNode("div",U8e,[r.createElementVNode("button",{class:"close-btn",onClick:_[0]||(_[0]=b=>t.$emit("close"))},q8e),z8e,C8e,r.createElementVNode("div",P8e,[j.value===1?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[E8e,r.createElementVNode("div",F8e,[r.createElementVNode("label",{class:r.normalizeClass(["radio-label",{selected:g.value==="pre"}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",value:"pre","onUpdate:modelValue":_[1]||(_[1]=b=>g.value=b)},null,512),[[r.vModelRadio,g.value]]),r.createTextVNode(" Prepartido ")],2),r.createElementVNode("label",{class:r.normalizeClass(["radio-label",{selected:g.value==="post"}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",value:"post","onUpdate:modelValue":_[2]||(_[2]=b=>g.value=b)},null,512),[[r.vModelRadio,g.value]]),r.createTextVNode(" Postpartido ")],2)])],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[R8e,r.withDirectives(r.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":_[3]||(_[3]=b=>m.value=b),placeholder:"Untitled",maxlength:"40",autocomplete:"off",disabled:n.value},null,8,M8e),[[r.vModelText,m.value]]),f.value?(r.openBlock(),r.createElementBlock("div",j8e,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],64))]),W8e,r.createElementVNode("div",K8e,[r.createElementVNode("button",{class:"cancel-btn",onClick:_[4]||(_[4]=b=>t.$emit("close")),disabled:n.value},"Cancelar",8,A8e),j.value===1?(r.openBlock(),r.createElementBlock("button",{key:0,class:"next-btn",disabled:!g.value,onClick:_[5]||(_[5]=b=>j.value=2)}," Siguiente ",8,I8e)):(r.openBlock(),r.createElementBlock("button",{key:1,class:"next-btn",disabled:m.value.trim().length<3||n.value,onClick:l},[n.value?(r.openBlock(),r.createElementBlock("div",D8e)):(r.openBlock(),r.createElementBlock("span",J8e,"Guardar"))],8,X8e))])])]))}},[["__scopeId","data-v-a34cf1b5"]]),Uu=e=>(r.pushScopeId("data-v-40b6c5de"),e=e(),r.popScopeId(),e),B8e={class:"modal-overlay"},G8e={class:"modal-content"},Z8e=[Uu(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],H8e=Uu(()=>r.createElementVNode("div",{class:"modal-header"},[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-report-white.svg",class:"icon-title",alt:"icono reporte blanco"}),r.createElementVNode("span",{class:"modal-title"},"Generar reporte")],-1)),Y8e=Uu(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),Q8e={class:"modal-body"},$8e={key:0,class:"error-message-container"},e9e=Uu(()=>r.createElementVNode("p",{class:"error-text"},[r.createTextVNode(" Este reporte ya fue generado previamente"),r.createElementVNode("br"),r.createTextVNode(" con este template para el partido seleccionado. ")],-1)),t9e={key:1,style:{position:"relative"}},r9e={key:0,class:"loading-autoseteo-overlay"},n9e=[Uu(()=>r.createElementVNode("div",{class:"loading-autoseteo-content"},[r.createElementVNode("div",{class:"loading-spinner"})],-1))],a9e={class:"modal-group"},i9e=Uu(()=>r.createElementVNode("label",null,"1. Elige el torneo",-1)),o9e={key:0,class:"placeholder"},s9e=Uu(()=>r.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1)),l9e={key:0,class:"placeholder"},c9e={key:1},u9e=[Uu(()=>r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],d9e={key:0,class:"custom-select-dropdown"},p9e=["onMousedown"],h9e={class:"modal-row"},f9e={class:"modal-group"},m9e=Uu(()=>r.createElementVNode("label",null,"2. Elige la temporada",-1)),y9e={key:0,class:"placeholder"},g9e=Uu(()=>r.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1)),v9e={key:0,class:"placeholder"},b9e={key:1},x9e=[Uu(()=>r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],w9e={key:0,class:"custom-select-dropdown"},_9e=["onMousedown"],S9e={class:"modal-group"},T9e=Uu(()=>r.createElementVNode("label",null,"3. Elige la jornada",-1)),k9e={key:0,class:"placeholder"},N9e=Uu(()=>r.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1)),V9e={key:0,class:"placeholder"},O9e={key:1},L9e=[Uu(()=>r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],U9e={key:0,class:"custom-select-dropdown"},q9e=["onMousedown"],z9e={class:"modal-group"},C9e=Uu(()=>r.createElementVNode("label",null,"4. Elige el partido",-1)),P9e={key:0,class:"placeholder"},E9e=Uu(()=>r.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1)),F9e={key:0,class:"placeholder"},R9e=["src"],M9e=["src"],j9e=[Uu(()=>r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],W9e={key:0,class:"custom-select-dropdown"},K9e=["onMousedown"],A9e=["src"],I9e=["src"],X9e={key:0,class:"header-separator"},D9e={key:1,class:"modal-footer"},J9e=["disabled"],B9e={key:0,class:"loading-spinner select-spinner"},G9e=ml({__name:"ModalGenerarReporte",props:{userId:{type:String,required:!0},token:{type:String,required:!0},team:{type:Number,required:!0},templateId:{type:String,required:!0},templateType:{type:String,required:!1},template:{type:Object,required:!1},showError409OnMount:{type:Boolean,default:!1}},emits:["close","generar","switch-to-reports","open-configurar-contenido"],setup(e,{emit:a}){const i=e,k=a,j=r.ref([]),g=r.ref([]),m=r.ref([]),n=r.ref([]),f=r.ref(""),l=r.ref(""),t=r.ref(""),_=r.ref(null),b=es.create({headers:{Authorization:i.token}}),v=r.ref(!1),h=r.ref(!1),o=r.ref(!1),s=r.ref(!1),p=r.ref(!1),c=r.ref(!1),d=r.ref(!1),x=r.ref(!1),w=r.ref([]),S=r.ref([]),V=r.ref(!1),O=r.ref(!1),U=r.ref(!1);function z(ie){c.value&&(c.value=!1,p.value=!1),d.value=!1,f.value=ie,V.value=!1,T()}function L(ie){c.value&&(c.value=!1,p.value=!1),d.value=!1,l.value=ie,O.value=!1,E()}function C(ie){c.value&&(c.value=!1,p.value=!1),d.value=!1,t.value=ie,U.value=!1,W()}const q=r.ref(null);async function N(){try{h.value=!0;const ie=await es.get("https://kefloixzy1.execute-api.us-west-2.amazonaws.com/prod/gs3/tournaments");if(ie.data&&Array.isArray(ie.data)){if(w.value=ie.data,j.value=ie.data.map(ue=>ue.tournament).sort((ue,he)=>ue.order&&he.order?ue.order-he.order:ue.order&&!he.order?-1:!ue.order&&he.order?1:0),f.value="",g.value=[],l.value="",m.value=[],t.value="",n.value=[],_.value=null,q.value)setTimeout(()=>{Y(q.value)},100);else if(j.value.length>0){const ue=j.value[0];f.value=ue,P(ue)}}}catch(ie){console.error("Error al cargar torneos:",ie),j.value=[{name:"Concacaf Copa Oro"},{name:"Liga MX"},{name:"MLS"}],g.value=[],m.value=[],f.value="",l.value="",t.value="",_.value=null}finally{h.value=!1}}function P(ie){const ue=w.value.find(he=>he.tournament&&he.tournament.name===ie.name);ue&&Array.isArray(ue.seasons)?(g.value=ue.seasons,l.value="",m.value=[],t.value="",n.value=[],_.value=null):(g.value=[],l.value="",m.value=[],t.value="",n.value=[],_.value=null)}function T(){l.value="",t.value="",_.value=null,f.value?P(f.value):(g.value=[],m.value=[],n.value=[])}function E(){if(s.value=!0,t.value="",_.value=null,m.value=[],n.value=[],l.value&&l.value.id){const ie=[l.value.id];if(l.value.related_seasons&&Array.isArray(l.value.related_seasons)){const ue=l.value.related_seasons.map(he=>he.id).filter(Boolean);ie.push(...ue)}R(ie)}else s.value=!1}async function R(ie){o.value=!0;try{const ue=Array.isArray(ie)?ie.join("&seasons="):ie,he=await b.get(`https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?seasons=${ue}`);if(he.data.data&&Array.isArray(he.data.data)){const ae=he.data.data.reduce((xe,be)=>be.games&&Array.isArray(be.games)?xe.concat(be.games):xe,[]);S.value=ae.map(xe=>({label:xe.label||`${xe.home_team_acronym||"Local"} vs ${xe.visiting_team_acronym||"Visitante"}`,localLogo:"https://golstatsimages.blob.core.windows.net/teams-80/"+xe.home_team+".png"||"",visitanteLogo:"https://golstatsimages.blob.core.windows.net/teams-80/"+xe.visiting_team+".png"||"",...xe}));let de=S.value;i.templateType==="2"||i.templateType===2?de=de.filter(xe=>xe.game_status===1):(i.templateType==="1"||i.templateType===1)&&(de=de.filter(xe=>xe.game_status===4));const ce=de.map(xe=>xe.matchday_id).filter(Boolean),ye=[...new Set(ce)];m.value=ye.map(xe=>{const be=S.value.find(Te=>Te.matchday_id&&Te.matchday_id===xe);return be?{id:xe,name:be.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")}:null}).filter(Boolean).sort((xe,be)=>{const Te=xe.name.startsWith("Jornada"),Oe=be.name.startsWith("Jornada");return Te&&Oe?xe.id-be.id:Te&&!Oe?-1:!Te&&Oe?1:0}),t.value="",n.value=[],_.value=null,s.value=!1,q.value&&c.value&&setTimeout(()=>{$(q.value)},200)}else S.value=[],m.value=[],t.value="",n.value=[],_.value=null}catch(ue){console.error("Error al cargar partidos:",ue),S.value=[],m.value=[],t.value="",n.value=[],_.value=null,s.value=!1}finally{o.value=!1}}function W(){_.value=null,n.value=[],t.value&&t.value.id&&K(t.value)}function K(ie){if(!ie||!ie.id){n.value=[];return}let ue=S.value.filter(he=>he.matchday_id===ie.id);i.templateType==="2"||i.templateType===2?ue=ue.filter(he=>he.game_status===1):(i.templateType==="1"||i.templateType===1)&&(ue=ue.filter(he=>he.game_status===4)),n.value=ue}function X(){if(!i.template||!i.template.pages)return!1;console.log("ENTRO A QUI A REVISAR SI HAY FORTALKEZAS"),console.log(i.template);for(const ie of i.template.pages)if(ie.components&&Array.isArray(ie.components)&&ie.components.some(he=>he.name==="Fortalezas"||he.componentName==="GSCStrengths"))return!0;return!1}async function D(){try{if(X()){k("open-configurar-contenido",{liga:f.value,torneo:l.value,jornada:t.value,partido:_.value,template:i.template}),k("close");return}h.value=!0;let ie="";l.value&&l.value.name&&(ie=l.value.name);const ue={template_id:i.templateId,user_id:i.template&&i.template.user_id?parseInt(i.template.user_id):parseInt(i.userId),tournament_id:f.value.id||1,tournament_name:f.value.name,season_id:_.value.season_id,season_name:ie,game_id:_.value.id||_.value.game_id},he=await es.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${i.userId}/reports`,ue,{headers:{Authorization:i.token,"Content-Type":"application/json"}});k("generar",{liga:f.value,torneo:l.value,jornada:t.value,partido:_.value,reportData:he.data}),k("switch-to-reports"),k("close")}catch(ie){console.error("Error al generar el reporte:",ie),ie.response&&ie.response.status===409?x.value=!0:alert("Error al generar el reporte. Por favor, intenta de nuevo.")}finally{h.value=!1}}function H(){U.value=!U.value}function ne(ie){c.value&&(c.value=!1,p.value=!1),d.value=!1,_.value=ie,v.value=!1}function B(){document.body.style.overflow="hidden"}function re(){document.body.style.overflow=""}r.watch(()=>i.showError409OnMount,ie=>{x.value=ie},{immediate:!0}),r.onMounted(()=>{i.showError409OnMount&&(x.value=!0),N(),B(),ee(),q.value&&(p.value=!0,c.value=!0)}),r.watch(f,(ie,ue)=>{if(ie&&q.value&&c.value&&!ue&&!d.value){const he=g.value.find(ae=>ae.id===q.value.season_id);he&&(d.value=!0,l.value=he,d.value=!1)}}),r.watch(l,(ie,ue)=>{ie&&q.value&&c.value&&!ue&&!d.value?setTimeout(()=>{const he=m.value.find(ae=>ae.id===q.value.matchday_id);he&&(d.value=!0,t.value=he,K(he),d.value=!1)},500):ie&&ue&&c.value&&(c.value=!1,p.value=!1)}),r.watch(t,(ie,ue)=>{ie&&q.value&&c.value&&!ue&&!d.value?setTimeout(()=>{const he=n.value.find(de=>de.game_id===q.value.game_id||de.id===q.value.game_id);if(K(ie),he){_.value=he,p.value=!1,c.value=!1;return}const ae=n.value.find(de=>de.home_team===q.value.home_team&&de.visiting_team===q.value.visiting_team);if(ae){_.value=ae,p.value=!1,c.value=!1;return}if(S.value.length>0){const de=S.value.find(ce=>ce.game_id===q.value.game_id||ce.id===q.value.game_id);if(de){_.value=de,p.value=!1,c.value=!1;return}}p.value=!1,c.value=!1},1e3):ie&&ue&&c.value&&(c.value=!1,p.value=!1)}),r.onUnmounted(()=>{re()});async function ee(){try{const ie=await b.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/teams/${i.team}/last-games`);i.templateType==="1"||i.templateType===1?(q.value=ie.data.data.prematch,ie.data.data.prematch&&(p.value=!0,c.value=!0,ie.data.data.prematch.season_id&&await R([ie.data.data.prematch.season_id]))):(i.templateType==="2"||i.templateType===2)&&(q.value=ie.data.data.postmatch,ie.data.data.postmatch&&(p.value=!0,c.value=!0,ie.data.data.postmatch.season_id&&await R([ie.data.data.postmatch.season_id])))}catch(ie){console.error("Error al cargar últimos juegos:",ie)}}function Y(ie){if(!(!ie||!ie.game_id)&&ie.tournament_id&&j.value.length>0){const ue=j.value.find(he=>he.id===ie.tournament_id);ue&&(f.value=ue,P(ue))}}function $(ie){if(!(!ie||!ie.game_id)&&ie.tournament_id&&j.value.length>0){const ue=j.value.find(he=>he.id===ie.tournament_id);if(ue&&(f.value=ue,ie.season_id&&g.value.length>0)){const he=g.value.find(ae=>ae.id===ie.season_id);if(he&&(l.value=he,ie.matchday_id&&m.value.length>0)){const ae=m.value.find(de=>de.id===ie.matchday_id);if(ae&&(t.value=ae,ie.game_id&&n.value.length>0)){const de=n.value.find(ce=>ce.game_id===ie.game_id||ce.id===ie.game_id);if(de)_.value=de;else{const ce=n.value.find(ye=>ye.home_team===ie.home_team&&ye.visiting_team===ie.visiting_team);ce&&(_.value=ce)}}}}}}function le(){x.value=!1,f.value="",l.value="",t.value="",_.value=null,g.value=[],m.value=[],n.value=[],V.value=!1,O.value=!1,U.value=!1,v.value=!1,re(),k("close")}return(ie,ue)=>(r.openBlock(),r.createElementBlock("div",B8e,[r.createElementVNode("div",G8e,[r.createElementVNode("button",{class:"close-btn",onClick:le},Z8e),H8e,Y8e,r.createElementVNode("div",Q8e,[x.value?(r.openBlock(),r.createElementBlock("div",$8e,[e9e,r.createElementVNode("button",{class:"accept-btn",onClick:le},"Aceptar")])):(r.openBlock(),r.createElementBlock("div",t9e,[p.value?(r.openBlock(),r.createElementBlock("div",r9e,n9e)):r.createCommentVNode("",!0),r.createElementVNode("div",a9e,[i9e,r.createElementVNode("div",{class:"select-wrapper custom-dropdown liga-select",tabindex:"0",onClick:ue[0]||(ue[0]=he=>V.value=!V.value),onBlur:ue[1]||(ue[1]=he=>V.value=!1)},[r.createElementVNode("div",{class:r.normalizeClass(["custom-select-display",{disabled:h.value||j.value.length===0}])},[h.value?(r.openBlock(),r.createElementBlock("span",o9e,[s9e,r.createTextVNode("Cargando torneos...")])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[f.value?(r.openBlock(),r.createElementBlock("span",c9e,r.toDisplayString(f.value.name),1)):(r.openBlock(),r.createElementBlock("span",l9e,"Selecciona el torneo"))],64)),r.createElementVNode("span",{class:r.normalizeClass(["select-chevron",{open:V.value}])},u9e,2)],2),V.value&&j.value.length>0?(r.openBlock(),r.createElementBlock("div",d9e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,he=>(r.openBlock(),r.createElementBlock("div",{key:he.name,class:"custom-select-option",onMousedown:r.withModifiers(ae=>z(he),["prevent"])},r.toDisplayString(he.name),41,p9e))),128))])):r.createCommentVNode("",!0)],32)]),r.createElementVNode("div",h9e,[r.createElementVNode("div",f9e,[m9e,r.createElementVNode("div",{class:"select-wrapper custom-dropdown torneo-select",tabindex:"0",onClick:ue[2]||(ue[2]=he=>O.value=!O.value),onBlur:ue[3]||(ue[3]=he=>O.value=!1)},[r.createElementVNode("div",{class:r.normalizeClass(["custom-select-display",{disabled:!f.value||g.value.length===0||h.value}])},[h.value?(r.openBlock(),r.createElementBlock("span",y9e,[g9e,r.createTextVNode("Cargando temporada...")])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[l.value?(r.openBlock(),r.createElementBlock("span",b9e,r.toDisplayString(l.value.name),1)):(r.openBlock(),r.createElementBlock("span",v9e,"Elige la temporada"))],64)),r.createElementVNode("span",{class:r.normalizeClass(["select-chevron",{open:O.value}])},x9e,2)],2),O.value&&g.value.length>0&&f.value?(r.openBlock(),r.createElementBlock("div",w9e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g.value,he=>(r.openBlock(),r.createElementBlock("div",{key:he.id,class:"custom-select-option",onMousedown:r.withModifiers(ae=>L(he),["prevent"])},r.toDisplayString(he.name),41,_9e))),128))])):r.createCommentVNode("",!0)],32)]),r.createElementVNode("div",S9e,[T9e,r.createElementVNode("div",{class:"select-wrapper custom-dropdown jornada-select",tabindex:"0",onClick:H,onBlur:ue[4]||(ue[4]=he=>U.value=!1)},[r.createElementVNode("div",{class:r.normalizeClass(["custom-select-display",{disabled:!l.value||m.value.length===0||s.value}])},[s.value?(r.openBlock(),r.createElementBlock("span",k9e,[N9e,r.createTextVNode("Cargando jornadas...")])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[t.value?(r.openBlock(),r.createElementBlock("span",O9e,r.toDisplayString(t.value.name),1)):(r.openBlock(),r.createElementBlock("span",V9e,"Elige la jornada"))],64)),r.createElementVNode("span",{class:r.normalizeClass(["select-chevron",{open:U.value}])},L9e,2)],2),U.value&&m.value.length>0?(r.openBlock(),r.createElementBlock("div",U9e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.value,he=>(r.openBlock(),r.createElementBlock("div",{key:he.id,class:"custom-select-option",onMousedown:r.withModifiers(ae=>C(he),["prevent"])},r.toDisplayString(he.name),41,q9e))),128))])):r.createCommentVNode("",!0)],32)])]),r.createElementVNode("div",z9e,[C9e,r.createElementVNode("div",{class:"select-wrapper partido-select",tabindex:"0",onClick:ue[5]||(ue[5]=he=>v.value=!v.value),onBlur:ue[6]||(ue[6]=he=>v.value=!1)},[r.createElementVNode("div",{class:r.normalizeClass(["custom-select-display",{disabled:!t.value||o.value}])},[o.value?(r.openBlock(),r.createElementBlock("span",P9e,[E9e,r.createTextVNode("Cargando partidos...")])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[_.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[_.value.localLogo?(r.openBlock(),r.createElementBlock("img",{key:0,src:_.value.localLogo,class:"logo-equipo",alt:"local"},null,8,R9e)):r.createCommentVNode("",!0),r.createElementVNode("span",null,r.toDisplayString(_.value.label),1),_.value.visitanteLogo?(r.openBlock(),r.createElementBlock("img",{key:1,src:_.value.visitanteLogo,class:"logo-equipo",alt:"visitante"},null,8,M9e)):r.createCommentVNode("",!0)],64)):(r.openBlock(),r.createElementBlock("span",F9e,"Selecciona el partido"))],64)),r.createElementVNode("span",{class:r.normalizeClass(["select-chevron",{open:v.value}])},j9e,2)],2),v.value&&!o.value&&t.value?(r.openBlock(),r.createElementBlock("div",W9e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.value,he=>(r.openBlock(),r.createElementBlock("div",{key:he.label,class:"custom-select-option",onMousedown:r.withModifiers(ae=>ne(he),["prevent"])},[r.createElementVNode("img",{src:he.localLogo,class:"logo-equipo",alt:"local"},null,8,A9e),r.createElementVNode("span",null,r.toDisplayString(he.label),1),r.createElementVNode("img",{src:he.visitanteLogo,class:"logo-equipo",alt:"visitante"},null,8,I9e)],40,K9e))),128))])):r.createCommentVNode("",!0)],32)])]))]),x.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",X9e)),x.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",D9e,[r.createElementVNode("button",{class:"cancel-btn",onClick:le},"Cancelar"),r.createElementVNode("button",{class:"next-btn",disabled:!f.value||!l.value||!t.value||!_.value||h.value,onClick:D},[h.value?(r.openBlock(),r.createElementBlock("span",B9e)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(h.value?"Generando...":"Generar"),1)],8,J9e)]))])]))}},[["__scopeId","data-v-40b6c5de"]]),H1=e=>(r.pushScopeId("data-v-3f4f9ca5"),e=e(),r.popScopeId(),e),Z9e={class:"modal-overlay"},H9e={class:"modal-content"},Y9e=[H1(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],Q9e=H1(()=>r.createElementVNode("div",{class:"modal-header"},[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename-white.svg",class:"icon-title",alt:"icon"}),r.createElementVNode("span",{class:"modal-title"},"Renombrar Template")],-1)),$9e=H1(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),eNe={class:"modal-body"},tNe=H1(()=>r.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),rNe=["placeholder","disabled"],nNe={key:0,class:"error-message"},aNe=H1(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),iNe={class:"modal-footer"},oNe=["disabled"],sNe=["disabled"],lNe={key:0},cNe={key:1},uNe=ml({__name:"ModalRenameTemplate",props:{initialName:{type:String,required:!0},templateType:{type:String,required:!0},token:{type:String,required:!0},userId:{type:String,required:!0},templateId:{type:String,required:!0}},emits:["close","rename","refresh"],setup(e,{emit:a}){const i=e,k=a,j=r.ref(i.initialName),g=r.ref(!1),m=r.ref("");r.watch(()=>i.initialName,f=>{j.value=f,m.value=""}),r.onMounted(()=>{document.body.style.overflow="hidden"}),r.onUnmounted(()=>{document.body.style.overflow=""});async function n(){var f;if(!(j.value.trim().length<3)){g.value=!0,m.value="";try{await es.put(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${i.userId}/templates/${i.templateId}/general`,{name:j.value.trim()},{headers:{Authorization:`${i.token}`,"Content-Type":"application/json"}}),k("rename",j.value.trim()),k("refresh"),k("close")}catch(l){console.error("Error al renombrar el template:",l),((f=l.response)==null?void 0:f.status)===409?m.value="Ya existe un template con el mismo nombre":m.value="Error al renombrar el template. Inténtalo de nuevo."}finally{g.value=!1}}}return(f,l)=>(r.openBlock(),r.createElementBlock("div",Z9e,[r.createElementVNode("div",H9e,[r.createElementVNode("button",{class:"close-btn",onClick:l[0]||(l[0]=t=>f.$emit("close"))},Y9e),Q9e,$9e,r.createElementVNode("div",eNe,[tNe,r.withDirectives(r.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":l[1]||(l[1]=t=>j.value=t),placeholder:e.initialName,maxlength:"40",autocomplete:"off",disabled:g.value},null,8,rNe),[[r.vModelText,j.value]]),m.value?(r.openBlock(),r.createElementBlock("div",nNe,r.toDisplayString(m.value),1)):r.createCommentVNode("",!0)]),aNe,r.createElementVNode("div",iNe,[r.createElementVNode("button",{class:"cancel-btn",onClick:l[2]||(l[2]=t=>f.$emit("close")),disabled:g.value},"Cancelar",8,oNe),r.createElementVNode("button",{class:"next-btn",disabled:j.value.trim().length<3||g.value,onClick:n},[g.value?(r.openBlock(),r.createElementBlock("span",lNe,"Guardando...")):(r.openBlock(),r.createElementBlock("span",cNe,"Guardar"))],8,sNe)])])]))}},[["__scopeId","data-v-3f4f9ca5"]]),Y1=e=>(r.pushScopeId("data-v-98cd9dcd"),e=e(),r.popScopeId(),e),dNe={class:"modal-overlay"},pNe={class:"modal-content"},hNe=[Y1(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],fNe=Y1(()=>r.createElementVNode("div",{class:"modal-header"},[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-duplicate-white.svg",class:"icon-title",alt:"icon"}),r.createElementVNode("span",{class:"modal-title"},"Duplicar template")],-1)),mNe=Y1(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),yNe={class:"modal-body"},gNe=Y1(()=>r.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),vNe=["placeholder"],bNe=Y1(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),xNe={class:"modal-footer"},wNe=["disabled"],_Ne=ml({__name:"ModalduplicateTemplate",props:{initialName:{type:String,required:!0},token:{type:String,required:!0},templateId:{type:String,required:!0}},emits:["close","duplicate","template-duplicated"],setup(e,{emit:a}){const i=e,k=a,j=r.ref(i.initialName+" copy"),g=r.ref(!1);r.watch(()=>i.initialName,n=>{j.value=n+" copy"}),r.onMounted(()=>{document.body.style.overflow="hidden"}),r.onUnmounted(()=>{document.body.style.overflow=""});async function m(){if(j.value.trim().length>=3&&!g.value){g.value=!0;try{const n=await es.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates/${i.templateId}/duplicate`,{name:j.value.trim()},{headers:{Authorization:`${i.token}`,"Content-Type":"application/json"}});k("template-duplicated",{originalTemplateId:i.templateId,newTemplateName:j.value.trim(),responseData:n.data}),k("close")}catch(n){console.error("Error al duplicar template:",n),alert("Error al duplicar el template. Por favor, intenta de nuevo.")}finally{g.value=!1}}}return(n,f)=>(r.openBlock(),r.createElementBlock("div",dNe,[r.createElementVNode("div",pNe,[r.createElementVNode("button",{class:"close-btn",onClick:f[0]||(f[0]=l=>n.$emit("close"))},hNe),fNe,mNe,r.createElementVNode("div",yNe,[gNe,r.withDirectives(r.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":f[1]||(f[1]=l=>j.value=l),placeholder:e.initialName,maxlength:"40",autocomplete:"off"},null,8,vNe),[[r.vModelText,j.value]])]),bNe,r.createElementVNode("div",xNe,[r.createElementVNode("button",{class:"cancel-btn",onClick:f[2]||(f[2]=l=>n.$emit("close"))},"Cancelar"),r.createElementVNode("button",{class:"next-btn",disabled:j.value.trim().length<3||g.value,onClick:m},r.toDisplayString(g.value?"Duplicando...":"Aceptar"),9,wNe)])])]))}},[["__scopeId","data-v-98cd9dcd"]]),SNe=e=>(r.pushScopeId("data-v-65422842"),e=e(),r.popScopeId(),e),TNe={class:"modal-overlay"},kNe={class:"modal-content"},NNe=[SNe(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],VNe=r.createStaticVNode('<div class="modal-header" data-v-65422842><img src="https://golstatsimages.blob.core.windows.net/reports-images/icn-delete-delete.svg" class="icon-title" alt="icon" data-v-65422842><span class="modal-title" data-v-65422842>Eliminar template</span></div><div class="header-separator" data-v-65422842></div><div class="modal-body confirm-text" data-v-65422842> ¿Estás seguro que deseas eliminar<br data-v-65422842> este template? Si lo haces no habrá manera<br data-v-65422842> de recuperarlo. </div><div class="header-separator" data-v-65422842></div>',4),ONe={class:"modal-footer"},LNe=["disabled"],UNe=ml({__name:"ModalDeleteTemplate",props:{templateId:{type:String,required:!0},userId:{type:String,required:!0},token:{type:String,required:!0}},emits:["close","delete","templateDeleted"],setup(e,{emit:a}){const i=e,k=a,j=r.ref(!1);r.onMounted(()=>{document.body.style.overflow="hidden"}),r.onUnmounted(()=>{document.body.style.overflow=""});const g=async()=>{try{j.value=!0;const n=await es.create({headers:{Authorization:`${i.token}`}}).delete(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${i.userId}/templates/${i.templateId}`);(n.status===200||n.status===204)&&(k("templateDeleted",i.templateId),k("close"))}catch(m){console.error("Error al eliminar template:",m),alert("Error al eliminar el template. Por favor, inténtalo de nuevo.")}finally{j.value=!1}};return(m,n)=>(r.openBlock(),r.createElementBlock("div",TNe,[r.createElementVNode("div",kNe,[r.createElementVNode("button",{class:"close-btn",onClick:n[0]||(n[0]=f=>m.$emit("close"))},NNe),VNe,r.createElementVNode("div",ONe,[r.createElementVNode("button",{class:"cancel-btn",onClick:n[1]||(n[1]=f=>m.$emit("close"))},"Cancelar"),r.createElementVNode("button",{class:"delete-btn",onClick:g,disabled:j.value},r.toDisplayString(j.value?"Eliminando...":"Eliminar"),9,LNe)])])]))}},[["__scopeId","data-v-65422842"]]),q2=e=>(r.pushScopeId("data-v-11f42e0a"),e=e(),r.popScopeId(),e),qNe={class:"fortalezas-view"},zNe={class:"fortalezas-header"},CNe={class:"team-logo-container"},PNe=["src","alt"],ENe={class:"header-content"},FNe={class:"fortalezas-title"},RNe={class:"fortalezas-description"},MNe={class:"fortalezas-container"},jNe={class:"categorias-tabs segmented"},WNe=["onClick"],KNe={class:"fortalezas-list"},ANe={key:0,class:"loading-state"},INe=[q2(()=>r.createElementVNode("div",{class:"loading-spinner"},null,-1)),q2(()=>r.createElementVNode("p",{class:"loading-text"},"Cargando fortalezas...",-1))],XNe={key:1,class:"error-state"},DNe={class:"error-text"},JNe=["onClick"],BNe=["onClick"],GNe=["checked","disabled","onClick"],ZNe={key:0,class:"selection-number"},HNe={class:"fortaleza-badge"},YNe={class:"fortaleza-content"},QNe={class:"fortaleza-name"},$Ne={class:"fortaleza-ranking"},eVe=q2(()=>r.createElementVNode("div",{class:"separator"},null,-1)),tVe={class:"category-indicator"},rVe={class:"fortalezas-footer"},nVe={key:0,class:"counter-section"},aVe={class:"counter-text"},iVe={key:1,class:"carousel-section"},oVe={class:"footer-badge"},sVe={class:"footer-content"},lVe={class:"footer-name"},cVe={class:"footer-ranking"},uVe=q2(()=>r.createElementVNode("div",{class:"footer-separator"},null,-1)),dVe={class:"footer-category-indicator"},pVe=["onClick"],hVe={key:2,class:"empty-message-full"},fVe={class:"empty-text"},LV=ml({__name:"FortalezasView",props:{teamInitials:{type:String,default:"CA"},title:{type:String,default:"Fortalezas a favor de mi equipo"},modelValue:{type:Array,default:()=>[]},teamLogoUrl:{type:String,required:!1,default:null},seasonId:{type:[String,Number],required:!0},teamId:{type:[String,Number],required:!0},token:{type:String,required:!0},totalFortalezas:{type:Number,default:15},rivalTeamId:{type:[String,Number],required:!1,default:null},gameId:{type:[String,Number],required:!1,default:null},templateType:{type:[String,Number],required:!1,default:1}},emits:["update:modelValue"],setup(e,{expose:a,emit:i}){const k=e,j=i,g=r.computed(()=>k.teamLogoUrl?k.teamLogoUrl:k.teamId?`https://golstatsimages.blob.core.windows.net/teams-80/${k.teamId}.png`:"https://golstatsimages.blob.core.windows.net/teams-80/2.png"),m=r.ref([...k.modelValue]),n=r.reactive({}),f=r.ref(!1),l=r.ref(null);r.watch(()=>k.modelValue,D=>{if(Array.isArray(D)){const H=JSON.stringify([...m.value].sort()),ne=JSON.stringify([...D].sort());H!==ne&&(m.value=[...D],Object.keys(n).forEach(B=>delete n[B]),m.value.forEach((B,re)=>{n[B]=re+1}))}},{immediate:!0,deep:!0});const t=r.ref(0),_=r.ref(null),b=r.ref(null),v=r.ref(0),h=r.ref(0);function o(){const D=_.value,H=b.value;v.value=D?D.clientWidth:0,h.value=H?H.scrollWidth:0}const s=r.computed(()=>Math.max(0,h.value-v.value)),p=r.computed(()=>t.value>0),c=r.computed(()=>t.value<s.value);function d(){const D=Math.min(s.value,t.value+200);t.value=D}function x(){const D=Math.max(0,t.value-200);t.value=D}let w=null;r.onMounted(()=>{o();const D=()=>o();window.addEventListener("resize",D),w=D,console.log("FetchFortalezas"),z()}),r.onBeforeUnmount(()=>{w&&(window.removeEventListener("resize",w),w=null)}),r.watch(()=>m.value.slice(),async()=>{await r.nextTick(),o()},{deep:!0}),r.watch(()=>[k.seasonId,k.teamId,k.gameId,k.token,k.templateType],()=>{z()},{immediate:!1});const S=r.computed(()=>m.value.map(D=>O.value.find(H=>H.id===D)).filter(Boolean).sort((D,H)=>n[D.id]-n[H.id])),V=r.computed(()=>({transform:`translateX(-${t.value}px)`})),O=r.ref([]),U=r.ref([]);async function z(){if(!k.seasonId||!k.teamId){console.warn("seasonId y teamId son requeridos para obtener las fortalezas");return}f.value=!0,l.value=null;try{let D;k.templateType===2?D=`https://5c9xc3gwh2.execute-api.us-east-2.amazonaws.com/prod/strengths/seasons/${k.seasonId}/postgames/${k.gameId}/teams/${k.teamId}`:D=`https://5c9xc3gwh2.execute-api.us-east-2.amazonaws.com/prod/strengths/seasons/${k.seasonId}/pregames/${k.gameId}/teams/${k.teamId}`;const H=await fetch(D,{method:"GET",headers:{Authorization:`${k.token}`,"Content-Type":"application/json"}});if(!H.ok)throw new Error(`Error al obtener fortalezas: ${H.status} ${H.statusText}`);const ne=await H.json();console.log("data: ",ne),console.log("nUEVO NUEVO dataaaaaa: ----------->",ne),U.value=ne.strengths||[],console.log("nUEVO NUEVO dataaaaaa:5555555555 ----------->",ne.strengths),O.value=ne.strengths.map(B=>({id:B.categories,name:B.name,value:B.total,category:B.category_type==1?"Ofensiva":B.category_type==2?"Defensiva":"Posesion",ranking:`#${B.league_ranking} en la liga`,color:L(B.category_type||"General")})),N()}catch(D){console.error("Error al cargar fortalezas:",D),l.value=D.message,O.value=[]}finally{f.value=!1}}function L(D){return{1:"#4CAF50",3:"#2196F3",2:"#00BCD4",General:"#9C27B0"}[D]||"#9C27B0"}const C=r.ref(["Todos"]),q=r.ref("Todos");function N(){const D=[...new Set(O.value.map(H=>H.category))];C.value=["Todos",...D]}const P=r.computed(()=>q.value==="Todos"?O.value:O.value.filter(D=>D.category===q.value));function T(D){const H=m.value.indexOf(D);if(H>-1)m.value.splice(H,1),delete n[D];else{if(m.value.length>=k.totalFortalezas)return;const ne=O.value.length,B=new Set(Object.values(n));let re=1;for(;B.has(re)&&re<=ne;)re++;n[D]=re,m.value.push(D)}j("update:modelValue",m.value)}function E(D){q.value=D}function R(D){const H=m.value.indexOf(D);H>-1&&(m.value.splice(H,1),delete n[D],j("update:modelValue",m.value))}function W(){const D=O.value.length,H=new Set(m.value),ne=new Set(Object.values(n)),B=[];for(let Y=1;Y<=D;Y++)ne.has(Y)||B.push(Y);B.sort((Y,$)=>Y-$);const re=P.value.map(Y=>Y.id).filter(Y=>!H.has(Y)),ee=k.totalFortalezas;for(const Y of re){if(m.value.length>=ee)break;const $=B.shift();if($===void 0)break;n[Y]=$,m.value.push(Y)}j("update:modelValue",m.value)}function K(){console.warn("Error loading team logo, falling back to initials")}function X(){console.warn("Error loading league logo")}return a({fortalezasData:O,fortalezasRawData:U,selectedFortalezas:m,selectionOrderMap:n,autocompletar:W}),(D,H)=>(r.openBlock(),r.createElementBlock("div",qNe,[r.createElementVNode("div",zNe,[r.createElementVNode("div",CNe,[r.createElementVNode("img",{src:g.value,alt:`Logo ${e.teamInitials}`,class:"team-logo",onError:K},null,40,PNe)]),r.createElementVNode("div",ENe,[r.createElementVNode("h3",FNe,r.toDisplayString(e.title),1),r.createElementVNode("p",RNe," Este template contiene "+r.toDisplayString(e.totalFortalezas)+" visualizaciones de Fortalezas. Selecciona las deseadas. ",1)])]),r.createElementVNode("div",MNe,[r.createElementVNode("div",jNe,[r.createElementVNode("div",{class:"segmented-highlight",style:r.normalizeStyle({width:`calc(100% / ${C.value.length})`,left:`calc(${C.value.indexOf(q.value)} * (100% / ${C.value.length}))`})},null,4),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C.value,ne=>(r.openBlock(),r.createElementBlock("button",{key:ne,class:r.normalizeClass(["categoria-tab",{active:q.value===ne}]),onClick:B=>E(ne)},r.toDisplayString(ne),11,WNe))),128))]),r.createElementVNode("div",KNe,[f.value?(r.openBlock(),r.createElementBlock("div",ANe,INe)):l.value?(r.openBlock(),r.createElementBlock("div",XNe,[r.createElementVNode("p",DNe,"Error al cargar las fortalezas: "+r.toDisplayString(l.value),1),r.createElementVNode("button",{onClick:z,class:"retry-button"},"Reintentar")])):(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:2},r.renderList(P.value,ne=>(r.openBlock(),r.createElementBlock("div",{key:ne.id,class:r.normalizeClass(["fortaleza-item",{selected:m.value.includes(ne.id),disabled:!m.value.includes(ne.id)&&m.value.length>=e.totalFortalezas}]),onClick:B=>T(ne.id)},[r.createElementVNode("div",{class:"fortaleza-checkbox",onClick:r.withModifiers(B=>!m.value.includes(ne.id)&&m.value.length>=e.totalFortalezas?null:T(ne.id),["stop"])},[r.createElementVNode("input",{type:"checkbox",checked:m.value.includes(ne.id),disabled:!m.value.includes(ne.id)&&m.value.length>=e.totalFortalezas,class:"checkbox-input",onClick:r.withModifiers(B=>!m.value.includes(ne.id)&&m.value.length>=e.totalFortalezas?null:T(ne.id),["stop"])},null,8,GNe),m.value.includes(ne.id)?(r.openBlock(),r.createElementBlock("span",ZNe,r.toDisplayString(n[ne.id]),1)):r.createCommentVNode("",!0)],8,BNe),r.createElementVNode("div",HNe,r.toDisplayString(ne.value),1),r.createElementVNode("div",YNe,[r.createElementVNode("div",QNe,r.toDisplayString(ne.name),1),r.createElementVNode("div",$Ne,[r.createElementVNode("span",null,r.toDisplayString(ne.ranking),1),r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/golstats2-tournaments/1.png",alt:"Liga",class:"league-logo",onError:X},null,32),eVe,r.createElementVNode("div",tVe,[r.createElementVNode("div",{class:"category-dot",style:r.normalizeStyle({backgroundColor:ne.color})},null,4),r.createElementVNode("span",null,r.toDisplayString(ne.category),1)])])])],10,JNe))),128))])]),r.createElementVNode("div",rVe,[m.value.length>0?(r.openBlock(),r.createElementBlock("div",nVe,[r.createElementVNode("div",aVe,r.toDisplayString(m.value.length)+"/"+r.toDisplayString(e.totalFortalezas),1)])):r.createCommentVNode("",!0),m.value.length>0?(r.openBlock(),r.createElementBlock("div",iVe,[r.createElementVNode("div",{class:"carousel-container",ref_key:"carouselContainerRef",ref:_},[p.value?(r.openBlock(),r.createElementBlock("button",{key:0,class:"carousel-arrow left",onClick:x},"‹")):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"carousel-track",ref_key:"carouselTrackRef",ref:b,style:r.normalizeStyle(V.value)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.value,ne=>(r.openBlock(),r.createElementBlock("div",{key:ne.id,class:"footer-pill"},[r.createElementVNode("div",oVe,r.toDisplayString(ne.value),1),r.createElementVNode("div",sVe,[r.createElementVNode("div",lVe,r.toDisplayString(ne.name),1),r.createElementVNode("div",cVe,[r.createElementVNode("span",null,r.toDisplayString(ne.ranking),1),r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/golstats2-tournaments/1.png",alt:"Liga",class:"footer-league-logo",onError:X},null,32),uVe,r.createElementVNode("div",dVe,[r.createElementVNode("div",{class:"footer-category-dot",style:r.normalizeStyle({backgroundColor:ne.color})},null,4),r.createElementVNode("span",null,r.toDisplayString(ne.category),1)])])]),r.createElementVNode("button",{class:"pill-remove-btn",onClick:B=>R(ne.id)},"×",8,pVe)]))),128))],4),c.value?(r.openBlock(),r.createElementBlock("button",{key:1,class:"carousel-arrow right",onClick:d},"›")):r.createCommentVNode("",!0)],512)])):(r.openBlock(),r.createElementBlock("div",hVe,[r.createElementVNode("span",fVe,r.toDisplayString(m.value.length)+" de "+r.toDisplayString(e.totalFortalezas)+" Fortalezas agregadas",1)]))])]))}},[["__scopeId","data-v-11f42e0a"]]),Q1=e=>(r.pushScopeId("data-v-a856f73c"),e=e(),r.popScopeId(),e),mVe={class:"corners-view"},yVe={class:"corners-header"},gVe={class:"team-logo-container"},vVe=["src","alt"],bVe={class:"header-content"},xVe={class:"corners-title"},wVe=Q1(()=>r.createElementVNode("p",{class:"corners-description"}," Este template contiene 10 visualizaciones de tiros de esquina. Selecciona los deseados. ",-1)),_Ve={class:"corners-container"},SVe={class:"matches-header"},TVe={class:"team-logos"},kVe={class:"logo"},NVe={class:"score"},VVe={class:"logo alt"},OVe={class:"meta"},LVe={class:"categorias-tabs segmented"},UVe=["onClick"],qVe={class:"corners-list"},zVe=["onClick"],CVe={class:"check-col"},PVe=["onClick"],EVe=["checked","disabled","onClick"],FVe={key:0,class:"selection-number"},RVe={class:"badge-col"},MVe={class:"count-badge"},jVe={class:"content-col"},WVe={class:"title-row"},KVe={class:"time"},AVe={class:"title"},IVe={class:"player"},XVe={class:"meta-row"},DVe=Q1(()=>r.createElementVNode("span",null,"Comba hacia afuera",-1)),JVe=Q1(()=>r.createElementVNode("span",{class:"dot"},null,-1)),BVe=Q1(()=>r.createElementVNode("div",{class:"separator"},null,-1)),GVe={class:"category-indicator"},ZVe={class:"corners-footer"},HVe={key:0,class:"counter-section"},YVe={class:"counter-text"},QVe={key:1,class:"carousel-section"},$Ve={class:"footer-badge"},eOe={class:"footer-content"},tOe={class:"footer-name"},rOe={class:"footer-ranking"},nOe=Q1(()=>r.createElementVNode("div",{class:"footer-separator"},null,-1)),aOe={class:"footer-category-indicator"},iOe=["onClick"],oOe={key:2,class:"empty-message-full"},sOe={class:"empty-text"},W5=148,UV=ml({__name:"TirosEsquinaView",props:{modelValue:{type:Array,default:()=>[]},rival:{type:Boolean,default:!1},teamInitials:{type:String,default:"AME"},title:{type:String,default:"Tiros de esquina en contra de mi equipo"},teamLogoUrl:{type:String,default:"https://golstatsimages.blob.core.windows.net/teams-80/2.png"}},emits:["update:modelValue"],setup(e,{expose:a,emit:i}){const k=e,j=i,g=["Todos","Ofensiva","Defensiva"],m=r.ref("Todos"),n=r.ref([...k.modelValue]),f=r.reactive({});n.value.forEach((ie,ue)=>{f[ie]=ue+1});const l=r.ref(0),t=r.ref(null),_=r.ref(null),b=r.ref(0),v=r.ref(0);function h(){const ie=t.value,ue=_.value;b.value=ie?ie.clientWidth:0,v.value=ue?ue.scrollWidth:0}const o=r.computed(()=>Math.max(0,v.value-b.value)),s=r.computed(()=>l.value>0),p=r.computed(()=>l.value<o.value);function c(){const ie=Math.min(o.value,l.value+200);l.value=ie}function d(){const ie=Math.max(0,l.value-200);l.value=ie}const x=r.computed(()=>n.value.map(ie=>H.value.find(ue=>ue.id===ie)).filter(Boolean).sort((ie,ue)=>f[ie.id]-f[ue.id])),w=r.computed(()=>({transform:`translateX(-${l.value}px)`})),S=r.ref([{id:1,home:"AME",away:"PUM",score:"4 - 1",jornada:"J11"},{id:2,home:"ASL",away:"AME",score:"0 - 1",jornada:"J10"},{id:3,home:"MTY",away:"AME",score:"2 - 0",jornada:"J9"},{id:4,home:"CAZ",away:"AME",score:"1 - 1",jornada:"J8"},{id:5,home:"AME",away:"LEO",score:"3 - 2",jornada:"J7"}]),V=r.ref(0),O=r.ref(null),U=r.ref(1),z=r.computed(()=>Math.max(0,S.value.length-U.value)),L=r.computed(()=>V.value>0),C=r.computed(()=>V.value<z.value),q=r.ref(!1),N=r.ref(0),P=r.ref(0);function T(){const ie=O.value,ue=ie?ie.clientWidth:0,he=Math.max(1,Math.floor(ue/(W5+10)));U.value=he}const E=r.computed(()=>{const ie=-V.value*(W5+10),ue=q.value?P.value:0;return{transform:`translateX(${ie+ue}px)`}});function R(){V.value=Math.min(z.value,V.value+1)}function W(){V.value=Math.max(0,V.value-1)}function K(ie){q.value=!0,N.value=ie.clientX,P.value=0}function X(ie){q.value&&(P.value=ie.clientX-N.value)}function D(){if(!q.value)return;const ie=W5/3;P.value<=-ie?R():P.value>=ie&&W(),q.value=!1,P.value=0}const H=r.ref([{id:1,order:"2/7",minute:"12:31",title:"Tiro de esquina",player:"Pedro Vite",wasGoal:!0,category:"Ofensiva",color:"#4CAF50"},{id:2,order:"4/7",minute:"33:41",title:"Tiro de esquina",player:"Pedro Vite",wasGoal:!1,category:"Defensiva",color:"#F44336"},{id:3,order:"6/7",minute:"62:21",title:"Tiro de esquina",player:"Pedro Vite",wasGoal:!1,category:"Ofensiva",color:"#4CAF50",disabled:!0}]),ne=r.computed(()=>m.value==="Todos"?H.value:H.value.filter(ie=>ie.category===m.value));function B(ie){const ue=H.value.find(ae=>ae.id===ie);if(ue!=null&&ue.disabled)return;const he=n.value.indexOf(ie);if(he>-1)n.value.splice(he,1),delete f[ie];else{const ae=H.value.length,de=new Set(Object.values(f));let ce=1;for(;de.has(ce)&&ce<=ae;)ce++;f[ie]=ce,n.value.push(ie)}j("update:modelValue",n.value)}function re(){const ie=H.value.length,ue=new Set(n.value),he=new Set(Object.values(f)),ae=[];for(let ce=1;ce<=ie;ce++)he.has(ce)||ae.push(ce);ae.sort((ce,ye)=>ce-ye);const de=ne.value.map(ce=>ce.id).filter(ce=>!ue.has(ce));for(const ce of de){const ye=ae.shift();if(ye===void 0)break;f[ce]=ye,n.value.push(ce)}j("update:modelValue",n.value)}function ee(ie){const ue=n.value.indexOf(ie);ue>-1&&(n.value.splice(ue,1),delete f[ie],j("update:modelValue",n.value))}function Y(){console.warn("Error loading team logo, falling back to initials")}let $=null;r.onMounted(()=>{h();const ie=()=>h();window.addEventListener("resize",ie),$=ie}),r.onBeforeUnmount(()=>{$&&(window.removeEventListener("resize",$),$=null)}),r.watch(()=>n.value.slice(),async()=>{await r.nextTick(),h()},{deep:!0});let le=null;return r.onMounted(()=>{T();const ie=()=>T();window.addEventListener("resize",ie),le=ie}),r.onBeforeUnmount(()=>{le&&(window.removeEventListener("resize",le),le=null)}),a({autocompletar:re}),(ie,ue)=>(r.openBlock(),r.createElementBlock("div",mVe,[r.createElementVNode("div",yVe,[r.createElementVNode("div",gVe,[r.createElementVNode("img",{src:e.teamLogoUrl,alt:`Logo ${e.teamInitials}`,class:"team-logo",onError:Y},null,40,vVe)]),r.createElementVNode("div",bVe,[r.createElementVNode("h3",xVe,r.toDisplayString(e.title),1),wVe])]),r.createElementVNode("div",_Ve,[r.createElementVNode("div",SVe,[r.createElementVNode("div",{class:"window",ref_key:"matchesWindowRef",ref:O,onPointerdown:K,onPointerup:D,onPointercancel:D,onPointerleave:D,onPointermove:X},[L.value?(r.openBlock(),r.createElementBlock("button",{key:0,class:"carousel-arrow left",onClick:W}," ‹ ")):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["track",{animating:!q.value}]),style:r.normalizeStyle(E.value)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.value,(he,ae)=>(r.openBlock(),r.createElementBlock("div",{key:he.id+"-"+ae,class:r.normalizeClass(["match-pill",{active:ae===V.value}])},[r.createElementVNode("div",TVe,[r.createElementVNode("div",kVe,r.toDisplayString(he.home),1),r.createElementVNode("span",NVe,r.toDisplayString(he.score),1),r.createElementVNode("div",VVe,r.toDisplayString(he.away),1)]),r.createElementVNode("div",OVe,r.toDisplayString(he.jornada),1)],2))),128))],6),C.value?(r.openBlock(),r.createElementBlock("button",{key:1,class:"carousel-arrow right",onClick:R}," › ")):r.createCommentVNode("",!0)],544)]),r.createElementVNode("div",LVe,[r.createElementVNode("div",{class:"segmented-highlight",style:r.normalizeStyle({width:`calc(100% / ${g.length})`,left:`calc(${g.indexOf(m.value)} * (100% / ${g.length}))`})},null,4),(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(g,he=>r.createElementVNode("button",{key:he,class:r.normalizeClass(["categoria-tab",{active:m.value===he}]),onClick:ae=>m.value=he},r.toDisplayString(he),11,UVe)),64))]),r.createElementVNode("div",qVe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(ne.value,he=>(r.openBlock(),r.createElementBlock("div",{key:he.id,class:r.normalizeClass(["corner-item",{selected:n.value.includes(he.id),disabled:he.disabled}]),onClick:ae=>!he.disabled&&B(he.id)},[r.createElementVNode("div",CVe,[r.createElementVNode("div",{class:"corner-checkbox",onClick:r.withModifiers(ae=>!he.disabled&&B(he.id),["stop"])},[r.createElementVNode("input",{type:"checkbox",checked:n.value.includes(he.id),disabled:he.disabled,class:"checkbox-input",onClick:r.withModifiers(ae=>!he.disabled&&B(he.id),["stop"])},null,8,EVe),n.value.includes(he.id)?(r.openBlock(),r.createElementBlock("span",FVe,r.toDisplayString(f[he.id]),1)):r.createCommentVNode("",!0)],8,PVe)]),r.createElementVNode("div",RVe,[r.createElementVNode("div",MVe,r.toDisplayString(he.order),1)]),r.createElementVNode("div",jVe,[r.createElementVNode("div",WVe,[r.createElementVNode("span",KVe,r.toDisplayString(he.minute),1),r.createElementVNode("span",AVe,r.toDisplayString(he.title),1),r.createElementVNode("span",IVe,"| "+r.toDisplayString(he.player),1)]),r.createElementVNode("div",XVe,[DVe,JVe,r.createElementVNode("span",null,"Rematado "+r.toDisplayString(he.wasGoal?"fue gol":"no fue gol"),1),BVe,r.createElementVNode("div",GVe,[r.createElementVNode("div",{class:"category-dot",style:r.normalizeStyle({backgroundColor:he.color||"#4CAF50"})},null,4),r.createElementVNode("span",null,r.toDisplayString(he.category),1)])])])],10,zVe))),128))])]),r.createElementVNode("div",ZVe,[n.value.length>0?(r.openBlock(),r.createElementBlock("div",HVe,[r.createElementVNode("div",YVe,r.toDisplayString(n.value.length)+"/10",1)])):r.createCommentVNode("",!0),n.value.length>0?(r.openBlock(),r.createElementBlock("div",QVe,[r.createElementVNode("div",{class:"carousel-container",ref_key:"carouselContainerRef",ref:t},[s.value?(r.openBlock(),r.createElementBlock("button",{key:0,class:"carousel-arrow left",onClick:d},"‹")):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"carousel-track",ref_key:"carouselTrackRef",ref:_,style:r.normalizeStyle(w.value)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(x.value,he=>(r.openBlock(),r.createElementBlock("div",{key:he.id,class:"footer-pill"},[r.createElementVNode("div",$Ve,r.toDisplayString(he.order),1),r.createElementVNode("div",eOe,[r.createElementVNode("div",tOe,r.toDisplayString(he.title),1),r.createElementVNode("div",rOe,[r.createElementVNode("span",null,r.toDisplayString(he.minute),1),r.createElementVNode("span",null,r.toDisplayString(he.player),1),nOe,r.createElementVNode("div",aOe,[r.createElementVNode("div",{class:"footer-category-dot",style:r.normalizeStyle({backgroundColor:he.color||"#4CAF50"})},null,4),r.createElementVNode("span",null,r.toDisplayString(he.category),1)])])]),r.createElementVNode("button",{class:"pill-remove-btn",onClick:ae=>ee(he.id)},"×",8,iOe)]))),128))],4),p.value?(r.openBlock(),r.createElementBlock("button",{key:1,class:"carousel-arrow right",onClick:c},"›")):r.createCommentVNode("",!0)],512)])):(r.openBlock(),r.createElementBlock("div",oOe,[r.createElementVNode("span",sOe,r.toDisplayString(n.value.length)+" de 10 Tiros de esquina agregados",1)]))])]))}},[["__scopeId","data-v-a856f73c"]]),Ip=e=>(r.pushScopeId("data-v-6b708ebe"),e=e(),r.popScopeId(),e),lOe={class:"modal-overlay"},cOe={class:"modal-content"},uOe={class:"modal-header"},dOe={class:"header-left"},pOe=Ip(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-report-white.svg",class:"icon-title",alt:"icono reporte blanco"},null,-1)),hOe={class:"modal-title"},fOe={class:"prepartido-text"},mOe={class:"step-counter"},yOe=Ip(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),gOe={key:0,class:"step-content"},vOe={key:0,class:"content-section"},bOe=Ip(()=>r.createElementVNode("h3",{class:"section-title"},"Fortalezas",-1)),xOe=Ip(()=>r.createElementVNode("div",{class:"title-separator"},null,-1)),wOe={class:"section-description"},_Oe=Ip(()=>r.createElementVNode("div",{class:"content-separator"},null,-1)),SOe={class:"radio-group"},TOe={class:"radio-option"},kOe=Ip(()=>r.createElementVNode("span",{class:"radio-custom"},null,-1)),NOe=Ip(()=>r.createElementVNode("span",{class:"radio-label"},"Automáticamente",-1)),VOe={class:"radio-option"},OOe=Ip(()=>r.createElementVNode("span",{class:"radio-custom"},null,-1)),LOe=Ip(()=>r.createElementVNode("span",{class:"radio-label"},"Manualmente",-1)),UOe={key:1,class:"step-content"},qOe={key:2,class:"step-content"},zOe={key:3,class:"step-content"},COe={key:4,class:"step-content"},POe=Ip(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),EOe={class:"modal-footer"},FOe=Ip(()=>r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M10 12L6 8L10 4",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),ROe={class:"footer-actions"},MOe=["disabled"],jOe=r.createStaticVNode('<div class="modal-header" data-v-6b708ebe><div class="header-left" data-v-6b708ebe><span class="modal-title" data-v-6b708ebe>Confirmación</span></div></div><div class="header-separator" data-v-6b708ebe></div><div class="modal-body" data-v-6b708ebe><div class="step-content" data-v-6b708ebe><h3 class="confirm-dialog-title" data-v-6b708ebe>¿Estás seguro de regresar?</h3><p class="confirm-dialog-message" data-v-6b708ebe>Se perderá la información seleccionada</p></div></div>',3),WOe=ml({__name:"ModalConfigurarContenido",props:{hasRival:{type:Boolean,default:!0},token:{type:String,required:!0},template:{type:Object,required:!1,default:null},team:{type:Number,required:!1,default:null},partido:{type:Object,required:!1,default:null}},emits:["close","back","next"],setup(e,{emit:a}){const i=a,k=e;function j(){if(!k.template||!k.template.pages)return!1;for(const E of k.template.pages)if(E.components&&Array.isArray(E.components)&&E.components.some(W=>W.title==="Fortalezas"||W.id===15||W.componentName==="GSCStrengths"))return!0;return!1}function g(){if(console.log("5555555555555555 Nuevo Valor al crear fortalezas:: : : :: : : : :: : : :",k.template),!k.template||!k.template.pages)return{equipo:0,rival:0,total:0};console.log("Nuevo Valor al crear fortalezas:: : : :: : : : :: : : :",k.template);let E=0,R=0;for(const W of k.template.pages)if(console.log("page 11 5555555555555555555555555555555555 ",W),W.components&&Array.isArray(W.components)){console.log("page entro");const K=W.components.filter(X=>X.componentName==="GSCStrengths"||X.id===15||X.name==="Fortalezas");console.log("componentesFortalezas componentesFortalezas componentesFortalezas",K);for(const X of K)X.dynamicFilters&&Array.isArray(X.dynamicFilters)&&X.dynamicFilters[1]&&(X.dynamicFilters[0]===1?E+=X.dynamicFilters[1]:X.dynamicFilters[0]===2?R+=X.dynamicFilters[1]:X.dynamicFilters[0]===3&&(X.filterMultiple.isHomeTeam?E+=X.dynamicFilters[1]:R+=X.dynamicFilters[1]))}return console.log("CONTADOR FINAL DE FORTALEZAS: ",{equipo:E,rival:R,total:E+R}),{equipo:E,rival:R,total:E+R}}const m=r.computed(()=>j()),n=r.computed(()=>g()),f=r.computed(()=>!k.template||!k.template.template_type||k.template.template_type===1?"Prepartido":"Postpartido"),l=r.ref(0),t=r.ref(!1),_=r.ref(!1),b=r.ref("manual"),v=r.ref("manual"),h=r.ref([]),o=r.ref([]),s=r.ref([]),p=r.ref([]),c=r.computed(()=>{let E=0;return m.value&&b.value==="manual"&&(n.value.equipo>0&&(E+=1),n.value.rival>0&&(E+=1)),Math.max(E,1)}),d=r.computed(()=>{var W,K;if(l.value===0)return m.value?b.value==="automatico"||b.value==="manual":!1;const R=x()[l.value];if(R==="fortalezasEquipo"){const X=w.value;if(!X)return!1;const D=h.value.length,H=n.value.equipo,ne=((W=X.fortalezasData)==null?void 0:W.length)||0;return D===H||ne>0&&ne<H&&D===ne}if(R==="fortalezasRival"){const X=S.value;if(!X)return!1;const D=o.value.length,H=n.value.rival,ne=((K=X.fortalezasData)==null?void 0:K.length)||0;return D===H||ne>0&&ne<H&&D===ne}return!1});function x(){const E=[];m.value&&b.value==="manual"&&(n.value.equipo>0&&E.push("fortalezasEquipo"),n.value.rival>0&&E.push("fortalezasRival"));const R={};return E.forEach((W,K)=>{R[K+1]=W}),R}const w=r.ref(null),S=r.ref(null),V=r.ref(null),O=r.ref(null);function U(){i("close")}function z(){l.value>1?l.value--:l.value===1?h.value.length>0||o.value.length>0?_.value=!0:l.value--:i("back")}function L(){h.value=[],o.value=[],s.value=[],p.value=[],_.value=!1,l.value--}function C(){_.value=!1}async function q(){if(l.value===0){if(!d.value)return;if(b.value==="automatico"){i("next",{fortalezas:b.value,tirosEsquina:v.value,selectedFortalezasEquipo:[],selectedFortalezasRival:[],strengthsPayload:{}});return}t.value=!0,setTimeout(()=>{l.value++,t.value=!1},300)}else if(l.value<c.value)t.value=!0,setTimeout(()=>{l.value++,t.value=!1},300);else{await r.nextTick();const E=N();console.log("Estructura de strengths emitida:",JSON.stringify(E,null,2)),i("next",{fortalezas:b.value,tirosEsquina:v.value,selectedFortalezasEquipo:h.value,selectedFortalezasRival:o.value,strengthsPayload:E})}}function N(){var ne;if(console.log("=== INICIANDO buildStrengthsPayload ==="),console.log("Template:",k.template),console.log("Template pages:",(ne=k.template)==null?void 0:ne.pages),!k.template||!k.template.pages)return console.warn("No hay template o pages"),{};const E={};console.log("selectedFortalezasEquipo:",h.value),console.log("selectedFortalezasRival:",o.value),console.log("fortalezasEquipoRef:",w.value),console.log("fortalezasRivalRef:",S.value);let R=w.value,W=S.value;if(R){console.log("equipoRef keys:",Object.keys(R)),console.log("equipoRef.fortalezasRawData:",R.fortalezasRawData),console.log("equipoRef.fortalezasRawData type:",typeof R.fortalezasRawData);let B=R.fortalezasRawData;B&&typeof B=="object"&&"value"in B&&(console.log("⚠️ fortalezasRawData es un ref, usando .value"),B=B.value),console.log("rawDataEquipo después de verificar ref:",B),console.log("rawDataEquipo is array:",Array.isArray(B)),Array.isArray(B)&&(console.log("rawDataEquipo length:",B.length),B.length>0&&console.log("Primer elemento equipoRef:",B[0]))}else console.error("❌ equipoRef NO está disponible");if(W){console.log("rivalRef keys:",Object.keys(W)),console.log("rivalRef.fortalezasRawData:",W.fortalezasRawData),console.log("rivalRef.fortalezasRawData type:",typeof W.fortalezasRawData);let B=W.fortalezasRawData;B&&typeof B=="object"&&"value"in B&&(console.log("⚠️ fortalezasRawData es un ref, usando .value"),B=B.value),console.log("rawDataRival después de verificar ref:",B),console.log("rawDataRival is array:",Array.isArray(B)),Array.isArray(B)&&(console.log("rawDataRival length:",B.length),B.length>0&&console.log("Primer elemento rivalRef:",B[0]))}else console.error("❌ rivalRef NO está disponible");!R&&h.value.length>0&&console.warn("⚠️ Ref de equipo no disponible, pero hay selecciones"),!W&&o.value.length>0&&console.warn("⚠️ Ref de rival no disponible, pero hay selecciones");const K=P(h.value,R),X=P(o.value,W);console.log("fortalezasEquipoOrdenadas:",K),console.log("fortalezasRivalOrdenadas:",X);let D=0,H=0;return k.template.pages.forEach((B,re)=>{const ee=re+1;console.log(`
4131
+ `+g):k.stack=g}catch{}}throw k}}_request(a,i){typeof a=="string"?(i=i||{},i.url=a):i=a||{},i=Cm(this.defaults,i);const{transitional:k,paramsSerializer:j,headers:g}=i;k!==void 0&&L2.assertOptions(k,{silentJSONParsing:xh.transitional(xh.boolean),forcedJSONParsing:xh.transitional(xh.boolean),clarifyTimeoutError:xh.transitional(xh.boolean)},!1),j!=null&&(Qn.isFunction(j)?i.paramsSerializer={serialize:j}:L2.assertOptions(j,{encode:xh.function,serialize:xh.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),L2.assertOptions(i,{baseUrl:xh.spelling("baseURL"),withXsrfToken:xh.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let m=g&&Qn.merge(g.common,g[i.method]);g&&Qn.forEach(["delete","get","head","post","put","patch","common"],h=>{delete g[h]}),i.headers=Cd.concat(m,g);const n=[];let f=!0;this.interceptors.request.forEach(function(o){typeof o.runWhen=="function"&&o.runWhen(i)===!1||(f=f&&o.synchronous,n.unshift(o.fulfilled,o.rejected))});const l=[];this.interceptors.response.forEach(function(o){l.push(o.fulfilled,o.rejected)});let t,_=0,b;if(!f){const h=[TV.bind(this),void 0];for(h.unshift(...n),h.push(...l),b=h.length,t=Promise.resolve(i);_<b;)t=t.then(h[_++],h[_++]);return t}b=n.length;let v=i;for(;_<b;){const h=n[_++],o=n[_++];try{v=h(v)}catch(s){o.call(this,s);break}}try{t=TV.call(this,v)}catch(h){return Promise.reject(h)}for(_=0,b=l.length;_<b;)t=t.then(l[_++],l[_++]);return t}getUri(a){a=Cm(this.defaults,a);const i=hV(a.baseURL,a.url,a.allowAbsoluteUrls);return aV(i,a.params,a.paramsSerializer)}};Qn.forEach(["delete","get","head","options"],function(a){Pm.prototype[a]=function(i,k){return this.request(Cm(k||{},{method:a,url:i,data:(k||{}).data}))}}),Qn.forEach(["post","put","patch"],function(a){function i(k){return function(g,m,n){return this.request(Cm(n||{},{method:a,headers:k?{"Content-Type":"multipart/form-data"}:{},url:g,data:m}))}}Pm.prototype[a]=i(),Pm.prototype[a+"Form"]=i(!0)});let e8e=class DV{constructor(a){if(typeof a!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(g){i=g});const k=this;this.promise.then(j=>{if(!k._listeners)return;let g=k._listeners.length;for(;g-- >0;)k._listeners[g](j);k._listeners=null}),this.promise.then=j=>{let g;const m=new Promise(n=>{k.subscribe(n),g=n}).then(j);return m.cancel=function(){k.unsubscribe(g)},m},a(function(g,m,n){k.reason||(k.reason=new $0(g,m,n),i(k.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(a){if(this.reason){a(this.reason);return}this._listeners?this._listeners.push(a):this._listeners=[a]}unsubscribe(a){if(!this._listeners)return;const i=this._listeners.indexOf(a);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const a=new AbortController,i=k=>{a.abort(k)};return this.subscribe(i),a.signal.unsubscribe=()=>this.unsubscribe(i),a.signal}static source(){let a;return{token:new DV(function(j){a=j}),cancel:a}}};function t8e(e){return function(i){return e.apply(null,i)}}function r8e(e){return Qn.isObject(e)&&e.isAxiosError===!0}const j5={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(j5).forEach(([e,a])=>{j5[a]=e});function VV(e){const a=new Pm(e),i=IN(Pm.prototype.request,a);return Qn.extend(i,Pm.prototype,a,{allOwnKeys:!0}),Qn.extend(i,a,null,{allOwnKeys:!0}),i.create=function(j){return VV(Cm(e,j))},i}const es=VV(B1);es.Axios=Pm,es.CanceledError=$0,es.CancelToken=e8e,es.isCancel=cV,es.VERSION=kV,es.toFormData=T2,es.AxiosError=fo,es.Cancel=es.CanceledError,es.all=function(a){return Promise.all(a)},es.spread=t8e,es.isAxiosError=r8e,es.mergeConfig=Cm,es.AxiosHeaders=Cd,es.formToJSON=e=>sV(Qn.isHTMLForm(e)?new FormData(e):e),es.getAdapter=SV.getAdapter,es.HttpStatusCode=j5,es.default=es;const{Axios:GFe,AxiosError:ZFe,CanceledError:HFe,isCancel:YFe,CancelToken:QFe,VERSION:$Fe,all:eRe,Cancel:tRe,isAxiosError:rRe,spread:nRe,toFormData:aRe,AxiosHeaders:iRe,HttpStatusCode:oRe,formToJSON:sRe,getAdapter:lRe,mergeConfig:cRe}=es,ml=(e,a)=>{const i=e.__vccOpts||e;for(const[k,j]of a)i[k]=j;return i},Z1=e=>(r.pushScopeId("data-v-127740d3"),e=e(),r.popScopeId(),e),n8e={class:"tooltip-template-options"},a8e=Z1(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-report.svg",alt:"Generar reporte",class:"icon"},null,-1)),i8e=Z1(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1)),o8e=Z1(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-edit.svg",alt:"Editar template",class:"icon"},null,-1)),s8e=Z1(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-duplicate.svg",alt:"Duplicar template",class:"icon"},null,-1)),l8e=Z1(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1)),c8e=ml({__name:"TooltipTemplateOptions",props:{canEdit:{type:Boolean,default:!0}},emits:["generar-reporte","renombrar","editar","duplicar","eliminar"],setup(e,{emit:a}){return(i,k)=>(r.openBlock(),r.createElementBlock("div",n8e,[r.createElementVNode("ul",null,[r.createElementVNode("li",{class:"option",onClick:k[0]||(k[0]=j=>i.$emit("generar-reporte"))},[a8e,r.createTextVNode(" Generar reporte ")]),e.canEdit?(r.openBlock(),r.createElementBlock("li",{key:0,class:"option",onClick:k[1]||(k[1]=j=>i.$emit("renombrar"))},[i8e,r.createTextVNode(" Renombrar template ")])):r.createCommentVNode("",!0),e.canEdit?(r.openBlock(),r.createElementBlock("li",{key:1,class:"option",onClick:k[2]||(k[2]=j=>i.$emit("editar"))},[o8e,r.createTextVNode(" Editar template ")])):r.createCommentVNode("",!0),r.createElementVNode("li",{class:"option",onClick:k[3]||(k[3]=j=>i.$emit("duplicar"))},[s8e,r.createTextVNode(" Duplicar template ")]),e.canEdit?(r.openBlock(),r.createElementBlock("li",{key:2,class:"option",onClick:k[4]||(k[4]=j=>i.$emit("eliminar"))},[l8e,r.createTextVNode(" Eliminar template ")])):r.createCommentVNode("",!0)])]))}},[["__scopeId","data-v-127740d3"]]),U2=e=>(r.pushScopeId("data-v-8520e810"),e=e(),r.popScopeId(),e),u8e={class:"template-card postpartido",style:{position:"relative"}},d8e=[U2(()=>r.createElementVNode("span",null,null,-1)),U2(()=>r.createElementVNode("span",null,null,-1)),U2(()=>r.createElementVNode("span",null,null,-1))],p8e={key:0,class:"template-img-placeholder",style:{position:"relative"}},h8e={key:0,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-01.jpg",alt:"Template Prematch Type 1",class:"template-img"},f8e={key:1,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-01.jpg",alt:"Template Postmatch Type 1",class:"template-img"},m8e={key:2,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-02.jpg",alt:"Template Prematch Type 2",class:"template-img"},y8e={key:3,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-02.jpg",alt:"Template Postmatch Type 2",class:"template-img"},g8e={key:4,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-03.jpg",alt:"Template Prematch Type 3",class:"template-img"},v8e={key:5,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-03.jpg",alt:"Template Postmatch Type 3",class:"template-img"},b8e={key:6,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-prmatch-04.jpg",alt:"Template Prematch Type 4",class:"template-img"},x8e={key:7,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumbnail-portada-04.jpg",alt:"Template Postmatch Type 4",class:"template-img"},w8e={key:8,src:"https://golstatsimages.blob.core.windows.net/reports-images/thumb1.png",alt:"Template Default",class:"template-img"},_8e={class:"inner-card-postpartido"},S8e={class:"postpartido-footer"},T8e={class:"postpartido-version"},k8e={class:"postpartido-status"},N8e=U2(()=>r.createElementVNode("span",{class:"tipo-label"},"Tipo:",-1)),V8e={class:"tipo-value"},O8e=ml({__name:"TemplateItem",props:{template:{type:Object,required:!0},userId:{type:Number,required:!0}},emits:["generar-reporte","renombrar","duplicar","eliminar","edit-template"],setup(e,{emit:a}){const i=e,k=a,j=r.ref(!1),g=r.computed(()=>i.userId===i.template.user_id);function m(){j.value=!1,k("generar-reporte")}function n(){j.value=!1;const b=i.template.name||"";k("renombrar",b)}function f(){j.value=!1,k("edit-template",i.template)}function l(){j.value=!1;const b=i.template.name||"";k("duplicar",b)}function t(){j.value=!1,k("eliminar",i.template)}function _(b){}return(b,v)=>(r.openBlock(),r.createElementBlock("div",u8e,[r.createElementVNode("div",{class:"three-dots",onClick:v[0]||(v[0]=r.withModifiers(h=>j.value=!j.value,["stop"]))},d8e),e.template.pages&&e.template.pages[0]?(r.openBlock(),r.createElementBlock("div",p8e,[e.template.template_type===1&&e.template.pages[0].type==1?(r.openBlock(),r.createElementBlock("img",h8e)):e.template.template_type===2&&e.template.pages[0].type==1?(r.openBlock(),r.createElementBlock("img",f8e)):e.template.template_type===1&&e.template.pages[0].type==2?(r.openBlock(),r.createElementBlock("img",m8e)):e.template.template_type===2&&e.template.pages[0].type==2?(r.openBlock(),r.createElementBlock("img",y8e)):e.template.template_type===1&&e.template.pages[0].type==3?(r.openBlock(),r.createElementBlock("img",g8e)):e.template.template_type===2&&e.template.pages[0].type==3?(r.openBlock(),r.createElementBlock("img",v8e)):e.template.template_type===1&&e.template.pages[0].type==4?(r.openBlock(),r.createElementBlock("img",b8e)):e.template.template_type===2&&e.template.pages[0].type==4?(r.openBlock(),r.createElementBlock("img",x8e)):(r.openBlock(),r.createElementBlock("img",w8e))])):r.createCommentVNode("",!0),r.createElementVNode("div",_8e,[r.createElementVNode("div",S8e,[r.createElementVNode("div",T8e,r.toDisplayString(e.template.name),1),r.createElementVNode("div",k8e,[N8e,r.createElementVNode("span",V8e," "+r.toDisplayString(e.template.template_type==1?"Prepartido":"Postpartido"),1)]),r.createElementVNode("button",{class:"postpartido-btn",onClick:v[1]||(v[1]=h=>k("generar-reporte"))},"Generar reporte")])]),j.value?(r.openBlock(),r.createBlock(c8e,{key:1,"can-edit":g.value,onClick:v[2]||(v[2]=r.withModifiers(h=>j.value=!1,["self"])),onMouseleave:v[3]||(v[3]=h=>j.value=!1),onGenerarReporte:m,onRenombrar:n,onEditar:f,onDuplicar:l,onEliminar:t,onToggleAutogen:_},null,8,["can-edit"])):r.createCommentVNode("",!0),j.value?(r.openBlock(),r.createElementBlock("div",{key:2,class:"tooltip-overlay",onClick:v[4]||(v[4]=h=>j.value=!1)})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-8520e810"]]),ey=e=>(r.pushScopeId("data-v-a34cf1b5"),e=e(),r.popScopeId(),e),L8e={class:"modal-overlay"},U8e={class:"modal-content"},q8e=[ey(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],z8e=ey(()=>r.createElementVNode("div",{class:"modal-header"},[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-editar-withe.svg",class:"icon-title",alt:"icon"}),r.createElementVNode("span",{class:"modal-title"},"Crear Template")],-1)),C8e=ey(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),P8e={class:"modal-body"},E8e=ey(()=>r.createElementVNode("div",{class:"modal-label"},"Define el tipo de análisis para tu template:",-1)),F8e={class:"radio-group"},R8e=ey(()=>r.createElementVNode("div",{class:"modal-label"},"Agrega un nombre a tu template:",-1)),M8e=["disabled"],j8e={key:0,class:"error-message"},W8e=ey(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),K8e={class:"modal-footer"},A8e=["disabled"],I8e=["disabled"],X8e=["disabled"],D8e={key:0,class:"loading-spinner"},J8e={key:1},OV=ml({__name:"ModalCreateTemplate",props:{token:{type:String,required:!0},team:{type:Number,required:!0}},emits:["close","template-created","open-modal-new-template"],setup(e,{emit:a}){const i=e,k=a,j=r.ref(1),g=r.ref("pre"),m=r.ref(""),n=r.ref(!1),f=r.ref(""),l=async()=>{var t;if(!(m.value.trim().length<3)){n.value=!0,f.value="";try{const _={name:m.value.trim(),team_id:i.team,template_type:g.value==="pre"?1:2},v=await es.create({headers:{Authorization:`${i.token}`}}).post("https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates",_);k("template-created",v.data),k("open-modal-new-template",(t=v.data)==null?void 0:t.data),k("close")}catch(_){console.error("Error al guardar template:",_),_.response&&_.response.status===409&&(f.value="Ya existe un template con el mismo nombre")}finally{n.value=!1}}};return r.onMounted(()=>{document.body.style.overflow="hidden"}),r.onUnmounted(()=>{document.body.style.overflow=""}),(t,_)=>(r.openBlock(),r.createElementBlock("div",L8e,[r.createElementVNode("div",U8e,[r.createElementVNode("button",{class:"close-btn",onClick:_[0]||(_[0]=b=>t.$emit("close"))},q8e),z8e,C8e,r.createElementVNode("div",P8e,[j.value===1?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[E8e,r.createElementVNode("div",F8e,[r.createElementVNode("label",{class:r.normalizeClass(["radio-label",{selected:g.value==="pre"}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",value:"pre","onUpdate:modelValue":_[1]||(_[1]=b=>g.value=b)},null,512),[[r.vModelRadio,g.value]]),r.createTextVNode(" Prepartido ")],2),r.createElementVNode("label",{class:r.normalizeClass(["radio-label",{selected:g.value==="post"}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",value:"post","onUpdate:modelValue":_[2]||(_[2]=b=>g.value=b)},null,512),[[r.vModelRadio,g.value]]),r.createTextVNode(" Postpartido ")],2)])],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[R8e,r.withDirectives(r.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":_[3]||(_[3]=b=>m.value=b),placeholder:"Untitled",maxlength:"40",autocomplete:"off",disabled:n.value},null,8,M8e),[[r.vModelText,m.value]]),f.value?(r.openBlock(),r.createElementBlock("div",j8e,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],64))]),W8e,r.createElementVNode("div",K8e,[r.createElementVNode("button",{class:"cancel-btn",onClick:_[4]||(_[4]=b=>t.$emit("close")),disabled:n.value},"Cancelar",8,A8e),j.value===1?(r.openBlock(),r.createElementBlock("button",{key:0,class:"next-btn",disabled:!g.value,onClick:_[5]||(_[5]=b=>j.value=2)}," Siguiente ",8,I8e)):(r.openBlock(),r.createElementBlock("button",{key:1,class:"next-btn",disabled:m.value.trim().length<3||n.value,onClick:l},[n.value?(r.openBlock(),r.createElementBlock("div",D8e)):(r.openBlock(),r.createElementBlock("span",J8e,"Guardar"))],8,X8e))])])]))}},[["__scopeId","data-v-a34cf1b5"]]),Uu=e=>(r.pushScopeId("data-v-40b6c5de"),e=e(),r.popScopeId(),e),B8e={class:"modal-overlay"},G8e={class:"modal-content"},Z8e=[Uu(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],H8e=Uu(()=>r.createElementVNode("div",{class:"modal-header"},[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-report-white.svg",class:"icon-title",alt:"icono reporte blanco"}),r.createElementVNode("span",{class:"modal-title"},"Generar reporte")],-1)),Y8e=Uu(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),Q8e={class:"modal-body"},$8e={key:0,class:"error-message-container"},e9e=Uu(()=>r.createElementVNode("p",{class:"error-text"},[r.createTextVNode(" Este reporte ya fue generado previamente"),r.createElementVNode("br"),r.createTextVNode(" con este template para el partido seleccionado. ")],-1)),t9e={key:1,style:{position:"relative"}},r9e={key:0,class:"loading-autoseteo-overlay"},n9e=[Uu(()=>r.createElementVNode("div",{class:"loading-autoseteo-content"},[r.createElementVNode("div",{class:"loading-spinner"})],-1))],a9e={class:"modal-group"},i9e=Uu(()=>r.createElementVNode("label",null,"1. Elige el torneo",-1)),o9e={key:0,class:"placeholder"},s9e=Uu(()=>r.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1)),l9e={key:0,class:"placeholder"},c9e={key:1},u9e=[Uu(()=>r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],d9e={key:0,class:"custom-select-dropdown"},p9e=["onMousedown"],h9e={class:"modal-row"},f9e={class:"modal-group"},m9e=Uu(()=>r.createElementVNode("label",null,"2. Elige la temporada",-1)),y9e={key:0,class:"placeholder"},g9e=Uu(()=>r.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1)),v9e={key:0,class:"placeholder"},b9e={key:1},x9e=[Uu(()=>r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],w9e={key:0,class:"custom-select-dropdown"},_9e=["onMousedown"],S9e={class:"modal-group"},T9e=Uu(()=>r.createElementVNode("label",null,"3. Elige la jornada",-1)),k9e={key:0,class:"placeholder"},N9e=Uu(()=>r.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1)),V9e={key:0,class:"placeholder"},O9e={key:1},L9e=[Uu(()=>r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],U9e={key:0,class:"custom-select-dropdown"},q9e=["onMousedown"],z9e={class:"modal-group"},C9e=Uu(()=>r.createElementVNode("label",null,"4. Elige el partido",-1)),P9e={key:0,class:"placeholder"},E9e=Uu(()=>r.createElementVNode("span",{class:"loading-spinner select-spinner"},null,-1)),F9e={key:0,class:"placeholder"},R9e=["src"],M9e=["src"],j9e=[Uu(()=>r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M5 7L8 10L11 7",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],W9e={key:0,class:"custom-select-dropdown"},K9e=["onMousedown"],A9e=["src"],I9e=["src"],X9e={key:0,class:"header-separator"},D9e={key:1,class:"modal-footer"},J9e=["disabled"],B9e={key:0,class:"loading-spinner select-spinner"},G9e=ml({__name:"ModalGenerarReporte",props:{userId:{type:String,required:!0},token:{type:String,required:!0},team:{type:Number,required:!0},templateId:{type:String,required:!0},templateType:{type:String,required:!1},template:{type:Object,required:!1},showError409OnMount:{type:Boolean,default:!1}},emits:["close","generar","switch-to-reports","open-configurar-contenido"],setup(e,{emit:a}){const i=e,k=a,j=r.ref([]),g=r.ref([]),m=r.ref([]),n=r.ref([]),f=r.ref(""),l=r.ref(""),t=r.ref(""),_=r.ref(null),b=es.create({headers:{Authorization:i.token}}),v=r.ref(!1),h=r.ref(!1),o=r.ref(!1),s=r.ref(!1),p=r.ref(!1),c=r.ref(!1),d=r.ref(!1),x=r.ref(!1),w=r.ref([]),S=r.ref([]),V=r.ref(!1),O=r.ref(!1),U=r.ref(!1);function z(ie){c.value&&(c.value=!1,p.value=!1),d.value=!1,f.value=ie,V.value=!1,T()}function L(ie){c.value&&(c.value=!1,p.value=!1),d.value=!1,l.value=ie,O.value=!1,E()}function C(ie){c.value&&(c.value=!1,p.value=!1),d.value=!1,t.value=ie,U.value=!1,W()}const q=r.ref(null);async function N(){try{h.value=!0;const ie=await es.get("https://kefloixzy1.execute-api.us-west-2.amazonaws.com/prod/gs3/tournaments");if(ie.data&&Array.isArray(ie.data)){if(w.value=ie.data,j.value=ie.data.map(ue=>ue.tournament).sort((ue,he)=>ue.order&&he.order?ue.order-he.order:ue.order&&!he.order?-1:!ue.order&&he.order?1:0),f.value="",g.value=[],l.value="",m.value=[],t.value="",n.value=[],_.value=null,q.value)setTimeout(()=>{Y(q.value)},100);else if(j.value.length>0){const ue=j.value[0];f.value=ue,P(ue)}}}catch(ie){console.error("Error al cargar torneos:",ie),j.value=[{name:"Concacaf Copa Oro"},{name:"Liga MX"},{name:"MLS"}],g.value=[],m.value=[],f.value="",l.value="",t.value="",_.value=null}finally{h.value=!1}}function P(ie){const ue=w.value.find(he=>he.tournament&&he.tournament.name===ie.name);ue&&Array.isArray(ue.seasons)?(g.value=ue.seasons,l.value="",m.value=[],t.value="",n.value=[],_.value=null):(g.value=[],l.value="",m.value=[],t.value="",n.value=[],_.value=null)}function T(){l.value="",t.value="",_.value=null,f.value?P(f.value):(g.value=[],m.value=[],n.value=[])}function E(){if(s.value=!0,t.value="",_.value=null,m.value=[],n.value=[],l.value&&l.value.id){const ie=[l.value.id];if(l.value.related_seasons&&Array.isArray(l.value.related_seasons)){const ue=l.value.related_seasons.map(he=>he.id).filter(Boolean);ie.push(...ue)}R(ie)}else s.value=!1}async function R(ie){o.value=!0;try{const ue=Array.isArray(ie)?ie.join("&seasons="):ie,he=await b.get(`https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?seasons=${ue}`);if(he.data.data&&Array.isArray(he.data.data)){const ae=he.data.data.reduce((xe,be)=>be.games&&Array.isArray(be.games)?xe.concat(be.games):xe,[]);S.value=ae.map(xe=>({label:xe.label||`${xe.home_team_acronym||"Local"} vs ${xe.visiting_team_acronym||"Visitante"}`,localLogo:"https://golstatsimages.blob.core.windows.net/teams-80/"+xe.home_team+".png"||"",visitanteLogo:"https://golstatsimages.blob.core.windows.net/teams-80/"+xe.visiting_team+".png"||"",...xe}));let de=S.value;i.templateType==="2"||i.templateType===2?de=de.filter(xe=>xe.game_status===1):(i.templateType==="1"||i.templateType===1)&&(de=de.filter(xe=>xe.game_status===4));const ce=de.map(xe=>xe.matchday_id).filter(Boolean),ye=[...new Set(ce)];m.value=ye.map(xe=>{const be=S.value.find(Te=>Te.matchday_id&&Te.matchday_id===xe);return be?{id:xe,name:be.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")}:null}).filter(Boolean).sort((xe,be)=>{const Te=xe.name.startsWith("Jornada"),Oe=be.name.startsWith("Jornada");return Te&&Oe?xe.id-be.id:Te&&!Oe?-1:!Te&&Oe?1:0}),t.value="",n.value=[],_.value=null,s.value=!1,q.value&&c.value&&setTimeout(()=>{$(q.value)},200)}else S.value=[],m.value=[],t.value="",n.value=[],_.value=null}catch(ue){console.error("Error al cargar partidos:",ue),S.value=[],m.value=[],t.value="",n.value=[],_.value=null,s.value=!1}finally{o.value=!1}}function W(){_.value=null,n.value=[],t.value&&t.value.id&&K(t.value)}function K(ie){if(!ie||!ie.id){n.value=[];return}let ue=S.value.filter(he=>he.matchday_id===ie.id);i.templateType==="2"||i.templateType===2?ue=ue.filter(he=>he.game_status===1):(i.templateType==="1"||i.templateType===1)&&(ue=ue.filter(he=>he.game_status===4)),n.value=ue}function X(){if(!i.template||!i.template.pages)return!1;console.log("ENTRO A QUI A REVISAR SI HAY FORTALKEZAS"),console.log(i.template);for(const ie of i.template.pages)if(ie.components&&Array.isArray(ie.components)&&ie.components.some(he=>he.name==="Fortalezas"||he.componentName==="GSCStrengths"))return!0;return!1}async function D(){try{if(X()){k("open-configurar-contenido",{liga:f.value,torneo:l.value,jornada:t.value,partido:_.value,template:i.template}),k("close");return}h.value=!0;let ie="";l.value&&l.value.name&&(ie=l.value.name);const ue={template_id:i.templateId,user_id:i.template&&i.template.user_id?parseInt(i.template.user_id):parseInt(i.userId),tournament_id:f.value.id||1,tournament_name:f.value.name,season_id:_.value.season_id,season_name:ie,game_id:_.value.id||_.value.game_id},he=await es.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${i.userId}/reports`,ue,{headers:{Authorization:i.token,"Content-Type":"application/json"}});k("generar",{liga:f.value,torneo:l.value,jornada:t.value,partido:_.value,reportData:he.data}),k("switch-to-reports"),k("close")}catch(ie){console.error("Error al generar el reporte:",ie),ie.response&&ie.response.status===409?x.value=!0:alert("Error al generar el reporte. Por favor, intenta de nuevo.")}finally{h.value=!1}}function H(){U.value=!U.value}function ne(ie){c.value&&(c.value=!1,p.value=!1),d.value=!1,_.value=ie,v.value=!1}function B(){document.body.style.overflow="hidden"}function re(){document.body.style.overflow=""}r.watch(()=>i.showError409OnMount,ie=>{x.value=ie},{immediate:!0}),r.onMounted(()=>{i.showError409OnMount&&(x.value=!0),N(),B(),ee(),q.value&&(p.value=!0,c.value=!0)}),r.watch(f,(ie,ue)=>{if(ie&&q.value&&c.value&&!ue&&!d.value){const he=g.value.find(ae=>ae.id===q.value.season_id);he&&(d.value=!0,l.value=he,d.value=!1)}}),r.watch(l,(ie,ue)=>{ie&&q.value&&c.value&&!ue&&!d.value?setTimeout(()=>{const he=m.value.find(ae=>ae.id===q.value.matchday_id);he&&(d.value=!0,t.value=he,K(he),d.value=!1)},500):ie&&ue&&c.value&&(c.value=!1,p.value=!1)}),r.watch(t,(ie,ue)=>{ie&&q.value&&c.value&&!ue&&!d.value?setTimeout(()=>{const he=n.value.find(de=>de.game_id===q.value.game_id||de.id===q.value.game_id);if(K(ie),he){_.value=he,p.value=!1,c.value=!1;return}const ae=n.value.find(de=>de.home_team===q.value.home_team&&de.visiting_team===q.value.visiting_team);if(ae){_.value=ae,p.value=!1,c.value=!1;return}if(S.value.length>0){const de=S.value.find(ce=>ce.game_id===q.value.game_id||ce.id===q.value.game_id);if(de){_.value=de,p.value=!1,c.value=!1;return}}p.value=!1,c.value=!1},1e3):ie&&ue&&c.value&&(c.value=!1,p.value=!1)}),r.onUnmounted(()=>{re()});async function ee(){try{const ie=await b.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/teams/${i.team}/last-games`);i.templateType==="1"||i.templateType===1?(q.value=ie.data.data.prematch,ie.data.data.prematch&&(p.value=!0,c.value=!0,ie.data.data.prematch.season_id&&await R([ie.data.data.prematch.season_id]))):(i.templateType==="2"||i.templateType===2)&&(q.value=ie.data.data.postmatch,ie.data.data.postmatch&&(p.value=!0,c.value=!0,ie.data.data.postmatch.season_id&&await R([ie.data.data.postmatch.season_id])))}catch(ie){console.error("Error al cargar últimos juegos:",ie)}}function Y(ie){if(!(!ie||!ie.game_id)&&ie.tournament_id&&j.value.length>0){const ue=j.value.find(he=>he.id===ie.tournament_id);ue&&(f.value=ue,P(ue))}}function $(ie){if(!(!ie||!ie.game_id)&&ie.tournament_id&&j.value.length>0){const ue=j.value.find(he=>he.id===ie.tournament_id);if(ue&&(f.value=ue,ie.season_id&&g.value.length>0)){const he=g.value.find(ae=>ae.id===ie.season_id);if(he&&(l.value=he,ie.matchday_id&&m.value.length>0)){const ae=m.value.find(de=>de.id===ie.matchday_id);if(ae&&(t.value=ae,ie.game_id&&n.value.length>0)){const de=n.value.find(ce=>ce.game_id===ie.game_id||ce.id===ie.game_id);if(de)_.value=de;else{const ce=n.value.find(ye=>ye.home_team===ie.home_team&&ye.visiting_team===ie.visiting_team);ce&&(_.value=ce)}}}}}}function le(){x.value=!1,f.value="",l.value="",t.value="",_.value=null,g.value=[],m.value=[],n.value=[],V.value=!1,O.value=!1,U.value=!1,v.value=!1,re(),k("close")}return(ie,ue)=>(r.openBlock(),r.createElementBlock("div",B8e,[r.createElementVNode("div",G8e,[r.createElementVNode("button",{class:"close-btn",onClick:le},Z8e),H8e,Y8e,r.createElementVNode("div",Q8e,[x.value?(r.openBlock(),r.createElementBlock("div",$8e,[e9e,r.createElementVNode("button",{class:"accept-btn",onClick:le},"Aceptar")])):(r.openBlock(),r.createElementBlock("div",t9e,[p.value?(r.openBlock(),r.createElementBlock("div",r9e,n9e)):r.createCommentVNode("",!0),r.createElementVNode("div",a9e,[i9e,r.createElementVNode("div",{class:"select-wrapper custom-dropdown liga-select",tabindex:"0",onClick:ue[0]||(ue[0]=he=>V.value=!V.value),onBlur:ue[1]||(ue[1]=he=>V.value=!1)},[r.createElementVNode("div",{class:r.normalizeClass(["custom-select-display",{disabled:h.value||j.value.length===0}])},[h.value?(r.openBlock(),r.createElementBlock("span",o9e,[s9e,r.createTextVNode("Cargando torneos...")])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[f.value?(r.openBlock(),r.createElementBlock("span",c9e,r.toDisplayString(f.value.name),1)):(r.openBlock(),r.createElementBlock("span",l9e,"Selecciona el torneo"))],64)),r.createElementVNode("span",{class:r.normalizeClass(["select-chevron",{open:V.value}])},u9e,2)],2),V.value&&j.value.length>0?(r.openBlock(),r.createElementBlock("div",d9e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,he=>(r.openBlock(),r.createElementBlock("div",{key:he.name,class:"custom-select-option",onMousedown:r.withModifiers(ae=>z(he),["prevent"])},r.toDisplayString(he.name),41,p9e))),128))])):r.createCommentVNode("",!0)],32)]),r.createElementVNode("div",h9e,[r.createElementVNode("div",f9e,[m9e,r.createElementVNode("div",{class:"select-wrapper custom-dropdown torneo-select",tabindex:"0",onClick:ue[2]||(ue[2]=he=>O.value=!O.value),onBlur:ue[3]||(ue[3]=he=>O.value=!1)},[r.createElementVNode("div",{class:r.normalizeClass(["custom-select-display",{disabled:!f.value||g.value.length===0||h.value}])},[h.value?(r.openBlock(),r.createElementBlock("span",y9e,[g9e,r.createTextVNode("Cargando temporada...")])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[l.value?(r.openBlock(),r.createElementBlock("span",b9e,r.toDisplayString(l.value.name),1)):(r.openBlock(),r.createElementBlock("span",v9e,"Elige la temporada"))],64)),r.createElementVNode("span",{class:r.normalizeClass(["select-chevron",{open:O.value}])},x9e,2)],2),O.value&&g.value.length>0&&f.value?(r.openBlock(),r.createElementBlock("div",w9e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g.value,he=>(r.openBlock(),r.createElementBlock("div",{key:he.id,class:"custom-select-option",onMousedown:r.withModifiers(ae=>L(he),["prevent"])},r.toDisplayString(he.name),41,_9e))),128))])):r.createCommentVNode("",!0)],32)]),r.createElementVNode("div",S9e,[T9e,r.createElementVNode("div",{class:"select-wrapper custom-dropdown jornada-select",tabindex:"0",onClick:H,onBlur:ue[4]||(ue[4]=he=>U.value=!1)},[r.createElementVNode("div",{class:r.normalizeClass(["custom-select-display",{disabled:!l.value||m.value.length===0||s.value}])},[s.value?(r.openBlock(),r.createElementBlock("span",k9e,[N9e,r.createTextVNode("Cargando jornadas...")])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[t.value?(r.openBlock(),r.createElementBlock("span",O9e,r.toDisplayString(t.value.name),1)):(r.openBlock(),r.createElementBlock("span",V9e,"Elige la jornada"))],64)),r.createElementVNode("span",{class:r.normalizeClass(["select-chevron",{open:U.value}])},L9e,2)],2),U.value&&m.value.length>0?(r.openBlock(),r.createElementBlock("div",U9e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.value,he=>(r.openBlock(),r.createElementBlock("div",{key:he.id,class:"custom-select-option",onMousedown:r.withModifiers(ae=>C(he),["prevent"])},r.toDisplayString(he.name),41,q9e))),128))])):r.createCommentVNode("",!0)],32)])]),r.createElementVNode("div",z9e,[C9e,r.createElementVNode("div",{class:"select-wrapper partido-select",tabindex:"0",onClick:ue[5]||(ue[5]=he=>v.value=!v.value),onBlur:ue[6]||(ue[6]=he=>v.value=!1)},[r.createElementVNode("div",{class:r.normalizeClass(["custom-select-display",{disabled:!t.value||o.value}])},[o.value?(r.openBlock(),r.createElementBlock("span",P9e,[E9e,r.createTextVNode("Cargando partidos...")])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[_.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[_.value.localLogo?(r.openBlock(),r.createElementBlock("img",{key:0,src:_.value.localLogo,class:"logo-equipo",alt:"local"},null,8,R9e)):r.createCommentVNode("",!0),r.createElementVNode("span",null,r.toDisplayString(_.value.label),1),_.value.visitanteLogo?(r.openBlock(),r.createElementBlock("img",{key:1,src:_.value.visitanteLogo,class:"logo-equipo",alt:"visitante"},null,8,M9e)):r.createCommentVNode("",!0)],64)):(r.openBlock(),r.createElementBlock("span",F9e,"Selecciona el partido"))],64)),r.createElementVNode("span",{class:r.normalizeClass(["select-chevron",{open:v.value}])},j9e,2)],2),v.value&&!o.value&&t.value?(r.openBlock(),r.createElementBlock("div",W9e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.value,he=>(r.openBlock(),r.createElementBlock("div",{key:he.label,class:"custom-select-option",onMousedown:r.withModifiers(ae=>ne(he),["prevent"])},[r.createElementVNode("img",{src:he.localLogo,class:"logo-equipo",alt:"local"},null,8,A9e),r.createElementVNode("span",null,r.toDisplayString(he.label),1),r.createElementVNode("img",{src:he.visitanteLogo,class:"logo-equipo",alt:"visitante"},null,8,I9e)],40,K9e))),128))])):r.createCommentVNode("",!0)],32)])]))]),x.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",X9e)),x.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",D9e,[r.createElementVNode("button",{class:"cancel-btn",onClick:le},"Cancelar"),r.createElementVNode("button",{class:"next-btn",disabled:!f.value||!l.value||!t.value||!_.value||h.value,onClick:D},[h.value?(r.openBlock(),r.createElementBlock("span",B9e)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(h.value?"Generando...":"Generar"),1)],8,J9e)]))])]))}},[["__scopeId","data-v-40b6c5de"]]),H1=e=>(r.pushScopeId("data-v-3f4f9ca5"),e=e(),r.popScopeId(),e),Z9e={class:"modal-overlay"},H9e={class:"modal-content"},Y9e=[H1(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],Q9e=H1(()=>r.createElementVNode("div",{class:"modal-header"},[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename-white.svg",class:"icon-title",alt:"icon"}),r.createElementVNode("span",{class:"modal-title"},"Renombrar Template")],-1)),$9e=H1(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),eNe={class:"modal-body"},tNe=H1(()=>r.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),rNe=["placeholder","disabled"],nNe={key:0,class:"error-message"},aNe=H1(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),iNe={class:"modal-footer"},oNe=["disabled"],sNe=["disabled"],lNe={key:0},cNe={key:1},uNe=ml({__name:"ModalRenameTemplate",props:{initialName:{type:String,required:!0},templateType:{type:String,required:!0},token:{type:String,required:!0},userId:{type:String,required:!0},templateId:{type:String,required:!0}},emits:["close","rename","refresh"],setup(e,{emit:a}){const i=e,k=a,j=r.ref(i.initialName),g=r.ref(!1),m=r.ref("");r.watch(()=>i.initialName,f=>{j.value=f,m.value=""}),r.onMounted(()=>{document.body.style.overflow="hidden"}),r.onUnmounted(()=>{document.body.style.overflow=""});async function n(){var f;if(!(j.value.trim().length<3)){g.value=!0,m.value="";try{await es.put(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${i.userId}/templates/${i.templateId}/general`,{name:j.value.trim()},{headers:{Authorization:`${i.token}`,"Content-Type":"application/json"}}),k("rename",j.value.trim()),k("refresh"),k("close")}catch(l){console.error("Error al renombrar el template:",l),((f=l.response)==null?void 0:f.status)===409?m.value="Ya existe un template con el mismo nombre":m.value="Error al renombrar el template. Inténtalo de nuevo."}finally{g.value=!1}}}return(f,l)=>(r.openBlock(),r.createElementBlock("div",Z9e,[r.createElementVNode("div",H9e,[r.createElementVNode("button",{class:"close-btn",onClick:l[0]||(l[0]=t=>f.$emit("close"))},Y9e),Q9e,$9e,r.createElementVNode("div",eNe,[tNe,r.withDirectives(r.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":l[1]||(l[1]=t=>j.value=t),placeholder:e.initialName,maxlength:"40",autocomplete:"off",disabled:g.value},null,8,rNe),[[r.vModelText,j.value]]),m.value?(r.openBlock(),r.createElementBlock("div",nNe,r.toDisplayString(m.value),1)):r.createCommentVNode("",!0)]),aNe,r.createElementVNode("div",iNe,[r.createElementVNode("button",{class:"cancel-btn",onClick:l[2]||(l[2]=t=>f.$emit("close")),disabled:g.value},"Cancelar",8,oNe),r.createElementVNode("button",{class:"next-btn",disabled:j.value.trim().length<3||g.value,onClick:n},[g.value?(r.openBlock(),r.createElementBlock("span",lNe,"Guardando...")):(r.openBlock(),r.createElementBlock("span",cNe,"Guardar"))],8,sNe)])])]))}},[["__scopeId","data-v-3f4f9ca5"]]),Y1=e=>(r.pushScopeId("data-v-abfffcd1"),e=e(),r.popScopeId(),e),dNe={class:"modal-overlay"},pNe={class:"modal-content"},hNe=[Y1(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],fNe=Y1(()=>r.createElementVNode("div",{class:"modal-header"},[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-duplicate-white.svg",class:"icon-title",alt:"icon"}),r.createElementVNode("span",{class:"modal-title"},"Duplicar template")],-1)),mNe=Y1(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),yNe={class:"modal-body"},gNe=Y1(()=>r.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),vNe=["placeholder"],bNe=Y1(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),xNe={class:"modal-footer"},wNe=["disabled"],_Ne=ml({__name:"ModalduplicateTemplate",props:{initialName:{type:String,required:!0},token:{type:String,required:!0},templateId:{type:String,required:!0}},emits:["close","duplicate","template-duplicated"],setup(e,{emit:a}){const i=e,k=a,j=r.ref(i.initialName+" copy"),g=r.ref(!1);r.watch(()=>i.initialName,n=>{j.value=n+" copy"}),r.onMounted(()=>{document.body.style.overflow="hidden"}),r.onUnmounted(()=>{document.body.style.overflow=""});async function m(){if(j.value.trim().length>=3&&!g.value){g.value=!0;try{const n=await es.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates/${i.templateId}/duplicate`,{name:j.value.trim()},{headers:{Authorization:`${i.token}`,"Content-Type":"application/json"}});k("template-duplicated",{originalTemplateId:i.templateId,newTemplateName:j.value.trim(),responseData:n.data}),k("close")}catch(n){console.error("Error al duplicar template:",n),alert("Error al duplicar el template. Por favor, intenta de nuevo.")}finally{g.value=!1}}}return(n,f)=>(r.openBlock(),r.createElementBlock("div",dNe,[r.createElementVNode("div",pNe,[r.createElementVNode("button",{class:"close-btn",onClick:f[0]||(f[0]=l=>n.$emit("close"))},hNe),fNe,mNe,r.createElementVNode("div",yNe,[gNe,r.withDirectives(r.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":f[1]||(f[1]=l=>j.value=l),placeholder:e.initialName,maxlength:"40",autocomplete:"off"},null,8,vNe),[[r.vModelText,j.value]])]),bNe,r.createElementVNode("div",xNe,[r.createElementVNode("button",{class:"cancel-btn",onClick:f[2]||(f[2]=l=>n.$emit("close"))},"Cancelar"),r.createElementVNode("button",{class:"next-btn",disabled:j.value.trim().length<3||g.value,onClick:m},r.toDisplayString(g.value?"Duplicando...":"Aceptar"),9,wNe)])])]))}},[["__scopeId","data-v-abfffcd1"]]),SNe=e=>(r.pushScopeId("data-v-93a27145"),e=e(),r.popScopeId(),e),TNe={class:"modal-overlay"},kNe={class:"modal-content"},NNe=[SNe(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],VNe=r.createStaticVNode('<div class="modal-header" data-v-93a27145><img src="https://golstatsimages.blob.core.windows.net/reports-images/icn-delete-delete.svg" class="icon-title" alt="icon" data-v-93a27145><span class="modal-title" data-v-93a27145>Eliminar template</span></div><div class="header-separator" data-v-93a27145></div><div class="modal-body confirm-text" data-v-93a27145> ¿Estás seguro que deseas eliminar<br data-v-93a27145> este template? Si lo haces no habrá manera<br data-v-93a27145> de recuperarlo. </div><div class="header-separator" data-v-93a27145></div>',4),ONe={class:"modal-footer"},LNe=["disabled"],UNe=ml({__name:"ModalDeleteTemplate",props:{templateId:{type:String,required:!0},userId:{type:String,required:!0},token:{type:String,required:!0}},emits:["close","delete","templateDeleted"],setup(e,{emit:a}){const i=e,k=a,j=r.ref(!1);r.onMounted(()=>{document.body.style.overflow="hidden"}),r.onUnmounted(()=>{document.body.style.overflow=""});const g=async()=>{try{j.value=!0;const n=await es.create({headers:{Authorization:`${i.token}`}}).delete(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${i.userId}/templates/${i.templateId}`);(n.status===200||n.status===204)&&(k("templateDeleted",i.templateId),k("close"))}catch(m){console.error("Error al eliminar template:",m),alert("Error al eliminar el template. Por favor, inténtalo de nuevo.")}finally{j.value=!1}};return(m,n)=>(r.openBlock(),r.createElementBlock("div",TNe,[r.createElementVNode("div",kNe,[r.createElementVNode("button",{class:"close-btn",onClick:n[0]||(n[0]=f=>m.$emit("close"))},NNe),VNe,r.createElementVNode("div",ONe,[r.createElementVNode("button",{class:"cancel-btn",onClick:n[1]||(n[1]=f=>m.$emit("close"))},"Cancelar"),r.createElementVNode("button",{class:"delete-btn",onClick:g,disabled:j.value},r.toDisplayString(j.value?"Eliminando...":"Eliminar"),9,LNe)])])]))}},[["__scopeId","data-v-93a27145"]]),q2=e=>(r.pushScopeId("data-v-11f42e0a"),e=e(),r.popScopeId(),e),qNe={class:"fortalezas-view"},zNe={class:"fortalezas-header"},CNe={class:"team-logo-container"},PNe=["src","alt"],ENe={class:"header-content"},FNe={class:"fortalezas-title"},RNe={class:"fortalezas-description"},MNe={class:"fortalezas-container"},jNe={class:"categorias-tabs segmented"},WNe=["onClick"],KNe={class:"fortalezas-list"},ANe={key:0,class:"loading-state"},INe=[q2(()=>r.createElementVNode("div",{class:"loading-spinner"},null,-1)),q2(()=>r.createElementVNode("p",{class:"loading-text"},"Cargando fortalezas...",-1))],XNe={key:1,class:"error-state"},DNe={class:"error-text"},JNe=["onClick"],BNe=["onClick"],GNe=["checked","disabled","onClick"],ZNe={key:0,class:"selection-number"},HNe={class:"fortaleza-badge"},YNe={class:"fortaleza-content"},QNe={class:"fortaleza-name"},$Ne={class:"fortaleza-ranking"},eVe=q2(()=>r.createElementVNode("div",{class:"separator"},null,-1)),tVe={class:"category-indicator"},rVe={class:"fortalezas-footer"},nVe={key:0,class:"counter-section"},aVe={class:"counter-text"},iVe={key:1,class:"carousel-section"},oVe={class:"footer-badge"},sVe={class:"footer-content"},lVe={class:"footer-name"},cVe={class:"footer-ranking"},uVe=q2(()=>r.createElementVNode("div",{class:"footer-separator"},null,-1)),dVe={class:"footer-category-indicator"},pVe=["onClick"],hVe={key:2,class:"empty-message-full"},fVe={class:"empty-text"},LV=ml({__name:"FortalezasView",props:{teamInitials:{type:String,default:"CA"},title:{type:String,default:"Fortalezas a favor de mi equipo"},modelValue:{type:Array,default:()=>[]},teamLogoUrl:{type:String,required:!1,default:null},seasonId:{type:[String,Number],required:!0},teamId:{type:[String,Number],required:!0},token:{type:String,required:!0},totalFortalezas:{type:Number,default:15},rivalTeamId:{type:[String,Number],required:!1,default:null},gameId:{type:[String,Number],required:!1,default:null},templateType:{type:[String,Number],required:!1,default:1}},emits:["update:modelValue"],setup(e,{expose:a,emit:i}){const k=e,j=i,g=r.computed(()=>k.teamLogoUrl?k.teamLogoUrl:k.teamId?`https://golstatsimages.blob.core.windows.net/teams-80/${k.teamId}.png`:"https://golstatsimages.blob.core.windows.net/teams-80/2.png"),m=r.ref([...k.modelValue]),n=r.reactive({}),f=r.ref(!1),l=r.ref(null);r.watch(()=>k.modelValue,D=>{if(Array.isArray(D)){const H=JSON.stringify([...m.value].sort()),ne=JSON.stringify([...D].sort());H!==ne&&(m.value=[...D],Object.keys(n).forEach(B=>delete n[B]),m.value.forEach((B,re)=>{n[B]=re+1}))}},{immediate:!0,deep:!0});const t=r.ref(0),_=r.ref(null),b=r.ref(null),v=r.ref(0),h=r.ref(0);function o(){const D=_.value,H=b.value;v.value=D?D.clientWidth:0,h.value=H?H.scrollWidth:0}const s=r.computed(()=>Math.max(0,h.value-v.value)),p=r.computed(()=>t.value>0),c=r.computed(()=>t.value<s.value);function d(){const D=Math.min(s.value,t.value+200);t.value=D}function x(){const D=Math.max(0,t.value-200);t.value=D}let w=null;r.onMounted(()=>{o();const D=()=>o();window.addEventListener("resize",D),w=D,console.log("FetchFortalezas"),z()}),r.onBeforeUnmount(()=>{w&&(window.removeEventListener("resize",w),w=null)}),r.watch(()=>m.value.slice(),async()=>{await r.nextTick(),o()},{deep:!0}),r.watch(()=>[k.seasonId,k.teamId,k.gameId,k.token,k.templateType],()=>{z()},{immediate:!1});const S=r.computed(()=>m.value.map(D=>O.value.find(H=>H.id===D)).filter(Boolean).sort((D,H)=>n[D.id]-n[H.id])),V=r.computed(()=>({transform:`translateX(-${t.value}px)`})),O=r.ref([]),U=r.ref([]);async function z(){if(!k.seasonId||!k.teamId){console.warn("seasonId y teamId son requeridos para obtener las fortalezas");return}f.value=!0,l.value=null;try{let D;k.templateType===2?D=`https://5c9xc3gwh2.execute-api.us-east-2.amazonaws.com/prod/strengths/seasons/${k.seasonId}/postgames/${k.gameId}/teams/${k.teamId}`:D=`https://5c9xc3gwh2.execute-api.us-east-2.amazonaws.com/prod/strengths/seasons/${k.seasonId}/pregames/${k.gameId}/teams/${k.teamId}`;const H=await fetch(D,{method:"GET",headers:{Authorization:`${k.token}`,"Content-Type":"application/json"}});if(!H.ok)throw new Error(`Error al obtener fortalezas: ${H.status} ${H.statusText}`);const ne=await H.json();console.log("data: ",ne),console.log("nUEVO NUEVO dataaaaaa: ----------->",ne),U.value=ne.strengths||[],console.log("nUEVO NUEVO dataaaaaa:5555555555 ----------->",ne.strengths),O.value=ne.strengths.map(B=>({id:B.categories,name:B.name,value:B.total,category:B.category_type==1?"Ofensiva":B.category_type==2?"Defensiva":"Posesion",ranking:`#${B.league_ranking} en la liga`,color:L(B.category_type||"General")})),N()}catch(D){console.error("Error al cargar fortalezas:",D),l.value=D.message,O.value=[]}finally{f.value=!1}}function L(D){return{1:"#4CAF50",3:"#2196F3",2:"#00BCD4",General:"#9C27B0"}[D]||"#9C27B0"}const C=r.ref(["Todos"]),q=r.ref("Todos");function N(){const D=[...new Set(O.value.map(H=>H.category))];C.value=["Todos",...D]}const P=r.computed(()=>q.value==="Todos"?O.value:O.value.filter(D=>D.category===q.value));function T(D){const H=m.value.indexOf(D);if(H>-1)m.value.splice(H,1),delete n[D];else{if(m.value.length>=k.totalFortalezas)return;const ne=O.value.length,B=new Set(Object.values(n));let re=1;for(;B.has(re)&&re<=ne;)re++;n[D]=re,m.value.push(D)}j("update:modelValue",m.value)}function E(D){q.value=D}function R(D){const H=m.value.indexOf(D);H>-1&&(m.value.splice(H,1),delete n[D],j("update:modelValue",m.value))}function W(){const D=O.value.length,H=new Set(m.value),ne=new Set(Object.values(n)),B=[];for(let Y=1;Y<=D;Y++)ne.has(Y)||B.push(Y);B.sort((Y,$)=>Y-$);const re=P.value.map(Y=>Y.id).filter(Y=>!H.has(Y)),ee=k.totalFortalezas;for(const Y of re){if(m.value.length>=ee)break;const $=B.shift();if($===void 0)break;n[Y]=$,m.value.push(Y)}j("update:modelValue",m.value)}function K(){console.warn("Error loading team logo, falling back to initials")}function X(){console.warn("Error loading league logo")}return a({fortalezasData:O,fortalezasRawData:U,selectedFortalezas:m,selectionOrderMap:n,autocompletar:W}),(D,H)=>(r.openBlock(),r.createElementBlock("div",qNe,[r.createElementVNode("div",zNe,[r.createElementVNode("div",CNe,[r.createElementVNode("img",{src:g.value,alt:`Logo ${e.teamInitials}`,class:"team-logo",onError:K},null,40,PNe)]),r.createElementVNode("div",ENe,[r.createElementVNode("h3",FNe,r.toDisplayString(e.title),1),r.createElementVNode("p",RNe," Este template contiene "+r.toDisplayString(e.totalFortalezas)+" visualizaciones de Fortalezas. Selecciona las deseadas. ",1)])]),r.createElementVNode("div",MNe,[r.createElementVNode("div",jNe,[r.createElementVNode("div",{class:"segmented-highlight",style:r.normalizeStyle({width:`calc(100% / ${C.value.length})`,left:`calc(${C.value.indexOf(q.value)} * (100% / ${C.value.length}))`})},null,4),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C.value,ne=>(r.openBlock(),r.createElementBlock("button",{key:ne,class:r.normalizeClass(["categoria-tab",{active:q.value===ne}]),onClick:B=>E(ne)},r.toDisplayString(ne),11,WNe))),128))]),r.createElementVNode("div",KNe,[f.value?(r.openBlock(),r.createElementBlock("div",ANe,INe)):l.value?(r.openBlock(),r.createElementBlock("div",XNe,[r.createElementVNode("p",DNe,"Error al cargar las fortalezas: "+r.toDisplayString(l.value),1),r.createElementVNode("button",{onClick:z,class:"retry-button"},"Reintentar")])):(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:2},r.renderList(P.value,ne=>(r.openBlock(),r.createElementBlock("div",{key:ne.id,class:r.normalizeClass(["fortaleza-item",{selected:m.value.includes(ne.id),disabled:!m.value.includes(ne.id)&&m.value.length>=e.totalFortalezas}]),onClick:B=>T(ne.id)},[r.createElementVNode("div",{class:"fortaleza-checkbox",onClick:r.withModifiers(B=>!m.value.includes(ne.id)&&m.value.length>=e.totalFortalezas?null:T(ne.id),["stop"])},[r.createElementVNode("input",{type:"checkbox",checked:m.value.includes(ne.id),disabled:!m.value.includes(ne.id)&&m.value.length>=e.totalFortalezas,class:"checkbox-input",onClick:r.withModifiers(B=>!m.value.includes(ne.id)&&m.value.length>=e.totalFortalezas?null:T(ne.id),["stop"])},null,8,GNe),m.value.includes(ne.id)?(r.openBlock(),r.createElementBlock("span",ZNe,r.toDisplayString(n[ne.id]),1)):r.createCommentVNode("",!0)],8,BNe),r.createElementVNode("div",HNe,r.toDisplayString(ne.value),1),r.createElementVNode("div",YNe,[r.createElementVNode("div",QNe,r.toDisplayString(ne.name),1),r.createElementVNode("div",$Ne,[r.createElementVNode("span",null,r.toDisplayString(ne.ranking),1),r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/golstats2-tournaments/1.png",alt:"Liga",class:"league-logo",onError:X},null,32),eVe,r.createElementVNode("div",tVe,[r.createElementVNode("div",{class:"category-dot",style:r.normalizeStyle({backgroundColor:ne.color})},null,4),r.createElementVNode("span",null,r.toDisplayString(ne.category),1)])])])],10,JNe))),128))])]),r.createElementVNode("div",rVe,[m.value.length>0?(r.openBlock(),r.createElementBlock("div",nVe,[r.createElementVNode("div",aVe,r.toDisplayString(m.value.length)+"/"+r.toDisplayString(e.totalFortalezas),1)])):r.createCommentVNode("",!0),m.value.length>0?(r.openBlock(),r.createElementBlock("div",iVe,[r.createElementVNode("div",{class:"carousel-container",ref_key:"carouselContainerRef",ref:_},[p.value?(r.openBlock(),r.createElementBlock("button",{key:0,class:"carousel-arrow left",onClick:x},"‹")):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"carousel-track",ref_key:"carouselTrackRef",ref:b,style:r.normalizeStyle(V.value)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.value,ne=>(r.openBlock(),r.createElementBlock("div",{key:ne.id,class:"footer-pill"},[r.createElementVNode("div",oVe,r.toDisplayString(ne.value),1),r.createElementVNode("div",sVe,[r.createElementVNode("div",lVe,r.toDisplayString(ne.name),1),r.createElementVNode("div",cVe,[r.createElementVNode("span",null,r.toDisplayString(ne.ranking),1),r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/golstats2-tournaments/1.png",alt:"Liga",class:"footer-league-logo",onError:X},null,32),uVe,r.createElementVNode("div",dVe,[r.createElementVNode("div",{class:"footer-category-dot",style:r.normalizeStyle({backgroundColor:ne.color})},null,4),r.createElementVNode("span",null,r.toDisplayString(ne.category),1)])])]),r.createElementVNode("button",{class:"pill-remove-btn",onClick:B=>R(ne.id)},"×",8,pVe)]))),128))],4),c.value?(r.openBlock(),r.createElementBlock("button",{key:1,class:"carousel-arrow right",onClick:d},"›")):r.createCommentVNode("",!0)],512)])):(r.openBlock(),r.createElementBlock("div",hVe,[r.createElementVNode("span",fVe,r.toDisplayString(m.value.length)+" de "+r.toDisplayString(e.totalFortalezas)+" Fortalezas agregadas",1)]))])]))}},[["__scopeId","data-v-11f42e0a"]]),Q1=e=>(r.pushScopeId("data-v-a856f73c"),e=e(),r.popScopeId(),e),mVe={class:"corners-view"},yVe={class:"corners-header"},gVe={class:"team-logo-container"},vVe=["src","alt"],bVe={class:"header-content"},xVe={class:"corners-title"},wVe=Q1(()=>r.createElementVNode("p",{class:"corners-description"}," Este template contiene 10 visualizaciones de tiros de esquina. Selecciona los deseados. ",-1)),_Ve={class:"corners-container"},SVe={class:"matches-header"},TVe={class:"team-logos"},kVe={class:"logo"},NVe={class:"score"},VVe={class:"logo alt"},OVe={class:"meta"},LVe={class:"categorias-tabs segmented"},UVe=["onClick"],qVe={class:"corners-list"},zVe=["onClick"],CVe={class:"check-col"},PVe=["onClick"],EVe=["checked","disabled","onClick"],FVe={key:0,class:"selection-number"},RVe={class:"badge-col"},MVe={class:"count-badge"},jVe={class:"content-col"},WVe={class:"title-row"},KVe={class:"time"},AVe={class:"title"},IVe={class:"player"},XVe={class:"meta-row"},DVe=Q1(()=>r.createElementVNode("span",null,"Comba hacia afuera",-1)),JVe=Q1(()=>r.createElementVNode("span",{class:"dot"},null,-1)),BVe=Q1(()=>r.createElementVNode("div",{class:"separator"},null,-1)),GVe={class:"category-indicator"},ZVe={class:"corners-footer"},HVe={key:0,class:"counter-section"},YVe={class:"counter-text"},QVe={key:1,class:"carousel-section"},$Ve={class:"footer-badge"},eOe={class:"footer-content"},tOe={class:"footer-name"},rOe={class:"footer-ranking"},nOe=Q1(()=>r.createElementVNode("div",{class:"footer-separator"},null,-1)),aOe={class:"footer-category-indicator"},iOe=["onClick"],oOe={key:2,class:"empty-message-full"},sOe={class:"empty-text"},W5=148,UV=ml({__name:"TirosEsquinaView",props:{modelValue:{type:Array,default:()=>[]},rival:{type:Boolean,default:!1},teamInitials:{type:String,default:"AME"},title:{type:String,default:"Tiros de esquina en contra de mi equipo"},teamLogoUrl:{type:String,default:"https://golstatsimages.blob.core.windows.net/teams-80/2.png"}},emits:["update:modelValue"],setup(e,{expose:a,emit:i}){const k=e,j=i,g=["Todos","Ofensiva","Defensiva"],m=r.ref("Todos"),n=r.ref([...k.modelValue]),f=r.reactive({});n.value.forEach((ie,ue)=>{f[ie]=ue+1});const l=r.ref(0),t=r.ref(null),_=r.ref(null),b=r.ref(0),v=r.ref(0);function h(){const ie=t.value,ue=_.value;b.value=ie?ie.clientWidth:0,v.value=ue?ue.scrollWidth:0}const o=r.computed(()=>Math.max(0,v.value-b.value)),s=r.computed(()=>l.value>0),p=r.computed(()=>l.value<o.value);function c(){const ie=Math.min(o.value,l.value+200);l.value=ie}function d(){const ie=Math.max(0,l.value-200);l.value=ie}const x=r.computed(()=>n.value.map(ie=>H.value.find(ue=>ue.id===ie)).filter(Boolean).sort((ie,ue)=>f[ie.id]-f[ue.id])),w=r.computed(()=>({transform:`translateX(-${l.value}px)`})),S=r.ref([{id:1,home:"AME",away:"PUM",score:"4 - 1",jornada:"J11"},{id:2,home:"ASL",away:"AME",score:"0 - 1",jornada:"J10"},{id:3,home:"MTY",away:"AME",score:"2 - 0",jornada:"J9"},{id:4,home:"CAZ",away:"AME",score:"1 - 1",jornada:"J8"},{id:5,home:"AME",away:"LEO",score:"3 - 2",jornada:"J7"}]),V=r.ref(0),O=r.ref(null),U=r.ref(1),z=r.computed(()=>Math.max(0,S.value.length-U.value)),L=r.computed(()=>V.value>0),C=r.computed(()=>V.value<z.value),q=r.ref(!1),N=r.ref(0),P=r.ref(0);function T(){const ie=O.value,ue=ie?ie.clientWidth:0,he=Math.max(1,Math.floor(ue/(W5+10)));U.value=he}const E=r.computed(()=>{const ie=-V.value*(W5+10),ue=q.value?P.value:0;return{transform:`translateX(${ie+ue}px)`}});function R(){V.value=Math.min(z.value,V.value+1)}function W(){V.value=Math.max(0,V.value-1)}function K(ie){q.value=!0,N.value=ie.clientX,P.value=0}function X(ie){q.value&&(P.value=ie.clientX-N.value)}function D(){if(!q.value)return;const ie=W5/3;P.value<=-ie?R():P.value>=ie&&W(),q.value=!1,P.value=0}const H=r.ref([{id:1,order:"2/7",minute:"12:31",title:"Tiro de esquina",player:"Pedro Vite",wasGoal:!0,category:"Ofensiva",color:"#4CAF50"},{id:2,order:"4/7",minute:"33:41",title:"Tiro de esquina",player:"Pedro Vite",wasGoal:!1,category:"Defensiva",color:"#F44336"},{id:3,order:"6/7",minute:"62:21",title:"Tiro de esquina",player:"Pedro Vite",wasGoal:!1,category:"Ofensiva",color:"#4CAF50",disabled:!0}]),ne=r.computed(()=>m.value==="Todos"?H.value:H.value.filter(ie=>ie.category===m.value));function B(ie){const ue=H.value.find(ae=>ae.id===ie);if(ue!=null&&ue.disabled)return;const he=n.value.indexOf(ie);if(he>-1)n.value.splice(he,1),delete f[ie];else{const ae=H.value.length,de=new Set(Object.values(f));let ce=1;for(;de.has(ce)&&ce<=ae;)ce++;f[ie]=ce,n.value.push(ie)}j("update:modelValue",n.value)}function re(){const ie=H.value.length,ue=new Set(n.value),he=new Set(Object.values(f)),ae=[];for(let ce=1;ce<=ie;ce++)he.has(ce)||ae.push(ce);ae.sort((ce,ye)=>ce-ye);const de=ne.value.map(ce=>ce.id).filter(ce=>!ue.has(ce));for(const ce of de){const ye=ae.shift();if(ye===void 0)break;f[ce]=ye,n.value.push(ce)}j("update:modelValue",n.value)}function ee(ie){const ue=n.value.indexOf(ie);ue>-1&&(n.value.splice(ue,1),delete f[ie],j("update:modelValue",n.value))}function Y(){console.warn("Error loading team logo, falling back to initials")}let $=null;r.onMounted(()=>{h();const ie=()=>h();window.addEventListener("resize",ie),$=ie}),r.onBeforeUnmount(()=>{$&&(window.removeEventListener("resize",$),$=null)}),r.watch(()=>n.value.slice(),async()=>{await r.nextTick(),h()},{deep:!0});let le=null;return r.onMounted(()=>{T();const ie=()=>T();window.addEventListener("resize",ie),le=ie}),r.onBeforeUnmount(()=>{le&&(window.removeEventListener("resize",le),le=null)}),a({autocompletar:re}),(ie,ue)=>(r.openBlock(),r.createElementBlock("div",mVe,[r.createElementVNode("div",yVe,[r.createElementVNode("div",gVe,[r.createElementVNode("img",{src:e.teamLogoUrl,alt:`Logo ${e.teamInitials}`,class:"team-logo",onError:Y},null,40,vVe)]),r.createElementVNode("div",bVe,[r.createElementVNode("h3",xVe,r.toDisplayString(e.title),1),wVe])]),r.createElementVNode("div",_Ve,[r.createElementVNode("div",SVe,[r.createElementVNode("div",{class:"window",ref_key:"matchesWindowRef",ref:O,onPointerdown:K,onPointerup:D,onPointercancel:D,onPointerleave:D,onPointermove:X},[L.value?(r.openBlock(),r.createElementBlock("button",{key:0,class:"carousel-arrow left",onClick:W}," ‹ ")):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["track",{animating:!q.value}]),style:r.normalizeStyle(E.value)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.value,(he,ae)=>(r.openBlock(),r.createElementBlock("div",{key:he.id+"-"+ae,class:r.normalizeClass(["match-pill",{active:ae===V.value}])},[r.createElementVNode("div",TVe,[r.createElementVNode("div",kVe,r.toDisplayString(he.home),1),r.createElementVNode("span",NVe,r.toDisplayString(he.score),1),r.createElementVNode("div",VVe,r.toDisplayString(he.away),1)]),r.createElementVNode("div",OVe,r.toDisplayString(he.jornada),1)],2))),128))],6),C.value?(r.openBlock(),r.createElementBlock("button",{key:1,class:"carousel-arrow right",onClick:R}," › ")):r.createCommentVNode("",!0)],544)]),r.createElementVNode("div",LVe,[r.createElementVNode("div",{class:"segmented-highlight",style:r.normalizeStyle({width:`calc(100% / ${g.length})`,left:`calc(${g.indexOf(m.value)} * (100% / ${g.length}))`})},null,4),(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(g,he=>r.createElementVNode("button",{key:he,class:r.normalizeClass(["categoria-tab",{active:m.value===he}]),onClick:ae=>m.value=he},r.toDisplayString(he),11,UVe)),64))]),r.createElementVNode("div",qVe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(ne.value,he=>(r.openBlock(),r.createElementBlock("div",{key:he.id,class:r.normalizeClass(["corner-item",{selected:n.value.includes(he.id),disabled:he.disabled}]),onClick:ae=>!he.disabled&&B(he.id)},[r.createElementVNode("div",CVe,[r.createElementVNode("div",{class:"corner-checkbox",onClick:r.withModifiers(ae=>!he.disabled&&B(he.id),["stop"])},[r.createElementVNode("input",{type:"checkbox",checked:n.value.includes(he.id),disabled:he.disabled,class:"checkbox-input",onClick:r.withModifiers(ae=>!he.disabled&&B(he.id),["stop"])},null,8,EVe),n.value.includes(he.id)?(r.openBlock(),r.createElementBlock("span",FVe,r.toDisplayString(f[he.id]),1)):r.createCommentVNode("",!0)],8,PVe)]),r.createElementVNode("div",RVe,[r.createElementVNode("div",MVe,r.toDisplayString(he.order),1)]),r.createElementVNode("div",jVe,[r.createElementVNode("div",WVe,[r.createElementVNode("span",KVe,r.toDisplayString(he.minute),1),r.createElementVNode("span",AVe,r.toDisplayString(he.title),1),r.createElementVNode("span",IVe,"| "+r.toDisplayString(he.player),1)]),r.createElementVNode("div",XVe,[DVe,JVe,r.createElementVNode("span",null,"Rematado "+r.toDisplayString(he.wasGoal?"fue gol":"no fue gol"),1),BVe,r.createElementVNode("div",GVe,[r.createElementVNode("div",{class:"category-dot",style:r.normalizeStyle({backgroundColor:he.color||"#4CAF50"})},null,4),r.createElementVNode("span",null,r.toDisplayString(he.category),1)])])])],10,zVe))),128))])]),r.createElementVNode("div",ZVe,[n.value.length>0?(r.openBlock(),r.createElementBlock("div",HVe,[r.createElementVNode("div",YVe,r.toDisplayString(n.value.length)+"/10",1)])):r.createCommentVNode("",!0),n.value.length>0?(r.openBlock(),r.createElementBlock("div",QVe,[r.createElementVNode("div",{class:"carousel-container",ref_key:"carouselContainerRef",ref:t},[s.value?(r.openBlock(),r.createElementBlock("button",{key:0,class:"carousel-arrow left",onClick:d},"‹")):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"carousel-track",ref_key:"carouselTrackRef",ref:_,style:r.normalizeStyle(w.value)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(x.value,he=>(r.openBlock(),r.createElementBlock("div",{key:he.id,class:"footer-pill"},[r.createElementVNode("div",$Ve,r.toDisplayString(he.order),1),r.createElementVNode("div",eOe,[r.createElementVNode("div",tOe,r.toDisplayString(he.title),1),r.createElementVNode("div",rOe,[r.createElementVNode("span",null,r.toDisplayString(he.minute),1),r.createElementVNode("span",null,r.toDisplayString(he.player),1),nOe,r.createElementVNode("div",aOe,[r.createElementVNode("div",{class:"footer-category-dot",style:r.normalizeStyle({backgroundColor:he.color||"#4CAF50"})},null,4),r.createElementVNode("span",null,r.toDisplayString(he.category),1)])])]),r.createElementVNode("button",{class:"pill-remove-btn",onClick:ae=>ee(he.id)},"×",8,iOe)]))),128))],4),p.value?(r.openBlock(),r.createElementBlock("button",{key:1,class:"carousel-arrow right",onClick:c},"›")):r.createCommentVNode("",!0)],512)])):(r.openBlock(),r.createElementBlock("div",oOe,[r.createElementVNode("span",sOe,r.toDisplayString(n.value.length)+" de 10 Tiros de esquina agregados",1)]))])]))}},[["__scopeId","data-v-a856f73c"]]),Ip=e=>(r.pushScopeId("data-v-0052f835"),e=e(),r.popScopeId(),e),lOe={class:"modal-overlay"},cOe={class:"modal-content"},uOe={class:"modal-header"},dOe={class:"header-left"},pOe=Ip(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-report-white.svg",class:"icon-title",alt:"icono reporte blanco"},null,-1)),hOe={class:"modal-title"},fOe={class:"prepartido-text"},mOe={class:"step-counter"},yOe=Ip(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),gOe={key:0,class:"step-content"},vOe={key:0,class:"content-section"},bOe=Ip(()=>r.createElementVNode("h3",{class:"section-title"},"Fortalezas",-1)),xOe=Ip(()=>r.createElementVNode("div",{class:"title-separator"},null,-1)),wOe={class:"section-description"},_Oe=Ip(()=>r.createElementVNode("div",{class:"content-separator"},null,-1)),SOe={class:"radio-group"},TOe={class:"radio-option"},kOe=Ip(()=>r.createElementVNode("span",{class:"radio-custom"},null,-1)),NOe=Ip(()=>r.createElementVNode("span",{class:"radio-label"},"Automáticamente",-1)),VOe={class:"radio-option"},OOe=Ip(()=>r.createElementVNode("span",{class:"radio-custom"},null,-1)),LOe=Ip(()=>r.createElementVNode("span",{class:"radio-label"},"Manualmente",-1)),UOe={key:1,class:"step-content"},qOe={key:2,class:"step-content"},zOe={key:3,class:"step-content"},COe={key:4,class:"step-content"},POe=Ip(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),EOe={class:"modal-footer"},FOe=Ip(()=>r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M10 12L6 8L10 4",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),ROe={class:"footer-actions"},MOe=["disabled"],jOe=r.createStaticVNode('<div class="modal-header" data-v-0052f835><div class="header-left" data-v-0052f835><span class="modal-title" data-v-0052f835>Confirmación</span></div></div><div class="header-separator" data-v-0052f835></div><div class="modal-body" data-v-0052f835><div class="step-content" data-v-0052f835><h3 class="confirm-dialog-title" data-v-0052f835>¿Estás seguro de regresar?</h3><p class="confirm-dialog-message" data-v-0052f835>Se perderá la información seleccionada</p></div></div>',3),WOe=ml({__name:"ModalConfigurarContenido",props:{hasRival:{type:Boolean,default:!0},token:{type:String,required:!0},template:{type:Object,required:!1,default:null},team:{type:Number,required:!1,default:null},partido:{type:Object,required:!1,default:null}},emits:["close","back","next"],setup(e,{emit:a}){const i=a,k=e;function j(){if(!k.template||!k.template.pages)return!1;for(const E of k.template.pages)if(E.components&&Array.isArray(E.components)&&E.components.some(W=>W.title==="Fortalezas"||W.id===15||W.componentName==="GSCStrengths"))return!0;return!1}function g(){if(console.log("5555555555555555 Nuevo Valor al crear fortalezas:: : : :: : : : :: : : :",k.template),!k.template||!k.template.pages)return{equipo:0,rival:0,total:0};console.log("Nuevo Valor al crear fortalezas:: : : :: : : : :: : : :",k.template);let E=0,R=0;for(const W of k.template.pages)if(console.log("page 11 5555555555555555555555555555555555 ",W),W.components&&Array.isArray(W.components)){console.log("page entro");const K=W.components.filter(X=>X.componentName==="GSCStrengths"||X.id===15||X.name==="Fortalezas");console.log("componentesFortalezas componentesFortalezas componentesFortalezas",K);for(const X of K)X.dynamicFilters&&Array.isArray(X.dynamicFilters)&&X.dynamicFilters[1]&&(X.dynamicFilters[0]===1?E+=X.dynamicFilters[1]:X.dynamicFilters[0]===2?R+=X.dynamicFilters[1]:X.dynamicFilters[0]===3&&(X.filterMultiple.isHomeTeam?E+=X.dynamicFilters[1]:R+=X.dynamicFilters[1]))}return console.log("CONTADOR FINAL DE FORTALEZAS: ",{equipo:E,rival:R,total:E+R}),{equipo:E,rival:R,total:E+R}}const m=r.computed(()=>j()),n=r.computed(()=>g()),f=r.computed(()=>!k.template||!k.template.template_type||k.template.template_type===1?"Prepartido":"Postpartido"),l=r.ref(0),t=r.ref(!1),_=r.ref(!1),b=r.ref("manual"),v=r.ref("manual"),h=r.ref([]),o=r.ref([]),s=r.ref([]),p=r.ref([]),c=r.computed(()=>{let E=0;return m.value&&b.value==="manual"&&(n.value.equipo>0&&(E+=1),n.value.rival>0&&(E+=1)),Math.max(E,1)}),d=r.computed(()=>{var W,K;if(l.value===0)return m.value?b.value==="automatico"||b.value==="manual":!1;const R=x()[l.value];if(R==="fortalezasEquipo"){const X=w.value;if(!X)return!1;const D=h.value.length,H=n.value.equipo,ne=((W=X.fortalezasData)==null?void 0:W.length)||0;return D===H||ne>0&&ne<H&&D===ne}if(R==="fortalezasRival"){const X=S.value;if(!X)return!1;const D=o.value.length,H=n.value.rival,ne=((K=X.fortalezasData)==null?void 0:K.length)||0;return D===H||ne>0&&ne<H&&D===ne}return!1});function x(){const E=[];m.value&&b.value==="manual"&&(n.value.equipo>0&&E.push("fortalezasEquipo"),n.value.rival>0&&E.push("fortalezasRival"));const R={};return E.forEach((W,K)=>{R[K+1]=W}),R}const w=r.ref(null),S=r.ref(null),V=r.ref(null),O=r.ref(null);function U(){i("close")}function z(){l.value>1?l.value--:l.value===1?h.value.length>0||o.value.length>0?_.value=!0:l.value--:i("back")}function L(){h.value=[],o.value=[],s.value=[],p.value=[],_.value=!1,l.value--}function C(){_.value=!1}async function q(){if(l.value===0){if(!d.value)return;if(b.value==="automatico"){i("next",{fortalezas:b.value,tirosEsquina:v.value,selectedFortalezasEquipo:[],selectedFortalezasRival:[],strengthsPayload:{}});return}t.value=!0,setTimeout(()=>{l.value++,t.value=!1},300)}else if(l.value<c.value)t.value=!0,setTimeout(()=>{l.value++,t.value=!1},300);else{await r.nextTick();const E=N();console.log("Estructura de strengths emitida:",JSON.stringify(E,null,2)),i("next",{fortalezas:b.value,tirosEsquina:v.value,selectedFortalezasEquipo:h.value,selectedFortalezasRival:o.value,strengthsPayload:E})}}function N(){var ne;if(console.log("=== INICIANDO buildStrengthsPayload ==="),console.log("Template:",k.template),console.log("Template pages:",(ne=k.template)==null?void 0:ne.pages),!k.template||!k.template.pages)return console.warn("No hay template o pages"),{};const E={};console.log("selectedFortalezasEquipo:",h.value),console.log("selectedFortalezasRival:",o.value),console.log("fortalezasEquipoRef:",w.value),console.log("fortalezasRivalRef:",S.value);let R=w.value,W=S.value;if(R){console.log("equipoRef keys:",Object.keys(R)),console.log("equipoRef.fortalezasRawData:",R.fortalezasRawData),console.log("equipoRef.fortalezasRawData type:",typeof R.fortalezasRawData);let B=R.fortalezasRawData;B&&typeof B=="object"&&"value"in B&&(console.log("⚠️ fortalezasRawData es un ref, usando .value"),B=B.value),console.log("rawDataEquipo después de verificar ref:",B),console.log("rawDataEquipo is array:",Array.isArray(B)),Array.isArray(B)&&(console.log("rawDataEquipo length:",B.length),B.length>0&&console.log("Primer elemento equipoRef:",B[0]))}else console.error("❌ equipoRef NO está disponible");if(W){console.log("rivalRef keys:",Object.keys(W)),console.log("rivalRef.fortalezasRawData:",W.fortalezasRawData),console.log("rivalRef.fortalezasRawData type:",typeof W.fortalezasRawData);let B=W.fortalezasRawData;B&&typeof B=="object"&&"value"in B&&(console.log("⚠️ fortalezasRawData es un ref, usando .value"),B=B.value),console.log("rawDataRival después de verificar ref:",B),console.log("rawDataRival is array:",Array.isArray(B)),Array.isArray(B)&&(console.log("rawDataRival length:",B.length),B.length>0&&console.log("Primer elemento rivalRef:",B[0]))}else console.error("❌ rivalRef NO está disponible");!R&&h.value.length>0&&console.warn("⚠️ Ref de equipo no disponible, pero hay selecciones"),!W&&o.value.length>0&&console.warn("⚠️ Ref de rival no disponible, pero hay selecciones");const K=P(h.value,R),X=P(o.value,W);console.log("fortalezasEquipoOrdenadas:",K),console.log("fortalezasRivalOrdenadas:",X);let D=0,H=0;return k.template.pages.forEach((B,re)=>{const ee=re+1;console.log(`
4132
4132
  === Página ${ee} ===`),console.log("Page components:",B.components),B.components&&Array.isArray(B.components)&&(B.components.forEach((Y,$)=>{var ie,ue,he,ae,de,ce,ye,xe;if(Y.componentName==="GSCStrengths"||Y.id===15||Y.name==="Fortalezas"||Y.title==="Fortalezas"){const be=$+1;if(console.log(`
4133
4133
  --- Componente ${be} (Fortalezas) en página ${ee} ---`),console.log("Component:",Y),console.log("Component properties:",{name:Y.name,title:Y.title,componentName:Y.componentName,id:Y.id}),console.log("dynamicFilters:",Y.dynamicFilters),Y.dynamicFilters&&Array.isArray(Y.dynamicFilters)){const Te=Y.dynamicFilters[0],Oe=Y.dynamicFilters[1]||0;console.log(`Tipo: ${Te===1?"Equipo":Te===2?"Rival":"Dinámico (3)"}, Cantidad requerida: ${Oe}`);let Le=[],_e=[],Ce=k.team;Te===1?(_e=K,console.log(`Equipo: Total ordenadas=${_e.length}, index=${D}, cantidad requerida=${Oe}`),_e.length>D?(Le=_e.slice(D,D+Oe),console.log(`Index equipo: ${D}, tomando ${Le.length} fortalezas de ${_e.length} disponibles`)):console.warn(`No hay suficientes fortalezas de equipo. Disponibles: ${_e.length}, Necesarias desde índice: ${D}`),D+=Oe,Ce=((ie=k.partido)==null?void 0:ie.local)||((ue=k.partido)==null?void 0:ue.home_team)||k.team):Te===2?(_e=X,console.log(`Rival: Total ordenadas=${_e.length}, index=${H}, cantidad requerida=${Oe}`),_e.length>H?(Le=_e.slice(H,H+Oe),console.log(`Index rival: ${H}, tomando ${Le.length} fortalezas de ${_e.length} disponibles`)):console.warn(`No hay suficientes fortalezas de rival. Disponibles: ${_e.length}, Necesarias desde índice: ${H}`),H+=Oe,Ce=((he=k.partido)==null?void 0:he.visita)||((ae=k.partido)==null?void 0:ae.visiting_team)):Te===3&&(Y.filterMultiple&&Y.filterMultiple.isHomeTeam?(_e=K,console.log(`Dinámico (Equipo): Total ordenadas=${_e.length}, index=${D}, cantidad requerida=${Oe}`),_e.length>D?(Le=_e.slice(D,D+Oe),console.log(`Index equipo: ${D}, tomando ${Le.length} fortalezas de ${_e.length} disponibles`)):console.warn(`No hay suficientes fortalezas de equipo. Disponibles: ${_e.length}, Necesarias desde índice: ${D}`),D+=Oe,Ce=((de=k.partido)==null?void 0:de.local)||((ce=k.partido)==null?void 0:ce.home_team)||k.team):(_e=X,console.log(`Dinámico (Rival): Total ordenadas=${_e.length}, index=${H}, cantidad requerida=${Oe}`),_e.length>H?(Le=_e.slice(H,H+Oe),console.log(`Index rival: ${H}, tomando ${Le.length} fortalezas de ${_e.length} disponibles`)):console.warn(`No hay suficientes fortalezas de rival. Disponibles: ${_e.length}, Necesarias desde índice: ${H}`),H+=Oe,Ce=((ye=k.partido)==null?void 0:ye.visita)||((xe=k.partido)==null?void 0:xe.visiting_team))),console.log("fortalezasAsignar:",Le),Le.length>0?(E[ee]||(E[ee]={}),E[ee][be]||(E[ee][be]=[]),Le.forEach((Pe,Be)=>{E[ee][be].push({team_id:Ce,ranking_type:Pe.ranking_type||1,precondition_id:Pe.precondition_id||null,order:Be+1,name:Pe.name,category_type:Pe.category_type||1,total:Pe.total||0,is_relevant:Pe.is_relevant||0,league_ranking:Pe.league_ranking||0,categories:Array.isArray(Pe.categories)?Pe.categories:[Pe.categories],team_contribution:Pe.team_contribution||0})}),console.log(`✓ Agregadas ${Le.length} fortalezas al payload para componente ${be} en página ${ee}`),console.log(`Payload actual para página ${ee}:`,JSON.stringify(E[ee],null,2))):console.warn(`⚠️ No hay fortalezas para asignar al componente ${be} en página ${ee}. IndexEquipo: ${D}, IndexRival: ${H}`)}else console.warn(`⚠️ Componente ${$+1} en página ${ee} no tiene dynamicFilters válido`),console.warn("Component:",Y)}}),console.log(`
4134
4134
  ✓ Página ${ee} procesada. Componentes de Fortalezas encontrados y procesados.`))}),console.log(`
4135
- === PAYLOAD FINAL ===`),console.log(JSON.stringify(E,null,2)),E}function P(E,R){if(console.log("=== getOrderedStrengths INICIO ==="),console.log("selectedIds (orden de selección):",E),console.log("fortalezasViewRef existe?:",!!R),!E||E.length===0)return console.warn("No hay IDs seleccionados"),[];if(!R)return console.warn("Ref no disponible"),[];let W=R.fortalezasRawData;if(!W)return console.warn("fortalezasRawData no está disponible en el ref"),[];if(W&&typeof W=="object"&&"value"in W&&(console.log("⚠️ fortalezasRawData es un ref, accediendo a .value"),W=W.value),!Array.isArray(W))return console.warn("fortalezasRawData no es un array:",typeof W,W),[];if(W.length===0)return console.warn("fortalezasRawData está vacío"),[];console.log("fortalezasRawData length:",W.length),console.log("Primeras 2 fortalezas raw:",W.slice(0,2));const K=E.map(X=>{console.log(`Buscando ID: ${X} (tipo: ${typeof X})`);const D=W.find(ne=>{const B=ne.categories===X||ne.categories===Number(X)||String(ne.categories)===String(X);return!B&&W.indexOf(ne)<3&&console.log(` Comparando: item.categories=${ne.categories} (${typeof ne.categories}) vs id=${X} (${typeof X})`),B});if(D)return console.log(`✓ Encontrada: ${D.name} (categories: ${D.categories})`),D;console.warn(`✗ No encontrada con categories = ${X}, intentando por id`);const H=W.find(ne=>ne.id===X||ne.id===Number(X)||String(ne.id)===String(X));return H?(console.log(`✓ Encontrada por id: ${H.name}`),H):(console.error(`✗✗ No se encontró fortaleza con id/categories = ${X}`),null)}).filter(Boolean);return console.log(`selectedStrengths (${K.length} de ${E.length} encontradas):`,K),console.log("=== getOrderedStrengths FIN ==="),K}function T(){const R=x()[l.value];if(R==="fortalezasEquipo"&&w.value)return w.value.autocompletar();if(R==="fortalezasRival"&&S.value)return S.value.autocompletar();if(R==="cornersEquipo"&&V.value)return V.value.autocompletar();if(R==="cornersRival"&&O.value)return O.value.autocompletar()}return(E,R)=>{var W,K,X,D,H,ne,B,re,ee,Y,$,le,ie,ue,he,ae;return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",lOe,[r.createElementVNode("div",cOe,[r.createElementVNode("div",uOe,[r.createElementVNode("div",dOe,[pOe,r.createElementVNode("span",hOe,[r.createTextVNode("Generar reporte  -   "),r.createElementVNode("span",fOe,r.toDisplayString(f.value),1)])]),r.createElementVNode("div",mOe," Paso "+r.toDisplayString(l.value===0?1:l.value)+" de "+r.toDisplayString(c.value),1)]),yOe,r.createElementVNode("div",{class:r.normalizeClass(["modal-body",{transitioning:t.value}])},[l.value===0?(r.openBlock(),r.createElementBlock("div",gOe,[m.value?(r.openBlock(),r.createElementBlock("div",vOe,[bOe,xOe,r.createElementVNode("p",wOe," Este template contiene "+r.toDisplayString(n.value.equipo)+" visualizaciones de Fortalezas de tu equipo y "+r.toDisplayString(n.value.rival)+" de tu rival. ¿Cómo prefieres que se agregue este contenido? ",1),_Oe,r.createElementVNode("div",SOe,[r.createElementVNode("label",TOe,[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"fortalezas",value:"automatico","onUpdate:modelValue":R[0]||(R[0]=de=>b.value=de)},null,512),[[r.vModelRadio,b.value]]),kOe,NOe]),r.createElementVNode("label",VOe,[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"fortalezas",value:"manual","onUpdate:modelValue":R[1]||(R[1]=de=>b.value=de)},null,512),[[r.vModelRadio,b.value]]),OOe,LOe])])])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),n.value.equipo>0?r.withDirectives((r.openBlock(),r.createElementBlock("div",UOe,[r.createVNode(LV,{key:"fortalezas-equipo",modelValue:h.value,"onUpdate:modelValue":R[2]||(R[2]=de=>h.value=de),"team-initials":"AME","season-id":(W=k.partido)==null?void 0:W.season_id,"team-id":((K=k.partido)==null?void 0:K.local)||((X=k.partido)==null?void 0:X.home_team),"rival-team-id":((D=k.partido)==null?void 0:D.visita)||((H=k.partido)==null?void 0:H.visiting_team),"game-id":((ne=k.partido)==null?void 0:ne.game_id)||((B=k.partido)==null?void 0:B.id),token:k.token,"template-type":((re=k.template)==null?void 0:re.template_type)||1,title:"Fortalezas a favor de mi equipo","total-fortalezas":n.value.equipo,ref_key:"fortalezasEquipoRef",ref:w},null,8,["modelValue","season-id","team-id","rival-team-id","game-id","token","template-type","total-fortalezas"])],512)),[[r.vShow,x()[l.value]==="fortalezasEquipo"]]):r.createCommentVNode("",!0),n.value.rival>0?r.withDirectives((r.openBlock(),r.createElementBlock("div",qOe,[r.createVNode(LV,{key:"fortalezas-rival",modelValue:o.value,"onUpdate:modelValue":R[3]||(R[3]=de=>o.value=de),"team-initials":"RIV","season-id":(ee=k.partido)==null?void 0:ee.season_id,"team-id":((Y=k.partido)==null?void 0:Y.visita)||(($=k.partido)==null?void 0:$.visiting_team),"rival-team-id":((le=k.partido)==null?void 0:le.local)||((ie=k.partido)==null?void 0:ie.home_team),"game-id":((ue=k.partido)==null?void 0:ue.game_id)||((he=k.partido)==null?void 0:he.id),token:k.token,"template-type":((ae=k.template)==null?void 0:ae.template_type)||1,title:"Fortalezas a favor del rival","total-fortalezas":n.value.rival,ref_key:"fortalezasRivalRef",ref:S},null,8,["modelValue","season-id","team-id","rival-team-id","game-id","token","template-type","total-fortalezas"])],512)),[[r.vShow,x()[l.value]==="fortalezasRival"]]):r.createCommentVNode("",!0),x()[l.value]==="cornersEquipo"?(r.openBlock(),r.createElementBlock("div",zOe,[r.createVNode(UV,{modelValue:s.value,"onUpdate:modelValue":R[4]||(R[4]=de=>s.value=de),rival:!1,"team-initials":"AME",title:"Tiros de esquina en contra de mi equipo","team-logo-url":"https://golstatsimages.blob.core.windows.net/teams-80/2.png",ref_key:"cornersEquipoRef",ref:V},null,8,["modelValue"])])):r.createCommentVNode("",!0),x()[l.value]==="cornersRival"?(r.openBlock(),r.createElementBlock("div",COe,[r.createVNode(UV,{modelValue:p.value,"onUpdate:modelValue":R[5]||(R[5]=de=>p.value=de),rival:!0,"team-initials":"RIV",title:"Tiros de esquina en contra del rival","team-logo-url":"https://golstatsimages.blob.core.windows.net/teams-80/1.png",ref_key:"cornersRivalRef",ref:O},null,8,["modelValue"])])):r.createCommentVNode("",!0)],2),POe,r.createElementVNode("div",EOe,[r.createElementVNode("button",{class:"back-btn",onClick:z},[FOe,r.createTextVNode(" Regresar ")]),r.createElementVNode("div",ROe,[l.value===0?(r.openBlock(),r.createElementBlock("button",{key:0,class:"cancel-btn",onClick:U},"Cancelar")):r.createCommentVNode("",!0),l.value===1||l.value===2?(r.openBlock(),r.createElementBlock("button",{key:1,class:"cancel-btn",onClick:T}," Autocompletar ")):r.createCommentVNode("",!0),r.createElementVNode("button",{class:r.normalizeClass(["next-btn",{disabled:!d.value}]),disabled:!d.value,onClick:q},r.toDisplayString(l.value===0?b.value==="automatico"?"Finalizar":"Siguiente":l.value===c.value?"Finalizar":"Siguiente"),11,MOe)])])])]),_.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"modal-overlay",onClick:r.withModifiers(C,["self"])},[r.createElementVNode("div",{class:"modal-content confirm-dialog"},[jOe,r.createElementVNode("div",{class:"modal-footer"},[r.createElementVNode("div",{class:"footer-actions"},[r.createElementVNode("button",{class:"cancel-btn",onClick:C},"Cancelar"),r.createElementVNode("button",{class:"next-btn",onClick:L},"Confirmar")])])])])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-6b708ebe"]]),z2=e=>(r.pushScopeId("data-v-e7ddb7cc"),e=e(),r.popScopeId(),e),KOe={class:"templates-header"},AOe={class:"count"},IOe={key:0,class:"sort-options"},XOe=["onClick"],DOe={key:0,class:"checkmark"},JOe=[z2(()=>r.createElementVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M5 10.5L9 14.5L15 7.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],BOe={key:0,class:"loading-state"},GOe=[z2(()=>r.createElementVNode("div",{class:"loading-spinner"},null,-1)),z2(()=>r.createElementVNode("p",null,"Cargando templates...",-1))],ZOe=[z2(()=>r.createElementVNode("div",{class:"inner-card"},[r.createElementVNode("div",{class:"plus"},[r.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-add@3x.png",alt:"Agregar"})]),r.createElementVNode("div",{class:"create-text"},"Crear Template")],-1))],HOe=ml({__name:"TemplatesSection",props:{userId:{type:Number,required:!0},team:{type:Number,required:!0},token:{type:String,required:!0},searchQuery:{type:String,default:""}},emits:["switch-to-reports","open-modal-new-template","edit-template"],setup(e,{expose:a,emit:i}){const k=i,j=e,g=r.ref(!1),m=r.ref(null),n=r.ref(!1),f=r.ref(!1),l=r.ref(!1),t=r.ref(!1),_=r.ref(!1),b=r.ref(!1),v=r.ref(null),h=r.ref(!1),o=r.ref(""),s=r.ref(""),p=r.ref(""),c=r.ref(""),d=r.ref(""),x=r.ref(""),w=r.ref(""),S=r.ref(""),V=r.ref(""),O=r.ref(null),U=r.ref(null),z=r.ref(null),L=r.ref(null),C=r.ref(0),q=r.ref([]),N=r.ref(!1),P=r.ref(null);r.watch([()=>j.team,()=>j.token],()=>{j.team&&j.token&&E()},{immediate:!1});const T=[{label:"A - Z",value:"name-asc"},{label:"Más recientes",value:"date-desc"}],E=async()=>{try{N.value=!0,P.value=null;const ue=await es.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates/teams/${j.team}`,{headers:{Authorization:`${j.token}`,"Content-Type":"application/json"}});ue.data&&Array.isArray(ue.data)?q.value=ue.data:ue.data&&ue.data.templates?q.value=ue.data.templates:ue.data&&ue.data.data?q.value=ue.data.data:q.value=[]}catch(ue){console.error("Error al obtener templates:",ue),console.error("Error response:",ue.response),P.value=ue.message||"Error al cargar los templates",q.value=[]}finally{N.value=!1}},R=r.computed(()=>{if(!q.value.length)return[];let ue=[...q.value];if(j.searchQuery.trim()){const he=j.searchQuery.toLowerCase().trim();ue=ue.filter(ae=>ae.name.toLowerCase().includes(he))}switch(m.value){case"name-asc":return ue.sort((he,ae)=>he.name.localeCompare(ae.name));case"date-desc":return ue.sort((he,ae)=>new Date(ae.created_at)-new Date(he.created_at));default:return ue}}),W=r.computed(()=>{if(!C.value)return"grid-1-column";const ue=340,he=20,de=C.value-40,ce=Math.floor((de+he)/(ue+he)),ye=Math.max(1,ce);return ye>=4?"grid-4-columns":ye>=3?"grid-3-columns":ye>=2?"grid-2-columns":"grid-1-column"}),K=()=>{g.value=!g.value},X=ue=>{m.value=ue,g.value=!1},D=ue=>{const he=T.find(ae=>ae.value===ue);return he?he.label:null},H=ue=>{g.value&&U.value&&!U.value.contains(ue.target)&&(g.value=!1)},ne=()=>{z.value&&(C.value=z.value.offsetWidth)};function B(ue){k("edit-template",ue)}function re(){f.value=!1,h.value=!1}function ee(ue){v.value=ue,f.value=!1,h.value=!1,b.value=!0}function Y(){b.value=!1,f.value=!0}async function $(ue){var he,ae,de,ce,ye,xe,be,Te;try{if(b.value=!1,!v.value)return;const Oe={template_id:v.value.template.id,user_id:j.userId,tournament_id:v.value.liga.id||1,tournament_name:v.value.liga.name,season_id:v.value.partido.season_id,season_name:((he=v.value.torneo)==null?void 0:he.name)||"",game_id:v.value.partido.id||v.value.partido.game_id},Le=await es.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${j.userId}/reports`,Oe,{headers:{Authorization:j.token,"Content-Type":"application/json"}}),_e=((ae=Le.data)==null?void 0:ae.id)||((de=Le.data)==null?void 0:de.report_id)||((ye=(ce=Le.data)==null?void 0:ce.data)==null?void 0:ye.id)||((be=(xe=Le.data)==null?void 0:xe.data)==null?void 0:be.report_id);if(console.log("Report ID obtenido:",_e),console.log("Strengths Payload recibido:",ue==null?void 0:ue.strengthsPayload),ue!=null&&ue.strengthsPayload&&Object.keys(ue.strengthsPayload).length>0&&_e)try{console.log("Enviando strengths al endpoint...");const Ce=await es.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${j.userId}/reports/${_e}/strengths`,ue.strengthsPayload,{headers:{Authorization:j.token,"Content-Type":"application/json"}});console.log("Strengths guardados exitosamente:",Ce.data)}catch(Ce){console.error("Error al guardar las fortalezas:",Ce),console.error("Error response:",(Te=Ce.response)==null?void 0:Te.data)}else console.warn("No se enviaron strengths porque:",{hasPayload:!!(ue!=null&&ue.strengthsPayload),payloadKeys:ue!=null&&ue.strengthsPayload?Object.keys(ue.strengthsPayload).length:0,hasReportId:!!_e});k("switch-to-reports"),v.value=null}catch(Oe){console.error("Error al generar el reporte:",Oe),Oe.response&&Oe.response.status===409?v.value&&(w.value=v.value.template.id,V.value=v.value.template.template_type,O.value=v.value.template,h.value=!0,await r.nextTick(),f.value=!0):alert("Error al generar el reporte. Por favor, intenta de nuevo.")}}let le=null;r.onMounted(async()=>{document.addEventListener("mousedown",H),await r.nextTick(),ne(),window.ResizeObserver?(le=new ResizeObserver(()=>{ne()}),z.value&&le.observe(z.value)):window.addEventListener("resize",ne),E()});function ie(ue){k("open-modal-new-template",ue)}return r.onBeforeUnmount(()=>{document.removeEventListener("mousedown",H),le?le.disconnect():window.removeEventListener("resize",ne)}),a({obtenerTemplates:E}),(ue,he)=>{var ae,de;return r.openBlock(),r.createElementBlock("div",{class:"templates-section",ref_key:"templatesSectionRef",ref:z},[r.createElementVNode("div",KOe,[r.createElementVNode("span",null,[r.createTextVNode("Templates "),r.createElementVNode("span",AOe,"("+r.toDisplayString(R.value.length)+")",1)]),r.createElementVNode("div",{class:"sort-dropdown",ref_key:"sortDropdownRef",ref:U},[r.createElementVNode("button",{class:"sort-button",onClick:K},[r.createTextVNode(r.toDisplayString(D(m.value)||"Ordenar")+" ",1),r.createElementVNode("span",{class:r.normalizeClass(["dropdown-arrow",{rotated:g.value}])},null,2)]),g.value?(r.openBlock(),r.createElementBlock("div",IOe,[(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(T,ce=>r.createElementVNode("div",{key:ce.value,class:r.normalizeClass(["sort-option",{selected:m.value===ce.value}]),onClick:ye=>X(ce.value)},[r.createElementVNode("span",null,r.toDisplayString(ce.label),1),m.value===ce.value?(r.openBlock(),r.createElementBlock("span",DOe,JOe)):r.createCommentVNode("",!0)],10,XOe)),64))])):r.createCommentVNode("",!0)],512)]),N.value?(r.openBlock(),r.createElementBlock("div",BOe,GOe)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["templates-list",W.value]),ref_key:"templatesListRef",ref:L},[r.createElementVNode("div",{class:"template-card create",onClick:he[0]||(he[0]=ce=>n.value=!0)},ZOe),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(R.value,ce=>(r.openBlock(),r.createBlock(O8e,{key:ce.id,template:ce,"user-id":e.userId,onGenerarReporte:ye=>{w.value=ce.id,V.value=ce.template_type,O.value=ce,f.value=!0},onRenombrar:ye=>{S.value=ce.id,o.value=ye,s.value=ce.template_type,l.value=!0},onDuplicar:ye=>{x.value=ce.id,p.value=ye,t.value=!0},onEliminar:ye=>{c.value=ye.name,d.value=ye.id,_.value=!0},onEditTemplate:B},null,8,["template","user-id","onGenerarReporte","onRenombrar","onDuplicar","onEliminar"]))),128))],2)),n.value?(r.openBlock(),r.createBlock(OV,{key:2,token:e.token,team:e.team,onClose:he[1]||(he[1]=ce=>n.value=!1),onOpenModalNewTemplate:ie},null,8,["token","team"])):r.createCommentVNode("",!0),f.value?(r.openBlock(),r.createBlock(G9e,{key:3,"user-id":e.userId,token:e.token,team:e.team,"template-id":w.value,"template-type":V.value,template:O.value,"show-error409-on-mount":h.value,onClose:re,onSwitchToReports:he[2]||(he[2]=ce=>ue.$emit("switch-to-reports")),onOpenConfigurarContenido:ee},null,8,["user-id","token","team","template-id","template-type","template","show-error409-on-mount"])):r.createCommentVNode("",!0),b.value?(r.openBlock(),r.createBlock(WOe,{key:4,"has-rival":!0,token:e.token,template:((ae=v.value)==null?void 0:ae.template)||null,team:e.team,partido:((de=v.value)==null?void 0:de.partido)||null,onClose:he[3]||(he[3]=ce=>b.value=!1),onBack:Y,onNext:$},null,8,["token","template","team","partido"])):r.createCommentVNode("",!0),l.value?(r.openBlock(),r.createBlock(uNe,{key:5,initialName:o.value,token:e.token,"template-id":S.value,"template-type":s.value,"user-id":e.userId,onRefresh:he[4]||(he[4]=ce=>E()),onClose:he[5]||(he[5]=ce=>l.value=!1),onRename:he[6]||(he[6]=ce=>{l.value=!1})},null,8,["initialName","token","template-id","template-type","user-id"])):r.createCommentVNode("",!0),t.value?(r.openBlock(),r.createBlock(_Ne,{key:6,initialName:p.value,token:e.token,"template-id":x.value,onClose:he[7]||(he[7]=ce=>t.value=!1),onTemplateDuplicated:he[8]||(he[8]=ce=>{t.value=!1,E()})},null,8,["initialName","token","template-id"])):r.createCommentVNode("",!0),_.value?(r.openBlock(),r.createBlock(UNe,{key:7,"template-id":d.value,"user-id":e.userId,token:e.token,onClose:he[9]||(he[9]=ce=>_.value=!1),onTemplateDeleted:he[10]||(he[10]=ce=>{_.value=!1,E()})},null,8,["template-id","user-id","token"])):r.createCommentVNode("",!0)],512)}}},[["__scopeId","data-v-e7ddb7cc"]]),K5=e=>(r.pushScopeId("data-v-d17eb1eb"),e=e(),r.popScopeId(),e),YOe={class:"tooltip-report-options"},QOe=K5(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename.svg",alt:"Renombrar reporte",class:"icon"},null,-1)),$Oe=K5(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-download.svg",alt:"Descargar reporte",class:"icon"},null,-1)),eLe=K5(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-delete.svg",alt:"Eliminar reporte",class:"icon"},null,-1)),tLe=ml({__name:"TooltipReportOptions",emits:["ver-reporte","renombrar","editar","duplicar","descargar","eliminar"],setup(e,{emit:a}){return(i,k)=>(r.openBlock(),r.createElementBlock("div",YOe,[r.createElementVNode("ul",null,[r.createElementVNode("li",{class:"option",onClick:k[0]||(k[0]=j=>i.$emit("renombrar"))},[QOe,r.createTextVNode(" Renombrar reporte ")]),r.createElementVNode("li",{class:"option",onClick:k[1]||(k[1]=j=>i.$emit("descargar"))},[$Oe,r.createTextVNode(" Descargar reporte ")]),r.createElementVNode("li",{class:"option",onClick:k[2]||(k[2]=j=>i.$emit("eliminar"))},[eLe,r.createTextVNode(" Eliminar reporte ")])])]))}},[["__scopeId","data-v-d17eb1eb"]]);function Kh(e){if(!e)return"";const a=new Date(e);if(isNaN(a.getTime()))return"";const i=a.getDate(),k=a.toLocaleDateString("es-ES",{month:"short"}),j=a.getFullYear();return`${i} ${k}, ${j}`}const rLe=e=>(r.pushScopeId("data-v-bb7e7ba7"),e=e(),r.popScopeId(),e),nLe={class:"prematch-bg"},aLe={class:"background-shields"},iLe={class:"shield-left"},oLe=["src"],sLe={class:"shield-right"},lLe=["src"],cLe=rLe(()=>r.createElementVNode("div",{class:"title"},[r.createTextVNode("Análisis "),r.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),uLe={class:"subtitle"},dLe={class:"jornada"},pLe={class:"fecha"},hLe={class:"teams-row"},fLe={class:"team team-local"},mLe={class:"escudo-svg"},yLe=["src"],gLe={class:"team-name"},vLe={class:"team team-visitor"},bLe={class:"escudo-svg"},xLe=["src"],wLe={class:"team-name"},_Le=ml({__name:"AnalisisPrematchType1",props:{report:{type:Object,default:()=>({})}},setup(e){function a(k){return k?k.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 i=e;return(k,j)=>(r.openBlock(),r.createElementBlock("div",nLe,[r.createElementVNode("div",aLe,[r.createElementVNode("div",iLe,[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+i.report.game.home_team+".png",alt:"Escudo local"},null,8,oLe)]),r.createElementVNode("div",sLe,[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+i.report.game.visiting_team+".png",alt:"Escudo visitante"},null,8,lLe)])]),cLe,r.createElementVNode("div",uLe,[r.createElementVNode("span",dLe,r.toDisplayString(a(i.report.game.matchday_name)),1),r.createElementVNode("span",pLe," - "+r.toDisplayString(r.unref(Kh)(i.report.game.date_time_utc)),1)]),r.createElementVNode("div",hLe,[r.createElementVNode("div",fLe,[r.createElementVNode("span",mLe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+i.report.game.home_team+".png"},null,8,yLe)]),r.createElementVNode("span",gLe,r.toDisplayString(i.report.game.home_team_acronym),1)]),r.createElementVNode("div",vLe,[r.createElementVNode("span",bLe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+i.report.game.visiting_team+".png"},null,8,xLe)]),r.createElementVNode("span",wLe,r.toDisplayString(i.report.game.visiting_team_acronym),1)])])]))}},[["__scopeId","data-v-bb7e7ba7"]]),ty=e=>(r.pushScopeId("data-v-7dd14646"),e=e(),r.popScopeId(),e),SLe={class:"prematch-bg"},TLe={class:"background-shields"},kLe={class:"shield-left"},NLe=["src"],VLe={class:"shield-right"},OLe=["src"],LLe=ty(()=>r.createElementVNode("div",{class:"title"},[r.createTextVNode("Análisis "),r.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),ULe={class:"subtitle"},qLe={class:"jornada"},zLe={class:"fecha"},CLe={class:"teams-grid"},PLe={class:"row row-top"},ELe={class:"team team-local"},FLe={class:"escudo-svg"},RLe=["src"],MLe={class:"team-name"},jLe={class:"score"},WLe={class:"score-text"},KLe={class:"team team-visitor"},ALe={class:"team-name"},ILe={class:"escudo-svg"},XLe=["src"],DLe={class:"row row-bottom"},JLe={class:"team-stats"},BLe=r.createStaticVNode('<span class="stat ball" data-v-7dd14646><svg width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-7dd14646><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-7dd14646></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-7dd14646></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-7dd14646></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-7dd14646></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-7dd14646></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-7dd14646></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-7dd14646></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path></svg></span>',1),GLe={class:"stat red"},ZLe=ty(()=>r.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})],-1)),HLe={class:"stat-number"},YLe={class:"stat yellow"},QLe=ty(()=>r.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})],-1)),$Le={class:"stat-number"},eUe=ty(()=>r.createElementVNode("div",{class:"empty"},null,-1)),tUe={class:"team-stats"},rUe={class:"stat-number"},nUe=ty(()=>r.createElementVNode("span",{class:"stat yellow"},[r.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})])],-1)),aUe={class:"stat-number"},iUe=ty(()=>r.createElementVNode("span",{class:"stat red"},[r.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})])],-1)),oUe=r.createStaticVNode('<span class="stat ball" data-v-7dd14646><svg width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-7dd14646><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-7dd14646></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-7dd14646></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-7dd14646></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-7dd14646></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-7dd14646></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-7dd14646></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-7dd14646></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-7dd14646></path></svg></span>',1),sUe=ml({__name:"AnalisisPostMatchType1",props:{report:{type:Object,default:()=>({})}},setup(e){function a(l){return l?l.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 i=e,k=r.computed(()=>{var _,b,v;const l=(v=(b=(_=i.report)==null?void 0:_.game)==null?void 0:b.minutes)==null?void 0:v.home_goals_minutes;if(!Array.isArray(l)||l.length===0)return null;const t=l.map(h=>{const o=h.match(/(\d+)'$/);return o?o[1]+"'":""}).filter(h=>h!=="");if(t.length>5){const h=t.slice(0,5).join(", "),o=t.slice(5).join(", ");return`${h}
4135
+ === PAYLOAD FINAL ===`),console.log(JSON.stringify(E,null,2)),E}function P(E,R){if(console.log("=== getOrderedStrengths INICIO ==="),console.log("selectedIds (orden de selección):",E),console.log("fortalezasViewRef existe?:",!!R),!E||E.length===0)return console.warn("No hay IDs seleccionados"),[];if(!R)return console.warn("Ref no disponible"),[];let W=R.fortalezasRawData;if(!W)return console.warn("fortalezasRawData no está disponible en el ref"),[];if(W&&typeof W=="object"&&"value"in W&&(console.log("⚠️ fortalezasRawData es un ref, accediendo a .value"),W=W.value),!Array.isArray(W))return console.warn("fortalezasRawData no es un array:",typeof W,W),[];if(W.length===0)return console.warn("fortalezasRawData está vacío"),[];console.log("fortalezasRawData length:",W.length),console.log("Primeras 2 fortalezas raw:",W.slice(0,2));const K=E.map(X=>{console.log(`Buscando ID: ${X} (tipo: ${typeof X})`);const D=W.find(ne=>{const B=ne.categories===X||ne.categories===Number(X)||String(ne.categories)===String(X);return!B&&W.indexOf(ne)<3&&console.log(` Comparando: item.categories=${ne.categories} (${typeof ne.categories}) vs id=${X} (${typeof X})`),B});if(D)return console.log(`✓ Encontrada: ${D.name} (categories: ${D.categories})`),D;console.warn(`✗ No encontrada con categories = ${X}, intentando por id`);const H=W.find(ne=>ne.id===X||ne.id===Number(X)||String(ne.id)===String(X));return H?(console.log(`✓ Encontrada por id: ${H.name}`),H):(console.error(`✗✗ No se encontró fortaleza con id/categories = ${X}`),null)}).filter(Boolean);return console.log(`selectedStrengths (${K.length} de ${E.length} encontradas):`,K),console.log("=== getOrderedStrengths FIN ==="),K}function T(){const R=x()[l.value];if(R==="fortalezasEquipo"&&w.value)return w.value.autocompletar();if(R==="fortalezasRival"&&S.value)return S.value.autocompletar();if(R==="cornersEquipo"&&V.value)return V.value.autocompletar();if(R==="cornersRival"&&O.value)return O.value.autocompletar()}return(E,R)=>{var W,K,X,D,H,ne,B,re,ee,Y,$,le,ie,ue,he,ae;return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",lOe,[r.createElementVNode("div",cOe,[r.createElementVNode("div",uOe,[r.createElementVNode("div",dOe,[pOe,r.createElementVNode("span",hOe,[r.createTextVNode("Generar reporte  -   "),r.createElementVNode("span",fOe,r.toDisplayString(f.value),1)])]),r.createElementVNode("div",mOe," Paso "+r.toDisplayString(l.value===0?1:l.value)+" de "+r.toDisplayString(c.value),1)]),yOe,r.createElementVNode("div",{class:r.normalizeClass(["modal-body",{transitioning:t.value}])},[l.value===0?(r.openBlock(),r.createElementBlock("div",gOe,[m.value?(r.openBlock(),r.createElementBlock("div",vOe,[bOe,xOe,r.createElementVNode("p",wOe," Este template contiene "+r.toDisplayString(n.value.equipo)+" visualizaciones de Fortalezas de tu equipo y "+r.toDisplayString(n.value.rival)+" de tu rival. ¿Cómo prefieres que se agregue este contenido? ",1),_Oe,r.createElementVNode("div",SOe,[r.createElementVNode("label",TOe,[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"fortalezas",value:"automatico","onUpdate:modelValue":R[0]||(R[0]=de=>b.value=de)},null,512),[[r.vModelRadio,b.value]]),kOe,NOe]),r.createElementVNode("label",VOe,[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"fortalezas",value:"manual","onUpdate:modelValue":R[1]||(R[1]=de=>b.value=de)},null,512),[[r.vModelRadio,b.value]]),OOe,LOe])])])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),n.value.equipo>0?r.withDirectives((r.openBlock(),r.createElementBlock("div",UOe,[r.createVNode(LV,{key:"fortalezas-equipo",modelValue:h.value,"onUpdate:modelValue":R[2]||(R[2]=de=>h.value=de),"team-initials":"AME","season-id":(W=k.partido)==null?void 0:W.season_id,"team-id":((K=k.partido)==null?void 0:K.local)||((X=k.partido)==null?void 0:X.home_team),"rival-team-id":((D=k.partido)==null?void 0:D.visita)||((H=k.partido)==null?void 0:H.visiting_team),"game-id":((ne=k.partido)==null?void 0:ne.game_id)||((B=k.partido)==null?void 0:B.id),token:k.token,"template-type":((re=k.template)==null?void 0:re.template_type)||1,title:"Fortalezas a favor de mi equipo","total-fortalezas":n.value.equipo,ref_key:"fortalezasEquipoRef",ref:w},null,8,["modelValue","season-id","team-id","rival-team-id","game-id","token","template-type","total-fortalezas"])],512)),[[r.vShow,x()[l.value]==="fortalezasEquipo"]]):r.createCommentVNode("",!0),n.value.rival>0?r.withDirectives((r.openBlock(),r.createElementBlock("div",qOe,[r.createVNode(LV,{key:"fortalezas-rival",modelValue:o.value,"onUpdate:modelValue":R[3]||(R[3]=de=>o.value=de),"team-initials":"RIV","season-id":(ee=k.partido)==null?void 0:ee.season_id,"team-id":((Y=k.partido)==null?void 0:Y.visita)||(($=k.partido)==null?void 0:$.visiting_team),"rival-team-id":((le=k.partido)==null?void 0:le.local)||((ie=k.partido)==null?void 0:ie.home_team),"game-id":((ue=k.partido)==null?void 0:ue.game_id)||((he=k.partido)==null?void 0:he.id),token:k.token,"template-type":((ae=k.template)==null?void 0:ae.template_type)||1,title:"Fortalezas a favor del rival","total-fortalezas":n.value.rival,ref_key:"fortalezasRivalRef",ref:S},null,8,["modelValue","season-id","team-id","rival-team-id","game-id","token","template-type","total-fortalezas"])],512)),[[r.vShow,x()[l.value]==="fortalezasRival"]]):r.createCommentVNode("",!0),x()[l.value]==="cornersEquipo"?(r.openBlock(),r.createElementBlock("div",zOe,[r.createVNode(UV,{modelValue:s.value,"onUpdate:modelValue":R[4]||(R[4]=de=>s.value=de),rival:!1,"team-initials":"AME",title:"Tiros de esquina en contra de mi equipo","team-logo-url":"https://golstatsimages.blob.core.windows.net/teams-80/2.png",ref_key:"cornersEquipoRef",ref:V},null,8,["modelValue"])])):r.createCommentVNode("",!0),x()[l.value]==="cornersRival"?(r.openBlock(),r.createElementBlock("div",COe,[r.createVNode(UV,{modelValue:p.value,"onUpdate:modelValue":R[5]||(R[5]=de=>p.value=de),rival:!0,"team-initials":"RIV",title:"Tiros de esquina en contra del rival","team-logo-url":"https://golstatsimages.blob.core.windows.net/teams-80/1.png",ref_key:"cornersRivalRef",ref:O},null,8,["modelValue"])])):r.createCommentVNode("",!0)],2),POe,r.createElementVNode("div",EOe,[r.createElementVNode("button",{class:"back-btn",onClick:z},[FOe,r.createTextVNode(" Regresar ")]),r.createElementVNode("div",ROe,[l.value===0?(r.openBlock(),r.createElementBlock("button",{key:0,class:"cancel-btn",onClick:U},"Cancelar")):r.createCommentVNode("",!0),l.value===1||l.value===2?(r.openBlock(),r.createElementBlock("button",{key:1,class:"cancel-btn",onClick:T}," Autocompletar ")):r.createCommentVNode("",!0),r.createElementVNode("button",{class:r.normalizeClass(["next-btn",{disabled:!d.value}]),disabled:!d.value,onClick:q},r.toDisplayString(l.value===0?b.value==="automatico"?"Finalizar":"Siguiente":l.value===c.value?"Finalizar":"Siguiente"),11,MOe)])])])]),_.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"modal-overlay",onClick:r.withModifiers(C,["self"])},[r.createElementVNode("div",{class:"modal-content confirm-dialog"},[jOe,r.createElementVNode("div",{class:"modal-footer"},[r.createElementVNode("div",{class:"footer-actions"},[r.createElementVNode("button",{class:"cancel-btn",onClick:C},"Cancelar"),r.createElementVNode("button",{class:"next-btn",onClick:L},"Confirmar")])])])])):r.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-0052f835"]]),z2=e=>(r.pushScopeId("data-v-e7ddb7cc"),e=e(),r.popScopeId(),e),KOe={class:"templates-header"},AOe={class:"count"},IOe={key:0,class:"sort-options"},XOe=["onClick"],DOe={key:0,class:"checkmark"},JOe=[z2(()=>r.createElementVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M5 10.5L9 14.5L15 7.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],BOe={key:0,class:"loading-state"},GOe=[z2(()=>r.createElementVNode("div",{class:"loading-spinner"},null,-1)),z2(()=>r.createElementVNode("p",null,"Cargando templates...",-1))],ZOe=[z2(()=>r.createElementVNode("div",{class:"inner-card"},[r.createElementVNode("div",{class:"plus"},[r.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-add@3x.png",alt:"Agregar"})]),r.createElementVNode("div",{class:"create-text"},"Crear Template")],-1))],HOe=ml({__name:"TemplatesSection",props:{userId:{type:Number,required:!0},team:{type:Number,required:!0},token:{type:String,required:!0},searchQuery:{type:String,default:""}},emits:["switch-to-reports","open-modal-new-template","edit-template"],setup(e,{expose:a,emit:i}){const k=i,j=e,g=r.ref(!1),m=r.ref(null),n=r.ref(!1),f=r.ref(!1),l=r.ref(!1),t=r.ref(!1),_=r.ref(!1),b=r.ref(!1),v=r.ref(null),h=r.ref(!1),o=r.ref(""),s=r.ref(""),p=r.ref(""),c=r.ref(""),d=r.ref(""),x=r.ref(""),w=r.ref(""),S=r.ref(""),V=r.ref(""),O=r.ref(null),U=r.ref(null),z=r.ref(null),L=r.ref(null),C=r.ref(0),q=r.ref([]),N=r.ref(!1),P=r.ref(null);r.watch([()=>j.team,()=>j.token],()=>{j.team&&j.token&&E()},{immediate:!1});const T=[{label:"A - Z",value:"name-asc"},{label:"Más recientes",value:"date-desc"}],E=async()=>{try{N.value=!0,P.value=null;const ue=await es.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates/teams/${j.team}`,{headers:{Authorization:`${j.token}`,"Content-Type":"application/json"}});ue.data&&Array.isArray(ue.data)?q.value=ue.data:ue.data&&ue.data.templates?q.value=ue.data.templates:ue.data&&ue.data.data?q.value=ue.data.data:q.value=[]}catch(ue){console.error("Error al obtener templates:",ue),console.error("Error response:",ue.response),P.value=ue.message||"Error al cargar los templates",q.value=[]}finally{N.value=!1}},R=r.computed(()=>{if(!q.value.length)return[];let ue=[...q.value];if(j.searchQuery.trim()){const he=j.searchQuery.toLowerCase().trim();ue=ue.filter(ae=>ae.name.toLowerCase().includes(he))}switch(m.value){case"name-asc":return ue.sort((he,ae)=>he.name.localeCompare(ae.name));case"date-desc":return ue.sort((he,ae)=>new Date(ae.created_at)-new Date(he.created_at));default:return ue}}),W=r.computed(()=>{if(!C.value)return"grid-1-column";const ue=340,he=20,de=C.value-40,ce=Math.floor((de+he)/(ue+he)),ye=Math.max(1,ce);return ye>=4?"grid-4-columns":ye>=3?"grid-3-columns":ye>=2?"grid-2-columns":"grid-1-column"}),K=()=>{g.value=!g.value},X=ue=>{m.value=ue,g.value=!1},D=ue=>{const he=T.find(ae=>ae.value===ue);return he?he.label:null},H=ue=>{g.value&&U.value&&!U.value.contains(ue.target)&&(g.value=!1)},ne=()=>{z.value&&(C.value=z.value.offsetWidth)};function B(ue){k("edit-template",ue)}function re(){f.value=!1,h.value=!1}function ee(ue){v.value=ue,f.value=!1,h.value=!1,b.value=!0}function Y(){b.value=!1,f.value=!0}async function $(ue){var he,ae,de,ce,ye,xe,be,Te;try{if(b.value=!1,!v.value)return;const Oe={template_id:v.value.template.id,user_id:j.userId,tournament_id:v.value.liga.id||1,tournament_name:v.value.liga.name,season_id:v.value.partido.season_id,season_name:((he=v.value.torneo)==null?void 0:he.name)||"",game_id:v.value.partido.id||v.value.partido.game_id},Le=await es.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${j.userId}/reports`,Oe,{headers:{Authorization:j.token,"Content-Type":"application/json"}}),_e=((ae=Le.data)==null?void 0:ae.id)||((de=Le.data)==null?void 0:de.report_id)||((ye=(ce=Le.data)==null?void 0:ce.data)==null?void 0:ye.id)||((be=(xe=Le.data)==null?void 0:xe.data)==null?void 0:be.report_id);if(console.log("Report ID obtenido:",_e),console.log("Strengths Payload recibido:",ue==null?void 0:ue.strengthsPayload),ue!=null&&ue.strengthsPayload&&Object.keys(ue.strengthsPayload).length>0&&_e)try{console.log("Enviando strengths al endpoint...");const Ce=await es.post(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${j.userId}/reports/${_e}/strengths`,ue.strengthsPayload,{headers:{Authorization:j.token,"Content-Type":"application/json"}});console.log("Strengths guardados exitosamente:",Ce.data)}catch(Ce){console.error("Error al guardar las fortalezas:",Ce),console.error("Error response:",(Te=Ce.response)==null?void 0:Te.data)}else console.warn("No se enviaron strengths porque:",{hasPayload:!!(ue!=null&&ue.strengthsPayload),payloadKeys:ue!=null&&ue.strengthsPayload?Object.keys(ue.strengthsPayload).length:0,hasReportId:!!_e});k("switch-to-reports"),v.value=null}catch(Oe){console.error("Error al generar el reporte:",Oe),Oe.response&&Oe.response.status===409?v.value&&(w.value=v.value.template.id,V.value=v.value.template.template_type,O.value=v.value.template,h.value=!0,await r.nextTick(),f.value=!0):alert("Error al generar el reporte. Por favor, intenta de nuevo.")}}let le=null;r.onMounted(async()=>{document.addEventListener("mousedown",H),await r.nextTick(),ne(),window.ResizeObserver?(le=new ResizeObserver(()=>{ne()}),z.value&&le.observe(z.value)):window.addEventListener("resize",ne),E()});function ie(ue){k("open-modal-new-template",ue)}return r.onBeforeUnmount(()=>{document.removeEventListener("mousedown",H),le?le.disconnect():window.removeEventListener("resize",ne)}),a({obtenerTemplates:E}),(ue,he)=>{var ae,de;return r.openBlock(),r.createElementBlock("div",{class:"templates-section",ref_key:"templatesSectionRef",ref:z},[r.createElementVNode("div",KOe,[r.createElementVNode("span",null,[r.createTextVNode("Templates "),r.createElementVNode("span",AOe,"("+r.toDisplayString(R.value.length)+")",1)]),r.createElementVNode("div",{class:"sort-dropdown",ref_key:"sortDropdownRef",ref:U},[r.createElementVNode("button",{class:"sort-button",onClick:K},[r.createTextVNode(r.toDisplayString(D(m.value)||"Ordenar")+" ",1),r.createElementVNode("span",{class:r.normalizeClass(["dropdown-arrow",{rotated:g.value}])},null,2)]),g.value?(r.openBlock(),r.createElementBlock("div",IOe,[(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(T,ce=>r.createElementVNode("div",{key:ce.value,class:r.normalizeClass(["sort-option",{selected:m.value===ce.value}]),onClick:ye=>X(ce.value)},[r.createElementVNode("span",null,r.toDisplayString(ce.label),1),m.value===ce.value?(r.openBlock(),r.createElementBlock("span",DOe,JOe)):r.createCommentVNode("",!0)],10,XOe)),64))])):r.createCommentVNode("",!0)],512)]),N.value?(r.openBlock(),r.createElementBlock("div",BOe,GOe)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["templates-list",W.value]),ref_key:"templatesListRef",ref:L},[r.createElementVNode("div",{class:"template-card create",onClick:he[0]||(he[0]=ce=>n.value=!0)},ZOe),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(R.value,ce=>(r.openBlock(),r.createBlock(O8e,{key:ce.id,template:ce,"user-id":e.userId,onGenerarReporte:ye=>{w.value=ce.id,V.value=ce.template_type,O.value=ce,f.value=!0},onRenombrar:ye=>{S.value=ce.id,o.value=ye,s.value=ce.template_type,l.value=!0},onDuplicar:ye=>{x.value=ce.id,p.value=ye,t.value=!0},onEliminar:ye=>{c.value=ye.name,d.value=ye.id,_.value=!0},onEditTemplate:B},null,8,["template","user-id","onGenerarReporte","onRenombrar","onDuplicar","onEliminar"]))),128))],2)),n.value?(r.openBlock(),r.createBlock(OV,{key:2,token:e.token,team:e.team,onClose:he[1]||(he[1]=ce=>n.value=!1),onOpenModalNewTemplate:ie},null,8,["token","team"])):r.createCommentVNode("",!0),f.value?(r.openBlock(),r.createBlock(G9e,{key:3,"user-id":e.userId,token:e.token,team:e.team,"template-id":w.value,"template-type":V.value,template:O.value,"show-error409-on-mount":h.value,onClose:re,onSwitchToReports:he[2]||(he[2]=ce=>ue.$emit("switch-to-reports")),onOpenConfigurarContenido:ee},null,8,["user-id","token","team","template-id","template-type","template","show-error409-on-mount"])):r.createCommentVNode("",!0),b.value?(r.openBlock(),r.createBlock(WOe,{key:4,"has-rival":!0,token:e.token,template:((ae=v.value)==null?void 0:ae.template)||null,team:e.team,partido:((de=v.value)==null?void 0:de.partido)||null,onClose:he[3]||(he[3]=ce=>b.value=!1),onBack:Y,onNext:$},null,8,["token","template","team","partido"])):r.createCommentVNode("",!0),l.value?(r.openBlock(),r.createBlock(uNe,{key:5,initialName:o.value,token:e.token,"template-id":S.value,"template-type":s.value,"user-id":e.userId,onRefresh:he[4]||(he[4]=ce=>E()),onClose:he[5]||(he[5]=ce=>l.value=!1),onRename:he[6]||(he[6]=ce=>{l.value=!1})},null,8,["initialName","token","template-id","template-type","user-id"])):r.createCommentVNode("",!0),t.value?(r.openBlock(),r.createBlock(_Ne,{key:6,initialName:p.value,token:e.token,"template-id":x.value,onClose:he[7]||(he[7]=ce=>t.value=!1),onTemplateDuplicated:he[8]||(he[8]=ce=>{t.value=!1,E()})},null,8,["initialName","token","template-id"])):r.createCommentVNode("",!0),_.value?(r.openBlock(),r.createBlock(UNe,{key:7,"template-id":d.value,"user-id":e.userId,token:e.token,onClose:he[9]||(he[9]=ce=>_.value=!1),onTemplateDeleted:he[10]||(he[10]=ce=>{_.value=!1,E()})},null,8,["template-id","user-id","token"])):r.createCommentVNode("",!0)],512)}}},[["__scopeId","data-v-e7ddb7cc"]]),K5=e=>(r.pushScopeId("data-v-246ad2d7"),e=e(),r.popScopeId(),e),YOe={class:"tooltip-report-options"},QOe=K5(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename.svg",alt:"Renombrar reporte",class:"icon"},null,-1)),$Oe=K5(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-download.svg",alt:"Descargar reporte",class:"icon"},null,-1)),eLe=K5(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-delete.svg",alt:"Eliminar reporte",class:"icon"},null,-1)),tLe=ml({__name:"TooltipReportOptions",emits:["ver-reporte","renombrar","editar","duplicar","descargar","eliminar"],setup(e,{emit:a}){return(i,k)=>(r.openBlock(),r.createElementBlock("div",YOe,[r.createElementVNode("ul",null,[r.createElementVNode("li",{class:"option",onClick:k[0]||(k[0]=j=>i.$emit("renombrar"))},[QOe,r.createTextVNode(" Renombrar reporte ")]),r.createElementVNode("li",{class:"option",onClick:k[1]||(k[1]=j=>i.$emit("descargar"))},[$Oe,r.createTextVNode(" Descargar reporte ")]),r.createElementVNode("li",{class:"option",onClick:k[2]||(k[2]=j=>i.$emit("eliminar"))},[eLe,r.createTextVNode(" Eliminar reporte ")])])]))}},[["__scopeId","data-v-246ad2d7"]]);function Kh(e){if(!e)return"";const a=new Date(e);if(isNaN(a.getTime()))return"";const i=a.getDate(),k=a.toLocaleDateString("es-ES",{month:"short"}),j=a.getFullYear();return`${i} ${k}, ${j}`}const rLe=e=>(r.pushScopeId("data-v-bb7e7ba7"),e=e(),r.popScopeId(),e),nLe={class:"prematch-bg"},aLe={class:"background-shields"},iLe={class:"shield-left"},oLe=["src"],sLe={class:"shield-right"},lLe=["src"],cLe=rLe(()=>r.createElementVNode("div",{class:"title"},[r.createTextVNode("Análisis "),r.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),uLe={class:"subtitle"},dLe={class:"jornada"},pLe={class:"fecha"},hLe={class:"teams-row"},fLe={class:"team team-local"},mLe={class:"escudo-svg"},yLe=["src"],gLe={class:"team-name"},vLe={class:"team team-visitor"},bLe={class:"escudo-svg"},xLe=["src"],wLe={class:"team-name"},_Le=ml({__name:"AnalisisPrematchType1",props:{report:{type:Object,default:()=>({})}},setup(e){function a(k){return k?k.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 i=e;return(k,j)=>(r.openBlock(),r.createElementBlock("div",nLe,[r.createElementVNode("div",aLe,[r.createElementVNode("div",iLe,[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+i.report.game.home_team+".png",alt:"Escudo local"},null,8,oLe)]),r.createElementVNode("div",sLe,[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+i.report.game.visiting_team+".png",alt:"Escudo visitante"},null,8,lLe)])]),cLe,r.createElementVNode("div",uLe,[r.createElementVNode("span",dLe,r.toDisplayString(a(i.report.game.matchday_name)),1),r.createElementVNode("span",pLe," - "+r.toDisplayString(r.unref(Kh)(i.report.game.date_time_utc)),1)]),r.createElementVNode("div",hLe,[r.createElementVNode("div",fLe,[r.createElementVNode("span",mLe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+i.report.game.home_team+".png"},null,8,yLe)]),r.createElementVNode("span",gLe,r.toDisplayString(i.report.game.home_team_acronym),1)]),r.createElementVNode("div",vLe,[r.createElementVNode("span",bLe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+i.report.game.visiting_team+".png"},null,8,xLe)]),r.createElementVNode("span",wLe,r.toDisplayString(i.report.game.visiting_team_acronym),1)])])]))}},[["__scopeId","data-v-bb7e7ba7"]]),ty=e=>(r.pushScopeId("data-v-78d552f2"),e=e(),r.popScopeId(),e),SLe={class:"prematch-bg"},TLe={class:"background-shields"},kLe={class:"shield-left"},NLe=["src"],VLe={class:"shield-right"},OLe=["src"],LLe=ty(()=>r.createElementVNode("div",{class:"title"},[r.createTextVNode("Análisis "),r.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),ULe={class:"subtitle"},qLe={class:"jornada"},zLe={class:"fecha"},CLe={class:"teams-grid"},PLe={class:"row row-top"},ELe={class:"team team-local"},FLe={class:"escudo-svg"},RLe=["src"],MLe={class:"team-name"},jLe={class:"score"},WLe={class:"score-text"},KLe={class:"team team-visitor"},ALe={class:"team-name"},ILe={class:"escudo-svg"},XLe=["src"],DLe={class:"row row-bottom"},JLe={class:"team-stats"},BLe=r.createStaticVNode('<span class="stat ball" data-v-78d552f2><svg width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-78d552f2><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-78d552f2></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-78d552f2></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-78d552f2></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-78d552f2></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-78d552f2></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-78d552f2></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-78d552f2></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path></svg></span>',1),GLe={class:"stat red"},ZLe=ty(()=>r.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})],-1)),HLe={class:"stat-number"},YLe={class:"stat yellow"},QLe=ty(()=>r.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})],-1)),$Le={class:"stat-number"},eUe=ty(()=>r.createElementVNode("div",{class:"empty"},null,-1)),tUe={class:"team-stats"},rUe={class:"stat-number"},nUe=ty(()=>r.createElementVNode("span",{class:"stat yellow"},[r.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})])],-1)),aUe={class:"stat-number"},iUe=ty(()=>r.createElementVNode("span",{class:"stat red"},[r.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})])],-1)),oUe=r.createStaticVNode('<span class="stat ball" data-v-78d552f2><svg width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-78d552f2><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-78d552f2></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-78d552f2></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-78d552f2></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-78d552f2></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-78d552f2></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-78d552f2></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-78d552f2></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-78d552f2></path></svg></span>',1),sUe=ml({__name:"AnalisisPostMatchType1",props:{report:{type:Object,default:()=>({})}},setup(e){function a(l){return l?l.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 i=e,k=r.computed(()=>{var _,b,v;const l=(v=(b=(_=i.report)==null?void 0:_.game)==null?void 0:b.minutes)==null?void 0:v.home_goals_minutes;if(!Array.isArray(l)||l.length===0)return null;const t=l.map(h=>{const o=h.match(/(\d+)'$/);return o?o[1]+"'":""}).filter(h=>h!=="");if(t.length>5){const h=t.slice(0,5).join(", "),o=t.slice(5).join(", ");return`${h}
4136
4136
  ${o}`}return t.join(", ")}),j=r.computed(()=>{var _,b,v;const l=(v=(b=(_=i.report)==null?void 0:_.game)==null?void 0:b.minutes)==null?void 0:v.visiting_goals_minutes;if(!Array.isArray(l)||l.length===0)return null;const t=l.map(h=>{const o=h.match(/(\d+)'$/);return o?o[1]+"'":""}).filter(h=>h!=="");if(t.length>5){const h=t.slice(0,5).join(", "),o=t.slice(5).join(", ");return`${h}
4137
4137
  ${o}`}return t.join(", ")}),g=r.computed(()=>{var t,_,b;const l=(b=(_=(t=i.report)==null?void 0:t.game)==null?void 0:_.minutes)==null?void 0:b.home_red_cards_minutes;return Array.isArray(l)&&l.length>0?l.length:null}),m=r.computed(()=>{var t,_,b;const l=(b=(_=(t=i.report)==null?void 0:t.game)==null?void 0:_.minutes)==null?void 0:b.home_yellow_cards_minutes;return Array.isArray(l)&&l.length>0?l.length:null}),n=r.computed(()=>{var t,_,b;const l=(b=(_=(t=i.report)==null?void 0:t.game)==null?void 0:_.minutes)==null?void 0:b.away_yellow_cards_minutes;return Array.isArray(l)&&l.length>0?l.length:null}),f=r.computed(()=>{var t,_,b;const l=(b=(_=(t=i.report)==null?void 0:t.game)==null?void 0:_.minutes)==null?void 0:b.away_red_cards_minutes;return Array.isArray(l)&&l.length>0?l.length:null});return(l,t)=>(r.openBlock(),r.createElementBlock("div",SLe,[r.createElementVNode("div",TLe,[r.createElementVNode("div",kLe,[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+e.report.game.home_team+".png",alt:"Escudo local"},null,8,NLe)]),r.createElementVNode("div",VLe,[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+e.report.game.visiting_team+".png",alt:"Escudo visitante"},null,8,OLe)])]),LLe,r.createElementVNode("div",ULe,[r.createElementVNode("span",qLe,r.toDisplayString(a(e.report.game.matchday_name)),1),r.createElementVNode("span",zLe," - "+r.toDisplayString(r.unref(Kh)(e.report.game.date_time_utc)),1)]),r.createElementVNode("div",CLe,[r.createElementVNode("div",PLe,[r.createElementVNode("div",ELe,[r.createElementVNode("span",FLe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+e.report.game.home_team+".png"},null,8,RLe)]),r.createElementVNode("span",MLe,r.toDisplayString(e.report.game.home_team_acronym),1)]),r.createElementVNode("div",jLe,[r.createElementVNode("span",WLe,r.toDisplayString(e.report.game.score[0])+":"+r.toDisplayString(e.report.game.score[1]),1)]),r.createElementVNode("div",KLe,[r.createElementVNode("span",ALe,r.toDisplayString(e.report.game.visiting_team_acronym),1),r.createElementVNode("span",ILe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+e.report.game.visiting_team+".png"},null,8,XLe)])])]),r.createElementVNode("div",DLe,[r.createElementVNode("div",JLe,[BLe,k.value!==null?(r.openBlock(),r.createElementBlock("span",{key:0,class:r.normalizeClass(["stat time",{"two-lines":k.value&&k.value.includes(`
4138
4138
  `)}])},r.toDisplayString(k.value),3)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["separator",{"two-lines":k.value&&k.value.includes(`
4139
4139
  `)}])},null,2),r.createElementVNode("span",GLe,[ZLe,r.createElementVNode("span",HLe,r.toDisplayString(g.value||0),1)]),r.createElementVNode("span",YLe,[QLe,r.createElementVNode("span",$Le,r.toDisplayString(m.value||0),1)])]),eUe,r.createElementVNode("div",tUe,[r.createElementVNode("span",rUe,r.toDisplayString(n.value||0),1),nUe,r.createElementVNode("span",aUe,r.toDisplayString(f.value||0),1),iUe,r.createElementVNode("div",{class:r.normalizeClass(["separator",{"two-lines":j.value&&j.value.includes(`
4140
4140
  `)}])},null,2),j.value!==null?(r.openBlock(),r.createElementBlock("span",{key:0,class:r.normalizeClass(["stat time",{"two-lines":j.value&&j.value.includes(`
4141
- `)}])},r.toDisplayString(j.value),3)):r.createCommentVNode("",!0),oUe])])])]))}},[["__scopeId","data-v-7dd14646"]]),lUe=e=>(r.pushScopeId("data-v-ef17e1af"),e=e(),r.popScopeId(),e),cUe={class:"prematch-bg"},uUe={class:"background-shields"},dUe={class:"shield-left"},pUe=["src"],hUe={class:"shield-right"},fUe=["src"],mUe=lUe(()=>r.createElementVNode("div",{class:"title"},[r.createTextVNode("Análisis "),r.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),yUe={class:"subtitle"},gUe={class:"jornada"},vUe={class:"fecha"},bUe={class:"teams-row"},xUe={class:"team team-local"},wUe={class:"escudo-svg"},_Ue=["src"],SUe={class:"team-name"},TUe={class:"team team-visitor"},kUe={class:"escudo-svg"},NUe=["src"],VUe={class:"team-name"},OUe=ml({__name:"AnalisisPrematchType2",props:{report:{type:Object,default:()=>({})}},setup(e){function a(k){return k?k.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 i=e;return(k,j)=>(r.openBlock(),r.createElementBlock("div",cUe,[r.createElementVNode("div",uUe,[r.createElementVNode("div",dUe,[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+i.report.game.home_team+".png",alt:"Escudo local"},null,8,pUe)]),r.createElementVNode("div",hUe,[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+i.report.game.visiting_team+".png",alt:"Escudo visitante"},null,8,fUe)])]),mUe,r.createElementVNode("div",yUe,[r.createElementVNode("span",gUe,r.toDisplayString(a(i.report.game.matchday_name)),1),r.createElementVNode("span",vUe," - "+r.toDisplayString(r.unref(Kh)(i.report.game.date_time_utc)),1)]),r.createElementVNode("div",bUe,[r.createElementVNode("div",xUe,[r.createElementVNode("span",wUe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+i.report.game.home_team+".png"},null,8,_Ue)]),r.createElementVNode("span",SUe,r.toDisplayString(i.report.game.home_team_acronym),1)]),r.createElementVNode("div",TUe,[r.createElementVNode("span",kUe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+i.report.game.visiting_team+".png"},null,8,NUe)]),r.createElementVNode("span",VUe,r.toDisplayString(i.report.game.visiting_team_acronym),1)])])]))}},[["__scopeId","data-v-ef17e1af"]]),ry=e=>(r.pushScopeId("data-v-63a8a7f8"),e=e(),r.popScopeId(),e),LUe={class:"prematch-bg"},UUe={class:"background-shields"},qUe={class:"shield-left"},zUe=["src"],CUe={class:"shield-right"},PUe=["src"],EUe=ry(()=>r.createElementVNode("div",{class:"title"},[r.createTextVNode("Análisis "),r.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),FUe={class:"subtitle"},RUe={class:"jornada"},MUe={class:"fecha"},jUe={class:"teams-grid"},WUe={class:"row row-top"},KUe={class:"team team-local"},AUe={class:"escudo-svg"},IUe=["src"],XUe={class:"team-name"},DUe={class:"score"},JUe={class:"score-text"},BUe={class:"team team-visitor"},GUe={class:"team-name"},ZUe={class:"escudo-svg"},HUe=["src"],YUe={class:"row row-bottom"},QUe={class:"team-stats"},$Ue=r.createStaticVNode('<span class="stat ball" data-v-63a8a7f8><svg width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-63a8a7f8><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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path></svg></span>',1),eqe={class:"stat red"},tqe=ry(()=>r.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})],-1)),rqe={class:"stat-number"},nqe={class:"stat yellow"},aqe=ry(()=>r.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})],-1)),iqe={class:"stat-number"},oqe=ry(()=>r.createElementVNode("div",{class:"empty"},null,-1)),sqe={class:"team-stats"},lqe={class:"stat-number"},cqe=ry(()=>r.createElementVNode("span",{class:"stat yellow"},[r.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})])],-1)),uqe={class:"stat-number"},dqe=ry(()=>r.createElementVNode("span",{class:"stat red"},[r.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})])],-1)),pqe=r.createStaticVNode('<span class="stat ball" data-v-63a8a7f8><svg width="19" height="19" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-63a8a7f8><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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></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-63a8a7f8></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-63a8a7f8></path></svg></span>',1),hqe=ml({__name:"AnalisisPostMatchType2",props:{report:{type:Object,default:()=>({})}},setup(e){function a(l){return l?l.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 i=e,k=r.computed(()=>{var _,b,v;const l=(v=(b=(_=i.report)==null?void 0:_.game)==null?void 0:b.minutes)==null?void 0:v.home_goals_minutes;if(!Array.isArray(l)||l.length===0)return null;const t=l.map(h=>{const o=h.match(/(\d+)'$/);return o?o[1]+"'":""}).filter(h=>h!=="");if(t.length>5){const h=t.slice(0,5).join(", "),o=t.slice(5).join(", ");return`${h}
4141
+ `)}])},r.toDisplayString(j.value),3)):r.createCommentVNode("",!0),oUe])])])]))}},[["__scopeId","data-v-78d552f2"]]),lUe=e=>(r.pushScopeId("data-v-ef17e1af"),e=e(),r.popScopeId(),e),cUe={class:"prematch-bg"},uUe={class:"background-shields"},dUe={class:"shield-left"},pUe=["src"],hUe={class:"shield-right"},fUe=["src"],mUe=lUe(()=>r.createElementVNode("div",{class:"title"},[r.createTextVNode("Análisis "),r.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),yUe={class:"subtitle"},gUe={class:"jornada"},vUe={class:"fecha"},bUe={class:"teams-row"},xUe={class:"team team-local"},wUe={class:"escudo-svg"},_Ue=["src"],SUe={class:"team-name"},TUe={class:"team team-visitor"},kUe={class:"escudo-svg"},NUe=["src"],VUe={class:"team-name"},OUe=ml({__name:"AnalisisPrematchType2",props:{report:{type:Object,default:()=>({})}},setup(e){function a(k){return k?k.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 i=e;return(k,j)=>(r.openBlock(),r.createElementBlock("div",cUe,[r.createElementVNode("div",uUe,[r.createElementVNode("div",dUe,[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+i.report.game.home_team+".png",alt:"Escudo local"},null,8,pUe)]),r.createElementVNode("div",hUe,[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+i.report.game.visiting_team+".png",alt:"Escudo visitante"},null,8,fUe)])]),mUe,r.createElementVNode("div",yUe,[r.createElementVNode("span",gUe,r.toDisplayString(a(i.report.game.matchday_name)),1),r.createElementVNode("span",vUe," - "+r.toDisplayString(r.unref(Kh)(i.report.game.date_time_utc)),1)]),r.createElementVNode("div",bUe,[r.createElementVNode("div",xUe,[r.createElementVNode("span",wUe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+i.report.game.home_team+".png"},null,8,_Ue)]),r.createElementVNode("span",SUe,r.toDisplayString(i.report.game.home_team_acronym),1)]),r.createElementVNode("div",TUe,[r.createElementVNode("span",kUe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+i.report.game.visiting_team+".png"},null,8,NUe)]),r.createElementVNode("span",VUe,r.toDisplayString(i.report.game.visiting_team_acronym),1)])])]))}},[["__scopeId","data-v-ef17e1af"]]),ry=e=>(r.pushScopeId("data-v-2a752817"),e=e(),r.popScopeId(),e),LUe={class:"prematch-bg"},UUe={class:"background-shields"},qUe={class:"shield-left"},zUe=["src"],CUe={class:"shield-right"},PUe=["src"],EUe=ry(()=>r.createElementVNode("div",{class:"title"},[r.createTextVNode("Análisis "),r.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),FUe={class:"subtitle"},RUe={class:"jornada"},MUe={class:"fecha"},jUe={class:"teams-grid"},WUe={class:"row row-top"},KUe={class:"team team-local"},AUe={class:"escudo-svg"},IUe=["src"],XUe={class:"team-name"},DUe={class:"score"},JUe={class:"score-text"},BUe={class:"team team-visitor"},GUe={class:"team-name"},ZUe={class:"escudo-svg"},HUe=["src"],YUe={class:"row row-bottom"},QUe={class:"team-stats"},$Ue=r.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),eqe={class:"stat red"},tqe=ry(()=>r.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})],-1)),rqe={class:"stat-number"},nqe={class:"stat yellow"},aqe=ry(()=>r.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})],-1)),iqe={class:"stat-number"},oqe=ry(()=>r.createElementVNode("div",{class:"empty"},null,-1)),sqe={class:"team-stats"},lqe={class:"stat-number"},cqe=ry(()=>r.createElementVNode("span",{class:"stat yellow"},[r.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FFE066",stroke:"#BFA600"})])],-1)),uqe={class:"stat-number"},dqe=ry(()=>r.createElementVNode("span",{class:"stat red"},[r.createElementVNode("svg",{width:"12",height:"16",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{width:"14",height:"18",rx:"2",fill:"#FF4D4F",stroke:"#A80000"})])],-1)),pqe=r.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),hqe=ml({__name:"AnalisisPostMatchType2",props:{report:{type:Object,default:()=>({})}},setup(e){function a(l){return l?l.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 i=e,k=r.computed(()=>{var _,b,v;const l=(v=(b=(_=i.report)==null?void 0:_.game)==null?void 0:b.minutes)==null?void 0:v.home_goals_minutes;if(!Array.isArray(l)||l.length===0)return null;const t=l.map(h=>{const o=h.match(/(\d+)'$/);return o?o[1]+"'":""}).filter(h=>h!=="");if(t.length>5){const h=t.slice(0,5).join(", "),o=t.slice(5).join(", ");return`${h}
4142
4142
  ${o}`}return t.join(", ")}),j=r.computed(()=>{var _,b,v;const l=(v=(b=(_=i.report)==null?void 0:_.game)==null?void 0:b.minutes)==null?void 0:v.visiting_goals_minutes;if(!Array.isArray(l)||l.length===0)return null;const t=l.map(h=>{const o=h.match(/(\d+)'$/);return o?o[1]+"'":""}).filter(h=>h!=="");if(t.length>5){const h=t.slice(0,5).join(", "),o=t.slice(5).join(", ");return`${h}
4143
4143
  ${o}`}return t.join(", ")}),g=r.computed(()=>{var t,_,b;const l=(b=(_=(t=i.report)==null?void 0:t.game)==null?void 0:_.minutes)==null?void 0:b.home_red_cards_minutes;return Array.isArray(l)&&l.length>0?l.length:null}),m=r.computed(()=>{var t,_,b;const l=(b=(_=(t=i.report)==null?void 0:t.game)==null?void 0:_.minutes)==null?void 0:b.home_yellow_cards_minutes;return Array.isArray(l)&&l.length>0?l.length:null}),n=r.computed(()=>{var t,_,b;const l=(b=(_=(t=i.report)==null?void 0:t.game)==null?void 0:_.minutes)==null?void 0:b.away_yellow_cards_minutes;return Array.isArray(l)&&l.length>0?l.length:null}),f=r.computed(()=>{var t,_,b;const l=(b=(_=(t=i.report)==null?void 0:t.game)==null?void 0:_.minutes)==null?void 0:b.away_red_cards_minutes;return Array.isArray(l)&&l.length>0?l.length:null});return(l,t)=>(r.openBlock(),r.createElementBlock("div",LUe,[r.createElementVNode("div",UUe,[r.createElementVNode("div",qUe,[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+e.report.game.home_team+".png",alt:"Escudo local"},null,8,zUe)]),r.createElementVNode("div",CUe,[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/teams-150/"+e.report.game.visiting_team+".png",alt:"Escudo visitante"},null,8,PUe)])]),EUe,r.createElementVNode("div",FUe,[r.createElementVNode("span",RUe,"Jornada "+r.toDisplayString(a(e.report.game.matchday_name)),1),r.createElementVNode("span",MUe," - "+r.toDisplayString(r.unref(Kh)(e.report.game.date_time_utc)),1)]),r.createElementVNode("div",jUe,[r.createElementVNode("div",WUe,[r.createElementVNode("div",KUe,[r.createElementVNode("span",AUe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+e.report.game.home_team+".png"},null,8,IUe)]),r.createElementVNode("span",XUe,r.toDisplayString(e.report.game.home_team_acronym),1)]),r.createElementVNode("div",DUe,[r.createElementVNode("span",JUe,r.toDisplayString(e.report.game.score[0])+":"+r.toDisplayString(e.report.game.score[1]),1)]),r.createElementVNode("div",BUe,[r.createElementVNode("span",GUe,r.toDisplayString(e.report.game.visiting_team_acronym),1),r.createElementVNode("span",ZUe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+e.report.game.visiting_team+".png"},null,8,HUe)])])]),r.createElementVNode("div",YUe,[r.createElementVNode("div",QUe,[$Ue,k.value!==null?(r.openBlock(),r.createElementBlock("span",{key:0,class:r.normalizeClass(["stat time",{"two-lines":k.value&&k.value.includes(`
4144
4144
  `)}])},r.toDisplayString(k.value),3)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["separator",{"two-lines":k.value&&k.value.includes(`
4145
4145
  `)}])},null,2),r.createElementVNode("span",eqe,[tqe,r.createElementVNode("span",rqe,r.toDisplayString(g.value||0),1)]),r.createElementVNode("span",nqe,[aqe,r.createElementVNode("span",iqe,r.toDisplayString(m.value||0),1)])]),oqe,r.createElementVNode("div",sqe,[r.createElementVNode("span",lqe,r.toDisplayString(n.value||0),1),cqe,r.createElementVNode("span",uqe,r.toDisplayString(f.value||0),1),dqe,r.createElementVNode("div",{class:r.normalizeClass(["separator",{"two-lines":j.value&&j.value.includes(`
4146
4146
  `)}])},null,2),j.value!==null?(r.openBlock(),r.createElementBlock("span",{key:0,class:r.normalizeClass(["stat time",{"two-lines":j.value&&j.value.includes(`
4147
- `)}])},r.toDisplayString(j.value),3)):r.createCommentVNode("",!0),pqe])])])]))}},[["__scopeId","data-v-63a8a7f8"]]),qV=e=>(r.pushScopeId("data-v-b31afbdf"),e=e(),r.popScopeId(),e),fqe={class:"prematch-bg"},mqe=qV(()=>r.createElementVNode("div",{class:"title"},[r.createTextVNode("Análisis "),r.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),yqe={class:"subtitle"},gqe={class:"jornada"},vqe={class:"fecha"},bqe={class:"teams-row"},xqe={class:"team team-local"},wqe={class:"escudo-svg"},_qe=["src"],Sqe=qV(()=>r.createElementVNode("div",{class:"divider-line"},[r.createElementVNode("div",{class:"dotted-line"})],-1)),Tqe={class:"team team-visitor"},kqe={class:"escudo-svg"},Nqe=["src"],Vqe=ml({__name:"AnalisisPrematchType3",props:{report:{type:Object,default:()=>({})}},setup(e){function a(k){return k?k.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 i=e;return(k,j)=>(r.openBlock(),r.createElementBlock("div",fqe,[mqe,r.createElementVNode("div",yqe,[r.createElementVNode("span",gqe,r.toDisplayString(a(i.report.game.matchday_name)),1),r.createElementVNode("span",vqe," - "+r.toDisplayString(r.unref(Kh)(i.report.game.date_time_utc)),1)]),r.createElementVNode("div",bqe,[r.createElementVNode("div",xqe,[r.createElementVNode("span",wqe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+i.report.game.home_team+".png"},null,8,_qe)])]),Sqe,r.createElementVNode("div",Tqe,[r.createElementVNode("span",kqe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+i.report.game.visiting_team+".png"},null,8,Nqe)])])])]))}},[["__scopeId","data-v-b31afbdf"]]),ny=e=>(r.pushScopeId("data-v-893ebf20"),e=e(),r.popScopeId(),e),Oqe={class:"prematch-bg"},Lqe=ny(()=>r.createElementVNode("div",{class:"title"},[r.createTextVNode("Análisis "),r.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),Uqe={class:"subtitle"},qqe={class:"jornada"},zqe={class:"fecha"},Cqe={class:"teams-row"},Pqe={class:"team team-local"},Eqe={class:"team-header"},Fqe={class:"escudo-svg"},Rqe=["src"],Mqe={class:"score"},jqe={class:"players-list"},Wqe={class:"player-name"},Kqe=ny(()=>r.createElementVNode("span",{class:"player-icon"},[r.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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)),Aqe={key:0,class:"more-events-indicator"},Iqe=[ny(()=>r.createElementVNode("span",{class:"more-events-text"},"...",-1))],Xqe=ny(()=>r.createElementVNode("div",{class:"divider-line"},[r.createElementVNode("div",{class:"dotted-line"})],-1)),Dqe={class:"team team-visitor"},Jqe={class:"team-header"},Bqe={class:"score"},Gqe={class:"escudo-svg"},Zqe=["src"],Hqe={class:"players-list"},Yqe=ny(()=>r.createElementVNode("span",{class:"player-icon"},[r.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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)),Qqe={class:"player-name"},$qe={key:0},eze={key:0,class:"more-events-indicator"},tze=[ny(()=>r.createElementVNode("span",{class:"more-events-text"},"...",-1))],rze=ml({__name:"AnalisisPostMatchType3",props:{report:{type:Object,default:()=>({})}},setup(e){function a(f){return f?f.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 i=e,k=r.computed(()=>{var f,l,t;return(((t=(l=(f=i.report)==null?void 0:f.game)==null?void 0:l.report_minutes)==null?void 0:t.home_goals_minutes)||[]).slice(0,5)}),j=r.computed(()=>{var f,l,t;return(((t=(l=(f=i.report)==null?void 0:f.game)==null?void 0:l.report_minutes)==null?void 0:t.visiting_goals_minutes)||[]).slice(0,5)});function g(f){const l=Array.from(f.matchAll(/\d+\s*\+*\s*\d*'/g)).map(b=>b[0]).join(", "),t=f.match(/^(.*?)\s*\d+'/),_=t?" "+t[1].trim():"";return{minutos:l,nombre:_}}const m=r.computed(()=>{var l,t,_,b;return(((b=(_=(t=(l=i.report)==null?void 0:l.game)==null?void 0:t.report_minutes)==null?void 0:_.home_goals_minutes)==null?void 0:b.length)||0)>5}),n=r.computed(()=>{var l,t,_,b;return(((b=(_=(t=(l=i.report)==null?void 0:l.game)==null?void 0:t.report_minutes)==null?void 0:_.visiting_goals_minutes)==null?void 0:b.length)||0)>5});return(f,l)=>(r.openBlock(),r.createElementBlock("div",Oqe,[Lqe,r.createElementVNode("div",Uqe,[r.createElementVNode("span",qqe,"Jornada "+r.toDisplayString(a(e.report.game.matchday_name)),1),r.createElementVNode("span",zqe," - "+r.toDisplayString(r.unref(Kh)(e.report.game.date_time_utc)),1)]),r.createElementVNode("div",Cqe,[r.createElementVNode("div",Pqe,[r.createElementVNode("div",Eqe,[r.createElementVNode("span",Fqe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+e.report.game.home_team+".png"},null,8,Rqe)]),r.createElementVNode("div",Mqe,r.toDisplayString(e.report.game.score[0]),1)]),r.createElementVNode("div",jqe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.value,(t,_)=>(r.openBlock(),r.createElementBlock("div",{key:`home-event-${_}`,class:"player-item"},[r.createElementVNode("span",Wqe,r.toDisplayString(t)+" ",1),Kqe]))),128)),m.value?(r.openBlock(),r.createElementBlock("div",Aqe,Iqe)):r.createCommentVNode("",!0)])]),Xqe,r.createElementVNode("div",Dqe,[r.createElementVNode("div",Jqe,[r.createElementVNode("div",Bqe,r.toDisplayString(e.report.game.score[1]),1),r.createElementVNode("span",Gqe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+e.report.game.visiting_team+".png"},null,8,Zqe)])]),r.createElementVNode("div",Hqe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,(t,_)=>(r.openBlock(),r.createElementBlock("div",{key:`visiting-event-${_}`,class:"player-item"},[Yqe,r.createElementVNode("span",Qqe,[r.createTextVNode(r.toDisplayString(g(t).minutos)+" ",1),g(t).nombre?(r.openBlock(),r.createElementBlock("span",$qe,r.toDisplayString(g(t).nombre),1)):r.createCommentVNode("",!0)])]))),128)),n.value?(r.openBlock(),r.createElementBlock("div",eze,tze)):r.createCommentVNode("",!0)])])])]))}},[["__scopeId","data-v-893ebf20"]]),zV=e=>(r.pushScopeId("data-v-ef3bf0e5"),e=e(),r.popScopeId(),e),nze={class:"prematch-bg"},aze=zV(()=>r.createElementVNode("div",{class:"title"},[r.createTextVNode("Análisis "),r.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),ize={class:"subtitle"},oze={class:"jornada"},sze={class:"fecha"},lze={class:"teams-row"},cze={class:"team team-local"},uze={class:"escudo-svg"},dze=["src"],pze=zV(()=>r.createElementVNode("div",{class:"divider-line"},[r.createElementVNode("div",{class:"dotted-line"})],-1)),hze={class:"team team-visitor"},fze={class:"escudo-svg"},mze=["src"],yze=ml({__name:"AnalisisPrematchType4",props:{report:{type:Object,default:()=>({})}},setup(e){function a(k){return k?k.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 i=e;return(k,j)=>(r.openBlock(),r.createElementBlock("div",nze,[aze,r.createElementVNode("div",ize,[r.createElementVNode("span",oze,r.toDisplayString(a(i.report.game.matchday_name)),1),r.createElementVNode("span",sze," - "+r.toDisplayString(r.unref(Kh)(i.report.game.date_time_utc)),1)]),r.createElementVNode("div",lze,[r.createElementVNode("div",cze,[r.createElementVNode("span",uze,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+i.report.game.home_team+".png"},null,8,dze)])]),pze,r.createElementVNode("div",hze,[r.createElementVNode("span",fze,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+i.report.game.visiting_team+".png"},null,8,mze)])])])]))}},[["__scopeId","data-v-ef3bf0e5"]]),ay=e=>(r.pushScopeId("data-v-9c7a5ed5"),e=e(),r.popScopeId(),e),gze={class:"prematch-bg"},vze=ay(()=>r.createElementVNode("div",{class:"title"},[r.createTextVNode("Análisis "),r.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),bze={class:"subtitle"},xze={class:"jornada"},wze={class:"fecha"},_ze={class:"teams-row"},Sze={class:"team team-local"},Tze={class:"team-header"},kze={class:"escudo-svg"},Nze=["src"],Vze={class:"score"},Oze={class:"players-list"},Lze={class:"player-name"},Uze=ay(()=>r.createElementVNode("span",{class:"player-icon"},[r.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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)),qze={key:0,class:"more-events-indicator"},zze=[ay(()=>r.createElementVNode("span",{class:"more-events-text"},"...",-1))],Cze=ay(()=>r.createElementVNode("div",{class:"divider-line"},[r.createElementVNode("div",{class:"dotted-line"})],-1)),Pze={class:"team team-visitor"},Eze={class:"team-header"},Fze={class:"score"},Rze={class:"escudo-svg"},Mze=["src"],jze={class:"players-list"},Wze=ay(()=>r.createElementVNode("span",{class:"player-icon"},[r.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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)),Kze={class:"player-name"},Aze={key:0},Ize={key:0,class:"more-events-indicator"},Xze=[ay(()=>r.createElementVNode("span",{class:"more-events-text"},"...",-1))],Dze=ml({__name:"AnalisisPostMatchType4",props:{report:{type:Object,default:()=>({})}},setup(e){function a(f){return f?f.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 i=e,k=r.computed(()=>{var f,l,t;return(((t=(l=(f=i.report)==null?void 0:f.game)==null?void 0:l.report_minutes)==null?void 0:t.home_goals_minutes)||[]).slice(0,5)}),j=r.computed(()=>{var f,l,t;return(((t=(l=(f=i.report)==null?void 0:f.game)==null?void 0:l.report_minutes)==null?void 0:t.visiting_goals_minutes)||[]).slice(0,5)});function g(f){const l=Array.from(f.matchAll(/\d+\s*\+*\s*\d*'/g)).map(b=>b[0]).join(", "),t=f.match(/^(.*?)\s*\d+'/),_=t?t[1].trim():"";return{minutos:l,nombre:_}}const m=r.computed(()=>{var l,t,_,b;return(((b=(_=(t=(l=i.report)==null?void 0:l.game)==null?void 0:t.report_minutes)==null?void 0:_.home_goals_minutes)==null?void 0:b.length)||0)>5}),n=r.computed(()=>{var l,t,_,b;return(((b=(_=(t=(l=i.report)==null?void 0:l.game)==null?void 0:t.report_minutes)==null?void 0:_.visiting_goals_minutes)==null?void 0:b.length)||0)>5});return(f,l)=>(r.openBlock(),r.createElementBlock("div",gze,[vze,r.createElementVNode("div",bze,[r.createElementVNode("span",xze,"Jornada "+r.toDisplayString(a(e.report.game.matchday_name)),1),r.createElementVNode("span",wze," - "+r.toDisplayString(r.unref(Kh)(e.report.game.date_time_utc)),1)]),r.createElementVNode("div",_ze,[r.createElementVNode("div",Sze,[r.createElementVNode("div",Tze,[r.createElementVNode("span",kze,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+e.report.game.home_team+".png"},null,8,Nze)]),r.createElementVNode("div",Vze,r.toDisplayString(e.report.game.score[0]),1)]),r.createElementVNode("div",Oze,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.value,(t,_)=>(r.openBlock(),r.createElementBlock("div",{key:`home-event-${_}`,class:"player-item"},[r.createElementVNode("span",Lze,r.toDisplayString(t)+" ",1),Uze]))),128)),m.value?(r.openBlock(),r.createElementBlock("div",qze,zze)):r.createCommentVNode("",!0)])]),Cze,r.createElementVNode("div",Pze,[r.createElementVNode("div",Eze,[r.createElementVNode("div",Fze,r.toDisplayString(e.report.game.score[1]),1),r.createElementVNode("span",Rze,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+e.report.game.visiting_team+".png"},null,8,Mze)])]),r.createElementVNode("div",jze,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,(t,_)=>(r.openBlock(),r.createElementBlock("div",{key:`visiting-event-${_}`,class:"player-item"},[Wze,r.createElementVNode("span",Kze,[r.createTextVNode(r.toDisplayString(g(t).minutos)+" ",1),g(t).nombre?(r.openBlock(),r.createElementBlock("span",Aze," "+r.toDisplayString(g(t).nombre),1)):r.createCommentVNode("",!0)])]))),128)),n.value?(r.openBlock(),r.createElementBlock("div",Ize,Xze)):r.createCommentVNode("",!0)])])])]))}},[["__scopeId","data-v-9c7a5ed5"]]),A5=e=>(r.pushScopeId("data-v-34e6ad47"),e=e(),r.popScopeId(),e),Jze={class:"report-card",style:{position:"relative"}},Bze=[A5(()=>r.createElementVNode("span",null,null,-1)),A5(()=>r.createElementVNode("span",null,null,-1)),A5(()=>r.createElementVNode("span",null,null,-1))],Gze={class:"report-img-placeholder",style:{position:"relative"}},Zze={class:"inner-card-report"},Hze={class:"report-footer"},Yze={class:"report-title"},Qze={class:"report-template"},$ze={class:"template-name"},eCe={class:"report-league"},tCe={class:"report-tournament"},rCe=ml({__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(e,{emit:a}){const i=a,k=e,j=r.ref(!1);function g(){j.value=!1,i("open-report",k.report)}function m(){j.value=!1,i("renombrar",k.report.report_name||"Reporte",k.report.id)}function n(){j.value=!1,i("edit-template",k.report)}function f(){j.value=!1}function l(){j.value=!1,i("eliminar",k.report)}function t(){i("download-report",k.report),j.value=!1}function _(v){return v?v.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 b(){i("open-report",k.report)}return(v,h)=>(r.openBlock(),r.createElementBlock("div",Jze,[r.createElementVNode("div",{class:"three-dots",onClick:h[0]||(h[0]=r.withModifiers(o=>j.value=!j.value,["stop"]))},Bze),r.createElementVNode("div",Gze,[e.report.template_type===1&&e.report.pages[0].type==1?(r.openBlock(),r.createBlock(_Le,{key:0,"local-team":e.localTeam,"visitor-team":e.visitorTeam,league:e.league,date:e.date,report:e.report},null,8,["local-team","visitor-team","league","date","report"])):e.report.template_type===2&&e.report.pages[0].type==1?(r.openBlock(),r.createBlock(sUe,{key:1,"local-team":e.localTeam,"visitor-team":e.visitorTeam,"local-score":e.localScore,"visitor-score":e.visitorScore,league:e.league,date:e.date,report:e.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):r.createCommentVNode("",!0),e.report.template_type===1&&e.report.pages[0].type==2?(r.openBlock(),r.createBlock(OUe,{key:2,"local-team":e.localTeam,"visitor-team":e.visitorTeam,league:e.league,date:e.date,report:e.report},null,8,["local-team","visitor-team","league","date","report"])):e.report.template_type===2&&e.report.pages[0].type==2?(r.openBlock(),r.createBlock(hqe,{key:3,"local-team":e.localTeam,"visitor-team":e.visitorTeam,"local-score":e.localScore,"visitor-score":e.visitorScore,league:e.league,date:e.date,report:e.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):r.createCommentVNode("",!0),e.report.template_type===1&&e.report.pages[0].type==3?(r.openBlock(),r.createBlock(Vqe,{key:4,"local-team":e.localTeam,"visitor-team":e.visitorTeam,league:e.league,date:e.date,report:e.report},null,8,["local-team","visitor-team","league","date","report"])):e.report.template_type===2&&e.report.pages[0].type==3?(r.openBlock(),r.createBlock(rze,{key:5,"local-team":e.localTeam,"visitor-team":e.visitorTeam,"local-score":e.localScore,"visitor-score":e.visitorScore,league:e.league,date:e.date,report:e.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):e.report.template_type===1&&e.report.pages[0].type==4?(r.openBlock(),r.createBlock(yze,{key:6,"local-team":e.localTeam,"visitor-team":e.visitorTeam,"local-score":e.localScore,"visitor-score":e.visitorScore,league:e.league,date:e.date,report:e.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):e.report.template_type===2&&e.report.pages[0].type==4?(r.openBlock(),r.createBlock(Dze,{key:7,"local-team":e.localTeam,"visitor-team":e.visitorTeam,"local-score":e.localScore,"visitor-score":e.visitorScore,league:e.league,date:e.date,report:e.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"report-img-overlay"},[r.createElementVNode("button",{class:"report-img-button",onClick:b},"Ver reporte")])]),r.createElementVNode("div",Zze,[r.createElementVNode("div",Hze,[r.createElementVNode("div",Yze,r.toDisplayString(e.report.report_name),1),r.createElementVNode("div",Qze,[r.createTextVNode(" Template: "),r.createElementVNode("span",$ze,r.toDisplayString(e.report.name),1)]),r.createElementVNode("div",eCe,r.toDisplayString(e.report.season_name)+" - "+r.toDisplayString(_(e.report.game.matchday_name))+"  |  "+r.toDisplayString(r.unref(Kh)(e.report.game.date_time_utc)),1),r.createElementVNode("div",tCe,r.toDisplayString(e.report.tournament_name),1)])]),j.value?(r.openBlock(),r.createBlock(tLe,{key:0,onClick:h[1]||(h[1]=r.withModifiers(o=>j.value=!1,["self"])),onMouseleave:h[2]||(h[2]=o=>j.value=!1),onVerReporte:g,onRenombrar:m,onEditar:n,onDuplicar:f,onEliminar:l,onDescargar:t})):r.createCommentVNode("",!0),j.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:"tooltip-overlay",onClick:h[3]||(h[3]=o=>j.value=!1)})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-34e6ad47"]]),$1=e=>(r.pushScopeId("data-v-a6ea9581"),e=e(),r.popScopeId(),e),nCe={class:"modal-overlay"},aCe={class:"modal-content"},iCe=[$1(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],oCe=$1(()=>r.createElementVNode("div",{class:"modal-header"},[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename-white.svg",class:"icon-title",alt:"icon"}),r.createElementVNode("span",{class:"modal-title"},"Renombrar Reporte")],-1)),sCe=$1(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),lCe={class:"modal-body"},cCe=$1(()=>r.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),uCe=["placeholder","disabled"],dCe={key:0,class:"error-message"},pCe=$1(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),hCe={class:"modal-footer"},fCe=["disabled"],mCe=["disabled"],yCe={key:0},gCe={key:1},vCe=ml({__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(e,{emit:a}){const i=e,k=a,j=r.ref(i.initialName),g=r.ref(!1),m=r.ref("");r.watch(()=>i.initialName,f=>{j.value=f,m.value=""});async function n(){var f;if(!(j.value.trim().length<3)){g.value=!0,m.value="";try{await es.create({headers:{Authorization:`${i.token}`}}).put(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${i.userId}/reports/${i.reportId}/rename`,{name:j.value.trim()}),k("rename",j.value.trim()),k("refresh"),k("close")}catch(l){console.error("Error al renombrar el reporte:",l),((f=l.response)==null?void 0:f.status)===409?m.value="Ya existe un reporte con el mismo nombre":m.value="Error al renombrar el reporte. Inténtalo de nuevo."}finally{g.value=!1}}}return r.onMounted(()=>{document.body.style.overflow="hidden"}),r.onUnmounted(()=>{document.body.style.overflow=""}),(f,l)=>(r.openBlock(),r.createElementBlock("div",nCe,[r.createElementVNode("div",aCe,[r.createElementVNode("button",{class:"close-btn",onClick:l[0]||(l[0]=t=>f.$emit("close"))},iCe),oCe,sCe,r.createElementVNode("div",lCe,[cCe,r.withDirectives(r.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":l[1]||(l[1]=t=>j.value=t),placeholder:e.initialName,maxlength:"40",autocomplete:"off",disabled:g.value},null,8,uCe),[[r.vModelText,j.value]]),m.value?(r.openBlock(),r.createElementBlock("div",dCe,r.toDisplayString(m.value),1)):r.createCommentVNode("",!0)]),pCe,r.createElementVNode("div",hCe,[r.createElementVNode("button",{class:"cancel-btn",onClick:l[2]||(l[2]=t=>f.$emit("close")),disabled:g.value},"Cancelar",8,fCe),r.createElementVNode("button",{class:"next-btn",disabled:j.value.trim().length<3||g.value,onClick:n},[g.value?(r.openBlock(),r.createElementBlock("span",yCe,"Guardando...")):(r.openBlock(),r.createElementBlock("span",gCe,"Guardar"))],8,mCe)])])]))}},[["__scopeId","data-v-a6ea9581"]]),bCe=e=>(r.pushScopeId("data-v-2bd7ac3a"),e=e(),r.popScopeId(),e),xCe={class:"modal-overlay"},wCe={class:"modal-content"},_Ce=[bCe(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],SCe=r.createStaticVNode('<div class="modal-header" data-v-2bd7ac3a><img src="https://golstatsimages.blob.core.windows.net/reports-images/icn-delete-delete.svg" class="icon-title" alt="icon" data-v-2bd7ac3a><span class="modal-title" data-v-2bd7ac3a>Eliminar reporte</span></div><div class="header-separator" data-v-2bd7ac3a></div><div class="modal-body confirm-text" data-v-2bd7ac3a> ¿Estás seguro que deseas eliminar<br data-v-2bd7ac3a> este reporte? Si lo haces no habrá manera<br data-v-2bd7ac3a> de recuperarlo. </div><div class="header-separator" data-v-2bd7ac3a></div>',4),TCe={class:"modal-footer"},kCe=["disabled"],NCe=["disabled"],VCe=ml({__name:"ModalDeleteReport",props:{reportId:{type:String,required:!0},userId:{type:String,required:!0},token:{type:String,required:!0}},emits:["close","delete","reportDeleted"],setup(e,{emit:a}){const i=e,k=a,j=r.ref(!1),g=async()=>{try{j.value=!0;const n=await es.create({headers:{Authorization:`${i.token}`}}).delete(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${i.userId}/reports/${i.reportId}`);k("reportDeleted",i.reportId),k("close")}catch(m){console.error("Error al eliminar el reporte:",m),alert("Error al eliminar el reporte. Por favor, intenta de nuevo.")}finally{j.value=!1}};return r.onMounted(()=>{document.body.style.overflow="hidden"}),r.onUnmounted(()=>{document.body.style.overflow=""}),(m,n)=>(r.openBlock(),r.createElementBlock("div",xCe,[r.createElementVNode("div",wCe,[r.createElementVNode("button",{class:"close-btn",onClick:n[0]||(n[0]=f=>m.$emit("close"))},_Ce),SCe,r.createElementVNode("div",TCe,[r.createElementVNode("button",{class:"cancel-btn",onClick:n[1]||(n[1]=f=>m.$emit("close")),disabled:j.value},"Cancelar",8,kCe),r.createElementVNode("button",{class:"delete-btn",onClick:g,disabled:j.value},r.toDisplayString(j.value?"Eliminando...":"Eliminar"),9,NCe)])])]))}},[["__scopeId","data-v-2bd7ac3a"]]),I5=e=>(r.pushScopeId("data-v-d40008f8"),e=e(),r.popScopeId(),e),OCe={class:"reports-header"},LCe={class:"count"},UCe={key:0,class:"sort-options"},qCe=["onClick"],zCe={key:0,class:"checkmark"},CCe=[I5(()=>r.createElementVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M5 10.5L9 14.5L15 7.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],PCe={key:0,class:"loading-state"},ECe=[I5(()=>r.createElementVNode("div",{class:"loading-spinner"},null,-1)),I5(()=>r.createElementVNode("p",null,"Cargando reportes...",-1))],FCe={key:1,class:"error-state"},RCe={key:3,class:"empty-reports"},MCe={key:4,class:"empty-reports"},jCe=ml({__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(e,{emit:a}){const i=e,k=a,j=r.ref([]),g=r.ref(!1),m=r.ref(null),n=r.computed(()=>{let W=j.value;if(i.searchQuery.trim()){const K=i.searchQuery.toLowerCase().trim();W=j.value.filter(X=>{var re,ee,Y,$,le,ie,ue;return!!((((re=X.report_name)==null?void 0:re.toLowerCase())||"").includes(K)||(((ee=X.name)==null?void 0:ee.toLowerCase())||"").includes(K)||X.created_at&&new Date(X.created_at).toLocaleDateString("es-ES",{year:"numeric",month:"long",day:"numeric"}).toLowerCase().includes(K)||(Y=X.game)!=null&&Y.date_time_utc&&new Date(X.game.date_time_utc).toLocaleDateString("es-ES",{year:"numeric",month:"long",day:"numeric"}).toLowerCase().includes(K)||(((le=($=X.game)==null?void 0:$.season_name)==null?void 0:le.toLowerCase())||"").includes(K)||(((ie=X.tournament_name)==null?void 0:ie.toLowerCase())||"").includes(K)||(ue=X.game)!=null&&ue.matchday&&X.game.matchday.toString().includes(K))})}return l.value&&(W=[...W].sort((K,X)=>{var D,H;if(l.value==="A - Z"){const ne=(K.report_name||"").toLowerCase(),B=(X.report_name||"").toLowerCase();return ne.localeCompare(B,"es",{sensitivity:"base"})}else if(l.value==="Más recientes"){const ne=new Date(K.created_at||0);return new Date(X.created_at||0)-ne}else if(l.value==="Torneo"){const ne=(K.tournament_name||"").toLowerCase(),B=(X.tournament_name||"").toLowerCase();if(ne!==B)return ne.localeCompare(B,"es",{sensitivity:"base"});const re=K.season_id||0;return(X.season_id||0)-re}else if(l.value==="Jornada"){const ne=((D=K.game)==null?void 0:D.matchday_id)||0,B=((H=X.game)==null?void 0:H.matchday_id)||0;return ne-B}return 0})),W}),f=r.ref(!1),l=r.ref("Más recientes"),t=r.ref(!1),_=r.ref(""),b=r.ref(""),v=r.ref(""),h=r.ref(!1),o=r.ref(""),s=r.ref(""),p=r.ref(null),c=r.ref(null),d=r.ref(null),x=r.ref(0),w=[{label:"A - Z",value:"A - Z"},{label:"Más recientes",value:"Más recientes"},{label:"Torneo",value:"Torneo"},{label:"Jornada",value:"Jornada"}],S=async()=>{g.value=!0,m.value=null;try{const W=await es.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${i.userId}/reports`,{headers:{Authorization:`${i.token}`,"Content-Type":"application/json"}});W.data&&Array.isArray(W.data)?j.value=W.data:W.data&&W.data.reports?j.value=W.data.reports:W.data&&W.data.data?j.value=W.data.data:j.value=[]}catch(W){console.error("Error cargando reportes:",W),console.error("Error response:",W.response),m.value=W.message||"Error al cargar los reportes",j.value=[]}finally{g.value=!1}},V=r.computed(()=>{if(!x.value)return"grid-1-column";const W=340,K=20,D=x.value-40,H=Math.floor((D+K)/(W+K)),ne=Math.max(1,H);return ne>=4?"grid-4-columns":ne>=3?"grid-3-columns":ne>=2?"grid-2-columns":"grid-1-column"}),O=()=>{f.value=!f.value},U=W=>{l.value=W,f.value=!1};function z(W){k("open-report",W)}const L=(W,K)=>{_.value=W,b.value=K;const X=j.value.find(D=>D.id===K);v.value=X?X.template_type:"",t.value=!0},C=W=>{t.value=!1;const K=j.value.findIndex(X=>X.id===b.value);K!==-1&&(j.value[K].report_name=W)},q=W=>{o.value=W.report_name||"Reporte",s.value=W.id,h.value=!0},N=W=>{h.value=!1,j.value=j.value.filter(K=>K.id!==W)};function P(W){k("download-report",W)}const T=W=>{f.value&&p.value&&!p.value.contains(W.target)&&(f.value=!1)},E=()=>{c.value&&(x.value=c.value.offsetWidth)};let R=null;return r.onMounted(async()=>{document.addEventListener("mousedown",T),await S(),await r.nextTick(),E(),window.ResizeObserver?(R=new ResizeObserver(()=>{E()}),c.value&&R.observe(c.value)):window.addEventListener("resize",E)}),r.onBeforeUnmount(()=>{document.removeEventListener("mousedown",T),R?R.disconnect():window.removeEventListener("resize",E)}),(W,K)=>(r.openBlock(),r.createElementBlock("div",{class:"reports-section",ref_key:"reportsSectionRef",ref:c},[r.createElementVNode("div",OCe,[r.createElementVNode("span",null,[r.createTextVNode("Reportes "),r.createElementVNode("span",LCe,"("+r.toDisplayString(n.value.length)+")",1)]),r.createElementVNode("div",{class:"sort-dropdown",ref_key:"sortDropdownRef",ref:p},[r.createElementVNode("button",{class:"sort-button",onClick:O},[r.createTextVNode(r.toDisplayString(l.value||"Ordenar")+" ",1),r.createElementVNode("span",{class:r.normalizeClass(["dropdown-arrow",{rotated:f.value}])},null,2)]),f.value?(r.openBlock(),r.createElementBlock("div",UCe,[(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(w,X=>r.createElementVNode("div",{key:X.value,class:r.normalizeClass(["sort-option",{selected:l.value===X.value}]),onClick:D=>l.value!==X.value&&U(X.value)},[r.createElementVNode("span",null,r.toDisplayString(X.label),1),l.value===X.value?(r.openBlock(),r.createElementBlock("span",zCe,CCe)):r.createCommentVNode("",!0)],10,qCe)),64))])):r.createCommentVNode("",!0)],512)]),g.value?(r.openBlock(),r.createElementBlock("div",PCe,ECe)):m.value?(r.openBlock(),r.createElementBlock("div",FCe,[r.createElementVNode("p",null,"Error al cargar reportes: "+r.toDisplayString(m.value),1),r.createElementVNode("button",{onClick:S,class:"retry-button"},"Reintentar")])):(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["reports-grid",V.value]),ref_key:"reportsGridRef",ref:d},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.value,X=>(r.openBlock(),r.createBlock(rCe,{key:X.id,report:X,onOpenReport:z,onRenombrar:L,onEliminar:q,onDownloadReport:P},null,8,["report"]))),128))],2)),!g.value&&!m.value&&j.value.length===0?(r.openBlock(),r.createElementBlock("div",RCe," No tienes reportes aún. ")):r.createCommentVNode("",!0),!g.value&&!m.value&&j.value.length>0&&n.value.length===0?(r.openBlock(),r.createElementBlock("div",MCe," No se encontraron reportes que coincidan con tu búsqueda. ")):r.createCommentVNode("",!0),t.value?(r.openBlock(),r.createBlock(vCe,{key:5,initialName:_.value,templateType:v.value,token:e.token,userId:e.userId,reportId:b.value,onClose:K[0]||(K[0]=X=>t.value=!1),onRename:C,onRefresh:S},null,8,["initialName","templateType","token","userId","reportId"])):r.createCommentVNode("",!0),h.value?(r.openBlock(),r.createBlock(VCe,{key:6,"report-id":s.value,"user-id":e.userId,token:e.token,onClose:K[1]||(K[1]=X=>h.value=!1),onReportDeleted:N},null,8,["report-id","user-id","token"])):r.createCommentVNode("",!0)],512))}},[["__scopeId","data-v-d40008f8"]]),WCe={class:"modal-overlay"},KCe={class:"modal-content"},ACe=r.createStaticVNode('<div class="modal-icon" data-v-30303ebd><svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-30303ebd><rect x="8" y="10" width="32" height="20" rx="2" stroke="#C0CBE0" stroke-width="2" data-v-30303ebd></rect><rect x="16" y="34" width="16" height="2" rx="1" fill="#C0CBE0" data-v-30303ebd></rect></svg></div><div class="modal-text" data-v-30303ebd> Esta sección solo está disponible para<br data-v-30303ebd> escritorio. Utiliza tu computadora <br data-v-30303ebd>para ingresar. </div>',2),ICe=ml({__name:"ModalSoloEscritorio",setup(e){return(a,i)=>(r.openBlock(),r.createElementBlock("div",WCe,[r.createElementVNode("div",KCe,[ACe,r.createElementVNode("button",{class:"modal-btn",onClick:i[0]||(i[0]=k=>a.$emit("toHome"))},"OK")])]))}},[["__scopeId","data-v-30303ebd"]]),iy=e=>(r.pushScopeId("data-v-9ffb4e12"),e=e(),r.popScopeId(),e),XCe=iy(()=>r.createElementVNode("h1",{class:"title"},"Mis reportes",-1)),DCe={class:"top-bar"},JCe={class:"tabs-container"},BCe={class:"tabs"},GCe={key:0,class:"actions"},ZCe={class:"search-container"},HCe=iy(()=>r.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-search@3x.png",alt:"Buscar",class:"search-icon"},null,-1)),YCe=[iy(()=>r.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M9 3L3 9M3 3L9 9",stroke:"#8B98A9","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],QCe=iy(()=>r.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-agregar@3x.png",alt:"Agregar",class:"create-icon"},null,-1)),$Ce={key:1,class:"actions"},ePe={class:"search-container"},tPe=iy(()=>r.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-search@3x.png",alt:"Buscar",class:"search-icon"},null,-1)),rPe=[iy(()=>r.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M9 3L3 9M3 3L9 9",stroke:"#8B98A9","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],nPe=ml({__name:"gsc-reports",props:{userId:{type:Number,required:!0},team:{type:Number,required:!0},token:{type:String,required:!0}},emits:["toHome","download-report"],setup(e,{emit:a}){const i=e,{userId:k,team:j,token:g}=i,m=r.ref("templates"),n=r.ref(!1),f=r.ref(null),l=r.ref(!1),t=r.ref(""),_=r.ref(""),b=r.ref(null),v=r.ref(null),h=r.ref(0),o=a;function s(){if(f.value){const U=f.value.offsetWidth;n.value=U<1028}}r.watch(n,U=>{U?document.body.style.overflow="hidden":document.body.style.overflow=""}),r.onBeforeUnmount(()=>{document.body.style.overflow=""}),r.onMounted(()=>{s(),window.addEventListener("resize",s)}),r.onBeforeUnmount(()=>{window.removeEventListener("resize",s)});function p(U){c(U)}function c(U){b.value.show({template:U,isTemplateMode:!0})}const d=()=>{t.value=""},x=()=>{_.value=""};function w(U){b.value&&b.value.show({template:U,isTemplateMode:!1})}function S(U){o("download-report",U)}function V(){o("toHome")}function O(){v.value&&v.value.obtenerTemplates(),h.value+=1}return(U,z)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(r.unref(Cke),{ref_key:"reportTemplateMaker",ref:b,token:r.unref(g),"user-team-id":r.unref(j),onClose:O},null,8,["token","user-team-id"]),r.createElementVNode("div",{ref_key:"containerRef",ref:f,class:"reports-container"},[n.value?(r.openBlock(),r.createBlock(ICe,{key:0,onToHome:V})):r.createCommentVNode("",!0),XCe,r.createElementVNode("div",DCe,[r.createElementVNode("div",JCe,[r.createElementVNode("div",BCe,[r.createElementVNode("div",{class:r.normalizeClass(["tab tab-templates",{active:m.value==="templates"}]),onClick:z[0]||(z[0]=L=>m.value="templates")}," Templates ",2),r.createElementVNode("div",{class:r.normalizeClass(["tab tab-reports",{active:m.value==="reports"}]),onClick:z[1]||(z[1]=L=>m.value="reports")}," Tus reportes ",2)])]),m.value==="templates"?(r.openBlock(),r.createElementBlock("div",GCe,[r.createElementVNode("div",ZCe,[HCe,r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":z[2]||(z[2]=L=>t.value=L),class:"search",type:"text",placeholder:"Buscar template"},null,512),[[r.vModelText,t.value]]),t.value?(r.openBlock(),r.createElementBlock("button",{key:0,onClick:d,class:"clear-search-btn",type:"button"},YCe)):r.createCommentVNode("",!0)]),r.createElementVNode("button",{class:"create-template-btn",onClick:z[3]||(z[3]=L=>l.value=!0)},[QCe,r.createTextVNode(" Crear template ")])])):r.createCommentVNode("",!0),m.value==="reports"?(r.openBlock(),r.createElementBlock("div",$Ce,[r.createElementVNode("div",ePe,[tPe,r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":z[4]||(z[4]=L=>_.value=L),class:"search search-reports",type:"text",placeholder:"Buscar reporte"},null,512),[[r.vModelText,_.value]]),_.value?(r.openBlock(),r.createElementBlock("button",{key:0,onClick:x,class:"clear-search-btn",type:"button"},rPe)):r.createCommentVNode("",!0)])])):r.createCommentVNode("",!0)]),m.value==="templates"?(r.openBlock(),r.createBlock(HOe,{ref_key:"templatesSectionRef",ref:v,userId:r.unref(k),token:r.unref(g),team:r.unref(j),searchQuery:t.value,key:h.value,onSwitchToReports:z[5]||(z[5]=L=>m.value="reports"),onOpenModalNewTemplate:p,onEditTemplate:c},null,8,["userId","token","team","searchQuery"])):(r.openBlock(),r.createBlock(jCe,{key:2,userId:r.unref(k),token:r.unref(g),team:r.unref(j),searchQuery:_.value,onOpenReport:w,onDownloadReport:S},null,8,["userId","token","team","searchQuery"])),l.value?(r.openBlock(),r.createBlock(OV,{key:3,token:r.unref(g),team:r.unref(j),onOpenModalNewTemplate:p,onClose:z[6]||(z[6]=L=>l.value=!1)},null,8,["token","team"])):r.createCommentVNode("",!0)],512)],64))}},[["__scopeId","data-v-9ffb4e12"]]),aPe={class:"subcategory-group"},iPe={__name:"SubcategoryGroup",props:{subcategoryGroup:{type:Array,default:()=>[]}},setup(e){return(a,i)=>(r.openBlock(),r.createElementBlock("div",aPe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.subcategoryGroup,k=>(r.openBlock(),r.createBlock(r.unref(l3),{key:k.id,modelValue:k.isSelected,"onUpdate:modelValue":j=>k.isSelected=j,label:k.name},null,8,["modelValue","onUpdate:modelValue","label"]))),128))]))}},oPe=wd(iPe,[["__scopeId","data-v-ae6f3d72"]]),sPe={class:"filter-subcategories"},lPe=Object.freeze(Object.defineProperty({__proto__:null,default:wd({__name:"FilterSubcategories",props:{subcategoryGroups:{type:Array,default:()=>[]}},setup(e){return(a,i)=>(r.openBlock(),r.createElementBlock("div",sPe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.subcategoryGroups,k=>(r.openBlock(),r.createElementBlock("div",{key:k.id,class:"filter-subcategories__group"},[r.createVNode(oPe,{subcategoryGroup:k},null,8,["subcategoryGroup"])]))),128))]))}},[["__scopeId","data-v-5edaefc2"]])},Symbol.toStringTag,{value:"Module"})),C2=e=>(r.pushScopeId("data-v-80d9c265"),e=e(),r.popScopeId(),e),cPe={class:"details__header"},uPe=C2(()=>r.createElementVNode("div",{class:"details__header__title"},"Jugando como",-1)),dPe={class:"details__header__checkbox"},pPe={class:"details__body"},hPe={class:"details__body__playing-as"},fPe=["onClick"],mPe={class:"details__header"},yPe=C2(()=>r.createElementVNode("div",{class:"details__header__title"},"En: (Elige el lapso de tiempo)",-1)),gPe={class:"details__header__checkbox"},vPe={class:"details__body"},bPe=C2(()=>r.createElementVNode("div",{class:"details__body__title"},"1er tiempo",-1)),xPe={class:"details__body__game-section"},wPe=["onClick"],_Pe={class:"details__body"},SPe=C2(()=>r.createElementVNode("div",{class:"details__body__title"},"2do tiempo",-1)),TPe={class:"details__body__game-section"},kPe=["onClick"],NPe=Object.freeze(Object.defineProperty({__proto__:null,default:wd({__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(e){const a=e;r.useCssVars(t=>({"49cba245":e.buttonsBackgroundColor,"52f02da6":e.buttonsTextColor,"7d3f686a":e.buttonsBorderWidth,"7c286a07":e.buttonsBorderColor,"24a6f4aa":e.buttonsBackgroundColorActive,cd8d7768:e.buttonsTextColorActive,"35fa5c10":e.buttonsBorderWidthActive,"0cde1826":e.buttonsBorderColorActive}));const i=r.computed(()=>a.playingAs.every(t=>t.isSelected)),k=r.computed(()=>a.gameSections.every(t=>t.isSelected)),j=r.computed(()=>a.gameSections.reduce((t,_)=>(_.value<=3?t.firstHalf.push(_):t.secondHalf.push(_),t),{firstHalf:[],secondHalf:[]})),g=r.computed(()=>({"--border-radius-first-button":`${a.buttonsBorderRadius} 0 0 ${a.buttonsBorderRadius}`,"--border-radius-last-button":`0 ${a.buttonsBorderRadius} ${a.buttonsBorderRadius} 0`}));function m(t){t?a.playingAs.forEach(_=>{_.isSelected=!0}):a.playingAs.forEach((_,b)=>{_.isSelected=b===0})}function n(t){a.playingAs.filter(_=>_.isSelected).length===1&&t.isSelected||(t.isSelected=!t.isSelected)}function f(t){a.gameSections.filter(_=>_.isSelected).length===1&&t.isSelected||(t.isSelected=!t.isSelected)}function l(t){t?a.gameSections.forEach(_=>{_.isSelected=!0}):a.gameSections.forEach((_,b)=>{_.isSelected=b===0})}return(t,_)=>(r.openBlock(),r.createElementBlock("div",{class:"details",style:r.normalizeStyle(g.value)},[r.createElementVNode("div",cPe,[uPe,r.createElementVNode("div",dPe,[r.createVNode(r.unref(l3),{label:"Todos","model-value":i.value,"onUpdate:modelValue":m},null,8,["model-value"])])]),r.createElementVNode("div",pPe,[r.createElementVNode("div",hPe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.playingAs,(b,v)=>(r.openBlock(),r.createElementBlock("div",{key:`pa${v}`,class:r.normalizeClass(["details__body__button",{active:b.isSelected}]),onClick:h=>n(b)},r.toDisplayString(b.name),11,fPe))),128))])]),r.createElementVNode("div",mPe,[yPe,r.createElementVNode("div",gPe,[r.createVNode(r.unref(l3),{label:"Todos","model-value":k.value,"onUpdate:modelValue":l},null,8,["model-value"])])]),r.createElementVNode("div",vPe,[bPe,r.createElementVNode("div",xPe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value.firstHalf,(b,v)=>(r.openBlock(),r.createElementBlock("div",{key:`pa${v}`,class:r.normalizeClass(["details__body__button",{active:b.isSelected}]),onClick:h=>f(b)},r.toDisplayString(b.text),11,wPe))),128))])]),r.createElementVNode("div",_Pe,[SPe,r.createElementVNode("div",TPe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value.secondHalf,(b,v)=>(r.openBlock(),r.createElementBlock("div",{key:`pa${v}`,class:r.normalizeClass(["details__body__button",{active:b.isSelected}]),onClick:h=>f(b)},r.toDisplayString(b.text),11,kPe))),128))])])],4))}},[["__scopeId","data-v-80d9c265"]])},Symbol.toStringTag,{value:"Module"})),VPe={class:"filter-field"},OPe=Object.freeze(Object.defineProperty({__proto__:null,default:wd({__name:"FilterField",setup(e){const a=r.ref(Array.from({length:16},(k,j)=>j+1));function i(){}return(k,j)=>(r.openBlock(),r.createElementBlock("div",VPe,[r.createVNode(r.unref(fG),{width:"100%","background-color":"#2E3B46",value:a.value,"onUpdate:modelValue":i},null,8,["value"])]))}},[["__scopeId","data-v-8103c3e1"]])},Symbol.toStringTag,{value:"Module"}));tm.GSCReports=nPe,Object.defineProperty(tm,Symbol.toStringTag,{value:"Module"})}));
4147
+ `)}])},r.toDisplayString(j.value),3)):r.createCommentVNode("",!0),pqe])])])]))}},[["__scopeId","data-v-2a752817"]]),qV=e=>(r.pushScopeId("data-v-23601285"),e=e(),r.popScopeId(),e),fqe={class:"prematch-bg"},mqe=qV(()=>r.createElementVNode("div",{class:"title"},[r.createTextVNode("Análisis "),r.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),yqe={class:"subtitle"},gqe={class:"jornada"},vqe={class:"fecha"},bqe={class:"teams-row"},xqe={class:"team team-local"},wqe={class:"escudo-svg"},_qe=["src"],Sqe=qV(()=>r.createElementVNode("div",{class:"divider-line"},[r.createElementVNode("div",{class:"dotted-line"})],-1)),Tqe={class:"team team-visitor"},kqe={class:"escudo-svg"},Nqe=["src"],Vqe=ml({__name:"AnalisisPrematchType3",props:{report:{type:Object,default:()=>({})}},setup(e){function a(k){return k?k.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 i=e;return(k,j)=>(r.openBlock(),r.createElementBlock("div",fqe,[mqe,r.createElementVNode("div",yqe,[r.createElementVNode("span",gqe,r.toDisplayString(a(i.report.game.matchday_name)),1),r.createElementVNode("span",vqe," - "+r.toDisplayString(r.unref(Kh)(i.report.game.date_time_utc)),1)]),r.createElementVNode("div",bqe,[r.createElementVNode("div",xqe,[r.createElementVNode("span",wqe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+i.report.game.home_team+".png"},null,8,_qe)])]),Sqe,r.createElementVNode("div",Tqe,[r.createElementVNode("span",kqe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+i.report.game.visiting_team+".png"},null,8,Nqe)])])])]))}},[["__scopeId","data-v-23601285"]]),ny=e=>(r.pushScopeId("data-v-893ebf20"),e=e(),r.popScopeId(),e),Oqe={class:"prematch-bg"},Lqe=ny(()=>r.createElementVNode("div",{class:"title"},[r.createTextVNode("Análisis "),r.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),Uqe={class:"subtitle"},qqe={class:"jornada"},zqe={class:"fecha"},Cqe={class:"teams-row"},Pqe={class:"team team-local"},Eqe={class:"team-header"},Fqe={class:"escudo-svg"},Rqe=["src"],Mqe={class:"score"},jqe={class:"players-list"},Wqe={class:"player-name"},Kqe=ny(()=>r.createElementVNode("span",{class:"player-icon"},[r.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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)),Aqe={key:0,class:"more-events-indicator"},Iqe=[ny(()=>r.createElementVNode("span",{class:"more-events-text"},"...",-1))],Xqe=ny(()=>r.createElementVNode("div",{class:"divider-line"},[r.createElementVNode("div",{class:"dotted-line"})],-1)),Dqe={class:"team team-visitor"},Jqe={class:"team-header"},Bqe={class:"score"},Gqe={class:"escudo-svg"},Zqe=["src"],Hqe={class:"players-list"},Yqe=ny(()=>r.createElementVNode("span",{class:"player-icon"},[r.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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)),Qqe={class:"player-name"},$qe={key:0},eze={key:0,class:"more-events-indicator"},tze=[ny(()=>r.createElementVNode("span",{class:"more-events-text"},"...",-1))],rze=ml({__name:"AnalisisPostMatchType3",props:{report:{type:Object,default:()=>({})}},setup(e){function a(f){return f?f.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 i=e,k=r.computed(()=>{var f,l,t;return(((t=(l=(f=i.report)==null?void 0:f.game)==null?void 0:l.report_minutes)==null?void 0:t.home_goals_minutes)||[]).slice(0,5)}),j=r.computed(()=>{var f,l,t;return(((t=(l=(f=i.report)==null?void 0:f.game)==null?void 0:l.report_minutes)==null?void 0:t.visiting_goals_minutes)||[]).slice(0,5)});function g(f){const l=Array.from(f.matchAll(/\d+\s*\+*\s*\d*'/g)).map(b=>b[0]).join(", "),t=f.match(/^(.*?)\s*\d+'/),_=t?" "+t[1].trim():"";return{minutos:l,nombre:_}}const m=r.computed(()=>{var l,t,_,b;return(((b=(_=(t=(l=i.report)==null?void 0:l.game)==null?void 0:t.report_minutes)==null?void 0:_.home_goals_minutes)==null?void 0:b.length)||0)>5}),n=r.computed(()=>{var l,t,_,b;return(((b=(_=(t=(l=i.report)==null?void 0:l.game)==null?void 0:t.report_minutes)==null?void 0:_.visiting_goals_minutes)==null?void 0:b.length)||0)>5});return(f,l)=>(r.openBlock(),r.createElementBlock("div",Oqe,[Lqe,r.createElementVNode("div",Uqe,[r.createElementVNode("span",qqe,"Jornada "+r.toDisplayString(a(e.report.game.matchday_name)),1),r.createElementVNode("span",zqe," - "+r.toDisplayString(r.unref(Kh)(e.report.game.date_time_utc)),1)]),r.createElementVNode("div",Cqe,[r.createElementVNode("div",Pqe,[r.createElementVNode("div",Eqe,[r.createElementVNode("span",Fqe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+e.report.game.home_team+".png"},null,8,Rqe)]),r.createElementVNode("div",Mqe,r.toDisplayString(e.report.game.score[0]),1)]),r.createElementVNode("div",jqe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.value,(t,_)=>(r.openBlock(),r.createElementBlock("div",{key:`home-event-${_}`,class:"player-item"},[r.createElementVNode("span",Wqe,r.toDisplayString(t)+" ",1),Kqe]))),128)),m.value?(r.openBlock(),r.createElementBlock("div",Aqe,Iqe)):r.createCommentVNode("",!0)])]),Xqe,r.createElementVNode("div",Dqe,[r.createElementVNode("div",Jqe,[r.createElementVNode("div",Bqe,r.toDisplayString(e.report.game.score[1]),1),r.createElementVNode("span",Gqe,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+e.report.game.visiting_team+".png"},null,8,Zqe)])]),r.createElementVNode("div",Hqe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,(t,_)=>(r.openBlock(),r.createElementBlock("div",{key:`visiting-event-${_}`,class:"player-item"},[Yqe,r.createElementVNode("span",Qqe,[r.createTextVNode(r.toDisplayString(g(t).minutos)+" ",1),g(t).nombre?(r.openBlock(),r.createElementBlock("span",$qe,r.toDisplayString(g(t).nombre),1)):r.createCommentVNode("",!0)])]))),128)),n.value?(r.openBlock(),r.createElementBlock("div",eze,tze)):r.createCommentVNode("",!0)])])])]))}},[["__scopeId","data-v-893ebf20"]]),zV=e=>(r.pushScopeId("data-v-347d4c02"),e=e(),r.popScopeId(),e),nze={class:"prematch-bg"},aze=zV(()=>r.createElementVNode("div",{class:"title"},[r.createTextVNode("Análisis "),r.createElementVNode("span",{class:"highlight"},"Prematch")],-1)),ize={class:"subtitle"},oze={class:"jornada"},sze={class:"fecha"},lze={class:"teams-row"},cze={class:"team team-local"},uze={class:"escudo-svg"},dze=["src"],pze=zV(()=>r.createElementVNode("div",{class:"divider-line"},[r.createElementVNode("div",{class:"dotted-line"})],-1)),hze={class:"team team-visitor"},fze={class:"escudo-svg"},mze=["src"],yze=ml({__name:"AnalisisPrematchType4",props:{report:{type:Object,default:()=>({})}},setup(e){function a(k){return k?k.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 i=e;return(k,j)=>(r.openBlock(),r.createElementBlock("div",nze,[aze,r.createElementVNode("div",ize,[r.createElementVNode("span",oze,r.toDisplayString(a(i.report.game.matchday_name)),1),r.createElementVNode("span",sze," - "+r.toDisplayString(r.unref(Kh)(i.report.game.date_time_utc)),1)]),r.createElementVNode("div",lze,[r.createElementVNode("div",cze,[r.createElementVNode("span",uze,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+i.report.game.home_team+".png"},null,8,dze)])]),pze,r.createElementVNode("div",hze,[r.createElementVNode("span",fze,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+i.report.game.visiting_team+".png"},null,8,mze)])])])]))}},[["__scopeId","data-v-347d4c02"]]),ay=e=>(r.pushScopeId("data-v-9c7a5ed5"),e=e(),r.popScopeId(),e),gze={class:"prematch-bg"},vze=ay(()=>r.createElementVNode("div",{class:"title"},[r.createTextVNode("Análisis "),r.createElementVNode("span",{class:"highlight"},"Postmatch")],-1)),bze={class:"subtitle"},xze={class:"jornada"},wze={class:"fecha"},_ze={class:"teams-row"},Sze={class:"team team-local"},Tze={class:"team-header"},kze={class:"escudo-svg"},Nze=["src"],Vze={class:"score"},Oze={class:"players-list"},Lze={class:"player-name"},Uze=ay(()=>r.createElementVNode("span",{class:"player-icon"},[r.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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)),qze={key:0,class:"more-events-indicator"},zze=[ay(()=>r.createElementVNode("span",{class:"more-events-text"},"...",-1))],Cze=ay(()=>r.createElementVNode("div",{class:"divider-line"},[r.createElementVNode("div",{class:"dotted-line"})],-1)),Pze={class:"team team-visitor"},Eze={class:"team-header"},Fze={class:"score"},Rze={class:"escudo-svg"},Mze=["src"],jze={class:"players-list"},Wze=ay(()=>r.createElementVNode("span",{class:"player-icon"},[r.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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)),Kze={class:"player-name"},Aze={key:0},Ize={key:0,class:"more-events-indicator"},Xze=[ay(()=>r.createElementVNode("span",{class:"more-events-text"},"...",-1))],Dze=ml({__name:"AnalisisPostMatchType4",props:{report:{type:Object,default:()=>({})}},setup(e){function a(f){return f?f.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 i=e,k=r.computed(()=>{var f,l,t;return(((t=(l=(f=i.report)==null?void 0:f.game)==null?void 0:l.report_minutes)==null?void 0:t.home_goals_minutes)||[]).slice(0,5)}),j=r.computed(()=>{var f,l,t;return(((t=(l=(f=i.report)==null?void 0:f.game)==null?void 0:l.report_minutes)==null?void 0:t.visiting_goals_minutes)||[]).slice(0,5)});function g(f){const l=Array.from(f.matchAll(/\d+\s*\+*\s*\d*'/g)).map(b=>b[0]).join(", "),t=f.match(/^(.*?)\s*\d+'/),_=t?t[1].trim():"";return{minutos:l,nombre:_}}const m=r.computed(()=>{var l,t,_,b;return(((b=(_=(t=(l=i.report)==null?void 0:l.game)==null?void 0:t.report_minutes)==null?void 0:_.home_goals_minutes)==null?void 0:b.length)||0)>5}),n=r.computed(()=>{var l,t,_,b;return(((b=(_=(t=(l=i.report)==null?void 0:l.game)==null?void 0:t.report_minutes)==null?void 0:_.visiting_goals_minutes)==null?void 0:b.length)||0)>5});return(f,l)=>(r.openBlock(),r.createElementBlock("div",gze,[vze,r.createElementVNode("div",bze,[r.createElementVNode("span",xze,"Jornada "+r.toDisplayString(a(e.report.game.matchday_name)),1),r.createElementVNode("span",wze," - "+r.toDisplayString(r.unref(Kh)(e.report.game.date_time_utc)),1)]),r.createElementVNode("div",_ze,[r.createElementVNode("div",Sze,[r.createElementVNode("div",Tze,[r.createElementVNode("span",kze,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+e.report.game.home_team+".png"},null,8,Nze)]),r.createElementVNode("div",Vze,r.toDisplayString(e.report.game.score[0]),1)]),r.createElementVNode("div",Oze,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.value,(t,_)=>(r.openBlock(),r.createElementBlock("div",{key:`home-event-${_}`,class:"player-item"},[r.createElementVNode("span",Lze,r.toDisplayString(t)+" ",1),Uze]))),128)),m.value?(r.openBlock(),r.createElementBlock("div",qze,zze)):r.createCommentVNode("",!0)])]),Cze,r.createElementVNode("div",Pze,[r.createElementVNode("div",Eze,[r.createElementVNode("div",Fze,r.toDisplayString(e.report.game.score[1]),1),r.createElementVNode("span",Rze,[r.createElementVNode("img",{width:"55px",src:"https://golstatsimages.blob.core.windows.net/teams-80/"+e.report.game.visiting_team+".png"},null,8,Mze)])]),r.createElementVNode("div",jze,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value,(t,_)=>(r.openBlock(),r.createElementBlock("div",{key:`visiting-event-${_}`,class:"player-item"},[Wze,r.createElementVNode("span",Kze,[r.createTextVNode(r.toDisplayString(g(t).minutos)+" ",1),g(t).nombre?(r.openBlock(),r.createElementBlock("span",Aze," "+r.toDisplayString(g(t).nombre),1)):r.createCommentVNode("",!0)])]))),128)),n.value?(r.openBlock(),r.createElementBlock("div",Ize,Xze)):r.createCommentVNode("",!0)])])])]))}},[["__scopeId","data-v-9c7a5ed5"]]),A5=e=>(r.pushScopeId("data-v-34e6ad47"),e=e(),r.popScopeId(),e),Jze={class:"report-card",style:{position:"relative"}},Bze=[A5(()=>r.createElementVNode("span",null,null,-1)),A5(()=>r.createElementVNode("span",null,null,-1)),A5(()=>r.createElementVNode("span",null,null,-1))],Gze={class:"report-img-placeholder",style:{position:"relative"}},Zze={class:"inner-card-report"},Hze={class:"report-footer"},Yze={class:"report-title"},Qze={class:"report-template"},$ze={class:"template-name"},eCe={class:"report-league"},tCe={class:"report-tournament"},rCe=ml({__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(e,{emit:a}){const i=a,k=e,j=r.ref(!1);function g(){j.value=!1,i("open-report",k.report)}function m(){j.value=!1,i("renombrar",k.report.report_name||"Reporte",k.report.id)}function n(){j.value=!1,i("edit-template",k.report)}function f(){j.value=!1}function l(){j.value=!1,i("eliminar",k.report)}function t(){i("download-report",k.report),j.value=!1}function _(v){return v?v.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 b(){i("open-report",k.report)}return(v,h)=>(r.openBlock(),r.createElementBlock("div",Jze,[r.createElementVNode("div",{class:"three-dots",onClick:h[0]||(h[0]=r.withModifiers(o=>j.value=!j.value,["stop"]))},Bze),r.createElementVNode("div",Gze,[e.report.template_type===1&&e.report.pages[0].type==1?(r.openBlock(),r.createBlock(_Le,{key:0,"local-team":e.localTeam,"visitor-team":e.visitorTeam,league:e.league,date:e.date,report:e.report},null,8,["local-team","visitor-team","league","date","report"])):e.report.template_type===2&&e.report.pages[0].type==1?(r.openBlock(),r.createBlock(sUe,{key:1,"local-team":e.localTeam,"visitor-team":e.visitorTeam,"local-score":e.localScore,"visitor-score":e.visitorScore,league:e.league,date:e.date,report:e.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):r.createCommentVNode("",!0),e.report.template_type===1&&e.report.pages[0].type==2?(r.openBlock(),r.createBlock(OUe,{key:2,"local-team":e.localTeam,"visitor-team":e.visitorTeam,league:e.league,date:e.date,report:e.report},null,8,["local-team","visitor-team","league","date","report"])):e.report.template_type===2&&e.report.pages[0].type==2?(r.openBlock(),r.createBlock(hqe,{key:3,"local-team":e.localTeam,"visitor-team":e.visitorTeam,"local-score":e.localScore,"visitor-score":e.visitorScore,league:e.league,date:e.date,report:e.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):r.createCommentVNode("",!0),e.report.template_type===1&&e.report.pages[0].type==3?(r.openBlock(),r.createBlock(Vqe,{key:4,"local-team":e.localTeam,"visitor-team":e.visitorTeam,league:e.league,date:e.date,report:e.report},null,8,["local-team","visitor-team","league","date","report"])):e.report.template_type===2&&e.report.pages[0].type==3?(r.openBlock(),r.createBlock(rze,{key:5,"local-team":e.localTeam,"visitor-team":e.visitorTeam,"local-score":e.localScore,"visitor-score":e.visitorScore,league:e.league,date:e.date,report:e.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):e.report.template_type===1&&e.report.pages[0].type==4?(r.openBlock(),r.createBlock(yze,{key:6,"local-team":e.localTeam,"visitor-team":e.visitorTeam,"local-score":e.localScore,"visitor-score":e.visitorScore,league:e.league,date:e.date,report:e.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):e.report.template_type===2&&e.report.pages[0].type==4?(r.openBlock(),r.createBlock(Dze,{key:7,"local-team":e.localTeam,"visitor-team":e.visitorTeam,"local-score":e.localScore,"visitor-score":e.visitorScore,league:e.league,date:e.date,report:e.report},null,8,["local-team","visitor-team","local-score","visitor-score","league","date","report"])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"report-img-overlay"},[r.createElementVNode("button",{class:"report-img-button",onClick:b},"Ver reporte")])]),r.createElementVNode("div",Zze,[r.createElementVNode("div",Hze,[r.createElementVNode("div",Yze,r.toDisplayString(e.report.report_name),1),r.createElementVNode("div",Qze,[r.createTextVNode(" Template: "),r.createElementVNode("span",$ze,r.toDisplayString(e.report.name),1)]),r.createElementVNode("div",eCe,r.toDisplayString(e.report.season_name)+" - "+r.toDisplayString(_(e.report.game.matchday_name))+"  |  "+r.toDisplayString(r.unref(Kh)(e.report.game.date_time_utc)),1),r.createElementVNode("div",tCe,r.toDisplayString(e.report.tournament_name),1)])]),j.value?(r.openBlock(),r.createBlock(tLe,{key:0,onClick:h[1]||(h[1]=r.withModifiers(o=>j.value=!1,["self"])),onMouseleave:h[2]||(h[2]=o=>j.value=!1),onVerReporte:g,onRenombrar:m,onEditar:n,onDuplicar:f,onEliminar:l,onDescargar:t})):r.createCommentVNode("",!0),j.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:"tooltip-overlay",onClick:h[3]||(h[3]=o=>j.value=!1)})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-34e6ad47"]]),$1=e=>(r.pushScopeId("data-v-a6ea9581"),e=e(),r.popScopeId(),e),nCe={class:"modal-overlay"},aCe={class:"modal-content"},iCe=[$1(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],oCe=$1(()=>r.createElementVNode("div",{class:"modal-header"},[r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-rename-white.svg",class:"icon-title",alt:"icon"}),r.createElementVNode("span",{class:"modal-title"},"Renombrar Reporte")],-1)),sCe=$1(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),lCe={class:"modal-body"},cCe=$1(()=>r.createElementVNode("div",{class:"modal-label"},"Nombre:",-1)),uCe=["placeholder","disabled"],dCe={key:0,class:"error-message"},pCe=$1(()=>r.createElementVNode("div",{class:"header-separator"},null,-1)),hCe={class:"modal-footer"},fCe=["disabled"],mCe=["disabled"],yCe={key:0},gCe={key:1},vCe=ml({__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(e,{emit:a}){const i=e,k=a,j=r.ref(i.initialName),g=r.ref(!1),m=r.ref("");r.watch(()=>i.initialName,f=>{j.value=f,m.value=""});async function n(){var f;if(!(j.value.trim().length<3)){g.value=!0,m.value="";try{await es.create({headers:{Authorization:`${i.token}`}}).put(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${i.userId}/reports/${i.reportId}/rename`,{name:j.value.trim()}),k("rename",j.value.trim()),k("refresh"),k("close")}catch(l){console.error("Error al renombrar el reporte:",l),((f=l.response)==null?void 0:f.status)===409?m.value="Ya existe un reporte con el mismo nombre":m.value="Error al renombrar el reporte. Inténtalo de nuevo."}finally{g.value=!1}}}return r.onMounted(()=>{document.body.style.overflow="hidden"}),r.onUnmounted(()=>{document.body.style.overflow=""}),(f,l)=>(r.openBlock(),r.createElementBlock("div",nCe,[r.createElementVNode("div",aCe,[r.createElementVNode("button",{class:"close-btn",onClick:l[0]||(l[0]=t=>f.$emit("close"))},iCe),oCe,sCe,r.createElementVNode("div",lCe,[cCe,r.withDirectives(r.createElementVNode("input",{class:"template-name-input",type:"text","onUpdate:modelValue":l[1]||(l[1]=t=>j.value=t),placeholder:e.initialName,maxlength:"40",autocomplete:"off",disabled:g.value},null,8,uCe),[[r.vModelText,j.value]]),m.value?(r.openBlock(),r.createElementBlock("div",dCe,r.toDisplayString(m.value),1)):r.createCommentVNode("",!0)]),pCe,r.createElementVNode("div",hCe,[r.createElementVNode("button",{class:"cancel-btn",onClick:l[2]||(l[2]=t=>f.$emit("close")),disabled:g.value},"Cancelar",8,fCe),r.createElementVNode("button",{class:"next-btn",disabled:j.value.trim().length<3||g.value,onClick:n},[g.value?(r.openBlock(),r.createElementBlock("span",yCe,"Guardando...")):(r.openBlock(),r.createElementBlock("span",gCe,"Guardar"))],8,mCe)])])]))}},[["__scopeId","data-v-a6ea9581"]]),bCe=e=>(r.pushScopeId("data-v-2bd7ac3a"),e=e(),r.popScopeId(),e),xCe={class:"modal-overlay"},wCe={class:"modal-content"},_Ce=[bCe(()=>r.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/reports-images/icn-close.svg",alt:"Cerrar"},null,-1))],SCe=r.createStaticVNode('<div class="modal-header" data-v-2bd7ac3a><img src="https://golstatsimages.blob.core.windows.net/reports-images/icn-delete-delete.svg" class="icon-title" alt="icon" data-v-2bd7ac3a><span class="modal-title" data-v-2bd7ac3a>Eliminar reporte</span></div><div class="header-separator" data-v-2bd7ac3a></div><div class="modal-body confirm-text" data-v-2bd7ac3a> ¿Estás seguro que deseas eliminar<br data-v-2bd7ac3a> este reporte? Si lo haces no habrá manera<br data-v-2bd7ac3a> de recuperarlo. </div><div class="header-separator" data-v-2bd7ac3a></div>',4),TCe={class:"modal-footer"},kCe=["disabled"],NCe=["disabled"],VCe=ml({__name:"ModalDeleteReport",props:{reportId:{type:String,required:!0},userId:{type:String,required:!0},token:{type:String,required:!0}},emits:["close","delete","reportDeleted"],setup(e,{emit:a}){const i=e,k=a,j=r.ref(!1),g=async()=>{try{j.value=!0;const n=await es.create({headers:{Authorization:`${i.token}`}}).delete(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${i.userId}/reports/${i.reportId}`);k("reportDeleted",i.reportId),k("close")}catch(m){console.error("Error al eliminar el reporte:",m),alert("Error al eliminar el reporte. Por favor, intenta de nuevo.")}finally{j.value=!1}};return r.onMounted(()=>{document.body.style.overflow="hidden"}),r.onUnmounted(()=>{document.body.style.overflow=""}),(m,n)=>(r.openBlock(),r.createElementBlock("div",xCe,[r.createElementVNode("div",wCe,[r.createElementVNode("button",{class:"close-btn",onClick:n[0]||(n[0]=f=>m.$emit("close"))},_Ce),SCe,r.createElementVNode("div",TCe,[r.createElementVNode("button",{class:"cancel-btn",onClick:n[1]||(n[1]=f=>m.$emit("close")),disabled:j.value},"Cancelar",8,kCe),r.createElementVNode("button",{class:"delete-btn",onClick:g,disabled:j.value},r.toDisplayString(j.value?"Eliminando...":"Eliminar"),9,NCe)])])]))}},[["__scopeId","data-v-2bd7ac3a"]]),I5=e=>(r.pushScopeId("data-v-d40008f8"),e=e(),r.popScopeId(),e),OCe={class:"reports-header"},LCe={class:"count"},UCe={key:0,class:"sort-options"},qCe=["onClick"],zCe={key:0,class:"checkmark"},CCe=[I5(()=>r.createElementVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M5 10.5L9 14.5L15 7.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],PCe={key:0,class:"loading-state"},ECe=[I5(()=>r.createElementVNode("div",{class:"loading-spinner"},null,-1)),I5(()=>r.createElementVNode("p",null,"Cargando reportes...",-1))],FCe={key:1,class:"error-state"},RCe={key:3,class:"empty-reports"},MCe={key:4,class:"empty-reports"},jCe=ml({__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(e,{emit:a}){const i=e,k=a,j=r.ref([]),g=r.ref(!1),m=r.ref(null),n=r.computed(()=>{let W=j.value;if(i.searchQuery.trim()){const K=i.searchQuery.toLowerCase().trim();W=j.value.filter(X=>{var re,ee,Y,$,le,ie,ue;return!!((((re=X.report_name)==null?void 0:re.toLowerCase())||"").includes(K)||(((ee=X.name)==null?void 0:ee.toLowerCase())||"").includes(K)||X.created_at&&new Date(X.created_at).toLocaleDateString("es-ES",{year:"numeric",month:"long",day:"numeric"}).toLowerCase().includes(K)||(Y=X.game)!=null&&Y.date_time_utc&&new Date(X.game.date_time_utc).toLocaleDateString("es-ES",{year:"numeric",month:"long",day:"numeric"}).toLowerCase().includes(K)||(((le=($=X.game)==null?void 0:$.season_name)==null?void 0:le.toLowerCase())||"").includes(K)||(((ie=X.tournament_name)==null?void 0:ie.toLowerCase())||"").includes(K)||(ue=X.game)!=null&&ue.matchday&&X.game.matchday.toString().includes(K))})}return l.value&&(W=[...W].sort((K,X)=>{var D,H;if(l.value==="A - Z"){const ne=(K.report_name||"").toLowerCase(),B=(X.report_name||"").toLowerCase();return ne.localeCompare(B,"es",{sensitivity:"base"})}else if(l.value==="Más recientes"){const ne=new Date(K.created_at||0);return new Date(X.created_at||0)-ne}else if(l.value==="Torneo"){const ne=(K.tournament_name||"").toLowerCase(),B=(X.tournament_name||"").toLowerCase();if(ne!==B)return ne.localeCompare(B,"es",{sensitivity:"base"});const re=K.season_id||0;return(X.season_id||0)-re}else if(l.value==="Jornada"){const ne=((D=K.game)==null?void 0:D.matchday_id)||0,B=((H=X.game)==null?void 0:H.matchday_id)||0;return ne-B}return 0})),W}),f=r.ref(!1),l=r.ref("Más recientes"),t=r.ref(!1),_=r.ref(""),b=r.ref(""),v=r.ref(""),h=r.ref(!1),o=r.ref(""),s=r.ref(""),p=r.ref(null),c=r.ref(null),d=r.ref(null),x=r.ref(0),w=[{label:"A - Z",value:"A - Z"},{label:"Más recientes",value:"Más recientes"},{label:"Torneo",value:"Torneo"},{label:"Jornada",value:"Jornada"}],S=async()=>{g.value=!0,m.value=null;try{const W=await es.get(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${i.userId}/reports`,{headers:{Authorization:`${i.token}`,"Content-Type":"application/json"}});W.data&&Array.isArray(W.data)?j.value=W.data:W.data&&W.data.reports?j.value=W.data.reports:W.data&&W.data.data?j.value=W.data.data:j.value=[]}catch(W){console.error("Error cargando reportes:",W),console.error("Error response:",W.response),m.value=W.message||"Error al cargar los reportes",j.value=[]}finally{g.value=!1}},V=r.computed(()=>{if(!x.value)return"grid-1-column";const W=340,K=20,D=x.value-40,H=Math.floor((D+K)/(W+K)),ne=Math.max(1,H);return ne>=4?"grid-4-columns":ne>=3?"grid-3-columns":ne>=2?"grid-2-columns":"grid-1-column"}),O=()=>{f.value=!f.value},U=W=>{l.value=W,f.value=!1};function z(W){k("open-report",W)}const L=(W,K)=>{_.value=W,b.value=K;const X=j.value.find(D=>D.id===K);v.value=X?X.template_type:"",t.value=!0},C=W=>{t.value=!1;const K=j.value.findIndex(X=>X.id===b.value);K!==-1&&(j.value[K].report_name=W)},q=W=>{o.value=W.report_name||"Reporte",s.value=W.id,h.value=!0},N=W=>{h.value=!1,j.value=j.value.filter(K=>K.id!==W)};function P(W){k("download-report",W)}const T=W=>{f.value&&p.value&&!p.value.contains(W.target)&&(f.value=!1)},E=()=>{c.value&&(x.value=c.value.offsetWidth)};let R=null;return r.onMounted(async()=>{document.addEventListener("mousedown",T),await S(),await r.nextTick(),E(),window.ResizeObserver?(R=new ResizeObserver(()=>{E()}),c.value&&R.observe(c.value)):window.addEventListener("resize",E)}),r.onBeforeUnmount(()=>{document.removeEventListener("mousedown",T),R?R.disconnect():window.removeEventListener("resize",E)}),(W,K)=>(r.openBlock(),r.createElementBlock("div",{class:"reports-section",ref_key:"reportsSectionRef",ref:c},[r.createElementVNode("div",OCe,[r.createElementVNode("span",null,[r.createTextVNode("Reportes "),r.createElementVNode("span",LCe,"("+r.toDisplayString(n.value.length)+")",1)]),r.createElementVNode("div",{class:"sort-dropdown",ref_key:"sortDropdownRef",ref:p},[r.createElementVNode("button",{class:"sort-button",onClick:O},[r.createTextVNode(r.toDisplayString(l.value||"Ordenar")+" ",1),r.createElementVNode("span",{class:r.normalizeClass(["dropdown-arrow",{rotated:f.value}])},null,2)]),f.value?(r.openBlock(),r.createElementBlock("div",UCe,[(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(w,X=>r.createElementVNode("div",{key:X.value,class:r.normalizeClass(["sort-option",{selected:l.value===X.value}]),onClick:D=>l.value!==X.value&&U(X.value)},[r.createElementVNode("span",null,r.toDisplayString(X.label),1),l.value===X.value?(r.openBlock(),r.createElementBlock("span",zCe,CCe)):r.createCommentVNode("",!0)],10,qCe)),64))])):r.createCommentVNode("",!0)],512)]),g.value?(r.openBlock(),r.createElementBlock("div",PCe,ECe)):m.value?(r.openBlock(),r.createElementBlock("div",FCe,[r.createElementVNode("p",null,"Error al cargar reportes: "+r.toDisplayString(m.value),1),r.createElementVNode("button",{onClick:S,class:"retry-button"},"Reintentar")])):(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["reports-grid",V.value]),ref_key:"reportsGridRef",ref:d},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.value,X=>(r.openBlock(),r.createBlock(rCe,{key:X.id,report:X,onOpenReport:z,onRenombrar:L,onEliminar:q,onDownloadReport:P},null,8,["report"]))),128))],2)),!g.value&&!m.value&&j.value.length===0?(r.openBlock(),r.createElementBlock("div",RCe," No tienes reportes aún. ")):r.createCommentVNode("",!0),!g.value&&!m.value&&j.value.length>0&&n.value.length===0?(r.openBlock(),r.createElementBlock("div",MCe," No se encontraron reportes que coincidan con tu búsqueda. ")):r.createCommentVNode("",!0),t.value?(r.openBlock(),r.createBlock(vCe,{key:5,initialName:_.value,templateType:v.value,token:e.token,userId:e.userId,reportId:b.value,onClose:K[0]||(K[0]=X=>t.value=!1),onRename:C,onRefresh:S},null,8,["initialName","templateType","token","userId","reportId"])):r.createCommentVNode("",!0),h.value?(r.openBlock(),r.createBlock(VCe,{key:6,"report-id":s.value,"user-id":e.userId,token:e.token,onClose:K[1]||(K[1]=X=>h.value=!1),onReportDeleted:N},null,8,["report-id","user-id","token"])):r.createCommentVNode("",!0)],512))}},[["__scopeId","data-v-d40008f8"]]),WCe={class:"modal-overlay"},KCe={class:"modal-content"},ACe=r.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),ICe=ml({__name:"ModalSoloEscritorio",setup(e){return(a,i)=>(r.openBlock(),r.createElementBlock("div",WCe,[r.createElementVNode("div",KCe,[ACe,r.createElementVNode("button",{class:"modal-btn",onClick:i[0]||(i[0]=k=>a.$emit("toHome"))},"OK")])]))}},[["__scopeId","data-v-76d7f6ed"]]),iy=e=>(r.pushScopeId("data-v-9ffb4e12"),e=e(),r.popScopeId(),e),XCe=iy(()=>r.createElementVNode("h1",{class:"title"},"Mis reportes",-1)),DCe={class:"top-bar"},JCe={class:"tabs-container"},BCe={class:"tabs"},GCe={key:0,class:"actions"},ZCe={class:"search-container"},HCe=iy(()=>r.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-search@3x.png",alt:"Buscar",class:"search-icon"},null,-1)),YCe=[iy(()=>r.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M9 3L3 9M3 3L9 9",stroke:"#8B98A9","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],QCe=iy(()=>r.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-agregar@3x.png",alt:"Agregar",class:"create-icon"},null,-1)),$Ce={key:1,class:"actions"},ePe={class:"search-container"},tPe=iy(()=>r.createElementVNode("img",{src:"http://golstatsimages.blob.core.windows.net/playlist-icons/icn-search@3x.png",alt:"Buscar",class:"search-icon"},null,-1)),rPe=[iy(()=>r.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M9 3L3 9M3 3L9 9",stroke:"#8B98A9","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],nPe=ml({__name:"gsc-reports",props:{userId:{type:Number,required:!0},team:{type:Number,required:!0},token:{type:String,required:!0}},emits:["toHome","download-report"],setup(e,{emit:a}){const i=e,{userId:k,team:j,token:g}=i,m=r.ref("templates"),n=r.ref(!1),f=r.ref(null),l=r.ref(!1),t=r.ref(""),_=r.ref(""),b=r.ref(null),v=r.ref(null),h=r.ref(0),o=a;function s(){if(f.value){const U=f.value.offsetWidth;n.value=U<1028}}r.watch(n,U=>{U?document.body.style.overflow="hidden":document.body.style.overflow=""}),r.onBeforeUnmount(()=>{document.body.style.overflow=""}),r.onMounted(()=>{s(),window.addEventListener("resize",s)}),r.onBeforeUnmount(()=>{window.removeEventListener("resize",s)});function p(U){c(U)}function c(U){b.value.show({template:U,isTemplateMode:!0})}const d=()=>{t.value=""},x=()=>{_.value=""};function w(U){b.value&&b.value.show({template:U,isTemplateMode:!1})}function S(U){o("download-report",U)}function V(){o("toHome")}function O(){v.value&&v.value.obtenerTemplates(),h.value+=1}return(U,z)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(r.unref(Cke),{ref_key:"reportTemplateMaker",ref:b,token:r.unref(g),"user-team-id":r.unref(j),onClose:O},null,8,["token","user-team-id"]),r.createElementVNode("div",{ref_key:"containerRef",ref:f,class:"reports-container"},[n.value?(r.openBlock(),r.createBlock(ICe,{key:0,onToHome:V})):r.createCommentVNode("",!0),XCe,r.createElementVNode("div",DCe,[r.createElementVNode("div",JCe,[r.createElementVNode("div",BCe,[r.createElementVNode("div",{class:r.normalizeClass(["tab tab-templates",{active:m.value==="templates"}]),onClick:z[0]||(z[0]=L=>m.value="templates")}," Templates ",2),r.createElementVNode("div",{class:r.normalizeClass(["tab tab-reports",{active:m.value==="reports"}]),onClick:z[1]||(z[1]=L=>m.value="reports")}," Tus reportes ",2)])]),m.value==="templates"?(r.openBlock(),r.createElementBlock("div",GCe,[r.createElementVNode("div",ZCe,[HCe,r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":z[2]||(z[2]=L=>t.value=L),class:"search",type:"text",placeholder:"Buscar template"},null,512),[[r.vModelText,t.value]]),t.value?(r.openBlock(),r.createElementBlock("button",{key:0,onClick:d,class:"clear-search-btn",type:"button"},YCe)):r.createCommentVNode("",!0)]),r.createElementVNode("button",{class:"create-template-btn",onClick:z[3]||(z[3]=L=>l.value=!0)},[QCe,r.createTextVNode(" Crear template ")])])):r.createCommentVNode("",!0),m.value==="reports"?(r.openBlock(),r.createElementBlock("div",$Ce,[r.createElementVNode("div",ePe,[tPe,r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":z[4]||(z[4]=L=>_.value=L),class:"search search-reports",type:"text",placeholder:"Buscar reporte"},null,512),[[r.vModelText,_.value]]),_.value?(r.openBlock(),r.createElementBlock("button",{key:0,onClick:x,class:"clear-search-btn",type:"button"},rPe)):r.createCommentVNode("",!0)])])):r.createCommentVNode("",!0)]),m.value==="templates"?(r.openBlock(),r.createBlock(HOe,{ref_key:"templatesSectionRef",ref:v,userId:r.unref(k),token:r.unref(g),team:r.unref(j),searchQuery:t.value,key:h.value,onSwitchToReports:z[5]||(z[5]=L=>m.value="reports"),onOpenModalNewTemplate:p,onEditTemplate:c},null,8,["userId","token","team","searchQuery"])):(r.openBlock(),r.createBlock(jCe,{key:2,userId:r.unref(k),token:r.unref(g),team:r.unref(j),searchQuery:_.value,onOpenReport:w,onDownloadReport:S},null,8,["userId","token","team","searchQuery"])),l.value?(r.openBlock(),r.createBlock(OV,{key:3,token:r.unref(g),team:r.unref(j),onOpenModalNewTemplate:p,onClose:z[6]||(z[6]=L=>l.value=!1)},null,8,["token","team"])):r.createCommentVNode("",!0)],512)],64))}},[["__scopeId","data-v-9ffb4e12"]]),aPe={class:"subcategory-group"},iPe={__name:"SubcategoryGroup",props:{subcategoryGroup:{type:Array,default:()=>[]}},setup(e){return(a,i)=>(r.openBlock(),r.createElementBlock("div",aPe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.subcategoryGroup,k=>(r.openBlock(),r.createBlock(r.unref(l3),{key:k.id,modelValue:k.isSelected,"onUpdate:modelValue":j=>k.isSelected=j,label:k.name},null,8,["modelValue","onUpdate:modelValue","label"]))),128))]))}},oPe=wd(iPe,[["__scopeId","data-v-ae6f3d72"]]),sPe={class:"filter-subcategories"},lPe=Object.freeze(Object.defineProperty({__proto__:null,default:wd({__name:"FilterSubcategories",props:{subcategoryGroups:{type:Array,default:()=>[]}},setup(e){return(a,i)=>(r.openBlock(),r.createElementBlock("div",sPe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.subcategoryGroups,k=>(r.openBlock(),r.createElementBlock("div",{key:k.id,class:"filter-subcategories__group"},[r.createVNode(oPe,{subcategoryGroup:k},null,8,["subcategoryGroup"])]))),128))]))}},[["__scopeId","data-v-5edaefc2"]])},Symbol.toStringTag,{value:"Module"})),C2=e=>(r.pushScopeId("data-v-80d9c265"),e=e(),r.popScopeId(),e),cPe={class:"details__header"},uPe=C2(()=>r.createElementVNode("div",{class:"details__header__title"},"Jugando como",-1)),dPe={class:"details__header__checkbox"},pPe={class:"details__body"},hPe={class:"details__body__playing-as"},fPe=["onClick"],mPe={class:"details__header"},yPe=C2(()=>r.createElementVNode("div",{class:"details__header__title"},"En: (Elige el lapso de tiempo)",-1)),gPe={class:"details__header__checkbox"},vPe={class:"details__body"},bPe=C2(()=>r.createElementVNode("div",{class:"details__body__title"},"1er tiempo",-1)),xPe={class:"details__body__game-section"},wPe=["onClick"],_Pe={class:"details__body"},SPe=C2(()=>r.createElementVNode("div",{class:"details__body__title"},"2do tiempo",-1)),TPe={class:"details__body__game-section"},kPe=["onClick"],NPe=Object.freeze(Object.defineProperty({__proto__:null,default:wd({__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(e){const a=e;r.useCssVars(t=>({"49cba245":e.buttonsBackgroundColor,"52f02da6":e.buttonsTextColor,"7d3f686a":e.buttonsBorderWidth,"7c286a07":e.buttonsBorderColor,"24a6f4aa":e.buttonsBackgroundColorActive,cd8d7768:e.buttonsTextColorActive,"35fa5c10":e.buttonsBorderWidthActive,"0cde1826":e.buttonsBorderColorActive}));const i=r.computed(()=>a.playingAs.every(t=>t.isSelected)),k=r.computed(()=>a.gameSections.every(t=>t.isSelected)),j=r.computed(()=>a.gameSections.reduce((t,_)=>(_.value<=3?t.firstHalf.push(_):t.secondHalf.push(_),t),{firstHalf:[],secondHalf:[]})),g=r.computed(()=>({"--border-radius-first-button":`${a.buttonsBorderRadius} 0 0 ${a.buttonsBorderRadius}`,"--border-radius-last-button":`0 ${a.buttonsBorderRadius} ${a.buttonsBorderRadius} 0`}));function m(t){t?a.playingAs.forEach(_=>{_.isSelected=!0}):a.playingAs.forEach((_,b)=>{_.isSelected=b===0})}function n(t){a.playingAs.filter(_=>_.isSelected).length===1&&t.isSelected||(t.isSelected=!t.isSelected)}function f(t){a.gameSections.filter(_=>_.isSelected).length===1&&t.isSelected||(t.isSelected=!t.isSelected)}function l(t){t?a.gameSections.forEach(_=>{_.isSelected=!0}):a.gameSections.forEach((_,b)=>{_.isSelected=b===0})}return(t,_)=>(r.openBlock(),r.createElementBlock("div",{class:"details",style:r.normalizeStyle(g.value)},[r.createElementVNode("div",cPe,[uPe,r.createElementVNode("div",dPe,[r.createVNode(r.unref(l3),{label:"Todos","model-value":i.value,"onUpdate:modelValue":m},null,8,["model-value"])])]),r.createElementVNode("div",pPe,[r.createElementVNode("div",hPe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.playingAs,(b,v)=>(r.openBlock(),r.createElementBlock("div",{key:`pa${v}`,class:r.normalizeClass(["details__body__button",{active:b.isSelected}]),onClick:h=>n(b)},r.toDisplayString(b.name),11,fPe))),128))])]),r.createElementVNode("div",mPe,[yPe,r.createElementVNode("div",gPe,[r.createVNode(r.unref(l3),{label:"Todos","model-value":k.value,"onUpdate:modelValue":l},null,8,["model-value"])])]),r.createElementVNode("div",vPe,[bPe,r.createElementVNode("div",xPe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value.firstHalf,(b,v)=>(r.openBlock(),r.createElementBlock("div",{key:`pa${v}`,class:r.normalizeClass(["details__body__button",{active:b.isSelected}]),onClick:h=>f(b)},r.toDisplayString(b.text),11,wPe))),128))])]),r.createElementVNode("div",_Pe,[SPe,r.createElementVNode("div",TPe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(j.value.secondHalf,(b,v)=>(r.openBlock(),r.createElementBlock("div",{key:`pa${v}`,class:r.normalizeClass(["details__body__button",{active:b.isSelected}]),onClick:h=>f(b)},r.toDisplayString(b.text),11,kPe))),128))])])],4))}},[["__scopeId","data-v-80d9c265"]])},Symbol.toStringTag,{value:"Module"})),VPe={class:"filter-field"},OPe=Object.freeze(Object.defineProperty({__proto__:null,default:wd({__name:"FilterField",setup(e){const a=r.ref(Array.from({length:16},(k,j)=>j+1));function i(){}return(k,j)=>(r.openBlock(),r.createElementBlock("div",VPe,[r.createVNode(r.unref(fG),{width:"100%","background-color":"#2E3B46",value:a.value,"onUpdate:modelValue":i},null,8,["value"])]))}},[["__scopeId","data-v-8103c3e1"]])},Symbol.toStringTag,{value:"Module"}));tm.GSCReports=nPe,Object.defineProperty(tm,Symbol.toStringTag,{value:"Module"})}));