@zoom/cobrowsesdk 2.7.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/CHANGELOG.md +1 -0
- package/LICENSE.md +1 -0
- package/README.md +143 -0
- package/esm/agent.js +1 -0
- package/esm/base.js +1 -0
- package/esm/customer.js +1 -0
- package/esm/sdk-channel.js +1 -0
- package/esm/sdk-client-agent.js +1 -0
- package/esm/sdk-client.js +1 -0
- package/esm/sdk-controller.js +1 -0
- package/esm/sdk-core-css.js +1 -0
- package/esm/sdk-core.js +1 -0
- package/esm/sdk-portal-agent-css.js +1 -0
- package/esm/sdk-portal-agent.js +1 -0
- package/esm/sdk-portal-customer-css.js +1 -0
- package/esm/sdk-portal-customer.js +1 -0
- package/oss_attribution.txt +5929 -0
- package/package.json +45 -0
- package/types/agent-umd.d.ts +1029 -0
- package/types/agent.d.ts +1023 -0
- package/types/customer-umd.d.ts +1031 -0
- package/types/customer.d.ts +1025 -0
- package/umd/agent.js +1 -0
- package/umd/customer.js +1 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The Changelog can be found [here](https://developers.zoom.us/changelog/cobrowse-sdk/)
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Use of this SDK is subject to our [Terms of Use](https://www.zoom.com/en/trust/video-sdk-terms/).
|
package/README.md
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# Zoom Cobrowse SDK for Web
|
|
2
|
+
|
|
3
|
+
This SDK is subject to Zoom's [Terms of Use](https://www.zoom.com/en/trust/video-sdk-terms/). It falls under the definitions of "SDK" and "SDK Service" as outlined in those terms.
|
|
4
|
+
|
|
5
|
+
The [Zoom Cobrowse SDK](https://developers.zoom.us/docs/cobrowse-sdk/) enables users to share their web browsing experience with an organization without compromising privacy and security. Collaborators can annotate and see what is being shared. Certain parts of the screen can be masked or redacted from view by the user to protect their privacy and confidentiality. This offers a secure and advanced form of screen sharing, limited to one particular web site.
|
|
6
|
+
|
|
7
|
+
## Customer
|
|
8
|
+
|
|
9
|
+
### Installation
|
|
10
|
+
|
|
11
|
+
In your frontend project, install the Cobrowse SDK:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
$ npm install @zoom/cobrowsesdk --save
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
In the component file where you want to use the Cobrowse SDK, import ZoomCobrowse:
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
import { ZoomCobrowseSDK } from '@zoom/cobrowsesdk/customer';
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Usage
|
|
24
|
+
|
|
25
|
+
#### Initialize the API
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
ZoomCobrowseSDK.init( settings Object, [ Callback Function ] )
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This initializes the environment for ZoomCobrowseSDK, the settings based on settings object, it tests required browser features, and passes the result to the Callback function. Don't make any other API calls before Callback is called.
|
|
32
|
+
|
|
33
|
+
#### Implement a callback function
|
|
34
|
+
|
|
35
|
+
Callback should be a function accepting one argument with the following structure:
|
|
36
|
+
|
|
37
|
+
```js
|
|
38
|
+
{
|
|
39
|
+
"success": true | false,
|
|
40
|
+
"session": "<Zoom Cobrowse Session Instance>",
|
|
41
|
+
"error": "<error message or undefined if no error occured>"
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### Sample code
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
ZoomCobrowseSDK.init(settings, function ({ success, session, error }) {
|
|
49
|
+
if (success) {
|
|
50
|
+
const sessionInfo = session.getSessionInfo();
|
|
51
|
+
|
|
52
|
+
if (sessionInfo.sessionStatus === 'session_recoverable') {
|
|
53
|
+
session.join();
|
|
54
|
+
} else {
|
|
55
|
+
session.start({
|
|
56
|
+
sdkToken: '{SDK_TOKEN}',
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
console.log(error);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Agent
|
|
66
|
+
|
|
67
|
+
### Installation
|
|
68
|
+
|
|
69
|
+
In your frontend project, install the Cobrowse SDK:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
$ npm install @zoom/cobrowsesdk --save
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
In the component file where you want to use the Cobrowse SDK, import ZoomCobrowse:
|
|
76
|
+
|
|
77
|
+
```js
|
|
78
|
+
import { ZoomCobrowseAgentSDK } from '@zoom/cobrowsesdk/agent';
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Usage
|
|
82
|
+
|
|
83
|
+
This snippet loads the necessary ZoomCobrowseAgentSDK JS libraries. Once it is there, the ZoomCobrowseAgentSDK.init() function will be immediately available.
|
|
84
|
+
|
|
85
|
+
#### Initialize the API
|
|
86
|
+
|
|
87
|
+
```js
|
|
88
|
+
ZoomCobrowseAgentSDK.init( settings Object, [ Callback Function ] )
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
This script initializes the ZoomCobrowseAgentSDK environment by defining a global object (ZoomCobrowseAgentSDK) and loading the SDK dynamically. It ensures that the necessary dependencies are available and verifies browser compatibility. Once loaded, it prepares the SDK for use by passing the initialization arguments to ZoomCobrowseAgentSDKInitArgs. Ensure no other API calls are made before the SDK has been fully initialized.
|
|
92
|
+
|
|
93
|
+
#### Implement a callback function
|
|
94
|
+
|
|
95
|
+
Callback should be a function accepting one argument with the following structure:
|
|
96
|
+
|
|
97
|
+
```js
|
|
98
|
+
{
|
|
99
|
+
"success": true | false,
|
|
100
|
+
"session": "<Zoom Cobrowse Session Instance>",
|
|
101
|
+
"error": "<error message or undefined if no error occured>"
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
#### Sample code
|
|
106
|
+
|
|
107
|
+
```js
|
|
108
|
+
ZoomAgentCobrowseSDK.init(settings, function ({ success, session, error }) {
|
|
109
|
+
if (success) {
|
|
110
|
+
const sessionInfo = session.getSessionInfo();
|
|
111
|
+
|
|
112
|
+
if (sessionInfo.sessionStatus === 'session_recoverable') {
|
|
113
|
+
session.join();
|
|
114
|
+
} else {
|
|
115
|
+
session.join({
|
|
116
|
+
sdkToken: '{SDK_TOKEN}',
|
|
117
|
+
pinCode: '{PIN_CODE}',
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
} else {
|
|
121
|
+
console.log(error);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Session Parameters
|
|
127
|
+
|
|
128
|
+
Now we will start or join the session. Here are the required parameters for the `session.start()` or `session.join()` functions.
|
|
129
|
+
|
|
130
|
+
| Parameter | Parameter Description |
|
|
131
|
+
| --------- | ------------------------------------------------------------------------------------------- |
|
|
132
|
+
| token | Required, your [Cobrowse SDK JWT](https://developers.zoom.us/docs/cobrowse-sdk/authorize/). |
|
|
133
|
+
|
|
134
|
+
Then start or join the session and define the stream, which will be used for [core features](#core-features).
|
|
135
|
+
|
|
136
|
+
## Core Features:
|
|
137
|
+
|
|
138
|
+
- [Annotation](https://developers.zoom.us/docs/cobrowse-sdk/features/#annotation)
|
|
139
|
+
- [Data masking](https://developers.zoom.us/docs/cobrowse-sdk/features/#data-masking)
|
|
140
|
+
|
|
141
|
+
For the full list of features and event listeners, as well as additional guides, see our [Cobrowse SDK docs](https://developers.zoom.us/docs/cobrowse-sdk/).
|
|
142
|
+
|
|
143
|
+
[Open Source Software attribution](https://st1.zoom.us/zcb/2.7.0/oss_attribution.txt)
|
package/esm/agent.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */t=function(){return n};var e,n={},r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function f(t,e,n,r){return Object.defineProperty(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r})}try{f({},"")}catch(e){f=function(t,e,n){return t[e]=n}}function l(t,n,r,o){var i=n&&n.prototype instanceof d?n:d,a=Object.create(i.prototype);return f(a,"_invoke",function(t,n,r){var o=1;return function(i,a){if(3===o)throw Error("Generator is already running");if(4===o){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=k(s,r);if(u){if(u===p)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(1===o)throw o=4,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=3;var c=h(t,n,r);if("normal"===c.type){if(o=r.done?4:2,c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=4,r.method="throw",r.arg=c.arg)}}}(t,r,new C(o||[])),!0),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=l;var p={};function d(){}function y(){}function m(){}var v={};f(v,a,(function(){return this}));var g=Object.getPrototypeOf,w=g&&g(g(O([])));w&&w!==r&&o.call(w,a)&&(v=w);var _=m.prototype=d.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(r,i,a,u){var c=h(t[r],t,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==s(l)&&o.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var r;f(this,"_invoke",(function(t,o){function i(){return new e((function(e,r){n(t,o,e,r)}))}return r=r?r.then(i,i):i()}),!0)}function k(t,n){var r=n.method,o=t.i[r];if(o===e)return n.delegate=null,"throw"===r&&t.i.return&&(n.method="return",n.arg=e,k(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var i=h(o,t.i,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,p;var a=i.arg;return a?a.done?(n[t.r]=a.value,n.next=t.n,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function E(t){this.tryEntries.push(t)}function N(t){var n=t[4]||{};n.type="normal",n.arg=e,t[4]=n}function C(t){this.tryEntries=[[-1]],t.forEach(E,this),this.reset(!0)}function O(t){if(null!=t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function n(){for(;++r<t.length;)if(o.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(s(t)+" is not iterable")}return y.prototype=m,f(_,"constructor",m),f(m,"constructor",y),y.displayName=f(m,c,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,f(t,c,"GeneratorFunction")),t.prototype=Object.create(_),t},n.awrap=function(t){return{__await:t}},b(S.prototype),f(S.prototype,u,(function(){return this})),n.AsyncIterator=S,n.async=function(t,e,r,o,i){void 0===i&&(i=Promise);var a=new S(l(t,e,r,o),i);return n.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(_),f(_,c,"Generator"),f(_,a,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),n=[];for(var r in e)n.unshift(r);return function t(){for(;n.length;)if((r=n.pop())in e)return t.value=r,t.done=!1,t;return t.done=!0,t}},n.values=O,C.prototype={constructor:C,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(N),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(e){a.type="throw",a.arg=t,n.next=e}for(var o=n.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i[4],s=this.prev,u=i[1],c=i[2];if(-1===i[0])return r("end"),!1;if(!u&&!c)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=s){if(s<u)return this.method="next",this.arg=e,r(u),!0;if(s<c)return r(c),!1}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r[0]>-1&&r[0]<=this.prev&&this.prev<r[2]){var o=r;break}}o&&("break"===t||"continue"===t)&&o[0]<=e&&e<=o[2]&&(o=null);var i=o?o[4]:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o[2],p):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n[2]===t)return this.complete(n[4],n[3]),N(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n[0]===t){var r=n[4];if("throw"===r.type){var o=r.arg;N(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={i:O(t),r:n,n:r},"next"===this.method&&(this.arg=e),p}},n}function e(t,n){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},e(t,n)}function n(t){var e=i();return function(){var n,o=a(t);if(e){var i=a(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return r(this,n)}}function r(t,e){if(e&&("object"==s(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return o(t)}function o(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function i(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(i=function(){return!!t})()}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,l(r.key),r)}}function f(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t){var e=function(t,e){if("object"!=s(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==s(e)?e:e+""}import{S as h,D as p,_ as d,T as y}from"./base.js";var m=function(){function t(e,n){u(this,t),this.sessionInfo=e,this.metaInfo=n,this.isViewer=!0}return f(t,[{key:"sessionId",get:function(){var t;return(null===(t=this.sessionInfo)||void 0===t?void 0:t.session_id)||""}},{key:"sdkVersion",get:function(){var t;return(null===(t=window.ZCB_NPM_SDK_AGENT_MAIN)||void 0===t?void 0:t.sdkVersion)||""}},{key:"domain",get:function(){return this.metaInfo.zoomHostName}},{key:"appKey",get:function(){return this.metaInfo.appKey}},{key:"authToken",get:function(){var t,e;return(null===(e=null===(t=this.sessionInfo)||void 0===t?void 0:t.current_user)||void 0===e?void 0:e.auth_token)||""}}]),t}(),v="ZoomCobrowseAgentPortal",g=function(i){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&e(t,n)}(s,h);var a=n(s);function s(t){var e;return u(this,s),s.instance?r(e,s.instance):((e=a.call(this,t)).initPromise=new p,e.sdkVersion="2.7.0",s.instance=o(e),window.ZCB_NPM_SDK_AGENT_SESSION_CONTEXT=new m(null,e.getMetaInfo()),r(e,o(e)))}return f(s,[{key:"getMetaInfo",value:function(){var t=this.options||{};return{appKey:t.appKey,zoomHostName:t.zoomHostName}}},{key:"fullScriptsSrc",get:function(){return[{name:"sdk-client-agent",url:"./sdk-client-agent",lazyContent:import("./sdk-client-agent.js")}]}},{key:"initCallback",value:function(e){return d(this,void 0,void 0,t().mark((function n(){var r=this;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=3;break}return t.next=3,Promise.all([this.appendByFragment(this.doc,this.fullScriptsSrc,y.JS,this.addScript.bind(this),this.doc.head)]).then((function(){r.initPromise.resolve(!0)}));case 3:case"end":return t.stop()}}),n,this)})))}},{key:"outerFrameScript",get:function(){return[{name:"sdk-channel",url:"./sdk-channel",lazyContent:import("./sdk-channel.js")},{name:"sdk-controller",url:"./sdk-controller",lazyContent:import("./sdk-controller.js")},{name:"sdk-portal-agent",url:"./sdk-portal-agent",lazyContent:import("./sdk-portal-agent.js"),attrs:{crossOrigin:"anonymous"}}]}},{key:"outerFrameCss",get:function(){return[{name:"sdk-portal-agent-css",url:"./sdk-portal-agent/css",lazyContent:import("./sdk-portal-agent-css.js")}]}},{key:"waitIframeLoaded",value:function(){return new Promise((function(t){setTimeout((function(){t(!1)}),0)}))}},{key:"initAgentPortal",value:function(e,n){return d(this,void 0,void 0,t().mark((function r(){var o,i,a,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.waitIframeLoaded();case 2:if(o=e.contentDocument,i=e.contentWindow,e.title=v,e.style.width="100%",e.style.height="100%",o&&i){t.next=9;break}throw new Error("frame not ready: title=".concat(e.title));case 9:return i.ZCB_NPM_SDK_AGENT_MAIN=window.ZCB_NPM_SDK_AGENT_MAIN,i.ZCB_NPM_SDK_AGENT_SESSION_CONTEXT=new m(n,this.getMetaInfo()),(a=o.createElement("div")).id="root",o.body.appendChild(a),(s=o.createElement("title")).innerText=v,o.head.appendChild(s),t.next=19,Promise.all([this.appendByFragment(o,this.outerFrameCss,y.CSS,this.addLink.bind(this),o.head),this.appendByFragment(o,this.outerFrameScript,y.JS,this.addScript.bind(this),o.body)]);case 19:case"end":return t.stop()}}),r,this)})))}},{key:"innerFrameScript",get:function(){return[{name:"sdk-core",url:"./sdk-core",lazyContent:import("./sdk-core.js")}]}},{key:"innerFrameCss",get:function(){return[{name:"sdk-core-css",url:"./sdk-core/css",lazyContent:import("./sdk-core-css.js")}]}},{key:"initAgentInner",value:function(e,n){var r,o,i;return d(this,void 0,void 0,t().mark((function a(){var s,u,c,f;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.waitIframeLoaded();case 2:if(s=e.contentDocument,u=e.contentWindow,e.title=n,s&&u){t.next=7;break}throw new Error("frame not ready: title=".concat(e.title));case 7:return u.ZCB_NPM_SDK_AGENT_MAIN=window.ZCB_NPM_SDK_AGENT_MAIN,u.parent.ZCB_NPM_SDK_AGENT_SESSION_CONTEXT&&(u.ZCB_NPM_SDK_AGENT_SESSION_CONTEXT=u.parent.ZCB_NPM_SDK_AGENT_SESSION_CONTEXT),c=s.createElement("meta"),s.head.appendChild(c),c.setAttribute("http-equiv","Content-Security-Policy"),c.setAttribute("content",(null===(i=null===(o=null===(r=u.ZCB_NPM_SDK_AGENT_SESSION_CONTEXT)||void 0===r?void 0:r.sessionInfo)||void 0===o?void 0:o.sdk_config)||void 0===i?void 0:i.csp)||""),(f=s.createElement("title")).innerText=n,s.head.appendChild(f),t.next=18,Promise.all([this.appendByFragment(s,this.innerFrameCss,y.CSS,this.addLink.bind(this),s.head),this.appendByFragment(s,this.innerFrameScript,y.JS,this.addScript.bind(this),s.body)]);case 18:case"end":return t.stop()}}),a,this)})))}},{key:"isInnerFrame",value:function(t){return t.title!==v}}]),s}(),w={init:function(t,e){var n=t||{},r=n.appKey,o=void 0===r?"":r,i=n.zoomHostName,a=void 0===i?"us01-zcb.zoom.us":i,s=!g.instance,u=new g({doc:document,appKey:o,zoomHostName:a});window.ZCB_NPM_SDK_AGENT_MAIN=u,s?window.ZoomCobrowseAgentSDKInitArgs=[t,e]:u.initPromise.promise.then((function(){window.ZoomCobrowseAgentSDK.init(t,e)}))}};export{w as ZoomCobrowseAgentSDK};
|
package/esm/base.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */t=function(){return r};var e,r={},n=Object.prototype,i=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function f(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{f({},"")}catch(e){f=function(t,e,r){return t[e]=r}}function l(t,r,n,i){var o=r&&r.prototype instanceof d?r:d,a=Object.create(o.prototype);return f(a,"_invoke",function(t,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var u=n.delegate;if(u){var s=P(u,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var c=h(t,r,n);if("normal"===c.type){if(i=n.done?4:2,c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=4,n.method="throw",n.arg=c.arg)}}}(t,n,new k(i||[])),!0),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=l;var p={};function d(){}function v(){}function m(){}var y={};f(y,u,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(I([])));b&&b!==n&&i.call(b,u)&&(y=b);var E=m.prototype=d.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(n,a,u,s){var c=h(t[n],t,a);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==o(l)&&i.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,u,s)}),(function(t){r("throw",t,u,s)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return r("throw",t,u,s)}))}s(c.arg)}var n;f(this,"_invoke",(function(t,i){function o(){return new e((function(e,n){r(t,i,e,n)}))}return n=n?n.then(o,o):o()}),!0)}function P(t,r){var n=r.method,i=t.i[n];if(i===e)return r.delegate=null,"throw"===n&&t.i.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var o=h(i,t.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var a=o.arg;return a?a.done?(r[t.r]=a.value,r.next=t.n,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,p):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function R(t){this.tryEntries.push(t)}function T(t){var r=t[4]||{};r.type="normal",r.arg=e,t[4]=r}function k(t){this.tryEntries=[[-1]],t.forEach(R,this),this.reset(!0)}function I(t){if(null!=t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function r(){for(;++n<t.length;)if(i.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(o(t)+" is not iterable")}return v.prototype=m,f(E,"constructor",m),f(m,"constructor",v),v.displayName=f(m,c,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,f(t,c,"GeneratorFunction")),t.prototype=Object.create(E),t},r.awrap=function(t){return{__await:t}},w(O.prototype),f(O.prototype,s,(function(){return this})),r.AsyncIterator=O,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var a=new O(l(t,e,n,i),o);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(E),f(E,c,"Generator"),f(E,u,(function(){return this})),f(E,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.unshift(n);return function t(){for(;r.length;)if((n=r.pop())in e)return t.value=n,t.done=!1,t;return t.done=!0,t}},r.values=I,k.prototype={constructor:k,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e){a.type="throw",a.arg=t,r.next=e}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],u=this.prev,s=o[1],c=o[2];if(-1===o[0])return n("end"),!1;if(!s&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=u){if(u<s)return this.method="next",this.arg=e,n(s),!0;if(u<c)return n(c),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===t||"continue"===t)&&i[0]<=e&&e<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i[2],p):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),T(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r[0]===t){var n=r[4];if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={i:I(t),r:r,n:n},"next"===this.method&&(this.arg=e),p}},r}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function n(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function i(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:e+""}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{s(n.next(t))}catch(t){o(t)}}function u(t){try{s(n.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))}function u(t){if("object"===("undefined"==typeof window?"undefined":o(window))){var e=encodeURI(t);return btoa(e)}return Buffer.from(t).toString("base64")}var s=function(t){return u(t)},c=function(){function t(r){var n=r.requestOrigin,i=r.parentFrameId;e(this,t),this.parentFrameId=i;var o=s(n);i&&(o=i+"--"+o),this.frameId=o}return n(t,[{key:"equal",value:function(t){var e=t.requestOrigin,r=t.parentFrameId;return r===this.parentFrameId&&this.frameId===r+"--"+s(e)}},{key:"isParentFrame",value:function(t){return this.frameId===t}},{key:"isSubFrame",value:function(t){return this.parentFrameId===t}}]),t}(),f=function(){function t(r){e(this,t),this.frames=new Map,this.tabId=r}return n(t,[{key:"getFrame",value:function(t){var e=t.requestOrigin,r=t.parentFrameId,n=null;return this.frames.forEach((function(t){t.equal({requestOrigin:e,parentFrameId:r})&&(n=t)})),n}},{key:"checkAddFrame",value:function(t){var e=this,r=t.requestOrigin,n=t.parentFrameId,i=this.getFrame({requestOrigin:r,parentFrameId:n});if(i)return i;if(this.tabId===n)return this.addFrame({requestOrigin:r,parentFrameId:n});var o=null;return this.frames.forEach((function(t){o||t.isParentFrame(n)&&(o=e.addFrame({requestOrigin:r,parentFrameId:n}))})),o}},{key:"getSubFrames",value:function(t){var e=[];return this.frames.forEach((function(r){r.isSubFrame(t)&&e.push(r)})),e}},{key:"addFrame",value:function(t){var e=t.requestOrigin,r=t.parentFrameId,n=new c({requestOrigin:e,parentFrameId:r});return this.frames.set(n.frameId,n),n}}]),t}(),l=function(){function t(){e(this,t),this.tabs=new Map}return n(t,[{key:"makeRequest",value:function(t){var e=t.requestOrigin,r=t.parentFrameId,n="";return r?(this.tabs.forEach((function(t){if(!n){var i=t.checkAddFrame({requestOrigin:e,parentFrameId:r});i&&(n=i.frameId)}})),n):this.tabs.size?(this.tabs.forEach((function(t,e){n||(n=e)})),n):(n=s(e),this.tabs.set(n,new f(n)),n)}},{key:"makeViewerRequest",value:function(t){var e=t.parentFrameId,r="";return this.tabs.forEach((function(t){var n;if(e){if(r)return;var i=t.getSubFrames(e);r=(null===(n=i[0])||void 0===n?void 0:n.frameId)||""}else r=t.tabId})),r}}]),t}(),h=new(function(){function t(){e(this,t),this.rooms=new Map}return n(t,[{key:"makeRequest",value:function(t){var e=t.roomId,r=t.requestOrigin,n=t.parentFrameId,i=t.isViewer;this.rooms.get(e)||this.rooms.set(e,new l);var o=this.rooms.get(e);return o?i?o.makeViewerRequest({parentFrameId:n}):o.makeRequest({requestOrigin:r,parentFrameId:n}):""}}]),t}());"undefined"!=typeof global&&(global.cpsRoomManager=h);var p,d,v,m=function(t,e){return"".concat(t).concat(e)};!function t(e,r){var n={},i=function(){var i=e[a];"string"==typeof i?n[a]=m(r,i):"function"==typeof i?n[a]=function(){return m(r,i.apply(void 0,arguments))}:"object"===o(i)&&(i instanceof RegExp||(n[a]=t(i,r)))};for(var a in e)i();return n}({log:{report:"/report-log"},blob:{uploadBlob:"/upload-blob",getBlobUrl:function(t){return"/cps-blob-".concat(t)},getBlobUrlReg:/cps-blob-([^?#\/]+)/}},"/co-browsing"),function(t){t.LOCAL="local",t.PROD="prod"}(p||(p={})),function(t){t.LEADER="1",t.FOLLOWER="2",t.RECORDER="11"}(d||(d={})),function(t){t.IMG="IMG",t.SOURCE="SOURCE",t.LINK="LINK",t.A="A",t.AUDIO="AUDIO",t.IFRAME="IFRAME",t.FORM="FORM",t.SCRIPT="SCRIPT",t.STYLE="STYLE"}(v||(v={}));var y,g,b,E,w,O,P,R;!function(t){t.LEADER="HR",t.FOLLOWER="VR"}(y||(y={})),new RegExp("(.+)(HTTPS?)/(.+)/".concat("CPS-SEP-FLAG","/(").concat(y.FOLLOWER,"|").concat(y.LEADER,")")),function(t){t[t.TYPE_UNKNOWN=-1]="TYPE_UNKNOWN",t[t.TYPE_TOP=1]="TYPE_TOP",t[t.TYPE_FRAME=2]="TYPE_FRAME",t[t.TYPE_AUX=3]="TYPE_AUX",t[t.TYPE_SCRIPT=4]="TYPE_SCRIPT",t[t.TYPE_MODULE=5]="TYPE_MODULE",t[t.TYPE_LINK=6]="TYPE_LINK",t[t.TYPE_XHR=7]="TYPE_XHR",t[t.TYPE_RESOURCE=8]="TYPE_RESOURCE",t[t.TYPE_WORKER=9]="TYPE_WORKER",t[t.TYPE_WORKER_SCOPE=10]="TYPE_WORKER_SCOPE",t[t.TYPE_REDIRECT=11]="TYPE_REDIRECT",t[t.TYPE_PAWS=12]="TYPE_PAWS",t[t.TYPE_CONTINUATION=13]="TYPE_CONTINUATION"}(g||(g={})),function(t){t.UNKNOW="unknow",t.BROWSER="browser",t.BROWSER_WORKER="worker",t.NODE="node",t.NODE_WORKER="node_worker"}(b||(b={})),E="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,w="undefined"!=typeof window,O="function"==typeof importScripts,P=E&&!O,R=!E&&!w,O?b.BROWSER_WORKER:w?b.BROWSER:R?b.NODE:P?b.NODE_WORKER:b.UNKNOW;var T,k,I=n((function t(){var r=this;e(this,t),this.promise=new Promise((function(t,e){r.reject=e,r.resolve=t})),this.promise.then((function(t){return r.resolved=!0,t})).catch((function(){r.resolved=!1})).finally((function(){r.finished=!0,r.finishedTimestamp=Date.now()}))}));!function(t){t.PING="zcb-sdk-ping",t.PONG="zcb-sdk-pong"}(T||(T={})),function(t){t.CSS="text/css",t.JS="application/javascript"}(k||(k={}));var _=function(){function r(t){e(this,r),this.options=t,this._initTimer=null,this._bindedPongHandler=null,this.receivedPong=!1,this.codeBlobMap=new Map,this.enableBlob=!1;var n=this.options.doc;this.doc=n,this.ping()}return n(r,[{key:"ping",value:function(){this.addListener();try{if(window.parent===window)return void this.initCallback(!0);window.parent.postMessage("sdk-ping","*")}catch(t){return this.stopInitTimer(),void this.initCallback(!0)}this.startInitTimer()}},{key:"startInitTimer",value:function(){var t=this,e=(this.options||{}).pingPongTimeout,r=void 0===e?500:e;this.stopInitTimer(),this._initTimer=setTimeout((function(){t.receivedPong||t.initCallback(!0)}),r)}},{key:"stopInitTimer",value:function(){this.removeListener(),this._initTimer&&(clearTimeout(this._initTimer),this._initTimer=null)}},{key:"addListener",value:function(){this._bindedPongHandler=this.handlePong.bind(this),window.addEventListener("message",this._bindedPongHandler)}},{key:"removeListener",value:function(){this._bindedPongHandler&&window.removeEventListener("message",this._bindedPongHandler)}},{key:"handlePong",value:function(t){var e;try{t.data===T.PING&&(null===(e=t.source)||void 0===e||e.postMessage(T.PONG,"*")),t.data===T.PONG&&(this.receivedPong=!0,this.initCallback(!1))}catch(t){this.stopInitTimer(),this.initCallback(!0)}}},{key:"initCallback",value:function(e){return a(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),e)})))}},{key:"addScript",value:function(t,e,r,n,i){var o=t.createElement("script");if(o.type="text/javascript",this.enableBlob?(o.src=r,o.async=!1):o.textContent=r,o.id=i,n)for(var a in n)n.hasOwnProperty(a)&&(o[a]=n[a]);e.appendChild(o)}},{key:"addLink",value:function(t,e,r,n,i){var o=this.enableBlob?"link":"style",a=t.createElement(o);if(this.enableBlob?(a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.setAttribute("href",r)):a.textContent=r,a.setAttribute("class","CBS-internal-block"),a.id=i,n)for(var u in n)n.hasOwnProperty(u)&&(a[u]=n[u]);e.appendChild(a)}},{key:"appendByFragment",value:function(e,r,n,i,o){return a(this,void 0,void 0,t().mark((function a(){var u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=e.createDocumentFragment(),t.next=3,this.getTrunkBlobUrl(r,n);case 3:t.sent.forEach((function(t){var r=t.url,n=t.attrs,o=t.name;i(e,u,r,n,o)})),o.appendChild(u);case 6:case"end":return t.stop()}}),a,this)})))}},{key:"getTrunkBlobUrl",value:function(e,r){return a(this,void 0,void 0,t().mark((function n(){var i=this;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.enableBlob){t.next=6;break}return t.next=3,Promise.all(e.map((function(t){var e=t.url,n=t.lazyContent;if(i.codeBlobMap.get(e))return Promise.resolve(null);var o=new I;return i.codeBlobMap.set(e,o),n.then((function(t){return i.getBlobUrl(t.default,r)})).then((function(t){o.resolve(t)})).catch((function(t){o.reject(t),i.codeBlobMap.delete(e)}))})));case 3:return t.abrupt("return",Promise.all(e.map((function(t){var e=t.url,r=t.attrs,n=t.name;return i.codeBlobMap.get(e).promise.then((function(t){return{url:t,attrs:r,name:n}}))}))));case 6:return t.abrupt("return",Promise.all(e.map((function(t){var e=t.lazyContent,r=t.attrs,n=t.name;return e.then((function(t){return{url:t.default,attrs:r,name:n}}))}))));case 7:case"end":return t.stop()}}),n,this)})))}},{key:"getBlobUrl",value:function(t,e){var r=new Blob([t],{type:e});return URL.createObjectURL(r)}}]),r}();export{I as D,_ as S,k as T,a as _};
|
package/esm/customer.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */t=function(){return e};var r,e={},n=Object.prototype,o=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function f(t,r,e,n){return Object.defineProperty(t,r,{value:e,enumerable:!n,configurable:!n,writable:!n})}try{f({},"")}catch(r){f=function(t,r,e){return t[r]=e}}function l(t,e,n,o){var i=e&&e.prototype instanceof y?e:y,a=Object.create(i.prototype);return f(a,"_invoke",function(t,e,n){var o=1;return function(i,a){if(3===o)throw Error("Generator is already running");if(4===o){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=_(u,n);if(c){if(c===p)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===o)throw o=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=3;var s=h(t,e,n);if("normal"===s.type){if(o=n.done?4:2,s.arg===p)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=4,n.method="throw",n.arg=s.arg)}}}(t,n,new O(o||[])),!0),a}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p={};function y(){}function d(){}function m(){}var v={};f(v,a,(function(){return this}));var g=Object.getPrototypeOf,w=g&&g(g(x([])));w&&w!==n&&o.call(w,a)&&(v=w);var b=m.prototype=y.prototype=Object.create(v);function k(t){["next","throw","return"].forEach((function(r){f(t,r,(function(t){return this._invoke(r,t)}))}))}function S(t,r){function e(n,i,a,c){var s=h(t[n],t,i);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==u(l)&&o.call(l,"__await")?r.resolve(l.__await).then((function(t){e("next",t,a,c)}),(function(t){e("throw",t,a,c)})):r.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return e("throw",t,a,c)}))}c(s.arg)}var n;f(this,"_invoke",(function(t,o){function i(){return new r((function(r,n){e(t,o,r,n)}))}return n=n?n.then(i,i):i()}),!0)}function _(t,e){var n=e.method,o=t.i[n];if(o===r)return e.delegate=null,"throw"===n&&t.i.return&&(e.method="return",e.arg=r,_(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var i=h(o,t.i,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,p;var a=i.arg;return a?a.done?(e[t.r]=a.value,e.next=t.n,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,p):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function j(t){this.tryEntries.push(t)}function E(t){var e=t[4]||{};e.type="normal",e.arg=r,t[4]=e}function O(t){this.tryEntries=[[-1]],t.forEach(j,this),this.reset(!0)}function x(t){if(null!=t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=r,e.done=!0,e};return i.next=i}}throw new TypeError(u(t)+" is not iterable")}return d.prototype=m,f(b,"constructor",m),f(m,"constructor",d),d.displayName=f(m,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===d||"GeneratorFunction"===(r.displayName||r.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,f(t,s,"GeneratorFunction")),t.prototype=Object.create(b),t},e.awrap=function(t){return{__await:t}},k(S.prototype),f(S.prototype,c,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new S(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(b),f(b,s,"Generator"),f(b,a,(function(){return this})),f(b,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var r=Object(t),e=[];for(var n in r)e.unshift(n);return function t(){for(;e.length;)if((n=e.pop())in r)return t.value=n,t.done=!1,t;return t.done=!0,t}},e.values=x,O.prototype={constructor:O,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r){a.type="throw",a.arg=t,e.next=r}for(var o=e.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i[4],u=this.prev,c=i[1],s=i[2];if(-1===i[0])return n("end"),!1;if(!c&&!s)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=u){if(u<c)return this.method="next",this.arg=r,n(c),!0;if(u<s)return n(s),!1}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}o&&("break"===t||"continue"===t)&&o[0]<=r&&r<=o[2]&&(o=null);var i=o?o[4]:{};return i.type=t,i.arg=r,o?(this.method="next",this.next=o[2],p):this.complete(i)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),p},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e[2]===t)return this.complete(e[4],e[3]),E(e),p}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e[0]===t){var n=e[4];if("throw"===n.type){var o=n.arg;E(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={i:x(t),r:e,n:n},"next"===this.method&&(this.arg=r),p}},e}function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},r(t,e)}function e(t){var r=i();return function(){var e,o=a(t);if(r){var i=a(this).constructor;e=Reflect.construct(o,arguments,i)}else e=o.apply(this,arguments);return n(this,e)}}function n(t,r){if(r&&("object"==u(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return o(t)}function o(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function i(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(i=function(){return!!t})()}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function c(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function s(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,l(n.key),n)}}function f(t,r,e){return r&&s(t.prototype,r),e&&s(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t){var r=function(t,r){if("object"!=u(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==u(r)?r:r+""}import{S as h,_ as p,T as y}from"./base.js";var d=function(){function t(r){c(this,t),this.metaInfo=r}return f(t,[{key:"sdkVersion",get:function(){var t;return(null===(t=window.ZCB_NPM_SDK_CUSTOMER_MAIN)||void 0===t?void 0:t.sdkVersion)||""}},{key:"domain",get:function(){return this.metaInfo.zoomHostName}},{key:"appKey",get:function(){return this.metaInfo.appKey}}]),t}(),m=function(i){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&r(t,e)}(u,h);var a=e(u);function u(t){var r;if(c(this,u),u.instance)return n(r,u.instance);(r=a.call(this,t)).sdkVersion="2.7.0",u.instance=o(r);var e=t.appKey,i=t.zoomHostName;return window.ZCB_NPM_SDK_CUSTOMER_SESSION_CONTEXT=new d({appKey:e,zoomHostName:i}),n(r,o(r))}return f(u,[{key:"fullScriptsSrc",get:function(){return[{name:"sdk-core",url:"./sdk-core",lazyContent:import("./sdk-core.js")},{name:"sdk-channel",url:"./sdk-channel",lazyContent:import("./sdk-channel.js")},{name:"sdk-controller",url:"./sdk-controller",lazyContent:import("./sdk-controller.js")},{name:"sdk-client",url:"./sdk-client",lazyContent:import("./sdk-client.js")},{name:"sdk-portal-customer",url:"./sdk-portal-customer",lazyContent:import("./sdk-portal-customer.js")}]}},{key:"coreScriptsSrc",get:function(){return[{name:"sdk-core",url:"./sdk-core",lazyContent:import("./sdk-core.js")}]}},{key:"cssSrc",get:function(){return[{name:"sdk-portal-customer-css",url:"./sdk-portal-customer/css",lazyContent:import("./sdk-portal-customer-css.js")}]}},{key:"initCallback",value:function(r){return p(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!r){t.next=5;break}return t.next=3,Promise.all([this.appendByFragment(this.doc,this.cssSrc,y.CSS,this.addLink.bind(this),this.doc.head),this.appendByFragment(this.doc,this.fullScriptsSrc,y.JS,this.addScript.bind(this),this.doc.head)]);case 3:t.next=7;break;case 5:return t.next=7,Promise.all([this.appendByFragment(this.doc,this.coreScriptsSrc,y.JS,this.addScript.bind(this),this.doc.head)]);case 7:case"end":return t.stop()}}),e,this)})))}}]),u}(),v={init:function(t,r){var e=t||{},n=e.appKey,o=void 0===n?"":n,i=e.zoomHostName,a=new m({doc:document,appKey:o,zoomHostName:void 0===i?"us01-zcb.zoom.us":i});window.ZCB_NPM_SDK_CUSTOMER_MAIN=a,window.ZoomCobrowseSDKInitArgs=[t,r]}};export{v as ZoomCobrowseSDK};
|