PageSourceSearch

https://s3.elespanol.com/assets_js/web/v2/Gallery-NUU6B6UY.js

js elespanol.com collected 2026-09-24 09:10:23 UTC 18,737 bytes, 1 lines download raw bytes

1import{b as J}from"./chunk-QFP6S6VT.js";import{a as $}from"./chunk-CD4FICZE.js";import{a as Y,b as K}from"./chunk-DSHUOJOV.js";import"./chunk-RT2UEKQX.js";import"./chunk-VTC22NR5.js";import"./chunk-QD2YVZSD.js";import{d as q,g as X}from"./chunk-6IEOUFJJ.js";import"./chunk-FY2FBY5S.js";import"./chunk-PDTAGS5S.js";import{h as D,k as V,l as a,p,q as U,r as O,t as j}from"./chunk-PHTBXULL.js";import{a as W,c as l}from"./chunk-ZIYJVGPD.js";import{b as I,c as u,e as G}from"./chunk-VIVYENB4.js";import"./chunk-3HVXYCZN.js";import{a as T}from"./chunk-T6LYIDMV.js";import{b as B}from"./chunk-74EIPC4E.js";import{c as H}from"./chunk-YI2EV5SO.js";import{s as L,t as rt,u as h}from"./chunk-7WI4Z4JO.js";h();rt();h();h();h();h();var f=class extends W{constructor(t){super(t),this.position=0,this.id=0}};f.ON_UI_NAV_MOVE="onUINavMove";f.ON_UI_NAV_STATIC_CLICK_TOUCH="onUINavStatic";var c=class extends T{constructor(t,i){super(),this.id=t,this.long=i||0}notifyOnMoveTo(t,i=!1){this._dispatch(f.ON_UI_NAV_MOVE,t,i)}_dispatch(t,i,s){let n=new f(t);n.position=i,n.id=this.id,n.isAdPosition=s,this.dispatchEvent(n,!0)}notifyOnNoMove(t,i){this._dispatch(f.ON_UI_NAV_STATIC_CLICK_TOUCH,t,i)}};h();function Q(e,t,i,s){return e==s?t+i:i*(-Math.pow(2,-10*e/s)+1)+t}I("GALLERY");var k="GALLERY",x=class extends c{constructor(t,i,s,n=[],o){super(t,o);let r=t.split("_");this._id=r[1],this._container=i,this.wrapper=s,this.centered=!0,this._next=null,this._prev=null,this.elements=n,this._step=1,this.startIndex=1,this.position=this.startIndex,this._gap=0,this._limit=1,this._disabled=!1,this._loader=null,this._fitToWrapper=null,this._firstChild=null,this._allowTransformation3D=H("transform -webkit-transform -ms-transform -moz-transform"),this._side=0,this.roundIndex=[],this._isInfinite=!1,this._isInitialized=!1,this._widthList=0,this._currentOffset=0,this._adPos=[],this._automatic=!1,this._type=null,this.long=o,this._long=o,this._fitToHeight=!1,this._enableTracking=!1,this._pauseElement=null,this._playElement=null,this._closeElement=null,this._timer=null,this._timerInterval=7*1e3,this._realPosition=0,this._lastX=0,this._dragMoveX=0,this._dragMoveY=0,this._flagTracking=!1,this._freeze=!1}setFreeze(t){return this._freeze=t,this}getFreeze(){return this._freeze}isPlaying(){return V(this._pauseElement)}setFlagTracking(t){return this._flagTracking=t,this}getFlagTracking(){return this._flagTracking}static ease(t){return t=--t*t*t+1,t=Math.max(0,t),t=Math.min(1,t),t}getRealPosition(){return this._realPosition}setCloseElement(t){return this._closeElement=t,this}setPauseElement(t){return this._pauseElement=t,this}setPlayElement(t){return this._playElement=t,this}setStatusTracking(t){return this._enableTracking=t,this}getStatusTracking(){return this._enableTracking}startAutomatic(){this._automatic&&(this._timer||(this._timer=new K(this._timerInterval),l(this._timer,Y.ON_TM_TIMER,this._onTimerAutoGallery,this)),(!this._freeze||!this.isPlaying())&&(a(this._pauseElement,!0),a(this._playElement,!1)),this._timer.start())}stopAutomatic(){this._timer&&this._automatic&&(this._freeze||(a(this._pauseElement,!1),a(this._playElement,!0)),this._timer.stop())}_onTimerAutoGallery(){let t=this.getPosition(),i=this.long;this._isInfinite?this.next():t===i?(this.position=1,this.direct(this.position)):this.next()}isAdPosition(t){let i=!1;for(let s=0;s<this._adPos.length;s++)t==this._adPos[s]&&(i=!0);return i}getAdPosElements(){return this._adPos}getPosition(){return this.position}setType(t){return this._type=t,this}getType(){return this._type}fitToHeight(t){return this._fitToHeight=t,this}setAnimationOffset(t){if(X&&U(this._container)){let m=function(d){i||(i=d);let y=d-i,w=Math.min(y,n)/n*(t-_)+_,E=Q(y,0,t-_,n);s.style.transform="translate3d("+(E+_)+"px, 0, 0)",y<n?window.requestAnimationFrame(m):p(s,!0)};p(this._container,!1),function(){var d=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;window.requestAnimationFrame=d}();let i=null,s=this._container,n=300,o=Math.sign(t),r=Math.abs(t),_=this._currentOffset;window.requestAnimationFrame(m)}else this._container.style.transitionTimingFunction="cubic-bezier(0.5,0.25,
10,1)",this._container.style.transform="translate3d("+t+"px,0,0)",this._allowTransformation3D||(this._container.style.marginLeft=t+"px");this._currentOffset=t}getLong(){return this.long}setAutomatic(t){return this._automatic=t,this}getElements(){return this.elements}setCentered(t){return this.centered=t,this}addAdPosition(t,i){this._adPos[t]=i}setStep(t=1){return this._step=t,this}setInfinite(t){return this._isInfinite=t,this}setStartIndex(t=1){return this.startIndex=t,this.position=this.startIndex,this}setLoader(t){return this._loader=t,this}fitToWrapper(t){return this._fitToWrapper=t,this}setNextElement(t){return this._next=t,this}setPrevElement(t){return this._prev=t,this}init(){}disableNextPrev(){a(this._next,!1),this._next=void 0,a(this._prev,!1),this._prev=void 0}next(){u(["jeef.ui.nav.Gallery>next>","Avanzado posiciones dependiendo del n\xFAmero de steps y del ancho de pantalla ... "],k);let t;this._isInfinite?t=this.position+this._step:(this.position+=this._step,t=this.position>this.long?this.long:this.position),this._directGoto(t)}prev(){u(["jeef.ui.nav.Gallery>prev>","Retrasamos posiciones dependiendo del n\xFAmero de steps y del ancho de pantalla ... "],k);let t;this._isInfinite?t=this.position-this._step:(this.position-=this._step,t=this.position<=0?1:this.position),this._directGoto(t)}direct(t){u(["jeef.ui.nav.Gallery>direct>","Avanzando hacia la siguiente posici\xF3n del listado de elementos de la galer\xEDa: "+t],k),this.position=t,this._directGoto(t)}_directGoto(t){}isRunning(){return this._timer?this._timer.running():!1}reCalculate(){}disable(){this._disabled=!0}enable(){this._disabled=!1}};h();function Z(e){return e>0?1:e<0?-1:0}I("GALLERY");var ht="GALLERY",g=class extends x{constructor(t,i,s,n,o){super(t,i,s,n,o),this._fullGaps=[],this._steps=[],this._startDragPosition=0,this._downOffset=0,this._downTimestamp=0,this._dragging=!1,this._preventClick=!1,this._BORDER_PROP_OFFSET=.15,this._twoFinger=!1,this.maxHeightElementGallery=0}init(){p(this._container,!1),this._firstChild=this.elements[this.startIndex-1],tt.apply(this),v.apply(this,[this.position]),setTimeout(()=>{p(this._container,!0)},0),this._makeInfiniteAbsoluteItems(),this._isInitialized=!0,this._listenUIEvents(),this.startAutomatic()}middleAutoStart(t,i){this.setFreeze(!0),this.stopAutomatic(),t.apply(this,i),this.startAutomatic(),this.setFreeze(!1)}_listenUIEvents(){l(this.wrapper,"touchstart",ft,this),l(this.wrapper,"touchend",st,this),l(this.wrapper,"touchmove",_t,this),l(this.wrapper,"click",pt,this);let t=this.wrapper.querySelectorAll("img"),i=[];for(let s=0;s<t.length;s++){let n=new Promise(o=>{t[s].complete?o(!0):t[s].addEventListener("load",()=>{o(!0)})});i.push(n)}Promise.all(i).then(s=>{let n=[];t.forEach(o=>{n.push(o.parentNode.parentNode.parentNode.parentNode.offsetHeight)}),this.maxHeightElementGallery=Math.max(...n),this._makeInfiniteAbsoluteItems()})}_directGoto(t){v.apply(this,[t])}reCalculate(){if(u(["jeef.ui.nav.Gallery>reCalculate>"],ht),!et()&&!this._twoFingers){this._enableTracking=!1;let t=this._step;p(this._container,!1),this._isInfinite&&this._quitInfiniteAbsoluteItems(),tt.apply(this),ut.apply(this,[t]),this._enableTracking=!0,p(this._container,!0)}}_makeInfiniteAbsoluteItems(){this._isInfinite&&(dt.apply(this),this.wrapper.style.height=this.maxHeightElementGallery+"px")}_quitInfiniteAbsoluteItems(){if(this._isInfinite){this.position=it.apply(this);for(let t=0;t<this.elements.length;t++)this.elements[t].style.position="static",this.elements[t].style.left=""}}},lt=function(e){this._twoFingers=e.native.touches.length>1},et=function(){return window.visualViewport&&window.visualViewport.scale>1},it=function(e=!1){let t=this._step;e||(t=0);let i=(this.position-t)/this.long,s=this.position;return this.position<=0?(s=this.position+this.long*Math.max(1,Math.trunc(Math.abs(i))),i<-1&&s<0?s=-Math.abs(s)+this.long:s===0&&(s=this.long)):i>=1&&(s=this.position-this.long*Math.trunc(i)),s},ft=function(e){lt.apply(this,[e]),this._dragging||(this._startDragPosition=this.position,this._downTimestamp=Date.now(),this._downOffset=this._currentOffset,this._dragging=!0,this._lastX=e.native.changedTouches[0].pageX,this._dragMoveX=e.native.changedTouches[0].pageX,this._dragMoveY=e.n
1ative.changedTouches[0].pageY,p(this._container,!1))},pt=function(e){if(this._preventClick)return this._preventClick=!1,!1},_t=function(e){if(this.wrapper.offsetWidth<this._widthList&&this._dragging){this.setFreeze(!0),this.stopAutomatic();let t=this._downOffset+(e.native.changedTouches[0].pageX-this._lastX),i=t,s,n,o=Math.abs(this._dragMoveX-e.native.changedTouches[0].pageX),r=Math.abs(this._dragMoveY-e.native.changedTouches[0].pageY);if(o>=r&&!et()&&!this._twoFingers)return this._isInfinite||(t>0&&(s=t/this.wrapper.offsetWidth,s=g.ease(s),i=this._gap*s*this._BORDER_PROP_OFFSET),n=-this._widthList+this.wrapper.offsetWidth,t<n&&(s=(t-n)/-this._gap,s=g.ease(s),i=n-this._gap*s*this._BORDER_PROP_OFFSET)),this.setAnimationOffset(i),!1;st.apply(this,arguments)}},st=function(e){if(this._dragging){let t,i=Z(this._downOffset-this._currentOffset),s=(Date.now()-this._downTimestamp)/1e3,n=Math.abs(this._downOffset-this._currentOffset),o=e.native.changedTouches[0].pageX,r=n/s;t=Math.round((this._currentOffset-this._side)/-this._gap)+1,r>window.innerWidth*.5&&t==this._startDragPosition&&(t+=1*i),p(this._container,!0),this._dragging=!1,n===0?this.centered&&(this._preventClick=!1,o<this.wrapper.getBoundingClientRect().left+this._side&&(this.prev(),this.startAutomatic(),this.setFreeze(!1),this._preventClick=!0),o>this.wrapper.getBoundingClientRect().right-this._side?(this.next(),this.startAutomatic(),this.setFreeze(!1),this._preventClick=!0):this._freeze||this.notifyOnNoMove(this.getPosition(),!1)):(this._preventClick=!0,v.apply(this,[t]),this.startAutomatic(),this.setFreeze(!1))}},ut=function(e){if(!this._isInfinite)this._step!==e&&this.position%this._step===0&&(this.position=this.position-this._step+1),v.apply(this,[this.position]);else{let t=this.position;this._enableTracking=!1,v.apply(this,[this.startIndex]),this._makeInfiniteAbsoluteItems(),this._enableTracking=!0,v.apply(this,[t])}},dt=function(){let e=this.elements[0].parentNode,t=parseInt(document.defaultView.getComputedStyle(this._firstChild,"").marginRight),i=0,s=0;for(e.style.position="relative",e.style.minHeight="205px",s;i<this.elements.length;i++)this.elements[i].style.position="absolute",this.elements[i].style.top="0",this.elements[i].style.left=s+"px",s+=this.elements[0].offsetWidth+t;for(i=0;i<this.long;i++)this.roundIndex[i]=i},ct=function(e){a(this._next,e),a(this._prev,e)},gt=function(e){let t=0;for(this._gap=this.wrapper.offsetWidth;t<e;t++)this.elements[t].style.width=this._gap+"px";this._widthList=this.wrapper.offsetWidth*e},mt=function(e,t){let i=this.roundIndex.length/2,s;i=Math.round(i);let n=e-i,o=this.position-i;for(;o<=n;o++)for(s=0;s<this.roundIndex.length;s++)this.roundIndex[s]===o&&(this.roundIndex[s]+=this.long,this.elements[s].style.left=(this.elements[0].offsetWidth+t)*(o+this.long)+"px")},yt=function(e,t){let i=this.roundIndex.length-2,s=e+i,n=this.position+i;for(;n>=s;n--)for(let o=0;o<this.roundIndex.length;o++)this.roundIndex[o]===n&&(this.roundIndex[o]-=this.long,this.elements[o].style.left=(this.elements[0].offsetWidth+t)*(n-this.long)+"px")},wt=function(e){let t=parseInt(document.defaultView.getComputedStyle(this._firstChild,"").marginRight);e>this.position?mt.apply(this,[e,t]):e<this.position&&yt.apply(this,[e,t])},It=function(e){let t=parseInt(document.defaultView.getComputedStyle(this._firstChild,"").marginRight),i=0,s=0;for(;s<e;s++)i+=this.elements[s].getBoundingClientRect().width+t;return this._widthList=i-t,this._gap=this._firstChild.offsetWidth+t,this.centered&&(this._side=(this.wrapper.offsetWidth%this._gap+t)*.5),t},vt=function(){(this._limit>=this.elements.length||this._widthList<this.wrapper.offsetWidth)&&(this.disable.apply(this),this._isInfinite||ct.apply(this,[!1]))};var tt=function(){let e=this.elements.length,t=0;a(this._loader,!0),this._fitToWrapper?gt.apply(this,[e]):t=It.apply(this,[e]),this._limit=1,this._limit=Math.floor((this.wrapper.offsetWidth+t)/this._gap),this._step>this._limit&&(this._step=this._limit),vt.apply(this),a(this._loader,!1),a(this._container,!0)},v=function(e){if(!this._disabled){let t=Tt.apply(this,[e]),i=bt.apply(this,[t]),s;wt.apply(this,[t]),s=-(this._gap*(t-1))+i,this._isInfinite||(s=Math.max(s,-this._widthList+this.wrapper.offsetWidth)),this.position=t,this.setAnimationOffset(s),Et.apply(this,[t]);let n=this.position,o=!1;if(this._isInfinite){let r=At.apply(this);n=r[0],this._realPosition=n,o=r[1]}this.notifyOnMoveTo(n,o)}},xt=function(e){let t,i=!1,s=0;for(let n=0;n<e;n++)for(let o=0;o<this._adPos.length;o++)n===this._adPos[o]&&s++,e-this._step===this._adPos[o]&&(i=!0);return t=e-s,Math.max(0,t),[t,i]},At=function(){let e=it.apply(this,[!0]);return xt.apply(this,[e])},Et=function(e){this._next&&this._prev&&(a(this._next,!0),a(this._prev,!0),this._isInfinite||(e>=this.long-this._limit+1&&a(this._next,!1),e===1&&a(this._prev,!1)))},Tt=function(e){let t;return t=e,this._isInfinite||(t=Math.min(e,nt.apply(this)),t=Math.min(e,this.long),t=Math.max(1,t)),t},nt=function(){return this.long-this._limit+1},bt=function(e){let t;return t=e===1?0:this._side,t=e===nt.apply(this)?this._side*2:t,t};h();var A=class extends c{constructor(t,i,s){let n=i||[];super(t,n.length),this._elements=n,this._position=s||1}next(){this._position<this._elements.length&&C.apply(this,[this._position+1])}prev(){this._position>1&&C.apply(this,[this._position-1])}direct(t){t>0&&t<=this._elements.length&&C.apply(this,[t])}},C=function(e){this._position=e;let t=0;for(t;t<this._elements.length;t++)a(this._elements[t],t+1==this._position);this.notifyOnMoveTo(this._position)};var F="INT/GAL";I(F);B("jeeiSite.ui.Gallery");var b=null,P=class e extends T{constructor(){super(),this._galleries={},this._adPos=[],this._trackingPosition=!1,this.outherWidth=window.outerWidth,this.outherHeight=window.outerHeight,this.flagFirstResize=!0}
1static getInstance(){return b||(b=new e,Mt.apply(b)),b}getGallery(t){return this._galleries[t]}registerElement(t,i){u(["jeeiSite.ui.Gallery>registerElement> ",t,i],F);let s=document.getElementById(t),n,o,r,_=[],m,d,y,w,E,S,R=!1,N=!1,z=!1,M=!1;if(s&&s.getAttribute("data-type")==="gallery"){for(M=s.getAttribute("data-subtype"),o=s.id.replace("gallery_",""),r=parseInt(i||s.getAttribute("data-long")||0),m=parseInt(s.getAttribute("data-start"))||1,R=s.getAttribute("data-automatic")||!1,N=s.getAttribute("data-infinite")||!1,d=document.getElementById("gallery_list_"+o),y=document.getElementById("gallery_wrapper_"+o),E=document.getElementById("gallery_loader_"+o),S=s?s.getAttribute("data-fit")=="true":!1,z=s.getAttribute("data-fitheight")||!1,w=0;w<r;w++)_[w]=document.getElementById("gallery_element_"+(w+1)+"_"+o);if(r&&_.length){switch(M){case"toggle":n=new A(o,_,m),l(n,f.ON_UI_NAV_MOVE,at,this);break;case"kinetic":case"horizontal":case"fullHorizontal":default:n=new g(o,d,y,_,r),n.setType(M).setCentered(q).setStep().setStep(parseInt(s.getAttribute("data-step"))).setInfinite(N).setLoader(E).fitToHeight(z).setNextElement(document.getElementById("gallery_next_"+o)).setCloseElement(document.getElementById("gallery_close_"+o)).setPrevElement(document.getElementById("gallery_prev_"+o)).setPauseElement(document.getElementById("gallery_pause_"+o)).setPlayElement(document.getElementById("gallery_play_"+o)).setStartIndex(m).fitToWrapper(S).setAutomatic(R).setFlagTracking(!1).init(),Pt.apply(this,[n]),l(n,f.ON_UI_NAV_MOVE,at,this);break}this._galleries[t]=n}return n}else return!1}},Pt=function(e){let t,i,s=e.getLong();for(t=0,i=0;i<s;i++)e.getElements()[i].querySelector('[id*="robagaleria"]')&&(e.addAdPosition(t,i),t++)},Mt=function(){l(window,"ready",()=>{this.outherWidth=window.outerWidth,this.outherHeight=window.outerHeight},this),l(document,"click",Ot,this),l(window,"resize",ot,this),l(window,"orientationchange",ot,this)},ot=function(e){if(this.flagFirstResize||this.outherWidth!==window.outerWidth||this.outherHeight!==window.outerHeight){this.flagFirstResize=!1,console.log("_onResize  -----> ");let t=0;for(t in this._galleries)this._galleries[t].reCalculate()}},Ot=function(e){let t=j("data-type",e.target,window.document),i=t?D(t[0]):null,s,n;try{n=this.getGallery(i[0].id)}catch(o){}switch(t[1]){case"prev":n.middleAutoStart(n.prev),e.native.preventDefault();break;case"next":n.middleAutoStart(n.next),e.native.preventDefault();break;case"nav":s=parseInt(t[0].getAttribute("data-value")),n.middleAutoStart(n.direct,[s]),e.native.preventDefault();break;case"pause":n.stopAutomatic(),e.native.preventDefault();break;case"play":n.startAutomatic(),e.native.preventDefault();break}},at=function(e){let t=Ft(e.target.long,e.position);Ct(e.id,e.target.long,t),St.apply(this,[e.id,e.target.long,t,e.isAdPosition]),kt.apply(this,[e.target,t,e.isAdPosition]),this.dispatchEvent(e)},kt=function(e,t,i){e.getFlagTracking()&&e.getStatusTracking()&&t!==this._trackingPosition&&!i&&(this._trackingPosition=t,window.location.hash="",history.pushState({},document.title,"".concat(window.location.href.replace("#",""),"#img_").concat(t)),$.getInstance().pageView(window.location.href.replace(window.location.protocol+"//www"+L.subDomain,"")),J.getInstance().pageViewCandidate()),i&&(this._trackingPosition=null)},Ct=function(e,t,i){let s,n;for(n=1;n<=t;n++)try{s=document.getElementById("gallery_bullet_"+n+"_"+e),s.setAttribute("data-action","toggle"),s!==null&&n===i?s.setAttribute("data-status","on"):s.setAttribute("data-status","off")}catch(o){G(["_updateBullets>_updateBullets> No se encontraron bullets para ",e],F);break}},Ft=function(e,t){let i=t;if(t>e)i=t/e,i=Math.trunc(i),i=i*e,i=t-i;else if(i<0){i=t/e,i=Math.trunc(i),i=i*e,i=t-i,i=Math.abs(i);let s=[],n,o;for(n=0,o=e;n<e;n++,o--)s[n]=o;i=s[i]}return i===0&&(i=e),i},St=function(e,t,i,s){let n=i,o=t-this._galleries["gallery_"+e].getAdPosElements().length,r=n.toString()+' de <a href="#" data-value="'+t+'" data-type="nav" data-target="gallery_'+e+'">'+t+"</a>";this._galleries["gallery_"+e].getType()==="fullHorizontal"&&(r=n.toString()+" de "+o),document.getElementById("gallery_indicator_"+e)!==null&&(document.getElementById("gallery_indicator_"+e).innerHTML=r),O(d
1ocument.getElementById("gallery_indicator_"+e),""),s&&(document.getElementById("gallery_indicator_"+e).innerHTML=r,O(document.getElementById("gallery_indicator_"+e),"ad"),window.location.hash="")};window.jeeiSite.ui.Gallery=P;export{P as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.