@golstats/gsc-reports 1.0.114 → 1.0.116

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.
@@ -7990,7 +7990,7 @@ uniform ${gi} ${vi} u_${$i};
7990
7990
  * see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
7991
7991
  */const u_=new sHe;class Rh{static init(r={},n=".grid-stack"){if(typeof document>"u")return null;const v=Rh.getGridElement(n);return v?(v.gridstack||(v.gridstack=new Rh(v,ru.cloneDeep(r))),v.gridstack):(console.error(typeof n=="string"?'GridStack.initAll() no grid was found with selector "'+n+`" - element missing or wrong selector ?
7992
7992
  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(r={},n=".grid-stack"){const v=[];return typeof document>"u"||(Rh.getGridElements(n).forEach($=>{$.gridstack||($.gridstack=new Rh($,ru.cloneDeep(r))),v.push($.gridstack)}),v.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+n+`" - element missing or wrong selector ?
7993
- Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),v}static addGrid(r,n={}){if(!r)return null;let v=r;if(v.gridstack){const $=v.gridstack;return n&&($.opts={...$.opts,...n}),n.children!==void 0&&$.load(n.children),$}return(!r.classList.contains("grid-stack")||Rh.addRemoveCB)&&(Rh.addRemoveCB?v=Rh.addRemoveCB(r,n,!0,!0):v=ru.createDiv(["grid-stack",n.class],r)),Rh.init(n,v)}static registerEngine(r){Rh.engineClass=r}get placeholder(){if(!this._placeholder){this._placeholder=ru.createDiv([this.opts.placeholderClass,T3.itemClass,this.opts.itemClass]);const r=ru.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(r.textContent=this.opts.placeholderText)}return this._placeholder}constructor(r,n={}){var v;this.el=r,this.opts=n,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},r.gridstack=this,this.opts=n=n||{},r.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),n.row&&(n.minRow=n.maxRow=n.row,delete n.row);const $=ru.toNumber(r.getAttribute("gs-row"));n.column==="auto"&&delete n.column,n.alwaysShowResizeHandle!==void 0&&(n._alwaysShowResizeHandle=n.alwaysShowResizeHandle);const h=n.columnOpts;if(h){const a=h.breakpoints;!h.columnWidth&&!(a!=null&&a.length)?delete n.columnOpts:(h.columnMax=h.columnMax||12,(a==null?void 0:a.length)>1&&a.sort((k,T)=>(T.w||0)-(k.w||0)))}const u={...ru.cloneDeep(T3),column:ru.toNumber(r.getAttribute("gs-column"))||T3.column,minRow:$||ru.toNumber(r.getAttribute("gs-min-row"))||T3.minRow,maxRow:$||ru.toNumber(r.getAttribute("gs-max-row"))||T3.maxRow,staticGrid:ru.toBool(r.getAttribute("gs-static"))||T3.staticGrid,sizeToContent:ru.toBool(r.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(n.handleClass?"."+n.handleClass:n.handle?n.handle:"")||T3.draggable.handle},removableOptions:{accept:n.itemClass||T3.removableOptions.accept,decline:T3.removableOptions.decline}};r.getAttribute("gs-animate")&&(u.animate=ru.toBool(r.getAttribute("gs-animate"))),n=ru.defaults(n,u),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(n),n.rtl==="auto"&&(n.rtl=r.style.direction==="rtl"),n.rtl&&this.el.classList.add("grid-stack-rtl");const i=this.el.closest("."+T3.itemClass),p=i==null?void 0:i.gridstackNode;if(p&&(p.subGrid=this,this.parentGridNode=p,this.el.classList.add("grid-stack-nested"),p.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=n.cellHeight==="auto",this._isAutoCellHeight||n.cellHeight==="initial")this.cellHeight(void 0);else{typeof n.cellHeight=="number"&&n.cellHeightUnit&&n.cellHeightUnit!==T3.cellHeightUnit&&(n.cellHeight=n.cellHeight+n.cellHeightUnit,delete n.cellHeightUnit);const a=n.cellHeight;delete n.cellHeight,this.cellHeight(a)}n.alwaysShowResizeHandle==="mobile"&&(n.alwaysShowResizeHandle=Gw),this._setStaticClass();const c=n.engineClass||Rh.engineClass||P4;if(this.engine=new c({column:this.getColumn(),float:n.float,maxRow:n.maxRow,onChange:a=>{a.forEach(k=>{const T=k.el;T&&(k._removeDOM?(T&&T.remove(),delete k._removeDOM):this._writePosAttr(T,k))}),this._updateContainerHeight()}}),n.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(a=>this._prepareElement(a)),delete this.engine._loading,this.batchUpdate(!1)),n.children){const a=n.children;delete n.children,a.length&&this.load(a)}this.setAnimation(),n.subGridDynamic&&!Mf.pauseDrag&&(Mf.pauseDrag=!0),((v=n.draggable)==null?void 0:v.pause)!==void 0&&(Mf.pauseDrag=n.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(r=this.opts){this.el.classList.add("gs-"+r.column),typeof r.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/r.column}%`)}addWidget(r){if(!r)return;if(typeof r=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(r.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(r);let n,v=r;if(v.grid=this,v.el?n=v.el:Rh.addRemoveCB?n=Rh.addRemoveCB(this.el,r,!0,!1):n=this.createWidgetDivs(v),!n)return;if(v=n.gridstackNode,v&&n.parentElement===this.el&&this.engine.nodes.find(h=>h._id===v._id))return n;const $=this._readAttr(n);return ru.defaults(r,$),this.engine.prepareNode(r),this.el.appendChild(n),this.makeWidget(n,r),n}createWidgetDivs(r){const n=ru.createDiv(["grid-stack-item",this.opts.itemClass]),v=ru.createDiv(["grid-stack-item-content"],n);return ru.lazyLoad(r)?r.visibleObservable||(r.visibleObservable=new IntersectionObserver(([$])=>{var h,u;$.isIntersecting&&((h=r.visibleObservable)==null||h.disconnect(),delete r.visibleObservable,Rh.renderCB(v,r),(u=r.grid)==null||u.prepareDragDrop(r.el))}),window.setTimeout(()=>{var $;return($=r.visibleObservable)==null?void 0:$.observe(n)})):Rh.renderCB(v,r),n}makeSubGrid(r,n,v,$=!0){var h,u,i;let p=r.gridstackNode;if(p||(p=this.makeWidget(r).gridstackNode),(h=p.subGrid)!=null&&h.el)return p.subGrid;let c,a=this;for(;a&&!c;)c=(u=a.opts)==null?void 0:u.subGridOpts,a=(i=a.parentGridNode)==null?void 0:i.grid;n=ru.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...c||{},...n||p.subGridOpts||{}}),p.subGridOpts=n;let k;n.column==="auto"&&(k=!0,n.column=Math.max(p.w||1,(v==null?void 0:v.w)||1),delete n.columnOpts);let T=p.el.querySelector(".grid-stack-item-content"),x,d;if($&&(this._removeDD(p.el),d={...p,x:0,y:0},ru.removeInternalForSave(d),delete d.subGridOpts,p.content&&(d.content=p.content,delete p.content),Rh.addRemoveCB?x=Rh.addRemoveCB(this.el,d,!0,!1):(x=ru.createDiv(["grid-stack-item"]),x.appendChild(T),T=ru.createDiv(["grid-stack-item-content"],p.el)),this.prepareDragDrop(p.el)),v){const l=k?n.column:p.w,s=p.h+v.h,f=p.el.style;f.transition="none",this.update(p.el,{w:l,h:s}),setTimeout(()=>f.transition=null)}const o=p.subGrid=Rh.addGrid(T,n);return v!=null&&v._moving&&(o._isTemp=!0),k&&(o._autoColumn=!0),$&&o.makeWidget(x,d),v&&(v._moving?window.setTimeout(()=>ru.simulateMouseEvent(v._event,"mouseenter",o.el),0):o.makeWidget(p.el,p)),this.resizeToContentCheck(!1,p),o}removeAsSubGrid(r){var n;const v=(n=this.parentGridNode)==null?void 0:n.grid;v&&(v.batchUpdate(),v.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach($=>{$.x+=this.parentGridNode.x,$.y+=this.parentGridNode.y,v.makeWidget($.el,$)}),v.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,r&&window.setTimeout(()=>ru.simulateMouseEvent(r._event,"mouseenter",v.el),0))}save(r=!0,n=!1,v=Rh.saveCB,$){const h=this.engine.save(r,v,$);if(h.forEach(u=>{var i;if(r&&u.el&&!u.subGrid&&!v){const p=u.el.querySelector(".grid-stack-item-content");u.content=p==null?void 0:p.innerHTML,u.content||delete u.content}else if(!r&&!v&&delete u.content,(i=u.subGrid)!=null&&i.el){const p=u.w||u.subGrid.getColumn(),c=u.subGrid.save(r,n,v,p);u.subGridOpts=n?c:{children:c},delete u.subGrid}delete u.el}),n){const u=ru.cloneDeep(this.opts);u.marginBottom===u.marginTop&&u.marginRight===u.marginLeft&&u.marginTop===u.marginRight&&(u.margin=u.marginTop,delete u.marginTop,delete u.marginRight,delete u.marginBottom,delete u.marginLeft),u.rtl===(this.el.style.direction==="rtl")&&(u.rtl="auto"),this._isAutoCellHeight&&(u.cellHeight="auto"),this._autoColumn&&(u.column="auto");const i=u._alwaysShowResizeHandle;return delete u._alwaysShowResizeHandle,i!==void 0?u.alwaysShowResizeHandle=i:delete u.alwaysShowResizeHandle,ru.removeInternalAndSame(u,T3),u.children=h,u}return h}load(r,n=Rh.addRemoveCB||!0){r=ru.cloneDeep(r);const v=this.getColumn();r.forEach(a=>{a.w=a.w||a.minW||1,a.h=a.h||a.minH||1}),r=ru.sort(r),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let $=0;r.forEach(a=>{$=Math.max($,(a.x||0)+a.w)}),$>this.engine.defaultColumn&&(this.engine.defaultColumn=$),$>v&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=r,this.engine.columnChanged($,v,this.responseLayout),r=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(r,$,!0));const h=Rh.addRemoveCB;typeof n=="function"&&(Rh.addRemoveCB=n);const u=[];this.batchUpdate();const i=!this.engine.nodes.length,p=i&&this.opts.animate;p&&this.setAnimation(!1),!i&&n&&[...this.engine.nodes].forEach(a=>{a.id&&(ru.find(r,a.id)||(Rh.addRemoveCB&&Rh.addRemoveCB(this.el,a,!1,!1),u.push(a),this.removeWidget(a.el,!0,!1)))}),this.engine._loading=!0;const c=[];return this.engine.nodes=this.engine.nodes.filter(a=>ru.find(r,a.id)?(c.push(a),!1):!0),r.forEach(a=>{var k;const T=ru.find(c,a.id);if(T){if(ru.shouldSizeToContent(T)&&(a.h=T.h),this.engine.nodeBoundFix(a),(a.autoPosition||a.x===void 0||a.y===void 0)&&(a.w=a.w||T.w,a.h=a.h||T.h,this.engine.findEmptyPosition(a)),this.engine.nodes.push(T),ru.samePos(T,a)&&this.engine.nodes.length>1&&(this.moveNode(T,{...a,forceCollide:!0}),ru.copyPos(a,T)),this.update(T.el,a),(k=a.subGridOpts)!=null&&k.children){const x=T.el.querySelector(".grid-stack");x&&x.gridstack&&x.gridstack.load(a.subGridOpts.children)}}else n&&this.addWidget(a)}),delete this.engine._loading,this.engine.removedNodes=u,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,h?Rh.addRemoveCB=h:delete Rh.addRemoveCB,p&&this.setAnimation(!0,!0),this}batchUpdate(r=!0){return this.engine.batchUpdate(r),r||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(r=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!r||!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 n=this.el.querySelector("."+this.opts.itemClass);if(n){const $=ru.toNumber(n.getAttribute("gs-h"))||1;return Math.round(n.offsetHeight/$)}const v=parseInt(this.el.getAttribute("gs-current-row"));return v?Math.round(this.el.getBoundingClientRect().height/v):this.opts.cellHeight}cellHeight(r){if(r!==void 0&&this._isAutoCellHeight!==(r==="auto")&&(this._isAutoCellHeight=r==="auto",this._updateResizeEvent()),(r==="initial"||r==="auto")&&(r=void 0),r===void 0){const v=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;r=this.cellWidth()+v}const n=ru.parseHeight(r);return this.opts.cellHeightUnit===n.unit&&this.opts.cellHeight===n.h?this:(this.opts.cellHeightUnit=n.unit,this.opts.cellHeight=n.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(r=!1){var n;return r&&(n=this.opts.columnOpts)!=null&&n.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var r,n;const v=this.opts.columnOpts;if(!v||!v.columnWidth&&!((r=v.breakpoints)!=null&&r.length))return!1;const $=this.getColumn();let h=$;const u=this._widthOrContainer(!0);if(v.columnWidth)h=Math.min(Math.round(u/v.columnWidth)||1,v.columnMax);else{h=v.columnMax;let i=0;for(;i<v.breakpoints.length&&u<=v.breakpoints[i].w;)h=v.breakpoints[i++].c||$}if(h!==$){const i=(n=v.breakpoints)==null?void 0:n.find(p=>p.c===h);return this.column(h,(i==null?void 0:i.layout)||v.layout),!0}return!1}compact(r="compact",n=!0){return this.engine.compact(r,n),this._triggerChangeEvent(),this}column(r,n="moveScale"){if(!r||r<1||this.opts.column===r)return this;const v=this.getColumn();return this.opts.column=r,this.engine?(this.engine.column=r,this.el.classList.remove("gs-"+v),this._updateColumnVar(),this.engine.columnChanged(v,r,n),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=n,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(r=>r.matches("."+this.opts.itemClass)&&!r.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(r=!0){var n;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),r?this.el.parentNode.removeChild(this.el):(this.removeAll(r),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,(n=this._placeholder)==null||delete n.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(r){return this.opts.float!==r&&(this.opts.float=this.engine.float=r,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(r,n=!1){const v=this.el.getBoundingClientRect();let $;n?$={top:v.top+document.documentElement.scrollTop,left:v.left}:$={top:this.el.offsetTop,left:this.el.offsetLeft};const h=r.left-$.left,u=r.top-$.top,i=v.width/this.getColumn(),p=v.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(h/i),y:Math.floor(u/p)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(r,n,v,$){return this.engine.isAreaEmpty(r,n,v,$)}makeWidget(r,n){const v=Rh.getElement(r);if(!v||v.gridstackNode)return v;v.parentElement||this.el.appendChild(v),this._prepareElement(v,!0,n);const $=v.gridstackNode;this._updateContainerHeight(),$.subGridOpts&&this.makeSubGrid(v,$.subGridOpts,void 0,!1);let h;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(h=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),h&&delete this._ignoreLayoutsNodeChange,v}on(r,n){return r.indexOf(" ")!==-1?(r.split(" ").forEach(v=>this.on(v,n)),this):(r==="change"||r==="added"||r==="removed"||r==="enable"||r==="disable"?(r==="enable"||r==="disable"?this._gsEventHandler[r]=v=>n(v):this._gsEventHandler[r]=v=>{v.detail&&n(v,v.detail)},this.el.addEventListener(r,this._gsEventHandler[r])):r==="drag"||r==="dragstart"||r==="dragstop"||r==="resizestart"||r==="resize"||r==="resizestop"||r==="dropped"||r==="resizecontent"?this._gsEventHandler[r]=n:console.error("GridStack.on("+r+") event not supported"),this)}off(r){return r.indexOf(" ")!==-1?(r.split(" ").forEach(n=>this.off(n)),this):((r==="change"||r==="added"||r==="removed"||r==="enable"||r==="disable")&&this._gsEventHandler[r]&&this.el.removeEventListener(r,this._gsEventHandler[r]),delete this._gsEventHandler[r],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(r=>this.off(r)),this}removeWidget(r,n=!0,v=!0){return r?(Rh.getElements(r).forEach($=>{if($.parentElement&&$.parentElement!==this.el)return;let h=$.gridstackNode;h||(h=this.engine.nodes.find(u=>$===u.el)),h&&(n&&Rh.addRemoveCB&&Rh.addRemoveCB(this.el,h,!1,!1),delete $.gridstackNode,this._removeDD($),this.engine.removeNode(h,n,v),n&&$.parentElement&&$.remove())}),v&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(r=!0,n=!0){return this.engine.nodes.forEach(v=>{r&&Rh.addRemoveCB&&Rh.addRemoveCB(this.el,v,!1,!1),delete v.el.gridstackNode,this.opts.staticGrid||this._removeDD(v.el)}),this.engine.removeAll(r,n),n&&this._triggerRemoveEvent(),this}setAnimation(r=this.opts.animate,n){return n?setTimeout(()=>{this.opts&&this.setAnimation(r)}):r?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=r,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(r,n=!0,v=!0){return!!this.opts.staticGrid===r?this:(r?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach($=>{this.prepareDragDrop($.el),$.subGrid&&v&&$.subGrid.setStatic(r,n,v)}),n&&this._setStaticClass(),this)}updateOptions(r){var n;const v=this.opts;return r===v?this:(r.acceptWidgets!==void 0&&(v.acceptWidgets=r.acceptWidgets,this._setupAcceptWidget()),r.animate!==void 0&&this.setAnimation(r.animate),r.cellHeight&&this.cellHeight(r.cellHeight),r.class!==void 0&&r.class!==v.class&&(v.class&&this.el.classList.remove(v.class),r.class&&this.el.classList.add(r.class)),r.columnOpts?(this.opts.columnOpts=r.columnOpts,this.checkDynamicColumn()):r.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof r.column=="number"&&this.column(r.column),r.margin!==void 0&&this.margin(r.margin),r.staticGrid!==void 0&&this.setStatic(r.staticGrid),r.disableDrag!==void 0&&!r.staticGrid&&this.enableMove(!r.disableDrag),r.disableResize!==void 0&&!r.staticGrid&&this.enableResize(!r.disableResize),r.float!==void 0&&this.float(r.float),r.row!==void 0?(v.minRow=v.maxRow=v.row=r.row,this._updateContainerHeight()):(r.minRow!==void 0&&(v.minRow=r.minRow,this._updateContainerHeight()),r.maxRow!==void 0&&(v.maxRow=r.maxRow)),r.lazyLoad!==void 0&&(v.lazyLoad=r.lazyLoad),(n=r.children)!=null&&n.length&&this.load(r.children),this)}update(r,n){return Rh.getElements(r).forEach(v=>{var $;const h=v==null?void 0:v.gridstackNode;if(!h)return;const u={...ru.copyPos({},h),...ru.cloneDeep(n)};this.engine.nodeBoundFix(u),delete u.autoPosition;const i=["x","y","w","h"];let p;if(i.some(k=>u[k]!==void 0&&u[k]!==h[k])&&(p={},i.forEach(k=>{p[k]=u[k]!==void 0?u[k]:h[k],delete u[k]})),!p&&(u.minW||u.minH||u.maxW||u.maxH)&&(p={}),u.content!==void 0){const k=v.querySelector(".grid-stack-item-content");k&&k.textContent!==u.content&&(h.content=u.content,Rh.renderCB(k,u),($=h.subGrid)!=null&&$.el&&(k.appendChild(h.subGrid.el),h.subGrid._updateContainerHeight())),delete u.content}let c=!1,a=!1;for(const k in u)k[0]!=="_"&&h[k]!==u[k]&&(h[k]=u[k],c=!0,a=a||!this.opts.staticGrid&&(k==="noResize"||k==="noMove"||k==="locked"));if(ru.sanitizeMinMax(h),p){const k=p.w!==void 0&&p.w!==h.w;this.moveNode(h,p),k&&h.subGrid?h.subGrid.onResize(this.hasAnimationCSS()?h.w:void 0):this.resizeToContentCheck(k,h),delete h._orig}(p||c)&&this._writeAttr(v,h),a&&this.prepareDragDrop(h.el),Rh.updateCB&&Rh.updateCB(h)}),this}moveNode(r,n){const v=r._updating;v||this.engine.cleanNodes().beginUpdate(r),this.engine.moveNode(r,n),this._updateContainerHeight(),v||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(r){var n,v;if(!r||(r.classList.remove("size-to-content-max"),!r.clientHeight))return;const $=r.gridstackNode;if(!$)return;const h=$.grid;if(!h||r.parentElement!==h.el)return;const u=h.getCellHeight(!0);if(!u)return;let i=$.h?$.h*u:r.clientHeight,p;if($.resizeToContentParent&&(p=r.querySelector($.resizeToContentParent)),p||(p=r.querySelector(Rh.resizeToContentParent)),!p)return;const c=r.clientHeight-p.clientHeight,a=$.h?$.h*u-c:p.clientHeight;let k;if($.subGrid){k=$.subGrid.getRow()*$.subGrid.getCellHeight(!0);const d=$.subGrid.el.getBoundingClientRect(),o=r.getBoundingClientRect();k+=d.top-o.top}else{if((v=(n=$.subGridOpts)==null?void 0:n.children)!=null&&v.length)return;{const d=p.firstElementChild;if(!d){console.error(`Error: GridStack.resizeToContent() widget id:${$.id} '${Rh.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}k=d.getBoundingClientRect().height||a}}if(a===k)return;i+=k-a;let T=Math.ceil(i/u);const x=Number.isInteger($.sizeToContent)?$.sizeToContent:0;x&&T>x&&(T=x,r.classList.add("size-to-content-max")),$.minH&&T<$.minH?T=$.minH:$.maxH&&T>$.maxH&&(T=$.maxH),T!==$.h&&(h._ignoreLayoutsNodeChange=!0,h.moveNode($,{h:T}),delete h._ignoreLayoutsNodeChange)}resizeToContentCBCheck(r){Rh.resizeToContentCB?Rh.resizeToContentCB(r):this.resizeToContent(r)}rotate(r,n){return Rh.getElements(r).forEach(v=>{const $=v.gridstackNode;if(!ru.canBeRotated($))return;const h={w:$.h,h:$.w,minH:$.minW,minW:$.minH,maxH:$.maxW,maxW:$.maxH};if(n){const i=n.left>0?Math.floor(n.left/this.cellWidth()):0,p=n.top>0?Math.floor(n.top/this.opts.cellHeight):0;h.x=$.x+i-($.h-(p+1)),h.y=$.y+p-i}Object.keys(h).forEach(i=>{h[i]===void 0&&delete h[i]});const u=$._orig;this.update(v,h),$._orig=u}),this}margin(r){if(!(typeof r=="string"&&r.split(" ").length>1)){const n=ru.parseHeight(r);if(this.opts.marginUnit===n.unit&&this.opts.margin===n.h)return}return this.opts.margin=r,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(r){return this.engine.willItFit(r)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const r=this.engine.getDirtyNodes(!0);return r&&r.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(r),this._triggerEvent("change",r)),this.engine.saveInitial(),this}_triggerAddEvent(){var r;if(this.engine.batchMode)return this;if((r=this.engine.addedNodes)!=null&&r.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(v=>{delete v._dirty});const n=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",n)}return this}_triggerRemoveEvent(){var r;if(this.engine.batchMode)return this;if((r=this.engine.removedNodes)!=null&&r.length){const n=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",n)}return this}_triggerEvent(r,n){const v=n?new CustomEvent(r,{bubbles:!1,detail:n}):new Event(r);let $=this;for(;$.parentGridNode;)$=$.parentGridNode.grid;return $.el.dispatchEvent(v),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const r=this.parentGridNode;let n=this.getRow()+this._extraDragRow;const v=this.opts.cellHeight,$=this.opts.cellHeightUnit;if(!v)return this;if(!r&&!this.opts.minRow){const h=ru.parseHeight(getComputedStyle(this.el).minHeight);if(h.h>0&&h.unit===$){const u=Math.floor(h.h/v);n<u&&(n=u)}}return this.el.setAttribute("gs-current-row",String(n)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),n&&(this.el.style[r?"minHeight":"height"]=n*v+$),r&&ru.shouldSizeToContent(r)&&r.grid.resizeToContentCBCheck(r.el),this}_prepareElement(r,n=!1,v){v=v||this._readAttr(r),r.gridstackNode=v,v.el=r,v.grid=this,v=this.engine.addNode(v,n),this._writeAttr(r,v),r.classList.add(T3.itemClass,this.opts.itemClass);const $=ru.shouldSizeToContent(v);return $?r.classList.add("size-to-content"):r.classList.remove("size-to-content"),$&&this.resizeToContentCheck(!1,v),ru.lazyLoad(v)||this.prepareDragDrop(v.el),this}_writePosAttr(r,n){return(!n._moving&&!n._resizing||this._placeholder===r)&&(r.style.top=n.y?n.y===1?"var(--gs-cell-height)":`calc(${n.y} * var(--gs-cell-height))`:null,r.style.left=n.x?n.x===1?"var(--gs-column-width)":`calc(${n.x} * var(--gs-column-width))`:null,r.style.width=n.w>1?`calc(${n.w} * var(--gs-column-width))`:null,r.style.height=n.h>1?`calc(${n.h} * var(--gs-cell-height))`:null),r.setAttribute("gs-x",String(n.x)),r.setAttribute("gs-y",String(n.y)),n.w>1?r.setAttribute("gs-w",String(n.w)):r.removeAttribute("gs-w"),n.h>1?r.setAttribute("gs-h",String(n.h)):r.removeAttribute("gs-h"),this}_writeAttr(r,n){if(!n)return this;this._writePosAttr(r,n);const v={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const $ in v)n[$]?r.setAttribute(v[$],String(n[$])):r.removeAttribute(v[$]);return this}_readAttr(r,n=!0){const v={};v.x=ru.toNumber(r.getAttribute("gs-x")),v.y=ru.toNumber(r.getAttribute("gs-y")),v.w=ru.toNumber(r.getAttribute("gs-w")),v.h=ru.toNumber(r.getAttribute("gs-h")),v.autoPosition=ru.toBool(r.getAttribute("gs-auto-position")),v.noResize=ru.toBool(r.getAttribute("gs-no-resize")),v.noMove=ru.toBool(r.getAttribute("gs-no-move")),v.locked=ru.toBool(r.getAttribute("gs-locked"));const $=r.getAttribute("gs-size-to-content");$&&($==="true"||$==="false"?v.sizeToContent=ru.toBool($):v.sizeToContent=parseInt($,10)),v.id=r.getAttribute("gs-id"),v.maxW=ru.toNumber(r.getAttribute("gs-max-w")),v.minW=ru.toNumber(r.getAttribute("gs-min-w")),v.maxH=ru.toNumber(r.getAttribute("gs-max-h")),v.minH=ru.toNumber(r.getAttribute("gs-min-h")),n&&(v.w===1&&r.removeAttribute("gs-w"),v.h===1&&r.removeAttribute("gs-h"),v.maxW&&r.removeAttribute("gs-max-w"),v.minW&&r.removeAttribute("gs-min-w"),v.maxH&&r.removeAttribute("gs-max-h"),v.minH&&r.removeAttribute("gs-min-h"));for(const h in v){if(!v.hasOwnProperty(h))return;!v[h]&&v[h]!==0&&h!=="sizeToContent"&&delete v[h]}return v}_setStaticClass(){const r=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...r),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...r),this.el.removeAttribute("gs-static")),this}onResize(r=(n=>(n=this.el)==null?void 0:n.clientWidth)()){if(!r||this.prevWidth===r)return;this.prevWidth=r,this.batchUpdate();let n=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),n=!0):n=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(v=>{v.subGrid&&v.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(n),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(r=!1,n=void 0){if(this.engine){if(r&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,n),this.animationDelay);if(n)ru.shouldSizeToContent(n)&&this.resizeToContentCBCheck(n.el);else if(this.engine.nodes.some(v=>ru.shouldSizeToContent(v))){const v=[...this.engine.nodes];this.batchUpdate(),v.forEach($=>{ru.shouldSizeToContent($)&&this.resizeToContentCBCheck($.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,n?[n]:this.engine.nodes)}}_updateResizeEvent(r=!1){const n=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(v=>v.sizeToContent));return!r&&n&&!this.resizeObserver?(this._sizeThrottle=ru.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(r||!n)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(r=".grid-stack-item"){return ru.getElement(r)}static getElements(r=".grid-stack-item"){return ru.getElements(r)}static getGridElement(r){return Rh.getElement(r)}static getGridElements(r){return ru.getElements(r)}_initMargin(){let r,n=0,v=[];typeof this.opts.margin=="string"&&(v=this.opts.margin.split(" ")),v.length===2?(this.opts.marginTop=this.opts.marginBottom=v[0],this.opts.marginLeft=this.opts.marginRight=v[1]):v.length===4?(this.opts.marginTop=v[0],this.opts.marginRight=v[1],this.opts.marginBottom=v[2],this.opts.marginLeft=v[3]):(r=ru.parseHeight(this.opts.margin),this.opts.marginUnit=r.unit,n=this.opts.margin=r.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(h=>{this.opts[h]===void 0?this.opts[h]=n:(r=ru.parseHeight(this.opts[h]),this.opts[h]=r.h,delete this.opts.margin)}),this.opts.marginUnit=r.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 $=this.el.style;return $.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),$.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),$.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),$.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return u_}static setupDragIn(r,n,v,$=document){(n==null?void 0:n.pause)!==void 0&&(Mf.pauseDrag=n.pause),n={appendTo:"body",helper:"clone",...n||{}},(typeof r=="string"?ru.getElements(r,$):r).forEach((h,u)=>{u_.isDraggable(h)||u_.dragIn(h,n),v!=null&&v[u]&&(h.gridstackNode=v[u])})}movable(r,n){return this.opts.staticGrid?this:(Rh.getElements(r).forEach(v=>{const $=v.gridstackNode;$&&(n?delete $.noMove:$.noMove=!0,this.prepareDragDrop($.el))}),this)}resizable(r,n){return this.opts.staticGrid?this:(Rh.getElements(r).forEach(v=>{const $=v.gridstackNode;$&&(n?delete $.noResize:$.noResize=!0,this.prepareDragDrop($.el))}),this)}disable(r=!0){if(!this.opts.staticGrid)return this.enableMove(!1,r),this.enableResize(!1,r),this._triggerEvent("disable"),this}enable(r=!0){if(!this.opts.staticGrid)return this.enableMove(!0,r),this.enableResize(!0,r),this._triggerEvent("enable"),this}enableMove(r,n=!0){return this.opts.staticGrid?this:(r?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(v=>{this.prepareDragDrop(v.el),v.subGrid&&n&&v.subGrid.enableMove(r,n)}),this)}enableResize(r,n=!0){return this.opts.staticGrid?this:(r?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(v=>{this.prepareDragDrop(v.el),v.subGrid&&n&&v.subGrid.enableResize(r,n)}),this)}cancelDrag(){var r;const n=(r=this._placeholder)==null?void 0:r.gridstackNode;n&&(n._isExternal?(n._isAboutToRemove=!0,this.engine.removeNode(n)):n._isAboutToRemove&&Rh._itemRemoving(n.el,!1),this.engine.restoreInitial())}_removeDD(r){return u_.draggable(r,"destroy").resizable(r,"destroy"),r.gridstackNode&&delete r.gridstackNode._initDD,delete r.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return u_.droppable(this.el,"destroy"),this;let r,n;const v=($,h,u)=>{var i;u=u||h;const p=u.gridstackNode;if(!p)return;if(!((i=p.grid)!=null&&i.el)){u.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const x=u.getBoundingClientRect();u.style.left=x.x+(this.dragTransform.xScale-1)*($.clientX-x.x)/this.dragTransform.xScale+"px",u.style.top=x.y+(this.dragTransform.yScale-1)*($.clientY-x.y)/this.dragTransform.yScale+"px",u.style.transformOrigin="0px 0px"}let{top:c,left:a}=u.getBoundingClientRect();const k=this.el.getBoundingClientRect();a-=k.left,c-=k.top;const T={position:{top:c*this.dragTransform.xScale,left:a*this.dragTransform.yScale}};if(p._temporaryRemoved){if(p.x=Math.max(0,Math.round(a/n)),p.y=Math.max(0,Math.round(c/r)),delete p.autoPosition,this.engine.nodeBoundFix(p),!this.engine.willItFit(p)){if(p.autoPosition=!0,!this.engine.willItFit(p)){u_.off(h,"drag");return}p._willFitPos&&(ru.copyPos(p,p._willFitPos),delete p._willFitPos)}this._onStartMoving(u,$,T,p,n,r)}else this._dragOrResize(u,$,T,p,n,r)};return u_.droppable(this.el,{accept:$=>{const h=$.gridstackNode||this._readAttr($,!1);if((h==null?void 0:h.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let u=!0;if(typeof this.opts.acceptWidgets=="function")u=this.opts.acceptWidgets($);else{const i=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;u=$.matches(i)}if(u&&h&&this.opts.maxRow){const i={w:h.w,h:h.h,minW:h.minW,minH:h.minH};u=this.engine.willItFit(i)}return u}}).on(this.el,"dropover",($,h,u)=>{let i=(u==null?void 0:u.gridstackNode)||h.gridstackNode;if((i==null?void 0:i.grid)===this&&!i._temporaryRemoved)return!1;if(i!=null&&i._sidebarOrig&&(i.w=i._sidebarOrig.w,i.h=i._sidebarOrig.h),i!=null&&i.grid&&i.grid!==this&&!i._temporaryRemoved&&i.grid._leave(h,u),u=u||h,n=this.cellWidth(),r=this.getCellHeight(!0),!i){const a=u.getAttribute("data-gs-widget")||u.getAttribute("gridstacknode");if(a){try{i=JSON.parse(a)}catch{console.error("Gridstack dropover: Bad JSON format: ",a)}u.removeAttribute("data-gs-widget"),u.removeAttribute("gridstacknode")}i||(i=this._readAttr(u)),i._sidebarOrig={w:i.w,h:i.h}}i.grid||(i.el||(i={...i}),i._isExternal=!0,u.gridstackNode=i);const p=i.w||Math.round(u.offsetWidth/n)||1,c=i.h||Math.round(u.offsetHeight/r)||1;return i.grid&&i.grid!==this?(h._gridstackNodeOrig||(h._gridstackNodeOrig=i),h.gridstackNode=i={...i,w:p,h:c,grid:this},delete i.x,delete i.y,this.engine.cleanupNode(i).nodeBoundFix(i),i._initDD=i._isExternal=i._temporaryRemoved=!0):(i.w=p,i.h=c,i._temporaryRemoved=!0),Rh._itemRemoving(i.el,!1),u_.on(h,"drag",v),v($,h,u),!1}).on(this.el,"dropout",($,h,u)=>{const i=(u==null?void 0:u.gridstackNode)||h.gridstackNode;return i&&(!i.grid||i.grid===this)&&(this._leave(h,u),this._isTemp&&this.removeAsSubGrid(i)),!1}).on(this.el,"drop",($,h,u)=>{var i,p,c;const a=(u==null?void 0:u.gridstackNode)||h.gridstackNode;if((a==null?void 0:a.grid)===this&&!a._isExternal)return!1;const k=!!this.placeholder.parentElement,T=h!==u;this.placeholder.remove(),delete this.placeholder.gridstackNode,k&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const x=h._gridstackNodeOrig;if(delete h._gridstackNodeOrig,k&&x!=null&&x.grid&&x.grid!==this){const o=x.grid;o.engine.removeNodeFromLayoutCache(x),o.engine.removedNodes.push(x),o._triggerRemoveEvent()._triggerChangeEvent(),o.parentGridNode&&!o.engine.nodes.length&&o.opts.subGridDynamic&&o.removeAsSubGrid()}if(!a||(k&&(this.engine.cleanupNode(a),a.grid=this),(i=a.grid)==null||delete i._isTemp,u_.off(h,"drag"),u!==h?(u.remove(),h=u):h.remove(),this._removeDD(h),!k))return!1;const d=(c=(p=a.subGrid)==null?void 0:p.el)==null?void 0:c.gridstack;return ru.copyPos(a,this._readAttr(this.placeholder)),ru.removePositioningStyles(h),T&&(a.content||a.subGridOpts||Rh.addRemoveCB)?(delete a.el,h=this.addWidget(a)):(this._prepareElement(h,!0,a),this.el.appendChild(h),this.resizeToContentCheck(!1,a),d&&(d.parentGridNode=a),this._updateContainerHeight()),this.engine.addedNodes.push(a),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...$,type:"dropped"},x&&x.grid?x:void 0,a),!1}),this}static _itemRemoving(r,n){if(!r)return;const v=r?r.gridstackNode:void 0;!(v!=null&&v.grid)||r.classList.contains(v.grid.opts.removableOptions.decline)||(n?v._isAboutToRemove=!0:delete v._isAboutToRemove,n?r.classList.add("grid-stack-item-removing"):r.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const r=document.querySelector(this.opts.removable);return r?(!this.opts.staticGrid&&!u_.isDroppable(r)&&u_.droppable(r,this.opts.removableOptions).on(r,"dropover",(n,v)=>Rh._itemRemoving(v,!0)).on(r,"dropout",(n,v)=>Rh._itemRemoving(v,!1)),this):this}prepareDragDrop(r,n=!1){const v=r==null?void 0:r.gridstackNode;if(!v)return;const $=v.noMove||this.opts.disableDrag,h=v.noResize||this.opts.disableResize,u=this.opts.staticGrid||$&&h;if((n||u)&&(v._initDD&&(this._removeDD(r),delete v._initDD),u&&r.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!n))return this;if(!v._initDD){let i,p;const c=(T,x)=>{this.triggerEvent(T,T.target),i=this.cellWidth(),p=this.getCellHeight(!0),this._onStartMoving(r,T,x,v,i,p)},a=(T,x)=>{this._dragOrResize(r,T,x,v,i,p)},k=T=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete v._moving,delete v._resizing,delete v._event,delete v._lastTried;const x=v.w!==v._orig.w,d=T.target;if(!(!d.gridstackNode||d.gridstackNode.grid!==this)){if(v.el=d,v._isAboutToRemove){const o=r.gridstackNode.grid;o._gsEventHandler[T.type]&&o._gsEventHandler[T.type](T,d),o.engine.nodes.push(v),o.removeWidget(r,!0,!0)}else ru.removePositioningStyles(d),v._temporaryRemoved?(this._writePosAttr(d,v),this.engine.addNode(v)):this._writePosAttr(d,v),this.triggerEvent(T,d);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),T.type==="resizestop"&&(Number.isInteger(v.sizeToContent)&&(v.sizeToContent=v.h),this.resizeToContentCheck(x,v))}};u_.draggable(r,{start:c,stop:k,drag:a}).resizable(r,{start:c,stop:k,resize:a}),v._initDD=!0}return u_.draggable(r,$?"disable":"enable").resizable(r,h?"disable":"enable"),this}_onStartMoving(r,n,v,$,h,u){var i;if(this.engine.cleanNodes().beginUpdate($),this._writePosAttr(this.placeholder,$),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=$,(i=$.grid)!=null&&i.el)this.dragTransform=ru.getValuesFromTransformedElement(r);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const p=this.placeholder.closest(".grid-stack");this.dragTransform=ru.getValuesFromTransformedElement(p)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if($.el=this.placeholder,$._lastUiPosition=v.position,$._prevYPix=v.position.top,$._moving=n.type==="dragstart",$._resizing=n.type==="resizestart",delete $._lastTried,n.type==="dropover"&&$._temporaryRemoved&&(this.engine.addNode($),$._moving=!0),this.engine.cacheRects(h,u,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),n.type==="resizestart"){const p=this.getColumn()-$.x,c=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-$.y;u_.resizable(r,"option","minWidth",h*Math.min($.minW||1,p)).resizable(r,"option","minHeight",u*Math.min($.minH||1,c)).resizable(r,"option","maxWidth",h*Math.min($.maxW||Number.MAX_SAFE_INTEGER,p)).resizable(r,"option","maxWidthMoveLeft",h*Math.min($.maxW||Number.MAX_SAFE_INTEGER,$.x+$.w)).resizable(r,"option","maxHeight",u*Math.min($.maxH||Number.MAX_SAFE_INTEGER,c)).resizable(r,"option","maxHeightMoveUp",u*Math.min($.maxH||Number.MAX_SAFE_INTEGER,$.y+$.h))}}_dragOrResize(r,n,v,$,h,u){const i={...$._orig};let p,c=this.opts.marginLeft,a=this.opts.marginRight,k=this.opts.marginTop,T=this.opts.marginBottom;const x=Math.round(u*.1),d=Math.round(h*.1);if(c=Math.min(c,d),a=Math.min(a,d),k=Math.min(k,x),T=Math.min(T,x),n.type==="drag"){if($._temporaryRemoved)return;const l=v.position.top-$._prevYPix;$._prevYPix=v.position.top,this.opts.draggable.scroll!==!1&&ru.updateScrollPosition(r,v.position,l);const s=v.position.left+(v.position.left>$._lastUiPosition.left?-a:c),f=v.position.top+(v.position.top>$._lastUiPosition.top?-T:k);i.x=Math.round(s/h),i.y=Math.round(f/u);const g=this._extraDragRow;if(this.engine.collide($,i)){const S=this.getRow();let L=Math.max(0,i.y+$.h-S);this.opts.maxRow&&S+L>this.opts.maxRow&&(L=Math.max(0,this.opts.maxRow-S)),this._extraDragRow=L}else this._extraDragRow=0;if(this._extraDragRow!==g&&this._updateContainerHeight(),$.x===i.x&&$.y===i.y)return}else if(n.type==="resize"){if(i.x<0||(ru.updateScrollResize(n,r,u),i.w=Math.round((v.size.width-c)/h),i.h=Math.round((v.size.height-k)/u),$.w===i.w&&$.h===i.h)||$._lastTried&&$._lastTried.w===i.w&&$._lastTried.h===i.h)return;const l=v.position.left+c,s=v.position.top+k;i.x=Math.round(l/h),i.y=Math.round(s/u),p=!0}$._event=n,$._lastTried=i;const o={x:v.position.left+c,y:v.position.top+k,w:(v.size?v.size.width:$.w*h)-c-a,h:(v.size?v.size.height:$.h*u)-k-T};if(this.engine.moveNodeCheck($,{...i,cellWidth:h,cellHeight:u,rect:o,resizing:p})){$._lastUiPosition=v.position,this.engine.cacheRects(h,u,k,a,T,c),delete $._skipDown,p&&$.subGrid&&$.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const l=n.target;$._sidebarOrig||this._writePosAttr(l,$),this.triggerEvent(n,l)}}triggerEvent(r,n){let v=this;for(;v.parentGridNode;)v=v.parentGridNode.grid;v._gsEventHandler[r.type]&&v._gsEventHandler[r.type](r,n)}_leave(r,n){n=n||r;const v=n.gridstackNode;if(!v||(n.style.transform=n.style.transformOrigin=null,u_.off(r,"drag"),v._temporaryRemoved))return;v._temporaryRemoved=!0,this.engine.removeNode(v),v.el=v._isExternal&&n?n:r;const $=v._sidebarOrig;v._isExternal&&this.engine.cleanupNode(v),v._sidebarOrig=$,this.opts.removable===!0&&Rh._itemRemoving(r,!0),r._gridstackNodeOrig?(r.gridstackNode=r._gridstackNodeOrig,delete r._gridstackNodeOrig):v._isExternal&&this.engine.restoreInitial()}}Rh.renderCB=(e,r)=>{e&&r!=null&&r.content&&(e.textContent=r.content)},Rh.resizeToContentParent=".grid-stack-item-content",Rh.Utils=ru,Rh.Engine=P4,Rh.GDRev="12.4.2";const lHe=[{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}],A4=e=>lHe.find(r=>r.id===e),R4=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 Qk{constructor(r,n=[],v,$=null,h=!1,u=!1,i=null,p=null,c=null){Nw(this,"id",""),Nw(this,"childViews",[]),Nw(this,"viewId",0),Nw(this,"dynamicFilters",null),Nw(this,"componentSpecificFilters",new Map),Nw(this,"isPostMatch",!1),Nw(this,"isTemplateMode",!1),Nw(this,"filtresJSON",null),Nw(this,"token",null),Nw(this,"_isUpdating",!1),Nw(this,"filters",null),this.id=r,this.viewId=v,this.childViews=n,this.dynamicFilters=$,this.isPostMatch=h,this.isTemplateMode=u,this.filtresJSON=i,this.token=p,this.filters=c,this.componentSpecificFilters=new Map}resetClass(){this.childViews.forEach(r=>{r.view.filterAndViewsContainer=new Qk(this.id,[r],this.viewId,this.dynamicFilters,this.isPostMatch,this.isTemplateMode,this.filtresJSON,this.token,this.filters)})}hasEventTypeId(r,n){return!r||!Array.isArray(r)?!1:r.some(v=>v&&v.event_type_id===n)}hasCategoryId(r,n){return!r||!Array.isArray(r)?!1:r.some(v=>v&&v.category_id===n)}getId(){return this.id}setViewId(r){this.viewId=r}setFiltersJSON(r){this.filtresJSON=r}setDynamicFilters(r,n=null){n?this.componentSpecificFilters.set(n,[...r]):this.dynamicFilters=r}setFilters(r){this.filters=r}getComponentDynamicFilters(r){return r&&this.componentSpecificFilters.has(r)?this.componentSpecificFilters.get(r):this.dynamicFilters}getAllComponentFilters(){return this.componentSpecificFilters}debugComponentFilters(){}static debugAllComponentFilters(){}clearAllComponentFilters(){this.componentSpecificFilters.clear()}getDynamicFilters(){return this.dynamicFilters}getHomeTeamViews(){return this.childViews.filter(r=>r.view.isHomeTeam)}getAwayTeamViews(){return this.childViews.filter(r=>!r.view.isHomeTeam)}addSpecificPlays(r){if(r.view.componentProps&&this.filters){const n=this.filters.selectedTeam.value;if(n===3){const v=this.getHomeTeamViews().length,$=this.getAwayTeamViews().length;v===0&&$>0&&this.getAwayTeamViews().forEach(h=>{h.view.componentProps.isHomeTeamForAnalysis=!0,h.view.isHomeTeam=!0,h.view.filterMultiple&&(h.view.filterMultiple.isHomeTeam=!0)}),v<this.filters.howManyCorners?this.childViews.length===0?(r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.isAgainstMode=this.filters.isAgainstMode,r.view.componentProps.howManyCorners=this.filters.howManyCorners,r.view.componentProps.advancedFilters=this.filters.advancedFilters,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}):this.childViews.reduce((h,u,i,p)=>{let c={isAgainstMode:u.view.isAgainstMode,advancedFilters:u.view.componentProps.advancedFilters,isHomeTeamForAnalysis:u.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:u.view.isHomeTeam};return h&&(h.isHomeTeam&&!u.view.isHomeTeam?(u.view.componentProps.isAgainstMode=this.filters.isAgainstMode,u.view.componentProps.advancedFilters=this.filters.advancedFilters,u.view.componentProps.isHomeTeamForAnalysis=!0,u.view.isHomeTeam=!0,u.view.filterMultiple={isHomeTeam:u.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}):!h.isHomeTeam&&!u.view.isHomeTeam&&(u.view.componentProps.isAgainstMode=h.isAgainstMode,u.view.componentProps.advancedFilters=h.advancedFilters,u.view.componentProps.isHomeTeamForAnalysis=h.isHomeTeamForAnalysis,u.view.isHomeTeam=h.isHomeTeam,u.view.filterMultiple={isHomeTeam:u.view.isHomeTeam,selectedCategory:u.view.componentProps.categories[0],advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}),i===p.length-1&&(r.view.componentProps.advancedFilters=c.advancedFilters,r.view.componentProps.isAgainstMode=c.isAgainstMode,r.view.componentProps.isHomeTeamForAnalysis=c.isHomeTeamForAnalysis,r.view.isHomeTeam=c.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode})),c},null):(r.view.componentProps.advancedFilters=this.filters.advancedFilters,r.view.componentProps.isAgainstMode=this.filters.isAgainstMode,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode})}else{const v=n===1;r.view.componentProps.isHomeTeamForAnalysis=v,r.view.isHomeTeam=v,r.view.componentProps.advancedFilters=this.filters.advancedFilters,r.view.componentProps.isAgainstMode=this.filters.isAgainstMode,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}}}console.log("++++++++++++++++++++++++++++++++++++++++++++++++++++++"),console.log("view: ",r)}addLastTouch(r){if(r.view.componentProps&&this.filters){let n=null;const v=this.filters.selectedCategories.map(h=>h.value),$=this.filters.selectedTeam.value;if($===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(p=>{p.view.componentProps.isHomeTeamForAnalysis=!0,p.view.isHomeTeam=!0,p.view.filterMultiple&&(p.view.filterMultiple.isHomeTeam=!0)});const h=this.getHomeTeamViews(),u=this.getAwayTeamViews();let i=!0;for(let p=0;p<v.length;p++){n=v[p];const c=h.find(k=>k.view.componentProps.categories[0].name===n.name),a=u.find(k=>k.view.componentProps.categories[0].name===n.name);if(!c||!a){i=!c;break}}i?this.childViews.length===0?(r.view.componentProps.categories=[n],r.view.componentProps.analysisType=this.filters.selectedGamePhase.name,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,r.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,r.view.title=n.name,r.view.titleShort=n.name,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:n,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):this.childViews.reduce((p,c,a,k)=>{let T={categories:c.view.componentProps.categories,analysisType:c.view.componentProps.analysisType,isAssistZoneVisible:this.filters.isAssistZoneVisible,howManyGames:this.filters.howManyGamesSelected.value,title:c.view.title,isHomeTeamForAnalysis:c.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:c.view.isHomeTeam};return p&&(p.isHomeTeam&&!c.view.isHomeTeam?(c.view.componentProps.categories=[n],c.view.componentProps.analysisType=this.filters.selectedGamePhase.name,c.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,c.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,c.view.componentProps.isHomeTeamForAnalysis=!0,c.view.title=n.name,r.view.titleShort=n.name,c.view.isHomeTeam=!0,c.view.filterMultiple={isHomeTeam:c.view.isHomeTeam,selectedCategory:n,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):!p.isHomeTeam&&!c.view.isHomeTeam&&(c.view.componentProps.categories=p.categories,c.view.componentProps.analysisType=p.analysisType,c.view.componentProps.isHomeTeamForAnalysis=p.isHomeTeamForAnalysis,c.view.componentProps.isAssistZoneVisible=p.isAssistZoneVisible,c.view.componentProps.howManyGames=p.howManyGames,c.view.title=p.title,c.view.titleShort=p.titleShort,c.view.isHomeTeam=p.isHomeTeam,c.view.filterMultiple={isHomeTeam:c.view.isHomeTeam,selectedCategory:c.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}),a===k.length-1&&(r.view.componentProps.categories=T.categories,r.view.componentProps.analysisType=T.analysisType,r.view.componentProps.isHomeTeamForAnalysis=T.isHomeTeamForAnalysis,r.view.componentProps.isAssistZoneVisible=T.isAssistZoneVisible,r.view.componentProps.howManyGames=T.howManyGames,r.view.title=T.title,r.view.titleShort=T.titleShort,r.view.isHomeTeam=T.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:r.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})),T},null):(r.view.componentProps.categories=[n],r.view.componentProps.analysisType=this.filters.selectedGamePhase.name,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,r.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,r.view.title=n.name,r.view.titleShort=n.name,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:n,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})}else{const h=$===1,u=h?this.getHomeTeamViews():this.getAwayTeamViews();r.view.componentProps.isHomeTeamForAnalysis=h,r.view.isHomeTeam=h;for(let i=0;i<v.length;i++){const p=v[i];if(!u.find(c=>c.view.componentProps.categories[0].name===p.name)){r.view.componentProps.categories=[p],r.view.componentProps.analysisType=this.filters.selectedGamePhase.name,r.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,r.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,r.view.title=p.name,r.view.titleShort=p.name,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:p,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible};break}}}}}addView(r,n=!1){var v,$,h,u,i,p,c,a,k,T;if(r.view.filterAndViewsContainer=this,Sd.emit("component-added-to-container",this),this.viewId===5&&r.view.componentProps&&!n&&(r.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,r.view.filterMultiple={isHomeTeam:r.view.componentProps.preMatchType===1}),this.viewId===15&&r.view.componentProps&&!n&&(r.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,r.view.filterMultiple={isHomeTeam:r.view.componentProps.preMatchType===1}),this.viewId===17&&r.view.componentProps&&!n){this.dynamicFilters[0]!==void 0&&(r.view.componentProps.infavoragainstteam=!this.dynamicFilters[0]),this.dynamicFilters[1]!==void 0&&(r.view.componentProps.lateralidad=this.dynamicFilters[1]===32?"right":"left");const x=this.dynamicFilters[2]!==void 0?this.dynamicFilters[2]:this.dynamicFilters[0]||1,d=r.view.componentProps.game;if(x===3){const o=this.childViews.filter(l=>{var s;return((s=l.view.filterMultiple)==null?void 0:s.isHomeTeam)===!0}).length===0;d&&(r.view.componentProps.teamselected=o?d.home_team:d.away_team),r.view.filterMultiple={isHomeTeam:o}}else d&&(r.view.componentProps.teamselected=x===2?d.away_team:d.home_team),r.view.filterMultiple={isHomeTeam:x===1}}if(this.viewId===10&&r.view.componentProps&&!n&&(r.view.componentProps.isHomeTeamForAnalysis=this.dynamicFilters[0]!==3?this.dynamicFilters[0]===1:1,r.isHomeTeam=r.view.componentProps.isHomeTeamForAnalysis,r.view.filterMultiple={isHomeTeam:r.view.componentProps.isHomeTeamForAnalysis},r.view.filtersJSON=this.filtresJSON),this.viewId===7&&r.view.componentProps&&!n){const x=this.getComponentDynamicFilters(r.view.id),d=x||this.dynamicFilters;!x&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const o=d[0]===1?"offensive":"defensive",l=d[1]===1;r.view.componentProps.analysisType=o,r.view.componentProps.isHomeTeamForAnalysis=l,r.isHomeTeam=l,r.view.filterMultiple={isHomeTeam:l},Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:d})}if(this.viewId===1&&r.view.componentProps&&!n){const x=this.dynamicFilters[0]||[];if(x&&x.length>0){let d;if(Array.isArray(x)){const l=this.childViews.map(f=>{var g;return(g=f.view.componentProps)==null?void 0:g.type}).filter(f=>f!==void 0),s=x.filter(f=>!l.includes(f));s.length>0?d=s[0]:d=x[0]}else d=x;const o=R4.get(this.viewId);r.view.componentProps.type=d,r.view.componentProps.default=!1,r.view.title=`Comparativa ${o[d]}`,r.view.filterMultiple={category:d}}}if(this.viewId===9&&r.view.componentProps&&!n){const x=this.dynamicFilters[0].map(s=>s.join("-"));let d="";const o=this.dynamicFilters[1],l=R4.get(this.viewId);if(o===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(L=>{L.view.componentProps.isHomeTeamForAnalysis=!0,L.view.isHomeTeam=!0,L.view.filterMultiple&&(L.view.filterMultiple.isHomeTeam=!0)});let s=null;const f=this.getHomeTeamViews(),g=this.getAwayTeamViews();let S=!0;for(let L=0;L<x.length;L++){d=x[L],s=l.analysisTypes.get(x[L]);const E=f.find(V=>V.view.componentProps.analysisType===s.analysisType),P=g.find(V=>V.view.componentProps.analysisType===s.analysisType);if(!E||!P){S=!E;break}}S?this.childViews.length===0?(r.view.componentProps.analysisType=s.analysisType,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.title=s.title,r.view.titleShort=s.titleShort,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:d.split("-").map(L=>parseInt(L))}):this.childViews.reduce((L,E,P,V)=>{let I={analysisType:E.view.componentProps.analysisType,title:E.view.title,isHomeTeamForAnalysis:E.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:E.view.isHomeTeam};return L&&(L.isHomeTeam&&!E.view.isHomeTeam?(E.view.componentProps.analysisType=s.analysisType,E.view.componentProps.isHomeTeamForAnalysis=!0,E.view.title=s.title,r.view.titleShort=s.titleShort,E.view.isHomeTeam=!0,E.view.filterMultiple={isHomeTeam:E.view.isHomeTeam,categoryIds:d.split("-").map(j=>parseInt(j))}):!L.isHomeTeam&&!E.view.isHomeTeam&&(E.view.componentProps.analysisType=L.analysisType,E.view.componentProps.isHomeTeamForAnalysis=L.isHomeTeamForAnalysis,E.view.title=L.title,E.view.titleShort=L.titleShort,E.view.isHomeTeam=L.isHomeTeam,E.view.filterMultiple={isHomeTeam:E.view.isHomeTeam,categoryIds:d.split("-").map(j=>parseInt(j))}),P===V.length-1&&(r.view.componentProps.analysisType=I.analysisType,r.view.componentProps.isHomeTeamForAnalysis=I.isHomeTeamForAnalysis,r.view.title=I.title,r.view.titleShort=I.titleShort,r.view.isHomeTeam=I.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:d.split("-").map(j=>parseInt(j))})),I},null):(r.view.componentProps.analysisType=s.analysisType,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.title=s.title,r.view.titleShort=s.titleShort,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:d.split("-").map(L=>parseInt(L))})}else{const s=o===1,f=s?this.getHomeTeamViews():this.getAwayTeamViews();r.view.componentProps.isHomeTeamForAnalysis=s,r.view.isHomeTeam=s;for(let g=0;g<x.length;g++){const S=l.analysisTypes.get(x[g]);if(!f.find(L=>L.view.componentProps.analysisType===S.analysisType)){r.view.componentProps.analysisType=S.analysisType,r.view.title=S.title,r.view.titleShort=S.titleShort,r.view.filterMultiple={categoryIds:x[g].split("-").map(L=>parseInt(L)),isHomeTeam:r.view.isHomeTeam};break}}}}if(this.viewId===2&&!n&&r.view.componentProps){const x=this.getComponentDynamicFilters(r.view.id),d=x||this.dynamicFilters;!x&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id),r.view.componentProps.game&&(r.view.componentProps.gameid=r.view.componentProps.game.id,r.view.componentProps.season=r.view.componentProps.game.season_id,r.view.componentProps.teamView=d[1]===2?r.view.componentProps.game.awayTeam.team_id:d[1]===1?r.view.componentProps.game.homeTeam.team_id:0);const o=this.dynamicFilters[0]||[];let l=null;if(Array.isArray(o)){if(o.length>0){const g=this.childViews.map(L=>{var E;const P=(E=L.view.componentProps)==null?void 0:E.categoryView;return P&&P.length>0?P[0].id:null}).filter(L=>L!==null),S=o.filter(L=>!g.includes(L));S.length>0&&(l=S[0])}}else{const g=o;g&&(this.childViews.find(S=>{var L;const E=(L=S.view.componentProps)==null?void 0:L.categoryView;return E&&E.length>0&&E[0].id===g})||(l=g))}let s=null;if(l)try{s=A4(l)}catch{}const f=d&&d.length>1?d[1]:1;r.view.filterMultiple={categoryId:l,teamType:f},r.view.componentProps.categoryView=s?[{id:l,name:s.name}]:l?[{id:l,name:`Category ${l}`}]:[{id:0,name:"Category"}]}if(this.viewId===8&&r.view.componentProps&&!n&&r.view.game&&(r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0),r.view.componentProps.areInactiveVisible=this.dynamicFilters[0]||!1,r.view.componentProps.game=(v=r.view)==null?void 0:v.game,r.view.componentProps.teamSelected={teamId:(h=($=r.view)==null?void 0:$.game)==null?void 0:h.home_team},r.view.componentProps.isDefault=!1,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:this.dynamicFilters})),this.viewId===13&&r.view.componentProps&&!n&&(r.view.componentProps.isdefault=!0,r.view.componentProps.seasonid=2010,r.view.teamids=[1,2],r.view.componentProps.categoryids=[20,2],r.view.componentProps.teamsshow=[1,2],r.view.componentProps.analysistype=1,r.view.componentProps.gameid="",r.view.componentProps.teams=[],r.view.componentProps.game=""),this.viewId===15&&r.view.componentProps&&!n&&(r.view.componentProps.isdefault=!0,r.view.componentProps.view=1,r.view.numitems=3,r.view.typegame=1,r.view.componentProps.token=this.token,r.view.componentProps.data={season:2010,type:2,team:14}),this.viewId===17&&r.view.componentProps&&!n&&(r.view.componentProps.forseason=!1,r.view.componentProps.forteam=!0,r.view.componentProps.tournamentselected={id:1},r.view.componentProps.forgame=!1,r.view.componentProps.filters={},r.view.componentProps.showBallGo=!0,r.view.componentProps.showHeatMap=!0,r.view.componentProps.ballOnOff=!1,r.view.componentProps.showdefault=!0),this.viewId===14&&r.view.componentProps&&!n&&(r.view.componentProps.isReports=!0,r.view.componentProps.isDefault=!0,r.view.componentProps.type=0,r.view.componentProps.typeView=1,r.view.componentProps.showVideos=!1,r.view.componentProps.currentSeason=2010,r.view.componentProps.localTeam=2,r.view.componentProps.awayTeam=1),this.viewId===6&&r.view.componentProps&&!n){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const x=this.getComponentDynamicFilters(r.view.id),d=x||this.dynamicFilters;!x&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const o=d&&d.length>0?d[0]:[];if(o&&o.length>0){let l=0;for(const s of o)if(!this.childViews.find(f=>f.view.componentProps.gameNumber===s)){l=s;break}l&&(r.view.componentProps.gameNumber=l,r.view.filterMultiple={gameNumber:l})}Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:d})}if(this.viewId===3&&r.view.componentProps&&!n&&r.view.game){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const x=this.getComponentDynamicFilters(r.view.id),d=x||this.dynamicFilters;!x&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const o=d&&d.length>0?d[0]:!1;r.view.componentProps.desplegable=o,r.view.componentProps.key=o,r.view.componentProps.game=(u=r.view)==null?void 0:u.game,r.view.componentProps.defaultShields=!1,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:d})}if(this.viewId===4&&r.view.componentProps&&!n&&r.view.game){if(r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0),this.isPostMatch){r.view.componentProps.key=!1,r.view.componentProps.isDefault=!1,r.view.componentProps.token=this.token,r.view.componentProps.gameId=(p=(i=r.view)==null?void 0:i.game)==null?void 0:p.game_id,r.view.componentProps.homeTeam=(a=(c=r.view)==null?void 0:c.game)==null?void 0:a.home_team,r.view.componentProps.awayTeam=(T=(k=r.view)==null?void 0:k.game)==null?void 0:T.visiting_team;const o=this.getComponentDynamicFilters(r.view.id),l=o||this.dynamicFilters;!o&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const s=l&&l.length>0?l[0]:[],f=this.hasEventTypeId(s,1),g=this.hasCategoryId(s,8),S=this.hasCategoryId(s,9),L=this.hasEventTypeId(s,3);r.view.componentProps.goals=f,r.view.componentProps.yellowCards=g,r.view.componentProps.redCards=S,r.view.componentProps.substitutions=L}const x=this.getComponentDynamicFilters(r.view.id)||this.dynamicFilters,d=x&&x.length>0?x[0]:[];r.view.componentProps.selectedEvents=d,r.view.componentProps.key=d.length>0,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:x})}this.viewId===16&&this.addLastTouch(r),this.viewId===18&&this.addSpecificPlays(r),this.childViews.push(r),Sd.emit("view-added")}getHowManyViewsToAdd(r,n=null){if(this.viewId===5||this.viewId===14||this.viewId===13||this.viewId===15)return 1;if(this.viewId===6){const v=r[0];return v===2||v===3?v:1}if(this.viewId===4)return r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0?1:0;if(this.viewId===9){const v=r[0],$=r[1];if($===1||$===2){const h=$===1?this.getHomeTeamViews():this.getAwayTeamViews();return v.length-h.length}else return v*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===16&&n){const v=n.selectedCategories||[],$=n.selectedTeam.value;if($===1||$===2){const h=$===1?this.getHomeTeamViews():this.getAwayTeamViews();return v.length-h.length}else return v.length*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===2){const v=r[0]||[],$=r[1]||1;if(!v||v.length===0)return 0;if(Array.isArray(v)){const h=this.childViews.map(u=>{var i;const p=(i=u.view.componentProps)==null?void 0:i.categoryView;return p&&p.length>0?p[0].id:null}).filter(u=>u!==null);return v.filter(u=>!h.includes(u)).length}else{const h=v;return this.childViews.find(u=>{var i,p;const c=(i=u.view.componentProps)==null?void 0:i.categoryView,a=((p=u.view.filterMultiple)==null?void 0:p.teamType)||1;return c&&c.length>0&&c[0].id===h&&a===$})?0:1}}if(this.viewId===1){const v=r[0]||[];if(!v||v.length===0)return 0;if(Array.isArray(v)){const $=this.childViews.map(h=>{var u;return(u=h.view.componentProps)==null?void 0:u.type}).filter(h=>h!==void 0);return v.filter(h=>!$.includes(h)).length}else{const $=v;return this.childViews.find(h=>{var u;return((u=h.view.componentProps)==null?void 0:u.type)===$})?0:1}}return 0}getRequiresAddView(r,n){if(this.viewId===5)return r[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===15)return r[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===17){const v=r[2]||1,$=r[2];return v===3||$===3?this.childViews.length<2:this.childViews.length===0}if(this.viewId===10)return r[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===7)return r[1]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===6){const v=r[0];return v?v.length>this.childViews.length:this.childViews.length===0}if(this.viewId===4){const v=r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0;return this.childViews.length===0&&v}if(this.viewId===9)return this.getRequiresAddViewMultipleAndBothTeams(r);if(this.viewId===16&&n){const v=[n.selectedCategories,n.selectedTeam.value];return this.getRequiresAddViewMultipleAndBothTeams(v,n.totalCategoriesSelected)}if(this.viewId===18&&n){const v=[n.howManyCorners,n.selectedTeam.value],$=this.getRequiresAddViewMultipleAndBothTeams(v,n.howManyCorners);return console.count("before aux18 return"),console.log("aux18:",$),$}if(this.viewId===1){const v=r[0]||[];if(!v||v.length===0)return!1;if(Array.isArray(v)){const $=this.childViews.map(h=>{var u;return(u=h.view.componentProps)==null?void 0:u.type}).filter(h=>h!==void 0);return v.filter(h=>!$.includes(h)).length>0}else{const $=v;return!this.childViews.find(h=>{var u;return((u=h.view.componentProps)==null?void 0:u.type)===$})}}if(this.viewId===2){const v=r[0]||[];if(Array.isArray(v)){if(v.length>0){const $=this.childViews.map(h=>{var u;const i=(u=h.view.componentProps)==null?void 0:u.categoryView;return i&&i.length>0?i[0].id:null}).filter(h=>h!==null);return v.filter(h=>!$.includes(h)).length>0}return!1}else{const $=v,h=r[1]||1;return $?!this.childViews.find(u=>{var i,p;const c=(i=u.view.componentProps)==null?void 0:i.categoryView,a=((p=u.view.filterMultiple)==null?void 0:p.teamType)||1;return c&&c.length>0&&c[0].id===$&&a===h}):!1}}return this.viewId===8||this.viewId===3||this.viewId===14?this.childViews.length===0:!1}getRequiresAddViewMultipleAndBothTeams(r,n=null){const v=this.childViews.filter(c=>c.view.isHomeTeam),$=this.childViews.filter(c=>!c.view.isHomeTeam),h=n||r[0].length,u=r[1],i=h*(u===1||u===2?1:2),p=u===3?v.length+$.length:v.length||$.length;return i>p}getRequiresLessViews(r){if(this.viewId===5)return r[0]!==3&&this.childViews.length>1;if(this.viewId===15)return r[0]!==3&&this.childViews.length>1;if(this.viewId===17)return r[0]!==3&&this.childViews.length>1;if(this.viewId===6){const n=r[0];return n===2||n===3}return this.viewId,!1}updateSummary({dynamicFilters:r}){const n=this.childViews[0],v=document.querySelector(`[gs-id="${n.view.id}"]`),$=n.grid;if(n&&v&&$){const h=r[0],u=`min_column${h?"_2":""}`,i=`min_row${h?"_2":""}`,p=`max_column${h?"_2":""}`,c=`max_row${h?"_2":""}`,a=`colspan${h?"_2":""}`,k=`rowspan${h?"_2":""}`,T=n.view.coreView[a],x=n.view.coreView[k],d=n.view.coreView[u],o=n.view.coreView[i],l=n.view.coreView[p],s=n.view.coreView[c];n.view.w=T,n.view.h=x,n.view.maxWidth=l,n.view.maxHeight=s,n.view.minWidth=d,n.view.minHeight=o,v.setAttribute("gs-w",T),v.setAttribute("gs-h",x),v.setAttribute("gs-max-w",l),v.setAttribute("gs-max-h",s),v.setAttribute("gs-min-w",d),v.setAttribute("gs-min-h",o),$.update(v,{h:x,w:T,"gs-max-h":s,"gs-max-w":l,"gs-min-h":o,"gs-min-w":d})}}updateFilters(r){this.filters=r,this.viewId===16?this.updateLastTouchFilters(r):this.viewId===18&&this.updateSpecificPlaysFilters(r)}updateDynamicFilters(r,n=null){var v,$;if(!this._isUpdating){this._isUpdating=!0,n?this.componentSpecificFilters.set(n,[...r]):this.dynamicFilters=r,Sd.emit("component-added-to-container",this);try{if(this.viewId===5){const h=r[0]||1;if(h<3)if(this.childViews.length===1){const u=this.childViews[0];u.view.componentProps&&(u.view.componentProps.preMatchType=h,u.view.filterMultiple={isHomeTeam:u.view.componentProps.preMatchType===1})}else{const u=this.childViews.pop(),i=u.grid,p=u.page,c=document.querySelector(`[gs-id="${u.view.id}"]`);if(i&&c&&(i.removeWidget(c),p)){const k=p.items.findIndex(T=>T.id===u.view.id);k!==-1&&p.items.splice(k,1)}const a=this.childViews[0];a.view.componentProps&&(a.view.componentProps.preMatchType=h,a.view.filterMultiple={isHomeTeam:a.view.componentProps.preMatchType})}else this.childViews.forEach((u,i)=>{u.view.componentProps.preMatchType=i+1,u.view.filterMultiple={isHomeTeam:u.view.componentProps.preMatchType}})}if(this.viewId===15){const h=r[0]||1;if(n){const u=this.childViews.find(i=>i.view.id===n);u&&u.view.componentProps&&(u.view.componentProps.preMatchType=h,u.view.filterMultiple={isHomeTeam:h===1})}else if(h<3){if(this.childViews.length===1){const u=this.childViews[0];u.view.componentProps&&(u.view.componentProps.preMatchType=h,u.view.filterMultiple={isHomeTeam:h===1})}else if(this.childViews.length>1){for(;this.childViews.length>1;){const i=this.childViews.pop(),p=i.grid,c=i.page,a=document.querySelector(`[gs-id="${i.view.id}"]`);if(p&&a&&(p.removeWidget(a),c)){const k=c.items.findIndex(T=>T.id===i.view.id);k!==-1&&c.items.splice(k,1)}}const u=this.childViews[0];u.view.componentProps&&(u.view.componentProps.preMatchType=h,u.view.filterMultiple={isHomeTeam:h===1})}}else if(this.childViews.length===2)this.childViews.forEach((u,i)=>{u.view.componentProps&&(u.view.componentProps.preMatchType=i+1,u.view.filterMultiple={isHomeTeam:i===0})});else if(this.childViews.length<2)this.childViews.forEach((u,i)=>{u.view.componentProps&&(u.view.componentProps.preMatchType=i+1,u.view.filterMultiple={isHomeTeam:i===0})});else{for(;this.childViews.length>2;){const u=this.childViews.pop(),i=u.grid,p=u.page,c=document.querySelector(`[gs-id="${u.view.id}"]`);if(i&&c&&(i.removeWidget(c),p)){const a=p.items.findIndex(k=>k.id===u.view.id);a!==-1&&p.items.splice(a,1)}}this.childViews.forEach((u,i)=>{u.view.componentProps&&(u.view.componentProps.preMatchType=i+1,u.view.filterMultiple={isHomeTeam:i===0})})}}if(this.viewId===17){const h=r[0]||1,u=r[2],i=h===3||u===3;if(n){const p=this.childViews.find(c=>c.view.id===n);if(p&&p.view.componentProps&&(r[0]!==void 0&&(p.view.componentProps.infavoragainstteam=!r[0]),r[1]!==void 0&&(p.view.componentProps.lateralidad=r[1]===32?"right":"left"),r[2]!==void 0)){const c=r[2],a=p.view.componentProps.game;if(c===3){if(((v=p.view.filterMultiple)==null?void 0:v.isHomeTeam)!==void 0){const k=p.view.filterMultiple.isHomeTeam;a&&(p.view.componentProps.teamselected=(typeof k=="boolean"?k:k===1)?a.home_team:a.away_team)}}else a&&(p.view.componentProps.teamselected=c===2?a.away_team:a.home_team);p.view.filterMultiple={isHomeTeam:c===1||c===3&&(($=p.view.filterMultiple)==null?void 0:$.isHomeTeam)}}}else if(i)if(this.childViews.length===2)this.childViews.forEach((p,c)=>{p.view.componentProps&&(p.view.componentProps.teamselected=c+1,p.view.filterMultiple={isHomeTeam:c===0})});else if(this.childViews.length<2)this.childViews.forEach((p,c)=>{p.view.componentProps&&(p.view.componentProps.teamselected=c+1,p.view.filterMultiple={isHomeTeam:c===0})});else{for(;this.childViews.length>2;){const p=this.childViews.pop(),c=p.grid,a=p.page,k=document.querySelector(`[gs-id="${p.view.id}"]`);if(c&&k&&(c.removeWidget(k),a)){const T=a.items.findIndex(x=>x.id===p.view.id);T!==-1&&a.items.splice(T,1)}}this.childViews.forEach((p,c)=>{p.view.componentProps&&(p.view.componentProps.teamselected=c+1,p.view.filterMultiple={isHomeTeam:c===0})})}else if(this.childViews.length===1){const p=this.childViews[0];if(p.view.componentProps){r[0]!==void 0&&(p.view.componentProps.infavoragainstteam=!r[0]),r[1]!==void 0&&(p.view.componentProps.lateralidad=r[1]===32?"right":"left");const c=p.view.componentProps.game;if(r[2]!==void 0&&c){const a=r[2];p.view.componentProps.teamselected=a===2?c.away_team:c.home_team}p.view.filterMultiple={isHomeTeam:h===1}}}else if(this.childViews.length>1){for(;this.childViews.length>1;){const c=this.childViews.pop(),a=c.grid,k=c.page,T=document.querySelector(`[gs-id="${c.view.id}"]`);if(a&&T&&(a.removeWidget(T),k)){const x=k.items.findIndex(d=>d.id===c.view.id);x!==-1&&k.items.splice(x,1)}}const p=this.childViews[0];if(p.view.componentProps){r[0]!==void 0&&(p.view.componentProps.infavoragainstteam=!r[0]),r[1]!==void 0&&(p.view.componentProps.lateralidad=r[1]===32?"right":"left");const c=p.view.componentProps.game;if(r[2]!==void 0&&c){const a=r[2];p.view.componentProps.teamselected=a===2?c.away_team:c.home_team}p.view.filterMultiple={isHomeTeam:h===1}}}}if(this.viewId===10){const h=r[0]||1;if(h<3)if(this.childViews.length===1){const u=this.childViews[0];u.view.componentProps&&(u.view.componentProps.isHomeTeamForAnalysis=h===1,u.view.filterMultiple={isHomeTeam:u.view.componentProps.isHomeTeamForAnalysis})}else{const u=this.childViews.pop(),i=u.grid,p=u.page,c=document.querySelector(`[gs-id="${u.view.id}"]`);if(i&&c&&(i.removeWidget(c),p)){const k=p.items.findIndex(T=>T.id===u.view.id);k!==-1&&p.items.splice(k,1)}const a=this.childViews[0];a.view.componentProps&&(a.view.componentProps.isHomeTeamForAnalysis=h===1,a.view.filterMultiple={isHomeTeam:a.view.componentProps.isHomeTeamForAnalysis})}else this.childViews.forEach((u,i)=>{u.view.componentProps.isHomeTeamForAnalysis=i%2===0,u.view.filterMultiple={isHomeTeam:u.view.componentProps.isHomeTeamForAnalysis}})}if(this.viewId===7){const h=r[1];if(h===3)this.childViews.forEach((u,i)=>{u.view.componentProps.isHomeTeamForAnalysis=i%2===0,u.view.isHomeTeam=i%2===0,u.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",u.view.filterMultiple={isHomeTeam:u.view.isHomeTeam}});else{const u=h===1;if(this.childViews.length>0){const i=this.childViews[0];i.view.componentProps.isHomeTeamForAnalysis=u,i.view.isHomeTeam=u,i.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",i.view.filterMultiple={isHomeTeam:u},this.childViews.length>1&&this.removeChildView(this.childViews[1])}}}if(this.viewId===9){const h=r[0],u=r[1];if(u===3){if(this.childViews.length>h.length){const i=h.map(p=>{const c=p.join("-");return R4.get(this.viewId).analysisTypes.get(c).analysisType});this.childViews.reduce((p,c)=>(i.includes(c.view.componentProps.analysisType)||p.push(c.view.componentProps.analysisType),p),[]).forEach(p=>{const c=this.childViews.findIndex(a=>a.view.componentProps.analysisType===p);if(c!==-1){const a=this.childViews[c];this.removeChildView(a)}})}}else{const i=u===1,p=this.getHomeTeamViews(),c=this.getAwayTeamViews();if(i&&p.length===0)c.forEach(a=>{a.view.componentProps.isHomeTeamForAnalysis=i,a.view.isHomeTeam=i,a.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}});else if(!i&&c.length===0)p.forEach(a=>{a.view.componentProps.isHomeTeamForAnalysis=i,a.view.isHomeTeam=i,a.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}});else if(p.length===c.length)i||p.forEach(a=>{a.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}}),(i?c:p).forEach(a=>{this.removeChildView(a)});else{const a=i?this.getHomeTeamViews():this.getAwayTeamViews();if(a.length>h.length){const k=h.map(T=>{const x=T.join("-");return R4.get(this.viewId).analysisTypes.get(x).analysisType});a.forEach(T=>{k.includes(T.view.componentProps.analysisType)?T.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}:this.removeChildView(T)})}else a.forEach(k=>{k.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}})}}}if(this.viewId===2){const h=r[0]||[];if(Array.isArray(h)){const u=this.childViews.map(i=>{var p,c;const a=(p=i.view.componentProps)==null?void 0:p.categoryView,k=((c=i.view.filterMultiple)==null?void 0:c.teamType)||1,T=a&&a.length>0?a[0].id:null;return T?{categoryId:T,teamType:k,viewId:i.view.id}:null}).filter(i=>i!==null);if(n){const i=this.childViews.find(p=>p.view.id===n);if(i){const p=r[1]||1,c=h[0];if(c){let a=null;try{a=A4(c)}catch{}i.view.filterMultiple={categoryId:c,teamType:p},i.view.componentProps.game&&(p===1?i.view.componentProps.teamView=i.view.componentProps.game.homeTeam.team_id:p===2?i.view.componentProps.teamView=i.view.componentProps.game.awayTeam.team_id:i.view.componentProps.teamView=0),i.view.componentProps.categoryView=a?[{id:c,name:a.name}]:[{id:c,name:`Category ${c}`}]}}}if(!n){const i=r[1]||1;this.childViews.forEach(p=>{var c;const a=(c=p.view.componentProps)==null?void 0:c.categoryView;if(a&&a.length>0){const k=a[0].id;h.includes(k)&&(p.view.filterMultiple={categoryId:k,teamType:i})}})}if(u.map(i=>i.categoryId).filter(i=>!h.includes(i)).forEach(i=>{this.childViews.filter(p=>{var c;const a=(c=p.view.componentProps)==null?void 0:c.categoryView;return a&&a.length>0&&a[0].id===i}).forEach(p=>{this.removeChildView(p),Sd.emit("component-removed",{viewId:p.view.id,categoryId:i})})}),n){const i=h[0];if(i){const p=this.childViews.find(c=>c.view.id===n);if(p){let c=null;try{c=A4(i)}catch{}const a=r[1]||1;p.view.filterMultiple={categoryId:i,teamType:a},p.view.componentProps.game&&(p.view.componentProps.teamView=a===2?p.view.componentProps.game.awayTeam.team_id:a===1?p.view.componentProps.game.homeTeam.team_id:0),p.view.componentProps.categoryView=c?[{id:i,name:c.name}]:[{id:i,name:`Category ${i}`}]}}}}else{const u=h;if(u&&n){const i=this.childViews.find(p=>p.view.id===n);if(i){let p=null;try{p=A4(u)}catch{}const c=r[1]||1;i.view.filterMultiple={categoryId:u,teamType:c},i.view.componentProps.game&&(i.view.componentProps.teamView=c===2?i.view.componentProps.game.awayTeam.team_id:c===1?i.view.componentProps.game.homeTeam.team_id:0),i.view.componentProps.categoryView=p?[{id:u,name:p.name}]:[{id:u,name:`Category ${u}`}]}}}}if(this.viewId===8){const h=r[0]||!1;this.childViews.forEach(u=>{u.view.componentProps&&(u.view.componentProps._isReactive||(u.view.componentProps=t.reactive(u.view.componentProps),u.view.componentProps._isReactive=!0),u.view.componentProps.areInactiveVisible=h,u.view.componentProps.key=h,Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))})}if(this.viewId===1){const h=r[0]||[];if(n){this.setDynamicFilters(r,n);const u=this.childViews.find(i=>i.view.id===n);u&&this.updateComparative(u,r)}else if(this.childViews.reduce((u,i)=>(h.includes(i.view.componentProps.type)||u.push(i.view.componentProps.type),u),[]).forEach(u=>{const i=this.childViews.findIndex(p=>p.view.componentProps.type===u);if(i!==-1){for(let p=i;p<this.childViews.length;p++){const c=this.childViews[p+1],a=this.childViews[p];c&&(a.view.componentProps.type=c.view.componentProps.type,a.view.title=c.view.title)}this.removeChildView(this.childViews[this.childViews.length-1])}}),Array.isArray(h))this.childViews.length>0&&h.length>0&&this.childViews.forEach((u,i)=>{if(u.view.componentProps&&i<h.length){const p=h[i],c=R4.get(this.viewId);u.view.componentProps.type=p,u.view.componentProps.default=!1,u.view.title=`Comparativa ${c[p]}`,u.view.filterMultiple={category:p}}});else{const u=h;if(u&&this.childViews.length>0){const i=this.childViews[0];if(i.view.componentProps){const p=R4.get(this.viewId);i.view.componentProps.type=u,i.view.componentProps.default=!1,i.view.title=`Comparativa ${p[u]}`,i.view.filterMultiple={category:u}}}}}if(this.viewId===6){const h=r[0]||[];if(n){this.setDynamicFilters(r,n);const u=this.childViews.find(i=>i.view.id===n);u&&this.updateGSCLineupsReports(u,r)}else{if(Array.isArray(h))if(h.length===0)for(;this.childViews.length>0;)this.removeChildView(this.childViews[0]);else this.childViews.reduce((u,i)=>(h.includes(i.view.componentProps.gameNumber)||u.push(i.view.componentProps.gameNumber),u),[]).forEach(u=>{const i=this.childViews.findIndex(p=>p.view.componentProps.gameNumber===u);if(i!==-1){for(let p=i;p<this.childViews.length;p++){const c=this.childViews[p+1],a=this.childViews[p];c&&(a.view.componentProps.gameNumber=c.view.componentProps.gameNumber,a.view.filterMultiple={gameNumber:c.view.componentProps.gameNumber})}this.removeChildView(this.childViews[this.childViews.length-1])}});this.childViews.forEach(u=>{u.view.componentProps&&(u.view.componentProps._isReactive||(u.view.componentProps=t.reactive(u.view.componentProps),u.view.componentProps._isReactive=!0),Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))})}}if(this.viewId===3){if(n){this.setDynamicFilters(r,n);const h=this.childViews.find(u=>u.view.id===n);h&&this.updateMatchSummary(h,r)}else{const h=r[0]||!1;this.childViews.forEach(u=>{u.view.componentProps&&(u.view.componentProps._isReactive||(u.view.componentProps=t.reactive(u.view.componentProps),u.view.componentProps._isReactive=!0),u.view.componentProps.desplegable=h,u.view.componentProps.key=h,Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))})}this.updateSummary({dynamicFilters:r})}if(this.viewId===13){const h=r[1]||[];if(n){this.setDynamicFilters(r,n);const u=this.childViews.find(i=>i.view.id===n);u&&(u.view.componentProps&&(u.view.componentProps.categoryids=h,u.view.componentProps.analysistype=r[0]||1,u.view.componentProps.teamsshow=r[2]==1?[1]:r[2]==2?[2]:[1,2],u.view.dynamicFilters=r,u.view._updateKey=Date.now()),Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))}else this.childViews.forEach(u=>{u.view.componentProps&&(u.view.componentProps._isReactive||(u.view.componentProps=t.reactive(u.view.componentProps),u.view.componentProps._isReactive=!0),u.view.componentProps.categoryids=h,u.view.componentProps.analysistype=r[0]||1,u.view.componentProps.teamsshow=r[2]==1?[1]:r[2]==2?[2]:[1,2],u.view.dynamicFilters=r,u.view._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))})}else if(this.viewId===15){const h=r[0]||1,u=r[3]!==void 0?r[3]:typeof r[1]=="number"?r[1]:null;if(n){this.setDynamicFilters(r,n);const i=this.childViews.find(p=>p.view.id===n);i&&i.view.componentProps&&(i.view.componentProps.analysistype=h,u!==null&&(i.view.componentProps.numitems=u),i.view.dynamicFilters=r,i.view._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:i.view.id,componentProps:i.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:i.view.id,dynamicFilters:r}))}else this.childViews.forEach(i=>{i.view.componentProps&&(i.view.componentProps._isReactive||(i.view.componentProps=t.reactive(i.view.componentProps),i.view.componentProps._isReactive=!0),i.view.componentProps.analysistype=h,u!==null&&(i.view.componentProps.numitems=u),i.view.dynamicFilters=r,i.view._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:i.view.id,componentProps:i.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:i.view.id,dynamicFilters:r}))})}if(this.viewId===4){const h=r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0;if(n){const u=this.childViews.find(i=>i.view.id===n);u&&u.view.componentProps.selectedEvents}else if(!h&&this.childViews.length>0)this.childViews.forEach(u=>{this.removeChildView(u)});else if(h&&this.childViews.length===0){const u={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};Sd.emit("add-view",u)}else this.childViews.forEach(u=>{this.updateTimeline(u,r)})}}finally{this._isUpdating=!1}}}removeAllChildViews(){[...this.childViews].forEach(r=>{this.removeChildView(r)})}removeChildView(r,n=!1){const v=this.childViews.findIndex($=>$.view.id===r.view.id);if(v!==-1){const $=this.childViews[v];this.childViews.splice(v,1),$.view.id&&this.componentSpecificFilters.delete($.view.id);const h=$.grid,u=$.page,i=document.querySelector(`[gs-id="${$.view.id}"]`);if(h&&i&&(h.removeWidget(i),u&&!n)){const p=u.items.findIndex(c=>c.id===$.view.id);p!==-1&&(u.items.splice(p,1),u.items.length===0&&Sd.emit("empty-page",u))}}}updateView({view:r,dynamicFilters:n,filtersJSON:v,filters:$}){this.setFiltersJSON(v),this.dynamicFilters=n;const h=this.childViews.find(u=>{var i;return((i=u.view)==null?void 0:i.id)===r.view.id});if(h){h.view.filtersJSON=v,h.view.coreView&&(h.view.coreView.filtersJSON=v);let u=n;if(this.viewId===4){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===8){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===3){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i),this.updateSummary({dynamicFilters:u})}else if(this.viewId===1){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===6){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===7){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===9){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}this.viewId===5?this.updateVolumetricField(h,u):this.viewId===7?this.updateGoalData(h,u):this.viewId===9?this.updateFieldDataByZones(h,n):this.viewId===10?this.updateXg(h,u):this.viewId===3?this.updateMatchSummary(h,u):this.viewId===4?this.updateTimeline(h,u):this.viewId===8?this.updateFieldPosesion(h,u):this.viewId===1?this.updateComparative(h,u):this.viewId===2?this.updateGSCtops(h,u):this.viewId===6?this.updateGSCLineupsReports(h,u):this.viewId===16?this.updateLastTouchSingle(h,$):this.viewId===18&&this.updateSpecificPlaysFiltersSingle(h,$)}}updateComparative(r,n){if(r.view.componentProps){const v=n[0]||[];if(v&&v.length>0){let $;if(Array.isArray(v)){const u=this.childViews.findIndex(i=>i.view.id===r.view.id);u>=0&&u<v.length?$=v[u]:$=v[0]}else $=v;const h=R4.get(this.viewId);r.view.componentProps.type=$,r.view.componentProps.default=!1,r.view.title=`Comparativa ${h[$]}`,r.view.filterMultiple={category:$}}Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n})}}updateVolumetricField(r,n){if(r.view.componentProps){const v=n[0]||1;r.view.isHomeTeam=v===1,r.view.componentProps.preMatchType=v,r.view.filterMultiple={isHomeTeam:v},Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateGoalData(r,n){if(r.view.componentProps){const v=n[0]===1?"offensive":"defensive",$=n[1]===1;r.view.componentProps.analysisType=v,r.view.componentProps.isHomeTeamForAnalysis=$,r.view.isHomeTeam=$,r.view.filterMultiple={isHomeTeam:$},Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateFieldDataByZones(r,n){if(r.view.componentProps){const v=n[0],$=n[1]===1;if(r.view.componentProps.isHomeTeamForAnalysis=$,r.view.isHomeTeam=$,r.view.filterMultiple={categoryIds:v,isHomeTeam:$},v&&v.length){const h=v.join("-"),u=R4.get(this.viewId).analysisTypes.get(h);u&&(r.view.componentProps.analysisType=u.analysisType,r.view.title=u.title,r.view.titleShort=u.titleShort)}}}updateXg(r,n){const v=n[0]===1;r.view.componentProps&&(r.view.isHomeTeam=v,r.view.componentProps.isHomeTeamForAnalysis=v,r.view.filtersJSON=this.filtresJSON,r.view.filterMultiple={isHomeTeam:v})}updateMatchSummary(r,n){if(r.view.componentProps){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const v=n&&n.length>0?n[0]:!1;r.view.componentProps.desplegable=v,r.view.componentProps.key=v,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n})}}updateTimeline(r,n){if(r.view.componentProps){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const v=this.getComponentDynamicFilters(r.view.id)||n,$=v&&v.length>0?v[0]:[];r.view.componentProps.selectedEvents=$,r.view.componentProps.key=$.length>0;const h=this.hasEventTypeId($,1),u=this.hasCategoryId($,8),i=this.hasCategoryId($,9),p=this.hasEventTypeId($,3);r.view.componentProps.goals=h,r.view.componentProps.yellowCards=u,r.view.componentProps.redCards=i,r.view.componentProps.substitutions=p,r.view.componentProps._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:v}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:v}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateFieldPosesion(r,n){if(r.view.componentProps){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const v=n&&n.length>0?n[0]:!1;r.view.componentProps.areInactiveVisible=v,r.view.componentProps.key=v,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n})}}updateGSCtops(r,n){if(r.view.componentProps){const v=n[0]||[];if(Array.isArray(v)){if(v.length>0){const $=v[0];let h=null;try{h=A4($)}catch(i){console.warn("Error getting category by ID:",i)}const u=n[1]||1;r.view.filterMultiple={categoryId:$,teamType:u},r.view.componentProps.game&&(u===1?r.view.componentProps.teamView=r.view.componentProps.game.homeTeam.team_id:u===2?r.view.componentProps.teamView=r.view.componentProps.game.awayTeam.team_id:r.view.componentProps.teamView=0),r.view.componentProps.categoryView=h?[{id:$,name:h.name}]:[{id:$,name:`Category ${$}`}]}}else{const $=v;if($){let h=null;try{h=A4($)}catch(i){console.warn("Error getting category by ID:",i)}const u=n[1]||1;r.view.filterMultiple={categoryId:$,teamType:u},r.view.componentProps.game&&(u===1?r.view.componentProps.teamView=r.view.componentProps.game.homeTeam.team_id:u===2?r.view.componentProps.teamView=r.view.componentProps.game.awayTeam.team_id:r.view.componentProps.teamView=0),r.view.componentProps.categoryView=h?[{id:$,name:h.name}]:[{id:$,name:`Category ${$}`}]}}}}updateGSCLineupsReports(r,n){if(r.view.componentProps){const v=n[0]||[];if(Array.isArray(v)){if(v.length>0){const $=v[0];r.view.filterMultiple={gameNumber:$},r.view.componentProps.gameNumber=$}}else{const $=v;$&&(r.view.filterMultiple={gameNumber:$},r.view.componentProps.gameNumber=$)}Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}getCategoryIdFromAnalysisType(r,n){if(!r||!n)return null;for(const v of n){const $=v.join("-"),h=R4.get(this.viewId);if(h&&h.analysisTypes){const u=h.analysisTypes.get($);if(u&&u.analysisType===r)return v[0]||null}}return null}updateLastTouchFilters(){if(!this.filters){console.warn("No filters available in updateLastTouchFilters");return}this.childViews.forEach($=>{$.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,$.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,$.view.filterMultiple.howManyGamesSelected=this.filters.howManyGamesSelected,$.view.filterMultiple.isAssistZoneVisible=this.filters.isAssistZoneVisible});const r=this.filters.selectedCategories.map($=>$.value),n=r.map($=>$.name),v=this.filters.selectedTeam.value;if(v===3)this.childViews.length>r&&this.childViews.reduce(($,h)=>(n.includes(h.view.componentProps.categories[0].name)||$.push(h.view.componentProps.categories[0].name),$),[]).forEach($=>{const h=this.childViews.findIndex(u=>u.view.componentProps.categories[0].name===$);if(h!==-1){const u=this.childViews[h];this.removeChildView(u)}});else{const $=v===1,h=this.getHomeTeamViews(),u=this.getAwayTeamViews();if($&&h.length===0)u.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=$,i.view.isHomeTeam=$,i.view.filterMultiple.isHomeTeam=$});else if(!$&&u.length===0)h.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=$,i.view.isHomeTeam=$,i.view.filterMultiple.isHomeTeam=$});else if(h.length===u.length)$||h.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=$,i.view.isHomeTeam=$,i.view.filterMultiple.isHomeTeam=$}),($?u:h).forEach(i=>{this.removeChildView(i)});else{const i=$?this.getHomeTeamViews():this.getAwayTeamViews();if(i.length>r.length){const p=r.map(c=>c.name);i.forEach(c=>{p.includes(c.view.componentProps.categories[0].name)?c.view.filterMultiple.isHomeTeam=$:this.removeChildView(c)})}else i.forEach(p=>{p.view.filterMultiple.isHomeTeam=$})}}}updateLastTouchSingle(r,n){if(r.view.componentProps){const v=n.selectedTeam.value===1,$=n.selectedCategory.value;r.view.isHomeTeam=v,r.view.componentProps.isHomeTeamForAnalysis=v,r.view.componentProps.categories=[$],r.view.componentProps.analysisType=n.selectedGamePhase.name,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.isAssistZoneVisible=n.isAssistZoneVisible,r.view.componentProps.howManyGames=n.howManyGamesSelected.value,r.view.title=$.name,r.view.titleShort=$.name,r.view.isHomeTeam=v,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:$,selectedGamePhase:n.selectedGamePhase,howManyGamesSelected:n.howManyGamesSelected,isAssistZoneVisible:n.isAssistZoneVisible}}}updateSpecificPlaysFilters(){if(!this.filters)return;this.childViews.forEach(n=>{n.view.componentProps.advancedFilters=this.filters.advancedFilters,n.view.componentProps.howManyCorners=this.filters.howManyCorners,n.view.componentProps.isAgainstMode=this.filters.isAgainstMode,n.view.filterMultiple.advancedFilters=this.filters.advancedFilters,n.view.filterMultiple.isAgainstMode=this.filters.isAgainstMode});const r=this.filters.selectedTeam.value;if(r===3){const n=this.getHomeTeamViews(),v=this.getAwayTeamViews();if(n.length+v.length>this.filters.howManyCorners*2){const $=[];n.forEach((h,u)=>{u>=this.filters.howManyCorners&&$.push(h)}),v.forEach((h,u)=>{u>=this.filters.howManyCorners&&$.push(h)}),$.forEach(h=>{this.removeChildView(h)})}}else{const n=r===1,v=this.getHomeTeamViews(),$=this.getAwayTeamViews();if(n&&v.length===0)$.forEach(h=>{console.log("awayView before update:",h),h.view.componentProps.isHomeTeamForAnalysis=n,h.view.isHomeTeam=n,h.view.filterMultiple.isHomeTeam=n});else if(!n&&$.length===0)v.forEach(h=>{h.view.componentProps.isHomeTeamForAnalysis=n,h.view.isHomeTeam=n,h.view.filterMultiple.isHomeTeam=n});else if(v.length===$.length)n||v.forEach(h=>{h.view.componentProps.isHomeTeamForAnalysis=n,h.view.isHomeTeam=n,h.view.filterMultiple.isHomeTeam=n}),(n?$:v).forEach(h=>{this.removeChildView(h)});else{const h=n?this.getHomeTeamViews():this.getAwayTeamViews();h.length>this.filters.howManyCorners?h.forEach((u,i)=>{i>=this.filters.howManyCorners?this.removeChildView(u):u.view.filterMultiple.isHomeTeam=n}):h.forEach(u=>{u.view.filterMultiple.isHomeTeam=n})}}}updateSpecificPlaysFiltersSingle(r,n){if(n.selectedTeam&&r.view.componentProps){const v=n.selectedTeam.value===1;r.view.isHomeTeam=v,r.view.componentProps.isHomeTeamForAnalysis=v,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.advancedFilters=n.advancedFilters,r.view.componentProps.isAgainstMode=n.isAgainstMode,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:n.advancedFilters,isAgainstMode:n.isAgainstMode}}}}const cHe={class:"template-page__header"},uHe={class:"template-page__header__name"},dHe=["value"],pHe={class:"template-page__header__details"},hHe={class:"template-page__header__details__teams"},fHe={class:"template-page__header__details__teams__team"},mHe={key:0,class:"template-page__header__details__teams__team__logo"},yHe=["src"],gHe={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},vHe={class:"template-page__header__details__teams__team"},bHe={key:0,class:"template-page__header__details__teams__team__logo"},xHe=["src"],_He={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wHe={class:"template-page__content"},THe=["id"],SHe=["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"],kHe=t.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:r}){var n,v,$,h,u,i,p;const c=t.ref(null);let a=null;const k=e,T=t.ref(!1),x=r,d=t.computed(()=>k.page.items.reduce((je,_e)=>(je.set(_e.id,_e),je),new Map)),o=t.computed(()=>{var je,_e,Ue,qe;return k.game&&k.game.homeTeam&&k.game.awayTeam?{homeTeam:{name:((je=k.game.homeTeam)==null?void 0:je.acronym)||"LOC",logo:((_e=k.game.homeTeam)==null?void 0:_e.logo)||null},awayTeam:{name:((Ue=k.game.awayTeam)==null?void 0:Ue.acronym)||"VIS",logo:((qe=k.game.awayTeam)==null?void 0:qe.logo)||null}}:{homeTeam:{name:"LOC"},awayTeam:{name:"VIS"}}});let l=null,s=null,f=!1,g=null,S=!1;const L=()=>{S=!0},E=()=>{S=!1};function P(){S||(f=!0,g&&clearTimeout(g),g=setTimeout(()=>{f=!1},150))}function V(){const je={root:null,rootMargin:"0px",threshold:.7};l=new IntersectionObserver(qe=>{qe.forEach(Re=>{if(f){s&&clearTimeout(s),s=setTimeout(()=>{x("intersection-changed",Re.isIntersecting)},100);return}s&&clearTimeout(s),s=setTimeout(()=>{x("intersection-changed",Re.isIntersecting)},50)})},je);const _e=c.value;_e&&l.observe(_e);const Ue=document.querySelector(".container-main");Ue&&Ue.addEventListener("scroll",P,{passive:!0}),document.addEventListener("programmatic-scroll-start",L),document.addEventListener("programmatic-scroll-end",E)}function I(je){k.page.title=je.target.value,x("view-changed")}const j={game_id:0,season_id:0,prematch:!1},U={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:[]}},D=new Map([[5,{component:DI,componentName:"GSCVolumetricField",props:{isGamePreMatch:!k.isPostMatch,areTeamsVisible:!1,isTitleVisible:!1,isGhostEffect:k.isTemplateMode,isTemplateMode:k.isTemplateMode,preMatchType:1}}],[2,{component:zj,componentName:"GscTopPlayer",props:{categoryView:[{id:0,name:"Category"}],gamed:k.game?k.game.id:U.gameId,game:k.game,season:k.game?(n=k==null?void 0:k.game)==null?void 0:n.season_id:U.seasonId,teamView:0,useDummyData:k.isTemplateMode}}],[8,{component:AD,componentName:"FieldPosesion",props:{widthSection:600,game:U,teamSelected:{teamId:0},areInactiveVisible:!0,showTitle:!1,isDefault:!0,key:!1}}],[6,{component:IK,componentName:"GSCLineupsReports",props:{selectedOption:k.isPostMatch?"Postmatch":"Prematch",game:j,gamehome:j,gameaway:j}}],[3,{component:FD,componentName:"GSCMatchSummary",props:{game:U,defaultShields:!0,desplegable:!1}}],[4,{component:wW,componentName:"GSCTimelineReports",props:{key:!0,isDefault:!0,gameId:U.gameId,homeTeam:U.homeTeam.team_id,awayTeam:U.awayTeam.team_id,token:k.token,goals:!0,yellowCards:!0,redCards:!0,substitutions:!0}}],[7,{component:EB,componentName:"GSCGoalData",props:{game:k.game,isHomeTeamForAnalysis:!0,canInteract:!1,canPlayVideos:!1,isPreMatch:!k.isPostMatch,analysisType:1}}],[9,{component:WK,componentName:"GSCFieldDataByZones",props:{game:k.game,isHomeTeamForAnalysis:!0,analysisType:"successfulPasses",canPlayVideos:!1,isPreMatch:!k.isPostMatch,negative:!0}}],[10,{component:iP,componentName:"GSCGameXg",props:{game:k.game,isHomeTeamForAnalysis:!0,isPostMatch:k.isPostMatch}}],[13,{component:YF,componentName:"GSCTimelapseTable",props:{isdefault:!0,seasonId:k.game?(v=k==null?void 0:k.game)==null?void 0:v.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:cF,componentName:"GSCGeneraltable",props:{isReports:!0,isDefault:!0,type:0,typeView:1,tournament:1,currentSeasonId:2010,showVideos:!1,localTeam:2,awayTeam:1}}],[15,{component:EX,componentName:"GSCStrengths",props:{token:k.token,view:1,numitems:3,typegame:1,isdefault:!0,data:{player:35240,season:1772,type:2,team:14}}}],[17,{component:DG,componentName:"GSCCornersGeneralTrend",props:{game:k.game?{id:k.game.id||k.game.game_id||k.game.gameId||null,home_team:k.game.home_team||null,away_team:k.game.visiting_team||null,season:k.game.seasonId||k.game.season_id||null,game_status:k.game.game_status||k.game.status||null,home_acronym:k.game.home_team_acronym||(($=k.game.homeTeam)==null?void 0:$.acronym)||null,away_acronym:k.game.visiting_team_acronym||((h=k.game.awayTeam)==null?void 0:h.acronym)||null,logo_home:((u=k.game.homeTeam)==null?void 0:u.logo)||null,logo_away:((i=k.game.awayTeam)==null?void 0:i.logo)||null}:null,infavoragainstteam:!0,forseason:!1,forteam:!0,showdefault:!0,tournamentselected:{id:1},forgame:!1,lateralidad:"right",teamselected:2,filters:{},showBallGo:!0,showHeatMap:!0,ballOnOff:!1}}],[10,{component:iP,componentName:"GSCGameXg",props:{game:k.game,isHomeTeamForAnalysis:!0,isPostMatch:k.isPostMatch}}],[1,{component:NB,componentName:"GSCComparativeReports",props:{gameId:k.game?k.game.id:"",homeLogo:k.game?k.game.homeTeam.logo:"",awayLogo:k.game?k.game.awayTeam.logo:"",seasonId:k.game?(p=k==null?void 0:k.game)==null?void 0:p.season_id:0,typeGame:k.isPostMatch,type:"stoppedBall",default:k.isTemplateMode}}],[16,{component:UX,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:k.isTemplateMode,isPreMatch:!k.isPostMatch}}],[18,{component:AZ,componentName:"GSCSpecificPlays",props:{isHomeTeamForAnalysis:!0,isTemplateMode:k.isTemplateMode,isPreMatch:!k.isPostMatch,seasonIdForAnalysis:1325,selectedCategory:31,teamIdForAnalysis:1,isAgainstMode:!1,game:{id:62323,home_team:1,away_team:14,season:1325,game_status:4,home_acronym:"CHI",away_acronym:"SAN",logo_home:"https://golstatsimages.blob.core.windows.net/teams-80/1.png",logo_away:"https://golstatsimages.blob.core.windows.net/teams-80/14.png"},advancedFilters:{areConnectionsVisible:!1,arePathsVisible:!1,secondsBefore:-1,secondsAfter:1,secondsBeforeAndAfter:0}}}]]);function F(je){var _e,Ue,qe;if(((_e=je==null?void 0:je.coreView)==null?void 0:_e.id)===17&&je.dynamicFilters&&je.dynamicFilters[2]!==void 0){const Re=je.dynamicFilters[2];if(Re===1)return!0;if(Re===2)return!1;if(Re===3&&((Ue=je.filterMultiple)==null?void 0:Ue.isHomeTeam)!==void 0)return typeof je.filterMultiple.isHomeTeam=="boolean"?je.filterMultiple.isHomeTeam:je.filterMultiple.isHomeTeam===1}return(qe=je.componentProps)!=null&&qe.preMatchType?je.componentProps.preMatchType===1:je.isHomeTeam}function z(je){if(je)if(typeof je=="string"){let _e=null;switch(je){case"GSCVolumetricField":_e=DI;break;case"GSCGoalData":_e=EB;break;case"GscTopPlayer":_e=zj;break;case"FieldPosesion":_e=AD;break;case"GSCLineupsReports":_e=IK;break;case"GSCMatchSummary":_e=FD;break;case"GSCTimelineReports":_e=wW;break;case"GSCFieldDataByZones":_e=WK;break;case"GSCGeneraltable":_e=cF;break;case"GSCTimelapseTable":_e=YF;break;case"GSCGameXg":_e=iP;break;case"GSCComparativeReports":_e=NB;break;case"GSCStrengths":_e=EX;break;case"GSCCornersGeneralTrend":_e=DG;break;case"GSCLastTouch":_e=UX;break;case"GSCSpecificPlays":_e=AZ;break;default:_e=null}return _e}else return je;return null}function X({pageId:je,view:_e,filterAndWidgetContainer:Ue,applyMinimumSize:qe=!1,dynamicFilters:Re=[],filters:We=null}){if(k.page.id===je&&a){let Qe=!1;_e.id===3&&(Qe=Re[0]);const rt=`min_column${Qe?"_2":""}`,dt=`min_row${Qe?"_2":""}`,ut=`colspan${Qe?"_2":""}`,Ye=`rowspan${Qe?"_2":""}`,st={w:qe?_e[rt]:_e[ut],h:qe?_e[dt]:_e[Ye]};if(a.willItFit(0,0,st.w,st.h,!0)){const lt=a.addWidget(st),Ot=Number(lt.getAttribute("gs-x")||0),zt=Number(lt.getAttribute("gs-y")||0);a.removeWidget(lt);const Et=D.get(_e.id),qt=t.reactive({...JSON.parse(JSON.stringify(Et.props))||{},_isReactive:!0}),Gt=t.reactive({pageId:je,grid:a,page:k.page,view:{name:_e.name,title:_e.title,key:Date.now()-7*Math.random(),id:`w-${String(Date.now())}`,x:Ot,y:zt,w:st.w,h:st.h,maxWidth:_e.max_column,maxHeight:_e.max_row,minWidth:_e.min_column,minHeight:_e.min_row,componentName:Et.componentName,componentProps:qt,pageId:je,coreView:_e}});Ue.addView(Gt),Sd.emit("add-page-view",Gt)}else Sd.emit("add-page-and-view",{pageId:je,view:_e,filterAndWidgetContainer:Ue})}}function M(je){if(a){const _e=document.querySelector(`[gs-id="${je.id}"]`);_e&&(a.removeWidget(_e),x("delete-view",je))}}function Y(je){if(!je.filterAndViewsContainer&&je.coreView){const _e=new Qk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[je],je.coreView.id,je.dynamicFilters||[],k.isPostMatch,k.isTemplateMode,je.filtersJSON,null,je.filters);je.filterAndViewsContainer=_e}x("edit-view",je)}function se(){x("delete-page",k.page)}function me(){Sd.emit("change-sort",k.page)}function ge(je){if(f)return;const _e=k.page.items.find(Ue=>Ue.id===je.itemId||Ue.id===je.viewId);_e&&(Object.assign(_e.componentProps,je.componentProps),_e._updateKey=Date.now())}function be(je){if(f)return;const _e=k.page.items.find(Ue=>Ue.id===je.viewId);_e&&(Object.assign(_e.componentProps,je.componentProps),_e._updateKey=Date.now())}function xe(je){if(f)return;const _e=k.page.items.find(Ue=>Ue.id===je.viewId);_e&&(Object.assign(_e.componentProps,je.componentProps||{}),_e._updateKey=Date.now())}const Pe=function(){Sd.off("add-view",X),Sd.off("force-component-update",ge),Sd.off("component-props-updated",be),Sd.off("dynamic-filters-changed",xe);const je=document.querySelector(".container-main");je&&je.removeEventListener("scroll",P),s&&clearTimeout(s),g&&clearTimeout(g)};return Sd.on("add-view",X),Sd.on("force-component-update",ge),Sd.on("component-props-updated",be),Sd.on("dynamic-filters-changed",xe),t.onMounted(async()=>{await t.nextTick(),a=Rh.init({column:12,row:12,maxRow:12,cellHeight:60,float:!0,resizable:{handles:"e, se, s, sw, w"}},`#grid-stack-${k.id}`),a.on("change",(je,_e)=>{const Ue=_e[0];if(Ue){const qe=d.value.get(Ue.id);qe&&(qe.x=Ue.x,qe.y=Ue.y,qe.w=Ue.w,qe.h=Ue.h,x("view-changed"))}}),V(),k.page.grid=a,k.page.offListeners=Pe}),t.onUnmounted(()=>{l&&l.disconnect(),Pe(),s&&clearTimeout(s),g&&clearTimeout(g),document.removeEventListener("programmatic-scroll-start",L),document.removeEventListener("programmatic-scroll-end",E)}),(je,_e)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"templatePage",ref:c,class:"template-page"},[t.createElementVNode("div",cHe,[T.value?(t.openBlock(),t.createBlock(RZ,{key:0,"options-type":"page",onClick:_e[0]||(_e[0]=t.withModifiers(Ue=>T.value=!1,["self"])),onMouseleave:_e[1]||(_e[1]=Ue=>T.value=!1),onCloseTooltip:_e[2]||(_e[2]=Ue=>T.value=!1),onDeletePage:se,onChangeSort:me})):t.createCommentVNode("",!0),t.createElementVNode("div",uHe,[_e[4]||(_e[4]=t.createElementVNode("div",null,[t.createElementVNode("svg",{width:"19",height:"21",viewBox:"0 0 19 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.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)),_e[5]||(_e[5]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("input",{value:e.page.title,type:"text",class:"page-title-input",onclick:"this.select()",onInput:I},null,40,dHe)]),t.createElementVNode("div",pHe,[t.createElementVNode("div",hHe,[t.createElementVNode("div",fHe,[o.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",mHe,[t.createElementVNode("img",{src:o.value.homeTeam.logo,alt:"Home Team Logo",width:"25",height:"25"},null,8,yHe)])):(t.openBlock(),t.createElementBlock("svg",gHe,[..._e[6]||(_e[6]=[t.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)])])),t.createElementVNode("span",null,t.toDisplayString(o.value.homeTeam.name),1)]),_e[8]||(_e[8]=t.createElementVNode("div",{class:"template-page__header__details__teams__vs"}," VS ",-1)),t.createElementVNode("div",vHe,[t.createElementVNode("span",null,t.toDisplayString(o.value.awayTeam.name),1),o.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",bHe,[t.createElementVNode("img",{src:o.value.awayTeam.logo,alt:"Away Team Logo",width:"25",height:"25"},null,8,xHe)])):(t.openBlock(),t.createElementBlock("svg",_He,[..._e[7]||(_e[7]=[t.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?(t.openBlock(),t.createElementBlock("div",{key:0,class:"template-page__header__details__options",onClick:_e[3]||(_e[3]=Ue=>T.value=!0)},[..._e[9]||(_e[9]=[t.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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)])])):t.createCommentVNode("",!0)])]),t.createElementVNode("div",wHe,[t.createElementVNode("div",{id:`grid-stack-${e.id}`,class:"grid-stack"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.page.items,Ue=>{var qe;return t.openBlock(),t.createElementBlock("div",{class:"grid-stack-item",key:Ue.key,"gs-id":Ue.id,"gs-x":Ue.x,"gs-y":Ue.y,"gs-w":Ue.w,"gs-h":Ue.h,"gs-max-w":Ue.maxWidth,"gs-max-h":Ue.maxHeight,"gs-min-w":Ue.minWidth,"gs-min-h":Ue.minHeight,"gs-no-resize":!e.isTemplateMode,"gs-no-move":!k.isTemplateMode,"gs-auto-position":Ue.x===0&&Ue.y===0},[t.createElementVNode("div",{class:t.normalizeClass(["grid-stack-item-content",{"is-selected":Ue.isSelected}])},[t.createVNode(eHe,{view:Ue,"is-template-mode":e.isTemplateMode,"is-post-match":e.isPostMatch,game:e.game,lastGames:e.lastGames,"is-home-team":F(Ue),"is-filter-visible":e.isFilterVisible,"view-id":((qe=Ue==null?void 0:Ue.coreView)==null?void 0:qe.id)||0,onEdit:Re=>Y(Ue),onDelete:Re=>M(Ue)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(z(Ue.componentName)),t.mergeProps({ref_for:!0},Ue.componentProps,{key:`${Ue.id}-${Ue._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,SHe)}),128))],8,THe)])],512))}}),LHe=t2(kHe,[["__scopeId","data-v-b0bc39a0"]]),NHe={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},OHe={key:0,class:"cover__main-logo cover__main-logo__home"},MHe={key:0,class:"team-logo"},EHe=["src"],CHe={key:1,width:"575",height:"675",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},zHe=["fill"],VHe={key:1,class:"cover__main-logo cover__main-logo__away"},PHe={key:0,class:"team-logo"},AHe=["src"],RHe={key:1,width:"575",height:"575",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},UHe=["fill"],FHe={class:"cover__title-subtitle"},IHe={class:"cover__title-subtitle__title"},qHe={class:"cover__title-subtitle__subtitle"},jHe={key:2,class:"cover-type-one"},DHe={class:"team-info-one"},WHe={class:"team-data"},KHe={key:0,class:"team-logo"},BHe=["src"],XHe={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},GHe=["fill","opacity"],ZHe={class:"team-name"},JHe={key:0,class:"team-events"},HHe={class:"score-one"},YHe={key:0},QHe={class:"team-info-one"},$He={class:"team-data"},eYe={key:0,class:"team-logo"},tYe=["src"],rYe={key:1,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},nYe=["fill","opacity"],aYe={class:"team-name"},iYe={key:0,class:"team-events"},oYe={key:3,class:"cover-type-two"},sYe={class:"team-data"},lYe={class:"team-info"},cYe={key:0,class:"team-logo"},uYe=["src"],dYe={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},pYe=["fill","opacity"],hYe={key:2,class:"team-score-two"},fYe={key:0,class:"team-goals"},mYe={class:"team-data"},yYe={class:"team-info"},gYe={key:0,class:"team-score-two"},vYe={key:1,class:"team-logo"},bYe=["src"],xYe={key:2,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_Ye=["fill","opacity"],wYe={key:0,class:"team-goals"},TYe={__name:"CoverPage",props:{game:{type:Object,default:()=>null},coverId:{type:Number,default:1},isPostMatch:{type:Boolean,default:!0}},emits:["intersection-changed"],setup(e,{emit:r}){const n=e,v=r,$=t.ref(null),h=t.computed(()=>[1,2].includes(n.coverId)),u=t.computed(()=>[1,3].includes(n.coverId)),i=t.computed(()=>n.coverId===1?{homeTeam:"#1558CC",awayTeam:"#0046BF",opacity:1}:n.coverId===3?{homeTeam:"#000A1A",awayTeam:"#000A1A",opacity:.4}:{homeTeam:"#576883",awayTeam:"#576883",opacity:.4}),p=t.computed(()=>n.game&&n.game.score?n.game.score:["0","0"]),c=t.computed(()=>{var I,j,U,D,F,z,X,M;if(n.game&&n.game.homeTeam&&n.game.awayTeam){const Y={homeTeam:{name:((I=n.game.homeTeam)==null?void 0:I.acronym)||"LOC",logo:((j=n.game.homeTeam)==null?void 0:j.logo)||null},awayTeam:{name:((U=n.game.awayTeam)==null?void 0:U.acronym)||"VIS",logo:((D=n.game.awayTeam)==null?void 0:D.logo)||null}};return h.value?(Y.homeTeam.goalsMinutes=o(n.game.minutes.home_goals_minutes),Y.homeTeam.totalYellowCards=((F=n.game.minutes.home_yellow_cards_minutes)==null?void 0:F.length)||0,Y.homeTeam.totalRedCards=((z=n.game.minutes.home_red_cards_minutes)==null?void 0:z.length)||0,Y.awayTeam.goalsMinutes=o(n.game.minutes.visiting_goals_minutes),Y.awayTeam.totalYellowCards=((X=n.game.minutes.away_yellow_cards_minutes)==null?void 0:X.length)||0,Y.awayTeam.totalRedCards=((M=n.game.minutes.away_red_cards_minutes)==null?void 0:M.length)||0):(Y.homeTeam.goalsEvents=d(n.game.report_minutes.home_goals_minutes),Y.awayTeam.goalsEvents=d(n.game.report_minutes.visiting_goals_minutes)),Y}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'"}]}}}),a=t.computed(()=>({"--background-image":u.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":n.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-one":n.isPostMatch?"100%":"fit-content","--grid-template-columns-type-two":n.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-two":n.isPostMatch?"100%":"fit-content"})),k=t.computed(()=>n.isPostMatch?"Postmatch":"Prematch"),T=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],x=t.computed(()=>{if(n.game){let I=NHe[n.game.matchday_abbreviation];I||(I=n.game.matchday_abbreviation.replace("M","J"));const[j,U,D]=n.game.date.split("-");return`${I} - ${D} ${T[Number(U)-1]}, ${j}`}return"Jornada - Día 00 Mes"});function d(I){return!I||!Array.isArray(I)||I.length===0?"":I.map(j=>{const U=j.split(", ");let D=U[0].replace("'","");D=D.replace("+",""),D=D.replace("’","");const F=D.split(" "),{strings:z,numbers:X}=F.reduce((se,me)=>(isNaN(Number(me))?se.strings.push(me):se.numbers.push(me),se),{strings:[],numbers:[]}),M=z.join(" "),Y=X.length===1?`${X[0]}'`:`${X[0]}' ${X.slice(1).join(" + ")}'`;return{playerName:M,goalTime:U.length===1?Y:`${Y}, ${U.reduce((se,me,ge)=>ge===0?se:`${se}${me}${ge<U.length-1?", ":""}`,"")}`}})}function o(I){return!I||!Array.isArray(I)||I.length===0?"":I.reduce((j,U,D)=>{const F=U.split(" ");let z="";return F.length===3?z=F[2]:F.length===5&&(z=`${F[2]} ${F[3]} ${F[4]}`),z&&(j+=`${z}${D<I.length-1?", ":""}`),j},"")}let l=null,s=null,f=!1,g=null,S=!1;const L=()=>{S=!0},E=()=>{S=!1};function P(){S||(f=!0,g&&clearTimeout(g),g=setTimeout(()=>{f=!1},150))}function V(){const I={root:null,rootMargin:"0px",threshold:.7};l=new IntersectionObserver(D=>{D.forEach(F=>{if(f){s&&clearTimeout(s),s=setTimeout(()=>{v("intersection-changed",F.isIntersecting)},100);return}s&&clearTimeout(s),s=setTimeout(()=>{v("intersection-changed",F.isIntersecting)},50)})},I);const j=$.value;j&&l.observe(j);const U=document.querySelector(".container-main");U&&U.addEventListener("scroll",P,{passive:!0}),document.addEventListener("programmatic-scroll-start",L),document.addEventListener("programmatic-scroll-end",E)}return t.onMounted(()=>{V()}),t.onUnmounted(()=>{l&&l.disconnect();const I=document.querySelector(".container-main");I&&I.removeEventListener("scroll",P),document.removeEventListener("programmatic-scroll-start",L),document.removeEventListener("programmatic-scroll-end",E),s&&clearTimeout(s),g&&clearTimeout(g)}),(I,j)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"coverPage",ref:$,class:"cover",style:t.normalizeStyle(a.value)},[h.value?(t.openBlock(),t.createElementBlock("div",OHe,[c.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",MHe,[t.createElementVNode("img",{src:c.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,EHe)])):(t.openBlock(),t.createElementBlock("svg",CHe,[t.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:i.value.homeTeam},null,8,zHe)]))])):t.createCommentVNode("",!0),h.value?(t.openBlock(),t.createElementBlock("div",VHe,[c.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",PHe,[t.createElementVNode("img",{src:c.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,AHe)])):(t.openBlock(),t.createElementBlock("svg",RHe,[t.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:i.value.awayTeam},null,8,UHe)]))])):t.createCommentVNode("",!0),t.createElementVNode("div",FHe,[t.createElementVNode("div",IHe,[j[0]||(j[0]=t.createElementVNode("div",null,"Análisis",-1)),t.createElementVNode("div",null,t.toDisplayString(k.value),1)]),t.createElementVNode("div",qHe,t.toDisplayString(x.value),1)]),h.value?(t.openBlock(),t.createElementBlock("div",jHe,[t.createElementVNode("div",DHe,[t.createElementVNode("div",WHe,[c.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",KHe,[t.createElementVNode("img",{src:c.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,BHe)])):(t.openBlock(),t.createElementBlock("svg",XHe,[t.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:i.value.homeTeam,opacity:i.value.opacity},null,8,GHe)])),t.createElementVNode("div",ZHe,t.toDisplayString(c.value.homeTeam.name),1)]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",JHe,[j[1]||(j[1]=t.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)),t.createElementVNode("div",null,t.toDisplayString(c.value.homeTeam.goalsMinutes),1),j[2]||(j[2]=t.createElementVNode("div",{class:"separator"},null,-1)),j[3]||(j[3]=t.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),t.createElementVNode("div",null,t.toDisplayString(c.value.homeTeam.totalYellowCards),1),j[4]||(j[4]=t.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),t.createElementVNode("div",null,t.toDisplayString(c.value.homeTeam.totalRedCards),1)])):t.createCommentVNode("",!0)]),t.createElementVNode("div",HHe,[e.isPostMatch?(t.openBlock(),t.createElementBlock("div",YHe,t.toDisplayString(p.value[0])+" : "+t.toDisplayString(p.value[1]),1)):t.createCommentVNode("",!0)]),t.createElementVNode("div",QHe,[t.createElementVNode("div",$He,[c.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",eYe,[t.createElementVNode("img",{src:c.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,tYe)])):(t.openBlock(),t.createElementBlock("svg",rYe,[t.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:i.value.awayTeam,opacity:i.value.opacity},null,8,nYe)])),t.createElementVNode("div",aYe,t.toDisplayString(c.value.awayTeam.name),1)]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",iYe,[t.createElementVNode("div",null,t.toDisplayString(c.value.awayTeam.totalYellowCards),1),j[5]||(j[5]=t.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),t.createElementVNode("div",null,t.toDisplayString(c.value.awayTeam.totalRedCards),1),j[6]||(j[6]=t.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),j[7]||(j[7]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",null,t.toDisplayString(c.value.awayTeam.goalsMinutes),1),j[8]||(j[8]=t.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))])):t.createCommentVNode("",!0)])])):(t.openBlock(),t.createElementBlock("div",oYe,[t.createElementVNode("div",sYe,[t.createElementVNode("div",lYe,[c.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",cYe,[t.createElementVNode("img",{src:c.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,uYe)])):(t.openBlock(),t.createElementBlock("svg",dYe,[t.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:i.value.homeTeam,opacity:i.value.opacity},null,8,pYe)])),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",hYe,t.toDisplayString(p.value[0]),1)):t.createCommentVNode("",!0)]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",fYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value.homeTeam.goalsEvents,(U,D)=>(t.openBlock(),t.createElementBlock("div",{key:`goal-${D}`,class:"goal"},[t.createElementVNode("div",null,t.toDisplayString(U.playerName),1),j[9]||(j[9]=t.createElementVNode("div",{class:"bullet"},null,-1)),t.createElementVNode("div",null,t.toDisplayString(U.goalTime),1),j[10]||(j[10]=t.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))])):t.createCommentVNode("",!0)]),j[13]||(j[13]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",mYe,[t.createElementVNode("div",yYe,[e.isPostMatch?(t.openBlock(),t.createElementBlock("div",gYe,t.toDisplayString(p.value[1]),1)):t.createCommentVNode("",!0),c.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",vYe,[t.createElementVNode("img",{src:c.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,bYe)])):(t.openBlock(),t.createElementBlock("svg",xYe,[t.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:i.value.awayTeam,opacity:i.value.opacity},null,8,_Ye)]))]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",wYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value.awayTeam.goalsEvents,(U,D)=>(t.openBlock(),t.createElementBlock("div",{key:`goal-a-${D}`,class:"goal"},[j[11]||(j[11]=t.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)),t.createElementVNode("div",null,t.toDisplayString(U.goalTime),1),j[12]||(j[12]=t.createElementVNode("div",{class:"bullet"},null,-1)),t.createElementVNode("div",null,t.toDisplayString(U.playerName),1)]))),128))])):t.createCommentVNode("",!0)])]))],4))}},SYe=t2(TYe,[["__scopeId","data-v-6680cbcf"]]),kYe={class:"table-category-filters"},LYe={key:0,class:"custom-radio-group filter-inline"},NYe={class:"radio-label"},OYe={class:"radio-options"},MYe=["name","value","onUpdate:modelValue"],EYe=["data-filter-type","onClick"],CYe={class:"select-display"},zYe={class:"select-label"},VYe={key:0,class:"dropdown-menu type-menu simple-select-menu"},PYe={class:"simple-select-scroll-area"},AYe=["onClick"],RYe={class:"option-content"},UYe={class:"option-title"},FYe={key:0,class:"option-checkmark"},IYe={key:2,class:"filter-separator"},qYe={__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:r,emit:n}){const v=e,$=n,h=t.ref([]);let u=null;const i=(S,L)=>{if(!L)return!0;for(let E=0;E<S.length;E++)if(!p(S[E],L[E]))return!0;return!1},p=(S,L)=>{if(Array.isArray(S)&&Array.isArray(L)){if(S.length!==L.length)return!1;for(let E=0;E<S.length;E++)if(S[E]!==L[E])return!1;return!0}return S===L},c=t.ref(null),a=t.ref([]);let k=!1,T=null;const x=()=>{T=null},d=()=>{setTimeout(()=>{k=!1},1e3)},o=(S,L=!0)=>{if(v.filters&&v.filters[0]&&v.filters[1]&&v.filters[1].options){const E=v.filters[0].options,P=v.filters[1].options;S!=null?E.findIndex(V=>V.value===S)!==-1&&P[S]?(a.value=P[S],L&&!(()=>{const V=h.value[1];return V==null?!1:Array.isArray(V)?V.length>0:V!==""})()&&!k&&a.value.length>0&&(h.value[1]=a.value[0].value,t.nextTick(()=>{}))):(a.value=[],h.value[1]=null):(a.value=[],h.value[1]=null)}},l=()=>{v.initialValues&&v.initialValues.length>0?h.value=[...v.initialValues]:h.value=v.filters.map(S=>{var L,E,P,V;return S.type==="select"?[]:S.type==="check"?!1:S.type==="radio-button"?((E=(L=S.options)==null?void 0:L[0])==null?void 0:E.value)||null:S.type==="select-simple"&&((V=(P=S.options)==null?void 0:P[0])==null?void 0:V.value)||null}),v.componentId===13&&h.value.some(S=>S!=null&&(Array.isArray(S)?S.length>0:S!==!1&&S!==""))&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))};l(),setTimeout(()=>{t.nextTick(()=>{if(h.value[0]!==null&&h.value[0]!==void 0&&!k){const S=!(()=>{const L=h.value[1];return L==null?!1:Array.isArray(L)?L.length>0:L!==""})();o(h.value[0],S)}})},300),t.watch(()=>v.initialValues,S=>{const L=!p(h.value,S),E=S&&S.length>0&&!k&&L,P=v.isEditMode&&k;E&&!P?h.value=[...S]:k?T&&T.length>0&&(h.value=[...T]):P&&T&&T.length>0&&(h.value=[...T])},{deep:!0}),t.watch(()=>v.isEditMode,(S,L)=>{L===!0&&S===!1&&x()},{immediate:!0}),t.watch(h,(S,L)=>{S.some(E=>E!=null&&(Array.isArray(E)?E.length>0:E!==!1&&E!==""))&&i(S,u)&&(u=[...S],$("filters-changed",{componentId:v.componentId,filters:S,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),t.watch(()=>h.value[0],(S,L)=>{S!==L&&L!==void 0?o(S,!0):L===void 0&&S!==null&&S!==void 0&&o(S,!1)},{immediate:!0}),t.watch(()=>h.value,(S,L)=>{v.filters.map((E,P)=>E.type==="radio-button"?P:-1).filter(E=>E!==-1)},{deep:!0}),t.watch(a,()=>{},{deep:!0});const s=S=>{c.value===S?c.value=null:c.value=S},f=(S,L)=>{if(k=!0,d(),h.value[S]=L,(S===0||S===1)&&(T=[...h.value]),c.value=null,S===0){h.value[1]!==void 0&&(h.value[1]=null);const E=k;k=!1,o(L,!0),k=E,h.value[1]!==null&&h.value[1]!==void 0&&(T=[...h.value])}},g=()=>{k=!0,setTimeout(()=>{k=!1},1e3)};return r({getCurrentValues:()=>h.value,initializeValues:l}),(S,L)=>(t.openBlock(),t.createElementBlock("div",kYe,[e.filters&&e.filters.length>0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filters,(E,P)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:P},[E.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",LYe,[t.createElementVNode("div",NYe,t.toDisplayString(E.label),1),t.createElementVNode("div",OYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(E.options,V=>(t.openBlock(),t.createElementBlock("label",{key:V.value,class:t.normalizeClass(["radio-option-card",{active:h.value[P]===V.value}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"table-radio-"+P,value:V.value,"onUpdate:modelValue":I=>h.value[P]=I,onChange:L[0]||(L[0]=()=>{g()})},null,40,MYe),[[t.vModelRadio,h.value[P]]]),t.createElementVNode("span",null,t.toDisplayString(V.label),1)],2))),128))])])):E.type==="select-simple"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"custom-select dynamic-select filter-inline","data-filter-type":E.type,onClick:t.withModifiers(V=>s(P),["stop"])},[t.createElementVNode("div",CYe,[L[2]||(L[2]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.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)),t.createElementVNode("span",zYe,t.toDisplayString(E.label||"Tipo de análisis"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:c.value===P}])},[...L[1]||(L[1]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),c.value===P?(t.openBlock(),t.createElementBlock("div",VYe,[t.createElementVNode("div",PYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(P===1?a.value:E.options,V=>(t.openBlock(),t.createElementBlock("div",{key:V.value,class:t.normalizeClass(["option-card simple-select-option",{active:p(h.value[P],V.value)}]),onClick:t.withModifiers(I=>f(P,V.value),["stop"])},[t.createElementVNode("div",RYe,[t.createElementVNode("div",UYe,t.toDisplayString(V.label),1)]),p(h.value[P],V.value)?(t.openBlock(),t.createElementBlock("div",FYe,[...L[3]||(L[3]=[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[t.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):t.createCommentVNode("",!0)],10,AYe))),128))])])):t.createCommentVNode("",!0)],8,EYe)):t.createCommentVNode("",!0),P===1&&e.filters.length>2?(t.openBlock(),t.createElementBlock("div",IYe)):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0)]))}},jYe=t2(qYe,[["__scopeId","data-v-fd7f7425"]]),DYe={class:"strengths-filters"},WYe={key:0,class:"custom-radio-group filter-inline"},KYe={class:"radio-label"},BYe={class:"radio-options"},XYe=["name","value","onUpdate:modelValue"],GYe={class:"filter-inline select-with-label"},ZYe=["data-filter-type","onClick"],JYe={class:"select-display"},HYe={class:"select-label"},YYe={key:0,class:"dropdown-menu type-menu simple-select-menu"},QYe={class:"simple-select-scroll-area"},$Ye=["onClick"],eQe={class:"option-content"},tQe={class:"option-title"},rQe={key:0,class:"option-checkmark"},nQe={key:2,class:"filter-separator"},aQe={__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:r,emit:n}){const v=e,$=n,h=t.ref([]);let u=null;const i=t.ref(null),p=t.ref([]);let c=!1,a=null;const k=(s,f)=>{if(Array.isArray(s)&&Array.isArray(f)){if(s.length!==f.length)return!1;for(let g=0;g<s.length;g++)if(s[g]!==f[g])return!1;return!0}return s===f},T=(s,f=!0)=>{if(v.filters&&v.filters[0]&&v.filters[1]&&v.filters[1].options){const g=v.filters[0].options,S=v.filters[1].options;s!=null?g.findIndex(L=>L.value===s)!==-1&&S[s]?(p.value=S[s],f&&!(()=>{const L=h.value[1];return L==null?!1:Array.isArray(L)?L.length>0:L!==""})()&&!c&&p.value.length>0&&(h.value[1]=p.value[0].value,t.nextTick(()=>{}))):(p.value=[],h.value[1]=null):(p.value=[],h.value[1]=null)}},x=()=>{v.initialValues&&v.initialValues.length>0?v.initialValues.length>0&&(typeof v.initialValues[0]=="number"||typeof v.initialValues[0]=="boolean"||v.initialValues[0]===null||Array.isArray(v.initialValues[0]))?h.value=[...v.initialValues]:v.isEditMode?h.value=v.filters.map((s,f)=>{var g,S,L,E,P,V,I,j,U,D;const F=v.initialValues[f];return F?s.type==="radio-button"&&F.selectedOption?F.selectedOption.value:s.type==="radio-button"&&!F.selectedOption?F.selectedValue!==void 0?F.selectedValue:((V=(P=s.options)==null?void 0:P[0])==null?void 0:V.value)||null:s.type==="select-simple"&&F.selectedValue!==void 0?Array.isArray(F.selectedValue)?F.selectedValue[0]:F.selectedValue:s.type==="select"&&F.selectedOptions?F.selectedOptions.map(z=>z.value):s.type==="check"&&F.isChecked!==void 0?F.isChecked:F.selectedValue!==void 0?F.selectedValue:s.type==="select"?[]:s.type==="check"?!1:s.type==="radio-button"?((j=(I=s.options)==null?void 0:I[0])==null?void 0:j.value)||null:s.type==="select-simple"&&((D=(U=s.options)==null?void 0:U[0])==null?void 0:D.value)||null:s.type==="select"?[]:s.type==="check"?!1:s.type==="radio-button"?((S=(g=s.options)==null?void 0:g[0])==null?void 0:S.value)||null:s.type==="select-simple"&&((E=(L=s.options)==null?void 0:L[0])==null?void 0:E.value)||null}):h.value=[...v.initialValues]:h.value=v.filters.map(s=>{var f,g,S,L;return s.type==="select"?[]:s.type==="check"?!1:s.type==="radio-button"?((g=(f=s.options)==null?void 0:f[0])==null?void 0:g.value)||null:s.type==="select-simple"&&((L=(S=s.options)==null?void 0:S[0])==null?void 0:L.value)||null}),h.value.some(s=>s!=null&&(Array.isArray(s)?s.length>0:s!==!1&&s!==""))&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))};x(),setTimeout(()=>{t.nextTick(()=>{if(h.value[0]!==null&&h.value[0]!==void 0&&!c){const s=!(()=>{const f=h.value[1];return f==null?!1:Array.isArray(f)?f.length>0:f!==""})();T(h.value[0],s)}})},300),t.watch(()=>v.initialValues,(s,f)=>{if(!s||s.length===0)return;const g=s.length>0&&(typeof s[0]=="number"||typeof s[0]=="boolean"||s[0]===null||Array.isArray(s[0])),S=!k(h.value,s),L=s&&s.length>0&&!c&&S,E=v.isEditMode&&c;L&&!E?g?h.value=[...s]:v.isEditMode?h.value=v.filters.map((P,V)=>{const I=s[V];return I?P.type==="radio-button"&&I.selectedOption?I.selectedOption.value:P.type==="select-simple"&&I.selectedValue!==void 0?Array.isArray(I.selectedValue)?I.selectedValue[0]:I.selectedValue:P.type==="select"&&I.selectedOptions?I.selectedOptions.map(j=>j.value):P.type==="check"&&I.isChecked!==void 0?I.isChecked:I.selectedValue!==void 0?I.selectedValue:h.value[V]:h.value[V]}):h.value=[...s]:c?a&&a.length>0&&(h.value=[...a]):E&&a&&a.length>0&&(h.value=[...a])},{deep:!0}),t.watch(()=>v.isEditMode,(s,f)=>{f===!0&&s===!1&&(a=null)},{immediate:!0}),t.watch(h,s=>{s.some(f=>f!=null&&(Array.isArray(f)?f.length>0:f!==!1&&f!==""))&&(()=>{if(!u)return!0;for(let f=0;f<s.length;f++)if(!k(s[f],u[f]))return!0;return!1})()&&(u=[...s],$("filters-changed",{componentId:v.componentId,filters:s,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),t.watch(()=>h.value[0],(s,f)=>{s!==f&&f!==void 0?T(s,!0):f===void 0&&s!==null&&s!==void 0&&T(s,!1)},{immediate:!0});const d=s=>{i.value===s?i.value=null:i.value=s},o=(s,f)=>{if(c=!0,setTimeout(()=>{c=!1},1e3),h.value[s]=f,(s===0||s===1)&&(a=[...h.value]),i.value=null,s===0){h.value[1]!==void 0&&(h.value[1]=null);const g=c;c=!1,T(f,!0),c=g,h.value[1]!==null&&h.value[1]!==void 0&&(a=[...h.value])}},l=()=>{c=!0,setTimeout(()=>{c=!1},400)};return r({getCurrentValues:()=>h.value,initializeValues:x}),(s,f)=>(t.openBlock(),t.createElementBlock("div",DYe,[e.filters&&e.filters.length>0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filters,(g,S)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:S},[g.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",WYe,[t.createElementVNode("div",KYe,t.toDisplayString(g.label),1),t.createElementVNode("div",BYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g.options,L=>(t.openBlock(),t.createElementBlock("label",{key:L.value,class:t.normalizeClass(["radio-option-card",{active:h.value[S]===L.value}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"strengths-radio-"+S,value:L.value,"onUpdate:modelValue":E=>h.value[S]=E,onChange:l},null,40,XYe),[[t.vModelRadio,h.value[S]]]),t.createElementVNode("span",null,t.toDisplayString(L.label),1)],2))),128))])])):g.type==="select-simple"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[f[4]||(f[4]=t.createElementVNode("div",{class:"filter-separator"},null,-1)),t.createElementVNode("div",GYe,[f[3]||(f[3]=t.createElementVNode("div",{class:"radio-label"},"Mostrar: ",-1)),t.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":g.type,onClick:t.withModifiers(L=>d(S),["stop"])},[t.createElementVNode("div",JYe,[f[1]||(f[1]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.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)),t.createElementVNode("span",HYe,t.toDisplayString(g.label||"Tipo de análisis"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:i.value===S}])},[...f[0]||(f[0]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),i.value===S?(t.openBlock(),t.createElementBlock("div",YYe,[t.createElementVNode("div",QYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g.options,L=>(t.openBlock(),t.createElementBlock("div",{key:L.value,class:t.normalizeClass(["option-card simple-select-option",{active:k(h.value[S],L.value)}]),onClick:t.withModifiers(E=>o(S,L.value),["stop"])},[t.createElementVNode("div",eQe,[t.createElementVNode("div",tQe,t.toDisplayString(L.label),1)]),k(h.value[S],L.value)?(t.openBlock(),t.createElementBlock("div",rQe,[...f[2]||(f[2]=[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[t.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):t.createCommentVNode("",!0)],10,$Ye))),128))])])):t.createCommentVNode("",!0)],8,ZYe)])],64)):t.createCommentVNode("",!0),S===1&&e.filters.length>2?(t.openBlock(),t.createElementBlock("div",nQe)):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0)]))}},iQe=t2(aQe,[["__scopeId","data-v-700ac1f0"]]),oQe=(e,r)=>{const n=e.__vccOpts||e;for(const[v,$]of r)n[v]=$;return n},sQe={key:1},lQe={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cQe=["fill"],uQe={key:0,class:"checkbox__teams"},dQe={class:"checkbox__teams__logo"},pQe=["src"],hQe={class:"checkbox__teams__logo"},fQe=["src"],mQe={__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:r}){const n=e;t.useCssVars(c=>({"7bd9d47b":e.width,"34dc7ddc":e.height}));const v=t.ref(!1),$=t.computed(()=>{const c={color:n.boxValueColor,"font-family":n.fontFamily,height:n.boxWidthAndHeight,width:n.boxWidthAndHeight,minWidth:n.boxWidthAndHeight,"border-radius":n.boxBorderRadius,"margin-top":n.boxMarginTop};return v.value?(c["background-color"]=n.boxBackgroundColor,c.border=`solid ${n.boxBorderWidth} ${n.boxBackgroundColor}`):c.border=`solid ${n.boxBorderWidth} ${n.boxBorderColor}`,c}),h=t.computed(()=>({"font-family":n.boxValueFontFamily,"font-size":n.boxValueFontSize,color:n.boxValueColor,"line-height":1})),u=t.computed(()=>{const c={color:n.labelColor,"font-family":n.fontFamily,"font-size":n.labelFontSize,"white-space":n.labelWhiteSpace,"text-align":n.boxPosition==="top"||n.boxPosition==="bottom"?"center":n.boxPosition};return(n.boxPosition==="left"||n.boxPosition==="right")&&(c[`margin-${n.boxPosition}`]=n.isBoxOnly?"0":n.teamsIds?"8px":"10px"),c});t.watch(()=>n.modelValue,c=>{c!==v.value&&(v.value=c)},{immediate:!0});function i(){n.avoidInteraction||!v.value&&n.avoidToCheck||(v.value=!v.value,r("update:modelValue",v.value))}function p(c){return`${{}.TEAM_LOGOS_URL||"https://golstatsimages.blob.core.windows.net/teams-80/"}${c}.png`}return(c,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["checkbox",`box-${e.boxPosition}`]),onClick:i},[t.createElementVNode("div",{class:"checkbox__box",style:t.normalizeStyle($.value)},[v.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[n.boxValue?(t.openBlock(),t.createElementBlock("div",{key:0,class:"checkbox__box__value",style:t.normalizeStyle(h.value)},t.toDisplayString(e.boxValue),5)):(t.openBlock(),t.createElementBlock("div",sQe,[(t.openBlock(),t.createElementBlock("svg",lQe,[t.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,cQe)]))]))],64)):t.createCommentVNode("",!0)],4),e.teamsIds&&e.teamsIds.length?(t.openBlock(),t.createElementBlock("div",uQe,[t.createElementVNode("div",dQe,[t.createElementVNode("img",{src:p(e.teamsIds[0]),alt:""},null,8,pQe)]),t.createElementVNode("div",hQe,[t.createElementVNode("img",{src:p(e.teamsIds[1]),alt:""},null,8,fQe)])])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"checkbox__label",style:t.normalizeStyle(u.value)},t.toDisplayString(e.label),5)],2))}},oA=oQe(mQe,[["__scopeId","data-v-b6f124d8"]]),yQe=(e,r)=>{const n=e.__vccOpts||e;for(const[v,$]of r)n[v]=$;return n},sA={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))}}},DZ=()=>{t.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}))},WZ=sA.setup;sA.setup=WZ?(e,r)=>(DZ(),WZ(e,r)):DZ;const gQe=e=>(t.pushScopeId("data-v-f3ee6b2b"),e=e(),t.popScopeId(),e),vQe=["src"],bQe={key:1,class:"text"},xQe=["src"],_Qe={class:"stats"},wQe=gQe(()=>t.createElementVNode("img",{class:"iconstats",src:"https://golstatsimages.blob.core.windows.net/todoelfut/playdes.png"},null,-1)),TQe={class:"numstats"},SQe={class:"leyend"};function kQe(e,r,n,v,$,h){return t.openBlock(),t.createElementBlock("div",null,[n.type==0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["button",$.status&&n.typeOnOff&&"button-active"]),style:t.normalizeStyle([h.customStyle,$.status&&n.typeOnOff&&h.customActive]),onClick:r[0]||(r[0]=(...u)=>h.btnClick&&h.btnClick(...u))},[n.icon&&n.iconPosition.toLowerCase()==="left"?(t.openBlock(),t.createElementBlock("img",{key:0,class:"icon",style:t.normalizeStyle({width:n.iconSize}),src:n.icon},null,12,vQe)):t.createCommentVNode("",!0),n.textValue?(t.openBlock(),t.createElementBlock("div",bQe,t.toDisplayString(n.textValue),1)):t.createCommentVNode("",!0),n.icon&&n.iconPosition.toLowerCase()==="right"?(t.openBlock(),t.createElementBlock("img",{key:2,class:"icon",style:t.normalizeStyle({width:n.iconSize}),src:n.icon},null,12,xQe)):t.createCommentVNode("",!0)],6)):t.createCommentVNode("",!0),n.type==1?(t.openBlock(),t.createElementBlock("div",{key:1,class:"button-target",onClick:r[1]||(r[1]=(...u)=>h.btnClick&&h.btnClick(...u))},[t.createElementVNode("div",_Qe,[wQe,t.createElementVNode("div",TQe,t.toDisplayString(n.textStat),1)]),t.createElementVNode("div",SQe,t.toDisplayString(n.textCategory),1)])):t.createCommentVNode("",!0)])}const LQe=yQe(sA,[["render",kQe],["__scopeId","data-v-f3ee6b2b"]]),NQe={class:"gsc-dropdown__main-container__item-selected"},OQe=["height","width"],MQe=["stroke"],EQe={key:1,width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},CQe=["fill"],zQe={class:"gsc-dropdown__items-container"},VQe=["onClick"],PQe={key:0,class:"gsc-dropdown__items-footer"},$k={__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(r=>r 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:r}){const n=e,v=t.ref({}),$=t.ref(null),h=t.ref(n.isMultipleOption?-1:0),u=t.ref(!1);t.watch(()=>n.items,(x,d)=>{if(!n.modelValue&&(!n.onlyFirstTime||!d||!d.length)&&x&&x.length){if(n.defaultItemByProp){const o=n.items.findIndex(l=>l[n.defaultItemByProp.propName]===n.defaultItemByProp.value);o!==-1?(h.value=o,v.value=x[o]):(h.value=0,v.value=x[0])}else v.value=x[n.defaultItemByIndex];r("input",v.value)}},{immediate:!0}),t.watch(()=>n.modelValue,x=>{if(x){const d=n.items.findIndex(o=>typeof x=="object"?JSON.stringify(o)===JSON.stringify(x):o===x);d!==-1&&(h.value=d,v.value=n.items[d],r("update:modelValue",v.value))}},{immediate:!0});const i=t.computed(()=>({height:n.height,width:n.width,backgroundColor:n.backgroundColor,borderRadius:`${n.borderRadius}px`,border:`${n.borderType} ${n.borderWidth}px ${n.borderColor}`,color:n.color,"--hover-background-color":n.hoverBackgroundColor,"--list-container-padding":n.listContainerPadding,"--list-item-padding":n.listItemPadding,"--list-item-margin":n.listItemMargin,"--list-background-color":n.listBackgroundColor,"--list-height":n.listHeight,"--list-item-border-radius":n.listItemBorderRadius,"--list-item-selected-color":n.listItemSelectedColor,"--list-item-selected-background-color":n.listItemSelectedBackgroundColor,"--list-item-color":n.listItemColor,"--list-border-radius":`${n.listBorderRadius}`,"--list-border-color":n.listBorderColor,"--list-width":n.isListSameWidth?n.width:"fit-content","--list-border-width":`${n.listBorderWidth}px`,"--list-margin-top":n.listMarginTop,"--list-left":n.listAlignment==="left"?"0":"auto","--list-right":n.listAlignment==="right"?"0":"auto","--footer-border":`${n.footerBorderWidth}px solid ${n.footerBorderColor}`,"--dropdown-opacity":n.isDisabled?"0.5":"1","--dropdown-cursor":n.isDisabled?"not-allowed":"pointer","--dropdown-font-size":n.fontSize?n.fontSize:"14px"})),p=t.computed(()=>({height:`${n.arrowHeight}px`,width:`${n.arrowWidth}px`}));function c(){n.isDisabled||(u.value=!u.value)}function a(x){$.value&&!$.value.contains(x.target)&&(u.value=!1)}function k(x,d){n.isMultipleOption?h.value=-1:(h.value=d,u.value=!1),v.value=x,r("input",v.value),r("update:modelValue",v.value)}function T(){u.value=!1,r("click-ready")}return t.onMounted(()=>{document.addEventListener("click",a)}),t.onBeforeMount(()=>{document.removeEventListener("click",a)}),(x,d)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"dropDown",ref:$,class:"gsc-dropdown",style:t.normalizeStyle(i.value)},[t.createElementVNode("div",{class:"gsc-dropdown__main-container",style:t.normalizeStyle({"padding-right":`${e.arrowWidth+8}px`}),onClick:c},[t.createElementVNode("div",NQe,[t.renderSlot(x.$slots,"default",{selectedItem:v.value})]),t.createElementVNode("div",{class:t.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":u.value}]),style:t.normalizeStyle(p.value)},[e.iconType===1?(t.openBlock(),t.createElementBlock("svg",{key:0,height:e.arrowHeight,width:e.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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,MQe)],8,OQe)):(t.openBlock(),t.createElementBlock("svg",EQe,[t.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,CQe)]))],6)],4),t.createVNode(t.Transition,null,{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",zQe,[t.createElementVNode("div",null,[t.createElementVNode("div",{class:"gsc-dropdown__items",style:t.normalizeStyle({"margin-top":`${n.borderWidth}px`})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.items,(o,l)=>(t.openBlock(),t.createElementBlock("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["gsc-dropdown__items__item",{selected:l===h.value}]),key:l,onClick:s=>k(o,l)},[t.renderSlot(x.$slots,"availableItem",{item:o})],10,VQe)),[[t.vShow,!o.isHidden]])]))),256))],4),e.isFooterVisible?(t.openBlock(),t.createElementBlock("div",PQe,[t.createVNode(t.unref(LQe),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:T})])):t.createCommentVNode("",!0)])],512),[[t.vShow,u.value]])]),_:3})],4))}},lA={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},AQe=[{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"}}],RQe=[{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}}],UQe={class:"last-touch"},FQe={class:"selected-item"},IQe={class:"available-item"},qQe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},jQe={class:"selected-item"},DQe={class:"available-item"},WQe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},KQe={key:1},BQe={class:"selected-item"},XQe={class:"available-item"},GQe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ZQe={class:"last-touch__how-many-games"},JQe={class:"selected-item"},HQe={class:"available-item"},YQe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},QQe={__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:r}){const n=e,v=r,$=t.ref([{label:"Ofensivo",value:2,name:"offensive"},{label:"Defensivo",value:3,name:"defensive"}]),h=t.ref({id:0,name:"Fases de juego",value:null}),u=t.ref(!1),i=t.ref([{id:1,name:"Último partido",value:1},{id:3,name:"Últimos 3 partidos",value:3},{id:0,name:"Todos mis partidos",value:0}]),p=t.ref(n.defaultFilters?null:i.value[0]),c=t.ref(null),a=t.computed(()=>({...lA})),k=t.computed(()=>({...lA,isFooterVisible:!n.isEditMode,isMultipleOption:!n.isEditMode})),T=t.computed(()=>{const ge=[];return x.value.options.forEach(be=>{be.forEach(xe=>{ge.push(xe)})}),ge}),x=t.ref(null),d=t.ref(null),o=t.ref(null),l=t.ref(null);t.watch(()=>n.viewConfig,ge=>{ge.filters&&(x.value||s(),d.value||f(),o.value||g(),l.value||P())},{immediate:!0});function s(){if(n.viewConfig&&n.viewConfig.filters){const ge=n.viewConfig.filters.find(be=>be.key==="categories");ge&&ge.options&&(x.value={label:ge.label,options:Object.entries(ge.options).reduce((be,[xe,Pe])=>(be.set(Number(xe),Pe),be),new Map)})}x.value={label:"Tipo de jugada",options:new Map([[2,RQe],[3,AQe]])}}function f(){if(n.viewConfig&&n.viewConfig.filters){const ge=n.viewConfig.filters.find(be=>be.key==="gamePhases");if(ge){d.value={label:ge.label,options:ge.options};return}}d.value={label:"Fases de juego",options:$.value}}function g(){if(n.viewConfig&&n.viewConfig.filters){const ge=n.viewConfig.filters.find(be=>be.key==="teamRadios");if(ge){o.value={options:ge.options},F(null,ge.options[0]);return}}o.value={label:"Equipo",options:n.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]},F(null,o.value.options[0])}const S=t.ref(n.defaultFilters?null:o.value.options[0]),L=t.ref(n.defaultFilters?null:d.value.options[0]),E=t.ref(n.defaultFilters?null:x.value.options.get(L.value.value)[0]);function P(){if(n.viewConfig&&n.viewConfig.filters){const ge=n.viewConfig.filters.find(be=>be.key==="assistZoneCheckbox");if(ge){l.value={label:ge.label},z(ge.value);return}}l.value={label:"Zona de asistencia"}}const V=t.computed(()=>{const ge={selectedGamePhase:L.value,selectedTeam:S.value,isAssistZoneVisible:u.value,howManyGamesSelected:p.value};return n.isEditMode?(ge.selectedCategory=E.value,ge.totalCategoriesSelected=1):(ge.selectedCategories=c.value,ge.totalCategoriesSelected=0,x.value.options.forEach(be=>{be.forEach(xe=>{xe.isSelected&&(ge.totalCategoriesSelected+=1)})})),ge}),I=t.computed(()=>L.value?x.value.options.get(L.value.value)||[]:[]);t.watch(()=>V.value,ge=>{j()&&v("change",{areAllFiltersFilled:j(),filters:ge,view:n.viewConfig})},{deep:!0});function j(){return L.value&&(n.isEditMode&&E.value||!n.isEditMode&&c.value&&c.value.length)&&S.value&&p.value}function U(ge){L.value=ge,M(null)}function D(ge){S.value=ge}function F(ge,be){console.log("onChangeRadio:",be.value)}function z(ge){u.value=ge}function X(ge){p.value=ge}function M(ge){E.value=ge}function Y(ge,be){be.isSelected=ge,c.value=T.value.filter(xe=>xe.isSelected)}function se(){n.defaultFilters&&(u.value=n.defaultFilters.isAssistZoneVisible,p.value=i.value.find(ge=>ge.value===n.defaultFilters.howManyGamesSelected.value)||i.value[0],L.value=d.value.options.find(ge=>ge.value===n.defaultFilters.selectedGamePhase.value)||d.value.options[0],S.value=o.value.options.find(ge=>ge.value===(n.defaultFilters.isHomeTeam?1:2))||o.value.options[0],E.value=x.value.options.get(L.value.value).find(ge=>ge.value.name===n.defaultFilters.selectedCategory.name)||x.value.options.get(L.value.value)[0])}function me(){I.value.forEach(ge=>{ge.isSelected=!1}),u.value=!1,p.value=i.value[0],L.value=null,S.value=null,E.value=null,c.value=null}return t.onBeforeUnmount(()=>{me()}),t.onMounted(()=>{setTimeout(()=>{se()},500)}),(ge,be)=>(t.openBlock(),t.createElementBlock("div",UQe,[t.createVNode(t.unref($k),t.mergeProps(a.value,{items:d.value.options,"model-value":L.value,"onUpdate:modelValue":U}),{default:t.withCtx(()=>[t.createElementVNode("div",FQe,[be[0]||(be[0]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.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"}),t.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)),t.createElementVNode("div",null,t.toDisplayString(L.value?L.value.label:d.value.label||h.value.name),1)])]),availableItem:t.withCtx(({item:xe})=>[t.createElementVNode("div",IQe,[t.createElementVNode("div",null,t.toDisplayString(xe.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",qQe,[...be[1]||(be[1]=[t.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)),[[t.vShow,L.value&&L.value.label===xe.label]])])])]),_:1},16,["items","model-value"]),t.createVNode(t.unref($k),t.mergeProps(k.value,{items:I.value,"model-value":E.value,"onUpdate:modelValue":M}),{default:t.withCtx(()=>[t.createElementVNode("div",jQe,[be[2]||(be[2]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.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"}),t.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)),t.createElementVNode("div",null,t.toDisplayString(x.value.label),1)])]),availableItem:t.withCtx(({item:xe})=>[t.createElementVNode("div",DQe,[e.isEditMode?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",null,t.toDisplayString(xe.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",WQe,[...be[3]||(be[3]=[t.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)),[[t.vShow,E.value&&E.value.label===xe.label]])])],64)):(t.openBlock(),t.createElementBlock("div",KQe,[t.createVNode(t.unref(oA),{"model-value":xe.isSelected,label:xe.label,"onUpdate:modelValue":Pe=>Y(Pe,xe)},null,8,["model-value","label","onUpdate:modelValue"])]))])]),_:1},16,["items","model-value"]),t.createVNode(t.unref($k),t.mergeProps(a.value,{items:o.value.options,"model-value":S.value,"onUpdate:modelValue":D}),{default:t.withCtx(()=>[t.createElementVNode("div",BQe,[be[4]||(be[4]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.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"}),t.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)),t.createElementVNode("div",null,t.toDisplayString(S.value?S.value.label:o.value.label),1)])]),availableItem:t.withCtx(({item:xe})=>[t.createElementVNode("div",XQe,[t.createElementVNode("div",null,t.toDisplayString(xe.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",GQe,[...be[5]||(be[5]=[t.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)),[[t.vShow,S.value&&S.value.label===xe.label]])])])]),_:1},16,["items","model-value"]),t.createVNode(t.unref(oA),{"model-value":u.value,label:l.value.label,"onUpdate:modelValue":z},null,8,["model-value","label"]),t.withDirectives(t.createElementVNode("div",ZQe,[t.createVNode(t.unref($k),t.mergeProps(a.value,{items:i.value,"model-value":p.value,"onUpdate:modelValue":X}),{default:t.withCtx(()=>[t.createElementVNode("div",JQe,[be[6]||(be[6]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.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"}),t.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)),t.createElementVNode("div",null,t.toDisplayString(p.value?p.value.name:"Seleccione"),1)])]),availableItem:t.withCtx(({item:xe})=>[t.createElementVNode("div",HQe,[t.createElementVNode("div",null,t.toDisplayString(xe.name),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",YQe,[...be[7]||(be[7]=[t.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)),[[t.vShow,p.value&&p.value.name===xe.name]])])])]),_:1},16,["items","model-value"])],512),[[t.vShow,!e.isPostMatch]])]))}},$Qe=t2(QQe,[["__scopeId","data-v-7e67f3f8"]]),e$e=(e,r)=>{const n=e.__vccOpts||e;for(const[v,$]of r)n[v]=$;return n},t$e={__name:"GSC-Menu",props:{menuMarginTop:{type:Number,default:0,validator(e){return!Number.isNaN(e)}},modelValue:{type:Boolean,default:!1},width:{type:String,default:"fit-content"},menuWidth:{type:String,default:"fit-content"},zIndexOpen:{type:Number,default:3},leftMenu:{type:String,default:"unset"}},emits:["update:modelValue"],setup(e,{emit:r}){const n=e;t.useCssVars(x=>({"6263632b":e.width,"252e289a":p.value,d3c8b2e8:e.menuWidth}));const v=t.ref(null),$=t.ref(!1),h=t.ref(null),u=t.ref({}),i=t.ref({top:"0px",left:n.leftMenu,width:n.menuWidth}),p=t.computed(()=>$.value?n.zIndexOpen:1);t.watch(()=>n.modelValue,x=>{x!==$.value&&($.value=x)},{immediate:!0}),t.watch($,async x=>{var d;if(x){await t.nextTick();const o=(d=h.value)==null?void 0:d.getBoundingClientRect();o&&setTimeout(()=>{c({boundingClientRect:o})},1e3)}else setTimeout(()=>{u.value["--translate-x"]="0px"},500)});function c(x){const d=window.innerWidth,o=x.boundingClientRect.x,l=x.boundingClientRect.x+x.boundingClientRect.width,s=o<=0?Math.abs(o)+10:l>=d?d-(l+30):0;if(u.value["--translate-x"]=`${s}px`,v.value){const f=v.value.getBoundingClientRect();i.value.top=`${f.height+n.menuMarginTop}px`}}function a(){new IntersectionObserver(x=>{x[0].intersectionRatio>0&&c(x[0])}).observe(h.value)}function k(){$.value=!$.value,r("update:modelValue",$.value)}function T(){$.value=!1,r("update:modelValue",$.value)}return t.onMounted(()=>{t.nextTick(()=>{a()})}),(x,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[$.value?(t.openBlock(),t.createElementBlock("div",{key:0,id:"menu-overlay",onClick:T})):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"menu-container",style:t.normalizeStyle(u.value)},[t.createElementVNode("div",{ref_key:"trigger",ref:v,class:"menu-container__trigger",onClick:k},[t.renderSlot(x.$slots,"trigger",{},void 0,!0)],512),t.createVNode(t.Transition,null,{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{ref_key:"menu",ref:h,class:"menu-container__menu",style:t.normalizeStyle(i.value)},[t.renderSlot(x.$slots,"menu",{},void 0,!0)],4),[[t.vShow,$.value]])]),_:3})],4)],64))}},r$e=e$e(t$e,[["__scopeId","data-v-419c8567"]]),Kb={CORNERS_ADVANCED:"cornersAdvanced"},n$e={key:0,class:"button__icon"},a$e={key:0,width:"19",height:"17",viewBox:"0 0 19 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i$e=["stroke"],o$e=["stroke"],s$e=["stroke"],l$e={key:1,width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c$e=["stroke"],u$e=["stroke"],d$e=["fill"],p$e={key:2,width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h$e=["fill"],f$e={key:3,width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m$e=["stroke"],y$e=["stroke"],g$e=["stroke"],v$e=["stroke"],b$e=["stroke"],x$e={key:4,width:"18",height:"17",viewBox:"0 0 18 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_$e={key:5,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},w$e={key:6,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T$e={key:7,width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},S$e={key:8,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},k$e={class:"button__text"},L$e={key:0,class:"info-container"},N$e={key:1,style:{width:"20px"}},O$e={width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},M$e=["fill"],E$e={__name:"ButtonFilter",props:{isActive:{type:Boolean,default:!1},showBadge:{type:Boolean,default:!0},showBadgeOnFilterFull:{type:Boolean,default:!0},text:{type:String,default:""},infoValue:{type:[String,Number],default:""},filtersTotal:{type:Number,default:0},textFontFamily:{type:String,default:"sans-serif"},textFontSize:{type:String,default:"14px"},fontColor:{type:String,default:"white"},infoBackgroundColor:{type:String,default:"#424D58"},infoFontColor:{type:String,default:"#CBEE6B"},infoFontFamily:{type:String,default:"sans-serif"},infoFontSize:{type:String,default:"10px"},infoBorderColor:{type:String,default:"#0D1D29"},infoBorderRadius:{type:String,default:"4px"},infoHeight:{type:String,default:"20px"},infoWidth:{type:String,default:"20px"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},backgroundColor:{type:String,default:"#0D1D29"},borderRadius:{type:String,default:"8px"},borderColor:{type:String,default:"#172531"},borderColorActive:{type:String,default:"white"},borderWidth:{type:String,default:"1px"},padding:{type:String,default:"12px"},arrowColor:{type:String,default:"#92929D"},iconColor:{type:String,default:"#92929D"},iconType:{type:String,default:"productivity"},showIcon:{type:Boolean,default:!0}},setup(e){const r=e,n=t.computed(()=>({"--height":r.height,"--width":r.width,"--text-font-family":r.textFontFamily,"--text-font-size":r.textFontSize,"--background-color":r.backgroundColor,"--border-radius":r.borderRadius,"--border-color":r.isActive?r.borderColorActive:r.borderColor,"--border-width":r.borderWidth,"--padding":r.padding,"--font-color":r.fontColor})),v=t.computed(()=>({"--info-background-color":r.infoValue?r.infoBackgroundColor:"transparent","--info-border-color":r.infoValue?r.infoBorderColor:"transparent","--info-border-radius":r.infoBorderRadius,"--info-font-family":r.infoFontFamily,"--info-font-size":r.infoFontSize,"--info-font-color":r.infoFontColor,"--info-height":r.infoHeight,"--info-width":r.infoWidth})),$=t.computed(()=>[Kb.PLAYS_TYPES,Kb.GOLSTATS,Kb.TOURNAMENTS,Kb.PLAYS,Kb.RESULTS,Kb.RESULTS_BY_TIME].includes(r.iconType)),h=t.computed(()=>[Kb.FIELD,Kb.GAMES].includes(r.iconType)),u=t.computed(()=>[Kb.DETAILS,Kb.UNIVERSE].includes(r.iconType)),i=t.computed(()=>[Kb.PERSONAL_DATA].includes(r.iconType)),p=t.computed(()=>[Kb.PRODUCTIVITY].includes(r.iconType)),c=t.computed(()=>(console.log("props.iconType",r.iconType),[Kb.CORNERS_ADVANCED].includes(r.iconType))),a=t.computed(()=>[Kb.HOW_WAS_CORNER].includes(r.iconType)),k=t.computed(()=>[Kb.TAKEN_CORNERS].includes(r.iconType)),T=t.computed(()=>[Kb.ZONE].includes(r.iconType)),x=t.computed(()=>[Kb.WHAT_HAPPENED].includes(r.iconType));return(d,o)=>(t.openBlock(),t.createElementBlock("div",{class:"button",style:t.normalizeStyle(n.value)},[e.showIcon?(t.openBlock(),t.createElementBlock("div",n$e,[i.value?(t.openBlock(),t.createElementBlock("svg",a$e,[t.createElementVNode("path",{d:"M12.6665 16.0001V14.3334C12.6665 13.4494 12.3153 12.6015 11.6902 11.9764C11.0651 11.3513 10.2173 11.0001 9.33323 11.0001H4.33329C3.44925 11.0001 2.60141 11.3513 1.9763 11.9764C1.35119 12.6015 1 13.4494 1 14.3334V16.0001",stroke:e.iconColor,"stroke-opacity":"1","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,i$e),t.createElementVNode("path",{d:"M6.83329 7.66658C8.67422 7.66658 10.1666 6.17422 10.1666 4.33329C10.1666 2.49237 8.67422 1 6.83329 1C4.99237 1 3.5 2.49237 3.5 4.33329C3.5 6.17422 4.99237 7.66658 6.83329 7.66658Z",stroke:e.iconColor,"stroke-opacity":"1","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,o$e),t.createElementVNode("path",{d:"M15.164 5.16663V10.1666M17.664 7.66659H12.6641",stroke:e.iconColor,"stroke-opacity":"1","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,s$e)])):t.createCommentVNode("",!0),$.value||c.value?(t.openBlock(),t.createElementBlock("svg",l$e,[t.createElementVNode("path",{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:e.iconColor,"stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,c$e),t.createElementVNode("path",{d:"M15.9996 16.8727L14.8359 15.7091",stroke:e.iconColor,"stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,u$e),t.createElementVNode("path",{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:e.iconColor,stroke:"#353F47","stroke-width":"0.3"},null,8,d$e)])):t.createCommentVNode("",!0),u.value?(t.openBlock(),t.createElementBlock("svg",p$e,[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.5 0C13.1944 0 17 3.80558 17 8.5C17 13.1944 13.1944 17 8.5 17C3.80558 17 0 13.1944 0 8.5C0 3.80558 3.80558 0 8.5 0ZM8.49751 1.54553C4.65662 1.54553 1.54297 4.65919 1.54297 8.50008C1.54297 12.341 4.65662 15.4546 8.49751 15.4546C12.3384 15.4546 15.4521 12.341 15.4521 8.50008C15.4521 4.65919 12.3384 1.54553 8.49751 1.54553ZM8.49929 3.09082C8.92605 3.09082 9.27202 3.43678 9.27202 3.86355V8.12198L12.451 10.5945C12.7878 10.8565 12.8485 11.342 12.5865 11.6789C12.3245 12.0157 11.839 12.0764 11.5022 11.8144L8.02488 9.10986C7.83666 8.96347 7.72656 8.73837 7.72656 8.49991V3.86355C7.72656 3.43678 8.07252 3.09082 8.49929 3.09082Z",fill:e.iconColor},null,8,h$e)])):t.createCommentVNode("",!0),h.value?(t.openBlock(),t.createElementBlock("svg",f$e,[t.createElementVNode("rect",{x:"1.16772",y:"1.16699",width:"19",height:"15.6667",stroke:e.iconColor},null,8,m$e),t.createElementVNode("rect",{x:"16.1677",y:"6.16699",width:"4",height:"5.66667",stroke:e.iconColor},null,8,y$e),t.createElementVNode("rect",{x:"1.16772",y:"6.16699",width:"4",height:"5.66667",stroke:e.iconColor},null,8,g$e),t.createElementVNode("path",{d:"M10.6677 0.666992V16.5003",stroke:e.iconColor},null,8,v$e),t.createElementVNode("path",{d:"M13.5033 9.00032C13.5033 10.5651 12.2348 11.8337 10.67 11.8337C9.1052 11.8337 7.83667 10.5651 7.83667 9.00032C7.83667 7.43552 9.1052 6.16699 10.67 6.16699C12.2348 6.16699 13.5033 7.43552 13.5033 9.00032Z",stroke:e.iconColor},null,8,b$e)])):t.createCommentVNode("",!0),p.value?(t.openBlock(),t.createElementBlock("svg",x$e,[...o[0]||(o[0]=[t.createElementVNode("path",{d:"M1.85113 13.0897C1.9303 13.2137 2.01739 13.3404 2.10447 13.4617C2.30239 13.7361 2.51878 14 2.74837 14.2507C3.74589 15.3298 5.01785 16.1504 6.41385 16.5963C6.4719 16.6148 6.52996 16.6332 6.58802 16.6491C6.60385 16.6544 6.61704 16.657 6.63024 16.6623C6.70413 16.6834 6.77538 16.7045 6.84927 16.723C7.54859 16.9077 8.27429 17 9.00264 17C9.73098 17 10.4593 16.9077 11.1586 16.7256C11.3064 16.686 11.4542 16.6438 11.5967 16.5989C11.9187 16.496 12.2353 16.372 12.5414 16.2322C12.7895 16.1187 13.0296 15.9921 13.2645 15.8549C14.2963 15.2533 15.2041 14.438 15.9034 13.467C15.9668 13.3799 16.0301 13.2876 16.0908 13.1926C16.1119 13.1609 16.133 13.1293 16.1541 13.095C16.9432 11.8681 17.405 10.4486 17.4868 8.98945C17.4947 8.84169 17.5 8.69393 17.5 8.54618C17.5 8.53034 17.5 8.51715 17.5 8.50132C17.5 6.90765 17.0646 5.37995 16.2386 4.04222C16.1198 3.85224 15.9932 3.66491 15.8612 3.48021C15.8586 3.47493 15.8559 3.4723 15.8533 3.46702C15.8084 3.40633 15.7636 3.34565 15.7161 3.2876C15.6712 3.22955 15.6237 3.1715 15.5789 3.1161C14.6526 1.98417 13.4466 1.10818 12.0928 0.580475C11.9556 0.525066 11.8105 0.474934 11.668 0.42744C10.8103 0.145118 9.91307 0 9.00264 0C8.09221 0 7.19497 0.14248 6.33732 0.424802C6.19482 0.472295 6.04967 0.525066 5.91245 0.577836C4.55604 1.10554 3.35005 1.98417 2.42378 3.11346C2.37364 3.17678 2.32086 3.24011 2.27072 3.30607C2.2285 3.35884 2.18892 3.41161 2.14933 3.46702C2.14933 3.46702 2.14933 3.46966 2.14669 3.4723C2.14669 3.47493 2.14405 3.47757 2.14142 3.48021C1.43418 4.44591 0.94598 5.53034 0.69792 6.68074C0.660975 6.85224 0.626669 7.02639 0.600279 7.20053C0.571251 7.39578 0.547501 7.59103 0.531667 7.78892C0.521111 7.91293 0.513195 8.03694 0.507917 8.16095C0.502639 8.27441 0.5 8.38786 0.5 8.50132V8.61214C0.502639 8.73615 0.507917 8.8628 0.513195 8.98945C0.595002 10.4486 1.05681 11.8681 1.84586 13.0923L1.85113 13.0897ZM1.82738 7.64908C1.82738 7.63325 1.83002 7.62005 1.83266 7.60422C1.84322 7.52771 1.85377 7.45119 1.86433 7.37731C1.86433 7.36412 1.86697 7.35092 1.86961 7.33773C1.8828 7.25594 1.89863 7.1715 1.91447 7.08971C1.91711 7.07124 1.92238 7.05541 1.92502 7.03694C1.94086 6.95778 1.95933 6.87599 1.9778 6.79683V6.78628C1.99891 6.70449 2.02266 6.62269 2.04378 6.5409C2.04905 6.52243 2.05433 6.5066 2.05961 6.48813C2.08336 6.40897 2.10711 6.32718 2.1335 6.24802L2.14142 6.22164C2.16517 6.14776 2.19156 6.07652 2.21794 6.00264C2.22322 5.98681 2.23114 5.97098 2.23642 5.95515C2.26545 5.87863 2.29711 5.79947 2.32878 5.72559C2.33406 5.70976 2.34197 5.69657 2.34725 5.68338C2.37628 5.61478 2.40795 5.54617 2.43962 5.47757C2.44489 5.46702 2.45017 5.45383 2.45545 5.44063C2.48975 5.36676 2.5267 5.29024 2.56628 5.21636C2.5742 5.20053 2.58212 5.1847 2.59267 5.16887C2.63226 5.09499 2.6692 5.02375 2.71143 4.94987V4.94195H2.7167L3.2656 6.63061L1.82738 7.67546C1.82738 7.67546 1.82738 7.65699 1.83002 7.64908H1.82738ZM4.08367 7.6095L5.62745 8.31926L6.52204 11.0712L5.62481 12.1108H2.74309C2.23642 11.2348 1.92238 10.2612 1.81683 9.25594L4.08367 7.6095ZM7.58026 1.41161C7.65942 1.39578 7.74123 1.37995 7.8204 1.36675C7.84151 1.36412 7.86262 1.35884 7.88109 1.3562C7.96026 1.34301 8.03679 1.33245 8.11596 1.32454C8.13971 1.3219 8.16346 1.31926 8.18721 1.31662C8.24791 1.30871 8.30596 1.30343 8.36666 1.29815C8.39305 1.29815 8.42207 1.29288 8.44846 1.29024C8.52235 1.28496 8.59361 1.27968 8.6675 1.27705C8.69916 1.27705 8.73347 1.27441 8.76514 1.27177C8.82319 1.27177 8.88125 1.26913 8.94194 1.26913C8.98153 1.26913 9.01847 1.26913 9.05806 1.26913C9.11611 1.26913 9.17681 1.26913 9.23487 1.27177C9.26653 1.27177 9.30084 1.27177 9.33251 1.27705C9.4064 1.27968 9.48029 1.28496 9.55154 1.29024C9.58057 1.29024 9.60696 1.29551 9.63334 1.29815C9.69404 1.30343 9.75473 1.30871 9.81279 1.31662C9.83654 1.31926 9.86029 1.3219 9.88668 1.32454C9.96585 1.33509 10.045 1.34565 10.1215 1.3562L10.1849 1.36675C10.264 1.37995 10.3459 1.39314 10.425 1.41161C10.4277 1.41161 10.4303 1.41161 10.4356 1.41161H10.4382L9 2.45646L7.56178 1.41161H7.56442C7.56442 1.41161 7.5697 1.41161 7.57234 1.41161H7.58026ZM9.00528 6.56728L11.1138 8.10026L10.3089 10.5805H7.70165L6.89677 8.10026L9.00528 6.56728ZM15.3018 4.94459V4.94987C15.3466 5.02111 15.3862 5.09499 15.4232 5.16887L15.4469 5.21636C15.4839 5.29024 15.5208 5.36676 15.5577 5.44063C15.563 5.45119 15.5683 5.46438 15.5736 5.47493C15.6052 5.54354 15.6369 5.61214 15.6659 5.68338C15.6712 5.69657 15.6791 5.7124 15.6844 5.72559C15.7161 5.80211 15.7478 5.87863 15.7768 5.95778C15.7821 5.97361 15.79 5.98945 15.7953 6.00528C15.8216 6.07916 15.848 6.1504 15.8718 6.22428C15.8744 6.23219 15.8771 6.24011 15.8797 6.25066C15.9061 6.32982 15.9298 6.40897 15.9536 6.49077C15.9589 6.50923 15.9641 6.52771 15.9694 6.54618C15.9905 6.62797 16.0143 6.70976 16.0328 6.78892C16.0328 6.7942 16.0328 6.79683 16.0328 6.80211C16.0512 6.88127 16.0697 6.96042 16.0855 7.03958L16.0961 7.09235C16.1119 7.17414 16.1278 7.25594 16.141 7.33773C16.141 7.35092 16.1462 7.36412 16.1462 7.37731C16.1568 7.45119 16.1673 7.52771 16.1779 7.60422C16.1779 7.62005 16.1805 7.63325 16.1832 7.64908C16.1832 7.65699 16.1832 7.66755 16.1858 7.67546L14.7476 6.63061L15.2965 4.93931L15.3018 4.94459ZM13.9295 7.61214L16.1937 9.25858C16.0882 10.2639 15.7715 11.2401 15.2675 12.1135H12.3858L11.4912 11.0739L12.3858 8.3219L13.9295 7.61214ZM14.3306 13.3879C14.3306 13.3879 14.3254 13.3931 14.3227 13.3958C14.2673 13.4565 14.2093 13.5172 14.1512 13.5752C14.138 13.5884 14.1248 13.6016 14.1116 13.6148C14.0536 13.6728 13.9929 13.7309 13.9322 13.7889C13.9216 13.7995 13.9111 13.81 13.8979 13.8206C13.8424 13.8707 13.7844 13.9235 13.729 13.971C13.7184 13.9789 13.7079 13.9894 13.6973 14C13.634 14.0554 13.5706 14.1055 13.5047 14.1583C13.4888 14.1715 13.473 14.1821 13.4598 14.1953C13.3938 14.2454 13.3278 14.2955 13.2619 14.3456C13.2619 14.3456 13.2566 14.3483 13.2566 14.3509C13.188 14.4011 13.1194 14.4486 13.0481 14.496C13.0323 14.5066 13.0165 14.5172 12.998 14.5277C12.9294 14.5726 12.8581 14.6174 12.7895 14.6623C12.7763 14.6702 12.7658 14.6781 12.7526 14.6834C12.6892 14.723 12.6233 14.7599 12.5573 14.7968C12.5441 14.8048 12.5283 14.8127 12.5151 14.8206C12.4438 14.8602 12.3699 14.8997 12.296 14.9367C12.2802 14.9446 12.2617 14.9525 12.2459 14.9631C12.1746 15 12.1007 15.0343 12.0295 15.0686C12.0242 15.0686 12.0189 15.0739 12.0137 15.0765H12.0084L12.5573 13.3879H14.3306ZM6.00217 15.0765L5.98898 15.0712C5.91509 15.0369 5.8412 15 5.76731 14.9631C5.75147 14.9551 5.73564 14.9472 5.71981 14.9393C5.64592 14.9024 5.57203 14.8628 5.49814 14.8206C5.48494 14.8127 5.47175 14.8048 5.45855 14.7995C5.39258 14.7625 5.32661 14.723 5.26063 14.6834C5.25008 14.6781 5.23688 14.6702 5.22633 14.6623C5.15508 14.6201 5.08646 14.5726 5.01521 14.5277C4.99938 14.5172 4.98355 14.5066 4.96771 14.496C4.89646 14.4486 4.82785 14.4011 4.75924 14.3509H4.75396C4.68799 14.2982 4.61937 14.248 4.5534 14.1953C4.53757 14.1821 4.52437 14.1715 4.50854 14.1583C4.44256 14.1055 4.37923 14.0554 4.3159 14C4.30534 13.9894 4.29478 13.9815 4.28159 13.971C4.22353 13.9208 4.16812 13.8707 4.1127 13.8206C4.10214 13.81 4.08895 13.7995 4.07839 13.7889C4.0177 13.7335 3.957 13.6755 3.89894 13.6148C3.88575 13.6016 3.87256 13.5884 3.85936 13.5752C3.8013 13.5172 3.74589 13.4591 3.69047 13.3984C3.68783 13.3958 3.68519 13.3931 3.67991 13.3879H5.45328L6.00217 15.0765C6.00217 15.0765 5.99954 15.0765 5.9969 15.0765H6.00217ZM7.50636 15.5726L6.63552 12.8971L7.53012 11.8602H10.4804L11.375 12.8971L10.5042 15.5726C9.52251 15.7784 8.48805 15.781 7.50373 15.5726H7.50636ZM14.3755 3.66755L13.4809 6.41953L11.9371 7.12929L9.6439 5.46174V3.57784L11.9503 1.90237C12.8713 2.31135 13.6999 2.91557 14.3781 3.66755H14.3755ZM6.06287 1.90237L8.3693 3.57784V5.46174L6.07606 7.12929L4.53229 6.41953L3.63769 3.66755C4.3159 2.91557 5.14452 2.31398 6.06551 1.90237H6.06287Z",fill:"#979DA2"},null,-1)])])):t.createCommentVNode("",!0),k.value?(t.openBlock(),t.createElementBlock("svg",_$e,[...o[1]||(o[1]=[t.createElementVNode("path",{d:"M17.182 5.9a.538.538 0 0 0-.13-.416L14.24 2.109a.558.558 0 0 0-.433-.203h-2.25c-.017 0-.034.012-.056.012a.557.557 0 0 0-.563.41 1.68 1.68 0 0 1-1.63 1.266 1.68 1.68 0 0 1-1.632-1.266.55.55 0 0 0-.563-.41c-.017 0-.033-.012-.056-.012h-2.25a.558.558 0 0 0-.433.203L1.561 5.484a.586.586 0 0 0-.129.416c.017.152.09.287.208.382l2.605 2.082v8.167c0 .31.253.563.562.563h9c.31 0 .563-.253.563-.563V8.364l2.604-2.082a.59.59 0 0 0 .208-.382zm-3.937 4.444H5.37V9.78h7.875v.563zM5.37 15.969v-4.5h7.875v4.5H5.37zm9-9.045v-.518a.564.564 0 0 0-.563-.562.564.564 0 0 0-.562.562v2.25H5.37v-2.25a.564.564 0 0 0-.563-.562.564.564 0 0 0-.562.562v.518L2.793 5.765l2.278-2.734h1.66A2.802 2.802 0 0 0 9.307 4.72a2.803 2.803 0 0 0 2.576-1.688h1.66l2.278 2.734-1.451 1.159z",fill:"#98A2B3"},null,-1)])])):t.createCommentVNode("",!0),a.value?(t.openBlock(),t.createElementBlock("svg",w$e,[...o[2]||(o[2]=[t.createElementVNode("path",{d:"M15.426 3.353a2.384 2.384 0 0 0-2.381 2.381 2.384 2.384 0 0 0 2.381 2.382 2.384 2.384 0 0 0 2.381-2.382 2.384 2.384 0 0 0-2.381-2.38zm0 3.766a1.386 1.386 0 0 1-1.385-1.385c0-.763.622-1.384 1.385-1.384s1.385.621 1.385 1.384c0 .764-.622 1.385-1.385 1.385zM1.424 6.558a.497.497 0 0 0 .704 0l1.295-1.296L4.72 6.558a.497.497 0 0 0 .704 0 .498.498 0 0 0 0-.705L4.128 4.558l1.295-1.295a.498.498 0 0 0-.705-.705L3.423 3.853 2.128 2.558a.499.499 0 0 0-.704.705l1.295 1.295-1.295 1.295a.498.498 0 0 0 0 .705zM13.013 12.443a.498.498 0 0 0-.705 0l-1.295 1.295-1.295-1.295a.499.499 0 0 0-.704.704l1.295 1.295-1.295 1.295a.499.499 0 0 0 .704.705l1.295-1.295 1.295 1.295a.497.497 0 0 0 .705 0 .498.498 0 0 0 0-.705l-1.295-1.295 1.295-1.295a.498.498 0 0 0 0-.704zM12.052 5.455l-2.01-1.747a.498.498 0 0 0-.654.753l1.066.926c-3.145.411-5.008 2.055-6.043 3.444a9.569 9.569 0 0 0-1.501 3.012 2.384 2.384 0 0 0-2.103 2.364 2.384 2.384 0 0 0 2.381 2.381 2.384 2.384 0 0 0 2.381-2.381 2.385 2.385 0 0 0-1.647-2.265 8.674 8.674 0 0 1 1.312-2.547C6.53 7.674 8.33 6.66 10.594 6.372l-.992 1.142a.498.498 0 0 0 .752.654l1.747-2.01a.498.498 0 0 0-.05-.703zm-7.48 8.752c0 .763-.62 1.384-1.384 1.384a1.386 1.386 0 0 1-1.384-1.384c0-.764.62-1.385 1.384-1.385.763 0 1.385.622 1.385 1.385z",fill:"#98A2B3",stroke:"#98A2B3","stroke-width":".3"},null,-1)])])):t.createCommentVNode("",!0),T.value?(t.openBlock(),t.createElementBlock("svg",T$e,[...o[3]||(o[3]=[t.createElementVNode("rect",{x:".707",y:".9",width:"5.2",height:"5.2",rx:".8",stroke:"#98A2B3","stroke-width":"1.2"},null,-1),t.createElementVNode("rect",{x:"8.707",y:".9",width:"5.2",height:"5.2",rx:".8",fill:"#98A2B3",stroke:"#98A2B3","stroke-width":"1.2"},null,-1),t.createElementVNode("rect",{x:".707",y:"8.9",width:"5.2",height:"5.2",rx:".8",fill:"#98A2B3",stroke:"#98A2B3","stroke-width":"1.2"},null,-1),t.createElementVNode("rect",{x:"8.707",y:"8.9",width:"5.2",height:"5.2",rx:".8",stroke:"#98A2B3","stroke-width":"1.2"},null,-1)])])):t.createCommentVNode("",!0),x.value?(t.openBlock(),t.createElementBlock("svg",S$e,[...o[4]||(o[4]=[t.createStaticVNode('<g clip-path="url(#gpdeo9cu3a)" fill="#98A2B3" data-v-2df3c6a9><path d="M9.307.5C4.505.5.598 4.407.598 9.209c0 2 .69 3.938 1.946 5.486l-.754 3.159a.524.524 0 0 0 .727.599l3.038-1.384a8.743 8.743 0 0 0 3.752.848c4.802 0 8.709-3.907 8.709-8.708C18.016 4.407 14.109.5 9.307.5zm0 16.368a7.574 7.574 0 0 1-3.502-.845.525.525 0 0 0-.457-.011l-2.289 1.042.566-2.372a.524.524 0 0 0-.113-.465A7.657 7.657 0 0 1 1.647 9.21c0-4.224 3.436-7.66 7.66-7.66s7.66 3.436 7.66 7.66c0 4.223-3.436 7.66-7.66 7.66z" data-v-2df3c6a9></path><path d="M9.68 5.199c-1.094-.115-2.459.397-3.041 1.797a.524.524 0 0 0 .968.403c.375-.902 1.255-1.231 1.964-1.157.721.075 1.232.542 1.365 1.25.13.693-.136 1.097-1.097 1.662-1.042.613-1.372.874-1.372 2.27a.524.524 0 0 0 1.049 0c0-.479.033-.715.118-.843.094-.14.33-.283.737-.523.666-.392 1.905-1.12 1.596-2.76-.221-1.171-1.098-1.975-2.288-2.1zM9.145 12.673a.608.608 0 0 0-.506.17c-.13.13-.19.31-.17.505a.525.525 0 0 0 .939.263.523.523 0 0 0-.263-.938z" data-v-2df3c6a9></path></g><defs data-v-2df3c6a9><clipPath id="gpdeo9cu3a" data-v-2df3c6a9><path fill="#fff" transform="translate(.307 .5)" d="M0 0h18v18H0z" data-v-2df3c6a9></path></clipPath></defs>',2)])])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.createElementVNode("div",k$e,t.toDisplayString(e.text),1),e.showBadge?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.showBadgeOnFilterFull?(t.openBlock(),t.createElementBlock("div",L$e,[t.createElementVNode("div",{class:"button__info",style:t.normalizeStyle(v.value)},[t.withDirectives(t.createElementVNode("span",null,t.toDisplayString(e.infoValue),513),[[t.vShow,e.infoValue]])],4)])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.filtersTotal>0&&e.filtersTotal!=parseInt(e.infoValue)?(t.openBlock(),t.createElementBlock("div",{key:0,class:"button__info",style:t.normalizeStyle(v.value)},[t.withDirectives(t.createElementVNode("span",null,t.toDisplayString(e.infoValue),513),[[t.vShow,e.infoValue]])],4)):e.filtersTotal>0?(t.openBlock(),t.createElementBlock("div",N$e)):t.createCommentVNode("",!0)],64))],64)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["button__arrow",{"rotated-180":e.isActive}])},[(t.openBlock(),t.createElementBlock("svg",O$e,[t.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,M$e)]))],2)],4))}},C$e=t2(E$e,[["__scopeId","data-v-2df3c6a9"]]),z$e={__name:"SwitchCustom",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:r}){const n=e,v=r,$=t.ref(null);t.watch(()=>n.modelValue,()=>{h()},{immediate:!0});function h(){$.value&&($.value.checked=n.modelValue)}function u(i){v("update:modelValue",i.target.checked)}return t.onMounted(()=>{h()}),(i,p)=>(t.openBlock(),t.createElementBlock("input",{ref_key:"switchCustom",ref:$,id:"toggle",class:"toggle",type:"checkbox",role:"switch",name:"toggle",onInput:u},null,544))}},cA=t2(z$e,[["__scopeId","data-v-e3a6ae4e"]]),V$e={class:"corners"},P$e={class:"corners-type"},A$e={class:"selected-item"},R$e={class:"available-item"},U$e={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},F$e={class:"advanced-filters-menu"},I$e={class:"toggle-group"},q$e={class:"toggle-group"},j$e={key:0,class:"time-control"},D$e={class:"stepper-container"},W$e={class:"stepper"},K$e={class:"stepper-value"},B$e={class:"time-control"},X$e={class:"stepper-container"},G$e={class:"stepper"},Z$e={class:"stepper-value"},J$e={class:"time-control"},H$e={class:"stepper-container"},Y$e={class:"stepper"},Q$e={class:"stepper-value"},$$e={class:"corners__how-many-games"},eet={class:"selected-item"},tet={class:"available-item"},ret={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},net={__name:"FilterCorners",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:r}){var n;const v=Array.from({length:10}).map((P,V)=>({id:V+1,name:`${V+1} ${V===0?"corner":"corners"}`,value:V+1})),$=e,h=r,u=t.ref([...v]),i=t.ref(u.value[0]),p=t.ref(l()),c=t.ref({backgroundColor:"#2e3b46",width:"96.2%",borderColor:"rgba(255, 255, 255, 0.20)",infoBorderColor:"rgba(255, 255, 255, 0.20)",height:"40px",padding:"0 4px",textFontFamily:"'Poppins-Regular'",showIcon:!1}),a=t.ref({label:"Equipo",options:$.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]}),k=t.ref(!1),T=t.ref($.defaultFilters?$.defaultFilters.isAgainstMode:!1),x=t.ref($.defaultFilters?null:(n=a.value)==null?void 0:n.options[0]),d=t.computed(()=>({...lA}));t.watch(()=>$.viewConfig,P=>{P.filters&&(a.value||s())},{immediate:!0});const o=t.computed(()=>({isAgainstMode:T.value,selectedTeam:x.value,howManyCorners:i.value?i.value.value:null,advancedFilters:{...p.value}}));t.watch(()=>o.value,P=>{h("change",{filters:{...P,advancedFilters:{...P.advancedFilters,areConnectionsVisible:!P.advancedFilters.areConnectionsVisible,arePathsVisible:!P.advancedFilters.arePathsVisible}},view:$.viewConfig})},{deep:!0,immediate:!0});function l(){return{areConnectionsVisible:!0,arePathsVisible:!0,secondsBefore:-1,secondsAfter:0,secondsBeforeAndAfter:0}}function s(){if($.viewConfig&&$.viewConfig.filters){const P=$.viewConfig.filters.find(V=>V.key==="teamRadios");if(P){a.value={options:P.options};return}}a.value={label:"Equipo",options:$.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]}}function f(){$.defaultFilters&&(x.value=a.value.options.find(P=>P.value===($.defaultFilters.isHomeTeam?1:2))||a.value.options[0],p.value={...$.defaultFilters.advancedFilters,areConnectionsVisible:!$.defaultFilters.advancedFilters.areConnectionsVisible,arePathsVisible:!$.defaultFilters.advancedFilters.arePathsVisible})}function g(P){x.value=P}function S(P){i.value=P}function L(P,V){const I=p.value[V]+P;if(!(I<-5||I>10)){if(["secondsBefore","secondsAfter"].includes(V)){if(V==="secondsBefore"){if(p.value.secondsAfter<I)return}else if(p.value.secondsBefore>I)return}p.value[V]=I}}function E(){k.value=!1}return t.onBeforeUnmount(()=>{}),t.onMounted(()=>{setTimeout(()=>{f()},500)}),(P,V)=>(t.openBlock(),t.createElementBlock("div",V$e,[t.withDirectives(t.createElementVNode("div",P$e,[t.createElementVNode("div",{class:t.normalizeClass(["label",{"switch-selected":!T.value}])}," A favor ",2),t.createVNode(cA,{modelValue:T.value,"onUpdate:modelValue":V[0]||(V[0]=I=>T.value=I)},null,8,["modelValue"]),t.createElementVNode("div",{class:t.normalizeClass(["label",{"switch-selected":T.value}])}," En contra ",2)],512),[[t.vShow,!e.isPostMatch]]),t.createVNode(t.unref($k),t.mergeProps(d.value,{items:a.value.options,"model-value":x.value,"onUpdate:modelValue":g}),{default:t.withCtx(()=>[t.createElementVNode("div",A$e,[V[10]||(V[10]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.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"}),t.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)),t.createElementVNode("div",null,t.toDisplayString(x.value?x.value.label:a.value.label),1)])]),availableItem:t.withCtx(({item:I})=>[t.createElementVNode("div",R$e,[t.createElementVNode("div",null,t.toDisplayString(I.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",U$e,[...V[11]||(V[11]=[t.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)),[[t.vShow,x.value&&x.value.label===I.label]])])])]),_:1},16,["items","model-value"]),t.createVNode(t.unref(r$e),{modelValue:k.value,"onUpdate:modelValue":V[9]||(V[9]=I=>k.value=I),width:"250px","left-menu":"0","menu-margin-top":18},{trigger:t.withCtx(()=>[t.createVNode(C$e,t.mergeProps(c.value,{text:"Filtros avanzados","show-badge-on-filter-full":!1,"filters-total":0,"is-active":k.value,"show-icon":!0,"icon-type":t.unref(Kb).CORNERS_ADVANCED}),null,16,["is-active","icon-type"])]),menu:t.withCtx(()=>[t.createElementVNode("div",F$e,[V[22]||(V[22]=t.createElementVNode("h2",{class:"menu-title"},"Mostrar Conexiones",-1)),t.createElementVNode("div",I$e,[V[12]||(V[12]=t.createElementVNode("label",{class:"toggle-label"},"Sí",-1)),t.createVNode(cA,{modelValue:p.value.areConnectionsVisible,"onUpdate:modelValue":V[1]||(V[1]=I=>p.value.areConnectionsVisible=I)},null,8,["modelValue"]),V[13]||(V[13]=t.createElementVNode("label",{class:"toggle-label"},"No",-1))]),V[23]||(V[23]=t.createElementVNode("hr",{class:"separator"},null,-1)),V[24]||(V[24]=t.createElementVNode("h2",{class:"menu-title"},"Mostrar recorridos",-1)),t.createElementVNode("div",q$e,[V[14]||(V[14]=t.createElementVNode("label",{class:"toggle-label"},"Sí",-1)),t.createVNode(cA,{modelValue:p.value.arePathsVisible,"onUpdate:modelValue":V[2]||(V[2]=I=>p.value.arePathsVisible=I)},null,8,["modelValue"]),V[15]||(V[15]=t.createElementVNode("label",{class:"toggle-label"},"No",-1))]),p.value.arePathsVisible?(t.openBlock(),t.createElementBlock("div",j$e,[V[17]||(V[17]=t.createElementVNode("label",{class:"time-label"},[t.createTextVNode(" Segundos "),t.createElementVNode("span",{class:"highlight"},"antes"),t.createTextVNode(" / "),t.createElementVNode("span",{class:"highlight"},"después"),t.createTextVNode(" del cobro: ")],-1)),t.createElementVNode("div",D$e,[t.createElementVNode("div",W$e,[t.createElementVNode("button",{class:"stepper-btn",onClick:V[3]||(V[3]=I=>L(-1,"secondsBeforeAndAfter"))},"−"),t.createElementVNode("span",K$e,t.toDisplayString(p.value.secondsBeforeAndAfter),1),t.createElementVNode("button",{class:"stepper-btn",onClick:V[4]||(V[4]=I=>L(1,"secondsBeforeAndAfter"))},"+")]),V[16]||(V[16]=t.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("div",B$e,[V[19]||(V[19]=t.createElementVNode("label",{class:"time-label"},[t.createTextVNode(" Segundos "),t.createElementVNode("span",{class:"highlight"},"antes"),t.createTextVNode(" del cobro: ")],-1)),t.createElementVNode("div",X$e,[t.createElementVNode("div",G$e,[t.createElementVNode("button",{class:"stepper-btn",onClick:V[5]||(V[5]=I=>L(-1,"secondsBefore"))},"−"),t.createElementVNode("span",Z$e,t.toDisplayString(p.value.secondsBefore),1),t.createElementVNode("button",{class:"stepper-btn",onClick:V[6]||(V[6]=I=>L(1,"secondsBefore"))},"+")]),V[18]||(V[18]=t.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])]),t.createElementVNode("div",J$e,[V[21]||(V[21]=t.createElementVNode("label",{class:"time-label"},[t.createTextVNode(" Segundos "),t.createElementVNode("span",{class:"highlight"},"después"),t.createTextVNode(" del cobro: ")],-1)),t.createElementVNode("div",H$e,[t.createElementVNode("div",Y$e,[t.createElementVNode("button",{class:"stepper-btn",onClick:V[7]||(V[7]=I=>L(-1,"secondsAfter"))},"−"),t.createElementVNode("span",Q$e,t.toDisplayString(p.value.secondsAfter),1),t.createElementVNode("button",{class:"stepper-btn",onClick:V[8]||(V[8]=I=>L(1,"secondsAfter"))},"+")]),V[20]||(V[20]=t.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])])],64)),V[25]||(V[25]=t.createElementVNode("hr",{class:"separator"},null,-1)),t.createElementVNode("button",{class:"btn-ready",onClick:E},"Listo")])]),_:1},8,["modelValue"]),t.withDirectives(t.createElementVNode("div",$$e,[t.createVNode(t.unref($k),t.mergeProps(d.value,{items:u.value,"model-value":i.value,"onUpdate:modelValue":S}),{default:t.withCtx(()=>[t.createElementVNode("div",eet,[V[26]||(V[26]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.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"}),t.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)),t.createElementVNode("div",null,t.toDisplayString(i.value?i.value.name:"Seleccione"),1)])]),availableItem:t.withCtx(({item:I})=>[t.createElementVNode("div",tet,[t.createElementVNode("div",null,t.toDisplayString(I.name),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",ret,[...V[27]||(V[27]=[t.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)),[[t.vShow,i.value&&i.value.name===I.name]])])])]),_:1},16,["items","model-value"])],512),[[t.vShow,!e.defaultFilters]])]))}},aet=t2(net,[["__scopeId","data-v-75e86cac"]]),iet={class:"resultados-filter"},oet={class:"filter-checkboxes"},set=["checked","disabled","onChange"],cet={class:"checkbox-label"},uet={class:"filter-actions"},det={__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","done"],setup(e,{emit:r}){const n=e,v=r,$=[{value:"iba-ganando",label:"Iba ganando"},{value:"iba-perdiendo",label:"Iba perdiendo"},{value:"iba-empatado",label:"Iba empatado"}],h=t.ref([]);t.watch(()=>n.selectedValues,k=>{var T;if(console.log("[ResultadosFilter] Watcher - selectedValues recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:k,filterValue:k==null?void 0:k[n.filterIndex],optionValue:(T=k==null?void 0:k[n.filterIndex])==null?void 0:T[n.optionIndex],isArray:Array.isArray(k),filterValueType:typeof(k==null?void 0:k[n.filterIndex])}),!k||!Array.isArray(k)){h.value.length===0&&(console.log("[ResultadosFilter] No hay valores en props, usando valores por defecto"),h.value=["iba-ganando","iba-perdiendo","iba-empatado"]);return}const x=k[n.filterIndex];if(x&&typeof x=="object"&&!Array.isArray(x))if(x[n.optionIndex]!==void 0){const d=Array.isArray(x[n.optionIndex])?x[n.optionIndex]:[];console.log("[ResultadosFilter] Valores encontrados para sincronizar:",d,"localSelectedValues actual:",h.value);const o=JSON.stringify(h.value.sort()),l=JSON.stringify(d.sort());o!==l?(console.log("[ResultadosFilter] Actualizando localSelectedValues con:",d),h.value=d.length>0?[...d]:[]):console.log("[ResultadosFilter] Los valores ya están sincronizados, no se actualiza");return}else console.log("[ResultadosFilter] filterValue existe pero no tiene optionIndex",n.optionIndex,"filterValue keys:",Object.keys(x));else console.log("[ResultadosFilter] filterValue no es un objeto válido:",x);h.value.length===0&&(console.log("[ResultadosFilter] No se encontraron valores guardados, usando valores por defecto"),h.value=["iba-ganando","iba-perdiendo","iba-empatado"])},{immediate:!0,deep:!0}),t.onMounted(()=>{var k,T,x;console.log("[ResultadosFilter] onMounted - Valores recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:n.selectedValues,filterValue:(k=n.selectedValues)==null?void 0:k[n.filterIndex],optionValue:(x=(T=n.selectedValues)==null?void 0:T[n.filterIndex])==null?void 0:x[n.optionIndex]}),t.nextTick(()=>{if(n.selectedValues&&Array.isArray(n.selectedValues)){const d=n.selectedValues[n.filterIndex];if(d&&typeof d=="object"&&!Array.isArray(d)&&d[n.optionIndex]!==void 0){const o=Array.isArray(d[n.optionIndex])?d[n.optionIndex]:[];if(console.log("[ResultadosFilter] onMounted - Valores encontrados:",o),o.length>0){console.log("[ResultadosFilter] onMounted - Actualizando localSelectedValues con:",o),h.value=[...o];return}}}h.value.length===0&&(console.log("[ResultadosFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),h.value=["iba-ganando","iba-perdiendo","iba-empatado"])})});const u=k=>h.value.includes(k),i=k=>h.value.length===1&&h.value.includes(k),p=(k,T)=>{let x=[...h.value];if(T)x.includes(k)||x.push(k);else{if(x.length===1)return;x=x.filter(d=>d!==k)}x.length===0&&(x=[$[0].value]),h.value=x,v("update-selection",{optionIndex:n.optionIndex,values:x})},c=()=>{const k=$.map(T=>T.value);h.value=[...k],v("update-selection",{optionIndex:n.optionIndex,values:[...k]})},a=()=>{v("done")};return(k,T)=>(t.openBlock(),t.createElementBlock("div",iet,[t.createElementVNode("div",oet,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList($,x=>t.createElementVNode("label",{key:x.value,class:"checkbox-item"},[t.createElementVNode("input",{type:"checkbox",checked:u(x.value),disabled:i(x.value),onChange:t.withModifiers(d=>p(x.value,d.target.checked),["stop"])},null,40,set),t.createElementVNode("span",cet,t.toDisplayString(x.label),1)])),64))]),t.createElementVNode("div",uet,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(c,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(a,["stop"])}," Listo ")])]))}},SM=t2(det,[["__scopeId","data-v-6b648e3f"]]),pet={class:"detalles-filter"},het={class:"filter-header"},fet={class:"checkbox-todos"},met=["checked"],yet={class:"time-section"},get={class:"time-buttons"},vet=["onClick"],bet={class:"time-section"},xet={class:"time-buttons"},_et=["onClick"],wet={class:"filter-actions"},Tet={__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","done"],setup(e,{emit:r}){const n=e,v=r,$=[{value:"0-15",label:"0-15"},{value:"16-30",label:"16-30"},{value:"31-45",label:"31-45"}],h=[{value:"46-60",label:"46-60"},{value:"61-75",label:"61-75"},{value:"76-90",label:"76-90"}],u=[...$,...h].map(d=>d.value),i=t.ref([]);t.watch(()=>n.selectedValues,d=>{var o;if(console.log("[DetallesFilter] Watcher - selectedValues recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:d,filterValue:d==null?void 0:d[n.filterIndex],optionValue:(o=d==null?void 0:d[n.filterIndex])==null?void 0:o[n.optionIndex]}),!d||!Array.isArray(d))return;const l=d[n.filterIndex];if(l&&typeof l=="object"&&!Array.isArray(l)&&l[n.optionIndex]!==void 0){const s=Array.isArray(l[n.optionIndex])?l[n.optionIndex]:[];if(console.log("[DetallesFilter] Valores encontrados para sincronizar:",s),s.length>0){const f=JSON.stringify(i.value.sort()),g=JSON.stringify(s.sort());f!==g&&(console.log("[DetallesFilter] Actualizando localSelectedValues con:",s),i.value=[...s])}}},{immediate:!0,deep:!0});const p=t.computed(()=>[...$,...h].map(d=>d.value).every(d=>i.value.includes(d)));t.onMounted(()=>{var d,o,l;console.log("[DetallesFilter] onMounted - Valores recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:n.selectedValues,filterValue:(d=n.selectedValues)==null?void 0:d[n.filterIndex],optionValue:(l=(o=n.selectedValues)==null?void 0:o[n.filterIndex])==null?void 0:l[n.optionIndex]}),t.nextTick(()=>{if(n.selectedValues&&Array.isArray(n.selectedValues)){const s=n.selectedValues[n.filterIndex];if(s&&typeof s=="object"&&!Array.isArray(s)&&s[n.optionIndex]!==void 0){const f=Array.isArray(s[n.optionIndex])?s[n.optionIndex]:[];if(console.log("[DetallesFilter] onMounted - Valores encontrados:",f),f.length>0){console.log("[DetallesFilter] onMounted - Actualizando localSelectedValues con:",f),i.value=[...f];return}}}i.value.length===0&&(console.log("[DetallesFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),i.value=[...u])})});const c=d=>i.value.includes(d),a=d=>{const o=d.target.checked;let l=[];o?l=[...$,...h].map(s=>s.value):l=[u[0]],i.value=l,v("update-selection",{optionIndex:n.optionIndex,values:l})},k=d=>{let o=[...i.value];if(o.includes(d))if(o.length>1)o=o.filter(l=>l!==d);else return;else o.includes(d)||o.push(d);o.length===0&&(o=[u[0]]),i.value=o,v("update-selection",{optionIndex:n.optionIndex,values:o})},T=()=>{const d=[u[0]];i.value=d,v("update-selection",{optionIndex:n.optionIndex,values:d})},x=()=>{v("done")};return(d,o)=>(t.openBlock(),t.createElementBlock("div",pet,[t.createElementVNode("div",het,[o[1]||(o[1]=t.createElementVNode("span",{class:"filter-title"},"En: (Elige el lapso de tiempo)",-1)),t.createElementVNode("label",fet,[t.createElementVNode("input",{type:"checkbox",checked:p.value,onChange:t.withModifiers(a,["stop"])},null,40,met),o[0]||(o[0]=t.createElementVNode("span",{class:"checkbox-label"},"Todos",-1))])]),t.createElementVNode("div",yet,[o[2]||(o[2]=t.createElementVNode("div",{class:"time-label"},"1er tiempo",-1)),t.createElementVNode("div",get,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList($,l=>t.createElementVNode("button",{key:l.value,class:t.normalizeClass(["time-button",{active:c(l.value)}]),onClick:t.withModifiers(s=>k(l.value),["stop"])},t.toDisplayString(l.label),11,vet)),64))])]),t.createElementVNode("div",bet,[o[3]||(o[3]=t.createElementVNode("div",{class:"time-label"},"2do tiempo",-1)),t.createElementVNode("div",xet,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(h,l=>t.createElementVNode("button",{key:l.value,class:t.normalizeClass(["time-button",{active:c(l.value)}]),onClick:t.withModifiers(s=>k(l.value),["stop"])},t.toDisplayString(l.label),11,_et)),64))])]),t.createElementVNode("div",wet,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(T,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(x,["stop"])}," Listo ")])]))}},uA=t2(Tet,[["__scopeId","data-v-7bea3520"]]),ket={class:"como-fue-cobrado-filter"},Let={class:"cobro-grid"},Net=["onClick"],Oet={class:"cobro-image-container"},Met=["src","alt"],Eet={class:"cobro-footer"},Cet={class:"cobro-label"},zet={class:"filter-actions"},Vet={__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","done"],setup(e,{emit:r}){const n=e,v=r,$=[{value:"comba-afuera",label:"Comba hacia afuera",image:"https://golstatsimages.blob.core.windows.net/content/comba-afuera-izquierda.png",count:10},{value:"comba-adentro",label:"Comba hacia adentro",image:"https://golstatsimages.blob.core.windows.net/content/comba-adentro-izquierda.png",count:2},{value:"raz-area",label:"Raz de área",image:"https://golstatsimages.blob.core.windows.net/content/raz-area-izquierda.png",count:0},{value:"en-corto",label:"En corto",image:"https://golstatsimages.blob.core.windows.net/content/en-corto-izquierda.png",count:1}],h=t.ref([]);t.watch(()=>n.selectedValues,a=>{var k;if(console.log("[ComoFueCobradoFilter] Watcher - selectedValues recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:a,filterValue:a==null?void 0:a[n.filterIndex],optionValue:(k=a==null?void 0:a[n.filterIndex])==null?void 0:k[n.optionIndex]}),!a||!Array.isArray(a)){h.value.length===0&&(h.value=[...$.map(x=>x.value)]);return}const T=a[n.filterIndex];if(T&&typeof T=="object"&&!Array.isArray(T)&&T[n.optionIndex]!==void 0){const x=Array.isArray(T[n.optionIndex])?T[n.optionIndex]:[];console.log("[ComoFueCobradoFilter] Valores encontrados para sincronizar:",x);const d=JSON.stringify(h.value.sort()),o=JSON.stringify(x.sort());d!==o&&(h.value=x.length>0?[...x]:[]);return}h.value.length===0&&(h.value=[...$.map(x=>x.value)])},{immediate:!0,deep:!0});const u=a=>h.value.includes(a),i=a=>{let k=[...h.value];k.includes(a)?k=k.filter(T=>T!==a):k.push(a),k.length===0&&(k=[...$.map(T=>T.value)]),h.value=k,v("update-selection",{optionIndex:n.optionIndex,values:k})};t.onMounted(()=>{var a,k,T;console.log("[ComoFueCobradoFilter] onMounted - Valores recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:n.selectedValues,filterValue:(a=n.selectedValues)==null?void 0:a[n.filterIndex],optionValue:(T=(k=n.selectedValues)==null?void 0:k[n.filterIndex])==null?void 0:T[n.optionIndex]}),t.nextTick(()=>{if(n.selectedValues&&Array.isArray(n.selectedValues)){const x=n.selectedValues[n.filterIndex];if(x&&typeof x=="object"&&!Array.isArray(x)&&x[n.optionIndex]!==void 0){const d=Array.isArray(x[n.optionIndex])?x[n.optionIndex]:[];if(console.log("[ComoFueCobradoFilter] onMounted - Valores encontrados:",d),d.length>0){console.log("[ComoFueCobradoFilter] onMounted - Actualizando localSelectedValues con:",d),h.value=[...d];return}}}h.value.length===0&&(console.log("[ComoFueCobradoFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),h.value=["izquierda",...$.map(x=>x.value)])})});const p=()=>{const a=[...$.map(k=>k.value)];h.value=a,v("update-selection",{optionIndex:n.optionIndex,values:a})},c=()=>{v("done")};return(a,k)=>(t.openBlock(),t.createElementBlock("div",ket,[t.createElementVNode("div",Let,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList($,T=>t.createElementVNode("div",{key:T.value,class:t.normalizeClass(["cobro-item",{active:u(T.value)}]),onClick:t.withModifiers(x=>i(T.value),["stop"])},[t.createElementVNode("div",Oet,[t.createElementVNode("img",{src:T.image,alt:T.label,class:"cobro-image"},null,8,Met)]),t.createElementVNode("div",Eet,[t.createElementVNode("span",Cet,t.toDisplayString(T.label),1)])],10,Net)),64))]),t.createElementVNode("div",zet,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(p,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(c,["stop"])}," Listo ")])]))}},kM=t2(Vet,[["__scopeId","data-v-fb6f9ab9"]]),Pet={class:"zona-filter"},Aet={class:"template-zone"},Ret={class:"controls-zone-container"},Uet={class:"controls-zone-container-title-checkcon"},Fet={class:"controls-zone-container-title-checkcon-check"},Iet={class:"gsc-field-img-container"},qet=["fill"],jet=["fill"],Det=["fill"],Wet=["fill"],Ket=["fill"],Bet=["fill"],Xet=["fill"],Get=["fill"],Zet=["fill"],Jet=["fill"],Het=["fill"],Yet=["fill"],Qet=["fill"],$et=["fill"],ett=["fill"],ttt=["fill"],rtt=["fill"],ntt=["fill"],att=["fill"],itt=["fill"],ott=["fill"],stt=["fill"],ltt=["fill"],ctt=["fill"],utt=["fill"],dtt=["fill"],ptt=["fill"],htt=["fill"],ftt=["fill"],mtt=["fill"],ytt=["fill"],gtt=["fill"],vtt=["fill"],btt=["fill"],xtt=["fill"],_tt=["id"],wtt=["mask"],Ttt={class:"filter-actions"},Stt={__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","done"],setup(e,{emit:r}){const n=e,v=r,$=Array.from({length:35},(x,d)=>d+1),h=t.ref(!0),u=t.ref([]),i=t.computed(()=>u.value),p=t.computed(()=>new Date().getTime());t.watch(()=>n.selectedValues,x=>{var d;if(console.log("[ZonaFilter] Watcher - selectedValues recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:x,filterValue:x==null?void 0:x[n.filterIndex],optionValue:(d=x==null?void 0:x[n.filterIndex])==null?void 0:d[n.optionIndex]}),!x||!Array.isArray(x)){u.value.length===0&&(console.log("[ZonaFilter] No hay valores en props, usando valores por defecto"),u.value=[...$],h.value=!0);return}const o=x[n.filterIndex];if(o&&typeof o=="object"&&!Array.isArray(o)){if(o[n.optionIndex]!==void 0){const l=Array.isArray(o[n.optionIndex])?o[n.optionIndex]:[];console.log("[ZonaFilter] Valores encontrados para sincronizar:",l);const s=JSON.stringify(u.value.sort((g,S)=>g-S)),f=JSON.stringify(l.sort((g,S)=>g-S));s!==f&&(console.log("[ZonaFilter] Actualizando zonesLocal con:",l),u.value=l.length>0?[...l]:[],h.value=l.length===35);return}}else if(Array.isArray(o)&&o.length>0){console.log("[ZonaFilter] filterValue es array directo:",o);const l=JSON.stringify(u.value.sort((f,g)=>f-g)),s=JSON.stringify(o.sort((f,g)=>f-g));l!==s&&(console.log("[ZonaFilter] Actualizando zonesLocal con array directo:",o),u.value=[...o],h.value=o.length===35);return}u.value.length===0&&(console.log("[ZonaFilter] No se encontraron valores guardados, usando valores por defecto"),u.value=[...$],h.value=!0)},{immediate:!0,deep:!0}),t.watch(u,x=>{h.value=x.length===35,v("update-selection",{optionIndex:n.optionIndex,values:x})},{deep:!0});function c(x){console.log("value clickAllCheckbox: ",x),x?(u.value=[...$],h.value=!0):(u.value=[1],h.value=!1)}function a(x){u.value.includes(x)?u.value=u.value.filter(d=>d!==x):u.value.push(x),h.value=u.value.length===35}const k=()=>{u.value=[...$],h.value=!0},T=()=>{v("done")};return t.onMounted(()=>{var x,d,o;if(console.log("[ZonaFilter] onMounted - Valores recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:n.selectedValues,filterValue:(x=n.selectedValues)==null?void 0:x[n.filterIndex],optionValue:(o=(d=n.selectedValues)==null?void 0:d[n.filterIndex])==null?void 0:o[n.optionIndex]}),n.selectedValues&&Array.isArray(n.selectedValues)){const l=n.selectedValues[n.filterIndex];if(l&&typeof l=="object"&&!Array.isArray(l)&&l[n.optionIndex]!==void 0){const s=Array.isArray(l[n.optionIndex])?l[n.optionIndex]:[];if(console.log("[ZonaFilter] onMounted - Valores encontrados:",s),s.length>0){console.log("[ZonaFilter] onMounted - Actualizando zonesLocal con:",s),u.value=[...s],h.value=s.length===35;return}}}u.value.length===0&&(console.log("[ZonaFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),u.value=[...$],h.value=!0)}),(x,d)=>(t.openBlock(),t.createElementBlock("div",Pet,[t.createElementVNode("div",Aet,[t.createElementVNode("div",Ret,[d[36]||(d[36]=t.createElementVNode("div",{class:"controls-zone-container-title"}," ¿A dónde fue el balón?: ",-1)),d[37]||(d[37]=t.createElementVNode("div",{class:"separator-line"},null,-1)),t.createElementVNode("div",Uet,[d[35]||(d[35]=t.createElementVNode("div",{class:"controls-zone-container-title-checkcon-label"}," Todas las zonas ",-1)),t.createElementVNode("div",Fet,[t.createVNode(t.unref(oA),{label:"",fontFamily:"Poppins-Regular",labelFontSize:"11px","label-color":"#FFF","model-value":h.value,"onUpdate:modelValue":c},null,8,["model-value"])])])]),t.createElementVNode("div",Iet,[(t.openBlock(),t.createElementBlock("svg",{key:`field-${u.value.length}`,width:"100%",height:"177",viewBox:"0 0 380 177",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{onClick:d[0]||(d[0]=o=>a(1)),class:"sector-field",x:"0.347042",y:"0.347042",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:i.value.includes(1)?"#FFFF0030":"#2e3b46"},null,8,qet),t.createElementVNode("rect",{onClick:d[1]||(d[1]=o=>a(9)),class:"sector-field",x:"288.347",y:"0.347042",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(9)?"#FFFF0030":"#2e3b46"},null,8,jet),t.createElementVNode("rect",{onClick:d[2]||(d[2]=o=>a(17)),class:"sector-field",x:"0.347042",y:"44.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(17)?"#FFFF0030":"#2e3b46"},null,8,Det),t.createElementVNode("rect",{onClick:d[3]||(d[3]=o=>a(25)),class:"sector-field",x:"288.347",y:"44.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(25)?"#FFFF0030":"#2e3b46"},null,8,Wet),t.createElementVNode("rect",{onClick:d[4]||(d[4]=o=>a(26)),class:"sector-field",x:"0.347042",y:"88.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(26)?"#FFFF0030":"#2e3b46"},null,8,Ket),t.createElementVNode("rect",{onClick:d[5]||(d[5]=o=>a(27)),class:"sector-field",x:"91.347",y:"88.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(27)?"#FFFF0030":"#2e3b46"},null,8,Bet),t.createElementVNode("rect",{onClick:d[6]||(d[6]=o=>a(28)),class:"sector-field",x:"157.015",y:"88.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(28)?"#FFFF0030":"#2e3b46"},null,8,Xet),t.createElementVNode("rect",{onClick:d[7]||(d[7]=o=>a(29)),class:"sector-field",x:"222.679",y:"88.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(29)?"#FFFF0030":"#2e3b46"},null,8,Get),t.createElementVNode("rect",{onClick:d[8]||(d[8]=o=>a(30)),class:"sector-field",x:"288.347",y:"88.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(30)?"#FFFF0030":"#2e3b46"},null,8,Zet),t.createElementVNode("rect",{onClick:d[9]||(d[9]=o=>a(31)),class:"sector-field",x:"0.347042",y:"132.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(31)?"#FFFF0030":"#2e3b46"},null,8,Jet),t.createElementVNode("rect",{onClick:d[10]||(d[10]=o=>a(32)),class:"sector-field",x:"91.347",y:"132.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(32)?"#FFFF0030":"#2e3b46"},null,8,Het),t.createElementVNode("rect",{onClick:d[11]||(d[11]=o=>a(33)),class:"sector-field",x:"157.015",y:"132.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(33)?"#FFFF0030":"#2e3b46"},null,8,Yet),t.createElementVNode("rect",{onClick:d[12]||(d[12]=o=>a(34)),class:"sector-field",x:"222.679",y:"132.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(34)?"#FFFF0030":"#2e3b46"},null,8,Qet),t.createElementVNode("rect",{onClick:d[13]||(d[13]=o=>a(35)),class:"sector-field",x:"288.347",y:"132.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(35)?"#FFFF0030":"#2e3b46"},null,8,$et),t.createElementVNode("rect",{onClick:d[14]||(d[14]=o=>a(2)),class:"sector-field",x:"91.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(2)?"#FFFF0030":"#2e3b46"},null,8,ett),t.createElementVNode("rect",{onClick:d[15]||(d[15]=o=>a(3)),class:"sector-field",x:"114.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(3)?"#FFFF0030":"#2e3b46"},null,8,ttt),t.createElementVNode("rect",{onClick:d[16]||(d[16]=o=>a(4)),class:"sector-field",x:"137.347",y:"0.347042",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(4)?"#FFFF0030":"#2e3b46"},null,8,rtt),t.createElementVNode("rect",{onClick:d[17]||(d[17]=o=>a(5)),class:"sector-field",x:"172.347",y:"0.347042",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(5)?"#FFFF0030":"#2e3b46"},null,8,ntt),t.createElementVNode("rect",{onClick:d[18]||(d[18]=o=>a(6)),class:"sector-field",x:"207.347",y:"0.347042",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(6)?"#FFFF0030":"#2e3b46"},null,8,att),t.createElementVNode("rect",{onClick:d[19]||(d[19]=o=>a(7)),class:"sector-field",x:"242.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(7)?"#FFFF0030":"#2e3b46"},null,8,itt),t.createElementVNode("rect",{onClick:d[20]||(d[20]=o=>a(8)),class:"sector-field",x:"265.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(8)?"#FFFF0030":"#2e3b46"},null,8,ott),t.createElementVNode("rect",{onClick:d[21]||(d[21]=o=>a(10)),class:"sector-field",x:"91.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(10)?"#FFFF0030":"#2e3b46"},null,8,stt),t.createElementVNode("rect",{onClick:d[22]||(d[22]=o=>a(11)),class:"sector-field",x:"114.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(11)?"#FFFF0030":"#2e3b46"},null,8,ltt),t.createElementVNode("rect",{onClick:d[23]||(d[23]=o=>a(12)),class:"sector-field",x:"137.347",y:"29.6804",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(12)?"#FFFF0030":"#2e3b46"},null,8,ctt),t.createElementVNode("rect",{onClick:d[24]||(d[24]=o=>a(13)),class:"sector-field",x:"172.347",y:"29.6804",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(13)?"#FFFF0030":"#2e3b46"},null,8,utt),t.createElementVNode("rect",{onClick:d[25]||(d[25]=o=>a(14)),class:"sector-field",x:"207.347",y:"29.6804",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(14)?"#FFFF0030":"#2e3b46"},null,8,dtt),t.createElementVNode("rect",{onClick:d[26]||(d[26]=o=>a(15)),class:"sector-field",x:"242.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(15)?"#FFFF0030":"#2e3b46"},null,8,ptt),t.createElementVNode("rect",{onClick:d[27]||(d[27]=o=>a(16)),class:"sector-field",x:"265.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(16)?"#FFFF0030":"#2e3b46"},null,8,htt),t.createElementVNode("rect",{onClick:d[28]||(d[28]=o=>a(18)),class:"sector-field",x:"91.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(18)?"#FFFF0030":"#2e3b46"},null,8,ftt),t.createElementVNode("rect",{onClick:d[29]||(d[29]=o=>a(19)),class:"sector-field",x:"114.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(19)?"#FFFF0030":"#2e3b46"},null,8,mtt),t.createElementVNode("rect",{onClick:d[30]||(d[30]=o=>a(20)),class:"sector-field",x:"137.347",y:"59.0137",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(20)?"#FFFF0030":"#2e3b46"},null,8,ytt),t.createElementVNode("rect",{onClick:d[31]||(d[31]=o=>a(21)),class:"sector-field",x:"172.347",y:"59.0137",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(21)?"#FFFF0030":"#2e3b46"},null,8,gtt),t.createElementVNode("rect",{onClick:d[32]||(d[32]=o=>a(22)),class:"sector-field",x:"207.347",y:"59.0137",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(22)?"#FFFF0030":"#2e3b46"},null,8,vtt),t.createElementVNode("rect",{onClick:d[33]||(d[33]=o=>a(23)),class:"sector-field",x:"242.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(23)?"#FFFF0030":"#2e3b46"},null,8,btt),t.createElementVNode("rect",{onClick:d[34]||(d[34]=o=>a(24)),class:"sector-field",x:"265.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(24)?"#FFFF0030":"#2e3b46"},null,8,xtt),d[40]||(d[40]=t.createElementVNode("rect",{x:"91.6",y:"0.6",width:"196.8",height:"87.8",stroke:"#DFE3E2","stroke-width":"1.2"},null,-1)),d[41]||(d[41]=t.createElementVNode("rect",{x:"137.6",y:"0.782404",width:"104.8",height:"28.8",stroke:"#DFE3E2","stroke-width":"1.2"},null,-1)),t.createElementVNode("mask",{id:p.value,style:{"mask-type":"alpha"},maskUnits:"userSpaceOnUse",x:"91",y:"88",width:"198",height:"25"},[...d[38]||(d[38]=[t.createElementVNode("rect",{width:"197.746",height:"24.6043",transform:"matrix(1 0 0 -1 91 113)",fill:"#D9D9D9"},null,-1)])],8,_tt),t.createElementVNode("g",{mask:`url(#${p.value})`},[...d[39]||(d[39]=[t.createElementVNode("circle",{cx:"185.329",cy:"56.5046",r:"52.6152",stroke:"#DFE3E2","stroke-width":"1.38817"},null,-1)])],8,wtt),d[42]||(d[42]=t.createElementVNode("circle",{cx:"190.278",cy:"66.2782",r:"2.27817",fill:"white"},null,-1)),d[43]||(d[43]=t.createElementVNode("rect",{x:"0.7",y:"0.7",width:"378.6",height:"175.6",stroke:"#DFE3E2","stroke-width":"1.4"},null,-1))]))])]),t.createElementVNode("div",Ttt,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(k,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(T,["stop"])}," Listo ")])]))}},dA=t2(Stt,[["__scopeId","data-v-203bc904"]]),ktt={class:"que-sucedio-filter"},Ltt={class:"filter-header"},Ntt={class:"checkbox-item todos-header"},Ott=["checked"],Mtt={class:"filter-section"},Ett={class:"checkbox-item main-option"},Ctt=["checked"],ztt={class:"sub-options"},Vtt={class:"checkbox-item sub-option"},Ptt=["checked"],Att={class:"checkbox-item sub-option"},Rtt=["checked"],Utt={class:"filter-section"},Ftt={class:"checkbox-item main-option"},Itt=["checked"],qtt={class:"sub-options"},jtt={class:"checkbox-item sub-option"},Dtt=["checked"],Wtt={class:"checkbox-item sub-option"},Ktt=["checked"],Btt={class:"checkbox-item sub-option"},Xtt=["checked"],Gtt={class:"filter-actions"},Ztt={__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","done"],setup(e,{emit:r}){const n=e,v=r,$=["rematado-destino-porteria","fue-gol","no-fue-gol","rematado-sin-destino-porteria","ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"],h={"rematado-destino-porteria":["fue-gol","no-fue-gol"],"rematado-sin-destino-porteria":["ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"]},u=t.ref([]);t.watch(()=>n.selectedValues,d=>{if(!d||!Array.isArray(d))return;const o=d[n.filterIndex];if(o&&typeof o=="object"&&!Array.isArray(o)&&o[n.optionIndex]!==void 0){const l=Array.isArray(o[n.optionIndex])?o[n.optionIndex]:[];if(l.length>0){const s=JSON.stringify(u.value.sort()),f=JSON.stringify(l.sort());s!==f&&(u.value=[...l])}}},{immediate:!0,deep:!0}),t.onMounted(()=>{t.nextTick(()=>{if(n.selectedValues&&Array.isArray(n.selectedValues)){const d=n.selectedValues[n.filterIndex];if(d&&typeof d=="object"&&!Array.isArray(d)&&d[n.optionIndex]!==void 0){const o=Array.isArray(d[n.optionIndex])?d[n.optionIndex]:[];if(o.length>0){u.value=[...o];return}}}u.value.length===0&&(u.value=[...$])})});const i=t.computed(()=>$.every(d=>u.value.includes(d))),p=d=>u.value.includes(d),c=d=>{d.target.checked?u.value=[...$]:u.value=[],v("update-selection",{optionIndex:n.optionIndex,values:[...u.value]})},a=(d,o)=>{let l=[...u.value];const s=h[d]||[];o?(l.includes(d)||l.push(d),s.forEach(f=>{l.includes(f)||l.push(f)})):l=l.filter(f=>f!==d&&!s.includes(f)),u.value=l,v("update-selection",{optionIndex:n.optionIndex,values:l})},k=(d,o)=>{let l=[...u.value];const s=Object.keys(h).find(f=>h[f].includes(d));o?(l.includes(d)||l.push(d),s&&h[s].every(f=>l.includes(f))&&!l.includes(s)&&l.push(s)):(l=l.filter(f=>f!==d),s&&l.includes(s)&&(l=l.filter(f=>f!==s))),u.value=l,v("update-selection",{optionIndex:n.optionIndex,values:l})},T=()=>{u.value=[...$],v("update-selection",{optionIndex:n.optionIndex,values:[...$]})},x=()=>{v("done")};return(d,o)=>(t.openBlock(),t.createElementBlock("div",ktt,[t.createElementVNode("div",Ltt,[t.createElementVNode("label",Ntt,[o[7]||(o[7]=t.createElementVNode("span",{class:"checkbox-label"},"Todos",-1)),t.createElementVNode("input",{type:"checkbox",checked:i.value,onChange:t.withModifiers(c,["stop"])},null,40,Ott)])]),o[15]||(o[15]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",Mtt,[t.createElementVNode("label",Ett,[t.createElementVNode("input",{type:"checkbox",checked:p("rematado-destino-porteria"),onChange:o[0]||(o[0]=t.withModifiers(l=>a("rematado-destino-porteria",l.target.checked),["stop"]))},null,40,Ctt),o[8]||(o[8]=t.createElementVNode("span",{class:"checkbox-label"},"Rematado con destino a portería",-1))]),t.createElementVNode("div",ztt,[t.createElementVNode("label",Vtt,[t.createElementVNode("input",{type:"checkbox",checked:p("fue-gol"),onChange:o[1]||(o[1]=t.withModifiers(l=>k("fue-gol",l.target.checked),["stop"]))},null,40,Ptt),o[9]||(o[9]=t.createElementVNode("span",{class:"checkbox-label"},"Fue gol",-1))]),t.createElementVNode("label",Att,[t.createElementVNode("input",{type:"checkbox",checked:p("no-fue-gol"),onChange:o[2]||(o[2]=t.withModifiers(l=>k("no-fue-gol",l.target.checked),["stop"]))},null,40,Rtt),o[10]||(o[10]=t.createElementVNode("span",{class:"checkbox-label"},"No fue gol",-1))])])]),o[16]||(o[16]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",Utt,[t.createElementVNode("label",Ftt,[t.createElementVNode("input",{type:"checkbox",checked:p("rematado-sin-destino-porteria"),onChange:o[3]||(o[3]=t.withModifiers(l=>a("rematado-sin-destino-porteria",l.target.checked),["stop"]))},null,40,Itt),o[11]||(o[11]=t.createElementVNode("span",{class:"checkbox-label"},"Rematado sin destino a portería",-1))]),t.createElementVNode("div",qtt,[t.createElementVNode("label",jtt,[t.createElementVNode("input",{type:"checkbox",checked:p("ganados-por-portero-rival"),onChange:o[4]||(o[4]=t.withModifiers(l=>k("ganados-por-portero-rival",l.target.checked),["stop"]))},null,40,Dtt),o[12]||(o[12]=t.createElementVNode("span",{class:"checkbox-label"},"Ganados por portero rival",-1))]),t.createElementVNode("label",Wtt,[t.createElementVNode("input",{type:"checkbox",checked:p("ganados-por-jugador-rival"),onChange:o[5]||(o[5]=t.withModifiers(l=>k("ganados-por-jugador-rival",l.target.checked),["stop"]))},null,40,Ktt),o[13]||(o[13]=t.createElementVNode("span",{class:"checkbox-label"},"Ganados por jugador rival",-1))]),t.createElementVNode("label",Btt,[t.createElementVNode("input",{type:"checkbox",checked:p("sin-destino"),onChange:o[6]||(o[6]=t.withModifiers(l=>k("sin-destino",l.target.checked),["stop"]))},null,40,Xtt),o[14]||(o[14]=t.createElementVNode("span",{class:"checkbox-label"},"Sin destino",-1))])])]),t.createElementVNode("div",Gtt,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(T,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(x,["stop"])}," Listo ")])]))}},u9=t2(Ztt,[["__scopeId","data-v-e3994cc8"]]),Jtt={class:"advanced-select-accordion"},Htt=["onClick"],Ytt={class:"accordion-header-left"},Qtt={class:"accordion-icon"},$tt=["src","alt"],ert={class:"accordion-title"},trt={class:"accordion-header-right"},rrt={key:0,class:"accordion-badge"},nrt={key:0,class:"accordion-content"},art={class:"accordion-footer"},irt={__name:"AdvancedSelectAccordion",props:{filter:{type:Object,required:!0},filterIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","close"],setup(e,{emit:r}){const n=e;t.watch(()=>n.selectedValues,x=>{console.log("Acorden inicla 55555555555v [AdvancedSelectAccordion] selectedValues recibidos:",{filterIndex:n.filterIndex,selectedValues:x,filterValue:x==null?void 0:x[n.filterIndex],filterValueType:typeof(x==null?void 0:x[n.filterIndex]),isArray:Array.isArray(x==null?void 0:x[n.filterIndex]),filterValueKeys:x!=null&&x[n.filterIndex]&&typeof(x==null?void 0:x[n.filterIndex])=="object"?Object.keys(x[n.filterIndex]):null})},{immediate:!0,deep:!0});const v=r,$=t.ref({}),h=x=>{$.value[x]?$.value[x]=!1:(Object.keys($.value).forEach(d=>{$.value[d]=!1}),$.value[x]=!0)},u=x=>{const d=n.filter.options[x];if(!d||!d.filters)return 0;const o=n.selectedValues[n.filterIndex];if(!o||!o[x])return 0;const l=o[x];return Array.isArray(l)?l.length:0},i=(x,d)=>x.icon?x.icon:`https://golstatsimages.blob.core.windows.net/todoelfut/f${d+1}.png`,p=x=>x==="Qué sucedió?"||x==="Qué sucedió"?"¿Qué sucedió?":x,c=x=>{const d={resultados:SM,detalles:uA,"como-fue-cobrado":kM,"como fue cobrado":kM,zona:dA,"que-sucedio":u9,"qué sucedió":u9,"que sucedio":u9},o=typeof x.value=="string"?x.value:String(x.value||""),l=typeof x.label=="string"?x.label:String(x.label||""),s=o.toLowerCase().trim(),f=l.toLowerCase().trim();if(s&&d[s])return d[s];if(f&&d[f])return d[f];const g=f.replace(/\s+/g,"-").replace(/[¿?]/g,"").replace(/[áéíóú]/g,S=>({á:"a",é:"e",í:"i",ó:"o",ú:"u"})[S]||S);return g&&d[g]?d[g]:SM},a=x=>{v("update-selection",{filterIndex:n.filterIndex,optionIndex:x.optionIndex,values:x.values})},k=x=>{$.value[x]=!1},T=()=>{v("close")};return(x,d)=>(t.openBlock(),t.createElementBlock("div",Jtt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filter.options,(o,l)=>(t.openBlock(),t.createElementBlock("div",{key:o.value||l,class:"accordion-item"},[t.createElementVNode("div",{class:"accordion-header",onClick:t.withModifiers(s=>h(l),["stop"])},[t.createElementVNode("div",Ytt,[t.createElementVNode("span",Qtt,[t.createElementVNode("img",{src:i(o,l),alt:o.label},null,8,$tt)]),t.createElementVNode("span",ert,t.toDisplayString(p(o.label)),1)]),t.createElementVNode("div",trt,[u(l)>0?(t.openBlock(),t.createElementBlock("span",rrt,t.toDisplayString(u(l)),1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass(["accordion-chevron",{open:$.value[l]}])},[...d[0]||(d[0]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)])],8,Htt),t.createVNode(t.Transition,{name:"accordion"},{default:t.withCtx(()=>[$.value[l]?(t.openBlock(),t.createElementBlock("div",nrt,[c(o)===SM?(t.openBlock(),t.createBlock(SM,{key:0,option:o,"filter-index":e.filterIndex,"option-index":l,"selected-values":e.selectedValues,onUpdateSelection:a,onDone:()=>k(l)},null,8,["option","filter-index","option-index","selected-values","onDone"])):c(o)===uA?(t.openBlock(),t.createBlock(uA,{key:1,option:o,"filter-index":e.filterIndex,"option-index":l,"selected-values":e.selectedValues,onUpdateSelection:a,onDone:()=>k(l)},null,8,["option","filter-index","option-index","selected-values","onDone"])):c(o)===kM?(t.openBlock(),t.createBlock(kM,{key:2,option:o,"filter-index":e.filterIndex,"option-index":l,"selected-values":e.selectedValues,onUpdateSelection:a,onDone:()=>k(l)},null,8,["option","filter-index","option-index","selected-values","onDone"])):c(o)===dA?(t.openBlock(),t.createBlock(dA,{key:3,option:o,"filter-index":e.filterIndex,"option-index":l,"selected-values":e.selectedValues,onUpdateSelection:a,onDone:()=>k(l)},null,8,["option","filter-index","option-index","selected-values","onDone"])):c(o)===u9?(t.openBlock(),t.createBlock(u9,{key:4,option:o,"filter-index":e.filterIndex,"option-index":l,"selected-values":e.selectedValues,onUpdateSelection:a,onDone:()=>k(l)},null,8,["option","filter-index","option-index","selected-values","onDone"])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)]),_:2},1024)]))),128)),t.createElementVNode("div",art,[d[1]||(d[1]=t.createElementVNode("div",{class:"footer-separator"},null,-1)),t.createElementVNode("button",{class:"btn-done-footer",onClick:t.withModifiers(T,["stop"])}," Listo ")])]))}},ort=t2(irt,[["__scopeId","data-v-92b4e8ad"]]),srt={class:"corners-zone-filters"},lrt={key:0,class:"custom-radio-group"},crt={class:"radio-label"},urt={class:"radio-options"},drt=["name","value","onUpdate:modelValue"],prt={key:0,class:"filter-separator"},hrt={class:"filter-inline select-with-label"},frt=["data-filter-type","onClick"],mrt={class:"select-display"},yrt={class:"select-label"},grt={key:0,class:"dropdown-menu type-menu simple-select-menu"},vrt={class:"simple-select-scroll-area"},brt=["onClick"],xrt={class:"option-content"},_rt={class:"option-title"},wrt={key:0,class:"option-checkmark"},Trt={class:"switch-group"},Srt={class:"switch-label"},krt=["onClick"],Lrt={key:0,class:"filter-separator"},Nrt={key:3,class:"filter-inline advanced-select-wrapper"},Ort=["data-filter-type","onClick"],Mrt={class:"select-display"},Ert={class:"select-label"},Crt={__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:r,emit:n}){const v=e,$=n,h=t.ref([]);let u=null;const i=t.ref(null),p=t.ref(null),c=t.ref([]);let a=!1,k=null;const T=(I,j)=>{if(Array.isArray(I)&&Array.isArray(j)){if(I.length!==j.length)return!1;for(let U=0;U<I.length;U++)if(I[U]!==j[U])return!1;return!0}return I===j},x=(I,j=!0)=>{if(v.filters&&v.filters[0]&&v.filters[1]){const U=v.filters[0],D=v.filters[1],F=U.options,z=D.options;F&&Array.isArray(F)&&z?I!=null?F.findIndex(X=>X.value===I)!==-1&&z[I]?(c.value=z[I],j&&!(()=>{const X=h.value[1];return X==null?!1:Array.isArray(X)?X.length>0:X!==""})()&&!a&&c.value.length>0&&(h.value[1]=c.value[0].value,t.nextTick(()=>{}))):(c.value=[],h.value[1]=null):(c.value=[],h.value[1]=null):c.value=[]}},d=()=>{v.initialValues&&v.initialValues.length>0?v.initialValues.length>0&&(typeof v.initialValues[0]=="number"||typeof v.initialValues[0]=="boolean"||v.initialValues[0]===null||Array.isArray(v.initialValues[0]))?h.value=v.filters.map((U,D)=>{var F,z,X,M;const Y=v.initialValues[D];if(Y!=null)return U.type==="switch"&&v.filters.findIndex(se=>se.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor desde initialValues en índice ${D} (formato simple):`,Y),Y;if(U.type==="radio-button")return((z=(F=U.options)==null?void 0:F[0])==null?void 0:z.value)||null;if(U.type==="advanced-select"){const se={};let me=!1;return U.options&&Array.isArray(U.options)&&U.options.forEach((ge,be)=>{var xe,Pe,je,_e,Ue,qe,Re;ge.value==="zona"||(xe=ge.label)!=null&&xe.toLowerCase().includes("zona")?(se[be]=Array.from({length:35},(We,Qe)=>Qe+1),me=!0):ge.value==="resultados"||(Pe=ge.label)!=null&&Pe.toLowerCase().includes("resultados")?(se[be]=["iba-ganando","iba-perdiendo","iba-empatado"],me=!0):ge.value==="que-sucedio"||ge.value==="que sucedio"||(je=ge.label)!=null&&je.toLowerCase().includes("qué sucedió")||(_e=ge.label)!=null&&_e.toLowerCase().includes("que sucedio")?(se[be]=["rematado-destino-porteria","fue-gol","no-fue-gol","rematado-sin-destino-porteria","ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"],me=!0):ge.value==="detalles"||(Ue=ge.label)!=null&&Ue.toLowerCase().includes("detalles")?(se[be]=["0-15","16-30","31-45","46-60","61-75","76-90"],me=!0):(ge.value==="como-fue-cobrado"||ge.value==="como fue cobrado"||(qe=ge.label)!=null&&qe.toLowerCase().includes("cómo fue cobrado")||(Re=ge.label)!=null&&Re.toLowerCase().includes("como fue cobrado"))&&(se[be]=["izquierda","comba-afuera","comba-adentro","raz-area","en-corto"],me=!0)}),me?se:{}}return U.type==="select"?[]:U.type==="check"?!1:U.type==="switch"?(v.filters.findIndex(se=>se.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${D} (formato simple):`,!1),!1):U.type==="select-simple"&&((M=(X=U.options)==null?void 0:X[0])==null?void 0:M.value)||null}):v.isEditMode?h.value=v.filters.map((U,D)=>{var F,z,X,M,Y,se,me,ge,be,xe;const Pe=v.initialValues[D];if(D===3&&console.log(`[CornersZoneFilters] Procesando filtro en índice ${D} (FILTRO AVANZADO):`,{filterType:U.type,filterData:Pe,hasFilterData:!!Pe,filterDataKeys:Pe?Object.keys(Pe):null,selectedValue:Pe==null?void 0:Pe.selectedValue,selectedValueType:typeof(Pe==null?void 0:Pe.selectedValue),isDirectObject:Pe&&typeof Pe=="object"&&!Array.isArray(Pe)&&!Pe.selectedValue&&!Pe.selectedOption&&!Pe.isChecked}),!Pe)return U.type==="select"?[]:U.type==="check"?!1:U.type==="switch"?(v.filters.findIndex(je=>je.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${D} (modo edición):`,!1),!1):U.type==="radio-button"?((z=(F=U.options)==null?void 0:F[0])==null?void 0:z.value)||null:U.type==="select-simple"?((M=(X=U.options)==null?void 0:X[0])==null?void 0:M.value)||null:U.type==="advanced-select"?{}:null;if(U.type==="advanced-select"){if(console.log(`[CornersZoneFilters] Modo edición - Filtro avanzado en índice ${D}:`,{filterIndex:D,filterType:U.type,filterData:Pe,selectedValue:Pe==null?void 0:Pe.selectedValue,selectedValueType:typeof(Pe==null?void 0:Pe.selectedValue),isArray:Array.isArray(Pe==null?void 0:Pe.selectedValue),isDirectObject:typeof Pe=="object"&&!Array.isArray(Pe)&&!Pe.selectedValue&&!Pe.selectedOption&&!Pe.isChecked}),Pe.selectedValue!==void 0&&Pe.selectedValue!==null){if(typeof Pe.selectedValue=="object"&&!Array.isArray(Pe.selectedValue)){const je=Object.keys(Pe.selectedValue).some(_e=>{const Ue=Number(_e);return!isNaN(Ue)&&Ue>=0});return console.log(`[CornersZoneFilters] Filtro avanzado ${D} - hasCorrectStructure:`,je,"selectedValue:",Pe.selectedValue),je&&console.log(`[CornersZoneFilters] Filtro avanzado ${D} - Retornando selectedValue directamente:`,Pe.selectedValue),Pe.selectedValue}else if(Array.isArray(Pe.selectedValue)){const je={};return Pe.selectedValue.forEach((_e,Ue)=>{je[Ue]=_e}),je}}return typeof Pe=="object"&&!Array.isArray(Pe)&&!Pe.selectedValue&&!Pe.selectedOption&&!Pe.isChecked&&Pe!==null&&Object.keys(Pe).some(je=>{const _e=Number(je);return!isNaN(_e)&&_e>=0})?(console.log(`[CornersZoneFilters] Filtro avanzado ${D} - filterData es objeto directo guardado, retornando:`,Pe),Pe):(console.log(`[CornersZoneFilters] Filtro avanzado ${D} - No hay valores guardados, retornando objeto vacío`),{})}return U.type==="radio-button"&&Pe.selectedOption?Pe.selectedOption.value:U.type==="radio-button"&&!Pe.selectedOption?Pe.selectedValue!==void 0?Pe.selectedValue:((se=(Y=U.options)==null?void 0:Y[0])==null?void 0:se.value)||null:U.type==="select-simple"&&Pe.selectedValue!==void 0?Array.isArray(Pe.selectedValue)?Pe.selectedValue[0]:Pe.selectedValue:U.type==="select"&&Pe.selectedOptions?Pe.selectedOptions.map(je=>je.value):U.type==="check"&&Pe.isChecked!==void 0?Pe.isChecked:U.type==="switch"&&(Pe.isChecked!==void 0||Pe.selectedValue!==void 0)?Pe.isChecked!==void 0?Pe.isChecked:Pe.selectedValue:Pe.selectedValue!==void 0?Pe.selectedValue:U.type==="select"?[]:U.type==="check"||U.type==="switch"?!1:U.type==="radio-button"?((ge=(me=U.options)==null?void 0:me[0])==null?void 0:ge.value)||null:U.type==="select-simple"?((xe=(be=U.options)==null?void 0:be[0])==null?void 0:xe.value)||null:U.type==="advanced-select"?{}:null}):h.value=v.filters.map((U,D)=>{var F,z,X,M;const Y=v.initialValues[D];if(Y!=null)return Y;if(U.type==="radio-button")return((z=(F=U.options)==null?void 0:F[0])==null?void 0:z.value)||null;if(U.type==="advanced-select"){const se={};let me=!1;return U.options&&Array.isArray(U.options)&&U.options.forEach((ge,be)=>{var xe,Pe,je,_e,Ue,qe,Re;ge.value==="zona"||(xe=ge.label)!=null&&xe.toLowerCase().includes("zona")?(se[be]=Array.from({length:35},(We,Qe)=>Qe+1),me=!0):ge.value==="resultados"||(Pe=ge.label)!=null&&Pe.toLowerCase().includes("resultados")?(se[be]=["iba-ganando","iba-perdiendo","iba-empatado"],me=!0):ge.value==="que-sucedio"||ge.value==="que sucedio"||(je=ge.label)!=null&&je.toLowerCase().includes("qué sucedió")||(_e=ge.label)!=null&&_e.toLowerCase().includes("que sucedio")?(se[be]=["rematado-destino-porteria","fue-gol","no-fue-gol","rematado-sin-destino-porteria","ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"],me=!0):ge.value==="detalles"||(Ue=ge.label)!=null&&Ue.toLowerCase().includes("detalles")?(se[be]=["0-15","16-30","31-45","46-60","61-75","76-90"],me=!0):(ge.value==="como-fue-cobrado"||ge.value==="como fue cobrado"||(qe=ge.label)!=null&&qe.toLowerCase().includes("cómo fue cobrado")||(Re=ge.label)!=null&&Re.toLowerCase().includes("como fue cobrado"))&&(se[be]=["izquierda","comba-afuera","comba-adentro","raz-area","en-corto"],me=!0)}),me?se:{}}return U.type==="select"?[]:U.type==="check"?!1:U.type==="switch"?(v.filters.findIndex(se=>se.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${D} (modo agregar):`,!1),!1):U.type==="select-simple"&&((M=(X=U.options)==null?void 0:X[0])==null?void 0:M.value)||null}):h.value=v.filters.map((U,D)=>{var F,z,X,M;return U.type==="select"?[]:U.type==="check"?!1:U.type==="switch"?(v.filters.findIndex(Y=>Y.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${D} (sin initialValues):`,!1),!1):U.type==="radio-button"?((z=(F=U.options)==null?void 0:F[0])==null?void 0:z.value)||null:U.type==="select-simple"?((M=(X=U.options)==null?void 0:X[0])==null?void 0:M.value)||null:U.type==="advanced-select"?{}:null});const I=h.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!=="")),j=v.filters.map((U,D)=>({index:D,type:U.type,label:U.label||U.label_1||U.label_2||`Filtro ${D}`,value:h.value[D]}));console.log("??????????????????????????????????? ---- ???????????????????????????????????"),console.log("Valores de filtros seteados:",j),console.log("selectedValues:",h.value),console.log("props.filters:",v.filters),console.log("??????????????????????????????????? ---- ???????????????????????????????????"),I&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))};d(),setTimeout(()=>{t.nextTick(()=>{if(h.value[0]!==null&&h.value[0]!==void 0&&!a){const I=!(()=>{const j=h.value[1];return j==null?!1:Array.isArray(j)?j.length>0:j!==""})();x(h.value[0],I),t.nextTick(()=>{h.value.some(j=>j!=null&&(Array.isArray(j)?j.length>0:typeof j=="object"&&!Array.isArray(j)?Object.keys(j).length>0:j!==!1&&j!==""))&&(!u||h.value.length!==u.length||h.value.some((j,U)=>!T(j,u[U])))&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))})}else setTimeout(()=>{h.value.some(I=>I!=null&&(Array.isArray(I)?I.length>0:typeof I=="object"&&!Array.isArray(I)?Object.keys(I).length>0:I!==!1&&I!==""))&&(!u||h.value.length!==u.length||h.value.some((I,j)=>!T(I,u[j])))&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))},100)})},300),t.watch(()=>v.initialValues,I=>{if(!I||I.length===0)return;const j=I.length>0&&(typeof I[0]=="number"||typeof I[0]=="boolean"||I[0]===null||Array.isArray(I[0])),U=!T(h.value,I),D=I&&I.length>0&&!a&&U,F=v.isEditMode&&a;if(D&&!F)if(j){const z=v.filters.findIndex(X=>X.type==="switch");z!==-1&&I[z]!==void 0&&console.log(`[Primer Switch] Se setea valor desde watcher initialValues (formato simple) en índice ${z}:`,I[z]),h.value=[...I]}else v.isEditMode?h.value=v.filters.map((z,X)=>{const M=I[X];return M?z.type==="radio-button"&&M.selectedOption?M.selectedOption.value:z.type==="select-simple"&&M.selectedValue!==void 0?Array.isArray(M.selectedValue)?M.selectedValue[0]:M.selectedValue:z.type==="select"&&M.selectedOptions?M.selectedOptions.map(Y=>Y.value):z.type==="check"&&M.isChecked!==void 0?M.isChecked:z.type==="switch"&&M.isChecked!==void 0?(v.filters.findIndex(Y=>Y.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor desde isChecked en índice ${X} (modo edición):`,M.isChecked),M.isChecked):z.type==="switch"&&M.selectedValue!==void 0?(v.filters.findIndex(Y=>Y.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor desde selectedValue en índice ${X} (modo edición):`,M.selectedValue),M.selectedValue):z.type==="advanced-select"&&M.selectedValue!==void 0||M.selectedValue!==void 0?M.selectedValue:h.value[X]:h.value[X]}):h.value=[...I];else a?k&&k.length>0&&(h.value=[...k]):F&&k&&k.length>0&&(h.value=[...k])},{deep:!0}),t.watch(()=>v.isEditMode,(I,j)=>{j===!0&&I===!1&&(k=null)},{immediate:!0}),t.watch(h,I=>{if(I.some(j=>j!=null&&(Array.isArray(j)?j.length>0:typeof j=="object"&&!Array.isArray(j)?Object.keys(j).length>0:j!==!1&&j!==""))){const j=[...I];if(u){for(;j.length<u.length;)j.push(void 0);for(let U=0;U<u.length;U++)u[U]!==void 0&&u[U]!==null&&(j[U]===void 0||j[U]===null)&&(j[U]=u[U])}if((()=>{if(!u||j.length!==u.length)return!0;for(let U=0;U<j.length;U++)if(!T(j[U],u[U]))return!0;return!1})()){u=[...j];const U=v.filters.map((D,F)=>({index:F,type:D.type,label:D.label||D.label_1||D.label_2||`Filtro ${F}`,value:j[F]}));console.log("Valores de filtros actualizados:",U),$("filters-changed",{componentId:v.componentId,filters:j,timestamp:new Date().toISOString()})}}},{deep:!0}),t.watch(()=>h.value[0],(I,j)=>{var U;if(I==null){const F=v.filters[0];if(F&&F.type==="radio-button"&&F.options&&F.options.length>0){const z=F.options[0].value;h.value[0]=z;return}}const D=(U=v.filters)==null?void 0:U[0];D&&D.type==="select-simple"&&(I!==j&&j!==void 0?x(I,!0):j===void 0&&I!==null&&I!==void 0&&x(I,!1))},{immediate:!0});const o=I=>{i.value===I?i.value=null:(i.value=I,p.value=null)},l=I=>{p.value===I?p.value=null:(p.value=I,i.value=null)},s=(I,j)=>{if(a=!0,setTimeout(()=>{a=!1},1e3),h.value[I]=j,(I===0||I===1)&&(k=[...h.value]),i.value=null,I===0){h.value[1]!==void 0&&(h.value[1]=null);const U=a;a=!1,x(j,!0),a=U,h.value[1]!==null&&h.value[1]!==void 0&&(k=[...h.value])}},f=()=>{a=!0,setTimeout(()=>{a=!1},400)},g=I=>{a=!0,setTimeout(()=>{a=!1},400);const j=h.value[I],U=!j;h.value[I]=U,v.filters.findIndex(D=>D.type==="switch")===I&&console.log(`[Primer Switch] Se setea valor en índice ${I} desde toggleSwitch:`,U,"(valor anterior:",j,")")},S=I=>{a=!0,setTimeout(()=>{a=!1},400),h.value[I.filterIndex]||(h.value[I.filterIndex]={}),h.value[I.filterIndex]={...h.value[I.filterIndex],[I.optionIndex]:I.values},t.nextTick(()=>{h.value.some(j=>j!=null&&(Array.isArray(j)?j.length>0:typeof j=="object"&&!Array.isArray(j)?Object.keys(j).length>0:j!==!1&&j!==""))&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))})},L=()=>h.value,E=(I,j)=>{const U=h.value[j];if(U==null)return null;if(j===1&&c.value.length>0){const D=c.value.find(F=>F.value===U);return D?D.label:null}if(I.options&&Array.isArray(I.options)){const D=I.options.find(F=>F.value===U);return D?D.label:null}return null},P=(I,j)=>{const U=h.value[j];if(!U||typeof U!="object"||Array.isArray(U))return null;const D=Object.values(U).reduce((F,z)=>Array.isArray(z)&&z.length>0?F+z.length:F,0);return D>0?`${D} seleccionado${D>1?"s":""}`:null},V=I=>{const j=I.target,U=j.closest(".advanced-select-dropdown"),D=j.closest(".advanced-select-menu"),F=j.closest(".advanced-select-accordion"),z=j.closest(".advanced-select-content"),X=j.closest(".custom-select.dynamic-select"),M=j.closest(".simple-select-menu");!(U||D||F||z)&&!(X||M)&&(p.value=null,i.value=null)};return t.onMounted(()=>{document.addEventListener("click",V)}),t.onUnmounted(()=>{document.removeEventListener("click",V)}),r({getCurrentValues:L,initializeValues:d}),(I,j)=>(t.openBlock(),t.createElementBlock("div",srt,[e.filters&&e.filters.length>0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filters,(U,D)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:D},[U.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",lrt,[t.createElementVNode("div",crt,t.toDisplayString(U.label),1),t.createElementVNode("div",urt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(U.options,F=>(t.openBlock(),t.createElementBlock("label",{key:F.value,class:t.normalizeClass(["radio-option-card",{active:h.value[D]===F.value}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"corners-zone-radio-"+D,value:F.value,"onUpdate:modelValue":z=>h.value[D]=z,onChange:f},null,40,drt),[[t.vModelRadio,h.value[D]]]),t.createElementVNode("span",null,t.toDisplayString(F.label),1)],2))),128))])])):U.type==="select-simple"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[D==2?(t.openBlock(),t.createElementBlock("div",prt)):t.createCommentVNode("",!0),t.createElementVNode("div",hrt,[t.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":U.type,onClick:t.withModifiers(F=>o(D),["stop"])},[t.createElementVNode("div",mrt,[j[3]||(j[3]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.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)),t.createElementVNode("span",yrt,t.toDisplayString(E(U,D)||U.label_2||U.label||"Tipo de análisis"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:i.value===D}])},[...j[2]||(j[2]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),i.value===D?(t.openBlock(),t.createElementBlock("div",grt,[t.createElementVNode("div",vrt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(D===1?c.value:U.options,F=>(t.openBlock(),t.createElementBlock("div",{key:F.value,class:t.normalizeClass(["option-card simple-select-option",{active:T(h.value[D],F.value)}]),onClick:t.withModifiers(z=>s(D,F.value),["stop"])},[t.createElementVNode("div",xrt,[t.createElementVNode("div",_rt,t.toDisplayString(F.label),1)]),T(h.value[D],F.value)?(t.openBlock(),t.createElementBlock("div",wrt,[...j[4]||(j[4]=[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[t.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):t.createCommentVNode("",!0)],10,brt))),128))])])):t.createCommentVNode("",!0)],8,frt)])],64)):U.type==="switch"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("div",Trt,[t.createElementVNode("label",Srt,[U.label_1?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["switch-text switch-text-left",{"switch-text-selected":!h.value[D]}])},t.toDisplayString(U.label_1),3)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"switch",onClick:F=>g(D)},[t.createElementVNode("div",{class:t.normalizeClass(["switch-track",{"switch-on":h.value[D]}])},[t.createElementVNode("div",{class:t.normalizeClass(["switch-thumb",{on:h.value[D]}])},null,2)],2)],8,krt),U.label_2?(t.openBlock(),t.createElementBlock("span",{key:1,class:t.normalizeClass(["switch-text switch-text-right",{"switch-text-selected":h.value[D]}])},t.toDisplayString(U.label_2),3)):t.createCommentVNode("",!0)])]),D>=0?(t.openBlock(),t.createElementBlock("div",Lrt)):t.createCommentVNode("",!0)],64)):U.type==="advanced-select"?(t.openBlock(),t.createElementBlock("div",Nrt,[t.createElementVNode("div",{class:"custom-select dynamic-select filter-inline advanced-select-dropdown","data-filter-type":U.type,onClick:t.withModifiers(F=>l(D),["stop"])},[t.createElementVNode("div",Mrt,[j[6]||(j[6]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.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)),t.createElementVNode("span",Ert,t.toDisplayString(P(U,D)||U.label||"Seleccionar"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:p.value===D}])},[...j[5]||(j[5]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),p.value===D?(t.openBlock(),t.createElementBlock("div",{key:0,class:"dropdown-menu type-menu advanced-select-menu",onClick:j[1]||(j[1]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",{class:"advanced-select-content",onClick:j[0]||(j[0]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(ort,{filter:U,"filter-index":D,"selected-values":h.value,onUpdateSelection:S,onClose:F=>l(D)},null,8,["filter","filter-index","selected-values","onClose"])])])):t.createCommentVNode("",!0)],8,Ort)])):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0)]))}},zrt=t2(Crt,[["__scopeId","data-v-32afcda4"]]),Vrt={class:"floating-bar"},Prt={class:"tab active"},Art={class:"select-display"},Rrt={class:"select-icon"},Urt=["src"],Frt={key:1,alt:"icono",class:"option-img-default",src:"https://golstatsimages.blob.core.windows.net/images-library/vector2.png"},Irt={key:0,class:"select-placeholder select-label"},qrt={key:1,class:"select-label"},jrt={key:0,class:"dropdown-menu field-menu"},Drt=["onClick"],Wrt={class:"option-icon"},Krt=["data-hover-src","src"],Brt={class:"option-content"},Xrt={class:"option-title"},Grt={key:0,class:"option-description"},Zrt={class:"select-display"},Jrt={class:"select-icon"},Hrt=["src"],Yrt=["src"],Qrt={class:"select-label"},$rt={key:0,class:"dropdown-menu type-menu type-menu-grid"},ent={class:"option-grid"},tnt=["onClick"],rnt={key:0,class:"option-grid-title"},nnt={key:1,class:"option-grid-title"},ant={key:2,class:"option-grid-title"},int={class:"option-grid-icon"},ont=["src"],snt={key:1,class:"filter-separator"},lnt=["onClick"],cnt={class:"select-display"},unt={key:0,class:"badge-categorias"},dnt={key:0,class:"dropdown-menu type-menu multi-select-menu"},pnt={class:"multi-select-scroll-area"},hnt={class:"select-all-checkbox"},fnt=["checked","indeterminate","onChange"],mnt={class:"option-checkbox"},ynt=["checked","onChange"],gnt=["onClick"],vnt={class:"option-title"},bnt={class:"multi-select-footer"},xnt={key:1,class:"custom-radio-group filter-inline"},_nt={class:"radio-label"},wnt={class:"radio-options"},Tnt=["onUpdate:modelValue","disabled","name","value","onChange"],Snt={key:2,class:"check-group filter-inline"},knt=["onUpdate:modelValue","checked"],Lnt=["data-filter-type","onClick"],Nnt={class:"select-display"},Ont={key:0,class:"dropdown-menu type-menu simple-select-menu"},Mnt={class:"simple-select-scroll-area"},Ent=["onMouseenter","onClick"],Cnt={class:"option-content"},znt={class:"option-title"},Vnt={key:0,class:"option-checkmark"},Pnt={key:4,class:"filter-separator"},Ant=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:r,emit:n}){const v=e,$=n,h=t.ref(new Map),u=t.ref([]);let i=null,p=null,c=null;const a=t.ref(!1),k=t.ref(!1),T=t.ref(!1),x=t.ref(!1),d=t.ref(!1),o=t.ref(!1),l=t.computed(()=>u.value),s=t.ref(null),f=t.computed(()=>l.value[s.value]||null),g=t.computed(()=>{var St;const Yt=((St=f.value)==null?void 0:St.views)||[];return F(Yt)}),S=t.ref(null),L=t.computed(()=>g.value.find(St=>St.id===S.value)||null),E=t.ref([]),P=t.computed(()=>{var St,Yt;return a.value?((St=L.value)==null?void 0:St.filters_edition_mode)||[]:((Yt=L.value)==null?void 0:Yt.filters)||[]});t.watch(a,St=>{St||(k.value=!1)}),t.watch(L,St=>{var Yt,er;if(!St){E.value=[];return}const or=St.id===6&&v.isPostMatch,Or=St.id===14;if(!Array.isArray(P.value)&&!or&&!Or){E.value=[];return}x.value||(or||Or?E.value=[]:E.value=P.value.map((Pr,sn)=>{var qn,jn,ba,fa,Ia,en,Ur,mn,Vn,Jn,Cn,Xr,un,kr,dn,Gn,Dn,oa,Yn,qr,wr;if(Pr.type==="select"){if(a.value&&c&&c.dynamicFilters){const En=c.dynamicFilters[sn];if(En){if(En.selectedOptions&&Array.isArray(En.selectedOptions))return En.selectedOptions.map(na=>na.value);if(En.selectedValue&&Array.isArray(En.selectedValue))return En.selectedValue.length>0&&En.selectedValue[0]&&typeof En.selectedValue[0]=="object"?lr(En.selectedValue):En.selectedValue}}return St.id===4&&Pr.options&&Array.isArray(Pr.options)?Pr.options.map(En=>En.value):[]}else if(Pr.type==="radio-button"){if(a.value&&c&&c.dynamicFilters){const En=c.dynamicFilters[sn];if(En&&En.selectedOption){let na=En.selectedOption.value;if(St.id===15&&sn===0&&na===3&&((jn=(qn=p==null?void 0:p.view)==null?void 0:qn.filterMultiple)==null?void 0:jn.isHomeTeam)!==void 0){const ma=p.view.filterMultiple.isHomeTeam;typeof ma=="boolean"?na=ma?1:2:typeof ma=="number"&&(na=ma===1?1:2)}return na}}if(St.id===7&&a.value&&p!=null&&p.view){if(sn===0&&(ba=p.view.componentProps)!=null&&ba.analysisType)return p.view.componentProps.analysisType==="offensive"?1:2;if(sn===1&&((fa=p.view.filterMultiple)==null?void 0:fa.isHomeTeam)!==void 0)return p.view.filterMultiple.isHomeTeam?1:2}return((en=(Ia=Pr.options)==null?void 0:Ia[0])==null?void 0:en.value)??null}else if(Pr.type==="select-simple"){if(a.value&&c&&c.dynamicFilters){const En=c.dynamicFilters[sn];if(En&&En.selectedValue!==void 0){let na;return St.id===2&&(mn=(Ur=p==null?void 0:p.view)==null?void 0:Ur.filterMultiple)!=null&&mn.categoryId?na=p.view.filterMultiple.categoryId:St.id===1&&(Jn=(Vn=p==null?void 0:p.view)==null?void 0:Vn.filterMultiple)!=null&&Jn.category?na=p.view.filterMultiple.category:St.id===6&&(Xr=(Cn=p==null?void 0:p.view)==null?void 0:Cn.filterMultiple)!=null&&Xr.gameNumber?na=p.view.filterMultiple.gameNumber:na=Array.isArray(En.selectedValue)?En.selectedValue[0]:En.selectedValue,na}}if(St.id===2&&a.value&&p!=null&&p.view){if(i&&p.view.id){const En=i.getComponentDynamicFilters(p.view.id);if(En&&En[sn]!==void 0)return En[sn]}if(p.view.filterMultiple){if(Pr.type==="select-simple"&&p.view.filterMultiple.categoryId){const En=p.view.filterMultiple.categoryId;return(Pr.options||[]).find(na=>na.value==En),En}if(Pr.type==="radio-button"&&p.view.filterMultiple.teamType!==void 0){const En=p.view.filterMultiple.teamType;return(Pr.options||[]).find(na=>na.value==En),En}}}if(St.id===1&&a.value&&(un=p==null?void 0:p.view)!=null&&un.filterMultiple&&p.view.filterMultiple.category){const En=p.view.filterMultiple.category;return(Pr.options||[]).find(na=>na.value==En),En}if(St.id===9&&a.value&&(kr=p==null?void 0:p.view)!=null&&kr.filterMultiple&&Pr.type==="select-simple"&&p.view.filterMultiple.categoryIds){const En=Array.isArray(p.view.filterMultiple.categoryIds)?p.view.filterMultiple.categoryIds:[p.view.filterMultiple.categoryIds],na=(Pr.options||[]).filter(ma=>Array.isArray(ma.value)?hr(ma.value,En):En.includes(ma.value));return na.length>0?na[0].value:En}if(St.id===6&&a.value&&(dn=p==null?void 0:p.view)!=null&&dn.filterMultiple&&p.view.filterMultiple.gameNumber){const En=p.view.filterMultiple.gameNumber;return(Pr.options||[]).find(na=>na.value==En),En}if(St.id===5&&a.value&&(Gn=p==null?void 0:p.view)!=null&&Gn.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0){const En=p.view.filterMultiple.isHomeTeam;let na;if(typeof En=="boolean"?na=En?1:2:typeof En=="number"?na=En===1?1:2:na=1,(Pr.options||[]).find(ma=>ma.value==na),Pr.type==="radio-button"&&(Pr.label==="Equipo"||Pr.label==="Team"||Pr.label==="Equipo seleccionado"))return na}if(St.id===15&&a.value&&(Dn=p==null?void 0:p.view)!=null&&Dn.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0&&Pr.type==="radio-button"&&sn===0){const En=p.view.filterMultiple.isHomeTeam;let na;if(typeof En=="boolean"?na=En?1:2:typeof En=="number"?na=En===1?1:2:na=1,(Pr.options||[]).find(ma=>ma.value==na))return na}if(St.id===9&&a.value&&(oa=p==null?void 0:p.view)!=null&&oa.filterMultiple&&Pr.type==="radio-button"&&p.view.filterMultiple.isHomeTeam!==void 0){const En=p.view.filterMultiple.isHomeTeam?1:2,na=((Yn=Pr.options)==null?void 0:Yn.map(ma=>ma.value))||[];return na.includes(En)?En:na[0]||1}return((wr=(qr=Pr.options)==null?void 0:qr[0])==null?void 0:wr.value)??null}else if(Pr.type==="check"){if(a.value&&c&&c.dynamicFilters){const En=c.dynamicFilters[sn];if(En&&En.isChecked!==void 0)return En.isChecked}if(St.id===8)return!0;if(St.id===3){if(a.value&&c&&c.dynamicFilters){const En=c.dynamicFilters[sn];if(En&&En.isChecked!==void 0)return En.isChecked}return!1}return!1}return null}),!((Yt=St.name)!=null&&Yt.toLowerCase().includes("tops players")||(er=St.title)!=null&&er.toLowerCase().includes("tops players"))&&(!a.value||or)&&t.nextTick(()=>{var Pr,sn;St.id===4&&a.value&&(Pr=p==null?void 0:p.view)!=null&&Pr.id&&i&&i.setDynamicFilters(E.value,p.view.id),St.id===3&&a.value&&(sn=p==null?void 0:p.view)!=null&&sn.id&&i&&i.setDynamicFilters(E.value,p.view.id),Ye()}))},{immediate:!0}),t.watch(()=>i,St=>{St&&St.dynamicFilters&&Array.isArray(St.dynamicFilters)&&(x.value=!0,E.value=[...St.dynamicFilters],t.nextTick(()=>{x.value=!1}))},{deep:!0}),t.watch(()=>i==null?void 0:i.dynamicFilters,St=>{if(St&&Array.isArray(St)){if(d.value)return;x.value=!0,E.value=[...St],t.nextTick(()=>{x.value=!1})}},{deep:!0}),t.watch(()=>L.value,St=>{if(a.value&&c&&St&&St.filters){if(x.value||o.value)return;if(St.id===3){if(d.value||o.value)return;const Yt=c.dynamicFilters.find(er=>er.filterType==="check");Yt&&Yt.isChecked!==void 0&&E.value&&E.value.length>0&&(d.value=!0,E.value[0]=Yt.isChecked,t.nextTick(()=>{E.value=[...E.value],d.value=!1}))}setTimeout(()=>{(!E.value||E.value.length===0)&&($t(),Zt(),Tt()),St.id===4&&Rt()},100)}},{deep:!0}),t.watch(()=>{var St;return(St=L.value)==null?void 0:St.id},St=>{if(a.value&&c&&St===4){if(x.value||o.value)return;setTimeout(()=>{Rt()},200)}}),t.watch(()=>E.value,St=>{if(a.value&&c&&St&&St.length>0){if(x.value||d.value||o.value)return;setTimeout(()=>{var Yt;It()&&($t(),Zt(),Tt(),((Yt=L.value)==null?void 0:Yt.id)===4&&Rt())},50)}},{deep:!0});function V(St,Yt){var er,or,Or,Pr,sn;const qn=E.value[St];if((er=L.value)==null||er.id,(or=L.value)==null||or.id,Array.isArray(qn)){if(((Or=L.value)==null?void 0:Or.id)===4&&St===0){const jn=qn.some(ba=>{if(Yt.category_id&&Yt.event_type_id){if(ba.category_id&&ba.event_type_id)return ba.category_id===Yt.category_id&&ba.event_type_id===Yt.event_type_id;if(ba.event_type_id&&!ba.category_id)return ba.event_type_id===Yt.event_type_id;if(ba.category_id&&!ba.event_type_id)return ba.category_id===Yt.category_id}else{if(Yt.event_type_id)return ba.event_type_id===Yt.event_type_id;if(Yt.category_id)return ba.category_id===Yt.category_id}return JSON.stringify(ba)===JSON.stringify(Yt)});return(Pr=L.value)==null||Pr.id,jn}return qn.includes(Yt)}else if(qn!=null)return(sn=L.value)==null||sn.id,qn===Yt;return!1}function I(St,Yt){var er,or,Or;const Pr=(or=(er=L.value)==null?void 0:er.filters)==null?void 0:or[St];if((Pr==null?void 0:Pr.type)==="select-simple"){rt(St,Yt);return}Array.isArray(E.value[St])||(E.value[St]=[]);const sn=E.value[St];let qn=-1;((Or=L.value)==null?void 0:Or.id)===4&&St===0?qn=sn.findIndex(jn=>Yt.category_id&&Yt.event_type_id?jn.category_id===Yt.category_id&&jn.event_type_id===Yt.event_type_id:Yt.event_type_id?jn.event_type_id===Yt.event_type_id:Yt.category_id?jn.category_id===Yt.category_id:!1):qn=sn.indexOf(Yt),qn>-1?sn.splice(qn,1):sn.push(Yt),a.value&&Pt(),Ye()}function j(St){var Yt,er;const or=E.value[St],Or=(er=(Yt=L.value)==null?void 0:Yt.filters)==null?void 0:er[St];return(Or==null?void 0:Or.type)==="select-simple"||!Or||!Or.options||!Array.isArray(or)?!1:or.length===Or.options.length}function U(St){var Yt,er;const or=E.value[St],Or=(er=(Yt=L.value)==null?void 0:Yt.filters)==null?void 0:er[St];return(Or==null?void 0:Or.type)==="select-simple"||!Or||!Or.options||!Array.isArray(or)?!1:or.length>0&&or.length<Or.options.length}function D(){var St;return!(((St=L.value)==null?void 0:St.id)===6&&v.isPostMatch)}function F(St){return!St||!Array.isArray(St)?St:St.filter(Yt=>{const er=(Yt.name||Yt.title||"").toLowerCase();return v.isPostMatch?!0:!["resumen general","timeline","datos relevantes"].some(or=>er.includes(or))})}function z(){var St,Yt;const er=((Yt=(St=f.value)==null?void 0:St.name)==null?void 0:Yt.toLowerCase())||"";return er.includes("cancha")||er.includes("volumétrica")||er.includes("volumetric")}function X(St,Yt){if(!a.value||!z())return!1;const er=String(St||"").toLowerCase(),or=String(Yt||"").toLowerCase();return er.includes("ambos")||or.includes("ambos")}function M(St){var Yt,er;const or=(er=(Yt=L.value)==null?void 0:Yt.filters)==null?void 0:er[St];if(!or||!or.options)return;const Or=or.options.map(Pr=>Pr.value);Array.isArray(E.value[St])||(E.value[St]=[]),j(St)?E.value[St]=[]:E.value[St]=[...Or],ge.value=St,Ye()}const Y=t.ref("ambos"),se=t.ref(!1),me=t.ref(!1),ge=t.ref(null),be=t.ref(null);function xe(St,Yt=!1){const er="https://golstatsimages.blob.core.windows.net/images-library/",or="https://golstatsimages.blob.core.windows.net/reports-images/",Or={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"},Pr=Object.keys(Or).find(sn=>St==null?void 0:St.toLowerCase().includes(sn.toLowerCase()));if(Pr){const sn=Or[Pr],qn=Yt?"":"-def";return Pr.toLowerCase().includes("tabla")?`${or}${sn}${qn}@2x.png`:`${er}${sn}${qn}@2x.png`}return`${er}icn_default${Yt?"":"-def"}.png`}function Pe(){return f.value?f.value.name:"Tipo de vista"}function je(){return L.value?L.value.name||L.value.title:"Visualización"}function _e(){a.value||(se.value=!se.value,se.value&&(me.value=!1,t.nextTick(()=>{Jt()})))}function Ue(){a.value||f.value&&(me.value=!me.value,me.value&&(se.value=!1))}function qe(St){a.value||(s.value=St,se.value=!1,S.value=null,Ye())}function Re(St){var Yt,er;a.value||(S.value=St.id,me.value=!1,(Yt=St.name)!=null&&Yt.toLowerCase().includes("tops players")||(er=St.title)==null||er.toLowerCase().includes("tops players"))}function We(St){var Yt;ge.value=ge.value===St?null:St,((Yt=L.value)==null?void 0:Yt.id)===4&&a.value&&St===0&&setTimeout(()=>{E.value=[...E.value]},50)}function Qe(St){be.value=be.value===St?null:St}function rt(St,Yt){var er,or,Or,Pr,sn;if(((er=L.value)==null?void 0:er.id)===2){const qn=P.value.findIndex(jn=>jn.type==="select-simple"&&jn.label==="Tipo de análisis");St===qn?E.value[0]=Yt:E.value[St]=Yt}else if(((or=L.value)==null?void 0:or.id)===1)E.value[0]=Yt;else if(((Or=L.value)==null?void 0:Or.id)===6)E.value[0]=Yt;else if(((Pr=L.value)==null?void 0:Pr.id)===9)if(St===0){Array.isArray(Yt)?E.value[St]=Yt:E.value[St]=[Yt];const qn=((sn=P.value[St])==null?void 0:sn.options)||[],jn=Array.isArray(Yt)?Yt:[Yt],ba=qn.find(fa=>Array.isArray(fa.value)?hr(fa.value,jn):jn.includes(fa.value));ba?E.value[St]=ba.value:E.value[St]=jn}else E.value[St]=Yt;else E.value[St]=Yt;be.value=null,a.value&&Pt(),Ye()}function dt(St){St.target.closest(".custom-select")||(se.value=!1,me.value=!1,be.value=null)}const ut=[16,18];function Ye(){var St,Yt,er,or,Or,Pr,sn,qn,jn,ba,fa,Ia,en,Ur,mn,Vn,Jn,Cn,Xr,un,kr,dn;if(ut.includes((St=L.value)==null?void 0:St.id)||x.value)return;let Gn=[],Dn=[];L.value&&Array.isArray(P.value)&&P.value.forEach((wr,En)=>{if(wr.type==="select"&&wr.label==="Tipo de análisis"&&wr.id===2){const na=E.value[En]||[];Array.isArray(na)&&na.length>0&&(Gn=na.map(ma=>{var ea;const Ha=(ea=wr.options)==null?void 0:ea.find(Pa=>Pa.value===ma);return{value:ma,label:(Ha==null?void 0:Ha.label)||ma}}))}});const oa=((Yt=L.value)==null?void 0:Yt.id)===4;if(L.value&&Array.isArray(L.value.filters)&&L.value.filters.some(wr=>wr.type==="select"&&wr.label==="Tipo de análisis"&&wr.id===2)&&Gn.length===0&&!oa)return;if(oa&&E.value&&E.value.length>0){const wr=E.value[0];Array.isArray(wr)&&wr.length>0}Dn=((er=P.value)==null?void 0:er.map((wr,En)=>{var na,ma,ea,Ha;const Pa=E.value[En];let Ya=wr.id||`filter_${En}`;return((na=L.value)==null?void 0:na.id)===3&&a.value&&(ma=p==null?void 0:p.view)!=null&&ma.id&&(Ya=`filter_${En}_component_${p.view.id}`),{filterId:Ya,filterType:wr.type,filterLabel:wr.label,filterIcon:wr.icon||null,selectedValue:Pa,selectedOptions:wr.type==="select"&&Array.isArray(Pa)&&Pa.length>0?Pa.map(Aa=>{var Da;const Ni=(Da=wr.options)==null?void 0:Da.find(Pi=>Pi.value===Aa);return{value:Aa,label:(Ni==null?void 0:Ni.label)||Aa,icon:(Ni==null?void 0:Ni.icon)||null}}):null,selectedOption:wr.type==="radio-button"&&Pa!=null?{value:Pa,label:((Ha=(ea=wr.options)==null?void 0:ea.find(Aa=>Aa.value===Pa))==null?void 0:Ha.label)||Pa}:null,isChecked:wr.type==="check"?Pa:null}}))||[];const Yn={mainSelector:{id:((or=f.value)==null?void 0:or.id)||null,name:((Or=f.value)==null?void 0:Or.name)||null,url:((Pr=f.value)==null?void 0:Pr.url)||null},viewSelector:{id:((sn=L.value)==null?void 0:sn.id)||null,name:((qn=L.value)==null?void 0:qn.name)||((jn=L.value)==null?void 0:jn.title)||null,url:((ba=L.value)==null?void 0:ba.url)||null},team:Y.value,dynamicFilters:Dn,categoriasSeleccionadas:Gn,timestamp:new Date().toISOString(),summary:{mainSelected:!!f.value,viewSelected:!!L.value,totalDynamicFilters:((fa=P.value)==null?void 0:fa.length)||0,activeFilters:((Ia=P.value)==null?void 0:Ia.filter((wr,En)=>{const na=E.value[En];return Array.isArray(na)?na.length>0:na!=null&&na!==!1}).length)||0}},qr={main:f.value,view:L.value,team:Y.value,dynamicFilters:E.value,filtersJSON:Yn,filterAndViewsContainer:i,viewToEdit:p};if($("filters-changed",qr),a.value&&p){if(c=Yn,((en=L.value)==null?void 0:en.id)===2){const wr=c.dynamicFilters.findIndex(En=>En.filterType==="select-simple"&&En.filterLabel==="Tipo de análisis");wr!==-1&&(mn=(Ur=p.view)==null?void 0:Ur.filterMultiple)!=null&&mn.categoryId&&(c.dynamicFilters[wr].selectedValue=p.view.filterMultiple.categoryId)}if(((Vn=L.value)==null?void 0:Vn.id)===1){const wr=c.dynamicFilters.findIndex(En=>En.filterType==="select-simple"&&En.filterLabel==="Tipo de análisis");wr!==-1&&(Cn=(Jn=p.view)==null?void 0:Jn.filterMultiple)!=null&&Cn.category&&(c.dynamicFilters[wr].selectedValue=p.view.filterMultiple.category)}}if(((Xr=L.value)==null?void 0:Xr.id)===6&&a.value&&(un=p==null?void 0:p.view)!=null&&un.filterMultiple&&p.view.filterMultiple.gameNumber&&c){const wr=c.dynamicFilters.findIndex(En=>En.filterType==="select-simple"&&En.filterLabel==="Número de juego");wr!==-1&&(dn=(kr=p.view)==null?void 0:kr.filterMultiple)!=null&&dn.gameNumber&&(c.dynamicFilters[wr].selectedValue=p.view.filterMultiple.gameNumber)}i&&!a.value?i.setDynamicFilters(E.value):i&&a.value}function st(){p=null,c=null,i=null,s.value=null,S.value=null,Y.value="ambos",E.value=[],se.value=!1,me.value=!1,ge.value=null,be.value=null,a.value=!1,k.value=!1,T.value=!1}function lt(St){if(St&&St.dynamicFilters){if(d.value)return;Array.isArray(St.dynamicFilters)&&St.dynamicFilters.length>0&&(x.value=!0,E.value=[...St.dynamicFilters],t.nextTick(()=>{x.value=!1}))}}function Ot(St){if(a.value=!0,St.mainSelector&&St.mainSelector.id){const Yt=u.value.findIndex(er=>er.id===St.mainSelector.id);Yt!==-1&&(s.value=Yt)}St.viewSelector&&St.viewSelector.id&&f.value&&f.value.views.findIndex(Yt=>Yt.id===St.viewSelector.id)!==-1&&(S.value=St.viewSelector.id),St.dynamicFilters&&Array.isArray(St.dynamicFilters)&&t.nextTick(()=>{setTimeout(()=>{var Yt,er,or,Or,Pr,sn,qn,jn,ba,fa,Ia,en,Ur,mn,Vn,Jn,Cn,Xr,un,kr,dn,Gn,Dn;if(L.value&&P.value){if(x.value)return;if(d.value=!0,St.dynamicFilters.forEach((oa,Yn)=>{var qr,wr,En,na,ma,ea,Ha,Pa,Ya,Aa,Da,Ni,Pi;if(Yn<P.value.length){const Po=P.value[Yn];if(((qr=L.value)==null?void 0:qr.id)===3&&a.value,Po.type==="check"){const So=oa.isChecked;typeof So=="boolean"&&(E.value[Yn]=So)}else if(Po.type==="select"&&oa.selectedOptions){const So=oa.selectedOptions.map(zo=>zo.value);E.value[Yn]=So}else if(Po.type==="select"&&oa.selectedValue&&Array.isArray(oa.selectedValue))if(oa.selectedValue.length>0&&oa.selectedValue[0]&&typeof oa.selectedValue[0]=="object"){const So=lr(oa.selectedValue);E.value[Yn]=So}else E.value[Yn]=oa.selectedValue;else if(Po.type==="radio-button"&&oa.selectedOption)E.value[Yn]=oa.selectedOption.value;else if(Po.type==="select-simple"&&oa.selectedValue!==void 0){let So;((wr=L.value)==null?void 0:wr.id)===2&&(na=(En=p==null?void 0:p.view)==null?void 0:En.filterMultiple)!=null&&na.categoryId?So=p.view.filterMultiple.categoryId:((ma=L.value)==null?void 0:ma.id)===1&&(Ha=(ea=p==null?void 0:p.view)==null?void 0:ea.filterMultiple)!=null&&Ha.category?So=p.view.filterMultiple.category:((Pa=L.value)==null?void 0:Pa.id)===6&&(Aa=(Ya=p==null?void 0:p.view)==null?void 0:Ya.filterMultiple)!=null&&Aa.gameNumber?So=p.view.filterMultiple.gameNumber:((Da=L.value)==null?void 0:Da.id)===9&&(Pi=(Ni=p==null?void 0:p.view)==null?void 0:Ni.filterMultiple)!=null&&Pi.categoryIds?So=p.view.filterMultiple.categoryIds:So=Array.isArray(oa.selectedValue)?oa.selectedValue[0]:oa.selectedValue,E.value[Yn]=So}}}),((Yt=L.value)==null?void 0:Yt.id)===3&&a.value,((er=L.value)==null?void 0:er.id)===2&&a.value&&(or=p==null?void 0:p.view)!=null&&or.filterMultiple){if(p.view.filterMultiple.categoryId){const oa=P.value.findIndex(Yn=>Yn.type==="select-simple"&&Yn.label==="Tipo de análisis");if(oa!==-1){const Yn=p.view.filterMultiple.categoryId;if(E.value[0]=Yn,p.view.componentProps&&Yn){let qr=`Category ${Yn}`,wr=null;try{wr=A4(Yn),wr&&(qr=wr.name)}catch{const En=P.value.findIndex(na=>na.type==="select-simple"&&na.label==="Tipo de análisis");if(En!==-1){const na=(((Or=P.value[En])==null?void 0:Or.options)||[]).find(ma=>ma.value==Yn);na&&(qr=na.label)}}p.view.componentProps.categoryView=[{id:Yn,name:qr}]}(((Pr=P.value[oa])==null?void 0:Pr.options)||[]).find(qr=>qr.value==Yn),t.nextTick(()=>{E.value=[...E.value]})}}if(p.view.filterMultiple.teamType!==void 0){const oa=P.value.findIndex(Yn=>Yn.type==="radio-button");if(oa!==-1){const Yn=p.view.filterMultiple.teamType;E.value[oa]=Yn,(((sn=P.value[oa])==null?void 0:sn.options)||[]).find(qr=>qr.value==Yn),t.nextTick(()=>{E.value=[...E.value]})}}}if(((qn=L.value)==null?void 0:qn.id)===9&&a.value&&(jn=p==null?void 0:p.view)!=null&&jn.filterMultiple){if(p.view.filterMultiple.categoryIds){const oa=P.value.findIndex(Yn=>Yn.type==="select-simple");if(oa!==-1){const Yn=Array.isArray(p.view.filterMultiple.categoryIds)?p.view.filterMultiple.categoryIds:[p.view.filterMultiple.categoryIds];E.value[0]=Yn;const qr=(((ba=P.value[oa])==null?void 0:ba.options)||[]).filter(En=>Array.isArray(En.value)?hr(En.value,Yn):Yn.includes(En.value));if(qr.length>0){const En=qr[0].value;E.value[oa]=En}else E.value[oa]=Yn;const wr=E.value[oa];hr(wr,Yn),t.nextTick(()=>{E.value=[...E.value]})}}if(p.view.filterMultiple.isHomeTeam!==void 0){const oa=P.value.findIndex(Yn=>Yn.type==="radio-button");if(oa!==-1){const Yn=p.view.filterMultiple.isHomeTeam;let qr;typeof Yn=="boolean"?qr=Yn?1:2:typeof Yn=="number"?qr=Yn===1?1:2:qr=1,E.value[oa]=qr,(((fa=P.value[oa])==null?void 0:fa.options)||[]).find(wr=>wr.value==qr),t.nextTick(()=>{E.value=[...E.value]})}}}if(((Ia=L.value)==null?void 0:Ia.id)===1&&a.value&&(en=p==null?void 0:p.view)!=null&&en.filterMultiple&&p.view.filterMultiple.category){const oa=P.value.findIndex(Yn=>Yn.type==="select-simple"&&Yn.label==="Tipo de análisis");if(oa!==-1){const Yn=p.view.filterMultiple.category;E.value[0]=Yn,p.view.componentProps&&Yn&&(p.view.componentProps.type=Yn),(((Ur=P.value[oa])==null?void 0:Ur.options)||[]).find(qr=>qr.value==Yn),t.nextTick(()=>{E.value=[...E.value]})}}if(((mn=L.value)==null?void 0:mn.id)===6&&a.value&&(Vn=p==null?void 0:p.view)!=null&&Vn.filterMultiple&&p.view.filterMultiple.gameNumber){const oa=P.value.findIndex(Yn=>Yn.type==="select-simple"&&Yn.label==="Número de juego");if(oa!==-1){const Yn=p.view.filterMultiple.gameNumber;E.value[0]=Yn,p.view.componentProps&&Yn&&(p.view.componentProps.gameNumber=Yn),(((Jn=P.value[oa])==null?void 0:Jn.options)||[]).find(qr=>qr.value==Yn),t.nextTick(()=>{E.value=[...E.value]})}}if(((Cn=L.value)==null?void 0:Cn.id)===7&&a.value&&p!=null&&p.view){if((Xr=p.view.componentProps)!=null&&Xr.analysisType&&P.value.length>0&&((un=P.value[0])==null?void 0:un.type)==="radio-button"){const oa=p.view.componentProps.analysisType==="offensive"?1:2;E.value[0]=oa}if(((kr=p.view.filterMultiple)==null?void 0:kr.isHomeTeam)!==void 0){const oa=P.value.findIndex(Yn=>Yn.type==="radio-button"&&Yn.label==="Equipo");if(oa!==-1){const Yn=p.view.filterMultiple.isHomeTeam?1:2;E.value[1]=Yn}else if(P.value.length>1&&((dn=P.value[1])==null?void 0:dn.type)==="radio-button"){const Yn=p.view.filterMultiple.isHomeTeam,qr=Yn?1:2;E.value[1]=qr,p.view.componentProps&&(p.view.componentProps.isHomeTeamForAnalysis=Yn),(((Gn=P.value[1])==null?void 0:Gn.options)||[]).find(wr=>wr.value==qr),t.nextTick(()=>{E.value=[...E.value]})}if(oa!==-1&&p.view.componentProps){const Yn=p.view.filterMultiple.isHomeTeam,qr=Yn?1:2;p.view.componentProps.isHomeTeamForAnalysis=Yn,(((Dn=P.value[oa])==null?void 0:Dn.options)||[]).find(wr=>wr.value==qr),t.nextTick(()=>{E.value=[...E.value]})}}}t.nextTick(()=>{d.value=!1})}},100)})}function zt(){var St,Yt,er,or,Or,Pr,sn,qn,jn,ba;return{mainSelector:{id:((St=f.value)==null?void 0:St.id)||null,name:((Yt=f.value)==null?void 0:Yt.name)||null,url:((er=f.value)==null?void 0:er.url)||null},viewSelector:{id:((or=L.value)==null?void 0:or.id)||null,name:((Or=L.value)==null?void 0:Or.name)||((Pr=L.value)==null?void 0:Pr.title)||null,url:((sn=L.value)==null?void 0:sn.url)||null},team:Y.value,dynamicFilters:((qn=P.value)==null?void 0:qn.map((fa,Ia)=>{var en,Ur;const mn=E.value[Ia];return{filterId:fa.id||`filter_${Ia}`,filterType:fa.type,filterLabel:fa.label,filterIcon:fa.icon||null,selectedValue:mn,selectedOptions:fa.type==="select"&&Array.isArray(mn)&&mn.length>0?mn.map(Vn=>{var Jn;const Cn=(Jn=fa.options)==null?void 0:Jn.find(Xr=>Xr.value===Vn);return{value:Vn,label:(Cn==null?void 0:Cn.label)||Vn,icon:(Cn==null?void 0:Cn.icon)||null}}):null,selectedOption:fa.type==="radio-button"&&mn?{value:mn,label:((Ur=(en=fa.options)==null?void 0:en.find(Vn=>Vn.value===mn))==null?void 0:Ur.label)||mn}:null,isChecked:fa.type==="check"?mn:null}}))||[],timestamp:new Date().toISOString(),summary:{mainSelected:!!f.value,viewSelected:!!L.value,totalDynamicFilters:((jn=P.value)==null?void 0:jn.length)||0,activeFilters:((ba=P.value)==null?void 0:ba.filter((fa,Ia)=>{const en=E.value[Ia];return Array.isArray(en)?en.length>0:en!=null&&en!==!1}).length)||0}}}r({getCurrentFiltersJSON:zt});function Et(){st(),$("close",i)}function qt(){k.value=!1,Et()}function Gt(){T.value&&(Sd.emit("filters-cancelled",i),T.value=!1),k.value=!1,Et()}t.onMounted(async()=>{document.addEventListener("click",dt),t.nextTick(()=>{Jt()});const St="https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/views";try{const Yt=await(await fetch(St,{headers:{Authorization:`${v.token}`}})).json();u.value=Yt.data||[],h.value.clear(),u.value&&(h.value=u.value.reduce((er,or)=>(or.views&&Array.isArray(or.views)&&or.views.forEach(Or=>{Or.filters&&Array.isArray(Or.filters)&&er.set(Or.id,Or)}),er),new Map))}catch(Yt){console.error("Error al obtener datos:",Yt)}});function Jt(){document.querySelectorAll(".field-menu .option-card").forEach(St=>{const Yt=St.querySelector(".option-img");if(!Yt||!Yt.dataset.hoverSrc)return;const er=Yt.src,or=Yt.dataset.hoverSrc;St.addEventListener("mouseenter",()=>{Yt.src=or}),St.addEventListener("mouseleave",()=>{Yt.src=er})})}t.onUnmounted(()=>{document.removeEventListener("click",dt)}),Sd.on("set-filter-and-views-container",St=>{i=St,St&&lt(St)}),Sd.on("view-added",()=>{k.value=!0,T.value=!0}),Sd.on("component-added-to-container",St=>{(!a.value||i&&St.id===i.id)&&lt(St)}),Sd.on("edit-view",St=>{var Yt,er,or,Or,Pr,sn,qn,jn,ba,fa,Ia,en,Ur,mn,Vn,Jn,Cn,Xr,un,kr,dn,Gn,Dn;console.log("on edit-view event received for view:",St),p=St,i=((Yt=St.view)==null?void 0:Yt.filterAndViewsContainer)||null,c=null;const oa=[(or=(er=St.view)==null?void 0:er.coreView)==null?void 0:or.filtersJSON,(Or=St.view)==null?void 0:Or.filtersJSON,(Pr=St.coreView)==null?void 0:Pr.filtersJSON,St.filtersJSON,(qn=(sn=St.view)==null?void 0:sn.componentProps)==null?void 0:qn.filtersJSON];for(const Yn of oa)if(Yn){c=Yn;break}if(i&&(i.viewId===4||i.viewId===8||i.viewId===3||i.viewId===1||i.viewId===2||i.viewId===13)&&(jn=St.view)!=null&&jn.id){const Yn=i.getComponentDynamicFilters(St.view.id);if(Yn){let qr="Unknown";i.viewId===4?qr="Timeline":i.viewId===8?qr="FieldPosesion":i.viewId===3?qr="GSCMatchSummary":i.viewId===1?qr="GSCComparativeReports":i.viewId===2?qr="GscTopPlayer":i.viewId===13&&(qr="GSCTimelapseTable"),c&&(i.viewId===13?c={...c,dynamicFilters:Yn}:c={...c,dynamicFilters:Yn.map((wr,En)=>Array.isArray(wr)?{selectedValue:wr,selectedOptions:wr.map(na=>({value:na,label:na}))}:typeof wr=="boolean"?{isChecked:wr}:qr==="GSCComparativeReports"&&En===0?{selectedValue:wr,selectedOptions:[{value:wr,label:wr}]}:qr==="GscTopPlayer"&&En===0?{selectedValue:wr,selectedOptions:[{value:wr,label:wr}]}:qr==="GscTopPlayer"&&En===1?{selectedOption:{value:wr,label:wr}}:{selectedOption:{value:wr,label:wr}})})}}if(i&&i.viewId===2&&(ba=St.view)!=null&&ba.filterMultiple){if(St.view.filterMultiple.categoryId&&c){const Yn=c.dynamicFilters.findIndex(qr=>qr.filterType==="select-simple"&&qr.filterLabel==="Tipo de análisis");Yn!==-1&&(c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedValue:St.view.filterMultiple.categoryId,selectedOptions:[{value:St.view.filterMultiple.categoryId,label:`Category ${St.view.filterMultiple.categoryId}`}]})}if(St.view.filterMultiple.teamType!==void 0&&c){const Yn=c.dynamicFilters.findIndex(qr=>qr.filterType==="radio-button");if(Yn!==-1){const qr=St.view.filterMultiple.teamType,wr=qr===1?"Mi equipo":qr===2?"Rival":qr===3?"Ambos":"Equipo";c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedOption:{value:qr,label:wr}}}}}if(i&&i.viewId===1&&(fa=St.view)!=null&&fa.filterMultiple&&St.view.filterMultiple.category&&c){const Yn=c.dynamicFilters.findIndex(qr=>qr.filterType==="select-simple"&&qr.filterLabel==="Tipo de análisis");Yn!==-1&&(c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedValue:St.view.filterMultiple.category,selectedOptions:[{value:St.view.filterMultiple.category,label:St.view.filterMultiple.category}]})}if(i&&i.viewId===9&&(Ia=St.view)!=null&&Ia.filterMultiple){if(St.view.filterMultiple.categoryIds&&c){const Yn=c.dynamicFilters.findIndex(qr=>qr.filterType==="select"&&qr.filterLabel==="Tipo de análisis");if(Yn!==-1){const qr=Array.isArray(St.view.filterMultiple.categoryIds)?St.view.filterMultiple.categoryIds:[St.view.filterMultiple.categoryIds];c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedValue:qr,selectedOptions:qr.map(na=>({value:na,label:`Category ${na}`}))};const wr=St.view.filterMultiple.categoryIds;hr(wr,qr);const En=(((en=P.value[Yn])==null?void 0:en.options)||[]).filter(na=>Array.isArray(na.value)?hr(na.value,qr):qr.includes(na.value));if(En.length>0){const na=En[0];c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedValue:na.value,selectedOptions:[na]}}}}if(St.view.filterMultiple.isHomeTeam!==void 0&&c){const Yn=c.dynamicFilters.findIndex(qr=>qr.filterType==="radio-button");if(Yn!==-1){const qr=St.view.filterMultiple.isHomeTeam;let wr,En;typeof qr=="boolean"?(wr=qr?1:2,En=qr?"Mi equipo":"Rival"):typeof qr=="number"?(wr=qr===1?1:2,En=qr===1?"Mi equipo":"Rival"):(wr=1,En="Mi equipo"),c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedOption:{value:wr,label:En}}}}}if(i&&i.viewId===6&&(Ur=St.view)!=null&&Ur.filterMultiple&&St.view.filterMultiple.gameNumber&&c){const Yn=c.dynamicFilters.findIndex(qr=>qr.filterType==="select-simple"&&qr.filterLabel==="Número de juego");Yn!==-1&&(c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedValue:St.view.filterMultiple.gameNumber,selectedOptions:[{value:St.view.filterMultiple.gameNumber,label:`Juego ${St.view.filterMultiple.gameNumber}`}]})}if(i&&i.viewId===7&&St.view&&c){if((mn=St.view.componentProps)!=null&&mn.analysisType){const Yn=c.dynamicFilters.findIndex((qr,wr)=>qr.filterType==="radio-button"&&wr===0);if(Yn!==-1){const qr=St.view.componentProps.analysisType,wr=qr==="offensive"?1:2,En=qr==="offensive"?"A favor":"En contra";c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedOption:{value:wr,label:En}}}}if(((Vn=St.view.filterMultiple)==null?void 0:Vn.isHomeTeam)!==void 0){const Yn=c.dynamicFilters.findIndex(qr=>qr.filterType==="radio-button"&&qr.filterLabel==="Equipo");if(Yn!==-1){const qr=St.view.filterMultiple.isHomeTeam,wr=qr?1:2,En=qr?"Equipo propio":"Equipo rival";c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedOption:{value:wr,label:En}}}}}if(i&&i.viewId===10&&(Jn=St.view)!=null&&Jn.filterMultiple&&((Xr=(Cn=p==null?void 0:p.view)==null?void 0:Cn.coreView)==null?void 0:Xr.id)===10){const Yn=St.view.componentProps.isHomeTeamForAnalysis?{label:"Equipo propio",value:1}:{label:"Rival",value:2};c&&(c.dynamicFilters[0]={...c.dynamicFilters[0],selectedOption:Yn})}if(i&&i.viewId===15&&(un=St.view)!=null&&un.id){const Yn=i.getComponentDynamicFilters(St.view.id);if(Yn&&c)c={...c,dynamicFilters:Yn.map((qr,wr)=>{var En,na;if(wr===0){let ma=qr;if(qr===3&&((na=(En=St.view)==null?void 0:En.filterMultiple)==null?void 0:na.isHomeTeam)!==void 0){const ea=St.view.filterMultiple.isHomeTeam;typeof ea=="boolean"?ma=ea?1:2:typeof ea=="number"&&(ma=ea===1?1:2)}return{selectedOption:{value:ma,label:ma===1?"Mi equipo":"Rival"}}}else if(wr===1)return{selectedValue:qr,selectedOptions:[{value:qr,label:`${qr} fortalezas`}]};return typeof qr=="number"?{selectedValue:qr}:{selectedOption:{value:qr,label:String(qr)}}})};else if((kr=St.view)!=null&&kr.filterMultiple&&c&&St.view.filterMultiple.isHomeTeam!==void 0){const qr=c.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button"&&wr.filterLabel==="Mi equipo");if(qr!==-1){const wr=St.view.filterMultiple.isHomeTeam;let En,na;typeof wr=="boolean"?(En=wr?1:2,na=wr?"Local":"Visitante"):typeof wr=="number"?(En=wr===1?1:2,na=wr===1?"Local":"Visitante"):(En=1,na="Local"),c.dynamicFilters[qr]={...c.dynamicFilters[qr],selectedOption:{value:En,label:na}}}}}if(i&&i.viewId===17&&(dn=St.view)!=null&&dn.id){const Yn=i.getComponentDynamicFilters(St.view.id);if(Yn&&c)console.log("Edit filters opt 1",c),c={...c,dynamicFilters:Yn.map((qr,wr)=>{var En,na,ma,ea,Ha,Pa;const Ya=(En=P.value)==null?void 0:En[wr];if(Ya&&Ya.type==="radio-button"){let Aa=qr;if(qr===3&&((ma=(na=St.view)==null?void 0:na.filterMultiple)==null?void 0:ma.isHomeTeam)!==void 0){const Da=St.view.filterMultiple.isHomeTeam;typeof Da=="boolean"?Aa=Da?1:2:typeof Da=="number"&&(Aa=Da===1?1:2)}return{selectedOption:{value:Aa,label:Aa===1?"Mi equipo":Aa===2?"Rival":"Ambos"}}}else if(wr===2){let Aa=qr;if((qr===3||qr!==1&&qr!==2&&(ea=St.view)!=null&&ea.filterMultiple)&&((Pa=(Ha=St.view)==null?void 0:Ha.filterMultiple)==null?void 0:Pa.isHomeTeam)!==void 0){const Da=St.view.filterMultiple.isHomeTeam;typeof Da=="boolean"?Aa=Da?1:2:typeof Da=="number"&&(Aa=Da===1?1:2)}return Ya&&Ya.type==="select-simple"?{selectedValue:Aa,selectedOptions:[{value:Aa,label:String(Aa)}]}:Ya&&Ya.type==="radio-button"?{selectedOption:{value:Aa,label:Aa===1?"Mi equipo":Aa===2?"Rival":"Ambos"}}:typeof Aa=="number"?{selectedValue:Aa}:{selectedOption:{value:Aa,label:String(Aa)}}}else{if(Ya&&Ya.type==="switch")return typeof qr=="boolean"?{selectedValue:qr}:{selectedValue:qr};if(Ya&&Ya.type==="check")return typeof qr=="boolean"?{selectedValue:qr}:{selectedValue:qr}}return Array.isArray(qr)?{selectedValue:qr,selectedOptions:qr.map(Aa=>({value:Aa,label:String(Aa)}))}:typeof qr=="boolean"?{selectedValue:qr}:typeof qr=="object"&&qr!==null?qr:typeof qr=="number"?{selectedValue:qr}:{selectedOption:{value:qr,label:String(qr)}}})},console.log("Edit filters opt 1 finla --->",c);else if((Gn=St.view)!=null&&Gn.filterMultiple&&c&&(console.log("Edit filters opt 1 multiple"),St.view.filterMultiple.isHomeTeam!==void 0)){const qr=c.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button");if(qr!==-1){const wr=St.view.filterMultiple.isHomeTeam;let En,na;typeof wr=="boolean"?(En=wr?1:2,na=wr?"Mi equipo":"Rival"):typeof wr=="number"?(En=wr===1?1:2,na=wr===1?"Mi equipo":"Rival"):(En=1,na="Mi equipo"),c.dynamicFilters[qr]={...c.dynamicFilters[qr],selectedOption:{value:En,label:na}}}}}if(i&&i.viewId===5&&(Dn=St.view)!=null&&Dn.filterMultiple&&St.view.filterMultiple.isHomeTeam!==void 0&&c){const Yn=c.dynamicFilters.findIndex(qr=>qr.filterType==="radio-button"&&qr.filterLabel==="Equipo");if(Yn!==-1){const qr=St.view.filterMultiple.isHomeTeam;let wr,En;typeof qr=="boolean"?(wr=qr?1:2,En=qr?"Equipo propio":"Equipo rival"):typeof qr=="number"?(wr=qr===1?1:2,En=qr===1?"Equipo propio":"Equipo rival"):(wr=1,En="Equipo propio"),c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedOption:{value:wr,label:En}}}else{const qr=c.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button");if(qr!==-1){const wr=St.view.filterMultiple.isHomeTeam;let En,na;typeof wr=="boolean"?(En=wr?1:2,na=wr?"Equipo propio":"Equipo rival"):typeof wr=="number"?(En=wr===1?1:2,na=wr===1?"Equipo propio":"Equipo rival"):(En=1,na="Equipo propio"),c.dynamicFilters[qr]={...c.dynamicFilters[qr],selectedOption:{value:En,label:na}}}}}c&&Ot(c),k.value=!0});function Qt(){ge.value=null}function sr(St,Yt){var er;(er=L.value)==null||er.id}function hr(St,Yt){if(!Array.isArray(St)||!Array.isArray(Yt)||St.length!==Yt.length)return!1;const er=[...St].sort((Or,Pr)=>Or-Pr),or=[...Yt].sort((Or,Pr)=>Or-Pr);return JSON.stringify(er)===JSON.stringify(or)}function $t(){if(a.value&&c&&c.dynamicFilters){if(o.value||x.value)return;o.value=!0,d.value=!0,c.dynamicFilters.forEach((St,Yt)=>{var er;if(St&&(er=P.value)!=null&&er[Yt]){const or=P.value[Yt];if(or.type==="check"&&St.isChecked!==void 0)E.value[Yt]=St.isChecked;else if(or.type==="select"&&St.selectedOptions){const Or=St.selectedOptions.map(Pr=>Pr.value);E.value[Yt]=Or}else or.type==="select"&&St.selectedValue&&Array.isArray(St.selectedValue)&&(E.value[Yt]=St.selectedValue)}}),t.nextTick(()=>{d.value=!1,o.value=!1})}}function Rt(){var St;if(a.value&&c&&c.dynamicFilters&&((St=L.value)==null?void 0:St.id)===4){if(o.value||x.value)return;o.value=!0,d.value=!0,c.dynamicFilters.forEach((Yt,er)=>{var or,Or;if(Yt&&((Or=(or=P.value)==null?void 0:or[er])==null?void 0:Or.type)==="select"){if(Yt.selectedOptions){const Pr=Yt.selectedOptions.map(sn=>sn.value);E.value[er]=Pr}else if(Yt.selectedValue&&Array.isArray(Yt.selectedValue))if(Yt.selectedValue.length>0&&Yt.selectedValue[0]&&typeof Yt.selectedValue[0]=="object"){const Pr=lr(Yt.selectedValue);E.value[er]=Pr}else E.value[er]=Yt.selectedValue}}),setTimeout(()=>{var Yt;if(E.value=[...E.value],(Yt=p==null?void 0:p.view)!=null&&Yt.componentProps&&E.value&&E.value.length>0){const er=E.value[0];if(Array.isArray(er)&&er.length>0){const or=er.some(qn=>qn.event_type_id===1||typeof qn=="string"&&qn.includes("1")),Or=er.some(qn=>qn.category_id===8||typeof qn=="string"&&qn.includes("8")),Pr=er.some(qn=>qn.category_id===9||typeof qn=="string"&&qn.includes("9")),sn=er.some(qn=>qn.event_type_id===3||typeof qn=="string"&&qn.includes("3"));p.view.componentProps.selectedEvents=er,p.view.componentProps.goals=or,p.view.componentProps.yellowCards=Or,p.view.componentProps.redCards=Pr,p.view.componentProps.substitutions=sn,p.view.componentProps.key=er.length>0,p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}},200),t.nextTick(()=>{d.value=!1,o.value=!1})}}function lr(St){return!Array.isArray(St)||St.length===0?[]:St.map(Yt=>{if(Yt&&typeof Yt=="object"){if(Yt.event_type_id!==void 0||Yt.category_id!==void 0)return{event_type_id:Yt.event_type_id,category_id:Yt.category_id,...Yt.name&&{name:Yt.name},...Yt.label&&{label:Yt.label}};if(Yt.value&&typeof Yt.value=="object")return{event_type_id:Yt.value.event_type_id,category_id:Yt.value.category_id,...Yt.value.name&&{name:Yt.value.name},...Yt.value.label&&{label:Yt.value.label}};if(typeof Yt=="string"&&Yt.includes("-")){const[er,or]=Yt.split("-");return{category_id:parseInt(er),event_type_id:parseInt(or)}}}if(typeof Yt=="string")if(Yt.includes("-")){const[er,or]=Yt.split("-");return{category_id:parseInt(er),event_type_id:parseInt(or)}}else{const er=parseInt(Yt);if(!isNaN(er))return{event_type_id:er}}return Yt})}function Zt(){var St,Yt,er,or,Or,Pr,sn,qn,jn,ba,fa,Ia,en,Ur,mn,Vn;if(a.value&&c&&c.dynamicFilters&&P.value){if(o.value||x.value)return;if(o.value=!0,d.value=!0,c.dynamicFilters.forEach((Jn,Cn)=>{var Xr,un,kr,dn,Gn,Dn,oa,Yn,qr,wr,En;if(Jn&&((Xr=P.value[Cn])==null?void 0:Xr.type)==="select"){if(Jn.selectedOptions){const na=Jn.selectedOptions.map(ma=>ma.value);E.value[Cn]=na}else if(Jn.selectedValue&&Array.isArray(Jn.selectedValue))if(Jn.selectedValue.length>0&&Jn.selectedValue[0]&&typeof Jn.selectedValue[0]=="object"){const na=lr(Jn.selectedValue);E.value[Cn]=na}else E.value[Cn]=Jn.selectedValue}else if(Jn&&((un=P.value[Cn])==null?void 0:un.type)==="select-simple"&&Jn.selectedValue!==void 0){let na;((kr=L.value)==null?void 0:kr.id)===2&&(Gn=(dn=p==null?void 0:p.view)==null?void 0:dn.filterMultiple)!=null&&Gn.categoryId?na=p.view.filterMultiple.categoryId:((Dn=L.value)==null?void 0:Dn.id)===1&&(Yn=(oa=p==null?void 0:p.view)==null?void 0:oa.filterMultiple)!=null&&Yn.category?na=p.view.filterMultiple.category:((qr=L.value)==null?void 0:qr.id)===6&&(En=(wr=p==null?void 0:p.view)==null?void 0:wr.filterMultiple)!=null&&En.gameNumber?na=p.view.filterMultiple.gameNumber:na=Array.isArray(Jn.selectedValue)?Jn.selectedValue[0]:Jn.selectedValue,E.value[Cn]=na}}),((St=L.value)==null?void 0:St.id)===4&&setTimeout(()=>{var Jn;if(E.value=[...E.value],(Jn=p==null?void 0:p.view)!=null&&Jn.componentProps&&E.value&&E.value.length>0){const Cn=E.value[0];if(Array.isArray(Cn)&&Cn.length>0){const Xr=Cn.some(Gn=>Gn.event_type_id===1||typeof Gn=="string"&&Gn.includes("1")),un=Cn.some(Gn=>Gn.category_id===8||typeof Gn=="string"&&Gn.includes("8")),kr=Cn.some(Gn=>Gn.category_id===9||typeof Gn=="string"&&Gn.includes("9")),dn=Cn.some(Gn=>Gn.event_type_id===3||typeof Gn=="string"&&Gn.includes("3"));p.view.componentProps.selectedEvents=Cn,p.view.componentProps.goals=Xr,p.view.componentProps.yellowCards=un,p.view.componentProps.redCards=kr,p.view.componentProps.substitutions=dn,p.view.componentProps.key=Cn.length>0,p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}},100),((Yt=L.value)==null?void 0:Yt.id)===2&&(er=p==null?void 0:p.view)!=null&&er.filterMultiple){if(p.view.filterMultiple.categoryId){const Jn=P.value.findIndex(Cn=>Cn.type==="select-simple"&&Cn.label==="Tipo de análisis");if(Jn!==-1){const Cn=p.view.filterMultiple.categoryId;if(E.value[0]=Cn,p.view.componentProps&&Cn){let Xr=`Category ${Cn}`,un=null;try{un=A4(Cn),un&&(Xr=un.name)}catch{const kr=P.value.findIndex(dn=>dn.type==="select-simple"&&dn.label==="Tipo de análisis");if(kr!==-1){const dn=(((or=P.value[kr])==null?void 0:or.options)||[]).find(Gn=>Gn.value==Cn);dn&&(Xr=dn.label)}}p.view.componentProps.categoryView=[{id:Cn,name:Xr}]}(((Or=P.value[Jn])==null?void 0:Or.options)||[]).find(Xr=>Xr.value==Cn),t.nextTick(()=>{E.value=[...E.value]})}}if(p.view.filterMultiple.teamType!==void 0){const Jn=P.value.findIndex(Cn=>Cn.type==="radio-button");if(Jn!==-1){const Cn=p.view.filterMultiple.teamType;E.value[Jn]=Cn,(((Pr=P.value[Jn])==null?void 0:Pr.options)||[]).find(Xr=>Xr.value==Cn),t.nextTick(()=>{E.value=[...E.value]})}}}if(((sn=L.value)==null?void 0:sn.id)===1&&(qn=p==null?void 0:p.view)!=null&&qn.filterMultiple&&p.view.filterMultiple.category&&P.value.findIndex(Jn=>Jn.type==="select-simple"&&Jn.label==="Tipo de análisis")!==-1){const Jn=p.view.filterMultiple.category;E.value[0]=Jn,p.view.componentProps&&Jn&&(p.view.componentProps.type=Jn),t.nextTick(()=>{E.value=[...E.value]})}if(((jn=L.value)==null?void 0:jn.id)===6&&(ba=p==null?void 0:p.view)!=null&&ba.filterMultiple&&p.view.filterMultiple.gameNumber&&P.value.findIndex(Jn=>Jn.type==="select-simple"&&Jn.label==="Número de juego")!==-1){const Jn=p.view.filterMultiple.gameNumber;E.value[0]=Jn,p.view.componentProps&&Jn&&(p.view.componentProps.gameNumber=Jn),t.nextTick(()=>{E.value=[...E.value]})}if(((fa=L.value)==null?void 0:fa.id)===5&&(Ia=p==null?void 0:p.view)!=null&&Ia.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0)if(P.value.findIndex(Jn=>Jn.type==="radio-button"&&Jn.label==="Equipo")!==-1){const Jn=p.view.filterMultiple.isHomeTeam;let Cn;typeof Jn=="boolean"?Cn=Jn?1:2:typeof Jn=="number"?Cn=Jn===1?1:2:Cn=1,E.value[0]=Cn,p.view.componentProps&&Jn!==void 0&&(p.view.componentProps.isHomeTeamForAnalysis=Jn===1),t.nextTick(()=>{E.value=[...E.value]})}else{const Jn=P.value.findIndex(Cn=>Cn.type==="radio-button");if(Jn!==-1){const Cn=p.view.filterMultiple.isHomeTeam;let Xr;typeof Cn=="boolean"?Xr=Cn?1:2:typeof Cn=="number"?Xr=Cn===1?1:2:Xr=1,E.value[Jn]=Xr,p.view.componentProps&&Cn!==void 0&&(p.view.componentProps.preMatchType=Cn),t.nextTick(()=>{E.value=[...E.value]})}}if(((en=L.value)==null?void 0:en.id)===15&&(Ur=p==null?void 0:p.view)!=null&&Ur.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0){const Jn=P.value.findIndex(Cn=>Cn.type==="radio-button");if(Jn!==-1){const Cn=p.view.filterMultiple.isHomeTeam;console.log("Strengths forceRadioFilterUpdate - isHomeTeam:",Cn,"type:",typeof Cn);let Xr;typeof Cn=="boolean"?Xr=Cn?1:2:typeof Cn=="number"?Xr=Cn===1?1:2:Xr=1,console.log("Strengths forceRadioFilterUpdate - teamValue calculado:",Xr,"teamFilterIndex:",Jn),E.value[Jn]=Xr,p.view.componentProps&&Cn!==void 0&&(p.view.componentProps.preMatchType=Xr),t.nextTick(()=>{E.value=[...E.value],console.log("Strengths forceRadioFilterUpdate - dynamicFilters.value después:",E.value)})}else{const Cn=P.value.findIndex(Xr=>Xr.type==="radio-button");if(Cn!==-1){const Xr=p.view.filterMultiple.isHomeTeam;let un;typeof Xr=="boolean"?un=Xr?1:2:typeof Xr=="number"?un=Xr===1?1:2:un=1,E.value[Cn]=un,p.view.componentProps&&Xr!==void 0&&(p.view.componentProps.preMatchType=un),t.nextTick(()=>{E.value=[...E.value]})}}}if(((mn=L.value)==null?void 0:mn.id)===17&&(Vn=p==null?void 0:p.view)!=null&&Vn.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0){const Jn=P.value.findIndex(Cn=>Cn.type==="radio-button");if(Jn!==-1){const Cn=p.view.filterMultiple.isHomeTeam;let Xr;typeof Cn=="boolean"?Xr=Cn?1:2:typeof Cn=="number"?Xr=Cn===1?1:2:Xr=1,E.value[Jn]=Xr,p.view.componentProps&&Cn!==void 0&&(p.view.componentProps.teamselected=Xr),t.nextTick(()=>{E.value=[...E.value]})}else{const Cn=P.value.findIndex(Xr=>Xr.type==="radio-button");if(Cn!==-1){const Xr=p.view.filterMultiple.isHomeTeam;let un;typeof Xr=="boolean"?un=Xr?1:2:typeof Xr=="number"?un=Xr===1?1:2:un=1,E.value[Cn]=un,p.view.componentProps&&Xr!==void 0&&(p.view.componentProps.teamselected=un),t.nextTick(()=>{E.value=[...E.value]})}}}t.nextTick(()=>{d.value=!1,o.value=!1})}}function Tt(){if(!o.value&&a.value&&c&&c.dynamicFilters&&P.value){if(x.value)return;o.value=!0,d.value=!0,c.dynamicFilters.forEach((St,Yt)=>{var er;if(St&&((er=P.value[Yt])==null?void 0:er.type)==="radio-button"&&St.selectedOption&&St.selectedOption.value!==void 0){const or=St.selectedOption.value;E.value[Yt]=or}}),t.nextTick(()=>{d.value=!1,o.value=!1})}}function Pt(){var St,Yt,er,or,Or,Pr,sn,qn,jn,ba,fa,Ia,en,Ur,mn,Vn,Jn,Cn,Xr,un,kr,dn,Gn,Dn,oa,Yn,qr,wr,En,na,ma,ea,Ha,Pa,Ya;if(i&&a.value&&p){if(x.value)return;if(d.value=!0,((St=L.value)==null?void 0:St.id)===4){if(i.setDynamicFilters(E.value,(Yt=p.view)==null?void 0:Yt.id),i.updateDynamicFilters(E.value,(er=p.view)==null?void 0:er.id),p.view.componentProps&&E.value&&E.value.length>0){const Aa=E.value[0];if(Array.isArray(Aa)&&Aa.length>0){const Da=Aa.some(So=>So.event_type_id===1||typeof So=="string"&&So.includes("1")),Ni=Aa.some(So=>So.category_id===8||typeof So=="string"&&So.includes("8")),Pi=Aa.some(So=>So.category_id===9||typeof So=="string"&&So.includes("9")),Po=Aa.some(So=>So.event_type_id===3||typeof So=="string"&&So.includes("3"));p.view.componentProps.selectedEvents=Aa,p.view.componentProps.goals=Da,p.view.componentProps.yellowCards=Ni,p.view.componentProps.redCards=Pi,p.view.componentProps.substitutions=Po,p.view.componentProps.key=Aa.length>0,p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}}else if(((or=L.value)==null?void 0:or.id)===8)i.setDynamicFilters(E.value,(Or=p.view)==null?void 0:Or.id),i.updateDynamicFilters(E.value,(Pr=p.view)==null?void 0:Pr.id);else if(((sn=L.value)==null?void 0:sn.id)===3)i.setDynamicFilters(E.value,(qn=p.view)==null?void 0:qn.id),i.updateDynamicFilters(E.value,(jn=p.view)==null?void 0:jn.id);else if(((ba=L.value)==null?void 0:ba.id)===13){const Aa=(fa=p.view)==null?void 0:fa.id;i.setDynamicFilters(E.value,Aa),i.updateDynamicFilters(E.value,Aa),p.view.componentProps&&(p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps}))}else if(((Ia=L.value)==null?void 0:Ia.id)===15){const Aa=(en=p.view)==null?void 0:en.id;if(i.setDynamicFilters(E.value,Aa),i.updateDynamicFilters(E.value,Aa),p.view.componentProps){const Da=Array.isArray(E.value)&&E.value[3]!==void 0?E.value[3]:null;Da!==null&&(p.view.componentProps.numitems=Da),p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}else if(((Ur=L.value)==null?void 0:Ur.id)===17){const Aa=(mn=p==null?void 0:p.view)==null?void 0:mn.id;i.setDynamicFilters(E.value,Aa),i.updateDynamicFilters(E.value,Aa);const Da=(Ni,Pi)=>{if(!Ni)return;const Po=E.value[0];Po!==void 0&&(Ni.infavoragainstteam=!Po);const So=E.value[1];So!==void 0&&(Ni.lateralidad=So===32?"right":"left");const zo=E.value[2];zo!==void 0&&Pi&&(zo===3||(Ni.teamselected=zo===2?Pi.away_team:Pi.home_team)),Ni._updateKey=Date.now()};if(p&&p.view&&p.view.componentProps){const Ni=p.view.componentProps.game;Da(p.view.componentProps,Ni),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}else if(((Vn=L.value)==null?void 0:Vn.id)===2){i.setDynamicFilters(E.value,(Jn=p.view)==null?void 0:Jn.id),i.updateDynamicFilters(E.value,(Cn=p.view)==null?void 0:Cn.id);const Aa=E.value[0];if(Aa!==void 0&&(p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.categoryId,p.view.filterMultiple.categoryId=Aa,p.view.componentProps)){let Ni=`Category ${Aa}`,Pi=null;try{Pi=A4(Aa),Pi&&(Ni=Pi.name)}catch{const Po=P.value.findIndex(So=>So.type==="select-simple"&&So.label==="Tipo de análisis");if(Po!==-1){const So=(((Xr=P.value[Po])==null?void 0:Xr.options)||[]).find(zo=>zo.value==Aa);So&&(Ni=So.label)}}p.view.componentProps.categoryView=[{id:Aa,name:Ni}],Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple})}const Da=E.value[1];Da!==void 0&&(p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.teamType,p.view.filterMultiple.teamType=Da,p.view.componentProps&&p.view.componentProps.game&&(Da===1?p.view.componentProps.teamView=p.view.componentProps.game.homeTeam.team_id:Da===2?p.view.componentProps.teamView=p.view.componentProps.game.awayTeam.team_id:p.view.componentProps.teamView=0),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}))}else if(((un=L.value)==null?void 0:un.id)===1){i.setDynamicFilters(E.value,(kr=p.view)==null?void 0:kr.id),i.updateDynamicFilters(E.value,(dn=p.view)==null?void 0:dn.id);const Aa=E.value[0];Aa!==void 0&&(p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.category,p.view.filterMultiple.category=Aa,p.view.componentProps&&(p.view.componentProps.type=Aa),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}))}else if(((Gn=L.value)==null?void 0:Gn.id)===6){i.setDynamicFilters(E.value,(Dn=p.view)==null?void 0:Dn.id),i.updateDynamicFilters(E.value,(oa=p.view)==null?void 0:oa.id);const Aa=E.value[0];Aa!==void 0&&(p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.gameNumber,p.view.filterMultiple.gameNumber=Aa,p.view.componentProps&&(p.view.componentProps.gameNumber=Aa,p.view._updateKey,p.view._updateKey=Date.now()),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}),Sd.emit("dynamic-filters-changed",{containerViewId:(Yn=L.value)==null?void 0:Yn.id,viewId:p.view.id,dynamicFilters:E.value}),Sd.emit("component-props-updated",{viewId:p.view.id,componentProps:p.view.componentProps,dynamicFilters:E.value}),t.nextTick(()=>{p.view.componentProps&&(p.view.componentProps={...p.view.componentProps})}))}else if(((qr=L.value)==null?void 0:qr.id)===7){i.setDynamicFilters(E.value,(wr=p.view)==null?void 0:wr.id),i.updateDynamicFilters(E.value,(En=p.view)==null?void 0:En.id);const Aa=E.value[0],Da=E.value[1];if(Aa!==void 0&&p.view.componentProps){const Ni=Aa===1?"offensive":"defensive";p.view.componentProps.analysisType=Ni}if(Da!==void 0){p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.isHomeTeam;const Ni=Da===1;p.view.filterMultiple.isHomeTeam=Ni,p.view.componentProps&&(p.view.componentProps.isHomeTeamForAnalysis=Ni,p.view._updateKey,p.view._updateKey=Date.now()),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}),Sd.emit("dynamic-filters-changed",{containerViewId:(na=L.value)==null?void 0:na.id,viewId:p.view.id,dynamicFilters:E.value}),Sd.emit("component-props-updated",{viewId:p.view.id,componentProps:p.view.componentProps,dynamicFilters:E.value}),t.nextTick(()=>{p.view.componentProps&&(p.view.componentProps={...p.view.componentProps})})}}else if(((ma=L.value)==null?void 0:ma.id)===5){i.setDynamicFilters(E.value,(ea=p.view)==null?void 0:ea.id),i.updateDynamicFilters(E.value,(Ha=p.view)==null?void 0:Ha.id);const Aa=E.value[0];if(Aa!==void 0){p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.isHomeTeam;const Da=Aa===1?1:2;p.view.filterMultiple.isHomeTeam=Da,p.view.componentProps&&(p.view.componentProps.isHomeTeamForAnalysis=Da===1,p.view._updateKey,p.view._updateKey=Date.now()),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}),Sd.emit("dynamic-filters-changed",{containerViewId:(Pa=L.value)==null?void 0:Pa.id,viewId:p.view.id,dynamicFilters:E.value}),Sd.emit("component-props-updated",{viewId:p.view.id,componentProps:p.view.componentProps,dynamicFilters:E.value}),t.nextTick(()=>{p.view.componentProps&&(p.view.componentProps={...p.view.componentProps})})}}else((Ya=L.value)==null?void 0:Ya.id)===9||(i.setDynamicFilters(E.value),i.updateDynamicFilters(E.value));t.nextTick(()=>{d.value=!1})}}function It(){var St,Yt;if(!c||!c.dynamicFilters||!P.value)return!1;for(let er=0;er<c.dynamicFilters.length;er++){const or=c.dynamicFilters[er],Or=P.value[er],Pr=E.value[er];if(!(!or||!Or)){if(Or.type==="check"){if(or.isChecked!==Pr)return!0}else if(Or.type==="radio-button"){if(((St=or.selectedOption)==null?void 0:St.value)!==Pr)return!0}else if(Or.type==="select"){const sn=((Yt=or.selectedOptions)==null?void 0:Yt.map(jn=>jn.value))||or.selectedValue||[],qn=Array.isArray(Pr)?Pr:[];if(JSON.stringify(sn)!==JSON.stringify(qn))return!0}}}return!1}function vr(St){var Yt,er,or,Or,Pr,sn,qn,jn,ba,fa,Ia,en,Ur,mn,Vn,Jn,Cn;if(E.value=St.filters,i){const Xr=((Yt=p==null?void 0:p.view)==null?void 0:Yt.id)||null;i.setDynamicFilters(E.value,Xr),i.updateDynamicFilters(E.value,Xr)}if(a.value&&p&&(Sd.emit("activate-save-button"),Sd.emit("force-component-update",{itemId:((er=p==null?void 0:p.view)==null?void 0:er.id)||null,componentProps:p.view.componentProps}),Sd.emit("dynamic-filters-changed",{containerViewId:((or=p==null?void 0:p.view)==null?void 0:or.id)||null,viewId:((Or=p==null?void 0:p.view)==null?void 0:Or.id)||null,dynamicFilters:E.value}),Sd.emit("dynamic-filters-changed",{containerViewId:((Pr=p==null?void 0:p.view)==null?void 0:Pr.id)||null,viewId:((sn=p==null?void 0:p.view)==null?void 0:sn.id)||null,dynamicFilters:E.value}),t.nextTick(()=>{p.view.componentProps&&(p.view.componentProps={...p.view.componentProps})})),!a.value&&i&&(((qn=L.value)==null?void 0:qn.id)===15||((jn=L.value)==null?void 0:jn.id)===17)&&i.getRequiresAddView(E.value,P.value)){i.setDynamicFilters(E.value),$("filters-changed",{main:f.value,view:L.value,team:Y.value,dynamicFilters:E.value,filtersJSON:{mainSelector:{id:((ba=f.value)==null?void 0:ba.id)||null,name:((fa=f.value)==null?void 0:fa.name)||null,url:((Ia=f.value)==null?void 0:Ia.url)||null},viewSelector:{id:((en=L.value)==null?void 0:en.id)||null,name:((Ur=L.value)==null?void 0:Ur.name)||((mn=L.value)==null?void 0:mn.title)||null,url:((Vn=L.value)==null?void 0:Vn.url)||null},team:Y.value,dynamicFilters:E.value,timestamp:new Date().toISOString(),summary:{mainSelected:!!f.value,viewSelected:!!L.value,totalDynamicFilters:((Jn=P.value)==null?void 0:Jn.length)||0,activeFilters:((Cn=P.value)==null?void 0:Cn.filter((Xr,un)=>{const kr=E.value[un];return Array.isArray(kr)?kr.length>0:kr!=null&&kr!==!1}).length)||0}},filterAndViewsContainer:i,viewToEdit:p}),Ye();return}Pt()}function ur(St){St.filterIndex!==void 0&&St.value!==void 0&&(E.value[St.filterIndex]=St.value,a.value&&Pt(),Ye())}function gr(){Gt()}function Tr(St){var Yt,er,or,Or,Pr,sn,qn;console.log("newFilters in onChangeFiltersAltMode:",St);const jn={mainSelector:{id:((Yt=f.value)==null?void 0:Yt.id)||null,name:((er=f.value)==null?void 0:er.name)||null,url:((or=f.value)==null?void 0:or.url)||null},viewSelector:{id:((Or=L.value)==null?void 0:Or.id)||null,name:((Pr=L.value)==null?void 0:Pr.name)||((sn=L.value)==null?void 0:sn.title)||null,url:((qn=L.value)==null?void 0:qn.url)||null}};$("filters-changed",{filters:St.filters,view:St.view,viewToEdit:p,filterAndViewsContainer:i,filtersJSON:jn,isAltMode:!0})}function Rr(St){return JSON.parse(JSON.stringify(St))}return(St,Yt)=>(t.openBlock(),t.createElementBlock("div",Vrt,[t.createElementVNode("button",Prt,t.toDisplayString(a.value?"Editando visualización":"Nueva visualización"),1),t.createElementVNode("div",{class:t.normalizeClass([{disabled:a.value},"custom-select main-select"]),onClick:_e},[t.createElementVNode("div",Art,[t.createElementVNode("span",Rrt,[f.value?(t.openBlock(),t.createElementBlock("img",{key:0,src:xe(f.value.name,!1),alt:"icono",class:"option-img"},null,8,Urt)):(t.openBlock(),t.createElementBlock("img",Frt))]),f.value?(t.openBlock(),t.createElementBlock("span",qrt,t.toDisplayString(Pe()),1)):(t.openBlock(),t.createElementBlock("span",Irt,"Tipo de vista")),t.createElementVNode("span",{class:t.normalizeClass([{open:se.value},"arrow"])},[...Yt[5]||(Yt[5]=[t.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),se.value?(t.openBlock(),t.createElementBlock("div",jrt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,(er,or)=>(t.openBlock(),t.createElementBlock("div",{key:er.id,class:t.normalizeClass([{active:s.value===or},"option-card"]),onClick:t.withModifiers(Or=>qe(or),["stop"])},[t.createElementVNode("div",Wrt,[t.createElementVNode("img",{"data-hover-src":xe(er.name,!0),src:xe(er.name,!1),alt:"icono",class:"option-img-34"},null,8,Krt)]),t.createElementVNode("div",Brt,[t.createElementVNode("div",Xrt,t.toDisplayString(er.name),1),er.description?(t.openBlock(),t.createElementBlock("div",Grt,t.toDisplayString(er.description),1)):t.createCommentVNode("",!0)])],10,Drt))),128))])):t.createCommentVNode("",!0)],2),f.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([{disabled:a.value},"custom-select second-select"]),onClick:Ue},[t.createElementVNode("div",Zrt,[t.createElementVNode("span",Jrt,[L.value?(t.openBlock(),t.createElementBlock("img",{key:0,src:L.value.url,alt:"icono",class:"option-img-graph2"},null,8,Hrt)):f.value?(t.openBlock(),t.createElementBlock("img",{key:1,src:xe(f.value.name,!1),alt:"icono",class:"option-img"},null,8,Yrt)):t.createCommentVNode("",!0)]),t.createElementVNode("span",Qrt,t.toDisplayString(je()),1),t.createElementVNode("span",{class:t.normalizeClass([{open:me.value},"arrow"])},[...Yt[6]||(Yt[6]=[t.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),me.value&&f.value?(t.openBlock(),t.createElementBlock("div",$rt,[t.createElementVNode("div",ent,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g.value,er=>(t.openBlock(),t.createElementBlock("div",{key:er.id,class:t.normalizeClass([{active:S.value===er.id},"option-card-grid"]),onClick:t.withModifiers(or=>Re(er),["stop"])},[er.id===17?(t.openBlock(),t.createElementBlock("div",rnt,[...Yt[7]||(Yt[7]=[t.createElementVNode("div",null,"Tiros de esquina",-1),t.createElementVNode("div",null,"tendencia general",-1)])])):er.id===18?(t.openBlock(),t.createElementBlock("div",nnt,[...Yt[8]||(Yt[8]=[t.createElementVNode("div",null,"Tactica fija",-1),t.createElementVNode("div",null,"jugadas especificas",-1)])])):(t.openBlock(),t.createElementBlock("div",ant,t.toDisplayString(er.name||er.title),1)),t.createElementVNode("div",int,[t.createElementVNode("img",{src:er.url,alt:"icono",class:"option-img-grid"},null,8,ont)])],10,tnt))),128))])])):t.createCommentVNode("",!0)],2)):t.createCommentVNode("",!0),L.value?(t.openBlock(),t.createElementBlock("div",snt)):t.createCommentVNode("",!0),L.value&&L.value.id===13?(t.openBlock(),t.createBlock(jYe,{key:2,"component-id":13,filters:P.value,"initial-values":a.value?t.unref(c).dynamicFilters:E.value,"is-edit-mode":a.value,onFiltersChanged:vr,onFilterUpdated:ur},null,8,["filters","initial-values","is-edit-mode"])):L.value&&L.value.id===16?(t.openBlock(),t.createBlock($Qe,{key:3,"default-filters":t.unref(p)?t.unref(p).view.filterMultiple:null,"is-edit-mode":!!t.unref(p),"is-post-match":e.isPostMatch,"view-config":Rr(h.value.get(16)),onChange:Tr,onRemoveViews:gr},null,8,["default-filters","is-edit-mode","is-post-match","view-config"])):L.value&&L.value.id===18?(t.openBlock(),t.createBlock(aet,{key:4,"default-filters":t.unref(p)?t.unref(p).view.filterMultiple:null,"view-config":Rr(h.value.get(18)),"is-post-match":e.isPostMatch,onChange:Tr,onRemoveViews:gr},null,8,["default-filters","view-config","is-post-match"])):L.value&&L.value.id===15?(t.openBlock(),t.createBlock(iQe,{key:5,"component-id":15,filters:P.value,"initial-values":a.value?t.unref(c).dynamicFilters:E.value,"is-edit-mode":a.value,onFiltersChanged:vr,onFilterUpdated:ur},null,8,["filters","initial-values","is-edit-mode"])):L.value&&L.value.id===17?(t.openBlock(),t.createBlock(zrt,{key:6,"component-id":17,"default-filters":t.unref(p)?t.unref(p).view.filterMultiple:null,filters:P.value,"initial-values":a.value?t.unref(c).dynamicFilters:E.value,"is-edit-mode":a.value,"view-config":Rr(h.value.get(17)),onChange:Tr,onFiltersChanged:vr,onFilterUpdated:ur,onRemoveViews:gr},null,8,["default-filters","filters","initial-values","is-edit-mode","view-config"])):L.value&&P.value&&D()?(t.openBlock(),t.createElementBlock("div",{key:7,class:t.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":P.value.length>=2}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(P.value,(er,or)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:or},[er.type==="select"?(t.openBlock(),t.createElementBlock("div",{key:0,class:"custom-select dynamic-select filter-inline",onClick:t.withModifiers(Or=>We(or),["stop"])},[t.createElementVNode("div",cnt,[Yt[10]||(Yt[10]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.createElementVNode("img",{alt:"icono categorías",src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),Yt[11]||(Yt[11]=t.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),Array.isArray(E.value[or])&&E.value[or].length>0?(t.openBlock(),t.createElementBlock("span",unt,t.toDisplayString(E.value[or].length),1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass([{open:ge.value===or},"arrow"])},[...Yt[9]||(Yt[9]=[t.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),ge.value===or?(t.openBlock(),t.createElementBlock("div",dnt,[t.createElementVNode("div",pnt,[t.createElementVNode("div",{class:"multi-select-header",onClick:Yt[1]||(Yt[1]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("label",hnt,[t.createElementVNode("input",{checked:j(or),indeterminate:U(or),type:"checkbox",onChange:t.withModifiers(Or=>M(or),["stop"]),onClick:Yt[0]||(Yt[0]=t.withModifiers(()=>{},["stop"]))},null,40,fnt),Yt[12]||(Yt[12]=t.createElementVNode("span",{class:"select-all-label"},"Agregar todas",-1))])]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(er.options,Or=>(t.openBlock(),t.createElementBlock("div",{key:Or.value,class:t.normalizeClass([{active:V(or,Or.value)},"option-card multi-select-option"]),onClick:Yt[2]||(Yt[2]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",mnt,[t.createElementVNode("input",{checked:V(or,Or.value),type:"checkbox",onChange:t.withModifiers(Pr=>I(or,Or.value),["stop"])},null,40,ynt)]),t.createElementVNode("div",{class:"option-content",onClick:Pr=>I(or,Or.value)},[t.createElementVNode("div",vnt,t.toDisplayString(Or.label),1)],8,gnt)],2))),128))]),t.createElementVNode("div",bnt,[t.createElementVNode("button",{class:"btn-listo",onClick:Yt[3]||(Yt[3]=t.withModifiers(Or=>Qt(),["stop"]))},"Listo")])])):t.createCommentVNode("",!0)],8,lnt)):er.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",xnt,[t.createElementVNode("div",_nt,t.toDisplayString(er.label),1),t.createElementVNode("div",wnt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(er.options,Or=>(t.openBlock(),t.createElementBlock("label",{key:Or.value,class:t.normalizeClass([{active:E.value[or]===Or.value},"radio-option-card"])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Pr=>E.value[or]=Pr,disabled:X(Or.value,Or.label),name:"dynamic-radio-"+or,value:Or.value,type:"radio",onChange:()=>{var Pr,sn,qn;if(((Pr=L.value.value)==null?void 0:Pr.id)===9&&a.value.value&&(qn=(sn=t.unref(p))==null?void 0:sn.view)!=null&&qn.filterMultiple){const jn=E.value[or]===1;t.unref(p).view.filterMultiple.isHomeTeam=jn}a.value.value&&Pt(),Ye()}},null,40,Tnt),[[t.vModelRadio,E.value[or]]]),t.createElementVNode("span",null,t.toDisplayString(Or.label),1)],2))),128))])])):er.type==="check"?(t.openBlock(),t.createElementBlock("div",Snt,[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Or=>E.value[or]=Or,checked:E.value[or],type:"checkbox",onChange:Yt[4]||(Yt[4]=()=>{a.value.value&&Pt(),Ye()})},null,40,knt),[[t.vModelCheckbox,E.value[or]]]),t.createTextVNode(" "+t.toDisplayString(er.label),1)])])):er.type==="select-simple"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-filter-type":er.type,class:"custom-select dynamic-select filter-inline",onClick:t.withModifiers(Or=>Qe(or),["stop"])},[t.createElementVNode("div",Nnt,[Yt[14]||(Yt[14]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.createElementVNode("img",{alt:"icono categorías",src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),Yt[15]||(Yt[15]=t.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),t.createElementVNode("span",{class:t.normalizeClass([{open:be.value===or},"arrow"])},[...Yt[13]||(Yt[13]=[t.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),be.value===or?(t.openBlock(),t.createElementBlock("div",Ont,[t.createElementVNode("div",Mnt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(er.options,Or=>(t.openBlock(),t.createElementBlock("div",{key:Or.value,class:t.normalizeClass([{active:E.value[or]===Or.value},"option-card simple-select-option"]),onMouseenter:Pr=>sr(or,Or.value),onClick:t.withModifiers(Pr=>rt(or,Or.value),["stop"])},[t.createElementVNode("div",Cnt,[t.createElementVNode("div",znt,t.toDisplayString(Or.label),1)]),E.value[or]===Or.value?(t.openBlock(),t.createElementBlock("div",Vnt,[...Yt[16]||(Yt[16]=[t.createElementVNode("svg",{fill:"none",height:"16",viewBox:"0 0 16 16",width:"16"},[t.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])])):t.createCommentVNode("",!0)],42,Ent))),128))])])):t.createCommentVNode("",!0)],8,Lnt)):t.createCommentVNode("",!0),or===1&&P.value.length>2?(t.openBlock(),t.createElementBlock("div",Pnt)):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0),a.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("button",{key:8,class:"cancel-btn",onClick:Gt},"Cancelar")),k.value?(t.openBlock(),t.createElementBlock("button",{key:9,class:"ok-btn",onClick:qt},"OK")):t.createCommentVNode("",!0)]))}}),Rnt=t2(Ant,[["__scopeId","data-v-5035e341"]]),Unt={key:0,class:"modal-simple"},Fnt={class:"modal-simple__content"},Int={class:"modal-simple__content__header"},qnt={class:"modal-simple__content__body"},jnt={class:"modal-simple__content__footer"},Dnt={__name:"ModalSimple",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(r,n)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[e.modelValue?(t.openBlock(),t.createElementBlock("div",Unt,[t.createElementVNode("div",Fnt,[t.createElementVNode("div",Int,[t.renderSlot(r.$slots,"header",{},void 0,!0)]),t.createElementVNode("div",qnt,[t.renderSlot(r.$slots,"body",{},void 0,!0)]),t.createElementVNode("div",jnt,[t.renderSlot(r.$slots,"footer",{},void 0,!0)])])])):t.createCommentVNode("",!0)]))}},Wnt=t2(Dnt,[["__scopeId","data-v-1cc4f590"]]),Knt={class:"footer"},Bnt={__name:"ModalCautionClose",props:{value:{type:Boolean,default:!1}},emits:["update:modelValue","action"],setup(e,{emit:r}){const n=r;function v(h){n("update:modelValue",h)}function $(h){n("action",h),n("update:modelValue",!1)}return(h,u)=>(t.openBlock(),t.createBlock(Wnt,{"modle-value":e.value,"onUpdate:modelValue":v},{header:t.withCtx(()=>[...u[2]||(u[2]=[t.createElementVNode("div",{class:"header"},"Descartar template",-1)])]),body:t.withCtx(()=>[...u[3]||(u[3]=[t.createElementVNode("div",{class:"body"},"¿Estás seguro que deseas abandonar el proceso?",-1)])]),footer:t.withCtx(()=>[t.createElementVNode("div",Knt,[t.createElementVNode("div",{role:"button",class:"btn btn-cancel",onClick:u[0]||(u[0]=i=>$(!1))}," Seguir editando "),t.createElementVNode("div",{role:"button",class:"btn btn-confirm",onClick:u[1]||(u[1]=i=>$(!0))}," Descartar ")])]),_:1},8,["modle-value"]))}},Xnt=t2(Bnt,[["__scopeId","data-v-ed9b5088"]]),Gnt={key:0,class:"modal-simple"},Znt={__name:"ModalChangesSaved",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(r,n)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,null,{default:t.withCtx(()=>[e.modelValue?(t.openBlock(),t.createElementBlock("div",Gnt,[...n[0]||(n[0]=[t.createElementVNode("div",{class:"modal-simple__content"},[t.createElementVNode("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.createElementVNode("path",{d:"M29.3333 5.33203L16 18.6787L12 14.6787",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"})]),t.createElementVNode("div",{class:"modal-simple__content__text"}," Los cambios se han guardado correctamente ")],-1)])])):t.createCommentVNode("",!0)]),_:1})]))}},Jnt=t2(Znt,[["__scopeId","data-v-2bc30783"]]),Hnt={class:"template-maker__header"},Ynt={key:0,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Qnt={class:"template-maker__content"},$nt={class:"template-maker__content__main"},eat={id:"containerMain",class:"container-main"},tat={class:"template-maker__content__main__cover-selector"},rat=["id"],nat={class:"page-indicator"},aat={class:"page-indicator__index"},iat=["onClick"],oat=["onClick"],sat={key:0,class:"template-maker__content__main__footer"},lat={class:"template-maker__content__main__footer__paginator"},cat={class:"template-maker__content__main__footer__paginator__nav"},uat={class:"template-maker__content__main__footer__paginator__numbers"},dat=["onClick"],pat={__name:"GSC-TemplateReportMaker",props:{token:{type:String,default:""},userTeamId:{type:Number,default:0}},emits:["close"],setup(e,{expose:r,emit:n}){const v=new Map,$=t.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:{}}]}]),h=t.ref(null),u=t.ref(0),i=t.ref(!1),p=t.ref(null),c=t.ref(null),a=t.ref(!0),k=t.ref(!1),T=t.ref(!1),x=t.ref(0),d=t.ref(!1),o=t.ref(null),l=t.ref(new Map),s=t.ref(null),f=t.ref(null),g=t.ref(!1),S=t.ref(!1),L=t.ref(!1),E=new Map,P=new Map,V=t.computed(()=>({"--overflow-y-template-maker":k.value?"scroll":"hidden","--height-container-main":k.value?"fit-content":"calc(100vh - 64px)","--margin-bottom-container-main":(k.value,"0")})),I=t.computed(()=>u.value+1);t.watch(()=>i.value,$t=>{const Rt=document.getElementById("app");$t?(u.value=0,document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",Rt&&(Rt.style.overflow="hidden")):(document.body.style.overflow="",document.documentElement.style.overflow="",Rt&&(Rt.style.overflow=""))});function j($t){return $t<10?`0${$t}`:$t}async function U({templateId:$t,userId:Rt}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Rt}/templates/${$t}`,{method:"GET",headers:{Authorization:dt.token}})).json()).data}catch(lr){console.error("Error fetching template by ID:",lr)}}async function D({reportId:$t,userId:Rt}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Rt}/reports/${$t}`,{method:"GET",headers:{Authorization:dt.token}})).json()).data}catch(lr){console.error("Error fetching report by ID:",lr)}}let F=0;function z($t){h.value=$t,F>0&&(g.value=!0),F++}function X($t){$t&&st(null,!0)}let M=null;function Y($t,Rt){let lr=$t.getBoundingClientRect(),Zt={height:$t.clientHeight,width:$t.clientWidth},Tt=Rt.getBoundingClientRect();if(!(Tt.top>=lr.top&&Tt.bottom<=lr.top+Zt.height)){const Pt=Tt.top-lr.top,It=Tt.bottom-lr.bottom;Math.abs(Pt)<Math.abs(It)?$t.scrollTop+=Pt:$t.scrollTop+=It}}function se($t,Rt){let lr=$t.getBoundingClientRect();const Zt=Rt.getBoundingClientRect().top-lr.top;$t.scrollTop+=Zt}function me($t,Rt=!1){const lr={title:`Page ${$.value.length+1}`,id:`p-${Date.now()}`,items:[]};if(Gt(),$t!==void 0&&$t>=-1?$.value.splice($t+1,0,lr):$.value.push(lr),t.nextTick(()=>{const Zt=$.value.findIndex(Pt=>Pt.id===lr.id),Tt=document.getElementById(`page-${Zt+1}`);M||(M=document.getElementById("containerMain")),Tt&&M?Y(M,Tt):console.error("Page element or container main element not found")}),Rt)return lr;g.value=!0}function ge($t){if($t<0||$t>$.value.length)return;u.value=$t;const Rt=document.getElementById(`page-${$t}`);if(M||(M=document.getElementById("containerMain")),Rt&&M){const lr=new CustomEvent("programmatic-scroll-start");document.dispatchEvent(lr),se(M,Rt),setTimeout(()=>{const Zt=new CustomEvent("programmatic-scroll-end");document.dispatchEvent(Zt)},300)}else console.error("Page element or container main element not found")}function be($t){s.value=$t,d.value=!0}function xe($t,Rt){const lr=Rt+1;$t&&u.value!==lr&&(u.value=lr)}function Pe($t){d.value=!0,Sd.emit("edit-view",{view:$t})}async function je({templateReportId:$t,userId:Rt,isTemplateMode:lr}){try{return lr?U({templateId:$t,userId:Rt}):D({reportId:$t,userId:Rt})}catch(Zt){throw new Error("Error fetching template or report by ID: "+Zt.message)}}function _e(){F=0,d.value=!1,u.value=0,s.value=null,f.value=null,l.value.clear(),M=null,p.value=null,c.value=null,h.value=null,x.value=0,$.value=[],T.value=!1,g.value=!1,S.value=!1,L.value=!1,E.forEach($t=>clearTimeout($t)),E.clear(),P.forEach($t=>clearTimeout($t)),P.clear(),Ue=[],v.clear()}let Ue=[];async function qe($t){if(_e(),a.value=$t.isTemplateMode,k.value=!!$t.isPDFMode,$t.isPDFMode?p.value=await D({reportId:$t.reportId,userId:$t.userId}):(p.value=$t.template,p.value=await je({templateReportId:$t.template.id,userId:$t.template.user_id,isTemplateMode:$t.isTemplateMode})),!p.value)return;p.value&&p.value.game&&(p.value.game=Ye(p.value.game)),c.value=JSON.parse(JSON.stringify(p.value)),T.value=p.value.template_type===2;const Rt=p.value.pages.find(lr=>lr.is_front_page);x.value=Rt?Rt.type:1,i.value=!0,$t.isTemplateMode||(Ue=await rt(p.value)),$.value=p.value.pages.reduce((lr,Zt,Tt)=>{if(!Zt.is_front_page){Zt.name||(Zt.name="");const Pt=Tt,It={originalPage:JSON.parse(JSON.stringify(Zt)),title:Zt.name,id:`p-${Date.now()-Tt*9}`,items:[],components:Zt.components};Zt.components&&Zt.components.length>0&&(It.items=Zt.components.reduce((vr,ur,gr)=>{const Tr=new Qk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],ur.coreView.id,ur.dynamicFilters,T.value,a.value,ur.filtersJSON||null,dt.token,ur.filters),Rr={originalComponent:JSON.parse(JSON.stringify(ur)),title:ur.title,shortTitle:ur.shortTitle||ur.title,game:p.value.game,idAux:ur.id,id:`w-${Date.now()-gr*7}`,x:ur.column,y:ur.row,w:ur.colspan,h:ur.rowspan,maxWidth:ur.max_column,maxHeight:ur.max_row,minWidth:ur.min_column,minHeight:ur.min_row,noResize:!a.value,noMove:!a.value,coreView:ur.coreView||null,isTemplateMode:a.value,componentName:ur.componentName,componentProps:Qe({currentProps:ur.componentProps,coreView:ur.coreView,isTemplateMode:a.value,templateToEdit:p.value,filterMultiple:ur.filterMultiple||null,game:p.value.game||null,dynamicFilters:ur.dynamicFilters,page:Pt,componentId:gr})||{},filterMultiple:ur.filterMultiple,isHomeTeam:We({game:p.value.game,isTemplateMode:a.value,currentIsHomeTeam:ur.isHomeTeam||ur.componentProps.isHomeTeamForAnalysis}),filtersJSON:ur.filtersJSON||null,dynamicFilters:ur.dynamicFilters||[],filterAndViewsContainer:Tr};if(Rr.componentProps.isViewNull)return vr;const St=t.reactive({view:Rr});return Tr.addView(St,!0),l.value.set(Tr.getId(),Tr),vr.push(Rr),vr},[])),lr.push(It)}return lr},[])}function Re({game:$t,isTemplateMode:Rt}){const lr=$t&&$t.homeTeam&&$t.awayTeam&&($t.homeTeam.team_id===dt.userTeamId||$t.awayTeam.team_id===dt.userTeamId);return{isUserTeamHome:lr&&$t.homeTeam.team_id===dt.userTeamId,requiresUserTeamAdjustment:lr&&!Rt}}function We({game:$t,isTemplateMode:Rt,currentIsHomeTeam:lr}){const{isUserTeamHome:Zt,requiresUserTeamAdjustment:Tt}=Re({game:$t,isTemplateMode:Rt});return Tt?lr?Zt:!Zt:lr}function Qe({currentProps:$t,coreView:Rt,templateToEdit:lr,isTemplateMode:Zt,filterMultiple:Tt,game:Pt,dynamicFilters:It,page:vr,componentId:ur}){var gr,Tr,Rr,St;if(!$t||!Rt)return $t||{};const{isUserTeamHome:Yt,requiresUserTeamAdjustment:er}=Re({game:Pt,isTemplateMode:Zt});let or={...$t};if(Rt.id===5){if(or.isGhostEffect=Zt,er){const Or=or.preMatchType===1;or.preMatchType=Or?Yt?1:2:Yt?2:1}Pt&&(or.game=Pt)}if(Rt.id===7&&er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}if(Rt.id===9){if(er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}Pt&&(or.game=Pt)}if(Rt.id===18){if(!Zt&&er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}if(!Zt){or.teamIdForAnalysis=or.isHomeTeamForAnalysis?Pt.home_team:Pt.visiting_team;const Or=Ue.findIndex(sn=>((or.isAgainstMode?1:0)===sn.is_against||sn.is_against===or.isAgainstMode)&&or.teamIdForAnalysis===sn.team_id);let Pr=null;Or!==-1&&(Pr={...Ue[Or]},Ue.splice(Or,1)),console.log("viewCorner",Pr),Pr?(or.specificPlaysCornersData=Pr,or.playIdForAnalysis=Pr.play_id,or.gameIdForAnalysis=Pr.game_id,or.seasonIdForAnalysis=Pr.season_id||Pt.season_id,or.isTemplateMode=Zt,or.isGameOnly=!0,or.isCornerInfoVisible=!0):(or.isNullCornerData=!0,or.isViewNull=!0,console.warn("No specific plays corner data available for this component"))}}if(Rt.id===16){if(!Zt&&er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}if(!Zt){or.isPreMatch=!T.value,or.isTemplateMode=Zt,or.seasonId=lr.season_id,or.teamIdForAnalysis=or.isHomeTeamForAnalysis?lr.game.home_team:lr.game.visiting_team;const Or=or.isHomeTeamForAnalysis?lr.last_games.last_home_games:lr.last_games.last_visiting_games;T.value?or.gamesIdsForAnalysis=[lr.game.game_id]:or.howManyGames?or.gamesIdsForAnalysis=Or.slice(0,or.howManyGames).map(Pr=>Pr.game_id):(or.gamesIdsForAnalysis=[],or.gameDataUTC=lr.game.date_time_utc)}}if(Rt.id===10&&er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}if(Rt.id===1&&(or.gameId=Pt?Pt.id:"",or.homeLogo=Pt?Pt.homeTeam.logo:"",or.awayLogo=Pt?Pt.awayTeam.logo:"",or.seasonId=Pt?Pt.season_id:0,or.default=Zt),Rt.id===6&&(or.game=Pt||"",or.lastGames=lr.last_games,or.selectedOption=lr.template_type===2?"Postmatch":"Prematch"),Rt.id===13&&(or.isdefault=Zt,or.seasonid=Pt?Pt.seasonId:2010,or.datetimeutc=Pt?lr.template_type===1?Pt?Pt.date_time_utc:"":null:"",or.teamids=Pt?[Pt.home_team,Pt.visiting_team]:[1,2],or.categoryids=It?It[1]:[20,2],or.teamsshow=Pt?It?It[2]==1?[Pt.home_team]:It[2]==2?[Pt.visiting_team]:[Pt.home_team,Pt.visiting_team]:[1,2]:[1,2],or.analysistype=It?It[0]:[],or.gameid=lr.template_type===1?null:Pt?Pt.id:"",or.teams=Pt?[{id:Pt.home_team,name:Pt.home_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Pt.home_team+".png"},{id:Pt.visiting_team,name:Pt.visiting_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Pt.visiting_team+".png"}]:[]),Rt.id===15&&(or.view=1,or.token=dt.token,or.numitems=It?It[1]:3,or.isdefault=Zt,or.reportid=lr!=null&&lr.id?lr.id:0,or.userid=lr!=null&&lr.user_id?lr.user_id:0,or.page=vr+1,or.typegame=T.value?2:1,or.componentid=ur+1,or.data={season:Pt?Pt.seasonId:2010,type:2,game:Pt?Pt.id:0,team:Zt?2:Tt?Tt.isHomeTeam?Pt.home_team||2:Pt.visiting_team||2:2}),Rt.id===17){or.game=Pt?{id:Pt.id||Pt.game_id||Pt.gameId||null,home_team:Pt.home_team||null,away_team:Pt.visiting_team||null,season:Pt.seasonId||Pt.season_id||null,game_status:Pt.game_status||Pt.status||null,home_acronym:Pt.home_team_acronym||((gr=Pt.homeTeam)==null?void 0:gr.acronym)||null,away_acronym:Pt.visiting_team_acronym||((Tr=Pt.awayTeam)==null?void 0:Tr.acronym)||null,logo_home:((Rr=Pt.homeTeam)==null?void 0:Rr.logo)||null,logo_away:((St=Pt.awayTeam)==null?void 0:St.logo)||null}:null,or.infavoragainstteam=It?!It[0]:!0,or.forseason=!T.value,or.forteam=!1,or.tournamentselected=lr!=null&&lr.tournament_id?{id:lr.tournament_id}:{id:1},or.forgame=!!T.value,or.lateralidad=It&&It[1]==32?"right":"left",or.teamselected=It[2]==3?Tt?Tt.isHomeTeam?Pt==null?void 0:Pt.home_team:Pt==null?void 0:Pt.visiting_team:0:It[2]==2?Pt==null?void 0:Pt.visiting_team:Pt==null?void 0:Pt.home_team;const Or=It&&It[3]&&typeof It[3]=="object"&&!Array.isArray(It[3])&&It[3][4]!==void 0?Array.isArray(It[3][4])?It[3][4].filter(Pr=>Pr!=="rematado-destino-porteria").reduce((Pr,sn)=>(sn==="fue-gol"?Pr.push(583,585,587,589):sn==="no-fue-gol"?Pr.push(584,586,588,590):sn==="rematado-sin-destino-porteria"?Pr.push(125,131,139,145):sn==="sin-destino"?Pr.push(122,128,136,142):sn==="ganados-por-portero-rival"?Pr.push(123,129,137,143):sn==="ganados-por-jugador-rival"&&Pr.push(124,130,138,144),Pr),[]):[]:[];or.filters={isMoment:!0,final:[1,2,3],moment:It&&It[3]&&typeof It[3]=="object"&&!Array.isArray(It[3])&&It[3][0]!==void 0?Array.isArray(It[3][0])?It[3][0].map(Pr=>Pr==="iba-ganando"?1:Pr==="iba-empatado"?3:Pr==="iba-perdiendo"?2:Pr):[]:[],playingAs:[1,2],sections:It&&It[3]&&typeof It[3]=="object"&&!Array.isArray(It[3])&&It[3][1]!==void 0?Array.isArray(It[3][1])?It[3][1].map(Pr=>Pr==="0-15"?1:Pr==="16-30"?2:Pr==="31-45"?3:Pr==="46-60"?4:Pr==="61-75"?5:Pr==="76-90"?6:Pr):[]:[],games:T.value?[Pt==null?void 0:Pt.game_id]:[],players:[],cornertype:It&&It[1]!==void 0?It[1]:null,howWas:It&&It[3]&&typeof It[3]=="object"&&!Array.isArray(It[3])&&It[3][2]!==void 0?Array.isArray(It[3][2])?It[3][2].filter(Pr=>Pr!=="izquierda"&&Pr!=="derecha").map(Pr=>{const sn=It[1];return Pr==="comba-afuera"?sn==32?134:120:Pr==="comba-adentro"?sn==32?140:126:Pr==="raz-area"?sn==32?146:327:Pr==="en-corto"?sn==32?147:133:Pr}):[]:[],zona:It&&It[3]&&typeof It[3]=="object"&&!Array.isArray(It[3])&&It[3][3]!==void 0?Array.isArray(It[3][3])?It[3][3]:[]:[],whathappened:Or,isWhatHappenedFull:Array.isArray(Or)&&Or.length===24,isZoneFull:It&&It[3]&&typeof It[3]=="object"&&!Array.isArray(It[3])&&It[3][3]!==void 0&&Array.isArray(It[3][3])?It[3][3].length===35:!1},or.showBallGo=!0,or.showHeatMap=!0,or.ballOnOff="OFF",or.showdefault=Zt}if(Rt.id===14&&(or.isReports=!0,or.isDefault=Zt,or.type=lr.tournament_type==1?1:0,or.typeView=1,or.tournament=lr.tournament_id,or.currentSeason=Pt?Pt.season_id:0,or.currentSeasonId=Pt?Pt.season_id:0,or.showVideos=!1,or.localTeam=Pt?Pt.home_team:0,or.awayTeam=Pt?Pt.visiting_team:0),Rt.id===3&&(or.defaultShields=Zt,Pt&&(or.game=Pt)),Rt.id===2){let Or=!0,Pr=0,sn=0;Pt&&(Or=lr.main_team==Pt.home_team||lr.main_team==Pt.visiting_team,Pr=Or?lr.main_team==(Pt==null?void 0:Pt.home_team)?Pt==null?void 0:Pt.home_team:Pt==null?void 0:Pt.visiting_team:Pt==null?void 0:Pt.home_team,sn=Or?lr.main_team==(Pt==null?void 0:Pt.home_team)?Pt==null?void 0:Pt.visiting_team:Pt==null?void 0:Pt.home_team:Pt==null?void 0:Pt.visiting_team),or.gamed=Pt?Pt.id:"",or.game=Pt||"",or.season=Pt?Pt.season_id:0,or.teamView=Tt.teamType==3?0:Tt.teamType==1?Pr:sn,or.useDummyData=Zt}return Rt.id===8&&(or.teamSelected=Pt?{teamId:Pt.home_team}:1,or.isDefault=Zt,Pt&&(or.game=Pt)),Rt.id===4&&(or.gameId=Pt?Pt.id:"",or.isDefault=Zt,or.homeTeam=Pt?Pt==null?void 0:Pt.home_team:"",or.awayTeam=Pt?Pt==null?void 0:Pt.visiting_team:""),or}async function rt($t){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${$t.user_id}/reports/${$t.id}/specific-plays-corners`,{method:"GET",headers:{Authorization:dt.token}})).json()).data}catch(Rt){return console.error("Error fetching specific plays:",Rt),[]}}const dt=e,ut=n;t.watch(()=>dt.token,($t,Rt)=>{},{immediate:!0}),r({show:qe}),Sd.on("add-page-view",$t=>{v.set($t.view.id,$t.view);const Rt=$.value.find(lr=>lr.id===$t.pageId);Rt&&(Rt.items||(Rt.items=[]),Rt.items.push($t.view),t.nextTick(()=>{const lr=document.querySelector(`[gs-id="${$t.view.id}"]`);$t.grid.makeWidget(lr)}))}),Sd.on("add-page-and-view",$t=>{const Rt=$.value.findIndex(lr=>lr.id===$t.pageId);if(Rt>-1){const lr=me(Rt,!0);setTimeout(()=>{Sd.emit("add-view",{pageId:lr.id,view:$t.view,filterAndWidgetContainer:$t.filterAndWidgetContainer}),f.value&&(lr.stepBackPage=f.value),f.value=lr},500)}else console.error("Page not found for adding view:",$t.pageId)}),Sd.on("empty-page",$t=>{d.value&&s.value&&s.value.id===$t.id||(Jt($t),f.value&&f.value.id===$t.id&&(f.value.stepBackPage?f.value=f.value.stepBackPage:f.value=null))}),Sd.on("filters-cancelled",$t=>{$t&&$t.removeAllChildViews()}),Sd.on("activate-save-button",()=>{g.value=!0});function Ye($t){return{...$t,gameId:$t.game_id,id:$t.game_id,seasonId:$t.season_id,status:$t.game_status,homeTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${$t.home_team}.png`,team_id:$t.home_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${$t.home_team}.png`,colloquial_name:$t.home_team_name,acronym:$t.home_team_acronym,team_name:$t.home_team_name},awayTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${$t.visiting_team}.png`,team_id:$t.visiting_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${$t.visiting_team}.png`,colloquial_name:$t.visiting_team_name,acronym:$t.visiting_team_acronym,team_name:$t.visiting_team_name}}}function st($t,Rt=!1){Rt||!a.value?(i.value=!1,_e(),ut("close")):g.value?S.value=!0:(i.value=!1,_e(),ut("close"))}function lt(){o.value=null,d.value=!1}function Ot({page:$t,view:Rt,applyMinimumSize:lr=!1}){const Zt=$t.grid;if(!$t||!Rt||!Zt)return null;const Tt=lr?{w:Rt.min_column,h:Rt.min_row}:{w:Rt.colspan,h:Rt.rowspan},Pt=Zt.willItFit(0,0,Tt.w,Tt.h,!0);return Pt?{willFit:Pt,applyMinimumSize:lr}:lr?null:Ot({page:$t,view:Rt,applyMinimumSize:!0})}const zt=new Set([9]);function Et($t){var Rt,lr,Zt,Tt,Pt,It,vr,ur,gr,Tr,Rr,St,Yt,er,or,Or,Pr,sn,qn;if($t.dynamicFilters&&$t.dynamicFilters.length>0&&$t.viewToEdit&&$t.viewToEdit.view){const jn=$t.viewToEdit.view.id;$.value.forEach(ba=>{ba.items.forEach(fa=>{fa.id===jn&&fa.coreView&&fa.coreView.id===3&&(fa.componentProps.desplegable=$t.dynamicFilters[0]||!1,fa.componentProps.key=$t.dynamicFilters[0]||!1,t.nextTick(()=>{Sd.emit("force-component-update",{itemId:fa.id,componentProps:fa.componentProps})}))})})}if($t.viewToEdit){if(!$t.viewToEdit.view.filterAndViewsContainer){const jn=new Qk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[$t.viewToEdit],((Rt=$t.viewToEdit.view.coreView)==null?void 0:Rt.id)||$t.viewToEdit.view.id,$t.dynamicFilters||[],T.value,a.value,$t.filtersJSON,dt.token,$t.filters);$t.viewToEdit.view.filterAndViewsContainer=jn}$t.viewToEdit.view.filterAndViewsContainer.updateView({view:$t.viewToEdit,dynamicFilters:$t.dynamicFilters||[],filtersJSON:$t.filtersJSON||null,filters:$t.filters}),g.value=!0}else if($t.view){$t.view.id&&$t.filterAndViewsContainer&&$t.view.id!==$t.filterAndViewsContainer.viewId&&($t.filterAndViewsContainer.removeAllChildViews(),$t.filterAndViewsContainer.setViewId($t.view.id),$t.filterAndViewsContainer.setFiltersJSON($t.filtersJSON||null)),$t.view.id&&zt.has($t.view.id)&&$t.dynamicFilters[0]&&$t.dynamicFilters[0].length===0&&$t.filterAndViewsContainer&&($t.filterAndViewsContainer.updateDynamicFilters($t.dynamicFilters,(Zt=(lr=$t.viewToEdit)==null?void 0:lr.view)==null?void 0:Zt.id),g.value=!0);const jn=f.value||s.value,ba=Ot({page:jn,view:$t.view,applyMinimumSize:!1});$t.view.filtersJSON=$t.filtersJSON||null;const fa=$t.filterAndViewsContainer,Ia=$.value.findIndex(en=>en.id===jn.id);if(fa){const en=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters,$t.filters);if(((Tt=$t.view)==null?void 0:Tt.id)===15){const Ur=(Pt=$t.filterAndViewsContainer)==null?void 0:Pt.getId();if(Ur&&E.has(Ur)){const mn=E.get(Ur);clearTimeout(mn),E.delete(Ur)}}if(((It=$t.view)==null?void 0:It.id)===17){const Ur=(vr=$t.filterAndViewsContainer)==null?void 0:vr.getId();if(Ur&&P.has(Ur)){const mn=P.get(Ur);clearTimeout(mn),P.delete(Ur)}}if(en){if(fa.setFilters($t.filters),fa.setDynamicFilters($t.dynamicFilters),ba||Ia===$.value.length-1){Sd.emit("add-view",{pageId:jn.id,view:$t.view,filterAndWidgetContainer:fa,avoidWillFit:!1,applyMinimumSize:ba?ba.applyMinimumSize:!1,dynamicFilters:$t.dynamicFilters,filters:$t.filters}),$t.filterAndViewsContainer.updateDynamicFilters($t.dynamicFilters,(gr=(ur=$t.viewToEdit)==null?void 0:ur.view)==null?void 0:gr.id),g.value=!0;let Ur=null;if(((Tr=$t.view)==null?void 0:Tr.id)===15?(t.nextTick(()=>{var mn;const Vn=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters,$t.filters);((mn=$t.dynamicFilters)==null?void 0:mn[0])===3&&Vn&&Et($t)}),Ur=setTimeout(()=>{var mn,Vn;const Jn=(mn=$t.filterAndViewsContainer)==null?void 0:mn.getId();Jn&&E.delete(Jn);const Cn=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters);((Vn=$t.dynamicFilters)==null?void 0:Vn[0])===3&&Cn&&Et($t)},200)):((Rr=$t.view)==null?void 0:Rr.id)===17?(t.nextTick(()=>{var mn,Vn;const Jn=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters,$t.filters),Cn=(mn=$t.dynamicFilters)==null?void 0:mn[0],Xr=(Vn=$t.dynamicFilters)==null?void 0:Vn[2];(Cn===3||Xr===3)&&Jn&&Et($t)}),Ur=setTimeout(()=>{var mn,Vn,Jn;const Cn=(mn=$t.filterAndViewsContainer)==null?void 0:mn.getId();Cn&&P.delete(Cn);const Xr=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters),un=(Vn=$t.dynamicFilters)==null?void 0:Vn[0],kr=(Jn=$t.dynamicFilters)==null?void 0:Jn[2];(un===3||kr===3)&&Xr&&Et($t)},200)):Ur=setTimeout(()=>{$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters,$t.filters)&&Et($t)},1e3),((St=$t.view)==null?void 0:St.id)===15&&Ur){const mn=(Yt=$t.filterAndViewsContainer)==null?void 0:Yt.getId();mn&&E.set(mn,Ur)}if(((er=$t.view)==null?void 0:er.id)===17&&Ur){const mn=(or=$t.filterAndViewsContainer)==null?void 0:or.getId();mn&&P.set(mn,Ur)}}}else $t.isAltMode?$t.viewToEdit||$t.filterAndViewsContainer.updateFilters($t.filters,(Pr=(Or=$t.viewToEdit)==null?void 0:Or.view)==null?void 0:Pr.id):$t.filterAndViewsContainer.updateDynamicFilters($t.dynamicFilters,(qn=(sn=$t.viewToEdit)==null?void 0:sn.view)==null?void 0:qn.id),g.value=!0}else if(ba||Ia===$.value.length-1){const en=new Qk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],$t.view.id,$t.dynamicFilters,T.value,a.value,$t.filtersJSON,dt.token,$t.filters);Sd.emit("set-filter-and-views-container",en),l.value.set(en.getId(),en);const Ur=$t.dynamicFilters&&($t.dynamicFilters[0]===3||$t.dynamicFilters[2]===3)&&($t.view.id===15||$t.view.id===17);$t.dynamicFilters&&(Array.isArray($t.dynamicFilters[0])||Ur)?($t.filterAndViewsContainer=en,Et($t)):Sd.emit("add-view",{pageId:jn.id,view:$t.view,filterAndWidgetContainer:en,avoidWillFit:!1,applyMinimumSize:ba?ba.applyMinimumSize:!1,dynamicFilters:$t.dynamicFilters,filters:$t.filters}),g.value=!0}}}async function qt(){if(g.value)try{const $t=[{is_front_page:!0,template_type:h.value.isPostMatch?2:1,type:h.value.id},...$.value.map(lr=>({columns:lr.originalPage?lr.originalPage.columns:12,rows:lr.originalPage?lr.originalPage.rows:12,gap:lr.originalPage?lr.originalPage.gap:10,name:lr.title,width:lr.originalPage?lr.originalPage.width:968,height:lr.originalPage?lr.originalPage.height:702,components:lr.items.reduce((Zt,Tt)=>(Tt.isDeleted||Zt.push({min_column:Tt.minWidth,min_row:Tt.minHeight,max_column:Tt.maxWidth,max_row:Tt.maxHeight,column:Tt.x,row:Tt.y,colspan:Tt.w,rowspan:Tt.h,name:Tt.name,title:Tt.title,titleShort:Tt.titleShort||Tt.title,dynamicFilters:Tt.filterAndViewsContainer.getComponentDynamicFilters(Tt.id)||Tt.filterAndViewsContainer.getDynamicFilters()||[],coreView:Tt.coreView||null,componentName:Tt.componentName,componentProps:Tt.componentProps||{},isHomeTeam:Tt.isHomeTeam||Tt.componentProps.isHomeTeamForAnalysis,filterMultiple:Tt.filterMultiple}),Zt),[])}))];console.log("pagesAux to save:",$t);const Rt=await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${p.value.user_id}/templates/${p.value.id}/pages`,{method:"PATCH",headers:{Authorization:dt.token},body:JSON.stringify({pages:$t})});L.value=!0,await Rt.json(),g.value=!1,setTimeout(()=>{L.value=!1},2e3)}catch($t){console.error("Error saving template:",$t)}}function Gt(){$.value.forEach($t=>{$t.offListeners&&$t.offListeners()})}function Jt($t){const Rt=$.value.findIndex(lr=>lr.id===$t.id);Rt>-1&&(Gt(),$.value=$.value.filter(lr=>lr.id!==$t.id),u.value>=Rt&&(u.value=Math.max(0,u.value-1)),g.value=!0)}function Qt(){g.value=!0}function sr($t){const Rt=$.value.find(lr=>lr.items.some(Zt=>Zt.id===$t.id));if(Rt){const lr=Rt.items.find(Zt=>Zt.id===$t.id);lr&&(lr.isDeleted=!0,g.value=!0)}}function hr($t){}return($t,Rt)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(Xnt,{modelValue:S.value,"onUpdate:modelValue":Rt[0]||(Rt[0]=lr=>S.value=lr),onAction:X},null,8,["modelValue"]),t.createVNode(Jnt,{"model-value":L.value},null,8,["model-value"]),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[i.value&&p.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"template-maker",style:t.normalizeStyle(V.value)},[t.withDirectives(t.createVNode(Rnt,{token:e.token,view:o.value,"is-post-match":T.value,onClose:lt,onFiltersChanged:Et},null,8,["token","view","is-post-match"]),[[t.vShow,a.value&&d.value]]),t.createElementVNode("div",Hnt,[t.createTextVNode(t.toDisplayString(p.value?p.value.name:"Nuevo template")+" ",1),t.createElementVNode("div",{class:"template-maker__header__close",onClick:st},[k.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("svg",Ynt,[...Rt[6]||(Rt[6]=[t.createElementVNode("path",{d:"M1.33398 1.33398L14.6673 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),t.createElementVNode("path",{d:"M14.666 1.33398L1.33268 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))])]),t.createElementVNode("div",Qnt,[Rt[13]||(Rt[13]=t.createElementVNode("div",{class:"template-maker__content__sidebar"},null,-1)),t.createElementVNode("div",$nt,[t.createElementVNode("div",eat,[t.createElementVNode("div",tat,[t.withDirectives(t.createVNode(xQ,{"is-post-match":T.value,"initial-cover-id":x.value,onSelectCover:z},null,8,["is-post-match","initial-cover-id"]),[[t.vShow,a.value]])]),(t.openBlock(),t.createElementBlock("div",{class:"template-maker__content__main__pages",key:$.value.length},[h.value?(t.openBlock(),t.createBlock(SYe,{key:0,id:"page-0",game:p.value.game||null,"cover-id":h.value.id,"is-post-match":h.value.isPostMatch,onIntersectionChanged:Rt[1]||(Rt[1]=lr=>xe(lr,-1))},null,8,["game","cover-id","is-post-match"])):t.createCommentVNode("",!0),a.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:"new-items-buttons",style:t.normalizeStyle({"margin-bottom":$.value.length===0?"30px":"0"})},[d.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:"new-items-buttons__add-page new-item-button",onClick:Rt[2]||(Rt[2]=lr=>me(-1))},[...Rt[7]||(Rt[7]=[t.createElementVNode("div",null,"+ Nueva página",-1),t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]))],4)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList($.value,(lr,Zt)=>(t.openBlock(),t.createElementBlock("div",{key:Zt,id:`page-${Zt+1}`,class:"template-maker__content__main__pages__page"},[t.createElementVNode("div",nat,[t.createElementVNode("div",aat,"Pag "+t.toDisplayString(j(Zt+2)),1)]),h.value?(t.openBlock(),t.createBlock(LHe,{key:0,page:lr,"is-template-mode":a.value,"is-post-match":h.value.isPostMatch,game:p.value.game||null,lastGames:p.value.lastGames||[],"is-filter-visible":d.value,onEditView:Pe,onIntersectionChanged:Tt=>xe(Tt,Zt),onChangeSort:hr,onDeletePage:Jt,onViewChanged:Qt,onDeleteView:sr},null,8,["page","is-template-mode","is-post-match","game","lastGames","is-filter-visible","onIntersectionChanged"])):t.createCommentVNode("",!0),a.value&&!d.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:"new-items-buttons",style:t.normalizeStyle({"margin-bottom":Zt+1===$.value.length?"30px":"0","margin-top":"10px"})},[t.createElementVNode("div",{class:"new-items-buttons__add-page new-item-button",onClick:Tt=>me(Zt)},[...Rt[8]||(Rt[8]=[t.createElementVNode("div",null,"+ Nueva página",-1),t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,iat),t.createElementVNode("div",{class:"new-items-buttons__add-item new-item-button",onClick:Tt=>be(lr)},[...Rt[9]||(Rt[9]=[t.createElementVNode("div",null,"+ Agregar gráfico",-1),t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M12 13.3346V6.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M8 13.3346V2.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M4 13.332V9.33203",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,oat)],4)):t.createCommentVNode("",!0)],8,rat))),128))]))]),k.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",sat,[t.createElementVNode("div",lat,[t.createElementVNode("div",cat,[t.createElementVNode("div",null,"Páginas "+t.toDisplayString(I.value),1),t.createElementVNode("div",{class:t.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:u.value<=0}]),onClick:Rt[3]||(Rt[3]=lr=>u.value>0&&ge(u.value-1))},[...Rt[10]||(Rt[10]=[t.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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),t.createElementVNode("div",{class:t.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:u.value>=$.value.length}]),onClick:Rt[4]||(Rt[4]=lr=>u.value<$.value.length&&ge(u.value+1))},[...Rt[11]||(Rt[11]=[t.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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)]),t.createElementVNode("div",uat,[t.createElementVNode("div",{role:"button",class:t.normalizeClass({active:u.value===0}),onClick:Rt[5]||(Rt[5]=lr=>ge(0))},t.toDisplayString(j(1)),3),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList($.value,(lr,Zt)=>(t.openBlock(),t.createElementBlock("div",{role:"button",key:Zt,class:t.normalizeClass({active:Zt+1===u.value}),onClick:Tt=>ge(Zt+1)},t.toDisplayString(j(Zt+2)),11,dat))),128))])]),a.value?(t.openBlock(),t.createElementBlock("div",{key:0,role:"button",class:t.normalizeClass(["template-maker__content__main__footer__save save-button",{disabled:!g.value}]),onClick:qt},[...Rt[12]||(Rt[12]=[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.createElementVNode("path",{d:"M11.3346 14.0013V8.66797H4.66797V14.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M4.66797 2V5.33333H10.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1),t.createElementVNode("div",null,"Guardar",-1)])],2)):t.createCommentVNode("",!0)]))])])],4)):t.createCommentVNode("",!0)]))],64))}},hat=t2(pat,[["__scopeId","data-v-2710a2ea"]]);function KZ(e,r){return function(){return e.apply(r,arguments)}}const{toString:fat}=Object.prototype,{getPrototypeOf:pA}=Object,{iterator:LM,toStringTag:BZ}=Symbol,NM=(e=>r=>{const n=fat.call(r);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Zw=e=>(e=e.toLowerCase(),r=>NM(r)===e),OM=e=>r=>typeof r===e,{isArray:e7}=Array,t7=OM("undefined");function d9(e){return e!==null&&!t7(e)&&e.constructor!==null&&!t7(e.constructor)&&Y_(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const XZ=Zw("ArrayBuffer");function mat(e){let r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(e):r=e&&e.buffer&&XZ(e.buffer),r}const yat=OM("string"),Y_=OM("function"),GZ=OM("number"),p9=e=>e!==null&&typeof e=="object",gat=e=>e===!0||e===!1,MM=e=>{if(NM(e)!=="object")return!1;const r=pA(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(BZ in e)&&!(LM in e)},vat=e=>{if(!p9(e)||d9(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},bat=Zw("Date"),xat=Zw("File"),_at=Zw("Blob"),wat=Zw("FileList"),Tat=e=>p9(e)&&Y_(e.pipe),Sat=e=>{let r;return e&&(typeof FormData=="function"&&e instanceof FormData||Y_(e.append)&&((r=NM(e))==="formdata"||r==="object"&&Y_(e.toString)&&e.toString()==="[object FormData]"))},kat=Zw("URLSearchParams"),[Lat,Nat,Oat,Mat]=["ReadableStream","Request","Response","Headers"].map(Zw),Eat=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function h9(e,r,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let v,$;if(typeof e!="object"&&(e=[e]),e7(e))for(v=0,$=e.length;v<$;v++)r.call(null,e[v],v,e);else{if(d9(e))return;const h=n?Object.getOwnPropertyNames(e):Object.keys(e),u=h.length;let i;for(v=0;v<u;v++)i=h[v],r.call(null,e[i],i,e)}}function ZZ(e,r){if(d9(e))return null;r=r.toLowerCase();const n=Object.keys(e);let v=n.length,$;for(;v-- >0;)if($=n[v],r===$.toLowerCase())return $;return null}const OS=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,JZ=e=>!t7(e)&&e!==OS;function hA(){const{caseless:e,skipUndefined:r}=JZ(this)&&this||{},n={},v=($,h)=>{const u=e&&ZZ(n,h)||h;MM(n[u])&&MM($)?n[u]=hA(n[u],$):MM($)?n[u]=hA({},$):e7($)?n[u]=$.slice():(!r||!t7($))&&(n[u]=$)};for(let $=0,h=arguments.length;$<h;$++)arguments[$]&&h9(arguments[$],v);return n}const Cat=(e,r,n,{allOwnKeys:v}={})=>(h9(r,($,h)=>{n&&Y_($)?e[h]=KZ($,n):e[h]=$},{allOwnKeys:v}),e),zat=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Vat=(e,r,n,v)=>{e.prototype=Object.create(r.prototype,v),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:r.prototype}),n&&Object.assign(e.prototype,n)},Pat=(e,r,n,v)=>{let $,h,u;const i={};if(r=r||{},e==null)return r;do{for($=Object.getOwnPropertyNames(e),h=$.length;h-- >0;)u=$[h],(!v||v(u,e,r))&&!i[u]&&(r[u]=e[u],i[u]=!0);e=n!==!1&&pA(e)}while(e&&(!n||n(e,r))&&e!==Object.prototype);return r},Aat=(e,r,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=r.length;const v=e.indexOf(r,n);return v!==-1&&v===n},Rat=e=>{if(!e)return null;if(e7(e))return e;let r=e.length;if(!GZ(r))return null;const n=new Array(r);for(;r-- >0;)n[r]=e[r];return n},Uat=(e=>r=>e&&r instanceof e)(typeof Uint8Array<"u"&&pA(Uint8Array)),Fat=(e,r)=>{const v=(e&&e[LM]).call(e);let $;for(;($=v.next())&&!$.done;){const h=$.value;r.call(e,h[0],h[1])}},Iat=(e,r)=>{let n;const v=[];for(;(n=e.exec(r))!==null;)v.push(n);return v},qat=Zw("HTMLFormElement"),jat=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,v,$){return v.toUpperCase()+$}),HZ=(({hasOwnProperty:e})=>(r,n)=>e.call(r,n))(Object.prototype),Dat=Zw("RegExp"),YZ=(e,r)=>{const n=Object.getOwnPropertyDescriptors(e),v={};h9(n,($,h)=>{let u;(u=r($,h,e))!==!1&&(v[h]=u||$)}),Object.defineProperties(e,v)},Wat=e=>{YZ(e,(r,n)=>{if(Y_(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const v=e[n];if(Y_(v)){if(r.enumerable=!1,"writable"in r){r.writable=!1;return}r.set||(r.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Kat=(e,r)=>{const n={},v=$=>{$.forEach(h=>{n[h]=!0})};return e7(e)?v(e):v(String(e).split(r)),n},Bat=()=>{},Xat=(e,r)=>e!=null&&Number.isFinite(e=+e)?e:r;function Gat(e){return!!(e&&Y_(e.append)&&e[BZ]==="FormData"&&e[LM])}const Zat=e=>{const r=new Array(10),n=(v,$)=>{if(p9(v)){if(r.indexOf(v)>=0)return;if(d9(v))return v;if(!("toJSON"in v)){r[$]=v;const h=e7(v)?[]:{};return h9(v,(u,i)=>{const p=n(u,$+1);!t7(p)&&(h[i]=p)}),r[$]=void 0,h}}return v};return n(e,0)},Jat=Zw("AsyncFunction"),Hat=e=>e&&(p9(e)||Y_(e))&&Y_(e.then)&&Y_(e.catch),QZ=((e,r)=>e?setImmediate:r?((n,v)=>(OS.addEventListener("message",({source:$,data:h})=>{$===OS&&h===n&&v.length&&v.shift()()},!1),$=>{v.push($),OS.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Y_(OS.postMessage)),Yat=typeof queueMicrotask<"u"?queueMicrotask.bind(OS):typeof process<"u"&&process.nextTick||QZ,nu={isArray:e7,isArrayBuffer:XZ,isBuffer:d9,isFormData:Sat,isArrayBufferView:mat,isString:yat,isNumber:GZ,isBoolean:gat,isObject:p9,isPlainObject:MM,isEmptyObject:vat,isReadableStream:Lat,isRequest:Nat,isResponse:Oat,isHeaders:Mat,isUndefined:t7,isDate:bat,isFile:xat,isBlob:_at,isRegExp:Dat,isFunction:Y_,isStream:Tat,isURLSearchParams:kat,isTypedArray:Uat,isFileList:wat,forEach:h9,merge:hA,extend:Cat,trim:Eat,stripBOM:zat,inherits:Vat,toFlatObject:Pat,kindOf:NM,kindOfTest:Zw,endsWith:Aat,toArray:Rat,forEachEntry:Fat,matchAll:Iat,isHTMLForm:qat,hasOwnProperty:HZ,hasOwnProp:HZ,reduceDescriptors:YZ,freezeMethods:Wat,toObjectSet:Kat,toCamelCase:jat,noop:Bat,toFiniteNumber:Xat,findKey:ZZ,global:OS,isContextDefined:JZ,isSpecCompliantForm:Gat,toJSONObject:Zat,isAsyncFn:Jat,isThenable:Hat,setImmediate:QZ,asap:Yat,isIterable:e=>e!=null&&Y_(e[LM])};function Rm(e,r,n,v,$){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",r&&(this.code=r),n&&(this.config=n),v&&(this.request=v),$&&(this.response=$,this.status=$.status?$.status:null)}nu.inherits(Rm,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:nu.toJSONObject(this.config),code:this.code,status:this.status}}});const $Z=Rm.prototype,eJ={};["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=>{eJ[e]={value:e}}),Object.defineProperties(Rm,eJ),Object.defineProperty($Z,"isAxiosError",{value:!0}),Rm.from=(e,r,n,v,$,h)=>{const u=Object.create($Z);nu.toFlatObject(e,u,function(a){return a!==Error.prototype},c=>c!=="isAxiosError");const i=e&&e.message?e.message:"Error",p=r==null&&e?e.code:r;return Rm.call(u,i,p,n,v,$),e&&u.cause==null&&Object.defineProperty(u,"cause",{value:e,configurable:!0}),u.name=e&&e.name||"Error",h&&Object.assign(u,h),u};const Qat=null;function fA(e){return nu.isPlainObject(e)||nu.isArray(e)}function tJ(e){return nu.endsWith(e,"[]")?e.slice(0,-2):e}function rJ(e,r,n){return e?e.concat(r).map(function($,h){return $=tJ($),!n&&h?"["+$+"]":$}).join(n?".":""):r}function $at(e){return nu.isArray(e)&&!e.some(fA)}const eit=nu.toFlatObject(nu,{},null,function(r){return/^is[A-Z]/.test(r)});function EM(e,r,n){if(!nu.isObject(e))throw new TypeError("target must be an object");r=r||new FormData,n=nu.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(o,l){return!nu.isUndefined(l[o])});const v=n.metaTokens,$=n.visitor||a,h=n.dots,u=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&nu.isSpecCompliantForm(r);if(!nu.isFunction($))throw new TypeError("visitor must be a function");function c(d){if(d===null)return"";if(nu.isDate(d))return d.toISOString();if(nu.isBoolean(d))return d.toString();if(!p&&nu.isBlob(d))throw new Rm("Blob is not supported. Use a Buffer instead.");return nu.isArrayBuffer(d)||nu.isTypedArray(d)?p&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function a(d,o,l){let s=d;if(d&&!l&&typeof d=="object"){if(nu.endsWith(o,"{}"))o=v?o:o.slice(0,-2),d=JSON.stringify(d);else if(nu.isArray(d)&&$at(d)||(nu.isFileList(d)||nu.endsWith(o,"[]"))&&(s=nu.toArray(d)))return o=tJ(o),s.forEach(function(g,S){!(nu.isUndefined(g)||g===null)&&r.append(u===!0?rJ([o],S,h):u===null?o:o+"[]",c(g))}),!1}return fA(d)?!0:(r.append(rJ(l,o,h),c(d)),!1)}const k=[],T=Object.assign(eit,{defaultVisitor:a,convertValue:c,isVisitable:fA});function x(d,o){if(!nu.isUndefined(d)){if(k.indexOf(d)!==-1)throw Error("Circular reference detected in "+o.join("."));k.push(d),nu.forEach(d,function(s,f){(!(nu.isUndefined(s)||s===null)&&$.call(r,s,nu.isString(f)?f.trim():f,o,T))===!0&&x(s,o?o.concat(f):[f])}),k.pop()}}if(!nu.isObject(e))throw new TypeError("data must be an object");return x(e),r}function nJ(e){const r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(v){return r[v]})}function mA(e,r){this._pairs=[],e&&EM(e,this,r)}const aJ=mA.prototype;aJ.append=function(r,n){this._pairs.push([r,n])},aJ.toString=function(r){const n=r?function(v){return r.call(this,v,nJ)}:nJ;return this._pairs.map(function($){return n($[0])+"="+n($[1])},"").join("&")};function tit(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function iJ(e,r,n){if(!r)return e;const v=n&&n.encode||tit;nu.isFunction(n)&&(n={serialize:n});const $=n&&n.serialize;let h;if($?h=$(r,n):h=nu.isURLSearchParams(r)?r.toString():new mA(r,n).toString(v),h){const u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+h}return e}class oJ{constructor(){this.handlers=[]}use(r,n,v){return this.handlers.push({fulfilled:r,rejected:n,synchronous:v?v.synchronous:!1,runWhen:v?v.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){nu.forEach(this.handlers,function(v){v!==null&&r(v)})}}const sJ={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},rit={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:mA,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},yA=typeof window<"u"&&typeof document<"u",gA=typeof navigator=="object"&&navigator||void 0,nit=yA&&(!gA||["ReactNative","NativeScript","NS"].indexOf(gA.product)<0),ait=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",iit=yA&&window.location.href||"http://localhost",Wx={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:yA,hasStandardBrowserEnv:nit,hasStandardBrowserWebWorkerEnv:ait,navigator:gA,origin:iit},Symbol.toStringTag,{value:"Module"})),...rit};function oit(e,r){return EM(e,new Wx.classes.URLSearchParams,{visitor:function(n,v,$,h){return Wx.isNode&&nu.isBuffer(n)?(this.append(v,n.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)},...r})}function sit(e){return nu.matchAll(/\w+|\[(\w*)]/g,e).map(r=>r[0]==="[]"?"":r[1]||r[0])}function lit(e){const r={},n=Object.keys(e);let v;const $=n.length;let h;for(v=0;v<$;v++)h=n[v],r[h]=e[h];return r}function lJ(e){function r(n,v,$,h){let u=n[h++];if(u==="__proto__")return!0;const i=Number.isFinite(+u),p=h>=n.length;return u=!u&&nu.isArray($)?$.length:u,p?(nu.hasOwnProp($,u)?$[u]=[$[u],v]:$[u]=v,!i):((!$[u]||!nu.isObject($[u]))&&($[u]=[]),r(n,v,$[u],h)&&nu.isArray($[u])&&($[u]=lit($[u])),!i)}if(nu.isFormData(e)&&nu.isFunction(e.entries)){const n={};return nu.forEachEntry(e,(v,$)=>{r(sit(v),$,n,0)}),n}return null}function cit(e,r,n){if(nu.isString(e))try{return(r||JSON.parse)(e),nu.trim(e)}catch(v){if(v.name!=="SyntaxError")throw v}return(n||JSON.stringify)(e)}const f9={transitional:sJ,adapter:["xhr","http","fetch"],transformRequest:[function(r,n){const v=n.getContentType()||"",$=v.indexOf("application/json")>-1,h=nu.isObject(r);if(h&&nu.isHTMLForm(r)&&(r=new FormData(r)),nu.isFormData(r))return $?JSON.stringify(lJ(r)):r;if(nu.isArrayBuffer(r)||nu.isBuffer(r)||nu.isStream(r)||nu.isFile(r)||nu.isBlob(r)||nu.isReadableStream(r))return r;if(nu.isArrayBufferView(r))return r.buffer;if(nu.isURLSearchParams(r))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let i;if(h){if(v.indexOf("application/x-www-form-urlencoded")>-1)return oit(r,this.formSerializer).toString();if((i=nu.isFileList(r))||v.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return EM(i?{"files[]":r}:r,p&&new p,this.formSerializer)}}return h||$?(n.setContentType("application/json",!1),cit(r)):r}],transformResponse:[function(r){const n=this.transitional||f9.transitional,v=n&&n.forcedJSONParsing,$=this.responseType==="json";if(nu.isResponse(r)||nu.isReadableStream(r))return r;if(r&&nu.isString(r)&&(v&&!this.responseType||$)){const u=!(n&&n.silentJSONParsing)&&$;try{return JSON.parse(r,this.parseReviver)}catch(i){if(u)throw i.name==="SyntaxError"?Rm.from(i,Rm.ERR_BAD_RESPONSE,this,null,this.response):i}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Wx.classes.FormData,Blob:Wx.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};nu.forEach(["delete","get","head","post","put","patch"],e=>{f9.headers[e]={}});const uit=nu.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"]),dit=e=>{const r={};let n,v,$;return e&&e.split(`
7993
+ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),v}static addGrid(r,n={}){if(!r)return null;let v=r;if(v.gridstack){const $=v.gridstack;return n&&($.opts={...$.opts,...n}),n.children!==void 0&&$.load(n.children),$}return(!r.classList.contains("grid-stack")||Rh.addRemoveCB)&&(Rh.addRemoveCB?v=Rh.addRemoveCB(r,n,!0,!0):v=ru.createDiv(["grid-stack",n.class],r)),Rh.init(n,v)}static registerEngine(r){Rh.engineClass=r}get placeholder(){if(!this._placeholder){this._placeholder=ru.createDiv([this.opts.placeholderClass,T3.itemClass,this.opts.itemClass]);const r=ru.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(r.textContent=this.opts.placeholderText)}return this._placeholder}constructor(r,n={}){var v;this.el=r,this.opts=n,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},r.gridstack=this,this.opts=n=n||{},r.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),n.row&&(n.minRow=n.maxRow=n.row,delete n.row);const $=ru.toNumber(r.getAttribute("gs-row"));n.column==="auto"&&delete n.column,n.alwaysShowResizeHandle!==void 0&&(n._alwaysShowResizeHandle=n.alwaysShowResizeHandle);const h=n.columnOpts;if(h){const a=h.breakpoints;!h.columnWidth&&!(a!=null&&a.length)?delete n.columnOpts:(h.columnMax=h.columnMax||12,(a==null?void 0:a.length)>1&&a.sort((k,T)=>(T.w||0)-(k.w||0)))}const u={...ru.cloneDeep(T3),column:ru.toNumber(r.getAttribute("gs-column"))||T3.column,minRow:$||ru.toNumber(r.getAttribute("gs-min-row"))||T3.minRow,maxRow:$||ru.toNumber(r.getAttribute("gs-max-row"))||T3.maxRow,staticGrid:ru.toBool(r.getAttribute("gs-static"))||T3.staticGrid,sizeToContent:ru.toBool(r.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(n.handleClass?"."+n.handleClass:n.handle?n.handle:"")||T3.draggable.handle},removableOptions:{accept:n.itemClass||T3.removableOptions.accept,decline:T3.removableOptions.decline}};r.getAttribute("gs-animate")&&(u.animate=ru.toBool(r.getAttribute("gs-animate"))),n=ru.defaults(n,u),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(n),n.rtl==="auto"&&(n.rtl=r.style.direction==="rtl"),n.rtl&&this.el.classList.add("grid-stack-rtl");const i=this.el.closest("."+T3.itemClass),p=i==null?void 0:i.gridstackNode;if(p&&(p.subGrid=this,this.parentGridNode=p,this.el.classList.add("grid-stack-nested"),p.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=n.cellHeight==="auto",this._isAutoCellHeight||n.cellHeight==="initial")this.cellHeight(void 0);else{typeof n.cellHeight=="number"&&n.cellHeightUnit&&n.cellHeightUnit!==T3.cellHeightUnit&&(n.cellHeight=n.cellHeight+n.cellHeightUnit,delete n.cellHeightUnit);const a=n.cellHeight;delete n.cellHeight,this.cellHeight(a)}n.alwaysShowResizeHandle==="mobile"&&(n.alwaysShowResizeHandle=Gw),this._setStaticClass();const c=n.engineClass||Rh.engineClass||P4;if(this.engine=new c({column:this.getColumn(),float:n.float,maxRow:n.maxRow,onChange:a=>{a.forEach(k=>{const T=k.el;T&&(k._removeDOM?(T&&T.remove(),delete k._removeDOM):this._writePosAttr(T,k))}),this._updateContainerHeight()}}),n.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(a=>this._prepareElement(a)),delete this.engine._loading,this.batchUpdate(!1)),n.children){const a=n.children;delete n.children,a.length&&this.load(a)}this.setAnimation(),n.subGridDynamic&&!Mf.pauseDrag&&(Mf.pauseDrag=!0),((v=n.draggable)==null?void 0:v.pause)!==void 0&&(Mf.pauseDrag=n.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(r=this.opts){this.el.classList.add("gs-"+r.column),typeof r.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/r.column}%`)}addWidget(r){if(!r)return;if(typeof r=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(r.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(r);let n,v=r;if(v.grid=this,v.el?n=v.el:Rh.addRemoveCB?n=Rh.addRemoveCB(this.el,r,!0,!1):n=this.createWidgetDivs(v),!n)return;if(v=n.gridstackNode,v&&n.parentElement===this.el&&this.engine.nodes.find(h=>h._id===v._id))return n;const $=this._readAttr(n);return ru.defaults(r,$),this.engine.prepareNode(r),this.el.appendChild(n),this.makeWidget(n,r),n}createWidgetDivs(r){const n=ru.createDiv(["grid-stack-item",this.opts.itemClass]),v=ru.createDiv(["grid-stack-item-content"],n);return ru.lazyLoad(r)?r.visibleObservable||(r.visibleObservable=new IntersectionObserver(([$])=>{var h,u;$.isIntersecting&&((h=r.visibleObservable)==null||h.disconnect(),delete r.visibleObservable,Rh.renderCB(v,r),(u=r.grid)==null||u.prepareDragDrop(r.el))}),window.setTimeout(()=>{var $;return($=r.visibleObservable)==null?void 0:$.observe(n)})):Rh.renderCB(v,r),n}makeSubGrid(r,n,v,$=!0){var h,u,i;let p=r.gridstackNode;if(p||(p=this.makeWidget(r).gridstackNode),(h=p.subGrid)!=null&&h.el)return p.subGrid;let c,a=this;for(;a&&!c;)c=(u=a.opts)==null?void 0:u.subGridOpts,a=(i=a.parentGridNode)==null?void 0:i.grid;n=ru.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...c||{},...n||p.subGridOpts||{}}),p.subGridOpts=n;let k;n.column==="auto"&&(k=!0,n.column=Math.max(p.w||1,(v==null?void 0:v.w)||1),delete n.columnOpts);let T=p.el.querySelector(".grid-stack-item-content"),x,d;if($&&(this._removeDD(p.el),d={...p,x:0,y:0},ru.removeInternalForSave(d),delete d.subGridOpts,p.content&&(d.content=p.content,delete p.content),Rh.addRemoveCB?x=Rh.addRemoveCB(this.el,d,!0,!1):(x=ru.createDiv(["grid-stack-item"]),x.appendChild(T),T=ru.createDiv(["grid-stack-item-content"],p.el)),this.prepareDragDrop(p.el)),v){const l=k?n.column:p.w,s=p.h+v.h,f=p.el.style;f.transition="none",this.update(p.el,{w:l,h:s}),setTimeout(()=>f.transition=null)}const o=p.subGrid=Rh.addGrid(T,n);return v!=null&&v._moving&&(o._isTemp=!0),k&&(o._autoColumn=!0),$&&o.makeWidget(x,d),v&&(v._moving?window.setTimeout(()=>ru.simulateMouseEvent(v._event,"mouseenter",o.el),0):o.makeWidget(p.el,p)),this.resizeToContentCheck(!1,p),o}removeAsSubGrid(r){var n;const v=(n=this.parentGridNode)==null?void 0:n.grid;v&&(v.batchUpdate(),v.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach($=>{$.x+=this.parentGridNode.x,$.y+=this.parentGridNode.y,v.makeWidget($.el,$)}),v.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,r&&window.setTimeout(()=>ru.simulateMouseEvent(r._event,"mouseenter",v.el),0))}save(r=!0,n=!1,v=Rh.saveCB,$){const h=this.engine.save(r,v,$);if(h.forEach(u=>{var i;if(r&&u.el&&!u.subGrid&&!v){const p=u.el.querySelector(".grid-stack-item-content");u.content=p==null?void 0:p.innerHTML,u.content||delete u.content}else if(!r&&!v&&delete u.content,(i=u.subGrid)!=null&&i.el){const p=u.w||u.subGrid.getColumn(),c=u.subGrid.save(r,n,v,p);u.subGridOpts=n?c:{children:c},delete u.subGrid}delete u.el}),n){const u=ru.cloneDeep(this.opts);u.marginBottom===u.marginTop&&u.marginRight===u.marginLeft&&u.marginTop===u.marginRight&&(u.margin=u.marginTop,delete u.marginTop,delete u.marginRight,delete u.marginBottom,delete u.marginLeft),u.rtl===(this.el.style.direction==="rtl")&&(u.rtl="auto"),this._isAutoCellHeight&&(u.cellHeight="auto"),this._autoColumn&&(u.column="auto");const i=u._alwaysShowResizeHandle;return delete u._alwaysShowResizeHandle,i!==void 0?u.alwaysShowResizeHandle=i:delete u.alwaysShowResizeHandle,ru.removeInternalAndSame(u,T3),u.children=h,u}return h}load(r,n=Rh.addRemoveCB||!0){r=ru.cloneDeep(r);const v=this.getColumn();r.forEach(a=>{a.w=a.w||a.minW||1,a.h=a.h||a.minH||1}),r=ru.sort(r),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let $=0;r.forEach(a=>{$=Math.max($,(a.x||0)+a.w)}),$>this.engine.defaultColumn&&(this.engine.defaultColumn=$),$>v&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=r,this.engine.columnChanged($,v,this.responseLayout),r=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(r,$,!0));const h=Rh.addRemoveCB;typeof n=="function"&&(Rh.addRemoveCB=n);const u=[];this.batchUpdate();const i=!this.engine.nodes.length,p=i&&this.opts.animate;p&&this.setAnimation(!1),!i&&n&&[...this.engine.nodes].forEach(a=>{a.id&&(ru.find(r,a.id)||(Rh.addRemoveCB&&Rh.addRemoveCB(this.el,a,!1,!1),u.push(a),this.removeWidget(a.el,!0,!1)))}),this.engine._loading=!0;const c=[];return this.engine.nodes=this.engine.nodes.filter(a=>ru.find(r,a.id)?(c.push(a),!1):!0),r.forEach(a=>{var k;const T=ru.find(c,a.id);if(T){if(ru.shouldSizeToContent(T)&&(a.h=T.h),this.engine.nodeBoundFix(a),(a.autoPosition||a.x===void 0||a.y===void 0)&&(a.w=a.w||T.w,a.h=a.h||T.h,this.engine.findEmptyPosition(a)),this.engine.nodes.push(T),ru.samePos(T,a)&&this.engine.nodes.length>1&&(this.moveNode(T,{...a,forceCollide:!0}),ru.copyPos(a,T)),this.update(T.el,a),(k=a.subGridOpts)!=null&&k.children){const x=T.el.querySelector(".grid-stack");x&&x.gridstack&&x.gridstack.load(a.subGridOpts.children)}}else n&&this.addWidget(a)}),delete this.engine._loading,this.engine.removedNodes=u,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,h?Rh.addRemoveCB=h:delete Rh.addRemoveCB,p&&this.setAnimation(!0,!0),this}batchUpdate(r=!0){return this.engine.batchUpdate(r),r||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(r=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!r||!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 n=this.el.querySelector("."+this.opts.itemClass);if(n){const $=ru.toNumber(n.getAttribute("gs-h"))||1;return Math.round(n.offsetHeight/$)}const v=parseInt(this.el.getAttribute("gs-current-row"));return v?Math.round(this.el.getBoundingClientRect().height/v):this.opts.cellHeight}cellHeight(r){if(r!==void 0&&this._isAutoCellHeight!==(r==="auto")&&(this._isAutoCellHeight=r==="auto",this._updateResizeEvent()),(r==="initial"||r==="auto")&&(r=void 0),r===void 0){const v=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;r=this.cellWidth()+v}const n=ru.parseHeight(r);return this.opts.cellHeightUnit===n.unit&&this.opts.cellHeight===n.h?this:(this.opts.cellHeightUnit=n.unit,this.opts.cellHeight=n.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(r=!1){var n;return r&&(n=this.opts.columnOpts)!=null&&n.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var r,n;const v=this.opts.columnOpts;if(!v||!v.columnWidth&&!((r=v.breakpoints)!=null&&r.length))return!1;const $=this.getColumn();let h=$;const u=this._widthOrContainer(!0);if(v.columnWidth)h=Math.min(Math.round(u/v.columnWidth)||1,v.columnMax);else{h=v.columnMax;let i=0;for(;i<v.breakpoints.length&&u<=v.breakpoints[i].w;)h=v.breakpoints[i++].c||$}if(h!==$){const i=(n=v.breakpoints)==null?void 0:n.find(p=>p.c===h);return this.column(h,(i==null?void 0:i.layout)||v.layout),!0}return!1}compact(r="compact",n=!0){return this.engine.compact(r,n),this._triggerChangeEvent(),this}column(r,n="moveScale"){if(!r||r<1||this.opts.column===r)return this;const v=this.getColumn();return this.opts.column=r,this.engine?(this.engine.column=r,this.el.classList.remove("gs-"+v),this._updateColumnVar(),this.engine.columnChanged(v,r,n),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=n,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(r=>r.matches("."+this.opts.itemClass)&&!r.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(r=!0){var n;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),r?this.el.parentNode.removeChild(this.el):(this.removeAll(r),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,(n=this._placeholder)==null||delete n.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(r){return this.opts.float!==r&&(this.opts.float=this.engine.float=r,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(r,n=!1){const v=this.el.getBoundingClientRect();let $;n?$={top:v.top+document.documentElement.scrollTop,left:v.left}:$={top:this.el.offsetTop,left:this.el.offsetLeft};const h=r.left-$.left,u=r.top-$.top,i=v.width/this.getColumn(),p=v.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(h/i),y:Math.floor(u/p)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(r,n,v,$){return this.engine.isAreaEmpty(r,n,v,$)}makeWidget(r,n){const v=Rh.getElement(r);if(!v||v.gridstackNode)return v;v.parentElement||this.el.appendChild(v),this._prepareElement(v,!0,n);const $=v.gridstackNode;this._updateContainerHeight(),$.subGridOpts&&this.makeSubGrid(v,$.subGridOpts,void 0,!1);let h;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(h=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),h&&delete this._ignoreLayoutsNodeChange,v}on(r,n){return r.indexOf(" ")!==-1?(r.split(" ").forEach(v=>this.on(v,n)),this):(r==="change"||r==="added"||r==="removed"||r==="enable"||r==="disable"?(r==="enable"||r==="disable"?this._gsEventHandler[r]=v=>n(v):this._gsEventHandler[r]=v=>{v.detail&&n(v,v.detail)},this.el.addEventListener(r,this._gsEventHandler[r])):r==="drag"||r==="dragstart"||r==="dragstop"||r==="resizestart"||r==="resize"||r==="resizestop"||r==="dropped"||r==="resizecontent"?this._gsEventHandler[r]=n:console.error("GridStack.on("+r+") event not supported"),this)}off(r){return r.indexOf(" ")!==-1?(r.split(" ").forEach(n=>this.off(n)),this):((r==="change"||r==="added"||r==="removed"||r==="enable"||r==="disable")&&this._gsEventHandler[r]&&this.el.removeEventListener(r,this._gsEventHandler[r]),delete this._gsEventHandler[r],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(r=>this.off(r)),this}removeWidget(r,n=!0,v=!0){return r?(Rh.getElements(r).forEach($=>{if($.parentElement&&$.parentElement!==this.el)return;let h=$.gridstackNode;h||(h=this.engine.nodes.find(u=>$===u.el)),h&&(n&&Rh.addRemoveCB&&Rh.addRemoveCB(this.el,h,!1,!1),delete $.gridstackNode,this._removeDD($),this.engine.removeNode(h,n,v),n&&$.parentElement&&$.remove())}),v&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(r=!0,n=!0){return this.engine.nodes.forEach(v=>{r&&Rh.addRemoveCB&&Rh.addRemoveCB(this.el,v,!1,!1),delete v.el.gridstackNode,this.opts.staticGrid||this._removeDD(v.el)}),this.engine.removeAll(r,n),n&&this._triggerRemoveEvent(),this}setAnimation(r=this.opts.animate,n){return n?setTimeout(()=>{this.opts&&this.setAnimation(r)}):r?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=r,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(r,n=!0,v=!0){return!!this.opts.staticGrid===r?this:(r?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach($=>{this.prepareDragDrop($.el),$.subGrid&&v&&$.subGrid.setStatic(r,n,v)}),n&&this._setStaticClass(),this)}updateOptions(r){var n;const v=this.opts;return r===v?this:(r.acceptWidgets!==void 0&&(v.acceptWidgets=r.acceptWidgets,this._setupAcceptWidget()),r.animate!==void 0&&this.setAnimation(r.animate),r.cellHeight&&this.cellHeight(r.cellHeight),r.class!==void 0&&r.class!==v.class&&(v.class&&this.el.classList.remove(v.class),r.class&&this.el.classList.add(r.class)),r.columnOpts?(this.opts.columnOpts=r.columnOpts,this.checkDynamicColumn()):r.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof r.column=="number"&&this.column(r.column),r.margin!==void 0&&this.margin(r.margin),r.staticGrid!==void 0&&this.setStatic(r.staticGrid),r.disableDrag!==void 0&&!r.staticGrid&&this.enableMove(!r.disableDrag),r.disableResize!==void 0&&!r.staticGrid&&this.enableResize(!r.disableResize),r.float!==void 0&&this.float(r.float),r.row!==void 0?(v.minRow=v.maxRow=v.row=r.row,this._updateContainerHeight()):(r.minRow!==void 0&&(v.minRow=r.minRow,this._updateContainerHeight()),r.maxRow!==void 0&&(v.maxRow=r.maxRow)),r.lazyLoad!==void 0&&(v.lazyLoad=r.lazyLoad),(n=r.children)!=null&&n.length&&this.load(r.children),this)}update(r,n){return Rh.getElements(r).forEach(v=>{var $;const h=v==null?void 0:v.gridstackNode;if(!h)return;const u={...ru.copyPos({},h),...ru.cloneDeep(n)};this.engine.nodeBoundFix(u),delete u.autoPosition;const i=["x","y","w","h"];let p;if(i.some(k=>u[k]!==void 0&&u[k]!==h[k])&&(p={},i.forEach(k=>{p[k]=u[k]!==void 0?u[k]:h[k],delete u[k]})),!p&&(u.minW||u.minH||u.maxW||u.maxH)&&(p={}),u.content!==void 0){const k=v.querySelector(".grid-stack-item-content");k&&k.textContent!==u.content&&(h.content=u.content,Rh.renderCB(k,u),($=h.subGrid)!=null&&$.el&&(k.appendChild(h.subGrid.el),h.subGrid._updateContainerHeight())),delete u.content}let c=!1,a=!1;for(const k in u)k[0]!=="_"&&h[k]!==u[k]&&(h[k]=u[k],c=!0,a=a||!this.opts.staticGrid&&(k==="noResize"||k==="noMove"||k==="locked"));if(ru.sanitizeMinMax(h),p){const k=p.w!==void 0&&p.w!==h.w;this.moveNode(h,p),k&&h.subGrid?h.subGrid.onResize(this.hasAnimationCSS()?h.w:void 0):this.resizeToContentCheck(k,h),delete h._orig}(p||c)&&this._writeAttr(v,h),a&&this.prepareDragDrop(h.el),Rh.updateCB&&Rh.updateCB(h)}),this}moveNode(r,n){const v=r._updating;v||this.engine.cleanNodes().beginUpdate(r),this.engine.moveNode(r,n),this._updateContainerHeight(),v||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(r){var n,v;if(!r||(r.classList.remove("size-to-content-max"),!r.clientHeight))return;const $=r.gridstackNode;if(!$)return;const h=$.grid;if(!h||r.parentElement!==h.el)return;const u=h.getCellHeight(!0);if(!u)return;let i=$.h?$.h*u:r.clientHeight,p;if($.resizeToContentParent&&(p=r.querySelector($.resizeToContentParent)),p||(p=r.querySelector(Rh.resizeToContentParent)),!p)return;const c=r.clientHeight-p.clientHeight,a=$.h?$.h*u-c:p.clientHeight;let k;if($.subGrid){k=$.subGrid.getRow()*$.subGrid.getCellHeight(!0);const d=$.subGrid.el.getBoundingClientRect(),o=r.getBoundingClientRect();k+=d.top-o.top}else{if((v=(n=$.subGridOpts)==null?void 0:n.children)!=null&&v.length)return;{const d=p.firstElementChild;if(!d){console.error(`Error: GridStack.resizeToContent() widget id:${$.id} '${Rh.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}k=d.getBoundingClientRect().height||a}}if(a===k)return;i+=k-a;let T=Math.ceil(i/u);const x=Number.isInteger($.sizeToContent)?$.sizeToContent:0;x&&T>x&&(T=x,r.classList.add("size-to-content-max")),$.minH&&T<$.minH?T=$.minH:$.maxH&&T>$.maxH&&(T=$.maxH),T!==$.h&&(h._ignoreLayoutsNodeChange=!0,h.moveNode($,{h:T}),delete h._ignoreLayoutsNodeChange)}resizeToContentCBCheck(r){Rh.resizeToContentCB?Rh.resizeToContentCB(r):this.resizeToContent(r)}rotate(r,n){return Rh.getElements(r).forEach(v=>{const $=v.gridstackNode;if(!ru.canBeRotated($))return;const h={w:$.h,h:$.w,minH:$.minW,minW:$.minH,maxH:$.maxW,maxW:$.maxH};if(n){const i=n.left>0?Math.floor(n.left/this.cellWidth()):0,p=n.top>0?Math.floor(n.top/this.opts.cellHeight):0;h.x=$.x+i-($.h-(p+1)),h.y=$.y+p-i}Object.keys(h).forEach(i=>{h[i]===void 0&&delete h[i]});const u=$._orig;this.update(v,h),$._orig=u}),this}margin(r){if(!(typeof r=="string"&&r.split(" ").length>1)){const n=ru.parseHeight(r);if(this.opts.marginUnit===n.unit&&this.opts.margin===n.h)return}return this.opts.margin=r,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(r){return this.engine.willItFit(r)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const r=this.engine.getDirtyNodes(!0);return r&&r.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(r),this._triggerEvent("change",r)),this.engine.saveInitial(),this}_triggerAddEvent(){var r;if(this.engine.batchMode)return this;if((r=this.engine.addedNodes)!=null&&r.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(v=>{delete v._dirty});const n=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",n)}return this}_triggerRemoveEvent(){var r;if(this.engine.batchMode)return this;if((r=this.engine.removedNodes)!=null&&r.length){const n=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",n)}return this}_triggerEvent(r,n){const v=n?new CustomEvent(r,{bubbles:!1,detail:n}):new Event(r);let $=this;for(;$.parentGridNode;)$=$.parentGridNode.grid;return $.el.dispatchEvent(v),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const r=this.parentGridNode;let n=this.getRow()+this._extraDragRow;const v=this.opts.cellHeight,$=this.opts.cellHeightUnit;if(!v)return this;if(!r&&!this.opts.minRow){const h=ru.parseHeight(getComputedStyle(this.el).minHeight);if(h.h>0&&h.unit===$){const u=Math.floor(h.h/v);n<u&&(n=u)}}return this.el.setAttribute("gs-current-row",String(n)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),n&&(this.el.style[r?"minHeight":"height"]=n*v+$),r&&ru.shouldSizeToContent(r)&&r.grid.resizeToContentCBCheck(r.el),this}_prepareElement(r,n=!1,v){v=v||this._readAttr(r),r.gridstackNode=v,v.el=r,v.grid=this,v=this.engine.addNode(v,n),this._writeAttr(r,v),r.classList.add(T3.itemClass,this.opts.itemClass);const $=ru.shouldSizeToContent(v);return $?r.classList.add("size-to-content"):r.classList.remove("size-to-content"),$&&this.resizeToContentCheck(!1,v),ru.lazyLoad(v)||this.prepareDragDrop(v.el),this}_writePosAttr(r,n){return(!n._moving&&!n._resizing||this._placeholder===r)&&(r.style.top=n.y?n.y===1?"var(--gs-cell-height)":`calc(${n.y} * var(--gs-cell-height))`:null,r.style.left=n.x?n.x===1?"var(--gs-column-width)":`calc(${n.x} * var(--gs-column-width))`:null,r.style.width=n.w>1?`calc(${n.w} * var(--gs-column-width))`:null,r.style.height=n.h>1?`calc(${n.h} * var(--gs-cell-height))`:null),r.setAttribute("gs-x",String(n.x)),r.setAttribute("gs-y",String(n.y)),n.w>1?r.setAttribute("gs-w",String(n.w)):r.removeAttribute("gs-w"),n.h>1?r.setAttribute("gs-h",String(n.h)):r.removeAttribute("gs-h"),this}_writeAttr(r,n){if(!n)return this;this._writePosAttr(r,n);const v={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const $ in v)n[$]?r.setAttribute(v[$],String(n[$])):r.removeAttribute(v[$]);return this}_readAttr(r,n=!0){const v={};v.x=ru.toNumber(r.getAttribute("gs-x")),v.y=ru.toNumber(r.getAttribute("gs-y")),v.w=ru.toNumber(r.getAttribute("gs-w")),v.h=ru.toNumber(r.getAttribute("gs-h")),v.autoPosition=ru.toBool(r.getAttribute("gs-auto-position")),v.noResize=ru.toBool(r.getAttribute("gs-no-resize")),v.noMove=ru.toBool(r.getAttribute("gs-no-move")),v.locked=ru.toBool(r.getAttribute("gs-locked"));const $=r.getAttribute("gs-size-to-content");$&&($==="true"||$==="false"?v.sizeToContent=ru.toBool($):v.sizeToContent=parseInt($,10)),v.id=r.getAttribute("gs-id"),v.maxW=ru.toNumber(r.getAttribute("gs-max-w")),v.minW=ru.toNumber(r.getAttribute("gs-min-w")),v.maxH=ru.toNumber(r.getAttribute("gs-max-h")),v.minH=ru.toNumber(r.getAttribute("gs-min-h")),n&&(v.w===1&&r.removeAttribute("gs-w"),v.h===1&&r.removeAttribute("gs-h"),v.maxW&&r.removeAttribute("gs-max-w"),v.minW&&r.removeAttribute("gs-min-w"),v.maxH&&r.removeAttribute("gs-max-h"),v.minH&&r.removeAttribute("gs-min-h"));for(const h in v){if(!v.hasOwnProperty(h))return;!v[h]&&v[h]!==0&&h!=="sizeToContent"&&delete v[h]}return v}_setStaticClass(){const r=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...r),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...r),this.el.removeAttribute("gs-static")),this}onResize(r=(n=>(n=this.el)==null?void 0:n.clientWidth)()){if(!r||this.prevWidth===r)return;this.prevWidth=r,this.batchUpdate();let n=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),n=!0):n=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(v=>{v.subGrid&&v.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(n),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(r=!1,n=void 0){if(this.engine){if(r&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,n),this.animationDelay);if(n)ru.shouldSizeToContent(n)&&this.resizeToContentCBCheck(n.el);else if(this.engine.nodes.some(v=>ru.shouldSizeToContent(v))){const v=[...this.engine.nodes];this.batchUpdate(),v.forEach($=>{ru.shouldSizeToContent($)&&this.resizeToContentCBCheck($.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,n?[n]:this.engine.nodes)}}_updateResizeEvent(r=!1){const n=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(v=>v.sizeToContent));return!r&&n&&!this.resizeObserver?(this._sizeThrottle=ru.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(r||!n)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(r=".grid-stack-item"){return ru.getElement(r)}static getElements(r=".grid-stack-item"){return ru.getElements(r)}static getGridElement(r){return Rh.getElement(r)}static getGridElements(r){return ru.getElements(r)}_initMargin(){let r,n=0,v=[];typeof this.opts.margin=="string"&&(v=this.opts.margin.split(" ")),v.length===2?(this.opts.marginTop=this.opts.marginBottom=v[0],this.opts.marginLeft=this.opts.marginRight=v[1]):v.length===4?(this.opts.marginTop=v[0],this.opts.marginRight=v[1],this.opts.marginBottom=v[2],this.opts.marginLeft=v[3]):(r=ru.parseHeight(this.opts.margin),this.opts.marginUnit=r.unit,n=this.opts.margin=r.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(h=>{this.opts[h]===void 0?this.opts[h]=n:(r=ru.parseHeight(this.opts[h]),this.opts[h]=r.h,delete this.opts.margin)}),this.opts.marginUnit=r.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 $=this.el.style;return $.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),$.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),$.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),$.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return u_}static setupDragIn(r,n,v,$=document){(n==null?void 0:n.pause)!==void 0&&(Mf.pauseDrag=n.pause),n={appendTo:"body",helper:"clone",...n||{}},(typeof r=="string"?ru.getElements(r,$):r).forEach((h,u)=>{u_.isDraggable(h)||u_.dragIn(h,n),v!=null&&v[u]&&(h.gridstackNode=v[u])})}movable(r,n){return this.opts.staticGrid?this:(Rh.getElements(r).forEach(v=>{const $=v.gridstackNode;$&&(n?delete $.noMove:$.noMove=!0,this.prepareDragDrop($.el))}),this)}resizable(r,n){return this.opts.staticGrid?this:(Rh.getElements(r).forEach(v=>{const $=v.gridstackNode;$&&(n?delete $.noResize:$.noResize=!0,this.prepareDragDrop($.el))}),this)}disable(r=!0){if(!this.opts.staticGrid)return this.enableMove(!1,r),this.enableResize(!1,r),this._triggerEvent("disable"),this}enable(r=!0){if(!this.opts.staticGrid)return this.enableMove(!0,r),this.enableResize(!0,r),this._triggerEvent("enable"),this}enableMove(r,n=!0){return this.opts.staticGrid?this:(r?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(v=>{this.prepareDragDrop(v.el),v.subGrid&&n&&v.subGrid.enableMove(r,n)}),this)}enableResize(r,n=!0){return this.opts.staticGrid?this:(r?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(v=>{this.prepareDragDrop(v.el),v.subGrid&&n&&v.subGrid.enableResize(r,n)}),this)}cancelDrag(){var r;const n=(r=this._placeholder)==null?void 0:r.gridstackNode;n&&(n._isExternal?(n._isAboutToRemove=!0,this.engine.removeNode(n)):n._isAboutToRemove&&Rh._itemRemoving(n.el,!1),this.engine.restoreInitial())}_removeDD(r){return u_.draggable(r,"destroy").resizable(r,"destroy"),r.gridstackNode&&delete r.gridstackNode._initDD,delete r.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return u_.droppable(this.el,"destroy"),this;let r,n;const v=($,h,u)=>{var i;u=u||h;const p=u.gridstackNode;if(!p)return;if(!((i=p.grid)!=null&&i.el)){u.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const x=u.getBoundingClientRect();u.style.left=x.x+(this.dragTransform.xScale-1)*($.clientX-x.x)/this.dragTransform.xScale+"px",u.style.top=x.y+(this.dragTransform.yScale-1)*($.clientY-x.y)/this.dragTransform.yScale+"px",u.style.transformOrigin="0px 0px"}let{top:c,left:a}=u.getBoundingClientRect();const k=this.el.getBoundingClientRect();a-=k.left,c-=k.top;const T={position:{top:c*this.dragTransform.xScale,left:a*this.dragTransform.yScale}};if(p._temporaryRemoved){if(p.x=Math.max(0,Math.round(a/n)),p.y=Math.max(0,Math.round(c/r)),delete p.autoPosition,this.engine.nodeBoundFix(p),!this.engine.willItFit(p)){if(p.autoPosition=!0,!this.engine.willItFit(p)){u_.off(h,"drag");return}p._willFitPos&&(ru.copyPos(p,p._willFitPos),delete p._willFitPos)}this._onStartMoving(u,$,T,p,n,r)}else this._dragOrResize(u,$,T,p,n,r)};return u_.droppable(this.el,{accept:$=>{const h=$.gridstackNode||this._readAttr($,!1);if((h==null?void 0:h.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let u=!0;if(typeof this.opts.acceptWidgets=="function")u=this.opts.acceptWidgets($);else{const i=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;u=$.matches(i)}if(u&&h&&this.opts.maxRow){const i={w:h.w,h:h.h,minW:h.minW,minH:h.minH};u=this.engine.willItFit(i)}return u}}).on(this.el,"dropover",($,h,u)=>{let i=(u==null?void 0:u.gridstackNode)||h.gridstackNode;if((i==null?void 0:i.grid)===this&&!i._temporaryRemoved)return!1;if(i!=null&&i._sidebarOrig&&(i.w=i._sidebarOrig.w,i.h=i._sidebarOrig.h),i!=null&&i.grid&&i.grid!==this&&!i._temporaryRemoved&&i.grid._leave(h,u),u=u||h,n=this.cellWidth(),r=this.getCellHeight(!0),!i){const a=u.getAttribute("data-gs-widget")||u.getAttribute("gridstacknode");if(a){try{i=JSON.parse(a)}catch{console.error("Gridstack dropover: Bad JSON format: ",a)}u.removeAttribute("data-gs-widget"),u.removeAttribute("gridstacknode")}i||(i=this._readAttr(u)),i._sidebarOrig={w:i.w,h:i.h}}i.grid||(i.el||(i={...i}),i._isExternal=!0,u.gridstackNode=i);const p=i.w||Math.round(u.offsetWidth/n)||1,c=i.h||Math.round(u.offsetHeight/r)||1;return i.grid&&i.grid!==this?(h._gridstackNodeOrig||(h._gridstackNodeOrig=i),h.gridstackNode=i={...i,w:p,h:c,grid:this},delete i.x,delete i.y,this.engine.cleanupNode(i).nodeBoundFix(i),i._initDD=i._isExternal=i._temporaryRemoved=!0):(i.w=p,i.h=c,i._temporaryRemoved=!0),Rh._itemRemoving(i.el,!1),u_.on(h,"drag",v),v($,h,u),!1}).on(this.el,"dropout",($,h,u)=>{const i=(u==null?void 0:u.gridstackNode)||h.gridstackNode;return i&&(!i.grid||i.grid===this)&&(this._leave(h,u),this._isTemp&&this.removeAsSubGrid(i)),!1}).on(this.el,"drop",($,h,u)=>{var i,p,c;const a=(u==null?void 0:u.gridstackNode)||h.gridstackNode;if((a==null?void 0:a.grid)===this&&!a._isExternal)return!1;const k=!!this.placeholder.parentElement,T=h!==u;this.placeholder.remove(),delete this.placeholder.gridstackNode,k&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const x=h._gridstackNodeOrig;if(delete h._gridstackNodeOrig,k&&x!=null&&x.grid&&x.grid!==this){const o=x.grid;o.engine.removeNodeFromLayoutCache(x),o.engine.removedNodes.push(x),o._triggerRemoveEvent()._triggerChangeEvent(),o.parentGridNode&&!o.engine.nodes.length&&o.opts.subGridDynamic&&o.removeAsSubGrid()}if(!a||(k&&(this.engine.cleanupNode(a),a.grid=this),(i=a.grid)==null||delete i._isTemp,u_.off(h,"drag"),u!==h?(u.remove(),h=u):h.remove(),this._removeDD(h),!k))return!1;const d=(c=(p=a.subGrid)==null?void 0:p.el)==null?void 0:c.gridstack;return ru.copyPos(a,this._readAttr(this.placeholder)),ru.removePositioningStyles(h),T&&(a.content||a.subGridOpts||Rh.addRemoveCB)?(delete a.el,h=this.addWidget(a)):(this._prepareElement(h,!0,a),this.el.appendChild(h),this.resizeToContentCheck(!1,a),d&&(d.parentGridNode=a),this._updateContainerHeight()),this.engine.addedNodes.push(a),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...$,type:"dropped"},x&&x.grid?x:void 0,a),!1}),this}static _itemRemoving(r,n){if(!r)return;const v=r?r.gridstackNode:void 0;!(v!=null&&v.grid)||r.classList.contains(v.grid.opts.removableOptions.decline)||(n?v._isAboutToRemove=!0:delete v._isAboutToRemove,n?r.classList.add("grid-stack-item-removing"):r.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const r=document.querySelector(this.opts.removable);return r?(!this.opts.staticGrid&&!u_.isDroppable(r)&&u_.droppable(r,this.opts.removableOptions).on(r,"dropover",(n,v)=>Rh._itemRemoving(v,!0)).on(r,"dropout",(n,v)=>Rh._itemRemoving(v,!1)),this):this}prepareDragDrop(r,n=!1){const v=r==null?void 0:r.gridstackNode;if(!v)return;const $=v.noMove||this.opts.disableDrag,h=v.noResize||this.opts.disableResize,u=this.opts.staticGrid||$&&h;if((n||u)&&(v._initDD&&(this._removeDD(r),delete v._initDD),u&&r.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!n))return this;if(!v._initDD){let i,p;const c=(T,x)=>{this.triggerEvent(T,T.target),i=this.cellWidth(),p=this.getCellHeight(!0),this._onStartMoving(r,T,x,v,i,p)},a=(T,x)=>{this._dragOrResize(r,T,x,v,i,p)},k=T=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete v._moving,delete v._resizing,delete v._event,delete v._lastTried;const x=v.w!==v._orig.w,d=T.target;if(!(!d.gridstackNode||d.gridstackNode.grid!==this)){if(v.el=d,v._isAboutToRemove){const o=r.gridstackNode.grid;o._gsEventHandler[T.type]&&o._gsEventHandler[T.type](T,d),o.engine.nodes.push(v),o.removeWidget(r,!0,!0)}else ru.removePositioningStyles(d),v._temporaryRemoved?(this._writePosAttr(d,v),this.engine.addNode(v)):this._writePosAttr(d,v),this.triggerEvent(T,d);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),T.type==="resizestop"&&(Number.isInteger(v.sizeToContent)&&(v.sizeToContent=v.h),this.resizeToContentCheck(x,v))}};u_.draggable(r,{start:c,stop:k,drag:a}).resizable(r,{start:c,stop:k,resize:a}),v._initDD=!0}return u_.draggable(r,$?"disable":"enable").resizable(r,h?"disable":"enable"),this}_onStartMoving(r,n,v,$,h,u){var i;if(this.engine.cleanNodes().beginUpdate($),this._writePosAttr(this.placeholder,$),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=$,(i=$.grid)!=null&&i.el)this.dragTransform=ru.getValuesFromTransformedElement(r);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const p=this.placeholder.closest(".grid-stack");this.dragTransform=ru.getValuesFromTransformedElement(p)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if($.el=this.placeholder,$._lastUiPosition=v.position,$._prevYPix=v.position.top,$._moving=n.type==="dragstart",$._resizing=n.type==="resizestart",delete $._lastTried,n.type==="dropover"&&$._temporaryRemoved&&(this.engine.addNode($),$._moving=!0),this.engine.cacheRects(h,u,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),n.type==="resizestart"){const p=this.getColumn()-$.x,c=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-$.y;u_.resizable(r,"option","minWidth",h*Math.min($.minW||1,p)).resizable(r,"option","minHeight",u*Math.min($.minH||1,c)).resizable(r,"option","maxWidth",h*Math.min($.maxW||Number.MAX_SAFE_INTEGER,p)).resizable(r,"option","maxWidthMoveLeft",h*Math.min($.maxW||Number.MAX_SAFE_INTEGER,$.x+$.w)).resizable(r,"option","maxHeight",u*Math.min($.maxH||Number.MAX_SAFE_INTEGER,c)).resizable(r,"option","maxHeightMoveUp",u*Math.min($.maxH||Number.MAX_SAFE_INTEGER,$.y+$.h))}}_dragOrResize(r,n,v,$,h,u){const i={...$._orig};let p,c=this.opts.marginLeft,a=this.opts.marginRight,k=this.opts.marginTop,T=this.opts.marginBottom;const x=Math.round(u*.1),d=Math.round(h*.1);if(c=Math.min(c,d),a=Math.min(a,d),k=Math.min(k,x),T=Math.min(T,x),n.type==="drag"){if($._temporaryRemoved)return;const l=v.position.top-$._prevYPix;$._prevYPix=v.position.top,this.opts.draggable.scroll!==!1&&ru.updateScrollPosition(r,v.position,l);const s=v.position.left+(v.position.left>$._lastUiPosition.left?-a:c),f=v.position.top+(v.position.top>$._lastUiPosition.top?-T:k);i.x=Math.round(s/h),i.y=Math.round(f/u);const g=this._extraDragRow;if(this.engine.collide($,i)){const S=this.getRow();let L=Math.max(0,i.y+$.h-S);this.opts.maxRow&&S+L>this.opts.maxRow&&(L=Math.max(0,this.opts.maxRow-S)),this._extraDragRow=L}else this._extraDragRow=0;if(this._extraDragRow!==g&&this._updateContainerHeight(),$.x===i.x&&$.y===i.y)return}else if(n.type==="resize"){if(i.x<0||(ru.updateScrollResize(n,r,u),i.w=Math.round((v.size.width-c)/h),i.h=Math.round((v.size.height-k)/u),$.w===i.w&&$.h===i.h)||$._lastTried&&$._lastTried.w===i.w&&$._lastTried.h===i.h)return;const l=v.position.left+c,s=v.position.top+k;i.x=Math.round(l/h),i.y=Math.round(s/u),p=!0}$._event=n,$._lastTried=i;const o={x:v.position.left+c,y:v.position.top+k,w:(v.size?v.size.width:$.w*h)-c-a,h:(v.size?v.size.height:$.h*u)-k-T};if(this.engine.moveNodeCheck($,{...i,cellWidth:h,cellHeight:u,rect:o,resizing:p})){$._lastUiPosition=v.position,this.engine.cacheRects(h,u,k,a,T,c),delete $._skipDown,p&&$.subGrid&&$.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const l=n.target;$._sidebarOrig||this._writePosAttr(l,$),this.triggerEvent(n,l)}}triggerEvent(r,n){let v=this;for(;v.parentGridNode;)v=v.parentGridNode.grid;v._gsEventHandler[r.type]&&v._gsEventHandler[r.type](r,n)}_leave(r,n){n=n||r;const v=n.gridstackNode;if(!v||(n.style.transform=n.style.transformOrigin=null,u_.off(r,"drag"),v._temporaryRemoved))return;v._temporaryRemoved=!0,this.engine.removeNode(v),v.el=v._isExternal&&n?n:r;const $=v._sidebarOrig;v._isExternal&&this.engine.cleanupNode(v),v._sidebarOrig=$,this.opts.removable===!0&&Rh._itemRemoving(r,!0),r._gridstackNodeOrig?(r.gridstackNode=r._gridstackNodeOrig,delete r._gridstackNodeOrig):v._isExternal&&this.engine.restoreInitial()}}Rh.renderCB=(e,r)=>{e&&r!=null&&r.content&&(e.textContent=r.content)},Rh.resizeToContentParent=".grid-stack-item-content",Rh.Utils=ru,Rh.Engine=P4,Rh.GDRev="12.4.2";const lHe=[{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}],A4=e=>lHe.find(r=>r.id===e),R4=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 Qk{constructor(r,n=[],v,$=null,h=!1,u=!1,i=null,p=null,c=null){Nw(this,"id",""),Nw(this,"childViews",[]),Nw(this,"viewId",0),Nw(this,"dynamicFilters",null),Nw(this,"componentSpecificFilters",new Map),Nw(this,"isPostMatch",!1),Nw(this,"isTemplateMode",!1),Nw(this,"filtresJSON",null),Nw(this,"token",null),Nw(this,"_isUpdating",!1),Nw(this,"filters",null),this.id=r,this.viewId=v,this.childViews=n,this.dynamicFilters=$,this.isPostMatch=h,this.isTemplateMode=u,this.filtresJSON=i,this.token=p,this.filters=c,this.componentSpecificFilters=new Map}resetClass(){this.childViews.forEach(r=>{r.view.filterAndViewsContainer=new Qk(this.id,[r],this.viewId,this.dynamicFilters,this.isPostMatch,this.isTemplateMode,this.filtresJSON,this.token,this.filters)})}hasEventTypeId(r,n){return!r||!Array.isArray(r)?!1:r.some(v=>v&&v.event_type_id===n)}hasCategoryId(r,n){return!r||!Array.isArray(r)?!1:r.some(v=>v&&v.category_id===n)}getId(){return this.id}setViewId(r){this.viewId=r}setFiltersJSON(r){this.filtresJSON=r}setDynamicFilters(r,n=null){n?this.componentSpecificFilters.set(n,[...r]):this.dynamicFilters=r}setFilters(r){this.filters=r}getComponentDynamicFilters(r){return r&&this.componentSpecificFilters.has(r)?this.componentSpecificFilters.get(r):this.dynamicFilters}getAllComponentFilters(){return this.componentSpecificFilters}debugComponentFilters(){}static debugAllComponentFilters(){}clearAllComponentFilters(){this.componentSpecificFilters.clear()}getDynamicFilters(){return this.dynamicFilters}getHomeTeamViews(){return this.childViews.filter(r=>r.view.isHomeTeam)}getAwayTeamViews(){return this.childViews.filter(r=>!r.view.isHomeTeam)}addSpecificPlays(r){if(r.view.componentProps&&this.filters){const n=this.filters.selectedTeam.value;if(n===3){const v=this.getHomeTeamViews().length,$=this.getAwayTeamViews().length;v===0&&$>0&&this.getAwayTeamViews().forEach(h=>{h.view.componentProps.isHomeTeamForAnalysis=!0,h.view.isHomeTeam=!0,h.view.filterMultiple&&(h.view.filterMultiple.isHomeTeam=!0)}),v<this.filters.howManyCorners?this.childViews.length===0?(r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.isAgainstMode=this.filters.isAgainstMode,r.view.componentProps.howManyCorners=this.filters.howManyCorners,r.view.componentProps.advancedFilters=this.filters.advancedFilters,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}):this.childViews.reduce((h,u,i,p)=>{let c={isAgainstMode:u.view.isAgainstMode,advancedFilters:u.view.componentProps.advancedFilters,isHomeTeamForAnalysis:u.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:u.view.isHomeTeam};return h&&(h.isHomeTeam&&!u.view.isHomeTeam?(u.view.componentProps.isAgainstMode=this.filters.isAgainstMode,u.view.componentProps.advancedFilters=this.filters.advancedFilters,u.view.componentProps.isHomeTeamForAnalysis=!0,u.view.isHomeTeam=!0,u.view.filterMultiple={isHomeTeam:u.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}):!h.isHomeTeam&&!u.view.isHomeTeam&&(u.view.componentProps.isAgainstMode=h.isAgainstMode,u.view.componentProps.advancedFilters=h.advancedFilters,u.view.componentProps.isHomeTeamForAnalysis=h.isHomeTeamForAnalysis,u.view.isHomeTeam=h.isHomeTeam,u.view.filterMultiple={isHomeTeam:u.view.isHomeTeam,selectedCategory:u.view.componentProps.categories[0],advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}),i===p.length-1&&(r.view.componentProps.advancedFilters=c.advancedFilters,r.view.componentProps.isAgainstMode=c.isAgainstMode,r.view.componentProps.isHomeTeamForAnalysis=c.isHomeTeamForAnalysis,r.view.isHomeTeam=c.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode})),c},null):(r.view.componentProps.advancedFilters=this.filters.advancedFilters,r.view.componentProps.isAgainstMode=this.filters.isAgainstMode,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode})}else{const v=n===1;r.view.componentProps.isHomeTeamForAnalysis=v,r.view.isHomeTeam=v,r.view.componentProps.advancedFilters=this.filters.advancedFilters,r.view.componentProps.isAgainstMode=this.filters.isAgainstMode,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}}}console.log("++++++++++++++++++++++++++++++++++++++++++++++++++++++"),console.log("view: ",r)}addLastTouch(r){if(r.view.componentProps&&this.filters){let n=null;const v=this.filters.selectedCategories.map(h=>h.value),$=this.filters.selectedTeam.value;if($===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(p=>{p.view.componentProps.isHomeTeamForAnalysis=!0,p.view.isHomeTeam=!0,p.view.filterMultiple&&(p.view.filterMultiple.isHomeTeam=!0)});const h=this.getHomeTeamViews(),u=this.getAwayTeamViews();let i=!0;for(let p=0;p<v.length;p++){n=v[p];const c=h.find(k=>k.view.componentProps.categories[0].name===n.name),a=u.find(k=>k.view.componentProps.categories[0].name===n.name);if(!c||!a){i=!c;break}}i?this.childViews.length===0?(r.view.componentProps.categories=[n],r.view.componentProps.analysisType=this.filters.selectedGamePhase.name,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,r.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,r.view.title=n.name,r.view.titleShort=n.name,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:n,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):this.childViews.reduce((p,c,a,k)=>{let T={categories:c.view.componentProps.categories,analysisType:c.view.componentProps.analysisType,isAssistZoneVisible:this.filters.isAssistZoneVisible,howManyGames:this.filters.howManyGamesSelected.value,title:c.view.title,isHomeTeamForAnalysis:c.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:c.view.isHomeTeam};return p&&(p.isHomeTeam&&!c.view.isHomeTeam?(c.view.componentProps.categories=[n],c.view.componentProps.analysisType=this.filters.selectedGamePhase.name,c.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,c.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,c.view.componentProps.isHomeTeamForAnalysis=!0,c.view.title=n.name,r.view.titleShort=n.name,c.view.isHomeTeam=!0,c.view.filterMultiple={isHomeTeam:c.view.isHomeTeam,selectedCategory:n,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):!p.isHomeTeam&&!c.view.isHomeTeam&&(c.view.componentProps.categories=p.categories,c.view.componentProps.analysisType=p.analysisType,c.view.componentProps.isHomeTeamForAnalysis=p.isHomeTeamForAnalysis,c.view.componentProps.isAssistZoneVisible=p.isAssistZoneVisible,c.view.componentProps.howManyGames=p.howManyGames,c.view.title=p.title,c.view.titleShort=p.titleShort,c.view.isHomeTeam=p.isHomeTeam,c.view.filterMultiple={isHomeTeam:c.view.isHomeTeam,selectedCategory:c.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}),a===k.length-1&&(r.view.componentProps.categories=T.categories,r.view.componentProps.analysisType=T.analysisType,r.view.componentProps.isHomeTeamForAnalysis=T.isHomeTeamForAnalysis,r.view.componentProps.isAssistZoneVisible=T.isAssistZoneVisible,r.view.componentProps.howManyGames=T.howManyGames,r.view.title=T.title,r.view.titleShort=T.titleShort,r.view.isHomeTeam=T.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:r.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})),T},null):(r.view.componentProps.categories=[n],r.view.componentProps.analysisType=this.filters.selectedGamePhase.name,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,r.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,r.view.title=n.name,r.view.titleShort=n.name,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:n,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})}else{const h=$===1,u=h?this.getHomeTeamViews():this.getAwayTeamViews();r.view.componentProps.isHomeTeamForAnalysis=h,r.view.isHomeTeam=h;for(let i=0;i<v.length;i++){const p=v[i];if(!u.find(c=>c.view.componentProps.categories[0].name===p.name)){r.view.componentProps.categories=[p],r.view.componentProps.analysisType=this.filters.selectedGamePhase.name,r.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,r.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,r.view.title=p.name,r.view.titleShort=p.name,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:p,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible};break}}}}}addView(r,n=!1){var v,$,h,u,i,p,c,a,k,T;if(r.view.filterAndViewsContainer=this,Sd.emit("component-added-to-container",this),this.viewId===5&&r.view.componentProps&&!n&&(r.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,r.view.filterMultiple={isHomeTeam:r.view.componentProps.preMatchType===1}),this.viewId===15&&r.view.componentProps&&!n&&(r.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,r.view.filterMultiple={isHomeTeam:r.view.componentProps.preMatchType===1}),this.viewId===17&&r.view.componentProps&&!n){this.dynamicFilters[0]!==void 0&&(r.view.componentProps.infavoragainstteam=!this.dynamicFilters[0]),this.dynamicFilters[1]!==void 0&&(r.view.componentProps.lateralidad=this.dynamicFilters[1]===32?"right":"left");const x=this.dynamicFilters[2]!==void 0?this.dynamicFilters[2]:this.dynamicFilters[0]||1,d=r.view.componentProps.game;if(x===3){const o=this.childViews.filter(l=>{var s;return((s=l.view.filterMultiple)==null?void 0:s.isHomeTeam)===!0}).length===0;d&&(r.view.componentProps.teamselected=o?d.home_team:d.away_team),r.view.filterMultiple={isHomeTeam:o}}else d&&(r.view.componentProps.teamselected=x===2?d.away_team:d.home_team),r.view.filterMultiple={isHomeTeam:x===1}}if(this.viewId===10&&r.view.componentProps&&!n&&(r.view.componentProps.isHomeTeamForAnalysis=this.dynamicFilters[0]!==3?this.dynamicFilters[0]===1:1,r.isHomeTeam=r.view.componentProps.isHomeTeamForAnalysis,r.view.filterMultiple={isHomeTeam:r.view.componentProps.isHomeTeamForAnalysis},r.view.filtersJSON=this.filtresJSON),this.viewId===7&&r.view.componentProps&&!n){const x=this.getComponentDynamicFilters(r.view.id),d=x||this.dynamicFilters;!x&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const o=d[0]===1?"offensive":"defensive",l=d[1]===1;r.view.componentProps.analysisType=o,r.view.componentProps.isHomeTeamForAnalysis=l,r.isHomeTeam=l,r.view.filterMultiple={isHomeTeam:l},Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:d})}if(this.viewId===1&&r.view.componentProps&&!n){const x=this.dynamicFilters[0]||[];if(x&&x.length>0){let d;if(Array.isArray(x)){const l=this.childViews.map(f=>{var g;return(g=f.view.componentProps)==null?void 0:g.type}).filter(f=>f!==void 0),s=x.filter(f=>!l.includes(f));s.length>0?d=s[0]:d=x[0]}else d=x;const o=R4.get(this.viewId);r.view.componentProps.type=d,r.view.componentProps.default=!1,r.view.title=`Comparativa ${o[d]}`,r.view.filterMultiple={category:d}}}if(this.viewId===9&&r.view.componentProps&&!n){const x=this.dynamicFilters[0].map(s=>s.join("-"));let d="";const o=this.dynamicFilters[1],l=R4.get(this.viewId);if(o===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(L=>{L.view.componentProps.isHomeTeamForAnalysis=!0,L.view.isHomeTeam=!0,L.view.filterMultiple&&(L.view.filterMultiple.isHomeTeam=!0)});let s=null;const f=this.getHomeTeamViews(),g=this.getAwayTeamViews();let S=!0;for(let L=0;L<x.length;L++){d=x[L],s=l.analysisTypes.get(x[L]);const E=f.find(V=>V.view.componentProps.analysisType===s.analysisType),P=g.find(V=>V.view.componentProps.analysisType===s.analysisType);if(!E||!P){S=!E;break}}S?this.childViews.length===0?(r.view.componentProps.analysisType=s.analysisType,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.title=s.title,r.view.titleShort=s.titleShort,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:d.split("-").map(L=>parseInt(L))}):this.childViews.reduce((L,E,P,V)=>{let I={analysisType:E.view.componentProps.analysisType,title:E.view.title,isHomeTeamForAnalysis:E.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:E.view.isHomeTeam};return L&&(L.isHomeTeam&&!E.view.isHomeTeam?(E.view.componentProps.analysisType=s.analysisType,E.view.componentProps.isHomeTeamForAnalysis=!0,E.view.title=s.title,r.view.titleShort=s.titleShort,E.view.isHomeTeam=!0,E.view.filterMultiple={isHomeTeam:E.view.isHomeTeam,categoryIds:d.split("-").map(j=>parseInt(j))}):!L.isHomeTeam&&!E.view.isHomeTeam&&(E.view.componentProps.analysisType=L.analysisType,E.view.componentProps.isHomeTeamForAnalysis=L.isHomeTeamForAnalysis,E.view.title=L.title,E.view.titleShort=L.titleShort,E.view.isHomeTeam=L.isHomeTeam,E.view.filterMultiple={isHomeTeam:E.view.isHomeTeam,categoryIds:d.split("-").map(j=>parseInt(j))}),P===V.length-1&&(r.view.componentProps.analysisType=I.analysisType,r.view.componentProps.isHomeTeamForAnalysis=I.isHomeTeamForAnalysis,r.view.title=I.title,r.view.titleShort=I.titleShort,r.view.isHomeTeam=I.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:d.split("-").map(j=>parseInt(j))})),I},null):(r.view.componentProps.analysisType=s.analysisType,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.title=s.title,r.view.titleShort=s.titleShort,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:d.split("-").map(L=>parseInt(L))})}else{const s=o===1,f=s?this.getHomeTeamViews():this.getAwayTeamViews();r.view.componentProps.isHomeTeamForAnalysis=s,r.view.isHomeTeam=s;for(let g=0;g<x.length;g++){const S=l.analysisTypes.get(x[g]);if(!f.find(L=>L.view.componentProps.analysisType===S.analysisType)){r.view.componentProps.analysisType=S.analysisType,r.view.title=S.title,r.view.titleShort=S.titleShort,r.view.filterMultiple={categoryIds:x[g].split("-").map(L=>parseInt(L)),isHomeTeam:r.view.isHomeTeam};break}}}}if(this.viewId===2&&!n&&r.view.componentProps){const x=this.getComponentDynamicFilters(r.view.id),d=x||this.dynamicFilters;!x&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id),r.view.componentProps.game&&(r.view.componentProps.gameid=r.view.componentProps.game.id,r.view.componentProps.season=r.view.componentProps.game.season_id,r.view.componentProps.teamView=d[1]===2?r.view.componentProps.game.awayTeam.team_id:d[1]===1?r.view.componentProps.game.homeTeam.team_id:0);const o=this.dynamicFilters[0]||[];let l=null;if(Array.isArray(o)){if(o.length>0){const g=this.childViews.map(L=>{var E;const P=(E=L.view.componentProps)==null?void 0:E.categoryView;return P&&P.length>0?P[0].id:null}).filter(L=>L!==null),S=o.filter(L=>!g.includes(L));S.length>0&&(l=S[0])}}else{const g=o;g&&(this.childViews.find(S=>{var L;const E=(L=S.view.componentProps)==null?void 0:L.categoryView;return E&&E.length>0&&E[0].id===g})||(l=g))}let s=null;if(l)try{s=A4(l)}catch{}const f=d&&d.length>1?d[1]:1;r.view.filterMultiple={categoryId:l,teamType:f},r.view.componentProps.categoryView=s?[{id:l,name:s.name}]:l?[{id:l,name:`Category ${l}`}]:[{id:0,name:"Category"}]}if(this.viewId===8&&r.view.componentProps&&!n&&r.view.game&&(r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0),r.view.componentProps.areInactiveVisible=this.dynamicFilters[0]||!1,r.view.componentProps.game=(v=r.view)==null?void 0:v.game,r.view.componentProps.teamSelected={teamId:(h=($=r.view)==null?void 0:$.game)==null?void 0:h.home_team},r.view.componentProps.isDefault=!1,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:this.dynamicFilters})),this.viewId===13&&r.view.componentProps&&!n&&(r.view.componentProps.isdefault=!0,r.view.componentProps.seasonid=2010,r.view.teamids=[1,2],r.view.componentProps.categoryids=[20,2],r.view.componentProps.teamsshow=[1,2],r.view.componentProps.analysistype=1,r.view.componentProps.gameid="",r.view.componentProps.teams=[],r.view.componentProps.game=""),this.viewId===15&&r.view.componentProps&&!n&&(r.view.componentProps.isdefault=!0,r.view.componentProps.view=1,r.view.numitems=3,r.view.typegame=1,r.view.componentProps.token=this.token,r.view.componentProps.data={season:2010,type:2,team:14}),this.viewId===17&&r.view.componentProps&&!n&&(r.view.componentProps.forseason=!1,r.view.componentProps.forteam=!0,r.view.componentProps.tournamentselected={id:1},r.view.componentProps.forgame=!1,r.view.componentProps.filters={},r.view.componentProps.showBallGo=!0,r.view.componentProps.showHeatMap=!0,r.view.componentProps.ballOnOff=!1,r.view.componentProps.showdefault=!0),this.viewId===14&&r.view.componentProps&&!n&&(r.view.componentProps.isReports=!0,r.view.componentProps.isDefault=!0,r.view.componentProps.type=0,r.view.componentProps.typeView=1,r.view.componentProps.showVideos=!1,r.view.componentProps.currentSeason=2010,r.view.componentProps.localTeam=2,r.view.componentProps.awayTeam=1),this.viewId===6&&r.view.componentProps&&!n){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const x=this.getComponentDynamicFilters(r.view.id),d=x||this.dynamicFilters;!x&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const o=d&&d.length>0?d[0]:[];if(o&&o.length>0){let l=0;for(const s of o)if(!this.childViews.find(f=>f.view.componentProps.gameNumber===s)){l=s;break}l&&(r.view.componentProps.gameNumber=l,r.view.filterMultiple={gameNumber:l})}Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:d})}if(this.viewId===3&&r.view.componentProps&&!n&&r.view.game){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const x=this.getComponentDynamicFilters(r.view.id),d=x||this.dynamicFilters;!x&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const o=d&&d.length>0?d[0]:!1;r.view.componentProps.desplegable=o,r.view.componentProps.key=o,r.view.componentProps.game=(u=r.view)==null?void 0:u.game,r.view.componentProps.defaultShields=!1,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:d})}if(this.viewId===4&&r.view.componentProps&&!n&&r.view.game){if(r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0),this.isPostMatch){r.view.componentProps.key=!1,r.view.componentProps.isDefault=!1,r.view.componentProps.token=this.token,r.view.componentProps.gameId=(p=(i=r.view)==null?void 0:i.game)==null?void 0:p.game_id,r.view.componentProps.homeTeam=(a=(c=r.view)==null?void 0:c.game)==null?void 0:a.home_team,r.view.componentProps.awayTeam=(T=(k=r.view)==null?void 0:k.game)==null?void 0:T.visiting_team;const o=this.getComponentDynamicFilters(r.view.id),l=o||this.dynamicFilters;!o&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const s=l&&l.length>0?l[0]:[],f=this.hasEventTypeId(s,1),g=this.hasCategoryId(s,8),S=this.hasCategoryId(s,9),L=this.hasEventTypeId(s,3);r.view.componentProps.goals=f,r.view.componentProps.yellowCards=g,r.view.componentProps.redCards=S,r.view.componentProps.substitutions=L}const x=this.getComponentDynamicFilters(r.view.id)||this.dynamicFilters,d=x&&x.length>0?x[0]:[];r.view.componentProps.selectedEvents=d,r.view.componentProps.key=d.length>0,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:x})}this.viewId===16&&this.addLastTouch(r),this.viewId===18&&this.addSpecificPlays(r),this.childViews.push(r),Sd.emit("view-added")}getHowManyViewsToAdd(r,n=null){if(this.viewId===5||this.viewId===14||this.viewId===13||this.viewId===15)return 1;if(this.viewId===6){const v=r[0];return v===2||v===3?v:1}if(this.viewId===4)return r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0?1:0;if(this.viewId===9){const v=r[0],$=r[1];if($===1||$===2){const h=$===1?this.getHomeTeamViews():this.getAwayTeamViews();return v.length-h.length}else return v*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===16&&n){const v=n.selectedCategories||[],$=n.selectedTeam.value;if($===1||$===2){const h=$===1?this.getHomeTeamViews():this.getAwayTeamViews();return v.length-h.length}else return v.length*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===2){const v=r[0]||[],$=r[1]||1;if(!v||v.length===0)return 0;if(Array.isArray(v)){const h=this.childViews.map(u=>{var i;const p=(i=u.view.componentProps)==null?void 0:i.categoryView;return p&&p.length>0?p[0].id:null}).filter(u=>u!==null);return v.filter(u=>!h.includes(u)).length}else{const h=v;return this.childViews.find(u=>{var i,p;const c=(i=u.view.componentProps)==null?void 0:i.categoryView,a=((p=u.view.filterMultiple)==null?void 0:p.teamType)||1;return c&&c.length>0&&c[0].id===h&&a===$})?0:1}}if(this.viewId===1){const v=r[0]||[];if(!v||v.length===0)return 0;if(Array.isArray(v)){const $=this.childViews.map(h=>{var u;return(u=h.view.componentProps)==null?void 0:u.type}).filter(h=>h!==void 0);return v.filter(h=>!$.includes(h)).length}else{const $=v;return this.childViews.find(h=>{var u;return((u=h.view.componentProps)==null?void 0:u.type)===$})?0:1}}return 0}getRequiresAddView(r,n){if(this.viewId===5)return r[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===15)return r[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===17){const v=r[2]||1,$=r[2];return v===3||$===3?this.childViews.length<2:this.childViews.length===0}if(this.viewId===10)return r[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===7)return r[1]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===6){const v=r[0];return v?v.length>this.childViews.length:this.childViews.length===0}if(this.viewId===4){const v=r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0;return this.childViews.length===0&&v}if(this.viewId===9)return this.getRequiresAddViewMultipleAndBothTeams(r);if(this.viewId===16&&n){const v=[n.selectedCategories,n.selectedTeam.value];return this.getRequiresAddViewMultipleAndBothTeams(v,n.totalCategoriesSelected)}if(this.viewId===18&&n){const v=[n.howManyCorners,n.selectedTeam.value],$=this.getRequiresAddViewMultipleAndBothTeams(v,n.howManyCorners);return console.count("before aux18 return"),console.log("aux18:",$),$}if(this.viewId===1){const v=r[0]||[];if(!v||v.length===0)return!1;if(Array.isArray(v)){const $=this.childViews.map(h=>{var u;return(u=h.view.componentProps)==null?void 0:u.type}).filter(h=>h!==void 0);return v.filter(h=>!$.includes(h)).length>0}else{const $=v;return!this.childViews.find(h=>{var u;return((u=h.view.componentProps)==null?void 0:u.type)===$})}}if(this.viewId===2){const v=r[0]||[];if(Array.isArray(v)){if(v.length>0){const $=this.childViews.map(h=>{var u;const i=(u=h.view.componentProps)==null?void 0:u.categoryView;return i&&i.length>0?i[0].id:null}).filter(h=>h!==null);return v.filter(h=>!$.includes(h)).length>0}return!1}else{const $=v,h=r[1]||1;return $?!this.childViews.find(u=>{var i,p;const c=(i=u.view.componentProps)==null?void 0:i.categoryView,a=((p=u.view.filterMultiple)==null?void 0:p.teamType)||1;return c&&c.length>0&&c[0].id===$&&a===h}):!1}}return this.viewId===8||this.viewId===3||this.viewId===14?this.childViews.length===0:!1}getRequiresAddViewMultipleAndBothTeams(r,n=null){const v=this.childViews.filter(c=>c.view.isHomeTeam),$=this.childViews.filter(c=>!c.view.isHomeTeam),h=n||r[0].length,u=r[1],i=h*(u===1||u===2?1:2),p=u===3?v.length+$.length:v.length||$.length;return i>p}getRequiresLessViews(r){if(this.viewId===5)return r[0]!==3&&this.childViews.length>1;if(this.viewId===15)return r[0]!==3&&this.childViews.length>1;if(this.viewId===17)return r[0]!==3&&this.childViews.length>1;if(this.viewId===6){const n=r[0];return n===2||n===3}return this.viewId,!1}updateSummary({dynamicFilters:r}){const n=this.childViews[0],v=document.querySelector(`[gs-id="${n.view.id}"]`),$=n.grid;if(n&&v&&$){const h=r[0],u=`min_column${h?"_2":""}`,i=`min_row${h?"_2":""}`,p=`max_column${h?"_2":""}`,c=`max_row${h?"_2":""}`,a=`colspan${h?"_2":""}`,k=`rowspan${h?"_2":""}`,T=n.view.coreView[a],x=n.view.coreView[k],d=n.view.coreView[u],o=n.view.coreView[i],l=n.view.coreView[p],s=n.view.coreView[c];n.view.w=T,n.view.h=x,n.view.maxWidth=l,n.view.maxHeight=s,n.view.minWidth=d,n.view.minHeight=o,v.setAttribute("gs-w",T),v.setAttribute("gs-h",x),v.setAttribute("gs-max-w",l),v.setAttribute("gs-max-h",s),v.setAttribute("gs-min-w",d),v.setAttribute("gs-min-h",o),$.update(v,{h:x,w:T,"gs-max-h":s,"gs-max-w":l,"gs-min-h":o,"gs-min-w":d})}}updateFilters(r){this.filters=r,this.viewId===16?this.updateLastTouchFilters(r):this.viewId===18&&this.updateSpecificPlaysFilters(r)}updateDynamicFilters(r,n=null){var v,$;if(!this._isUpdating){this._isUpdating=!0,n?this.componentSpecificFilters.set(n,[...r]):this.dynamicFilters=r,Sd.emit("component-added-to-container",this);try{if(this.viewId===5){const h=r[0]||1;if(h<3)if(this.childViews.length===1){const u=this.childViews[0];u.view.componentProps&&(u.view.componentProps.preMatchType=h,u.view.filterMultiple={isHomeTeam:u.view.componentProps.preMatchType===1})}else{const u=this.childViews.pop(),i=u.grid,p=u.page,c=document.querySelector(`[gs-id="${u.view.id}"]`);if(i&&c&&(i.removeWidget(c),p)){const k=p.items.findIndex(T=>T.id===u.view.id);k!==-1&&p.items.splice(k,1)}const a=this.childViews[0];a.view.componentProps&&(a.view.componentProps.preMatchType=h,a.view.filterMultiple={isHomeTeam:a.view.componentProps.preMatchType})}else this.childViews.forEach((u,i)=>{u.view.componentProps.preMatchType=i+1,u.view.filterMultiple={isHomeTeam:u.view.componentProps.preMatchType}})}if(this.viewId===15){const h=r[0]||1;if(n){const u=this.childViews.find(i=>i.view.id===n);u&&u.view.componentProps&&(u.view.componentProps.preMatchType=h,u.view.filterMultiple={isHomeTeam:h===1})}else if(h<3){if(this.childViews.length===1){const u=this.childViews[0];u.view.componentProps&&(u.view.componentProps.preMatchType=h,u.view.filterMultiple={isHomeTeam:h===1})}else if(this.childViews.length>1){for(;this.childViews.length>1;){const i=this.childViews.pop(),p=i.grid,c=i.page,a=document.querySelector(`[gs-id="${i.view.id}"]`);if(p&&a&&(p.removeWidget(a),c)){const k=c.items.findIndex(T=>T.id===i.view.id);k!==-1&&c.items.splice(k,1)}}const u=this.childViews[0];u.view.componentProps&&(u.view.componentProps.preMatchType=h,u.view.filterMultiple={isHomeTeam:h===1})}}else if(this.childViews.length===2)this.childViews.forEach((u,i)=>{u.view.componentProps&&(u.view.componentProps.preMatchType=i+1,u.view.filterMultiple={isHomeTeam:i===0})});else if(this.childViews.length<2)this.childViews.forEach((u,i)=>{u.view.componentProps&&(u.view.componentProps.preMatchType=i+1,u.view.filterMultiple={isHomeTeam:i===0})});else{for(;this.childViews.length>2;){const u=this.childViews.pop(),i=u.grid,p=u.page,c=document.querySelector(`[gs-id="${u.view.id}"]`);if(i&&c&&(i.removeWidget(c),p)){const a=p.items.findIndex(k=>k.id===u.view.id);a!==-1&&p.items.splice(a,1)}}this.childViews.forEach((u,i)=>{u.view.componentProps&&(u.view.componentProps.preMatchType=i+1,u.view.filterMultiple={isHomeTeam:i===0})})}}if(this.viewId===17){const h=r[0]||1,u=r[2],i=h===3||u===3;if(n){const p=this.childViews.find(c=>c.view.id===n);if(p&&p.view.componentProps&&(r[0]!==void 0&&(p.view.componentProps.infavoragainstteam=!r[0]),r[1]!==void 0&&(p.view.componentProps.lateralidad=r[1]===32?"right":"left"),r[2]!==void 0)){const c=r[2],a=p.view.componentProps.game;if(c===3){if(((v=p.view.filterMultiple)==null?void 0:v.isHomeTeam)!==void 0){const k=p.view.filterMultiple.isHomeTeam;a&&(p.view.componentProps.teamselected=(typeof k=="boolean"?k:k===1)?a.home_team:a.away_team)}}else a&&(p.view.componentProps.teamselected=c===2?a.away_team:a.home_team);p.view.filterMultiple={isHomeTeam:c===1||c===3&&(($=p.view.filterMultiple)==null?void 0:$.isHomeTeam)}}}else if(i)if(this.childViews.length===2)this.childViews.forEach((p,c)=>{p.view.componentProps&&(p.view.componentProps.teamselected=c+1,p.view.filterMultiple={isHomeTeam:c===0})});else if(this.childViews.length<2)this.childViews.forEach((p,c)=>{p.view.componentProps&&(p.view.componentProps.teamselected=c+1,p.view.filterMultiple={isHomeTeam:c===0})});else{for(;this.childViews.length>2;){const p=this.childViews.pop(),c=p.grid,a=p.page,k=document.querySelector(`[gs-id="${p.view.id}"]`);if(c&&k&&(c.removeWidget(k),a)){const T=a.items.findIndex(x=>x.id===p.view.id);T!==-1&&a.items.splice(T,1)}}this.childViews.forEach((p,c)=>{p.view.componentProps&&(p.view.componentProps.teamselected=c+1,p.view.filterMultiple={isHomeTeam:c===0})})}else if(this.childViews.length===1){const p=this.childViews[0];if(p.view.componentProps){r[0]!==void 0&&(p.view.componentProps.infavoragainstteam=!r[0]),r[1]!==void 0&&(p.view.componentProps.lateralidad=r[1]===32?"right":"left");const c=p.view.componentProps.game;if(r[2]!==void 0&&c){const a=r[2];p.view.componentProps.teamselected=a===2?c.away_team:c.home_team}p.view.filterMultiple={isHomeTeam:h===1}}}else if(this.childViews.length>1){for(;this.childViews.length>1;){const c=this.childViews.pop(),a=c.grid,k=c.page,T=document.querySelector(`[gs-id="${c.view.id}"]`);if(a&&T&&(a.removeWidget(T),k)){const x=k.items.findIndex(d=>d.id===c.view.id);x!==-1&&k.items.splice(x,1)}}const p=this.childViews[0];if(p.view.componentProps){r[0]!==void 0&&(p.view.componentProps.infavoragainstteam=!r[0]),r[1]!==void 0&&(p.view.componentProps.lateralidad=r[1]===32?"right":"left");const c=p.view.componentProps.game;if(r[2]!==void 0&&c){const a=r[2];p.view.componentProps.teamselected=a===2?c.away_team:c.home_team}p.view.filterMultiple={isHomeTeam:h===1}}}}if(this.viewId===10){const h=r[0]||1;if(h<3)if(this.childViews.length===1){const u=this.childViews[0];u.view.componentProps&&(u.view.componentProps.isHomeTeamForAnalysis=h===1,u.view.filterMultiple={isHomeTeam:u.view.componentProps.isHomeTeamForAnalysis})}else{const u=this.childViews.pop(),i=u.grid,p=u.page,c=document.querySelector(`[gs-id="${u.view.id}"]`);if(i&&c&&(i.removeWidget(c),p)){const k=p.items.findIndex(T=>T.id===u.view.id);k!==-1&&p.items.splice(k,1)}const a=this.childViews[0];a.view.componentProps&&(a.view.componentProps.isHomeTeamForAnalysis=h===1,a.view.filterMultiple={isHomeTeam:a.view.componentProps.isHomeTeamForAnalysis})}else this.childViews.forEach((u,i)=>{u.view.componentProps.isHomeTeamForAnalysis=i%2===0,u.view.filterMultiple={isHomeTeam:u.view.componentProps.isHomeTeamForAnalysis}})}if(this.viewId===7){const h=r[1];if(h===3)this.childViews.forEach((u,i)=>{u.view.componentProps.isHomeTeamForAnalysis=i%2===0,u.view.isHomeTeam=i%2===0,u.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",u.view.filterMultiple={isHomeTeam:u.view.isHomeTeam}});else{const u=h===1;if(this.childViews.length>0){const i=this.childViews[0];i.view.componentProps.isHomeTeamForAnalysis=u,i.view.isHomeTeam=u,i.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",i.view.filterMultiple={isHomeTeam:u},this.childViews.length>1&&this.removeChildView(this.childViews[1])}}}if(this.viewId===9){const h=r[0],u=r[1];if(u===3){if(this.childViews.length>h.length){const i=h.map(p=>{const c=p.join("-");return R4.get(this.viewId).analysisTypes.get(c).analysisType});this.childViews.reduce((p,c)=>(i.includes(c.view.componentProps.analysisType)||p.push(c.view.componentProps.analysisType),p),[]).forEach(p=>{const c=this.childViews.findIndex(a=>a.view.componentProps.analysisType===p);if(c!==-1){const a=this.childViews[c];this.removeChildView(a)}})}}else{const i=u===1,p=this.getHomeTeamViews(),c=this.getAwayTeamViews();if(i&&p.length===0)c.forEach(a=>{a.view.componentProps.isHomeTeamForAnalysis=i,a.view.isHomeTeam=i,a.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}});else if(!i&&c.length===0)p.forEach(a=>{a.view.componentProps.isHomeTeamForAnalysis=i,a.view.isHomeTeam=i,a.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}});else if(p.length===c.length)i||p.forEach(a=>{a.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}}),(i?c:p).forEach(a=>{this.removeChildView(a)});else{const a=i?this.getHomeTeamViews():this.getAwayTeamViews();if(a.length>h.length){const k=h.map(T=>{const x=T.join("-");return R4.get(this.viewId).analysisTypes.get(x).analysisType});a.forEach(T=>{k.includes(T.view.componentProps.analysisType)?T.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}:this.removeChildView(T)})}else a.forEach(k=>{k.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}})}}}if(this.viewId===2){const h=r[0]||[];if(Array.isArray(h)){const u=this.childViews.map(i=>{var p,c;const a=(p=i.view.componentProps)==null?void 0:p.categoryView,k=((c=i.view.filterMultiple)==null?void 0:c.teamType)||1,T=a&&a.length>0?a[0].id:null;return T?{categoryId:T,teamType:k,viewId:i.view.id}:null}).filter(i=>i!==null);if(n){const i=this.childViews.find(p=>p.view.id===n);if(i){const p=r[1]||1,c=h[0];if(c){let a=null;try{a=A4(c)}catch{}i.view.filterMultiple={categoryId:c,teamType:p},i.view.componentProps.game&&(p===1?i.view.componentProps.teamView=i.view.componentProps.game.homeTeam.team_id:p===2?i.view.componentProps.teamView=i.view.componentProps.game.awayTeam.team_id:i.view.componentProps.teamView=0),i.view.componentProps.categoryView=a?[{id:c,name:a.name}]:[{id:c,name:`Category ${c}`}]}}}if(!n){const i=r[1]||1;this.childViews.forEach(p=>{var c;const a=(c=p.view.componentProps)==null?void 0:c.categoryView;if(a&&a.length>0){const k=a[0].id;h.includes(k)&&(p.view.filterMultiple={categoryId:k,teamType:i})}})}if(u.map(i=>i.categoryId).filter(i=>!h.includes(i)).forEach(i=>{this.childViews.filter(p=>{var c;const a=(c=p.view.componentProps)==null?void 0:c.categoryView;return a&&a.length>0&&a[0].id===i}).forEach(p=>{this.removeChildView(p),Sd.emit("component-removed",{viewId:p.view.id,categoryId:i})})}),n){const i=h[0];if(i){const p=this.childViews.find(c=>c.view.id===n);if(p){let c=null;try{c=A4(i)}catch{}const a=r[1]||1;p.view.filterMultiple={categoryId:i,teamType:a},p.view.componentProps.game&&(p.view.componentProps.teamView=a===2?p.view.componentProps.game.awayTeam.team_id:a===1?p.view.componentProps.game.homeTeam.team_id:0),p.view.componentProps.categoryView=c?[{id:i,name:c.name}]:[{id:i,name:`Category ${i}`}]}}}}else{const u=h;if(u&&n){const i=this.childViews.find(p=>p.view.id===n);if(i){let p=null;try{p=A4(u)}catch{}const c=r[1]||1;i.view.filterMultiple={categoryId:u,teamType:c},i.view.componentProps.game&&(i.view.componentProps.teamView=c===2?i.view.componentProps.game.awayTeam.team_id:c===1?i.view.componentProps.game.homeTeam.team_id:0),i.view.componentProps.categoryView=p?[{id:u,name:p.name}]:[{id:u,name:`Category ${u}`}]}}}}if(this.viewId===8){const h=r[0]||!1;this.childViews.forEach(u=>{u.view.componentProps&&(u.view.componentProps._isReactive||(u.view.componentProps=t.reactive(u.view.componentProps),u.view.componentProps._isReactive=!0),u.view.componentProps.areInactiveVisible=h,u.view.componentProps.key=h,Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))})}if(this.viewId===1){const h=r[0]||[];if(n){this.setDynamicFilters(r,n);const u=this.childViews.find(i=>i.view.id===n);u&&this.updateComparative(u,r)}else if(this.childViews.reduce((u,i)=>(h.includes(i.view.componentProps.type)||u.push(i.view.componentProps.type),u),[]).forEach(u=>{const i=this.childViews.findIndex(p=>p.view.componentProps.type===u);if(i!==-1){for(let p=i;p<this.childViews.length;p++){const c=this.childViews[p+1],a=this.childViews[p];c&&(a.view.componentProps.type=c.view.componentProps.type,a.view.title=c.view.title)}this.removeChildView(this.childViews[this.childViews.length-1])}}),Array.isArray(h))this.childViews.length>0&&h.length>0&&this.childViews.forEach((u,i)=>{if(u.view.componentProps&&i<h.length){const p=h[i],c=R4.get(this.viewId);u.view.componentProps.type=p,u.view.componentProps.default=!1,u.view.title=`Comparativa ${c[p]}`,u.view.filterMultiple={category:p}}});else{const u=h;if(u&&this.childViews.length>0){const i=this.childViews[0];if(i.view.componentProps){const p=R4.get(this.viewId);i.view.componentProps.type=u,i.view.componentProps.default=!1,i.view.title=`Comparativa ${p[u]}`,i.view.filterMultiple={category:u}}}}}if(this.viewId===6){const h=r[0]||[];if(n){this.setDynamicFilters(r,n);const u=this.childViews.find(i=>i.view.id===n);u&&this.updateGSCLineupsReports(u,r)}else{if(Array.isArray(h))if(h.length===0)for(;this.childViews.length>0;)this.removeChildView(this.childViews[0]);else this.childViews.reduce((u,i)=>(h.includes(i.view.componentProps.gameNumber)||u.push(i.view.componentProps.gameNumber),u),[]).forEach(u=>{const i=this.childViews.findIndex(p=>p.view.componentProps.gameNumber===u);if(i!==-1){for(let p=i;p<this.childViews.length;p++){const c=this.childViews[p+1],a=this.childViews[p];c&&(a.view.componentProps.gameNumber=c.view.componentProps.gameNumber,a.view.filterMultiple={gameNumber:c.view.componentProps.gameNumber})}this.removeChildView(this.childViews[this.childViews.length-1])}});this.childViews.forEach(u=>{u.view.componentProps&&(u.view.componentProps._isReactive||(u.view.componentProps=t.reactive(u.view.componentProps),u.view.componentProps._isReactive=!0),Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))})}}if(this.viewId===3){if(n){this.setDynamicFilters(r,n);const h=this.childViews.find(u=>u.view.id===n);h&&this.updateMatchSummary(h,r)}else{const h=r[0]||!1;this.childViews.forEach(u=>{u.view.componentProps&&(u.view.componentProps._isReactive||(u.view.componentProps=t.reactive(u.view.componentProps),u.view.componentProps._isReactive=!0),u.view.componentProps.desplegable=h,u.view.componentProps.key=h,Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))})}this.updateSummary({dynamicFilters:r})}if(this.viewId===13){const h=r[1]||[];if(n){this.setDynamicFilters(r,n);const u=this.childViews.find(i=>i.view.id===n);u&&(u.view.componentProps&&(u.view.componentProps.categoryids=h,u.view.componentProps.analysistype=r[0]||1,u.view.componentProps.teamsshow=r[2]==1?[1]:r[2]==2?[2]:[1,2],u.view.dynamicFilters=r,u.view._updateKey=Date.now()),Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))}else this.childViews.forEach(u=>{u.view.componentProps&&(u.view.componentProps._isReactive||(u.view.componentProps=t.reactive(u.view.componentProps),u.view.componentProps._isReactive=!0),u.view.componentProps.categoryids=h,u.view.componentProps.analysistype=r[0]||1,u.view.componentProps.teamsshow=r[2]==1?[1]:r[2]==2?[2]:[1,2],u.view.dynamicFilters=r,u.view._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))})}else if(this.viewId===15){const h=r[0]||1,u=r[3]!==void 0?r[3]:typeof r[1]=="number"?r[1]:null;if(n){this.setDynamicFilters(r,n);const i=this.childViews.find(p=>p.view.id===n);i&&i.view.componentProps&&(i.view.componentProps.analysistype=h,u!==null&&(i.view.componentProps.numitems=u),i.view.dynamicFilters=r,i.view._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:i.view.id,componentProps:i.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:i.view.id,dynamicFilters:r}))}else this.childViews.forEach(i=>{i.view.componentProps&&(i.view.componentProps._isReactive||(i.view.componentProps=t.reactive(i.view.componentProps),i.view.componentProps._isReactive=!0),i.view.componentProps.analysistype=h,u!==null&&(i.view.componentProps.numitems=u),i.view.dynamicFilters=r,i.view._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:i.view.id,componentProps:i.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:i.view.id,dynamicFilters:r}))})}if(this.viewId===4){const h=r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0;if(n){const u=this.childViews.find(i=>i.view.id===n);u&&u.view.componentProps.selectedEvents}else if(!h&&this.childViews.length>0)this.childViews.forEach(u=>{this.removeChildView(u)});else if(h&&this.childViews.length===0){const u={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};Sd.emit("add-view",u)}else this.childViews.forEach(u=>{this.updateTimeline(u,r)})}}finally{this._isUpdating=!1}}}removeAllChildViews(){[...this.childViews].forEach(r=>{this.removeChildView(r)})}removeChildView(r,n=!1){const v=this.childViews.findIndex($=>$.view.id===r.view.id);if(v!==-1){const $=this.childViews[v];this.childViews.splice(v,1),$.view.id&&this.componentSpecificFilters.delete($.view.id);const h=$.grid,u=$.page,i=document.querySelector(`[gs-id="${$.view.id}"]`);if(h&&i&&(h.removeWidget(i),u&&!n)){const p=u.items.findIndex(c=>c.id===$.view.id);p!==-1&&(u.items.splice(p,1),u.items.length===0&&Sd.emit("empty-page",u))}}}updateView({view:r,dynamicFilters:n,filtersJSON:v,filters:$}){this.setFiltersJSON(v),this.dynamicFilters=n;const h=this.childViews.find(u=>{var i;return((i=u.view)==null?void 0:i.id)===r.view.id});if(h){h.view.filtersJSON=v,h.view.coreView&&(h.view.coreView.filtersJSON=v);let u=n;if(this.viewId===4){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===8){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===3){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i),this.updateSummary({dynamicFilters:u})}else if(this.viewId===1){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===6){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===7){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===9){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}this.viewId===5?this.updateVolumetricField(h,u):this.viewId===7?this.updateGoalData(h,u):this.viewId===9?this.updateFieldDataByZones(h,n):this.viewId===10?this.updateXg(h,u):this.viewId===3?this.updateMatchSummary(h,u):this.viewId===4?this.updateTimeline(h,u):this.viewId===8?this.updateFieldPosesion(h,u):this.viewId===1?this.updateComparative(h,u):this.viewId===2?this.updateGSCtops(h,u):this.viewId===6?this.updateGSCLineupsReports(h,u):this.viewId===16?this.updateLastTouchSingle(h,$):this.viewId===18&&this.updateSpecificPlaysFiltersSingle(h,$)}}updateComparative(r,n){if(r.view.componentProps){const v=n[0]||[];if(v&&v.length>0){let $;if(Array.isArray(v)){const u=this.childViews.findIndex(i=>i.view.id===r.view.id);u>=0&&u<v.length?$=v[u]:$=v[0]}else $=v;const h=R4.get(this.viewId);r.view.componentProps.type=$,r.view.componentProps.default=!1,r.view.title=`Comparativa ${h[$]}`,r.view.filterMultiple={category:$}}Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n})}}updateVolumetricField(r,n){if(r.view.componentProps){const v=n[0]||1;r.view.isHomeTeam=v===1,r.view.componentProps.preMatchType=v,r.view.filterMultiple={isHomeTeam:v},Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateGoalData(r,n){if(r.view.componentProps){const v=n[0]===1?"offensive":"defensive",$=n[1]===1;r.view.componentProps.analysisType=v,r.view.componentProps.isHomeTeamForAnalysis=$,r.view.isHomeTeam=$,r.view.filterMultiple={isHomeTeam:$},Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateFieldDataByZones(r,n){if(r.view.componentProps){const v=n[0],$=n[1]===1;if(r.view.componentProps.isHomeTeamForAnalysis=$,r.view.isHomeTeam=$,r.view.filterMultiple={categoryIds:v,isHomeTeam:$},v&&v.length){const h=v.join("-"),u=R4.get(this.viewId).analysisTypes.get(h);u&&(r.view.componentProps.analysisType=u.analysisType,r.view.title=u.title,r.view.titleShort=u.titleShort)}}}updateXg(r,n){const v=n[0]===1;r.view.componentProps&&(r.view.isHomeTeam=v,r.view.componentProps.isHomeTeamForAnalysis=v,r.view.filtersJSON=this.filtresJSON,r.view.filterMultiple={isHomeTeam:v})}updateMatchSummary(r,n){if(r.view.componentProps){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const v=n&&n.length>0?n[0]:!1;r.view.componentProps.desplegable=v,r.view.componentProps.key=v,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n})}}updateTimeline(r,n){if(r.view.componentProps){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const v=this.getComponentDynamicFilters(r.view.id)||n,$=v&&v.length>0?v[0]:[];r.view.componentProps.selectedEvents=$,r.view.componentProps.key=$.length>0;const h=this.hasEventTypeId($,1),u=this.hasCategoryId($,8),i=this.hasCategoryId($,9),p=this.hasEventTypeId($,3);r.view.componentProps.goals=h,r.view.componentProps.yellowCards=u,r.view.componentProps.redCards=i,r.view.componentProps.substitutions=p,r.view.componentProps._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:v}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:v}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateFieldPosesion(r,n){if(r.view.componentProps){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const v=n&&n.length>0?n[0]:!1;r.view.componentProps.areInactiveVisible=v,r.view.componentProps.key=v,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n})}}updateGSCtops(r,n){if(r.view.componentProps){const v=n[0]||[];if(Array.isArray(v)){if(v.length>0){const $=v[0];let h=null;try{h=A4($)}catch(i){console.warn("Error getting category by ID:",i)}const u=n[1]||1;r.view.filterMultiple={categoryId:$,teamType:u},r.view.componentProps.game&&(u===1?r.view.componentProps.teamView=r.view.componentProps.game.homeTeam.team_id:u===2?r.view.componentProps.teamView=r.view.componentProps.game.awayTeam.team_id:r.view.componentProps.teamView=0),r.view.componentProps.categoryView=h?[{id:$,name:h.name}]:[{id:$,name:`Category ${$}`}]}}else{const $=v;if($){let h=null;try{h=A4($)}catch(i){console.warn("Error getting category by ID:",i)}const u=n[1]||1;r.view.filterMultiple={categoryId:$,teamType:u},r.view.componentProps.game&&(u===1?r.view.componentProps.teamView=r.view.componentProps.game.homeTeam.team_id:u===2?r.view.componentProps.teamView=r.view.componentProps.game.awayTeam.team_id:r.view.componentProps.teamView=0),r.view.componentProps.categoryView=h?[{id:$,name:h.name}]:[{id:$,name:`Category ${$}`}]}}}}updateGSCLineupsReports(r,n){if(r.view.componentProps){const v=n[0]||[];if(Array.isArray(v)){if(v.length>0){const $=v[0];r.view.filterMultiple={gameNumber:$},r.view.componentProps.gameNumber=$}}else{const $=v;$&&(r.view.filterMultiple={gameNumber:$},r.view.componentProps.gameNumber=$)}Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}getCategoryIdFromAnalysisType(r,n){if(!r||!n)return null;for(const v of n){const $=v.join("-"),h=R4.get(this.viewId);if(h&&h.analysisTypes){const u=h.analysisTypes.get($);if(u&&u.analysisType===r)return v[0]||null}}return null}updateLastTouchFilters(){if(!this.filters){console.warn("No filters available in updateLastTouchFilters");return}this.childViews.forEach($=>{$.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,$.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,$.view.filterMultiple.howManyGamesSelected=this.filters.howManyGamesSelected,$.view.filterMultiple.isAssistZoneVisible=this.filters.isAssistZoneVisible});const r=this.filters.selectedCategories.map($=>$.value),n=r.map($=>$.name),v=this.filters.selectedTeam.value;if(v===3)this.childViews.length>r&&this.childViews.reduce(($,h)=>(n.includes(h.view.componentProps.categories[0].name)||$.push(h.view.componentProps.categories[0].name),$),[]).forEach($=>{const h=this.childViews.findIndex(u=>u.view.componentProps.categories[0].name===$);if(h!==-1){const u=this.childViews[h];this.removeChildView(u)}});else{const $=v===1,h=this.getHomeTeamViews(),u=this.getAwayTeamViews();if($&&h.length===0)u.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=$,i.view.isHomeTeam=$,i.view.filterMultiple.isHomeTeam=$});else if(!$&&u.length===0)h.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=$,i.view.isHomeTeam=$,i.view.filterMultiple.isHomeTeam=$});else if(h.length===u.length)$||h.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=$,i.view.isHomeTeam=$,i.view.filterMultiple.isHomeTeam=$}),($?u:h).forEach(i=>{this.removeChildView(i)});else{const i=$?this.getHomeTeamViews():this.getAwayTeamViews();if(i.length>r.length){const p=r.map(c=>c.name);i.forEach(c=>{p.includes(c.view.componentProps.categories[0].name)?c.view.filterMultiple.isHomeTeam=$:this.removeChildView(c)})}else i.forEach(p=>{p.view.filterMultiple.isHomeTeam=$})}}}updateLastTouchSingle(r,n){if(r.view.componentProps){const v=n.selectedTeam.value===1,$=n.selectedCategory.value;r.view.isHomeTeam=v,r.view.componentProps.isHomeTeamForAnalysis=v,r.view.componentProps.categories=[$],r.view.componentProps.analysisType=n.selectedGamePhase.name,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.isAssistZoneVisible=n.isAssistZoneVisible,r.view.componentProps.howManyGames=n.howManyGamesSelected.value,r.view.title=$.name,r.view.titleShort=$.name,r.view.isHomeTeam=v,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:$,selectedGamePhase:n.selectedGamePhase,howManyGamesSelected:n.howManyGamesSelected,isAssistZoneVisible:n.isAssistZoneVisible}}}updateSpecificPlaysFilters(){if(!this.filters)return;this.childViews.forEach(n=>{n.view.componentProps.advancedFilters=this.filters.advancedFilters,n.view.componentProps.howManyCorners=this.filters.howManyCorners,n.view.componentProps.isAgainstMode=this.filters.isAgainstMode,n.view.filterMultiple.advancedFilters=this.filters.advancedFilters,n.view.filterMultiple.isAgainstMode=this.filters.isAgainstMode});const r=this.filters.selectedTeam.value;if(r===3){const n=this.getHomeTeamViews(),v=this.getAwayTeamViews();if(n.length+v.length>this.filters.howManyCorners*2){const $=[];n.forEach((h,u)=>{u>=this.filters.howManyCorners&&$.push(h)}),v.forEach((h,u)=>{u>=this.filters.howManyCorners&&$.push(h)}),$.forEach(h=>{this.removeChildView(h)})}}else{const n=r===1,v=this.getHomeTeamViews(),$=this.getAwayTeamViews();if(n&&v.length===0)$.forEach(h=>{console.log("awayView before update:",h),h.view.componentProps.isHomeTeamForAnalysis=n,h.view.isHomeTeam=n,h.view.filterMultiple.isHomeTeam=n});else if(!n&&$.length===0)v.forEach(h=>{h.view.componentProps.isHomeTeamForAnalysis=n,h.view.isHomeTeam=n,h.view.filterMultiple.isHomeTeam=n});else if(v.length===$.length)n||v.forEach(h=>{h.view.componentProps.isHomeTeamForAnalysis=n,h.view.isHomeTeam=n,h.view.filterMultiple.isHomeTeam=n}),(n?$:v).forEach(h=>{this.removeChildView(h)});else{const h=n?this.getHomeTeamViews():this.getAwayTeamViews();h.length>this.filters.howManyCorners?h.forEach((u,i)=>{i>=this.filters.howManyCorners?this.removeChildView(u):u.view.filterMultiple.isHomeTeam=n}):h.forEach(u=>{u.view.filterMultiple.isHomeTeam=n})}}}updateSpecificPlaysFiltersSingle(r,n){if(n.selectedTeam&&r.view.componentProps){const v=n.selectedTeam.value===1;r.view.isHomeTeam=v,r.view.componentProps.isHomeTeamForAnalysis=v,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.advancedFilters=n.advancedFilters,r.view.componentProps.isAgainstMode=n.isAgainstMode,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:n.advancedFilters,isAgainstMode:n.isAgainstMode}}}}const cHe={class:"template-page__header"},uHe={class:"template-page__header__name"},dHe=["value"],pHe={class:"template-page__header__details"},hHe={class:"template-page__header__details__teams"},fHe={class:"template-page__header__details__teams__team"},mHe={key:0,class:"template-page__header__details__teams__team__logo"},yHe=["src"],gHe={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},vHe={class:"template-page__header__details__teams__team"},bHe={key:0,class:"template-page__header__details__teams__team__logo"},xHe=["src"],_He={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wHe={class:"template-page__content"},THe=["id"],SHe=["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"],kHe=t.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:r}){var n,v,$,h,u,i,p;const c=t.ref(null);let a=null;const k=e,T=t.ref(!1),x=r,d=t.computed(()=>k.page.items.reduce((je,_e)=>(je.set(_e.id,_e),je),new Map)),o=t.computed(()=>{var je,_e,Ue,qe;return k.game&&k.game.homeTeam&&k.game.awayTeam?{homeTeam:{name:((je=k.game.homeTeam)==null?void 0:je.acronym)||"LOC",logo:((_e=k.game.homeTeam)==null?void 0:_e.logo)||null},awayTeam:{name:((Ue=k.game.awayTeam)==null?void 0:Ue.acronym)||"VIS",logo:((qe=k.game.awayTeam)==null?void 0:qe.logo)||null}}:{homeTeam:{name:"LOC"},awayTeam:{name:"VIS"}}});let l=null,s=null,f=!1,g=null,S=!1;const L=()=>{S=!0},E=()=>{S=!1};function P(){S||(f=!0,g&&clearTimeout(g),g=setTimeout(()=>{f=!1},150))}function V(){const je={root:null,rootMargin:"0px",threshold:.7};l=new IntersectionObserver(qe=>{qe.forEach(Re=>{if(f){s&&clearTimeout(s),s=setTimeout(()=>{x("intersection-changed",Re.isIntersecting)},100);return}s&&clearTimeout(s),s=setTimeout(()=>{x("intersection-changed",Re.isIntersecting)},50)})},je);const _e=c.value;_e&&l.observe(_e);const Ue=document.querySelector(".container-main");Ue&&Ue.addEventListener("scroll",P,{passive:!0}),document.addEventListener("programmatic-scroll-start",L),document.addEventListener("programmatic-scroll-end",E)}function I(je){k.page.title=je.target.value,x("view-changed")}const j={game_id:0,season_id:0,prematch:!1},U={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:[]}},D=new Map([[5,{component:DI,componentName:"GSCVolumetricField",props:{isGamePreMatch:!k.isPostMatch,areTeamsVisible:!1,isTitleVisible:!1,isGhostEffect:k.isTemplateMode,isTemplateMode:k.isTemplateMode,preMatchType:1}}],[2,{component:zj,componentName:"GscTopPlayer",props:{categoryView:[{id:0,name:"Category"}],gamed:k.game?k.game.id:U.gameId,game:k.game,season:k.game?(n=k==null?void 0:k.game)==null?void 0:n.season_id:U.seasonId,teamView:0,useDummyData:k.isTemplateMode}}],[8,{component:AD,componentName:"FieldPosesion",props:{widthSection:600,game:U,teamSelected:{teamId:0},areInactiveVisible:!0,showTitle:!1,isDefault:!0,key:!1}}],[6,{component:IK,componentName:"GSCLineupsReports",props:{selectedOption:k.isPostMatch?"Postmatch":"Prematch",game:j,gamehome:j,gameaway:j}}],[3,{component:FD,componentName:"GSCMatchSummary",props:{game:U,defaultShields:!0,desplegable:!1}}],[4,{component:wW,componentName:"GSCTimelineReports",props:{key:!0,isDefault:!0,gameId:U.gameId,homeTeam:U.homeTeam.team_id,awayTeam:U.awayTeam.team_id,token:k.token,goals:!0,yellowCards:!0,redCards:!0,substitutions:!0}}],[7,{component:EB,componentName:"GSCGoalData",props:{game:k.game,isHomeTeamForAnalysis:!0,canInteract:!1,canPlayVideos:!1,isPreMatch:!k.isPostMatch,analysisType:1}}],[9,{component:WK,componentName:"GSCFieldDataByZones",props:{game:k.game,isHomeTeamForAnalysis:!0,analysisType:"successfulPasses",canPlayVideos:!1,isPreMatch:!k.isPostMatch,negative:!0}}],[10,{component:iP,componentName:"GSCGameXg",props:{game:k.game,isHomeTeamForAnalysis:!0,isPostMatch:k.isPostMatch}}],[13,{component:YF,componentName:"GSCTimelapseTable",props:{isdefault:!0,seasonId:k.game?(v=k==null?void 0:k.game)==null?void 0:v.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:cF,componentName:"GSCGeneraltable",props:{isReports:!0,isDefault:!0,type:0,typeView:1,tournament:1,currentSeasonId:2010,showVideos:!1,localTeam:2,awayTeam:1}}],[15,{component:EX,componentName:"GSCStrengths",props:{token:k.token,view:1,numitems:3,typegame:1,isdefault:!0,data:{player:35240,season:1772,type:2,team:14}}}],[17,{component:DG,componentName:"GSCCornersGeneralTrend",props:{game:k.game?{id:k.game.id||k.game.game_id||k.game.gameId||null,home_team:k.game.home_team||null,away_team:k.game.visiting_team||null,season:k.game.seasonId||k.game.season_id||null,game_status:k.game.game_status||k.game.status||null,home_acronym:k.game.home_team_acronym||(($=k.game.homeTeam)==null?void 0:$.acronym)||null,away_acronym:k.game.visiting_team_acronym||((h=k.game.awayTeam)==null?void 0:h.acronym)||null,logo_home:((u=k.game.homeTeam)==null?void 0:u.logo)||null,logo_away:((i=k.game.awayTeam)==null?void 0:i.logo)||null}:null,infavoragainstteam:!0,forseason:!1,forteam:!0,showdefault:!0,tournamentselected:{id:1},forgame:!1,lateralidad:"right",teamselected:2,filters:{},showBallGo:!0,showHeatMap:!0,ballOnOff:!1}}],[10,{component:iP,componentName:"GSCGameXg",props:{game:k.game,isHomeTeamForAnalysis:!0,isPostMatch:k.isPostMatch}}],[1,{component:NB,componentName:"GSCComparativeReports",props:{gameId:k.game?k.game.id:"",homeLogo:k.game?k.game.homeTeam.logo:"",awayLogo:k.game?k.game.awayTeam.logo:"",seasonId:k.game?(p=k==null?void 0:k.game)==null?void 0:p.season_id:0,typeGame:k.isPostMatch,type:"stoppedBall",default:k.isTemplateMode}}],[16,{component:UX,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:k.isTemplateMode,isPreMatch:!k.isPostMatch}}],[18,{component:AZ,componentName:"GSCSpecificPlays",props:{isHomeTeamForAnalysis:!0,isTemplateMode:k.isTemplateMode,isPreMatch:!k.isPostMatch,seasonIdForAnalysis:1325,selectedCategory:31,teamIdForAnalysis:1,isAgainstMode:!1,game:{id:62323,home_team:1,away_team:14,season:1325,game_status:4,home_acronym:"CHI",away_acronym:"SAN",logo_home:"https://golstatsimages.blob.core.windows.net/teams-80/1.png",logo_away:"https://golstatsimages.blob.core.windows.net/teams-80/14.png"},advancedFilters:{areConnectionsVisible:!1,arePathsVisible:!1,secondsBefore:-1,secondsAfter:1,secondsBeforeAndAfter:0}}}]]);function F(je){var _e,Ue,qe;if(((_e=je==null?void 0:je.coreView)==null?void 0:_e.id)===17&&je.dynamicFilters&&je.dynamicFilters[2]!==void 0){const Re=je.dynamicFilters[2];if(Re===1)return!0;if(Re===2)return!1;if(Re===3&&((Ue=je.filterMultiple)==null?void 0:Ue.isHomeTeam)!==void 0)return typeof je.filterMultiple.isHomeTeam=="boolean"?je.filterMultiple.isHomeTeam:je.filterMultiple.isHomeTeam===1}return(qe=je.componentProps)!=null&&qe.preMatchType?je.componentProps.preMatchType===1:je.isHomeTeam}function z(je){if(je)if(typeof je=="string"){let _e=null;switch(je){case"GSCVolumetricField":_e=DI;break;case"GSCGoalData":_e=EB;break;case"GscTopPlayer":_e=zj;break;case"FieldPosesion":_e=AD;break;case"GSCLineupsReports":_e=IK;break;case"GSCMatchSummary":_e=FD;break;case"GSCTimelineReports":_e=wW;break;case"GSCFieldDataByZones":_e=WK;break;case"GSCGeneraltable":_e=cF;break;case"GSCTimelapseTable":_e=YF;break;case"GSCGameXg":_e=iP;break;case"GSCComparativeReports":_e=NB;break;case"GSCStrengths":_e=EX;break;case"GSCCornersGeneralTrend":_e=DG;break;case"GSCLastTouch":_e=UX;break;case"GSCSpecificPlays":_e=AZ;break;default:_e=null}return _e}else return je;return null}function X({pageId:je,view:_e,filterAndWidgetContainer:Ue,applyMinimumSize:qe=!1,dynamicFilters:Re=[],filters:We=null}){if(k.page.id===je&&a){let Qe=!1;_e.id===3&&(Qe=Re[0]);const rt=`min_column${Qe?"_2":""}`,dt=`min_row${Qe?"_2":""}`,ut=`colspan${Qe?"_2":""}`,Ye=`rowspan${Qe?"_2":""}`,st={w:qe?_e[rt]:_e[ut],h:qe?_e[dt]:_e[Ye]};if(a.willItFit(0,0,st.w,st.h,!0)){const lt=a.addWidget(st),Ot=Number(lt.getAttribute("gs-x")||0),zt=Number(lt.getAttribute("gs-y")||0);a.removeWidget(lt);const Et=D.get(_e.id),qt=t.reactive({...JSON.parse(JSON.stringify(Et.props))||{},_isReactive:!0}),Gt=t.reactive({pageId:je,grid:a,page:k.page,view:{name:_e.name,title:_e.title,key:Date.now()-7*Math.random(),id:`w-${String(Date.now())}`,x:Ot,y:zt,w:st.w,h:st.h,maxWidth:_e.max_column,maxHeight:_e.max_row,minWidth:_e.min_column,minHeight:_e.min_row,componentName:Et.componentName,componentProps:qt,pageId:je,coreView:_e}});Ue.addView(Gt),Sd.emit("add-page-view",Gt)}else Sd.emit("add-page-and-view",{pageId:je,view:_e,filterAndWidgetContainer:Ue})}}function M(je){if(a){const _e=document.querySelector(`[gs-id="${je.id}"]`);_e&&(a.removeWidget(_e),x("delete-view",je))}}function Y(je){if(!je.filterAndViewsContainer&&je.coreView){const _e=new Qk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[je],je.coreView.id,je.dynamicFilters||[],k.isPostMatch,k.isTemplateMode,je.filtersJSON,null,je.filters);je.filterAndViewsContainer=_e}x("edit-view",je)}function se(){x("delete-page",k.page)}function me(){Sd.emit("change-sort",k.page)}function ge(je){if(f)return;const _e=k.page.items.find(Ue=>Ue.id===je.itemId||Ue.id===je.viewId);_e&&(Object.assign(_e.componentProps,je.componentProps),_e._updateKey=Date.now())}function be(je){if(f)return;const _e=k.page.items.find(Ue=>Ue.id===je.viewId);_e&&(Object.assign(_e.componentProps,je.componentProps),_e._updateKey=Date.now())}function xe(je){if(f)return;const _e=k.page.items.find(Ue=>Ue.id===je.viewId);_e&&(Object.assign(_e.componentProps,je.componentProps||{}),_e._updateKey=Date.now())}const Pe=function(){Sd.off("add-view",X),Sd.off("force-component-update",ge),Sd.off("component-props-updated",be),Sd.off("dynamic-filters-changed",xe);const je=document.querySelector(".container-main");je&&je.removeEventListener("scroll",P),s&&clearTimeout(s),g&&clearTimeout(g)};return Sd.on("add-view",X),Sd.on("force-component-update",ge),Sd.on("component-props-updated",be),Sd.on("dynamic-filters-changed",xe),t.onMounted(async()=>{await t.nextTick(),a=Rh.init({column:12,row:12,maxRow:12,cellHeight:60,float:!0,resizable:{handles:"e, se, s, sw, w"}},`#grid-stack-${k.id}`),a.on("change",(je,_e)=>{const Ue=_e[0];if(Ue){const qe=d.value.get(Ue.id);qe&&(qe.x=Ue.x,qe.y=Ue.y,qe.w=Ue.w,qe.h=Ue.h,x("view-changed"))}}),V(),k.page.grid=a,k.page.offListeners=Pe}),t.onUnmounted(()=>{l&&l.disconnect(),Pe(),s&&clearTimeout(s),g&&clearTimeout(g),document.removeEventListener("programmatic-scroll-start",L),document.removeEventListener("programmatic-scroll-end",E)}),(je,_e)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"templatePage",ref:c,class:"template-page"},[t.createElementVNode("div",cHe,[T.value?(t.openBlock(),t.createBlock(RZ,{key:0,"options-type":"page",onClick:_e[0]||(_e[0]=t.withModifiers(Ue=>T.value=!1,["self"])),onMouseleave:_e[1]||(_e[1]=Ue=>T.value=!1),onCloseTooltip:_e[2]||(_e[2]=Ue=>T.value=!1),onDeletePage:se,onChangeSort:me})):t.createCommentVNode("",!0),t.createElementVNode("div",uHe,[_e[4]||(_e[4]=t.createElementVNode("div",null,[t.createElementVNode("svg",{width:"19",height:"21",viewBox:"0 0 19 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.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)),_e[5]||(_e[5]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("input",{value:e.page.title,type:"text",class:"page-title-input",onclick:"this.select()",onInput:I},null,40,dHe)]),t.createElementVNode("div",pHe,[t.createElementVNode("div",hHe,[t.createElementVNode("div",fHe,[o.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",mHe,[t.createElementVNode("img",{src:o.value.homeTeam.logo,alt:"Home Team Logo",width:"25",height:"25"},null,8,yHe)])):(t.openBlock(),t.createElementBlock("svg",gHe,[..._e[6]||(_e[6]=[t.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)])])),t.createElementVNode("span",null,t.toDisplayString(o.value.homeTeam.name),1)]),_e[8]||(_e[8]=t.createElementVNode("div",{class:"template-page__header__details__teams__vs"}," VS ",-1)),t.createElementVNode("div",vHe,[t.createElementVNode("span",null,t.toDisplayString(o.value.awayTeam.name),1),o.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",bHe,[t.createElementVNode("img",{src:o.value.awayTeam.logo,alt:"Away Team Logo",width:"25",height:"25"},null,8,xHe)])):(t.openBlock(),t.createElementBlock("svg",_He,[..._e[7]||(_e[7]=[t.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?(t.openBlock(),t.createElementBlock("div",{key:0,class:"template-page__header__details__options",onClick:_e[3]||(_e[3]=Ue=>T.value=!0)},[..._e[9]||(_e[9]=[t.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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)])])):t.createCommentVNode("",!0)])]),t.createElementVNode("div",wHe,[t.createElementVNode("div",{id:`grid-stack-${e.id}`,class:"grid-stack"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.page.items,Ue=>{var qe;return t.openBlock(),t.createElementBlock("div",{class:"grid-stack-item",key:Ue.key,"gs-id":Ue.id,"gs-x":Ue.x,"gs-y":Ue.y,"gs-w":Ue.w,"gs-h":Ue.h,"gs-max-w":Ue.maxWidth,"gs-max-h":Ue.maxHeight,"gs-min-w":Ue.minWidth,"gs-min-h":Ue.minHeight,"gs-no-resize":!e.isTemplateMode,"gs-no-move":!k.isTemplateMode,"gs-auto-position":Ue.x===0&&Ue.y===0},[t.createElementVNode("div",{class:t.normalizeClass(["grid-stack-item-content",{"is-selected":Ue.isSelected}])},[t.createVNode(eHe,{view:Ue,"is-template-mode":e.isTemplateMode,"is-post-match":e.isPostMatch,game:e.game,lastGames:e.lastGames,"is-home-team":F(Ue),"is-filter-visible":e.isFilterVisible,"view-id":((qe=Ue==null?void 0:Ue.coreView)==null?void 0:qe.id)||0,onEdit:Re=>Y(Ue),onDelete:Re=>M(Ue)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(z(Ue.componentName)),t.mergeProps({ref_for:!0},Ue.componentProps,{key:`${Ue.id}-${Ue._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,SHe)}),128))],8,THe)])],512))}}),LHe=t2(kHe,[["__scopeId","data-v-b0bc39a0"]]),NHe={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},OHe={key:0,class:"cover__main-logo cover__main-logo__home"},MHe={key:0,class:"team-logo"},EHe=["src"],CHe={key:1,width:"575",height:"675",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},zHe=["fill"],VHe={key:1,class:"cover__main-logo cover__main-logo__away"},PHe={key:0,class:"team-logo"},AHe=["src"],RHe={key:1,width:"575",height:"575",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},UHe=["fill"],FHe={class:"cover__title-subtitle"},IHe={class:"cover__title-subtitle__title"},qHe={class:"cover__title-subtitle__subtitle"},jHe={key:2,class:"cover-type-one"},DHe={class:"team-info-one"},WHe={class:"team-data"},KHe={key:0,class:"team-logo"},BHe=["src"],XHe={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},GHe=["fill","opacity"],ZHe={class:"team-name"},JHe={key:0,class:"team-events"},HHe={class:"score-one"},YHe={key:0},QHe={class:"team-info-one"},$He={class:"team-data"},eYe={key:0,class:"team-logo"},tYe=["src"],rYe={key:1,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},nYe=["fill","opacity"],aYe={class:"team-name"},iYe={key:0,class:"team-events"},oYe={key:3,class:"cover-type-two"},sYe={class:"team-data"},lYe={class:"team-info"},cYe={key:0,class:"team-logo"},uYe=["src"],dYe={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},pYe=["fill","opacity"],hYe={key:2,class:"team-score-two"},fYe={key:0,class:"team-goals"},mYe={class:"team-data"},yYe={class:"team-info"},gYe={key:0,class:"team-score-two"},vYe={key:1,class:"team-logo"},bYe=["src"],xYe={key:2,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_Ye=["fill","opacity"],wYe={key:0,class:"team-goals"},TYe={__name:"CoverPage",props:{game:{type:Object,default:()=>null},coverId:{type:Number,default:1},isPostMatch:{type:Boolean,default:!0}},emits:["intersection-changed"],setup(e,{emit:r}){const n=e,v=r,$=t.ref(null),h=t.computed(()=>[1,2].includes(n.coverId)),u=t.computed(()=>[1,3].includes(n.coverId)),i=t.computed(()=>n.coverId===1?{homeTeam:"#1558CC",awayTeam:"#0046BF",opacity:1}:n.coverId===3?{homeTeam:"#000A1A",awayTeam:"#000A1A",opacity:.4}:{homeTeam:"#576883",awayTeam:"#576883",opacity:.4}),p=t.computed(()=>n.game&&n.game.score?n.game.score:["0","0"]),c=t.computed(()=>{var I,j,U,D,F,z,X,M;if(n.game&&n.game.homeTeam&&n.game.awayTeam){const Y={homeTeam:{name:((I=n.game.homeTeam)==null?void 0:I.acronym)||"LOC",logo:((j=n.game.homeTeam)==null?void 0:j.logo)||null},awayTeam:{name:((U=n.game.awayTeam)==null?void 0:U.acronym)||"VIS",logo:((D=n.game.awayTeam)==null?void 0:D.logo)||null}};return h.value?(Y.homeTeam.goalsMinutes=o(n.game.minutes.home_goals_minutes),Y.homeTeam.totalYellowCards=((F=n.game.minutes.home_yellow_cards_minutes)==null?void 0:F.length)||0,Y.homeTeam.totalRedCards=((z=n.game.minutes.home_red_cards_minutes)==null?void 0:z.length)||0,Y.awayTeam.goalsMinutes=o(n.game.minutes.visiting_goals_minutes),Y.awayTeam.totalYellowCards=((X=n.game.minutes.away_yellow_cards_minutes)==null?void 0:X.length)||0,Y.awayTeam.totalRedCards=((M=n.game.minutes.away_red_cards_minutes)==null?void 0:M.length)||0):(Y.homeTeam.goalsEvents=d(n.game.report_minutes.home_goals_minutes),Y.awayTeam.goalsEvents=d(n.game.report_minutes.visiting_goals_minutes)),Y}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'"}]}}}),a=t.computed(()=>({"--background-image":u.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":n.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-one":n.isPostMatch?"100%":"fit-content","--grid-template-columns-type-two":n.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-two":n.isPostMatch?"100%":"fit-content"})),k=t.computed(()=>n.isPostMatch?"Postmatch":"Prematch"),T=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],x=t.computed(()=>{if(n.game){let I=NHe[n.game.matchday_abbreviation];I||(I=n.game.matchday_abbreviation.replace("M","J"));const[j,U,D]=n.game.date.split("-");return`${I} - ${D} ${T[Number(U)-1]}, ${j}`}return"Jornada - Día 00 Mes"});function d(I){return!I||!Array.isArray(I)||I.length===0?"":I.map(j=>{const U=j.split(", ");let D=U[0].replace("'","");D=D.replace("+",""),D=D.replace("’","");const F=D.split(" "),{strings:z,numbers:X}=F.reduce((se,me)=>(isNaN(Number(me))?se.strings.push(me):se.numbers.push(me),se),{strings:[],numbers:[]}),M=z.join(" "),Y=X.length===1?`${X[0]}'`:`${X[0]}' ${X.slice(1).join(" + ")}'`;return{playerName:M,goalTime:U.length===1?Y:`${Y}, ${U.reduce((se,me,ge)=>ge===0?se:`${se}${me}${ge<U.length-1?", ":""}`,"")}`}})}function o(I){return!I||!Array.isArray(I)||I.length===0?"":I.reduce((j,U,D)=>{const F=U.split(" ");let z="";return F.length===3?z=F[2]:F.length===5&&(z=`${F[2]} ${F[3]} ${F[4]}`),z&&(j+=`${z}${D<I.length-1?", ":""}`),j},"")}let l=null,s=null,f=!1,g=null,S=!1;const L=()=>{S=!0},E=()=>{S=!1};function P(){S||(f=!0,g&&clearTimeout(g),g=setTimeout(()=>{f=!1},150))}function V(){const I={root:null,rootMargin:"0px",threshold:.7};l=new IntersectionObserver(D=>{D.forEach(F=>{if(f){s&&clearTimeout(s),s=setTimeout(()=>{v("intersection-changed",F.isIntersecting)},100);return}s&&clearTimeout(s),s=setTimeout(()=>{v("intersection-changed",F.isIntersecting)},50)})},I);const j=$.value;j&&l.observe(j);const U=document.querySelector(".container-main");U&&U.addEventListener("scroll",P,{passive:!0}),document.addEventListener("programmatic-scroll-start",L),document.addEventListener("programmatic-scroll-end",E)}return t.onMounted(()=>{V()}),t.onUnmounted(()=>{l&&l.disconnect();const I=document.querySelector(".container-main");I&&I.removeEventListener("scroll",P),document.removeEventListener("programmatic-scroll-start",L),document.removeEventListener("programmatic-scroll-end",E),s&&clearTimeout(s),g&&clearTimeout(g)}),(I,j)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"coverPage",ref:$,class:"cover",style:t.normalizeStyle(a.value)},[h.value?(t.openBlock(),t.createElementBlock("div",OHe,[c.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",MHe,[t.createElementVNode("img",{src:c.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,EHe)])):(t.openBlock(),t.createElementBlock("svg",CHe,[t.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:i.value.homeTeam},null,8,zHe)]))])):t.createCommentVNode("",!0),h.value?(t.openBlock(),t.createElementBlock("div",VHe,[c.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",PHe,[t.createElementVNode("img",{src:c.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,AHe)])):(t.openBlock(),t.createElementBlock("svg",RHe,[t.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:i.value.awayTeam},null,8,UHe)]))])):t.createCommentVNode("",!0),t.createElementVNode("div",FHe,[t.createElementVNode("div",IHe,[j[0]||(j[0]=t.createElementVNode("div",null,"Análisis",-1)),t.createElementVNode("div",null,t.toDisplayString(k.value),1)]),t.createElementVNode("div",qHe,t.toDisplayString(x.value),1)]),h.value?(t.openBlock(),t.createElementBlock("div",jHe,[t.createElementVNode("div",DHe,[t.createElementVNode("div",WHe,[c.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",KHe,[t.createElementVNode("img",{src:c.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,BHe)])):(t.openBlock(),t.createElementBlock("svg",XHe,[t.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:i.value.homeTeam,opacity:i.value.opacity},null,8,GHe)])),t.createElementVNode("div",ZHe,t.toDisplayString(c.value.homeTeam.name),1)]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",JHe,[j[1]||(j[1]=t.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)),t.createElementVNode("div",null,t.toDisplayString(c.value.homeTeam.goalsMinutes),1),j[2]||(j[2]=t.createElementVNode("div",{class:"separator"},null,-1)),j[3]||(j[3]=t.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),t.createElementVNode("div",null,t.toDisplayString(c.value.homeTeam.totalYellowCards),1),j[4]||(j[4]=t.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),t.createElementVNode("div",null,t.toDisplayString(c.value.homeTeam.totalRedCards),1)])):t.createCommentVNode("",!0)]),t.createElementVNode("div",HHe,[e.isPostMatch?(t.openBlock(),t.createElementBlock("div",YHe,t.toDisplayString(p.value[0])+" : "+t.toDisplayString(p.value[1]),1)):t.createCommentVNode("",!0)]),t.createElementVNode("div",QHe,[t.createElementVNode("div",$He,[c.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",eYe,[t.createElementVNode("img",{src:c.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,tYe)])):(t.openBlock(),t.createElementBlock("svg",rYe,[t.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:i.value.awayTeam,opacity:i.value.opacity},null,8,nYe)])),t.createElementVNode("div",aYe,t.toDisplayString(c.value.awayTeam.name),1)]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",iYe,[t.createElementVNode("div",null,t.toDisplayString(c.value.awayTeam.totalYellowCards),1),j[5]||(j[5]=t.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),t.createElementVNode("div",null,t.toDisplayString(c.value.awayTeam.totalRedCards),1),j[6]||(j[6]=t.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),j[7]||(j[7]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",null,t.toDisplayString(c.value.awayTeam.goalsMinutes),1),j[8]||(j[8]=t.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))])):t.createCommentVNode("",!0)])])):(t.openBlock(),t.createElementBlock("div",oYe,[t.createElementVNode("div",sYe,[t.createElementVNode("div",lYe,[c.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",cYe,[t.createElementVNode("img",{src:c.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,uYe)])):(t.openBlock(),t.createElementBlock("svg",dYe,[t.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:i.value.homeTeam,opacity:i.value.opacity},null,8,pYe)])),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",hYe,t.toDisplayString(p.value[0]),1)):t.createCommentVNode("",!0)]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",fYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value.homeTeam.goalsEvents,(U,D)=>(t.openBlock(),t.createElementBlock("div",{key:`goal-${D}`,class:"goal"},[t.createElementVNode("div",null,t.toDisplayString(U.playerName),1),j[9]||(j[9]=t.createElementVNode("div",{class:"bullet"},null,-1)),t.createElementVNode("div",null,t.toDisplayString(U.goalTime),1),j[10]||(j[10]=t.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))])):t.createCommentVNode("",!0)]),j[13]||(j[13]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",mYe,[t.createElementVNode("div",yYe,[e.isPostMatch?(t.openBlock(),t.createElementBlock("div",gYe,t.toDisplayString(p.value[1]),1)):t.createCommentVNode("",!0),c.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",vYe,[t.createElementVNode("img",{src:c.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,bYe)])):(t.openBlock(),t.createElementBlock("svg",xYe,[t.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:i.value.awayTeam,opacity:i.value.opacity},null,8,_Ye)]))]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",wYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value.awayTeam.goalsEvents,(U,D)=>(t.openBlock(),t.createElementBlock("div",{key:`goal-a-${D}`,class:"goal"},[j[11]||(j[11]=t.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)),t.createElementVNode("div",null,t.toDisplayString(U.goalTime),1),j[12]||(j[12]=t.createElementVNode("div",{class:"bullet"},null,-1)),t.createElementVNode("div",null,t.toDisplayString(U.playerName),1)]))),128))])):t.createCommentVNode("",!0)])]))],4))}},SYe=t2(TYe,[["__scopeId","data-v-6680cbcf"]]),kYe={class:"table-category-filters"},LYe={key:0,class:"custom-radio-group filter-inline"},NYe={class:"radio-label"},OYe={class:"radio-options"},MYe=["name","value","onUpdate:modelValue"],EYe=["data-filter-type","onClick"],CYe={class:"select-display"},zYe={class:"select-label"},VYe={key:0,class:"dropdown-menu type-menu simple-select-menu"},PYe={class:"simple-select-scroll-area"},AYe=["onClick"],RYe={class:"option-content"},UYe={class:"option-title"},FYe={key:0,class:"option-checkmark"},IYe={key:2,class:"filter-separator"},qYe={__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:r,emit:n}){const v=e,$=n,h=t.ref([]);let u=null;const i=(S,L)=>{if(!L)return!0;for(let E=0;E<S.length;E++)if(!p(S[E],L[E]))return!0;return!1},p=(S,L)=>{if(Array.isArray(S)&&Array.isArray(L)){if(S.length!==L.length)return!1;for(let E=0;E<S.length;E++)if(S[E]!==L[E])return!1;return!0}return S===L},c=t.ref(null),a=t.ref([]);let k=!1,T=null;const x=()=>{T=null},d=()=>{setTimeout(()=>{k=!1},1e3)},o=(S,L=!0)=>{if(v.filters&&v.filters[0]&&v.filters[1]&&v.filters[1].options){const E=v.filters[0].options,P=v.filters[1].options;S!=null?E.findIndex(V=>V.value===S)!==-1&&P[S]?(a.value=P[S],L&&!(()=>{const V=h.value[1];return V==null?!1:Array.isArray(V)?V.length>0:V!==""})()&&!k&&a.value.length>0&&(h.value[1]=a.value[0].value,t.nextTick(()=>{}))):(a.value=[],h.value[1]=null):(a.value=[],h.value[1]=null)}},l=()=>{v.initialValues&&v.initialValues.length>0?h.value=[...v.initialValues]:h.value=v.filters.map(S=>{var L,E,P,V;return S.type==="select"?[]:S.type==="check"?!1:S.type==="radio-button"?((E=(L=S.options)==null?void 0:L[0])==null?void 0:E.value)||null:S.type==="select-simple"&&((V=(P=S.options)==null?void 0:P[0])==null?void 0:V.value)||null}),v.componentId===13&&h.value.some(S=>S!=null&&(Array.isArray(S)?S.length>0:S!==!1&&S!==""))&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))};l(),setTimeout(()=>{t.nextTick(()=>{if(h.value[0]!==null&&h.value[0]!==void 0&&!k){const S=!(()=>{const L=h.value[1];return L==null?!1:Array.isArray(L)?L.length>0:L!==""})();o(h.value[0],S)}})},300),t.watch(()=>v.initialValues,S=>{const L=!p(h.value,S),E=S&&S.length>0&&!k&&L,P=v.isEditMode&&k;E&&!P?h.value=[...S]:k?T&&T.length>0&&(h.value=[...T]):P&&T&&T.length>0&&(h.value=[...T])},{deep:!0}),t.watch(()=>v.isEditMode,(S,L)=>{L===!0&&S===!1&&x()},{immediate:!0}),t.watch(h,(S,L)=>{S.some(E=>E!=null&&(Array.isArray(E)?E.length>0:E!==!1&&E!==""))&&i(S,u)&&(u=[...S],$("filters-changed",{componentId:v.componentId,filters:S,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),t.watch(()=>h.value[0],(S,L)=>{S!==L&&L!==void 0?o(S,!0):L===void 0&&S!==null&&S!==void 0&&o(S,!1)},{immediate:!0}),t.watch(()=>h.value,(S,L)=>{v.filters.map((E,P)=>E.type==="radio-button"?P:-1).filter(E=>E!==-1)},{deep:!0}),t.watch(a,()=>{},{deep:!0});const s=S=>{c.value===S?c.value=null:c.value=S},f=(S,L)=>{if(k=!0,d(),h.value[S]=L,(S===0||S===1)&&(T=[...h.value]),c.value=null,S===0){h.value[1]!==void 0&&(h.value[1]=null);const E=k;k=!1,o(L,!0),k=E,h.value[1]!==null&&h.value[1]!==void 0&&(T=[...h.value])}},g=()=>{k=!0,setTimeout(()=>{k=!1},1e3)};return r({getCurrentValues:()=>h.value,initializeValues:l}),(S,L)=>(t.openBlock(),t.createElementBlock("div",kYe,[e.filters&&e.filters.length>0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filters,(E,P)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:P},[E.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",LYe,[t.createElementVNode("div",NYe,t.toDisplayString(E.label),1),t.createElementVNode("div",OYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(E.options,V=>(t.openBlock(),t.createElementBlock("label",{key:V.value,class:t.normalizeClass(["radio-option-card",{active:h.value[P]===V.value}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"table-radio-"+P,value:V.value,"onUpdate:modelValue":I=>h.value[P]=I,onChange:L[0]||(L[0]=()=>{g()})},null,40,MYe),[[t.vModelRadio,h.value[P]]]),t.createElementVNode("span",null,t.toDisplayString(V.label),1)],2))),128))])])):E.type==="select-simple"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"custom-select dynamic-select filter-inline","data-filter-type":E.type,onClick:t.withModifiers(V=>s(P),["stop"])},[t.createElementVNode("div",CYe,[L[2]||(L[2]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.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)),t.createElementVNode("span",zYe,t.toDisplayString(E.label||"Tipo de análisis"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:c.value===P}])},[...L[1]||(L[1]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),c.value===P?(t.openBlock(),t.createElementBlock("div",VYe,[t.createElementVNode("div",PYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(P===1?a.value:E.options,V=>(t.openBlock(),t.createElementBlock("div",{key:V.value,class:t.normalizeClass(["option-card simple-select-option",{active:p(h.value[P],V.value)}]),onClick:t.withModifiers(I=>f(P,V.value),["stop"])},[t.createElementVNode("div",RYe,[t.createElementVNode("div",UYe,t.toDisplayString(V.label),1)]),p(h.value[P],V.value)?(t.openBlock(),t.createElementBlock("div",FYe,[...L[3]||(L[3]=[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[t.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):t.createCommentVNode("",!0)],10,AYe))),128))])])):t.createCommentVNode("",!0)],8,EYe)):t.createCommentVNode("",!0),P===1&&e.filters.length>2?(t.openBlock(),t.createElementBlock("div",IYe)):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0)]))}},jYe=t2(qYe,[["__scopeId","data-v-fd7f7425"]]),DYe={class:"strengths-filters"},WYe={key:0,class:"custom-radio-group filter-inline"},KYe={class:"radio-label"},BYe={class:"radio-options"},XYe=["name","value","onUpdate:modelValue"],GYe={class:"filter-inline select-with-label"},ZYe=["data-filter-type","onClick"],JYe={class:"select-display"},HYe={class:"select-label"},YYe={key:0,class:"dropdown-menu type-menu simple-select-menu"},QYe={class:"simple-select-scroll-area"},$Ye=["onClick"],eQe={class:"option-content"},tQe={class:"option-title"},rQe={key:0,class:"option-checkmark"},nQe={key:2,class:"filter-separator"},aQe={__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:r,emit:n}){const v=e,$=n,h=t.ref([]);let u=null;const i=t.ref(null),p=t.ref([]);let c=!1,a=null;const k=(s,f)=>{if(Array.isArray(s)&&Array.isArray(f)){if(s.length!==f.length)return!1;for(let g=0;g<s.length;g++)if(s[g]!==f[g])return!1;return!0}return s===f},T=(s,f=!0)=>{if(v.filters&&v.filters[0]&&v.filters[1]&&v.filters[1].options){const g=v.filters[0].options,S=v.filters[1].options;s!=null?g.findIndex(L=>L.value===s)!==-1&&S[s]?(p.value=S[s],f&&!(()=>{const L=h.value[1];return L==null?!1:Array.isArray(L)?L.length>0:L!==""})()&&!c&&p.value.length>0&&(h.value[1]=p.value[0].value,t.nextTick(()=>{}))):(p.value=[],h.value[1]=null):(p.value=[],h.value[1]=null)}},x=()=>{v.initialValues&&v.initialValues.length>0?v.initialValues.length>0&&(typeof v.initialValues[0]=="number"||typeof v.initialValues[0]=="boolean"||v.initialValues[0]===null||Array.isArray(v.initialValues[0]))?h.value=[...v.initialValues]:v.isEditMode?h.value=v.filters.map((s,f)=>{var g,S,L,E,P,V,I,j,U,D;const F=v.initialValues[f];return F?s.type==="radio-button"&&F.selectedOption?F.selectedOption.value:s.type==="radio-button"&&!F.selectedOption?F.selectedValue!==void 0?F.selectedValue:((V=(P=s.options)==null?void 0:P[0])==null?void 0:V.value)||null:s.type==="select-simple"&&F.selectedValue!==void 0?Array.isArray(F.selectedValue)?F.selectedValue[0]:F.selectedValue:s.type==="select"&&F.selectedOptions?F.selectedOptions.map(z=>z.value):s.type==="check"&&F.isChecked!==void 0?F.isChecked:F.selectedValue!==void 0?F.selectedValue:s.type==="select"?[]:s.type==="check"?!1:s.type==="radio-button"?((j=(I=s.options)==null?void 0:I[0])==null?void 0:j.value)||null:s.type==="select-simple"&&((D=(U=s.options)==null?void 0:U[0])==null?void 0:D.value)||null:s.type==="select"?[]:s.type==="check"?!1:s.type==="radio-button"?((S=(g=s.options)==null?void 0:g[0])==null?void 0:S.value)||null:s.type==="select-simple"&&((E=(L=s.options)==null?void 0:L[0])==null?void 0:E.value)||null}):h.value=[...v.initialValues]:h.value=v.filters.map(s=>{var f,g,S,L;return s.type==="select"?[]:s.type==="check"?!1:s.type==="radio-button"?((g=(f=s.options)==null?void 0:f[0])==null?void 0:g.value)||null:s.type==="select-simple"&&((L=(S=s.options)==null?void 0:S[0])==null?void 0:L.value)||null}),h.value.some(s=>s!=null&&(Array.isArray(s)?s.length>0:s!==!1&&s!==""))&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))};x(),setTimeout(()=>{t.nextTick(()=>{if(h.value[0]!==null&&h.value[0]!==void 0&&!c){const s=!(()=>{const f=h.value[1];return f==null?!1:Array.isArray(f)?f.length>0:f!==""})();T(h.value[0],s)}})},300),t.watch(()=>v.initialValues,(s,f)=>{if(!s||s.length===0)return;const g=s.length>0&&(typeof s[0]=="number"||typeof s[0]=="boolean"||s[0]===null||Array.isArray(s[0])),S=!k(h.value,s),L=s&&s.length>0&&!c&&S,E=v.isEditMode&&c;L&&!E?g?h.value=[...s]:v.isEditMode?h.value=v.filters.map((P,V)=>{const I=s[V];return I?P.type==="radio-button"&&I.selectedOption?I.selectedOption.value:P.type==="select-simple"&&I.selectedValue!==void 0?Array.isArray(I.selectedValue)?I.selectedValue[0]:I.selectedValue:P.type==="select"&&I.selectedOptions?I.selectedOptions.map(j=>j.value):P.type==="check"&&I.isChecked!==void 0?I.isChecked:I.selectedValue!==void 0?I.selectedValue:h.value[V]:h.value[V]}):h.value=[...s]:c?a&&a.length>0&&(h.value=[...a]):E&&a&&a.length>0&&(h.value=[...a])},{deep:!0}),t.watch(()=>v.isEditMode,(s,f)=>{f===!0&&s===!1&&(a=null)},{immediate:!0}),t.watch(h,s=>{s.some(f=>f!=null&&(Array.isArray(f)?f.length>0:f!==!1&&f!==""))&&(()=>{if(!u)return!0;for(let f=0;f<s.length;f++)if(!k(s[f],u[f]))return!0;return!1})()&&(u=[...s],$("filters-changed",{componentId:v.componentId,filters:s,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),t.watch(()=>h.value[0],(s,f)=>{s!==f&&f!==void 0?T(s,!0):f===void 0&&s!==null&&s!==void 0&&T(s,!1)},{immediate:!0});const d=s=>{i.value===s?i.value=null:i.value=s},o=(s,f)=>{if(c=!0,setTimeout(()=>{c=!1},1e3),h.value[s]=f,(s===0||s===1)&&(a=[...h.value]),i.value=null,s===0){h.value[1]!==void 0&&(h.value[1]=null);const g=c;c=!1,T(f,!0),c=g,h.value[1]!==null&&h.value[1]!==void 0&&(a=[...h.value])}},l=()=>{c=!0,setTimeout(()=>{c=!1},400)};return r({getCurrentValues:()=>h.value,initializeValues:x}),(s,f)=>(t.openBlock(),t.createElementBlock("div",DYe,[e.filters&&e.filters.length>0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filters,(g,S)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:S},[g.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",WYe,[t.createElementVNode("div",KYe,t.toDisplayString(g.label),1),t.createElementVNode("div",BYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g.options,L=>(t.openBlock(),t.createElementBlock("label",{key:L.value,class:t.normalizeClass(["radio-option-card",{active:h.value[S]===L.value}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"strengths-radio-"+S,value:L.value,"onUpdate:modelValue":E=>h.value[S]=E,onChange:l},null,40,XYe),[[t.vModelRadio,h.value[S]]]),t.createElementVNode("span",null,t.toDisplayString(L.label),1)],2))),128))])])):g.type==="select-simple"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[f[4]||(f[4]=t.createElementVNode("div",{class:"filter-separator"},null,-1)),t.createElementVNode("div",GYe,[f[3]||(f[3]=t.createElementVNode("div",{class:"radio-label"},"Mostrar: ",-1)),t.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":g.type,onClick:t.withModifiers(L=>d(S),["stop"])},[t.createElementVNode("div",JYe,[f[1]||(f[1]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.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)),t.createElementVNode("span",HYe,t.toDisplayString(g.label||"Tipo de análisis"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:i.value===S}])},[...f[0]||(f[0]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),i.value===S?(t.openBlock(),t.createElementBlock("div",YYe,[t.createElementVNode("div",QYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g.options,L=>(t.openBlock(),t.createElementBlock("div",{key:L.value,class:t.normalizeClass(["option-card simple-select-option",{active:k(h.value[S],L.value)}]),onClick:t.withModifiers(E=>o(S,L.value),["stop"])},[t.createElementVNode("div",eQe,[t.createElementVNode("div",tQe,t.toDisplayString(L.label),1)]),k(h.value[S],L.value)?(t.openBlock(),t.createElementBlock("div",rQe,[...f[2]||(f[2]=[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[t.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):t.createCommentVNode("",!0)],10,$Ye))),128))])])):t.createCommentVNode("",!0)],8,ZYe)])],64)):t.createCommentVNode("",!0),S===1&&e.filters.length>2?(t.openBlock(),t.createElementBlock("div",nQe)):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0)]))}},iQe=t2(aQe,[["__scopeId","data-v-700ac1f0"]]),oQe=(e,r)=>{const n=e.__vccOpts||e;for(const[v,$]of r)n[v]=$;return n},sQe={key:1},lQe={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cQe=["fill"],uQe={key:0,class:"checkbox__teams"},dQe={class:"checkbox__teams__logo"},pQe=["src"],hQe={class:"checkbox__teams__logo"},fQe=["src"],mQe={__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:r}){const n=e;t.useCssVars(c=>({"7bd9d47b":e.width,"34dc7ddc":e.height}));const v=t.ref(!1),$=t.computed(()=>{const c={color:n.boxValueColor,"font-family":n.fontFamily,height:n.boxWidthAndHeight,width:n.boxWidthAndHeight,minWidth:n.boxWidthAndHeight,"border-radius":n.boxBorderRadius,"margin-top":n.boxMarginTop};return v.value?(c["background-color"]=n.boxBackgroundColor,c.border=`solid ${n.boxBorderWidth} ${n.boxBackgroundColor}`):c.border=`solid ${n.boxBorderWidth} ${n.boxBorderColor}`,c}),h=t.computed(()=>({"font-family":n.boxValueFontFamily,"font-size":n.boxValueFontSize,color:n.boxValueColor,"line-height":1})),u=t.computed(()=>{const c={color:n.labelColor,"font-family":n.fontFamily,"font-size":n.labelFontSize,"white-space":n.labelWhiteSpace,"text-align":n.boxPosition==="top"||n.boxPosition==="bottom"?"center":n.boxPosition};return(n.boxPosition==="left"||n.boxPosition==="right")&&(c[`margin-${n.boxPosition}`]=n.isBoxOnly?"0":n.teamsIds?"8px":"10px"),c});t.watch(()=>n.modelValue,c=>{c!==v.value&&(v.value=c)},{immediate:!0});function i(){n.avoidInteraction||!v.value&&n.avoidToCheck||(v.value=!v.value,r("update:modelValue",v.value))}function p(c){return`${{}.TEAM_LOGOS_URL||"https://golstatsimages.blob.core.windows.net/teams-80/"}${c}.png`}return(c,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["checkbox",`box-${e.boxPosition}`]),onClick:i},[t.createElementVNode("div",{class:"checkbox__box",style:t.normalizeStyle($.value)},[v.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[n.boxValue?(t.openBlock(),t.createElementBlock("div",{key:0,class:"checkbox__box__value",style:t.normalizeStyle(h.value)},t.toDisplayString(e.boxValue),5)):(t.openBlock(),t.createElementBlock("div",sQe,[(t.openBlock(),t.createElementBlock("svg",lQe,[t.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,cQe)]))]))],64)):t.createCommentVNode("",!0)],4),e.teamsIds&&e.teamsIds.length?(t.openBlock(),t.createElementBlock("div",uQe,[t.createElementVNode("div",dQe,[t.createElementVNode("img",{src:p(e.teamsIds[0]),alt:""},null,8,pQe)]),t.createElementVNode("div",hQe,[t.createElementVNode("img",{src:p(e.teamsIds[1]),alt:""},null,8,fQe)])])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"checkbox__label",style:t.normalizeStyle(u.value)},t.toDisplayString(e.label),5)],2))}},oA=oQe(mQe,[["__scopeId","data-v-b6f124d8"]]),yQe=(e,r)=>{const n=e.__vccOpts||e;for(const[v,$]of r)n[v]=$;return n},sA={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))}}},DZ=()=>{t.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}))},WZ=sA.setup;sA.setup=WZ?(e,r)=>(DZ(),WZ(e,r)):DZ;const gQe=e=>(t.pushScopeId("data-v-f3ee6b2b"),e=e(),t.popScopeId(),e),vQe=["src"],bQe={key:1,class:"text"},xQe=["src"],_Qe={class:"stats"},wQe=gQe(()=>t.createElementVNode("img",{class:"iconstats",src:"https://golstatsimages.blob.core.windows.net/todoelfut/playdes.png"},null,-1)),TQe={class:"numstats"},SQe={class:"leyend"};function kQe(e,r,n,v,$,h){return t.openBlock(),t.createElementBlock("div",null,[n.type==0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["button",$.status&&n.typeOnOff&&"button-active"]),style:t.normalizeStyle([h.customStyle,$.status&&n.typeOnOff&&h.customActive]),onClick:r[0]||(r[0]=(...u)=>h.btnClick&&h.btnClick(...u))},[n.icon&&n.iconPosition.toLowerCase()==="left"?(t.openBlock(),t.createElementBlock("img",{key:0,class:"icon",style:t.normalizeStyle({width:n.iconSize}),src:n.icon},null,12,vQe)):t.createCommentVNode("",!0),n.textValue?(t.openBlock(),t.createElementBlock("div",bQe,t.toDisplayString(n.textValue),1)):t.createCommentVNode("",!0),n.icon&&n.iconPosition.toLowerCase()==="right"?(t.openBlock(),t.createElementBlock("img",{key:2,class:"icon",style:t.normalizeStyle({width:n.iconSize}),src:n.icon},null,12,xQe)):t.createCommentVNode("",!0)],6)):t.createCommentVNode("",!0),n.type==1?(t.openBlock(),t.createElementBlock("div",{key:1,class:"button-target",onClick:r[1]||(r[1]=(...u)=>h.btnClick&&h.btnClick(...u))},[t.createElementVNode("div",_Qe,[wQe,t.createElementVNode("div",TQe,t.toDisplayString(n.textStat),1)]),t.createElementVNode("div",SQe,t.toDisplayString(n.textCategory),1)])):t.createCommentVNode("",!0)])}const LQe=yQe(sA,[["render",kQe],["__scopeId","data-v-f3ee6b2b"]]),NQe={class:"gsc-dropdown__main-container__item-selected"},OQe=["height","width"],MQe=["stroke"],EQe={key:1,width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},CQe=["fill"],zQe={class:"gsc-dropdown__items-container"},VQe=["onClick"],PQe={key:0,class:"gsc-dropdown__items-footer"},$k={__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(r=>r 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:r}){const n=e,v=t.ref({}),$=t.ref(null),h=t.ref(n.isMultipleOption?-1:0),u=t.ref(!1);t.watch(()=>n.items,(x,d)=>{if(!n.modelValue&&(!n.onlyFirstTime||!d||!d.length)&&x&&x.length){if(n.defaultItemByProp){const o=n.items.findIndex(l=>l[n.defaultItemByProp.propName]===n.defaultItemByProp.value);o!==-1?(h.value=o,v.value=x[o]):(h.value=0,v.value=x[0])}else v.value=x[n.defaultItemByIndex];r("input",v.value)}},{immediate:!0}),t.watch(()=>n.modelValue,x=>{if(x){const d=n.items.findIndex(o=>typeof x=="object"?JSON.stringify(o)===JSON.stringify(x):o===x);d!==-1&&(h.value=d,v.value=n.items[d],r("update:modelValue",v.value))}},{immediate:!0});const i=t.computed(()=>({height:n.height,width:n.width,backgroundColor:n.backgroundColor,borderRadius:`${n.borderRadius}px`,border:`${n.borderType} ${n.borderWidth}px ${n.borderColor}`,color:n.color,"--hover-background-color":n.hoverBackgroundColor,"--list-container-padding":n.listContainerPadding,"--list-item-padding":n.listItemPadding,"--list-item-margin":n.listItemMargin,"--list-background-color":n.listBackgroundColor,"--list-height":n.listHeight,"--list-item-border-radius":n.listItemBorderRadius,"--list-item-selected-color":n.listItemSelectedColor,"--list-item-selected-background-color":n.listItemSelectedBackgroundColor,"--list-item-color":n.listItemColor,"--list-border-radius":`${n.listBorderRadius}`,"--list-border-color":n.listBorderColor,"--list-width":n.isListSameWidth?n.width:"fit-content","--list-border-width":`${n.listBorderWidth}px`,"--list-margin-top":n.listMarginTop,"--list-left":n.listAlignment==="left"?"0":"auto","--list-right":n.listAlignment==="right"?"0":"auto","--footer-border":`${n.footerBorderWidth}px solid ${n.footerBorderColor}`,"--dropdown-opacity":n.isDisabled?"0.5":"1","--dropdown-cursor":n.isDisabled?"not-allowed":"pointer","--dropdown-font-size":n.fontSize?n.fontSize:"14px"})),p=t.computed(()=>({height:`${n.arrowHeight}px`,width:`${n.arrowWidth}px`}));function c(){n.isDisabled||(u.value=!u.value)}function a(x){$.value&&!$.value.contains(x.target)&&(u.value=!1)}function k(x,d){n.isMultipleOption?h.value=-1:(h.value=d,u.value=!1),v.value=x,r("input",v.value),r("update:modelValue",v.value)}function T(){u.value=!1,r("click-ready")}return t.onMounted(()=>{document.addEventListener("click",a)}),t.onBeforeMount(()=>{document.removeEventListener("click",a)}),(x,d)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"dropDown",ref:$,class:"gsc-dropdown",style:t.normalizeStyle(i.value)},[t.createElementVNode("div",{class:"gsc-dropdown__main-container",style:t.normalizeStyle({"padding-right":`${e.arrowWidth+8}px`}),onClick:c},[t.createElementVNode("div",NQe,[t.renderSlot(x.$slots,"default",{selectedItem:v.value})]),t.createElementVNode("div",{class:t.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":u.value}]),style:t.normalizeStyle(p.value)},[e.iconType===1?(t.openBlock(),t.createElementBlock("svg",{key:0,height:e.arrowHeight,width:e.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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,MQe)],8,OQe)):(t.openBlock(),t.createElementBlock("svg",EQe,[t.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,CQe)]))],6)],4),t.createVNode(t.Transition,null,{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",zQe,[t.createElementVNode("div",null,[t.createElementVNode("div",{class:"gsc-dropdown__items",style:t.normalizeStyle({"margin-top":`${n.borderWidth}px`})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.items,(o,l)=>(t.openBlock(),t.createElementBlock("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["gsc-dropdown__items__item",{selected:l===h.value}]),key:l,onClick:s=>k(o,l)},[t.renderSlot(x.$slots,"availableItem",{item:o})],10,VQe)),[[t.vShow,!o.isHidden]])]))),256))],4),e.isFooterVisible?(t.openBlock(),t.createElementBlock("div",PQe,[t.createVNode(t.unref(LQe),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:T})])):t.createCommentVNode("",!0)])],512),[[t.vShow,u.value]])]),_:3})],4))}},lA={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},AQe=[{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"}}],RQe=[{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}}],UQe={class:"last-touch"},FQe={class:"selected-item"},IQe={class:"available-item"},qQe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},jQe={class:"selected-item"},DQe={class:"available-item"},WQe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},KQe={key:1},BQe={class:"selected-item"},XQe={class:"available-item"},GQe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ZQe={class:"last-touch__how-many-games"},JQe={class:"selected-item"},HQe={class:"available-item"},YQe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},QQe={__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:r}){const n=e,v=r,$=t.ref([{label:"Ofensivo",value:2,name:"offensive"},{label:"Defensivo",value:3,name:"defensive"}]),h=t.ref({id:0,name:"Fases de juego",value:null}),u=t.ref(!1),i=t.ref([{id:1,name:"Último partido",value:1},{id:3,name:"Últimos 3 partidos",value:3},{id:0,name:"Todos mis partidos",value:0}]),p=t.ref(n.defaultFilters?null:i.value[0]),c=t.ref(null),a=t.computed(()=>({...lA})),k=t.computed(()=>({...lA,isFooterVisible:!n.isEditMode,isMultipleOption:!n.isEditMode})),T=t.computed(()=>{const ge=[];return x.value.options.forEach(be=>{be.forEach(xe=>{ge.push(xe)})}),ge}),x=t.ref(null),d=t.ref(null),o=t.ref(null),l=t.ref(null);t.watch(()=>n.viewConfig,ge=>{ge.filters&&(x.value||s(),d.value||f(),o.value||g(),l.value||P())},{immediate:!0});function s(){if(n.viewConfig&&n.viewConfig.filters){const ge=n.viewConfig.filters.find(be=>be.key==="categories");ge&&ge.options&&(x.value={label:ge.label,options:Object.entries(ge.options).reduce((be,[xe,Pe])=>(be.set(Number(xe),Pe),be),new Map)})}x.value={label:"Tipo de jugada",options:new Map([[2,RQe],[3,AQe]])}}function f(){if(n.viewConfig&&n.viewConfig.filters){const ge=n.viewConfig.filters.find(be=>be.key==="gamePhases");if(ge){d.value={label:ge.label,options:ge.options};return}}d.value={label:"Fases de juego",options:$.value}}function g(){if(n.viewConfig&&n.viewConfig.filters){const ge=n.viewConfig.filters.find(be=>be.key==="teamRadios");if(ge){o.value={options:ge.options},F(null,ge.options[0]);return}}o.value={label:"Equipo",options:n.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]},F(null,o.value.options[0])}const S=t.ref(n.defaultFilters?null:o.value.options[0]),L=t.ref(n.defaultFilters?null:d.value.options[0]),E=t.ref(n.defaultFilters?null:x.value.options.get(L.value.value)[0]);function P(){if(n.viewConfig&&n.viewConfig.filters){const ge=n.viewConfig.filters.find(be=>be.key==="assistZoneCheckbox");if(ge){l.value={label:ge.label},z(ge.value);return}}l.value={label:"Zona de asistencia"}}const V=t.computed(()=>{const ge={selectedGamePhase:L.value,selectedTeam:S.value,isAssistZoneVisible:u.value,howManyGamesSelected:p.value};return n.isEditMode?(ge.selectedCategory=E.value,ge.totalCategoriesSelected=1):(ge.selectedCategories=c.value,ge.totalCategoriesSelected=0,x.value.options.forEach(be=>{be.forEach(xe=>{xe.isSelected&&(ge.totalCategoriesSelected+=1)})})),ge}),I=t.computed(()=>L.value?x.value.options.get(L.value.value)||[]:[]);t.watch(()=>V.value,ge=>{j()&&v("change",{areAllFiltersFilled:j(),filters:ge,view:n.viewConfig})},{deep:!0});function j(){return L.value&&(n.isEditMode&&E.value||!n.isEditMode&&c.value&&c.value.length)&&S.value&&p.value}function U(ge){L.value=ge,M(null)}function D(ge){S.value=ge}function F(ge,be){console.log("onChangeRadio:",be.value)}function z(ge){u.value=ge}function X(ge){p.value=ge}function M(ge){E.value=ge}function Y(ge,be){be.isSelected=ge,c.value=T.value.filter(xe=>xe.isSelected)}function se(){n.defaultFilters&&(u.value=n.defaultFilters.isAssistZoneVisible,p.value=i.value.find(ge=>ge.value===n.defaultFilters.howManyGamesSelected.value)||i.value[0],L.value=d.value.options.find(ge=>ge.value===n.defaultFilters.selectedGamePhase.value)||d.value.options[0],S.value=o.value.options.find(ge=>ge.value===(n.defaultFilters.isHomeTeam?1:2))||o.value.options[0],E.value=x.value.options.get(L.value.value).find(ge=>ge.value.name===n.defaultFilters.selectedCategory.name)||x.value.options.get(L.value.value)[0])}function me(){I.value.forEach(ge=>{ge.isSelected=!1}),u.value=!1,p.value=i.value[0],L.value=null,S.value=null,E.value=null,c.value=null}return t.onBeforeUnmount(()=>{me()}),t.onMounted(()=>{setTimeout(()=>{se()},500)}),(ge,be)=>(t.openBlock(),t.createElementBlock("div",UQe,[t.createVNode(t.unref($k),t.mergeProps(a.value,{items:d.value.options,"model-value":L.value,"onUpdate:modelValue":U}),{default:t.withCtx(()=>[t.createElementVNode("div",FQe,[be[0]||(be[0]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.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"}),t.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)),t.createElementVNode("div",null,t.toDisplayString(L.value?L.value.label:d.value.label||h.value.name),1)])]),availableItem:t.withCtx(({item:xe})=>[t.createElementVNode("div",IQe,[t.createElementVNode("div",null,t.toDisplayString(xe.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",qQe,[...be[1]||(be[1]=[t.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)),[[t.vShow,L.value&&L.value.label===xe.label]])])])]),_:1},16,["items","model-value"]),t.createVNode(t.unref($k),t.mergeProps(k.value,{items:I.value,"model-value":E.value,"onUpdate:modelValue":M}),{default:t.withCtx(()=>[t.createElementVNode("div",jQe,[be[2]||(be[2]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.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"}),t.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)),t.createElementVNode("div",null,t.toDisplayString(x.value.label),1)])]),availableItem:t.withCtx(({item:xe})=>[t.createElementVNode("div",DQe,[e.isEditMode?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",null,t.toDisplayString(xe.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",WQe,[...be[3]||(be[3]=[t.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)),[[t.vShow,E.value&&E.value.label===xe.label]])])],64)):(t.openBlock(),t.createElementBlock("div",KQe,[t.createVNode(t.unref(oA),{"model-value":xe.isSelected,label:xe.label,"onUpdate:modelValue":Pe=>Y(Pe,xe)},null,8,["model-value","label","onUpdate:modelValue"])]))])]),_:1},16,["items","model-value"]),t.createVNode(t.unref($k),t.mergeProps(a.value,{items:o.value.options,"model-value":S.value,"onUpdate:modelValue":D}),{default:t.withCtx(()=>[t.createElementVNode("div",BQe,[be[4]||(be[4]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.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"}),t.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)),t.createElementVNode("div",null,t.toDisplayString(S.value?S.value.label:o.value.label),1)])]),availableItem:t.withCtx(({item:xe})=>[t.createElementVNode("div",XQe,[t.createElementVNode("div",null,t.toDisplayString(xe.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",GQe,[...be[5]||(be[5]=[t.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)),[[t.vShow,S.value&&S.value.label===xe.label]])])])]),_:1},16,["items","model-value"]),t.createVNode(t.unref(oA),{"model-value":u.value,label:l.value.label,"onUpdate:modelValue":z},null,8,["model-value","label"]),t.withDirectives(t.createElementVNode("div",ZQe,[t.createVNode(t.unref($k),t.mergeProps(a.value,{items:i.value,"model-value":p.value,"onUpdate:modelValue":X}),{default:t.withCtx(()=>[t.createElementVNode("div",JQe,[be[6]||(be[6]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.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"}),t.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)),t.createElementVNode("div",null,t.toDisplayString(p.value?p.value.name:"Seleccione"),1)])]),availableItem:t.withCtx(({item:xe})=>[t.createElementVNode("div",HQe,[t.createElementVNode("div",null,t.toDisplayString(xe.name),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",YQe,[...be[7]||(be[7]=[t.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)),[[t.vShow,p.value&&p.value.name===xe.name]])])])]),_:1},16,["items","model-value"])],512),[[t.vShow,!e.isPostMatch]])]))}},$Qe=t2(QQe,[["__scopeId","data-v-7e67f3f8"]]),e$e=(e,r)=>{const n=e.__vccOpts||e;for(const[v,$]of r)n[v]=$;return n},t$e={__name:"GSC-Menu",props:{menuMarginTop:{type:Number,default:0,validator(e){return!Number.isNaN(e)}},modelValue:{type:Boolean,default:!1},width:{type:String,default:"fit-content"},menuWidth:{type:String,default:"fit-content"},zIndexOpen:{type:Number,default:3},leftMenu:{type:String,default:"unset"}},emits:["update:modelValue"],setup(e,{emit:r}){const n=e;t.useCssVars(x=>({"6263632b":e.width,"252e289a":p.value,d3c8b2e8:e.menuWidth}));const v=t.ref(null),$=t.ref(!1),h=t.ref(null),u=t.ref({}),i=t.ref({top:"0px",left:n.leftMenu,width:n.menuWidth}),p=t.computed(()=>$.value?n.zIndexOpen:1);t.watch(()=>n.modelValue,x=>{x!==$.value&&($.value=x)},{immediate:!0}),t.watch($,async x=>{var d;if(x){await t.nextTick();const o=(d=h.value)==null?void 0:d.getBoundingClientRect();o&&setTimeout(()=>{c({boundingClientRect:o})},1e3)}else setTimeout(()=>{u.value["--translate-x"]="0px"},500)});function c(x){const d=window.innerWidth,o=x.boundingClientRect.x,l=x.boundingClientRect.x+x.boundingClientRect.width,s=o<=0?Math.abs(o)+10:l>=d?d-(l+30):0;if(u.value["--translate-x"]=`${s}px`,v.value){const f=v.value.getBoundingClientRect();i.value.top=`${f.height+n.menuMarginTop}px`}}function a(){new IntersectionObserver(x=>{x[0].intersectionRatio>0&&c(x[0])}).observe(h.value)}function k(){$.value=!$.value,r("update:modelValue",$.value)}function T(){$.value=!1,r("update:modelValue",$.value)}return t.onMounted(()=>{t.nextTick(()=>{a()})}),(x,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[$.value?(t.openBlock(),t.createElementBlock("div",{key:0,id:"menu-overlay",onClick:T})):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"menu-container",style:t.normalizeStyle(u.value)},[t.createElementVNode("div",{ref_key:"trigger",ref:v,class:"menu-container__trigger",onClick:k},[t.renderSlot(x.$slots,"trigger",{},void 0,!0)],512),t.createVNode(t.Transition,null,{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{ref_key:"menu",ref:h,class:"menu-container__menu",style:t.normalizeStyle(i.value)},[t.renderSlot(x.$slots,"menu",{},void 0,!0)],4),[[t.vShow,$.value]])]),_:3})],4)],64))}},r$e=e$e(t$e,[["__scopeId","data-v-419c8567"]]),Kb={CORNERS_ADVANCED:"cornersAdvanced"},n$e={key:0,class:"button__icon"},a$e={key:0,width:"19",height:"17",viewBox:"0 0 19 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i$e=["stroke"],o$e=["stroke"],s$e=["stroke"],l$e={key:1,width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c$e=["stroke"],u$e=["stroke"],d$e=["fill"],p$e={key:2,width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h$e=["fill"],f$e={key:3,width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m$e=["stroke"],y$e=["stroke"],g$e=["stroke"],v$e=["stroke"],b$e=["stroke"],x$e={key:4,width:"18",height:"17",viewBox:"0 0 18 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_$e={key:5,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},w$e={key:6,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T$e={key:7,width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},S$e={key:8,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},k$e={class:"button__text"},L$e={key:0,class:"info-container"},N$e={key:1,style:{width:"20px"}},O$e={width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},M$e=["fill"],E$e={__name:"ButtonFilter",props:{isActive:{type:Boolean,default:!1},showBadge:{type:Boolean,default:!0},showBadgeOnFilterFull:{type:Boolean,default:!0},text:{type:String,default:""},infoValue:{type:[String,Number],default:""},filtersTotal:{type:Number,default:0},textFontFamily:{type:String,default:"sans-serif"},textFontSize:{type:String,default:"14px"},fontColor:{type:String,default:"white"},infoBackgroundColor:{type:String,default:"#424D58"},infoFontColor:{type:String,default:"#CBEE6B"},infoFontFamily:{type:String,default:"sans-serif"},infoFontSize:{type:String,default:"10px"},infoBorderColor:{type:String,default:"#0D1D29"},infoBorderRadius:{type:String,default:"4px"},infoHeight:{type:String,default:"20px"},infoWidth:{type:String,default:"20px"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},backgroundColor:{type:String,default:"#0D1D29"},borderRadius:{type:String,default:"8px"},borderColor:{type:String,default:"#172531"},borderColorActive:{type:String,default:"white"},borderWidth:{type:String,default:"1px"},padding:{type:String,default:"12px"},arrowColor:{type:String,default:"#92929D"},iconColor:{type:String,default:"#92929D"},iconType:{type:String,default:"productivity"},showIcon:{type:Boolean,default:!0}},setup(e){const r=e,n=t.computed(()=>({"--height":r.height,"--width":r.width,"--text-font-family":r.textFontFamily,"--text-font-size":r.textFontSize,"--background-color":r.backgroundColor,"--border-radius":r.borderRadius,"--border-color":r.isActive?r.borderColorActive:r.borderColor,"--border-width":r.borderWidth,"--padding":r.padding,"--font-color":r.fontColor})),v=t.computed(()=>({"--info-background-color":r.infoValue?r.infoBackgroundColor:"transparent","--info-border-color":r.infoValue?r.infoBorderColor:"transparent","--info-border-radius":r.infoBorderRadius,"--info-font-family":r.infoFontFamily,"--info-font-size":r.infoFontSize,"--info-font-color":r.infoFontColor,"--info-height":r.infoHeight,"--info-width":r.infoWidth})),$=t.computed(()=>[Kb.PLAYS_TYPES,Kb.GOLSTATS,Kb.TOURNAMENTS,Kb.PLAYS,Kb.RESULTS,Kb.RESULTS_BY_TIME].includes(r.iconType)),h=t.computed(()=>[Kb.FIELD,Kb.GAMES].includes(r.iconType)),u=t.computed(()=>[Kb.DETAILS,Kb.UNIVERSE].includes(r.iconType)),i=t.computed(()=>[Kb.PERSONAL_DATA].includes(r.iconType)),p=t.computed(()=>[Kb.PRODUCTIVITY].includes(r.iconType)),c=t.computed(()=>(console.log("props.iconType",r.iconType),[Kb.CORNERS_ADVANCED].includes(r.iconType))),a=t.computed(()=>[Kb.HOW_WAS_CORNER].includes(r.iconType)),k=t.computed(()=>[Kb.TAKEN_CORNERS].includes(r.iconType)),T=t.computed(()=>[Kb.ZONE].includes(r.iconType)),x=t.computed(()=>[Kb.WHAT_HAPPENED].includes(r.iconType));return(d,o)=>(t.openBlock(),t.createElementBlock("div",{class:"button",style:t.normalizeStyle(n.value)},[e.showIcon?(t.openBlock(),t.createElementBlock("div",n$e,[i.value?(t.openBlock(),t.createElementBlock("svg",a$e,[t.createElementVNode("path",{d:"M12.6665 16.0001V14.3334C12.6665 13.4494 12.3153 12.6015 11.6902 11.9764C11.0651 11.3513 10.2173 11.0001 9.33323 11.0001H4.33329C3.44925 11.0001 2.60141 11.3513 1.9763 11.9764C1.35119 12.6015 1 13.4494 1 14.3334V16.0001",stroke:e.iconColor,"stroke-opacity":"1","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,i$e),t.createElementVNode("path",{d:"M6.83329 7.66658C8.67422 7.66658 10.1666 6.17422 10.1666 4.33329C10.1666 2.49237 8.67422 1 6.83329 1C4.99237 1 3.5 2.49237 3.5 4.33329C3.5 6.17422 4.99237 7.66658 6.83329 7.66658Z",stroke:e.iconColor,"stroke-opacity":"1","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,o$e),t.createElementVNode("path",{d:"M15.164 5.16663V10.1666M17.664 7.66659H12.6641",stroke:e.iconColor,"stroke-opacity":"1","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,s$e)])):t.createCommentVNode("",!0),$.value||c.value?(t.openBlock(),t.createElementBlock("svg",l$e,[t.createElementVNode("path",{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:e.iconColor,"stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,c$e),t.createElementVNode("path",{d:"M15.9996 16.8727L14.8359 15.7091",stroke:e.iconColor,"stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,u$e),t.createElementVNode("path",{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:e.iconColor,stroke:"#353F47","stroke-width":"0.3"},null,8,d$e)])):t.createCommentVNode("",!0),u.value?(t.openBlock(),t.createElementBlock("svg",p$e,[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.5 0C13.1944 0 17 3.80558 17 8.5C17 13.1944 13.1944 17 8.5 17C3.80558 17 0 13.1944 0 8.5C0 3.80558 3.80558 0 8.5 0ZM8.49751 1.54553C4.65662 1.54553 1.54297 4.65919 1.54297 8.50008C1.54297 12.341 4.65662 15.4546 8.49751 15.4546C12.3384 15.4546 15.4521 12.341 15.4521 8.50008C15.4521 4.65919 12.3384 1.54553 8.49751 1.54553ZM8.49929 3.09082C8.92605 3.09082 9.27202 3.43678 9.27202 3.86355V8.12198L12.451 10.5945C12.7878 10.8565 12.8485 11.342 12.5865 11.6789C12.3245 12.0157 11.839 12.0764 11.5022 11.8144L8.02488 9.10986C7.83666 8.96347 7.72656 8.73837 7.72656 8.49991V3.86355C7.72656 3.43678 8.07252 3.09082 8.49929 3.09082Z",fill:e.iconColor},null,8,h$e)])):t.createCommentVNode("",!0),h.value?(t.openBlock(),t.createElementBlock("svg",f$e,[t.createElementVNode("rect",{x:"1.16772",y:"1.16699",width:"19",height:"15.6667",stroke:e.iconColor},null,8,m$e),t.createElementVNode("rect",{x:"16.1677",y:"6.16699",width:"4",height:"5.66667",stroke:e.iconColor},null,8,y$e),t.createElementVNode("rect",{x:"1.16772",y:"6.16699",width:"4",height:"5.66667",stroke:e.iconColor},null,8,g$e),t.createElementVNode("path",{d:"M10.6677 0.666992V16.5003",stroke:e.iconColor},null,8,v$e),t.createElementVNode("path",{d:"M13.5033 9.00032C13.5033 10.5651 12.2348 11.8337 10.67 11.8337C9.1052 11.8337 7.83667 10.5651 7.83667 9.00032C7.83667 7.43552 9.1052 6.16699 10.67 6.16699C12.2348 6.16699 13.5033 7.43552 13.5033 9.00032Z",stroke:e.iconColor},null,8,b$e)])):t.createCommentVNode("",!0),p.value?(t.openBlock(),t.createElementBlock("svg",x$e,[...o[0]||(o[0]=[t.createElementVNode("path",{d:"M1.85113 13.0897C1.9303 13.2137 2.01739 13.3404 2.10447 13.4617C2.30239 13.7361 2.51878 14 2.74837 14.2507C3.74589 15.3298 5.01785 16.1504 6.41385 16.5963C6.4719 16.6148 6.52996 16.6332 6.58802 16.6491C6.60385 16.6544 6.61704 16.657 6.63024 16.6623C6.70413 16.6834 6.77538 16.7045 6.84927 16.723C7.54859 16.9077 8.27429 17 9.00264 17C9.73098 17 10.4593 16.9077 11.1586 16.7256C11.3064 16.686 11.4542 16.6438 11.5967 16.5989C11.9187 16.496 12.2353 16.372 12.5414 16.2322C12.7895 16.1187 13.0296 15.9921 13.2645 15.8549C14.2963 15.2533 15.2041 14.438 15.9034 13.467C15.9668 13.3799 16.0301 13.2876 16.0908 13.1926C16.1119 13.1609 16.133 13.1293 16.1541 13.095C16.9432 11.8681 17.405 10.4486 17.4868 8.98945C17.4947 8.84169 17.5 8.69393 17.5 8.54618C17.5 8.53034 17.5 8.51715 17.5 8.50132C17.5 6.90765 17.0646 5.37995 16.2386 4.04222C16.1198 3.85224 15.9932 3.66491 15.8612 3.48021C15.8586 3.47493 15.8559 3.4723 15.8533 3.46702C15.8084 3.40633 15.7636 3.34565 15.7161 3.2876C15.6712 3.22955 15.6237 3.1715 15.5789 3.1161C14.6526 1.98417 13.4466 1.10818 12.0928 0.580475C11.9556 0.525066 11.8105 0.474934 11.668 0.42744C10.8103 0.145118 9.91307 0 9.00264 0C8.09221 0 7.19497 0.14248 6.33732 0.424802C6.19482 0.472295 6.04967 0.525066 5.91245 0.577836C4.55604 1.10554 3.35005 1.98417 2.42378 3.11346C2.37364 3.17678 2.32086 3.24011 2.27072 3.30607C2.2285 3.35884 2.18892 3.41161 2.14933 3.46702C2.14933 3.46702 2.14933 3.46966 2.14669 3.4723C2.14669 3.47493 2.14405 3.47757 2.14142 3.48021C1.43418 4.44591 0.94598 5.53034 0.69792 6.68074C0.660975 6.85224 0.626669 7.02639 0.600279 7.20053C0.571251 7.39578 0.547501 7.59103 0.531667 7.78892C0.521111 7.91293 0.513195 8.03694 0.507917 8.16095C0.502639 8.27441 0.5 8.38786 0.5 8.50132V8.61214C0.502639 8.73615 0.507917 8.8628 0.513195 8.98945C0.595002 10.4486 1.05681 11.8681 1.84586 13.0923L1.85113 13.0897ZM1.82738 7.64908C1.82738 7.63325 1.83002 7.62005 1.83266 7.60422C1.84322 7.52771 1.85377 7.45119 1.86433 7.37731C1.86433 7.36412 1.86697 7.35092 1.86961 7.33773C1.8828 7.25594 1.89863 7.1715 1.91447 7.08971C1.91711 7.07124 1.92238 7.05541 1.92502 7.03694C1.94086 6.95778 1.95933 6.87599 1.9778 6.79683V6.78628C1.99891 6.70449 2.02266 6.62269 2.04378 6.5409C2.04905 6.52243 2.05433 6.5066 2.05961 6.48813C2.08336 6.40897 2.10711 6.32718 2.1335 6.24802L2.14142 6.22164C2.16517 6.14776 2.19156 6.07652 2.21794 6.00264C2.22322 5.98681 2.23114 5.97098 2.23642 5.95515C2.26545 5.87863 2.29711 5.79947 2.32878 5.72559C2.33406 5.70976 2.34197 5.69657 2.34725 5.68338C2.37628 5.61478 2.40795 5.54617 2.43962 5.47757C2.44489 5.46702 2.45017 5.45383 2.45545 5.44063C2.48975 5.36676 2.5267 5.29024 2.56628 5.21636C2.5742 5.20053 2.58212 5.1847 2.59267 5.16887C2.63226 5.09499 2.6692 5.02375 2.71143 4.94987V4.94195H2.7167L3.2656 6.63061L1.82738 7.67546C1.82738 7.67546 1.82738 7.65699 1.83002 7.64908H1.82738ZM4.08367 7.6095L5.62745 8.31926L6.52204 11.0712L5.62481 12.1108H2.74309C2.23642 11.2348 1.92238 10.2612 1.81683 9.25594L4.08367 7.6095ZM7.58026 1.41161C7.65942 1.39578 7.74123 1.37995 7.8204 1.36675C7.84151 1.36412 7.86262 1.35884 7.88109 1.3562C7.96026 1.34301 8.03679 1.33245 8.11596 1.32454C8.13971 1.3219 8.16346 1.31926 8.18721 1.31662C8.24791 1.30871 8.30596 1.30343 8.36666 1.29815C8.39305 1.29815 8.42207 1.29288 8.44846 1.29024C8.52235 1.28496 8.59361 1.27968 8.6675 1.27705C8.69916 1.27705 8.73347 1.27441 8.76514 1.27177C8.82319 1.27177 8.88125 1.26913 8.94194 1.26913C8.98153 1.26913 9.01847 1.26913 9.05806 1.26913C9.11611 1.26913 9.17681 1.26913 9.23487 1.27177C9.26653 1.27177 9.30084 1.27177 9.33251 1.27705C9.4064 1.27968 9.48029 1.28496 9.55154 1.29024C9.58057 1.29024 9.60696 1.29551 9.63334 1.29815C9.69404 1.30343 9.75473 1.30871 9.81279 1.31662C9.83654 1.31926 9.86029 1.3219 9.88668 1.32454C9.96585 1.33509 10.045 1.34565 10.1215 1.3562L10.1849 1.36675C10.264 1.37995 10.3459 1.39314 10.425 1.41161C10.4277 1.41161 10.4303 1.41161 10.4356 1.41161H10.4382L9 2.45646L7.56178 1.41161H7.56442C7.56442 1.41161 7.5697 1.41161 7.57234 1.41161H7.58026ZM9.00528 6.56728L11.1138 8.10026L10.3089 10.5805H7.70165L6.89677 8.10026L9.00528 6.56728ZM15.3018 4.94459V4.94987C15.3466 5.02111 15.3862 5.09499 15.4232 5.16887L15.4469 5.21636C15.4839 5.29024 15.5208 5.36676 15.5577 5.44063C15.563 5.45119 15.5683 5.46438 15.5736 5.47493C15.6052 5.54354 15.6369 5.61214 15.6659 5.68338C15.6712 5.69657 15.6791 5.7124 15.6844 5.72559C15.7161 5.80211 15.7478 5.87863 15.7768 5.95778C15.7821 5.97361 15.79 5.98945 15.7953 6.00528C15.8216 6.07916 15.848 6.1504 15.8718 6.22428C15.8744 6.23219 15.8771 6.24011 15.8797 6.25066C15.9061 6.32982 15.9298 6.40897 15.9536 6.49077C15.9589 6.50923 15.9641 6.52771 15.9694 6.54618C15.9905 6.62797 16.0143 6.70976 16.0328 6.78892C16.0328 6.7942 16.0328 6.79683 16.0328 6.80211C16.0512 6.88127 16.0697 6.96042 16.0855 7.03958L16.0961 7.09235C16.1119 7.17414 16.1278 7.25594 16.141 7.33773C16.141 7.35092 16.1462 7.36412 16.1462 7.37731C16.1568 7.45119 16.1673 7.52771 16.1779 7.60422C16.1779 7.62005 16.1805 7.63325 16.1832 7.64908C16.1832 7.65699 16.1832 7.66755 16.1858 7.67546L14.7476 6.63061L15.2965 4.93931L15.3018 4.94459ZM13.9295 7.61214L16.1937 9.25858C16.0882 10.2639 15.7715 11.2401 15.2675 12.1135H12.3858L11.4912 11.0739L12.3858 8.3219L13.9295 7.61214ZM14.3306 13.3879C14.3306 13.3879 14.3254 13.3931 14.3227 13.3958C14.2673 13.4565 14.2093 13.5172 14.1512 13.5752C14.138 13.5884 14.1248 13.6016 14.1116 13.6148C14.0536 13.6728 13.9929 13.7309 13.9322 13.7889C13.9216 13.7995 13.9111 13.81 13.8979 13.8206C13.8424 13.8707 13.7844 13.9235 13.729 13.971C13.7184 13.9789 13.7079 13.9894 13.6973 14C13.634 14.0554 13.5706 14.1055 13.5047 14.1583C13.4888 14.1715 13.473 14.1821 13.4598 14.1953C13.3938 14.2454 13.3278 14.2955 13.2619 14.3456C13.2619 14.3456 13.2566 14.3483 13.2566 14.3509C13.188 14.4011 13.1194 14.4486 13.0481 14.496C13.0323 14.5066 13.0165 14.5172 12.998 14.5277C12.9294 14.5726 12.8581 14.6174 12.7895 14.6623C12.7763 14.6702 12.7658 14.6781 12.7526 14.6834C12.6892 14.723 12.6233 14.7599 12.5573 14.7968C12.5441 14.8048 12.5283 14.8127 12.5151 14.8206C12.4438 14.8602 12.3699 14.8997 12.296 14.9367C12.2802 14.9446 12.2617 14.9525 12.2459 14.9631C12.1746 15 12.1007 15.0343 12.0295 15.0686C12.0242 15.0686 12.0189 15.0739 12.0137 15.0765H12.0084L12.5573 13.3879H14.3306ZM6.00217 15.0765L5.98898 15.0712C5.91509 15.0369 5.8412 15 5.76731 14.9631C5.75147 14.9551 5.73564 14.9472 5.71981 14.9393C5.64592 14.9024 5.57203 14.8628 5.49814 14.8206C5.48494 14.8127 5.47175 14.8048 5.45855 14.7995C5.39258 14.7625 5.32661 14.723 5.26063 14.6834C5.25008 14.6781 5.23688 14.6702 5.22633 14.6623C5.15508 14.6201 5.08646 14.5726 5.01521 14.5277C4.99938 14.5172 4.98355 14.5066 4.96771 14.496C4.89646 14.4486 4.82785 14.4011 4.75924 14.3509H4.75396C4.68799 14.2982 4.61937 14.248 4.5534 14.1953C4.53757 14.1821 4.52437 14.1715 4.50854 14.1583C4.44256 14.1055 4.37923 14.0554 4.3159 14C4.30534 13.9894 4.29478 13.9815 4.28159 13.971C4.22353 13.9208 4.16812 13.8707 4.1127 13.8206C4.10214 13.81 4.08895 13.7995 4.07839 13.7889C4.0177 13.7335 3.957 13.6755 3.89894 13.6148C3.88575 13.6016 3.87256 13.5884 3.85936 13.5752C3.8013 13.5172 3.74589 13.4591 3.69047 13.3984C3.68783 13.3958 3.68519 13.3931 3.67991 13.3879H5.45328L6.00217 15.0765C6.00217 15.0765 5.99954 15.0765 5.9969 15.0765H6.00217ZM7.50636 15.5726L6.63552 12.8971L7.53012 11.8602H10.4804L11.375 12.8971L10.5042 15.5726C9.52251 15.7784 8.48805 15.781 7.50373 15.5726H7.50636ZM14.3755 3.66755L13.4809 6.41953L11.9371 7.12929L9.6439 5.46174V3.57784L11.9503 1.90237C12.8713 2.31135 13.6999 2.91557 14.3781 3.66755H14.3755ZM6.06287 1.90237L8.3693 3.57784V5.46174L6.07606 7.12929L4.53229 6.41953L3.63769 3.66755C4.3159 2.91557 5.14452 2.31398 6.06551 1.90237H6.06287Z",fill:"#979DA2"},null,-1)])])):t.createCommentVNode("",!0),k.value?(t.openBlock(),t.createElementBlock("svg",_$e,[...o[1]||(o[1]=[t.createElementVNode("path",{d:"M17.182 5.9a.538.538 0 0 0-.13-.416L14.24 2.109a.558.558 0 0 0-.433-.203h-2.25c-.017 0-.034.012-.056.012a.557.557 0 0 0-.563.41 1.68 1.68 0 0 1-1.63 1.266 1.68 1.68 0 0 1-1.632-1.266.55.55 0 0 0-.563-.41c-.017 0-.033-.012-.056-.012h-2.25a.558.558 0 0 0-.433.203L1.561 5.484a.586.586 0 0 0-.129.416c.017.152.09.287.208.382l2.605 2.082v8.167c0 .31.253.563.562.563h9c.31 0 .563-.253.563-.563V8.364l2.604-2.082a.59.59 0 0 0 .208-.382zm-3.937 4.444H5.37V9.78h7.875v.563zM5.37 15.969v-4.5h7.875v4.5H5.37zm9-9.045v-.518a.564.564 0 0 0-.563-.562.564.564 0 0 0-.562.562v2.25H5.37v-2.25a.564.564 0 0 0-.563-.562.564.564 0 0 0-.562.562v.518L2.793 5.765l2.278-2.734h1.66A2.802 2.802 0 0 0 9.307 4.72a2.803 2.803 0 0 0 2.576-1.688h1.66l2.278 2.734-1.451 1.159z",fill:"#98A2B3"},null,-1)])])):t.createCommentVNode("",!0),a.value?(t.openBlock(),t.createElementBlock("svg",w$e,[...o[2]||(o[2]=[t.createElementVNode("path",{d:"M15.426 3.353a2.384 2.384 0 0 0-2.381 2.381 2.384 2.384 0 0 0 2.381 2.382 2.384 2.384 0 0 0 2.381-2.382 2.384 2.384 0 0 0-2.381-2.38zm0 3.766a1.386 1.386 0 0 1-1.385-1.385c0-.763.622-1.384 1.385-1.384s1.385.621 1.385 1.384c0 .764-.622 1.385-1.385 1.385zM1.424 6.558a.497.497 0 0 0 .704 0l1.295-1.296L4.72 6.558a.497.497 0 0 0 .704 0 .498.498 0 0 0 0-.705L4.128 4.558l1.295-1.295a.498.498 0 0 0-.705-.705L3.423 3.853 2.128 2.558a.499.499 0 0 0-.704.705l1.295 1.295-1.295 1.295a.498.498 0 0 0 0 .705zM13.013 12.443a.498.498 0 0 0-.705 0l-1.295 1.295-1.295-1.295a.499.499 0 0 0-.704.704l1.295 1.295-1.295 1.295a.499.499 0 0 0 .704.705l1.295-1.295 1.295 1.295a.497.497 0 0 0 .705 0 .498.498 0 0 0 0-.705l-1.295-1.295 1.295-1.295a.498.498 0 0 0 0-.704zM12.052 5.455l-2.01-1.747a.498.498 0 0 0-.654.753l1.066.926c-3.145.411-5.008 2.055-6.043 3.444a9.569 9.569 0 0 0-1.501 3.012 2.384 2.384 0 0 0-2.103 2.364 2.384 2.384 0 0 0 2.381 2.381 2.384 2.384 0 0 0 2.381-2.381 2.385 2.385 0 0 0-1.647-2.265 8.674 8.674 0 0 1 1.312-2.547C6.53 7.674 8.33 6.66 10.594 6.372l-.992 1.142a.498.498 0 0 0 .752.654l1.747-2.01a.498.498 0 0 0-.05-.703zm-7.48 8.752c0 .763-.62 1.384-1.384 1.384a1.386 1.386 0 0 1-1.384-1.384c0-.764.62-1.385 1.384-1.385.763 0 1.385.622 1.385 1.385z",fill:"#98A2B3",stroke:"#98A2B3","stroke-width":".3"},null,-1)])])):t.createCommentVNode("",!0),T.value?(t.openBlock(),t.createElementBlock("svg",T$e,[...o[3]||(o[3]=[t.createElementVNode("rect",{x:".707",y:".9",width:"5.2",height:"5.2",rx:".8",stroke:"#98A2B3","stroke-width":"1.2"},null,-1),t.createElementVNode("rect",{x:"8.707",y:".9",width:"5.2",height:"5.2",rx:".8",fill:"#98A2B3",stroke:"#98A2B3","stroke-width":"1.2"},null,-1),t.createElementVNode("rect",{x:".707",y:"8.9",width:"5.2",height:"5.2",rx:".8",fill:"#98A2B3",stroke:"#98A2B3","stroke-width":"1.2"},null,-1),t.createElementVNode("rect",{x:"8.707",y:"8.9",width:"5.2",height:"5.2",rx:".8",stroke:"#98A2B3","stroke-width":"1.2"},null,-1)])])):t.createCommentVNode("",!0),x.value?(t.openBlock(),t.createElementBlock("svg",S$e,[...o[4]||(o[4]=[t.createStaticVNode('<g clip-path="url(#gpdeo9cu3a)" fill="#98A2B3" data-v-2df3c6a9><path d="M9.307.5C4.505.5.598 4.407.598 9.209c0 2 .69 3.938 1.946 5.486l-.754 3.159a.524.524 0 0 0 .727.599l3.038-1.384a8.743 8.743 0 0 0 3.752.848c4.802 0 8.709-3.907 8.709-8.708C18.016 4.407 14.109.5 9.307.5zm0 16.368a7.574 7.574 0 0 1-3.502-.845.525.525 0 0 0-.457-.011l-2.289 1.042.566-2.372a.524.524 0 0 0-.113-.465A7.657 7.657 0 0 1 1.647 9.21c0-4.224 3.436-7.66 7.66-7.66s7.66 3.436 7.66 7.66c0 4.223-3.436 7.66-7.66 7.66z" data-v-2df3c6a9></path><path d="M9.68 5.199c-1.094-.115-2.459.397-3.041 1.797a.524.524 0 0 0 .968.403c.375-.902 1.255-1.231 1.964-1.157.721.075 1.232.542 1.365 1.25.13.693-.136 1.097-1.097 1.662-1.042.613-1.372.874-1.372 2.27a.524.524 0 0 0 1.049 0c0-.479.033-.715.118-.843.094-.14.33-.283.737-.523.666-.392 1.905-1.12 1.596-2.76-.221-1.171-1.098-1.975-2.288-2.1zM9.145 12.673a.608.608 0 0 0-.506.17c-.13.13-.19.31-.17.505a.525.525 0 0 0 .939.263.523.523 0 0 0-.263-.938z" data-v-2df3c6a9></path></g><defs data-v-2df3c6a9><clipPath id="gpdeo9cu3a" data-v-2df3c6a9><path fill="#fff" transform="translate(.307 .5)" d="M0 0h18v18H0z" data-v-2df3c6a9></path></clipPath></defs>',2)])])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.createElementVNode("div",k$e,t.toDisplayString(e.text),1),e.showBadge?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.showBadgeOnFilterFull?(t.openBlock(),t.createElementBlock("div",L$e,[t.createElementVNode("div",{class:"button__info",style:t.normalizeStyle(v.value)},[t.withDirectives(t.createElementVNode("span",null,t.toDisplayString(e.infoValue),513),[[t.vShow,e.infoValue]])],4)])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.filtersTotal>0&&e.filtersTotal!=parseInt(e.infoValue)?(t.openBlock(),t.createElementBlock("div",{key:0,class:"button__info",style:t.normalizeStyle(v.value)},[t.withDirectives(t.createElementVNode("span",null,t.toDisplayString(e.infoValue),513),[[t.vShow,e.infoValue]])],4)):e.filtersTotal>0?(t.openBlock(),t.createElementBlock("div",N$e)):t.createCommentVNode("",!0)],64))],64)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["button__arrow",{"rotated-180":e.isActive}])},[(t.openBlock(),t.createElementBlock("svg",O$e,[t.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,M$e)]))],2)],4))}},C$e=t2(E$e,[["__scopeId","data-v-2df3c6a9"]]),z$e={__name:"SwitchCustom",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:r}){const n=e,v=r,$=t.ref(null);t.watch(()=>n.modelValue,()=>{h()},{immediate:!0});function h(){$.value&&($.value.checked=n.modelValue)}function u(i){v("update:modelValue",i.target.checked)}return t.onMounted(()=>{h()}),(i,p)=>(t.openBlock(),t.createElementBlock("input",{ref_key:"switchCustom",ref:$,id:"toggle",class:"toggle",type:"checkbox",role:"switch",name:"toggle",onInput:u},null,544))}},cA=t2(z$e,[["__scopeId","data-v-e3a6ae4e"]]),V$e={class:"corners"},P$e={class:"corners-type"},A$e={class:"selected-item"},R$e={class:"available-item"},U$e={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},F$e={class:"advanced-filters-menu"},I$e={class:"toggle-group"},q$e={class:"toggle-group"},j$e={key:0,class:"time-control"},D$e={class:"stepper-container"},W$e={class:"stepper"},K$e={class:"stepper-value"},B$e={class:"time-control"},X$e={class:"stepper-container"},G$e={class:"stepper"},Z$e={class:"stepper-value"},J$e={class:"time-control"},H$e={class:"stepper-container"},Y$e={class:"stepper"},Q$e={class:"stepper-value"},$$e={class:"corners__how-many-games"},eet={class:"selected-item"},tet={class:"available-item"},ret={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},net={__name:"FilterCorners",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:r}){var n;const v=Array.from({length:10}).map((P,V)=>({id:V+1,name:`${V+1} ${V===0?"corner":"corners"}`,value:V+1})),$=e,h=r,u=t.ref([...v]),i=t.ref(u.value[0]),p=t.ref(l()),c=t.ref({backgroundColor:"#2e3b46",width:"96.2%",borderColor:"rgba(255, 255, 255, 0.20)",infoBorderColor:"rgba(255, 255, 255, 0.20)",height:"40px",padding:"0 4px",textFontFamily:"'Poppins-Regular'",showIcon:!1}),a=t.ref({label:"Equipo",options:$.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]}),k=t.ref(!1),T=t.ref($.defaultFilters?$.defaultFilters.isAgainstMode:!1),x=t.ref($.defaultFilters?null:(n=a.value)==null?void 0:n.options[0]),d=t.computed(()=>({...lA}));t.watch(()=>$.viewConfig,P=>{P.filters&&(a.value||s())},{immediate:!0});const o=t.computed(()=>({isAgainstMode:T.value,selectedTeam:x.value,howManyCorners:i.value?i.value.value:null,advancedFilters:{...p.value}}));t.watch(()=>o.value,P=>{h("change",{filters:{...P,advancedFilters:{...P.advancedFilters,areConnectionsVisible:!P.advancedFilters.areConnectionsVisible,arePathsVisible:!P.advancedFilters.arePathsVisible}},view:$.viewConfig})},{deep:!0,immediate:!0});function l(){return{areConnectionsVisible:!0,arePathsVisible:!0,secondsBefore:-1,secondsAfter:0,secondsBeforeAndAfter:0}}function s(){if($.viewConfig&&$.viewConfig.filters){const P=$.viewConfig.filters.find(V=>V.key==="teamRadios");if(P){a.value={options:P.options};return}}a.value={label:"Equipo",options:$.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]}}function f(){$.defaultFilters&&(x.value=a.value.options.find(P=>P.value===($.defaultFilters.isHomeTeam?1:2))||a.value.options[0],p.value={...$.defaultFilters.advancedFilters,areConnectionsVisible:!$.defaultFilters.advancedFilters.areConnectionsVisible,arePathsVisible:!$.defaultFilters.advancedFilters.arePathsVisible})}function g(P){x.value=P}function S(P){i.value=P}function L(P,V){const I=p.value[V]+P;if(!(I<-5||I>10)){if(["secondsBefore","secondsAfter"].includes(V)){if(V==="secondsBefore"){if(p.value.secondsAfter<I)return}else if(p.value.secondsBefore>I)return}p.value[V]=I}}function E(){k.value=!1}return t.onBeforeUnmount(()=>{}),t.onMounted(()=>{setTimeout(()=>{f()},500)}),(P,V)=>(t.openBlock(),t.createElementBlock("div",V$e,[t.withDirectives(t.createElementVNode("div",P$e,[t.createElementVNode("div",{class:t.normalizeClass(["label",{"switch-selected":!T.value}])}," A favor ",2),t.createVNode(cA,{modelValue:T.value,"onUpdate:modelValue":V[0]||(V[0]=I=>T.value=I)},null,8,["modelValue"]),t.createElementVNode("div",{class:t.normalizeClass(["label",{"switch-selected":T.value}])}," En contra ",2)],512),[[t.vShow,!e.isPostMatch]]),t.createVNode(t.unref($k),t.mergeProps(d.value,{items:a.value.options,"model-value":x.value,"onUpdate:modelValue":g}),{default:t.withCtx(()=>[t.createElementVNode("div",A$e,[V[10]||(V[10]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.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"}),t.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)),t.createElementVNode("div",null,t.toDisplayString(x.value?x.value.label:a.value.label),1)])]),availableItem:t.withCtx(({item:I})=>[t.createElementVNode("div",R$e,[t.createElementVNode("div",null,t.toDisplayString(I.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",U$e,[...V[11]||(V[11]=[t.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)),[[t.vShow,x.value&&x.value.label===I.label]])])])]),_:1},16,["items","model-value"]),t.createVNode(t.unref(r$e),{modelValue:k.value,"onUpdate:modelValue":V[9]||(V[9]=I=>k.value=I),width:"250px","left-menu":"0","menu-margin-top":18},{trigger:t.withCtx(()=>[t.createVNode(C$e,t.mergeProps(c.value,{text:"Filtros avanzados","show-badge-on-filter-full":!1,"filters-total":0,"is-active":k.value,"show-icon":!0,"icon-type":t.unref(Kb).CORNERS_ADVANCED}),null,16,["is-active","icon-type"])]),menu:t.withCtx(()=>[t.createElementVNode("div",F$e,[V[22]||(V[22]=t.createElementVNode("h2",{class:"menu-title"},"Mostrar Conexiones",-1)),t.createElementVNode("div",I$e,[V[12]||(V[12]=t.createElementVNode("label",{class:"toggle-label"},"Sí",-1)),t.createVNode(cA,{modelValue:p.value.areConnectionsVisible,"onUpdate:modelValue":V[1]||(V[1]=I=>p.value.areConnectionsVisible=I)},null,8,["modelValue"]),V[13]||(V[13]=t.createElementVNode("label",{class:"toggle-label"},"No",-1))]),V[23]||(V[23]=t.createElementVNode("hr",{class:"separator"},null,-1)),V[24]||(V[24]=t.createElementVNode("h2",{class:"menu-title"},"Mostrar recorridos",-1)),t.createElementVNode("div",q$e,[V[14]||(V[14]=t.createElementVNode("label",{class:"toggle-label"},"Sí",-1)),t.createVNode(cA,{modelValue:p.value.arePathsVisible,"onUpdate:modelValue":V[2]||(V[2]=I=>p.value.arePathsVisible=I)},null,8,["modelValue"]),V[15]||(V[15]=t.createElementVNode("label",{class:"toggle-label"},"No",-1))]),p.value.arePathsVisible?(t.openBlock(),t.createElementBlock("div",j$e,[V[17]||(V[17]=t.createElementVNode("label",{class:"time-label"},[t.createTextVNode(" Segundos "),t.createElementVNode("span",{class:"highlight"},"antes"),t.createTextVNode(" / "),t.createElementVNode("span",{class:"highlight"},"después"),t.createTextVNode(" del cobro: ")],-1)),t.createElementVNode("div",D$e,[t.createElementVNode("div",W$e,[t.createElementVNode("button",{class:"stepper-btn",onClick:V[3]||(V[3]=I=>L(-1,"secondsBeforeAndAfter"))},"−"),t.createElementVNode("span",K$e,t.toDisplayString(p.value.secondsBeforeAndAfter),1),t.createElementVNode("button",{class:"stepper-btn",onClick:V[4]||(V[4]=I=>L(1,"secondsBeforeAndAfter"))},"+")]),V[16]||(V[16]=t.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("div",B$e,[V[19]||(V[19]=t.createElementVNode("label",{class:"time-label"},[t.createTextVNode(" Segundos "),t.createElementVNode("span",{class:"highlight"},"antes"),t.createTextVNode(" del cobro: ")],-1)),t.createElementVNode("div",X$e,[t.createElementVNode("div",G$e,[t.createElementVNode("button",{class:"stepper-btn",onClick:V[5]||(V[5]=I=>L(-1,"secondsBefore"))},"−"),t.createElementVNode("span",Z$e,t.toDisplayString(p.value.secondsBefore),1),t.createElementVNode("button",{class:"stepper-btn",onClick:V[6]||(V[6]=I=>L(1,"secondsBefore"))},"+")]),V[18]||(V[18]=t.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])]),t.createElementVNode("div",J$e,[V[21]||(V[21]=t.createElementVNode("label",{class:"time-label"},[t.createTextVNode(" Segundos "),t.createElementVNode("span",{class:"highlight"},"después"),t.createTextVNode(" del cobro: ")],-1)),t.createElementVNode("div",H$e,[t.createElementVNode("div",Y$e,[t.createElementVNode("button",{class:"stepper-btn",onClick:V[7]||(V[7]=I=>L(-1,"secondsAfter"))},"−"),t.createElementVNode("span",Q$e,t.toDisplayString(p.value.secondsAfter),1),t.createElementVNode("button",{class:"stepper-btn",onClick:V[8]||(V[8]=I=>L(1,"secondsAfter"))},"+")]),V[20]||(V[20]=t.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])])],64)),V[25]||(V[25]=t.createElementVNode("hr",{class:"separator"},null,-1)),t.createElementVNode("button",{class:"btn-ready",onClick:E},"Listo")])]),_:1},8,["modelValue"]),t.withDirectives(t.createElementVNode("div",$$e,[t.createVNode(t.unref($k),t.mergeProps(d.value,{items:u.value,"model-value":i.value,"onUpdate:modelValue":S}),{default:t.withCtx(()=>[t.createElementVNode("div",eet,[V[26]||(V[26]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.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"}),t.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)),t.createElementVNode("div",null,t.toDisplayString(i.value?i.value.name:"Seleccione"),1)])]),availableItem:t.withCtx(({item:I})=>[t.createElementVNode("div",tet,[t.createElementVNode("div",null,t.toDisplayString(I.name),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",ret,[...V[27]||(V[27]=[t.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)),[[t.vShow,i.value&&i.value.name===I.name]])])])]),_:1},16,["items","model-value"])],512),[[t.vShow,!e.defaultFilters]])]))}},aet=t2(net,[["__scopeId","data-v-75e86cac"]]),iet={class:"resultados-filter"},oet={class:"filter-checkboxes"},set=["checked","disabled","onChange"],cet={class:"checkbox-label"},uet={class:"filter-actions"},det={__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","done"],setup(e,{emit:r}){const n=e,v=r,$=[{value:"iba-ganando",label:"Iba ganando"},{value:"iba-perdiendo",label:"Iba perdiendo"},{value:"iba-empatado",label:"Iba empatado"}],h=t.ref([]);t.watch(()=>n.selectedValues,k=>{var T;if(console.log("[ResultadosFilter] Watcher - selectedValues recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:k,filterValue:k==null?void 0:k[n.filterIndex],optionValue:(T=k==null?void 0:k[n.filterIndex])==null?void 0:T[n.optionIndex],isArray:Array.isArray(k),filterValueType:typeof(k==null?void 0:k[n.filterIndex])}),!k||!Array.isArray(k)){h.value.length===0&&(console.log("[ResultadosFilter] No hay valores en props, usando valores por defecto"),h.value=["iba-ganando","iba-perdiendo","iba-empatado"]);return}const x=k[n.filterIndex];if(x&&typeof x=="object"&&!Array.isArray(x))if(x[n.optionIndex]!==void 0){const d=Array.isArray(x[n.optionIndex])?x[n.optionIndex]:[];console.log("[ResultadosFilter] Valores encontrados para sincronizar:",d,"localSelectedValues actual:",h.value);const o=JSON.stringify(h.value.sort()),l=JSON.stringify(d.sort());o!==l?(console.log("[ResultadosFilter] Actualizando localSelectedValues con:",d),h.value=d.length>0?[...d]:[]):console.log("[ResultadosFilter] Los valores ya están sincronizados, no se actualiza");return}else console.log("[ResultadosFilter] filterValue existe pero no tiene optionIndex",n.optionIndex,"filterValue keys:",Object.keys(x));else console.log("[ResultadosFilter] filterValue no es un objeto válido:",x);h.value.length===0&&(console.log("[ResultadosFilter] No se encontraron valores guardados, usando valores por defecto"),h.value=["iba-ganando","iba-perdiendo","iba-empatado"])},{immediate:!0,deep:!0}),t.onMounted(()=>{var k,T,x;console.log("[ResultadosFilter] onMounted - Valores recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:n.selectedValues,filterValue:(k=n.selectedValues)==null?void 0:k[n.filterIndex],optionValue:(x=(T=n.selectedValues)==null?void 0:T[n.filterIndex])==null?void 0:x[n.optionIndex]}),t.nextTick(()=>{if(n.selectedValues&&Array.isArray(n.selectedValues)){const d=n.selectedValues[n.filterIndex];if(d&&typeof d=="object"&&!Array.isArray(d)&&d[n.optionIndex]!==void 0){const o=Array.isArray(d[n.optionIndex])?d[n.optionIndex]:[];if(console.log("[ResultadosFilter] onMounted - Valores encontrados:",o),o.length>0){console.log("[ResultadosFilter] onMounted - Actualizando localSelectedValues con:",o),h.value=[...o];return}}}h.value.length===0&&(console.log("[ResultadosFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),h.value=["iba-ganando","iba-perdiendo","iba-empatado"])})});const u=k=>h.value.includes(k),i=k=>h.value.length===1&&h.value.includes(k),p=(k,T)=>{let x=[...h.value];if(T)x.includes(k)||x.push(k);else{if(x.length===1)return;x=x.filter(d=>d!==k)}x.length===0&&(x=[$[0].value]),h.value=x,v("update-selection",{optionIndex:n.optionIndex,values:x})},c=()=>{const k=$.map(T=>T.value);h.value=[...k],v("update-selection",{optionIndex:n.optionIndex,values:[...k]})},a=()=>{v("done")};return(k,T)=>(t.openBlock(),t.createElementBlock("div",iet,[t.createElementVNode("div",oet,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList($,x=>t.createElementVNode("label",{key:x.value,class:"checkbox-item"},[t.createElementVNode("input",{type:"checkbox",checked:u(x.value),disabled:i(x.value),onChange:t.withModifiers(d=>p(x.value,d.target.checked),["stop"])},null,40,set),t.createElementVNode("span",cet,t.toDisplayString(x.label),1)])),64))]),t.createElementVNode("div",uet,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(c,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(a,["stop"])}," Listo ")])]))}},SM=t2(det,[["__scopeId","data-v-6b648e3f"]]),pet={class:"detalles-filter"},het={class:"filter-header"},fet={class:"checkbox-todos"},met=["checked"],yet={class:"time-section"},get={class:"time-buttons"},vet=["onClick"],bet={class:"time-section"},xet={class:"time-buttons"},_et=["onClick"],wet={class:"filter-actions"},Tet={__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","done"],setup(e,{emit:r}){const n=e,v=r,$=[{value:"0-15",label:"0-15"},{value:"16-30",label:"16-30"},{value:"31-45",label:"31-45"}],h=[{value:"46-60",label:"46-60"},{value:"61-75",label:"61-75"},{value:"76-90",label:"76-90"}],u=[...$,...h].map(d=>d.value),i=t.ref([]);t.watch(()=>n.selectedValues,d=>{var o;if(console.log("[DetallesFilter] Watcher - selectedValues recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:d,filterValue:d==null?void 0:d[n.filterIndex],optionValue:(o=d==null?void 0:d[n.filterIndex])==null?void 0:o[n.optionIndex]}),!d||!Array.isArray(d))return;const l=d[n.filterIndex];if(l&&typeof l=="object"&&!Array.isArray(l)&&l[n.optionIndex]!==void 0){const s=Array.isArray(l[n.optionIndex])?l[n.optionIndex]:[];if(console.log("[DetallesFilter] Valores encontrados para sincronizar:",s),s.length>0){const f=JSON.stringify(i.value.sort()),g=JSON.stringify(s.sort());f!==g&&(console.log("[DetallesFilter] Actualizando localSelectedValues con:",s),i.value=[...s])}}},{immediate:!0,deep:!0});const p=t.computed(()=>[...$,...h].map(d=>d.value).every(d=>i.value.includes(d)));t.onMounted(()=>{var d,o,l;console.log("[DetallesFilter] onMounted - Valores recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:n.selectedValues,filterValue:(d=n.selectedValues)==null?void 0:d[n.filterIndex],optionValue:(l=(o=n.selectedValues)==null?void 0:o[n.filterIndex])==null?void 0:l[n.optionIndex]}),t.nextTick(()=>{if(n.selectedValues&&Array.isArray(n.selectedValues)){const s=n.selectedValues[n.filterIndex];if(s&&typeof s=="object"&&!Array.isArray(s)&&s[n.optionIndex]!==void 0){const f=Array.isArray(s[n.optionIndex])?s[n.optionIndex]:[];if(console.log("[DetallesFilter] onMounted - Valores encontrados:",f),f.length>0){console.log("[DetallesFilter] onMounted - Actualizando localSelectedValues con:",f),i.value=[...f];return}}}i.value.length===0&&(console.log("[DetallesFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),i.value=[...u])})});const c=d=>i.value.includes(d),a=d=>{const o=d.target.checked;let l=[];o?l=[...$,...h].map(s=>s.value):l=[u[0]],i.value=l,v("update-selection",{optionIndex:n.optionIndex,values:l})},k=d=>{let o=[...i.value];if(o.includes(d))if(o.length>1)o=o.filter(l=>l!==d);else return;else o.includes(d)||o.push(d);o.length===0&&(o=[u[0]]),i.value=o,v("update-selection",{optionIndex:n.optionIndex,values:o})},T=()=>{const d=[u[0]];i.value=d,v("update-selection",{optionIndex:n.optionIndex,values:d})},x=()=>{v("done")};return(d,o)=>(t.openBlock(),t.createElementBlock("div",pet,[t.createElementVNode("div",het,[o[1]||(o[1]=t.createElementVNode("span",{class:"filter-title"},"En: (Elige el lapso de tiempo)",-1)),t.createElementVNode("label",fet,[t.createElementVNode("input",{type:"checkbox",checked:p.value,onChange:t.withModifiers(a,["stop"])},null,40,met),o[0]||(o[0]=t.createElementVNode("span",{class:"checkbox-label"},"Todos",-1))])]),t.createElementVNode("div",yet,[o[2]||(o[2]=t.createElementVNode("div",{class:"time-label"},"1er tiempo",-1)),t.createElementVNode("div",get,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList($,l=>t.createElementVNode("button",{key:l.value,class:t.normalizeClass(["time-button",{active:c(l.value)}]),onClick:t.withModifiers(s=>k(l.value),["stop"])},t.toDisplayString(l.label),11,vet)),64))])]),t.createElementVNode("div",bet,[o[3]||(o[3]=t.createElementVNode("div",{class:"time-label"},"2do tiempo",-1)),t.createElementVNode("div",xet,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(h,l=>t.createElementVNode("button",{key:l.value,class:t.normalizeClass(["time-button",{active:c(l.value)}]),onClick:t.withModifiers(s=>k(l.value),["stop"])},t.toDisplayString(l.label),11,_et)),64))])]),t.createElementVNode("div",wet,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(T,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(x,["stop"])}," Listo ")])]))}},uA=t2(Tet,[["__scopeId","data-v-7bea3520"]]),ket={class:"como-fue-cobrado-filter"},Let={class:"cobro-grid"},Net=["onClick"],Oet={class:"cobro-image-container"},Met=["src","alt"],Eet={class:"cobro-footer"},Cet={class:"cobro-label"},zet={class:"filter-actions"},Vet={__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","done"],setup(e,{emit:r}){const n=e,v=r,$=[{value:"comba-afuera",label:"Comba hacia afuera",image:"https://golstatsimages.blob.core.windows.net/content/comba-afuera-izquierda.png",count:10},{value:"comba-adentro",label:"Comba hacia adentro",image:"https://golstatsimages.blob.core.windows.net/content/comba-adentro-izquierda.png",count:2},{value:"raz-area",label:"Raz de área",image:"https://golstatsimages.blob.core.windows.net/content/raz-area-izquierda.png",count:0},{value:"en-corto",label:"En corto",image:"https://golstatsimages.blob.core.windows.net/content/en-corto-izquierda.png",count:1}],h=t.ref([]);t.watch(()=>n.selectedValues,a=>{var k;if(console.log("[ComoFueCobradoFilter] Watcher - selectedValues recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:a,filterValue:a==null?void 0:a[n.filterIndex],optionValue:(k=a==null?void 0:a[n.filterIndex])==null?void 0:k[n.optionIndex]}),!a||!Array.isArray(a)){h.value.length===0&&(h.value=[...$.map(x=>x.value)]);return}const T=a[n.filterIndex];if(T&&typeof T=="object"&&!Array.isArray(T)&&T[n.optionIndex]!==void 0){const x=Array.isArray(T[n.optionIndex])?T[n.optionIndex]:[];console.log("[ComoFueCobradoFilter] Valores encontrados para sincronizar:",x);const d=JSON.stringify(h.value.sort()),o=JSON.stringify(x.sort());d!==o&&(h.value=x.length>0?[...x]:[]);return}h.value.length===0&&(h.value=[...$.map(x=>x.value)])},{immediate:!0,deep:!0});const u=a=>h.value.includes(a),i=a=>{let k=[...h.value];k.includes(a)?k=k.filter(T=>T!==a):k.push(a),k.length===0&&(k=[...$.map(T=>T.value)]),h.value=k,v("update-selection",{optionIndex:n.optionIndex,values:k})};t.onMounted(()=>{var a,k,T;console.log("[ComoFueCobradoFilter] onMounted - Valores recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:n.selectedValues,filterValue:(a=n.selectedValues)==null?void 0:a[n.filterIndex],optionValue:(T=(k=n.selectedValues)==null?void 0:k[n.filterIndex])==null?void 0:T[n.optionIndex]}),t.nextTick(()=>{if(n.selectedValues&&Array.isArray(n.selectedValues)){const x=n.selectedValues[n.filterIndex];if(x&&typeof x=="object"&&!Array.isArray(x)&&x[n.optionIndex]!==void 0){const d=Array.isArray(x[n.optionIndex])?x[n.optionIndex]:[];if(console.log("[ComoFueCobradoFilter] onMounted - Valores encontrados:",d),d.length>0){console.log("[ComoFueCobradoFilter] onMounted - Actualizando localSelectedValues con:",d),h.value=[...d];return}}}h.value.length===0&&(console.log("[ComoFueCobradoFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),h.value=["izquierda",...$.map(x=>x.value)])})});const p=()=>{const a=[...$.map(k=>k.value)];h.value=a,v("update-selection",{optionIndex:n.optionIndex,values:a})},c=()=>{v("done")};return(a,k)=>(t.openBlock(),t.createElementBlock("div",ket,[t.createElementVNode("div",Let,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList($,T=>t.createElementVNode("div",{key:T.value,class:t.normalizeClass(["cobro-item",{active:u(T.value)}]),onClick:t.withModifiers(x=>i(T.value),["stop"])},[t.createElementVNode("div",Oet,[t.createElementVNode("img",{src:T.image,alt:T.label,class:"cobro-image"},null,8,Met)]),t.createElementVNode("div",Eet,[t.createElementVNode("span",Cet,t.toDisplayString(T.label),1)])],10,Net)),64))]),t.createElementVNode("div",zet,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(p,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(c,["stop"])}," Listo ")])]))}},kM=t2(Vet,[["__scopeId","data-v-fb6f9ab9"]]),Pet={class:"zona-filter"},Aet={class:"template-zone"},Ret={class:"controls-zone-container"},Uet={class:"controls-zone-container-title-checkcon"},Fet={class:"controls-zone-container-title-checkcon-check"},Iet={class:"gsc-field-img-container"},qet=["fill"],jet=["fill"],Det=["fill"],Wet=["fill"],Ket=["fill"],Bet=["fill"],Xet=["fill"],Get=["fill"],Zet=["fill"],Jet=["fill"],Het=["fill"],Yet=["fill"],Qet=["fill"],$et=["fill"],ett=["fill"],ttt=["fill"],rtt=["fill"],ntt=["fill"],att=["fill"],itt=["fill"],ott=["fill"],stt=["fill"],ltt=["fill"],ctt=["fill"],utt=["fill"],dtt=["fill"],ptt=["fill"],htt=["fill"],ftt=["fill"],mtt=["fill"],ytt=["fill"],gtt=["fill"],vtt=["fill"],btt=["fill"],xtt=["fill"],_tt=["id"],wtt=["mask"],Ttt={class:"filter-actions"},Stt={__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","done"],setup(e,{emit:r}){const n=e,v=r,$=Array.from({length:35},(x,d)=>d+1),h=t.ref(!0),u=t.ref([]),i=t.computed(()=>u.value),p=t.computed(()=>new Date().getTime());t.watch(()=>n.selectedValues,x=>{var d;if(console.log("[ZonaFilter] Watcher - selectedValues recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:x,filterValue:x==null?void 0:x[n.filterIndex],optionValue:(d=x==null?void 0:x[n.filterIndex])==null?void 0:d[n.optionIndex]}),!x||!Array.isArray(x)){u.value.length===0&&(console.log("[ZonaFilter] No hay valores en props, usando valores por defecto"),u.value=[...$],h.value=!0);return}const o=x[n.filterIndex];if(o&&typeof o=="object"&&!Array.isArray(o)){if(o[n.optionIndex]!==void 0){const l=Array.isArray(o[n.optionIndex])?o[n.optionIndex]:[];console.log("[ZonaFilter] Valores encontrados para sincronizar:",l);const s=JSON.stringify(u.value.sort((g,S)=>g-S)),f=JSON.stringify(l.sort((g,S)=>g-S));s!==f&&(console.log("[ZonaFilter] Actualizando zonesLocal con:",l),u.value=l.length>0?[...l]:[],h.value=l.length===35);return}}else if(Array.isArray(o)&&o.length>0){console.log("[ZonaFilter] filterValue es array directo:",o);const l=JSON.stringify(u.value.sort((f,g)=>f-g)),s=JSON.stringify(o.sort((f,g)=>f-g));l!==s&&(console.log("[ZonaFilter] Actualizando zonesLocal con array directo:",o),u.value=[...o],h.value=o.length===35);return}u.value.length===0&&(console.log("[ZonaFilter] No se encontraron valores guardados, usando valores por defecto"),u.value=[...$],h.value=!0)},{immediate:!0,deep:!0}),t.watch(u,x=>{h.value=x.length===35,v("update-selection",{optionIndex:n.optionIndex,values:x})},{deep:!0});function c(x){console.log("value clickAllCheckbox: ",x),x?(u.value=[...$],h.value=!0):(u.value=[1],h.value=!1)}function a(x){u.value.includes(x)?u.value=u.value.filter(d=>d!==x):u.value.push(x),h.value=u.value.length===35}const k=()=>{u.value=[...$],h.value=!0},T=()=>{v("done")};return t.onMounted(()=>{var x,d,o;if(console.log("[ZonaFilter] onMounted - Valores recibidos:",{filterIndex:n.filterIndex,optionIndex:n.optionIndex,selectedValues:n.selectedValues,filterValue:(x=n.selectedValues)==null?void 0:x[n.filterIndex],optionValue:(o=(d=n.selectedValues)==null?void 0:d[n.filterIndex])==null?void 0:o[n.optionIndex]}),n.selectedValues&&Array.isArray(n.selectedValues)){const l=n.selectedValues[n.filterIndex];if(l&&typeof l=="object"&&!Array.isArray(l)&&l[n.optionIndex]!==void 0){const s=Array.isArray(l[n.optionIndex])?l[n.optionIndex]:[];if(console.log("[ZonaFilter] onMounted - Valores encontrados:",s),s.length>0){console.log("[ZonaFilter] onMounted - Actualizando zonesLocal con:",s),u.value=[...s],h.value=s.length===35;return}}}u.value.length===0&&(console.log("[ZonaFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),u.value=[...$],h.value=!0)}),(x,d)=>(t.openBlock(),t.createElementBlock("div",Pet,[t.createElementVNode("div",Aet,[t.createElementVNode("div",Ret,[d[36]||(d[36]=t.createElementVNode("div",{class:"controls-zone-container-title"}," ¿A dónde fue el balón?: ",-1)),d[37]||(d[37]=t.createElementVNode("div",{class:"separator-line"},null,-1)),t.createElementVNode("div",Uet,[d[35]||(d[35]=t.createElementVNode("div",{class:"controls-zone-container-title-checkcon-label"}," Todas las zonas ",-1)),t.createElementVNode("div",Fet,[t.createVNode(t.unref(oA),{label:"",fontFamily:"Poppins-Regular",labelFontSize:"11px","label-color":"#FFF","model-value":h.value,"onUpdate:modelValue":c},null,8,["model-value"])])])]),t.createElementVNode("div",Iet,[(t.openBlock(),t.createElementBlock("svg",{key:`field-${u.value.length}`,width:"100%",height:"177",viewBox:"0 0 380 177",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{onClick:d[0]||(d[0]=o=>a(1)),class:"sector-field",x:"0.347042",y:"0.347042",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:i.value.includes(1)?"#FFFF0030":"#2e3b46"},null,8,qet),t.createElementVNode("rect",{onClick:d[1]||(d[1]=o=>a(9)),class:"sector-field",x:"288.347",y:"0.347042",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(9)?"#FFFF0030":"#2e3b46"},null,8,jet),t.createElementVNode("rect",{onClick:d[2]||(d[2]=o=>a(17)),class:"sector-field",x:"0.347042",y:"44.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(17)?"#FFFF0030":"#2e3b46"},null,8,Det),t.createElementVNode("rect",{onClick:d[3]||(d[3]=o=>a(25)),class:"sector-field",x:"288.347",y:"44.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(25)?"#FFFF0030":"#2e3b46"},null,8,Wet),t.createElementVNode("rect",{onClick:d[4]||(d[4]=o=>a(26)),class:"sector-field",x:"0.347042",y:"88.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(26)?"#FFFF0030":"#2e3b46"},null,8,Ket),t.createElementVNode("rect",{onClick:d[5]||(d[5]=o=>a(27)),class:"sector-field",x:"91.347",y:"88.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(27)?"#FFFF0030":"#2e3b46"},null,8,Bet),t.createElementVNode("rect",{onClick:d[6]||(d[6]=o=>a(28)),class:"sector-field",x:"157.015",y:"88.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(28)?"#FFFF0030":"#2e3b46"},null,8,Xet),t.createElementVNode("rect",{onClick:d[7]||(d[7]=o=>a(29)),class:"sector-field",x:"222.679",y:"88.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(29)?"#FFFF0030":"#2e3b46"},null,8,Get),t.createElementVNode("rect",{onClick:d[8]||(d[8]=o=>a(30)),class:"sector-field",x:"288.347",y:"88.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(30)?"#FFFF0030":"#2e3b46"},null,8,Zet),t.createElementVNode("rect",{onClick:d[9]||(d[9]=o=>a(31)),class:"sector-field",x:"0.347042",y:"132.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(31)?"#FFFF0030":"#2e3b46"},null,8,Jet),t.createElementVNode("rect",{onClick:d[10]||(d[10]=o=>a(32)),class:"sector-field",x:"91.347",y:"132.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(32)?"#FFFF0030":"#2e3b46"},null,8,Het),t.createElementVNode("rect",{onClick:d[11]||(d[11]=o=>a(33)),class:"sector-field",x:"157.015",y:"132.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(33)?"#FFFF0030":"#2e3b46"},null,8,Yet),t.createElementVNode("rect",{onClick:d[12]||(d[12]=o=>a(34)),class:"sector-field",x:"222.679",y:"132.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(34)?"#FFFF0030":"#2e3b46"},null,8,Qet),t.createElementVNode("rect",{onClick:d[13]||(d[13]=o=>a(35)),class:"sector-field",x:"288.347",y:"132.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(35)?"#FFFF0030":"#2e3b46"},null,8,$et),t.createElementVNode("rect",{onClick:d[14]||(d[14]=o=>a(2)),class:"sector-field",x:"91.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(2)?"#FFFF0030":"#2e3b46"},null,8,ett),t.createElementVNode("rect",{onClick:d[15]||(d[15]=o=>a(3)),class:"sector-field",x:"114.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(3)?"#FFFF0030":"#2e3b46"},null,8,ttt),t.createElementVNode("rect",{onClick:d[16]||(d[16]=o=>a(4)),class:"sector-field",x:"137.347",y:"0.347042",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(4)?"#FFFF0030":"#2e3b46"},null,8,rtt),t.createElementVNode("rect",{onClick:d[17]||(d[17]=o=>a(5)),class:"sector-field",x:"172.347",y:"0.347042",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(5)?"#FFFF0030":"#2e3b46"},null,8,ntt),t.createElementVNode("rect",{onClick:d[18]||(d[18]=o=>a(6)),class:"sector-field",x:"207.347",y:"0.347042",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(6)?"#FFFF0030":"#2e3b46"},null,8,att),t.createElementVNode("rect",{onClick:d[19]||(d[19]=o=>a(7)),class:"sector-field",x:"242.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(7)?"#FFFF0030":"#2e3b46"},null,8,itt),t.createElementVNode("rect",{onClick:d[20]||(d[20]=o=>a(8)),class:"sector-field",x:"265.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(8)?"#FFFF0030":"#2e3b46"},null,8,ott),t.createElementVNode("rect",{onClick:d[21]||(d[21]=o=>a(10)),class:"sector-field",x:"91.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(10)?"#FFFF0030":"#2e3b46"},null,8,stt),t.createElementVNode("rect",{onClick:d[22]||(d[22]=o=>a(11)),class:"sector-field",x:"114.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(11)?"#FFFF0030":"#2e3b46"},null,8,ltt),t.createElementVNode("rect",{onClick:d[23]||(d[23]=o=>a(12)),class:"sector-field",x:"137.347",y:"29.6804",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(12)?"#FFFF0030":"#2e3b46"},null,8,ctt),t.createElementVNode("rect",{onClick:d[24]||(d[24]=o=>a(13)),class:"sector-field",x:"172.347",y:"29.6804",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(13)?"#FFFF0030":"#2e3b46"},null,8,utt),t.createElementVNode("rect",{onClick:d[25]||(d[25]=o=>a(14)),class:"sector-field",x:"207.347",y:"29.6804",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(14)?"#FFFF0030":"#2e3b46"},null,8,dtt),t.createElementVNode("rect",{onClick:d[26]||(d[26]=o=>a(15)),class:"sector-field",x:"242.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(15)?"#FFFF0030":"#2e3b46"},null,8,ptt),t.createElementVNode("rect",{onClick:d[27]||(d[27]=o=>a(16)),class:"sector-field",x:"265.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(16)?"#FFFF0030":"#2e3b46"},null,8,htt),t.createElementVNode("rect",{onClick:d[28]||(d[28]=o=>a(18)),class:"sector-field",x:"91.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(18)?"#FFFF0030":"#2e3b46"},null,8,ftt),t.createElementVNode("rect",{onClick:d[29]||(d[29]=o=>a(19)),class:"sector-field",x:"114.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(19)?"#FFFF0030":"#2e3b46"},null,8,mtt),t.createElementVNode("rect",{onClick:d[30]||(d[30]=o=>a(20)),class:"sector-field",x:"137.347",y:"59.0137",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(20)?"#FFFF0030":"#2e3b46"},null,8,ytt),t.createElementVNode("rect",{onClick:d[31]||(d[31]=o=>a(21)),class:"sector-field",x:"172.347",y:"59.0137",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(21)?"#FFFF0030":"#2e3b46"},null,8,gtt),t.createElementVNode("rect",{onClick:d[32]||(d[32]=o=>a(22)),class:"sector-field",x:"207.347",y:"59.0137",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(22)?"#FFFF0030":"#2e3b46"},null,8,vtt),t.createElementVNode("rect",{onClick:d[33]||(d[33]=o=>a(23)),class:"sector-field",x:"242.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(23)?"#FFFF0030":"#2e3b46"},null,8,btt),t.createElementVNode("rect",{onClick:d[34]||(d[34]=o=>a(24)),class:"sector-field",x:"265.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(24)?"#FFFF0030":"#2e3b46"},null,8,xtt),d[40]||(d[40]=t.createElementVNode("rect",{x:"91.6",y:"0.6",width:"196.8",height:"87.8",stroke:"#DFE3E2","stroke-width":"1.2"},null,-1)),d[41]||(d[41]=t.createElementVNode("rect",{x:"137.6",y:"0.782404",width:"104.8",height:"28.8",stroke:"#DFE3E2","stroke-width":"1.2"},null,-1)),t.createElementVNode("mask",{id:p.value,style:{"mask-type":"alpha"},maskUnits:"userSpaceOnUse",x:"91",y:"88",width:"198",height:"25"},[...d[38]||(d[38]=[t.createElementVNode("rect",{width:"197.746",height:"24.6043",transform:"matrix(1 0 0 -1 91 113)",fill:"#D9D9D9"},null,-1)])],8,_tt),t.createElementVNode("g",{mask:`url(#${p.value})`},[...d[39]||(d[39]=[t.createElementVNode("circle",{cx:"185.329",cy:"56.5046",r:"52.6152",stroke:"#DFE3E2","stroke-width":"1.38817"},null,-1)])],8,wtt),d[42]||(d[42]=t.createElementVNode("circle",{cx:"190.278",cy:"66.2782",r:"2.27817",fill:"white"},null,-1)),d[43]||(d[43]=t.createElementVNode("rect",{x:"0.7",y:"0.7",width:"378.6",height:"175.6",stroke:"#DFE3E2","stroke-width":"1.4"},null,-1))]))])]),t.createElementVNode("div",Ttt,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(k,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(T,["stop"])}," Listo ")])]))}},dA=t2(Stt,[["__scopeId","data-v-203bc904"]]),ktt={class:"que-sucedio-filter"},Ltt={class:"filter-header"},Ntt={class:"checkbox-item todos-header"},Ott=["checked"],Mtt={class:"filter-section"},Ett={class:"checkbox-item main-option"},Ctt=["checked"],ztt={class:"sub-options"},Vtt={class:"checkbox-item sub-option"},Ptt=["checked"],Att={class:"checkbox-item sub-option"},Rtt=["checked"],Utt={class:"filter-section"},Ftt={class:"checkbox-item main-option"},Itt=["checked"],qtt={class:"sub-options"},jtt={class:"checkbox-item sub-option"},Dtt=["checked"],Wtt={class:"checkbox-item sub-option"},Ktt=["checked"],Btt={class:"checkbox-item sub-option"},Xtt=["checked"],Gtt={class:"filter-actions"},Ztt={__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","done"],setup(e,{emit:r}){const n=e,v=r,$=["rematado-destino-porteria","fue-gol","no-fue-gol","rematado-sin-destino-porteria","ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"],h={"rematado-destino-porteria":["fue-gol","no-fue-gol"],"rematado-sin-destino-porteria":["ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"]},u=t.ref([]);t.watch(()=>n.selectedValues,d=>{if(!d||!Array.isArray(d))return;const o=d[n.filterIndex];if(o&&typeof o=="object"&&!Array.isArray(o)&&o[n.optionIndex]!==void 0){const l=Array.isArray(o[n.optionIndex])?o[n.optionIndex]:[];if(l.length>0){const s=JSON.stringify(u.value.sort()),f=JSON.stringify(l.sort());s!==f&&(u.value=[...l])}}},{immediate:!0,deep:!0}),t.onMounted(()=>{t.nextTick(()=>{if(n.selectedValues&&Array.isArray(n.selectedValues)){const d=n.selectedValues[n.filterIndex];if(d&&typeof d=="object"&&!Array.isArray(d)&&d[n.optionIndex]!==void 0){const o=Array.isArray(d[n.optionIndex])?d[n.optionIndex]:[];if(o.length>0){u.value=[...o];return}}}u.value.length===0&&(u.value=[...$])})});const i=t.computed(()=>$.every(d=>u.value.includes(d))),p=d=>u.value.includes(d),c=d=>{d.target.checked?u.value=[...$]:u.value=[],v("update-selection",{optionIndex:n.optionIndex,values:[...u.value]})},a=(d,o)=>{let l=[...u.value];const s=h[d]||[];o?(l.includes(d)||l.push(d),s.forEach(f=>{l.includes(f)||l.push(f)})):l=l.filter(f=>f!==d&&!s.includes(f)),u.value=l,v("update-selection",{optionIndex:n.optionIndex,values:l})},k=(d,o)=>{let l=[...u.value];const s=Object.keys(h).find(f=>h[f].includes(d));o?(l.includes(d)||l.push(d),s&&h[s].every(f=>l.includes(f))&&!l.includes(s)&&l.push(s)):(l=l.filter(f=>f!==d),s&&l.includes(s)&&(l=l.filter(f=>f!==s))),u.value=l,v("update-selection",{optionIndex:n.optionIndex,values:l})},T=()=>{u.value=[...$],v("update-selection",{optionIndex:n.optionIndex,values:[...$]})},x=()=>{v("done")};return(d,o)=>(t.openBlock(),t.createElementBlock("div",ktt,[t.createElementVNode("div",Ltt,[t.createElementVNode("label",Ntt,[o[7]||(o[7]=t.createElementVNode("span",{class:"checkbox-label"},"Todos",-1)),t.createElementVNode("input",{type:"checkbox",checked:i.value,onChange:t.withModifiers(c,["stop"])},null,40,Ott)])]),o[15]||(o[15]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",Mtt,[t.createElementVNode("label",Ett,[t.createElementVNode("input",{type:"checkbox",checked:p("rematado-destino-porteria"),onChange:o[0]||(o[0]=t.withModifiers(l=>a("rematado-destino-porteria",l.target.checked),["stop"]))},null,40,Ctt),o[8]||(o[8]=t.createElementVNode("span",{class:"checkbox-label"},"Rematado con destino a portería",-1))]),t.createElementVNode("div",ztt,[t.createElementVNode("label",Vtt,[t.createElementVNode("input",{type:"checkbox",checked:p("fue-gol"),onChange:o[1]||(o[1]=t.withModifiers(l=>k("fue-gol",l.target.checked),["stop"]))},null,40,Ptt),o[9]||(o[9]=t.createElementVNode("span",{class:"checkbox-label"},"Fue gol",-1))]),t.createElementVNode("label",Att,[t.createElementVNode("input",{type:"checkbox",checked:p("no-fue-gol"),onChange:o[2]||(o[2]=t.withModifiers(l=>k("no-fue-gol",l.target.checked),["stop"]))},null,40,Rtt),o[10]||(o[10]=t.createElementVNode("span",{class:"checkbox-label"},"No fue gol",-1))])])]),o[16]||(o[16]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",Utt,[t.createElementVNode("label",Ftt,[t.createElementVNode("input",{type:"checkbox",checked:p("rematado-sin-destino-porteria"),onChange:o[3]||(o[3]=t.withModifiers(l=>a("rematado-sin-destino-porteria",l.target.checked),["stop"]))},null,40,Itt),o[11]||(o[11]=t.createElementVNode("span",{class:"checkbox-label"},"Rematado sin destino a portería",-1))]),t.createElementVNode("div",qtt,[t.createElementVNode("label",jtt,[t.createElementVNode("input",{type:"checkbox",checked:p("ganados-por-portero-rival"),onChange:o[4]||(o[4]=t.withModifiers(l=>k("ganados-por-portero-rival",l.target.checked),["stop"]))},null,40,Dtt),o[12]||(o[12]=t.createElementVNode("span",{class:"checkbox-label"},"Ganados por portero rival",-1))]),t.createElementVNode("label",Wtt,[t.createElementVNode("input",{type:"checkbox",checked:p("ganados-por-jugador-rival"),onChange:o[5]||(o[5]=t.withModifiers(l=>k("ganados-por-jugador-rival",l.target.checked),["stop"]))},null,40,Ktt),o[13]||(o[13]=t.createElementVNode("span",{class:"checkbox-label"},"Ganados por jugador rival",-1))]),t.createElementVNode("label",Btt,[t.createElementVNode("input",{type:"checkbox",checked:p("sin-destino"),onChange:o[6]||(o[6]=t.withModifiers(l=>k("sin-destino",l.target.checked),["stop"]))},null,40,Xtt),o[14]||(o[14]=t.createElementVNode("span",{class:"checkbox-label"},"Sin destino",-1))])])]),t.createElementVNode("div",Gtt,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(T,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(x,["stop"])}," Listo ")])]))}},u9=t2(Ztt,[["__scopeId","data-v-e3994cc8"]]),Jtt={class:"advanced-select-accordion"},Htt=["onClick"],Ytt={class:"accordion-header-left"},Qtt={class:"accordion-icon"},$tt=["src","alt"],ert={class:"accordion-title"},trt={class:"accordion-header-right"},rrt={key:0,class:"accordion-badge"},nrt={key:0,class:"accordion-content"},art={class:"accordion-footer"},irt={__name:"AdvancedSelectAccordion",props:{filter:{type:Object,required:!0},filterIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","close"],setup(e,{emit:r}){const n=e;t.watch(()=>n.selectedValues,x=>{console.log("Acorden inicla 55555555555v [AdvancedSelectAccordion] selectedValues recibidos:",{filterIndex:n.filterIndex,selectedValues:x,filterValue:x==null?void 0:x[n.filterIndex],filterValueType:typeof(x==null?void 0:x[n.filterIndex]),isArray:Array.isArray(x==null?void 0:x[n.filterIndex]),filterValueKeys:x!=null&&x[n.filterIndex]&&typeof(x==null?void 0:x[n.filterIndex])=="object"?Object.keys(x[n.filterIndex]):null})},{immediate:!0,deep:!0});const v=r,$=t.ref({}),h=x=>{$.value[x]?$.value[x]=!1:(Object.keys($.value).forEach(d=>{$.value[d]=!1}),$.value[x]=!0)},u=x=>{const d=n.filter.options[x];if(!d||!d.filters)return 0;const o=n.selectedValues[n.filterIndex];if(!o||!o[x])return 0;const l=o[x];return Array.isArray(l)?l.length:0},i=(x,d)=>x.icon?x.icon:`https://golstatsimages.blob.core.windows.net/todoelfut/f${d+1}.png`,p=x=>x==="Qué sucedió?"||x==="Qué sucedió"?"¿Qué sucedió?":x,c=x=>{const d={resultados:SM,detalles:uA,"como-fue-cobrado":kM,"como fue cobrado":kM,zona:dA,"que-sucedio":u9,"qué sucedió":u9,"que sucedio":u9},o=typeof x.value=="string"?x.value:String(x.value||""),l=typeof x.label=="string"?x.label:String(x.label||""),s=o.toLowerCase().trim(),f=l.toLowerCase().trim();if(s&&d[s])return d[s];if(f&&d[f])return d[f];const g=f.replace(/\s+/g,"-").replace(/[¿?]/g,"").replace(/[áéíóú]/g,S=>({á:"a",é:"e",í:"i",ó:"o",ú:"u"})[S]||S);return g&&d[g]?d[g]:SM},a=x=>{v("update-selection",{filterIndex:n.filterIndex,optionIndex:x.optionIndex,values:x.values})},k=x=>{$.value[x]=!1},T=()=>{v("close")};return(x,d)=>(t.openBlock(),t.createElementBlock("div",Jtt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filter.options,(o,l)=>(t.openBlock(),t.createElementBlock("div",{key:o.value||l,class:"accordion-item"},[t.createElementVNode("div",{class:"accordion-header",onClick:t.withModifiers(s=>h(l),["stop"])},[t.createElementVNode("div",Ytt,[t.createElementVNode("span",Qtt,[t.createElementVNode("img",{src:i(o,l),alt:o.label},null,8,$tt)]),t.createElementVNode("span",ert,t.toDisplayString(p(o.label)),1)]),t.createElementVNode("div",trt,[u(l)>0?(t.openBlock(),t.createElementBlock("span",rrt,t.toDisplayString(u(l)),1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass(["accordion-chevron",{open:$.value[l]}])},[...d[0]||(d[0]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)])],8,Htt),t.createVNode(t.Transition,{name:"accordion"},{default:t.withCtx(()=>[$.value[l]?(t.openBlock(),t.createElementBlock("div",nrt,[c(o)===SM?(t.openBlock(),t.createBlock(SM,{key:0,option:o,"filter-index":e.filterIndex,"option-index":l,"selected-values":e.selectedValues,onUpdateSelection:a,onDone:()=>k(l)},null,8,["option","filter-index","option-index","selected-values","onDone"])):c(o)===uA?(t.openBlock(),t.createBlock(uA,{key:1,option:o,"filter-index":e.filterIndex,"option-index":l,"selected-values":e.selectedValues,onUpdateSelection:a,onDone:()=>k(l)},null,8,["option","filter-index","option-index","selected-values","onDone"])):c(o)===kM?(t.openBlock(),t.createBlock(kM,{key:2,option:o,"filter-index":e.filterIndex,"option-index":l,"selected-values":e.selectedValues,onUpdateSelection:a,onDone:()=>k(l)},null,8,["option","filter-index","option-index","selected-values","onDone"])):c(o)===dA?(t.openBlock(),t.createBlock(dA,{key:3,option:o,"filter-index":e.filterIndex,"option-index":l,"selected-values":e.selectedValues,onUpdateSelection:a,onDone:()=>k(l)},null,8,["option","filter-index","option-index","selected-values","onDone"])):c(o)===u9?(t.openBlock(),t.createBlock(u9,{key:4,option:o,"filter-index":e.filterIndex,"option-index":l,"selected-values":e.selectedValues,onUpdateSelection:a,onDone:()=>k(l)},null,8,["option","filter-index","option-index","selected-values","onDone"])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)]),_:2},1024)]))),128)),t.createElementVNode("div",art,[d[1]||(d[1]=t.createElementVNode("div",{class:"footer-separator"},null,-1)),t.createElementVNode("button",{class:"btn-done-footer",onClick:t.withModifiers(T,["stop"])}," Listo ")])]))}},ort=t2(irt,[["__scopeId","data-v-92b4e8ad"]]),srt={class:"corners-zone-filters"},lrt={key:0,class:"custom-radio-group"},crt={class:"radio-label"},urt={class:"radio-options"},drt=["name","value","onUpdate:modelValue"],prt={key:0,class:"filter-separator"},hrt={class:"filter-inline select-with-label"},frt=["data-filter-type","onClick"],mrt={class:"select-display"},yrt={class:"select-label"},grt={key:0,class:"dropdown-menu type-menu simple-select-menu"},vrt={class:"simple-select-scroll-area"},brt=["onClick"],xrt={class:"option-content"},_rt={class:"option-title"},wrt={key:0,class:"option-checkmark"},Trt={class:"switch-group"},Srt={class:"switch-label"},krt=["onClick"],Lrt={key:0,class:"filter-separator"},Nrt={key:3,class:"filter-inline advanced-select-wrapper"},Ort=["data-filter-type","onClick"],Mrt={class:"select-display"},Ert={class:"select-label"},Crt={__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:r,emit:n}){const v=e,$=n,h=t.ref([]);let u=null;const i=t.ref(null),p=t.ref(null),c=t.ref([]);let a=!1,k=null;const T=(I,j)=>{if(Array.isArray(I)&&Array.isArray(j)){if(I.length!==j.length)return!1;for(let U=0;U<I.length;U++)if(I[U]!==j[U])return!1;return!0}return I===j},x=(I,j=!0)=>{if(v.filters&&v.filters[0]&&v.filters[1]){const U=v.filters[0],D=v.filters[1],F=U.options,z=D.options;F&&Array.isArray(F)&&z?I!=null?F.findIndex(X=>X.value===I)!==-1&&z[I]?(c.value=z[I],j&&!(()=>{const X=h.value[1];return X==null?!1:Array.isArray(X)?X.length>0:X!==""})()&&!a&&c.value.length>0&&(h.value[1]=c.value[0].value,t.nextTick(()=>{}))):(c.value=[],h.value[1]=null):(c.value=[],h.value[1]=null):c.value=[]}},d=()=>{v.initialValues&&v.initialValues.length>0?v.initialValues.length>0&&(typeof v.initialValues[0]=="number"||typeof v.initialValues[0]=="boolean"||v.initialValues[0]===null||Array.isArray(v.initialValues[0]))?h.value=v.filters.map((U,D)=>{var F,z,X,M;const Y=v.initialValues[D];if(Y!=null)return U.type==="switch"&&v.filters.findIndex(se=>se.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor desde initialValues en índice ${D} (formato simple):`,Y),Y;if(U.type==="radio-button")return((z=(F=U.options)==null?void 0:F[0])==null?void 0:z.value)||null;if(U.type==="advanced-select"){const se={};let me=!1;return U.options&&Array.isArray(U.options)&&U.options.forEach((ge,be)=>{var xe,Pe,je,_e,Ue,qe,Re;ge.value==="zona"||(xe=ge.label)!=null&&xe.toLowerCase().includes("zona")?(se[be]=Array.from({length:35},(We,Qe)=>Qe+1),me=!0):ge.value==="resultados"||(Pe=ge.label)!=null&&Pe.toLowerCase().includes("resultados")?(se[be]=["iba-ganando","iba-perdiendo","iba-empatado"],me=!0):ge.value==="que-sucedio"||ge.value==="que sucedio"||(je=ge.label)!=null&&je.toLowerCase().includes("qué sucedió")||(_e=ge.label)!=null&&_e.toLowerCase().includes("que sucedio")?(se[be]=["rematado-destino-porteria","fue-gol","no-fue-gol","rematado-sin-destino-porteria","ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"],me=!0):ge.value==="detalles"||(Ue=ge.label)!=null&&Ue.toLowerCase().includes("detalles")?(se[be]=["0-15","16-30","31-45","46-60","61-75","76-90"],me=!0):(ge.value==="como-fue-cobrado"||ge.value==="como fue cobrado"||(qe=ge.label)!=null&&qe.toLowerCase().includes("cómo fue cobrado")||(Re=ge.label)!=null&&Re.toLowerCase().includes("como fue cobrado"))&&(se[be]=["izquierda","comba-afuera","comba-adentro","raz-area","en-corto"],me=!0)}),me?se:{}}return U.type==="select"?[]:U.type==="check"?!1:U.type==="switch"?(v.filters.findIndex(se=>se.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${D} (formato simple):`,!1),!1):U.type==="select-simple"&&((M=(X=U.options)==null?void 0:X[0])==null?void 0:M.value)||null}):v.isEditMode?h.value=v.filters.map((U,D)=>{var F,z,X,M,Y,se,me,ge,be,xe;const Pe=v.initialValues[D];if(D===3&&console.log(`[CornersZoneFilters] Procesando filtro en índice ${D} (FILTRO AVANZADO):`,{filterType:U.type,filterData:Pe,hasFilterData:!!Pe,filterDataKeys:Pe?Object.keys(Pe):null,selectedValue:Pe==null?void 0:Pe.selectedValue,selectedValueType:typeof(Pe==null?void 0:Pe.selectedValue),isDirectObject:Pe&&typeof Pe=="object"&&!Array.isArray(Pe)&&!Pe.selectedValue&&!Pe.selectedOption&&!Pe.isChecked}),!Pe)return U.type==="select"?[]:U.type==="check"?!1:U.type==="switch"?(v.filters.findIndex(je=>je.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${D} (modo edición):`,!1),!1):U.type==="radio-button"?((z=(F=U.options)==null?void 0:F[0])==null?void 0:z.value)||null:U.type==="select-simple"?((M=(X=U.options)==null?void 0:X[0])==null?void 0:M.value)||null:U.type==="advanced-select"?{}:null;if(U.type==="advanced-select"){if(console.log(`[CornersZoneFilters] Modo edición - Filtro avanzado en índice ${D}:`,{filterIndex:D,filterType:U.type,filterData:Pe,selectedValue:Pe==null?void 0:Pe.selectedValue,selectedValueType:typeof(Pe==null?void 0:Pe.selectedValue),isArray:Array.isArray(Pe==null?void 0:Pe.selectedValue),isDirectObject:typeof Pe=="object"&&!Array.isArray(Pe)&&!Pe.selectedValue&&!Pe.selectedOption&&!Pe.isChecked}),Pe.selectedValue!==void 0&&Pe.selectedValue!==null){if(typeof Pe.selectedValue=="object"&&!Array.isArray(Pe.selectedValue)){const je=Object.keys(Pe.selectedValue).some(_e=>{const Ue=Number(_e);return!isNaN(Ue)&&Ue>=0});return console.log(`[CornersZoneFilters] Filtro avanzado ${D} - hasCorrectStructure:`,je,"selectedValue:",Pe.selectedValue),je&&console.log(`[CornersZoneFilters] Filtro avanzado ${D} - Retornando selectedValue directamente:`,Pe.selectedValue),Pe.selectedValue}else if(Array.isArray(Pe.selectedValue)){const je={};return Pe.selectedValue.forEach((_e,Ue)=>{je[Ue]=_e}),je}}return typeof Pe=="object"&&!Array.isArray(Pe)&&!Pe.selectedValue&&!Pe.selectedOption&&!Pe.isChecked&&Pe!==null&&Object.keys(Pe).some(je=>{const _e=Number(je);return!isNaN(_e)&&_e>=0})?(console.log(`[CornersZoneFilters] Filtro avanzado ${D} - filterData es objeto directo guardado, retornando:`,Pe),Pe):(console.log(`[CornersZoneFilters] Filtro avanzado ${D} - No hay valores guardados, retornando objeto vacío`),{})}return U.type==="radio-button"&&Pe.selectedOption?Pe.selectedOption.value:U.type==="radio-button"&&!Pe.selectedOption?Pe.selectedValue!==void 0?Pe.selectedValue:((se=(Y=U.options)==null?void 0:Y[0])==null?void 0:se.value)||null:U.type==="select-simple"&&Pe.selectedValue!==void 0?Array.isArray(Pe.selectedValue)?Pe.selectedValue[0]:Pe.selectedValue:U.type==="select"&&Pe.selectedOptions?Pe.selectedOptions.map(je=>je.value):U.type==="check"&&Pe.isChecked!==void 0?Pe.isChecked:U.type==="switch"&&(Pe.isChecked!==void 0||Pe.selectedValue!==void 0)?Pe.isChecked!==void 0?Pe.isChecked:Pe.selectedValue:Pe.selectedValue!==void 0?Pe.selectedValue:U.type==="select"?[]:U.type==="check"||U.type==="switch"?!1:U.type==="radio-button"?((ge=(me=U.options)==null?void 0:me[0])==null?void 0:ge.value)||null:U.type==="select-simple"?((xe=(be=U.options)==null?void 0:be[0])==null?void 0:xe.value)||null:U.type==="advanced-select"?{}:null}):h.value=v.filters.map((U,D)=>{var F,z,X,M;const Y=v.initialValues[D];if(Y!=null)return Y;if(U.type==="radio-button")return((z=(F=U.options)==null?void 0:F[0])==null?void 0:z.value)||null;if(U.type==="advanced-select"){const se={};let me=!1;return U.options&&Array.isArray(U.options)&&U.options.forEach((ge,be)=>{var xe,Pe,je,_e,Ue,qe,Re;ge.value==="zona"||(xe=ge.label)!=null&&xe.toLowerCase().includes("zona")?(se[be]=Array.from({length:35},(We,Qe)=>Qe+1),me=!0):ge.value==="resultados"||(Pe=ge.label)!=null&&Pe.toLowerCase().includes("resultados")?(se[be]=["iba-ganando","iba-perdiendo","iba-empatado"],me=!0):ge.value==="que-sucedio"||ge.value==="que sucedio"||(je=ge.label)!=null&&je.toLowerCase().includes("qué sucedió")||(_e=ge.label)!=null&&_e.toLowerCase().includes("que sucedio")?(se[be]=["rematado-destino-porteria","fue-gol","no-fue-gol","rematado-sin-destino-porteria","ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"],me=!0):ge.value==="detalles"||(Ue=ge.label)!=null&&Ue.toLowerCase().includes("detalles")?(se[be]=["0-15","16-30","31-45","46-60","61-75","76-90"],me=!0):(ge.value==="como-fue-cobrado"||ge.value==="como fue cobrado"||(qe=ge.label)!=null&&qe.toLowerCase().includes("cómo fue cobrado")||(Re=ge.label)!=null&&Re.toLowerCase().includes("como fue cobrado"))&&(se[be]=["izquierda","comba-afuera","comba-adentro","raz-area","en-corto"],me=!0)}),me?se:{}}return U.type==="select"?[]:U.type==="check"?!1:U.type==="switch"?(v.filters.findIndex(se=>se.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${D} (modo agregar):`,!1),!1):U.type==="select-simple"&&((M=(X=U.options)==null?void 0:X[0])==null?void 0:M.value)||null}):h.value=v.filters.map((U,D)=>{var F,z,X,M;return U.type==="select"?[]:U.type==="check"?!1:U.type==="switch"?(v.filters.findIndex(Y=>Y.type==="switch")===D&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${D} (sin initialValues):`,!1),!1):U.type==="radio-button"?((z=(F=U.options)==null?void 0:F[0])==null?void 0:z.value)||null:U.type==="select-simple"?((M=(X=U.options)==null?void 0:X[0])==null?void 0:M.value)||null:U.type==="advanced-select"?{}:null});const I=h.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!=="")),j=v.filters.map((U,D)=>({index:D,type:U.type,label:U.label||U.label_1||U.label_2||`Filtro ${D}`,value:h.value[D]}));console.log("??????????????????????????????????? ---- ???????????????????????????????????"),console.log("Valores de filtros seteados:",j),console.log("selectedValues:",h.value),console.log("props.filters:",v.filters),console.log("??????????????????????????????????? ---- ???????????????????????????????????"),I&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))};d(),setTimeout(()=>{t.nextTick(()=>{if(h.value[0]!==null&&h.value[0]!==void 0&&!a){const I=!(()=>{const j=h.value[1];return j==null?!1:Array.isArray(j)?j.length>0:j!==""})();x(h.value[0],I),t.nextTick(()=>{h.value.some(j=>j!=null&&(Array.isArray(j)?j.length>0:typeof j=="object"&&!Array.isArray(j)?Object.keys(j).length>0:j!==!1&&j!==""))&&(!u||h.value.length!==u.length||h.value.some((j,U)=>!T(j,u[U])))&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))})}else setTimeout(()=>{h.value.some(I=>I!=null&&(Array.isArray(I)?I.length>0:typeof I=="object"&&!Array.isArray(I)?Object.keys(I).length>0:I!==!1&&I!==""))&&(!u||h.value.length!==u.length||h.value.some((I,j)=>!T(I,u[j])))&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))},100)})},300),t.watch(()=>v.initialValues,I=>{if(!I||I.length===0)return;const j=I.length>0&&(typeof I[0]=="number"||typeof I[0]=="boolean"||I[0]===null||Array.isArray(I[0])),U=!T(h.value,I),D=I&&I.length>0&&!a&&U,F=v.isEditMode&&a;if(D&&!F)if(j){const z=v.filters.findIndex(X=>X.type==="switch");z!==-1&&I[z]!==void 0&&console.log(`[Primer Switch] Se setea valor desde watcher initialValues (formato simple) en índice ${z}:`,I[z]),h.value=[...I]}else v.isEditMode?h.value=v.filters.map((z,X)=>{const M=I[X];return M?z.type==="radio-button"&&M.selectedOption?M.selectedOption.value:z.type==="select-simple"&&M.selectedValue!==void 0?Array.isArray(M.selectedValue)?M.selectedValue[0]:M.selectedValue:z.type==="select"&&M.selectedOptions?M.selectedOptions.map(Y=>Y.value):z.type==="check"&&M.isChecked!==void 0?M.isChecked:z.type==="switch"&&M.isChecked!==void 0?(v.filters.findIndex(Y=>Y.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor desde isChecked en índice ${X} (modo edición):`,M.isChecked),M.isChecked):z.type==="switch"&&M.selectedValue!==void 0?(v.filters.findIndex(Y=>Y.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor desde selectedValue en índice ${X} (modo edición):`,M.selectedValue),M.selectedValue):z.type==="advanced-select"&&M.selectedValue!==void 0||M.selectedValue!==void 0?M.selectedValue:h.value[X]:h.value[X]}):h.value=[...I];else a?k&&k.length>0&&(h.value=[...k]):F&&k&&k.length>0&&(h.value=[...k])},{deep:!0}),t.watch(()=>v.isEditMode,(I,j)=>{j===!0&&I===!1&&(k=null)},{immediate:!0}),t.watch(h,I=>{if(I.some(j=>j!=null&&(Array.isArray(j)?j.length>0:typeof j=="object"&&!Array.isArray(j)?Object.keys(j).length>0:j!==!1&&j!==""))){const j=[...I];if(u){for(;j.length<u.length;)j.push(void 0);for(let U=0;U<u.length;U++)u[U]!==void 0&&u[U]!==null&&(j[U]===void 0||j[U]===null)&&(j[U]=u[U])}if((()=>{if(!u||j.length!==u.length)return!0;for(let U=0;U<j.length;U++)if(!T(j[U],u[U]))return!0;return!1})()){u=[...j];const U=v.filters.map((D,F)=>({index:F,type:D.type,label:D.label||D.label_1||D.label_2||`Filtro ${F}`,value:j[F]}));console.log("Valores de filtros actualizados:",U),$("filters-changed",{componentId:v.componentId,filters:j,timestamp:new Date().toISOString()})}}},{deep:!0}),t.watch(()=>h.value[0],(I,j)=>{var U;if(I==null){const F=v.filters[0];if(F&&F.type==="radio-button"&&F.options&&F.options.length>0){const z=F.options[0].value;h.value[0]=z;return}}const D=(U=v.filters)==null?void 0:U[0];D&&D.type==="select-simple"&&(I!==j&&j!==void 0?x(I,!0):j===void 0&&I!==null&&I!==void 0&&x(I,!1))},{immediate:!0});const o=I=>{i.value===I?i.value=null:(i.value=I,p.value=null)},l=I=>{p.value===I?p.value=null:(p.value=I,i.value=null)},s=(I,j)=>{if(a=!0,setTimeout(()=>{a=!1},1e3),h.value[I]=j,(I===0||I===1)&&(k=[...h.value]),i.value=null,I===0){h.value[1]!==void 0&&(h.value[1]=null);const U=a;a=!1,x(j,!0),a=U,h.value[1]!==null&&h.value[1]!==void 0&&(k=[...h.value])}},f=()=>{a=!0,setTimeout(()=>{a=!1},400)},g=I=>{a=!0,setTimeout(()=>{a=!1},400);const j=h.value[I],U=!j;h.value[I]=U,v.filters.findIndex(D=>D.type==="switch")===I&&console.log(`[Primer Switch] Se setea valor en índice ${I} desde toggleSwitch:`,U,"(valor anterior:",j,")")},S=I=>{a=!0,setTimeout(()=>{a=!1},400),h.value[I.filterIndex]||(h.value[I.filterIndex]={}),h.value[I.filterIndex]={...h.value[I.filterIndex],[I.optionIndex]:I.values},t.nextTick(()=>{h.value.some(j=>j!=null&&(Array.isArray(j)?j.length>0:typeof j=="object"&&!Array.isArray(j)?Object.keys(j).length>0:j!==!1&&j!==""))&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))})},L=()=>h.value,E=(I,j)=>{const U=h.value[j];if(U==null)return null;if(j===1&&c.value.length>0){const D=c.value.find(F=>F.value===U);return D?D.label:null}if(I.options&&Array.isArray(I.options)){const D=I.options.find(F=>F.value===U);return D?D.label:null}return null},P=(I,j)=>{const U=h.value[j];if(!U||typeof U!="object"||Array.isArray(U))return null;const D=Object.values(U).reduce((F,z)=>Array.isArray(z)&&z.length>0?F+z.length:F,0);return D>0?`${D} seleccionado${D>1?"s":""}`:null},V=I=>{const j=I.target,U=j.closest(".advanced-select-dropdown"),D=j.closest(".advanced-select-menu"),F=j.closest(".advanced-select-accordion"),z=j.closest(".advanced-select-content"),X=j.closest(".custom-select.dynamic-select"),M=j.closest(".simple-select-menu");!(U||D||F||z)&&!(X||M)&&(p.value=null,i.value=null)};return t.onMounted(()=>{document.addEventListener("click",V)}),t.onUnmounted(()=>{document.removeEventListener("click",V)}),r({getCurrentValues:L,initializeValues:d}),(I,j)=>(t.openBlock(),t.createElementBlock("div",srt,[e.filters&&e.filters.length>0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filters,(U,D)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:D},[U.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",lrt,[t.createElementVNode("div",crt,t.toDisplayString(U.label),1),t.createElementVNode("div",urt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(U.options,F=>(t.openBlock(),t.createElementBlock("label",{key:F.value,class:t.normalizeClass(["radio-option-card",{active:h.value[D]===F.value}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"corners-zone-radio-"+D,value:F.value,"onUpdate:modelValue":z=>h.value[D]=z,onChange:f},null,40,drt),[[t.vModelRadio,h.value[D]]]),t.createElementVNode("span",null,t.toDisplayString(F.label),1)],2))),128))])])):U.type==="select-simple"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[D==2?(t.openBlock(),t.createElementBlock("div",prt)):t.createCommentVNode("",!0),t.createElementVNode("div",hrt,[t.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":U.type,onClick:t.withModifiers(F=>o(D),["stop"])},[t.createElementVNode("div",mrt,[j[3]||(j[3]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.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)),t.createElementVNode("span",yrt,t.toDisplayString(E(U,D)||U.label_2||U.label||"Tipo de análisis"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:i.value===D}])},[...j[2]||(j[2]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),i.value===D?(t.openBlock(),t.createElementBlock("div",grt,[t.createElementVNode("div",vrt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(D===1?c.value:U.options,F=>(t.openBlock(),t.createElementBlock("div",{key:F.value,class:t.normalizeClass(["option-card simple-select-option",{active:T(h.value[D],F.value)}]),onClick:t.withModifiers(z=>s(D,F.value),["stop"])},[t.createElementVNode("div",xrt,[t.createElementVNode("div",_rt,t.toDisplayString(F.label),1)]),T(h.value[D],F.value)?(t.openBlock(),t.createElementBlock("div",wrt,[...j[4]||(j[4]=[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[t.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):t.createCommentVNode("",!0)],10,brt))),128))])])):t.createCommentVNode("",!0)],8,frt)])],64)):U.type==="switch"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("div",Trt,[t.createElementVNode("label",Srt,[U.label_1?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["switch-text switch-text-left",{"switch-text-selected":!h.value[D]}])},t.toDisplayString(U.label_1),3)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"switch",onClick:F=>g(D)},[t.createElementVNode("div",{class:t.normalizeClass(["switch-track",{"switch-on":h.value[D]}])},[t.createElementVNode("div",{class:t.normalizeClass(["switch-thumb",{on:h.value[D]}])},null,2)],2)],8,krt),U.label_2?(t.openBlock(),t.createElementBlock("span",{key:1,class:t.normalizeClass(["switch-text switch-text-right",{"switch-text-selected":h.value[D]}])},t.toDisplayString(U.label_2),3)):t.createCommentVNode("",!0)])]),D>=0?(t.openBlock(),t.createElementBlock("div",Lrt)):t.createCommentVNode("",!0)],64)):U.type==="advanced-select"?(t.openBlock(),t.createElementBlock("div",Nrt,[t.createElementVNode("div",{class:"custom-select dynamic-select filter-inline advanced-select-dropdown","data-filter-type":U.type,onClick:t.withModifiers(F=>l(D),["stop"])},[t.createElementVNode("div",Mrt,[j[6]||(j[6]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.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)),t.createElementVNode("span",Ert,t.toDisplayString(P(U,D)||U.label||"Seleccionar"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:p.value===D}])},[...j[5]||(j[5]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),p.value===D?(t.openBlock(),t.createElementBlock("div",{key:0,class:"dropdown-menu type-menu advanced-select-menu",onClick:j[1]||(j[1]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",{class:"advanced-select-content",onClick:j[0]||(j[0]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(ort,{filter:U,"filter-index":D,"selected-values":h.value,onUpdateSelection:S,onClose:F=>l(D)},null,8,["filter","filter-index","selected-values","onClose"])])])):t.createCommentVNode("",!0)],8,Ort)])):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0)]))}},zrt=t2(Crt,[["__scopeId","data-v-32afcda4"]]),Vrt={class:"floating-bar"},Prt={class:"tab active"},Art={class:"select-display"},Rrt={class:"select-icon"},Urt=["src"],Frt={key:1,alt:"icono",class:"option-img-default",src:"https://golstatsimages.blob.core.windows.net/images-library/vector2.png"},Irt={key:0,class:"select-placeholder select-label"},qrt={key:1,class:"select-label"},jrt={key:0,class:"dropdown-menu field-menu"},Drt=["onClick"],Wrt={class:"option-icon"},Krt=["data-hover-src","src"],Brt={class:"option-content"},Xrt={class:"option-title"},Grt={key:0,class:"option-description"},Zrt={class:"select-display"},Jrt={class:"select-icon"},Hrt=["src"],Yrt=["src"],Qrt={class:"select-label"},$rt={key:0,class:"dropdown-menu type-menu type-menu-grid"},ent={class:"option-grid"},tnt=["onClick"],rnt={key:0,class:"option-grid-title"},nnt={key:1,class:"option-grid-title"},ant={key:2,class:"option-grid-title"},int={class:"option-grid-icon"},ont=["src"],snt={key:1,class:"filter-separator"},lnt=["onClick"],cnt={class:"select-display"},unt={key:0,class:"badge-categorias"},dnt={key:0,class:"dropdown-menu type-menu multi-select-menu"},pnt={class:"multi-select-scroll-area"},hnt={class:"select-all-checkbox"},fnt=["checked","indeterminate","onChange"],mnt={class:"option-checkbox"},ynt=["checked","onChange"],gnt=["onClick"],vnt={class:"option-title"},bnt={class:"multi-select-footer"},xnt={key:1,class:"custom-radio-group filter-inline"},_nt={class:"radio-label"},wnt={class:"radio-options"},Tnt=["onUpdate:modelValue","disabled","name","value","onChange"],Snt={key:2,class:"check-group filter-inline"},knt=["onUpdate:modelValue","checked"],Lnt=["data-filter-type","onClick"],Nnt={class:"select-display"},Ont={key:0,class:"dropdown-menu type-menu simple-select-menu"},Mnt={class:"simple-select-scroll-area"},Ent=["onMouseenter","onClick"],Cnt={class:"option-content"},znt={class:"option-title"},Vnt={key:0,class:"option-checkmark"},Pnt={key:4,class:"filter-separator"},Ant=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:r,emit:n}){const v=e,$=n,h=t.ref(new Map),u=t.ref([]);let i=null,p=null,c=null;const a=t.ref(!1),k=t.ref(!1),T=t.ref(!1),x=t.ref(!1),d=t.ref(!1),o=t.ref(!1),l=t.computed(()=>u.value),s=t.ref(null),f=t.computed(()=>l.value[s.value]||null),g=t.computed(()=>{var St;const Yt=((St=f.value)==null?void 0:St.views)||[];return F(Yt)}),S=t.ref(null),L=t.computed(()=>g.value.find(St=>St.id===S.value)||null),E=t.ref([]),P=t.computed(()=>{var St,Yt;return a.value?((St=L.value)==null?void 0:St.filters_edition_mode)||[]:((Yt=L.value)==null?void 0:Yt.filters)||[]});t.watch(a,St=>{St||(k.value=!1)}),t.watch(L,St=>{var Yt,er;if(!St){E.value=[];return}const or=St.id===6&&v.isPostMatch,Or=St.id===14;if(!Array.isArray(P.value)&&!or&&!Or){E.value=[];return}x.value||(or||Or?E.value=[]:E.value=P.value.map((Pr,sn)=>{var qn,jn,ba,fa,Ia,en,Ur,mn,Vn,Jn,Cn,Xr,un,kr,dn,Gn,Dn,oa,Yn,qr,wr;if(Pr.type==="select"){if(a.value&&c&&c.dynamicFilters){const En=c.dynamicFilters[sn];if(En){if(En.selectedOptions&&Array.isArray(En.selectedOptions))return En.selectedOptions.map(na=>na.value);if(En.selectedValue&&Array.isArray(En.selectedValue))return En.selectedValue.length>0&&En.selectedValue[0]&&typeof En.selectedValue[0]=="object"?lr(En.selectedValue):En.selectedValue}}return St.id===4&&Pr.options&&Array.isArray(Pr.options)?Pr.options.map(En=>En.value):[]}else if(Pr.type==="radio-button"){if(a.value&&c&&c.dynamicFilters){const En=c.dynamicFilters[sn];if(En&&En.selectedOption){let na=En.selectedOption.value;if(St.id===15&&sn===0&&na===3&&((jn=(qn=p==null?void 0:p.view)==null?void 0:qn.filterMultiple)==null?void 0:jn.isHomeTeam)!==void 0){const ma=p.view.filterMultiple.isHomeTeam;typeof ma=="boolean"?na=ma?1:2:typeof ma=="number"&&(na=ma===1?1:2)}return na}}if(St.id===7&&a.value&&p!=null&&p.view){if(sn===0&&(ba=p.view.componentProps)!=null&&ba.analysisType)return p.view.componentProps.analysisType==="offensive"?1:2;if(sn===1&&((fa=p.view.filterMultiple)==null?void 0:fa.isHomeTeam)!==void 0)return p.view.filterMultiple.isHomeTeam?1:2}return((en=(Ia=Pr.options)==null?void 0:Ia[0])==null?void 0:en.value)??null}else if(Pr.type==="select-simple"){if(a.value&&c&&c.dynamicFilters){const En=c.dynamicFilters[sn];if(En&&En.selectedValue!==void 0){let na;return St.id===2&&(mn=(Ur=p==null?void 0:p.view)==null?void 0:Ur.filterMultiple)!=null&&mn.categoryId?na=p.view.filterMultiple.categoryId:St.id===1&&(Jn=(Vn=p==null?void 0:p.view)==null?void 0:Vn.filterMultiple)!=null&&Jn.category?na=p.view.filterMultiple.category:St.id===6&&(Xr=(Cn=p==null?void 0:p.view)==null?void 0:Cn.filterMultiple)!=null&&Xr.gameNumber?na=p.view.filterMultiple.gameNumber:na=Array.isArray(En.selectedValue)?En.selectedValue[0]:En.selectedValue,na}}if(St.id===2&&a.value&&p!=null&&p.view){if(i&&p.view.id){const En=i.getComponentDynamicFilters(p.view.id);if(En&&En[sn]!==void 0)return En[sn]}if(p.view.filterMultiple){if(Pr.type==="select-simple"&&p.view.filterMultiple.categoryId){const En=p.view.filterMultiple.categoryId;return(Pr.options||[]).find(na=>na.value==En),En}if(Pr.type==="radio-button"&&p.view.filterMultiple.teamType!==void 0){const En=p.view.filterMultiple.teamType;return(Pr.options||[]).find(na=>na.value==En),En}}}if(St.id===1&&a.value&&(un=p==null?void 0:p.view)!=null&&un.filterMultiple&&p.view.filterMultiple.category){const En=p.view.filterMultiple.category;return(Pr.options||[]).find(na=>na.value==En),En}if(St.id===9&&a.value&&(kr=p==null?void 0:p.view)!=null&&kr.filterMultiple&&Pr.type==="select-simple"&&p.view.filterMultiple.categoryIds){const En=Array.isArray(p.view.filterMultiple.categoryIds)?p.view.filterMultiple.categoryIds:[p.view.filterMultiple.categoryIds],na=(Pr.options||[]).filter(ma=>Array.isArray(ma.value)?hr(ma.value,En):En.includes(ma.value));return na.length>0?na[0].value:En}if(St.id===6&&a.value&&(dn=p==null?void 0:p.view)!=null&&dn.filterMultiple&&p.view.filterMultiple.gameNumber){const En=p.view.filterMultiple.gameNumber;return(Pr.options||[]).find(na=>na.value==En),En}if(St.id===5&&a.value&&(Gn=p==null?void 0:p.view)!=null&&Gn.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0){const En=p.view.filterMultiple.isHomeTeam;let na;if(typeof En=="boolean"?na=En?1:2:typeof En=="number"?na=En===1?1:2:na=1,(Pr.options||[]).find(ma=>ma.value==na),Pr.type==="radio-button"&&(Pr.label==="Equipo"||Pr.label==="Team"||Pr.label==="Equipo seleccionado"))return na}if(St.id===15&&a.value&&(Dn=p==null?void 0:p.view)!=null&&Dn.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0&&Pr.type==="radio-button"&&sn===0){const En=p.view.filterMultiple.isHomeTeam;let na;if(typeof En=="boolean"?na=En?1:2:typeof En=="number"?na=En===1?1:2:na=1,(Pr.options||[]).find(ma=>ma.value==na))return na}if(St.id===9&&a.value&&(oa=p==null?void 0:p.view)!=null&&oa.filterMultiple&&Pr.type==="radio-button"&&p.view.filterMultiple.isHomeTeam!==void 0){const En=p.view.filterMultiple.isHomeTeam?1:2,na=((Yn=Pr.options)==null?void 0:Yn.map(ma=>ma.value))||[];return na.includes(En)?En:na[0]||1}return((wr=(qr=Pr.options)==null?void 0:qr[0])==null?void 0:wr.value)??null}else if(Pr.type==="check"){if(a.value&&c&&c.dynamicFilters){const En=c.dynamicFilters[sn];if(En&&En.isChecked!==void 0)return En.isChecked}if(St.id===8)return!0;if(St.id===3){if(a.value&&c&&c.dynamicFilters){const En=c.dynamicFilters[sn];if(En&&En.isChecked!==void 0)return En.isChecked}return!1}return!1}return null}),!((Yt=St.name)!=null&&Yt.toLowerCase().includes("tops players")||(er=St.title)!=null&&er.toLowerCase().includes("tops players"))&&(!a.value||or)&&t.nextTick(()=>{var Pr,sn;St.id===4&&a.value&&(Pr=p==null?void 0:p.view)!=null&&Pr.id&&i&&i.setDynamicFilters(E.value,p.view.id),St.id===3&&a.value&&(sn=p==null?void 0:p.view)!=null&&sn.id&&i&&i.setDynamicFilters(E.value,p.view.id),Ye()}))},{immediate:!0}),t.watch(()=>i,St=>{St&&St.dynamicFilters&&Array.isArray(St.dynamicFilters)&&(x.value=!0,E.value=[...St.dynamicFilters],t.nextTick(()=>{x.value=!1}))},{deep:!0}),t.watch(()=>i==null?void 0:i.dynamicFilters,St=>{if(St&&Array.isArray(St)){if(d.value)return;x.value=!0,E.value=[...St],t.nextTick(()=>{x.value=!1})}},{deep:!0}),t.watch(()=>L.value,St=>{if(a.value&&c&&St&&St.filters){if(x.value||o.value)return;if(St.id===3){if(d.value||o.value)return;const Yt=c.dynamicFilters.find(er=>er.filterType==="check");Yt&&Yt.isChecked!==void 0&&E.value&&E.value.length>0&&(d.value=!0,E.value[0]=Yt.isChecked,t.nextTick(()=>{E.value=[...E.value],d.value=!1}))}setTimeout(()=>{(!E.value||E.value.length===0)&&($t(),Zt(),Tt()),St.id===4&&Rt()},100)}},{deep:!0}),t.watch(()=>{var St;return(St=L.value)==null?void 0:St.id},St=>{if(a.value&&c&&St===4){if(x.value||o.value)return;setTimeout(()=>{Rt()},200)}}),t.watch(()=>E.value,St=>{if(a.value&&c&&St&&St.length>0){if(x.value||d.value||o.value)return;setTimeout(()=>{var Yt;It()&&($t(),Zt(),Tt(),((Yt=L.value)==null?void 0:Yt.id)===4&&Rt())},50)}},{deep:!0});function V(St,Yt){var er,or,Or,Pr,sn;const qn=E.value[St];if((er=L.value)==null||er.id,(or=L.value)==null||or.id,Array.isArray(qn)){if(((Or=L.value)==null?void 0:Or.id)===4&&St===0){const jn=qn.some(ba=>{if(Yt.category_id&&Yt.event_type_id){if(ba.category_id&&ba.event_type_id)return ba.category_id===Yt.category_id&&ba.event_type_id===Yt.event_type_id;if(ba.event_type_id&&!ba.category_id)return ba.event_type_id===Yt.event_type_id;if(ba.category_id&&!ba.event_type_id)return ba.category_id===Yt.category_id}else{if(Yt.event_type_id)return ba.event_type_id===Yt.event_type_id;if(Yt.category_id)return ba.category_id===Yt.category_id}return JSON.stringify(ba)===JSON.stringify(Yt)});return(Pr=L.value)==null||Pr.id,jn}return qn.includes(Yt)}else if(qn!=null)return(sn=L.value)==null||sn.id,qn===Yt;return!1}function I(St,Yt){var er,or,Or;const Pr=(or=(er=L.value)==null?void 0:er.filters)==null?void 0:or[St];if((Pr==null?void 0:Pr.type)==="select-simple"){rt(St,Yt);return}Array.isArray(E.value[St])||(E.value[St]=[]);const sn=E.value[St];let qn=-1;((Or=L.value)==null?void 0:Or.id)===4&&St===0?qn=sn.findIndex(jn=>Yt.category_id&&Yt.event_type_id?jn.category_id===Yt.category_id&&jn.event_type_id===Yt.event_type_id:Yt.event_type_id?jn.event_type_id===Yt.event_type_id:Yt.category_id?jn.category_id===Yt.category_id:!1):qn=sn.indexOf(Yt),qn>-1?sn.splice(qn,1):sn.push(Yt),a.value&&Pt(),Ye()}function j(St){var Yt,er;const or=E.value[St],Or=(er=(Yt=L.value)==null?void 0:Yt.filters)==null?void 0:er[St];return(Or==null?void 0:Or.type)==="select-simple"||!Or||!Or.options||!Array.isArray(or)?!1:or.length===Or.options.length}function U(St){var Yt,er;const or=E.value[St],Or=(er=(Yt=L.value)==null?void 0:Yt.filters)==null?void 0:er[St];return(Or==null?void 0:Or.type)==="select-simple"||!Or||!Or.options||!Array.isArray(or)?!1:or.length>0&&or.length<Or.options.length}function D(){var St;return!(((St=L.value)==null?void 0:St.id)===6&&v.isPostMatch)}function F(St){return!St||!Array.isArray(St)?St:St.filter(Yt=>{const er=(Yt.name||Yt.title||"").toLowerCase();return v.isPostMatch?!0:!["resumen general","timeline","datos relevantes"].some(or=>er.includes(or))})}function z(){var St,Yt;const er=((Yt=(St=f.value)==null?void 0:St.name)==null?void 0:Yt.toLowerCase())||"";return er.includes("cancha")||er.includes("volumétrica")||er.includes("volumetric")}function X(St,Yt){if(!a.value||!z())return!1;const er=String(St||"").toLowerCase(),or=String(Yt||"").toLowerCase();return er.includes("ambos")||or.includes("ambos")}function M(St){var Yt,er;const or=(er=(Yt=L.value)==null?void 0:Yt.filters)==null?void 0:er[St];if(!or||!or.options)return;const Or=or.options.map(Pr=>Pr.value);Array.isArray(E.value[St])||(E.value[St]=[]),j(St)?E.value[St]=[]:E.value[St]=[...Or],ge.value=St,Ye()}const Y=t.ref("ambos"),se=t.ref(!1),me=t.ref(!1),ge=t.ref(null),be=t.ref(null);function xe(St,Yt=!1){const er="https://golstatsimages.blob.core.windows.net/images-library/",or="https://golstatsimages.blob.core.windows.net/reports-images/",Or={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"},Pr=Object.keys(Or).find(sn=>St==null?void 0:St.toLowerCase().includes(sn.toLowerCase()));if(Pr){const sn=Or[Pr],qn=Yt?"":"-def";return Pr.toLowerCase().includes("tabla")?`${or}${sn}${qn}@2x.png`:`${er}${sn}${qn}@2x.png`}return`${er}icn_default${Yt?"":"-def"}.png`}function Pe(){return f.value?f.value.name:"Tipo de vista"}function je(){return L.value?L.value.name||L.value.title:"Visualización"}function _e(){a.value||(se.value=!se.value,se.value&&(me.value=!1,t.nextTick(()=>{Jt()})))}function Ue(){a.value||f.value&&(me.value=!me.value,me.value&&(se.value=!1))}function qe(St){a.value||(s.value=St,se.value=!1,S.value=null,Ye())}function Re(St){var Yt,er;a.value||(S.value=St.id,me.value=!1,(Yt=St.name)!=null&&Yt.toLowerCase().includes("tops players")||(er=St.title)==null||er.toLowerCase().includes("tops players"))}function We(St){var Yt;ge.value=ge.value===St?null:St,((Yt=L.value)==null?void 0:Yt.id)===4&&a.value&&St===0&&setTimeout(()=>{E.value=[...E.value]},50)}function Qe(St){be.value=be.value===St?null:St}function rt(St,Yt){var er,or,Or,Pr,sn;if(((er=L.value)==null?void 0:er.id)===2){const qn=P.value.findIndex(jn=>jn.type==="select-simple"&&jn.label==="Tipo de análisis");St===qn?E.value[0]=Yt:E.value[St]=Yt}else if(((or=L.value)==null?void 0:or.id)===1)E.value[0]=Yt;else if(((Or=L.value)==null?void 0:Or.id)===6)E.value[0]=Yt;else if(((Pr=L.value)==null?void 0:Pr.id)===9)if(St===0){Array.isArray(Yt)?E.value[St]=Yt:E.value[St]=[Yt];const qn=((sn=P.value[St])==null?void 0:sn.options)||[],jn=Array.isArray(Yt)?Yt:[Yt],ba=qn.find(fa=>Array.isArray(fa.value)?hr(fa.value,jn):jn.includes(fa.value));ba?E.value[St]=ba.value:E.value[St]=jn}else E.value[St]=Yt;else E.value[St]=Yt;be.value=null,a.value&&Pt(),Ye()}function dt(St){St.target.closest(".custom-select")||(se.value=!1,me.value=!1,be.value=null)}const ut=[16,18];function Ye(){var St,Yt,er,or,Or,Pr,sn,qn,jn,ba,fa,Ia,en,Ur,mn,Vn,Jn,Cn,Xr,un,kr,dn;if(ut.includes((St=L.value)==null?void 0:St.id)||x.value)return;let Gn=[],Dn=[];L.value&&Array.isArray(P.value)&&P.value.forEach((wr,En)=>{if(wr.type==="select"&&wr.label==="Tipo de análisis"&&wr.id===2){const na=E.value[En]||[];Array.isArray(na)&&na.length>0&&(Gn=na.map(ma=>{var ea;const Ha=(ea=wr.options)==null?void 0:ea.find(Pa=>Pa.value===ma);return{value:ma,label:(Ha==null?void 0:Ha.label)||ma}}))}});const oa=((Yt=L.value)==null?void 0:Yt.id)===4;if(L.value&&Array.isArray(L.value.filters)&&L.value.filters.some(wr=>wr.type==="select"&&wr.label==="Tipo de análisis"&&wr.id===2)&&Gn.length===0&&!oa)return;if(oa&&E.value&&E.value.length>0){const wr=E.value[0];Array.isArray(wr)&&wr.length>0}Dn=((er=P.value)==null?void 0:er.map((wr,En)=>{var na,ma,ea,Ha;const Pa=E.value[En];let Ya=wr.id||`filter_${En}`;return((na=L.value)==null?void 0:na.id)===3&&a.value&&(ma=p==null?void 0:p.view)!=null&&ma.id&&(Ya=`filter_${En}_component_${p.view.id}`),{filterId:Ya,filterType:wr.type,filterLabel:wr.label,filterIcon:wr.icon||null,selectedValue:Pa,selectedOptions:wr.type==="select"&&Array.isArray(Pa)&&Pa.length>0?Pa.map(Aa=>{var Da;const Ni=(Da=wr.options)==null?void 0:Da.find(Pi=>Pi.value===Aa);return{value:Aa,label:(Ni==null?void 0:Ni.label)||Aa,icon:(Ni==null?void 0:Ni.icon)||null}}):null,selectedOption:wr.type==="radio-button"&&Pa!=null?{value:Pa,label:((Ha=(ea=wr.options)==null?void 0:ea.find(Aa=>Aa.value===Pa))==null?void 0:Ha.label)||Pa}:null,isChecked:wr.type==="check"?Pa:null}}))||[];const Yn={mainSelector:{id:((or=f.value)==null?void 0:or.id)||null,name:((Or=f.value)==null?void 0:Or.name)||null,url:((Pr=f.value)==null?void 0:Pr.url)||null},viewSelector:{id:((sn=L.value)==null?void 0:sn.id)||null,name:((qn=L.value)==null?void 0:qn.name)||((jn=L.value)==null?void 0:jn.title)||null,url:((ba=L.value)==null?void 0:ba.url)||null},team:Y.value,dynamicFilters:Dn,categoriasSeleccionadas:Gn,timestamp:new Date().toISOString(),summary:{mainSelected:!!f.value,viewSelected:!!L.value,totalDynamicFilters:((fa=P.value)==null?void 0:fa.length)||0,activeFilters:((Ia=P.value)==null?void 0:Ia.filter((wr,En)=>{const na=E.value[En];return Array.isArray(na)?na.length>0:na!=null&&na!==!1}).length)||0}},qr={main:f.value,view:L.value,team:Y.value,dynamicFilters:E.value,filtersJSON:Yn,filterAndViewsContainer:i,viewToEdit:p};if($("filters-changed",qr),a.value&&p){if(c=Yn,((en=L.value)==null?void 0:en.id)===2){const wr=c.dynamicFilters.findIndex(En=>En.filterType==="select-simple"&&En.filterLabel==="Tipo de análisis");wr!==-1&&(mn=(Ur=p.view)==null?void 0:Ur.filterMultiple)!=null&&mn.categoryId&&(c.dynamicFilters[wr].selectedValue=p.view.filterMultiple.categoryId)}if(((Vn=L.value)==null?void 0:Vn.id)===1){const wr=c.dynamicFilters.findIndex(En=>En.filterType==="select-simple"&&En.filterLabel==="Tipo de análisis");wr!==-1&&(Cn=(Jn=p.view)==null?void 0:Jn.filterMultiple)!=null&&Cn.category&&(c.dynamicFilters[wr].selectedValue=p.view.filterMultiple.category)}}if(((Xr=L.value)==null?void 0:Xr.id)===6&&a.value&&(un=p==null?void 0:p.view)!=null&&un.filterMultiple&&p.view.filterMultiple.gameNumber&&c){const wr=c.dynamicFilters.findIndex(En=>En.filterType==="select-simple"&&En.filterLabel==="Número de juego");wr!==-1&&(dn=(kr=p.view)==null?void 0:kr.filterMultiple)!=null&&dn.gameNumber&&(c.dynamicFilters[wr].selectedValue=p.view.filterMultiple.gameNumber)}i&&!a.value?i.setDynamicFilters(E.value):i&&a.value}function st(){p=null,c=null,i=null,s.value=null,S.value=null,Y.value="ambos",E.value=[],se.value=!1,me.value=!1,ge.value=null,be.value=null,a.value=!1,k.value=!1,T.value=!1}function lt(St){if(St&&St.dynamicFilters){if(d.value)return;Array.isArray(St.dynamicFilters)&&St.dynamicFilters.length>0&&(x.value=!0,E.value=[...St.dynamicFilters],t.nextTick(()=>{x.value=!1}))}}function Ot(St){if(a.value=!0,St.mainSelector&&St.mainSelector.id){const Yt=u.value.findIndex(er=>er.id===St.mainSelector.id);Yt!==-1&&(s.value=Yt)}St.viewSelector&&St.viewSelector.id&&f.value&&f.value.views.findIndex(Yt=>Yt.id===St.viewSelector.id)!==-1&&(S.value=St.viewSelector.id),St.dynamicFilters&&Array.isArray(St.dynamicFilters)&&t.nextTick(()=>{setTimeout(()=>{var Yt,er,or,Or,Pr,sn,qn,jn,ba,fa,Ia,en,Ur,mn,Vn,Jn,Cn,Xr,un,kr,dn,Gn,Dn;if(L.value&&P.value){if(x.value)return;if(d.value=!0,St.dynamicFilters.forEach((oa,Yn)=>{var qr,wr,En,na,ma,ea,Ha,Pa,Ya,Aa,Da,Ni,Pi;if(Yn<P.value.length){const Po=P.value[Yn];if(((qr=L.value)==null?void 0:qr.id)===3&&a.value,Po.type==="check"){const So=oa.isChecked;typeof So=="boolean"&&(E.value[Yn]=So)}else if(Po.type==="select"&&oa.selectedOptions){const So=oa.selectedOptions.map(zo=>zo.value);E.value[Yn]=So}else if(Po.type==="select"&&oa.selectedValue&&Array.isArray(oa.selectedValue))if(oa.selectedValue.length>0&&oa.selectedValue[0]&&typeof oa.selectedValue[0]=="object"){const So=lr(oa.selectedValue);E.value[Yn]=So}else E.value[Yn]=oa.selectedValue;else if(Po.type==="radio-button"&&oa.selectedOption)E.value[Yn]=oa.selectedOption.value;else if(Po.type==="select-simple"&&oa.selectedValue!==void 0){let So;((wr=L.value)==null?void 0:wr.id)===2&&(na=(En=p==null?void 0:p.view)==null?void 0:En.filterMultiple)!=null&&na.categoryId?So=p.view.filterMultiple.categoryId:((ma=L.value)==null?void 0:ma.id)===1&&(Ha=(ea=p==null?void 0:p.view)==null?void 0:ea.filterMultiple)!=null&&Ha.category?So=p.view.filterMultiple.category:((Pa=L.value)==null?void 0:Pa.id)===6&&(Aa=(Ya=p==null?void 0:p.view)==null?void 0:Ya.filterMultiple)!=null&&Aa.gameNumber?So=p.view.filterMultiple.gameNumber:((Da=L.value)==null?void 0:Da.id)===9&&(Pi=(Ni=p==null?void 0:p.view)==null?void 0:Ni.filterMultiple)!=null&&Pi.categoryIds?So=p.view.filterMultiple.categoryIds:So=Array.isArray(oa.selectedValue)?oa.selectedValue[0]:oa.selectedValue,E.value[Yn]=So}}}),((Yt=L.value)==null?void 0:Yt.id)===3&&a.value,((er=L.value)==null?void 0:er.id)===2&&a.value&&(or=p==null?void 0:p.view)!=null&&or.filterMultiple){if(p.view.filterMultiple.categoryId){const oa=P.value.findIndex(Yn=>Yn.type==="select-simple"&&Yn.label==="Tipo de análisis");if(oa!==-1){const Yn=p.view.filterMultiple.categoryId;if(E.value[0]=Yn,p.view.componentProps&&Yn){let qr=`Category ${Yn}`,wr=null;try{wr=A4(Yn),wr&&(qr=wr.name)}catch{const En=P.value.findIndex(na=>na.type==="select-simple"&&na.label==="Tipo de análisis");if(En!==-1){const na=(((Or=P.value[En])==null?void 0:Or.options)||[]).find(ma=>ma.value==Yn);na&&(qr=na.label)}}p.view.componentProps.categoryView=[{id:Yn,name:qr}]}(((Pr=P.value[oa])==null?void 0:Pr.options)||[]).find(qr=>qr.value==Yn),t.nextTick(()=>{E.value=[...E.value]})}}if(p.view.filterMultiple.teamType!==void 0){const oa=P.value.findIndex(Yn=>Yn.type==="radio-button");if(oa!==-1){const Yn=p.view.filterMultiple.teamType;E.value[oa]=Yn,(((sn=P.value[oa])==null?void 0:sn.options)||[]).find(qr=>qr.value==Yn),t.nextTick(()=>{E.value=[...E.value]})}}}if(((qn=L.value)==null?void 0:qn.id)===9&&a.value&&(jn=p==null?void 0:p.view)!=null&&jn.filterMultiple){if(p.view.filterMultiple.categoryIds){const oa=P.value.findIndex(Yn=>Yn.type==="select-simple");if(oa!==-1){const Yn=Array.isArray(p.view.filterMultiple.categoryIds)?p.view.filterMultiple.categoryIds:[p.view.filterMultiple.categoryIds];E.value[0]=Yn;const qr=(((ba=P.value[oa])==null?void 0:ba.options)||[]).filter(En=>Array.isArray(En.value)?hr(En.value,Yn):Yn.includes(En.value));if(qr.length>0){const En=qr[0].value;E.value[oa]=En}else E.value[oa]=Yn;const wr=E.value[oa];hr(wr,Yn),t.nextTick(()=>{E.value=[...E.value]})}}if(p.view.filterMultiple.isHomeTeam!==void 0){const oa=P.value.findIndex(Yn=>Yn.type==="radio-button");if(oa!==-1){const Yn=p.view.filterMultiple.isHomeTeam;let qr;typeof Yn=="boolean"?qr=Yn?1:2:typeof Yn=="number"?qr=Yn===1?1:2:qr=1,E.value[oa]=qr,(((fa=P.value[oa])==null?void 0:fa.options)||[]).find(wr=>wr.value==qr),t.nextTick(()=>{E.value=[...E.value]})}}}if(((Ia=L.value)==null?void 0:Ia.id)===1&&a.value&&(en=p==null?void 0:p.view)!=null&&en.filterMultiple&&p.view.filterMultiple.category){const oa=P.value.findIndex(Yn=>Yn.type==="select-simple"&&Yn.label==="Tipo de análisis");if(oa!==-1){const Yn=p.view.filterMultiple.category;E.value[0]=Yn,p.view.componentProps&&Yn&&(p.view.componentProps.type=Yn),(((Ur=P.value[oa])==null?void 0:Ur.options)||[]).find(qr=>qr.value==Yn),t.nextTick(()=>{E.value=[...E.value]})}}if(((mn=L.value)==null?void 0:mn.id)===6&&a.value&&(Vn=p==null?void 0:p.view)!=null&&Vn.filterMultiple&&p.view.filterMultiple.gameNumber){const oa=P.value.findIndex(Yn=>Yn.type==="select-simple"&&Yn.label==="Número de juego");if(oa!==-1){const Yn=p.view.filterMultiple.gameNumber;E.value[0]=Yn,p.view.componentProps&&Yn&&(p.view.componentProps.gameNumber=Yn),(((Jn=P.value[oa])==null?void 0:Jn.options)||[]).find(qr=>qr.value==Yn),t.nextTick(()=>{E.value=[...E.value]})}}if(((Cn=L.value)==null?void 0:Cn.id)===7&&a.value&&p!=null&&p.view){if((Xr=p.view.componentProps)!=null&&Xr.analysisType&&P.value.length>0&&((un=P.value[0])==null?void 0:un.type)==="radio-button"){const oa=p.view.componentProps.analysisType==="offensive"?1:2;E.value[0]=oa}if(((kr=p.view.filterMultiple)==null?void 0:kr.isHomeTeam)!==void 0){const oa=P.value.findIndex(Yn=>Yn.type==="radio-button"&&Yn.label==="Equipo");if(oa!==-1){const Yn=p.view.filterMultiple.isHomeTeam?1:2;E.value[1]=Yn}else if(P.value.length>1&&((dn=P.value[1])==null?void 0:dn.type)==="radio-button"){const Yn=p.view.filterMultiple.isHomeTeam,qr=Yn?1:2;E.value[1]=qr,p.view.componentProps&&(p.view.componentProps.isHomeTeamForAnalysis=Yn),(((Gn=P.value[1])==null?void 0:Gn.options)||[]).find(wr=>wr.value==qr),t.nextTick(()=>{E.value=[...E.value]})}if(oa!==-1&&p.view.componentProps){const Yn=p.view.filterMultiple.isHomeTeam,qr=Yn?1:2;p.view.componentProps.isHomeTeamForAnalysis=Yn,(((Dn=P.value[oa])==null?void 0:Dn.options)||[]).find(wr=>wr.value==qr),t.nextTick(()=>{E.value=[...E.value]})}}}t.nextTick(()=>{d.value=!1})}},100)})}function zt(){var St,Yt,er,or,Or,Pr,sn,qn,jn,ba;return{mainSelector:{id:((St=f.value)==null?void 0:St.id)||null,name:((Yt=f.value)==null?void 0:Yt.name)||null,url:((er=f.value)==null?void 0:er.url)||null},viewSelector:{id:((or=L.value)==null?void 0:or.id)||null,name:((Or=L.value)==null?void 0:Or.name)||((Pr=L.value)==null?void 0:Pr.title)||null,url:((sn=L.value)==null?void 0:sn.url)||null},team:Y.value,dynamicFilters:((qn=P.value)==null?void 0:qn.map((fa,Ia)=>{var en,Ur;const mn=E.value[Ia];return{filterId:fa.id||`filter_${Ia}`,filterType:fa.type,filterLabel:fa.label,filterIcon:fa.icon||null,selectedValue:mn,selectedOptions:fa.type==="select"&&Array.isArray(mn)&&mn.length>0?mn.map(Vn=>{var Jn;const Cn=(Jn=fa.options)==null?void 0:Jn.find(Xr=>Xr.value===Vn);return{value:Vn,label:(Cn==null?void 0:Cn.label)||Vn,icon:(Cn==null?void 0:Cn.icon)||null}}):null,selectedOption:fa.type==="radio-button"&&mn?{value:mn,label:((Ur=(en=fa.options)==null?void 0:en.find(Vn=>Vn.value===mn))==null?void 0:Ur.label)||mn}:null,isChecked:fa.type==="check"?mn:null}}))||[],timestamp:new Date().toISOString(),summary:{mainSelected:!!f.value,viewSelected:!!L.value,totalDynamicFilters:((jn=P.value)==null?void 0:jn.length)||0,activeFilters:((ba=P.value)==null?void 0:ba.filter((fa,Ia)=>{const en=E.value[Ia];return Array.isArray(en)?en.length>0:en!=null&&en!==!1}).length)||0}}}r({getCurrentFiltersJSON:zt});function Et(){st(),$("close",i)}function qt(){k.value=!1,Et()}function Gt(){T.value&&(Sd.emit("filters-cancelled",i),T.value=!1),k.value=!1,Et()}t.onMounted(async()=>{document.addEventListener("click",dt),t.nextTick(()=>{Jt()});const St="https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/views";try{const Yt=await(await fetch(St,{headers:{Authorization:`${v.token}`}})).json();u.value=Yt.data||[],h.value.clear(),u.value&&(h.value=u.value.reduce((er,or)=>(or.views&&Array.isArray(or.views)&&or.views.forEach(Or=>{Or.filters&&Array.isArray(Or.filters)&&er.set(Or.id,Or)}),er),new Map))}catch(Yt){console.error("Error al obtener datos:",Yt)}});function Jt(){document.querySelectorAll(".field-menu .option-card").forEach(St=>{const Yt=St.querySelector(".option-img");if(!Yt||!Yt.dataset.hoverSrc)return;const er=Yt.src,or=Yt.dataset.hoverSrc;St.addEventListener("mouseenter",()=>{Yt.src=or}),St.addEventListener("mouseleave",()=>{Yt.src=er})})}t.onUnmounted(()=>{document.removeEventListener("click",dt)}),Sd.on("set-filter-and-views-container",St=>{i=St,St&&lt(St)}),Sd.on("view-added",()=>{k.value=!0,T.value=!0}),Sd.on("component-added-to-container",St=>{(!a.value||i&&St.id===i.id)&&lt(St)}),Sd.on("edit-view",St=>{var Yt,er,or,Or,Pr,sn,qn,jn,ba,fa,Ia,en,Ur,mn,Vn,Jn,Cn,Xr,un,kr,dn,Gn,Dn;console.log("on edit-view event received for view:",St),p=St,i=((Yt=St.view)==null?void 0:Yt.filterAndViewsContainer)||null,c=null;const oa=[(or=(er=St.view)==null?void 0:er.coreView)==null?void 0:or.filtersJSON,(Or=St.view)==null?void 0:Or.filtersJSON,(Pr=St.coreView)==null?void 0:Pr.filtersJSON,St.filtersJSON,(qn=(sn=St.view)==null?void 0:sn.componentProps)==null?void 0:qn.filtersJSON];for(const Yn of oa)if(Yn){c=Yn;break}if(i&&(i.viewId===4||i.viewId===8||i.viewId===3||i.viewId===1||i.viewId===2||i.viewId===13)&&(jn=St.view)!=null&&jn.id){const Yn=i.getComponentDynamicFilters(St.view.id);if(Yn){let qr="Unknown";i.viewId===4?qr="Timeline":i.viewId===8?qr="FieldPosesion":i.viewId===3?qr="GSCMatchSummary":i.viewId===1?qr="GSCComparativeReports":i.viewId===2?qr="GscTopPlayer":i.viewId===13&&(qr="GSCTimelapseTable"),c&&(i.viewId===13?c={...c,dynamicFilters:Yn}:c={...c,dynamicFilters:Yn.map((wr,En)=>Array.isArray(wr)?{selectedValue:wr,selectedOptions:wr.map(na=>({value:na,label:na}))}:typeof wr=="boolean"?{isChecked:wr}:qr==="GSCComparativeReports"&&En===0?{selectedValue:wr,selectedOptions:[{value:wr,label:wr}]}:qr==="GscTopPlayer"&&En===0?{selectedValue:wr,selectedOptions:[{value:wr,label:wr}]}:qr==="GscTopPlayer"&&En===1?{selectedOption:{value:wr,label:wr}}:{selectedOption:{value:wr,label:wr}})})}}if(i&&i.viewId===2&&(ba=St.view)!=null&&ba.filterMultiple){if(St.view.filterMultiple.categoryId&&c){const Yn=c.dynamicFilters.findIndex(qr=>qr.filterType==="select-simple"&&qr.filterLabel==="Tipo de análisis");Yn!==-1&&(c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedValue:St.view.filterMultiple.categoryId,selectedOptions:[{value:St.view.filterMultiple.categoryId,label:`Category ${St.view.filterMultiple.categoryId}`}]})}if(St.view.filterMultiple.teamType!==void 0&&c){const Yn=c.dynamicFilters.findIndex(qr=>qr.filterType==="radio-button");if(Yn!==-1){const qr=St.view.filterMultiple.teamType,wr=qr===1?"Mi equipo":qr===2?"Rival":qr===3?"Ambos":"Equipo";c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedOption:{value:qr,label:wr}}}}}if(i&&i.viewId===1&&(fa=St.view)!=null&&fa.filterMultiple&&St.view.filterMultiple.category&&c){const Yn=c.dynamicFilters.findIndex(qr=>qr.filterType==="select-simple"&&qr.filterLabel==="Tipo de análisis");Yn!==-1&&(c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedValue:St.view.filterMultiple.category,selectedOptions:[{value:St.view.filterMultiple.category,label:St.view.filterMultiple.category}]})}if(i&&i.viewId===9&&(Ia=St.view)!=null&&Ia.filterMultiple){if(St.view.filterMultiple.categoryIds&&c){const Yn=c.dynamicFilters.findIndex(qr=>qr.filterType==="select"&&qr.filterLabel==="Tipo de análisis");if(Yn!==-1){const qr=Array.isArray(St.view.filterMultiple.categoryIds)?St.view.filterMultiple.categoryIds:[St.view.filterMultiple.categoryIds];c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedValue:qr,selectedOptions:qr.map(na=>({value:na,label:`Category ${na}`}))};const wr=St.view.filterMultiple.categoryIds;hr(wr,qr);const En=(((en=P.value[Yn])==null?void 0:en.options)||[]).filter(na=>Array.isArray(na.value)?hr(na.value,qr):qr.includes(na.value));if(En.length>0){const na=En[0];c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedValue:na.value,selectedOptions:[na]}}}}if(St.view.filterMultiple.isHomeTeam!==void 0&&c){const Yn=c.dynamicFilters.findIndex(qr=>qr.filterType==="radio-button");if(Yn!==-1){const qr=St.view.filterMultiple.isHomeTeam;let wr,En;typeof qr=="boolean"?(wr=qr?1:2,En=qr?"Mi equipo":"Rival"):typeof qr=="number"?(wr=qr===1?1:2,En=qr===1?"Mi equipo":"Rival"):(wr=1,En="Mi equipo"),c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedOption:{value:wr,label:En}}}}}if(i&&i.viewId===6&&(Ur=St.view)!=null&&Ur.filterMultiple&&St.view.filterMultiple.gameNumber&&c){const Yn=c.dynamicFilters.findIndex(qr=>qr.filterType==="select-simple"&&qr.filterLabel==="Número de juego");Yn!==-1&&(c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedValue:St.view.filterMultiple.gameNumber,selectedOptions:[{value:St.view.filterMultiple.gameNumber,label:`Juego ${St.view.filterMultiple.gameNumber}`}]})}if(i&&i.viewId===7&&St.view&&c){if((mn=St.view.componentProps)!=null&&mn.analysisType){const Yn=c.dynamicFilters.findIndex((qr,wr)=>qr.filterType==="radio-button"&&wr===0);if(Yn!==-1){const qr=St.view.componentProps.analysisType,wr=qr==="offensive"?1:2,En=qr==="offensive"?"A favor":"En contra";c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedOption:{value:wr,label:En}}}}if(((Vn=St.view.filterMultiple)==null?void 0:Vn.isHomeTeam)!==void 0){const Yn=c.dynamicFilters.findIndex(qr=>qr.filterType==="radio-button"&&qr.filterLabel==="Equipo");if(Yn!==-1){const qr=St.view.filterMultiple.isHomeTeam,wr=qr?1:2,En=qr?"Equipo propio":"Equipo rival";c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedOption:{value:wr,label:En}}}}}if(i&&i.viewId===10&&(Jn=St.view)!=null&&Jn.filterMultiple&&((Xr=(Cn=p==null?void 0:p.view)==null?void 0:Cn.coreView)==null?void 0:Xr.id)===10){const Yn=St.view.componentProps.isHomeTeamForAnalysis?{label:"Equipo propio",value:1}:{label:"Rival",value:2};c&&(c.dynamicFilters[0]={...c.dynamicFilters[0],selectedOption:Yn})}if(i&&i.viewId===15&&(un=St.view)!=null&&un.id){const Yn=i.getComponentDynamicFilters(St.view.id);if(Yn&&c)c={...c,dynamicFilters:Yn.map((qr,wr)=>{var En,na;if(wr===0){let ma=qr;if(qr===3&&((na=(En=St.view)==null?void 0:En.filterMultiple)==null?void 0:na.isHomeTeam)!==void 0){const ea=St.view.filterMultiple.isHomeTeam;typeof ea=="boolean"?ma=ea?1:2:typeof ea=="number"&&(ma=ea===1?1:2)}return{selectedOption:{value:ma,label:ma===1?"Mi equipo":"Rival"}}}else if(wr===1)return{selectedValue:qr,selectedOptions:[{value:qr,label:`${qr} fortalezas`}]};return typeof qr=="number"?{selectedValue:qr}:{selectedOption:{value:qr,label:String(qr)}}})};else if((kr=St.view)!=null&&kr.filterMultiple&&c&&St.view.filterMultiple.isHomeTeam!==void 0){const qr=c.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button"&&wr.filterLabel==="Mi equipo");if(qr!==-1){const wr=St.view.filterMultiple.isHomeTeam;let En,na;typeof wr=="boolean"?(En=wr?1:2,na=wr?"Local":"Visitante"):typeof wr=="number"?(En=wr===1?1:2,na=wr===1?"Local":"Visitante"):(En=1,na="Local"),c.dynamicFilters[qr]={...c.dynamicFilters[qr],selectedOption:{value:En,label:na}}}}}if(i&&i.viewId===17&&(dn=St.view)!=null&&dn.id){const Yn=i.getComponentDynamicFilters(St.view.id);if(Yn&&c)console.log("Edit filters opt 1",c),c={...c,dynamicFilters:Yn.map((qr,wr)=>{var En,na,ma,ea,Ha,Pa;const Ya=(En=P.value)==null?void 0:En[wr];if(Ya&&Ya.type==="radio-button"){let Aa=qr;if(qr===3&&((ma=(na=St.view)==null?void 0:na.filterMultiple)==null?void 0:ma.isHomeTeam)!==void 0){const Da=St.view.filterMultiple.isHomeTeam;typeof Da=="boolean"?Aa=Da?1:2:typeof Da=="number"&&(Aa=Da===1?1:2)}return{selectedOption:{value:Aa,label:Aa===1?"Mi equipo":Aa===2?"Rival":"Ambos"}}}else if(wr===2){let Aa=qr;if((qr===3||qr!==1&&qr!==2&&(ea=St.view)!=null&&ea.filterMultiple)&&((Pa=(Ha=St.view)==null?void 0:Ha.filterMultiple)==null?void 0:Pa.isHomeTeam)!==void 0){const Da=St.view.filterMultiple.isHomeTeam;typeof Da=="boolean"?Aa=Da?1:2:typeof Da=="number"&&(Aa=Da===1?1:2)}return Ya&&Ya.type==="select-simple"?{selectedValue:Aa,selectedOptions:[{value:Aa,label:String(Aa)}]}:Ya&&Ya.type==="radio-button"?{selectedOption:{value:Aa,label:Aa===1?"Mi equipo":Aa===2?"Rival":"Ambos"}}:typeof Aa=="number"?{selectedValue:Aa}:{selectedOption:{value:Aa,label:String(Aa)}}}else{if(Ya&&Ya.type==="switch")return typeof qr=="boolean"?{selectedValue:qr}:{selectedValue:qr};if(Ya&&Ya.type==="check")return typeof qr=="boolean"?{selectedValue:qr}:{selectedValue:qr}}return Array.isArray(qr)?{selectedValue:qr,selectedOptions:qr.map(Aa=>({value:Aa,label:String(Aa)}))}:typeof qr=="boolean"?{selectedValue:qr}:typeof qr=="object"&&qr!==null?qr:typeof qr=="number"?{selectedValue:qr}:{selectedOption:{value:qr,label:String(qr)}}})},console.log("Edit filters opt 1 finla --->",c);else if((Gn=St.view)!=null&&Gn.filterMultiple&&c&&(console.log("Edit filters opt 1 multiple"),St.view.filterMultiple.isHomeTeam!==void 0)){const qr=c.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button");if(qr!==-1){const wr=St.view.filterMultiple.isHomeTeam;let En,na;typeof wr=="boolean"?(En=wr?1:2,na=wr?"Mi equipo":"Rival"):typeof wr=="number"?(En=wr===1?1:2,na=wr===1?"Mi equipo":"Rival"):(En=1,na="Mi equipo"),c.dynamicFilters[qr]={...c.dynamicFilters[qr],selectedOption:{value:En,label:na}}}}}if(i&&i.viewId===5&&(Dn=St.view)!=null&&Dn.filterMultiple&&St.view.filterMultiple.isHomeTeam!==void 0&&c){const Yn=c.dynamicFilters.findIndex(qr=>qr.filterType==="radio-button"&&qr.filterLabel==="Equipo");if(Yn!==-1){const qr=St.view.filterMultiple.isHomeTeam;let wr,En;typeof qr=="boolean"?(wr=qr?1:2,En=qr?"Equipo propio":"Equipo rival"):typeof qr=="number"?(wr=qr===1?1:2,En=qr===1?"Equipo propio":"Equipo rival"):(wr=1,En="Equipo propio"),c.dynamicFilters[Yn]={...c.dynamicFilters[Yn],selectedOption:{value:wr,label:En}}}else{const qr=c.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button");if(qr!==-1){const wr=St.view.filterMultiple.isHomeTeam;let En,na;typeof wr=="boolean"?(En=wr?1:2,na=wr?"Equipo propio":"Equipo rival"):typeof wr=="number"?(En=wr===1?1:2,na=wr===1?"Equipo propio":"Equipo rival"):(En=1,na="Equipo propio"),c.dynamicFilters[qr]={...c.dynamicFilters[qr],selectedOption:{value:En,label:na}}}}}c&&Ot(c),k.value=!0});function Qt(){ge.value=null}function sr(St,Yt){var er;(er=L.value)==null||er.id}function hr(St,Yt){if(!Array.isArray(St)||!Array.isArray(Yt)||St.length!==Yt.length)return!1;const er=[...St].sort((Or,Pr)=>Or-Pr),or=[...Yt].sort((Or,Pr)=>Or-Pr);return JSON.stringify(er)===JSON.stringify(or)}function $t(){if(a.value&&c&&c.dynamicFilters){if(o.value||x.value)return;o.value=!0,d.value=!0,c.dynamicFilters.forEach((St,Yt)=>{var er;if(St&&(er=P.value)!=null&&er[Yt]){const or=P.value[Yt];if(or.type==="check"&&St.isChecked!==void 0)E.value[Yt]=St.isChecked;else if(or.type==="select"&&St.selectedOptions){const Or=St.selectedOptions.map(Pr=>Pr.value);E.value[Yt]=Or}else or.type==="select"&&St.selectedValue&&Array.isArray(St.selectedValue)&&(E.value[Yt]=St.selectedValue)}}),t.nextTick(()=>{d.value=!1,o.value=!1})}}function Rt(){var St;if(a.value&&c&&c.dynamicFilters&&((St=L.value)==null?void 0:St.id)===4){if(o.value||x.value)return;o.value=!0,d.value=!0,c.dynamicFilters.forEach((Yt,er)=>{var or,Or;if(Yt&&((Or=(or=P.value)==null?void 0:or[er])==null?void 0:Or.type)==="select"){if(Yt.selectedOptions){const Pr=Yt.selectedOptions.map(sn=>sn.value);E.value[er]=Pr}else if(Yt.selectedValue&&Array.isArray(Yt.selectedValue))if(Yt.selectedValue.length>0&&Yt.selectedValue[0]&&typeof Yt.selectedValue[0]=="object"){const Pr=lr(Yt.selectedValue);E.value[er]=Pr}else E.value[er]=Yt.selectedValue}}),setTimeout(()=>{var Yt;if(E.value=[...E.value],(Yt=p==null?void 0:p.view)!=null&&Yt.componentProps&&E.value&&E.value.length>0){const er=E.value[0];if(Array.isArray(er)&&er.length>0){const or=er.some(qn=>qn.event_type_id===1||typeof qn=="string"&&qn.includes("1")),Or=er.some(qn=>qn.category_id===8||typeof qn=="string"&&qn.includes("8")),Pr=er.some(qn=>qn.category_id===9||typeof qn=="string"&&qn.includes("9")),sn=er.some(qn=>qn.event_type_id===3||typeof qn=="string"&&qn.includes("3"));p.view.componentProps.selectedEvents=er,p.view.componentProps.goals=or,p.view.componentProps.yellowCards=Or,p.view.componentProps.redCards=Pr,p.view.componentProps.substitutions=sn,p.view.componentProps.key=er.length>0,p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}},200),t.nextTick(()=>{d.value=!1,o.value=!1})}}function lr(St){return!Array.isArray(St)||St.length===0?[]:St.map(Yt=>{if(Yt&&typeof Yt=="object"){if(Yt.event_type_id!==void 0||Yt.category_id!==void 0)return{event_type_id:Yt.event_type_id,category_id:Yt.category_id,...Yt.name&&{name:Yt.name},...Yt.label&&{label:Yt.label}};if(Yt.value&&typeof Yt.value=="object")return{event_type_id:Yt.value.event_type_id,category_id:Yt.value.category_id,...Yt.value.name&&{name:Yt.value.name},...Yt.value.label&&{label:Yt.value.label}};if(typeof Yt=="string"&&Yt.includes("-")){const[er,or]=Yt.split("-");return{category_id:parseInt(er),event_type_id:parseInt(or)}}}if(typeof Yt=="string")if(Yt.includes("-")){const[er,or]=Yt.split("-");return{category_id:parseInt(er),event_type_id:parseInt(or)}}else{const er=parseInt(Yt);if(!isNaN(er))return{event_type_id:er}}return Yt})}function Zt(){var St,Yt,er,or,Or,Pr,sn,qn,jn,ba,fa,Ia,en,Ur,mn,Vn;if(a.value&&c&&c.dynamicFilters&&P.value){if(o.value||x.value)return;if(o.value=!0,d.value=!0,c.dynamicFilters.forEach((Jn,Cn)=>{var Xr,un,kr,dn,Gn,Dn,oa,Yn,qr,wr,En;if(Jn&&((Xr=P.value[Cn])==null?void 0:Xr.type)==="select"){if(Jn.selectedOptions){const na=Jn.selectedOptions.map(ma=>ma.value);E.value[Cn]=na}else if(Jn.selectedValue&&Array.isArray(Jn.selectedValue))if(Jn.selectedValue.length>0&&Jn.selectedValue[0]&&typeof Jn.selectedValue[0]=="object"){const na=lr(Jn.selectedValue);E.value[Cn]=na}else E.value[Cn]=Jn.selectedValue}else if(Jn&&((un=P.value[Cn])==null?void 0:un.type)==="select-simple"&&Jn.selectedValue!==void 0){let na;((kr=L.value)==null?void 0:kr.id)===2&&(Gn=(dn=p==null?void 0:p.view)==null?void 0:dn.filterMultiple)!=null&&Gn.categoryId?na=p.view.filterMultiple.categoryId:((Dn=L.value)==null?void 0:Dn.id)===1&&(Yn=(oa=p==null?void 0:p.view)==null?void 0:oa.filterMultiple)!=null&&Yn.category?na=p.view.filterMultiple.category:((qr=L.value)==null?void 0:qr.id)===6&&(En=(wr=p==null?void 0:p.view)==null?void 0:wr.filterMultiple)!=null&&En.gameNumber?na=p.view.filterMultiple.gameNumber:na=Array.isArray(Jn.selectedValue)?Jn.selectedValue[0]:Jn.selectedValue,E.value[Cn]=na}}),((St=L.value)==null?void 0:St.id)===4&&setTimeout(()=>{var Jn;if(E.value=[...E.value],(Jn=p==null?void 0:p.view)!=null&&Jn.componentProps&&E.value&&E.value.length>0){const Cn=E.value[0];if(Array.isArray(Cn)&&Cn.length>0){const Xr=Cn.some(Gn=>Gn.event_type_id===1||typeof Gn=="string"&&Gn.includes("1")),un=Cn.some(Gn=>Gn.category_id===8||typeof Gn=="string"&&Gn.includes("8")),kr=Cn.some(Gn=>Gn.category_id===9||typeof Gn=="string"&&Gn.includes("9")),dn=Cn.some(Gn=>Gn.event_type_id===3||typeof Gn=="string"&&Gn.includes("3"));p.view.componentProps.selectedEvents=Cn,p.view.componentProps.goals=Xr,p.view.componentProps.yellowCards=un,p.view.componentProps.redCards=kr,p.view.componentProps.substitutions=dn,p.view.componentProps.key=Cn.length>0,p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}},100),((Yt=L.value)==null?void 0:Yt.id)===2&&(er=p==null?void 0:p.view)!=null&&er.filterMultiple){if(p.view.filterMultiple.categoryId){const Jn=P.value.findIndex(Cn=>Cn.type==="select-simple"&&Cn.label==="Tipo de análisis");if(Jn!==-1){const Cn=p.view.filterMultiple.categoryId;if(E.value[0]=Cn,p.view.componentProps&&Cn){let Xr=`Category ${Cn}`,un=null;try{un=A4(Cn),un&&(Xr=un.name)}catch{const kr=P.value.findIndex(dn=>dn.type==="select-simple"&&dn.label==="Tipo de análisis");if(kr!==-1){const dn=(((or=P.value[kr])==null?void 0:or.options)||[]).find(Gn=>Gn.value==Cn);dn&&(Xr=dn.label)}}p.view.componentProps.categoryView=[{id:Cn,name:Xr}]}(((Or=P.value[Jn])==null?void 0:Or.options)||[]).find(Xr=>Xr.value==Cn),t.nextTick(()=>{E.value=[...E.value]})}}if(p.view.filterMultiple.teamType!==void 0){const Jn=P.value.findIndex(Cn=>Cn.type==="radio-button");if(Jn!==-1){const Cn=p.view.filterMultiple.teamType;E.value[Jn]=Cn,(((Pr=P.value[Jn])==null?void 0:Pr.options)||[]).find(Xr=>Xr.value==Cn),t.nextTick(()=>{E.value=[...E.value]})}}}if(((sn=L.value)==null?void 0:sn.id)===1&&(qn=p==null?void 0:p.view)!=null&&qn.filterMultiple&&p.view.filterMultiple.category&&P.value.findIndex(Jn=>Jn.type==="select-simple"&&Jn.label==="Tipo de análisis")!==-1){const Jn=p.view.filterMultiple.category;E.value[0]=Jn,p.view.componentProps&&Jn&&(p.view.componentProps.type=Jn),t.nextTick(()=>{E.value=[...E.value]})}if(((jn=L.value)==null?void 0:jn.id)===6&&(ba=p==null?void 0:p.view)!=null&&ba.filterMultiple&&p.view.filterMultiple.gameNumber&&P.value.findIndex(Jn=>Jn.type==="select-simple"&&Jn.label==="Número de juego")!==-1){const Jn=p.view.filterMultiple.gameNumber;E.value[0]=Jn,p.view.componentProps&&Jn&&(p.view.componentProps.gameNumber=Jn),t.nextTick(()=>{E.value=[...E.value]})}if(((fa=L.value)==null?void 0:fa.id)===5&&(Ia=p==null?void 0:p.view)!=null&&Ia.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0)if(P.value.findIndex(Jn=>Jn.type==="radio-button"&&Jn.label==="Equipo")!==-1){const Jn=p.view.filterMultiple.isHomeTeam;let Cn;typeof Jn=="boolean"?Cn=Jn?1:2:typeof Jn=="number"?Cn=Jn===1?1:2:Cn=1,E.value[0]=Cn,p.view.componentProps&&Jn!==void 0&&(p.view.componentProps.isHomeTeamForAnalysis=Jn===1),t.nextTick(()=>{E.value=[...E.value]})}else{const Jn=P.value.findIndex(Cn=>Cn.type==="radio-button");if(Jn!==-1){const Cn=p.view.filterMultiple.isHomeTeam;let Xr;typeof Cn=="boolean"?Xr=Cn?1:2:typeof Cn=="number"?Xr=Cn===1?1:2:Xr=1,E.value[Jn]=Xr,p.view.componentProps&&Cn!==void 0&&(p.view.componentProps.preMatchType=Cn),t.nextTick(()=>{E.value=[...E.value]})}}if(((en=L.value)==null?void 0:en.id)===15&&(Ur=p==null?void 0:p.view)!=null&&Ur.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0){const Jn=P.value.findIndex(Cn=>Cn.type==="radio-button");if(Jn!==-1){const Cn=p.view.filterMultiple.isHomeTeam;console.log("Strengths forceRadioFilterUpdate - isHomeTeam:",Cn,"type:",typeof Cn);let Xr;typeof Cn=="boolean"?Xr=Cn?1:2:typeof Cn=="number"?Xr=Cn===1?1:2:Xr=1,console.log("Strengths forceRadioFilterUpdate - teamValue calculado:",Xr,"teamFilterIndex:",Jn),E.value[Jn]=Xr,p.view.componentProps&&Cn!==void 0&&(p.view.componentProps.preMatchType=Xr),t.nextTick(()=>{E.value=[...E.value],console.log("Strengths forceRadioFilterUpdate - dynamicFilters.value después:",E.value)})}else{const Cn=P.value.findIndex(Xr=>Xr.type==="radio-button");if(Cn!==-1){const Xr=p.view.filterMultiple.isHomeTeam;let un;typeof Xr=="boolean"?un=Xr?1:2:typeof Xr=="number"?un=Xr===1?1:2:un=1,E.value[Cn]=un,p.view.componentProps&&Xr!==void 0&&(p.view.componentProps.preMatchType=un),t.nextTick(()=>{E.value=[...E.value]})}}}if(((mn=L.value)==null?void 0:mn.id)===17&&(Vn=p==null?void 0:p.view)!=null&&Vn.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0){const Jn=P.value.findIndex(Cn=>Cn.type==="radio-button");if(Jn!==-1){const Cn=p.view.filterMultiple.isHomeTeam;let Xr;typeof Cn=="boolean"?Xr=Cn?1:2:typeof Cn=="number"?Xr=Cn===1?1:2:Xr=1,E.value[Jn]=Xr,p.view.componentProps&&Cn!==void 0&&(p.view.componentProps.teamselected=Xr),t.nextTick(()=>{E.value=[...E.value]})}else{const Cn=P.value.findIndex(Xr=>Xr.type==="radio-button");if(Cn!==-1){const Xr=p.view.filterMultiple.isHomeTeam;let un;typeof Xr=="boolean"?un=Xr?1:2:typeof Xr=="number"?un=Xr===1?1:2:un=1,E.value[Cn]=un,p.view.componentProps&&Xr!==void 0&&(p.view.componentProps.teamselected=un),t.nextTick(()=>{E.value=[...E.value]})}}}t.nextTick(()=>{d.value=!1,o.value=!1})}}function Tt(){if(!o.value&&a.value&&c&&c.dynamicFilters&&P.value){if(x.value)return;o.value=!0,d.value=!0,c.dynamicFilters.forEach((St,Yt)=>{var er;if(St&&((er=P.value[Yt])==null?void 0:er.type)==="radio-button"&&St.selectedOption&&St.selectedOption.value!==void 0){const or=St.selectedOption.value;E.value[Yt]=or}}),t.nextTick(()=>{d.value=!1,o.value=!1})}}function Pt(){var St,Yt,er,or,Or,Pr,sn,qn,jn,ba,fa,Ia,en,Ur,mn,Vn,Jn,Cn,Xr,un,kr,dn,Gn,Dn,oa,Yn,qr,wr,En,na,ma,ea,Ha,Pa,Ya;if(i&&a.value&&p){if(x.value)return;if(d.value=!0,((St=L.value)==null?void 0:St.id)===4){if(i.setDynamicFilters(E.value,(Yt=p.view)==null?void 0:Yt.id),i.updateDynamicFilters(E.value,(er=p.view)==null?void 0:er.id),p.view.componentProps&&E.value&&E.value.length>0){const Aa=E.value[0];if(Array.isArray(Aa)&&Aa.length>0){const Da=Aa.some(So=>So.event_type_id===1||typeof So=="string"&&So.includes("1")),Ni=Aa.some(So=>So.category_id===8||typeof So=="string"&&So.includes("8")),Pi=Aa.some(So=>So.category_id===9||typeof So=="string"&&So.includes("9")),Po=Aa.some(So=>So.event_type_id===3||typeof So=="string"&&So.includes("3"));p.view.componentProps.selectedEvents=Aa,p.view.componentProps.goals=Da,p.view.componentProps.yellowCards=Ni,p.view.componentProps.redCards=Pi,p.view.componentProps.substitutions=Po,p.view.componentProps.key=Aa.length>0,p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}}else if(((or=L.value)==null?void 0:or.id)===8)i.setDynamicFilters(E.value,(Or=p.view)==null?void 0:Or.id),i.updateDynamicFilters(E.value,(Pr=p.view)==null?void 0:Pr.id);else if(((sn=L.value)==null?void 0:sn.id)===3)i.setDynamicFilters(E.value,(qn=p.view)==null?void 0:qn.id),i.updateDynamicFilters(E.value,(jn=p.view)==null?void 0:jn.id);else if(((ba=L.value)==null?void 0:ba.id)===13){const Aa=(fa=p.view)==null?void 0:fa.id;i.setDynamicFilters(E.value,Aa),i.updateDynamicFilters(E.value,Aa),p.view.componentProps&&(p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps}))}else if(((Ia=L.value)==null?void 0:Ia.id)===15){const Aa=(en=p.view)==null?void 0:en.id;if(i.setDynamicFilters(E.value,Aa),i.updateDynamicFilters(E.value,Aa),p.view.componentProps){const Da=Array.isArray(E.value)&&E.value[3]!==void 0?E.value[3]:null;Da!==null&&(p.view.componentProps.numitems=Da),p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}else if(((Ur=L.value)==null?void 0:Ur.id)===17){const Aa=(mn=p==null?void 0:p.view)==null?void 0:mn.id;i.setDynamicFilters(E.value,Aa),i.updateDynamicFilters(E.value,Aa);const Da=(Ni,Pi)=>{if(!Ni)return;const Po=E.value[0];Po!==void 0&&(Ni.infavoragainstteam=!Po);const So=E.value[1];So!==void 0&&(Ni.lateralidad=So===32?"right":"left");const zo=E.value[2];zo!==void 0&&Pi&&(zo===3||(Ni.teamselected=zo===2?Pi.away_team:Pi.home_team)),Ni._updateKey=Date.now()};if(p&&p.view&&p.view.componentProps){const Ni=p.view.componentProps.game;Da(p.view.componentProps,Ni),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}else if(((Vn=L.value)==null?void 0:Vn.id)===2){i.setDynamicFilters(E.value,(Jn=p.view)==null?void 0:Jn.id),i.updateDynamicFilters(E.value,(Cn=p.view)==null?void 0:Cn.id);const Aa=E.value[0];if(Aa!==void 0&&(p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.categoryId,p.view.filterMultiple.categoryId=Aa,p.view.componentProps)){let Ni=`Category ${Aa}`,Pi=null;try{Pi=A4(Aa),Pi&&(Ni=Pi.name)}catch{const Po=P.value.findIndex(So=>So.type==="select-simple"&&So.label==="Tipo de análisis");if(Po!==-1){const So=(((Xr=P.value[Po])==null?void 0:Xr.options)||[]).find(zo=>zo.value==Aa);So&&(Ni=So.label)}}p.view.componentProps.categoryView=[{id:Aa,name:Ni}],Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple})}const Da=E.value[1];Da!==void 0&&(p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.teamType,p.view.filterMultiple.teamType=Da,p.view.componentProps&&p.view.componentProps.game&&(Da===1?p.view.componentProps.teamView=p.view.componentProps.game.homeTeam.team_id:Da===2?p.view.componentProps.teamView=p.view.componentProps.game.awayTeam.team_id:p.view.componentProps.teamView=0),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}))}else if(((un=L.value)==null?void 0:un.id)===1){i.setDynamicFilters(E.value,(kr=p.view)==null?void 0:kr.id),i.updateDynamicFilters(E.value,(dn=p.view)==null?void 0:dn.id);const Aa=E.value[0];Aa!==void 0&&(p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.category,p.view.filterMultiple.category=Aa,p.view.componentProps&&(p.view.componentProps.type=Aa),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}))}else if(((Gn=L.value)==null?void 0:Gn.id)===6){i.setDynamicFilters(E.value,(Dn=p.view)==null?void 0:Dn.id),i.updateDynamicFilters(E.value,(oa=p.view)==null?void 0:oa.id);const Aa=E.value[0];Aa!==void 0&&(p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.gameNumber,p.view.filterMultiple.gameNumber=Aa,p.view.componentProps&&(p.view.componentProps.gameNumber=Aa,p.view._updateKey,p.view._updateKey=Date.now()),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}),Sd.emit("dynamic-filters-changed",{containerViewId:(Yn=L.value)==null?void 0:Yn.id,viewId:p.view.id,dynamicFilters:E.value}),Sd.emit("component-props-updated",{viewId:p.view.id,componentProps:p.view.componentProps,dynamicFilters:E.value}),t.nextTick(()=>{p.view.componentProps&&(p.view.componentProps={...p.view.componentProps})}))}else if(((qr=L.value)==null?void 0:qr.id)===7){i.setDynamicFilters(E.value,(wr=p.view)==null?void 0:wr.id),i.updateDynamicFilters(E.value,(En=p.view)==null?void 0:En.id);const Aa=E.value[0],Da=E.value[1];if(Aa!==void 0&&p.view.componentProps){const Ni=Aa===1?"offensive":"defensive";p.view.componentProps.analysisType=Ni}if(Da!==void 0){p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.isHomeTeam;const Ni=Da===1;p.view.filterMultiple.isHomeTeam=Ni,p.view.componentProps&&(p.view.componentProps.isHomeTeamForAnalysis=Ni,p.view._updateKey,p.view._updateKey=Date.now()),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}),Sd.emit("dynamic-filters-changed",{containerViewId:(na=L.value)==null?void 0:na.id,viewId:p.view.id,dynamicFilters:E.value}),Sd.emit("component-props-updated",{viewId:p.view.id,componentProps:p.view.componentProps,dynamicFilters:E.value}),t.nextTick(()=>{p.view.componentProps&&(p.view.componentProps={...p.view.componentProps})})}}else if(((ma=L.value)==null?void 0:ma.id)===5){i.setDynamicFilters(E.value,(ea=p.view)==null?void 0:ea.id),i.updateDynamicFilters(E.value,(Ha=p.view)==null?void 0:Ha.id);const Aa=E.value[0];if(Aa!==void 0){p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.isHomeTeam;const Da=Aa===1?1:2;p.view.filterMultiple.isHomeTeam=Da,p.view.componentProps&&(p.view.componentProps.isHomeTeamForAnalysis=Da===1,p.view._updateKey,p.view._updateKey=Date.now()),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}),Sd.emit("dynamic-filters-changed",{containerViewId:(Pa=L.value)==null?void 0:Pa.id,viewId:p.view.id,dynamicFilters:E.value}),Sd.emit("component-props-updated",{viewId:p.view.id,componentProps:p.view.componentProps,dynamicFilters:E.value}),t.nextTick(()=>{p.view.componentProps&&(p.view.componentProps={...p.view.componentProps})})}}else((Ya=L.value)==null?void 0:Ya.id)===9||(i.setDynamicFilters(E.value),i.updateDynamicFilters(E.value));t.nextTick(()=>{d.value=!1})}}function It(){var St,Yt;if(!c||!c.dynamicFilters||!P.value)return!1;for(let er=0;er<c.dynamicFilters.length;er++){const or=c.dynamicFilters[er],Or=P.value[er],Pr=E.value[er];if(!(!or||!Or)){if(Or.type==="check"){if(or.isChecked!==Pr)return!0}else if(Or.type==="radio-button"){if(((St=or.selectedOption)==null?void 0:St.value)!==Pr)return!0}else if(Or.type==="select"){const sn=((Yt=or.selectedOptions)==null?void 0:Yt.map(jn=>jn.value))||or.selectedValue||[],qn=Array.isArray(Pr)?Pr:[];if(JSON.stringify(sn)!==JSON.stringify(qn))return!0}}}return!1}function vr(St){var Yt,er,or,Or,Pr,sn,qn,jn,ba,fa,Ia,en,Ur,mn,Vn,Jn,Cn;if(E.value=St.filters,i){const Xr=((Yt=p==null?void 0:p.view)==null?void 0:Yt.id)||null;i.setDynamicFilters(E.value,Xr),i.updateDynamicFilters(E.value,Xr)}if(a.value&&p&&(Sd.emit("activate-save-button"),Sd.emit("force-component-update",{itemId:((er=p==null?void 0:p.view)==null?void 0:er.id)||null,componentProps:p.view.componentProps}),Sd.emit("dynamic-filters-changed",{containerViewId:((or=p==null?void 0:p.view)==null?void 0:or.id)||null,viewId:((Or=p==null?void 0:p.view)==null?void 0:Or.id)||null,dynamicFilters:E.value}),Sd.emit("dynamic-filters-changed",{containerViewId:((Pr=p==null?void 0:p.view)==null?void 0:Pr.id)||null,viewId:((sn=p==null?void 0:p.view)==null?void 0:sn.id)||null,dynamicFilters:E.value}),t.nextTick(()=>{p.view.componentProps&&(p.view.componentProps={...p.view.componentProps})})),!a.value&&i&&(((qn=L.value)==null?void 0:qn.id)===15||((jn=L.value)==null?void 0:jn.id)===17)&&i.getRequiresAddView(E.value,P.value)){i.setDynamicFilters(E.value),$("filters-changed",{main:f.value,view:L.value,team:Y.value,dynamicFilters:E.value,filtersJSON:{mainSelector:{id:((ba=f.value)==null?void 0:ba.id)||null,name:((fa=f.value)==null?void 0:fa.name)||null,url:((Ia=f.value)==null?void 0:Ia.url)||null},viewSelector:{id:((en=L.value)==null?void 0:en.id)||null,name:((Ur=L.value)==null?void 0:Ur.name)||((mn=L.value)==null?void 0:mn.title)||null,url:((Vn=L.value)==null?void 0:Vn.url)||null},team:Y.value,dynamicFilters:E.value,timestamp:new Date().toISOString(),summary:{mainSelected:!!f.value,viewSelected:!!L.value,totalDynamicFilters:((Jn=P.value)==null?void 0:Jn.length)||0,activeFilters:((Cn=P.value)==null?void 0:Cn.filter((Xr,un)=>{const kr=E.value[un];return Array.isArray(kr)?kr.length>0:kr!=null&&kr!==!1}).length)||0}},filterAndViewsContainer:i,viewToEdit:p}),Ye();return}Pt()}function ur(St){St.filterIndex!==void 0&&St.value!==void 0&&(E.value[St.filterIndex]=St.value,a.value&&Pt(),Ye())}function gr(){Gt()}function Tr(St){var Yt,er,or,Or,Pr,sn,qn;console.log("newFilters in onChangeFiltersAltMode:",St);const jn={mainSelector:{id:((Yt=f.value)==null?void 0:Yt.id)||null,name:((er=f.value)==null?void 0:er.name)||null,url:((or=f.value)==null?void 0:or.url)||null},viewSelector:{id:((Or=L.value)==null?void 0:Or.id)||null,name:((Pr=L.value)==null?void 0:Pr.name)||((sn=L.value)==null?void 0:sn.title)||null,url:((qn=L.value)==null?void 0:qn.url)||null}};$("filters-changed",{filters:St.filters,view:St.view,viewToEdit:p,filterAndViewsContainer:i,filtersJSON:jn,isAltMode:!0})}function Rr(St){return JSON.parse(JSON.stringify(St))}return(St,Yt)=>(t.openBlock(),t.createElementBlock("div",Vrt,[t.createElementVNode("button",Prt,t.toDisplayString(a.value?"Editando visualización":"Nueva visualización"),1),t.createElementVNode("div",{class:t.normalizeClass([{disabled:a.value},"custom-select main-select"]),onClick:_e},[t.createElementVNode("div",Art,[t.createElementVNode("span",Rrt,[f.value?(t.openBlock(),t.createElementBlock("img",{key:0,src:xe(f.value.name,!1),alt:"icono",class:"option-img"},null,8,Urt)):(t.openBlock(),t.createElementBlock("img",Frt))]),f.value?(t.openBlock(),t.createElementBlock("span",qrt,t.toDisplayString(Pe()),1)):(t.openBlock(),t.createElementBlock("span",Irt,"Tipo de vista")),t.createElementVNode("span",{class:t.normalizeClass([{open:se.value},"arrow"])},[...Yt[5]||(Yt[5]=[t.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),se.value?(t.openBlock(),t.createElementBlock("div",jrt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,(er,or)=>(t.openBlock(),t.createElementBlock("div",{key:er.id,class:t.normalizeClass([{active:s.value===or},"option-card"]),onClick:t.withModifiers(Or=>qe(or),["stop"])},[t.createElementVNode("div",Wrt,[t.createElementVNode("img",{"data-hover-src":xe(er.name,!0),src:xe(er.name,!1),alt:"icono",class:"option-img-34"},null,8,Krt)]),t.createElementVNode("div",Brt,[t.createElementVNode("div",Xrt,t.toDisplayString(er.name),1),er.description?(t.openBlock(),t.createElementBlock("div",Grt,t.toDisplayString(er.description),1)):t.createCommentVNode("",!0)])],10,Drt))),128))])):t.createCommentVNode("",!0)],2),f.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([{disabled:a.value},"custom-select second-select"]),onClick:Ue},[t.createElementVNode("div",Zrt,[t.createElementVNode("span",Jrt,[L.value?(t.openBlock(),t.createElementBlock("img",{key:0,src:L.value.url,alt:"icono",class:"option-img-graph2"},null,8,Hrt)):f.value?(t.openBlock(),t.createElementBlock("img",{key:1,src:xe(f.value.name,!1),alt:"icono",class:"option-img"},null,8,Yrt)):t.createCommentVNode("",!0)]),t.createElementVNode("span",Qrt,t.toDisplayString(je()),1),t.createElementVNode("span",{class:t.normalizeClass([{open:me.value},"arrow"])},[...Yt[6]||(Yt[6]=[t.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),me.value&&f.value?(t.openBlock(),t.createElementBlock("div",$rt,[t.createElementVNode("div",ent,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g.value,er=>(t.openBlock(),t.createElementBlock("div",{key:er.id,class:t.normalizeClass([{active:S.value===er.id},"option-card-grid"]),onClick:t.withModifiers(or=>Re(er),["stop"])},[er.id===17?(t.openBlock(),t.createElementBlock("div",rnt,[...Yt[7]||(Yt[7]=[t.createElementVNode("div",null,"Tiros de esquina",-1),t.createElementVNode("div",null,"tendencia general",-1)])])):er.id===18?(t.openBlock(),t.createElementBlock("div",nnt,[...Yt[8]||(Yt[8]=[t.createElementVNode("div",null,"Tactica fija",-1),t.createElementVNode("div",null,"jugadas especificas",-1)])])):(t.openBlock(),t.createElementBlock("div",ant,t.toDisplayString(er.name||er.title),1)),t.createElementVNode("div",int,[t.createElementVNode("img",{src:er.url,alt:"icono",class:"option-img-grid"},null,8,ont)])],10,tnt))),128))])])):t.createCommentVNode("",!0)],2)):t.createCommentVNode("",!0),L.value?(t.openBlock(),t.createElementBlock("div",snt)):t.createCommentVNode("",!0),L.value&&L.value.id===13?(t.openBlock(),t.createBlock(jYe,{key:2,"component-id":13,filters:P.value,"initial-values":a.value?t.unref(c).dynamicFilters:E.value,"is-edit-mode":a.value,onFiltersChanged:vr,onFilterUpdated:ur},null,8,["filters","initial-values","is-edit-mode"])):L.value&&L.value.id===16?(t.openBlock(),t.createBlock($Qe,{key:3,"default-filters":t.unref(p)?t.unref(p).view.filterMultiple:null,"is-edit-mode":!!t.unref(p),"is-post-match":e.isPostMatch,"view-config":Rr(h.value.get(16)),onChange:Tr,onRemoveViews:gr},null,8,["default-filters","is-edit-mode","is-post-match","view-config"])):L.value&&L.value.id===18?(t.openBlock(),t.createBlock(aet,{key:4,"default-filters":t.unref(p)?t.unref(p).view.filterMultiple:null,"view-config":Rr(h.value.get(18)),"is-post-match":e.isPostMatch,onChange:Tr,onRemoveViews:gr},null,8,["default-filters","view-config","is-post-match"])):L.value&&L.value.id===15?(t.openBlock(),t.createBlock(iQe,{key:5,"component-id":15,filters:P.value,"initial-values":a.value?t.unref(c).dynamicFilters:E.value,"is-edit-mode":a.value,onFiltersChanged:vr,onFilterUpdated:ur},null,8,["filters","initial-values","is-edit-mode"])):L.value&&L.value.id===17?(t.openBlock(),t.createBlock(zrt,{key:6,"component-id":17,"default-filters":t.unref(p)?t.unref(p).view.filterMultiple:null,filters:P.value,"initial-values":a.value?t.unref(c).dynamicFilters:E.value,"is-edit-mode":a.value,"view-config":Rr(h.value.get(17)),onChange:Tr,onFiltersChanged:vr,onFilterUpdated:ur,onRemoveViews:gr},null,8,["default-filters","filters","initial-values","is-edit-mode","view-config"])):L.value&&P.value&&D()?(t.openBlock(),t.createElementBlock("div",{key:7,class:t.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":P.value.length>=2}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(P.value,(er,or)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:or},[er.type==="select"?(t.openBlock(),t.createElementBlock("div",{key:0,class:"custom-select dynamic-select filter-inline",onClick:t.withModifiers(Or=>We(or),["stop"])},[t.createElementVNode("div",cnt,[Yt[10]||(Yt[10]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.createElementVNode("img",{alt:"icono categorías",src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),Yt[11]||(Yt[11]=t.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),Array.isArray(E.value[or])&&E.value[or].length>0?(t.openBlock(),t.createElementBlock("span",unt,t.toDisplayString(E.value[or].length),1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass([{open:ge.value===or},"arrow"])},[...Yt[9]||(Yt[9]=[t.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),ge.value===or?(t.openBlock(),t.createElementBlock("div",dnt,[t.createElementVNode("div",pnt,[t.createElementVNode("div",{class:"multi-select-header",onClick:Yt[1]||(Yt[1]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("label",hnt,[t.createElementVNode("input",{checked:j(or),indeterminate:U(or),type:"checkbox",onChange:t.withModifiers(Or=>M(or),["stop"]),onClick:Yt[0]||(Yt[0]=t.withModifiers(()=>{},["stop"]))},null,40,fnt),Yt[12]||(Yt[12]=t.createElementVNode("span",{class:"select-all-label"},"Agregar todas",-1))])]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(er.options,Or=>(t.openBlock(),t.createElementBlock("div",{key:Or.value,class:t.normalizeClass([{active:V(or,Or.value)},"option-card multi-select-option"]),onClick:Yt[2]||(Yt[2]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",mnt,[t.createElementVNode("input",{checked:V(or,Or.value),type:"checkbox",onChange:t.withModifiers(Pr=>I(or,Or.value),["stop"])},null,40,ynt)]),t.createElementVNode("div",{class:"option-content",onClick:Pr=>I(or,Or.value)},[t.createElementVNode("div",vnt,t.toDisplayString(Or.label),1)],8,gnt)],2))),128))]),t.createElementVNode("div",bnt,[t.createElementVNode("button",{class:"btn-listo",onClick:Yt[3]||(Yt[3]=t.withModifiers(Or=>Qt(),["stop"]))},"Listo")])])):t.createCommentVNode("",!0)],8,lnt)):er.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",xnt,[t.createElementVNode("div",_nt,t.toDisplayString(er.label),1),t.createElementVNode("div",wnt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(er.options,Or=>(t.openBlock(),t.createElementBlock("label",{key:Or.value,class:t.normalizeClass([{active:E.value[or]===Or.value},"radio-option-card"])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Pr=>E.value[or]=Pr,disabled:X(Or.value,Or.label),name:"dynamic-radio-"+or,value:Or.value,type:"radio",onChange:()=>{var Pr,sn,qn;if(((Pr=L.value.value)==null?void 0:Pr.id)===9&&a.value.value&&(qn=(sn=t.unref(p))==null?void 0:sn.view)!=null&&qn.filterMultiple){const jn=E.value[or]===1;t.unref(p).view.filterMultiple.isHomeTeam=jn}a.value.value&&Pt(),Ye()}},null,40,Tnt),[[t.vModelRadio,E.value[or]]]),t.createElementVNode("span",null,t.toDisplayString(Or.label),1)],2))),128))])])):er.type==="check"?(t.openBlock(),t.createElementBlock("div",Snt,[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Or=>E.value[or]=Or,checked:E.value[or],type:"checkbox",onChange:Yt[4]||(Yt[4]=()=>{a.value.value&&Pt(),Ye()})},null,40,knt),[[t.vModelCheckbox,E.value[or]]]),t.createTextVNode(" "+t.toDisplayString(er.label),1)])])):er.type==="select-simple"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-filter-type":er.type,class:"custom-select dynamic-select filter-inline",onClick:t.withModifiers(Or=>Qe(or),["stop"])},[t.createElementVNode("div",Nnt,[Yt[14]||(Yt[14]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.createElementVNode("img",{alt:"icono categorías",src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),Yt[15]||(Yt[15]=t.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),t.createElementVNode("span",{class:t.normalizeClass([{open:be.value===or},"arrow"])},[...Yt[13]||(Yt[13]=[t.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),be.value===or?(t.openBlock(),t.createElementBlock("div",Ont,[t.createElementVNode("div",Mnt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(er.options,Or=>(t.openBlock(),t.createElementBlock("div",{key:Or.value,class:t.normalizeClass([{active:E.value[or]===Or.value},"option-card simple-select-option"]),onMouseenter:Pr=>sr(or,Or.value),onClick:t.withModifiers(Pr=>rt(or,Or.value),["stop"])},[t.createElementVNode("div",Cnt,[t.createElementVNode("div",znt,t.toDisplayString(Or.label),1)]),E.value[or]===Or.value?(t.openBlock(),t.createElementBlock("div",Vnt,[...Yt[16]||(Yt[16]=[t.createElementVNode("svg",{fill:"none",height:"16",viewBox:"0 0 16 16",width:"16"},[t.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])])):t.createCommentVNode("",!0)],42,Ent))),128))])])):t.createCommentVNode("",!0)],8,Lnt)):t.createCommentVNode("",!0),or===1&&P.value.length>2?(t.openBlock(),t.createElementBlock("div",Pnt)):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0),a.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("button",{key:8,class:"cancel-btn",onClick:Gt},"Cancelar")),k.value?(t.openBlock(),t.createElementBlock("button",{key:9,class:"ok-btn",onClick:qt},"OK")):t.createCommentVNode("",!0)]))}}),Rnt=t2(Ant,[["__scopeId","data-v-5035e341"]]),Unt={key:0,class:"modal-simple"},Fnt={class:"modal-simple__content"},Int={class:"modal-simple__content__header"},qnt={class:"modal-simple__content__body"},jnt={class:"modal-simple__content__footer"},Dnt={__name:"ModalSimple",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(r,n)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[e.modelValue?(t.openBlock(),t.createElementBlock("div",Unt,[t.createElementVNode("div",Fnt,[t.createElementVNode("div",Int,[t.renderSlot(r.$slots,"header",{},void 0,!0)]),t.createElementVNode("div",qnt,[t.renderSlot(r.$slots,"body",{},void 0,!0)]),t.createElementVNode("div",jnt,[t.renderSlot(r.$slots,"footer",{},void 0,!0)])])])):t.createCommentVNode("",!0)]))}},Wnt=t2(Dnt,[["__scopeId","data-v-1cc4f590"]]),Knt={class:"footer"},Bnt={__name:"ModalCautionClose",props:{value:{type:Boolean,default:!1}},emits:["update:modelValue","action"],setup(e,{emit:r}){const n=r;function v(h){n("update:modelValue",h)}function $(h){n("action",h),n("update:modelValue",!1)}return(h,u)=>(t.openBlock(),t.createBlock(Wnt,{"modle-value":e.value,"onUpdate:modelValue":v},{header:t.withCtx(()=>[...u[2]||(u[2]=[t.createElementVNode("div",{class:"header"},"Descartar template",-1)])]),body:t.withCtx(()=>[...u[3]||(u[3]=[t.createElementVNode("div",{class:"body"},"¿Estás seguro que deseas abandonar el proceso?",-1)])]),footer:t.withCtx(()=>[t.createElementVNode("div",Knt,[t.createElementVNode("div",{role:"button",class:"btn btn-cancel",onClick:u[0]||(u[0]=i=>$(!1))}," Seguir editando "),t.createElementVNode("div",{role:"button",class:"btn btn-confirm",onClick:u[1]||(u[1]=i=>$(!0))}," Descartar ")])]),_:1},8,["modle-value"]))}},Xnt=t2(Bnt,[["__scopeId","data-v-ed9b5088"]]),Gnt={key:0,class:"modal-simple"},Znt={__name:"ModalChangesSaved",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(r,n)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,null,{default:t.withCtx(()=>[e.modelValue?(t.openBlock(),t.createElementBlock("div",Gnt,[...n[0]||(n[0]=[t.createElementVNode("div",{class:"modal-simple__content"},[t.createElementVNode("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.createElementVNode("path",{d:"M29.3333 5.33203L16 18.6787L12 14.6787",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"})]),t.createElementVNode("div",{class:"modal-simple__content__text"}," Los cambios se han guardado correctamente ")],-1)])])):t.createCommentVNode("",!0)]),_:1})]))}},Jnt=t2(Znt,[["__scopeId","data-v-2bc30783"]]),Hnt={class:"template-maker__header"},Ynt={key:0,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Qnt={class:"template-maker__content"},$nt={class:"template-maker__content__main"},eat={id:"containerMain",class:"container-main"},tat={class:"template-maker__content__main__cover-selector"},rat=["id"],nat={class:"page-indicator"},aat={class:"page-indicator__index"},iat=["onClick"],oat=["onClick"],sat={key:0,class:"template-maker__content__main__footer"},lat={class:"template-maker__content__main__footer__paginator"},cat={class:"template-maker__content__main__footer__paginator__nav"},uat={class:"template-maker__content__main__footer__paginator__numbers"},dat=["onClick"],pat={__name:"GSC-TemplateReportMaker",props:{token:{type:String,default:""},userTeamId:{type:Number,default:0}},emits:["close"],setup(e,{expose:r,emit:n}){const v=new Map,$=t.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:{}}]}]),h=t.ref(null),u=t.ref(0),i=t.ref(!1),p=t.ref(null),c=t.ref(null),a=t.ref(!0),k=t.ref(!1),T=t.ref(!1),x=t.ref(0),d=t.ref(!1),o=t.ref(null),l=t.ref(new Map),s=t.ref(null),f=t.ref(null),g=t.ref(!1),S=t.ref(!1),L=t.ref(!1),E=new Map,P=new Map,V=t.computed(()=>({"--overflow-y-template-maker":k.value?"scroll":"hidden","--height-container-main":k.value?"fit-content":"calc(100vh - 64px)","--margin-bottom-container-main":(k.value,"0")})),I=t.computed(()=>u.value+1);t.watch(()=>i.value,$t=>{const Rt=document.getElementById("app");$t?(u.value=0,document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",Rt&&(Rt.style.overflow="hidden")):(document.body.style.overflow="",document.documentElement.style.overflow="",Rt&&(Rt.style.overflow=""))});function j($t){return $t<10?`0${$t}`:$t}async function U({templateId:$t,userId:Rt}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Rt}/templates/${$t}`,{method:"GET",headers:{Authorization:dt.token}})).json()).data}catch(lr){console.error("Error fetching template by ID:",lr)}}async function D({reportId:$t,userId:Rt}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Rt}/reports/${$t}`,{method:"GET",headers:{Authorization:dt.token}})).json()).data}catch(lr){console.error("Error fetching report by ID:",lr)}}let F=0;function z($t){h.value=$t,F>0&&(g.value=!0),F++}function X($t){$t&&st(null,!0)}let M=null;function Y($t,Rt){let lr=$t.getBoundingClientRect(),Zt={height:$t.clientHeight,width:$t.clientWidth},Tt=Rt.getBoundingClientRect();if(!(Tt.top>=lr.top&&Tt.bottom<=lr.top+Zt.height)){const Pt=Tt.top-lr.top,It=Tt.bottom-lr.bottom;Math.abs(Pt)<Math.abs(It)?$t.scrollTop+=Pt:$t.scrollTop+=It}}function se($t,Rt){let lr=$t.getBoundingClientRect();const Zt=Rt.getBoundingClientRect().top-lr.top;$t.scrollTop+=Zt}function me($t,Rt=!1){const lr={title:`Page ${$.value.length+1}`,id:`p-${Date.now()}`,items:[]};if(Gt(),$t!==void 0&&$t>=-1?$.value.splice($t+1,0,lr):$.value.push(lr),t.nextTick(()=>{const Zt=$.value.findIndex(Pt=>Pt.id===lr.id),Tt=document.getElementById(`page-${Zt+1}`);M||(M=document.getElementById("containerMain")),Tt&&M?Y(M,Tt):console.error("Page element or container main element not found")}),Rt)return lr;g.value=!0}function ge($t){if($t<0||$t>$.value.length)return;u.value=$t;const Rt=document.getElementById(`page-${$t}`);if(M||(M=document.getElementById("containerMain")),Rt&&M){const lr=new CustomEvent("programmatic-scroll-start");document.dispatchEvent(lr),se(M,Rt),setTimeout(()=>{const Zt=new CustomEvent("programmatic-scroll-end");document.dispatchEvent(Zt)},300)}else console.error("Page element or container main element not found")}function be($t){s.value=$t,d.value=!0}function xe($t,Rt){const lr=Rt+1;$t&&u.value!==lr&&(u.value=lr)}function Pe($t){d.value=!0,Sd.emit("edit-view",{view:$t})}async function je({templateReportId:$t,userId:Rt,isTemplateMode:lr}){try{return lr?U({templateId:$t,userId:Rt}):D({reportId:$t,userId:Rt})}catch(Zt){throw new Error("Error fetching template or report by ID: "+Zt.message)}}function _e(){F=0,d.value=!1,u.value=0,s.value=null,f.value=null,l.value.clear(),M=null,p.value=null,c.value=null,h.value=null,x.value=0,$.value=[],T.value=!1,g.value=!1,S.value=!1,L.value=!1,E.forEach($t=>clearTimeout($t)),E.clear(),P.forEach($t=>clearTimeout($t)),P.clear(),Ue=[],v.clear()}let Ue=[];async function qe($t){if(_e(),a.value=$t.isTemplateMode,k.value=!!$t.isPDFMode,$t.isPDFMode?p.value=await D({reportId:$t.reportId,userId:$t.userId}):(p.value=$t.template,p.value=await je({templateReportId:$t.template.id,userId:$t.template.user_id,isTemplateMode:$t.isTemplateMode})),!p.value)return;p.value&&p.value.game&&(p.value.game=Ye(p.value.game)),c.value=JSON.parse(JSON.stringify(p.value)),T.value=p.value.template_type===2;const Rt=p.value.pages.find(lr=>lr.is_front_page);x.value=Rt?Rt.type:1,i.value=!0,$t.isTemplateMode||(Ue=await rt(p.value)),$.value=p.value.pages.reduce((lr,Zt,Tt)=>{if(!Zt.is_front_page){Zt.name||(Zt.name="");const Pt=Tt,It={originalPage:JSON.parse(JSON.stringify(Zt)),title:Zt.name,id:`p-${Date.now()-Tt*9}`,items:[],components:Zt.components};Zt.components&&Zt.components.length>0&&(It.items=Zt.components.reduce((vr,ur,gr)=>{const Tr=new Qk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],ur.coreView.id,ur.dynamicFilters,T.value,a.value,ur.filtersJSON||null,dt.token,ur.filters),Rr={originalComponent:JSON.parse(JSON.stringify(ur)),title:ur.title,shortTitle:ur.shortTitle||ur.title,game:p.value.game,idAux:ur.id,id:`w-${Date.now()-gr*7}`,x:ur.column,y:ur.row,w:ur.colspan,h:ur.rowspan,maxWidth:ur.max_column,maxHeight:ur.max_row,minWidth:ur.min_column,minHeight:ur.min_row,noResize:!a.value,noMove:!a.value,coreView:ur.coreView||null,isTemplateMode:a.value,componentName:ur.componentName,componentProps:Qe({currentProps:ur.componentProps,coreView:ur.coreView,isTemplateMode:a.value,templateToEdit:p.value,filterMultiple:ur.filterMultiple||null,game:p.value.game||null,dynamicFilters:ur.dynamicFilters,page:Pt,componentId:gr})||{},filterMultiple:ur.filterMultiple,isHomeTeam:We({game:p.value.game,isTemplateMode:a.value,currentIsHomeTeam:ur.isHomeTeam||ur.componentProps.isHomeTeamForAnalysis}),filtersJSON:ur.filtersJSON||null,dynamicFilters:ur.dynamicFilters||[],filterAndViewsContainer:Tr};if(Rr.componentProps.isViewNull)return vr;const St=t.reactive({view:Rr});return Tr.addView(St,!0),l.value.set(Tr.getId(),Tr),vr.push(Rr),vr},[])),lr.push(It)}return lr},[])}function Re({game:$t,isTemplateMode:Rt}){const lr=$t&&$t.homeTeam&&$t.awayTeam&&($t.homeTeam.team_id===dt.userTeamId||$t.awayTeam.team_id===dt.userTeamId);return{isUserTeamHome:lr&&$t.homeTeam.team_id===dt.userTeamId,requiresUserTeamAdjustment:lr&&!Rt}}function We({game:$t,isTemplateMode:Rt,currentIsHomeTeam:lr}){const{isUserTeamHome:Zt,requiresUserTeamAdjustment:Tt}=Re({game:$t,isTemplateMode:Rt});return Tt?lr?Zt:!Zt:lr}function Qe({currentProps:$t,coreView:Rt,templateToEdit:lr,isTemplateMode:Zt,filterMultiple:Tt,game:Pt,dynamicFilters:It,page:vr,componentId:ur}){var gr,Tr,Rr,St;if(!$t||!Rt)return $t||{};const{isUserTeamHome:Yt,requiresUserTeamAdjustment:er}=Re({game:Pt,isTemplateMode:Zt});let or={...$t};if(Rt.id===5){if(or.isGhostEffect=Zt,er){const Or=or.preMatchType===1;or.preMatchType=Or?Yt?1:2:Yt?2:1}Pt&&(or.game=Pt)}if(Rt.id===7){if(er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}Pt&&(or.game=Pt)}if(Rt.id===9){if(er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}Pt&&(or.game=Pt)}if(Rt.id===18){if(!Zt&&er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}if(!Zt){or.teamIdForAnalysis=or.isHomeTeamForAnalysis?Pt.home_team:Pt.visiting_team;const Or=Ue.findIndex(sn=>((or.isAgainstMode?1:0)===sn.is_against||sn.is_against===or.isAgainstMode)&&or.teamIdForAnalysis===sn.team_id);let Pr=null;Or!==-1&&(Pr={...Ue[Or]},Ue.splice(Or,1)),console.log("viewCorner",Pr),Pr?(or.specificPlaysCornersData=Pr,or.playIdForAnalysis=Pr.play_id,or.gameIdForAnalysis=Pr.game_id,or.seasonIdForAnalysis=Pr.season_id||Pt.season_id,or.isTemplateMode=Zt,or.isGameOnly=!0,or.isCornerInfoVisible=!0):(or.isNullCornerData=!0,or.isViewNull=!0,console.warn("No specific plays corner data available for this component"))}}if(Rt.id===16){if(!Zt&&er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}if(!Zt){or.isPreMatch=!T.value,or.isTemplateMode=Zt,or.seasonId=lr.season_id,or.teamIdForAnalysis=or.isHomeTeamForAnalysis?lr.game.home_team:lr.game.visiting_team;const Or=or.isHomeTeamForAnalysis?lr.last_games.last_home_games:lr.last_games.last_visiting_games;T.value?or.gamesIdsForAnalysis=[lr.game.game_id]:or.howManyGames?or.gamesIdsForAnalysis=Or.slice(0,or.howManyGames).map(Pr=>Pr.game_id):(or.gamesIdsForAnalysis=[],or.gameDataUTC=lr.game.date_time_utc)}}if(Rt.id===10){if(er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}Pt&&(or.game=Pt)}if(Rt.id===1&&(or.gameId=Pt?Pt.id:"",or.homeLogo=Pt?Pt.homeTeam.logo:"",or.awayLogo=Pt?Pt.awayTeam.logo:"",or.seasonId=Pt?Pt.season_id:0,or.default=Zt),Rt.id===6&&(or.game=Pt||"",or.lastGames=lr.last_games,or.selectedOption=lr.template_type===2?"Postmatch":"Prematch"),Rt.id===13&&(or.isdefault=Zt,or.seasonid=Pt?Pt.seasonId:2010,or.datetimeutc=Pt?lr.template_type===1?Pt?Pt.date_time_utc:"":null:"",or.teamids=Pt?[Pt.home_team,Pt.visiting_team]:[1,2],or.categoryids=It?It[1]:[20,2],or.teamsshow=Pt?It?It[2]==1?[Pt.home_team]:It[2]==2?[Pt.visiting_team]:[Pt.home_team,Pt.visiting_team]:[1,2]:[1,2],or.analysistype=It?It[0]:[],or.gameid=lr.template_type===1?null:Pt?Pt.id:"",or.teams=Pt?[{id:Pt.home_team,name:Pt.home_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Pt.home_team+".png"},{id:Pt.visiting_team,name:Pt.visiting_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Pt.visiting_team+".png"}]:[]),Rt.id===15&&(or.view=1,or.token=dt.token,or.numitems=It?It[1]:3,or.isdefault=Zt,or.reportid=lr!=null&&lr.id?lr.id:0,or.userid=lr!=null&&lr.user_id?lr.user_id:0,or.page=vr+1,or.typegame=T.value?2:1,or.componentid=ur+1,or.data={season:Pt?Pt.seasonId:2010,type:2,game:Pt?Pt.id:0,team:Zt?2:Tt?Tt.isHomeTeam?Pt.home_team||2:Pt.visiting_team||2:2}),Rt.id===17){or.game=Pt?{id:Pt.id||Pt.game_id||Pt.gameId||null,home_team:Pt.home_team||null,away_team:Pt.visiting_team||null,season:Pt.seasonId||Pt.season_id||null,game_status:Pt.game_status||Pt.status||null,home_acronym:Pt.home_team_acronym||((gr=Pt.homeTeam)==null?void 0:gr.acronym)||null,away_acronym:Pt.visiting_team_acronym||((Tr=Pt.awayTeam)==null?void 0:Tr.acronym)||null,logo_home:((Rr=Pt.homeTeam)==null?void 0:Rr.logo)||null,logo_away:((St=Pt.awayTeam)==null?void 0:St.logo)||null}:null,or.infavoragainstteam=It?!It[0]:!0,or.forseason=!T.value,or.forteam=!1,or.tournamentselected=lr!=null&&lr.tournament_id?{id:lr.tournament_id}:{id:1},or.forgame=!!T.value,or.lateralidad=It&&It[1]==32?"right":"left",or.teamselected=It[2]==3?Tt?Tt.isHomeTeam?Pt==null?void 0:Pt.home_team:Pt==null?void 0:Pt.visiting_team:0:It[2]==2?Pt==null?void 0:Pt.visiting_team:Pt==null?void 0:Pt.home_team;const Or=It&&It[3]&&typeof It[3]=="object"&&!Array.isArray(It[3])&&It[3][4]!==void 0?Array.isArray(It[3][4])?It[3][4].filter(Pr=>Pr!=="rematado-destino-porteria").reduce((Pr,sn)=>(sn==="fue-gol"?Pr.push(583,585,587,589):sn==="no-fue-gol"?Pr.push(584,586,588,590):sn==="rematado-sin-destino-porteria"?Pr.push(125,131,139,145):sn==="sin-destino"?Pr.push(122,128,136,142):sn==="ganados-por-portero-rival"?Pr.push(123,129,137,143):sn==="ganados-por-jugador-rival"&&Pr.push(124,130,138,144),Pr),[]):[]:[];or.filters={isMoment:!0,final:[1,2,3],moment:It&&It[3]&&typeof It[3]=="object"&&!Array.isArray(It[3])&&It[3][0]!==void 0?Array.isArray(It[3][0])?It[3][0].map(Pr=>Pr==="iba-ganando"?1:Pr==="iba-empatado"?3:Pr==="iba-perdiendo"?2:Pr):[]:[],playingAs:[1,2],sections:It&&It[3]&&typeof It[3]=="object"&&!Array.isArray(It[3])&&It[3][1]!==void 0?Array.isArray(It[3][1])?It[3][1].map(Pr=>Pr==="0-15"?1:Pr==="16-30"?2:Pr==="31-45"?3:Pr==="46-60"?4:Pr==="61-75"?5:Pr==="76-90"?6:Pr):[]:[],games:T.value?[Pt==null?void 0:Pt.game_id]:[],players:[],cornertype:It&&It[1]!==void 0?It[1]:null,howWas:It&&It[3]&&typeof It[3]=="object"&&!Array.isArray(It[3])&&It[3][2]!==void 0?Array.isArray(It[3][2])?It[3][2].filter(Pr=>Pr!=="izquierda"&&Pr!=="derecha").map(Pr=>{const sn=It[1];return Pr==="comba-afuera"?sn==32?134:120:Pr==="comba-adentro"?sn==32?140:126:Pr==="raz-area"?sn==32?146:327:Pr==="en-corto"?sn==32?147:133:Pr}):[]:[],zona:It&&It[3]&&typeof It[3]=="object"&&!Array.isArray(It[3])&&It[3][3]!==void 0?Array.isArray(It[3][3])?It[3][3]:[]:[],whathappened:Or,isWhatHappenedFull:Array.isArray(Or)&&Or.length===24,isZoneFull:It&&It[3]&&typeof It[3]=="object"&&!Array.isArray(It[3])&&It[3][3]!==void 0&&Array.isArray(It[3][3])?It[3][3].length===35:!1},or.showBallGo=!0,or.showHeatMap=!0,or.ballOnOff="OFF",or.showdefault=Zt}if(Rt.id===14&&(or.isReports=!0,or.isDefault=Zt,or.type=lr.tournament_type==1?1:0,or.typeView=1,or.tournament=lr.tournament_id,or.currentSeason=Pt?Pt.season_id:0,or.currentSeasonId=Pt?Pt.season_id:0,or.showVideos=!1,or.localTeam=Pt?Pt.home_team:0,or.awayTeam=Pt?Pt.visiting_team:0),Rt.id===3&&(or.defaultShields=Zt,Pt&&(or.game=Pt)),Rt.id===2){let Or=!0,Pr=0,sn=0;Pt&&(Or=lr.main_team==Pt.home_team||lr.main_team==Pt.visiting_team,Pr=Or?lr.main_team==(Pt==null?void 0:Pt.home_team)?Pt==null?void 0:Pt.home_team:Pt==null?void 0:Pt.visiting_team:Pt==null?void 0:Pt.home_team,sn=Or?lr.main_team==(Pt==null?void 0:Pt.home_team)?Pt==null?void 0:Pt.visiting_team:Pt==null?void 0:Pt.home_team:Pt==null?void 0:Pt.visiting_team),or.gamed=Pt?Pt.id:"",or.game=Pt||"",or.season=Pt?Pt.season_id:0,or.teamView=Tt.teamType==3?0:Tt.teamType==1?Pr:sn,or.useDummyData=Zt}return Rt.id===8&&(or.teamSelected=Pt?{teamId:Pt.home_team}:1,or.isDefault=Zt,Pt&&(or.game=Pt)),Rt.id===4&&(or.gameId=Pt?Pt.id:"",or.isDefault=Zt,or.homeTeam=Pt?Pt==null?void 0:Pt.home_team:"",or.awayTeam=Pt?Pt==null?void 0:Pt.visiting_team:""),or}async function rt($t){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${$t.user_id}/reports/${$t.id}/specific-plays-corners`,{method:"GET",headers:{Authorization:dt.token}})).json()).data}catch(Rt){return console.error("Error fetching specific plays:",Rt),[]}}const dt=e,ut=n;t.watch(()=>dt.token,($t,Rt)=>{},{immediate:!0}),r({show:qe}),Sd.on("add-page-view",$t=>{v.set($t.view.id,$t.view);const Rt=$.value.find(lr=>lr.id===$t.pageId);Rt&&(Rt.items||(Rt.items=[]),Rt.items.push($t.view),t.nextTick(()=>{const lr=document.querySelector(`[gs-id="${$t.view.id}"]`);$t.grid.makeWidget(lr)}))}),Sd.on("add-page-and-view",$t=>{const Rt=$.value.findIndex(lr=>lr.id===$t.pageId);if(Rt>-1){const lr=me(Rt,!0);setTimeout(()=>{Sd.emit("add-view",{pageId:lr.id,view:$t.view,filterAndWidgetContainer:$t.filterAndWidgetContainer}),f.value&&(lr.stepBackPage=f.value),f.value=lr},500)}else console.error("Page not found for adding view:",$t.pageId)}),Sd.on("empty-page",$t=>{d.value&&s.value&&s.value.id===$t.id||(Jt($t),f.value&&f.value.id===$t.id&&(f.value.stepBackPage?f.value=f.value.stepBackPage:f.value=null))}),Sd.on("filters-cancelled",$t=>{$t&&$t.removeAllChildViews()}),Sd.on("activate-save-button",()=>{g.value=!0});function Ye($t){return{...$t,gameId:$t.game_id,id:$t.game_id,seasonId:$t.season_id,status:$t.game_status,homeTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${$t.home_team}.png`,team_id:$t.home_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${$t.home_team}.png`,colloquial_name:$t.home_team_name,acronym:$t.home_team_acronym,team_name:$t.home_team_name},awayTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${$t.visiting_team}.png`,team_id:$t.visiting_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${$t.visiting_team}.png`,colloquial_name:$t.visiting_team_name,acronym:$t.visiting_team_acronym,team_name:$t.visiting_team_name}}}function st($t,Rt=!1){Rt||!a.value?(i.value=!1,_e(),ut("close")):g.value?S.value=!0:(i.value=!1,_e(),ut("close"))}function lt(){o.value=null,d.value=!1}function Ot({page:$t,view:Rt,applyMinimumSize:lr=!1}){const Zt=$t.grid;if(!$t||!Rt||!Zt)return null;const Tt=lr?{w:Rt.min_column,h:Rt.min_row}:{w:Rt.colspan,h:Rt.rowspan},Pt=Zt.willItFit(0,0,Tt.w,Tt.h,!0);return Pt?{willFit:Pt,applyMinimumSize:lr}:lr?null:Ot({page:$t,view:Rt,applyMinimumSize:!0})}const zt=new Set([9]);function Et($t){var Rt,lr,Zt,Tt,Pt,It,vr,ur,gr,Tr,Rr,St,Yt,er,or,Or,Pr,sn,qn;if($t.dynamicFilters&&$t.dynamicFilters.length>0&&$t.viewToEdit&&$t.viewToEdit.view){const jn=$t.viewToEdit.view.id;$.value.forEach(ba=>{ba.items.forEach(fa=>{fa.id===jn&&fa.coreView&&fa.coreView.id===3&&(fa.componentProps.desplegable=$t.dynamicFilters[0]||!1,fa.componentProps.key=$t.dynamicFilters[0]||!1,t.nextTick(()=>{Sd.emit("force-component-update",{itemId:fa.id,componentProps:fa.componentProps})}))})})}if($t.viewToEdit){if(!$t.viewToEdit.view.filterAndViewsContainer){const jn=new Qk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[$t.viewToEdit],((Rt=$t.viewToEdit.view.coreView)==null?void 0:Rt.id)||$t.viewToEdit.view.id,$t.dynamicFilters||[],T.value,a.value,$t.filtersJSON,dt.token,$t.filters);$t.viewToEdit.view.filterAndViewsContainer=jn}$t.viewToEdit.view.filterAndViewsContainer.updateView({view:$t.viewToEdit,dynamicFilters:$t.dynamicFilters||[],filtersJSON:$t.filtersJSON||null,filters:$t.filters}),g.value=!0}else if($t.view){$t.view.id&&$t.filterAndViewsContainer&&$t.view.id!==$t.filterAndViewsContainer.viewId&&($t.filterAndViewsContainer.removeAllChildViews(),$t.filterAndViewsContainer.setViewId($t.view.id),$t.filterAndViewsContainer.setFiltersJSON($t.filtersJSON||null)),$t.view.id&&zt.has($t.view.id)&&$t.dynamicFilters[0]&&$t.dynamicFilters[0].length===0&&$t.filterAndViewsContainer&&($t.filterAndViewsContainer.updateDynamicFilters($t.dynamicFilters,(Zt=(lr=$t.viewToEdit)==null?void 0:lr.view)==null?void 0:Zt.id),g.value=!0);const jn=f.value||s.value,ba=Ot({page:jn,view:$t.view,applyMinimumSize:!1});$t.view.filtersJSON=$t.filtersJSON||null;const fa=$t.filterAndViewsContainer,Ia=$.value.findIndex(en=>en.id===jn.id);if(fa){const en=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters,$t.filters);if(((Tt=$t.view)==null?void 0:Tt.id)===15){const Ur=(Pt=$t.filterAndViewsContainer)==null?void 0:Pt.getId();if(Ur&&E.has(Ur)){const mn=E.get(Ur);clearTimeout(mn),E.delete(Ur)}}if(((It=$t.view)==null?void 0:It.id)===17){const Ur=(vr=$t.filterAndViewsContainer)==null?void 0:vr.getId();if(Ur&&P.has(Ur)){const mn=P.get(Ur);clearTimeout(mn),P.delete(Ur)}}if(en){if(fa.setFilters($t.filters),fa.setDynamicFilters($t.dynamicFilters),ba||Ia===$.value.length-1){Sd.emit("add-view",{pageId:jn.id,view:$t.view,filterAndWidgetContainer:fa,avoidWillFit:!1,applyMinimumSize:ba?ba.applyMinimumSize:!1,dynamicFilters:$t.dynamicFilters,filters:$t.filters}),$t.filterAndViewsContainer.updateDynamicFilters($t.dynamicFilters,(gr=(ur=$t.viewToEdit)==null?void 0:ur.view)==null?void 0:gr.id),g.value=!0;let Ur=null;if(((Tr=$t.view)==null?void 0:Tr.id)===15?(t.nextTick(()=>{var mn;const Vn=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters,$t.filters);((mn=$t.dynamicFilters)==null?void 0:mn[0])===3&&Vn&&Et($t)}),Ur=setTimeout(()=>{var mn,Vn;const Jn=(mn=$t.filterAndViewsContainer)==null?void 0:mn.getId();Jn&&E.delete(Jn);const Cn=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters);((Vn=$t.dynamicFilters)==null?void 0:Vn[0])===3&&Cn&&Et($t)},200)):((Rr=$t.view)==null?void 0:Rr.id)===17?(t.nextTick(()=>{var mn,Vn;const Jn=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters,$t.filters),Cn=(mn=$t.dynamicFilters)==null?void 0:mn[0],Xr=(Vn=$t.dynamicFilters)==null?void 0:Vn[2];(Cn===3||Xr===3)&&Jn&&Et($t)}),Ur=setTimeout(()=>{var mn,Vn,Jn;const Cn=(mn=$t.filterAndViewsContainer)==null?void 0:mn.getId();Cn&&P.delete(Cn);const Xr=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters),un=(Vn=$t.dynamicFilters)==null?void 0:Vn[0],kr=(Jn=$t.dynamicFilters)==null?void 0:Jn[2];(un===3||kr===3)&&Xr&&Et($t)},200)):Ur=setTimeout(()=>{$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters,$t.filters)&&Et($t)},1e3),((St=$t.view)==null?void 0:St.id)===15&&Ur){const mn=(Yt=$t.filterAndViewsContainer)==null?void 0:Yt.getId();mn&&E.set(mn,Ur)}if(((er=$t.view)==null?void 0:er.id)===17&&Ur){const mn=(or=$t.filterAndViewsContainer)==null?void 0:or.getId();mn&&P.set(mn,Ur)}}}else $t.isAltMode?$t.viewToEdit||$t.filterAndViewsContainer.updateFilters($t.filters,(Pr=(Or=$t.viewToEdit)==null?void 0:Or.view)==null?void 0:Pr.id):$t.filterAndViewsContainer.updateDynamicFilters($t.dynamicFilters,(qn=(sn=$t.viewToEdit)==null?void 0:sn.view)==null?void 0:qn.id),g.value=!0}else if(ba||Ia===$.value.length-1){const en=new Qk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],$t.view.id,$t.dynamicFilters,T.value,a.value,$t.filtersJSON,dt.token,$t.filters);Sd.emit("set-filter-and-views-container",en),l.value.set(en.getId(),en);const Ur=$t.dynamicFilters&&($t.dynamicFilters[0]===3||$t.dynamicFilters[2]===3)&&($t.view.id===15||$t.view.id===17);$t.dynamicFilters&&(Array.isArray($t.dynamicFilters[0])||Ur)?($t.filterAndViewsContainer=en,Et($t)):Sd.emit("add-view",{pageId:jn.id,view:$t.view,filterAndWidgetContainer:en,avoidWillFit:!1,applyMinimumSize:ba?ba.applyMinimumSize:!1,dynamicFilters:$t.dynamicFilters,filters:$t.filters}),g.value=!0}}}async function qt(){if(g.value)try{const $t=[{is_front_page:!0,template_type:h.value.isPostMatch?2:1,type:h.value.id},...$.value.map(lr=>({columns:lr.originalPage?lr.originalPage.columns:12,rows:lr.originalPage?lr.originalPage.rows:12,gap:lr.originalPage?lr.originalPage.gap:10,name:lr.title,width:lr.originalPage?lr.originalPage.width:968,height:lr.originalPage?lr.originalPage.height:702,components:lr.items.reduce((Zt,Tt)=>(Tt.isDeleted||Zt.push({min_column:Tt.minWidth,min_row:Tt.minHeight,max_column:Tt.maxWidth,max_row:Tt.maxHeight,column:Tt.x,row:Tt.y,colspan:Tt.w,rowspan:Tt.h,name:Tt.name,title:Tt.title,titleShort:Tt.titleShort||Tt.title,dynamicFilters:Tt.filterAndViewsContainer.getComponentDynamicFilters(Tt.id)||Tt.filterAndViewsContainer.getDynamicFilters()||[],coreView:Tt.coreView||null,componentName:Tt.componentName,componentProps:Tt.componentProps||{},isHomeTeam:Tt.isHomeTeam||Tt.componentProps.isHomeTeamForAnalysis,filterMultiple:Tt.filterMultiple}),Zt),[])}))];console.log("pagesAux to save:",$t);const Rt=await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${p.value.user_id}/templates/${p.value.id}/pages`,{method:"PATCH",headers:{Authorization:dt.token},body:JSON.stringify({pages:$t})});L.value=!0,await Rt.json(),g.value=!1,setTimeout(()=>{L.value=!1},2e3)}catch($t){console.error("Error saving template:",$t)}}function Gt(){$.value.forEach($t=>{$t.offListeners&&$t.offListeners()})}function Jt($t){const Rt=$.value.findIndex(lr=>lr.id===$t.id);Rt>-1&&(Gt(),$.value=$.value.filter(lr=>lr.id!==$t.id),u.value>=Rt&&(u.value=Math.max(0,u.value-1)),g.value=!0)}function Qt(){g.value=!0}function sr($t){const Rt=$.value.find(lr=>lr.items.some(Zt=>Zt.id===$t.id));if(Rt){const lr=Rt.items.find(Zt=>Zt.id===$t.id);lr&&(lr.isDeleted=!0,g.value=!0)}}function hr($t){}return($t,Rt)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(Xnt,{modelValue:S.value,"onUpdate:modelValue":Rt[0]||(Rt[0]=lr=>S.value=lr),onAction:X},null,8,["modelValue"]),t.createVNode(Jnt,{"model-value":L.value},null,8,["model-value"]),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[i.value&&p.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"template-maker",style:t.normalizeStyle(V.value)},[t.withDirectives(t.createVNode(Rnt,{token:e.token,view:o.value,"is-post-match":T.value,onClose:lt,onFiltersChanged:Et},null,8,["token","view","is-post-match"]),[[t.vShow,a.value&&d.value]]),t.createElementVNode("div",Hnt,[t.createTextVNode(t.toDisplayString(p.value?p.value.name:"Nuevo template")+" ",1),t.createElementVNode("div",{class:"template-maker__header__close",onClick:st},[k.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("svg",Ynt,[...Rt[6]||(Rt[6]=[t.createElementVNode("path",{d:"M1.33398 1.33398L14.6673 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),t.createElementVNode("path",{d:"M14.666 1.33398L1.33268 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))])]),t.createElementVNode("div",Qnt,[Rt[13]||(Rt[13]=t.createElementVNode("div",{class:"template-maker__content__sidebar"},null,-1)),t.createElementVNode("div",$nt,[t.createElementVNode("div",eat,[t.createElementVNode("div",tat,[t.withDirectives(t.createVNode(xQ,{"is-post-match":T.value,"initial-cover-id":x.value,onSelectCover:z},null,8,["is-post-match","initial-cover-id"]),[[t.vShow,a.value]])]),(t.openBlock(),t.createElementBlock("div",{class:"template-maker__content__main__pages",key:$.value.length},[h.value?(t.openBlock(),t.createBlock(SYe,{key:0,id:"page-0",game:p.value.game||null,"cover-id":h.value.id,"is-post-match":h.value.isPostMatch,onIntersectionChanged:Rt[1]||(Rt[1]=lr=>xe(lr,-1))},null,8,["game","cover-id","is-post-match"])):t.createCommentVNode("",!0),a.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:"new-items-buttons",style:t.normalizeStyle({"margin-bottom":$.value.length===0?"30px":"0"})},[d.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:"new-items-buttons__add-page new-item-button",onClick:Rt[2]||(Rt[2]=lr=>me(-1))},[...Rt[7]||(Rt[7]=[t.createElementVNode("div",null,"+ Nueva página",-1),t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]))],4)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList($.value,(lr,Zt)=>(t.openBlock(),t.createElementBlock("div",{key:Zt,id:`page-${Zt+1}`,class:"template-maker__content__main__pages__page"},[t.createElementVNode("div",nat,[t.createElementVNode("div",aat,"Pag "+t.toDisplayString(j(Zt+2)),1)]),h.value?(t.openBlock(),t.createBlock(LHe,{key:0,page:lr,"is-template-mode":a.value,"is-post-match":h.value.isPostMatch,game:p.value.game||null,lastGames:p.value.lastGames||[],"is-filter-visible":d.value,onEditView:Pe,onIntersectionChanged:Tt=>xe(Tt,Zt),onChangeSort:hr,onDeletePage:Jt,onViewChanged:Qt,onDeleteView:sr},null,8,["page","is-template-mode","is-post-match","game","lastGames","is-filter-visible","onIntersectionChanged"])):t.createCommentVNode("",!0),a.value&&!d.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:"new-items-buttons",style:t.normalizeStyle({"margin-bottom":Zt+1===$.value.length?"30px":"0","margin-top":"10px"})},[t.createElementVNode("div",{class:"new-items-buttons__add-page new-item-button",onClick:Tt=>me(Zt)},[...Rt[8]||(Rt[8]=[t.createElementVNode("div",null,"+ Nueva página",-1),t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,iat),t.createElementVNode("div",{class:"new-items-buttons__add-item new-item-button",onClick:Tt=>be(lr)},[...Rt[9]||(Rt[9]=[t.createElementVNode("div",null,"+ Agregar gráfico",-1),t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M12 13.3346V6.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M8 13.3346V2.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M4 13.332V9.33203",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,oat)],4)):t.createCommentVNode("",!0)],8,rat))),128))]))]),k.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",sat,[t.createElementVNode("div",lat,[t.createElementVNode("div",cat,[t.createElementVNode("div",null,"Páginas "+t.toDisplayString(I.value),1),t.createElementVNode("div",{class:t.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:u.value<=0}]),onClick:Rt[3]||(Rt[3]=lr=>u.value>0&&ge(u.value-1))},[...Rt[10]||(Rt[10]=[t.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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),t.createElementVNode("div",{class:t.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:u.value>=$.value.length}]),onClick:Rt[4]||(Rt[4]=lr=>u.value<$.value.length&&ge(u.value+1))},[...Rt[11]||(Rt[11]=[t.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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)]),t.createElementVNode("div",uat,[t.createElementVNode("div",{role:"button",class:t.normalizeClass({active:u.value===0}),onClick:Rt[5]||(Rt[5]=lr=>ge(0))},t.toDisplayString(j(1)),3),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList($.value,(lr,Zt)=>(t.openBlock(),t.createElementBlock("div",{role:"button",key:Zt,class:t.normalizeClass({active:Zt+1===u.value}),onClick:Tt=>ge(Zt+1)},t.toDisplayString(j(Zt+2)),11,dat))),128))])]),a.value?(t.openBlock(),t.createElementBlock("div",{key:0,role:"button",class:t.normalizeClass(["template-maker__content__main__footer__save save-button",{disabled:!g.value}]),onClick:qt},[...Rt[12]||(Rt[12]=[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.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"}),t.createElementVNode("path",{d:"M11.3346 14.0013V8.66797H4.66797V14.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M4.66797 2V5.33333H10.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1),t.createElementVNode("div",null,"Guardar",-1)])],2)):t.createCommentVNode("",!0)]))])])],4)):t.createCommentVNode("",!0)]))],64))}},hat=t2(pat,[["__scopeId","data-v-97ea5669"]]);function KZ(e,r){return function(){return e.apply(r,arguments)}}const{toString:fat}=Object.prototype,{getPrototypeOf:pA}=Object,{iterator:LM,toStringTag:BZ}=Symbol,NM=(e=>r=>{const n=fat.call(r);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Zw=e=>(e=e.toLowerCase(),r=>NM(r)===e),OM=e=>r=>typeof r===e,{isArray:e7}=Array,t7=OM("undefined");function d9(e){return e!==null&&!t7(e)&&e.constructor!==null&&!t7(e.constructor)&&Y_(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const XZ=Zw("ArrayBuffer");function mat(e){let r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(e):r=e&&e.buffer&&XZ(e.buffer),r}const yat=OM("string"),Y_=OM("function"),GZ=OM("number"),p9=e=>e!==null&&typeof e=="object",gat=e=>e===!0||e===!1,MM=e=>{if(NM(e)!=="object")return!1;const r=pA(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(BZ in e)&&!(LM in e)},vat=e=>{if(!p9(e)||d9(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},bat=Zw("Date"),xat=Zw("File"),_at=Zw("Blob"),wat=Zw("FileList"),Tat=e=>p9(e)&&Y_(e.pipe),Sat=e=>{let r;return e&&(typeof FormData=="function"&&e instanceof FormData||Y_(e.append)&&((r=NM(e))==="formdata"||r==="object"&&Y_(e.toString)&&e.toString()==="[object FormData]"))},kat=Zw("URLSearchParams"),[Lat,Nat,Oat,Mat]=["ReadableStream","Request","Response","Headers"].map(Zw),Eat=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function h9(e,r,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let v,$;if(typeof e!="object"&&(e=[e]),e7(e))for(v=0,$=e.length;v<$;v++)r.call(null,e[v],v,e);else{if(d9(e))return;const h=n?Object.getOwnPropertyNames(e):Object.keys(e),u=h.length;let i;for(v=0;v<u;v++)i=h[v],r.call(null,e[i],i,e)}}function ZZ(e,r){if(d9(e))return null;r=r.toLowerCase();const n=Object.keys(e);let v=n.length,$;for(;v-- >0;)if($=n[v],r===$.toLowerCase())return $;return null}const OS=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,JZ=e=>!t7(e)&&e!==OS;function hA(){const{caseless:e,skipUndefined:r}=JZ(this)&&this||{},n={},v=($,h)=>{const u=e&&ZZ(n,h)||h;MM(n[u])&&MM($)?n[u]=hA(n[u],$):MM($)?n[u]=hA({},$):e7($)?n[u]=$.slice():(!r||!t7($))&&(n[u]=$)};for(let $=0,h=arguments.length;$<h;$++)arguments[$]&&h9(arguments[$],v);return n}const Cat=(e,r,n,{allOwnKeys:v}={})=>(h9(r,($,h)=>{n&&Y_($)?e[h]=KZ($,n):e[h]=$},{allOwnKeys:v}),e),zat=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Vat=(e,r,n,v)=>{e.prototype=Object.create(r.prototype,v),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:r.prototype}),n&&Object.assign(e.prototype,n)},Pat=(e,r,n,v)=>{let $,h,u;const i={};if(r=r||{},e==null)return r;do{for($=Object.getOwnPropertyNames(e),h=$.length;h-- >0;)u=$[h],(!v||v(u,e,r))&&!i[u]&&(r[u]=e[u],i[u]=!0);e=n!==!1&&pA(e)}while(e&&(!n||n(e,r))&&e!==Object.prototype);return r},Aat=(e,r,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=r.length;const v=e.indexOf(r,n);return v!==-1&&v===n},Rat=e=>{if(!e)return null;if(e7(e))return e;let r=e.length;if(!GZ(r))return null;const n=new Array(r);for(;r-- >0;)n[r]=e[r];return n},Uat=(e=>r=>e&&r instanceof e)(typeof Uint8Array<"u"&&pA(Uint8Array)),Fat=(e,r)=>{const v=(e&&e[LM]).call(e);let $;for(;($=v.next())&&!$.done;){const h=$.value;r.call(e,h[0],h[1])}},Iat=(e,r)=>{let n;const v=[];for(;(n=e.exec(r))!==null;)v.push(n);return v},qat=Zw("HTMLFormElement"),jat=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,v,$){return v.toUpperCase()+$}),HZ=(({hasOwnProperty:e})=>(r,n)=>e.call(r,n))(Object.prototype),Dat=Zw("RegExp"),YZ=(e,r)=>{const n=Object.getOwnPropertyDescriptors(e),v={};h9(n,($,h)=>{let u;(u=r($,h,e))!==!1&&(v[h]=u||$)}),Object.defineProperties(e,v)},Wat=e=>{YZ(e,(r,n)=>{if(Y_(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const v=e[n];if(Y_(v)){if(r.enumerable=!1,"writable"in r){r.writable=!1;return}r.set||(r.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Kat=(e,r)=>{const n={},v=$=>{$.forEach(h=>{n[h]=!0})};return e7(e)?v(e):v(String(e).split(r)),n},Bat=()=>{},Xat=(e,r)=>e!=null&&Number.isFinite(e=+e)?e:r;function Gat(e){return!!(e&&Y_(e.append)&&e[BZ]==="FormData"&&e[LM])}const Zat=e=>{const r=new Array(10),n=(v,$)=>{if(p9(v)){if(r.indexOf(v)>=0)return;if(d9(v))return v;if(!("toJSON"in v)){r[$]=v;const h=e7(v)?[]:{};return h9(v,(u,i)=>{const p=n(u,$+1);!t7(p)&&(h[i]=p)}),r[$]=void 0,h}}return v};return n(e,0)},Jat=Zw("AsyncFunction"),Hat=e=>e&&(p9(e)||Y_(e))&&Y_(e.then)&&Y_(e.catch),QZ=((e,r)=>e?setImmediate:r?((n,v)=>(OS.addEventListener("message",({source:$,data:h})=>{$===OS&&h===n&&v.length&&v.shift()()},!1),$=>{v.push($),OS.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Y_(OS.postMessage)),Yat=typeof queueMicrotask<"u"?queueMicrotask.bind(OS):typeof process<"u"&&process.nextTick||QZ,nu={isArray:e7,isArrayBuffer:XZ,isBuffer:d9,isFormData:Sat,isArrayBufferView:mat,isString:yat,isNumber:GZ,isBoolean:gat,isObject:p9,isPlainObject:MM,isEmptyObject:vat,isReadableStream:Lat,isRequest:Nat,isResponse:Oat,isHeaders:Mat,isUndefined:t7,isDate:bat,isFile:xat,isBlob:_at,isRegExp:Dat,isFunction:Y_,isStream:Tat,isURLSearchParams:kat,isTypedArray:Uat,isFileList:wat,forEach:h9,merge:hA,extend:Cat,trim:Eat,stripBOM:zat,inherits:Vat,toFlatObject:Pat,kindOf:NM,kindOfTest:Zw,endsWith:Aat,toArray:Rat,forEachEntry:Fat,matchAll:Iat,isHTMLForm:qat,hasOwnProperty:HZ,hasOwnProp:HZ,reduceDescriptors:YZ,freezeMethods:Wat,toObjectSet:Kat,toCamelCase:jat,noop:Bat,toFiniteNumber:Xat,findKey:ZZ,global:OS,isContextDefined:JZ,isSpecCompliantForm:Gat,toJSONObject:Zat,isAsyncFn:Jat,isThenable:Hat,setImmediate:QZ,asap:Yat,isIterable:e=>e!=null&&Y_(e[LM])};function Rm(e,r,n,v,$){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",r&&(this.code=r),n&&(this.config=n),v&&(this.request=v),$&&(this.response=$,this.status=$.status?$.status:null)}nu.inherits(Rm,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:nu.toJSONObject(this.config),code:this.code,status:this.status}}});const $Z=Rm.prototype,eJ={};["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=>{eJ[e]={value:e}}),Object.defineProperties(Rm,eJ),Object.defineProperty($Z,"isAxiosError",{value:!0}),Rm.from=(e,r,n,v,$,h)=>{const u=Object.create($Z);nu.toFlatObject(e,u,function(a){return a!==Error.prototype},c=>c!=="isAxiosError");const i=e&&e.message?e.message:"Error",p=r==null&&e?e.code:r;return Rm.call(u,i,p,n,v,$),e&&u.cause==null&&Object.defineProperty(u,"cause",{value:e,configurable:!0}),u.name=e&&e.name||"Error",h&&Object.assign(u,h),u};const Qat=null;function fA(e){return nu.isPlainObject(e)||nu.isArray(e)}function tJ(e){return nu.endsWith(e,"[]")?e.slice(0,-2):e}function rJ(e,r,n){return e?e.concat(r).map(function($,h){return $=tJ($),!n&&h?"["+$+"]":$}).join(n?".":""):r}function $at(e){return nu.isArray(e)&&!e.some(fA)}const eit=nu.toFlatObject(nu,{},null,function(r){return/^is[A-Z]/.test(r)});function EM(e,r,n){if(!nu.isObject(e))throw new TypeError("target must be an object");r=r||new FormData,n=nu.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(o,l){return!nu.isUndefined(l[o])});const v=n.metaTokens,$=n.visitor||a,h=n.dots,u=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&nu.isSpecCompliantForm(r);if(!nu.isFunction($))throw new TypeError("visitor must be a function");function c(d){if(d===null)return"";if(nu.isDate(d))return d.toISOString();if(nu.isBoolean(d))return d.toString();if(!p&&nu.isBlob(d))throw new Rm("Blob is not supported. Use a Buffer instead.");return nu.isArrayBuffer(d)||nu.isTypedArray(d)?p&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function a(d,o,l){let s=d;if(d&&!l&&typeof d=="object"){if(nu.endsWith(o,"{}"))o=v?o:o.slice(0,-2),d=JSON.stringify(d);else if(nu.isArray(d)&&$at(d)||(nu.isFileList(d)||nu.endsWith(o,"[]"))&&(s=nu.toArray(d)))return o=tJ(o),s.forEach(function(g,S){!(nu.isUndefined(g)||g===null)&&r.append(u===!0?rJ([o],S,h):u===null?o:o+"[]",c(g))}),!1}return fA(d)?!0:(r.append(rJ(l,o,h),c(d)),!1)}const k=[],T=Object.assign(eit,{defaultVisitor:a,convertValue:c,isVisitable:fA});function x(d,o){if(!nu.isUndefined(d)){if(k.indexOf(d)!==-1)throw Error("Circular reference detected in "+o.join("."));k.push(d),nu.forEach(d,function(s,f){(!(nu.isUndefined(s)||s===null)&&$.call(r,s,nu.isString(f)?f.trim():f,o,T))===!0&&x(s,o?o.concat(f):[f])}),k.pop()}}if(!nu.isObject(e))throw new TypeError("data must be an object");return x(e),r}function nJ(e){const r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(v){return r[v]})}function mA(e,r){this._pairs=[],e&&EM(e,this,r)}const aJ=mA.prototype;aJ.append=function(r,n){this._pairs.push([r,n])},aJ.toString=function(r){const n=r?function(v){return r.call(this,v,nJ)}:nJ;return this._pairs.map(function($){return n($[0])+"="+n($[1])},"").join("&")};function tit(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function iJ(e,r,n){if(!r)return e;const v=n&&n.encode||tit;nu.isFunction(n)&&(n={serialize:n});const $=n&&n.serialize;let h;if($?h=$(r,n):h=nu.isURLSearchParams(r)?r.toString():new mA(r,n).toString(v),h){const u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+h}return e}class oJ{constructor(){this.handlers=[]}use(r,n,v){return this.handlers.push({fulfilled:r,rejected:n,synchronous:v?v.synchronous:!1,runWhen:v?v.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){nu.forEach(this.handlers,function(v){v!==null&&r(v)})}}const sJ={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},rit={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:mA,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},yA=typeof window<"u"&&typeof document<"u",gA=typeof navigator=="object"&&navigator||void 0,nit=yA&&(!gA||["ReactNative","NativeScript","NS"].indexOf(gA.product)<0),ait=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",iit=yA&&window.location.href||"http://localhost",Wx={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:yA,hasStandardBrowserEnv:nit,hasStandardBrowserWebWorkerEnv:ait,navigator:gA,origin:iit},Symbol.toStringTag,{value:"Module"})),...rit};function oit(e,r){return EM(e,new Wx.classes.URLSearchParams,{visitor:function(n,v,$,h){return Wx.isNode&&nu.isBuffer(n)?(this.append(v,n.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)},...r})}function sit(e){return nu.matchAll(/\w+|\[(\w*)]/g,e).map(r=>r[0]==="[]"?"":r[1]||r[0])}function lit(e){const r={},n=Object.keys(e);let v;const $=n.length;let h;for(v=0;v<$;v++)h=n[v],r[h]=e[h];return r}function lJ(e){function r(n,v,$,h){let u=n[h++];if(u==="__proto__")return!0;const i=Number.isFinite(+u),p=h>=n.length;return u=!u&&nu.isArray($)?$.length:u,p?(nu.hasOwnProp($,u)?$[u]=[$[u],v]:$[u]=v,!i):((!$[u]||!nu.isObject($[u]))&&($[u]=[]),r(n,v,$[u],h)&&nu.isArray($[u])&&($[u]=lit($[u])),!i)}if(nu.isFormData(e)&&nu.isFunction(e.entries)){const n={};return nu.forEachEntry(e,(v,$)=>{r(sit(v),$,n,0)}),n}return null}function cit(e,r,n){if(nu.isString(e))try{return(r||JSON.parse)(e),nu.trim(e)}catch(v){if(v.name!=="SyntaxError")throw v}return(n||JSON.stringify)(e)}const f9={transitional:sJ,adapter:["xhr","http","fetch"],transformRequest:[function(r,n){const v=n.getContentType()||"",$=v.indexOf("application/json")>-1,h=nu.isObject(r);if(h&&nu.isHTMLForm(r)&&(r=new FormData(r)),nu.isFormData(r))return $?JSON.stringify(lJ(r)):r;if(nu.isArrayBuffer(r)||nu.isBuffer(r)||nu.isStream(r)||nu.isFile(r)||nu.isBlob(r)||nu.isReadableStream(r))return r;if(nu.isArrayBufferView(r))return r.buffer;if(nu.isURLSearchParams(r))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let i;if(h){if(v.indexOf("application/x-www-form-urlencoded")>-1)return oit(r,this.formSerializer).toString();if((i=nu.isFileList(r))||v.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return EM(i?{"files[]":r}:r,p&&new p,this.formSerializer)}}return h||$?(n.setContentType("application/json",!1),cit(r)):r}],transformResponse:[function(r){const n=this.transitional||f9.transitional,v=n&&n.forcedJSONParsing,$=this.responseType==="json";if(nu.isResponse(r)||nu.isReadableStream(r))return r;if(r&&nu.isString(r)&&(v&&!this.responseType||$)){const u=!(n&&n.silentJSONParsing)&&$;try{return JSON.parse(r,this.parseReviver)}catch(i){if(u)throw i.name==="SyntaxError"?Rm.from(i,Rm.ERR_BAD_RESPONSE,this,null,this.response):i}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Wx.classes.FormData,Blob:Wx.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};nu.forEach(["delete","get","head","post","put","patch"],e=>{f9.headers[e]={}});const uit=nu.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"]),dit=e=>{const r={};let n,v,$;return e&&e.split(`
7994
7994
  `).forEach(function(u){$=u.indexOf(":"),n=u.substring(0,$).trim().toLowerCase(),v=u.substring($+1).trim(),!(!n||r[n]&&uit[n])&&(n==="set-cookie"?r[n]?r[n].push(v):r[n]=[v]:r[n]=r[n]?r[n]+", "+v:v)}),r},cJ=Symbol("internals");function m9(e){return e&&String(e).trim().toLowerCase()}function CM(e){return e===!1||e==null?e:nu.isArray(e)?e.map(CM):String(e)}function pit(e){const r=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let v;for(;v=n.exec(e);)r[v[1]]=v[2];return r}const hit=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function vA(e,r,n,v,$){if(nu.isFunction(v))return v.call(this,r,n);if($&&(r=n),!!nu.isString(r)){if(nu.isString(v))return r.indexOf(v)!==-1;if(nu.isRegExp(v))return v.test(r)}}function fit(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(r,n,v)=>n.toUpperCase()+v)}function mit(e,r){const n=nu.toCamelCase(" "+r);["get","set","has"].forEach(v=>{Object.defineProperty(e,v+n,{value:function($,h,u){return this[v].call(this,r,$,h,u)},configurable:!0})})}let Q_=class{constructor(r){r&&this.set(r)}set(r,n,v){const $=this;function h(i,p,c){const a=m9(p);if(!a)throw new Error("header name must be a non-empty string");const k=nu.findKey($,a);(!k||$[k]===void 0||c===!0||c===void 0&&$[k]!==!1)&&($[k||p]=CM(i))}const u=(i,p)=>nu.forEach(i,(c,a)=>h(c,a,p));if(nu.isPlainObject(r)||r instanceof this.constructor)u(r,n);else if(nu.isString(r)&&(r=r.trim())&&!hit(r))u(dit(r),n);else if(nu.isObject(r)&&nu.isIterable(r)){let i={},p,c;for(const a of r){if(!nu.isArray(a))throw TypeError("Object iterator must return a key-value pair");i[c=a[0]]=(p=i[c])?nu.isArray(p)?[...p,a[1]]:[p,a[1]]:a[1]}u(i,n)}else r!=null&&h(n,r,v);return this}get(r,n){if(r=m9(r),r){const v=nu.findKey(this,r);if(v){const $=this[v];if(!n)return $;if(n===!0)return pit($);if(nu.isFunction(n))return n.call(this,$,v);if(nu.isRegExp(n))return n.exec($);throw new TypeError("parser must be boolean|regexp|function")}}}has(r,n){if(r=m9(r),r){const v=nu.findKey(this,r);return!!(v&&this[v]!==void 0&&(!n||vA(this,this[v],v,n)))}return!1}delete(r,n){const v=this;let $=!1;function h(u){if(u=m9(u),u){const i=nu.findKey(v,u);i&&(!n||vA(v,v[i],i,n))&&(delete v[i],$=!0)}}return nu.isArray(r)?r.forEach(h):h(r),$}clear(r){const n=Object.keys(this);let v=n.length,$=!1;for(;v--;){const h=n[v];(!r||vA(this,this[h],h,r,!0))&&(delete this[h],$=!0)}return $}normalize(r){const n=this,v={};return nu.forEach(this,($,h)=>{const u=nu.findKey(v,h);if(u){n[u]=CM($),delete n[h];return}const i=r?fit(h):String(h).trim();i!==h&&delete n[h],n[i]=CM($),v[i]=!0}),this}concat(...r){return this.constructor.concat(this,...r)}toJSON(r){const n=Object.create(null);return nu.forEach(this,(v,$)=>{v!=null&&v!==!1&&(n[$]=r&&nu.isArray(v)?v.join(", "):v)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([r,n])=>r+": "+n).join(`
7995
7995
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(r){return r instanceof this?r:new this(r)}static concat(r,...n){const v=new this(r);return n.forEach($=>v.set($)),v}static accessor(r){const v=(this[cJ]=this[cJ]={accessors:{}}).accessors,$=this.prototype;function h(u){const i=m9(u);v[i]||(mit($,u),v[i]=!0)}return nu.isArray(r)?r.forEach(h):h(r),this}};Q_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),nu.reduceDescriptors(Q_.prototype,({value:e},r)=>{let n=r[0].toUpperCase()+r.slice(1);return{get:()=>e,set(v){this[n]=v}}}),nu.freezeMethods(Q_);function bA(e,r){const n=this||f9,v=r||n,$=Q_.from(v.headers);let h=v.data;return nu.forEach(e,function(i){h=i.call(n,h,$.normalize(),r?r.status:void 0)}),$.normalize(),h}function uJ(e){return!!(e&&e.__CANCEL__)}function r7(e,r,n){Rm.call(this,e??"canceled",Rm.ERR_CANCELED,r,n),this.name="CanceledError"}nu.inherits(r7,Rm,{__CANCEL__:!0});function dJ(e,r,n){const v=n.config.validateStatus;!n.status||!v||v(n.status)?e(n):r(new Rm("Request failed with status code "+n.status,[Rm.ERR_BAD_REQUEST,Rm.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function yit(e){const r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return r&&r[1]||""}function git(e,r){e=e||10;const n=new Array(e),v=new Array(e);let $=0,h=0,u;return r=r!==void 0?r:1e3,function(p){const c=Date.now(),a=v[h];u||(u=c),n[$]=p,v[$]=c;let k=h,T=0;for(;k!==$;)T+=n[k++],k=k%e;if($=($+1)%e,$===h&&(h=(h+1)%e),c-u<r)return;const x=a&&c-a;return x?Math.round(T*1e3/x):void 0}}function vit(e,r){let n=0,v=1e3/r,$,h;const u=(c,a=Date.now())=>{n=a,$=null,h&&(clearTimeout(h),h=null),e(...c)};return[(...c)=>{const a=Date.now(),k=a-n;k>=v?u(c,a):($=c,h||(h=setTimeout(()=>{h=null,u($)},v-k)))},()=>$&&u($)]}const zM=(e,r,n=3)=>{let v=0;const $=git(50,250);return vit(h=>{const u=h.loaded,i=h.lengthComputable?h.total:void 0,p=u-v,c=$(p),a=u<=i;v=u;const k={loaded:u,total:i,progress:i?u/i:void 0,bytes:p,rate:c||void 0,estimated:c&&i&&a?(i-u)/c:void 0,event:h,lengthComputable:i!=null,[r?"download":"upload"]:!0};e(k)},n)},pJ=(e,r)=>{const n=e!=null;return[v=>r[0]({lengthComputable:n,total:e,loaded:v}),r[1]]},hJ=e=>(...r)=>nu.asap(()=>e(...r)),bit=Wx.hasStandardBrowserEnv?((e,r)=>n=>(n=new URL(n,Wx.origin),e.protocol===n.protocol&&e.host===n.host&&(r||e.port===n.port)))(new URL(Wx.origin),Wx.navigator&&/(msie|trident)/i.test(Wx.navigator.userAgent)):()=>!0,xit=Wx.hasStandardBrowserEnv?{write(e,r,n,v,$,h,u){if(typeof document>"u")return;const i=[`${e}=${encodeURIComponent(r)}`];nu.isNumber(n)&&i.push(`expires=${new Date(n).toUTCString()}`),nu.isString(v)&&i.push(`path=${v}`),nu.isString($)&&i.push(`domain=${$}`),h===!0&&i.push("secure"),nu.isString(u)&&i.push(`SameSite=${u}`),document.cookie=i.join("; ")},read(e){if(typeof document>"u")return null;const r=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return r?decodeURIComponent(r[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function _it(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function wit(e,r){return r?e.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):e}function fJ(e,r,n){let v=!_it(r);return e&&(v||n==!1)?wit(e,r):r}const mJ=e=>e instanceof Q_?{...e}:e;function MS(e,r){r=r||{};const n={};function v(c,a,k,T){return nu.isPlainObject(c)&&nu.isPlainObject(a)?nu.merge.call({caseless:T},c,a):nu.isPlainObject(a)?nu.merge({},a):nu.isArray(a)?a.slice():a}function $(c,a,k,T){if(nu.isUndefined(a)){if(!nu.isUndefined(c))return v(void 0,c,k,T)}else return v(c,a,k,T)}function h(c,a){if(!nu.isUndefined(a))return v(void 0,a)}function u(c,a){if(nu.isUndefined(a)){if(!nu.isUndefined(c))return v(void 0,c)}else return v(void 0,a)}function i(c,a,k){if(k in r)return v(c,a);if(k in e)return v(void 0,c)}const p={url:h,method:h,data:h,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:i,headers:(c,a,k)=>$(mJ(c),mJ(a),k,!0)};return nu.forEach(Object.keys({...e,...r}),function(a){const k=p[a]||$,T=k(e[a],r[a],a);nu.isUndefined(T)&&k!==i||(n[a]=T)}),n}const yJ=e=>{const r=MS({},e);let{data:n,withXSRFToken:v,xsrfHeaderName:$,xsrfCookieName:h,headers:u,auth:i}=r;if(r.headers=u=Q_.from(u),r.url=iJ(fJ(r.baseURL,r.url,r.allowAbsoluteUrls),e.params,e.paramsSerializer),i&&u.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),nu.isFormData(n)){if(Wx.hasStandardBrowserEnv||Wx.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(nu.isFunction(n.getHeaders)){const p=n.getHeaders(),c=["content-type","content-length"];Object.entries(p).forEach(([a,k])=>{c.includes(a.toLowerCase())&&u.set(a,k)})}}if(Wx.hasStandardBrowserEnv&&(v&&nu.isFunction(v)&&(v=v(r)),v||v!==!1&&bit(r.url))){const p=$&&h&&xit.read(h);p&&u.set($,p)}return r},Tit=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,v){const $=yJ(e);let h=$.data;const u=Q_.from($.headers).normalize();let{responseType:i,onUploadProgress:p,onDownloadProgress:c}=$,a,k,T,x,d;function o(){x&&x(),d&&d(),$.cancelToken&&$.cancelToken.unsubscribe(a),$.signal&&$.signal.removeEventListener("abort",a)}let l=new XMLHttpRequest;l.open($.method.toUpperCase(),$.url,!0),l.timeout=$.timeout;function s(){if(!l)return;const g=Q_.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),L={data:!i||i==="text"||i==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:g,config:e,request:l};dJ(function(P){n(P),o()},function(P){v(P),o()},L),l=null}"onloadend"in l?l.onloadend=s:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(s)},l.onabort=function(){l&&(v(new Rm("Request aborted",Rm.ECONNABORTED,e,l)),l=null)},l.onerror=function(S){const L=S&&S.message?S.message:"Network Error",E=new Rm(L,Rm.ERR_NETWORK,e,l);E.event=S||null,v(E),l=null},l.ontimeout=function(){let S=$.timeout?"timeout of "+$.timeout+"ms exceeded":"timeout exceeded";const L=$.transitional||sJ;$.timeoutErrorMessage&&(S=$.timeoutErrorMessage),v(new Rm(S,L.clarifyTimeoutError?Rm.ETIMEDOUT:Rm.ECONNABORTED,e,l)),l=null},h===void 0&&u.setContentType(null),"setRequestHeader"in l&&nu.forEach(u.toJSON(),function(S,L){l.setRequestHeader(L,S)}),nu.isUndefined($.withCredentials)||(l.withCredentials=!!$.withCredentials),i&&i!=="json"&&(l.responseType=$.responseType),c&&([T,d]=zM(c,!0),l.addEventListener("progress",T)),p&&l.upload&&([k,x]=zM(p),l.upload.addEventListener("progress",k),l.upload.addEventListener("loadend",x)),($.cancelToken||$.signal)&&(a=g=>{l&&(v(!g||g.type?new r7(null,e,l):g),l.abort(),l=null)},$.cancelToken&&$.cancelToken.subscribe(a),$.signal&&($.signal.aborted?a():$.signal.addEventListener("abort",a)));const f=yit($.url);if(f&&Wx.protocols.indexOf(f)===-1){v(new Rm("Unsupported protocol "+f+":",Rm.ERR_BAD_REQUEST,e));return}l.send(h||null)})},Sit=(e,r)=>{const{length:n}=e=e?e.filter(Boolean):[];if(r||n){let v=new AbortController,$;const h=function(c){if(!$){$=!0,i();const a=c instanceof Error?c:this.reason;v.abort(a instanceof Rm?a:new r7(a instanceof Error?a.message:a))}};let u=r&&setTimeout(()=>{u=null,h(new Rm(`timeout ${r} of ms exceeded`,Rm.ETIMEDOUT))},r);const i=()=>{e&&(u&&clearTimeout(u),u=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(h):c.removeEventListener("abort",h)}),e=null)};e.forEach(c=>c.addEventListener("abort",h));const{signal:p}=v;return p.unsubscribe=()=>nu.asap(i),p}},kit=function*(e,r){let n=e.byteLength;if(n<r){yield e;return}let v=0,$;for(;v<n;)$=v+r,yield e.slice(v,$),v=$},Lit=async function*(e,r){for await(const n of Nit(e))yield*kit(n,r)},Nit=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const r=e.getReader();try{for(;;){const{done:n,value:v}=await r.read();if(n)break;yield v}}finally{await r.cancel()}},gJ=(e,r,n,v)=>{const $=Lit(e,r);let h=0,u,i=p=>{u||(u=!0,v&&v(p))};return new ReadableStream({async pull(p){try{const{done:c,value:a}=await $.next();if(c){i(),p.close();return}let k=a.byteLength;if(n){let T=h+=k;n(T)}p.enqueue(new Uint8Array(a))}catch(c){throw i(c),c}},cancel(p){return i(p),$.return()}},{highWaterMark:2})},vJ=64*1024,{isFunction:VM}=nu,Oit=(({Request:e,Response:r})=>({Request:e,Response:r}))(nu.global),{ReadableStream:bJ,TextEncoder:xJ}=nu.global,_J=(e,...r)=>{try{return!!e(...r)}catch{return!1}},Mit=e=>{e=nu.merge.call({skipUndefined:!0},Oit,e);const{fetch:r,Request:n,Response:v}=e,$=r?VM(r):typeof fetch=="function",h=VM(n),u=VM(v);if(!$)return!1;const i=$&&VM(bJ),p=$&&(typeof xJ=="function"?(d=>o=>d.encode(o))(new xJ):async d=>new Uint8Array(await new n(d).arrayBuffer())),c=h&&i&&_J(()=>{let d=!1;const o=new n(Wx.origin,{body:new bJ,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!o}),a=u&&i&&_J(()=>nu.isReadableStream(new v("").body)),k={stream:a&&(d=>d.body)};$&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!k[d]&&(k[d]=(o,l)=>{let s=o&&o[d];if(s)return s.call(o);throw new Rm(`Response type '${d}' is not supported`,Rm.ERR_NOT_SUPPORT,l)})});const T=async d=>{if(d==null)return 0;if(nu.isBlob(d))return d.size;if(nu.isSpecCompliantForm(d))return(await new n(Wx.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(nu.isArrayBufferView(d)||nu.isArrayBuffer(d))return d.byteLength;if(nu.isURLSearchParams(d)&&(d=d+""),nu.isString(d))return(await p(d)).byteLength},x=async(d,o)=>{const l=nu.toFiniteNumber(d.getContentLength());return l??T(o)};return async d=>{let{url:o,method:l,data:s,signal:f,cancelToken:g,timeout:S,onDownloadProgress:L,onUploadProgress:E,responseType:P,headers:V,withCredentials:I="same-origin",fetchOptions:j}=yJ(d),U=r||fetch;P=P?(P+"").toLowerCase():"text";let D=Sit([f,g&&g.toAbortSignal()],S),F=null;const z=D&&D.unsubscribe&&(()=>{D.unsubscribe()});let X;try{if(E&&c&&l!=="get"&&l!=="head"&&(X=await x(V,s))!==0){let be=new n(o,{method:"POST",body:s,duplex:"half"}),xe;if(nu.isFormData(s)&&(xe=be.headers.get("content-type"))&&V.setContentType(xe),be.body){const[Pe,je]=pJ(X,zM(hJ(E)));s=gJ(be.body,vJ,Pe,je)}}nu.isString(I)||(I=I?"include":"omit");const M=h&&"credentials"in n.prototype,Y={...j,signal:D,method:l.toUpperCase(),headers:V.normalize().toJSON(),body:s,duplex:"half",credentials:M?I:void 0};F=h&&new n(o,Y);let se=await(h?U(F,j):U(o,Y));const me=a&&(P==="stream"||P==="response");if(a&&(L||me&&z)){const be={};["status","statusText","headers"].forEach(_e=>{be[_e]=se[_e]});const xe=nu.toFiniteNumber(se.headers.get("content-length")),[Pe,je]=L&&pJ(xe,zM(hJ(L),!0))||[];se=new v(gJ(se.body,vJ,Pe,()=>{je&&je(),z&&z()}),be)}P=P||"text";let ge=await k[nu.findKey(k,P)||"text"](se,d);return!me&&z&&z(),await new Promise((be,xe)=>{dJ(be,xe,{data:ge,headers:Q_.from(se.headers),status:se.status,statusText:se.statusText,config:d,request:F})})}catch(M){throw z&&z(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new Rm("Network Error",Rm.ERR_NETWORK,d,F),{cause:M.cause||M}):Rm.from(M,M&&M.code,d,F)}}},Eit=new Map,wJ=e=>{let r=e&&e.env||{};const{fetch:n,Request:v,Response:$}=r,h=[v,$,n];let u=h.length,i=u,p,c,a=Eit;for(;i--;)p=h[i],c=a.get(p),c===void 0&&a.set(p,c=i?new Map:Mit(r)),a=c;return c};wJ();const xA={http:Qat,xhr:Tit,fetch:{get:wJ}};nu.forEach(xA,(e,r)=>{if(e){try{Object.defineProperty(e,"name",{value:r})}catch{}Object.defineProperty(e,"adapterName",{value:r})}});const TJ=e=>`- ${e}`,Cit=e=>nu.isFunction(e)||e===null||e===!1;function zit(e,r){e=nu.isArray(e)?e:[e];const{length:n}=e;let v,$;const h={};for(let u=0;u<n;u++){v=e[u];let i;if($=v,!Cit(v)&&($=xA[(i=String(v)).toLowerCase()],$===void 0))throw new Rm(`Unknown adapter '${i}'`);if($&&(nu.isFunction($)||($=$.get(r))))break;h[i||"#"+u]=$}if(!$){const u=Object.entries(h).map(([p,c])=>`adapter ${p} `+(c===!1?"is not supported by the environment":"is not available in the build"));let i=n?u.length>1?`since :
7996
7996
  `+u.map(TJ).join(`