PageSourceSearch

https://webeco.nait.ca/_nuxt/FqFeEh1p.js

js nait.ca collected 2026-10-02 04:14:00 UTC 7,215 bytes, 1 lines download raw bytes

1import{S as y}from"./7JICTxpt.js";import{S as w}from"./CIRx1xN5.js";import{_ as v,o,f as b,b as S,h as x,d as r,C as u,c as a,t as g,s as c,a as d,Z as C,A as T}from"./-1zjGLeH.js";const k={components:{SimpleButton:y,Section:w},data(){return{currentIndex:0,containerWidth:0,tileWidth:0,leftOffset:0,tileGap:44,retryCount:0,maxRetries:5,disableScroll:!1,dimensionsReady:!1,totalTiles:0,slotObserver:null}},props:{heading:{type:String},headingClass:{type:String},backgroundColor:{type:String},description:{type:String,default:null},descriptionClass:{type:String,default:null}},computed:{trackStyle(){return{transform:`translateX(-${this.currentIndex*(this.tileWidth+this.tileGap)}px)`,"--left-offset":`${this.leftOffset}px`}},getTextClasses(){switch(this.backgroundColor){case"blue":case"purple":case"dark blue":return{button:"secondaryWhite",heading:"text-white"};case"yellow":return{button:"primaryBlue",heading:""};default:return{heading:"",button:"grey"}}},totalTrackWidth(){return!this.dimensionsReady||this.totalTiles===0?0:this.totalTiles*this.tileWidth+(this.totalTiles-1)*this.tileGap+this.leftOffset},tilesPerView(){if(!this.dimensionsReady)return 1;const i=this.containerWidth-this.leftOffset;return Math.floor((i+this.tileGap)/(this.tileWidth+this.tileGap))},maxScrollIndex(){return Math.max(0,this.totalTiles-this.tilesPerView)}},methods:{initTouchEvents(){this.$refs.sliderTrack.addEventListener("touchstart",this.onTouchStart,{passive:!0}),this.$refs.sliderTrack.addEventListener("touchmove",this.onTouchMove,{passive:!0}),this.$refs.sliderTrack.addEventListener("touchend",this.onTouchEnd,{passive:!0})},onTouchStart(i){this.touchStartX=i.touches[0].clientX},onTouchMove(i){this.touchEndX=i.touches[0].clientX},onTouchEnd(){this.touchStartX-this.touchEndX>50&&this.scrollRight(),this.touchStartX-this.touchEndX<-50&&this.scrollLeft()},initKeyboardNavigation(){this.$refs.sliderContainer.addEventListener("keydown",this.onKeyDown)},onKeyDown(i){i.key==="ArrowLeft"?this.scrollLeft():i.key==="ArrowRight"&&this.scrollRight()},canScrollLeft(){return!this.dimensionsReady||this.disableScroll?!1:this.currentIndex>0},canScrollRight(){return!this.dimensionsReady||this.disableScroll?!1:this.currentIndex<this.maxScrollIndex},scrollLeft(){this.canScrollLeft()&&(this.currentIndex-=1)},scrollRight(){this.canScrollRight()&&(this.currentIndex+=1)},setDimensions(){const i=this.$refs.sliderContainer,h=this.$refs.contentContainer,s=this.$refs.sliderTrack;if(!i||!h||!s){this.dimensionsReady=!1;return}this.tileGap=window.innerWidth<768?32:44;const n=s.children;if(this.totalTiles=n.length,this.totalTiles===0){this.dimensionsReady=!1;return}Array.from(n).forEach(t=>{t.style.width="",t.style.maxWidth="",t.style.marginRight=""});const l=n[0];if(!l||l.getBoundingClientRect().width===0){this.retryCount<=this.maxRetries?(this.retryCount++,setTimeout(()=>this.setDimensions(),200)):(console.warn("MediaSlider: Max retries reached. Unable to calculate dimensions."),this.dimensionsReady=!1);return}this.retryCount=0,i.offsetHeight,this.containerWidth=i.offsetWidth,this.tileWidth=l.getBoundingClientRect().width,this.leftOffset=h.getBoundingClientRect().left,s.style.setProperty("--left-offset",`${this.leftOffset}px`);const e=window.innerWidth<=1024;if(this.disableScroll=this.totalTiles===1&&e||this.totalTiles<=this.tilesPerView,this.currentIndex>this.maxScrollIndex&&(this.currentIndex=this.maxScrollIndex),n.length===1&&n[0]){const t=n[0];if(e){const f=`${this.leftOffset}px`,m=`calc(100% - ${this.leftOffset*2}px)`;t.style.marginRight=f,t.style.width=m,t.style.maxWidth=m}else t.style.width="",t.style.maxWidth="",t.style.marginRight=""}this.$nextTick(()=>{this.dimensionsReady=!0})},observeSlotChanges(){this.$refs.sliderTrack&&(this.slotObserver?.disconnect(),this.slotObserver=new MutationObserver(()=>{this.setDimensions()}),this.slotObserver.observe(this.$refs.sliderTrack,{childList:!0}))}},watch:{"$slots.default"(){this.setDimensions()}},mounted(){this.$nextTick(()=>{typeof window<"u"&&"ontouchstart"in window&&this.initTouchEvents(),this.initKeyboardNavigation(),requestAnimationFrame(()=>{this.setDimensions(),this.observeSlotChanges()})}),window.addEventListener("resize",this.setDimensions)},beforeUnmount(){window.removeEventListener("load",this.setDimensions),window.removeEventListener("resize",this.setDimensions),typeof window<"u"&&"ontouchstart"in window&&(this.$refs.sliderTrack.removeEventListener("touchstart",this.onTouchStart),this.$refs.sliderTrack.removeEventListener("touchmove",this.onTouchMove),this.$refs.sliderTrack.removeEventListener("touchend",this.onTouchEnd)),this.$refs.sliderContainer.removeEventListener("keydown",this.onKeyDown),this.slotObserver?.disconnect()}},p={ref:"contentContainer",class:"mx-6 sm:mx-8 md:mx-11 lg:mx-14 xl:mx-16 min-[1528px]:mx-auto max-w-[1400px] h-1"},R={key:2,class:"flex justify-between w-20 mb-4"},L={ref:"mediaSlider",class:"relative w-full"},_={key:0,class:"mx-6 sm:mx-8 md:mx-11 lg:mx-14 xl:mx-16 min-[1528px]:mx-auto max-w-[1400px] flex justify-end mb-2"},E={class:"flex justify-between w-20 mb-4"},O={ref:"sliderContainer",class:"slider-container overflow-hidden flex-1",tabindex:"0"};function W(i,h,s,n,l,e){const t=x("SimpleButton"),f=x("Section");return o(),b(f,{"remove-container":!0,"background-color":s.backgroundColor,class:"media-slider"},{default:S(()=>[r("div",p,null,512),r("div",{class:u(["mx-6 sm:mx-8 md:mx-11 lg:mx-14 xl:mx-16 min-[1528px]:mx-auto max-w-[1400px] mb-2",s.description?null:"flex justify-between gap-4 items-center"])},[s.heading?(o(),a("h2",{key:0,class:u(["heading-two",[s.headingClass,e.getTextClasses.heading]])},g(s.heading),3)):c("",!0),s.description?(o(),a("p",{key:1,class:u(["mt-1",s.descriptionClass,e.getTextClasses.heading])},g(s.description),3)):c("",!0),!s.description&&!l.disableScroll&&(e.canScrollLeft()||e.canScrollRight())?(o(),a("div",R,[d(t,{"is-disabled":!e.canScrollLeft(),type:"action",design:"iconOnly",colour:e.getTextClasses.button,"icon-class":"fa-solid fa-caret-left",size:"small",text:"Previous",onClick:e.scrollLeft},null,8,["is-disabled","colour","onClick"]),d(t,{"is-disabled":!e.canScrollRight(),type:"action",design:"iconOnly",colour:e.getTextClasses.button,"icon-class":"fa-solid fa-caret-right",size:"small",text:"Next",onClick:e.scrollRight},null,8,["is-disabled","colour","onClick"])])):c("",!0)],2),r("div",L,[s.description&&!l.disableScroll&&(e.canScrollLeft()||e.canScrollRight())?(o(),a("div",_,[r("div",E,[d(t,{"is-disabled":!e.canScrollLeft(),type:"action",design:"iconOnly",colour:e.getTextClasses.button,"icon-class":"fa-solid fa-caret-left",size:"small",text:"Previous",onClick:e.scrollLeft},null,8,["is-disabled","colour","onClick"]),d(t,{"is-disabled":!e.canScrollRight(),type:"action",design:"iconOnly",colour:e.getTextClasses.button,"icon-class":"fa-solid fa-caret-right",size:"small",text:"Next",onClick:e.scrollRight},null,8,["is-disabled","colour","onClick"])])])):c("",!0),r("div",O,[r("div",{ref:"sliderTrack",class:"slider-track flex transition-transform duration-300 ease-in-out whitespace-nowrap gap-8 sm:gap-11",style:C(e.trackStyle)},[T(i.$slots,"default")],4)],512)],512)]),_:3},8,["background-color"])}const M=v(k,[["render",W]]);export{M};

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.