|  | 
| 747 | 747 |             return this; | 
| 748 | 748 |         }; | 
| 749 | 749 |         default_1.prototype.getVersion = function () { | 
| 750 |  | -            return '7.1.1'; | 
|  | 750 | +            return '7.1.2'; | 
| 751 | 751 |         }; | 
| 752 | 752 |         default_1.prototype._addPnsdkSuffix = function (name, suffix) { | 
| 753 | 753 |             this._PNSDKSuffix[name] = suffix; | 
|  | 
| 7672 | 7672 |         return default_1; | 
| 7673 | 7673 |     }()); | 
| 7674 | 7674 | 
 | 
|  | 7675 | +    var BASE64_CHARMAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; | 
|  | 7676 | +    /** | 
|  | 7677 | +     * Decode a Base64 encoded string. | 
|  | 7678 | +     * | 
|  | 7679 | +     * @param paddedInput Base64 string with padding | 
|  | 7680 | +     * @returns ArrayBuffer with decoded data | 
|  | 7681 | +     */ | 
|  | 7682 | +    function decode$1(paddedInput) { | 
|  | 7683 | +        // Remove up to last two equal signs. | 
|  | 7684 | +        var input = paddedInput.replace(/==?$/, ''); | 
|  | 7685 | +        var outputLength = Math.floor((input.length / 4) * 3); | 
|  | 7686 | +        // Prepare output buffer. | 
|  | 7687 | +        var data = new ArrayBuffer(outputLength); | 
|  | 7688 | +        var view = new Uint8Array(data); | 
|  | 7689 | +        var cursor = 0; | 
|  | 7690 | +        /** | 
|  | 7691 | +         * Returns the next integer representation of a sixtet of bytes from the input | 
|  | 7692 | +         * @returns sixtet of bytes | 
|  | 7693 | +         */ | 
|  | 7694 | +        function nextSixtet() { | 
|  | 7695 | +            var char = input.charAt(cursor++); | 
|  | 7696 | +            var index = BASE64_CHARMAP.indexOf(char); | 
|  | 7697 | +            if (index === -1) { | 
|  | 7698 | +                throw new Error("Illegal character at ".concat(cursor, ": ").concat(input.charAt(cursor - 1))); | 
|  | 7699 | +            } | 
|  | 7700 | +            return index; | 
|  | 7701 | +        } | 
|  | 7702 | +        for (var i = 0; i < outputLength; i += 3) { | 
|  | 7703 | +            // Obtain four sixtets | 
|  | 7704 | +            var sx1 = nextSixtet(); | 
|  | 7705 | +            var sx2 = nextSixtet(); | 
|  | 7706 | +            var sx3 = nextSixtet(); | 
|  | 7707 | +            var sx4 = nextSixtet(); | 
|  | 7708 | +            // Encode them as three octets | 
|  | 7709 | +            var oc1 = ((sx1 & 63) << 2) | (sx2 >> 4); | 
|  | 7710 | +            var oc2 = ((sx2 & 15) << 4) | (sx3 >> 2); | 
|  | 7711 | +            var oc3 = ((sx3 & 3) << 6) | (sx4 >> 0); | 
|  | 7712 | +            view[i] = oc1; | 
|  | 7713 | +            // Skip padding bytes. | 
|  | 7714 | +            if (sx3 != 64) | 
|  | 7715 | +                view[i + 1] = oc2; | 
|  | 7716 | +            if (sx4 != 64) | 
|  | 7717 | +                view[i + 2] = oc3; | 
|  | 7718 | +        } | 
|  | 7719 | +        return data; | 
|  | 7720 | +    } | 
|  | 7721 | + | 
|  | 7722 | +    function stringifyBufferKeys(obj) { | 
|  | 7723 | +        var isObject = function (value) { return value && typeof value === 'object' && value.constructor === Object; }; | 
|  | 7724 | +        var isString = function (value) { return typeof value === 'string' || value instanceof String; }; | 
|  | 7725 | +        var isNumber = function (value) { return typeof value === 'number' && isFinite(value); }; | 
|  | 7726 | +        if (!isObject(obj)) { | 
|  | 7727 | +            return obj; | 
|  | 7728 | +        } | 
|  | 7729 | +        var normalizedObject = {}; | 
|  | 7730 | +        Object.keys(obj).forEach(function (key) { | 
|  | 7731 | +            var keyIsString = isString(key); | 
|  | 7732 | +            var stringifiedKey = key; | 
|  | 7733 | +            var value = obj[key]; | 
|  | 7734 | +            if (Array.isArray(key) || (keyIsString && key.indexOf(',') >= 0)) { | 
|  | 7735 | +                var bytes = keyIsString ? key.split(',') : key; | 
|  | 7736 | +                stringifiedKey = bytes.reduce(function (string, byte) { | 
|  | 7737 | +                    string += String.fromCharCode(byte); | 
|  | 7738 | +                    return string; | 
|  | 7739 | +                }, ''); | 
|  | 7740 | +            } | 
|  | 7741 | +            else if (isNumber(key) || (keyIsString && !isNaN(key))) { | 
|  | 7742 | +                stringifiedKey = String.fromCharCode(keyIsString ? parseInt(key, 10) : 10); | 
|  | 7743 | +            } | 
|  | 7744 | +            normalizedObject[stringifiedKey] = isObject(value) ? stringifyBufferKeys(value) : value; | 
|  | 7745 | +        }); | 
|  | 7746 | +        return normalizedObject; | 
|  | 7747 | +    } | 
|  | 7748 | + | 
| 7675 | 7749 |     var default_1$1 = /** @class */ (function () { | 
| 7676 | 7750 |         function default_1(decode, base64ToBinary) { | 
| 7677 | 7751 |             this._base64ToBinary = base64ToBinary; | 
|  | 
| 11499 | 11573 |             return false; | 
| 11500 | 11574 |         } | 
| 11501 | 11575 |     } | 
| 11502 |  | -    function base64ToBinary(base64String) { | 
| 11503 |  | -        var parsedWordArray = hmacSha256.enc.Base64.parse(base64String).words; | 
| 11504 |  | -        var arrayBuffer = new ArrayBuffer(parsedWordArray.length * 4); | 
| 11505 |  | -        var view = new Uint8Array(arrayBuffer); | 
| 11506 |  | -        var filledArrayBuffer = null; | 
| 11507 |  | -        var zeroBytesCount = 0; | 
| 11508 |  | -        var byteOffset = 0; | 
| 11509 |  | -        for (var wordIdx = 0; wordIdx < parsedWordArray.length; wordIdx += 1) { | 
| 11510 |  | -            var word = parsedWordArray[wordIdx]; | 
| 11511 |  | -            byteOffset = wordIdx * 4; | 
| 11512 |  | -            view[byteOffset] = (word & 0xff000000) >> 24; | 
| 11513 |  | -            view[byteOffset + 1] = (word & 0x00ff0000) >> 16; | 
| 11514 |  | -            view[byteOffset + 2] = (word & 0x0000ff00) >> 8; | 
| 11515 |  | -            view[byteOffset + 3] = word & 0x000000ff; | 
| 11516 |  | -        } | 
| 11517 |  | -        for (var byteIdx = byteOffset + 3; byteIdx >= byteOffset; byteIdx -= 1) { | 
| 11518 |  | -            if (view[byteIdx] === 0 && zeroBytesCount < 3) { | 
| 11519 |  | -                zeroBytesCount += 1; | 
| 11520 |  | -            } | 
| 11521 |  | -        } | 
| 11522 |  | -        if (zeroBytesCount > 0) { | 
| 11523 |  | -            filledArrayBuffer = view.buffer.slice(0, view.byteLength - zeroBytesCount); | 
| 11524 |  | -        } | 
| 11525 |  | -        else { | 
| 11526 |  | -            filledArrayBuffer = view.buffer; | 
| 11527 |  | -        } | 
| 11528 |  | -        return filledArrayBuffer; | 
| 11529 |  | -    } | 
| 11530 |  | -    function stringifyBufferKeys(obj) { | 
| 11531 |  | -        var isObject = function (value) { return value && typeof value === 'object' && value.constructor === Object; }; | 
| 11532 |  | -        var isString = function (value) { return typeof value === 'string' || value instanceof String; }; | 
| 11533 |  | -        var isNumber = function (value) { return typeof value === 'number' && isFinite(value); }; | 
| 11534 |  | -        if (!isObject(obj)) { | 
| 11535 |  | -            return obj; | 
| 11536 |  | -        } | 
| 11537 |  | -        var normalizedObject = {}; | 
| 11538 |  | -        Object.keys(obj).forEach(function (key) { | 
| 11539 |  | -            var keyIsString = isString(key); | 
| 11540 |  | -            var stringifiedKey = key; | 
| 11541 |  | -            var value = obj[key]; | 
| 11542 |  | -            if (Array.isArray(key) || (keyIsString && key.indexOf(',') >= 0)) { | 
| 11543 |  | -                var bytes = keyIsString ? key.split(',') : key; | 
| 11544 |  | -                stringifiedKey = bytes.reduce(function (string, byte) { | 
| 11545 |  | -                    string += String.fromCharCode(byte); | 
| 11546 |  | -                    return string; | 
| 11547 |  | -                }, ''); | 
| 11548 |  | -            } | 
| 11549 |  | -            else if (isNumber(key) || (keyIsString && !isNaN(key))) { | 
| 11550 |  | -                stringifiedKey = String.fromCharCode(keyIsString ? parseInt(key, 10) : 10); | 
| 11551 |  | -            } | 
| 11552 |  | -            normalizedObject[stringifiedKey] = isObject(value) ? stringifyBufferKeys(value) : value; | 
| 11553 |  | -        }); | 
| 11554 |  | -        return normalizedObject; | 
| 11555 |  | -    } | 
| 11556 | 11576 |     var default_1 = /** @class */ (function (_super) { | 
| 11557 | 11577 |         __extends(default_1, _super); | 
| 11558 | 11578 |         function default_1(setup) { | 
|  | 
| 11569 | 11589 |                 getfile: getfile, | 
| 11570 | 11590 |                 postfile: postfile, | 
| 11571 | 11591 |             }); | 
| 11572 |  | -            setup.cbor = new default_1$1(function (arrayBuffer) { return stringifyBufferKeys(CborReader.decode(arrayBuffer)); }, base64ToBinary); | 
|  | 11592 | +            setup.cbor = new default_1$1(function (arrayBuffer) { return stringifyBufferKeys(CborReader.decode(arrayBuffer)); }, decode$1); | 
| 11573 | 11593 |             setup.PubNubFile = PubNubFile; | 
| 11574 | 11594 |             setup.cryptography = new WebCryptography(); | 
| 11575 | 11595 |             _this = _super.call(this, setup) || this; | 
|  | 
0 commit comments