@pendo/agent 2.325.0 → 2.327.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/debugger-plugin.min.js +1 -1
- package/dist/dom.esm.js +58 -49
- package/dist/pendo.module.js +687 -254
- package/dist/pendo.module.min.js +8 -6
- package/dist/servers.json +7 -7
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license https://agent.pendo.io/licenses
|
|
3
3
|
*/
|
|
4
|
-
!function(){"use strict";class L{constructor(e,t){this.path=e,this.handler=t}}class G{routes={};addRoute(e,t){this.routes[e]||(this.routes[e]=[]),this.routes[e].unshift(new L(e,t))}removeRoute(e){this.routes[e].shift()}lookupRouteProvider(){return e=>this.routes[e]?this.routes[e][0].handler:undefined}}const u=(...e)=>s=>{return[].concat(e).reduce((e,t,i,n)=>{e=t(e,s);return e||n.splice(i,n.length-i),e},s)};let W=0;const i=(e,t,i)=>{if(!e||"string"!=typeof t)return i;let n=e;for(const s of t.split(".")){if(null==n)return i;n=n[s]}return n===undefined?i:n};const t=(t,i)=>{if(t&&i)if(Array.isArray(t))for(let e=0;e<t.length;e++)i(t[e],e,t);else if("object"==typeof t)for(const e in t)t.hasOwnProperty(e)&&i(t[e],e,t);return t},h=e=>"function"==typeof e,O=e=>!(null==e),d=()=>Date.now();class e{app=null;router=null;destination=window.parent||window.top;origin="*";constructor(e,t={}){this.app=e,this.router=e.router,this.config=t,this.events=e.PluginAPI.getEventable()}getConfig(e,t){return i(this.config,e,t)}getDestinationProvider(){return()=>this.destination}getOriginProvider(){return()=>this.origin}triggerOpened(){this.events.trigger("opened",{containerType:this.type})}triggerClosed(){this.events.trigger("closed",{containerType:this.type})}}var a={padding:"0 !important",margin:"0 !important","box-sizing":"border-box !important",border:"none !important",display:"block !important",visibility:"visible !important"},c=2147483647,p={WINDOW_MARGIN:10,HEADER_HEIGHT:50,TOP:100,LEFT:100,HEIGHT:700,WIDTH:500,MIN_HEIGHT:500,MIN_WIDTH:500};const{MIN_HEIGHT:g,MIN_WIDTH:l,WINDOW_MARGIN:f}=p;function s(t,i,n,s,o){let r=0,a=0,d=0,c=0;function u(e){e.preventDefault(),i.css({visibility:"hidden"}),t.releasePointerCapture(e.pointerId),t.removeEventListener("pointermove",h),o()}function h(e){-1!==e.button||0===e.buttons?u(e):(e.preventDefault(),d=r-e.clientX,c=a-e.clientY,r=e.clientX,a=e.clientY,s(d,c))}t.addEventListener("pointerdown",function(e){0===e.button&&(e.preventDefault(),i.css({visibility:"visible"}),r=e.clientX,a=e.clientY,t.setPointerCapture(e.pointerId),t.addEventListener("pointermove",h),n())}),t.addEventListener("pointerup",u),t.addEventListener("pointerout",u)}function U(e,t){const i=e.handle[0],n=e.container[0];s(i,e.blockout,function(){i.style.cursor="grabbing"},function(e,t){n.style.left=m(n,e)+"px",n.style.top=v(n,t)+"px"},function(){i.style.cursor="grab",t()})}function m(e,t){t=e.offsetLeft-t,e=window.innerWidth-e.offsetWidth-f;return t<f||e<f?f:e<t?e:t}function v(e,t){t=e.offsetTop-t,e=window.innerHeight-e.offsetHeight-f;return t<f||e<f?f:e<t?e:t}function _(e,t){var i=e.resizeHandle[0];const n=e.container[0];s(i,e.blockout,()=>{},function(e,t){n.style.width=b(n,e)+"px",n.style.height=w(n,t)+"px"},t)}function b(e,t){t=e.offsetWidth-t,e=window.innerWidth-e.offsetLeft-f;return e<t?e:t<l?l:t}function w(e,t){t=e.offsetHeight-t,e=window.innerHeight-e.offsetTop-f;return e<t?e:t<g?g:t}class F extends e{type="frame";destination=window.parent||window.top;origin=/^https?:/.test(window.location.protocol)?window.location.origin:"*";constructor(n,e){super(n,e);const{pendo:s,PluginAPI:o}=n;e=this.getConfig("containerId","pendo-client-app");this.container=s.dom(`<div id="${e}" class="pendo-ignore">`).css({...a,height:n.state.height,width:n.state.width,"z-index":c-1,"background-color":"#FFFFFF",position:"fixed","box-shadow":"rgb(136, 136, 136) 0px 0px 20px 0px",overflow:"hidden"}),this.handle=s.dom('<div id="pendo-app-draggable-handle">').css({...a,"z-index":c,height:p.HEADER_HEIGHT,width:"calc(100% - 100px)",position:"absolute",cursor:"grab"}).on("dblclick",()=>{n.state.minimized||(this.container.css({height:p.HEIGHT,width:p.WIDTH,transition:"all 250ms linear"}),setTimeout(()=>{this.container&&(this.container.css({transition:"none"}),this.saveSize())},250))}).appendTo(this.container),this.resizeHandle=s.dom('<div id="pendo-app-resize-handle">').css({...a,"z-index":c,visibility:this.app.state.minimized?"hidden":"visible",height:0,width:0,"border-left":"10px solid transparent","border-bottom":"10px solid rgb(136, 136, 136)",cursor:"nwse-resize",position:"absolute",bottom:0,right:0}).appendTo(this.container),this.frame=s.dom('<iframe id="pendo-agent-application" src="about:blank">').css({...a,height:"100%",width:"100%"}).on("load",()=>{if(o.ConfigReader.get("inlineStyleNonce")){const i=this.frame[0].contentDocument.createElement.bind(this.frame[0].contentDocument);this.frame[0].contentDocument.createElement=(e,...t)=>{t=i(e,...t);return"style"===e&&(e=o.ConfigReader.get("inlineStyleNonce"))&&t.setAttribute("nonce",e),t}}var e,t=document.createElement("script");t.src=((e=s)&&e.trustedTypesPolicy?e.trustedTypesPolicy:{createScriptURL(e){return e}}).createScriptURL(o.getAssetUrl(n.assetName)),this.frame[0].contentDocument.body.appendChild(t),this.frame[0].contentWindow.ignoreIframeMonitor=!0,this.triggerOpened()}).appendTo(this.container),this.blockout=s.dom('<div id="pendo-app-dragging-blockout">').css({"z-index":c-2,position:"absolute",height:"100%",width:"100%",top:0,left:0,visibility:"hidden"}).appendTo(s.dom.getBody()),this.elements=[this.container,this.blockout],this.positionFrame=e=>{var{left:t,top:i,height:n}=e,{minimized:e,width:s}=e,t=t||p.LEFT,i=i||p.TOP,n=e?p.HEADER_HEIGHT:n;t=m({offsetLeft:t,offsetWidth:s},0),i=v({offsetTop:i,offsetHeight:n},0),this.container.css({left:t,top:i,height:n}),this.savePosition()},this.saveSize=()=>{var{offsetHeight:e,offsetWidth:t}=this.container[0];e&&t&&this.app.setProperties({height:e,width:t})},this.savePosition=()=>{var{offsetLeft:e,offsetTop:t}=this.container[0];e&&t&&this.app.setProperties({left:e,top:t})},this.toggleMinimize=()=>{this.app.setProperties({minimized:!this.app.state.minimized}),this.resizeHandle.css({visibility:this.app.state.minimized?"hidden":"visible"}),this.positionFrame(this.app.state)},this.positionFrame(this.app.state),U(this,this.savePosition),_(this,this.saveSize),window.addEventListener("resize",r),this.listeners=[["resize",r]];const t=s._.throttle(()=>{return e=this.container[0],0<(t=e.offsetLeft+e.offsetWidth+f-window.innerWidth)&&(e.style.left=m(e,t)+"px",e.offsetWidth>l)&&(e.style.width=b(e,t)+"px"),void(0<(t=e.offsetTop+e.offsetHeight+f-window.innerHeight)&&(e.style.top=v(e,t)+"px",e.offsetHeight>g)&&(e.style.height=w(e,t)+"px"));var e,t},10),i=s._.debounce(()=>{this.savePosition(),this.saveSize()},1e3);function r(){t(),i()}}open(){return this.router.addRoute("app::toggleMinimize",this.toggleMinimize),this.container.appendTo(this.app.pendo.dom.getBody()),Promise.resolve()}close(){this.router.removeRoute("app::toggleMinimize"),this.listeners.forEach(([e,t])=>window.removeEventListener(e,t)),this.elements.forEach(e=>e.remove()),this.triggerClosed()}}const y="promise";function T(e,t,i){this.name=e,this.type=t,this.data=i}T.prototype.toString=function(){return`Message.${this.type} - `+this.name};const $=(e,t,i)=>{e=new T(e,t,i);return t===y&&(e.requestId=""+(W+=1)),e},C=e=>{try{var{name:t,type:i,isResponse:n,data:s,requestId:o,sender:r}=e.data||{},a=new T(t,i,O(s)?JSON.parse(s):undefined);return a.requestId=o,a.sender=r,a.destination=e.source,a.isResponse=n,a}catch(d){return!1}},q=e=>{var t=((e,t)=>{if(!e||"object"!=typeof e)return{};var i=Array.isArray(t)?t:[t],n={};for(const s in e)e.hasOwnProperty(s)&&!i.includes(s)&&(n[s]=e[s]);return n})(e,["destination","toString","data"]);return t.data=JSON.stringify(e.data,(e,t)=>"function"==typeof t||t instanceof RegExp?t.toString?t.toString():undefined:t),t},n=e=>(e.isResponse=!0,e),o="disconnected",P={lastMessageReceivedAt:0,currentConnectionQuality:o,changeCallbacks:{},evalCallbacks:{}},r=e=>{e!==P.currentConnectionQuality&&(P.currentConnectionQuality=e,t(P.changeCallbacks,e=>{e(P.currentConnectionQuality)}))},B=()=>{var e;0===P.lastMessageReceivedAt?r(o):((e=d()-P.lastMessageReceivedAt)<1e4?r("connected"):1e4<e&&(3e4<e?r("dead_connection"):r(o)),t(P.evalCallbacks,e=>{e(P.currentConnectionQuality)}))};let I;let R=0;const j=()=>{P.currentConnectionQuality=o,P.lastMessageReceivedAt=0},E={appName:undefined,connectionName:undefined,frameId:undefined,pendingRequests:{},topics:{},senderIds:{},originProvider:undefined,destinationProvider:undefined},S=()=>""+E.appName+E.connectionName+`(${E.frameId})`,H=e=>{e.sender||(e.sender=S());var t=e.destination||E.destinationProvider(),i=q(e),n=Q(e.sender),s=K(e.sender);n||s?n?n.postMessage(i):t.postMessage(i,E.originProvider()):(s=new MessageChannel,ee(s.port1,e.sender),t.postMessage(i,E.originProvider(),[s.port2]))},D=(s,o,r=1e3)=>new Promise((e,t)=>{const i=$(s,y,o),n=setTimeout(()=>{t(s+" timeout"),A(i),ie(i)},r);X(i,()=>clearTimeout(n),e,t),H(i)}),z=e=>{var t;return E.senderIds[e]||(t=e,E.senderIds[t])||(E.senderIds[t]={port:undefined,hasTriedToUpgradeToMessageChannel:!1}),E.senderIds[e]},Q=e=>z(e).port,K=e=>z(e).hasTriedToUpgradeToMessageChannel,X=(e,t,i,n)=>{E.pendingRequests[e.requestId]={message:e,clearTimeoutfn:t,resolve:i,reject:n}};const A=e=>{var t=e["requestId"];return E.pendingRequests[t].clearTimeoutfn(),delete E.pendingRequests[t],e};const k="message::ping";var Y;const J=u(e=>{var t=E.pendingRequests[e.requestId];return t&&(t.resolve(e.data),A(e)),e},t=>{var e=E.topics[t.name];return e&&e.forEach(e=>e(t.data)),t},t=>{var e;return t&&!t.isResponse&&(t.name===k?H(n(t)):(e=E.routeHandlerLookup(t.name))?e(t,e=>{t.data=e,H(n(t))}):console.log(S(),"No route handler for "+t.name,t)),t},(Y=()=>{var e;e=d(),P.lastMessageReceivedAt=e},(e,...t)=>(Y(e,...t),e))),V=e=>("*"===E.originProvider()||e.origin===E.originProvider())&&e,Z=e=>{var t=i(e,"data.sender");return!(!t||"string"!=typeof t||!t.includes(E.appName))&&e},ee=(e,t)=>{t=z(t);t.port=e,t.hasTriedToUpgradeToMessageChannel=!0,t.port.onmessage=u(C,J)},te=(e,t)=>{return!z(e.sender).hasTriedToUpgradeToMessageChannel&&t.ports&&t.ports[0]&&ee(t.ports[0],e.sender),e},ie=e=>{e=e.sender;(e=z(e)).port=undefined,e.hasTriedToUpgradeToMessageChannel=!1};let N=()=>{};const ne=()=>{N(),N=()=>{},I&&I(),j()},se=((n,s)=>{let o,r=0,a;return function(...e){var t=d(),i=s-(t-r);return i<=0||s<i?(o&&(clearTimeout(o),o=null),r=t,a=n.apply(this,e)):!o&&0<s&&(o=setTimeout(()=>{r=d(),o=null,a=n.apply(this,e)},i)),a}})(e=>{"connected"!==e&&E.usePingAutoReconnect&&D(k)["catch"](()=>{})},1e3),oe=(e,t,i,n,s,o=!1,r)=>{if(window.addEventListener){E.appName=e,E.frameId=t,E.routeHandlerLookup=i,E.usePingAutoReconnect=o,E.connectionName=r||"",E.originProvider=n||(()=>window.location.origin||"*"),E.destinationProvider=s||(()=>window.parent||window.top);{const d=setInterval(B,100);I=()=>clearInterval(d)}e=se;if(h(e)){const c=R++;P.evalCallbacks[c]=e}const a=u(V,Z,C,te,J);window.addEventListener("message",a),N=()=>window.removeEventListener("message",a)}},re=e=>{if(h(e)){const t=R++;P.changeCallbacks[t]=e}};class ae extends e{type="window";testUrl="";realUrl=undefined;getTitle(){return this.getConfig("title",this.getName())}getName(){return this.getConfig("name","Agent_Application")}open(){return this.router.addRoute("app::windowClosed",()=>{this.app.setProperties({containerType:"frame"}),this.app.stop()}),this.testConnection().then(()=>{this.triggerOpened()})["catch"](()=>{return this.createWindow(),s=this.app,o=1e3,new Promise((e,t)=>{const i=d(),n=()=>{s.getConnectionStatus()?e():d()-i>o?t():setTimeout(n,50)};n()});var s,o})}testConnection(){return this.destination=window.open(this.testUrl,this.getName(),`width=${this.app.state.width},height=${this.app.state.height},resizable=yes,scrollbars=yes,status=yes,location=no`),D("app::reconnect")}createWindow(){this.realUrl&&(this.destination=window.open(this.realUrl,this.getName(),`width=${this.app.state.width},height=${this.app.state.height},resizable=yes,scrollbars=yes,status=yes,location=no`));var e=document.createElement("script");e.src=this.app.PluginAPI.getAssetUrl(this.app.assetName),this.destination.document.body.appendChild(e),this.destination.document.title=this.getTitle()}close(){this.router.removeRoute("app::windowClosed"),this.destination.close(),this.triggerClosed()}}const de=()=>({});class ce{defaultState={containerType:"frame",minimized:!1,height:p.HEIGHT,width:p.WIDTH,left:p.LEFT,top:p.TOP};state={};containerClosedCallbacks=[];container=null;isConnected=!1;constructor(e,t,i,n,s,o=de,r=de){this.appName=e,this.assetName=t,this.assetStorageKey=i,this.connectionName=n,this.frameConfigProvider=o,this.windowConfigProvider=r,s&&Object.assign(this.defaultState,s),this.router=new G}init(e,t){this.pendo=e,this.PluginAPI=t,this.events=t.getEventable(),this.router.addRoute("app::ping",(e,t)=>{t()}),this.router.addRoute("app::setProperties",({data:e})=>{this.setProperties(e)}),this.router.addRoute("app::toggleContainer",()=>{this.setProperties({minimized:!1}),this.toggleContainerType()}),this.router.addRoute("app::windowClosed",()=>{}),this.loadState(),this.prepContainer(),this.start()}prepContainer(){this.container="window"===this.state.containerType?new ae(this,this.windowConfigProvider()):new F(this,this.frameConfigProvider())}setConnectionStatus(e){this.isConnected="connected"===e}getConnectionStatus(){return this.isConnected}setProperties(e){Object.assign(this.state,e),this.writeState()}getDefaultState(){return this.defaultState||{}}loadState(){try{var e=this.PluginAPI.agentStorage.read(this.assetStorageKey);this.state=Object.assign({},this.getDefaultState(),this.state,e)}catch(t){this.PluginAPI.log.error(t),this.state=Object.assign({},this.getDefaultState(),this.state)}}writeState(){this.PluginAPI.agentStorage.write(this.assetStorageKey,this.state)}toggleContainerType(){var e="frame"===this.state.containerType?"window":"frame";this.setProperties({containerType:e}),this.stop(),this.start()}start(){this.container||this.prepContainer();var e=this.PluginAPI.EventTracer.addTracerIds({})["frameId"];oe(this.appName,e,this.router.lookupRouteProvider(),this.container.getOriginProvider(),this.container.getDestinationProvider(),!0,this.connectionName),re(e=>{this.setConnectionStatus(e)}),this.container.open().then(()=>{this.events.trigger("mounted")})["catch"](()=>{"window"===this.state.containerType?(this.setProperties({containerType:"frame"}),this.prepContainer(),this.start()):(this.PluginAPI.log(`Failed to start ${this.appName} in either window or frame.`),this.stop())})}stop(){this.container.close(),this.container=null,this.events.trigger("unmounted"),ne()}}const ue=()=>{try{return performance.getEntries()}catch(e){return[{failedGetEntries:!0,message:e.message,stack:e.stack}]}};class he extends ce{constructor(){super("Debugger","pendo.debugger.min.js","debug-enabled","AgentPlugin",null,()=>({containerId:"pendo-client-debugger"}),()=>({title:"Pendo Debugger"}))}initialize(s,o){o.restartDebugger=this.start.bind(this),super.init(s,o),this.router.addRoute("debugger::connect",(e,t)=>{var i;t({config:o.ConfigReader.audit(),env:{apiKey:(i=s).apiKey,environment:i.debugging.isStagingServer()?"staging":"production",device:i.debugging.isMobileUserAgent()?"mobile":"desktop",browserCookies:window.navigator.cookieEnabled,guideStatus:i.areGuidesDisabled()?"off":i.areGuidesDelayed()?"delayed":"on",foundShadowRoot:!!(i=i.debugging.observer.shadowDom).foundShadowRoots||(i.findShadowRoots(document,Infinity,()=>{}),i.foundShadowRoots)},container:this.state,events:o.store.state["debugger"].eventsCaptured,timeOrigin:performance.timeOrigin})}),this.router.addRoute("debugger::stop",()=>{s.disableDebugging()}),this.router.addRoute("debugger::showGuideById",(e,t)=>{t(s.showGuideById(e.data))}),this.router.addRoute("debugger::toggleGuideLoop",e=>{e.data?s.startGuides():s.stopGuides()}),this.router.addRoute("debugger::tombstoneGuide",e=>{e=s.findGuideById(e.data);o.Tombstone.addGuide(e)}),this.router.addRoute("debugger::openGuidePage",e=>{e=e.data,n=s,t=o.hosts.SERVER;var t,i,n=(i=n.findGuideById(e))&&n._.get(i,"attributes.resourceCenter")?i.attributes.resourceCenter.isTopLevel?`${t}/resource-center/${i.id}/draft`:(n=n.BuildingBlocks.BuildingBlockResourceCenter.getResourceCenter())&&n.id?`${t}/resource-center/${n.id}/module/`+i.id:"":t+"/guides/"+e;n&&window.open(n,"_blank")}),this.router.addRoute("debugger::restore",({data:e})=>{if(e&&e.length){const t=document.createElement("iframe");t.sandbox="allow-same-origin",t.src="about:blank",t.hidden=!0,document.body.appendChild(t),t.contentWindow.ignoreIframeMonitor=!0,e.forEach(e=>{e.id.split(".").reduce((e,t,i,n)=>i===n.length-1?(e.destination[t]=e.source[t],e.destination[t]):(e.destination=e.destination[t],e.source=e.source[t],e),{destination:window,source:t.contentWindow})}),document.body.removeChild(t)}}),this.router.addRoute("debugger::sync",(e,i)=>{const t=o.store.subscribe((e,t)=>{"debugger/eventsCaptured"===e.type&&i({action:"events/eventsCaptured",data:t["debugger"].eventsCaptured})}),n=setInterval(()=>{i({action:"agent/sync",data:o.store.state}),i({action:"environment/validateEnvironment",data:s.validateEnvironment(!0)}),i({action:"performance/sync",data:ue()})},500);this.events.on("unmounted",()=>{clearInterval(n),t()})}),this.router.addRoute("debugger::enableEventLogging",({data:e})=>{this.setProperties({enableEventLogging:e}),o.store.dispatch("debugger/enableEventLogging",e)}),this.router.addRoute("debugger::clearEventsCaptured",()=>{o.store.dispatch("debugger/clearEventsCaptured")}),this.router.addRoute("debugger::checkGuideEligibility",({data:e},t)=>{o.store.dispatch("debugger/checkGuideEligibility",{guideId:e,response:t})}),this.router.addRoute("debugger::testSelector",({data:e},t)=>{o.store.dispatch("debugger/testSelector",{selector:e,response:t})})}teardown(){super.stop(),this.setProperties({enabled:!1,containerType:"frame"})}}var x=new he,pe={initialize(e,t){x.initialize(e,t);const i=e.disableDebugging;e.disableDebugging=()=>{x.teardown(),i(),e.disableDebugging=i}},teardown(){x.teardown()}},ge=document.getElementById("pendo-debugger-plugin");let M="pendo";ge&&(M=ge.getAttribute("data-pendo-global-key")||"pendo"),window[M].addExtension&&window[M].addExtension({name:"Debugger",version:"1.0.0",type:"agent",use:"plugin",uri:pe})}();
|
|
4
|
+
!function(){"use strict";class L{constructor(e,t){this.path=e,this.handler=t}}class G{routes={};addRoute(e,t){this.routes[e]||(this.routes[e]=[]),this.routes[e].unshift(new L(e,t))}removeRoute(e){this.routes[e].shift()}lookupRouteProvider(){return e=>this.routes[e]?this.routes[e][0].handler:undefined}}const u=(...e)=>s=>{return[].concat(e).reduce((e,t,i,n)=>{e=t(e,s);return e||n.splice(i,n.length-i),e},s)};let W=0;const i=(e,t,i)=>{if(!e||"string"!=typeof t)return i;let n=e;for(const s of t.split(".")){if(null==n)return i;n=n[s]}return n===undefined?i:n};const t=(t,i)=>{if(t&&i)if(Array.isArray(t))for(let e=0;e<t.length;e++)i(t[e],e,t);else if("object"==typeof t)for(const e in t)t.hasOwnProperty(e)&&i(t[e],e,t);return t},h=e=>"function"==typeof e,O=e=>!(null==e),d=()=>Date.now();class e{app=null;router=null;destination=window.parent||window.top;origin="*";constructor(e,t={}){this.app=e,this.router=e.router,this.config=t,this.events=e.PluginAPI.getEventable()}getConfig(e,t){return i(this.config,e,t)}getDestinationProvider(){return()=>this.destination}getOriginProvider(){return()=>this.origin}triggerOpened(){this.events.trigger("opened",{containerType:this.type})}triggerClosed(){this.events.trigger("closed",{containerType:this.type})}}var a={padding:"0 !important",margin:"0 !important","box-sizing":"border-box !important",border:"none !important",display:"block !important",visibility:"visible !important"},c=2147483647,p={WINDOW_MARGIN:10,HEADER_HEIGHT:50,TOP:100,LEFT:100,HEIGHT:700,WIDTH:500,MIN_HEIGHT:500,MIN_WIDTH:500};const{MIN_HEIGHT:g,MIN_WIDTH:l,WINDOW_MARGIN:f}=p;function s(t,i,n,s,o){let r=0,a=0,d=0,c=0;function u(e){e.preventDefault(),i.css({visibility:"hidden"}),t.releasePointerCapture(e.pointerId),t.removeEventListener("pointermove",h),o()}function h(e){-1!==e.button||0===e.buttons?u(e):(e.preventDefault(),d=r-e.clientX,c=a-e.clientY,r=e.clientX,a=e.clientY,s(d,c))}t.addEventListener("pointerdown",function(e){0===e.button&&(e.preventDefault(),i.css({visibility:"visible"}),r=e.clientX,a=e.clientY,t.setPointerCapture(e.pointerId),t.addEventListener("pointermove",h),n())}),t.addEventListener("pointerup",u),t.addEventListener("pointerout",u)}function U(e,t){const i=e.handle[0],n=e.container[0];s(i,e.blockout,function(){i.style.cursor="grabbing"},function(e,t){n.style.left=m(n,e)+"px",n.style.top=v(n,t)+"px"},function(){i.style.cursor="grab",t()})}function m(e,t){t=e.offsetLeft-t,e=window.innerWidth-e.offsetWidth-f;return t<f||e<f?f:e<t?e:t}function v(e,t){t=e.offsetTop-t,e=window.innerHeight-e.offsetHeight-f;return t<f||e<f?f:e<t?e:t}function _(e,t){var i=e.resizeHandle[0];const n=e.container[0];s(i,e.blockout,()=>{},function(e,t){n.style.width=b(n,e)+"px",n.style.height=w(n,t)+"px"},t)}function b(e,t){t=e.offsetWidth-t,e=window.innerWidth-e.offsetLeft-f;return e<t?e:t<l?l:t}function w(e,t){t=e.offsetHeight-t,e=window.innerHeight-e.offsetTop-f;return e<t?e:t<g?g:t}class F extends e{type="frame";destination=window.parent||window.top;origin=/^https?:/.test(window.location.protocol)?window.location.origin:"*";constructor(n,e){super(n,e);const{pendo:s,PluginAPI:o}=n;e=this.getConfig("containerId","pendo-client-app");this.container=s.dom(`<div id="${e}" class="pendo-ignore">`).css({...a,height:n.state.height,width:n.state.width,"z-index":c-1,"background-color":"#FFFFFF",position:"fixed","box-shadow":"rgb(136, 136, 136) 0px 0px 20px 0px",overflow:"hidden"}),this.handle=s.dom('<div id="pendo-app-draggable-handle">').css({...a,"z-index":c,height:p.HEADER_HEIGHT,width:"calc(100% - 100px)",position:"absolute",cursor:"grab"}).on("dblclick",()=>{n.state.minimized||(this.container.css({height:p.HEIGHT,width:p.WIDTH,transition:"all 250ms linear"}),setTimeout(()=>{this.container&&(this.container.css({transition:"none"}),this.saveSize())},250))}).appendTo(this.container),this.resizeHandle=s.dom('<div id="pendo-app-resize-handle">').css({...a,"z-index":c,visibility:this.app.state.minimized?"hidden":"visible",height:0,width:0,"border-left":"10px solid transparent","border-bottom":"10px solid rgb(136, 136, 136)",cursor:"nwse-resize",position:"absolute",bottom:0,right:0}).appendTo(this.container),this.frame=s.dom('<iframe id="pendo-agent-application" src="about:blank">').css({...a,height:"100%",width:"100%"}).on("load",()=>{if(o.ConfigReader.get("inlineStyleNonce")){const i=this.frame[0].contentDocument.createElement.bind(this.frame[0].contentDocument);this.frame[0].contentDocument.createElement=(e,...t)=>{t=i(e,...t);return"style"===e&&(e=o.ConfigReader.get("inlineStyleNonce"))&&t.setAttribute("nonce",e),t}}var e,t=document.createElement("script");t.src=((e=s)&&e.trustedTypesPolicy?e.trustedTypesPolicy:{createScriptURL(e){return e}}).createScriptURL(o.hosts.getAssetUrl(n.assetName)),this.frame[0].contentDocument.body.appendChild(t),this.frame[0].contentWindow.ignoreIframeMonitor=!0,this.triggerOpened()}).appendTo(this.container),this.blockout=s.dom('<div id="pendo-app-dragging-blockout">').css({"z-index":c-2,position:"absolute",height:"100%",width:"100%",top:0,left:0,visibility:"hidden"}).appendTo(s.dom.getBody()),this.elements=[this.container,this.blockout],this.positionFrame=e=>{var{left:t,top:i,height:n}=e,{minimized:e,width:s}=e,t=t||p.LEFT,i=i||p.TOP,n=e?p.HEADER_HEIGHT:n;t=m({offsetLeft:t,offsetWidth:s},0),i=v({offsetTop:i,offsetHeight:n},0),this.container.css({left:t,top:i,height:n}),this.savePosition()},this.saveSize=()=>{var{offsetHeight:e,offsetWidth:t}=this.container[0];e&&t&&this.app.setProperties({height:e,width:t})},this.savePosition=()=>{var{offsetLeft:e,offsetTop:t}=this.container[0];e&&t&&this.app.setProperties({left:e,top:t})},this.toggleMinimize=()=>{this.app.setProperties({minimized:!this.app.state.minimized}),this.resizeHandle.css({visibility:this.app.state.minimized?"hidden":"visible"}),this.positionFrame(this.app.state)},this.positionFrame(this.app.state),U(this,this.savePosition),_(this,this.saveSize),window.addEventListener("resize",r),this.listeners=[["resize",r]];const t=s._.throttle(()=>{return e=this.container[0],0<(t=e.offsetLeft+e.offsetWidth+f-window.innerWidth)&&(e.style.left=m(e,t)+"px",e.offsetWidth>l)&&(e.style.width=b(e,t)+"px"),void(0<(t=e.offsetTop+e.offsetHeight+f-window.innerHeight)&&(e.style.top=v(e,t)+"px",e.offsetHeight>g)&&(e.style.height=w(e,t)+"px"));var e,t},10),i=s._.debounce(()=>{this.savePosition(),this.saveSize()},1e3);function r(){t(),i()}}open(){return this.router.addRoute("app::toggleMinimize",this.toggleMinimize),this.container.appendTo(this.app.pendo.dom.getBody()),Promise.resolve()}close(){this.router.removeRoute("app::toggleMinimize"),this.listeners.forEach(([e,t])=>window.removeEventListener(e,t)),this.elements.forEach(e=>e.remove()),this.triggerClosed()}}const y="promise";function T(e,t,i){this.name=e,this.type=t,this.data=i}T.prototype.toString=function(){return`Message.${this.type} - `+this.name};const $=(e,t,i)=>{e=new T(e,t,i);return t===y&&(e.requestId=""+(W+=1)),e},C=e=>{try{var{name:t,type:i,isResponse:n,data:s,requestId:o,sender:r}=e.data||{},a=new T(t,i,O(s)?JSON.parse(s):undefined);return a.requestId=o,a.sender=r,a.destination=e.source,a.isResponse=n,a}catch(d){return!1}},q=e=>{var t=((e,t)=>{if(!e||"object"!=typeof e)return{};var i=Array.isArray(t)?t:[t],n={};for(const s in e)e.hasOwnProperty(s)&&!i.includes(s)&&(n[s]=e[s]);return n})(e,["destination","toString","data"]);return t.data=JSON.stringify(e.data,(e,t)=>"function"==typeof t||t instanceof RegExp?t.toString?t.toString():undefined:t),t},n=e=>(e.isResponse=!0,e),o="disconnected",P={lastMessageReceivedAt:0,currentConnectionQuality:o,changeCallbacks:{},evalCallbacks:{}},r=e=>{e!==P.currentConnectionQuality&&(P.currentConnectionQuality=e,t(P.changeCallbacks,e=>{e(P.currentConnectionQuality)}))},B=()=>{var e;0===P.lastMessageReceivedAt?r(o):((e=d()-P.lastMessageReceivedAt)<1e4?r("connected"):1e4<e&&(3e4<e?r("dead_connection"):r(o)),t(P.evalCallbacks,e=>{e(P.currentConnectionQuality)}))};let I;let R=0;const j=()=>{P.currentConnectionQuality=o,P.lastMessageReceivedAt=0},E={appName:undefined,connectionName:undefined,frameId:undefined,pendingRequests:{},topics:{},senderIds:{},originProvider:undefined,destinationProvider:undefined},S=()=>""+E.appName+E.connectionName+`(${E.frameId})`,H=e=>{e.sender||(e.sender=S());var t=e.destination||E.destinationProvider(),i=q(e),n=Q(e.sender),s=K(e.sender);n||s?n?n.postMessage(i):t.postMessage(i,E.originProvider()):(s=new MessageChannel,ee(s.port1,e.sender),t.postMessage(i,E.originProvider(),[s.port2]))},D=(s,o,r=1e3)=>new Promise((e,t)=>{const i=$(s,y,o),n=setTimeout(()=>{t(s+" timeout"),A(i),ie(i)},r);X(i,()=>clearTimeout(n),e,t),H(i)}),z=e=>{var t;return E.senderIds[e]||(t=e,E.senderIds[t])||(E.senderIds[t]={port:undefined,hasTriedToUpgradeToMessageChannel:!1}),E.senderIds[e]},Q=e=>z(e).port,K=e=>z(e).hasTriedToUpgradeToMessageChannel,X=(e,t,i,n)=>{E.pendingRequests[e.requestId]={message:e,clearTimeoutfn:t,resolve:i,reject:n}};const A=e=>{var t=e["requestId"];return E.pendingRequests[t].clearTimeoutfn(),delete E.pendingRequests[t],e};const k="message::ping";var Y;const J=u(e=>{var t=E.pendingRequests[e.requestId];return t&&(t.resolve(e.data),A(e)),e},t=>{var e=E.topics[t.name];return e&&e.forEach(e=>e(t.data)),t},t=>{var e;return t&&!t.isResponse&&(t.name===k?H(n(t)):(e=E.routeHandlerLookup(t.name))?e(t,e=>{t.data=e,H(n(t))}):console.log(S(),"No route handler for "+t.name,t)),t},(Y=()=>{var e;e=d(),P.lastMessageReceivedAt=e},(e,...t)=>(Y(e,...t),e))),V=e=>("*"===E.originProvider()||e.origin===E.originProvider())&&e,Z=e=>{var t=i(e,"data.sender");return!(!t||"string"!=typeof t||!t.includes(E.appName))&&e},ee=(e,t)=>{t=z(t);t.port=e,t.hasTriedToUpgradeToMessageChannel=!0,t.port.onmessage=u(C,J)},te=(e,t)=>{return!z(e.sender).hasTriedToUpgradeToMessageChannel&&t.ports&&t.ports[0]&&ee(t.ports[0],e.sender),e},ie=e=>{e=e.sender;(e=z(e)).port=undefined,e.hasTriedToUpgradeToMessageChannel=!1};let N=()=>{};const ne=()=>{N(),N=()=>{},I&&I(),j()},se=((n,s)=>{let o,r=0,a;return function(...e){var t=d(),i=s-(t-r);return i<=0||s<i?(o&&(clearTimeout(o),o=null),r=t,a=n.apply(this,e)):!o&&0<s&&(o=setTimeout(()=>{r=d(),o=null,a=n.apply(this,e)},i)),a}})(e=>{"connected"!==e&&E.usePingAutoReconnect&&D(k)["catch"](()=>{})},1e3),oe=(e,t,i,n,s,o=!1,r)=>{if(window.addEventListener){E.appName=e,E.frameId=t,E.routeHandlerLookup=i,E.usePingAutoReconnect=o,E.connectionName=r||"",E.originProvider=n||(()=>window.location.origin||"*"),E.destinationProvider=s||(()=>window.parent||window.top);{const d=setInterval(B,100);I=()=>clearInterval(d)}e=se;if(h(e)){const c=R++;P.evalCallbacks[c]=e}const a=u(V,Z,C,te,J);window.addEventListener("message",a),N=()=>window.removeEventListener("message",a)}},re=e=>{if(h(e)){const t=R++;P.changeCallbacks[t]=e}};class ae extends e{type="window";testUrl="";realUrl=undefined;getTitle(){return this.getConfig("title",this.getName())}getName(){return this.getConfig("name","Agent_Application")}open(){return this.router.addRoute("app::windowClosed",()=>{this.app.setProperties({containerType:"frame"}),this.app.stop()}),this.testConnection().then(()=>{this.triggerOpened()})["catch"](()=>{return this.createWindow(),s=this.app,o=1e3,new Promise((e,t)=>{const i=d(),n=()=>{s.getConnectionStatus()?e():d()-i>o?t():setTimeout(n,50)};n()});var s,o})}testConnection(){return this.destination=window.open(this.testUrl,this.getName(),`width=${this.app.state.width},height=${this.app.state.height},resizable=yes,scrollbars=yes,status=yes,location=no`),D("app::reconnect")}createWindow(){this.realUrl&&(this.destination=window.open(this.realUrl,this.getName(),`width=${this.app.state.width},height=${this.app.state.height},resizable=yes,scrollbars=yes,status=yes,location=no`));var e=document.createElement("script");e.src=this.app.PluginAPI.hosts.getAssetUrl(this.app.assetName),this.destination.document.body.appendChild(e),this.destination.document.title=this.getTitle()}close(){this.router.removeRoute("app::windowClosed"),this.destination.close(),this.triggerClosed()}}const de=()=>({});class ce{defaultState={containerType:"frame",minimized:!1,height:p.HEIGHT,width:p.WIDTH,left:p.LEFT,top:p.TOP};state={};containerClosedCallbacks=[];container=null;isConnected=!1;constructor(e,t,i,n,s,o=de,r=de){this.appName=e,this.assetName=t,this.assetStorageKey=i,this.connectionName=n,this.frameConfigProvider=o,this.windowConfigProvider=r,s&&Object.assign(this.defaultState,s),this.router=new G}init(e,t){this.pendo=e,this.PluginAPI=t,this.events=t.getEventable(),this.router.addRoute("app::ping",(e,t)=>{t()}),this.router.addRoute("app::setProperties",({data:e})=>{this.setProperties(e)}),this.router.addRoute("app::toggleContainer",()=>{this.setProperties({minimized:!1}),this.toggleContainerType()}),this.router.addRoute("app::windowClosed",()=>{}),this.loadState(),this.prepContainer(),this.start()}prepContainer(){this.container="window"===this.state.containerType?new ae(this,this.windowConfigProvider()):new F(this,this.frameConfigProvider())}setConnectionStatus(e){this.isConnected="connected"===e}getConnectionStatus(){return this.isConnected}setProperties(e){Object.assign(this.state,e),this.writeState()}getDefaultState(){return this.defaultState||{}}loadState(){try{var e=this.PluginAPI.agentStorage.read(this.assetStorageKey);this.state=Object.assign({},this.getDefaultState(),this.state,e)}catch(t){this.PluginAPI.log.error(t),this.state=Object.assign({},this.getDefaultState(),this.state)}}writeState(){this.PluginAPI.agentStorage.write(this.assetStorageKey,this.state)}toggleContainerType(){var e="frame"===this.state.containerType?"window":"frame";this.setProperties({containerType:e}),this.stop(),this.start()}start(){this.container||this.prepContainer();var e=this.PluginAPI.EventTracer.addTracerIds({})["frameId"];oe(this.appName,e,this.router.lookupRouteProvider(),this.container.getOriginProvider(),this.container.getDestinationProvider(),!0,this.connectionName),re(e=>{this.setConnectionStatus(e)}),this.container.open().then(()=>{this.events.trigger("mounted")})["catch"](()=>{"window"===this.state.containerType?(this.setProperties({containerType:"frame"}),this.prepContainer(),this.start()):(this.PluginAPI.log(`Failed to start ${this.appName} in either window or frame.`),this.stop())})}stop(){this.container.close(),this.container=null,this.events.trigger("unmounted"),ne()}}const ue=()=>{try{return performance.getEntries()}catch(e){return[{failedGetEntries:!0,message:e.message,stack:e.stack}]}};class he extends ce{constructor(){super("Debugger","pendo.debugger.min.js","debug-enabled","AgentPlugin",null,()=>({containerId:"pendo-client-debugger"}),()=>({title:"Pendo Debugger"}))}initialize(s,o){o.restartDebugger=this.start.bind(this),super.init(s,o),this.router.addRoute("debugger::connect",(e,t)=>{var i;t({config:o.ConfigReader.audit(),env:{apiKey:(i=s).apiKey,environment:i.debugging.isStagingServer()?"staging":"production",device:i.debugging.isMobileUserAgent()?"mobile":"desktop",browserCookies:window.navigator.cookieEnabled,guideStatus:i.areGuidesDisabled()?"off":i.areGuidesDelayed()?"delayed":"on",foundShadowRoot:!!(i=i.debugging.observer.shadowDom).foundShadowRoots||(i.findShadowRoots(document,Infinity,()=>{}),i.foundShadowRoots)},container:this.state,events:o.store.state["debugger"].eventsCaptured,timeOrigin:performance.timeOrigin})}),this.router.addRoute("debugger::stop",()=>{s.disableDebugging()}),this.router.addRoute("debugger::showGuideById",(e,t)=>{t(s.showGuideById(e.data))}),this.router.addRoute("debugger::toggleGuideLoop",e=>{e.data?s.startGuides():s.stopGuides()}),this.router.addRoute("debugger::tombstoneGuide",e=>{e=s.findGuideById(e.data);o.Tombstone.addGuide(e)}),this.router.addRoute("debugger::openGuidePage",e=>{e=e.data,n=s,t=o.hosts.SERVER;var t,i,n=(i=n.findGuideById(e))&&n._.get(i,"attributes.resourceCenter")?i.attributes.resourceCenter.isTopLevel?`${t}/resource-center/${i.id}/draft`:(n=n.BuildingBlocks.BuildingBlockResourceCenter.getResourceCenter())&&n.id?`${t}/resource-center/${n.id}/module/`+i.id:"":t+"/guides/"+e;n&&window.open(n,"_blank")}),this.router.addRoute("debugger::restore",({data:e})=>{if(e&&e.length){const t=document.createElement("iframe");t.sandbox="allow-same-origin",t.src="about:blank",t.hidden=!0,document.body.appendChild(t),t.contentWindow.ignoreIframeMonitor=!0,e.forEach(e=>{e.id.split(".").reduce((e,t,i,n)=>i===n.length-1?(e.destination[t]=e.source[t],e.destination[t]):(e.destination=e.destination[t],e.source=e.source[t],e),{destination:window,source:t.contentWindow})}),document.body.removeChild(t)}}),this.router.addRoute("debugger::sync",(e,i)=>{const t=o.store.subscribe((e,t)=>{"debugger/eventsCaptured"===e.type&&i({action:"events/eventsCaptured",data:t["debugger"].eventsCaptured})}),n=setInterval(()=>{i({action:"agent/sync",data:o.store.state}),i({action:"environment/validateEnvironment",data:s.validateEnvironment(!0)}),i({action:"performance/sync",data:ue()})},500);this.events.on("unmounted",()=>{clearInterval(n),t()})}),this.router.addRoute("debugger::enableEventLogging",({data:e})=>{this.setProperties({enableEventLogging:e}),o.store.dispatch("debugger/enableEventLogging",e)}),this.router.addRoute("debugger::clearEventsCaptured",()=>{o.store.dispatch("debugger/clearEventsCaptured")}),this.router.addRoute("debugger::checkGuideEligibility",({data:e},t)=>{o.store.dispatch("debugger/checkGuideEligibility",{guideId:e,response:t})}),this.router.addRoute("debugger::testSelector",({data:e},t)=>{o.store.dispatch("debugger/testSelector",{selector:e,response:t})})}teardown(){super.stop(),this.setProperties({enabled:!1,containerType:"frame"})}}var x=new he,pe={initialize(e,t){x.initialize(e,t);const i=e.disableDebugging;e.disableDebugging=()=>{x.teardown(),i(),e.disableDebugging=i}},teardown(){x.teardown()}},ge=document.getElementById("pendo-debugger-plugin");let M="pendo";ge&&(M=ge.getAttribute("data-pendo-global-key")||"pendo"),window[M].addExtension&&window[M].addExtension({name:"Debugger",version:"1.0.0",type:"agent",use:"plugin",uri:pe})}();
|
package/dist/dom.esm.js
CHANGED
|
@@ -5058,16 +5058,17 @@ var SizzleProxy = wrapSizzle(Sizzle);
|
|
|
5058
5058
|
* pendo.dom('h1')[0].remove()
|
|
5059
5059
|
* @example
|
|
5060
5060
|
* pendo.dom('.left').css({ 'text-align': 'center' })
|
|
5061
|
-
*/
|
|
5062
|
-
|
|
5063
|
-
*
|
|
5064
|
-
*
|
|
5065
|
-
* @
|
|
5066
|
-
* @
|
|
5067
|
-
* @
|
|
5068
|
-
* @
|
|
5069
|
-
*
|
|
5070
|
-
|
|
5061
|
+
*/
|
|
5062
|
+
/**
|
|
5063
|
+
* Creates new DOM elements from HTML text.
|
|
5064
|
+
*
|
|
5065
|
+
* @param {string} htmlString HTML syntax used to produce new DOM elements
|
|
5066
|
+
* @returns {DomQuery} array with the newly created elements
|
|
5067
|
+
* @access public
|
|
5068
|
+
* @category DOM
|
|
5069
|
+
* @example
|
|
5070
|
+
* pendo.dom('<div><span>this should create an unattached DOM node</span></div>');
|
|
5071
|
+
*/
|
|
5071
5072
|
function dom(selection, context) {
|
|
5072
5073
|
var self = this;
|
|
5073
5074
|
var nodes;
|
|
@@ -5141,11 +5142,11 @@ function dom(selection, context) {
|
|
|
5141
5142
|
}
|
|
5142
5143
|
|
|
5143
5144
|
/**
|
|
5144
|
-
* Utility function to check if passed value exists. Returns false for `null` and `undefined`.
|
|
5145
|
+
* Utility function to check if the passed value exists. Returns false for `null` and `undefined`.
|
|
5145
5146
|
*
|
|
5146
5147
|
* @access public
|
|
5147
5148
|
* @category Utility
|
|
5148
|
-
* @param {any} value
|
|
5149
|
+
* @param {any} arg value to type check
|
|
5149
5150
|
* @returns {Boolean}
|
|
5150
5151
|
* @example
|
|
5151
5152
|
* pendo.doesExist(null) => false
|
|
@@ -6373,7 +6374,7 @@ var ConfigReader = (function () {
|
|
|
6373
6374
|
*
|
|
6374
6375
|
* @access public
|
|
6375
6376
|
* @category Config/Core
|
|
6376
|
-
* @name
|
|
6377
|
+
* @name forcedLeader
|
|
6377
6378
|
* @default false
|
|
6378
6379
|
* @type {boolean}
|
|
6379
6380
|
*/
|
|
@@ -6560,7 +6561,7 @@ var ConfigReader = (function () {
|
|
|
6560
6561
|
* An array of exact strings that can still be included in event data if text capture is disabled
|
|
6561
6562
|
* (`excludeAllText`). This will not override any allow list specified by your application settings but will apply if none is provided.
|
|
6562
6563
|
* These are not selectors but are equality checks (the string 'Bug' will allow links that have 'Bug' as the
|
|
6563
|
-
* text to be captured but not ones like 'Bug Report')
|
|
6564
|
+
* text to be captured but not ones like 'Bug Report').
|
|
6564
6565
|
*
|
|
6565
6566
|
* @access public
|
|
6566
6567
|
* @category Config/Analytics
|
|
@@ -6658,7 +6659,7 @@ var ConfigReader = (function () {
|
|
|
6658
6659
|
/**
|
|
6659
6660
|
* By default, the web SDK will also attempt to intercept calls to `stopPropagation` and
|
|
6660
6661
|
* `stopImmediatePropagation` for click, focus, submit, and change events in order to ensure that Pendo can
|
|
6661
|
-
* still
|
|
6662
|
+
* still properly recognize these events. In the case of this causing duplicate events or other issues, this
|
|
6662
6663
|
* functionality can be disabled.
|
|
6663
6664
|
*
|
|
6664
6665
|
* @access public
|
|
@@ -6721,7 +6722,7 @@ var ConfigReader = (function () {
|
|
|
6721
6722
|
*/
|
|
6722
6723
|
addOption('cacheGuides', [SNIPPET_SRC, PENDO_CONFIG_SRC], false);
|
|
6723
6724
|
/**
|
|
6724
|
-
* How often to clear the guides cache (in milliseconds)
|
|
6725
|
+
* How often to clear the guides cache (in milliseconds).
|
|
6725
6726
|
*
|
|
6726
6727
|
* @access public
|
|
6727
6728
|
* @category Config/Guides
|
|
@@ -6755,7 +6756,7 @@ var ConfigReader = (function () {
|
|
|
6755
6756
|
addOption('disableGlobalCSS', [SNIPPET_SRC, PENDO_CONFIG_SRC], false);
|
|
6756
6757
|
/**
|
|
6757
6758
|
* Building block guides use an inline style tag for various pseudo styles (e.g. hover, carets, animations).
|
|
6758
|
-
* These can be turned off using this flag for
|
|
6759
|
+
* These can be turned off using this flag for applications with more restrictive CSP settings but will
|
|
6759
6760
|
* require custom effort to reach style parity.
|
|
6760
6761
|
*
|
|
6761
6762
|
* @access public
|
|
@@ -6781,7 +6782,7 @@ var ConfigReader = (function () {
|
|
|
6781
6782
|
* cookies, localStorage, click tracking, and metadata. Only displays guides
|
|
6782
6783
|
* that have been configured explicitly to show to this visitor.
|
|
6783
6784
|
*
|
|
6784
|
-
* @access
|
|
6785
|
+
* @access private
|
|
6785
6786
|
* @category Config/Guides
|
|
6786
6787
|
* @name doNotTrackGuides
|
|
6787
6788
|
* @default false
|
|
@@ -6789,7 +6790,7 @@ var ConfigReader = (function () {
|
|
|
6789
6790
|
*/
|
|
6790
6791
|
addOption('doNotTrackGuides', [SNIPPET_SRC, PENDO_CONFIG_SRC]);
|
|
6791
6792
|
/**
|
|
6792
|
-
* If `true`, the web SDK will listen for `alt+shift+8` on the keyboard and try to launch the designer
|
|
6793
|
+
* If `true`, the web SDK will listen for `alt+shift+8` on the keyboard and try to launch the designer. The
|
|
6793
6794
|
* keyboard shortcut requires the guide launch modal of Engage to be open in another tab showing the shortcut.
|
|
6794
6795
|
*
|
|
6795
6796
|
* @access public
|
|
@@ -6867,7 +6868,7 @@ var ConfigReader = (function () {
|
|
|
6867
6868
|
*/
|
|
6868
6869
|
addOption('guides.disabled', [SNIPPET_SRC], false, undefined, ['disableGuides']);
|
|
6869
6870
|
/**
|
|
6870
|
-
* If
|
|
6871
|
+
* If `true`, guides with slow selectors will be removed from guide display processing.
|
|
6871
6872
|
* This will improve application performance, but slow guides will not be shown to users.
|
|
6872
6873
|
*
|
|
6873
6874
|
* @access public
|
|
@@ -6923,7 +6924,7 @@ var ConfigReader = (function () {
|
|
|
6923
6924
|
*/
|
|
6924
6925
|
addOption('inlineStyleNonce', [SNIPPET_SRC]);
|
|
6925
6926
|
/**
|
|
6926
|
-
* Formerly `leaderKey
|
|
6927
|
+
* Formerly `leaderKey`. Specify a preferred publicAppId to lead the multi-application iframe installation to make decisions about automatic
|
|
6927
6928
|
* guide display. In installations with more than 2 publicAppIds, the leaderApplication can be specified as a priority
|
|
6928
6929
|
* list (e.g. `leaderApplication: ['key1', 'key2', ...]`). Either all frames must agree on the leaderApplication setting,
|
|
6929
6930
|
* or only one frame should specify the leaderApplication. If neither of these conditions are met, the default leader
|
|
@@ -6953,7 +6954,7 @@ var ConfigReader = (function () {
|
|
|
6953
6954
|
addOption('storage.allowKeys', [SNIPPET_SRC], '*');
|
|
6954
6955
|
// Feedback
|
|
6955
6956
|
/**
|
|
6956
|
-
* If Feedback is
|
|
6957
|
+
* If Feedback is set up for your subscription, this option can be used to selectively disable Feedback.
|
|
6957
6958
|
*
|
|
6958
6959
|
* @access public
|
|
6959
6960
|
* @category Config/Core
|
|
@@ -6966,8 +6967,8 @@ var ConfigReader = (function () {
|
|
|
6966
6967
|
addOption('feedbackSettings', [PENDO_CONFIG_SRC], {});
|
|
6967
6968
|
addOption('pendoFeedback', [PENDO_CONFIG_SRC], false);
|
|
6968
6969
|
/**
|
|
6969
|
-
* If set, the web SDK will use this as the suffix when writing last step advanced key into the
|
|
6970
|
-
* This supports cross
|
|
6970
|
+
* If set, the web SDK will use this as the suffix when writing the last step advanced key into the visitor's cookie.
|
|
6971
|
+
* This supports cross-app guides by having a shared accessible location for different apps on the same effective level domain.
|
|
6971
6972
|
*
|
|
6972
6973
|
* @access public
|
|
6973
6974
|
* @category Config/Core
|
|
@@ -7496,7 +7497,7 @@ function applyMatrix2dRect(matrix2d, rect) {
|
|
|
7496
7497
|
return transformedRect;
|
|
7497
7498
|
}
|
|
7498
7499
|
|
|
7499
|
-
var VERSION = '2.
|
|
7500
|
+
var VERSION = '2.327.0_';
|
|
7500
7501
|
|
|
7501
7502
|
var decodeURIComponent = _.isFunction(window.decodeURIComponent) ? window.decodeURIComponent : _.identity;
|
|
7502
7503
|
|
|
@@ -8404,6 +8405,7 @@ Eventable.clear = function (events) {
|
|
|
8404
8405
|
new EventType('eventCaptured', [DEBUG]),
|
|
8405
8406
|
new EventType('error', [DEBUG, LIFECYCLE]),
|
|
8406
8407
|
new EventType('onClickCaptured', [DEBUG]),
|
|
8408
|
+
new EventType('onEventCaptured', [DEBUG]),
|
|
8407
8409
|
new EventType('urlChanged', [LIFECYCLE]),
|
|
8408
8410
|
new EventType('leaderChanged', [LIFECYCLE, FRAMES]),
|
|
8409
8411
|
new EventType('transmit:locked', [LIFECYCLE]),
|
|
@@ -8813,8 +8815,8 @@ var isUnlocked = function () {
|
|
|
8813
8815
|
* Check if the Element has this classname.
|
|
8814
8816
|
*
|
|
8815
8817
|
* @alias hasClass
|
|
8816
|
-
* @param {element}
|
|
8817
|
-
* @param {String}
|
|
8818
|
+
* @param {element} ele The Element to test for the classname
|
|
8819
|
+
* @param {String} cls The classname to look for on the element
|
|
8818
8820
|
* @returns {Boolean}
|
|
8819
8821
|
* @access public
|
|
8820
8822
|
* @category DOM
|
|
@@ -8854,7 +8856,7 @@ var _addClass = function (ele, cls) {
|
|
|
8854
8856
|
}
|
|
8855
8857
|
};
|
|
8856
8858
|
/**
|
|
8857
|
-
* Remove a classname from an
|
|
8859
|
+
* Remove a classname from an Element's classlist.
|
|
8858
8860
|
*
|
|
8859
8861
|
* @alias removeClass
|
|
8860
8862
|
* @param {element} ele The Element from which the class will be removed
|
|
@@ -8877,7 +8879,7 @@ var _removeClass = function (ele, cls) {
|
|
|
8877
8879
|
}
|
|
8878
8880
|
};
|
|
8879
8881
|
/**
|
|
8880
|
-
* Sets the classname
|
|
8882
|
+
* Sets the classname for an Element.
|
|
8881
8883
|
*
|
|
8882
8884
|
* @alias setClass
|
|
8883
8885
|
* @param {element} ele The Element that will get the new classlist.
|
|
@@ -9489,8 +9491,15 @@ function scrollElementIntoParentRect(element, scrollParent) {
|
|
|
9489
9491
|
clientRect.left += diff;
|
|
9490
9492
|
clientRect.right += diff;
|
|
9491
9493
|
}
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
+
var isScrollByAFunction = _.isFunction(scrollParent.scrollBy);
|
|
9495
|
+
var isScrollByNative = isScrollByAFunction && isNativeCode(scrollParent.scrollBy);
|
|
9496
|
+
if (isScrollByAFunction) {
|
|
9497
|
+
if (isScrollByNative) {
|
|
9498
|
+
scrollParent.scrollBy(xScrollAmount, yScrollAmount);
|
|
9499
|
+
}
|
|
9500
|
+
else {
|
|
9501
|
+
scrollParent.scrollTo(scrollParent.scrollX + xScrollAmount, scrollParent.scrollY + yScrollAmount);
|
|
9502
|
+
}
|
|
9494
9503
|
}
|
|
9495
9504
|
else {
|
|
9496
9505
|
scrollParent.scrollTop += yScrollAmount;
|
|
@@ -9536,8 +9545,8 @@ DomQuery.$ = {
|
|
|
9536
9545
|
return newDom;
|
|
9537
9546
|
},
|
|
9538
9547
|
/**
|
|
9539
|
-
* Iterate over each element in the DomQuery list and call the
|
|
9540
|
-
*
|
|
9548
|
+
* Iterate over each element in the DomQuery list and call the provided callback function passing in the
|
|
9549
|
+
* element as the argument.
|
|
9541
9550
|
*
|
|
9542
9551
|
* @function each
|
|
9543
9552
|
* @param {function} callback The callback to be called for each element in the list
|
|
@@ -9559,7 +9568,7 @@ DomQuery.$ = {
|
|
|
9559
9568
|
* Iterate over each element in the DomQuery list and create and append the Elements represented by the HTML string provided.
|
|
9560
9569
|
*
|
|
9561
9570
|
* @function html
|
|
9562
|
-
* @param {String}
|
|
9571
|
+
* @param {String} content String representing html to be created as dom Elements for each of the Elements in the list.
|
|
9563
9572
|
* @returns {DomQuery}
|
|
9564
9573
|
* @category DOMQuery
|
|
9565
9574
|
* @access public
|
|
@@ -9580,7 +9589,7 @@ DomQuery.$ = {
|
|
|
9580
9589
|
* Iterate over each element in the DomQuery list and add the text provided as innerText on the element.
|
|
9581
9590
|
*
|
|
9582
9591
|
* @function text
|
|
9583
|
-
* @param {String} content String to be added as innerText
|
|
9592
|
+
* @param {String} content String to be added as innerText.
|
|
9584
9593
|
* @returns {DomQuery}
|
|
9585
9594
|
* @access public
|
|
9586
9595
|
* @category DOMQuery
|
|
@@ -9645,7 +9654,7 @@ DomQuery.$ = {
|
|
|
9645
9654
|
});
|
|
9646
9655
|
},
|
|
9647
9656
|
/**
|
|
9648
|
-
* Iterate over each element and
|
|
9657
|
+
* Iterate over each element and check for each class name. Returns true if all elements have each classname.
|
|
9649
9658
|
*
|
|
9650
9659
|
* @function hasClass
|
|
9651
9660
|
* @param {String} classNames Space separated string of classnames.
|
|
@@ -9668,7 +9677,7 @@ DomQuery.$ = {
|
|
|
9668
9677
|
return allElemsHaveClass;
|
|
9669
9678
|
},
|
|
9670
9679
|
/**
|
|
9671
|
-
* Iterate over each element and toggle each class name on or off depending on
|
|
9680
|
+
* Iterate over each element and toggle each class name on or off depending on
|
|
9672
9681
|
* the current state of the element.
|
|
9673
9682
|
*
|
|
9674
9683
|
* @function toggleClass
|
|
@@ -9696,7 +9705,7 @@ DomQuery.$ = {
|
|
|
9696
9705
|
* Iterate over each element and apply the styles object.
|
|
9697
9706
|
*
|
|
9698
9707
|
* @function css
|
|
9699
|
-
* @param {Object} styles Object containing style
|
|
9708
|
+
* @param {Object} styles Object containing style attribute names and values.
|
|
9700
9709
|
* @returns {DomQuery}
|
|
9701
9710
|
* @access public
|
|
9702
9711
|
* @category DOMQuery
|
|
@@ -9750,7 +9759,7 @@ DomQuery.$ = {
|
|
|
9750
9759
|
return self;
|
|
9751
9760
|
},
|
|
9752
9761
|
/**
|
|
9753
|
-
* Add all elements in the list as
|
|
9762
|
+
* Add all elements in the list as topmost child nodes of the first element found for the given selector.
|
|
9754
9763
|
*
|
|
9755
9764
|
* @function prependTo
|
|
9756
9765
|
* @param {String} selector CSS selector to identify the target parent element
|
|
@@ -9765,10 +9774,10 @@ DomQuery.$ = {
|
|
|
9765
9774
|
return this;
|
|
9766
9775
|
},
|
|
9767
9776
|
/**
|
|
9768
|
-
* Add all children from the selector as
|
|
9777
|
+
* Add all children from the selector as topmost children of the first element in this list.
|
|
9769
9778
|
*
|
|
9770
9779
|
* @function prepend
|
|
9771
|
-
* @param {String} selector CSS selector to identify
|
|
9780
|
+
* @param {String} selector CSS selector to identify topmost child element(s)
|
|
9772
9781
|
* @returns {DomQuery}
|
|
9773
9782
|
* @access public
|
|
9774
9783
|
* @category DOMQuery
|
|
@@ -9792,7 +9801,7 @@ DomQuery.$ = {
|
|
|
9792
9801
|
return self;
|
|
9793
9802
|
},
|
|
9794
9803
|
/**
|
|
9795
|
-
* Return the parent node of the first element in this list
|
|
9804
|
+
* Return the parent node of the first element in this list.
|
|
9796
9805
|
*
|
|
9797
9806
|
* @function getParent
|
|
9798
9807
|
* @returns {element}
|
|
@@ -9809,7 +9818,7 @@ DomQuery.$ = {
|
|
|
9809
9818
|
},
|
|
9810
9819
|
/**
|
|
9811
9820
|
* For the first element in this list, insert the first element from the selector before it
|
|
9812
|
-
* in parent element's child nodes list.
|
|
9821
|
+
* in the parent element's child nodes list.
|
|
9813
9822
|
*
|
|
9814
9823
|
* @function insertBefore
|
|
9815
9824
|
* @param {String} selector CSS selector for the element to be inserted before this element
|
|
@@ -9848,7 +9857,7 @@ DomQuery.$ = {
|
|
|
9848
9857
|
return this;
|
|
9849
9858
|
},
|
|
9850
9859
|
/**
|
|
9851
|
-
* Iterate over each element and set the attribute name to the specified value
|
|
9860
|
+
* Iterate over each element and set the attribute name to the specified value.
|
|
9852
9861
|
*
|
|
9853
9862
|
* @function attr
|
|
9854
9863
|
* @param {String} attrName Name of attribute to set
|
|
@@ -9909,10 +9918,10 @@ DomQuery.$ = {
|
|
|
9909
9918
|
return dom(this[index]);
|
|
9910
9919
|
},
|
|
9911
9920
|
/**
|
|
9912
|
-
* Set the height or unset the height for the first element in the list
|
|
9921
|
+
* Set the height or unset the height for the first element in the list.
|
|
9913
9922
|
*
|
|
9914
9923
|
* @function height
|
|
9915
|
-
* @param {Number} height The new height to set. Undefined will remove the height allow it to auto determined.
|
|
9924
|
+
* @param {Number} height The new height to set. Undefined will remove the height and allow it to be auto determined.
|
|
9916
9925
|
* @returns {DomQuery}
|
|
9917
9926
|
* @access public
|
|
9918
9927
|
* @category DOMQuery
|
|
@@ -9933,10 +9942,10 @@ DomQuery.$ = {
|
|
|
9933
9942
|
}
|
|
9934
9943
|
},
|
|
9935
9944
|
/**
|
|
9936
|
-
* Set the width or unset the width for the first element in the list
|
|
9945
|
+
* Set the width or unset the width for the first element in the list.
|
|
9937
9946
|
*
|
|
9938
9947
|
* @function width
|
|
9939
|
-
* @param {Number} width The new width to set. Undefined will remove the width allow it to auto determined.
|
|
9948
|
+
* @param {Number} width The new width to set. Undefined will remove the width and allow it to be auto determined.
|
|
9940
9949
|
* @returns {DomQuery}
|
|
9941
9950
|
* @access public
|
|
9942
9951
|
* @category DOMQuery
|
|
@@ -9957,7 +9966,7 @@ DomQuery.$ = {
|
|
|
9957
9966
|
}
|
|
9958
9967
|
},
|
|
9959
9968
|
/**
|
|
9960
|
-
* For each element in the list, call the element's focus method if it exists
|
|
9969
|
+
* For each element in the list, call the element's focus method if it exists.
|
|
9961
9970
|
*
|
|
9962
9971
|
* @function focus
|
|
9963
9972
|
* @returns {DomQuery}
|