PageSourceSearch

https://devdocs.io/assets/lib/util-ca0ea9595202d98c50949dd3ab5310319b29a9dfc439915448b645dfbc282387.js

js devdocs.io collected 2026-09-24 08:30:23 UTC 6,937 bytes, 1 lines download raw bytes

1let smoothDistance,smoothDuration,smoothEnd,smoothStart;export const $=function(e,t){null==t&&(t=document);try{return t.querySelector(e)}catch(e){}};export const $$=function(e,t){null==t&&(t=document);try{return t.querySelectorAll(e)}catch(e){}};$.id=e=>document.getElementById(e),$.hasChild=function(e,t){if(e)for(;t;){if(t===e)return!0;if(t===document.body)return;t=t.parentNode}},$.closestLink=function(e,t){for(null==t&&(t=document.body);e;){if("A"===e.tagName)return e;if(e===t)return;e=e.parentNode}},$.on=function(e,t,o,n){if(null==n&&(n=!1),t.includes(" "))for(var r of t.split(" "))$.on(e,r,o);else e.addEventListener(t,o,n)},$.off=function(e,t,o,n){if(null==n&&(n=!1),t.includes(" "))for(var r of t.split(" "))$.off(e,r,o);else e.removeEventListener(t,o,n)},$.trigger=function(e,t,o,n){const r=new Event(t,{bubbles:o??!0,cancelable:n??!0});e.dispatchEvent(r)},$.click=function(e){const t=new MouseEvent("click",{bubbles:!0,cancelable:!0});e.dispatchEvent(t)},$.stopEvent=function(e){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation()},$.eventTarget=function(e){const t=e.target;return t.correspondingUseElement||t};const buildFragment=function(e){const t=document.createDocumentFragment();if($.isCollection(e))for(var o of $.makeArray(e))t.appendChild(o);else t.innerHTML=e;return t};$.append=function(e,t){"string"==typeof t?e.insertAdjacentHTML("beforeend",t):($.isCollection(t)&&(t=buildFragment(t)),e.appendChild(t))},$.prepend=function(e,t){e.firstChild?"string"==typeof t?e.insertAdjacentHTML("afterbegin",t):($.isCollection(t)&&(t=buildFragment(t)),e.insertBefore(t,e.firstChild)):$.append(e,t)},$.before=function(e,t){("string"==typeof t||$.isCollection(t))&&(t=buildFragment(t)),e.parentNode.insertBefore(t,e)},$.after=function(e,t){("string"==typeof t||$.isCollection(t))&&(t=buildFragment(t)),e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t)},$.remove=function(e){if($.isCollection(e))for(var t of $.makeArray(e))null!=t.parentNode&&t.parentNode.removeChild(t);else{const t=e;null!=t.parentNode&&t.parentNode.removeChild(t)}},$.empty=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},$.batchUpdate=function(e,t){const o=e.parentNode,n=e.nextSibling;o.removeChild(e),t(e),n?o.insertBefore(e,n):o.appendChild(e)},$.rect=e=>e.getBoundingClientRect(),$.offset=function(e,t){null==t&&(t=document.body);let o=0,n=0;for(;e&&e!==t;)o+=e.offsetTop,n+=e.offsetLeft,e=e.offsetParent;return{top:o,left:n}},$.scrollParent=function(e){for(;(e=e.parentNode)&&1===e.nodeType;){const t=e;if(t.scrollTop>0)break;if(["auto","scroll"].includes(getComputedStyle(t)?.overflowY??""))break}return e},$.scrollTo=function(e,t,o,n){if(null==o&&(o="center"),null==n&&(n={}),!e)return;if(null==t&&(t=$.scrollParent(e)),!t)return;const r=t.clientHeight,i=t.scrollHeight;if(!(i>r))return;const{top:l}=$.offset(e,t),{offsetTop:s}=t.firstElementChild;switch(o){case"top":t.scrollTop=l-s-(n.margin||0);break;case"center":t.scrollTop=l-Math.round(r/2-e.offsetHeight/2);break;case"continuous":var{scrollTop:c}=t,a=e.offsetHeight,u=t.lastElementChild,d=u.offsetTop+u.offsetHeight,f=d>0?i-d:0;l-s<=c+a*(n.topGap||1)?t.scrollTop=l-s-a*(n.topGap||1):l+f>=c+r-a*((n.bottomGap||1)+1)&&(t.scrollTop=l+f-r+a*((n.bottomGap||1)+1))}},$.scrollToWithImageLock=function(e,t,...o){if(null==t&&(t=$.scrollParent(e)),t)for(var n of($.scrollTo(e,t,...o),t.getElementsByTagName("img")))n.complete||function(){let r;const i=function(n){return clearTimeout(r),l(n.target),$.scrollTo(e,t,...o)};var l=e=>$.off(e,"load",i);$.on(n,"load",i),r=setTimeout(l.bind(null,n),3e3)}()},$.lockScroll=function(e,t){const o=$.scrollParent(e);if(o){let{top:n}=$.rect(e);[document.body,document.documentElement].includes(o)||(n-=$.rect(o).top),t(),o.scrollTop=$.offset(e,o).top-n}else t()},$.openDetailsAncestors=function(e){for(;e;)"DETAILS"===e.tagName&&(e.open=!0),e=e.parentElement};let smoothScroll=smoothStart=smoothEnd=smoothDistance=smoothDuration=null;$.smoothScroll=function(e,t){if(smoothEnd=t,smoothScroll){const e=smoothEnd-smoothStart;return smoothDuration+=Math.min(300,Math.abs(smoothDistance-e)),void(smoothDistance=e)}smoothStart=e.scrollTop,smoothDistance=smoothEnd-smoothStart,smoothDuration=Math.min(300,Math.abs(smoothDistance));const o=Date.now();return smoothScroll=function(){const t=Math.min(1,(Date.now()-o)/smoothDuration),n=Math.max(0,Math.floor(smoothStart+smoothDistance*(t<.5?2*t*t:t*(4-2*t)-1)));return e.scrollTop=n,1===t?smoothScroll=null:requestAnimationFrame(smoothScroll)},requestAnimationFrame(smoothScroll)},$.makeArray=function(e){return Array.isArray(e)?e:Array.prototype.slice.apply(e)},$.arrayDelete=function(e,t){const o=e.indexOf(t);return o>=0&&(e.splice(o,1),!0)},$.isCollection=e=>Array.isArray(e)||"function"==typeof e?.item;const ESCAPE_HTML_MAP={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"},ESCAPE_HTML_REGEXP=/[&<>
1"'\/]/g;$.escape=e=>e.replace(ESCAPE_HTML_REGEXP,e=>ESCAPE_HTML_MAP[e]);const ESCAPE_REGEXP=/([.*+?^=!:${}()|\[\]\/\\])/g;$.escapeRegexp=e=>e.replace(ESCAPE_REGEXP,"\\$1"),$.urlDecode=e=>decodeURIComponent(e.replace(/\+/g,"%20")),$.urlDecodeFragment=e=>decodeURIComponent(e),$.classify=function(e){const t=e.split("_");for(let e=0;e<t.length;e++){var o=t[e];t[e]=o[0].toUpperCase()+o.slice(1)}return t.join("")},$.noop=function(){},$.download=function(e,t){const o=URL.createObjectURL(e),n=document.createElement("a");n.href=o,n.download=t,n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n),setTimeout(()=>URL.revokeObjectURL(o),1e3)};const hrefOf=e=>"string"==typeof e?e:e.href;$.popup=function(e){try{window.open(hrefOf(e),"_blank","noopener")}catch(t){const o=window.open();o.opener&&(o.opener=null),o.location=hrefOf(e)}};let isMac=null;$.isMac=()=>null!=isMac?isMac:isMac=navigator.userAgent.includes("Mac");let isIE=null;$.isIE=()=>null!=isIE?isIE:isIE=navigator.userAgent.includes("MSIE")||navigator.userAgent.includes("rv:11.0");let isChromeForAndroid=null;$.isChromeForAndroid=()=>null!=isChromeForAndroid?isChromeForAndroid:isChromeForAndroid=navigator.userAgent.includes("Android")&&/Chrome\/([.0-9])+ Mobile/.test(navigator.userAgent);let isAndroid=null;$.isAndroid=()=>null!=isAndroid?isAndroid:isAndroid=navigator.userAgent.includes("Android");let isIOS=null;$.isIOS=()=>null!=isIOS?isIOS:isIOS=navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPad"),$.overlayScrollbarsEnabled=function(){if(!$.isMac())return!1;const e=document.createElement("div");e.setAttribute("style","width: 100px; height: 100px; overflow: scroll; position: absolute"),document.body.appendChild(e);const t=e.offsetWidth===e.clientWidth;return document.body.removeChild(e),t};const HIGHLIGHT_DEFAULTS={className:"highlight",delay:1e3};$.highlight=function(e,t){t={...HIGHLIGHT_DEFAULTS,...t||{}},e.classList.add(t.className),setTimeout(()=>e.classList.remove(t.className),t.delay)};

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.