PageSourceSearch

https://www.unsw.edu.au/etc.clientlibs/unsw-common/clientlibs/clie…/publication-search-197d29e273082a815038.js

js unsw.edu.au collected 2026-10-01 07:21:47 UTC 15,604 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkunsw_common_ui_frontend=self.webpackChunkunsw_common_ui_frontend||[]).push([[5207],{8789:(function(G,W,f){f.d(W,{d:function(){return A},q:function(){return n}});function n(E,P,T){const{term:p,type:o}=H(E,P);window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer.push({event:"search",pageinfo:{...window.unswAepData.pageinfo},searchinfo:{searchterm:p,searchtype:o,totalresults:T},userInfo:{...window.unswAepData.userinfo}})}function A(E,P,T,p,o,i){const{term:c,type:u}=H(E,P);window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer.push({event:"searchresultclickthrough",pageinfo:{...window.unswAepData.pageinfo},searchinfo:{searchterm:c,searchtype:u,totalresults:T,searchresultclicked:p,searchresultclickedURL:o,searchresultclickedrank:i},userInfo:{...window.unswAepData.userinfo}})}function H(E,P){return{term:E==="!padrenull"||!E?"":E,type:P==="test-search"?"ndarc-resources":P}}}),3400:(function(G,W,f){f.d(W,{PG:function(){return p},SC:function(){return P},UE:function(){return H},pp:function(){return E}});const n=/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,A=["January","February","March","April","May","June","July","August","September","October","November","December"],H=o=>o.split(" ").map(i=>n.test(i)?`<a href="${i}">${i} </a>`:i).join(" "),E=(o=null,i="article")=>{const c=new Date;let u=o!==null?new Date(o.replace("T"," ")):void 0,D="";if(o!==null&&(u===void 0||isNaN(u.getTime()))){let l=o.split(" "),k=A.indexOf(l[1]);k===-1&&(k=A.indexOf(A.filter(y=>l[1]===y.substring(0,3))[0])),k!==-1&&k!==void 0&&(u=new Date(`${l[2]}/${(void 0).addLeadingZero(k+1)}/${(void 0).addLeadingZero(l[0])}`))}if(u&&!isNaN(u.getTime())){if(i==="news")D=`${A[u.getMonth()]} ${u.getDate()}, ${u.getFullYear()}`;else{let l=(c.getTime()-u.getTime())/1e3;l<3600?D=`${Math.ceil(l/60)} minutes ago`:l<3600*24?D=`${Math.ceil(l/60/60)} hours ago`:l<3600*48?D="Yesterday":D=`${u.getDate()} ${A[u.getMonth()]} ${u.getFullYear()}`}return D}else return o||""},P=(o="",i=750)=>{const c=o.substring(0,Math.min(i,o.length)),u=c.lastIndexOf(" ");return u===-1?c:c.substring(0,u)},T=o=>new DOMParser().parseFromString(o,"text/html").documentElement.textContent,p=(o,i)=>{const c=y=>y.replace(/\s*\|\s*/g," | "),u=o?`${c(o)}. ${c(o)}.`:"",D=o?`${c(o)}.`:"";let l=T(i||"");const k=y=>
1y.trim().replace(/[^\p{L}\p{N}]+/gu," ").toLowerCase();if(k(i).startsWith(k(u))?l=l.slice(u.length).replace(/^[^\p{L}\p{N}]+/u,""):k(i).startsWith(k(D))&&(l=l.slice(D.length).replace(/^[^\p{L}\p{N}]+/u,"")),l.includes("Published on")){const y=l.indexOf("Published on"),M=l.indexOf(".",y);M!==-1&&(l=l.slice(0,y)+l.slice(M+1),l=l.replace(/\s{2,}/g," "))}return l}}),9022:(function(G,W,f){var n=f(6540),A=f(4863),H=f(2068),E=f(9638);class P extends n.Component{render(){const{activeFilters:p,config:o,query:i,results:c,setSort:u,sortOptions:D,toggleSort:l,searching:k,total:y,hideSort:M,noResultsMessage:R,forceResultsTitle:Q,clearFiltersInMeta:X,resultsVisible:z,hasSubmitButton:ee}=this.props,{resultsPath:K,text:J}=o,{filterSingle:S,filterPlural:d,noResults:U,hasResults:F,showingResults:L,showingNoResults:x,sortLabel:q}=J;let te=c.length>0&&L?L.replace(/%x/,c.length).replace(/%y/,y):x,v="",Z;const V=i.replace(/[\[\]"\\]/g,"");if(K!=="")return null;switch(!0){case Q!==void 0:v=Q;break;case k:v="Searching...";break;case(c.length>0&&i!==""&&p===1):v=`${F} "${V}" + ${p} ${S}`;break;case(c.length>0&&i!==""&&p>1):v=`${F} "${V}" + ${p} ${d}`;break;case(c.length>0&&i!==""):v=`${F} "${V}"`;break;case(c.length>0&&i===""&&p===1):v=`${F} ${p} ${S}`;break;case(c.length>0&&i===""&&p>1):v=`${F} ${p} ${d}`;break;case(c.length===0&&i===""&&p===1):v=`${U} ${p} ${S}`;break;case(c.length===0&&i===""&&p>1):v=`${U} ${p} ${d}`;break;case(c.length===0&&i!==""):v=`${U} "${V}"`;break;case(c.length!==0&&i===""&&R&&R!==""):v=R;break;default:v=x}return M||(Z=n.createElement(A.A,{...this.props,...D,className:"sort",label:q,selectFilter:u,toggleFilter:l})),n.createElement("div",{className:"meta"},v!==""?n.createElement("h2",null,v):"",n.createElement("p",{role:"status"},te),Z,X&&(z||!ee)?n.createElement("div",{className:"text-reset"},n.createElement(H.A,{...this.props})):"")}}P.defaultProps={activeFilters:0,config:{...E.et},query:"",results:[],setSort:(T,p)=>null,sortOptions:{...E.wp},toggleSort:T=>null,clearFilters:()=>null,total:0},W.A=P}),9750:(function(G,W,f){f.r(W),f.d(W,{PublicationSearchIndex:function(){return K}});var n=f(6540),A=f(5338),H=f(8662),E=f(9418),P=f(3400),T=f(1312),p=f(8789);const o=["January","February","March","April","May","June","July","August","September","October","November","December"];class i extends n.Component{getDate(S){const d=new Date(S);return o[d.getMonth()]+" "+d.getDate()+", "+d.getFullYear()}trackClick(){(0,p.d)(this.props.query,this.props.type,this.props.totalResults,this.props.title,this.props.liveUrl,this.props.rank)}handleClick(S){const d=S.target.closest("a");d&&(0,p.d)(this.props.query,this.props.type,this.props.totalResults,d.innerText,d.getAttribute("href"),this.props.rank)}render(){const{title:S,liveUrl:d,summary:U,metaData:F,openNewWindow:L}=this.props,x=L?{target:"_blank","aria-label":"Opens in a new window"}:{};return window.unsw.urlUtil.isExternal(d)&&(x.rel="noopener noreferrer"),n.createElement("div",{className:"publication-item"},n.createElement("div",{className:"publication-item--publication-info"},F.publicationCategory," | ",F.publicationYear),n.createElement("a",{href:d,className:"publication-item--author-info",...x,onClick:()=>this.trackClick(),"data-test":"est"},F.image?n.createElement("img",{src:F.image,alt:"author-avatar"}):"",S),n.createElement("div",{onClick:q=>this.handleClick(q),className:"publication-item--body",dangerouslySetInnerHTML:{__html:E.A.sanitize((0,P.UE)(U))}}),n.createElement("div",{className:"publication-item--separator"}))}}i.defaultProps={title:"",liveUrl:"",metaData:{},summary:""};var c=i;class u extends n.Component{render(){const{config:S,results:d,resultsSummary:U,query:F,profile:L}=this.props;return d.length===0||S.resultsPath!==""?null:n.createElement("div",{className:"publication-search-results"},d.map((x,q)=>n.createElement(c,{key:q,...x,openNewWindow:S.openNewWindow==="true",query:F,type:L,totalResults:U.totalMatching})))}}u.defaultProps={config:{resultsPath:""},results:[],resultsSummary:{},query:"",profile:""};var D=u,l=f(9022),k=f(9426),y=f(9638);const M=document.getElementsByClassName("site-header-new desktop"),R=document.querySelector("#publication-search"),Q={date:"date",relevance:"relevance"},X={atar:"",degreeType:"",faculty:"",areaStudy:"",fieldInterest:"",eligibility:""};class z extends n.Component{constructor(S){super(S),this.mouseOverHeader=()=>{let{filterOptions:t}=this.state;for(let s=0;s<t.length;s++)t[s].open=!1;this.setState({filterOptions:t})},this.getFilterOptionsFromFacets=t=>{let s=this.state.filterOptions;
1return s.forEach(e=>{e.param==="f.Faculty%7CpublicationFaculty"&&this.state.isPublicationWithFacException?e.useLocalOptions=!0:e.options=[]}),t.forEach(e=>{e.allValues&&e.allValues.forEach(r=>{if(r.queryStringParam){let a=r.queryStringParam.split("="),m=a[0],h=a[1],g=this.getFilterByParam(s,m);g!==void 0&&g.options!==void 0&&!g.useLocalOptions&&g.options.push({label:r.label,value:h})}})}),s},this.getFilterByParam=(t,s)=>t.filter(e=>e.param===s)[0],this.initFilters=(t,s)=>{const e=this.getFilterOptionsFromFacets(s);let r=0;for(let a=0;a<e.length;a++){const m=e[a].id,h=t.filters.defaults[m]?t.filters.defaults[m]:"",g=h===""?!0:e[a].options.filter(w=>w.value===h).length>0;(e[a].selected===void 0||e[a].selected===""||e[a].selected===null)&&(e[a].selected=g?h:""),e[a].selected!==""&&++r}return{activeFilters:r,filterOptions:e}},this.extractHash=()=>{let{filterOptions:t,sortOptions:s,perPage:e,query:r}=this.state;const m=(this.props.hash?this.props.hash.substr(1):window.location.hash.substr(1)).split("&");let h=r,g=1;const{oldStartRank:w}=this.state;let I=e.toString(),_="",C=[],N=s.selected||"relevance",B=0;for(let b=0;b<m.length;b++){const $=m[b];if(/search=/.test($)&&(h=decodeURIComponent($.substr(7)).replace(/^[\[\]]+|[\[\]]+$/g,"").replace(/\\+/g,""),h!==this.state.query)){const O=h.split(" ").map(Y=>Y.trim());this.setState({keywords:O})}/numRanks=/.test($)&&(I=$.substr(9)),/startRank=/.test($)&&(g=parseInt($.substr(10))),/filters/.test($)&&(_=$.substr(8).replace(/%20/gi," "),C=_.split("+")),/sort=/.test($)&&(N=$.substr(5))}for(let b=0;b<C.length;b++){const O=decodeURIComponent(C[b]).split(":"),Y=O[0]?O[0]:null,se=O[1]?O[1]:null;for(let j=0;j<t.length;j++)Y===t[j].param&&(t[j].options.length===0||t[j].options.filter(ae=>ae.value===se).length&&t[j].param===Y)&&(t[j].selected=se,++B)}for(let b in Q)if(b===N){s.selected=Q[b];break}this.setState({activeFilters:B,filterOptions:t,numRanks:I,results:[],oldStartRank:w,startRank:g,query:h,inputQuery:h,sortOptions:s},()=>this.createSearchUrl())},this.createUrlHash=()=>{let{activeFilters:t,filterOptions:s,numRanks:e,query:r,inputQuery:a,startRank:m,sortOptions:h,perPage:g}=this.state,w="";e||(e=g);let I="";if(t>0){let C=[];for(let N=0;N<s.length;N++){const{param:B,selected:b}=s[N];b!==""&&C.push(encodeURIComponent(`${B}:${b}`))}I=C.length>0?`&filters=${C.join("+")}`:""}let _="relevance";for(let C in Q)if(Q[C]===h.selected){_=C;break}return r=encodeURIComponent(r||a||""),w=`search=${r}${I}&sort=${_}&startRank=${m}&numRanks=${e}`,window.location.hash=`#${w}`,this.setState({hash:w}),w},this.scrollToTop=()=>{document.getElementsByTagName("BODY")[0].scrollIntoView({behavior:"auto",block:"start"})},this.setQuery=(t,s=!1)=>{let e=t.replace(y.Kv,"");s?this.setState({inputQuery:e,query:e,searchRefine:"query"},()=>this.createUrlHash()):this.setState({inputQuery:e,searchRefine:"query"})},this.createSearchUrl=()=>{let{activeFilters:t,filterOptions:s,query:e,startRank:r,numRanks:a,sortOptions:m,urlBase:h,queryType:g,scope:w,collection:I,isPublicationWithFacException:_}=this.state;_&&(w="");let C="";if(t>0){let B=[];for(let b=0;b<s.length;b++){const{param:$,selected:O}=s[b];O&&O!==""&&s[b].type!=="input"&&$.indexOf("&")===-1&&O.indexOf("&")===-1&&($==="f.Faculty%7CpublicationFaculty"&&_?O==="UNSW+Canberra"?w="canberraPublication":O==="UNSW+Sydney"&&(w="notCanberraPublication"):B.push(`${$}=${O}`))}C=B.length>0?`&${B.join("&")}`:""}e=encodeURIComponent(this.appendWildCardSearch(e)||""),w=encodeURIComponent(w||""),I=encodeURIComponent(I||""),g=e===""?"query":g;let N=`${h}?form=json&collection=${I}&profile=publications&${g}=${e||"!padrenull"}&start_rank=${r}&num_ranks=${a}${m.selected==="relevance"?"":`&sort=${m.selected}&tierbars=0`}${C}${w?`&gscope1=${w}`:""}`;return this.setState({url:N,searching:!0},()=>this.doSearch()),N},this.appendWildCardSearch=t=>{const e=/"[^"]*"|\S+/g;let r="";return t&&t.length>0&&(r=t.match(e).map(a=>{var m,h;return a.startsWith('"')&&a.endsWith('"')||((m=this.state.config)==null?void 0:m.exactMatch)===!0||((h=this.state.config)==null?void 0:h.exactMatch)==="true"?a:a.replace(/\*+$/,"")+"*"}).join(" ")),r},this.doSearch=()=>{const{cache:t,url:s}=this.state,e=this.isCached();if(e!==!1)return this.fetchResult(t[e]),null;fetch(s,y.lw).then(r=>r.json()).then(r=>this.fetchResult(r)).catch(r=>this.error(r))},this.isCached=()=>{const{cache:t,url:s}=this.state;for(let e=0;e<t.length;e++)if(t[e].url===s)return e;return!1},this.cacheResult=t=>{let{cache:s,url:e}=this.state;const r=this.isCached();return r!==!1?(s[r]={url:e,data:t},s):(s.push({url:e,data:t}),s)},this.submitSearch=()=>(this.setState({startRank:1},()=>this.createUrlHash()),null),this.fetchResult=t=>{if(!t||!t.response||!t.response.resultPacket||!t.response.resultPacket.results||t.response.resultPacket.results.length===0){this.setState({searching:!1,total:0});return}const e=t.response.facets,{activeFilters:r,filterOptions:a}=this.initFilters(this.state.config,e),{results:m,resultsSummary:h,query:g}=t.response.resultPacket;this.setState({facets:e,results:m,activeFilters:r,filterOptions:a,total:h.totalMatching,searching:!1,query:g==="!padrenull"?"":g,profile:"publication",resultsSummary:h}),(0,p.q)(g,"publication",h.totalMatching)},this.clearSearch=()=>(this.setState({query:""},()=>this.createUrlHash()),null),this.error=t=>{this.setState({error:!0,searching:!1})},this.toggleFilter=t=>{let{filterOptions:s}=this.state;for(let e=0;e<s.length;e++){const{id:r,open:a}=s[e];r===t?s[e].open=!a:s[e].open=!1}this.setState({filterOptions:s})},this.selectFilter=(t,s)=>{let{activeFilters:e,filterOptions:r}=this.state;for(let a=0;a<r.length;a++){const m=!!r[a].options.filter(h=>h.value===s).length;switch(!0){case!m:break;case(r[a].id===t&&r[a].selected===s):r[a].selected="",r[a].open=!1,--e,e=e<0?0:e;break;case(r[a].id===t&&r[a].selected!==""):r[a].selected=s,r[a].open=!1;break;case r[a].id===t:r[a].selected=s,r[a].open=!1,++e,e=e>r.length?r.length:e;break;default:}}this.setState({startRank:1,activeFilters:e,filterOptions:r,searchRefine:"filters"},()=>this.createUrlHash())},this.clearFilters=()=>{const{filterOptions:t}=this.state;for(let s=0;s<t.length;s++)t[s].selected="";this.setState({activeFilters:0,query:"",inputQuery:"",filterOptions:t,searchRefine:"filters"},()=>this.createUrlHash())},this.toggleSort=t=>{const{sortOptions:s}=this.state;!0===(t==="sort")?s.open=!s.open:s.open=!1,this.setState({sortOptions:s})},this.setSort=(t,s)=>{const{sortOptions:e}=this.state;return e.selected=s,e.open=!1,this.setState({startRank:1,sortOptions:e,searchRefine:"sort"},()=>this.createUrlHash()),null},this.setStartRank=t=>(R.scrollIntoView(!0),this.setState({startRank:t},()=>this.createUrlHash()),null);const d=R!==null?R.dataset.apiUrl:"",U=R!==null?R.dataset.scope:"",F=U==="canberraPublication",L=12,x=R&&R.dataset.collection?R.dataset.collection:"unsw~unsw-search",q=R!==null?R.dataset.queryType:"query",te=R!==null?R.dataset.queryParam:"",v=`${d}/?form=json&collection=${x}&profile=publications&${q}=&start_rank=1&num_ranks=${L}`,Z=window.location.hash?window.location.hash.substr(1):"",V={url:v,data:y.dF},re=window.itemSearchConfig?{...window.itemSearchConfig}:{...y.et};this.state={activeFilters:0,cache:[V],collection:x,config:re,error:!1,filters:{...X},filterOptions:[...y.Ac],hash:Z,inputQuery:"",isPublicationWithFacException:F,keywords:[],numRanks:L.toString(),oldStartRank:1,perPage:L,results:[],facets:[],searching:!1,searchRefine:"filters",startRank:1,sort:"relevance",scope:U,sortOptions:{...y.wp},total:0,query:te,url:v,urlBase:d,queryType:q}}componentDidMount(){this.extractHash(),window.addEventListener("hashchange",this.extractHash,!1),M.length===1&&M[0].addEventListener("mouseenter",this.mouseOverHeader,!0)}componentWillUnmount(){window.removeEventListener("hashchange",()=>null,!1),M.length===1&&M[0].removeEventListener("mouseenter",this.mouseOverHeader,!0)}render(){return n.createElement(n.Fragment,null,n.createElement(H.A,{...this.state,submitSearch:this.submitSearch,setQuery:this.setQuery,clearFilters:this.clearFilters,selectFilter:this.selectFilter,toggleFilter:this.toggleFilter}),n.createElement(l.A,{...this.state,setSort:this.setSort,toggleSort:this.toggleSort}),n.createElement(D,{...this.state}),n.createElement(k.A,{...this.state,setStartRank:this.setStartRank,hasFocus:this.hasFocus}
1))}}z.defaultProps={hash:"",jest:!1,hasModal:{filter:!1,sort:!1}};var ee=z;class K{constructor(){this.selector='[data-cmp-is="publication-search"]',this.init()}init(){this.$els=document.querySelectorAll(this.selector),this.$els.forEach((S,d)=>{S.removeAttribute("data-cmp-is"),A.createRoot(S).render(n.createElement(ee,null))})}}new K})}]);

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.