@pendo/agent 2.268.0-beta → 2.269.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/README.md +22 -19
- package/dist/debugger-plugin.min.js +1 -1
- package/dist/pendo.module.js +29 -9
- package/dist/pendo.module.min.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,8 +37,8 @@ const pendo = await initialize({
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
```
|
|
40
|
-
The object returned by calling `initialize` is the same as a snippet install of the Pendo Agent and has access to all public functions found in the public function [documentation pages](https://agent.pendo.io/public/agent).
|
|
41
40
|
|
|
41
|
+
The object returned by calling `initialize` is the same as a snippet install of the Pendo Agent and has access to all public functions found in the public function [documentation pages](https://agent.pendo.io/public/agent).
|
|
42
42
|
|
|
43
43
|
### Parameters
|
|
44
44
|
|
|
@@ -49,10 +49,9 @@ The object returned by calling `initialize` is the same as a snippet install of
|
|
|
49
49
|
| visitor | optional | object | The visitor information for the current user of your application. This includes the `id` and any other metadata you want attached to the visitor. If not provided the visitor will be treated as an anonymous visitor. |
|
|
50
50
|
| account | optional | object | The account information for the current user of your application if applicable. If not provided the visitor will not be assigned to an account. |
|
|
51
51
|
| globalKey | optional | string | The key where you would like the global `pendo` object to be stored after initialization. By default this will be stored on `window.pendo` but this allows it to change to a different name if desired. |
|
|
52
|
-
| plugins | optional | array | A list of imported plugins to enable additional features in the Pendo Agent. More information can be found [below](#
|
|
53
|
-
| config | optional | object | An object that contains the entire server configuration for your application may be passed. By default, the Agent will download the latest configuration upon initialization if not passed in. More information can be found [below](#
|
|
54
|
-
| assets | optional | object | Configuration for the host and path to support including Agent static assets in your application code. More information can be found [below](#
|
|
55
|
-
|
|
52
|
+
| plugins | optional | array | A list of imported plugins to enable additional features in the Pendo Agent. More information can be found [below](#plugins). |
|
|
53
|
+
| config | optional | object | An object that contains the entire server configuration for your application may be passed. By default, the Agent will download the latest configuration upon initialization if not passed in. More information can be found [below](#config). |
|
|
54
|
+
| assets | optional | object | Configuration for the host and path to support including Agent static assets in your application code. More information can be found [below](#assets). |
|
|
56
55
|
|
|
57
56
|
In addition to the above parameters, any additional options that can normally be provided to `pendo.initialize` may be included. See [our documentation](https://agent.pendo.io/config/) for the full list of options that can be passed to `initialize`.
|
|
58
57
|
|
|
@@ -60,39 +59,41 @@ In addition to the above parameters, any additional options that can normally be
|
|
|
60
59
|
|
|
61
60
|
#### Assets
|
|
62
61
|
|
|
63
|
-
During runtime, the Pendo Agent occassionally needs to download additional script files to provide functionality that is not bundled into the Agent. This functionality is mostly meant for admins that need to design and preview guides as well as debug Pendo within their application. By default the Agent in this package will download those assets from Pendo's CDN when needed. If you would prefer to include these scripts in your application code instead of downloading them from Pendo at runtime, you can provide a host and path to where these files can be loaded from. The host can be your own CDN
|
|
62
|
+
During runtime, the Pendo Agent occassionally needs to download additional script files to provide functionality that is not bundled into the Agent. This functionality is mostly meant for admins that need to design and preview guides as well as debug Pendo within their application. By default the Agent in this package will download those assets from Pendo's CDN when needed. If you would prefer to include these scripts in your application code instead of downloading them from Pendo at runtime, you can provide a host and path to where these files can be loaded from. The host can be your own CDN, domain, extension runtime location, or can even be a relative url if the host is empty.
|
|
64
63
|
|
|
65
64
|
| name | type | description |
|
|
66
65
|
| ---- | ---- | ----------- |
|
|
67
66
|
| host | string | domain host for where your assets will be hosted, if this value is an empty string, the assets will be loaded using a relative url. |
|
|
68
67
|
| path | string | additional path to add to the url before the filename. Useful if your assets are served from a path of `public` or something similar. If left blank, no additional path will be added to the urls. |
|
|
69
|
-
| localOnly | boolean | serve all possible assets from the given asset host. This will prevent the use of things that are unable to be self served, like the Visual Design Studio and guide code blocks. To be able to use guide code blocks you will need to allow remote scripts. The designer will not launch at all and will print a log message instead if this is set to true. Defaults to false. |
|
|
68
|
+
| localOnly | boolean | serve all possible assets from the given asset host. This will prevent the use of things that are unable to be self served, like the Visual Design Studio and guide code blocks. To be able to use guide code blocks you will need to allow remote scripts. The designer will not launch at all and will print a log message instead if this is set to true. This option is useful when including the Agent in things like browser extensions that have strict rules around remote code execution. Defaults to false. |
|
|
70
69
|
|
|
71
|
-
The [CLI](#
|
|
70
|
+
The [CLI](#cli) below can be used to copy these static files from this package to your application code.
|
|
72
71
|
|
|
73
72
|
#### Config
|
|
74
73
|
|
|
75
74
|
By default, the Pendo Agent will use the provided apiKey and environment to download the latest version of the configuration for that application. This includes what settings have been enabled/disabled as well as any configured historical metadata fields and feature event properties. This ensures that the latest configuration is always being used without you requiring to redeploy your application. If you would prefer to not download the latest configuration and instead use a local static version, you can pass the JSON object to the `config` property instead. This will mean however, that to take advantage of any changes made to settings in the Pendo UI or to your historical metadata fields and feature event properties you will need to download a new version of the config and redeploy your application.
|
|
76
75
|
|
|
77
|
-
The [CLI](#
|
|
76
|
+
The [CLI](#cli) below can be used to easily download and save a new version of that configuration.
|
|
78
77
|
|
|
79
78
|
#### Plugins
|
|
80
79
|
|
|
81
80
|
Pendo has a subset of features that need to be manually enabled or are part of separate purchases. By default the functionality for these features is not included in the Agent. When using this package when there is a need to enable these features requires passing in the desired plugins. These plugins are available to be imported just like the `initialize` function and can then be passed directly into an array using the `plugins` property. Any plugin that also requires an additional purchase or package can still be included but will not function without configuration inside of your subscription.
|
|
82
81
|
|
|
83
82
|
The current list of available plugins and their export names are:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
|
|
84
|
+
- Text Capture (TextCapture)
|
|
85
|
+
- Feedback (Feedback)
|
|
86
|
+
- Session Replay (Replay)
|
|
87
|
+
- Guide Logic (GuideMarkdown)
|
|
88
|
+
- Voice of the Customer Portal (VocPortal)
|
|
89
89
|
|
|
90
90
|
## CLI
|
|
91
91
|
|
|
92
92
|
The Pendo package includes a CLI tool to be able to simplify a few actions providing greater control of the Pendo Agent in your application. Once you have installed `@pendo/agent` in your application, you will have access to the `pendo` script from your terminal (you can also use a tool like `npx` to make use of the `pendo` script without installing the package if desired by using `npx pendo`). The usage of this script can be found below or by typing `pendo` or `pendo help` into your terminal where the package is installed:
|
|
93
93
|
|
|
94
94
|
### Help
|
|
95
|
-
|
|
95
|
+
|
|
96
|
+
```bash
|
|
96
97
|
Usage: pendo <command>
|
|
97
98
|
|
|
98
99
|
CLI for @pendo/agent to assist in integrating the Pendo Agent into your application.
|
|
@@ -108,8 +109,9 @@ Documentation for the Pendo Agent can be found at:
|
|
|
108
109
|
https://agent.pendo.io
|
|
109
110
|
```
|
|
110
111
|
|
|
111
|
-
### Config
|
|
112
|
-
|
|
112
|
+
### Download Config
|
|
113
|
+
|
|
114
|
+
```bash
|
|
113
115
|
Usage: pendo config --apiKey=<application_api_key> --env=<subscription_environment> [--output=<filename>]
|
|
114
116
|
|
|
115
117
|
Download a new configuration file for a specific application built from the most recent subscription and application settings.
|
|
@@ -124,8 +126,9 @@ Examples:
|
|
|
124
126
|
$ pendo config --apiKey=dd753dfd-ac99-4c5c-48ad-6eb18190cf77 --env=io --output=pendo.config.json
|
|
125
127
|
```
|
|
126
128
|
|
|
127
|
-
### Copy
|
|
128
|
-
|
|
129
|
+
### Copy Static Assets
|
|
130
|
+
|
|
131
|
+
```bash
|
|
129
132
|
Usage: pendo copy --dest=<destination_folder> [--src=<node_module_folder>]
|
|
130
133
|
|
|
131
134
|
Copy static Pendo Agent files into a local folder for self hosting. Includes guide styles, scripts for the debugger and preview mode, and the worker file for Session Replay.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";class t{constructor(t,e){this.path=t,this.handler=e}}class e{routes={};addRoute(e,n){this.routes[e]||(this.routes[e]=[]),this.routes[e].unshift(new t(e,n))}removeRoute(t){this.routes[t].shift()}lookupRouteProvider(){return t=>this.routes[t]?this.routes[t][0].handler:void 0}}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var o=Array.isArray,i="object"==typeof n&&n&&n.Object===Object&&n,a=i,s="object"==typeof self&&self&&self.Object===Object&&self,c=a||s||Function("return this")(),u=c.Symbol,d=u,l=Object.prototype,p=l.hasOwnProperty,f=l.toString,h=d?d.toStringTag:void 0;var g=function(t){var e=p.call(t,h),n=t[h];try{t[h]=void 0;var r=!0}catch(t){}var o=f.call(t);return r&&(e?t[h]=n:delete t[h]),o},v=Object.prototype.toString;var b=g,y=function(t){return v.call(t)},m=u?u.toStringTag:void 0;var w=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":m&&m in Object(t)?b(t):y(t)};var j=function(t){return null!=t&&"object"==typeof t},_=w,T=j;var P=function(t){return"symbol"==typeof t||T(t)&&"[object Symbol]"==_(t)},O=o,I=P,A=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,C=/^\w*$/;var E=function(t,e){if(O(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!I(t))||(C.test(t)||!A.test(t)||null!=e&&t in Object(e))};var S=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},x=w,R=S;var z,N=function(t){if(!R(t))return!1;var e=x(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},D=r(N),M=c["__core-js_shared__"],$=(z=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+z:"";var H=function(t){return!!$&&$ in t},k=Function.prototype.toString;var W=function(t){if(null!=t){try{return k.call(t)}catch(t){}try{return t+""}catch(t){}}return""},L=N,U=H,F=S,G=W,B=/^\[object .+?Constructor\]$/,q=Function.prototype,Q=Object.prototype,V=q.toString,K=Q.hasOwnProperty,J=RegExp("^"+V.call(K).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var X=function(t){return!(!F(t)||U(t))&&(L(t)?J:B).test(G(t))},Y=function(t,e){return null==t?void 0:t[e]};var Z=function(t,e){var n=Y(t,e);return X(n)?n:void 0},tt=Z(Object,"create"),et=tt;var nt=function(){this.__data__=et?et(null):{},this.size=0};var rt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ot=tt,it=Object.prototype.hasOwnProperty;var at=function(t){var e=this.__data__;if(ot){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return it.call(e,t)?e[t]:void 0},st=tt,ct=Object.prototype.hasOwnProperty;var ut=tt;var dt=nt,lt=rt,pt=at,ft=function(t){var e=this.__data__;return st?void 0!==e[t]:ct.call(e,t)},ht=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ut&&void 0===e?"__lodash_hash_undefined__":e,this};function gt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}gt.prototype.clear=dt,gt.prototype.delete=lt,gt.prototype.get=pt,gt.prototype.has=ft,gt.prototype.set=ht;var vt=gt;var bt=function(){this.__data__=[],this.size=0};var yt=function(t,e){return t===e||t!=t&&e!=e},mt=yt;var wt=function(t,e){for(var n=t.length;n--;)if(mt(t[n][0],e))return n;return-1},jt=wt,_t=Array.prototype.splice;var Tt=wt;var Pt=wt;var Ot=wt;var It=bt,At=function(t){var e=this.__data__,n=jt(e,t);return!(n<0)&&(n==e.length-1?e.pop():_t.call(e,n,1),--this.size,!0)},Ct=function(t){var e=this.__data__,n=Tt(e,t);return n<0?void 0:e[n][1]},Et=function(t){return Pt(this.__data__,t)>-1},St=function(t,e){var n=this.__data__,r=Ot(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};function xt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}xt.prototype.clear=It,xt.prototype.delete=At,xt.prototype.get=Ct,xt.prototype.has=Et,xt.prototype.set=St;var Rt=xt,zt=Z(c,"Map"),Nt=vt,Dt=Rt,Mt=zt;var $t=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Ht=function(t,e){var n=t.__data__;return $t(e)?n["string"==typeof e?"string":"hash"]:n.map},kt=Ht;var Wt=Ht;var Lt=Ht;var Ut=Ht;var Ft=function(){this.size=0,this.__data__={hash:new Nt,map:new(Mt||Dt),string:new Nt}},Gt=function(t){var e=kt(this,t).delete(t);return this.size-=e?1:0,e},Bt=function(t){return Wt(this,t).get(t)},qt=function(t){return Lt(this,t).has(t)},Qt=function(t,e){var n=Ut(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function Vt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Vt.prototype.clear=Ft,Vt.prototype.delete=Gt,Vt.prototype.get=Bt,Vt.prototype.has=qt,Vt.prototype.set=Qt;var Kt=Vt,Jt=Kt;function Xt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Xt.Cache||Jt),n}Xt.Cache=Jt;var Yt=Xt;var Zt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/\\(\\)?/g,ee=function(t){var e=Yt(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Zt,(function(t,n,r,o){e.push(r?o.replace(te,"$1"):n||t)})),e}));var ne=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o},re=ne,oe=o,ie=P,ae=u?u.prototype:void 0,se=ae?ae.toString:void 0;var ce=function t(e){if("string"==typeof e)return e;if(oe(e))return re(e,t)+"";if(ie(e))return se?se.call(e):"";var n=e+"";return"0"==n&&1/e==-Infinity?"-0":n},ue=ce;var de=function(t){return null==t?"":ue(t)},le=o,pe=E,fe=ee,he=de;var ge=function(t,e){return le(t)?t:pe(t,e)?[t]:fe(he(t))},ve=P;var be=function(t){if("string"==typeof t||ve(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e},ye=ge,me=be;var we=function(t,e){for(var n=0,r=(e=ye(e,t)).length;null!=t&&n<r;)t=t[me(e[n++])];return n&&n==r?t:void 0},je=we;var _e=r((function(t,e,n){var r=null==t?void 0:je(t,e);return void 0===r?n:r}));class Te{app=null;router=null;destination=window.parent||window.top;origin="*";constructor(t,e={}){this.app=t,this.router=t.router,this.config=e,this.events=t.PluginAPI.getEventable()}getConfig(t,e){return _e(this.config,t,e)}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 Pe={padding:"0 !important",margin:"0 !important","box-sizing":"border-box !important",border:"none !important"},Oe=2147483647,Ie={WINDOW_MARGIN:10,HEADER_HEIGHT:50,TOP:100,LEFT:100,HEIGHT:700,WIDTH:500,MIN_HEIGHT:500,MIN_WIDTH:500};const{MIN_HEIGHT:Ae,MIN_WIDTH:Ce,WINDOW_MARGIN:Ee}=Ie;function Se(t,e,n,r,o){let i=0,a=0,s=0,c=0;function u(n){n.preventDefault(),e.css({visibility:"hidden"}),t.releasePointerCapture(n.pointerId),t.removeEventListener("pointermove",d),o()}function d(t){-1===t.button&&0!==t.buttons?(t.preventDefault(),s=i-t.clientX,c=a-t.clientY,i=t.clientX,a=t.clientY,r(s,c)):u(t)}t.addEventListener("pointerdown",(function(r){if(0!==r.button)return;r.preventDefault(),e.css({visibility:"visible"}),i=r.clientX,a=r.clientY,t.setPointerCapture(r.pointerId),t.addEventListener("pointermove",d),n()})),t.addEventListener("pointerup",u),t.addEventListener("pointerout",u)}function xe(t,e){const n=t.offsetLeft-e,r=window.innerWidth-t.offsetWidth-Ee;return n<Ee||r<Ee?Ee:n>r?r:n}function Re(t,e){const n=t.offsetTop-e,r=window.innerHeight-t.offsetHeight-Ee;return n<Ee||r<Ee?Ee:n>r?r:n}function ze(t,e){const n=t.offsetWidth-e,r=window.innerWidth-t.offsetLeft-Ee;return n>r?r:n<Ce?Ce:n}function Ne(t,e){const n=t.offsetHeight-e,r=window.innerHeight-t.offsetTop-Ee;return n>r?r:n<Ae?Ae:n}class De extends Te{type="frame";destination=window.parent||window.top;origin=window.location.origin;constructor(t,e){super(t,e);const{pendo:n,PluginAPI:r}=t,o=this.getConfig("containerId","pendo-client-app");this.container=n.dom(`<div id="${o}" class="pendo-ignore">`).css({...Pe,height:t.state.height,width:t.state.width,"z-index":Oe-1,"background-color":"#FFFFFF",position:"fixed","box-shadow":"rgb(136, 136, 136) 0px 0px 20px 0px",overflow:"hidden"}),this.handle=n.dom('<div id="pendo-app-draggable-handle">').css({...Pe,"z-index":Oe,height:Ie.HEADER_HEIGHT,width:"calc(100% - 100px)",position:"absolute",cursor:"grab"}).on("dblclick",(()=>{t.state.minimized||(this.container.css({height:Ie.HEIGHT,width:Ie.WIDTH,transition:"all 250ms linear"}),setTimeout((()=>{this.container&&(this.container.css({transition:"none"}),this.saveSize())}),250))})).appendTo(this.container),this.resizeHandle=n.dom('<div id="pendo-app-resize-handle">').css({...Pe,"z-index":Oe,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=n.dom('<iframe id="pendo-agent-application" src="about:blank">').css({...Pe,height:"100%",width:"100%"}).on("load",(()=>{const e=this.frame[0].contentDocument.createElement.bind(this.frame[0].contentDocument);this.frame[0].contentDocument.createElement=(t,...n)=>{const o=e(t,...n);if("style"===t){const t=r.ConfigReader.get("inlineStyleNonce");t&&o.setAttribute("nonce",t)}return o};const o=document.createElement("script");var i;o.src=(i=n,i&&i.trustedTypesPolicy?i.trustedTypesPolicy:{createScriptURL:t=>t}).createScriptURL(r.getAssetUrl(t.assetName)),this.frame[0].contentDocument.body.appendChild(o),this.frame[0].contentWindow.ignoreIframeMonitor=!0,this.triggerOpened()})).appendTo(this.container),this.blockout=n.dom('<div id="pendo-app-dragging-blockout">').css({"z-index":Oe-2,position:"absolute",height:"100%",width:"100%",top:0,left:0,visibility:"hidden"}).appendTo(n.dom.getBody()),this.elements=[this.container,this.blockout],this.positionFrame=t=>{let{left:e,top:n,height:r}=t;const{minimized:o,width:i}=t;e=e||Ie.LEFT,n=n||Ie.TOP,r=o?Ie.HEADER_HEIGHT:r,e=xe({offsetLeft:e,offsetWidth:i},0),n=Re({offsetTop:n,offsetHeight:r},0),this.container.css({left:e,top:n,height:r}),this.savePosition()},this.saveSize=()=>{const{offsetHeight:t,offsetWidth:e}=this.container[0];t&&e&&this.app.setProperties({height:t,width:e})},this.savePosition=()=>{const{offsetLeft:t,offsetTop:e}=this.container[0];t&&e&&this.app.setProperties({left:t,top:e})},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),function(t,e){const n=t.handle[0],r=t.container[0];Se(n,t.blockout,(function(){n.style.cursor="grabbing"}),(function(t,e){r.style.left=`${xe(r,t)}px`,r.style.top=`${Re(r,e)}px`}),(function(){n.style.cursor="grab",e()}))}(this,this.savePosition),function(t,e){const n=t.resizeHandle[0],r=t.container[0];Se(n,t.blockout,(()=>{}),(function(t,e){r.style.width=`${ze(r,t)}px`,r.style.height=`${Ne(r,e)}px`}),e)}(this,this.saveSize),window.addEventListener("resize",s),this.listeners=[["resize",s]];const i=n._.throttle((()=>function(t){const e=t.offsetLeft+t.offsetWidth+Ee-window.innerWidth;e>0&&(t.style.left=`${xe(t,e)}px`,t.offsetWidth>Ce&&(t.style.width=`${ze(t,e)}px`));const n=t.offsetTop+t.offsetHeight+Ee-window.innerHeight;n>0&&(t.style.top=`${Re(t,n)}px`,t.offsetHeight>Ae&&(t.style.height=`${Ne(t,n)}px`))}(this.container[0])),10),a=n._.debounce((()=>{this.savePosition(),this.saveSize()}),1e3);function s(){i(),a()}}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((([t,e])=>window.removeEventListener(t,e))),this.elements.forEach((t=>t.remove())),this.triggerClosed()}}var Me=c,$e=/\s/;var He=function(t){for(var e=t.length;e--&&$e.test(t.charAt(e)););return e},ke=/^\s+/;var We=function(t){return t?t.slice(0,He(t)+1).replace(ke,""):t},Le=S,Ue=P,Fe=/^[-+]0x[0-9a-f]+$/i,Ge=/^0b[01]+$/i,Be=/^0o[0-7]+$/i,qe=parseInt;var Qe=S,Ve=function(){return Me.Date.now()},Ke=function(t){if("number"==typeof t)return t;if(Ue(t))return NaN;if(Le(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Le(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=We(t);var n=Ge.test(t);return n||Be.test(t)?qe(t.slice(2),n?2:8):Fe.test(t)?NaN:+t},Je=Math.max,Xe=Math.min;var Ye=function(t,e,n){var r,o,i,a,s,c,u=0,d=!1,l=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function f(e){var n=r,i=o;return r=o=void 0,u=e,a=t.apply(i,n)}function h(t){var n=t-c;return void 0===c||n>=e||n<0||l&&t-u>=i}function g(){var t=Ve();if(h(t))return v(t);s=setTimeout(g,function(t){var n=e-(t-c);return l?Xe(n,i-(t-u)):n}(t))}function v(t){return s=void 0,p&&r?f(t):(r=o=void 0,a)}function b(){var t=Ve(),n=h(t);if(r=arguments,o=this,c=t,n){if(void 0===s)return function(t){return u=t,s=setTimeout(g,e),d?f(t):a}(c);if(l)return clearTimeout(s),s=setTimeout(g,e),f(c)}return void 0===s&&(s=setTimeout(g,e)),a}return e=Ke(e)||0,Qe(n)&&(d=!!n.leading,i=(l="maxWait"in n)?Je(Ke(n.maxWait)||0,e):i,p="trailing"in n?!!n.trailing:p),b.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=c=o=s=void 0},b.flush=function(){return void 0===s?a:v(Ve())},b},Ze=Ye,tn=S;var en=r((function(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return tn(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Ze(t,e,{leading:r,maxWait:e,trailing:o})})),nn=de,rn=0;var on=r((function(t){var e=++rn;return nn(t)+e})),an=Rt;var sn=Rt,cn=zt,un=Kt;var dn=Rt,ln=function(){this.__data__=new an,this.size=0},pn=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},fn=function(t){return this.__data__.get(t)},hn=function(t){return this.__data__.has(t)},gn=function(t,e){var n=this.__data__;if(n instanceof sn){var r=n.__data__;if(!cn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new un(r)}return n.set(t,e),this.size=n.size,this};function vn(t){var e=this.__data__=new dn(t);this.size=e.size}vn.prototype.clear=ln,vn.prototype.delete=pn,vn.prototype.get=fn,vn.prototype.has=hn,vn.prototype.set=gn;var bn=vn;var yn=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t},mn=Z,wn=function(){try{var t=mn(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),jn=wn;var _n=function(t,e,n){"__proto__"==e&&jn?jn(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},Tn=_n,Pn=yt,On=Object.prototype.hasOwnProperty;var In=function(t,e,n){var r=t[e];On.call(t,e)&&Pn(r,n)&&(void 0!==n||e in t)||Tn(t,e,n)},An=In,Cn=_n;var En=function(t,e,n,r){var o=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var s=e[i],c=r?r(n[s],t[s],s,n,t):void 0;void 0===c&&(c=t[s]),o?Cn(n,s,c):An(n,s,c)}return n};var Sn=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r},xn=w,Rn=j;var zn=function(t){return Rn(t)&&"[object Arguments]"==xn(t)},Nn=j,Dn=Object.prototype,Mn=Dn.hasOwnProperty,$n=Dn.propertyIsEnumerable,Hn=zn(function(){return arguments}())?zn:function(t){return Nn(t)&&Mn.call(t,"callee")&&!$n.call(t,"callee")},kn=Hn,Wn={exports:{}};var Ln=function(){return!1};!function(t,e){var n=c,r=Ln,o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o?n.Buffer:void 0,s=(a?a.isBuffer:void 0)||r;t.exports=s}(Wn,Wn.exports);var Un=Wn.exports,Fn=/^(?:0|[1-9]\d*)$/;var Gn=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Fn.test(t))&&t>-1&&t%1==0&&t<e};var Bn=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},qn=w,Qn=Bn,Vn=j,Kn={};Kn["[object Float32Array]"]=Kn["[object Float64Array]"]=Kn["[object Int8Array]"]=Kn["[object Int16Array]"]=Kn["[object Int32Array]"]=Kn["[object Uint8Array]"]=Kn["[object Uint8ClampedArray]"]=Kn["[object Uint16Array]"]=Kn["[object Uint32Array]"]=!0,Kn["[object Arguments]"]=Kn["[object Array]"]=Kn["[object ArrayBuffer]"]=Kn["[object Boolean]"]=Kn["[object DataView]"]=Kn["[object Date]"]=Kn["[object Error]"]=Kn["[object Function]"]=Kn["[object Map]"]=Kn["[object Number]"]=Kn["[object Object]"]=Kn["[object RegExp]"]=Kn["[object Set]"]=Kn["[object String]"]=Kn["[object WeakMap]"]=!1;var Jn=function(t){return Vn(t)&&Qn(t.length)&&!!Kn[qn(t)]};var Xn=function(t){return function(e){return t(e)}},Yn={exports:{}};!function(t,e){var n=i,r=e&&!e.nodeType&&e,o=r&&t&&!t.nodeType&&t,a=o&&o.exports===r&&n.process,s=function(){try{var t=o&&o.require&&o.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s}(Yn,Yn.exports);var Zn=Yn.exports,tr=Jn,er=Xn,nr=Zn&&Zn.isTypedArray,rr=nr?er(nr):tr,or=Sn,ir=kn,ar=o,sr=Un,cr=Gn,ur=rr,dr=Object.prototype.hasOwnProperty;var lr=function(t,e){var n=ar(t),r=!n&&ir(t),o=!n&&!r&&sr(t),i=!n&&!r&&!o&&ur(t),a=n||r||o||i,s=a?or(t.length,String):[],c=s.length;for(var u in t)!e&&!dr.call(t,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||cr(u,c))||s.push(u);return s},pr=Object.prototype;var fr=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||pr)};var hr=function(t,e){return function(n){return t(e(n))}},gr=hr(Object.keys,Object),vr=fr,br=gr,yr=Object.prototype.hasOwnProperty;var mr=N,wr=Bn;var jr=function(t){return null!=t&&wr(t.length)&&!mr(t)},_r=lr,Tr=function(t){if(!vr(t))return br(t);var e=[];for(var n in Object(t))yr.call(t,n)&&"constructor"!=n&&e.push(n);return e},Pr=jr;var Or=function(t){return Pr(t)?_r(t):Tr(t)},Ir=En,Ar=Or;var Cr=function(t,e){return t&&Ir(e,Ar(e),t)};var Er=S,Sr=fr,xr=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e},Rr=Object.prototype.hasOwnProperty;var zr=lr,Nr=function(t){if(!Er(t))return xr(t);var e=Sr(t),n=[];for(var r in t)("constructor"!=r||!e&&Rr.call(t,r))&&n.push(r);return n},Dr=jr;var Mr=function(t){return Dr(t)?zr(t,!0):Nr(t)},$r=En,Hr=Mr;var kr=function(t,e){return t&&$r(e,Hr(e),t)},Wr={exports:{}};!function(t,e){var n=c,r=e&&!e.nodeType&&e,o=r&&t&&!t.nodeType&&t,i=o&&o.exports===r?n.Buffer:void 0,a=i?i.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=a?a(n):new t.constructor(n);return t.copy(r),r}}(Wr,Wr.exports);var Lr=Wr.exports;var Ur=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e};var Fr=function(){return[]},Gr=function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i},Br=Fr,qr=Object.prototype.propertyIsEnumerable,Qr=Object.getOwnPropertySymbols,Vr=Qr?function(t){return null==t?[]:(t=Object(t),Gr(Qr(t),(function(e){return qr.call(t,e)})))}:Br,Kr=En,Jr=Vr;var Xr=function(t,e){return Kr(t,Jr(t),e)};var Yr=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t},Zr=hr(Object.getPrototypeOf,Object),to=Yr,eo=Zr,no=Vr,ro=Fr,oo=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)to(e,no(t)),t=eo(t);return e}:ro,io=En,ao=oo;var so=function(t,e){return io(t,ao(t),e)},co=Yr,uo=o;var lo=function(t,e,n){var r=e(t);return uo(t)?r:co(r,n(t))},po=lo,fo=Vr,ho=Or;var go=function(t){return po(t,ho,fo)},vo=lo,bo=oo,yo=Mr;var mo=function(t){return vo(t,yo,bo)},wo=Z(c,"DataView"),jo=zt,_o=Z(c,"Promise"),To=Z(c,"Set"),Po=Z(c,"WeakMap"),Oo=w,Io=W,Ao="[object Map]",Co="[object Promise]",Eo="[object Set]",So="[object WeakMap]",xo="[object DataView]",Ro=Io(wo),zo=Io(jo),No=Io(_o),Do=Io(To),Mo=Io(Po),$o=Oo;(wo&&$o(new wo(new ArrayBuffer(1)))!=xo||jo&&$o(new jo)!=Ao||_o&&$o(_o.resolve())!=Co||To&&$o(new To)!=Eo||Po&&$o(new Po)!=So)&&($o=function(t){var e=Oo(t),n="[object Object]"==e?t.constructor:void 0,r=n?Io(n):"";if(r)switch(r){case Ro:return xo;case zo:return Ao;case No:return Co;case Do:return Eo;case Mo:return So}return e});var Ho=$o,ko=Object.prototype.hasOwnProperty;var Wo=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&ko.call(t,"index")&&(n.index=t.index,n.input=t.input),n},Lo=c.Uint8Array;var Uo=function(t){var e=new t.constructor(t.byteLength);return new Lo(e).set(new Lo(t)),e},Fo=Uo;var Go=function(t,e){var n=e?Fo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)},Bo=/\w*$/;var qo=function(t){var e=new t.constructor(t.source,Bo.exec(t));return e.lastIndex=t.lastIndex,e},Qo=u?u.prototype:void 0,Vo=Qo?Qo.valueOf:void 0;var Ko=Uo;var Jo=Uo,Xo=Go,Yo=qo,Zo=function(t){return Vo?Object(Vo.call(t)):{}},ti=function(t,e){var n=e?Ko(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)};var ei=function(t,e,n){var r=t.constructor;switch(e){case"[object ArrayBuffer]":return Jo(t);case"[object Boolean]":case"[object Date]":return new r(+t);case"[object DataView]":return Xo(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return ti(t,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(t);case"[object RegExp]":return Yo(t);case"[object Symbol]":return Zo(t)}},ni=S,ri=Object.create,oi=function(){function t(){}return function(e){if(!ni(e))return{};if(ri)return ri(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),ii=Zr,ai=fr;var si=function(t){return"function"!=typeof t.constructor||ai(t)?{}:oi(ii(t))},ci=Ho,ui=j;var di=function(t){return ui(t)&&"[object Map]"==ci(t)},li=Xn,pi=Zn&&Zn.isMap,fi=pi?li(pi):di,hi=Ho,gi=j;var vi=function(t){return gi(t)&&"[object Set]"==hi(t)},bi=Xn,yi=Zn&&Zn.isSet,mi=yi?bi(yi):vi,wi=bn,ji=yn,_i=In,Ti=Cr,Pi=kr,Oi=Lr,Ii=Ur,Ai=Xr,Ci=so,Ei=go,Si=mo,xi=Ho,Ri=Wo,zi=ei,Ni=si,Di=o,Mi=Un,$i=fi,Hi=S,ki=mi,Wi=Or,Li=Mr,Ui="[object Arguments]",Fi="[object Function]",Gi="[object Object]",Bi={};Bi[Ui]=Bi["[object Array]"]=Bi["[object ArrayBuffer]"]=Bi["[object DataView]"]=Bi["[object Boolean]"]=Bi["[object Date]"]=Bi["[object Float32Array]"]=Bi["[object Float64Array]"]=Bi["[object Int8Array]"]=Bi["[object Int16Array]"]=Bi["[object Int32Array]"]=Bi["[object Map]"]=Bi["[object Number]"]=Bi[Gi]=Bi["[object RegExp]"]=Bi["[object Set]"]=Bi["[object String]"]=Bi["[object Symbol]"]=Bi["[object Uint8Array]"]=Bi["[object Uint8ClampedArray]"]=Bi["[object Uint16Array]"]=Bi["[object Uint32Array]"]=!0,Bi["[object Error]"]=Bi[Fi]=Bi["[object WeakMap]"]=!1;var qi=function t(e,n,r,o,i,a){var s,c=1&n,u=2&n,d=4&n;if(r&&(s=i?r(e,o,i,a):r(e)),void 0!==s)return s;if(!Hi(e))return e;var l=Di(e);if(l){if(s=Ri(e),!c)return Ii(e,s)}else{var p=xi(e),f=p==Fi||"[object GeneratorFunction]"==p;if(Mi(e))return Oi(e,c);if(p==Gi||p==Ui||f&&!i){if(s=u||f?{}:Ni(e),!c)return u?Ci(e,Pi(s,e)):Ai(e,Ti(s,e))}else{if(!Bi[p])return i?e:{};s=zi(e,p,c)}}a||(a=new wi);var h=a.get(e);if(h)return h;a.set(e,s),ki(e)?e.forEach((function(o){s.add(t(o,n,r,o,e,a))})):$i(e)&&e.forEach((function(o,i){s.set(i,t(o,n,r,i,e,a))}));var g=l?void 0:(d?u?Si:Ei:u?Li:Wi)(e);return ji(g||e,(function(o,i){g&&(o=e[i=o]),_i(s,i,t(o,n,r,i,e,a))})),s};var Qi=function(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r<o;)i[r]=t[r+e];return i},Vi=we,Ki=Qi;var Ji=ge,Xi=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0},Yi=function(t,e){return e.length<2?t:Vi(t,Ki(e,0,-1))},Zi=be;var ta=function(t,e){return e=Ji(e,t),null==(t=Yi(t,e))||delete t[Zi(Xi(e))]},ea=w,na=Zr,ra=j,oa=Function.prototype,ia=Object.prototype,aa=oa.toString,sa=ia.hasOwnProperty,ca=aa.call(Object);var ua=function(t){if(!ra(t)||"[object Object]"!=ea(t))return!1;var e=na(t);if(null===e)return!0;var n=sa.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&aa.call(n)==ca};var da=function(t){return ua(t)?void 0:t},la=kn,pa=o,fa=u?u.isConcatSpreadable:void 0;var ha=Yr,ga=function(t){return pa(t)||la(t)||!!(fa&&t&&t[fa])};var va=function t(e,n,r,o,i){var a=-1,s=e.length;for(r||(r=ga),i||(i=[]);++a<s;){var c=e[a];n>0&&r(c)?n>1?t(c,n-1,r,o,i):ha(i,c):o||(i[i.length]=c)}return i},ba=va;var ya=function(t){return(null==t?0:t.length)?ba(t,1):[]};var ma=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)},wa=Math.max;var ja=function(t,e,n){return e=wa(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=wa(r.length-e,0),a=Array(i);++o<i;)a[o]=r[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=r[o];return s[e]=n(a),ma(t,this,s)}};var _a=function(t){return t},Ta=function(t){return function(){return t}},Pa=wn,Oa=Pa?function(t,e){return Pa(t,"toString",{configurable:!0,enumerable:!1,value:Ta(e),writable:!0})}:_a,Ia=Date.now;var Aa=function(t){var e=0,n=0;return function(){var r=Ia(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}},Ca=Aa(Oa),Ea=ya,Sa=ja,xa=Ca;var Ra=ne,za=qi,Na=ta,Da=ge,Ma=En,$a=da,Ha=mo,ka=r(function(t){return xa(Sa(t,void 0,Ea),t+"")}((function(t,e){var n={};if(null==t)return n;var r=!1;e=Ra(e,(function(e){return e=Da(e,t),r||(r=e.length>1),e})),Ma(t,Ha(t),n),r&&(n=za(n,7,$a));for(var o=e.length;o--;)Na(n,e[o]);return n})));const Wa="promise";function La(t,e,n){this.name=t,this.type=e,this.data=n}La.prototype.toString=function(){return`Message.${this.type} - ${this.name}`};const Ua=t=>{try{const{name:e,type:n,isResponse:r,data:o,requestId:i,sender:a}=t.data||{},s=new La(e,n,null!=o?JSON.parse(o):void 0);return s.requestId=i,s.sender=a,s.destination=t.source,s.isResponse=r,s}catch(t){return!1}},Fa=t=>(t.isResponse=!0,t),Ga=(...t)=>e=>[].concat(t).reduce(((t,n,r,o)=>{const i=n(t,e);return i||o.splice(r,o.length-r),i}),e);var Ba=function(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),s=a.length;s--;){var c=a[t?s:++o];if(!1===n(i[c],c,i))break}return e}}(),qa=Or;var Qa=jr;var Va=function(t,e){return function(n,r){if(null==n)return n;if(!Qa(n))return t(n,r);for(var o=n.length,i=e?o:-1,a=Object(n);(e?i--:++i<o)&&!1!==r(a[i],i,a););return n}}((function(t,e){return t&&Ba(t,e,qa)})),Ka=_a;var Ja=yn,Xa=Va,Ya=function(t){return"function"==typeof t?t:Ka},Za=o;var ts=r((function(t,e){return(Za(t)?Ja:Xa)(t,Ya(e))}));const es="disconnected",ns={lastMessageReceivedAt:0,currentConnectionQuality:es,changeCallbacks:{},evalCallbacks:{}},rs=t=>{t!==ns.currentConnectionQuality&&(ns.currentConnectionQuality=t,ts(ns.changeCallbacks,(t=>{t(ns.currentConnectionQuality)})))},os=()=>{if(0===ns.lastMessageReceivedAt)return void rs(es);const t=Date.now()-ns.lastMessageReceivedAt;t<1e4?rs("connected"):(t=>t>1e4)(t)&&((t=>t>3e4)(t)?rs("dead_connection"):rs(es)),ts(ns.evalCallbacks,(t=>{t(ns.currentConnectionQuality)}))};let is;let as=0;const ss=()=>{ns.currentConnectionQuality=es,ns.lastMessageReceivedAt=0},cs={appName:void 0,connectionName:void 0,frameId:void 0,pendingRequests:{},topics:{},senderIds:{},originProvider:void 0,destinationProvider:void 0},us=()=>`${cs.appName}${cs.connectionName}(${cs.frameId})`,ds=t=>{t.sender||(t.sender=us());const e=t.destination||cs.destinationProvider(),n=(t=>{const e=ka(t,["destination","toString","data"]);return e.data=JSON.stringify(t.data,((t,e)=>"function"==typeof e||e instanceof RegExp?e.toString?e.toString():void 0:e)),e})(t),r=fs(t.sender),o=hs(t.sender);if(r||o)r?r.postMessage(n):e.postMessage(n,cs.originProvider());else{const r=new MessageChannel;_s(r.port1,t.sender),e.postMessage(n,cs.originProvider(),[r.port2])}},ls=(t,e,n=1e3)=>new Promise(((r,o)=>{const i=((t,e,n)=>{const r=new La(t,e,n);return e===Wa&&(r.requestId=on()),r})(t,Wa,e),a=setTimeout((()=>{o(`${t} timeout`),vs(i),Ps(i)}),n);gs(i,(()=>clearTimeout(a)),r,o),ds(i)})),ps=t=>(cs.senderIds[t]||(t=>{cs.senderIds[t]||(cs.senderIds[t]={port:void 0,hasTriedToUpgradeToMessageChannel:!1})})(t),cs.senderIds[t]),fs=t=>ps(t).port,hs=t=>ps(t).hasTriedToUpgradeToMessageChannel,gs=(t,e,n,r)=>{cs.pendingRequests[t.requestId]={message:t,clearTimeoutfn:e,resolve:n,reject:r}},vs=t=>{const{requestId:e}=t;return cs.pendingRequests[e].clearTimeoutfn(),delete cs.pendingRequests[e],t},bs="message::ping",ys=Ga((t=>{const e=cs.pendingRequests[t.requestId];return e&&(e.resolve(t.data),vs(t)),t}),(t=>{const e=cs.topics[t.name];return e&&e.forEach((e=>e(t.data))),t}),(t=>{if(!t)return t;if(t.isResponse)return t;if(t.name===bs)return ds(Fa(t)),t;const e=cs.routeHandlerLookup(t.name);if(e){const n=e=>{t.data=e,ds(Fa(t))};e(t,n)}else console.log(us(),`No route handler for ${t.name}`,t);return t}),(ms=()=>{((t=Date.now())=>{ns.lastMessageReceivedAt=t})()},(t,...e)=>(ms(t,...e),t)));var ms;const ws=t=>("*"===cs.originProvider()||t.origin===cs.originProvider())&&t,js=t=>{const e=_e(t,"data.sender");return!(!e||"string"!=typeof e)&&(!!e.includes(cs.appName)&&t)},_s=(t,e)=>{const n=ps(e);n.port=t,n.hasTriedToUpgradeToMessageChannel=!0,n.port.onmessage=Ga(Ua,ys)},Ts=(t,e)=>(!ps(t.sender).hasTriedToUpgradeToMessageChannel&&e.ports&&e.ports[0]&&_s(e.ports[0],t.sender),t),Ps=t=>{(t=>{const e=ps(t);e.port=void 0,e.hasTriedToUpgradeToMessageChannel=!1})(t.sender)};let Os=()=>{};const Is=()=>{Os(),Os=()=>{},is&&is(),ss()},As=en((t=>{"connected"!==t&&cs.usePingAutoReconnect&&ls(bs).catch((()=>{console.log("message::ping timedout")}))}),1e3),Cs=(t,e,n,r,o,i=!1,a)=>{if(!window.addEventListener)return;cs.appName=t,cs.frameId=e,cs.routeHandlerLookup=n,cs.usePingAutoReconnect=i,cs.connectionName=a||"",cs.originProvider=r||(()=>window.location.origin||"*"),cs.destinationProvider=o||(()=>window.parent||window.top),((t={})=>{const e=setInterval(os,100);is=()=>clearInterval(e)})(),(t=>{if(!D(t))return;const e=as++;ns.evalCallbacks[e]=t})(As);const s=Ga(ws,js,Ua,Ts,ys);window.addEventListener("message",s),Os=()=>window.removeEventListener("message",s)},Es=t=>{(t=>{if(!D(t))return;const e=as++;ns.changeCallbacks[e]=t})(t)};function Ss(){return(new Date).getTime()}class xs extends Te{type="window";testUrl="";realUrl=void 0;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(),t=this.app,e=1e3,new Promise(((n,r)=>{const o=Ss(),i=()=>{t.getConnectionStatus()?n():Ss()-o>e?r():setTimeout(i,50)};i()}));var t,e}))}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`),ls("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`));const t=document.createElement("script");t.src=this.app.PluginAPI.getAssetUrl(this.app.assetName),this.destination.document.body.appendChild(t),this.destination.document.title=this.getTitle()}close(){this.router.removeRoute("app::windowClosed"),this.destination.close(),this.triggerClosed()}}const Rs=()=>({});class zs{defaultState={containerType:"frame",minimized:!1,height:500,width:500,left:100,top:100};state={};containerClosedCallbacks=[];container=null;isConnected=!1;constructor(t,n,r,o,i,a=Rs,s=Rs){this.appName=t,this.assetName=n,this.assetStorageKey=r,this.connectionName=o,this.frameConfigProvider=a,this.windowConfigProvider=s,i&&Object.assign(this.defaultState,i),this.router=new e}init(t,e){this.pendo=t,this.PluginAPI=e,this.events=e.getEventable(),this.router.addRoute("app::ping",((t,e)=>{e()})),this.router.addRoute("app::setProperties",(({data:t})=>{this.setProperties(t)})),this.router.addRoute("app::toggleContainer",(()=>{this.setProperties({minimized:!1}),this.toggleContainerType()})),this.router.addRoute("app::windowClosed",(()=>{})),this.loadState(),this.prepContainer()}prepContainer(){this.container="window"===this.state.containerType?new xs(this,this.windowConfigProvider()):new De(this,this.frameConfigProvider())}setConnectionStatus(t){this.isConnected="connected"===t}getConnectionStatus(){return this.isConnected}setProperties(t){Object.assign(this.state,t),this.writeState()}getDefaultState(){return this.defaultState||{}}loadState(){try{const t=JSON.parse(this.PluginAPI.agentStorage.read(this.assetStorageKey,!0));this.state=Object.assign({},this.getDefaultState(),this.state,t)}catch(t){this.PluginAPI.log.error(t),this.state=Object.assign({},this.getDefaultState(),this.state)}}writeState(){this.PluginAPI.agentStorage.write(this.assetStorageKey,JSON.stringify(this.state),null,!0)}toggleContainerType(){const t="frame"===this.state.containerType?"window":"frame";this.setProperties({containerType:t}),this.stop(),this.start()}start(){this.container||this.prepContainer();const{frameId:t}=this.PluginAPI.EventTracer.addTracerIds({});Cs(this.appName,t,this.router.lookupRouteProvider(),this.container.getOriginProvider(),this.container.getDestinationProvider(),!0,this.connectionName),Es((t=>{this.setConnectionStatus(t)})),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"),Is()}}const Ns=t=>({apiKey:t.apiKey,environment:t.debugging.isStagingServer()?"staging":"production",device:t.debugging.isMobileUserAgent()?"mobile":"desktop",browserCookies:window.navigator.cookieEnabled,guideStatus:t.areGuidesDisabled()?"disabled":t.debugging.areGuidesDelayed()?"delayed":"enabled"}),Ds=function(){const t={height:Ie.HEIGHT,width:Ie.WIDTH};let e,n;const r=new zs("Debugger","pendo.debugger.min.js","debug-enabled","AgentPlugin",t,(()=>({containerId:"pendo-client-debugger"})),(()=>({title:"Pendo Debugger"}))),o={app:r,init(t,o){e=t,n=o,n.restartDebugger=this.start,r.init(e,n),r.router.addRoute("debugger::connect",((t,o)=>{o({config:n.ConfigReader.audit(),env:Ns(e),container:r.state,events:n.store.state.debugger.eventsCaptured})})),r.router.addRoute("debugger::stop",(()=>{e.disableDebugging()})),r.router.addRoute("debugger::showGuideById",((t,n)=>{n(e.showGuideById(t.data))})),r.router.addRoute("debugger::toggleGuideLoop",(t=>{t.data?e.startGuides():e.stopGuides()})),r.router.addRoute("debugger::tombstoneGuide",(t=>{const r=e.findGuideById(t.data);n.Tombstone.addGuide(r)})),r.router.addRoute("debugger::openGuidePage",(t=>{const r=((t,e,n)=>{const r=e.findGuideById(t);if(!r||!e._.get(r,"attributes.resourceCenter"))return`${n}/guides/${t}`;if(r.attributes.resourceCenter.isTopLevel)return`${n}/resource-center/${r.id}/draft`;const o=e.BuildingBlocks.BuildingBlockResourceCenter.getResourceCenter();return o&&o.id?`${n}/resource-center/${o.id}/module/${r.id}`:""})(t.data,e,n.hosts.SERVER);r&&window.open(r,"_blank")})),r.router.addRoute("debugger::restore",(({data:t})=>{(t=>{if(!t||!t.length)return;const e=document.createElement("iframe");e.sandbox="allow-same-origin",e.src="about:blank",e.hidden=!0,document.body.appendChild(e),e.contentWindow.ignoreIframeMonitor=!0,t.forEach((t=>{t.id.split(".").reduce(((t,e,n,r)=>n===r.length-1?(t.destination[e]=t.source[e],t.destination[e]):(t.destination=t.destination[e],t.source=t.source[e],t)),{destination:window,source:e.contentWindow})})),document.body.removeChild(e)})(t)})),r.router.addRoute("debugger::findShadowRoot",((t,e)=>{e((()=>{let t,e=!1,n=0;const r=document.createNodeIterator(document.body,NodeFilter.SHOW_ELEMENT);if(!r||!r.nextNode)return!0;for(;n<1e4&&!e;)n++,t=r.nextNode(),t&&t.shadowRoot&&(e=!0);return e})())})),r.router.addRoute("debugger::sync",((t,o)=>{const i=n.store.subscribe(((t,e)=>{"debugger/eventsCaptured"===t.type&&o({action:"events/eventsCaptured",data:e.debugger.eventsCaptured})})),a=setInterval((()=>{o({action:"agent/sync",data:n.store.state}),o({action:"environment/validateEnvironment",data:e.validateEnvironment(!0)})}),500);r.events.on("unmounted",(()=>{clearInterval(a),i()}))})),r.router.addRoute("debugger::enableEventLogging",(({data:t})=>{r.setProperties({enableEventLogging:t}),n.store.dispatch("debugger/enableEventLogging",t)})),r.router.addRoute("debugger::clearEventsCaptured",(()=>{n.store.dispatch("debugger/clearEventsCaptured")})),r.router.addRoute("debugger::checkGuideEligibility",(({data:t},e)=>{n.store.dispatch("debugger/checkGuideEligibility",{guideId:t,response:e})}))},start(){r.start()},stop(){r.stop(),r.setProperties({enabled:!1,containerType:"frame"})}};return o}();const Ms={initialize:function(t,e){Ds.init(t,e),Ds.start();const n=t.disableDebugging;t.disableDebugging=()=>{Ds.stop(),n()}},teardown:function(){Ds.stop()}};pendo.addExtension&&pendo.addExtension({name:"Debugger",version:"1.0.0",type:"agent",use:"plugin",uri:Ms})}();
|
|
1
|
+
!function(){"use strict";class t{constructor(t,e){this.path=t,this.handler=e}}class e{routes={};addRoute(e,n){this.routes[e]||(this.routes[e]=[]),this.routes[e].unshift(new t(e,n))}removeRoute(t){this.routes[t].shift()}lookupRouteProvider(){return t=>this.routes[t]?this.routes[t][0].handler:void 0}}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var o=Array.isArray,i="object"==typeof n&&n&&n.Object===Object&&n,a=i,s="object"==typeof self&&self&&self.Object===Object&&self,c=a||s||Function("return this")(),u=c.Symbol,d=u,l=Object.prototype,p=l.hasOwnProperty,f=l.toString,h=d?d.toStringTag:void 0;var g=function(t){var e=p.call(t,h),n=t[h];try{t[h]=void 0;var r=!0}catch(t){}var o=f.call(t);return r&&(e?t[h]=n:delete t[h]),o},v=Object.prototype.toString;var b=g,y=function(t){return v.call(t)},m=u?u.toStringTag:void 0;var w=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":m&&m in Object(t)?b(t):y(t)};var j=function(t){return null!=t&&"object"==typeof t},_=w,T=j;var P=function(t){return"symbol"==typeof t||T(t)&&"[object Symbol]"==_(t)},O=o,I=P,A=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,C=/^\w*$/;var E=function(t,e){if(O(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!I(t))||(C.test(t)||!A.test(t)||null!=e&&t in Object(e))};var S=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},x=w,R=S;var z,N=function(t){if(!R(t))return!1;var e=x(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},D=r(N),M=c["__core-js_shared__"],$=(z=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+z:"";var H=function(t){return!!$&&$ in t},k=Function.prototype.toString;var W=function(t){if(null!=t){try{return k.call(t)}catch(t){}try{return t+""}catch(t){}}return""},L=N,U=H,F=S,G=W,B=/^\[object .+?Constructor\]$/,q=Function.prototype,Q=Object.prototype,V=q.toString,K=Q.hasOwnProperty,J=RegExp("^"+V.call(K).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var X=function(t){return!(!F(t)||U(t))&&(L(t)?J:B).test(G(t))},Y=function(t,e){return null==t?void 0:t[e]};var Z=function(t,e){var n=Y(t,e);return X(n)?n:void 0},tt=Z(Object,"create"),et=tt;var nt=function(){this.__data__=et?et(null):{},this.size=0};var rt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ot=tt,it=Object.prototype.hasOwnProperty;var at=function(t){var e=this.__data__;if(ot){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return it.call(e,t)?e[t]:void 0},st=tt,ct=Object.prototype.hasOwnProperty;var ut=tt;var dt=nt,lt=rt,pt=at,ft=function(t){var e=this.__data__;return st?void 0!==e[t]:ct.call(e,t)},ht=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ut&&void 0===e?"__lodash_hash_undefined__":e,this};function gt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}gt.prototype.clear=dt,gt.prototype.delete=lt,gt.prototype.get=pt,gt.prototype.has=ft,gt.prototype.set=ht;var vt=gt;var bt=function(){this.__data__=[],this.size=0};var yt=function(t,e){return t===e||t!=t&&e!=e},mt=yt;var wt=function(t,e){for(var n=t.length;n--;)if(mt(t[n][0],e))return n;return-1},jt=wt,_t=Array.prototype.splice;var Tt=wt;var Pt=wt;var Ot=wt;var It=bt,At=function(t){var e=this.__data__,n=jt(e,t);return!(n<0)&&(n==e.length-1?e.pop():_t.call(e,n,1),--this.size,!0)},Ct=function(t){var e=this.__data__,n=Tt(e,t);return n<0?void 0:e[n][1]},Et=function(t){return Pt(this.__data__,t)>-1},St=function(t,e){var n=this.__data__,r=Ot(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};function xt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}xt.prototype.clear=It,xt.prototype.delete=At,xt.prototype.get=Ct,xt.prototype.has=Et,xt.prototype.set=St;var Rt=xt,zt=Z(c,"Map"),Nt=vt,Dt=Rt,Mt=zt;var $t=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Ht=function(t,e){var n=t.__data__;return $t(e)?n["string"==typeof e?"string":"hash"]:n.map},kt=Ht;var Wt=Ht;var Lt=Ht;var Ut=Ht;var Ft=function(){this.size=0,this.__data__={hash:new Nt,map:new(Mt||Dt),string:new Nt}},Gt=function(t){var e=kt(this,t).delete(t);return this.size-=e?1:0,e},Bt=function(t){return Wt(this,t).get(t)},qt=function(t){return Lt(this,t).has(t)},Qt=function(t,e){var n=Ut(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function Vt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Vt.prototype.clear=Ft,Vt.prototype.delete=Gt,Vt.prototype.get=Bt,Vt.prototype.has=qt,Vt.prototype.set=Qt;var Kt=Vt,Jt=Kt;function Xt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Xt.Cache||Jt),n}Xt.Cache=Jt;var Yt=Xt;var Zt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/\\(\\)?/g,ee=function(t){var e=Yt(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Zt,(function(t,n,r,o){e.push(r?o.replace(te,"$1"):n||t)})),e}));var ne=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o},re=ne,oe=o,ie=P,ae=u?u.prototype:void 0,se=ae?ae.toString:void 0;var ce=function t(e){if("string"==typeof e)return e;if(oe(e))return re(e,t)+"";if(ie(e))return se?se.call(e):"";var n=e+"";return"0"==n&&1/e==-Infinity?"-0":n},ue=ce;var de=function(t){return null==t?"":ue(t)},le=o,pe=E,fe=ee,he=de;var ge=function(t,e){return le(t)?t:pe(t,e)?[t]:fe(he(t))},ve=P;var be=function(t){if("string"==typeof t||ve(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e},ye=ge,me=be;var we=function(t,e){for(var n=0,r=(e=ye(e,t)).length;null!=t&&n<r;)t=t[me(e[n++])];return n&&n==r?t:void 0},je=we;var _e=r((function(t,e,n){var r=null==t?void 0:je(t,e);return void 0===r?n:r}));class Te{app=null;router=null;destination=window.parent||window.top;origin="*";constructor(t,e={}){this.app=t,this.router=t.router,this.config=e,this.events=t.PluginAPI.getEventable()}getConfig(t,e){return _e(this.config,t,e)}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 Pe={padding:"0 !important",margin:"0 !important","box-sizing":"border-box !important",border:"none !important"},Oe=2147483647,Ie={WINDOW_MARGIN:10,HEADER_HEIGHT:50,TOP:100,LEFT:100,HEIGHT:700,WIDTH:500,MIN_HEIGHT:500,MIN_WIDTH:500};const{MIN_HEIGHT:Ae,MIN_WIDTH:Ce,WINDOW_MARGIN:Ee}=Ie;function Se(t,e,n,r,o){let i=0,a=0,s=0,c=0;function u(n){n.preventDefault(),e.css({visibility:"hidden"}),t.releasePointerCapture(n.pointerId),t.removeEventListener("pointermove",d),o()}function d(t){-1===t.button&&0!==t.buttons?(t.preventDefault(),s=i-t.clientX,c=a-t.clientY,i=t.clientX,a=t.clientY,r(s,c)):u(t)}t.addEventListener("pointerdown",(function(r){if(0!==r.button)return;r.preventDefault(),e.css({visibility:"visible"}),i=r.clientX,a=r.clientY,t.setPointerCapture(r.pointerId),t.addEventListener("pointermove",d),n()})),t.addEventListener("pointerup",u),t.addEventListener("pointerout",u)}function xe(t,e){const n=t.offsetLeft-e,r=window.innerWidth-t.offsetWidth-Ee;return n<Ee||r<Ee?Ee:n>r?r:n}function Re(t,e){const n=t.offsetTop-e,r=window.innerHeight-t.offsetHeight-Ee;return n<Ee||r<Ee?Ee:n>r?r:n}function ze(t,e){const n=t.offsetWidth-e,r=window.innerWidth-t.offsetLeft-Ee;return n>r?r:n<Ce?Ce:n}function Ne(t,e){const n=t.offsetHeight-e,r=window.innerHeight-t.offsetTop-Ee;return n>r?r:n<Ae?Ae:n}class De extends Te{type="frame";destination=window.parent||window.top;origin=window.location.origin;constructor(t,e){super(t,e);const{pendo:n,PluginAPI:r}=t,o=this.getConfig("containerId","pendo-client-app");this.container=n.dom(`<div id="${o}" class="pendo-ignore">`).css({...Pe,height:t.state.height,width:t.state.width,"z-index":Oe-1,"background-color":"#FFFFFF",position:"fixed","box-shadow":"rgb(136, 136, 136) 0px 0px 20px 0px",overflow:"hidden"}),this.handle=n.dom('<div id="pendo-app-draggable-handle">').css({...Pe,"z-index":Oe,height:Ie.HEADER_HEIGHT,width:"calc(100% - 100px)",position:"absolute",cursor:"grab"}).on("dblclick",(()=>{t.state.minimized||(this.container.css({height:Ie.HEIGHT,width:Ie.WIDTH,transition:"all 250ms linear"}),setTimeout((()=>{this.container&&(this.container.css({transition:"none"}),this.saveSize())}),250))})).appendTo(this.container),this.resizeHandle=n.dom('<div id="pendo-app-resize-handle">').css({...Pe,"z-index":Oe,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=n.dom('<iframe id="pendo-agent-application" src="about:blank">').css({...Pe,height:"100%",width:"100%"}).on("load",(()=>{if(r.ConfigReader.get("inlineStyleNonce")){const t=this.frame[0].contentDocument.createElement.bind(this.frame[0].contentDocument);this.frame[0].contentDocument.createElement=(e,...n)=>{const o=t(e,...n);if("style"===e){const t=r.ConfigReader.get("inlineStyleNonce");t&&o.setAttribute("nonce",t)}return o}}const e=document.createElement("script");var o;e.src=(o=n,o&&o.trustedTypesPolicy?o.trustedTypesPolicy:{createScriptURL:t=>t}).createScriptURL(r.getAssetUrl(t.assetName)),this.frame[0].contentDocument.body.appendChild(e),this.frame[0].contentWindow.ignoreIframeMonitor=!0,this.triggerOpened()})).appendTo(this.container),this.blockout=n.dom('<div id="pendo-app-dragging-blockout">').css({"z-index":Oe-2,position:"absolute",height:"100%",width:"100%",top:0,left:0,visibility:"hidden"}).appendTo(n.dom.getBody()),this.elements=[this.container,this.blockout],this.positionFrame=t=>{let{left:e,top:n,height:r}=t;const{minimized:o,width:i}=t;e=e||Ie.LEFT,n=n||Ie.TOP,r=o?Ie.HEADER_HEIGHT:r,e=xe({offsetLeft:e,offsetWidth:i},0),n=Re({offsetTop:n,offsetHeight:r},0),this.container.css({left:e,top:n,height:r}),this.savePosition()},this.saveSize=()=>{const{offsetHeight:t,offsetWidth:e}=this.container[0];t&&e&&this.app.setProperties({height:t,width:e})},this.savePosition=()=>{const{offsetLeft:t,offsetTop:e}=this.container[0];t&&e&&this.app.setProperties({left:t,top:e})},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),function(t,e){const n=t.handle[0],r=t.container[0];Se(n,t.blockout,(function(){n.style.cursor="grabbing"}),(function(t,e){r.style.left=`${xe(r,t)}px`,r.style.top=`${Re(r,e)}px`}),(function(){n.style.cursor="grab",e()}))}(this,this.savePosition),function(t,e){const n=t.resizeHandle[0],r=t.container[0];Se(n,t.blockout,(()=>{}),(function(t,e){r.style.width=`${ze(r,t)}px`,r.style.height=`${Ne(r,e)}px`}),e)}(this,this.saveSize),window.addEventListener("resize",s),this.listeners=[["resize",s]];const i=n._.throttle((()=>function(t){const e=t.offsetLeft+t.offsetWidth+Ee-window.innerWidth;e>0&&(t.style.left=`${xe(t,e)}px`,t.offsetWidth>Ce&&(t.style.width=`${ze(t,e)}px`));const n=t.offsetTop+t.offsetHeight+Ee-window.innerHeight;n>0&&(t.style.top=`${Re(t,n)}px`,t.offsetHeight>Ae&&(t.style.height=`${Ne(t,n)}px`))}(this.container[0])),10),a=n._.debounce((()=>{this.savePosition(),this.saveSize()}),1e3);function s(){i(),a()}}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((([t,e])=>window.removeEventListener(t,e))),this.elements.forEach((t=>t.remove())),this.triggerClosed()}}var Me=c,$e=/\s/;var He=function(t){for(var e=t.length;e--&&$e.test(t.charAt(e)););return e},ke=/^\s+/;var We=function(t){return t?t.slice(0,He(t)+1).replace(ke,""):t},Le=S,Ue=P,Fe=/^[-+]0x[0-9a-f]+$/i,Ge=/^0b[01]+$/i,Be=/^0o[0-7]+$/i,qe=parseInt;var Qe=S,Ve=function(){return Me.Date.now()},Ke=function(t){if("number"==typeof t)return t;if(Ue(t))return NaN;if(Le(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Le(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=We(t);var n=Ge.test(t);return n||Be.test(t)?qe(t.slice(2),n?2:8):Fe.test(t)?NaN:+t},Je=Math.max,Xe=Math.min;var Ye=function(t,e,n){var r,o,i,a,s,c,u=0,d=!1,l=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function f(e){var n=r,i=o;return r=o=void 0,u=e,a=t.apply(i,n)}function h(t){var n=t-c;return void 0===c||n>=e||n<0||l&&t-u>=i}function g(){var t=Ve();if(h(t))return v(t);s=setTimeout(g,function(t){var n=e-(t-c);return l?Xe(n,i-(t-u)):n}(t))}function v(t){return s=void 0,p&&r?f(t):(r=o=void 0,a)}function b(){var t=Ve(),n=h(t);if(r=arguments,o=this,c=t,n){if(void 0===s)return function(t){return u=t,s=setTimeout(g,e),d?f(t):a}(c);if(l)return clearTimeout(s),s=setTimeout(g,e),f(c)}return void 0===s&&(s=setTimeout(g,e)),a}return e=Ke(e)||0,Qe(n)&&(d=!!n.leading,i=(l="maxWait"in n)?Je(Ke(n.maxWait)||0,e):i,p="trailing"in n?!!n.trailing:p),b.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=c=o=s=void 0},b.flush=function(){return void 0===s?a:v(Ve())},b},Ze=Ye,tn=S;var en=r((function(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return tn(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Ze(t,e,{leading:r,maxWait:e,trailing:o})})),nn=de,rn=0;var on=r((function(t){var e=++rn;return nn(t)+e})),an=Rt;var sn=Rt,cn=zt,un=Kt;var dn=Rt,ln=function(){this.__data__=new an,this.size=0},pn=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},fn=function(t){return this.__data__.get(t)},hn=function(t){return this.__data__.has(t)},gn=function(t,e){var n=this.__data__;if(n instanceof sn){var r=n.__data__;if(!cn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new un(r)}return n.set(t,e),this.size=n.size,this};function vn(t){var e=this.__data__=new dn(t);this.size=e.size}vn.prototype.clear=ln,vn.prototype.delete=pn,vn.prototype.get=fn,vn.prototype.has=hn,vn.prototype.set=gn;var bn=vn;var yn=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t},mn=Z,wn=function(){try{var t=mn(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),jn=wn;var _n=function(t,e,n){"__proto__"==e&&jn?jn(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},Tn=_n,Pn=yt,On=Object.prototype.hasOwnProperty;var In=function(t,e,n){var r=t[e];On.call(t,e)&&Pn(r,n)&&(void 0!==n||e in t)||Tn(t,e,n)},An=In,Cn=_n;var En=function(t,e,n,r){var o=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var s=e[i],c=r?r(n[s],t[s],s,n,t):void 0;void 0===c&&(c=t[s]),o?Cn(n,s,c):An(n,s,c)}return n};var Sn=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r},xn=w,Rn=j;var zn=function(t){return Rn(t)&&"[object Arguments]"==xn(t)},Nn=j,Dn=Object.prototype,Mn=Dn.hasOwnProperty,$n=Dn.propertyIsEnumerable,Hn=zn(function(){return arguments}())?zn:function(t){return Nn(t)&&Mn.call(t,"callee")&&!$n.call(t,"callee")},kn=Hn,Wn={exports:{}};var Ln=function(){return!1};!function(t,e){var n=c,r=Ln,o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o?n.Buffer:void 0,s=(a?a.isBuffer:void 0)||r;t.exports=s}(Wn,Wn.exports);var Un=Wn.exports,Fn=/^(?:0|[1-9]\d*)$/;var Gn=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Fn.test(t))&&t>-1&&t%1==0&&t<e};var Bn=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},qn=w,Qn=Bn,Vn=j,Kn={};Kn["[object Float32Array]"]=Kn["[object Float64Array]"]=Kn["[object Int8Array]"]=Kn["[object Int16Array]"]=Kn["[object Int32Array]"]=Kn["[object Uint8Array]"]=Kn["[object Uint8ClampedArray]"]=Kn["[object Uint16Array]"]=Kn["[object Uint32Array]"]=!0,Kn["[object Arguments]"]=Kn["[object Array]"]=Kn["[object ArrayBuffer]"]=Kn["[object Boolean]"]=Kn["[object DataView]"]=Kn["[object Date]"]=Kn["[object Error]"]=Kn["[object Function]"]=Kn["[object Map]"]=Kn["[object Number]"]=Kn["[object Object]"]=Kn["[object RegExp]"]=Kn["[object Set]"]=Kn["[object String]"]=Kn["[object WeakMap]"]=!1;var Jn=function(t){return Vn(t)&&Qn(t.length)&&!!Kn[qn(t)]};var Xn=function(t){return function(e){return t(e)}},Yn={exports:{}};!function(t,e){var n=i,r=e&&!e.nodeType&&e,o=r&&t&&!t.nodeType&&t,a=o&&o.exports===r&&n.process,s=function(){try{var t=o&&o.require&&o.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s}(Yn,Yn.exports);var Zn=Yn.exports,tr=Jn,er=Xn,nr=Zn&&Zn.isTypedArray,rr=nr?er(nr):tr,or=Sn,ir=kn,ar=o,sr=Un,cr=Gn,ur=rr,dr=Object.prototype.hasOwnProperty;var lr=function(t,e){var n=ar(t),r=!n&&ir(t),o=!n&&!r&&sr(t),i=!n&&!r&&!o&&ur(t),a=n||r||o||i,s=a?or(t.length,String):[],c=s.length;for(var u in t)!e&&!dr.call(t,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||cr(u,c))||s.push(u);return s},pr=Object.prototype;var fr=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||pr)};var hr=function(t,e){return function(n){return t(e(n))}},gr=hr(Object.keys,Object),vr=fr,br=gr,yr=Object.prototype.hasOwnProperty;var mr=N,wr=Bn;var jr=function(t){return null!=t&&wr(t.length)&&!mr(t)},_r=lr,Tr=function(t){if(!vr(t))return br(t);var e=[];for(var n in Object(t))yr.call(t,n)&&"constructor"!=n&&e.push(n);return e},Pr=jr;var Or=function(t){return Pr(t)?_r(t):Tr(t)},Ir=En,Ar=Or;var Cr=function(t,e){return t&&Ir(e,Ar(e),t)};var Er=S,Sr=fr,xr=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e},Rr=Object.prototype.hasOwnProperty;var zr=lr,Nr=function(t){if(!Er(t))return xr(t);var e=Sr(t),n=[];for(var r in t)("constructor"!=r||!e&&Rr.call(t,r))&&n.push(r);return n},Dr=jr;var Mr=function(t){return Dr(t)?zr(t,!0):Nr(t)},$r=En,Hr=Mr;var kr=function(t,e){return t&&$r(e,Hr(e),t)},Wr={exports:{}};!function(t,e){var n=c,r=e&&!e.nodeType&&e,o=r&&t&&!t.nodeType&&t,i=o&&o.exports===r?n.Buffer:void 0,a=i?i.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=a?a(n):new t.constructor(n);return t.copy(r),r}}(Wr,Wr.exports);var Lr=Wr.exports;var Ur=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e};var Fr=function(){return[]},Gr=function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i},Br=Fr,qr=Object.prototype.propertyIsEnumerable,Qr=Object.getOwnPropertySymbols,Vr=Qr?function(t){return null==t?[]:(t=Object(t),Gr(Qr(t),(function(e){return qr.call(t,e)})))}:Br,Kr=En,Jr=Vr;var Xr=function(t,e){return Kr(t,Jr(t),e)};var Yr=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t},Zr=hr(Object.getPrototypeOf,Object),to=Yr,eo=Zr,no=Vr,ro=Fr,oo=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)to(e,no(t)),t=eo(t);return e}:ro,io=En,ao=oo;var so=function(t,e){return io(t,ao(t),e)},co=Yr,uo=o;var lo=function(t,e,n){var r=e(t);return uo(t)?r:co(r,n(t))},po=lo,fo=Vr,ho=Or;var go=function(t){return po(t,ho,fo)},vo=lo,bo=oo,yo=Mr;var mo=function(t){return vo(t,yo,bo)},wo=Z(c,"DataView"),jo=zt,_o=Z(c,"Promise"),To=Z(c,"Set"),Po=Z(c,"WeakMap"),Oo=w,Io=W,Ao="[object Map]",Co="[object Promise]",Eo="[object Set]",So="[object WeakMap]",xo="[object DataView]",Ro=Io(wo),zo=Io(jo),No=Io(_o),Do=Io(To),Mo=Io(Po),$o=Oo;(wo&&$o(new wo(new ArrayBuffer(1)))!=xo||jo&&$o(new jo)!=Ao||_o&&$o(_o.resolve())!=Co||To&&$o(new To)!=Eo||Po&&$o(new Po)!=So)&&($o=function(t){var e=Oo(t),n="[object Object]"==e?t.constructor:void 0,r=n?Io(n):"";if(r)switch(r){case Ro:return xo;case zo:return Ao;case No:return Co;case Do:return Eo;case Mo:return So}return e});var Ho=$o,ko=Object.prototype.hasOwnProperty;var Wo=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&ko.call(t,"index")&&(n.index=t.index,n.input=t.input),n},Lo=c.Uint8Array;var Uo=function(t){var e=new t.constructor(t.byteLength);return new Lo(e).set(new Lo(t)),e},Fo=Uo;var Go=function(t,e){var n=e?Fo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)},Bo=/\w*$/;var qo=function(t){var e=new t.constructor(t.source,Bo.exec(t));return e.lastIndex=t.lastIndex,e},Qo=u?u.prototype:void 0,Vo=Qo?Qo.valueOf:void 0;var Ko=Uo;var Jo=Uo,Xo=Go,Yo=qo,Zo=function(t){return Vo?Object(Vo.call(t)):{}},ti=function(t,e){var n=e?Ko(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)};var ei=function(t,e,n){var r=t.constructor;switch(e){case"[object ArrayBuffer]":return Jo(t);case"[object Boolean]":case"[object Date]":return new r(+t);case"[object DataView]":return Xo(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return ti(t,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(t);case"[object RegExp]":return Yo(t);case"[object Symbol]":return Zo(t)}},ni=S,ri=Object.create,oi=function(){function t(){}return function(e){if(!ni(e))return{};if(ri)return ri(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),ii=Zr,ai=fr;var si=function(t){return"function"!=typeof t.constructor||ai(t)?{}:oi(ii(t))},ci=Ho,ui=j;var di=function(t){return ui(t)&&"[object Map]"==ci(t)},li=Xn,pi=Zn&&Zn.isMap,fi=pi?li(pi):di,hi=Ho,gi=j;var vi=function(t){return gi(t)&&"[object Set]"==hi(t)},bi=Xn,yi=Zn&&Zn.isSet,mi=yi?bi(yi):vi,wi=bn,ji=yn,_i=In,Ti=Cr,Pi=kr,Oi=Lr,Ii=Ur,Ai=Xr,Ci=so,Ei=go,Si=mo,xi=Ho,Ri=Wo,zi=ei,Ni=si,Di=o,Mi=Un,$i=fi,Hi=S,ki=mi,Wi=Or,Li=Mr,Ui="[object Arguments]",Fi="[object Function]",Gi="[object Object]",Bi={};Bi[Ui]=Bi["[object Array]"]=Bi["[object ArrayBuffer]"]=Bi["[object DataView]"]=Bi["[object Boolean]"]=Bi["[object Date]"]=Bi["[object Float32Array]"]=Bi["[object Float64Array]"]=Bi["[object Int8Array]"]=Bi["[object Int16Array]"]=Bi["[object Int32Array]"]=Bi["[object Map]"]=Bi["[object Number]"]=Bi[Gi]=Bi["[object RegExp]"]=Bi["[object Set]"]=Bi["[object String]"]=Bi["[object Symbol]"]=Bi["[object Uint8Array]"]=Bi["[object Uint8ClampedArray]"]=Bi["[object Uint16Array]"]=Bi["[object Uint32Array]"]=!0,Bi["[object Error]"]=Bi[Fi]=Bi["[object WeakMap]"]=!1;var qi=function t(e,n,r,o,i,a){var s,c=1&n,u=2&n,d=4&n;if(r&&(s=i?r(e,o,i,a):r(e)),void 0!==s)return s;if(!Hi(e))return e;var l=Di(e);if(l){if(s=Ri(e),!c)return Ii(e,s)}else{var p=xi(e),f=p==Fi||"[object GeneratorFunction]"==p;if(Mi(e))return Oi(e,c);if(p==Gi||p==Ui||f&&!i){if(s=u||f?{}:Ni(e),!c)return u?Ci(e,Pi(s,e)):Ai(e,Ti(s,e))}else{if(!Bi[p])return i?e:{};s=zi(e,p,c)}}a||(a=new wi);var h=a.get(e);if(h)return h;a.set(e,s),ki(e)?e.forEach((function(o){s.add(t(o,n,r,o,e,a))})):$i(e)&&e.forEach((function(o,i){s.set(i,t(o,n,r,i,e,a))}));var g=l?void 0:(d?u?Si:Ei:u?Li:Wi)(e);return ji(g||e,(function(o,i){g&&(o=e[i=o]),_i(s,i,t(o,n,r,i,e,a))})),s};var Qi=function(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r<o;)i[r]=t[r+e];return i},Vi=we,Ki=Qi;var Ji=ge,Xi=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0},Yi=function(t,e){return e.length<2?t:Vi(t,Ki(e,0,-1))},Zi=be;var ta=function(t,e){return e=Ji(e,t),null==(t=Yi(t,e))||delete t[Zi(Xi(e))]},ea=w,na=Zr,ra=j,oa=Function.prototype,ia=Object.prototype,aa=oa.toString,sa=ia.hasOwnProperty,ca=aa.call(Object);var ua=function(t){if(!ra(t)||"[object Object]"!=ea(t))return!1;var e=na(t);if(null===e)return!0;var n=sa.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&aa.call(n)==ca};var da=function(t){return ua(t)?void 0:t},la=kn,pa=o,fa=u?u.isConcatSpreadable:void 0;var ha=Yr,ga=function(t){return pa(t)||la(t)||!!(fa&&t&&t[fa])};var va=function t(e,n,r,o,i){var a=-1,s=e.length;for(r||(r=ga),i||(i=[]);++a<s;){var c=e[a];n>0&&r(c)?n>1?t(c,n-1,r,o,i):ha(i,c):o||(i[i.length]=c)}return i},ba=va;var ya=function(t){return(null==t?0:t.length)?ba(t,1):[]};var ma=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)},wa=Math.max;var ja=function(t,e,n){return e=wa(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=wa(r.length-e,0),a=Array(i);++o<i;)a[o]=r[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=r[o];return s[e]=n(a),ma(t,this,s)}};var _a=function(t){return t},Ta=function(t){return function(){return t}},Pa=wn,Oa=Pa?function(t,e){return Pa(t,"toString",{configurable:!0,enumerable:!1,value:Ta(e),writable:!0})}:_a,Ia=Date.now;var Aa=function(t){var e=0,n=0;return function(){var r=Ia(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}},Ca=Aa(Oa),Ea=ya,Sa=ja,xa=Ca;var Ra=ne,za=qi,Na=ta,Da=ge,Ma=En,$a=da,Ha=mo,ka=r(function(t){return xa(Sa(t,void 0,Ea),t+"")}((function(t,e){var n={};if(null==t)return n;var r=!1;e=Ra(e,(function(e){return e=Da(e,t),r||(r=e.length>1),e})),Ma(t,Ha(t),n),r&&(n=za(n,7,$a));for(var o=e.length;o--;)Na(n,e[o]);return n})));const Wa="promise";function La(t,e,n){this.name=t,this.type=e,this.data=n}La.prototype.toString=function(){return`Message.${this.type} - ${this.name}`};const Ua=t=>{try{const{name:e,type:n,isResponse:r,data:o,requestId:i,sender:a}=t.data||{},s=new La(e,n,null!=o?JSON.parse(o):void 0);return s.requestId=i,s.sender=a,s.destination=t.source,s.isResponse=r,s}catch(t){return!1}},Fa=t=>(t.isResponse=!0,t),Ga=(...t)=>e=>[].concat(t).reduce(((t,n,r,o)=>{const i=n(t,e);return i||o.splice(r,o.length-r),i}),e);var Ba=function(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),s=a.length;s--;){var c=a[t?s:++o];if(!1===n(i[c],c,i))break}return e}}(),qa=Or;var Qa=jr;var Va=function(t,e){return function(n,r){if(null==n)return n;if(!Qa(n))return t(n,r);for(var o=n.length,i=e?o:-1,a=Object(n);(e?i--:++i<o)&&!1!==r(a[i],i,a););return n}}((function(t,e){return t&&Ba(t,e,qa)})),Ka=_a;var Ja=yn,Xa=Va,Ya=function(t){return"function"==typeof t?t:Ka},Za=o;var ts=r((function(t,e){return(Za(t)?Ja:Xa)(t,Ya(e))}));const es="disconnected",ns={lastMessageReceivedAt:0,currentConnectionQuality:es,changeCallbacks:{},evalCallbacks:{}},rs=t=>{t!==ns.currentConnectionQuality&&(ns.currentConnectionQuality=t,ts(ns.changeCallbacks,(t=>{t(ns.currentConnectionQuality)})))},os=()=>{if(0===ns.lastMessageReceivedAt)return void rs(es);const t=Date.now()-ns.lastMessageReceivedAt;t<1e4?rs("connected"):(t=>t>1e4)(t)&&((t=>t>3e4)(t)?rs("dead_connection"):rs(es)),ts(ns.evalCallbacks,(t=>{t(ns.currentConnectionQuality)}))};let is;let as=0;const ss=()=>{ns.currentConnectionQuality=es,ns.lastMessageReceivedAt=0},cs={appName:void 0,connectionName:void 0,frameId:void 0,pendingRequests:{},topics:{},senderIds:{},originProvider:void 0,destinationProvider:void 0},us=()=>`${cs.appName}${cs.connectionName}(${cs.frameId})`,ds=t=>{t.sender||(t.sender=us());const e=t.destination||cs.destinationProvider(),n=(t=>{const e=ka(t,["destination","toString","data"]);return e.data=JSON.stringify(t.data,((t,e)=>"function"==typeof e||e instanceof RegExp?e.toString?e.toString():void 0:e)),e})(t),r=fs(t.sender),o=hs(t.sender);if(r||o)r?r.postMessage(n):e.postMessage(n,cs.originProvider());else{const r=new MessageChannel;_s(r.port1,t.sender),e.postMessage(n,cs.originProvider(),[r.port2])}},ls=(t,e,n=1e3)=>new Promise(((r,o)=>{const i=((t,e,n)=>{const r=new La(t,e,n);return e===Wa&&(r.requestId=on()),r})(t,Wa,e),a=setTimeout((()=>{o(`${t} timeout`),vs(i),Ps(i)}),n);gs(i,(()=>clearTimeout(a)),r,o),ds(i)})),ps=t=>(cs.senderIds[t]||(t=>{cs.senderIds[t]||(cs.senderIds[t]={port:void 0,hasTriedToUpgradeToMessageChannel:!1})})(t),cs.senderIds[t]),fs=t=>ps(t).port,hs=t=>ps(t).hasTriedToUpgradeToMessageChannel,gs=(t,e,n,r)=>{cs.pendingRequests[t.requestId]={message:t,clearTimeoutfn:e,resolve:n,reject:r}},vs=t=>{const{requestId:e}=t;return cs.pendingRequests[e].clearTimeoutfn(),delete cs.pendingRequests[e],t},bs="message::ping",ys=Ga((t=>{const e=cs.pendingRequests[t.requestId];return e&&(e.resolve(t.data),vs(t)),t}),(t=>{const e=cs.topics[t.name];return e&&e.forEach((e=>e(t.data))),t}),(t=>{if(!t)return t;if(t.isResponse)return t;if(t.name===bs)return ds(Fa(t)),t;const e=cs.routeHandlerLookup(t.name);if(e){const n=e=>{t.data=e,ds(Fa(t))};e(t,n)}else console.log(us(),`No route handler for ${t.name}`,t);return t}),(ms=()=>{((t=Date.now())=>{ns.lastMessageReceivedAt=t})()},(t,...e)=>(ms(t,...e),t)));var ms;const ws=t=>("*"===cs.originProvider()||t.origin===cs.originProvider())&&t,js=t=>{const e=_e(t,"data.sender");return!(!e||"string"!=typeof e)&&(!!e.includes(cs.appName)&&t)},_s=(t,e)=>{const n=ps(e);n.port=t,n.hasTriedToUpgradeToMessageChannel=!0,n.port.onmessage=Ga(Ua,ys)},Ts=(t,e)=>(!ps(t.sender).hasTriedToUpgradeToMessageChannel&&e.ports&&e.ports[0]&&_s(e.ports[0],t.sender),t),Ps=t=>{(t=>{const e=ps(t);e.port=void 0,e.hasTriedToUpgradeToMessageChannel=!1})(t.sender)};let Os=()=>{};const Is=()=>{Os(),Os=()=>{},is&&is(),ss()},As=en((t=>{"connected"!==t&&cs.usePingAutoReconnect&&ls(bs).catch((()=>{console.log("message::ping timedout")}))}),1e3),Cs=(t,e,n,r,o,i=!1,a)=>{if(!window.addEventListener)return;cs.appName=t,cs.frameId=e,cs.routeHandlerLookup=n,cs.usePingAutoReconnect=i,cs.connectionName=a||"",cs.originProvider=r||(()=>window.location.origin||"*"),cs.destinationProvider=o||(()=>window.parent||window.top),((t={})=>{const e=setInterval(os,100);is=()=>clearInterval(e)})(),(t=>{if(!D(t))return;const e=as++;ns.evalCallbacks[e]=t})(As);const s=Ga(ws,js,Ua,Ts,ys);window.addEventListener("message",s),Os=()=>window.removeEventListener("message",s)},Es=t=>{(t=>{if(!D(t))return;const e=as++;ns.changeCallbacks[e]=t})(t)};function Ss(){return(new Date).getTime()}class xs extends Te{type="window";testUrl="";realUrl=void 0;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(),t=this.app,e=1e3,new Promise(((n,r)=>{const o=Ss(),i=()=>{t.getConnectionStatus()?n():Ss()-o>e?r():setTimeout(i,50)};i()}));var t,e}))}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`),ls("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`));const t=document.createElement("script");t.src=this.app.PluginAPI.getAssetUrl(this.app.assetName),this.destination.document.body.appendChild(t),this.destination.document.title=this.getTitle()}close(){this.router.removeRoute("app::windowClosed"),this.destination.close(),this.triggerClosed()}}const Rs=()=>({});class zs{defaultState={containerType:"frame",minimized:!1,height:500,width:500,left:100,top:100};state={};containerClosedCallbacks=[];container=null;isConnected=!1;constructor(t,n,r,o,i,a=Rs,s=Rs){this.appName=t,this.assetName=n,this.assetStorageKey=r,this.connectionName=o,this.frameConfigProvider=a,this.windowConfigProvider=s,i&&Object.assign(this.defaultState,i),this.router=new e}init(t,e){this.pendo=t,this.PluginAPI=e,this.events=e.getEventable(),this.router.addRoute("app::ping",((t,e)=>{e()})),this.router.addRoute("app::setProperties",(({data:t})=>{this.setProperties(t)})),this.router.addRoute("app::toggleContainer",(()=>{this.setProperties({minimized:!1}),this.toggleContainerType()})),this.router.addRoute("app::windowClosed",(()=>{})),this.loadState(),this.prepContainer()}prepContainer(){this.container="window"===this.state.containerType?new xs(this,this.windowConfigProvider()):new De(this,this.frameConfigProvider())}setConnectionStatus(t){this.isConnected="connected"===t}getConnectionStatus(){return this.isConnected}setProperties(t){Object.assign(this.state,t),this.writeState()}getDefaultState(){return this.defaultState||{}}loadState(){try{const t=JSON.parse(this.PluginAPI.agentStorage.read(this.assetStorageKey,!0));this.state=Object.assign({},this.getDefaultState(),this.state,t)}catch(t){this.PluginAPI.log.error(t),this.state=Object.assign({},this.getDefaultState(),this.state)}}writeState(){this.PluginAPI.agentStorage.write(this.assetStorageKey,JSON.stringify(this.state),null,!0)}toggleContainerType(){const t="frame"===this.state.containerType?"window":"frame";this.setProperties({containerType:t}),this.stop(),this.start()}start(){this.container||this.prepContainer();const{frameId:t}=this.PluginAPI.EventTracer.addTracerIds({});Cs(this.appName,t,this.router.lookupRouteProvider(),this.container.getOriginProvider(),this.container.getDestinationProvider(),!0,this.connectionName),Es((t=>{this.setConnectionStatus(t)})),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"),Is()}}const Ns=t=>({apiKey:t.apiKey,environment:t.debugging.isStagingServer()?"staging":"production",device:t.debugging.isMobileUserAgent()?"mobile":"desktop",browserCookies:window.navigator.cookieEnabled,guideStatus:t.areGuidesDisabled()?"disabled":t.debugging.areGuidesDelayed()?"delayed":"enabled"}),Ds=function(){const t={height:Ie.HEIGHT,width:Ie.WIDTH};let e,n;const r=new zs("Debugger","pendo.debugger.min.js","debug-enabled","AgentPlugin",t,(()=>({containerId:"pendo-client-debugger"})),(()=>({title:"Pendo Debugger"}))),o={app:r,init(t,o){e=t,n=o,n.restartDebugger=this.start,r.init(e,n),r.router.addRoute("debugger::connect",((t,o)=>{o({config:n.ConfigReader.audit(),env:Ns(e),container:r.state,events:n.store.state.debugger.eventsCaptured})})),r.router.addRoute("debugger::stop",(()=>{e.disableDebugging()})),r.router.addRoute("debugger::showGuideById",((t,n)=>{n(e.showGuideById(t.data))})),r.router.addRoute("debugger::toggleGuideLoop",(t=>{t.data?e.startGuides():e.stopGuides()})),r.router.addRoute("debugger::tombstoneGuide",(t=>{const r=e.findGuideById(t.data);n.Tombstone.addGuide(r)})),r.router.addRoute("debugger::openGuidePage",(t=>{const r=((t,e,n)=>{const r=e.findGuideById(t);if(!r||!e._.get(r,"attributes.resourceCenter"))return`${n}/guides/${t}`;if(r.attributes.resourceCenter.isTopLevel)return`${n}/resource-center/${r.id}/draft`;const o=e.BuildingBlocks.BuildingBlockResourceCenter.getResourceCenter();return o&&o.id?`${n}/resource-center/${o.id}/module/${r.id}`:""})(t.data,e,n.hosts.SERVER);r&&window.open(r,"_blank")})),r.router.addRoute("debugger::restore",(({data:t})=>{(t=>{if(!t||!t.length)return;const e=document.createElement("iframe");e.sandbox="allow-same-origin",e.src="about:blank",e.hidden=!0,document.body.appendChild(e),e.contentWindow.ignoreIframeMonitor=!0,t.forEach((t=>{t.id.split(".").reduce(((t,e,n,r)=>n===r.length-1?(t.destination[e]=t.source[e],t.destination[e]):(t.destination=t.destination[e],t.source=t.source[e],t)),{destination:window,source:e.contentWindow})})),document.body.removeChild(e)})(t)})),r.router.addRoute("debugger::findShadowRoot",((t,e)=>{e((()=>{let t,e=!1,n=0;const r=document.createNodeIterator(document.body,NodeFilter.SHOW_ELEMENT);if(!r||!r.nextNode)return!0;for(;n<1e4&&!e;)n++,t=r.nextNode(),t&&t.shadowRoot&&(e=!0);return e})())})),r.router.addRoute("debugger::sync",((t,o)=>{const i=n.store.subscribe(((t,e)=>{"debugger/eventsCaptured"===t.type&&o({action:"events/eventsCaptured",data:e.debugger.eventsCaptured})})),a=setInterval((()=>{o({action:"agent/sync",data:n.store.state}),o({action:"environment/validateEnvironment",data:e.validateEnvironment(!0)})}),500);r.events.on("unmounted",(()=>{clearInterval(a),i()}))})),r.router.addRoute("debugger::enableEventLogging",(({data:t})=>{r.setProperties({enableEventLogging:t}),n.store.dispatch("debugger/enableEventLogging",t)})),r.router.addRoute("debugger::clearEventsCaptured",(()=>{n.store.dispatch("debugger/clearEventsCaptured")})),r.router.addRoute("debugger::checkGuideEligibility",(({data:t},e)=>{n.store.dispatch("debugger/checkGuideEligibility",{guideId:t,response:e})}))},start(){r.start()},stop(){r.stop(),r.setProperties({enabled:!1,containerType:"frame"})}};return o}();const Ms={initialize:function(t,e){Ds.init(t,e),Ds.start();const n=t.disableDebugging;t.disableDebugging=()=>{Ds.stop(),n()}},teardown:function(){Ds.stop()}};pendo.addExtension&&pendo.addExtension({name:"Debugger",version:"1.0.0",type:"agent",use:"plugin",uri:Ms})}();
|
package/dist/pendo.module.js
CHANGED
|
@@ -9864,7 +9864,8 @@ var ConfigReader = (function () {
|
|
|
9864
9864
|
addOption('allowedText', [SNIPPET_SRC, PENDO_CONFIG_SRC], []);
|
|
9865
9865
|
/**
|
|
9866
9866
|
* An array of specific Pendo events that you do not want the Agent to capture. Available event types
|
|
9867
|
-
* include: `identify`, `meta`, `load`, `click`, `focus`, `submit`, `change`, `track`.
|
|
9867
|
+
* include: `identify`, `meta`, `load`, `click`, `focus`, `submit`, `change`, `track`. See [Event Controls](/events/event-controls)
|
|
9868
|
+
* for more information.
|
|
9868
9869
|
*
|
|
9869
9870
|
* @access public
|
|
9870
9871
|
* @category Config/Analytics
|
|
@@ -9911,8 +9912,10 @@ var ConfigReader = (function () {
|
|
|
9911
9912
|
*/
|
|
9912
9913
|
addOption('excludeAllText', [PENDO_CONFIG_SRC, SNIPPET_SRC], false, true);
|
|
9913
9914
|
/**
|
|
9914
|
-
* When `true`,
|
|
9915
|
-
*
|
|
9915
|
+
* When `true`, the Agent will only send guide and poll events. All other events will not be sent, including:
|
|
9916
|
+
* identify, meta, load, click, focus, change, submit, or track. Metadata assigned to visitors will still function
|
|
9917
|
+
* for guide targeting but will not be sent to Pendo to be visible in the UI. See [Event Controls](/events/event-controls)
|
|
9918
|
+
* for more information.
|
|
9916
9919
|
*
|
|
9917
9920
|
* @access public
|
|
9918
9921
|
* @category Config/Analytics
|
|
@@ -10631,8 +10634,8 @@ var SERVER = '';
|
|
|
10631
10634
|
var ASSET_HOST = '';
|
|
10632
10635
|
var ASSET_PATH = '';
|
|
10633
10636
|
var DESIGNER_ENV = '';
|
|
10634
|
-
var VERSION = '2.
|
|
10635
|
-
var PACKAGE_VERSION = '2.
|
|
10637
|
+
var VERSION = '2.269.0_';
|
|
10638
|
+
var PACKAGE_VERSION = '2.269.0';
|
|
10636
10639
|
var LOADER = 'xhr';
|
|
10637
10640
|
/* eslint-enable agent-eslint-rules/no-gulp-env-references */
|
|
10638
10641
|
/**
|
|
@@ -20524,7 +20527,7 @@ var ContentVerifier = (function () {
|
|
|
20524
20527
|
return q.all(promises);
|
|
20525
20528
|
}
|
|
20526
20529
|
catch (e) {
|
|
20527
|
-
Events.
|
|
20530
|
+
Events.contentVerificationFail.trigger(contentContainer, e);
|
|
20528
20531
|
throw e;
|
|
20529
20532
|
}
|
|
20530
20533
|
}
|
|
@@ -20576,7 +20579,7 @@ var ContentVerifier = (function () {
|
|
|
20576
20579
|
return verifyContentHash(contentContainer, urlProp);
|
|
20577
20580
|
}
|
|
20578
20581
|
function computeStepHash(contentContainer, urlProp) {
|
|
20579
|
-
var propMap = { 'domUrl': 'domHash', 'domJsonpUrl': 'domJsonpHash' };
|
|
20582
|
+
var propMap = { 'domUrl': 'domHash', 'domJsonpUrl': 'domJsonpHash', 'contentUrl': 'contentHash', 'contentUrlJs': 'contentJsHash' };
|
|
20580
20583
|
var prop = propMap[urlProp];
|
|
20581
20584
|
return contentContainer[prop] || getHashFromContentUrl(contentContainer[urlProp]);
|
|
20582
20585
|
}
|
|
@@ -21222,7 +21225,7 @@ var AsyncContent = (function () {
|
|
|
21222
21225
|
language = guide.language;
|
|
21223
21226
|
}
|
|
21224
21227
|
var uniqueContentKey = step.guideId + step.id;
|
|
21225
|
-
var container = _.extend({ 'id': uniqueContentKey, 'language': language, 'guideId': step.guideId }, _.pick(step, 'contentUrl', 'contentUrlCss', 'contentUrlJs', 'domJsonpUrl', 'domUrl'));
|
|
21228
|
+
var container = _.extend({ 'id': uniqueContentKey, 'language': language, 'guideId': step.guideId }, _.pick(step, 'contentUrl', 'contentUrlCss', 'contentUrlJs', 'domJsonpUrl', 'domUrl', 'domHash', 'contentHash', 'contentJsHash'));
|
|
21226
21229
|
stepState.promise = ContentVerifier.verify(container).then(function () {
|
|
21227
21230
|
stepState.verified = true;
|
|
21228
21231
|
return ContentLoader.load(container);
|
|
@@ -28104,6 +28107,23 @@ function createPreviewBar() {
|
|
|
28104
28107
|
'z-index': 400000
|
|
28105
28108
|
});
|
|
28106
28109
|
frame.onload = function () {
|
|
28110
|
+
if (ConfigReader.get('inlineStyleNonce')) {
|
|
28111
|
+
var originalCreateDocument_1 = frame.contentDocument.createElement.bind(frame.contentDocument);
|
|
28112
|
+
frame.contentDocument.createElement = function (type) {
|
|
28113
|
+
var rest = [];
|
|
28114
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
28115
|
+
rest[_i - 1] = arguments[_i];
|
|
28116
|
+
}
|
|
28117
|
+
var el = originalCreateDocument_1.apply(void 0, __spreadArray([type], rest, false));
|
|
28118
|
+
if (type === 'style') {
|
|
28119
|
+
var styleNonce = ConfigReader.get('inlineStyleNonce');
|
|
28120
|
+
if (styleNonce) {
|
|
28121
|
+
el.setAttribute('nonce', styleNonce);
|
|
28122
|
+
}
|
|
28123
|
+
}
|
|
28124
|
+
return el;
|
|
28125
|
+
};
|
|
28126
|
+
}
|
|
28107
28127
|
var script = document.createElement('script');
|
|
28108
28128
|
script.src = getPreviewModeAssetUrl();
|
|
28109
28129
|
frame.contentDocument.body.appendChild(script);
|
|
@@ -28119,7 +28139,7 @@ function prepareDesignerPreviewGuide() {
|
|
|
28119
28139
|
_.each(currentPreviewGuideConfig.guide.steps, function (step) {
|
|
28120
28140
|
var toRemove = ['domJsonpUrl', 'domUrl'];
|
|
28121
28141
|
if (step.domUrl && step.domUrl.indexOf('data:') === 0) {
|
|
28122
|
-
toRemove = ['domJson', '
|
|
28142
|
+
toRemove = ['domJson', 'contentJs', 'contentCss', 'content'];
|
|
28123
28143
|
}
|
|
28124
28144
|
_.each(toRemove, function (field) {
|
|
28125
28145
|
delete step[field];
|