sheetjs/dist/xlsx.mini.min.js

10 lines
236 KiB
JavaScript
Raw Normal View History

/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
2022-02-26 04:32:40 +00:00
var XLSX={};function make_xlsx_lib(e){e.version="0.18.2";var r=1200,t=1252;var a=[874,932,936,949,950,1e4];for(var n=0;n<=8;++n)a.push(1250+n);var i={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969};var s=function(e){if(a.indexOf(e)==-1)return;t=i[0]=e};function l(){s(1252)}var o=function(e){r=e;s(e)};function c(){o(1200);l()}function f(e){var r=[];for(var t=0,a=e.length;t<a;++t)r[t]=e.charCodeAt(t);return r}function u(e){var r=[];for(var t=0;t<e.length>>1;++t)r[t]=String.fromCharCode(e.charCodeAt(2*t)+(e.charCodeAt(2*t+1)<<8));return r.join("")}function h(e){var r=[];for(var t=0;t<e.length>>1;++t)r[t]=String.fromCharCode(e.charCodeAt(2*t+1)+(e.charCodeAt(2*t)<<8));return r.join("")}var p=function(e){var r=e.charCodeAt(0),t=e.charCodeAt(1);if(r==255&&t==254)return u(e.slice(2));if(r==254&&t==255)return h(e.slice(2));if(r==65279)return e.slice(1);return e};var d=function so(e){return String.fromCharCode(e)};var m=function lo(e){return String.fromCharCode(e)};var v=null;var g=true;var b=function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return{encode:function(r){var t="";var a=0,n=0,i=0,s=0,l=0,o=0,c=0;for(var f=0;f<r.length;){a=r.charCodeAt(f++);s=a>>2;n=r.charCodeAt(f++);l=(a&3)<<4|n>>4;i=r.charCodeAt(f++);o=(n&15)<<2|i>>6;c=i&63;if(isNaN(n)){o=c=64}else if(isNaN(i)){c=64}t+=e.charAt(s)+e.charAt(l)+e.charAt(o)+e.charAt(c)}return t},decode:function(r){var t="";var a=0,n=0,i=0,s=0,l=0,o=0,c=0;r=r.replace(/[^\w\+\/\=]/g,"");for(var f=0;f<r.length;){s=e.indexOf(r.charAt(f++));l=e.indexOf(r.charAt(f++));a=s<<2|l>>4;t+=String.fromCharCode(a);o=e.indexOf(r.charAt(f++));n=(l&15)<<4|o>>2;if(o!==64){t+=String.fromCharCode(n)}c=e.indexOf(r.charAt(f++));i=(o&3)<<6|c;if(c!==64){t+=String.fromCharCode(i)}}return t}}}();var w=typeof Buffer!=="undefined"&&typeof undefined!=="undefined"&&typeof{}!=="undefined"&&!!{}.node;var y=function(){};if(typeof Buffer!=="undefined"){var k=!Buffer.from;if(!k)try{Buffer.from("foo","utf8")}catch(x){k=true}y=k?function(e,r){return r?new Buffer(e,r):new Buffer(e)}:Buffer.from.bind(Buffer);if(!Buffer.alloc)Buffer.alloc=function(e){return new Buffer(e)};if(!Buffer.allocUnsafe)Buffer.allocUnsafe=function(e){return new Buffer(e)}}function S(e){return w?Buffer.alloc(e):typeof Uint8Array!="undefined"?new Uint8Array(e):new Array(e)}function C(e){return w?Buffer.allocUnsafe(e):typeof Uint8Array!="undefined"?new Uint8Array(e):new Array(e)}var _=function oo(e){if(w)return y(e,"binary");return e.split("").map(function(e){return e.charCodeAt(0)&255})};function A(e){if(typeof ArrayBuffer==="undefined")return _(e);var r=new ArrayBuffer(e.length),t=new Uint8Array(r);for(var a=0;a!=e.length;++a)t[a]=e.charCodeAt(a)&255;return r}function F(e){if(Array.isArray(e))return e.map(function(e){return String.fromCharCode(e)}).join("");var r=[];for(var t=0;t<e.length;++t)r[t]=String.fromCharCode(e[t]);return r.join("")}function E(e){if(typeof Uint8Array==="undefined")throw new Error("Unsupported");return new Uint8Array(e)}function T(e){if(typeof ArrayBuffer=="undefined")throw new Error("Unsupported");if(e instanceof ArrayBuffer)return T(new Uint8Array(e));var r=new Array(e.length);for(var t=0;t<e.length;++t)r[t]=e[t];return r}function O(e){var r=[],t=0,a=e.length+250;var n=S(e.length+255);for(var i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s<128)n[t++]=s;else if(s<2048){n[t++]=192|s>>6&31;n[t++]=128|s&63}else if(s>=55296&&s<57344){s=(s&1023)+64;var l=e.charCodeAt(++i)&1023;n[t++]=240|s>>8&7;n[t++]=128|s>>2&63;n[t++]=128|l>>6&15|(s&3)<<4;n[t++]=128|l&63}else{n[t++]=224|s>>12&15;n[t++]=128|s>>6&63;n[t++]=128|s&63}if(t>a){r.push(n.slice(0,t));t=0;n=S(65535);a=65530}}r.push(n.slice(0,t));return D(r)}var D=function(e){if(typeof Uint8Array!=="undefined"){var r=0,t=0;for(r=0;r<e.length;++r)t+=e[r].length;var a=new Uint8Array(t);var n=0;for(r=0,t=0;r<e.length;t+=n,++r){n=e[r].length;if(e[r]instanceof Uint8Array)a.set(e[r],t);else if(typeof e[r]=="string"){throw"wtf"}else a.set(new Uin
while(y<n)a=a>>>8^t[(a^e[y++])&255];return~a}function x(e,r){var a=r^-1;for(var n=0,i=e.length,s=0,l=0;n<i;){s=e.charCodeAt(n++);if(s<128){a=a>>>8^t[(a^s)&255]}else if(s<2048){a=a>>>8^t[(a^(192|s>>6&31))&255];a=a>>>8^t[(a^(128|s&63))&255]}else if(s>=55296&&s<57344){s=(s&1023)+64;l=e.charCodeAt(n++)&1023;a=a>>>8^t[(a^(240|s>>8&7))&255];a=a>>>8^t[(a^(128|s>>2&63))&255];a=a>>>8^t[(a^(128|l>>6&15|(s&3)<<4))&255];a=a>>>8^t[(a^(128|l&63))&255]}else{a=a>>>8^t[(a^(224|s>>12&15))&255];a=a>>>8^t[(a^(128|s>>6&63))&255];a=a>>>8^t[(a^(128|s&63))&255]}}return~a}e.table=t;e.bstr=y;e.buf=k;e.str=x});var H=function fo(){var e={};e.version="1.2.1";function r(e,r){var t=e.split("/"),a=r.split("/");for(var n=0,i=0,s=Math.min(t.length,a.length);n<s;++n){if(i=t[n].length-a[n].length)return i;if(t[n]!=a[n])return t[n]<a[n]?-1:1}return t.length-a.length}function t(e){if(e.charAt(e.length-1)=="/")return e.slice(0,-1).indexOf("/")===-1?e:t(e.slice(0,-1));var r=e.lastIndexOf("/");return r===-1?e:e.slice(0,r+1)}function a(e){if(e.charAt(e.length-1)=="/")return a(e.slice(0,-1));var r=e.lastIndexOf("/");return r===-1?e:e.slice(r+1)}function n(e,r){if(typeof r==="string")r=new Date(r);var t=r.getHours();t=t<<6|r.getMinutes();t=t<<5|r.getSeconds()>>>1;e._W(2,t);var a=r.getFullYear()-1980;a=a<<4|r.getMonth()+1;a=a<<5|r.getDate();e._W(2,a)}function i(e){var r=e._R(2)&65535;var t=e._R(2)&65535;var a=new Date;var n=t&31;t>>>=5;var i=t&15;t>>>=4;a.setMilliseconds(0);a.setFullYear(t+1980);a.setMonth(i-1);a.setDate(n);var s=r&31;r>>>=5;var l=r&63;r>>>=6;a.setHours(r);a.setMinutes(l);a.setSeconds(s<<1);return a}function s(e){Zr(e,0);var r={};var t=0;while(e.l<=e.length-4){var a=e._R(2);var n=e._R(2),i=e.l+n;var s={};switch(a){case 21589:{t=e._R(1);if(t&1)s.mtime=e._R(4);if(n>5){if(t&2)s.atime=e._R(4);if(t&4)s.ctime=e._R(4)}if(s.mtime)s.mt=new Date(s.mtime*1e3)}break;}e.l=i;r[a]=s}return r}var l;function o(){return l||(l=undefined)}function c(e,r){if(e[0]==80&&e[1]==75)return Me(e,r);if((e[0]|32)==109&&(e[1]|32)==105)return $e(e,r);if(e.length<512)throw new Error("CFB file size "+e.length+" < 512");var t=3;var a=512;var n=0;var i=0;var s=0;var l=0;var o=0;var c=[];var d=e.slice(0,512);Zr(d,0);var v=f(d);t=v[0];switch(t){case 3:a=512;break;case 4:a=4096;break;case 0:if(v[1]==0)return Me(e,r);default:throw new Error("Major Version: Expected 3 or 4 saw "+t);}if(a!==512){d=e.slice(0,a);Zr(d,28)}var b=e.slice(0,a);u(d,t);var w=d._R(4,"i");if(t===3&&w!==0)throw new Error("# Directory Sectors: Expected 0 saw "+w);d.l+=4;s=d._R(4,"i");d.l+=4;d.chk("00100000","Mini Stream Cutoff Size: ");l=d._R(4,"i");n=d._R(4,"i");o=d._R(4,"i");i=d._R(4,"i");for(var y=-1,x=0;x<109;++x){y=d._R(4,"i");if(y<0)break;c[x]=y}var S=h(e,a);m(o,i,S,a,c);var C=g(S,s,c,a);C[s].name="!Directory";if(n>0&&l!==L)C[l].name="!MiniFAT";C[c[0]].name="!FAT";C.fat_addrs=c;C.ssz=a;var _={},A=[],F=[],E=[];k(s,C,S,A,n,_,F,l);p(F,E,A);A.shift();var T={FileIndex:F,FullPaths:E};if(r&&r.raw)T.raw={header:b,sectors:S};return T}function f(e){if(e[e.l]==80&&e[e.l+1]==75)return[0,0];e.chk(B,"Header Signature: ");e.l+=16;var r=e._R(2,"u");return[e._R(2,"u"),r]}function u(e,r){var t=9;e.l+=2;switch(t=e._R(2)){case 9:if(r!=3)throw new Error("Sector Shift: Expected 9 saw "+t);break;case 12:if(r!=4)throw new Error("Sector Shift: Expected 12 saw "+t);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+t);}e.chk("0600","Mini Sector Shift: ");e.chk("000000000000","Reserved: ")}function h(e,r){var t=Math.ceil(e.length/r)-1;var a=[];for(var n=1;n<t;++n)a[n-1]=e.slice(n*r,(n+1)*r);a[t-1]=e.slice(t*r);return a}function p(e,r,t){var a=0,n=0,i=0,s=0,l=0,o=t.length;var c=[],f=[];for(;a<o;++a){c[a]=f[a]=a;r[a]=t[a]}for(;l<f.length;++l){a=f[l];n=e[a].L;i=e[a].R;s=e[a].C;if(c[a]===a){if(n!==-1&&c[n]!==n)c[a]=c[n];if(i!==-1&&c[i]!==i)c[a]=c[i]}if(s!==-1)c[s]=a;if(n!==-1&&a!=c[a]){c[n]=c[a];if(f.lastIndexOf(n)<l)f.push(n)}if(i!==-1&&a!=c[a]){c[i]=c[a];if(f.lastIndexOf(i)<l)f.push(i)}}for(a=1;a<o;++a)if(c[a]===a){if(i!==-1&&c[i]!==i)c[a]=c[i];else if(n!==-1&&c[n]!==n)c[a]=c[n]}for(a=1;a<o;++a){if(e[a].type===0)continue;l
return i}function fe(e,r){if(w&&Buffer.isBuffer(e)){if(r){if(e[0]==255&&e[1]==254)return e.slice(2).toString("utf16le");if(e[1]==254&&e[2]==255)return h(e.slice(2).toString("binary"))}return e.toString("binary")}var t=[];for(var a=0;a!=e.length;++a)t.push(String.fromCharCode(e[a]));return t.join("")}function ue(e){if(typeof JSON!="undefined"&&!Array.isArray(e))return JSON.parse(JSON.stringify(e));if(typeof e!="object"||e==null)return e;if(e instanceof Date)return new Date(e.getTime());var r={};for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))r[t]=ue(e[t]);return r}function he(e,r){var t="";while(t.length<r)t+=e;return t}function pe(e){var r=Number(e);if(isFinite(r))return r;if(!isNaN(r))return NaN;if(!/\d/.test(e))return r;var t=1;var a=e.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,function(){t*=100;return""});if(!isNaN(r=Number(a)))return r/t;a=a.replace(/[(](.*)[)]/,function(e,r){t=-t;return r});if(!isNaN(r=Number(a)))return r/t;return r}var de=["january","february","march","april","may","june","july","august","september","october","november","december"];function me(e){var r=new Date(e),t=new Date(NaN);var a=r.getYear(),n=r.getMonth(),i=r.getDate();if(isNaN(i))return t;var s=e.toLowerCase();if(s.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)){s=s.replace(/[^a-z]/g,"").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,"");if(s.length>3&&de.indexOf(s)==-1)return t}else if(s.match(/[a-z]/))return t;if(a<0||a>8099)return t;if((n>0||i>1)&&a!=101)return r;if(e.match(/[^-0-9:,\/\\]/))return t;return r}var ve="abacaba".split(/(:?b)/i).length==5;function ge(e,r,t){if(ve||typeof r=="string")return e.split(r);var a=e.split(r),n=[a[0]];for(var i=1;i<a.length;++i){n.push(t);n.push(a[i])}return n}function be(e){if(!e)return null;if(e.content&&e.type)return fe(e.content,true);if(e.data)return p(e.data);if(e.asNodeBuffer&&w)return p(e.asNodeBuffer().toString("binary"));if(e.asBinary)return p(e.asBinary());if(e._data&&e._data.getContent)return p(fe(Array.prototype.slice.call(e._data.getContent(),0)));return null}function we(e){if(!e)return null;if(e.data)return f(e.data);if(e.asNodeBuffer&&w)return e.asNodeBuffer();if(e._data&&e._data.getContent){var r=e._data.getContent();if(typeof r=="string")return f(r);return Array.prototype.slice.call(r)}if(e.content&&e.type)return e.content;return null}function ye(e){return e&&e.name.slice(-4)===".bin"?we(e):be(e)}function ke(e,r){var t=e.FullPaths||J(e.files);var a=r.toLowerCase().replace(/[\/]/g,"\\"),n=a.replace(/\\/g,"/");for(var i=0;i<t.length;++i){var s=t[i].replace(/^Root Entry[\/]/,"").toLowerCase();if(a==s||n==s)return e.files?e.files[t[i]]:e.FileIndex[i]}return null}function xe(e,r){var t=ke(e,r);if(t==null)throw new Error("Cannot find file "+r+" in zip");return t}function Se(e,r,t){if(!t)return ye(xe(e,r));if(!r)return null;try{return Se(e,r)}catch(a){return null}}function Ce(e,r,t){if(!t)return be(xe(e,r));if(!r)return null;try{return Ce(e,r)}catch(a){return null}}function _e(e,r,t){if(!t)return we(xe(e,r));if(!r)return null;try{return _e(e,r)}catch(a){return null}}function Ae(e){var r=e.FullPaths||J(e.files),t=[];for(var a=0;a<r.length;++a)if(r[a].slice(-1)!="/")t.push(r[a].replace(/^Root Entry[\/]/,""));return t.sort()}function Fe(e,r,t){if(e.FullPaths){if(typeof t=="string"){var a;if(w)a=y(t);else a=O(t);return H.utils.cfb_add(e,r,a)}H.utils.cfb_add(e,r,t)}else e.file(r,t)}function Ee(){return H.utils.cfb_new()}function Te(e,r){switch(r.type){case"base64":return H.read(e,{type:"base64"});case"binary":return H.read(e,{type:"binary"});case"buffer":;case"array":return H.read(e,{type:"buffer"});}throw new Error("Unrecognized type "+r.type)}function Oe(e,r){if(e.charAt(0)=="/")return e.slice(1);var t=r.split("/");if(r.slice(-1)!="/")t.pop();var a=e.split("/");while(a.length!==0){var n=a.shift();if(n==="..")t.pop();else if(n!==".")t.push(n)}return t.join("/")}var De='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n';var Me=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g;var Ne=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*
xlam:"application/vnd.ms-excel.addin.macroEnabled.main+xml",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"},strs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",xlsb:"application/vnd.ms-excel.sharedStrings"},comments:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",xlsb:"application/vnd.ms-excel.comments"},sheets:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",xlsb:"application/vnd.ms-excel.worksheet"},charts:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml",xlsb:"application/vnd.ms-excel.chartsheet"},dialogs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml",xlsb:"application/vnd.ms-excel.dialogsheet"},macros:{xlsx:"application/vnd.ms-excel.macrosheet+xml",xlsb:"application/vnd.ms-excel.macrosheet"},styles:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",xlsb:"application/vnd.ms-excel.styles"}};J(e).forEach(function(r){["xlsm","xlam"].forEach(function(t){if(!e[r][t])e[r][t]=e[r].xlsx})});J(e).forEach(function(r){J(e[r]).forEach(function(t){qt[e[r][t]]=r})});return e}();var Qt=Q(qt);dr.CT="http://schemas.openxmlformats.org/package/2006/content-types";function ea(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],TODO:[],xmlns:""}}function ra(e){var r=ea();if(!e||!e.match)return r;var t={};(e.match(Ne)||[]).forEach(function(e){var a=Ie(e);switch(a[0].replace(Pe,"<")){case"<?xml":break;case"<Types":r.xmlns=a["xmlns"+(a[0].match(/<(\w+):/)||["",""])[1]];break;case"<Default":t[a.Extension]=a.ContentType;break;case"<Override":if(r[qt[a.ContentType]]!==undefined)r[qt[a.ContentType]].push(a.PartName);break;}});if(r.xmlns!==dr.CT)throw new Error("Unknown Namespace: "+r.xmlns);r.calcchain=r.calcchains.length>0?r.calcchains[0]:"";r.sst=r.strs.length>0?r.strs[0]:"";r.style=r.styles.length>0?r.styles[0]:"";r.defaults=t;delete r.calcchains;return r}var ta=ur("Types",null,{xmlns:dr.CT,"xmlns:xsd":dr.xsd,"xmlns:xsi":dr.xsi});var aa=[["xml","application/xml"],["bin","application/vnd.ms-excel.sheet.binary.macroEnabled.main"],["vml","application/vnd.openxmlformats-officedocument.vmlDrawing"],["data","application/vnd.openxmlformats-officedocument.model+data"],["bmp","image/bmp"],["png","image/png"],["gif","image/gif"],["emf","image/x-emf"],["wmf","image/x-wmf"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["tif","image/tiff"],["tiff","image/tiff"],["pdf","application/pdf"],["rels",Qt.rels[0]]].map(function(e){return ur("Default",null,{Extension:e[0],ContentType:e[1]})});function na(e,r){var t=[],a;t[t.length]=De;t[t.length]=ta;t=t.concat(aa);var n=function(n){if(e[n]&&e[n].length>0){a=e[n][0];t[t.length]=ur("Override",null,{PartName:(a[0]=="/"?"":"/")+a,ContentType:Zt[n][r.bookType||"xlsx"]})}};var i=function(a){(e[a]||[]).forEach(function(e){t[t.length]=ur("Override",null,{PartName:(e[0]=="/"?"":"/")+e,ContentType:Zt[a][r.bookType||"xlsx"]})})};var s=function(r){(e[r]||[]).forEach(function(e){t[t.length]=ur("Override",null,{PartName:(e[0]=="/"?"":"/")+e,ContentType:Qt[r][0]})})};n("workbooks");i("sheets");i("charts");s("themes");["strs","styles"].forEach(n);["coreprops","extprops","custprops"].forEach(s);s("vba");s("comments");s("drawings");if(t.length>2){t[t.length]="</Types>";t[1]=t[1].replace("/>",">")}return t.join("")}var ia={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",XLINK:"ht
if(!t.cellNF)delete a.z}else{a.t="s";a.v=r}if(a.t=="z"){}else if(t.dense){if(!i[l])i[l]=[];i[l][o]=a}else i[bt({c:o,r:l})]=a;f=u+1;m=e.charCodeAt(f);if(s.e.c<o)s.e.c=o;if(s.e.r<l)s.e.r=l;if(d==h)++o;else{o=0;++l;if(t.sheetRows&&t.sheetRows<=l)return true}}e:for(;u<e.length;++u)switch(d=e.charCodeAt(u)){case 34:if(m===34)p=!p;break;case h:;case 10:;case 13:if(!p&&b())break e;break;default:break;}if(u-f>0)b();i["!ref"]=yt(s);return i}function s(e,t){if(!(t&&t.PRN))return i(e,t);if(t.FS)return i(e,t);if(e.slice(0,4)=="sep=")return i(e,t);if(e.indexOf("\t")>=0||e.indexOf(",")>=0||e.indexOf(";")>=0)return i(e,t);return At(r(e,t),t)}function l(e,r){var t="",a=r.type=="string"?[0,0,0,0]:ml(e,r);switch(r.type){case"base64":t=b.decode(e);break;case"binary":t=e;break;case"buffer":if(r.codepage==65001)t=e.toString("utf8");else if(r.codepage&&typeof cptable!=="undefined")t=cptable.utils.decode(r.codepage,e);else t=w&&Buffer.isBuffer(e)?e.toString("binary"):F(e);break;case"array":t=fe(e);break;case"string":t=e;break;default:throw new Error("Unrecognized type "+r.type);}if(a[0]==239&&a[1]==187&&a[2]==191)t=qe(t.slice(3));else if(r.type!="string"&&r.type!="buffer"&&r.codepage==65001)t=qe(t);else if(r.type=="binary"&&typeof cptable!=="undefined"&&r.codepage)t=cptable.utils.decode(r.codepage,cptable.utils.encode(28591,t));if(t.slice(0,19)=="socialcalc:version:")return Ba.to_sheet(r.type=="string"?t:qe(t),r);return s(t,r)}function o(e,r){return Ct(l(e,r),r)}function c(e){var r=[];var t=kt(e["!ref"]),a;var n=Array.isArray(e);for(var i=t.s.r;i<=t.e.r;++i){var s=[];for(var l=t.s.c;l<=t.e.c;++l){var o=bt({r:i,c:l});a=n?(e[i]||[])[l]:e[o];if(!a||a.v==null){s.push(" ");continue}var c=(a.w||(St(a),a.w)||"").slice(0,10);while(c.length<10)c+=" ";s.push(c+(l===0?" ":""))}r.push(s.join(""))}return r.join("\n")}return{to_workbook:o,to_sheet:l,from_sheet:c}}();function Ua(e,r){var t=r||{},a=!!t.WTF;t.WTF=true;try{var n=Ia.to_workbook(e,t);t.WTF=a;return n}catch(i){t.WTF=a;if(!i.message.match(/SYLK bad record ID/)&&a)throw i;return za.to_workbook(e,r)}}function $a(e){var r={},t=e.match(Ne),a=0;var n=false;if(t)for(;a!=t.length;++a){var s=Ie(t[a]);switch(s[0].replace(/\w*:/g,"")){case"<condense":break;case"<extend":break;case"<shadow":if(!s.val)break;case"<shadow>":;case"<shadow/>":r.shadow=1;break;case"</shadow>":break;case"<charset":if(s.val=="1")break;r.cp=i[parseInt(s.val,10)];break;case"<outline":if(!s.val)break;case"<outline>":;case"<outline/>":r.outline=1;break;case"</outline>":break;case"<rFont":r.name=s.val;break;case"<sz":r.sz=s.val;break;case"<strike":if(!s.val)break;case"<strike>":;case"<strike/>":r.strike=1;break;case"</strike>":break;case"<u":if(!s.val)break;switch(s.val){case"double":r.uval="double";break;case"singleAccounting":r.uval="single-accounting";break;case"doubleAccounting":r.uval="double-accounting";break;};case"<u>":;case"<u/>":r.u=1;break;case"</u>":break;case"<b":if(s.val=="0")break;case"<b>":;case"<b/>":r.b=1;break;case"</b>":break;case"<i":if(s.val=="0")break;case"<i>":;case"<i/>":r.i=1;break;case"</i>":break;case"<color":if(s.rgb)r.color=s.rgb.slice(2,8);break;case"<color>":;case"<color/>":;case"</color>":break;case"<family":r.family=s.val;break;case"<family>":;case"<family/>":;case"</family>":break;case"<vertAlign":r.valign=s.val;break;case"<vertAlign>":;case"<vertAlign/>":;case"</vertAlign>":break;case"<scheme":break;case"<scheme>":;case"<scheme/>":;case"</scheme>":break;case"<extLst":;case"<extLst>":;case"</extLst>":break;case"<ext":n=true;break;case"</ext>":n=false;break;default:if(s[0].charCodeAt(1)!==47&&!n)throw new Error("Unrecognized rich format "+s[0]);}}return r}var Wa=function(){var e=tr("t"),r=tr("rPr");function t(t){var a=t.match(e);if(!a)return{t:"s",v:""};var n={t:"s",v:Ue(a[1])};var i=t.match(r);if(i)n.s=$a(i[1]);return n}var a=/<(?:\w+:)?r>/g,n=/<\/(?:\w+:)?r>/;return function i(e){return e.replace(a,"").split(n).map(t).filter(function(e){return e.v})}}();var ja=function _o(){var e=/(\r\n|\n)/g;function r(e,r,t){var a=[];if(e.u)a.push("text-decoration: underline;");if(e.uval)a.push("text-underli
if(e.match(/<(?:\w+:)?comments *\/>/))return[];var t=[];var a=[];var n=e.match(/<(?:\w+:)?authors>([\s\S]*)<\/(?:\w+:)?authors>/);if(n&&n[1])n[1].split(/<\/\w*:?author>/).forEach(function(e){if(e===""||e.trim()==="")return;var r=e.match(/<(?:\w+:)?author[^>]*>(.*)/);if(r)t.push(r[1])});var i=e.match(/<(?:\w+:)?commentList>([\s\S]*)<\/(?:\w+:)?commentList>/);if(i&&i[1])i[1].split(/<\/\w*:?comment>/).forEach(function(e){if(e===""||e.trim()==="")return;var n=e.match(/<(?:\w+:)?comment[^>]*>/);if(!n)return;var i=Ie(n[0]);var s={author:i.authorId&&t[i.authorId]||"sheetjsghost",ref:i.ref,guid:i.guid};var l=gt(i.ref);if(r.sheetRows&&r.sheetRows<=l.r)return;var o=e.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/);var c=!!o&&!!o[1]&&Ga(o[1])||{r:"",t:"",h:""};s.r=c.r;if(c.r=="<t></t>")c.t=c.h="";s.t=(c.t||"").replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(r.cellHTML)s.h=c.h;a.push(s)});return a}var qn=ur("comments",null,{xmlns:dr.main[0]});function Zn(e){var r=[De,qn];var t=[];r.push("<authors>");e.forEach(function(e){e[1].forEach(function(e){var a=je(e.a);if(t.indexOf(a)>-1)return;t.push(a);r.push("<author>"+a+"</author>")})});r.push("</authors>");r.push("<commentList>");e.forEach(function(e){e[1].forEach(function(a){r.push('<comment ref="'+e[0]+'" authorId="'+t.indexOf(je(a.a))+'"><text>');r.push(cr("t",a.t==null?"":je(a.t)));r.push("</text></comment>")})});r.push("</commentList>");if(r.length>2){r[r.length]="</comments>";r[1]=r[1].replace("/>",">")}return r.join("")}var Qn="application/vnd.ms-office.vbaProject";function ei(e){var r=H.utils.cfb_new({root:"R"});e.FullPaths.forEach(function(t,a){if(t.slice(-1)==="/"||!t.match(/_VBA_PROJECT_CUR/))return;var n=t.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/,"");H.utils.cfb_add(r,n,e.FileIndex[a].content)});return H.write(r)}function ri(e,r){r.FullPaths.forEach(function(t,a){if(a==0)return;var n=t.replace(/[^\/]*[\/]/,"/_VBA_PROJECT_CUR/");if(n.slice(-1)!=="/")H.utils.cfb_add(e,n,r.FileIndex[a].content)})}var ti=["xlsb","xlsm","xlam","biff8","xla"];ia.DS="http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet";ia.MS="http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet";function ai(){return{"!type":"dialog"}}function ni(){return{"!type":"dialog"}}function ii(){return{"!type":"macro"}}function si(){return{"!type":"macro"}}var li=function(){var e=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g;var r={r:0,c:0};function t(e,t,a,n){var i=false,s=false;if(a.length==0)s=true;else if(a.charAt(0)=="["){s=true;a=a.slice(1,-1)}if(n.length==0)i=true;else if(n.charAt(0)=="["){i=true;n=n.slice(1,-1)}var l=a.length>0?parseInt(a,10)|0:0,o=n.length>0?parseInt(n,10)|0:0;if(i)o+=r.c;else--o;if(s)l+=r.r;else--l;return t+(i?"":"$")+pt(o)+(s?"":"$")+ct(l)}return function a(n,i){r=i;return n.replace(e,t)}}();var oi=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g;var ci=function(){return function e(r,t){return r.replace(oi,function(e,r,a,n,i,s){var l=ht(n)-(a?0:t.c);var o=ot(s)-(i?0:t.r);var c=o==0?"":!i?"["+o+"]":o+1;var f=l==0?"":!a?"["+l+"]":l+1;return r+"R"+c+"C"+f})}}();function fi(e,r){return e.replace(oi,function(e,t,a,n,i,s){return t+(a=="$"?a+n:pt(ht(n)+r.c))+(i=="$"?i+s:ct(ot(s)+r.r))})}function ui(e,r,t){var a=wt(r),n=a.s,i=gt(t);var s={r:i.r-n.r,c:i.c-n.c};return fi(e,s)}function hi(e){if(e.length==1)return false;return true}function pi(e){return e.replace(/_xlfn\./g,"")}function di(e){if(e.slice(0,3)=="of:")e=e.slice(3);if(e.charCodeAt(0)==61){e=e.slice(1);if(e.charCodeAt(0)==61)e=e.slice(1)}e=e.replace(/COM\.MICROSOFT\./g,"");e=e.replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g,function(e,r){return r.replace(/\./g,"")});e=e.replace(/\[.(#[A-Z]*[?!])\]/g,"$1");return e.replace(/[;~]/g,",").replace(/\|/g,";")}function mi(e){var r="of:="+e.replace(oi,"$1[.$2$3$4$5]").replace(/\]:\[/g,":");return r.replace(/;/g,"|").replace(/,/g,";")}function vi(e){var r=e.split(":");var t=r[0].
if(n[c].s.r<t||n[c].s.c<s){l=-1;break}l=n[c].e.r-n[c].s.r+1;o=n[c].e.c-n[c].s.c+1;break}if(l<0)continue;var f=bt({r:t,c:s});var u=a.dense?(e[t]||[])[s]:e[f];var h=u&&u.v!=null&&(u.h||Xe(u.w||(St(u),u.w)||""))||"";var p={};if(l>1)p.rowspan=l;if(o>1)p.colspan=o;if(a.editable)h='<span contenteditable="true">'+h+"</span>";else if(u){p["data-t"]=u&&u.t||"z";if(u.v!=null)p["data-v"]=u.v;if(u.z!=null)p["data-z"]=u.z;if(u.l&&(u.l.Target||"#").charAt(0)!="#")h='<a href="'+u.l.Target+'">'+h+"</a>"}p.id=(a.id||"sjs")+"-"+f;i.push(ur("td",h,p))}var d="<tr>";return d+i.join("")+"</tr>"}function a(e,r,t){var a=[];return a.join("")+"<table"+(t&&t.id?' id="'+t.id+'"':"")+">"}var n='<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>';var i="</body></html>";function s(e,r){var s=r||{};var l=s.header!=null?s.header:n;var o=s.footer!=null?s.footer:i;var c=[l];var f=wt(e["!ref"]);s.dense=Array.isArray(e);c.push(a(e,f,s));for(var u=f.s.r;u<=f.e.r;++u)c.push(t(e,f,u,s));c.push("</table>"+o);return c.join("")}return{to_workbook:r,to_sheet:e,_row:t,BEGIN:n,END:i,_preamble:a,from_sheet:s}}();function Xs(e,r,t){var a=t||{};if(v!=null)a.dense=v;var n=0,i=0;if(a.origin!=null){if(typeof a.origin=="number")n=a.origin;else{var s=typeof a.origin=="string"?gt(a.origin):a.origin;n=s.r;i=s.c}}var l=r.getElementsByTagName("tr");var o=Math.min(a.sheetRows||1e7,l.length);var c={s:{r:0,c:0},e:{r:n,c:i}};if(e["!ref"]){var f=wt(e["!ref"]);c.s.r=Math.min(c.s.r,f.s.r);c.s.c=Math.min(c.s.c,f.s.c);c.e.r=Math.max(c.e.r,f.e.r);c.e.c=Math.max(c.e.c,f.e.c);if(n==-1)c.e.r=n=f.e.r+1}var u=[],h=0;var p=e["!rows"]||(e["!rows"]=[]);var d=0,m=0,g=0,b=0,w=0,y=0;if(!e["!cols"])e["!cols"]=[];for(;d<l.length&&m<o;++d){var k=l[d];if(Js(k)){if(a.display)continue;p[m]={hidden:true}}var x=k.children;for(g=b=0;g<x.length;++g){var S=x[g];if(a.display&&Js(S))continue;var C=S.hasAttribute("data-v")?S.getAttribute("data-v"):S.hasAttribute("v")?S.getAttribute("v"):ar(S.innerHTML);var _=S.getAttribute("data-z")||S.getAttribute("z");for(h=0;h<u.length;++h){var A=u[h];if(A.s.c==b+i&&A.s.r<m+n&&m+n<=A.e.r){b=A.e.c+1-i;h=-1}}y=+S.getAttribute("colspan")||1;if((w=+S.getAttribute("rowspan")||1)>1||y>1)u.push({s:{r:m+n,c:b+i},e:{r:m+n+(w||1)-1,c:b+i+(y||1)-1}});var F={t:"s",v:C};var E=S.getAttribute("data-t")||S.getAttribute("t")||"";if(C!=null){if(C.length==0)F.t=E||"z";else if(a.raw||C.trim().length==0||E=="s"){}else if(C==="TRUE")F={t:"b",v:true};else if(C==="FALSE")F={t:"b",v:false};else if(!isNaN(pe(C)))F={t:"n",v:pe(C)};else if(!isNaN(me(C).getDate())){F={t:"d",v:ce(C)};if(!a.cellDates)F={t:"n",v:re(F.v)};F.z=a.dateNF||P._table[14]}}if(F.z===undefined&&_!=null)F.z=_;var T="",O=S.getElementsByTagName("A");if(O&&O.length)for(var D=0;D<O.length;++D)if(O[D].hasAttribute("href")){T=O[D].getAttribute("href");if(T.charAt(0)!="#")break}if(T&&T.charAt(0)!="#")F.l={Target:T};if(a.dense){if(!e[m+n])e[m+n]=[];e[m+n][b+i]=F}else e[bt({c:b+i,r:m+n})]=F;if(c.e.c<b+i)c.e.c=b+i;b+=y}++m}if(u.length)e["!merges"]=(e["!merges"]||[]).concat(u);c.e.r=Math.max(c.e.r,m-1+n);e["!ref"]=yt(c);if(m>=o)e["!fullref"]=yt((c.e.r=l.length-d+m-1+n,c));return e}function Gs(e,r){var t=r||{};var a=t.dense?[]:{};return Xs(a,e,r)}function Ys(e,r){return Ct(Gs(e,r),r)}function Js(e){var r="";var t=Ks(e);if(t)r=t(e).getPropertyValue("display");if(!r)r=e.style&&e.style.display;return r==="none"}function Ks(e){if(e.ownerDocument.defaultView&&typeof e.ownerDocument.defaultView.getComputedStyle==="function")return e.ownerDocument.defaultView.getComputedStyle;if(typeof getComputedStyle==="function")return getComputedStyle;return null}var qs=function(){var e=function(e){var r=e.replace(/[\t\r\n]/g," ").trim().replace(/ +/g," ").replace(/<text:s\/>/g," ").replace(/<text:s text:c="(\d+)"\/>/g,function(e,r){return Array(parseInt(r,10)+1).join(" ")}).replace(/<text:tab[^>]*\/>/g,"\t").replace(/<text:line-break\/>/g,"\n");var t=Ue(r.replace(/<[^>]*>/g,""));return[t]};var r={day:["d","dd"],month:["m","mm"],year:["y","yy"],hours:["h","hh"],minutes:["m","mm"],seconds:["s","ss"],"am-pm":["A/P","AM/PM"],"day-of-we
}if(r.Strings!=null&&r.Strings.length>0){s="xl/sharedStrings."+t;Fe(i,s,js(r.Strings,s,r));n.strs.push(s);ua(r.wbrels,-1,"sharedStrings."+t,ia.SST)}s="xl/workbook."+t;Fe(i,s,zs(e,s,r));n.workbooks.push(s);ua(r.rels,1,s,ia.WB);s="xl/theme/theme1.xml";Fe(i,s,jn(e.Themes,r));n.themes.push(s);ua(r.wbrels,-1,"theme/theme1.xml",ia.THEME);s="xl/styles."+t;Fe(i,s,Ws(e,s,r));n.styles.push(s);ua(r.wbrels,-1,"styles."+t,ia.STY);if(e.vbaraw&&a){s="xl/vbaProject.bin";Fe(i,s,e.vbaraw);n.vba.push(s);ua(r.wbrels,-1,"vbaProject.bin",ia.VBA)}Fe(i,"[Content_Types].xml",na(n,r));Fe(i,"_rels/.rels",ca(r.rels));Fe(i,"xl/_rels/workbook."+t+".rels",ca(r.wbrels));delete r.revssf;delete r.ssf;return i}function dl(e,r){Gn=1024;if(e&&!e.SSF){e.SSF=P.get_table()}if(e&&e.SSF){R(P);P.load_table(e.SSF);r.revssf=Z(e.SSF);r.revssf[e.SSF[65535]]=0;r.ssf=e.SSF}r.rels={};r.wbrels={};r.Strings=[];r.Strings.Count=0;r.Strings.Unique=0;if(yi)r.revStrings=new Map;else{r.revStrings={};r.revStrings.foo=[];delete r.revStrings.foo}var t="xml";var a=ti.indexOf(r.bookType)>-1;var n=ea();il(r=r||{});var i=Ee();var s="",l=0;r.cellXfs=[];Ci(r.cellXfs,{},{revssf:{General:0}});if(!e.Props)e.Props={};s="docProps/core.xml";Fe(i,s,Ca(e.Props,r));n.coreprops.push(s);ua(r.rels,2,s,ia.CORE_PROPS);s="docProps/app.xml";if(e.Props&&e.Props.SheetNames){}else if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{var o=[];for(var c=0;c<e.SheetNames.length;++c)if((e.Workbook.Sheets[c]||{}).Hidden!=2)o.push(e.SheetNames[c]);e.Props.SheetNames=o}e.Props.Worksheets=e.Props.SheetNames.length;Fe(i,s,Oa(e.Props,r));n.extprops.push(s);ua(r.rels,3,s,ia.EXT_PROPS);if(e.Custprops!==e.Props&&J(e.Custprops||{}).length>0){s="docProps/custom.xml";Fe(i,s,Pa(e.Custprops,r));n.custprops.push(s);ua(r.rels,4,s,ia.CUST_PROPS)}for(l=1;l<=e.SheetNames.length;++l){var f={"!id":{}};var u=e.Sheets[e.SheetNames[l-1]];var h=(u||{})["!type"]||"sheet";switch(h){case"chart":;default:s="xl/worksheets/sheet"+l+"."+t;Fe(i,s,ss(l-1,r,e,f));n.sheets.push(s);ua(r.wbrels,-1,"worksheets/sheet"+l+"."+t,ia.WS[0]);}if(u){var p=u["!comments"];var d=false;if(p&&p.length>0){var m="xl/comments"+l+"."+t;Fe(i,m,Zn(p,r));n.comments.push(m);ua(f,-1,"../comments"+l+"."+t,ia.CMNT);d=true}if(u["!legacy"]){if(d)Fe(i,"xl/drawings/vmlDrawing"+l+".vml",Yn(l,u["!comments"]))}delete u["!comments"];delete u["!legacy"]}if(f["!id"].rId1)Fe(i,sa(s),ca(f))}if(r.Strings!=null&&r.Strings.length>0){s="xl/sharedStrings."+t;Fe(i,s,Qa(r.Strings,r));n.strs.push(s);ua(r.wbrels,-1,"sharedStrings."+t,ia.SST)}s="xl/workbook."+t;Fe(i,s,Fs(e,r));n.workbooks.push(s);ua(r.rels,1,s,ia.WB);s="xl/theme/theme1.xml";Fe(i,s,jn(e.Themes,r));n.themes.push(s);ua(r.wbrels,-1,"theme/theme1.xml",ia.THEME);s="xl/styles."+t;Fe(i,s,Mn(e,r));n.styles.push(s);ua(r.wbrels,-1,"styles."+t,ia.STY);if(e.vbaraw&&a){s="xl/vbaProject.bin";Fe(i,s,e.vbaraw);n.vba.push(s);ua(r.wbrels,-1,"vbaProject.bin",ia.VBA)}Fe(i,"[Content_Types].xml",na(n,r));Fe(i,"_rels/.rels",ca(r.rels));Fe(i,"xl/_rels/workbook."+t+".rels",ca(r.wbrels));delete r.revssf;delete r.ssf;return i}function ml(e,r){var t="";switch((r||{}).type||"base64"){case"buffer":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];case"base64":t=b.decode(e.slice(0,12));break;case"binary":t=e;break;case"array":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];default:throw new Error("Unrecognized type "+(r&&r.type||"undefined"));}return[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3),t.charCodeAt(4),t.charCodeAt(5),t.charCodeAt(6),t.charCodeAt(7)]}function vl(e,r){if(H.find(e,"EncryptedPackage"))return ul(e,r);return parse_xlscfb(e,r)}function gl(e,r){var t,a=e;var n=r||{};if(!n.type)n.type=w&&Buffer.isBuffer(e)?"buffer":"base64";t=Te(a,n);return fl(t,n)}function bl(e,r){var t=0;e:while(t<e.length)switch(e.charCodeAt(t)){case 10:;case 13:;case 32:++t;break;case 60:return parse_xlml(e.slice(t),r);default:break e;}return za.to_workbook(e,r)}function wl(e,r){var t="",a=ml(e,r);switch(r.type){case"base64":t=b.decode(e);break;case"binary":t=e;break;case"buffer":t=e.toString("binary");break;case"array":t=fe(e);break