UNPKG

mr-excel

Version:

A versatile JavaScript library for effortlessly generating .xlsx files from input objects. Seamlessly create Excel spreadsheets with data, formatting, formulas, and more.

2 lines (1 loc) 3.12 kB
define(["exports","./_commonjsHelpers-BXTBJ82R"],function(g,l){"use strict";function S(f,v){for(var u=0;u<v.length;u++){const a=v[u];if(typeof a!="string"&&!Array.isArray(a)){for(const s in a)if(s!=="default"&&!(s in f)){const c=Object.getOwnPropertyDescriptor(a,s);c&&Object.defineProperty(f,s,c.get?c:{enumerable:!0,get:()=>a[s]})}}}return Object.freeze(Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}))}var y={exports:{}};(function(f,v){(function(u,a){a()})(l.commonjsGlobal,function(){function u(e,t){return typeof t>"u"?t={autoBom:!1}:typeof t!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function a(e,t,i){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){p(n.response,t,i)},n.onerror=function(){console.error("could not download file")},n.send()}function s(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function c(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var r=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof l.commonjsGlobal=="object"&&l.commonjsGlobal.global===l.commonjsGlobal?l.commonjsGlobal:void 0,j=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),p=r.saveAs||(typeof window!="object"||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!j?function(e,t,i){var n=r.URL||r.webkitURL,o=document.createElement("a");t=t||e.name||"download",o.download=t,o.rel="noopener",typeof e=="string"?(o.href=e,o.origin===location.origin?c(o):s(o.href)?a(e,t,i):c(o,o.target="_blank")):(o.href=n.createObjectURL(e),setTimeout(function(){n.revokeObjectURL(o.href)},4e4),setTimeout(function(){c(o)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,i){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(u(e,i),t);else if(s(e))a(e,t,i);else{var n=document.createElement("a");n.href=e,n.target="_blank",setTimeout(function(){c(n)})}}:function(e,t,i,n){if(n=n||open("","_blank"),n&&(n.document.title=n.document.body.innerText="downloading..."),typeof e=="string")return a(e,t,i);var o=e.type==="application/octet-stream",A=/constructor/i.test(r.HTMLElement)||r.safari,E=/CriOS\/[\d]+/.test(navigator.userAgent);if((E||o&&A||j)&&typeof FileReader<"u"){var m=new FileReader;m.onloadend=function(){var d=m.result;d=E?d:d.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=d:location=d,n=null},m.readAsDataURL(e)}else{var h=r.URL||r.webkitURL,w=h.createObjectURL(e);n?n.location=w:location.href=w,n=null,setTimeout(function(){h.revokeObjectURL(w)},4e4)}});r.saveAs=p.saveAs=p,f.exports=p})})(y);var b=y.exports;const O=S({__proto__:null,default:l.getDefaultExportFromCjs(b)},[b]);g.FileSaver_min=O});