PageSourceSearch

https://widgets.textmagic.com/messenger-widget-script.js

js textmagic.com collected 2026-09-24 08:30:03 UTC 3,372 bytes, 1 lines download raw bytes

1(function(){var e=e=>{let n=document.createElement(`div`);return e&&n.setAttribute(`id`,e),n.style.cssText=`border: 0; background-color: transparent; pointer-events: none; overflow: visible; opacity: 1; max-width: 100%; max-height: 100%;`,t(n),n},t=e=>{!document.currentScript||document.currentScript.parentElement===document.head?document.body.appendChild(e):document.currentScript.after(e)},n=({wrapper:e,code:t,isPreview:n,path:r})=>{let i=document.createElement(`iframe`);return i.src=`${r||`https://widgets.textmagic.com`}/index.html?code=${t}`,n&&(i.src=`${i.src}&isPreview=true`),i.style.cssText=`pointer-events: all; background: none; border: 0; float: none; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; min-height: 0;`,i.allow=`fullscreen`,e.appendChild(i),i},r=e=>{let t=document.currentScript.getAttribute(e);if(!t)throw Error(`TM widget: ${e} not found`);return t},i=()=>r(`data-code`),a=()=>document.currentScript.getAttribute(`data-wrapper-id`)||void 0,o=()=>!!document.currentScript.getAttribute(`data-is-preview`),s=(e,t)=>{e.style.cssText+=`position: fixed; z-index: 2147483647; right: 10px; bottom: 0`,t.style.cssText+=`position: absolute`},c=(e,t,n)=>{let r=r=>{r.data.widgetId===e&&r.data.type===t&&n(r)};return window.addEventListener(`message`,r),()=>window.removeEventListener(`message`,r)},l=e=>{window.parent.postMessage(e,`*`)},u=(e,t)=>{e.contentWindow?.postMessage(t,`*`)},d=(e,t)=>{e.source?.postMessage(t,{targetOrigin:e.origin})},f=(e,t)=>({subscribe:n=>c(e,t,n),sendToParent:n=>{l({widgetId:e,type:t,payload:n})},sendToIframe:(n,r)=>{u(n,{widgetId:e,type:t,payload:r})},reply:(n,r)=>{d(n,{widgetId:e,type:t,payload:r})}}),p=e=>f(e,`textmagicMessengerPosition`),m=(e,t)=>p(e).subscribe(e=>{t(e.data.payload)}),h=null,g=(e,t,{isMobile:n})=>{let r=t||h;if(t&&(h=t),!r)return;let i=n?5:r.sideSpacing,a=n?5:r.bottomSpacing,o=n?`env(safe-area-inset-bottom, 0px)`:`0px`;e.style.width=`${r.width}px`,e.style.height=`${r.height}px`,e.style.bottom=`calc(${a-24}px + ${o})`,e.style.maxWidth=`calc(100% - ${i*2}px + 48px)`,e.style.maxHeight=`calc(100% - ${a*2}px + 48px - ${o})`,r.alignTo===`left`?(e.style.left=`${i-24}px`,e.style.right=`unset`):r.alignTo===`right`&&(e.style.left=`unset`,e.style.right=`${i-24}px`)},_=e=>f(e,`textmagicGetParentUrl`),v=e=>f(e,`textmagicSendParentUrl`),y=e=>_(e).subscribe(t=>{v(e).reply(t,window.location.href)}),b=e=>f(e,`textmagicSendParentResize`),x=e=>f(e,`textmagicGetParentResize`),S=768,C=390,w=e=>e.offsetWidth<=S,T=e=>e.offsetWidth<=C,E=e=>({isMobile:w(e),isParentSmaller:T(e)}),D=(e,t,n)=>{b(e).sendToIframe(t,n)},O=(e,t)=>{let n=new ResizeObserver(()=>{t(E(e))});return n.observe(e),()=>n.disconnect()},k=(e,t)=>x(e).subscribe(n=>{b(e).reply(n,E(t))}),A=e=>f(e,`textmagicMessengerTabActivity`),j=e=>{document.addEventListener(`visibilitychange`,()=>{e(document.visibilityState===`visible`)})},M=(e,t,n)=>{A(e).sendToIframe(t,n)},N=e=>f(e,`textmagicOpenLink`),P=(e,t)=>N(e).subscribe(e=>{t(e.data.payload)}),F=i(),I=a(),L=o(),R=e(I),z=n({wrapper:R,code:F,isPreview:L,path:`https://widgets.textmagic.com/messenger`});s(R,z),m(F,e=>{g(R,e,E(document.body))}),O(document.body,e=>{g(R,null,e),D(F,z,e)}),y(F),k(F,document.body),j(e=>{M(F,z,e)}),P(F,({href:e,openInNewWindow:t})=>{if(e)if(t){let t=window.open(e,`_blank`,`noopener,noreferrer`);t&&(t.opener=null)}else window.location.href=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.