sheetjs_sheetjs/dist/shim.min.js
SheetJS 75845a0ca7 version bump 0.11.19: browser writeFile
- IE6-9 ActiveX + VBScript shim
- `writeFile` supported in browser
- `oldie` demo for IE write strategies
2018-02-03 15:46:32 -05:00

2 lines
5.4 KiB
JavaScript
Generated

/* xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
if(!Object.keys){Object.keys=function(){var t=Object.prototype.hasOwnProperty,r=!{toString:null}.propertyIsEnumerable("toString"),e=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=e.length;return function(i){if(typeof i!=="object"&&typeof i!=="function"||i===null)throw new TypeError("Object.keys called on non-object");var o=[];for(var a in i){if(t.call(i,a))o.push(a)}if(r){for(var f=0;f<n;f++){if(t.call(i,e[f]))o.push(e[f])}}return o}}()}if(!Array.prototype.filter){Array.prototype.filter=function(t){"use strict";if(this==null)throw new TypeError;var r=Object(this);var e=r.length>>>0;if(typeof t!="function")throw new TypeError;var n=[];var i=arguments[1];for(var o=0;o<e;o++){if(o in r){var a=r[o];if(t.call(i,a,o,r))n.push(a)}}return n}}if(!String.prototype.trim){String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}}if(!Array.prototype.forEach){Array.prototype.forEach=function(t){"use strict";if(this===void 0||this===null)throw new TypeError;var r=Object(this);var e=r.length>>>0;if(typeof t!=="function")throw new TypeError;var n=arguments.length>=2?arguments[1]:void 0;for(var i=0;i<e;i++){if(i in r)t.call(n,r[i],i,r)}}}if(!Array.prototype.map){Array.prototype.map=function(t,r){var e,n,i;if(this==null){throw new TypeError(" this is null or not defined")}var o=Object(this);var a=o.length>>>0;if(typeof t!=="function"){throw new TypeError(t+" is not a function")}if(r){e=r}n=new Array(a);i=0;while(i<a){var f,l;if(i in o){f=o[i];l=t.call(e,f,i,o);n[i]=l}i++}return n}}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(t,r){if(this===undefined||this===null){throw new TypeError('"this" is null or not defined')}var e=this.length>>>0;r=+r||0;if(Math.abs(r)===Infinity){r=0}if(r<0){r+=e;if(r<0){r=0}}for(;r<e;r++){if(this[r]===t){return r}}return-1}}if(!Array.isArray){Array.isArray=function(t){return Object.prototype.toString.call(t)==="[object Array]"}}"use strict";if(typeof ArrayBuffer!=="undefined"&&!ArrayBuffer.prototype.slice){ArrayBuffer.prototype.slice=function(t,r){t=t|0||0;var e=this.byteLength;r=r===void 0?e:r|0;if(t<0)t+=e;if(r<0)r+=e;if(e===0||t>=e||t>=r){return new ArrayBuffer(0)}var n=Math.min(e-t,r-t);var i=new ArrayBuffer(n);var o=new Uint8Array(i);o.set(new Uint8Array(this,t,n));return i}}(function(){var t=typeof exports!="undefined"?exports:typeof self!="undefined"?self:$.global;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function e(t){this.message=t}e.prototype=new Error;e.prototype.name="InvalidCharacterError";t.btoa||(t.btoa=function(t){var n=String(t);for(var i,o,a=0,f=r,l="";n.charAt(a|0)||(f="=",a%1);l+=f.charAt(63&i>>8-a%1*8)){o=n.charCodeAt(a+=3/4);if(o>255){throw new e("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.")}i=i<<8|o}return l});t.atob||(t.atob=function(t){var n=String(t).replace(/[=]+$/,"");if(n.length%4==1){throw new e("'atob' failed: The string to be decoded is not correctly encoded.")}for(var i=0,o,a,f=0,l="";a=n.charAt(f++);~a&&(o=i%4?o*64+a:a,i++%4)?l+=String.fromCharCode(255&o>>(-2*i&6)):0){a=r.indexOf(a)}return l})})();if(!Date.prototype.toISOString){(function(){function t(t){if(t<10){return"0"+t}return t}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+t(this.getUTCMonth()+1)+"-"+t(this.getUTCDate())+"T"+t(this.getUTCHours())+":"+t(this.getUTCMinutes())+":"+t(this.getUTCSeconds())+"."+(this.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"}})()}if(typeof Uint8Array!=="undefined"&&!Uint8Array.prototype.slice)Uint8Array.prototype.slice=function(t,r){if(t<0){t+=this.length;if(t<0)t=0}if(t>=this.length)return new Uint8Array(0);if(r==null)r=this.length;if(r<0){r+=this.length;if(r<0)r=0}if(r>this.length)r=this.length;var e=new Uint8Array(r-t);while(t<=--r)e[r-t]=this[r];return e};var IE_SaveFile=function(){try{if(typeof IE_SaveFile_Impl=="undefined")document.write(['<script type="text/vbscript" language="vbscript">','IE_GetProfileAndPath_Key = "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\"','Function IE_GetProfileAndPath(key): Set wshell = CreateObject("WScript.Shell"): IE_GetProfileAndPath = wshell.RegRead(IE_GetProfileAndPath_Key & key): IE_GetProfileAndPath = wshell.ExpandEnvironmentStrings("%USERPROFILE%") & "!" & IE_GetProfileAndPath: End Function','Function IE_SaveFile_Impl(FileName, payload): Dim data, plen, i, bit: data = CStr(payload): plen = Len(data): Set fso = CreateObject("Scripting.FileSystemObject"): fso.CreateTextFile FileName, True: Set f = fso.GetFile(FileName): Set stream = f.OpenAsTextStream(2, 0): For i = 1 To plen Step 3: bit = Mid(data, i, 2): stream.write Chr(CLng("&h" & bit)): Next: stream.Close: IE_SaveFile_Impl = True: End Function',"|/script>".replace("|","<")].join("\r\n"));if(typeof IE_SaveFile_Impl=="undefined")return void 0;var t=function(){var t="";try{t=IE_GetProfileAndPath("{374DE290-123F-4565-9164-39C4925E467B}")}catch(r){try{t=IE_GetProfileAndPath("Personal")}catch(r){try{t=IE_GetProfileAndPath("Desktop")}catch(r){throw r}}}var e=t.split("!");DDP=e[1].replace("%USERPROFILE%",e[0]);return function(t){return DDP+"\\"+t}}();function r(t){var r=[];var e=typeof t=="string";for(var n=0;n<t.length;++n)r.push(("00"+(e?t.charCodeAt(n):t[n]).toString(16)).slice(-2));var i=r.join("|");return i}return function(e,n){return IE_SaveFile_Impl(t(n),r(e))}}catch(e){return void 0}}();