PageSourceSearch

https://boldwave.ai/wp-content/themes/salient/js/build/elements/nectar-chat-thread.js?ver=18.0

js boldwave.ai collected 2026-10-05 12:24:00 UTC 10,345 bytes, 1 lines download raw bytes

1!function(){"use strict";function t(t){if(null==t)return!1;var e=String(t).trim().toLowerCase();return"true"===e||"1"===e||"yes"===e||"y"===e||"on"===e}function e(t){var e=[];if(!t)return e;try{for(var i,n=[],r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:function(t){return/\S/.test(t.nodeValue)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});i=r.nextNode();)n.push(i);for(var o=0;o<n.length;o++){var a=n[o];if(a.parentNode){for(var s=(a.nodeValue||"").match(/\S+|\s+/g)||[],l=document.createDocumentFragment(),h=0;h<s.length;h++){var u=s[h];if(/\s+/.test(u))l.appendChild(document.createTextNode(u));else{var d=document.createElement("span");d.textContent=u,d.className="nectar-chat-thread__word",d.style.opacity="0",e.push(d),l.appendChild(d)}}a.parentNode.replaceChild(l,a)}}}catch(t){}return e}function i(t){if(t)for(var e=t.querySelectorAll(".nectar-chat-thread__word"),i=0;i<e.length;i++){var n=e[i],r=document.createTextNode(n.textContent);n.parentNode&&n.parentNode.replaceChild(r,n)}}function n(t,e){try{t&&e&&t.unobserve(e)}catch(t){}}function r(e){var i;this.rootElement=e,this.animationType=(e.getAttribute("data-animation")||"fade").toLowerCase(),"fade-in"===this.animationType&&(this.animationType="fade"),this.shouldLoop=t(e.getAttribute("data-loop-animation")),this.usingFrontEndEditor=!(!window.nectarDOMInfo||!window.nectarDOMInfo.usingFrontEndEditor),this.usingFrontEndEditor&&(this.shouldLoop=!1),this.autoHeight=t(e.getAttribute("data-auto-height-animation")),this.bubbles=(i=e,Array.prototype.slice.call(i.querySelectorAll(".nectar-chat-thread__bubble"))),this.bubbleWordSpans=[],this.hasStarted=!1,this.isInView=!1,this.timeline=null,this.observer=null,this._cachedRadius=null,this._resizeTimer=null,this._onResizeBound=this._handleResize.bind(this),this._needsTimelineRebuild=!1,this._suppressNextCompleteRestart=!1,this.prepareInitialState(),this.createIntersectionObserver(),this.events()}r.prototype.prepareInitialState=function(){if("fade"===this.animationType)for(var t=0;t<this.bubbles.length;t++){var n=this.bubbles[t];n.style.opacity="0",n.style.transform="translateY(0px)"}else if("typing"===this.animationType)for(var r=0;r<this.bubbles.length;r++){var o=this.bubbles[r].querySelector(".nectar-chat-thread__bubble-content__inner");if(o)if(0!==r)if(o.querySelector(".nectar-chat-thread__word")){for(var a=Array.prototype.slice.call(o.querySelectorAll(".nectar-chat-thread__word")),s=0;s<a.length;s++)a[s].style.opacity="0";this.bubbleWordSpans.push(a)}else this.bubbleWordSpans.push(e(o));else o.querySelector(".nectar-chat-thread__word")&&i(o),this.bubbleWordSpans.push([]);else this.bubbleWordSpans.push([])}},r.prototype.events=function(){!!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)?window.addEventListener("orientationchange",this._onResizeBound):window.addEventListener("resize",this._onResizeBound)},r.prototype._handleResize=function(){var t=this;this.autoHeight&&(this._resizeTimer&&window.clearTimeout(this._resizeTimer),this._resizeTimer=window.setTimeout(function(){try{"typing"===t.animationType&&(t.isInView&&t.timeline?t.startTypingAnimation(!0):t._needsTimelineRebuild=!0)}catch(t){}},120))},r.prototype.getBorderRadiusValue=function(){if(this._cachedRadius)return this._cachedRadius;try{var t=window.getComputedStyle(this.rootElement).getPropertyValue("--border-radius"),e=t&&String(t).trim().length>0?String(t).trim():"10px";return this._cachedRadius=e,e}catch(t){return"10px"}},r.prototype.getRadiusStringForDirection=function(t){var e=this.getBorderRadiusValue();return"outgoing"===t?e+" "+e+" 0 "+e:e+" "+e+" "+e+" 0"},r.prototype.createIntersectionObserver=function(){var t=this;"IntersectionObserver"in window?(this.observer=new IntersectionObserver(function(e){for(var i=0;i<e.length;i++){var n=e[i];n.target===t.rootElement&&(n.isIntersecting||n.intersectionRatio>0?t.onEnterViewport():t.onExitViewport())}},{threshold:.2,rootMargin:"0px 0px -100px 0px"}),this.observer.observe(this.rootElement)):(this.isInView=!0,this.startAnimation())},r.prototype.onEnterViewport=function(){if(this.isInView=!0,this.hasStarted){if(this.shouldLoop&&this.timeline&&this.timeline.paused)try{this._needsTimelineRebuild&&"typing"===this.animationType?(this._needsTimelineRebuild=!1,this.startTypingAnimation(!0)):this.timeline.play()}catch(t){}}else this.startAnimation()},r.prototype.onExitViewport=function(){if(this.isInView=!1,this.shouldLoop&&this.timeline)try{this.timeline.pause()}catch(t){}},r.prototype.startAnimation=function(t){!0!==t&&(this.hasStarted=!0),"typing"===this.animationType?this.startTypingAnimation():this.startFadeAnimation()},r.prototype.startFadeAnimation=function(){var t=this,e=this.bubbles;if(e&&0!==e.length){if(this.timeline)try{this.timeline.pause()}catch(t){}this.timeline=window.anime.timeline({autoplay:!1,loop:this.shouldLoop,easing:"easeOutQuart",duration:1e3,begin:function(){for(var t=0;t<e.length;t++)e[t].style.opacity="0"},complete:function(){t.shouldLoop||n(t.observer,t.rootElement)}}),this.timeline.add({targets:e,opacity:[0,1],translateY:[30,0],delay:window.anime.
1stagger(300)});try{this.timeline.play()}catch(t){}}else n(this.observer,this.rootElement)},r.prototype.startTypingAnimation=function(){var t=this,e=this._collectTypingTargets(),i=e.groups,r=e.bubbleEls;if(i&&0!==i.length){if(this.timeline)try{this.timeline.pause()}catch(t){}this.timeline=window.anime.timeline({autoplay:!1,loop:!1,easing:"linear",begin:function(){try{r.forEach(function(t){t.classList.remove("animation-resetting")})}catch(t){}t._applyTypingBeginState(r,i)},complete:function(){if(t.shouldLoop&&t.isInView)try{t._suppressNextCompleteRestart?t._suppressNextCompleteRestart=!1:t.timeline.restart()}catch(t){}else t.shouldLoop||n(t.observer,t.rootElement)}});for(var o=0;o<i.length;o++)t._addRevealSequenceForBubble(o,i[o],r[o]);this.shouldLoop&&r.length>1&&(t._addLoopResetSequence(r),this.timeline.add({duration:1100}),this.timeline.add({duration:0,begin:function(){for(var e=1;e<r.length;e++){var i=r[e],n=i?i.querySelector(".nectar-chat-thread__bubble-content"):null;if(n){var o="outgoing"===i.getAttribute("data-direction"),a=t.getRadiusStringForDirection(o?"outgoing":"incoming");n.style.clipPath=o?"inset(100% 0% 0% 100% round "+a+")":"inset(100% 100% 0% 0% round "+a+")";for(var s=i.querySelectorAll(".nectar-chat-thread__word"),l=0;l<s.length;l++)s[l].style.opacity="0";t.autoHeight&&(i.style.maxHeight="0px")}}}}));try{this.timeline.play()}catch(t){}}else n(this.observer,this.rootElement)},r.prototype._collectTypingTargets=function(){for(var t=[],n=[],r=0;r<this.bubbles.length;r++){var o=this.bubbles[r].querySelector(".nectar-chat-thread__bubble-content__inner");if(n.push(this.bubbles[r]),o)if(0!==r){var a=o.querySelectorAll(".nectar-chat-thread__word");t.push(a&&a.length>0?Array.prototype.slice.call(a):e(o))}else o.querySelector(".nectar-chat-thread__word")&&i(o),t.push([]);else t.push([])}return{groups:t,bubbleEls:n}},r.prototype._applyTypingBeginState=function(t,e){for(var i=0;i<t.length;i++)t[i].style.opacity=0===i?"1":"0";for(var n=0;n<e.length;n++)for(var r=e[n],o=0;o<r.length;o++)r[o].style.opacity=0===n?"1":"0";if(t[0]){var a=t[0].querySelector(".nectar-chat-thread__bubble-content");if(a){var s="outgoing"===t[0].getAttribute("data-direction"),l=this.getRadiusStringForDirection(s?"outgoing":"incoming");a.style.clipPath="inset(0% 0% 0% 0% round "+l+")"}}if(this.autoHeight)for(var h=1;h<t.length;h++)t[h]&&(t[h].style.maxHeight="0px")},r.prototype._addRevealSequenceForBubble=function(t,e,i){var n=i?i.querySelector(".nectar-chat-thread__bubble-content"):null;if(0!==t){this.autoHeight&&t>0&&this.timeline.add({targets:i,maxHeight:["0px",function(t){return function(t){if(!t)return"0px";var e=t.style.maxHeight,i=t.style.overflow;t.style.maxHeight="none",t.style.overflow="visible";var n=t.scrollHeight||t.offsetHeight||0;if(t.style.maxHeight=e,t.style.overflow=i,n&&n>0)return n+"px";try{var r=t.cloneNode(!0);r.style.position="absolute",r.style.visibility="hidden",r.style.opacity="0",r.style.pointerEvents="none",r.style.maxHeight="none",r.style.height="auto",r.style.clipPath="none",document.body.appendChild(r);var o=r.scrollHeight||r.offsetHeight||0;return document.body.removeChild(r),Math.max(0,Math.ceil(o))+"px"}catch(t){return"0px"}}(t)}],duration:1100,easing:"easeOutQuart"});var r=i&&"outgoing"===i.getAttribute("data-direction"),o=this.getRadiusStringForDirection(r?"outgoing":"incoming"),a=r?"inset(100% 0% 0% 100% round "+o+")":"inset(100% 100% 0% 0% round "+o+")",s="inset(0% 0% 0% 0% round "+o+")",l=this.autoHeight&&t>0?"-=1100":void 0;this.timeline.add({targets:n,clipPath:[a,s],duration:1100,easing:"easeOutQuart"},l),this.timeline.add({targets:i,opacity:[0,1],duration:500,easing:"easeOutQuart"},"-=1100");var h=e.length||1,u=60,d=1100-(h-1)*u;d<500&&(u=(1100-(d=500))/Math.max(1,h-1)),this.timeline.add({targets:e,opacity:[0,1],duration:d,easing:"easeOutQuad",delay:window.anime.stagger(u)},"-=1100"),this.timeline.add({duration:1100})}else if(i&&(i.style.opacity="1"),n&&(n.style.clipPath="inset(0% 0% 0% 0% round "+this.getRadiusStringForDirection("incoming")+")"),e&&e.length)for(var c=0;c<e.length;c++)e[c].style.opacity="1"},r.prototype._addLoopResetSequence=function(t){for(var e=this,i=t.slice(1),n=[],r=0;r<i.length;r++){var o=i[r]?i[r].querySelector(".nectar-chat-thread__bubble-content"):null;o&&n.push(o)}
1e.timeline.add({begin:function(){i.forEach(function(t){t.classList.add("animation-resetting")})},targets:n,clipPath:function(t){var i=t?t.parentElement:null,n=i&&"outgoing"===i.getAttribute("data-direction"),r=e.getRadiusStringForDirection(n?"outgoing":"incoming");return n?"inset(100% 0% 0% 100% round "+r+")":"inset(100% 100% 0% 0% round "+r+")"},duration:1100,easing:"easeOutQuart"}),e.timeline.add({targets:i,opacity:[1,0],duration:500,easing:"easeOutQuart"},"-=1100"),e.autoHeight&&e.timeline.add({targets:i,maxHeight:"0px",duration:1100,easing:"easeOutQuart"},"-=1100")},r.initAll=function(){for(var t=document.querySelectorAll(".nectar-chat-thread"),e=0;e<t.length;e++)new r(t[e])},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",function(){r.initAll()}):r.initAll(),window&&window.jQuery&&window.jQuery(window).on("vc_reload",function(){window.setTimeout(r.initAll,200)}),window.NectarChatThread=r}();

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.