@golstats/gsc-reports 1.0.91 → 1.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{FilterConditions-55d68355-DMqzcKBO-wrp6BUT3-Dp7zzNNA.js → FilterConditions-55d68355-DMqzcKBO-C6ez4fsi-d9p1oGAu.js} +1 -1
- package/dist/{FilterField-59a73e38-CNaE03Ge-BUKXpbc--BlMVo3Ge.js → FilterField-59a73e38-CNaE03Ge-D7KFOAII-fuX0tD_2.js} +1 -1
- package/dist/{FilterSubcategories-a9b32cc9-_h5FCZ4r-CVsIKvd8-C0uU1PfL.js → FilterSubcategories-a9b32cc9-_h5FCZ4r-Bh7E_iYD-CqKqTfyh.js} +1 -1
- package/dist/gsc-reports.css +1 -1
- package/dist/gsc-reports.es.js +1 -1
- package/dist/gsc-reports.umd.js +1 -1
- package/dist/{index-Chk-5rv_.js → index-BJNwu3I4.js} +5 -5
- package/package.json +2 -2
package/dist/gsc-reports.umd.js
CHANGED
|
@@ -4128,7 +4128,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
4128
4128
|
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
|
|
4129
4129
|
*/const ud=new C9e;class bi{static init(r={},n=".grid-stack"){if(typeof document>"u")return null;const b=bi.getGridElement(n);return b?(b.gridstack||(b.gridstack=new bi(b,Ya.cloneDeep(r))),b.gridstack):(console.error(typeof n=="string"?'GridStack.initAll() no grid was found with selector "'+n+`" - element missing or wrong selector ?
|
|
4130
4130
|
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 b=[];return typeof document>"u"||(bi.getGridElements(n).forEach(R=>{R.gridstack||(R.gridstack=new bi(R,Ya.cloneDeep(r))),b.push(R.gridstack)}),b.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+n+`" - element missing or wrong selector ?
|
|
4131
|
-
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),b}static addGrid(r,n={}){if(!r)return null;let b=r;if(b.gridstack){const R=b.gridstack;return n&&(R.opts={...R.opts,...n}),n.children!==void 0&&R.load(n.children),R}return(!r.classList.contains("grid-stack")||bi.addRemoveCB)&&(bi.addRemoveCB?b=bi.addRemoveCB(r,n,!0,!0):b=Ya.createDiv(["grid-stack",n.class],r)),bi.init(n,b)}static registerEngine(r){bi.engineClass=r}get placeholder(){if(!this._placeholder){this._placeholder=Ya.createDiv([this.opts.placeholderClass,Yd.itemClass,this.opts.itemClass]);const r=Ya.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(r.textContent=this.opts.placeholderText)}return this._placeholder}constructor(r,n={}){var b;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 R=Ya.toNumber(r.getAttribute("gs-row"));n.column==="auto"&&delete n.column,n.alwaysShowResizeHandle!==void 0&&(n._alwaysShowResizeHandle=n.alwaysShowResizeHandle);const y=n.columnOpts;if(y){const a=y.breakpoints;!y.columnWidth&&!(a!=null&&a.length)?delete n.columnOpts:(y.columnMax=y.columnMax||12,(a==null?void 0:a.length)>1&&a.sort((S,x)=>(x.w||0)-(S.w||0)))}const c={...Ya.cloneDeep(Yd),column:Ya.toNumber(r.getAttribute("gs-column"))||Yd.column,minRow:R||Ya.toNumber(r.getAttribute("gs-min-row"))||Yd.minRow,maxRow:R||Ya.toNumber(r.getAttribute("gs-max-row"))||Yd.maxRow,staticGrid:Ya.toBool(r.getAttribute("gs-static"))||Yd.staticGrid,sizeToContent:Ya.toBool(r.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(n.handleClass?"."+n.handleClass:n.handle?n.handle:"")||Yd.draggable.handle},removableOptions:{accept:n.itemClass||Yd.removableOptions.accept,decline:Yd.removableOptions.decline}};r.getAttribute("gs-animate")&&(c.animate=Ya.toBool(r.getAttribute("gs-animate"))),n=Ya.defaults(n,c),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("."+Yd.itemClass),d=i==null?void 0:i.gridstackNode;if(d&&(d.subGrid=this,this.parentGridNode=d,this.el.classList.add("grid-stack-nested"),d.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!==Yd.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=Hp),this._setStaticClass();const l=n.engineClass||bi.engineClass||Gh;if(this.engine=new l({column:this.getColumn(),float:n.float,maxRow:n.maxRow,onChange:a=>{a.forEach(S=>{const x=S.el;x&&(S._removeDOM?(x&&x.remove(),delete S._removeDOM):this._writePosAttr(x,S))}),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&&!Mi.pauseDrag&&(Mi.pauseDrag=!0),((b=n.draggable)==null?void 0:b.pause)!==void 0&&(Mi.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,b=r;if(b.grid=this,b.el?n=b.el:bi.addRemoveCB?n=bi.addRemoveCB(this.el,r,!0,!1):n=this.createWidgetDivs(b),!n)return;if(b=n.gridstackNode,b&&n.parentElement===this.el&&this.engine.nodes.find(y=>y._id===b._id))return n;const R=this._readAttr(n);return Ya.defaults(r,R),this.engine.prepareNode(r),this.el.appendChild(n),this.makeWidget(n,r),n}createWidgetDivs(r){const n=Ya.createDiv(["grid-stack-item",this.opts.itemClass]),b=Ya.createDiv(["grid-stack-item-content"],n);return Ya.lazyLoad(r)?r.visibleObservable||(r.visibleObservable=new IntersectionObserver(([R])=>{var y,c;R.isIntersecting&&((y=r.visibleObservable)==null||y.disconnect(),delete r.visibleObservable,bi.renderCB(b,r),(c=r.grid)==null||c.prepareDragDrop(r.el))}),window.setTimeout(()=>{var R;return(R=r.visibleObservable)==null?void 0:R.observe(n)})):bi.renderCB(b,r),n}makeSubGrid(r,n,b,R=!0){var y,c,i;let d=r.gridstackNode;if(d||(d=this.makeWidget(r).gridstackNode),(y=d.subGrid)!=null&&y.el)return d.subGrid;let l,a=this;for(;a&&!l;)l=(c=a.opts)==null?void 0:c.subGridOpts,a=(i=a.parentGridNode)==null?void 0:i.grid;n=Ya.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...l||{},...n||d.subGridOpts||{}}),d.subGridOpts=n;let S;n.column==="auto"&&(S=!0,n.column=Math.max(d.w||1,(b==null?void 0:b.w)||1),delete n.columnOpts);let x=d.el.querySelector(".grid-stack-item-content"),v,p;if(R&&(this._removeDD(d.el),p={...d,x:0,y:0},Ya.removeInternalForSave(p),delete p.subGridOpts,d.content&&(p.content=d.content,delete d.content),bi.addRemoveCB?v=bi.addRemoveCB(this.el,p,!0,!1):(v=Ya.createDiv(["grid-stack-item"]),v.appendChild(x),x=Ya.createDiv(["grid-stack-item-content"],d.el)),this.prepareDragDrop(d.el)),b){const s=S?n.column:d.w,f=d.h+b.h,u=d.el.style;u.transition="none",this.update(d.el,{w:s,h:f}),setTimeout(()=>u.transition=null)}const o=d.subGrid=bi.addGrid(x,n);return b!=null&&b._moving&&(o._isTemp=!0),S&&(o._autoColumn=!0),R&&o.makeWidget(v,p),b&&(b._moving?window.setTimeout(()=>Ya.simulateMouseEvent(b._event,"mouseenter",o.el),0):o.makeWidget(d.el,d)),this.resizeToContentCheck(!1,d),o}removeAsSubGrid(r){var n;const b=(n=this.parentGridNode)==null?void 0:n.grid;b&&(b.batchUpdate(),b.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(R=>{R.x+=this.parentGridNode.x,R.y+=this.parentGridNode.y,b.makeWidget(R.el,R)}),b.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,r&&window.setTimeout(()=>Ya.simulateMouseEvent(r._event,"mouseenter",b.el),0))}save(r=!0,n=!1,b=bi.saveCB,R){const y=this.engine.save(r,b,R);if(y.forEach(c=>{var i;if(r&&c.el&&!c.subGrid&&!b){const d=c.el.querySelector(".grid-stack-item-content");c.content=d==null?void 0:d.innerHTML,c.content||delete c.content}else if(!r&&!b&&delete c.content,(i=c.subGrid)!=null&&i.el){const d=c.w||c.subGrid.getColumn(),l=c.subGrid.save(r,n,b,d);c.subGridOpts=n?l:{children:l},delete c.subGrid}delete c.el}),n){const c=Ya.cloneDeep(this.opts);c.marginBottom===c.marginTop&&c.marginRight===c.marginLeft&&c.marginTop===c.marginRight&&(c.margin=c.marginTop,delete c.marginTop,delete c.marginRight,delete c.marginBottom,delete c.marginLeft),c.rtl===(this.el.style.direction==="rtl")&&(c.rtl="auto"),this._isAutoCellHeight&&(c.cellHeight="auto"),this._autoColumn&&(c.column="auto");const i=c._alwaysShowResizeHandle;return delete c._alwaysShowResizeHandle,i!==void 0?c.alwaysShowResizeHandle=i:delete c.alwaysShowResizeHandle,Ya.removeInternalAndSame(c,Yd),c.children=y,c}return y}load(r,n=bi.addRemoveCB||!0){r=Ya.cloneDeep(r);const b=this.getColumn();r.forEach(a=>{a.w=a.w||a.minW||1,a.h=a.h||a.minH||1}),r=Ya.sort(r),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let R=0;r.forEach(a=>{R=Math.max(R,(a.x||0)+a.w)}),R>this.engine.defaultColumn&&(this.engine.defaultColumn=R),R>b&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=r,this.engine.columnChanged(R,b,this.responseLayout),r=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(r,R,!0));const y=bi.addRemoveCB;typeof n=="function"&&(bi.addRemoveCB=n);const c=[];this.batchUpdate();const i=!this.engine.nodes.length,d=i&&this.opts.animate;d&&this.setAnimation(!1),!i&&n&&[...this.engine.nodes].forEach(a=>{a.id&&(Ya.find(r,a.id)||(bi.addRemoveCB&&bi.addRemoveCB(this.el,a,!1,!1),c.push(a),this.removeWidget(a.el,!0,!1)))}),this.engine._loading=!0;const l=[];return this.engine.nodes=this.engine.nodes.filter(a=>Ya.find(r,a.id)?(l.push(a),!1):!0),r.forEach(a=>{var S;const x=Ya.find(l,a.id);if(x){if(Ya.shouldSizeToContent(x)&&(a.h=x.h),this.engine.nodeBoundFix(a),(a.autoPosition||a.x===void 0||a.y===void 0)&&(a.w=a.w||x.w,a.h=a.h||x.h,this.engine.findEmptyPosition(a)),this.engine.nodes.push(x),Ya.samePos(x,a)&&this.engine.nodes.length>1&&(this.moveNode(x,{...a,forceCollide:!0}),Ya.copyPos(a,x)),this.update(x.el,a),(S=a.subGridOpts)!=null&&S.children){const v=x.el.querySelector(".grid-stack");v&&v.gridstack&&v.gridstack.load(a.subGridOpts.children)}}else n&&this.addWidget(a)}),delete this.engine._loading,this.engine.removedNodes=c,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,y?bi.addRemoveCB=y:delete bi.addRemoveCB,d&&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 R=Ya.toNumber(n.getAttribute("gs-h"))||1;return Math.round(n.offsetHeight/R)}const b=parseInt(this.el.getAttribute("gs-current-row"));return b?Math.round(this.el.getBoundingClientRect().height/b):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 b=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;r=this.cellWidth()+b}const n=Ya.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 b=this.opts.columnOpts;if(!b||!b.columnWidth&&!((r=b.breakpoints)!=null&&r.length))return!1;const R=this.getColumn();let y=R;const c=this._widthOrContainer(!0);if(b.columnWidth)y=Math.min(Math.round(c/b.columnWidth)||1,b.columnMax);else{y=b.columnMax;let i=0;for(;i<b.breakpoints.length&&c<=b.breakpoints[i].w;)y=b.breakpoints[i++].c||R}if(y!==R){const i=(n=b.breakpoints)==null?void 0:n.find(d=>d.c===y);return this.column(y,(i==null?void 0:i.layout)||b.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 b=this.getColumn();return this.opts.column=r,this.engine?(this.engine.column=r,this.el.classList.remove("gs-"+b),this._updateColumnVar(),this.engine.columnChanged(b,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 b=this.el.getBoundingClientRect();let R;n?R={top:b.top+document.documentElement.scrollTop,left:b.left}:R={top:this.el.offsetTop,left:this.el.offsetLeft};const y=r.left-R.left,c=r.top-R.top,i=b.width/this.getColumn(),d=b.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(y/i),y:Math.floor(c/d)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(r,n,b,R){return this.engine.isAreaEmpty(r,n,b,R)}makeWidget(r,n){const b=bi.getElement(r);if(!b||b.gridstackNode)return b;b.parentElement||this.el.appendChild(b),this._prepareElement(b,!0,n);const R=b.gridstackNode;this._updateContainerHeight(),R.subGridOpts&&this.makeSubGrid(b,R.subGridOpts,void 0,!1);let y;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(y=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),y&&delete this._ignoreLayoutsNodeChange,b}on(r,n){return r.indexOf(" ")!==-1?(r.split(" ").forEach(b=>this.on(b,n)),this):(r==="change"||r==="added"||r==="removed"||r==="enable"||r==="disable"?(r==="enable"||r==="disable"?this._gsEventHandler[r]=b=>n(b):this._gsEventHandler[r]=b=>{b.detail&&n(b,b.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,b=!0){return r?(bi.getElements(r).forEach(R=>{if(R.parentElement&&R.parentElement!==this.el)return;let y=R.gridstackNode;y||(y=this.engine.nodes.find(c=>R===c.el)),y&&(n&&bi.addRemoveCB&&bi.addRemoveCB(this.el,y,!1,!1),delete R.gridstackNode,this._removeDD(R),this.engine.removeNode(y,n,b),n&&R.parentElement&&R.remove())}),b&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(r=!0,n=!0){return this.engine.nodes.forEach(b=>{r&&bi.addRemoveCB&&bi.addRemoveCB(this.el,b,!1,!1),delete b.el.gridstackNode,this.opts.staticGrid||this._removeDD(b.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,b=!0){return!!this.opts.staticGrid===r?this:(r?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(R=>{this.prepareDragDrop(R.el),R.subGrid&&b&&R.subGrid.setStatic(r,n,b)}),n&&this._setStaticClass(),this)}updateOptions(r){var n;const b=this.opts;return r===b?this:(r.acceptWidgets!==void 0&&(b.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!==b.class&&(b.class&&this.el.classList.remove(b.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?(b.minRow=b.maxRow=b.row=r.row,this._updateContainerHeight()):(r.minRow!==void 0&&(b.minRow=r.minRow,this._updateContainerHeight()),r.maxRow!==void 0&&(b.maxRow=r.maxRow)),(n=r.children)!=null&&n.length&&this.load(r.children),this)}update(r,n){return bi.getElements(r).forEach(b=>{var R;const y=b==null?void 0:b.gridstackNode;if(!y)return;const c={...Ya.copyPos({},y),...Ya.cloneDeep(n)};this.engine.nodeBoundFix(c),delete c.autoPosition;const i=["x","y","w","h"];let d;if(i.some(S=>c[S]!==void 0&&c[S]!==y[S])&&(d={},i.forEach(S=>{d[S]=c[S]!==void 0?c[S]:y[S],delete c[S]})),!d&&(c.minW||c.minH||c.maxW||c.maxH)&&(d={}),c.content!==void 0){const S=b.querySelector(".grid-stack-item-content");S&&S.textContent!==c.content&&(y.content=c.content,bi.renderCB(S,c),(R=y.subGrid)!=null&&R.el&&(S.appendChild(y.subGrid.el),y.subGrid._updateContainerHeight())),delete c.content}let l=!1,a=!1;for(const S in c)S[0]!=="_"&&y[S]!==c[S]&&(y[S]=c[S],l=!0,a=a||!this.opts.staticGrid&&(S==="noResize"||S==="noMove"||S==="locked"));if(Ya.sanitizeMinMax(y),d){const S=d.w!==void 0&&d.w!==y.w;this.moveNode(y,d),S&&y.subGrid?y.subGrid.onResize(this.hasAnimationCSS()?y.w:void 0):this.resizeToContentCheck(S,y),delete y._orig}(d||l)&&this._writeAttr(b,y),a&&this.prepareDragDrop(y.el),bi.updateCB&&bi.updateCB(y)}),this}moveNode(r,n){const b=r._updating;b||this.engine.cleanNodes().beginUpdate(r),this.engine.moveNode(r,n),this._updateContainerHeight(),b||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(r){var n,b;if(!r||(r.classList.remove("size-to-content-max"),!r.clientHeight))return;const R=r.gridstackNode;if(!R)return;const y=R.grid;if(!y||r.parentElement!==y.el)return;const c=y.getCellHeight(!0);if(!c)return;let i=R.h?R.h*c:r.clientHeight,d;if(R.resizeToContentParent&&(d=r.querySelector(R.resizeToContentParent)),d||(d=r.querySelector(bi.resizeToContentParent)),!d)return;const l=r.clientHeight-d.clientHeight,a=R.h?R.h*c-l:d.clientHeight;let S;if(R.subGrid){S=R.subGrid.getRow()*R.subGrid.getCellHeight(!0);const p=R.subGrid.el.getBoundingClientRect(),o=r.getBoundingClientRect();S+=p.top-o.top}else{if((b=(n=R.subGridOpts)==null?void 0:n.children)!=null&&b.length)return;{const p=d.firstElementChild;if(!p){console.error(`Error: GridStack.resizeToContent() widget id:${R.id} '${bi.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}S=p.getBoundingClientRect().height||a}}if(a===S)return;i+=S-a;let x=Math.ceil(i/c);const v=Number.isInteger(R.sizeToContent)?R.sizeToContent:0;v&&x>v&&(x=v,r.classList.add("size-to-content-max")),R.minH&&x<R.minH?x=R.minH:R.maxH&&x>R.maxH&&(x=R.maxH),x!==R.h&&(y._ignoreLayoutsNodeChange=!0,y.moveNode(R,{h:x}),delete y._ignoreLayoutsNodeChange)}resizeToContentCBCheck(r){bi.resizeToContentCB?bi.resizeToContentCB(r):this.resizeToContent(r)}rotate(r,n){return bi.getElements(r).forEach(b=>{const R=b.gridstackNode;if(!Ya.canBeRotated(R))return;const y={w:R.h,h:R.w,minH:R.minW,minW:R.minH,maxH:R.maxW,maxW:R.maxH};if(n){const i=n.left>0?Math.floor(n.left/this.cellWidth()):0,d=n.top>0?Math.floor(n.top/this.opts.cellHeight):0;y.x=R.x+i-(R.h-(d+1)),y.y=R.y+d-i}Object.keys(y).forEach(i=>{y[i]===void 0&&delete y[i]});const c=R._orig;this.update(b,y),R._orig=c}),this}margin(r){if(!(typeof r=="string"&&r.split(" ").length>1)){const n=Ya.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){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");const n=arguments;let b=0,R={x:n[b++],y:n[b++],w:n[b++],h:n[b++],autoPosition:n[b++]};return this.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(b=>{delete b._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 b=n?new CustomEvent(r,{bubbles:!1,detail:n}):new Event(r);let R=this;for(;R.parentGridNode;)R=R.parentGridNode.grid;return R.el.dispatchEvent(b),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const r=this.parentGridNode;let n=this.getRow()+this._extraDragRow;const b=this.opts.cellHeight,R=this.opts.cellHeightUnit;if(!b)return this;if(!r&&!this.opts.minRow){const y=Ya.parseHeight(getComputedStyle(this.el).minHeight);if(y.h>0&&y.unit===R){const c=Math.floor(y.h/b);n<c&&(n=c)}}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*b+R),r&&Ya.shouldSizeToContent(r)&&r.grid.resizeToContentCBCheck(r.el),this}_prepareElement(r,n=!1,b){b=b||this._readAttr(r),r.gridstackNode=b,b.el=r,b.grid=this,b=this.engine.addNode(b,n),this._writeAttr(r,b),r.classList.add(Yd.itemClass,this.opts.itemClass);const R=Ya.shouldSizeToContent(b);return R?r.classList.add("size-to-content"):r.classList.remove("size-to-content"),R&&this.resizeToContentCheck(!1,b),Ya.lazyLoad(b)||this.prepareDragDrop(b.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),n.x>0?r.setAttribute("gs-x",String(n.x)):r.removeAttribute("gs-x"),n.y>0?r.setAttribute("gs-y",String(n.y)):r.removeAttribute("gs-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 b={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const R in b)n[R]?r.setAttribute(b[R],String(n[R])):r.removeAttribute(b[R]);return this}_readAttr(r,n=!0){const b={};b.x=Ya.toNumber(r.getAttribute("gs-x")),b.y=Ya.toNumber(r.getAttribute("gs-y")),b.w=Ya.toNumber(r.getAttribute("gs-w")),b.h=Ya.toNumber(r.getAttribute("gs-h")),b.autoPosition=Ya.toBool(r.getAttribute("gs-auto-position")),b.noResize=Ya.toBool(r.getAttribute("gs-no-resize")),b.noMove=Ya.toBool(r.getAttribute("gs-no-move")),b.locked=Ya.toBool(r.getAttribute("gs-locked"));const R=r.getAttribute("gs-size-to-content");R&&(R==="true"||R==="false"?b.sizeToContent=Ya.toBool(R):b.sizeToContent=parseInt(R,10)),b.id=r.getAttribute("gs-id"),b.maxW=Ya.toNumber(r.getAttribute("gs-max-w")),b.minW=Ya.toNumber(r.getAttribute("gs-min-w")),b.maxH=Ya.toNumber(r.getAttribute("gs-max-h")),b.minH=Ya.toNumber(r.getAttribute("gs-min-h")),n&&(b.w===1&&r.removeAttribute("gs-w"),b.h===1&&r.removeAttribute("gs-h"),b.maxW&&r.removeAttribute("gs-max-w"),b.minW&&r.removeAttribute("gs-min-w"),b.maxH&&r.removeAttribute("gs-max-h"),b.minH&&r.removeAttribute("gs-min-h"));for(const y in b){if(!b.hasOwnProperty(y))return;!b[y]&&b[y]!==0&&y!=="sizeToContent"&&delete b[y]}return b}_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(b=>{b.subGrid&&b.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)Ya.shouldSizeToContent(n)&&this.resizeToContentCBCheck(n.el);else if(this.engine.nodes.some(b=>Ya.shouldSizeToContent(b))){const b=[...this.engine.nodes];this.batchUpdate(),b.forEach(R=>{Ya.shouldSizeToContent(R)&&this.resizeToContentCBCheck(R.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(b=>b.sizeToContent));return!r&&n&&!this.resizeObserver?(this._sizeThrottle=Ya.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 Ya.getElement(r)}static getElements(r=".grid-stack-item"){return Ya.getElements(r)}static getGridElement(r){return bi.getElement(r)}static getGridElements(r){return Ya.getElements(r)}_initMargin(){let r,n=0,b=[];typeof this.opts.margin=="string"&&(b=this.opts.margin.split(" ")),b.length===2?(this.opts.marginTop=this.opts.marginBottom=b[0],this.opts.marginLeft=this.opts.marginRight=b[1]):b.length===4?(this.opts.marginTop=b[0],this.opts.marginRight=b[1],this.opts.marginBottom=b[2],this.opts.marginLeft=b[3]):(r=Ya.parseHeight(this.opts.margin),this.opts.marginUnit=r.unit,n=this.opts.margin=r.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(y=>{this.opts[y]===void 0?this.opts[y]=n:(r=Ya.parseHeight(this.opts[y]),this.opts[y]=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 R=this.el.style;return R.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),R.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),R.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),R.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return ud}static setupDragIn(r,n,b,R=document){(n==null?void 0:n.pause)!==void 0&&(Mi.pauseDrag=n.pause),n={appendTo:"body",helper:"clone",...n||{}},(typeof r=="string"?Ya.getElements(r,R):r).forEach((y,c)=>{ud.isDraggable(y)||ud.dragIn(y,n),b!=null&&b[c]&&(y.gridstackNode=b[c])})}movable(r,n){return this.opts.staticGrid?this:(bi.getElements(r).forEach(b=>{const R=b.gridstackNode;R&&(n?delete R.noMove:R.noMove=!0,this.prepareDragDrop(R.el))}),this)}resizable(r,n){return this.opts.staticGrid?this:(bi.getElements(r).forEach(b=>{const R=b.gridstackNode;R&&(n?delete R.noResize:R.noResize=!0,this.prepareDragDrop(R.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(b=>{this.prepareDragDrop(b.el),b.subGrid&&n&&b.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(b=>{this.prepareDragDrop(b.el),b.subGrid&&n&&b.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&&bi._itemRemoving(n.el,!1),this.engine.restoreInitial())}_removeDD(r){return ud.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 ud.droppable(this.el,"destroy"),this;let r,n;const b=(R,y,c)=>{var i;c=c||y;const d=c.gridstackNode;if(!d)return;if(!((i=d.grid)!=null&&i.el)){c.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const v=c.getBoundingClientRect();c.style.left=v.x+(this.dragTransform.xScale-1)*(R.clientX-v.x)/this.dragTransform.xScale+"px",c.style.top=v.y+(this.dragTransform.yScale-1)*(R.clientY-v.y)/this.dragTransform.yScale+"px",c.style.transformOrigin="0px 0px"}let{top:l,left:a}=c.getBoundingClientRect();const S=this.el.getBoundingClientRect();a-=S.left,l-=S.top;const x={position:{top:l*this.dragTransform.xScale,left:a*this.dragTransform.yScale}};if(d._temporaryRemoved){if(d.x=Math.max(0,Math.round(a/n)),d.y=Math.max(0,Math.round(l/r)),delete d.autoPosition,this.engine.nodeBoundFix(d),!this.engine.willItFit(d)){if(d.autoPosition=!0,!this.engine.willItFit(d)){ud.off(y,"drag");return}d._willFitPos&&(Ya.copyPos(d,d._willFitPos),delete d._willFitPos)}this._onStartMoving(c,R,x,d,n,r)}else this._dragOrResize(c,R,x,d,n,r)};return ud.droppable(this.el,{accept:R=>{const y=R.gridstackNode||this._readAttr(R,!1);if((y==null?void 0:y.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let c=!0;if(typeof this.opts.acceptWidgets=="function")c=this.opts.acceptWidgets(R);else{const i=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;c=R.matches(i)}if(c&&y&&this.opts.maxRow){const i={w:y.w,h:y.h,minW:y.minW,minH:y.minH};c=this.engine.willItFit(i)}return c}}).on(this.el,"dropover",(R,y,c)=>{let i=(c==null?void 0:c.gridstackNode)||y.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(y,c),c=c||y,n=this.cellWidth(),r=this.getCellHeight(!0),!i){const a=c.getAttribute("data-gs-widget")||c.getAttribute("gridstacknode");if(a){try{i=JSON.parse(a)}catch{console.error("Gridstack dropover: Bad JSON format: ",a)}c.removeAttribute("data-gs-widget"),c.removeAttribute("gridstacknode")}i||(i=this._readAttr(c)),i._sidebarOrig={w:i.w,h:i.h}}i.grid||(i.el||(i={...i}),i._isExternal=!0,c.gridstackNode=i);const d=i.w||Math.round(c.offsetWidth/n)||1,l=i.h||Math.round(c.offsetHeight/r)||1;return i.grid&&i.grid!==this?(y._gridstackNodeOrig||(y._gridstackNodeOrig=i),y.gridstackNode=i={...i,w:d,h:l,grid:this},delete i.x,delete i.y,this.engine.cleanupNode(i).nodeBoundFix(i),i._initDD=i._isExternal=i._temporaryRemoved=!0):(i.w=d,i.h=l,i._temporaryRemoved=!0),bi._itemRemoving(i.el,!1),ud.on(y,"drag",b),b(R,y,c),!1}).on(this.el,"dropout",(R,y,c)=>{const i=(c==null?void 0:c.gridstackNode)||y.gridstackNode;return i&&(!i.grid||i.grid===this)&&(this._leave(y,c),this._isTemp&&this.removeAsSubGrid(i)),!1}).on(this.el,"drop",(R,y,c)=>{var i,d,l;const a=(c==null?void 0:c.gridstackNode)||y.gridstackNode;if((a==null?void 0:a.grid)===this&&!a._isExternal)return!1;const S=!!this.placeholder.parentElement,x=y!==c;this.placeholder.remove(),delete this.placeholder.gridstackNode,S&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const v=y._gridstackNodeOrig;if(delete y._gridstackNodeOrig,S&&v!=null&&v.grid&&v.grid!==this){const o=v.grid;o.engine.removeNodeFromLayoutCache(v),o.engine.removedNodes.push(v),o._triggerRemoveEvent()._triggerChangeEvent(),o.parentGridNode&&!o.engine.nodes.length&&o.opts.subGridDynamic&&o.removeAsSubGrid()}if(!a||(S&&(this.engine.cleanupNode(a),a.grid=this),(i=a.grid)==null||delete i._isTemp,ud.off(y,"drag"),c!==y?(c.remove(),y=c):y.remove(),this._removeDD(y),!S))return!1;const p=(l=(d=a.subGrid)==null?void 0:d.el)==null?void 0:l.gridstack;return Ya.copyPos(a,this._readAttr(this.placeholder)),Ya.removePositioningStyles(y),x&&(a.content||a.subGridOpts||bi.addRemoveCB)?(delete a.el,y=this.addWidget(a)):(this._prepareElement(y,!0,a),this.el.appendChild(y),this.resizeToContentCheck(!1,a),p&&(p.parentGridNode=a),this._updateContainerHeight()),this.engine.addedNodes.push(a),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...R,type:"dropped"},v&&v.grid?v:void 0,a),!1}),this}static _itemRemoving(r,n){if(!r)return;const b=r?r.gridstackNode:void 0;!(b!=null&&b.grid)||r.classList.contains(b.grid.opts.removableOptions.decline)||(n?b._isAboutToRemove=!0:delete b._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&&!ud.isDroppable(r)&&ud.droppable(r,this.opts.removableOptions).on(r,"dropover",(n,b)=>bi._itemRemoving(b,!0)).on(r,"dropout",(n,b)=>bi._itemRemoving(b,!1)),this):this}prepareDragDrop(r,n=!1){const b=r==null?void 0:r.gridstackNode;if(!b)return;const R=b.noMove||this.opts.disableDrag,y=b.noResize||this.opts.disableResize,c=this.opts.staticGrid||R&&y;if((n||c)&&(b._initDD&&(this._removeDD(r),delete b._initDD),c&&r.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!n))return this;if(!b._initDD){let i,d;const l=(x,v)=>{this.triggerEvent(x,x.target),i=this.cellWidth(),d=this.getCellHeight(!0),this._onStartMoving(r,x,v,b,i,d)},a=(x,v)=>{this._dragOrResize(r,x,v,b,i,d)},S=x=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete b._moving,delete b._resizing,delete b._event,delete b._lastTried;const v=b.w!==b._orig.w,p=x.target;if(!(!p.gridstackNode||p.gridstackNode.grid!==this)){if(b.el=p,b._isAboutToRemove){const o=r.gridstackNode.grid;o._gsEventHandler[x.type]&&o._gsEventHandler[x.type](x,p),o.engine.nodes.push(b),o.removeWidget(r,!0,!0)}else Ya.removePositioningStyles(p),b._temporaryRemoved?(this._writePosAttr(p,b),this.engine.addNode(b)):this._writePosAttr(p,b),this.triggerEvent(x,p);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),x.type==="resizestop"&&(Number.isInteger(b.sizeToContent)&&(b.sizeToContent=b.h),this.resizeToContentCheck(v,b))}};ud.draggable(r,{start:l,stop:S,drag:a}).resizable(r,{start:l,stop:S,resize:a}),b._initDD=!0}return ud.draggable(r,R?"disable":"enable").resizable(r,y?"disable":"enable"),this}_onStartMoving(r,n,b,R,y,c){var i;if(this.engine.cleanNodes().beginUpdate(R),this._writePosAttr(this.placeholder,R),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=R,(i=R.grid)!=null&&i.el)this.dragTransform=Ya.getValuesFromTransformedElement(r);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const d=this.placeholder.closest(".grid-stack");this.dragTransform=Ya.getValuesFromTransformedElement(d)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(R.el=this.placeholder,R._lastUiPosition=b.position,R._prevYPix=b.position.top,R._moving=n.type==="dragstart",R._resizing=n.type==="resizestart",delete R._lastTried,n.type==="dropover"&&R._temporaryRemoved&&(this.engine.addNode(R),R._moving=!0),this.engine.cacheRects(y,c,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),n.type==="resizestart"){const d=this.getColumn()-R.x,l=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-R.y;ud.resizable(r,"option","minWidth",y*Math.min(R.minW||1,d)).resizable(r,"option","minHeight",c*Math.min(R.minH||1,l)).resizable(r,"option","maxWidth",y*Math.min(R.maxW||Number.MAX_SAFE_INTEGER,d)).resizable(r,"option","maxWidthMoveLeft",y*Math.min(R.maxW||Number.MAX_SAFE_INTEGER,R.x+R.w)).resizable(r,"option","maxHeight",c*Math.min(R.maxH||Number.MAX_SAFE_INTEGER,l)).resizable(r,"option","maxHeightMoveUp",c*Math.min(R.maxH||Number.MAX_SAFE_INTEGER,R.y+R.h))}}_dragOrResize(r,n,b,R,y,c){const i={...R._orig};let d,l=this.opts.marginLeft,a=this.opts.marginRight,S=this.opts.marginTop,x=this.opts.marginBottom;const v=Math.round(c*.1),p=Math.round(y*.1);if(l=Math.min(l,p),a=Math.min(a,p),S=Math.min(S,v),x=Math.min(x,v),n.type==="drag"){if(R._temporaryRemoved)return;const s=b.position.top-R._prevYPix;R._prevYPix=b.position.top,this.opts.draggable.scroll!==!1&&Ya.updateScrollPosition(r,b.position,s);const f=b.position.left+(b.position.left>R._lastUiPosition.left?-a:l),u=b.position.top+(b.position.top>R._lastUiPosition.top?-x:S);i.x=Math.round(f/y),i.y=Math.round(u/c);const m=this._extraDragRow;if(this.engine.collide(R,i)){const w=this.getRow();let _=Math.max(0,i.y+R.h-w);this.opts.maxRow&&w+_>this.opts.maxRow&&(_=Math.max(0,this.opts.maxRow-w)),this._extraDragRow=_}else this._extraDragRow=0;if(this._extraDragRow!==m&&this._updateContainerHeight(),R.x===i.x&&R.y===i.y)return}else if(n.type==="resize"){if(i.x<0||(Ya.updateScrollResize(n,r,c),i.w=Math.round((b.size.width-l)/y),i.h=Math.round((b.size.height-S)/c),R.w===i.w&&R.h===i.h)||R._lastTried&&R._lastTried.w===i.w&&R._lastTried.h===i.h)return;const s=b.position.left+l,f=b.position.top+S;i.x=Math.round(s/y),i.y=Math.round(f/c),d=!0}R._event=n,R._lastTried=i;const o={x:b.position.left+l,y:b.position.top+S,w:(b.size?b.size.width:R.w*y)-l-a,h:(b.size?b.size.height:R.h*c)-S-x};if(this.engine.moveNodeCheck(R,{...i,cellWidth:y,cellHeight:c,rect:o,resizing:d})){R._lastUiPosition=b.position,this.engine.cacheRects(y,c,S,a,x,l),delete R._skipDown,d&&R.subGrid&&R.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const s=n.target;R._sidebarOrig||this._writePosAttr(s,R),this.triggerEvent(n,s)}}triggerEvent(r,n){let b=this;for(;b.parentGridNode;)b=b.parentGridNode.grid;b._gsEventHandler[r.type]&&b._gsEventHandler[r.type](r,n)}_leave(r,n){n=n||r;const b=n.gridstackNode;if(!b||(n.style.transform=n.style.transformOrigin=null,ud.off(r,"drag"),b._temporaryRemoved))return;b._temporaryRemoved=!0,this.engine.removeNode(b),b.el=b._isExternal&&n?n:r;const R=b._sidebarOrig;b._isExternal&&this.engine.cleanupNode(b),b._sidebarOrig=R,this.opts.removable===!0&&bi._itemRemoving(r,!0),r._gridstackNodeOrig?(r.gridstackNode=r._gridstackNodeOrig,delete r._gridstackNodeOrig):b._isExternal&&this.engine.restoreInitial()}commit(){return L9e(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}bi.renderCB=(e,r)=>{e&&r!=null&&r.content&&(e.textContent=r.content)},bi.resizeToContentParent=".grid-stack-item-content",bi.Utils=Ya,bi.Engine=Gh,bi.GDRev="12.3.2";const U9e=[{id:1,name:"Goles",isSelected:!1},{id:2,name:"Pases acertados",isSelected:!1},{id:23,name:"Tiros de Esquina",isSelected:!1},{id:3,name:"Balones recuperados en disputa",isSelected:!1},{id:4,name:"Asistencias",isSelected:!1},{id:5,name:"Participaciones en gol",isSelected:!1},{id:6,name:"Tiros a gol",isSelected:!1},{id:7,name:"Tiros a gol que llegaron a la portería",isSelected:!1},{id:8,name:"Cabeceos en área rival",isSelected:!1},{id:9,name:"Cabeceos en área propia",isSelected:!1},{id:10,name:"Centros",isSelected:!1},{id:11,name:"Centros acertados",isSelected:!1},{id:12,name:"1vs1 exitosos ofensivos",isSelected:!1},{id:13,name:"1vs1 exitosos ofensivos que terminaron en gol",isSelected:!1},{id:14,name:"1vs1 defensivos exitoso",isSelected:!1},{id:15,name:"Rechaces",isSelected:!1},{id:16,name:"Balones ganados en área propia",isSelected:!1},{id:17,name:"Balones ganados en área rival",isSelected:!1},{id:18,name:"Faltas cometidas",isSelected:!1},{id:19,name:"Faltas recibidas",isSelected:!1},{id:20,name:"Tarjetas amarillas",isSelected:!1},{id:21,name:"Tarjetas rojas",isSelected:!1},{id:22,name:"Atajadas",isSelected:!1},{id:24,name:"Oportunidades de gol",isSelected:!1},{id:25,name:"Balones recuperados en cancha rival",isSelected:!1}],Jh=e=>U9e.find(r=>r.id===e),Zh=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 p1{constructor(r,n=[],b,R=null,y=!1,c=!1,i=null,d=null,l=null){Up(this,"id",""),Up(this,"childViews",[]),Up(this,"viewId",0),Up(this,"dynamicFilters",null),Up(this,"componentSpecificFilters",new Map),Up(this,"isPostMatch",!1),Up(this,"isTemplateMode",!1),Up(this,"filtresJSON",null),Up(this,"token",null),Up(this,"_isUpdating",!1),Up(this,"filters",null),this.id=r,this.viewId=b,this.childViews=n,this.dynamicFilters=R,this.isPostMatch=y,this.isTemplateMode=c,this.filtresJSON=i,this.token=d,this.filters=l,this.componentSpecificFilters=new Map}resetClass(){this.childViews.forEach(r=>{r.view.filterAndViewsContainer=new p1(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(b=>b&&b.event_type_id===n)}hasCategoryId(r,n){return!r||!Array.isArray(r)?!1:r.some(b=>b&&b.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(console.log("teamSelected: ",n),n===3){console.log("this.getHomeTeamViews(): ",this.getHomeTeamViews()),console.log("this.getAwayTeamViews(): ",this.getAwayTeamViews());const b=this.getHomeTeamViews().length,R=this.getAwayTeamViews().length;b===0&&R>0&&this.getAwayTeamViews().forEach(y=>{y.view.componentProps.isHomeTeamForAnalysis=!0,y.view.isHomeTeam=!0,y.view.filterMultiple&&(y.view.filterMultiple.isHomeTeam=!0)}),b<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((y,c,i,d)=>{let l={isAgainstMode:c.view.isAgainstMode,advancedFilters:c.view.componentProps.advancedFilters,isHomeTeamForAnalysis:c.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:c.view.isHomeTeam};return y&&(y.isHomeTeam&&!c.view.isHomeTeam?(c.view.componentProps.isAgainstMode=this.filters.isAgainstMode,c.view.componentProps.advancedFilters=this.filters.advancedFilters,c.view.componentProps.isHomeTeamForAnalysis=!0,c.view.isHomeTeam=!0,c.view.filterMultiple={isHomeTeam:c.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}):!y.isHomeTeam&&!c.view.isHomeTeam&&(c.view.componentProps.isAgainstMode=y.isAgainstMode,c.view.componentProps.advancedFilters=y.advancedFilters,c.view.componentProps.isHomeTeamForAnalysis=y.isHomeTeamForAnalysis,c.view.isHomeTeam=y.isHomeTeam,c.view.filterMultiple={isHomeTeam:c.view.isHomeTeam,selectedCategory:c.view.componentProps.categories[0],advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}),i===d.length-1&&(r.view.componentProps.advancedFilters=l.advancedFilters,r.view.componentProps.isAgainstMode=l.isAgainstMode,r.view.componentProps.isHomeTeamForAnalysis=l.isHomeTeamForAnalysis,r.view.isHomeTeam=l.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode})),l},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 b=n===1;r.view.componentProps.isHomeTeamForAnalysis=b,r.view.isHomeTeam=b,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 b=this.filters.selectedCategories.map(y=>y.value),R=this.filters.selectedTeam.value;if(R===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(d=>{d.view.componentProps.isHomeTeamForAnalysis=!0,d.view.isHomeTeam=!0,d.view.filterMultiple&&(d.view.filterMultiple.isHomeTeam=!0)});const y=this.getHomeTeamViews(),c=this.getAwayTeamViews();let i=!0;for(let d=0;d<b.length;d++){n=b[d];const l=y.find(S=>S.view.componentProps.categories[0].name===n.name),a=c.find(S=>S.view.componentProps.categories[0].name===n.name);if(!l||!a){i=!l;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((d,l,a,S)=>{let x={categories:l.view.componentProps.categories,analysisType:l.view.componentProps.analysisType,isAssistZoneVisible:this.filters.isAssistZoneVisible,howManyGames:this.filters.howManyGamesSelected.value,title:l.view.title,isHomeTeamForAnalysis:l.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:l.view.isHomeTeam};return d&&(d.isHomeTeam&&!l.view.isHomeTeam?(l.view.componentProps.categories=[n],l.view.componentProps.analysisType=this.filters.selectedGamePhase.name,l.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,l.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,l.view.componentProps.isHomeTeamForAnalysis=!0,l.view.title=n.name,r.view.titleShort=n.name,l.view.isHomeTeam=!0,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:n,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):!d.isHomeTeam&&!l.view.isHomeTeam&&(l.view.componentProps.categories=d.categories,l.view.componentProps.analysisType=d.analysisType,l.view.componentProps.isHomeTeamForAnalysis=d.isHomeTeamForAnalysis,l.view.componentProps.isAssistZoneVisible=d.isAssistZoneVisible,l.view.componentProps.howManyGames=d.howManyGames,l.view.title=d.title,l.view.titleShort=d.titleShort,l.view.isHomeTeam=d.isHomeTeam,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:l.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}),a===S.length-1&&(r.view.componentProps.categories=x.categories,r.view.componentProps.analysisType=x.analysisType,r.view.componentProps.isHomeTeamForAnalysis=x.isHomeTeamForAnalysis,r.view.componentProps.isAssistZoneVisible=x.isAssistZoneVisible,r.view.componentProps.howManyGames=x.howManyGames,r.view.title=x.title,r.view.titleShort=x.titleShort,r.view.isHomeTeam=x.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})),x},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 y=R===1,c=y?this.getHomeTeamViews():this.getAwayTeamViews();r.view.componentProps.isHomeTeamForAnalysis=y,r.view.isHomeTeam=y;for(let i=0;i<b.length;i++){const d=b[i];if(!c.find(l=>l.view.componentProps.categories[0].name===d.name)){r.view.componentProps.categories=[d],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=d.name,r.view.titleShort=d.name,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:d,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible};break}}}}}addView(r,n=!1){var b,R,y,c,i,d,l,a,S,x;if(r.view.filterAndViewsContainer=this,Un.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===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 v=this.getComponentDynamicFilters(r.view.id),p=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const o=p[0]===1?"offensive":"defensive",s=p[1]===1;r.view.componentProps.analysisType=o,r.view.componentProps.isHomeTeamForAnalysis=s,r.isHomeTeam=s,r.view.filterMultiple={isHomeTeam:s},Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:p})}if(this.viewId===1&&r.view.componentProps&&!n){const v=this.dynamicFilters[0]||[];if(v&&v.length>0){let p;if(Array.isArray(v)){const s=this.childViews.map(u=>{var m;return(m=u.view.componentProps)==null?void 0:m.type}).filter(u=>u!==void 0),f=v.filter(u=>!s.includes(u));f.length>0?p=f[0]:p=v[0]}else p=v;const o=Zh.get(this.viewId);r.view.componentProps.type=p,r.view.componentProps.default=!1,r.view.title=`Comparativa ${o[p]}`,r.view.filterMultiple={category:p}}}if(this.viewId===9&&r.view.componentProps&&!n){const v=this.dynamicFilters[0].map(f=>f.join("-"));let p="";const o=this.dynamicFilters[1],s=Zh.get(this.viewId);if(o===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(_=>{_.view.componentProps.isHomeTeamForAnalysis=!0,_.view.isHomeTeam=!0,_.view.filterMultiple&&(_.view.filterMultiple.isHomeTeam=!0)});let f=null;const u=this.getHomeTeamViews(),m=this.getAwayTeamViews();let w=!0;for(let _=0;_<v.length;_++){p=v[_],f=s.analysisTypes.get(v[_]);const T=u.find(L=>L.view.componentProps.analysisType===f.analysisType),V=m.find(L=>L.view.componentProps.analysisType===f.analysisType);if(!T||!V){w=!T;break}}w?this.childViews.length===0?(r.view.componentProps.analysisType=f.analysisType,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.title=f.title,r.view.titleShort=f.titleShort,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:p.split("-").map(_=>parseInt(_))}):this.childViews.reduce((_,T,V,L)=>{let O={analysisType:T.view.componentProps.analysisType,title:T.view.title,isHomeTeamForAnalysis:T.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:T.view.isHomeTeam};return _&&(_.isHomeTeam&&!T.view.isHomeTeam?(T.view.componentProps.analysisType=f.analysisType,T.view.componentProps.isHomeTeamForAnalysis=!0,T.view.title=f.title,r.view.titleShort=f.titleShort,T.view.isHomeTeam=!0,T.view.filterMultiple={isHomeTeam:T.view.isHomeTeam,categoryIds:p.split("-").map(U=>parseInt(U))}):!_.isHomeTeam&&!T.view.isHomeTeam&&(T.view.componentProps.analysisType=_.analysisType,T.view.componentProps.isHomeTeamForAnalysis=_.isHomeTeamForAnalysis,T.view.title=_.title,T.view.titleShort=_.titleShort,T.view.isHomeTeam=_.isHomeTeam,T.view.filterMultiple={isHomeTeam:T.view.isHomeTeam,categoryIds:p.split("-").map(U=>parseInt(U))}),V===L.length-1&&(r.view.componentProps.analysisType=O.analysisType,r.view.componentProps.isHomeTeamForAnalysis=O.isHomeTeamForAnalysis,r.view.title=O.title,r.view.titleShort=O.titleShort,r.view.isHomeTeam=O.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:p.split("-").map(U=>parseInt(U))})),O},null):(r.view.componentProps.analysisType=f.analysisType,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.title=f.title,r.view.titleShort=f.titleShort,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:p.split("-").map(_=>parseInt(_))})}else{const f=o===1,u=f?this.getHomeTeamViews():this.getAwayTeamViews();r.view.componentProps.isHomeTeamForAnalysis=f,r.view.isHomeTeam=f;for(let m=0;m<v.length;m++){const w=s.analysisTypes.get(v[m]);if(!u.find(_=>_.view.componentProps.analysisType===w.analysisType)){r.view.componentProps.analysisType=w.analysisType,r.view.title=w.title,r.view.titleShort=w.titleShort,r.view.filterMultiple={categoryIds:v[m].split("-").map(_=>parseInt(_)),isHomeTeam:r.view.isHomeTeam};break}}}}if(this.viewId===2&&!n&&r.view.componentProps){const v=this.getComponentDynamicFilters(r.view.id),p=v||this.dynamicFilters;!v&&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=p[1]===2?r.view.componentProps.game.awayTeam.team_id:p[1]===1?r.view.componentProps.game.homeTeam.team_id:0);const o=this.dynamicFilters[0]||[];let s=null;if(Array.isArray(o)){if(o.length>0){const m=this.childViews.map(_=>{var T;const V=(T=_.view.componentProps)==null?void 0:T.categoryView;return V&&V.length>0?V[0].id:null}).filter(_=>_!==null),w=o.filter(_=>!m.includes(_));w.length>0&&(s=w[0])}}else{const m=o;m&&(this.childViews.find(w=>{var _;const T=(_=w.view.componentProps)==null?void 0:_.categoryView;return T&&T.length>0&&T[0].id===m})||(s=m))}let f=null;if(s)try{f=Jh(s)}catch{}const u=p&&p.length>1?p[1]:1;r.view.filterMultiple={categoryId:s,teamType:u},r.view.componentProps.categoryView=f?[{id:s,name:f.name}]:s?[{id:s,name:`Category ${s}`}]:[{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=(b=r.view)==null?void 0:b.game,r.view.componentProps.teamSelected={teamId:(y=(R=r.view)==null?void 0:R.game)==null?void 0:y.home_team},r.view.componentProps.isDefault=!1,Un.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===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 v=this.getComponentDynamicFilters(r.view.id),p=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const o=p&&p.length>0?p[0]:[];if(o&&o.length>0){let s=0;for(const f of o)if(!this.childViews.find(u=>u.view.componentProps.gameNumber===f)){s=f;break}s&&(r.view.componentProps.gameNumber=s,r.view.filterMultiple={gameNumber:s})}Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:p})}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 v=this.getComponentDynamicFilters(r.view.id),p=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const o=p&&p.length>0?p[0]:!1;r.view.componentProps.desplegable=o,r.view.componentProps.key=o,r.view.componentProps.game=(c=r.view)==null?void 0:c.game,r.view.componentProps.defaultShields=!1,Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:p})}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=(d=(i=r.view)==null?void 0:i.game)==null?void 0:d.game_id,r.view.componentProps.homeTeam=(a=(l=r.view)==null?void 0:l.game)==null?void 0:a.home_team,r.view.componentProps.awayTeam=(x=(S=r.view)==null?void 0:S.game)==null?void 0:x.visiting_team;const o=this.getComponentDynamicFilters(r.view.id),s=o||this.dynamicFilters;!o&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const f=s&&s.length>0?s[0]:[],u=this.hasEventTypeId(f,1),m=this.hasCategoryId(f,8),w=this.hasCategoryId(f,9),_=this.hasEventTypeId(f,3);r.view.componentProps.goals=u,r.view.componentProps.yellowCards=m,r.view.componentProps.redCards=w,r.view.componentProps.substitutions=_}const v=this.getComponentDynamicFilters(r.view.id)||this.dynamicFilters,p=v&&v.length>0?v[0]:[];r.view.componentProps.selectedEvents=p,r.view.componentProps.key=p.length>0,Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:v})}this.viewId===16&&this.addLastTouch(r),this.viewId===18&&this.addSpecificPlays(r),this.childViews.push(r),Un.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 b=r[0];return b===2||b===3?b: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 b=r[0],R=r[1];if(R===1||R===2){const y=R===1?this.getHomeTeamViews():this.getAwayTeamViews();return b.length-y.length}else return b*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===16&&n){const b=n.selectedCategories||[],R=n.selectedTeam.value;if(R===1||R===2){const y=R===1?this.getHomeTeamViews():this.getAwayTeamViews();return b.length-y.length}else return b.length*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===2){const b=r[0]||[],R=r[1]||1;if(!b||b.length===0)return 0;if(Array.isArray(b)){const y=this.childViews.map(c=>{var i;const d=(i=c.view.componentProps)==null?void 0:i.categoryView;return d&&d.length>0?d[0].id:null}).filter(c=>c!==null);return b.filter(c=>!y.includes(c)).length}else{const y=b;return this.childViews.find(c=>{var i,d;const l=(i=c.view.componentProps)==null?void 0:i.categoryView,a=((d=c.view.filterMultiple)==null?void 0:d.teamType)||1;return l&&l.length>0&&l[0].id===y&&a===R})?0:1}}if(this.viewId===1){const b=r[0]||[];if(!b||b.length===0)return 0;if(Array.isArray(b)){const R=this.childViews.map(y=>{var c;return(c=y.view.componentProps)==null?void 0:c.type}).filter(y=>y!==void 0);return b.filter(y=>!R.includes(y)).length}else{const R=b;return this.childViews.find(y=>{var c;return((c=y.view.componentProps)==null?void 0:c.type)===R})?0:1}}return 0}getRequiresAddView(r,n){if(console.log("getRequiresAddView - viewId:",this.viewId),console.log("filters:",n),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===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 b=r[0];return b?b.length>this.childViews.length:this.childViews.length===0}if(this.viewId===4){const b=r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0;return this.childViews.length===0&&b}if(this.viewId===9)return this.getRequiresAddViewMultipleAndBothTeams(r);if(this.viewId===16&&n){const b=[n.selectedCategories,n.selectedTeam.value];return this.getRequiresAddViewMultipleAndBothTeams(b,n.totalCategoriesSelected)}if(this.viewId===18&&n){console.log("getRequiresAddView - GSCShotMapAnalysis"),console.log("dynamicFilters:",r),console.log("filters:",n);const b=[n.howManyCorners,n.selectedTeam.value],R=this.getRequiresAddViewMultipleAndBothTeams(b,n.howManyCorners);return console.count("before aux18 return"),console.log("aux18:",R),R}if(this.viewId===1){const b=r[0]||[];if(!b||b.length===0)return!1;if(Array.isArray(b)){const R=this.childViews.map(y=>{var c;return(c=y.view.componentProps)==null?void 0:c.type}).filter(y=>y!==void 0);return b.filter(y=>!R.includes(y)).length>0}else{const R=b;return!this.childViews.find(y=>{var c;return((c=y.view.componentProps)==null?void 0:c.type)===R})}}if(this.viewId===2){const b=r[0]||[];if(Array.isArray(b)){if(b.length>0){const R=this.childViews.map(y=>{var c;const i=(c=y.view.componentProps)==null?void 0:c.categoryView;return i&&i.length>0?i[0].id:null}).filter(y=>y!==null);return b.filter(y=>!R.includes(y)).length>0}return!1}else{const R=b,y=r[1]||1;return R?!this.childViews.find(c=>{var i,d;const l=(i=c.view.componentProps)==null?void 0:i.categoryView,a=((d=c.view.filterMultiple)==null?void 0:d.teamType)||1;return l&&l.length>0&&l[0].id===R&&a===y}):!1}}return this.viewId===8||this.viewId===3||this.viewId===14?this.childViews.length===0:!1}getRequiresAddViewMultipleAndBothTeams(r,n=null){const b=this.childViews.filter(l=>l.view.isHomeTeam),R=this.childViews.filter(l=>!l.view.isHomeTeam),y=n||r[0].length,c=r[1],i=y*(c===1||c===2?1:2),d=c===3?b.length+R.length:b.length||R.length;return i>d}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===6){const n=r[0];return n===2||n===3}return this.viewId,!1}updateSummary({dynamicFilters:r}){const n=this.childViews[0],b=document.querySelector(`[gs-id="${n.view.id}"]`),R=n.grid;if(n&&b&&R){const y=r[0],c=`min_column${y?"_2":""}`,i=`min_row${y?"_2":""}`,d=`max_column${y?"_2":""}`,l=`max_row${y?"_2":""}`,a=`colspan${y?"_2":""}`,S=`rowspan${y?"_2":""}`,x=n.view.coreView[a],v=n.view.coreView[S],p=n.view.coreView[c],o=n.view.coreView[i],s=n.view.coreView[d],f=n.view.coreView[l];n.view.w=x,n.view.h=v,n.view.maxWidth=s,n.view.maxHeight=f,n.view.minWidth=p,n.view.minHeight=o,b.setAttribute("gs-w",x),b.setAttribute("gs-h",v),b.setAttribute("gs-max-w",s),b.setAttribute("gs-max-h",f),b.setAttribute("gs-min-w",p),b.setAttribute("gs-min-h",o),R.update(b,{h:v,w:x,"gs-max-h":f,"gs-max-w":s,"gs-min-h":o,"gs-min-w":p})}}updateFilters(r){this.filters=r,this.viewId===16?this.updateLastTouchFilters(r):this.viewId===18&&this.updateSpecificPlaysFilters(r)}updateDynamicFilters(r,n=null){if(!this._isUpdating){this._isUpdating=!0,n?this.componentSpecificFilters.set(n,[...r]):this.dynamicFilters=r,Un.emit("component-added-to-container",this);try{if(this.viewId===5){const b=r[0]||1;if(b<3)if(this.childViews.length===1){const R=this.childViews[0];R.view.componentProps&&(R.view.componentProps.preMatchType=b,R.view.filterMultiple={isHomeTeam:R.view.componentProps.preMatchType===1})}else{const R=this.childViews.pop(),y=R.grid,c=R.page,i=document.querySelector(`[gs-id="${R.view.id}"]`);if(y&&i&&(y.removeWidget(i),c)){const l=c.items.findIndex(a=>a.id===R.view.id);l!==-1&&c.items.splice(l,1)}const d=this.childViews[0];d.view.componentProps&&(d.view.componentProps.preMatchType=b,d.view.filterMultiple={isHomeTeam:d.view.componentProps.preMatchType})}else this.childViews.forEach((R,y)=>{R.view.componentProps.preMatchType=y+1,R.view.filterMultiple={isHomeTeam:R.view.componentProps.preMatchType}})}if(this.viewId===15){const b=r[0]||1;if(n){const R=this.childViews.find(y=>y.view.id===n);R&&R.view.componentProps&&(R.view.componentProps.preMatchType=b,R.view.filterMultiple={isHomeTeam:b===1})}else if(b<3){if(this.childViews.length===1){const R=this.childViews[0];R.view.componentProps&&(R.view.componentProps.preMatchType=b,R.view.filterMultiple={isHomeTeam:b===1})}else if(this.childViews.length>1){for(;this.childViews.length>1;){const y=this.childViews.pop(),c=y.grid,i=y.page,d=document.querySelector(`[gs-id="${y.view.id}"]`);if(c&&d&&(c.removeWidget(d),i)){const l=i.items.findIndex(a=>a.id===y.view.id);l!==-1&&i.items.splice(l,1)}}const R=this.childViews[0];R.view.componentProps&&(R.view.componentProps.preMatchType=b,R.view.filterMultiple={isHomeTeam:b===1})}}else if(this.childViews.length===2)this.childViews.forEach((R,y)=>{R.view.componentProps&&(R.view.componentProps.preMatchType=y+1,R.view.filterMultiple={isHomeTeam:y===0})});else if(this.childViews.length<2)this.childViews.forEach((R,y)=>{R.view.componentProps&&(R.view.componentProps.preMatchType=y+1,R.view.filterMultiple={isHomeTeam:y===0})});else{for(;this.childViews.length>2;){const R=this.childViews.pop(),y=R.grid,c=R.page,i=document.querySelector(`[gs-id="${R.view.id}"]`);if(y&&i&&(y.removeWidget(i),c)){const d=c.items.findIndex(l=>l.id===R.view.id);d!==-1&&c.items.splice(d,1)}}this.childViews.forEach((R,y)=>{R.view.componentProps&&(R.view.componentProps.preMatchType=y+1,R.view.filterMultiple={isHomeTeam:y===0})})}}if(this.viewId===10){const b=r[0]||1;if(b<3)if(this.childViews.length===1){const R=this.childViews[0];R.view.componentProps&&(R.view.componentProps.isHomeTeamForAnalysis=b===1,R.view.filterMultiple={isHomeTeam:R.view.componentProps.isHomeTeamForAnalysis})}else{const R=this.childViews.pop(),y=R.grid,c=R.page,i=document.querySelector(`[gs-id="${R.view.id}"]`);if(y&&i&&(y.removeWidget(i),c)){const l=c.items.findIndex(a=>a.id===R.view.id);l!==-1&&c.items.splice(l,1)}const d=this.childViews[0];d.view.componentProps&&(d.view.componentProps.isHomeTeamForAnalysis=b===1,d.view.filterMultiple={isHomeTeam:d.view.componentProps.isHomeTeamForAnalysis})}else this.childViews.forEach((R,y)=>{R.view.componentProps.isHomeTeamForAnalysis=y%2===0,R.view.filterMultiple={isHomeTeam:R.view.componentProps.isHomeTeamForAnalysis}})}if(this.viewId===7){const b=r[1];if(b===3)this.childViews.forEach((R,y)=>{R.view.componentProps.isHomeTeamForAnalysis=y%2===0,R.view.isHomeTeam=y%2===0,R.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",R.view.filterMultiple={isHomeTeam:R.view.isHomeTeam}});else{const R=b===1;if(this.childViews.length>0){const y=this.childViews[0];y.view.componentProps.isHomeTeamForAnalysis=R,y.view.isHomeTeam=R,y.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",y.view.filterMultiple={isHomeTeam:R},this.childViews.length>1&&this.removeChildView(this.childViews[1])}}}if(this.viewId===9){const b=r[0],R=r[1];if(R===3){if(this.childViews.length>b.length){const y=b.map(c=>{const i=c.join("-");return Zh.get(this.viewId).analysisTypes.get(i).analysisType});this.childViews.reduce((c,i)=>(y.includes(i.view.componentProps.analysisType)||c.push(i.view.componentProps.analysisType),c),[]).forEach(c=>{const i=this.childViews.findIndex(d=>d.view.componentProps.analysisType===c);if(i!==-1){const d=this.childViews[i];this.removeChildView(d)}})}}else{const y=R===1,c=this.getHomeTeamViews(),i=this.getAwayTeamViews();if(y&&c.length===0)i.forEach(d=>{d.view.componentProps.isHomeTeamForAnalysis=y,d.view.isHomeTeam=y,d.view.filterMultiple={categoryIds:b[0],isHomeTeam:y}});else if(!y&&i.length===0)c.forEach(d=>{d.view.componentProps.isHomeTeamForAnalysis=y,d.view.isHomeTeam=y,d.view.filterMultiple={categoryIds:b[0],isHomeTeam:y}});else if(c.length===i.length)y||c.forEach(d=>{d.view.filterMultiple={categoryIds:b[0],isHomeTeam:y}}),(y?i:c).forEach(d=>{this.removeChildView(d)});else{const d=y?this.getHomeTeamViews():this.getAwayTeamViews();if(d.length>b.length){const l=b.map(a=>{const S=a.join("-");return Zh.get(this.viewId).analysisTypes.get(S).analysisType});d.forEach(a=>{l.includes(a.view.componentProps.analysisType)?a.view.filterMultiple={categoryIds:b[0],isHomeTeam:y}:this.removeChildView(a)})}else d.forEach(l=>{l.view.filterMultiple={categoryIds:b[0],isHomeTeam:y}})}}}if(this.viewId===2){const b=r[0]||[];if(Array.isArray(b)){const R=this.childViews.map(y=>{var c,i;const d=(c=y.view.componentProps)==null?void 0:c.categoryView,l=((i=y.view.filterMultiple)==null?void 0:i.teamType)||1,a=d&&d.length>0?d[0].id:null;return a?{categoryId:a,teamType:l,viewId:y.view.id}:null}).filter(y=>y!==null);if(n){const y=this.childViews.find(c=>c.view.id===n);if(y){const c=r[1]||1,i=b[0];if(i){let d=null;try{d=Jh(i)}catch{}y.view.filterMultiple={categoryId:i,teamType:c},y.view.componentProps.game&&(c===1?y.view.componentProps.teamView=y.view.componentProps.game.homeTeam.team_id:c===2?y.view.componentProps.teamView=y.view.componentProps.game.awayTeam.team_id:y.view.componentProps.teamView=0),y.view.componentProps.categoryView=d?[{id:i,name:d.name}]:[{id:i,name:`Category ${i}`}]}}}if(!n){const y=r[1]||1;this.childViews.forEach(c=>{var i;const d=(i=c.view.componentProps)==null?void 0:i.categoryView;if(d&&d.length>0){const l=d[0].id;b.includes(l)&&(c.view.filterMultiple={categoryId:l,teamType:y})}})}if(R.map(y=>y.categoryId).filter(y=>!b.includes(y)).forEach(y=>{this.childViews.filter(c=>{var i;const d=(i=c.view.componentProps)==null?void 0:i.categoryView;return d&&d.length>0&&d[0].id===y}).forEach(c=>{this.removeChildView(c),Un.emit("component-removed",{viewId:c.view.id,categoryId:y})})}),n){const y=b[0];if(y){const c=this.childViews.find(i=>i.view.id===n);if(c){let i=null;try{i=Jh(y)}catch{}const d=r[1]||1;c.view.filterMultiple={categoryId:y,teamType:d},c.view.componentProps.game&&(c.view.componentProps.teamView=d===2?c.view.componentProps.game.awayTeam.team_id:d===1?c.view.componentProps.game.homeTeam.team_id:0),c.view.componentProps.categoryView=i?[{id:y,name:i.name}]:[{id:y,name:`Category ${y}`}]}}}}else{const R=b;if(R&&n){const y=this.childViews.find(c=>c.view.id===n);if(y){let c=null;try{c=Jh(R)}catch{}const i=r[1]||1;y.view.filterMultiple={categoryId:R,teamType:i},y.view.componentProps.game&&(y.view.componentProps.teamView=i===2?y.view.componentProps.game.awayTeam.team_id:i===1?y.view.componentProps.game.homeTeam.team_id:0),y.view.componentProps.categoryView=c?[{id:R,name:c.name}]:[{id:R,name:`Category ${R}`}]}}}}if(this.viewId===8){const b=r[0]||!1;this.childViews.forEach(R=>{R.view.componentProps&&(R.view.componentProps._isReactive||(R.view.componentProps=t.reactive(R.view.componentProps),R.view.componentProps._isReactive=!0),R.view.componentProps.areInactiveVisible=b,R.view.componentProps.key=b,Un.emit("component-props-updated",{viewId:R.view.id,componentProps:R.view.componentProps,dynamicFilters:r}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:R.view.id,dynamicFilters:r}))})}if(this.viewId===1){const b=r[0]||[];if(n){this.setDynamicFilters(r,n);const R=this.childViews.find(y=>y.view.id===n);R&&this.updateComparative(R,r)}else if(this.childViews.reduce((R,y)=>(b.includes(y.view.componentProps.type)||R.push(y.view.componentProps.type),R),[]).forEach(R=>{const y=this.childViews.findIndex(c=>c.view.componentProps.type===R);if(y!==-1){for(let c=y;c<this.childViews.length;c++){const i=this.childViews[c+1],d=this.childViews[c];i&&(d.view.componentProps.type=i.view.componentProps.type,d.view.title=i.view.title)}this.removeChildView(this.childViews[this.childViews.length-1])}}),Array.isArray(b))this.childViews.length>0&&b.length>0&&this.childViews.forEach((R,y)=>{if(R.view.componentProps&&y<b.length){const c=b[y],i=Zh.get(this.viewId);R.view.componentProps.type=c,R.view.componentProps.default=!1,R.view.title=`Comparativa ${i[c]}`,R.view.filterMultiple={category:c}}});else{const R=b;if(R&&this.childViews.length>0){const y=this.childViews[0];if(y.view.componentProps){const c=Zh.get(this.viewId);y.view.componentProps.type=R,y.view.componentProps.default=!1,y.view.title=`Comparativa ${c[R]}`,y.view.filterMultiple={category:R}}}}}if(this.viewId===6){const b=r[0]||[];if(n){this.setDynamicFilters(r,n);const R=this.childViews.find(y=>y.view.id===n);R&&this.updateGSCLineupsReports(R,r)}else{if(Array.isArray(b))if(b.length===0)for(;this.childViews.length>0;)this.removeChildView(this.childViews[0]);else this.childViews.reduce((R,y)=>(b.includes(y.view.componentProps.gameNumber)||R.push(y.view.componentProps.gameNumber),R),[]).forEach(R=>{const y=this.childViews.findIndex(c=>c.view.componentProps.gameNumber===R);if(y!==-1){for(let c=y;c<this.childViews.length;c++){const i=this.childViews[c+1],d=this.childViews[c];i&&(d.view.componentProps.gameNumber=i.view.componentProps.gameNumber,d.view.filterMultiple={gameNumber:i.view.componentProps.gameNumber})}this.removeChildView(this.childViews[this.childViews.length-1])}});this.childViews.forEach(R=>{R.view.componentProps&&(R.view.componentProps._isReactive||(R.view.componentProps=t.reactive(R.view.componentProps),R.view.componentProps._isReactive=!0),Un.emit("component-props-updated",{viewId:R.view.id,componentProps:R.view.componentProps,dynamicFilters:r}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:R.view.id,dynamicFilters:r}))})}}if(this.viewId===3){if(n){this.setDynamicFilters(r,n);const b=this.childViews.find(R=>R.view.id===n);b&&this.updateMatchSummary(b,r)}else{const b=r[0]||!1;this.childViews.forEach(R=>{R.view.componentProps&&(R.view.componentProps._isReactive||(R.view.componentProps=t.reactive(R.view.componentProps),R.view.componentProps._isReactive=!0),R.view.componentProps.desplegable=b,R.view.componentProps.key=b,Un.emit("component-props-updated",{viewId:R.view.id,componentProps:R.view.componentProps,dynamicFilters:r}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:R.view.id,dynamicFilters:r}))})}this.updateSummary({dynamicFilters:r})}if(this.viewId===13){const b=r[1]||[];if(n){this.setDynamicFilters(r,n);const R=this.childViews.find(y=>y.view.id===n);R&&(R.view.componentProps&&(R.view.componentProps.categoryids=b,R.view.componentProps.analysistype=r[0]||1,R.view.componentProps.teamsshow=r[2]==1?[1]:r[2]==2?[2]:[1,2],R.view.dynamicFilters=r,R.view._updateKey=Date.now()),Un.emit("component-props-updated",{viewId:R.view.id,componentProps:R.view.componentProps,dynamicFilters:r}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:R.view.id,dynamicFilters:r}))}else this.childViews.forEach(R=>{R.view.componentProps&&(R.view.componentProps._isReactive||(R.view.componentProps=t.reactive(R.view.componentProps),R.view.componentProps._isReactive=!0),R.view.componentProps.categoryids=b,R.view.componentProps.analysistype=r[0]||1,R.view.componentProps.teamsshow=r[2]==1?[1]:r[2]==2?[2]:[1,2],R.view.dynamicFilters=r,R.view._updateKey=Date.now(),Un.emit("component-props-updated",{viewId:R.view.id,componentProps:R.view.componentProps,dynamicFilters:r}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:R.view.id,dynamicFilters:r}))})}else if(this.viewId===15){const b=r[0]||1,R=r[3]!==void 0?r[3]:typeof r[1]=="number"?r[1]:null;if(n){this.setDynamicFilters(r,n);const y=this.childViews.find(c=>c.view.id===n);y&&y.view.componentProps&&(y.view.componentProps.analysistype=b,R!==null&&(y.view.componentProps.numitems=R),y.view.dynamicFilters=r,y.view._updateKey=Date.now(),Un.emit("component-props-updated",{viewId:y.view.id,componentProps:y.view.componentProps,dynamicFilters:r}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:y.view.id,dynamicFilters:r}))}else this.childViews.forEach(y=>{y.view.componentProps&&(y.view.componentProps._isReactive||(y.view.componentProps=t.reactive(y.view.componentProps),y.view.componentProps._isReactive=!0),y.view.componentProps.analysistype=b,R!==null&&(y.view.componentProps.numitems=R),y.view.dynamicFilters=r,y.view._updateKey=Date.now(),Un.emit("component-props-updated",{viewId:y.view.id,componentProps:y.view.componentProps,dynamicFilters:r}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:y.view.id,dynamicFilters:r}))})}if(this.viewId===4){const b=r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0;if(n){const R=this.childViews.find(y=>y.view.id===n);R&&R.view.componentProps.selectedEvents}else if(!b&&this.childViews.length>0)this.childViews.forEach(R=>{this.removeChildView(R)});else if(b&&this.childViews.length===0){const R={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};Un.emit("add-view",R)}else this.childViews.forEach(R=>{this.updateTimeline(R,r)})}}finally{this._isUpdating=!1}}}removeAllChildViews(){[...this.childViews].forEach(r=>{this.removeChildView(r)})}removeChildView(r,n=!1){const b=this.childViews.findIndex(R=>R.view.id===r.view.id);if(b!==-1){const R=this.childViews[b];this.childViews.splice(b,1),R.view.id&&this.componentSpecificFilters.delete(R.view.id);const y=R.grid,c=R.page,i=document.querySelector(`[gs-id="${R.view.id}"]`);if(y&&i&&(y.removeWidget(i),c&&!n)){const d=c.items.findIndex(l=>l.id===R.view.id);d!==-1&&(c.items.splice(d,1),c.items.length===0&&Un.emit("empty-page",c))}}}updateView({view:r,dynamicFilters:n,filtersJSON:b,filters:R}){this.setFiltersJSON(b),this.dynamicFilters=n;const y=this.childViews.find(c=>{var i;return((i=c.view)==null?void 0:i.id)===r.view.id});if(y){y.view.filtersJSON=b,y.view.coreView&&(y.view.coreView.filtersJSON=b);let c=n;if(this.viewId===4){const i=this.getComponentDynamicFilters(r.view.id);i&&(c=i)}else if(this.viewId===8){const i=this.getComponentDynamicFilters(r.view.id);i&&(c=i)}else if(this.viewId===3){const i=this.getComponentDynamicFilters(r.view.id);i&&(c=i),this.updateSummary({dynamicFilters:c})}else if(this.viewId===1){const i=this.getComponentDynamicFilters(r.view.id);i&&(c=i)}else if(this.viewId===6){const i=this.getComponentDynamicFilters(r.view.id);i&&(c=i)}else if(this.viewId===7){const i=this.getComponentDynamicFilters(r.view.id);i&&(c=i)}else if(this.viewId===9){const i=this.getComponentDynamicFilters(r.view.id);i&&(c=i)}this.viewId===5?this.updateVolumetricField(y,c):this.viewId===7?this.updateGoalData(y,c):this.viewId===9?this.updateFieldDataByZones(y,n):this.viewId===10?this.updateXg(y,c):this.viewId===3?this.updateMatchSummary(y,c):this.viewId===4?this.updateTimeline(y,c):this.viewId===8?this.updateFieldPosesion(y,c):this.viewId===1?this.updateComparative(y,c):this.viewId===2?this.updateGSCtops(y,c):this.viewId===6?this.updateGSCLineupsReports(y,c):this.viewId===16?this.updateLastTouchSingle(y,R):this.viewId===18&&this.updateSpecificPlaysFiltersSingle(y,R)}}updateComparative(r,n){if(r.view.componentProps){const b=n[0]||[];if(b&&b.length>0){let R;if(Array.isArray(b)){const c=this.childViews.findIndex(i=>i.view.id===r.view.id);c>=0&&c<b.length?R=b[c]:R=b[0]}else R=b;const y=Zh.get(this.viewId);r.view.componentProps.type=R,r.view.componentProps.default=!1,r.view.title=`Comparativa ${y[R]}`,r.view.filterMultiple={category:R}}Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n})}}updateVolumetricField(r,n){if(r.view.componentProps){const b=n[0]||1;r.view.isHomeTeam=b===1,r.view.componentProps.preMatchType=b,r.view.filterMultiple={isHomeTeam:b},Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n}),Un.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateGoalData(r,n){if(r.view.componentProps){const b=n[0]===1?"offensive":"defensive",R=n[1]===1;r.view.componentProps.analysisType=b,r.view.componentProps.isHomeTeamForAnalysis=R,r.view.isHomeTeam=R,r.view.filterMultiple={isHomeTeam:R},Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n}),Un.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateFieldDataByZones(r,n){if(r.view.componentProps){const b=n[0],R=n[1]===1;if(r.view.componentProps.isHomeTeamForAnalysis=R,r.view.isHomeTeam=R,r.view.filterMultiple={categoryIds:b,isHomeTeam:R},b&&b.length){const y=b.join("-"),c=Zh.get(this.viewId).analysisTypes.get(y);c&&(r.view.componentProps.analysisType=c.analysisType,r.view.title=c.title,r.view.titleShort=c.titleShort)}}}updateXg(r,n){const b=n[0]===1;r.view.componentProps&&(r.view.isHomeTeam=b,r.view.componentProps.isHomeTeamForAnalysis=b,r.view.filtersJSON=this.filtresJSON,r.view.filterMultiple={isHomeTeam:b})}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 b=n&&n.length>0?n[0]:!1;r.view.componentProps.desplegable=b,r.view.componentProps.key=b,Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Un.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 b=this.getComponentDynamicFilters(r.view.id)||n,R=b&&b.length>0?b[0]:[];r.view.componentProps.selectedEvents=R,r.view.componentProps.key=R.length>0;const y=this.hasEventTypeId(R,1),c=this.hasCategoryId(R,8),i=this.hasCategoryId(R,9),d=this.hasEventTypeId(R,3);r.view.componentProps.goals=y,r.view.componentProps.yellowCards=c,r.view.componentProps.redCards=i,r.view.componentProps.substitutions=d,r.view.componentProps._updateKey=Date.now(),Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:b}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:b}),Un.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 b=n&&n.length>0?n[0]:!1;r.view.componentProps.areInactiveVisible=b,r.view.componentProps.key=b,Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n})}}updateGSCtops(r,n){if(r.view.componentProps){const b=n[0]||[];if(Array.isArray(b)){if(b.length>0){const R=b[0];let y=null;try{y=Jh(R)}catch(i){console.warn("Error getting category by ID:",i)}const c=n[1]||1;r.view.filterMultiple={categoryId:R,teamType:c},r.view.componentProps.game&&(c===1?r.view.componentProps.teamView=r.view.componentProps.game.homeTeam.team_id:c===2?r.view.componentProps.teamView=r.view.componentProps.game.awayTeam.team_id:r.view.componentProps.teamView=0),r.view.componentProps.categoryView=y?[{id:R,name:y.name}]:[{id:R,name:`Category ${R}`}]}}else{const R=b;if(R){let y=null;try{y=Jh(R)}catch(i){console.warn("Error getting category by ID:",i)}const c=n[1]||1;r.view.filterMultiple={categoryId:R,teamType:c},r.view.componentProps.game&&(c===1?r.view.componentProps.teamView=r.view.componentProps.game.homeTeam.team_id:c===2?r.view.componentProps.teamView=r.view.componentProps.game.awayTeam.team_id:r.view.componentProps.teamView=0),r.view.componentProps.categoryView=y?[{id:R,name:y.name}]:[{id:R,name:`Category ${R}`}]}}}}updateGSCLineupsReports(r,n){if(r.view.componentProps){const b=n[0]||[];if(Array.isArray(b)){if(b.length>0){const R=b[0];r.view.filterMultiple={gameNumber:R},r.view.componentProps.gameNumber=R}}else{const R=b;R&&(r.view.filterMultiple={gameNumber:R},r.view.componentProps.gameNumber=R)}Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n}),Un.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}getCategoryIdFromAnalysisType(r,n){if(!r||!n)return null;for(const b of n){const R=b.join("-"),y=Zh.get(this.viewId);if(y&&y.analysisTypes){const c=y.analysisTypes.get(R);if(c&&c.analysisType===r)return b[0]||null}}return null}updateLastTouchFilters(){if(!this.filters){console.warn("No filters available in updateLastTouchFilters");return}this.childViews.forEach(R=>{R.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,R.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,R.view.filterMultiple.howManyGamesSelected=this.filters.howManyGamesSelected,R.view.filterMultiple.isAssistZoneVisible=this.filters.isAssistZoneVisible});const r=this.filters.selectedCategories.map(R=>R.value),n=r.map(R=>R.name),b=this.filters.selectedTeam.value;if(b===3)this.childViews.length>r&&this.childViews.reduce((R,y)=>(n.includes(y.view.componentProps.categories[0].name)||R.push(y.view.componentProps.categories[0].name),R),[]).forEach(R=>{const y=this.childViews.findIndex(c=>c.view.componentProps.categories[0].name===R);if(y!==-1){const c=this.childViews[y];this.removeChildView(c)}});else{const R=b===1,y=this.getHomeTeamViews(),c=this.getAwayTeamViews();if(R&&y.length===0)c.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=R,i.view.isHomeTeam=R,i.view.filterMultiple.isHomeTeam=R});else if(!R&&c.length===0)y.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=R,i.view.isHomeTeam=R,i.view.filterMultiple.isHomeTeam=R});else if(y.length===c.length)R||y.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=R,i.view.isHomeTeam=R,i.view.filterMultiple.isHomeTeam=R}),(R?c:y).forEach(i=>{this.removeChildView(i)});else{const i=R?this.getHomeTeamViews():this.getAwayTeamViews();if(i.length>r.length){const d=r.map(l=>l.name);i.forEach(l=>{d.includes(l.view.componentProps.categories[0].name)?l.view.filterMultiple.isHomeTeam=R:this.removeChildView(l)})}else i.forEach(d=>{d.view.filterMultiple.isHomeTeam=R})}}}updateLastTouchSingle(r,n){if(r.view.componentProps){const b=n.selectedTeam.value===1,R=n.selectedCategory.value;r.view.isHomeTeam=b,r.view.componentProps.isHomeTeamForAnalysis=b,r.view.componentProps.categories=[R],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=R.name,r.view.titleShort=R.name,r.view.isHomeTeam=b,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:R,selectedGamePhase:n.selectedGamePhase,howManyGamesSelected:n.howManyGamesSelected,isAssistZoneVisible:n.isAssistZoneVisible}}}updateSpecificPlaysFilters(){if(console.log("updateSpecificPlaysFilters called"),!this.filters){console.warn("No filters available in updateCornershFilters");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(),b=this.getAwayTeamViews();if(n.length+b.length>this.filters.howManyCorners*2){const R=[];n.forEach((y,c)=>{c>=this.filters.howManyCorners&&R.push(y)}),b.forEach((y,c)=>{c>=this.filters.howManyCorners&&R.push(y)}),R.forEach(y=>{this.removeChildView(y)})}}else{const n=r===1,b=this.getHomeTeamViews(),R=this.getAwayTeamViews();n&&b.length===0?R.forEach(y=>{console.log("awayView before update:",y),y.view.componentProps.isHomeTeamForAnalysis=n,y.view.isHomeTeam=n,y.view.filterMultiple.isHomeTeam=n}):!n&&R.length===0?b.forEach(y=>{y.view.componentProps.isHomeTeamForAnalysis=n,y.view.isHomeTeam=n,y.view.filterMultiple.isHomeTeam=n}):b.length===R.length&&(n||b.forEach(y=>{y.view.componentProps.isHomeTeamForAnalysis=n,y.view.isHomeTeam=n,y.view.filterMultiple.isHomeTeam=n}),(n?R:b).forEach(y=>{this.removeChildView(y)}))}}updateSpecificPlaysFiltersSingle(r,n){if(console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"),console.log("view:",r),console.log("filter:",n),console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"),n.selectedTeam&&r.view.componentProps){const b=n.selectedTeam.value===1;r.view.isHomeTeam=b,r.view.componentProps.isHomeTeamForAnalysis=b,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.advancedFilters=n.advancedFilters,r.view.isHomeTeam=b,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:n.advancedFilters}}}}const z9e={class:"template-page__header"},E9e={class:"template-page__header__name"},P9e=["value"],R9e={class:"template-page__header__details"},M9e={class:"template-page__header__details__teams"},F9e={class:"template-page__header__details__teams__team"},j9e={key:0,class:"template-page__header__details__teams__team__logo"},W9e=["src"],A9e={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},K9e={class:"template-page__header__details__teams__team"},I9e={key:0,class:"template-page__header__details__teams__team__logo"},X9e=["src"],D9e={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B9e={class:"template-page__content"},G9e=["id"],J9e=["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"],Z9e=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,b,R;const y=t.ref(null);let c=null;const i=e,d=t.ref(!1),l=r,a=t.computed(()=>i.page.items.reduce((W,A)=>(W.set(A.id,A),W),new Map)),S=t.computed(()=>{var W,A,X,D;return i.game&&i.game.homeTeam&&i.game.awayTeam?{homeTeam:{name:((W=i.game.homeTeam)==null?void 0:W.acronym)||"LOC",logo:((A=i.game.homeTeam)==null?void 0:A.logo)||null},awayTeam:{name:((X=i.game.awayTeam)==null?void 0:X.acronym)||"VIS",logo:((D=i.game.awayTeam)==null?void 0:D.logo)||null}}:{homeTeam:{name:"LOC"},awayTeam:{name:"VIS"}}});let x=null,v=null,p=!1,o=null,s=!1;const f=()=>{s=!0},u=()=>{s=!1};function m(){s||(p=!0,o&&clearTimeout(o),o=setTimeout(()=>{p=!1},150))}function w(){const W={root:null,rootMargin:"0px",threshold:.7};x=new IntersectionObserver(D=>{D.forEach(Y=>{if(p){v&&clearTimeout(v),v=setTimeout(()=>{l("intersection-changed",Y.isIntersecting)},100);return}v&&clearTimeout(v),v=setTimeout(()=>{l("intersection-changed",Y.isIntersecting)},50)})},W);const A=y.value;A&&x.observe(A);const X=document.querySelector(".container-main");X&&X.addEventListener("scroll",m,{passive:!0}),document.addEventListener("programmatic-scroll-start",f),document.addEventListener("programmatic-scroll-end",u)}function _(W){i.page.title=W.target.value,l("view-changed")}const T={game_id:0,season_id:0,prematch:!1},V={gameId:90209,id:90209,seasonId:1909,regularSeasonId:1909,matchday_name:"Matchday 1",status:1,score:[1,3],game_status:1,dateTimeUTC:"2024-09-05T22:00:00Z",homeTeam:{logo:"https://golstatsimages.blob.core.windows.net/teams-80/2936.png",team_id:2936,provisional_logo:"https://golstatsimages.blob.core.windows.net/teams-provisional/2936.png",colloquial_name:"Guyana",acronym:"GUY",team_name:"Guyana"},awayTeam:{logo:"https://golstatsimages.blob.core.windows.net/teams-80/3279.png",team_id:3279,provisional_logo:"https://golstatsimages.blob.core.windows.net/teams-provisional/3279.png",colloquial_name:"Surinam",acronym:"SUR",team_name:"Surinam"},is_live:0,minutes:{home_goals_minutes:[],visiting_goals_minutes:[],home_yellow_cards_minutes:[],away_yellow_cards_minutes:[],home_red_cards_minutes:[],away_red_cards_minutes:[]}},L=new Map([[5,{component:D4,componentName:"GSCVolumetricField",props:{isGamePreMatch:!i.isPostMatch,areTeamsVisible:!1,isTitleVisible:!1,isGhostEffect:i.isTemplateMode,isTemplateMode:i.isTemplateMode,preMatchType:1}}],[2,{component:P7,componentName:"GscTopPlayer",props:{categoryView:[{id:0,name:"Category"}],gamed:i.game?i.game.id:V.gameId,game:i.game,season:i.game?(n=i==null?void 0:i.game)==null?void 0:n.season_id:V.seasonId,teamView:0,useDummyData:i.isTemplateMode}}],[8,{component:F9,componentName:"FieldPosesion",props:{widthSection:600,game:V,teamSelected:{teamId:0},areInactiveVisible:!0,showTitle:!1,isDefault:!0,key:!1}}],[6,{component:Kk,componentName:"GSCLineupsReports",props:{selectedOption:i.isPostMatch?"Postmatch":"Prematch",game:T,gamehome:T,gameaway:T}}],[3,{component:A9,componentName:"GSCMatchSummary",props:{game:V,defaultShields:!0,desplegable:!1}}],[4,{component:k8,componentName:"GSCTimelineReports",props:{key:!0,isDefault:!0,gameId:V.gameId,homeTeam:V.homeTeam.team_id,awayTeam:V.awayTeam.team_id,token:i.token,goals:!0,yellowCards:!0,redCards:!0,substitutions:!0}}],[7,{component:qN,componentName:"GSCGoalData",props:{game:i.game,isHomeTeamForAnalysis:!0,canInteract:!1,canPlayVideos:!1,isPreMatch:!i.isPostMatch,analysisType:1}}],[9,{component:Ik,componentName:"GSCFieldDataByZones",props:{game:i.game,isHomeTeamForAnalysis:!0,analysisType:"successfulPasses",canPlayVideos:!1,isPreMatch:!i.isPostMatch,negative:!0}}],[10,{component:F5,componentName:"GSCGameXg",props:{game:i.game,isHomeTeamForAnalysis:!0,isPostMatch:i.isPostMatch}}],[13,{component:e4,componentName:"GSCTimelapseTable",props:{isdefault:!0,seasonId:i.game?(b=i==null?void 0:i.game)==null?void 0:b.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:p6,componentName:"GSCGeneraltable",props:{isReports:!0,isDefault:!0,type:0,typeView:1,tournament:1,currentSeasonId:2010,showVideos:!1,localTeam:2,awayTeam:1}}],[15,{component:OV,componentName:"GSCStrengths",props:{token:i.token,view:1,numitems:3,typegame:1,isdefault:!0,data:{player:35240,season:1772,type:2,team:14}}}],[10,{component:F5,componentName:"GSCGameXg",props:{game:i.game,isHomeTeamForAnalysis:!0,isPostMatch:i.isPostMatch}}],[1,{component:VN,componentName:"GSCComparativeReports",props:{gameId:i.game?i.game.id:"",homeLogo:i.game?i.game.homeTeam.logo:"",awayLogo:i.game?i.game.awayTeam.logo:"",seasonId:i.game?(R=i==null?void 0:i.game)==null?void 0:R.season_id:0,typeGame:i.isPostMatch,type:"stoppedBall",default:i.isTemplateMode}}],[16,{component:RV,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:i.isTemplateMode,isPreMatch:!i.isPostMatch}}],[18,{component:OL,componentName:"GSCSpecificPlays",props:{isHomeTeamForAnalysis:!0,isTemplateMode:i.isTemplateMode,isPreMatch:!i.isPostMatch,seasonIdForAnalysis:1325,selectedCategory:31,teamIdForAnalysis:1,iaAgainstMode:!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 O(W){if(W)if(typeof W=="string"){let A=null;switch(W){case"GSCVolumetricField":A=D4;break;case"GSCGoalData":A=qN;break;case"GscTopPlayer":A=P7;break;case"FieldPosesion":A=F9;break;case"GSCLineupsReports":A=Kk;break;case"GSCMatchSummary":A=A9;break;case"GSCTimelineReports":A=k8;break;case"GSCFieldDataByZones":A=Ik;break;case"GSCGeneraltable":A=p6;break;case"GSCTimelapseTable":A=e4;break;case"GSCGameXg":A=F5;break;case"GSCComparativeReports":A=VN;break;case"GSCStrengths":A=OV;break;case"GSCLastTouch":A=RV;break;case"GSCSpecificPlays":A=OL;break;default:A=null}return A}else return W;return null}function U({pageId:W,view:A,filterAndWidgetContainer:X,applyMinimumSize:D=!1,dynamicFilters:Y=[],filters:re=null}){if(i.page.id===W&&c){let G=!1;A.id===3&&(G=Y[0]);const te=`min_column${G?"_2":""}`,ee=`min_row${G?"_2":""}`,H=`colspan${G?"_2":""}`,$=`rowspan${G?"_2":""}`,oe={w:D?A[te]:A[H],h:D?A[ee]:A[$]};if(c.willItFit(0,0,oe.w,oe.h,!0)){const se=c.addWidget(oe),ce=Number(se.getAttribute("gs-x")||0),he=Number(se.getAttribute("gs-y")||0);c.removeWidget(se);const ne=L.get(A.id),de=t.reactive({...JSON.parse(JSON.stringify(ne.props))||{},_isReactive:!0}),ue=t.reactive({pageId:W,grid:c,page:i.page,view:{name:A.name,title:A.title,key:Date.now()-7*Math.random(),id:`w-${String(Date.now())}`,x:ce,y:he,w:oe.w,h:oe.h,maxWidth:A.max_column,maxHeight:A.max_row,minWidth:A.min_column,minHeight:A.min_row,componentName:ne.componentName,componentProps:de,pageId:W,coreView:A}});X.addView(ue),Un.emit("add-page-view",ue)}else Un.emit("add-page-and-view",{pageId:W,view:A,filterAndWidgetContainer:X})}}function q(W){if(c){const A=document.querySelector(`[gs-id="${W.id}"]`);A&&(c.removeWidget(A),l("delete-view",W))}}function z(W){if(!W.filterAndViewsContainer&&W.coreView){const A=new p1(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[W],W.coreView.id,W.dynamicFilters||[],i.isPostMatch,i.isTemplateMode,W.filtersJSON,null,W.filters);W.filterAndViewsContainer=A}l("edit-view",W)}function C(){l("delete-page",i.page)}function N(){Un.emit("change-sort",i.page)}function E(W){if(p)return;const A=i.page.items.find(X=>X.id===W.itemId||X.id===W.viewId);A&&(Object.assign(A.componentProps,W.componentProps),A._updateKey=Date.now())}function k(W){if(p)return;const A=i.page.items.find(X=>X.id===W.viewId);A&&(Object.assign(A.componentProps,W.componentProps),A._updateKey=Date.now())}function P(W){if(p)return;const A=i.page.items.find(X=>X.id===W.viewId);A&&(Object.assign(A.componentProps,W.componentProps||{}),A._updateKey=Date.now())}const F=function(){Un.off("add-view",U),Un.off("force-component-update",E),Un.off("component-props-updated",k),Un.off("dynamic-filters-changed",P);const W=document.querySelector(".container-main");W&&W.removeEventListener("scroll",m),v&&clearTimeout(v),o&&clearTimeout(o)};return Un.on("add-view",U),Un.on("force-component-update",E),Un.on("component-props-updated",k),Un.on("dynamic-filters-changed",P),t.onMounted(async()=>{await t.nextTick(),c=bi.init({column:12,row:12,maxRow:12,cellHeight:60,float:!0,resizable:{handles:"e, se, s, sw, w"}},`#grid-stack-${i.id}`),c.on("change",(W,A)=>{const X=A[0];if(X){const D=a.value.get(X.id);D&&(D.x=X.x,D.y=X.y,D.w=X.w,D.h=X.h,l("view-changed"))}}),w(),i.page.grid=c,i.page.offListeners=F}),t.onUnmounted(()=>{x&&x.disconnect(),F(),v&&clearTimeout(v),o&&clearTimeout(o),document.removeEventListener("programmatic-scroll-start",f),document.removeEventListener("programmatic-scroll-end",u)}),(W,A)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"templatePage",ref:y,class:"template-page"},[t.createElementVNode("div",z9e,[d.value?(t.openBlock(),t.createBlock(qL,{key:0,"options-type":"page",onClick:A[0]||(A[0]=t.withModifiers(X=>d.value=!1,["self"])),onMouseleave:A[1]||(A[1]=X=>d.value=!1),onCloseTooltip:A[2]||(A[2]=X=>d.value=!1),onDeletePage:C,onChangeSort:N})):t.createCommentVNode("",!0),t.createElementVNode("div",E9e,[A[4]||(A[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)),A[5]||(A[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:_},null,40,P9e)]),t.createElementVNode("div",R9e,[t.createElementVNode("div",M9e,[t.createElementVNode("div",F9e,[S.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",j9e,[t.createElementVNode("img",{src:S.value.homeTeam.logo,alt:"Home Team Logo",width:"25",height:"25"},null,8,W9e)])):(t.openBlock(),t.createElementBlock("svg",A9e,[...A[6]||(A[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(S.value.homeTeam.name),1)]),A[8]||(A[8]=t.createElementVNode("div",{class:"template-page__header__details__teams__vs"}," VS ",-1)),t.createElementVNode("div",K9e,[t.createElementVNode("span",null,t.toDisplayString(S.value.awayTeam.name),1),S.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",I9e,[t.createElementVNode("img",{src:S.value.awayTeam.logo,alt:"Away Team Logo",width:"25",height:"25"},null,8,X9e)])):(t.openBlock(),t.createElementBlock("svg",D9e,[...A[7]||(A[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:A[3]||(A[3]=X=>d.value=!0)},[...A[9]||(A[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",B9e,[t.createElementVNode("div",{id:`grid-stack-${e.id}`,class:"grid-stack"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.page.items,X=>{var D,Y,re;return t.openBlock(),t.createElementBlock("div",{class:"grid-stack-item",key:X.key,"gs-id":X.id,"gs-x":X.x,"gs-y":X.y,"gs-w":X.w,"gs-h":X.h,"gs-max-w":X.maxWidth,"gs-max-h":X.maxHeight,"gs-min-w":X.minWidth,"gs-min-h":X.minHeight,"gs-no-resize":!e.isTemplateMode,"gs-no-move":!i.isTemplateMode,"gs-auto-position":X.x===0&&X.y===0},[t.createElementVNode("div",{class:t.normalizeClass(["grid-stack-item-content",{"is-selected":X.isSelected}])},[t.createVNode(S9e,{view:X,"is-template-mode":e.isTemplateMode,"is-post-match":e.isPostMatch,game:e.game,lastGames:e.lastGames,"is-home-team":(D=X.componentProps)!=null&&D.preMatchType?((Y=X.componentProps)==null?void 0:Y.preMatchType)===1:X.isHomeTeam,"is-filter-visible":e.isFilterVisible,"view-id":((re=X==null?void 0:X.coreView)==null?void 0:re.id)||0,onEdit:G=>z(X),onDelete:G=>q(X)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(O(X.componentName)),t.mergeProps({ref_for:!0},X.componentProps,{key:`${X.id}-${X._updateKey||0}`}),null,16))]),_:2},1032,["view","is-template-mode","is-post-match","game","lastGames","is-home-team","is-filter-visible","view-id","onEdit","onDelete"])],2)],8,J9e)}),128))],8,G9e)])],512))}}),H9e=pc(Z9e,[["__scopeId","data-v-9b6eca9e"]]),Y9e={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},Q9e={key:0,class:"cover__main-logo cover__main-logo__home"},$9e={key:0,class:"team-logo"},e8e=["src"],t8e={key:1,width:"575",height:"675",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r8e=["fill"],a8e={key:1,class:"cover__main-logo cover__main-logo__away"},n8e={key:0,class:"team-logo"},i8e=["src"],o8e={key:1,width:"575",height:"575",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s8e=["fill"],l8e={class:"cover__title-subtitle"},c8e={class:"cover__title-subtitle__title"},u8e={class:"cover__title-subtitle__subtitle"},d8e={key:2,class:"cover-type-one"},p8e={class:"team-info-one"},h8e={class:"team-data"},f8e={key:0,class:"team-logo"},m8e=["src"],y8e={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g8e=["fill","opacity"],v8e={class:"team-name"},b8e={key:0,class:"team-events"},x8e={class:"score-one"},w8e={key:0},_8e={class:"team-info-one"},S8e={class:"team-data"},T8e={key:0,class:"team-logo"},k8e=["src"],N8e={key:1,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},V8e=["fill","opacity"],L8e={class:"team-name"},O8e={key:0,class:"team-events"},q8e={key:3,class:"cover-type-two"},C8e={class:"team-data"},U8e={class:"team-info"},z8e={key:0,class:"team-logo"},E8e=["src"],P8e={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},R8e=["fill","opacity"],M8e={key:2,class:"team-score-two"},F8e={key:0,class:"team-goals"},j8e={class:"team-data"},W8e={class:"team-info"},A8e={key:0,class:"team-score-two"},K8e={key:1,class:"team-logo"},I8e=["src"],X8e={key:2,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},D8e=["fill","opacity"],B8e={key:0,class:"team-goals"},G8e={__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,b=r,R=t.ref(null),y=t.computed(()=>[1,2].includes(n.coverId)),c=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}),d=t.computed(()=>n.game&&n.game.score?n.game.score:["0","0"]),l=t.computed(()=>{var O,U,q,z,C,N,E,k;if(n.game&&n.game.homeTeam&&n.game.awayTeam){const P={homeTeam:{name:((O=n.game.homeTeam)==null?void 0:O.acronym)||"LOC",logo:((U=n.game.homeTeam)==null?void 0:U.logo)||null},awayTeam:{name:((q=n.game.awayTeam)==null?void 0:q.acronym)||"VIS",logo:((z=n.game.awayTeam)==null?void 0:z.logo)||null}};return y.value?(P.homeTeam.goalsMinutes=o(n.game.minutes.home_goals_minutes),P.homeTeam.totalYellowCards=((C=n.game.minutes.home_yellow_cards_minutes)==null?void 0:C.length)||0,P.homeTeam.totalRedCards=((N=n.game.minutes.home_red_cards_minutes)==null?void 0:N.length)||0,P.awayTeam.goalsMinutes=o(n.game.minutes.visiting_goals_minutes),P.awayTeam.totalYellowCards=((E=n.game.minutes.away_yellow_cards_minutes)==null?void 0:E.length)||0,P.awayTeam.totalRedCards=((k=n.game.minutes.away_red_cards_minutes)==null?void 0:k.length)||0):(P.homeTeam.goalsEvents=p(n.game.report_minutes.home_goals_minutes),P.awayTeam.goalsEvents=p(n.game.report_minutes.visiting_goals_minutes)),P}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":c.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"})),S=t.computed(()=>n.isPostMatch?"Postmatch":"Prematch"),x=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],v=t.computed(()=>{if(n.game){let O=Y9e[n.game.matchday_abbreviation];O||(O=n.game.matchday_abbreviation.replace("M","J"));const[U,q,z]=n.game.date.split("-");return`${O} - ${z} ${x[Number(q)-1]}, ${U}`}return"Jornada - Día 00 Mes"});function p(O){return!O||!Array.isArray(O)||O.length===0?"":O.map(U=>{const q=U.split(", ");let z=q[0].replace("'","");z=z.replace("+",""),z=z.replace("’","");const C=z.split(" "),{strings:N,numbers:E}=C.reduce((F,W)=>(isNaN(Number(W))?F.strings.push(W):F.numbers.push(W),F),{strings:[],numbers:[]}),k=N.join(" "),P=E.length===1?`${E[0]}'`:`${E[0]}' ${E.slice(1).join(" + ")}'`;return{playerName:k,goalTime:q.length===1?P:`${P}, ${q.reduce((F,W,A)=>A===0?F:`${F}${W}${A<q.length-1?", ":""}`,"")}`}})}function o(O){return!O||!Array.isArray(O)||O.length===0?"":O.reduce((U,q,z)=>{const C=q.split(" ");let N="";return C.length===3?N=C[2]:C.length===5&&(N=`${C[2]} ${C[3]} ${C[4]}`),N&&(U+=`${N}${z<O.length-1?", ":""}`),U},"")}let s=null,f=null,u=!1,m=null,w=!1;const _=()=>{w=!0},T=()=>{w=!1};function V(){w||(u=!0,m&&clearTimeout(m),m=setTimeout(()=>{u=!1},150))}function L(){const O={root:null,rootMargin:"0px",threshold:.7};s=new IntersectionObserver(z=>{z.forEach(C=>{if(u){f&&clearTimeout(f),f=setTimeout(()=>{b("intersection-changed",C.isIntersecting)},100);return}f&&clearTimeout(f),f=setTimeout(()=>{b("intersection-changed",C.isIntersecting)},50)})},O);const U=R.value;U&&s.observe(U);const q=document.querySelector(".container-main");q&&q.addEventListener("scroll",V,{passive:!0}),document.addEventListener("programmatic-scroll-start",_),document.addEventListener("programmatic-scroll-end",T)}return t.onMounted(()=>{L()}),t.onUnmounted(()=>{s&&s.disconnect();const O=document.querySelector(".container-main");O&&O.removeEventListener("scroll",V),document.removeEventListener("programmatic-scroll-start",_),document.removeEventListener("programmatic-scroll-end",T),f&&clearTimeout(f),m&&clearTimeout(m)}),(O,U)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"coverPage",ref:R,class:"cover",style:t.normalizeStyle(a.value)},[y.value?(t.openBlock(),t.createElementBlock("div",Q9e,[l.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",$9e,[t.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,e8e)])):(t.openBlock(),t.createElementBlock("svg",t8e,[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,r8e)]))])):t.createCommentVNode("",!0),y.value?(t.openBlock(),t.createElementBlock("div",a8e,[l.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",n8e,[t.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,i8e)])):(t.openBlock(),t.createElementBlock("svg",o8e,[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,s8e)]))])):t.createCommentVNode("",!0),t.createElementVNode("div",l8e,[t.createElementVNode("div",c8e,[U[0]||(U[0]=t.createElementVNode("div",null,"Análisis",-1)),t.createElementVNode("div",null,t.toDisplayString(S.value),1)]),t.createElementVNode("div",u8e,t.toDisplayString(v.value),1)]),y.value?(t.openBlock(),t.createElementBlock("div",d8e,[t.createElementVNode("div",p8e,[t.createElementVNode("div",h8e,[l.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",f8e,[t.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,m8e)])):(t.openBlock(),t.createElementBlock("svg",y8e,[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,g8e)])),t.createElementVNode("div",v8e,t.toDisplayString(l.value.homeTeam.name),1)]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",b8e,[U[1]||(U[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(l.value.homeTeam.goalsMinutes),1),U[2]||(U[2]=t.createElementVNode("div",{class:"separator"},null,-1)),U[3]||(U[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(l.value.homeTeam.totalYellowCards),1),U[4]||(U[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(l.value.homeTeam.totalRedCards),1)])):t.createCommentVNode("",!0)]),t.createElementVNode("div",x8e,[e.isPostMatch?(t.openBlock(),t.createElementBlock("div",w8e,t.toDisplayString(d.value[0])+" : "+t.toDisplayString(d.value[1]),1)):t.createCommentVNode("",!0)]),t.createElementVNode("div",_8e,[t.createElementVNode("div",S8e,[l.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",T8e,[t.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,k8e)])):(t.openBlock(),t.createElementBlock("svg",N8e,[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,V8e)])),t.createElementVNode("div",L8e,t.toDisplayString(l.value.awayTeam.name),1)]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",O8e,[t.createElementVNode("div",null,t.toDisplayString(l.value.awayTeam.totalYellowCards),1),U[5]||(U[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(l.value.awayTeam.totalRedCards),1),U[6]||(U[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)),U[7]||(U[7]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",null,t.toDisplayString(l.value.awayTeam.goalsMinutes),1),U[8]||(U[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",q8e,[t.createElementVNode("div",C8e,[t.createElementVNode("div",U8e,[l.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",z8e,[t.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,E8e)])):(t.openBlock(),t.createElementBlock("svg",P8e,[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,R8e)])),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",M8e,t.toDisplayString(d.value[0]),1)):t.createCommentVNode("",!0)]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",F8e,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value.homeTeam.goalsEvents,(q,z)=>(t.openBlock(),t.createElementBlock("div",{key:`goal-${z}`,class:"goal"},[t.createElementVNode("div",null,t.toDisplayString(q.playerName),1),U[9]||(U[9]=t.createElementVNode("div",{class:"bullet"},null,-1)),t.createElementVNode("div",null,t.toDisplayString(q.goalTime),1),U[10]||(U[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)]),U[13]||(U[13]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",j8e,[t.createElementVNode("div",W8e,[e.isPostMatch?(t.openBlock(),t.createElementBlock("div",A8e,t.toDisplayString(d.value[1]),1)):t.createCommentVNode("",!0),l.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",K8e,[t.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,I8e)])):(t.openBlock(),t.createElementBlock("svg",X8e,[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,D8e)]))]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",B8e,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value.awayTeam.goalsEvents,(q,z)=>(t.openBlock(),t.createElementBlock("div",{key:`goal-a-${z}`,class:"goal"},[U[11]||(U[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(q.goalTime),1),U[12]||(U[12]=t.createElementVNode("div",{class:"bullet"},null,-1)),t.createElementVNode("div",null,t.toDisplayString(q.playerName),1)]))),128))])):t.createCommentVNode("",!0)])]))],4))}},J8e=pc(G8e,[["__scopeId","data-v-6680cbcf"]]),Z8e={class:"table-category-filters"},H8e={key:0,class:"custom-radio-group filter-inline"},Y8e={class:"radio-label"},Q8e={class:"radio-options"},$8e=["name","value","onUpdate:modelValue","onClick"],eke=["data-filter-type","onClick","onMousedown","onMouseup"],tke={class:"select-display"},rke={class:"select-label"},ake={key:0,class:"dropdown-menu type-menu simple-select-menu"},nke={class:"simple-select-scroll-area"},ike=["onClick"],oke={class:"option-content"},ske={class:"option-title"},lke={key:0,class:"option-checkmark"},cke={key:2,class:"filter-separator"},uke={__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 b=e,R=n,y=t.ref([]);let c=null;const i=(w,_)=>{if(!_)return!0;for(let T=0;T<w.length;T++)if(!d(w[T],_[T]))return!0;return!1},d=(w,_)=>{if(Array.isArray(w)&&Array.isArray(_)){if(w.length!==_.length)return!1;for(let T=0;T<w.length;T++)if(w[T]!==_[T])return!1;return!0}return w===_},l=t.ref(null),a=t.ref([]);let S=!1,x=null;const v=()=>{x=null},p=()=>{setTimeout(()=>{S=!1},1e3)},o=(w,_=!0)=>{if(b.filters&&b.filters[0]&&b.filters[1]&&b.filters[1].options){const T=b.filters[0].options,V=b.filters[1].options;w!=null?T.findIndex(L=>L.value===w)!==-1&&V[w]?(a.value=V[w],_&&!(()=>{const L=y.value[1];return L==null?!1:Array.isArray(L)?L.length>0:L!==""})()&&!S&&a.value.length>0&&(y.value[1]=a.value[0].value,t.nextTick(()=>{}))):(a.value=[],y.value[1]=null):(a.value=[],y.value[1]=null)}},s=()=>{b.initialValues&&b.initialValues.length>0?y.value=[...b.initialValues]:y.value=b.filters.map(w=>{var _,T,V,L;return w.type==="select"?[]:w.type==="check"?!1:w.type==="radio-button"?((T=(_=w.options)==null?void 0:_[0])==null?void 0:T.value)||null:w.type==="select-simple"&&((L=(V=w.options)==null?void 0:V[0])==null?void 0:L.value)||null}),b.componentId===13&&y.value.some(w=>w!=null&&(Array.isArray(w)?w.length>0:w!==!1&&w!==""))&&(c=[...y.value],R("filters-changed",{componentId:b.componentId,filters:y.value,timestamp:new Date().toISOString()}))};s(),setTimeout(()=>{t.nextTick(()=>{if(y.value[0]!==null&&y.value[0]!==void 0&&!S){const w=!(()=>{const _=y.value[1];return _==null?!1:Array.isArray(_)?_.length>0:_!==""})();o(y.value[0],w)}})},300),t.watch(()=>b.initialValues,w=>{const _=!d(y.value,w),T=w&&w.length>0&&!S&&_,V=b.isEditMode&&S;T&&!V?y.value=[...w]:S?x&&x.length>0&&(y.value=[...x]):V&&x&&x.length>0&&(y.value=[...x])},{deep:!0}),t.watch(()=>b.isEditMode,(w,_)=>{_===!0&&w===!1&&v()},{immediate:!0}),t.watch(y,(w,_)=>{w.some(T=>T!=null&&(Array.isArray(T)?T.length>0:T!==!1&&T!==""))&&i(w,c)&&(c=[...w],R("filters-changed",{componentId:b.componentId,filters:w,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),t.watch(()=>y.value[0],(w,_)=>{w!==_&&_!==void 0?o(w,!0):_===void 0&&w!==null&&w!==void 0&&o(w,!1)},{immediate:!0}),t.watch(()=>y.value,(w,_)=>{b.filters.map((T,V)=>T.type==="radio-button"?V:-1).filter(T=>T!==-1).forEach(T=>{})},{deep:!0}),t.watch(a,()=>{},{deep:!0});const f=w=>{l.value===w?l.value=null:l.value=w},u=(w,_)=>{if(S=!0,p(),y.value[w]=_,(w===0||w===1)&&(x=[...y.value]),l.value=null,w===0){y.value[1]!==void 0&&(y.value[1]=null);const T=S;S=!1,o(_,!0),S=T,y.value[1]!==null&&y.value[1]!==void 0&&(x=[...y.value])}},m=()=>{S=!0,setTimeout(()=>{S=!1},1e3)};return r({getCurrentValues:()=>y.value,initializeValues:s}),(w,_)=>(t.openBlock(),t.createElementBlock("div",Z8e,[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,(T,V)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:V},[T.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",H8e,[t.createElementVNode("div",Y8e,t.toDisplayString(T.label),1),t.createElementVNode("div",Q8e,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(T.options,L=>(t.openBlock(),t.createElementBlock("label",{key:L.value,class:t.normalizeClass(["radio-option-card",{active:y.value[V]===L.value}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"table-radio-"+V,value:L.value,"onUpdate:modelValue":O=>y.value[V]=O,onChange:_[0]||(_[0]=()=>{m()}),onClick:O=>console.log("Click en radio button",V,L.value,"Valor actual:",y.value[V])},null,40,$8e),[[t.vModelRadio,y.value[V]]]),t.createElementVNode("span",null,t.toDisplayString(L.label),1)],2))),128))])])):T.type==="select-simple"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"custom-select dynamic-select filter-inline","data-filter-type":T.type,onClick:t.withModifiers(L=>f(V),["stop"]),onMousedown:L=>console.log("Mouse down en selector",V),onMouseup:L=>console.log("Mouse up en selector",V)},[t.createElementVNode("div",tke,[_[2]||(_[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",rke,t.toDisplayString(T.label||"Tipo de análisis"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:l.value===V}])},[..._[1]||(_[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)]),l.value===V?(t.openBlock(),t.createElementBlock("div",ake,[t.createElementVNode("div",nke,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(V===1?a.value:T.options,L=>(t.openBlock(),t.createElementBlock("div",{key:L.value,class:t.normalizeClass(["option-card simple-select-option",{active:d(y.value[V],L.value)}]),onClick:t.withModifiers(O=>u(V,L.value),["stop"])},[t.createElementVNode("div",oke,[t.createElementVNode("div",ske,t.toDisplayString(L.label),1)]),d(y.value[V],L.value)?(t.openBlock(),t.createElementBlock("div",lke,[..._[3]||(_[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,ike))),128))])])):t.createCommentVNode("",!0)],40,eke)):t.createCommentVNode("",!0),V===1&&e.filters.length>2?(t.openBlock(),t.createElementBlock("div",cke)):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0)]))}},dke=pc(uke,[["__scopeId","data-v-9d00f072"]]),pke={class:"strengths-filters"},hke={key:0,class:"custom-radio-group filter-inline"},fke={class:"radio-label"},mke={class:"radio-options"},yke=["name","value","onUpdate:modelValue"],gke={class:"filter-inline select-with-label"},vke=["data-filter-type","onClick"],bke={class:"select-display"},xke={class:"select-label"},wke={key:0,class:"dropdown-menu type-menu simple-select-menu"},_ke={class:"simple-select-scroll-area"},Ske=["onClick"],Tke={class:"option-content"},kke={class:"option-title"},Nke={key:0,class:"option-checkmark"},Vke={key:2,class:"filter-separator"},Lke={__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 b=e,R=n,y=t.ref([]);let c=null;const i=t.ref(null),d=t.ref([]);let l=!1,a=null;const S=(f,u)=>{if(Array.isArray(f)&&Array.isArray(u)){if(f.length!==u.length)return!1;for(let m=0;m<f.length;m++)if(f[m]!==u[m])return!1;return!0}return f===u},x=(f,u=!0)=>{if(b.filters&&b.filters[0]&&b.filters[1]&&b.filters[1].options){const m=b.filters[0].options,w=b.filters[1].options;f!=null?m.findIndex(_=>_.value===f)!==-1&&w[f]?(d.value=w[f],u&&!(()=>{const _=y.value[1];return _==null?!1:Array.isArray(_)?_.length>0:_!==""})()&&!l&&d.value.length>0&&(y.value[1]=d.value[0].value,t.nextTick(()=>{}))):(d.value=[],y.value[1]=null):(d.value=[],y.value[1]=null)}},v=()=>{if(b.initialValues&&b.initialValues.length>0){const u=b.initialValues.length>0&&(typeof b.initialValues[0]=="number"||typeof b.initialValues[0]=="boolean"||b.initialValues[0]===null||Array.isArray(b.initialValues[0]));console.log("StrengthsFilters initializeValues - isSimpleFormat:",u),u?(console.log("StrengthsFilters initializeValues - Usando formato simple, valores:",b.initialValues),y.value=[...b.initialValues]):b.isEditMode?y.value=b.filters.map((m,w)=>{var _,T,V,L,O,U,q,z,C,N;const E=b.initialValues[w];if(console.log(`StrengthsFilters initializeValues - filter[${w}]:`,m==null?void 0:m.type,"filterData:",E),!E)return console.log(`StrengthsFilters initializeValues - No hay filterData para índice ${w}, usando valor por defecto`),m.type==="select"?[]:m.type==="check"?!1:m.type==="radio-button"?((T=(_=m.options)==null?void 0:_[0])==null?void 0:T.value)||null:m.type==="select-simple"&&((L=(V=m.options)==null?void 0:V[0])==null?void 0:L.value)||null;if(m.type==="radio-button"&&E.selectedOption){console.log("StrengthsFilters initializeValues - filterData.selectedOption: ",E.selectedOption,"index:",w);const k=E.selectedOption.value;return console.log("StrengthsFilters initializeValues - selectedValue extraído:",k),k}else{if(m.type==="radio-button"&&!E.selectedOption)return console.log("StrengthsFilters initializeValues - filterData NO tiene selectedOption:",E,"index:",w),E.selectedValue!==void 0?(console.log("StrengthsFilters initializeValues - Usando selectedValue:",E.selectedValue),E.selectedValue):(console.log("StrengthsFilters initializeValues - Usando valor por defecto del filter"),((U=(O=m.options)==null?void 0:O[0])==null?void 0:U.value)||null);if(m.type==="select-simple"&&E.selectedValue!==void 0)return Array.isArray(E.selectedValue)?E.selectedValue[0]:E.selectedValue;if(m.type==="select"&&E.selectedOptions)return E.selectedOptions.map(k=>k.value);if(m.type==="check"&&E.isChecked!==void 0)return E.isChecked}return E.selectedValue!==void 0?E.selectedValue:m.type==="select"?[]:m.type==="check"?!1:m.type==="radio-button"?((z=(q=m.options)==null?void 0:q[0])==null?void 0:z.value)||null:m.type==="select-simple"&&((N=(C=m.options)==null?void 0:C[0])==null?void 0:N.value)||null}):y.value=[...b.initialValues]}else y.value=b.filters.map(u=>{var m,w,_,T;return u.type==="select"?[]:u.type==="check"?!1:u.type==="radio-button"?((w=(m=u.options)==null?void 0:m[0])==null?void 0:w.value)||null:u.type==="select-simple"&&((T=(_=u.options)==null?void 0:_[0])==null?void 0:T.value)||null});console.log("StrengthsFilters initializeValues - selectedValues.value final:",y.value);const f=y.value.some(u=>u!=null&&(Array.isArray(u)?u.length>0:u!==!1&&u!==""));console.log("StrengthsFilters initializeValues - hasValidValues:",f),f&&(c=[...y.value],R("filters-changed",{componentId:b.componentId,filters:y.value,timestamp:new Date().toISOString()}))};v(),setTimeout(()=>{t.nextTick(()=>{if(y.value[0]!==null&&y.value[0]!==void 0&&!l){const f=!(()=>{const u=y.value[1];return u==null?!1:Array.isArray(u)?u.length>0:u!==""})();x(y.value[0],f)}})},300),t.watch(()=>b.initialValues,(f,u)=>{if(!f||f.length===0)return;console.log("StrengthsFilters watch initialValues - newValues:",f),console.log("StrengthsFilters watch initialValues - oldValues:",u),console.log("StrengthsFilters watch initialValues - props.isEditMode:",b.isEditMode),console.log("StrengthsFilters watch initialValues - isUserInteracting:",l);const m=f.length>0&&(typeof f[0]=="number"||typeof f[0]=="boolean"||f[0]===null||Array.isArray(f[0]));console.log("StrengthsFilters watch initialValues - isSimpleFormat:",m);const w=!S(y.value,f),_=f&&f.length>0&&!l&&w,T=b.isEditMode&&l;console.log("StrengthsFilters watch initialValues - valuesAreDifferent:",w,"shouldUpdate:",_,"isEditModeProtection:",T),_&&!T?m?(console.log("StrengthsFilters watch initialValues - Usando formato simple, valores:",f),y.value=[...f]):b.isEditMode?y.value=b.filters.map((V,L)=>{const O=f[L];if(!O)return console.log("StrengthsFilters watch initialValues - No hay filterData para índice",L),y.value[L];if(V.type==="radio-button"&&O.selectedOption){console.log("StrengthsFilters watch initialValues - filterData.selectedOption: ",O.selectedOption,"index:",L);const U=O.selectedOption.value;return console.log("StrengthsFilters watch initialValues - selectedValue extraído:",U),U}else{if(V.type==="select-simple"&&O.selectedValue!==void 0)return Array.isArray(O.selectedValue)?O.selectedValue[0]:O.selectedValue;if(V.type==="select"&&O.selectedOptions)return O.selectedOptions.map(U=>U.value);if(V.type==="check"&&O.isChecked!==void 0)return O.isChecked}return O.selectedValue!==void 0?O.selectedValue:y.value[L]}):y.value=[...f]:l?a&&a.length>0&&(y.value=[...a]):T&&a&&a.length>0&&(y.value=[...a])},{deep:!0}),t.watch(()=>b.isEditMode,(f,u)=>{u===!0&&f===!1&&(a=null)},{immediate:!0}),t.watch(y,f=>{f.some(u=>u!=null&&(Array.isArray(u)?u.length>0:u!==!1&&u!==""))&&(()=>{if(!c)return!0;for(let u=0;u<f.length;u++)if(!S(f[u],c[u]))return!0;return!1})()&&(c=[...f],R("filters-changed",{componentId:b.componentId,filters:f,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),t.watch(()=>y.value[0],(f,u)=>{f!==u&&u!==void 0?x(f,!0):u===void 0&&f!==null&&f!==void 0&&x(f,!1)},{immediate:!0});const p=f=>{i.value===f?i.value=null:i.value=f},o=(f,u)=>{if(l=!0,setTimeout(()=>{l=!1},1e3),y.value[f]=u,(f===0||f===1)&&(a=[...y.value]),i.value=null,f===0){y.value[1]!==void 0&&(y.value[1]=null);const m=l;l=!1,x(u,!0),l=m,y.value[1]!==null&&y.value[1]!==void 0&&(a=[...y.value])}},s=()=>{l=!0,setTimeout(()=>{l=!1},400)};return r({getCurrentValues:()=>y.value,initializeValues:v}),(f,u)=>(t.openBlock(),t.createElementBlock("div",pke,[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,(m,w)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:w},[m.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",hke,[t.createElementVNode("div",fke,t.toDisplayString(m.label),1),t.createElementVNode("div",mke,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.options,_=>(t.openBlock(),t.createElementBlock("label",{key:_.value,class:t.normalizeClass(["radio-option-card",{active:y.value[w]===_.value}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"strengths-radio-"+w,value:_.value,"onUpdate:modelValue":T=>y.value[w]=T,onChange:s},null,40,yke),[[t.vModelRadio,y.value[w]]]),t.createElementVNode("span",null,t.toDisplayString(_.label),1)],2))),128))])])):m.type==="select-simple"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[u[4]||(u[4]=t.createElementVNode("div",{class:"filter-separator"},null,-1)),t.createElementVNode("div",gke,[u[3]||(u[3]=t.createElementVNode("div",{class:"radio-label"},"Mostrar: ",-1)),t.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":m.type,onClick:t.withModifiers(_=>p(w),["stop"])},[t.createElementVNode("div",bke,[u[1]||(u[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",xke,t.toDisplayString(m.label||"Tipo de análisis"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:i.value===w}])},[...u[0]||(u[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===w?(t.openBlock(),t.createElementBlock("div",wke,[t.createElementVNode("div",_ke,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.options,_=>(t.openBlock(),t.createElementBlock("div",{key:_.value,class:t.normalizeClass(["option-card simple-select-option",{active:S(y.value[w],_.value)}]),onClick:t.withModifiers(T=>o(w,_.value),["stop"])},[t.createElementVNode("div",Tke,[t.createElementVNode("div",kke,t.toDisplayString(_.label),1)]),S(y.value[w],_.value)?(t.openBlock(),t.createElementBlock("div",Nke,[...u[2]||(u[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,Ske))),128))])])):t.createCommentVNode("",!0)],8,vke)])],64)):t.createCommentVNode("",!0),w===1&&e.filters.length>2?(t.openBlock(),t.createElementBlock("div",Vke)):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0)]))}},Oke=pc(Lke,[["__scopeId","data-v-4c3876bd"]]),qke=(e,r)=>{const n=e.__vccOpts||e;for(const[b,R]of r)n[b]=R;return n},Cke={key:1},Uke={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},zke=["fill"],Eke={key:0,class:"checkbox__teams"},Pke={class:"checkbox__teams__logo"},Rke=["src"],Mke={class:"checkbox__teams__logo"},Fke=["src"],jke={__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(l=>({"7bd9d47b":e.width,"34dc7ddc":e.height}));const b=t.ref(!1),R=t.computed(()=>{const l={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 b.value?(l["background-color"]=n.boxBackgroundColor,l.border=`solid ${n.boxBorderWidth} ${n.boxBackgroundColor}`):l.border=`solid ${n.boxBorderWidth} ${n.boxBorderColor}`,l}),y=t.computed(()=>({"font-family":n.boxValueFontFamily,"font-size":n.boxValueFontSize,color:n.boxValueColor,"line-height":1})),c=t.computed(()=>{const l={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")&&(l[`margin-${n.boxPosition}`]=n.isBoxOnly?"0":n.teamsIds?"8px":"10px"),l});t.watch(()=>n.modelValue,l=>{l!==b.value&&(b.value=l)},{immediate:!0});function i(){n.avoidInteraction||!b.value&&n.avoidToCheck||(b.value=!b.value,r("update:modelValue",b.value))}function d(l){return`${{}.TEAM_LOGOS_URL||"https://golstatsimages.blob.core.windows.net/teams-80/"}${l}.png`}return(l,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["checkbox",`box-${e.boxPosition}`]),onClick:i},[t.createElementVNode("div",{class:"checkbox__box",style:t.normalizeStyle(R.value)},[b.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(y.value)},t.toDisplayString(e.boxValue),5)):(t.openBlock(),t.createElementBlock("div",Cke,[(t.openBlock(),t.createElementBlock("svg",Uke,[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,zke)]))]))],64)):t.createCommentVNode("",!0)],4),e.teamsIds&&e.teamsIds.length?(t.openBlock(),t.createElementBlock("div",Eke,[t.createElementVNode("div",Pke,[t.createElementVNode("img",{src:d(e.teamsIds[0]),alt:""},null,8,Rke)]),t.createElementVNode("div",Mke,[t.createElementVNode("img",{src:d(e.teamsIds[1]),alt:""},null,8,Fke)])])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"checkbox__label",style:t.normalizeStyle(c.value)},t.toDisplayString(e.label),5)],2))}},RL=qke(jke,[["__scopeId","data-v-b6f124d8"]]),Wke=(e,r)=>{const n=e.__vccOpts||e;for(const[b,R]of r)n[b]=R;return n},N_={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))}}},ML=()=>{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}))},FL=N_.setup;N_.setup=FL?(e,r)=>(ML(),FL(e,r)):ML;const Ake=e=>(t.pushScopeId("data-v-f3ee6b2b"),e=e(),t.popScopeId(),e),Kke=["src"],Ike={key:1,class:"text"},Xke=["src"],Dke={class:"stats"},Bke=Ake(()=>t.createElementVNode("img",{class:"iconstats",src:"https://golstatsimages.blob.core.windows.net/todoelfut/playdes.png"},null,-1)),Gke={class:"numstats"},Jke={class:"leyend"};function Zke(e,r,n,b,R,y){return t.openBlock(),t.createElementBlock("div",null,[n.type==0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["button",R.status&&n.typeOnOff&&"button-active"]),style:t.normalizeStyle([y.customStyle,R.status&&n.typeOnOff&&y.customActive]),onClick:r[0]||(r[0]=(...c)=>y.btnClick&&y.btnClick(...c))},[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,Kke)):t.createCommentVNode("",!0),n.textValue?(t.openBlock(),t.createElementBlock("div",Ike,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,Xke)):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]=(...c)=>y.btnClick&&y.btnClick(...c))},[t.createElementVNode("div",Dke,[Bke,t.createElementVNode("div",Gke,t.toDisplayString(n.textStat),1)]),t.createElementVNode("div",Jke,t.toDisplayString(n.textCategory),1)])):t.createCommentVNode("",!0)])}const Hke=Wke(N_,[["render",Zke],["__scopeId","data-v-f3ee6b2b"]]),Yke={class:"gsc-dropdown__main-container__item-selected"},Qke=["height","width"],$ke=["stroke"],eNe={key:1,width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tNe=["fill"],rNe={class:"gsc-dropdown__items-container"},aNe=["onClick"],nNe={key:0,class:"gsc-dropdown__items-footer"},h1={__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,b=t.ref({}),R=t.ref(null),y=t.ref(n.isMultipleOption?-1:0),c=t.ref(!1);t.watch(()=>n.items,(v,p)=>{if(!n.modelValue&&(!n.onlyFirstTime||!p||!p.length)&&v&&v.length){if(n.defaultItemByProp){const o=n.items.findIndex(s=>s[n.defaultItemByProp.propName]===n.defaultItemByProp.value);o!==-1?(y.value=o,b.value=v[o]):(y.value=0,b.value=v[0])}else b.value=v[n.defaultItemByIndex];r("input",b.value)}},{immediate:!0}),t.watch(()=>n.modelValue,v=>{if(v){const p=n.items.findIndex(o=>typeof v=="object"?JSON.stringify(o)===JSON.stringify(v):o===v);p!==-1&&(y.value=p,b.value=n.items[p],r("update:modelValue",b.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"})),d=t.computed(()=>({height:`${n.arrowHeight}px`,width:`${n.arrowWidth}px`}));function l(){n.isDisabled||(c.value=!c.value)}function a(v){R.value&&!R.value.contains(v.target)&&(c.value=!1)}function S(v,p){n.isMultipleOption?y.value=-1:(y.value=p,c.value=!1),b.value=v,r("input",b.value),r("update:modelValue",b.value)}function x(){c.value=!1,r("click-ready")}return t.onMounted(()=>{document.addEventListener("click",a)}),t.onBeforeMount(()=>{document.removeEventListener("click",a)}),(v,p)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"dropDown",ref:R,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:l},[t.createElementVNode("div",Yke,[t.renderSlot(v.$slots,"default",{selectedItem:b.value})]),t.createElementVNode("div",{class:t.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":c.value}]),style:t.normalizeStyle(d.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,$ke)],8,Qke)):(t.openBlock(),t.createElementBlock("svg",eNe,[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,tNe)]))],6)],4),t.createVNode(t.Transition,null,{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",rNe,[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,s)=>(t.openBlock(),t.createElementBlock("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["gsc-dropdown__items__item",{selected:s===y.value}]),key:s,onClick:f=>S(o,s)},[t.renderSlot(v.$slots,"availableItem",{item:o})],10,aNe)),[[t.vShow,!o.isHidden]])]))),256))],4),e.isFooterVisible?(t.openBlock(),t.createElementBlock("div",nNe,[t.createVNode(t.unref(Hke),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:x})])):t.createCommentVNode("",!0)])],512),[[t.vShow,c.value]])]),_:3})],4))}},V_={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},iNe=[{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"}}],oNe=[{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}}],sNe={class:"last-touch"},lNe={class:"selected-item"},cNe={class:"available-item"},uNe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dNe={class:"selected-item"},pNe={class:"available-item"},hNe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fNe={key:1},mNe={class:"selected-item"},yNe={class:"available-item"},gNe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},vNe={class:"last-touch__how-many-games"},bNe={class:"selected-item"},xNe={class:"available-item"},wNe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_Ne={__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,b=r,R=t.ref([{label:"Ofensivo",value:2,name:"offensive"},{label:"Defensivo",value:3,name:"defensive"}]),y=t.ref({id:0,name:"Fases de juego",value:null}),c=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}]),d=t.ref(n.defaultFilters?null:i.value[0]),l=t.ref(null),a=t.computed(()=>({...V_})),S=t.computed(()=>({...V_,isFooterVisible:!n.isEditMode,isMultipleOption:!n.isEditMode})),x=t.computed(()=>{const A=[];return v.value.options.forEach(X=>{X.forEach(D=>{A.push(D)})}),A}),v=t.ref(null),p=t.ref(null),o=t.ref(null),s=t.ref(null);t.watch(()=>n.viewConfig,A=>{A.filters&&(v.value||f(),p.value||u(),o.value||m(),s.value||V())},{immediate:!0});function f(){if(n.viewConfig&&n.viewConfig.filters){const A=n.viewConfig.filters.find(X=>X.key==="categories");A&&A.options&&(v.value={label:A.label,options:Object.entries(A.options).reduce((X,[D,Y])=>(X.set(Number(D),Y),X),new Map)})}v.value={label:"Tipo de jugada",options:new Map([[2,oNe],[3,iNe]])}}function u(){if(n.viewConfig&&n.viewConfig.filters){const A=n.viewConfig.filters.find(X=>X.key==="gamePhases");if(A){p.value={label:A.label,options:A.options};return}}p.value={label:"Fases de juego",options:R.value}}function m(){if(n.viewConfig&&n.viewConfig.filters){const A=n.viewConfig.filters.find(X=>X.key==="teamRadios");if(A){o.value={options:A.options},C(null,A.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}]},C(null,o.value.options[0])}const w=t.ref(n.defaultFilters?null:o.value.options[0]),_=t.ref(n.defaultFilters?null:p.value.options[0]),T=t.ref(n.defaultFilters?null:v.value.options.get(_.value.value)[0]);function V(){if(n.viewConfig&&n.viewConfig.filters){const A=n.viewConfig.filters.find(X=>X.key==="assistZoneCheckbox");if(A){s.value={label:A.label},N(A.value);return}}s.value={label:"Zona de asistencia"}}const L=t.computed(()=>{const A={selectedGamePhase:_.value,selectedTeam:w.value,isAssistZoneVisible:c.value,howManyGamesSelected:d.value};return n.isEditMode?(A.selectedCategory=T.value,A.totalCategoriesSelected=1):(A.selectedCategories=l.value,A.totalCategoriesSelected=0,v.value.options.forEach(X=>{X.forEach(D=>{D.isSelected&&(A.totalCategoriesSelected+=1)})})),A}),O=t.computed(()=>_.value?v.value.options.get(_.value.value)||[]:[]);t.watch(()=>L.value,A=>{U()&&(console.log("before emit change:",{areAllFiltersFilled:U(),filters:A,view:n.viewConfig}),b("change",{areAllFiltersFilled:U(),filters:A,view:n.viewConfig}))},{deep:!0});function U(){return _.value&&(n.isEditMode&&T.value||!n.isEditMode&&l.value&&l.value.length)&&w.value&&d.value}function q(A){_.value=A,k(null)}function z(A){w.value=A}function C(A,X){console.log("onChangeRadio:",X.value)}function N(A){c.value=A}function E(A){d.value=A}function k(A){T.value=A}function P(A,X){X.isSelected=A,l.value=x.value.filter(D=>D.isSelected)}function F(){n.defaultFilters&&(c.value=n.defaultFilters.isAssistZoneVisible,d.value=i.value.find(A=>A.value===n.defaultFilters.howManyGamesSelected.value)||i.value[0],_.value=p.value.options.find(A=>A.value===n.defaultFilters.selectedGamePhase.value)||p.value.options[0],w.value=o.value.options.find(A=>A.value===(n.defaultFilters.isHomeTeam?1:2))||o.value.options[0],T.value=v.value.options.get(_.value.value).find(A=>A.value.name===n.defaultFilters.selectedCategory.name)||v.value.options.get(_.value.value)[0])}function W(){O.value.forEach(A=>{A.isSelected=!1}),c.value=!1,d.value=i.value[0],_.value=null,w.value=null,T.value=null,l.value=null}return t.onBeforeUnmount(()=>{W()}),t.onMounted(()=>{setTimeout(()=>{F()},500)}),(A,X)=>(t.openBlock(),t.createElementBlock("div",sNe,[t.createVNode(t.unref(h1),t.mergeProps(a.value,{items:p.value.options,"model-value":_.value,"onUpdate:modelValue":q}),{default:t.withCtx(()=>[t.createElementVNode("div",lNe,[X[0]||(X[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(_.value?_.value.label:p.value.label||y.value.name),1)])]),availableItem:t.withCtx(({item:D})=>[t.createElementVNode("div",cNe,[t.createElementVNode("div",null,t.toDisplayString(D.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",uNe,[...X[1]||(X[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,_.value&&_.value.label===D.label]])])])]),_:1},16,["items","model-value"]),t.createVNode(t.unref(h1),t.mergeProps(S.value,{items:O.value,"model-value":T.value,"onUpdate:modelValue":k}),{default:t.withCtx(()=>[t.createElementVNode("div",dNe,[X[2]||(X[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(v.value.label),1)])]),availableItem:t.withCtx(({item:D})=>[t.createElementVNode("div",pNe,[e.isEditMode?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",null,t.toDisplayString(D.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",hNe,[...X[3]||(X[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,T.value&&T.value.label===D.label]])])],64)):(t.openBlock(),t.createElementBlock("div",fNe,[t.createVNode(t.unref(RL),{"model-value":D.isSelected,label:D.label,"onUpdate:modelValue":Y=>P(Y,D)},null,8,["model-value","label","onUpdate:modelValue"])]))])]),_:1},16,["items","model-value"]),t.createVNode(t.unref(h1),t.mergeProps(a.value,{items:o.value.options,"model-value":w.value,"onUpdate:modelValue":z}),{default:t.withCtx(()=>[t.createElementVNode("div",mNe,[X[4]||(X[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(w.value?w.value.label:o.value.label),1)])]),availableItem:t.withCtx(({item:D})=>[t.createElementVNode("div",yNe,[t.createElementVNode("div",null,t.toDisplayString(D.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",gNe,[...X[5]||(X[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,w.value&&w.value.label===D.label]])])])]),_:1},16,["items","model-value"]),t.createVNode(t.unref(RL),{"model-value":c.value,label:s.value.label,"onUpdate:modelValue":N},null,8,["model-value","label"]),t.withDirectives(t.createElementVNode("div",vNe,[t.createVNode(t.unref(h1),t.mergeProps(a.value,{items:i.value,"model-value":d.value,"onUpdate:modelValue":E}),{default:t.withCtx(()=>[t.createElementVNode("div",bNe,[X[6]||(X[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(d.value?d.value.name:"Seleccione"),1)])]),availableItem:t.withCtx(({item:D})=>[t.createElementVNode("div",xNe,[t.createElementVNode("div",null,t.toDisplayString(D.name),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",wNe,[...X[7]||(X[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,d.value&&d.value.name===D.name]])])])]),_:1},16,["items","model-value"])],512),[[t.vShow,!e.isPostMatch]])]))}},SNe=pc(_Ne,[["__scopeId","data-v-b006bd89"]]),TNe=(e,r)=>{const n=e.__vccOpts||e;for(const[b,R]of r)n[b]=R;return n},kNe={__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(v=>({"398d9242":e.width,f164e302:d.value,"4bb88040":e.menuWidth}));const b=t.ref(null),R=t.ref(!1),y=t.ref(null),c=t.ref({}),i=t.computed(()=>{const v={top:"0px","--left-menu":n.leftMenu};if(b.value){const p=b.value.getBoundingClientRect();v.top=`${p.height+n.menuMarginTop}px`}return v}),d=t.computed(()=>R.value?n.zIndexOpen:1);t.watch(()=>n.modelValue,v=>{v!==R.value&&(R.value=v)},{immediate:!0}),t.watch(R,v=>{v||setTimeout(()=>{c.value["--translate-x"]="0px"},500)});function l(v){const p=window.innerWidth,o=v.boundingClientRect.x,s=v.boundingClientRect.x+v.boundingClientRect.width,f=o<=0?Math.abs(o)+4:s>=p?p-(s+10):0;c.value["--translate-x"]=`${f}px`}function a(){new IntersectionObserver(v=>{v[0].intersectionRatio>0&&l(v[0])}).observe(y.value)}function S(){R.value=!R.value,r("update:modelValue",R.value)}function x(){R.value=!1,r("update:modelValue",R.value)}return t.onMounted(()=>{t.nextTick(()=>{a()})}),(v,p)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[R.value?(t.openBlock(),t.createElementBlock("div",{key:0,id:"menu-overlay",onClick:x})):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"menu-container",style:t.normalizeStyle(c.value)},[t.createElementVNode("div",{ref_key:"trigger",ref:b,class:"menu-container__trigger",onClick:S},[t.renderSlot(v.$slots,"trigger",{},void 0,!0)],512),t.createVNode(t.Transition,null,{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{ref_key:"menu",ref:y,class:"menu-container__menu",style:t.normalizeStyle(i.value)},[t.renderSlot(v.$slots,"menu",{},void 0,!0)],4),[[t.vShow,R.value]])]),_:3})],4)],64))}},NNe=TNe(kNe,[["__scopeId","data-v-18c0df61"]]),Su={CORNERS_ADVANCED:"cornersAdvanced"},VNe={key:0,class:"button__icon"},LNe={key:0,width:"19",height:"17",viewBox:"0 0 19 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ONe=["stroke"],qNe=["stroke"],CNe=["stroke"],UNe={key:1,width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},zNe=["stroke"],ENe=["stroke"],PNe=["fill"],RNe={key:2,width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},MNe=["fill"],FNe={key:3,width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},jNe=["stroke"],WNe=["stroke"],ANe=["stroke"],KNe=["stroke"],INe=["stroke"],XNe={key:4,width:"18",height:"17",viewBox:"0 0 18 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},DNe={key:5,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},BNe={key:6,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},GNe={key:7,width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},JNe={key:8,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ZNe={class:"button__text"},HNe={key:0,class:"info-container"},YNe={key:1,style:{width:"20px"}},QNe={width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$Ne=["fill"],eVe={__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})),b=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})),R=t.computed(()=>[Su.PLAYS_TYPES,Su.GOLSTATS,Su.TOURNAMENTS,Su.PLAYS,Su.RESULTS,Su.RESULTS_BY_TIME].includes(r.iconType)),y=t.computed(()=>[Su.FIELD,Su.GAMES].includes(r.iconType)),c=t.computed(()=>[Su.DETAILS,Su.UNIVERSE].includes(r.iconType)),i=t.computed(()=>[Su.PERSONAL_DATA].includes(r.iconType)),d=t.computed(()=>[Su.PRODUCTIVITY].includes(r.iconType)),l=t.computed(()=>(console.log("props.iconType",r.iconType),[Su.CORNERS_ADVANCED].includes(r.iconType))),a=t.computed(()=>[Su.HOW_WAS_CORNER].includes(r.iconType)),S=t.computed(()=>[Su.TAKEN_CORNERS].includes(r.iconType)),x=t.computed(()=>[Su.ZONE].includes(r.iconType)),v=t.computed(()=>[Su.WHAT_HAPPENED].includes(r.iconType));return(p,o)=>(t.openBlock(),t.createElementBlock("div",{class:"button",style:t.normalizeStyle(n.value)},[e.showIcon?(t.openBlock(),t.createElementBlock("div",VNe,[i.value?(t.openBlock(),t.createElementBlock("svg",LNe,[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,ONe),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,qNe),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,CNe)])):t.createCommentVNode("",!0),R.value||l.value?(t.openBlock(),t.createElementBlock("svg",UNe,[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,zNe),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,ENe),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,PNe)])):t.createCommentVNode("",!0),c.value?(t.openBlock(),t.createElementBlock("svg",RNe,[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,MNe)])):t.createCommentVNode("",!0),y.value?(t.openBlock(),t.createElementBlock("svg",FNe,[t.createElementVNode("rect",{x:"1.16772",y:"1.16699",width:"19",height:"15.6667",stroke:e.iconColor},null,8,jNe),t.createElementVNode("rect",{x:"16.1677",y:"6.16699",width:"4",height:"5.66667",stroke:e.iconColor},null,8,WNe),t.createElementVNode("rect",{x:"1.16772",y:"6.16699",width:"4",height:"5.66667",stroke:e.iconColor},null,8,ANe),t.createElementVNode("path",{d:"M10.6677 0.666992V16.5003",stroke:e.iconColor},null,8,KNe),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,INe)])):t.createCommentVNode("",!0),d.value?(t.openBlock(),t.createElementBlock("svg",XNe,[...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),S.value?(t.openBlock(),t.createElementBlock("svg",DNe,[...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",BNe,[...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),x.value?(t.openBlock(),t.createElementBlock("svg",GNe,[...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),v.value?(t.openBlock(),t.createElementBlock("svg",JNe,[...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",ZNe,t.toDisplayString(e.text),1),e.showBadge?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.showBadgeOnFilterFull?(t.openBlock(),t.createElementBlock("div",HNe,[t.createElementVNode("div",{class:"button__info",style:t.normalizeStyle(b.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(b.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",YNe)):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",QNe,[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,$Ne)]))],2)],4))}},tVe=pc(eVe,[["__scopeId","data-v-2df3c6a9"]]),rVe={__name:"SwitchCustom",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:r}){const n=e,b=r,R=t.ref(null);t.watch(()=>n.modelValue,()=>{y()},{immediate:!0});function y(){R.value&&(R.value.checked=n.modelValue)}function c(i){b("update:modelValue",i.target.checked)}return t.onMounted(()=>{y()}),(i,d)=>(t.openBlock(),t.createElementBlock("input",{ref_key:"switchCustom",ref:R,id:"toggle",class:"toggle",type:"checkbox",role:"switch",name:"toggle",onInput:c},null,544))}},L_=pc(rVe,[["__scopeId","data-v-e3a6ae4e"]]),aVe={class:"corners"},nVe={class:"corners-type"},iVe={class:"selected-item"},oVe={class:"available-item"},sVe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lVe={class:"advanced-filters-menu"},cVe={class:"toggle-group"},uVe={class:"toggle-group"},dVe={key:0,class:"time-control"},pVe={class:"stepper-container"},hVe={class:"stepper"},fVe={class:"stepper-value"},mVe={class:"time-control"},yVe={class:"stepper-container"},gVe={class:"stepper"},vVe={class:"stepper-value"},bVe={class:"time-control"},xVe={class:"stepper-container"},wVe={class:"stepper"},_Ve={class:"stepper-value"},SVe={class:"corners__how-many-games"},TVe={class:"selected-item"},kVe={class:"available-item"},NVe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},VVe={__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 b=Array.from({length:10}).map((V,L)=>({id:L+1,name:`${L+1} ${L===0?"corner":"corners"}`,value:L+1})),R=e,y=r,c=t.ref([...b]),i=t.ref(c.value[0]),d=t.ref(s()),l=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:R.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]}),S=t.ref(!1),x=t.ref(R.defaultFilters?R.defaultFilters.isAgainstMode:!1),v=t.ref(R.defaultFilters?null:(n=a.value)==null?void 0:n.options[0]),p=t.computed(()=>({...V_}));t.watch(()=>R.viewConfig,V=>{V.filters&&(a.value||f())},{immediate:!0});const o=t.computed(()=>({isAgainstMode:x.value,selectedTeam:v.value,howManyCorners:i.value?i.value.value:null,advancedFilters:{...d.value}}));t.watch(()=>o.value,V=>{console.log("before emit change",V),console.log("props.viewConfig",R.viewConfig),y("change",{filters:{...V,advancedFilters:{...V.advancedFilters,areConnectionsVisible:!V.advancedFilters.areConnectionsVisible,arePathsVisible:!V.advancedFilters.arePathsVisible}},view:R.viewConfig})},{deep:!0,immediate:!0});function s(){return{areConnectionsVisible:!0,arePathsVisible:!0,secondsBefore:-1,secondsAfter:0,secondsBeforeAndAfter:0}}function f(){if(R.viewConfig&&R.viewConfig.filters){const V=R.viewConfig.filters.find(L=>L.key==="teamRadios");if(V){a.value={options:V.options};return}}a.value={label:"Equipo",options:R.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]}}function u(){console.log("setDefaultValues called with props.defaultFilters:",R.defaultFilters),R.defaultFilters&&(v.value=a.value.options.find(V=>V.value===(R.defaultFilters.isHomeTeam?1:2))||a.value.options[0],d.value={...R.defaultFilters.advancedFilters,areConnectionsVisible:!R.defaultFilters.advancedFilters.areConnectionsVisible,arePathsVisible:!R.defaultFilters.advancedFilters.arePathsVisible})}function m(V){v.value=V}function w(V){i.value=V}function _(V,L){d.value[L]+=V}function T(){S.value=!1}return t.onBeforeUnmount(()=>{}),t.onMounted(()=>{setTimeout(()=>{u()},500)}),(V,L)=>(t.openBlock(),t.createElementBlock("div",aVe,[t.withDirectives(t.createElementVNode("div",nVe,[t.createElementVNode("div",{class:t.normalizeClass(["label",{"switch-selected":!x.value}])}," A favor ",2),t.createVNode(L_,{modelValue:x.value,"onUpdate:modelValue":L[0]||(L[0]=O=>x.value=O)},null,8,["modelValue"]),t.createElementVNode("div",{class:t.normalizeClass(["label",{"switch-selected":x.value}])}," En contra ",2)],512),[[t.vShow,!e.isPostMatch]]),t.createVNode(t.unref(h1),t.mergeProps(p.value,{items:a.value.options,"model-value":v.value,"onUpdate:modelValue":m}),{default:t.withCtx(()=>[t.createElementVNode("div",iVe,[L[10]||(L[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(v.value?v.value.label:a.value.label),1)])]),availableItem:t.withCtx(({item:O})=>[t.createElementVNode("div",oVe,[t.createElementVNode("div",null,t.toDisplayString(O.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",sVe,[...L[11]||(L[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,v.value&&v.value.label===O.label]])])])]),_:1},16,["items","model-value"]),t.createVNode(t.unref(NNe),{modelValue:S.value,"onUpdate:modelValue":L[9]||(L[9]=O=>S.value=O),width:"250px","left-menu":"0","menu-margin-top":18},{trigger:t.withCtx(()=>[t.createVNode(tVe,t.mergeProps(l.value,{text:"Filtros avanzados","show-badge-on-filter-full":!1,"filters-total":0,"is-active":S.value,"show-icon":!0,"icon-type":t.unref(Su).CORNERS_ADVANCED}),null,16,["is-active","icon-type"])]),menu:t.withCtx(()=>[t.createElementVNode("div",lVe,[L[22]||(L[22]=t.createElementVNode("h2",{class:"menu-title"},"Mostrar Conexiones",-1)),t.createElementVNode("div",cVe,[L[12]||(L[12]=t.createElementVNode("label",{class:"toggle-label"},"Sí",-1)),t.createVNode(L_,{modelValue:d.value.areConnectionsVisible,"onUpdate:modelValue":L[1]||(L[1]=O=>d.value.areConnectionsVisible=O)},null,8,["modelValue"]),L[13]||(L[13]=t.createElementVNode("label",{class:"toggle-label"},"No",-1))]),L[23]||(L[23]=t.createElementVNode("hr",{class:"separator"},null,-1)),L[24]||(L[24]=t.createElementVNode("h2",{class:"menu-title"},"Mostrar recorridos",-1)),t.createElementVNode("div",uVe,[L[14]||(L[14]=t.createElementVNode("label",{class:"toggle-label"},"Sí",-1)),t.createVNode(L_,{modelValue:d.value.arePathsVisible,"onUpdate:modelValue":L[2]||(L[2]=O=>d.value.arePathsVisible=O)},null,8,["modelValue"]),L[15]||(L[15]=t.createElementVNode("label",{class:"toggle-label"},"No",-1))]),d.value.arePathsVisible?(t.openBlock(),t.createElementBlock("div",dVe,[L[17]||(L[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",pVe,[t.createElementVNode("div",hVe,[t.createElementVNode("button",{class:"stepper-btn",onClick:L[3]||(L[3]=O=>_(-1,"secondsBeforeAndAfter"))},"−"),t.createElementVNode("span",fVe,t.toDisplayString(d.value.secondsBeforeAndAfter),1),t.createElementVNode("button",{class:"stepper-btn",onClick:L[4]||(L[4]=O=>_(1,"secondsBeforeAndAfter"))},"+")]),L[16]||(L[16]=t.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("div",mVe,[L[19]||(L[19]=t.createElementVNode("label",{class:"time-label"},[t.createTextVNode(" Segundos "),t.createElementVNode("span",{class:"highlight"},"antes"),t.createTextVNode(" del cobro: ")],-1)),t.createElementVNode("div",yVe,[t.createElementVNode("div",gVe,[t.createElementVNode("button",{class:"stepper-btn",onClick:L[5]||(L[5]=O=>_(-1,"secondsBefore"))},"−"),t.createElementVNode("span",vVe,t.toDisplayString(d.value.secondsBefore),1),t.createElementVNode("button",{class:"stepper-btn",onClick:L[6]||(L[6]=O=>_(1,"secondsBefore"))},"+")]),L[18]||(L[18]=t.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])]),t.createElementVNode("div",bVe,[L[21]||(L[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",xVe,[t.createElementVNode("div",wVe,[t.createElementVNode("button",{class:"stepper-btn",onClick:L[7]||(L[7]=O=>_(-1,"secondsAfter"))},"−"),t.createElementVNode("span",_Ve,t.toDisplayString(d.value.secondsAfter),1),t.createElementVNode("button",{class:"stepper-btn",onClick:L[8]||(L[8]=O=>_(1,"secondsAfter"))},"+")]),L[20]||(L[20]=t.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])])],64)),L[25]||(L[25]=t.createElementVNode("hr",{class:"separator"},null,-1)),t.createElementVNode("button",{class:"btn-ready",onClick:T},"Listo")])]),_:1},8,["modelValue"]),t.withDirectives(t.createElementVNode("div",SVe,[t.createVNode(t.unref(h1),t.mergeProps(p.value,{items:c.value,"model-value":i.value,"onUpdate:modelValue":w}),{default:t.withCtx(()=>[t.createElementVNode("div",TVe,[L[26]||(L[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:O})=>[t.createElementVNode("div",kVe,[t.createElementVNode("div",null,t.toDisplayString(O.name),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",NVe,[...L[27]||(L[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===O.name]])])])]),_:1},16,["items","model-value"])],512),[[t.vShow,!e.defaultFilters]])]))}},LVe=pc(VVe,[["__scopeId","data-v-d3233b73"]]),OVe={class:"resultados-filter"},qVe={class:"filter-checkboxes"},CVe=["checked","onChange"],UVe={class:"checkbox-label"},zVe={class:"filter-actions"},EVe={__name:"ResultadosFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:r}){const n=e,b=r,R=t.computed(()=>n.option.filters||[{label:"Iba ganando",value:"winning"},{label:"Iba perdiendo",value:"losing"},{label:"Iba empatado",value:"tied"}]),y=t.computed(()=>{const a=n.selectedValues[n.filterIndex];return!a||!a[n.optionIndex]?[]:Array.isArray(a[n.optionIndex])?a[n.optionIndex]:[]}),c=a=>y.value.includes(a),i=(a,S)=>{let x=[...y.value];S?x.includes(a)||x.push(a):x=x.filter(v=>v!==a),b("update-selection",{optionIndex:n.optionIndex,values:x})},d=()=>{b("update-selection",{optionIndex:n.optionIndex,values:[]})},l=()=>{};return(a,S)=>(t.openBlock(),t.createElementBlock("div",OVe,[t.createElementVNode("div",qVe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R.value,x=>(t.openBlock(),t.createElementBlock("label",{key:x.value,class:"checkbox-item"},[t.createElementVNode("input",{type:"checkbox",checked:c(x.value),onChange:t.withModifiers(v=>i(x.value,v.target.checked),["stop"])},null,40,CVe),t.createElementVNode("span",UVe,t.toDisplayString(x.label),1)]))),128))]),t.createElementVNode("div",zVe,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(d,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(l,["stop"])}," Listo ")])]))}},$b=pc(EVe,[["__scopeId","data-v-1fba7a5d"]]),PVe={class:"detalles-filter"},RVe={class:"filter-checkboxes"},MVe=["checked","onChange"],FVe={class:"checkbox-label"},jVe={class:"filter-actions"},WVe={__name:"DetallesFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:r}){const n=e,b=r,R=t.computed(()=>n.option.filters||[]),y=t.computed(()=>{const a=n.selectedValues[n.filterIndex];return!a||!a[n.optionIndex]?[]:Array.isArray(a[n.optionIndex])?a[n.optionIndex]:[]}),c=a=>y.value.includes(a),i=(a,S)=>{let x=[...y.value];S?x.includes(a)||x.push(a):x=x.filter(v=>v!==a),b("update-selection",{optionIndex:n.optionIndex,values:x})},d=()=>{b("update-selection",{optionIndex:n.optionIndex,values:[]})},l=()=>{};return(a,S)=>(t.openBlock(),t.createElementBlock("div",PVe,[t.createElementVNode("div",RVe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R.value,x=>(t.openBlock(),t.createElementBlock("label",{key:x.value,class:"checkbox-item"},[t.createElementVNode("input",{type:"checkbox",checked:c(x.value),onChange:t.withModifiers(v=>i(x.value,v.target.checked),["stop"])},null,40,MVe),t.createElementVNode("span",FVe,t.toDisplayString(x.label),1)]))),128))]),t.createElementVNode("div",jVe,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(d,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(l,["stop"])}," Listo ")])]))}},O_=pc(WVe,[["__scopeId","data-v-175921a6"]]),AVe={class:"como-fue-cobrado-filter"},KVe={class:"filter-checkboxes"},IVe=["checked","onChange"],XVe={class:"checkbox-label"},DVe={class:"filter-actions"},BVe={__name:"ComoFueCobradoFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:r}){const n=e,b=r,R=t.computed(()=>n.option.filters||[]),y=t.computed(()=>{const a=n.selectedValues[n.filterIndex];return!a||!a[n.optionIndex]?[]:Array.isArray(a[n.optionIndex])?a[n.optionIndex]:[]}),c=a=>y.value.includes(a),i=(a,S)=>{let x=[...y.value];S?x.includes(a)||x.push(a):x=x.filter(v=>v!==a),b("update-selection",{optionIndex:n.optionIndex,values:x})},d=()=>{b("update-selection",{optionIndex:n.optionIndex,values:[]})},l=()=>{};return(a,S)=>(t.openBlock(),t.createElementBlock("div",AVe,[t.createElementVNode("div",KVe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R.value,x=>(t.openBlock(),t.createElementBlock("label",{key:x.value,class:"checkbox-item"},[t.createElementVNode("input",{type:"checkbox",checked:c(x.value),onChange:t.withModifiers(v=>i(x.value,v.target.checked),["stop"])},null,40,IVe),t.createElementVNode("span",XVe,t.toDisplayString(x.label),1)]))),128))]),t.createElementVNode("div",DVe,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(d,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(l,["stop"])}," Listo ")])]))}},ex=pc(BVe,[["__scopeId","data-v-905a2961"]]),GVe={class:"zona-filter"},JVe={class:"filter-checkboxes"},ZVe=["checked","onChange"],HVe={class:"checkbox-label"},YVe={class:"filter-actions"},QVe={__name:"ZonaFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:r}){const n=e,b=r,R=t.computed(()=>n.option.filters||[]),y=t.computed(()=>{const a=n.selectedValues[n.filterIndex];return!a||!a[n.optionIndex]?[]:Array.isArray(a[n.optionIndex])?a[n.optionIndex]:[]}),c=a=>y.value.includes(a),i=(a,S)=>{let x=[...y.value];S?x.includes(a)||x.push(a):x=x.filter(v=>v!==a),b("update-selection",{optionIndex:n.optionIndex,values:x})},d=()=>{b("update-selection",{optionIndex:n.optionIndex,values:[]})},l=()=>{};return(a,S)=>(t.openBlock(),t.createElementBlock("div",GVe,[t.createElementVNode("div",JVe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R.value,x=>(t.openBlock(),t.createElementBlock("label",{key:x.value,class:"checkbox-item"},[t.createElementVNode("input",{type:"checkbox",checked:c(x.value),onChange:t.withModifiers(v=>i(x.value,v.target.checked),["stop"])},null,40,ZVe),t.createElementVNode("span",HVe,t.toDisplayString(x.label),1)]))),128))]),t.createElementVNode("div",YVe,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(d,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(l,["stop"])}," Listo ")])]))}},q_=pc(QVe,[["__scopeId","data-v-6fb0c545"]]),$Ve={class:"que-sucedio-filter"},eLe={class:"filter-checkboxes"},tLe=["checked","onChange"],rLe={class:"checkbox-label"},aLe={class:"filter-actions"},nLe={__name:"QueSucedioFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:r}){const n=e,b=r,R=t.computed(()=>n.option.filters||[]),y=t.computed(()=>{const a=n.selectedValues[n.filterIndex];return!a||!a[n.optionIndex]?[]:Array.isArray(a[n.optionIndex])?a[n.optionIndex]:[]}),c=a=>y.value.includes(a),i=(a,S)=>{let x=[...y.value];S?x.includes(a)||x.push(a):x=x.filter(v=>v!==a),b("update-selection",{optionIndex:n.optionIndex,values:x})},d=()=>{b("update-selection",{optionIndex:n.optionIndex,values:[]})},l=()=>{};return(a,S)=>(t.openBlock(),t.createElementBlock("div",$Ve,[t.createElementVNode("div",eLe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R.value,x=>(t.openBlock(),t.createElementBlock("label",{key:x.value,class:"checkbox-item"},[t.createElementVNode("input",{type:"checkbox",checked:c(x.value),onChange:t.withModifiers(v=>i(x.value,v.target.checked),["stop"])},null,40,tLe),t.createElementVNode("span",rLe,t.toDisplayString(x.label),1)]))),128))]),t.createElementVNode("div",aLe,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(d,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(l,["stop"])}," Listo ")])]))}},pg=pc(nLe,[["__scopeId","data-v-ecc3baf0"]]),iLe={class:"advanced-select-accordion"},oLe=["onClick"],sLe={class:"accordion-header-left"},lLe={class:"accordion-icon"},cLe=["src","alt"],uLe={class:"accordion-title"},dLe={class:"accordion-header-right"},pLe={key:0,class:"accordion-badge"},hLe={key:0,class:"accordion-content"},fLe={class:"accordion-footer"},mLe={__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,b=r,R=t.ref({}),y=S=>{R.value[S]?R.value[S]=!1:(Object.keys(R.value).forEach(x=>{R.value[x]=!1}),R.value[S]=!0)},c=S=>{const x=n.filter.options[S];if(!x||!x.filters)return 0;const v=n.selectedValues[n.filterIndex];if(!v||!v[S])return 0;const p=v[S];return Array.isArray(p)?p.length:0},i=(S,x)=>S.icon?S.icon:`https://golstatsimages.blob.core.windows.net/todoelfut/f${x+1}.png`,d=S=>{const x={resultados:$b,detalles:O_,"como-fue-cobrado":ex,"como fue cobrado":ex,zona:q_,"que-sucedio":pg,"qué sucedió":pg,"que sucedio":pg},v=typeof S.value=="string"?S.value:String(S.value||""),p=typeof S.label=="string"?S.label:String(S.label||""),o=v.toLowerCase().trim(),s=p.toLowerCase().trim();if(o&&x[o])return x[o];if(s&&x[s])return x[s];const f=s.replace(/\s+/g,"-").replace(/[¿?]/g,"").replace(/[áéíóú]/g,u=>({á:"a",é:"e",í:"i",ó:"o",ú:"u"})[u]||u);return f&&x[f]?x[f]:$b},l=S=>{b("update-selection",{filterIndex:n.filterIndex,optionIndex:S.optionIndex,values:S.values})},a=()=>{b("close")};return(S,x)=>(t.openBlock(),t.createElementBlock("div",iLe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filter.options,(v,p)=>(t.openBlock(),t.createElementBlock("div",{key:v.value||p,class:"accordion-item"},[t.createElementVNode("div",{class:"accordion-header",onClick:t.withModifiers(o=>y(p),["stop"])},[t.createElementVNode("div",sLe,[t.createElementVNode("span",lLe,[t.createElementVNode("img",{src:i(v,p),alt:v.label},null,8,cLe)]),t.createElementVNode("span",uLe,t.toDisplayString(v.label),1)]),t.createElementVNode("div",dLe,[c(p)>0?(t.openBlock(),t.createElementBlock("span",pLe,t.toDisplayString(c(p)),1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass(["accordion-chevron",{open:R.value[p]}])},[...x[0]||(x[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,oLe),t.createVNode(t.Transition,{name:"accordion"},{default:t.withCtx(()=>[R.value[p]?(t.openBlock(),t.createElementBlock("div",hLe,[d(v)===$b?(t.openBlock(),t.createBlock($b,{key:0,option:v,"filter-index":e.filterIndex,"option-index":p,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):d(v)===O_?(t.openBlock(),t.createBlock(O_,{key:1,option:v,"filter-index":e.filterIndex,"option-index":p,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):d(v)===ex?(t.openBlock(),t.createBlock(ex,{key:2,option:v,"filter-index":e.filterIndex,"option-index":p,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):d(v)===q_?(t.openBlock(),t.createBlock(q_,{key:3,option:v,"filter-index":e.filterIndex,"option-index":p,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):d(v)===pg?(t.openBlock(),t.createBlock(pg,{key:4,option:v,"filter-index":e.filterIndex,"option-index":p,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)]),_:2},1024)]))),128)),t.createElementVNode("div",fLe,[x[1]||(x[1]=t.createElementVNode("div",{class:"footer-separator"},null,-1)),t.createElementVNode("button",{class:"btn-done-footer",onClick:t.withModifiers(a,["stop"])}," Listo ")])]))}},yLe=pc(mLe,[["__scopeId","data-v-941aab18"]]),gLe={class:"corners-zone-filters"},vLe={key:0,class:"custom-radio-group"},bLe={class:"radio-label"},xLe={class:"radio-options"},wLe=["name","value","onUpdate:modelValue"],_Le={key:0,class:"filter-separator"},SLe={class:"filter-inline select-with-label"},TLe=["data-filter-type","onClick"],kLe={class:"select-display"},NLe={class:"select-label"},VLe={key:0,class:"dropdown-menu type-menu simple-select-menu"},LLe={class:"simple-select-scroll-area"},OLe=["onClick"],qLe={class:"option-content"},CLe={class:"option-title"},ULe={key:0,class:"option-checkmark"},zLe={class:"switch-group"},ELe={class:"switch-label"},PLe={key:0,class:"switch-text switch-text-left"},RLe=["onClick"],MLe={key:1,class:"switch-text switch-text-right"},FLe={key:0,class:"filter-separator"},jLe={key:3,class:"filter-inline advanced-select-wrapper"},WLe=["data-filter-type","onClick"],ALe={class:"select-display"},KLe={class:"select-label"},ILe={key:0,class:"dropdown-menu type-menu advanced-select-menu"},XLe={class:"advanced-select-content"},DLe={__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 b=e,R=n,y=t.ref([]);let c=null;const i=t.ref(null),d=t.ref(null),l=t.ref([]);let a=!1,S=null;const x=(O,U)=>{if(Array.isArray(O)&&Array.isArray(U)){if(O.length!==U.length)return!1;for(let q=0;q<O.length;q++)if(O[q]!==U[q])return!1;return!0}return O===U},v=(O,U=!0)=>{if(b.filters&&b.filters[0]&&b.filters[1]&&b.filters[1].options){const q=b.filters[0].options,z=b.filters[1].options;O!=null?q.findIndex(C=>C.value===O)!==-1&&z[O]?(l.value=z[O],U&&!(()=>{const C=y.value[1];return C==null?!1:Array.isArray(C)?C.length>0:C!==""})()&&!a&&l.value.length>0&&(y.value[1]=l.value[0].value,t.nextTick(()=>{}))):(l.value=[],y.value[1]=null):(l.value=[],y.value[1]=null)}},p=()=>{b.initialValues&&b.initialValues.length>0?b.initialValues.length>0&&(typeof b.initialValues[0]=="number"||typeof b.initialValues[0]=="boolean"||b.initialValues[0]===null||Array.isArray(b.initialValues[0]))?y.value=[...b.initialValues]:b.isEditMode?y.value=b.filters.map((O,U)=>{var q,z,C,N,E,k,P,F,W,A;const X=b.initialValues[U];return X?O.type==="radio-button"&&X.selectedOption?X.selectedOption.value:O.type==="radio-button"&&!X.selectedOption?X.selectedValue!==void 0?X.selectedValue:((k=(E=O.options)==null?void 0:E[0])==null?void 0:k.value)||null:O.type==="select-simple"&&X.selectedValue!==void 0?Array.isArray(X.selectedValue)?X.selectedValue[0]:X.selectedValue:O.type==="select"&&X.selectedOptions?X.selectedOptions.map(D=>D.value):O.type==="check"&&X.isChecked!==void 0?X.isChecked:X.selectedValue!==void 0?X.selectedValue:O.type==="select"?[]:O.type==="check"||O.type==="switch"?!1:O.type==="radio-button"?((F=(P=O.options)==null?void 0:P[0])==null?void 0:F.value)||null:O.type==="select-simple"?((A=(W=O.options)==null?void 0:W[0])==null?void 0:A.value)||null:O.type==="advanced-select"?{}:null:O.type==="select"?[]:O.type==="check"||O.type==="switch"?!1:O.type==="radio-button"?((z=(q=O.options)==null?void 0:q[0])==null?void 0:z.value)||null:O.type==="select-simple"&&((N=(C=O.options)==null?void 0:C[0])==null?void 0:N.value)||null}):y.value=[...b.initialValues]:y.value=b.filters.map(O=>{var U,q,z,C;return O.type==="select"?[]:O.type==="check"||O.type==="switch"?!1:O.type==="radio-button"?((q=(U=O.options)==null?void 0:U[0])==null?void 0:q.value)||null:O.type==="select-simple"?((C=(z=O.options)==null?void 0:z[0])==null?void 0:C.value)||null:O.type==="advanced-select"?{}:null}),y.value.some(O=>O!=null&&(Array.isArray(O)?O.length>0:typeof O=="object"&&!Array.isArray(O)?Object.keys(O).length>0:O!==!1&&O!==""))&&(c=[...y.value],R("filters-changed",{componentId:b.componentId,filters:y.value,timestamp:new Date().toISOString()}))};p(),setTimeout(()=>{t.nextTick(()=>{if(y.value[0]!==null&&y.value[0]!==void 0&&!a){const O=!(()=>{const U=y.value[1];return U==null?!1:Array.isArray(U)?U.length>0:U!==""})();v(y.value[0],O)}})},300),t.watch(()=>b.initialValues,O=>{if(!O||O.length===0)return;const U=O.length>0&&(typeof O[0]=="number"||typeof O[0]=="boolean"||O[0]===null||Array.isArray(O[0])),q=!x(y.value,O),z=O&&O.length>0&&!a&&q,C=b.isEditMode&&a;z&&!C?U?y.value=[...O]:b.isEditMode?y.value=b.filters.map((N,E)=>{const k=O[E];return k?N.type==="radio-button"&&k.selectedOption?k.selectedOption.value:N.type==="select-simple"&&k.selectedValue!==void 0?Array.isArray(k.selectedValue)?k.selectedValue[0]:k.selectedValue:N.type==="select"&&k.selectedOptions?k.selectedOptions.map(P=>P.value):N.type==="check"&&k.isChecked!==void 0||N.type==="switch"&&k.isChecked!==void 0?k.isChecked:N.type==="switch"&&k.selectedValue!==void 0||N.type==="advanced-select"&&k.selectedValue!==void 0||k.selectedValue!==void 0?k.selectedValue:y.value[E]:y.value[E]}):y.value=[...O]:a?S&&S.length>0&&(y.value=[...S]):C&&S&&S.length>0&&(y.value=[...S])},{deep:!0}),t.watch(()=>b.isEditMode,(O,U)=>{U===!0&&O===!1&&(S=null)},{immediate:!0}),t.watch(y,O=>{O.some(U=>U!=null&&(Array.isArray(U)?U.length>0:typeof U=="object"&&!Array.isArray(U)?Object.keys(U).length>0:U!==!1&&U!==""))&&(()=>{if(!c)return!0;for(let U=0;U<O.length;U++)if(!x(O[U],c[U]))return!0;return!1})()&&(c=[...O],R("filters-changed",{componentId:b.componentId,filters:O,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),t.watch(()=>y.value[0],(O,U)=>{O!==U&&U!==void 0?v(O,!0):U===void 0&&O!==null&&O!==void 0&&v(O,!1)},{immediate:!0});const o=O=>{i.value===O?i.value=null:(i.value=O,d.value=null)},s=O=>{d.value===O?d.value=null:(d.value=O,i.value=null)},f=(O,U)=>{if(a=!0,setTimeout(()=>{a=!1},1e3),y.value[O]=U,(O===0||O===1)&&(S=[...y.value]),i.value=null,O===0){y.value[1]!==void 0&&(y.value[1]=null);const q=a;a=!1,v(U,!0),a=q,y.value[1]!==null&&y.value[1]!==void 0&&(S=[...y.value])}},u=()=>{a=!0,setTimeout(()=>{a=!1},400)},m=O=>{a=!0,setTimeout(()=>{a=!1},400),y.value[O]=!y.value[O]},w=O=>{a=!0,setTimeout(()=>{a=!1},400),y.value[O.filterIndex]||(y.value[O.filterIndex]={}),y.value[O.filterIndex][O.optionIndex]=O.values},_=()=>y.value,T=(O,U)=>{const q=y.value[U];if(q==null)return null;if(U===1&&l.value.length>0){const z=l.value.find(C=>C.value===q);return z?z.label:null}if(O.options&&Array.isArray(O.options)){const z=O.options.find(C=>C.value===q);return z?z.label:null}return null},V=(O,U)=>{const q=y.value[U];if(!q||typeof q!="object"||Array.isArray(q))return null;const z=Object.values(q).reduce((C,N)=>Array.isArray(N)&&N.length>0?C+N.length:C,0);return z>0?`${z} seleccionado${z>1?"s":""}`:null},L=O=>{const U=O.target,q=U.closest(".advanced-select-dropdown"),z=U.closest(".custom-select.dynamic-select");!q&&!z&&(d.value=null,i.value=null)};return t.onMounted(()=>{document.addEventListener("click",L)}),t.onUnmounted(()=>{document.removeEventListener("click",L)}),r({getCurrentValues:_,initializeValues:p}),(O,U)=>(t.openBlock(),t.createElementBlock("div",gLe,[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,(q,z)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:z},[q.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",vLe,[t.createElementVNode("div",bLe,t.toDisplayString(q.label),1),t.createElementVNode("div",xLe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(q.options,C=>(t.openBlock(),t.createElementBlock("label",{key:C.value,class:t.normalizeClass(["radio-option-card",{active:y.value[z]===C.value}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"corners-zone-radio-"+z,value:C.value,"onUpdate:modelValue":N=>y.value[z]=N,onChange:u},null,40,wLe),[[t.vModelRadio,y.value[z]]]),t.createElementVNode("span",null,t.toDisplayString(C.label),1)],2))),128))])])):q.type==="select-simple"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[z==2?(t.openBlock(),t.createElementBlock("div",_Le)):t.createCommentVNode("",!0),t.createElementVNode("div",SLe,[t.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":q.type,onClick:t.withModifiers(C=>o(z),["stop"])},[t.createElementVNode("div",kLe,[U[1]||(U[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",NLe,t.toDisplayString(T(q,z)||q.label_2||q.label||"Tipo de análisis"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:i.value===z}])},[...U[0]||(U[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===z?(t.openBlock(),t.createElementBlock("div",VLe,[t.createElementVNode("div",LLe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(z===1?l.value:q.options,C=>(t.openBlock(),t.createElementBlock("div",{key:C.value,class:t.normalizeClass(["option-card simple-select-option",{active:x(y.value[z],C.value)}]),onClick:t.withModifiers(N=>f(z,C.value),["stop"])},[t.createElementVNode("div",qLe,[t.createElementVNode("div",CLe,t.toDisplayString(C.label),1)]),x(y.value[z],C.value)?(t.openBlock(),t.createElementBlock("div",ULe,[...U[2]||(U[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,OLe))),128))])])):t.createCommentVNode("",!0)],8,TLe)])],64)):q.type==="switch"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("div",zLe,[t.createElementVNode("label",ELe,[q.label_1?(t.openBlock(),t.createElementBlock("span",PLe,t.toDisplayString(q.label_1),1)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"switch",onClick:C=>m(z)},[t.createElementVNode("div",{class:t.normalizeClass(["switch-track",{"switch-on":y.value[z]}])},[t.createElementVNode("div",{class:t.normalizeClass(["switch-thumb",{on:y.value[z]}])},null,2)],2)],8,RLe),q.label_2?(t.openBlock(),t.createElementBlock("span",MLe,t.toDisplayString(q.label_2),1)):t.createCommentVNode("",!0)])]),z>=0?(t.openBlock(),t.createElementBlock("div",FLe)):t.createCommentVNode("",!0)],64)):q.type==="advanced-select"?(t.openBlock(),t.createElementBlock("div",jLe,[t.createElementVNode("div",{class:"custom-select dynamic-select filter-inline advanced-select-dropdown","data-filter-type":q.type,onClick:t.withModifiers(C=>s(z),["stop"])},[t.createElementVNode("div",ALe,[U[4]||(U[4]=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",KLe,t.toDisplayString(V(q,z)||q.label||"Seleccionar"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:d.value===z}])},[...U[3]||(U[3]=[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)]),d.value===z?(t.openBlock(),t.createElementBlock("div",ILe,[t.createElementVNode("div",XLe,[t.createVNode(yLe,{filter:q,"filter-index":z,"selected-values":y.value,onUpdateSelection:w,onClose:C=>s(z)},null,8,["filter","filter-index","selected-values","onClose"])])])):t.createCommentVNode("",!0)],8,WLe)])):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0)]))}},BLe=pc(DLe,[["__scopeId","data-v-65027e1a"]]),GLe={class:"floating-bar"},JLe={class:"tab active"},ZLe={class:"select-display"},HLe={class:"select-icon"},YLe=["src"],QLe={key:1,alt:"icono",class:"option-img-default",src:"https://golstatsimages.blob.core.windows.net/images-library/vector2.png"},$Le={key:0,class:"select-placeholder select-label"},eOe={key:1,class:"select-label"},tOe={key:0,class:"dropdown-menu field-menu"},rOe=["onClick"],aOe={class:"option-icon"},nOe=["data-hover-src","src"],iOe={class:"option-content"},oOe={class:"option-title"},sOe={key:0,class:"option-description"},lOe={class:"select-display"},cOe={class:"select-icon"},uOe=["src"],dOe=["src"],pOe={class:"select-label"},hOe={key:0,class:"dropdown-menu type-menu type-menu-grid"},fOe={class:"option-grid"},mOe=["onClick"],yOe={class:"option-grid-title"},gOe={class:"option-grid-icon"},vOe=["src"],bOe={key:1,class:"filter-separator"},xOe=["onClick"],wOe={class:"select-display"},_Oe={key:0,class:"badge-categorias"},SOe={key:0,class:"dropdown-menu type-menu multi-select-menu"},TOe={class:"multi-select-scroll-area"},kOe={class:"select-all-checkbox"},NOe=["checked","indeterminate","onChange"],VOe={class:"option-checkbox"},LOe=["checked","onChange"],OOe=["onClick"],qOe={class:"option-title"},COe={class:"multi-select-footer"},UOe={key:1,class:"custom-radio-group filter-inline"},zOe={class:"radio-label"},EOe={class:"radio-options"},POe=["onUpdate:modelValue","disabled","name","value","onChange"],ROe={key:2,class:"check-group filter-inline"},MOe=["onUpdate:modelValue","checked"],FOe=["data-filter-type","onClick"],jOe={class:"select-display"},WOe={key:0,class:"dropdown-menu type-menu simple-select-menu"},AOe={class:"simple-select-scroll-area"},KOe=["onMouseenter","onClick"],IOe={class:"option-content"},XOe={class:"option-title"},DOe={key:0,class:"option-checkmark"},BOe={key:4,class:"filter-separator"},GOe=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 b=e,R=n,y=t.ref(new Map),c=t.ref([]);let i=null,d=null,l=null;const a=t.ref(!1),S=t.ref(!1),x=t.ref(!1),v=t.ref(!1),p=t.ref(!1),o=t.ref(!1),s=t.computed(()=>c.value),f=t.ref(null),u=t.computed(()=>s.value[f.value]||null),m=t.computed(()=>{var ye;const ze=((ye=u.value)==null?void 0:ye.views)||[];return C(ze)}),w=t.ref(null),_=t.computed(()=>m.value.find(ye=>ye.id===w.value)||null),T=t.ref([]),V=t.computed(()=>{var ye,ze;return a.value?((ye=_.value)==null?void 0:ye.filters_edition_mode)||[]:((ze=_.value)==null?void 0:ze.filters)||[]});t.watch(a,ye=>{ye||(S.value=!1)}),t.watch(_,ye=>{var ze,Me;if(!ye){T.value=[];return}const je=ye.id===6&&b.isPostMatch,He=ye.id===14;if(!Array.isArray(V.value)&&!je&&!He){T.value=[];return}v.value||(je||He?T.value=[]:T.value=V.value.map(($e,ut)=>{var xt,_t,Rt,Xt,It,lt,et,ct,mt,Ut,Nt,it,dt,Ze,pt,kt,vt,St,Lt,nt,rt;if($e.type==="select"){if(a.value&&l&&l.dynamicFilters){const wt=l.dynamicFilters[ut];if(wt){if(wt.selectedOptions&&Array.isArray(wt.selectedOptions))return wt.selectedOptions.map(Mt=>Mt.value);if(wt.selectedValue&&Array.isArray(wt.selectedValue))return wt.selectedValue.length>0&&wt.selectedValue[0]&&typeof wt.selectedValue[0]=="object"?Fe(wt.selectedValue):wt.selectedValue}}return ye.id===4&&$e.options&&Array.isArray($e.options)?$e.options.map(wt=>wt.value):[]}else if($e.type==="radio-button"){if(a.value&&l&&l.dynamicFilters){const wt=l.dynamicFilters[ut];if(wt&&wt.selectedOption){let Mt=wt.selectedOption.value;if(ye.id===15&&ut===0&&Mt===3&&((_t=(xt=d==null?void 0:d.view)==null?void 0:xt.filterMultiple)==null?void 0:_t.isHomeTeam)!==void 0){const Ft=d.view.filterMultiple.isHomeTeam;typeof Ft=="boolean"?Mt=Ft?1:2:typeof Ft=="number"&&(Mt=Ft===1?1:2)}return Mt}}if(ye.id===7&&a.value&&d!=null&&d.view){if(ut===0&&(Rt=d.view.componentProps)!=null&&Rt.analysisType)return d.view.componentProps.analysisType==="offensive"?1:2;if(ut===1&&((Xt=d.view.filterMultiple)==null?void 0:Xt.isHomeTeam)!==void 0)return d.view.filterMultiple.isHomeTeam?1:2}return((lt=(It=$e.options)==null?void 0:It[0])==null?void 0:lt.value)??null}else if($e.type==="select-simple"){if(a.value&&l&&l.dynamicFilters){const wt=l.dynamicFilters[ut];if(wt&&wt.selectedValue!==void 0){let Mt;return ye.id===2&&(ct=(et=d==null?void 0:d.view)==null?void 0:et.filterMultiple)!=null&&ct.categoryId?Mt=d.view.filterMultiple.categoryId:ye.id===1&&(Ut=(mt=d==null?void 0:d.view)==null?void 0:mt.filterMultiple)!=null&&Ut.category?Mt=d.view.filterMultiple.category:ye.id===6&&(it=(Nt=d==null?void 0:d.view)==null?void 0:Nt.filterMultiple)!=null&&it.gameNumber?Mt=d.view.filterMultiple.gameNumber:Mt=Array.isArray(wt.selectedValue)?wt.selectedValue[0]:wt.selectedValue,Mt}}if(ye.id===2&&a.value&&d!=null&&d.view){if(i&&d.view.id){const wt=i.getComponentDynamicFilters(d.view.id);if(wt&&wt[ut]!==void 0)return wt[ut]}if(d.view.filterMultiple){if($e.type==="select-simple"&&d.view.filterMultiple.categoryId){const wt=d.view.filterMultiple.categoryId;return($e.options||[]).find(Mt=>Mt.value==wt),wt}if($e.type==="radio-button"&&d.view.filterMultiple.teamType!==void 0){const wt=d.view.filterMultiple.teamType;return($e.options||[]).find(Mt=>Mt.value==wt),wt}}}if(ye.id===1&&a.value&&(dt=d==null?void 0:d.view)!=null&&dt.filterMultiple&&d.view.filterMultiple.category){const wt=d.view.filterMultiple.category;return($e.options||[]).find(Mt=>Mt.value==wt),wt}if(ye.id===9&&a.value&&(Ze=d==null?void 0:d.view)!=null&&Ze.filterMultiple&&$e.type==="select-simple"&&d.view.filterMultiple.categoryIds){const wt=Array.isArray(d.view.filterMultiple.categoryIds)?d.view.filterMultiple.categoryIds:[d.view.filterMultiple.categoryIds],Mt=($e.options||[]).filter(Ft=>Array.isArray(Ft.value)?Te(Ft.value,wt):wt.includes(Ft.value));return Mt.length>0?Mt[0].value:wt}if(ye.id===6&&a.value&&(pt=d==null?void 0:d.view)!=null&&pt.filterMultiple&&d.view.filterMultiple.gameNumber){const wt=d.view.filterMultiple.gameNumber;return($e.options||[]).find(Mt=>Mt.value==wt),wt}if(ye.id===5&&a.value&&(kt=d==null?void 0:d.view)!=null&&kt.filterMultiple&&d.view.filterMultiple.isHomeTeam!==void 0){const wt=d.view.filterMultiple.isHomeTeam;let Mt;if(typeof wt=="boolean"?Mt=wt?1:2:typeof wt=="number"?Mt=wt===1?1:2:Mt=1,($e.options||[]).find(Ft=>Ft.value==Mt),$e.type==="radio-button"&&($e.label==="Equipo"||$e.label==="Team"||$e.label==="Equipo seleccionado"))return Mt}if(ye.id===15&&a.value&&(vt=d==null?void 0:d.view)!=null&&vt.filterMultiple&&d.view.filterMultiple.isHomeTeam!==void 0&&$e.type==="radio-button"&&ut===0){const wt=d.view.filterMultiple.isHomeTeam;let Mt;if(typeof wt=="boolean"?Mt=wt?1:2:typeof wt=="number"?Mt=wt===1?1:2:Mt=1,($e.options||[]).find(Ft=>Ft.value==Mt))return Mt}if(ye.id===9&&a.value&&(St=d==null?void 0:d.view)!=null&&St.filterMultiple&&$e.type==="radio-button"&&d.view.filterMultiple.isHomeTeam!==void 0){const wt=d.view.filterMultiple.isHomeTeam?1:2,Mt=((Lt=$e.options)==null?void 0:Lt.map(Ft=>Ft.value))||[];return Mt.includes(wt)?wt:Mt[0]||1}return((rt=(nt=$e.options)==null?void 0:nt[0])==null?void 0:rt.value)??null}else if($e.type==="check"){if(a.value&&l&&l.dynamicFilters){const wt=l.dynamicFilters[ut];if(wt&&wt.isChecked!==void 0)return wt.isChecked}if(ye.id===8)return!0;if(ye.id===3){if(a.value&&l&&l.dynamicFilters){const wt=l.dynamicFilters[ut];if(wt&&wt.isChecked!==void 0)return wt.isChecked}return!1}return!1}return null}),!((ze=ye.name)!=null&&ze.toLowerCase().includes("tops players")||(Me=ye.title)!=null&&Me.toLowerCase().includes("tops players"))&&(!a.value||je)&&t.nextTick(()=>{var $e,ut;ye.id===4&&a.value&&($e=d==null?void 0:d.view)!=null&&$e.id&&i&&i.setDynamicFilters(T.value,d.view.id),ye.id===3&&a.value&&(ut=d==null?void 0:d.view)!=null&&ut.id&&i&&i.setDynamicFilters(T.value,d.view.id),ne()}))},{immediate:!0}),t.watch(()=>i,ye=>{ye&&ye.dynamicFilters&&Array.isArray(ye.dynamicFilters)&&(v.value=!0,T.value=[...ye.dynamicFilters],t.nextTick(()=>{v.value=!1}))},{deep:!0}),t.watch(()=>i==null?void 0:i.dynamicFilters,ye=>{if(ye&&Array.isArray(ye)){if(p.value)return;v.value=!0,T.value=[...ye],t.nextTick(()=>{v.value=!1})}},{deep:!0}),t.watch(()=>_.value,ye=>{if(a.value&&l&&ye&&ye.filters){if(v.value||o.value)return;if(ye.id===3){if(p.value||o.value)return;const ze=l.dynamicFilters.find(Me=>Me.filterType==="check");ze&&ze.isChecked!==void 0&&T.value&&T.value.length>0&&(p.value=!0,T.value[0]=ze.isChecked,t.nextTick(()=>{T.value=[...T.value],p.value=!1}))}setTimeout(()=>{(!T.value||T.value.length===0)&&(Pe(),Ue(),me()),ye.id===4&&Ne()},100)}},{deep:!0}),t.watch(()=>{var ye;return(ye=_.value)==null?void 0:ye.id},ye=>{if(a.value&&l&&ye===4){if(v.value||o.value)return;setTimeout(()=>{Ne()},200)}}),t.watch(()=>T.value,ye=>{if(a.value&&l&&ye&&ye.length>0){if(v.value||p.value||o.value)return;setTimeout(()=>{var ze;ke()&&(Pe(),Ue(),me(),((ze=_.value)==null?void 0:ze.id)===4&&Ne())},50)}},{deep:!0});function L(ye,ze){var Me,je,He,$e,ut;const xt=T.value[ye];if((Me=_.value)==null||Me.id,(je=_.value)==null||je.id,Array.isArray(xt)){if(((He=_.value)==null?void 0:He.id)===4&&ye===0){const _t=xt.some(Rt=>{if(ze.category_id&&ze.event_type_id){if(Rt.category_id&&Rt.event_type_id)return Rt.category_id===ze.category_id&&Rt.event_type_id===ze.event_type_id;if(Rt.event_type_id&&!Rt.category_id)return Rt.event_type_id===ze.event_type_id;if(Rt.category_id&&!Rt.event_type_id)return Rt.category_id===ze.category_id}else{if(ze.event_type_id)return Rt.event_type_id===ze.event_type_id;if(ze.category_id)return Rt.category_id===ze.category_id}return JSON.stringify(Rt)===JSON.stringify(ze)});return($e=_.value)==null||$e.id,_t}return xt.includes(ze)}else if(xt!=null)return(ut=_.value)==null||ut.id,xt===ze;return!1}function O(ye,ze){var Me,je,He;const $e=(je=(Me=_.value)==null?void 0:Me.filters)==null?void 0:je[ye];if(($e==null?void 0:$e.type)==="select-simple"){se(ye,ze);return}Array.isArray(T.value[ye])||(T.value[ye]=[]);const ut=T.value[ye];let xt=-1;((He=_.value)==null?void 0:He.id)===4&&ye===0?xt=ut.findIndex(_t=>ze.category_id&&ze.event_type_id?_t.category_id===ze.category_id&&_t.event_type_id===ze.event_type_id:ze.event_type_id?_t.event_type_id===ze.event_type_id:ze.category_id?_t.category_id===ze.category_id:!1):xt=ut.indexOf(ze),xt>-1?ut.splice(xt,1):ut.push(ze),a.value&&Le(),ne()}function U(ye){var ze,Me;const je=T.value[ye],He=(Me=(ze=_.value)==null?void 0:ze.filters)==null?void 0:Me[ye];return(He==null?void 0:He.type)==="select-simple"||!He||!He.options||!Array.isArray(je)?!1:je.length===He.options.length}function q(ye){var ze,Me;const je=T.value[ye],He=(Me=(ze=_.value)==null?void 0:ze.filters)==null?void 0:Me[ye];return(He==null?void 0:He.type)==="select-simple"||!He||!He.options||!Array.isArray(je)?!1:je.length>0&&je.length<He.options.length}function z(){var ye;return!(((ye=_.value)==null?void 0:ye.id)===6&&b.isPostMatch)}function C(ye){return!ye||!Array.isArray(ye)?ye:ye.filter(ze=>{const Me=(ze.name||ze.title||"").toLowerCase();return b.isPostMatch?!0:!["resumen general","timeline","datos relevantes"].some(je=>Me.includes(je))})}function N(){var ye,ze;const Me=((ze=(ye=u.value)==null?void 0:ye.name)==null?void 0:ze.toLowerCase())||"";return Me.includes("cancha")||Me.includes("volumétrica")||Me.includes("volumetric")}function E(ye,ze){if(!a.value||!N())return!1;const Me=String(ye||"").toLowerCase(),je=String(ze||"").toLowerCase();return Me.includes("ambos")||je.includes("ambos")}function k(ye){var ze,Me;const je=(Me=(ze=_.value)==null?void 0:ze.filters)==null?void 0:Me[ye];if(!je||!je.options)return;const He=je.options.map($e=>$e.value);Array.isArray(T.value[ye])||(T.value[ye]=[]),U(ye)?T.value[ye]=[]:T.value[ye]=[...He],A.value=ye,ne()}const P=t.ref("ambos"),F=t.ref(!1),W=t.ref(!1),A=t.ref(null),X=t.ref(null);function D(ye,ze=!1){const Me="https://golstatsimages.blob.core.windows.net/images-library/",je="https://golstatsimages.blob.core.windows.net/reports-images/",He={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"},$e=Object.keys(He).find(ut=>ye==null?void 0:ye.toLowerCase().includes(ut.toLowerCase()));if($e){const ut=He[$e],xt=ze?"":"-def";return $e.toLowerCase().includes("tabla")?`${je}${ut}${xt}@2x.png`:`${Me}${ut}${xt}@2x.png`}return`${Me}icn_default${ze?"":"-def"}.png`}function Y(){return u.value?u.value.name:"Tipo de vista"}function re(){return _.value?_.value.name||_.value.title:"Visualización"}function G(){a.value||(F.value=!F.value,F.value&&(W.value=!1,t.nextTick(()=>{Ce()})))}function te(){a.value||u.value&&(W.value=!W.value,W.value&&(F.value=!1))}function ee(ye){a.value||(f.value=ye,F.value=!1,w.value=null,ne())}function H(ye){var ze,Me;a.value||(w.value=ye.id,W.value=!1,(ze=ye.name)!=null&&ze.toLowerCase().includes("tops players")||(Me=ye.title)==null||Me.toLowerCase().includes("tops players"))}function $(ye){var ze;A.value=A.value===ye?null:ye,((ze=_.value)==null?void 0:ze.id)===4&&a.value&&ye===0&&setTimeout(()=>{T.value=[...T.value]},50)}function oe(ye){X.value=X.value===ye?null:ye}function se(ye,ze){var Me,je,He,$e,ut;if(((Me=_.value)==null?void 0:Me.id)===2){const xt=V.value.findIndex(_t=>_t.type==="select-simple"&&_t.label==="Tipo de análisis");ye===xt?T.value[0]=ze:T.value[ye]=ze}else if(((je=_.value)==null?void 0:je.id)===1)T.value[0]=ze;else if(((He=_.value)==null?void 0:He.id)===6)T.value[0]=ze;else if((($e=_.value)==null?void 0:$e.id)===9)if(ye===0){Array.isArray(ze)?T.value[ye]=ze:T.value[ye]=[ze];const xt=((ut=V.value[ye])==null?void 0:ut.options)||[],_t=Array.isArray(ze)?ze:[ze],Rt=xt.find(Xt=>Array.isArray(Xt.value)?Te(Xt.value,_t):_t.includes(Xt.value));Rt?T.value[ye]=Rt.value:T.value[ye]=_t}else T.value[ye]=ze;else T.value[ye]=ze;X.value=null,a.value&&Le(),ne()}function ce(ye){ye.target.closest(".custom-select")||(F.value=!1,W.value=!1,X.value=null)}const he=[16,18];function ne(){var ye,ze,Me,je,He,$e,ut,xt,_t,Rt,Xt,It,lt,et,ct,mt,Ut,Nt,it,dt,Ze,pt;if(he.includes((ye=_.value)==null?void 0:ye.id)||v.value)return;let kt=[],vt=[];_.value&&Array.isArray(V.value)&&V.value.forEach((rt,wt)=>{if(rt.type==="select"&&rt.label==="Tipo de análisis"&&rt.id===2){const Mt=T.value[wt]||[];Array.isArray(Mt)&&Mt.length>0&&(kt=Mt.map(Ft=>{var Ct;const Ht=(Ct=rt.options)==null?void 0:Ct.find(Kt=>Kt.value===Ft);return{value:Ft,label:(Ht==null?void 0:Ht.label)||Ft}}))}});const St=((ze=_.value)==null?void 0:ze.id)===4;if(_.value&&Array.isArray(_.value.filters)&&_.value.filters.some(rt=>rt.type==="select"&&rt.label==="Tipo de análisis"&&rt.id===2)&&kt.length===0&&!St)return;if(St&&T.value&&T.value.length>0){const rt=T.value[0];Array.isArray(rt)&&rt.length>0}vt=((Me=V.value)==null?void 0:Me.map((rt,wt)=>{var Mt,Ft,Ct,Ht;const Kt=T.value[wt];let Yt=rt.id||`filter_${wt}`;return((Mt=_.value)==null?void 0:Mt.id)===3&&a.value&&(Ft=d==null?void 0:d.view)!=null&&Ft.id&&(Yt=`filter_${wt}_component_${d.view.id}`),{filterId:Yt,filterType:rt.type,filterLabel:rt.label,filterIcon:rt.icon||null,selectedValue:Kt,selectedOptions:rt.type==="select"&&Array.isArray(Kt)&&Kt.length>0?Kt.map(Gt=>{var Jt;const or=(Jt=rt.options)==null?void 0:Jt.find(sr=>sr.value===Gt);return{value:Gt,label:(or==null?void 0:or.label)||Gt,icon:(or==null?void 0:or.icon)||null}}):null,selectedOption:rt.type==="radio-button"&&Kt!=null?{value:Kt,label:((Ht=(Ct=rt.options)==null?void 0:Ct.find(Gt=>Gt.value===Kt))==null?void 0:Ht.label)||Kt}:null,isChecked:rt.type==="check"?Kt:null}}))||[];const Lt={mainSelector:{id:((je=u.value)==null?void 0:je.id)||null,name:((He=u.value)==null?void 0:He.name)||null,url:(($e=u.value)==null?void 0:$e.url)||null},viewSelector:{id:((ut=_.value)==null?void 0:ut.id)||null,name:((xt=_.value)==null?void 0:xt.name)||((_t=_.value)==null?void 0:_t.title)||null,url:((Rt=_.value)==null?void 0:Rt.url)||null},team:P.value,dynamicFilters:vt,categoriasSeleccionadas:kt,timestamp:new Date().toISOString(),summary:{mainSelected:!!u.value,viewSelected:!!_.value,totalDynamicFilters:((Xt=V.value)==null?void 0:Xt.length)||0,activeFilters:((It=V.value)==null?void 0:It.filter((rt,wt)=>{const Mt=T.value[wt];return Array.isArray(Mt)?Mt.length>0:Mt!=null&&Mt!==!1}).length)||0}},nt={main:u.value,view:_.value,team:P.value,dynamicFilters:T.value,filtersJSON:Lt,filterAndViewsContainer:i,viewToEdit:d};if(R("filters-changed",nt),a.value&&d){if(l=Lt,((lt=_.value)==null?void 0:lt.id)===2){const rt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select-simple"&&wt.filterLabel==="Tipo de análisis");rt!==-1&&(ct=(et=d.view)==null?void 0:et.filterMultiple)!=null&&ct.categoryId&&(l.dynamicFilters[rt].selectedValue=d.view.filterMultiple.categoryId)}if(((mt=_.value)==null?void 0:mt.id)===1){const rt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select-simple"&&wt.filterLabel==="Tipo de análisis");rt!==-1&&(Nt=(Ut=d.view)==null?void 0:Ut.filterMultiple)!=null&&Nt.category&&(l.dynamicFilters[rt].selectedValue=d.view.filterMultiple.category)}}if(((it=_.value)==null?void 0:it.id)===6&&a.value&&(dt=d==null?void 0:d.view)!=null&&dt.filterMultiple&&d.view.filterMultiple.gameNumber&&l){const rt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select-simple"&&wt.filterLabel==="Número de juego");rt!==-1&&(pt=(Ze=d.view)==null?void 0:Ze.filterMultiple)!=null&&pt.gameNumber&&(l.dynamicFilters[rt].selectedValue=d.view.filterMultiple.gameNumber)}i&&!a.value?i.setDynamicFilters(T.value):i&&a.value}function de(){d=null,l=null,i=null,f.value=null,w.value=null,P.value="ambos",T.value=[],F.value=!1,W.value=!1,A.value=null,X.value=null,a.value=!1,S.value=!1,x.value=!1}function ue(ye){if(ye&&ye.dynamicFilters){if(p.value)return;Array.isArray(ye.dynamicFilters)&&ye.dynamicFilters.length>0&&(v.value=!0,T.value=[...ye.dynamicFilters],t.nextTick(()=>{v.value=!1}))}}function ge(ye){if(a.value=!0,ye.mainSelector&&ye.mainSelector.id){const ze=c.value.findIndex(Me=>Me.id===ye.mainSelector.id);ze!==-1&&(f.value=ze)}ye.viewSelector&&ye.viewSelector.id&&u.value&&u.value.views.findIndex(ze=>ze.id===ye.viewSelector.id)!==-1&&(w.value=ye.viewSelector.id),ye.dynamicFilters&&Array.isArray(ye.dynamicFilters)&&t.nextTick(()=>{setTimeout(()=>{var ze,Me,je,He,$e,ut,xt,_t,Rt,Xt,It,lt,et,ct,mt,Ut,Nt,it,dt,Ze,pt,kt,vt;if(_.value&&V.value){if(v.value)return;if(p.value=!0,ye.dynamicFilters.forEach((St,Lt)=>{var nt,rt,wt,Mt,Ft,Ct,Ht,Kt,Yt,Gt,Jt,or,sr;if(Lt<V.value.length){const qr=V.value[Lt];if(((nt=_.value)==null?void 0:nt.id)===3&&a.value,qr.type==="check"){const Ur=St.isChecked;typeof Ur=="boolean"&&(T.value[Lt]=Ur)}else if(qr.type==="select"&&St.selectedOptions){const Ur=St.selectedOptions.map(Or=>Or.value);T.value[Lt]=Ur}else if(qr.type==="select"&&St.selectedValue&&Array.isArray(St.selectedValue))if(St.selectedValue.length>0&&St.selectedValue[0]&&typeof St.selectedValue[0]=="object"){const Ur=Fe(St.selectedValue);T.value[Lt]=Ur}else T.value[Lt]=St.selectedValue;else if(qr.type==="radio-button"&&St.selectedOption)T.value[Lt]=St.selectedOption.value;else if(qr.type==="select-simple"&&St.selectedValue!==void 0){let Ur;((rt=_.value)==null?void 0:rt.id)===2&&(Mt=(wt=d==null?void 0:d.view)==null?void 0:wt.filterMultiple)!=null&&Mt.categoryId?Ur=d.view.filterMultiple.categoryId:((Ft=_.value)==null?void 0:Ft.id)===1&&(Ht=(Ct=d==null?void 0:d.view)==null?void 0:Ct.filterMultiple)!=null&&Ht.category?Ur=d.view.filterMultiple.category:((Kt=_.value)==null?void 0:Kt.id)===6&&(Gt=(Yt=d==null?void 0:d.view)==null?void 0:Yt.filterMultiple)!=null&&Gt.gameNumber?Ur=d.view.filterMultiple.gameNumber:((Jt=_.value)==null?void 0:Jt.id)===9&&(sr=(or=d==null?void 0:d.view)==null?void 0:or.filterMultiple)!=null&&sr.categoryIds?Ur=d.view.filterMultiple.categoryIds:Ur=Array.isArray(St.selectedValue)?St.selectedValue[0]:St.selectedValue,T.value[Lt]=Ur}}}),((ze=_.value)==null?void 0:ze.id)===3&&a.value,((Me=_.value)==null?void 0:Me.id)===2&&a.value&&(je=d==null?void 0:d.view)!=null&&je.filterMultiple){if(d.view.filterMultiple.categoryId){const St=V.value.findIndex(Lt=>Lt.type==="select-simple"&&Lt.label==="Tipo de análisis");if(St!==-1){const Lt=d.view.filterMultiple.categoryId;if(T.value[0]=Lt,d.view.componentProps&&Lt){let nt=`Category ${Lt}`,rt=null;try{rt=Jh(Lt),rt&&(nt=rt.name)}catch{const wt=V.value.findIndex(Mt=>Mt.type==="select-simple"&&Mt.label==="Tipo de análisis");if(wt!==-1){const Mt=(((He=V.value[wt])==null?void 0:He.options)||[]).find(Ft=>Ft.value==Lt);Mt&&(nt=Mt.label)}}d.view.componentProps.categoryView=[{id:Lt,name:nt}]}((($e=V.value[St])==null?void 0:$e.options)||[]).find(nt=>nt.value==Lt),t.nextTick(()=>{T.value=[...T.value]})}}if(d.view.filterMultiple.teamType!==void 0){const St=V.value.findIndex(Lt=>Lt.type==="radio-button");if(St!==-1){const Lt=d.view.filterMultiple.teamType;T.value[St]=Lt,(((ut=V.value[St])==null?void 0:ut.options)||[]).find(nt=>nt.value==Lt),t.nextTick(()=>{T.value=[...T.value]})}}}if(((xt=_.value)==null?void 0:xt.id)===9&&a.value&&(_t=d==null?void 0:d.view)!=null&&_t.filterMultiple){if(d.view.filterMultiple.categoryIds){const St=V.value.findIndex(Lt=>Lt.type==="select-simple");if(St!==-1){const Lt=Array.isArray(d.view.filterMultiple.categoryIds)?d.view.filterMultiple.categoryIds:[d.view.filterMultiple.categoryIds];T.value[0]=Lt;const nt=(((Rt=V.value[St])==null?void 0:Rt.options)||[]).filter(wt=>Array.isArray(wt.value)?Te(wt.value,Lt):Lt.includes(wt.value));if(nt.length>0){const wt=nt[0].value;T.value[St]=wt}else T.value[St]=Lt;const rt=T.value[St];Te(rt,Lt),t.nextTick(()=>{T.value=[...T.value]})}}if(d.view.filterMultiple.isHomeTeam!==void 0){const St=V.value.findIndex(Lt=>Lt.type==="radio-button");if(St!==-1){const Lt=d.view.filterMultiple.isHomeTeam;let nt;typeof Lt=="boolean"?nt=Lt?1:2:typeof Lt=="number"?nt=Lt===1?1:2:nt=1,T.value[St]=nt,(((Xt=V.value[St])==null?void 0:Xt.options)||[]).find(rt=>rt.value==nt),t.nextTick(()=>{T.value=[...T.value]})}}}if(((It=_.value)==null?void 0:It.id)===1&&a.value&&(lt=d==null?void 0:d.view)!=null&<.filterMultiple&&d.view.filterMultiple.category){const St=V.value.findIndex(Lt=>Lt.type==="select-simple"&&Lt.label==="Tipo de análisis");if(St!==-1){const Lt=d.view.filterMultiple.category;T.value[0]=Lt,d.view.componentProps&&Lt&&(d.view.componentProps.type=Lt),(((et=V.value[St])==null?void 0:et.options)||[]).find(nt=>nt.value==Lt),t.nextTick(()=>{T.value=[...T.value]})}}if(((ct=_.value)==null?void 0:ct.id)===6&&a.value&&(mt=d==null?void 0:d.view)!=null&&mt.filterMultiple&&d.view.filterMultiple.gameNumber){const St=V.value.findIndex(Lt=>Lt.type==="select-simple"&&Lt.label==="Número de juego");if(St!==-1){const Lt=d.view.filterMultiple.gameNumber;T.value[0]=Lt,d.view.componentProps&&Lt&&(d.view.componentProps.gameNumber=Lt),(((Ut=V.value[St])==null?void 0:Ut.options)||[]).find(nt=>nt.value==Lt),t.nextTick(()=>{T.value=[...T.value]})}}if(((Nt=_.value)==null?void 0:Nt.id)===7&&a.value&&d!=null&&d.view){if((it=d.view.componentProps)!=null&&it.analysisType&&V.value.length>0&&((dt=V.value[0])==null?void 0:dt.type)==="radio-button"){const St=d.view.componentProps.analysisType==="offensive"?1:2;T.value[0]=St}if(((Ze=d.view.filterMultiple)==null?void 0:Ze.isHomeTeam)!==void 0){const St=V.value.findIndex(Lt=>Lt.type==="radio-button"&&Lt.label==="Equipo");if(St!==-1){const Lt=d.view.filterMultiple.isHomeTeam?1:2;T.value[1]=Lt}else if(V.value.length>1&&((pt=V.value[1])==null?void 0:pt.type)==="radio-button"){const Lt=d.view.filterMultiple.isHomeTeam,nt=Lt?1:2;T.value[1]=nt,d.view.componentProps&&(d.view.componentProps.isHomeTeamForAnalysis=Lt),(((kt=V.value[1])==null?void 0:kt.options)||[]).find(rt=>rt.value==nt),t.nextTick(()=>{T.value=[...T.value]})}if(St!==-1&&d.view.componentProps){const Lt=d.view.filterMultiple.isHomeTeam,nt=Lt?1:2;d.view.componentProps.isHomeTeamForAnalysis=Lt,(((vt=V.value[St])==null?void 0:vt.options)||[]).find(rt=>rt.value==nt),t.nextTick(()=>{T.value=[...T.value]})}}}t.nextTick(()=>{p.value=!1})}},100)})}function xe(){var ye,ze,Me,je,He,$e,ut,xt,_t,Rt;return{mainSelector:{id:((ye=u.value)==null?void 0:ye.id)||null,name:((ze=u.value)==null?void 0:ze.name)||null,url:((Me=u.value)==null?void 0:Me.url)||null},viewSelector:{id:((je=_.value)==null?void 0:je.id)||null,name:((He=_.value)==null?void 0:He.name)||(($e=_.value)==null?void 0:$e.title)||null,url:((ut=_.value)==null?void 0:ut.url)||null},team:P.value,dynamicFilters:((xt=V.value)==null?void 0:xt.map((Xt,It)=>{var lt,et;const ct=T.value[It];return{filterId:Xt.id||`filter_${It}`,filterType:Xt.type,filterLabel:Xt.label,filterIcon:Xt.icon||null,selectedValue:ct,selectedOptions:Xt.type==="select"&&Array.isArray(ct)&&ct.length>0?ct.map(mt=>{var Ut;const Nt=(Ut=Xt.options)==null?void 0:Ut.find(it=>it.value===mt);return{value:mt,label:(Nt==null?void 0:Nt.label)||mt,icon:(Nt==null?void 0:Nt.icon)||null}}):null,selectedOption:Xt.type==="radio-button"&&ct?{value:ct,label:((et=(lt=Xt.options)==null?void 0:lt.find(mt=>mt.value===ct))==null?void 0:et.label)||ct}:null,isChecked:Xt.type==="check"?ct:null}}))||[],timestamp:new Date().toISOString(),summary:{mainSelected:!!u.value,viewSelected:!!_.value,totalDynamicFilters:((_t=V.value)==null?void 0:_t.length)||0,activeFilters:((Rt=V.value)==null?void 0:Rt.filter((Xt,It)=>{const lt=T.value[It];return Array.isArray(lt)?lt.length>0:lt!=null&<!==!1}).length)||0}}}r({getCurrentFiltersJSON:xe});function be(){de(),R("close",i)}function _e(){S.value=!1,be()}function qe(){x.value&&(Un.emit("filters-cancelled",i),x.value=!1),S.value=!1,be()}t.onMounted(async()=>{document.addEventListener("click",ce),t.nextTick(()=>{Ce()});const ye="https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/views";try{const ze=await(await fetch(ye,{headers:{Authorization:`${b.token}`}})).json();c.value=ze.data||[],y.value.clear(),c.value&&(y.value=c.value.reduce((Me,je)=>(je.views&&Array.isArray(je.views)&&je.views.forEach(He=>{He.filters&&Array.isArray(He.filters)&&Me.set(He.id,He)}),Me),new Map))}catch(ze){console.error("Error al obtener datos:",ze)}});function Ce(){document.querySelectorAll(".field-menu .option-card").forEach(ye=>{const ze=ye.querySelector(".option-img");if(!ze||!ze.dataset.hoverSrc)return;const Me=ze.src,je=ze.dataset.hoverSrc;ye.addEventListener("mouseenter",()=>{ze.src=je}),ye.addEventListener("mouseleave",()=>{ze.src=Me})})}t.onUnmounted(()=>{document.removeEventListener("click",ce)}),Un.on("set-filter-and-views-container",ye=>{i=ye,ye&&ue(ye)}),Un.on("view-added",()=>{S.value=!0,x.value=!0}),Un.on("component-added-to-container",ye=>{(!a.value||i&&ye.id===i.id)&&ue(ye)}),Un.on("edit-view",ye=>{var ze,Me,je,He,$e,ut,xt,_t,Rt,Xt,It,lt,et,ct,mt,Ut,Nt,it,dt,Ze,pt;console.log("on edit-view event received for view:",ye),d=ye,i=((ze=ye.view)==null?void 0:ze.filterAndViewsContainer)||null,l=null;const kt=[(je=(Me=ye.view)==null?void 0:Me.coreView)==null?void 0:je.filtersJSON,(He=ye.view)==null?void 0:He.filtersJSON,($e=ye.coreView)==null?void 0:$e.filtersJSON,ye.filtersJSON,(xt=(ut=ye.view)==null?void 0:ut.componentProps)==null?void 0:xt.filtersJSON];for(const vt of kt)if(vt){l=vt;break}if(i&&(i.viewId===4||i.viewId===8||i.viewId===3||i.viewId===1||i.viewId===2||i.viewId===13)&&(_t=ye.view)!=null&&_t.id){const vt=i.getComponentDynamicFilters(ye.view.id);if(vt){let St="Unknown";i.viewId===4?St="Timeline":i.viewId===8?St="FieldPosesion":i.viewId===3?St="GSCMatchSummary":i.viewId===1?St="GSCComparativeReports":i.viewId===2?St="GscTopPlayer":i.viewId===13&&(St="GSCTimelapseTable"),l&&(i.viewId===13?l={...l,dynamicFilters:vt}:l={...l,dynamicFilters:vt.map((Lt,nt)=>Array.isArray(Lt)?{selectedValue:Lt,selectedOptions:Lt.map(rt=>({value:rt,label:rt}))}:typeof Lt=="boolean"?{isChecked:Lt}:St==="GSCComparativeReports"&&nt===0?{selectedValue:Lt,selectedOptions:[{value:Lt,label:Lt}]}:St==="GscTopPlayer"&&nt===0?{selectedValue:Lt,selectedOptions:[{value:Lt,label:Lt}]}:St==="GscTopPlayer"&&nt===1?{selectedOption:{value:Lt,label:Lt}}:{selectedOption:{value:Lt,label:Lt}})})}}if(i&&i.viewId===2&&(Rt=ye.view)!=null&&Rt.filterMultiple){if(ye.view.filterMultiple.categoryId&&l){const vt=l.dynamicFilters.findIndex(St=>St.filterType==="select-simple"&&St.filterLabel==="Tipo de análisis");vt!==-1&&(l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:ye.view.filterMultiple.categoryId,selectedOptions:[{value:ye.view.filterMultiple.categoryId,label:`Category ${ye.view.filterMultiple.categoryId}`}]})}if(ye.view.filterMultiple.teamType!==void 0&&l){const vt=l.dynamicFilters.findIndex(St=>St.filterType==="radio-button");if(vt!==-1){const St=ye.view.filterMultiple.teamType,Lt=St===1?"Mi equipo":St===2?"Rival":St===3?"Ambos":"Equipo";l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:St,label:Lt}}}}}if(i&&i.viewId===1&&(Xt=ye.view)!=null&&Xt.filterMultiple&&ye.view.filterMultiple.category&&l){const vt=l.dynamicFilters.findIndex(St=>St.filterType==="select-simple"&&St.filterLabel==="Tipo de análisis");vt!==-1&&(l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:ye.view.filterMultiple.category,selectedOptions:[{value:ye.view.filterMultiple.category,label:ye.view.filterMultiple.category}]})}if(i&&i.viewId===9&&(It=ye.view)!=null&&It.filterMultiple){if(ye.view.filterMultiple.categoryIds&&l){const vt=l.dynamicFilters.findIndex(St=>St.filterType==="select"&&St.filterLabel==="Tipo de análisis");if(vt!==-1){const St=Array.isArray(ye.view.filterMultiple.categoryIds)?ye.view.filterMultiple.categoryIds:[ye.view.filterMultiple.categoryIds];l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:St,selectedOptions:St.map(rt=>({value:rt,label:`Category ${rt}`}))};const Lt=ye.view.filterMultiple.categoryIds;Te(Lt,St);const nt=(((lt=V.value[vt])==null?void 0:lt.options)||[]).filter(rt=>Array.isArray(rt.value)?Te(rt.value,St):St.includes(rt.value));if(nt.length>0){const rt=nt[0];l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:rt.value,selectedOptions:[rt]}}}}if(ye.view.filterMultiple.isHomeTeam!==void 0&&l){const vt=l.dynamicFilters.findIndex(St=>St.filterType==="radio-button");if(vt!==-1){const St=ye.view.filterMultiple.isHomeTeam;let Lt,nt;typeof St=="boolean"?(Lt=St?1:2,nt=St?"Mi equipo":"Rival"):typeof St=="number"?(Lt=St===1?1:2,nt=St===1?"Mi equipo":"Rival"):(Lt=1,nt="Mi equipo"),l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Lt,label:nt}}}}}if(i&&i.viewId===6&&(et=ye.view)!=null&&et.filterMultiple&&ye.view.filterMultiple.gameNumber&&l){const vt=l.dynamicFilters.findIndex(St=>St.filterType==="select-simple"&&St.filterLabel==="Número de juego");vt!==-1&&(l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:ye.view.filterMultiple.gameNumber,selectedOptions:[{value:ye.view.filterMultiple.gameNumber,label:`Juego ${ye.view.filterMultiple.gameNumber}`}]})}if(i&&i.viewId===7&&ye.view&&l){if((ct=ye.view.componentProps)!=null&&ct.analysisType){const vt=l.dynamicFilters.findIndex((St,Lt)=>St.filterType==="radio-button"&&Lt===0);if(vt!==-1){const St=ye.view.componentProps.analysisType,Lt=St==="offensive"?1:2,nt=St==="offensive"?"A favor":"En contra";l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Lt,label:nt}}}}if(((mt=ye.view.filterMultiple)==null?void 0:mt.isHomeTeam)!==void 0){const vt=l.dynamicFilters.findIndex(St=>St.filterType==="radio-button"&&St.filterLabel==="Equipo");if(vt!==-1){const St=ye.view.filterMultiple.isHomeTeam,Lt=St?1:2,nt=St?"Equipo propio":"Equipo rival";l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Lt,label:nt}}}}}if(i&&i.viewId===10&&(Ut=ye.view)!=null&&Ut.filterMultiple&&((it=(Nt=d==null?void 0:d.view)==null?void 0:Nt.coreView)==null?void 0:it.id)===10){const vt=ye.view.componentProps.isHomeTeamForAnalysis?{label:"Equipo propio",value:1}:{label:"Rival",value:2};l&&(l.dynamicFilters[0]={...l.dynamicFilters[0],selectedOption:vt})}if(i&&i.viewId===15&&(dt=ye.view)!=null&&dt.id){const vt=i.getComponentDynamicFilters(ye.view.id);if(vt&&l)l={...l,dynamicFilters:vt.map((St,Lt)=>{var nt,rt;if(Lt===0){let wt=St;if(St===3&&((rt=(nt=ye.view)==null?void 0:nt.filterMultiple)==null?void 0:rt.isHomeTeam)!==void 0){const Mt=ye.view.filterMultiple.isHomeTeam;typeof Mt=="boolean"?wt=Mt?1:2:typeof Mt=="number"&&(wt=Mt===1?1:2)}return{selectedOption:{value:wt,label:wt===1?"Mi equipo":"Rival"}}}else if(Lt===1)return{selectedValue:St,selectedOptions:[{value:St,label:`${St} fortalezas`}]};return typeof St=="number"?{selectedValue:St}:{selectedOption:{value:St,label:String(St)}}})};else if((Ze=ye.view)!=null&&Ze.filterMultiple&&l&&ye.view.filterMultiple.isHomeTeam!==void 0){const St=l.dynamicFilters.findIndex(Lt=>Lt.filterType==="radio-button"&&Lt.filterLabel==="Mi equipo");if(St!==-1){const Lt=ye.view.filterMultiple.isHomeTeam;let nt,rt;typeof Lt=="boolean"?(nt=Lt?1:2,rt=Lt?"Local":"Visitante"):typeof Lt=="number"?(nt=Lt===1?1:2,rt=Lt===1?"Local":"Visitante"):(nt=1,rt="Local"),l.dynamicFilters[St]={...l.dynamicFilters[St],selectedOption:{value:nt,label:rt}}}}}if(i&&i.viewId===5&&(pt=ye.view)!=null&&pt.filterMultiple&&ye.view.filterMultiple.isHomeTeam!==void 0&&l){const vt=l.dynamicFilters.findIndex(St=>St.filterType==="radio-button"&&St.filterLabel==="Equipo");if(vt!==-1){const St=ye.view.filterMultiple.isHomeTeam;let Lt,nt;typeof St=="boolean"?(Lt=St?1:2,nt=St?"Equipo propio":"Equipo rival"):typeof St=="number"?(Lt=St===1?1:2,nt=St===1?"Equipo propio":"Equipo rival"):(Lt=1,nt="Equipo propio"),l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Lt,label:nt}}}else{const St=l.dynamicFilters.findIndex(Lt=>Lt.filterType==="radio-button");if(St!==-1){const Lt=ye.view.filterMultiple.isHomeTeam;let nt,rt;typeof Lt=="boolean"?(nt=Lt?1:2,rt=Lt?"Equipo propio":"Equipo rival"):typeof Lt=="number"?(nt=Lt===1?1:2,rt=Lt===1?"Equipo propio":"Equipo rival"):(nt=1,rt="Equipo propio"),l.dynamicFilters[St]={...l.dynamicFilters[St],selectedOption:{value:nt,label:rt}}}}}l&&ge(l),S.value=!0});function Ee(){A.value=null}function Re(ye,ze){var Me;(Me=_.value)==null||Me.id}function Te(ye,ze){if(!Array.isArray(ye)||!Array.isArray(ze)||ye.length!==ze.length)return!1;const Me=[...ye].sort((He,$e)=>He-$e),je=[...ze].sort((He,$e)=>He-$e);return JSON.stringify(Me)===JSON.stringify(je)}function Pe(){if(a.value&&l&&l.dynamicFilters){if(o.value||v.value)return;o.value=!0,p.value=!0,l.dynamicFilters.forEach((ye,ze)=>{var Me;if(ye&&(Me=V.value)!=null&&Me[ze]){const je=V.value[ze];if(je.type==="check"&&ye.isChecked!==void 0)T.value[ze]=ye.isChecked;else if(je.type==="select"&&ye.selectedOptions){const He=ye.selectedOptions.map($e=>$e.value);T.value[ze]=He}else je.type==="select"&&ye.selectedValue&&Array.isArray(ye.selectedValue)&&(T.value[ze]=ye.selectedValue)}}),t.nextTick(()=>{p.value=!1,o.value=!1})}}function Ne(){var ye;if(a.value&&l&&l.dynamicFilters&&((ye=_.value)==null?void 0:ye.id)===4){if(o.value||v.value)return;o.value=!0,p.value=!0,l.dynamicFilters.forEach((ze,Me)=>{var je,He;if(ze&&((He=(je=V.value)==null?void 0:je[Me])==null?void 0:He.type)==="select"){if(ze.selectedOptions){const $e=ze.selectedOptions.map(ut=>ut.value);T.value[Me]=$e}else if(ze.selectedValue&&Array.isArray(ze.selectedValue))if(ze.selectedValue.length>0&&ze.selectedValue[0]&&typeof ze.selectedValue[0]=="object"){const $e=Fe(ze.selectedValue);T.value[Me]=$e}else T.value[Me]=ze.selectedValue}}),setTimeout(()=>{var ze;if(T.value=[...T.value],(ze=d==null?void 0:d.view)!=null&&ze.componentProps&&T.value&&T.value.length>0){const Me=T.value[0];if(Array.isArray(Me)&&Me.length>0){const je=Me.some(xt=>xt.event_type_id===1||typeof xt=="string"&&xt.includes("1")),He=Me.some(xt=>xt.category_id===8||typeof xt=="string"&&xt.includes("8")),$e=Me.some(xt=>xt.category_id===9||typeof xt=="string"&&xt.includes("9")),ut=Me.some(xt=>xt.event_type_id===3||typeof xt=="string"&&xt.includes("3"));d.view.componentProps.selectedEvents=Me,d.view.componentProps.goals=je,d.view.componentProps.yellowCards=He,d.view.componentProps.redCards=$e,d.view.componentProps.substitutions=ut,d.view.componentProps.key=Me.length>0,d.view.componentProps._updateKey=Date.now(),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps})}}},200),t.nextTick(()=>{p.value=!1,o.value=!1})}}function Fe(ye){return!Array.isArray(ye)||ye.length===0?[]:ye.map(ze=>{if(ze&&typeof ze=="object"){if(ze.event_type_id!==void 0||ze.category_id!==void 0)return{event_type_id:ze.event_type_id,category_id:ze.category_id,...ze.name&&{name:ze.name},...ze.label&&{label:ze.label}};if(ze.value&&typeof ze.value=="object")return{event_type_id:ze.value.event_type_id,category_id:ze.value.category_id,...ze.value.name&&{name:ze.value.name},...ze.value.label&&{label:ze.value.label}};if(typeof ze=="string"&&ze.includes("-")){const[Me,je]=ze.split("-");return{category_id:parseInt(Me),event_type_id:parseInt(je)}}}if(typeof ze=="string")if(ze.includes("-")){const[Me,je]=ze.split("-");return{category_id:parseInt(Me),event_type_id:parseInt(je)}}else{const Me=parseInt(ze);if(!isNaN(Me))return{event_type_id:Me}}return ze})}function Ue(){var ye,ze,Me,je,He,$e,ut,xt,_t,Rt,Xt,It,lt,et;if(a.value&&l&&l.dynamicFilters&&V.value){if(o.value||v.value)return;if(o.value=!0,p.value=!0,l.dynamicFilters.forEach((ct,mt)=>{var Ut,Nt,it,dt,Ze,pt,kt,vt,St,Lt,nt;if(ct&&((Ut=V.value[mt])==null?void 0:Ut.type)==="select"){if(ct.selectedOptions){const rt=ct.selectedOptions.map(wt=>wt.value);T.value[mt]=rt}else if(ct.selectedValue&&Array.isArray(ct.selectedValue))if(ct.selectedValue.length>0&&ct.selectedValue[0]&&typeof ct.selectedValue[0]=="object"){const rt=Fe(ct.selectedValue);T.value[mt]=rt}else T.value[mt]=ct.selectedValue}else if(ct&&((Nt=V.value[mt])==null?void 0:Nt.type)==="select-simple"&&ct.selectedValue!==void 0){let rt;((it=_.value)==null?void 0:it.id)===2&&(Ze=(dt=d==null?void 0:d.view)==null?void 0:dt.filterMultiple)!=null&&Ze.categoryId?rt=d.view.filterMultiple.categoryId:((pt=_.value)==null?void 0:pt.id)===1&&(vt=(kt=d==null?void 0:d.view)==null?void 0:kt.filterMultiple)!=null&&vt.category?rt=d.view.filterMultiple.category:((St=_.value)==null?void 0:St.id)===6&&(nt=(Lt=d==null?void 0:d.view)==null?void 0:Lt.filterMultiple)!=null&&nt.gameNumber?rt=d.view.filterMultiple.gameNumber:rt=Array.isArray(ct.selectedValue)?ct.selectedValue[0]:ct.selectedValue,T.value[mt]=rt}}),((ye=_.value)==null?void 0:ye.id)===4&&setTimeout(()=>{var ct;if(T.value=[...T.value],(ct=d==null?void 0:d.view)!=null&&ct.componentProps&&T.value&&T.value.length>0){const mt=T.value[0];if(Array.isArray(mt)&&mt.length>0){const Ut=mt.some(Ze=>Ze.event_type_id===1||typeof Ze=="string"&&Ze.includes("1")),Nt=mt.some(Ze=>Ze.category_id===8||typeof Ze=="string"&&Ze.includes("8")),it=mt.some(Ze=>Ze.category_id===9||typeof Ze=="string"&&Ze.includes("9")),dt=mt.some(Ze=>Ze.event_type_id===3||typeof Ze=="string"&&Ze.includes("3"));d.view.componentProps.selectedEvents=mt,d.view.componentProps.goals=Ut,d.view.componentProps.yellowCards=Nt,d.view.componentProps.redCards=it,d.view.componentProps.substitutions=dt,d.view.componentProps.key=mt.length>0,d.view.componentProps._updateKey=Date.now(),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps})}}},100),((ze=_.value)==null?void 0:ze.id)===2&&(Me=d==null?void 0:d.view)!=null&&Me.filterMultiple){if(d.view.filterMultiple.categoryId){const ct=V.value.findIndex(mt=>mt.type==="select-simple"&&mt.label==="Tipo de análisis");if(ct!==-1){const mt=d.view.filterMultiple.categoryId;if(T.value[0]=mt,d.view.componentProps&&mt){let Ut=`Category ${mt}`,Nt=null;try{Nt=Jh(mt),Nt&&(Ut=Nt.name)}catch{const it=V.value.findIndex(dt=>dt.type==="select-simple"&&dt.label==="Tipo de análisis");if(it!==-1){const dt=(((je=V.value[it])==null?void 0:je.options)||[]).find(Ze=>Ze.value==mt);dt&&(Ut=dt.label)}}d.view.componentProps.categoryView=[{id:mt,name:Ut}]}(((He=V.value[ct])==null?void 0:He.options)||[]).find(Ut=>Ut.value==mt),t.nextTick(()=>{T.value=[...T.value]})}}if(d.view.filterMultiple.teamType!==void 0){const ct=V.value.findIndex(mt=>mt.type==="radio-button");if(ct!==-1){const mt=d.view.filterMultiple.teamType;T.value[ct]=mt,((($e=V.value[ct])==null?void 0:$e.options)||[]).find(Ut=>Ut.value==mt),t.nextTick(()=>{T.value=[...T.value]})}}}if(((ut=_.value)==null?void 0:ut.id)===1&&(xt=d==null?void 0:d.view)!=null&&xt.filterMultiple&&d.view.filterMultiple.category&&V.value.findIndex(ct=>ct.type==="select-simple"&&ct.label==="Tipo de análisis")!==-1){const ct=d.view.filterMultiple.category;T.value[0]=ct,d.view.componentProps&&ct&&(d.view.componentProps.type=ct),t.nextTick(()=>{T.value=[...T.value]})}if(((_t=_.value)==null?void 0:_t.id)===6&&(Rt=d==null?void 0:d.view)!=null&&Rt.filterMultiple&&d.view.filterMultiple.gameNumber&&V.value.findIndex(ct=>ct.type==="select-simple"&&ct.label==="Número de juego")!==-1){const ct=d.view.filterMultiple.gameNumber;T.value[0]=ct,d.view.componentProps&&ct&&(d.view.componentProps.gameNumber=ct),t.nextTick(()=>{T.value=[...T.value]})}if(((Xt=_.value)==null?void 0:Xt.id)===5&&(It=d==null?void 0:d.view)!=null&&It.filterMultiple&&d.view.filterMultiple.isHomeTeam!==void 0)if(V.value.findIndex(ct=>ct.type==="radio-button"&&ct.label==="Equipo")!==-1){const ct=d.view.filterMultiple.isHomeTeam;let mt;typeof ct=="boolean"?mt=ct?1:2:typeof ct=="number"?mt=ct===1?1:2:mt=1,T.value[0]=mt,d.view.componentProps&&ct!==void 0&&(d.view.componentProps.isHomeTeamForAnalysis=ct===1),t.nextTick(()=>{T.value=[...T.value]})}else{const ct=V.value.findIndex(mt=>mt.type==="radio-button");if(ct!==-1){const mt=d.view.filterMultiple.isHomeTeam;let Ut;typeof mt=="boolean"?Ut=mt?1:2:typeof mt=="number"?Ut=mt===1?1:2:Ut=1,T.value[ct]=Ut,d.view.componentProps&&mt!==void 0&&(d.view.componentProps.preMatchType=mt),t.nextTick(()=>{T.value=[...T.value]})}}if(((lt=_.value)==null?void 0:lt.id)===15&&(et=d==null?void 0:d.view)!=null&&et.filterMultiple&&d.view.filterMultiple.isHomeTeam!==void 0){const ct=V.value.findIndex(mt=>mt.type==="radio-button");if(ct!==-1){const mt=d.view.filterMultiple.isHomeTeam;console.log("Strengths forceRadioFilterUpdate - isHomeTeam:",mt,"type:",typeof mt);let Ut;typeof mt=="boolean"?Ut=mt?1:2:typeof mt=="number"?Ut=mt===1?1:2:Ut=1,console.log("Strengths forceRadioFilterUpdate - teamValue calculado:",Ut,"teamFilterIndex:",ct),T.value[ct]=Ut,d.view.componentProps&&mt!==void 0&&(d.view.componentProps.preMatchType=Ut),t.nextTick(()=>{T.value=[...T.value],console.log("Strengths forceRadioFilterUpdate - dynamicFilters.value después:",T.value)})}else{const mt=V.value.findIndex(Ut=>Ut.type==="radio-button");if(mt!==-1){const Ut=d.view.filterMultiple.isHomeTeam;let Nt;typeof Ut=="boolean"?Nt=Ut?1:2:typeof Ut=="number"?Nt=Ut===1?1:2:Nt=1,T.value[mt]=Nt,d.view.componentProps&&Ut!==void 0&&(d.view.componentProps.preMatchType=Nt),t.nextTick(()=>{T.value=[...T.value]})}}}t.nextTick(()=>{p.value=!1,o.value=!1})}}function me(){if(!o.value&&a.value&&l&&l.dynamicFilters&&V.value){if(v.value)return;o.value=!0,p.value=!0,l.dynamicFilters.forEach((ye,ze)=>{var Me;if(ye&&((Me=V.value[ze])==null?void 0:Me.type)==="radio-button"&&ye.selectedOption&&ye.selectedOption.value!==void 0){const je=ye.selectedOption.value;T.value[ze]=je}}),t.nextTick(()=>{p.value=!1,o.value=!1})}}function Le(){var ye,ze,Me,je,He,$e,ut,xt,_t,Rt,Xt,It,lt,et,ct,mt,Ut,Nt,it,dt,Ze,pt,kt,vt,St,Lt,nt,rt,wt,Mt,Ft,Ct,Ht;if(i&&a.value&&d){if(v.value)return;if(p.value=!0,((ye=_.value)==null?void 0:ye.id)===4){if(i.setDynamicFilters(T.value,(ze=d.view)==null?void 0:ze.id),i.updateDynamicFilters(T.value,(Me=d.view)==null?void 0:Me.id),d.view.componentProps&&T.value&&T.value.length>0){const Kt=T.value[0];if(Array.isArray(Kt)&&Kt.length>0){const Yt=Kt.some(sr=>sr.event_type_id===1||typeof sr=="string"&&sr.includes("1")),Gt=Kt.some(sr=>sr.category_id===8||typeof sr=="string"&&sr.includes("8")),Jt=Kt.some(sr=>sr.category_id===9||typeof sr=="string"&&sr.includes("9")),or=Kt.some(sr=>sr.event_type_id===3||typeof sr=="string"&&sr.includes("3"));d.view.componentProps.selectedEvents=Kt,d.view.componentProps.goals=Yt,d.view.componentProps.yellowCards=Gt,d.view.componentProps.redCards=Jt,d.view.componentProps.substitutions=or,d.view.componentProps.key=Kt.length>0,d.view.componentProps._updateKey=Date.now(),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps})}}}else if(((je=_.value)==null?void 0:je.id)===8)i.setDynamicFilters(T.value,(He=d.view)==null?void 0:He.id),i.updateDynamicFilters(T.value,($e=d.view)==null?void 0:$e.id);else if(((ut=_.value)==null?void 0:ut.id)===3)i.setDynamicFilters(T.value,(xt=d.view)==null?void 0:xt.id),i.updateDynamicFilters(T.value,(_t=d.view)==null?void 0:_t.id);else if(((Rt=_.value)==null?void 0:Rt.id)===13){const Kt=(Xt=d.view)==null?void 0:Xt.id;i.setDynamicFilters(T.value,Kt),i.updateDynamicFilters(T.value,Kt),d.view.componentProps&&(d.view.componentProps._updateKey=Date.now(),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps}))}else if(((It=_.value)==null?void 0:It.id)===15){const Kt=(lt=d.view)==null?void 0:lt.id;if(i.setDynamicFilters(T.value,Kt),i.updateDynamicFilters(T.value,Kt),d.view.componentProps){const Yt=Array.isArray(T.value)&&T.value[3]!==void 0?T.value[3]:null;Yt!==null&&(d.view.componentProps.numitems=Yt),d.view.componentProps._updateKey=Date.now(),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps})}}else if(((et=_.value)==null?void 0:et.id)===2){i.setDynamicFilters(T.value,(ct=d.view)==null?void 0:ct.id),i.updateDynamicFilters(T.value,(mt=d.view)==null?void 0:mt.id);const Kt=T.value[0];if(Kt!==void 0&&(d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.categoryId,d.view.filterMultiple.categoryId=Kt,d.view.componentProps)){let Gt=`Category ${Kt}`,Jt=null;try{Jt=Jh(Kt),Jt&&(Gt=Jt.name)}catch{const or=V.value.findIndex(sr=>sr.type==="select-simple"&&sr.label==="Tipo de análisis");if(or!==-1){const sr=(((Ut=V.value[or])==null?void 0:Ut.options)||[]).find(qr=>qr.value==Kt);sr&&(Gt=sr.label)}}d.view.componentProps.categoryView=[{id:Kt,name:Gt}],Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple})}const Yt=T.value[1];Yt!==void 0&&(d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.teamType,d.view.filterMultiple.teamType=Yt,d.view.componentProps&&d.view.componentProps.game&&(Yt===1?d.view.componentProps.teamView=d.view.componentProps.game.homeTeam.team_id:Yt===2?d.view.componentProps.teamView=d.view.componentProps.game.awayTeam.team_id:d.view.componentProps.teamView=0),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}))}else if(((Nt=_.value)==null?void 0:Nt.id)===1){i.setDynamicFilters(T.value,(it=d.view)==null?void 0:it.id),i.updateDynamicFilters(T.value,(dt=d.view)==null?void 0:dt.id);const Kt=T.value[0];Kt!==void 0&&(d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.category,d.view.filterMultiple.category=Kt,d.view.componentProps&&(d.view.componentProps.type=Kt),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}))}else if(((Ze=_.value)==null?void 0:Ze.id)===6){i.setDynamicFilters(T.value,(pt=d.view)==null?void 0:pt.id),i.updateDynamicFilters(T.value,(kt=d.view)==null?void 0:kt.id);const Kt=T.value[0];Kt!==void 0&&(d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.gameNumber,d.view.filterMultiple.gameNumber=Kt,d.view.componentProps&&(d.view.componentProps.gameNumber=Kt,d.view._updateKey,d.view._updateKey=Date.now()),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}),Un.emit("dynamic-filters-changed",{containerViewId:(vt=_.value)==null?void 0:vt.id,viewId:d.view.id,dynamicFilters:T.value}),Un.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:T.value}),t.nextTick(()=>{d.view.componentProps&&(d.view.componentProps={...d.view.componentProps})}))}else if(((St=_.value)==null?void 0:St.id)===7){i.setDynamicFilters(T.value,(Lt=d.view)==null?void 0:Lt.id),i.updateDynamicFilters(T.value,(nt=d.view)==null?void 0:nt.id);const Kt=T.value[0],Yt=T.value[1];if(Kt!==void 0&&d.view.componentProps){const Gt=Kt===1?"offensive":"defensive";d.view.componentProps.analysisType=Gt}if(Yt!==void 0){d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.isHomeTeam;const Gt=Yt===1;d.view.filterMultiple.isHomeTeam=Gt,d.view.componentProps&&(d.view.componentProps.isHomeTeamForAnalysis=Gt,d.view._updateKey,d.view._updateKey=Date.now()),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}),Un.emit("dynamic-filters-changed",{containerViewId:(rt=_.value)==null?void 0:rt.id,viewId:d.view.id,dynamicFilters:T.value}),Un.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:T.value}),t.nextTick(()=>{d.view.componentProps&&(d.view.componentProps={...d.view.componentProps})})}}else if(((wt=_.value)==null?void 0:wt.id)===5){i.setDynamicFilters(T.value,(Mt=d.view)==null?void 0:Mt.id),i.updateDynamicFilters(T.value,(Ft=d.view)==null?void 0:Ft.id);const Kt=T.value[0];if(Kt!==void 0){d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.isHomeTeam;const Yt=Kt===1?1:2;d.view.filterMultiple.isHomeTeam=Yt,d.view.componentProps&&(d.view.componentProps.isHomeTeamForAnalysis=Yt===1,d.view._updateKey,d.view._updateKey=Date.now()),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}),Un.emit("dynamic-filters-changed",{containerViewId:(Ct=_.value)==null?void 0:Ct.id,viewId:d.view.id,dynamicFilters:T.value}),Un.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:T.value}),t.nextTick(()=>{d.view.componentProps&&(d.view.componentProps={...d.view.componentProps})})}}else((Ht=_.value)==null?void 0:Ht.id)===9||(i.setDynamicFilters(T.value),i.updateDynamicFilters(T.value));t.nextTick(()=>{p.value=!1})}}function ke(){var ye,ze;if(!l||!l.dynamicFilters||!V.value)return!1;for(let Me=0;Me<l.dynamicFilters.length;Me++){const je=l.dynamicFilters[Me],He=V.value[Me],$e=T.value[Me];if(!(!je||!He)){if(He.type==="check"){if(je.isChecked!==$e)return!0}else if(He.type==="radio-button"){if(((ye=je.selectedOption)==null?void 0:ye.value)!==$e)return!0}else if(He.type==="select"){const ut=((ze=je.selectedOptions)==null?void 0:ze.map(_t=>_t.value))||je.selectedValue||[],xt=Array.isArray($e)?$e:[];if(JSON.stringify(ut)!==JSON.stringify(xt))return!0}}}return!1}function Xe(ye){var ze,Me,je,He,$e,ut,xt,_t,Rt,Xt,It,lt,et,ct,mt,Ut;if(T.value=ye.filters,i){const Nt=((ze=d==null?void 0:d.view)==null?void 0:ze.id)||null;i.setDynamicFilters(T.value,Nt),i.updateDynamicFilters(T.value,Nt)}if(a.value&&d&&(Un.emit("activate-save-button"),Un.emit("force-component-update",{itemId:((Me=d==null?void 0:d.view)==null?void 0:Me.id)||null,componentProps:d.view.componentProps}),Un.emit("dynamic-filters-changed",{containerViewId:((je=d==null?void 0:d.view)==null?void 0:je.id)||null,viewId:((He=d==null?void 0:d.view)==null?void 0:He.id)||null,dynamicFilters:T.value}),Un.emit("dynamic-filters-changed",{containerViewId:(($e=d==null?void 0:d.view)==null?void 0:$e.id)||null,viewId:((ut=d==null?void 0:d.view)==null?void 0:ut.id)||null,dynamicFilters:T.value}),t.nextTick(()=>{d.view.componentProps&&(d.view.componentProps={...d.view.componentProps})})),!a.value&&i&&((xt=_.value)==null?void 0:xt.id)===15&&i.getRequiresAddView(T.value)){i.setDynamicFilters(T.value),R("filters-changed",{main:u.value,view:_.value,team:P.value,dynamicFilters:T.value,filtersJSON:{mainSelector:{id:((_t=u.value)==null?void 0:_t.id)||null,name:((Rt=u.value)==null?void 0:Rt.name)||null,url:((Xt=u.value)==null?void 0:Xt.url)||null},viewSelector:{id:((It=_.value)==null?void 0:It.id)||null,name:((lt=_.value)==null?void 0:lt.name)||((et=_.value)==null?void 0:et.title)||null,url:((ct=_.value)==null?void 0:ct.url)||null},team:P.value,dynamicFilters:T.value,timestamp:new Date().toISOString(),summary:{mainSelected:!!u.value,viewSelected:!!_.value,totalDynamicFilters:((mt=V.value)==null?void 0:mt.length)||0,activeFilters:((Ut=V.value)==null?void 0:Ut.filter((Nt,it)=>{const dt=T.value[it];return Array.isArray(dt)?dt.length>0:dt!=null&&dt!==!1}).length)||0}},filterAndViewsContainer:i,viewToEdit:d}),ne();return}Le()}function Ae(ye){ye.filterIndex!==void 0&&ye.value!==void 0&&(T.value[ye.filterIndex]=ye.value,a.value&&Le(),ne())}function Ie(){qe()}function Je(ye){var ze,Me,je,He,$e,ut,xt;console.log("newFilters in onChangeFiltersAltMode:",ye);const _t={mainSelector:{id:((ze=u.value)==null?void 0:ze.id)||null,name:((Me=u.value)==null?void 0:Me.name)||null,url:((je=u.value)==null?void 0:je.url)||null},viewSelector:{id:((He=_.value)==null?void 0:He.id)||null,name:(($e=_.value)==null?void 0:$e.name)||((ut=_.value)==null?void 0:ut.title)||null,url:((xt=_.value)==null?void 0:xt.url)||null}};R("filters-changed",{filters:ye.filters,view:ye.view,viewToEdit:d,filterAndViewsContainer:i,filtersJSON:_t,isAltMode:!0})}function Qe(ye){return JSON.parse(JSON.stringify(ye))}return(ye,ze)=>(t.openBlock(),t.createElementBlock("div",GLe,[t.createElementVNode("button",JLe,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:G},[t.createElementVNode("div",ZLe,[t.createElementVNode("span",HLe,[u.value?(t.openBlock(),t.createElementBlock("img",{key:0,src:D(u.value.name,!1),alt:"icono",class:"option-img"},null,8,YLe)):(t.openBlock(),t.createElementBlock("img",QLe))]),u.value?(t.openBlock(),t.createElementBlock("span",eOe,t.toDisplayString(Y()),1)):(t.openBlock(),t.createElementBlock("span",$Le,"Tipo de vista")),t.createElementVNode("span",{class:t.normalizeClass([{open:F.value},"arrow"])},[...ze[5]||(ze[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)]),F.value?(t.openBlock(),t.createElementBlock("div",tOe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.value,(Me,je)=>(t.openBlock(),t.createElementBlock("div",{key:Me.id,class:t.normalizeClass([{active:f.value===je},"option-card"]),onClick:t.withModifiers(He=>ee(je),["stop"])},[t.createElementVNode("div",aOe,[t.createElementVNode("img",{"data-hover-src":D(Me.name,!0),src:D(Me.name,!1),alt:"icono",class:"option-img-34"},null,8,nOe)]),t.createElementVNode("div",iOe,[t.createElementVNode("div",oOe,t.toDisplayString(Me.name),1),Me.description?(t.openBlock(),t.createElementBlock("div",sOe,t.toDisplayString(Me.description),1)):t.createCommentVNode("",!0)])],10,rOe))),128))])):t.createCommentVNode("",!0)],2),u.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([{disabled:a.value},"custom-select second-select"]),onClick:te},[t.createElementVNode("div",lOe,[t.createElementVNode("span",cOe,[_.value?(t.openBlock(),t.createElementBlock("img",{key:0,src:_.value.url,alt:"icono",class:"option-img-graph2"},null,8,uOe)):u.value?(t.openBlock(),t.createElementBlock("img",{key:1,src:D(u.value.name,!1),alt:"icono",class:"option-img"},null,8,dOe)):t.createCommentVNode("",!0)]),t.createElementVNode("span",pOe,t.toDisplayString(re()),1),t.createElementVNode("span",{class:t.normalizeClass([{open:W.value},"arrow"])},[...ze[6]||(ze[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)]),W.value&&u.value?(t.openBlock(),t.createElementBlock("div",hOe,[t.createElementVNode("div",fOe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.value,Me=>(t.openBlock(),t.createElementBlock("div",{key:Me.id,class:t.normalizeClass([{active:w.value===Me.id},"option-card-grid"]),onClick:t.withModifiers(je=>H(Me),["stop"])},[t.createElementVNode("div",yOe,t.toDisplayString(Me.name||Me.title),1),t.createElementVNode("div",gOe,[t.createElementVNode("img",{src:Me.url,alt:"icono",class:"option-img-grid"},null,8,vOe)])],10,mOe))),128))])])):t.createCommentVNode("",!0)],2)):t.createCommentVNode("",!0),_.value?(t.openBlock(),t.createElementBlock("div",bOe)):t.createCommentVNode("",!0),_.value&&_.value.id===13?(t.openBlock(),t.createBlock(dke,{key:2,"component-id":13,filters:V.value,"initial-values":a.value?t.unref(l).dynamicFilters:T.value,"is-edit-mode":a.value,onFiltersChanged:Xe,onFilterUpdated:Ae},null,8,["filters","initial-values","is-edit-mode"])):_.value&&_.value.id===16?(t.openBlock(),t.createBlock(SNe,{key:3,"default-filters":t.unref(d)?t.unref(d).view.filterMultiple:null,"is-edit-mode":!!t.unref(d),"is-post-match":e.isPostMatch,"view-config":Qe(y.value.get(16)),onChange:Je,onRemoveViews:Ie},null,8,["default-filters","is-edit-mode","is-post-match","view-config"])):_.value&&_.value.id===18?(t.openBlock(),t.createBlock(LVe,{key:4,"default-filters":t.unref(d)?t.unref(d).view.filterMultiple:null,"view-config":Qe(y.value.get(18)),onChange:Je,onRemoveViews:Ie},null,8,["default-filters","view-config"])):_.value&&_.value.id===15?(t.openBlock(),t.createBlock(Oke,{key:5,"component-id":15,filters:V.value,"initial-values":a.value?t.unref(l).dynamicFilters:T.value,"is-edit-mode":a.value,onFiltersChanged:Xe,onFilterUpdated:Ae},null,8,["filters","initial-values","is-edit-mode"])):_.value&&_.value.id===17?(t.openBlock(),t.createBlock(BLe,{key:6,"component-id":17,"default-filters":t.unref(d)?t.unref(d).view.filterMultiple:null,filters:V.value,"initial-values":a.value?t.unref(l).dynamicFilters:T.value,"is-edit-mode":a.value,"view-config":Qe(y.value.get(17)),onChange:Je,onFiltersChanged:Xe,onFilterUpdated:Ae,onRemoveViews:Ie},null,8,["default-filters","filters","initial-values","is-edit-mode","view-config"])):_.value&&V.value&&z()?(t.openBlock(),t.createElementBlock("div",{key:7,class:t.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":V.value.length>=2}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(V.value,(Me,je)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:je},[Me.type==="select"?(t.openBlock(),t.createElementBlock("div",{key:0,class:"custom-select dynamic-select filter-inline",onClick:t.withModifiers(He=>$(je),["stop"])},[t.createElementVNode("div",wOe,[ze[8]||(ze[8]=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)),ze[9]||(ze[9]=t.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),Array.isArray(T.value[je])&&T.value[je].length>0?(t.openBlock(),t.createElementBlock("span",_Oe,t.toDisplayString(T.value[je].length),1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass([{open:A.value===je},"arrow"])},[...ze[7]||(ze[7]=[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)]),A.value===je?(t.openBlock(),t.createElementBlock("div",SOe,[t.createElementVNode("div",TOe,[t.createElementVNode("div",{class:"multi-select-header",onClick:ze[1]||(ze[1]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("label",kOe,[t.createElementVNode("input",{checked:U(je),indeterminate:q(je),type:"checkbox",onChange:t.withModifiers(He=>k(je),["stop"]),onClick:ze[0]||(ze[0]=t.withModifiers(()=>{},["stop"]))},null,40,NOe),ze[10]||(ze[10]=t.createElementVNode("span",{class:"select-all-label"},"Agregar todas",-1))])]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Me.options,He=>(t.openBlock(),t.createElementBlock("div",{key:He.value,class:t.normalizeClass([{active:L(je,He.value)},"option-card multi-select-option"]),onClick:ze[2]||(ze[2]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",VOe,[t.createElementVNode("input",{checked:L(je,He.value),type:"checkbox",onChange:t.withModifiers($e=>O(je,He.value),["stop"])},null,40,LOe)]),t.createElementVNode("div",{class:"option-content",onClick:$e=>O(je,He.value)},[t.createElementVNode("div",qOe,t.toDisplayString(He.label),1)],8,OOe)],2))),128))]),t.createElementVNode("div",COe,[t.createElementVNode("button",{class:"btn-listo",onClick:ze[3]||(ze[3]=t.withModifiers(He=>Ee(),["stop"]))},"Listo")])])):t.createCommentVNode("",!0)],8,xOe)):Me.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",UOe,[t.createElementVNode("div",zOe,t.toDisplayString(Me.label),1),t.createElementVNode("div",EOe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Me.options,He=>(t.openBlock(),t.createElementBlock("label",{key:He.value,class:t.normalizeClass([{active:T.value[je]===He.value},"radio-option-card"])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":$e=>T.value[je]=$e,disabled:E(He.value,He.label),name:"dynamic-radio-"+je,value:He.value,type:"radio",onChange:()=>{var $e,ut,xt;if((($e=_.value.value)==null?void 0:$e.id)===9&&a.value.value&&(xt=(ut=t.unref(d))==null?void 0:ut.view)!=null&&xt.filterMultiple){const _t=T.value[je]===1;t.unref(d).view.filterMultiple.isHomeTeam=_t}a.value.value&&Le(),ne()}},null,40,POe),[[t.vModelRadio,T.value[je]]]),t.createElementVNode("span",null,t.toDisplayString(He.label),1)],2))),128))])])):Me.type==="check"?(t.openBlock(),t.createElementBlock("div",ROe,[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":He=>T.value[je]=He,checked:T.value[je],type:"checkbox",onChange:ze[4]||(ze[4]=()=>{a.value.value&&Le(),ne()})},null,40,MOe),[[t.vModelCheckbox,T.value[je]]]),t.createTextVNode(" "+t.toDisplayString(Me.label),1)])])):Me.type==="select-simple"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-filter-type":Me.type,class:"custom-select dynamic-select filter-inline",onClick:t.withModifiers(He=>oe(je),["stop"])},[t.createElementVNode("div",jOe,[ze[12]||(ze[12]=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)),ze[13]||(ze[13]=t.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),t.createElementVNode("span",{class:t.normalizeClass([{open:X.value===je},"arrow"])},[...ze[11]||(ze[11]=[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)]),X.value===je?(t.openBlock(),t.createElementBlock("div",WOe,[t.createElementVNode("div",AOe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Me.options,He=>(t.openBlock(),t.createElementBlock("div",{key:He.value,class:t.normalizeClass([{active:T.value[je]===He.value},"option-card simple-select-option"]),onMouseenter:$e=>Re(je,He.value),onClick:t.withModifiers($e=>se(je,He.value),["stop"])},[t.createElementVNode("div",IOe,[t.createElementVNode("div",XOe,t.toDisplayString(He.label),1)]),T.value[je]===He.value?(t.openBlock(),t.createElementBlock("div",DOe,[...ze[14]||(ze[14]=[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,KOe))),128))])])):t.createCommentVNode("",!0)],8,FOe)):t.createCommentVNode("",!0),je===1&&V.value.length>2?(t.openBlock(),t.createElementBlock("div",BOe)):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:qe},"Cancelar")),S.value?(t.openBlock(),t.createElementBlock("button",{key:9,class:"ok-btn",onClick:_e},"OK")):t.createCommentVNode("",!0)]))}}),JOe=pc(GOe,[["__scopeId","data-v-39dca05e"]]),ZOe={key:0,class:"modal-simple"},HOe={class:"modal-simple__content"},YOe={class:"modal-simple__content__header"},QOe={class:"modal-simple__content__body"},$Oe={class:"modal-simple__content__footer"},eqe={__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",ZOe,[t.createElementVNode("div",HOe,[t.createElementVNode("div",YOe,[t.renderSlot(r.$slots,"header",{},void 0,!0)]),t.createElementVNode("div",QOe,[t.renderSlot(r.$slots,"body",{},void 0,!0)]),t.createElementVNode("div",$Oe,[t.renderSlot(r.$slots,"footer",{},void 0,!0)])])])):t.createCommentVNode("",!0)]))}},tqe=pc(eqe,[["__scopeId","data-v-1cc4f590"]]),rqe={class:"footer"},aqe={__name:"ModalCautionClose",props:{value:{type:Boolean,default:!1}},emits:["update:modelValue","action"],setup(e,{emit:r}){const n=r;function b(y){n("update:modelValue",y)}function R(y){n("action",y),n("update:modelValue",!1)}return(y,c)=>(t.openBlock(),t.createBlock(tqe,{"modle-value":e.value,"onUpdate:modelValue":b},{header:t.withCtx(()=>[...c[2]||(c[2]=[t.createElementVNode("div",{class:"header"},"Descartar template",-1)])]),body:t.withCtx(()=>[...c[3]||(c[3]=[t.createElementVNode("div",{class:"body"},"¿Estás seguro que deseas abandonar el proceso?",-1)])]),footer:t.withCtx(()=>[t.createElementVNode("div",rqe,[t.createElementVNode("div",{role:"button",class:"btn btn-cancel",onClick:c[0]||(c[0]=i=>R(!1))}," Seguir editando "),t.createElementVNode("div",{role:"button",class:"btn btn-confirm",onClick:c[1]||(c[1]=i=>R(!0))}," Descartar ")])]),_:1},8,["modle-value"]))}},nqe=pc(aqe,[["__scopeId","data-v-ed9b5088"]]),iqe={key:0,class:"modal-simple"},oqe={__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",iqe,[...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})]))}},sqe=pc(oqe,[["__scopeId","data-v-2bc30783"]]),lqe={class:"template-maker__header"},cqe={key:0,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},uqe={class:"template-maker__content"},dqe={class:"template-maker__content__main"},pqe={id:"containerMain",class:"container-main"},hqe={class:"template-maker__content__main__cover-selector"},fqe=["id"],mqe={class:"page-indicator"},yqe={class:"page-indicator__index"},gqe=["onClick"],vqe=["onClick"],bqe={key:0,class:"template-maker__content__main__footer"},xqe={class:"template-maker__content__main__footer__paginator"},wqe={class:"template-maker__content__main__footer__paginator__nav"},_qe={class:"template-maker__content__main__footer__paginator__numbers"},Sqe=["onClick"],Tqe={__name:"GSC-TemplateReportMaker",props:{token:{type:String,default:""},userTeamId:{type:Number,default:0}},emits:["close"],setup(e,{expose:r,emit:n}){const b=new Map,R=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:{}}]}]),y=t.ref(null),c=t.ref(0),i=t.ref(!1),d=t.ref(null),l=t.ref(null),a=t.ref(!0),S=t.ref(!1),x=t.ref(!1),v=t.ref(0),p=t.ref(!1),o=t.ref(null),s=t.ref(new Map),f=t.ref(null),u=t.ref(null),m=t.ref(!1),w=t.ref(!1),_=t.ref(!1),T=new Map,V=t.computed(()=>({"--overflow-y-template-maker":S.value?"scroll":"hidden","--height-container-main":S.value?"fit-content":"calc(100vh - 64px)","--margin-bottom-container-main":(S.value,"0")})),L=t.computed(()=>c.value+1);t.watch(()=>i.value,Te=>{const Pe=document.getElementById("app");Te?(c.value=0,document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",Pe&&(Pe.style.overflow="hidden")):(document.body.style.overflow="",document.documentElement.style.overflow="",Pe&&(Pe.style.overflow=""))});function O(Te){return Te<10?`0${Te}`:Te}async function U({templateId:Te,userId:Pe}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Pe}/templates/${Te}`,{method:"GET",headers:{Authorization:se.token}})).json()).data}catch(Ne){console.error("Error fetching template by ID:",Ne)}}async function q({reportId:Te,userId:Pe}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Pe}/reports/${Te}`,{method:"GET",headers:{Authorization:se.token}})).json()).data}catch(Ne){console.error("Error fetching report by ID:",Ne)}}let z=0;function C(Te){y.value=Te,z>0&&(m.value=!0),z++}function N(Te){Te&&ne(null,!0)}let E=null;function k(Te,Pe){let Ne=Te.getBoundingClientRect(),Fe={height:Te.clientHeight,width:Te.clientWidth},Ue=Pe.getBoundingClientRect();if(!(Ue.top>=Ne.top&&Ue.bottom<=Ne.top+Fe.height)){const me=Ue.top-Ne.top,Le=Ue.bottom-Ne.bottom;Math.abs(me)<Math.abs(Le)?Te.scrollTop+=me:Te.scrollTop+=Le}}function P(Te,Pe){let Ne=Te.getBoundingClientRect();const Fe=Pe.getBoundingClientRect().top-Ne.top;Te.scrollTop+=Fe}function F(Te,Pe=!1){const Ne={title:`Page ${R.value.length+1}`,id:`p-${Date.now()}`,items:[]};if(_e(),Te!==void 0&&Te>=-1?R.value.splice(Te+1,0,Ne):R.value.push(Ne),t.nextTick(()=>{const Fe=R.value.findIndex(me=>me.id===Ne.id),Ue=document.getElementById(`page-${Fe+1}`);E||(E=document.getElementById("containerMain")),Ue&&E?k(E,Ue):console.error("Page element or container main element not found")}),Pe)return Ne;m.value=!0}function W(Te){if(Te<0||Te>R.value.length)return;c.value=Te;const Pe=document.getElementById(`page-${Te}`);if(E||(E=document.getElementById("containerMain")),Pe&&E){const Ne=new CustomEvent("programmatic-scroll-start");document.dispatchEvent(Ne),P(E,Pe),setTimeout(()=>{const Fe=new CustomEvent("programmatic-scroll-end");document.dispatchEvent(Fe)},300)}else console.error("Page element or container main element not found")}function A(Te){f.value=Te,p.value=!0}function X(Te,Pe){const Ne=Pe+1;Te&&c.value!==Ne&&(c.value=Ne)}function D(Te){p.value=!0,Un.emit("edit-view",{view:Te})}async function Y({templateReportId:Te,userId:Pe,isTemplateMode:Ne}){try{return Ne?U({templateId:Te,userId:Pe}):q({reportId:Te,userId:Pe})}catch(Fe){throw new Error("Error fetching template or report by ID: "+Fe.message)}}function re(){z=0,p.value=!1,c.value=0,f.value=null,u.value=null,s.value.clear(),E=null}let G=[];async function te(Te){if(re(),a.value=Te.isTemplateMode,S.value=!!Te.isPDFMode,Te.isPDFMode?d.value=await q({reportId:Te.reportId,userId:Te.userId}):(d.value=Te.template,d.value=await Y({templateReportId:Te.template.id,userId:Te.template.user_id,isTemplateMode:Te.isTemplateMode})),!d.value)return;d.value&&d.value.game&&(d.value.game=he(d.value.game)),l.value=JSON.parse(JSON.stringify(d.value)),x.value=d.value.template_type===2;const Pe=d.value.pages.find(Ne=>Ne.is_front_page);v.value=Pe?Pe.type:1,i.value=!0,console.log("isTemplateMode:",a.value),Te.isTemplateMode||(G=await oe(d.value),console.log("specificPlaysCorners fetched:",G)),R.value=d.value.pages.reduce((Ne,Fe,Ue)=>{if(!Fe.is_front_page){Fe.name||(Fe.name="");const me=Ue,Le={originalPage:JSON.parse(JSON.stringify(Fe)),title:Fe.name,id:`p-${Date.now()-Ue*9}`,items:[],components:Fe.components};Fe.components&&Fe.components.length>0&&(Le.items=Fe.components.map((ke,Xe)=>{const Ae=new p1(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],ke.coreView.id,ke.dynamicFilters,x.value,a.value,ke.filtersJSON||null,se.token,ke.filters),Ie={originalComponent:JSON.parse(JSON.stringify(ke)),title:ke.title,shortTitle:ke.shortTitle||ke.title,game:d.value.game,idAux:ke.id,id:`w-${Date.now()-Xe*7}`,x:ke.column,y:ke.row,w:ke.colspan,h:ke.rowspan,maxWidth:ke.max_column,maxHeight:ke.max_row,minWidth:ke.min_column,minHeight:ke.min_row,noResize:!a.value,noMove:!a.value,coreView:ke.coreView||null,isTemplateMode:a.value,componentName:ke.componentName,componentProps:$({currentProps:ke.componentProps,coreView:ke.coreView,isTemplateMode:a.value,templateToEdit:d.value,filterMultiple:ke.filterMultiple||null,game:d.value.game||null,dynamicFilters:ke.dynamicFilters,page:me,componentId:Xe})||{},filterMultiple:ke.filterMultiple,isHomeTeam:H({game:d.value.game,isTemplateMode:a.value,currentIsHomeTeam:ke.isHomeTeam||ke.componentProps.isHomeTeamForAnalysis}),filtersJSON:ke.filtersJSON||null,dynamicFilters:ke.dynamicFilters||[],filterAndViewsContainer:Ae},Je=t.reactive({view:Ie});return Ae.addView(Je,!0),s.value.set(Ae.getId(),Ae),Ie})),Ne.push(Le)}return Ne},[]),console.log("Pages loaded into template maker:",R.value)}function ee({game:Te,isTemplateMode:Pe}){const Ne=Te&&Te.homeTeam&&Te.awayTeam&&(Te.homeTeam.team_id===se.userTeamId||Te.awayTeam.team_id===se.userTeamId);return{isUserTeamHome:Ne&&Te.homeTeam.team_id===se.userTeamId,requiresUserTeamAdjustment:Ne&&!Pe}}function H({game:Te,isTemplateMode:Pe,currentIsHomeTeam:Ne}){const{isUserTeamHome:Fe,requiresUserTeamAdjustment:Ue}=ee({game:Te,isTemplateMode:Pe});return Ue?Ne?Fe:!Fe:Ne}function $({currentProps:Te,coreView:Pe,templateToEdit:Ne,isTemplateMode:Fe,filterMultiple:Ue,game:me,dynamicFilters:Le,page:ke,componentId:Xe}){if(!Te||!Pe)return Te||{};const{isUserTeamHome:Ae,requiresUserTeamAdjustment:Ie}=ee({game:me,isTemplateMode:Fe});console.log("currentProps:",Te);let Je={...Te};if(Pe.id===5&&(Je.isGhostEffect=Fe,Ie)){const Qe=Je.preMatchType===1;Je.preMatchType=Qe?Ae?1:2:Ae?2:1}if(Pe.id===7&&Ie){const Qe=Je.isHomeTeamForAnalysis;Je.isHomeTeamForAnalysis=Qe?Ae:!Ae}if(Pe.id===9&&Ie){const Qe=Je.isHomeTeamForAnalysis;Je.isHomeTeamForAnalysis=Qe?Ae:!Ae}if(Pe.id===18){if(console.log("1818181818181818181818181818181818181818"),console.log("currentProps:",Te),console.log("coreView:",Pe),console.log("templateToEdit:",Ne),console.log("isTemplateMode:",Fe),console.log("filterMultiple:",Ue),console.log("game:",me),console.log("dynamicFilters:",Le),!Fe&&Ie){const Qe=Je.isHomeTeamForAnalysis;Je.isHomeTeamForAnalysis=Qe?Ae:!Ae}if(!Fe){console.log("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"),console.log("specificPlaysCorners before shift:",G);const Qe=G.shift();console.log("specificPlaysCorner:",Qe),Qe?(Je.specificPlaysCornersData=Qe,Je.teamIdForAnalysis=Je.isHomeTeamForAnalysis?me.home_team:me.visiting_team,Je.playIdForAnalysis=Qe.play_id,Je.gameIdForAnalysis=Qe.game_id,Je.seasonIdForAnalysis=me.season_id,Je.isTemplateMode=Fe,Je.isGameOnly=!0,console.log("propsAux for coreView.id 18:",Je)):console.warn("No specific plays corner data available for this component")}}if(Pe.id===16){if(!Fe&&Ie){const Qe=Je.isHomeTeamForAnalysis;Je.isHomeTeamForAnalysis=Qe?Ae:!Ae}if(!Fe){Je.isPreMatch=!x.value,Je.isTemplateMode=Fe,Je.seasonId=Ne.season_id,Je.teamIdForAnalysis=Je.isHomeTeamForAnalysis?Ne.game.home_team:Ne.game.visiting_team;const Qe=Je.isHomeTeamForAnalysis?Ne.last_games.last_home_games:Ne.last_games.last_visiting_games;x.value?Je.gamesIdsForAnalysis=[Ne.game.game_id]:Je.howManyGames?Je.gamesIdsForAnalysis=Qe.slice(0,Je.howManyGames).map(ye=>ye.game_id):(Je.gamesIdsForAnalysis=[],Je.gameDataUTC=Ne.game.date_time_utc)}}if(Pe.id===10&&Ie){const Qe=Je.isHomeTeamForAnalysis;Je.isHomeTeamForAnalysis=Qe?Ae:!Ae}if(Pe.id===1&&(Je.gameId=me?me.id:"",Je.homeLogo=me?me.homeTeam.logo:"",Je.awayLogo=me?me.awayTeam.logo:"",Je.seasonId=me?me.season_id:0,Je.default=Fe),Pe.id===6&&(Je.game=me||"",Je.lastGames=Ne.last_games,Je.selectedOption=Ne.template_type===2?"Postmatch":"Prematch"),Pe.id===13&&(Je.isdefault=Fe,Je.seasonid=me?me.seasonId:2010,Je.datetimeutc=me?Ne.template_type===1?me?me.date_time_utc:"":null:"",Je.teamids=me?[me.home_team,me.visiting_team]:[1,2],Je.categoryids=Le?Le[1]:[20,2],Je.teamsshow=me?Le?Le[2]==1?[me.home_team]:Le[2]==2?[me.visiting_team]:[me.home_team,me.visiting_team]:[1,2]:[1,2],Je.analysistype=Le?Le[0]:[],Je.gameid=Ne.template_type===1?null:me?me.id:"",Je.teams=me?[{id:me.home_team,name:me.home_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+me.home_team+".png"},{id:me.visiting_team,name:me.visiting_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+me.visiting_team+".png"}]:[]),Pe.id===15&&(Je.view=1,Je.token=se.token,Je.numitems=Le?Le[1]:3,Je.isdefault=Fe,Je.reportid=Ne!=null&&Ne.id?Ne.id:0,Je.userid=Ne!=null&&Ne.user_id?Ne.user_id:0,Je.page=ke+1,Je.typegame=x.value?2:1,Je.componentid=Xe+1,Je.data={season:me?me.seasonId:2010,type:2,game:me?me.id:0,team:Fe?2:Ue?Ue.isHomeTeam?me.home_team||2:me.visiting_team||2:2}),Pe.id===14&&(Je.isReports=!0,Je.isDefault=Fe,Je.type=Ne.tournament_type==1?1:0,Je.typeView=1,Je.tournament=Ne.tournament_id,Je.currentSeason=me?me.season_id:0,Je.currentSeasonId=me?me.season_id:0,Je.showVideos=!1,Je.localTeam=me?me.home_team:0,Je.awayTeam=me?me.visiting_team:0),Pe.id===3&&(Je.defaultShields=Fe),Pe.id===2){let Qe=!0,ye=0,ze=0;me&&(Qe=Ne.main_team==me.home_team||Ne.main_team==me.visiting_team,ye=Qe?Ne.main_team==(me==null?void 0:me.home_team)?me==null?void 0:me.home_team:me==null?void 0:me.visiting_team:me==null?void 0:me.home_team,ze=Qe?Ne.main_team==(me==null?void 0:me.home_team)?me==null?void 0:me.visiting_team:me==null?void 0:me.home_team:me==null?void 0:me.visiting_team),Je.gamed=me?me.id:"",Je.game=me||"",Je.season=me?me.season_id:0,Je.teamView=Ue.teamType==3?0:Ue.teamType==1?ye:ze,Je.useDummyData=Fe}return Pe.id===8&&(Je.teamSelected=me?{teamId:me.home_team}:1,Je.isDefault=Fe),Pe.id===4&&(Je.gameId=me?me.id:"",Je.isDefault=Fe,Je.homeTeam=me?me==null?void 0:me.home_team:"",Je.awayTeam=me?me==null?void 0:me.visiting_team:""),Je}async function oe(Te){try{const Pe=await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Te.user_id}/reports/${Te.id}/specific-plays-corners`,{method:"GET",headers:{Authorization:se.token}})).json();return console.log("66666666666666666666666666666666666666"),console.log("data",Pe),Pe.data}catch(Pe){return console.error("Error fetching specific plays:",Pe),[]}}const se=e,ce=n;t.watch(()=>se.token,(Te,Pe)=>{},{immediate:!0}),r({show:te}),Un.on("add-page-view",Te=>{b.set(Te.view.id,Te.view);const Pe=R.value.find(Ne=>Ne.id===Te.pageId);Pe&&(Pe.items||(Pe.items=[]),Pe.items.push(Te.view),t.nextTick(()=>{const Ne=document.querySelector(`[gs-id="${Te.view.id}"]`);Te.grid.makeWidget(Ne)}))}),Un.on("add-page-and-view",Te=>{const Pe=R.value.findIndex(Ne=>Ne.id===Te.pageId);if(Pe>-1){const Ne=F(Pe,!0);setTimeout(()=>{Un.emit("add-view",{pageId:Ne.id,view:Te.view,filterAndWidgetContainer:Te.filterAndWidgetContainer}),u.value&&(Ne.stepBackPage=u.value),u.value=Ne},500)}else console.error("Page not found for adding view:",Te.pageId)}),Un.on("empty-page",Te=>{p.value&&f.value&&f.value.id===Te.id||(qe(Te),u.value&&u.value.id===Te.id&&(u.value.stepBackPage?u.value=u.value.stepBackPage:u.value=null))}),Un.on("filters-cancelled",Te=>{Te&&Te.removeAllChildViews()}),Un.on("activate-save-button",()=>{m.value=!0});function he(Te){return{...Te,gameId:Te.game_id,id:Te.game_id,seasonId:Te.season_id,status:Te.game_status,homeTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${Te.home_team}.png`,team_id:Te.home_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${Te.home_team}.png`,colloquial_name:Te.home_team_name,acronym:Te.home_team_acronym,team_name:Te.home_team_name},awayTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${Te.visiting_team}.png`,team_id:Te.visiting_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${Te.visiting_team}.png`,colloquial_name:Te.visiting_team_name,acronym:Te.visiting_team_acronym,team_name:Te.visiting_team_name}}}function ne(Te,Pe=!1){Pe||!a.value?(i.value=!1,re(),ce("close")):m.value?w.value=!0:(i.value=!1,re(),ce("close"))}function de(){o.value=null,p.value=!1}function ue({page:Te,view:Pe,applyMinimumSize:Ne=!1}){const Fe=Te.grid;if(!Te||!Pe||!Fe)return null;const Ue=Ne?{w:Pe.min_column,h:Pe.min_row}:{w:Pe.colspan,h:Pe.rowspan},me=Fe.willItFit(0,0,Ue.w,Ue.h,!0);return me?{willFit:me,applyMinimumSize:Ne}:Ne?null:ue({page:Te,view:Pe,applyMinimumSize:!0})}const ge=new Set([9]);function xe(Te){var Pe,Ne,Fe,Ue,me,Le,ke,Xe,Ae,Ie,Je,Qe,ye,ze;if(console.log("onFiltersChanged called with filters:",Te),Te.dynamicFilters&&Te.dynamicFilters.length>0&&Te.viewToEdit&&Te.viewToEdit.view){const Me=Te.viewToEdit.view.id;R.value.forEach(je=>{je.items.forEach(He=>{He.id===Me&&He.coreView&&He.coreView.id===3&&(He.componentProps.desplegable=Te.dynamicFilters[0]||!1,He.componentProps.key=Te.dynamicFilters[0]||!1,t.nextTick(()=>{Un.emit("force-component-update",{itemId:He.id,componentProps:He.componentProps})}))})})}if(Te.viewToEdit){if(!Te.viewToEdit.view.filterAndViewsContainer){const Me=new p1(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[Te.viewToEdit],((Pe=Te.viewToEdit.view.coreView)==null?void 0:Pe.id)||Te.viewToEdit.view.id,Te.dynamicFilters||[],x.value,a.value,Te.filtersJSON,se.token,Te.filters);Te.viewToEdit.view.filterAndViewsContainer=Me}Te.viewToEdit.view.filterAndViewsContainer.updateView({view:Te.viewToEdit,dynamicFilters:Te.dynamicFilters||[],filtersJSON:Te.filtersJSON||null,filters:Te.filters}),m.value=!0}else if(Te.view){Te.view.id&&Te.filterAndViewsContainer&&Te.view.id!==Te.filterAndViewsContainer.viewId&&(Te.filterAndViewsContainer.removeAllChildViews(),Te.filterAndViewsContainer.setViewId(Te.view.id),Te.filterAndViewsContainer.setFiltersJSON(Te.filtersJSON||null)),Te.view.id&&ge.has(Te.view.id)&&Te.dynamicFilters[0]&&Te.dynamicFilters[0].length===0&&Te.filterAndViewsContainer&&(Te.filterAndViewsContainer.updateDynamicFilters(Te.dynamicFilters,(Fe=(Ne=Te.viewToEdit)==null?void 0:Ne.view)==null?void 0:Fe.id),m.value=!0);const Me=u.value||f.value,je=ue({page:Me,view:Te.view,applyMinimumSize:!1});Te.view.filtersJSON=Te.filtersJSON||null;const He=Te.filterAndViewsContainer,$e=R.value.findIndex(ut=>ut.id===Me.id);if(He){console.log("1111");const ut=Te.filterAndViewsContainer.getRequiresAddView(Te.dynamicFilters,Te.filters);if(((Ue=Te.view)==null?void 0:Ue.id)===15){const xt=(me=Te.filterAndViewsContainer)==null?void 0:me.getId();if(xt&&T.has(xt)){const _t=T.get(xt);clearTimeout(_t),T.delete(xt)}}if(ut){if(He.setFilters(Te.filters),He.setDynamicFilters(Te.dynamicFilters),je||$e===R.value.length-1){Un.emit("add-view",{pageId:Me.id,view:Te.view,filterAndWidgetContainer:He,avoidWillFit:!1,applyMinimumSize:je?je.applyMinimumSize:!1,dynamicFilters:Te.dynamicFilters,filters:Te.filters}),Te.filterAndViewsContainer.updateDynamicFilters(Te.dynamicFilters,(ke=(Le=Te.viewToEdit)==null?void 0:Le.view)==null?void 0:ke.id),m.value=!0;let xt=null;if(((Xe=Te.view)==null?void 0:Xe.id)===15?(t.nextTick(()=>{var _t;const Rt=Te.filterAndViewsContainer.getRequiresAddView(Te.dynamicFilters,Te.filters);((_t=Te.dynamicFilters)==null?void 0:_t[0])===3&&Rt&&xe(Te)}),xt=setTimeout(()=>{var _t,Rt;const Xt=(_t=Te.filterAndViewsContainer)==null?void 0:_t.getId();Xt&&T.delete(Xt),console.log("222222222222222222");const It=Te.filterAndViewsContainer.getRequiresAddView(Te.dynamicFilters);((Rt=Te.dynamicFilters)==null?void 0:Rt[0])===3&&It&&xe(Te)},200)):(console.log("33333333333333"),xt=setTimeout(()=>{Te.filterAndViewsContainer.getRequiresAddView(Te.dynamicFilters,Te.filters)&&xe(Te)},1e3)),((Ae=Te.view)==null?void 0:Ae.id)===15&&xt){const _t=(Ie=Te.filterAndViewsContainer)==null?void 0:Ie.getId();_t&&T.set(_t,xt)}}}else Te.isAltMode?Te.viewToEdit||Te.filterAndViewsContainer.updateFilters(Te.filters,(Qe=(Je=Te.viewToEdit)==null?void 0:Je.view)==null?void 0:Qe.id):Te.filterAndViewsContainer.updateDynamicFilters(Te.dynamicFilters,(ze=(ye=Te.viewToEdit)==null?void 0:ye.view)==null?void 0:ze.id),m.value=!0}else if(je||$e===R.value.length-1){const ut=new p1(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],Te.view.id,Te.dynamicFilters,x.value,a.value,Te.filtersJSON,se.token,Te.filters);Un.emit("set-filter-and-views-container",ut),s.value.set(ut.getId(),ut),Te.dynamicFilters&&Array.isArray(Te.dynamicFilters[0])?(Te.filterAndViewsContainer=ut,xe(Te)):Un.emit("add-view",{pageId:Me.id,view:Te.view,filterAndWidgetContainer:ut,avoidWillFit:!1,applyMinimumSize:je?je.applyMinimumSize:!1,dynamicFilters:Te.dynamicFilters,filters:Te.filters}),m.value=!0}}}async function be(){if(m.value)try{const Te=[{is_front_page:!0,template_type:y.value.isPostMatch?2:1,type:y.value.id},...R.value.map(Ne=>({columns:Ne.originalPage?Ne.originalPage.columns:12,rows:Ne.originalPage?Ne.originalPage.rows:12,gap:Ne.originalPage?Ne.originalPage.gap:10,name:Ne.title,width:Ne.originalPage?Ne.originalPage.width:968,height:Ne.originalPage?Ne.originalPage.height:702,components:Ne.items.reduce((Fe,Ue)=>(Ue.isDeleted||Fe.push({min_column:Ue.minWidth,min_row:Ue.minHeight,max_column:Ue.maxWidth,max_row:Ue.maxHeight,column:Ue.x,row:Ue.y,colspan:Ue.w,rowspan:Ue.h,name:Ue.name,title:Ue.title,titleShort:Ue.titleShort||Ue.title,dynamicFilters:Ue.filterAndViewsContainer.getComponentDynamicFilters(Ue.id)||Ue.filterAndViewsContainer.getDynamicFilters()||[],coreView:Ue.coreView||null,componentName:Ue.componentName,componentProps:Ue.componentProps||{},isHomeTeam:Ue.isHomeTeam||Ue.componentProps.isHomeTeamForAnalysis,filterMultiple:Ue.filterMultiple}),Fe),[])}))],Pe=await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${d.value.user_id}/templates/${d.value.id}/pages`,{method:"PATCH",headers:{Authorization:se.token},body:JSON.stringify({pages:Te})});_.value=!0,await Pe.json(),m.value=!1,setTimeout(()=>{_.value=!1},2e3)}catch(Te){console.error("Error saving template:",Te)}}function _e(){R.value.forEach(Te=>{Te.offListeners&&Te.offListeners()})}function qe(Te){const Pe=R.value.findIndex(Ne=>Ne.id===Te.id);Pe>-1&&(_e(),R.value=R.value.filter(Ne=>Ne.id!==Te.id),c.value>=Pe&&(c.value=Math.max(0,c.value-1)),m.value=!0)}function Ce(){m.value=!0}function Ee(Te){const Pe=R.value.find(Ne=>Ne.items.some(Fe=>Fe.id===Te.id));if(Pe){const Ne=Pe.items.find(Fe=>Fe.id===Te.id);Ne&&(Ne.isDeleted=!0,m.value=!0)}}function Re(Te){}return(Te,Pe)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(nqe,{modelValue:w.value,"onUpdate:modelValue":Pe[0]||(Pe[0]=Ne=>w.value=Ne),onAction:N},null,8,["modelValue"]),t.createVNode(sqe,{"model-value":_.value},null,8,["model-value"]),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[i.value&&d.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"template-maker",style:t.normalizeStyle(V.value)},[t.withDirectives(t.createVNode(JOe,{token:e.token,view:o.value,"is-post-match":x.value,onClose:de,onFiltersChanged:xe},null,8,["token","view","is-post-match"]),[[t.vShow,a.value&&p.value]]),t.createElementVNode("div",lqe,[t.createTextVNode(t.toDisplayString(d.value?d.value.name:"Nuevo template")+" ",1),t.createElementVNode("div",{class:"template-maker__header__close",onClick:ne},[S.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("svg",cqe,[...Pe[6]||(Pe[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",uqe,[Pe[13]||(Pe[13]=t.createElementVNode("div",{class:"template-maker__content__sidebar"},null,-1)),t.createElementVNode("div",dqe,[t.createElementVNode("div",pqe,[t.createElementVNode("div",hqe,[t.withDirectives(t.createVNode(HO,{"is-post-match":x.value,"initial-cover-id":v.value,onSelectCover:C},null,8,["is-post-match","initial-cover-id"]),[[t.vShow,a.value]])]),(t.openBlock(),t.createElementBlock("div",{class:"template-maker__content__main__pages",key:R.value.length},[y.value?(t.openBlock(),t.createBlock(J8e,{key:0,id:"page-0",game:d.value.game||null,"cover-id":y.value.id,"is-post-match":y.value.isPostMatch,onIntersectionChanged:Pe[1]||(Pe[1]=Ne=>X(Ne,-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":R.value.length===0?"30px":"0"})},[p.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:"new-items-buttons__add-page new-item-button",onClick:Pe[2]||(Pe[2]=Ne=>F(-1))},[...Pe[7]||(Pe[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(R.value,(Ne,Fe)=>(t.openBlock(),t.createElementBlock("div",{key:Fe,id:`page-${Fe+1}`,class:"template-maker__content__main__pages__page"},[t.createElementVNode("div",mqe,[t.createElementVNode("div",yqe,"Pag "+t.toDisplayString(O(Fe+2)),1)]),y.value?(t.openBlock(),t.createBlock(H9e,{key:0,page:Ne,"is-template-mode":a.value,"is-post-match":y.value.isPostMatch,game:d.value.game||null,lastGames:d.value.lastGames||[],"is-filter-visible":p.value,onEditView:D,onIntersectionChanged:Ue=>X(Ue,Fe),onChangeSort:Re,onDeletePage:qe,onViewChanged:Ce,onDeleteView:Ee},null,8,["page","is-template-mode","is-post-match","game","lastGames","is-filter-visible","onIntersectionChanged"])):t.createCommentVNode("",!0),a.value&&!p.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:"new-items-buttons",style:t.normalizeStyle({"margin-bottom":Fe+1===R.value.length?"30px":"0","margin-top":"10px"})},[t.createElementVNode("div",{class:"new-items-buttons__add-page new-item-button",onClick:Ue=>F(Fe)},[...Pe[8]||(Pe[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,gqe),t.createElementVNode("div",{class:"new-items-buttons__add-item new-item-button",onClick:Ue=>A(Ne)},[...Pe[9]||(Pe[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,vqe)],4)):t.createCommentVNode("",!0)],8,fqe))),128))]))]),S.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",bqe,[t.createElementVNode("div",xqe,[t.createElementVNode("div",wqe,[t.createElementVNode("div",null,"Páginas "+t.toDisplayString(L.value),1),t.createElementVNode("div",{class:t.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:c.value<=0}]),onClick:Pe[3]||(Pe[3]=Ne=>c.value>0&&W(c.value-1))},[...Pe[10]||(Pe[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:c.value>=R.value.length}]),onClick:Pe[4]||(Pe[4]=Ne=>c.value<R.value.length&&W(c.value+1))},[...Pe[11]||(Pe[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",_qe,[t.createElementVNode("div",{role:"button",class:t.normalizeClass({active:c.value===0}),onClick:Pe[5]||(Pe[5]=Ne=>W(0))},t.toDisplayString(O(1)),3),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R.value,(Ne,Fe)=>(t.openBlock(),t.createElementBlock("div",{role:"button",key:Fe,class:t.normalizeClass({active:Fe+1===c.value}),onClick:Ue=>W(Fe+1)},t.toDisplayString(O(Fe+2)),11,Sqe))),128))])]),a.value?(t.openBlock(),t.createElementBlock("div",{key:0,role:"button",class:t.normalizeClass(["template-maker__content__main__footer__save save-button",{disabled:!m.value}]),onClick:be},[...Pe[12]||(Pe[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))}},kqe=pc(Tqe,[["__scopeId","data-v-04deba4c"]]);function jL(e,r){return function(){return e.apply(r,arguments)}}const{toString:Nqe}=Object.prototype,{getPrototypeOf:C_}=Object,{iterator:tx,toStringTag:WL}=Symbol,rx=(e=>r=>{const n=Nqe.call(r);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Yp=e=>(e=e.toLowerCase(),r=>rx(r)===e),ax=e=>r=>typeof r===e,{isArray:f1}=Array,m1=ax("undefined");function hg(e){return e!==null&&!m1(e)&&e.constructor!==null&&!m1(e.constructor)&&Wd(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const AL=Yp("ArrayBuffer");function Vqe(e){let r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(e):r=e&&e.buffer&&AL(e.buffer),r}const Lqe=ax("string"),Wd=ax("function"),KL=ax("number"),fg=e=>e!==null&&typeof e=="object",Oqe=e=>e===!0||e===!1,nx=e=>{if(rx(e)!=="object")return!1;const r=C_(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(WL in e)&&!(tx in e)},qqe=e=>{if(!fg(e)||hg(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Cqe=Yp("Date"),Uqe=Yp("File"),zqe=Yp("Blob"),Eqe=Yp("FileList"),Pqe=e=>fg(e)&&Wd(e.pipe),Rqe=e=>{let r;return e&&(typeof FormData=="function"&&e instanceof FormData||Wd(e.append)&&((r=rx(e))==="formdata"||r==="object"&&Wd(e.toString)&&e.toString()==="[object FormData]"))},Mqe=Yp("URLSearchParams"),[Fqe,jqe,Wqe,Aqe]=["ReadableStream","Request","Response","Headers"].map(Yp),Kqe=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mg(e,r,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let b,R;if(typeof e!="object"&&(e=[e]),f1(e))for(b=0,R=e.length;b<R;b++)r.call(null,e[b],b,e);else{if(hg(e))return;const y=n?Object.getOwnPropertyNames(e):Object.keys(e),c=y.length;let i;for(b=0;b<c;b++)i=y[b],r.call(null,e[i],i,e)}}function IL(e,r){if(hg(e))return null;r=r.toLowerCase();const n=Object.keys(e);let b=n.length,R;for(;b-- >0;)if(R=n[b],r===R.toLowerCase())return R;return null}const Dm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,XL=e=>!m1(e)&&e!==Dm;function U_(){const{caseless:e,skipUndefined:r}=XL(this)&&this||{},n={},b=(R,y)=>{const c=e&&IL(n,y)||y;nx(n[c])&&nx(R)?n[c]=U_(n[c],R):nx(R)?n[c]=U_({},R):f1(R)?n[c]=R.slice():(!r||!m1(R))&&(n[c]=R)};for(let R=0,y=arguments.length;R<y;R++)arguments[R]&&mg(arguments[R],b);return n}const Iqe=(e,r,n,{allOwnKeys:b}={})=>(mg(r,(R,y)=>{n&&Wd(R)?e[y]=jL(R,n):e[y]=R},{allOwnKeys:b}),e),Xqe=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Dqe=(e,r,n,b)=>{e.prototype=Object.create(r.prototype,b),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:r.prototype}),n&&Object.assign(e.prototype,n)},Bqe=(e,r,n,b)=>{let R,y,c;const i={};if(r=r||{},e==null)return r;do{for(R=Object.getOwnPropertyNames(e),y=R.length;y-- >0;)c=R[y],(!b||b(c,e,r))&&!i[c]&&(r[c]=e[c],i[c]=!0);e=n!==!1&&C_(e)}while(e&&(!n||n(e,r))&&e!==Object.prototype);return r},Gqe=(e,r,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=r.length;const b=e.indexOf(r,n);return b!==-1&&b===n},Jqe=e=>{if(!e)return null;if(f1(e))return e;let r=e.length;if(!KL(r))return null;const n=new Array(r);for(;r-- >0;)n[r]=e[r];return n},Zqe=(e=>r=>e&&r instanceof e)(typeof Uint8Array<"u"&&C_(Uint8Array)),Hqe=(e,r)=>{const b=(e&&e[tx]).call(e);let R;for(;(R=b.next())&&!R.done;){const y=R.value;r.call(e,y[0],y[1])}},Yqe=(e,r)=>{let n;const b=[];for(;(n=e.exec(r))!==null;)b.push(n);return b},Qqe=Yp("HTMLFormElement"),$qe=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,b,R){return b.toUpperCase()+R}),DL=(({hasOwnProperty:e})=>(r,n)=>e.call(r,n))(Object.prototype),eCe=Yp("RegExp"),BL=(e,r)=>{const n=Object.getOwnPropertyDescriptors(e),b={};mg(n,(R,y)=>{let c;(c=r(R,y,e))!==!1&&(b[y]=c||R)}),Object.defineProperties(e,b)},tCe=e=>{BL(e,(r,n)=>{if(Wd(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const b=e[n];if(Wd(b)){if(r.enumerable=!1,"writable"in r){r.writable=!1;return}r.set||(r.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},rCe=(e,r)=>{const n={},b=R=>{R.forEach(y=>{n[y]=!0})};return f1(e)?b(e):b(String(e).split(r)),n},aCe=()=>{},nCe=(e,r)=>e!=null&&Number.isFinite(e=+e)?e:r;function iCe(e){return!!(e&&Wd(e.append)&&e[WL]==="FormData"&&e[tx])}const oCe=e=>{const r=new Array(10),n=(b,R)=>{if(fg(b)){if(r.indexOf(b)>=0)return;if(hg(b))return b;if(!("toJSON"in b)){r[R]=b;const y=f1(b)?[]:{};return mg(b,(c,i)=>{const d=n(c,R+1);!m1(d)&&(y[i]=d)}),r[R]=void 0,y}}return b};return n(e,0)},sCe=Yp("AsyncFunction"),lCe=e=>e&&(fg(e)||Wd(e))&&Wd(e.then)&&Wd(e.catch),GL=((e,r)=>e?setImmediate:r?((n,b)=>(Dm.addEventListener("message",({source:R,data:y})=>{R===Dm&&y===n&&b.length&&b.shift()()},!1),R=>{b.push(R),Dm.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Wd(Dm.postMessage)),cCe=typeof queueMicrotask<"u"?queueMicrotask.bind(Dm):typeof process<"u"&&process.nextTick||GL,Qa={isArray:f1,isArrayBuffer:AL,isBuffer:hg,isFormData:Rqe,isArrayBufferView:Vqe,isString:Lqe,isNumber:KL,isBoolean:Oqe,isObject:fg,isPlainObject:nx,isEmptyObject:qqe,isReadableStream:Fqe,isRequest:jqe,isResponse:Wqe,isHeaders:Aqe,isUndefined:m1,isDate:Cqe,isFile:Uqe,isBlob:zqe,isRegExp:eCe,isFunction:Wd,isStream:Pqe,isURLSearchParams:Mqe,isTypedArray:Zqe,isFileList:Eqe,forEach:mg,merge:U_,extend:Iqe,trim:Kqe,stripBOM:Xqe,inherits:Dqe,toFlatObject:Bqe,kindOf:rx,kindOfTest:Yp,endsWith:Gqe,toArray:Jqe,forEachEntry:Hqe,matchAll:Yqe,isHTMLForm:Qqe,hasOwnProperty:DL,hasOwnProp:DL,reduceDescriptors:BL,freezeMethods:tCe,toObjectSet:rCe,toCamelCase:$qe,noop:aCe,toFiniteNumber:nCe,findKey:IL,global:Dm,isContextDefined:XL,isSpecCompliantForm:iCe,toJSONObject:oCe,isAsyncFn:sCe,isThenable:lCe,setImmediate:GL,asap:cCe,isIterable:e=>e!=null&&Wd(e[tx])};function yo(e,r,n,b,R){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),b&&(this.request=b),R&&(this.response=R,this.status=R.status?R.status:null)}Qa.inherits(yo,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:Qa.toJSONObject(this.config),code:this.code,status:this.status}}});const JL=yo.prototype,ZL={};["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=>{ZL[e]={value:e}}),Object.defineProperties(yo,ZL),Object.defineProperty(JL,"isAxiosError",{value:!0}),yo.from=(e,r,n,b,R,y)=>{const c=Object.create(JL);Qa.toFlatObject(e,c,function(a){return a!==Error.prototype},l=>l!=="isAxiosError");const i=e&&e.message?e.message:"Error",d=r==null&&e?e.code:r;return yo.call(c,i,d,n,b,R),e&&c.cause==null&&Object.defineProperty(c,"cause",{value:e,configurable:!0}),c.name=e&&e.name||"Error",y&&Object.assign(c,y),c};const uCe=null;function z_(e){return Qa.isPlainObject(e)||Qa.isArray(e)}function HL(e){return Qa.endsWith(e,"[]")?e.slice(0,-2):e}function YL(e,r,n){return e?e.concat(r).map(function(R,y){return R=HL(R),!n&&y?"["+R+"]":R}).join(n?".":""):r}function dCe(e){return Qa.isArray(e)&&!e.some(z_)}const pCe=Qa.toFlatObject(Qa,{},null,function(r){return/^is[A-Z]/.test(r)});function ix(e,r,n){if(!Qa.isObject(e))throw new TypeError("target must be an object");r=r||new FormData,n=Qa.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(o,s){return!Qa.isUndefined(s[o])});const b=n.metaTokens,R=n.visitor||a,y=n.dots,c=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&Qa.isSpecCompliantForm(r);if(!Qa.isFunction(R))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(Qa.isDate(p))return p.toISOString();if(Qa.isBoolean(p))return p.toString();if(!d&&Qa.isBlob(p))throw new yo("Blob is not supported. Use a Buffer instead.");return Qa.isArrayBuffer(p)||Qa.isTypedArray(p)?d&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function a(p,o,s){let f=p;if(p&&!s&&typeof p=="object"){if(Qa.endsWith(o,"{}"))o=b?o:o.slice(0,-2),p=JSON.stringify(p);else if(Qa.isArray(p)&&dCe(p)||(Qa.isFileList(p)||Qa.endsWith(o,"[]"))&&(f=Qa.toArray(p)))return o=HL(o),f.forEach(function(m,w){!(Qa.isUndefined(m)||m===null)&&r.append(c===!0?YL([o],w,y):c===null?o:o+"[]",l(m))}),!1}return z_(p)?!0:(r.append(YL(s,o,y),l(p)),!1)}const S=[],x=Object.assign(pCe,{defaultVisitor:a,convertValue:l,isVisitable:z_});function v(p,o){if(!Qa.isUndefined(p)){if(S.indexOf(p)!==-1)throw Error("Circular reference detected in "+o.join("."));S.push(p),Qa.forEach(p,function(f,u){(!(Qa.isUndefined(f)||f===null)&&R.call(r,f,Qa.isString(u)?u.trim():u,o,x))===!0&&v(f,o?o.concat(u):[u])}),S.pop()}}if(!Qa.isObject(e))throw new TypeError("data must be an object");return v(e),r}function QL(e){const r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(b){return r[b]})}function E_(e,r){this._pairs=[],e&&ix(e,this,r)}const $L=E_.prototype;$L.append=function(r,n){this._pairs.push([r,n])},$L.toString=function(r){const n=r?function(b){return r.call(this,b,QL)}:QL;return this._pairs.map(function(R){return n(R[0])+"="+n(R[1])},"").join("&")};function hCe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function eO(e,r,n){if(!r)return e;const b=n&&n.encode||hCe;Qa.isFunction(n)&&(n={serialize:n});const R=n&&n.serialize;let y;if(R?y=R(r,n):y=Qa.isURLSearchParams(r)?r.toString():new E_(r,n).toString(b),y){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+y}return e}class tO{constructor(){this.handlers=[]}use(r,n,b){return this.handlers.push({fulfilled:r,rejected:n,synchronous:b?b.synchronous:!1,runWhen:b?b.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){Qa.forEach(this.handlers,function(b){b!==null&&r(b)})}}const rO={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},fCe={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:E_,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},P_=typeof window<"u"&&typeof document<"u",R_=typeof navigator=="object"&&navigator||void 0,mCe=P_&&(!R_||["ReactNative","NativeScript","NS"].indexOf(R_.product)<0),yCe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",gCe=P_&&window.location.href||"http://localhost",ed={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:P_,hasStandardBrowserEnv:mCe,hasStandardBrowserWebWorkerEnv:yCe,navigator:R_,origin:gCe},Symbol.toStringTag,{value:"Module"})),...fCe};function vCe(e,r){return ix(e,new ed.classes.URLSearchParams,{visitor:function(n,b,R,y){return ed.isNode&&Qa.isBuffer(n)?(this.append(b,n.toString("base64")),!1):y.defaultVisitor.apply(this,arguments)},...r})}function bCe(e){return Qa.matchAll(/\w+|\[(\w*)]/g,e).map(r=>r[0]==="[]"?"":r[1]||r[0])}function xCe(e){const r={},n=Object.keys(e);let b;const R=n.length;let y;for(b=0;b<R;b++)y=n[b],r[y]=e[y];return r}function aO(e){function r(n,b,R,y){let c=n[y++];if(c==="__proto__")return!0;const i=Number.isFinite(+c),d=y>=n.length;return c=!c&&Qa.isArray(R)?R.length:c,d?(Qa.hasOwnProp(R,c)?R[c]=[R[c],b]:R[c]=b,!i):((!R[c]||!Qa.isObject(R[c]))&&(R[c]=[]),r(n,b,R[c],y)&&Qa.isArray(R[c])&&(R[c]=xCe(R[c])),!i)}if(Qa.isFormData(e)&&Qa.isFunction(e.entries)){const n={};return Qa.forEachEntry(e,(b,R)=>{r(bCe(b),R,n,0)}),n}return null}function wCe(e,r,n){if(Qa.isString(e))try{return(r||JSON.parse)(e),Qa.trim(e)}catch(b){if(b.name!=="SyntaxError")throw b}return(n||JSON.stringify)(e)}const yg={transitional:rO,adapter:["xhr","http","fetch"],transformRequest:[function(r,n){const b=n.getContentType()||"",R=b.indexOf("application/json")>-1,y=Qa.isObject(r);if(y&&Qa.isHTMLForm(r)&&(r=new FormData(r)),Qa.isFormData(r))return R?JSON.stringify(aO(r)):r;if(Qa.isArrayBuffer(r)||Qa.isBuffer(r)||Qa.isStream(r)||Qa.isFile(r)||Qa.isBlob(r)||Qa.isReadableStream(r))return r;if(Qa.isArrayBufferView(r))return r.buffer;if(Qa.isURLSearchParams(r))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let i;if(y){if(b.indexOf("application/x-www-form-urlencoded")>-1)return vCe(r,this.formSerializer).toString();if((i=Qa.isFileList(r))||b.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return ix(i?{"files[]":r}:r,d&&new d,this.formSerializer)}}return y||R?(n.setContentType("application/json",!1),wCe(r)):r}],transformResponse:[function(r){const n=this.transitional||yg.transitional,b=n&&n.forcedJSONParsing,R=this.responseType==="json";if(Qa.isResponse(r)||Qa.isReadableStream(r))return r;if(r&&Qa.isString(r)&&(b&&!this.responseType||R)){const c=!(n&&n.silentJSONParsing)&&R;try{return JSON.parse(r,this.parseReviver)}catch(i){if(c)throw i.name==="SyntaxError"?yo.from(i,yo.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:ed.classes.FormData,Blob:ed.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Qa.forEach(["delete","get","head","post","put","patch"],e=>{yg.headers[e]={}});const _Ce=Qa.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"]),SCe=e=>{const r={};let n,b,R;return e&&e.split(`
|
|
4131
|
+
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),b}static addGrid(r,n={}){if(!r)return null;let b=r;if(b.gridstack){const R=b.gridstack;return n&&(R.opts={...R.opts,...n}),n.children!==void 0&&R.load(n.children),R}return(!r.classList.contains("grid-stack")||bi.addRemoveCB)&&(bi.addRemoveCB?b=bi.addRemoveCB(r,n,!0,!0):b=Ya.createDiv(["grid-stack",n.class],r)),bi.init(n,b)}static registerEngine(r){bi.engineClass=r}get placeholder(){if(!this._placeholder){this._placeholder=Ya.createDiv([this.opts.placeholderClass,Yd.itemClass,this.opts.itemClass]);const r=Ya.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(r.textContent=this.opts.placeholderText)}return this._placeholder}constructor(r,n={}){var b;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 R=Ya.toNumber(r.getAttribute("gs-row"));n.column==="auto"&&delete n.column,n.alwaysShowResizeHandle!==void 0&&(n._alwaysShowResizeHandle=n.alwaysShowResizeHandle);const y=n.columnOpts;if(y){const a=y.breakpoints;!y.columnWidth&&!(a!=null&&a.length)?delete n.columnOpts:(y.columnMax=y.columnMax||12,(a==null?void 0:a.length)>1&&a.sort((S,x)=>(x.w||0)-(S.w||0)))}const c={...Ya.cloneDeep(Yd),column:Ya.toNumber(r.getAttribute("gs-column"))||Yd.column,minRow:R||Ya.toNumber(r.getAttribute("gs-min-row"))||Yd.minRow,maxRow:R||Ya.toNumber(r.getAttribute("gs-max-row"))||Yd.maxRow,staticGrid:Ya.toBool(r.getAttribute("gs-static"))||Yd.staticGrid,sizeToContent:Ya.toBool(r.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(n.handleClass?"."+n.handleClass:n.handle?n.handle:"")||Yd.draggable.handle},removableOptions:{accept:n.itemClass||Yd.removableOptions.accept,decline:Yd.removableOptions.decline}};r.getAttribute("gs-animate")&&(c.animate=Ya.toBool(r.getAttribute("gs-animate"))),n=Ya.defaults(n,c),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("."+Yd.itemClass),d=i==null?void 0:i.gridstackNode;if(d&&(d.subGrid=this,this.parentGridNode=d,this.el.classList.add("grid-stack-nested"),d.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!==Yd.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=Hp),this._setStaticClass();const l=n.engineClass||bi.engineClass||Gh;if(this.engine=new l({column:this.getColumn(),float:n.float,maxRow:n.maxRow,onChange:a=>{a.forEach(S=>{const x=S.el;x&&(S._removeDOM?(x&&x.remove(),delete S._removeDOM):this._writePosAttr(x,S))}),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&&!Mi.pauseDrag&&(Mi.pauseDrag=!0),((b=n.draggable)==null?void 0:b.pause)!==void 0&&(Mi.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,b=r;if(b.grid=this,b.el?n=b.el:bi.addRemoveCB?n=bi.addRemoveCB(this.el,r,!0,!1):n=this.createWidgetDivs(b),!n)return;if(b=n.gridstackNode,b&&n.parentElement===this.el&&this.engine.nodes.find(y=>y._id===b._id))return n;const R=this._readAttr(n);return Ya.defaults(r,R),this.engine.prepareNode(r),this.el.appendChild(n),this.makeWidget(n,r),n}createWidgetDivs(r){const n=Ya.createDiv(["grid-stack-item",this.opts.itemClass]),b=Ya.createDiv(["grid-stack-item-content"],n);return Ya.lazyLoad(r)?r.visibleObservable||(r.visibleObservable=new IntersectionObserver(([R])=>{var y,c;R.isIntersecting&&((y=r.visibleObservable)==null||y.disconnect(),delete r.visibleObservable,bi.renderCB(b,r),(c=r.grid)==null||c.prepareDragDrop(r.el))}),window.setTimeout(()=>{var R;return(R=r.visibleObservable)==null?void 0:R.observe(n)})):bi.renderCB(b,r),n}makeSubGrid(r,n,b,R=!0){var y,c,i;let d=r.gridstackNode;if(d||(d=this.makeWidget(r).gridstackNode),(y=d.subGrid)!=null&&y.el)return d.subGrid;let l,a=this;for(;a&&!l;)l=(c=a.opts)==null?void 0:c.subGridOpts,a=(i=a.parentGridNode)==null?void 0:i.grid;n=Ya.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...l||{},...n||d.subGridOpts||{}}),d.subGridOpts=n;let S;n.column==="auto"&&(S=!0,n.column=Math.max(d.w||1,(b==null?void 0:b.w)||1),delete n.columnOpts);let x=d.el.querySelector(".grid-stack-item-content"),v,p;if(R&&(this._removeDD(d.el),p={...d,x:0,y:0},Ya.removeInternalForSave(p),delete p.subGridOpts,d.content&&(p.content=d.content,delete d.content),bi.addRemoveCB?v=bi.addRemoveCB(this.el,p,!0,!1):(v=Ya.createDiv(["grid-stack-item"]),v.appendChild(x),x=Ya.createDiv(["grid-stack-item-content"],d.el)),this.prepareDragDrop(d.el)),b){const s=S?n.column:d.w,f=d.h+b.h,u=d.el.style;u.transition="none",this.update(d.el,{w:s,h:f}),setTimeout(()=>u.transition=null)}const o=d.subGrid=bi.addGrid(x,n);return b!=null&&b._moving&&(o._isTemp=!0),S&&(o._autoColumn=!0),R&&o.makeWidget(v,p),b&&(b._moving?window.setTimeout(()=>Ya.simulateMouseEvent(b._event,"mouseenter",o.el),0):o.makeWidget(d.el,d)),this.resizeToContentCheck(!1,d),o}removeAsSubGrid(r){var n;const b=(n=this.parentGridNode)==null?void 0:n.grid;b&&(b.batchUpdate(),b.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(R=>{R.x+=this.parentGridNode.x,R.y+=this.parentGridNode.y,b.makeWidget(R.el,R)}),b.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,r&&window.setTimeout(()=>Ya.simulateMouseEvent(r._event,"mouseenter",b.el),0))}save(r=!0,n=!1,b=bi.saveCB,R){const y=this.engine.save(r,b,R);if(y.forEach(c=>{var i;if(r&&c.el&&!c.subGrid&&!b){const d=c.el.querySelector(".grid-stack-item-content");c.content=d==null?void 0:d.innerHTML,c.content||delete c.content}else if(!r&&!b&&delete c.content,(i=c.subGrid)!=null&&i.el){const d=c.w||c.subGrid.getColumn(),l=c.subGrid.save(r,n,b,d);c.subGridOpts=n?l:{children:l},delete c.subGrid}delete c.el}),n){const c=Ya.cloneDeep(this.opts);c.marginBottom===c.marginTop&&c.marginRight===c.marginLeft&&c.marginTop===c.marginRight&&(c.margin=c.marginTop,delete c.marginTop,delete c.marginRight,delete c.marginBottom,delete c.marginLeft),c.rtl===(this.el.style.direction==="rtl")&&(c.rtl="auto"),this._isAutoCellHeight&&(c.cellHeight="auto"),this._autoColumn&&(c.column="auto");const i=c._alwaysShowResizeHandle;return delete c._alwaysShowResizeHandle,i!==void 0?c.alwaysShowResizeHandle=i:delete c.alwaysShowResizeHandle,Ya.removeInternalAndSame(c,Yd),c.children=y,c}return y}load(r,n=bi.addRemoveCB||!0){r=Ya.cloneDeep(r);const b=this.getColumn();r.forEach(a=>{a.w=a.w||a.minW||1,a.h=a.h||a.minH||1}),r=Ya.sort(r),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let R=0;r.forEach(a=>{R=Math.max(R,(a.x||0)+a.w)}),R>this.engine.defaultColumn&&(this.engine.defaultColumn=R),R>b&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=r,this.engine.columnChanged(R,b,this.responseLayout),r=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(r,R,!0));const y=bi.addRemoveCB;typeof n=="function"&&(bi.addRemoveCB=n);const c=[];this.batchUpdate();const i=!this.engine.nodes.length,d=i&&this.opts.animate;d&&this.setAnimation(!1),!i&&n&&[...this.engine.nodes].forEach(a=>{a.id&&(Ya.find(r,a.id)||(bi.addRemoveCB&&bi.addRemoveCB(this.el,a,!1,!1),c.push(a),this.removeWidget(a.el,!0,!1)))}),this.engine._loading=!0;const l=[];return this.engine.nodes=this.engine.nodes.filter(a=>Ya.find(r,a.id)?(l.push(a),!1):!0),r.forEach(a=>{var S;const x=Ya.find(l,a.id);if(x){if(Ya.shouldSizeToContent(x)&&(a.h=x.h),this.engine.nodeBoundFix(a),(a.autoPosition||a.x===void 0||a.y===void 0)&&(a.w=a.w||x.w,a.h=a.h||x.h,this.engine.findEmptyPosition(a)),this.engine.nodes.push(x),Ya.samePos(x,a)&&this.engine.nodes.length>1&&(this.moveNode(x,{...a,forceCollide:!0}),Ya.copyPos(a,x)),this.update(x.el,a),(S=a.subGridOpts)!=null&&S.children){const v=x.el.querySelector(".grid-stack");v&&v.gridstack&&v.gridstack.load(a.subGridOpts.children)}}else n&&this.addWidget(a)}),delete this.engine._loading,this.engine.removedNodes=c,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,y?bi.addRemoveCB=y:delete bi.addRemoveCB,d&&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 R=Ya.toNumber(n.getAttribute("gs-h"))||1;return Math.round(n.offsetHeight/R)}const b=parseInt(this.el.getAttribute("gs-current-row"));return b?Math.round(this.el.getBoundingClientRect().height/b):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 b=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;r=this.cellWidth()+b}const n=Ya.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 b=this.opts.columnOpts;if(!b||!b.columnWidth&&!((r=b.breakpoints)!=null&&r.length))return!1;const R=this.getColumn();let y=R;const c=this._widthOrContainer(!0);if(b.columnWidth)y=Math.min(Math.round(c/b.columnWidth)||1,b.columnMax);else{y=b.columnMax;let i=0;for(;i<b.breakpoints.length&&c<=b.breakpoints[i].w;)y=b.breakpoints[i++].c||R}if(y!==R){const i=(n=b.breakpoints)==null?void 0:n.find(d=>d.c===y);return this.column(y,(i==null?void 0:i.layout)||b.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 b=this.getColumn();return this.opts.column=r,this.engine?(this.engine.column=r,this.el.classList.remove("gs-"+b),this._updateColumnVar(),this.engine.columnChanged(b,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 b=this.el.getBoundingClientRect();let R;n?R={top:b.top+document.documentElement.scrollTop,left:b.left}:R={top:this.el.offsetTop,left:this.el.offsetLeft};const y=r.left-R.left,c=r.top-R.top,i=b.width/this.getColumn(),d=b.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(y/i),y:Math.floor(c/d)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(r,n,b,R){return this.engine.isAreaEmpty(r,n,b,R)}makeWidget(r,n){const b=bi.getElement(r);if(!b||b.gridstackNode)return b;b.parentElement||this.el.appendChild(b),this._prepareElement(b,!0,n);const R=b.gridstackNode;this._updateContainerHeight(),R.subGridOpts&&this.makeSubGrid(b,R.subGridOpts,void 0,!1);let y;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(y=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),y&&delete this._ignoreLayoutsNodeChange,b}on(r,n){return r.indexOf(" ")!==-1?(r.split(" ").forEach(b=>this.on(b,n)),this):(r==="change"||r==="added"||r==="removed"||r==="enable"||r==="disable"?(r==="enable"||r==="disable"?this._gsEventHandler[r]=b=>n(b):this._gsEventHandler[r]=b=>{b.detail&&n(b,b.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,b=!0){return r?(bi.getElements(r).forEach(R=>{if(R.parentElement&&R.parentElement!==this.el)return;let y=R.gridstackNode;y||(y=this.engine.nodes.find(c=>R===c.el)),y&&(n&&bi.addRemoveCB&&bi.addRemoveCB(this.el,y,!1,!1),delete R.gridstackNode,this._removeDD(R),this.engine.removeNode(y,n,b),n&&R.parentElement&&R.remove())}),b&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(r=!0,n=!0){return this.engine.nodes.forEach(b=>{r&&bi.addRemoveCB&&bi.addRemoveCB(this.el,b,!1,!1),delete b.el.gridstackNode,this.opts.staticGrid||this._removeDD(b.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,b=!0){return!!this.opts.staticGrid===r?this:(r?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(R=>{this.prepareDragDrop(R.el),R.subGrid&&b&&R.subGrid.setStatic(r,n,b)}),n&&this._setStaticClass(),this)}updateOptions(r){var n;const b=this.opts;return r===b?this:(r.acceptWidgets!==void 0&&(b.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!==b.class&&(b.class&&this.el.classList.remove(b.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?(b.minRow=b.maxRow=b.row=r.row,this._updateContainerHeight()):(r.minRow!==void 0&&(b.minRow=r.minRow,this._updateContainerHeight()),r.maxRow!==void 0&&(b.maxRow=r.maxRow)),(n=r.children)!=null&&n.length&&this.load(r.children),this)}update(r,n){return bi.getElements(r).forEach(b=>{var R;const y=b==null?void 0:b.gridstackNode;if(!y)return;const c={...Ya.copyPos({},y),...Ya.cloneDeep(n)};this.engine.nodeBoundFix(c),delete c.autoPosition;const i=["x","y","w","h"];let d;if(i.some(S=>c[S]!==void 0&&c[S]!==y[S])&&(d={},i.forEach(S=>{d[S]=c[S]!==void 0?c[S]:y[S],delete c[S]})),!d&&(c.minW||c.minH||c.maxW||c.maxH)&&(d={}),c.content!==void 0){const S=b.querySelector(".grid-stack-item-content");S&&S.textContent!==c.content&&(y.content=c.content,bi.renderCB(S,c),(R=y.subGrid)!=null&&R.el&&(S.appendChild(y.subGrid.el),y.subGrid._updateContainerHeight())),delete c.content}let l=!1,a=!1;for(const S in c)S[0]!=="_"&&y[S]!==c[S]&&(y[S]=c[S],l=!0,a=a||!this.opts.staticGrid&&(S==="noResize"||S==="noMove"||S==="locked"));if(Ya.sanitizeMinMax(y),d){const S=d.w!==void 0&&d.w!==y.w;this.moveNode(y,d),S&&y.subGrid?y.subGrid.onResize(this.hasAnimationCSS()?y.w:void 0):this.resizeToContentCheck(S,y),delete y._orig}(d||l)&&this._writeAttr(b,y),a&&this.prepareDragDrop(y.el),bi.updateCB&&bi.updateCB(y)}),this}moveNode(r,n){const b=r._updating;b||this.engine.cleanNodes().beginUpdate(r),this.engine.moveNode(r,n),this._updateContainerHeight(),b||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(r){var n,b;if(!r||(r.classList.remove("size-to-content-max"),!r.clientHeight))return;const R=r.gridstackNode;if(!R)return;const y=R.grid;if(!y||r.parentElement!==y.el)return;const c=y.getCellHeight(!0);if(!c)return;let i=R.h?R.h*c:r.clientHeight,d;if(R.resizeToContentParent&&(d=r.querySelector(R.resizeToContentParent)),d||(d=r.querySelector(bi.resizeToContentParent)),!d)return;const l=r.clientHeight-d.clientHeight,a=R.h?R.h*c-l:d.clientHeight;let S;if(R.subGrid){S=R.subGrid.getRow()*R.subGrid.getCellHeight(!0);const p=R.subGrid.el.getBoundingClientRect(),o=r.getBoundingClientRect();S+=p.top-o.top}else{if((b=(n=R.subGridOpts)==null?void 0:n.children)!=null&&b.length)return;{const p=d.firstElementChild;if(!p){console.error(`Error: GridStack.resizeToContent() widget id:${R.id} '${bi.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}S=p.getBoundingClientRect().height||a}}if(a===S)return;i+=S-a;let x=Math.ceil(i/c);const v=Number.isInteger(R.sizeToContent)?R.sizeToContent:0;v&&x>v&&(x=v,r.classList.add("size-to-content-max")),R.minH&&x<R.minH?x=R.minH:R.maxH&&x>R.maxH&&(x=R.maxH),x!==R.h&&(y._ignoreLayoutsNodeChange=!0,y.moveNode(R,{h:x}),delete y._ignoreLayoutsNodeChange)}resizeToContentCBCheck(r){bi.resizeToContentCB?bi.resizeToContentCB(r):this.resizeToContent(r)}rotate(r,n){return bi.getElements(r).forEach(b=>{const R=b.gridstackNode;if(!Ya.canBeRotated(R))return;const y={w:R.h,h:R.w,minH:R.minW,minW:R.minH,maxH:R.maxW,maxW:R.maxH};if(n){const i=n.left>0?Math.floor(n.left/this.cellWidth()):0,d=n.top>0?Math.floor(n.top/this.opts.cellHeight):0;y.x=R.x+i-(R.h-(d+1)),y.y=R.y+d-i}Object.keys(y).forEach(i=>{y[i]===void 0&&delete y[i]});const c=R._orig;this.update(b,y),R._orig=c}),this}margin(r){if(!(typeof r=="string"&&r.split(" ").length>1)){const n=Ya.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){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");const n=arguments;let b=0,R={x:n[b++],y:n[b++],w:n[b++],h:n[b++],autoPosition:n[b++]};return this.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(b=>{delete b._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 b=n?new CustomEvent(r,{bubbles:!1,detail:n}):new Event(r);let R=this;for(;R.parentGridNode;)R=R.parentGridNode.grid;return R.el.dispatchEvent(b),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const r=this.parentGridNode;let n=this.getRow()+this._extraDragRow;const b=this.opts.cellHeight,R=this.opts.cellHeightUnit;if(!b)return this;if(!r&&!this.opts.minRow){const y=Ya.parseHeight(getComputedStyle(this.el).minHeight);if(y.h>0&&y.unit===R){const c=Math.floor(y.h/b);n<c&&(n=c)}}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*b+R),r&&Ya.shouldSizeToContent(r)&&r.grid.resizeToContentCBCheck(r.el),this}_prepareElement(r,n=!1,b){b=b||this._readAttr(r),r.gridstackNode=b,b.el=r,b.grid=this,b=this.engine.addNode(b,n),this._writeAttr(r,b),r.classList.add(Yd.itemClass,this.opts.itemClass);const R=Ya.shouldSizeToContent(b);return R?r.classList.add("size-to-content"):r.classList.remove("size-to-content"),R&&this.resizeToContentCheck(!1,b),Ya.lazyLoad(b)||this.prepareDragDrop(b.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),n.x>0?r.setAttribute("gs-x",String(n.x)):r.removeAttribute("gs-x"),n.y>0?r.setAttribute("gs-y",String(n.y)):r.removeAttribute("gs-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 b={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const R in b)n[R]?r.setAttribute(b[R],String(n[R])):r.removeAttribute(b[R]);return this}_readAttr(r,n=!0){const b={};b.x=Ya.toNumber(r.getAttribute("gs-x")),b.y=Ya.toNumber(r.getAttribute("gs-y")),b.w=Ya.toNumber(r.getAttribute("gs-w")),b.h=Ya.toNumber(r.getAttribute("gs-h")),b.autoPosition=Ya.toBool(r.getAttribute("gs-auto-position")),b.noResize=Ya.toBool(r.getAttribute("gs-no-resize")),b.noMove=Ya.toBool(r.getAttribute("gs-no-move")),b.locked=Ya.toBool(r.getAttribute("gs-locked"));const R=r.getAttribute("gs-size-to-content");R&&(R==="true"||R==="false"?b.sizeToContent=Ya.toBool(R):b.sizeToContent=parseInt(R,10)),b.id=r.getAttribute("gs-id"),b.maxW=Ya.toNumber(r.getAttribute("gs-max-w")),b.minW=Ya.toNumber(r.getAttribute("gs-min-w")),b.maxH=Ya.toNumber(r.getAttribute("gs-max-h")),b.minH=Ya.toNumber(r.getAttribute("gs-min-h")),n&&(b.w===1&&r.removeAttribute("gs-w"),b.h===1&&r.removeAttribute("gs-h"),b.maxW&&r.removeAttribute("gs-max-w"),b.minW&&r.removeAttribute("gs-min-w"),b.maxH&&r.removeAttribute("gs-max-h"),b.minH&&r.removeAttribute("gs-min-h"));for(const y in b){if(!b.hasOwnProperty(y))return;!b[y]&&b[y]!==0&&y!=="sizeToContent"&&delete b[y]}return b}_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(b=>{b.subGrid&&b.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)Ya.shouldSizeToContent(n)&&this.resizeToContentCBCheck(n.el);else if(this.engine.nodes.some(b=>Ya.shouldSizeToContent(b))){const b=[...this.engine.nodes];this.batchUpdate(),b.forEach(R=>{Ya.shouldSizeToContent(R)&&this.resizeToContentCBCheck(R.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(b=>b.sizeToContent));return!r&&n&&!this.resizeObserver?(this._sizeThrottle=Ya.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 Ya.getElement(r)}static getElements(r=".grid-stack-item"){return Ya.getElements(r)}static getGridElement(r){return bi.getElement(r)}static getGridElements(r){return Ya.getElements(r)}_initMargin(){let r,n=0,b=[];typeof this.opts.margin=="string"&&(b=this.opts.margin.split(" ")),b.length===2?(this.opts.marginTop=this.opts.marginBottom=b[0],this.opts.marginLeft=this.opts.marginRight=b[1]):b.length===4?(this.opts.marginTop=b[0],this.opts.marginRight=b[1],this.opts.marginBottom=b[2],this.opts.marginLeft=b[3]):(r=Ya.parseHeight(this.opts.margin),this.opts.marginUnit=r.unit,n=this.opts.margin=r.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(y=>{this.opts[y]===void 0?this.opts[y]=n:(r=Ya.parseHeight(this.opts[y]),this.opts[y]=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 R=this.el.style;return R.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),R.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),R.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),R.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return ud}static setupDragIn(r,n,b,R=document){(n==null?void 0:n.pause)!==void 0&&(Mi.pauseDrag=n.pause),n={appendTo:"body",helper:"clone",...n||{}},(typeof r=="string"?Ya.getElements(r,R):r).forEach((y,c)=>{ud.isDraggable(y)||ud.dragIn(y,n),b!=null&&b[c]&&(y.gridstackNode=b[c])})}movable(r,n){return this.opts.staticGrid?this:(bi.getElements(r).forEach(b=>{const R=b.gridstackNode;R&&(n?delete R.noMove:R.noMove=!0,this.prepareDragDrop(R.el))}),this)}resizable(r,n){return this.opts.staticGrid?this:(bi.getElements(r).forEach(b=>{const R=b.gridstackNode;R&&(n?delete R.noResize:R.noResize=!0,this.prepareDragDrop(R.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(b=>{this.prepareDragDrop(b.el),b.subGrid&&n&&b.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(b=>{this.prepareDragDrop(b.el),b.subGrid&&n&&b.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&&bi._itemRemoving(n.el,!1),this.engine.restoreInitial())}_removeDD(r){return ud.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 ud.droppable(this.el,"destroy"),this;let r,n;const b=(R,y,c)=>{var i;c=c||y;const d=c.gridstackNode;if(!d)return;if(!((i=d.grid)!=null&&i.el)){c.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const v=c.getBoundingClientRect();c.style.left=v.x+(this.dragTransform.xScale-1)*(R.clientX-v.x)/this.dragTransform.xScale+"px",c.style.top=v.y+(this.dragTransform.yScale-1)*(R.clientY-v.y)/this.dragTransform.yScale+"px",c.style.transformOrigin="0px 0px"}let{top:l,left:a}=c.getBoundingClientRect();const S=this.el.getBoundingClientRect();a-=S.left,l-=S.top;const x={position:{top:l*this.dragTransform.xScale,left:a*this.dragTransform.yScale}};if(d._temporaryRemoved){if(d.x=Math.max(0,Math.round(a/n)),d.y=Math.max(0,Math.round(l/r)),delete d.autoPosition,this.engine.nodeBoundFix(d),!this.engine.willItFit(d)){if(d.autoPosition=!0,!this.engine.willItFit(d)){ud.off(y,"drag");return}d._willFitPos&&(Ya.copyPos(d,d._willFitPos),delete d._willFitPos)}this._onStartMoving(c,R,x,d,n,r)}else this._dragOrResize(c,R,x,d,n,r)};return ud.droppable(this.el,{accept:R=>{const y=R.gridstackNode||this._readAttr(R,!1);if((y==null?void 0:y.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let c=!0;if(typeof this.opts.acceptWidgets=="function")c=this.opts.acceptWidgets(R);else{const i=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;c=R.matches(i)}if(c&&y&&this.opts.maxRow){const i={w:y.w,h:y.h,minW:y.minW,minH:y.minH};c=this.engine.willItFit(i)}return c}}).on(this.el,"dropover",(R,y,c)=>{let i=(c==null?void 0:c.gridstackNode)||y.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(y,c),c=c||y,n=this.cellWidth(),r=this.getCellHeight(!0),!i){const a=c.getAttribute("data-gs-widget")||c.getAttribute("gridstacknode");if(a){try{i=JSON.parse(a)}catch{console.error("Gridstack dropover: Bad JSON format: ",a)}c.removeAttribute("data-gs-widget"),c.removeAttribute("gridstacknode")}i||(i=this._readAttr(c)),i._sidebarOrig={w:i.w,h:i.h}}i.grid||(i.el||(i={...i}),i._isExternal=!0,c.gridstackNode=i);const d=i.w||Math.round(c.offsetWidth/n)||1,l=i.h||Math.round(c.offsetHeight/r)||1;return i.grid&&i.grid!==this?(y._gridstackNodeOrig||(y._gridstackNodeOrig=i),y.gridstackNode=i={...i,w:d,h:l,grid:this},delete i.x,delete i.y,this.engine.cleanupNode(i).nodeBoundFix(i),i._initDD=i._isExternal=i._temporaryRemoved=!0):(i.w=d,i.h=l,i._temporaryRemoved=!0),bi._itemRemoving(i.el,!1),ud.on(y,"drag",b),b(R,y,c),!1}).on(this.el,"dropout",(R,y,c)=>{const i=(c==null?void 0:c.gridstackNode)||y.gridstackNode;return i&&(!i.grid||i.grid===this)&&(this._leave(y,c),this._isTemp&&this.removeAsSubGrid(i)),!1}).on(this.el,"drop",(R,y,c)=>{var i,d,l;const a=(c==null?void 0:c.gridstackNode)||y.gridstackNode;if((a==null?void 0:a.grid)===this&&!a._isExternal)return!1;const S=!!this.placeholder.parentElement,x=y!==c;this.placeholder.remove(),delete this.placeholder.gridstackNode,S&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const v=y._gridstackNodeOrig;if(delete y._gridstackNodeOrig,S&&v!=null&&v.grid&&v.grid!==this){const o=v.grid;o.engine.removeNodeFromLayoutCache(v),o.engine.removedNodes.push(v),o._triggerRemoveEvent()._triggerChangeEvent(),o.parentGridNode&&!o.engine.nodes.length&&o.opts.subGridDynamic&&o.removeAsSubGrid()}if(!a||(S&&(this.engine.cleanupNode(a),a.grid=this),(i=a.grid)==null||delete i._isTemp,ud.off(y,"drag"),c!==y?(c.remove(),y=c):y.remove(),this._removeDD(y),!S))return!1;const p=(l=(d=a.subGrid)==null?void 0:d.el)==null?void 0:l.gridstack;return Ya.copyPos(a,this._readAttr(this.placeholder)),Ya.removePositioningStyles(y),x&&(a.content||a.subGridOpts||bi.addRemoveCB)?(delete a.el,y=this.addWidget(a)):(this._prepareElement(y,!0,a),this.el.appendChild(y),this.resizeToContentCheck(!1,a),p&&(p.parentGridNode=a),this._updateContainerHeight()),this.engine.addedNodes.push(a),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...R,type:"dropped"},v&&v.grid?v:void 0,a),!1}),this}static _itemRemoving(r,n){if(!r)return;const b=r?r.gridstackNode:void 0;!(b!=null&&b.grid)||r.classList.contains(b.grid.opts.removableOptions.decline)||(n?b._isAboutToRemove=!0:delete b._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&&!ud.isDroppable(r)&&ud.droppable(r,this.opts.removableOptions).on(r,"dropover",(n,b)=>bi._itemRemoving(b,!0)).on(r,"dropout",(n,b)=>bi._itemRemoving(b,!1)),this):this}prepareDragDrop(r,n=!1){const b=r==null?void 0:r.gridstackNode;if(!b)return;const R=b.noMove||this.opts.disableDrag,y=b.noResize||this.opts.disableResize,c=this.opts.staticGrid||R&&y;if((n||c)&&(b._initDD&&(this._removeDD(r),delete b._initDD),c&&r.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!n))return this;if(!b._initDD){let i,d;const l=(x,v)=>{this.triggerEvent(x,x.target),i=this.cellWidth(),d=this.getCellHeight(!0),this._onStartMoving(r,x,v,b,i,d)},a=(x,v)=>{this._dragOrResize(r,x,v,b,i,d)},S=x=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete b._moving,delete b._resizing,delete b._event,delete b._lastTried;const v=b.w!==b._orig.w,p=x.target;if(!(!p.gridstackNode||p.gridstackNode.grid!==this)){if(b.el=p,b._isAboutToRemove){const o=r.gridstackNode.grid;o._gsEventHandler[x.type]&&o._gsEventHandler[x.type](x,p),o.engine.nodes.push(b),o.removeWidget(r,!0,!0)}else Ya.removePositioningStyles(p),b._temporaryRemoved?(this._writePosAttr(p,b),this.engine.addNode(b)):this._writePosAttr(p,b),this.triggerEvent(x,p);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),x.type==="resizestop"&&(Number.isInteger(b.sizeToContent)&&(b.sizeToContent=b.h),this.resizeToContentCheck(v,b))}};ud.draggable(r,{start:l,stop:S,drag:a}).resizable(r,{start:l,stop:S,resize:a}),b._initDD=!0}return ud.draggable(r,R?"disable":"enable").resizable(r,y?"disable":"enable"),this}_onStartMoving(r,n,b,R,y,c){var i;if(this.engine.cleanNodes().beginUpdate(R),this._writePosAttr(this.placeholder,R),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=R,(i=R.grid)!=null&&i.el)this.dragTransform=Ya.getValuesFromTransformedElement(r);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const d=this.placeholder.closest(".grid-stack");this.dragTransform=Ya.getValuesFromTransformedElement(d)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(R.el=this.placeholder,R._lastUiPosition=b.position,R._prevYPix=b.position.top,R._moving=n.type==="dragstart",R._resizing=n.type==="resizestart",delete R._lastTried,n.type==="dropover"&&R._temporaryRemoved&&(this.engine.addNode(R),R._moving=!0),this.engine.cacheRects(y,c,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),n.type==="resizestart"){const d=this.getColumn()-R.x,l=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-R.y;ud.resizable(r,"option","minWidth",y*Math.min(R.minW||1,d)).resizable(r,"option","minHeight",c*Math.min(R.minH||1,l)).resizable(r,"option","maxWidth",y*Math.min(R.maxW||Number.MAX_SAFE_INTEGER,d)).resizable(r,"option","maxWidthMoveLeft",y*Math.min(R.maxW||Number.MAX_SAFE_INTEGER,R.x+R.w)).resizable(r,"option","maxHeight",c*Math.min(R.maxH||Number.MAX_SAFE_INTEGER,l)).resizable(r,"option","maxHeightMoveUp",c*Math.min(R.maxH||Number.MAX_SAFE_INTEGER,R.y+R.h))}}_dragOrResize(r,n,b,R,y,c){const i={...R._orig};let d,l=this.opts.marginLeft,a=this.opts.marginRight,S=this.opts.marginTop,x=this.opts.marginBottom;const v=Math.round(c*.1),p=Math.round(y*.1);if(l=Math.min(l,p),a=Math.min(a,p),S=Math.min(S,v),x=Math.min(x,v),n.type==="drag"){if(R._temporaryRemoved)return;const s=b.position.top-R._prevYPix;R._prevYPix=b.position.top,this.opts.draggable.scroll!==!1&&Ya.updateScrollPosition(r,b.position,s);const f=b.position.left+(b.position.left>R._lastUiPosition.left?-a:l),u=b.position.top+(b.position.top>R._lastUiPosition.top?-x:S);i.x=Math.round(f/y),i.y=Math.round(u/c);const m=this._extraDragRow;if(this.engine.collide(R,i)){const w=this.getRow();let _=Math.max(0,i.y+R.h-w);this.opts.maxRow&&w+_>this.opts.maxRow&&(_=Math.max(0,this.opts.maxRow-w)),this._extraDragRow=_}else this._extraDragRow=0;if(this._extraDragRow!==m&&this._updateContainerHeight(),R.x===i.x&&R.y===i.y)return}else if(n.type==="resize"){if(i.x<0||(Ya.updateScrollResize(n,r,c),i.w=Math.round((b.size.width-l)/y),i.h=Math.round((b.size.height-S)/c),R.w===i.w&&R.h===i.h)||R._lastTried&&R._lastTried.w===i.w&&R._lastTried.h===i.h)return;const s=b.position.left+l,f=b.position.top+S;i.x=Math.round(s/y),i.y=Math.round(f/c),d=!0}R._event=n,R._lastTried=i;const o={x:b.position.left+l,y:b.position.top+S,w:(b.size?b.size.width:R.w*y)-l-a,h:(b.size?b.size.height:R.h*c)-S-x};if(this.engine.moveNodeCheck(R,{...i,cellWidth:y,cellHeight:c,rect:o,resizing:d})){R._lastUiPosition=b.position,this.engine.cacheRects(y,c,S,a,x,l),delete R._skipDown,d&&R.subGrid&&R.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const s=n.target;R._sidebarOrig||this._writePosAttr(s,R),this.triggerEvent(n,s)}}triggerEvent(r,n){let b=this;for(;b.parentGridNode;)b=b.parentGridNode.grid;b._gsEventHandler[r.type]&&b._gsEventHandler[r.type](r,n)}_leave(r,n){n=n||r;const b=n.gridstackNode;if(!b||(n.style.transform=n.style.transformOrigin=null,ud.off(r,"drag"),b._temporaryRemoved))return;b._temporaryRemoved=!0,this.engine.removeNode(b),b.el=b._isExternal&&n?n:r;const R=b._sidebarOrig;b._isExternal&&this.engine.cleanupNode(b),b._sidebarOrig=R,this.opts.removable===!0&&bi._itemRemoving(r,!0),r._gridstackNodeOrig?(r.gridstackNode=r._gridstackNodeOrig,delete r._gridstackNodeOrig):b._isExternal&&this.engine.restoreInitial()}commit(){return L9e(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}bi.renderCB=(e,r)=>{e&&r!=null&&r.content&&(e.textContent=r.content)},bi.resizeToContentParent=".grid-stack-item-content",bi.Utils=Ya,bi.Engine=Gh,bi.GDRev="12.3.2";const U9e=[{id:1,name:"Goles",isSelected:!1},{id:2,name:"Pases acertados",isSelected:!1},{id:23,name:"Tiros de Esquina",isSelected:!1},{id:3,name:"Balones recuperados en disputa",isSelected:!1},{id:4,name:"Asistencias",isSelected:!1},{id:5,name:"Participaciones en gol",isSelected:!1},{id:6,name:"Tiros a gol",isSelected:!1},{id:7,name:"Tiros a gol que llegaron a la portería",isSelected:!1},{id:8,name:"Cabeceos en área rival",isSelected:!1},{id:9,name:"Cabeceos en área propia",isSelected:!1},{id:10,name:"Centros",isSelected:!1},{id:11,name:"Centros acertados",isSelected:!1},{id:12,name:"1vs1 exitosos ofensivos",isSelected:!1},{id:13,name:"1vs1 exitosos ofensivos que terminaron en gol",isSelected:!1},{id:14,name:"1vs1 defensivos exitoso",isSelected:!1},{id:15,name:"Rechaces",isSelected:!1},{id:16,name:"Balones ganados en área propia",isSelected:!1},{id:17,name:"Balones ganados en área rival",isSelected:!1},{id:18,name:"Faltas cometidas",isSelected:!1},{id:19,name:"Faltas recibidas",isSelected:!1},{id:20,name:"Tarjetas amarillas",isSelected:!1},{id:21,name:"Tarjetas rojas",isSelected:!1},{id:22,name:"Atajadas",isSelected:!1},{id:24,name:"Oportunidades de gol",isSelected:!1},{id:25,name:"Balones recuperados en cancha rival",isSelected:!1}],Jh=e=>U9e.find(r=>r.id===e),Zh=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 p1{constructor(r,n=[],b,R=null,y=!1,c=!1,i=null,d=null,l=null){Up(this,"id",""),Up(this,"childViews",[]),Up(this,"viewId",0),Up(this,"dynamicFilters",null),Up(this,"componentSpecificFilters",new Map),Up(this,"isPostMatch",!1),Up(this,"isTemplateMode",!1),Up(this,"filtresJSON",null),Up(this,"token",null),Up(this,"_isUpdating",!1),Up(this,"filters",null),this.id=r,this.viewId=b,this.childViews=n,this.dynamicFilters=R,this.isPostMatch=y,this.isTemplateMode=c,this.filtresJSON=i,this.token=d,this.filters=l,this.componentSpecificFilters=new Map}resetClass(){this.childViews.forEach(r=>{r.view.filterAndViewsContainer=new p1(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(b=>b&&b.event_type_id===n)}hasCategoryId(r,n){return!r||!Array.isArray(r)?!1:r.some(b=>b&&b.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(console.log("teamSelected: ",n),n===3){console.log("this.getHomeTeamViews(): ",this.getHomeTeamViews()),console.log("this.getAwayTeamViews(): ",this.getAwayTeamViews());const b=this.getHomeTeamViews().length,R=this.getAwayTeamViews().length;b===0&&R>0&&this.getAwayTeamViews().forEach(y=>{y.view.componentProps.isHomeTeamForAnalysis=!0,y.view.isHomeTeam=!0,y.view.filterMultiple&&(y.view.filterMultiple.isHomeTeam=!0)}),b<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((y,c,i,d)=>{let l={isAgainstMode:c.view.isAgainstMode,advancedFilters:c.view.componentProps.advancedFilters,isHomeTeamForAnalysis:c.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:c.view.isHomeTeam};return y&&(y.isHomeTeam&&!c.view.isHomeTeam?(c.view.componentProps.isAgainstMode=this.filters.isAgainstMode,c.view.componentProps.advancedFilters=this.filters.advancedFilters,c.view.componentProps.isHomeTeamForAnalysis=!0,c.view.isHomeTeam=!0,c.view.filterMultiple={isHomeTeam:c.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}):!y.isHomeTeam&&!c.view.isHomeTeam&&(c.view.componentProps.isAgainstMode=y.isAgainstMode,c.view.componentProps.advancedFilters=y.advancedFilters,c.view.componentProps.isHomeTeamForAnalysis=y.isHomeTeamForAnalysis,c.view.isHomeTeam=y.isHomeTeam,c.view.filterMultiple={isHomeTeam:c.view.isHomeTeam,selectedCategory:c.view.componentProps.categories[0],advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}),i===d.length-1&&(r.view.componentProps.advancedFilters=l.advancedFilters,r.view.componentProps.isAgainstMode=l.isAgainstMode,r.view.componentProps.isHomeTeamForAnalysis=l.isHomeTeamForAnalysis,r.view.isHomeTeam=l.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode})),l},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 b=n===1;r.view.componentProps.isHomeTeamForAnalysis=b,r.view.isHomeTeam=b,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 b=this.filters.selectedCategories.map(y=>y.value),R=this.filters.selectedTeam.value;if(R===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(d=>{d.view.componentProps.isHomeTeamForAnalysis=!0,d.view.isHomeTeam=!0,d.view.filterMultiple&&(d.view.filterMultiple.isHomeTeam=!0)});const y=this.getHomeTeamViews(),c=this.getAwayTeamViews();let i=!0;for(let d=0;d<b.length;d++){n=b[d];const l=y.find(S=>S.view.componentProps.categories[0].name===n.name),a=c.find(S=>S.view.componentProps.categories[0].name===n.name);if(!l||!a){i=!l;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((d,l,a,S)=>{let x={categories:l.view.componentProps.categories,analysisType:l.view.componentProps.analysisType,isAssistZoneVisible:this.filters.isAssistZoneVisible,howManyGames:this.filters.howManyGamesSelected.value,title:l.view.title,isHomeTeamForAnalysis:l.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:l.view.isHomeTeam};return d&&(d.isHomeTeam&&!l.view.isHomeTeam?(l.view.componentProps.categories=[n],l.view.componentProps.analysisType=this.filters.selectedGamePhase.name,l.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,l.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,l.view.componentProps.isHomeTeamForAnalysis=!0,l.view.title=n.name,r.view.titleShort=n.name,l.view.isHomeTeam=!0,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:n,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):!d.isHomeTeam&&!l.view.isHomeTeam&&(l.view.componentProps.categories=d.categories,l.view.componentProps.analysisType=d.analysisType,l.view.componentProps.isHomeTeamForAnalysis=d.isHomeTeamForAnalysis,l.view.componentProps.isAssistZoneVisible=d.isAssistZoneVisible,l.view.componentProps.howManyGames=d.howManyGames,l.view.title=d.title,l.view.titleShort=d.titleShort,l.view.isHomeTeam=d.isHomeTeam,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:l.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}),a===S.length-1&&(r.view.componentProps.categories=x.categories,r.view.componentProps.analysisType=x.analysisType,r.view.componentProps.isHomeTeamForAnalysis=x.isHomeTeamForAnalysis,r.view.componentProps.isAssistZoneVisible=x.isAssistZoneVisible,r.view.componentProps.howManyGames=x.howManyGames,r.view.title=x.title,r.view.titleShort=x.titleShort,r.view.isHomeTeam=x.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})),x},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 y=R===1,c=y?this.getHomeTeamViews():this.getAwayTeamViews();r.view.componentProps.isHomeTeamForAnalysis=y,r.view.isHomeTeam=y;for(let i=0;i<b.length;i++){const d=b[i];if(!c.find(l=>l.view.componentProps.categories[0].name===d.name)){r.view.componentProps.categories=[d],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=d.name,r.view.titleShort=d.name,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:d,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible};break}}}}}addView(r,n=!1){var b,R,y,c,i,d,l,a,S,x;if(r.view.filterAndViewsContainer=this,Un.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===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 v=this.getComponentDynamicFilters(r.view.id),p=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const o=p[0]===1?"offensive":"defensive",s=p[1]===1;r.view.componentProps.analysisType=o,r.view.componentProps.isHomeTeamForAnalysis=s,r.isHomeTeam=s,r.view.filterMultiple={isHomeTeam:s},Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:p})}if(this.viewId===1&&r.view.componentProps&&!n){const v=this.dynamicFilters[0]||[];if(v&&v.length>0){let p;if(Array.isArray(v)){const s=this.childViews.map(u=>{var m;return(m=u.view.componentProps)==null?void 0:m.type}).filter(u=>u!==void 0),f=v.filter(u=>!s.includes(u));f.length>0?p=f[0]:p=v[0]}else p=v;const o=Zh.get(this.viewId);r.view.componentProps.type=p,r.view.componentProps.default=!1,r.view.title=`Comparativa ${o[p]}`,r.view.filterMultiple={category:p}}}if(this.viewId===9&&r.view.componentProps&&!n){const v=this.dynamicFilters[0].map(f=>f.join("-"));let p="";const o=this.dynamicFilters[1],s=Zh.get(this.viewId);if(o===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(_=>{_.view.componentProps.isHomeTeamForAnalysis=!0,_.view.isHomeTeam=!0,_.view.filterMultiple&&(_.view.filterMultiple.isHomeTeam=!0)});let f=null;const u=this.getHomeTeamViews(),m=this.getAwayTeamViews();let w=!0;for(let _=0;_<v.length;_++){p=v[_],f=s.analysisTypes.get(v[_]);const T=u.find(L=>L.view.componentProps.analysisType===f.analysisType),V=m.find(L=>L.view.componentProps.analysisType===f.analysisType);if(!T||!V){w=!T;break}}w?this.childViews.length===0?(r.view.componentProps.analysisType=f.analysisType,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.title=f.title,r.view.titleShort=f.titleShort,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:p.split("-").map(_=>parseInt(_))}):this.childViews.reduce((_,T,V,L)=>{let O={analysisType:T.view.componentProps.analysisType,title:T.view.title,isHomeTeamForAnalysis:T.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:T.view.isHomeTeam};return _&&(_.isHomeTeam&&!T.view.isHomeTeam?(T.view.componentProps.analysisType=f.analysisType,T.view.componentProps.isHomeTeamForAnalysis=!0,T.view.title=f.title,r.view.titleShort=f.titleShort,T.view.isHomeTeam=!0,T.view.filterMultiple={isHomeTeam:T.view.isHomeTeam,categoryIds:p.split("-").map(U=>parseInt(U))}):!_.isHomeTeam&&!T.view.isHomeTeam&&(T.view.componentProps.analysisType=_.analysisType,T.view.componentProps.isHomeTeamForAnalysis=_.isHomeTeamForAnalysis,T.view.title=_.title,T.view.titleShort=_.titleShort,T.view.isHomeTeam=_.isHomeTeam,T.view.filterMultiple={isHomeTeam:T.view.isHomeTeam,categoryIds:p.split("-").map(U=>parseInt(U))}),V===L.length-1&&(r.view.componentProps.analysisType=O.analysisType,r.view.componentProps.isHomeTeamForAnalysis=O.isHomeTeamForAnalysis,r.view.title=O.title,r.view.titleShort=O.titleShort,r.view.isHomeTeam=O.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:p.split("-").map(U=>parseInt(U))})),O},null):(r.view.componentProps.analysisType=f.analysisType,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.title=f.title,r.view.titleShort=f.titleShort,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:p.split("-").map(_=>parseInt(_))})}else{const f=o===1,u=f?this.getHomeTeamViews():this.getAwayTeamViews();r.view.componentProps.isHomeTeamForAnalysis=f,r.view.isHomeTeam=f;for(let m=0;m<v.length;m++){const w=s.analysisTypes.get(v[m]);if(!u.find(_=>_.view.componentProps.analysisType===w.analysisType)){r.view.componentProps.analysisType=w.analysisType,r.view.title=w.title,r.view.titleShort=w.titleShort,r.view.filterMultiple={categoryIds:v[m].split("-").map(_=>parseInt(_)),isHomeTeam:r.view.isHomeTeam};break}}}}if(this.viewId===2&&!n&&r.view.componentProps){const v=this.getComponentDynamicFilters(r.view.id),p=v||this.dynamicFilters;!v&&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=p[1]===2?r.view.componentProps.game.awayTeam.team_id:p[1]===1?r.view.componentProps.game.homeTeam.team_id:0);const o=this.dynamicFilters[0]||[];let s=null;if(Array.isArray(o)){if(o.length>0){const m=this.childViews.map(_=>{var T;const V=(T=_.view.componentProps)==null?void 0:T.categoryView;return V&&V.length>0?V[0].id:null}).filter(_=>_!==null),w=o.filter(_=>!m.includes(_));w.length>0&&(s=w[0])}}else{const m=o;m&&(this.childViews.find(w=>{var _;const T=(_=w.view.componentProps)==null?void 0:_.categoryView;return T&&T.length>0&&T[0].id===m})||(s=m))}let f=null;if(s)try{f=Jh(s)}catch{}const u=p&&p.length>1?p[1]:1;r.view.filterMultiple={categoryId:s,teamType:u},r.view.componentProps.categoryView=f?[{id:s,name:f.name}]:s?[{id:s,name:`Category ${s}`}]:[{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=(b=r.view)==null?void 0:b.game,r.view.componentProps.teamSelected={teamId:(y=(R=r.view)==null?void 0:R.game)==null?void 0:y.home_team},r.view.componentProps.isDefault=!1,Un.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===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 v=this.getComponentDynamicFilters(r.view.id),p=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const o=p&&p.length>0?p[0]:[];if(o&&o.length>0){let s=0;for(const f of o)if(!this.childViews.find(u=>u.view.componentProps.gameNumber===f)){s=f;break}s&&(r.view.componentProps.gameNumber=s,r.view.filterMultiple={gameNumber:s})}Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:p})}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 v=this.getComponentDynamicFilters(r.view.id),p=v||this.dynamicFilters;!v&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const o=p&&p.length>0?p[0]:!1;r.view.componentProps.desplegable=o,r.view.componentProps.key=o,r.view.componentProps.game=(c=r.view)==null?void 0:c.game,r.view.componentProps.defaultShields=!1,Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:p})}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=(d=(i=r.view)==null?void 0:i.game)==null?void 0:d.game_id,r.view.componentProps.homeTeam=(a=(l=r.view)==null?void 0:l.game)==null?void 0:a.home_team,r.view.componentProps.awayTeam=(x=(S=r.view)==null?void 0:S.game)==null?void 0:x.visiting_team;const o=this.getComponentDynamicFilters(r.view.id),s=o||this.dynamicFilters;!o&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const f=s&&s.length>0?s[0]:[],u=this.hasEventTypeId(f,1),m=this.hasCategoryId(f,8),w=this.hasCategoryId(f,9),_=this.hasEventTypeId(f,3);r.view.componentProps.goals=u,r.view.componentProps.yellowCards=m,r.view.componentProps.redCards=w,r.view.componentProps.substitutions=_}const v=this.getComponentDynamicFilters(r.view.id)||this.dynamicFilters,p=v&&v.length>0?v[0]:[];r.view.componentProps.selectedEvents=p,r.view.componentProps.key=p.length>0,Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:v})}this.viewId===16&&this.addLastTouch(r),this.viewId===18&&this.addSpecificPlays(r),this.childViews.push(r),Un.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 b=r[0];return b===2||b===3?b: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 b=r[0],R=r[1];if(R===1||R===2){const y=R===1?this.getHomeTeamViews():this.getAwayTeamViews();return b.length-y.length}else return b*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===16&&n){const b=n.selectedCategories||[],R=n.selectedTeam.value;if(R===1||R===2){const y=R===1?this.getHomeTeamViews():this.getAwayTeamViews();return b.length-y.length}else return b.length*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===2){const b=r[0]||[],R=r[1]||1;if(!b||b.length===0)return 0;if(Array.isArray(b)){const y=this.childViews.map(c=>{var i;const d=(i=c.view.componentProps)==null?void 0:i.categoryView;return d&&d.length>0?d[0].id:null}).filter(c=>c!==null);return b.filter(c=>!y.includes(c)).length}else{const y=b;return this.childViews.find(c=>{var i,d;const l=(i=c.view.componentProps)==null?void 0:i.categoryView,a=((d=c.view.filterMultiple)==null?void 0:d.teamType)||1;return l&&l.length>0&&l[0].id===y&&a===R})?0:1}}if(this.viewId===1){const b=r[0]||[];if(!b||b.length===0)return 0;if(Array.isArray(b)){const R=this.childViews.map(y=>{var c;return(c=y.view.componentProps)==null?void 0:c.type}).filter(y=>y!==void 0);return b.filter(y=>!R.includes(y)).length}else{const R=b;return this.childViews.find(y=>{var c;return((c=y.view.componentProps)==null?void 0:c.type)===R})?0:1}}return 0}getRequiresAddView(r,n){if(console.log("getRequiresAddView - viewId:",this.viewId),console.log("filters:",n),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===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 b=r[0];return b?b.length>this.childViews.length:this.childViews.length===0}if(this.viewId===4){const b=r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0;return this.childViews.length===0&&b}if(this.viewId===9)return this.getRequiresAddViewMultipleAndBothTeams(r);if(this.viewId===16&&n){const b=[n.selectedCategories,n.selectedTeam.value];return this.getRequiresAddViewMultipleAndBothTeams(b,n.totalCategoriesSelected)}if(this.viewId===18&&n){console.log("getRequiresAddView - GSCShotMapAnalysis"),console.log("dynamicFilters:",r),console.log("filters:",n);const b=[n.howManyCorners,n.selectedTeam.value],R=this.getRequiresAddViewMultipleAndBothTeams(b,n.howManyCorners);return console.count("before aux18 return"),console.log("aux18:",R),R}if(this.viewId===1){const b=r[0]||[];if(!b||b.length===0)return!1;if(Array.isArray(b)){const R=this.childViews.map(y=>{var c;return(c=y.view.componentProps)==null?void 0:c.type}).filter(y=>y!==void 0);return b.filter(y=>!R.includes(y)).length>0}else{const R=b;return!this.childViews.find(y=>{var c;return((c=y.view.componentProps)==null?void 0:c.type)===R})}}if(this.viewId===2){const b=r[0]||[];if(Array.isArray(b)){if(b.length>0){const R=this.childViews.map(y=>{var c;const i=(c=y.view.componentProps)==null?void 0:c.categoryView;return i&&i.length>0?i[0].id:null}).filter(y=>y!==null);return b.filter(y=>!R.includes(y)).length>0}return!1}else{const R=b,y=r[1]||1;return R?!this.childViews.find(c=>{var i,d;const l=(i=c.view.componentProps)==null?void 0:i.categoryView,a=((d=c.view.filterMultiple)==null?void 0:d.teamType)||1;return l&&l.length>0&&l[0].id===R&&a===y}):!1}}return this.viewId===8||this.viewId===3||this.viewId===14?this.childViews.length===0:!1}getRequiresAddViewMultipleAndBothTeams(r,n=null){const b=this.childViews.filter(l=>l.view.isHomeTeam),R=this.childViews.filter(l=>!l.view.isHomeTeam),y=n||r[0].length,c=r[1],i=y*(c===1||c===2?1:2),d=c===3?b.length+R.length:b.length||R.length;return i>d}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===6){const n=r[0];return n===2||n===3}return this.viewId,!1}updateSummary({dynamicFilters:r}){const n=this.childViews[0],b=document.querySelector(`[gs-id="${n.view.id}"]`),R=n.grid;if(n&&b&&R){const y=r[0],c=`min_column${y?"_2":""}`,i=`min_row${y?"_2":""}`,d=`max_column${y?"_2":""}`,l=`max_row${y?"_2":""}`,a=`colspan${y?"_2":""}`,S=`rowspan${y?"_2":""}`,x=n.view.coreView[a],v=n.view.coreView[S],p=n.view.coreView[c],o=n.view.coreView[i],s=n.view.coreView[d],f=n.view.coreView[l];n.view.w=x,n.view.h=v,n.view.maxWidth=s,n.view.maxHeight=f,n.view.minWidth=p,n.view.minHeight=o,b.setAttribute("gs-w",x),b.setAttribute("gs-h",v),b.setAttribute("gs-max-w",s),b.setAttribute("gs-max-h",f),b.setAttribute("gs-min-w",p),b.setAttribute("gs-min-h",o),R.update(b,{h:v,w:x,"gs-max-h":f,"gs-max-w":s,"gs-min-h":o,"gs-min-w":p})}}updateFilters(r){this.filters=r,this.viewId===16?this.updateLastTouchFilters(r):this.viewId===18&&this.updateSpecificPlaysFilters(r)}updateDynamicFilters(r,n=null){if(!this._isUpdating){this._isUpdating=!0,n?this.componentSpecificFilters.set(n,[...r]):this.dynamicFilters=r,Un.emit("component-added-to-container",this);try{if(this.viewId===5){const b=r[0]||1;if(b<3)if(this.childViews.length===1){const R=this.childViews[0];R.view.componentProps&&(R.view.componentProps.preMatchType=b,R.view.filterMultiple={isHomeTeam:R.view.componentProps.preMatchType===1})}else{const R=this.childViews.pop(),y=R.grid,c=R.page,i=document.querySelector(`[gs-id="${R.view.id}"]`);if(y&&i&&(y.removeWidget(i),c)){const l=c.items.findIndex(a=>a.id===R.view.id);l!==-1&&c.items.splice(l,1)}const d=this.childViews[0];d.view.componentProps&&(d.view.componentProps.preMatchType=b,d.view.filterMultiple={isHomeTeam:d.view.componentProps.preMatchType})}else this.childViews.forEach((R,y)=>{R.view.componentProps.preMatchType=y+1,R.view.filterMultiple={isHomeTeam:R.view.componentProps.preMatchType}})}if(this.viewId===15){const b=r[0]||1;if(n){const R=this.childViews.find(y=>y.view.id===n);R&&R.view.componentProps&&(R.view.componentProps.preMatchType=b,R.view.filterMultiple={isHomeTeam:b===1})}else if(b<3){if(this.childViews.length===1){const R=this.childViews[0];R.view.componentProps&&(R.view.componentProps.preMatchType=b,R.view.filterMultiple={isHomeTeam:b===1})}else if(this.childViews.length>1){for(;this.childViews.length>1;){const y=this.childViews.pop(),c=y.grid,i=y.page,d=document.querySelector(`[gs-id="${y.view.id}"]`);if(c&&d&&(c.removeWidget(d),i)){const l=i.items.findIndex(a=>a.id===y.view.id);l!==-1&&i.items.splice(l,1)}}const R=this.childViews[0];R.view.componentProps&&(R.view.componentProps.preMatchType=b,R.view.filterMultiple={isHomeTeam:b===1})}}else if(this.childViews.length===2)this.childViews.forEach((R,y)=>{R.view.componentProps&&(R.view.componentProps.preMatchType=y+1,R.view.filterMultiple={isHomeTeam:y===0})});else if(this.childViews.length<2)this.childViews.forEach((R,y)=>{R.view.componentProps&&(R.view.componentProps.preMatchType=y+1,R.view.filterMultiple={isHomeTeam:y===0})});else{for(;this.childViews.length>2;){const R=this.childViews.pop(),y=R.grid,c=R.page,i=document.querySelector(`[gs-id="${R.view.id}"]`);if(y&&i&&(y.removeWidget(i),c)){const d=c.items.findIndex(l=>l.id===R.view.id);d!==-1&&c.items.splice(d,1)}}this.childViews.forEach((R,y)=>{R.view.componentProps&&(R.view.componentProps.preMatchType=y+1,R.view.filterMultiple={isHomeTeam:y===0})})}}if(this.viewId===10){const b=r[0]||1;if(b<3)if(this.childViews.length===1){const R=this.childViews[0];R.view.componentProps&&(R.view.componentProps.isHomeTeamForAnalysis=b===1,R.view.filterMultiple={isHomeTeam:R.view.componentProps.isHomeTeamForAnalysis})}else{const R=this.childViews.pop(),y=R.grid,c=R.page,i=document.querySelector(`[gs-id="${R.view.id}"]`);if(y&&i&&(y.removeWidget(i),c)){const l=c.items.findIndex(a=>a.id===R.view.id);l!==-1&&c.items.splice(l,1)}const d=this.childViews[0];d.view.componentProps&&(d.view.componentProps.isHomeTeamForAnalysis=b===1,d.view.filterMultiple={isHomeTeam:d.view.componentProps.isHomeTeamForAnalysis})}else this.childViews.forEach((R,y)=>{R.view.componentProps.isHomeTeamForAnalysis=y%2===0,R.view.filterMultiple={isHomeTeam:R.view.componentProps.isHomeTeamForAnalysis}})}if(this.viewId===7){const b=r[1];if(b===3)this.childViews.forEach((R,y)=>{R.view.componentProps.isHomeTeamForAnalysis=y%2===0,R.view.isHomeTeam=y%2===0,R.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",R.view.filterMultiple={isHomeTeam:R.view.isHomeTeam}});else{const R=b===1;if(this.childViews.length>0){const y=this.childViews[0];y.view.componentProps.isHomeTeamForAnalysis=R,y.view.isHomeTeam=R,y.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",y.view.filterMultiple={isHomeTeam:R},this.childViews.length>1&&this.removeChildView(this.childViews[1])}}}if(this.viewId===9){const b=r[0],R=r[1];if(R===3){if(this.childViews.length>b.length){const y=b.map(c=>{const i=c.join("-");return Zh.get(this.viewId).analysisTypes.get(i).analysisType});this.childViews.reduce((c,i)=>(y.includes(i.view.componentProps.analysisType)||c.push(i.view.componentProps.analysisType),c),[]).forEach(c=>{const i=this.childViews.findIndex(d=>d.view.componentProps.analysisType===c);if(i!==-1){const d=this.childViews[i];this.removeChildView(d)}})}}else{const y=R===1,c=this.getHomeTeamViews(),i=this.getAwayTeamViews();if(y&&c.length===0)i.forEach(d=>{d.view.componentProps.isHomeTeamForAnalysis=y,d.view.isHomeTeam=y,d.view.filterMultiple={categoryIds:b[0],isHomeTeam:y}});else if(!y&&i.length===0)c.forEach(d=>{d.view.componentProps.isHomeTeamForAnalysis=y,d.view.isHomeTeam=y,d.view.filterMultiple={categoryIds:b[0],isHomeTeam:y}});else if(c.length===i.length)y||c.forEach(d=>{d.view.filterMultiple={categoryIds:b[0],isHomeTeam:y}}),(y?i:c).forEach(d=>{this.removeChildView(d)});else{const d=y?this.getHomeTeamViews():this.getAwayTeamViews();if(d.length>b.length){const l=b.map(a=>{const S=a.join("-");return Zh.get(this.viewId).analysisTypes.get(S).analysisType});d.forEach(a=>{l.includes(a.view.componentProps.analysisType)?a.view.filterMultiple={categoryIds:b[0],isHomeTeam:y}:this.removeChildView(a)})}else d.forEach(l=>{l.view.filterMultiple={categoryIds:b[0],isHomeTeam:y}})}}}if(this.viewId===2){const b=r[0]||[];if(Array.isArray(b)){const R=this.childViews.map(y=>{var c,i;const d=(c=y.view.componentProps)==null?void 0:c.categoryView,l=((i=y.view.filterMultiple)==null?void 0:i.teamType)||1,a=d&&d.length>0?d[0].id:null;return a?{categoryId:a,teamType:l,viewId:y.view.id}:null}).filter(y=>y!==null);if(n){const y=this.childViews.find(c=>c.view.id===n);if(y){const c=r[1]||1,i=b[0];if(i){let d=null;try{d=Jh(i)}catch{}y.view.filterMultiple={categoryId:i,teamType:c},y.view.componentProps.game&&(c===1?y.view.componentProps.teamView=y.view.componentProps.game.homeTeam.team_id:c===2?y.view.componentProps.teamView=y.view.componentProps.game.awayTeam.team_id:y.view.componentProps.teamView=0),y.view.componentProps.categoryView=d?[{id:i,name:d.name}]:[{id:i,name:`Category ${i}`}]}}}if(!n){const y=r[1]||1;this.childViews.forEach(c=>{var i;const d=(i=c.view.componentProps)==null?void 0:i.categoryView;if(d&&d.length>0){const l=d[0].id;b.includes(l)&&(c.view.filterMultiple={categoryId:l,teamType:y})}})}if(R.map(y=>y.categoryId).filter(y=>!b.includes(y)).forEach(y=>{this.childViews.filter(c=>{var i;const d=(i=c.view.componentProps)==null?void 0:i.categoryView;return d&&d.length>0&&d[0].id===y}).forEach(c=>{this.removeChildView(c),Un.emit("component-removed",{viewId:c.view.id,categoryId:y})})}),n){const y=b[0];if(y){const c=this.childViews.find(i=>i.view.id===n);if(c){let i=null;try{i=Jh(y)}catch{}const d=r[1]||1;c.view.filterMultiple={categoryId:y,teamType:d},c.view.componentProps.game&&(c.view.componentProps.teamView=d===2?c.view.componentProps.game.awayTeam.team_id:d===1?c.view.componentProps.game.homeTeam.team_id:0),c.view.componentProps.categoryView=i?[{id:y,name:i.name}]:[{id:y,name:`Category ${y}`}]}}}}else{const R=b;if(R&&n){const y=this.childViews.find(c=>c.view.id===n);if(y){let c=null;try{c=Jh(R)}catch{}const i=r[1]||1;y.view.filterMultiple={categoryId:R,teamType:i},y.view.componentProps.game&&(y.view.componentProps.teamView=i===2?y.view.componentProps.game.awayTeam.team_id:i===1?y.view.componentProps.game.homeTeam.team_id:0),y.view.componentProps.categoryView=c?[{id:R,name:c.name}]:[{id:R,name:`Category ${R}`}]}}}}if(this.viewId===8){const b=r[0]||!1;this.childViews.forEach(R=>{R.view.componentProps&&(R.view.componentProps._isReactive||(R.view.componentProps=t.reactive(R.view.componentProps),R.view.componentProps._isReactive=!0),R.view.componentProps.areInactiveVisible=b,R.view.componentProps.key=b,Un.emit("component-props-updated",{viewId:R.view.id,componentProps:R.view.componentProps,dynamicFilters:r}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:R.view.id,dynamicFilters:r}))})}if(this.viewId===1){const b=r[0]||[];if(n){this.setDynamicFilters(r,n);const R=this.childViews.find(y=>y.view.id===n);R&&this.updateComparative(R,r)}else if(this.childViews.reduce((R,y)=>(b.includes(y.view.componentProps.type)||R.push(y.view.componentProps.type),R),[]).forEach(R=>{const y=this.childViews.findIndex(c=>c.view.componentProps.type===R);if(y!==-1){for(let c=y;c<this.childViews.length;c++){const i=this.childViews[c+1],d=this.childViews[c];i&&(d.view.componentProps.type=i.view.componentProps.type,d.view.title=i.view.title)}this.removeChildView(this.childViews[this.childViews.length-1])}}),Array.isArray(b))this.childViews.length>0&&b.length>0&&this.childViews.forEach((R,y)=>{if(R.view.componentProps&&y<b.length){const c=b[y],i=Zh.get(this.viewId);R.view.componentProps.type=c,R.view.componentProps.default=!1,R.view.title=`Comparativa ${i[c]}`,R.view.filterMultiple={category:c}}});else{const R=b;if(R&&this.childViews.length>0){const y=this.childViews[0];if(y.view.componentProps){const c=Zh.get(this.viewId);y.view.componentProps.type=R,y.view.componentProps.default=!1,y.view.title=`Comparativa ${c[R]}`,y.view.filterMultiple={category:R}}}}}if(this.viewId===6){const b=r[0]||[];if(n){this.setDynamicFilters(r,n);const R=this.childViews.find(y=>y.view.id===n);R&&this.updateGSCLineupsReports(R,r)}else{if(Array.isArray(b))if(b.length===0)for(;this.childViews.length>0;)this.removeChildView(this.childViews[0]);else this.childViews.reduce((R,y)=>(b.includes(y.view.componentProps.gameNumber)||R.push(y.view.componentProps.gameNumber),R),[]).forEach(R=>{const y=this.childViews.findIndex(c=>c.view.componentProps.gameNumber===R);if(y!==-1){for(let c=y;c<this.childViews.length;c++){const i=this.childViews[c+1],d=this.childViews[c];i&&(d.view.componentProps.gameNumber=i.view.componentProps.gameNumber,d.view.filterMultiple={gameNumber:i.view.componentProps.gameNumber})}this.removeChildView(this.childViews[this.childViews.length-1])}});this.childViews.forEach(R=>{R.view.componentProps&&(R.view.componentProps._isReactive||(R.view.componentProps=t.reactive(R.view.componentProps),R.view.componentProps._isReactive=!0),Un.emit("component-props-updated",{viewId:R.view.id,componentProps:R.view.componentProps,dynamicFilters:r}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:R.view.id,dynamicFilters:r}))})}}if(this.viewId===3){if(n){this.setDynamicFilters(r,n);const b=this.childViews.find(R=>R.view.id===n);b&&this.updateMatchSummary(b,r)}else{const b=r[0]||!1;this.childViews.forEach(R=>{R.view.componentProps&&(R.view.componentProps._isReactive||(R.view.componentProps=t.reactive(R.view.componentProps),R.view.componentProps._isReactive=!0),R.view.componentProps.desplegable=b,R.view.componentProps.key=b,Un.emit("component-props-updated",{viewId:R.view.id,componentProps:R.view.componentProps,dynamicFilters:r}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:R.view.id,dynamicFilters:r}))})}this.updateSummary({dynamicFilters:r})}if(this.viewId===13){const b=r[1]||[];if(n){this.setDynamicFilters(r,n);const R=this.childViews.find(y=>y.view.id===n);R&&(R.view.componentProps&&(R.view.componentProps.categoryids=b,R.view.componentProps.analysistype=r[0]||1,R.view.componentProps.teamsshow=r[2]==1?[1]:r[2]==2?[2]:[1,2],R.view.dynamicFilters=r,R.view._updateKey=Date.now()),Un.emit("component-props-updated",{viewId:R.view.id,componentProps:R.view.componentProps,dynamicFilters:r}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:R.view.id,dynamicFilters:r}))}else this.childViews.forEach(R=>{R.view.componentProps&&(R.view.componentProps._isReactive||(R.view.componentProps=t.reactive(R.view.componentProps),R.view.componentProps._isReactive=!0),R.view.componentProps.categoryids=b,R.view.componentProps.analysistype=r[0]||1,R.view.componentProps.teamsshow=r[2]==1?[1]:r[2]==2?[2]:[1,2],R.view.dynamicFilters=r,R.view._updateKey=Date.now(),Un.emit("component-props-updated",{viewId:R.view.id,componentProps:R.view.componentProps,dynamicFilters:r}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:R.view.id,dynamicFilters:r}))})}else if(this.viewId===15){const b=r[0]||1,R=r[3]!==void 0?r[3]:typeof r[1]=="number"?r[1]:null;if(n){this.setDynamicFilters(r,n);const y=this.childViews.find(c=>c.view.id===n);y&&y.view.componentProps&&(y.view.componentProps.analysistype=b,R!==null&&(y.view.componentProps.numitems=R),y.view.dynamicFilters=r,y.view._updateKey=Date.now(),Un.emit("component-props-updated",{viewId:y.view.id,componentProps:y.view.componentProps,dynamicFilters:r}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:y.view.id,dynamicFilters:r}))}else this.childViews.forEach(y=>{y.view.componentProps&&(y.view.componentProps._isReactive||(y.view.componentProps=t.reactive(y.view.componentProps),y.view.componentProps._isReactive=!0),y.view.componentProps.analysistype=b,R!==null&&(y.view.componentProps.numitems=R),y.view.dynamicFilters=r,y.view._updateKey=Date.now(),Un.emit("component-props-updated",{viewId:y.view.id,componentProps:y.view.componentProps,dynamicFilters:r}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:y.view.id,dynamicFilters:r}))})}if(this.viewId===4){const b=r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0;if(n){const R=this.childViews.find(y=>y.view.id===n);R&&R.view.componentProps.selectedEvents}else if(!b&&this.childViews.length>0)this.childViews.forEach(R=>{this.removeChildView(R)});else if(b&&this.childViews.length===0){const R={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};Un.emit("add-view",R)}else this.childViews.forEach(R=>{this.updateTimeline(R,r)})}}finally{this._isUpdating=!1}}}removeAllChildViews(){[...this.childViews].forEach(r=>{this.removeChildView(r)})}removeChildView(r,n=!1){const b=this.childViews.findIndex(R=>R.view.id===r.view.id);if(b!==-1){const R=this.childViews[b];this.childViews.splice(b,1),R.view.id&&this.componentSpecificFilters.delete(R.view.id);const y=R.grid,c=R.page,i=document.querySelector(`[gs-id="${R.view.id}"]`);if(y&&i&&(y.removeWidget(i),c&&!n)){const d=c.items.findIndex(l=>l.id===R.view.id);d!==-1&&(c.items.splice(d,1),c.items.length===0&&Un.emit("empty-page",c))}}}updateView({view:r,dynamicFilters:n,filtersJSON:b,filters:R}){this.setFiltersJSON(b),this.dynamicFilters=n;const y=this.childViews.find(c=>{var i;return((i=c.view)==null?void 0:i.id)===r.view.id});if(y){y.view.filtersJSON=b,y.view.coreView&&(y.view.coreView.filtersJSON=b);let c=n;if(this.viewId===4){const i=this.getComponentDynamicFilters(r.view.id);i&&(c=i)}else if(this.viewId===8){const i=this.getComponentDynamicFilters(r.view.id);i&&(c=i)}else if(this.viewId===3){const i=this.getComponentDynamicFilters(r.view.id);i&&(c=i),this.updateSummary({dynamicFilters:c})}else if(this.viewId===1){const i=this.getComponentDynamicFilters(r.view.id);i&&(c=i)}else if(this.viewId===6){const i=this.getComponentDynamicFilters(r.view.id);i&&(c=i)}else if(this.viewId===7){const i=this.getComponentDynamicFilters(r.view.id);i&&(c=i)}else if(this.viewId===9){const i=this.getComponentDynamicFilters(r.view.id);i&&(c=i)}this.viewId===5?this.updateVolumetricField(y,c):this.viewId===7?this.updateGoalData(y,c):this.viewId===9?this.updateFieldDataByZones(y,n):this.viewId===10?this.updateXg(y,c):this.viewId===3?this.updateMatchSummary(y,c):this.viewId===4?this.updateTimeline(y,c):this.viewId===8?this.updateFieldPosesion(y,c):this.viewId===1?this.updateComparative(y,c):this.viewId===2?this.updateGSCtops(y,c):this.viewId===6?this.updateGSCLineupsReports(y,c):this.viewId===16?this.updateLastTouchSingle(y,R):this.viewId===18&&this.updateSpecificPlaysFiltersSingle(y,R)}}updateComparative(r,n){if(r.view.componentProps){const b=n[0]||[];if(b&&b.length>0){let R;if(Array.isArray(b)){const c=this.childViews.findIndex(i=>i.view.id===r.view.id);c>=0&&c<b.length?R=b[c]:R=b[0]}else R=b;const y=Zh.get(this.viewId);r.view.componentProps.type=R,r.view.componentProps.default=!1,r.view.title=`Comparativa ${y[R]}`,r.view.filterMultiple={category:R}}Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n})}}updateVolumetricField(r,n){if(r.view.componentProps){const b=n[0]||1;r.view.isHomeTeam=b===1,r.view.componentProps.preMatchType=b,r.view.filterMultiple={isHomeTeam:b},Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n}),Un.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateGoalData(r,n){if(r.view.componentProps){const b=n[0]===1?"offensive":"defensive",R=n[1]===1;r.view.componentProps.analysisType=b,r.view.componentProps.isHomeTeamForAnalysis=R,r.view.isHomeTeam=R,r.view.filterMultiple={isHomeTeam:R},Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n}),Un.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateFieldDataByZones(r,n){if(r.view.componentProps){const b=n[0],R=n[1]===1;if(r.view.componentProps.isHomeTeamForAnalysis=R,r.view.isHomeTeam=R,r.view.filterMultiple={categoryIds:b,isHomeTeam:R},b&&b.length){const y=b.join("-"),c=Zh.get(this.viewId).analysisTypes.get(y);c&&(r.view.componentProps.analysisType=c.analysisType,r.view.title=c.title,r.view.titleShort=c.titleShort)}}}updateXg(r,n){const b=n[0]===1;r.view.componentProps&&(r.view.isHomeTeam=b,r.view.componentProps.isHomeTeamForAnalysis=b,r.view.filtersJSON=this.filtresJSON,r.view.filterMultiple={isHomeTeam:b})}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 b=n&&n.length>0?n[0]:!1;r.view.componentProps.desplegable=b,r.view.componentProps.key=b,Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Un.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 b=this.getComponentDynamicFilters(r.view.id)||n,R=b&&b.length>0?b[0]:[];r.view.componentProps.selectedEvents=R,r.view.componentProps.key=R.length>0;const y=this.hasEventTypeId(R,1),c=this.hasCategoryId(R,8),i=this.hasCategoryId(R,9),d=this.hasEventTypeId(R,3);r.view.componentProps.goals=y,r.view.componentProps.yellowCards=c,r.view.componentProps.redCards=i,r.view.componentProps.substitutions=d,r.view.componentProps._updateKey=Date.now(),Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:b}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:b}),Un.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 b=n&&n.length>0?n[0]:!1;r.view.componentProps.areInactiveVisible=b,r.view.componentProps.key=b,Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n})}}updateGSCtops(r,n){if(r.view.componentProps){const b=n[0]||[];if(Array.isArray(b)){if(b.length>0){const R=b[0];let y=null;try{y=Jh(R)}catch(i){console.warn("Error getting category by ID:",i)}const c=n[1]||1;r.view.filterMultiple={categoryId:R,teamType:c},r.view.componentProps.game&&(c===1?r.view.componentProps.teamView=r.view.componentProps.game.homeTeam.team_id:c===2?r.view.componentProps.teamView=r.view.componentProps.game.awayTeam.team_id:r.view.componentProps.teamView=0),r.view.componentProps.categoryView=y?[{id:R,name:y.name}]:[{id:R,name:`Category ${R}`}]}}else{const R=b;if(R){let y=null;try{y=Jh(R)}catch(i){console.warn("Error getting category by ID:",i)}const c=n[1]||1;r.view.filterMultiple={categoryId:R,teamType:c},r.view.componentProps.game&&(c===1?r.view.componentProps.teamView=r.view.componentProps.game.homeTeam.team_id:c===2?r.view.componentProps.teamView=r.view.componentProps.game.awayTeam.team_id:r.view.componentProps.teamView=0),r.view.componentProps.categoryView=y?[{id:R,name:y.name}]:[{id:R,name:`Category ${R}`}]}}}}updateGSCLineupsReports(r,n){if(r.view.componentProps){const b=n[0]||[];if(Array.isArray(b)){if(b.length>0){const R=b[0];r.view.filterMultiple={gameNumber:R},r.view.componentProps.gameNumber=R}}else{const R=b;R&&(r.view.filterMultiple={gameNumber:R},r.view.componentProps.gameNumber=R)}Un.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:n}),Un.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:n}),Un.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}getCategoryIdFromAnalysisType(r,n){if(!r||!n)return null;for(const b of n){const R=b.join("-"),y=Zh.get(this.viewId);if(y&&y.analysisTypes){const c=y.analysisTypes.get(R);if(c&&c.analysisType===r)return b[0]||null}}return null}updateLastTouchFilters(){if(!this.filters){console.warn("No filters available in updateLastTouchFilters");return}this.childViews.forEach(R=>{R.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,R.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,R.view.filterMultiple.howManyGamesSelected=this.filters.howManyGamesSelected,R.view.filterMultiple.isAssistZoneVisible=this.filters.isAssistZoneVisible});const r=this.filters.selectedCategories.map(R=>R.value),n=r.map(R=>R.name),b=this.filters.selectedTeam.value;if(b===3)this.childViews.length>r&&this.childViews.reduce((R,y)=>(n.includes(y.view.componentProps.categories[0].name)||R.push(y.view.componentProps.categories[0].name),R),[]).forEach(R=>{const y=this.childViews.findIndex(c=>c.view.componentProps.categories[0].name===R);if(y!==-1){const c=this.childViews[y];this.removeChildView(c)}});else{const R=b===1,y=this.getHomeTeamViews(),c=this.getAwayTeamViews();if(R&&y.length===0)c.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=R,i.view.isHomeTeam=R,i.view.filterMultiple.isHomeTeam=R});else if(!R&&c.length===0)y.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=R,i.view.isHomeTeam=R,i.view.filterMultiple.isHomeTeam=R});else if(y.length===c.length)R||y.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=R,i.view.isHomeTeam=R,i.view.filterMultiple.isHomeTeam=R}),(R?c:y).forEach(i=>{this.removeChildView(i)});else{const i=R?this.getHomeTeamViews():this.getAwayTeamViews();if(i.length>r.length){const d=r.map(l=>l.name);i.forEach(l=>{d.includes(l.view.componentProps.categories[0].name)?l.view.filterMultiple.isHomeTeam=R:this.removeChildView(l)})}else i.forEach(d=>{d.view.filterMultiple.isHomeTeam=R})}}}updateLastTouchSingle(r,n){if(r.view.componentProps){const b=n.selectedTeam.value===1,R=n.selectedCategory.value;r.view.isHomeTeam=b,r.view.componentProps.isHomeTeamForAnalysis=b,r.view.componentProps.categories=[R],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=R.name,r.view.titleShort=R.name,r.view.isHomeTeam=b,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:R,selectedGamePhase:n.selectedGamePhase,howManyGamesSelected:n.howManyGamesSelected,isAssistZoneVisible:n.isAssistZoneVisible}}}updateSpecificPlaysFilters(){if(console.log("updateSpecificPlaysFilters called"),!this.filters){console.warn("No filters available in updateCornershFilters");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(),b=this.getAwayTeamViews();if(n.length+b.length>this.filters.howManyCorners*2){const R=[];n.forEach((y,c)=>{c>=this.filters.howManyCorners&&R.push(y)}),b.forEach((y,c)=>{c>=this.filters.howManyCorners&&R.push(y)}),R.forEach(y=>{this.removeChildView(y)})}}else{const n=r===1,b=this.getHomeTeamViews(),R=this.getAwayTeamViews();n&&b.length===0?R.forEach(y=>{console.log("awayView before update:",y),y.view.componentProps.isHomeTeamForAnalysis=n,y.view.isHomeTeam=n,y.view.filterMultiple.isHomeTeam=n}):!n&&R.length===0?b.forEach(y=>{y.view.componentProps.isHomeTeamForAnalysis=n,y.view.isHomeTeam=n,y.view.filterMultiple.isHomeTeam=n}):b.length===R.length&&(n||b.forEach(y=>{y.view.componentProps.isHomeTeamForAnalysis=n,y.view.isHomeTeam=n,y.view.filterMultiple.isHomeTeam=n}),(n?R:b).forEach(y=>{this.removeChildView(y)}))}}updateSpecificPlaysFiltersSingle(r,n){if(console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"),console.log("view:",r),console.log("filter:",n),console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"),n.selectedTeam&&r.view.componentProps){const b=n.selectedTeam.value===1;r.view.isHomeTeam=b,r.view.componentProps.isHomeTeamForAnalysis=b,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.advancedFilters=n.advancedFilters,r.view.isHomeTeam=b,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:n.advancedFilters}}}}const z9e={class:"template-page__header"},E9e={class:"template-page__header__name"},P9e=["value"],R9e={class:"template-page__header__details"},M9e={class:"template-page__header__details__teams"},F9e={class:"template-page__header__details__teams__team"},j9e={key:0,class:"template-page__header__details__teams__team__logo"},W9e=["src"],A9e={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},K9e={class:"template-page__header__details__teams__team"},I9e={key:0,class:"template-page__header__details__teams__team__logo"},X9e=["src"],D9e={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B9e={class:"template-page__content"},G9e=["id"],J9e=["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"],Z9e=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,b,R;const y=t.ref(null);let c=null;const i=e,d=t.ref(!1),l=r,a=t.computed(()=>i.page.items.reduce((W,A)=>(W.set(A.id,A),W),new Map)),S=t.computed(()=>{var W,A,X,D;return i.game&&i.game.homeTeam&&i.game.awayTeam?{homeTeam:{name:((W=i.game.homeTeam)==null?void 0:W.acronym)||"LOC",logo:((A=i.game.homeTeam)==null?void 0:A.logo)||null},awayTeam:{name:((X=i.game.awayTeam)==null?void 0:X.acronym)||"VIS",logo:((D=i.game.awayTeam)==null?void 0:D.logo)||null}}:{homeTeam:{name:"LOC"},awayTeam:{name:"VIS"}}});let x=null,v=null,p=!1,o=null,s=!1;const f=()=>{s=!0},u=()=>{s=!1};function m(){s||(p=!0,o&&clearTimeout(o),o=setTimeout(()=>{p=!1},150))}function w(){const W={root:null,rootMargin:"0px",threshold:.7};x=new IntersectionObserver(D=>{D.forEach(Y=>{if(p){v&&clearTimeout(v),v=setTimeout(()=>{l("intersection-changed",Y.isIntersecting)},100);return}v&&clearTimeout(v),v=setTimeout(()=>{l("intersection-changed",Y.isIntersecting)},50)})},W);const A=y.value;A&&x.observe(A);const X=document.querySelector(".container-main");X&&X.addEventListener("scroll",m,{passive:!0}),document.addEventListener("programmatic-scroll-start",f),document.addEventListener("programmatic-scroll-end",u)}function _(W){i.page.title=W.target.value,l("view-changed")}const T={game_id:0,season_id:0,prematch:!1},V={gameId:90209,id:90209,seasonId:1909,regularSeasonId:1909,matchday_name:"Matchday 1",status:1,score:[1,3],game_status:1,dateTimeUTC:"2024-09-05T22:00:00Z",homeTeam:{logo:"https://golstatsimages.blob.core.windows.net/teams-80/2936.png",team_id:2936,provisional_logo:"https://golstatsimages.blob.core.windows.net/teams-provisional/2936.png",colloquial_name:"Guyana",acronym:"GUY",team_name:"Guyana"},awayTeam:{logo:"https://golstatsimages.blob.core.windows.net/teams-80/3279.png",team_id:3279,provisional_logo:"https://golstatsimages.blob.core.windows.net/teams-provisional/3279.png",colloquial_name:"Surinam",acronym:"SUR",team_name:"Surinam"},is_live:0,minutes:{home_goals_minutes:[],visiting_goals_minutes:[],home_yellow_cards_minutes:[],away_yellow_cards_minutes:[],home_red_cards_minutes:[],away_red_cards_minutes:[]}},L=new Map([[5,{component:D4,componentName:"GSCVolumetricField",props:{isGamePreMatch:!i.isPostMatch,areTeamsVisible:!1,isTitleVisible:!1,isGhostEffect:i.isTemplateMode,isTemplateMode:i.isTemplateMode,preMatchType:1}}],[2,{component:P7,componentName:"GscTopPlayer",props:{categoryView:[{id:0,name:"Category"}],gamed:i.game?i.game.id:V.gameId,game:i.game,season:i.game?(n=i==null?void 0:i.game)==null?void 0:n.season_id:V.seasonId,teamView:0,useDummyData:i.isTemplateMode}}],[8,{component:F9,componentName:"FieldPosesion",props:{widthSection:600,game:V,teamSelected:{teamId:0},areInactiveVisible:!0,showTitle:!1,isDefault:!0,key:!1}}],[6,{component:Kk,componentName:"GSCLineupsReports",props:{selectedOption:i.isPostMatch?"Postmatch":"Prematch",game:T,gamehome:T,gameaway:T}}],[3,{component:A9,componentName:"GSCMatchSummary",props:{game:V,defaultShields:!0,desplegable:!1}}],[4,{component:k8,componentName:"GSCTimelineReports",props:{key:!0,isDefault:!0,gameId:V.gameId,homeTeam:V.homeTeam.team_id,awayTeam:V.awayTeam.team_id,token:i.token,goals:!0,yellowCards:!0,redCards:!0,substitutions:!0}}],[7,{component:qN,componentName:"GSCGoalData",props:{game:i.game,isHomeTeamForAnalysis:!0,canInteract:!1,canPlayVideos:!1,isPreMatch:!i.isPostMatch,analysisType:1}}],[9,{component:Ik,componentName:"GSCFieldDataByZones",props:{game:i.game,isHomeTeamForAnalysis:!0,analysisType:"successfulPasses",canPlayVideos:!1,isPreMatch:!i.isPostMatch,negative:!0}}],[10,{component:F5,componentName:"GSCGameXg",props:{game:i.game,isHomeTeamForAnalysis:!0,isPostMatch:i.isPostMatch}}],[13,{component:e4,componentName:"GSCTimelapseTable",props:{isdefault:!0,seasonId:i.game?(b=i==null?void 0:i.game)==null?void 0:b.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:p6,componentName:"GSCGeneraltable",props:{isReports:!0,isDefault:!0,type:0,typeView:1,tournament:1,currentSeasonId:2010,showVideos:!1,localTeam:2,awayTeam:1}}],[15,{component:OV,componentName:"GSCStrengths",props:{token:i.token,view:1,numitems:3,typegame:1,isdefault:!0,data:{player:35240,season:1772,type:2,team:14}}}],[10,{component:F5,componentName:"GSCGameXg",props:{game:i.game,isHomeTeamForAnalysis:!0,isPostMatch:i.isPostMatch}}],[1,{component:VN,componentName:"GSCComparativeReports",props:{gameId:i.game?i.game.id:"",homeLogo:i.game?i.game.homeTeam.logo:"",awayLogo:i.game?i.game.awayTeam.logo:"",seasonId:i.game?(R=i==null?void 0:i.game)==null?void 0:R.season_id:0,typeGame:i.isPostMatch,type:"stoppedBall",default:i.isTemplateMode}}],[16,{component:RV,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:i.isTemplateMode,isPreMatch:!i.isPostMatch}}],[18,{component:OL,componentName:"GSCSpecificPlays",props:{isHomeTeamForAnalysis:!0,isTemplateMode:i.isTemplateMode,isPreMatch:!i.isPostMatch,seasonIdForAnalysis:1325,selectedCategory:31,teamIdForAnalysis:1,iaAgainstMode:!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 O(W){if(W)if(typeof W=="string"){let A=null;switch(W){case"GSCVolumetricField":A=D4;break;case"GSCGoalData":A=qN;break;case"GscTopPlayer":A=P7;break;case"FieldPosesion":A=F9;break;case"GSCLineupsReports":A=Kk;break;case"GSCMatchSummary":A=A9;break;case"GSCTimelineReports":A=k8;break;case"GSCFieldDataByZones":A=Ik;break;case"GSCGeneraltable":A=p6;break;case"GSCTimelapseTable":A=e4;break;case"GSCGameXg":A=F5;break;case"GSCComparativeReports":A=VN;break;case"GSCStrengths":A=OV;break;case"GSCLastTouch":A=RV;break;case"GSCSpecificPlays":A=OL;break;default:A=null}return A}else return W;return null}function U({pageId:W,view:A,filterAndWidgetContainer:X,applyMinimumSize:D=!1,dynamicFilters:Y=[],filters:re=null}){if(i.page.id===W&&c){let G=!1;A.id===3&&(G=Y[0]);const te=`min_column${G?"_2":""}`,ee=`min_row${G?"_2":""}`,H=`colspan${G?"_2":""}`,$=`rowspan${G?"_2":""}`,oe={w:D?A[te]:A[H],h:D?A[ee]:A[$]};if(c.willItFit(0,0,oe.w,oe.h,!0)){const se=c.addWidget(oe),ce=Number(se.getAttribute("gs-x")||0),he=Number(se.getAttribute("gs-y")||0);c.removeWidget(se);const ne=L.get(A.id),de=t.reactive({...JSON.parse(JSON.stringify(ne.props))||{},_isReactive:!0}),ue=t.reactive({pageId:W,grid:c,page:i.page,view:{name:A.name,title:A.title,key:Date.now()-7*Math.random(),id:`w-${String(Date.now())}`,x:ce,y:he,w:oe.w,h:oe.h,maxWidth:A.max_column,maxHeight:A.max_row,minWidth:A.min_column,minHeight:A.min_row,componentName:ne.componentName,componentProps:de,pageId:W,coreView:A}});X.addView(ue),Un.emit("add-page-view",ue)}else Un.emit("add-page-and-view",{pageId:W,view:A,filterAndWidgetContainer:X})}}function q(W){if(c){const A=document.querySelector(`[gs-id="${W.id}"]`);A&&(c.removeWidget(A),l("delete-view",W))}}function z(W){if(!W.filterAndViewsContainer&&W.coreView){const A=new p1(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[W],W.coreView.id,W.dynamicFilters||[],i.isPostMatch,i.isTemplateMode,W.filtersJSON,null,W.filters);W.filterAndViewsContainer=A}l("edit-view",W)}function C(){l("delete-page",i.page)}function N(){Un.emit("change-sort",i.page)}function E(W){if(p)return;const A=i.page.items.find(X=>X.id===W.itemId||X.id===W.viewId);A&&(Object.assign(A.componentProps,W.componentProps),A._updateKey=Date.now())}function k(W){if(p)return;const A=i.page.items.find(X=>X.id===W.viewId);A&&(Object.assign(A.componentProps,W.componentProps),A._updateKey=Date.now())}function P(W){if(p)return;const A=i.page.items.find(X=>X.id===W.viewId);A&&(Object.assign(A.componentProps,W.componentProps||{}),A._updateKey=Date.now())}const F=function(){Un.off("add-view",U),Un.off("force-component-update",E),Un.off("component-props-updated",k),Un.off("dynamic-filters-changed",P);const W=document.querySelector(".container-main");W&&W.removeEventListener("scroll",m),v&&clearTimeout(v),o&&clearTimeout(o)};return Un.on("add-view",U),Un.on("force-component-update",E),Un.on("component-props-updated",k),Un.on("dynamic-filters-changed",P),t.onMounted(async()=>{await t.nextTick(),c=bi.init({column:12,row:12,maxRow:12,cellHeight:60,float:!0,resizable:{handles:"e, se, s, sw, w"}},`#grid-stack-${i.id}`),c.on("change",(W,A)=>{const X=A[0];if(X){const D=a.value.get(X.id);D&&(D.x=X.x,D.y=X.y,D.w=X.w,D.h=X.h,l("view-changed"))}}),w(),i.page.grid=c,i.page.offListeners=F}),t.onUnmounted(()=>{x&&x.disconnect(),F(),v&&clearTimeout(v),o&&clearTimeout(o),document.removeEventListener("programmatic-scroll-start",f),document.removeEventListener("programmatic-scroll-end",u)}),(W,A)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"templatePage",ref:y,class:"template-page"},[t.createElementVNode("div",z9e,[d.value?(t.openBlock(),t.createBlock(qL,{key:0,"options-type":"page",onClick:A[0]||(A[0]=t.withModifiers(X=>d.value=!1,["self"])),onMouseleave:A[1]||(A[1]=X=>d.value=!1),onCloseTooltip:A[2]||(A[2]=X=>d.value=!1),onDeletePage:C,onChangeSort:N})):t.createCommentVNode("",!0),t.createElementVNode("div",E9e,[A[4]||(A[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)),A[5]||(A[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:_},null,40,P9e)]),t.createElementVNode("div",R9e,[t.createElementVNode("div",M9e,[t.createElementVNode("div",F9e,[S.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",j9e,[t.createElementVNode("img",{src:S.value.homeTeam.logo,alt:"Home Team Logo",width:"25",height:"25"},null,8,W9e)])):(t.openBlock(),t.createElementBlock("svg",A9e,[...A[6]||(A[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(S.value.homeTeam.name),1)]),A[8]||(A[8]=t.createElementVNode("div",{class:"template-page__header__details__teams__vs"}," VS ",-1)),t.createElementVNode("div",K9e,[t.createElementVNode("span",null,t.toDisplayString(S.value.awayTeam.name),1),S.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",I9e,[t.createElementVNode("img",{src:S.value.awayTeam.logo,alt:"Away Team Logo",width:"25",height:"25"},null,8,X9e)])):(t.openBlock(),t.createElementBlock("svg",D9e,[...A[7]||(A[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:A[3]||(A[3]=X=>d.value=!0)},[...A[9]||(A[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",B9e,[t.createElementVNode("div",{id:`grid-stack-${e.id}`,class:"grid-stack"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.page.items,X=>{var D,Y,re;return t.openBlock(),t.createElementBlock("div",{class:"grid-stack-item",key:X.key,"gs-id":X.id,"gs-x":X.x,"gs-y":X.y,"gs-w":X.w,"gs-h":X.h,"gs-max-w":X.maxWidth,"gs-max-h":X.maxHeight,"gs-min-w":X.minWidth,"gs-min-h":X.minHeight,"gs-no-resize":!e.isTemplateMode,"gs-no-move":!i.isTemplateMode,"gs-auto-position":X.x===0&&X.y===0},[t.createElementVNode("div",{class:t.normalizeClass(["grid-stack-item-content",{"is-selected":X.isSelected}])},[t.createVNode(S9e,{view:X,"is-template-mode":e.isTemplateMode,"is-post-match":e.isPostMatch,game:e.game,lastGames:e.lastGames,"is-home-team":(D=X.componentProps)!=null&&D.preMatchType?((Y=X.componentProps)==null?void 0:Y.preMatchType)===1:X.isHomeTeam,"is-filter-visible":e.isFilterVisible,"view-id":((re=X==null?void 0:X.coreView)==null?void 0:re.id)||0,onEdit:G=>z(X),onDelete:G=>q(X)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(O(X.componentName)),t.mergeProps({ref_for:!0},X.componentProps,{key:`${X.id}-${X._updateKey||0}`}),null,16))]),_:2},1032,["view","is-template-mode","is-post-match","game","lastGames","is-home-team","is-filter-visible","view-id","onEdit","onDelete"])],2)],8,J9e)}),128))],8,G9e)])],512))}}),H9e=pc(Z9e,[["__scopeId","data-v-9b6eca9e"]]),Y9e={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},Q9e={key:0,class:"cover__main-logo cover__main-logo__home"},$9e={key:0,class:"team-logo"},e8e=["src"],t8e={key:1,width:"575",height:"675",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r8e=["fill"],a8e={key:1,class:"cover__main-logo cover__main-logo__away"},n8e={key:0,class:"team-logo"},i8e=["src"],o8e={key:1,width:"575",height:"575",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s8e=["fill"],l8e={class:"cover__title-subtitle"},c8e={class:"cover__title-subtitle__title"},u8e={class:"cover__title-subtitle__subtitle"},d8e={key:2,class:"cover-type-one"},p8e={class:"team-info-one"},h8e={class:"team-data"},f8e={key:0,class:"team-logo"},m8e=["src"],y8e={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g8e=["fill","opacity"],v8e={class:"team-name"},b8e={key:0,class:"team-events"},x8e={class:"score-one"},w8e={key:0},_8e={class:"team-info-one"},S8e={class:"team-data"},T8e={key:0,class:"team-logo"},k8e=["src"],N8e={key:1,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},V8e=["fill","opacity"],L8e={class:"team-name"},O8e={key:0,class:"team-events"},q8e={key:3,class:"cover-type-two"},C8e={class:"team-data"},U8e={class:"team-info"},z8e={key:0,class:"team-logo"},E8e=["src"],P8e={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},R8e=["fill","opacity"],M8e={key:2,class:"team-score-two"},F8e={key:0,class:"team-goals"},j8e={class:"team-data"},W8e={class:"team-info"},A8e={key:0,class:"team-score-two"},K8e={key:1,class:"team-logo"},I8e=["src"],X8e={key:2,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},D8e=["fill","opacity"],B8e={key:0,class:"team-goals"},G8e={__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,b=r,R=t.ref(null),y=t.computed(()=>[1,2].includes(n.coverId)),c=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}),d=t.computed(()=>n.game&&n.game.score?n.game.score:["0","0"]),l=t.computed(()=>{var O,U,q,z,C,N,E,k;if(n.game&&n.game.homeTeam&&n.game.awayTeam){const P={homeTeam:{name:((O=n.game.homeTeam)==null?void 0:O.acronym)||"LOC",logo:((U=n.game.homeTeam)==null?void 0:U.logo)||null},awayTeam:{name:((q=n.game.awayTeam)==null?void 0:q.acronym)||"VIS",logo:((z=n.game.awayTeam)==null?void 0:z.logo)||null}};return y.value?(P.homeTeam.goalsMinutes=o(n.game.minutes.home_goals_minutes),P.homeTeam.totalYellowCards=((C=n.game.minutes.home_yellow_cards_minutes)==null?void 0:C.length)||0,P.homeTeam.totalRedCards=((N=n.game.minutes.home_red_cards_minutes)==null?void 0:N.length)||0,P.awayTeam.goalsMinutes=o(n.game.minutes.visiting_goals_minutes),P.awayTeam.totalYellowCards=((E=n.game.minutes.away_yellow_cards_minutes)==null?void 0:E.length)||0,P.awayTeam.totalRedCards=((k=n.game.minutes.away_red_cards_minutes)==null?void 0:k.length)||0):(P.homeTeam.goalsEvents=p(n.game.report_minutes.home_goals_minutes),P.awayTeam.goalsEvents=p(n.game.report_minutes.visiting_goals_minutes)),P}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":c.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"})),S=t.computed(()=>n.isPostMatch?"Postmatch":"Prematch"),x=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],v=t.computed(()=>{if(n.game){let O=Y9e[n.game.matchday_abbreviation];O||(O=n.game.matchday_abbreviation.replace("M","J"));const[U,q,z]=n.game.date.split("-");return`${O} - ${z} ${x[Number(q)-1]}, ${U}`}return"Jornada - Día 00 Mes"});function p(O){return!O||!Array.isArray(O)||O.length===0?"":O.map(U=>{const q=U.split(", ");let z=q[0].replace("'","");z=z.replace("+",""),z=z.replace("’","");const C=z.split(" "),{strings:N,numbers:E}=C.reduce((F,W)=>(isNaN(Number(W))?F.strings.push(W):F.numbers.push(W),F),{strings:[],numbers:[]}),k=N.join(" "),P=E.length===1?`${E[0]}'`:`${E[0]}' ${E.slice(1).join(" + ")}'`;return{playerName:k,goalTime:q.length===1?P:`${P}, ${q.reduce((F,W,A)=>A===0?F:`${F}${W}${A<q.length-1?", ":""}`,"")}`}})}function o(O){return!O||!Array.isArray(O)||O.length===0?"":O.reduce((U,q,z)=>{const C=q.split(" ");let N="";return C.length===3?N=C[2]:C.length===5&&(N=`${C[2]} ${C[3]} ${C[4]}`),N&&(U+=`${N}${z<O.length-1?", ":""}`),U},"")}let s=null,f=null,u=!1,m=null,w=!1;const _=()=>{w=!0},T=()=>{w=!1};function V(){w||(u=!0,m&&clearTimeout(m),m=setTimeout(()=>{u=!1},150))}function L(){const O={root:null,rootMargin:"0px",threshold:.7};s=new IntersectionObserver(z=>{z.forEach(C=>{if(u){f&&clearTimeout(f),f=setTimeout(()=>{b("intersection-changed",C.isIntersecting)},100);return}f&&clearTimeout(f),f=setTimeout(()=>{b("intersection-changed",C.isIntersecting)},50)})},O);const U=R.value;U&&s.observe(U);const q=document.querySelector(".container-main");q&&q.addEventListener("scroll",V,{passive:!0}),document.addEventListener("programmatic-scroll-start",_),document.addEventListener("programmatic-scroll-end",T)}return t.onMounted(()=>{L()}),t.onUnmounted(()=>{s&&s.disconnect();const O=document.querySelector(".container-main");O&&O.removeEventListener("scroll",V),document.removeEventListener("programmatic-scroll-start",_),document.removeEventListener("programmatic-scroll-end",T),f&&clearTimeout(f),m&&clearTimeout(m)}),(O,U)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"coverPage",ref:R,class:"cover",style:t.normalizeStyle(a.value)},[y.value?(t.openBlock(),t.createElementBlock("div",Q9e,[l.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",$9e,[t.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,e8e)])):(t.openBlock(),t.createElementBlock("svg",t8e,[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,r8e)]))])):t.createCommentVNode("",!0),y.value?(t.openBlock(),t.createElementBlock("div",a8e,[l.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",n8e,[t.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,i8e)])):(t.openBlock(),t.createElementBlock("svg",o8e,[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,s8e)]))])):t.createCommentVNode("",!0),t.createElementVNode("div",l8e,[t.createElementVNode("div",c8e,[U[0]||(U[0]=t.createElementVNode("div",null,"Análisis",-1)),t.createElementVNode("div",null,t.toDisplayString(S.value),1)]),t.createElementVNode("div",u8e,t.toDisplayString(v.value),1)]),y.value?(t.openBlock(),t.createElementBlock("div",d8e,[t.createElementVNode("div",p8e,[t.createElementVNode("div",h8e,[l.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",f8e,[t.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,m8e)])):(t.openBlock(),t.createElementBlock("svg",y8e,[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,g8e)])),t.createElementVNode("div",v8e,t.toDisplayString(l.value.homeTeam.name),1)]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",b8e,[U[1]||(U[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(l.value.homeTeam.goalsMinutes),1),U[2]||(U[2]=t.createElementVNode("div",{class:"separator"},null,-1)),U[3]||(U[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(l.value.homeTeam.totalYellowCards),1),U[4]||(U[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(l.value.homeTeam.totalRedCards),1)])):t.createCommentVNode("",!0)]),t.createElementVNode("div",x8e,[e.isPostMatch?(t.openBlock(),t.createElementBlock("div",w8e,t.toDisplayString(d.value[0])+" : "+t.toDisplayString(d.value[1]),1)):t.createCommentVNode("",!0)]),t.createElementVNode("div",_8e,[t.createElementVNode("div",S8e,[l.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",T8e,[t.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,k8e)])):(t.openBlock(),t.createElementBlock("svg",N8e,[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,V8e)])),t.createElementVNode("div",L8e,t.toDisplayString(l.value.awayTeam.name),1)]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",O8e,[t.createElementVNode("div",null,t.toDisplayString(l.value.awayTeam.totalYellowCards),1),U[5]||(U[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(l.value.awayTeam.totalRedCards),1),U[6]||(U[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)),U[7]||(U[7]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",null,t.toDisplayString(l.value.awayTeam.goalsMinutes),1),U[8]||(U[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",q8e,[t.createElementVNode("div",C8e,[t.createElementVNode("div",U8e,[l.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",z8e,[t.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,E8e)])):(t.openBlock(),t.createElementBlock("svg",P8e,[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,R8e)])),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",M8e,t.toDisplayString(d.value[0]),1)):t.createCommentVNode("",!0)]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",F8e,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value.homeTeam.goalsEvents,(q,z)=>(t.openBlock(),t.createElementBlock("div",{key:`goal-${z}`,class:"goal"},[t.createElementVNode("div",null,t.toDisplayString(q.playerName),1),U[9]||(U[9]=t.createElementVNode("div",{class:"bullet"},null,-1)),t.createElementVNode("div",null,t.toDisplayString(q.goalTime),1),U[10]||(U[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)]),U[13]||(U[13]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",j8e,[t.createElementVNode("div",W8e,[e.isPostMatch?(t.openBlock(),t.createElementBlock("div",A8e,t.toDisplayString(d.value[1]),1)):t.createCommentVNode("",!0),l.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",K8e,[t.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,I8e)])):(t.openBlock(),t.createElementBlock("svg",X8e,[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,D8e)]))]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",B8e,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value.awayTeam.goalsEvents,(q,z)=>(t.openBlock(),t.createElementBlock("div",{key:`goal-a-${z}`,class:"goal"},[U[11]||(U[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(q.goalTime),1),U[12]||(U[12]=t.createElementVNode("div",{class:"bullet"},null,-1)),t.createElementVNode("div",null,t.toDisplayString(q.playerName),1)]))),128))])):t.createCommentVNode("",!0)])]))],4))}},J8e=pc(G8e,[["__scopeId","data-v-6680cbcf"]]),Z8e={class:"table-category-filters"},H8e={key:0,class:"custom-radio-group filter-inline"},Y8e={class:"radio-label"},Q8e={class:"radio-options"},$8e=["name","value","onUpdate:modelValue","onClick"],eke=["data-filter-type","onClick","onMousedown","onMouseup"],tke={class:"select-display"},rke={class:"select-label"},ake={key:0,class:"dropdown-menu type-menu simple-select-menu"},nke={class:"simple-select-scroll-area"},ike=["onClick"],oke={class:"option-content"},ske={class:"option-title"},lke={key:0,class:"option-checkmark"},cke={key:2,class:"filter-separator"},uke={__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 b=e,R=n,y=t.ref([]);let c=null;const i=(w,_)=>{if(!_)return!0;for(let T=0;T<w.length;T++)if(!d(w[T],_[T]))return!0;return!1},d=(w,_)=>{if(Array.isArray(w)&&Array.isArray(_)){if(w.length!==_.length)return!1;for(let T=0;T<w.length;T++)if(w[T]!==_[T])return!1;return!0}return w===_},l=t.ref(null),a=t.ref([]);let S=!1,x=null;const v=()=>{x=null},p=()=>{setTimeout(()=>{S=!1},1e3)},o=(w,_=!0)=>{if(b.filters&&b.filters[0]&&b.filters[1]&&b.filters[1].options){const T=b.filters[0].options,V=b.filters[1].options;w!=null?T.findIndex(L=>L.value===w)!==-1&&V[w]?(a.value=V[w],_&&!(()=>{const L=y.value[1];return L==null?!1:Array.isArray(L)?L.length>0:L!==""})()&&!S&&a.value.length>0&&(y.value[1]=a.value[0].value,t.nextTick(()=>{}))):(a.value=[],y.value[1]=null):(a.value=[],y.value[1]=null)}},s=()=>{b.initialValues&&b.initialValues.length>0?y.value=[...b.initialValues]:y.value=b.filters.map(w=>{var _,T,V,L;return w.type==="select"?[]:w.type==="check"?!1:w.type==="radio-button"?((T=(_=w.options)==null?void 0:_[0])==null?void 0:T.value)||null:w.type==="select-simple"&&((L=(V=w.options)==null?void 0:V[0])==null?void 0:L.value)||null}),b.componentId===13&&y.value.some(w=>w!=null&&(Array.isArray(w)?w.length>0:w!==!1&&w!==""))&&(c=[...y.value],R("filters-changed",{componentId:b.componentId,filters:y.value,timestamp:new Date().toISOString()}))};s(),setTimeout(()=>{t.nextTick(()=>{if(y.value[0]!==null&&y.value[0]!==void 0&&!S){const w=!(()=>{const _=y.value[1];return _==null?!1:Array.isArray(_)?_.length>0:_!==""})();o(y.value[0],w)}})},300),t.watch(()=>b.initialValues,w=>{const _=!d(y.value,w),T=w&&w.length>0&&!S&&_,V=b.isEditMode&&S;T&&!V?y.value=[...w]:S?x&&x.length>0&&(y.value=[...x]):V&&x&&x.length>0&&(y.value=[...x])},{deep:!0}),t.watch(()=>b.isEditMode,(w,_)=>{_===!0&&w===!1&&v()},{immediate:!0}),t.watch(y,(w,_)=>{w.some(T=>T!=null&&(Array.isArray(T)?T.length>0:T!==!1&&T!==""))&&i(w,c)&&(c=[...w],R("filters-changed",{componentId:b.componentId,filters:w,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),t.watch(()=>y.value[0],(w,_)=>{w!==_&&_!==void 0?o(w,!0):_===void 0&&w!==null&&w!==void 0&&o(w,!1)},{immediate:!0}),t.watch(()=>y.value,(w,_)=>{b.filters.map((T,V)=>T.type==="radio-button"?V:-1).filter(T=>T!==-1).forEach(T=>{})},{deep:!0}),t.watch(a,()=>{},{deep:!0});const f=w=>{l.value===w?l.value=null:l.value=w},u=(w,_)=>{if(S=!0,p(),y.value[w]=_,(w===0||w===1)&&(x=[...y.value]),l.value=null,w===0){y.value[1]!==void 0&&(y.value[1]=null);const T=S;S=!1,o(_,!0),S=T,y.value[1]!==null&&y.value[1]!==void 0&&(x=[...y.value])}},m=()=>{S=!0,setTimeout(()=>{S=!1},1e3)};return r({getCurrentValues:()=>y.value,initializeValues:s}),(w,_)=>(t.openBlock(),t.createElementBlock("div",Z8e,[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,(T,V)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:V},[T.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",H8e,[t.createElementVNode("div",Y8e,t.toDisplayString(T.label),1),t.createElementVNode("div",Q8e,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(T.options,L=>(t.openBlock(),t.createElementBlock("label",{key:L.value,class:t.normalizeClass(["radio-option-card",{active:y.value[V]===L.value}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"table-radio-"+V,value:L.value,"onUpdate:modelValue":O=>y.value[V]=O,onChange:_[0]||(_[0]=()=>{m()}),onClick:O=>console.log("Click en radio button",V,L.value,"Valor actual:",y.value[V])},null,40,$8e),[[t.vModelRadio,y.value[V]]]),t.createElementVNode("span",null,t.toDisplayString(L.label),1)],2))),128))])])):T.type==="select-simple"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"custom-select dynamic-select filter-inline","data-filter-type":T.type,onClick:t.withModifiers(L=>f(V),["stop"]),onMousedown:L=>console.log("Mouse down en selector",V),onMouseup:L=>console.log("Mouse up en selector",V)},[t.createElementVNode("div",tke,[_[2]||(_[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",rke,t.toDisplayString(T.label||"Tipo de análisis"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:l.value===V}])},[..._[1]||(_[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)]),l.value===V?(t.openBlock(),t.createElementBlock("div",ake,[t.createElementVNode("div",nke,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(V===1?a.value:T.options,L=>(t.openBlock(),t.createElementBlock("div",{key:L.value,class:t.normalizeClass(["option-card simple-select-option",{active:d(y.value[V],L.value)}]),onClick:t.withModifiers(O=>u(V,L.value),["stop"])},[t.createElementVNode("div",oke,[t.createElementVNode("div",ske,t.toDisplayString(L.label),1)]),d(y.value[V],L.value)?(t.openBlock(),t.createElementBlock("div",lke,[..._[3]||(_[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,ike))),128))])])):t.createCommentVNode("",!0)],40,eke)):t.createCommentVNode("",!0),V===1&&e.filters.length>2?(t.openBlock(),t.createElementBlock("div",cke)):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0)]))}},dke=pc(uke,[["__scopeId","data-v-9d00f072"]]),pke={class:"strengths-filters"},hke={key:0,class:"custom-radio-group filter-inline"},fke={class:"radio-label"},mke={class:"radio-options"},yke=["name","value","onUpdate:modelValue"],gke={class:"filter-inline select-with-label"},vke=["data-filter-type","onClick"],bke={class:"select-display"},xke={class:"select-label"},wke={key:0,class:"dropdown-menu type-menu simple-select-menu"},_ke={class:"simple-select-scroll-area"},Ske=["onClick"],Tke={class:"option-content"},kke={class:"option-title"},Nke={key:0,class:"option-checkmark"},Vke={key:2,class:"filter-separator"},Lke={__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 b=e,R=n,y=t.ref([]);let c=null;const i=t.ref(null),d=t.ref([]);let l=!1,a=null;const S=(f,u)=>{if(Array.isArray(f)&&Array.isArray(u)){if(f.length!==u.length)return!1;for(let m=0;m<f.length;m++)if(f[m]!==u[m])return!1;return!0}return f===u},x=(f,u=!0)=>{if(b.filters&&b.filters[0]&&b.filters[1]&&b.filters[1].options){const m=b.filters[0].options,w=b.filters[1].options;f!=null?m.findIndex(_=>_.value===f)!==-1&&w[f]?(d.value=w[f],u&&!(()=>{const _=y.value[1];return _==null?!1:Array.isArray(_)?_.length>0:_!==""})()&&!l&&d.value.length>0&&(y.value[1]=d.value[0].value,t.nextTick(()=>{}))):(d.value=[],y.value[1]=null):(d.value=[],y.value[1]=null)}},v=()=>{if(b.initialValues&&b.initialValues.length>0){const u=b.initialValues.length>0&&(typeof b.initialValues[0]=="number"||typeof b.initialValues[0]=="boolean"||b.initialValues[0]===null||Array.isArray(b.initialValues[0]));console.log("StrengthsFilters initializeValues - isSimpleFormat:",u),u?(console.log("StrengthsFilters initializeValues - Usando formato simple, valores:",b.initialValues),y.value=[...b.initialValues]):b.isEditMode?y.value=b.filters.map((m,w)=>{var _,T,V,L,O,U,q,z,C,N;const E=b.initialValues[w];if(console.log(`StrengthsFilters initializeValues - filter[${w}]:`,m==null?void 0:m.type,"filterData:",E),!E)return console.log(`StrengthsFilters initializeValues - No hay filterData para índice ${w}, usando valor por defecto`),m.type==="select"?[]:m.type==="check"?!1:m.type==="radio-button"?((T=(_=m.options)==null?void 0:_[0])==null?void 0:T.value)||null:m.type==="select-simple"&&((L=(V=m.options)==null?void 0:V[0])==null?void 0:L.value)||null;if(m.type==="radio-button"&&E.selectedOption){console.log("StrengthsFilters initializeValues - filterData.selectedOption: ",E.selectedOption,"index:",w);const k=E.selectedOption.value;return console.log("StrengthsFilters initializeValues - selectedValue extraído:",k),k}else{if(m.type==="radio-button"&&!E.selectedOption)return console.log("StrengthsFilters initializeValues - filterData NO tiene selectedOption:",E,"index:",w),E.selectedValue!==void 0?(console.log("StrengthsFilters initializeValues - Usando selectedValue:",E.selectedValue),E.selectedValue):(console.log("StrengthsFilters initializeValues - Usando valor por defecto del filter"),((U=(O=m.options)==null?void 0:O[0])==null?void 0:U.value)||null);if(m.type==="select-simple"&&E.selectedValue!==void 0)return Array.isArray(E.selectedValue)?E.selectedValue[0]:E.selectedValue;if(m.type==="select"&&E.selectedOptions)return E.selectedOptions.map(k=>k.value);if(m.type==="check"&&E.isChecked!==void 0)return E.isChecked}return E.selectedValue!==void 0?E.selectedValue:m.type==="select"?[]:m.type==="check"?!1:m.type==="radio-button"?((z=(q=m.options)==null?void 0:q[0])==null?void 0:z.value)||null:m.type==="select-simple"&&((N=(C=m.options)==null?void 0:C[0])==null?void 0:N.value)||null}):y.value=[...b.initialValues]}else y.value=b.filters.map(u=>{var m,w,_,T;return u.type==="select"?[]:u.type==="check"?!1:u.type==="radio-button"?((w=(m=u.options)==null?void 0:m[0])==null?void 0:w.value)||null:u.type==="select-simple"&&((T=(_=u.options)==null?void 0:_[0])==null?void 0:T.value)||null});console.log("StrengthsFilters initializeValues - selectedValues.value final:",y.value);const f=y.value.some(u=>u!=null&&(Array.isArray(u)?u.length>0:u!==!1&&u!==""));console.log("StrengthsFilters initializeValues - hasValidValues:",f),f&&(c=[...y.value],R("filters-changed",{componentId:b.componentId,filters:y.value,timestamp:new Date().toISOString()}))};v(),setTimeout(()=>{t.nextTick(()=>{if(y.value[0]!==null&&y.value[0]!==void 0&&!l){const f=!(()=>{const u=y.value[1];return u==null?!1:Array.isArray(u)?u.length>0:u!==""})();x(y.value[0],f)}})},300),t.watch(()=>b.initialValues,(f,u)=>{if(!f||f.length===0)return;console.log("StrengthsFilters watch initialValues - newValues:",f),console.log("StrengthsFilters watch initialValues - oldValues:",u),console.log("StrengthsFilters watch initialValues - props.isEditMode:",b.isEditMode),console.log("StrengthsFilters watch initialValues - isUserInteracting:",l);const m=f.length>0&&(typeof f[0]=="number"||typeof f[0]=="boolean"||f[0]===null||Array.isArray(f[0]));console.log("StrengthsFilters watch initialValues - isSimpleFormat:",m);const w=!S(y.value,f),_=f&&f.length>0&&!l&&w,T=b.isEditMode&&l;console.log("StrengthsFilters watch initialValues - valuesAreDifferent:",w,"shouldUpdate:",_,"isEditModeProtection:",T),_&&!T?m?(console.log("StrengthsFilters watch initialValues - Usando formato simple, valores:",f),y.value=[...f]):b.isEditMode?y.value=b.filters.map((V,L)=>{const O=f[L];if(!O)return console.log("StrengthsFilters watch initialValues - No hay filterData para índice",L),y.value[L];if(V.type==="radio-button"&&O.selectedOption){console.log("StrengthsFilters watch initialValues - filterData.selectedOption: ",O.selectedOption,"index:",L);const U=O.selectedOption.value;return console.log("StrengthsFilters watch initialValues - selectedValue extraído:",U),U}else{if(V.type==="select-simple"&&O.selectedValue!==void 0)return Array.isArray(O.selectedValue)?O.selectedValue[0]:O.selectedValue;if(V.type==="select"&&O.selectedOptions)return O.selectedOptions.map(U=>U.value);if(V.type==="check"&&O.isChecked!==void 0)return O.isChecked}return O.selectedValue!==void 0?O.selectedValue:y.value[L]}):y.value=[...f]:l?a&&a.length>0&&(y.value=[...a]):T&&a&&a.length>0&&(y.value=[...a])},{deep:!0}),t.watch(()=>b.isEditMode,(f,u)=>{u===!0&&f===!1&&(a=null)},{immediate:!0}),t.watch(y,f=>{f.some(u=>u!=null&&(Array.isArray(u)?u.length>0:u!==!1&&u!==""))&&(()=>{if(!c)return!0;for(let u=0;u<f.length;u++)if(!S(f[u],c[u]))return!0;return!1})()&&(c=[...f],R("filters-changed",{componentId:b.componentId,filters:f,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),t.watch(()=>y.value[0],(f,u)=>{f!==u&&u!==void 0?x(f,!0):u===void 0&&f!==null&&f!==void 0&&x(f,!1)},{immediate:!0});const p=f=>{i.value===f?i.value=null:i.value=f},o=(f,u)=>{if(l=!0,setTimeout(()=>{l=!1},1e3),y.value[f]=u,(f===0||f===1)&&(a=[...y.value]),i.value=null,f===0){y.value[1]!==void 0&&(y.value[1]=null);const m=l;l=!1,x(u,!0),l=m,y.value[1]!==null&&y.value[1]!==void 0&&(a=[...y.value])}},s=()=>{l=!0,setTimeout(()=>{l=!1},400)};return r({getCurrentValues:()=>y.value,initializeValues:v}),(f,u)=>(t.openBlock(),t.createElementBlock("div",pke,[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,(m,w)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:w},[m.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",hke,[t.createElementVNode("div",fke,t.toDisplayString(m.label),1),t.createElementVNode("div",mke,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.options,_=>(t.openBlock(),t.createElementBlock("label",{key:_.value,class:t.normalizeClass(["radio-option-card",{active:y.value[w]===_.value}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"strengths-radio-"+w,value:_.value,"onUpdate:modelValue":T=>y.value[w]=T,onChange:s},null,40,yke),[[t.vModelRadio,y.value[w]]]),t.createElementVNode("span",null,t.toDisplayString(_.label),1)],2))),128))])])):m.type==="select-simple"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[u[4]||(u[4]=t.createElementVNode("div",{class:"filter-separator"},null,-1)),t.createElementVNode("div",gke,[u[3]||(u[3]=t.createElementVNode("div",{class:"radio-label"},"Mostrar: ",-1)),t.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":m.type,onClick:t.withModifiers(_=>p(w),["stop"])},[t.createElementVNode("div",bke,[u[1]||(u[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",xke,t.toDisplayString(m.label||"Tipo de análisis"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:i.value===w}])},[...u[0]||(u[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===w?(t.openBlock(),t.createElementBlock("div",wke,[t.createElementVNode("div",_ke,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.options,_=>(t.openBlock(),t.createElementBlock("div",{key:_.value,class:t.normalizeClass(["option-card simple-select-option",{active:S(y.value[w],_.value)}]),onClick:t.withModifiers(T=>o(w,_.value),["stop"])},[t.createElementVNode("div",Tke,[t.createElementVNode("div",kke,t.toDisplayString(_.label),1)]),S(y.value[w],_.value)?(t.openBlock(),t.createElementBlock("div",Nke,[...u[2]||(u[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,Ske))),128))])])):t.createCommentVNode("",!0)],8,vke)])],64)):t.createCommentVNode("",!0),w===1&&e.filters.length>2?(t.openBlock(),t.createElementBlock("div",Vke)):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0)]))}},Oke=pc(Lke,[["__scopeId","data-v-4c3876bd"]]),qke=(e,r)=>{const n=e.__vccOpts||e;for(const[b,R]of r)n[b]=R;return n},Cke={key:1},Uke={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},zke=["fill"],Eke={key:0,class:"checkbox__teams"},Pke={class:"checkbox__teams__logo"},Rke=["src"],Mke={class:"checkbox__teams__logo"},Fke=["src"],jke={__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(l=>({"7bd9d47b":e.width,"34dc7ddc":e.height}));const b=t.ref(!1),R=t.computed(()=>{const l={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 b.value?(l["background-color"]=n.boxBackgroundColor,l.border=`solid ${n.boxBorderWidth} ${n.boxBackgroundColor}`):l.border=`solid ${n.boxBorderWidth} ${n.boxBorderColor}`,l}),y=t.computed(()=>({"font-family":n.boxValueFontFamily,"font-size":n.boxValueFontSize,color:n.boxValueColor,"line-height":1})),c=t.computed(()=>{const l={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")&&(l[`margin-${n.boxPosition}`]=n.isBoxOnly?"0":n.teamsIds?"8px":"10px"),l});t.watch(()=>n.modelValue,l=>{l!==b.value&&(b.value=l)},{immediate:!0});function i(){n.avoidInteraction||!b.value&&n.avoidToCheck||(b.value=!b.value,r("update:modelValue",b.value))}function d(l){return`${{}.TEAM_LOGOS_URL||"https://golstatsimages.blob.core.windows.net/teams-80/"}${l}.png`}return(l,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["checkbox",`box-${e.boxPosition}`]),onClick:i},[t.createElementVNode("div",{class:"checkbox__box",style:t.normalizeStyle(R.value)},[b.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(y.value)},t.toDisplayString(e.boxValue),5)):(t.openBlock(),t.createElementBlock("div",Cke,[(t.openBlock(),t.createElementBlock("svg",Uke,[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,zke)]))]))],64)):t.createCommentVNode("",!0)],4),e.teamsIds&&e.teamsIds.length?(t.openBlock(),t.createElementBlock("div",Eke,[t.createElementVNode("div",Pke,[t.createElementVNode("img",{src:d(e.teamsIds[0]),alt:""},null,8,Rke)]),t.createElementVNode("div",Mke,[t.createElementVNode("img",{src:d(e.teamsIds[1]),alt:""},null,8,Fke)])])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"checkbox__label",style:t.normalizeStyle(c.value)},t.toDisplayString(e.label),5)],2))}},RL=qke(jke,[["__scopeId","data-v-b6f124d8"]]),Wke=(e,r)=>{const n=e.__vccOpts||e;for(const[b,R]of r)n[b]=R;return n},N_={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))}}},ML=()=>{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}))},FL=N_.setup;N_.setup=FL?(e,r)=>(ML(),FL(e,r)):ML;const Ake=e=>(t.pushScopeId("data-v-f3ee6b2b"),e=e(),t.popScopeId(),e),Kke=["src"],Ike={key:1,class:"text"},Xke=["src"],Dke={class:"stats"},Bke=Ake(()=>t.createElementVNode("img",{class:"iconstats",src:"https://golstatsimages.blob.core.windows.net/todoelfut/playdes.png"},null,-1)),Gke={class:"numstats"},Jke={class:"leyend"};function Zke(e,r,n,b,R,y){return t.openBlock(),t.createElementBlock("div",null,[n.type==0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["button",R.status&&n.typeOnOff&&"button-active"]),style:t.normalizeStyle([y.customStyle,R.status&&n.typeOnOff&&y.customActive]),onClick:r[0]||(r[0]=(...c)=>y.btnClick&&y.btnClick(...c))},[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,Kke)):t.createCommentVNode("",!0),n.textValue?(t.openBlock(),t.createElementBlock("div",Ike,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,Xke)):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]=(...c)=>y.btnClick&&y.btnClick(...c))},[t.createElementVNode("div",Dke,[Bke,t.createElementVNode("div",Gke,t.toDisplayString(n.textStat),1)]),t.createElementVNode("div",Jke,t.toDisplayString(n.textCategory),1)])):t.createCommentVNode("",!0)])}const Hke=Wke(N_,[["render",Zke],["__scopeId","data-v-f3ee6b2b"]]),Yke={class:"gsc-dropdown__main-container__item-selected"},Qke=["height","width"],$ke=["stroke"],eNe={key:1,width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tNe=["fill"],rNe={class:"gsc-dropdown__items-container"},aNe=["onClick"],nNe={key:0,class:"gsc-dropdown__items-footer"},h1={__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,b=t.ref({}),R=t.ref(null),y=t.ref(n.isMultipleOption?-1:0),c=t.ref(!1);t.watch(()=>n.items,(v,p)=>{if(!n.modelValue&&(!n.onlyFirstTime||!p||!p.length)&&v&&v.length){if(n.defaultItemByProp){const o=n.items.findIndex(s=>s[n.defaultItemByProp.propName]===n.defaultItemByProp.value);o!==-1?(y.value=o,b.value=v[o]):(y.value=0,b.value=v[0])}else b.value=v[n.defaultItemByIndex];r("input",b.value)}},{immediate:!0}),t.watch(()=>n.modelValue,v=>{if(v){const p=n.items.findIndex(o=>typeof v=="object"?JSON.stringify(o)===JSON.stringify(v):o===v);p!==-1&&(y.value=p,b.value=n.items[p],r("update:modelValue",b.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"})),d=t.computed(()=>({height:`${n.arrowHeight}px`,width:`${n.arrowWidth}px`}));function l(){n.isDisabled||(c.value=!c.value)}function a(v){R.value&&!R.value.contains(v.target)&&(c.value=!1)}function S(v,p){n.isMultipleOption?y.value=-1:(y.value=p,c.value=!1),b.value=v,r("input",b.value),r("update:modelValue",b.value)}function x(){c.value=!1,r("click-ready")}return t.onMounted(()=>{document.addEventListener("click",a)}),t.onBeforeMount(()=>{document.removeEventListener("click",a)}),(v,p)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"dropDown",ref:R,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:l},[t.createElementVNode("div",Yke,[t.renderSlot(v.$slots,"default",{selectedItem:b.value})]),t.createElementVNode("div",{class:t.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":c.value}]),style:t.normalizeStyle(d.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,$ke)],8,Qke)):(t.openBlock(),t.createElementBlock("svg",eNe,[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,tNe)]))],6)],4),t.createVNode(t.Transition,null,{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",rNe,[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,s)=>(t.openBlock(),t.createElementBlock("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["gsc-dropdown__items__item",{selected:s===y.value}]),key:s,onClick:f=>S(o,s)},[t.renderSlot(v.$slots,"availableItem",{item:o})],10,aNe)),[[t.vShow,!o.isHidden]])]))),256))],4),e.isFooterVisible?(t.openBlock(),t.createElementBlock("div",nNe,[t.createVNode(t.unref(Hke),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:x})])):t.createCommentVNode("",!0)])],512),[[t.vShow,c.value]])]),_:3})],4))}},V_={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},iNe=[{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"}}],oNe=[{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}}],sNe={class:"last-touch"},lNe={class:"selected-item"},cNe={class:"available-item"},uNe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dNe={class:"selected-item"},pNe={class:"available-item"},hNe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fNe={key:1},mNe={class:"selected-item"},yNe={class:"available-item"},gNe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},vNe={class:"last-touch__how-many-games"},bNe={class:"selected-item"},xNe={class:"available-item"},wNe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_Ne={__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,b=r,R=t.ref([{label:"Ofensivo",value:2,name:"offensive"},{label:"Defensivo",value:3,name:"defensive"}]),y=t.ref({id:0,name:"Fases de juego",value:null}),c=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}]),d=t.ref(n.defaultFilters?null:i.value[0]),l=t.ref(null),a=t.computed(()=>({...V_})),S=t.computed(()=>({...V_,isFooterVisible:!n.isEditMode,isMultipleOption:!n.isEditMode})),x=t.computed(()=>{const A=[];return v.value.options.forEach(X=>{X.forEach(D=>{A.push(D)})}),A}),v=t.ref(null),p=t.ref(null),o=t.ref(null),s=t.ref(null);t.watch(()=>n.viewConfig,A=>{A.filters&&(v.value||f(),p.value||u(),o.value||m(),s.value||V())},{immediate:!0});function f(){if(n.viewConfig&&n.viewConfig.filters){const A=n.viewConfig.filters.find(X=>X.key==="categories");A&&A.options&&(v.value={label:A.label,options:Object.entries(A.options).reduce((X,[D,Y])=>(X.set(Number(D),Y),X),new Map)})}v.value={label:"Tipo de jugada",options:new Map([[2,oNe],[3,iNe]])}}function u(){if(n.viewConfig&&n.viewConfig.filters){const A=n.viewConfig.filters.find(X=>X.key==="gamePhases");if(A){p.value={label:A.label,options:A.options};return}}p.value={label:"Fases de juego",options:R.value}}function m(){if(n.viewConfig&&n.viewConfig.filters){const A=n.viewConfig.filters.find(X=>X.key==="teamRadios");if(A){o.value={options:A.options},C(null,A.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}]},C(null,o.value.options[0])}const w=t.ref(n.defaultFilters?null:o.value.options[0]),_=t.ref(n.defaultFilters?null:p.value.options[0]),T=t.ref(n.defaultFilters?null:v.value.options.get(_.value.value)[0]);function V(){if(n.viewConfig&&n.viewConfig.filters){const A=n.viewConfig.filters.find(X=>X.key==="assistZoneCheckbox");if(A){s.value={label:A.label},N(A.value);return}}s.value={label:"Zona de asistencia"}}const L=t.computed(()=>{const A={selectedGamePhase:_.value,selectedTeam:w.value,isAssistZoneVisible:c.value,howManyGamesSelected:d.value};return n.isEditMode?(A.selectedCategory=T.value,A.totalCategoriesSelected=1):(A.selectedCategories=l.value,A.totalCategoriesSelected=0,v.value.options.forEach(X=>{X.forEach(D=>{D.isSelected&&(A.totalCategoriesSelected+=1)})})),A}),O=t.computed(()=>_.value?v.value.options.get(_.value.value)||[]:[]);t.watch(()=>L.value,A=>{U()&&(console.log("before emit change:",{areAllFiltersFilled:U(),filters:A,view:n.viewConfig}),b("change",{areAllFiltersFilled:U(),filters:A,view:n.viewConfig}))},{deep:!0});function U(){return _.value&&(n.isEditMode&&T.value||!n.isEditMode&&l.value&&l.value.length)&&w.value&&d.value}function q(A){_.value=A,k(null)}function z(A){w.value=A}function C(A,X){console.log("onChangeRadio:",X.value)}function N(A){c.value=A}function E(A){d.value=A}function k(A){T.value=A}function P(A,X){X.isSelected=A,l.value=x.value.filter(D=>D.isSelected)}function F(){n.defaultFilters&&(c.value=n.defaultFilters.isAssistZoneVisible,d.value=i.value.find(A=>A.value===n.defaultFilters.howManyGamesSelected.value)||i.value[0],_.value=p.value.options.find(A=>A.value===n.defaultFilters.selectedGamePhase.value)||p.value.options[0],w.value=o.value.options.find(A=>A.value===(n.defaultFilters.isHomeTeam?1:2))||o.value.options[0],T.value=v.value.options.get(_.value.value).find(A=>A.value.name===n.defaultFilters.selectedCategory.name)||v.value.options.get(_.value.value)[0])}function W(){O.value.forEach(A=>{A.isSelected=!1}),c.value=!1,d.value=i.value[0],_.value=null,w.value=null,T.value=null,l.value=null}return t.onBeforeUnmount(()=>{W()}),t.onMounted(()=>{setTimeout(()=>{F()},500)}),(A,X)=>(t.openBlock(),t.createElementBlock("div",sNe,[t.createVNode(t.unref(h1),t.mergeProps(a.value,{items:p.value.options,"model-value":_.value,"onUpdate:modelValue":q}),{default:t.withCtx(()=>[t.createElementVNode("div",lNe,[X[0]||(X[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(_.value?_.value.label:p.value.label||y.value.name),1)])]),availableItem:t.withCtx(({item:D})=>[t.createElementVNode("div",cNe,[t.createElementVNode("div",null,t.toDisplayString(D.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",uNe,[...X[1]||(X[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,_.value&&_.value.label===D.label]])])])]),_:1},16,["items","model-value"]),t.createVNode(t.unref(h1),t.mergeProps(S.value,{items:O.value,"model-value":T.value,"onUpdate:modelValue":k}),{default:t.withCtx(()=>[t.createElementVNode("div",dNe,[X[2]||(X[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(v.value.label),1)])]),availableItem:t.withCtx(({item:D})=>[t.createElementVNode("div",pNe,[e.isEditMode?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",null,t.toDisplayString(D.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",hNe,[...X[3]||(X[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,T.value&&T.value.label===D.label]])])],64)):(t.openBlock(),t.createElementBlock("div",fNe,[t.createVNode(t.unref(RL),{"model-value":D.isSelected,label:D.label,"onUpdate:modelValue":Y=>P(Y,D)},null,8,["model-value","label","onUpdate:modelValue"])]))])]),_:1},16,["items","model-value"]),t.createVNode(t.unref(h1),t.mergeProps(a.value,{items:o.value.options,"model-value":w.value,"onUpdate:modelValue":z}),{default:t.withCtx(()=>[t.createElementVNode("div",mNe,[X[4]||(X[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(w.value?w.value.label:o.value.label),1)])]),availableItem:t.withCtx(({item:D})=>[t.createElementVNode("div",yNe,[t.createElementVNode("div",null,t.toDisplayString(D.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",gNe,[...X[5]||(X[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,w.value&&w.value.label===D.label]])])])]),_:1},16,["items","model-value"]),t.createVNode(t.unref(RL),{"model-value":c.value,label:s.value.label,"onUpdate:modelValue":N},null,8,["model-value","label"]),t.withDirectives(t.createElementVNode("div",vNe,[t.createVNode(t.unref(h1),t.mergeProps(a.value,{items:i.value,"model-value":d.value,"onUpdate:modelValue":E}),{default:t.withCtx(()=>[t.createElementVNode("div",bNe,[X[6]||(X[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(d.value?d.value.name:"Seleccione"),1)])]),availableItem:t.withCtx(({item:D})=>[t.createElementVNode("div",xNe,[t.createElementVNode("div",null,t.toDisplayString(D.name),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",wNe,[...X[7]||(X[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,d.value&&d.value.name===D.name]])])])]),_:1},16,["items","model-value"])],512),[[t.vShow,!e.isPostMatch]])]))}},SNe=pc(_Ne,[["__scopeId","data-v-b006bd89"]]),TNe=(e,r)=>{const n=e.__vccOpts||e;for(const[b,R]of r)n[b]=R;return n},kNe={__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(v=>({"398d9242":e.width,f164e302:d.value,"4bb88040":e.menuWidth}));const b=t.ref(null),R=t.ref(!1),y=t.ref(null),c=t.ref({}),i=t.computed(()=>{const v={top:"0px","--left-menu":n.leftMenu};if(b.value){const p=b.value.getBoundingClientRect();v.top=`${p.height+n.menuMarginTop}px`}return v}),d=t.computed(()=>R.value?n.zIndexOpen:1);t.watch(()=>n.modelValue,v=>{v!==R.value&&(R.value=v)},{immediate:!0}),t.watch(R,v=>{v||setTimeout(()=>{c.value["--translate-x"]="0px"},500)});function l(v){const p=window.innerWidth,o=v.boundingClientRect.x,s=v.boundingClientRect.x+v.boundingClientRect.width,f=o<=0?Math.abs(o)+4:s>=p?p-(s+10):0;c.value["--translate-x"]=`${f}px`}function a(){new IntersectionObserver(v=>{v[0].intersectionRatio>0&&l(v[0])}).observe(y.value)}function S(){R.value=!R.value,r("update:modelValue",R.value)}function x(){R.value=!1,r("update:modelValue",R.value)}return t.onMounted(()=>{t.nextTick(()=>{a()})}),(v,p)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[R.value?(t.openBlock(),t.createElementBlock("div",{key:0,id:"menu-overlay",onClick:x})):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"menu-container",style:t.normalizeStyle(c.value)},[t.createElementVNode("div",{ref_key:"trigger",ref:b,class:"menu-container__trigger",onClick:S},[t.renderSlot(v.$slots,"trigger",{},void 0,!0)],512),t.createVNode(t.Transition,null,{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{ref_key:"menu",ref:y,class:"menu-container__menu",style:t.normalizeStyle(i.value)},[t.renderSlot(v.$slots,"menu",{},void 0,!0)],4),[[t.vShow,R.value]])]),_:3})],4)],64))}},NNe=TNe(kNe,[["__scopeId","data-v-18c0df61"]]),Su={CORNERS_ADVANCED:"cornersAdvanced"},VNe={key:0,class:"button__icon"},LNe={key:0,width:"19",height:"17",viewBox:"0 0 19 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ONe=["stroke"],qNe=["stroke"],CNe=["stroke"],UNe={key:1,width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},zNe=["stroke"],ENe=["stroke"],PNe=["fill"],RNe={key:2,width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},MNe=["fill"],FNe={key:3,width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},jNe=["stroke"],WNe=["stroke"],ANe=["stroke"],KNe=["stroke"],INe=["stroke"],XNe={key:4,width:"18",height:"17",viewBox:"0 0 18 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},DNe={key:5,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},BNe={key:6,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},GNe={key:7,width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},JNe={key:8,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ZNe={class:"button__text"},HNe={key:0,class:"info-container"},YNe={key:1,style:{width:"20px"}},QNe={width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$Ne=["fill"],eVe={__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})),b=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})),R=t.computed(()=>[Su.PLAYS_TYPES,Su.GOLSTATS,Su.TOURNAMENTS,Su.PLAYS,Su.RESULTS,Su.RESULTS_BY_TIME].includes(r.iconType)),y=t.computed(()=>[Su.FIELD,Su.GAMES].includes(r.iconType)),c=t.computed(()=>[Su.DETAILS,Su.UNIVERSE].includes(r.iconType)),i=t.computed(()=>[Su.PERSONAL_DATA].includes(r.iconType)),d=t.computed(()=>[Su.PRODUCTIVITY].includes(r.iconType)),l=t.computed(()=>(console.log("props.iconType",r.iconType),[Su.CORNERS_ADVANCED].includes(r.iconType))),a=t.computed(()=>[Su.HOW_WAS_CORNER].includes(r.iconType)),S=t.computed(()=>[Su.TAKEN_CORNERS].includes(r.iconType)),x=t.computed(()=>[Su.ZONE].includes(r.iconType)),v=t.computed(()=>[Su.WHAT_HAPPENED].includes(r.iconType));return(p,o)=>(t.openBlock(),t.createElementBlock("div",{class:"button",style:t.normalizeStyle(n.value)},[e.showIcon?(t.openBlock(),t.createElementBlock("div",VNe,[i.value?(t.openBlock(),t.createElementBlock("svg",LNe,[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,ONe),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,qNe),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,CNe)])):t.createCommentVNode("",!0),R.value||l.value?(t.openBlock(),t.createElementBlock("svg",UNe,[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,zNe),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,ENe),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,PNe)])):t.createCommentVNode("",!0),c.value?(t.openBlock(),t.createElementBlock("svg",RNe,[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,MNe)])):t.createCommentVNode("",!0),y.value?(t.openBlock(),t.createElementBlock("svg",FNe,[t.createElementVNode("rect",{x:"1.16772",y:"1.16699",width:"19",height:"15.6667",stroke:e.iconColor},null,8,jNe),t.createElementVNode("rect",{x:"16.1677",y:"6.16699",width:"4",height:"5.66667",stroke:e.iconColor},null,8,WNe),t.createElementVNode("rect",{x:"1.16772",y:"6.16699",width:"4",height:"5.66667",stroke:e.iconColor},null,8,ANe),t.createElementVNode("path",{d:"M10.6677 0.666992V16.5003",stroke:e.iconColor},null,8,KNe),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,INe)])):t.createCommentVNode("",!0),d.value?(t.openBlock(),t.createElementBlock("svg",XNe,[...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),S.value?(t.openBlock(),t.createElementBlock("svg",DNe,[...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",BNe,[...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),x.value?(t.openBlock(),t.createElementBlock("svg",GNe,[...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),v.value?(t.openBlock(),t.createElementBlock("svg",JNe,[...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",ZNe,t.toDisplayString(e.text),1),e.showBadge?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.showBadgeOnFilterFull?(t.openBlock(),t.createElementBlock("div",HNe,[t.createElementVNode("div",{class:"button__info",style:t.normalizeStyle(b.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(b.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",YNe)):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",QNe,[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,$Ne)]))],2)],4))}},tVe=pc(eVe,[["__scopeId","data-v-2df3c6a9"]]),rVe={__name:"SwitchCustom",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:r}){const n=e,b=r,R=t.ref(null);t.watch(()=>n.modelValue,()=>{y()},{immediate:!0});function y(){R.value&&(R.value.checked=n.modelValue)}function c(i){b("update:modelValue",i.target.checked)}return t.onMounted(()=>{y()}),(i,d)=>(t.openBlock(),t.createElementBlock("input",{ref_key:"switchCustom",ref:R,id:"toggle",class:"toggle",type:"checkbox",role:"switch",name:"toggle",onInput:c},null,544))}},L_=pc(rVe,[["__scopeId","data-v-e3a6ae4e"]]),aVe={class:"corners"},nVe={class:"corners-type"},iVe={class:"selected-item"},oVe={class:"available-item"},sVe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lVe={class:"advanced-filters-menu"},cVe={class:"toggle-group"},uVe={class:"toggle-group"},dVe={key:0,class:"time-control"},pVe={class:"stepper-container"},hVe={class:"stepper"},fVe={class:"stepper-value"},mVe={class:"time-control"},yVe={class:"stepper-container"},gVe={class:"stepper"},vVe={class:"stepper-value"},bVe={class:"time-control"},xVe={class:"stepper-container"},wVe={class:"stepper"},_Ve={class:"stepper-value"},SVe={class:"corners__how-many-games"},TVe={class:"selected-item"},kVe={class:"available-item"},NVe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},VVe={__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 b=Array.from({length:10}).map((V,L)=>({id:L+1,name:`${L+1} ${L===0?"corner":"corners"}`,value:L+1})),R=e,y=r,c=t.ref([...b]),i=t.ref(c.value[0]),d=t.ref(s()),l=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:R.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]}),S=t.ref(!1),x=t.ref(R.defaultFilters?R.defaultFilters.isAgainstMode:!1),v=t.ref(R.defaultFilters?null:(n=a.value)==null?void 0:n.options[0]),p=t.computed(()=>({...V_}));t.watch(()=>R.viewConfig,V=>{V.filters&&(a.value||f())},{immediate:!0});const o=t.computed(()=>({isAgainstMode:x.value,selectedTeam:v.value,howManyCorners:i.value?i.value.value:null,advancedFilters:{...d.value}}));t.watch(()=>o.value,V=>{console.log("before emit change",V),console.log("props.viewConfig",R.viewConfig),y("change",{filters:{...V,advancedFilters:{...V.advancedFilters,areConnectionsVisible:!V.advancedFilters.areConnectionsVisible,arePathsVisible:!V.advancedFilters.arePathsVisible}},view:R.viewConfig})},{deep:!0,immediate:!0});function s(){return{areConnectionsVisible:!0,arePathsVisible:!0,secondsBefore:-1,secondsAfter:0,secondsBeforeAndAfter:0}}function f(){if(R.viewConfig&&R.viewConfig.filters){const V=R.viewConfig.filters.find(L=>L.key==="teamRadios");if(V){a.value={options:V.options};return}}a.value={label:"Equipo",options:R.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]}}function u(){console.log("setDefaultValues called with props.defaultFilters:",R.defaultFilters),R.defaultFilters&&(v.value=a.value.options.find(V=>V.value===(R.defaultFilters.isHomeTeam?1:2))||a.value.options[0],d.value={...R.defaultFilters.advancedFilters,areConnectionsVisible:!R.defaultFilters.advancedFilters.areConnectionsVisible,arePathsVisible:!R.defaultFilters.advancedFilters.arePathsVisible})}function m(V){v.value=V}function w(V){i.value=V}function _(V,L){d.value[L]+=V}function T(){S.value=!1}return t.onBeforeUnmount(()=>{}),t.onMounted(()=>{setTimeout(()=>{u()},500)}),(V,L)=>(t.openBlock(),t.createElementBlock("div",aVe,[t.withDirectives(t.createElementVNode("div",nVe,[t.createElementVNode("div",{class:t.normalizeClass(["label",{"switch-selected":!x.value}])}," A favor ",2),t.createVNode(L_,{modelValue:x.value,"onUpdate:modelValue":L[0]||(L[0]=O=>x.value=O)},null,8,["modelValue"]),t.createElementVNode("div",{class:t.normalizeClass(["label",{"switch-selected":x.value}])}," En contra ",2)],512),[[t.vShow,!e.isPostMatch]]),t.createVNode(t.unref(h1),t.mergeProps(p.value,{items:a.value.options,"model-value":v.value,"onUpdate:modelValue":m}),{default:t.withCtx(()=>[t.createElementVNode("div",iVe,[L[10]||(L[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(v.value?v.value.label:a.value.label),1)])]),availableItem:t.withCtx(({item:O})=>[t.createElementVNode("div",oVe,[t.createElementVNode("div",null,t.toDisplayString(O.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",sVe,[...L[11]||(L[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,v.value&&v.value.label===O.label]])])])]),_:1},16,["items","model-value"]),t.createVNode(t.unref(NNe),{modelValue:S.value,"onUpdate:modelValue":L[9]||(L[9]=O=>S.value=O),width:"250px","left-menu":"0","menu-margin-top":18},{trigger:t.withCtx(()=>[t.createVNode(tVe,t.mergeProps(l.value,{text:"Filtros avanzados","show-badge-on-filter-full":!1,"filters-total":0,"is-active":S.value,"show-icon":!0,"icon-type":t.unref(Su).CORNERS_ADVANCED}),null,16,["is-active","icon-type"])]),menu:t.withCtx(()=>[t.createElementVNode("div",lVe,[L[22]||(L[22]=t.createElementVNode("h2",{class:"menu-title"},"Mostrar Conexiones",-1)),t.createElementVNode("div",cVe,[L[12]||(L[12]=t.createElementVNode("label",{class:"toggle-label"},"Sí",-1)),t.createVNode(L_,{modelValue:d.value.areConnectionsVisible,"onUpdate:modelValue":L[1]||(L[1]=O=>d.value.areConnectionsVisible=O)},null,8,["modelValue"]),L[13]||(L[13]=t.createElementVNode("label",{class:"toggle-label"},"No",-1))]),L[23]||(L[23]=t.createElementVNode("hr",{class:"separator"},null,-1)),L[24]||(L[24]=t.createElementVNode("h2",{class:"menu-title"},"Mostrar recorridos",-1)),t.createElementVNode("div",uVe,[L[14]||(L[14]=t.createElementVNode("label",{class:"toggle-label"},"Sí",-1)),t.createVNode(L_,{modelValue:d.value.arePathsVisible,"onUpdate:modelValue":L[2]||(L[2]=O=>d.value.arePathsVisible=O)},null,8,["modelValue"]),L[15]||(L[15]=t.createElementVNode("label",{class:"toggle-label"},"No",-1))]),d.value.arePathsVisible?(t.openBlock(),t.createElementBlock("div",dVe,[L[17]||(L[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",pVe,[t.createElementVNode("div",hVe,[t.createElementVNode("button",{class:"stepper-btn",onClick:L[3]||(L[3]=O=>_(-1,"secondsBeforeAndAfter"))},"−"),t.createElementVNode("span",fVe,t.toDisplayString(d.value.secondsBeforeAndAfter),1),t.createElementVNode("button",{class:"stepper-btn",onClick:L[4]||(L[4]=O=>_(1,"secondsBeforeAndAfter"))},"+")]),L[16]||(L[16]=t.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("div",mVe,[L[19]||(L[19]=t.createElementVNode("label",{class:"time-label"},[t.createTextVNode(" Segundos "),t.createElementVNode("span",{class:"highlight"},"antes"),t.createTextVNode(" del cobro: ")],-1)),t.createElementVNode("div",yVe,[t.createElementVNode("div",gVe,[t.createElementVNode("button",{class:"stepper-btn",onClick:L[5]||(L[5]=O=>_(-1,"secondsBefore"))},"−"),t.createElementVNode("span",vVe,t.toDisplayString(d.value.secondsBefore),1),t.createElementVNode("button",{class:"stepper-btn",onClick:L[6]||(L[6]=O=>_(1,"secondsBefore"))},"+")]),L[18]||(L[18]=t.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])]),t.createElementVNode("div",bVe,[L[21]||(L[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",xVe,[t.createElementVNode("div",wVe,[t.createElementVNode("button",{class:"stepper-btn",onClick:L[7]||(L[7]=O=>_(-1,"secondsAfter"))},"−"),t.createElementVNode("span",_Ve,t.toDisplayString(d.value.secondsAfter),1),t.createElementVNode("button",{class:"stepper-btn",onClick:L[8]||(L[8]=O=>_(1,"secondsAfter"))},"+")]),L[20]||(L[20]=t.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])])],64)),L[25]||(L[25]=t.createElementVNode("hr",{class:"separator"},null,-1)),t.createElementVNode("button",{class:"btn-ready",onClick:T},"Listo")])]),_:1},8,["modelValue"]),t.withDirectives(t.createElementVNode("div",SVe,[t.createVNode(t.unref(h1),t.mergeProps(p.value,{items:c.value,"model-value":i.value,"onUpdate:modelValue":w}),{default:t.withCtx(()=>[t.createElementVNode("div",TVe,[L[26]||(L[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:O})=>[t.createElementVNode("div",kVe,[t.createElementVNode("div",null,t.toDisplayString(O.name),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",NVe,[...L[27]||(L[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===O.name]])])])]),_:1},16,["items","model-value"])],512),[[t.vShow,!e.defaultFilters]])]))}},LVe=pc(VVe,[["__scopeId","data-v-d3233b73"]]),OVe={class:"resultados-filter"},qVe={class:"filter-checkboxes"},CVe=["checked","onChange"],UVe={class:"checkbox-label"},zVe={class:"filter-actions"},EVe={__name:"ResultadosFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:r}){const n=e,b=r,R=t.computed(()=>n.option.filters||[{label:"Iba ganando",value:"winning"},{label:"Iba perdiendo",value:"losing"},{label:"Iba empatado",value:"tied"}]),y=t.computed(()=>{const a=n.selectedValues[n.filterIndex];return!a||!a[n.optionIndex]?[]:Array.isArray(a[n.optionIndex])?a[n.optionIndex]:[]}),c=a=>y.value.includes(a),i=(a,S)=>{let x=[...y.value];S?x.includes(a)||x.push(a):x=x.filter(v=>v!==a),b("update-selection",{optionIndex:n.optionIndex,values:x})},d=()=>{b("update-selection",{optionIndex:n.optionIndex,values:[]})},l=()=>{};return(a,S)=>(t.openBlock(),t.createElementBlock("div",OVe,[t.createElementVNode("div",qVe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R.value,x=>(t.openBlock(),t.createElementBlock("label",{key:x.value,class:"checkbox-item"},[t.createElementVNode("input",{type:"checkbox",checked:c(x.value),onChange:t.withModifiers(v=>i(x.value,v.target.checked),["stop"])},null,40,CVe),t.createElementVNode("span",UVe,t.toDisplayString(x.label),1)]))),128))]),t.createElementVNode("div",zVe,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(d,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(l,["stop"])}," Listo ")])]))}},$b=pc(EVe,[["__scopeId","data-v-1fba7a5d"]]),PVe={class:"detalles-filter"},RVe={class:"filter-checkboxes"},MVe=["checked","onChange"],FVe={class:"checkbox-label"},jVe={class:"filter-actions"},WVe={__name:"DetallesFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:r}){const n=e,b=r,R=t.computed(()=>n.option.filters||[]),y=t.computed(()=>{const a=n.selectedValues[n.filterIndex];return!a||!a[n.optionIndex]?[]:Array.isArray(a[n.optionIndex])?a[n.optionIndex]:[]}),c=a=>y.value.includes(a),i=(a,S)=>{let x=[...y.value];S?x.includes(a)||x.push(a):x=x.filter(v=>v!==a),b("update-selection",{optionIndex:n.optionIndex,values:x})},d=()=>{b("update-selection",{optionIndex:n.optionIndex,values:[]})},l=()=>{};return(a,S)=>(t.openBlock(),t.createElementBlock("div",PVe,[t.createElementVNode("div",RVe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R.value,x=>(t.openBlock(),t.createElementBlock("label",{key:x.value,class:"checkbox-item"},[t.createElementVNode("input",{type:"checkbox",checked:c(x.value),onChange:t.withModifiers(v=>i(x.value,v.target.checked),["stop"])},null,40,MVe),t.createElementVNode("span",FVe,t.toDisplayString(x.label),1)]))),128))]),t.createElementVNode("div",jVe,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(d,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(l,["stop"])}," Listo ")])]))}},O_=pc(WVe,[["__scopeId","data-v-175921a6"]]),AVe={class:"como-fue-cobrado-filter"},KVe={class:"filter-checkboxes"},IVe=["checked","onChange"],XVe={class:"checkbox-label"},DVe={class:"filter-actions"},BVe={__name:"ComoFueCobradoFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:r}){const n=e,b=r,R=t.computed(()=>n.option.filters||[]),y=t.computed(()=>{const a=n.selectedValues[n.filterIndex];return!a||!a[n.optionIndex]?[]:Array.isArray(a[n.optionIndex])?a[n.optionIndex]:[]}),c=a=>y.value.includes(a),i=(a,S)=>{let x=[...y.value];S?x.includes(a)||x.push(a):x=x.filter(v=>v!==a),b("update-selection",{optionIndex:n.optionIndex,values:x})},d=()=>{b("update-selection",{optionIndex:n.optionIndex,values:[]})},l=()=>{};return(a,S)=>(t.openBlock(),t.createElementBlock("div",AVe,[t.createElementVNode("div",KVe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R.value,x=>(t.openBlock(),t.createElementBlock("label",{key:x.value,class:"checkbox-item"},[t.createElementVNode("input",{type:"checkbox",checked:c(x.value),onChange:t.withModifiers(v=>i(x.value,v.target.checked),["stop"])},null,40,IVe),t.createElementVNode("span",XVe,t.toDisplayString(x.label),1)]))),128))]),t.createElementVNode("div",DVe,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(d,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(l,["stop"])}," Listo ")])]))}},ex=pc(BVe,[["__scopeId","data-v-905a2961"]]),GVe={class:"zona-filter"},JVe={class:"filter-checkboxes"},ZVe=["checked","onChange"],HVe={class:"checkbox-label"},YVe={class:"filter-actions"},QVe={__name:"ZonaFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:r}){const n=e,b=r,R=t.computed(()=>n.option.filters||[]),y=t.computed(()=>{const a=n.selectedValues[n.filterIndex];return!a||!a[n.optionIndex]?[]:Array.isArray(a[n.optionIndex])?a[n.optionIndex]:[]}),c=a=>y.value.includes(a),i=(a,S)=>{let x=[...y.value];S?x.includes(a)||x.push(a):x=x.filter(v=>v!==a),b("update-selection",{optionIndex:n.optionIndex,values:x})},d=()=>{b("update-selection",{optionIndex:n.optionIndex,values:[]})},l=()=>{};return(a,S)=>(t.openBlock(),t.createElementBlock("div",GVe,[t.createElementVNode("div",JVe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R.value,x=>(t.openBlock(),t.createElementBlock("label",{key:x.value,class:"checkbox-item"},[t.createElementVNode("input",{type:"checkbox",checked:c(x.value),onChange:t.withModifiers(v=>i(x.value,v.target.checked),["stop"])},null,40,ZVe),t.createElementVNode("span",HVe,t.toDisplayString(x.label),1)]))),128))]),t.createElementVNode("div",YVe,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(d,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(l,["stop"])}," Listo ")])]))}},q_=pc(QVe,[["__scopeId","data-v-6fb0c545"]]),$Ve={class:"que-sucedio-filter"},eLe={class:"filter-checkboxes"},tLe=["checked","onChange"],rLe={class:"checkbox-label"},aLe={class:"filter-actions"},nLe={__name:"QueSucedioFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection"],setup(e,{emit:r}){const n=e,b=r,R=t.computed(()=>n.option.filters||[]),y=t.computed(()=>{const a=n.selectedValues[n.filterIndex];return!a||!a[n.optionIndex]?[]:Array.isArray(a[n.optionIndex])?a[n.optionIndex]:[]}),c=a=>y.value.includes(a),i=(a,S)=>{let x=[...y.value];S?x.includes(a)||x.push(a):x=x.filter(v=>v!==a),b("update-selection",{optionIndex:n.optionIndex,values:x})},d=()=>{b("update-selection",{optionIndex:n.optionIndex,values:[]})},l=()=>{};return(a,S)=>(t.openBlock(),t.createElementBlock("div",$Ve,[t.createElementVNode("div",eLe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R.value,x=>(t.openBlock(),t.createElementBlock("label",{key:x.value,class:"checkbox-item"},[t.createElementVNode("input",{type:"checkbox",checked:c(x.value),onChange:t.withModifiers(v=>i(x.value,v.target.checked),["stop"])},null,40,tLe),t.createElementVNode("span",rLe,t.toDisplayString(x.label),1)]))),128))]),t.createElementVNode("div",aLe,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(d,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(l,["stop"])}," Listo ")])]))}},pg=pc(nLe,[["__scopeId","data-v-ecc3baf0"]]),iLe={class:"advanced-select-accordion"},oLe=["onClick"],sLe={class:"accordion-header-left"},lLe={class:"accordion-icon"},cLe=["src","alt"],uLe={class:"accordion-title"},dLe={class:"accordion-header-right"},pLe={key:0,class:"accordion-badge"},hLe={key:0,class:"accordion-content"},fLe={class:"accordion-footer"},mLe={__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,b=r,R=t.ref({}),y=S=>{R.value[S]?R.value[S]=!1:(Object.keys(R.value).forEach(x=>{R.value[x]=!1}),R.value[S]=!0)},c=S=>{const x=n.filter.options[S];if(!x||!x.filters)return 0;const v=n.selectedValues[n.filterIndex];if(!v||!v[S])return 0;const p=v[S];return Array.isArray(p)?p.length:0},i=(S,x)=>S.icon?S.icon:`https://golstatsimages.blob.core.windows.net/todoelfut/f${x+1}.png`,d=S=>{const x={resultados:$b,detalles:O_,"como-fue-cobrado":ex,"como fue cobrado":ex,zona:q_,"que-sucedio":pg,"qué sucedió":pg,"que sucedio":pg},v=typeof S.value=="string"?S.value:String(S.value||""),p=typeof S.label=="string"?S.label:String(S.label||""),o=v.toLowerCase().trim(),s=p.toLowerCase().trim();if(o&&x[o])return x[o];if(s&&x[s])return x[s];const f=s.replace(/\s+/g,"-").replace(/[¿?]/g,"").replace(/[áéíóú]/g,u=>({á:"a",é:"e",í:"i",ó:"o",ú:"u"})[u]||u);return f&&x[f]?x[f]:$b},l=S=>{b("update-selection",{filterIndex:n.filterIndex,optionIndex:S.optionIndex,values:S.values})},a=()=>{b("close")};return(S,x)=>(t.openBlock(),t.createElementBlock("div",iLe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filter.options,(v,p)=>(t.openBlock(),t.createElementBlock("div",{key:v.value||p,class:"accordion-item"},[t.createElementVNode("div",{class:"accordion-header",onClick:t.withModifiers(o=>y(p),["stop"])},[t.createElementVNode("div",sLe,[t.createElementVNode("span",lLe,[t.createElementVNode("img",{src:i(v,p),alt:v.label},null,8,cLe)]),t.createElementVNode("span",uLe,t.toDisplayString(v.label),1)]),t.createElementVNode("div",dLe,[c(p)>0?(t.openBlock(),t.createElementBlock("span",pLe,t.toDisplayString(c(p)),1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass(["accordion-chevron",{open:R.value[p]}])},[...x[0]||(x[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,oLe),t.createVNode(t.Transition,{name:"accordion"},{default:t.withCtx(()=>[R.value[p]?(t.openBlock(),t.createElementBlock("div",hLe,[d(v)===$b?(t.openBlock(),t.createBlock($b,{key:0,option:v,"filter-index":e.filterIndex,"option-index":p,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):d(v)===O_?(t.openBlock(),t.createBlock(O_,{key:1,option:v,"filter-index":e.filterIndex,"option-index":p,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):d(v)===ex?(t.openBlock(),t.createBlock(ex,{key:2,option:v,"filter-index":e.filterIndex,"option-index":p,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):d(v)===q_?(t.openBlock(),t.createBlock(q_,{key:3,option:v,"filter-index":e.filterIndex,"option-index":p,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):d(v)===pg?(t.openBlock(),t.createBlock(pg,{key:4,option:v,"filter-index":e.filterIndex,"option-index":p,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)]),_:2},1024)]))),128)),t.createElementVNode("div",fLe,[x[1]||(x[1]=t.createElementVNode("div",{class:"footer-separator"},null,-1)),t.createElementVNode("button",{class:"btn-done-footer",onClick:t.withModifiers(a,["stop"])}," Listo ")])]))}},yLe=pc(mLe,[["__scopeId","data-v-941aab18"]]),gLe={class:"corners-zone-filters"},vLe={key:0,class:"custom-radio-group"},bLe={class:"radio-label"},xLe={class:"radio-options"},wLe=["name","value","onUpdate:modelValue"],_Le={key:0,class:"filter-separator"},SLe={class:"filter-inline select-with-label"},TLe=["data-filter-type","onClick"],kLe={class:"select-display"},NLe={class:"select-label"},VLe={key:0,class:"dropdown-menu type-menu simple-select-menu"},LLe={class:"simple-select-scroll-area"},OLe=["onClick"],qLe={class:"option-content"},CLe={class:"option-title"},ULe={key:0,class:"option-checkmark"},zLe={class:"switch-group"},ELe={class:"switch-label"},PLe={key:0,class:"switch-text switch-text-left"},RLe=["onClick"],MLe={key:1,class:"switch-text switch-text-right"},FLe={key:0,class:"filter-separator"},jLe={key:3,class:"filter-inline advanced-select-wrapper"},WLe=["data-filter-type","onClick"],ALe={class:"select-display"},KLe={class:"select-label"},ILe={key:0,class:"dropdown-menu type-menu advanced-select-menu"},XLe={class:"advanced-select-content"},DLe={__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 b=e,R=n,y=t.ref([]);let c=null;const i=t.ref(null),d=t.ref(null),l=t.ref([]);let a=!1,S=null;const x=(O,U)=>{if(Array.isArray(O)&&Array.isArray(U)){if(O.length!==U.length)return!1;for(let q=0;q<O.length;q++)if(O[q]!==U[q])return!1;return!0}return O===U},v=(O,U=!0)=>{if(b.filters&&b.filters[0]&&b.filters[1]&&b.filters[1].options){const q=b.filters[0].options,z=b.filters[1].options;O!=null?q.findIndex(C=>C.value===O)!==-1&&z[O]?(l.value=z[O],U&&!(()=>{const C=y.value[1];return C==null?!1:Array.isArray(C)?C.length>0:C!==""})()&&!a&&l.value.length>0&&(y.value[1]=l.value[0].value,t.nextTick(()=>{}))):(l.value=[],y.value[1]=null):(l.value=[],y.value[1]=null)}},p=()=>{b.initialValues&&b.initialValues.length>0?b.initialValues.length>0&&(typeof b.initialValues[0]=="number"||typeof b.initialValues[0]=="boolean"||b.initialValues[0]===null||Array.isArray(b.initialValues[0]))?y.value=[...b.initialValues]:b.isEditMode?y.value=b.filters.map((O,U)=>{var q,z,C,N,E,k,P,F,W,A;const X=b.initialValues[U];return X?O.type==="radio-button"&&X.selectedOption?X.selectedOption.value:O.type==="radio-button"&&!X.selectedOption?X.selectedValue!==void 0?X.selectedValue:((k=(E=O.options)==null?void 0:E[0])==null?void 0:k.value)||null:O.type==="select-simple"&&X.selectedValue!==void 0?Array.isArray(X.selectedValue)?X.selectedValue[0]:X.selectedValue:O.type==="select"&&X.selectedOptions?X.selectedOptions.map(D=>D.value):O.type==="check"&&X.isChecked!==void 0?X.isChecked:X.selectedValue!==void 0?X.selectedValue:O.type==="select"?[]:O.type==="check"||O.type==="switch"?!1:O.type==="radio-button"?((F=(P=O.options)==null?void 0:P[0])==null?void 0:F.value)||null:O.type==="select-simple"?((A=(W=O.options)==null?void 0:W[0])==null?void 0:A.value)||null:O.type==="advanced-select"?{}:null:O.type==="select"?[]:O.type==="check"||O.type==="switch"?!1:O.type==="radio-button"?((z=(q=O.options)==null?void 0:q[0])==null?void 0:z.value)||null:O.type==="select-simple"&&((N=(C=O.options)==null?void 0:C[0])==null?void 0:N.value)||null}):y.value=[...b.initialValues]:y.value=b.filters.map(O=>{var U,q,z,C;return O.type==="select"?[]:O.type==="check"||O.type==="switch"?!1:O.type==="radio-button"?((q=(U=O.options)==null?void 0:U[0])==null?void 0:q.value)||null:O.type==="select-simple"?((C=(z=O.options)==null?void 0:z[0])==null?void 0:C.value)||null:O.type==="advanced-select"?{}:null}),y.value.some(O=>O!=null&&(Array.isArray(O)?O.length>0:typeof O=="object"&&!Array.isArray(O)?Object.keys(O).length>0:O!==!1&&O!==""))&&(c=[...y.value],R("filters-changed",{componentId:b.componentId,filters:y.value,timestamp:new Date().toISOString()}))};p(),setTimeout(()=>{t.nextTick(()=>{if(y.value[0]!==null&&y.value[0]!==void 0&&!a){const O=!(()=>{const U=y.value[1];return U==null?!1:Array.isArray(U)?U.length>0:U!==""})();v(y.value[0],O)}})},300),t.watch(()=>b.initialValues,O=>{if(!O||O.length===0)return;const U=O.length>0&&(typeof O[0]=="number"||typeof O[0]=="boolean"||O[0]===null||Array.isArray(O[0])),q=!x(y.value,O),z=O&&O.length>0&&!a&&q,C=b.isEditMode&&a;z&&!C?U?y.value=[...O]:b.isEditMode?y.value=b.filters.map((N,E)=>{const k=O[E];return k?N.type==="radio-button"&&k.selectedOption?k.selectedOption.value:N.type==="select-simple"&&k.selectedValue!==void 0?Array.isArray(k.selectedValue)?k.selectedValue[0]:k.selectedValue:N.type==="select"&&k.selectedOptions?k.selectedOptions.map(P=>P.value):N.type==="check"&&k.isChecked!==void 0||N.type==="switch"&&k.isChecked!==void 0?k.isChecked:N.type==="switch"&&k.selectedValue!==void 0||N.type==="advanced-select"&&k.selectedValue!==void 0||k.selectedValue!==void 0?k.selectedValue:y.value[E]:y.value[E]}):y.value=[...O]:a?S&&S.length>0&&(y.value=[...S]):C&&S&&S.length>0&&(y.value=[...S])},{deep:!0}),t.watch(()=>b.isEditMode,(O,U)=>{U===!0&&O===!1&&(S=null)},{immediate:!0}),t.watch(y,O=>{O.some(U=>U!=null&&(Array.isArray(U)?U.length>0:typeof U=="object"&&!Array.isArray(U)?Object.keys(U).length>0:U!==!1&&U!==""))&&(()=>{if(!c)return!0;for(let U=0;U<O.length;U++)if(!x(O[U],c[U]))return!0;return!1})()&&(c=[...O],R("filters-changed",{componentId:b.componentId,filters:O,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),t.watch(()=>y.value[0],(O,U)=>{O!==U&&U!==void 0?v(O,!0):U===void 0&&O!==null&&O!==void 0&&v(O,!1)},{immediate:!0});const o=O=>{i.value===O?i.value=null:(i.value=O,d.value=null)},s=O=>{d.value===O?d.value=null:(d.value=O,i.value=null)},f=(O,U)=>{if(a=!0,setTimeout(()=>{a=!1},1e3),y.value[O]=U,(O===0||O===1)&&(S=[...y.value]),i.value=null,O===0){y.value[1]!==void 0&&(y.value[1]=null);const q=a;a=!1,v(U,!0),a=q,y.value[1]!==null&&y.value[1]!==void 0&&(S=[...y.value])}},u=()=>{a=!0,setTimeout(()=>{a=!1},400)},m=O=>{a=!0,setTimeout(()=>{a=!1},400),y.value[O]=!y.value[O]},w=O=>{a=!0,setTimeout(()=>{a=!1},400),y.value[O.filterIndex]||(y.value[O.filterIndex]={}),y.value[O.filterIndex][O.optionIndex]=O.values},_=()=>y.value,T=(O,U)=>{const q=y.value[U];if(q==null)return null;if(U===1&&l.value.length>0){const z=l.value.find(C=>C.value===q);return z?z.label:null}if(O.options&&Array.isArray(O.options)){const z=O.options.find(C=>C.value===q);return z?z.label:null}return null},V=(O,U)=>{const q=y.value[U];if(!q||typeof q!="object"||Array.isArray(q))return null;const z=Object.values(q).reduce((C,N)=>Array.isArray(N)&&N.length>0?C+N.length:C,0);return z>0?`${z} seleccionado${z>1?"s":""}`:null},L=O=>{const U=O.target,q=U.closest(".advanced-select-dropdown"),z=U.closest(".custom-select.dynamic-select");!q&&!z&&(d.value=null,i.value=null)};return t.onMounted(()=>{document.addEventListener("click",L)}),t.onUnmounted(()=>{document.removeEventListener("click",L)}),r({getCurrentValues:_,initializeValues:p}),(O,U)=>(t.openBlock(),t.createElementBlock("div",gLe,[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,(q,z)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:z},[q.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",vLe,[t.createElementVNode("div",bLe,t.toDisplayString(q.label),1),t.createElementVNode("div",xLe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(q.options,C=>(t.openBlock(),t.createElementBlock("label",{key:C.value,class:t.normalizeClass(["radio-option-card",{active:y.value[z]===C.value}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"corners-zone-radio-"+z,value:C.value,"onUpdate:modelValue":N=>y.value[z]=N,onChange:u},null,40,wLe),[[t.vModelRadio,y.value[z]]]),t.createElementVNode("span",null,t.toDisplayString(C.label),1)],2))),128))])])):q.type==="select-simple"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[z==2?(t.openBlock(),t.createElementBlock("div",_Le)):t.createCommentVNode("",!0),t.createElementVNode("div",SLe,[t.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":q.type,onClick:t.withModifiers(C=>o(z),["stop"])},[t.createElementVNode("div",kLe,[U[1]||(U[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",NLe,t.toDisplayString(T(q,z)||q.label_2||q.label||"Tipo de análisis"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:i.value===z}])},[...U[0]||(U[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===z?(t.openBlock(),t.createElementBlock("div",VLe,[t.createElementVNode("div",LLe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(z===1?l.value:q.options,C=>(t.openBlock(),t.createElementBlock("div",{key:C.value,class:t.normalizeClass(["option-card simple-select-option",{active:x(y.value[z],C.value)}]),onClick:t.withModifiers(N=>f(z,C.value),["stop"])},[t.createElementVNode("div",qLe,[t.createElementVNode("div",CLe,t.toDisplayString(C.label),1)]),x(y.value[z],C.value)?(t.openBlock(),t.createElementBlock("div",ULe,[...U[2]||(U[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,OLe))),128))])])):t.createCommentVNode("",!0)],8,TLe)])],64)):q.type==="switch"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("div",zLe,[t.createElementVNode("label",ELe,[q.label_1?(t.openBlock(),t.createElementBlock("span",PLe,t.toDisplayString(q.label_1),1)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"switch",onClick:C=>m(z)},[t.createElementVNode("div",{class:t.normalizeClass(["switch-track",{"switch-on":y.value[z]}])},[t.createElementVNode("div",{class:t.normalizeClass(["switch-thumb",{on:y.value[z]}])},null,2)],2)],8,RLe),q.label_2?(t.openBlock(),t.createElementBlock("span",MLe,t.toDisplayString(q.label_2),1)):t.createCommentVNode("",!0)])]),z>=0?(t.openBlock(),t.createElementBlock("div",FLe)):t.createCommentVNode("",!0)],64)):q.type==="advanced-select"?(t.openBlock(),t.createElementBlock("div",jLe,[t.createElementVNode("div",{class:"custom-select dynamic-select filter-inline advanced-select-dropdown","data-filter-type":q.type,onClick:t.withModifiers(C=>s(z),["stop"])},[t.createElementVNode("div",ALe,[U[4]||(U[4]=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",KLe,t.toDisplayString(V(q,z)||q.label||"Seleccionar"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:d.value===z}])},[...U[3]||(U[3]=[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)]),d.value===z?(t.openBlock(),t.createElementBlock("div",ILe,[t.createElementVNode("div",XLe,[t.createVNode(yLe,{filter:q,"filter-index":z,"selected-values":y.value,onUpdateSelection:w,onClose:C=>s(z)},null,8,["filter","filter-index","selected-values","onClose"])])])):t.createCommentVNode("",!0)],8,WLe)])):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0)]))}},BLe=pc(DLe,[["__scopeId","data-v-65027e1a"]]),GLe={class:"floating-bar"},JLe={class:"tab active"},ZLe={class:"select-display"},HLe={class:"select-icon"},YLe=["src"],QLe={key:1,alt:"icono",class:"option-img-default",src:"https://golstatsimages.blob.core.windows.net/images-library/vector2.png"},$Le={key:0,class:"select-placeholder select-label"},eOe={key:1,class:"select-label"},tOe={key:0,class:"dropdown-menu field-menu"},rOe=["onClick"],aOe={class:"option-icon"},nOe=["data-hover-src","src"],iOe={class:"option-content"},oOe={class:"option-title"},sOe={key:0,class:"option-description"},lOe={class:"select-display"},cOe={class:"select-icon"},uOe=["src"],dOe=["src"],pOe={class:"select-label"},hOe={key:0,class:"dropdown-menu type-menu type-menu-grid"},fOe={class:"option-grid"},mOe=["onClick"],yOe={class:"option-grid-title"},gOe={class:"option-grid-icon"},vOe=["src"],bOe={key:1,class:"filter-separator"},xOe=["onClick"],wOe={class:"select-display"},_Oe={key:0,class:"badge-categorias"},SOe={key:0,class:"dropdown-menu type-menu multi-select-menu"},TOe={class:"multi-select-scroll-area"},kOe={class:"select-all-checkbox"},NOe=["checked","indeterminate","onChange"],VOe={class:"option-checkbox"},LOe=["checked","onChange"],OOe=["onClick"],qOe={class:"option-title"},COe={class:"multi-select-footer"},UOe={key:1,class:"custom-radio-group filter-inline"},zOe={class:"radio-label"},EOe={class:"radio-options"},POe=["onUpdate:modelValue","disabled","name","value","onChange"],ROe={key:2,class:"check-group filter-inline"},MOe=["onUpdate:modelValue","checked"],FOe=["data-filter-type","onClick"],jOe={class:"select-display"},WOe={key:0,class:"dropdown-menu type-menu simple-select-menu"},AOe={class:"simple-select-scroll-area"},KOe=["onMouseenter","onClick"],IOe={class:"option-content"},XOe={class:"option-title"},DOe={key:0,class:"option-checkmark"},BOe={key:4,class:"filter-separator"},GOe=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 b=e,R=n,y=t.ref(new Map),c=t.ref([]);let i=null,d=null,l=null;const a=t.ref(!1),S=t.ref(!1),x=t.ref(!1),v=t.ref(!1),p=t.ref(!1),o=t.ref(!1),s=t.computed(()=>c.value),f=t.ref(null),u=t.computed(()=>s.value[f.value]||null),m=t.computed(()=>{var ye;const ze=((ye=u.value)==null?void 0:ye.views)||[];return C(ze)}),w=t.ref(null),_=t.computed(()=>m.value.find(ye=>ye.id===w.value)||null),T=t.ref([]),V=t.computed(()=>{var ye,ze;return a.value?((ye=_.value)==null?void 0:ye.filters_edition_mode)||[]:((ze=_.value)==null?void 0:ze.filters)||[]});t.watch(a,ye=>{ye||(S.value=!1)}),t.watch(_,ye=>{var ze,Me;if(!ye){T.value=[];return}const je=ye.id===6&&b.isPostMatch,He=ye.id===14;if(!Array.isArray(V.value)&&!je&&!He){T.value=[];return}v.value||(je||He?T.value=[]:T.value=V.value.map(($e,ut)=>{var xt,_t,Rt,Xt,It,lt,et,ct,mt,Ut,Nt,it,dt,Ze,pt,kt,vt,St,Lt,nt,rt;if($e.type==="select"){if(a.value&&l&&l.dynamicFilters){const wt=l.dynamicFilters[ut];if(wt){if(wt.selectedOptions&&Array.isArray(wt.selectedOptions))return wt.selectedOptions.map(Mt=>Mt.value);if(wt.selectedValue&&Array.isArray(wt.selectedValue))return wt.selectedValue.length>0&&wt.selectedValue[0]&&typeof wt.selectedValue[0]=="object"?Fe(wt.selectedValue):wt.selectedValue}}return ye.id===4&&$e.options&&Array.isArray($e.options)?$e.options.map(wt=>wt.value):[]}else if($e.type==="radio-button"){if(a.value&&l&&l.dynamicFilters){const wt=l.dynamicFilters[ut];if(wt&&wt.selectedOption){let Mt=wt.selectedOption.value;if(ye.id===15&&ut===0&&Mt===3&&((_t=(xt=d==null?void 0:d.view)==null?void 0:xt.filterMultiple)==null?void 0:_t.isHomeTeam)!==void 0){const Ft=d.view.filterMultiple.isHomeTeam;typeof Ft=="boolean"?Mt=Ft?1:2:typeof Ft=="number"&&(Mt=Ft===1?1:2)}return Mt}}if(ye.id===7&&a.value&&d!=null&&d.view){if(ut===0&&(Rt=d.view.componentProps)!=null&&Rt.analysisType)return d.view.componentProps.analysisType==="offensive"?1:2;if(ut===1&&((Xt=d.view.filterMultiple)==null?void 0:Xt.isHomeTeam)!==void 0)return d.view.filterMultiple.isHomeTeam?1:2}return((lt=(It=$e.options)==null?void 0:It[0])==null?void 0:lt.value)??null}else if($e.type==="select-simple"){if(a.value&&l&&l.dynamicFilters){const wt=l.dynamicFilters[ut];if(wt&&wt.selectedValue!==void 0){let Mt;return ye.id===2&&(ct=(et=d==null?void 0:d.view)==null?void 0:et.filterMultiple)!=null&&ct.categoryId?Mt=d.view.filterMultiple.categoryId:ye.id===1&&(Ut=(mt=d==null?void 0:d.view)==null?void 0:mt.filterMultiple)!=null&&Ut.category?Mt=d.view.filterMultiple.category:ye.id===6&&(it=(Nt=d==null?void 0:d.view)==null?void 0:Nt.filterMultiple)!=null&&it.gameNumber?Mt=d.view.filterMultiple.gameNumber:Mt=Array.isArray(wt.selectedValue)?wt.selectedValue[0]:wt.selectedValue,Mt}}if(ye.id===2&&a.value&&d!=null&&d.view){if(i&&d.view.id){const wt=i.getComponentDynamicFilters(d.view.id);if(wt&&wt[ut]!==void 0)return wt[ut]}if(d.view.filterMultiple){if($e.type==="select-simple"&&d.view.filterMultiple.categoryId){const wt=d.view.filterMultiple.categoryId;return($e.options||[]).find(Mt=>Mt.value==wt),wt}if($e.type==="radio-button"&&d.view.filterMultiple.teamType!==void 0){const wt=d.view.filterMultiple.teamType;return($e.options||[]).find(Mt=>Mt.value==wt),wt}}}if(ye.id===1&&a.value&&(dt=d==null?void 0:d.view)!=null&&dt.filterMultiple&&d.view.filterMultiple.category){const wt=d.view.filterMultiple.category;return($e.options||[]).find(Mt=>Mt.value==wt),wt}if(ye.id===9&&a.value&&(Ze=d==null?void 0:d.view)!=null&&Ze.filterMultiple&&$e.type==="select-simple"&&d.view.filterMultiple.categoryIds){const wt=Array.isArray(d.view.filterMultiple.categoryIds)?d.view.filterMultiple.categoryIds:[d.view.filterMultiple.categoryIds],Mt=($e.options||[]).filter(Ft=>Array.isArray(Ft.value)?Te(Ft.value,wt):wt.includes(Ft.value));return Mt.length>0?Mt[0].value:wt}if(ye.id===6&&a.value&&(pt=d==null?void 0:d.view)!=null&&pt.filterMultiple&&d.view.filterMultiple.gameNumber){const wt=d.view.filterMultiple.gameNumber;return($e.options||[]).find(Mt=>Mt.value==wt),wt}if(ye.id===5&&a.value&&(kt=d==null?void 0:d.view)!=null&&kt.filterMultiple&&d.view.filterMultiple.isHomeTeam!==void 0){const wt=d.view.filterMultiple.isHomeTeam;let Mt;if(typeof wt=="boolean"?Mt=wt?1:2:typeof wt=="number"?Mt=wt===1?1:2:Mt=1,($e.options||[]).find(Ft=>Ft.value==Mt),$e.type==="radio-button"&&($e.label==="Equipo"||$e.label==="Team"||$e.label==="Equipo seleccionado"))return Mt}if(ye.id===15&&a.value&&(vt=d==null?void 0:d.view)!=null&&vt.filterMultiple&&d.view.filterMultiple.isHomeTeam!==void 0&&$e.type==="radio-button"&&ut===0){const wt=d.view.filterMultiple.isHomeTeam;let Mt;if(typeof wt=="boolean"?Mt=wt?1:2:typeof wt=="number"?Mt=wt===1?1:2:Mt=1,($e.options||[]).find(Ft=>Ft.value==Mt))return Mt}if(ye.id===9&&a.value&&(St=d==null?void 0:d.view)!=null&&St.filterMultiple&&$e.type==="radio-button"&&d.view.filterMultiple.isHomeTeam!==void 0){const wt=d.view.filterMultiple.isHomeTeam?1:2,Mt=((Lt=$e.options)==null?void 0:Lt.map(Ft=>Ft.value))||[];return Mt.includes(wt)?wt:Mt[0]||1}return((rt=(nt=$e.options)==null?void 0:nt[0])==null?void 0:rt.value)??null}else if($e.type==="check"){if(a.value&&l&&l.dynamicFilters){const wt=l.dynamicFilters[ut];if(wt&&wt.isChecked!==void 0)return wt.isChecked}if(ye.id===8)return!0;if(ye.id===3){if(a.value&&l&&l.dynamicFilters){const wt=l.dynamicFilters[ut];if(wt&&wt.isChecked!==void 0)return wt.isChecked}return!1}return!1}return null}),!((ze=ye.name)!=null&&ze.toLowerCase().includes("tops players")||(Me=ye.title)!=null&&Me.toLowerCase().includes("tops players"))&&(!a.value||je)&&t.nextTick(()=>{var $e,ut;ye.id===4&&a.value&&($e=d==null?void 0:d.view)!=null&&$e.id&&i&&i.setDynamicFilters(T.value,d.view.id),ye.id===3&&a.value&&(ut=d==null?void 0:d.view)!=null&&ut.id&&i&&i.setDynamicFilters(T.value,d.view.id),ne()}))},{immediate:!0}),t.watch(()=>i,ye=>{ye&&ye.dynamicFilters&&Array.isArray(ye.dynamicFilters)&&(v.value=!0,T.value=[...ye.dynamicFilters],t.nextTick(()=>{v.value=!1}))},{deep:!0}),t.watch(()=>i==null?void 0:i.dynamicFilters,ye=>{if(ye&&Array.isArray(ye)){if(p.value)return;v.value=!0,T.value=[...ye],t.nextTick(()=>{v.value=!1})}},{deep:!0}),t.watch(()=>_.value,ye=>{if(a.value&&l&&ye&&ye.filters){if(v.value||o.value)return;if(ye.id===3){if(p.value||o.value)return;const ze=l.dynamicFilters.find(Me=>Me.filterType==="check");ze&&ze.isChecked!==void 0&&T.value&&T.value.length>0&&(p.value=!0,T.value[0]=ze.isChecked,t.nextTick(()=>{T.value=[...T.value],p.value=!1}))}setTimeout(()=>{(!T.value||T.value.length===0)&&(Pe(),Ue(),me()),ye.id===4&&Ne()},100)}},{deep:!0}),t.watch(()=>{var ye;return(ye=_.value)==null?void 0:ye.id},ye=>{if(a.value&&l&&ye===4){if(v.value||o.value)return;setTimeout(()=>{Ne()},200)}}),t.watch(()=>T.value,ye=>{if(a.value&&l&&ye&&ye.length>0){if(v.value||p.value||o.value)return;setTimeout(()=>{var ze;ke()&&(Pe(),Ue(),me(),((ze=_.value)==null?void 0:ze.id)===4&&Ne())},50)}},{deep:!0});function L(ye,ze){var Me,je,He,$e,ut;const xt=T.value[ye];if((Me=_.value)==null||Me.id,(je=_.value)==null||je.id,Array.isArray(xt)){if(((He=_.value)==null?void 0:He.id)===4&&ye===0){const _t=xt.some(Rt=>{if(ze.category_id&&ze.event_type_id){if(Rt.category_id&&Rt.event_type_id)return Rt.category_id===ze.category_id&&Rt.event_type_id===ze.event_type_id;if(Rt.event_type_id&&!Rt.category_id)return Rt.event_type_id===ze.event_type_id;if(Rt.category_id&&!Rt.event_type_id)return Rt.category_id===ze.category_id}else{if(ze.event_type_id)return Rt.event_type_id===ze.event_type_id;if(ze.category_id)return Rt.category_id===ze.category_id}return JSON.stringify(Rt)===JSON.stringify(ze)});return($e=_.value)==null||$e.id,_t}return xt.includes(ze)}else if(xt!=null)return(ut=_.value)==null||ut.id,xt===ze;return!1}function O(ye,ze){var Me,je,He;const $e=(je=(Me=_.value)==null?void 0:Me.filters)==null?void 0:je[ye];if(($e==null?void 0:$e.type)==="select-simple"){se(ye,ze);return}Array.isArray(T.value[ye])||(T.value[ye]=[]);const ut=T.value[ye];let xt=-1;((He=_.value)==null?void 0:He.id)===4&&ye===0?xt=ut.findIndex(_t=>ze.category_id&&ze.event_type_id?_t.category_id===ze.category_id&&_t.event_type_id===ze.event_type_id:ze.event_type_id?_t.event_type_id===ze.event_type_id:ze.category_id?_t.category_id===ze.category_id:!1):xt=ut.indexOf(ze),xt>-1?ut.splice(xt,1):ut.push(ze),a.value&&Le(),ne()}function U(ye){var ze,Me;const je=T.value[ye],He=(Me=(ze=_.value)==null?void 0:ze.filters)==null?void 0:Me[ye];return(He==null?void 0:He.type)==="select-simple"||!He||!He.options||!Array.isArray(je)?!1:je.length===He.options.length}function q(ye){var ze,Me;const je=T.value[ye],He=(Me=(ze=_.value)==null?void 0:ze.filters)==null?void 0:Me[ye];return(He==null?void 0:He.type)==="select-simple"||!He||!He.options||!Array.isArray(je)?!1:je.length>0&&je.length<He.options.length}function z(){var ye;return!(((ye=_.value)==null?void 0:ye.id)===6&&b.isPostMatch)}function C(ye){return!ye||!Array.isArray(ye)?ye:ye.filter(ze=>{const Me=(ze.name||ze.title||"").toLowerCase();return b.isPostMatch?!0:!["resumen general","timeline","datos relevantes"].some(je=>Me.includes(je))})}function N(){var ye,ze;const Me=((ze=(ye=u.value)==null?void 0:ye.name)==null?void 0:ze.toLowerCase())||"";return Me.includes("cancha")||Me.includes("volumétrica")||Me.includes("volumetric")}function E(ye,ze){if(!a.value||!N())return!1;const Me=String(ye||"").toLowerCase(),je=String(ze||"").toLowerCase();return Me.includes("ambos")||je.includes("ambos")}function k(ye){var ze,Me;const je=(Me=(ze=_.value)==null?void 0:ze.filters)==null?void 0:Me[ye];if(!je||!je.options)return;const He=je.options.map($e=>$e.value);Array.isArray(T.value[ye])||(T.value[ye]=[]),U(ye)?T.value[ye]=[]:T.value[ye]=[...He],A.value=ye,ne()}const P=t.ref("ambos"),F=t.ref(!1),W=t.ref(!1),A=t.ref(null),X=t.ref(null);function D(ye,ze=!1){const Me="https://golstatsimages.blob.core.windows.net/images-library/",je="https://golstatsimages.blob.core.windows.net/reports-images/",He={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"},$e=Object.keys(He).find(ut=>ye==null?void 0:ye.toLowerCase().includes(ut.toLowerCase()));if($e){const ut=He[$e],xt=ze?"":"-def";return $e.toLowerCase().includes("tabla")?`${je}${ut}${xt}@2x.png`:`${Me}${ut}${xt}@2x.png`}return`${Me}icn_default${ze?"":"-def"}.png`}function Y(){return u.value?u.value.name:"Tipo de vista"}function re(){return _.value?_.value.name||_.value.title:"Visualización"}function G(){a.value||(F.value=!F.value,F.value&&(W.value=!1,t.nextTick(()=>{Ce()})))}function te(){a.value||u.value&&(W.value=!W.value,W.value&&(F.value=!1))}function ee(ye){a.value||(f.value=ye,F.value=!1,w.value=null,ne())}function H(ye){var ze,Me;a.value||(w.value=ye.id,W.value=!1,(ze=ye.name)!=null&&ze.toLowerCase().includes("tops players")||(Me=ye.title)==null||Me.toLowerCase().includes("tops players"))}function $(ye){var ze;A.value=A.value===ye?null:ye,((ze=_.value)==null?void 0:ze.id)===4&&a.value&&ye===0&&setTimeout(()=>{T.value=[...T.value]},50)}function oe(ye){X.value=X.value===ye?null:ye}function se(ye,ze){var Me,je,He,$e,ut;if(((Me=_.value)==null?void 0:Me.id)===2){const xt=V.value.findIndex(_t=>_t.type==="select-simple"&&_t.label==="Tipo de análisis");ye===xt?T.value[0]=ze:T.value[ye]=ze}else if(((je=_.value)==null?void 0:je.id)===1)T.value[0]=ze;else if(((He=_.value)==null?void 0:He.id)===6)T.value[0]=ze;else if((($e=_.value)==null?void 0:$e.id)===9)if(ye===0){Array.isArray(ze)?T.value[ye]=ze:T.value[ye]=[ze];const xt=((ut=V.value[ye])==null?void 0:ut.options)||[],_t=Array.isArray(ze)?ze:[ze],Rt=xt.find(Xt=>Array.isArray(Xt.value)?Te(Xt.value,_t):_t.includes(Xt.value));Rt?T.value[ye]=Rt.value:T.value[ye]=_t}else T.value[ye]=ze;else T.value[ye]=ze;X.value=null,a.value&&Le(),ne()}function ce(ye){ye.target.closest(".custom-select")||(F.value=!1,W.value=!1,X.value=null)}const he=[16,18];function ne(){var ye,ze,Me,je,He,$e,ut,xt,_t,Rt,Xt,It,lt,et,ct,mt,Ut,Nt,it,dt,Ze,pt;if(he.includes((ye=_.value)==null?void 0:ye.id)||v.value)return;let kt=[],vt=[];_.value&&Array.isArray(V.value)&&V.value.forEach((rt,wt)=>{if(rt.type==="select"&&rt.label==="Tipo de análisis"&&rt.id===2){const Mt=T.value[wt]||[];Array.isArray(Mt)&&Mt.length>0&&(kt=Mt.map(Ft=>{var Ct;const Ht=(Ct=rt.options)==null?void 0:Ct.find(Kt=>Kt.value===Ft);return{value:Ft,label:(Ht==null?void 0:Ht.label)||Ft}}))}});const St=((ze=_.value)==null?void 0:ze.id)===4;if(_.value&&Array.isArray(_.value.filters)&&_.value.filters.some(rt=>rt.type==="select"&&rt.label==="Tipo de análisis"&&rt.id===2)&&kt.length===0&&!St)return;if(St&&T.value&&T.value.length>0){const rt=T.value[0];Array.isArray(rt)&&rt.length>0}vt=((Me=V.value)==null?void 0:Me.map((rt,wt)=>{var Mt,Ft,Ct,Ht;const Kt=T.value[wt];let Yt=rt.id||`filter_${wt}`;return((Mt=_.value)==null?void 0:Mt.id)===3&&a.value&&(Ft=d==null?void 0:d.view)!=null&&Ft.id&&(Yt=`filter_${wt}_component_${d.view.id}`),{filterId:Yt,filterType:rt.type,filterLabel:rt.label,filterIcon:rt.icon||null,selectedValue:Kt,selectedOptions:rt.type==="select"&&Array.isArray(Kt)&&Kt.length>0?Kt.map(Gt=>{var Jt;const or=(Jt=rt.options)==null?void 0:Jt.find(sr=>sr.value===Gt);return{value:Gt,label:(or==null?void 0:or.label)||Gt,icon:(or==null?void 0:or.icon)||null}}):null,selectedOption:rt.type==="radio-button"&&Kt!=null?{value:Kt,label:((Ht=(Ct=rt.options)==null?void 0:Ct.find(Gt=>Gt.value===Kt))==null?void 0:Ht.label)||Kt}:null,isChecked:rt.type==="check"?Kt:null}}))||[];const Lt={mainSelector:{id:((je=u.value)==null?void 0:je.id)||null,name:((He=u.value)==null?void 0:He.name)||null,url:(($e=u.value)==null?void 0:$e.url)||null},viewSelector:{id:((ut=_.value)==null?void 0:ut.id)||null,name:((xt=_.value)==null?void 0:xt.name)||((_t=_.value)==null?void 0:_t.title)||null,url:((Rt=_.value)==null?void 0:Rt.url)||null},team:P.value,dynamicFilters:vt,categoriasSeleccionadas:kt,timestamp:new Date().toISOString(),summary:{mainSelected:!!u.value,viewSelected:!!_.value,totalDynamicFilters:((Xt=V.value)==null?void 0:Xt.length)||0,activeFilters:((It=V.value)==null?void 0:It.filter((rt,wt)=>{const Mt=T.value[wt];return Array.isArray(Mt)?Mt.length>0:Mt!=null&&Mt!==!1}).length)||0}},nt={main:u.value,view:_.value,team:P.value,dynamicFilters:T.value,filtersJSON:Lt,filterAndViewsContainer:i,viewToEdit:d};if(R("filters-changed",nt),a.value&&d){if(l=Lt,((lt=_.value)==null?void 0:lt.id)===2){const rt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select-simple"&&wt.filterLabel==="Tipo de análisis");rt!==-1&&(ct=(et=d.view)==null?void 0:et.filterMultiple)!=null&&ct.categoryId&&(l.dynamicFilters[rt].selectedValue=d.view.filterMultiple.categoryId)}if(((mt=_.value)==null?void 0:mt.id)===1){const rt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select-simple"&&wt.filterLabel==="Tipo de análisis");rt!==-1&&(Nt=(Ut=d.view)==null?void 0:Ut.filterMultiple)!=null&&Nt.category&&(l.dynamicFilters[rt].selectedValue=d.view.filterMultiple.category)}}if(((it=_.value)==null?void 0:it.id)===6&&a.value&&(dt=d==null?void 0:d.view)!=null&&dt.filterMultiple&&d.view.filterMultiple.gameNumber&&l){const rt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select-simple"&&wt.filterLabel==="Número de juego");rt!==-1&&(pt=(Ze=d.view)==null?void 0:Ze.filterMultiple)!=null&&pt.gameNumber&&(l.dynamicFilters[rt].selectedValue=d.view.filterMultiple.gameNumber)}i&&!a.value?i.setDynamicFilters(T.value):i&&a.value}function de(){d=null,l=null,i=null,f.value=null,w.value=null,P.value="ambos",T.value=[],F.value=!1,W.value=!1,A.value=null,X.value=null,a.value=!1,S.value=!1,x.value=!1}function ue(ye){if(ye&&ye.dynamicFilters){if(p.value)return;Array.isArray(ye.dynamicFilters)&&ye.dynamicFilters.length>0&&(v.value=!0,T.value=[...ye.dynamicFilters],t.nextTick(()=>{v.value=!1}))}}function ge(ye){if(a.value=!0,ye.mainSelector&&ye.mainSelector.id){const ze=c.value.findIndex(Me=>Me.id===ye.mainSelector.id);ze!==-1&&(f.value=ze)}ye.viewSelector&&ye.viewSelector.id&&u.value&&u.value.views.findIndex(ze=>ze.id===ye.viewSelector.id)!==-1&&(w.value=ye.viewSelector.id),ye.dynamicFilters&&Array.isArray(ye.dynamicFilters)&&t.nextTick(()=>{setTimeout(()=>{var ze,Me,je,He,$e,ut,xt,_t,Rt,Xt,It,lt,et,ct,mt,Ut,Nt,it,dt,Ze,pt,kt,vt;if(_.value&&V.value){if(v.value)return;if(p.value=!0,ye.dynamicFilters.forEach((St,Lt)=>{var nt,rt,wt,Mt,Ft,Ct,Ht,Kt,Yt,Gt,Jt,or,sr;if(Lt<V.value.length){const qr=V.value[Lt];if(((nt=_.value)==null?void 0:nt.id)===3&&a.value,qr.type==="check"){const Ur=St.isChecked;typeof Ur=="boolean"&&(T.value[Lt]=Ur)}else if(qr.type==="select"&&St.selectedOptions){const Ur=St.selectedOptions.map(Or=>Or.value);T.value[Lt]=Ur}else if(qr.type==="select"&&St.selectedValue&&Array.isArray(St.selectedValue))if(St.selectedValue.length>0&&St.selectedValue[0]&&typeof St.selectedValue[0]=="object"){const Ur=Fe(St.selectedValue);T.value[Lt]=Ur}else T.value[Lt]=St.selectedValue;else if(qr.type==="radio-button"&&St.selectedOption)T.value[Lt]=St.selectedOption.value;else if(qr.type==="select-simple"&&St.selectedValue!==void 0){let Ur;((rt=_.value)==null?void 0:rt.id)===2&&(Mt=(wt=d==null?void 0:d.view)==null?void 0:wt.filterMultiple)!=null&&Mt.categoryId?Ur=d.view.filterMultiple.categoryId:((Ft=_.value)==null?void 0:Ft.id)===1&&(Ht=(Ct=d==null?void 0:d.view)==null?void 0:Ct.filterMultiple)!=null&&Ht.category?Ur=d.view.filterMultiple.category:((Kt=_.value)==null?void 0:Kt.id)===6&&(Gt=(Yt=d==null?void 0:d.view)==null?void 0:Yt.filterMultiple)!=null&&Gt.gameNumber?Ur=d.view.filterMultiple.gameNumber:((Jt=_.value)==null?void 0:Jt.id)===9&&(sr=(or=d==null?void 0:d.view)==null?void 0:or.filterMultiple)!=null&&sr.categoryIds?Ur=d.view.filterMultiple.categoryIds:Ur=Array.isArray(St.selectedValue)?St.selectedValue[0]:St.selectedValue,T.value[Lt]=Ur}}}),((ze=_.value)==null?void 0:ze.id)===3&&a.value,((Me=_.value)==null?void 0:Me.id)===2&&a.value&&(je=d==null?void 0:d.view)!=null&&je.filterMultiple){if(d.view.filterMultiple.categoryId){const St=V.value.findIndex(Lt=>Lt.type==="select-simple"&&Lt.label==="Tipo de análisis");if(St!==-1){const Lt=d.view.filterMultiple.categoryId;if(T.value[0]=Lt,d.view.componentProps&&Lt){let nt=`Category ${Lt}`,rt=null;try{rt=Jh(Lt),rt&&(nt=rt.name)}catch{const wt=V.value.findIndex(Mt=>Mt.type==="select-simple"&&Mt.label==="Tipo de análisis");if(wt!==-1){const Mt=(((He=V.value[wt])==null?void 0:He.options)||[]).find(Ft=>Ft.value==Lt);Mt&&(nt=Mt.label)}}d.view.componentProps.categoryView=[{id:Lt,name:nt}]}((($e=V.value[St])==null?void 0:$e.options)||[]).find(nt=>nt.value==Lt),t.nextTick(()=>{T.value=[...T.value]})}}if(d.view.filterMultiple.teamType!==void 0){const St=V.value.findIndex(Lt=>Lt.type==="radio-button");if(St!==-1){const Lt=d.view.filterMultiple.teamType;T.value[St]=Lt,(((ut=V.value[St])==null?void 0:ut.options)||[]).find(nt=>nt.value==Lt),t.nextTick(()=>{T.value=[...T.value]})}}}if(((xt=_.value)==null?void 0:xt.id)===9&&a.value&&(_t=d==null?void 0:d.view)!=null&&_t.filterMultiple){if(d.view.filterMultiple.categoryIds){const St=V.value.findIndex(Lt=>Lt.type==="select-simple");if(St!==-1){const Lt=Array.isArray(d.view.filterMultiple.categoryIds)?d.view.filterMultiple.categoryIds:[d.view.filterMultiple.categoryIds];T.value[0]=Lt;const nt=(((Rt=V.value[St])==null?void 0:Rt.options)||[]).filter(wt=>Array.isArray(wt.value)?Te(wt.value,Lt):Lt.includes(wt.value));if(nt.length>0){const wt=nt[0].value;T.value[St]=wt}else T.value[St]=Lt;const rt=T.value[St];Te(rt,Lt),t.nextTick(()=>{T.value=[...T.value]})}}if(d.view.filterMultiple.isHomeTeam!==void 0){const St=V.value.findIndex(Lt=>Lt.type==="radio-button");if(St!==-1){const Lt=d.view.filterMultiple.isHomeTeam;let nt;typeof Lt=="boolean"?nt=Lt?1:2:typeof Lt=="number"?nt=Lt===1?1:2:nt=1,T.value[St]=nt,(((Xt=V.value[St])==null?void 0:Xt.options)||[]).find(rt=>rt.value==nt),t.nextTick(()=>{T.value=[...T.value]})}}}if(((It=_.value)==null?void 0:It.id)===1&&a.value&&(lt=d==null?void 0:d.view)!=null&<.filterMultiple&&d.view.filterMultiple.category){const St=V.value.findIndex(Lt=>Lt.type==="select-simple"&&Lt.label==="Tipo de análisis");if(St!==-1){const Lt=d.view.filterMultiple.category;T.value[0]=Lt,d.view.componentProps&&Lt&&(d.view.componentProps.type=Lt),(((et=V.value[St])==null?void 0:et.options)||[]).find(nt=>nt.value==Lt),t.nextTick(()=>{T.value=[...T.value]})}}if(((ct=_.value)==null?void 0:ct.id)===6&&a.value&&(mt=d==null?void 0:d.view)!=null&&mt.filterMultiple&&d.view.filterMultiple.gameNumber){const St=V.value.findIndex(Lt=>Lt.type==="select-simple"&&Lt.label==="Número de juego");if(St!==-1){const Lt=d.view.filterMultiple.gameNumber;T.value[0]=Lt,d.view.componentProps&&Lt&&(d.view.componentProps.gameNumber=Lt),(((Ut=V.value[St])==null?void 0:Ut.options)||[]).find(nt=>nt.value==Lt),t.nextTick(()=>{T.value=[...T.value]})}}if(((Nt=_.value)==null?void 0:Nt.id)===7&&a.value&&d!=null&&d.view){if((it=d.view.componentProps)!=null&&it.analysisType&&V.value.length>0&&((dt=V.value[0])==null?void 0:dt.type)==="radio-button"){const St=d.view.componentProps.analysisType==="offensive"?1:2;T.value[0]=St}if(((Ze=d.view.filterMultiple)==null?void 0:Ze.isHomeTeam)!==void 0){const St=V.value.findIndex(Lt=>Lt.type==="radio-button"&&Lt.label==="Equipo");if(St!==-1){const Lt=d.view.filterMultiple.isHomeTeam?1:2;T.value[1]=Lt}else if(V.value.length>1&&((pt=V.value[1])==null?void 0:pt.type)==="radio-button"){const Lt=d.view.filterMultiple.isHomeTeam,nt=Lt?1:2;T.value[1]=nt,d.view.componentProps&&(d.view.componentProps.isHomeTeamForAnalysis=Lt),(((kt=V.value[1])==null?void 0:kt.options)||[]).find(rt=>rt.value==nt),t.nextTick(()=>{T.value=[...T.value]})}if(St!==-1&&d.view.componentProps){const Lt=d.view.filterMultiple.isHomeTeam,nt=Lt?1:2;d.view.componentProps.isHomeTeamForAnalysis=Lt,(((vt=V.value[St])==null?void 0:vt.options)||[]).find(rt=>rt.value==nt),t.nextTick(()=>{T.value=[...T.value]})}}}t.nextTick(()=>{p.value=!1})}},100)})}function xe(){var ye,ze,Me,je,He,$e,ut,xt,_t,Rt;return{mainSelector:{id:((ye=u.value)==null?void 0:ye.id)||null,name:((ze=u.value)==null?void 0:ze.name)||null,url:((Me=u.value)==null?void 0:Me.url)||null},viewSelector:{id:((je=_.value)==null?void 0:je.id)||null,name:((He=_.value)==null?void 0:He.name)||(($e=_.value)==null?void 0:$e.title)||null,url:((ut=_.value)==null?void 0:ut.url)||null},team:P.value,dynamicFilters:((xt=V.value)==null?void 0:xt.map((Xt,It)=>{var lt,et;const ct=T.value[It];return{filterId:Xt.id||`filter_${It}`,filterType:Xt.type,filterLabel:Xt.label,filterIcon:Xt.icon||null,selectedValue:ct,selectedOptions:Xt.type==="select"&&Array.isArray(ct)&&ct.length>0?ct.map(mt=>{var Ut;const Nt=(Ut=Xt.options)==null?void 0:Ut.find(it=>it.value===mt);return{value:mt,label:(Nt==null?void 0:Nt.label)||mt,icon:(Nt==null?void 0:Nt.icon)||null}}):null,selectedOption:Xt.type==="radio-button"&&ct?{value:ct,label:((et=(lt=Xt.options)==null?void 0:lt.find(mt=>mt.value===ct))==null?void 0:et.label)||ct}:null,isChecked:Xt.type==="check"?ct:null}}))||[],timestamp:new Date().toISOString(),summary:{mainSelected:!!u.value,viewSelected:!!_.value,totalDynamicFilters:((_t=V.value)==null?void 0:_t.length)||0,activeFilters:((Rt=V.value)==null?void 0:Rt.filter((Xt,It)=>{const lt=T.value[It];return Array.isArray(lt)?lt.length>0:lt!=null&<!==!1}).length)||0}}}r({getCurrentFiltersJSON:xe});function be(){de(),R("close",i)}function _e(){S.value=!1,be()}function qe(){x.value&&(Un.emit("filters-cancelled",i),x.value=!1),S.value=!1,be()}t.onMounted(async()=>{document.addEventListener("click",ce),t.nextTick(()=>{Ce()});const ye="https://fb78a14uud.execute-api.us-east-2.amazonaws.com/qa/views";try{const ze=await(await fetch(ye,{headers:{Authorization:`${b.token}`}})).json();c.value=ze.data||[],y.value.clear(),c.value&&(y.value=c.value.reduce((Me,je)=>(je.views&&Array.isArray(je.views)&&je.views.forEach(He=>{He.filters&&Array.isArray(He.filters)&&Me.set(He.id,He)}),Me),new Map))}catch(ze){console.error("Error al obtener datos:",ze)}});function Ce(){document.querySelectorAll(".field-menu .option-card").forEach(ye=>{const ze=ye.querySelector(".option-img");if(!ze||!ze.dataset.hoverSrc)return;const Me=ze.src,je=ze.dataset.hoverSrc;ye.addEventListener("mouseenter",()=>{ze.src=je}),ye.addEventListener("mouseleave",()=>{ze.src=Me})})}t.onUnmounted(()=>{document.removeEventListener("click",ce)}),Un.on("set-filter-and-views-container",ye=>{i=ye,ye&&ue(ye)}),Un.on("view-added",()=>{S.value=!0,x.value=!0}),Un.on("component-added-to-container",ye=>{(!a.value||i&&ye.id===i.id)&&ue(ye)}),Un.on("edit-view",ye=>{var ze,Me,je,He,$e,ut,xt,_t,Rt,Xt,It,lt,et,ct,mt,Ut,Nt,it,dt,Ze,pt;console.log("on edit-view event received for view:",ye),d=ye,i=((ze=ye.view)==null?void 0:ze.filterAndViewsContainer)||null,l=null;const kt=[(je=(Me=ye.view)==null?void 0:Me.coreView)==null?void 0:je.filtersJSON,(He=ye.view)==null?void 0:He.filtersJSON,($e=ye.coreView)==null?void 0:$e.filtersJSON,ye.filtersJSON,(xt=(ut=ye.view)==null?void 0:ut.componentProps)==null?void 0:xt.filtersJSON];for(const vt of kt)if(vt){l=vt;break}if(i&&(i.viewId===4||i.viewId===8||i.viewId===3||i.viewId===1||i.viewId===2||i.viewId===13)&&(_t=ye.view)!=null&&_t.id){const vt=i.getComponentDynamicFilters(ye.view.id);if(vt){let St="Unknown";i.viewId===4?St="Timeline":i.viewId===8?St="FieldPosesion":i.viewId===3?St="GSCMatchSummary":i.viewId===1?St="GSCComparativeReports":i.viewId===2?St="GscTopPlayer":i.viewId===13&&(St="GSCTimelapseTable"),l&&(i.viewId===13?l={...l,dynamicFilters:vt}:l={...l,dynamicFilters:vt.map((Lt,nt)=>Array.isArray(Lt)?{selectedValue:Lt,selectedOptions:Lt.map(rt=>({value:rt,label:rt}))}:typeof Lt=="boolean"?{isChecked:Lt}:St==="GSCComparativeReports"&&nt===0?{selectedValue:Lt,selectedOptions:[{value:Lt,label:Lt}]}:St==="GscTopPlayer"&&nt===0?{selectedValue:Lt,selectedOptions:[{value:Lt,label:Lt}]}:St==="GscTopPlayer"&&nt===1?{selectedOption:{value:Lt,label:Lt}}:{selectedOption:{value:Lt,label:Lt}})})}}if(i&&i.viewId===2&&(Rt=ye.view)!=null&&Rt.filterMultiple){if(ye.view.filterMultiple.categoryId&&l){const vt=l.dynamicFilters.findIndex(St=>St.filterType==="select-simple"&&St.filterLabel==="Tipo de análisis");vt!==-1&&(l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:ye.view.filterMultiple.categoryId,selectedOptions:[{value:ye.view.filterMultiple.categoryId,label:`Category ${ye.view.filterMultiple.categoryId}`}]})}if(ye.view.filterMultiple.teamType!==void 0&&l){const vt=l.dynamicFilters.findIndex(St=>St.filterType==="radio-button");if(vt!==-1){const St=ye.view.filterMultiple.teamType,Lt=St===1?"Mi equipo":St===2?"Rival":St===3?"Ambos":"Equipo";l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:St,label:Lt}}}}}if(i&&i.viewId===1&&(Xt=ye.view)!=null&&Xt.filterMultiple&&ye.view.filterMultiple.category&&l){const vt=l.dynamicFilters.findIndex(St=>St.filterType==="select-simple"&&St.filterLabel==="Tipo de análisis");vt!==-1&&(l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:ye.view.filterMultiple.category,selectedOptions:[{value:ye.view.filterMultiple.category,label:ye.view.filterMultiple.category}]})}if(i&&i.viewId===9&&(It=ye.view)!=null&&It.filterMultiple){if(ye.view.filterMultiple.categoryIds&&l){const vt=l.dynamicFilters.findIndex(St=>St.filterType==="select"&&St.filterLabel==="Tipo de análisis");if(vt!==-1){const St=Array.isArray(ye.view.filterMultiple.categoryIds)?ye.view.filterMultiple.categoryIds:[ye.view.filterMultiple.categoryIds];l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:St,selectedOptions:St.map(rt=>({value:rt,label:`Category ${rt}`}))};const Lt=ye.view.filterMultiple.categoryIds;Te(Lt,St);const nt=(((lt=V.value[vt])==null?void 0:lt.options)||[]).filter(rt=>Array.isArray(rt.value)?Te(rt.value,St):St.includes(rt.value));if(nt.length>0){const rt=nt[0];l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:rt.value,selectedOptions:[rt]}}}}if(ye.view.filterMultiple.isHomeTeam!==void 0&&l){const vt=l.dynamicFilters.findIndex(St=>St.filterType==="radio-button");if(vt!==-1){const St=ye.view.filterMultiple.isHomeTeam;let Lt,nt;typeof St=="boolean"?(Lt=St?1:2,nt=St?"Mi equipo":"Rival"):typeof St=="number"?(Lt=St===1?1:2,nt=St===1?"Mi equipo":"Rival"):(Lt=1,nt="Mi equipo"),l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Lt,label:nt}}}}}if(i&&i.viewId===6&&(et=ye.view)!=null&&et.filterMultiple&&ye.view.filterMultiple.gameNumber&&l){const vt=l.dynamicFilters.findIndex(St=>St.filterType==="select-simple"&&St.filterLabel==="Número de juego");vt!==-1&&(l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:ye.view.filterMultiple.gameNumber,selectedOptions:[{value:ye.view.filterMultiple.gameNumber,label:`Juego ${ye.view.filterMultiple.gameNumber}`}]})}if(i&&i.viewId===7&&ye.view&&l){if((ct=ye.view.componentProps)!=null&&ct.analysisType){const vt=l.dynamicFilters.findIndex((St,Lt)=>St.filterType==="radio-button"&&Lt===0);if(vt!==-1){const St=ye.view.componentProps.analysisType,Lt=St==="offensive"?1:2,nt=St==="offensive"?"A favor":"En contra";l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Lt,label:nt}}}}if(((mt=ye.view.filterMultiple)==null?void 0:mt.isHomeTeam)!==void 0){const vt=l.dynamicFilters.findIndex(St=>St.filterType==="radio-button"&&St.filterLabel==="Equipo");if(vt!==-1){const St=ye.view.filterMultiple.isHomeTeam,Lt=St?1:2,nt=St?"Equipo propio":"Equipo rival";l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Lt,label:nt}}}}}if(i&&i.viewId===10&&(Ut=ye.view)!=null&&Ut.filterMultiple&&((it=(Nt=d==null?void 0:d.view)==null?void 0:Nt.coreView)==null?void 0:it.id)===10){const vt=ye.view.componentProps.isHomeTeamForAnalysis?{label:"Equipo propio",value:1}:{label:"Rival",value:2};l&&(l.dynamicFilters[0]={...l.dynamicFilters[0],selectedOption:vt})}if(i&&i.viewId===15&&(dt=ye.view)!=null&&dt.id){const vt=i.getComponentDynamicFilters(ye.view.id);if(vt&&l)l={...l,dynamicFilters:vt.map((St,Lt)=>{var nt,rt;if(Lt===0){let wt=St;if(St===3&&((rt=(nt=ye.view)==null?void 0:nt.filterMultiple)==null?void 0:rt.isHomeTeam)!==void 0){const Mt=ye.view.filterMultiple.isHomeTeam;typeof Mt=="boolean"?wt=Mt?1:2:typeof Mt=="number"&&(wt=Mt===1?1:2)}return{selectedOption:{value:wt,label:wt===1?"Mi equipo":"Rival"}}}else if(Lt===1)return{selectedValue:St,selectedOptions:[{value:St,label:`${St} fortalezas`}]};return typeof St=="number"?{selectedValue:St}:{selectedOption:{value:St,label:String(St)}}})};else if((Ze=ye.view)!=null&&Ze.filterMultiple&&l&&ye.view.filterMultiple.isHomeTeam!==void 0){const St=l.dynamicFilters.findIndex(Lt=>Lt.filterType==="radio-button"&&Lt.filterLabel==="Mi equipo");if(St!==-1){const Lt=ye.view.filterMultiple.isHomeTeam;let nt,rt;typeof Lt=="boolean"?(nt=Lt?1:2,rt=Lt?"Local":"Visitante"):typeof Lt=="number"?(nt=Lt===1?1:2,rt=Lt===1?"Local":"Visitante"):(nt=1,rt="Local"),l.dynamicFilters[St]={...l.dynamicFilters[St],selectedOption:{value:nt,label:rt}}}}}if(i&&i.viewId===5&&(pt=ye.view)!=null&&pt.filterMultiple&&ye.view.filterMultiple.isHomeTeam!==void 0&&l){const vt=l.dynamicFilters.findIndex(St=>St.filterType==="radio-button"&&St.filterLabel==="Equipo");if(vt!==-1){const St=ye.view.filterMultiple.isHomeTeam;let Lt,nt;typeof St=="boolean"?(Lt=St?1:2,nt=St?"Equipo propio":"Equipo rival"):typeof St=="number"?(Lt=St===1?1:2,nt=St===1?"Equipo propio":"Equipo rival"):(Lt=1,nt="Equipo propio"),l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Lt,label:nt}}}else{const St=l.dynamicFilters.findIndex(Lt=>Lt.filterType==="radio-button");if(St!==-1){const Lt=ye.view.filterMultiple.isHomeTeam;let nt,rt;typeof Lt=="boolean"?(nt=Lt?1:2,rt=Lt?"Equipo propio":"Equipo rival"):typeof Lt=="number"?(nt=Lt===1?1:2,rt=Lt===1?"Equipo propio":"Equipo rival"):(nt=1,rt="Equipo propio"),l.dynamicFilters[St]={...l.dynamicFilters[St],selectedOption:{value:nt,label:rt}}}}}l&&ge(l),S.value=!0});function Ee(){A.value=null}function Re(ye,ze){var Me;(Me=_.value)==null||Me.id}function Te(ye,ze){if(!Array.isArray(ye)||!Array.isArray(ze)||ye.length!==ze.length)return!1;const Me=[...ye].sort((He,$e)=>He-$e),je=[...ze].sort((He,$e)=>He-$e);return JSON.stringify(Me)===JSON.stringify(je)}function Pe(){if(a.value&&l&&l.dynamicFilters){if(o.value||v.value)return;o.value=!0,p.value=!0,l.dynamicFilters.forEach((ye,ze)=>{var Me;if(ye&&(Me=V.value)!=null&&Me[ze]){const je=V.value[ze];if(je.type==="check"&&ye.isChecked!==void 0)T.value[ze]=ye.isChecked;else if(je.type==="select"&&ye.selectedOptions){const He=ye.selectedOptions.map($e=>$e.value);T.value[ze]=He}else je.type==="select"&&ye.selectedValue&&Array.isArray(ye.selectedValue)&&(T.value[ze]=ye.selectedValue)}}),t.nextTick(()=>{p.value=!1,o.value=!1})}}function Ne(){var ye;if(a.value&&l&&l.dynamicFilters&&((ye=_.value)==null?void 0:ye.id)===4){if(o.value||v.value)return;o.value=!0,p.value=!0,l.dynamicFilters.forEach((ze,Me)=>{var je,He;if(ze&&((He=(je=V.value)==null?void 0:je[Me])==null?void 0:He.type)==="select"){if(ze.selectedOptions){const $e=ze.selectedOptions.map(ut=>ut.value);T.value[Me]=$e}else if(ze.selectedValue&&Array.isArray(ze.selectedValue))if(ze.selectedValue.length>0&&ze.selectedValue[0]&&typeof ze.selectedValue[0]=="object"){const $e=Fe(ze.selectedValue);T.value[Me]=$e}else T.value[Me]=ze.selectedValue}}),setTimeout(()=>{var ze;if(T.value=[...T.value],(ze=d==null?void 0:d.view)!=null&&ze.componentProps&&T.value&&T.value.length>0){const Me=T.value[0];if(Array.isArray(Me)&&Me.length>0){const je=Me.some(xt=>xt.event_type_id===1||typeof xt=="string"&&xt.includes("1")),He=Me.some(xt=>xt.category_id===8||typeof xt=="string"&&xt.includes("8")),$e=Me.some(xt=>xt.category_id===9||typeof xt=="string"&&xt.includes("9")),ut=Me.some(xt=>xt.event_type_id===3||typeof xt=="string"&&xt.includes("3"));d.view.componentProps.selectedEvents=Me,d.view.componentProps.goals=je,d.view.componentProps.yellowCards=He,d.view.componentProps.redCards=$e,d.view.componentProps.substitutions=ut,d.view.componentProps.key=Me.length>0,d.view.componentProps._updateKey=Date.now(),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps})}}},200),t.nextTick(()=>{p.value=!1,o.value=!1})}}function Fe(ye){return!Array.isArray(ye)||ye.length===0?[]:ye.map(ze=>{if(ze&&typeof ze=="object"){if(ze.event_type_id!==void 0||ze.category_id!==void 0)return{event_type_id:ze.event_type_id,category_id:ze.category_id,...ze.name&&{name:ze.name},...ze.label&&{label:ze.label}};if(ze.value&&typeof ze.value=="object")return{event_type_id:ze.value.event_type_id,category_id:ze.value.category_id,...ze.value.name&&{name:ze.value.name},...ze.value.label&&{label:ze.value.label}};if(typeof ze=="string"&&ze.includes("-")){const[Me,je]=ze.split("-");return{category_id:parseInt(Me),event_type_id:parseInt(je)}}}if(typeof ze=="string")if(ze.includes("-")){const[Me,je]=ze.split("-");return{category_id:parseInt(Me),event_type_id:parseInt(je)}}else{const Me=parseInt(ze);if(!isNaN(Me))return{event_type_id:Me}}return ze})}function Ue(){var ye,ze,Me,je,He,$e,ut,xt,_t,Rt,Xt,It,lt,et;if(a.value&&l&&l.dynamicFilters&&V.value){if(o.value||v.value)return;if(o.value=!0,p.value=!0,l.dynamicFilters.forEach((ct,mt)=>{var Ut,Nt,it,dt,Ze,pt,kt,vt,St,Lt,nt;if(ct&&((Ut=V.value[mt])==null?void 0:Ut.type)==="select"){if(ct.selectedOptions){const rt=ct.selectedOptions.map(wt=>wt.value);T.value[mt]=rt}else if(ct.selectedValue&&Array.isArray(ct.selectedValue))if(ct.selectedValue.length>0&&ct.selectedValue[0]&&typeof ct.selectedValue[0]=="object"){const rt=Fe(ct.selectedValue);T.value[mt]=rt}else T.value[mt]=ct.selectedValue}else if(ct&&((Nt=V.value[mt])==null?void 0:Nt.type)==="select-simple"&&ct.selectedValue!==void 0){let rt;((it=_.value)==null?void 0:it.id)===2&&(Ze=(dt=d==null?void 0:d.view)==null?void 0:dt.filterMultiple)!=null&&Ze.categoryId?rt=d.view.filterMultiple.categoryId:((pt=_.value)==null?void 0:pt.id)===1&&(vt=(kt=d==null?void 0:d.view)==null?void 0:kt.filterMultiple)!=null&&vt.category?rt=d.view.filterMultiple.category:((St=_.value)==null?void 0:St.id)===6&&(nt=(Lt=d==null?void 0:d.view)==null?void 0:Lt.filterMultiple)!=null&&nt.gameNumber?rt=d.view.filterMultiple.gameNumber:rt=Array.isArray(ct.selectedValue)?ct.selectedValue[0]:ct.selectedValue,T.value[mt]=rt}}),((ye=_.value)==null?void 0:ye.id)===4&&setTimeout(()=>{var ct;if(T.value=[...T.value],(ct=d==null?void 0:d.view)!=null&&ct.componentProps&&T.value&&T.value.length>0){const mt=T.value[0];if(Array.isArray(mt)&&mt.length>0){const Ut=mt.some(Ze=>Ze.event_type_id===1||typeof Ze=="string"&&Ze.includes("1")),Nt=mt.some(Ze=>Ze.category_id===8||typeof Ze=="string"&&Ze.includes("8")),it=mt.some(Ze=>Ze.category_id===9||typeof Ze=="string"&&Ze.includes("9")),dt=mt.some(Ze=>Ze.event_type_id===3||typeof Ze=="string"&&Ze.includes("3"));d.view.componentProps.selectedEvents=mt,d.view.componentProps.goals=Ut,d.view.componentProps.yellowCards=Nt,d.view.componentProps.redCards=it,d.view.componentProps.substitutions=dt,d.view.componentProps.key=mt.length>0,d.view.componentProps._updateKey=Date.now(),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps})}}},100),((ze=_.value)==null?void 0:ze.id)===2&&(Me=d==null?void 0:d.view)!=null&&Me.filterMultiple){if(d.view.filterMultiple.categoryId){const ct=V.value.findIndex(mt=>mt.type==="select-simple"&&mt.label==="Tipo de análisis");if(ct!==-1){const mt=d.view.filterMultiple.categoryId;if(T.value[0]=mt,d.view.componentProps&&mt){let Ut=`Category ${mt}`,Nt=null;try{Nt=Jh(mt),Nt&&(Ut=Nt.name)}catch{const it=V.value.findIndex(dt=>dt.type==="select-simple"&&dt.label==="Tipo de análisis");if(it!==-1){const dt=(((je=V.value[it])==null?void 0:je.options)||[]).find(Ze=>Ze.value==mt);dt&&(Ut=dt.label)}}d.view.componentProps.categoryView=[{id:mt,name:Ut}]}(((He=V.value[ct])==null?void 0:He.options)||[]).find(Ut=>Ut.value==mt),t.nextTick(()=>{T.value=[...T.value]})}}if(d.view.filterMultiple.teamType!==void 0){const ct=V.value.findIndex(mt=>mt.type==="radio-button");if(ct!==-1){const mt=d.view.filterMultiple.teamType;T.value[ct]=mt,((($e=V.value[ct])==null?void 0:$e.options)||[]).find(Ut=>Ut.value==mt),t.nextTick(()=>{T.value=[...T.value]})}}}if(((ut=_.value)==null?void 0:ut.id)===1&&(xt=d==null?void 0:d.view)!=null&&xt.filterMultiple&&d.view.filterMultiple.category&&V.value.findIndex(ct=>ct.type==="select-simple"&&ct.label==="Tipo de análisis")!==-1){const ct=d.view.filterMultiple.category;T.value[0]=ct,d.view.componentProps&&ct&&(d.view.componentProps.type=ct),t.nextTick(()=>{T.value=[...T.value]})}if(((_t=_.value)==null?void 0:_t.id)===6&&(Rt=d==null?void 0:d.view)!=null&&Rt.filterMultiple&&d.view.filterMultiple.gameNumber&&V.value.findIndex(ct=>ct.type==="select-simple"&&ct.label==="Número de juego")!==-1){const ct=d.view.filterMultiple.gameNumber;T.value[0]=ct,d.view.componentProps&&ct&&(d.view.componentProps.gameNumber=ct),t.nextTick(()=>{T.value=[...T.value]})}if(((Xt=_.value)==null?void 0:Xt.id)===5&&(It=d==null?void 0:d.view)!=null&&It.filterMultiple&&d.view.filterMultiple.isHomeTeam!==void 0)if(V.value.findIndex(ct=>ct.type==="radio-button"&&ct.label==="Equipo")!==-1){const ct=d.view.filterMultiple.isHomeTeam;let mt;typeof ct=="boolean"?mt=ct?1:2:typeof ct=="number"?mt=ct===1?1:2:mt=1,T.value[0]=mt,d.view.componentProps&&ct!==void 0&&(d.view.componentProps.isHomeTeamForAnalysis=ct===1),t.nextTick(()=>{T.value=[...T.value]})}else{const ct=V.value.findIndex(mt=>mt.type==="radio-button");if(ct!==-1){const mt=d.view.filterMultiple.isHomeTeam;let Ut;typeof mt=="boolean"?Ut=mt?1:2:typeof mt=="number"?Ut=mt===1?1:2:Ut=1,T.value[ct]=Ut,d.view.componentProps&&mt!==void 0&&(d.view.componentProps.preMatchType=mt),t.nextTick(()=>{T.value=[...T.value]})}}if(((lt=_.value)==null?void 0:lt.id)===15&&(et=d==null?void 0:d.view)!=null&&et.filterMultiple&&d.view.filterMultiple.isHomeTeam!==void 0){const ct=V.value.findIndex(mt=>mt.type==="radio-button");if(ct!==-1){const mt=d.view.filterMultiple.isHomeTeam;console.log("Strengths forceRadioFilterUpdate - isHomeTeam:",mt,"type:",typeof mt);let Ut;typeof mt=="boolean"?Ut=mt?1:2:typeof mt=="number"?Ut=mt===1?1:2:Ut=1,console.log("Strengths forceRadioFilterUpdate - teamValue calculado:",Ut,"teamFilterIndex:",ct),T.value[ct]=Ut,d.view.componentProps&&mt!==void 0&&(d.view.componentProps.preMatchType=Ut),t.nextTick(()=>{T.value=[...T.value],console.log("Strengths forceRadioFilterUpdate - dynamicFilters.value después:",T.value)})}else{const mt=V.value.findIndex(Ut=>Ut.type==="radio-button");if(mt!==-1){const Ut=d.view.filterMultiple.isHomeTeam;let Nt;typeof Ut=="boolean"?Nt=Ut?1:2:typeof Ut=="number"?Nt=Ut===1?1:2:Nt=1,T.value[mt]=Nt,d.view.componentProps&&Ut!==void 0&&(d.view.componentProps.preMatchType=Nt),t.nextTick(()=>{T.value=[...T.value]})}}}t.nextTick(()=>{p.value=!1,o.value=!1})}}function me(){if(!o.value&&a.value&&l&&l.dynamicFilters&&V.value){if(v.value)return;o.value=!0,p.value=!0,l.dynamicFilters.forEach((ye,ze)=>{var Me;if(ye&&((Me=V.value[ze])==null?void 0:Me.type)==="radio-button"&&ye.selectedOption&&ye.selectedOption.value!==void 0){const je=ye.selectedOption.value;T.value[ze]=je}}),t.nextTick(()=>{p.value=!1,o.value=!1})}}function Le(){var ye,ze,Me,je,He,$e,ut,xt,_t,Rt,Xt,It,lt,et,ct,mt,Ut,Nt,it,dt,Ze,pt,kt,vt,St,Lt,nt,rt,wt,Mt,Ft,Ct,Ht;if(i&&a.value&&d){if(v.value)return;if(p.value=!0,((ye=_.value)==null?void 0:ye.id)===4){if(i.setDynamicFilters(T.value,(ze=d.view)==null?void 0:ze.id),i.updateDynamicFilters(T.value,(Me=d.view)==null?void 0:Me.id),d.view.componentProps&&T.value&&T.value.length>0){const Kt=T.value[0];if(Array.isArray(Kt)&&Kt.length>0){const Yt=Kt.some(sr=>sr.event_type_id===1||typeof sr=="string"&&sr.includes("1")),Gt=Kt.some(sr=>sr.category_id===8||typeof sr=="string"&&sr.includes("8")),Jt=Kt.some(sr=>sr.category_id===9||typeof sr=="string"&&sr.includes("9")),or=Kt.some(sr=>sr.event_type_id===3||typeof sr=="string"&&sr.includes("3"));d.view.componentProps.selectedEvents=Kt,d.view.componentProps.goals=Yt,d.view.componentProps.yellowCards=Gt,d.view.componentProps.redCards=Jt,d.view.componentProps.substitutions=or,d.view.componentProps.key=Kt.length>0,d.view.componentProps._updateKey=Date.now(),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps})}}}else if(((je=_.value)==null?void 0:je.id)===8)i.setDynamicFilters(T.value,(He=d.view)==null?void 0:He.id),i.updateDynamicFilters(T.value,($e=d.view)==null?void 0:$e.id);else if(((ut=_.value)==null?void 0:ut.id)===3)i.setDynamicFilters(T.value,(xt=d.view)==null?void 0:xt.id),i.updateDynamicFilters(T.value,(_t=d.view)==null?void 0:_t.id);else if(((Rt=_.value)==null?void 0:Rt.id)===13){const Kt=(Xt=d.view)==null?void 0:Xt.id;i.setDynamicFilters(T.value,Kt),i.updateDynamicFilters(T.value,Kt),d.view.componentProps&&(d.view.componentProps._updateKey=Date.now(),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps}))}else if(((It=_.value)==null?void 0:It.id)===15){const Kt=(lt=d.view)==null?void 0:lt.id;if(i.setDynamicFilters(T.value,Kt),i.updateDynamicFilters(T.value,Kt),d.view.componentProps){const Yt=Array.isArray(T.value)&&T.value[3]!==void 0?T.value[3]:null;Yt!==null&&(d.view.componentProps.numitems=Yt),d.view.componentProps._updateKey=Date.now(),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps})}}else if(((et=_.value)==null?void 0:et.id)===2){i.setDynamicFilters(T.value,(ct=d.view)==null?void 0:ct.id),i.updateDynamicFilters(T.value,(mt=d.view)==null?void 0:mt.id);const Kt=T.value[0];if(Kt!==void 0&&(d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.categoryId,d.view.filterMultiple.categoryId=Kt,d.view.componentProps)){let Gt=`Category ${Kt}`,Jt=null;try{Jt=Jh(Kt),Jt&&(Gt=Jt.name)}catch{const or=V.value.findIndex(sr=>sr.type==="select-simple"&&sr.label==="Tipo de análisis");if(or!==-1){const sr=(((Ut=V.value[or])==null?void 0:Ut.options)||[]).find(qr=>qr.value==Kt);sr&&(Gt=sr.label)}}d.view.componentProps.categoryView=[{id:Kt,name:Gt}],Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple})}const Yt=T.value[1];Yt!==void 0&&(d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.teamType,d.view.filterMultiple.teamType=Yt,d.view.componentProps&&d.view.componentProps.game&&(Yt===1?d.view.componentProps.teamView=d.view.componentProps.game.homeTeam.team_id:Yt===2?d.view.componentProps.teamView=d.view.componentProps.game.awayTeam.team_id:d.view.componentProps.teamView=0),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}))}else if(((Nt=_.value)==null?void 0:Nt.id)===1){i.setDynamicFilters(T.value,(it=d.view)==null?void 0:it.id),i.updateDynamicFilters(T.value,(dt=d.view)==null?void 0:dt.id);const Kt=T.value[0];Kt!==void 0&&(d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.category,d.view.filterMultiple.category=Kt,d.view.componentProps&&(d.view.componentProps.type=Kt),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}))}else if(((Ze=_.value)==null?void 0:Ze.id)===6){i.setDynamicFilters(T.value,(pt=d.view)==null?void 0:pt.id),i.updateDynamicFilters(T.value,(kt=d.view)==null?void 0:kt.id);const Kt=T.value[0];Kt!==void 0&&(d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.gameNumber,d.view.filterMultiple.gameNumber=Kt,d.view.componentProps&&(d.view.componentProps.gameNumber=Kt,d.view._updateKey,d.view._updateKey=Date.now()),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}),Un.emit("dynamic-filters-changed",{containerViewId:(vt=_.value)==null?void 0:vt.id,viewId:d.view.id,dynamicFilters:T.value}),Un.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:T.value}),t.nextTick(()=>{d.view.componentProps&&(d.view.componentProps={...d.view.componentProps})}))}else if(((St=_.value)==null?void 0:St.id)===7){i.setDynamicFilters(T.value,(Lt=d.view)==null?void 0:Lt.id),i.updateDynamicFilters(T.value,(nt=d.view)==null?void 0:nt.id);const Kt=T.value[0],Yt=T.value[1];if(Kt!==void 0&&d.view.componentProps){const Gt=Kt===1?"offensive":"defensive";d.view.componentProps.analysisType=Gt}if(Yt!==void 0){d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.isHomeTeam;const Gt=Yt===1;d.view.filterMultiple.isHomeTeam=Gt,d.view.componentProps&&(d.view.componentProps.isHomeTeamForAnalysis=Gt,d.view._updateKey,d.view._updateKey=Date.now()),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}),Un.emit("dynamic-filters-changed",{containerViewId:(rt=_.value)==null?void 0:rt.id,viewId:d.view.id,dynamicFilters:T.value}),Un.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:T.value}),t.nextTick(()=>{d.view.componentProps&&(d.view.componentProps={...d.view.componentProps})})}}else if(((wt=_.value)==null?void 0:wt.id)===5){i.setDynamicFilters(T.value,(Mt=d.view)==null?void 0:Mt.id),i.updateDynamicFilters(T.value,(Ft=d.view)==null?void 0:Ft.id);const Kt=T.value[0];if(Kt!==void 0){d.view.filterMultiple||(d.view.filterMultiple={}),d.view.filterMultiple.isHomeTeam;const Yt=Kt===1?1:2;d.view.filterMultiple.isHomeTeam=Yt,d.view.componentProps&&(d.view.componentProps.isHomeTeamForAnalysis=Yt===1,d.view._updateKey,d.view._updateKey=Date.now()),Un.emit("force-component-update",{itemId:d.view.id,componentProps:d.view.componentProps,filterMultiple:d.view.filterMultiple}),Un.emit("dynamic-filters-changed",{containerViewId:(Ct=_.value)==null?void 0:Ct.id,viewId:d.view.id,dynamicFilters:T.value}),Un.emit("component-props-updated",{viewId:d.view.id,componentProps:d.view.componentProps,dynamicFilters:T.value}),t.nextTick(()=>{d.view.componentProps&&(d.view.componentProps={...d.view.componentProps})})}}else((Ht=_.value)==null?void 0:Ht.id)===9||(i.setDynamicFilters(T.value),i.updateDynamicFilters(T.value));t.nextTick(()=>{p.value=!1})}}function ke(){var ye,ze;if(!l||!l.dynamicFilters||!V.value)return!1;for(let Me=0;Me<l.dynamicFilters.length;Me++){const je=l.dynamicFilters[Me],He=V.value[Me],$e=T.value[Me];if(!(!je||!He)){if(He.type==="check"){if(je.isChecked!==$e)return!0}else if(He.type==="radio-button"){if(((ye=je.selectedOption)==null?void 0:ye.value)!==$e)return!0}else if(He.type==="select"){const ut=((ze=je.selectedOptions)==null?void 0:ze.map(_t=>_t.value))||je.selectedValue||[],xt=Array.isArray($e)?$e:[];if(JSON.stringify(ut)!==JSON.stringify(xt))return!0}}}return!1}function Xe(ye){var ze,Me,je,He,$e,ut,xt,_t,Rt,Xt,It,lt,et,ct,mt,Ut;if(T.value=ye.filters,i){const Nt=((ze=d==null?void 0:d.view)==null?void 0:ze.id)||null;i.setDynamicFilters(T.value,Nt),i.updateDynamicFilters(T.value,Nt)}if(a.value&&d&&(Un.emit("activate-save-button"),Un.emit("force-component-update",{itemId:((Me=d==null?void 0:d.view)==null?void 0:Me.id)||null,componentProps:d.view.componentProps}),Un.emit("dynamic-filters-changed",{containerViewId:((je=d==null?void 0:d.view)==null?void 0:je.id)||null,viewId:((He=d==null?void 0:d.view)==null?void 0:He.id)||null,dynamicFilters:T.value}),Un.emit("dynamic-filters-changed",{containerViewId:(($e=d==null?void 0:d.view)==null?void 0:$e.id)||null,viewId:((ut=d==null?void 0:d.view)==null?void 0:ut.id)||null,dynamicFilters:T.value}),t.nextTick(()=>{d.view.componentProps&&(d.view.componentProps={...d.view.componentProps})})),!a.value&&i&&((xt=_.value)==null?void 0:xt.id)===15&&i.getRequiresAddView(T.value)){i.setDynamicFilters(T.value),R("filters-changed",{main:u.value,view:_.value,team:P.value,dynamicFilters:T.value,filtersJSON:{mainSelector:{id:((_t=u.value)==null?void 0:_t.id)||null,name:((Rt=u.value)==null?void 0:Rt.name)||null,url:((Xt=u.value)==null?void 0:Xt.url)||null},viewSelector:{id:((It=_.value)==null?void 0:It.id)||null,name:((lt=_.value)==null?void 0:lt.name)||((et=_.value)==null?void 0:et.title)||null,url:((ct=_.value)==null?void 0:ct.url)||null},team:P.value,dynamicFilters:T.value,timestamp:new Date().toISOString(),summary:{mainSelected:!!u.value,viewSelected:!!_.value,totalDynamicFilters:((mt=V.value)==null?void 0:mt.length)||0,activeFilters:((Ut=V.value)==null?void 0:Ut.filter((Nt,it)=>{const dt=T.value[it];return Array.isArray(dt)?dt.length>0:dt!=null&&dt!==!1}).length)||0}},filterAndViewsContainer:i,viewToEdit:d}),ne();return}Le()}function Ae(ye){ye.filterIndex!==void 0&&ye.value!==void 0&&(T.value[ye.filterIndex]=ye.value,a.value&&Le(),ne())}function Ie(){qe()}function Je(ye){var ze,Me,je,He,$e,ut,xt;console.log("newFilters in onChangeFiltersAltMode:",ye);const _t={mainSelector:{id:((ze=u.value)==null?void 0:ze.id)||null,name:((Me=u.value)==null?void 0:Me.name)||null,url:((je=u.value)==null?void 0:je.url)||null},viewSelector:{id:((He=_.value)==null?void 0:He.id)||null,name:(($e=_.value)==null?void 0:$e.name)||((ut=_.value)==null?void 0:ut.title)||null,url:((xt=_.value)==null?void 0:xt.url)||null}};R("filters-changed",{filters:ye.filters,view:ye.view,viewToEdit:d,filterAndViewsContainer:i,filtersJSON:_t,isAltMode:!0})}function Qe(ye){return JSON.parse(JSON.stringify(ye))}return(ye,ze)=>(t.openBlock(),t.createElementBlock("div",GLe,[t.createElementVNode("button",JLe,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:G},[t.createElementVNode("div",ZLe,[t.createElementVNode("span",HLe,[u.value?(t.openBlock(),t.createElementBlock("img",{key:0,src:D(u.value.name,!1),alt:"icono",class:"option-img"},null,8,YLe)):(t.openBlock(),t.createElementBlock("img",QLe))]),u.value?(t.openBlock(),t.createElementBlock("span",eOe,t.toDisplayString(Y()),1)):(t.openBlock(),t.createElementBlock("span",$Le,"Tipo de vista")),t.createElementVNode("span",{class:t.normalizeClass([{open:F.value},"arrow"])},[...ze[5]||(ze[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)]),F.value?(t.openBlock(),t.createElementBlock("div",tOe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.value,(Me,je)=>(t.openBlock(),t.createElementBlock("div",{key:Me.id,class:t.normalizeClass([{active:f.value===je},"option-card"]),onClick:t.withModifiers(He=>ee(je),["stop"])},[t.createElementVNode("div",aOe,[t.createElementVNode("img",{"data-hover-src":D(Me.name,!0),src:D(Me.name,!1),alt:"icono",class:"option-img-34"},null,8,nOe)]),t.createElementVNode("div",iOe,[t.createElementVNode("div",oOe,t.toDisplayString(Me.name),1),Me.description?(t.openBlock(),t.createElementBlock("div",sOe,t.toDisplayString(Me.description),1)):t.createCommentVNode("",!0)])],10,rOe))),128))])):t.createCommentVNode("",!0)],2),u.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([{disabled:a.value},"custom-select second-select"]),onClick:te},[t.createElementVNode("div",lOe,[t.createElementVNode("span",cOe,[_.value?(t.openBlock(),t.createElementBlock("img",{key:0,src:_.value.url,alt:"icono",class:"option-img-graph2"},null,8,uOe)):u.value?(t.openBlock(),t.createElementBlock("img",{key:1,src:D(u.value.name,!1),alt:"icono",class:"option-img"},null,8,dOe)):t.createCommentVNode("",!0)]),t.createElementVNode("span",pOe,t.toDisplayString(re()),1),t.createElementVNode("span",{class:t.normalizeClass([{open:W.value},"arrow"])},[...ze[6]||(ze[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)]),W.value&&u.value?(t.openBlock(),t.createElementBlock("div",hOe,[t.createElementVNode("div",fOe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.value,Me=>(t.openBlock(),t.createElementBlock("div",{key:Me.id,class:t.normalizeClass([{active:w.value===Me.id},"option-card-grid"]),onClick:t.withModifiers(je=>H(Me),["stop"])},[t.createElementVNode("div",yOe,t.toDisplayString(Me.name||Me.title),1),t.createElementVNode("div",gOe,[t.createElementVNode("img",{src:Me.url,alt:"icono",class:"option-img-grid"},null,8,vOe)])],10,mOe))),128))])])):t.createCommentVNode("",!0)],2)):t.createCommentVNode("",!0),_.value?(t.openBlock(),t.createElementBlock("div",bOe)):t.createCommentVNode("",!0),_.value&&_.value.id===13?(t.openBlock(),t.createBlock(dke,{key:2,"component-id":13,filters:V.value,"initial-values":a.value?t.unref(l).dynamicFilters:T.value,"is-edit-mode":a.value,onFiltersChanged:Xe,onFilterUpdated:Ae},null,8,["filters","initial-values","is-edit-mode"])):_.value&&_.value.id===16?(t.openBlock(),t.createBlock(SNe,{key:3,"default-filters":t.unref(d)?t.unref(d).view.filterMultiple:null,"is-edit-mode":!!t.unref(d),"is-post-match":e.isPostMatch,"view-config":Qe(y.value.get(16)),onChange:Je,onRemoveViews:Ie},null,8,["default-filters","is-edit-mode","is-post-match","view-config"])):_.value&&_.value.id===18?(t.openBlock(),t.createBlock(LVe,{key:4,"default-filters":t.unref(d)?t.unref(d).view.filterMultiple:null,"view-config":Qe(y.value.get(18)),onChange:Je,onRemoveViews:Ie},null,8,["default-filters","view-config"])):_.value&&_.value.id===15?(t.openBlock(),t.createBlock(Oke,{key:5,"component-id":15,filters:V.value,"initial-values":a.value?t.unref(l).dynamicFilters:T.value,"is-edit-mode":a.value,onFiltersChanged:Xe,onFilterUpdated:Ae},null,8,["filters","initial-values","is-edit-mode"])):_.value&&_.value.id===17?(t.openBlock(),t.createBlock(BLe,{key:6,"component-id":17,"default-filters":t.unref(d)?t.unref(d).view.filterMultiple:null,filters:V.value,"initial-values":a.value?t.unref(l).dynamicFilters:T.value,"is-edit-mode":a.value,"view-config":Qe(y.value.get(17)),onChange:Je,onFiltersChanged:Xe,onFilterUpdated:Ae,onRemoveViews:Ie},null,8,["default-filters","filters","initial-values","is-edit-mode","view-config"])):_.value&&V.value&&z()?(t.openBlock(),t.createElementBlock("div",{key:7,class:t.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":V.value.length>=2}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(V.value,(Me,je)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:je},[Me.type==="select"?(t.openBlock(),t.createElementBlock("div",{key:0,class:"custom-select dynamic-select filter-inline",onClick:t.withModifiers(He=>$(je),["stop"])},[t.createElementVNode("div",wOe,[ze[8]||(ze[8]=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)),ze[9]||(ze[9]=t.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),Array.isArray(T.value[je])&&T.value[je].length>0?(t.openBlock(),t.createElementBlock("span",_Oe,t.toDisplayString(T.value[je].length),1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass([{open:A.value===je},"arrow"])},[...ze[7]||(ze[7]=[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)]),A.value===je?(t.openBlock(),t.createElementBlock("div",SOe,[t.createElementVNode("div",TOe,[t.createElementVNode("div",{class:"multi-select-header",onClick:ze[1]||(ze[1]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("label",kOe,[t.createElementVNode("input",{checked:U(je),indeterminate:q(je),type:"checkbox",onChange:t.withModifiers(He=>k(je),["stop"]),onClick:ze[0]||(ze[0]=t.withModifiers(()=>{},["stop"]))},null,40,NOe),ze[10]||(ze[10]=t.createElementVNode("span",{class:"select-all-label"},"Agregar todas",-1))])]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Me.options,He=>(t.openBlock(),t.createElementBlock("div",{key:He.value,class:t.normalizeClass([{active:L(je,He.value)},"option-card multi-select-option"]),onClick:ze[2]||(ze[2]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",VOe,[t.createElementVNode("input",{checked:L(je,He.value),type:"checkbox",onChange:t.withModifiers($e=>O(je,He.value),["stop"])},null,40,LOe)]),t.createElementVNode("div",{class:"option-content",onClick:$e=>O(je,He.value)},[t.createElementVNode("div",qOe,t.toDisplayString(He.label),1)],8,OOe)],2))),128))]),t.createElementVNode("div",COe,[t.createElementVNode("button",{class:"btn-listo",onClick:ze[3]||(ze[3]=t.withModifiers(He=>Ee(),["stop"]))},"Listo")])])):t.createCommentVNode("",!0)],8,xOe)):Me.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",UOe,[t.createElementVNode("div",zOe,t.toDisplayString(Me.label),1),t.createElementVNode("div",EOe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Me.options,He=>(t.openBlock(),t.createElementBlock("label",{key:He.value,class:t.normalizeClass([{active:T.value[je]===He.value},"radio-option-card"])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":$e=>T.value[je]=$e,disabled:E(He.value,He.label),name:"dynamic-radio-"+je,value:He.value,type:"radio",onChange:()=>{var $e,ut,xt;if((($e=_.value.value)==null?void 0:$e.id)===9&&a.value.value&&(xt=(ut=t.unref(d))==null?void 0:ut.view)!=null&&xt.filterMultiple){const _t=T.value[je]===1;t.unref(d).view.filterMultiple.isHomeTeam=_t}a.value.value&&Le(),ne()}},null,40,POe),[[t.vModelRadio,T.value[je]]]),t.createElementVNode("span",null,t.toDisplayString(He.label),1)],2))),128))])])):Me.type==="check"?(t.openBlock(),t.createElementBlock("div",ROe,[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":He=>T.value[je]=He,checked:T.value[je],type:"checkbox",onChange:ze[4]||(ze[4]=()=>{a.value.value&&Le(),ne()})},null,40,MOe),[[t.vModelCheckbox,T.value[je]]]),t.createTextVNode(" "+t.toDisplayString(Me.label),1)])])):Me.type==="select-simple"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-filter-type":Me.type,class:"custom-select dynamic-select filter-inline",onClick:t.withModifiers(He=>oe(je),["stop"])},[t.createElementVNode("div",jOe,[ze[12]||(ze[12]=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)),ze[13]||(ze[13]=t.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),t.createElementVNode("span",{class:t.normalizeClass([{open:X.value===je},"arrow"])},[...ze[11]||(ze[11]=[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)]),X.value===je?(t.openBlock(),t.createElementBlock("div",WOe,[t.createElementVNode("div",AOe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Me.options,He=>(t.openBlock(),t.createElementBlock("div",{key:He.value,class:t.normalizeClass([{active:T.value[je]===He.value},"option-card simple-select-option"]),onMouseenter:$e=>Re(je,He.value),onClick:t.withModifiers($e=>se(je,He.value),["stop"])},[t.createElementVNode("div",IOe,[t.createElementVNode("div",XOe,t.toDisplayString(He.label),1)]),T.value[je]===He.value?(t.openBlock(),t.createElementBlock("div",DOe,[...ze[14]||(ze[14]=[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,KOe))),128))])])):t.createCommentVNode("",!0)],8,FOe)):t.createCommentVNode("",!0),je===1&&V.value.length>2?(t.openBlock(),t.createElementBlock("div",BOe)):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:qe},"Cancelar")),S.value?(t.openBlock(),t.createElementBlock("button",{key:9,class:"ok-btn",onClick:_e},"OK")):t.createCommentVNode("",!0)]))}}),JOe=pc(GOe,[["__scopeId","data-v-2d63cff9"]]),ZOe={key:0,class:"modal-simple"},HOe={class:"modal-simple__content"},YOe={class:"modal-simple__content__header"},QOe={class:"modal-simple__content__body"},$Oe={class:"modal-simple__content__footer"},eqe={__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",ZOe,[t.createElementVNode("div",HOe,[t.createElementVNode("div",YOe,[t.renderSlot(r.$slots,"header",{},void 0,!0)]),t.createElementVNode("div",QOe,[t.renderSlot(r.$slots,"body",{},void 0,!0)]),t.createElementVNode("div",$Oe,[t.renderSlot(r.$slots,"footer",{},void 0,!0)])])])):t.createCommentVNode("",!0)]))}},tqe=pc(eqe,[["__scopeId","data-v-1cc4f590"]]),rqe={class:"footer"},aqe={__name:"ModalCautionClose",props:{value:{type:Boolean,default:!1}},emits:["update:modelValue","action"],setup(e,{emit:r}){const n=r;function b(y){n("update:modelValue",y)}function R(y){n("action",y),n("update:modelValue",!1)}return(y,c)=>(t.openBlock(),t.createBlock(tqe,{"modle-value":e.value,"onUpdate:modelValue":b},{header:t.withCtx(()=>[...c[2]||(c[2]=[t.createElementVNode("div",{class:"header"},"Descartar template",-1)])]),body:t.withCtx(()=>[...c[3]||(c[3]=[t.createElementVNode("div",{class:"body"},"¿Estás seguro que deseas abandonar el proceso?",-1)])]),footer:t.withCtx(()=>[t.createElementVNode("div",rqe,[t.createElementVNode("div",{role:"button",class:"btn btn-cancel",onClick:c[0]||(c[0]=i=>R(!1))}," Seguir editando "),t.createElementVNode("div",{role:"button",class:"btn btn-confirm",onClick:c[1]||(c[1]=i=>R(!0))}," Descartar ")])]),_:1},8,["modle-value"]))}},nqe=pc(aqe,[["__scopeId","data-v-ed9b5088"]]),iqe={key:0,class:"modal-simple"},oqe={__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",iqe,[...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})]))}},sqe=pc(oqe,[["__scopeId","data-v-2bc30783"]]),lqe={class:"template-maker__header"},cqe={key:0,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},uqe={class:"template-maker__content"},dqe={class:"template-maker__content__main"},pqe={id:"containerMain",class:"container-main"},hqe={class:"template-maker__content__main__cover-selector"},fqe=["id"],mqe={class:"page-indicator"},yqe={class:"page-indicator__index"},gqe=["onClick"],vqe=["onClick"],bqe={key:0,class:"template-maker__content__main__footer"},xqe={class:"template-maker__content__main__footer__paginator"},wqe={class:"template-maker__content__main__footer__paginator__nav"},_qe={class:"template-maker__content__main__footer__paginator__numbers"},Sqe=["onClick"],Tqe={__name:"GSC-TemplateReportMaker",props:{token:{type:String,default:""},userTeamId:{type:Number,default:0}},emits:["close"],setup(e,{expose:r,emit:n}){const b=new Map,R=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:{}}]}]),y=t.ref(null),c=t.ref(0),i=t.ref(!1),d=t.ref(null),l=t.ref(null),a=t.ref(!0),S=t.ref(!1),x=t.ref(!1),v=t.ref(0),p=t.ref(!1),o=t.ref(null),s=t.ref(new Map),f=t.ref(null),u=t.ref(null),m=t.ref(!1),w=t.ref(!1),_=t.ref(!1),T=new Map,V=t.computed(()=>({"--overflow-y-template-maker":S.value?"scroll":"hidden","--height-container-main":S.value?"fit-content":"calc(100vh - 64px)","--margin-bottom-container-main":(S.value,"0")})),L=t.computed(()=>c.value+1);t.watch(()=>i.value,Te=>{const Pe=document.getElementById("app");Te?(c.value=0,document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",Pe&&(Pe.style.overflow="hidden")):(document.body.style.overflow="",document.documentElement.style.overflow="",Pe&&(Pe.style.overflow=""))});function O(Te){return Te<10?`0${Te}`:Te}async function U({templateId:Te,userId:Pe}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Pe}/templates/${Te}`,{method:"GET",headers:{Authorization:se.token}})).json()).data}catch(Ne){console.error("Error fetching template by ID:",Ne)}}async function q({reportId:Te,userId:Pe}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Pe}/reports/${Te}`,{method:"GET",headers:{Authorization:se.token}})).json()).data}catch(Ne){console.error("Error fetching report by ID:",Ne)}}let z=0;function C(Te){y.value=Te,z>0&&(m.value=!0),z++}function N(Te){Te&&ne(null,!0)}let E=null;function k(Te,Pe){let Ne=Te.getBoundingClientRect(),Fe={height:Te.clientHeight,width:Te.clientWidth},Ue=Pe.getBoundingClientRect();if(!(Ue.top>=Ne.top&&Ue.bottom<=Ne.top+Fe.height)){const me=Ue.top-Ne.top,Le=Ue.bottom-Ne.bottom;Math.abs(me)<Math.abs(Le)?Te.scrollTop+=me:Te.scrollTop+=Le}}function P(Te,Pe){let Ne=Te.getBoundingClientRect();const Fe=Pe.getBoundingClientRect().top-Ne.top;Te.scrollTop+=Fe}function F(Te,Pe=!1){const Ne={title:`Page ${R.value.length+1}`,id:`p-${Date.now()}`,items:[]};if(_e(),Te!==void 0&&Te>=-1?R.value.splice(Te+1,0,Ne):R.value.push(Ne),t.nextTick(()=>{const Fe=R.value.findIndex(me=>me.id===Ne.id),Ue=document.getElementById(`page-${Fe+1}`);E||(E=document.getElementById("containerMain")),Ue&&E?k(E,Ue):console.error("Page element or container main element not found")}),Pe)return Ne;m.value=!0}function W(Te){if(Te<0||Te>R.value.length)return;c.value=Te;const Pe=document.getElementById(`page-${Te}`);if(E||(E=document.getElementById("containerMain")),Pe&&E){const Ne=new CustomEvent("programmatic-scroll-start");document.dispatchEvent(Ne),P(E,Pe),setTimeout(()=>{const Fe=new CustomEvent("programmatic-scroll-end");document.dispatchEvent(Fe)},300)}else console.error("Page element or container main element not found")}function A(Te){f.value=Te,p.value=!0}function X(Te,Pe){const Ne=Pe+1;Te&&c.value!==Ne&&(c.value=Ne)}function D(Te){p.value=!0,Un.emit("edit-view",{view:Te})}async function Y({templateReportId:Te,userId:Pe,isTemplateMode:Ne}){try{return Ne?U({templateId:Te,userId:Pe}):q({reportId:Te,userId:Pe})}catch(Fe){throw new Error("Error fetching template or report by ID: "+Fe.message)}}function re(){z=0,p.value=!1,c.value=0,f.value=null,u.value=null,s.value.clear(),E=null}let G=[];async function te(Te){if(re(),a.value=Te.isTemplateMode,S.value=!!Te.isPDFMode,Te.isPDFMode?d.value=await q({reportId:Te.reportId,userId:Te.userId}):(d.value=Te.template,d.value=await Y({templateReportId:Te.template.id,userId:Te.template.user_id,isTemplateMode:Te.isTemplateMode})),!d.value)return;d.value&&d.value.game&&(d.value.game=he(d.value.game)),l.value=JSON.parse(JSON.stringify(d.value)),x.value=d.value.template_type===2;const Pe=d.value.pages.find(Ne=>Ne.is_front_page);v.value=Pe?Pe.type:1,i.value=!0,console.log("isTemplateMode:",a.value),Te.isTemplateMode||(G=await oe(d.value),console.log("specificPlaysCorners fetched:",G)),R.value=d.value.pages.reduce((Ne,Fe,Ue)=>{if(!Fe.is_front_page){Fe.name||(Fe.name="");const me=Ue,Le={originalPage:JSON.parse(JSON.stringify(Fe)),title:Fe.name,id:`p-${Date.now()-Ue*9}`,items:[],components:Fe.components};Fe.components&&Fe.components.length>0&&(Le.items=Fe.components.map((ke,Xe)=>{const Ae=new p1(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],ke.coreView.id,ke.dynamicFilters,x.value,a.value,ke.filtersJSON||null,se.token,ke.filters),Ie={originalComponent:JSON.parse(JSON.stringify(ke)),title:ke.title,shortTitle:ke.shortTitle||ke.title,game:d.value.game,idAux:ke.id,id:`w-${Date.now()-Xe*7}`,x:ke.column,y:ke.row,w:ke.colspan,h:ke.rowspan,maxWidth:ke.max_column,maxHeight:ke.max_row,minWidth:ke.min_column,minHeight:ke.min_row,noResize:!a.value,noMove:!a.value,coreView:ke.coreView||null,isTemplateMode:a.value,componentName:ke.componentName,componentProps:$({currentProps:ke.componentProps,coreView:ke.coreView,isTemplateMode:a.value,templateToEdit:d.value,filterMultiple:ke.filterMultiple||null,game:d.value.game||null,dynamicFilters:ke.dynamicFilters,page:me,componentId:Xe})||{},filterMultiple:ke.filterMultiple,isHomeTeam:H({game:d.value.game,isTemplateMode:a.value,currentIsHomeTeam:ke.isHomeTeam||ke.componentProps.isHomeTeamForAnalysis}),filtersJSON:ke.filtersJSON||null,dynamicFilters:ke.dynamicFilters||[],filterAndViewsContainer:Ae},Je=t.reactive({view:Ie});return Ae.addView(Je,!0),s.value.set(Ae.getId(),Ae),Ie})),Ne.push(Le)}return Ne},[]),console.log("Pages loaded into template maker:",R.value)}function ee({game:Te,isTemplateMode:Pe}){const Ne=Te&&Te.homeTeam&&Te.awayTeam&&(Te.homeTeam.team_id===se.userTeamId||Te.awayTeam.team_id===se.userTeamId);return{isUserTeamHome:Ne&&Te.homeTeam.team_id===se.userTeamId,requiresUserTeamAdjustment:Ne&&!Pe}}function H({game:Te,isTemplateMode:Pe,currentIsHomeTeam:Ne}){const{isUserTeamHome:Fe,requiresUserTeamAdjustment:Ue}=ee({game:Te,isTemplateMode:Pe});return Ue?Ne?Fe:!Fe:Ne}function $({currentProps:Te,coreView:Pe,templateToEdit:Ne,isTemplateMode:Fe,filterMultiple:Ue,game:me,dynamicFilters:Le,page:ke,componentId:Xe}){if(!Te||!Pe)return Te||{};const{isUserTeamHome:Ae,requiresUserTeamAdjustment:Ie}=ee({game:me,isTemplateMode:Fe});console.log("currentProps:",Te);let Je={...Te};if(Pe.id===5&&(Je.isGhostEffect=Fe,Ie)){const Qe=Je.preMatchType===1;Je.preMatchType=Qe?Ae?1:2:Ae?2:1}if(Pe.id===7&&Ie){const Qe=Je.isHomeTeamForAnalysis;Je.isHomeTeamForAnalysis=Qe?Ae:!Ae}if(Pe.id===9&&Ie){const Qe=Je.isHomeTeamForAnalysis;Je.isHomeTeamForAnalysis=Qe?Ae:!Ae}if(Pe.id===18){if(console.log("1818181818181818181818181818181818181818"),console.log("currentProps:",Te),console.log("coreView:",Pe),console.log("templateToEdit:",Ne),console.log("isTemplateMode:",Fe),console.log("filterMultiple:",Ue),console.log("game:",me),console.log("dynamicFilters:",Le),!Fe&&Ie){const Qe=Je.isHomeTeamForAnalysis;Je.isHomeTeamForAnalysis=Qe?Ae:!Ae}if(!Fe){console.log("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"),console.log("specificPlaysCorners before shift:",G);const Qe=G.shift();console.log("specificPlaysCorner:",Qe),Qe?(Je.specificPlaysCornersData=Qe,Je.teamIdForAnalysis=Je.isHomeTeamForAnalysis?me.home_team:me.visiting_team,Je.playIdForAnalysis=Qe.play_id,Je.gameIdForAnalysis=Qe.game_id,Je.seasonIdForAnalysis=me.season_id,Je.isTemplateMode=Fe,Je.isGameOnly=!0,console.log("propsAux for coreView.id 18:",Je)):console.warn("No specific plays corner data available for this component")}}if(Pe.id===16){if(!Fe&&Ie){const Qe=Je.isHomeTeamForAnalysis;Je.isHomeTeamForAnalysis=Qe?Ae:!Ae}if(!Fe){Je.isPreMatch=!x.value,Je.isTemplateMode=Fe,Je.seasonId=Ne.season_id,Je.teamIdForAnalysis=Je.isHomeTeamForAnalysis?Ne.game.home_team:Ne.game.visiting_team;const Qe=Je.isHomeTeamForAnalysis?Ne.last_games.last_home_games:Ne.last_games.last_visiting_games;x.value?Je.gamesIdsForAnalysis=[Ne.game.game_id]:Je.howManyGames?Je.gamesIdsForAnalysis=Qe.slice(0,Je.howManyGames).map(ye=>ye.game_id):(Je.gamesIdsForAnalysis=[],Je.gameDataUTC=Ne.game.date_time_utc)}}if(Pe.id===10&&Ie){const Qe=Je.isHomeTeamForAnalysis;Je.isHomeTeamForAnalysis=Qe?Ae:!Ae}if(Pe.id===1&&(Je.gameId=me?me.id:"",Je.homeLogo=me?me.homeTeam.logo:"",Je.awayLogo=me?me.awayTeam.logo:"",Je.seasonId=me?me.season_id:0,Je.default=Fe),Pe.id===6&&(Je.game=me||"",Je.lastGames=Ne.last_games,Je.selectedOption=Ne.template_type===2?"Postmatch":"Prematch"),Pe.id===13&&(Je.isdefault=Fe,Je.seasonid=me?me.seasonId:2010,Je.datetimeutc=me?Ne.template_type===1?me?me.date_time_utc:"":null:"",Je.teamids=me?[me.home_team,me.visiting_team]:[1,2],Je.categoryids=Le?Le[1]:[20,2],Je.teamsshow=me?Le?Le[2]==1?[me.home_team]:Le[2]==2?[me.visiting_team]:[me.home_team,me.visiting_team]:[1,2]:[1,2],Je.analysistype=Le?Le[0]:[],Je.gameid=Ne.template_type===1?null:me?me.id:"",Je.teams=me?[{id:me.home_team,name:me.home_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+me.home_team+".png"},{id:me.visiting_team,name:me.visiting_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+me.visiting_team+".png"}]:[]),Pe.id===15&&(Je.view=1,Je.token=se.token,Je.numitems=Le?Le[1]:3,Je.isdefault=Fe,Je.reportid=Ne!=null&&Ne.id?Ne.id:0,Je.userid=Ne!=null&&Ne.user_id?Ne.user_id:0,Je.page=ke+1,Je.typegame=x.value?2:1,Je.componentid=Xe+1,Je.data={season:me?me.seasonId:2010,type:2,game:me?me.id:0,team:Fe?2:Ue?Ue.isHomeTeam?me.home_team||2:me.visiting_team||2:2}),Pe.id===14&&(Je.isReports=!0,Je.isDefault=Fe,Je.type=Ne.tournament_type==1?1:0,Je.typeView=1,Je.tournament=Ne.tournament_id,Je.currentSeason=me?me.season_id:0,Je.currentSeasonId=me?me.season_id:0,Je.showVideos=!1,Je.localTeam=me?me.home_team:0,Je.awayTeam=me?me.visiting_team:0),Pe.id===3&&(Je.defaultShields=Fe),Pe.id===2){let Qe=!0,ye=0,ze=0;me&&(Qe=Ne.main_team==me.home_team||Ne.main_team==me.visiting_team,ye=Qe?Ne.main_team==(me==null?void 0:me.home_team)?me==null?void 0:me.home_team:me==null?void 0:me.visiting_team:me==null?void 0:me.home_team,ze=Qe?Ne.main_team==(me==null?void 0:me.home_team)?me==null?void 0:me.visiting_team:me==null?void 0:me.home_team:me==null?void 0:me.visiting_team),Je.gamed=me?me.id:"",Je.game=me||"",Je.season=me?me.season_id:0,Je.teamView=Ue.teamType==3?0:Ue.teamType==1?ye:ze,Je.useDummyData=Fe}return Pe.id===8&&(Je.teamSelected=me?{teamId:me.home_team}:1,Je.isDefault=Fe),Pe.id===4&&(Je.gameId=me?me.id:"",Je.isDefault=Fe,Je.homeTeam=me?me==null?void 0:me.home_team:"",Je.awayTeam=me?me==null?void 0:me.visiting_team:""),Je}async function oe(Te){try{const Pe=await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Te.user_id}/reports/${Te.id}/specific-plays-corners`,{method:"GET",headers:{Authorization:se.token}})).json();return console.log("66666666666666666666666666666666666666"),console.log("data",Pe),Pe.data}catch(Pe){return console.error("Error fetching specific plays:",Pe),[]}}const se=e,ce=n;t.watch(()=>se.token,(Te,Pe)=>{},{immediate:!0}),r({show:te}),Un.on("add-page-view",Te=>{b.set(Te.view.id,Te.view);const Pe=R.value.find(Ne=>Ne.id===Te.pageId);Pe&&(Pe.items||(Pe.items=[]),Pe.items.push(Te.view),t.nextTick(()=>{const Ne=document.querySelector(`[gs-id="${Te.view.id}"]`);Te.grid.makeWidget(Ne)}))}),Un.on("add-page-and-view",Te=>{const Pe=R.value.findIndex(Ne=>Ne.id===Te.pageId);if(Pe>-1){const Ne=F(Pe,!0);setTimeout(()=>{Un.emit("add-view",{pageId:Ne.id,view:Te.view,filterAndWidgetContainer:Te.filterAndWidgetContainer}),u.value&&(Ne.stepBackPage=u.value),u.value=Ne},500)}else console.error("Page not found for adding view:",Te.pageId)}),Un.on("empty-page",Te=>{p.value&&f.value&&f.value.id===Te.id||(qe(Te),u.value&&u.value.id===Te.id&&(u.value.stepBackPage?u.value=u.value.stepBackPage:u.value=null))}),Un.on("filters-cancelled",Te=>{Te&&Te.removeAllChildViews()}),Un.on("activate-save-button",()=>{m.value=!0});function he(Te){return{...Te,gameId:Te.game_id,id:Te.game_id,seasonId:Te.season_id,status:Te.game_status,homeTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${Te.home_team}.png`,team_id:Te.home_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${Te.home_team}.png`,colloquial_name:Te.home_team_name,acronym:Te.home_team_acronym,team_name:Te.home_team_name},awayTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${Te.visiting_team}.png`,team_id:Te.visiting_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${Te.visiting_team}.png`,colloquial_name:Te.visiting_team_name,acronym:Te.visiting_team_acronym,team_name:Te.visiting_team_name}}}function ne(Te,Pe=!1){Pe||!a.value?(i.value=!1,re(),ce("close")):m.value?w.value=!0:(i.value=!1,re(),ce("close"))}function de(){o.value=null,p.value=!1}function ue({page:Te,view:Pe,applyMinimumSize:Ne=!1}){const Fe=Te.grid;if(!Te||!Pe||!Fe)return null;const Ue=Ne?{w:Pe.min_column,h:Pe.min_row}:{w:Pe.colspan,h:Pe.rowspan},me=Fe.willItFit(0,0,Ue.w,Ue.h,!0);return me?{willFit:me,applyMinimumSize:Ne}:Ne?null:ue({page:Te,view:Pe,applyMinimumSize:!0})}const ge=new Set([9]);function xe(Te){var Pe,Ne,Fe,Ue,me,Le,ke,Xe,Ae,Ie,Je,Qe,ye,ze;if(console.log("onFiltersChanged called with filters:",Te),Te.dynamicFilters&&Te.dynamicFilters.length>0&&Te.viewToEdit&&Te.viewToEdit.view){const Me=Te.viewToEdit.view.id;R.value.forEach(je=>{je.items.forEach(He=>{He.id===Me&&He.coreView&&He.coreView.id===3&&(He.componentProps.desplegable=Te.dynamicFilters[0]||!1,He.componentProps.key=Te.dynamicFilters[0]||!1,t.nextTick(()=>{Un.emit("force-component-update",{itemId:He.id,componentProps:He.componentProps})}))})})}if(Te.viewToEdit){if(!Te.viewToEdit.view.filterAndViewsContainer){const Me=new p1(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[Te.viewToEdit],((Pe=Te.viewToEdit.view.coreView)==null?void 0:Pe.id)||Te.viewToEdit.view.id,Te.dynamicFilters||[],x.value,a.value,Te.filtersJSON,se.token,Te.filters);Te.viewToEdit.view.filterAndViewsContainer=Me}Te.viewToEdit.view.filterAndViewsContainer.updateView({view:Te.viewToEdit,dynamicFilters:Te.dynamicFilters||[],filtersJSON:Te.filtersJSON||null,filters:Te.filters}),m.value=!0}else if(Te.view){Te.view.id&&Te.filterAndViewsContainer&&Te.view.id!==Te.filterAndViewsContainer.viewId&&(Te.filterAndViewsContainer.removeAllChildViews(),Te.filterAndViewsContainer.setViewId(Te.view.id),Te.filterAndViewsContainer.setFiltersJSON(Te.filtersJSON||null)),Te.view.id&&ge.has(Te.view.id)&&Te.dynamicFilters[0]&&Te.dynamicFilters[0].length===0&&Te.filterAndViewsContainer&&(Te.filterAndViewsContainer.updateDynamicFilters(Te.dynamicFilters,(Fe=(Ne=Te.viewToEdit)==null?void 0:Ne.view)==null?void 0:Fe.id),m.value=!0);const Me=u.value||f.value,je=ue({page:Me,view:Te.view,applyMinimumSize:!1});Te.view.filtersJSON=Te.filtersJSON||null;const He=Te.filterAndViewsContainer,$e=R.value.findIndex(ut=>ut.id===Me.id);if(He){console.log("1111");const ut=Te.filterAndViewsContainer.getRequiresAddView(Te.dynamicFilters,Te.filters);if(((Ue=Te.view)==null?void 0:Ue.id)===15){const xt=(me=Te.filterAndViewsContainer)==null?void 0:me.getId();if(xt&&T.has(xt)){const _t=T.get(xt);clearTimeout(_t),T.delete(xt)}}if(ut){if(He.setFilters(Te.filters),He.setDynamicFilters(Te.dynamicFilters),je||$e===R.value.length-1){Un.emit("add-view",{pageId:Me.id,view:Te.view,filterAndWidgetContainer:He,avoidWillFit:!1,applyMinimumSize:je?je.applyMinimumSize:!1,dynamicFilters:Te.dynamicFilters,filters:Te.filters}),Te.filterAndViewsContainer.updateDynamicFilters(Te.dynamicFilters,(ke=(Le=Te.viewToEdit)==null?void 0:Le.view)==null?void 0:ke.id),m.value=!0;let xt=null;if(((Xe=Te.view)==null?void 0:Xe.id)===15?(t.nextTick(()=>{var _t;const Rt=Te.filterAndViewsContainer.getRequiresAddView(Te.dynamicFilters,Te.filters);((_t=Te.dynamicFilters)==null?void 0:_t[0])===3&&Rt&&xe(Te)}),xt=setTimeout(()=>{var _t,Rt;const Xt=(_t=Te.filterAndViewsContainer)==null?void 0:_t.getId();Xt&&T.delete(Xt),console.log("222222222222222222");const It=Te.filterAndViewsContainer.getRequiresAddView(Te.dynamicFilters);((Rt=Te.dynamicFilters)==null?void 0:Rt[0])===3&&It&&xe(Te)},200)):(console.log("33333333333333"),xt=setTimeout(()=>{Te.filterAndViewsContainer.getRequiresAddView(Te.dynamicFilters,Te.filters)&&xe(Te)},1e3)),((Ae=Te.view)==null?void 0:Ae.id)===15&&xt){const _t=(Ie=Te.filterAndViewsContainer)==null?void 0:Ie.getId();_t&&T.set(_t,xt)}}}else Te.isAltMode?Te.viewToEdit||Te.filterAndViewsContainer.updateFilters(Te.filters,(Qe=(Je=Te.viewToEdit)==null?void 0:Je.view)==null?void 0:Qe.id):Te.filterAndViewsContainer.updateDynamicFilters(Te.dynamicFilters,(ze=(ye=Te.viewToEdit)==null?void 0:ye.view)==null?void 0:ze.id),m.value=!0}else if(je||$e===R.value.length-1){const ut=new p1(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],Te.view.id,Te.dynamicFilters,x.value,a.value,Te.filtersJSON,se.token,Te.filters);Un.emit("set-filter-and-views-container",ut),s.value.set(ut.getId(),ut),Te.dynamicFilters&&Array.isArray(Te.dynamicFilters[0])?(Te.filterAndViewsContainer=ut,xe(Te)):Un.emit("add-view",{pageId:Me.id,view:Te.view,filterAndWidgetContainer:ut,avoidWillFit:!1,applyMinimumSize:je?je.applyMinimumSize:!1,dynamicFilters:Te.dynamicFilters,filters:Te.filters}),m.value=!0}}}async function be(){if(m.value)try{const Te=[{is_front_page:!0,template_type:y.value.isPostMatch?2:1,type:y.value.id},...R.value.map(Ne=>({columns:Ne.originalPage?Ne.originalPage.columns:12,rows:Ne.originalPage?Ne.originalPage.rows:12,gap:Ne.originalPage?Ne.originalPage.gap:10,name:Ne.title,width:Ne.originalPage?Ne.originalPage.width:968,height:Ne.originalPage?Ne.originalPage.height:702,components:Ne.items.reduce((Fe,Ue)=>(Ue.isDeleted||Fe.push({min_column:Ue.minWidth,min_row:Ue.minHeight,max_column:Ue.maxWidth,max_row:Ue.maxHeight,column:Ue.x,row:Ue.y,colspan:Ue.w,rowspan:Ue.h,name:Ue.name,title:Ue.title,titleShort:Ue.titleShort||Ue.title,dynamicFilters:Ue.filterAndViewsContainer.getComponentDynamicFilters(Ue.id)||Ue.filterAndViewsContainer.getDynamicFilters()||[],coreView:Ue.coreView||null,componentName:Ue.componentName,componentProps:Ue.componentProps||{},isHomeTeam:Ue.isHomeTeam||Ue.componentProps.isHomeTeamForAnalysis,filterMultiple:Ue.filterMultiple}),Fe),[])}))],Pe=await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${d.value.user_id}/templates/${d.value.id}/pages`,{method:"PATCH",headers:{Authorization:se.token},body:JSON.stringify({pages:Te})});_.value=!0,await Pe.json(),m.value=!1,setTimeout(()=>{_.value=!1},2e3)}catch(Te){console.error("Error saving template:",Te)}}function _e(){R.value.forEach(Te=>{Te.offListeners&&Te.offListeners()})}function qe(Te){const Pe=R.value.findIndex(Ne=>Ne.id===Te.id);Pe>-1&&(_e(),R.value=R.value.filter(Ne=>Ne.id!==Te.id),c.value>=Pe&&(c.value=Math.max(0,c.value-1)),m.value=!0)}function Ce(){m.value=!0}function Ee(Te){const Pe=R.value.find(Ne=>Ne.items.some(Fe=>Fe.id===Te.id));if(Pe){const Ne=Pe.items.find(Fe=>Fe.id===Te.id);Ne&&(Ne.isDeleted=!0,m.value=!0)}}function Re(Te){}return(Te,Pe)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(nqe,{modelValue:w.value,"onUpdate:modelValue":Pe[0]||(Pe[0]=Ne=>w.value=Ne),onAction:N},null,8,["modelValue"]),t.createVNode(sqe,{"model-value":_.value},null,8,["model-value"]),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[i.value&&d.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"template-maker",style:t.normalizeStyle(V.value)},[t.withDirectives(t.createVNode(JOe,{token:e.token,view:o.value,"is-post-match":x.value,onClose:de,onFiltersChanged:xe},null,8,["token","view","is-post-match"]),[[t.vShow,a.value&&p.value]]),t.createElementVNode("div",lqe,[t.createTextVNode(t.toDisplayString(d.value?d.value.name:"Nuevo template")+" ",1),t.createElementVNode("div",{class:"template-maker__header__close",onClick:ne},[S.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("svg",cqe,[...Pe[6]||(Pe[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",uqe,[Pe[13]||(Pe[13]=t.createElementVNode("div",{class:"template-maker__content__sidebar"},null,-1)),t.createElementVNode("div",dqe,[t.createElementVNode("div",pqe,[t.createElementVNode("div",hqe,[t.withDirectives(t.createVNode(HO,{"is-post-match":x.value,"initial-cover-id":v.value,onSelectCover:C},null,8,["is-post-match","initial-cover-id"]),[[t.vShow,a.value]])]),(t.openBlock(),t.createElementBlock("div",{class:"template-maker__content__main__pages",key:R.value.length},[y.value?(t.openBlock(),t.createBlock(J8e,{key:0,id:"page-0",game:d.value.game||null,"cover-id":y.value.id,"is-post-match":y.value.isPostMatch,onIntersectionChanged:Pe[1]||(Pe[1]=Ne=>X(Ne,-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":R.value.length===0?"30px":"0"})},[p.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:"new-items-buttons__add-page new-item-button",onClick:Pe[2]||(Pe[2]=Ne=>F(-1))},[...Pe[7]||(Pe[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(R.value,(Ne,Fe)=>(t.openBlock(),t.createElementBlock("div",{key:Fe,id:`page-${Fe+1}`,class:"template-maker__content__main__pages__page"},[t.createElementVNode("div",mqe,[t.createElementVNode("div",yqe,"Pag "+t.toDisplayString(O(Fe+2)),1)]),y.value?(t.openBlock(),t.createBlock(H9e,{key:0,page:Ne,"is-template-mode":a.value,"is-post-match":y.value.isPostMatch,game:d.value.game||null,lastGames:d.value.lastGames||[],"is-filter-visible":p.value,onEditView:D,onIntersectionChanged:Ue=>X(Ue,Fe),onChangeSort:Re,onDeletePage:qe,onViewChanged:Ce,onDeleteView:Ee},null,8,["page","is-template-mode","is-post-match","game","lastGames","is-filter-visible","onIntersectionChanged"])):t.createCommentVNode("",!0),a.value&&!p.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:"new-items-buttons",style:t.normalizeStyle({"margin-bottom":Fe+1===R.value.length?"30px":"0","margin-top":"10px"})},[t.createElementVNode("div",{class:"new-items-buttons__add-page new-item-button",onClick:Ue=>F(Fe)},[...Pe[8]||(Pe[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,gqe),t.createElementVNode("div",{class:"new-items-buttons__add-item new-item-button",onClick:Ue=>A(Ne)},[...Pe[9]||(Pe[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,vqe)],4)):t.createCommentVNode("",!0)],8,fqe))),128))]))]),S.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",bqe,[t.createElementVNode("div",xqe,[t.createElementVNode("div",wqe,[t.createElementVNode("div",null,"Páginas "+t.toDisplayString(L.value),1),t.createElementVNode("div",{class:t.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:c.value<=0}]),onClick:Pe[3]||(Pe[3]=Ne=>c.value>0&&W(c.value-1))},[...Pe[10]||(Pe[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:c.value>=R.value.length}]),onClick:Pe[4]||(Pe[4]=Ne=>c.value<R.value.length&&W(c.value+1))},[...Pe[11]||(Pe[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",_qe,[t.createElementVNode("div",{role:"button",class:t.normalizeClass({active:c.value===0}),onClick:Pe[5]||(Pe[5]=Ne=>W(0))},t.toDisplayString(O(1)),3),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R.value,(Ne,Fe)=>(t.openBlock(),t.createElementBlock("div",{role:"button",key:Fe,class:t.normalizeClass({active:Fe+1===c.value}),onClick:Ue=>W(Fe+1)},t.toDisplayString(O(Fe+2)),11,Sqe))),128))])]),a.value?(t.openBlock(),t.createElementBlock("div",{key:0,role:"button",class:t.normalizeClass(["template-maker__content__main__footer__save save-button",{disabled:!m.value}]),onClick:be},[...Pe[12]||(Pe[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))}},kqe=pc(Tqe,[["__scopeId","data-v-04deba4c"]]);function jL(e,r){return function(){return e.apply(r,arguments)}}const{toString:Nqe}=Object.prototype,{getPrototypeOf:C_}=Object,{iterator:tx,toStringTag:WL}=Symbol,rx=(e=>r=>{const n=Nqe.call(r);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Yp=e=>(e=e.toLowerCase(),r=>rx(r)===e),ax=e=>r=>typeof r===e,{isArray:f1}=Array,m1=ax("undefined");function hg(e){return e!==null&&!m1(e)&&e.constructor!==null&&!m1(e.constructor)&&Wd(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const AL=Yp("ArrayBuffer");function Vqe(e){let r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(e):r=e&&e.buffer&&AL(e.buffer),r}const Lqe=ax("string"),Wd=ax("function"),KL=ax("number"),fg=e=>e!==null&&typeof e=="object",Oqe=e=>e===!0||e===!1,nx=e=>{if(rx(e)!=="object")return!1;const r=C_(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(WL in e)&&!(tx in e)},qqe=e=>{if(!fg(e)||hg(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Cqe=Yp("Date"),Uqe=Yp("File"),zqe=Yp("Blob"),Eqe=Yp("FileList"),Pqe=e=>fg(e)&&Wd(e.pipe),Rqe=e=>{let r;return e&&(typeof FormData=="function"&&e instanceof FormData||Wd(e.append)&&((r=rx(e))==="formdata"||r==="object"&&Wd(e.toString)&&e.toString()==="[object FormData]"))},Mqe=Yp("URLSearchParams"),[Fqe,jqe,Wqe,Aqe]=["ReadableStream","Request","Response","Headers"].map(Yp),Kqe=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mg(e,r,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let b,R;if(typeof e!="object"&&(e=[e]),f1(e))for(b=0,R=e.length;b<R;b++)r.call(null,e[b],b,e);else{if(hg(e))return;const y=n?Object.getOwnPropertyNames(e):Object.keys(e),c=y.length;let i;for(b=0;b<c;b++)i=y[b],r.call(null,e[i],i,e)}}function IL(e,r){if(hg(e))return null;r=r.toLowerCase();const n=Object.keys(e);let b=n.length,R;for(;b-- >0;)if(R=n[b],r===R.toLowerCase())return R;return null}const Dm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,XL=e=>!m1(e)&&e!==Dm;function U_(){const{caseless:e,skipUndefined:r}=XL(this)&&this||{},n={},b=(R,y)=>{const c=e&&IL(n,y)||y;nx(n[c])&&nx(R)?n[c]=U_(n[c],R):nx(R)?n[c]=U_({},R):f1(R)?n[c]=R.slice():(!r||!m1(R))&&(n[c]=R)};for(let R=0,y=arguments.length;R<y;R++)arguments[R]&&mg(arguments[R],b);return n}const Iqe=(e,r,n,{allOwnKeys:b}={})=>(mg(r,(R,y)=>{n&&Wd(R)?e[y]=jL(R,n):e[y]=R},{allOwnKeys:b}),e),Xqe=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Dqe=(e,r,n,b)=>{e.prototype=Object.create(r.prototype,b),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:r.prototype}),n&&Object.assign(e.prototype,n)},Bqe=(e,r,n,b)=>{let R,y,c;const i={};if(r=r||{},e==null)return r;do{for(R=Object.getOwnPropertyNames(e),y=R.length;y-- >0;)c=R[y],(!b||b(c,e,r))&&!i[c]&&(r[c]=e[c],i[c]=!0);e=n!==!1&&C_(e)}while(e&&(!n||n(e,r))&&e!==Object.prototype);return r},Gqe=(e,r,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=r.length;const b=e.indexOf(r,n);return b!==-1&&b===n},Jqe=e=>{if(!e)return null;if(f1(e))return e;let r=e.length;if(!KL(r))return null;const n=new Array(r);for(;r-- >0;)n[r]=e[r];return n},Zqe=(e=>r=>e&&r instanceof e)(typeof Uint8Array<"u"&&C_(Uint8Array)),Hqe=(e,r)=>{const b=(e&&e[tx]).call(e);let R;for(;(R=b.next())&&!R.done;){const y=R.value;r.call(e,y[0],y[1])}},Yqe=(e,r)=>{let n;const b=[];for(;(n=e.exec(r))!==null;)b.push(n);return b},Qqe=Yp("HTMLFormElement"),$qe=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,b,R){return b.toUpperCase()+R}),DL=(({hasOwnProperty:e})=>(r,n)=>e.call(r,n))(Object.prototype),eCe=Yp("RegExp"),BL=(e,r)=>{const n=Object.getOwnPropertyDescriptors(e),b={};mg(n,(R,y)=>{let c;(c=r(R,y,e))!==!1&&(b[y]=c||R)}),Object.defineProperties(e,b)},tCe=e=>{BL(e,(r,n)=>{if(Wd(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const b=e[n];if(Wd(b)){if(r.enumerable=!1,"writable"in r){r.writable=!1;return}r.set||(r.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},rCe=(e,r)=>{const n={},b=R=>{R.forEach(y=>{n[y]=!0})};return f1(e)?b(e):b(String(e).split(r)),n},aCe=()=>{},nCe=(e,r)=>e!=null&&Number.isFinite(e=+e)?e:r;function iCe(e){return!!(e&&Wd(e.append)&&e[WL]==="FormData"&&e[tx])}const oCe=e=>{const r=new Array(10),n=(b,R)=>{if(fg(b)){if(r.indexOf(b)>=0)return;if(hg(b))return b;if(!("toJSON"in b)){r[R]=b;const y=f1(b)?[]:{};return mg(b,(c,i)=>{const d=n(c,R+1);!m1(d)&&(y[i]=d)}),r[R]=void 0,y}}return b};return n(e,0)},sCe=Yp("AsyncFunction"),lCe=e=>e&&(fg(e)||Wd(e))&&Wd(e.then)&&Wd(e.catch),GL=((e,r)=>e?setImmediate:r?((n,b)=>(Dm.addEventListener("message",({source:R,data:y})=>{R===Dm&&y===n&&b.length&&b.shift()()},!1),R=>{b.push(R),Dm.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Wd(Dm.postMessage)),cCe=typeof queueMicrotask<"u"?queueMicrotask.bind(Dm):typeof process<"u"&&process.nextTick||GL,Qa={isArray:f1,isArrayBuffer:AL,isBuffer:hg,isFormData:Rqe,isArrayBufferView:Vqe,isString:Lqe,isNumber:KL,isBoolean:Oqe,isObject:fg,isPlainObject:nx,isEmptyObject:qqe,isReadableStream:Fqe,isRequest:jqe,isResponse:Wqe,isHeaders:Aqe,isUndefined:m1,isDate:Cqe,isFile:Uqe,isBlob:zqe,isRegExp:eCe,isFunction:Wd,isStream:Pqe,isURLSearchParams:Mqe,isTypedArray:Zqe,isFileList:Eqe,forEach:mg,merge:U_,extend:Iqe,trim:Kqe,stripBOM:Xqe,inherits:Dqe,toFlatObject:Bqe,kindOf:rx,kindOfTest:Yp,endsWith:Gqe,toArray:Jqe,forEachEntry:Hqe,matchAll:Yqe,isHTMLForm:Qqe,hasOwnProperty:DL,hasOwnProp:DL,reduceDescriptors:BL,freezeMethods:tCe,toObjectSet:rCe,toCamelCase:$qe,noop:aCe,toFiniteNumber:nCe,findKey:IL,global:Dm,isContextDefined:XL,isSpecCompliantForm:iCe,toJSONObject:oCe,isAsyncFn:sCe,isThenable:lCe,setImmediate:GL,asap:cCe,isIterable:e=>e!=null&&Wd(e[tx])};function yo(e,r,n,b,R){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),b&&(this.request=b),R&&(this.response=R,this.status=R.status?R.status:null)}Qa.inherits(yo,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:Qa.toJSONObject(this.config),code:this.code,status:this.status}}});const JL=yo.prototype,ZL={};["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=>{ZL[e]={value:e}}),Object.defineProperties(yo,ZL),Object.defineProperty(JL,"isAxiosError",{value:!0}),yo.from=(e,r,n,b,R,y)=>{const c=Object.create(JL);Qa.toFlatObject(e,c,function(a){return a!==Error.prototype},l=>l!=="isAxiosError");const i=e&&e.message?e.message:"Error",d=r==null&&e?e.code:r;return yo.call(c,i,d,n,b,R),e&&c.cause==null&&Object.defineProperty(c,"cause",{value:e,configurable:!0}),c.name=e&&e.name||"Error",y&&Object.assign(c,y),c};const uCe=null;function z_(e){return Qa.isPlainObject(e)||Qa.isArray(e)}function HL(e){return Qa.endsWith(e,"[]")?e.slice(0,-2):e}function YL(e,r,n){return e?e.concat(r).map(function(R,y){return R=HL(R),!n&&y?"["+R+"]":R}).join(n?".":""):r}function dCe(e){return Qa.isArray(e)&&!e.some(z_)}const pCe=Qa.toFlatObject(Qa,{},null,function(r){return/^is[A-Z]/.test(r)});function ix(e,r,n){if(!Qa.isObject(e))throw new TypeError("target must be an object");r=r||new FormData,n=Qa.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(o,s){return!Qa.isUndefined(s[o])});const b=n.metaTokens,R=n.visitor||a,y=n.dots,c=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&Qa.isSpecCompliantForm(r);if(!Qa.isFunction(R))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(Qa.isDate(p))return p.toISOString();if(Qa.isBoolean(p))return p.toString();if(!d&&Qa.isBlob(p))throw new yo("Blob is not supported. Use a Buffer instead.");return Qa.isArrayBuffer(p)||Qa.isTypedArray(p)?d&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function a(p,o,s){let f=p;if(p&&!s&&typeof p=="object"){if(Qa.endsWith(o,"{}"))o=b?o:o.slice(0,-2),p=JSON.stringify(p);else if(Qa.isArray(p)&&dCe(p)||(Qa.isFileList(p)||Qa.endsWith(o,"[]"))&&(f=Qa.toArray(p)))return o=HL(o),f.forEach(function(m,w){!(Qa.isUndefined(m)||m===null)&&r.append(c===!0?YL([o],w,y):c===null?o:o+"[]",l(m))}),!1}return z_(p)?!0:(r.append(YL(s,o,y),l(p)),!1)}const S=[],x=Object.assign(pCe,{defaultVisitor:a,convertValue:l,isVisitable:z_});function v(p,o){if(!Qa.isUndefined(p)){if(S.indexOf(p)!==-1)throw Error("Circular reference detected in "+o.join("."));S.push(p),Qa.forEach(p,function(f,u){(!(Qa.isUndefined(f)||f===null)&&R.call(r,f,Qa.isString(u)?u.trim():u,o,x))===!0&&v(f,o?o.concat(u):[u])}),S.pop()}}if(!Qa.isObject(e))throw new TypeError("data must be an object");return v(e),r}function QL(e){const r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(b){return r[b]})}function E_(e,r){this._pairs=[],e&&ix(e,this,r)}const $L=E_.prototype;$L.append=function(r,n){this._pairs.push([r,n])},$L.toString=function(r){const n=r?function(b){return r.call(this,b,QL)}:QL;return this._pairs.map(function(R){return n(R[0])+"="+n(R[1])},"").join("&")};function hCe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function eO(e,r,n){if(!r)return e;const b=n&&n.encode||hCe;Qa.isFunction(n)&&(n={serialize:n});const R=n&&n.serialize;let y;if(R?y=R(r,n):y=Qa.isURLSearchParams(r)?r.toString():new E_(r,n).toString(b),y){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+y}return e}class tO{constructor(){this.handlers=[]}use(r,n,b){return this.handlers.push({fulfilled:r,rejected:n,synchronous:b?b.synchronous:!1,runWhen:b?b.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){Qa.forEach(this.handlers,function(b){b!==null&&r(b)})}}const rO={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},fCe={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:E_,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},P_=typeof window<"u"&&typeof document<"u",R_=typeof navigator=="object"&&navigator||void 0,mCe=P_&&(!R_||["ReactNative","NativeScript","NS"].indexOf(R_.product)<0),yCe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",gCe=P_&&window.location.href||"http://localhost",ed={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:P_,hasStandardBrowserEnv:mCe,hasStandardBrowserWebWorkerEnv:yCe,navigator:R_,origin:gCe},Symbol.toStringTag,{value:"Module"})),...fCe};function vCe(e,r){return ix(e,new ed.classes.URLSearchParams,{visitor:function(n,b,R,y){return ed.isNode&&Qa.isBuffer(n)?(this.append(b,n.toString("base64")),!1):y.defaultVisitor.apply(this,arguments)},...r})}function bCe(e){return Qa.matchAll(/\w+|\[(\w*)]/g,e).map(r=>r[0]==="[]"?"":r[1]||r[0])}function xCe(e){const r={},n=Object.keys(e);let b;const R=n.length;let y;for(b=0;b<R;b++)y=n[b],r[y]=e[y];return r}function aO(e){function r(n,b,R,y){let c=n[y++];if(c==="__proto__")return!0;const i=Number.isFinite(+c),d=y>=n.length;return c=!c&&Qa.isArray(R)?R.length:c,d?(Qa.hasOwnProp(R,c)?R[c]=[R[c],b]:R[c]=b,!i):((!R[c]||!Qa.isObject(R[c]))&&(R[c]=[]),r(n,b,R[c],y)&&Qa.isArray(R[c])&&(R[c]=xCe(R[c])),!i)}if(Qa.isFormData(e)&&Qa.isFunction(e.entries)){const n={};return Qa.forEachEntry(e,(b,R)=>{r(bCe(b),R,n,0)}),n}return null}function wCe(e,r,n){if(Qa.isString(e))try{return(r||JSON.parse)(e),Qa.trim(e)}catch(b){if(b.name!=="SyntaxError")throw b}return(n||JSON.stringify)(e)}const yg={transitional:rO,adapter:["xhr","http","fetch"],transformRequest:[function(r,n){const b=n.getContentType()||"",R=b.indexOf("application/json")>-1,y=Qa.isObject(r);if(y&&Qa.isHTMLForm(r)&&(r=new FormData(r)),Qa.isFormData(r))return R?JSON.stringify(aO(r)):r;if(Qa.isArrayBuffer(r)||Qa.isBuffer(r)||Qa.isStream(r)||Qa.isFile(r)||Qa.isBlob(r)||Qa.isReadableStream(r))return r;if(Qa.isArrayBufferView(r))return r.buffer;if(Qa.isURLSearchParams(r))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let i;if(y){if(b.indexOf("application/x-www-form-urlencoded")>-1)return vCe(r,this.formSerializer).toString();if((i=Qa.isFileList(r))||b.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return ix(i?{"files[]":r}:r,d&&new d,this.formSerializer)}}return y||R?(n.setContentType("application/json",!1),wCe(r)):r}],transformResponse:[function(r){const n=this.transitional||yg.transitional,b=n&&n.forcedJSONParsing,R=this.responseType==="json";if(Qa.isResponse(r)||Qa.isReadableStream(r))return r;if(r&&Qa.isString(r)&&(b&&!this.responseType||R)){const c=!(n&&n.silentJSONParsing)&&R;try{return JSON.parse(r,this.parseReviver)}catch(i){if(c)throw i.name==="SyntaxError"?yo.from(i,yo.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:ed.classes.FormData,Blob:ed.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Qa.forEach(["delete","get","head","post","put","patch"],e=>{yg.headers[e]={}});const _Ce=Qa.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"]),SCe=e=>{const r={};let n,b,R;return e&&e.split(`
|
|
4132
4132
|
`).forEach(function(c){R=c.indexOf(":"),n=c.substring(0,R).trim().toLowerCase(),b=c.substring(R+1).trim(),!(!n||r[n]&&_Ce[n])&&(n==="set-cookie"?r[n]?r[n].push(b):r[n]=[b]:r[n]=r[n]?r[n]+", "+b:b)}),r},nO=Symbol("internals");function gg(e){return e&&String(e).trim().toLowerCase()}function ox(e){return e===!1||e==null?e:Qa.isArray(e)?e.map(ox):String(e)}function TCe(e){const r=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let b;for(;b=n.exec(e);)r[b[1]]=b[2];return r}const kCe=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function M_(e,r,n,b,R){if(Qa.isFunction(b))return b.call(this,r,n);if(R&&(r=n),!!Qa.isString(r)){if(Qa.isString(b))return r.indexOf(b)!==-1;if(Qa.isRegExp(b))return b.test(r)}}function NCe(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(r,n,b)=>n.toUpperCase()+b)}function VCe(e,r){const n=Qa.toCamelCase(" "+r);["get","set","has"].forEach(b=>{Object.defineProperty(e,b+n,{value:function(R,y,c){return this[b].call(this,r,R,y,c)},configurable:!0})})}let Ad=class{constructor(r){r&&this.set(r)}set(r,n,b){const R=this;function y(i,d,l){const a=gg(d);if(!a)throw new Error("header name must be a non-empty string");const S=Qa.findKey(R,a);(!S||R[S]===void 0||l===!0||l===void 0&&R[S]!==!1)&&(R[S||d]=ox(i))}const c=(i,d)=>Qa.forEach(i,(l,a)=>y(l,a,d));if(Qa.isPlainObject(r)||r instanceof this.constructor)c(r,n);else if(Qa.isString(r)&&(r=r.trim())&&!kCe(r))c(SCe(r),n);else if(Qa.isObject(r)&&Qa.isIterable(r)){let i={},d,l;for(const a of r){if(!Qa.isArray(a))throw TypeError("Object iterator must return a key-value pair");i[l=a[0]]=(d=i[l])?Qa.isArray(d)?[...d,a[1]]:[d,a[1]]:a[1]}c(i,n)}else r!=null&&y(n,r,b);return this}get(r,n){if(r=gg(r),r){const b=Qa.findKey(this,r);if(b){const R=this[b];if(!n)return R;if(n===!0)return TCe(R);if(Qa.isFunction(n))return n.call(this,R,b);if(Qa.isRegExp(n))return n.exec(R);throw new TypeError("parser must be boolean|regexp|function")}}}has(r,n){if(r=gg(r),r){const b=Qa.findKey(this,r);return!!(b&&this[b]!==void 0&&(!n||M_(this,this[b],b,n)))}return!1}delete(r,n){const b=this;let R=!1;function y(c){if(c=gg(c),c){const i=Qa.findKey(b,c);i&&(!n||M_(b,b[i],i,n))&&(delete b[i],R=!0)}}return Qa.isArray(r)?r.forEach(y):y(r),R}clear(r){const n=Object.keys(this);let b=n.length,R=!1;for(;b--;){const y=n[b];(!r||M_(this,this[y],y,r,!0))&&(delete this[y],R=!0)}return R}normalize(r){const n=this,b={};return Qa.forEach(this,(R,y)=>{const c=Qa.findKey(b,y);if(c){n[c]=ox(R),delete n[y];return}const i=r?NCe(y):String(y).trim();i!==y&&delete n[y],n[i]=ox(R),b[i]=!0}),this}concat(...r){return this.constructor.concat(this,...r)}toJSON(r){const n=Object.create(null);return Qa.forEach(this,(b,R)=>{b!=null&&b!==!1&&(n[R]=r&&Qa.isArray(b)?b.join(", "):b)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([r,n])=>r+": "+n).join(`
|
|
4133
4133
|
`)}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 b=new this(r);return n.forEach(R=>b.set(R)),b}static accessor(r){const b=(this[nO]=this[nO]={accessors:{}}).accessors,R=this.prototype;function y(c){const i=gg(c);b[i]||(VCe(R,c),b[i]=!0)}return Qa.isArray(r)?r.forEach(y):y(r),this}};Ad.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Qa.reduceDescriptors(Ad.prototype,({value:e},r)=>{let n=r[0].toUpperCase()+r.slice(1);return{get:()=>e,set(b){this[n]=b}}}),Qa.freezeMethods(Ad);function F_(e,r){const n=this||yg,b=r||n,R=Ad.from(b.headers);let y=b.data;return Qa.forEach(e,function(i){y=i.call(n,y,R.normalize(),r?r.status:void 0)}),R.normalize(),y}function iO(e){return!!(e&&e.__CANCEL__)}function y1(e,r,n){yo.call(this,e??"canceled",yo.ERR_CANCELED,r,n),this.name="CanceledError"}Qa.inherits(y1,yo,{__CANCEL__:!0});function oO(e,r,n){const b=n.config.validateStatus;!n.status||!b||b(n.status)?e(n):r(new yo("Request failed with status code "+n.status,[yo.ERR_BAD_REQUEST,yo.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function LCe(e){const r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return r&&r[1]||""}function OCe(e,r){e=e||10;const n=new Array(e),b=new Array(e);let R=0,y=0,c;return r=r!==void 0?r:1e3,function(d){const l=Date.now(),a=b[y];c||(c=l),n[R]=d,b[R]=l;let S=y,x=0;for(;S!==R;)x+=n[S++],S=S%e;if(R=(R+1)%e,R===y&&(y=(y+1)%e),l-c<r)return;const v=a&&l-a;return v?Math.round(x*1e3/v):void 0}}function qCe(e,r){let n=0,b=1e3/r,R,y;const c=(l,a=Date.now())=>{n=a,R=null,y&&(clearTimeout(y),y=null),e(...l)};return[(...l)=>{const a=Date.now(),S=a-n;S>=b?c(l,a):(R=l,y||(y=setTimeout(()=>{y=null,c(R)},b-S)))},()=>R&&c(R)]}const sx=(e,r,n=3)=>{let b=0;const R=OCe(50,250);return qCe(y=>{const c=y.loaded,i=y.lengthComputable?y.total:void 0,d=c-b,l=R(d),a=c<=i;b=c;const S={loaded:c,total:i,progress:i?c/i:void 0,bytes:d,rate:l||void 0,estimated:l&&i&&a?(i-c)/l:void 0,event:y,lengthComputable:i!=null,[r?"download":"upload"]:!0};e(S)},n)},sO=(e,r)=>{const n=e!=null;return[b=>r[0]({lengthComputable:n,total:e,loaded:b}),r[1]]},lO=e=>(...r)=>Qa.asap(()=>e(...r)),CCe=ed.hasStandardBrowserEnv?((e,r)=>n=>(n=new URL(n,ed.origin),e.protocol===n.protocol&&e.host===n.host&&(r||e.port===n.port)))(new URL(ed.origin),ed.navigator&&/(msie|trident)/i.test(ed.navigator.userAgent)):()=>!0,UCe=ed.hasStandardBrowserEnv?{write(e,r,n,b,R,y,c){if(typeof document>"u")return;const i=[`${e}=${encodeURIComponent(r)}`];Qa.isNumber(n)&&i.push(`expires=${new Date(n).toUTCString()}`),Qa.isString(b)&&i.push(`path=${b}`),Qa.isString(R)&&i.push(`domain=${R}`),y===!0&&i.push("secure"),Qa.isString(c)&&i.push(`SameSite=${c}`),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 zCe(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ECe(e,r){return r?e.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):e}function cO(e,r,n){let b=!zCe(r);return e&&(b||n==!1)?ECe(e,r):r}const uO=e=>e instanceof Ad?{...e}:e;function Bm(e,r){r=r||{};const n={};function b(l,a,S,x){return Qa.isPlainObject(l)&&Qa.isPlainObject(a)?Qa.merge.call({caseless:x},l,a):Qa.isPlainObject(a)?Qa.merge({},a):Qa.isArray(a)?a.slice():a}function R(l,a,S,x){if(Qa.isUndefined(a)){if(!Qa.isUndefined(l))return b(void 0,l,S,x)}else return b(l,a,S,x)}function y(l,a){if(!Qa.isUndefined(a))return b(void 0,a)}function c(l,a){if(Qa.isUndefined(a)){if(!Qa.isUndefined(l))return b(void 0,l)}else return b(void 0,a)}function i(l,a,S){if(S in r)return b(l,a);if(S in e)return b(void 0,l)}const d={url:y,method:y,data:y,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:i,headers:(l,a,S)=>R(uO(l),uO(a),S,!0)};return Qa.forEach(Object.keys({...e,...r}),function(a){const S=d[a]||R,x=S(e[a],r[a],a);Qa.isUndefined(x)&&S!==i||(n[a]=x)}),n}const dO=e=>{const r=Bm({},e);let{data:n,withXSRFToken:b,xsrfHeaderName:R,xsrfCookieName:y,headers:c,auth:i}=r;if(r.headers=c=Ad.from(c),r.url=eO(cO(r.baseURL,r.url,r.allowAbsoluteUrls),e.params,e.paramsSerializer),i&&c.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),Qa.isFormData(n)){if(ed.hasStandardBrowserEnv||ed.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(Qa.isFunction(n.getHeaders)){const d=n.getHeaders(),l=["content-type","content-length"];Object.entries(d).forEach(([a,S])=>{l.includes(a.toLowerCase())&&c.set(a,S)})}}if(ed.hasStandardBrowserEnv&&(b&&Qa.isFunction(b)&&(b=b(r)),b||b!==!1&&CCe(r.url))){const d=R&&y&&UCe.read(y);d&&c.set(R,d)}return r},PCe=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,b){const R=dO(e);let y=R.data;const c=Ad.from(R.headers).normalize();let{responseType:i,onUploadProgress:d,onDownloadProgress:l}=R,a,S,x,v,p;function o(){v&&v(),p&&p(),R.cancelToken&&R.cancelToken.unsubscribe(a),R.signal&&R.signal.removeEventListener("abort",a)}let s=new XMLHttpRequest;s.open(R.method.toUpperCase(),R.url,!0),s.timeout=R.timeout;function f(){if(!s)return;const m=Ad.from("getAllResponseHeaders"in s&&s.getAllResponseHeaders()),_={data:!i||i==="text"||i==="json"?s.responseText:s.response,status:s.status,statusText:s.statusText,headers:m,config:e,request:s};oO(function(V){n(V),o()},function(V){b(V),o()},_),s=null}"onloadend"in s?s.onloadend=f:s.onreadystatechange=function(){!s||s.readyState!==4||s.status===0&&!(s.responseURL&&s.responseURL.indexOf("file:")===0)||setTimeout(f)},s.onabort=function(){s&&(b(new yo("Request aborted",yo.ECONNABORTED,e,s)),s=null)},s.onerror=function(w){const _=w&&w.message?w.message:"Network Error",T=new yo(_,yo.ERR_NETWORK,e,s);T.event=w||null,b(T),s=null},s.ontimeout=function(){let w=R.timeout?"timeout of "+R.timeout+"ms exceeded":"timeout exceeded";const _=R.transitional||rO;R.timeoutErrorMessage&&(w=R.timeoutErrorMessage),b(new yo(w,_.clarifyTimeoutError?yo.ETIMEDOUT:yo.ECONNABORTED,e,s)),s=null},y===void 0&&c.setContentType(null),"setRequestHeader"in s&&Qa.forEach(c.toJSON(),function(w,_){s.setRequestHeader(_,w)}),Qa.isUndefined(R.withCredentials)||(s.withCredentials=!!R.withCredentials),i&&i!=="json"&&(s.responseType=R.responseType),l&&([x,p]=sx(l,!0),s.addEventListener("progress",x)),d&&s.upload&&([S,v]=sx(d),s.upload.addEventListener("progress",S),s.upload.addEventListener("loadend",v)),(R.cancelToken||R.signal)&&(a=m=>{s&&(b(!m||m.type?new y1(null,e,s):m),s.abort(),s=null)},R.cancelToken&&R.cancelToken.subscribe(a),R.signal&&(R.signal.aborted?a():R.signal.addEventListener("abort",a)));const u=LCe(R.url);if(u&&ed.protocols.indexOf(u)===-1){b(new yo("Unsupported protocol "+u+":",yo.ERR_BAD_REQUEST,e));return}s.send(y||null)})},RCe=(e,r)=>{const{length:n}=e=e?e.filter(Boolean):[];if(r||n){let b=new AbortController,R;const y=function(l){if(!R){R=!0,i();const a=l instanceof Error?l:this.reason;b.abort(a instanceof yo?a:new y1(a instanceof Error?a.message:a))}};let c=r&&setTimeout(()=>{c=null,y(new yo(`timeout ${r} of ms exceeded`,yo.ETIMEDOUT))},r);const i=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(y):l.removeEventListener("abort",y)}),e=null)};e.forEach(l=>l.addEventListener("abort",y));const{signal:d}=b;return d.unsubscribe=()=>Qa.asap(i),d}},MCe=function*(e,r){let n=e.byteLength;if(n<r){yield e;return}let b=0,R;for(;b<n;)R=b+r,yield e.slice(b,R),b=R},FCe=async function*(e,r){for await(const n of jCe(e))yield*MCe(n,r)},jCe=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const r=e.getReader();try{for(;;){const{done:n,value:b}=await r.read();if(n)break;yield b}}finally{await r.cancel()}},pO=(e,r,n,b)=>{const R=FCe(e,r);let y=0,c,i=d=>{c||(c=!0,b&&b(d))};return new ReadableStream({async pull(d){try{const{done:l,value:a}=await R.next();if(l){i(),d.close();return}let S=a.byteLength;if(n){let x=y+=S;n(x)}d.enqueue(new Uint8Array(a))}catch(l){throw i(l),l}},cancel(d){return i(d),R.return()}},{highWaterMark:2})},hO=64*1024,{isFunction:lx}=Qa,WCe=(({Request:e,Response:r})=>({Request:e,Response:r}))(Qa.global),{ReadableStream:fO,TextEncoder:mO}=Qa.global,yO=(e,...r)=>{try{return!!e(...r)}catch{return!1}},ACe=e=>{e=Qa.merge.call({skipUndefined:!0},WCe,e);const{fetch:r,Request:n,Response:b}=e,R=r?lx(r):typeof fetch=="function",y=lx(n),c=lx(b);if(!R)return!1;const i=R&&lx(fO),d=R&&(typeof mO=="function"?(p=>o=>p.encode(o))(new mO):async p=>new Uint8Array(await new n(p).arrayBuffer())),l=y&&i&&yO(()=>{let p=!1;const o=new n(ed.origin,{body:new fO,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!o}),a=c&&i&&yO(()=>Qa.isReadableStream(new b("").body)),S={stream:a&&(p=>p.body)};R&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!S[p]&&(S[p]=(o,s)=>{let f=o&&o[p];if(f)return f.call(o);throw new yo(`Response type '${p}' is not supported`,yo.ERR_NOT_SUPPORT,s)})});const x=async p=>{if(p==null)return 0;if(Qa.isBlob(p))return p.size;if(Qa.isSpecCompliantForm(p))return(await new n(ed.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(Qa.isArrayBufferView(p)||Qa.isArrayBuffer(p))return p.byteLength;if(Qa.isURLSearchParams(p)&&(p=p+""),Qa.isString(p))return(await d(p)).byteLength},v=async(p,o)=>{const s=Qa.toFiniteNumber(p.getContentLength());return s??x(o)};return async p=>{let{url:o,method:s,data:f,signal:u,cancelToken:m,timeout:w,onDownloadProgress:_,onUploadProgress:T,responseType:V,headers:L,withCredentials:O="same-origin",fetchOptions:U}=dO(p),q=r||fetch;V=V?(V+"").toLowerCase():"text";let z=RCe([u,m&&m.toAbortSignal()],w),C=null;const N=z&&z.unsubscribe&&(()=>{z.unsubscribe()});let E;try{if(T&&l&&s!=="get"&&s!=="head"&&(E=await v(L,f))!==0){let X=new n(o,{method:"POST",body:f,duplex:"half"}),D;if(Qa.isFormData(f)&&(D=X.headers.get("content-type"))&&L.setContentType(D),X.body){const[Y,re]=sO(E,sx(lO(T)));f=pO(X.body,hO,Y,re)}}Qa.isString(O)||(O=O?"include":"omit");const k=y&&"credentials"in n.prototype,P={...U,signal:z,method:s.toUpperCase(),headers:L.normalize().toJSON(),body:f,duplex:"half",credentials:k?O:void 0};C=y&&new n(o,P);let F=await(y?q(C,U):q(o,P));const W=a&&(V==="stream"||V==="response");if(a&&(_||W&&N)){const X={};["status","statusText","headers"].forEach(G=>{X[G]=F[G]});const D=Qa.toFiniteNumber(F.headers.get("content-length")),[Y,re]=_&&sO(D,sx(lO(_),!0))||[];F=new b(pO(F.body,hO,Y,()=>{re&&re(),N&&N()}),X)}V=V||"text";let A=await S[Qa.findKey(S,V)||"text"](F,p);return!W&&N&&N(),await new Promise((X,D)=>{oO(X,D,{data:A,headers:Ad.from(F.headers),status:F.status,statusText:F.statusText,config:p,request:C})})}catch(k){throw N&&N(),k&&k.name==="TypeError"&&/Load failed|fetch/i.test(k.message)?Object.assign(new yo("Network Error",yo.ERR_NETWORK,p,C),{cause:k.cause||k}):yo.from(k,k&&k.code,p,C)}}},KCe=new Map,gO=e=>{let r=e&&e.env||{};const{fetch:n,Request:b,Response:R}=r,y=[b,R,n];let c=y.length,i=c,d,l,a=KCe;for(;i--;)d=y[i],l=a.get(d),l===void 0&&a.set(d,l=i?new Map:ACe(r)),a=l;return l};gO();const j_={http:uCe,xhr:PCe,fetch:{get:gO}};Qa.forEach(j_,(e,r)=>{if(e){try{Object.defineProperty(e,"name",{value:r})}catch{}Object.defineProperty(e,"adapterName",{value:r})}});const vO=e=>`- ${e}`,ICe=e=>Qa.isFunction(e)||e===null||e===!1;function XCe(e,r){e=Qa.isArray(e)?e:[e];const{length:n}=e;let b,R;const y={};for(let c=0;c<n;c++){b=e[c];let i;if(R=b,!ICe(b)&&(R=j_[(i=String(b)).toLowerCase()],R===void 0))throw new yo(`Unknown adapter '${i}'`);if(R&&(Qa.isFunction(R)||(R=R.get(r))))break;y[i||"#"+c]=R}if(!R){const c=Object.entries(y).map(([d,l])=>`adapter ${d} `+(l===!1?"is not supported by the environment":"is not available in the build"));let i=n?c.length>1?`since :
|
|
4134
4134
|
`+c.map(vO).join(`
|