sheetjs/dist/xlsx.mini.min.js

10 lines
245 KiB
JavaScript
Raw Normal View History

/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
2022-02-14 01:28:13 +00:00
var DO_NOT_EXPORT_CODEPAGE=true;var XLSX={};function make_xlsx_lib(e){e.version="0.18.1";var r=1200,t=1252;if(typeof module!=="undefined"&&typeof require!=="undefined"){if(typeof cptable==="undefined"){if(typeof global!=="undefined")global.cptable=require("./dist/cpexcel.js");else if(typeof window!=="undefined")window.cptable=require("./dist/cpexcel.js")}}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 o(){s(1252)}var l=function(e){r=e;s(e)};function c(){l(1200);o()}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 p=function el(e){return String.fromCharCode(e)};var v=function rl(e){return String.fromCharCode(e)};if(typeof cptable!=="undefined"){l=function(e){r=e;s(e)};d=function(e){if(e.charCodeAt(0)===255&&e.charCodeAt(1)===254){return cptable.utils.decode(1200,f(e.slice(2)))}return e};p=function tl(e){if(r===1200)return String.fromCharCode(e);return cptable.utils.decode(r,[e&255,e>>8])[0]};v=function al(e){return cptable.utils.decode(t,[e])[0]}}var m=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,o=0,l=0,c=0;for(var f=0;f<r.length;){a=r.charCodeAt(f++);s=a>>2;n=r.charCodeAt(f++);o=(a&3)<<4|n>>4;i=r.charCodeAt(f++);l=(n&15)<<2|i>>6;c=i&63;if(isNaN(n)){l=c=64}else if(isNaN(i)){c=64}t+=e.charAt(s)+e.charAt(o)+e.charAt(l)+e.charAt(c)}return t},decode:function(r){var t="";var a=0,n=0,i=0,s=0,o=0,l=0,c=0;r=r.replace(/[^\w\+\/\=]/g,"");for(var f=0;f<r.length;){s=e.indexOf(r.charAt(f++));o=e.indexOf(r.charAt(f++));a=s<<2|o>>4;t+=String.fromCharCode(a);l=e.indexOf(r.charAt(f++));n=(o&15)<<4|l>>2;if(l!==64){t+=String.fromCharCode(n)}c=e.indexOf(r.charAt(f++));i=(l&3)<<6|c;if(c!==64){t+=String.fromCharCode(i)}}return t}}}();var w=typeof Buffer!=="undefined"&&typeof process!=="undefined"&&typeof process.versions!=="undefined"&&!!process.versions.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 _(e){return w?Buffer.allocUnsafe(e):typeof Uint8Array!="undefined"?new Uint8Array(e):new Array(e)}var C=function nl(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 C(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 E(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 F(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;var a=S(e.length+255);for(var n=0;n<e.length;++n){var i=e.charCodeAt(n);if(i<128)a[t++]=
}var i=[];for(a=1;a!=16;++a)i[a-1]=typeof Int32Array!=="undefined"?n.subarray(a*256,a*256+256):n.slice(a*256,a*256+256);return i}var n=a(t);var i=n[0],s=n[1],o=n[2],l=n[3],c=n[4];var f=n[5],u=n[6],h=n[7],d=n[8],p=n[9];var v=n[10],m=n[11],g=n[12],b=n[13],w=n[14];function y(e,r){var a=r^-1;for(var n=0,i=e.length;n<i;)a=a>>>8^t[(a^e.charCodeAt(n++))&255];return~a}function k(e,r){var a=r^-1,n=e.length-15,y=0;for(;y<n;)a=w[e[y++]^a&255]^b[e[y++]^a>>8&255]^g[e[y++]^a>>16&255]^m[e[y++]^a>>>24]^v[e[y++]]^p[e[y++]]^d[e[y++]]^h[e[y++]]^u[e[y++]]^f[e[y++]]^c[e[y++]]^l[e[y++]]^o[e[y++]]^s[e[y++]]^i[e[y++]]^t[e[y++]];n+=15;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,o=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;o=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|o>>6&15|(s&3)<<4))&255];a=a>>>8^t[(a^(128|o&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 sl(){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 o=r&63;r>>>=6;a.setHours(r);a.setMinutes(o);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 o;function l(){return o||(o=require("fs"))}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 We(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 o=0;var l=0;var c=[];var p=e.slice(0,512);Zr(p,0);var m=f(p);t=m[0];switch(t){case 3:a=512;break;case 4:a=4096;break;case 0:if(m[1]==0)return Me(e,r);default:throw new Error("Major Version: Expected 3 or 4 saw "+t);}if(a!==512){p=e.slice(0,a);Zr(p,28)}var b=e.slice(0,a);u(p,t);var w=p._R(4,"i");if(t===3&&w!==0)throw new Error("# Directory Sectors: Expected 0 saw "+w);p.l+=4;s=p._R(4,"i");p.l+=4;p.chk("00100000","Mini Stream Cutoff Size: ");o=p._R(4,"i");n=p._R(4,"i");l=p._R(4,"i");i=p._R(4,"i");for(var y=-1,x=0;x<109;++x){y=p._R(4,"i");if(y<0)break;c[x]=y}var S=h(e,a);v(l,i,S,a,c);var _=g(S,s,c,a);_[s].name="!Directory";if(n>0&&o!==L)_[o].name="!MiniFAT";_[c[0]].name="!FAT";_.fat_addrs=c;_.ssz=a;var C={},A=[],E=[],F=[];k(s,_,S,A,n,C,E,o);d(E,F,A);A.shift();var T={FileIndex:E,FullPaths:F};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
if(isNaN(oe.getFullYear()))oe=new Date("2/19/17");var le=oe.getFullYear()==2017;function ce(e,r){var t=new Date(e);if(le){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(oe.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 i=new Date(+n[0],+n[1]-1,+n[2],+n[3]||0,+n[4]||0,+n[5]||0);if(e.indexOf("Z")>-1)i=new Date(i.getTime()-i.getTimezoneOffset()*60*1e3);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 de(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 pe=["january","february","march","april","may","june","july","august","september","october","november","december"];function ve(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&&pe.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 me="abacaba".split(/(:?b)/i).length==5;function ge(e,r,t){if(me||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 d(e.data);if(e.asNodeBuffer&&w)return d(e.asNodeBuffer().toString("binary"));if(e.asBinary)return d(e.asBinary());if(e._data&&e._data.getContent)return d(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||q(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 _e(e,r,t){if(!t)return be(xe(e,r));if(!r)return null;try{return _e(e,r)}catch(a){return null}}function Ce(e,r,t){if(!t)return we(xe(e,r));if(!r)return null;try{return Ce(e,r)}catch(a){return null}}function Ae(e){var r=e.FullPaths||q(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 Ee(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 Fe(){return H.utils.cfb_new()}function Te(e,r){switch(r.ty
"application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"};var Zt=function(){var e={workbooks:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.main+xml",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.main",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"}};q(e).forEach(function(r){["xlsm","xlam"].forEach(function(t){if(!e[r][t])e[r][t]=e[r].xlsx})});q(e).forEach(function(r){q(e[r]).forEach(function(t){Kt[e[r][t]]=r})});return e}();var Qt=Q(Kt);pr.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[Kt[a.ContentType]]!==undefined)r[Kt[a.ContentType]].push(a.PartName);break;}});if(r.xmlns!==pr.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:pr.CT,"xmlns:xsd":pr.xsd,"xmlns:xsi":pr.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 i
}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 o=t.s.c;o<=t.e.c;++o){var l=bt({r:i,c:o});a=n?(e[i]||[])[o]:e[l];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+(o===0?" ":""))}r.push(s.join(""))}return r.join("\n")}return{to_workbook:l,to_sheet:o,from_sheet:c}}();function Na(e,r){var t=r||{},a=!!t.WTF;t.WTF=true;try{var n=Ta.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 Ma.to_workbook(e,r)}}function Pa(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 Ra=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:ze(a[1])};var i=t.match(r);if(i)n.s=Pa(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 Ia=function yl(){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-underline-style:"+e.uval+";");if(e.sz)a.push("font-size:"+e.sz+"pt;");if(e.outline)a.push("text-effect: outline;");if(e.shadow)a.push("text-shadow: auto;");r.push('<span style="'+a.join("")+'">');if(e.b){r.push("<b>");t.push("</b>")}if(e.i){r.push("<i>");t.push("</i>")}if(e.strike){r.push("<s>");t.push("</s>")}var n=e.valign||"";if(n=="superscript"||n=="super")n="sup";else if(n=="subscript")n="sub";if(n!=""){r.push("<"+n+">");t.push("</"+n+">")}t.push("</span>");return e}function t(t){var a=[[],t.v,[]];if(!t.v)return"";if(t.s)r(t.s,a[0],a[2]);return a[0].join("")+a[1].replace(e,"<br/>")+a[2].join("")}return function a(e){return e.map(t).join("")}}();var La=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,Ba=/<(?:\w+:)?r>/;var Ua=/<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;function za(e,r){var t=r?r.cellHTML:true;var a={};if(!e)return{t:""};if(e.match(/^\s*<(?:\w+:)?t[^>]*>/)){a.t=ze(Ke(e.slice(e.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||""));a.r=Ke(e);if(t)a.h=Xe(a.t)}else if(e.match(Ba)){a.r=Ke(e);a.t=ze(Ke((e.replace(Ua,"").match(La)||[]).join("").replace(Ne,"")));if(t)a.h=Ia(Ra(a.r))}return a}var Wa=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/;var ja=/<(?:\w+:)?(?:si|sstItem)>/g;var $a=/<\/(?:\w+:)?(?:si|sstItem)>/;function Ha(e,r){var t=[],a="";if(!e)return t;var n=e.match(Wa);if(n){a=n[2].replace(ja,"").split($a);for(var i=0;i!=a.length;++i){var s=za(a[i].trim(),r);if(s!=null)t[t.length]=s}n=Ie(n[1]);t.Count=n.count;t.Unique=n.uniqueCount}
}return r.join("")}var Xn="application/vnd.ms-office.vbaProject";function Gn(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 Yn(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 qn=["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 Jn(){return{"!type":"dialog"}}function Kn(){return{"!type":"dialog"}}function Zn(){return{"!type":"macro"}}function Qn(){return{"!type":"macro"}}var ei=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 o=a.length>0?parseInt(a,10)|0:0,l=n.length>0?parseInt(n,10)|0:0;if(i)l+=r.c;else--l;if(s)o+=r.r;else--o;return t+(i?"":"$")+dt(l)+(s?"":"$")+ct(o)}return function a(n,i){r=i;return n.replace(e,t)}}();var ri=/(^|[^._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 ti=function(){return function e(r,t){return r.replace(ri,function(e,r,a,n,i,s){var o=ht(n)-(a?0:t.c);var l=lt(s)-(i?0:t.r);var c=l==0?"":!i?"["+l+"]":l+1;var f=o==0?"":!a?"["+o+"]":o+1;return r+"R"+c+"C"+f})}}();function ai(e,r){return e.replace(ri,function(e,t,a,n,i,s){return t+(a=="$"?a+n:dt(ht(n)+r.c))+(i=="$"?i+s:ct(lt(s)+r.r))})}function ni(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 ai(e,s)}function ii(e){if(e.length==1)return false;return true}function si(e){return e.replace(/_xlfn\./g,"")}var oi={};var li={};ia.WS=["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"];var ci=typeof Map!=="undefined";function fi(e,r,t){var a=0,n=e.length;if(t){if(ci?t.has(r):Object.prototype.hasOwnProperty.call(t,r)){var i=ci?t.get(r):t[r];for(;a<i.length;++a){if(e[i[a]].t===r){e.Count++;return i[a]}}}}else for(;a<n;++a){if(e[a].t===r){e.Count++;return a}}e[n]={t:r};e.Count++;e.Unique++;if(t){if(ci){if(!t.has(r))t.set(r,[]);t.get(r).push(n)}else{if(!Object.prototype.hasOwnProperty.call(t,r))t[r]=[];t[r].push(n)}}return n}function ui(e,r){var t={min:e+1,max:e+1};var a=-1;if(r.MDW)rn=r.MDW;if(r.width!=null)t.customWidth=1;else if(r.wpx!=null)a=an(r.wpx);else if(r.wch!=null)a=r.wch;if(a>-1){t.width=nn(a);t.customWidth=1}else if(r.width!=null)t.width=r.width;if(r.hidden)t.hidden=true;if(r.level!=null){t.outlineLevel=t.level=r.level}return t}function hi(e,r){if(!e)return;var t=[.7,.7,.75,.75,.3,.3];if(r=="xlml")t=[1,1,1,1,.5,.5];if(e.left==null)e.left=t[0];if(e.right==null)e.right=t[1];if(e.top==null)e.top=t[2];if(e.bottom==null)e.bottom=t[3];if(e.header==null)e.header=t[4];if(e.footer==null)e.footer=t[5]}function di(e,r,t){var a=t.revssf[r.z!=null?r.z:"General"];var n=60,i=e.length;if(a==null&&t.ssf){for(;n<392;++n)if(t.ssf[n]==null){P.load(r.z,n);t.ssf[n]=r.z;t.revssf[r.z]=a=n;break}}for(n=0;n!=i;++n)if(e[n].numFmtId===a)return n;e[i]={numFmtId:a,fontId:0,fillId:0,borderId:0,xfId:0,applyNumberFormat:1};return i}function pi(e,r,t,a,n,i){try{if(a.cellNF)e.z=P._table[r]}catch(s){if(a.WTF)throw s}if(e.t==="z"&&!a.cellStyles)return;if(e.t==="d"&&typeof e.v==="string")e.v=ce(e.v);if((!a||a.cellText!==false)&&e.t!=="z")try{if(P._table[r]==null)P.load(L[r]||"General",r);if(e.t==="e")e.w=e.w||qt[e.v];else if(r===0){if(e.t==="n"){if((e.v|0)===e.v)e.w=P._general_int(e.v);else e.w=P._general_num(e.v)}else if(e.t==="d"){var o=re(e.v);if((o|0)===o)e.w=P._general_int(o);else e.w=P
var o=r.getElementsByTagName("tr");var l=Math.min(a.sheetRows||1e7,o.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 d=e["!rows"]||(e["!rows"]=[]);var p=0,v=0,g=0,b=0,w=0,y=0;if(!e["!cols"])e["!cols"]=[];for(;p<o.length&&v<l;++p){var k=o[p];if(Ws(k)){if(a.display)continue;d[v]={hidden:true}}var x=k.children;for(g=b=0;g<x.length;++g){var S=x[g];if(a.display&&Ws(S))continue;var _=S.hasAttribute("data-v")?S.getAttribute("data-v"):S.hasAttribute("v")?S.getAttribute("v"):ar(S.innerHTML);var C=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<v+n&&v+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:v+n,c:b+i},e:{r:v+n+(w||1)-1,c:b+i+(y||1)-1}});var E={t:"s",v:_};var F=S.getAttribute("data-t")||S.getAttribute("t")||"";if(_!=null){if(_.length==0)E.t=F||"z";else if(a.raw||_.trim().length==0||F=="s"){}else if(_==="TRUE")E={t:"b",v:true};else if(_==="FALSE")E={t:"b",v:false};else if(!isNaN(de(_)))E={t:"n",v:de(_)};else if(!isNaN(ve(_).getDate())){E={t:"d",v:ce(_)};if(!a.cellDates)E={t:"n",v:re(E.v)};E.z=a.dateNF||P._table[14]}}if(E.z===undefined&&C!=null)E.z=C;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)!="#")E.l={Target:T};if(a.dense){if(!e[v+n])e[v+n]=[];e[v+n][b+i]=E}else e[bt({c:b+i,r:v+n})]=E;if(c.e.c<b+i)c.e.c=b+i;b+=y}++v}if(u.length)e["!merges"]=(e["!merges"]||[]).concat(u);c.e.r=Math.max(c.e.r,v-1+n);e["!ref"]=yt(c);if(v>=l)e["!fullref"]=yt((c.e.r=o.length-p+v-1+n,c));return e}function Us(e,r){var t=r||{};var a=t.dense?[]:{};return Bs(a,e,r)}function zs(e,r){return _t(Us(e,r),r)}function Ws(e){var r="";var t=js(e);if(t)r=t(e).getPropertyValue("display");if(!r)r=e.style&&e.style.display;return r==="none"}function js(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 $s=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=ze(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-week":["ddd","dddd"],era:["e","ee"],quarter:["\\Qm",'m\\"th quarter"']};return function t(a,n){var i=n||{};if(m!=null&&i.dense==null)i.dense=m;var s=xlml_normalize(a);var o=[],l;var c;var f={name:""},u="",h=0;var d;var p;var v={},g=[];var b=i.dense?[]:{};var w,y;var k={value:""};var x="",S=0,_;var C=[];var A=-1,E=-1,F={s:{r:1e6,c:1e7},e:{r:0,c:0}};var T=0;var O={};var D=[],M={},N=0,P=0;var R=[],I=1,L=1;var B=[];var U={Names:[]};var z={};var W=["",""];var j=[],$={};var H="",V=0;var X=false,G=false;var Y=0;xlmlregex.lastIndex=0;s=s.replace(/<!--([\s\S]*?)-->/gm,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");while(w=xlmlregex.exec(s))switch(w[3]=w[3].replace(/_.*$/,"")){case"table":;case"工作表":if(w[1]==="/"){if(F.e.c>=F.s.c&&F.e.r>=F.s.r)b["!ref"]=yt(F);else b["!ref"]="A1:A1";if(i.sheetRows>0&&i.sheetRows<=F.e.r){b["!fullref"]=b["!ref"];F.e.r=i.sheetRows-1;b["!ref"]=yt(F)}if(D.length)b["!merges"]=D;if(R.length)b["!rows"]=R;d.name=d["名称"]||d.name;if(typeof JSON!=="undefined")JSON.stringify(d);g.push(d.name);v[d.name]=b;G=false}else if(w[0].charAt(w[0].length-2)!=="/"){d=Ie(w[0],false);A=E=-1;F.s.r=F.s.c=1e7;F.e.r=F.e.c=0;b=i.dense?[]:{};D=[];R=[];G=true}break;case"table-row-group":if(w[1]==="/")--T;else++T;break;case"table-row":;case"行":if(w[1]==="/"){A+=I;I=1;break}p=Ie(w[0],false);if
})}})});if(t.SheetNames.length==0)throw new Error("Empty NUMBERS file");return t}return o(l)}();function Js(e){return function r(t){for(var a=0;a!=e.length;++a){var n=e[a];if(t[n[0]]===undefined)t[n[0]]=n[1];if(n[2]==="n")t[n[0]]=Number(t[n[0]])}}}var Ks=function(e){Js([["cellNF",false],["cellHTML",true],["cellFormula",true],["cellStyles",false],["cellText",true],["cellDates",false],["sheetStubs",false],["sheetRows",0,"n"],["bookDeps",false],["bookSheets",false],["bookProps",false],["bookFiles",false],["bookVBA",false],["password",""],["WTF",false]])(e)};var Zs=Js([["cellDates",false],["bookSST",false],["bookType","xlsx"],["compression",false],["WTF",false]]);function Qs(e){if(ia.WS.indexOf(e)>-1)return"sheet";if(ia.CS&&e==ia.CS)return"chart";if(ia.DS&&e==ia.DS)return"dialog";if(ia.MS&&e==ia.MS)return"macro";return e&&e.length?e:"sheet"}function eo(e,r){if(!e)return 0;try{e=r.map(function a(r){if(!r.id)r.id=r.strRelID;return[r.name,e["!id"][r.id].Target,Qs(e["!id"][r.id].Type)]})}catch(t){return null}return!e||e.length===0?null:e}function ro(e,r,t,a,n,i,s,o,l,c,f,u){try{i[a]=oa(_e(e,t,true),r);var h=Se(e,r);var d;switch(o){case"sheet":d=ks(h,r,n,l,i[a],c,f,u);break;case"chart":d=xs(h,r,n,l,i[a],c,f,u);if(!d||!d["!drawel"])break;var p=Oe(d["!drawel"].Target,r);var v=sa(p);var m=Un(_e(e,p,true),oa(_e(e,v,true),p));var g=Oe(m,p);var b=sa(g);d=Ki(_e(e,g,true),g,l,oa(_e(e,b,true),g),c,d);break;case"macro":d=Ss(h,r,n,l,i[a],c,f,u);break;case"dialog":d=_s(h,r,n,l,i[a],c,f,u);break;default:throw new Error("Unrecognized sheet type "+o);}s[a]=d;var w=[];if(i&&i[a])q(i[a]).forEach(function(t){if(i[a][t].Type==ia.CMNT){var n=Oe(i[a][t].Target,r);w=Fs(Se(e,n,true),n,l);if(!w||!w.length)return;jn(d,w)}})}catch(y){if(l.WTF)throw y}}function to(e){return e.charAt(0)=="/"?e.slice(1):e}function ao(e,r){R(P);r=r||{};Ks(r);if(ke(e,"META-INF/manifest.xml"))return Hs(e,r);if(ke(e,"objectdata.xml"))return Hs(e,r);if(ke(e,"Index/Document.iwa")){if(typeof Uint8Array=="undefined")throw new Error("NUMBERS file parsing requires Uint8Array support");if(typeof qs!="undefined"){if(e.FileIndex)return qs.parse_numbers(e);var t=H.utils.cfb_new();Ae(e).forEach(function(r){Ee(t,r,Ce(e,r))});return qs.parse_numbers(t)}throw new Error("Unsupported NUMBERS file")}if(!ke(e,"[Content_Types].xml")){if(ke(e,"index.xml.gz"))throw new Error("Unsupported NUMBERS 08 file");if(ke(e,"index.xml"))throw new Error("Unsupported NUMBERS 09 file");throw new Error("Unsupported ZIP file")}var a=Ae(e);var n=ra(_e(e,"[Content_Types].xml"));var i=false;var s,o;if(n.workbooks.length===0){o="xl/workbook.xml";if(Se(e,o,true))n.workbooks.push(o)}if(n.workbooks.length===0){o="xl/workbook.bin";if(!Se(e,o,true))throw new Error("Could not find workbook");n.workbooks.push(o);i=true}if(n.workbooks[0].slice(-3)=="bin")i=true;var l={};var c={};if(!r.bookSheets&&!r.bookProps){oi=[];if(n.sst)try{oi=Es(Se(e,to(n.sst)),n.sst,r)}catch(f){if(r.WTF)throw f}if(r.cellStyles&&n.themes.length)l=As(_e(e,n.themes[0].replace(/^\//,""),true)||"",n.themes[0],r);if(n.style)c=Cs(Se(e,to(n.style)),n.style,l,r)}n.links.map(function(t){try{var a=oa(_e(e,sa(to(t))),t);return Os(Se(e,to(t)),a,t,r)}catch(n){}});var u=ys(Se(e,to(n.workbooks[0])),n.workbooks[0],r);var h={},d="";if(n.coreprops.length){d=Se(e,to(n.coreprops[0]),true);if(d)h=pa(d);if(n.extprops.length!==0){d=Se(e,to(n.extprops[0]),true);if(d)ka(d,h,r)}}var p={};if(!r.bookSheets||r.bookProps){if(n.custprops.length!==0){d=_e(e,to(n.custprops[0]),true);if(d)p=Ca(d,r)}}var v={};if(r.bookSheets||r.bookProps){if(u.Sheets)s=u.Sheets.map(function D(e){return e.name});else if(h.Worksheets&&h.SheetNames.length>0)s=h.SheetNames;if(r.bookProps){v.Props=h;v.Custprops=p}if(r.bookSheets&&typeof s!=="undefined")v.SheetNames=s;if(r.bookSheets?v.SheetNames:r.bookProps)return v}s={};var m={};if(r.bookDeps&&n.calcchain)m=Ts(Se(e,to(n.calcchain)),n.calcchain,r);var g=0;var b={};var w,y;{var k=u.Sheets;h.Worksheets=k.length;h.SheetNames=[];for(var x=0;x!=k.length;++x){h.SheetNames[x]=k[x].name}}var S=i?"bin":"xml";var _=n.workbooks[0].lastIndexOf("/");var C=(n.workbooks[0].