sheetjs/dist/xlsx.mini.min.js

11 lines
260 KiB
JavaScript
Raw Normal View History

/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
2022-07-26 02:20:22 +00:00
var XLSX={};function make_xlsx_lib(e){e.version="0.18.10";var r=1200,t=1252;var a;var n=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4];var s={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 i=function(e){if(n.indexOf(e)==-1)return;t=s[0]=e};function l(){i(1252)}var o=function(e){r=e;i(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 d=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 m=function _c(e){return String.fromCharCode(e)};var p=function Ac(e){return String.fromCharCode(e)};function v(e){a=e;o=function(e){r=e;i(e)};d=function(e){if(e.charCodeAt(0)===255&&e.charCodeAt(1)===254){return a.utils.decode(1200,f(e.slice(2)))}return e};m=function n(e){if(r===1200)return String.fromCharCode(e);return a.utils.decode(r,[e&255,e>>8])[0]};p=function s(e){return a.utils.decode(t,[e])[0]};na()}var g=null;var b=true;var w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function k(e){var r="";var t=0,a=0,n=0,s=0,i=0,l=0,o=0;for(var c=0;c<e.length;){t=e.charCodeAt(c++);s=t>>2;a=e.charCodeAt(c++);i=(t&3)<<4|a>>4;n=e.charCodeAt(c++);l=(a&15)<<2|n>>6;o=n&63;if(isNaN(a)){l=o=64}else if(isNaN(n)){o=64}r+=w.charAt(s)+w.charAt(i)+w.charAt(l)+w.charAt(o)}return r}function y(e){var r="";var t=0,a=0,n=0,s=0,i=0,l=0,o=0;for(var c=0;c<e.length;){t=e.charCodeAt(c++);if(t>255)t=95;s=t>>2;a=e.charCodeAt(c++);if(a>255)a=95;i=(t&3)<<4|a>>4;n=e.charCodeAt(c++);if(n>255)n=95;l=(a&15)<<2|n>>6;o=n&63;if(isNaN(a)){l=o=64}else if(isNaN(n)){o=64}r+=w.charAt(s)+w.charAt(i)+w.charAt(l)+w.charAt(o)}return r}function x(e){var r="";var t=0,a=0,n=0,s=0,i=0,l=0,o=0;e=e.replace(/[^\w\+\/\=]/g,"");for(var c=0;c<e.length;){s=w.indexOf(e.charAt(c++));i=w.indexOf(e.charAt(c++));t=s<<2|i>>4;r+=String.fromCharCode(t);l=w.indexOf(e.charAt(c++));a=(i&15)<<4|l>>2;if(l!==64){r+=String.fromCharCode(a)}o=w.indexOf(e.charAt(c++));n=(l&3)<<6|o;if(o!==64){r+=String.fromCharCode(n)}}return r}var S=function(){return typeof Buffer!=="undefined"&&typeof undefined!=="undefined"&&typeof{}!=="undefined"&&!!{}.node}();var C=function(){if(typeof Buffer!=="undefined"){var e=!Buffer.from;if(!e)try{Buffer.from("foo","utf8")}catch(r){e=true}return e?function(e,r){return r?new Buffer(e,r):new Buffer(e)}:Buffer.from.bind(Buffer)}return function(){}}();var _=function(){if(typeof Buffer==="undefined")return false;var e=C([65,0]);if(!e)return false;var r=e.toString("utf16le");return r.length==1}();function A(e){if(S)return Buffer.alloc?Buffer.alloc(e):new Buffer(e);return typeof Uint8Array!="undefined"?new Uint8Array(e):new Array(e)}function F(e){if(S)return Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e);return typeof Uint8Array!="undefined"?new Uint8Array(e):new Array(e)}var E=function Fc(e){if(S)return C(e,"binary");return e.split("").map(function(e){return e.charCodeAt(0)&255})};function T(e){if(typeof ArrayBuffer==="undefined")return E(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 D(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 O(e){if(typeof Uint8Array==="undefined")throw new Error("Unsupported");return new Uint8Array(e)}function M(e){if(typeof ArrayBuffer=="undefined")throw new Error("Unsupported");if(e instanceof ArrayBuffer)return M(new Uint8Array(e));var r=new Array(e.length);for(var t=0;t<e.length;++t)r[t]=e[t];return r}var N=S?functi
for(a=0;a!=256;++a)n[a]=e[a];for(a=0;a!=256;++a){t=e[a];for(r=256+a;r<4096;r+=256)t=n[r]=t>>>8^e[t&255]}var s=[];for(a=1;a!=16;++a)s[a-1]=typeof Int32Array!=="undefined"?n.subarray(a*256,a*256+256):n.slice(a*256,a*256+256);return s}var n=a(t);var s=n[0],i=n[1],l=n[2],o=n[3],c=n[4];var f=n[5],u=n[6],h=n[7],d=n[8],m=n[9];var p=n[10],v=n[11],g=n[12],b=n[13],w=n[14];function k(e,r){var a=r^-1;for(var n=0,s=e.length;n<s;)a=a>>>8^t[(a^e.charCodeAt(n++))&255];return~a}function y(e,r){var a=r^-1,n=e.length-15,k=0;for(;k<n;)a=w[e[k++]^a&255]^b[e[k++]^a>>8&255]^g[e[k++]^a>>16&255]^v[e[k++]^a>>>24]^p[e[k++]]^m[e[k++]]^d[e[k++]]^h[e[k++]]^u[e[k++]]^f[e[k++]]^c[e[k++]]^o[e[k++]]^l[e[k++]]^i[e[k++]]^s[e[k++]]^t[e[k++]];n+=15;while(k<n)a=a>>>8^t[(a^e[k++])&255];return~a}function x(e,r){var a=r^-1;for(var n=0,s=e.length,i=0,l=0;n<s;){i=e.charCodeAt(n++);if(i<128){a=a>>>8^t[(a^i)&255]}else if(i<2048){a=a>>>8^t[(a^(192|i>>6&31))&255];a=a>>>8^t[(a^(128|i&63))&255]}else if(i>=55296&&i<57344){i=(i&1023)+64;l=e.charCodeAt(n++)&1023;a=a>>>8^t[(a^(240|i>>8&7))&255];a=a>>>8^t[(a^(128|i>>2&63))&255];a=a>>>8^t[(a^(128|l>>6&15|(i&3)<<4))&255];a=a>>>8^t[(a^(128|l&63))&255]}else{a=a>>>8^t[(a^(224|i>>12&15))&255];a=a>>>8^t[(a^(128|i>>6&63))&255];a=a>>>8^t[(a^(128|i&63))&255]}}return~a}e.table=t;e.bstr=k;e.buf=y;e.str=x;return e}();var er=function Tc(){var e={};e.version="1.2.2";function r(e,r){var t=e.split("/"),a=r.split("/");for(var n=0,s=0,i=Math.min(t.length,a.length);n<i;++n){if(s=t[n].length-a[n].length)return s;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 s(e){var r=e._R(2)&65535;var t=e._R(2)&65535;var a=new Date;var n=t&31;t>>>=5;var s=t&15;t>>>=4;a.setMilliseconds(0);a.setFullYear(t+1980);a.setMonth(s-1);a.setDate(n);var i=r&31;r>>>=5;var l=r&63;r>>>=6;a.setHours(r);a.setMinutes(l);a.setSeconds(i<<1);return a}function i(e){ga(e,0);var r={};var t=0;while(e.l<=e.length-4){var a=e._R(2);var n=e._R(2),s=e.l+n;var i={};switch(a){case 21589:{t=e._R(1);if(t&1)i.mtime=e._R(4);if(n>5){if(t&2)i.atime=e._R(4);if(t&4)i.ctime=e._R(4)}if(i.mtime)i.mt=new Date(i.mtime*1e3)}break;}e.l=s;r[a]=i}return r}var l;function o(){return l||(l=rr)}function c(e,r){if(e[0]==80&&e[1]==75)return Oe(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 s=0;var i=0;var l=0;var o=0;var c=[];var m=e.slice(0,512);ga(m,0);var v=f(m);t=v[0];switch(t){case 3:a=512;break;case 4:a=4096;break;case 0:if(v[1]==0)return Oe(e,r);default:throw new Error("Major Version: Expected 3 or 4 saw "+t);}if(a!==512){m=e.slice(0,a);ga(m,28)}var w=e.slice(0,a);u(m,t);var k=m._R(4,"i");if(t===3&&k!==0)throw new Error("# Directory Sectors: Expected 0 saw "+k);m.l+=4;i=m._R(4,"i");m.l+=4;m.chk("00100000","Mini Stream Cutoff Size: ");l=m._R(4,"i");n=m._R(4,"i");o=m._R(4,"i");s=m._R(4,"i");for(var y=-1,x=0;x<109;++x){y=m._R(4,"i");if(y<0)break;c[x]=y}var S=h(e,a);p(o,s,S,a,c);var C=g(S,i,c,a);C[i].name="!Directory";if(n>0&&l!==B)C[l].name="!MiniFAT";C[c[0]].name="!FAT";C.fat_addrs=c;C.ssz=a;var _={},A=[],F=[],E=[];b(i,C,S,A,n,_,F,l);d(F,E,A);A.shift();var T={FileIndex:F,FullPaths:E};if(r&&r.raw)T.raw={header:w,sectors:S};return T}function f(e){if(e[e.l]==80&&e[e.l+1]==75)return[0,0];e.chk(z,"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
if(!a)throw new Error("Unsupported ISO Duration Field: M");else t*=60;case"S":break;}r+=t*parseInt(n[s],10)}return r}var br=new Date("2017-02-19T19:06:09.000Z");var wr=isNaN(br.getFullYear())?new Date("2/19/17"):br;var kr=wr.getFullYear()==2017;function yr(e,r){var t=new Date(e);if(kr){if(r>0)t.setTime(t.getTime()+t.getTimezoneOffset()*60*1e3);else if(r<0)t.setTime(t.getTime()-t.getTimezoneOffset()*60*1e3);return t}if(e instanceof Date)return e;if(wr.getFullYear()==1917&&!isNaN(t.getFullYear())){var a=t.getFullYear();if(e.indexOf(""+a)>-1)return t;t.setFullYear(t.getFullYear()+100);return t}var n=e.match(/\d+/g)||["2017","2","19","0","0","0"];var s=new Date(+n[0],+n[1]-1,+n[2],+n[3]||0,+n[4]||0,+n[5]||0);if(e.indexOf("Z")>-1)s=new Date(s.getTime()-s.getTimezoneOffset()*60*1e3);return s}function xr(e,r){if(S&&Buffer.isBuffer(e)){if(r&&_){if(e[0]==255&&e[1]==254)return gt(e.slice(2).toString("utf16le"));if(e[1]==254&&e[2]==255)return gt(h(e.slice(2).toString("binary")))}return e.toString("binary")}if(typeof TextDecoder!=="undefined")try{if(r){if(e[0]==255&&e[1]==254)return gt(new TextDecoder("utf-16le").decode(e.slice(2)));if(e[0]==254&&e[1]==255)return gt(new TextDecoder("utf-16be").decode(e.slice(2)))}var t={"€":"€","":"‚","ƒ":"ƒ","„":"„","…":"…","†":"†","‡":"‡","ˆ":"ˆ","‰":"‰","Š":"Š","":"‹","Œ":"Œ","Ž":"Ž","":"‘","":"’","“":"“","”":"”","•":"•","":"–","—":"—","˜":"˜","™":"™","š":"š","":"›","œ":"œ","ž":"ž","Ÿ":"Ÿ"};if(Array.isArray(e))e=new Uint8Array(e);return new TextDecoder("latin1").decode(e).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g,function(e){return t[e]||e})}catch(a){}var n=[];for(var s=0;s!=e.length;++s)n.push(String.fromCharCode(e[s]));return n.join("")}function Sr(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]=Sr(e[t]);return r}function Cr(e,r){var t="";while(t.length<r)t+=e;return t}function _r(e){var r=Number(e);if(!isNaN(r))return isFinite(r)?r: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 Ar=/^(0?\d|1[0-2])(?:|:([0-5]?\d)(?:|(\.\d+)(?:|:([0-5]?\d))|:([0-5]?\d)(|\.\d+)))([ap])m?/;function Fr(e){if(!e[2])return new Date(1900,0,0,+e[1]%12+(e[7]=="p"?12:0),0,0,0);if(e[3]){if(e[4])return new Date(1900,0,0,+e[1]%12+(e[7]=="p"?12:0),+e[2],+e[4],parseFloat(e[3])*1e3);else return new Date(1900,0,0,e[7]=="p"?12:0,+e[1],+e[2],parseFloat(e[3])*1e3)}else if(e[5])return new Date(1900,0,0,+e[1]%12+(e[7]=="p"?12:0),+e[2],+e[5],e[6]?parseFloat(e[6])*1e3:0);else return new Date(1900,0,0,+e[1]%12+(e[7]=="p"?12:0),+e[2],0,0)}var Er=["january","february","march","april","may","june","july","august","september","october","november","december"];function Tr(e){var r=e.toLowerCase();var t=r.replace(/\s+/g,"");var a=t.match(Ar);if(a)return Fr(a);var n=new Date(e),s=new Date(NaN);var i=n.getYear(),l=n.getMonth(),o=n.getDate();if(isNaN(o))return s;if(r.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)){r=r.replace(/[^a-z]/g,"").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,"");if(r.length>3&&Er.indexOf(r)==-1)return s}else if(r.replace(/[ap]m?/,"").match(/[a-z]/))return s;if(i<0||i>8099||e.match(/[^-0-9:,\/\\]/))return s;return n}var Dr=function(){var e="abacaba".split(/(:?b)/i).length==5;return function r(t,a,n){if(e||typeof a=="string")return t.split(a);var s=t.split(a),i=[s[0]];for(var l=1;l<s.length;++l){i.push(n);i.push(s[l])}return i}}();function Or(e){if(!e)return null;if(e.content&&e.type)return xr(e.content,true);if(e.data)return d(e.data);if(e.asNodeBuffer&&S)return d(e.asNodeBuffer().toString("binary"));if(e.asBinary)return d(e.asBinary());if(e._data&&e._data.getContent)return d
"application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"TODO","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats
var o="\r\n";var h=(((t||{}).Workbook||{}).WBProps||{}).date1904;a.push("P;PGeneral");a.push("F;P0;DG0G8;M255");if(e["!cols"])f(a,e["!cols"]);if(e["!rows"])u(a,e["!rows"]);a.push("B;Y"+(s.e.r-s.s.r+1)+";X"+(s.e.c-s.s.c+1)+";D"+[s.s.c,s.s.r,s.e.c,s.e.r].join(" "));a.push("O;L;D;B"+(h?";V4":"")+";K47;G100 0.001");for(var d=s.s.r;d<=s.e.r;++d){var m=[];for(var p=s.s.c;p<=s.e.c;++p){var v=La({r:d,c:p});i=l?(e[d]||[])[p]:e[v];if(!i||i.v==null&&(!i.f||i.F))continue;m.push(c(i,e,d,p,r))}n.push(m.join(o))}return a.join(o)+o+n.join(o)+o+"E"+o}return{to_workbook:l,from_sheet:h}}();var Zn=function(){function e(e,t){switch(t.type){case"base64":return r(x(e),t);case"binary":return r(e,t);case"buffer":return r(S&&Buffer.isBuffer(e)?e.toString("binary"):D(e),t);case"array":return r(xr(e),t);}throw new Error("Unrecognized type "+t.type)}function r(e,r){var t=e.split("\n"),a=-1,n=-1,s=0,i=[];for(;s!==t.length;++s){if(t[s].trim()==="BOT"){i[++a]=[];n=0;continue}if(a<0)continue;var l=t[s].trim().split(",");var o=l[0],c=l[1];++s;var f=t[s]||"";while((f.match(/["]/g)||[]).length&1&&s<t.length-1)f+="\n"+t[++s];f=f.trim();switch(+o){case-1:if(f==="BOT"){i[++a]=[];n=0;continue}else if(f!=="EOD")throw new Error("Unrecognized DIF special command "+f);break;case 0:if(f==="TRUE")i[a][n]=true;else if(f==="FALSE")i[a][n]=false;else if(!isNaN(_r(c)))i[a][n]=_r(c);else if(!isNaN(Tr(c).getDate()))i[a][n]=yr(c);else i[a][n]=c;++n;break;case 1:f=f.slice(1,f.length-1);f=f.replace(/""/g,'"');if(b&&f&&f.match(/^=".*"$/))f=f.slice(2,-1);i[a][n++]=f!==""?f:null;break;}if(f==="EOD")break}if(r&&r.sheetRows)i=i.slice(0,r.sheetRows);return i}function t(r,t){return Ga(e(r,t),t)}function a(e,r){var a=Va(t(e,r),r);a.bookType="dif";return a}var n=function(){var e=function t(e,r,a,n,s){e.push(r);e.push(a+","+n);e.push('"'+s.replace(/"/g,'""')+'"')};var r=function a(e,r,t,n){e.push(r+","+t);e.push(r==1?'"'+n.replace(/"/g,'""')+'"':n)};return function n(t){var a=[];var n=Ua(t["!ref"]),s;var i=Array.isArray(t);e(a,"TABLE",0,1,"sheetjs");e(a,"VECTORS",0,n.e.r-n.s.r+1,"");e(a,"TUPLES",0,n.e.c-n.s.c+1,"");e(a,"DATA",0,0,"");for(var l=n.s.r;l<=n.e.r;++l){r(a,-1,0,"BOT");for(var o=n.s.c;o<=n.e.c;++o){var c=La({r:l,c:o});s=i?(t[l]||[])[o]:t[c];if(!s){r(a,1,0,"");continue}switch(s.t){case"n":var f=b?s.w:s.v;if(!f&&s.v!=null)f=s.v;if(f==null){if(b&&s.f&&!s.F)r(a,1,0,"="+s.f);else r(a,1,0,"")}else r(a,0,f,"V");break;case"b":r(a,0,s.v?1:0,s.v?"TRUE":"FALSE");break;case"s":r(a,1,0,!b||isNaN(s.v)?s.v:'="'+s.v+'"');break;case"d":if(!s.w)s.w=Ue(s.z||K[14],hr(yr(s.v)));if(b)r(a,0,s.w,"V");else r(a,1,0,s.w);break;default:r(a,1,0,"");}}}r(a,-1,0,"EOD");var u="\r\n";var h=a.join(u);return h}}();return{to_workbook:a,to_sheet:t,from_sheet:n}}();var qn=function(){function e(e){return e.replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,"\n")}function r(e){return e.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function t(r,t){var a=r.split("\n"),n=-1,s=-1,i=0,l=[];for(;i!==a.length;++i){var o=a[i].trim().split(":");if(o[0]!=="cell")continue;var c=Ra(o[1]);if(l.length<=c.r)for(n=l.length;n<=c.r;++n)if(!l[n])l[n]=[];n=c.r;s=c.c;switch(o[2]){case"t":l[n][s]=e(o[3]);break;case"v":l[n][s]=+o[3];break;case"vtf":var f=o[o.length-1];case"vtc":switch(o[3]){case"nl":l[n][s]=+o[4]?true:false;break;default:l[n][s]=+o[4];break;}if(o[2]=="vtf")l[n][s]=[l[n][s],f];}}if(t&&t.sheetRows)l=l.slice(0,t.sheetRows);return l}function a(e,r){return Ga(t(e,r),r)}function n(e,r){return Va(a(e,r),r)}var s=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join("\n");var i=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join("\n")+"\n";var l=["# SocialCalc Spreadsheet Control Save","part:sheet"].join("\n");var o="--SocialCalcSpreadsheetControlSave--";function c(e){if(!e||!e["!ref"])return"";var t=[],a=[],n,s="";var i=Ba(e["!ref"]);var l=Array.isArray(e);for(var o=i.s.r;o<=i.e.r;++o){for(var c=i.s.c;c<=i.e.c;++c){s=La({r:o,c:c});n=l?(e[o]||[])[c]:e[s];if(!n||n.v==null||n.t==="z")continue;a=["cell",
t[t.length]="</a:gsLst>";t[t.length]='<a:lin ang="16200000" scaled="0"/>';t[t.length]="</a:gradFill>";t[t.length]="</a:fillStyleLst>";t[t.length]="<a:lnStyleLst>";t[t.length]='<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>';t[t.length]='<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>';t[t.length]='<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>';t[t.length]="</a:lnStyleLst>";t[t.length]="<a:effectStyleLst>";t[t.length]="<a:effectStyle>";t[t.length]="<a:effectLst>";t[t.length]='<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>';t[t.length]="</a:effectLst>";t[t.length]="</a:effectStyle>";t[t.length]="<a:effectStyle>";t[t.length]="<a:effectLst>";t[t.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>';t[t.length]="</a:effectLst>";t[t.length]="</a:effectStyle>";t[t.length]="<a:effectStyle>";t[t.length]="<a:effectLst>";t[t.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>';t[t.length]="</a:effectLst>";t[t.length]='<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>';t[t.length]='<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>';t[t.length]="</a:effectStyle>";t[t.length]="</a:effectStyleLst>";t[t.length]="<a:bgFillStyleLst>";t[t.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>';t[t.length]='<a:gradFill rotWithShape="1">';t[t.length]="<a:gsLst>";t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';t[t.length]='<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>';t[t.length]="</a:gsLst>";t[t.length]='<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>';t[t.length]="</a:gradFill>";t[t.length]='<a:gradFill rotWithShape="1">';t[t.length]="<a:gsLst>";t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>';t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>';t[t.length]="</a:gsLst>";t[t.length]='<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>';t[t.length]="</a:gradFill>";t[t.length]="</a:bgFillStyleLst>";t[t.length]="</a:fmtScheme>";t[t.length]="</a:themeElements>";t[t.length]="<a:objectDefaults>";t[t.length]="<a:spDef>";t[t.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>';t[t.length]="</a:spDef>";t[t.length]="<a:lnDef>";t[t.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>';t[t.length]="</a:lnDef>";t[t.length]="</a:objectDefaults>";t[t.length]="<a:extraClrSchemeLst/>";t[t.length]="</a:theme>";return t.join("")}function ti(e,r,t){var a={Types:[],Cell:[],Value:[]};if(!e)return a;var n=false;var s=2;var i;e.repl
};var s={"!type":"chart","!drawel":null,"!rel":""};var i;var l=e.match(qi);if(l)al(l[0],s,n,t);if(i=e.match(/drawing r:id="(.*?)"/))s["!rel"]=i[1];if(a["!id"][s["!rel"]])s["!drawel"]=a["!id"][s["!rel"]];return s}var Al=[["allowRefreshQuery",false,"bool"],["autoCompressPictures",true,"bool"],["backupFile",false,"bool"],["checkCompatibility",false,"bool"],["CodeName",""],["date1904",false,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",false,"bool"],["hidePivotFieldList",false,"bool"],["promptedSolutions",false,"bool"],["publishItems",false,"bool"],["refreshAllConnections",false,"bool"],["saveExternalLinkValues",true,"bool"],["showBorderUnselectedTables",true,"bool"],["showInkAnnotation",true,"bool"],["showObjects","all"],["showPivotChartFilter",false,"bool"],["updateLinks","userSet"]];var Fl=[["activeTab",0,"int"],["autoFilterDateGrouping",true,"bool"],["firstSheet",0,"int"],["minimized",false,"bool"],["showHorizontalScroll",true,"bool"],["showSheetTabs",true,"bool"],["showVerticalScroll",true,"bool"],["tabRatio",600,"int"],["visibility","visible"]];var El=[];var Tl=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];function Dl(e,r){for(var t=0;t!=e.length;++t){var a=e[t];for(var n=0;n!=r.length;++n){var s=r[n];if(a[s[0]]==null)a[s[0]]=s[1];else switch(s[2]){case"bool":if(typeof a[s[0]]=="string")a[s[0]]=ut(a[s[0]]);break;case"int":if(typeof a[s[0]]=="string")a[s[0]]=parseInt(a[s[0]],10);break;}}}}function Ol(e,r){for(var t=0;t!=r.length;++t){var a=r[t];if(e[a[0]]==null)e[a[0]]=a[1];else switch(a[2]){case"bool":if(typeof e[a[0]]=="string")e[a[0]]=ut(e[a[0]]);break;case"int":if(typeof e[a[0]]=="string")e[a[0]]=parseInt(e[a[0]],10);break;}}}function Ml(e){Ol(e.WBProps,Al);Ol(e.CalcPr,Tl);Dl(e.WBView,Fl);Dl(e.Sheets,El);Ri.date1904=ut(e.WBProps.date1904)}function Nl(e){if(!e.Workbook)return"false";if(!e.Workbook.WBProps)return"false";return ut(e.Workbook.WBProps.date1904)?"true":"false"}var Pl=":][*?/\\".split("");function Il(e,r){if(e.length>31){if(r)return false;throw new Error("Sheet names cannot exceed 31 chars")}var t=true;Pl.forEach(function(a){if(e.indexOf(a)==-1)return;if(!r)throw new Error("Sheet name cannot contain : \\ / ? * [ ]");t=false});return t}function Rl(e,r,t){e.forEach(function(a,n){Il(a);for(var s=0;s<n;++s)if(a==e[s])throw new Error("Duplicate Sheet Name: "+a);if(t){var i=r&&r[n]&&r[n].CodeName||a;if(i.charCodeAt(0)==95&&i.length>22)throw new Error("Bad Code Name: Worksheet"+i)}})}function Ll(e){if(!e||!e.SheetNames||!e.Sheets)throw new Error("Invalid Workbook");if(!e.SheetNames.length)throw new Error("Workbook is empty");var r=e.Workbook&&e.Workbook.Sheets||[];Rl(e.SheetNames,r,!!e.vbaraw);for(var t=0;t<e.SheetNames.length;++t)ji(e.Sheets[e.SheetNames[t]],e.SheetNames[t],t);e.SheetNames.forEach(function(r,t){var a=e.Sheets[r];if(!a||!a["!autofilter"])return;var n;if(!e.Workbook)e.Workbook={};if(!e.Workbook.Names)e.Workbook.Names=[];e.Workbook.Names.forEach(function(e){if(e.Name=="_xlnm._FilterDatabase"&&e.Sheet==t)n=e});var s=Wa(r)+"!"+$a(a["!autofilter"].ref);if(n)n.Ref=s;else e.Workbook.Names.push({Name:"_xlnm._FilterDatabase",Sheet:t,Ref:s})})}var Bl=/<\w+:workbook/;function zl(e,r){if(!e)throw new Error("Could not find file");var t={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},Names:[],xmlns:""};var a=false,n="xmlns";var s={},i=0;e.replace(Yr,function l(o,c){var f=Zr(o);switch(qr(f[0])){case"<?xml":break;case"<workbook":if(o.match(Bl))n="xmlns"+o.match(/<(\w+):/)[1];t.xmlns=f[n];break;case"</workbook>":break;case"<fileVersion":delete f[0];t.AppVersion=f;break;case"<fileVersion/>":;case"</fileVersion>":break;case"<fileSharing":break;case"<fileSharing/>":break;case"<workbookPr":;case"<workbookPr/>":Al.forEach(function(e){if(f[e[0]]==null)return;switch(e[2]){case"bool":t.WBProps[e[0]]=ut(f[e[0]]);break;case"int":t.WBProps[e[0]]=parseInt(f[e[0]],10);break;default:t.WBProps[e[0]]=f[e[0]];}});if(f.codeName)
"number:min-decimal-places":l[2]&&l.length-1||0,"number:min-integer-digits":l[1].length})+"<number:text>%</number:text>";break e}var o=false;if(["y","m","d"].indexOf(e[0])>-1){t="date";r:for(;i<e.length;++i)switch(s=e[i].toLowerCase()){case"h":;case"s":o=true;--i;break r;case"m":t:for(var c=i+1;c<e.length;++c)switch(e[c]){case"y":;case"d":break t;case"h":;case"s":o=true;--i;break r;};case"y":;case"d":while((e[++i]||"").toLowerCase()==s[0])s+=s[0];--i;switch(s){case"y":;case"yy":a+="<number:year/>";break;case"yyy":;case"yyyy":a+='<number:year number:style="long"/>';break;case"mmmmm":console.error("ODS has no equivalent of format |mmmmm|");case"m":;case"mm":;case"mmm":;case"mmmm":a+='<number:month number:style="'+(s.length%2?"short":"long")+'" number:textual="'+(s.length>=3?"true":"false")+'"/>';break;case"d":;case"dd":a+='<number:day number:style="'+(s.length%2?"short":"long")+'"/>';break;case"ddd":;case"dddd":a+='<number:day-of-week number:style="'+(s.length%2?"short":"long")+'"/>';break;}break;case'"':while(e[++i]!='"'||e[++i]=='"')s+=e[i];--i;a+="<number:text>"+nt(s.slice(1).replace(/""/g,'"'))+"</number:text>";break;case"/":a+="<number:text>"+nt(s)+"</number:text>";break;default:console.error("unrecognized character "+s+" in ODF format "+e);}if(!o)break e;e=e.slice(i+1);i=0}if(e.match(/^\[?[hms]/)){if(t=="number")t="time";if(e.match(/\[/)){e=e.replace(/[\[\]]/g,"");n["number:truncate-on-overflow"]="false"}for(;i<e.length;++i)switch(s=e[i].toLowerCase()){case"h":;case"m":;case"s":while((e[++i]||"").toLowerCase()==s[0])s+=s[0];--i;switch(s){case"h":;case"hh":a+='<number:hours number:style="'+(s.length%2?"short":"long")+'"/>';break;case"m":;case"mm":a+='<number:minutes number:style="'+(s.length%2?"short":"long")+'"/>';break;case"s":;case"ss":if(e[i+1]==".")do{s+=e[i+1];++i}while(e[i+1]=="0");a+='<number:seconds number:style="'+(s.match("ss")?"long":"short")+'"'+(s.match(/\./)?' number:decimal-places="'+(s.match(/0+/)||[""])[0].length+'"':"")+"/>";break;}break;case'"':while(e[++i]!='"'||e[++i]=='"')s+=e[i];--i;a+="<number:text>"+nt(s.slice(1).replace(/""/g,'"'))+"</number:text>";break;case"/":a+="<number:text>"+nt(s)+"</number:text>";break;case"a":if(e.slice(i,i+3).toLowerCase()=="a/p"){a+="<number:am-pm/>";i+=2;break}if(e.slice(i,i+5).toLowerCase()=="am/pm"){a+="<number:am-pm/>";i+=4;break};default:console.error("unrecognized character "+s+" in ODF format "+e);}break e}if(e.indexOf(/\$/)>-1){t="currency"}if(e[0]=="$"){a+='<number:currency-symbol number:language="en" number:country="US">$</number:currency-symbol>';e=e.slice(1);i=0}i=0;if(e[i]=='"'){while(e[++i]!='"'||e[++i]=='"')s+=e[i];--i;if(e[i+1]=="*"){i++;a+="<number:fill-character>"+nt(s.replace(/""/g,'"'))+"</number:fill-character>"}else{a+="<number:text>"+nt(s.replace(/""/g,'"'))+"</number:text>"}e=e.slice(i+1);i=0}var f=e.match(/([#0][0#,]*)(\.[0#]*|)(E[+]?0*|)/i);if(!f||!f[0])console.error("Could not find numeric part of "+e);else{var u=f[1].replace(/,/g,"");a+="<number:"+(f[3]?"scientific-":"")+"number"+' number:min-integer-digits="'+(u.indexOf("0")==-1?"0":u.length-u.indexOf("0"))+'"'+(f[0].indexOf(",")>-1?' number:grouping="true"':"")+(f[2]&&' number:decimal-places="'+(f[2].length-1)+'"'||' number:decimal-places="0"')+(f[3]&&f[3].indexOf("+")>-1?' number:forced-exponent-sign="true"':"")+(f[3]?' number:min-exponent-digits="'+f[3].match(/0+/)[0].length+'"':"")+">"+"</number:"+(f[3]?"scientific-":"")+"number>";i=f.index+f[0].length}if(e[i]=='"'){s="";while(e[++i]!='"'||e[++i]=='"')s+=e[i];--i;a+="<number:text>"+nt(s.replace(/""/g,'"'))+"</number:text>"}}if(!a){console.error("Could not generate ODS number format for |"+e+"|");return""}return Ft("number:"+t+"-style",a,n)}function bo(e,r,t){var a=e.filter(function(e){return e.Sheet==(t==-1?null:t)});if(!a.length)return"";return" <table:named-expressions>\n"+a.map(function(e){var r=Pi(e.Ref);return" "+Ft("table:named-range",null,{"table:name":e.Name,"table:cell-range-address":r,"table:base-cell-address":r.replace(/[\.]?[^\.]*$/,".$A$1")})}).join("\n")+"\n </table:named-expressions>\n"}var wo=functi
;case"file":return nr(r.file,e);case"buffer":return e;default:throw new Error("Unrecognized type "+r.type);}}function Zo(e,r){c();Ll(e);var t=Sr(r||{});if(t.cellStyles){t.cellNF=true;t.sheetStubs=true}if(t.type=="array"){t.type="binary";var a=Zo(e,t);t.type="array";return T(a)}return Vo(e,t)}function qo(e,r){c();Ll(e);var t=Sr(r||{});if(t.cellStyles){t.cellNF=true;t.sheetStubs=true}if(t.type=="array"){t.type="binary";var a=qo(e,t);t.type="array";return T(a)}var n=0;if(t.sheet){if(typeof t.sheet=="number")n=t.sheet;else n=e.SheetNames.indexOf(t.sheet);if(!e.SheetNames[n])throw new Error("Sheet not found: "+t.sheet+" : "+typeof t.sheet)}switch(t.bookType||"xlsb"){case"xml":;case"xlml":return Yo(write_xlml(e,t),t);case"slk":;case"sylk":return Yo(Kn.from_sheet(e.Sheets[e.SheetNames[n]],t,e),t);case"htm":;case"html":return Yo(no(e.Sheets[e.SheetNames[n]],t),t);case"txt":return Jo(oc(e.Sheets[e.SheetNames[n]],t),t);case"csv":return Yo(lc(e.Sheets[e.SheetNames[n]],t),t,"\ufeff");case"dif":return Yo(Zn.from_sheet(e.Sheets[e.SheetNames[n]],t),t);case"dbf":return Ko(Jn.from_sheet(e.Sheets[e.SheetNames[n]],t),t);case"prn":return Yo(Qn.from_sheet(e.Sheets[e.SheetNames[n]],t),t);case"rtf":return Yo(sheet_to_rtf(e.Sheets[e.SheetNames[n]],t),t);case"eth":return Yo(qn.from_sheet(e.Sheets[e.SheetNames[n]],t),t);case"fods":return Yo(ko(e,t),t);case"wk1":return Ko(WK_.sheet_to_wk1(e.Sheets[e.SheetNames[n]],t),t);case"wk3":return Ko(WK_.book_to_wk3(e,t),t);case"biff2":if(!t.biff)t.biff=2;case"biff3":if(!t.biff)t.biff=3;case"biff4":if(!t.biff)t.biff=4;return Ko(write_biff_buf(e,t),t);case"biff5":if(!t.biff)t.biff=5;case"biff8":;case"xla":;case"xls":if(!t.biff)t.biff=8;return Go(e,t);case"xlsx":;case"xlsm":;case"xlam":;case"xlsb":;case"numbers":;case"ods":return Ho(e,t);default:throw new Error("Unrecognized bookType |"+t.bookType+"|");}}function Qo(e){if(e.bookType)return;var r={xls:"biff8",htm:"html",slk:"sylk",socialcalc:"eth",Sh33tJS:"WTF"};var t=e.file.slice(e.file.lastIndexOf(".")).toLowerCase();if(t.match(/^\.[a-z]+$/))e.bookType=t.slice(1);e.bookType=r[e.bookType]||e.bookType}function ec(e,r,t){var a=t||{};a.type="file";a.file=r;Qo(a);return qo(e,a)}function rc(e,r,t){var a=t||{};a.type="file";a.file=r;Qo(a);return Zo(e,a)}function tc(e,r,t,a){var n=t||{};n.type="file";n.file=e;Qo(n);n.type="buffer";var s=a;if(!(s instanceof Function))s=t;return rr.writeFile(e,qo(r,n),s)}function ac(e,r,t,a,n,s,i,l){var o=Ea(t);var c=l.defval,f=l.raw||!Object.prototype.hasOwnProperty.call(l,"raw");var u=true;var h=n===1?[]:{};if(n!==1){if(Object.defineProperty)try{Object.defineProperty(h,"__rowNum__",{value:t,enumerable:false})}catch(d){h.__rowNum__=t}else h.__rowNum__=t}if(!i||e[t])for(var m=r.s.c;m<=r.e.c;++m){var p=i?e[t][m]:e[a[m]+o];if(p===undefined||p.t===undefined){if(c===undefined)continue;if(s[m]!=null){h[s[m]]=c}continue}var v=p.v;switch(p.t){case"z":if(v==null)break;continue;case"e":v=v==0?null:void 0;break;case"s":;case"d":;case"b":;case"n":break;default:throw new Error("unrecognized type "+p.t);}if(s[m]!=null){if(v==null){if(p.t=="e"&&v===null)h[s[m]]=null;else if(c!==undefined)h[s[m]]=c;else if(f&&v===null)h[s[m]]=null;else continue}else{h[s[m]]=f&&(p.t!=="n"||p.t==="n"&&l.rawNumbers!==false)?v:Ha(p,v,l)}if(v!=null)u=false}}return{row:h,isempty:u}}function nc(e,r){if(e==null||e["!ref"]==null)return[];var t={t:"n",v:0},a=0,n=1,s=[],i=0,l="";var o={s:{r:0,c:0},e:{r:0,c:0}};var c=r||{};var f=c.range!=null?c.range:e["!ref"];if(c.header===1)a=1;else if(c.header==="A")a=2;else if(Array.isArray(c.header))a=3;else if(c.header==null)a=0;switch(typeof f){case"string":o=Ua(f);break;case"number":o=Ua(e["!ref"]);o.s.r=f;break;default:o=f;}if(a>0)n=0;var u=Ea(o.s.r);var h=[];var d=[];var m=0,p=0;var v=Array.isArray(e);var g=o.s.r,b=0;var w={};if(v&&!e[g])e[g]=[];var k=c.skipHidden&&e["!cols"]||[];var y=c.skipHidden&&e["!rows"]||[];for(b=o.s.c;b<=o.e.c;++b){if((k[b]||{}).hidden)continue;h[b]=Ma(b);t=v?e[g][b]:e[h[b]+u];switch(a){case 1:s[b]=b-o.s.c;break;case 2:s[b]=h[b];break;case 3:s[b]=c.header[b-o.s.c];break;default:if(t==null)t={w:"__EMPTY",t:"s"}