PageSourceSearch

https://www.unsw.edu.au/etc.clientlibs/unsw-common/clientlibs/clie…/cmp-logo-display-8aaa47a07c0bb2aafbdb.js

js unsw.edu.au collected 2026-10-01 07:20:54 UTC 9,314 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkunsw_common_ui_frontend=self.webpackChunkunsw_common_ui_frontend||[]).push([[2750],{5261:(function(O,$,c){var b=c(2138),a=c(3889),C=c(3385),M=c(7083),e=c(5155),m=c(8221),h=c.n(m);class d extends b.A{constructor(l){super(),this.baseClass="cmp-logo-display",this.maximumHeight=634,this.$el=l,this.init(),this.onAemUpdate=()=>this.init()}setMaxHeight(){let l=0;Array.from(this.$el.querySelectorAll(`.${this.baseClass}__logos`)).forEach(r=>{const x=r.getBoundingClientRect().height;x>l&&(l=x)}),this.$el.style.setProperty("--max-carousel-height",`${Math.min(l,this.maximumHeight)}px`)}groupLogos(){const l=this.$el.dataset.logoSize;let o=4;if(l=="large"&&(o=4,window.innerWidth>600&&(o=6),window.innerWidth>960&&(o=8)),l=="medium"&&(o=6,window.innerWidth>600&&(o=12),window.innerWidth>960&&(o=12)),l=="small"&&(o=6,window.innerWidth>600&&(o=15),window.innerWidth>960&&(o=16)),o===this.logosPerSlide)return!1;this.logosPerSlide=o;const r=this.$el.querySelector(`.${this.baseClass}__logos-wrapper`);this.$clonedLogos&&(r.innerHTML="",r.appendChild(this.$clonedLogos.cloneNode(!0)));const x=Array.from(this.$el.querySelectorAll(`.${this.baseClass}__logo`)),p=Math.ceil(x.length/o),k=this.$el.querySelector(`.${this.baseClass}__logos`);this.$clonedLogos||(this.$clonedLogos=k.cloneNode(!0));for(let y=1;y<p;y++)r.appendChild(this.$clonedLogos.cloneNode(!0));return Array.from(this.$el.querySelectorAll(`.${this.baseClass}__logos`)).forEach((y,S)=>{const D=Array.from(y.querySelectorAll(`.${this.baseClass}__logo`)),I=S*o,R=I+o;D.forEach((T,E)=>{(E<I||E>=R)&&T.remove()})}),this.$el.dataset.slideCount=p.toString(),!0}initialiseCarousel(){this.swiper=new a.A(this.$el,{modules:[C.A,M.A,e.A],simulateTouch:!1,pagination:{clickable:!0,el:`.${this.baseClass}__pagination`,bulletElement:"button"},navigation:{nextEl:`.${this.baseClass}__button-next`,prevEl:`.${this.baseClass}__button-prev`}})}init(){if(this.swiper===void 0&&this.$el.dataset.displayType==="carousel"){this.groupLogos();const l=Array.from(this.$el.querySelectorAll(`.${this.baseClass}__logo__image`));let o=0;l.forEach(r=>{r.complete&&(o++,o===l.length&&this.setMaxHeight()),r.onload=()=>{o++,o===l.length&&this.setMaxHeight()}}),window.addEventListener("resize",h()(()=>{this.setMaxHeight(),this.groupLogos()&&(this.swiper.destroy(!0,!0),this.initialiseCarousel())},100)),this.initialiseCarousel()}}}document.querySelectorAll('[data-cmp-is="cmp-logo-display"]').forEach(v=>{new d(v)})}),2138:(function(O,$,c){c.d($,{A:function(){return b}});class b{constructor(){this.selector="",this.onAemUpdate=()=>{}}observe(){if(!this.selector)throw new Error("A selector needs to be assigned");const C=window.MutationObserver,M=document.querySelector("body");new C(m=>{m.forEach(h=>{const d=[].slice.call(h.addedNodes);d.length>0&&d.forEach(u=>{u instanceof Element&&u.matches(this.selector)&&this.onAemUpdate(u),u.querySelectorAll&&[].slice.call(u.querySelectorAll(this.selector)).forEach(l=>{this.onAemUpdate(l)})})})}).observe(M,{subtree:!0,childList:!0,characterData:!0})}}}),5155:(function(O,$,c){c.d($,{A:function(){return M}});var b=c(7643),a=c(7044);const C=e=>{var m;return!!e.virtual&&!!((m=e.params.virtual)!=null&&m.enabled)},M=({swiper:e,extendParams:m,on:h})=>{m({a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",slideLabelMessage:"{{index}} / {{slidesLength}}",containerMessage:null,containerRoleDescriptionMessage:null,containerRole:null,itemRoleDescriptionMessage:null,slideRole:"group",id:null,scrollOnFocus:!0,wrapperLiveRegion:!0}}),e.a11y={clicked:!1};let d=null,u=!1,v,l=new Date().getTime();function o(){return e.params.a11y}function r(t){const n=d;!n||!t||(0,a.w)(n,t)}function x(t=16){const n=()=>Math.round(16*Math.random()).toString(16);return"x".repeat(t).replace(/x/g,n)}function p(t){(0,a.s)(t).forEach(s=>{s.setAttribute("tabIndex","0")})}function k(t){(0,a.s)(t).forEach(s=>{s.setAttribute("tabIndex","-1")})}function _(t,n){(0,a.s)(t).forEach(i=>
1{i.setAttribute("role",n)})}function y(t,n){(0,a.s)(t).forEach(i=>{i.setAttribute("aria-roledescription",n)})}function S(t,n){(0,a.s)(t).forEach(i=>{i.setAttribute("aria-label",n)})}function D(t,n){(0,a.s)(t).forEach(i=>{i.setAttribute("id",n)})}function I(t,n){(0,a.s)(t).forEach(i=>{i.setAttribute("aria-live",n)})}function R(t){(0,a.s)(t).forEach(s=>{s.setAttribute("aria-disabled","true")})}function T(t){(0,a.s)(t).forEach(s=>{s.removeAttribute("aria-disabled")})}function E(t){if(t.keyCode!==13&&t.keyCode!==32)return;const n=o(),s=e.params.pagination,i=t.target;if(!(e.pagination&&e.pagination.el&&(i===e.pagination.el||e.pagination.el.contains(i))&&!i.matches((0,b.c)(s==null?void 0:s.bulletClass)))){if(e.navigation&&e.navigation.prevEl&&e.navigation.nextEl){const g=(0,a.s)(e.navigation.prevEl);(0,a.s)(e.navigation.nextEl).includes(i)&&(e.isEnd&&!e.params.loop||e.slideNext(),e.isEnd?r(n.lastSlideMessage):r(n.nextSlideMessage)),g.includes(i)&&(e.isBeginning&&!e.params.loop||e.slidePrev(),e.isBeginning?r(n.firstSlideMessage):r(n.prevSlideMessage))}e.pagination&&i.matches((0,b.c)(s==null?void 0:s.bulletClass))&&i.click()}}function z(){if(e.params.loop||e.params.rewind||!e.navigation)return;const{nextEl:t,prevEl:n}=e.navigation;n&&(e.isBeginning?(R(n),k(n)):(T(n),p(n))),t&&(e.isEnd?(R(t),k(t)):(T(t),p(t)))}function W(){return!!(e.pagination&&e.pagination.bullets&&e.pagination.bullets.length)}function B(){const t=e.params.pagination;return W()&&!!(t!=null&&t.clickable)}function V(){const t=o();if(!W())return;const n=e.params.pagination;e.pagination.bullets.forEach(s=>{var i;n.clickable&&(p(s),n.renderBullet||(_(s,"button"),S(s,t.paginationBulletMessage.replace(/\{\{index\}\}/,String(((i=(0,a.b)(s))!=null?i:0)+1))))),s.matches((0,b.c)(n.bulletActiveClass))?s.setAttribute("aria-current","true"):s.removeAttribute("aria-current")})}const H=(t,n,s)=>{p(t),t.tagName!=="BUTTON"&&(_(t,"button"),t.addEventListener("keydown",E)),S(t,s)},F=t=>{v&&v!==t.target&&!v.contains(t.target)&&(u=!0),e.a11y.clicked=!0},U=()=>{u=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.destroyed||(e.a11y.clicked=!1)})})},N=t=>{l=new Date().getTime()},q=t=>{const n=o();if(e.a11y.clicked||!n.scrollOnFocus||new Date().getTime()-l<100)return;const i=t.target.closest(`.${e.params.slideClass}, swiper-slide`);if(!i||!e.slides.includes(i))return;v=i;const g=C(e),A=(g?parseInt(i.getAttribute("data-swiper-slide-index")||"0",10):e.slides.indexOf(i))===e.activeIndex,L=e.params.watchSlidesProgress&&e.visibleSlides&&e.visibleSlides.includes(i);if(A||L)return;const f=t.sourceCapabilities;f&&f.firesTouchEvents||(e.isHorizontal()?e.el.scrollLeft=0:e.el.scrollTop=0,requestAnimationFrame(()=>{u||(e.params.loop?e.slideToLoop(e.getSlideIndexWhenGrid(parseInt(i.getAttribute("data-swiper-slide-index")||"0",10)),0):g?e.slideTo(e.getSlideIndexWhenGrid(parseInt(i.getAttribute("data-swiper-slide-index")||"0",10)),0):e.slideTo(e.getSlideIndexWhenGrid(e.slides.indexOf(i)),0),u=!1)}))},G=()=>{const t=o();t.itemRoleDescriptionMessage&&y(e.slides,t.itemRoleDescriptionMessage),t.slideRole&&_(e.slides,t.slideRole);const n=e.slides.length,s=t.slideLabelMessage;s&&e.slides.forEach((i,g)=>{const A=e.params.loop?parseInt(i.getAttribute("data-swiper-slide-index")||"0",10):g,L=s.replace(/\{\{index\}\}/,String(A+1)).replace(/\{\{slidesLength\}\}/,String(n));S(i,L)})},K=()=>{const t=o();d&&e.el.append(d);const n=e.el;t.containerRoleDescriptionMessage&&y(n,t.containerRoleDescriptionMessage),t.containerMessage&&S(n,t.containerMessage),t.containerRole&&_(n,t.containerRole);const s=e.wrapperEl,i=String(t.id||s.getAttribute("id")||`swiper-wrapper-${x(16)}`);if(D(s,i),t.wrapperLiveRegion){const f=e.params.autoplay,P=e.params.autoplay&&(f!=null&&f.enabled)?"off":"polite";I(s,P)}G();const g=e.navigation?e.navigation:{nextEl:void 0,prevEl:void 0},A=(0,a.s)(g.nextEl),L=(0,a.s)(g.prevEl);A&&A.forEach(f=>H(f,i,t.nextSlideMessage)),L&&L.forEach(f=>H(f,i,t.prevSlideMessage)),B()&&(0,a.s)(e.pagination.el).forEach(P=>{P.addEventListener("keydown",E)}),document.addEventListener("visibilitychange",N),e.el.addEventListener("focus",q,!0),e.el.addEventListener("pointerdown",F,!0),e.el.addEventListener("pointerup",U,!0)};function j(){d&&d.remove();const t=e.navigation?e.navigation:{nextEl:void 0,prevEl:void 0},n=(0,a.s)(t.nextEl),s=(0,a.s)(t.prevEl);
1n&&n.forEach(i=>i.removeEventListener("keydown",E)),s&&s.forEach(i=>i.removeEventListener("keydown",E)),B()&&(0,a.s)(e.pagination.el).forEach(g=>{g.removeEventListener("keydown",E)}),document.removeEventListener("visibilitychange",N),e.el&&typeof e.el!="string"&&(e.el.removeEventListener("focus",q,!0),e.el.removeEventListener("pointerdown",F,!0),e.el.removeEventListener("pointerup",U,!0))}h("beforeInit",()=>{d=(0,a.a)("span",o().notificationClass),d.setAttribute("aria-live","assertive"),d.setAttribute("aria-atomic","true")}),h("afterInit",()=>{o().enabled&&K()}),h("slidesLengthChange snapGridLengthChange slidesGridLengthChange",()=>{o().enabled&&G()}),h("fromEdge toEdge afterInit lock unlock",()=>{o().enabled&&z()}),h("paginationUpdate",()=>{o().enabled&&V()}),h("destroy",()=>{o().enabled&&j()})}})}]);

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.