PageSourceSearch

https://interview.tw/build/assets/Tools-DbMtmNy4.js

js interview.tw collected 2026-10-01 12:15:55 UTC 6,104 bytes, 1 lines download raw bytes

1import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{w as t,x as n}from"./vendor-Dlkm7nrb.js";import{t as r}from"./AlertV2-CnXEw1s4.js";var i=e(t()),a=e(n()),o=class e{static initEvents(){e._mountScrollOverwrite(),e._mountCopyUidBtn(),e._mountCopyInviteLinkBtn()}static runAfterScrollDepth(e,t=.3,n=1e4){let r=!1,i=()=>{r||(r=!0,window.removeEventListener(`scroll`,a),clearTimeout(o),e())},a=()=>{let e=document.documentElement.scrollHeight-window.innerHeight;if(e<=0){i();return}(window.scrollY||window.pageYOffset)/e>=t&&i()};window.addEventListener(`scroll`,a,{passive:!0});let o=setTimeout(i,n);a()}static getABTestGroup(){let e=(0,i.default)(`.iw_js_ab_test_group`);return e.length?e.val():`unknown`}static modifiedUrl(e){if(!e)return;let t=e.includes(`/c/`)?`${window.location.origin}${e}`:`${window.location.origin}/c/${e}`;return window.history.replaceState(``,``,t)}static _isOnSingleSalaryPage(){return/\/i/gi.test(window.location.pathname)}static getIsUserLoggedIn(){let e=(0,i.default)(`.iw_js_is_user_logged_in`);return e.length?e.val()===`true`:!1}static getUserUid(){let e=(0,i.default)(`.btn-nav-bar-copy-user-uid`);return e.length?e.data(`uid`)??`guest`:`guest`}static getCurrentEnvironment(){let e=window.location.origin,t=e.includes(`dev`),n=e.includes(`stage`);return t?`dev`:n?`stage`:`production`}static isCurrentEnvProduction(){return e.getCurrentEnvironment()===`production`}static copyToClipboard(e){navigator.clipboard.writeText(e)}static convertPathToStr(e=window.location.pathname){let t=/^\/$/gi,n=/\/c\//gi,r=/\/i\//gi,i=t.test(e),a=n.test(e),o=r.test(e),s=e.includes(`user-notifications`);return i?`首頁`:a?`公司頁面`:o?`面試頁面`:s?`通知中心`:e}static getUrlParams(e=``,t=window.location.search){let n=new URLSearchParams(t).get(e);return n===`true`?!0:n===`false`?!1:n}static getUrlParamsIsArray(e=``,t=window.location.search){let n=new URLSearchParams(t),r=n.get(e)??n.getAll(`${e}[]`);return r===`true`?!0:r===`false`?!1:r}static capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1)}static isEmptyObject(e){return Object.keys(e).length===0}static debounce(e,t,n){let r;return function(...i){let a=this,o=function(){r=null,n||e.apply(a,i)},s=n&&!r;clearTimeout(r),r=setTimeout(o,t),s&&e.apply(a,i)}}static mountIdleDetect(t,n,r,i=200){let a;window.addEventListener(`load`,s,!0),[`mousedown`,`mousemove`,`keydown`,`keypress`,`scroll`,`touchstart`,`click`].forEach(t=>{t===`scroll`?document.addEventListener(t,e.debounce(s,i),{passive:!0,capture:!0}):document.addEventListener(t,e.debounce(s,i),{capture:!0})});function o(){t()}function s(){n(),clearTimeout(a),a=setTimeout(o,r)}}static getEnvStrForGa(){let e=(0,i.default)(`.iw_js_env`),t=e?e.val():`-dev`;return t===`local`?`-dev`:t===`staging`?`-stage`:t===`production`?``:t}static getServerTimeString(){let e=(0,i.default)(`.iw_js_server_time`);return e?e.val():``}static modalCloseEvt(){(0,i.default)(`body`).removeClass(`lock-body-scroll-disabled`),(0,i.default)(`html`).removeClass(`zf-has-scroll is-reveal-open`),(0,i.default)(`.reveal-overlay`).each(function(){(0,i.default)(this).css(`display`,`none`)})}static modifiedUrlWithoutRedirect(e){return window.history.replaceState(``,``,`${window.location.origin}${e}`)}static validateEmail(e=``){return/^(([^<>()[\]\\.,:\s@\"]+(\.[^<>()[\]\\.,:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}static getFormParams(e){return(0,i.default)(e).serializeArray().reduce((e,t)=>{let n=e[t.name];if([`interviewIds`].includes(t.name)){let r=n?[...n,t.value]:[t.value];return{...e,[t.name]:r}}return{...e,[t.name]:t.value}},{})}static removeUrlParams(e,t=!0){let n=new URL(window.location.href),r=new URLSearchParams(n.search);e&&r.delete(e),t&&window.history.replaceState(``,``,`?${r}`)}static _mountScrollOverwrite(){`scrollRestoration`in window.history&&(window.history.scrollRestoration=`manual`),e.pageMountScroll(),window.addEventListener(`pagehide`,function(){window.scrollTo(0,0);let t=e.getScrollInfo();if(t||e.setScrollInfo(window.scrollY),t){let n=t.route===window.location.href,{isModalOpen:r}=t;n&&!r&&e.setScrollInfo(window.scrollY),n||e.setScrollInfo(window.scrollY)}})}static getEnv(){let e=window.location.hostname,t=e.includes(`dev`),n=e.includes(`stage`);return t?`dev`:n?`stage`:!t&&!n?`production`:`getEnv-Missing`}static entryTypeIsReload(){return window.performance.getEntriesByType(`navigation`)[0].type===`reload`}static getScrollKey(){return`LS_SCROLL_INFO`}static getScrollInfo(){let t=e.getScrollKey(),n=localStorage.getItem(t);return n?JSON.parse(n):!1}static setScrollInfo(t,n=!1){let r=e.getScrollKey(),i={route:window.location.href,position:t,isModalOpen:n,timeStamp:(0,a.default)().format(`YYYY-MM-DD HH:mm:ss`)};localStorage.setItem(r,JSON.stringify(i))}static pageMountScroll(){let t=e.getScrollInfo();if(t){let e=t.route===window.location.href,n=(0,a.default)().diff((0,a.default)(t.t
1imeStamp),`second`)<30;e&&n&&window.scroll({top:t.position})}}static getRandomNumber(e,t){return Math.floor(Math.random()*(e-t+1))+t}static _mountCopyUidBtn(){let t=(0,i.default)(`.iw_js_copy_uid`);t.length&&t.on(`click`,t=>{let n=(0,i.default)(t.currentTarget).data(`uid`);e.copyToClipboard(n),r.copyUidSuccess()})}static _mountCopyInviteLinkBtn(){let t=(0,i.default)(`.iw_js_copy_invite_link`);t.length&&t.on(`click`,t=>{let n=(0,i.default)(t.currentTarget).data(`link`);e.copyToClipboard(n),r.copyInviteLinkSuccess()})}static scrollTo(e,t=0,n=!0){let r=(0,i.default)(e);r=r[0].getBoundingClientRect();let a=(0,i.default)(`.iw_js_navbar_outer`)[0].clientHeight,o=window.scrollY,s=r.top+o-a-t;window.scrollTo({top:s,behavior:n?`smooth`:`auto`})}static hasVip(){return!!(0,i.default)(`.iw_menu-card-outer`).length}static _startCountDown(e=30,t=`.iw_js_limit_time`,n){let r=e;function i(e){let r=document.querySelector(t),i=e;window.emailCountDown=setInterval(()=>{r.textContent=i,--i<0&&(i=e),i===e&&(clearInterval(window.emailCountDown),n&&n())},1e3)}i(r)}static isSmallSize(){return window.matchMedia(`(max-width: 767px)`).matches}};export{o as t};

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.