import{__exports as r}from"../../../_virtual/es.uint8-array.to-base64.mjs";import{__require as t}from"../internals/export.mjs";import{__require as e}from"../internals/global-this.mjs";import{__require as a}from"../internals/function-uncurry-this.mjs";import{__require as i}from"../internals/an-object-or-undefined.mjs";import{__require as n}from"../internals/an-uint8-array.mjs";import{__require as o}from"../internals/array-buffer-not-detached.mjs";import{__require as s}from"../internals/base64-map.mjs";import{__require as m}from"../internals/get-alphabet-option.mjs";var u;function f(){if(u)return r;u=1;var f=t(),_=e(),p=a(),l=i(),c=n(),h=o(),j=s(),q=m(),b=j.i2c,d=j.i2cUrl,y=p("".charAt),g=_.Uint8Array,v=!g||!g.prototype.toBase64||!function(){try{(new g).toBase64(null)}catch(r){return!0}}();return g&&f({target:"Uint8Array",proto:!0,forced:v},{toBase64:function(){var r=c(this),t=arguments.length?l(arguments[0]):void 0,e="base64"===q(t)?b:d,a=!!t&&!!t.omitPadding;h(this.buffer);for(var i,n="",o=0,s=r.length,m=function(r){return y(e,i>>6*r&63)};o+2<s;o+=3)i=(r[o]<<16)+(r[o+1]<<8)+r[o+2],n+=m(3)+m(2)+m(1)+m(0);return o+2===s?(i=(r[o]<<16)+(r[o+1]<<8),n+=m(3)+m(2)+m(1)+(a?"":"=")):o+1===s&&(i=r[o]<<16,n+=m(3)+m(2)+(a?"":"==")),n}}),r}export{f as __require};