PageSourceSearch

https://www.randstad.pt/search-app/assets/js/auto-suggest.js

js randstad.pt collected 2026-10-02 04:26:43 UTC 11,581 bytes, 1 lines download raw bytes

1(s=>{var i={};function n(e){var t;return(i[e]||(t=i[e]={i:e,l:!1,exports:{}},s[e].call(t.exports,t,t.exports,n),t.l=!0,t)).exports}n.m=s,n.c=i,n.d=function(e,t,s){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(s,i,function(e){return t[e]}.bind(null,i));return s},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=186)})({1:function(e,t){e.exports=class{static triggerEvent(e,t){let s;"function"==typeof Event?s=new Event(t):(s=document.createEvent("Event")).initEvent(t,!0,!0),e.dispatchEvent(s)}static getElementByAttribute(e,t){return t?document.querySelector(`[${e}="${t}"]`):document.querySelector(`[${e}]`)}static getElementsByAttribute(e,t){return t?document.querySelectorAll(`[${e}="${t}"]`):document.querySelectorAll(`[${e}]`)}static getElementByAttributeWithinElement(e,t,s){return s?e.querySelector(`[${t}="${s}"]`):e.querySelector(`[${t}]`)}static isMouseOver(e){return 0<Array.prototype.slice.call(e.parentElement.querySelectorAll(":hover")).filter(function(){return e[0]==this}).length}static getElementsByAttributeWithinElement(e,t,s){return s?e.querySelectorAll(`[${t}="${s}"]`):e.querySelectorAll(`[${t}]`)}static getElementByClassWithinElement(e,t){return e.querySelector("."+t)}static maxWidthMobileViewports(){return 940}static createEvent(e){let t;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t}static isDesktop(){return Math.max(document.documentElement.clientWidth,window.innerWidth||0)>this.maxWidthMobileViewports()}static isIE11(){return-1!==navigator.userAgent.indexOf("MSIE")||-1<navigator.appVersion.indexOf("Trident/")}static getKeyCodeOnKeyDownEvent(e){let t;if(null!=e)if(void 0===e.code)switch(e.keyCode){case 13:t="Enter";break;case 38:t="ArrowUp";break;case 40:t="ArrowDown";break;case 8:t="Backspace";break;case 9:t="Tab";break;case 27:t="Escape";break;case 33:t="PageUp";break;case 34:t="PageDown";break;case 32:t="Space";break;default:t=void 0}else t=e.code;return t}static getKeyboardFocusableElements(e){return[...e.querySelectorAll('a[href], button, input, textarea, iframe, select, details,[tabindex]:not([tabindex="-1"])')].filter(e=>!("hidden"===window.getComputedStyle(e).visibility||e.hasAttribute("disabled")||e.getAttribute("aria-hidden")))}}},186:function(e,t,s){e.exports=s(429)},429:function(e,t,s){s.r(t);var t=s(1),n=s.n(t);let i="data-rs-auto-suggest";class r extends class{constructor(e){this.element=e,this.minimumLength=1,this.container=this.element,this.input=n.a.getElementByAttributeWithinElement(this.element,this.attributes.input),this.noResultMessage=this.input.getAttribute(this.attributes.noResultMessage),this.list=n.a.getElementByAttributeWithinElement(this.element,this.attributes.list),this.separator=this.list.getAttribute(this.attributes.separator),this.dataSource=this.getDataSource(),this.disableNativeAutoComplete(),this.addEventHandlers(),this.numberOfListItems=0,this.selectedIndex,this.selectedValue,this.previousInput="",this.resultList}get attributes(){return{autocomplete:"autocomplete",noResultMessage:i+"-no-result-message",container:i+"-container",index:i+"-index",input:i+"-input",list:i+"-list",listValue:i+"-list-value",preselect:i+"-preselect",selected:i+"-selected",separator:i+"-separator",values:i+"-values"}}get classes(){return{autosuggestOpen:"select-menu--open",autosuggestItem:"select-menu__item",autosuggestNoResult:"select-menu__item select-menu__item--no-result",autosuggestPreselect:"select-menu__item--preselect"}}get keyCodes(){return{Enter:"Enter",Up:"ArrowUp",Down:"ArrowDown",Tab:"Tab",Escape:"Escape",PageUp:"PageUp",PageDown:"PageDown"}}disableNativeAutoComplete(){this.input.setAttribute(this.attributes.autocomplete,"off")}
1addEventHandlers(){["input","focus"].forEach(e=>{this.input.addEventListener(e,()=>{this.numberOfListItems=0,this.input.value.length>=this.minimumLength?((this.previousInput.length<this.minimumLength||-1===this.input.value.toLowerCase().indexOf(this.previousInput.toLowerCase()))&&(this.dataSource=this.getDataSource()),this.createList()):this.closeList(),this.previousInput=this.input.value})}),this.input.addEventListener("keydown",e=>{n.a.getKeyCodeOnKeyDownEvent(e)==this.keyCodes.Tab&&(-1<this.selectedIndex&&this.setSelectedValue(this.selectedIndex),this.closeList()),n.a.getKeyCodeOnKeyDownEvent(e)==this.keyCodes.Escape&&this.closeList()}),document.addEventListener("click",e=>{this.list.contains(e.target)||this.input.contains(e.target)||this.closeList()}),document.addEventListener("keydown",e=>{this.handleButtonKeys(e)})}createList(){let s="",i=0;var e;this.resultList=JSON.parse(JSON.stringify(this.dataSource)),this.dataSource.forEach(e=>{var t;-1<e.toLowerCase().indexOf(this.input.value.toLowerCase())?(t=new RegExp(this.input.value,"gi"),t=e.replace(t,function(e){return`<mark>${e}</mark>`}),t=`<li class="${this.classes.autosuggestItem}" ${this.attributes.listValue} ${this.attributes.index}="${i}" >${t}</li>`,s+=t,this.numberOfListItems++,i++):-1<(t=this.resultList.indexOf(e))&&this.resultList.splice(t,1)}),this.dataSource=JSON.parse(JSON.stringify(this.resultList)),0<this.numberOfListItems?this.bindResultList(s):(e=`<li class="${this.classes.autosuggestNoResult}">${this.noResultMessage||"no results"} </li>`,this.bindResultList(e))}bindResultList(e){this.list.innerHTML=e,this.container.classList.add(this.classes.autosuggestOpen),this.list.querySelectorAll(`[${this.attributes.listValue}]`).forEach((t,e)=>{0===e&&(t.classList.add(this.classes.autosuggestPreselect),t.setAttribute(this.attributes.preselect,""),this.selectedIndex=0,this.updatePreselectedItem(this.selectedIndex,null,!0)),t.addEventListener("click",()=>{this.setSelectedValue(this.selectedIndex)}),t.addEventListener("mouseenter",e=>{this.updatePreselectedItem(t.getAttribute(this.attributes.index),e,!1)})})}updatePreselectedItem(e,t,s){var i=n.a.getElementByAttribute(this.attributes.preselect),i=(i.classList.remove(this.classes.autosuggestPreselect),i.removeAttribute(this.attributes.preselect),n.a.getElementByAttribute(this.attributes.index,e));i.classList.add(this.classes.autosuggestPreselect),i.setAttribute(this.attributes.preselect,""),this.selectedIndex=e,this.selectedValue=i.innerText,(null!=t&&"keydown"===t.type||!0===s)&&this.setScrollbar(i,t)}setSelectedValue(e){e=n.a.getElementByAttribute(this.attributes.index,e);null!=e&&(this.input.value=e.innerText,this.closeList())}handleButtonKeys(e){if(null!=e&&-1<this.selectedIndex)switch(n.a.getKeyCodeOnKeyDownEvent(e)){case this.keyCodes.Down:e.preventDefault(),this.selectedIndex<this.numberOfListItems-1&&(this.selectedIndex++,this.updatePreselectedItem(this.selectedIndex,e,!1));break;case this.keyCodes.Up:e.preventDefault(),0<this.selectedIndex&&(this.selectedIndex--,this.updatePreselectedItem(this.selectedIndex,e,!1));break;case this.keyCodes.PageDown:e.preventDefault(),this.selectedIndex<this.numberOfListItems-1&&this.updatePreselectedItem(Number(this.numberOfListItems)-1,e,!1);break;case this.keyCodes.PageUp:e.preventDefault(),0<this.selectedIndex&&this.updatePreselectedItem(0,e,!1);break;case this.keyCodes.Enter:e.preventDefault(),this.setSelectedValue(this.selectedIndex)}}setScrollbar(e,t){var s=e.offsetHeight,e=e.offsetTop,i=this.list.children[0].offsetTop;null!=t&&n.a.getKeyCodeOnKeyDownEvent(t)==this.keyCodes.Down?s+e>this.list.offsetHeight+this.list.scrollTop&&(this.list.scrollTop=s+e-this.list.offsetHeight):(e-i<this.list.scrollTop||e+s>this.list.scrollTop+this.list.offsetHeight)&&(this.list.scrollTop=e-i)}closeList(){this.container.classList.remove(this.classes.autosuggestOpen),this.list.innerHTML="",this.selectedValue="",this.selectedIndex=-1}getDataSource(){var e=this.list.getAttribute(this.attributes.values);return null!=e?e.split(this.separator):[]}static getSelector(){return`[${i}]`}}{constructor(e){super(e),this.submit=e.parentNode.querySelector('[type="submit"]'),this.numericValueRegex=this.list.dataset.rsNumericValueRegex,this.showNoResultsMessage="false"!==this.input.dataset.rsAutoSuggestShowNoResultsMessage}
1addEventHandlers(){["input","focus"].forEach(e=>{this.input.addEventListener(e,()=>{this.numberOfListItems=0,this.input.value.length>=this.minimumLength?(this.previousInput.length<this.minimumLength&&(this.dataSource=this.getDataSource()),this.dataSource=this.getDataSource(),this.createList()):this.container.classList.contains(this.classes.autosuggestOpen)&&this.closeList(),this.previousInput=this.input.value})}),this.input.addEventListener("keydown",e=>{n.a.getKeyCodeOnKeyDownEvent(e)==this.keyCodes.Tab&&(-1<this.selectedIndex&&this.setSelectedValue(this.selectedIndex),this.closeList()),n.a.getKeyCodeOnKeyDownEvent(e)==this.keyCodes.Escape&&this.closeList()}),document.addEventListener("click",e=>{this.list.contains(e.target)||this.input.contains(e.target)||this.container.classList.contains(this.classes.autosuggestOpen)&&this.closeList()}),document.addEventListener("keydown",e=>{this.handleButtonKeys(e),this.additionalHandleButtonKeys(e)})}additionalHandleButtonKeys(e){null!=e&&-1<this.selectedIndex&&n.a.getKeyCodeOnKeyDownEvent(e)===this.keyCodes.Enter&&(e.preventDefault(),this.closeList(),this.input.blur(),this.submit)&&this.submit.focus()}closeList(){var e=new CustomEvent("autoSuggestCloseDropdown",{detail:{element:this.element}});window.dispatchEvent(e),this.container.classList.remove(this.classes.autosuggestOpen),this.list.innerHTML="",this.selectedValue="",this.selectedIndex=-1}createList(){let s="",i=0;var e;this.resultList=JSON.parse(JSON.stringify(this.dataSource)),this.useExactValues="true"===this.list.dataset.rsUseExactValues,this.dataSource.forEach(e=>{var t;-1<e.toLowerCase().indexOf(this.input.value.toLowerCase())||this.useExactValues&&e?(t=this.input.value.replace(/[-\[\]/{}()*+?.\\^$|]/g,"\\$&"),t=new RegExp(t,"gi"),t=e.replace(t,function(e){return`<mark>${e}</mark>`}),t=`<li class="${this.classes.autosuggestItem}" ${this.attributes.listValue} ${this.attributes.index}="${i}" >${t}</li>`,s+=t,this.numberOfListItems++,i++):-1<(t=this.resultList.indexOf(e))&&this.resultList.splice(t,1)}),this.dataSource=JSON.parse(JSON.stringify(this.resultList)),0<this.numberOfListItems?this.bindResultList(s):this.showNoResultsMessage?(e=`<li class="${this.classes.autosuggestNoResult}">${this.noResultMessage||"no results"} </li>`,this.bindResultList(e)):this.closeList()}setSelectedValue(e){e=n.a.getElementByAttribute(this.attributes.index,e);if(null!=e){let t=e.innerText;this.numericValueRegex&&Number.parseInt(this.input.value)&&(s=new RegExp(this.numericValueRegex,"g"),e=e.innerText.match(s))&&e.forEach(e=>{e=e.replace(/[()]/g,""),Number.parseInt(e)&&(t=e)}),Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set.call(this.input,t);var s=new CustomEvent("input",{bubbles:!0});this.input.dispatchEvent(s),this.closeList()}}}window.orbit=window.orbit||{},window.orbit.autoSuggest=e=>{new r(e)};var a=[r];for(let s=0;s<a.length;s+=1){let t=document.querySelectorAll(a[s].getSelector());if(t.length)for(let e=0;e<t.length;e++)new a[s](t[e])}}});

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.