(self.webpackChunkchatgot_client_deepsider=self.webpackChunkchatgot_client_deepsider||[]).push([[657],{23807:function(e){
/*!
 * Compressor.js v1.2.1
 * https://fengyuanchen.github.io/compressorjs
 *
 * Copyright 2018-present Chen Fengyuan
 * Released under the MIT license
 *
 * Date: 2023-02-28T14:09:41.732Z
 */
e.exports=function(){"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function t(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?e(Object(i),!0).forEach((function(e){n(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}function a(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function n(e,t,r){return(t=s(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},o.apply(this,arguments)}function l(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function s(e){var t=l(e,"string");return"symbol"==typeof t?t:String(t)}var c={exports:{}};!function(e){"undefined"!=typeof window&&function(t){var r=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,i=t.Blob&&function(){try{return Boolean(new Blob)}catch(e){return!1}}(),a=i&&t.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(e){return!1}}(),n=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,o=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,l=(i||n)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(e){var t,r,l,s,c,u,f,h,d;if(!(t=e.match(o)))throw new Error("invalid data URI");for(r=t[2]?t[1]:"text/plain"+(t[3]||";charset=US-ASCII"),l=!!t[4],s=e.slice(t[0].length),c=l?atob(s):decodeURIComponent(s),u=new ArrayBuffer(c.length),f=new Uint8Array(u),h=0;h<c.length;h+=1)f[h]=c.charCodeAt(h);return i?new Blob([a?f:u],{type:r}):((d=new n).append(u),d.getBlob(r))};t.HTMLCanvasElement&&!r.toBlob&&(r.mozGetAsFile?r.toBlob=function(e,t,i){var a=this;setTimeout((function(){i&&r.toDataURL&&l?e(l(a.toDataURL(t,i))):e(a.mozGetAsFile("blob",t))}))}:r.toDataURL&&l&&(r.msToBlob?r.toBlob=function(e,t,i){var a=this;setTimeout((function(){(t&&"image/png"!==t||i)&&r.toDataURL&&l?e(l(a.toDataURL(t,i))):e(a.msToBlob(t))}))}:r.toBlob=function(e,t,r){var i=this;setTimeout((function(){e(l(i.toDataURL(t,r)))}))})),e.exports?e.exports=l:t.dataURLtoBlob=l}(window)}(c);var u=c.exports,f=function(e){return"undefined"!=typeof Blob&&(e instanceof Blob||"[object Blob]"===Object.prototype.toString.call(e))},h={strict:!0,checkOrientation:!0,retainExif:!1,maxWidth:1/0,maxHeight:1/0,minWidth:0,minHeight:0,width:void 0,height:void 0,resize:"none",quality:0.8,mimeType:"auto",convertTypes:["image/png"],convertSize:5000000,beforeDraw:null,drew:null,success:null,error:null},d="undefined"!=typeof window&&void 0!==window.document?window:{},b=function(e){return e>0&&e<1/0},p=Array.prototype.slice;function m(e){return Array.from?Array.from(e):p.call(e)}var v=/^image\/.+$/;function g(e){return v.test(e)}function w(e){var t=g(e)?e.substr(6):"";return"jpeg"===t&&(t="jpg"),".".concat(t)}var y=String.fromCharCode;function B(e,t,r){var i,a="";for(r+=t,i=t;i<r;i+=1)a+=y(e.getUint8(i));return a}var U=d.btoa;function O(e,t){for(var r=[],i=8192,a=new Uint8Array(e);a.length>0;)r.push(y.apply(null,m(a.subarray(0,i)))),a=a.subarray(i);return"data:".concat(t,";base64,").concat(U(r.join("")))}function j(e){var t,r=new DataView(e);try{var i,a,n;if(0xFF===r.getUint8(0)&&0xD8===r.getUint8(1))for(var o=r.byteLength,l=2;l+1<o;){if(0xFF===r.getUint8(l)&&0xE1===r.getUint8(l+1)){a=l;break}l+=1}if(a){var s=a+10;if("Exif"===B(r,a+4,4)){var c=r.getUint16(s);if(((i=0x4949===c)||0x4D4D===c)&&0x002A===r.getUint16(s+2,i)){var u=r.getUint32(s+4,i);u>=0x00000008&&(n=s+u)}}}if(n){var f,h,d=r.getUint16(n,i);for(h=0;h<d;h+=1)if(f=n+12*h+2,0x0112===r.getUint16(f,i)){f+=8,t=r.getUint16(f,i),r.setUint16(f,1,i);break}}}catch(e){t=1}return t}function x(e){var t=0,r=1,i=1;switch(e){case 2:r=-1;break;case 3:t=-180;break;case 4:i=-1;break;case 5:t=90,i=-1;break;case 6:t=90;break;case 7:t=90,r=-1;break;case 8:t=-90}return{rotate:t,scaleX:r,scaleY:i}}var k=/\.\d*(?:0|9){12}\d*$/;function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100000000000;return k.test(e)?Math.round(e*t)/t:e}function R(e){var t=e.aspectRatio,r=e.height,i=e.width,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",n=b(i),o=b(r);if(n&&o){var l=r*t;("contain"===a||"none"===a)&&l>i||"cover"===a&&l<i?r=i/t:i=r*t}else n?r=i/t:o&&(i=r*t);return{width:i,height:r}}function T(e){for(var t=m(new Uint8Array(e)),r=t.length,i=[],a=0;a+3<r;){var n=t[a],o=t[a+1];if(0xFF===n&&0xDA===o)break;if(0xFF===n&&0xD8===o)a+=2;else{var l=a+(256*t[a+2]+t[a+3])+2,s=t.slice(a,l);i.push(s),a=l}}return i.reduce((function(e,t){return 0xFF===t[0]&&0xE1===t[1]?e.concat(t):e}),[])}function E(e,t){var r=m(new Uint8Array(e));if(0xFF!==r[2]||0xE0!==r[3])return e;var i=256*r[4]+r[5],a=[0xFF,0xD8].concat(t,r.slice(4+i));return new Uint8Array(a)}var M=d.ArrayBuffer,D=d.FileReader,L=d.URL||d.webkitURL,P=/\.\w+$/,C=d.Compressor;return function(){function e(i,a){r(this,e),this.file=i,this.exif=[],this.image=new Image,this.options=t(t({},h),a),this.aborted=!1,this.result=null,this.init()}return a(e,[{key:"init",value:function(){var e=this,t=this.file,r=this.options;if(f(t)){var i=t.type;if(g(i))if(L&&D){M||(r.checkOrientation=!1,r.retainExif=!1);var a="image/jpeg"===i,n=a&&r.checkOrientation,l=a&&r.retainExif;if(!L||n||l){var s=new D;this.reader=s,s.onload=function(r){var a=r.target.result,s={},c=1;n&&(c=j(a))>1&&o(s,x(c)),l&&(e.exif=T(a)),s.url=n||l?!L||c>1?O(a,i):L.createObjectURL(t):a,e.load(s)},s.onabort=function(){e.fail(new Error("Aborted to read the image with FileReader."))},s.onerror=function(){e.fail(new Error("Failed to read the image with FileReader."))},s.onloadend=function(){e.reader=null},n||l?s.readAsArrayBuffer(t):s.readAsDataURL(t)}else this.load({url:L.createObjectURL(t)})}else this.fail(new Error("The current browser does not support image compression."));else this.fail(new Error("The first argument must be an image File or Blob object."))}else this.fail(new Error("The first argument must be a File or Blob object."))}},{key:"load",value:function(e){var r=this,i=this.file,a=this.image;a.onload=function(){r.draw(t(t({},e),{},{naturalWidth:a.naturalWidth,naturalHeight:a.naturalHeight}))},a.onabort=function(){r.fail(new Error("Aborted to load the image."))},a.onerror=function(){r.fail(new Error("Failed to load the image."))},d.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(d.navigator.userAgent)&&(a.crossOrigin="anonymous"),a.alt=i.name,a.src=e.url}},{key:"draw",value:function(e){var t=this,r=e.naturalWidth,i=e.naturalHeight,a=e.rotate,n=void 0===a?0:a,o=e.scaleX,l=void 0===o?1:o,s=e.scaleY,c=void 0===s?1:s,f=this.file,h=this.image,d=this.options,p=document.createElement("canvas"),m=p.getContext("2d"),v=Math.abs(n)%180==90,w=("contain"===d.resize||"cover"===d.resize)&&b(d.width)&&b(d.height),y=Math.max(d.maxWidth,0)||1/0,B=Math.max(d.maxHeight,0)||1/0,U=Math.max(d.minWidth,0)||0,j=Math.max(d.minHeight,0)||0,x=r/i,k=d.width,T=d.height;if(v){var M=[B,y];y=M[0],B=M[1];var L=[j,U];U=L[0],j=L[1];var P=[T,k];k=P[0],T=P[1]}w&&(x=k/T);var C=R({aspectRatio:x,width:y,height:B},"contain");y=C.width,B=C.height;var z=R({aspectRatio:x,width:U,height:j},"cover");if(U=z.width,j=z.height,w){var H=R({aspectRatio:x,width:k,height:T},d.resize);k=H.width,T=H.height}else{var F=R({aspectRatio:x,width:k,height:T}),S=F.width;k=void 0===S?r:S;var W=F.height;T=void 0===W?i:W}var I=-(k=Math.floor(A(Math.min(Math.max(k,U),y))))/2,_=-(T=Math.floor(A(Math.min(Math.max(T,j),B))))/2,q=k,$=T,G=[];if(w){var K=0,X=0,Y=r,N=i,V=R({aspectRatio:x,width:r,height:i},{contain:"cover",cover:"contain"}[d.resize]);Y=V.width,N=V.height,K=(r-Y)/2,X=(i-N)/2,G.push(K,X,Y,N)}if(G.push(I,_,q,$),v){var J=[T,k];k=J[0],T=J[1]}p.width=k,p.height=T,g(d.mimeType)||(d.mimeType=f.type);var Q="transparent";f.size>d.convertSize&&d.convertTypes.indexOf(d.mimeType)>=0&&(d.mimeType="image/jpeg");var Z="image/jpeg"===d.mimeType;if(Z&&(Q="#fff"),m.fillStyle=Q,m.fillRect(0,0,k,T),d.beforeDraw&&d.beforeDraw.call(this,m,p),!this.aborted&&(m.save(),m.translate(k/2,T/2),m.rotate(n*Math.PI/180),m.scale(l,c),m.drawImage.apply(m,[h].concat(G)),m.restore(),d.drew&&d.drew.call(this,m,p),!this.aborted)){var ee=function(e){if(!t.aborted){var a=function(e){return t.done({naturalWidth:r,naturalHeight:i,result:e})};if(e&&Z&&d.retainExif&&t.exif&&t.exif.length>0){var n=function(e){return a(u(O(E(e,t.exif),d.mimeType)))};if(e.arrayBuffer)e.arrayBuffer().then(n).catch((function(){t.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))}));else{var o=new D;t.reader=o,o.onload=function(e){var t=e.target;n(t.result)},o.onabort=function(){t.fail(new Error("Aborted to read the compressed image with FileReader."))},o.onerror=function(){t.fail(new Error("Failed to read the compressed image with FileReader."))},o.onloadend=function(){t.reader=null},o.readAsArrayBuffer(e)}}else a(e)}};p.toBlob?p.toBlob(ee,d.mimeType,d.quality):ee(u(p.toDataURL(d.mimeType,d.quality)))}}},{key:"done",value:function(e){var t=e.naturalWidth,r=e.naturalHeight,i=e.result,a=this.file,n=this.image,o=this.options;if(L&&0===n.src.indexOf("blob:")&&L.revokeObjectURL(n.src),i)if(o.strict&&!o.retainExif&&i.size>a.size&&o.mimeType===a.type&&!(o.width>t||o.height>r||o.minWidth>t||o.minHeight>r||o.maxWidth<t||o.maxHeight<r))i=a;else{var l=new Date;i.lastModified=l.getTime(),i.lastModifiedDate=l,i.name=a.name,i.name&&i.type!==a.type&&(i.name=i.name.replace(P,w(i.type)))}else i=a;this.result=i,o.success&&o.success.call(this,i)}},{key:"fail",value:function(e){var t=this.options;if(!t.error)throw e;t.error.call(this,e)}},{key:"abort",value:function(){this.aborted||(this.aborted=!0,this.reader?this.reader.abort():this.image.complete?this.fail(new Error("The compression process has been aborted.")):(this.image.onload=null,this.image.onabort()))}}],[{key:"noConflict",value:function(){return window.Compressor=C,e}},{key:"setDefaults",value:function(e){o(h,e)}}]),e}()}()}}]);