diff --git a/README.md b/README.md index 3387e6e9..116776c3 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ For direct use in a browser script: ```{"language":"html"} - + diff --git a/build/README.md b/build/README.md index 3387e6e9..116776c3 100644 --- a/build/README.md +++ b/build/README.md @@ -29,7 +29,7 @@ For direct use in a browser script: ```{"language":"html"} - + diff --git a/build/dist/node/purecloud-guest-chat-client.js b/build/dist/node/purecloud-guest-chat-client.js index 4c6dbcc5..07443c4b 100644 --- a/build/dist/node/purecloud-guest-chat-client.js +++ b/build/dist/node/purecloud-guest-chat-client.js @@ -6,7 +6,7 @@ var superagent = _interopDefault(require('superagent')); /** * @module purecloud-guest-chat-client/ApiClient - * @version 3.0.0 + * @version 4.0.0 */ class ApiClient { /** @@ -535,7 +535,7 @@ class ApiClient { // set header parameters request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); - //request.set({ 'purecloud-sdk': '3.0.0' }); + //request.set({ 'purecloud-sdk': '4.0.0' }); // set request timeout request.timeout(this.timeout); @@ -662,7 +662,7 @@ class WebChatApi { /** * WebChat service. * @module purecloud-guest-chat-client/api/WebChatApi - * @version 3.0.0 + * @version 4.0.0 */ /** @@ -1040,7 +1040,7 @@ class WebChatApi { * *

* @module purecloud-guest-chat-client/index - * @version 3.0.0 + * @version 4.0.0 */ class platformClient { constructor() { diff --git a/build/dist/web-amd/purecloud-guest-chat-client.js b/build/dist/web-amd/purecloud-guest-chat-client.js index ebdd5d6a..20c303ea 100644 --- a/build/dist/web-amd/purecloud-guest-chat-client.js +++ b/build/dist/web-amd/purecloud-guest-chat-client.js @@ -4,7 +4,7 @@ define(['superagent'], function (superagent) { 'use strict'; /** * @module purecloud-guest-chat-client/ApiClient - * @version 3.0.0 + * @version 4.0.0 */ class ApiClient { /** @@ -533,7 +533,7 @@ define(['superagent'], function (superagent) { 'use strict'; // set header parameters request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); - //request.set({ 'purecloud-sdk': '3.0.0' }); + //request.set({ 'purecloud-sdk': '4.0.0' }); // set request timeout request.timeout(this.timeout); @@ -660,7 +660,7 @@ define(['superagent'], function (superagent) { 'use strict'; /** * WebChat service. * @module purecloud-guest-chat-client/api/WebChatApi - * @version 3.0.0 + * @version 4.0.0 */ /** @@ -1038,7 +1038,7 @@ define(['superagent'], function (superagent) { 'use strict'; * *

* @module purecloud-guest-chat-client/index - * @version 3.0.0 + * @version 4.0.0 */ class platformClient { constructor() { diff --git a/build/dist/web-cjs/bundle.js b/build/dist/web-cjs/bundle.js index fd9a0ca7..506dfeac 100644 --- a/build/dist/web-cjs/bundle.js +++ b/build/dist/web-cjs/bundle.js @@ -1971,7 +1971,7 @@ function isSlowBuffer (obj) { /** * @module purecloud-guest-chat-client/ApiClient - * @version 3.0.0 + * @version 4.0.0 */ class ApiClient { /** @@ -2500,7 +2500,7 @@ class ApiClient { // set header parameters request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); - //request.set({ 'purecloud-sdk': '3.0.0' }); + //request.set({ 'purecloud-sdk': '4.0.0' }); // set request timeout request.timeout(this.timeout); @@ -2627,7 +2627,7 @@ class WebChatApi { /** * WebChat service. * @module purecloud-guest-chat-client/api/WebChatApi - * @version 3.0.0 + * @version 4.0.0 */ /** @@ -3005,7 +3005,7 @@ class WebChatApi { * *

* @module purecloud-guest-chat-client/index - * @version 3.0.0 + * @version 4.0.0 */ class platformClient { constructor() { diff --git a/build/dist/web-cjs/purecloud-guest-chat-client.js b/build/dist/web-cjs/purecloud-guest-chat-client.js index dba16371..6d84441f 100644 --- a/build/dist/web-cjs/purecloud-guest-chat-client.js +++ b/build/dist/web-cjs/purecloud-guest-chat-client.js @@ -1,6 +1,2026 @@ require=(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + var validLen = b64.indexOf('=') + if (validLen === -1) validLen = len + + var placeHoldersLen = validLen === len + ? 0 + : 4 - (validLen % 4) + + return [validLen, placeHoldersLen] +} + +// base64 is 4/3 + up to two characters of the original data +function byteLength (b64) { + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} + +function _byteLength (b64, validLen, placeHoldersLen) { + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} + +function toByteArray (b64) { + var tmp + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) + + var curByte = 0 + + // if there are placeholders, only get up to the last complete 4 chars + var len = placeHoldersLen > 0 + ? validLen - 4 + : validLen + + for (var i = 0; i < len; i += 4) { + tmp = + (revLookup[b64.charCodeAt(i)] << 18) | + (revLookup[b64.charCodeAt(i + 1)] << 12) | + (revLookup[b64.charCodeAt(i + 2)] << 6) | + revLookup[b64.charCodeAt(i + 3)] + arr[curByte++] = (tmp >> 16) & 0xFF + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } + + if (placeHoldersLen === 2) { + tmp = + (revLookup[b64.charCodeAt(i)] << 2) | + (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[curByte++] = tmp & 0xFF + } + + if (placeHoldersLen === 1) { + tmp = + (revLookup[b64.charCodeAt(i)] << 10) | + (revLookup[b64.charCodeAt(i + 1)] << 4) | + (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } + + return arr +} + +function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + + lookup[num >> 12 & 0x3F] + + lookup[num >> 6 & 0x3F] + + lookup[num & 0x3F] +} + +function encodeChunk (uint8, start, end) { + var tmp + var output = [] + for (var i = start; i < end; i += 3) { + tmp = + ((uint8[i] << 16) & 0xFF0000) + + ((uint8[i + 1] << 8) & 0xFF00) + + (uint8[i + 2] & 0xFF) + output.push(tripletToBase64(tmp)) + } + return output.join('') +} + +function fromByteArray (uint8) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk( + uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength) + )) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1] + parts.push( + lookup[tmp >> 2] + + lookup[(tmp << 4) & 0x3F] + + '==' + ) + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1] + parts.push( + lookup[tmp >> 10] + + lookup[(tmp >> 4) & 0x3F] + + lookup[(tmp << 2) & 0x3F] + + '=' + ) + } + + return parts.join('') +} + +},{}],3:[function(require,module,exports){ +(function (Buffer){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/* eslint-disable no-proto */ + +'use strict' + +var base64 = require('base64-js') +var ieee754 = require('ieee754') + +exports.Buffer = Buffer +exports.SlowBuffer = SlowBuffer +exports.INSPECT_MAX_BYTES = 50 + +var K_MAX_LENGTH = 0x7fffffff +exports.kMaxLength = K_MAX_LENGTH + +/** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Print warning and recommend using `buffer` v4.x which has an Object + * implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * We report that the browser does not support typed arrays if the are not subclassable + * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support + * for __proto__ and has a buggy typed array implementation. + */ +Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport() + +if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && + typeof console.error === 'function') { + console.error( + 'This browser lacks typed array (Uint8Array) support which is required by ' + + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.' + ) +} + +function typedArraySupport () { + // Can typed array instances can be augmented? + try { + var arr = new Uint8Array(1) + arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } } + return arr.foo() === 42 + } catch (e) { + return false + } +} + +Object.defineProperty(Buffer.prototype, 'parent', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined + return this.buffer + } +}) + +Object.defineProperty(Buffer.prototype, 'offset', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined + return this.byteOffset + } +}) + +function createBuffer (length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"') + } + // Return an augmented `Uint8Array` instance + var buf = new Uint8Array(length) + buf.__proto__ = Buffer.prototype + return buf +} + +/** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + +function Buffer (arg, encodingOrOffset, length) { + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new TypeError( + 'The "string" argument must be of type string. Received type number' + ) + } + return allocUnsafe(arg) + } + return from(arg, encodingOrOffset, length) +} + +// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 +if (typeof Symbol !== 'undefined' && Symbol.species != null && + Buffer[Symbol.species] === Buffer) { + Object.defineProperty(Buffer, Symbol.species, { + value: null, + configurable: true, + enumerable: false, + writable: false + }) +} + +Buffer.poolSize = 8192 // not used by this implementation + +function from (value, encodingOrOffset, length) { + if (typeof value === 'string') { + return fromString(value, encodingOrOffset) + } + + if (ArrayBuffer.isView(value)) { + return fromArrayLike(value) + } + + if (value == null) { + throw TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) + } + + if (isInstance(value, ArrayBuffer) || + (value && isInstance(value.buffer, ArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof value === 'number') { + throw new TypeError( + 'The "value" argument must not be of type number. Received type number' + ) + } + + var valueOf = value.valueOf && value.valueOf() + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length) + } + + var b = fromObject(value) + if (b) return b + + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && + typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from( + value[Symbol.toPrimitive]('string'), encodingOrOffset, length + ) + } + + throw new TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) +} + +/** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ +Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length) +} + +// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: +// https://github.com/feross/buffer/pull/148 +Buffer.prototype.__proto__ = Uint8Array.prototype +Buffer.__proto__ = Uint8Array + +function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be of type number') + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } +} + +function alloc (size, fill, encoding) { + assertSize(size) + if (size <= 0) { + return createBuffer(size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpretted as a start offset. + return typeof encoding === 'string' + ? createBuffer(size).fill(fill, encoding) + : createBuffer(size).fill(fill) + } + return createBuffer(size) +} + +/** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ +Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding) +} + +function allocUnsafe (size) { + assertSize(size) + return createBuffer(size < 0 ? 0 : checked(size) | 0) +} + +/** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ +Buffer.allocUnsafe = function (size) { + return allocUnsafe(size) +} +/** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ +Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size) +} + +function fromString (string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + + var length = byteLength(string, encoding) | 0 + var buf = createBuffer(length) + + var actual = buf.write(string, encoding) + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual) + } + + return buf +} + +function fromArrayLike (array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0 + var buf = createBuffer(length) + for (var i = 0; i < length; i += 1) { + buf[i] = array[i] & 255 + } + return buf +} + +function fromArrayBuffer (array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds') + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds') + } + + var buf + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array) + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset) + } else { + buf = new Uint8Array(array, byteOffset, length) + } + + // Return an augmented `Uint8Array` instance + buf.__proto__ = Buffer.prototype + return buf +} + +function fromObject (obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0 + var buf = createBuffer(len) + + if (buf.length === 0) { + return buf + } + + obj.copy(buf, 0, 0, len) + return buf + } + + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0) + } + return fromArrayLike(obj) + } + + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data) + } +} + +function checked (length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') + } + return length | 0 +} + +function SlowBuffer (length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0 + } + return Buffer.alloc(+length) +} + +Buffer.isBuffer = function isBuffer (b) { + return b != null && b._isBuffer === true && + b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false +} + +Buffer.compare = function compare (a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength) + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength) + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError( + 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' + ) + } + + if (a === b) return 0 + + var x = a.length + var y = b.length + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i] + y = b[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } +} + +Buffer.concat = function concat (list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + + if (list.length === 0) { + return Buffer.alloc(0) + } + + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; ++i) { + length += list[i].length + } + } + + var buffer = Buffer.allocUnsafe(length) + var pos = 0 + for (i = 0; i < list.length; ++i) { + var buf = list[i] + if (isInstance(buf, Uint8Array)) { + buf = Buffer.from(buf) + } + if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + buf.copy(buffer, pos) + pos += buf.length + } + return buffer +} + +function byteLength (string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + throw new TypeError( + 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + + 'Received type ' + typeof string + ) + } + + var len = string.length + var mustMatch = (arguments.length > 2 && arguments[2] === true) + if (!mustMatch && len === 0) return 0 + + // Use a for loop to avoid recursion + var loweredCase = false + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 + } + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} +Buffer.byteLength = byteLength + +function slowToString (encoding, start, end) { + var loweredCase = false + + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0 + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } + + if (end === undefined || end > this.length) { + end = this.length + } + + if (end <= 0) { + return '' + } + + // Force coersion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0 + start >>>= 0 + + if (end <= start) { + return '' + } + + if (!encoding) encoding = 'utf8' + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) + + case 'ascii': + return asciiSlice(this, start, end) + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase() + loweredCase = true + } + } +} + +// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) +// to detect a Buffer instance. It's not possible to use `instanceof Buffer` +// reliably in a browserify context because there could be multiple different +// copies of the 'buffer' package in use. This method works even for Buffer +// instances that were created from another copy of the `buffer` package. +// See: https://github.com/feross/buffer/issues/154 +Buffer.prototype._isBuffer = true + +function swap (b, n, m) { + var i = b[n] + b[n] = b[m] + b[m] = i +} + +Buffer.prototype.swap16 = function swap16 () { + var len = this.length + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') + } + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1) + } + return this +} + +Buffer.prototype.swap32 = function swap32 () { + var len = this.length + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3) + swap(this, i + 1, i + 2) + } + return this +} + +Buffer.prototype.swap64 = function swap64 () { + var len = this.length + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7) + swap(this, i + 1, i + 6) + swap(this, i + 2, i + 5) + swap(this, i + 3, i + 4) + } + return this +} + +Buffer.prototype.toString = function toString () { + var length = this.length + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) +} + +Buffer.prototype.toLocaleString = Buffer.prototype.toString + +Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 +} + +Buffer.prototype.inspect = function inspect () { + var str = '' + var max = exports.INSPECT_MAX_BYTES + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim() + if (this.length > max) str += ' ... ' + return '' +} + +Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength) + } + if (!Buffer.isBuffer(target)) { + throw new TypeError( + 'The "target" argument must be one of type Buffer or Uint8Array. ' + + 'Received type ' + (typeof target) + ) + } + + if (start === undefined) { + start = 0 + } + if (end === undefined) { + end = target ? target.length : 0 + } + if (thisStart === undefined) { + thisStart = 0 + } + if (thisEnd === undefined) { + thisEnd = this.length + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } + + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 + } + + start >>>= 0 + end >>>= 0 + thisStart >>>= 0 + thisEnd >>>= 0 + + if (this === target) return 0 + + var x = thisEnd - thisStart + var y = end - start + var len = Math.min(x, y) + + var thisCopy = this.slice(thisStart, thisEnd) + var targetCopy = target.slice(start, end) + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i] + y = targetCopy[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, +// OR the last index of `val` in `buffer` at offset <= `byteOffset`. +// +// Arguments: +// - buffer - a Buffer to search +// - val - a string, Buffer, or number +// - byteOffset - an index into `buffer`; will be clamped to an int32 +// - encoding - an optional encoding, relevant is val is a string +// - dir - true for indexOf, false for lastIndexOf +function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1 + + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset + byteOffset = 0 + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000 + } + byteOffset = +byteOffset // Coerce to Number. + if (numberIsNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : (buffer.length - 1) + } + + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset + if (byteOffset >= buffer.length) { + if (dir) return -1 + else byteOffset = buffer.length - 1 + } else if (byteOffset < 0) { + if (dir) byteOffset = 0 + else return -1 + } + + // Normalize val + if (typeof val === 'string') { + val = Buffer.from(val, encoding) + } + + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir) + } else if (typeof val === 'number') { + val = val & 0xFF // Search for a byte value [0-255] + if (typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) + } + } + return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) + } + + throw new TypeError('val must be string, number or Buffer') +} + +function arrayIndexOf (arr, val, byteOffset, encoding, dir) { + var indexSize = 1 + var arrLength = arr.length + var valLength = val.length + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase() + if (encoding === 'ucs2' || encoding === 'ucs-2' || + encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1 + } + indexSize = 2 + arrLength /= 2 + valLength /= 2 + byteOffset /= 2 + } + } + + function read (buf, i) { + if (indexSize === 1) { + return buf[i] + } else { + return buf.readUInt16BE(i * indexSize) + } + } + + var i + if (dir) { + var foundIndex = -1 + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize + } else { + if (foundIndex !== -1) i -= i - foundIndex + foundIndex = -1 + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength + for (i = byteOffset; i >= 0; i--) { + var found = true + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false + break + } + } + if (found) return i + } + } + + return -1 +} + +Buffer.prototype.includes = function includes (val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 +} + +Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true) +} + +Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) +} + +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + + var strLen = string.length + + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16) + if (numberIsNaN(parsed)) return i + buf[offset + i] = parsed + } + return i +} + +function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) +} + +function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) +} + +function latin1Write (buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) +} + +function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) +} + +function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) +} + +Buffer.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8' + length = this.length + offset = 0 + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset + length = this.length + offset = 0 + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset >>> 0 + if (isFinite(length)) { + length = length >>> 0 + if (encoding === undefined) encoding = 'utf8' + } else { + encoding = length + length = undefined + } + } else { + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) + } + + var remaining = this.length - offset + if (length === undefined || length > remaining) length = remaining + + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') + } + + if (!encoding) encoding = 'utf8' + + var loweredCase = false + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) + + case 'ascii': + return asciiWrite(this, string, offset, length) + + case 'latin1': + case 'binary': + return latin1Write(this, string, offset, length) + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} + +Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } +} + +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } +} + +function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end) + var res = [] + + var i = start + while (i < end) { + var firstByte = buf[i] + var codePoint = null + var bytesPerSequence = (firstByte > 0xEF) ? 4 + : (firstByte > 0xDF) ? 3 + : (firstByte > 0xBF) ? 2 + : 1 + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte + } + break + case 2: + secondByte = buf[i + 1] + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint + } + } + break + case 3: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint + } + } + break + case 4: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + fourthByte = buf[i + 3] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint + } + } + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD + bytesPerSequence = 1 + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000 + res.push(codePoint >>> 10 & 0x3FF | 0xD800) + codePoint = 0xDC00 | codePoint & 0x3FF + } + + res.push(codePoint) + i += bytesPerSequence + } + + return decodeCodePointsArray(res) +} + +// Based on http://stackoverflow.com/a/22747272/680742, the browser with +// the lowest limit is Chrome, with 0x10000 args. +// We go 1 magnitude less, for safety +var MAX_ARGUMENTS_LENGTH = 0x1000 + +function decodeCodePointsArray (codePoints) { + var len = codePoints.length + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } + + // Decode in chunks to avoid "call stack size exceeded". + var res = '' + var i = 0 + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ) + } + return res +} + +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F) + } + return ret +} + +function latin1Slice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]) + } + return ret +} + +function hexSlice (buf, start, end) { + var len = buf.length + + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len + + var out = '' + for (var i = start; i < end; ++i) { + out += toHex(buf[i]) + } + return out +} + +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256)) + } + return res +} + +Buffer.prototype.slice = function slice (start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end + + if (start < 0) { + start += len + if (start < 0) start = 0 + } else if (start > len) { + start = len + } + + if (end < 0) { + end += len + if (end < 0) end = 0 + } else if (end > len) { + end = len + } + + if (end < start) end = start + + var newBuf = this.subarray(start, end) + // Return an augmented `Uint8Array` instance + newBuf.__proto__ = Buffer.prototype + return newBuf +} + +/* + * Need to make sure that buffer isn't trying to write out of bounds. + */ +function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') +} + +Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + + return val +} + +Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) { + checkOffset(offset, byteLength, this.length) + } + + var val = this[offset + --byteLength] + var mul = 1 + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul + } + + return val +} + +Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 1, this.length) + return this[offset] +} + +Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + return this[offset] | (this[offset + 1] << 8) +} + +Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] +} + +Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) +} + +Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +} + +Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var i = byteLength + var mul = 1 + var val = this[offset + --i] + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 1, this.length) + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) +} + +Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset] | (this[offset + 1] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset + 1] | (this[offset] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) +} + +Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) +} + +Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) +} + +Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) +} + +Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) +} + +Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, false, 52, 8) +} + +function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') + if (offset + ext > buf.length) throw new RangeError('Index out of range') +} + +Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var mul = 1 + var i = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var i = byteLength - 1 + var mul = 1 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) + this[offset] = (value & 0xff) + return offset + 1 +} + +Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + return offset + 2 +} + +Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + return offset + 2 +} + +Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + this[offset + 3] = (value >>> 24) + this[offset + 2] = (value >>> 16) + this[offset + 1] = (value >>> 8) + this[offset] = (value & 0xff) + return offset + 4 +} + +Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + return offset + 4 +} + +Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + var limit = Math.pow(2, (8 * byteLength) - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = 0 + var mul = 1 + var sub = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + var limit = Math.pow(2, (8 * byteLength) - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = byteLength - 1 + var mul = 1 + var sub = 0 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) + if (value < 0) value = 0xff + value + 1 + this[offset] = (value & 0xff) + return offset + 1 +} + +Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + return offset + 2 +} + +Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + return offset + 2 +} + +Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + this[offset + 2] = (value >>> 16) + this[offset + 3] = (value >>> 24) + return offset + 4 +} + +Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (value < 0) value = 0xffffffff + value + 1 + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + return offset + 4 +} + +function checkIEEE754 (buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range') + if (offset < 0) throw new RangeError('Index out of range') +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) + } + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} + +Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} + +function writeDouble (buf, value, offset, littleEndian, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 +} + +Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +} + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (targetStart >= target.length) targetStart = target.length + if (!targetStart) targetStart = 0 + if (end > 0 && end < start) end = start + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('Index out of range') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start + } + + var len = end - start + + if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { + // Use built-in when available, missing from IE11 + this.copyWithin(targetStart, start, end) + } else if (this === target && start < targetStart && targetStart < end) { + // descending copy from end + for (var i = len - 1; i >= 0; --i) { + target[i + targetStart] = this[i + start] + } + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, end), + targetStart + ) + } + + return len +} + +// Usage: +// buffer.fill(number[, offset[, end]]) +// buffer.fill(buffer[, offset[, end]]) +// buffer.fill(string[, offset[, end]][, encoding]) +Buffer.prototype.fill = function fill (val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start + start = 0 + end = this.length + } else if (typeof end === 'string') { + encoding = end + end = this.length + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + if (val.length === 1) { + var code = val.charCodeAt(0) + if ((encoding === 'utf8' && code < 128) || + encoding === 'latin1') { + // Fast path: If `val` fits into a single byte, use that numeric value. + val = code + } + } + } else if (typeof val === 'number') { + val = val & 255 + } + + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') + } + + if (end <= start) { + return this + } + + start = start >>> 0 + end = end === undefined ? this.length : end >>> 0 + + if (!val) val = 0 + + var i + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val + } + } else { + var bytes = Buffer.isBuffer(val) + ? val + : Buffer.from(val, encoding) + var len = bytes.length + if (len === 0) { + throw new TypeError('The value "' + val + + '" is invalid for argument "value"') + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len] + } + } + + return this +} + +// HELPER FUNCTIONS +// ================ + +var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g + +function base64clean (str) { + // Node takes equal signs as end of the Base64 encoding + str = str.split('=')[0] + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = str.trim().replace(INVALID_BASE64_RE, '') + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' + } + return str +} + +function toHex (n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) +} + +function utf8ToBytes (string, units) { + units = units || Infinity + var codePoint + var length = string.length + var leadSurrogate = null + var bytes = [] + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i) + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } + + // valid lead + leadSurrogate = codePoint + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + leadSurrogate = codePoint + continue + } + + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + } + + leadSurrogate = null + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint) + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else { + throw new Error('Invalid code point') + } + } + + return bytes +} + +function asciiToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) + } + return byteArray +} + +function utf16leToBytes (str, units) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break + + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } + + return byteArray +} + +function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) +} + +function blitBuffer (src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i] + } + return i +} + +// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass +// the `instanceof` check but they should be treated as of that type. +// See: https://github.com/feross/buffer/issues/166 +function isInstance (obj, type) { + return obj instanceof type || + (obj != null && obj.constructor != null && obj.constructor.name != null && + obj.constructor.name === type.name) +} +function numberIsNaN (obj) { + // For IE11 support + return obj !== obj // eslint-disable-line no-self-compare +} + +}).call(this,require("buffer").Buffer) +},{"base64-js":2,"buffer":3,"ieee754":4}],4:[function(require,module,exports){ +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen) + e = e - eBias + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} + +exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 + + value = Math.abs(value) + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = ((value * c) - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128 +} + +},{}],5:[function(require,module,exports){ /** * Expose `Emitter`. @@ -165,7 +2185,7 @@ Emitter.prototype.hasListeners = function(event){ return !! this.listeners(event).length; }; -},{}],3:[function(require,module,exports){ +},{}],6:[function(require,module,exports){ function Agent() { this._defaults = []; } @@ -187,7 +2207,7 @@ Agent.prototype._setDefaults = function(req) { module.exports = Agent; -},{}],4:[function(require,module,exports){ +},{}],7:[function(require,module,exports){ /** * Root reference for iframes. */ @@ -1109,7 +3129,7 @@ request.put = function(url, data, fn) { return req; }; -},{"./agent-base":3,"./is-object":5,"./request-base":6,"./response-base":7,"component-emitter":2}],5:[function(require,module,exports){ +},{"./agent-base":6,"./is-object":8,"./request-base":9,"./response-base":10,"component-emitter":5}],8:[function(require,module,exports){ 'use strict'; /** @@ -1126,7 +3146,7 @@ function isObject(obj) { module.exports = isObject; -},{}],6:[function(require,module,exports){ +},{}],9:[function(require,module,exports){ 'use strict'; /** @@ -1822,7 +3842,7 @@ RequestBase.prototype._setTimeouts = function() { } }; -},{"./is-object":5}],7:[function(require,module,exports){ +},{"./is-object":8}],10:[function(require,module,exports){ 'use strict'; /** @@ -1960,7 +3980,7 @@ ResponseBase.prototype._setStatusProperties = function(status){ this.unprocessableEntity = 422 == status; }; -},{"./utils":8}],8:[function(require,module,exports){ +},{"./utils":11}],11:[function(require,module,exports){ 'use strict'; /** @@ -2034,7 +4054,7 @@ exports.cleanHeader = function(header, changesOrigin){ }; },{}],"platformClient":[function(require,module,exports){ -(function (global){ +(function (global,Buffer){ 'use strict'; function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } @@ -4008,7 +6028,7 @@ function isSlowBuffer (obj) { /** * @module purecloud-guest-chat-client/ApiClient - * @version 3.0.0 + * @version 4.0.0 */ class ApiClient { /** @@ -4537,7 +6557,7 @@ class ApiClient { // set header parameters request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); - //request.set({ 'purecloud-sdk': '3.0.0' }); + //request.set({ 'purecloud-sdk': '4.0.0' }); // set request timeout request.timeout(this.timeout); @@ -4664,7 +6684,7 @@ class WebChatApi { /** * WebChat service. * @module purecloud-guest-chat-client/api/WebChatApi - * @version 3.0.0 + * @version 4.0.0 */ /** @@ -5042,7 +7062,7 @@ class WebChatApi { * *

* @module purecloud-guest-chat-client/index - * @version 3.0.0 + * @version 4.0.0 */ class platformClient { constructor() { @@ -5064,5 +7084,5 @@ var index = new platformClient(); module.exports = index; -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"fs":1,"superagent":4}]},{},[]); +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) +},{"buffer":3,"fs":1,"superagent":7}]},{},[]); diff --git a/build/dist/web-cjs/purecloud-guest-chat-client.min.js b/build/dist/web-cjs/purecloud-guest-chat-client.min.js index 2dd4e086..66ddc5d6 100644 --- a/build/dist/web-cjs/purecloud-guest-chat-client.min.js +++ b/build/dist/web-cjs/purecloud-guest-chat-client.min.js @@ -1 +1 @@ -require=function(){return function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var c=r[s]={exports:{}};e[s][0].call(c.exports,function(t){return i(e[s][1][t]||t)},c,c.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4==r){var n;try{n=e.status}catch(t){n=0}if(!n){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var n=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.onprogress=n.bind(null,"download"),e.upload&&(e.upload.onprogress=n.bind(null,"upload"))}catch(t){}try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof r&&!this._isHost(r)){var i=this._header["content-type"],o=this._serializer||c.serialize[i?i.split(";")[0]:""];!o&&g(i)&&(o=c.serialize["application/json"]),o&&(r=o(r))}for(var s in this.header)null!=this.header[s]&&this.header.hasOwnProperty(s)&&e.setRequestHeader(s,this.header[s]);return this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0!==r?r:null),this},c.agent=function(){return new u},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(t){u.prototype[t.toLowerCase()]=function(e,r){var n=new c.Request(t,e);return this._setDefaults(n),r&&n.end(r),n}}),u.prototype.del=u.prototype.delete,c.get=function(t,e,r){var n=c("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},c.head=function(t,e,r){var n=c("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},c.options=function(t,e,r){var n=c("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},c.del=v,c.delete=v,c.patch=function(t,e,r){var n=c("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},c.post=function(t,e,r){var n=c("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},c.put=function(t,e,r){var n=c("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}},{"./agent-base":3,"./is-object":5,"./request-base":6,"./response-base":7,"component-emitter":2}],5:[function(t,e,r){"use strict";e.exports=function(t){return null!==t&&"object"==typeof t}},{}],6:[function(t,e,r){"use strict";var n=t("./is-object");function i(t){if(t)return function(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}(t)}e.exports=i,i.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,this},i.prototype.parse=function(t){return this._parser=t,this},i.prototype.responseType=function(t){return this._responseType=t,this},i.prototype.serialize=function(t){return this._serializer=t,this},i.prototype.timeout=function(t){if(!t||"object"!=typeof t)return this._timeout=t,this._responseTimeout=0,this;for(var e in t)switch(e){case"deadline":this._timeout=t.deadline;break;case"response":this._responseTimeout=t.response;break;default:console.warn("Unknown timeout option",e)}return this},i.prototype.retry=function(t,e){return 0!==arguments.length&&!0!==t||(t=1),t<=0&&(t=0),this._maxRetries=t,this._retries=0,this._retryCallback=e,this};var o=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];i.prototype._shouldRetry=function(t,e){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(t){console.error(t)}if(e&&e.status&&e.status>=500&&501!=e.status)return!0;if(t){if(t.code&&~o.indexOf(t.code))return!0;if(t.timeout&&"ECONNABORTED"==t.code)return!0;if(t.crossDomain)return!0}return!1},i.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},i.prototype.then=function(t,e){if(!this._fullfilledPromise){var r=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(t,e){r.end(function(r,n){r?e(r):t(n)})})}return this._fullfilledPromise.then(t,e)},i.prototype.catch=function(t){return this.then(void 0,t)},i.prototype.use=function(t){return t(this),this},i.prototype.ok=function(t){if("function"!=typeof t)throw Error("Callback required");return this._okCallback=t,this},i.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},i.prototype.get=function(t){return this._header[t.toLowerCase()]},i.prototype.getHeader=i.prototype.get,i.prototype.set=function(t,e){if(n(t)){for(var r in t)this.set(r,t[r]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},i.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},i.prototype.field=function(t,e){if(null===t||void 0===t)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),n(t)){for(var r in t)this.field(r,t[r]);return this}if(Array.isArray(e)){for(var i in e)this.field(t,e[i]);return this}if(null===e||void 0===e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=""+e),this._getFormData().append(t,e),this},i.prototype.abort=function(){return this._aborted?this:(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort"),this)},i.prototype._auth=function(t,e,r,n){switch(r.type){case"basic":this.set("Authorization","Basic "+n(t+":"+e));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer "+t)}return this},i.prototype.withCredentials=function(t){return void 0==t&&(t=!0),this._withCredentials=t,this},i.prototype.redirects=function(t){return this._maxRedirects=t,this},i.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw TypeError("Invalid argument");return this._maxResponseSize=t,this},i.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},i.prototype.send=function(t){var e=n(t),r=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(e&&n(this._data))for(var i in t)this._data[i]=t[i];else"string"==typeof t?(r||this.type("form"),r=this._header["content-type"],this._data="application/x-www-form-urlencoded"==r?this._data?this._data+"&"+t:t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)?this:(r||this.type("json"),this)},i.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},i.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var r=this.url.substring(e+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.substring(0,e)+"?"+r.join("&")}}},i.prototype._appendQueryString=function(){console.trace("Unsupported")},i.prototype._timeoutError=function(t,e,r){if(!this._aborted){var n=new Error(t+e+"ms exceeded");n.timeout=e,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.abort(),this.callback(n)}},i.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")},this._responseTimeout))}},{"./is-object":5}],7:[function(t,e,r){"use strict";var n=t("./utils");function i(t){if(t)return function(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}(t)}e.exports=i,i.prototype.get=function(t){return this.header[t.toLowerCase()]},i.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=n.type(e);var r=n.params(e);for(var i in r)this[i]=r[i];this.links={};try{t.link&&(this.links=n.parseLinks(t.link))}catch(t){}},i.prototype._setStatusProperties=function(t){var e=t/100|0;this.status=this.statusCode=t,this.statusType=e,this.info=1==e,this.ok=2==e,this.redirect=3==e,this.clientError=4==e,this.serverError=5==e,this.error=(4==e||5==e)&&this.toError(),this.created=201==t,this.accepted=202==t,this.noContent=204==t,this.badRequest=400==t,this.unauthorized=401==t,this.notAcceptable=406==t,this.forbidden=403==t,this.notFound=404==t,this.unprocessableEntity=422==t}},{"./utils":8}],8:[function(t,e,r){"use strict";r.type=function(t){return t.split(/ *; */).shift()},r.params=function(t){return t.split(/ *; */).reduce(function(t,e){var r=e.split(/ *= */),n=r.shift(),i=r.shift();return n&&i&&(t[n]=i),t},{})},r.parseLinks=function(t){return t.split(/ *, */).reduce(function(t,e){var r=e.split(/ *; */),n=r[0].slice(1,-1);return t[r[1].split(/ *= */)[1].slice(1,-1)]=n,t},{})},r.cleanHeader=function(t,e){return delete t["content-type"],delete t["content-length"],delete t["transfer-encoding"],delete t.host,e&&(delete t.authorization,delete t.cookie),t}},{}],platformClient:[function(t,e,r){(function(r){"use strict";var n,i=(n=t("superagent"))&&"object"==typeof n&&"default"in n?n.default:n,o=void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},s=[],a=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,h=!1;function c(){h=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e>18&63]+s[i>>12&63]+s[i>>6&63]+s[63&i]);return o.join("")}function p(t){var e;h||c();for(var r=t.length,n=r%3,i="",o=[],a=0,u=r-n;au?u:a+16383));return 1===n?(e=t[r-1],i+=s[e>>2],i+=s[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=s[e>>10],i+=s[e>>4&63],i+=s[e<<2&63],i+="="),o.push(i),o.join("")}function f(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,c=-7,l=r?i-1:0,p=r?-1:1,f=t[e+l];for(l+=p,o=f&(1<<-c)-1,f>>=-c,c+=a;c>0;o=256*o+t[e+l],l+=p,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+t[e+l],l+=p,c-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=h}return(f?-1:1)*s*Math.pow(2,o-n)}function d(t,e,r,n,i,o){var s,a,u,h=8*o-i-1,c=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?p/u:p*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=c?(a=0,s=c):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+f]=255&a,f+=d,a/=256,i-=8);for(s=s<0;t[r+f]=255&s,f+=d,s/=256,h-=8);t[r+f-d]|=128*g}var g={}.toString,y=Array.isArray||function(t){return"[object Array]"==g.call(t)};function m(){return w.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function v(t,e){if(m()=m())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m().toString(16)+" bytes");return 0|t}function C(t){return!(null==t||!t._isBuffer)}function R(t,e){if(C(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Z(t).length;default:if(n)return V(t).length;e=(""+e).toLowerCase(),n=!0}}function P(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function x(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=w.from(e,n)),C(e))return 0===e.length?-1:S(t,e,r,n,i);if("number"==typeof e)return e&=255,w.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):S(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function S(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var c=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var l=!0,p=0;pi&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function D(t,e,r){return 0===e&&r===t.length?p(t):p(t.slice(e,r))}function j(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:h>223?3:h>191?2:1;if(i+l<=r)switch(l){case 1:h<128&&(c=h);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&h)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&h)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,l=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=l}return function(t){var e=t.length;if(e<=L)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return W(this,e,r);case"utf8":case"utf-8":return j(this,e,r);case"ascii":return B(this,e,r);case"latin1":case"binary":return G(this,e,r);case"base64":return D(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},w.prototype.equals=function(t){if(!C(t))throw new TypeError("Argument must be a Buffer");return this===t||0===w.compare(this,t)},w.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),""},w.prototype.compare=function(t,e,r,n,i){if(!C(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,a=Math.min(o,s),u=this.slice(n,i),h=t.slice(e,r),c=0;ci)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return I(this,t,e,r);case"utf8":case"utf-8":return M(this,t,e,r);case"ascii":return O(this,t,e,r);case"latin1":case"binary":return q(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},w.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var L=4096;function B(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function $(t,e,r,n,i,o){if(!C(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function z(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function J(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function H(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function K(t,e,r,n,i){return i||H(t,0,r,4),d(t,e,r,n,23,4),r+4}function F(t,e,r,n,i){return i||H(t,0,r,8),d(t,e,r,n,52,8),r+8}w.prototype.slice=function(t,e){var r,n=this.length;if(t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},w.prototype.readUInt8=function(t,e){return e||N(t,1,this.length),this[t]},w.prototype.readUInt16LE=function(t,e){return e||N(t,2,this.length),this[t]|this[t+1]<<8},w.prototype.readUInt16BE=function(t,e){return e||N(t,2,this.length),this[t]<<8|this[t+1]},w.prototype.readUInt32LE=function(t,e){return e||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},w.prototype.readUInt32BE=function(t,e){return e||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},w.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||N(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},w.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||N(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},w.prototype.readInt8=function(t,e){return e||N(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},w.prototype.readInt16LE=function(t,e){e||N(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},w.prototype.readInt16BE=function(t,e){e||N(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},w.prototype.readInt32LE=function(t,e){return e||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},w.prototype.readInt32BE=function(t,e){return e||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},w.prototype.readFloatLE=function(t,e){return e||N(t,4,this.length),f(this,t,!0,23,4)},w.prototype.readFloatBE=function(t,e){return e||N(t,4,this.length),f(this,t,!1,23,4)},w.prototype.readDoubleLE=function(t,e){return e||N(t,8,this.length),f(this,t,!0,52,8)},w.prototype.readDoubleBE=function(t,e){return e||N(t,8,this.length),f(this,t,!1,52,8)},w.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||$(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},w.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||$(this,t,e,1,255,0),w.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},w.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||$(this,t,e,2,65535,0),w.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},w.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||$(this,t,e,2,65535,0),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},w.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||$(this,t,e,4,4294967295,0),w.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):J(this,t,e,!0),e+4},w.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||$(this,t,e,4,4294967295,0),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):J(this,t,e,!1),e+4},w.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);$(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},w.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);$(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},w.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||$(this,t,e,1,127,-128),w.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},w.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||$(this,t,e,2,32767,-32768),w.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):z(this,t,e,!0),e+2},w.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||$(this,t,e,2,32767,-32768),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):z(this,t,e,!1),e+2},w.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||$(this,t,e,4,2147483647,-2147483648),w.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):J(this,t,e,!0),e+4},w.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||$(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):J(this,t,e,!1),e+4},w.prototype.writeFloatLE=function(t,e,r){return K(this,t,e,!0,r)},w.prototype.writeFloatBE=function(t,e,r){return K(this,t,e,!1,r)},w.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},w.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},w.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!w.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Z(t){return function(t){var e,r,n,i,o,s;h||c();var l=t.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[l-2]?2:"="===t[l-1]?1:0,s=new u(3*l/4-o),n=o>0?l-4:l;var p=0;for(e=0,r=0;e>16&255,s[p++]=i>>8&255,s[p++]=255&i;return 2===o?(i=a[t.charCodeAt(e)]<<2|a[t.charCodeAt(e+1)]>>4,s[p++]=255&i):1===o&&(i=a[t.charCodeAt(e)]<<10|a[t.charCodeAt(e+1)]<<4|a[t.charCodeAt(e+2)]>>2,s[p++]=i>>8&255,s[p++]=255&i),s}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(X,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function tt(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function et(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}class rt{get instance(){return rt.instance}set instance(t){rt.instance=t}constructor(){rt.instance||(rt.instance=this),this.CollectionFormatEnum={CSV:",",SSV:" ",TSV:"\t",PIPES:"|",MULTI:"multi"};try{localStorage.setItem("purecloud_local_storage_test","purecloud_local_storage_test"),localStorage.removeItem("purecloud_local_storage_test"),this.hasLocalStorage=!0}catch(t){this.hasLocalStorage=!1}this.setEnvironment("https://api.mypurecloud.com"),this.authentications={"PureCloud OAuth":{type:"oauth2"},"Guest Chat JWT":{type:"apiKey",in:"header",name:"Authorization",apiKeyPrefix:"Bearer"}},this.defaultHeaders={},this.timeout=16e3,this.authData={},this.settingsPrefix="purecloud",this.superagent=i,"undefined"!=typeof window&&(window.ApiClient=this)}setDebugLog(t,e){this.debugLog=t,this.debugLogMaxLines=e&&e>0?e:void 0}setReturnExtendedResponses(t){this.returnExtended=t}setPersistSettings(t,e){this.persistSettings=t,this.settingsPrefix=e?e.replace(/\W+/g,"_"):"purecloud",this._debugTrace(`this.settingsPrefix=${this.settingsPrefix}`)}_saveSettings(t){try{if(t.apiKey&&(this.authData.apiKey=t.apiKey,this.authentications["Guest Chat JWT"].apiKey=t.apiKey),t.state&&(this.authData.state=t.state),t.tokenExpiryTime&&(this.authData.tokenExpiryTime=t.tokenExpiryTime,this.authData.tokenExpiryTimeString=t.tokenExpiryTimeString),!0!==this.persistSettings)return;if(!this.hasLocalStorage)return void this._debugTrace("Warning: Cannot access local storage. Settings will not be saved.");let e=JSON.parse(JSON.stringify(this.authData));delete e.state,localStorage.setItem(`${this.settingsPrefix}_auth_data`,JSON.stringify(e)),this._debugTrace("Auth data saved to local storage")}catch(t){console.error(t)}}_loadSettings(){if(!0!==this.persistSettings)return;if(!this.hasLocalStorage)return void this._debugTrace("Warning: Cannot access local storage. Settings will not be loaded.");const t=this.authData.state;this.authData=localStorage.getItem(`${this.settingsPrefix}_auth_data`),this.authData?this.authData=JSON.parse(this.authData):this.authData={},this.authData.apiKey&&this.setJwt(this.authData.apiKey),this.authData.state=t}setEnvironment(t){t||(t="mypurecloud.com"),(t=t.replace(/\/+$/,"")).startsWith("https://")&&(t=t.substring(8)),t.startsWith("http://")&&(t=t.substring(7)),t.startsWith("api.")&&(t=t.substring(4)),this.environment=t,this.basePath=`https://api.${t}`,this.authUrl=`https://login.${t}`}_testTokenAccess(){return new Promise((t,e)=>{this._loadSettings(),this.authentications["Guest Chat JWT"].apiKey?this.callApi("/api/v2/authorization/permissions","GET",null,null,null,null,null,["Guest Chat JWT"],["application/json"],["application/json"]).then(()=>{t()}).catch(t=>{this._saveSettings({apiKey:void 0}),e(t)}):e(new Error("Token is not set"))})}setJwt(t){this._saveSettings({apiKey:t})}setStorageKey(t){this.storageKey=t,this.setJwt(this.authentications["Guest Chat JWT"].apiKey)}_buildAuthUrl(t,e){return e||(e={}),Object.keys(e).reduce((t,r)=>e[r]?`${t}&${r}=${e[r]}`:t,`${this.authUrl}/${t}?`)}paramToString(t){return t?t instanceof Date?t.toJSON():t.toString():""}buildUrl(t,e){t.match(/^\//)||(t=`/${t}`);var r=this.basePath+t;return r=r.replace(/\{([\w-]+)\}/g,(t,r)=>{var n;return n=e.hasOwnProperty(r)?this.paramToString(e[r]):t,encodeURIComponent(n)})}isJsonMime(t){return Boolean(t&&t.match(/^application\/json(;.*)?$/i))}jsonPreferredMime(t){for(var e=0;e{var r=this.authentications[e];switch(r.type){case"basic":(r.username||r.password)&&t.auth(r.username||"",r.password||"");break;case"apiKey":if(r.apiKey){var n={};r.apiKeyPrefix?n[r.name]=`${r.apiKeyPrefix} ${r.apiKey}`:n[r.name]=r.apiKey,"header"===r.in?t.set(n):t.query(n)}break;case"oauth2":r.accessToken&&t.set({Authorization:`Bearer ${r.accessToken}`});break;default:throw new Error(`Unknown authentication type: ${r.type}`)}})}callApi(t,e,r,n,o,s,a,u,h,c){var l=this.buildUrl(t,r),p=i(e,l);if(this.proxy&&p.proxy&&p.proxy(this.proxy),this.debugLog){var f=`[REQUEST] ${e} ${l}`;r&&Object.keys(r).count>0&&r[Object.keys(r)[0]]&&(f+=`\nPath Params: ${JSON.stringify(r)}`),n&&Object.keys(n).count>0&&n[Object.keys(n)[0]]&&(f+=`\nQuery Params: ${JSON.stringify(n)}`),a&&(f+=`\nnBody: ${JSON.stringify(a)}`),this._debugTrace(f)}this.applyAuthToRequest(p,u),p.query(this.normalizeParams(n)),p.set(this.defaultHeaders).set(this.normalizeParams(o)),p.timeout(this.timeout);var d=this.jsonPreferredMime(h);if(d?p.type(d):p.header["Content-Type"]||p.type("application/json"),"application/x-www-form-urlencoded"===d)p.send(this.normalizeParams(s));else if("multipart/form-data"==d){var g=this.normalizeParams(s);for(var y in g)g.hasOwnProperty(y)&&(this.isFileParam(g[y])?p.attach(y,g[y]):p.field(y,g[y]))}else a&&p.send(a);var m=this.jsonPreferredMime(c);return m&&p.accept(m),new Promise((t,r)=>{p.end((n,i)=>{if(n&&(console.log(n),!i))return console.log("Response object was not defined!"),void r({status:0,statusText:"error",headers:[],body:{},text:"error",error:n});var o=!0===this.returnExtended||n?{status:i.status,statusText:i.statusText,headers:i.headers,body:i.body,text:i.text,error:n}:i.body?i.body:i.text;if(this.debugLog){var s=`[RESPONSE] ${i.status}: ${e} ${l}`;i.headers&&(s+=`\ninin-correlation-id: ${i.headers["inin-correlation-id"]}`),i.body&&(s+=`\nBody: ${JSON.stringify(i.body,null,2)}`),this._debugTrace(s),n&&this._debugTrace(n)}n?r(o):t(o)})})}parseDate(t){return new Date(t.replace(/T/i," "))}_debugTrace(t){if(this.debugLog){if("string"==typeof t){var e="",r=t.split("\n");if(this.debugLogMaxLines&&r.length>this.debugLogMaxLines){for(var n=0;n0?n-4:n,c=0;c>16&255,a[u++]=e>>8&255,a[u++]=255&e;2===s&&(e=i[t.charCodeAt(c)]<<2|i[t.charCodeAt(c+1)]>>4,a[u++]=255&e);1===s&&(e=i[t.charCodeAt(c)]<<10|i[t.charCodeAt(c+1)]<<4|i[t.charCodeAt(c+2)]>>2,a[u++]=e>>8&255,a[u++]=255&e);return a},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;sa?a:s+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var i,o,s=[],a=e;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],3:[function(t,e,r){(function(e){"use strict";var n=t("base64-js"),i=t("ieee754");r.Buffer=e,r.SlowBuffer=function(t){+t!=t&&(t=0);return e.alloc(+t)},r.INSPECT_MAX_BYTES=50;var o=2147483647;function s(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return r.__proto__=e.prototype,r}function e(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return a(t,e,r)}function a(t,r,n){if("string"==typeof t)return function(t,r){"string"==typeof r&&""!==r||(r="utf8");if(!e.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var n=0|l(t,r),i=s(n),o=i.write(t,r);o!==n&&(i=i.slice(0,o));return i}(t,r);if(ArrayBuffer.isView(t))return f(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(j(t,ArrayBuffer)||t&&j(t.buffer,ArrayBuffer))return function(t,r,n){if(r<0||t.byteLength=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function l(t,r){if(e.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||j(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var o=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return k(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(t).length;default:if(o)return i?-1:k(t).length;r=(""+r).toLowerCase(),o=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function d(t,r,n,i,o){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),G(n=+n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof r&&(r=e.from(r,i)),e.isBuffer(r))return 0===r.length?-1:g(t,r,n,i,o);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,n):Uint8Array.prototype.lastIndexOf.call(t,r,n):g(t,[r],n,i,o);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var f=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var c=!0,l=0;li&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function E(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function T(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:h>223?3:h>191?2:1;if(i+c<=r)switch(c){case 1:h<128&&(f=h);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&h)<<6|63&o)>127&&(f=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&h)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return function(t){var e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return C(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},e.prototype.toLocaleString=e.prototype.toString,e.prototype.equals=function(t){if(!e.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===e.compare(this,t)},e.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),""},e.prototype.compare=function(t,r,n,i,o){if(j(t,Uint8Array)&&(t=e.from(t,t.offset,t.byteLength)),!e.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),r<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;for(var s=o-i,a=n-r,u=Math.min(s,a),h=this.slice(i,o),f=t.slice(r,n),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return y(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return m(this,t,e,r);case"latin1":case"binary":return v(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function C(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function P(t,r,n,i,o,s){if(!e.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||rt.length)throw new RangeError("Index out of range")}function M(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(t,e,r,n,o){return e=+e,r>>>=0,o||M(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,o){return e=+e,r>>>=0,o||M(t,0,r,8),i.write(t,e,r,n,52,8),r+8}e.prototype.slice=function(t,r){var n=this.length;t=~~t,r=void 0===r?n:~~r,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),r<0?(r+=n)<0&&(r=0):r>n&&(r=n),r>>=0,e>>>=0,r||x(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||x(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},e.prototype.readUInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),this[t]},e.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},e.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},e.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},e.prototype.readUInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},e.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},e.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},e.prototype.readInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},e.prototype.readInt16LE=function(t,e){t>>>=0,e||x(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},e.prototype.readInt16BE=function(t,e){t>>>=0,e||x(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},e.prototype.readInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},e.prototype.readInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},e.prototype.readFloatLE=function(t,e){return t>>>=0,e||x(t,4,this.length),i.read(this,t,!0,23,4)},e.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),i.read(this,t,!1,23,4)},e.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),i.read(this,t,!0,52,8)},e.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(t,8,this.length),i.read(this,t,!1,52,8)},e.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},e.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},e.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},e.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},e.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},e.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},e.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},e.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},e.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},e.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},e.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},e.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},e.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},e.prototype.writeFloatLE=function(t,e,r){return B(this,t,e,!0,r)},e.prototype.writeFloatBE=function(t,e,r){return B(this,t,e,!1,r)},e.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},e.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},e.prototype.copy=function(t,r,n,i){if(!e.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r=0;--s)t[s+r]=this[s+n];else Uint8Array.prototype.set.call(t,this.subarray(n,i),r);return o},e.prototype.fill=function(t,r,n,i){if("string"==typeof t){if("string"==typeof r?(i=r,r=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!e.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===t.length){var o=t.charCodeAt(0);("utf8"===i&&o<128||"latin1"===i)&&(t=o)}}else"number"==typeof t&&(t&=255);if(r<0||this.length>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=r;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function D(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function j(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function G(t){return t!=t}}).call(this,t("buffer").Buffer)},{"base64-js":2,buffer:3,ieee754:4}],4:[function(t,e,r){r.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,f=-7,c=r?i-1:0,l=r?-1:1,p=t[e+c];for(c+=l,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+t[e+c],c+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+c],c+=l,f-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=h}return(p?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var s,a,u,h=8*o-i-1,f=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=f?(a=0,s=f):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,h-=8);t[r+p-d]|=128*g}},{}],5:[function(t,e,r){function n(t){if(t)return function(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}(t)}void 0!==e&&(e.exports=n),n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4==r){var n;try{n=e.status}catch(t){n=0}if(!n){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var n=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.onprogress=n.bind(null,"download"),e.upload&&(e.upload.onprogress=n.bind(null,"upload"))}catch(t){}try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof r&&!this._isHost(r)){var i=this._header["content-type"],o=this._serializer||f.serialize[i?i.split(";")[0]:""];!o&&g(i)&&(o=f.serialize["application/json"]),o&&(r=o(r))}for(var s in this.header)null!=this.header[s]&&this.header.hasOwnProperty(s)&&e.setRequestHeader(s,this.header[s]);return this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0!==r?r:null),this},f.agent=function(){return new u},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(t){u.prototype[t.toLowerCase()]=function(e,r){var n=new f.Request(t,e);return this._setDefaults(n),r&&n.end(r),n}}),u.prototype.del=u.prototype.delete,f.get=function(t,e,r){var n=f("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},f.head=function(t,e,r){var n=f("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},f.options=function(t,e,r){var n=f("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},f.del=m,f.delete=m,f.patch=function(t,e,r){var n=f("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},f.post=function(t,e,r){var n=f("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},f.put=function(t,e,r){var n=f("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}},{"./agent-base":6,"./is-object":8,"./request-base":9,"./response-base":10,"component-emitter":5}],8:[function(t,e,r){"use strict";e.exports=function(t){return null!==t&&"object"==typeof t}},{}],9:[function(t,e,r){"use strict";var n=t("./is-object");function i(t){if(t)return function(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}(t)}e.exports=i,i.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,this},i.prototype.parse=function(t){return this._parser=t,this},i.prototype.responseType=function(t){return this._responseType=t,this},i.prototype.serialize=function(t){return this._serializer=t,this},i.prototype.timeout=function(t){if(!t||"object"!=typeof t)return this._timeout=t,this._responseTimeout=0,this;for(var e in t)switch(e){case"deadline":this._timeout=t.deadline;break;case"response":this._responseTimeout=t.response;break;default:console.warn("Unknown timeout option",e)}return this},i.prototype.retry=function(t,e){return 0!==arguments.length&&!0!==t||(t=1),t<=0&&(t=0),this._maxRetries=t,this._retries=0,this._retryCallback=e,this};var o=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];i.prototype._shouldRetry=function(t,e){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(t){console.error(t)}if(e&&e.status&&e.status>=500&&501!=e.status)return!0;if(t){if(t.code&&~o.indexOf(t.code))return!0;if(t.timeout&&"ECONNABORTED"==t.code)return!0;if(t.crossDomain)return!0}return!1},i.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},i.prototype.then=function(t,e){if(!this._fullfilledPromise){var r=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(t,e){r.end(function(r,n){r?e(r):t(n)})})}return this._fullfilledPromise.then(t,e)},i.prototype.catch=function(t){return this.then(void 0,t)},i.prototype.use=function(t){return t(this),this},i.prototype.ok=function(t){if("function"!=typeof t)throw Error("Callback required");return this._okCallback=t,this},i.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},i.prototype.get=function(t){return this._header[t.toLowerCase()]},i.prototype.getHeader=i.prototype.get,i.prototype.set=function(t,e){if(n(t)){for(var r in t)this.set(r,t[r]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},i.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},i.prototype.field=function(t,e){if(null===t||void 0===t)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),n(t)){for(var r in t)this.field(r,t[r]);return this}if(Array.isArray(e)){for(var i in e)this.field(t,e[i]);return this}if(null===e||void 0===e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=""+e),this._getFormData().append(t,e),this},i.prototype.abort=function(){return this._aborted?this:(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort"),this)},i.prototype._auth=function(t,e,r,n){switch(r.type){case"basic":this.set("Authorization","Basic "+n(t+":"+e));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer "+t)}return this},i.prototype.withCredentials=function(t){return void 0==t&&(t=!0),this._withCredentials=t,this},i.prototype.redirects=function(t){return this._maxRedirects=t,this},i.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw TypeError("Invalid argument");return this._maxResponseSize=t,this},i.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},i.prototype.send=function(t){var e=n(t),r=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(e&&n(this._data))for(var i in t)this._data[i]=t[i];else"string"==typeof t?(r||this.type("form"),r=this._header["content-type"],this._data="application/x-www-form-urlencoded"==r?this._data?this._data+"&"+t:t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)?this:(r||this.type("json"),this)},i.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},i.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var r=this.url.substring(e+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.substring(0,e)+"?"+r.join("&")}}},i.prototype._appendQueryString=function(){console.trace("Unsupported")},i.prototype._timeoutError=function(t,e,r){if(!this._aborted){var n=new Error(t+e+"ms exceeded");n.timeout=e,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.abort(),this.callback(n)}},i.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")},this._responseTimeout))}},{"./is-object":8}],10:[function(t,e,r){"use strict";var n=t("./utils");function i(t){if(t)return function(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}(t)}e.exports=i,i.prototype.get=function(t){return this.header[t.toLowerCase()]},i.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=n.type(e);var r=n.params(e);for(var i in r)this[i]=r[i];this.links={};try{t.link&&(this.links=n.parseLinks(t.link))}catch(t){}},i.prototype._setStatusProperties=function(t){var e=t/100|0;this.status=this.statusCode=t,this.statusType=e,this.info=1==e,this.ok=2==e,this.redirect=3==e,this.clientError=4==e,this.serverError=5==e,this.error=(4==e||5==e)&&this.toError(),this.created=201==t,this.accepted=202==t,this.noContent=204==t,this.badRequest=400==t,this.unauthorized=401==t,this.notAcceptable=406==t,this.forbidden=403==t,this.notFound=404==t,this.unprocessableEntity=422==t}},{"./utils":11}],11:[function(t,e,r){"use strict";r.type=function(t){return t.split(/ *; */).shift()},r.params=function(t){return t.split(/ *; */).reduce(function(t,e){var r=e.split(/ *= */),n=r.shift(),i=r.shift();return n&&i&&(t[n]=i),t},{})},r.parseLinks=function(t){return t.split(/ *, */).reduce(function(t,e){var r=e.split(/ *; */),n=r[0].slice(1,-1);return t[r[1].split(/ *= */)[1].slice(1,-1)]=n,t},{})},r.cleanHeader=function(t,e){return delete t["content-type"],delete t["content-length"],delete t["transfer-encoding"],delete t.host,e&&(delete t.authorization,delete t.cookie),t}},{}],platformClient:[function(t,e,r){(function(r,n){"use strict";var i,o=(i=t("superagent"))&&"object"==typeof i&&"default"in i?i.default:i,s=void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},a=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,f=!1;function c(){f=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e>18&63]+a[i>>12&63]+a[i>>6&63]+a[63&i]);return o.join("")}function p(t){var e;f||c();for(var r=t.length,n=r%3,i="",o=[],s=0,u=r-n;su?u:s+16383));return 1===n?(e=t[r-1],i+=a[e>>2],i+=a[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=a[e>>10],i+=a[e>>4&63],i+=a[e<<2&63],i+="="),o.push(i),o.join("")}function d(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,f=-7,c=r?i-1:0,l=r?-1:1,p=t[e+c];for(c+=l,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+t[e+c],c+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+c],c+=l,f-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=h}return(p?-1:1)*s*Math.pow(2,o-n)}function g(t,e,r,n,i,o){var s,a,u,h=8*o-i-1,f=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=f?(a=0,s=f):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,h-=8);t[r+p-d]|=128*g}var y={}.toString,w=Array.isArray||function(t){return"[object Array]"==y.call(t)};function m(){return n.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function v(t,e){if(m()=m())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m().toString(16)+" bytes");return 0|t}function C(t){return!(null==t||!t._isBuffer)}function R(t,e){if(C(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Z(t).length;default:if(n)return V(t).length;e=(""+e).toLowerCase(),n=!0}}function I(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function S(t,e,r,i,o){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=n.from(e,i)),C(e))return 0===e.length?-1:x(t,e,r,i,o);if("number"==typeof e)return e&=255,n.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):x(t,[e],r,i,o);throw new TypeError("val must be string, number or Buffer")}function x(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var f=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var c=!0,l=0;li&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function k(t,e,r){return 0===e&&r===t.length?p(t):p(t.slice(e,r))}function q(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:h>223?3:h>191?2:1;if(i+c<=r)switch(c){case 1:h<128&&(f=h);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&h)<<6|63&o)>127&&(f=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&h)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return function(t){var e=t.length;if(e<=D)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return W(this,e,r);case"utf8":case"utf-8":return q(this,e,r);case"ascii":return j(this,e,r);case"latin1":case"binary":return G(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},n.prototype.equals=function(t){if(!C(t))throw new TypeError("Argument must be a Buffer");return this===t||0===n.compare(this,t)},n.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),""},n.prototype.compare=function(t,e,r,n,i){if(!C(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,a=Math.min(o,s),u=this.slice(n,i),h=t.slice(e,r),f=0;fi)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return P(this,t,e,r);case"utf8":case"utf-8":return M(this,t,e,r);case"ascii":return B(this,t,e,r);case"latin1":case"binary":return U(this,t,e,r);case"base64":return O(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function j(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function z(t,e,r,n,i,o){if(!C(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function $(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function J(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function H(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,i){return i||H(t,0,r,4),g(t,e,r,n,23,4),r+4}function K(t,e,r,n,i){return i||H(t,0,r,8),g(t,e,r,n,52,8),r+8}n.prototype.slice=function(t,e){var r,i=this.length;if(t=~~t,e=void 0===e?i:~~e,t<0?(t+=i)<0&&(t=0):t>i&&(t=i),e<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(i*=256);)n+=this[t+--e]*i;return n},n.prototype.readUInt8=function(t,e){return e||Y(t,1,this.length),this[t]},n.prototype.readUInt16LE=function(t,e){return e||Y(t,2,this.length),this[t]|this[t+1]<<8},n.prototype.readUInt16BE=function(t,e){return e||Y(t,2,this.length),this[t]<<8|this[t+1]},n.prototype.readUInt32LE=function(t,e){return e||Y(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},n.prototype.readUInt32BE=function(t,e){return e||Y(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},n.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||Y(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},n.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||Y(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},n.prototype.readInt8=function(t,e){return e||Y(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},n.prototype.readInt16LE=function(t,e){e||Y(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},n.prototype.readInt16BE=function(t,e){e||Y(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},n.prototype.readInt32LE=function(t,e){return e||Y(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},n.prototype.readInt32BE=function(t,e){return e||Y(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},n.prototype.readFloatLE=function(t,e){return e||Y(t,4,this.length),d(this,t,!0,23,4)},n.prototype.readFloatBE=function(t,e){return e||Y(t,4,this.length),d(this,t,!1,23,4)},n.prototype.readDoubleLE=function(t,e){return e||Y(t,8,this.length),d(this,t,!0,52,8)},n.prototype.readDoubleBE=function(t,e){return e||Y(t,8,this.length),d(this,t,!1,52,8)},n.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||z(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},n.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,1,255,0),n.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},n.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,2,65535,0),n.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):$(this,t,e,!0),e+2},n.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,2,65535,0),n.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):$(this,t,e,!1),e+2},n.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,4,4294967295,0),n.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):J(this,t,e,!0),e+4},n.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,4,4294967295,0),n.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):J(this,t,e,!1),e+4},n.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);z(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},n.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);z(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},n.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,1,127,-128),n.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},n.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,2,32767,-32768),n.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):$(this,t,e,!0),e+2},n.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,2,32767,-32768),n.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):$(this,t,e,!1),e+2},n.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,4,2147483647,-2147483648),n.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):J(this,t,e,!0),e+4},n.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||z(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),n.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):J(this,t,e,!1),e+4},n.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},n.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},n.prototype.writeDoubleLE=function(t,e,r){return K(this,t,e,!0,r)},n.prototype.writeDoubleBE=function(t,e,r){return K(this,t,e,!1,r)},n.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else if(s<1e3||!n.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Z(t){return function(t){var e,r,n,i,o,s;f||c();var a=t.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[a-2]?2:"="===t[a-1]?1:0,s=new h(3*a/4-o),n=o>0?a-4:a;var l=0;for(e=0,r=0;e>16&255,s[l++]=i>>8&255,s[l++]=255&i;return 2===o?(i=u[t.charCodeAt(e)]<<2|u[t.charCodeAt(e+1)]>>4,s[l++]=255&i):1===o&&(i=u[t.charCodeAt(e)]<<10|u[t.charCodeAt(e+1)]<<4|u[t.charCodeAt(e+2)]>>2,s[l++]=i>>8&255,s[l++]=255&i),s}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(X,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function tt(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function et(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}class rt{get instance(){return rt.instance}set instance(t){rt.instance=t}constructor(){rt.instance||(rt.instance=this),this.CollectionFormatEnum={CSV:",",SSV:" ",TSV:"\t",PIPES:"|",MULTI:"multi"};try{localStorage.setItem("purecloud_local_storage_test","purecloud_local_storage_test"),localStorage.removeItem("purecloud_local_storage_test"),this.hasLocalStorage=!0}catch(t){this.hasLocalStorage=!1}this.setEnvironment("https://api.mypurecloud.com"),this.authentications={"PureCloud OAuth":{type:"oauth2"},"Guest Chat JWT":{type:"apiKey",in:"header",name:"Authorization",apiKeyPrefix:"Bearer"}},this.defaultHeaders={},this.timeout=16e3,this.authData={},this.settingsPrefix="purecloud",this.superagent=o,"undefined"!=typeof window&&(window.ApiClient=this)}setDebugLog(t,e){this.debugLog=t,this.debugLogMaxLines=e&&e>0?e:void 0}setReturnExtendedResponses(t){this.returnExtended=t}setPersistSettings(t,e){this.persistSettings=t,this.settingsPrefix=e?e.replace(/\W+/g,"_"):"purecloud",this._debugTrace(`this.settingsPrefix=${this.settingsPrefix}`)}_saveSettings(t){try{if(t.apiKey&&(this.authData.apiKey=t.apiKey,this.authentications["Guest Chat JWT"].apiKey=t.apiKey),t.state&&(this.authData.state=t.state),t.tokenExpiryTime&&(this.authData.tokenExpiryTime=t.tokenExpiryTime,this.authData.tokenExpiryTimeString=t.tokenExpiryTimeString),!0!==this.persistSettings)return;if(!this.hasLocalStorage)return void this._debugTrace("Warning: Cannot access local storage. Settings will not be saved.");let e=JSON.parse(JSON.stringify(this.authData));delete e.state,localStorage.setItem(`${this.settingsPrefix}_auth_data`,JSON.stringify(e)),this._debugTrace("Auth data saved to local storage")}catch(t){console.error(t)}}_loadSettings(){if(!0!==this.persistSettings)return;if(!this.hasLocalStorage)return void this._debugTrace("Warning: Cannot access local storage. Settings will not be loaded.");const t=this.authData.state;this.authData=localStorage.getItem(`${this.settingsPrefix}_auth_data`),this.authData?this.authData=JSON.parse(this.authData):this.authData={},this.authData.apiKey&&this.setJwt(this.authData.apiKey),this.authData.state=t}setEnvironment(t){t||(t="mypurecloud.com"),(t=t.replace(/\/+$/,"")).startsWith("https://")&&(t=t.substring(8)),t.startsWith("http://")&&(t=t.substring(7)),t.startsWith("api.")&&(t=t.substring(4)),this.environment=t,this.basePath=`https://api.${t}`,this.authUrl=`https://login.${t}`}_testTokenAccess(){return new Promise((t,e)=>{this._loadSettings(),this.authentications["Guest Chat JWT"].apiKey?this.callApi("/api/v2/authorization/permissions","GET",null,null,null,null,null,["Guest Chat JWT"],["application/json"],["application/json"]).then(()=>{t()}).catch(t=>{this._saveSettings({apiKey:void 0}),e(t)}):e(new Error("Token is not set"))})}setJwt(t){this._saveSettings({apiKey:t})}setStorageKey(t){this.storageKey=t,this.setJwt(this.authentications["Guest Chat JWT"].apiKey)}_buildAuthUrl(t,e){return e||(e={}),Object.keys(e).reduce((t,r)=>e[r]?`${t}&${r}=${e[r]}`:t,`${this.authUrl}/${t}?`)}paramToString(t){return t?t instanceof Date?t.toJSON():t.toString():""}buildUrl(t,e){t.match(/^\//)||(t=`/${t}`);var r=this.basePath+t;return r=r.replace(/\{([\w-]+)\}/g,(t,r)=>{var n;return n=e.hasOwnProperty(r)?this.paramToString(e[r]):t,encodeURIComponent(n)})}isJsonMime(t){return Boolean(t&&t.match(/^application\/json(;.*)?$/i))}jsonPreferredMime(t){for(var e=0;e{var r=this.authentications[e];switch(r.type){case"basic":(r.username||r.password)&&t.auth(r.username||"",r.password||"");break;case"apiKey":if(r.apiKey){var n={};r.apiKeyPrefix?n[r.name]=`${r.apiKeyPrefix} ${r.apiKey}`:n[r.name]=r.apiKey,"header"===r.in?t.set(n):t.query(n)}break;case"oauth2":r.accessToken&&t.set({Authorization:`Bearer ${r.accessToken}`});break;default:throw new Error(`Unknown authentication type: ${r.type}`)}})}callApi(t,e,r,n,i,s,a,u,h,f){var c=this.buildUrl(t,r),l=o(e,c);if(this.proxy&&l.proxy&&l.proxy(this.proxy),this.debugLog){var p=`[REQUEST] ${e} ${c}`;r&&Object.keys(r).count>0&&r[Object.keys(r)[0]]&&(p+=`\nPath Params: ${JSON.stringify(r)}`),n&&Object.keys(n).count>0&&n[Object.keys(n)[0]]&&(p+=`\nQuery Params: ${JSON.stringify(n)}`),a&&(p+=`\nnBody: ${JSON.stringify(a)}`),this._debugTrace(p)}this.applyAuthToRequest(l,u),l.query(this.normalizeParams(n)),l.set(this.defaultHeaders).set(this.normalizeParams(i)),l.timeout(this.timeout);var d=this.jsonPreferredMime(h);if(d?l.type(d):l.header["Content-Type"]||l.type("application/json"),"application/x-www-form-urlencoded"===d)l.send(this.normalizeParams(s));else if("multipart/form-data"==d){var g=this.normalizeParams(s);for(var y in g)g.hasOwnProperty(y)&&(this.isFileParam(g[y])?l.attach(y,g[y]):l.field(y,g[y]))}else a&&l.send(a);var w=this.jsonPreferredMime(f);return w&&l.accept(w),new Promise((t,r)=>{l.end((n,i)=>{if(n&&(console.log(n),!i))return console.log("Response object was not defined!"),void r({status:0,statusText:"error",headers:[],body:{},text:"error",error:n});var o=!0===this.returnExtended||n?{status:i.status,statusText:i.statusText,headers:i.headers,body:i.body,text:i.text,error:n}:i.body?i.body:i.text;if(this.debugLog){var s=`[RESPONSE] ${i.status}: ${e} ${c}`;i.headers&&(s+=`\ninin-correlation-id: ${i.headers["inin-correlation-id"]}`),i.body&&(s+=`\nBody: ${JSON.stringify(i.body,null,2)}`),this._debugTrace(s),n&&this._debugTrace(n)}n?r(o):t(o)})})}parseDate(t){return new Date(t.replace(/T/i," "))}_debugTrace(t){if(this.debugLog){if("string"==typeof t){var e="",r=t.split("\n");if(this.debugLogMaxLines&&r.length>this.debugLogMaxLines){for(var n=0;n - + diff --git a/build/index.d.ts b/build/index.d.ts index ace7e100..931013aa 100644 --- a/build/index.d.ts +++ b/build/index.d.ts @@ -128,7 +128,7 @@ declare namespace Models { export interface JourneyCustomer { "id": string; - "type": string; + "idType": string; } export interface JourneyCustomerSession { @@ -149,6 +149,7 @@ declare namespace Models { "types": Array; "state": string; "communicationId"?: string; + "securityKey"?: string; "selfUri"?: string; } diff --git a/build/node_modules/acorn/package.json b/build/node_modules/acorn/package.json index b30264b5..309e2639 100644 --- a/build/node_modules/acorn/package.json +++ b/build/node_modules/acorn/package.json @@ -33,7 +33,7 @@ "_requiredBy": [ "/rollup-plugin-node-globals" ], - "_resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "_resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/acorn/-/acorn-5.7.3.tgz", "_shasum": "67aa231bf8812974b85235a96771eb6bd07ea279", "_shrinkwrap": null, "_spec": "acorn@^5.7.3", diff --git a/build/node_modules/buffer-from/package.json b/build/node_modules/buffer-from/package.json index 59d48605..79a5758a 100644 --- a/build/node_modules/buffer-from/package.json +++ b/build/node_modules/buffer-from/package.json @@ -32,7 +32,7 @@ "_requiredBy": [ "/concat-stream" ], - "_resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "_resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/buffer-from/-/buffer-from-1.1.1.tgz", "_shasum": "32713bc028f75c02fdb710d7c7bcec1f2c6070ef", "_shrinkwrap": null, "_spec": "buffer-from@^1.0.0", diff --git a/build/node_modules/concat-stream/package.json b/build/node_modules/concat-stream/package.json index d55895e3..d1b5ef92 100644 --- a/build/node_modules/concat-stream/package.json +++ b/build/node_modules/concat-stream/package.json @@ -33,7 +33,7 @@ "_requiredBy": [ "/level-filesystem" ], - "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "_resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/concat-stream/-/concat-stream-1.6.2.tgz", "_shasum": "904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34", "_shrinkwrap": null, "_spec": "concat-stream@^1.4.4", diff --git a/build/node_modules/core-util-is/package.json b/build/node_modules/core-util-is/package.json index 14545d3d..2b6a1bf0 100644 --- a/build/node_modules/core-util-is/package.json +++ b/build/node_modules/core-util-is/package.json @@ -32,7 +32,7 @@ "/levelup/readable-stream", "/readable-stream" ], - "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "_resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/core-util-is/-/core-util-is-1.0.2.tgz", "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", "_shrinkwrap": null, "_spec": "core-util-is@~1.0.0", diff --git a/build/node_modules/debug/package.json b/build/node_modules/debug/package.json index 605ccc8b..c9ae3e8d 100644 --- a/build/node_modules/debug/package.json +++ b/build/node_modules/debug/package.json @@ -33,7 +33,7 @@ "_requiredBy": [ "/superagent" ], - "_resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "_resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/debug/-/debug-3.2.6.tgz", "_shasum": "e83d17de16d8a7efb7717edbe5fb10135eee629b", "_shrinkwrap": null, "_spec": "debug@^3.1.0", diff --git a/build/node_modules/inherits/package.json b/build/node_modules/inherits/package.json index a72704e8..c7261dd3 100644 --- a/build/node_modules/inherits/package.json +++ b/build/node_modules/inherits/package.json @@ -54,7 +54,7 @@ "/sha.js", "/util" ], - "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "_resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/inherits/-/inherits-2.0.3.tgz", "_shasum": "633c2c83e3da42a502f52466022480f4208261de", "_shrinkwrap": null, "_spec": "inherits@~2.0.3", diff --git a/build/node_modules/ms/package.json b/build/node_modules/ms/package.json index 049379f2..0d6b1ad1 100644 --- a/build/node_modules/ms/package.json +++ b/build/node_modules/ms/package.json @@ -32,7 +32,7 @@ "_requiredBy": [ "/debug" ], - "_resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "_resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/ms/-/ms-2.1.1.tgz", "_shasum": "30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a", "_shrinkwrap": null, "_spec": "ms@^2.1.1", diff --git a/build/node_modules/once/package.json b/build/node_modules/once/package.json index b2c32661..c93da788 100644 --- a/build/node_modules/once/package.json +++ b/build/node_modules/once/package.json @@ -33,7 +33,7 @@ "/level-blobs", "/level-filesystem" ], - "_resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "_resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/once/-/once-1.4.0.tgz", "_shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", "_shrinkwrap": null, "_spec": "once@^1.3.0", diff --git a/build/node_modules/process-nextick-args/package.json b/build/node_modules/process-nextick-args/package.json index 8af11f1c..670b3bae 100644 --- a/build/node_modules/process-nextick-args/package.json +++ b/build/node_modules/process-nextick-args/package.json @@ -32,7 +32,7 @@ "_requiredBy": [ "/readable-stream" ], - "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "_resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "_shasum": "a37d732f4271b4ab1ad070d35508e8290788ffaa", "_shrinkwrap": null, "_spec": "process-nextick-args@~2.0.0", diff --git a/build/node_modules/readable-stream/package.json b/build/node_modules/readable-stream/package.json index 98b35d84..5aac4492 100644 --- a/build/node_modules/readable-stream/package.json +++ b/build/node_modules/readable-stream/package.json @@ -34,7 +34,7 @@ "/concat-stream", "/superagent" ], - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "_resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/readable-stream/-/readable-stream-2.3.6.tgz", "_shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf", "_shrinkwrap": null, "_spec": "readable-stream@^2.3.5", diff --git a/build/node_modules/resolve/package.json b/build/node_modules/resolve/package.json index 22ef3880..e2ad16af 100644 --- a/build/node_modules/resolve/package.json +++ b/build/node_modules/resolve/package.json @@ -1,11 +1,11 @@ { "_args": [ [ - "resolve@^1.8.1", + "resolve@^1.10.0", "/var/build/workspace/build-platform-sdks/platform-client-sdk-common/output/purecloudjavascript-guest/build/node_modules/rollup-plugin-commonjs" ] ], - "_from": "resolve@>=1.8.1 <2.0.0", + "_from": "resolve@>=1.10.0 <2.0.0", "_hasShrinkwrap": false, "_id": "resolve@1.10.0", "_inCache": true, @@ -24,10 +24,10 @@ "_phantomChildren": {}, "_requested": { "name": "resolve", - "raw": "resolve@^1.8.1", - "rawSpec": "^1.8.1", + "raw": "resolve@^1.10.0", + "rawSpec": "^1.10.0", "scope": null, - "spec": ">=1.8.1 <2.0.0", + "spec": ">=1.10.0 <2.0.0", "type": "range" }, "_requiredBy": [ @@ -37,7 +37,7 @@ "_resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", "_shasum": "3bdaaeaf45cc07f375656dfd2e54ed0810b101ba", "_shrinkwrap": null, - "_spec": "resolve@^1.8.1", + "_spec": "resolve@^1.10.0", "_where": "/var/build/workspace/build-platform-sdks/platform-client-sdk-common/output/purecloudjavascript-guest/build/node_modules/rollup-plugin-commonjs", "author": { "email": "mail@substack.net", diff --git a/build/node_modules/rollup-plugin-commonjs/CHANGELOG.md b/build/node_modules/rollup-plugin-commonjs/CHANGELOG.md index 1db7fb69..217d4fd4 100644 --- a/build/node_modules/rollup-plugin-commonjs/CHANGELOG.md +++ b/build/node_modules/rollup-plugin-commonjs/CHANGELOG.md @@ -1,5 +1,9 @@ # rollup-plugin-commonjs changelog +## 9.2.1 +*2019-02-23* +* Use correct context when manually resolving ids ([#370](https://github.com/rollup/rollup-plugin-commonjs/issues/370)) + ## 9.2.0 *2018-10-10* * Fix missing default warning, produce better code when importing known ESM default exports ([#349](https://github.com/rollup/rollup-plugin-commonjs/issues/349)) diff --git a/build/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs.js b/build/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs.js index 6afe0a34..7153110f 100644 --- a/build/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs.js +++ b/build/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs.js @@ -2,12 +2,12 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var fs = require('fs'); var path = require('path'); +var resolve = require('resolve'); var rollupPluginutils = require('rollup-pluginutils'); +var fs = require('fs'); var estreeWalker = require('estree-walker'); var MagicString = _interopDefault(require('magic-string')); -var resolve = require('resolve'); var PROXY_PREFIX = '\0commonjs-proxy:'; var EXTERNAL_PREFIX = '\0commonjs-external:'; @@ -95,12 +95,13 @@ function getName(id) { // maybe-sync, maybe-promise-returning functions function first(candidates) { return function() { + var this$1 = this; var args = [], len = arguments.length; while ( len-- ) args[ len ] = arguments[ len ]; return candidates.reduce(function (promise, candidate) { return promise.then( - function (result) { return (result != null ? result : Promise.resolve(candidate.apply(void 0, args))); } + function (result) { return (result != null ? result : Promise.resolve(candidate.call.apply(candidate, [ this$1 ].concat( args )))); } ); }, Promise.resolve()); }; @@ -132,7 +133,7 @@ function getResolveId(extensions) { importer = importer.slice(PROXY_PREFIX.length); } - return resolveUsingOtherResolvers(importee, importer).then(function (resolved) { + return resolveUsingOtherResolvers.call(this, importee, importer).then(function (resolved) { if (resolved) { return isProxyModule ? PROXY_PREFIX + resolved : resolved; } resolved = defaultResolver(importee, importer); @@ -871,8 +872,7 @@ function commonjs(options) { { return ("import * as " + name$1 + " from " + (JSON.stringify(actualId$1)) + "; export default " + name$1 + ";"); } else if (esModulesWithDefaultExport[actualId$1]) { return ("export {default} from " + (JSON.stringify(actualId$1)) + ";"); - } - else + } else { return ("import * as " + name$1 + " from " + (JSON.stringify( actualId$1 )) + "; import {getCjsExportFromNamespace} from \"" + HELPERS_ID + "\"; export default getCjsExportFromNamespace(" + name$1 + ")"); } @@ -895,7 +895,9 @@ function commonjs(options) { var hasDefaultExport = ref.hasDefaultExport; var ast = ref.ast; if (isEsModule) { - (hasDefaultExport ? esModulesWithDefaultExport : esModulesWithoutDefaultExport)[id] = true; + (hasDefaultExport ? esModulesWithDefaultExport : esModulesWithoutDefaultExport)[ + id + ] = true; return null; } diff --git a/build/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs.js.map b/build/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs.js.map index 09b68e34..85073e28 100644 --- a/build/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs.js.map +++ b/build/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs.js.map @@ -1 +1 @@ -{"version":3,"file":"rollup-plugin-commonjs.cjs.js","sources":["../src/helpers.js","../src/is-cjs.js","../src/default-resolver.js","../src/utils.js","../src/resolve-id.js","../src/ast-utils.js","../src/transform.js","../src/index.js"],"sourcesContent":["export const PROXY_PREFIX = '\\0commonjs-proxy:';\nexport const EXTERNAL_PREFIX = '\\0commonjs-external:';\nexport const HELPERS_ID = '\\0commonjsHelpers';\n\nexport const HELPERS = `\nexport var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nexport function commonjsRequire () {\n\tthrow new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');\n}\n\nexport function unwrapExports (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x.default : x;\n}\n\nexport function createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nexport function getCjsExportFromNamespace (n) {\n\treturn n && n.default || n;\n}`;\n","const isCjsPromises = Object.create(null);\n\nexport function getIsCjsPromise(id) {\n\tlet isCjsPromise = isCjsPromises[id];\n\tif (isCjsPromise) return isCjsPromise.promise;\n\n\tconst promise = new Promise(resolve => {\n\t\tisCjsPromises[id] = isCjsPromise = {\n\t\t\tresolve,\n\t\t\tpromise: undefined\n\t\t};\n\t});\n\tisCjsPromise.promise = promise;\n\n\treturn promise;\n}\n\nexport function setIsCjsPromise(id, promise) {\n\tconst isCjsPromise = isCjsPromises[id];\n\tif (isCjsPromise) {\n\t\tif (isCjsPromise.resolve) {\n\t\t\tisCjsPromise.resolve(promise);\n\t\t\tisCjsPromise.resolve = undefined;\n\t\t}\n\t} else {\n\t\tisCjsPromises[id] = { promise, resolve: undefined };\n\t}\n}\n","import * as fs from 'fs';\nimport {dirname, resolve} from 'path';\n\nfunction isFile(file) {\n\ttry {\n\t\tconst stats = fs.statSync(file);\n\t\treturn stats.isFile();\n\t} catch (err) {\n\t\treturn false;\n\t}\n}\n\nfunction addJsExtensionIfNecessary(file) {\n\tif (isFile(file)) return file;\n\n\tfile += '.js';\n\tif (isFile(file)) return file;\n\n\treturn null;\n}\n\nconst absolutePath = /^(?:\\/|(?:[A-Za-z]:)?[\\\\|/])/;\n\nfunction isAbsolute(path) {\n\treturn absolutePath.test(path);\n}\n\nexport default function defaultResolver(importee, importer) {\n\t// absolute paths are left untouched\n\tif (isAbsolute(importee)) return addJsExtensionIfNecessary(resolve(importee));\n\n\t// if this is the entry point, resolve against cwd\n\tif (importer === undefined) return addJsExtensionIfNecessary(resolve(process.cwd(), importee));\n\n\t// external modules are skipped at this stage\n\tif (importee[0] !== '.') return null;\n\n\treturn addJsExtensionIfNecessary(resolve(dirname(importer), importee));\n}\n","import {basename, dirname, extname, sep} from 'path';\nimport {makeLegalIdentifier} from 'rollup-pluginutils';\n\nexport function getName(id) {\n\tconst name = makeLegalIdentifier(basename(id, extname(id)));\n\tif (name !== 'index') {\n\t\treturn name;\n\t} else {\n\t\tconst segments = dirname(id).split(sep);\n\t\treturn makeLegalIdentifier(segments[segments.length - 1]);\n\t}\n}\n\n// Return the first non-falsy result from an array of\n// maybe-sync, maybe-promise-returning functions\nexport function first(candidates) {\n\treturn function(...args) {\n\t\treturn candidates.reduce((promise, candidate) => {\n\t\t\treturn promise.then(\n\t\t\t\tresult => (result != null ? result : Promise.resolve(candidate(...args)))\n\t\t\t);\n\t\t}, Promise.resolve());\n\t};\n}\n","import {statSync} from 'fs';\nimport {dirname, resolve, sep} from 'path';\nimport defaultResolver from './default-resolver';\nimport {EXTERNAL_PREFIX, PROXY_PREFIX} from './helpers';\nimport {first} from './utils';\n\nfunction getCandidatesForExtension(resolved, extension) {\n\treturn [resolved + extension, resolved + `${sep}index${extension}`];\n}\n\nfunction getCandidates(resolved, extensions) {\n\treturn extensions.reduce(\n\t\t(paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)),\n\t\t[resolved]\n\t);\n}\n\nexport function getResolveId(extensions) {\n\tlet resolveUsingOtherResolvers;\n\n\tfunction resolveId(importee, importer) {\n\t\tconst isProxyModule = importee.startsWith(PROXY_PREFIX);\n\t\tif (isProxyModule) {\n\t\t\timportee = importee.slice(PROXY_PREFIX.length);\n\t\t} else if (importee.startsWith('\\0')) {\n\t\t\treturn importee;\n\t\t}\n\n\t\tif (importer && importer.startsWith(PROXY_PREFIX)) {\n\t\t\timporter = importer.slice(PROXY_PREFIX.length);\n\t\t}\n\n\t\treturn resolveUsingOtherResolvers(importee, importer).then(resolved => {\n\t\t\tif (resolved) return isProxyModule ? PROXY_PREFIX + resolved : resolved;\n\n\t\t\tresolved = defaultResolver(importee, importer);\n\n\t\t\tif (isProxyModule) {\n\t\t\t\tif (resolved) return PROXY_PREFIX + resolved;\n\t\t\t\treturn EXTERNAL_PREFIX + importee; // external\n\t\t\t}\n\n\t\t\treturn resolved;\n\t\t});\n\t}\n\n\tresolveId.setRollupOptions = function(options) {\n\t\tconst resolvers = (options.plugins || [])\n\t\t\t.map(plugin => {\n\t\t\t\tif (plugin.resolveId === resolveId) {\n\t\t\t\t\t// substitute CommonJS resolution logic\n\t\t\t\t\treturn (importee, importer) => {\n\t\t\t\t\t\tif (importee[0] !== '.' || !importer) return; // not our problem\n\n\t\t\t\t\t\tconst resolved = resolve(dirname(importer), importee);\n\t\t\t\t\t\tconst candidates = getCandidates(resolved, extensions);\n\n\t\t\t\t\t\tfor (let i = 0; i < candidates.length; i += 1) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst stats = statSync(candidates[i]);\n\t\t\t\t\t\t\t\tif (stats.isFile()) return candidates[i];\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t/* noop */\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn plugin.resolveId;\n\t\t\t})\n\t\t\t.filter(Boolean);\n\n\t\tconst isExternal = id =>\n\t\t\toptions.external\n\t\t\t\t? Array.isArray(options.external)\n\t\t\t\t\t? options.external.includes(id)\n\t\t\t\t\t: options.external(id)\n\t\t\t\t: false;\n\n\t\tresolvers.unshift(id => (isExternal(id) ? false : null));\n\n\t\tresolveUsingOtherResolvers = first(resolvers);\n\t};\n\n\treturn resolveId;\n}\n","export function isReference(node, parent) {\n\tif (parent.type === 'MemberExpression') return parent.computed || node === parent.object;\n\n\t// disregard the `bar` in { bar: foo }\n\tif (parent.type === 'Property' && node !== parent.value) return false;\n\n\t// disregard the `bar` in `class Foo { bar () {...} }`\n\tif (parent.type === 'MethodDefinition') return false;\n\n\t// disregard the `bar` in `export { foo as bar }`\n\tif (parent.type === 'ExportSpecifier' && node !== parent.local) return false;\n\n\treturn true;\n}\n\nexport function flatten(node) {\n\tconst parts = [];\n\n\twhile (node.type === 'MemberExpression') {\n\t\tif (node.computed) return null;\n\n\t\tparts.unshift(node.property.name);\n\t\tnode = node.object;\n\t}\n\n\tif (node.type !== 'Identifier') return null;\n\n\tconst name = node.name;\n\tparts.unshift(name);\n\n\treturn { name, keypath: parts.join('.') };\n}\n\nexport function extractNames(node) {\n\tconst names = [];\n\textractors[node.type](names, node);\n\treturn names;\n}\n\nconst extractors = {\n\tIdentifier(names, node) {\n\t\tnames.push(node.name);\n\t},\n\n\tObjectPattern(names, node) {\n\t\tnode.properties.forEach(prop => {\n\t\t\textractors[prop.value.type](names, prop.value);\n\t\t});\n\t},\n\n\tArrayPattern(names, node) {\n\t\tnode.elements.forEach(element => {\n\t\t\tif (element) extractors[element.type](names, element);\n\t\t});\n\t},\n\n\tRestElement(names, node) {\n\t\textractors[node.argument.type](names, node.argument);\n\t},\n\n\tAssignmentPattern(names, node) {\n\t\textractors[node.left.type](names, node.left);\n\t}\n};\n\nexport function isTruthy(node) {\n\tif (node.type === 'Literal') return !!node.value;\n\tif (node.type === 'ParenthesizedExpression') return isTruthy(node.expression);\n\tif (node.operator in operators) return operators[node.operator](node);\n}\n\nexport function isFalsy(node) {\n\treturn not(isTruthy(node));\n}\n\nfunction not(value) {\n\treturn value === undefined ? value : !value;\n}\n\nfunction equals(a, b, strict) {\n\tif (a.type !== b.type) return undefined;\n\tif (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value;\n}\n\nconst operators = {\n\t'==': x => {\n\t\treturn equals(x.left, x.right, false);\n\t},\n\n\t'!=': x => not(operators['=='](x)),\n\n\t'===': x => {\n\t\treturn equals(x.left, x.right, true);\n\t},\n\n\t'!==': x => not(operators['==='](x)),\n\n\t'!': x => isFalsy(x.argument),\n\n\t'&&': x => isTruthy(x.left) && isTruthy(x.right),\n\n\t'||': x => isTruthy(x.left) || isTruthy(x.right)\n};\n","import { walk } from 'estree-walker';\nimport MagicString from 'magic-string';\nimport { attachScopes, makeLegalIdentifier } from 'rollup-pluginutils';\nimport { extractNames, flatten, isFalsy, isReference, isTruthy } from './ast-utils.js';\nimport { HELPERS_ID, PROXY_PREFIX } from './helpers.js';\nimport { getName } from './utils.js';\n\nconst reserved = 'process location abstract arguments boolean break byte case catch char class const continue debugger default delete do double else enum eval export extends false final finally float for from function goto if implements import in instanceof int interface let long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with yield'.split(\n\t' '\n);\nconst blacklist = { __esModule: true };\nreserved.forEach(word => (blacklist[word] = true));\n\nconst exportsPattern = /^(?:module\\.)?exports(?:\\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/;\n\nconst firstpassGlobal = /\\b(?:require|module|exports|global)\\b/;\nconst firstpassNoGlobal = /\\b(?:require|module|exports)\\b/;\nconst importExportDeclaration = /^(?:Import|Export(?:Named|Default))Declaration/;\nconst functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;\n\nfunction deconflict(scope, globals, identifier) {\n\tlet i = 1;\n\tlet deconflicted = identifier;\n\n\twhile (scope.contains(deconflicted) || globals.has(deconflicted) || deconflicted in blacklist)\n\t\tdeconflicted = `${identifier}_${i++}`;\n\tscope.declarations[deconflicted] = true;\n\n\treturn deconflicted;\n}\n\nfunction tryParse(parse, code, id) {\n\ttry {\n\t\treturn parse(code, { allowReturnOutsideFunction: true });\n\t} catch (err) {\n\t\terr.message += ` in ${id}`;\n\t\tthrow err;\n\t}\n}\n\nexport function hasCjsKeywords(code, ignoreGlobal) {\n\tconst firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal;\n\treturn firstpass.test(code);\n}\n\nexport function checkEsModule(parse, code, id) {\n\tconst ast = tryParse(parse, code, id);\n\n\tlet isEsModule = false;\n\tfor (const node of ast.body) {\n\t\tif (node.type === 'ExportDefaultDeclaration')\n\t\t\treturn { isEsModule: true, hasDefaultExport: true, ast };\n\t\tif (node.type === 'ExportNamedDeclaration') {\n\t\t\tisEsModule = true;\n\t\t\tfor (const specifier of node.specifiers) {\n\t\t\t\tif (specifier.exported.name === 'default') {\n\t\t\t\t\treturn { isEsModule: true, hasDefaultExport: true, ast };\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (importExportDeclaration.test(node.type)) isEsModule = true;\n\t}\n\n\treturn { isEsModule, hasDefaultExport: false, ast };\n}\n\nexport function transformCommonjs(\n\tparse,\n\tcode,\n\tid,\n\tisEntry,\n\tignoreGlobal,\n\tignoreRequire,\n\tcustomNamedExports,\n\tsourceMap,\n\tallowDynamicRequire,\n\tastCache\n) {\n\tconst ast = astCache || tryParse(parse, code, id);\n\n\tconst magicString = new MagicString(code);\n\n\tconst required = {};\n\t// Because objects have no guaranteed ordering, yet we need it,\n\t// we need to keep track of the order in a array\n\tconst sources = [];\n\n\tlet uid = 0;\n\n\tlet scope = attachScopes(ast, 'scope');\n\tconst uses = { module: false, exports: false, global: false, require: false };\n\n\tlet lexicalDepth = 0;\n\tlet programDepth = 0;\n\n\tconst globals = new Set();\n\n\tconst HELPERS_NAME = deconflict(scope, globals, 'commonjsHelpers'); // TODO technically wrong since globals isn't populated yet, but ¯\\_(ツ)_/¯\n\n\tconst namedExports = {};\n\n\t// TODO handle transpiled modules\n\tlet shouldWrap = /__esModule/.test(code);\n\n\tfunction isRequireStatement(node) {\n\t\tif (!node) return;\n\t\tif (node.type !== 'CallExpression') return;\n\t\tif (node.callee.name !== 'require' || scope.contains('require')) return;\n\t\tif (node.arguments.length === 0) return; // Weird case of require() without arguments\n\t\treturn true;\n\t}\n\n\tfunction hasDynamicArguments(node) {\n\t\treturn (\n\t\t\tnode.arguments.length > 1 ||\n\t\t\t(node.arguments[0].type !== 'Literal' &&\n\t\t\t\t(node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0))\n\t\t);\n\t}\n\n\tfunction isStaticRequireStatement(node) {\n\t\tif (!isRequireStatement(node)) return;\n\t\tif (hasDynamicArguments(node)) return;\n\t\tif (ignoreRequire(node.arguments[0].value)) return;\n\t\treturn true;\n\t}\n\n\tfunction getRequireStringArg(node) {\n\t\treturn node.arguments[0].type === 'Literal'\n\t\t\t? node.arguments[0].value\n\t\t\t: node.arguments[0].quasis[0].value.cooked;\n\t}\n\n\tfunction getRequired(node, name) {\n\t\tconst sourceId = getRequireStringArg(node);\n\t\tconst existing = required[sourceId];\n\t\tif (existing === undefined) {\n\t\t\tif (!name) {\n\t\t\t\tdo name = `require$$${uid++}`;\n\t\t\t\twhile (scope.contains(name));\n\t\t\t}\n\n\t\t\tsources.push(sourceId);\n\t\t\trequired[sourceId] = { source: sourceId, name, importsDefault: false };\n\t\t}\n\n\t\treturn required[sourceId];\n\t}\n\n\t// do a first pass, see which names are assigned to. This is necessary to prevent\n\t// illegally replacing `var foo = require('foo')` with `import foo from 'foo'`,\n\t// where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh)\n\tconst assignedTo = new Set();\n\twalk(ast, {\n\t\tenter(node) {\n\t\t\tif (node.type !== 'AssignmentExpression') return;\n\t\t\tif (node.left.type === 'MemberExpression') return;\n\n\t\t\textractNames(node.left).forEach(name => {\n\t\t\t\tassignedTo.add(name);\n\t\t\t});\n\t\t}\n\t});\n\n\twalk(ast, {\n\t\tenter(node, parent) {\n\t\t\tif (sourceMap) {\n\t\t\t\tmagicString.addSourcemapLocation(node.start);\n\t\t\t\tmagicString.addSourcemapLocation(node.end);\n\t\t\t}\n\n\t\t\t// skip dead branches\n\t\t\tif (parent && (parent.type === 'IfStatement' || parent.type === 'ConditionalExpression')) {\n\t\t\t\tif (node === parent.consequent && isFalsy(parent.test)) return this.skip();\n\t\t\t\tif (node === parent.alternate && isTruthy(parent.test)) return this.skip();\n\t\t\t}\n\n\t\t\tif (node._skip) return this.skip();\n\n\t\t\tprogramDepth += 1;\n\n\t\t\tif (node.scope) scope = node.scope;\n\t\t\tif (functionType.test(node.type)) lexicalDepth += 1;\n\n\t\t\t// if toplevel return, we need to wrap it\n\t\t\tif (node.type === 'ReturnStatement' && lexicalDepth === 0) {\n\t\t\t\tshouldWrap = true;\n\t\t\t}\n\n\t\t\t// rewrite `this` as `commonjsHelpers.commonjsGlobal`\n\t\t\tif (node.type === 'ThisExpression' && lexicalDepth === 0) {\n\t\t\t\tuses.global = true;\n\t\t\t\tif (!ignoreGlobal)\n\t\t\t\t\tmagicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {\n\t\t\t\t\t\tstoreName: true\n\t\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151)\n\t\t\tif (node.type === 'UnaryExpression' && node.operator === 'typeof') {\n\t\t\t\tconst flattened = flatten(node.argument);\n\t\t\t\tif (!flattened) return;\n\n\t\t\t\tif (scope.contains(flattened.name)) return;\n\n\t\t\t\tif (\n\t\t\t\t\tflattened.keypath === 'module.exports' ||\n\t\t\t\t\tflattened.keypath === 'module' ||\n\t\t\t\t\tflattened.keypath === 'exports'\n\t\t\t\t) {\n\t\t\t\t\tmagicString.overwrite(node.start, node.end, `'object'`, { storeName: false });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// rewrite `require` (if not already handled) `global` and `define`, and handle free references to\n\t\t\t// `module` and `exports` as these mean we need to wrap the module in commonjsHelpers.createCommonjsModule\n\t\t\tif (node.type === 'Identifier') {\n\t\t\t\tif (isReference(node, parent) && !scope.contains(node.name)) {\n\t\t\t\t\tif (node.name in uses) {\n\t\t\t\t\t\tif (node.name === 'require') {\n\t\t\t\t\t\t\tif (allowDynamicRequire) return;\n\t\t\t\t\t\t\tmagicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {\n\t\t\t\t\t\t\t\tstoreName: true\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tuses[node.name] = true;\n\t\t\t\t\t\tif (node.name === 'global' && !ignoreGlobal) {\n\t\t\t\t\t\t\tmagicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {\n\t\t\t\t\t\t\t\tstoreName: true\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if module or exports are used outside the context of an assignment\n\t\t\t\t\t\t// expression, we need to wrap the module\n\t\t\t\t\t\tif (node.name === 'module' || node.name === 'exports') {\n\t\t\t\t\t\t\tshouldWrap = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (node.name === 'define') {\n\t\t\t\t\t\tmagicString.overwrite(node.start, node.end, 'undefined', { storeName: true });\n\t\t\t\t\t}\n\n\t\t\t\t\tglobals.add(node.name);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Is this an assignment to exports or module.exports?\n\t\t\tif (node.type === 'AssignmentExpression') {\n\t\t\t\tif (node.left.type !== 'MemberExpression') return;\n\n\t\t\t\tconst flattened = flatten(node.left);\n\t\t\t\tif (!flattened) return;\n\n\t\t\t\tif (scope.contains(flattened.name)) return;\n\n\t\t\t\tconst match = exportsPattern.exec(flattened.keypath);\n\t\t\t\tif (!match || flattened.keypath === 'exports') return;\n\n\t\t\t\tuses[flattened.name] = true;\n\n\t\t\t\t// we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` –\n\t\t\t\t// if this isn't top-level, we'll need to wrap the module\n\t\t\t\tif (programDepth > 3) shouldWrap = true;\n\n\t\t\t\tnode.left._skip = true;\n\n\t\t\t\tif (flattened.keypath === 'module.exports' && node.right.type === 'ObjectExpression') {\n\t\t\t\t\treturn node.right.properties.forEach(prop => {\n\t\t\t\t\t\tif (prop.computed || prop.key.type !== 'Identifier') return;\n\t\t\t\t\t\tconst name = prop.key.name;\n\t\t\t\t\t\tif (name === makeLegalIdentifier(name)) namedExports[name] = true;\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (match[1]) namedExports[match[1]] = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// if this is `var x = require('x')`, we can do `import x from 'x'`\n\t\t\tif (\n\t\t\t\tnode.type === 'VariableDeclarator' &&\n\t\t\t\tnode.id.type === 'Identifier' &&\n\t\t\t\tisStaticRequireStatement(node.init)\n\t\t\t) {\n\t\t\t\t// for now, only do this for top-level requires. maybe fix this in future\n\t\t\t\tif (scope.parent) return;\n\n\t\t\t\t// edge case — CJS allows you to assign to imports. ES doesn't\n\t\t\t\tif (assignedTo.has(node.id.name)) return;\n\n\t\t\t\tconst required = getRequired(node.init, node.id.name);\n\t\t\t\trequired.importsDefault = true;\n\n\t\t\t\tif (required.name === node.id.name) {\n\t\t\t\t\tnode._shouldRemove = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!isStaticRequireStatement(node)) return;\n\n\t\t\tconst required = getRequired(node);\n\n\t\t\tif (parent.type === 'ExpressionStatement') {\n\t\t\t\t// is a bare import, e.g. `require('foo');`\n\t\t\t\tmagicString.remove(parent.start, parent.end);\n\t\t\t} else {\n\t\t\t\trequired.importsDefault = true;\n\t\t\t\tmagicString.overwrite(node.start, node.end, required.name);\n\t\t\t}\n\n\t\t\tnode.callee._skip = true;\n\t\t},\n\n\t\tleave(node) {\n\t\t\tprogramDepth -= 1;\n\t\t\tif (node.scope) scope = scope.parent;\n\t\t\tif (functionType.test(node.type)) lexicalDepth -= 1;\n\n\t\t\tif (node.type === 'VariableDeclaration') {\n\t\t\t\tlet keepDeclaration = false;\n\t\t\t\tlet c = node.declarations[0].start;\n\n\t\t\t\tfor (let i = 0; i < node.declarations.length; i += 1) {\n\t\t\t\t\tconst declarator = node.declarations[i];\n\n\t\t\t\t\tif (declarator._shouldRemove) {\n\t\t\t\t\t\tmagicString.remove(c, declarator.end);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!keepDeclaration) {\n\t\t\t\t\t\t\tmagicString.remove(c, declarator.start);\n\t\t\t\t\t\t\tkeepDeclaration = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tc = declarator.end;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!keepDeclaration) {\n\t\t\t\t\tmagicString.remove(node.start, node.end);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\tif (\n\t\t!sources.length &&\n\t\t!uses.module &&\n\t\t!uses.exports &&\n\t\t!uses.require &&\n\t\t(ignoreGlobal || !uses.global)\n\t) {\n\t\tif (Object.keys(namedExports).length) {\n\t\t\tthrow new Error(\n\t\t\t\t`Custom named exports were specified for ${id} but it does not appear to be a CommonJS module`\n\t\t\t);\n\t\t}\n\t\treturn null; // not a CommonJS module\n\t}\n\n\tconst includeHelpers = shouldWrap || uses.global || uses.require;\n\tconst importBlock =\n\t\t(includeHelpers ? [`import * as ${HELPERS_NAME} from '${HELPERS_ID}';`] : [])\n\t\t\t.concat(\n\t\t\t\tsources.map(source => {\n\t\t\t\t\t// import the actual module before the proxy, so that we know\n\t\t\t\t\t// what kind of proxy to build\n\t\t\t\t\treturn `import '${source}';`;\n\t\t\t\t}),\n\t\t\t\tsources.map(source => {\n\t\t\t\t\tconst { name, importsDefault } = required[source];\n\t\t\t\t\treturn `import ${importsDefault ? `${name} from ` : ``}'${PROXY_PREFIX}${source}';`;\n\t\t\t\t})\n\t\t\t)\n\t\t\t.join('\\n') + '\\n\\n';\n\n\tconst namedExportDeclarations = [];\n\tlet wrapperStart = '';\n\tlet wrapperEnd = '';\n\n\tconst moduleName = deconflict(scope, globals, getName(id));\n\tif (!isEntry) {\n\t\tconst exportModuleExports = {\n\t\t\tstr: `export { ${moduleName} as __moduleExports };`,\n\t\t\tname: '__moduleExports'\n\t\t};\n\n\t\tnamedExportDeclarations.push(exportModuleExports);\n\t}\n\n\tconst name = getName(id);\n\n\tfunction addExport(x) {\n\t\tconst deconflicted = deconflict(scope, globals, name);\n\n\t\tconst declaration =\n\t\t\tdeconflicted === name\n\t\t\t\t? `export var ${x} = ${moduleName}.${x};`\n\t\t\t\t: `var ${deconflicted} = ${moduleName}.${x};\\nexport { ${deconflicted} as ${x} };`;\n\n\t\tnamedExportDeclarations.push({\n\t\t\tstr: declaration,\n\t\t\tname: x\n\t\t});\n\t}\n\n\tif (customNamedExports) customNamedExports.forEach(addExport);\n\n\tconst defaultExportPropertyAssignments = [];\n\tlet hasDefaultExport = false;\n\n\tif (shouldWrap) {\n\t\tconst args = `module${uses.exports ? ', exports' : ''}`;\n\n\t\twrapperStart = `var ${moduleName} = ${HELPERS_NAME}.createCommonjsModule(function (${args}) {\\n`;\n\t\twrapperEnd = `\\n});`;\n\t} else {\n\t\tconst names = [];\n\n\t\tast.body.forEach(node => {\n\t\t\tif (node.type === 'ExpressionStatement' && node.expression.type === 'AssignmentExpression') {\n\t\t\t\tconst left = node.expression.left;\n\t\t\t\tconst flattened = flatten(left);\n\n\t\t\t\tif (!flattened) return;\n\n\t\t\t\tconst match = exportsPattern.exec(flattened.keypath);\n\t\t\t\tif (!match) return;\n\n\t\t\t\tif (flattened.keypath === 'module.exports') {\n\t\t\t\t\thasDefaultExport = true;\n\t\t\t\t\tmagicString.overwrite(left.start, left.end, `var ${moduleName}`);\n\t\t\t\t} else {\n\t\t\t\t\tconst name = match[1];\n\t\t\t\t\tconst deconflicted = deconflict(scope, globals, name);\n\n\t\t\t\t\tnames.push({ name, deconflicted });\n\n\t\t\t\t\tmagicString.overwrite(node.start, left.end, `var ${deconflicted}`);\n\n\t\t\t\t\tconst declaration =\n\t\t\t\t\t\tname === deconflicted\n\t\t\t\t\t\t\t? `export { ${name} };`\n\t\t\t\t\t\t\t: `export { ${deconflicted} as ${name} };`;\n\n\t\t\t\t\tif (name !== 'default') {\n\t\t\t\t\t\tnamedExportDeclarations.push({\n\t\t\t\t\t\t\tstr: declaration,\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t});\n\t\t\t\t\t\tdelete namedExports[name];\n\t\t\t\t\t}\n\n\t\t\t\t\tdefaultExportPropertyAssignments.push(`${moduleName}.${name} = ${deconflicted};`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (!hasDefaultExport) {\n\t\t\twrapperEnd = `\\n\\nvar ${moduleName} = {\\n${names\n\t\t\t\t.map(({ name, deconflicted }) => `\\t${name}: ${deconflicted}`)\n\t\t\t\t.join(',\\n')}\\n};`;\n\t\t}\n\t}\n\tObject.keys(namedExports)\n\t\t.filter(key => !blacklist[key])\n\t\t.forEach(addExport);\n\n\tconst defaultExport = /__esModule/.test(code)\n\t\t? `export default ${HELPERS_NAME}.unwrapExports(${moduleName});`\n\t\t: `export default ${moduleName};`;\n\n\tconst named = namedExportDeclarations\n\t\t.filter(x => x.name !== 'default' || !hasDefaultExport)\n\t\t.map(x => x.str);\n\n\tconst exportBlock =\n\t\t'\\n\\n' +\n\t\t[defaultExport]\n\t\t\t.concat(named)\n\t\t\t.concat(hasDefaultExport ? defaultExportPropertyAssignments : [])\n\t\t\t.join('\\n');\n\n\tmagicString\n\t\t.trim()\n\t\t.prepend(importBlock + wrapperStart)\n\t\t.trim()\n\t\t.append(wrapperEnd + exportBlock);\n\n\tcode = magicString.toString();\n\tconst map = sourceMap ? magicString.generateMap() : null;\n\n\treturn { code, map };\n}\n","import { extname, resolve } from 'path';\nimport { sync as nodeResolveSync } from 'resolve';\nimport { createFilter } from 'rollup-pluginutils';\nimport { EXTERNAL_PREFIX, HELPERS, HELPERS_ID, PROXY_PREFIX } from './helpers.js';\nimport { getIsCjsPromise, setIsCjsPromise } from './is-cjs';\nimport { getResolveId } from './resolve-id';\nimport { checkEsModule, hasCjsKeywords, transformCommonjs } from './transform.js';\nimport { getName } from './utils.js';\n\nexport default function commonjs(options = {}) {\n\tconst extensions = options.extensions || ['.js'];\n\tconst filter = createFilter(options.include, options.exclude);\n\tconst ignoreGlobal = options.ignoreGlobal;\n\n\tconst customNamedExports = {};\n\tif (options.namedExports) {\n\t\tObject.keys(options.namedExports).forEach(id => {\n\t\t\tlet resolvedId;\n\n\t\t\ttry {\n\t\t\t\tresolvedId = nodeResolveSync(id, { basedir: process.cwd() });\n\t\t\t} catch (err) {\n\t\t\t\tresolvedId = resolve(id);\n\t\t\t}\n\n\t\t\tcustomNamedExports[resolvedId] = options.namedExports[id];\n\t\t});\n\t}\n\n\tconst esModulesWithoutDefaultExport = Object.create(null);\n\tconst esModulesWithDefaultExport = Object.create(null);\n\tconst allowDynamicRequire = !!options.ignore; // TODO maybe this should be configurable?\n\n\tconst ignoreRequire =\n\t\ttypeof options.ignore === 'function'\n\t\t\t? options.ignore\n\t\t\t: Array.isArray(options.ignore)\n\t\t\t\t? id => options.ignore.includes(id)\n\t\t\t\t: () => false;\n\n\tlet entryModuleIdsPromise = null;\n\n\tconst resolveId = getResolveId(extensions);\n\n\tconst sourceMap = options.sourceMap !== false;\n\n\treturn {\n\t\tname: 'commonjs',\n\n\t\toptions(options) {\n\t\t\tresolveId.setRollupOptions(options);\n\t\t\tconst input = options.input || options.entry;\n\t\t\tconst entryModules = Array.isArray(input)\n\t\t\t\t? input\n\t\t\t\t: typeof input === 'object' && input !== null\n\t\t\t\t\t? Object.values(input)\n\t\t\t\t\t: [input];\n\t\t\tentryModuleIdsPromise = Promise.all(entryModules.map(entry => resolveId(entry)));\n\t\t},\n\n\t\tresolveId,\n\n\t\tload(id) {\n\t\t\tif (id === HELPERS_ID) return HELPERS;\n\n\t\t\t// generate proxy modules\n\t\t\tif (id.startsWith(EXTERNAL_PREFIX)) {\n\t\t\t\tconst actualId = id.slice(EXTERNAL_PREFIX.length);\n\t\t\t\tconst name = getName(actualId);\n\n\t\t\t\treturn `import ${name} from ${JSON.stringify(actualId)}; export default ${name};`;\n\t\t\t}\n\n\t\t\tif (id.startsWith(PROXY_PREFIX)) {\n\t\t\t\tconst actualId = id.slice(PROXY_PREFIX.length);\n\t\t\t\tconst name = getName(actualId);\n\n\t\t\t\treturn getIsCjsPromise(actualId).then(isCjs => {\n\t\t\t\t\tif (isCjs)\n\t\t\t\t\t\treturn `import { __moduleExports } from ${JSON.stringify(\n\t\t\t\t\t\t\tactualId\n\t\t\t\t\t\t)}; export default __moduleExports;`;\n\t\t\t\t\telse if (esModulesWithoutDefaultExport[actualId])\n\t\t\t\t\t\treturn `import * as ${name} from ${JSON.stringify(actualId)}; export default ${name};`;\n\t\t\t\t\telse if (esModulesWithDefaultExport[actualId]) {\n\t\t\t\t\t\treturn `export {default} from ${JSON.stringify(actualId)};`;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\treturn `import * as ${name} from ${JSON.stringify(\n\t\t\t\t\t\t\tactualId\n\t\t\t\t\t\t)}; import {getCjsExportFromNamespace} from \"${HELPERS_ID}\"; export default getCjsExportFromNamespace(${name})`;\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\n\t\ttransform(code, id) {\n\t\t\tif (!filter(id) || extensions.indexOf(extname(id)) === -1) {\n\t\t\t\tsetIsCjsPromise(id, Promise.resolve(null));\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst transformPromise = entryModuleIdsPromise\n\t\t\t\t.then(entryModuleIds => {\n\t\t\t\t\tconst { isEsModule, hasDefaultExport, ast } = checkEsModule(this.parse, code, id);\n\t\t\t\t\tif (isEsModule) {\n\t\t\t\t\t\t(hasDefaultExport ? esModulesWithDefaultExport : esModulesWithoutDefaultExport)[id] = true;\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// it is not an ES module but it does not have CJS-specific elements.\n\t\t\t\t\tif (!hasCjsKeywords(code, ignoreGlobal)) {\n\t\t\t\t\t\tesModulesWithoutDefaultExport[id] = true;\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst transformed = transformCommonjs(\n\t\t\t\t\t\tthis.parse,\n\t\t\t\t\t\tcode,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tentryModuleIds.indexOf(id) !== -1,\n\t\t\t\t\t\tignoreGlobal,\n\t\t\t\t\t\tignoreRequire,\n\t\t\t\t\t\tcustomNamedExports[id],\n\t\t\t\t\t\tsourceMap,\n\t\t\t\t\t\tallowDynamicRequire,\n\t\t\t\t\t\tast\n\t\t\t\t\t);\n\t\t\t\t\tif (!transformed) {\n\t\t\t\t\t\tesModulesWithoutDefaultExport[id] = true;\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn transformed;\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tthis.error(err, err.loc);\n\t\t\t\t});\n\n\t\t\tsetIsCjsPromise(id, transformPromise.then(Boolean, () => false));\n\t\t\treturn transformPromise;\n\t\t}\n\t};\n}\n"],"names":["const","let","resolve","fs.statSync","path","dirname","makeLegalIdentifier","basename","extname","sep","statSync","attachScopes","walk","flattened","required","createFilter","nodeResolveSync","options","actualId","name","this"],"mappings":";;;;;;;;;;;AAAOA,IAAM,YAAY,GAAG,mBAAmB,CAAC;AAChD,AAAOA,IAAM,eAAe,GAAG,sBAAsB,CAAC;AACtD,AAAOA,IAAM,UAAU,GAAG,mBAAmB,CAAC;;AAE9C,AAAOA,IAAM,OAAO,GAAG,8oBAiBrB,CAAC;;ACrBHA,IAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;;AAE1C,AAAO,SAAS,eAAe,CAAC,EAAE,EAAE;CACnCC,IAAI,YAAY,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;CACrC,IAAI,YAAY,IAAE,OAAO,YAAY,CAAC,OAAO,GAAC;;CAE9CD,IAAM,OAAO,GAAG,IAAI,OAAO,WAACE,YAAQ;EACnC,aAAa,CAAC,EAAE,CAAC,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,CAAC,GAAG,IAAI,CAAC;MAC3F,OAAO,IAAI,CAAC;MACZ;;;KAGD,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE;MACxC,6BAA6B,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;MACzC,OAAO,IAAI,CAAC;MACZ;;KAEDpB,IAAM,WAAW,GAAG,iBAAiB;MACpCoB,MAAI,CAAC,KAAK;MACV,IAAI;MACJ,EAAE;MACF,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;MACjC,YAAY;MACZ,aAAa;MACb,kBAAkB,CAAC,EAAE,CAAC;MACtB,SAAS;MACT,mBAAmB;MACnB,GAAG;MACH,CAAC;KACF,IAAI,CAAC,WAAW,EAAE;MACjB,6BAA6B,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;MACzC,OAAO,IAAI,CAAC;MACZ;;KAED,OAAO,WAAW,CAAC;KACnB,CAAC;KACD,KAAK,WAAC,KAAI;KACVA,MAAI,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;KACzB,CAAC,CAAC;;GAEJ,eAAe,CAAC,EAAE,EAAE,gBAAgB,CAAC,IAAI,CAAC,OAAO,cAAK,SAAG,QAAK,CAAC,CAAC,CAAC;GACjE,OAAO,gBAAgB,CAAC;GACxB;EACD,CAAC;CACF;;;;"} \ No newline at end of file +{"version":3,"file":"rollup-plugin-commonjs.cjs.js","sources":["../src/helpers.js","../src/is-cjs.js","../src/default-resolver.js","../src/utils.js","../src/resolve-id.js","../src/ast-utils.js","../src/transform.js","../src/index.js"],"sourcesContent":["export const PROXY_PREFIX = '\\0commonjs-proxy:';\nexport const EXTERNAL_PREFIX = '\\0commonjs-external:';\nexport const HELPERS_ID = '\\0commonjsHelpers';\n\nexport const HELPERS = `\nexport var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nexport function commonjsRequire () {\n\tthrow new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');\n}\n\nexport function unwrapExports (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x.default : x;\n}\n\nexport function createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nexport function getCjsExportFromNamespace (n) {\n\treturn n && n.default || n;\n}`;\n","const isCjsPromises = Object.create(null);\n\nexport function getIsCjsPromise(id) {\n\tlet isCjsPromise = isCjsPromises[id];\n\tif (isCjsPromise) return isCjsPromise.promise;\n\n\tconst promise = new Promise(resolve => {\n\t\tisCjsPromises[id] = isCjsPromise = {\n\t\t\tresolve,\n\t\t\tpromise: undefined\n\t\t};\n\t});\n\tisCjsPromise.promise = promise;\n\n\treturn promise;\n}\n\nexport function setIsCjsPromise(id, promise) {\n\tconst isCjsPromise = isCjsPromises[id];\n\tif (isCjsPromise) {\n\t\tif (isCjsPromise.resolve) {\n\t\t\tisCjsPromise.resolve(promise);\n\t\t\tisCjsPromise.resolve = undefined;\n\t\t}\n\t} else {\n\t\tisCjsPromises[id] = { promise, resolve: undefined };\n\t}\n}\n","import * as fs from 'fs';\nimport { dirname, resolve } from 'path';\n\nfunction isFile(file) {\n\ttry {\n\t\tconst stats = fs.statSync(file);\n\t\treturn stats.isFile();\n\t} catch (err) {\n\t\treturn false;\n\t}\n}\n\nfunction addJsExtensionIfNecessary(file) {\n\tif (isFile(file)) return file;\n\n\tfile += '.js';\n\tif (isFile(file)) return file;\n\n\treturn null;\n}\n\nconst absolutePath = /^(?:\\/|(?:[A-Za-z]:)?[\\\\|/])/;\n\nfunction isAbsolute(path) {\n\treturn absolutePath.test(path);\n}\n\nexport default function defaultResolver(importee, importer) {\n\t// absolute paths are left untouched\n\tif (isAbsolute(importee)) return addJsExtensionIfNecessary(resolve(importee));\n\n\t// if this is the entry point, resolve against cwd\n\tif (importer === undefined) return addJsExtensionIfNecessary(resolve(process.cwd(), importee));\n\n\t// external modules are skipped at this stage\n\tif (importee[0] !== '.') return null;\n\n\treturn addJsExtensionIfNecessary(resolve(dirname(importer), importee));\n}\n","import { basename, dirname, extname, sep } from 'path';\nimport { makeLegalIdentifier } from 'rollup-pluginutils';\n\nexport function getName(id) {\n\tconst name = makeLegalIdentifier(basename(id, extname(id)));\n\tif (name !== 'index') {\n\t\treturn name;\n\t} else {\n\t\tconst segments = dirname(id).split(sep);\n\t\treturn makeLegalIdentifier(segments[segments.length - 1]);\n\t}\n}\n\n// Return the first non-falsy result from an array of\n// maybe-sync, maybe-promise-returning functions\nexport function first(candidates) {\n\treturn function(...args) {\n\t\treturn candidates.reduce((promise, candidate) => {\n\t\t\treturn promise.then(\n\t\t\t\tresult => (result != null ? result : Promise.resolve(candidate.call(this, ...args)))\n\t\t\t);\n\t\t}, Promise.resolve());\n\t};\n}\n","import { statSync } from 'fs';\nimport { dirname, resolve, sep } from 'path';\nimport defaultResolver from './default-resolver';\nimport { EXTERNAL_PREFIX, PROXY_PREFIX } from './helpers';\nimport { first } from './utils';\n\nfunction getCandidatesForExtension(resolved, extension) {\n\treturn [resolved + extension, resolved + `${sep}index${extension}`];\n}\n\nfunction getCandidates(resolved, extensions) {\n\treturn extensions.reduce(\n\t\t(paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)),\n\t\t[resolved]\n\t);\n}\n\nexport function getResolveId(extensions) {\n\tlet resolveUsingOtherResolvers;\n\n\tfunction resolveId(importee, importer) {\n\t\tconst isProxyModule = importee.startsWith(PROXY_PREFIX);\n\t\tif (isProxyModule) {\n\t\t\timportee = importee.slice(PROXY_PREFIX.length);\n\t\t} else if (importee.startsWith('\\0')) {\n\t\t\treturn importee;\n\t\t}\n\n\t\tif (importer && importer.startsWith(PROXY_PREFIX)) {\n\t\t\timporter = importer.slice(PROXY_PREFIX.length);\n\t\t}\n\n\t\treturn resolveUsingOtherResolvers.call(this, importee, importer).then(resolved => {\n\t\t\tif (resolved) return isProxyModule ? PROXY_PREFIX + resolved : resolved;\n\n\t\t\tresolved = defaultResolver(importee, importer);\n\n\t\t\tif (isProxyModule) {\n\t\t\t\tif (resolved) return PROXY_PREFIX + resolved;\n\t\t\t\treturn EXTERNAL_PREFIX + importee; // external\n\t\t\t}\n\n\t\t\treturn resolved;\n\t\t});\n\t}\n\n\tresolveId.setRollupOptions = function(options) {\n\t\tconst resolvers = (options.plugins || [])\n\t\t\t.map(plugin => {\n\t\t\t\tif (plugin.resolveId === resolveId) {\n\t\t\t\t\t// substitute CommonJS resolution logic\n\t\t\t\t\treturn (importee, importer) => {\n\t\t\t\t\t\tif (importee[0] !== '.' || !importer) return; // not our problem\n\n\t\t\t\t\t\tconst resolved = resolve(dirname(importer), importee);\n\t\t\t\t\t\tconst candidates = getCandidates(resolved, extensions);\n\n\t\t\t\t\t\tfor (let i = 0; i < candidates.length; i += 1) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst stats = statSync(candidates[i]);\n\t\t\t\t\t\t\t\tif (stats.isFile()) return candidates[i];\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t/* noop */\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn plugin.resolveId;\n\t\t\t})\n\t\t\t.filter(Boolean);\n\n\t\tconst isExternal = id =>\n\t\t\toptions.external\n\t\t\t\t? Array.isArray(options.external)\n\t\t\t\t\t? options.external.includes(id)\n\t\t\t\t\t: options.external(id)\n\t\t\t\t: false;\n\n\t\tresolvers.unshift(id => (isExternal(id) ? false : null));\n\n\t\tresolveUsingOtherResolvers = first(resolvers);\n\t};\n\n\treturn resolveId;\n}\n","export function isReference(node, parent) {\n\tif (parent.type === 'MemberExpression') return parent.computed || node === parent.object;\n\n\t// disregard the `bar` in { bar: foo }\n\tif (parent.type === 'Property' && node !== parent.value) return false;\n\n\t// disregard the `bar` in `class Foo { bar () {...} }`\n\tif (parent.type === 'MethodDefinition') return false;\n\n\t// disregard the `bar` in `export { foo as bar }`\n\tif (parent.type === 'ExportSpecifier' && node !== parent.local) return false;\n\n\treturn true;\n}\n\nexport function flatten(node) {\n\tconst parts = [];\n\n\twhile (node.type === 'MemberExpression') {\n\t\tif (node.computed) return null;\n\n\t\tparts.unshift(node.property.name);\n\t\tnode = node.object;\n\t}\n\n\tif (node.type !== 'Identifier') return null;\n\n\tconst name = node.name;\n\tparts.unshift(name);\n\n\treturn { name, keypath: parts.join('.') };\n}\n\nexport function extractNames(node) {\n\tconst names = [];\n\textractors[node.type](names, node);\n\treturn names;\n}\n\nconst extractors = {\n\tIdentifier(names, node) {\n\t\tnames.push(node.name);\n\t},\n\n\tObjectPattern(names, node) {\n\t\tnode.properties.forEach(prop => {\n\t\t\textractors[prop.value.type](names, prop.value);\n\t\t});\n\t},\n\n\tArrayPattern(names, node) {\n\t\tnode.elements.forEach(element => {\n\t\t\tif (element) extractors[element.type](names, element);\n\t\t});\n\t},\n\n\tRestElement(names, node) {\n\t\textractors[node.argument.type](names, node.argument);\n\t},\n\n\tAssignmentPattern(names, node) {\n\t\textractors[node.left.type](names, node.left);\n\t}\n};\n\nexport function isTruthy(node) {\n\tif (node.type === 'Literal') return !!node.value;\n\tif (node.type === 'ParenthesizedExpression') return isTruthy(node.expression);\n\tif (node.operator in operators) return operators[node.operator](node);\n}\n\nexport function isFalsy(node) {\n\treturn not(isTruthy(node));\n}\n\nfunction not(value) {\n\treturn value === undefined ? value : !value;\n}\n\nfunction equals(a, b, strict) {\n\tif (a.type !== b.type) return undefined;\n\tif (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value;\n}\n\nconst operators = {\n\t'==': x => {\n\t\treturn equals(x.left, x.right, false);\n\t},\n\n\t'!=': x => not(operators['=='](x)),\n\n\t'===': x => {\n\t\treturn equals(x.left, x.right, true);\n\t},\n\n\t'!==': x => not(operators['==='](x)),\n\n\t'!': x => isFalsy(x.argument),\n\n\t'&&': x => isTruthy(x.left) && isTruthy(x.right),\n\n\t'||': x => isTruthy(x.left) || isTruthy(x.right)\n};\n","import { walk } from 'estree-walker';\nimport MagicString from 'magic-string';\nimport { attachScopes, makeLegalIdentifier } from 'rollup-pluginutils';\nimport { extractNames, flatten, isFalsy, isReference, isTruthy } from './ast-utils.js';\nimport { HELPERS_ID, PROXY_PREFIX } from './helpers.js';\nimport { getName } from './utils.js';\n\nconst reserved = 'process location abstract arguments boolean break byte case catch char class const continue debugger default delete do double else enum eval export extends false final finally float for from function goto if implements import in instanceof int interface let long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with yield'.split(\n\t' '\n);\nconst blacklist = { __esModule: true };\nreserved.forEach(word => (blacklist[word] = true));\n\nconst exportsPattern = /^(?:module\\.)?exports(?:\\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/;\n\nconst firstpassGlobal = /\\b(?:require|module|exports|global)\\b/;\nconst firstpassNoGlobal = /\\b(?:require|module|exports)\\b/;\nconst importExportDeclaration = /^(?:Import|Export(?:Named|Default))Declaration/;\nconst functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;\n\nfunction deconflict(scope, globals, identifier) {\n\tlet i = 1;\n\tlet deconflicted = identifier;\n\n\twhile (scope.contains(deconflicted) || globals.has(deconflicted) || deconflicted in blacklist)\n\t\tdeconflicted = `${identifier}_${i++}`;\n\tscope.declarations[deconflicted] = true;\n\n\treturn deconflicted;\n}\n\nfunction tryParse(parse, code, id) {\n\ttry {\n\t\treturn parse(code, { allowReturnOutsideFunction: true });\n\t} catch (err) {\n\t\terr.message += ` in ${id}`;\n\t\tthrow err;\n\t}\n}\n\nexport function hasCjsKeywords(code, ignoreGlobal) {\n\tconst firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal;\n\treturn firstpass.test(code);\n}\n\nexport function checkEsModule(parse, code, id) {\n\tconst ast = tryParse(parse, code, id);\n\n\tlet isEsModule = false;\n\tfor (const node of ast.body) {\n\t\tif (node.type === 'ExportDefaultDeclaration')\n\t\t\treturn { isEsModule: true, hasDefaultExport: true, ast };\n\t\tif (node.type === 'ExportNamedDeclaration') {\n\t\t\tisEsModule = true;\n\t\t\tfor (const specifier of node.specifiers) {\n\t\t\t\tif (specifier.exported.name === 'default') {\n\t\t\t\t\treturn { isEsModule: true, hasDefaultExport: true, ast };\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (importExportDeclaration.test(node.type)) isEsModule = true;\n\t}\n\n\treturn { isEsModule, hasDefaultExport: false, ast };\n}\n\nexport function transformCommonjs(\n\tparse,\n\tcode,\n\tid,\n\tisEntry,\n\tignoreGlobal,\n\tignoreRequire,\n\tcustomNamedExports,\n\tsourceMap,\n\tallowDynamicRequire,\n\tastCache\n) {\n\tconst ast = astCache || tryParse(parse, code, id);\n\n\tconst magicString = new MagicString(code);\n\n\tconst required = {};\n\t// Because objects have no guaranteed ordering, yet we need it,\n\t// we need to keep track of the order in a array\n\tconst sources = [];\n\n\tlet uid = 0;\n\n\tlet scope = attachScopes(ast, 'scope');\n\tconst uses = { module: false, exports: false, global: false, require: false };\n\n\tlet lexicalDepth = 0;\n\tlet programDepth = 0;\n\n\tconst globals = new Set();\n\n\tconst HELPERS_NAME = deconflict(scope, globals, 'commonjsHelpers'); // TODO technically wrong since globals isn't populated yet, but ¯\\_(ツ)_/¯\n\n\tconst namedExports = {};\n\n\t// TODO handle transpiled modules\n\tlet shouldWrap = /__esModule/.test(code);\n\n\tfunction isRequireStatement(node) {\n\t\tif (!node) return;\n\t\tif (node.type !== 'CallExpression') return;\n\t\tif (node.callee.name !== 'require' || scope.contains('require')) return;\n\t\tif (node.arguments.length === 0) return; // Weird case of require() without arguments\n\t\treturn true;\n\t}\n\n\tfunction hasDynamicArguments(node) {\n\t\treturn (\n\t\t\tnode.arguments.length > 1 ||\n\t\t\t(node.arguments[0].type !== 'Literal' &&\n\t\t\t\t(node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0))\n\t\t);\n\t}\n\n\tfunction isStaticRequireStatement(node) {\n\t\tif (!isRequireStatement(node)) return;\n\t\tif (hasDynamicArguments(node)) return;\n\t\tif (ignoreRequire(node.arguments[0].value)) return;\n\t\treturn true;\n\t}\n\n\tfunction getRequireStringArg(node) {\n\t\treturn node.arguments[0].type === 'Literal'\n\t\t\t? node.arguments[0].value\n\t\t\t: node.arguments[0].quasis[0].value.cooked;\n\t}\n\n\tfunction getRequired(node, name) {\n\t\tconst sourceId = getRequireStringArg(node);\n\t\tconst existing = required[sourceId];\n\t\tif (existing === undefined) {\n\t\t\tif (!name) {\n\t\t\t\tdo name = `require$$${uid++}`;\n\t\t\t\twhile (scope.contains(name));\n\t\t\t}\n\n\t\t\tsources.push(sourceId);\n\t\t\trequired[sourceId] = { source: sourceId, name, importsDefault: false };\n\t\t}\n\n\t\treturn required[sourceId];\n\t}\n\n\t// do a first pass, see which names are assigned to. This is necessary to prevent\n\t// illegally replacing `var foo = require('foo')` with `import foo from 'foo'`,\n\t// where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh)\n\tconst assignedTo = new Set();\n\twalk(ast, {\n\t\tenter(node) {\n\t\t\tif (node.type !== 'AssignmentExpression') return;\n\t\t\tif (node.left.type === 'MemberExpression') return;\n\n\t\t\textractNames(node.left).forEach(name => {\n\t\t\t\tassignedTo.add(name);\n\t\t\t});\n\t\t}\n\t});\n\n\twalk(ast, {\n\t\tenter(node, parent) {\n\t\t\tif (sourceMap) {\n\t\t\t\tmagicString.addSourcemapLocation(node.start);\n\t\t\t\tmagicString.addSourcemapLocation(node.end);\n\t\t\t}\n\n\t\t\t// skip dead branches\n\t\t\tif (parent && (parent.type === 'IfStatement' || parent.type === 'ConditionalExpression')) {\n\t\t\t\tif (node === parent.consequent && isFalsy(parent.test)) return this.skip();\n\t\t\t\tif (node === parent.alternate && isTruthy(parent.test)) return this.skip();\n\t\t\t}\n\n\t\t\tif (node._skip) return this.skip();\n\n\t\t\tprogramDepth += 1;\n\n\t\t\tif (node.scope) scope = node.scope;\n\t\t\tif (functionType.test(node.type)) lexicalDepth += 1;\n\n\t\t\t// if toplevel return, we need to wrap it\n\t\t\tif (node.type === 'ReturnStatement' && lexicalDepth === 0) {\n\t\t\t\tshouldWrap = true;\n\t\t\t}\n\n\t\t\t// rewrite `this` as `commonjsHelpers.commonjsGlobal`\n\t\t\tif (node.type === 'ThisExpression' && lexicalDepth === 0) {\n\t\t\t\tuses.global = true;\n\t\t\t\tif (!ignoreGlobal)\n\t\t\t\t\tmagicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {\n\t\t\t\t\t\tstoreName: true\n\t\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151)\n\t\t\tif (node.type === 'UnaryExpression' && node.operator === 'typeof') {\n\t\t\t\tconst flattened = flatten(node.argument);\n\t\t\t\tif (!flattened) return;\n\n\t\t\t\tif (scope.contains(flattened.name)) return;\n\n\t\t\t\tif (\n\t\t\t\t\tflattened.keypath === 'module.exports' ||\n\t\t\t\t\tflattened.keypath === 'module' ||\n\t\t\t\t\tflattened.keypath === 'exports'\n\t\t\t\t) {\n\t\t\t\t\tmagicString.overwrite(node.start, node.end, `'object'`, { storeName: false });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// rewrite `require` (if not already handled) `global` and `define`, and handle free references to\n\t\t\t// `module` and `exports` as these mean we need to wrap the module in commonjsHelpers.createCommonjsModule\n\t\t\tif (node.type === 'Identifier') {\n\t\t\t\tif (isReference(node, parent) && !scope.contains(node.name)) {\n\t\t\t\t\tif (node.name in uses) {\n\t\t\t\t\t\tif (node.name === 'require') {\n\t\t\t\t\t\t\tif (allowDynamicRequire) return;\n\t\t\t\t\t\t\tmagicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {\n\t\t\t\t\t\t\t\tstoreName: true\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tuses[node.name] = true;\n\t\t\t\t\t\tif (node.name === 'global' && !ignoreGlobal) {\n\t\t\t\t\t\t\tmagicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {\n\t\t\t\t\t\t\t\tstoreName: true\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if module or exports are used outside the context of an assignment\n\t\t\t\t\t\t// expression, we need to wrap the module\n\t\t\t\t\t\tif (node.name === 'module' || node.name === 'exports') {\n\t\t\t\t\t\t\tshouldWrap = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (node.name === 'define') {\n\t\t\t\t\t\tmagicString.overwrite(node.start, node.end, 'undefined', { storeName: true });\n\t\t\t\t\t}\n\n\t\t\t\t\tglobals.add(node.name);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Is this an assignment to exports or module.exports?\n\t\t\tif (node.type === 'AssignmentExpression') {\n\t\t\t\tif (node.left.type !== 'MemberExpression') return;\n\n\t\t\t\tconst flattened = flatten(node.left);\n\t\t\t\tif (!flattened) return;\n\n\t\t\t\tif (scope.contains(flattened.name)) return;\n\n\t\t\t\tconst match = exportsPattern.exec(flattened.keypath);\n\t\t\t\tif (!match || flattened.keypath === 'exports') return;\n\n\t\t\t\tuses[flattened.name] = true;\n\n\t\t\t\t// we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` –\n\t\t\t\t// if this isn't top-level, we'll need to wrap the module\n\t\t\t\tif (programDepth > 3) shouldWrap = true;\n\n\t\t\t\tnode.left._skip = true;\n\n\t\t\t\tif (flattened.keypath === 'module.exports' && node.right.type === 'ObjectExpression') {\n\t\t\t\t\treturn node.right.properties.forEach(prop => {\n\t\t\t\t\t\tif (prop.computed || prop.key.type !== 'Identifier') return;\n\t\t\t\t\t\tconst name = prop.key.name;\n\t\t\t\t\t\tif (name === makeLegalIdentifier(name)) namedExports[name] = true;\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (match[1]) namedExports[match[1]] = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// if this is `var x = require('x')`, we can do `import x from 'x'`\n\t\t\tif (\n\t\t\t\tnode.type === 'VariableDeclarator' &&\n\t\t\t\tnode.id.type === 'Identifier' &&\n\t\t\t\tisStaticRequireStatement(node.init)\n\t\t\t) {\n\t\t\t\t// for now, only do this for top-level requires. maybe fix this in future\n\t\t\t\tif (scope.parent) return;\n\n\t\t\t\t// edge case — CJS allows you to assign to imports. ES doesn't\n\t\t\t\tif (assignedTo.has(node.id.name)) return;\n\n\t\t\t\tconst required = getRequired(node.init, node.id.name);\n\t\t\t\trequired.importsDefault = true;\n\n\t\t\t\tif (required.name === node.id.name) {\n\t\t\t\t\tnode._shouldRemove = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!isStaticRequireStatement(node)) return;\n\n\t\t\tconst required = getRequired(node);\n\n\t\t\tif (parent.type === 'ExpressionStatement') {\n\t\t\t\t// is a bare import, e.g. `require('foo');`\n\t\t\t\tmagicString.remove(parent.start, parent.end);\n\t\t\t} else {\n\t\t\t\trequired.importsDefault = true;\n\t\t\t\tmagicString.overwrite(node.start, node.end, required.name);\n\t\t\t}\n\n\t\t\tnode.callee._skip = true;\n\t\t},\n\n\t\tleave(node) {\n\t\t\tprogramDepth -= 1;\n\t\t\tif (node.scope) scope = scope.parent;\n\t\t\tif (functionType.test(node.type)) lexicalDepth -= 1;\n\n\t\t\tif (node.type === 'VariableDeclaration') {\n\t\t\t\tlet keepDeclaration = false;\n\t\t\t\tlet c = node.declarations[0].start;\n\n\t\t\t\tfor (let i = 0; i < node.declarations.length; i += 1) {\n\t\t\t\t\tconst declarator = node.declarations[i];\n\n\t\t\t\t\tif (declarator._shouldRemove) {\n\t\t\t\t\t\tmagicString.remove(c, declarator.end);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!keepDeclaration) {\n\t\t\t\t\t\t\tmagicString.remove(c, declarator.start);\n\t\t\t\t\t\t\tkeepDeclaration = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tc = declarator.end;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!keepDeclaration) {\n\t\t\t\t\tmagicString.remove(node.start, node.end);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\tif (\n\t\t!sources.length &&\n\t\t!uses.module &&\n\t\t!uses.exports &&\n\t\t!uses.require &&\n\t\t(ignoreGlobal || !uses.global)\n\t) {\n\t\tif (Object.keys(namedExports).length) {\n\t\t\tthrow new Error(\n\t\t\t\t`Custom named exports were specified for ${id} but it does not appear to be a CommonJS module`\n\t\t\t);\n\t\t}\n\t\treturn null; // not a CommonJS module\n\t}\n\n\tconst includeHelpers = shouldWrap || uses.global || uses.require;\n\tconst importBlock =\n\t\t(includeHelpers ? [`import * as ${HELPERS_NAME} from '${HELPERS_ID}';`] : [])\n\t\t\t.concat(\n\t\t\t\tsources.map(source => {\n\t\t\t\t\t// import the actual module before the proxy, so that we know\n\t\t\t\t\t// what kind of proxy to build\n\t\t\t\t\treturn `import '${source}';`;\n\t\t\t\t}),\n\t\t\t\tsources.map(source => {\n\t\t\t\t\tconst { name, importsDefault } = required[source];\n\t\t\t\t\treturn `import ${importsDefault ? `${name} from ` : ``}'${PROXY_PREFIX}${source}';`;\n\t\t\t\t})\n\t\t\t)\n\t\t\t.join('\\n') + '\\n\\n';\n\n\tconst namedExportDeclarations = [];\n\tlet wrapperStart = '';\n\tlet wrapperEnd = '';\n\n\tconst moduleName = deconflict(scope, globals, getName(id));\n\tif (!isEntry) {\n\t\tconst exportModuleExports = {\n\t\t\tstr: `export { ${moduleName} as __moduleExports };`,\n\t\t\tname: '__moduleExports'\n\t\t};\n\n\t\tnamedExportDeclarations.push(exportModuleExports);\n\t}\n\n\tconst name = getName(id);\n\n\tfunction addExport(x) {\n\t\tconst deconflicted = deconflict(scope, globals, name);\n\n\t\tconst declaration =\n\t\t\tdeconflicted === name\n\t\t\t\t? `export var ${x} = ${moduleName}.${x};`\n\t\t\t\t: `var ${deconflicted} = ${moduleName}.${x};\\nexport { ${deconflicted} as ${x} };`;\n\n\t\tnamedExportDeclarations.push({\n\t\t\tstr: declaration,\n\t\t\tname: x\n\t\t});\n\t}\n\n\tif (customNamedExports) customNamedExports.forEach(addExport);\n\n\tconst defaultExportPropertyAssignments = [];\n\tlet hasDefaultExport = false;\n\n\tif (shouldWrap) {\n\t\tconst args = `module${uses.exports ? ', exports' : ''}`;\n\n\t\twrapperStart = `var ${moduleName} = ${HELPERS_NAME}.createCommonjsModule(function (${args}) {\\n`;\n\t\twrapperEnd = `\\n});`;\n\t} else {\n\t\tconst names = [];\n\n\t\tast.body.forEach(node => {\n\t\t\tif (node.type === 'ExpressionStatement' && node.expression.type === 'AssignmentExpression') {\n\t\t\t\tconst left = node.expression.left;\n\t\t\t\tconst flattened = flatten(left);\n\n\t\t\t\tif (!flattened) return;\n\n\t\t\t\tconst match = exportsPattern.exec(flattened.keypath);\n\t\t\t\tif (!match) return;\n\n\t\t\t\tif (flattened.keypath === 'module.exports') {\n\t\t\t\t\thasDefaultExport = true;\n\t\t\t\t\tmagicString.overwrite(left.start, left.end, `var ${moduleName}`);\n\t\t\t\t} else {\n\t\t\t\t\tconst name = match[1];\n\t\t\t\t\tconst deconflicted = deconflict(scope, globals, name);\n\n\t\t\t\t\tnames.push({ name, deconflicted });\n\n\t\t\t\t\tmagicString.overwrite(node.start, left.end, `var ${deconflicted}`);\n\n\t\t\t\t\tconst declaration =\n\t\t\t\t\t\tname === deconflicted\n\t\t\t\t\t\t\t? `export { ${name} };`\n\t\t\t\t\t\t\t: `export { ${deconflicted} as ${name} };`;\n\n\t\t\t\t\tif (name !== 'default') {\n\t\t\t\t\t\tnamedExportDeclarations.push({\n\t\t\t\t\t\t\tstr: declaration,\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t});\n\t\t\t\t\t\tdelete namedExports[name];\n\t\t\t\t\t}\n\n\t\t\t\t\tdefaultExportPropertyAssignments.push(`${moduleName}.${name} = ${deconflicted};`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (!hasDefaultExport) {\n\t\t\twrapperEnd = `\\n\\nvar ${moduleName} = {\\n${names\n\t\t\t\t.map(({ name, deconflicted }) => `\\t${name}: ${deconflicted}`)\n\t\t\t\t.join(',\\n')}\\n};`;\n\t\t}\n\t}\n\tObject.keys(namedExports)\n\t\t.filter(key => !blacklist[key])\n\t\t.forEach(addExport);\n\n\tconst defaultExport = /__esModule/.test(code)\n\t\t? `export default ${HELPERS_NAME}.unwrapExports(${moduleName});`\n\t\t: `export default ${moduleName};`;\n\n\tconst named = namedExportDeclarations\n\t\t.filter(x => x.name !== 'default' || !hasDefaultExport)\n\t\t.map(x => x.str);\n\n\tconst exportBlock =\n\t\t'\\n\\n' +\n\t\t[defaultExport]\n\t\t\t.concat(named)\n\t\t\t.concat(hasDefaultExport ? defaultExportPropertyAssignments : [])\n\t\t\t.join('\\n');\n\n\tmagicString\n\t\t.trim()\n\t\t.prepend(importBlock + wrapperStart)\n\t\t.trim()\n\t\t.append(wrapperEnd + exportBlock);\n\n\tcode = magicString.toString();\n\tconst map = sourceMap ? magicString.generateMap() : null;\n\n\treturn { code, map };\n}\n","import { extname, resolve } from 'path';\nimport { sync as nodeResolveSync } from 'resolve';\nimport { createFilter } from 'rollup-pluginutils';\nimport { EXTERNAL_PREFIX, HELPERS, HELPERS_ID, PROXY_PREFIX } from './helpers.js';\nimport { getIsCjsPromise, setIsCjsPromise } from './is-cjs';\nimport { getResolveId } from './resolve-id';\nimport { checkEsModule, hasCjsKeywords, transformCommonjs } from './transform.js';\nimport { getName } from './utils.js';\n\nexport default function commonjs(options = {}) {\n\tconst extensions = options.extensions || ['.js'];\n\tconst filter = createFilter(options.include, options.exclude);\n\tconst ignoreGlobal = options.ignoreGlobal;\n\n\tconst customNamedExports = {};\n\tif (options.namedExports) {\n\t\tObject.keys(options.namedExports).forEach(id => {\n\t\t\tlet resolvedId;\n\n\t\t\ttry {\n\t\t\t\tresolvedId = nodeResolveSync(id, { basedir: process.cwd() });\n\t\t\t} catch (err) {\n\t\t\t\tresolvedId = resolve(id);\n\t\t\t}\n\n\t\t\tcustomNamedExports[resolvedId] = options.namedExports[id];\n\t\t});\n\t}\n\n\tconst esModulesWithoutDefaultExport = Object.create(null);\n\tconst esModulesWithDefaultExport = Object.create(null);\n\tconst allowDynamicRequire = !!options.ignore; // TODO maybe this should be configurable?\n\n\tconst ignoreRequire =\n\t\ttypeof options.ignore === 'function'\n\t\t\t? options.ignore\n\t\t\t: Array.isArray(options.ignore)\n\t\t\t\t? id => options.ignore.includes(id)\n\t\t\t\t: () => false;\n\n\tlet entryModuleIdsPromise = null;\n\n\tconst resolveId = getResolveId(extensions);\n\n\tconst sourceMap = options.sourceMap !== false;\n\n\treturn {\n\t\tname: 'commonjs',\n\n\t\toptions(options) {\n\t\t\tresolveId.setRollupOptions(options);\n\t\t\tconst input = options.input || options.entry;\n\t\t\tconst entryModules = Array.isArray(input)\n\t\t\t\t? input\n\t\t\t\t: typeof input === 'object' && input !== null\n\t\t\t\t\t? Object.values(input)\n\t\t\t\t\t: [input];\n\t\t\tentryModuleIdsPromise = Promise.all(entryModules.map(entry => resolveId(entry)));\n\t\t},\n\n\t\tresolveId,\n\n\t\tload(id) {\n\t\t\tif (id === HELPERS_ID) return HELPERS;\n\n\t\t\t// generate proxy modules\n\t\t\tif (id.startsWith(EXTERNAL_PREFIX)) {\n\t\t\t\tconst actualId = id.slice(EXTERNAL_PREFIX.length);\n\t\t\t\tconst name = getName(actualId);\n\n\t\t\t\treturn `import ${name} from ${JSON.stringify(actualId)}; export default ${name};`;\n\t\t\t}\n\n\t\t\tif (id.startsWith(PROXY_PREFIX)) {\n\t\t\t\tconst actualId = id.slice(PROXY_PREFIX.length);\n\t\t\t\tconst name = getName(actualId);\n\n\t\t\t\treturn getIsCjsPromise(actualId).then(isCjs => {\n\t\t\t\t\tif (isCjs)\n\t\t\t\t\t\treturn `import { __moduleExports } from ${JSON.stringify(\n\t\t\t\t\t\t\tactualId\n\t\t\t\t\t\t)}; export default __moduleExports;`;\n\t\t\t\t\telse if (esModulesWithoutDefaultExport[actualId])\n\t\t\t\t\t\treturn `import * as ${name} from ${JSON.stringify(actualId)}; export default ${name};`;\n\t\t\t\t\telse if (esModulesWithDefaultExport[actualId]) {\n\t\t\t\t\t\treturn `export {default} from ${JSON.stringify(actualId)};`;\n\t\t\t\t\t} else\n\t\t\t\t\t\treturn `import * as ${name} from ${JSON.stringify(\n\t\t\t\t\t\t\tactualId\n\t\t\t\t\t\t)}; import {getCjsExportFromNamespace} from \"${HELPERS_ID}\"; export default getCjsExportFromNamespace(${name})`;\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\n\t\ttransform(code, id) {\n\t\t\tif (!filter(id) || extensions.indexOf(extname(id)) === -1) {\n\t\t\t\tsetIsCjsPromise(id, Promise.resolve(null));\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst transformPromise = entryModuleIdsPromise\n\t\t\t\t.then(entryModuleIds => {\n\t\t\t\t\tconst { isEsModule, hasDefaultExport, ast } = checkEsModule(this.parse, code, id);\n\t\t\t\t\tif (isEsModule) {\n\t\t\t\t\t\t(hasDefaultExport ? esModulesWithDefaultExport : esModulesWithoutDefaultExport)[\n\t\t\t\t\t\t\tid\n\t\t\t\t\t\t] = true;\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// it is not an ES module but it does not have CJS-specific elements.\n\t\t\t\t\tif (!hasCjsKeywords(code, ignoreGlobal)) {\n\t\t\t\t\t\tesModulesWithoutDefaultExport[id] = true;\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst transformed = transformCommonjs(\n\t\t\t\t\t\tthis.parse,\n\t\t\t\t\t\tcode,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tentryModuleIds.indexOf(id) !== -1,\n\t\t\t\t\t\tignoreGlobal,\n\t\t\t\t\t\tignoreRequire,\n\t\t\t\t\t\tcustomNamedExports[id],\n\t\t\t\t\t\tsourceMap,\n\t\t\t\t\t\tallowDynamicRequire,\n\t\t\t\t\t\tast\n\t\t\t\t\t);\n\t\t\t\t\tif (!transformed) {\n\t\t\t\t\t\tesModulesWithoutDefaultExport[id] = true;\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn transformed;\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tthis.error(err, err.loc);\n\t\t\t\t});\n\n\t\t\tsetIsCjsPromise(id, transformPromise.then(Boolean, () => false));\n\t\t\treturn transformPromise;\n\t\t}\n\t};\n}\n"],"names":["const","let","resolve","fs.statSync","path","dirname","makeLegalIdentifier","basename","extname","sep","this","statSync","attachScopes","walk","flattened","required","createFilter","nodeResolveSync","options","actualId","name"],"mappings":";;;;;;;;;;;AAAOA,IAAM,YAAY,GAAG,mBAAmB,CAAC;AAChD,AAAOA,IAAM,eAAe,GAAG,sBAAsB,CAAC;AACtD,AAAOA,IAAM,UAAU,GAAG,mBAAmB,CAAC;;AAE9C,AAAOA,IAAM,OAAO,GAAG,8oBAiBrB,CAAC;;ACrBHA,IAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;;AAE1C,AAAO,SAAS,eAAe,CAAC,EAAE,EAAE;CACnCC,IAAI,YAAY,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;CACrC,IAAI,YAAY,IAAE,OAAO,YAAY,CAAC,OAAO,GAAC;;CAE9CD,IAAM,OAAO,GAAG,IAAI,OAAO,WAACE,YAAQ;EACnC,aAAa,CAAC,EAAE,CAAC,GAAG,YAAY,GAAG;YAClCA,UAAO;GACP,OAAO,EAAE,SAAS;GAClB,CAAC;EACF,CAAC,CAAC;CACH,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC;;CAE/B,OAAO,OAAO,CAAC;CACf;;AAED,AAAO,SAAS,eAAe,CAA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,EAAE,CAAC,GAAG,IAAI,CAAC;MACzC,OAAO,IAAI,CAAC;MACZ;;KAEDV,IAAM,WAAW,GAAG,iBAAiB;MACpCU,MAAI,CAAC,KAAK;MACV,IAAI;MACJ,EAAE;MACF,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;MACjC,YAAY;MACZ,aAAa;MACb,kBAAkB,CAAC,EAAE,CAAC;MACtB,SAAS;MACT,mBAAmB;MACnB,GAAG;MACH,CAAC;KACF,IAAI,CAAC,WAAW,EAAE;MACjB,6BAA6B,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;MACzC,OAAO,IAAI,CAAC;MACZ;;KAED,OAAO,WAAW,CAAC;KACnB,CAAC;KACD,KAAK,WAAC,KAAI;KACVA,MAAI,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;KACzB,CAAC,CAAC;;GAEJ,eAAe,CAAC,EAAE,EAAE,gBAAgB,CAAC,IAAI,CAAC,OAAO,cAAK,SAAG,QAAK,CAAC,CAAC,CAAC;GACjE,OAAO,gBAAgB,CAAC;GACxB;EACD,CAAC;CACF;;;;"} \ No newline at end of file diff --git a/build/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.es.js b/build/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.es.js index f6f3ee21..623f7dd0 100644 --- a/build/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.es.js +++ b/build/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.es.js @@ -1,9 +1,9 @@ -import { statSync } from 'fs'; -import { dirname, resolve, basename, extname, sep } from 'path'; +import { resolve, dirname, basename, extname, sep } from 'path'; +import { sync } from 'resolve'; import { makeLegalIdentifier, attachScopes, createFilter } from 'rollup-pluginutils'; +import { statSync } from 'fs'; import { walk } from 'estree-walker'; import MagicString from 'magic-string'; -import { sync } from 'resolve'; var PROXY_PREFIX = '\0commonjs-proxy:'; var EXTERNAL_PREFIX = '\0commonjs-external:'; @@ -91,12 +91,13 @@ function getName(id) { // maybe-sync, maybe-promise-returning functions function first(candidates) { return function() { + var this$1 = this; var args = [], len = arguments.length; while ( len-- ) args[ len ] = arguments[ len ]; return candidates.reduce(function (promise, candidate) { return promise.then( - function (result) { return (result != null ? result : Promise.resolve(candidate.apply(void 0, args))); } + function (result) { return (result != null ? result : Promise.resolve(candidate.call.apply(candidate, [ this$1 ].concat( args )))); } ); }, Promise.resolve()); }; @@ -128,7 +129,7 @@ function getResolveId(extensions) { importer = importer.slice(PROXY_PREFIX.length); } - return resolveUsingOtherResolvers(importee, importer).then(function (resolved) { + return resolveUsingOtherResolvers.call(this, importee, importer).then(function (resolved) { if (resolved) { return isProxyModule ? PROXY_PREFIX + resolved : resolved; } resolved = defaultResolver(importee, importer); @@ -867,8 +868,7 @@ function commonjs(options) { { return ("import * as " + name$1 + " from " + (JSON.stringify(actualId$1)) + "; export default " + name$1 + ";"); } else if (esModulesWithDefaultExport[actualId$1]) { return ("export {default} from " + (JSON.stringify(actualId$1)) + ";"); - } - else + } else { return ("import * as " + name$1 + " from " + (JSON.stringify( actualId$1 )) + "; import {getCjsExportFromNamespace} from \"" + HELPERS_ID + "\"; export default getCjsExportFromNamespace(" + name$1 + ")"); } @@ -891,7 +891,9 @@ function commonjs(options) { var hasDefaultExport = ref.hasDefaultExport; var ast = ref.ast; if (isEsModule) { - (hasDefaultExport ? esModulesWithDefaultExport : esModulesWithoutDefaultExport)[id] = true; + (hasDefaultExport ? esModulesWithDefaultExport : esModulesWithoutDefaultExport)[ + id + ] = true; return null; } diff --git a/build/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.es.js.map b/build/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.es.js.map index 7e9524ab..ada4b604 100644 --- a/build/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.es.js.map +++ b/build/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.es.js.map @@ -1 +1 @@ -{"version":3,"file":"rollup-plugin-commonjs.es.js","sources":["../src/helpers.js","../src/is-cjs.js","../src/default-resolver.js","../src/utils.js","../src/resolve-id.js","../src/ast-utils.js","../src/transform.js","../src/index.js"],"sourcesContent":["export const PROXY_PREFIX = '\\0commonjs-proxy:';\nexport const EXTERNAL_PREFIX = '\\0commonjs-external:';\nexport const HELPERS_ID = '\\0commonjsHelpers';\n\nexport const HELPERS = `\nexport var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nexport function commonjsRequire () {\n\tthrow new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');\n}\n\nexport function unwrapExports (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x.default : x;\n}\n\nexport function createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nexport function getCjsExportFromNamespace (n) {\n\treturn n && n.default || n;\n}`;\n","const isCjsPromises = Object.create(null);\n\nexport function getIsCjsPromise(id) {\n\tlet isCjsPromise = isCjsPromises[id];\n\tif (isCjsPromise) return isCjsPromise.promise;\n\n\tconst promise = new Promise(resolve => {\n\t\tisCjsPromises[id] = isCjsPromise = {\n\t\t\tresolve,\n\t\t\tpromise: undefined\n\t\t};\n\t});\n\tisCjsPromise.promise = promise;\n\n\treturn promise;\n}\n\nexport function setIsCjsPromise(id, promise) {\n\tconst isCjsPromise = isCjsPromises[id];\n\tif (isCjsPromise) {\n\t\tif (isCjsPromise.resolve) {\n\t\t\tisCjsPromise.resolve(promise);\n\t\t\tisCjsPromise.resolve = undefined;\n\t\t}\n\t} else {\n\t\tisCjsPromises[id] = { promise, resolve: undefined };\n\t}\n}\n","import * as fs from 'fs';\nimport {dirname, resolve} from 'path';\n\nfunction isFile(file) {\n\ttry {\n\t\tconst stats = fs.statSync(file);\n\t\treturn stats.isFile();\n\t} catch (err) {\n\t\treturn false;\n\t}\n}\n\nfunction addJsExtensionIfNecessary(file) {\n\tif (isFile(file)) return file;\n\n\tfile += '.js';\n\tif (isFile(file)) return file;\n\n\treturn null;\n}\n\nconst absolutePath = /^(?:\\/|(?:[A-Za-z]:)?[\\\\|/])/;\n\nfunction isAbsolute(path) {\n\treturn absolutePath.test(path);\n}\n\nexport default function defaultResolver(importee, importer) {\n\t// absolute paths are left untouched\n\tif (isAbsolute(importee)) return addJsExtensionIfNecessary(resolve(importee));\n\n\t// if this is the entry point, resolve against cwd\n\tif (importer === undefined) return addJsExtensionIfNecessary(resolve(process.cwd(), importee));\n\n\t// external modules are skipped at this stage\n\tif (importee[0] !== '.') return null;\n\n\treturn addJsExtensionIfNecessary(resolve(dirname(importer), importee));\n}\n","import {basename, dirname, extname, sep} from 'path';\nimport {makeLegalIdentifier} from 'rollup-pluginutils';\n\nexport function getName(id) {\n\tconst name = makeLegalIdentifier(basename(id, extname(id)));\n\tif (name !== 'index') {\n\t\treturn name;\n\t} else {\n\t\tconst segments = dirname(id).split(sep);\n\t\treturn makeLegalIdentifier(segments[segments.length - 1]);\n\t}\n}\n\n// Return the first non-falsy result from an array of\n// maybe-sync, maybe-promise-returning functions\nexport function first(candidates) {\n\treturn function(...args) {\n\t\treturn candidates.reduce((promise, candidate) => {\n\t\t\treturn promise.then(\n\t\t\t\tresult => (result != null ? result : Promise.resolve(candidate(...args)))\n\t\t\t);\n\t\t}, Promise.resolve());\n\t};\n}\n","import {statSync} from 'fs';\nimport {dirname, resolve, sep} from 'path';\nimport defaultResolver from './default-resolver';\nimport {EXTERNAL_PREFIX, PROXY_PREFIX} from './helpers';\nimport {first} from './utils';\n\nfunction getCandidatesForExtension(resolved, extension) {\n\treturn [resolved + extension, resolved + `${sep}index${extension}`];\n}\n\nfunction getCandidates(resolved, extensions) {\n\treturn extensions.reduce(\n\t\t(paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)),\n\t\t[resolved]\n\t);\n}\n\nexport function getResolveId(extensions) {\n\tlet resolveUsingOtherResolvers;\n\n\tfunction resolveId(importee, importer) {\n\t\tconst isProxyModule = importee.startsWith(PROXY_PREFIX);\n\t\tif (isProxyModule) {\n\t\t\timportee = importee.slice(PROXY_PREFIX.length);\n\t\t} else if (importee.startsWith('\\0')) {\n\t\t\treturn importee;\n\t\t}\n\n\t\tif (importer && importer.startsWith(PROXY_PREFIX)) {\n\t\t\timporter = importer.slice(PROXY_PREFIX.length);\n\t\t}\n\n\t\treturn resolveUsingOtherResolvers(importee, importer).then(resolved => {\n\t\t\tif (resolved) return isProxyModule ? PROXY_PREFIX + resolved : resolved;\n\n\t\t\tresolved = defaultResolver(importee, importer);\n\n\t\t\tif (isProxyModule) {\n\t\t\t\tif (resolved) return PROXY_PREFIX + resolved;\n\t\t\t\treturn EXTERNAL_PREFIX + importee; // external\n\t\t\t}\n\n\t\t\treturn resolved;\n\t\t});\n\t}\n\n\tresolveId.setRollupOptions = function(options) {\n\t\tconst resolvers = (options.plugins || [])\n\t\t\t.map(plugin => {\n\t\t\t\tif (plugin.resolveId === resolveId) {\n\t\t\t\t\t// substitute CommonJS resolution logic\n\t\t\t\t\treturn (importee, importer) => {\n\t\t\t\t\t\tif (importee[0] !== '.' || !importer) return; // not our problem\n\n\t\t\t\t\t\tconst resolved = resolve(dirname(importer), importee);\n\t\t\t\t\t\tconst candidates = getCandidates(resolved, extensions);\n\n\t\t\t\t\t\tfor (let i = 0; i < candidates.length; i += 1) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst stats = statSync(candidates[i]);\n\t\t\t\t\t\t\t\tif (stats.isFile()) return candidates[i];\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t/* noop */\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn plugin.resolveId;\n\t\t\t})\n\t\t\t.filter(Boolean);\n\n\t\tconst isExternal = id =>\n\t\t\toptions.external\n\t\t\t\t? Array.isArray(options.external)\n\t\t\t\t\t? options.external.includes(id)\n\t\t\t\t\t: options.external(id)\n\t\t\t\t: false;\n\n\t\tresolvers.unshift(id => (isExternal(id) ? false : null));\n\n\t\tresolveUsingOtherResolvers = first(resolvers);\n\t};\n\n\treturn resolveId;\n}\n","export function isReference(node, parent) {\n\tif (parent.type === 'MemberExpression') return parent.computed || node === parent.object;\n\n\t// disregard the `bar` in { bar: foo }\n\tif (parent.type === 'Property' && node !== parent.value) return false;\n\n\t// disregard the `bar` in `class Foo { bar () {...} }`\n\tif (parent.type === 'MethodDefinition') return false;\n\n\t// disregard the `bar` in `export { foo as bar }`\n\tif (parent.type === 'ExportSpecifier' && node !== parent.local) return false;\n\n\treturn true;\n}\n\nexport function flatten(node) {\n\tconst parts = [];\n\n\twhile (node.type === 'MemberExpression') {\n\t\tif (node.computed) return null;\n\n\t\tparts.unshift(node.property.name);\n\t\tnode = node.object;\n\t}\n\n\tif (node.type !== 'Identifier') return null;\n\n\tconst name = node.name;\n\tparts.unshift(name);\n\n\treturn { name, keypath: parts.join('.') };\n}\n\nexport function extractNames(node) {\n\tconst names = [];\n\textractors[node.type](names, node);\n\treturn names;\n}\n\nconst extractors = {\n\tIdentifier(names, node) {\n\t\tnames.push(node.name);\n\t},\n\n\tObjectPattern(names, node) {\n\t\tnode.properties.forEach(prop => {\n\t\t\textractors[prop.value.type](names, prop.value);\n\t\t});\n\t},\n\n\tArrayPattern(names, node) {\n\t\tnode.elements.forEach(element => {\n\t\t\tif (element) extractors[element.type](names, element);\n\t\t});\n\t},\n\n\tRestElement(names, node) {\n\t\textractors[node.argument.type](names, node.argument);\n\t},\n\n\tAssignmentPattern(names, node) {\n\t\textractors[node.left.type](names, node.left);\n\t}\n};\n\nexport function isTruthy(node) {\n\tif (node.type === 'Literal') return !!node.value;\n\tif (node.type === 'ParenthesizedExpression') return isTruthy(node.expression);\n\tif (node.operator in operators) return operators[node.operator](node);\n}\n\nexport function isFalsy(node) {\n\treturn not(isTruthy(node));\n}\n\nfunction not(value) {\n\treturn value === undefined ? value : !value;\n}\n\nfunction equals(a, b, strict) {\n\tif (a.type !== b.type) return undefined;\n\tif (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value;\n}\n\nconst operators = {\n\t'==': x => {\n\t\treturn equals(x.left, x.right, false);\n\t},\n\n\t'!=': x => not(operators['=='](x)),\n\n\t'===': x => {\n\t\treturn equals(x.left, x.right, true);\n\t},\n\n\t'!==': x => not(operators['==='](x)),\n\n\t'!': x => isFalsy(x.argument),\n\n\t'&&': x => isTruthy(x.left) && isTruthy(x.right),\n\n\t'||': x => isTruthy(x.left) || isTruthy(x.right)\n};\n","import { walk } from 'estree-walker';\nimport MagicString from 'magic-string';\nimport { attachScopes, makeLegalIdentifier } from 'rollup-pluginutils';\nimport { extractNames, flatten, isFalsy, isReference, isTruthy } from './ast-utils.js';\nimport { HELPERS_ID, PROXY_PREFIX } from './helpers.js';\nimport { getName } from './utils.js';\n\nconst reserved = 'process location abstract arguments boolean break byte case catch char class const continue debugger default delete do double else enum eval export extends false final finally float for from function goto if implements import in instanceof int interface let long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with yield'.split(\n\t' '\n);\nconst blacklist = { __esModule: true };\nreserved.forEach(word => (blacklist[word] = true));\n\nconst exportsPattern = /^(?:module\\.)?exports(?:\\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/;\n\nconst firstpassGlobal = /\\b(?:require|module|exports|global)\\b/;\nconst firstpassNoGlobal = /\\b(?:require|module|exports)\\b/;\nconst importExportDeclaration = /^(?:Import|Export(?:Named|Default))Declaration/;\nconst functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;\n\nfunction deconflict(scope, globals, identifier) {\n\tlet i = 1;\n\tlet deconflicted = identifier;\n\n\twhile (scope.contains(deconflicted) || globals.has(deconflicted) || deconflicted in blacklist)\n\t\tdeconflicted = `${identifier}_${i++}`;\n\tscope.declarations[deconflicted] = true;\n\n\treturn deconflicted;\n}\n\nfunction tryParse(parse, code, id) {\n\ttry {\n\t\treturn parse(code, { allowReturnOutsideFunction: true });\n\t} catch (err) {\n\t\terr.message += ` in ${id}`;\n\t\tthrow err;\n\t}\n}\n\nexport function hasCjsKeywords(code, ignoreGlobal) {\n\tconst firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal;\n\treturn firstpass.test(code);\n}\n\nexport function checkEsModule(parse, code, id) {\n\tconst ast = tryParse(parse, code, id);\n\n\tlet isEsModule = false;\n\tfor (const node of ast.body) {\n\t\tif (node.type === 'ExportDefaultDeclaration')\n\t\t\treturn { isEsModule: true, hasDefaultExport: true, ast };\n\t\tif (node.type === 'ExportNamedDeclaration') {\n\t\t\tisEsModule = true;\n\t\t\tfor (const specifier of node.specifiers) {\n\t\t\t\tif (specifier.exported.name === 'default') {\n\t\t\t\t\treturn { isEsModule: true, hasDefaultExport: true, ast };\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (importExportDeclaration.test(node.type)) isEsModule = true;\n\t}\n\n\treturn { isEsModule, hasDefaultExport: false, ast };\n}\n\nexport function transformCommonjs(\n\tparse,\n\tcode,\n\tid,\n\tisEntry,\n\tignoreGlobal,\n\tignoreRequire,\n\tcustomNamedExports,\n\tsourceMap,\n\tallowDynamicRequire,\n\tastCache\n) {\n\tconst ast = astCache || tryParse(parse, code, id);\n\n\tconst magicString = new MagicString(code);\n\n\tconst required = {};\n\t// Because objects have no guaranteed ordering, yet we need it,\n\t// we need to keep track of the order in a array\n\tconst sources = [];\n\n\tlet uid = 0;\n\n\tlet scope = attachScopes(ast, 'scope');\n\tconst uses = { module: false, exports: false, global: false, require: false };\n\n\tlet lexicalDepth = 0;\n\tlet programDepth = 0;\n\n\tconst globals = new Set();\n\n\tconst HELPERS_NAME = deconflict(scope, globals, 'commonjsHelpers'); // TODO technically wrong since globals isn't populated yet, but ¯\\_(ツ)_/¯\n\n\tconst namedExports = {};\n\n\t// TODO handle transpiled modules\n\tlet shouldWrap = /__esModule/.test(code);\n\n\tfunction isRequireStatement(node) {\n\t\tif (!node) return;\n\t\tif (node.type !== 'CallExpression') return;\n\t\tif (node.callee.name !== 'require' || scope.contains('require')) return;\n\t\tif (node.arguments.length === 0) return; // Weird case of require() without arguments\n\t\treturn true;\n\t}\n\n\tfunction hasDynamicArguments(node) {\n\t\treturn (\n\t\t\tnode.arguments.length > 1 ||\n\t\t\t(node.arguments[0].type !== 'Literal' &&\n\t\t\t\t(node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0))\n\t\t);\n\t}\n\n\tfunction isStaticRequireStatement(node) {\n\t\tif (!isRequireStatement(node)) return;\n\t\tif (hasDynamicArguments(node)) return;\n\t\tif (ignoreRequire(node.arguments[0].value)) return;\n\t\treturn true;\n\t}\n\n\tfunction getRequireStringArg(node) {\n\t\treturn node.arguments[0].type === 'Literal'\n\t\t\t? node.arguments[0].value\n\t\t\t: node.arguments[0].quasis[0].value.cooked;\n\t}\n\n\tfunction getRequired(node, name) {\n\t\tconst sourceId = getRequireStringArg(node);\n\t\tconst existing = required[sourceId];\n\t\tif (existing === undefined) {\n\t\t\tif (!name) {\n\t\t\t\tdo name = `require$$${uid++}`;\n\t\t\t\twhile (scope.contains(name));\n\t\t\t}\n\n\t\t\tsources.push(sourceId);\n\t\t\trequired[sourceId] = { source: sourceId, name, importsDefault: false };\n\t\t}\n\n\t\treturn required[sourceId];\n\t}\n\n\t// do a first pass, see which names are assigned to. This is necessary to prevent\n\t// illegally replacing `var foo = require('foo')` with `import foo from 'foo'`,\n\t// where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh)\n\tconst assignedTo = new Set();\n\twalk(ast, {\n\t\tenter(node) {\n\t\t\tif (node.type !== 'AssignmentExpression') return;\n\t\t\tif (node.left.type === 'MemberExpression') return;\n\n\t\t\textractNames(node.left).forEach(name => {\n\t\t\t\tassignedTo.add(name);\n\t\t\t});\n\t\t}\n\t});\n\n\twalk(ast, {\n\t\tenter(node, parent) {\n\t\t\tif (sourceMap) {\n\t\t\t\tmagicString.addSourcemapLocation(node.start);\n\t\t\t\tmagicString.addSourcemapLocation(node.end);\n\t\t\t}\n\n\t\t\t// skip dead branches\n\t\t\tif (parent && (parent.type === 'IfStatement' || parent.type === 'ConditionalExpression')) {\n\t\t\t\tif (node === parent.consequent && isFalsy(parent.test)) return this.skip();\n\t\t\t\tif (node === parent.alternate && isTruthy(parent.test)) return this.skip();\n\t\t\t}\n\n\t\t\tif (node._skip) return this.skip();\n\n\t\t\tprogramDepth += 1;\n\n\t\t\tif (node.scope) scope = node.scope;\n\t\t\tif (functionType.test(node.type)) lexicalDepth += 1;\n\n\t\t\t// if toplevel return, we need to wrap it\n\t\t\tif (node.type === 'ReturnStatement' && lexicalDepth === 0) {\n\t\t\t\tshouldWrap = true;\n\t\t\t}\n\n\t\t\t// rewrite `this` as `commonjsHelpers.commonjsGlobal`\n\t\t\tif (node.type === 'ThisExpression' && lexicalDepth === 0) {\n\t\t\t\tuses.global = true;\n\t\t\t\tif (!ignoreGlobal)\n\t\t\t\t\tmagicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {\n\t\t\t\t\t\tstoreName: true\n\t\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151)\n\t\t\tif (node.type === 'UnaryExpression' && node.operator === 'typeof') {\n\t\t\t\tconst flattened = flatten(node.argument);\n\t\t\t\tif (!flattened) return;\n\n\t\t\t\tif (scope.contains(flattened.name)) return;\n\n\t\t\t\tif (\n\t\t\t\t\tflattened.keypath === 'module.exports' ||\n\t\t\t\t\tflattened.keypath === 'module' ||\n\t\t\t\t\tflattened.keypath === 'exports'\n\t\t\t\t) {\n\t\t\t\t\tmagicString.overwrite(node.start, node.end, `'object'`, { storeName: false });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// rewrite `require` (if not already handled) `global` and `define`, and handle free references to\n\t\t\t// `module` and `exports` as these mean we need to wrap the module in commonjsHelpers.createCommonjsModule\n\t\t\tif (node.type === 'Identifier') {\n\t\t\t\tif (isReference(node, parent) && !scope.contains(node.name)) {\n\t\t\t\t\tif (node.name in uses) {\n\t\t\t\t\t\tif (node.name === 'require') {\n\t\t\t\t\t\t\tif (allowDynamicRequire) return;\n\t\t\t\t\t\t\tmagicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {\n\t\t\t\t\t\t\t\tstoreName: true\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tuses[node.name] = true;\n\t\t\t\t\t\tif (node.name === 'global' && !ignoreGlobal) {\n\t\t\t\t\t\t\tmagicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {\n\t\t\t\t\t\t\t\tstoreName: true\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if module or exports are used outside the context of an assignment\n\t\t\t\t\t\t// expression, we need to wrap the module\n\t\t\t\t\t\tif (node.name === 'module' || node.name === 'exports') {\n\t\t\t\t\t\t\tshouldWrap = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (node.name === 'define') {\n\t\t\t\t\t\tmagicString.overwrite(node.start, node.end, 'undefined', { storeName: true });\n\t\t\t\t\t}\n\n\t\t\t\t\tglobals.add(node.name);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Is this an assignment to exports or module.exports?\n\t\t\tif (node.type === 'AssignmentExpression') {\n\t\t\t\tif (node.left.type !== 'MemberExpression') return;\n\n\t\t\t\tconst flattened = flatten(node.left);\n\t\t\t\tif (!flattened) return;\n\n\t\t\t\tif (scope.contains(flattened.name)) return;\n\n\t\t\t\tconst match = exportsPattern.exec(flattened.keypath);\n\t\t\t\tif (!match || flattened.keypath === 'exports') return;\n\n\t\t\t\tuses[flattened.name] = true;\n\n\t\t\t\t// we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` –\n\t\t\t\t// if this isn't top-level, we'll need to wrap the module\n\t\t\t\tif (programDepth > 3) shouldWrap = true;\n\n\t\t\t\tnode.left._skip = true;\n\n\t\t\t\tif (flattened.keypath === 'module.exports' && node.right.type === 'ObjectExpression') {\n\t\t\t\t\treturn node.right.properties.forEach(prop => {\n\t\t\t\t\t\tif (prop.computed || prop.key.type !== 'Identifier') return;\n\t\t\t\t\t\tconst name = prop.key.name;\n\t\t\t\t\t\tif (name === makeLegalIdentifier(name)) namedExports[name] = true;\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (match[1]) namedExports[match[1]] = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// if this is `var x = require('x')`, we can do `import x from 'x'`\n\t\t\tif (\n\t\t\t\tnode.type === 'VariableDeclarator' &&\n\t\t\t\tnode.id.type === 'Identifier' &&\n\t\t\t\tisStaticRequireStatement(node.init)\n\t\t\t) {\n\t\t\t\t// for now, only do this for top-level requires. maybe fix this in future\n\t\t\t\tif (scope.parent) return;\n\n\t\t\t\t// edge case — CJS allows you to assign to imports. ES doesn't\n\t\t\t\tif (assignedTo.has(node.id.name)) return;\n\n\t\t\t\tconst required = getRequired(node.init, node.id.name);\n\t\t\t\trequired.importsDefault = true;\n\n\t\t\t\tif (required.name === node.id.name) {\n\t\t\t\t\tnode._shouldRemove = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!isStaticRequireStatement(node)) return;\n\n\t\t\tconst required = getRequired(node);\n\n\t\t\tif (parent.type === 'ExpressionStatement') {\n\t\t\t\t// is a bare import, e.g. `require('foo');`\n\t\t\t\tmagicString.remove(parent.start, parent.end);\n\t\t\t} else {\n\t\t\t\trequired.importsDefault = true;\n\t\t\t\tmagicString.overwrite(node.start, node.end, required.name);\n\t\t\t}\n\n\t\t\tnode.callee._skip = true;\n\t\t},\n\n\t\tleave(node) {\n\t\t\tprogramDepth -= 1;\n\t\t\tif (node.scope) scope = scope.parent;\n\t\t\tif (functionType.test(node.type)) lexicalDepth -= 1;\n\n\t\t\tif (node.type === 'VariableDeclaration') {\n\t\t\t\tlet keepDeclaration = false;\n\t\t\t\tlet c = node.declarations[0].start;\n\n\t\t\t\tfor (let i = 0; i < node.declarations.length; i += 1) {\n\t\t\t\t\tconst declarator = node.declarations[i];\n\n\t\t\t\t\tif (declarator._shouldRemove) {\n\t\t\t\t\t\tmagicString.remove(c, declarator.end);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!keepDeclaration) {\n\t\t\t\t\t\t\tmagicString.remove(c, declarator.start);\n\t\t\t\t\t\t\tkeepDeclaration = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tc = declarator.end;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!keepDeclaration) {\n\t\t\t\t\tmagicString.remove(node.start, node.end);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\tif (\n\t\t!sources.length &&\n\t\t!uses.module &&\n\t\t!uses.exports &&\n\t\t!uses.require &&\n\t\t(ignoreGlobal || !uses.global)\n\t) {\n\t\tif (Object.keys(namedExports).length) {\n\t\t\tthrow new Error(\n\t\t\t\t`Custom named exports were specified for ${id} but it does not appear to be a CommonJS module`\n\t\t\t);\n\t\t}\n\t\treturn null; // not a CommonJS module\n\t}\n\n\tconst includeHelpers = shouldWrap || uses.global || uses.require;\n\tconst importBlock =\n\t\t(includeHelpers ? [`import * as ${HELPERS_NAME} from '${HELPERS_ID}';`] : [])\n\t\t\t.concat(\n\t\t\t\tsources.map(source => {\n\t\t\t\t\t// import the actual module before the proxy, so that we know\n\t\t\t\t\t// what kind of proxy to build\n\t\t\t\t\treturn `import '${source}';`;\n\t\t\t\t}),\n\t\t\t\tsources.map(source => {\n\t\t\t\t\tconst { name, importsDefault } = required[source];\n\t\t\t\t\treturn `import ${importsDefault ? `${name} from ` : ``}'${PROXY_PREFIX}${source}';`;\n\t\t\t\t})\n\t\t\t)\n\t\t\t.join('\\n') + '\\n\\n';\n\n\tconst namedExportDeclarations = [];\n\tlet wrapperStart = '';\n\tlet wrapperEnd = '';\n\n\tconst moduleName = deconflict(scope, globals, getName(id));\n\tif (!isEntry) {\n\t\tconst exportModuleExports = {\n\t\t\tstr: `export { ${moduleName} as __moduleExports };`,\n\t\t\tname: '__moduleExports'\n\t\t};\n\n\t\tnamedExportDeclarations.push(exportModuleExports);\n\t}\n\n\tconst name = getName(id);\n\n\tfunction addExport(x) {\n\t\tconst deconflicted = deconflict(scope, globals, name);\n\n\t\tconst declaration =\n\t\t\tdeconflicted === name\n\t\t\t\t? `export var ${x} = ${moduleName}.${x};`\n\t\t\t\t: `var ${deconflicted} = ${moduleName}.${x};\\nexport { ${deconflicted} as ${x} };`;\n\n\t\tnamedExportDeclarations.push({\n\t\t\tstr: declaration,\n\t\t\tname: x\n\t\t});\n\t}\n\n\tif (customNamedExports) customNamedExports.forEach(addExport);\n\n\tconst defaultExportPropertyAssignments = [];\n\tlet hasDefaultExport = false;\n\n\tif (shouldWrap) {\n\t\tconst args = `module${uses.exports ? ', exports' : ''}`;\n\n\t\twrapperStart = `var ${moduleName} = ${HELPERS_NAME}.createCommonjsModule(function (${args}) {\\n`;\n\t\twrapperEnd = `\\n});`;\n\t} else {\n\t\tconst names = [];\n\n\t\tast.body.forEach(node => {\n\t\t\tif (node.type === 'ExpressionStatement' && node.expression.type === 'AssignmentExpression') {\n\t\t\t\tconst left = node.expression.left;\n\t\t\t\tconst flattened = flatten(left);\n\n\t\t\t\tif (!flattened) return;\n\n\t\t\t\tconst match = exportsPattern.exec(flattened.keypath);\n\t\t\t\tif (!match) return;\n\n\t\t\t\tif (flattened.keypath === 'module.exports') {\n\t\t\t\t\thasDefaultExport = true;\n\t\t\t\t\tmagicString.overwrite(left.start, left.end, `var ${moduleName}`);\n\t\t\t\t} else {\n\t\t\t\t\tconst name = match[1];\n\t\t\t\t\tconst deconflicted = deconflict(scope, globals, name);\n\n\t\t\t\t\tnames.push({ name, deconflicted });\n\n\t\t\t\t\tmagicString.overwrite(node.start, left.end, `var ${deconflicted}`);\n\n\t\t\t\t\tconst declaration =\n\t\t\t\t\t\tname === deconflicted\n\t\t\t\t\t\t\t? `export { ${name} };`\n\t\t\t\t\t\t\t: `export { ${deconflicted} as ${name} };`;\n\n\t\t\t\t\tif (name !== 'default') {\n\t\t\t\t\t\tnamedExportDeclarations.push({\n\t\t\t\t\t\t\tstr: declaration,\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t});\n\t\t\t\t\t\tdelete namedExports[name];\n\t\t\t\t\t}\n\n\t\t\t\t\tdefaultExportPropertyAssignments.push(`${moduleName}.${name} = ${deconflicted};`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (!hasDefaultExport) {\n\t\t\twrapperEnd = `\\n\\nvar ${moduleName} = {\\n${names\n\t\t\t\t.map(({ name, deconflicted }) => `\\t${name}: ${deconflicted}`)\n\t\t\t\t.join(',\\n')}\\n};`;\n\t\t}\n\t}\n\tObject.keys(namedExports)\n\t\t.filter(key => !blacklist[key])\n\t\t.forEach(addExport);\n\n\tconst defaultExport = /__esModule/.test(code)\n\t\t? `export default ${HELPERS_NAME}.unwrapExports(${moduleName});`\n\t\t: `export default ${moduleName};`;\n\n\tconst named = namedExportDeclarations\n\t\t.filter(x => x.name !== 'default' || !hasDefaultExport)\n\t\t.map(x => x.str);\n\n\tconst exportBlock =\n\t\t'\\n\\n' +\n\t\t[defaultExport]\n\t\t\t.concat(named)\n\t\t\t.concat(hasDefaultExport ? defaultExportPropertyAssignments : [])\n\t\t\t.join('\\n');\n\n\tmagicString\n\t\t.trim()\n\t\t.prepend(importBlock + wrapperStart)\n\t\t.trim()\n\t\t.append(wrapperEnd + exportBlock);\n\n\tcode = magicString.toString();\n\tconst map = sourceMap ? magicString.generateMap() : null;\n\n\treturn { code, map };\n}\n","import { extname, resolve } from 'path';\nimport { sync as nodeResolveSync } from 'resolve';\nimport { createFilter } from 'rollup-pluginutils';\nimport { EXTERNAL_PREFIX, HELPERS, HELPERS_ID, PROXY_PREFIX } from './helpers.js';\nimport { getIsCjsPromise, setIsCjsPromise } from './is-cjs';\nimport { getResolveId } from './resolve-id';\nimport { checkEsModule, hasCjsKeywords, transformCommonjs } from './transform.js';\nimport { getName } from './utils.js';\n\nexport default function commonjs(options = {}) {\n\tconst extensions = options.extensions || ['.js'];\n\tconst filter = createFilter(options.include, options.exclude);\n\tconst ignoreGlobal = options.ignoreGlobal;\n\n\tconst customNamedExports = {};\n\tif (options.namedExports) {\n\t\tObject.keys(options.namedExports).forEach(id => {\n\t\t\tlet resolvedId;\n\n\t\t\ttry {\n\t\t\t\tresolvedId = nodeResolveSync(id, { basedir: process.cwd() });\n\t\t\t} catch (err) {\n\t\t\t\tresolvedId = resolve(id);\n\t\t\t}\n\n\t\t\tcustomNamedExports[resolvedId] = options.namedExports[id];\n\t\t});\n\t}\n\n\tconst esModulesWithoutDefaultExport = Object.create(null);\n\tconst esModulesWithDefaultExport = Object.create(null);\n\tconst allowDynamicRequire = !!options.ignore; // TODO maybe this should be configurable?\n\n\tconst ignoreRequire =\n\t\ttypeof options.ignore === 'function'\n\t\t\t? options.ignore\n\t\t\t: Array.isArray(options.ignore)\n\t\t\t\t? id => options.ignore.includes(id)\n\t\t\t\t: () => false;\n\n\tlet entryModuleIdsPromise = null;\n\n\tconst resolveId = getResolveId(extensions);\n\n\tconst sourceMap = options.sourceMap !== false;\n\n\treturn {\n\t\tname: 'commonjs',\n\n\t\toptions(options) {\n\t\t\tresolveId.setRollupOptions(options);\n\t\t\tconst input = options.input || options.entry;\n\t\t\tconst entryModules = Array.isArray(input)\n\t\t\t\t? input\n\t\t\t\t: typeof input === 'object' && input !== null\n\t\t\t\t\t? Object.values(input)\n\t\t\t\t\t: [input];\n\t\t\tentryModuleIdsPromise = Promise.all(entryModules.map(entry => resolveId(entry)));\n\t\t},\n\n\t\tresolveId,\n\n\t\tload(id) {\n\t\t\tif (id === HELPERS_ID) return HELPERS;\n\n\t\t\t// generate proxy modules\n\t\t\tif (id.startsWith(EXTERNAL_PREFIX)) {\n\t\t\t\tconst actualId = id.slice(EXTERNAL_PREFIX.length);\n\t\t\t\tconst name = getName(actualId);\n\n\t\t\t\treturn `import ${name} from ${JSON.stringify(actualId)}; export default ${name};`;\n\t\t\t}\n\n\t\t\tif (id.startsWith(PROXY_PREFIX)) {\n\t\t\t\tconst actualId = id.slice(PROXY_PREFIX.length);\n\t\t\t\tconst name = getName(actualId);\n\n\t\t\t\treturn getIsCjsPromise(actualId).then(isCjs => {\n\t\t\t\t\tif (isCjs)\n\t\t\t\t\t\treturn `import { __moduleExports } from ${JSON.stringify(\n\t\t\t\t\t\t\tactualId\n\t\t\t\t\t\t)}; export default __moduleExports;`;\n\t\t\t\t\telse if (esModulesWithoutDefaultExport[actualId])\n\t\t\t\t\t\treturn `import * as ${name} from ${JSON.stringify(actualId)}; export default ${name};`;\n\t\t\t\t\telse if (esModulesWithDefaultExport[actualId]) {\n\t\t\t\t\t\treturn `export {default} from ${JSON.stringify(actualId)};`;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\treturn `import * as ${name} from ${JSON.stringify(\n\t\t\t\t\t\t\tactualId\n\t\t\t\t\t\t)}; import {getCjsExportFromNamespace} from \"${HELPERS_ID}\"; export default getCjsExportFromNamespace(${name})`;\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\n\t\ttransform(code, id) {\n\t\t\tif (!filter(id) || extensions.indexOf(extname(id)) === -1) {\n\t\t\t\tsetIsCjsPromise(id, Promise.resolve(null));\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst transformPromise = entryModuleIdsPromise\n\t\t\t\t.then(entryModuleIds => {\n\t\t\t\t\tconst { isEsModule, hasDefaultExport, ast } = checkEsModule(this.parse, code, id);\n\t\t\t\t\tif (isEsModule) {\n\t\t\t\t\t\t(hasDefaultExport ? esModulesWithDefaultExport : esModulesWithoutDefaultExport)[id] = true;\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// it is not an ES module but it does not have CJS-specific elements.\n\t\t\t\t\tif (!hasCjsKeywords(code, ignoreGlobal)) {\n\t\t\t\t\t\tesModulesWithoutDefaultExport[id] = true;\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst transformed = transformCommonjs(\n\t\t\t\t\t\tthis.parse,\n\t\t\t\t\t\tcode,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tentryModuleIds.indexOf(id) !== -1,\n\t\t\t\t\t\tignoreGlobal,\n\t\t\t\t\t\tignoreRequire,\n\t\t\t\t\t\tcustomNamedExports[id],\n\t\t\t\t\t\tsourceMap,\n\t\t\t\t\t\tallowDynamicRequire,\n\t\t\t\t\t\tast\n\t\t\t\t\t);\n\t\t\t\t\tif (!transformed) {\n\t\t\t\t\t\tesModulesWithoutDefaultExport[id] = true;\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn transformed;\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tthis.error(err, err.loc);\n\t\t\t\t});\n\n\t\t\tsetIsCjsPromise(id, transformPromise.then(Boolean, () => false));\n\t\t\treturn transformPromise;\n\t\t}\n\t};\n}\n"],"names":["const","let","resolve","fs.statSync","flattened","required","nodeResolveSync","options","actualId","name","this"],"mappings":";;;;;;;AAAOA,IAAM,YAAY,GAAG,mBAAmB,CAAC;AAChD,AAAOA,IAAM,eAAe,GAAG,sBAAsB,CAAC;AACtD,AAAOA,IAAM,UAAU,GAAG,mBAAmB,CAAC;;AAE9C,AAAOA,IAAM,OAAO,GAAG,8oBAiBrB,CAAC;;ACrBHA,IAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;;AAE1C,AAAO,SAAS,eAAe,CAAC,EAAE,EAAE;CACnCC,IAAI,YAAY,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;CACrC,IAAI,YAAY,IAAE,OAAO,YAAY,CAAC,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EAAE;MACf,CAAC,gBAAgB,GAAG,0BAA0B,GAAG,6BAA6B,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC;MAC3F,OAAO,IAAI,CAAC;MACZ;;;KAGD,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE;MACxC,6BAA6B,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;MACzC,OAAO,IAAI,CAAC;MACZ;;KAEDV,IAAM,WAAW,GAAG,iBAAiB;MACpCU,MAAI,CAAC,KAAK;MACV,IAAI;MACJ,EAAE;MACF,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;MACjC,YAAY;MACZ,aAAa;MACb,kBAAkB,CAAC,EAAE,CAAC;MACtB,SAAS;MACT,mBAAmB;MACnB,GAAG;MACH,CAAC;KACF,IAAI,CAAC,WAAW,EAAE;MACjB,6BAA6B,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;MACzC,OAAO,IAAI,CAAC;MACZ;;KAED,OAAO,WAAW,CAAC;KACnB,CAAC;KACD,KAAK,WAAC,KAAI;KACVA,MAAI,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;KACzB,CAAC,CAAC;;GAEJ,eAAe,CAAC,EAAE,EAAE,gBAAgB,CAAC,IAAI,CAAC,OAAO,cAAK,SAAG,QAAK,CAAC,CAAC,CAAC;GACjE,OAAO,gBAAgB,CAAC;GACxB;EACD,CAAC;CACF;;;;"} \ No newline at end of file +{"version":3,"file":"rollup-plugin-commonjs.es.js","sources":["../src/helpers.js","../src/is-cjs.js","../src/default-resolver.js","../src/utils.js","../src/resolve-id.js","../src/ast-utils.js","../src/transform.js","../src/index.js"],"sourcesContent":["export const PROXY_PREFIX = '\\0commonjs-proxy:';\nexport const EXTERNAL_PREFIX = '\\0commonjs-external:';\nexport const HELPERS_ID = '\\0commonjsHelpers';\n\nexport const HELPERS = `\nexport var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nexport function commonjsRequire () {\n\tthrow new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');\n}\n\nexport function unwrapExports (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x.default : x;\n}\n\nexport function createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nexport function getCjsExportFromNamespace (n) {\n\treturn n && n.default || n;\n}`;\n","const isCjsPromises = Object.create(null);\n\nexport function getIsCjsPromise(id) {\n\tlet isCjsPromise = isCjsPromises[id];\n\tif (isCjsPromise) return isCjsPromise.promise;\n\n\tconst promise = new Promise(resolve => {\n\t\tisCjsPromises[id] = isCjsPromise = {\n\t\t\tresolve,\n\t\t\tpromise: undefined\n\t\t};\n\t});\n\tisCjsPromise.promise = promise;\n\n\treturn promise;\n}\n\nexport function setIsCjsPromise(id, promise) {\n\tconst isCjsPromise = isCjsPromises[id];\n\tif (isCjsPromise) {\n\t\tif (isCjsPromise.resolve) {\n\t\t\tisCjsPromise.resolve(promise);\n\t\t\tisCjsPromise.resolve = undefined;\n\t\t}\n\t} else {\n\t\tisCjsPromises[id] = { promise, resolve: undefined };\n\t}\n}\n","import * as fs from 'fs';\nimport { dirname, resolve } from 'path';\n\nfunction isFile(file) {\n\ttry {\n\t\tconst stats = fs.statSync(file);\n\t\treturn stats.isFile();\n\t} catch (err) {\n\t\treturn false;\n\t}\n}\n\nfunction addJsExtensionIfNecessary(file) {\n\tif (isFile(file)) return file;\n\n\tfile += '.js';\n\tif (isFile(file)) return file;\n\n\treturn null;\n}\n\nconst absolutePath = /^(?:\\/|(?:[A-Za-z]:)?[\\\\|/])/;\n\nfunction isAbsolute(path) {\n\treturn absolutePath.test(path);\n}\n\nexport default function defaultResolver(importee, importer) {\n\t// absolute paths are left untouched\n\tif (isAbsolute(importee)) return addJsExtensionIfNecessary(resolve(importee));\n\n\t// if this is the entry point, resolve against cwd\n\tif (importer === undefined) return addJsExtensionIfNecessary(resolve(process.cwd(), importee));\n\n\t// external modules are skipped at this stage\n\tif (importee[0] !== '.') return null;\n\n\treturn addJsExtensionIfNecessary(resolve(dirname(importer), importee));\n}\n","import { basename, dirname, extname, sep } from 'path';\nimport { makeLegalIdentifier } from 'rollup-pluginutils';\n\nexport function getName(id) {\n\tconst name = makeLegalIdentifier(basename(id, extname(id)));\n\tif (name !== 'index') {\n\t\treturn name;\n\t} else {\n\t\tconst segments = dirname(id).split(sep);\n\t\treturn makeLegalIdentifier(segments[segments.length - 1]);\n\t}\n}\n\n// Return the first non-falsy result from an array of\n// maybe-sync, maybe-promise-returning functions\nexport function first(candidates) {\n\treturn function(...args) {\n\t\treturn candidates.reduce((promise, candidate) => {\n\t\t\treturn promise.then(\n\t\t\t\tresult => (result != null ? result : Promise.resolve(candidate.call(this, ...args)))\n\t\t\t);\n\t\t}, Promise.resolve());\n\t};\n}\n","import { statSync } from 'fs';\nimport { dirname, resolve, sep } from 'path';\nimport defaultResolver from './default-resolver';\nimport { EXTERNAL_PREFIX, PROXY_PREFIX } from './helpers';\nimport { first } from './utils';\n\nfunction getCandidatesForExtension(resolved, extension) {\n\treturn [resolved + extension, resolved + `${sep}index${extension}`];\n}\n\nfunction getCandidates(resolved, extensions) {\n\treturn extensions.reduce(\n\t\t(paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)),\n\t\t[resolved]\n\t);\n}\n\nexport function getResolveId(extensions) {\n\tlet resolveUsingOtherResolvers;\n\n\tfunction resolveId(importee, importer) {\n\t\tconst isProxyModule = importee.startsWith(PROXY_PREFIX);\n\t\tif (isProxyModule) {\n\t\t\timportee = importee.slice(PROXY_PREFIX.length);\n\t\t} else if (importee.startsWith('\\0')) {\n\t\t\treturn importee;\n\t\t}\n\n\t\tif (importer && importer.startsWith(PROXY_PREFIX)) {\n\t\t\timporter = importer.slice(PROXY_PREFIX.length);\n\t\t}\n\n\t\treturn resolveUsingOtherResolvers.call(this, importee, importer).then(resolved => {\n\t\t\tif (resolved) return isProxyModule ? PROXY_PREFIX + resolved : resolved;\n\n\t\t\tresolved = defaultResolver(importee, importer);\n\n\t\t\tif (isProxyModule) {\n\t\t\t\tif (resolved) return PROXY_PREFIX + resolved;\n\t\t\t\treturn EXTERNAL_PREFIX + importee; // external\n\t\t\t}\n\n\t\t\treturn resolved;\n\t\t});\n\t}\n\n\tresolveId.setRollupOptions = function(options) {\n\t\tconst resolvers = (options.plugins || [])\n\t\t\t.map(plugin => {\n\t\t\t\tif (plugin.resolveId === resolveId) {\n\t\t\t\t\t// substitute CommonJS resolution logic\n\t\t\t\t\treturn (importee, importer) => {\n\t\t\t\t\t\tif (importee[0] !== '.' || !importer) return; // not our problem\n\n\t\t\t\t\t\tconst resolved = resolve(dirname(importer), importee);\n\t\t\t\t\t\tconst candidates = getCandidates(resolved, extensions);\n\n\t\t\t\t\t\tfor (let i = 0; i < candidates.length; i += 1) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst stats = statSync(candidates[i]);\n\t\t\t\t\t\t\t\tif (stats.isFile()) return candidates[i];\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t/* noop */\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn plugin.resolveId;\n\t\t\t})\n\t\t\t.filter(Boolean);\n\n\t\tconst isExternal = id =>\n\t\t\toptions.external\n\t\t\t\t? Array.isArray(options.external)\n\t\t\t\t\t? options.external.includes(id)\n\t\t\t\t\t: options.external(id)\n\t\t\t\t: false;\n\n\t\tresolvers.unshift(id => (isExternal(id) ? false : null));\n\n\t\tresolveUsingOtherResolvers = first(resolvers);\n\t};\n\n\treturn resolveId;\n}\n","export function isReference(node, parent) {\n\tif (parent.type === 'MemberExpression') return parent.computed || node === parent.object;\n\n\t// disregard the `bar` in { bar: foo }\n\tif (parent.type === 'Property' && node !== parent.value) return false;\n\n\t// disregard the `bar` in `class Foo { bar () {...} }`\n\tif (parent.type === 'MethodDefinition') return false;\n\n\t// disregard the `bar` in `export { foo as bar }`\n\tif (parent.type === 'ExportSpecifier' && node !== parent.local) return false;\n\n\treturn true;\n}\n\nexport function flatten(node) {\n\tconst parts = [];\n\n\twhile (node.type === 'MemberExpression') {\n\t\tif (node.computed) return null;\n\n\t\tparts.unshift(node.property.name);\n\t\tnode = node.object;\n\t}\n\n\tif (node.type !== 'Identifier') return null;\n\n\tconst name = node.name;\n\tparts.unshift(name);\n\n\treturn { name, keypath: parts.join('.') };\n}\n\nexport function extractNames(node) {\n\tconst names = [];\n\textractors[node.type](names, node);\n\treturn names;\n}\n\nconst extractors = {\n\tIdentifier(names, node) {\n\t\tnames.push(node.name);\n\t},\n\n\tObjectPattern(names, node) {\n\t\tnode.properties.forEach(prop => {\n\t\t\textractors[prop.value.type](names, prop.value);\n\t\t});\n\t},\n\n\tArrayPattern(names, node) {\n\t\tnode.elements.forEach(element => {\n\t\t\tif (element) extractors[element.type](names, element);\n\t\t});\n\t},\n\n\tRestElement(names, node) {\n\t\textractors[node.argument.type](names, node.argument);\n\t},\n\n\tAssignmentPattern(names, node) {\n\t\textractors[node.left.type](names, node.left);\n\t}\n};\n\nexport function isTruthy(node) {\n\tif (node.type === 'Literal') return !!node.value;\n\tif (node.type === 'ParenthesizedExpression') return isTruthy(node.expression);\n\tif (node.operator in operators) return operators[node.operator](node);\n}\n\nexport function isFalsy(node) {\n\treturn not(isTruthy(node));\n}\n\nfunction not(value) {\n\treturn value === undefined ? value : !value;\n}\n\nfunction equals(a, b, strict) {\n\tif (a.type !== b.type) return undefined;\n\tif (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value;\n}\n\nconst operators = {\n\t'==': x => {\n\t\treturn equals(x.left, x.right, false);\n\t},\n\n\t'!=': x => not(operators['=='](x)),\n\n\t'===': x => {\n\t\treturn equals(x.left, x.right, true);\n\t},\n\n\t'!==': x => not(operators['==='](x)),\n\n\t'!': x => isFalsy(x.argument),\n\n\t'&&': x => isTruthy(x.left) && isTruthy(x.right),\n\n\t'||': x => isTruthy(x.left) || isTruthy(x.right)\n};\n","import { walk } from 'estree-walker';\nimport MagicString from 'magic-string';\nimport { attachScopes, makeLegalIdentifier } from 'rollup-pluginutils';\nimport { extractNames, flatten, isFalsy, isReference, isTruthy } from './ast-utils.js';\nimport { HELPERS_ID, PROXY_PREFIX } from './helpers.js';\nimport { getName } from './utils.js';\n\nconst reserved = 'process location abstract arguments boolean break byte case catch char class const continue debugger default delete do double else enum eval export extends false final finally float for from function goto if implements import in instanceof int interface let long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with yield'.split(\n\t' '\n);\nconst blacklist = { __esModule: true };\nreserved.forEach(word => (blacklist[word] = true));\n\nconst exportsPattern = /^(?:module\\.)?exports(?:\\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/;\n\nconst firstpassGlobal = /\\b(?:require|module|exports|global)\\b/;\nconst firstpassNoGlobal = /\\b(?:require|module|exports)\\b/;\nconst importExportDeclaration = /^(?:Import|Export(?:Named|Default))Declaration/;\nconst functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;\n\nfunction deconflict(scope, globals, identifier) {\n\tlet i = 1;\n\tlet deconflicted = identifier;\n\n\twhile (scope.contains(deconflicted) || globals.has(deconflicted) || deconflicted in blacklist)\n\t\tdeconflicted = `${identifier}_${i++}`;\n\tscope.declarations[deconflicted] = true;\n\n\treturn deconflicted;\n}\n\nfunction tryParse(parse, code, id) {\n\ttry {\n\t\treturn parse(code, { allowReturnOutsideFunction: true });\n\t} catch (err) {\n\t\terr.message += ` in ${id}`;\n\t\tthrow err;\n\t}\n}\n\nexport function hasCjsKeywords(code, ignoreGlobal) {\n\tconst firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal;\n\treturn firstpass.test(code);\n}\n\nexport function checkEsModule(parse, code, id) {\n\tconst ast = tryParse(parse, code, id);\n\n\tlet isEsModule = false;\n\tfor (const node of ast.body) {\n\t\tif (node.type === 'ExportDefaultDeclaration')\n\t\t\treturn { isEsModule: true, hasDefaultExport: true, ast };\n\t\tif (node.type === 'ExportNamedDeclaration') {\n\t\t\tisEsModule = true;\n\t\t\tfor (const specifier of node.specifiers) {\n\t\t\t\tif (specifier.exported.name === 'default') {\n\t\t\t\t\treturn { isEsModule: true, hasDefaultExport: true, ast };\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (importExportDeclaration.test(node.type)) isEsModule = true;\n\t}\n\n\treturn { isEsModule, hasDefaultExport: false, ast };\n}\n\nexport function transformCommonjs(\n\tparse,\n\tcode,\n\tid,\n\tisEntry,\n\tignoreGlobal,\n\tignoreRequire,\n\tcustomNamedExports,\n\tsourceMap,\n\tallowDynamicRequire,\n\tastCache\n) {\n\tconst ast = astCache || tryParse(parse, code, id);\n\n\tconst magicString = new MagicString(code);\n\n\tconst required = {};\n\t// Because objects have no guaranteed ordering, yet we need it,\n\t// we need to keep track of the order in a array\n\tconst sources = [];\n\n\tlet uid = 0;\n\n\tlet scope = attachScopes(ast, 'scope');\n\tconst uses = { module: false, exports: false, global: false, require: false };\n\n\tlet lexicalDepth = 0;\n\tlet programDepth = 0;\n\n\tconst globals = new Set();\n\n\tconst HELPERS_NAME = deconflict(scope, globals, 'commonjsHelpers'); // TODO technically wrong since globals isn't populated yet, but ¯\\_(ツ)_/¯\n\n\tconst namedExports = {};\n\n\t// TODO handle transpiled modules\n\tlet shouldWrap = /__esModule/.test(code);\n\n\tfunction isRequireStatement(node) {\n\t\tif (!node) return;\n\t\tif (node.type !== 'CallExpression') return;\n\t\tif (node.callee.name !== 'require' || scope.contains('require')) return;\n\t\tif (node.arguments.length === 0) return; // Weird case of require() without arguments\n\t\treturn true;\n\t}\n\n\tfunction hasDynamicArguments(node) {\n\t\treturn (\n\t\t\tnode.arguments.length > 1 ||\n\t\t\t(node.arguments[0].type !== 'Literal' &&\n\t\t\t\t(node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0))\n\t\t);\n\t}\n\n\tfunction isStaticRequireStatement(node) {\n\t\tif (!isRequireStatement(node)) return;\n\t\tif (hasDynamicArguments(node)) return;\n\t\tif (ignoreRequire(node.arguments[0].value)) return;\n\t\treturn true;\n\t}\n\n\tfunction getRequireStringArg(node) {\n\t\treturn node.arguments[0].type === 'Literal'\n\t\t\t? node.arguments[0].value\n\t\t\t: node.arguments[0].quasis[0].value.cooked;\n\t}\n\n\tfunction getRequired(node, name) {\n\t\tconst sourceId = getRequireStringArg(node);\n\t\tconst existing = required[sourceId];\n\t\tif (existing === undefined) {\n\t\t\tif (!name) {\n\t\t\t\tdo name = `require$$${uid++}`;\n\t\t\t\twhile (scope.contains(name));\n\t\t\t}\n\n\t\t\tsources.push(sourceId);\n\t\t\trequired[sourceId] = { source: sourceId, name, importsDefault: false };\n\t\t}\n\n\t\treturn required[sourceId];\n\t}\n\n\t// do a first pass, see which names are assigned to. This is necessary to prevent\n\t// illegally replacing `var foo = require('foo')` with `import foo from 'foo'`,\n\t// where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh)\n\tconst assignedTo = new Set();\n\twalk(ast, {\n\t\tenter(node) {\n\t\t\tif (node.type !== 'AssignmentExpression') return;\n\t\t\tif (node.left.type === 'MemberExpression') return;\n\n\t\t\textractNames(node.left).forEach(name => {\n\t\t\t\tassignedTo.add(name);\n\t\t\t});\n\t\t}\n\t});\n\n\twalk(ast, {\n\t\tenter(node, parent) {\n\t\t\tif (sourceMap) {\n\t\t\t\tmagicString.addSourcemapLocation(node.start);\n\t\t\t\tmagicString.addSourcemapLocation(node.end);\n\t\t\t}\n\n\t\t\t// skip dead branches\n\t\t\tif (parent && (parent.type === 'IfStatement' || parent.type === 'ConditionalExpression')) {\n\t\t\t\tif (node === parent.consequent && isFalsy(parent.test)) return this.skip();\n\t\t\t\tif (node === parent.alternate && isTruthy(parent.test)) return this.skip();\n\t\t\t}\n\n\t\t\tif (node._skip) return this.skip();\n\n\t\t\tprogramDepth += 1;\n\n\t\t\tif (node.scope) scope = node.scope;\n\t\t\tif (functionType.test(node.type)) lexicalDepth += 1;\n\n\t\t\t// if toplevel return, we need to wrap it\n\t\t\tif (node.type === 'ReturnStatement' && lexicalDepth === 0) {\n\t\t\t\tshouldWrap = true;\n\t\t\t}\n\n\t\t\t// rewrite `this` as `commonjsHelpers.commonjsGlobal`\n\t\t\tif (node.type === 'ThisExpression' && lexicalDepth === 0) {\n\t\t\t\tuses.global = true;\n\t\t\t\tif (!ignoreGlobal)\n\t\t\t\t\tmagicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {\n\t\t\t\t\t\tstoreName: true\n\t\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151)\n\t\t\tif (node.type === 'UnaryExpression' && node.operator === 'typeof') {\n\t\t\t\tconst flattened = flatten(node.argument);\n\t\t\t\tif (!flattened) return;\n\n\t\t\t\tif (scope.contains(flattened.name)) return;\n\n\t\t\t\tif (\n\t\t\t\t\tflattened.keypath === 'module.exports' ||\n\t\t\t\t\tflattened.keypath === 'module' ||\n\t\t\t\t\tflattened.keypath === 'exports'\n\t\t\t\t) {\n\t\t\t\t\tmagicString.overwrite(node.start, node.end, `'object'`, { storeName: false });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// rewrite `require` (if not already handled) `global` and `define`, and handle free references to\n\t\t\t// `module` and `exports` as these mean we need to wrap the module in commonjsHelpers.createCommonjsModule\n\t\t\tif (node.type === 'Identifier') {\n\t\t\t\tif (isReference(node, parent) && !scope.contains(node.name)) {\n\t\t\t\t\tif (node.name in uses) {\n\t\t\t\t\t\tif (node.name === 'require') {\n\t\t\t\t\t\t\tif (allowDynamicRequire) return;\n\t\t\t\t\t\t\tmagicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {\n\t\t\t\t\t\t\t\tstoreName: true\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tuses[node.name] = true;\n\t\t\t\t\t\tif (node.name === 'global' && !ignoreGlobal) {\n\t\t\t\t\t\t\tmagicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {\n\t\t\t\t\t\t\t\tstoreName: true\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if module or exports are used outside the context of an assignment\n\t\t\t\t\t\t// expression, we need to wrap the module\n\t\t\t\t\t\tif (node.name === 'module' || node.name === 'exports') {\n\t\t\t\t\t\t\tshouldWrap = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (node.name === 'define') {\n\t\t\t\t\t\tmagicString.overwrite(node.start, node.end, 'undefined', { storeName: true });\n\t\t\t\t\t}\n\n\t\t\t\t\tglobals.add(node.name);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Is this an assignment to exports or module.exports?\n\t\t\tif (node.type === 'AssignmentExpression') {\n\t\t\t\tif (node.left.type !== 'MemberExpression') return;\n\n\t\t\t\tconst flattened = flatten(node.left);\n\t\t\t\tif (!flattened) return;\n\n\t\t\t\tif (scope.contains(flattened.name)) return;\n\n\t\t\t\tconst match = exportsPattern.exec(flattened.keypath);\n\t\t\t\tif (!match || flattened.keypath === 'exports') return;\n\n\t\t\t\tuses[flattened.name] = true;\n\n\t\t\t\t// we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` –\n\t\t\t\t// if this isn't top-level, we'll need to wrap the module\n\t\t\t\tif (programDepth > 3) shouldWrap = true;\n\n\t\t\t\tnode.left._skip = true;\n\n\t\t\t\tif (flattened.keypath === 'module.exports' && node.right.type === 'ObjectExpression') {\n\t\t\t\t\treturn node.right.properties.forEach(prop => {\n\t\t\t\t\t\tif (prop.computed || prop.key.type !== 'Identifier') return;\n\t\t\t\t\t\tconst name = prop.key.name;\n\t\t\t\t\t\tif (name === makeLegalIdentifier(name)) namedExports[name] = true;\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (match[1]) namedExports[match[1]] = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// if this is `var x = require('x')`, we can do `import x from 'x'`\n\t\t\tif (\n\t\t\t\tnode.type === 'VariableDeclarator' &&\n\t\t\t\tnode.id.type === 'Identifier' &&\n\t\t\t\tisStaticRequireStatement(node.init)\n\t\t\t) {\n\t\t\t\t// for now, only do this for top-level requires. maybe fix this in future\n\t\t\t\tif (scope.parent) return;\n\n\t\t\t\t// edge case — CJS allows you to assign to imports. ES doesn't\n\t\t\t\tif (assignedTo.has(node.id.name)) return;\n\n\t\t\t\tconst required = getRequired(node.init, node.id.name);\n\t\t\t\trequired.importsDefault = true;\n\n\t\t\t\tif (required.name === node.id.name) {\n\t\t\t\t\tnode._shouldRemove = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!isStaticRequireStatement(node)) return;\n\n\t\t\tconst required = getRequired(node);\n\n\t\t\tif (parent.type === 'ExpressionStatement') {\n\t\t\t\t// is a bare import, e.g. `require('foo');`\n\t\t\t\tmagicString.remove(parent.start, parent.end);\n\t\t\t} else {\n\t\t\t\trequired.importsDefault = true;\n\t\t\t\tmagicString.overwrite(node.start, node.end, required.name);\n\t\t\t}\n\n\t\t\tnode.callee._skip = true;\n\t\t},\n\n\t\tleave(node) {\n\t\t\tprogramDepth -= 1;\n\t\t\tif (node.scope) scope = scope.parent;\n\t\t\tif (functionType.test(node.type)) lexicalDepth -= 1;\n\n\t\t\tif (node.type === 'VariableDeclaration') {\n\t\t\t\tlet keepDeclaration = false;\n\t\t\t\tlet c = node.declarations[0].start;\n\n\t\t\t\tfor (let i = 0; i < node.declarations.length; i += 1) {\n\t\t\t\t\tconst declarator = node.declarations[i];\n\n\t\t\t\t\tif (declarator._shouldRemove) {\n\t\t\t\t\t\tmagicString.remove(c, declarator.end);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!keepDeclaration) {\n\t\t\t\t\t\t\tmagicString.remove(c, declarator.start);\n\t\t\t\t\t\t\tkeepDeclaration = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tc = declarator.end;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!keepDeclaration) {\n\t\t\t\t\tmagicString.remove(node.start, node.end);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\tif (\n\t\t!sources.length &&\n\t\t!uses.module &&\n\t\t!uses.exports &&\n\t\t!uses.require &&\n\t\t(ignoreGlobal || !uses.global)\n\t) {\n\t\tif (Object.keys(namedExports).length) {\n\t\t\tthrow new Error(\n\t\t\t\t`Custom named exports were specified for ${id} but it does not appear to be a CommonJS module`\n\t\t\t);\n\t\t}\n\t\treturn null; // not a CommonJS module\n\t}\n\n\tconst includeHelpers = shouldWrap || uses.global || uses.require;\n\tconst importBlock =\n\t\t(includeHelpers ? [`import * as ${HELPERS_NAME} from '${HELPERS_ID}';`] : [])\n\t\t\t.concat(\n\t\t\t\tsources.map(source => {\n\t\t\t\t\t// import the actual module before the proxy, so that we know\n\t\t\t\t\t// what kind of proxy to build\n\t\t\t\t\treturn `import '${source}';`;\n\t\t\t\t}),\n\t\t\t\tsources.map(source => {\n\t\t\t\t\tconst { name, importsDefault } = required[source];\n\t\t\t\t\treturn `import ${importsDefault ? `${name} from ` : ``}'${PROXY_PREFIX}${source}';`;\n\t\t\t\t})\n\t\t\t)\n\t\t\t.join('\\n') + '\\n\\n';\n\n\tconst namedExportDeclarations = [];\n\tlet wrapperStart = '';\n\tlet wrapperEnd = '';\n\n\tconst moduleName = deconflict(scope, globals, getName(id));\n\tif (!isEntry) {\n\t\tconst exportModuleExports = {\n\t\t\tstr: `export { ${moduleName} as __moduleExports };`,\n\t\t\tname: '__moduleExports'\n\t\t};\n\n\t\tnamedExportDeclarations.push(exportModuleExports);\n\t}\n\n\tconst name = getName(id);\n\n\tfunction addExport(x) {\n\t\tconst deconflicted = deconflict(scope, globals, name);\n\n\t\tconst declaration =\n\t\t\tdeconflicted === name\n\t\t\t\t? `export var ${x} = ${moduleName}.${x};`\n\t\t\t\t: `var ${deconflicted} = ${moduleName}.${x};\\nexport { ${deconflicted} as ${x} };`;\n\n\t\tnamedExportDeclarations.push({\n\t\t\tstr: declaration,\n\t\t\tname: x\n\t\t});\n\t}\n\n\tif (customNamedExports) customNamedExports.forEach(addExport);\n\n\tconst defaultExportPropertyAssignments = [];\n\tlet hasDefaultExport = false;\n\n\tif (shouldWrap) {\n\t\tconst args = `module${uses.exports ? ', exports' : ''}`;\n\n\t\twrapperStart = `var ${moduleName} = ${HELPERS_NAME}.createCommonjsModule(function (${args}) {\\n`;\n\t\twrapperEnd = `\\n});`;\n\t} else {\n\t\tconst names = [];\n\n\t\tast.body.forEach(node => {\n\t\t\tif (node.type === 'ExpressionStatement' && node.expression.type === 'AssignmentExpression') {\n\t\t\t\tconst left = node.expression.left;\n\t\t\t\tconst flattened = flatten(left);\n\n\t\t\t\tif (!flattened) return;\n\n\t\t\t\tconst match = exportsPattern.exec(flattened.keypath);\n\t\t\t\tif (!match) return;\n\n\t\t\t\tif (flattened.keypath === 'module.exports') {\n\t\t\t\t\thasDefaultExport = true;\n\t\t\t\t\tmagicString.overwrite(left.start, left.end, `var ${moduleName}`);\n\t\t\t\t} else {\n\t\t\t\t\tconst name = match[1];\n\t\t\t\t\tconst deconflicted = deconflict(scope, globals, name);\n\n\t\t\t\t\tnames.push({ name, deconflicted });\n\n\t\t\t\t\tmagicString.overwrite(node.start, left.end, `var ${deconflicted}`);\n\n\t\t\t\t\tconst declaration =\n\t\t\t\t\t\tname === deconflicted\n\t\t\t\t\t\t\t? `export { ${name} };`\n\t\t\t\t\t\t\t: `export { ${deconflicted} as ${name} };`;\n\n\t\t\t\t\tif (name !== 'default') {\n\t\t\t\t\t\tnamedExportDeclarations.push({\n\t\t\t\t\t\t\tstr: declaration,\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t});\n\t\t\t\t\t\tdelete namedExports[name];\n\t\t\t\t\t}\n\n\t\t\t\t\tdefaultExportPropertyAssignments.push(`${moduleName}.${name} = ${deconflicted};`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (!hasDefaultExport) {\n\t\t\twrapperEnd = `\\n\\nvar ${moduleName} = {\\n${names\n\t\t\t\t.map(({ name, deconflicted }) => `\\t${name}: ${deconflicted}`)\n\t\t\t\t.join(',\\n')}\\n};`;\n\t\t}\n\t}\n\tObject.keys(namedExports)\n\t\t.filter(key => !blacklist[key])\n\t\t.forEach(addExport);\n\n\tconst defaultExport = /__esModule/.test(code)\n\t\t? `export default ${HELPERS_NAME}.unwrapExports(${moduleName});`\n\t\t: `export default ${moduleName};`;\n\n\tconst named = namedExportDeclarations\n\t\t.filter(x => x.name !== 'default' || !hasDefaultExport)\n\t\t.map(x => x.str);\n\n\tconst exportBlock =\n\t\t'\\n\\n' +\n\t\t[defaultExport]\n\t\t\t.concat(named)\n\t\t\t.concat(hasDefaultExport ? defaultExportPropertyAssignments : [])\n\t\t\t.join('\\n');\n\n\tmagicString\n\t\t.trim()\n\t\t.prepend(importBlock + wrapperStart)\n\t\t.trim()\n\t\t.append(wrapperEnd + exportBlock);\n\n\tcode = magicString.toString();\n\tconst map = sourceMap ? magicString.generateMap() : null;\n\n\treturn { code, map };\n}\n","import { extname, resolve } from 'path';\nimport { sync as nodeResolveSync } from 'resolve';\nimport { createFilter } from 'rollup-pluginutils';\nimport { EXTERNAL_PREFIX, HELPERS, HELPERS_ID, PROXY_PREFIX } from './helpers.js';\nimport { getIsCjsPromise, setIsCjsPromise } from './is-cjs';\nimport { getResolveId } from './resolve-id';\nimport { checkEsModule, hasCjsKeywords, transformCommonjs } from './transform.js';\nimport { getName } from './utils.js';\n\nexport default function commonjs(options = {}) {\n\tconst extensions = options.extensions || ['.js'];\n\tconst filter = createFilter(options.include, options.exclude);\n\tconst ignoreGlobal = options.ignoreGlobal;\n\n\tconst customNamedExports = {};\n\tif (options.namedExports) {\n\t\tObject.keys(options.namedExports).forEach(id => {\n\t\t\tlet resolvedId;\n\n\t\t\ttry {\n\t\t\t\tresolvedId = nodeResolveSync(id, { basedir: process.cwd() });\n\t\t\t} catch (err) {\n\t\t\t\tresolvedId = resolve(id);\n\t\t\t}\n\n\t\t\tcustomNamedExports[resolvedId] = options.namedExports[id];\n\t\t});\n\t}\n\n\tconst esModulesWithoutDefaultExport = Object.create(null);\n\tconst esModulesWithDefaultExport = Object.create(null);\n\tconst allowDynamicRequire = !!options.ignore; // TODO maybe this should be configurable?\n\n\tconst ignoreRequire =\n\t\ttypeof options.ignore === 'function'\n\t\t\t? options.ignore\n\t\t\t: Array.isArray(options.ignore)\n\t\t\t\t? id => options.ignore.includes(id)\n\t\t\t\t: () => false;\n\n\tlet entryModuleIdsPromise = null;\n\n\tconst resolveId = getResolveId(extensions);\n\n\tconst sourceMap = options.sourceMap !== false;\n\n\treturn {\n\t\tname: 'commonjs',\n\n\t\toptions(options) {\n\t\t\tresolveId.setRollupOptions(options);\n\t\t\tconst input = options.input || options.entry;\n\t\t\tconst entryModules = Array.isArray(input)\n\t\t\t\t? input\n\t\t\t\t: typeof input === 'object' && input !== null\n\t\t\t\t\t? Object.values(input)\n\t\t\t\t\t: [input];\n\t\t\tentryModuleIdsPromise = Promise.all(entryModules.map(entry => resolveId(entry)));\n\t\t},\n\n\t\tresolveId,\n\n\t\tload(id) {\n\t\t\tif (id === HELPERS_ID) return HELPERS;\n\n\t\t\t// generate proxy modules\n\t\t\tif (id.startsWith(EXTERNAL_PREFIX)) {\n\t\t\t\tconst actualId = id.slice(EXTERNAL_PREFIX.length);\n\t\t\t\tconst name = getName(actualId);\n\n\t\t\t\treturn `import ${name} from ${JSON.stringify(actualId)}; export default ${name};`;\n\t\t\t}\n\n\t\t\tif (id.startsWith(PROXY_PREFIX)) {\n\t\t\t\tconst actualId = id.slice(PROXY_PREFIX.length);\n\t\t\t\tconst name = getName(actualId);\n\n\t\t\t\treturn getIsCjsPromise(actualId).then(isCjs => {\n\t\t\t\t\tif (isCjs)\n\t\t\t\t\t\treturn `import { __moduleExports } from ${JSON.stringify(\n\t\t\t\t\t\t\tactualId\n\t\t\t\t\t\t)}; export default __moduleExports;`;\n\t\t\t\t\telse if (esModulesWithoutDefaultExport[actualId])\n\t\t\t\t\t\treturn `import * as ${name} from ${JSON.stringify(actualId)}; export default ${name};`;\n\t\t\t\t\telse if (esModulesWithDefaultExport[actualId]) {\n\t\t\t\t\t\treturn `export {default} from ${JSON.stringify(actualId)};`;\n\t\t\t\t\t} else\n\t\t\t\t\t\treturn `import * as ${name} from ${JSON.stringify(\n\t\t\t\t\t\t\tactualId\n\t\t\t\t\t\t)}; import {getCjsExportFromNamespace} from \"${HELPERS_ID}\"; export default getCjsExportFromNamespace(${name})`;\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\n\t\ttransform(code, id) {\n\t\t\tif (!filter(id) || extensions.indexOf(extname(id)) === -1) {\n\t\t\t\tsetIsCjsPromise(id, Promise.resolve(null));\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst transformPromise = entryModuleIdsPromise\n\t\t\t\t.then(entryModuleIds => {\n\t\t\t\t\tconst { isEsModule, hasDefaultExport, ast } = checkEsModule(this.parse, code, id);\n\t\t\t\t\tif (isEsModule) {\n\t\t\t\t\t\t(hasDefaultExport ? esModulesWithDefaultExport : esModulesWithoutDefaultExport)[\n\t\t\t\t\t\t\tid\n\t\t\t\t\t\t] = true;\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// it is not an ES module but it does not have CJS-specific elements.\n\t\t\t\t\tif (!hasCjsKeywords(code, ignoreGlobal)) {\n\t\t\t\t\t\tesModulesWithoutDefaultExport[id] = true;\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst transformed = transformCommonjs(\n\t\t\t\t\t\tthis.parse,\n\t\t\t\t\t\tcode,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tentryModuleIds.indexOf(id) !== -1,\n\t\t\t\t\t\tignoreGlobal,\n\t\t\t\t\t\tignoreRequire,\n\t\t\t\t\t\tcustomNamedExports[id],\n\t\t\t\t\t\tsourceMap,\n\t\t\t\t\t\tallowDynamicRequire,\n\t\t\t\t\t\tast\n\t\t\t\t\t);\n\t\t\t\t\tif (!transformed) {\n\t\t\t\t\t\tesModulesWithoutDefaultExport[id] = true;\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn transformed;\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tthis.error(err, err.loc);\n\t\t\t\t});\n\n\t\t\tsetIsCjsPromise(id, transformPromise.then(Boolean, () => false));\n\t\t\treturn transformPromise;\n\t\t}\n\t};\n}\n"],"names":["const","let","resolve","fs.statSync","this","flattened","required","nodeResolveSync","options","actualId","name"],"mappings":";;;;;;;AAAOA,IAAM,YAAY,GAAG,mBAAmB,CAAC;AAChD,AAAOA,IAAM,eAAe,GAAG,sBAAsB,CAAC;AACtD,AAAOA,IAAM,UAAU,GAAG,mBAAmB,CAAC;;AAE9C,AAAOA,IAAM,OAAO,GAAG,8oBAiBrB,CAAC;;ACrBHA,IAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;;AAE1C,AAAO,SAAS,eAAe,CAAC,EAAE,EAAE;CACnCC,IAAI,YAAY,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;CACrC,IAAI,YAAY,IAAE,OAAO,YAAY,CAAC,OAAO,GAAC;;CAE9CD,IAAM,OAAO,GAAG,IAAI,OAAO,WAACE,YAAQ;EACnC,aAAa,CAAC,EAAE,CAAC,GAAG,YAAY,GAAG;YAClCA,UAAO;GACP,OAAO,EAAE,SAAS;GAClB,CAAC;EACF,CAAC,CAAC;CACH,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC;;CAE/B,OAAO,OAAO,CAAC;CACf;;AAED,AAAO,SAAS,eAAe,C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zC,OAAO,IAAI,CAAC;MACZ;;KAEDJ,IAAM,WAAW,GAAG,iBAAiB;MACpCI,MAAI,CAAC,KAAK;MACV,IAAI;MACJ,EAAE;MACF,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;MACjC,YAAY;MACZ,aAAa;MACb,kBAAkB,CAAC,EAAE,CAAC;MACtB,SAAS;MACT,mBAAmB;MACnB,GAAG;MACH,CAAC;KACF,IAAI,CAAC,WAAW,EAAE;MACjB,6BAA6B,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;MACzC,OAAO,IAAI,CAAC;MACZ;;KAED,OAAO,WAAW,CAAC;KACnB,CAAC;KACD,KAAK,WAAC,KAAI;KACVA,MAAI,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;KACzB,CAAC,CAAC;;GAEJ,eAAe,CAAC,EAAE,EAAE,gBAAgB,CAAC,IAAI,CAAC,OAAO,cAAK,SAAG,QAAK,CAAC,CAAC,CAAC;GACjE,OAAO,gBAAgB,CAAC;GACxB;EACD,CAAC;CACF;;;;"} \ No newline at end of file diff --git a/build/node_modules/rollup-plugin-commonjs/package.json b/build/node_modules/rollup-plugin-commonjs/package.json index ffb07da4..3ca2c85b 100644 --- a/build/node_modules/rollup-plugin-commonjs/package.json +++ b/build/node_modules/rollup-plugin-commonjs/package.json @@ -7,20 +7,20 @@ ], "_from": "rollup-plugin-commonjs@>=9.1.3 <10.0.0", "_hasShrinkwrap": false, - "_id": "rollup-plugin-commonjs@9.2.0", + "_id": "rollup-plugin-commonjs@9.2.1", "_inCache": true, "_installable": true, "_location": "/rollup-plugin-commonjs", "_nodeVersion": "10.7.0", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", - "tmp": "tmp/rollup-plugin-commonjs_9.2.0_1539145004790_0.71784296269482" + "tmp": "tmp/rollup-plugin-commonjs_9.2.1_1550928432710_0.9907046700947904" }, "_npmUser": { "email": "lukas.taegert@tngtech.com", "name": "lukastaegert" }, - "_npmVersion": "6.4.1", + "_npmVersion": "6.8.0", "_phantomChildren": {}, "_requested": { "name": "rollup-plugin-commonjs", @@ -33,8 +33,8 @@ "_requiredBy": [ "#DEV:/" ], - "_resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.2.0.tgz", - "_shasum": "4604e25069e0c78a09e08faa95dc32dec27f7c89", + "_resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.2.1.tgz", + "_shasum": "bb151ca8fa23600c7a03e25f9f0a45b1ee922dac", "_shrinkwrap": null, "_spec": "rollup-plugin-commonjs@^9.1.3", "_where": "/var/build/workspace/build-platform-sdks/platform-client-sdk-common/output/purecloudjavascript-guest/build", @@ -47,37 +47,37 @@ "dependencies": { "estree-walker": "^0.5.2", "magic-string": "^0.25.1", - "resolve": "^1.8.1", + "resolve": "^1.10.0", "rollup-pluginutils": "^2.3.3" }, "description": "Convert CommonJS modules to ES2015", "devDependencies": { - "acorn": "^6.0.2", - "eslint": "^5.6.1", - "eslint-plugin-import": "^2.14.0", - "husky": "^1.1.0", - "lint-staged": "^7.3.0", + "acorn": "^6.0.5", + "eslint": "^5.12.1", + "eslint-plugin-import": "^2.15.0", + "husky": "^1.3.1", + "lint-staged": "^8.1.0", "locate-character": "^2.0.5", "mocha": "^5.2.0", - "prettier": "^1.14.3", + "prettier": "^1.16.1", "require-relative": "^0.8.7", - "rollup": "^0.66.3", - "rollup-plugin-buble": "^0.19.2", - "rollup-plugin-node-resolve": "^3.4.0", + "rollup": "^1.1.2", + "rollup-plugin-buble": "^0.19.6", + "rollup-plugin-node-resolve": "^4.0.0", "shx": "^0.3.2", "source-map": "^0.7.3", - "source-map-support": "^0.5.9" + "source-map-support": "^0.5.10" }, "directories": {}, "dist": { "fileCount": 16, - "integrity": "sha512-0RM5U4Vd6iHjL6rLvr3lKBwnPsaVml+qxOGaaNUWN1lSq6S33KhITOfHmvxV3z2vy9Mk4t0g4rNlVaJJsNQPWA==", - "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvX0tCRA9TVsSAnZWagAAX/QP/iVS22iV+7fyqMTFF6Xd\nPRrjb+Fy29ZjcB0Hiq22dJruZoy2Bo5CgPZctIuxlinJ+Bl0DR7D8qr4rK/U\naQP+16PA3Y9VFMfoJPDymDn96hqfoizLsuSCMb5WKSZG2Cy3vaVb+gyaTBGd\n1BwSBsk6lF6M2pTNqsaaGVGeiq+pjxYNbiRnhqQeyBRHHnIOVQoPqBVYPVAB\nuXuk4XU9hPmvejLC3TbE5LweADEg5e7AWnJD5IxWnJcpzla1hNwZyQ8FboaO\nnb+RvfTVnyvyNasmfCfUNlkTldBmedus549UN9K+sgUwPHXKGAhtcNmSofOb\nT2VeS33Wf0/RHT8WV0HZOoOfwC9ZHmoo2Xi9plVubQV2RvKO9lWxXfTMI/2k\nKn7lxwyky2LZjrWQO1IHgEGwcFZmojWBNo/h0I5we3p6yWETw9p4Y7Qmjyv2\nsOXXczcj1FPbXICFNtE8SFCsZDLQeCIAMubnJIrhckqfDYKHsWkLlz9I/M94\nq4Pz6/yI2UJ88HeSvXQW57uatpy2CWWR4IdGZcRIUcpExL3vaidVAJIOSV5+\nmlze4vJfUuYvThrzemzd42KT9kVUIb084YqUzbdiizB1n2K3zMsgRJELgU4+\ngp9wdxrS+sJsgRUvcrOdnfq8VkWCwPwSPQB/QZJbKvJP+2jR3U8qjzn/g82W\n52VV\r\n=IfEb\r\n-----END PGP SIGNATURE-----\r\n", - "shasum": "4604e25069e0c78a09e08faa95dc32dec27f7c89", - "tarball": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.2.0.tgz", - "unpackedSize": 208135 + "integrity": "sha512-X0A/Cp/t+zbONFinBhiTZrfuUaVwRIp4xsbKq/2ohA2CDULa/7ONSJTelqxon+Vds2R2t2qJTqJQucKUC8GKkw==", + "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJccUoxCRA9TVsSAnZWagAAhTwP/0LfXqXPDqZVSGL/lbab\nRk9by/pVYWy9LrpQHvMoiGmLr4L/TVRIx9i1lzRzBnVxjYPJuxmfpRVQS4Ge\n6O8gqOJjjdB4wqxqugg4HECF5EVw/ETSEiiUYyNBrgZysWtBMK/n5TnVfFcP\ne5AQRFBsf2l2JCrpYLQEfVZq74sywmzUilA08WdsUd4M7vWSi9IaqG2c7oaZ\nfFUJ4EiWHM+tKJZgLIV6uNzJAAKKv70vEYCEuBA/baiQGsbRvHCslH2XDMh/\nXTo+EM2TxvtZHQINRy/c7I/earFloaAyXClV/92r6ZtsJgPP/p1gjEE4Ecq0\nOs3jj7u5/NGnAU1VSdcV+6getvMS3NSsGn6dHxC4e0E4IdK8/gSzd0LOIf3u\nZGFMzMQPhjxUHFJJV9wo/460B0m41hdlAClMCXVtkGADZcKfAQN8XRaeWojj\njITxcYrL2/LcDoP0F1feQyXfgc7WtwhiWcoqbhABIvuYUDBdPv479dV22c2h\nnQvPk3JJLFLQJ/hPTXStIYYwKDSTuRoBrg+UrnJYk/aXcZ2us+ylxfv3I7AK\nxK2fMR1HTKjoYdH6sOclmYm0bPcGJbYxLHk/08H/9OPUJjegXTgY4ZiqMr1P\nWJfD1L5yWd9syRxdoUjzHVg8gHkD5tVcduWh8ZdO6ToEaFhrweYog7hn5/my\nU+Uc\r\n=zras\r\n-----END PGP SIGNATURE-----\r\n", + "shasum": "bb151ca8fa23600c7a03e25f9f0a45b1ee922dac", + "tarball": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.2.1.tgz", + "unpackedSize": 208623 }, - "gitHead": "58e9aa5822ccb7e4682659617629c46e94ef650f", + "gitHead": "4d2624092aae352c5619ebedaa3d16b8911b4165", "homepage": "https://github.com/rollup/rollup-plugin-commonjs", "jsnext:main": "dist/rollup-plugin-commonjs.es.js", "license": "MIT", @@ -121,5 +121,5 @@ "test": "npm run test:only", "test:only": "mocha" }, - "version": "9.2.0" + "version": "9.2.1" } diff --git a/build/node_modules/rollup-plugin-commonjs/src/resolve-id.js b/build/node_modules/rollup-plugin-commonjs/src/resolve-id.js index 7243d88e..36bf4532 100644 --- a/build/node_modules/rollup-plugin-commonjs/src/resolve-id.js +++ b/build/node_modules/rollup-plugin-commonjs/src/resolve-id.js @@ -30,7 +30,7 @@ export function getResolveId(extensions) { importer = importer.slice(PROXY_PREFIX.length); } - return resolveUsingOtherResolvers(importee, importer).then(resolved => { + return resolveUsingOtherResolvers.call(this, importee, importer).then(resolved => { if (resolved) return isProxyModule ? PROXY_PREFIX + resolved : resolved; resolved = defaultResolver(importee, importer); diff --git a/build/node_modules/rollup-plugin-commonjs/src/utils.js b/build/node_modules/rollup-plugin-commonjs/src/utils.js index 6824015f..fc86cd0c 100644 --- a/build/node_modules/rollup-plugin-commonjs/src/utils.js +++ b/build/node_modules/rollup-plugin-commonjs/src/utils.js @@ -16,8 +16,8 @@ export function getName(id) { export function first(candidates) { return function(...args) { return candidates.reduce((promise, candidate) => { - return promise.then( - result => (result != null ? result : Promise.resolve(candidate(...args))) + return promise.then(result => + result != null ? result : Promise.resolve(candidate.call(this, ...args)) ); }, Promise.resolve()); }; diff --git a/build/node_modules/safe-buffer/package.json b/build/node_modules/safe-buffer/package.json index 77913501..af5e4e60 100644 --- a/build/node_modules/safe-buffer/package.json +++ b/build/node_modules/safe-buffer/package.json @@ -47,7 +47,7 @@ "/sha.js", "/string_decoder" ], - "_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "_resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/safe-buffer/-/safe-buffer-5.1.2.tgz", "_shasum": "991ec69d296e0313747d59bdfd2b745c35f8828d", "_shrinkwrap": null, "_spec": "safe-buffer@~5.1.1", diff --git a/build/node_modules/string_decoder/package.json b/build/node_modules/string_decoder/package.json index fb57109a..2f03c7fb 100644 --- a/build/node_modules/string_decoder/package.json +++ b/build/node_modules/string_decoder/package.json @@ -33,7 +33,7 @@ "_requiredBy": [ "/readable-stream" ], - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "_resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/string_decoder/-/string_decoder-1.1.1.tgz", "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8", "_shrinkwrap": null, "_spec": "string_decoder@~1.1.1", diff --git a/build/node_modules/typedarray/package.json b/build/node_modules/typedarray/package.json index cea7bf12..534a6025 100644 --- a/build/node_modules/typedarray/package.json +++ b/build/node_modules/typedarray/package.json @@ -27,7 +27,7 @@ "_requiredBy": [ "/concat-stream" ], - "_resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "_resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/typedarray/-/typedarray-0.0.6.tgz", "_shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777", "_shrinkwrap": null, "_spec": "typedarray@^0.0.6", diff --git a/build/node_modules/util-deprecate/package.json b/build/node_modules/util-deprecate/package.json index e9942e2c..289fabab 100644 --- a/build/node_modules/util-deprecate/package.json +++ b/build/node_modules/util-deprecate/package.json @@ -28,7 +28,7 @@ "_requiredBy": [ "/readable-stream" ], - "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "_resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/util-deprecate/-/util-deprecate-1.0.2.tgz", "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", "_shrinkwrap": null, "_spec": "util-deprecate@~1.0.1", diff --git a/build/node_modules/wrappy/package.json b/build/node_modules/wrappy/package.json index 2f285775..3cfb5a65 100644 --- a/build/node_modules/wrappy/package.json +++ b/build/node_modules/wrappy/package.json @@ -32,7 +32,7 @@ "_requiredBy": [ "/once" ], - "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "_resolved": "https://purecloud.jfrog.io/purecloud/api/npm/inin-internal-npm/wrappy/-/wrappy-1.0.2.tgz", "_shasum": "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f", "_shrinkwrap": null, "_spec": "wrappy@1", diff --git a/build/package.json b/build/package.json index b256016b..be216daa 100644 --- a/build/package.json +++ b/build/package.json @@ -1,6 +1,6 @@ { "name": "purecloud-guest-chat-client", - "version": "3.0.0", + "version": "4.0.0", "description": "A JavaScript library to interface with the PureCloud Platform API", "license": "MIT", "main": "dist/node/purecloud-guest-chat-client.js", @@ -12,7 +12,8 @@ "src/*", "package.json", "README.md", - "LICENSE" + "LICENSE", + "index.d.ts" ], "repository": { "type": "git", diff --git a/build/src/purecloud-guest-chat-client/ApiClient.js b/build/src/purecloud-guest-chat-client/ApiClient.js index c8a4441b..3f1b967a 100644 --- a/build/src/purecloud-guest-chat-client/ApiClient.js +++ b/build/src/purecloud-guest-chat-client/ApiClient.js @@ -2,7 +2,7 @@ import superagent from 'superagent'; /** * @module purecloud-guest-chat-client/ApiClient - * @version 3.0.0 + * @version 4.0.0 */ class ApiClient { /** @@ -531,7 +531,7 @@ class ApiClient { // set header parameters request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); - //request.set({ 'purecloud-sdk': '3.0.0' }); + //request.set({ 'purecloud-sdk': '4.0.0' }); // set request timeout request.timeout(this.timeout); diff --git a/build/src/purecloud-guest-chat-client/api/WebChatApi.js b/build/src/purecloud-guest-chat-client/api/WebChatApi.js index 52cc8a77..6892f1d6 100644 --- a/build/src/purecloud-guest-chat-client/api/WebChatApi.js +++ b/build/src/purecloud-guest-chat-client/api/WebChatApi.js @@ -5,7 +5,7 @@ class WebChatApi { /** * WebChat service. * @module purecloud-guest-chat-client/api/WebChatApi - * @version 3.0.0 + * @version 4.0.0 */ /** diff --git a/build/src/purecloud-guest-chat-client/index.js b/build/src/purecloud-guest-chat-client/index.js index b2bb74f6..548c2f84 100644 --- a/build/src/purecloud-guest-chat-client/index.js +++ b/build/src/purecloud-guest-chat-client/index.js @@ -31,7 +31,7 @@ import WebChatApi from './api/WebChatApi.js'; * *

* @module purecloud-guest-chat-client/index - * @version 3.0.0 + * @version 4.0.0 */ class platformClient { constructor() { diff --git a/releaseNotes.md b/releaseNotes.md index 65721a98..3ee2b1d2 100644 --- a/releaseNotes.md +++ b/releaseNotes.md @@ -1,58 +1,19 @@ -Platform API version: 3060 +Platform API version: 3102 -# Major Changes (3 changes) +# Major Changes (2 changes) -**GuestMemberInfo** (1 change) +**JourneyCustomer** (2 changes) -* Property profileImageUrl was removed +* Property type was removed +* Required property idType was added -**WebChatMemberInfo** (1 change) -* Property profileImageUrl was removed +# Minor Changes (1 change) -**WebChatMessage** (1 change) +**WebChatGuestMediaRequest** (1 change) -* Required property bodyType was added - - -# Minor Changes (9 changes) - -**CreateWebChatConversationRequest** (1 change) - -* Optional property journeyContext was added - -**GuestMemberInfo** (1 change) - -* Optional property avatarImageUrl was added - -**JourneyContext** (1 change) - -* Model was added - -**JourneyCustomer** (1 change) - -* Model was added - -**JourneyCustomerSession** (1 change) - -* Model was added - -**JourneyAction** (1 change) - -* Model was added - -**JourneyActionMap** (1 change) - -* Model was added - -**WebChatMemberInfo** (1 change) - -* Optional property avatarImageUrl was added - -**CreateWebChatMessageRequest** (1 change) - -* Optional property bodyType was added +* Optional property securityKey was added # Point Changes (0 changes) diff --git a/swagger.json b/swagger.json index a74e2e96..23e84259 100644 --- a/swagger.json +++ b/swagger.json @@ -1 +1 @@ -{"swagger":"2.0","info":{"description":"With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more.","version":"v2","title":"PureCloud Platform API","termsOfService":"https://developer.mypurecloud.com/tos","contact":{"name":"PureCloud Developer Evangelists","url":"https://developer.mypurecloud.com","email":"DeveloperEvangelists@genesys.com"},"license":{"name":"ININ","url":"http://www.inin.com"}},"host":"api.mypurecloud.com","tags":[{"name":"Alerting","description":"Rules and alerts","externalDocs":{"description":"Alerting Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/alerting/index.html"}},{"name":"Analytics","description":"Analytics querying and reporting.","externalDocs":{"description":"Analytics Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/analytics/index.html"}},{"name":"Architect","description":"Flows, Prompts, IVR schedules, Dependency Tracking","externalDocs":{"description":"Architect Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/architect/index.html"}},{"name":"Audit","description":"","externalDocs":{"description":"Audit Documentation","url":""}},{"name":"Authorization","description":"Roles and permissions","externalDocs":{"description":"Authorization Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/authorization/index.html"}},{"name":"Badges","description":"Badges stats"},{"name":"Billing","description":"","externalDocs":{"description":"billing Documentation","url":"https://developer.mypurecloud.com/billing"}},{"name":"Bridge","description":""},{"name":"Callbacks","description":""},{"name":"Calls","description":""},{"name":"Carrier Services","description":""},{"name":"Chats","description":""},{"name":"Cobrowse","description":""},{"name":"Compliance","description":""},{"name":"Configuration","description":"","externalDocs":{"description":"Configuration Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/configuration/index.html"}},{"name":"Content Management","description":"","externalDocs":{"description":"Content Management Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/contentmanagement/index.html"}},{"name":"Conversations","description":"","externalDocs":{"description":"Conversations Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/conversations/index.html"}},{"name":"Data Extensions","description":"Data extensions","externalDocs":{"description":"Data Extensions","url":"https://developer.mypurecloud.com"}},{"name":"Directory Proxy","description":"Search, Suggest, and people"},{"name":"Docs","description":"Swagger documentation definitions","externalDocs":{"description":"docs","url":"https://developer.mypurecloud.com"}},{"name":"Downloads","description":"Download file","externalDocs":{"description":"Downloads Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/downloads/index.html"}},{"name":"Emails","description":""},{"name":"External Contacts","description":"External Organizations, contacts, notes and relationships","externalDocs":{"description":"External Contacts","url":"https://developer.mypurecloud.com/api/rest/v2/externalcontacts/index.html"}},{"name":"Fax","description":"","externalDocs":{"description":"Fax Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/fax/index.html"}},{"name":"Flows","description":"IVR Flows","externalDocs":{"description":"Flow Aggregates Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/analytics/flow_aggregate.html"}},{"name":"General Data Protection Regulation","description":"Working with General Data Protection Regulation (GDPR) requests"},{"name":"Geolocation","description":"","externalDocs":{"description":"Geolocation Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/geolocation/index.html"}},{"name":"Greetings","description":"","externalDocs":{"description":"Greetings Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/greetings/index.html"}},{"name":"Groups","description":"Groups, members","externalDocs":{"description":"Groups Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/groups/index.html"}},{"name":"Identity Provider","description":"Identity providers","externalDocs":{"description":"Identity Providers Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/identityproviders/index.html"}},{"name":"Integrations","description":"","externalDocs":{"description":"Integrations Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/integrations/index.html"}},{"name":"Journey","description":"Journey Analytics","externalDocs":{"description":"Journey documentation","url":"https://developer.mypurecloud.com/api/rest/v1/journey/index.html"}},{"name":"Languages","description":"Available languages","externalDocs":{"description":"Languages Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/languages/index.html"}},{"name":"Licensing","description":""},{"name":"License","description":"Per-user platform license assignments"},{"name":"Locations","description":"Physical locations","externalDocs":{"description":"Locations Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/locations/index.html"}},{"name":"Marketplace","description":"Marketplace listing management"},{"name":"Meeting","description":"","externalDocs":{"description":"Meeting Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/meetings/index.html"}},{"name":"Messaging","description":"Messaging","externalDocs":{"description":"Messaging Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/messaging/index.html"}},{"name":"Mobile Devices","description":"Devices","externalDocs":{"description":"Devices Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/devices/index.html"}},{"name":"Notifications","description":"Channels, subscriptions, topics","externalDocs":{"description":"Notifications Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/notifications/index.html"}},{"name":"OAuth","description":"OAuth clients, providers","externalDocs":{"description":"OAuth Documentation","url":""}},{"name":"Objects","description":"Access-controlled objects in the platform","externalDocs":{"description":"authorization docs","url":"https://developer.mypurecloud.com/authorization"}},{"name":"Organization","description":"Organization"},{"name":"Organization Authorization","description":"Organization Authorization"},{"name":"Outbound","description":"","externalDocs":{"description":"Outbound Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/outbound/index.html"}},{"name":"Presence","description":"User and organization presences","externalDocs":{"description":"Presence Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/presence/index.html"}},{"name":"Process Automation","description":"Work items, flows"},{"name":"Quality","description":"Evaluations, calibrations","externalDocs":{"description":"Quality Management Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/quality/index.html"}},{"name":"Recording","description":"Recordings, policies, annotations, orphans","externalDocs":{"description":"Recording Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/recording/index.html"}},{"name":"Response Management","description":"Responses, library, query","externalDocs":{"description":"Response Management Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/responsemanagement/index.html"}},{"name":"Routing","description":"Queues, wrapup codes, skills, email & sms config","externalDocs":{"description":"Routing Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/routing/index.html"}},{"name":"SCIM","description":"System for Cross-domain Identity Management","externalDocs":{"description":"System for Cross-domain Identity Management: Definitions, Overview, Concepts, and Requirements","url":"https://tools.ietf.org/html/rfc7642"}},{"name":"Scripts","description":"Agent-facing scripts for interactions","externalDocs":{"description":"Scripts Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/scripts/index.html"}},{"name":"Search","description":"Search aggregate, users, groups","externalDocs":{"description":"Search Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/search/index.html"}},{"name":"SignedData","description":"Package data in signed JWTs"},{"name":"Socialize","description":"Gets, sets and updates entity data for the Socialize service"},{"name":"Stations","description":"Stations","externalDocs":{"description":"Stations Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/stations/index.html"}},{"name":"Suggest","description":"Search suggest user, group, locations"},{"name":"Telephony","description":"Telephony providers and configuration","externalDocs":{"description":"Telephony Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/telephonyprovidersedge/index.html"}},{"name":"Telephony Providers Edge","description":"Edge phones, trunks, lines.","externalDocs":{"description":"telephony provider edge","url":"https://developer.mypurecloud.com/api/rest/v2/telephonyprovidersedge/index.html"}},{"name":"Tokens","description":"Authentication Tokens","externalDocs":{"description":"Tokens Documentation","url":""}},{"name":"User Recordings","description":"Summary, media","externalDocs":{"description":"User Recordings Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/userrecordings/index.html"}},{"name":"Users","description":"Me, routing, roles","externalDocs":{"description":"Users Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/users/index.html"}},{"name":"Utilities","description":"","externalDocs":{"description":"Utilities Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/utilities/index.html"}},{"name":"Videos","description":""},{"name":"Virtual Reality","description":"Virtual Reality scenes and assets"},{"name":"Voicemail","description":"Mailbox, messages, policy","externalDocs":{"description":"Voicemail Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/voicemail/index.html"}},{"name":"WebChat","description":"WebChat deployments"},{"name":"Workforce Management","description":"Adherence, Schedules, Forecasts, Intraday Monitoring, Time Off Requests, Configuration","externalDocs":{"description":"Workforce Management Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/workforcemanagement/index.html"}}],"schemes":["https"],"consumes":["application/json"],"produces":["application/json"],"paths":{"/api/v2/webchat/guest/conversations":{"post":{"tags":["WebChat"],"summary":"Create an ACD chat conversation from an external customer.","description":"This endpoint will create a new ACD Chat conversation under the specified Chat Deployment.\n The conversation will begin with a guest member in it (with a role=CUSTOMER) according to the customer information that is supplied. If the guest member is authenticated, the 'memberAuthToken' field should include his JWT as generated by the 'POST /api/v2/signeddata' resource; if the guest member is anonymous (and the Deployment permits it) this field can be omitted.\n The returned data includes the IDs of the conversation created, along with a newly-create JWT token that you can supply to all future endpoints as authentication to perform operations against that conversation. After successfully creating a conversation, you should connect a websocket to the event stream named in the 'eventStreamUri' field of the response; the conversation is not routed until the event stream is attached.","operationId":"postWebchatGuestConversations","produces":["application/json"],"parameters":[{"in":"body","name":"body","description":"CreateConversationRequest","required":true,"schema":{"$ref":"#/definitions/CreateWebChatConversationRequest"}}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/CreateWebChatConversationResponse"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"chat.deployment.disabled":"The web chat deployment is currently disabled.","chat.deployment.bad.auth":"The customer member authentication has failed.","chat.error.invalid.queue":"The specified queue is not valid.","bad.request":"The request could not be understood by the server due to malformed syntax.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","chat.error.createconversationrequest.routingtarget":"The routing target is not valid.","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s","chat.deployment.require.auth":"The deployment requires the customer member to be authenticated."}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"credentials.expired":"The supplied credentials are expired and cannot be used.","authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"x-purecloud-method-name":"postWebchatGuestConversations"}},"/api/v2/webchat/guest/conversations/{conversationId}/mediarequests/{mediaRequestId}":{"get":{"tags":["WebChat"],"summary":"Get a media request in the conversation","description":"","operationId":"getWebchatGuestConversationMediarequest","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"mediaRequestId","in":"path","description":"mediaRequestId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatGuestMediaRequest"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMediarequest"},"patch":{"tags":["WebChat"],"summary":"Update a media request in the conversation, setting the state to ACCEPTED/DECLINED/ERRORED","description":"","operationId":"patchWebchatGuestConversationMediarequest","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"mediaRequestId","in":"path","description":"mediaRequestId","required":true,"type":"string"},{"in":"body","name":"body","description":"Request","required":true,"schema":{"$ref":"#/definitions/WebChatGuestMediaRequest"}}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatGuestMediaRequest"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","chat.error.conversation.state":"The conversation is in a state which does not permit this action.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"patchWebchatGuestConversationMediarequest"}},"/api/v2/webchat/guest/conversations/{conversationId}/messages":{"get":{"tags":["WebChat"],"summary":"Get the messages of a chat conversation.","description":"","operationId":"getWebchatGuestConversationMessages","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"after","in":"query","description":"If available, get the messages chronologically after the id of this message","required":false,"type":"string"},{"name":"before","in":"query","description":"If available, get the messages chronologically before the id of this message","required":false,"type":"string"},{"name":"sortOrder","in":"query","description":"Sort order","required":false,"type":"string","default":"ascending","enum":["ascending","descending"]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMessageEntityList"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMessages"}},"/api/v2/webchat/guest/conversations/{conversationId}/mediarequests":{"get":{"tags":["WebChat"],"summary":"Get all media requests to the guest in the conversation","description":"","operationId":"getWebchatGuestConversationMediarequests","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatGuestMediaRequestEntityList"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMediarequests"}},"/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}/typing":{"post":{"tags":["WebChat"],"summary":"Send a typing-indicator in a chat conversation.","description":"","operationId":"postWebchatGuestConversationMemberTyping","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"memberId","in":"path","description":"memberId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatTyping"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","chat.error.conversation.state":"The conversation is in a state which does not permit this action.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","chat.error.member.state":"The conversation member is in a state which does not permit this action.","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"postWebchatGuestConversationMemberTyping"}},"/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}/messages":{"post":{"tags":["WebChat"],"summary":"Send a message in a chat conversation.","description":"","operationId":"postWebchatGuestConversationMemberMessages","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"memberId","in":"path","description":"memberId","required":true,"type":"string"},{"in":"body","name":"body","description":"Message","required":true,"schema":{"$ref":"#/definitions/CreateWebChatMessageRequest"}}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMessage"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","chat.error.conversation.state":"The conversation is in a state which does not permit this action.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","chat.error.member.state":"The conversation member is in a state which does not permit this action.","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"postWebchatGuestConversationMemberMessages"}},"/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}":{"get":{"tags":["WebChat"],"summary":"Get a web chat conversation member","description":"","operationId":"getWebchatGuestConversationMember","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"memberId","in":"path","description":"memberId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMemberInfo"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMember"},"delete":{"tags":["WebChat"],"summary":"Remove a member from a chat conversation","description":"","operationId":"deleteWebchatGuestConversationMember","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"memberId","in":"path","description":"memberId","required":true,"type":"string"}],"responses":{"204":{"description":"Operation was successful."},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","chat.error.conversation.state":"The conversation is in a state which does not permit this action.","chat.error.member.state":"The conversation member is in a state which does not permit this action."}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"deleteWebchatGuestConversationMember"}},"/api/v2/webchat/guest/conversations/{conversationId}/messages/{messageId}":{"get":{"tags":["WebChat"],"summary":"Get a web chat conversation message","description":"","operationId":"getWebchatGuestConversationMessage","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"messageId","in":"path","description":"messageId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMessage"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMessage"}},"/api/v2/webchat/guest/conversations/{conversationId}/members":{"get":{"tags":["WebChat"],"summary":"Get the members of a chat conversation.","description":"","operationId":"getWebchatGuestConversationMembers","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"pageSize","in":"query","description":"The number of entries to return per page, or omitted for the default.","required":false,"type":"integer","default":25,"format":"int32"},{"name":"pageNumber","in":"query","description":"The page number to return, or omitted for the first page.","required":false,"type":"integer","default":1,"format":"int32"},{"name":"excludeDisconnectedMembers","in":"query","description":"If true, the results will not contain members who have a DISCONNECTED state.","required":false,"type":"boolean","default":false}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMemberInfoEntityList"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMembers"}}},"securityDefinitions":{"PureCloud OAuth":{"type":"oauth2","authorizationUrl":"https://login.mypurecloud.com/authorize","flow":"implicit","scopes":{"all":"All the scopes"}},"Guest Chat JWT":{"type":"apiKey","name":"Authorization","in":"header"}},"definitions":{"CreateWebChatConversationRequest":{"type":"object","required":["deploymentId","memberInfo","organizationId","routingTarget"],"properties":{"organizationId":{"type":"string","description":"The organization identifier."},"deploymentId":{"type":"string","description":"The web chat Deployment ID which contains the appropriate settings for this chat conversation."},"routingTarget":{"description":"The routing information to use for the new chat conversation.","$ref":"#/definitions/WebChatRoutingTarget"},"memberInfo":{"description":"The guest member info to use for the new chat conversation.","$ref":"#/definitions/GuestMemberInfo"},"memberAuthToken":{"type":"string","description":"If the guest member is an authenticated member (ie, not anonymous) his JWT is provided here. The token will have been previously generated with the \"POST /api/v2/signeddata\" resource."},"journeyContext":{"description":"A subset of the Journey System's data relevant to this conversation/session request (for external linkage and internal usage/context).","$ref":"#/definitions/JourneyContext"}}},"WebChatRoutingTarget":{"type":"object","required":["targetAddress","targetType"],"properties":{"targetType":{"type":"string","description":"The target type of the routing target, such as 'QUEUE'.","enum":["QUEUE"]},"targetAddress":{"type":"string","description":"The target of the route, in the format appropriate given the 'targetType'."},"skills":{"type":"array","description":"The list of skill names to use for routing.","items":{"type":"string"}},"language":{"type":"string","description":"The language name to use for routing."},"priority":{"type":"integer","format":"int64","description":"The priority to assign to the conversation for routing."}}},"GuestMemberInfo":{"type":"object","required":["displayName"],"properties":{"displayName":{"type":"string","description":"The display name to use for the guest member in the conversation."},"avatarImageUrl":{"type":"string","format":"uri","description":"The URL to the avatar image to use for the guest member in the conversation, if any."},"customFields":{"type":"object","description":"Any custom fields of information, in key-value format, to attach to the guest member in the conversation.","additionalProperties":{"type":"string"}}}},"JourneyContext":{"type":"object","properties":{"customer":{"description":"A subset of the Journey System's customer data at a point-in-time (for external linkage and internal usage/context)","$ref":"#/definitions/JourneyCustomer"},"customerSession":{"description":"A subset of the Journey System's tracked customer session data at a point-in-time (for external linkage and internal usage/context)","$ref":"#/definitions/JourneyCustomerSession"},"triggeringAction":{"description":"A subset of the Journey System's action data relevant to a part of a conversation (for external linkage and internal usage/context)","$ref":"#/definitions/JourneyAction"}}},"JourneyCustomer":{"type":"object","required":["id","type"],"properties":{"id":{"type":"string","description":"An ID of a customer within the Journey System at a point-in-time. Note that a customer entity can have multiple customerIds based on the stitching process. Depending on the context within the PureCloud conversation, this may or may not be mutable."},"type":{"type":"string","description":"The type of the customerId within the Journey System (e.g. cookie)."}}},"JourneyCustomerSession":{"type":"object","required":["id","type"],"properties":{"id":{"type":"string","description":"An ID of a Customer/User's session within the Journey System at a point-in-time"},"type":{"type":"string","description":"The type of the Customer/User's session ID within the Journey System (e.g. web, app)"}}},"JourneyAction":{"type":"object","required":["id"],"properties":{"id":{"type":"string","description":"The ID of an action from the Journey System (an action is spawned from an actionMap)"},"actionMap":{"description":"Details about the action map from the Journey System which triggered this action","$ref":"#/definitions/JourneyActionMap"}}},"JourneyActionMap":{"type":"object","required":["id","version"],"properties":{"id":{"type":"string","description":"The ID of the actionMap in the Journey System which triggered this action"},"version":{"type":"integer","format":"int32","description":"The version number of the actionMap in the Journey System at the time this action was triggered"}}},"CreateWebChatConversationResponse":{"type":"object","properties":{"id":{"type":"string","description":"Chat Conversation identifier"},"jwt":{"type":"string","description":"The JWT that you can use to identify subsequent calls on this conversation"},"eventStreamUri":{"type":"string","format":"uri","description":"The URI which provides the conversation event stream."},"member":{"description":"Chat Member","$ref":"#/definitions/WebChatMemberInfo"}}},"WebChatMemberInfo":{"type":"object","required":["role"],"properties":{"id":{"type":"string","description":"The communicationId of this member."},"displayName":{"type":"string","description":"The display name of the member."},"avatarImageUrl":{"type":"string","format":"uri","description":"The url to the avatar image of the member."},"role":{"type":"string","description":"The role of the member, one of [agent, customer, acd, workflow]","enum":["AGENT","CUSTOMER","WORKFLOW","ACD"]},"joinDate":{"type":"string","format":"date-time","description":"The time the member joined the conversation. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ"},"leaveDate":{"type":"string","format":"date-time","description":"The time the member left the conversation, or null if the member is still active in the conversation. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ"},"authenticatedGuest":{"type":"boolean","description":"If true, the guest member is an authenticated guest."},"customFields":{"type":"object","description":"Any custom fields of information pertaining to this member.","additionalProperties":{"type":"string"}},"state":{"type":"string","description":"The connection state of this member.","enum":["CONNECTED","DISCONNECTED","ALERTING"]}}},"ErrorBody":{"type":"object","properties":{"status":{"type":"integer","format":"int32"},"code":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":"string"},"message":{"type":"string"},"messageWithParams":{"type":"string"},"messageParams":{"type":"object","additionalProperties":{"type":"string"}},"contextId":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/definitions/Detail"}},"errors":{"type":"array","items":{"$ref":"#/definitions/ErrorBody"}}}},"Detail":{"type":"object","properties":{"errorCode":{"type":"string"},"fieldName":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":"string"}}},"WebChatGuestMediaRequest":{"type":"object","required":["state","types"],"properties":{"id":{"type":"string","description":"The globally unique identifier for the object.","readOnly":true},"name":{"type":"string"},"types":{"type":"array","description":"The types of media being requested.","items":{"type":"string","enum":["COBROWSE","SCREENSHARE"]}},"state":{"type":"string","description":"The state of the media request, one of PENDING|ACCEPTED|DECLINED|TIMEDOUT|CANCELLED|ERRORED.","enum":["PENDING","ACCEPTED","DECLINED","TIMEDOUT","CANCELLED","ERRORED"]},"communicationId":{"type":"string","description":"The ID of the new media communication, if applicable."},"selfUri":{"type":"string","format":"uri","description":"The URI for this object","readOnly":true}},"description":"Object representing the guest model of a media request of a chat conversation."},"WebChatMessageEntityList":{"type":"object","properties":{"pageSize":{"type":"integer","format":"int32"},"entities":{"type":"array","items":{"$ref":"#/definitions/WebChatMessage"}},"previousPage":{"type":"string"},"next":{"type":"string"},"selfUri":{"type":"string","format":"uri"}}},"WebChatMessage":{"type":"object","required":["body","bodyType","conversation","sender","timestamp"],"properties":{"id":{"type":"string","description":"The globally unique identifier for the object.","readOnly":true},"name":{"type":"string"},"conversation":{"description":"The identifier of the conversation","$ref":"#/definitions/WebChatConversation"},"sender":{"description":"The member who sent the message","$ref":"#/definitions/WebChatMemberInfo"},"body":{"type":"string","description":"The message body."},"bodyType":{"type":"string","description":"The purpose of the message within the conversation, such as a standard text entry versus a greeting.","enum":["standard","notice"]},"timestamp":{"type":"string","format":"date-time","description":"The timestamp of the message, in ISO-8601 format"},"selfUri":{"type":"string","format":"uri","description":"The URI for this object","readOnly":true}}},"WebChatConversation":{"type":"object","properties":{"id":{"type":"string","description":"The globally unique identifier for the object.","readOnly":true},"name":{"type":"string"},"member":{"description":"Chat Member","$ref":"#/definitions/WebChatMemberInfo"},"selfUri":{"type":"string","format":"uri","description":"The URI for this object","readOnly":true}}},"WebChatGuestMediaRequestEntityList":{"type":"object","properties":{"entities":{"type":"array","items":{"$ref":"#/definitions/WebChatGuestMediaRequest"}}}},"WebChatTyping":{"type":"object","required":["conversation","id","sender","timestamp"],"properties":{"id":{"type":"string","description":"The event identifier of this typing indicator event (useful to guard against event re-delivery"},"conversation":{"description":"The identifier of the conversation","$ref":"#/definitions/WebChatConversation"},"sender":{"description":"The member who sent the message","$ref":"#/definitions/WebChatMemberInfo"},"timestamp":{"type":"string","format":"date-time","description":"The timestamp of the message, in ISO-8601 format"}}},"CreateWebChatMessageRequest":{"type":"object","required":["body"],"properties":{"body":{"type":"string","description":"The message body. Note that message bodies are limited to 4,000 characters."},"bodyType":{"type":"string","description":"The purpose of the message within the conversation, such as a standard text entry versus a greeting.","enum":["standard","notice"]}}},"WebChatMemberInfoEntityList":{"type":"object","properties":{"entities":{"type":"array","items":{"$ref":"#/definitions/WebChatMemberInfo"}},"pageSize":{"type":"integer","format":"int32"},"pageNumber":{"type":"integer","format":"int32"},"total":{"type":"integer","format":"int64"},"firstUri":{"type":"string","format":"uri"},"selfUri":{"type":"string","format":"uri"},"nextUri":{"type":"string","format":"uri"},"previousUri":{"type":"string","format":"uri"},"lastUri":{"type":"string","format":"uri"},"pageCount":{"type":"integer","format":"int32"}}}},"responses":{"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"}}},"externalDocs":{"description":"PureCloud API Documentation","url":"https://developer.mypurecloud.com"}} \ No newline at end of file +{"swagger":"2.0","info":{"description":"With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more.","version":"v2","title":"PureCloud Platform API","termsOfService":"https://developer.mypurecloud.com/tos","contact":{"name":"PureCloud Developer Evangelists","url":"https://developer.mypurecloud.com","email":"DeveloperEvangelists@genesys.com"},"license":{"name":"ININ","url":"http://www.inin.com"}},"host":"api.mypurecloud.com","tags":[{"name":"Alerting","description":"Rules and alerts","externalDocs":{"description":"Alerting Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/alerting/index.html"}},{"name":"Analytics","description":"Analytics querying and reporting.","externalDocs":{"description":"Analytics Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/analytics/index.html"}},{"name":"Architect","description":"Flows, Prompts, IVR schedules, Dependency Tracking","externalDocs":{"description":"Architect Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/architect/index.html"}},{"name":"Audit","description":"","externalDocs":{"description":"Audit Documentation","url":""}},{"name":"Authorization","description":"Roles and permissions","externalDocs":{"description":"Authorization Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/authorization/index.html"}},{"name":"Badges","description":"Badges stats"},{"name":"Billing","description":"","externalDocs":{"description":"billing Documentation","url":"https://developer.mypurecloud.com/billing"}},{"name":"Bridge","description":""},{"name":"Callbacks","description":""},{"name":"Calls","description":""},{"name":"Carrier Services","description":""},{"name":"Chats","description":""},{"name":"Cobrowse","description":""},{"name":"Compliance","description":""},{"name":"Configuration","description":"","externalDocs":{"description":"Configuration Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/configuration/index.html"}},{"name":"Content Management","description":"","externalDocs":{"description":"Content Management Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/contentmanagement/index.html"}},{"name":"Conversations","description":"","externalDocs":{"description":"Conversations Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/conversations/index.html"}},{"name":"Data Extensions","description":"Data extensions","externalDocs":{"description":"Data Extensions","url":"https://developer.mypurecloud.com"}},{"name":"Directory Proxy","description":"Search, Suggest, and people"},{"name":"Docs","description":"Swagger documentation definitions","externalDocs":{"description":"docs","url":"https://developer.mypurecloud.com"}},{"name":"Downloads","description":"Download file","externalDocs":{"description":"Downloads Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/downloads/index.html"}},{"name":"Emails","description":""},{"name":"External Contacts","description":"External Organizations, contacts, notes and relationships","externalDocs":{"description":"External Contacts","url":"https://developer.mypurecloud.com/api/rest/v2/externalcontacts/index.html"}},{"name":"Fax","description":"","externalDocs":{"description":"Fax Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/fax/index.html"}},{"name":"Flows","description":"IVR Flows","externalDocs":{"description":"Flow Aggregates Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/analytics/flow_aggregate.html"}},{"name":"General Data Protection Regulation","description":"Working with General Data Protection Regulation (GDPR) requests"},{"name":"Geolocation","description":"","externalDocs":{"description":"Geolocation Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/geolocation/index.html"}},{"name":"Greetings","description":"","externalDocs":{"description":"Greetings Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/greetings/index.html"}},{"name":"Groups","description":"Groups, members","externalDocs":{"description":"Groups Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/groups/index.html"}},{"name":"Identity Provider","description":"Identity providers","externalDocs":{"description":"Identity Providers Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/identityproviders/index.html"}},{"name":"Integrations","description":"","externalDocs":{"description":"Integrations Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/integrations/index.html"}},{"name":"Journey","description":"Journey Analytics","externalDocs":{"description":"Journey documentation","url":"https://developer.mypurecloud.com/api/rest/v1/journey/index.html"}},{"name":"Languages","description":"Available languages","externalDocs":{"description":"Languages Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/languages/index.html"}},{"name":"Licensing","description":""},{"name":"License","description":"Per-user platform license assignments"},{"name":"Locations","description":"Physical locations","externalDocs":{"description":"Locations Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/locations/index.html"}},{"name":"Marketplace","description":"Marketplace listing management"},{"name":"Meeting","description":"","externalDocs":{"description":"Meeting Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/meetings/index.html"}},{"name":"Messaging","description":"Messaging","externalDocs":{"description":"Messaging Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/messaging/index.html"}},{"name":"Mobile Devices","description":"Devices","externalDocs":{"description":"Devices Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/devices/index.html"}},{"name":"Notifications","description":"Channels, subscriptions, topics","externalDocs":{"description":"Notifications Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/notifications/index.html"}},{"name":"OAuth","description":"OAuth clients, providers","externalDocs":{"description":"OAuth Documentation","url":""}},{"name":"Objects","description":"Access-controlled objects in the platform","externalDocs":{"description":"authorization docs","url":"https://developer.mypurecloud.com/authorization"}},{"name":"Organization","description":"Organization"},{"name":"Organization Authorization","description":"Organization Authorization"},{"name":"Outbound","description":"","externalDocs":{"description":"Outbound Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/outbound/index.html"}},{"name":"Presence","description":"User and organization presences","externalDocs":{"description":"Presence Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/presence/index.html"}},{"name":"Process Automation","description":"Work items, flows"},{"name":"Quality","description":"Evaluations, calibrations","externalDocs":{"description":"Quality Management Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/quality/index.html"}},{"name":"Recording","description":"Recordings, policies, annotations, orphans","externalDocs":{"description":"Recording Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/recording/index.html"}},{"name":"Response Management","description":"Responses, library, query","externalDocs":{"description":"Response Management Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/responsemanagement/index.html"}},{"name":"Routing","description":"Queues, wrapup codes, skills, email & sms config","externalDocs":{"description":"Routing Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/routing/index.html"}},{"name":"SCIM","description":"System for Cross-domain Identity Management","externalDocs":{"description":"System for Cross-domain Identity Management: Definitions, Overview, Concepts, and Requirements","url":"https://tools.ietf.org/html/rfc7642"}},{"name":"Scripts","description":"Agent-facing scripts for interactions","externalDocs":{"description":"Scripts Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/scripts/index.html"}},{"name":"Search","description":"Search aggregate, users, groups","externalDocs":{"description":"Search Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/search/index.html"}},{"name":"SignedData","description":"Package data in signed JWTs"},{"name":"Socialize","description":"Gets, sets and updates entity data for the Socialize service"},{"name":"Stations","description":"Stations","externalDocs":{"description":"Stations Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/stations/index.html"}},{"name":"Suggest","description":"Search suggest user, group, locations"},{"name":"Telephony","description":"Telephony providers and configuration","externalDocs":{"description":"Telephony Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/telephonyprovidersedge/index.html"}},{"name":"Telephony Providers Edge","description":"Edge phones, trunks, lines.","externalDocs":{"description":"telephony provider edge","url":"https://developer.mypurecloud.com/api/rest/v2/telephonyprovidersedge/index.html"}},{"name":"Tokens","description":"Authentication Tokens","externalDocs":{"description":"Tokens Documentation","url":""}},{"name":"User Recordings","description":"Summary, media","externalDocs":{"description":"User Recordings Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/userrecordings/index.html"}},{"name":"Users","description":"Me, routing, roles","externalDocs":{"description":"Users Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/users/index.html"}},{"name":"Utilities","description":"","externalDocs":{"description":"Utilities Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/utilities/index.html"}},{"name":"Videos","description":""},{"name":"Virtual Reality","description":"Virtual Reality scenes and assets"},{"name":"Voicemail","description":"Mailbox, messages, policy","externalDocs":{"description":"Voicemail Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/voicemail/index.html"}},{"name":"WebChat","description":"WebChat deployments"},{"name":"Workforce Management","description":"Adherence, Schedules, Forecasts, Intraday Monitoring, Time Off Requests, Configuration","externalDocs":{"description":"Workforce Management Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/workforcemanagement/index.html"}}],"schemes":["https"],"consumes":["application/json"],"produces":["application/json"],"paths":{"/api/v2/webchat/guest/conversations/{conversationId}/messages/{messageId}":{"get":{"tags":["WebChat"],"summary":"Get a web chat conversation message","description":"","operationId":"getWebchatGuestConversationMessage","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"messageId","in":"path","description":"messageId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMessage"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMessage"}},"/api/v2/webchat/guest/conversations/{conversationId}/messages":{"get":{"tags":["WebChat"],"summary":"Get the messages of a chat conversation.","description":"","operationId":"getWebchatGuestConversationMessages","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"after","in":"query","description":"If available, get the messages chronologically after the id of this message","required":false,"type":"string"},{"name":"before","in":"query","description":"If available, get the messages chronologically before the id of this message","required":false,"type":"string"},{"name":"sortOrder","in":"query","description":"Sort order","required":false,"type":"string","default":"ascending","enum":["ascending","descending"]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMessageEntityList"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMessages"}},"/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}/messages":{"post":{"tags":["WebChat"],"summary":"Send a message in a chat conversation.","description":"","operationId":"postWebchatGuestConversationMemberMessages","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"memberId","in":"path","description":"memberId","required":true,"type":"string"},{"in":"body","name":"body","description":"Message","required":true,"schema":{"$ref":"#/definitions/CreateWebChatMessageRequest"}}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMessage"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","chat.error.conversation.state":"The conversation is in a state which does not permit this action.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","chat.error.member.state":"The conversation member is in a state which does not permit this action.","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"postWebchatGuestConversationMemberMessages"}},"/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}/typing":{"post":{"tags":["WebChat"],"summary":"Send a typing-indicator in a chat conversation.","description":"","operationId":"postWebchatGuestConversationMemberTyping","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"memberId","in":"path","description":"memberId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatTyping"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","chat.error.conversation.state":"The conversation is in a state which does not permit this action.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","chat.error.member.state":"The conversation member is in a state which does not permit this action.","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"postWebchatGuestConversationMemberTyping"}},"/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}":{"get":{"tags":["WebChat"],"summary":"Get a web chat conversation member","description":"","operationId":"getWebchatGuestConversationMember","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"memberId","in":"path","description":"memberId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMemberInfo"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMember"},"delete":{"tags":["WebChat"],"summary":"Remove a member from a chat conversation","description":"","operationId":"deleteWebchatGuestConversationMember","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"memberId","in":"path","description":"memberId","required":true,"type":"string"}],"responses":{"204":{"description":"Operation was successful."},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","chat.error.conversation.state":"The conversation is in a state which does not permit this action.","chat.error.member.state":"The conversation member is in a state which does not permit this action."}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"deleteWebchatGuestConversationMember"}},"/api/v2/webchat/guest/conversations/{conversationId}/mediarequests/{mediaRequestId}":{"get":{"tags":["WebChat"],"summary":"Get a media request in the conversation","description":"","operationId":"getWebchatGuestConversationMediarequest","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"mediaRequestId","in":"path","description":"mediaRequestId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatGuestMediaRequest"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMediarequest"},"patch":{"tags":["WebChat"],"summary":"Update a media request in the conversation, setting the state to ACCEPTED/DECLINED/ERRORED","description":"","operationId":"patchWebchatGuestConversationMediarequest","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"mediaRequestId","in":"path","description":"mediaRequestId","required":true,"type":"string"},{"in":"body","name":"body","description":"Request","required":true,"schema":{"$ref":"#/definitions/WebChatGuestMediaRequest"}}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatGuestMediaRequest"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","chat.error.conversation.state":"The conversation is in a state which does not permit this action.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"patchWebchatGuestConversationMediarequest"}},"/api/v2/webchat/guest/conversations":{"post":{"tags":["WebChat"],"summary":"Create an ACD chat conversation from an external customer.","description":"This endpoint will create a new ACD Chat conversation under the specified Chat Deployment.\n The conversation will begin with a guest member in it (with a role=CUSTOMER) according to the customer information that is supplied. If the guest member is authenticated, the 'memberAuthToken' field should include his JWT as generated by the 'POST /api/v2/signeddata' resource; if the guest member is anonymous (and the Deployment permits it) this field can be omitted.\n The returned data includes the IDs of the conversation created, along with a newly-create JWT token that you can supply to all future endpoints as authentication to perform operations against that conversation. After successfully creating a conversation, you should connect a websocket to the event stream named in the 'eventStreamUri' field of the response; the conversation is not routed until the event stream is attached.","operationId":"postWebchatGuestConversations","produces":["application/json"],"parameters":[{"in":"body","name":"body","description":"CreateConversationRequest","required":true,"schema":{"$ref":"#/definitions/CreateWebChatConversationRequest"}}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/CreateWebChatConversationResponse"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"chat.deployment.disabled":"The web chat deployment is currently disabled.","chat.deployment.bad.auth":"The customer member authentication has failed.","chat.error.invalid.queue":"The specified queue is not valid.","bad.request":"The request could not be understood by the server due to malformed syntax.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","chat.error.createconversationrequest.routingtarget":"The routing target is not valid.","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s","chat.deployment.require.auth":"The deployment requires the customer member to be authenticated."}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"credentials.expired":"The supplied credentials are expired and cannot be used.","authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"x-purecloud-method-name":"postWebchatGuestConversations"}},"/api/v2/webchat/guest/conversations/{conversationId}/members":{"get":{"tags":["WebChat"],"summary":"Get the members of a chat conversation.","description":"","operationId":"getWebchatGuestConversationMembers","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"pageSize","in":"query","description":"The number of entries to return per page, or omitted for the default.","required":false,"type":"integer","default":25,"format":"int32"},{"name":"pageNumber","in":"query","description":"The page number to return, or omitted for the first page.","required":false,"type":"integer","default":1,"format":"int32"},{"name":"excludeDisconnectedMembers","in":"query","description":"If true, the results will not contain members who have a DISCONNECTED state.","required":false,"type":"boolean","default":false}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMemberInfoEntityList"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMembers"}},"/api/v2/webchat/guest/conversations/{conversationId}/mediarequests":{"get":{"tags":["WebChat"],"summary":"Get all media requests to the guest in the conversation","description":"","operationId":"getWebchatGuestConversationMediarequests","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatGuestMediaRequestEntityList"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMediarequests"}}},"securityDefinitions":{"PureCloud OAuth":{"type":"oauth2","authorizationUrl":"https://login.mypurecloud.com/authorize","flow":"implicit","scopes":{"all":"All the scopes"}},"Guest Chat JWT":{"type":"apiKey","name":"Authorization","in":"header"}},"definitions":{"WebChatMessage":{"type":"object","required":["body","bodyType","conversation","sender","timestamp"],"properties":{"id":{"type":"string","description":"The globally unique identifier for the object.","readOnly":true},"name":{"type":"string"},"conversation":{"description":"The identifier of the conversation","$ref":"#/definitions/WebChatConversation"},"sender":{"description":"The member who sent the message","$ref":"#/definitions/WebChatMemberInfo"},"body":{"type":"string","description":"The message body."},"bodyType":{"type":"string","description":"The purpose of the message within the conversation, such as a standard text entry versus a greeting.","enum":["standard","notice"]},"timestamp":{"type":"string","format":"date-time","description":"The timestamp of the message, in ISO-8601 format"},"selfUri":{"type":"string","format":"uri","description":"The URI for this object","readOnly":true}}},"WebChatConversation":{"type":"object","properties":{"id":{"type":"string","description":"The globally unique identifier for the object.","readOnly":true},"name":{"type":"string"},"member":{"description":"Chat Member","$ref":"#/definitions/WebChatMemberInfo"},"selfUri":{"type":"string","format":"uri","description":"The URI for this object","readOnly":true}}},"WebChatMemberInfo":{"type":"object","required":["role"],"properties":{"id":{"type":"string","description":"The communicationId of this member."},"displayName":{"type":"string","description":"The display name of the member."},"avatarImageUrl":{"type":"string","format":"uri","description":"The url to the avatar image of the member."},"role":{"type":"string","description":"The role of the member, one of [agent, customer, acd, workflow]","enum":["AGENT","CUSTOMER","WORKFLOW","ACD"]},"joinDate":{"type":"string","format":"date-time","description":"The time the member joined the conversation. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ"},"leaveDate":{"type":"string","format":"date-time","description":"The time the member left the conversation, or null if the member is still active in the conversation. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ"},"authenticatedGuest":{"type":"boolean","description":"If true, the guest member is an authenticated guest."},"customFields":{"type":"object","description":"Any custom fields of information pertaining to this member.","additionalProperties":{"type":"string"}},"state":{"type":"string","description":"The connection state of this member.","enum":["CONNECTED","DISCONNECTED","ALERTING"]}}},"ErrorBody":{"type":"object","properties":{"status":{"type":"integer","format":"int32"},"code":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":"string"},"message":{"type":"string"},"messageWithParams":{"type":"string"},"messageParams":{"type":"object","additionalProperties":{"type":"string"}},"contextId":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/definitions/Detail"}},"errors":{"type":"array","items":{"$ref":"#/definitions/ErrorBody"}}}},"Detail":{"type":"object","properties":{"errorCode":{"type":"string"},"fieldName":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":"string"}}},"WebChatMessageEntityList":{"type":"object","properties":{"pageSize":{"type":"integer","format":"int32"},"entities":{"type":"array","items":{"$ref":"#/definitions/WebChatMessage"}},"previousPage":{"type":"string"},"next":{"type":"string"},"selfUri":{"type":"string","format":"uri"}}},"CreateWebChatMessageRequest":{"type":"object","required":["body"],"properties":{"body":{"type":"string","description":"The message body. Note that message bodies are limited to 4,000 characters."},"bodyType":{"type":"string","description":"The purpose of the message within the conversation, such as a standard text entry versus a greeting.","enum":["standard","notice"]}}},"WebChatTyping":{"type":"object","required":["conversation","id","sender","timestamp"],"properties":{"id":{"type":"string","description":"The event identifier of this typing indicator event (useful to guard against event re-delivery"},"conversation":{"description":"The identifier of the conversation","$ref":"#/definitions/WebChatConversation"},"sender":{"description":"The member who sent the message","$ref":"#/definitions/WebChatMemberInfo"},"timestamp":{"type":"string","format":"date-time","description":"The timestamp of the message, in ISO-8601 format"}}},"WebChatGuestMediaRequest":{"type":"object","required":["state","types"],"properties":{"id":{"type":"string","description":"The globally unique identifier for the object.","readOnly":true},"name":{"type":"string"},"types":{"type":"array","description":"The types of media being requested.","items":{"type":"string","enum":["COBROWSE","SCREENSHARE"]}},"state":{"type":"string","description":"The state of the media request, one of PENDING|ACCEPTED|DECLINED|TIMEDOUT|CANCELLED|ERRORED.","enum":["PENDING","ACCEPTED","DECLINED","TIMEDOUT","CANCELLED","ERRORED"]},"communicationId":{"type":"string","description":"The ID of the new media communication, if applicable."},"securityKey":{"type":"string","description":"The security information related to a media request."},"selfUri":{"type":"string","format":"uri","description":"The URI for this object","readOnly":true}},"description":"Object representing the guest model of a media request of a chat conversation."},"CreateWebChatConversationRequest":{"type":"object","required":["deploymentId","memberInfo","organizationId","routingTarget"],"properties":{"organizationId":{"type":"string","description":"The organization identifier."},"deploymentId":{"type":"string","description":"The web chat Deployment ID which contains the appropriate settings for this chat conversation."},"routingTarget":{"description":"The routing information to use for the new chat conversation.","$ref":"#/definitions/WebChatRoutingTarget"},"memberInfo":{"description":"The guest member info to use for the new chat conversation.","$ref":"#/definitions/GuestMemberInfo"},"memberAuthToken":{"type":"string","description":"If the guest member is an authenticated member (ie, not anonymous) his JWT is provided here. The token will have been previously generated with the \"POST /api/v2/signeddata\" resource."},"journeyContext":{"description":"A subset of the Journey System's data relevant to this conversation/session request (for external linkage and internal usage/context).","$ref":"#/definitions/JourneyContext"}}},"WebChatRoutingTarget":{"type":"object","required":["targetAddress","targetType"],"properties":{"targetType":{"type":"string","description":"The target type of the routing target, such as 'QUEUE'.","enum":["QUEUE"]},"targetAddress":{"type":"string","description":"The target of the route, in the format appropriate given the 'targetType'."},"skills":{"type":"array","description":"The list of skill names to use for routing.","items":{"type":"string"}},"language":{"type":"string","description":"The language name to use for routing."},"priority":{"type":"integer","format":"int64","description":"The priority to assign to the conversation for routing."}}},"GuestMemberInfo":{"type":"object","required":["displayName"],"properties":{"displayName":{"type":"string","description":"The display name to use for the guest member in the conversation."},"avatarImageUrl":{"type":"string","format":"uri","description":"The URL to the avatar image to use for the guest member in the conversation, if any."},"customFields":{"type":"object","description":"Any custom fields of information, in key-value format, to attach to the guest member in the conversation.","additionalProperties":{"type":"string"}}}},"JourneyContext":{"type":"object","properties":{"customer":{"description":"A subset of the Journey System's customer data at a point-in-time (for external linkage and internal usage/context)","$ref":"#/definitions/JourneyCustomer"},"customerSession":{"description":"A subset of the Journey System's tracked customer session data at a point-in-time (for external linkage and internal usage/context)","$ref":"#/definitions/JourneyCustomerSession"},"triggeringAction":{"description":"A subset of the Journey System's action data relevant to a part of a conversation (for external linkage and internal usage/context)","$ref":"#/definitions/JourneyAction"}}},"JourneyCustomer":{"type":"object","required":["id","idType"],"properties":{"id":{"type":"string","description":"An ID of a customer within the Journey System at a point-in-time. Note that a customer entity can have multiple customerIds based on the stitching process. Depending on the context within the PureCloud conversation, this may or may not be mutable."},"idType":{"type":"string","description":"The type of the customerId within the Journey System (e.g. cookie)."}}},"JourneyCustomerSession":{"type":"object","required":["id","type"],"properties":{"id":{"type":"string","description":"An ID of a Customer/User's session within the Journey System at a point-in-time"},"type":{"type":"string","description":"The type of the Customer/User's session within the Journey System (e.g. web, app)"}}},"JourneyAction":{"type":"object","required":["id"],"properties":{"id":{"type":"string","description":"The ID of an action from the Journey System (an action is spawned from an actionMap)"},"actionMap":{"description":"Details about the action map from the Journey System which triggered this action","$ref":"#/definitions/JourneyActionMap"}}},"JourneyActionMap":{"type":"object","required":["id","version"],"properties":{"id":{"type":"string","description":"The ID of the actionMap in the Journey System which triggered this action"},"version":{"type":"integer","format":"int32","description":"The version number of the actionMap in the Journey System at the time this action was triggered"}}},"CreateWebChatConversationResponse":{"type":"object","properties":{"id":{"type":"string","description":"Chat Conversation identifier"},"jwt":{"type":"string","description":"The JWT that you can use to identify subsequent calls on this conversation"},"eventStreamUri":{"type":"string","format":"uri","description":"The URI which provides the conversation event stream."},"member":{"description":"Chat Member","$ref":"#/definitions/WebChatMemberInfo"}}},"WebChatMemberInfoEntityList":{"type":"object","properties":{"entities":{"type":"array","items":{"$ref":"#/definitions/WebChatMemberInfo"}},"pageSize":{"type":"integer","format":"int32"},"pageNumber":{"type":"integer","format":"int32"},"total":{"type":"integer","format":"int64"},"firstUri":{"type":"string","format":"uri"},"selfUri":{"type":"string","format":"uri"},"nextUri":{"type":"string","format":"uri"},"previousUri":{"type":"string","format":"uri"},"lastUri":{"type":"string","format":"uri"},"pageCount":{"type":"integer","format":"int32"}}},"WebChatGuestMediaRequestEntityList":{"type":"object","properties":{"entities":{"type":"array","items":{"$ref":"#/definitions/WebChatGuestMediaRequest"}}}}},"responses":{"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"}},"429":{"description":"Rate limit exceeded the maximum [%s] requests within [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"}}},"externalDocs":{"description":"PureCloud API Documentation","url":"https://developer.mypurecloud.com"}} \ No newline at end of file diff --git a/version.json b/version.json index 6ce6db08..cac7069d 100644 --- a/version.json +++ b/version.json @@ -1,9 +1,9 @@ { - "major": 3, + "major": 4, "minor": 0, "point": 0, "prerelease": "", "apiVersion": 0, - "display": "3.0.0", - "displayFull": "3.0.0" + "display": "4.0.0", + "displayFull": "4.0.0" } \ No newline at end of file