PageSourceSearch

https://forbes.ua/static/build/pub/js/wavesurfer-hover.20844fab11.js

js forbes.ua collected 2026-09-24 08:25:55 UTC 4,520 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4080],{5062:function(t,e,s){s.d(e,{default:function(){return c}});class i{constructor(){this.listeners={}}on(t,e,s){if(this.listeners[t]||(this.listeners[t]=new Set),null==s?void 0:s.once){const s=(...i)=>{this.un(t,s),e(...i)};return this.listeners[t].add(s),()=>this.un(t,s)}return this.listeners[t].add(e),()=>this.un(t,e)}un(t,e){var s;null===(s=this.listeners[t])||void 0===s||s.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(t=>t(...e))}}class n extends i{constructor(t){super(),this.subscriptions=[],this.isDestroyed=!1,this.options=t}onInit(){}_init(t){this.isDestroyed&&(this.subscriptions=[],this.isDestroyed=!1),this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(t=>t()),this.subscriptions=[],this.isDestroyed=!0,this.wavesurfer=void 0}}function o(t,e){const s=e.xmlns?document.createElementNS(e.xmlns,t):document.createElement(t);for(const[i,n]of Object.entries(e))if("children"===i&&n)for(const[t,e]of Object.entries(n))e instanceof Node?s.appendChild(e):"string"==typeof e?s.appendChild(document.createTextNode(e)):s.appendChild(o(t,e));else"style"===i?Object.assign(s.style,n):"textContent"===i?s.textContent=n:s.setAttribute(i,n.toString());return s}function r(t,e,s){const i=o(t,e||{});return null==s||s.appendChild(i),i}function l(t,e){let s;const i=()=>{s&&(s(),s=void 0),s=t()},n=e.map(t=>t.subscribe(i));return i(),()=>{s&&(s(),s=void 0),n.forEach(t=>t())}}function a(t,e){const s=function(){let t=null;const e=new Set;return{get value(){return t},set(s){Object.is(t,s)||(t=s,e.forEach(e=>e(t)))},update(e){this.set(e(t))},subscribe:t=>(e.add(t),()=>e.delete(t))}}(),i=t=>{s.set(t)};return t.addEventListener(e,i),s._cleanup=()=>{t.removeEventListener(e,i)},s}const h={lineWidth:1,labelSize:11,labelPreferLeft:!1,formatTimeCallback:t=>`${Math.floor(t/60)}:${("0"+Math.floor(t)%60).slice(-2)}`};class c extends n{constructor(t){super(t||{}),this.lastPointerPosition=null,this.options=Object.assign({},h,t),this.wrapper=r("div",{part:"hover"}),this.label=r("span",{part:"hover-label"},this.wrapper)}static create(t){return new c(t)}addUnits(t){return`${t}${"number"==typeof t?"px":""}`}onInit(){if(!this.wavesurfer)throw Error("WaveSurfer is not initialized");const t=this.wavesurfer.options,e=this.options.lineColor||t.cursorColor||t.progressColor;Object.assign(this.wrapper.style,{position:"absolute",zIndex:10,left:0,top:0,height:"100%",pointerEvents:"none",borderLeft:`${this.addUnits(this.options.lineWidth)} solid ${e}`,opacity:"0",transition:"opacity .1s ease-in"}),Object.assign(this.label.style,{display:"block",backgroundColor:this.options.labelBackground,color:this.options.labelColor,fontSize:`${this.addUnits(this.options.labelSize)}`,transition:"transform .1s ease-in",padding:"2px 3px"});const s=this.wavesurfer.getWrapper();s.appendChild(this.wrapper);const i=this.wavesurfer.getState(),n=a(s,"pointermove"),o=a(s,"pointerleave");this.subscriptions.push(l(()=>{const t=n.value;if(!t||!this.wavesurfer)return;this.lastPointerPosition={clientX:t.clientX,clientY:t.clientY};const e=this.wavesurfer.getWrapper().getBoundingClientRect(),{width:s}=e,o=t.clientX-e.left,r=Math.min(1,Math.max(0,o/s)),l=Math.min(s-this.options.lineWidth-1,o);this.wrapper.style.transform=`translateX(${l}px)`,this.wrapper.style.opacity="1";const a=i.duration.value;this.label.textContent=this.options.formatTimeCallback(a*r);const h=this.label.offsetWidth,c=this.options.labelPreferLeft?l-h>0:l+h>s;this.label.style.transform=c?`translateX(-${h+this.options.lineWidth}px)`:"",this.emit("hover",r)},[n,i.duration])),this.subscriptions.push(l(()=>{o.value&&(this.wrapper.style.opacity="0",this.lastPointerPosition=null)},[o]));const r=()=>{if(this.lastPointerPosition&&this.wavesurfer){const t=this.wavesurfer.getWrapper().getBoundingClientRect(),{width:e}=t,s=this.lastPointerPosition.clientX-t.left,n=Math.min(1,Math.max(0,s/e)),o=Math.min(e-this.options.lineWidth-1,s);this.wrapper.style.transform=`translateX(${o}px)`;const r=i.duration.value;
1this.label.textContent=this.options.formatTimeCallback(r*n);const l=this.label.offsetWidth,a=this.options.labelPreferLeft?o-l>0:o+l>e;this.label.style.transform=a?`translateX(-${l+this.options.lineWidth}px)`:""}};this.subscriptions.push(this.wavesurfer.on("zoom",r)),this.subscriptions.push(this.wavesurfer.on("scroll",r))}destroy(){super.destroy(),this.wrapper.remove()}}}}]);

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.