            }
            }

            // Append any remaining raw tokens
            while (rawIdx < rawCopy.length) {
                alignedRaw.push(rawCopy[rawIdx]);
                rawIdx += 1;
            }

            return alignedRaw;
        }

        function base64Encode(str) {
            const bytes = new TextEncoder().encode(str);
            let binary = "";
            bytes.forEach((b) => binary += String.fromCharCode(b));
            return btoa(binary);
        }

    </script>

    