>8-p;for(var v=(1<<7-p)-1;v>=0;--v)ye[d|v<>>=3){case 16:i=3+ne(e,r);r+=2;d=m[m.length-1];while(i-- >0)m.push(d);break;case 17:i=3+ie(e,r);r+=3;while(i-- >0)m.push(0);break;case 18:i=11+oe(e,r);r+=7;while(i-- >0)m.push(0);break;default:m.push(d);if(o>>0;var f=0,o=0;while((a&1)==0){a=ie(e,t);t+=3;if(a>>>1==0){if(t&7)t+=8-(t&7);var l=e[t>>>3]|e[(t>>>3)+1]<<8;t+=32;if(l>0){if(!r&&s0){n[i++]=e[t>>>3];t+=8}}continue}else if(a>>1==1){f=9;o=5}else{t=_e(e,t);f=Ce;o=Se}for(;;){if(!r&&s>>1==1?ge[c]:Te[c];t+=h&15;h>>>=4;if((h>>>8&255)===0)n[i++]=h;else if(h==256)break;else{h-=257;var u=h<8?0:h-4>>2;if(u>5)u=0;var d=i+J[h];if(u>0){d+=le(e,t,u);t+=u}c=le(e,t,o);h=a>>>1==1?be[c]:Ee[c];t+=h&15;h>>>=4;var p=h<4?0:h-2>>1;var v=q[h];if(p>0){v+=le(e,t,p);t+=p}if(!r&&s>>3];return[n.slice(0,i),t+7>>>3]}function Oe(e,r){var t=e.slice(e.l||0);var a=xe(t,r);e.l+=a[1];return a[0]}function Re(e,r){if(e){if(typeof console!=="undefined")console.error(r)}else throw new Error(r)}function Ne(e,r){var t=e;ga(t,0);var a=[],n=[];var i={FileIndex:a,FullPaths:n};O(i,{root:r.root});var f=t.length-4;while((t[f]!=80||t[f+1]!=75||t[f+2]!=5||t[f+3]!=6)&&f>=0)--f;t.l=f+4;t.l+=4;var o=t._R(2);t.l+=6;var l=t._R(4);t.l=l;for(f=0;f0){t=t.slice(0,t.length-1);t=t.slice(0,t.lastIndexOf("/")+1);if(i.slice(0,t.length)==t)break}}var s=(a[1]||"").match(/boundary="(.*?)"/);if(!s)throw new Error("MAD cannot find boundary");var f="--"+(s[1]||"");var o=[],l=[];var c={FileIndex:o,FullPaths:l};O(c);var h,u=0;for(n=0;n=32&&d<128)++h;var v=h>=u*4/5;n.push(a);n.push("Content-Location: "+(t.root||"file:///C:/SheetJS/")+s);n.push("Content-Transfer-Encoding: "+(v?"quoted-printable":"base64"));n.push("Content-Type: "+Pe(f,s));n.push("");n.push(v?Me(c):Le(c))}n.push(a+"--\r\n");return n.join("\r\n")}function ze(e){var r={};O(r,e);return r}function Ve(e,r,t,n){var i=n&&n.unsafe;if(!i)O(e);var s=!i&&er.find(e,r);if(!s){var f=e.FullPaths[0];if(r.slice(0,f.length)==f)f=r;else{if(f.slice(-1)!="/")f+="/";f=(f+r).replace("//","/")}s={name:a(r),type:2};e.FileIndex.push(s);e.FullPaths.push(f);if(!i)er.utils.cfb_gc(e)}s.content=t;s.size=t?t.length:0;if(n){if(n.CLSID)s.clsid=n.CLSID;if(n.mt)s.mt=n.mt;if(n.ct)s.ct=n.ct}return s}function Ge(e,r){O(e);var t=er.find(e,r);if(t)for(var a=0;a3)a=true;switch(n[i].slice(n[i].length-1)){case"Y":throw new Error("Unsupported ISO Duration Field: "+n[i].slice(n[i].length-1));case"D":t*=24;case"H":t*=60;case"M":if(!a)throw new Error("Unsupported ISO Duration Field: M");else t*=60;case"S":break;}r+=t*parseInt(n[i],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 Ar(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 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 Tr(e,r){if(E&&Buffer.isBuffer(e)){if(r&&C){if(e[0]==255&&e[1]==254)return gt(e.slice(2).toString("utf16le"));if(e[1]==254&&e[2]==255)return gt(u(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 i=0;i!=e.length;++i)n.push(String.fromCharCode(e[i]));return n.join("")}function Er(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]=Er(e[t]);return r}function yr(e,r){var t="";while(t.length3&&xr.indexOf(r)==-1)return i}else if(r.replace(/[ap]m?/,"").match(/[a-z]/))return i;if(s<0||s>8099||e.match(/[^-0-9:,\/\\]/))return i;return n}var Rr=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 i=t.split(a),s=[i[0]];for(var f=1;f\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g;var jr=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s*[\/\?]?>/gm,Xr=/<[^>]*>/g;var Yr=Gr.match(jr)?jr:Xr;var Kr=/<\w*:/,Zr=/<(\/?)\w+:/;function Jr(e,r,t){var a={};var n=0,i=0;for(;n!==e.length;++n)if((i=e.charCodeAt(n))===32||i===10||i===13)break;if(!r)a[0]=e.slice(0,n);if(n===e.length)return a;var s=e.match($r),f=0,o="",l=0,c="",h="",u=1;if(s)for(l=0;l!=s.length;++l){h=s[l];for(i=0;i!=h.length;++i)if(h.charCodeAt(i)===61)break;c=h.slice(0,i).trim();while(h.charCodeAt(i+1)==32)++i;u=(n=h.charCodeAt(i+1))==34||n==39?1:0;o=h.slice(i+1+u,h.length-u);for(f=0;f!=c.length;++f)if(c.charCodeAt(f)===58)break;if(f===c.length){if(c.indexOf("_")>0)c=c.slice(0,c.indexOf("_"));a[c]=o;if(!t)a[c.toLowerCase()]=o}else{var d=(f===5&&c.slice(0,5)==="xmlns"?"xmlns":"")+c.slice(f+1);if(a[d]&&c.slice(f-3,f)=="ext")continue;a[d]=o;if(!t)a[d.toLowerCase()]=o}}return a}function qr(e){return e.replace(Zr,"<$1")}var Qr={""":'"',"'":"'",">":">","<":"<","&":"&"};var et=or(Qr);var rt=function(){var e=/&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/gi,r=/_x([\da-fA-F]{4})_/gi;function t(a){var n=a+"",i=n.indexOf("-1?16:10))||e}).replace(r,function(e,r){return String.fromCharCode(parseInt(r,16))});var s=n.indexOf("]]>");return t(n.slice(0,i))+n.slice(i+9,s)+t(n.slice(s+3))}return function a(e,r){var a=t(e);return r?a.replace(/\r\n/g,"\n"):a}}();var tt=/[&<>'"]/g,at=/[\u0000-\u0008\u000b-\u001f\uFFFE-\uFFFF]/g;function nt(e){var r=e+"";return r.replace(tt,function(e){return et[e]}).replace(at,function(e){return"_x"+("000"+e.charCodeAt(0).toString(16)).slice(-4)+"_"})}function it(e){return nt(e).replace(/ /g,"_x0020_")}var st=/[\u0000-\u001f]/g;function ft(e){var r=e+"";return r.replace(tt,function(e){return et[e]}).replace(/\n/g,"
").replace(st,function(e){return""+("000"+e.charCodeAt(0).toString(16)).slice(-4)+";"})}function ot(e){var r=e+"";return r.replace(tt,function(e){return et[e]}).replace(st,function(e){return""+e.charCodeAt(0).toString(16).toUpperCase()+";"})}var lt=function(){var e=/(\d+);/g;function r(e,r){return String.fromCharCode(parseInt(r,10))}return function t(a){return a.replace(e,r)}}();function ct(e){return e.replace(/(\r\n|[\r\n])/g,"
")}function ht(e){switch(e){case 1:;case true:;case"1":;case"true":return true;case 0:;case false:;case"0":;case"false":return false;}return false}function ut(e){var r="",t=0,a=0,n=0,i=0,s=0,f=0;while(t191&&a<224){s=(a&31)<<6;s|=n&63;r+=String.fromCharCode(s);continue}i=e.charCodeAt(t++);if(a<240){r+=String.fromCharCode((a&15)<<12|(n&63)<<6|i&63);continue}s=e.charCodeAt(t++);f=((a&7)<<18|(n&63)<<12|(i&63)<<6|s&63)-65536;r+=String.fromCharCode(55296+(f>>>10&1023));r+=String.fromCharCode(56320+(f&1023))}return r}function dt(e){var r=S(2*e.length),t,a,n=1,i=0,s=0,f;for(a=0;a>>10&1023);t=56320+(t&1023)}if(s!==0){r[i++]=s&255;r[i++]=s>>>8;s=0}r[i++]=t%256;r[i++]=t>>>8}return r.slice(0,i).toString("ucs2")}function pt(e){return y(e,"binary").toString("utf8")}var vt="foo bar bazâð£";var mt=E&&(pt(vt)==ut(vt)&&pt||dt(vt)==ut(vt)&&dt)||ut;var gt=E?function(e){return y(e,"utf8").toString("binary")}:function(e){var r=[],t=0,a=0,n=0;while(t>6)));r.push(String.fromCharCode(128+(a&63)));break;case a>=55296&&a<57344:a-=55296;n=e.charCodeAt(t++)-56320+(a<<10);r.push(String.fromCharCode(240+(n>>18&7)));r.push(String.fromCharCode(144+(n>>12&63)));r.push(String.fromCharCode(128+(n>>6&63)));r.push(String.fromCharCode(128+(n&63)));break;default:r.push(String.fromCharCode(224+(a>>12)));r.push(String.fromCharCode(128+(a>>6&63)));r.push(String.fromCharCode(128+(a&63)));}}return r.join("")};var bt=function(){var e={};return function r(t,a){var n=t+"|"+(a||"");if(e[n])return e[n];return e[n]=new RegExp("<(?:\\w+:)?"+t+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)(?:\\w+:)?'+t+">",a||"")}}();var wt=function(){var e=[["nbsp"," "],["middot","·"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map(function(e){return[new RegExp("&"+e[0]+";","ig"),e[1]]});return function r(t){var a=t.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+/g,"\n").replace(/<[^>]*>/g,"");for(var n=0;n([\\s\\S]*?)(?:vt:)?"+t+">","g")}}();var At=/<\/?(?:vt:)?variant>/g,Tt=/<(?:vt:)([^>]*)>([\s\S]*);function Et(e,r){var t=Jr(e);var a=e.match(kt(t.baseType))||[];var n=[];if(a.length!=t.size){if(r.WTF)throw new Error("unexpected vector length "+a.length+" != "+t.size);return n}a.forEach(function(e){var r=e.replace(At,"").match(Tt);if(r)n.push({v:mt(r[2]),t:r[1]})});return n}var yt=/(^\s|\s$|\n)/;function Ct(e,r){return"<"+e+(r.match(yt)?' xml:space="preserve"':"")+">"+r+""+e+">"}function St(e){return sr(e).map(function(r){return" "+r+'="'+e[r]+'"'}).join("")}function _t(e,r,t){return"<"+e+(t!=null?St(t):"")+(r!=null?(r.match(yt)?' xml:space="preserve"':"")+">"+r+""+e:"/")+">"}function xt(e,r){try{return e.toISOString().replace(/\.\d*/,"")}catch(t){if(r)throw t}return""}function Ot(e,r){switch(typeof e){case"string":var t=_t("vt:lpwstr",nt(e));if(r)t=t.replace(/"/g,"_x0022_");return t;case"number":return _t((e|0)==e?"vt:i4":"vt:r8",nt(String(e)));case"boolean":return _t("vt:bool",e?"true":"false");}if(e instanceof Date)return _t("vt:filetime",xt(e));throw new Error("Unable to serialize "+e)}function Rt(e){if(E&&Buffer.isBuffer(e))return e.toString("utf8");if(typeof e==="string")return e;if(typeof Uint8Array!=="undefined"&&e instanceof Uint8Array)return mt(R(I(e)));throw new Error("Bad input format: expected Buffer or string")}var Nt=/<(\/?)([^\s?>:\/]+)(?:[\s?:\/](?:[^>=]|="[^"]*?")*)?>/gm;var It={CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",CT:"http://schemas.openxmlformats.org/package/2006/content-types",RELS:"http://schemas.openxmlformats.org/package/2006/relationships",TCMNT:"http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",mx:"http://schemas.microsoft.com/office/mac/excel/2008/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",sjs:"http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema"};var Ft=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"];var Dt={o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel",ss:"urn:schemas-microsoft-com:office:spreadsheet",dt:"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882",mv:"http://macVmlSchemaUri",v:"urn:schemas-microsoft-com:vml",html:"http://www.w3.org/TR/REC-html40"};function Pt(e,r){var t=1-2*(e[r+7]>>>7);var a=((e[r+7]&127)<<4)+(e[r+6]>>>4&15);var n=e[r+6]&15;for(var i=5;i>=0;--i)n=n*256+e[r+i];if(a==2047)return n==0?t*Infinity:NaN;if(a==0)a=-1022;else{a-=1023;n+=Math.pow(2,52)}return t*Math.pow(2,a-52)*n}function Lt(e,r,t){var a=(r<0||1/r==-Infinity?1:0)<<7,n=0,i=0;var s=a?-r:r;if(!isFinite(s)){n=2047;i=isNaN(r)?26985:0}else if(s==0)n=i=0;else{n=Math.floor(Math.log(s)/Math.LN2);i=s*Math.pow(2,52-n);if(n<=-1023&&(!isFinite(i)||i>4|a}var Mt=function(e){var r=[],t=10240;for(var a=0;a0&&Buffer.isBuffer(e[0][0])?Buffer.concat(e[0].map(function(e){return Buffer.isBuffer(e)?e:y(e)})):Mt(e)}:Mt;var Bt=function(e,r,t){var a=[];for(var n=r;n0?Gt(e,r+4,r+4+t-1):""};var jt=$t;var Xt=function(e,r){var t=oa(e,r);return t>0?Gt(e,r+4,r+4+t-1):""};var Yt=Xt;var Kt=function(e,r){var t=2*oa(e,r);return t>0?Gt(e,r+4,r+4+t-1):""};var Zt=Kt;var Jt=function Fk(e,r){var t=oa(e,r);return t>0?Wt(e,r+4,r+4+t):""};var qt=Jt;var Qt=function(e,r){var t=oa(e,r);return t>0?Gt(e,r+4,r+4+t):""};var ea=Qt;var ra=function(e,r){return Pt(e,r)};var ta=ra;var aa=function Dk(e){return Array.isArray(e)||typeof Uint8Array!=="undefined"&&e instanceof Uint8Array};if(E){jt=function Pk(e,r){if(!Buffer.isBuffer(e))return $t(e,r);var t=e.readUInt32LE(r);return t>0?e.toString("utf8",r+4,r+4+t-1):""};Yt=function Lk(e,r){if(!Buffer.isBuffer(e))return Xt(e,r);var t=e.readUInt32LE(r);return t>0?e.toString("utf8",r+4,r+4+t-1):""};Zt=function Mk(e,r){if(!Buffer.isBuffer(e)||!C)return Kt(e,r);var t=2*e.readUInt32LE(r);return e.toString("utf16le",r+4,r+4+t-1)};qt=function Uk(e,r){if(!Buffer.isBuffer(e)||!C)return Jt(e,r);var t=e.readUInt32LE(r);return e.toString("utf16le",r+4,r+4+t)};ea=function Bk(e,r){if(!Buffer.isBuffer(e))return Qt(e,r);var t=e.readUInt32LE(r);return e.toString("utf8",r+4,r+4+t)};ta=function Wk(e,r){if(Buffer.isBuffer(e))return e.readDoubleLE(r);return ra(e,r)};aa=function Hk(e){return Buffer.isBuffer(e)||Array.isArray(e)||typeof Uint8Array!=="undefined"&&e instanceof Uint8Array}}function na(){Wt=function(e,r,t){return a.utils.decode(1200,e.slice(r,t)).replace(P,"")};Gt=function(e,r,t){return a.utils.decode(65001,e.slice(r,t))};jt=function(e,r){var n=oa(e,r);return n>0?a.utils.decode(t,e.slice(r+4,r+4+n-1)):""};Yt=function(e,t){var n=oa(e,t);return n>0?a.utils.decode(r,e.slice(t+4,t+4+n-1)):""};Zt=function(e,r){var t=2*oa(e,r);return t>0?a.utils.decode(1200,e.slice(r+4,r+4+t-1)):""};qt=function(e,r){var t=oa(e,r);return t>0?a.utils.decode(1200,e.slice(r+4,r+4+t)):""};ea=function(e,r){var t=oa(e,r);return t>0?a.utils.decode(65001,e.slice(r+4,r+4+t)):""}}if(typeof a!=="undefined")na();var ia=function(e,r){return e[r]};var sa=function(e,r){return e[r+1]*(1<<8)+e[r]};var fa=function(e,r){var t=e[r+1]*(1<<8)+e[r];return t<32768?t:(65535-t+1)*-1};var oa=function(e,r){return e[r+3]*(1<<24)+(e[r+2]<<16)+(e[r+1]<<8)+e[r]};var la=function(e,r){return e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]};var ca=function(e,r){return e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]};function ha(e,t){var n="",i,s,f=[],o,l,c,h;switch(t){case"dbcs":h=this.l;if(E&&Buffer.isBuffer(this)&&C)n=this.slice(this.l,this.l+2*e).toString("utf16le");else for(c=0;c0?la:ca)(this,this.l);this.l+=4;return i}else{s=oa(this,this.l);this.l+=4}return s;case 8:;case-8:if(t==="f"){if(e==8)s=ta(this,this.l);else s=ta([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0);this.l+=8;return s}else e=8;case 16:n=zt(this,this.l,e);break;};}this.l+=e;return n}var ua=function(e,r,t){e[t]=r&255;e[t+1]=r>>>8&255;e[t+2]=r>>>16&255;e[t+3]=r>>>24&255};var da=function(e,r,t){e[t]=r&255;e[t+1]=r>>8&255;e[t+2]=r>>16&255;e[t+3]=r>>24&255};var pa=function(e,r,t){e[t]=r&255;e[t+1]=r>>>8&255};function va(e,n,i){var s=0,f=0;if(i==="dbcs"){for(f=0;f!=n.length;++f)pa(this,n.charCodeAt(f),this.l+2*f);s=2*n.length}else if(i==="sbcs"||i=="cpstr"){if(typeof a!=="undefined"&&t==874){for(f=0;f!=n.length;++f){var o=a.utils.encode(t,n.charAt(f));this[this.l+f]=o[0]}s=n.length}else if(typeof a!=="undefined"&&i=="cpstr"){o=a.utils.encode(r,n);if(o.length==n.length)for(f=0;f>8}while(this.l>>=8;this[this.l+1]=n&255;break;case 3:s=3;this[this.l]=n&255;n>>>=8;this[this.l+1]=n&255;n>>>=8;this[this.l+2]=n&255;break;case 4:s=4;ua(this,n,this.l);break;case 8:s=8;if(i==="f"){Lt(this,n,this.l);break};case 16:break;case-4:s=4;da(this,n,this.l);break;}this.l+=s;
+return this}function ma(e,r){var t=zt(this,this.l,e.length>>1);if(t!==e)throw new Error(r+"Expected "+e+" saw "+t);this.l+=e.length>>1}function ga(e,r){e.l=r;e._R=ha;e.chk=ma;e._W=va}function ba(e,r){e.l+=r}function wa(e){var r=S(e);ga(r,0);return r}function ka(e,r,t){if(!e)return;var a,n,i;ga(e,e.l||0);var s=e.length,f=0,o=0;while(e.la.l){a=a.slice(0,a.l);a.l=a.length}if(a.length>0)e.push(a)}a=null};var i=function c(e){if(a&&e=128?1:0)+1;if(a>=128)++i;if(a>=16384)++i;if(a>=2097152)++i;var s=e.next(i);if(n<=127)s._W(1,n);else{s._W(1,(n&127)+128);s._W(1,n>>7)}for(var f=0;f!=4;++f){if(a>=128){s._W(1,(a&127)+128);a>>=7}else{s._W(1,a);break}}if(a>0&&aa(t))e.push(t)}function Ea(e,r,t){var a=Er(e);if(r.s){if(a.cRel)a.c+=r.s.c;if(a.rRel)a.r+=r.s.r}else{if(a.cRel)a.c+=r.c;if(a.rRel)a.r+=r.r}if(!t||t.biff<12){while(a.c>=256)a.c-=256;while(a.r>=65536)a.r-=65536}return a}function ya(e,r,t){var a=Er(e);a.s=Ea(a.s,r.s,t);a.e=Ea(a.e,r.s,t);return a}function Ca(e,r){if(e.cRel&&e.c<0){e=Er(e);while(e.c<0)e.c+=r>8?16384:256}if(e.rRel&&e.r<0){e=Er(e);while(e.r<0)e.r+=r>8?1048576:r>5?65536:16384}var t=Ma(e);if(!e.cRel&&e.cRel!=null)t=Fa(t);if(!e.rRel&&e.rRel!=null)t=Oa(t);return t}function Sa(e,r){if(e.s.r==0&&!e.s.rRel){if(e.e.r==(r.biff>=12?1048575:r.biff>=8?65536:16384)&&!e.e.rRel){return(e.s.cRel?"":"$")+Ia(e.s.c)+":"+(e.e.cRel?"":"$")+Ia(e.e.c)}}if(e.s.c==0&&!e.s.cRel){if(e.e.c==(r.biff>=12?16383:255)&&!e.e.cRel){return(e.s.rRel?"":"$")+xa(e.s.r)+":"+(e.e.rRel?"":"$")+xa(e.e.r)}}return Ca(e.s,r.biff)+":"+Ca(e.e,r.biff)}if(typeof cptable!=="undefined")m(cptable);else if(typeof module!=="undefined"&&typeof require!=="undefined"){m(undefined)}function _a(e){return parseInt(Ra(e),10)-1}function xa(e){return""+(e+1)}function Oa(e){return e.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function Ra(e){return e.replace(/\$(\d+)$/,"$1")}function Na(e){var r=Da(e),t=0,a=0;for(;a!==r.length;++a)t=26*t+r.charCodeAt(a)-64;return t-1}function Ia(e){if(e<0)throw new Error("invalid column "+e);var r="";for(++e;e;e=Math.floor((e-1)/26))r=String.fromCharCode((e-1)%26+65)+r;return r}function Fa(e){return e.replace(/^([A-Z])/,"$$$1")}function Da(e){return e.replace(/^\$([A-Z])/,"$1")}function Pa(e){return e.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")}function La(e){var r=0,t=0;for(var a=0;a=48&&n<=57)r=10*r+(n-48);else if(n>=65&&n<=90)t=26*t+(n-64)}return{c:t-1,r:r-1}}function Ma(e){var r=e.c+1;var t="";for(;r;r=(r-1)/26|0)t=String.fromCharCode((r-1)%26+65)+t;return t+(e.r+1)}function Ua(e){var r=e.indexOf(":");if(r==-1)return{s:La(e),e:La(e)};return{s:La(e.slice(0,r)),e:La(e.slice(r+1))}}function Ba(e,r){if(typeof r==="undefined"||typeof r==="number"){return Ba(e.s,e.e)}if(typeof e!=="string")e=Ma(e);if(typeof r!=="string")r=Ma(r);return e==r?e:e+":"+r}function Wa(e){var r=Ua(e);return"$"+Ia(r.s.c)+"$"+xa(r.s.r)+":$"+Ia(r.e.c)+"$"+xa(r.e.r)}function Ha(e,r){if(!e&&!(r&&r.biff<=5&&r.biff>=2))throw new Error("empty sheet name");if(/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(e))return"'"+e.replace(/'/g,"''")+"'";return e}function za(e){var r={s:{c:0,r:0},e:{c:0,r:0}};var t=0,a=0,n=0;var i=e.length;for(t=0;a26)break;t=26*t+n}r.s.c=--t;for(t=0;a9)break;t=10*t+n}r.s.r=--t;if(a===i||n!=10){r.e.c=r.s.c;r.e.r=r.s.r;return r}++a;for(t=0;a!=i;++a){if((n=e.charCodeAt(a)-64)<1||n>26)break;t=26*t+n}r.e.c=--t;for(t=0;a!=i;++a){if((n=e.charCodeAt(a)-48)<0||n>9)break;t=10*t+n}r.e.r=--t;return r}function Va(e,r){var t=e.t=="d"&&r instanceof Date;if(e.z!=null)try{return e.w=ze(e.z,t?ur(r):r)}catch(a){}try{return e.w=ze((e.XF||{}).numFmtId||(t?14:0),t?ur(r):r)}catch(a){return""+r}}function Ga(e,r,t){if(e==null||e.t==null||e.t=="z")return"";if(e.w!==undefined)return e.w;if(e.t=="d"&&!e.z&&t&&t.dateNF)e.z=t.dateNF;if(e.t=="e")return Jn[e.v]||e.v;if(r==undefined)return Va(e,e.v);return Va(e,r)}function $a(e,r){var t=r&&r.sheet?r.sheet:"Sheet1";var a={};a[t]=e;return{SheetNames:[t],Sheets:a}}function ja(e,r,t){var a=t||{};var n=e?Array.isArray(e):a.dense;if(g!=null&&n==null)n=g;var i=e||(n?[]:{});var s=0,f=0;if(i&&a.origin!=null){if(typeof a.origin=="number")s=a.origin;else{var o=typeof a.origin=="string"?La(a.origin):a.origin;s=o.r;f=o.c}if(!i["!ref"])i["!ref"]="A1:A1"}var l={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(i["!ref"]){var c=za(i["!ref"]);l.s.c=c.s.c;l.s.r=c.s.r;l.e.c=Math.max(l.e.c,c.e.c);l.e.r=Math.max(l.e.r,c.e.r);if(s==-1)l.e.r=s=c.e.r+1}for(var h=0;h!=r.length;++h){if(!r[h])continue;if(!Array.isArray(r[h]))throw new Error("aoa_to_sheet expects an array of arrays");for(var u=0;u!=r[h].length;++u){if(typeof r[h][u]==="undefined")continue;var d={v:r[h][u]};var p=s+h,v=f+u;if(l.s.r>p)l.s.r=p;if(l.s.c>v)l.s.c=v;if(l.e.r0)r._W(0,e,"dbcs");return t?r.slice(0,r.l):r}function qa(e){return{ich:e._R(2),ifnt:e._R(2)}}function Qa(e,r){if(!r)r=wa(4);r._W(2,e.ich||0);r._W(2,e.ifnt||0);return r}function en(e,r){var t=e.l;var a=e._R(1);var n=Za(e);var i=[];var s={t:n,h:n};if((a&1)!==0){var f=e._R(4);for(var o=0;o!=f;++o)i.push(qa(e));s.r=i}else s.r=[{ich:0,ifnt:0}];e.l=t+r;return s}function rn(e,r){var t=false;if(r==null){t=true;r=wa(15+4*e.t.length)}r._W(1,0);Ja(e.t,r);return t?r.slice(0,r.l):r}var tn=en;function an(e,r){var t=false;if(r==null){t=true;r=wa(23+4*e.t.length)}r._W(1,1);Ja(e.t,r);r._W(4,1);Qa({ich:0,ifnt:0},r);return t?r.slice(0,r.l):r}function nn(e){var r=e._R(4);var t=e._R(2);t+=e._R(1)<<16;e.l++;return{c:r,iStyleRef:t}}function sn(e,r){if(r==null)r=wa(8);r._W(-4,e.c);r._W(3,e.iStyleRef||e.s);r._W(1,0);return r}function fn(e){var r=e._R(2);r+=e._R(1)<<16;e.l++;return{c:-1,iStyleRef:r}}function on(e,r){if(r==null)r=wa(4);r._W(3,e.iStyleRef||e.s);r._W(1,0);return r}var ln=Za;var cn=Ja;function hn(e){var r=e._R(4);return r===0||r===4294967295?"":e._R(r,"dbcs")}function un(e,r){var t=false;if(r==null){t=true;r=wa(127)}r._W(4,e.length>0?e.length:4294967295);if(e.length>0)r._W(0,e,"dbcs");return t?r.slice(0,r.l):r}var dn=Za;var pn=hn;var vn=un;function mn(e){var r=e.slice(e.l,e.l+4);var t=r[0]&1,a=r[0]&2;e.l+=4;var n=a===0?ta([0,0,0,0,r[0]&252,r[1],r[2],r[3]],0):la(r,0)>>2;return t?n/100:n}function gn(e,r){if(r==null)r=wa(4);var t=0,a=0,n=e*100;if(e==(e|0)&&e>=-(1<<29)&&e<1<<29){a=1}else if(n==(n|0)&&n>=-(1<<29)&&n<1<<29){a=1;t=1}if(a)r._W(-4,((t?n:e)<<2)+(t+2));else throw new Error("unsupported RkNumber "+e)}function bn(e){var r={s:{},e:{}};r.s.r=e._R(4);r.e.r=e._R(4);r.s.c=e._R(4);r.e.c=e._R(4);return r}function wn(e,r){if(!r)r=wa(16);r._W(4,e.s.r);r._W(4,e.e.r);r._W(4,e.s.c);r._W(4,e.e.c);return r}var kn=bn;var An=wn;function Tn(e){if(e.length-e.l<8)throw"XLS Xnum Buffer underflow";return e._R(8,"f")}function En(e,r){return(r||wa(8))._W(8,e,"f")}function yn(e){var r={};var t=e._R(1);var a=t>>>1;var n=e._R(1);var i=e._R(2,"i");var s=e._R(1);var f=e._R(1);var o=e._R(1);e.l++;switch(a){case 0:r.auto=1;break;case 1:r.index=n;var l=Zn[n];if(l)r.rgb=xl(l);break;case 2:r.rgb=xl([s,f,o]);break;case 3:r.theme=n;break;}if(i!=0)r.tint=i>0?i/32767:i/32768;return r}function Cn(e,r){if(!r)r=wa(8);if(!e||e.auto){r._W(4,0);r._W(4,0);return r}if(e.index!=null){r._W(1,2);r._W(1,e.index)}else if(e.theme!=null){r._W(1,6);r._W(1,e.theme)}else{r._W(1,5);r._W(1,0)}var t=e.tint||0;if(t>0)t*=32767;else if(t<0)t*=32768;r._W(2,t);if(!e.rgb||e.theme!=null){r._W(2,0);r._W(1,0);r._W(1,0)}else{var a=e.rgb||"FFFFFF";if(typeof a=="number")a=("000000"+a.toString(16)).slice(-6);r._W(1,parseInt(a.slice(0,2),16));r._W(1,parseInt(a.slice(2,4),16));r._W(1,parseInt(a.slice(4,6),16));r._W(1,255)}return r}function Sn(e){var r=e._R(1);e.l++;var t={fBold:r&1,fItalic:r&2,fUnderline:r&4,fStrikeout:r&8,fOutline:r&16,fShadow:r&32,fCondense:r&64,fExtend:r&128};return t}function _n(e,r){if(!r)r=wa(2);var t=(e.italic?2:0)|(e.strike?8:0)|(e.outline?16:0)|(e.shadow?32:0)|(e.condense?64:0)|(e.extend?128:0);r._W(1,t);r._W(1,0);return r}function xn(e,r){var t={2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"};var a=e._R(4);switch(a){case 0:return"";case 4294967295:;case 4294967294:return t[e._R(4)]||"";}if(a>400)throw new Error("Unsupported Clipboard: "+a.toString(16));e.l-=4;return e._R(0,r==1?"lpstr":"lpwstr")}function On(e){return xn(e,1)}function Rn(e){return xn(e,2)}var Nn=2;var In=3;var Fn=11;var Dn=12;var Pn=19;var Ln=64;var Mn=65;var Un=71;var Bn=4108;var Wn=4126;var Hn=80;var zn=81;var Vn=[Hn,zn];var Gn={1:{n:"CodePage",t:Nn},2:{n:"Category",t:Hn},3:{n:"PresentationFormat",t:Hn},4:{n:"ByteCount",t:In},5:{n:"LineCount",t:In},6:{n:"ParagraphCount",t:In},7:{n:"SlideCount",t:In},8:{n:"NoteCount",t:In},9:{n:"HiddenCount",t:In},10:{n:"MultimediaClipCount",t:In},11:{n:"ScaleCrop",t:Fn},12:{n:"HeadingPairs",t:Bn},13:{n:"TitlesOfParts",t:Wn},14:{n:"Manager",t:Hn},15:{n:"Company",t:Hn},16:{n:"LinksUpToDate",t:Fn},17:{n:"CharacterCount",t:In},19:{n:"SharedDoc",t:Fn},22:{n:"HyperlinksChanged",t:Fn},23:{n:"AppVersion",t:In,p:"version"},24:{n:"DigSig",t:Mn},26:{n:"ContentType",t:Hn},27:{n:"ContentStatus",t:Hn},28:{n:"Language",t:Hn},29:{n:"Version",t:Hn},255:{},2147483648:{n:"Locale",t:Pn},2147483651:{n:"Behavior",t:Pn},1919054434:{}};var $n={1:{n:"CodePage",t:Nn},2:{n:"Title",t:Hn},3:{n:"Subject",t:Hn},4:{n:"Author",t:Hn},5:{n:"Keywords",t:Hn},6:{n:"Comments",t:Hn},7:{n:"Template",t:Hn},8:{n:"LastAuthor",t:Hn},9:{n:"RevNumber",t:Hn},10:{n:"EditTime",t:Ln},11:{n:"LastPrinted",t:Ln},12:{n:"CreatedDate",t:Ln},13:{n:"ModifiedDate",t:Ln},14:{n:"PageCount",t:In},15:{n:"WordCount",t:In},16:{n:"CharCount",t:In},17:{n:"Thumbnail",t:Un},18:{n:"Application",t:Hn},19:{n:"DocSecurity",t:In},255:{},2147483648:{n:"Locale",t:Pn},2147483651:{n:"Behavior",t:Pn},1919054434:{}};var jn={1:"US",2:"CA",3:"",7:"RU",20:"EG",30:"GR",31:"NL",32:"BE",33:"FR",34:"ES",36:"HU",39:"IT",41:"CH",43:"AT",44:"GB",45:"DK",46:"SE",47:"NO",48:"PL",49:"DE",52:"MX",55:"BR",61:"AU",64:"NZ",66:"TH",81:"JP",82:"KR",84:"VN",86:"CN",90:"TR",105:"JS",213:"DZ",216:"MA",218:"LY",351:"PT",354:"IS",358:"FI",420:"CZ",886:"TW",961:"LB",962:"JO",963:"SY",964:"IQ",965:"KW",966:"SA",971:"AE",972:"IL",974:"QA",981:"IR",65535:"US"};var Xn=[null,"solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"];function Yn(e){return e.map(function(e){return[e>>16&255,e>>8&255,e&255]})}var Kn=Yn([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,0,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);var Zn=Er(Kn);var Jn={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"};var qn={"#NULL!":0,"#DIV/0!":7,"#VALUE!":15,"#REF!":23,"#NAME?":29,"#NUM!":36,"#N/A":42,"#GETTING_DATA":43,"#WTF?":255};var Qn=["_xlnm.Consolidate_Area","_xlnm.Auto_Open","_xlnm.Auto_Close","_xlnm.Extract","_xlnm.Database","_xlnm.Criteria","_xlnm.Print_Area","_xlnm.Print_Titles","_xlnm.Recorder","_xlnm.Data_Form","_xlnm.Auto_Activate","_xlnm.Auto_Deactivate","_xlnm.Sheet_Title","_xlnm._FilterDatabase"];var ei={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","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-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"};var ri={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"},metadata:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",xlsb:"application/vnd.ms-excel.sheetMetadata"},styles:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",xlsb:"application/vnd.ms-excel.styles"}};function ti(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""}}function ai(e){var r=ti();if(!e||!e.match)return r;var t={};(e.match(Yr)||[]).forEach(function(e){var a=Jr(e);switch(a[0].replace(Kr,"<")){case"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}function ni(e,r,t){var a=cr(ei);var n=[],i;if(!t){n[n.length]=Gr;n[n.length]=_t("Types",null,{xmlns:It.CT,"xmlns:xsd":It.xsd,"xmlns:xsi":It.xsi});n=n.concat([["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","application/vnd.openxmlformats-package.relationships+xml"]].map(function(e){return _t("Default",null,{Extension:e[0],ContentType:e[1]})}))}var s=function(t){if(e[t]&&e[t].length>0){i=e[t][0];n[n.length]=_t("Override",null,{PartName:(i[0]=="/"?"":"/")+i,ContentType:ri[t][r.bookType]||ri[t]["xlsx"]})}};var f=function(t){(e[t]||[]).forEach(function(e){n[n.length]=_t("Override",null,{PartName:(e[0]=="/"?"":"/")+e,ContentType:ri[t][r.bookType]||ri[t]["xlsx"]})})};var o=function(r){(e[r]||[]).forEach(function(e){n[n.length]=_t("Override",null,{PartName:(e[0]=="/"?"":"/")+e,ContentType:a[r][0]})})};s("workbooks");f("sheets");f("charts");o("themes");["strs","styles"].forEach(s);["coreprops","extprops","custprops"].forEach(o);o("vba");o("comments");o("threadedcomments");o("drawings");f("metadata");o("people");if(!t&&n.length>2){n[n.length]="";n[1]=n[1].replace("/>",">")}return n.join("")}var ii={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:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",CMNT:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",SST:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",STY:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",THEME:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",CHART:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",CHARTEX:"http://schemas.microsoft.com/office/2014/relationships/chartEx",CS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet",MS:"http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",IMG:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",DRAW:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",XLMETA:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",TCMNT:"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",PEOPLE:"http://schemas.microsoft.com/office/2017/10/relationships/person",CONN:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/connections",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function si(e){var r=e.lastIndexOf("/");return e.slice(0,r+1)+"_rels/"+e.slice(r+1)+".rels"}function fi(e,r){var t={"!id":{}};if(!e)return t;if(r.charAt(0)!=="/"){r="/"+r}var a={};(e.match(Yr)||[]).forEach(function(e){var n=Jr(e);if(n[0]==="2){r[r.length]="";r[1]=r[1].replace("/>",">")}return r.join("")}function li(e,r,t,a,n,i){if(!n)n={};if(!e["!id"])e["!id"]={};if(!e["!idx"])e["!idx"]=1;if(r<0)for(r=e["!idx"];e["!id"]["rId"+r];++r){}e["!idx"]=r+1;n.Id="rId"+r;n.Type=a;n.Target=t;if(i)n.TargetMode=i;else if([ii.HLINK,ii.XPATH,ii.XMISS].indexOf(n.Type)>-1)n.TargetMode="External";if(e["!id"][n.Id])throw new Error("Cannot rewrite rId "+r);e["!id"][n.Id]=n;e[("/"+n.Target).replace("//","/")]=n;return r}var ci="application/vnd.oasis.opendocument.spreadsheet";function hi(e,r){var t=Rt(e);var a;var n;while(a=Nt.exec(t))switch(a[3]){case"manifest":break;case"file-entry":n=Jr(a[0],false);if(n.path=="/"&&n.type!==ci)throw new Error("This OpenDocument is not a spreadsheet");break;case"encryption-data":;case"algorithm":;case"start-key-generation":;case"key-derivation":throw new Error("Unsupported ODS Encryption");default:if(r&&r.WTF)throw a;}}function ui(e){var r=[Gr];r.push('\n');r.push(' \n');for(var t=0;t\n');r.push("");return r.join("")}function di(e,r,t){return[' \n',' \n'," \n"].join("")}function pi(e,r){return[' \n',' \n'," \n"].join("")}function vi(e){var r=[Gr];r.push('\n');for(var t=0;t!=e.length;++t){r.push(di(e[t][0],e[t][1]));r.push(pi("",e[t][0]))}r.push(di("","Document","pkg"));r.push("");return r.join("")}function mi(){return'Sheet'+"JS "+e.version+""}var gi=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]];var bi=function(){var e=new Array(gi.length);for(var r=0;r]*>([\\s\\S]*?)"+a+">")}return e}();function wi(e){var r={};e=mt(e);for(var t=0;t0)r[a[1]]=rt(n[1]);if(a[2]==="date"&&r[a[1]])r[a[1]]=Ar(r[a[1]])}return r}function ki(e,r,t,a,n){if(n[e]!=null||r==null||r==="")return;n[e]=r;r=nt(r);a[a.length]=t?_t(e,r,t):Ct(e,r)}function Ai(e,r){var t=r||{};var a=[Gr,_t("cp:coreProperties",null,{"xmlns:cp":It.CORE_PROPS,"xmlns:dc":It.dc,"xmlns:dcterms":It.dcterms,"xmlns:dcmitype":It.dcmitype,"xmlns:xsi":It.xsi})],n={};if(!e&&!t.Props)return a.join("");if(e){if(e.CreatedDate!=null)ki("dcterms:created",typeof e.CreatedDate==="string"?e.CreatedDate:xt(e.CreatedDate,t.WTF),{"xsi:type":"dcterms:W3CDTF"},a,n);if(e.ModifiedDate!=null)ki("dcterms:modified",typeof e.ModifiedDate==="string"?e.ModifiedDate:xt(e.ModifiedDate,t.WTF),{"xsi:type":"dcterms:W3CDTF"},a,n)}for(var i=0;i!=gi.length;++i){var s=gi[i];var f=t.Props&&t.Props[s[1]]!=null?t.Props[s[1]]:e?e[s[1]]:null;if(f===true)f="1";else if(f===false)f="0";else if(typeof f=="number")f=String(f);if(f!=null)ki(s[0],f,null,a,n)}if(a.length>2){a[a.length]="";a[1]=a[1].replace("/>",">")}return a.join("")}var Ti=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]];var Ei=["Worksheets","SheetNames","NamedRanges","DefinedNames","Chartsheets","ChartNames"];function yi(e,r,t,a){var n=[];if(typeof e=="string")n=Et(e,a);else for(var i=0;i0)for(var l=0;l!==n.length;l+=2){o=+n[l+1].v;switch(n[l].v){case"Worksheets":;case"工作表":;case"Листы":;case"أوراق العمل":;case"ワークシート":;case"גליונות עבודה":;case"Arbeitsblätter":;case"Çalışma Sayfaları":;case"Feuilles de calcul":;case"Fogli di lavoro":;case"Folhas de cálculo":;case"Planilhas":;case"Regneark":;case"Hojas de cálculo":;case"Werkbladen":t.Worksheets=o;t.SheetNames=s.slice(f,f+o);break;case"Named Ranges":;case"Rangos con nombre":;case"名前付き一覧":;case"Benannte Bereiche":;case"Navngivne områder":
+t.NamedRanges=o;t.DefinedNames=s.slice(f,f+o);break;case"Charts":;case"Diagramme":t.Chartsheets=o;t.ChartNames=s.slice(f,f+o);break;}f+=o}}function Ci(e,r,t){var a={};if(!r)r={};e=mt(e);Ti.forEach(function(t){var n=(e.match(bt(t[0]))||[])[1];switch(t[2]){case"string":if(n)r[t[1]]=rt(n);break;case"bool":r[t[1]]=n==="true";break;case"raw":var i=e.match(new RegExp("<"+t[0]+"[^>]*>([\\s\\S]*?)"+t[0]+">"));if(i&&i.length>0)a[t[1]]=i[1];break;}});if(a.HeadingPairs&&a.TitlesOfParts)yi(a.HeadingPairs,a.TitlesOfParts,r,t);return r}function Si(e){var r=[],t=_t;if(!e)e={};e.Application="SheetJS";r[r.length]=Gr;r[r.length]=_t("Properties",null,{xmlns:It.EXT_PROPS,"xmlns:vt":It.vt});Ti.forEach(function(a){if(e[a[1]]===undefined)return;var n;switch(a[2]){case"string":n=nt(String(e[a[1]]));break;case"bool":n=e[a[1]]?"true":"false";break;}if(n!==undefined)r[r.length]=t(a[0],n)});r[r.length]=t("HeadingPairs",t("vt:vector",t("vt:variant","Worksheets")+t("vt:variant",t("vt:i4",String(e.Worksheets))),{size:2,baseType:"variant"}));r[r.length]=t("TitlesOfParts",t("vt:vector",e.SheetNames.map(function(e){return""+nt(e)+""}).join(""),{size:e.Worksheets,baseType:"lpstr"}));if(r.length>2){r[r.length]="";r[1]=r[1].replace("/>",">")}return r.join("")}var _i=/<[^>]+>[^<]*/g;function xi(e,r){var t={},a="";var n=e.match(_i);if(n)for(var i=0;i!=n.length;++i){var s=n[i],f=Jr(s);switch(qr(f[0])){case"":a=null;break;default:if(s.indexOf("");var l=o[0].slice(4),c=o[1];switch(l){case"lpstr":;case"bstr":;case"lpwstr":t[a]=rt(c);break;case"bool":t[a]=ht(c);break;case"i1":;case"i2":;case"i4":;case"i8":;case"int":;case"uint":t[a]=parseInt(c,10);break;case"r4":;case"r8":;case"decimal":t[a]=parseFloat(c);break;case"filetime":;case"date":t[a]=Ar(c);break;case"cy":;case"error":t[a]=rt(c);break;default:if(l.slice(-1)=="/")break;if(r.WTF&&typeof console!=="undefined")console.warn("Unexpected",s,l,o);}}else if(s.slice(0,2)===""){}else if(r.WTF)throw new Error(s);}}return t}function Oi(e){var r=[Gr,_t("Properties",null,{xmlns:It.CUST_PROPS,"xmlns:vt":It.vt})];if(!e)return r.join("");var t=1;sr(e).forEach(function a(n){++t;r[r.length]=_t("property",Ot(e[n],true),{fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:t,name:nt(n)})});if(r.length>2){r[r.length]="";r[1]=r[1].replace("/>",">")}return r.join("")}var Ri={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"};var Ni;function Ii(e,r,t){if(!Ni)Ni=or(Ri);r=Ni[r]||r;e[r]=t}function Fi(e,r){var t=[];sr(Ri).map(function(e){for(var r=0;r'+n.join("")+""+a+">"}function Pi(e){var r=e._R(4),t=e._R(4);return new Date((t/1e7*Math.pow(2,32)+r/1e7-11644473600)*1e3).toISOString().replace(/\.000/,"")}function Li(e){var r=typeof e=="string"?new Date(Date.parse(e)):e;var t=r.getTime()/1e3+11644473600;var a=t%Math.pow(2,32),n=(t-a)/Math.pow(2,32);a*=1e7;n*=1e7;var i=a/Math.pow(2,32)|0;if(i>0){a=a%Math.pow(2,32);n+=i}var s=wa(8);s._W(4,a);s._W(4,n);return s}function Mi(e,r,t){var a=e.l;var n=e._R(0,"lpstr-cp");if(t)while(e.l-a&3)++e.l;return n}function Ui(e,r,t){var a=e._R(0,"lpwstr");if(t)e.l+=4-(a.length+1&3)&3;return a}function Bi(e,r,t){if(r===31)return Ui(e);return Mi(e,r,t)}function Wi(e,r,t){return Bi(e,r,t===false?0:4)}function Hi(e,r){if(!r)throw new Error("VtUnalignedString must have positive length");return Bi(e,r,0)}function zi(e){var r=e._R(4);var t=[];for(var a=0;a!=r;++a){var n=e.l;t[a]=e._R(0,"lpwstr").replace(P,"");if(e.l-n&2)e.l+=2}return t}function Vi(e){var r=e._R(4);var t=[];for(var a=0;a!=r;++a)t[a]=e._R(0,"lpstr-cp").replace(P,"");return t}function Gi(e){var r=e.l;var t=Ki(e,zn);if(e[e.l]==0&&e[e.l+1]==0&&e.l-r&2)e.l+=2;var a=Ki(e,In);return[t,a]}function $i(e){var r=e._R(4);var t=[];for(var a=0;a>2+1<<2;return a}function Xi(e){var r=e._R(4);var t=e.slice(e.l,e.l+r);e.l+=r;if((r&3)>0)e.l+=4-(r&3)&3;return t}function Yi(e){var r={};r.Size=e._R(4);e.l+=r.Size+3-(r.Size-1)%4;return r}function Ki(e,r,t){var a=e._R(2),n,i=t||{};e.l+=2;if(r!==Dn)if(a!==r&&Vn.indexOf(r)===-1&&!((r&65534)==4126&&(a&65534)==4126))throw new Error("Expected type "+r+" saw "+a);switch(r===Dn?a:r){case 2:n=e._R(2,"i");if(!i.raw)e.l+=2;return n;case 3:n=e._R(4,"i");return n;case 11:return e._R(4)!==0;case 19:n=e._R(4);return n;case 30:return Mi(e,a,4).replace(P,"");case 31:return Ui(e);case 64:return Pi(e);case 65:return Xi(e);case 71:return Yi(e);case 80:return Wi(e,a,!i.raw).replace(P,"");case 81:return Hi(e,a).replace(P,"");case 4108:return $i(e);case 4126:;case 4127:return a==4127?zi(e):Vi(e);default:throw new Error("TypedPropertyValue unrecognized type "+r+" "+a);}}function Zi(e,r){var t=wa(4),a=wa(4);t._W(4,e==80?31:e);switch(e){case 3:a._W(-4,r);break;case 5:a=wa(8);a._W(8,r,"f");break;case 11:a._W(4,r?1:0);break;case 64:a=Li(r);break;case 31:;case 80:a=wa(4+2*(r.length+1)+(r.length%2?0:2));a._W(4,r.length+1);a._W(0,r,"dbcs");while(a.l!=a.length)a._W(1,0);break;default:throw new Error("TypedPropertyValue unrecognized type "+e+" "+r);}return F([t,a])}function Ji(e,r){var t=e.l;var a=e._R(4);var n=e._R(4);var i=[],s=0;var f=0;var l=-1,c={};for(s=0;s!=n;++s){var h=e._R(4);var u=e._R(4);i[s]=[h,u+t]}i.sort(function(e,r){return e[1]-r[1]});var d={};for(s=0;s!=n;++s){if(e.l!==i[s][1]){var p=true;if(s>0&&r)switch(r[i[s-1][0]].t){case 2:if(e.l+2===i[s][1]){e.l+=2;p=false}break;case 80:if(e.l<=i[s][1]){e.l=i[s][1];p=false}break;case 4108:if(e.l<=i[s][1]){e.l=i[s][1];p=false}break;}if((!r||s==0)&&e.l<=i[s][1]){p=false;e.l=i[s][1]}if(p)throw new Error("Read Error: Expected address "+i[s][1]+" at "+e.l+" :"+s)}if(r){if(i[s][0]==0&&i.length>s+1&&i[s][1]==i[s+1][1])continue;var v=r[i[s][0]];d[v.n]=Ki(e,v.t,{raw:true});if(v.p==="version")d[v.n]=String(d[v.n]>>16)+"."+("0000"+String(d[v.n]&65535)).slice(-4);if(v.n=="CodePage")switch(d[v.n]){case 0:d[v.n]=1252;case 874:;case 932:;case 936:;case 949:;case 950:;case 1250:;case 1251:;case 1253:;case 1254:;case 1255:;case 1256:;case 1257:;case 1258:;case 1e4:;case 1200:;case 1201:;case 1252:;case 65e3:;case-536:;case 65001:;case-535:o(f=d[v.n]>>>0&65535);break;default:throw new Error("Unsupported CodePage: "+d[v.n]);}}else{if(i[s][0]===1){f=d.CodePage=Ki(e,Nn);o(f);if(l!==-1){var m=e.l;e.l=i[l][1];c=ji(e,f);e.l=m}}else if(i[s][0]===0){if(f===0){l=s;e.l=i[s+1][1];continue}c=ji(e,f)}else{var g=c[i[s][0]];var b;switch(e[e.l]){case 65:e.l+=4;b=Xi(e);break;case 30:e.l+=4;b=Wi(e,e[e.l-4]).replace(/\u0000+$/,"");break;case 31:e.l+=4;b=Wi(e,e[e.l-4]).replace(/\u0000+$/,"");break;case 3:e.l+=4;b=e._R(4,"i");break;case 19:e.l+=4;b=e._R(4);break;case 5:e.l+=4;b=e._R(8,"f");break;case 11:e.l+=4;b=ss(e,4);break;case 64:e.l+=4;b=Ar(Pi(e));break;default:throw new Error("unparsed value: "+e[e.l]);}d[g]=b}}}e.l=t+a;return d}var qi=["CodePage","Thumbnail","_PID_LINKBASE","_PID_HLINKS","SystemIdentifier","FMTID"];function Qi(e){switch(typeof e){case"boolean":return 11;case"number":return(e|0)==e?3:5;case"string":return 31;case"object":if(e instanceof Date)return 64;break;}return-1}function es(e,r,t){var a=wa(8),n=[],i=[];var s=8,f=0;var o=wa(8),l=wa(8);o._W(4,2);o._W(4,1200);l._W(4,1);i.push(o);n.push(l);s+=8+o.length;if(!r){l=wa(8);l._W(4,0);n.unshift(l);var c=[wa(4)];c[0]._W(4,e.length);for(f=0;f-1||Ei.indexOf(e[f][0])>-1)continue;if(e[f][1]==null)continue;var u=e[f][1],d=0;if(r){d=+r[e[f][0]];var p=t[d];if(p.p=="version"&&typeof u=="string"){var v=u.split(".");u=(+v[0]<<16)+(+v[1]||0)}o=Zi(p.t,u)}else{var m=Qi(u);if(m==-1){m=31;u=String(u)}o=Zi(m,u)}i.push(o);l=wa(8);l._W(4,!r?2+f:d);n.push(l);s+=8+o.length}var g=8*(i.length+1);for(f=0;f=12?2:1);var i="sbcs-cont";var s=r;if(a&&a.biff>=8)r=1200;if(!a||a.biff==8){var f=e._R(1);if(f){i="dbcs-cont"}}else if(a.biff==12){i="wstr"}if(a.biff>=2&&a.biff<=5)i="cpstr";var o=n?e._R(n,i):"";r=s;return o}function ps(e){var t=r;r=1200;var a=e._R(2),n=e._R(1);var i=n&4,s=n&8;var f=1+(n&1);var o=0,l;var c={};if(s)o=e._R(2);if(i)l=e._R(4);var h=f==2?"dbcs-cont":"sbcs-cont";var u=a===0?"":e._R(a,h);if(s)e.l+=4*o;if(i)e.l+=l;c.t=u;if(!s){c.raw=""+c.t+"";c.r=c.t}r=t;return c}function vs(e){var r=e.t||"",t=1;var a=wa(3+(t>1?2:0));a._W(2,r.length);a._W(1,(t>1?8:0)|1);if(t>1)a._W(2,t);var n=wa(2*r.length);n._W(2*r.length,r,"utf16le");var i=[a,n];return F(i)}function ms(e,r,t){var a;if(t){if(t.biff>=2&&t.biff<=5)return e._R(r,"cpstr");if(t.biff>=12)return e._R(r,"dbcs-cont")}var n=e._R(1);if(n===0){a=e._R(r,"sbcs-cont")}else{a=e._R(r,"dbcs-cont")}return a}function gs(e,r,t){var a=e._R(t&&t.biff==2?1:2);if(a===0){e.l++;return""}return ms(e,a,t)}function bs(e,r,t){if(t.biff>5)return gs(e,r,t);var a=e._R(1);if(a===0){e.l++;return""}return e._R(a,t.biff<=4||!e.lens?"cpstr":"sbcs-cont")}function ws(e,r,t){if(!t)t=wa(3+2*e.length);t._W(2,e.length);t._W(1,1);t._W(31,e,"utf16le");return t}function ks(e){var r=e._R(1);e.l++;var t=e._R(2);e.l+=2;return[r,t]}function As(e){var r=e._R(4),t=e.l;var a=false;if(r>24){e.l+=r-24;if(e._R(16)==="795881f43b1d7f48af2c825dc4852763")a=true;e.l=t}var n=e._R((a?r-24:r)>>1,"utf16le").replace(P,"");if(a)e.l+=24;return n}function Ts(e){var r=e._R(2);var t="";while(r-- >0)t+="../";var a=e._R(0,"lpstr-ansi");e.l+=2;if(e._R(2)!=57005)throw new Error("Bad FileMoniker");var n=e._R(4);if(n===0)return t+a.replace(/\\/g,"/");var i=e._R(4);if(e._R(2)!=3)throw new Error("Bad FileMoniker");var s=e._R(i>>1,"utf16le").replace(P,"");return t+s}function Es(e,r){var t=e._R(16);r-=16;switch(t){case"e0c9ea79f9bace118c8200aa004ba90b":return As(e,r);case"0303000000000000c000000000000046":return Ts(e,r);default:throw new Error("Unsupported Moniker "+t);}}function ys(e){var r=e._R(4);var t=r>0?e._R(r,"utf16le").replace(P,""):"";return t}function Cs(e,r){if(!r)r=wa(6+e.length*2);r._W(4,1+e.length);for(var t=0;t-1?31:23;switch(a.charAt(0)){case"#":i=28;break;case".":i&=~2;break;}r._W(4,2);r._W(4,i);var s=[8,6815827,6619237,4849780,83];for(t=0;t-1?a.slice(0,n):a;r._W(4,2*(f.length+1));for(t=0;t-1?a.slice(n+1):"",r)}else{s="03 03 00 00 00 00 00 00 c0 00 00 00 00 00 00 46".split(" ");for(t=0;t8?4:2;var n=e._R(a),i=e._R(a,"i"),s=e._R(a,"i");return[n,i,s]}function Ps(e){var r=e._R(2);var t=mn(e);return[r,t]}function Ls(e,r,t){e.l+=4;r-=4;var a=e.l+r;var n=ds(e,r,t);var i=e._R(2);a-=e.l;if(i!==a)throw new Error("Malformed AddinUdf: padding = "+a+" != "+i);e.l+=i;return n}function Ms(e){var r=e._R(2);var t=e._R(2);var a=e._R(2);var n=e._R(2);return{s:{c:a,r:r},e:{c:n,r:t}}}function Us(e,r){if(!r)r=wa(8);r._W(2,e.s.r);r._W(2,e.e.r);r._W(2,e.s.c);r._W(2,e.e.c);return r}function Bs(e){var r=e._R(2);var t=e._R(2);var a=e._R(1);var n=e._R(1);return{s:{c:a,r:r},e:{c:n,r:t}}}var Ws=Bs;function Hs(e){e.l+=4;var r=e._R(2);var t=e._R(2);var a=e._R(2);e.l+=12;return[t,r,a]}function zs(e){var r={};e.l+=4;e.l+=16;r.fSharedNote=e._R(2);e.l+=4;return r}function Vs(e){var r={};e.l+=4;e.cf=e._R(2);return r}function Gs(e){e.l+=2;e.l+=e._R(2)}var $s={0:Gs,4:Gs,5:Gs,6:Gs,7:Vs,8:Gs,9:Gs,10:Gs,11:Gs,12:Gs,13:zs,14:Gs,15:Gs,16:Gs,17:Gs,18:Gs,19:Gs,20:Gs,21:Hs};function js(e,r){var t=e.l+r;var a=[];while(e.l=2){t.dt=e._R(2);e.l-=2}switch(t.BIFFVer){case 1536:;case 1280:;case 1024:;case 768:;case 512:;case 2:;case 7:break;default:if(r>6)throw new Error("Unexpected BIFF Ver "+t.BIFFVer);}e._R(r);return t}function Ys(e,r,t){var a=1536,n=16;switch(t.bookType){case"biff8":break;case"biff5":a=1280;n=8;break;case"biff4":a=4;n=6;break;case"biff3":a=3;n=6;break;case"biff2":a=2;n=4;break;case"xla":break;default:throw new Error("unsupported BIFF version");}var i=wa(n);i._W(2,a);i._W(2,r);if(n>4)i._W(2,29282);if(n>6)i._W(2,1997);if(n>8){i._W(2,49161);i._W(2,1);i._W(2,1798);i._W(2,0)}return i}function Ks(e,r){if(r===0)return 1200;if(e._R(2)!==1200){}return 1200}function Zs(e,r,t){if(t.enc){e.l+=r;return""}var a=e.l;var n=bs(e,0,t);e._R(r+a-e.l);return n}function Js(e,r){var t=!r||r.biff==8;var a=wa(t?112:54);a._W(r.biff==8?2:1,7);if(t)a._W(1,0);a._W(4,859007059);a._W(4,5458548|(t?0:536870912));while(a.l=8?2:1;var a=wa(8+t*e.name.length);a._W(4,e.pos);a._W(1,e.hs||0);a._W(1,e.dt);a._W(1,e.name.length);if(r.biff>=8)a._W(1,1);a._W(t*e.name.length,e.name,r.biff<8?"sbcs":"utf16le");var n=a.slice(0,a.l);n.l=a.l;return n}function rf(e,r){var t=e.l+r;var a=e._R(4);var n=e._R(4);var i=[];for(var s=0;s!=n&&e.l>15);n&=32767}var i={Unsynced:a&1,DyZero:(a&2)>>1,ExAsc:(a&4)>>2,ExDsc:(a&8)>>3};return[i,n]}function lf(e){var r=e._R(2),t=e._R(2),a=e._R(2),n=e._R(2);var i=e._R(2),s=e._R(2),f=e._R(2);var o=e._R(2),l=e._R(2);return{Pos:[r,t],Dim:[a,n],Flags:i,CurTab:s,FirstTab:f,Selected:o,TabRatio:l}}function cf(){var e=wa(18);e._W(2,0);e._W(2,0);e._W(2,29280);e._W(2,17600);e._W(2,56);e._W(2,0);e._W(2,0);e._W(2,1);e._W(2,500);return e}function hf(e,r,t){if(t&&t.biff>=2&&t.biff<5)return{};var a=e._R(2);return{RTL:a&64}}function uf(e){var r=wa(18),t=1718;if(e&&e.RTL)t|=64;r._W(2,t);r._W(4,0);r._W(4,64);r._W(4,0);r._W(4,0);return r}function df(){}function pf(e,r,t){var a={dyHeight:e._R(2),fl:e._R(2)};switch(t&&t.biff||8){case 2:break;case 3:;case 4:e.l+=2;break;default:e.l+=10;break;}a.name=ds(e,0,t);return a}function vf(e,r){var t=e.name||"Arial";var a=r&&r.biff==5,n=a?15+t.length:16+2*t.length;var i=wa(n);i._W(2,(e.sz||12)*20);i._W(4,0);i._W(2,400);i._W(4,0);i._W(2,0);i._W(1,t.length);if(!a)i._W(1,1);i._W((a?1:2)*t.length,t,a?"sbcs":"utf16le");return i}function mf(e){var r=Rs(e);r.isst=e._R(4);return r}function gf(e,r,t,a){var n=wa(10);Ns(e,r,a,n);n._W(4,t);return n}function bf(e,r,t){if(t.biffguess&&t.biff==2)t.biff=5;var a=e.l+r;var n=Rs(e,6);if(t.biff==2)e.l++;var i=gs(e,a-e.l,t);n.val=i;return n}function wf(e,r,t,a,n){var i=!n||n.biff==8;var s=wa(6+2+ +i+(1+i)*t.length);Ns(e,r,a,s);s._W(2,t.length);if(i)s._W(1,1);s._W((1+i)*t.length,t,i?"utf16le":"sbcs");return s}function kf(e,r,t){var a=e._R(2);var n=bs(e,0,t);return[a,n]}function Af(e,r,t,a){var n=t&&t.biff==5;if(!a)a=wa(n?3+r.length:5+2*r.length);a._W(2,e);a._W(n?1:2,r.length);if(!n)a._W(1,1);a._W((n?1:2)*r.length,r,n?"sbcs":"utf16le");var i=a.length>a.l?a.slice(0,a.l):a;if(i.l==null)i.l=i.length;return i}var Tf=bs;function Ef(e,r,t){var a=e.l+r;var n=t.biff==8||!t.biff?4:2;var i=e._R(n),s=e._R(n);var f=e._R(2),o=e._R(2);e.l=a;return{s:{r:i,c:f},e:{r:s,c:o}}}function yf(e,r){var t=r.biff==8||!r.biff?4:2;var a=wa(2*t+6);a._W(t,e.s.r);a._W(t,e.e.r+1);a._W(2,e.s.c);a._W(2,e.e.c+1);a._W(2,0);return a}function Cf(e){var r=e._R(2),t=e._R(2);var a=Ps(e);return{r:r,c:t,ixfe:a[0],rknum:a[1]}}function Sf(e,r){var t=e.l+r-2;var a=e._R(2),n=e._R(2);var i=[];while(e.l>26];if(!a.cellStyles)return n;n.alc=i&7;n.fWrap=i>>3&1;n.alcV=i>>4&7;n.fJustLast=i>>7&1;n.trot=i>>8&255;n.cIndent=i>>16&15;n.fShrinkToFit=i>>20&1;n.iReadOrder=i>>22&2;n.fAtrNum=i>>26&1;n.fAtrFnt=i>>27&1;n.fAtrAlc=i>>28&1;n.fAtrBdr=i>>29&1;n.fAtrPat=i>>30&1;n.fAtrProt=i>>31&1;n.dgLeft=s&15;n.dgRight=s>>4&15;n.dgTop=s>>8&15;n.dgBottom=s>>12&15;n.icvLeft=s>>16&127;n.icvRight=s>>23&127;n.grbitDiag=s>>30&3;n.icvTop=f&127;n.icvBottom=f>>7&127;n.icvDiag=f>>14&127;n.dgDiag=f>>21&15;n.icvFore=o&127;n.icvBack=o>>7&127;n.fsxButton=o>>14&1;return n}function Of(e,r,t){var a={};a.ifnt=e._R(2);a.numFmtId=e._R(2);a.flags=e._R(2);a.fStyle=a.flags>>2&1;r-=6;a.data=xf(e,r,a.fStyle,t);return a}function Rf(e,r,t,a){var n=t&&t.biff==5;if(!a)a=wa(n?16:20);a._W(2,0);if(e.style){a._W(2,e.numFmtId||0);a._W(2,65524)}else{a._W(2,e.numFmtId||0);a._W(2,r<<4)}var i=0;if(e.numFmtId>0&&n)i|=1024;a._W(4,i);a._W(4,0);if(!n)a._W(4,0);a._W(2,0);return a}function Nf(e){e.l+=4;var r=[e._R(2),e._R(2)];if(r[0]!==0)r[0]--;if(r[1]!==0)r[1]--;if(r[0]>7||r[1]>7)throw new Error("Bad Gutters: "+r.join("|"));return r}function If(e){var r=wa(8);r._W(4,0);r._W(2,e[0]?e[0]+1:0);r._W(2,e[1]?e[1]+1:0);return r}function Ff(e,r,t){var a=Rs(e,6);if(t.biff==2||r==9)++e.l;var n=hs(e,2);a.val=n;a.t=n===true||n===false?"b":"e";return a}function Df(e,r,t,a,n,i){var s=wa(8);Ns(e,r,a,s);us(t,i,s);return s}function Pf(e,r,t){if(t.biffguess&&t.biff==2)t.biff=5;var a=Rs(e,6);var n=Tn(e,8);a.val=n;return a}function Lf(e,r,t,a){var n=wa(14);Ns(e,r,a,n);En(t,n);return n}var Mf=Fs;function Uf(e,r,t){var a=e.l+r;var n=e._R(2);var i=e._R(2);t.sbcch=i;if(i==1025||i==14849)return[i,n];if(i<1||i>255)throw new Error("Unexpected SupBook type: "+i);var s=ms(e,i);var f=[];while(a>e.l)f.push(gs(e));return[i,n,s,f]}function Bf(e,r,t){var a=e._R(2);var n;var i={fBuiltIn:a&1,fWantAdvise:a>>>1&1,fWantPict:a>>>2&1,fOle:a>>>3&1,fOleLink:a>>>4&1,cf:a>>>5&1023,fIcon:a>>>15&1};if(t.sbcch===14849)n=Ls(e,r-2,t);i.body=n||e._R(r-2);if(typeof n==="string")i.Name=n;return i}function Wf(e,r,t){var a=e.l+r;var n=e._R(2);var i=e._R(1);var s=e._R(1);var f=e._R(t&&t.biff==2?1:2);var o=0;if(!t||t.biff>=5){if(t.biff!=5)e.l+=2;o=e._R(2);if(t.biff==5)e.l+=2;e.l+=4}var l=ms(e,s,t);if(n&32)l=Qn[l.charCodeAt(0)];var c=a-e.l;if(t&&t.biff==2)--c;var h=a==e.l||f===0||!(c>0)?[]:kd(e,c,t,f);return{chKey:i,Name:l,itab:o,rgce:h}}function Hf(e,r,t){if(t.biff<8)return zf(e,r,t);var a=[],n=e.l+r,i=e._R(t.biff>8?4:2);while(i--!==0)a.push(Ds(e,t.biff>8?12:6,t));if(e.l!=n)throw new Error("Bad ExternSheet: "+e.l+" != "+n);return a}function zf(e,r,t){if(e[e.l+1]==3)e[e.l]++;var a=ds(e,r,t);return a.charCodeAt(0)==3?a.slice(1):a}function Vf(e,r,t){if(t.biff<8){e.l+=r;return}var a=e._R(2);var n=e._R(2);var i=ms(e,a,t);var s=ms(e,n,t);return[i,s]}function Gf(e,r,t){var a=Bs(e,6);e.l++;var n=e._R(1);r-=8;return[Ad(e,r,t),n,a]}function $f(e,r,t){var a=Ws(e,6);switch(t.biff){case 2:e.l++;r-=7;break;case 3:;case 4:e.l+=2;r-=8;break;default:e.l+=6;r-=12;}return[a,bd(e,r,t,a)]}function jf(e){var r=e._R(4)!==0;var t=e._R(4)!==0;var a=e._R(4);return[r,t,a]}function Xf(e,r,t){if(t.biff<8)return;var a=e._R(2),n=e._R(2);var i=e._R(2),s=e._R(2);var f=bs(e,0,t);if(t.biff<8)e._R(1);return[{r:a,c:n},f,s,i]}function Yf(e,r,t){return Xf(e,r,t)}function Kf(e,r){var t=[];var a=e._R(2);while(a--)t.push(Ms(e,r));return t}function Zf(e){var r=wa(2+e.length*8);r._W(2,e.length);for(var t=0;t=(c?f:2*f))break}if(n.length!==f&&n.length!==f*2){throw new Error("cchText: "+f+" != "+n.length)}e.l=a+r;return{t:n}}catch(u){e.l=a+r;return{t:n}}}function ro(e,r){var t=Ms(e,8);e.l+=16;var a=Ss(e,r-24);return[t,a]}function to(e){var r=wa(24);var t=La(e[0]);r._W(2,t.r);r._W(2,t.r);r._W(2,t.c);r._W(2,t.c);var a="d0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" ");for(var n=0;n<16;++n)r._W(1,parseInt(a[n],16));return F([r,_s(e[1])])}function ao(e,r){e._R(2);var t=Ms(e,8);var a=e._R((r-10)/2,"dbcs-cont");a=a.replace(P,"");return[t,a]}function no(e){var r=e[1].Tooltip;var t=wa(10+2*(r.length+1));t._W(2,2048);var a=La(e[0]);t._W(2,a.r);t._W(2,a.r);t._W(2,a.c);t._W(2,a.c);for(var n=0;n0)t.push(Os(e,8));return t}function oo(e){var r=e._R(2);var t=[];while(r-- >0)t.push(Os(e,8));return t}function lo(e){e.l+=2;var r={cxfs:0,crc:0};r.cxfs=e._R(2);r.crc=e._R(4);return r}function co(e,r,t){if(!t.cellStyles)return ba(e,r);var a=t&&t.biff>=12?4:2;var n=e._R(a);var i=e._R(a);var s=e._R(a);var f=e._R(a);var o=e._R(2);if(a==2)e.l+=2;var l={s:n,e:i,w:s,ixfe:f,flags:o};if(t.biff>=5||!t.biff)l.level=o>>8&7;return l}function ho(e,r){var t=wa(12);t._W(2,r);t._W(2,r);t._W(2,e.width*256);t._W(2,0);var a=0;if(e.hidden)a|=1;t._W(1,a);a=e.level||0;t._W(1,a);t._W(2,0);return t}function uo(e,r){var t={};if(r<32)return t;e.l+=16;t.header=Tn(e,8);t.footer=Tn(e,8);e.l+=2;return t}function po(e,r,t){var a={area:false};if(t.biff!=5){e.l+=r;return a}var n=e._R(1);e.l+=3;if(n&16)a.area=true;return a}function vo(e){var r=wa(2*e);for(var t=0;t1048576)c=1e6;if(s!=2)h=i._R(2);var u=i._R(2);var d=t.codepage||1252;if(s!=2){i.l+=16;i._R(1);if(i[i.l]!==0)d=e[i[i.l]];i.l+=1;i.l+=2}if(l)i.l+=36;var p=[],v={};var m=Math.min(i.length,s==2?521:h-10-(o?264:0));var g=l?32:11;while(i.l0){if(i[i.l]===42){i.l+=u;continue}++i.l;n[++b]=[];w=0;for(w=0;w!=p.length;++w){var k=i.slice(i.l,i.l+p[w].len);i.l+=p[w].len;ga(k,0);var A=typeof a!=="undefined"?a.utils.decode(d,k):R(k);switch(p[w].type){case"C":if(A.trim().length)n[b][w]=A.replace(/\s+$/,"");break;case"D":if(A.length===8)n[b][w]=new Date(+A.slice(0,4),+A.slice(4,6)-1,+A.slice(6,8));else n[b][w]=A;break;case"F":n[b][w]=parseFloat(A.trim());break;case"+":;case"I":n[b][w]=l?k._R(-4,"i")^2147483648:k._R(4,"i");break;case"L":switch(A.trim().toUpperCase()){case"Y":;case"T":n[b][w]=true;break;case"N":;case"F":n[b][w]=false;break;case"":;case"?":break;default:throw new Error("DBF Unrecognized L:|"+A+"|");}break;case"M":if(!f)throw new Error("DBF Unexpected MEMO for type "+s.toString(16));n[b][w]="##MEMO##"+(l?parseInt(A.trim(),10):k._R(4));break;case"N":A=A.replace(/\u0000/g,"").trim();if(A&&A!=".")n[b][w]=+A||0;break;case"@":n[b][w]=new Date(k._R(-8,"f")-621356832e5);break;case"T":n[b][w]=new Date((k._R(4)-2440588)*864e5+k._R(4));break;case"Y":n[b][w]=k._R(4,"i")/1e4+k._R(4,"i")/1e4*Math.pow(2,32);break;case"O":n[b][w]=-k._R(-8,"f");break;case"B":if(o&&p[w].len==8){n[b][w]=k._R(8,"f");break};case"G":;case"P":k.l+=p[w].len;break;case"0":if(p[w].name==="_NullFlags")break;default:throw new Error("DBF Unsupported data type "+p[w].type);}}}if(s!=2)if(i.l=0)o(+f.codepage);if(f.type=="string")throw new Error("Cannot write DBF to JS string");var h=Aa();var u=ek(i,{header:1,raw:true,cellDates:true});var d=u[0],p=u.slice(1),v=i["!cols"]||[];var m=0,g=0,b=0,w=1;for(m=0;m250)S=250;C=((v[m]||{}).DBF||{}).type;if(C=="C"){if(v[m].DBF.len>S)S=v[m].DBF.len}if(y=="B"&&C=="N"){y="N";E[m]=v[m].DBF.dec;S=v[m].DBF.len}T[m]=y=="C"||C=="N"?S:l[y]||0;w+=T[m];A[m]=y}var x=h.next(32);x._W(4,318902576);x._W(4,p.length);x._W(2,296+32*b);x._W(2,w);for(m=0;m<4;++m)x._W(4,0);var O=+n[r]||3;x._W(4,0|O<<8);if(e[O]!=+f.codepage){console.error("DBF Unsupported codepage "+r+", using 1252");r=1252}for(m=0,g=0;m":190,"?":191,"{":223};var r=new RegExp("N("+sr(e).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm");var t=function(r,t){var a=e[t];return typeof a=="number"?v(a):a};var n=function(e,r,t){var a=r.charCodeAt(0)-32<<4|t.charCodeAt(0)-48;return a==59?e:v(a)};e["|"]=254;function i(e,r){switch(r.type){case"base64":return s(T(e),r);case"binary":return s(e,r);case"buffer":return s(E&&Buffer.isBuffer(e)?e.toString("binary"):R(e),r);case"array":return s(Tr(e),r);}throw new Error("Unrecognized type "+r.type)}function s(e,i){var s=e.split(/[\n\r]+/),f=-1,l=-1,c=0,h=0,u=[];var d=[];var p=null;var v={},m=[],g=[],b=[];var w=0,k;var A={Workbook:{WBProps:{},Names:[]}};if(+i.codepage>=0)o(+i.codepage);for(;c!==s.length;++c){w=0;var T=s[c].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,n).replace(r,t);var E=T.replace(/;;/g,"\0").split(";").map(function(e){return e.replace(/\u0000/g,";")});var y=E[0],C;if(T.length>0)switch(y){case"ID":break;case"E":break;case"B":break;case"O":for(h=1;h=1&&S<=4)A.Workbook.WBProps.date1904=true}break;}break;case"W":break;case"P":switch(E[1].charAt(0)){case"P":d.push(T.slice(3).replace(/;;/g,";"));break;}break;case"NN":{var _={Sheet:0};for(h=1;h-1&&u[I][F];if(!L||!L[1])throw new Error("SYLK shared formula cannot find base");D=Bh(L[1],{r:f-I,c:l-F})}if(D){if(!u[f][l])u[f][l]={t:"n",f:D};else u[f][l].f=D}break;case"F":var M=0;for(h=1;h0){m[f].hpt=w;m[f].hpx=$l(w)}else if(w===0)m[f].hidden=true;break;default:if(i&&i.WTF)throw new Error("SYLK bad record "+T);}if(M<1)p=null;break;default:if(i&&i.WTF)throw new Error("SYLK bad record "+T);}}if(m.length>0)v["!rows"]=m;if(g.length>0)v["!cols"]=g;g.forEach(function(e){Hl(e)});if(i&&i.sheetRows)u=u.slice(0,i.sheetRows);return[u,v,A]}function f(e,r){var t=i(e,r);var a=t[0],n=t[1],s=t[2];var f=Er(r);f.date1904=(((s||{}).Workbook||{}).WBProps||{}).date1904;var o=Xa(a,f);sr(n).forEach(function(e){o[e]=n[e]});var l=$a(o,r);sr(s).forEach(function(e){l[e]=s[e]});l.bookType="sylk";return l}function l(e,r,t,a){var n="C;Y"+(t+1)+";X"+(a+1)+";K";switch(e.t){case"n":n+=e.v||0;if(e.f&&!e.F)n+=";E"+Uh(e.f,{r:t,c:a});break;case"b":n+=e.v?"TRUE":"FALSE";break;case"e":n+=e.w||e.v;break;case"d":n+='"'+(e.w||e.v)+'"';break;case"s":n+='"'+e.v.replace(/"/g,"").replace(/;/g,";;")+'"';break;}return n}function c(e,r){r.forEach(function(r,t){var a="F;W"+(t+1)+" "+(t+1)+" ";if(r.hidden)a+="0";else{if(typeof r.width=="number"&&!r.wpx)r.wpx=Ll(r.width);if(typeof r.wpx=="number"&&!r.wch)r.wch=Ml(r.wpx);if(typeof r.wch=="number")a+=Math.round(r.wch)}if(a.charAt(a.length-1)!=" ")e.push(a)})}function h(e,r){r.forEach(function(r,t){var a="F;";if(r.hidden)a+="M0;";else if(r.hpt)a+="M"+20*r.hpt+";";else if(r.hpx)a+="M"+20*Gl(r.hpx)+";";if(a.length>2)e.push(a+"R"+(t+1))})}function u(e,r,t){var a=["ID;PSheetJS;N;E"],n=[];var i=za(e["!ref"]),s;var f=Array.isArray(e);var o="\r\n";var u=(((t||{}).Workbook||{}).WBProps||{}).date1904;a.push("P;PGeneral");a.push("F;P0;DG0G8;M255");if(e["!cols"])c(a,e["!cols"]);if(e["!rows"])h(a,e["!rows"]);a.push("B;Y"+(i.e.r-i.s.r+1)+";X"+(i.e.c-i.s.c+1)+";D"+[i.s.c,i.s.r,i.e.c,i.e.r].join(" "));a.push("O;L;D;B"+(u?";V4":"")+";K47;G100 0.001");for(var d=i.s.r;d<=i.e.r;++d){var p=[];for(var v=i.s.c;v<=i.e.c;++v){var m=Ma({r:d,c:v});s=f?(e[d]||[])[v]:e[m];if(!s||s.v==null&&(!s.f||s.F))continue;p.push(l(s,e,d,v,r))}n.push(p.join(o))}return a.join(o)+o+n.join(o)+o+"E"+o}return{to_workbook:f,from_sheet:u}}();var No=function(){function e(e,t){switch(t.type){case"base64":return r(T(e),t);case"binary":return r(e,t);case"buffer":return r(E&&Buffer.isBuffer(e)?e.toString("binary"):R(e),t);case"array":return r(Tr(e),t);}throw new Error("Unrecognized type "+t.type)}function r(e,r){var t=e.split("\n"),a=-1,n=-1,i=0,s=[];for(;i!==t.length;++i){if(t[i].trim()==="BOT"){s[++a]=[];n=0;continue}if(a<0)continue;var f=t[i].trim().split(",");var o=f[0],l=f[1];++i;var c=t[i]||"";while((c.match(/["]/g)||[]).length&1&&i=0&&i[s].length===0)--s;var f=10,o=0;var l=0;for(;l<=s;++l){o=i[l].indexOf(" ");if(o==-1)o=i[l].length;else o++;f=Math.max(f,o)}for(l=0;l<=s;++l){n[l]=[];var c=0;e(i[l].slice(0,f).trim(),n,l,c,a);for(c=1;c<=(i[l].length-f)/10+1;++c)e(i[l].slice(f+(c-1)*10,f+c*10).trim(),n,l,c,a)}if(a.sheetRows)n=n.slice(0,a.sheetRows);return n}var t={44:",",9:"\t",59:";",124:"|"};var n={44:3,9:2,59:1,124:0};function i(e){var r={},a=false,i=0,s=0;for(;i0)b();n["!ref"]=Ba(s);return n}function f(e,t){if(!(t&&t.PRN))return s(e,t);if(t.FS)return s(e,t);if(e.slice(0,4)=="sep=")return s(e,t);if(e.indexOf("\t")>=0||e.indexOf(",")>=0||e.indexOf(";")>=0)return s(e,t);return Xa(r(e,t),t)}function o(e,r){var t="",n=r.type=="string"?[0,0,0,0]:xw(e,r);switch(r.type){case"base64":t=T(e);break;case"binary":t=e;break;case"buffer":if(r.codepage==65001)t=e.toString("utf8");else if(r.codepage&&typeof a!=="undefined")t=a.utils.decode(r.codepage,e);else t=E&&Buffer.isBuffer(e)?e.toString("binary"):R(e);break;case"array":t=Tr(e);break;case"string":t=e;break;default:throw new Error("Unrecognized type "+r.type);}if(n[0]==239&&n[1]==187&&n[2]==191)t=mt(t.slice(3));else if(r.type!="string"&&r.type!="buffer"&&r.codepage==65001)t=mt(t);else if(r.type=="binary"&&typeof a!=="undefined"&&r.codepage)t=a.utils.decode(r.codepage,a.utils.encode(28591,t));if(t.slice(0,19)=="socialcalc:version:")return Io.to_sheet(r.type=="string"?t:mt(t),r);return f(t,r)}function l(e,r){return $a(o(e,r),r)}function c(e){var r=[];var t=za(e["!ref"]),a;var n=Array.isArray(e);for(var i=t.s.r;i<=t.e.r;++i){var s=[];for(var f=t.s.c;f<=t.e.c;++f){var o=Ma({r:i,c:f});a=n?(e[i]||[])[f]:e[o];if(!a||a.v==null){s.push(" ");continue}var l=(a.w||(Ga(a),a.w)||"").slice(0,10);while(l.length<10)l+=" ";s.push(l+(f===0?" ":""))}r.push(s.join(""))}return r.join("\n")}return{to_workbook:l,to_sheet:o,from_sheet:c}}();function Do(e,r){var t=r||{},a=!!t.WTF;t.WTF=true;try{var n=Ro.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 Fo.to_workbook(e,r)}}var Po=function(){function e(e,r,t){if(!e)return;ga(e,e.l||0);var a=t.Enum||H;while(e.l=16&&r[14]==5&&r[15]===108)throw new Error("Unsupported Works 3 for Mac file")}}if(r[2]==2){a.Enum=H;e(r,function(e,r,t){switch(t){case 0:a.vers=e;if(e>=4096)a.qpro=true;break;case 255:a.vers=e;a.works=true;break;case 6:h=e;break;case 204:if(e)s=e;break;case 222:s=e;break;case 15:;case 51:if((!a.qpro&&!a.works||t==51)&&e[1].v.charCodeAt(0)<48)e[1].v=e[1].v.slice(1);if(a.works||a.works2)e[1].v=e[1].v.replace(/\r\n/g,"\n");case 13:;case 14:;case 16:if(t==14&&(e[2]&112)==112&&(e[2]&15)>1&&(e[2]&15)<15){e[1].z=a.dateNF||Z[14];if(a.cellDates){e[1].t="d";e[1].v=mr(e[1].v)}}if(a.qpro){if(e[3]>f){n["!ref"]=Ba(h);o[i]=n;l.push(i);n=a.dense?[]:{};h={s:{r:0,c:0},e:{r:0,c:0}};f=e[3];i=s||"Sheet"+(f+1);s=""}}var c=a.dense?(n[e[0].r]||[])[e[0].c]:n[Ma(e[0])];if(c){c.t=e[1].t;c.v=e[1].v;if(e[1].z!=null)c.z=e[1].z;if(e[1].f!=null)c.f=e[1].f;break}if(a.dense){if(!n[e[0].r])n[e[0].r]=[];n[e[0].r][e[0].c]=e[1]}else n[Ma(e[0])]=e[1];break;case 21509:a.works2=true;break;default:;}},a)}else if(r[2]==26||r[2]==14){a.Enum=z;if(r[2]==14){a.qpro=true;r.l=0}e(r,function(e,r,t){switch(t){case 204:i=e;break;case 22:if(e[1].v.charCodeAt(0)<48)e[1].v=e[1].v.slice(1);e[1].v=e[1].v.replace(/\x0F./g,function(e){return String.fromCharCode(e.charCodeAt(1)-32)}).replace(/\r\n/g,"\n");case 23:;case 24:;case 25:;case 37:;case 39:;case 40:if(e[3]>f){n["!ref"]=Ba(h);o[i]=n;l.push(i);n=a.dense?[]:{};h={s:{r:0,c:0},e:{r:0,c:0}};f=e[3];i="Sheet"+(f+1)}if(u>0&&e[0].r>=u)break;if(a.dense){if(!n[e[0].r])n[e[0].r]=[];n[e[0].r][e[0].c]=e[1]}else n[Ma(e[0])]=e[1];if(h.e.c=0)o(+t.codepage);if(t.type=="string")throw new Error("Cannot write WK1 to JS string");var a=Aa();var n=za(e["!ref"]);var s=Array.isArray(e);var f=[];Pg(a,0,i(1030));Pg(a,6,l(n));var c=Math.min(n.e.r,8191);for(var h=n.s.r;h<=c;++h){var d=xa(h);for(var p=n.s.c;p<=n.e.c;++p){if(h===n.s.r)f[p]=Ia(p);var m=f[p]+d;var g=s?(e[h]||[])[p]:e[m];if(!g||g.t=="z")continue;if(g.t=="n"){if((g.v|0)==g.v&&g.v>=-32768&&g.v<=32767)Pg(a,13,v(h,p,g.v));else Pg(a,14,b(h,p,g.v))}else{var w=Ga(g);Pg(a,15,u(h,p,w.slice(0,239)))}}}Pg(a,1);return a.end()}function n(e,r){var t=r||{};if(+t.codepage>=0)o(+t.codepage);if(t.type=="string")throw new Error("Cannot write WK3 to JS string");var a=Aa();Pg(a,0,s(e));for(var n=0,i=0;n8191)t=8191;r._W(2,t);r._W(1,n);r._W(1,a);r._W(2,0);r._W(2,0);r._W(1,1);r._W(1,2);r._W(4,0);r._W(4,0);return r}function f(e,r,t){var a={s:{c:0,r:0},e:{c:0,r:0}};if(r==8&&t.qpro){a.s.c=e._R(1);e.l++;a.s.r=e._R(2);a.e.c=e._R(1);e.l++;a.e.r=e._R(2);return a}a.s.c=e._R(2);a.s.r=e._R(2);if(r==12&&t.qpro)e.l+=2;a.e.c=e._R(2);a.e.r=e._R(2);if(r==12&&t.qpro)e.l+=2;if(a.s.c==65535)a.s.c=a.e.c=a.s.r=a.e.r=0;return a}function l(e){var r=wa(8);r._W(2,e.s.c);r._W(2,e.s.r);r._W(2,e.e.c);r._W(2,e.e.r);return r}function c(e,r,t){var a=[{c:0,r:0},{t:"n",v:0},0,0];if(t.qpro&&t.vers!=20768){a[0].c=e._R(1);a[3]=e._R(1);a[0].r=e._R(2);e.l+=2}else if(t.works){a[0].c=e._R(2);a[0].r=e._R(2);a[2]=e._R(2)}else{a[2]=e._R(1);a[0].c=e._R(2);a[0].r=e._R(2)}return a}function h(e,r,t){var a=e.l+r;var n=c(e,r,t);n[1].t="s";if(t.vers==20768){e.l++;var i=e._R(1);n[1].v=e._R(i,"utf8");return n}if(t.qpro)e.l++;n[1].v=e._R(a-e.l,"cstr");return n}function u(e,r,t){var a=wa(7+t.length);a._W(1,255);a._W(2,r);a._W(2,e);a._W(1,39);for(var n=0;n=128?95:i)}a._W(1,0);return a}function d(e,r,t){var a=e.l+r;var n=c(e,r,t);n[1].t="s";if(t.vers==20768){var i=e._R(1);n[1].v=e._R(i,"utf8");return n}n[1].v=e._R(a-e.l,"cstr");return n}function p(e,r,t){var a=c(e,r,t);a[1].v=e._R(2,"i");return a}function v(e,r,t){var a=wa(7);a._W(1,255);a._W(2,r);a._W(2,e);a._W(2,t,"i");return a}function m(e,r,t){var a=c(e,r,t);a[1].v=e._R(8,"f");return a}function b(e,r,t){var a=wa(13);a._W(1,255);a._W(2,r);a._W(2,e);a._W(8,t,"f");return a}function w(e,r,t){var a=e.l+r;var n=c(e,r,t);n[1].v=e._R(8,"f");if(t.qpro)e.l=a;else{var i=e._R(2);y(e.slice(e.l,e.l+i),n);e.l+=i}return n}function k(e,r,t){var a=r&32768;r&=~32768;r=(a?e:0)+(r>=8192?r-16384:r);return(a?"":"$")+(t?Ia(r):xa(r))}var A={31:["NA",0],33:["ABS",1],34:["TRUNC",1],35:["SQRT",1],36:["LOG",1],37:["LN",1],38:["PI",0],39:["SIN",1],40:["COS",1],41:["TAN",1],42:["ATAN2",2],43:["ATAN",1],44:["ASIN",1],45:["ACOS",1],46:["EXP",1],47:["MOD",2],49:["ISNA",1],50:["ISERR",1],51:["FALSE",0],52:["TRUE",0],53:["RAND",0],63:["ROUND",2],68:["ISNUMBER",1],69:["ISTEXT",1],70:["LEN",1],71:["VALUE",1],73:["MID",3],74:["CHAR",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],102:["UPPER",1],103:["LOWER",1],107:["PROPER",1],109:["TRIM",1],111:["T",1]};var E=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function y(e,r){ga(e,0);var t=[],a=0,n="",i="",s="",f="";while(e.lt.length){console.error("WK1 bad formula parse 0x"+o.toString(16)+":|"+t.join("|")+"|");return}var u=t.slice(-a);t.length-=a;t.push(A[o][0]+"("+u.join(",")+")")}else if(o<=7)return console.error("WK1 invalid opcode "+o.toString(16));else if(o<=24)return console.error("WK1 unsupported op "+o.toString(16));else if(o<=30)return console.error("WK1 invalid opcode "+o.toString(16));else if(o<=115)return console.error("WK1 unsupported function opcode "+o.toString(16));else return console.error("WK1 unrecognized opcode "+o.toString(16));}}if(t.length==1)r[1].f=""+t[0];else console.error("WK1 bad formula parse |"+t.join("|")+"|")}function C(e){var r=[{c:0,r:0},{t:"n",v:0},0];r[0].r=e._R(2);r[3]=e[e.l++];r[0].c=e[e.l++];return r}function S(e,r){var t=C(e,r);t[1].t="s";t[1].v=e._R(r-4,"cstr");return t}function _(e,r,t,a){var n=wa(6+a.length);n._W(2,e);n._W(1,t);n._W(1,r);n._W(1,39);for(var i=0;i=128?95:s)}n._W(1,0);return n}function O(e,r){var t=C(e,r);t[1].v=e._R(2);var a=t[1].v>>1;if(t[1].v&1){switch(a&7){case 0:a=(a>>3)*5e3;break;case 1:a=(a>>3)*500;break;case 2:a=(a>>3)/20;break;case 3:a=(a>>3)/200;break;case 4:a=(a>>3)/2e3;break;case 5:a=(a>>3)/2e4;break;case 6:a=(a>>3)/16;break;case 7:a=(a>>3)/64;break;}}t[1].v=a;return t}function R(e,r){var t=C(e,r);var a=e._R(4);var n=e._R(4);var i=e._R(2);if(i==65535){if(a===0&&n===3221225472){t[1].t="e";t[1].v=15}else if(a===0&&n===3489660928){t[1].t="e";t[1].v=42}else t[1].v=0;return t}var s=i&32768;i=(i&32767)-16446;t[1].v=(1-s*2)*(n*Math.pow(2,i+32)+a*Math.pow(2,i));
+return t}function N(e,r,t,a){var n=wa(14);n._W(2,e);n._W(1,t);n._W(1,r);if(a==0){n._W(4,0);n._W(4,0);n._W(2,65535);return n}var i=0,s=0,f=0,o=0;if(a<0){i=1;a=-a}s=Math.log2(a)|0;a/=Math.pow(2,s-31);o=a>>>0;if((o&2147483648)==0){a/=2;++s;o=a>>>0}a-=o;o|=2147483648;o>>>=0;a*=Math.pow(2,32);f=a>>>0;n._W(4,f);n._W(4,o);s+=16383+(i?32768:0);n._W(2,s);return n}function I(e,r){var t=R(e,14);e.l+=r-14;return t}function F(e,r){var t=C(e,r);var a=e._R(4);t[1].v=a>>6;return t}function D(e,r){var t=C(e,r);var a=e._R(8,"f");t[1].v=a;return t}function P(e,r){var t=D(e,12);e.l+=r-12;return t}function L(e,r){return e[e.l+r-1]==0?e._R(r,"cstr"):""}function M(e,r){var t=e[e.l++];if(t>r-1)t=r-1;var a="";while(a.length127?95:n}t[t.l++]=0;return t}var H={0:{n:"BOF",f:os},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:f},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:p},14:{n:"NUMBER",f:m},15:{n:"LABEL",f:h},16:{n:"FORMULA",f:w},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f:d},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"},103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},204:{n:"SHEETNAMECS",f:L},222:{n:"SHEETNAMELP",f:M},255:{n:"BOF",f:os},65535:{n:""}};var z={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:S},23:{n:"NUMBER17",f:R},24:{n:"NUMBER18",f:O},25:{n:"FORMULA19",f:I},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:B},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:F},38:{n:"??"},39:{n:"NUMBER27",f:D},40:{n:"FORMULA28",f:P},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},204:{n:"SHEETNAMECS",f:L},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1537:{n:"SHEETINFOQP",f:U},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};function V(e,r){ga(e,0);var t=r||{};if(g!=null&&t.dense==null)t.dense=g;var a=t.dense?[]:{};var n=[],i="",s=[];var f={s:{r:-1,c:-1},e:{r:-1,c:-1}};var o=0,l=0,c=0,h=0;var u={SheetNames:[],Sheets:{}};e:while(e.l255||f.s.r>999999)break;if(f.e.cc)f.s.c=c;h=v._R(4);if(f.s.r>h)f.s.r=h;h=v._R(4);if(f.e.rh)f.s.r=h;if(f.e.r0&&o>=0){if(w&32)switch(w&31){case 2:b={t:"n",v:b.v+A&65535};break;case 3:b={t:"n",v:b.v+A&65535};if(b.v>32767)b.v-=65536;break;case 7:b={t:"s",v:n[l=l+A>>>0]};break;default:throw"Cannot apply delta for QPW cell type "+(w&31);}else switch(w&31){case 1:b={t:"z"};break;case 2:b={t:"n",v:v._R(2)};break;case 7:b={t:"s",v:n[l=v._R(4)-1]};break;default:throw"Cannot apply repeat for QPW cell type "+(w&31);}if(!(!t.sheetStubs&&b.t=="z")){if(Array.isArray(a)){if(!a[h])a[h]=[];a[h][c]=b}else a[Ma({r:h,c:c})]=b}++h;--o}}}break;default:break;}e.l+=p}return u}return{sheet_to_wk1:a,book_to_wk3:n,to_workbook:r}}();function Lo(e){var r={},t=e.match(Yr),a=0;var n=false;if(t)for(;a!=t.length;++a){var s=Jr(t[a]);switch(s[0].replace(/\w*:/g,"")){case"":;case"":r.shadow=1;break;case"":break;case"":;case"":r.outline=1;break;case"":break;case"":;case"":r.strike=1;break;case"":break;case"":;case"":r.u=1;break;case"":break;case"":;case"":r.b=1;break;case"":break;case"":;case"":r.i=1;break;case"":break;case"":;case"":;case"":break;case"":;case"":;case"":break;case"":;case"":;case"":break;case"":;case"":;case"":break;case"":;case"":break;case"":n=false;break;default:if(s[0].charCodeAt(1)!==47&&!n)throw new Error("Unrecognized rich format "+s[0]);}}return r}var Mo=function(){var e=bt("t"),r=bt("rPr");function t(t){var a=t.match(e);if(!a)return{t:"s",v:""};var n={t:"s",v:rt(a[1])};var i=t.match(r);if(i)n.s=Lo(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 Uo=function zk(){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('');if(e.b){r.push("");t.push("")}if(e.i){r.push("");t.push("")}if(e.strike){r.push("");t.push("")}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("");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,"
")+a[2].join("")}return function a(e){return e.map(t).join("")}}();var Bo=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,Wo=/<(?:\w+:)?r>/;var Ho=/<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;function zo(e,r){var t=r?r.cellHTML:true;var a={};if(!e)return{t:""};if(e.match(/^\s*<(?:\w+:)?t[^>]*>/)){a.t=rt(mt(e.slice(e.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||""),true);a.r=mt(e);if(t)a.h=ft(a.t)}else if(e.match(Wo)){a.r=mt(e);a.t=rt(mt((e.replace(Ho,"").match(Bo)||[]).join("").replace(Yr,"")),true);if(t)a.h=Uo(Mo(a.r))}return a}var Vo=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/;var Go=/<(?:\w+:)?(?:si|sstItem)>/g;var $o=/<\/(?:\w+:)?(?:si|sstItem)>/;function jo(e,r){var t=[],a="";if(!e)return t;var n=e.match(Vo);if(n){a=n[2].replace(Go,"").split($o);for(var i=0;i!=a.length;++i){var s=zo(a[i].trim(),r);if(s!=null)t[t.length]=s}n=Jr(n[1]);t.Count=n.count;t.Unique=n.uniqueCount}return t}var Xo=/^\s|\s$|[\t\n\r]/;function Yo(e,r){if(!r.bookSST)return"";var t=[Gr];t[t.length]=_t("sst",null,{xmlns:Ft[0],count:e.Count,uniqueCount:e.Unique});for(var a=0;a!=e.length;++a){if(e[a]==null)continue;var n=e[a];var i="";if(n.r)i+=n.r;else{i+=""+nt(n.t)+""}i+="";t[t.length]=i}if(t.length>2){t[t.length]="";t[1]=t[1].replace("/>",">")}return t.join("")}function Ko(e){return[e._R(4),e._R(4)]}function Zo(e,r){var t=[];var a=false;ka(e,function n(e,i,s){switch(s){case 159:t.Count=e[0];t.Unique=e[1];break;case 19:t.push(e);break;case 160:return true;case 35:a=true;break;case 36:a=false;break;default:if(i.T){}if(!a||r.WTF)throw new Error("Unexpected record 0x"+s.toString(16));}});return t}function Jo(e,r){if(!r)r=wa(8);r._W(4,e.Count);r._W(4,e.Unique);return r}var qo=rn;function Qo(e){var r=Aa();Ta(r,159,Jo(e));for(var t=0;t=4)e.l+=r-4;return t}function tl(e){var r={};r.id=e._R(0,"lpp4");r.R=rl(e,4);r.U=rl(e,4);r.W=rl(e,4);return r}function al(e){var r=e._R(4);var t=e.l+r-4;var a={};var n=e._R(4);var i=[];while(n-- >0)i.push({t:e._R(4),v:e._R(0,"lpp4")});a.name=e._R(0,"lpp4");a.comps=i;if(e.l!=t)throw new Error("Bad DataSpaceMapEntry: "+e.l+" != "+t);return a}function nl(e){var r=[];e.l+=4;var t=e._R(4);while(t-- >0)r.push(al(e));return r}function il(e){var r=[];e.l+=4;var t=e._R(4);while(t-- >0)r.push(e._R(0,"lpp4"));return r}function sl(e){var r={};e._R(4);e.l+=4;r.id=e._R(0,"lpp4");r.name=e._R(0,"lpp4");r.R=rl(e,4);r.U=rl(e,4);r.W=rl(e,4);return r}function fl(e){var r=sl(e);r.ename=e._R(0,"8lpp4");r.blksz=e._R(4);r.cmode=e._R(4);if(e._R(4)!=4)throw new Error("Bad !Primary record");return r}function ol(e,r){var t=e.l+r;var a={};a.Flags=e._R(4)&63;e.l+=4;a.AlgID=e._R(4);var n=false;switch(a.AlgID){case 26126:;case 26127:;case 26128:n=a.Flags==36;break;case 26625:n=a.Flags==4;break;case 0:n=a.Flags==16||a.Flags==4||a.Flags==36;break;default:throw"Unrecognized encryption algorithm: "+a.AlgID;}if(!n)throw new Error("Encryption Flags/AlgID mismatch");a.AlgIDHash=e._R(4);a.KeySize=e._R(4);a.ProviderType=e._R(4);e.l+=8;a.CSPName=e._R(t-e.l>>1,"utf16le");e.l=t;return a}function ll(e,r){var t={},a=e.l+r;e.l+=4;t.Salt=e.slice(e.l,e.l+16);e.l+=16;t.Verifier=e.slice(e.l,e.l+16);e.l+=16;e._R(4);t.VerifierHash=e.slice(e.l,a);e.l=a;return t}function cl(e){var r=rl(e);switch(r.Minor){case 2:return[r.Minor,hl(e,r)];case 3:return[r.Minor,ul(e,r)];case 4:return[r.Minor,dl(e,r)];}throw new Error("ECMA-376 Encrypted file unrecognized Version: "+r.Minor)}function hl(e){var r=e._R(4);if((r&63)!=36)throw new Error("EncryptionInfo mismatch");var t=e._R(4);var a=ol(e,t);var n=ll(e,e.length-e.l);return{t:"Std",h:a,v:n}}function ul(){throw new Error("File is password-protected: ECMA-376 Extensible")}function dl(e){var r=["saltSize","blockSize","keyBits","hashSize","cipherAlgorithm","cipherChaining","hashAlgorithm","saltValue"];e.l+=4;var t=e._R(e.length-e.l,"utf8");var a={};t.replace(Yr,function n(e){var t=Jr(e);switch(qr(t[0])){case"":break;case"":;case"":break;case"":break;case"4||a.Major<2)throw new Error("unrecognized major version code: "+a.Major);t.Flags=e._R(4);r-=4;var n=e._R(4);r-=4;t.EncryptionHeader=ol(e,n);r-=n;t.EncryptionVerifier=ll(e,r);return t}function vl(e){var r={};var t=r.EncryptionVersionInfo=rl(e,4);if(t.Major!=1||t.Minor!=1)throw"unrecognized version code "+t.Major+" : "+t.Minor;r.Salt=e._R(16);r.EncryptedVerifier=e._R(16);r.EncryptedVerifierHash=e._R(16);return r}function ml(e){var r=0,t;var a=el(e);var n=a.length+1,i,s;var f,o,l;t=S(n);t[0]=a.length;for(i=1;i!=n;++i)t[i]=a[i-1];for(i=n-1;i>=0;--i){s=t[i];f=(r&16384)===0?0:1;o=r<<1&32767;l=f|o;r=l^s}return r^52811}var gl=function(){var e=[187,255,255,186,255,255,185,128,0,190,15,0,191,15,0];var r=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163];var t=[44796,19929,39858,10053,20106,40212,10761,31585,63170,64933,60267,50935,40399,11199,17763,35526,1453,2906,5812,11624,23248,885,1770,3540,7080,14160,28320,56640,55369,41139,20807,41614,21821,43642,17621,28485,56970,44341,19019,38038,14605,29210,60195,50791,40175,10751,21502,43004,24537,18387,36774,3949,7898,15796,31592,63184,47201,24803,49606,37805,14203,28406,56812,17824,35648,1697,3394,6788,13576,27152,43601,17539,35078,557,1114,2228,4456,30388,60776,51953,34243,7079,14158,28316,14128,28256,56512,43425,17251,34502,7597,13105,26210,52420,35241,883,1766,3532,4129,8258,16516,33032,4657,9314,18628];var a=function(e){return(e/2|e*128)&255};var n=function(e,r){return a(e^r)};var i=function(e){var a=r[e.length-1];var n=104;for(var i=e.length-1;i>=0;--i){var s=e[i];for(var f=0;f!=7;++f){if(s&64)a^=t[n];s*=2;--n}}return a};return function(r){var t=el(r);var a=i(t);var s=t.length;var f=S(16);for(var o=0;o!=16;++o)f[o]=0;var l,c,h;if((s&1)===1){l=a>>8;f[s]=n(e[0],l);--s;l=a&255;c=t[t.length-1];f[s]=n(c,l)}while(s>0){--s;l=a>>8;f[s]=n(t[s],l);--s;l=a&255;f[s]=n(t[s],l)}s=15;h=15-t.length;while(h>0){l=a>>8;f[s]=n(e[h],l);--s;--h;l=a&255;f[s]=n(t[s],l);--s;--h}return f}}();var bl=function(e,r,t,a,n){if(!n)n=r;if(!a)a=gl(e);var i,s;for(i=0;i!=r.length;++i){s=r[i];s^=a[t];s=(s>>5|s<<3)&255;n[i]=s;++t}return[n,t,a]};var wl=function(e){var r=0,t=gl(e);return function(e){var a=bl("",e,r,t);r=a[1];return a[0]}};function kl(e,r,t,a){var n={key:os(e),verificationBytes:os(e)};if(t.password)n.verifier=ml(t.password);a.valid=n.verificationBytes===n.verifier;if(a.valid)a.insitu=wl(t.password);return n}function Al(e,r,t){var a=t||{};a.Info=e._R(2);e.l-=2;if(a.Info===1)a.Data=vl(e,r);else a.Data=pl(e,r);return a}function Tl(e,r,t){var a={Type:t.biff>=8?e._R(2):0};if(a.Type)Al(e,r-2,a);else kl(e,t.biff>=8?r:r-2,t,a);return a}function El(e,r){switch(r.type){case"base64":return yl(T(e),r);case"binary":return yl(e,r);case"buffer":return yl(E&&Buffer.isBuffer(e)?e.toString("binary"):R(e),r);case"array":return yl(Tr(e),r);}throw new Error("Unrecognized type "+r.type)}function yl(e,r){var t=r||{};var a=t.dense?[]:{};var n=e.match(/\\trowd[\s\S]*?\\row\b/g);if(!n)throw new Error("RTF missing table");var i={s:{c:0,r:0},e:{c:0,r:n.length-1}};n.forEach(function(e,r){if(Array.isArray(a))a[r]=[];var n=/\\[\w\-]+\b/g;var s=0;var f;var o=-1;var l=[];while((f=n.exec(e))!=null){var c=e.slice(s,n.lastIndex-f[0].length);if(c.charCodeAt(0)==32)c=c.slice(1);if(c.length)l.push(c);switch(f[0]){case"\\cell":++o;if(l.length){var h={v:l.join(""),t:"s"};if(h.v=="TRUE"||h.v=="FALSE"){h.v=h.v=="TRUE";h.t="b"}else if(!isNaN(Cr(h.v))){h.t="n";if(t.cellText!==false)h.w=h.v;h.v=Cr(h.v)}if(Array.isArray(a))a[r][o]=h;else a[Ma({r:r,c:o})]=h}l=[];break;case"\\par":l.push("\n");break;}s=n.lastIndex}if(o>i.e.c)i.e.c=o});a["!ref"]=Ba(i);return a}function Cl(e,r){var t=$a(El(e,r),r);t.bookType="rtf";return t}function Sl(e,r){var t=["{\\rtf1\\ansi"];if(!e["!ref"])return t[0]+"}";var a=za(e["!ref"]),n;var i=Array.isArray(e);for(var s=a.s.r;s<=a.e.r;++s){t.push("\\trowd\\trautofit1");for(var f=a.s.c;f<=a.e.c;++f)t.push("\\cellx"+(f+1));t.push("\\pard\\intbl");for(f=a.s.c;f<=a.e.c;++f){var o=Ma({r:s,c:f});n=i?(e[s]||[])[f]:e[o];if(!n||n.v==null&&(!n.f||n.F)){t.push(" \\cell");continue}t.push(" "+(n.w||(Ga(n),n.w)||"").replace(/[\r\n]/g,"\\par "));t.push("\\cell")}t.push("\\pard\\intbl\\row")}return t.join("")+"}"}function _l(e){var r=e.slice(e[0]==="#"?1:0).slice(0,6);return[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16)]}function xl(e){for(var r=0,t=1;r!=3;++r)t=t*256+(e[r]>255?255:e[r]<0?0:e[r]);return t.toString(16).toUpperCase().slice(1)}function Ol(e){var r=e[0]/255,t=e[1]/255,a=e[2]/255;var n=Math.max(r,t,a),i=Math.min(r,t,a),s=n-i;if(s===0)return[0,0,r];var f=0,o=0,l=n+i;o=s/(l>1?2-l:l);switch(n){case r:f=((t-a)/s+6)%6;break;case t:f=(a-r)/s+2;break;case a:f=(r-t)/s+4;break;}return[f/6,o,l/2]}function Rl(e){var r=e[0],t=e[1],a=e[2];var n=t*2*(a<.5?a:1-a),i=a-n/2;var s=[i,i,i],f=6*r;var o;if(t!==0)switch(f|0){case 0:;case 6:o=n*f;s[0]+=n;s[1]+=o;break;case 1:o=n*(2-f);s[0]+=o;s[1]+=n;break;case 2:o=n*(f-2);s[1]+=n;s[2]+=o;break;case 3:o=n*(4-f);s[1]+=o;s[2]+=n;break;case 4:o=n*(f-4);s[2]+=n;s[0]+=o;break;case 5:o=n*(6-f);s[2]+=o;s[0]+=n;break;}for(var l=0;l!=3;++l)s[l]=Math.round(s[l]*255);return s}function Nl(e,r){if(r===0)return e;var t=Ol(_l(e));if(r<0)t[2]=t[2]*(1+r);else t[2]=1-(1-t[2])*(1-r);return xl(Rl(t))}var Il=6,Fl=15,Dl=1,Pl=Il;function Ll(e){return Math.floor((e+Math.round(128/Pl)/256)*Pl)}function Ml(e){return Math.floor((e-5)/Pl*100+.5)/100}function Ul(e){return Math.round((e*Pl+5)/Pl*256)/256}function Bl(e){return Ul(Ml(Ll(e)))}function Wl(e){var r=Math.abs(e-Bl(e)),t=Pl;if(r>.005)for(Pl=Dl;Pl":;case"":break;case"":;case"":n={};if(t.diagonalUp)n.diagonalUp=ht(t.diagonalUp);if(t.diagonalDown)n.diagonalDown=ht(t.diagonalDown);r.Borders.push(n);break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":;case"":break;case"":break;case"":;case"":break;case"":break;case"":;case"":break;case"":break;case"":;case"":break;case"":break;case"":;case"":break;case"":break;case"":break;case"":;case"":break;case"":;case"":break;case"":i=false;break;default:if(a&&a.WTF){if(!i)throw new Error("unrecognized "+t[0]+" in borders")};}})}function Yl(e,r,t,a){r.Fills=[];var n={};var i=false;(e[0].match(Yr)||[]).forEach(function(e){var t=Jr(e);switch(qr(t[0])){case"":;case"":break;case"":;case"":n={};r.Fills.push(n);break;case"":break;case"":break;case"":r.Fills.push(n);n={};break;case"":if(t.patternType)n.patternType=t.patternType;break;case"":;case"":break;case"":;case"":break;case"":;case"":break;case"":break;case"":break;case"":break;case"":break;case"":;case"":break;case"":i=false;break;default:if(a&&a.WTF){if(!i)throw new Error("unrecognized "+t[0]+" in fills")};}})}function Kl(e,r,t,a){r.Fonts=[];var n={};var s=false;(e[0].match(Yr)||[]).forEach(function(e){var f=Jr(e);switch(qr(f[0])){case"":;case"":break;case"":break;case"":;case"":r.Fonts.push(n);n={};break;case"":;case"":break;case"":n.bold=1;break;case"":n.italic=1;break;case"":n.underline=1;break;case"":n.strike=1;break;case"":n.outline=1;break;case"":n.shadow=1;break;case"":n.condense=1;break;case"":n.extend=1;break;case"":;case"":break;case"":;case"":break;case"":;case"":break;case"":;case"":break;case"":;case"":break;case"":s=false;break;case"":;case"":break;case"":s=false;break;default:if(a&&a.WTF){if(!s)throw new Error("unrecognized "+f[0]+" in fonts")};}})}function Zl(e,r,t){r.NumberFmt=[];var a=sr(Z);for(var n=0;n":;case"":;case"":break;case"0){if(o>392){for(o=392;o>60;--o)if(r.NumberFmt[o]==null)break;r.NumberFmt[o]=f}qe(f,o)}}break;case"":break;default:if(t.WTF)throw new Error("unrecognized "+s[0]+" in numFmts");}}}function Jl(e){var r=[""];[[5,8],[23,26],[41,44],[50,392]].forEach(function(t){for(var a=t[0];a<=t[1];++a)if(e[a]!=null)r[r.length]=_t("numFmt",null,{numFmtId:a,formatCode:nt(e[a])})});if(r.length===1)return"";r[r.length]="";r[0]=_t("numFmts",null,{count:r.length-2}).replace("/>",">");return r.join("")}var ql=["numFmtId","fillId","fontId","borderId","xfId"];var Ql=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"];function ec(e,r,t){r.CellXf=[];var a;var n=false;(e[0].match(Yr)||[]).forEach(function(e){var i=Jr(e),s=0;switch(qr(i[0])){case"":;case"":;case"":break;case"":a=i;delete a[0];for(s=0;s392){for(s=392;s>60;--s)if(r.NumberFmt[a.numFmtId]==r.NumberFmt[s]){a.numFmtId=s;break}}r.CellXf.push(a);break;case"":break;case"":var f={};if(i.vertical)f.vertical=i.vertical;if(i.horizontal)f.horizontal=i.horizontal;if(i.textRotation!=null)f.textRotation=i.textRotation;if(i.indent)f.indent=i.indent;if(i.wrapText)f.wrapText=ht(i.wrapText);a.alignment=f;break;case"":break;case"":;case"":break;case"":n=false;break;case"":;case"":break;case"":n=false;break;default:if(t&&t.WTF){if(!n)throw new Error("unrecognized "+i[0]+" in cellXfs")};}})}function rc(e){var r=[];r[r.length]=_t("cellXfs",null);e.forEach(function(e){r[r.length]=_t("xf",null,e)});r[r.length]="";if(r.length===2)return"";r[0]=_t("cellXfs",null,{count:r.length-2}).replace("/>",">");return r.join("")}var tc=function Vk(){var e=/<(?:\w+:)?numFmts([^>]*)>[\S\s]*?<\/(?:\w+:)?numFmts>/;var r=/<(?:\w+:)?cellXfs([^>]*)>[\S\s]*?<\/(?:\w+:)?cellXfs>/;var t=/<(?:\w+:)?fills([^>]*)>[\S\s]*?<\/(?:\w+:)?fills>/;var a=/<(?:\w+:)?fonts([^>]*)>[\S\s]*?<\/(?:\w+:)?fonts>/;var n=/<(?:\w+:)?borders([^>]*)>[\S\s]*?<\/(?:\w+:)?borders>/;return function i(s,f,o){var l={};if(!s)return l;s=s.replace(//gm,"").replace(//gm,"");var c;if(c=s.match(e))Zl(c,l,o);if(c=s.match(a))Kl(c,l,f,o);if(c=s.match(t))Yl(c,l,f,o);if(c=s.match(n))Xl(c,l,f,o);if(c=s.match(r))ec(c,l,o);return l}}();function ac(e,r){var t=[Gr,_t("styleSheet",null,{xmlns:Ft[0],"xmlns:vt":It.vt})],a;if(e.SSF&&(a=Jl(e.SSF))!=null)t[t.length]=a;t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';if(a=rc(r.cellXfs))t[t.length]=a;t[t.length]='';t[t.length]='';t[t.length]='';if(t.length>2){t[t.length]="";t[1]=t[1].replace("/>",">")}return t.join("")}function nc(e,r){var t=e._R(2);var a=Za(e,r-2);return[t,a]}function ic(e,r,t){if(!t)t=wa(6+4*r.length);t._W(2,e);Ja(r,t);var a=t.length>t.l?t.slice(0,t.l):t;if(t.l==null)t.l=t.length;return a}function sc(e,r,t){var a={};a.sz=e._R(2)/20;var n=Sn(e,2,t);if(n.fItalic)a.italic=1;if(n.fCondense)a.condense=1;if(n.fExtend)a.extend=1;if(n.fShadow)a.shadow=1;if(n.fOutline)a.outline=1;if(n.fStrikeout)a.strike=1;var i=e._R(2);if(i===700)a.bold=1;switch(e._R(2)){case 1:a.vertAlign="superscript";break;case 2:a.vertAlign="subscript";break;}var s=e._R(1);if(s!=0)a.underline=s;var f=e._R(1);if(f>0)a.family=f;var o=e._R(1);if(o>0)a.charset=o;e.l++;a.color=yn(e,8);switch(e._R(1)){case 1:a.scheme="major";break;case 2:a.scheme="minor";break;}a.name=Za(e,r-21);return a}function fc(e,r){if(!r)r=wa(25+4*32);r._W(2,e.sz*20);_n(e,r);r._W(2,e.bold?700:400);var t=0;if(e.vertAlign=="superscript")t=1;else if(e.vertAlign=="subscript")t=2;r._W(2,t);r._W(1,e.underline||0);r._W(1,e.family||0);r._W(1,e.charset||0);r._W(1,0);Cn(e.color,r);var a=0;if(e.scheme=="major")a=1;if(e.scheme=="minor")a=2;r._W(1,a);Ja(e.name,r);return r.length>r.l?r.slice(0,r.l):r}var oc=["none","solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"];var lc;var cc=ba;function hc(e,r){if(!r)r=wa(4*3+8*7+16*1);if(!lc)lc=or(oc);var t=lc[e.patternType];if(t==null)t=40;r._W(4,t);var a=0;if(t!=40){Cn({auto:1},r);Cn({auto:1},r);for(;a<12;++a)r._W(4,0)}else{for(;a<4;++a)r._W(4,0);for(;a<12;++a)r._W(4,0)}return r.length>r.l?r.slice(0,r.l):r}function uc(e,r){var t=e.l+r;var a=e._R(2);var n=e._R(2);e.l=t;return{ixfe:a,numFmtId:n}}function dc(e,r,t){if(!t)t=wa(16);t._W(2,r||0);t._W(2,e.numFmtId||0);t._W(2,0);t._W(2,0);
+t._W(2,0);t._W(1,0);t._W(1,0);var a=0;t._W(1,a);t._W(1,0);t._W(1,0);t._W(1,0);return t}function pc(e,r){if(!r)r=wa(10);r._W(1,0);r._W(1,0);r._W(4,0);r._W(4,0);return r}var vc=ba;function mc(e,r){if(!r)r=wa(51);r._W(1,0);pc(null,r);pc(null,r);pc(null,r);pc(null,r);pc(null,r);return r.length>r.l?r.slice(0,r.l):r}function gc(e,r){if(!r)r=wa(12+4*10);r._W(4,e.xfId);r._W(2,1);r._W(1,+e.builtinId);r._W(1,0);un(e.name||"",r);return r.length>r.l?r.slice(0,r.l):r}function bc(e,r,t){var a=wa(4+256*2*4);a._W(4,e);un(r,a);un(t,a);return a.length>a.l?a.slice(0,a.l):a}function wc(e,r,t){var a={};a.NumberFmt=[];for(var n in Z)a.NumberFmt[n]=Z[n];a.CellXf=[];a.Fonts=[];var i=[];var s=false;ka(e,function f(e,n,o){switch(o){case 44:a.NumberFmt[e[0]]=e[1];qe(e[1],e[0]);break;case 43:a.Fonts.push(e);if(e.color.theme!=null&&r&&r.themeElements&&r.themeElements.clrScheme){e.color.rgb=Nl(r.themeElements.clrScheme[e.color.theme].rgb,e.color.tint||0)}break;case 1025:break;case 45:break;case 46:break;case 47:if(i[i.length-1]==617){a.CellXf.push(e)}break;case 48:;case 507:;case 572:;case 475:break;case 1171:;case 2102:;case 1130:;case 512:;case 2095:;case 3072:break;case 35:s=true;break;case 36:s=false;break;case 37:i.push(o);s=true;break;case 38:i.pop();s=false;break;default:if(n.T>0)i.push(o);else if(n.T<0)i.pop();else if(!s||t.WTF&&i[i.length-1]!=37)throw new Error("Unexpected record 0x"+o.toString(16));}});return a}function kc(e,r){if(!r)return;var t=0;[[5,8],[23,26],[41,44],[50,392]].forEach(function(e){for(var a=e[0];a<=e[1];++a)if(r[a]!=null)++t});if(t==0)return;Ta(e,615,Ka(t));[[5,8],[23,26],[41,44],[50,392]].forEach(function(t){for(var a=t[0];a<=t[1];++a)if(r[a]!=null)Ta(e,44,ic(a,r[a]))});Ta(e,616)}function Ac(e){var r=1;if(r==0)return;Ta(e,611,Ka(r));Ta(e,43,fc({sz:12,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}));Ta(e,612)}function Tc(e){var r=2;if(r==0)return;Ta(e,603,Ka(r));Ta(e,45,hc({patternType:"none"}));Ta(e,45,hc({patternType:"gray125"}));Ta(e,604)}function Ec(e){var r=1;if(r==0)return;Ta(e,613,Ka(r));Ta(e,46,mc({}));Ta(e,614)}function yc(e){var r=1;Ta(e,626,Ka(r));Ta(e,47,dc({numFmtId:0,fontId:0,fillId:0,borderId:0},65535));Ta(e,627)}function Cc(e,r){Ta(e,617,Ka(r.length));r.forEach(function(r){Ta(e,47,dc(r,0))});Ta(e,618)}function Sc(e){var r=1;Ta(e,619,Ka(r));Ta(e,48,gc({xfId:0,builtinId:0,name:"Normal"}));Ta(e,620)}function _c(e){var r=0;Ta(e,505,Ka(r));Ta(e,506)}function xc(e){var r=0;Ta(e,508,bc(r,"TableStyleMedium9","PivotStyleMedium4"));Ta(e,509)}function Oc(){return}function Rc(e,r){var t=Aa();Ta(t,278);kc(t,e.SSF);Ac(t,e);Tc(t,e);Ec(t,e);yc(t,e);Cc(t,r.cellXfs);Sc(t,e);_c(t,e);xc(t,e);Oc(t,e);Ta(t,279);return t.end()}var Nc=["","","","","","","","","","","",""];function Ic(e,r,t){r.themeElements.clrScheme=[];var a={};(e[0].match(Yr)||[]).forEach(function(e){var n=Jr(e);switch(n[0]){case"":break;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":;case"":if(n[0].charAt(1)==="/"){r.themeElements.clrScheme[Nc.indexOf(n[0])]=a;a={}}else{a.name=n[0].slice(3,n[0].length-1)}break;default:if(t&&t.WTF)throw new Error("Unrecognized "+n[0]+" in clrScheme");}})}function Fc(){}function Dc(){}var Pc=/]*)>[\s\S]*<\/a:clrScheme>/;var Lc=/]*)>[\s\S]*<\/a:fontScheme>/;var Mc=/]*)>[\s\S]*<\/a:fmtScheme>/;function Uc(e,r,t){r.themeElements={};var a;[["clrScheme",Pc,Ic],["fontScheme",Lc,Fc],["fmtScheme",Mc,Dc]].forEach(function(n){if(!(a=e.match(n[1])))throw new Error(n[0]+" not found in themeElements");n[2](a,r,t)})}var Bc=/]*)>[\s\S]*<\/a:themeElements>/;function Wc(e,r){if(!e||e.length===0)e=Hc();var t;var a={};if(!(t=e.match(Bc)))throw new Error("themeElements not found in theme");Uc(t[0],a,r);a.raw=e;return a}function Hc(e,r){if(r&&r.themeXLSX)return r.themeXLSX;if(e&&typeof e.raw=="string")return e.raw;var t=[Gr];t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]='';t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]='';t[t.length]="";t[t.length]="";t[t.length]="";t[t.length]="";return t.join("")}function zc(e,r,t){var a=e.l+r;var n=e._R(4);if(n===124226)return;if(!t.cellStyles){e.l=a;return}var i=e.slice(e.l);e.l=a;var s;try{s=zr(i,{type:"array"})}catch(f){return}var o=Mr(s,"theme/theme/theme1.xml",true);if(!o)return;return Wc(o,t)}function Vc(e){return e._R(4)}function Gc(e){var r={};r.xclrType=e._R(2);r.nTintShade=e._R(2);switch(r.xclrType){case 0:e.l+=4;break;case 1:r.xclrValue=$c(e,4);break;case 2:r.xclrValue=xs(e,4);break;case 3:r.xclrValue=Vc(e,4);break;case 4:e.l+=4;break;}e.l+=8;return r}function $c(e,r){return ba(e,r)}function jc(e,r){return ba(e,r)}function Xc(e){var r=e._R(2);var t=e._R(2)-4;var a=[r];switch(r){case 4:;case 5:;case 7:;case 8:;case 9:;case 10:;case 11:;case 13:a[1]=Gc(e,t);break;case 6:a[1]=jc(e,t);break;case 14:;case 15:a[1]=e._R(t===1?1:2);break;default:throw new Error("Unrecognized ExtProp type: "+r+" "+t);}return a}function Yc(e,r){var t=e.l+r;e.l+=2;var a=e._R(2);e.l+=2;var n=e._R(2);var i=[];while(n-- >0)i.push(Xc(e,t-e.l));return{ixfe:a,ext:i}}function Kc(e,r){r.forEach(function(e){switch(e[0]){case 4:break;case 5:break;case 6:break;case 7:break;case 8:break;case 9:break;case 10:break;case 11:break;case 13:break;case 14:break;case 15:break;}})}function Zc(e,r){return{flags:e._R(4),version:e._R(4),name:Za(e,r-8)}}function Jc(e){var r=wa(12+2*e.name.length);r._W(4,e.flags);r._W(4,e.version);Ja(e.name,r);return r.slice(0,r.l)}function qc(e){var r=[];var t=e._R(4);while(t-- >0)r.push([e._R(4),e._R(4)]);return r}function Qc(e){var r=wa(4+8*e.length);r._W(4,e.length);for(var t=0;t":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":i=2;break;case"":i=2;break;case"":;case"":;case"":break;case"":n=false;break;case"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n');return e.join("")}function fh(e){var r=[];if(!e)return r;var t=1;(e.match(Yr)||[]).forEach(function(e){var a=Jr(e);switch(a[0]){case"":;case"":break;case"]*r:id="([^"]*)"/)||["",""])[1];return r["!id"][t].Target}function dh(e,r){var t=[21600,21600];var a=["m0,0l0",t[1],t[0],t[1],t[0],"0xe"].join(",");var n=[_t("xml",null,{"xmlns:v":Dt.v,"xmlns:o":Dt.o,"xmlns:x":Dt.x,"xmlns:mv":Dt.mv}).replace(/\/>/,">"),_t("o:shapelayout",_t("o:idmap",null,{"v:ext":"edit",data:e}),{"v:ext":"edit"})];var i=65536*e;var s=r||[];if(s.length>0)n.push(_t("v:shapetype",[_t("v:stroke",null,{joinstyle:"miter"}),_t("v:path",null,{gradientshapeok:"t","o:connecttype":"rect"})].join(""),{id:"_x0000_t202",coordsize:t.join(","),"o:spt":202,path:a}));s.forEach(function(e){++i;n.push(ph(e,i))});n.push("");return n.join("")}function ph(e,r){var t=La(e[0]);var a={color2:"#BEFF82",type:"gradient"};if(a.type=="gradient")a.angle="-180";var n=a.type=="gradient"?_t("o:fill",null,{type:"gradientUnscaled","v:ext":"view"}):null;var i=_t("v:fill",n,a);var s={on:"t",obscured:"t"};return["",i,_t("v:shadow",null,s),_t("v:path",null,{"o:connecttype":"none"}),'','',"","",Ct("x:Anchor",[t.c+1,0,t.r+1,0,t.c+3,20,t.r+5,20].join(",")),Ct("x:AutoFill","False"),Ct("x:Row",String(t.r)),Ct("x:Column",String(t.c)),e[1].hidden?"":"","",""].join("")}function vh(e,r,t,a){var n=Array.isArray(e);var i;r.forEach(function(r){var s=La(r.ref);if(n){if(!e[s.r])e[s.r]=[];i=e[s.r][s.c]}else i=e[r.ref];if(!i){i={t:"z"};if(n)e[s.r][s.c]=i;else e[r.ref]=i;var f=za(e["!ref"]||"BDWGO1000001:A1");if(f.s.r>s.r)f.s.r=s.r;if(f.e.rs.c)f.s.c=s.c;if(f.e.c=0;--c){if(!t&&i.c[c].T)return;if(t&&!i.c[c].T)i.c.splice(c,1)}if(t&&a)for(c=0;c/))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=Jr(n[0]);var s={author:i.authorId&&t[i.authorId]||"sheetjsghost",ref:i.ref,guid:i.guid};var f=La(i.ref);if(r.sheetRows&&r.sheetRows<=f.r)return;var o=e.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/);var l=!!o&&!!o[1]&&zo(o[1])||{r:"",t:"",h:""};s.r=l.r;if(l.r=="")l.t=l.h="";s.t=(l.t||"").replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(r.cellHTML)s.h=l.h;a.push(s)});return a}function gh(e){var r=[Gr,_t("comments",null,{xmlns:Ft[0]})];var t=[];r.push("");e.forEach(function(e){e[1].forEach(function(e){var a=nt(e.a);if(t.indexOf(a)==-1){t.push(a);r.push(""+a+"")}if(e.T&&e.ID&&t.indexOf("tc="+e.ID)==-1){t.push("tc="+e.ID);r.push(""+"tc="+e.ID+"")}})});if(t.length==0){t.push("SheetJ5");r.push("SheetJ5")}r.push("");r.push("");e.forEach(function(e){var a=0,n=[],i=0;if(e[1][0]&&e[1][0].T&&e[1][0].ID)a=t.indexOf("tc="+e[1][0].ID);e[1].forEach(function(e){if(e.a)a=t.indexOf(nt(e.a));if(e.T)++i;n.push(e.t==null?"":nt(e.t))});if(i===0){e[1].forEach(function(a){r.push('');r.push(Ct("t",a.t==null?"":nt(a.t)));r.push("")})}else{r.push('');var s="Comment:\n "+n[0]+"\n";for(var f=1;f")}});r.push("");if(r.length>2){r[r.length]="";r[1]=r[1].replace("/>",">")}return r.join("")}function bh(e,r){var t=[];var a=false,n={},i=0;e.replace(Yr,function s(f,o){var l=Jr(f);switch(qr(l[0])){case"":break;case"":if(n.t!=null)t.push(n);break;case"":;case"":n.t=e.slice(i,o).replace(/\r\n/g,"\n").replace(/\r/g,"\n");break;case"":a=true;break;case"":a=false;break;case"":;case"":;case"":break;case"":a=false;break;default:if(!a&&r.WTF)throw new Error("unrecognized "+l[0]+" in threaded comments");}return f});return t}function wh(e,r,t){var a=[Gr,_t("ThreadedComments",null,{xmlns:It.TCMNT}).replace(/[\/]>/,">")];e.forEach(function(e){var n="";(e[1]||[]).forEach(function(i,s){if(!i.T){delete i.ID;return}if(i.a&&r.indexOf(i.a)==-1)r.push(i.a);var f={ref:e[0],id:"{54EE7951-7262-4200-6969-"+("000000000000"+t.tcid++).slice(-12)+"}"};if(s==0)n=f.id;else f.parentId=n;i.ID=f.id;if(i.a)f.personId="{54EE7950-7262-4200-6969-"+("000000000000"+r.indexOf(i.a)).slice(-12)+"}";a.push(_t("threadedComment",Ct("text",i.t||""),f))})});a.push("");return a.join("")}function kh(e,r){var t=[];var a=false;e.replace(Yr,function n(e){var n=Jr(e);switch(qr(n[0])){case"":break;case"":break;case"":;case"":;case"":break;case"":a=false;break;default:if(!a&&r.WTF)throw new Error("unrecognized "+n[0]+" in threaded comments");}return e});return t}function Ah(e){var r=[Gr,_t("personList",null,{xmlns:It.TCMNT,"xmlns:x":Ft[0]}).replace(/[\/]>/,">")];e.forEach(function(e,t){r.push(_t("person",null,{displayName:e,id:"{54EE7950-7262-4200-6969-"+("000000000000"+t).slice(-12)+"}",userId:e,providerId:"None"}))});r.push("");return r.join("")}function Th(e){var r={};r.iauthor=e._R(4);var t=kn(e,16);r.rfx=t.s;r.ref=Ma(t.s);e.l+=16;return r}function Eh(e,r){if(r==null)r=wa(36);r._W(4,e[1].iauthor);An(e[0],r);r._W(4,0);r._W(4,0);r._W(4,0);r._W(4,0);return r}var yh=Za;function Ch(e){return Ja(e.slice(0,54))}function Sh(e,r){var t=[];var a=[];var n={};var i=false;ka(e,function s(e,f,o){switch(o){case 632:a.push(e);break;case 635:n=e;break;case 637:n.t=e.t;n.h=e.h;n.r=e.r;break;case 636:n.author=a[n.iauthor];delete n.iauthor;if(r.sheetRows&&n.rfx&&r.sheetRows<=n.rfx.r)break;if(!n.t)n.t="";delete n.rfx;t.push(n);break;case 3072:break;case 35:i=true;break;case 36:i=false;break;case 37:break;case 38:break;default:if(f.T){}else if(!i||r.WTF)throw new Error("Unexpected record 0x"+o.toString(16));}});return t}function _h(e){var r=Aa();var t=[];Ta(r,628);Ta(r,630);e.forEach(function(e){e[1].forEach(function(e){if(t.indexOf(e.a)>-1)return;t.push(e.a.slice(0,54));Ta(r,632,Ch(e.a))})});Ta(r,631);Ta(r,633);e.forEach(function(e){e[1].forEach(function(a){a.iauthor=t.indexOf(a.a);var n={s:La(e[0]),e:La(e[0])};Ta(r,635,Eh([n,a]));if(a.t&&a.t.length>0)Ta(r,637,an(a));Ta(r,636);delete a.iauthor})});Ta(r,634);Ta(r,629);return r.end()}var xh="application/vnd.ms-office.vbaProject";function Oh(e){var r=er.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*/,"");er.utils.cfb_add(r,n,e.FileIndex[a].content)});return er.write(r)}function Rh(e,r){r.FullPaths.forEach(function(t,a){if(a==0)return;var n=t.replace(/[^\/]*[\/]/,"/_VBA_PROJECT_CUR/");if(n.slice(-1)!=="/")er.utils.cfb_add(e,n,r.FileIndex[a].content)})}var Nh=["xlsb","xlsm","xlam","biff8","xla"];function Ih(){return{"!type":"dialog"}}function Fh(){return{"!type":"dialog"}}function Dh(){return{"!type":"macro"}}function Ph(){return{"!type":"macro"}}var Lh=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 f=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)f+=r.r;else--f;return t+(i?"":"$")+Ia(o)+(s?"":"$")+xa(f)}return function a(n,i){r=i;return n.replace(e,t)}}();var Mh=/(^|[^._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 Uh=function(){return function e(r,t){return r.replace(Mh,function(e,r,a,n,i,s){var f=Na(n)-(a?0:t.c);var o=_a(s)-(i?0:t.r);var l=i=="$"?o+1:o==0?"":"["+o+"]";var c=a=="$"?f+1:f==0?"":"["+f+"]";return r+"R"+l+"C"+c})}}();function Bh(e,r){return e.replace(Mh,function(e,t,a,n,i,s){return t+(a=="$"?a+n:Ia(Na(n)+r.c))+(i=="$"?i+s:xa(_a(s)+r.r))})}function Wh(e,r,t){var a=Ua(r),n=a.s,i=La(t);var s={r:i.r-n.r,c:i.c-n.c};return Bh(e,s)}function Hh(e){if(e.length==1)return false;return true}function zh(e){return e.replace(/_xlfn\./g,"")}function Vh(e){e.l+=1;return}function Gh(e,r){var t=e._R(r==1?1:2);return[t&16383,t>>14&1,t>>15&1]}function $h(e,r,t){var a=2;if(t){if(t.biff>=2&&t.biff<=5)return jh(e,r,t);else if(t.biff==12)a=4}var n=e._R(a),i=e._R(a);var s=Gh(e,2);var f=Gh(e,2);return{s:{r:n,c:s[0],cRel:s[1],rRel:s[2]},e:{r:i,c:f[0],cRel:f[1],rRel:f[2]}}}function jh(e){var r=Gh(e,2),t=Gh(e,2);var a=e._R(1);var n=e._R(1);return{s:{r:r[0],c:a,cRel:r[1],rRel:r[2]},e:{r:t[0],c:n,cRel:t[1],rRel:t[2]}}}function Xh(e,r,t){if(t.biff<8)return jh(e,r,t);var a=e._R(t.biff==12?4:2),n=e._R(t.biff==12?4:2);var i=Gh(e,2);var s=Gh(e,2);return{s:{r:a,c:i[0],cRel:i[1],rRel:i[2]},e:{r:n,c:s[0],cRel:s[1],rRel:s[2]}}}function Yh(e,r,t){if(t&&t.biff>=2&&t.biff<=5)return Kh(e,r,t);var a=e._R(t&&t.biff==12?4:2);var n=Gh(e,2);return{r:a,c:n[0],cRel:n[1],rRel:n[2]}}function Kh(e){var r=Gh(e,2);var t=e._R(1);return{r:r[0],c:t,cRel:r[1],rRel:r[2]}}function Zh(e){var r=e._R(2);var t=e._R(2);return{r:r,c:t&255,fQuoted:!!(t&16384),cRel:t>>15,rRel:t>>15}}function Jh(e,r,t){var a=t&&t.biff?t.biff:8;if(a>=2&&a<=5)return qh(e,r,t);var n=e._R(a>=12?4:2);var i=e._R(2);var s=(i&16384)>>14,f=(i&32768)>>15;i&=16383;if(f==1)while(n>524287)n-=1048576;if(s==1)while(i>8191)i=i-16384;return{r:n,c:i,cRel:s,rRel:f}}function qh(e){var r=e._R(2);var t=e._R(1);var a=(r&32768)>>15,n=(r&16384)>>14;r&=16383;if(a==1&&r>=8192)r=r-16384;if(n==1&&t>=128)t=t-256;return{r:r,c:t,cRel:n,rRel:a}}function Qh(e,r,t){var a=(e[e.l++]&96)>>5;var n=$h(e,t.biff>=2&&t.biff<=5?6:8,t);return[a,n]}function eu(e,r,t){var a=(e[e.l++]&96)>>5;var n=e._R(2,"i");var i=8;if(t)switch(t.biff){case 5:e.l+=12;i=6;break;case 12:i=12;break;}var s=$h(e,i,t);return[a,n,s]}function ru(e,r,t){var a=(e[e.l++]&96)>>5;e.l+=t&&t.biff>8?12:t.biff<8?6:8;return[a]}function tu(e,r,t){var a=(e[e.l++]&96)>>5;var n=e._R(2);
+var i=8;if(t)switch(t.biff){case 5:e.l+=12;i=6;break;case 12:i=12;break;}e.l+=i;return[a,n]}function au(e,r,t){var a=(e[e.l++]&96)>>5;var n=Xh(e,r-1,t);return[a,n]}function nu(e,r,t){var a=(e[e.l++]&96)>>5;e.l+=t.biff==2?6:t.biff==12?14:7;return[a]}function iu(e){var r=e[e.l+1]&1;var t=1;e.l+=4;return[r,t]}function su(e,r,t){e.l+=2;var a=e._R(t&&t.biff==2?1:2);var n=[];for(var i=0;i<=a;++i)n.push(e._R(t&&t.biff==2?1:2));return n}function fu(e,r,t){var a=e[e.l+1]&255?1:0;e.l+=2;return[a,e._R(t&&t.biff==2?1:2)]}function ou(e,r,t){var a=e[e.l+1]&255?1:0;e.l+=2;return[a,e._R(t&&t.biff==2?1:2)]}function lu(e){var r=e[e.l+1]&255?1:0;e.l+=2;return[r,e._R(2)]}function cu(e,r,t){var a=e[e.l+1]&255?1:0;e.l+=t&&t.biff==2?3:4;return[a]}function hu(e){var r=e._R(1),t=e._R(1);return[r,t]}function uu(e){e._R(2);return hu(e,2)}function du(e){e._R(2);return hu(e,2)}function pu(e,r,t){var a=(e[e.l]&96)>>5;e.l+=1;var n=Yh(e,0,t);return[a,n]}function vu(e,r,t){var a=(e[e.l]&96)>>5;e.l+=1;var n=Jh(e,0,t);return[a,n]}function mu(e,r,t){var a=(e[e.l]&96)>>5;e.l+=1;var n=e._R(2);if(t&&t.biff==5)e.l+=12;var i=Yh(e,0,t);return[a,n,i]}function gu(e,r,t){var a=(e[e.l]&96)>>5;e.l+=1;var n=e._R(t&&t.biff<=3?1:2);return[$d[n],Gd[n],a]}function bu(e,r,t){var a=e[e.l++];var n=e._R(1),i=t&&t.biff<=3?[a==88?-1:0,e._R(1)]:wu(e);return[n,(i[0]===0?Gd:Vd)[i[1]]]}function wu(e){return[e[e.l+1]>>7,e._R(2)&32767]}function ku(e,r,t){e.l+=t&&t.biff==2?3:4;return}function Au(e,r,t){e.l++;if(t&&t.biff==12)return[e._R(4,"i"),0];var a=e._R(2);var n=e._R(t&&t.biff==2?1:2);return[a,n]}function Tu(e){e.l++;return Jn[e._R(1)]}function Eu(e){e.l++;return e._R(2)}function yu(e){e.l++;return e._R(1)!==0}function Cu(e){e.l++;return Tn(e,8)}function Su(e,r,t){e.l++;return ds(e,r-1,t)}function _u(e,r){var t=[e._R(1)];if(r==12)switch(t[0]){case 2:t[0]=4;break;case 4:t[0]=16;break;case 0:t[0]=1;break;case 1:t[0]=2;break;}switch(t[0]){case 4:t[1]=ss(e,1)?"TRUE":"FALSE";if(r!=12)e.l+=7;break;case 37:;case 16:t[1]=Jn[e[e.l]];e.l+=r==12?4:8;break;case 0:e.l+=8;break;case 1:t[1]=Tn(e,8);break;case 2:t[1]=bs(e,0,{biff:r>0&&r<8?2:r});break;default:throw new Error("Bad SerAr: "+t[0]);}return t}function xu(e,r,t){var a=e._R(t.biff==12?4:2);var n=[];for(var i=0;i!=a;++i)n.push((t.biff==12?kn:Ms)(e,8));return n}function Ou(e,r,t){var a=0,n=0;if(t.biff==12){a=e._R(4);n=e._R(4)}else{n=1+e._R(1);a=1+e._R(2)}if(t.biff>=2&&t.biff<8){--a;if(--n==0)n=256}for(var i=0,s=[];i!=a&&(s[i]=[]);++i)for(var f=0;f!=n;++f)s[i][f]=_u(e,t.biff);return s}function Ru(e,r,t){var a=e._R(1)>>>5&3;var n=!t||t.biff>=8?4:2;var i=e._R(n);switch(t.biff){case 2:e.l+=5;break;case 3:;case 4:e.l+=8;break;case 5:e.l+=12;break;}return[a,0,i]}function Nu(e,r,t){if(t.biff==5)return Iu(e,r,t);var a=e._R(1)>>>5&3;var n=e._R(2);var i=e._R(4);return[a,n,i]}function Iu(e){var r=e._R(1)>>>5&3;var t=e._R(2,"i");e.l+=8;var a=e._R(2);e.l+=12;return[r,t,a]}function Fu(e,r,t){var a=e._R(1)>>>5&3;e.l+=t&&t.biff==2?3:4;var n=e._R(t&&t.biff==2?1:2);return[a,n]}function Du(e,r,t){var a=e._R(1)>>>5&3;var n=e._R(t&&t.biff==2?1:2);return[a,n]}function Pu(e,r,t){var a=e._R(1)>>>5&3;e.l+=4;if(t.biff<8)e.l--;if(t.biff==12)e.l+=2;return[a]}function Lu(e,r,t){var a=(e[e.l++]&96)>>5;var n=e._R(2);var i=4;if(t)switch(t.biff){case 5:i=15;break;case 12:i=6;break;}e.l+=i;return[a,n]}var Mu=ba;var Uu=ba;var Bu=ba;function Wu(e,r,t){e.l+=2;return[Zh(e,4,t)]}function Hu(e){e.l+=6;return[]}var zu=Wu;var Vu=Hu;var Gu=Hu;var $u=Wu;function ju(e){e.l+=2;return[os(e),e._R(2)&1]}var Xu=Wu;var Yu=ju;var Ku=Hu;var Zu=Wu;var Ju=Wu;var qu=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function Qu(e){e.l+=2;var r=e._R(2);var t=e._R(2);var a=e._R(4);var n=e._R(2);var i=e._R(2);var s=qu[t>>2&31];return{ixti:r,coltype:t&3,rt:s,idx:a,c:n,C:i}}function ed(e){e.l+=2;return[e._R(4)]}function rd(e,r,t){e.l+=5;e.l+=2;e.l+=t.biff==2?1:4;return["PTGSHEET"]}function td(e,r,t){e.l+=t.biff==2?4:5;return["PTGENDSHEET"]}function ad(e){var r=e._R(1)>>>5&3;var t=e._R(2);return[r,t]}function nd(e){var r=e._R(1)>>>5&3;var t=e._R(2);return[r,t]}function id(e){e.l+=4;return[0,0]}var sd={1:{n:"PtgExp",f:Au},2:{n:"PtgTbl",f:Bu},3:{n:"PtgAdd",f:Vh},4:{n:"PtgSub",f:Vh},5:{n:"PtgMul",f:Vh},6:{n:"PtgDiv",f:Vh},7:{n:"PtgPower",f:Vh},8:{n:"PtgConcat",f:Vh},9:{n:"PtgLt",f:Vh},10:{n:"PtgLe",f:Vh},11:{n:"PtgEq",f:Vh},12:{n:"PtgGe",f:Vh},13:{n:"PtgGt",f:Vh},14:{n:"PtgNe",f:Vh},15:{n:"PtgIsect",f:Vh},16:{n:"PtgUnion",f:Vh},17:{n:"PtgRange",f:Vh},18:{n:"PtgUplus",f:Vh},19:{n:"PtgUminus",f:Vh},20:{n:"PtgPercent",f:Vh},21:{n:"PtgParen",f:Vh},22:{n:"PtgMissArg",f:Vh},23:{n:"PtgStr",f:Su},26:{n:"PtgSheet",f:rd},27:{n:"PtgEndSheet",f:td},28:{n:"PtgErr",f:Tu},29:{n:"PtgBool",f:yu},30:{n:"PtgInt",f:Eu},31:{n:"PtgNum",f:Cu},32:{n:"PtgArray",f:nu},33:{n:"PtgFunc",f:gu},34:{n:"PtgFuncVar",f:bu},35:{n:"PtgName",f:Ru},36:{n:"PtgRef",f:pu},37:{n:"PtgArea",f:Qh},38:{n:"PtgMemArea",f:Fu},39:{n:"PtgMemErr",f:Mu},40:{n:"PtgMemNoMem",f:Uu},41:{n:"PtgMemFunc",f:Du},42:{n:"PtgRefErr",f:Pu},43:{n:"PtgAreaErr",f:ru},44:{n:"PtgRefN",f:vu},45:{n:"PtgAreaN",f:au},46:{n:"PtgMemAreaN",f:ad},47:{n:"PtgMemNoMemN",f:nd},57:{n:"PtgNameX",f:Nu},58:{n:"PtgRef3d",f:mu},59:{n:"PtgArea3d",f:eu},60:{n:"PtgRefErr3d",f:Lu},61:{n:"PtgAreaErr3d",f:tu},255:{}};var fd={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61};var od={1:{n:"PtgElfLel",f:ju},2:{n:"PtgElfRw",f:Zu},3:{n:"PtgElfCol",f:zu},6:{n:"PtgElfRwV",f:Ju},7:{n:"PtgElfColV",f:$u},10:{n:"PtgElfRadical",f:Xu},11:{n:"PtgElfRadicalS",f:Ku},13:{n:"PtgElfColS",f:Vu},15:{n:"PtgElfColSV",f:Gu},16:{n:"PtgElfRadicalLel",f:Yu},25:{n:"PtgList",f:Qu},29:{n:"PtgSxName",f:ed},255:{}};var ld={0:{n:"PtgAttrNoop",f:id},1:{n:"PtgAttrSemi",f:cu},2:{n:"PtgAttrIf",f:ou},4:{n:"PtgAttrChoose",f:su},8:{n:"PtgAttrGoto",f:fu},16:{n:"PtgAttrSum",f:ku},32:{n:"PtgAttrBaxcel",f:iu},33:{n:"PtgAttrBaxcel",f:iu},64:{n:"PtgAttrSpace",f:uu},65:{n:"PtgAttrSpaceSemi",f:du},128:{n:"PtgAttrIfError",f:lu},255:{}};function cd(e,r,t,a){if(a.biff<8)return ba(e,r);var n=e.l+r;var i=[];for(var s=0;s!==t.length;++s){switch(t[s][0]){case"PtgArray":t[s][1]=Ou(e,0,a);i.push(t[s][1]);break;case"PtgMemArea":t[s][2]=xu(e,t[s][1],a);i.push(t[s][2]);break;case"PtgExp":if(a&&a.biff==12){t[s][1][1]=e._R(4);i.push(t[s][1])}break;case"PtgList":;case"PtgElfRadicalS":;case"PtgElfColS":;case"PtgElfColSV":throw"Unsupported "+t[s][0];default:break;}}r=n-e.l;if(r!==0)i.push(ba(e,r));return i}function hd(e,r,t){var a=e.l+r;var n,i,s=[];while(a!=e.l){r=a-e.l;i=e[e.l];n=sd[i]||sd[fd[i]];if(i===24||i===25)n=(i===24?od:ld)[e[e.l+1]];if(!n||!n.f){ba(e,r)}else{s.push([n.n,n.f(e,r,t)])}}return s}function ud(e){var r=[];for(var t=0;t=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function pd(e,r){var t=e.lastIndexOf("!"),a=r.lastIndexOf("!");if(t==-1&&a==-1)return e+":"+r;if(t>0&&a>0&&e.slice(0,t).toLowerCase()==r.slice(0,a).toLowerCase())return e+":"+r.slice(a+1);console.error("Cannot hydrate range",e,r);return e+":"+r}function vd(e,r,t){if(!e)return"SH33TJSERR0";if(t.biff>8&&(!e.XTI||!e.XTI[r]))return e.SheetNames[r];if(!e.XTI)return"SH33TJSERR6";var a=e.XTI[r];if(t.biff<8){if(r>1e4)r-=65536;if(r<0)r=-r;return r==0?"":e.XTI[r-1]}if(!a)return"SH33TJSERR1";var n="";if(t.biff>8)switch(e[a[0]][0]){case 357:n=a[1]==-1?"#REF":e.SheetNames[a[1]];return a[1]==a[2]?n:n+":"+e.SheetNames[a[2]];case 358:if(t.SID!=null)return e.SheetNames[t.SID];return"SH33TJSSAME"+e[a[0]][0];case 355:;default:return"SH33TJSSRC"+e[a[0]][0];}switch(e[a[0]][0][0]){case 1025:n=a[1]==-1?"#REF":e.SheetNames[a[1]]||"SH33TJSERR3";return a[1]==a[2]?n:n+":"+e.SheetNames[a[2]];case 14849:return e[a[0]].slice(1).map(function(e){return e.Name}).join(";;");default:if(!e[a[0]][0][3])return"SH33TJSERR2";n=a[1]==-1?"#REF":e[a[0]][0][3][a[1]]||"SH33TJSERR4";return a[1]==a[2]?n:n+":"+e[a[0]][0][3][a[2]];}}function md(e,r,t){var a=vd(e,r,t);return a=="#REF"?a:Ha(a,t)}function gd(e,r,t,a,n){var i=n&&n.biff||8;var s={s:{c:0,r:0},e:{c:0,r:0}};var f=[],o,l,c,h=0,u=0,d,p="";if(!e[0]||!e[0][0])return"";var v=-1,m="";for(var g=0,b=e[0].length;g=0){switch(e[0][v][1][0]){case 0:m=yr(" ",e[0][v][1][1]);break;case 1:m=yr("\r",e[0][v][1][1]);break;default:m="";if(n.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][v][1][0]);}l=l+m;v=-1}f.push(l+dd[w[0]]+o);break;case"PtgIsect":o=f.pop();l=f.pop();f.push(l+" "+o);break;case"PtgUnion":o=f.pop();l=f.pop();f.push(l+","+o);break;case"PtgRange":o=f.pop();l=f.pop();f.push(pd(l,o));break;case"PtgAttrChoose":break;case"PtgAttrGoto":break;case"PtgAttrIf":break;case"PtgAttrIfError":break;case"PtgRef":c=Ea(w[1][1],s,n);f.push(Ca(c,i));break;case"PtgRefN":c=t?Ea(w[1][1],t,n):w[1][1];f.push(Ca(c,i));break;case"PtgRef3d":h=w[1][1];c=Ea(w[1][2],s,n);p=md(a,h,n);var k=p;f.push(p+"!"+Ca(c,i));break;case"PtgFunc":;case"PtgFuncVar":var A=w[1][0],T=w[1][1];if(!A)A=0;A&=127;var E=A==0?[]:f.slice(-A);f.length-=A;if(T==="User")T=E.shift();f.push(T+"("+E.join(",")+")");break;case"PtgBool":f.push(w[1]?"TRUE":"FALSE");break;case"PtgInt":f.push(w[1]);break;case"PtgNum":f.push(String(w[1]));break;case"PtgStr":f.push('"'+w[1].replace(/"/g,'""')+'"');break;case"PtgErr":f.push(w[1]);break;case"PtgAreaN":d=ya(w[1][1],t?{s:t}:s,n);f.push(Sa(d,n));break;case"PtgArea":d=ya(w[1][1],s,n);f.push(Sa(d,n));break;case"PtgArea3d":h=w[1][1];d=w[1][2];p=md(a,h,n);f.push(p+"!"+Sa(d,n));break;case"PtgAttrSum":f.push("SUM("+f.pop()+")");break;case"PtgAttrBaxcel":;case"PtgAttrSemi":break;case"PtgName":u=w[1][2];var y=(a.names||[])[u-1]||(a[0]||[])[u];var C=y?y.Name:"SH33TJSNAME"+String(u);if(C&&C.slice(0,6)=="_xlfn."&&!n.xlfn)C=C.slice(6);f.push(C);break;case"PtgNameX":var S=w[1][1];u=w[1][2];var _;if(n.biff<=5){if(S<0)S=-S;if(a[S])_=a[S][u]}else{var x="";if(((a[S]||[])[0]||[])[0]==14849){}else if(((a[S]||[])[0]||[])[0]==1025){if(a[S][u]&&a[S][u].itab>0){x=a.SheetNames[a[S][u].itab-1]+"!"}}else x=a.SheetNames[u-1]+"!";if(a[S]&&a[S][u])x+=a[S][u].Name;else if(a[0]&&a[0][u])x+=a[0][u].Name;else{var O=(vd(a,S,n)||"").split(";;");if(O[u-1])x=O[u-1];else x+="SH33TJSERRX"}f.push(x);break}if(!_)_={Name:"SH33TJSERRY"};f.push(_.Name);break;case"PtgParen":var R="(",N=")";if(v>=0){m="";switch(e[0][v][1][0]){case 2:R=yr(" ",e[0][v][1][1])+R;break;case 3:R=yr("\r",e[0][v][1][1])+R;break;case 4:N=yr(" ",e[0][v][1][1])+N;break;case 5:N=yr("\r",e[0][v][1][1])+N;break;default:if(n.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][v][1][0]);}v=-1}f.push(R+f.pop()+N);break;case"PtgRefErr":f.push("#REF!");break;case"PtgRefErr3d":f.push("#REF!");break;case"PtgExp":c={c:w[1][1],r:w[1][0]};var I={c:t.c,r:t.r};if(a.sharedf[Ma(c)]){var F=a.sharedf[Ma(c)];f.push(gd(F,s,I,a,n))}else{var D=false;for(o=0;o!=a.arrayf.length;++o){l=a.arrayf[o];if(c.cl[0].e.c)continue;if(c.rl[0].e.r)continue;f.push(gd(l[1],s,I,a,n));D=true;break}if(!D)f.push(w[1])}break;case"PtgArray":f.push("{"+ud(w[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":;case"PtgAttrSpaceSemi":v=g;break;case"PtgTbl":break;case"PtgMemErr":break;case"PtgMissArg":f.push("");break;case"PtgAreaErr":f.push("#REF!");break;case"PtgAreaErr3d":f.push("#REF!");break;case"PtgList":f.push("Table"+w[1].idx+"[#"+w[1].rt+"]");break;case"PtgMemAreaN":;case"PtgMemNoMemN":;case"PtgAttrNoop":;case"PtgSheet":;case"PtgEndSheet":break;case"PtgMemFunc":break;case"PtgMemNoMem":break;case"PtgElfCol":;case"PtgElfColS":;case"PtgElfColSV":;case"PtgElfColV":;case"PtgElfLel":;case"PtgElfRadical":;case"PtgElfRadicalLel":;case"PtgElfRadicalS":;case"PtgElfRw":;case"PtgElfRwV":throw new Error("Unsupported ELFs");case"PtgSxName":throw new Error("Unrecognized Formula Token: "+String(w));default:throw new Error("Unrecognized Formula Token: "+String(w));}var P=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(n.biff!=3)if(v>=0&&P.indexOf(e[0][g][0])==-1){w=e[0][v];var L=true;switch(w[1][0]){case 4:L=false;case 0:m=yr(" ",w[1][1]);break;case 5:L=false;case 1:m=yr("\r",w[1][1]);break;default:m="";if(n.WTF)throw new Error("Unexpected PtgAttrSpaceType "+w[1][0]);}f.push((L?m:"")+f.pop()+(L?"":m));v=-1}}if(f.length>1&&n.WTF)throw new Error("bad formula stack");if(f[0]=="TRUE")return true;if(f[0]=="FALSE")return false;return f[0]}function bd(e,r,t){var a=e.l+r,n=t.biff==2?1:2;var i,s=e._R(n);if(s==65535)return[[],ba(e,r-2)];var f=hd(e,s,t);if(r!==s+n)i=cd(e,r-s-n,f,t);e.l=a;return[f,i]}function wd(e,r,t){var a=e.l+r,n=t.biff==2?1:2;var i,s=e._R(n);if(s==65535)return[[],ba(e,r-2)];var f=hd(e,s,t);if(r!==s+n)i=cd(e,r-s-n,f,t);e.l=a;return[f,i]}function kd(e,r,t,a){var n=e.l+r;var i=hd(e,a,t);var s;if(n!==e.l)s=cd(e,n-e.l,i,t);return[i,s]}function Ad(e,r,t){var a=e.l+r;var n,i=e._R(2);var s=hd(e,i,t);if(i==65535)return[[],ba(e,r-2)];if(r!==i+2)n=cd(e,a-i-2,s,t);return[s,n]}function Td(e){var r;if(sa(e,e.l+6)!==65535)return[Tn(e),"n"];switch(e[e.l]){case 0:e.l+=8;return["String","s"];case 1:r=e[e.l+2]===1;e.l+=8;return[r,"b"];case 2:r=e[e.l+2];e.l+=8;return[r,"e"];case 3:e.l+=8;return["","s"];}return[]}function Ed(e){if(e==null){var r=wa(8);r._W(1,3);r._W(1,0);r._W(2,0);r._W(2,0);r._W(2,65535);return r}else if(typeof e=="number")return En(e);return En(0)}function yd(e,r,t){var a=e.l+r;var n=Rs(e,6);if(t.biff==2)++e.l;var i=Td(e,8);var s=e._R(1);if(t.biff!=2){e._R(1);if(t.biff>=5){e._R(4)}}var f=wd(e,a-e.l,t);return{cell:n,val:i[0],formula:f,shared:s>>3&1,tt:i[1]}}function Cd(e,r,t,a,n){var i=Ns(r,t,n);var s=Ed(e.v);var f=wa(6);var o=1|32;f._W(2,o);f._W(4,0);var l=wa(e.bf.length);for(var c=0;c0?cd(e,i,n,t):null;return[n,s]}var _d=Sd;var xd=Sd;var Od=Sd;var Rd=Sd;function Nd(e){if((e|0)==e&&e=0){var r=wa(11);r._W(4,3);r._W(1,30);r._W(2,e);r._W(4,0);return r}var t=wa(17);t._W(4,11);t._W(1,31);t._W(8,e);t._W(4,0);return t}function Id(e){var r=wa(10);r._W(4,2);r._W(1,28);r._W(1,e);r._W(4,0);return r}function Fd(e){var r=wa(10);r._W(4,2);r._W(1,29);r._W(1,e?1:0);r._W(4,0);return r}function Dd(e){var r=wa(7);r._W(4,3+2*e.length);r._W(1,23);r._W(2,e.length);var t=wa(2*e.length);t._W(2*e.length,e,"utf16le");var a=wa(4);a._W(4,0);return F([r,t,a])}function Pd(e){var r=La(e);var t=wa(15);t._W(4,7);t._W(1,4|1<<5);t._W(4,r.r);t._W(2,r.c|(e.charAt(0)=="$"?0:1)<<14|(e.match(/\$\d/)?0:1)<<15);t._W(4,0);return t}function Ld(e,r){var t=e.lastIndexOf("!");var a=e.slice(0,t);e=e.slice(t+1);var n=La(e);if(a.charAt(0)=="'")a=a.slice(1,-1).replace(/''/g,"'");var i=wa(17);i._W(4,9);i._W(1,26|1<<5);i._W(2,2+r.SheetNames.map(function(e){return e.toLowerCase()}).indexOf(a.toLowerCase()));i._W(4,n.r);i._W(2,n.c|(e.charAt(0)=="$"?0:1)<<14|(e.match(/\$\d/)?0:1)<<15);i._W(4,0);return i}function Md(e,r){var t=e.lastIndexOf("!");var a=e.slice(0,t);e=e.slice(t+1);if(a.charAt(0)=="'")a=a.slice(1,-1).replace(/''/g,"'");var n=wa(17);n._W(4,9);n._W(1,28|1<<5);n._W(2,2+r.SheetNames.map(function(e){return e.toLowerCase()}).indexOf(a.toLowerCase()));n._W(4,0);n._W(2,0);n._W(4,0);return n}function Ud(e){var r=e.split(":"),t=r[0];var a=wa(23);a._W(4,15);t=r[0];var n=La(t);a._W(1,4|1<<5);a._W(4,n.r);a._W(2,n.c|(t.charAt(0)=="$"?0:1)<<14|(t.match(/\$\d/)?0:1)<<15);a._W(4,0);t=r[1];n=La(t);a._W(1,4|1<<5);a._W(4,n.r);a._W(2,n.c|(t.charAt(0)=="$"?0:1)<<14|(t.match(/\$\d/)?0:1)<<15);a._W(4,0);a._W(1,17);a._W(4,0);return a}function Bd(e,r){var t=e.lastIndexOf("!");var a=e.slice(0,t);e=e.slice(t+1);if(a.charAt(0)=="'")a=a.slice(1,-1).replace(/''/g,"'");var n=e.split(":");s=n[0];var i=wa(27);i._W(4,19);var s=n[0],f=La(s);i._W(1,26|1<<5);i._W(2,2+r.SheetNames.map(function(e){return e.toLowerCase()}).indexOf(a.toLowerCase()));i._W(4,f.r);i._W(2,f.c|(s.charAt(0)=="$"?0:1)<<14|(s.match(/\$\d/)?0:1)<<15);s=n[1];f=La(s);i._W(1,26|1<<5);i._W(2,2+r.SheetNames.map(function(e){return e.toLowerCase()}).indexOf(a.toLowerCase()));i._W(4,f.r);i._W(2,f.c|(s.charAt(0)=="$"?0:1)<<14|(s.match(/\$\d/)?0:1)<<15);i._W(1,17);i._W(4,0);return i}function Wd(e,r){var t=e.lastIndexOf("!");var a=e.slice(0,t);e=e.slice(t+1);if(a.charAt(0)=="'")a=a.slice(1,-1).replace(/''/g,"'");var n=Ua(e);var i=wa(23);i._W(4,15);i._W(1,27|1<<5);i._W(2,2+r.SheetNames.map(function(e){return e.toLowerCase()}).indexOf(a.toLowerCase()));i._W(4,n.s.r);i._W(4,n.e.r);i._W(2,n.s.c);i._W(2,n.e.c);i._W(4,0);return i}function Hd(e,r){if(typeof e=="number")return Nd(e);if(typeof e=="boolean")return Fd(e);if(/^#(DIV\/0!|GETTING_DATA|N\/A|NAME\?|NULL!|NUM!|REF!|VALUE!)$/.test(e))return Id(+qn[e]);if(e.match(/^\$?(?:[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D]|[A-Z]{1,2})\$?(?: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})$/))return Pd(e);if(e.match(/^\$?(?:[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D]|[A-Z]{1,2})\$?(?: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-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D]|[A-Z]{1,2})\$?(?: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})$/))return Ud(e);if(e.match(/^#REF!\$?(?:[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D]|[A-Z]{1,2})\$?(?: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-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D]|[A-Z]{1,2})\$?(?: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})$/))return Wd(e,r);if(e.match(/^(?:'[^\\\/?*\[\]:]*'|[^'][^\\\/?*\[\]:'`~!@#$%^()\-=+{}|;,<.>]*)!\$?(?:[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D]|[A-Z]{1,2})\$?(?: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})$/))return Ld(e,r);if(e.match(/^(?:'[^\\\/?*\[\]:]*'|[^'][^\\\/?*\[\]:'`~!@#$%^()\-=+{}|;,<.>]*)!\$?(?:[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D]|[A-Z]{1,2})\$?(?: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-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D]|[A-Z]{1,2})\$?(?: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})$/))return Bd(e,r);if(/^(?:'[^\\\/?*\[\]:]*'|[^'][^\\\/?*\[\]:'`~!@#$%^()\-=+{}|;,<.>]*)!#REF!$/.test(e))return Md(e,r);if(/^".*"$/.test(e))return Dd(e);if(/^[+-]\d+$/.test(e))return Nd(parseInt(e,10));throw"Formula |"+e+"| not supported for XLSB"}var zd=Hd;var Vd={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"};var Gd={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",
+348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"};var $d={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function jd(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(/\$'([^']|'')+'/g,function(e){return e.slice(1)});e=e.replace(/\$([^\]\. #$]+)/g,function(e,r){return r.match(/^([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})?$/)?e:r});e=e.replace(/\[.(#[A-Z]*[?!])\]/g,"$1");return e.replace(/[;~]/g,",").replace(/\|/g,";")}function Xd(e){var r="of:="+e.replace(Mh,"$1[.$2$3$4$5]").replace(/\]:\[/g,":");return r.replace(/;/g,"|").replace(/,/g,";")}function Yd(e){e=e.replace(/\$'([^']|'')+'/g,function(e){return e.slice(1)});e=e.replace(/\$([^\]\. #$]+)/g,function(e,r){return r.match(/^([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})?$/)?e:r});var r=e.split(":");var t=r[0].split(".")[0];return[t,r[0].split(".")[1]+(r.length>1?":"+(r[1].split(".")[1]||r[1].split(".")[0]):"")]}function Kd(e){return e.replace(/!/,".")}var Zd={};var Jd={};var qd=typeof Map!=="undefined";function Qd(e,r,t){var a=0,n=e.length;if(t){if(qd?t.has(r):Object.prototype.hasOwnProperty.call(t,r)){var i=qd?t.get(r):t[r];for(;a-1){t.width=Ul(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 rp(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 tp(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){qe(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 ap(e,r,t,a,n,i){try{if(a.cellNF)e.z=Z[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=Ar(e.v);if((!a||a.cellText!==false)&&e.t!=="z")try{if(Z[r]==null)qe(Xe[r]||"General",r);if(e.t==="e")e.w=e.w||Jn[e.v];else if(r===0){if(e.t==="n"){if((e.v|0)===e.v)e.w=e.v.toString(10);else e.w=le(e.v)}else if(e.t==="d"){var f=ur(e.v);if((f|0)===f)e.w=f.toString(10);else e.w=le(f)}else if(e.v===undefined)return"";else e.w=ce(e.v,Jd)}else if(e.t==="d")e.w=ze(r,ur(e.v),Jd);else e.w=ze(r,e.v,Jd)}catch(s){if(a.WTF)throw s}if(!a.cellStyles)return;if(t!=null)try{e.s=i.Fills[t];if(e.s.fgColor&&e.s.fgColor.theme&&!e.s.fgColor.rgb){e.s.fgColor.rgb=Nl(n.themeElements.clrScheme[e.s.fgColor.theme].rgb,e.s.fgColor.tint||0);if(a.WTF)e.s.fgColor.raw_rgb=n.themeElements.clrScheme[e.s.fgColor.theme].rgb}if(e.s.bgColor&&e.s.bgColor.theme){e.s.bgColor.rgb=Nl(n.themeElements.clrScheme[e.s.bgColor.theme].rgb,e.s.bgColor.tint||0);if(a.WTF)e.s.bgColor.raw_rgb=n.themeElements.clrScheme[e.s.bgColor.theme].rgb}}catch(s){if(a.WTF&&i.Fills)throw s}}function np(e,r,t){if(e&&e["!ref"]){var a=za(e["!ref"]);if(a.e.c=0&&t.s.c>=0)e["!ref"]=Ba(t)}var sp=/<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g;var fp=/<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/;var op=/<(?:\w:)?hyperlink [^>]*>/gm;var lp=/"(\w*:\w*)"/;var cp=/<(?:\w:)?col\b[^>]*[\/]?>/g;var hp=/<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g;var up=/<(?:\w:)?pageMargins[^>]*\/>/g;var dp=/<(?:\w:)?sheetPr\b(?:[^>a-z][^>]*)?\/>/;var pp=/<(?:\w:)?sheetPr[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetPr)>/;var vp=/<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/;function mp(e,r,t,a,n,i,s){if(!e)return e;if(!a)a={"!id":{}};if(g!=null&&r.dense==null)r.dense=g;var f=r.dense?[]:{};var o={s:{r:2e6,c:2e6},e:{r:0,c:0}};var l="",c="";var h=e.match(fp);if(h){l=e.slice(0,h.index);c=e.slice(h.index+h[0].length)}else l=c=e;var u=l.match(dp);if(u)bp(u[0],f,n,t);else if(u=l.match(pp))wp(u[0],u[1]||"",f,n,t,s,i);var d=(l.match(/<(?:\w*:)?dimension/)||{index:-1}).index;if(d>0){var p=l.slice(d,d+50).match(lp);if(p)ip(f,p[1])}var v=l.match(vp);if(v&&v[1])Ip(v[1],n);var m=[];if(r.cellStyles){var b=l.match(cp);if(b)_p(m,b)}if(h)Pp(h[1],f,r,o,i,s);var w=c.match(hp);if(w)f["!autofilter"]=Op(w[0]);var k=[];var A=c.match(sp);if(A)for(d=0;d!=A.length;++d)k[d]=za(A[d].slice(A[d].indexOf('"')+1));var T=c.match(op);if(T)yp(f,T,a);var E=c.match(up);if(E)f["!margins"]=Cp(Jr(E[0]));if(!f["!ref"]&&o.e.c>=o.s.c&&o.e.r>=o.s.r)f["!ref"]=Ba(o);if(r.sheetRows>0&&f["!ref"]){var y=za(f["!ref"]);if(r.sheetRows<=+y.e.r){y.e.r=r.sheetRows-1;if(y.e.r>o.e.r)y.e.r=o.e.r;if(y.e.ro.e.c)y.e.c=o.e.c;if(y.e.c0)f["!cols"]=m;if(k.length>0)f["!merges"]=k;return f}function gp(e){if(e.length===0)return"";var r='';for(var t=0;t!=e.length;++t)r+='';return r+""}function bp(e,r,t,a){var n=Jr(e);if(!t.Sheets[a])t.Sheets[a]={};if(n.codeName)t.Sheets[a].CodeName=rt(mt(n.codeName))}function wp(e,r,t,a,n){bp(e.slice(0,e.indexOf(">")),t,a,n)}function kp(e,r,t,a,n){var i=false;var s={},f=null;if(a.bookType!=="xlsx"&&r.vbaraw){var o=r.SheetNames[t];try{if(r.Workbook)o=r.Workbook.Sheets[t].CodeName||o}catch(l){}i=true;s.codeName=gt(nt(o))}if(e&&e["!outline"]){var c={summaryBelow:1,summaryRight:1};if(e["!outline"].above)c.summaryBelow=0;if(e["!outline"].left)c.summaryRight=0;f=(f||"")+_t("outlinePr",null,c)}if(!i&&!f)return;n[n.length]=_t("sheetPr",f,s)}var Ap=["objects","scenarios","selectLockedCells","selectUnlockedCells"];var Tp=["formatColumns","formatRows","formatCells","insertColumns","insertRows","insertHyperlinks","deleteColumns","deleteRows","sort","autoFilter","pivotTables"];function Ep(e){var r={sheet:1};Ap.forEach(function(t){if(e[t]!=null&&e[t])r[t]="1"});Tp.forEach(function(t){if(e[t]!=null&&!e[t])r[t]="0"});if(e.password)r.password=ml(e.password).toString(16).toUpperCase();return _t("sheetProtection",null,r)}function yp(e,r,t){var a=Array.isArray(e);for(var n=0;n!=r.length;++n){var i=Jr(mt(r[n]),true);if(!i.ref)return;var s=((t||{})["!id"]||[])[i.id];if(s){i.Target=s.Target;if(i.location)i.Target+="#"+rt(i.location)}else{i.Target="#"+rt(i.location);s={Target:i.Target,TargetMode:"Internal"}}i.Rel=s;if(i.tooltip){i.Tooltip=i.tooltip;delete i.tooltip}var f=za(i.ref);for(var o=f.s.r;o<=f.e.r;++o)for(var l=f.s.c;l<=f.e.c;++l){var c=Ma({c:l,r:o});if(a){if(!e[o])e[o]=[];if(!e[o][l])e[o][l]={t:"z",v:undefined};e[o][l].l=i}else{if(!e[c])e[c]={t:"z",v:undefined};e[c].l=i}}}}function Cp(e){var r={};["left","right","top","bottom","header","footer"].forEach(function(t){if(e[t])r[t]=parseFloat(e[t])});return r}function Sp(e){rp(e);return _t("pageMargins",null,e)}function _p(e,r){var t=false;for(var a=0;a!=r.length;++a){var n=Jr(r[a],true);if(n.hidden)n.hidden=ht(n.hidden);var i=parseInt(n.min,10)-1,s=parseInt(n.max,10)-1;if(n.outlineLevel)n.level=+n.outlineLevel||0;delete n.min;delete n.max;n.width=+n.width;if(!t&&n.width){t=true;Wl(n.width)}Hl(n);while(i<=s)e[i++]=Er(n)}}function xp(e,r){var t=[""],a;for(var n=0;n!=r.length;++n){if(!(a=r[n]))continue;t[t.length]=_t("col",null,ep(n,a))}t[t.length]="";return t.join("")}function Op(e){var r={ref:(e.match(/ref="([^"]*)"/)||[])[1]};return r}function Rp(e,r,t,a){var n=typeof e.ref=="string"?e.ref:Ba(e.ref);if(!t.Workbook)t.Workbook={Sheets:[]};if(!t.Workbook.Names)t.Workbook.Names=[];var i=t.Workbook.Names;var s=Ua(n);if(s.s.r==s.e.r){s.e.r=Ua(r["!ref"]).e.r;n=Ba(s)}for(var f=0;fa-z][^>]*)?\/?>/g;function Ip(e,r){if(!r.Views)r.Views=[{}];(e.match(Np)||[]).forEach(function(e,t){var a=Jr(e);if(!r.Views[t])r.Views[t]={};if(+a.zoomScale)r.Views[t].zoom=+a.zoomScale;if(a.rightToLeft&&ht(a.rightToLeft))r.Views[t].RTL=true})}function Fp(e,r,t,a){var n={workbookViewId:"0"};if((((a||{}).Workbook||{}).Views||[])[0])n.rightToLeft=a.Workbook.Views[0].RTL?"1":"0";return _t("sheetViews",_t("sheetView",null,n),{})}function Dp(e,r,t,a){if(e.c)t["!comments"].push([r,e.c]);if((e.v===undefined||e.t==="z"&&!(a||{}).sheetStubs)&&typeof e.f!=="string"&&typeof e.z=="undefined")return"";var n="";var i=e.t,s=e.v;if(e.t!=="z")switch(e.t){case"b":n=e.v?"1":"0";break;case"n":n=""+e.v;break;case"e":n=Jn[e.v];break;case"d":if(a&&a.cellDates)n=Ar(e.v,-1).toISOString();else{e=Er(e);e.t="n";n=""+(e.v=ur(Ar(e.v)))}if(typeof e.z==="undefined")e.z=Z[14];break;default:n=e.v;break;}var f=e.t=="z"||e.v==null?"":Ct("v",nt(n)),o={r:r};var l=tp(a.cellXfs,e,a);if(l!==0)o.s=l;switch(e.t){case"n":break;case"d":o.t="d";break;case"b":o.t="b";break;case"e":o.t="e";break;case"z":break;default:if(e.v==null){delete e.t;break}if(e.v.length>32767)throw new Error("Text length must not exceed 32767 characters");if(a&&a.bookSST){f=Ct("v",""+Qd(a.Strings,e.v,a.revStrings));o.t="s";break}else o.t="str";break;}if(e.t!=i){e.t=i;e.v=s}if(typeof e.f=="string"&&e.f){var c=e.F&&e.F.slice(0,r.length)==r?{t:"array",ref:e.F}:null;f=_t("f",nt(e.f),c)+(e.v!=null?f:"")}if(e.l)t["!links"].push([r,e.l]);if(e.D)o.cm=1;return _t("c",f,o)}var Pp=function(){var e=/<(?:\w+:)?c[ \/>]/,r=/<\/(?:\w+:)?row>/;var t=/r=["']([^"']*)["']/,a=/<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/;var n=/ref=["']([^"']*)["']/;var i=bt("v"),s=bt("f");return function f(o,l,c,h,u,d){var p=0,v="",m=[],g=[],b=0,w=0,k=0,A="",T;var E,y=0,C=0;var S,_;var x=0,O=0;var R=Array.isArray(d.CellXf),N;var I=[];var F=[];var D=Array.isArray(l);var P=[],L={},M=false;var U=!!c.sheetStubs;for(var B=o.split(r),W=0,H=B.length;W!=H;++W){v=B[W].trim();var z=v.length;if(z===0)continue;var V=0;e:for(p=0;p":if(v[p-1]!="/"){++p;break e}if(c&&c.cellStyles){E=Jr(v.slice(V,p),true);y=E.r!=null?parseInt(E.r,10):y+1;C=-1;if(c.sheetRows&&c.sheetRows=p)break;E=Jr(v.slice(V,p),true);y=E.r!=null?parseInt(E.r,10):y+1;C=-1;if(c.sheetRows&&c.sheetRowsy-1)h.s.r=y-1;if(h.e.r":"")+v;if(g!=null&&g.length===2){b=0;A=g[1];for(w=0;w!=A.length;++w){if((k=A.charCodeAt(w)-64)<1||k>26)break;b=26*b+k}--b;C=b}else++C;for(w=0;w!=v.length;++w)if(v.charCodeAt(w)===62)break;++w;E=Jr(v.slice(0,w),true);if(!E.r)E.r=Ma({r:y-1,c:C});A=v.slice(w);T={t:""};if((g=A.match(i))!=null&&g[1]!=="")T.v=rt(g[1]);if(c.cellFormula){if((g=A.match(s))!=null&&g[1]!==""){T.f=rt(mt(g[1]),true);if(!c.xlfn)T.f=zh(T.f);if(g[0].indexOf('t="array"')>-1){T.F=(A.match(n)||[])[1];if(T.F.indexOf(":")>-1)I.push([za(T.F),T.F])}else if(g[0].indexOf('t="shared"')>-1){_=Jr(g[0]);var $=rt(mt(g[1]));if(!c.xlfn)$=zh($);F[parseInt(_.si,10)]=[_,$,E.r]}}else if(g=A.match(/]*\/>/)){_=Jr(g[0]);if(F[_.si])T.f=Wh(F[_.si][1],F[_.si][2],E.r)}var j=La(E.r);for(w=0;w=I[w][0].s.r&&j.r<=I[w][0].e.r)if(j.c>=I[w][0].s.c&&j.c<=I[w][0].e.c)T.F=I[w][1]}if(E.t==null&&T.v===undefined){if(T.f||T.F){T.v=0;T.t="n"}else if(!U)continue;else T.t="z"}else T.t=E.t||"n";if(h.s.c>C)h.s.c=C;if(h.e.c0)l["!rows"]=P}}();function Lp(e,r,t,a){var n=[],i=[],s=za(e["!ref"]),f="",o,l="",c=[],h=0,u=0,d=e["!rows"];var p=Array.isArray(e);var v={r:l},m,g=-1;for(u=s.s.c;u<=s.e.c;++u)c[u]=Ia(u);for(h=s.s.r;h<=s.e.r;++h){i=[];l=xa(h);for(u=s.s.c;u<=s.e.c;++u){o=c[u]+l;var b=p?(e[h]||[])[u]:e[o];if(b===undefined)continue;if((f=Dp(b,o,e,r,t,a))!=null)i.push(f)}if(i.length>0||d&&d[h]){v={r:l};if(d&&d[h]){m=d[h];if(m.hidden)v.hidden=1;g=-1;if(m.hpx)g=Gl(m.hpx);else if(m.hpt)g=m.hpt;if(g>-1){v.ht=g;v.customHeight=1}if(m.level){v.outlineLevel=m.level}}n[n.length]=_t("row",i.join(""),v)}}if(d)for(;h-1){v.ht=g;v.customHeight=1}if(m.level){v.outlineLevel=m.level}n[n.length]=_t("row","",v)}}return n.join("")}function Mp(e,r,t,a){var n=[Gr,_t("worksheet",null,{xmlns:Ft[0],"xmlns:r":It.r})];var i=t.SheetNames[e],s=0,f="";var o=t.Sheets[i];if(o==null)o={};var l=o["!ref"]||"A1";var c=za(l);if(c.e.c>16383||c.e.r>1048575){if(r.WTF)throw new Error("Range "+l+" exceeds format limit A1:XFD1048576");c.e.c=Math.min(c.e.c,16383);c.e.r=Math.min(c.e.c,1048575);l=Ba(c)}if(!a)a={};o["!comments"]=[];var h=[];kp(o,t,e,r,n);n[n.length]=_t("dimension",null,{ref:l});n[n.length]=Fp(o,r,e,t);if(r.sheetFormat)n[n.length]=_t("sheetFormatPr",null,{defaultRowHeight:r.sheetFormat.defaultRowHeight||"16",baseColWidth:r.sheetFormat.baseColWidth||"10",outlineLevelRow:r.sheetFormat.outlineLevelRow||"7"});if(o["!cols"]!=null&&o["!cols"].length>0)n[n.length]=xp(o,o["!cols"]);n[s=n.length]="";o["!links"]=[];if(o["!ref"]!=null){f=Lp(o,r,e,t,a);if(f.length>0)n[n.length]=f}if(n.length>s+1){n[n.length]="";n[s]=n[s].replace("/>",">")}if(o["!protect"])n[n.length]=Ep(o["!protect"]);if(o["!autofilter"]!=null)n[n.length]=Rp(o["!autofilter"],o,t,e);if(o["!merges"]!=null&&o["!merges"].length>0)n[n.length]=gp(o["!merges"]);var u=-1,d,p=-1;if(o["!links"].length>0){n[n.length]="";o["!links"].forEach(function(e){if(!e[1].Target)return;d={ref:e[0]};if(e[1].Target.charAt(0)!="#"){p=li(a,-1,nt(e[1].Target).replace(/#.*$/,""),ii.HLINK);d["r:id"]="rId"+p}if((u=e[1].Target.indexOf("#"))>-1)d.location=nt(e[1].Target.slice(u+1));if(e[1].Tooltip)d.tooltip=nt(e[1].Tooltip);n[n.length]=_t("hyperlink",null,d)});n[n.length]=""}delete o["!links"];if(o["!margins"]!=null)n[n.length]=Sp(o["!margins"]);if(!r||r.ignoreEC||r.ignoreEC==void 0)n[n.length]=Ct("ignoredErrors",_t("ignoredError",null,{numberStoredAsText:1,sqref:l}));if(h.length>0){p=li(a,-1,"../drawings/drawing"+(e+1)+".xml",ii.DRAW);n[n.length]=_t("drawing",null,{"r:id":"rId"+p});o["!drawing"]=h}if(o["!comments"].length>0){p=li(a,-1,"../drawings/vmlDrawing"+(e+1)+".vml",ii.VML);n[n.length]=_t("legacyDrawing",null,{"r:id":"rId"+p});o["!legacy"]=p}if(n.length>1){n[n.length]="";n[1]=n[1].replace("/>",">")}return n.join("")}function Up(e,r){var t={};var a=e.l+r;t.r=e._R(4);e.l+=4;var n=e._R(2);e.l+=1;var i=e._R(1);e.l=a;if(i&7)t.level=i&7;if(i&16)t.hidden=true;if(i&32)t.hpt=n/20;return t}function Bp(e,r,t){var a=wa(17+8*16);var n=(t["!rows"]||[])[e]||{};a._W(4,e);a._W(4,0);var i=320;if(n.hpx)i=Gl(n.hpx)*20;else if(n.hpt)i=n.hpt*20;a._W(2,i);a._W(1,0);var s=0;if(n.level)s|=n.level;if(n.hidden)s|=16;if(n.hpx||n.hpt)s|=32;a._W(1,s);a._W(1,0);var f=0,o=a.l;a.l+=4;var l={r:e,c:0};for(var c=0;c<16;++c){if(r.s.c>c+1<<10||r.e.ca.l?a.slice(0,a.l):a}function Wp(e,r,t,a){var n=Bp(a,t,r);if(n.length>17||(r["!rows"]||[])[a])Ta(e,0,n)}var Hp=kn;var zp=An;function Vp(){}function Gp(e,r){var t={};var a=e[e.l];++e.l;t.above=!(a&64);t.left=!(a&128);e.l+=18;t.name=ln(e,r-19);return t}function $p(e,r,t){if(t==null)t=wa(84+4*e.length);var a=192;if(r){if(r.above)a&=~64;if(r.left)a&=~128}t._W(1,a);for(var n=1;n<3;++n)t._W(1,0);Cn({auto:1},t);t._W(-4,-1);t._W(-4,-1);cn(e,t);return t.slice(0,t.l)}function jp(e){var r=nn(e);return[r]}function Xp(e,r,t){if(t==null)t=wa(8);return sn(r,t)}function Yp(e){var r=fn(e);return[r]}function Kp(e,r,t){if(t==null)t=wa(4);return on(r,t)}function Zp(e){var r=nn(e);var t=e._R(1);return[r,t,"b"]}function Jp(e,r,t){if(t==null)t=wa(9);sn(r,t);t._W(1,e.v?1:0);return t}function qp(e){var r=fn(e);var t=e._R(1);return[r,t,"b"]}function Qp(e,r,t){if(t==null)t=wa(5);on(r,t);t._W(1,e.v?1:0);return t}function ev(e){var r=nn(e);var t=e._R(1);return[r,t,"e"]}function rv(e,r,t){if(t==null)t=wa(9);sn(r,t);t._W(1,e.v);return t}function tv(e){var r=fn(e);var t=e._R(1);return[r,t,"e"]}function av(e,r,t){if(t==null)t=wa(8);on(r,t);t._W(1,e.v);t._W(2,0);t._W(1,0);return t}function nv(e){var r=nn(e);var t=e._R(4);return[r,t,"s"]}function iv(e,r,t){if(t==null)t=wa(12);sn(r,t);t._W(4,r.v);return t}function sv(e){var r=fn(e);var t=e._R(4);return[r,t,"s"]}function fv(e,r,t){if(t==null)t=wa(8);on(r,t);t._W(4,r.v);return t}function ov(e){var r=nn(e);var t=Tn(e);return[r,t,"n"]}function lv(e,r,t){if(t==null)t=wa(16);sn(r,t);En(e.v,t);return t}function cv(e){var r=fn(e);var t=Tn(e);return[r,t,"n"]}function hv(e,r,t){if(t==null)t=wa(12);on(r,t);En(e.v,t);return t}function uv(e){var r=nn(e);var t=mn(e);return[r,t,"n"]}function dv(e,r,t){if(t==null)t=wa(12);sn(r,t);gn(e.v,t);return t}function pv(e){var r=fn(e);var t=mn(e);return[r,t,"n"]}function vv(e,r,t){if(t==null)t=wa(8);on(r,t);gn(e.v,t);return t}function mv(e){var r=nn(e);var t=en(e);return[r,t,"is"]}function gv(e){var r=nn(e);var t=Za(e);return[r,t,"str"]}function bv(e,r,t){if(t==null)t=wa(12+4*e.v.length);sn(r,t);Ja(e.v,t);return t.length>t.l?t.slice(0,t.l):t}function wv(e){var r=fn(e);var t=Za(e);return[r,t,"str"]}function kv(e,r,t){if(t==null)t=wa(8+4*e.v.length);on(r,t);Ja(e.v,t);return t.length>t.l?t.slice(0,t.l):t}function Av(e,r,t){var a=e.l+r;var n=nn(e);n.r=t["!row"];var i=e._R(1);var s=[n,i,"b"];if(t.cellFormula){e.l+=2;var f=xd(e,a-e.l,t);s[3]=gd(f,null,n,t.supbooks,t)}else e.l=a;return s}function Tv(e,r,t){var a=e.l+r;var n=nn(e);n.r=t["!row"];var i=e._R(1);var s=[n,i,"e"];if(t.cellFormula){e.l+=2;var f=xd(e,a-e.l,t);s[3]=gd(f,null,n,t.supbooks,t)}else e.l=a;return s}function Ev(e,r,t){var a=e.l+r;var n=nn(e);n.r=t["!row"];var i=Tn(e);var s=[n,i,"n"];if(t.cellFormula){e.l+=2;var f=xd(e,a-e.l,t);s[3]=gd(f,null,n,t.supbooks,t)}else e.l=a;return s}function yv(e,r,t){var a=e.l+r;var n=nn(e);n.r=t["!row"];var i=Za(e);var s=[n,i,"str"];if(t.cellFormula){e.l+=2;var f=xd(e,a-e.l,t);s[3]=gd(f,null,n,t.supbooks,t)}else e.l=a;return s}var Cv=kn;var Sv=An;function _v(e,r){if(r==null)r=wa(4);r._W(4,e);return r}function xv(e,r){var t=e.l+r;var a=kn(e,16);var n=hn(e);var i=Za(e);var s=Za(e);var f=Za(e);e.l=t;var o={rfx:a,relId:n,loc:i,display:f};if(s)o.Tooltip=s;return o}function Ov(e,r){var t=wa(50+4*(e[1].Target.length+(e[1].Tooltip||"").length));An({s:La(e[0]),e:La(e[0])},t);vn("rId"+r,t);var a=e[1].Target.indexOf("#");var n=a==-1?"":e[1].Target.slice(a+1);Ja(n||"",t);Ja(e[1].Tooltip||"",t);Ja("",t);return t.slice(0,t.l)}function Rv(){}function Nv(e,r,t){var a=e.l+r;var n=bn(e,16);var i=e._R(1);var s=[n];s[2]=i;if(t.cellFormula){var f=_d(e,a-e.l,t);s[1]=f}else e.l=a;return s}function Iv(e,r,t){var a=e.l+r;var n=kn(e,16);var i=[n];if(t.cellFormula){var s=Rd(e,a-e.l,t);i[1]=s;e.l=a}else e.l=a;return i}function Fv(e,r,t){if(t==null)t=wa(18);var a=ep(e,r);t._W(-4,e);t._W(-4,e);t._W(4,(a.width||10)*256);t._W(4,0);var n=0;if(r.hidden)n|=1;if(typeof a.width=="number")n|=2;if(r.level)n|=r.level<<8;t._W(2,n);return t}var Dv=["left","right","top","bottom","header","footer"];function Pv(e){var r={};Dv.forEach(function(t){r[t]=Tn(e,8)});return r}function Lv(e,r){if(r==null)r=wa(6*8);rp(e);Dv.forEach(function(t){En(e[t],r)});return r}function Mv(e){var r=e._R(2);e.l+=28;return{RTL:r&32}}function Uv(e,r,t){if(t==null)t=wa(30);var a=924;if((((r||{}).Views||[])[0]||{}).RTL)a|=32;t._W(2,a);t._W(4,0);t._W(4,0);t._W(4,0);t._W(1,0);t._W(1,0);t._W(2,0);t._W(2,100);t._W(2,0);t._W(2,0);t._W(2,0);t._W(4,0);return t}function Bv(e){var r=wa(24);r._W(4,4);r._W(4,1);An(e,r);return r}function Wv(e,r){if(r==null)r=wa(16*4+2);r._W(2,e.password?ml(e.password):0);r._W(4,1);[["objects",false],["scenarios",false],["formatCells",true],["formatColumns",true],["formatRows",true],["insertColumns",true],["insertRows",true],["insertHyperlinks",true],["deleteColumns",true],["deleteRows",true],["selectLockedCells",false],["sort",true],["autoFilter",true],["pivotTables",true],["selectUnlockedCells",false]].forEach(function(t){if(t[1])r._W(4,e[t[0]]!=null&&!e[t[0]]?1:0);else r._W(4,e[t[0]]!=null&&e[t[0]]?0:1)});return r}function Hv(){}function zv(){}function Vv(e,r,t,a,n,i,s){if(!e)return e;var f=r||{};if(!a)a={"!id":{}};if(g!=null&&f.dense==null)f.dense=g;var o=f.dense?[]:{};var l;var c={s:{r:2e6,c:2e6},e:{r:0,c:0}};var h=[];var u=false,d=false;var p,v,m,b,w,k,A,T,E;var y=[];f.biff=12;f["!row"]=0;var C=0,S=false;var _=[];var x={};var O=f.supbooks||n.supbooks||[[]];O.sharedf=x;O.arrayf=_;O.SheetNames=n.SheetNames||n.Sheets.map(function(e){return e.name});if(!f.supbooks){f.supbooks=O;if(n.Names)for(var R=0;R=R[0].s.r&&p.r<=R[0].e.r)if(w>=R[0].s.c&&w<=R[0].e.c){v.F=Ba(R[0]);S=true}}if(!S&&e.length>3)v.f=e[3]}if(c.s.r>p.r)c.s.r=p.r;if(c.s.c>w)c.s.c=w;if(c.e.rp.r)c.s.r=p.r;if(c.s.c>w)c.s.c=w;if(c.e.r=e.s){N[e.e--]={width:e.w/256,hidden:!!(e.flags&1),level:e.level};if(!F){F=true;Wl(e.w/256)}Hl(N[e.e+1])}break;case 161:o["!autofilter"]={ref:Ba(e)};break;case 476:o["!margins"]=e;break;case 147:if(!n.Sheets[t])n.Sheets[t]={};if(e.name)n.Sheets[t].CodeName=e.name;if(e.above||e.left)o["!outline"]={above:e.above,left:e.left};break;case 137:if(!n.Views)n.Views=[{}];if(!n.Views[0])n.Views[0]={};if(e.RTL)n.Views[0].RTL=true;break;case 485:break;case 64:;case 1053:break;case 151:break;case 152:;case 175:;case 644:;case 625:;case 562:;case 396:;case 1112:;case 1146:;case 471:;case 1050:;case 649:;case 1105:;case 589:;case 607:;case 564:;case 1055:;case 168:;case 174:;case 1180:;case 499:;case 507:;case 550:;case 171:;case 167:;case 1177:;case 169:;case 1181:;case 551:;case 552:;case 661:;case 639:;case 478:;case 537:;case 477:;case 536:;case 1103:;case 680:;case 1104:;case 1024:;case 663:;case 535:;case 678:;case 504:;case 1043:;case 428:;case 170:;case 3072:;case 50:;case 2070:;case 1045:break;case 35:u=true;break;case 36:u=false;break;case 37:h.push(g);u=true;break;case 38:h.pop();u=false;break;default:if(r.T){}else if(!u||f.WTF)throw new Error("Unexpected record 0x"+g.toString(16));}},f);delete f.supbooks;delete f["!row"];if(!o["!ref"]&&(c.s.r<2e6||l&&(l.e.r>0||l.e.c>0||l.s.r>0||l.s.c>0)))o["!ref"]=Ba(l||c);if(f.sheetRows&&o["!ref"]){var L=za(o["!ref"]);if(f.sheetRows<=+L.e.r){L.e.r=f.sheetRows-1;if(L.e.r>c.e.r)L.e.r=c.e.r;if(L.e.rc.e.c)L.e.c=c.e.c;if(L.e.c0)o["!merges"]=y;if(N.length>0)o["!cols"]=N;if(I.length>0)o["!rows"]=I;return o}function Gv(e,r,t,a,n,i,s){var f={r:t,c:a};if(r.c)i["!comments"].push([Ma(f),r.c]);if(r.v===undefined)return false;var o="";switch(r.t){case"b":o=r.v?"1":"0";break;case"d":r=Er(r);r.z=r.z||Z[14];r.v=ur(Ar(r.v));r.t="n";break;case"n":;case"e":o=""+r.v;break;default:o=r.v;break;}f.s=tp(n.cellXfs,r,n);if(r.l)i["!links"].push([Ma(f),r.l]);switch(r.t){case"s":;case"str":if(n.bookSST){o=Qd(n.Strings,r.v,n.revStrings);f.t="s";f.v=o;if(s)Ta(e,18,fv(r,f));else Ta(e,7,iv(r,f))}else{f.t="str";if(s)Ta(e,17,kv(r,f));else Ta(e,6,bv(r,f))}return true;case"n":if(r.v==(r.v|0)&&r.v>-1e3&&r.v<1e3){if(s)Ta(e,13,vv(r,f));else Ta(e,2,dv(r,f))}else{if(s)Ta(e,16,hv(r,f));else Ta(e,5,lv(r,f))}return true;case"b":f.t="b";if(s)Ta(e,15,Qp(r,f));else Ta(e,4,Jp(r,f));return true;case"e":f.t="e";if(s)Ta(e,14,av(r,f));else Ta(e,3,rv(r,f));return true;}if(s)Ta(e,12,Kp(r,f));else Ta(e,1,Xp(r,f));return true}function $v(e,r,t,a){var n=za(r["!ref"]||"A1"),i,s="",f=[];Ta(e,145);var o=Array.isArray(r);var l=n.e.r;if(r["!rows"])l=Math.max(n.e.r,r["!rows"].length-1);for(var c=n.s.r;c<=l;++c){s=xa(c);Wp(e,r,n,c);var h=false;if(c<=n.e.r)for(var u=n.s.c;u<=n.e.c;++u){if(c===n.s.r)f[u]=Ia(u);
+i=f[u]+s;var d=o?(r[c]||[])[u]:r[i];if(!d){h=false;continue}h=Gv(e,d,c,u,a,r,h)}}Ta(e,146)}function jv(e,r){if(!r||!r["!merges"])return;Ta(e,177,_v(r["!merges"].length));r["!merges"].forEach(function(r){Ta(e,176,Sv(r))});Ta(e,178)}function Xv(e,r){if(!r||!r["!cols"])return;Ta(e,390);r["!cols"].forEach(function(r,t){if(r)Ta(e,60,Fv(t,r))});Ta(e,391)}function Yv(e,r){if(!r||!r["!ref"])return;Ta(e,648);Ta(e,649,Bv(za(r["!ref"])));Ta(e,650)}function Kv(e,r,t){r["!links"].forEach(function(r){if(!r[1].Target)return;var a=li(t,-1,r[1].Target.replace(/#.*$/,""),ii.HLINK);Ta(e,494,Ov(r,a))});delete r["!links"]}function Zv(e,r,t,a){if(r["!comments"].length>0){var n=li(a,-1,"../drawings/vmlDrawing"+(t+1)+".vml",ii.VML);Ta(e,551,vn("rId"+n));r["!legacy"]=n}}function Jv(e,r,t,a){if(!r["!autofilter"])return;var n=r["!autofilter"];var i=typeof n.ref==="string"?n.ref:Ba(n.ref);if(!t.Workbook)t.Workbook={Sheets:[]};if(!t.Workbook.Names)t.Workbook.Names=[];var s=t.Workbook.Names;var f=Ua(i);if(f.s.r==f.e.r){f.e.r=Ua(r["!ref"]).e.r;i=Ba(f)}for(var o=0;o16383||l.e.r>1048575){if(r.WTF)throw new Error("Range "+(s["!ref"]||"A1")+" exceeds format limit A1:XFD1048576");l.e.c=Math.min(l.e.c,16383);l.e.r=Math.min(l.e.c,1048575)}s["!links"]=[];s["!comments"]=[];Ta(n,129);if(t.vbaraw||s["!outline"])Ta(n,147,$p(f,s["!outline"]));Ta(n,148,zp(l));qv(n,s,t.Workbook);Qv(n,s);Xv(n,s,e,r,t);$v(n,s,e,r,t);em(n,s);Jv(n,s,t,e);jv(n,s);Kv(n,s,a);if(s["!margins"])Ta(n,476,Lv(s["!margins"]));if(!r||r.ignoreEC||r.ignoreEC==void 0)Yv(n,s);Zv(n,s,e,a);Ta(n,130);return n.end()}function tm(e){var r=[];var t=e.match(/^/);var a;(e.match(/(.*?)<\/c:pt>/gm)||[]).forEach(function(e){var a=e.match(/(.*)<\/c:v><\/c:pt>/);if(!a)return;r[+a[1]]=t?+a[2]:a[2]});var n=rt((e.match(/([\s\S]*?)<\/c:formatCode>/)||["","General"])[1]);(e.match(/(.*?)<\/c:f>/gm)||[]).forEach(function(e){a=e.replace(/<.*?>/g,"")});return[r,n,a]}function am(e,r,t,a,n,i){var s=i||{"!type":"chart"};if(!e)return i;var f=0,o=0,l="A";var c={s:{r:2e6,c:2e6},e:{r:0,c:0}};(e.match(/[\s\S]*?<\/c:numCache>/gm)||[]).forEach(function(e){var r=tm(e);c.s.r=c.s.c=0;c.e.c=f;l=Ia(f);r[0].forEach(function(e,t){s[l+xa(t)]={t:"n",v:e,z:r[1]};o=t});if(c.e.r0)s["!ref"]=Ba(c);return s}function nm(e,r,t,a,n){if(!e)return e;if(!a)a={"!id":{}};var i={"!type":"chart","!drawel":null,"!rel":""};var s;var f=e.match(dp);if(f)bp(f[0],i,n,t);if(s=e.match(/drawing r:id="(.*?)"/))i["!rel"]=s[1];if(a["!id"][i["!rel"]])i["!drawel"]=a["!id"][i["!rel"]];return i}function im(e,r){e.l+=10;var t=Za(e,r-10);return{name:t}}function sm(e,r,t,a,n){if(!e)return e;if(!a)a={"!id":{}};var i={"!type":"chart","!drawel":null,"!rel":""};var s=[];var f=false;ka(e,function o(e,a,l){switch(l){case 550:i["!rel"]=e;break;case 651:if(!n.Sheets[t])n.Sheets[t]={};if(e.name)n.Sheets[t].CodeName=e.name;break;case 562:;case 652:;case 669:;case 679:;case 551:;case 552:;case 476:;case 3072:break;case 35:f=true;break;case 36:f=false;break;case 37:s.push(l);break;case 38:s.pop();break;default:if(a.T>0)s.push(l);else if(a.T<0)s.pop();else if(!f||r.WTF)throw new Error("Unexpected record 0x"+l.toString(16));}},r);if(a["!id"][i["!rel"]])i["!drawel"]=a["!id"][i["!rel"]];return i}var fm=[["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 om=[["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 lm=[];var cm=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];function hm(e,r){for(var t=0;t!=e.length;++t){var a=e[t];for(var n=0;n!=r.length;++n){var i=r[n];if(a[i[0]]==null)a[i[0]]=i[1];else switch(i[2]){case"bool":if(typeof a[i[0]]=="string")a[i[0]]=ht(a[i[0]]);break;case"int":if(typeof a[i[0]]=="string")a[i[0]]=parseInt(a[i[0]],10);break;}}}}function um(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]]=ht(e[a[0]]);break;case"int":if(typeof e[a[0]]=="string")e[a[0]]=parseInt(e[a[0]],10);break;}}}function dm(e){um(e.WBProps,fm);um(e.CalcPr,cm);hm(e.WBView,om);hm(e.Sheets,lm);Jd.date1904=ht(e.WBProps.date1904)}function pm(e){if(!e.Workbook)return"false";if(!e.Workbook.WBProps)return"false";return ht(e.Workbook.WBProps.date1904)?"true":"false"}var vm=":][*?/\\".split("");function mm(e,r){if(e.length>31){if(r)return false;throw new Error("Sheet names cannot exceed 31 chars")}var t=true;vm.forEach(function(a){if(e.indexOf(a)==-1)return;if(!r)throw new Error("Sheet name cannot contain : \\ / ? * [ ]");t=false});return t}function gm(e,r,t){e.forEach(function(a,n){mm(a);for(var i=0;i22)throw new Error("Bad Code Name: Worksheet"+s)}})}function bm(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||[];gm(e.SheetNames,r,!!e.vbaraw);for(var t=0;t":break;case"":;case"":break;case"":break;case"":fm.forEach(function(e){if(c[e[0]]==null)return;switch(e[2]){case"bool":t.WBProps[e[0]]=ht(c[e[0]]);break;case"int":t.WBProps[e[0]]=parseInt(c[e[0]],10);break;default:t.WBProps[e[0]]=c[e[0]];}});if(c.codeName)t.WBProps.CodeName=mt(c.codeName);break;case"":break;case"":break;case"":;case"":break;case"":delete c[0];t.WBView.push(c);break;case"":break;case"":;case"":break;case"":break;case"":break;case"":;case"":break;case"":break;case"":;case"":a=false;break;case"":{i.Ref=rt(mt(e.slice(s,l)));t.Names.push(i)}break;case"":break;case"":delete c[0];t.CalcPr=c;break;case"":break;case"":;case"":;case"":break;case"":;case"":;case"":break;case"":;case"":break;case"":break;case"":break;case"":;case"":break;case"":;case"":;case"":break;case"":a=false;break;case"":a=true;break;case"":a=false;break;case"0;var a={codeName:"ThisWorkbook"};if(e.Workbook&&e.Workbook.WBProps){fm.forEach(function(r){if(e.Workbook.WBProps[r[0]]==null)return;if(e.Workbook.WBProps[r[0]]==r[1])return;a[r[0]]=e.Workbook.WBProps[r[0]]});if(e.Workbook.WBProps.CodeName){a.codeName=e.Workbook.WBProps.CodeName;delete a.CodeName}}r[r.length]=_t("workbookPr",null,a);var n=e.Workbook&&e.Workbook.Sheets||[];var i=0;if(n&&n[0]&&!!n[0].Hidden){r[r.length]="";for(i=0;i!=e.SheetNames.length;++i){if(!n[i])break;if(!n[i].Hidden)break}if(i==e.SheetNames.length)i=0;r[r.length]='';r[r.length]=""}r[r.length]="";for(i=0;i!=e.SheetNames.length;++i){var s={name:nt(e.SheetNames[i].slice(0,31))};s.sheetId=""+(i+1);s["r:id"]="rId"+(i+1);if(n[i])switch(n[i].Hidden){case 1:s.state="hidden";break;case 2:s.state="veryHidden";break;}r[r.length]=_t("sheet",null,s)}r[r.length]="";if(t){r[r.length]="";if(e.Workbook&&e.Workbook.Names)e.Workbook.Names.forEach(function(e){var t={name:e.Name};if(e.Comment)t.comment=e.Comment;if(e.Sheet!=null)t.localSheetId=""+e.Sheet;if(e.Hidden)t.hidden="1";if(!e.Ref)return;r[r.length]=_t("definedName",nt(e.Ref),t)});r[r.length]=""}if(r.length>2){r[r.length]="";r[1]=r[1].replace("/>",">")}return r.join("")}function Tm(e,r){var t={};t.Hidden=e._R(4);t.iTabID=e._R(4);t.strRelID=pn(e,r-8);t.name=Za(e);return t}function Em(e,r){if(!r)r=wa(127);r._W(4,e.Hidden);r._W(4,e.iTabID);vn(e.strRelID,r);Ja(e.name.slice(0,31),r);return r.length>r.l?r.slice(0,r.l):r}function ym(e,r){var t={};var a=e._R(4);t.defaultThemeVersion=e._R(4);var n=r>8?Za(e):"";if(n.length>0)t.CodeName=n;t.autoCompressPictures=!!(a&65536);t.backupFile=!!(a&64);t.checkCompatibility=!!(a&4096);t.date1904=!!(a&1);t.filterPrivacy=!!(a&8);t.hidePivotFieldList=!!(a&1024);t.promptedSolutions=!!(a&16);t.publishItems=!!(a&2048);t.refreshAllConnections=!!(a&262144);t.saveExternalLinkValues=!!(a&128);t.showBorderUnselectedTables=!!(a&4);t.showInkAnnotation=!!(a&32);t.showObjects=["all","placeholders","none"][a>>13&3];t.showPivotChartFilter=!!(a&32768);t.updateLinks=["userSet","never","always"][a>>8&3];return t}function Cm(e,r){if(!r)r=wa(72);var t=0;if(e){if(e.date1904)t|=1;if(e.filterPrivacy)t|=8}r._W(4,t);r._W(4,0);cn(e&&e.CodeName||"ThisWorkbook",r);return r.slice(0,r.l)}function Sm(e,r){var t={};e._R(4);t.ArchID=e._R(4);e.l+=r-8;return t}function _m(e,r,t){var a=e.l+r;var n=e._R(4);e.l+=1;var i=e._R(4);var s=dn(e);var f=Od(e,0,t);var o=hn(e);if(n&32)s="_xlnm."+s;e.l=a;var l={Name:s,Ptg:f,Flags:n};if(i<268435455)l.Sheet=i;if(o)l.Comment=o;return l}function xm(e,r){var t=wa(9);var a=0;var n=e.Name;if(Qn.indexOf(n)>-1){a|=32;n=n.slice(6)}t._W(4,a);t._W(1,0);t._W(4,e.Sheet==null?4294967295:e.Sheet);var i=[t,Ja(n),zd(e.Ref,r)];if(e.Comment)i.push(un(e.Comment));else{var s=wa(4);s._W(4,4294967295);i.push(s)}return F(i)}function Om(e,r){var t={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},xmlns:""};var a=[];var n=false;if(!r)r={};r.biff=12;var i=[];var s=[[]];s.SheetNames=[];s.XTI=[];Fg[16]={n:"BrtFRTArchID$",f:Sm};ka(e,function f(e,o,l){switch(l){case 156:s.SheetNames.push(e.name);t.Sheets.push(e);break;case 153:t.WBProps=e;break;case 39:if(e.Sheet!=null)r.SID=e.Sheet;e.Ref=gd(e.Ptg,null,null,s,r);delete r.SID;delete e.Ptg;i.push(e);break;case 1036:break;case 357:;case 358:;case 355:;case 667:if(!s[0].length)s[0]=[l,e];else s.push([l,e]);s[s.length-1].XTI=[];break;case 362:if(s.length===0){s[0]=[];s[0].XTI=[]}s[s.length-1].XTI=s[s.length-1].XTI.concat(e);s.XTI=s.XTI.concat(e);break;case 361:break;case 2071:;case 158:;case 143:;case 664:;case 353:break;case 3072:;case 3073:;case 534:;case 677:;case 157:;case 610:;case 2050:;case 155:;case 548:;case 676:;case 128:;case 665:;case 2128:;case 2125:;case 549:;case 2053:;case 596:;case 2076:;case 2075:;case 2082:;case 397:;case 154:;case 1117:;case 553:;case 2091:break;case 35:a.push(l);n=true;break;case 36:a.pop();n=false;break;case 37:a.push(l);n=true;break;case 38:a.pop();n=false;break;case 16:break;default:if(o.T){}else if(!n||r.WTF&&a[a.length-1]!=37&&a[a.length-1]!=35)throw new Error("Unexpected record 0x"+l.toString(16));}},r);dm(t);t.Names=i;t.supbooks=s;return t}function Rm(e,r){Ta(e,143);for(var t=0;t!=r.SheetNames.length;++t){var a=r.Workbook&&r.Workbook.Sheets&&r.Workbook.Sheets[t]&&r.Workbook.Sheets[t].Hidden||0;var n={Hidden:a,iTabID:t+1,strRelID:"rId"+(t+1),name:r.SheetNames[t]};Ta(e,156,Em(n))}Ta(e,144)}function Nm(r,t){if(!t)t=wa(127);for(var a=0;a!=4;++a)t._W(4,0);Ja("SheetJS",t);Ja(e.version,t);Ja(e.version,t);Ja("7262",t);return t.length>t.l?t.slice(0,t.l):t}function Im(e,r){if(!r)r=wa(29);r._W(-4,0);r._W(-4,460);r._W(4,28800);r._W(4,17600);r._W(4,500);r._W(4,e);r._W(4,e);var t=120;r._W(1,t);return r.length>r.l?r.slice(0,r.l):r}function Fm(e,r){if(!r.Workbook||!r.Workbook.Sheets)return;var t=r.Workbook.Sheets;var a=0,n=-1,i=-1;for(;an)return;Ta(e,135);Ta(e,158,Im(n));Ta(e,136)}function Dm(e,r){if(!r.Workbook||!r.Workbook.Names)return;r.Workbook.Names.forEach(function(t){try{if(t.Flags&14)return;Ta(e,39,xm(t,r))}catch(a){console.error("Could not serialize defined name "+JSON.stringify(t))}})}function Pm(e){var r=e.SheetNames.length;var t=wa(12*r+28);t._W(4,r+2);t._W(4,0);t._W(4,-2);t._W(4,-2);t._W(4,0);t._W(4,-1);t._W(4,-1);for(var a=0;a-1?rt(r||e).replace(/<.*?>/g,""):a.r;break;case"DateTime":if(e.slice(-1)!="Z")e+="Z";a.v=(Ar(e)-new Date(Date.UTC(1899,11,30)))/(24*60*60*1e3);if(a.v!==a.v)a.v=rt(e);else if(a.v<60)a.v=a.v-1;if(!c||c=="General")c="yyyy-mm-dd";case"Number":if(a.v===undefined)a.v=+e;if(!a.t)a.t="n";break;case"Error":a.t="e";a.v=qn[e];if(l.cellText!==false)a.w=e;break;default:if(e==""&&r==""){a.t="z"}else{a.t="s";a.v=lt(r||e)}break;}tg(a,c,l);if(l.cellFormula!==false){if(a.Formula){var v=rt(a.Formula);if(v.charCodeAt(0)==61)v=v.slice(1);a.f=Lh(v,n);delete a.Formula;if(a.ArrayRange=="RC")a.F=Lh("RC:RC",n);else if(a.ArrayRange){a.F=Lh(a.ArrayRange,n);o.push([za(a.F),a.F])}}else{for(p=0;p=o[p][0].s.r&&n.r<=o[p][0].e.r)if(n.c>=o[p][0].s.c&&n.c<=o[p][0].e.c)a.F=o[p][1]}}if(l.cellStyles){d.forEach(function(e){if(!u.patternType&&e.patternType)u.patternType=e.patternType});a.s=u}if(a.StyleID!==undefined)a.ixfe=a.StyleID}function ig(e){return Qn.indexOf("_xlnm."+e)>-1?"_xlnm."+e:e}function sg(e){e.t=e.v||"";e.t=e.t.replace(/\r\n/g,"\n").replace(/\r/g,"\n");e.v=e.w=e.ixfe=undefined}function fg(e,r){var t=r||{};$e();var n=d(Rt(e));if(t.type=="binary"||t.type=="array"||t.type=="base64"){if(typeof a!=="undefined")n=a.utils.decode(65001,c(n));else n=mt(n)}var i=n.slice(0,1024).toLowerCase(),s=false;i=i.replace(/".*?"/g,"");if((i.indexOf(">")&1023)>Math.min(i.indexOf(",")&1023,i.indexOf(";")&1023)){var f=Er(t);f.type="string";return Fo.to_workbook(n,f)}if(i.indexOf("=0)s=true});if(s)return nb(n,t);Qm={"General Number":"General","General Date":Z[22],"Long Date":"dddd, mmmm dd, yyyy","Medium Date":Z[15],"Short Date":Z[14],"Long Time":Z[19],"Medium Time":Z[18],"Short Time":Z[20],Currency:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',Fixed:Z[2],Standard:Z[4],Percent:Z[10],Scientific:Z[11],"Yes/No":'"Yes";"Yes";"No";@',"True/False":'"True";"True";"False";@',"On/Off":'"Yes";"Yes";"No";@'};var o;var l=[],h;if(g!=null&&t.dense==null)t.dense=g;var u={},p=[],v=t.dense?[]:{},m="";var b={},w={};var k=Jm(''),A=0;var T=0,E=0;var y={s:{r:2e6,c:2e6},e:{r:0,c:0}};var C={},S={};var _="",x=0;var O=[];var R={},N={},I=0,F=[];var D=[],P={};var L=[],M,U=false;var B=[];var W=[],H={},z=0,V=0;var G={Sheets:[],WBProps:{date1904:false}},$={};Nt.lastIndex=0;n=n.replace(//gm,"");var j="";while(o=Nt.exec(n))switch(o[3]=(j=o[3]).toLowerCase()){case"data":if(j=="data"){if(o[1]==="/"){if((h=l.pop())[0]!==o[3])throw new Error("Bad state: "+h.join("|"))}else if(o[0].charAt(o[0].length-2)!=="/")l.push([o[3],true]);break}if(l[l.length-1][1])break;if(o[1]==="/")ng(n.slice(A,o.index),_,k,l[l.length-1][0]=="comment"?P:b,{c:T,r:E},C,L[T],w,B,t);else{_="";k=Jm(o[0]);A=o.index+o[0].length}break;case"cell":if(o[1]==="/"){if(D.length>0)b.c=D;if((!t.sheetRows||t.sheetRows>E)&&b.v!==void 0){if(t.dense){if(!v[E])v[E]=[];v[E][T]=b}else v[Ia(T)+xa(E)]=b}if(b.HRef){b.l={Target:rt(b.HRef)};if(b.HRefScreenTip)b.l.Tooltip=b.HRefScreenTip;delete b.HRef;delete b.HRefScreenTip}if(b.MergeAcross||b.MergeDown){z=T+(parseInt(b.MergeAcross,10)|0);V=E+(parseInt(b.MergeDown,10)|0);if(z>T||V>E)O.push({s:{c:T,r:E},e:{c:z,r:V}})}if(!t.sheetStubs){if(b.MergeAcross)T=z+1;else++T}else if(b.MergeAcross||b.MergeDown){for(var X=T;X<=z;++X){for(var Y=E;Y<=V;++Y){if(X>T||Y>E){if(t.dense){if(!v[Y])v[Y]=[];v[Y][X]={t:"z"}}else v[Ia(X)+xa(Y)]={t:"z"}}}}T=z+1}else++T}else{b=qm(o[0]);if(b.Index)T=+b.Index-1;if(Ty.e.c)y.e.c=T;if(o[0].slice(-2)==="/>")++T;D=[]}break;case"row":if(o[1]==="/"||o[0].slice(-2)==="/>"){if(Ey.e.r)y.e.r=E;if(o[0].slice(-2)==="/>"){w=Jm(o[0]);if(w.Index)E=+w.Index-1}T=0;++E}else{w=Jm(o[0]);if(w.Index)E=+w.Index-1;H={};if(w.AutoFitHeight=="0"||w.Height){H.hpx=parseInt(w.Height,10);H.hpt=Gl(H.hpx);W[E]=H}if(w.Hidden=="1"){H.hidden=true;W[E]=H}}break;case"worksheet":if(o[1]==="/"){if((h=l.pop())[0]!==o[3])throw new Error("Bad state: "+h.join("|"));p.push(m);if(y.s.r<=y.e.r&&y.s.c<=y.e.c){v["!ref"]=Ba(y);if(t.sheetRows&&t.sheetRows<=y.e.r){v["!fullref"]=v["!ref"];y.e.r=t.sheetRows-1;v["!ref"]=Ba(y)}}if(O.length)v["!merges"]=O;if(L.length>0)v["!cols"]=L;if(W.length>0)v["!rows"]=W;u[m]=v}else{y={s:{r:2e6,c:2e6},e:{r:0,c:0}};E=T=0;l.push([o[3],false]);h=Jm(o[0]);m=rt(h.Name);v=t.dense?[]:{};O=[];B=[];W=[];$={name:m,Hidden:0};G.Sheets.push($)}break;case"table":if(o[1]==="/"){if((h=l.pop())[0]!==o[3])throw new Error("Bad state: "+h.join("|"))}else if(o[0].slice(-2)=="/>")break;else{l.push([o[3],false]);L=[];U=false}break;case"style":if(o[1]==="/")ag(C,S,t);else S=Jm(o[0]);break;case"numberformat":S.nf=rt(Jm(o[0]).Format||"General");if(Qm[S.nf])S.nf=Qm[S.nf];for(var K=0;K!=392;++K)if(Z[K]==S.nf)break;if(K==392)for(K=57;K!=392;++K)if(Z[K]==null){qe(S.nf,K);break}break;case"column":if(l[l.length-1][0]!=="table")break;if(o[1]==="/")break;M=Jm(o[0]);if(M.Hidden){M.hidden=true;delete M.Hidden}if(M.Width)M.wpx=parseInt(M.Width,10);if(!U&&M.wpx>10){U=true;Pl=Il;for(var J=0;J0)ee.Sheet=G.Sheets.length-1;G.Names.push(ee);break;case"namedcell":break;case"b":break;case"i":break;case"u":break;case"s":break;case"em":break;case"h2":break;case"h3":break;case"sub":break;case"sup":break;case"span":break;case"alignment":break;case"borders":break;case"border":break;case"font":if(o[0].slice(-2)==="/>")break;else if(o[1]==="/")_+=n.slice(x,o.index);else x=o.index+o[0].length;break;case"interior":if(!t.cellStyles)break;S.Interior=Jm(o[0]);break;case"protection":break;case"author":;case"title":;case"description":;case"created":;case"keywords":;case"subject":;case"category":;case"company":;case"lastauthor":;case"lastsaved":;case"lastprinted":;case"version":;case"revision":;case"totaltime":;case"hyperlinkbase":;case"manager":;case"contentstatus":;case"identifier":;case"language":;case"appname":if(o[0].slice(-2)==="/>")break;else if(o[1]==="/")Ii(R,j,n.slice(I,o.index));else I=o.index+o[0].length;break;case"paragraphs":break;case"styles":;case"workbook":if(o[1]==="/"){if((h=l.pop())[0]!==o[3])throw new Error("Bad state: "+h.join("|"))}else l.push([o[3],false]);break;case"comment":if(o[1]==="/"){if((h=l.pop())[0]!==o[3])throw new Error("Bad state: "+h.join("|"));sg(P);D.push(P)}else{l.push([o[3],false]);h=Jm(o[0]);P={a:h.Author}}break;case"autofilter":if(o[1]==="/"){if((h=l.pop())[0]!==o[3])throw new Error("Bad state: "+h.join("|"))}else if(o[0].charAt(o[0].length-2)!=="/"){var re=Jm(o[0]);v["!autofilter"]={ref:Lh(re.Range).replace(/\$/g,"")};l.push([o[3],true])}break;case"name":break;case"datavalidation":if(o[1]==="/"){if((h=l.pop())[0]!==o[3])throw new Error("Bad state: "+h.join("|"))}else{if(o[0].charAt(o[0].length-2)!=="/")l.push([o[3],true])}break;case"pixelsperinch":break;case"componentoptions":;case"documentproperties":;case"customdocumentproperties":;case"officedocumentsettings":;case"pivottable":;case"pivotcache":;case"names":;case"mapinfo":;case"pagebreaks":;case"querytable":;case"sorting":;case"schema":;case"conditionalformatting":;case"smarttagtype":;case"smarttags":;case"excelworkbook":;case"workbookoptions":;case"worksheetoptions":if(o[1]==="/"){if((h=l.pop())[0]!==o[3])throw new Error("Bad state: "+h.join("|"))}else if(o[0].charAt(o[0].length-2)!=="/")l.push([o[3],true]);break;case"null":break;default:if(l.length==0&&o[3]=="document")return mb(n,t);if(l.length==0&&o[3]=="uof")return mb(n,t);var te=true;switch(l[l.length-1][0]){case"officedocumentsettings":switch(o[3]){case"allowpng":break;case"removepersonalinformation":break;case"downloadcomponents":break;case"locationofcomponents":break;case"colors":break;case"color":break;case"index":break;case"rgb":break;case"targetscreensize":break;case"readonlyrecommended":break;default:te=false;}break;case"componentoptions":switch(o[3]){case"toolbar":break;case"hideofficelogo":break;case"spreadsheetautofit":break;case"label":break;case"caption":break;case"maxheight":break;case"maxwidth":break;case"nextsheetnumber":break;default:te=false;}break;case"excelworkbook":switch(o[3]){case"date1904":G.WBProps.date1904=true;break;case"windowheight":break;case"windowwidth":break;case"windowtopx":break;case"windowtopy":break;case"tabratio":break;case"protectstructure":break;case"protectwindow":break;case"protectwindows":break;case"activesheet":break;case"displayinknotes":break;case"firstvisiblesheet":break;case"supbook":break;case"sheetname":break;case"sheetindex":break;case"sheetindexfirst":break;case"sheetindexlast":break;case"dll":break;case"acceptlabelsinformulas":break;case"donotsavelinkvalues":break;case"iteration":break;case"maxiterations":break;case"maxchange":break;case"path":break;case"xct":break;case"count":break;case"selectedsheets":break;case"calculation":break;case"uncalced":break;case"startupprompt":break;case"crn":break;case"externname":break;case"formula":break;case"colfirst":break;case"collast":break;case"wantadvise":break;case"boolean":break;case"error":break;case"text":break;case"ole":break;case"noautorecover":break;case"publishobjects":break;case"donotcalculatebeforesave":break;case"number":break;case"refmoder1c1":break;case"embedsavesmarttags":break;default:te=false;}break;case"workbookoptions":switch(o[3]){case"owcversion":break;case"height":break;case"width":break;default:te=false;}break;case"worksheetoptions":switch(o[3]){case"visible":if(o[0].slice(-2)==="/>"){}else if(o[1]==="/")switch(n.slice(I,o.index)){case"SheetHidden":$.Hidden=1;break;case"SheetVeryHidden":$.Hidden=2;break;}else I=o.index+o[0].length;break;case"header":if(!v["!margins"])rp(v["!margins"]={},"xlml");if(!isNaN(+Jr(o[0]).Margin))v["!margins"].header=+Jr(o[0]).Margin;break;case"footer":if(!v["!margins"])rp(v["!margins"]={},"xlml");if(!isNaN(+Jr(o[0]).Margin))v["!margins"].footer=+Jr(o[0]).Margin;break;case"pagemargins":var ae=Jr(o[0]);if(!v["!margins"])rp(v["!margins"]={},"xlml");if(!isNaN(+ae.Top))v["!margins"].top=+ae.Top;if(!isNaN(+ae.Left))v["!margins"].left=+ae.Left;if(!isNaN(+ae.Right))v["!margins"].right=+ae.Right;if(!isNaN(+ae.Bottom))v["!margins"].bottom=+ae.Bottom;break;case"displayrighttoleft":if(!G.Views)G.Views=[];if(!G.Views[0])G.Views[0]={};G.Views[0].RTL=true;break;case"freezepanes":break;case"frozennosplit":break;case"splithorizontal":;case"splitvertical":break;case"donotdisplaygridlines":break;case"activerow":break;case"activecol":break;case"toprowbottompane":break;case"leftcolumnrightpane":break;case"unsynced":break;case"print":break;case"printerrors":break;case"panes":break;case"scale":break;case"pane":break;case"number":break;case"layout":break;case"pagesetup":break;case"selected":break;case"protectobjects":break;case"enableselection":break;case"protectscenarios":break;case"validprinterinfo":break;case"horizontalresolution":break;case"verticalresolution":break;case"numberofcopies":break;case"activepane":break;case"toprowvisible":break;case"leftcolumnvisible":break;case"fittopage":break;case"rangeselection":break;case"papersizeindex":break;case"pagelayoutzoom":break;case"pagebreakzoom":break;case"filteron":break;case"fitwidth":break;case"fitheight":break;case"commentslayout":break;case"zoom":break;case"lefttoright":break;case"gridlines":break;case"allowsort":break;case"allowfilter":break;case"allowinsertrows":break;case"allowdeleterows":break;case"allowinsertcols":break;case"allowdeletecols":break;case"allowinserthyperlinks":break;case"allowformatcells":break;case"allowsizecols":break;case"allowsizerows":break;case"nosummaryrowsbelowdetail":if(!v["!outline"])v["!outline"]={};v["!outline"].above=true;break;case"tabcolorindex":break;case"donotdisplayheadings":break;case"showpagelayoutzoom":break;case"nosummarycolumnsrightdetail":if(!v["!outline"])v["!outline"]={};v["!outline"].left=true;break;case"blackandwhite":break;case"donotdisplayzeros":break;case"displaypagebreak":break;case"rowcolheadings":break;case"donotdisplayoutline":break;case"noorientation":break;case"allowusepivottables":break;case"zeroheight":break;case"viewablerange":break;case"selection":break;case"protectcontents":break;default:te=false;}break;case"pivottable":;case"pivotcache":switch(o[3]){case"immediateitemsondrop":break;case"showpagemultipleitemlabel":break;case"compactrowindent":break;case"location":break;case"pivotfield":break;case"orientation":
+break;case"layoutform":break;case"layoutsubtotallocation":break;case"layoutcompactrow":break;case"position":break;case"pivotitem":break;case"datatype":break;case"datafield":break;case"sourcename":break;case"parentfield":break;case"ptlineitems":break;case"ptlineitem":break;case"countofsameitems":break;case"item":break;case"itemtype":break;case"ptsource":break;case"cacheindex":break;case"consolidationreference":break;case"filename":break;case"reference":break;case"nocolumngrand":break;case"norowgrand":break;case"blanklineafteritems":break;case"hidden":break;case"subtotal":break;case"basefield":break;case"mapchilditems":break;case"function":break;case"refreshonfileopen":break;case"printsettitles":break;case"mergelabels":break;case"defaultversion":break;case"refreshname":break;case"refreshdate":break;case"refreshdatecopy":break;case"versionlastrefresh":break;case"versionlastupdate":break;case"versionupdateablemin":break;case"versionrefreshablemin":break;case"calculation":break;default:te=false;}break;case"pagebreaks":switch(o[3]){case"colbreaks":break;case"colbreak":break;case"rowbreaks":break;case"rowbreak":break;case"colstart":break;case"colend":break;case"rowend":break;default:te=false;}break;case"autofilter":switch(o[3]){case"autofiltercolumn":break;case"autofiltercondition":break;case"autofilterand":break;case"autofilteror":break;default:te=false;}break;case"querytable":switch(o[3]){case"id":break;case"autoformatfont":break;case"autoformatpattern":break;case"querysource":break;case"querytype":break;case"enableredirections":break;case"refreshedinxl9":break;case"urlstring":break;case"htmltables":break;case"connection":break;case"commandtext":break;case"refreshinfo":break;case"notitles":break;case"nextid":break;case"columninfo":break;case"overwritecells":break;case"donotpromptforfile":break;case"textwizardsettings":break;case"source":break;case"number":break;case"decimal":break;case"thousandseparator":break;case"trailingminusnumbers":break;case"formatsettings":break;case"fieldtype":break;case"delimiters":break;case"tab":break;case"comma":break;case"autoformatname":break;case"versionlastedit":break;case"versionlastrefresh":break;default:te=false;}break;case"datavalidation":switch(o[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;case"cellrangelist":break;default:te=false;}break;case"sorting":;case"conditionalformatting":switch(o[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"cellrangelist":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;default:te=false;}break;case"mapinfo":;case"schema":;case"data":switch(o[3]){case"map":break;case"entry":break;case"range":break;case"xpath":break;case"field":break;case"xsdtype":break;case"filteron":break;case"aggregate":break;case"elementtype":break;case"attributetype":break;case"schema":;case"element":;case"complextype":;case"datatype":;case"all":;case"attribute":;case"extends":break;case"row":break;default:te=false;}break;case"smarttags":break;default:te=false;break;}if(te)break;if(o[3].match(/!\[CDATA/))break;if(!l[l.length-1][1])throw"Unrecognized tag: "+o[3]+"|"+l.join("|");if(l[l.length-1][0]==="customdocumentproperties"){if(o[0].slice(-2)==="/>")break;else if(o[1]==="/")rg(N,j,F,n.slice(I,o.index));else{F=o;I=o.index+o[0].length}break}if(t.WTF)throw"Unrecognized tag: "+o[3]+"|"+l.join("|");}var ne={};if(!t.bookSheets&&!t.bookProps)ne.Sheets=u;ne.SheetNames=p;ne.Workbook=G;ne.SSF=Er(Z);ne.Props=R;ne.Custprops=N;ne.bookType="xlml";return ne}function og(e,r){bw(r=r||{});switch(r.type||"base64"){case"base64":return fg(T(e),r);case"binary":;case"buffer":;case"file":return fg(e,r);case"array":return fg(R(e),r);}}function lg(e,r){var t=[];if(e.Props)t.push(Fi(e.Props,r));if(e.Custprops)t.push(Di(e.Props,e.Custprops,r));return t.join("")}function cg(e){if((((e||{}).Workbook||{}).WBProps||{}).date1904)return'';return""}function hg(e,r){var t=[''];r.cellXfs.forEach(function(e,r){var a=[];a.push(_t("NumberFormat",null,{"ss:Format":nt(Z[e.numFmtId])}));var n={"ss:ID":"s"+(21+r)};t.push(_t("Style",a.join(""),n))});return _t("Styles",t.join(""))}function ug(e){return _t("NamedRange",null,{"ss:Name":e.Name.slice(0,6)=="_xlnm."?e.Name.slice(6):e.Name,"ss:RefersTo":"="+Uh(e.Ref,{r:0,c:0})})}function dg(e){if(!((e||{}).Workbook||{}).Names)return"";var r=e.Workbook.Names;var t=[];for(var a=0;a");if(e["!margins"].header)n.push(_t("Header",null,{"x:Margin":e["!margins"].header}));if(e["!margins"].footer)n.push(_t("Footer",null,{"x:Margin":e["!margins"].footer}));n.push(_t("PageMargins",null,{"x:Bottom":e["!margins"].bottom||"0.75","x:Left":e["!margins"].left||"0.7","x:Right":e["!margins"].right||"0.7","x:Top":e["!margins"].top||"0.75"}));n.push("")}if(a&&a.Workbook&&a.Workbook.Sheets&&a.Workbook.Sheets[t]){if(a.Workbook.Sheets[t].Hidden)n.push(_t("Visible",a.Workbook.Sheets[t].Hidden==1?"SheetHidden":"SheetVeryHidden",{}));else{for(var i=0;i")}}if(((((a||{}).Workbook||{}).Views||[])[0]||{}).RTL)n.push("");if(e["!protect"]){n.push(Ct("ProtectContents","True"));if(e["!protect"].objects)n.push(Ct("ProtectObjects","True"));if(e["!protect"].scenarios)n.push(Ct("ProtectScenarios","True"));if(e["!protect"].selectLockedCells!=null&&!e["!protect"].selectLockedCells)n.push(Ct("EnableSelection","NoSelection"));else if(e["!protect"].selectUnlockedCells!=null&&!e["!protect"].selectUnlockedCells)n.push(Ct("EnableSelection","UnlockedCells"));[["formatCells","AllowFormatCells"],["formatColumns","AllowSizeCols"],["formatRows","AllowSizeRows"],["insertColumns","AllowInsertCols"],["insertRows","AllowInsertRows"],["insertHyperlinks","AllowInsertHyperlinks"],["deleteColumns","AllowDeleteCols"],["deleteRows","AllowDeleteRows"],["sort","AllowSort"],["autoFilter","AllowFilter"],["pivotTables","AllowUsePivotTables"]].forEach(function(r){if(e["!protect"][r[0]])n.push("<"+r[1]+"/>")})}if(n.length==0)return"";return _t("WorksheetOptions",n.join(""),{xmlns:Dt.x})}function mg(e){return e.map(function(e){var r=ct(e.t||"");var t=_t("ss:Data",r,{xmlns:"http://www.w3.org/TR/REC-html40"});return _t("Comment",t,{"ss:Author":e.a})}).join("")}function gg(e,r,t,a,n,i,s){if(!e||e.v==undefined&&e.f==undefined)return"";var f={};if(e.f)f["ss:Formula"]="="+nt(Uh(e.f,s));if(e.F&&e.F.slice(0,r.length)==r){var o=La(e.F.slice(r.length+1));f["ss:ArrayRange"]="RC:R"+(o.r==s.r?"":"["+(o.r-s.r)+"]")+"C"+(o.c==s.c?"":"["+(o.c-s.c)+"]")}if(e.l&&e.l.Target){f["ss:HRef"]=nt(e.l.Target);if(e.l.Tooltip)f["x:HRefScreenTip"]=nt(e.l.Tooltip)}if(t["!merges"]){var l=t["!merges"];for(var c=0;c!=l.length;++c){if(l[c].s.c!=s.c||l[c].s.r!=s.r)continue;if(l[c].e.c>l[c].s.c)f["ss:MergeAcross"]=l[c].e.c-l[c].s.c;if(l[c].e.r>l[c].s.r)f["ss:MergeDown"]=l[c].e.r-l[c].s.r}}var h="",u="";switch(e.t){case"z":if(!a.sheetStubs)return"";break;case"n":h="Number";u=String(e.v);break;case"b":h="Boolean";u=e.v?"1":"0";break;case"e":h="Error";u=Jn[e.v];break;case"d":h="DateTime";u=new Date(e.v).toISOString();if(e.z==null)e.z=e.z||Z[14];break;case"s":h="String";u=ot(e.v||"");break;}var d=tp(a.cellXfs,e,a);f["ss:StyleID"]="s"+(21+d);f["ss:Index"]=s.c+1;var p=e.v!=null?u:"";var v=e.t=="z"?"":''+p+"";if((e.c||[]).length>0)v+=mg(e.c);return _t("Cell",v,f)}function bg(e,r){var t='"}function wg(e,r,t,a){if(!e["!ref"])return"";var n=za(e["!ref"]);var i=e["!merges"]||[],s=0;var f=[];if(e["!cols"])e["!cols"].forEach(function(e,r){Hl(e);var t=!!e.width;var a=ep(r,e);var n={"ss:Index":r+1};if(t)n["ss:Width"]=Ll(a.width);if(e.hidden)n["ss:Hidden"]="1";f.push(_t("Column",null,n))});var o=Array.isArray(e);for(var l=n.s.r;l<=n.e.r;++l){var c=[bg(l,(e["!rows"]||[])[l])];for(var h=n.s.c;h<=n.e.c;++h){var u=false;for(s=0;s!=i.length;++s){if(i[s].s.c>h)continue;if(i[s].s.r>l)continue;if(i[s].e.c");if(c.length>2)f.push(c.join(""))}return f.join("")}function kg(e,r,t){var a=[];var n=t.SheetNames[e];var i=t.Sheets[n];var s=i?pg(i,r,e,t):"";if(s.length>0)a.push(""+s+"");s=i?wg(i,r,e,t):"";if(s.length>0)a.push("");a.push(vg(i,r,e,t));if(i["!autofilter"])a.push('');return a.join("")}function Ag(e,r){if(!r)r={};if(!e.SSF)e.SSF=Er(Z);if(e.SSF){$e();Ge(e.SSF);r.revssf=lr(e.SSF);r.revssf[e.SSF[65535]]=0;r.ssf=e.SSF;r.cellXfs=[];tp(r.cellXfs,{},{revssf:{General:0}})}var t=[];t.push(lg(e,r));t.push(cg(e,r));t.push("");t.push("");for(var a=0;a40)return r;t.l-=4;r.Reserved1=t._R(0,"lpstr-ansi");if(t.length-t.l<=4)return r;a=t._R(4);if(a!==1907505652)return r;r.UnicodeClipboardFormat=Rn(t);a=t._R(4);if(a==0||a>40)return r;t.l-=4;r.Reserved2=t._R(0,"lpwstr")}var Eg=[60,1084,2066,2165,2175];function yg(e,r,t,a,n){var i=a;var s=[];var f=t.slice(t.l,t.l+i);if(n&&n.enc&&n.enc.insitu&&f.length>0)switch(e){case 9:;case 521:;case 1033:;case 2057:;case 47:;case 405:;case 225:;case 406:;case 312:;case 404:;case 10:break;case 133:break;default:n.enc.insitu(f);}s.push(f);t.l+=i;var o=sa(t,t.l),l=Dg[o];var c=0;while(l!=null&&Eg.indexOf(o)>-1){i=sa(t,t.l+2);c=t.l+4;if(o==2066)c+=4;else if(o==2165||o==2175){c+=12}f=t.slice(c,t.l+4+i);s.push(f);t.l+=4+i;l=Dg[o=sa(t,t.l)]}var h=F(s);ga(h,0);var u=0;h.lens=[];for(var d=0;d1)return;if(t.sheetRows&&e.r>=t.sheetRows)return;if(t.cellStyles&&r.XF&&r.XF.data)x(e,r,t);delete r.ixfe;delete r.XF;u=e;d=Ma(e);if(!s||!s.s||!s.e)s={s:{r:0,c:0},e:{r:0,c:0}};if(e.rs.e.r)s.e.r=e.r+1;if(e.c+1>s.e.c)s.e.c=e.c+1;if(t.cellFormula&&r.f){for(var a=0;ae.c||k[a][0].s.r>e.r)continue;if(k[a][0].e.c>8)!==j)throw new Error("rt mismatch: "+K+"!="+j);if(Y.r==12){e.l+=10;X-=10}}var J={};if(j===10)J=Y.f(e,X,R);else J=yg(j,Y,e,X,R);if(B==0&&[9,521,1033,2057].indexOf(U)===-1)continue;switch(j){case 34:t.opts.Date1904=C.WBProps.date1904=J;break;case 134:t.opts.WriteProtect=true;break;case 47:if(!R.enc)e.l=0;R.enc=J;if(!r.password)throw new Error("File is password-protected");if(J.valid==null)throw new Error("Encryption scheme unsupported");if(!J.valid)throw new Error("Password is incorrect");break;case 92:R.lastuser=J;break;case 66:var q=Number(J);switch(q){case 21010:q=1200;break;case 32768:q=1e4;break;case 32769:q=1252;break;}o(R.codepage=q);G=true;break;case 317:R.rrtabid=J;break;case 25:R.winlocked=J;break;case 439:t.opts["RefreshAll"]=J;break;case 12:t.opts["CalcCount"]=J;break;case 16:t.opts["CalcDelta"]=J;break;case 17:t.opts["CalcIter"]=J;break;case 13:t.opts["CalcMode"]=J;break;case 14:t.opts["CalcPrecision"]=J;break;case 95:t.opts["CalcSaveRecalc"]=J;break;case 15:R.CalcRefMode=J;break;case 2211:t.opts.FullCalc=J;break;case 129:if(J.fDialog)n["!type"]="dialog";if(!J.fBelow)(n["!outline"]||(n["!outline"]={})).above=true;if(!J.fRight)(n["!outline"]||(n["!outline"]={})).left=true;break;case 224:E.push(J);break;case 430:M.push([J]);M[M.length-1].XTI=[];break;case 35:;case 547:M[M.length-1].push(J);break;case 24:;case 536:V={Name:J.Name,Ref:gd(J.rgce,s,null,M,R)};if(J.itab>0)V.Sheet=J.itab-1;M.names.push(V);if(!M[0]){M[0]=[];M[0].XTI=[]}M[M.length-1].push(J);if(J.Name=="_xlnm._FilterDatabase"&&J.itab>0)if(J.rgce&&J.rgce[0]&&J.rgce[0][0]&&J.rgce[0][0][0]=="PtgArea3d")z[J.itab-1]={ref:Ba(J.rgce[0][0][1][2])};break;case 22:R.ExternCount=J;break;case 23:if(M.length==0){M[0]=[];M[0].XTI=[]}M[M.length-1].XTI=M[M.length-1].XTI.concat(J);M.XTI=M.XTI.concat(J);break;case 2196:if(R.biff<8)break;if(V!=null)V.Comment=J[1];break;case 18:n["!protect"]=J;break;case 19:if(J!==0&&R.WTF)console.error("Password verifier: "+J);break;case 133:{i[J.pos]=J;R.snames.push(J.name)}break;case 10:{if(--B)break;if(s.e){if(s.e.r>0&&s.e.c>0){s.e.r--;s.e.c--;n["!ref"]=Ba(s);if(r.sheetRows&&r.sheetRows<=s.e.r){var Q=s.e.r;s.e.r=r.sheetRows-1;n["!fullref"]=n["!ref"];n["!ref"]=Ba(s);s.e.r=Q}s.e.r++;s.e.c++}if(I.length>0)n["!merges"]=I;if(F.length>0)n["!objects"]=F;if(D.length>0)n["!cols"]=D;if(P.length>0)n["!rows"]=P;C.Sheets.push(S)}if(c==="")h=n;else a[c]=n;n=r.dense?[]:{}}break;case 9:;case 521:;case 1033:;case 2057:{if(R.biff===8)R.biff={9:2,521:3,1033:4}[j]||{512:2,768:3,1024:4,1280:5,1536:8,2:2,7:2}[J.BIFFVer]||8;R.biffguess=J.BIFFVer==0;if(J.BIFFVer==0&&J.dt==4096){R.biff=5;G=true;o(R.codepage=28591)}if(R.biff==8&&J.BIFFVer==0&&J.dt==16)R.biff=2;if(B++)break;n=r.dense?[]:{};if(R.biff<8&&!G){G=true;o(R.codepage=r.codepage||1252)}if(R.biff<5||J.BIFFVer==0&&J.dt==4096){if(c==="")c="Sheet1";s={s:{r:0,c:0},e:{r:0,c:0}};var ee={pos:e.l-X,name:c};i[ee.pos]=ee;R.snames.push(c)}else c=(i[$]||{name:""}).name;if(J.dt==32)n["!type"]="chart";if(J.dt==64)n["!type"]="macro";I=[];F=[];R.arrayf=k=[];D=[];P=[];L=false;S={Hidden:(i[$]||{hs:0}).hs,name:c}}break;case 515:;case 3:;case 2:{if(n["!type"]=="chart")if(r.dense?(n[J.r]||[])[J.c]:n[Ma({c:J.c,r:J.r})])++J.c;A={ixfe:J.ixfe,XF:E[J.ixfe]||{},v:J.val,t:"n"};if(W>0)A.z=H[A.ixfe>>8&63];Cg(A,r,t.opts.Date1904);O({c:J.c,r:J.r},A,r)}break;case 5:;case 517:{A={ixfe:J.ixfe,XF:E[J.ixfe],v:J.val,t:J.t};if(W>0)A.z=H[A.ixfe>>8&63];Cg(A,r,t.opts.Date1904);O({c:J.c,r:J.r},A,r)}break;case 638:{A={ixfe:J.ixfe,XF:E[J.ixfe],v:J.rknum,t:"n"};if(W>0)A.z=H[A.ixfe>>8&63];Cg(A,r,t.opts.Date1904);O({c:J.c,r:J.r},A,r)}break;case 189:{for(var re=J.c;re<=J.C;++re){var te=J.rkrec[re-J.c][0];A={ixfe:te,XF:E[te],v:J.rkrec[re-J.c][1],t:"n"};if(W>0)A.z=H[A.ixfe>>8&63];Cg(A,r,t.opts.Date1904);O({c:re,r:J.r},A,r)}}break;case 6:;case 518:;case 1030:{if(J.val=="String"){f=J;break}A=Sg(J.val,J.cell.ixfe,J.tt);A.XF=E[A.ixfe];if(r.cellFormula){var ae=J.formula;if(ae&&ae[0]&&ae[0][0]&&ae[0][0][0]=="PtgExp"){var ne=ae[0][0][1][0],ie=ae[0][0][1][1];var se=Ma({r:ne,c:ie});if(w[se])A.f=""+gd(J.formula,s,J.cell,M,R);else A.F=((r.dense?(n[ne]||[])[ie]:n[se])||{}).F}else A.f=""+gd(J.formula,s,J.cell,M,R)}if(W>0)A.z=H[A.ixfe>>8&63];Cg(A,r,t.opts.Date1904);O(J.cell,A,r);f=J}break;case 7:;case 519:{if(f){f.val=J;A=Sg(J,f.cell.ixfe,"s");A.XF=E[A.ixfe];if(r.cellFormula){A.f=""+gd(f.formula,s,f.cell,M,R)}if(W>0)A.z=H[A.ixfe>>8&63];Cg(A,r,t.opts.Date1904);O(f.cell,A,r);f=null}else throw new Error("String record expects Formula")}break;case 33:;case 545:{k.push(J);var fe=Ma(J[0].s);p=r.dense?(n[J[0].s.r]||[])[J[0].s.c]:n[fe];if(r.cellFormula&&p){if(!f)break;if(!fe||!p)break;p.f=""+gd(J[1],s,J[0],M,R);p.F=Ba(J[0])}}break;case 1212:{if(!r.cellFormula)break;if(d){if(!f)break;w[Ma(f.cell)]=J[0];p=r.dense?(n[f.cell.r]||[])[f.cell.c]:n[Ma(f.cell)];(p||{}).f=""+gd(J[0],s,u,M,R)}}break;case 253:A=Sg(l[J.isst].t,J.ixfe,"s");if(l[J.isst].h)A.h=l[J.isst].h;A.XF=E[A.ixfe];if(W>0)A.z=H[A.ixfe>>8&63];Cg(A,r,t.opts.Date1904);O({c:J.c,r:J.r},A,r);break;case 513:if(r.sheetStubs){A={ixfe:J.ixfe,XF:E[J.ixfe],t:"z"};if(W>0)A.z=H[A.ixfe>>8&63];Cg(A,r,t.opts.Date1904);O({c:J.c,r:J.r},A,r)}break;case 190:if(r.sheetStubs){for(var oe=J.c;oe<=J.C;++oe){var le=J.ixfe[oe-J.c];A={ixfe:le,XF:E[le],t:"z"};if(W>0)A.z=H[A.ixfe>>8&63];Cg(A,r,t.opts.Date1904);O({c:oe,r:J.r},A,r)}}break;case 214:;case 516:;case 4:A=Sg(J.val,J.ixfe,"s");A.XF=E[A.ixfe];if(W>0)A.z=H[A.ixfe>>8&63];Cg(A,r,t.opts.Date1904);O({c:J.c,r:J.r},A,r);break;case 0:;case 512:{if(B===1)s=J}break;case 252:{l=J}break;case 1054:{if(R.biff==4){H[W++]=J[1];for(var ce=0;ce=163)qe(J[1],W+163)}else qe(J[1],J[0])}break;case 30:{H[W++]=J;for(var he=0;he=163)qe(J,W+163)}break;case 229:I=I.concat(J);break;case 93:F[J.cmo[0]]=R.lastobj=J;break;case 438:R.lastobj.TxO=J;break;case 127:R.lastobj.ImData=J;break;case 440:{for(b=J[0].s.r;b<=J[0].e.r;++b)for(m=J[0].s.c;m<=J[0].e.c;++m){p=r.dense?(n[b]||[])[m]:n[Ma({c:m,r:b})];if(p)p.l=J[1]}}break;case 2048:{for(b=J[0].s.r;b<=J[0].e.r;++b)for(m=J[0].s.c;m<=J[0].e.c;++m){p=r.dense?(n[b]||[])[m]:n[Ma({c:m,r:b})];if(p&&p.l)p.l.Tooltip=J[1]}}break;case 28:{if(R.biff<=5&&R.biff>=2)break;p=r.dense?(n[J[0].r]||[])[J[0].c]:n[Ma(J[0])];var ue=F[J[2]];if(!p){if(r.dense){if(!n[J[0].r])n[J[0].r]=[];p=n[J[0].r][J[0].c]={t:"z"}}else{p=n[Ma(J[0])]={t:"z"}}s.e.r=Math.max(s.e.r,J[0].r);s.s.r=Math.min(s.s.r,J[0].r);s.e.c=Math.max(s.e.c,J[0].c);s.s.c=Math.min(s.s.c,J[0].c)}if(!p.c)p.c=[];v={a:J[1],t:ue.TxO.t};p.c.push(v)}break;case 2173:Kc(E[J.ixfe],J.ext);break;case 125:{if(!R.cellStyles)break;while(J.e>=J.s){D[J.e--]={width:J.w/256,level:J.level||0,hidden:!!(J.flags&1)};if(!L){L=true;Wl(J.w/256)}Hl(D[J.e+1])}}break;case 520:{var de={};if(J.level!=null){P[J.r]=de;de.level=J.level}if(J.hidden){P[J.r]=de;de.hidden=true}if(J.hpt){P[J.r]=de;de.hpt=J.hpt;de.hpx=$l(J.hpt)}}break;case 38:;case 39:;case 40:;case 41:if(!n["!margins"])rp(n["!margins"]={});n["!margins"][{38:"left",39:"right",40:"top",41:"bottom"}[j]]=J;break;case 161:if(!n["!margins"])rp(n["!margins"]={});n["!margins"].header=J.header;n["!margins"].footer=J.footer;break;case 574:if(J.RTL)C.Views[0].RTL=true;break;case 146:y=J;break;case 2198:N=J;break;case 140:T=J;break;case 442:{if(!c)C.WBProps.CodeName=J||"ThisWorkbook";else S.CodeName=J||S.name}break;}}else{if(!Y)console.error("Missing Info for XLS Record 0x"+j.toString(16));e.l+=X}}t.SheetNames=sr(i).sort(function(e,r){return Number(e)-Number(r)}).map(function(e){return i[e].name});if(!r.bookSheets)t.Sheets=a;if(!t.SheetNames.length&&h["!ref"]){t.SheetNames.push("Sheet1");if(t.Sheets)t.Sheets["Sheet1"]=h}else t.Preamble=h;if(t.Sheets)z.forEach(function(e,r){t.Sheets[t.SheetNames[r]]["!autofilter"]=e});t.Strings=l;t.SSF=Er(Z);if(R.enc)t.Encryption=R.enc;if(N)t.Themes=N;t.Metadata={};if(T!==undefined)t.Metadata.Country=T;if(M.names.length>0)C.Names=M.names;t.Workbook=C;return t}var xg={SI:"e0859ff2f94f6810ab9108002b27b3d9",DSI:"02d5cdd59c2e1b10939708002b2cf9ae",UDI:"05d5cdd59c2e1b10939708002b2cf9ae"};function Og(e,r,t){var a=er.find(e,"/!DocumentSummaryInformation");if(a&&a.size>0)try{var n=rs(a,Gn,xg.DSI);for(var i in n)r[i]=n[i]}catch(s){if(t.WTF)throw s}var f=er.find(e,"/!SummaryInformation");if(f&&f.size>0)try{var o=rs(f,$n,xg.SI);for(var l in o)if(r[l]==null)r[l]=o[l]}catch(s){if(t.WTF)throw s}if(r.HeadingPairs&&r.TitlesOfParts){yi(r.HeadingPairs,r.TitlesOfParts,r,t);delete r.HeadingPairs;delete r.TitlesOfParts}}function Rg(e,r){var t=[],a=[],n=[];var i=0,s;var f=fr(Gn,"n");var o=fr($n,"n");if(e.Props){s=sr(e.Props);for(i=0;i-1||Ei.indexOf(n[i][0])>-1)continue;if(n[i][1]==null)continue;l.push(n[i])}if(a.length)er.utils.cfb_add(r,"/SummaryInformation",ts(a,xg.SI,o,$n));if(t.length||l.length)er.utils.cfb_add(r,"/DocumentSummaryInformation",ts(t,xg.DSI,f,Gn,l.length?l:null,xg.UDI))}function Ng(e,r){if(!r)r={};bw(r);l();if(r.codepage)s(r.codepage);var t,a;if(e.FullPaths){if(er.find(e,"/encryption"))throw new Error("File is password-protected");t=er.find(e,"!CompObj");a=er.find(e,"/Workbook")||er.find(e,"/Book")}else{switch(r.type){case"base64":e=x(T(e));break;case"binary":e=x(e);break;case"buffer":break;case"array":if(!Array.isArray(e))e=Array.prototype.slice.call(e);break;}ga(e,0);a={content:e}}var n;var i;if(t)Tg(t);if(r.bookProps&&!r.bookSheets)n={};else{var f=E?"buffer":"array";if(a&&a.content)n=_g(a.content,r);else if((i=er.find(e,"PerfectOffice_MAIN"))&&i.content)n=Po.to_workbook(i.content,(r.type=f,r));else if((i=er.find(e,"NativeContent_MAIN"))&&i.content)n=Po.to_workbook(i.content,(r.type=f,r));else if((i=er.find(e,"MN0"))&&i.content)throw new Error("Unsupported Works 4 for Mac file");else throw new Error("Cannot find Workbook stream");if(r.bookVBA&&e.FullPaths&&er.find(e,"/_VBA_PROJECT_CUR/VBA/dir"))n.vbaraw=Oh(e)}var o={};if(e.FullPaths)Og(e,o,r);n.Props=n.Custprops=o;if(r.bookFiles)n.cfb=e;return n}function Ig(e,r){var t=r||{};var a=er.utils.cfb_new({root:"R"});var n="/Workbook";switch(t.bookType||"xls"){case"xls":t.bookType="biff8";case"xla":if(!t.bookType)t.bookType="xla";case"biff8":n="/Workbook";t.biff=8;break;case"biff5":n="/Book";t.biff=5;break;default:throw new Error("invalid type "+t.bookType+" for XLS CFB");}er.utils.cfb_add(a,n,Qg(e,t));if(t.biff==8&&(e.Props||e.Custprops))Rg(e,a);if(t.biff==8&&e.vbaraw)Rh(a,er.read(e.vbaraw,{type:typeof e.vbaraw=="string"?"binary":"buffer"}));return a}var Fg={0:{f:Up},1:{f:jp},2:{f:uv},3:{f:ev},4:{f:Zp},5:{f:ov},6:{f:gv},7:{f:nv},8:{f:yv},9:{f:Ev},10:{f:Av},11:{f:Tv},12:{f:Yp},13:{f:pv},14:{f:tv},15:{f:qp},16:{f:cv},17:{f:wv},18:{f:sv},19:{f:en},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:_m},40:{},42:{},43:{f:sc},44:{f:nc},45:{f:cc},46:{f:vc},47:{f:uc},48:{},49:{f:Ya},50:{},51:{f:qc},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:co},62:{f:mv},63:{f:oh},64:{f:Hv},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:ba,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:Mv},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:Gp},148:{f:Hp,p:16},151:{f:Rv},152:{},153:{f:ym},154:{},155:{},156:{f:Tm},157:{},158:{},159:{T:1,f:Ko},160:{T:-1},161:{T:1,f:kn},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:Cv},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:Zc},336:{T:-1},337:{f:rh,T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:pn},357:{},358:{},359:{},360:{T:1},361:{},362:{f:Hf},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:Nv},427:{f:Iv},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:Pv},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:Vp},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:xv},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:pn},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:yh},633:{T:1},634:{T:-1},635:{T:1,f:Th},636:{T:-1},637:{f:tn},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:im},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:zv},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1
+},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}};var Dg={6:{f:yd},10:{f:as},12:{f:os},13:{f:os},14:{f:ss},15:{f:ss},16:{f:Tn},17:{f:ss},18:{f:ss},19:{f:os},20:{f:Mf},21:{f:Mf},23:{f:Hf},24:{f:Wf},25:{f:ss},26:{},27:{},28:{f:Yf},29:{},34:{f:ss},35:{f:Bf},38:{f:Tn},39:{f:Tn},40:{f:Tn},41:{f:Tn},42:{f:ss},43:{f:ss},47:{f:Tl},49:{f:pf},51:{f:os},60:{},61:{f:lf},64:{f:ss},65:{f:df},66:{f:os},77:{},80:{},81:{},82:{},85:{f:os},89:{},90:{},91:{},92:{f:Zs},93:{f:Jf},94:{},95:{f:ss},96:{},97:{},99:{f:ss},125:{f:co},128:{f:Nf},129:{f:qs},130:{f:os},131:{f:ss},132:{f:ss},133:{f:Qs},134:{},140:{f:io},141:{f:os},144:{},146:{f:oo},151:{},152:{},153:{},154:{},155:{},156:{f:os},157:{},158:{},160:{f:go},161:{f:uo},174:{},175:{},176:{},177:{},178:{},180:{},181:{},182:{},184:{},185:{},189:{f:Sf},190:{f:_f},193:{f:as},197:{},198:{},199:{},200:{},201:{},202:{f:ss},203:{},204:{},205:{},206:{},207:{},208:{},209:{},210:{},211:{},213:{},215:{},216:{},217:{},218:{f:os},220:{},221:{f:ss},222:{},224:{f:Of},225:{f:Ks},226:{f:as},227:{},229:{f:Kf},233:{},235:{},236:{},237:{},239:{},240:{},241:{},242:{},244:{},245:{},246:{},247:{},248:{},249:{},251:{},252:{f:rf},253:{f:mf},255:{f:af},256:{},259:{},290:{},311:{},312:{},315:{},317:{f:cs},318:{},319:{},320:{},330:{},331:{},333:{},334:{},335:{},336:{},337:{},338:{},339:{},340:{},351:{},352:{f:ss},353:{f:as},401:{},402:{},403:{},404:{},405:{},406:{},407:{},408:{},425:{},426:{},427:{},428:{},429:{},430:{f:Uf},431:{f:ss},432:{},433:{},434:{},437:{},438:{f:eo},439:{f:ss},440:{f:ro},441:{},442:{f:gs},443:{},444:{f:os},445:{},446:{},448:{f:as},449:{f:ff,r:2},450:{f:as},512:{f:Ef},513:{f:mo},515:{f:Pf},516:{f:bf},517:{f:Ff},519:{f:bo},520:{f:nf},523:{},545:{f:$f},549:{f:of},566:{},574:{f:hf},638:{f:Cf},659:{},1048:{},1054:{f:kf},1084:{},1212:{f:Gf},2048:{f:ao},2049:{},2050:{},2051:{},2052:{},2053:{},2054:{},2055:{},2056:{},2057:{f:Xs},2058:{},2059:{},2060:{},2061:{},2062:{},2063:{},2064:{},2066:{},2067:{},2128:{},2129:{},2130:{},2131:{},2132:{},2133:{},2134:{},2135:{},2136:{},2137:{},2138:{},2146:{},2147:{r:12},2148:{},2149:{},2150:{},2151:{f:as},2152:{},2154:{},2155:{},2156:{},2161:{},2162:{},2164:{},2165:{},2166:{},2167:{},2168:{},2169:{},2170:{},2171:{},2172:{f:lo,r:12},2173:{f:Yc,r:12},2174:{},2175:{},2180:{},2181:{},2182:{},2183:{},2184:{},2185:{},2186:{},2187:{},2188:{f:ss,r:12},2189:{},2190:{r:12},2191:{},2192:{},2194:{},2195:{},2196:{f:Vf,r:12},2197:{},2198:{f:zc,r:12},2199:{},2200:{},2201:{},2202:{f:jf,r:12},2203:{f:as},2204:{},2205:{},2206:{},2207:{},2211:{f:sf},2212:{},2213:{},2214:{},2215:{},4097:{},4098:{},4099:{},4102:{},4103:{},4105:{},4106:{},4107:{},4108:{},4109:{},4116:{},4117:{},4118:{},4119:{},4120:{},4121:{},4122:{},4123:{},4124:{},4125:{},4126:{},4127:{},4128:{},4129:{},4130:{},4132:{},4133:{},4134:{f:os},4135:{},4146:{},4147:{},4148:{},4149:{},4154:{},4156:{},4157:{},4158:{},4159:{},4160:{},4161:{},4163:{},4164:{f:po},4165:{},4166:{},4168:{},4170:{},4171:{},4174:{},4175:{},4176:{},4177:{},4187:{},4188:{f:fo},4189:{},4191:{},4192:{},4193:{},4194:{},4195:{},4196:{},4197:{},4198:{},4199:{},4200:{},0:{f:Ef},1:{},2:{f:Eo},3:{f:Ao},4:{f:ko},5:{f:Ff},7:{f:Co},8:{},9:{f:Xs},11:{},22:{f:os},30:{f:Tf},31:{},32:{},33:{f:$f},36:{},37:{f:of},50:{f:So},62:{},52:{},67:{},68:{f:os},69:{},86:{},126:{},127:{f:wo},135:{},136:{},137:{},145:{},148:{},149:{},150:{},169:{},171:{},188:{},191:{},192:{},194:{},195:{},214:{f:_o},223:{},234:{},354:{},421:{},518:{f:yd},521:{f:Xs},536:{f:Wf},547:{f:Bf},561:{},579:{},1030:{f:yd},1033:{f:Xs},1091:{},2157:{},2163:{},2177:{},2240:{},2241:{},2242:{},2243:{},2244:{},2245:{},2246:{},2247:{},2248:{},2249:{},2250:{},2251:{},2262:{r:12},101:{},102:{},105:{},106:{},107:{},109:{},112:{},114:{},29282:{}};function Pg(e,r,t,a){var n=r;if(isNaN(n))return;var i=a||(t||[]).length||0;var s=e.next(4);s._W(2,n);s._W(2,i);if(i>0&&aa(t))e.push(t)}function Lg(e,r,t,a){var n=a||(t||[]).length||0;if(n<=8224)return Pg(e,r,t,n);var i=r;if(isNaN(i))return;var s=t.parts||[],f=0;var o=0,l=0;while(l+(s[f]||8224)<=8224){l+=s[f]||8224;f++}var c=e.next(4);c._W(2,i);c._W(2,l);e.push(t.slice(o,o+l));o+=l;while(o=0&&n<65536)Pg(e,2,yo(t,a,n));else Pg(e,3,To(t,a,n));return;case"b":;case"e":Pg(e,5,Ug(t,a,r.v,r.t));return;case"s":;case"str":Pg(e,4,Bg(t,a,(r.v||"").slice(0,255)));return;}Pg(e,1,Mg(null,t,a))}function Hg(e,r,t,a){var n=Array.isArray(r);var i=za(r["!ref"]||"A1"),s,f="",o=[];if(i.e.c>255||i.e.r>16383){if(a.WTF)throw new Error("Range "+(r["!ref"]||"A1")+" exceeds format limit A1:IV16384");i.e.c=Math.min(i.e.c,255);i.e.r=Math.min(i.e.c,16383);s=Ba(i)}for(var l=i.s.r;l<=i.e.r;++l){f=xa(l);for(var c=i.s.c;c<=i.e.c;++c){if(l===i.s.r)o[c]=Ia(c);s=o[c]+f;var h=n?(r[l]||[])[c]:r[s];if(!h)continue;Wg(e,h,l,c,a)}}}function zg(e,r){var t=r||{};if(g!=null&&t.dense==null)t.dense=g;var a=Aa();var n=0;for(var i=0;i255||d.e.r>=p){if(r.WTF)throw new Error("Range "+(i["!ref"]||"A1")+" exceeds format limit A1:IV16384");d.e.c=Math.min(d.e.c,255);d.e.r=Math.min(d.e.c,p-1)}Pg(a,2057,Ys(t,16,r));Pg(a,13,ls(1));Pg(a,12,ls(100));Pg(a,15,fs(true));Pg(a,17,fs(false));Pg(a,16,En(.001));Pg(a,95,fs(true));Pg(a,42,fs(false));Pg(a,43,fs(false));Pg(a,130,ls(1));Pg(a,128,If([0,0]));Pg(a,131,fs(false));Pg(a,132,fs(false));if(l)Yg(a,i["!cols"]);Pg(a,512,yf(d,r));if(l)i["!links"]=[];var v=[];for(var m=d.s.r;m<=d.e.r;++m){h=xa(m);for(var g=d.s.c;g<=d.e.c;++g){if(m===d.s.r)u[g]=Ia(g);c=u[g]+h;var b=o?(i[m]||[])[g]:i[c];if(!b)continue;Kg(a,b,m,g,r);if(l&&b.l)i["!links"].push([c,b.l]);if(l&&b.c)v.push([c,b.c])}}var w=f.CodeName||f.name||n;if(l)Pg(a,574,uf((s.Views||[])[0]));if(l&&(i["!merges"]||[]).length)Pg(a,229,Zf(i["!merges"]));if(l)Xg(a,i);Pg(a,442,ws(w,r));if(l)$g(a,i);Pg(a,10);return a.end()}function Jg(e,r,t){var a=Aa();var n=(e||{}).Workbook||{};var i=n.Sheets||[];var s=n.WBProps||{};var f=t.biff==8,o=t.biff==5;Pg(a,2057,Ys(e,5,t));if(t.bookType=="xla")Pg(a,135);Pg(a,225,f?ls(1200):null);Pg(a,193,ns(2));if(o)Pg(a,191);if(o)Pg(a,192);Pg(a,226);Pg(a,92,Js("SheetJS",t));Pg(a,66,ls(f?1200:1252));if(f)Pg(a,353,ls(0));if(f)Pg(a,448);Pg(a,317,vo(e.SheetNames.length));if(f&&e.vbaraw)Pg(a,211);if(f&&e.vbaraw){var l=s.CodeName||"ThisWorkbook";Pg(a,442,ws(l,t))}Pg(a,156,ls(17));Pg(a,25,fs(false));Pg(a,18,fs(false));Pg(a,19,ls(0));if(f)Pg(a,431,fs(false));if(f)Pg(a,444,ls(0));Pg(a,61,cf(t));Pg(a,64,fs(false));Pg(a,141,ls(0));Pg(a,34,fs(pm(e)=="true"));Pg(a,14,fs(true));if(f)Pg(a,439,fs(false));Pg(a,218,ls(0));Vg(a,e,t);Gg(a,e.SSF,t);jg(a,t);if(f)Pg(a,352,fs(false));var c=a.end();var h=Aa();if(f)Pg(h,140,so());if(f&&t.Strings)Lg(h,252,tf(t.Strings,t));Pg(h,10);var u=h.end();var d=Aa();var p=0,v=0;for(v=0;v255){if(typeof console!="undefined"&&console.error)console.error("Worksheet '"+e.SheetNames[t]+"' extends beyond column IV (255). Data may be lost.")}}var i=r||{};switch(i.biff||2){case 8:;case 5:return qg(e,r);case 4:;case 3:;case 2:return zg(e,r);}throw new Error("invalid type "+i.bookType+" for BIFF")}function eb(e,r){var t=r||{};if(g!=null&&t.dense==null)t.dense=g;var a=t.dense?[]:{};e=e.replace(//g,"");var n=e.match(/");var i=e.match(/<\/table/i);var s=n.index,f=i&&i.index||e.length;var o=Rr(e.slice(s,f),/(:?]*>)/i,"
");var l=-1,c=0,h=0,u=0;var d={s:{r:1e7,c:1e7},e:{r:0,c:0}};var p=[];for(s=0;s/i);for(f=0;f"))>-1)k=k.slice(A+1);for(var T=0;T")));u=y.colspan?+y.colspan:1;if((h=+y.rowspan)>1||u>1)p.push({s:{r:l,c:c},e:{r:l+(h||1)-1,c:c+u-1}});var C=y.t||y["data-t"]||"";if(!k.length){c+=u;continue}k=wt(k);if(d.s.r>l)d.s.r=l;if(d.e.rc)d.s.c=c;if(d.e.ct||n[c].s.c>f)continue;if(n[c].e.r1)s.rowspan=o;if(l>1)s.colspan=l;if(a.editable)d=''+d+"";else if(u){s["data-t"]=u&&u.t||"z";if(u.v!=null)s["data-v"]=u.v;if(u.z!=null)s["data-z"]=u.z;if(u.l&&(u.l.Target||"#").charAt(0)!="#")d=''+d+""}s.id=(a.id||"sjs")+"-"+h;i.push(_t("td",d,s))}var p="";return p+i.join("")+"
"}var tb='SheetJS Table Export';var ab="";function nb(e,r){var t=e.match(/[\s\S]*?<\/table>/gi);if(!t||t.length==0)throw new Error("Invalid HTML: could not find ");if(t.length==1){var a=$a(eb(t[0],r),r);a.bookType="html";return a}var n=ck();t.forEach(function(e,t){hk(n,eb(e,r),"Sheet"+(t+1))});n.bookType="html";return n}function ib(e,r,t){var a=[];return a.join("")+""}function sb(e,r){var t=r||{};var a=t.header!=null?t.header:tb;var n=t.footer!=null?t.footer:ab;var i=[a];var s=Ua(e["!ref"]);t.dense=Array.isArray(e);i.push(ib(e,s,t));for(var f=s.s.r;f<=s.e.r;++f)i.push(rb(e,s,f,t));i.push("
"+n);return i.join("")}function fb(e,r,t){var a=r.rows;if(!a){throw"Unsupported origin when "+r.tagName+" is not a TABLE"}var n=t||{};if(g!=null)n.dense=g;var i=0,s=0;if(n.origin!=null){if(typeof n.origin=="number")i=n.origin;else{var f=typeof n.origin=="string"?La(n.origin):n.origin;i=f.r;s=f.c}}var o=Math.min(n.sheetRows||1e7,a.length);var l={s:{r:0,c:0},e:{r:i,c:s}};if(e["!ref"]){var c=Ua(e["!ref"]);l.s.r=Math.min(l.s.r,c.s.r);l.s.c=Math.min(l.s.c,c.s.c);l.e.r=Math.max(l.e.r,c.e.r);l.e.c=Math.max(l.e.c,c.e.c);if(i==-1)l.e.r=i=c.e.r+1}var h=[],u=0;var d=e["!rows"]||(e["!rows"]=[]);var p=0,v=0,m=0,b=0,w=0,k=0;if(!e["!cols"])e["!cols"]=[];for(;p1||k>1)h.push({s:{r:v+i,c:b+s},e:{r:v+i+(w||1)-1,c:b+s+(k||1)-1}});var _={t:"s",v:y};var x=E.getAttribute("data-t")||E.getAttribute("t")||"";if(y!=null){if(y.length==0)_.t=x||"z";else if(n.raw||y.trim().length==0||x=="s"){}else if(y==="TRUE")_={t:"b",v:true};else if(y==="FALSE")_={t:"b",v:false};else if(!isNaN(Cr(y)))_={t:"n",v:Cr(y)};else if(!isNaN(Or(y).getDate())){_={t:"d",v:Ar(y)};if(!n.cellDates)_={t:"n",v:ur(_.v)};_.z=n.dateNF||Z[14]}}if(_.z===undefined&&C!=null)_.z=C;var O="",R=E.getElementsByTagName("A");if(R&&R.length)for(var N=0;N=o)e["!fullref"]=Ba((l.e.r=a.length-p+v-1+i,l));return e}function ob(e,r){var t=r||{};var a=t.dense?[]:{};return fb(a,e,r)}function lb(e,r){var t=$a(ob(e,r),r);return t}function cb(e){var r="";var t=hb(e);if(t)r=t(e).getPropertyValue("display");if(!r)r=e.style&&e.style.display;return r==="none"}function hb(e){if(e.ownerDocument.defaultView&&typeof e.ownerDocument.defaultView.getComputedStyle==="function")return e.ownerDocument.defaultView.getComputedStyle;if(typeof getComputedStyle==="function")return getComputedStyle;return null}function ub(e){var r=e.replace(/[\t\r\n]/g," ").trim().replace(/ +/g," ").replace(//g," ").replace(//g,function(e,r){return Array(parseInt(r,10)+1).join(" ")}).replace(/]*\/>/g,"\t").replace(//g,"\n");var t=rt(r.replace(/<[^>]*>/g,""));return[t]}function db(e,r,t){var a=t||{};var n=Rt(e);Nt.lastIndex=0;n=n.replace(//gm,"").replace(//gm,"");var i,s,f="",o="",l,c=0,h=-1,u=false,d="";while(i=Nt.exec(n)){switch(i[3]=i[3].replace(/_.*$/,"")){case"number-style":;case"currency-style":;case"percentage-style":;case"date-style":;case"time-style":;case"text-style":if(i[1]==="/"){u=false;if(s["truncate-on-overflow"]=="false"){if(f.match(/h/))f=f.replace(/h+/,"[$&]");else if(f.match(/m/))f=f.replace(/m+/,"[$&]");else if(f.match(/s/))f=f.replace(/s+/,"[$&]")}a[s.name]=f;f=""}else if(i[0].charAt(i[0].length-2)!=="/"){u=true;f="";s=Jr(i[0],false)}break;case"boolean-style":if(i[1]==="/"){u=false;a[s.name]="General";f=""}else if(i[0].charAt(i[0].length-2)!=="/"){u=true;f="";s=Jr(i[0],false)}break;case"boolean":f+="General";break;case"text":if(i[1]==="/"){d=n.slice(h,Nt.lastIndex-i[0].length);if(d=="%"&&s[0]=="=0")f=a[l["apply-style-name"]]+";"+f;else console.error("ODS number format may be incorrect: "+l["condition"]);break;case"number":if(i[1]==="/")break;l=Jr(i[0],false);o="";o+=yr("0",+l["min-integer-digits"]||1);if(ht(l["grouping"]))o=de(yr("#",Math.max(0,4-o.length))+o);if(+l["min-decimal-places"]||+l["decimal-places"])o+=".";if(+l["min-decimal-places"])o+=yr("0",+l["min-decimal-places"]||1);if(+l["decimal-places"]-(+l["min-decimal-places"]||0))o+=yr("0",+l["decimal-places"]-(+l["min-decimal-places"]||0));f+=o;break;case"embedded-text":if(i[1]==="/"){if(c==0)f+='"'+n.slice(h,Nt.lastIndex-i[0].length).replace(/"/g,'""')+'"';else f=f.slice(0,c)+'"'+n.slice(h,Nt.lastIndex-i[0].length).replace(/"/g,'""')+'"'+f.slice(c)}else if(i[0].charAt(i[0].length-2)!=="/"){h=Nt.lastIndex;c=-+Jr(i[0],false)["position"]||0}break;}}return a}function pb(e,r,t){var a=r||{};if(g!=null&&a.dense==null)a.dense=g;var n=Rt(e);var i=[],s;var f;var o,l="",c=0;var h;var u;var d={},p=[];var v=a.dense?[]:{};var m,b;var w={value:""};var k="",A=0,T;var E=[];var y=-1,C=-1,S={s:{r:1e6,c:1e7},e:{r:0,c:0}};var _=0;var x=t||{},O={};var R=[],N={},I=0,F=0;var D=[],P=1,L=1;var M=[];var U={Names:[],WBProps:{}};var B={};var W=["",""];var H=[],z={};var V="",G=0;var $=false,j=false;var X=0;var Y=0;Nt.lastIndex=0;n=n.replace(//gm,"").replace(//gm,"");while(m=Nt.exec(n))switch(m[3]=m[3].replace(/_.*$/,"")){case"table":;case"工作表":if(m[1]==="/"){if(S.e.c>=S.s.c&&S.e.r>=S.s.r)v["!ref"]=Ba(S);else v["!ref"]="A1:A1";if(a.sheetRows>0&&a.sheetRows<=S.e.r){v["!fullref"]=v["!ref"];S.e.r=a.sheetRows-1;v["!ref"]=Ba(S)}if(R.length)v["!merges"]=R;if(D.length)v["!rows"]=D;h.name=h["名称"]||h.name;if(typeof JSON!=="undefined")JSON.stringify(h);p.push(h.name);d[h.name]=v;j=false}else if(m[0].charAt(m[0].length-2)!=="/"){h=Jr(m[0],false);y=C=-1;S.s.r=S.s.c=1e7;S.e.r=S.e.c=0;v=a.dense?[]:{};R=[];D=[];j=true}break;case"table-row-group":if(m[1]==="/")--_;else++_;break;case"table-row":;case"行":if(m[1]==="/"){y+=P;P=1;break}u=Jr(m[0],false);if(u["行号"])y=u["行号"]-1;else if(y==-1)y=0;P=+u["number-rows-repeated"]||1;if(P<10)for(X=0;X0)D[y+X]={level:_};C=-1;break;case"covered-table-cell":if(m[1]!=="/")++C;if(a.sheetStubs){if(a.dense){if(!v[y])v[y]=[];v[y][C]={t:"z"}}else v[Ma({r:y,c:C})]={t:"z"}}k="";E=[];break;case"table-cell":;case"数据":if(m[0].charAt(m[0].length-2)==="/"){++C;w=Jr(m[0],false);L=parseInt(w["number-columns-repeated"]||"1",10);b={t:"z",v:null};if(w.formula&&a.cellFormula!=false)b.f=jd(rt(w.formula));if(w["style-name"]&&O[w["style-name"]])b.z=O[w["style-name"]];if((w["数据类型"]||w["value-type"])=="string"){b.t="s";b.v=rt(w["string-value"]||"");if(a.dense){if(!v[y])v[y]=[];v[y][C]=b}else{v[Ma({r:y,c:C})]=b}}C+=L-1}else if(m[1]!=="/"){++C;k="";A=0;E=[];L=1;var K=P?y+P-1:y;if(C>S.e.c)S.e.c=C;if(CS.e.r)S.e.r=K;w=Jr(m[0],false);H=[];z={};b={t:w["数据类型"]||w["value-type"],v:null};if(w["style-name"]&&O[w["style-name"]])b.z=O[w["style-name"]];if(a.cellFormula){if(w.formula)w.formula=rt(w.formula);if(w["number-matrix-columns-spanned"]&&w["number-matrix-rows-spanned"]){I=parseInt(w["number-matrix-rows-spanned"],10)||0;F=parseInt(w["number-matrix-columns-spanned"],10)||0;N={s:{r:y,c:C},e:{r:y+I-1,c:C+F-1}};b.F=Ba(N);M.push([N,b.F])}if(w.formula)b.f=jd(w.formula);else for(X=0;X=M[X][0].s.r&&y<=M[X][0].e.r)if(C>=M[X][0].s.c&&C<=M[X][0].e.c)b.F=M[X][1]}if(w["number-columns-spanned"]||w["number-rows-spanned"]){I=parseInt(w["number-rows-spanned"],10)||0;F=parseInt(w["number-columns-spanned"],10)||0;N={s:{r:y,c:C},e:{r:y+I-1,c:C+F-1}};R.push(N)}if(w["number-columns-repeated"])L=parseInt(w["number-columns-repeated"],10);switch(b.t){case"boolean":b.t="b";b.v=ht(w["boolean-value"])||+w["boolean-value"]>=1;break;case"float":b.t="n";b.v=parseFloat(w.value);break;case"percentage":b.t="n";b.v=parseFloat(w.value);break;case"currency":b.t="n";b.v=parseFloat(w.value);break;case"date":b.t="d";b.v=Ar(w["date-value"]);if(!a.cellDates){b.t="n";b.v=ur(b.v,U.WBProps.date1904)-Y}if(!b.z)b.z="m/d/yy";break;case"time":b.t="n";b.v=gr(w["time-value"])/86400;if(a.cellDates){b.t="d";b.v=mr(b.v)}if(!b.z)b.z="HH:MM:SS";break;case"number":b.t="n";b.v=parseFloat(w["数据数值"]);break;default:if(b.t==="string"||b.t==="text"||!b.t){b.t="s";if(w["string-value"]!=null){k=rt(w["string-value"]);E=[]}}else throw new Error("Unsupported value type "+b.t);}}else{$=false;if(b.t==="s"){b.v=k||"";if(E.length)b.R=E;$=A==0}if(B.Target)b.l=B;if(H.length>0){b.c=H;H=[]}if(k&&a.cellText!==false)b.w=k;if($){b.t="z";delete b.v}if(!$||a.sheetStubs){if(!(a.sheetRows&&a.sheetRows<=y)){for(var Z=0;Z0)v[y+Z][C+L]=Er(b)}else{v[Ma({r:y+Z,c:C})]=b;while(--L>0)v[Ma({r:y+Z,c:C+L})]=Er(b)}if(S.e.c<=C)S.e.c=C}}}L=parseInt(w["number-columns-repeated"]||"1",10);C+=L-1;L=0;b={};k="";E=[]}B={};break;case"document":;case"document-content":;case"电子表格文档":;case"spreadsheet":;case"主体":;case"scripts":;case"styles":;case"font-face-decls":;case"master-styles":if(m[1]==="/"){if((s=i.pop())[0]!==m[3])throw"Bad state: "+s}else if(m[0].charAt(m[0].length-2)!=="/")i.push([m[3],true]);break;case"annotation":if(m[1]==="/"){if((s=i.pop())[0]!==m[3])throw"Bad state: "+s;z.t=k;if(E.length)z.R=E;z.a=V;H.push(z)}else if(m[0].charAt(m[0].length-2)!=="/"){i.push([m[3],false])}V="";G=0;k="";A=0;E=[];break;case"creator":if(m[1]==="/"){V=n.slice(G,m.index)}else G=m.index+m[0].length;break;case"meta":;case"元数据":;case"settings":;case"config-item-set":;case"config-item-map-indexed":;case"config-item-map-entry":;case"config-item-map-named":;case"shapes":;case"frame":;case"text-box":;case"image":;case"data-pilot-tables":;case"list-style":;case"form":;case"dde-links":;case"event-listeners":;case"chart":if(m[1]==="/"){if((s=i.pop())[0]!==m[3])throw"Bad state: "+s}else if(m[0].charAt(m[0].length-2)!=="/")i.push([m[3],false]);k="";A=0;E=[];break;case"scientific-number":;case"currency-symbol":;case"fill-character":break;case"text-style":;case"boolean-style":;case"number-style":;case"currency-style":;case"percentage-style":;case"date-style":;case"time-style":if(m[1]==="/"){var J=Nt.lastIndex;db(n.slice(o,Nt.lastIndex),r,x);Nt.lastIndex=J}else if(m[0].charAt(m[0].length-2)!=="/"){o=Nt.lastIndex-m[0].length}break;case"script":break;case"libraries":break;case"automatic-styles":break;case"default-style":;case"page-layout":break;case"style":{var q=Jr(m[0],false);if(q["family"]=="table-cell"&&x[q["data-style-name"]])O[q["name"]]=x[q["data-style-name"]]}break;case"map":break;case"font-face":break;case"paragraph-properties":break;case"table-properties":break;case"table-column-properties":break;case"table-row-properties":break;case"table-cell-properties":break;case"number":break;case"fraction":break;case"day":;case"month":;case"year":;case"era":;case"day-of-week":;case"week-of-year":;case"quarter":;case"hours":;case"minutes":;case"seconds":;case"am-pm":break;case"boolean":break;case"text":if(m[0].slice(-2)==="/>")break;else if(m[1]==="/")switch(i[i.length-1][0]){case"number-style":;case"date-style":;case"time-style":l+=n.slice(c,m.index);break;}else c=m.index+m[0].length;break;case"named-range":f=Jr(m[0],false);W=Yd(f["cell-range-address"]);var Q={Name:f.name,Ref:W[0]+"!"+W[1]};if(j)Q.Sheet=p.length;U.Names.push(Q);break;case"text-content":break;case"text-properties":break;case"embedded-text":break;case"body":;case"电子表格":break;case"forms":break;case"table-column":break;case"table-header-rows":break;case"table-rows":break;case"table-column-group":break;case"table-header-columns":break;case"table-columns":break;case"null-date":f=Jr(m[0],false);switch(f["date-value"]){case"1904-01-01":U.WBProps.date1904=true;case"1900-01-01":Y=0;}break;case"graphic-properties":break;case"calculation-settings":break;case"named-expressions":break;case"label-range":break;case"label-ranges":break;case"named-expression":break;case"sort":break;case"sort-by":break;case"sort-groups":break;case"tab":break;case"line-break":break;case"span":break;case"p":;case"文本串":if(["master-styles"].indexOf(i[i.length-1][0])>-1)break;if(m[1]==="/"&&(!w||!w["string-value"])){var ee=ub(n.slice(A,m.index),T);k=(k.length>0?k+"\n":"")+ee[0]}else{T=Jr(m[0],false);A=m.index+m[0].length}break;case"s":break;case"database-range":if(m[1]==="/")break;try{W=Yd(Jr(m[0])["target-range-address"]);d[W[0]]["!autofilter"]={ref:W[1]}}catch(re){}break;case"date":break;case"object":break;case"title":;case"标题":break;case"desc":break;case"binary-data":break;case"table-source":break;case"scenario":break;case"iteration":break;case"content-validations":break;case"content-validation":break;case"help-message":break;case"error-message":break;case"database-ranges":break;case"filter":break;case"filter-and":break;case"filter-or":break;case"filter-condition":break;case"list-level-style-bullet":break;case"list-level-style-number":break;case"list-level-properties":break;case"sender-firstname":;case"sender-lastname":;case"sender-initials":;case"sender-title":;case"sender-position":;case"sender-email":;case"sender-phone-private":;case"sender-fax":;case"sender-company":;case"sender-phone-work":;case"sender-street":;case"sender-city":;case"sender-postal-code":;case"sender-country":;case"sender-state-or-province":;case"author-name":;case"author-initials":;case"chapter":;case"file-name":;case"template-name":;case"sheet-name":break;case"event-listener":break;case"initial-creator":;case"creation-date":;case"print-date":;case"generator":;case"document-statistic":;case"user-defined":;case"editing-duration":;case"editing-cycles":break;case"config-item":break;case"page-number":break;case"page-count":break;case"time":break;case"cell-range-source":break;case"detective":break;case"operation":break;case"highlighted-range":break;case"data-pilot-table":;case"source-cell-range":;case"source-service":;case"data-pilot-field":;case"data-pilot-level":;case"data-pilot-subtotals":;case"data-pilot-subtotal":;case"data-pilot-members":;case"data-pilot-member":;case"data-pilot-display-info":;case"data-pilot-sort-info":;case"data-pilot-layout-info":;case"data-pilot-field-reference":;case"data-pilot-groups":;case"data-pilot-group":;case"data-pilot-group-member":break;case"rect":break;case"dde-connection-decls":;case"dde-connection-decl":;case"dde-link":;case"dde-source":break;case"properties":break;case"property":break;case"a":if(m[1]!=="/"){B=Jr(m[0],false);if(!B.href)break;B.Target=rt(B.href);delete B.href;if(B.Target.charAt(0)=="#"&&B.Target.indexOf(".")>-1){W=Yd(B.Target.slice(1));B.Target="#"+W[0]+"!"+W[1]}else if(B.Target.match(/^\.\.[\\\/]/))B.Target=B.Target.slice(3)}break;case"table-protection":break;case"data-pilot-grand-total":break;case"office-document-common-attrs":
+break;default:switch(m[2]){case"dc:":;case"calcext:":;case"loext:":;case"ooo:":;case"chartooo:":;case"draw:":;case"style:":;case"chart:":;case"form:":;case"uof:":;case"表:":;case"字:":break;default:if(a.WTF)throw new Error(m);};}var te={Sheets:d,SheetNames:p,Workbook:U};if(a.bookSheets)delete te.Sheets;return te}function vb(e,r){r=r||{};if(Dr(e,"META-INF/manifest.xml"))hi(Lr(e,"META-INF/manifest.xml"),r);var t=Mr(e,"styles.xml");var a=t&&db(mt(t),r);var n=Mr(e,"content.xml");if(!n)throw new Error("Missing content.xml in ODS / UOF file");var i=pb(mt(n),r,a);if(Dr(e,"meta.xml"))i.Props=wi(Lr(e,"meta.xml"));i.bookType="ods";return i}function mb(e,r){var t=pb(e,r);t.bookType="fods";return t}var gb=function(){var e=["",'',"",'',"",'',"",""].join("");var r=""+e+"";return function t(){return Gr+r}}();function bb(e,r){var t="number",a="",n={"style:name":r},i="",s=0;e=e.replace(/"[$]"/g,"$");e:{if(e.indexOf(";")>-1){console.error("Unsupported ODS Style Map exported. Using first branch of "+e);e=e.slice(0,e.indexOf(";"))}if(e=="@"){t="text";a="";break e}if(e.indexOf(/\$/)>-1){t="currency"}if(e[s]=='"'){i="";while(e[++s]!='"'||e[++s]=='"')i+=e[s];--s;if(e[s+1]=="*"){s++;a+=""+nt(i.replace(/""/g,'"'))+""}else{a+=""+nt(i.replace(/""/g,'"'))+""}e=e.slice(s+1);s=0}var f=e.match(/# (\?+)\/(\?+)/);if(f){a+=_t("number:fraction",null,{"number:min-integer-digits":0,"number:min-numerator-digits":f[1].length,"number:max-denominator-value":Math.max(+f[1].replace(/./g,"9"),+f[2].replace(/./g,"9"))});break e}if(f=e.match(/# (\?+)\/(\d+)/)){a+=_t("number:fraction",null,{"number:min-integer-digits":0,"number:min-numerator-digits":f[1].length,"number:denominator-value":+f[2]});break e}if(f=e.match(/(\d+)(|\.\d+)%/)){t="percentage";a+=_t("number:number",null,{"number:decimal-places":f[2]&&f.length-1||0,"number:min-decimal-places":f[2]&&f.length-1||0,"number:min-integer-digits":f[1].length})+"%";break e}var o=false;if(["y","m","d"].indexOf(e[0])>-1){t="date";r:for(;s";break;case"yyy":;case"yyyy":a+='';break;case"mmmmm":console.error("ODS has no equivalent of format |mmmmm|");case"m":;case"mm":;case"mmm":;case"mmmm":a+='';break;case"d":;case"dd":a+='';break;case"ddd":;case"dddd":a+='';break;}break;case'"':while(e[++s]!='"'||e[++s]=='"')i+=e[s];--s;a+=""+nt(i.slice(1).replace(/""/g,'"'))+"";break;case"/":a+=""+nt(i)+"";break;default:console.error("unrecognized character "+i+" in ODF format "+e);}if(!o)break e;e=e.slice(s+1);s=0}if(e.match(/^\[?[hms]/)){if(t=="number")t="time";if(e.match(/\[/)){e=e.replace(/[\[\]]/g,"");n["number:truncate-on-overflow"]="false"}for(;s';break;case"m":;case"mm":a+='';break;case"s":;case"ss":if(e[s+1]==".")do{i+=e[s+1];++s}while(e[s+1]=="0");a+='";break;}break;case'"':while(e[++s]!='"'||e[++s]=='"')i+=e[s];--s;a+=""+nt(i.slice(1).replace(/""/g,'"'))+"";break;case"/":a+=""+nt(i)+"";break;case"a":if(e.slice(s,s+3).toLowerCase()=="a/p"){a+="";s+=2;break}if(e.slice(s,s+5).toLowerCase()=="am/pm"){a+="";s+=4;break};default:console.error("unrecognized character "+i+" in ODF format "+e);}break e}if(e.indexOf(/\$/)>-1){t="currency"}if(e[0]=="$"){a+='$';e=e.slice(1);s=0}s=0;if(e[s]=='"'){while(e[++s]!='"'||e[++s]=='"')i+=e[s];--s;if(e[s+1]=="*"){s++;a+=""+nt(i.replace(/""/g,'"'))+""}else{a+=""+nt(i.replace(/""/g,'"'))+""}e=e.slice(s+1);s=0}var c=e.match(/([#0][0#,]*)(\.[0#]*|)(E[+]?0*|)/i);if(!c||!c[0])console.error("Could not find numeric part of "+e);else{var h=c[1].replace(/,/g,"");a+="-1?' number:grouping="true"':"")+(c[2]&&' number:decimal-places="'+(c[2].length-1)+'"'||' number:decimal-places="0"')+(c[3]&&c[3].indexOf("+")>-1?' number:forced-exponent-sign="true"':"")+(c[3]?' number:min-exponent-digits="'+c[3].match(/0+/)[0].length+'"':"")+">"+"";s=c.index+c[0].length}if(e[s]=='"'){i="";while(e[++s]!='"'||e[++s]=='"')i+=e[s];--s;a+=""+nt(i.replace(/""/g,'"'))+""}}if(!a){console.error("Could not generate ODS number format for |"+e+"|");return""}return _t("number:"+t+"-style",a,n)}function wb(e,r,t){var a=e.filter(function(e){return e.Sheet==(t==-1?null:t)});if(!a.length)return"";return" \n"+a.map(function(e){var r=Kd(e.Ref);return" "+_t("table:named-range",null,{"table:name":e.Name,"table:cell-range-address":r,"table:base-cell-address":r.replace(/[\.]?[^\.]*$/,".$A$1")})}).join("\n")+"\n \n"}var kb=function(){var e=function(e){return nt(e).replace(/ +/g,function(e){return''}).replace(/\t/g,"").replace(/\n/g,"").replace(/^ /,"").replace(/ $/,"")};var r=" \n";var t=" \n";var a=function(a,n,i,s,f){var o=[];o.push(' \n');var l=0,c=0,h=Ua(a["!ref"]||"A1");var u=a["!merges"]||[],d=0;var p=Array.isArray(a);if(a["!cols"]){for(c=0;c<=h.e.c;++c)o.push(" \n")}var v="",m=a["!rows"]||[];for(l=0;l\n")}for(;l<=h.e.r;++l){v=m[l]?' table:style-name="ro'+m[l].ods+'"':"";o.push(" \n");for(c=0;cc)continue;if(u[d].s.r>l)continue;if(u[d].e.c\n")}if((n.Workbook||{}).Names)o.push(wb(n.Workbook.Names,n.SheetNames,i));o.push(" \n");return o.join("")};var n=function(e,r){e.push(" \n");var t=0;r.SheetNames.map(function(e){return r.Sheets[e]}).forEach(function(r){if(!r)return;if(r["!cols"]){for(var a=0;a\n');e.push(' \n');e.push(" \n");++t}}});var a=0;r.SheetNames.map(function(e){return r.Sheets[e]}).forEach(function(r){if(!r)return;if(r["!rows"]){for(var t=0;t\n');e.push(' \n');e.push(" \n");++a}}});e.push(' \n');e.push(' \n');e.push(" \n");e.push(' \n');e.push(' \n');e.push(" /\n");e.push(' \n');e.push(" /\n");e.push(" \n");e.push(" \n");var n={};var i=69;r.SheetNames.map(function(e){return r.Sheets[e]}).forEach(function(r){if(!r)return;var t=Ua(r["!ref"]);for(var a=0;a<=t.e.r;++a)for(var s=0;s<=t.e.c;++s){var f=Array.isArray(r)?(r[a]||[])[s]:r[Ma({r:a,c:s})];if(!f||!f.z||f.z.toLowerCase()=="general")continue;if(!n[f.z]){var o=bb(f.z,"N"+i);if(o){n[f.z]="N"+i;++i;e.push(o+"\n")}}}});e.push(' \n');sr(n).forEach(function(r){e.push('\n')});e.push(" \n");return n};return function i(e,r){var t=[Gr];var i=St({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:meta":"urn:oasis:names:tc:opendocument:xmlns:meta:1.0","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:presentation":"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:chart":"urn:oasis:names:tc:opendocument:xmlns:chart:1.0","xmlns:dr3d":"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0","xmlns:math":"http://www.w3.org/1998/Math/MathML","xmlns:form":"urn:oasis:names:tc:opendocument:xmlns:form:1.0","xmlns:script":"urn:oasis:names:tc:opendocument:xmlns:script:1.0","xmlns:ooo":"http://openoffice.org/2004/office","xmlns:ooow":"http://openoffice.org/2004/writer","xmlns:oooc":"http://openoffice.org/2004/calc","xmlns:dom":"http://www.w3.org/2001/xml-events","xmlns:xforms":"http://www.w3.org/2002/xforms","xmlns:xsd":"http://www.w3.org/2001/XMLSchema","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xmlns:sheet":"urn:oasis:names:tc:opendocument:sh33tjs:1.0","xmlns:rpt":"http://openoffice.org/2005/report","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","xmlns:xhtml":"http://www.w3.org/1999/xhtml","xmlns:grddl":"http://www.w3.org/2003/g/data-view#","xmlns:tableooo":"http://openoffice.org/2009/table","xmlns:drawooo":"http://openoffice.org/2010/draw","xmlns:calcext":"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0","xmlns:loext":"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0","xmlns:field":"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0","xmlns:formx":"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0","xmlns:css3t":"http://www.w3.org/TR/css3-text/","office:version":"1.2"});var s=St({"xmlns:config":"urn:oasis:names:tc:opendocument:xmlns:config:1.0","office:mimetype":"application/vnd.oasis.opendocument.spreadsheet"});if(r.bookType=="fods"){t.push("\n");t.push(mi().replace(//,"").replace(/<\/office:document-meta>/,"")+"\n")}else t.push("\n");var f=n(t,e);t.push(" \n");t.push(" \n");if(((e.Workbook||{}).WBProps||{}).date1904)t.push(' \n \n \n');for(var o=0;o!=e.SheetNames.length;++o)t.push(a(e.Sheets[e.SheetNames[o]],e,o,r,f));if((e.Workbook||{}).Names)t.push(wb(e.Workbook.Names,e.SheetNames,-1));t.push(" \n");t.push(" \n");if(r.bookType=="fods")t.push("");else t.push("");return t.join("")}}();function Ab(e,r){if(r.bookType=="fods")return kb(e,r);var t=Hr();var a="";var n=[];var i=[];a="mimetype";Wr(t,a,"application/vnd.oasis.opendocument.spreadsheet");a="content.xml";Wr(t,a,kb(e,r));n.push([a,"text/xml"]);i.push([a,"ContentFile"]);a="styles.xml";Wr(t,a,gb(e,r));n.push([a,"text/xml"]);i.push([a,"StylesFile"]);a="meta.xml";Wr(t,a,Gr+mi());n.push([a,"text/xml"]);i.push([a,"MetadataFile"]);a="manifest.rdf";Wr(t,a,vi(i));n.push([a,"application/rdf+xml"]);a="META-INF/manifest.xml";Wr(t,a,ui(n));return t}var Tb=function(){try{if(typeof Uint8Array=="undefined")return"slice";if(typeof Uint8Array.prototype.subarray=="undefined")return"slice";if(typeof Buffer!=="undefined"){if(typeof Buffer.prototype.subarray=="undefined")return"slice";if((typeof Buffer.from=="function"?Buffer.from([72,62]):new Buffer([72,62]))instanceof Uint8Array)return"subarray";return"slice"}return"subarray"}catch(e){return"slice"}}();function Eb(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function yb(e){return typeof TextDecoder!="undefined"?(new TextDecoder).decode(e):mt(R(e))}function Cb(e){return typeof TextEncoder!="undefined"?(new TextEncoder).encode(e):x(gt(e))}function Sb(e,r){var t=e.indexOf(r[0]);if(t==-1)return false;e:for(;t<=e.length-r.length;++t){for(var a=0;a>1&1431655765;e=(e&858993459)+(e>>2&858993459);return(e+(e>>4)&252645135)*16843009>>>24}function Ob(e,r){var t=(e[r+15]&127)<<7|e[r+14]>>1;var a=e[r+14]&1;for(var n=r+13;n>=r;--n)a=a*256+e[n];return(e[r+15]&128?-a:a)*Math.pow(10,t-6176)}function Rb(e,r,t){var a=Math.floor(t==0?0:Math.LOG10E*Math.log(Math.abs(t)))+6176-16;var n=t/Math.pow(10,a-6176);e[r+15]|=a>>7;e[r+14]|=(a&127)<<1;for(var i=0;n>=1;++i,n/=256)e[r+i]=n&255;e[r+15]|=t>=0?0:128}function Nb(e,r){var t=r?r[0]:0;var a=e[t]&127;e:if(e[t++]>=128){a|=(e[t]&127)<<7;if(e[t++]<128)break e;a|=(e[t]&127)<<14;if(e[t++]<128)break e;a|=(e[t]&127)<<21;if(e[t++]<128)break e;a+=(e[t]&127)*Math.pow(2,28);++t;if(e[t++]<128)break e;a+=(e[t]&127)*Math.pow(2,35);++t;if(e[t++]<128)break e;a+=(e[t]&127)*Math.pow(2,42);++t;if(e[t++]<128)break e}if(r)r[0]=t;return a}function Ib(e){var r=new Uint8Array(7);r[0]=e&127;var t=1;e:if(e>127){r[t-1]|=128;r[t]=e>>7&127;++t;if(e<=16383)break e;r[t-1]|=128;r[t]=e>>14&127;++t;if(e<=2097151)break e;r[t-1]|=128;r[t]=e>>21&127;++t;if(e<=268435455)break e;r[t-1]|=128;r[t]=e/256>>>21&127;++t;if(e<=34359738367)break e;r[t-1]|=128;r[t]=e/65536>>>21&127;++t;if(e<=4398046511103)break e;r[t-1]|=128;r[t]=e/16777216>>>21&127;++t}return r[Tb](0,t)}function Fb(e){var r=[0];var t=[];while(r[0]=128){t|=(e[r]&127)<<7;if(e[r++]<128)break e;t|=(e[r]&127)<<14;if(e[r++]<128)break e;t|=(e[r]&127)<<21;if(e[r++]<128)break e;t|=(e[r]&127)<<28}return t}function Lb(e){var r=[],t=[0];while(t[0]=128);f=e[Tb](o,t[0])}break;case 5:s=4;f=e[Tb](t[0],t[0]+s);t[0]+=s;break;case 1:s=8;f=e[Tb](t[0],t[0]+s);t[0]+=s;break;case 2:s=Nb(e,t);f=e[Tb](t[0],t[0]+s);t[0]+=s;break;case 3:;case 4:;default:throw new Error("PB Type ".concat(i," for Field ").concat(n," at offset ").concat(a));}var l={data:f,type:i};if(r[n]==null)r[n]=[l];else r[n].push(l)}return r}function Mb(e){var r=[];e.forEach(function(e,t){if(t==0)return;e.forEach(function(e){if(!e.data)return;r.push(Ib(t*8+e.type));if(e.type==2)r.push(Ib(e.data.length));r.push(e.data)})});return _b(r)}function Ub(e,r){return(e==null?void 0:e.map(function(e){return r(e.data)}))||[]}function Bb(e){var r;var t=[],a=[0];while(a[0]>>0>0;t.push(s)}return t}function Wb(e){var r=[];e.forEach(function(e){var t=[[],[{data:Ib(e.id),type:0}],[]];if(e.merge!=null)t[3]=[{data:Ib(+!!e.merge),type:0}];var a=[];e.messages.forEach(function(e){a.push(e.data);e.meta[3]=[{type:0,data:Ib(e.data.length)}];t[2].push({data:Mb(e.meta),type:2})});var n=Mb(t);r.push(Ib(n.length));r.push(n);a.forEach(function(e){return r.push(e)})});return _b(r)}function Hb(e,r){if(e!=0)throw new Error("Unexpected Snappy chunk type ".concat(e));var t=[0];var a=Nb(r,t);var n=[];while(t[0]>2;if(s<60)++s;else{var f=s-59;s=r[t[0]];if(f>1)s|=r[t[0]+1]<<8;if(f>2)s|=r[t[0]+2]<<16;if(f>3)s|=r[t[0]+3]<<24;s>>>=0;s++;t[0]+=f}n.push(r[Tb](t[0],t[0]+s));t[0]+=s;continue}else{var o=0,l=0;if(i==1){l=(r[t[0]]>>2&7)+4;o=(r[t[0]++]&224)<<3;o|=r[t[0]++]}else{l=(r[t[0]++]>>2)+1;if(i==2){o=r[t[0]]|r[t[0]+1]<<8;t[0]+=2}else{o=(r[t[0]]|r[t[0]+1]<<8|r[t[0]+2]<<16|r[t[0]+3]<<24)>>>0;t[0]+=4}}if(o==0)throw new Error("Invalid offset 0");var c=n.length-1,h=o;while(c>=0&&h>=n[c].length){h-=n[c].length;--c}if(c<0){if(h==0)h=n[c=0].length;else throw new Error("Invalid offset beyond length")}if(l0){n.push(n[c][Tb](n[c].length-h));l-=h}++c;while(l>=n[c].length){n.push(n[c]);l-=n[c].length;++c}if(l)n.push(n[c][Tb](0,l))}if(n.length>100)n=[_b(n)]}}if(n.reduce(function(e,r){return e+r.length},0)!=a)throw new Error("Unexpected length: ".concat(n.reduce(function(e,r){return e+r.length},0)," != ").concat(a));return n}function zb(e){if(Array.isArray(e))e=new Uint8Array(e);var r=[];var t=0;while(t>8&255]))}else if(a<=16777216){s+=4;r.push(new Uint8Array([248,a-1&255,a-1>>8&255,a-1>>16&255]))}else if(a<=4294967296){s+=5;r.push(new Uint8Array([252,a-1&255,a-1>>8&255,a-1>>16&255,a-1>>>24&255]))}r.push(e[Tb](t,t+a));s+=a;n[0]=0;n[1]=s&255;n[2]=s>>8&255;n[3]=s>>16&255;t+=a}return _b(r)}var Gb=function(){return{sst:[],rsst:[],ofmt:[],nfmt:[]}};function $b(e,r,t,a,n){var i,s,f,o;var l=r&255,c=r>>8;var h=c>=5?n:a;e:if(t&(c>4?8:4)&&e.t=="n"&&l==7){var u=((i=h[7])==null?void 0:i[0])?Nb(h[7][0].data):-1;if(u==-1)break e;var d=((s=h[15])==null?void 0:s[0])?Nb(h[15][0].data):-1;var p=((f=h[16])==null?void 0:f[0])?Nb(h[16][0].data):-1;var v=((o=h[40])==null?void 0:o[0])?Nb(h[40][0].data):-1;var m=e.v,g=m;r:if(v){if(m==0){d=p=2;break r}if(m>=604800)d=1;else if(m>=86400)d=2;else if(m>=3600)d=4;else if(m>=60)d=8;else if(m>=1)d=16;else d=32;if(Math.floor(m)!=m)p=32;else if(m%60)p=16;else if(m%3600)p=8;else if(m%86400)p=4;else if(m%604800)p=2;if(p=2){g=m/86400;if(p>2){g|=0;m-=86400*g}w.push('d"d"');b.push(g+(u==2?" day"+(g==1?"":"s"):u==1?"d":""))}if(d<=4&&p>=4){g=m/3600;if(p>4){g|=0;m-=3600*g}w.push((d>=4?"[h]":"h")+'"h"');b.push(g+(u==2?" hour"+(g==1?"":"s"):u==1?"h":""))}if(d<=8&&p>=8){g=m/60;if(p>8){g|=0;m-=60*g}w.push((d>=8?"[m]":"m")+'"m"');if(u==0)b.push((d==8&&p==8||g>=10?"":"0")+g);else b.push(g+(u==2?" minute"+(g==1?"":"s"):u==1?"m":""))}if(d<=16&&p>=16){g=m;if(p>16){g|=0;m-=g}w.push((d>=16?"[s]":"s")+'"s"');if(u==0)b.push((p==16&&d==16||g>=10?"":"0")+g);else b.push(g+(u==2?" second"+(g==1?"":"s"):u==1?"s":""))}if(p>=32){g=Math.round(1e3*m);if(d<32)w.push('.000"ms"');if(u==0)b.push((g>=100?"":g>=10?"0":"00")+g);else b.push(g+(u==2?" millisecond"+(g==1?"":"s"):u==1?"ms":""))}e.w=b.join(u==0?":":" ");e.z=w.join(u==0?'":"':" ");if(u==0)e.w=e.w.replace(/:(\d\d\d)$/,".$1")}}function jb(e,r,t){var a=Eb(e);var n=a.getUint32(4,true);var i=-1,s=-1,f=-1,o=NaN,l=new Date(2001,0,1);var c=t>1?12:8;if(n&2){f=a.getUint32(c,true);c+=4}c+=xb(n&(t>1?3468:396))*4;if(n&512){i=a.getUint32(c,true);c+=4}c+=xb(n&(t>1?12288:4096))*4;if(n&16){s=a.getUint32(c,true);c+=4}if(n&32){o=a.getFloat64(c,true);c+=8}if(n&64){l.setTime(l.getTime()+a.getFloat64(c,true)*1e3);c+=8}if(t>1){n=a.getUint32(8,true)>>>16;if(n&255){if(f==-1)f=a.getUint32(c,true);c+=4}}var h;var u=e[t>=4?1:2];switch(u){case 0:return void 0;case 2:h={t:"n",v:o};break;case 3:h={t:"s",v:r.sst[s]};break;case 5:h={t:"d",v:l};break;case 6:h={t:"b",v:o>0};break;case 7:h={t:"n",v:o};break;case 8:h={t:"e",v:0};break;case 9:{if(i>-1)h={t:"s",v:r.rsst[i]};else throw new Error("Unsupported cell type ".concat(e[Tb](0,4)))}break;default:throw new Error("Unsupported cell type ".concat(e[Tb](0,4)));}if(f>-1)$b(h,u|t<<8,n,r.ofmt[f],r.nfmt[f]);if(u==7)h.v/=86400;return h}function Xb(e,r){var t=Eb(e);var a=t.getUint32(4,true);var n=t.getUint32(8,true);var i=12;var s=-1,f=-1,o=-1,l=NaN,c=NaN,h=new Date(2001,0,1);if(n&1){l=Ob(e,i);i+=16}if(n&2){c=t.getFloat64(i,true);i+=8}if(n&4){h.setTime(h.getTime()+t.getFloat64(i,true)*1e3);i+=8}if(n&8){f=t.getUint32(i,true);i+=4}if(n&16){s=t.getUint32(i,true);i+=4}var u;var d=e[1];switch(d){case 0:return void 0;case 2:u={t:"n",v:l};break;case 3:u={t:"s",v:r.sst[f]};break;case 5:u={t:"d",v:h};break;case 6:u={t:"b",v:c>0};break;case 7:u={t:"n",v:c};break;case 8:u={t:"e",v:0};break;case 9:u={t:"s",v:r.rsst[s]};break;case 10:u={t:"n",v:l};break;default:throw new Error("Unsupported cell type ".concat(e[1]," : ").concat(n&31," : ").concat(e[Tb](0,4)));}i+=xb(n&8160)*4;if(n&516096){if(o==-1)o=t.getUint32(i,true);i+=4}if(o>-1)$b(u,d|5<<8,n>>13,r.ofmt[o],r.nfmt[o]);if(d==7)u.v/=86400;return u}function Yb(e,r){var t=new Uint8Array(32),a=Eb(t),n=12,i=0;t[0]=5;switch(e.t){case"n":t[1]=2;Rb(t,n,e.v);i|=1;n+=16;break;case"b":t[1]=6;a.setFloat64(n,e.v?1:0,true);i|=2;n+=8;break;case"s":if(r.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));t[1]=3;a.setUint32(n,r.indexOf(e.v),true);i|=8;n+=4;break;default:throw"unsupported cell type "+e.t;}a.setUint32(8,i,true);return t[Tb](0,n)}function Kb(e,r){var t=new Uint8Array(32),a=Eb(t),n=12,i=0;t[0]=4;switch(e.t){case"n":t[2]=2;a.setFloat64(n,e.v,true);i|=32;n+=8;break;case"b":t[2]=6;a.setFloat64(n,e.v?1:0,true);i|=32;n+=8;break;case"s":if(r.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));t[2]=3;a.setUint32(n,r.indexOf(e.v),true);i|=16;n+=4;break;default:throw"unsupported cell type "+e.t;}a.setUint32(8,i,true);return t[Tb](0,n)}function Zb(e,r){switch(e[0]){case 0:;case 1:;case 2:;case 3:;case 4:return jb(e,r,e[0]);case 5:return Xb(e,r);default:throw new Error("Unsupported payload version ".concat(e[0]));}}function Jb(e){var r=Lb(e);return Nb(r[1][0].data)}function qb(e){return Mb([[],[{type:0,data:Ib(e)}]])}function Qb(e,r){var t=Lb(r.data);var a=Pb(t[1][0].data);var n=t[3];var i=[];(n||[]).forEach(function(r){var t=Lb(r.data);var n=Pb(t[1][0].data)>>>0;switch(a){case 1:i[n]=yb(t[3][0].data);break;case 8:{var s=e[Jb(t[9][0].data)][0];var f=Lb(s.data);var o=e[Jb(f[1][0].data)][0];var l=Pb(o.meta[1][0].data);if(l!=2001)throw new Error("2000 unexpected reference to ".concat(l));var c=Lb(o.data);i[n]=c[3].map(function(e){return yb(e.data)}).join("")}break;case 2:i[n]=Lb(t[6][0].data);break;default:throw a;}});return i}function ew(e,r){var t,a,n,i,s,f,o,l,c,h,u,d,p,v;var m=Lb(e);var g=Pb(m[1][0].data)>>>0;var b=Pb(m[2][0].data)>>>0;var w=((a=(t=m[8])==null?void 0:t[0])==null?void 0:a.data)&&Pb(m[8][0].data)>0||false;var k,A;if(((i=(n=m[7])==null?void 0:n[0])==null?void 0:i.data)&&r!=0){k=(f=(s=m[7])==null?void 0:s[0])==null?void 0:f.data;A=(l=(o=m[6])==null?void 0:o[0])==null?void 0:l.data}else if(((h=(c=m[4])==null?void 0:c[0])==null?void 0:h.data)&&r!=1){k=(d=(u=m[4])==null?void 0:u[0])==null?void 0:d.data;A=(v=(p=m[3])==null?void 0:p[0])==null?void 0:v.data}else throw"NUMBERS Tile missing ".concat(r," cell storage");var T=w?4:1;var E=Eb(k);var y=[];for(var C=0;C=1)_[y[y.length-1][0]]=A[Tb](y[y.length-1][1]*T);return{R:g,cells:_}}function rw(e,r){var t;var a=Lb(r.data);var n=-1;if((t=a==null?void 0:a[7])==null?void 0:t[0]){if(Pb(a[7][0].data)>>>0)n=1;else n=0}var i=Ub(a[5],function(e){return ew(e,n)});return{nrows:Pb(a[4][0].data)>>>0,data:i.reduce(function(e,r){if(!e[r.R])e[r.R]=[];r.cells.forEach(function(t,a){if(e[r.R][a])throw new Error("Duplicate cell r=".concat(r.R," c=").concat(a));e[r.R][a]=t});return e},[])}}function tw(e,r,t){var a,n,i,s,f,o;var l=Lb(r.data);var c={s:{r:0,c:0},e:{r:0,c:0}};c.e.r=(Pb(l[6][0].data)>>>0)-1;if(c.e.r<0)throw new Error("Invalid row varint ".concat(l[6][0].data));c.e.c=(Pb(l[7][0].data)>>>0)-1;if(c.e.c<0)throw new Error("Invalid col varint ".concat(l[7][0].data));t["!ref"]=Ba(c);var h=Array.isArray(t);var u=Lb(l[4][0].data);var d=Gb();if((a=u[4])==null?void 0:a[0])d.sst=Qb(e,e[Jb(u[4][0].data)][0]);if((n=u[11])==null?void 0:n[0])d.ofmt=Qb(e,e[Jb(u[11][0].data)][0]);if((i=u[17])==null?void 0:i[0])d.rsst=Qb(e,e[Jb(u[17][0].data)][0]);if((s=u[22])==null?void 0:s[0])d.nfmt=Qb(e,e[Jb(u[22][0].data)][0]);var p=Lb(u[3][0].data);var v=0;p[1].forEach(function(r){var a=Lb(r.data);var n=e[Jb(a[2][0].data)][0];var i=Pb(n.meta[1][0].data);if(i!=6002)throw new Error("6001 unexpected reference to ".concat(i));var s=rw(e,n);s.data.forEach(function(e,r){e.forEach(function(e,a){var n=Zb(e,d);if(n){if(h){if(!t[v+r])t[v+r]=[];t[v+r][a]=n}else{var i=Ma({r:v+r,c:a});t[i]=n}}})});v+=s.nrows});if((f=u[13])==null?void 0:f[0]){var m=e[Jb(u[13][0].data)][0];var g=Pb(m.meta[1][0].data);if(g!=6144)throw new Error("Expected merge type 6144, found ".concat(g));t["!merges"]=(o=Lb(m.data))==null?void 0:o[1].map(function(e){var r=Lb(e.data);var t=Eb(Lb(r[1][0].data)[1][0].data),a=Eb(Lb(r[2][0].data)[1][0].data);return{s:{r:t.getUint16(0,true),c:t.getUint16(2,true)},e:{r:t.getUint16(0,true)+a.getUint16(0,true)-1,c:t.getUint16(2,true)+a.getUint16(2,true)-1}}})}}function aw(e,r,t){var a=Lb(r.data);var n;if(!(t==null?void 0:t.dense))n={"!ref":"A1"};else n=[];n["!ref"]="A1";var i=e[Jb(a[2][0].data)];var s=Pb(i[0].meta[1][0].data);if(s!=6001)throw new Error("6000 unexpected reference to ".concat(s));tw(e,i[0],n);return n}function nw(e,r,t){var a;var n=Lb(r.data);var i={name:((a=n[1])==null?void 0:a[0])?yb(n[1][0].data):"",sheets:[]};var s=Ub(n[2],Jb);s.forEach(function(r){e[r].forEach(function(r){var a=Pb(r.meta[1][0].data);if(a==6e3)i.sheets.push(aw(e,r,t))})});return i}function iw(e,r,t){var a;var n=ck();var i=Lb(r.data);if((a=i[2])==null?void 0:a[0])throw new Error("Keynote presentations are not supported");var s=Ub(i[1],Jb);s.forEach(function(r){e[r].forEach(function(r){var a=Pb(r.meta[1][0].data);if(a==2){var i=nw(e,r,t);i.sheets.forEach(function(e,r){hk(n,e,r==0?i.name:i.name+"_"+r,true)})}})});if(n.SheetNames.length==0)throw new Error("Empty NUMBERS file");n.bookType="numbers";return n}function sw(e,r){var t,a,n,i,s,f,o,l;var c={},h=[];e.FullPaths.forEach(function(e){if(e.match(/\.iwpv2/))throw new Error("Unsupported password protection")});e.FileIndex.forEach(function(e){if(!e.name.match(/\.iwa$/))return;if(e.content[0]==98)return;var r;try{r=zb(e.content)}catch(t){return console.log("?? "+e.content.length+" "+(t.message||t))}var a;try{a=Bb(r)}catch(t){return console.log("## "+(t.message||t))}a.forEach(function(e){c[e.id]=e.messages;h.push(e.id)})});if(!h.length)throw new Error("File has no messages");if(((i=(n=(a=(t=c==null?void 0:c[1])==null?void 0:t[0])==null?void 0:a.meta)==null?void 0:n[1])==null?void 0:i[0].data)&&Pb(c[1][0].meta[1][0].data)==1e4)throw new Error("Pages documents are not supported");var u=((l=(o=(f=(s=c==null?void 0:c[1])==null?void 0:s[0])==null?void 0:f.meta)==null?void 0:o[1])==null?void 0:l[0].data)&&Pb(c[1][0].meta[1][0].data)==1&&c[1][0];if(!u)h.forEach(function(e){c[e].forEach(function(e){var r=Pb(e.meta[1][0].data)>>>0;if(r==1){if(!u)u=e;else throw new Error("Document has multiple roots")}})});if(!u)throw new Error("Cannot find Document root");return iw(c,u,r)}function fw(e,r,t,a){var n,i;if(!((n=e[6])==null?void 0:n[0])||!((i=e[7])==null?void 0:i[0]))throw"Mutation only works on post-BNC storages!";var s=0;if(e[7][0].data.length<2*r.length){var f=new Uint8Array(2*r.length);
+f.set(e[7][0].data);e[7][0].data=f}if(e[4][0].data.length<2*r.length){var o=new Uint8Array(2*r.length);o.set(e[4][0].data);e[4][0].data=o}var l=Eb(e[7][0].data),c=0,h=[];var u=Eb(e[4][0].data),d=0,p=[];var v=a?4:1;for(var m=0;m1}).map(function(e){return[e,Ib(e)]});e.FileIndex.forEach(function(e){if(!e.name.match(/\.iwa/))return;if(e.name.match(/OperationStorage/))return;Bb(zb(e.content)).forEach(function(e){a.forEach(function(t){if(e.messages.some(function(e){return Pb(e.meta[1][0].data)!=11006&&Sb(e.data,t[1])})){r[t[0]].deps.push(e.id)}})})});return r}function hw(e,r){if(!r||!r.numbers)throw new Error("Must pass a `numbers` option -- check the README");var t=er.read(r.numbers,{type:"base64"});var a=cw(t);var n=er.find(t,a[1].location);if(!n)throw"Could not find ".concat(a[1].location," in Numbers template");var i=Bb(zb(n.content));var s=i.find(function(e){return e.id==1});if(s==null)throw"Could not find message ".concat(1," in Numbers template");var f=Ub(Lb(s.messages[0].data)[1],Jb);e.SheetNames.forEach(function(r,n){return pw(t,a,e.Sheets[r],r,n,f[n])});return t}function uw(e,r,t,a){var n=er.find(e,r[t].location);if(!n)throw"Could not find ".concat(r[t].location," in Numbers template");var i=Bb(zb(n.content));var s=i.find(function(e){return e.id==t});a(s,i);n.content=Vb(Wb(i));n.size=n.content.length}function dw(e,r,t){var a=er.find(e,r[t].location);if(!a)throw"Could not find ".concat(r[t].location," in Numbers template");var n=Bb(zb(a.content));var i=n.find(function(e){return e.id==t});return i}function pw(e,r,t,a,n,i){if(n>=1)return console.error("The Numbers writer currently writes only the first table");var s=[];uw(e,r,i,function(e){var r=Lb(e.messages[0].data);{r[1]=[{type:2,data:Cb(a)}];s=Ub(r[2],Jb)}e.messages[0].data=Mb(r)});var f=dw(e,r,s[0]);var o=Jb(Lb(f.messages[0].data)[2][0].data);uw(e,r,o,function(a,n){return mw(e,r,t,a,n,o)})}var vw=true;function mw(e,r,t,a,n,i){var s,f;var o=Ua(t["!ref"]);o.s.r=o.s.c=0;var l=false;if(o.e.c>999){l=true;o.e.c=999}if(o.e.r>999999){l=true;o.e.r=999999}if(l)console.error("Truncating to ".concat(Ba(o)));var c=ek(t,{range:o,header:1});var h=["~Sh33tJ5~"],u=new Set(h);c.forEach(function(e){return e.forEach(function(e){if(typeof e=="string"&&!u.has(e)){h.push(e);u.add(e)}})});var d=r[i].location;d=d.replace(/^Root Entry\//,"");d=d.replace(/^Index\//,"").replace(/\.iwa$/,"");var p=Lb(a.messages[0].data);{p[6][0].data=Ib(o.e.r+1);p[7][0].data=Ib(o.e.c+1);delete p[46];var v=Lb(p[4][0].data);{var m=Jb(Lb(v[1][0].data)[2][0].data);uw(e,r,m,function(e,r){var t;var a=Lb(e.messages[0].data);if((t=a==null?void 0:a[2])==null?void 0:t[0])for(var n=0;n0)E=Nb(Lb(t[0].data)[12][0].data);r[3]=r[3].filter(function(e){return Nb(Lb(e.data)[1][0].data)!=T});var a=r[3].findIndex(function(e){var r,t;var a=Lb(e.data);if((r=a[3])==null?void 0:r[0])return yb(a[3][0].data)==d;if(((t=a[2])==null?void 0:t[0])&&yb(a[2][0].data)==d)return true;return false});var n=Lb(r[3][a].data);if(!n[6])n[6]=[];n[6]=n[6].filter(function(e){return Nb(Lb(e.data)[1][0].data)!=T});r[3][a].data=Mb(n);e.messages[0].data=Mb(r)})}k[1]=[];var y=Math.ceil((o.e.r+1)/A);for(var C=0;C-1)return"sheet";if(ii.CS&&e==ii.CS)return"chart";if(ii.DS&&e==ii.DS)return"dialog";if(ii.MS&&e==ii.MS)return"macro";return e&&e.length?e:"sheet"}function Aw(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,kw(e["!id"][r.id].Type)]})}catch(t){return null}return!e||e.length===0?null:e}function Tw(e,r,t,a,n,i,s,f,o,l,c,h){try{i[a]=fi(Mr(e,t,true),r);var u=Lr(e,r);var d;switch(f){case"sheet":d=Bm(u,r,n,o,i[a],l,c,h);break;case"chart":d=Wm(u,r,n,o,i[a],l,c,h);if(!d||!d["!drawel"])break;var p=Vr(d["!drawel"].Target,r);var v=si(p);var m=uh(Mr(e,p,true),fi(Mr(e,v,true),p));var g=Vr(m,p);var b=si(g);d=am(Mr(e,g,true),g,o,fi(Mr(e,b,true),g),l,d);break;case"macro":d=Hm(u,r,n,o,i[a],l,c,h);break;case"dialog":d=zm(u,r,n,o,i[a],l,c,h);break;default:throw new Error("Unrecognized sheet type "+f);}s[a]=d;var w=[],k=[];if(i&&i[a])sr(i[a]).forEach(function(t){var n="";if(i[a][t].Type==ii.CMNT){n=Vr(i[a][t].Target,r);w=$m(Lr(e,n,true),n,o);if(!w||!w.length)return;vh(d,w,false)}if(i[a][t].Type==ii.TCMNT){n=Vr(i[a][t].Target,r);k=k.concat(bh(Lr(e,n,true),o))}});if(k&&k.length)vh(d,k,true,o.people||[])}catch(A){if(o.WTF)throw A}}function Ew(e){return e.charAt(0)=="/"?e.slice(1):e}function yw(e,r){$e();r=r||{};bw(r);if(Dr(e,"META-INF/manifest.xml"))return vb(e,r);if(Dr(e,"objectdata.xml"))return vb(e,r);if(Dr(e,"Index/Document.iwa")){if(typeof Uint8Array=="undefined")throw new Error("NUMBERS file parsing requires Uint8Array support");if(typeof sw!="undefined"){if(e.FileIndex)return sw(e,r);var t=er.utils.cfb_new();Br(e).forEach(function(r){Wr(t,r,Ur(e,r))});return sw(t,r)}throw new Error("Unsupported NUMBERS file")}if(!Dr(e,"[Content_Types].xml")){if(Dr(e,"index.xml.gz"))throw new Error("Unsupported NUMBERS 08 file");if(Dr(e,"index.xml"))throw new Error("Unsupported NUMBERS 09 file");var a=er.find(e,"Index.zip");if(a){r=Er(r);delete r.type;if(typeof a.content=="string")r.type="binary";if(typeof Bun!=="undefined"&&Buffer.isBuffer(a.content))return Lw(new Uint8Array(a.content),r);return Lw(a.content,r)}throw new Error("Unsupported ZIP file")}var n=Br(e);var i=ai(Mr(e,"[Content_Types].xml"));var s=false;var f,o;if(i.workbooks.length===0){o="xl/workbook.xml";if(Lr(e,o,true))i.workbooks.push(o)}if(i.workbooks.length===0){o="xl/workbook.bin";if(!Lr(e,o,true))throw new Error("Could not find workbook");i.workbooks.push(o);s=true}if(i.workbooks[0].slice(-3)=="bin")s=true;var l={};var c={};if(!r.bookSheets&&!r.bookProps){Zd=[];if(i.sst)try{Zd=Gm(Lr(e,Ew(i.sst)),i.sst,r)}catch(h){if(r.WTF)throw h}if(r.cellStyles&&i.themes.length)l=Wc(Mr(e,i.themes[0].replace(/^\//,""),true)||"",r);if(i.style)c=Vm(Lr(e,Ew(i.style)),i.style,l,r)}i.links.map(function(t){try{var a=fi(Mr(e,si(Ew(t))),t);return Xm(Lr(e,Ew(t)),a,t,r)}catch(n){}});var u=Um(Lr(e,Ew(i.workbooks[0])),i.workbooks[0],r);var d={},p="";if(i.coreprops.length){p=Lr(e,Ew(i.coreprops[0]),true);if(p)d=wi(p);if(i.extprops.length!==0){p=Lr(e,Ew(i.extprops[0]),true);if(p)Ci(p,d,r)}}var v={};if(!r.bookSheets||r.bookProps){if(i.custprops.length!==0){p=Mr(e,Ew(i.custprops[0]),true);if(p)v=xi(p,r)}}var m={};if(r.bookSheets||r.bookProps){if(u.Sheets)f=u.Sheets.map(function I(e){return e.name});else if(d.Worksheets&&d.SheetNames.length>0)f=d.SheetNames;if(r.bookProps){m.Props=d;m.Custprops=v}if(r.bookSheets&&typeof f!=="undefined")m.SheetNames=f;if(r.bookSheets?m.SheetNames:r.bookProps)return m}f={};var g={};if(r.bookDeps&&i.calcchain)g=jm(Lr(e,Ew(i.calcchain)),i.calcchain,r);var b=0;var w={};var k,A;{var T=u.Sheets;d.Worksheets=T.length;d.SheetNames=[];for(var E=0;E!=T.length;++E){d.SheetNames[E]=T[E].name}}var y=s?"bin":"xml";var C=i.workbooks[0].lastIndexOf("/");var S=(i.workbooks[0].slice(0,C+1)+"_rels/"+i.workbooks[0].slice(C+1)+".rels").replace(/^\//,"");if(!Dr(e,S))S="xl/_rels/workbook."+y+".rels";var _=fi(Mr(e,S,true),S.replace(/_rels.*/,"s5s"));if((i.metadata||[]).length>=1){r.xlmeta=Ym(Lr(e,Ew(i.metadata[0])),i.metadata[0],r)}if((i.people||[]).length>=1){r.people=kh(Lr(e,Ew(i.people[0])),r)}if(_)_=Aw(_,u.Sheets);var x=Lr(e,"xl/worksheets/sheet.xml",true)?1:0;e:for(b=0;b!=d.Worksheets;++b){var O="sheet";if(_&&_[b]){k="xl/"+_[b][1].replace(/[\/]?xl\//,"");if(!Dr(e,k))k=_[b][1];if(!Dr(e,k))k=S.replace(/_rels\/.*$/,"")+_[b][1];O=_[b][2]}else{k="xl/worksheets/sheet"+(b+1-x)+"."+y;k=k.replace(/sheet0\./,"sheet.")}A=k.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels");if(r&&r.sheets!=null)switch(typeof r.sheets){case"number":if(b!=r.sheets)continue e;break;case"string":if(d.SheetNames[b].toLowerCase()!=r.sheets.toLowerCase())continue e;break;default:if(Array.isArray&&Array.isArray(r.sheets)){var R=false;for(var N=0;N!=r.sheets.length;++N){if(typeof r.sheets[N]=="number"&&r.sheets[N]==b)R=1;if(typeof r.sheets[N]=="string"&&r.sheets[N].toLowerCase()==d.SheetNames[b].toLowerCase())R=1}if(!R)continue e};}Tw(e,k,A,d.SheetNames[b],b,w,f,O,r,u,l,c)}m={Directory:i,Workbook:u,Props:d,Custprops:v,Deps:g,Sheets:f,SheetNames:d.SheetNames,Strings:Zd,Styles:c,Themes:l,SSF:Er(Z)};if(r&&r.bookFiles){if(e.files){m.keys=n;m.files=e.files}else{m.keys=[];m.files={};e.FullPaths.forEach(function(r,t){r=r.replace(/^Root Entry[\/]/,"");m.keys.push(r);m.files[r]=e.FileIndex[t]})}}if(r&&r.bookVBA){if(i.vba.length>0)m.vbaraw=Lr(e,Ew(i.vba[0]),true);else if(i.defaults&&i.defaults.bin===xh)m.vbaraw=Lr(e,"xl/vbaProject.bin",true)}m.bookType=s?"xlsb":"xlsx";return m}function Cw(e,r){var t=r||{};var a="Workbook",n=er.find(e,a);try{a="/!DataSpaces/Version";n=er.find(e,a);if(!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);tl(n.content);a="/!DataSpaces/DataSpaceMap";n=er.find(e,a);if(!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);var i=nl(n.content);if(i.length!==1||i[0].comps.length!==1||i[0].comps[0].t!==0||i[0].name!=="StrongEncryptionDataSpace"||i[0].comps[0].v!=="EncryptedPackage")throw new Error("ECMA-376 Encrypted file bad "+a);a="/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace";n=er.find(e,a);if(!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);var s=il(n.content);if(s.length!=1||s[0]!="StrongEncryptionTransform")throw new Error("ECMA-376 Encrypted file bad "+a);a="/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary";n=er.find(e,a);if(!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);fl(n.content)}catch(f){}a="/EncryptionInfo";n=er.find(e,a);if(!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);var o=cl(n.content);a="/EncryptedPackage";n=er.find(e,a);if(!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);if(o[0]==4&&typeof decrypt_agile!=="undefined")return decrypt_agile(o[1],n.content,t.password||"",t);if(o[0]==2&&typeof decrypt_std76!=="undefined")return decrypt_std76(o[1],n.content,t.password||"",t);throw new Error("File is password-protected")}function Sw(e,r){if(e&&!e.SSF){e.SSF=Er(Z)}if(e&&e.SSF){$e();Ge(e.SSF);r.revssf=lr(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(qd)r.revStrings=new Map;else{r.revStrings={};r.revStrings.foo=[];delete r.revStrings.foo}var t="bin";var a=true;var n=ti();ww(r=r||{});var i=Hr();var s="",f=0;r.cellXfs=[];tp(r.cellXfs,{},{revssf:{General:0}});if(!e.Props)e.Props={};s="docProps/core.xml";Wr(i,s,Ai(e.Props,r));n.coreprops.push(s);li(r.rels,2,s,ii.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 l=0;l0){s="docProps/custom.xml";Wr(i,s,Oi(e.Custprops,r));n.custprops.push(s);li(r.rels,4,s,ii.CUST_PROPS)}for(f=1;f<=e.SheetNames.length;++f){var c={"!id":{}};var h=e.Sheets[e.SheetNames[f-1]];var u=(h||{})["!type"]||"sheet";switch(u){case"chart":;default:s="xl/worksheets/sheet"+f+"."+t;Wr(i,s,rm(f-1,r,e,c));n.sheets.push(s);li(r.wbrels,-1,"worksheets/sheet"+f+"."+t,ii.WS[0]);}if(h){var d=h["!comments"];var p=false;var v="";if(d&&d.length>0){v="xl/comments"+f+"."+t;Wr(i,v,_h(d,r));n.comments.push(v);li(c,-1,"../comments"+f+"."+t,ii.CMNT);p=true}if(h["!legacy"]){if(p)Wr(i,"xl/drawings/vmlDrawing"+f+".vml",dh(f,h["!comments"]))}delete h["!comments"];delete h["!legacy"]}if(c["!id"].rId1)Wr(i,si(s),oi(c))}if(r.Strings!=null&&r.Strings.length>0){s="xl/sharedStrings."+t;Wr(i,s,Qo(r.Strings,r));n.strs.push(s);li(r.wbrels,-1,"sharedStrings."+t,ii.SST)}s="xl/workbook."+t;Wr(i,s,Mm(e,r));n.workbooks.push(s);li(r.rels,1,s,ii.WB);s="xl/theme/theme1.xml";var m=Hc(e.Themes,r);Wr(i,s,m);n.themes.push(s);li(r.wbrels,-1,"theme/theme1.xml",ii.THEME);s="xl/styles."+t;Wr(i,s,Rc(e,r));n.styles.push(s);li(r.wbrels,-1,"styles."+t,ii.STY);if(e.vbaraw&&a){s="xl/vbaProject.bin";Wr(i,s,e.vbaraw);n.vba.push(s);li(r.wbrels,-1,"vbaProject.bin",ii.VBA)}s="xl/metadata."+t;Wr(i,s,nh());n.metadata.push(s);li(r.wbrels,-1,"metadata."+t,ii.XLMETA);Wr(i,"[Content_Types].xml",ni(n,r));Wr(i,"_rels/.rels",oi(r.rels));Wr(i,"xl/_rels/workbook."+t+".rels",oi(r.wbrels));delete r.revssf;delete r.ssf;return i}function _w(e,r){if(e&&!e.SSF){e.SSF=Er(Z)}if(e&&e.SSF){$e();Ge(e.SSF);r.revssf=lr(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(qd)r.revStrings=new Map;else{r.revStrings={};r.revStrings.foo=[];delete r.revStrings.foo}var t="xml";var a=Nh.indexOf(r.bookType)>-1;var n=ti();ww(r=r||{});var i=Hr();var s="",f=0;r.cellXfs=[];tp(r.cellXfs,{},{revssf:{General:0}});if(!e.Props)e.Props={};s="docProps/core.xml";Wr(i,s,Ai(e.Props,r));n.coreprops.push(s);li(r.rels,2,s,ii.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 l=0;l0){s="docProps/custom.xml";Wr(i,s,Oi(e.Custprops,r));n.custprops.push(s);li(r.rels,4,s,ii.CUST_PROPS)}var c=["SheetJ5"];r.tcid=0;for(f=1;f<=e.SheetNames.length;++f){var h={"!id":{}};var u=e.Sheets[e.SheetNames[f-1]];var d=(u||{})["!type"]||"sheet";switch(d){case"chart":;default:s="xl/worksheets/sheet"+f+"."+t;Wr(i,s,Mp(f-1,r,e,h));n.sheets.push(s);li(r.wbrels,-1,"worksheets/sheet"+f+"."+t,ii.WS[0]);}if(u){var p=u["!comments"];var v=false;var m="";if(p&&p.length>0){var g=false;p.forEach(function(e){e[1].forEach(function(e){if(e.T==true)g=true})});if(g){m="xl/threadedComments/threadedComment"+f+".xml";Wr(i,m,wh(p,c,r));n.threadedcomments.push(m);li(h,-1,"../threadedComments/threadedComment"+f+".xml",ii.TCMNT)}m="xl/comments"+f+"."+t;Wr(i,m,gh(p,r));n.comments.push(m);li(h,-1,"../comments"+f+"."+t,ii.CMNT);v=true}if(u["!legacy"]){if(v)Wr(i,"xl/drawings/vmlDrawing"+f+".vml",dh(f,u["!comments"]))}delete u["!comments"];delete u["!legacy"]}if(h["!id"].rId1)Wr(i,si(s),oi(h))}if(r.Strings!=null&&r.Strings.length>0){s="xl/sharedStrings."+t;Wr(i,s,Yo(r.Strings,r));n.strs.push(s);li(r.wbrels,-1,"sharedStrings."+t,ii.SST)}s="xl/workbook."+t;Wr(i,s,Am(e,r));n.workbooks.push(s);li(r.rels,1,s,ii.WB);s="xl/theme/theme1.xml";Wr(i,s,Hc(e.Themes,r));n.themes.push(s);li(r.wbrels,-1,"theme/theme1.xml",ii.THEME);s="xl/styles."+t;Wr(i,s,ac(e,r));n.styles.push(s);li(r.wbrels,-1,"styles."+t,ii.STY);if(e.vbaraw&&a){s="xl/vbaProject.bin";Wr(i,s,e.vbaraw);n.vba.push(s);li(r.wbrels,-1,"vbaProject.bin",ii.VBA)}s="xl/metadata."+t;Wr(i,s,sh());n.metadata.push(s);li(r.wbrels,-1,"metadata."+t,ii.XLMETA);if(c.length>1){s="xl/persons/person.xml";Wr(i,s,Ah(c,r));n.people.push(s);li(r.wbrels,-1,"persons/person.xml",ii.PEOPLE)}Wr(i,"[Content_Types].xml",ni(n,r));Wr(i,"_rels/.rels",oi(r.rels));Wr(i,"xl/_rels/workbook."+t+".rels",oi(r.wbrels));delete r.revssf;delete r.ssf;return i}function xw(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=T(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 Ow(e,r){if(er.find(e,"EncryptedPackage"))return Cw(e,r);return Ng(e,r)}function Rw(e,r){var t,a=e;var n=r||{};if(!n.type)n.type=E&&Buffer.isBuffer(e)?"buffer":"base64";t=zr(a,n);return yw(t,n)}function Nw(e,r){var t=0;e:while(t=2&&i[3]===0)return Po.to_workbook(n,t);if(i[2]===0&&(i[3]===8||i[3]===9))return Po.to_workbook(n,t)}break;case 3:;case 131:;case 139:;case 140:return Oo.to_workbook(n,t);case 123:if(i[1]===92&&i[2]===114&&i[3]===116)return Cl(n,t);break;case 10:;case 13:;case 32:return Iw(n,t);case 137:if(i[1]===80&&i[2]===78&&i[3]===71)throw new Error("PNG Image File is not a spreadsheet");break;case 8:if(i[1]===231)throw new Error("Unsupported Multiplan 1.x file!");break;case 12:if(i[1]===236)throw new Error("Unsupported Multiplan 2.x file!");if(i[1]===237)throw new Error("Unsupported Multiplan 3.x file!");break;}if(xo.indexOf(i[0])>-1&&i[2]<=12&&i[3]<=31)return Oo.to_workbook(n,t);return Pw(e,n,t,s)}function Mw(e,r){var t=r||{};t.type="file";return Lw(e,t)}function Uw(e,r){switch(r.type){case"base64":;case"binary":break;case"buffer":;case"array":r.type="";break;case"file":return nr(r.file,er.write(e,{type:E?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+r.bookType+"' files");default:throw new Error("Unrecognized type "+r.type);}return er.write(e,r)}function Bw(e,r){switch(r.bookType){case"ods":return Ab(e,r);case"numbers":return hw(e,r);case"xlsb":return Sw(e,r);default:return _w(e,r);}}function Ww(e,r){var t=Er(r||{});var a=Bw(e,t);return zw(a,t)}function Hw(e,r){var t=Er(r||{});var a=_w(e,t);return zw(a,t)}function zw(e,r){var t={};var a=E?"nodebuffer":typeof Uint8Array!=="undefined"?"array":"string";if(r.compression)t.compression="DEFLATE";if(r.password)t.type=a;else switch(r.type){case"base64":t.type="base64";break;case"binary":t.type="string";break;case"string":throw new Error("'string' output type invalid for '"+r.bookType+"' files");case"buffer":;case"file":t.type=a;break;default:throw new Error("Unrecognized type "+r.type);}var n=e.FullPaths?er.write(e,{fileType:"zip",type:{nodebuffer:"buffer",string:"binary"}[t.type]||t.type,compression:!!r.compression}):e.generate(t);if(typeof Deno!=="undefined"){if(typeof n=="string"){if(r.type=="binary"||r.type=="base64")return n;n=new Uint8Array(O(n))}}if(r.password&&typeof encrypt_agile!=="undefined")return Uw(encrypt_agile(n,r.password),r);if(r.type==="file")return nr(r.file,n);return r.type=="string"?mt(n):n}function Vw(e,r){var t=r||{};var a=Ig(e,t);return Uw(a,t)}function Gw(e,r,t){if(!t)t="";var a=t+e;switch(r.type){case"base64":return k(gt(a));case"binary":return gt(a);case"string":return e;case"file":return nr(r.file,a,"utf8");case"buffer":{if(E)return y(a,"utf8");else if(typeof TextEncoder!=="undefined")return(new TextEncoder).encode(a);else return Gw(a,{type:"binary"}).split("").map(function(e){return e.charCodeAt(0)})};}throw new Error("Unrecognized type "+r.type)}function $w(e,r){switch(r.type){case"base64":return A(e);case"binary":return e;case"string":return e;case"file":return nr(r.file,e,"binary");case"buffer":{if(E)return y(e,"binary");else return e.split("").map(function(e){return e.charCodeAt(0)})};}throw new Error("Unrecognized type "+r.type)}function jw(e,r){switch(r.type){case"string":;case"base64":;case"binary":var t="";for(var a=0;a0)n=0;var h=xa(o.s.r);var u=[];var d=[];var p=0,v=0;var m=Array.isArray(e);var g=o.s.r,b=0;var w={};if(m&&!e[g])e[g]=[];var k=l.skipHidden&&e["!cols"]||[];var A=l.skipHidden&&e["!rows"]||[];for(b=o.s.c;b<=o.e.c;++b){if((k[b]||{}).hidden)continue;u[b]=Ia(b);t=m?e[g][b]:e[u[b]+h];switch(a){case 1:i[b]=b-o.s.c;break;case 2:i[b]=u[b];break;case 3:i[b]=l.header[b-o.s.c];break;default:if(t==null)t={w:"__EMPTY",t:"s"};f=s=Ga(t,null,l);v=w[s]||0;if(!v)w[s]=1;else{do{f=s+"_"+v++}while(w[f]);w[s]=v;w[f]=1}i[b]=f;}}for(g=o.s.r+n;g<=o.e.r;++g){if((A[g]||{}).hidden)continue;var T=Qw(e,o,g,u,a,i,m,l);if(T.isempty===false||(a===1?l.blankrows!==false:!!l.blankrows))d[p++]=T.row}d.length=p;return d}var rk=/"/g;function tk(e,r,t,a,n,i,s,f){var o=true;var l=[],c="",h=xa(t);for(var u=r.s.c;u<=r.e.c;++u){if(!a[u])continue;var d=f.dense?(e[t]||[])[u]:e[a[u]+h];if(d==null)c="";else if(d.v!=null){o=false;c=""+(f.rawNumbers&&d.t=="n"?d.v:Ga(d,null,f));
+for(var p=0,v=0;p!==c.length;++p)if((v=c.charCodeAt(p))===n||v===i||v===34||f.forceQuotes){c='"'+c.replace(rk,'""')+'"';break}if(c=="ID")c='"ID"'}else if(d.f!=null&&!d.F){o=false;c="="+d.f;if(c.indexOf(",")>=0)c='"'+c.replace(rk,'""')+'"'}else c="";l.push(c)}if(f.blankrows===false&&o)return null;return l.join(s)}function ak(e,r){var t=[];var a=r==null?{}:r;if(e==null||e["!ref"]==null)return"";var n=za(e["!ref"]);var i=a.FS!==undefined?a.FS:",",s=i.charCodeAt(0);var f=a.RS!==undefined?a.RS:"\n",o=f.charCodeAt(0);var l=new RegExp((i=="|"?"\\|":i)+"+$");var c="",h=[];a.dense=Array.isArray(e);var u=a.skipHidden&&e["!cols"]||[];var d=a.skipHidden&&e["!rows"]||[];for(var p=n.s.c;p<=n.e.c;++p)if(!(u[p]||{}).hidden)h[p]=Ia(p);var v=0;for(var m=n.s.r;m<=n.e.r;++m){if((d[m]||{}).hidden)continue;c=tk(e,n,m,h,s,o,i,a);if(c==null){continue}if(a.strip)c=c.replace(l,"");if(c||a.blankrows!==false)t.push((v++?f:"")+c)}delete a.dense;return t.join("")}function nk(e,r){if(!r)r={};r.FS="\t";r.RS="\n";var t=ak(e,r);if(typeof a=="undefined"||r.type=="string")return t;var n=a.utils.encode(1200,t,"str");return String.fromCharCode(255)+String.fromCharCode(254)+n}function ik(e){var r="",t,a="";if(e==null||e["!ref"]==null)return[];var n=za(e["!ref"]),i="",s=[],f;var o=[];var l=Array.isArray(e);for(f=n.s.c;f<=n.e.c;++f)s[f]=Ia(f);for(var c=n.s.r;c<=n.e.r;++c){i=xa(c);for(f=n.s.c;f<=n.e.c;++f){r=s[f]+i;t=l?(e[c]||[])[f]:e[r];a="";if(t===undefined)continue;else if(t.F!=null){r=t.F;if(!t.f)continue;a=t.f;if(r.indexOf(":")==-1)r=r+":"+r}if(t.f!=null)a=t.f;else if(t.t=="z")continue;else if(t.t=="n"&&t.v!=null)a=""+t.v;else if(t.t=="b")a=t.v?"TRUE":"FALSE";else if(t.w!==undefined)a="'"+t.w;else if(t.v===undefined)continue;else if(t.t=="s")a="'"+t.v;else a=""+t.v;o[o.length]=r+"="+a}}return o}function sk(e,r,t){var a=t||{};var n=e?Array.isArray(e):a.dense;if(g!=null&&n==null)n=g;var i=+!a.skipHeader;var s=e||(n?[]:{});var f=0,o=0;if(s&&a.origin!=null){if(typeof a.origin=="number")f=a.origin;else{var l=typeof a.origin=="string"?La(a.origin):a.origin;f=l.r;o=l.c}}var c={s:{c:0,r:0},e:{c:o,r:f+r.length-1+i}};if(s["!ref"]){var h=za(s["!ref"]);c.e.c=Math.max(c.e.c,h.e.c);c.e.r=Math.max(c.e.r,h.e.r);if(f==-1){f=h.e.r+1;c.e.r=f+r.length-1+i}}else{if(f==-1){f=0;c.e.r=r.length-1+i}}var u=a.header||[],d=0;var p=[];r.forEach(function(e,r){if(n&&!s[f+r+i])s[f+r+i]=[];if(n)p=s[f+r+i];sr(e).forEach(function(t){if((d=u.indexOf(t))==-1)u[d=u.length]=t;var l=e[t];var c="z";var h="";var v=n?"":Ma({c:o+d,r:f+r+i});var m=n?p[o+d]:s[v];if(l&&typeof l==="object"&&!(l instanceof Date)){s[v]=l}else{if(typeof l=="number")c="n";else if(typeof l=="boolean")c="b";else if(typeof l=="string")c="s";else if(l instanceof Date){c="d";if(!a.cellDates){c="n";l=ur(l)}h=m!=null&&m.z&&Me(m.z)?m.z:a.dateNF||Z[14]}else if(l===null&&a.nullError){c="e";l=0}if(!m){if(!n)s[v]=m={t:c,v:l};else p[o+d]=m={t:c,v:l}}else{m.t=c;m.v=l;delete m.w;delete m.R;if(h)m.z=h}if(h)m.z=h}})});c.e.c=Math.max(c.e.c,o+u.length-1);var v=xa(f);if(n&&!s[f])s[f]=[];if(i)for(d=0;d=0&&e.SheetNames.length>r)return r;throw new Error("Cannot find sheet # "+r)}else if(typeof r=="string"){var t=e.SheetNames.indexOf(r);if(t>-1)return t;throw new Error("Cannot find sheet name |"+r+"|")}else throw new Error("Cannot find sheet |"+r+"|")}function ck(){return{SheetNames:[],Sheets:{}}}function hk(e,r,t,a){var n=1;if(!t)for(;n<=65535;++n,t=undefined)if(e.SheetNames.indexOf(t="Sheet"+n)==-1)break;if(!t||e.SheetNames.length>=65535)throw new Error("Too many worksheets");if(a&&e.SheetNames.indexOf(t)>=0){var i=t.match(/(^.*?)(\d+)$/);n=i&&+i[2]||0;var s=i&&i[1]||t;for(++n;n<=65535;++n)if(e.SheetNames.indexOf(t=s+n)==-1)break}mm(t);if(e.SheetNames.indexOf(t)>=0)throw new Error("Worksheet with name |"+t+"| already exists!");e.SheetNames.push(t);e.Sheets[t]=r;return t}function uk(e,r,t){if(!e.Workbook)e.Workbook={};if(!e.Workbook.Sheets)e.Workbook.Sheets=[];var a=lk(e,r);if(!e.Workbook.Sheets[a])e.Workbook.Sheets[a]={};switch(t){case 0:;case 1:;case 2:break;default:throw new Error("Bad sheet visibility setting "+t);}e.Workbook.Sheets[a].Hidden=t}function dk(e,r){e.z=r;return e}function pk(e,r,t){if(!r){delete e.l}else{e.l={Target:r};if(t)e.l.Tooltip=t}return e}function vk(e,r,t){return pk(e,"#"+r,t)}function mk(e,r,t){if(!e.c)e.c=[];e.c.push({t:r,a:t||"SheetJS"})}function gk(e,r,t,a){var n=typeof r!="string"?r:za(r);var i=typeof r=="string"?r:Ba(r);for(var s=n.s.r;s<=n.e.r;++s)for(var f=n.s.c;f<=n.e.c;++f){var o=ok(e,s,f);o.t="n";o.F=i;delete o.v;if(s==n.s.r&&f==n.s.c){o.f=t;if(a)o.D=true}}var l=Ua(e["!ref"]);if(l.s.r>n.s.r)l.s.r=n.s.r;if(l.s.c>n.s.c)l.s.c=n.s.c;if(l.e.rs.e.r){if(!o){o=true;t.push("
"+i)}return t.push(null)}while(f<=s.e.r){t.push(rb(e,s,f,a));++f;break}};return t}function Ek(e,r){var t=wk({objectMode:true});if(e==null||e["!ref"]==null){t.push(null);return t}var a={t:"n",v:0},n=0,i=1,s=[],f=0,o="";var l={s:{r:0,c:0},e:{r:0,c:0}};var c=r||{};var h=c.range!=null?c.range:e["!ref"];if(c.header===1)n=1;else if(c.header==="A")n=2;else if(Array.isArray(c.header))n=3;switch(typeof h){case"string":l=za(h);break;case"number":l=za(e["!ref"]);l.s.r=h;break;default:l=h;}if(n>0)i=0;var u=xa(l.s.r);var d=[];var p=0;var v=Array.isArray(e);var m=l.s.r,g=0;var b={};if(v&&!e[m])e[m]=[];var w=c.skipHidden&&e["!cols"]||[];var k=c.skipHidden&&e["!rows"]||[];for(g=l.s.c;g<=l.e.c;++g){if((w[g]||{}).hidden)continue;d[g]=Ia(g);a=v?e[m][g]:e[d[g]+u];switch(n){case 1:s[g]=g-l.s.c;break;case 2:s[g]=d[g];break;case 3:s[g]=c.header[g-l.s.c];break;default:if(a==null)a={w:"__EMPTY",t:"s"};o=f=Ga(a,null,c);p=b[f]||0;if(!p)b[f]=1;else{do{o=f+"_"+p++}while(b[o]);b[f]=p;b[o]=1}s[g]=o;}}m=l.s.r+i;t._read=function(){while(m<=l.e.r){if((k[m-1]||{}).hidden)continue;var r=Qw(e,l,m,d,n,s,v,c);++m;if(r.isempty===false||(n===1?c.blankrows!==false:!!c.blankrows)){t.push(r.row);return}}return t.push(null)};return t}var yk={to_json:Ek,to_html:Tk,to_csv:Ak,set_readable:kk};if(typeof Ng!=="undefined")e.parse_xlscfb=Ng;e.parse_zip=yw;e.read=Lw;e.readFile=Mw;e.readFileSync=Mw;e.write=Yw;e.writeFile=Zw;e.writeFileSync=Zw;e.writeFileAsync=qw;e.utils=bk;e.writeXLSX=Xw;e.writeFileXLSX=Jw;e.SSF=je;if(typeof yk!=="undefined")e.stream=yk;if(typeof er!=="undefined")e.CFB=er;if(typeof require!=="undefined"){var Ck=undefined;if((Ck||{}).Readable)kk(Ck.Readable);try{rr=undefined}catch(Sk){}}}if(typeof exports!=="undefined")make_xlsx_lib(exports);else if(typeof module!=="undefined"&&module.exports)make_xlsx_lib(module.exports);else if(typeof define==="function"&&define.amd)define("xlsx",function(){if(!XLSX.version)make_xlsx_lib(XLSX);return XLSX});else make_xlsx_lib(XLSX);if(typeof window!=="undefined"&&!window.XLSX)try{window.XLSX=XLSX}catch(e){}
diff --git a/plugins/tiddlywiki/xlsx-utils/files/xlsx.js b/plugins/tiddlywiki/xlsx-utils/files/xlsx.js
deleted file mode 100755
index c29f5ceae..000000000
--- a/plugins/tiddlywiki/xlsx-utils/files/xlsx.js
+++ /dev/null
@@ -1,11654 +0,0 @@
-/* xlsx.js (C) 2013-2015 SheetJS -- http://sheetjs.com */
-/* vim: set ts=2: */
-/*jshint -W041 */
-/*jshint funcscope:true, eqnull:true */
-var XLSX = {};
-(function make_xlsx(XLSX){
-XLSX.version = '0.8.0';
-var current_codepage = 1200, current_cptable;
-if(typeof module !== "undefined" && typeof require !== 'undefined') {
- if(typeof cptable === 'undefined') cptable = require('./dist/cpexcel');
- current_cptable = cptable[current_codepage];
-}
-function reset_cp() { set_cp(1200); }
-var set_cp = function(cp) { current_codepage = cp; };
-
-function char_codes(data) { var o = []; for(var i = 0, len = data.length; i < len; ++i) o[i] = data.charCodeAt(i); return o; }
-var debom_xml = function(data) { return data; };
-
-var _getchar = function _gc1(x) { return String.fromCharCode(x); };
-if(typeof cptable !== 'undefined') {
- set_cp = function(cp) { current_codepage = cp; current_cptable = cptable[cp]; };
- debom_xml = function(data) {
- if(data.charCodeAt(0) === 0xFF && data.charCodeAt(1) === 0xFE) { return cptable.utils.decode(1200, char_codes(data.substr(2))); }
- return data;
- };
- _getchar = function _gc2(x) {
- if(current_codepage === 1200) return String.fromCharCode(x);
- return cptable.utils.decode(current_codepage, [x&255,x>>8])[0];
- };
-}
-var Base64 = (function make_b64(){
- var map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
- return {
- encode: function(input, utf8) {
- var o = "";
- var c1, c2, c3, e1, e2, e3, e4;
- for(var i = 0; i < input.length; ) {
- c1 = input.charCodeAt(i++);
- c2 = input.charCodeAt(i++);
- c3 = input.charCodeAt(i++);
- e1 = c1 >> 2;
- e2 = (c1 & 3) << 4 | c2 >> 4;
- e3 = (c2 & 15) << 2 | c3 >> 6;
- e4 = c3 & 63;
- if (isNaN(c2)) { e3 = e4 = 64; }
- else if (isNaN(c3)) { e4 = 64; }
- o += map.charAt(e1) + map.charAt(e2) + map.charAt(e3) + map.charAt(e4);
- }
- return o;
- },
- decode: function b64_decode(input, utf8) {
- var o = "";
- var c1, c2, c3;
- var e1, e2, e3, e4;
- input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
- for(var i = 0; i < input.length;) {
- e1 = map.indexOf(input.charAt(i++));
- e2 = map.indexOf(input.charAt(i++));
- e3 = map.indexOf(input.charAt(i++));
- e4 = map.indexOf(input.charAt(i++));
- c1 = e1 << 2 | e2 >> 4;
- c2 = (e2 & 15) << 4 | e3 >> 2;
- c3 = (e3 & 3) << 6 | e4;
- o += String.fromCharCode(c1);
- if (e3 != 64) { o += String.fromCharCode(c2); }
- if (e4 != 64) { o += String.fromCharCode(c3); }
- }
- return o;
- }
- };
-})();
-var has_buf = (typeof Buffer !== 'undefined');
-
-function new_raw_buf(len) {
- /* jshint -W056 */
- return new (has_buf ? Buffer : Array)(len);
- /* jshint +W056 */
-}
-
-function s2a(s) {
- if(has_buf) return new Buffer(s, "binary");
- return s.split("").map(function(x){ return x.charCodeAt(0) & 0xff; });
-}
-
-var bconcat = function(bufs) { return [].concat.apply([], bufs); };
-
-var chr0 = /\u0000/g, chr1 = /[\u0001-\u0006]/;
-/* ssf.js (C) 2013-2014 SheetJS -- http://sheetjs.com */
-/*jshint -W041 */
-var SSF = {};
-var make_ssf = function make_ssf(SSF){
-SSF.version = '0.8.1';
-function _strrev(x) { var o = "", i = x.length-1; while(i>=0) o += x.charAt(i--); return o; }
-function fill(c,l) { var o = ""; while(o.length < l) o+=c; return o; }
-function pad0(v,d){var t=""+v; return t.length>=d?t:fill('0',d-t.length)+t;}
-function pad_(v,d){var t=""+v;return t.length>=d?t:fill(' ',d-t.length)+t;}
-function rpad_(v,d){var t=""+v; return t.length>=d?t:t+fill(' ',d-t.length);}
-function pad0r1(v,d){var t=""+Math.round(v); return t.length>=d?t:fill('0',d-t.length)+t;}
-function pad0r2(v,d){var t=""+v; return t.length>=d?t:fill('0',d-t.length)+t;}
-var p2_32 = Math.pow(2,32);
-function pad0r(v,d){if(v>p2_32||v<-p2_32) return pad0r1(v,d); var i = Math.round(v); return pad0r2(i,d); }
-function isgeneral(s, i) { return s.length >= 7 + i && (s.charCodeAt(i)|32) === 103 && (s.charCodeAt(i+1)|32) === 101 && (s.charCodeAt(i+2)|32) === 110 && (s.charCodeAt(i+3)|32) === 101 && (s.charCodeAt(i+4)|32) === 114 && (s.charCodeAt(i+5)|32) === 97 && (s.charCodeAt(i+6)|32) === 108; }
-/* Options */
-var opts_fmt = [
- ["date1904", 0],
- ["output", ""],
- ["WTF", false]
-];
-function fixopts(o){
- for(var y = 0; y != opts_fmt.length; ++y) if(o[opts_fmt[y][0]]===undefined) o[opts_fmt[y][0]]=opts_fmt[y][1];
-}
-SSF.opts = opts_fmt;
-var table_fmt = {
- 0: 'General',
- 1: '0',
- 2: '0.00',
- 3: '#,##0',
- 4: '#,##0.00',
- 9: '0%',
- 10: '0.00%',
- 11: '0.00E+00',
- 12: '# ?/?',
- 13: '# ??/??',
- 14: 'm/d/yy',
- 15: 'd-mmm-yy',
- 16: 'd-mmm',
- 17: 'mmm-yy',
- 18: 'h:mm AM/PM',
- 19: 'h:mm:ss AM/PM',
- 20: 'h:mm',
- 21: 'h:mm:ss',
- 22: 'm/d/yy h:mm',
- 37: '#,##0 ;(#,##0)',
- 38: '#,##0 ;[Red](#,##0)',
- 39: '#,##0.00;(#,##0.00)',
- 40: '#,##0.00;[Red](#,##0.00)',
- 45: 'mm:ss',
- 46: '[h]:mm:ss',
- 47: 'mmss.0',
- 48: '##0.0E+0',
- 49: '@',
- 56: '"上午/下午 "hh"時"mm"分"ss"秒 "',
- 65535: 'General'
-};
-var days = [
- ['Sun', 'Sunday'],
- ['Mon', 'Monday'],
- ['Tue', 'Tuesday'],
- ['Wed', 'Wednesday'],
- ['Thu', 'Thursday'],
- ['Fri', 'Friday'],
- ['Sat', 'Saturday']
-];
-var months = [
- ['J', 'Jan', 'January'],
- ['F', 'Feb', 'February'],
- ['M', 'Mar', 'March'],
- ['A', 'Apr', 'April'],
- ['M', 'May', 'May'],
- ['J', 'Jun', 'June'],
- ['J', 'Jul', 'July'],
- ['A', 'Aug', 'August'],
- ['S', 'Sep', 'September'],
- ['O', 'Oct', 'October'],
- ['N', 'Nov', 'November'],
- ['D', 'Dec', 'December']
-];
-function frac(x, D, mixed) {
- var sgn = x < 0 ? -1 : 1;
- var B = x * sgn;
- var P_2 = 0, P_1 = 1, P = 0;
- var Q_2 = 1, Q_1 = 0, Q = 0;
- var A = Math.floor(B);
- while(Q_1 < D) {
- A = Math.floor(B);
- P = A * P_1 + P_2;
- Q = A * Q_1 + Q_2;
- if((B - A) < 0.0000000005) break;
- B = 1 / (B - A);
- P_2 = P_1; P_1 = P;
- Q_2 = Q_1; Q_1 = Q;
- }
- if(Q > D) { Q = Q_1; P = P_1; }
- if(Q > D) { Q = Q_2; P = P_2; }
- if(!mixed) return [0, sgn * P, Q];
- if(Q===0) throw "Unexpected state: "+P+" "+P_1+" "+P_2+" "+Q+" "+Q_1+" "+Q_2;
- var q = Math.floor(sgn * P/Q);
- return [q, sgn*P - q*Q, Q];
-}
-function general_fmt_int(v, opts) { return ""+v; }
-SSF._general_int = general_fmt_int;
-var general_fmt_num = (function make_general_fmt_num() {
-var gnr1 = /\.(\d*[1-9])0+$/, gnr2 = /\.0*$/, gnr4 = /\.(\d*[1-9])0+/, gnr5 = /\.0*[Ee]/, gnr6 = /(E[+-])(\d)$/;
-function gfn2(v) {
- var w = (v<0?12:11);
- var o = gfn5(v.toFixed(12)); if(o.length <= w) return o;
- o = v.toPrecision(10); if(o.length <= w) return o;
- return v.toExponential(5);
-}
-function gfn3(v) {
- var o = v.toFixed(11).replace(gnr1,".$1");
- if(o.length > (v<0?12:11)) o = v.toPrecision(6);
- return o;
-}
-function gfn4(o) {
- for(var i = 0; i != o.length; ++i) if((o.charCodeAt(i) | 0x20) === 101) return o.replace(gnr4,".$1").replace(gnr5,"E").replace("e","E").replace(gnr6,"$10$2");
- return o;
-}
-function gfn5(o) {
- //for(var i = 0; i != o.length; ++i) if(o.charCodeAt(i) === 46) return o.replace(gnr2,"").replace(gnr1,".$1");
- //return o;
- return o.indexOf(".") > -1 ? o.replace(gnr2,"").replace(gnr1,".$1") : o;
-}
-return function general_fmt_num(v, opts) {
- var V = Math.floor(Math.log(Math.abs(v))*Math.LOG10E), o;
- if(V >= -4 && V <= -1) o = v.toPrecision(10+V);
- else if(Math.abs(V) <= 9) o = gfn2(v);
- else if(V === 10) o = v.toFixed(10).substr(0,12);
- else o = gfn3(v);
- return gfn5(gfn4(o));
-};})();
-SSF._general_num = general_fmt_num;
-function general_fmt(v, opts) {
- switch(typeof v) {
- case 'string': return v;
- case 'boolean': return v ? "TRUE" : "FALSE";
- case 'number': return (v|0) === v ? general_fmt_int(v, opts) : general_fmt_num(v, opts);
- }
- throw new Error("unsupported value in General format: " + v);
-}
-SSF._general = general_fmt;
-function fix_hijri(date, o) { return 0; }
-function parse_date_code(v,opts,b2) {
- if(v > 2958465 || v < 0) return null;
- var date = (v|0), time = Math.floor(86400 * (v - date)), dow=0;
- var dout=[];
- var out={D:date, T:time, u:86400*(v-date)-time,y:0,m:0,d:0,H:0,M:0,S:0,q:0};
- if(Math.abs(out.u) < 1e-6) out.u = 0;
- fixopts(opts != null ? opts : (opts=[]));
- if(opts.date1904) date += 1462;
- if(out.u > 0.999) {
- out.u = 0;
- if(++time == 86400) { time = 0; ++date; }
- }
- if(date === 60) {dout = b2 ? [1317,10,29] : [1900,2,29]; dow=3;}
- else if(date === 0) {dout = b2 ? [1317,8,29] : [1900,1,0]; dow=6;}
- else {
- if(date > 60) --date;
- /* 1 = Jan 1 1900 */
- var d = new Date(1900,0,1);
- d.setDate(d.getDate() + date - 1);
- dout = [d.getFullYear(), d.getMonth()+1,d.getDate()];
- dow = d.getDay();
- if(date < 60) dow = (dow + 6) % 7;
- if(b2) dow = fix_hijri(d, dout);
- }
- out.y = dout[0]; out.m = dout[1]; out.d = dout[2];
- out.S = time % 60; time = Math.floor(time / 60);
- out.M = time % 60; time = Math.floor(time / 60);
- out.H = time;
- out.q = dow;
- return out;
-}
-SSF.parse_date_code = parse_date_code;
-/*jshint -W086 */
-function write_date(type, fmt, val, ss0) {
- var o="", ss=0, tt=0, y = val.y, out, outl = 0;
- switch(type) {
- case 98: /* 'b' buddhist year */
- y = val.y + 543;
- /* falls through */
- case 121: /* 'y' year */
- switch(fmt.length) {
- case 1: case 2: out = y % 100; outl = 2; break;
- default: out = y % 10000; outl = 4; break;
- } break;
- case 109: /* 'm' month */
- switch(fmt.length) {
- case 1: case 2: out = val.m; outl = fmt.length; break;
- case 3: return months[val.m-1][1];
- case 5: return months[val.m-1][0];
- default: return months[val.m-1][2];
- } break;
- case 100: /* 'd' day */
- switch(fmt.length) {
- case 1: case 2: out = val.d; outl = fmt.length; break;
- case 3: return days[val.q][0];
- default: return days[val.q][1];
- } break;
- case 104: /* 'h' 12-hour */
- switch(fmt.length) {
- case 1: case 2: out = 1+(val.H+11)%12; outl = fmt.length; break;
- default: throw 'bad hour format: ' + fmt;
- } break;
- case 72: /* 'H' 24-hour */
- switch(fmt.length) {
- case 1: case 2: out = val.H; outl = fmt.length; break;
- default: throw 'bad hour format: ' + fmt;
- } break;
- case 77: /* 'M' minutes */
- switch(fmt.length) {
- case 1: case 2: out = val.M; outl = fmt.length; break;
- default: throw 'bad minute format: ' + fmt;
- } break;
- case 115: /* 's' seconds */
- if(val.u === 0) switch(fmt) {
- case 's': case 'ss': return pad0(val.S, fmt.length);
- case '.0': case '.00': case '.000':
- }
- switch(fmt) {
- case 's': case 'ss': case '.0': case '.00': case '.000':
- if(ss0 >= 2) tt = ss0 === 3 ? 1000 : 100;
- else tt = ss0 === 1 ? 10 : 1;
- ss = Math.round((tt)*(val.S + val.u));
- if(ss >= 60*tt) ss = 0;
- if(fmt === 's') return ss === 0 ? "0" : ""+ss/tt;
- o = pad0(ss,2 + ss0);
- if(fmt === 'ss') return o.substr(0,2);
- return "." + o.substr(2,fmt.length-1);
- default: throw 'bad second format: ' + fmt;
- }
- case 90: /* 'Z' absolute time */
- switch(fmt) {
- case '[h]': case '[hh]': out = val.D*24+val.H; break;
- case '[m]': case '[mm]': out = (val.D*24+val.H)*60+val.M; break;
- case '[s]': case '[ss]': out = ((val.D*24+val.H)*60+val.M)*60+Math.round(val.S+val.u); break;
- default: throw 'bad abstime format: ' + fmt;
- } outl = fmt.length === 3 ? 1 : 2; break;
- case 101: /* 'e' era */
- out = y; outl = 1;
- }
- if(outl > 0) return pad0(out, outl); else return "";
-}
-/*jshint +W086 */
-function commaify(s) {
- if(s.length <= 3) return s;
- var j = (s.length % 3), o = s.substr(0,j);
- for(; j!=s.length; j+=3) o+=(o.length > 0 ? "," : "") + s.substr(j,3);
- return o;
-}
-var write_num = (function make_write_num(){
-var pct1 = /%/g;
-function write_num_pct(type, fmt, val){
- var sfmt = fmt.replace(pct1,""), mul = fmt.length - sfmt.length;
- return write_num(type, sfmt, val * Math.pow(10,2*mul)) + fill("%",mul);
-}
-function write_num_cm(type, fmt, val){
- var idx = fmt.length - 1;
- while(fmt.charCodeAt(idx-1) === 44) --idx;
- return write_num(type, fmt.substr(0,idx), val / Math.pow(10,3*(fmt.length-idx)));
-}
-function write_num_exp(fmt, val){
- var o;
- var idx = fmt.indexOf("E") - fmt.indexOf(".") - 1;
- if(fmt.match(/^#+0.0E\+0$/)) {
- var period = fmt.indexOf("."); if(period === -1) period=fmt.indexOf('E');
- var ee = Math.floor(Math.log(Math.abs(val))*Math.LOG10E)%period;
- if(ee < 0) ee += period;
- o = (val/Math.pow(10,ee)).toPrecision(idx+1+(period+ee)%period);
- if(o.indexOf("e") === -1) {
- var fakee = Math.floor(Math.log(Math.abs(val))*Math.LOG10E);
- if(o.indexOf(".") === -1) o = o[0] + "." + o.substr(1) + "E+" + (fakee - o.length+ee);
- else o += "E+" + (fakee - ee);
- while(o.substr(0,2) === "0.") {
- o = o[0] + o.substr(2,period) + "." + o.substr(2+period);
- o = o.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");
- }
- o = o.replace(/\+-/,"-");
- }
- o = o.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function($$,$1,$2,$3) { return $1 + $2 + $3.substr(0,(period+ee)%period) + "." + $3.substr(ee) + "E"; });
- } else o = val.toExponential(idx);
- if(fmt.match(/E\+00$/) && o.match(/e[+-]\d$/)) o = o.substr(0,o.length-1) + "0" + o[o.length-1];
- if(fmt.match(/E\-/) && o.match(/e\+/)) o = o.replace(/e\+/,"e");
- return o.replace("e","E");
-}
-var frac1 = /# (\?+)( ?)\/( ?)(\d+)/;
-function write_num_f1(r, aval, sign) {
- var den = parseInt(r[4]), rr = Math.round(aval * den), base = Math.floor(rr/den);
- var myn = (rr - base*den), myd = den;
- return sign + (base === 0 ? "" : ""+base) + " " + (myn === 0 ? fill(" ", r[1].length + 1 + r[4].length) : pad_(myn,r[1].length) + r[2] + "/" + r[3] + pad0(myd,r[4].length));
-}
-function write_num_f2(r, aval, sign) {
- return sign + (aval === 0 ? "" : ""+aval) + fill(" ", r[1].length + 2 + r[4].length);
-}
-var dec1 = /^#*0*\.(0+)/;
-var closeparen = /\).*[0#]/;
-var phone = /\(###\) ###\\?-####/;
-function hashq(str) {
- var o = "", cc;
- for(var i = 0; i != str.length; ++i) switch((cc=str.charCodeAt(i))) {
- case 35: break;
- case 63: o+= " "; break;
- case 48: o+= "0"; break;
- default: o+= String.fromCharCode(cc);
- }
- return o;
-}
-function rnd(val, d) { var dd = Math.pow(10,d); return ""+(Math.round(val * dd)/dd); }
-function dec(val, d) { return Math.round((val-Math.floor(val))*Math.pow(10,d)); }
-function flr(val) { if(val < 2147483647 && val > -2147483648) return ""+(val >= 0 ? (val|0) : (val-1|0)); return ""+Math.floor(val); }
-function write_num_flt(type, fmt, val) {
- if(type.charCodeAt(0) === 40 && !fmt.match(closeparen)) {
- var ffmt = fmt.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");
- if(val >= 0) return write_num_flt('n', ffmt, val);
- return '(' + write_num_flt('n', ffmt, -val) + ')';
- }
- if(fmt.charCodeAt(fmt.length - 1) === 44) return write_num_cm(type, fmt, val);
- if(fmt.indexOf('%') !== -1) return write_num_pct(type, fmt, val);
- if(fmt.indexOf('E') !== -1) return write_num_exp(fmt, val);
- if(fmt.charCodeAt(0) === 36) return "$"+write_num_flt(type,fmt.substr(fmt[1]==' '?2:1),val);
- var o, oo;
- var r, ri, ff, aval = Math.abs(val), sign = val < 0 ? "-" : "";
- if(fmt.match(/^00+$/)) return sign + pad0r(aval,fmt.length);
- if(fmt.match(/^[#?]+$/)) {
- o = pad0r(val,0); if(o === "0") o = "";
- return o.length > fmt.length ? o : hashq(fmt.substr(0,fmt.length-o.length)) + o;
- }
- if((r = fmt.match(frac1)) !== null) return write_num_f1(r, aval, sign);
- if(fmt.match(/^#+0+$/) !== null) return sign + pad0r(aval,fmt.length - fmt.indexOf("0"));
- if((r = fmt.match(dec1)) !== null) {
- o = rnd(val, r[1].length).replace(/^([^\.]+)$/,"$1."+r[1]).replace(/\.$/,"."+r[1]).replace(/\.(\d*)$/,function($$, $1) { return "." + $1 + fill("0", r[1].length-$1.length); });
- return fmt.indexOf("0.") !== -1 ? o : o.replace(/^0\./,".");
- }
- fmt = fmt.replace(/^#+([0.])/, "$1");
- if((r = fmt.match(/^(0*)\.(#*)$/)) !== null) {
- return sign + rnd(aval, r[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,r[1].length?"0.":".");
- }
- if((r = fmt.match(/^#,##0(\.?)$/)) !== null) return sign + commaify(pad0r(aval,0));
- if((r = fmt.match(/^#,##0\.([#0]*0)$/)) !== null) {
- return val < 0 ? "-" + write_num_flt(type, fmt, -val) : commaify(""+(Math.floor(val))) + "." + pad0(dec(val, r[1].length),r[1].length);
- }
- if((r = fmt.match(/^#,#*,#0/)) !== null) return write_num_flt(type,fmt.replace(/^#,#*,/,""),val);
- if((r = fmt.match(/^([0#]+)(\\?-([0#]+))+$/)) !== null) {
- o = _strrev(write_num_flt(type, fmt.replace(/[\\-]/g,""), val));
- ri = 0;
- return _strrev(_strrev(fmt.replace(/\\/g,"")).replace(/[0#]/g,function(x){return ri= 0) return write_num_int('n', ffmt, val);
- return '(' + write_num_int('n', ffmt, -val) + ')';
- }
- if(fmt.charCodeAt(fmt.length - 1) === 44) return write_num_cm2(type, fmt, val);
- if(fmt.indexOf('%') !== -1) return write_num_pct2(type, fmt, val);
- if(fmt.indexOf('E') !== -1) return write_num_exp2(fmt, val);
- if(fmt.charCodeAt(0) === 36) return "$"+write_num_int(type,fmt.substr(fmt[1]==' '?2:1),val);
- var o;
- var r, ri, ff, aval = Math.abs(val), sign = val < 0 ? "-" : "";
- if(fmt.match(/^00+$/)) return sign + pad0(aval,fmt.length);
- if(fmt.match(/^[#?]+$/)) {
- o = (""+val); if(val === 0) o = "";
- return o.length > fmt.length ? o : hashq(fmt.substr(0,fmt.length-o.length)) + o;
- }
- if((r = fmt.match(frac1)) !== null) return write_num_f2(r, aval, sign);
- if(fmt.match(/^#+0+$/) !== null) return sign + pad0(aval,fmt.length - fmt.indexOf("0"));
- if((r = fmt.match(dec1)) !== null) {
- o = (""+val).replace(/^([^\.]+)$/,"$1."+r[1]).replace(/\.$/,"."+r[1]).replace(/\.(\d*)$/,function($$, $1) { return "." + $1 + fill("0", r[1].length-$1.length); });
- return fmt.indexOf("0.") !== -1 ? o : o.replace(/^0\./,".");
- }
- fmt = fmt.replace(/^#+([0.])/, "$1");
- if((r = fmt.match(/^(0*)\.(#*)$/)) !== null) {
- return sign + (""+aval).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,r[1].length?"0.":".");
- }
- if((r = fmt.match(/^#,##0(\.?)$/)) !== null) return sign + commaify((""+aval));
- if((r = fmt.match(/^#,##0\.([#0]*0)$/)) !== null) {
- return val < 0 ? "-" + write_num_int(type, fmt, -val) : commaify((""+val)) + "." + fill('0',r[1].length);
- }
- if((r = fmt.match(/^#,#*,#0/)) !== null) return write_num_int(type,fmt.replace(/^#,#*,/,""),val);
- if((r = fmt.match(/^([0#]+)(\\?-([0#]+))+$/)) !== null) {
- o = _strrev(write_num_int(type, fmt.replace(/[\\-]/g,""), val));
- ri = 0;
- return _strrev(_strrev(fmt.replace(/\\/g,"")).replace(/[0#]/g,function(x){return ri= 12 ? "P" : "A"; q.t = 'T'; hr='h';i+=3;}
- else if(fmt.substr(i,5) === "AM/PM") { if(dt!=null) q.v = dt.H >= 12 ? "PM" : "AM"; q.t = 'T'; i+=5; hr='h'; }
- else { q.t = "t"; ++i; }
- if(dt==null && q.t === 'T') return "";
- out[out.length] = q; lst = c; break;
- case '[':
- o = c;
- while(fmt[i++] !== ']' && i < fmt.length) o += fmt[i];
- if(o.substr(-1) !== ']') throw 'unterminated "[" block: |' + o + '|';
- if(o.match(abstime)) {
- if(dt==null) { dt=parse_date_code(v, opts); if(dt==null) return ""; }
- out[out.length] = {t:'Z', v:o.toLowerCase()};
- } else { o=""; }
- break;
- /* Numbers */
- case '.':
- if(dt != null) {
- o = c; while((c=fmt[++i]) === "0") o += c;
- out[out.length] = {t:'s', v:o}; break;
- }
- /* falls through */
- case '0': case '#':
- o = c; while("0#?.,E+-%".indexOf(c=fmt[++i]) > -1 || c=='\\' && fmt[i+1] == "-" && "0#".indexOf(fmt[i+2])>-1) o += c;
- out[out.length] = {t:'n', v:o}; break;
- case '?':
- o = c; while(fmt[++i] === c) o+=c;
- q={t:c, v:o}; out[out.length] = q; lst = c; break;
- case '*': ++i; if(fmt[i] == ' ' || fmt[i] == '*') ++i; break; // **
- case '(': case ')': out[out.length] = {t:(flen===1?'t':c), v:c}; ++i; break;
- case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
- o = c; while("0123456789".indexOf(fmt[++i]) > -1) o+=fmt[i];
- out[out.length] = {t:'D', v:o}; break;
- case ' ': out[out.length] = {t:c, v:c}; ++i; break;
- default:
- if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxz".indexOf(c) === -1) throw new Error('unrecognized character ' + c + ' in ' + fmt);
- out[out.length] = {t:'t', v:c}; ++i; break;
- }
- }
- var bt = 0, ss0 = 0, ssm;
- for(i=out.length-1, lst='t'; i >= 0; --i) {
- switch(out[i].t) {
- case 'h': case 'H': out[i].t = hr; lst='h'; if(bt < 1) bt = 1; break;
- case 's':
- if((ssm=out[i].v.match(/\.0+$/))) ss0=Math.max(ss0,ssm[0].length-1);
- if(bt < 3) bt = 3;
- /* falls through */
- case 'd': case 'y': case 'M': case 'e': lst=out[i].t; break;
- case 'm': if(lst === 's') { out[i].t = 'M'; if(bt < 2) bt = 2; } break;
- case 'X': if(out[i].v === "B2");
- break;
- case 'Z':
- if(bt < 1 && out[i].v.match(/[Hh]/)) bt = 1;
- if(bt < 2 && out[i].v.match(/[Mm]/)) bt = 2;
- if(bt < 3 && out[i].v.match(/[Ss]/)) bt = 3;
- }
- }
- switch(bt) {
- case 0: break;
- case 1:
- if(dt.u >= 0.5) { dt.u = 0; ++dt.S; }
- if(dt.S >= 60) { dt.S = 0; ++dt.M; }
- if(dt.M >= 60) { dt.M = 0; ++dt.H; }
- break;
- case 2:
- if(dt.u >= 0.5) { dt.u = 0; ++dt.S; }
- if(dt.S >= 60) { dt.S = 0; ++dt.M; }
- break;
- }
- /* replace fields */
- var nstr = "", jj;
- for(i=0; i < out.length; ++i) {
- switch(out[i].t) {
- case 't': case 'T': case ' ': case 'D': break;
- case 'X': out[i] = undefined; break;
- case 'd': case 'm': case 'y': case 'h': case 'H': case 'M': case 's': case 'e': case 'b': case 'Z':
- out[i].v = write_date(out[i].t.charCodeAt(0), out[i].v, dt, ss0);
- out[i].t = 't'; break;
- case 'n': case '(': case '?':
- jj = i+1;
- while(out[jj] != null && (
- (c=out[jj].t) === "?" || c === "D" ||
- (c === " " || c === "t") && out[jj+1] != null && (out[jj+1].t === '?' || out[jj+1].t === "t" && out[jj+1].v === '/') ||
- out[i].t === '(' && (c === ' ' || c === 'n' || c === ')') ||
- c === 't' && (out[jj].v === '/' || '$€'.indexOf(out[jj].v) > -1 || out[jj].v === ' ' && out[jj+1] != null && out[jj+1].t == '?')
- )) {
- out[i].v += out[jj].v;
- out[jj] = undefined; ++jj;
- }
- nstr += out[i].v;
- i = jj-1; break;
- case 'G': out[i].t = 't'; out[i].v = general_fmt(v,opts); break;
- }
- }
- var vv = "", myv, ostr;
- if(nstr.length > 0) {
- myv = (v<0&&nstr.charCodeAt(0) === 45 ? -v : v); /* '-' */
- ostr = write_num(nstr.charCodeAt(0) === 40 ? '(' : 'n', nstr, myv); /* '(' */
- jj=ostr.length-1;
- var decpt = out.length;
- for(i=0; i < out.length; ++i) if(out[i] != null && out[i].v.indexOf(".") > -1) { decpt = i; break; }
- var lasti=out.length;
- if(decpt === out.length && ostr.indexOf("E") === -1) {
- for(i=out.length-1; i>= 0;--i) {
- if(out[i] == null || 'n?('.indexOf(out[i].t) === -1) continue;
- if(jj>=out[i].v.length-1) { jj -= out[i].v.length; out[i].v = ostr.substr(jj+1, out[i].v.length); }
- else if(jj < 0) out[i].v = "";
- else { out[i].v = ostr.substr(0, jj+1); jj = -1; }
- out[i].t = 't';
- lasti = i;
- }
- if(jj>=0 && lasti= 0; --i) {
- if(out[i] == null || 'n?('.indexOf(out[i].t) === -1) continue;
- j=out[i].v.indexOf(".")>-1&&i===decpt?out[i].v.indexOf(".")-1:out[i].v.length-1;
- vv = out[i].v.substr(j+1);
- for(; j>=0; --j) {
- if(jj>=0 && (out[i].v[j] === "0" || out[i].v[j] === "#")) vv = ostr[jj--] + vv;
- }
- out[i].v = vv;
- out[i].t = 't';
- lasti = i;
- }
- if(jj>=0 && lasti-1&&i===decpt?out[i].v.indexOf(".")+1:0;
- vv = out[i].v.substr(0,j);
- for(; j-1) {
- myv = (flen >1 && v < 0 && i>0 && out[i-1].v === "-" ? -v:v);
- out[i].v = write_num(out[i].t, out[i].v, myv);
- out[i].t = 't';
- }
- var retval = "";
- for(i=0; i !== out.length; ++i) if(out[i] != null) retval += out[i].v;
- return retval;
-}
-SSF._eval = eval_fmt;
-var cfregex = /\[[=<>]/;
-var cfregex2 = /\[([=<>]*)(-?\d+\.?\d*)\]/;
-function chkcond(v, rr) {
- if(rr == null) return false;
- var thresh = parseFloat(rr[2]);
- switch(rr[1]) {
- case "=": if(v == thresh) return true; break;
- case ">": if(v > thresh) return true; break;
- case "<": if(v < thresh) return true; break;
- case "<>": if(v != thresh) return true; break;
- case ">=": if(v >= thresh) return true; break;
- case "<=": if(v <= thresh) return true; break;
- }
- return false;
-}
-function choose_fmt(f, v) {
- var fmt = split_fmt(f);
- var l = fmt.length, lat = fmt[l-1].indexOf("@");
- if(l<4 && lat>-1) --l;
- if(fmt.length > 4) throw "cannot find right format for |" + fmt + "|";
- if(typeof v !== "number") return [4, fmt.length === 4 || lat>-1?fmt[fmt.length-1]:"@"];
- switch(fmt.length) {
- case 1: fmt = lat>-1 ? ["General", "General", "General", fmt[0]] : [fmt[0], fmt[0], fmt[0], "@"]; break;
- case 2: fmt = lat>-1 ? [fmt[0], fmt[0], fmt[0], fmt[1]] : [fmt[0], fmt[1], fmt[0], "@"]; break;
- case 3: fmt = lat>-1 ? [fmt[0], fmt[1], fmt[0], fmt[2]] : [fmt[0], fmt[1], fmt[2], "@"]; break;
- case 4: break;
- }
- var ff = v > 0 ? fmt[0] : v < 0 ? fmt[1] : fmt[2];
- if(fmt[0].indexOf("[") === -1 && fmt[1].indexOf("[") === -1) return [l, ff];
- if(fmt[0].match(cfregex) != null || fmt[1].match(cfregex) != null) {
- var m1 = fmt[0].match(cfregex2);
- var m2 = fmt[1].match(cfregex2);
- return chkcond(v, m1) ? [l, fmt[0]] : chkcond(v, m2) ? [l, fmt[1]] : [l, fmt[m1 != null && m2 != null ? 2 : 1]];
- }
- return [l, ff];
-}
-function format(fmt,v,o) {
- fixopts(o != null ? o : (o=[]));
- var sfmt = "";
- switch(typeof fmt) {
- case "string": sfmt = fmt; break;
- case "number": sfmt = (o.table != null ? o.table : table_fmt)[fmt]; break;
- }
- if(isgeneral(sfmt,0)) return general_fmt(v, o);
- var f = choose_fmt(sfmt, v);
- if(isgeneral(f[1])) return general_fmt(v, o);
- if(v === true) v = "TRUE"; else if(v === false) v = "FALSE";
- else if(v === "" || v == null) return "";
- return eval_fmt(f[1], v, o, f[0]);
-}
-SSF._table = table_fmt;
-SSF.load = function load_entry(fmt, idx) { table_fmt[idx] = fmt; };
-SSF.format = format;
-SSF.get_table = function get_table() { return table_fmt; };
-SSF.load_table = function load_table(tbl) { for(var i=0; i!=0x0188; ++i) if(tbl[i] !== undefined) SSF.load(tbl[i], i); };
-};
-make_ssf(SSF);
-/* map from xlml named formats to SSF TODO: localize */
-var XLMLFormatMap = {
- "General Number": "General",
- "General Date": SSF._table[22],
- "Long Date": "dddd, mmmm dd, yyyy",
- "Medium Date": SSF._table[15],
- "Short Date": SSF._table[14],
- "Long Time": SSF._table[19],
- "Medium Time": SSF._table[18],
- "Short Time": SSF._table[20],
- "Currency": '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',
- "Fixed": SSF._table[2],
- "Standard": SSF._table[4],
- "Percent": SSF._table[10],
- "Scientific": SSF._table[11],
- "Yes/No": '"Yes";"Yes";"No";@',
- "True/False": '"True";"True";"False";@',
- "On/Off": '"Yes";"Yes";"No";@'
-};
-
-var DO_NOT_EXPORT_CFB = true;
-/* cfb.js (C) 2013-2014 SheetJS -- http://sheetjs.com */
-/* vim: set ts=2: */
-/*jshint eqnull:true */
-
-/* [MS-CFB] v20130118 */
-var CFB = (function _CFB(){
-var exports = {};
-exports.version = '0.10.2';
-function parse(file) {
-var mver = 3; // major version
-var ssz = 512; // sector size
-var nmfs = 0; // number of mini FAT sectors
-var ndfs = 0; // number of DIFAT sectors
-var dir_start = 0; // first directory sector location
-var minifat_start = 0; // first mini FAT sector location
-var difat_start = 0; // first mini FAT sector location
-
-var fat_addrs = []; // locations of FAT sectors
-
-/* [MS-CFB] 2.2 Compound File Header */
-var blob = file.slice(0,512);
-prep_blob(blob, 0);
-
-/* major version */
-var mv = check_get_mver(blob);
-mver = mv[0];
-switch(mver) {
- case 3: ssz = 512; break; case 4: ssz = 4096; break;
- default: throw "Major Version: Expected 3 or 4 saw " + mver;
-}
-
-/* reprocess header */
-if(ssz !== 512) { blob = file.slice(0,ssz); prep_blob(blob, 28 /* blob.l */); }
-/* Save header for final object */
-var header = file.slice(0,ssz);
-
-check_shifts(blob, mver);
-
-// Number of Directory Sectors
-var nds = blob.read_shift(4, 'i');
-if(mver === 3 && nds !== 0) throw '# Directory Sectors: Expected 0 saw ' + nds;
-
-// Number of FAT Sectors
-//var nfs = blob.read_shift(4, 'i');
-blob.l += 4;
-
-// First Directory Sector Location
-dir_start = blob.read_shift(4, 'i');
-
-// Transaction Signature
-blob.l += 4;
-
-// Mini Stream Cutoff Size
-blob.chk('00100000', 'Mini Stream Cutoff Size: ');
-
-// First Mini FAT Sector Location
-minifat_start = blob.read_shift(4, 'i');
-
-// Number of Mini FAT Sectors
-nmfs = blob.read_shift(4, 'i');
-
-// First DIFAT sector location
-difat_start = blob.read_shift(4, 'i');
-
-// Number of DIFAT Sectors
-ndfs = blob.read_shift(4, 'i');
-
-// Grab FAT Sector Locations
-for(var q, j = 0; j < 109; ++j) { /* 109 = (512 - blob.l)>>>2; */
- q = blob.read_shift(4, 'i');
- if(q<0) break;
- fat_addrs[j] = q;
-}
-
-/** Break the file up into sectors */
-var sectors = sectorify(file, ssz);
-
-sleuth_fat(difat_start, ndfs, sectors, ssz, fat_addrs);
-
-/** Chains */
-var sector_list = make_sector_list(sectors, dir_start, fat_addrs, ssz);
-
-sector_list[dir_start].name = "!Directory";
-if(nmfs > 0 && minifat_start !== ENDOFCHAIN) sector_list[minifat_start].name = "!MiniFAT";
-sector_list[fat_addrs[0]].name = "!FAT";
-sector_list.fat_addrs = fat_addrs;
-sector_list.ssz = ssz;
-
-/* [MS-CFB] 2.6.1 Compound File Directory Entry */
-var files = {}, Paths = [], FileIndex = [], FullPaths = [], FullPathDir = {};
-read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex);
-
-build_full_paths(FileIndex, FullPathDir, FullPaths, Paths);
-
-var root_name = Paths.shift();
-Paths.root = root_name;
-
-/* [MS-CFB] 2.6.4 (Unicode 3.0.1 case conversion) */
-var find_path = make_find_path(FullPaths, Paths, FileIndex, files, root_name);
-
-return {
- raw: {header: header, sectors: sectors},
- FileIndex: FileIndex,
- FullPaths: FullPaths,
- FullPathDir: FullPathDir,
- find: find_path
-};
-} // parse
-
-/* [MS-CFB] 2.2 Compound File Header -- read up to major version */
-function check_get_mver(blob) {
- // header signature 8
- blob.chk(HEADER_SIGNATURE, 'Header Signature: ');
-
- // clsid 16
- blob.chk(HEADER_CLSID, 'CLSID: ');
-
- // minor version 2
- var mver = blob.read_shift(2, 'u');
-
- return [blob.read_shift(2,'u'), mver];
-}
-function check_shifts(blob, mver) {
- var shift = 0x09;
-
- // Byte Order
- blob.chk('feff', 'Byte Order: ');
-
- // Sector Shift
- switch((shift = blob.read_shift(2))) {
- case 0x09: if(mver !== 3) throw 'MajorVersion/SectorShift Mismatch'; break;
- case 0x0c: if(mver !== 4) throw 'MajorVersion/SectorShift Mismatch'; break;
- default: throw 'Sector Shift: Expected 9 or 12 saw ' + shift;
- }
-
- // Mini Sector Shift
- blob.chk('0600', 'Mini Sector Shift: ');
-
- // Reserved
- blob.chk('000000000000', 'Reserved: ');
-}
-
-/** Break the file up into sectors */
-function sectorify(file, ssz) {
- var nsectors = Math.ceil(file.length/ssz)-1;
- var sectors = new Array(nsectors);
- for(var i=1; i < nsectors; ++i) sectors[i-1] = file.slice(i*ssz,(i+1)*ssz);
- sectors[nsectors-1] = file.slice(nsectors*ssz);
- return sectors;
-}
-
-/* [MS-CFB] 2.6.4 Red-Black Tree */
-function build_full_paths(FI, FPD, FP, Paths) {
- var i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;
- var dad = new Array(pl), q = new Array(pl);
-
- for(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }
-
- for(; j < q.length; ++j) {
- i = q[j];
- L = FI[i].L; R = FI[i].R; C = FI[i].C;
- if(dad[i] === i) {
- if(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];
- if(R !== -1 && dad[R] !== R) dad[i] = dad[R];
- }
- if(C !== -1 /*NOSTREAM*/) dad[C] = i;
- if(L !== -1) { dad[L] = dad[i]; q.push(L); }
- if(R !== -1) { dad[R] = dad[i]; q.push(R); }
- }
- for(i=1; i !== pl; ++i) if(dad[i] === i) {
- if(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];
- else if(L !== -1 && dad[L] !== L) dad[i] = dad[L];
- }
-
- for(i=1; i < pl; ++i) {
- if(FI[i].type === 0 /* unknown */) continue;
- j = dad[i];
- if(j === 0) FP[i] = FP[0] + "/" + FP[i];
- else while(j !== 0) {
- FP[i] = FP[j] + "/" + FP[i];
- j = dad[j];
- }
- dad[i] = 0;
- }
-
- FP[0] += "/";
- for(i=1; i < pl; ++i) {
- if(FI[i].type !== 2 /* stream */) FP[i] += "/";
- FPD[FP[i]] = FI[i];
- }
-}
-
-/* [MS-CFB] 2.6.4 */
-function make_find_path(FullPaths, Paths, FileIndex, files, root_name) {
- var UCFullPaths = new Array(FullPaths.length);
- var UCPaths = new Array(Paths.length), i;
- for(i = 0; i < FullPaths.length; ++i) UCFullPaths[i] = FullPaths[i].toUpperCase().replace(chr0,'').replace(chr1,'!');
- for(i = 0; i < Paths.length; ++i) UCPaths[i] = Paths[i].toUpperCase().replace(chr0,'').replace(chr1,'!');
- return function find_path(path) {
- var k;
- if(path.charCodeAt(0) === 47 /* "/" */) { k=true; path = root_name + path; }
- else k = path.indexOf("/") !== -1;
- var UCPath = path.toUpperCase().replace(chr0,'').replace(chr1,'!');
- var w = k === true ? UCFullPaths.indexOf(UCPath) : UCPaths.indexOf(UCPath);
- if(w === -1) return null;
- return k === true ? FileIndex[w] : files[Paths[w]];
- };
-}
-
-/** Chase down the rest of the DIFAT chain to build a comprehensive list
- DIFAT chains by storing the next sector number as the last 32 bytes */
-function sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {
- var q;
- if(idx === ENDOFCHAIN) {
- if(cnt !== 0) throw "DIFAT chain shorter than expected";
- } else if(idx !== -1 /*FREESECT*/) {
- var sector = sectors[idx], m = (ssz>>>2)-1;
- for(var i = 0; i < m; ++i) {
- if((q = __readInt32LE(sector,i*4)) === ENDOFCHAIN) break;
- fat_addrs.push(q);
- }
- sleuth_fat(__readInt32LE(sector,ssz-4),cnt - 1, sectors, ssz, fat_addrs);
- }
-}
-
-/** Follow the linked list of sectors for a given starting point */
-function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {
- var sl = sectors.length;
- var buf, buf_chain;
- if(!chkd) chkd = new Array(sl);
- var modulus = ssz - 1, j, jj;
- buf = [];
- buf_chain = [];
- for(j=start; j>=0;) {
- chkd[j] = true;
- buf[buf.length] = j;
- buf_chain.push(sectors[j]);
- var addr = fat_addrs[Math.floor(j*4/ssz)];
- jj = ((j*4) & modulus);
- if(ssz < 4 + jj) throw "FAT boundary crossed: " + j + " 4 "+ssz;
- j = __readInt32LE(sectors[addr], jj);
- }
- return {nodes: buf, data:__toBuffer([buf_chain])};
-}
-
-/** Chase down the sector linked lists */
-function make_sector_list(sectors, dir_start, fat_addrs, ssz) {
- var sl = sectors.length, sector_list = new Array(sl);
- var chkd = new Array(sl), buf, buf_chain;
- var modulus = ssz - 1, i, j, k, jj;
- for(i=0; i < sl; ++i) {
- buf = [];
- k = (i + dir_start); if(k >= sl) k-=sl;
- if(chkd[k] === true) continue;
- buf_chain = [];
- for(j=k; j>=0;) {
- chkd[j] = true;
- buf[buf.length] = j;
- buf_chain.push(sectors[j]);
- var addr = fat_addrs[Math.floor(j*4/ssz)];
- jj = ((j*4) & modulus);
- if(ssz < 4 + jj) throw "FAT boundary crossed: " + j + " 4 "+ssz;
- j = __readInt32LE(sectors[addr], jj);
- }
- sector_list[k] = {nodes: buf, data:__toBuffer([buf_chain])};
- }
- return sector_list;
-}
-
-/* [MS-CFB] 2.6.1 Compound File Directory Entry */
-function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex) {
- var blob;
- var minifat_store = 0, pl = (Paths.length?2:0);
- var sector = sector_list[dir_start].data;
- var i = 0, namelen = 0, name, o, ctime, mtime;
- for(; i < sector.length; i+= 128) {
- blob = sector.slice(i, i+128);
- prep_blob(blob, 64);
- namelen = blob.read_shift(2);
- if(namelen === 0) continue;
- name = __utf16le(blob,0,namelen-pl);
- Paths.push(name);
- o = {
- name: name,
- type: blob.read_shift(1),
- color: blob.read_shift(1),
- L: blob.read_shift(4, 'i'),
- R: blob.read_shift(4, 'i'),
- C: blob.read_shift(4, 'i'),
- clsid: blob.read_shift(16),
- state: blob.read_shift(4, 'i')
- };
- ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);
- if(ctime !== 0) {
- o.ctime = ctime; o.ct = read_date(blob, blob.l-8);
- }
- mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);
- if(mtime !== 0) {
- o.mtime = mtime; o.mt = read_date(blob, blob.l-8);
- }
- o.start = blob.read_shift(4, 'i');
- o.size = blob.read_shift(4, 'i');
- if(o.type === 5) { /* root */
- minifat_store = o.start;
- if(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = "!StreamData";
- /*minifat_size = o.size;*/
- } else if(o.size >= 4096 /* MSCSZ */) {
- o.storage = 'fat';
- if(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);
- sector_list[o.start].name = o.name;
- o.content = sector_list[o.start].data.slice(0,o.size);
- prep_blob(o.content, 0);
- } else {
- o.storage = 'minifat';
- if(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN) {
- o.content = sector_list[minifat_store].data.slice(o.start*MSSZ,o.start*MSSZ+o.size);
- prep_blob(o.content, 0);
- }
- }
- files[name] = o;
- FileIndex.push(o);
- }
-}
-
-function read_date(blob, offset) {
- return new Date(( ( (__readUInt32LE(blob,offset+4)/1e7)*Math.pow(2,32)+__readUInt32LE(blob,offset)/1e7 ) - 11644473600)*1000);
-}
-
-var fs;
-function readFileSync(filename, options) {
- if(fs === undefined) fs = require('fs');
- return parse(fs.readFileSync(filename), options);
-}
-
-function readSync(blob, options) {
- switch(options !== undefined && options.type !== undefined ? options.type : "base64") {
- case "file": return readFileSync(blob, options);
- case "base64": return parse(s2a(Base64.decode(blob)), options);
- case "binary": return parse(s2a(blob), options);
- }
- return parse(blob);
-}
-
-/** CFB Constants */
-var MSSZ = 64; /* Mini Sector Size = 1<<6 */
-//var MSCSZ = 4096; /* Mini Stream Cutoff Size */
-/* 2.1 Compound File Sector Numbers and Types */
-var ENDOFCHAIN = -2;
-/* 2.2 Compound File Header */
-var HEADER_SIGNATURE = 'd0cf11e0a1b11ae1';
-var HEADER_CLSID = '00000000000000000000000000000000';
-var consts = {
- /* 2.1 Compund File Sector Numbers and Types */
- MAXREGSECT: -6,
- DIFSECT: -4,
- FATSECT: -3,
- ENDOFCHAIN: ENDOFCHAIN,
- FREESECT: -1,
- /* 2.2 Compound File Header */
- HEADER_SIGNATURE: HEADER_SIGNATURE,
- HEADER_MINOR_VERSION: '3e00',
- MAXREGSID: -6,
- NOSTREAM: -1,
- HEADER_CLSID: HEADER_CLSID,
- /* 2.6.1 Compound File Directory Entry */
- EntryTypes: ['unknown','storage','stream','lockbytes','property','root']
-};
-
-exports.read = readSync;
-exports.parse = parse;
-exports.utils = {
- ReadShift: ReadShift,
- CheckField: CheckField,
- prep_blob: prep_blob,
- bconcat: bconcat,
- consts: consts
-};
-
-return exports;
-})();
-
-if(typeof require !== 'undefined' && typeof module !== 'undefined' && typeof DO_NOT_EXPORT_CFB === 'undefined') { module.exports = CFB; }
-function isval(x) { return x !== undefined && x !== null; }
-
-function keys(o) { return Object.keys(o); }
-
-function evert_key(obj, key) {
- var o = [], K = keys(obj);
- for(var i = 0; i !== K.length; ++i) o[obj[K[i]][key]] = K[i];
- return o;
-}
-
-function evert(obj) {
- var o = [], K = keys(obj);
- for(var i = 0; i !== K.length; ++i) o[obj[K[i]]] = K[i];
- return o;
-}
-
-function evert_num(obj) {
- var o = [], K = keys(obj);
- for(var i = 0; i !== K.length; ++i) o[obj[K[i]]] = parseInt(K[i],10);
- return o;
-}
-
-function evert_arr(obj) {
- var o = [], K = keys(obj);
- for(var i = 0; i !== K.length; ++i) {
- if(o[obj[K[i]]] == null) o[obj[K[i]]] = [];
- o[obj[K[i]]].push(K[i]);
- }
- return o;
-}
-
-/* TODO: date1904 logic */
-function datenum(v, date1904) {
- if(date1904) v+=1462;
- var epoch = Date.parse(v);
- return (epoch + 2209161600000) / (24 * 60 * 60 * 1000);
-}
-
-function cc2str(arr) {
- var o = "";
- for(var i = 0; i != arr.length; ++i) o += String.fromCharCode(arr[i]);
- return o;
-}
-
-function getdata(data) {
- if(!data) return null;
- if(data.name.substr(-4) === ".bin") {
- if(data.data) return char_codes(data.data);
- if(data.asNodeBuffer && has_buf) return data.asNodeBuffer();
- if(data._data && data._data.getContent) return Array.prototype.slice.call(data._data.getContent());
- } else {
- if(data.data) return data.name.substr(-4) !== ".bin" ? debom_xml(data.data) : char_codes(data.data);
- if(data.asNodeBuffer && has_buf) return debom_xml(data.asNodeBuffer().toString('binary'));
- if(data.asBinary) return debom_xml(data.asBinary());
- if(data._data && data._data.getContent) return debom_xml(cc2str(Array.prototype.slice.call(data._data.getContent(),0)));
- }
- return null;
-}
-
-function safegetzipfile(zip, file) {
- var f = file; if(zip.files[f]) return zip.files[f];
- f = file.toLowerCase(); if(zip.files[f]) return zip.files[f];
- f = f.replace(/\//g,'\\'); if(zip.files[f]) return zip.files[f];
- return null;
-}
-
-function getzipfile(zip, file) {
- var o = safegetzipfile(zip, file);
- if(o == null) throw new Error("Cannot find file " + file + " in zip");
- return o;
-}
-
-function getzipdata(zip, file, safe) {
- if(!safe) return getdata(getzipfile(zip, file));
- if(!file) return null;
- try { return getzipdata(zip, file); } catch(e) { return null; }
-}
-
-var _fs, jszip;
-if(typeof JSZip !== 'undefined') jszip = JSZip;
-if (typeof exports !== 'undefined') {
- if (typeof module !== 'undefined' && module.exports) {
- if(has_buf && typeof jszip === 'undefined') jszip = require('js'+'zip');
- if(typeof jszip === 'undefined') jszip = require('./js'+'zip').JSZip;
- _fs = require('f'+'s');
- }
-}
-var attregexg=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g;
-var tagregex=/<[^>]*>/g;
-var nsregex=/<\w*:/, nsregex2 = /<(\/?)\w+:/;
-function parsexmltag(tag, skip_root) {
- var z = [];
- var eq = 0, c = 0;
- for(; eq !== tag.length; ++eq) if((c = tag.charCodeAt(eq)) === 32 || c === 10 || c === 13) break;
- if(!skip_root) z[0] = tag.substr(0, eq);
- if(eq === tag.length) return z;
- var m = tag.match(attregexg), j=0, w="", v="", i=0, q="", cc="";
- if(m) for(i = 0; i != m.length; ++i) {
- cc = m[i];
- for(c=0; c != cc.length; ++c) if(cc.charCodeAt(c) === 61) break;
- q = cc.substr(0,c); v = cc.substring(c+2, cc.length-1);
- for(j=0;j!=q.length;++j) if(q.charCodeAt(j) === 58) break;
- if(j===q.length) z[q] = v;
- else z[(j===5 && q.substr(0,5)==="xmlns"?"xmlns":"")+q.substr(j+1)] = v;
- }
- return z;
-}
-function strip_ns(x) { return x.replace(nsregex2, "<$1"); }
-
-var encodings = {
- '"': '"',
- ''': "'",
- '>': '>',
- '<': '<',
- '&': '&'
-};
-var rencoding = evert(encodings);
-var rencstr = "&<>'\"".split("");
-
-// TODO: CP remap (need to read file version to determine OS)
-var unescapexml = (function() {
- var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]+)_/g;
- return function unescapexml(text){
- var s = text + '';
- return s.replace(encregex, function($$) { return encodings[$$]; }).replace(coderegex,function(m,c) {return String.fromCharCode(parseInt(c,16));});
- };
-})();
-
-var decregex=/[&<>'"]/g, charegex = /[\u0000-\u0008\u000b-\u001f]/g;
-function escapexml(text){
- var s = text + '';
- return s.replace(decregex, function(y) { return rencoding[y]; }).replace(charegex,function(s) { return "_x" + ("000"+s.charCodeAt(0).toString(16)).substr(-4) + "_";});
-}
-
-/* TODO: handle codepages */
-var xlml_fixstr = (function() {
- var entregex = /(\d+);/g;
- function entrepl($$,$1) { return String.fromCharCode(parseInt($1,10)); }
- return function xlml_fixstr(str) { return str.replace(entregex,entrepl); };
-})();
-
-function parsexmlbool(value, tag) {
- switch(value) {
- case '1': case 'true': case 'TRUE': return true;
- /* case '0': case 'false': case 'FALSE':*/
- default: return false;
- }
-}
-
-var utf8read = function utf8reada(orig) {
- var out = "", i = 0, c = 0, d = 0, e = 0, f = 0, w = 0;
- while (i < orig.length) {
- c = orig.charCodeAt(i++);
- if (c < 128) { out += String.fromCharCode(c); continue; }
- d = orig.charCodeAt(i++);
- if (c>191 && c<224) { out += String.fromCharCode(((c & 31) << 6) | (d & 63)); continue; }
- e = orig.charCodeAt(i++);
- if (c < 240) { out += String.fromCharCode(((c & 15) << 12) | ((d & 63) << 6) | (e & 63)); continue; }
- f = orig.charCodeAt(i++);
- w = (((c & 7) << 18) | ((d & 63) << 12) | ((e & 63) << 6) | (f & 63))-65536;
- out += String.fromCharCode(0xD800 + ((w>>>10)&1023));
- out += String.fromCharCode(0xDC00 + (w&1023));
- }
- return out;
-};
-
-
-if(has_buf) {
- var utf8readb = function utf8readb(data) {
- var out = new Buffer(2*data.length), w, i, j = 1, k = 0, ww=0, c;
- for(i = 0; i < data.length; i+=j) {
- j = 1;
- if((c=data.charCodeAt(i)) < 128) w = c;
- else if(c < 224) { w = (c&31)*64+(data.charCodeAt(i+1)&63); j=2; }
- else if(c < 240) { w=(c&15)*4096+(data.charCodeAt(i+1)&63)*64+(data.charCodeAt(i+2)&63); j=3; }
- else { j = 4;
- w = (c & 7)*262144+(data.charCodeAt(i+1)&63)*4096+(data.charCodeAt(i+2)&63)*64+(data.charCodeAt(i+3)&63);
- w -= 65536; ww = 0xD800 + ((w>>>10)&1023); w = 0xDC00 + (w&1023);
- }
- if(ww !== 0) { out[k++] = ww&255; out[k++] = ww>>>8; ww = 0; }
- out[k++] = w%256; out[k++] = w>>>8;
- }
- out.length = k;
- return out.toString('ucs2');
- };
- var corpus = "foo bar baz\u00e2\u0098\u0083\u00f0\u009f\u008d\u00a3";
- if(utf8read(corpus) == utf8readb(corpus)) utf8read = utf8readb;
- var utf8readc = function utf8readc(data) { return Buffer(data, 'binary').toString('utf8'); };
- if(utf8read(corpus) == utf8readc(corpus)) utf8read = utf8readc;
-}
-
-// matches ... extracts content
-var matchtag = (function() {
- var mtcache = {};
- return function matchtag(f,g) {
- var t = f+"|"+g;
- if(mtcache[t] !== undefined) return mtcache[t];
- return (mtcache[t] = new RegExp('<(?:\\w+:)?'+f+'(?: xml:space="preserve")?(?:[^>]*)>([^\u2603]*)(?:\\w+:)?'+f+'>',(g||"")));
- };
-})();
-
-var vtregex = (function(){ var vt_cache = {};
- return function vt_regex(bt) {
- if(vt_cache[bt] !== undefined) return vt_cache[bt];
- return (vt_cache[bt] = new RegExp("(.*?)", 'g') );
-};})();
-var vtvregex = /<\/?vt:variant>/g, vtmregex = /]*)>(.*);
-function parseVector(data) {
- var h = parsexmltag(data);
-
- var matches = data.match(vtregex(h.baseType))||[];
- if(matches.length != h.size) throw "unexpected vector length " + matches.length + " != " + h.size;
- var res = [];
- matches.forEach(function(x) {
- var v = x.replace(vtvregex,"").match(vtmregex);
- res.push({v:v[2], t:v[1]});
- });
- return res;
-}
-
-var wtregex = /(^\s|\s$|\n)/;
-function writetag(f,g) {return '<' + f + (g.match(wtregex)?' xml:space="preserve"' : "") + '>' + g + '' + f + '>';}
-
-function wxt_helper(h) { return keys(h).map(function(k) { return " " + k + '="' + h[k] + '"';}).join(""); }
-function writextag(f,g,h) { return '<' + f + (isval(h) ? wxt_helper(h) : "") + (isval(g) ? (g.match(wtregex)?' xml:space="preserve"' : "") + '>' + g + '' + f : "/") + '>';}
-
-function write_w3cdtf(d, t) { try { return d.toISOString().replace(/\.\d*/,""); } catch(e) { if(t) throw e; } }
-
-function write_vt(s) {
- switch(typeof s) {
- case 'string': return writextag('vt:lpwstr', s);
- case 'number': return writextag((s|0)==s?'vt:i4':'vt:r8', String(s));
- case 'boolean': return writextag('vt:bool',s?'true':'false');
- }
- if(s instanceof Date) return writextag('vt:filetime', write_w3cdtf(s));
- throw new Error("Unable to serialize " + s);
-}
-
-var XML_HEADER = '\r\n';
-var XMLNS = {
- 'dc': 'http://purl.org/dc/elements/1.1/',
- 'dcterms': 'http://purl.org/dc/terms/',
- 'dcmitype': 'http://purl.org/dc/dcmitype/',
- 'mx': 'http://schemas.microsoft.com/office/mac/excel/2008/main',
- 'r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',
- 'sjs': 'http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties',
- 'vt': 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes',
- 'xsi': 'http://www.w3.org/2001/XMLSchema-instance',
- 'xsd': 'http://www.w3.org/2001/XMLSchema'
-};
-
-XMLNS.main = [
- 'http://schemas.openxmlformats.org/spreadsheetml/2006/main',
- 'http://purl.oclc.org/ooxml/spreadsheetml/main',
- 'http://schemas.microsoft.com/office/excel/2006/main',
- 'http://schemas.microsoft.com/office/excel/2006/2'
-];
-
-function readIEEE754(buf, idx, isLE, nl, ml) {
- if(isLE === undefined) isLE = true;
- if(!nl) nl = 8;
- if(!ml && nl === 8) ml = 52;
- var e, m, el = nl * 8 - ml - 1, eMax = (1 << el) - 1, eBias = eMax >> 1;
- var bits = -7, d = isLE ? -1 : 1, i = isLE ? (nl - 1) : 0, s = buf[idx + i];
-
- i += d;
- e = s & ((1 << (-bits)) - 1); s >>>= (-bits); bits += el;
- for (; bits > 0; e = e * 256 + buf[idx + i], i += d, bits -= 8);
- m = e & ((1 << (-bits)) - 1); e >>>= (-bits); bits += ml;
- for (; bits > 0; m = m * 256 + buf[idx + i], i += d, bits -= 8);
- if (e === eMax) return m ? NaN : ((s ? -1 : 1) * Infinity);
- else if (e === 0) e = 1 - eBias;
- else { m = m + Math.pow(2, ml); e = e - eBias; }
- return (s ? -1 : 1) * m * Math.pow(2, e - ml);
-}
-
-var __toBuffer, ___toBuffer;
-__toBuffer = ___toBuffer = function toBuffer_(bufs) { var x = []; for(var i = 0; i < bufs[0].length; ++i) { x.push.apply(x, bufs[0][i]); } return x; };
-var __utf16le, ___utf16le;
-__utf16le = ___utf16le = function utf16le_(b,s,e) { var ss=[]; for(var i=s; i 0 ? __utf8(b, i+4,i+4+len-1) : "";};
-var __lpwstr, ___lpwstr;
-__lpwstr = ___lpwstr = function lpwstr_(b,i) { var len = 2*__readUInt32LE(b,i); return len > 0 ? __utf8(b, i+4,i+4+len-1) : "";};
-var __double, ___double;
-__double = ___double = function(b, idx) { return readIEEE754(b, idx);};
-
-var is_buf = function is_buf_a(a) { return Array.isArray(a); };
-if(has_buf) {
- __utf16le = function utf16le_b(b,s,e) { if(!Buffer.isBuffer(b)) return ___utf16le(b,s,e); return b.toString('utf16le',s,e); };
- __hexlify = function(b,s,l) { return Buffer.isBuffer(b) ? b.toString('hex',s,s+l) : ___hexlify(b,s,l); };
- __lpstr = function lpstr_b(b,i) { if(!Buffer.isBuffer(b)) return ___lpstr(b, i); var len = b.readUInt32LE(i); return len > 0 ? b.toString('utf8',i+4,i+4+len-1) : "";};
- __lpwstr = function lpwstr_b(b,i) { if(!Buffer.isBuffer(b)) return ___lpwstr(b, i); var len = 2*b.readUInt32LE(i); return b.toString('utf16le',i+4,i+4+len-1);};
- __utf8 = function utf8_b(s,e) { return this.toString('utf8',s,e); };
- __toBuffer = function(bufs) { return (bufs[0].length > 0 && Buffer.isBuffer(bufs[0][0])) ? Buffer.concat(bufs[0]) : ___toBuffer(bufs);};
- bconcat = function(bufs) { return Buffer.isBuffer(bufs[0]) ? Buffer.concat(bufs) : [].concat.apply([], bufs); };
- __double = function double_(b,i) { if(Buffer.isBuffer(b)) return b.readDoubleLE(i); return ___double(b,i); };
- is_buf = function is_buf_b(a) { return Buffer.isBuffer(a) || Array.isArray(a); };
-}
-
-/* from js-xls */
-if(typeof cptable !== 'undefined') {
- __utf16le = function(b,s,e) { return cptable.utils.decode(1200, b.slice(s,e)); };
- __utf8 = function(b,s,e) { return cptable.utils.decode(65001, b.slice(s,e)); };
- __lpstr = function(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? cptable.utils.decode(current_codepage, b.slice(i+4, i+4+len-1)) : "";};
- __lpwstr = function(b,i) { var len = 2*__readUInt32LE(b,i); return len > 0 ? cptable.utils.decode(1200, b.slice(i+4,i+4+len-1)) : "";};
-}
-
-var __readUInt8 = function(b, idx) { return b[idx]; };
-var __readUInt16LE = function(b, idx) { return b[idx+1]*(1<<8)+b[idx]; };
-var __readInt16LE = function(b, idx) { var u = b[idx+1]*(1<<8)+b[idx]; return (u < 0x8000) ? u : (0xffff - u + 1) * -1; };
-var __readUInt32LE = function(b, idx) { return b[idx+3]*(1<<24)+(b[idx+2]<<16)+(b[idx+1]<<8)+b[idx]; };
-var __readInt32LE = function(b, idx) { return (b[idx+3]<<24)|(b[idx+2]<<16)|(b[idx+1]<<8)|b[idx]; };
-
-var ___unhexlify = function(s) { return s.match(/../g).map(function(x) { return parseInt(x,16);}); };
-var __unhexlify = typeof Buffer !== "undefined" ? function(s) { return Buffer.isBuffer(s) ? new Buffer(s, 'hex') : ___unhexlify(s); } : ___unhexlify;
-
-function ReadShift(size, t) {
- var o="", oI, oR, oo=[], w, vv, i, loc;
- switch(t) {
- case 'dbcs':
- loc = this.l;
- if(has_buf && Buffer.isBuffer(this)) o = this.slice(this.l, this.l+2*size).toString("utf16le");
- else for(i = 0; i != size; ++i) { o+=String.fromCharCode(__readUInt16LE(this, loc)); loc+=2; }
- size *= 2;
- break;
-
- case 'utf8': o = __utf8(this, this.l, this.l + size); break;
- case 'utf16le': size *= 2; o = __utf16le(this, this.l, this.l + size); break;
-
- /* [MS-OLEDS] 2.1.4 LengthPrefixedAnsiString */
- case 'lpstr': o = __lpstr(this, this.l); size = 5 + o.length; break;
- /* [MS-OLEDS] 2.1.5 LengthPrefixedUnicodeString */
- case 'lpwstr': o = __lpwstr(this, this.l); size = 5 + o.length; if(o[o.length-1] == '\u0000') size += 2; break;
-
- case 'cstr': size = 0; o = "";
- while((w=__readUInt8(this, this.l + size++))!==0) oo.push(_getchar(w));
- o = oo.join(""); break;
- case 'wstr': size = 0; o = "";
- while((w=__readUInt16LE(this,this.l +size))!==0){oo.push(_getchar(w));size+=2;}
- size+=2; o = oo.join(""); break;
-
- /* sbcs and dbcs support continue records in the SST way TODO codepages */
- case 'dbcs-cont': o = ""; loc = this.l;
- for(i = 0; i != size; ++i) {
- if(this.lens && this.lens.indexOf(loc) !== -1) {
- w = __readUInt8(this, loc);
- this.l = loc + 1;
- vv = ReadShift.call(this, size-i, w ? 'dbcs-cont' : 'sbcs-cont');
- return oo.join("") + vv;
- }
- oo.push(_getchar(__readUInt16LE(this, loc)));
- loc+=2;
- } o = oo.join(""); size *= 2; break;
-
- case 'sbcs-cont': o = ""; loc = this.l;
- for(i = 0; i != size; ++i) {
- if(this.lens && this.lens.indexOf(loc) !== -1) {
- w = __readUInt8(this, loc);
- this.l = loc + 1;
- vv = ReadShift.call(this, size-i, w ? 'dbcs-cont' : 'sbcs-cont');
- return oo.join("") + vv;
- }
- oo.push(_getchar(__readUInt8(this, loc)));
- loc+=1;
- } o = oo.join(""); break;
-
- default:
- switch(size) {
- case 1: oI = __readUInt8(this, this.l); this.l++; return oI;
- case 2: oI = (t === 'i' ? __readInt16LE : __readUInt16LE)(this, this.l); this.l += 2; return oI;
- case 4:
- if(t === 'i' || (this[this.l+3] & 0x80)===0) { oI = __readInt32LE(this, this.l); this.l += 4; return oI; }
- else { oR = __readUInt32LE(this, this.l); this.l += 4; return oR; } break;
- case 8: if(t === 'f') { oR = __double(this, this.l); this.l += 8; return oR; }
- /* falls through */
- case 16: o = __hexlify(this, this.l, size); break;
- }}
- this.l+=size; return o;
-}
-
-function WriteShift(t, val, f) {
- var size, i;
- if(f === 'dbcs') {
- for(i = 0; i != val.length; ++i) this.writeUInt16LE(val.charCodeAt(i), this.l + 2 * i);
- size = 2 * val.length;
- } else switch(t) {
- case 1: size = 1; this[this.l] = val&255; break;
- case 3: size = 3; this[this.l+2] = val & 255; val >>>= 8; this[this.l+1] = val&255; val >>>= 8; this[this.l] = val&255; break;
- case 4: size = 4; this.writeUInt32LE(val, this.l); break;
- case 8: size = 8; if(f === 'f') { this.writeDoubleLE(val, this.l); break; }
- /* falls through */
- case 16: break;
- case -4: size = 4; this.writeInt32LE(val, this.l); break;
- }
- this.l += size; return this;
-}
-
-function CheckField(hexstr, fld) {
- var m = __hexlify(this,this.l,hexstr.length>>1);
- if(m !== hexstr) throw fld + 'Expected ' + hexstr + ' saw ' + m;
- this.l += hexstr.length>>1;
-}
-
-function prep_blob(blob, pos) {
- blob.l = pos;
- blob.read_shift = ReadShift;
- blob.chk = CheckField;
- blob.write_shift = WriteShift;
-}
-
-function parsenoop(blob, length) { blob.l += length; }
-
-function writenoop(blob, length) { blob.l += length; }
-
-function new_buf(sz) {
- var o = new_raw_buf(sz);
- prep_blob(o, 0);
- return o;
-}
-
-/* [MS-XLSB] 2.1.4 Record */
-function recordhopper(data, cb, opts) {
- var tmpbyte, cntbyte, length;
- prep_blob(data, data.l || 0);
- while(data.l < data.length) {
- var RT = data.read_shift(1);
- if(RT & 0x80) RT = (RT & 0x7F) + ((data.read_shift(1) & 0x7F)<<7);
- var R = XLSBRecordEnum[RT] || XLSBRecordEnum[0xFFFF];
- tmpbyte = data.read_shift(1);
- length = tmpbyte & 0x7F;
- for(cntbyte = 1; cntbyte <4 && (tmpbyte & 0x80); ++cntbyte) length += ((tmpbyte = data.read_shift(1)) & 0x7F)<<(7*cntbyte);
- var d = R.f(data, length, opts);
- if(cb(d, R, RT)) return;
- }
-}
-
-/* control buffer usage for fixed-length buffers */
-function buf_array() {
- var bufs = [], blksz = 2048;
- var newblk = function ba_newblk(sz) {
- var o = new_buf(sz);
- prep_blob(o, 0);
- return o;
- };
-
- var curbuf = newblk(blksz);
-
- var endbuf = function ba_endbuf() {
- curbuf.length = curbuf.l;
- if(curbuf.length > 0) bufs.push(curbuf);
- curbuf = null;
- };
-
- var next = function ba_next(sz) {
- if(sz < curbuf.length - curbuf.l) return curbuf;
- endbuf();
- return (curbuf = newblk(Math.max(sz+1, blksz)));
- };
-
- var end = function ba_end() {
- endbuf();
- return __toBuffer([bufs]);
- };
-
- var push = function ba_push(buf) { endbuf(); curbuf = buf; next(blksz); };
-
- return { next:next, push:push, end:end, _bufs:bufs };
-}
-
-function write_record(ba, type, payload, length) {
- var t = evert_RE[type], l;
- if(!length) length = XLSBRecordEnum[t].p || (payload||[]).length || 0;
- l = 1 + (t >= 0x80 ? 1 : 0) + 1 + length;
- if(length >= 0x80) ++l; if(length >= 0x4000) ++l; if(length >= 0x200000) ++l;
- var o = ba.next(l);
- if(t <= 0x7F) o.write_shift(1, t);
- else {
- o.write_shift(1, (t & 0x7F) + 0x80);
- o.write_shift(1, (t >> 7));
- }
- for(var i = 0; i != 4; ++i) {
- if(length >= 0x80) { o.write_shift(1, (length & 0x7F)+0x80); length >>= 7; }
- else { o.write_shift(1, length); break; }
- }
- if(length > 0 && is_buf(payload)) ba.push(payload);
-}
-/* XLS ranges enforced */
-function shift_cell_xls(cell, tgt) {
- if(tgt.s) {
- if(cell.cRel) cell.c += tgt.s.c;
- if(cell.rRel) cell.r += tgt.s.r;
- } else {
- cell.c += tgt.c;
- cell.r += tgt.r;
- }
- cell.cRel = cell.rRel = 0;
- while(cell.c >= 0x100) cell.c -= 0x100;
- while(cell.r >= 0x10000) cell.r -= 0x10000;
- return cell;
-}
-
-function shift_range_xls(cell, range) {
- cell.s = shift_cell_xls(cell.s, range.s);
- cell.e = shift_cell_xls(cell.e, range.s);
- return cell;
-}
-
-var OFFCRYPTO = {};
-var make_offcrypto = function(O, _crypto) {
- var crypto;
- if(typeof _crypto !== 'undefined') crypto = _crypto;
- else if(typeof require !== 'undefined') {
- try { crypto = require('cry'+'pto'); }
- catch(e) { crypto = null; }
- }
-
- O.rc4 = function(key, data) {
- var S = new Array(256);
- var c = 0, i = 0, j = 0, t = 0;
- for(i = 0; i != 256; ++i) S[i] = i;
- for(i = 0; i != 256; ++i) {
- j = (j + S[i] + (key[i%key.length]).charCodeAt(0))&255;
- t = S[i]; S[i] = S[j]; S[j] = t;
- }
- i = j = 0; out = Buffer(data.length);
- for(c = 0; c != data.length; ++c) {
- i = (i + 1)&255;
- j = (j + S[i])%256;
- t = S[i]; S[i] = S[j]; S[j] = t;
- out[c] = (data[c] ^ S[(S[i]+S[j])&255]);
- }
- return out;
- };
-
- if(crypto) {
- O.md5 = function(hex) { return crypto.createHash('md5').update(hex).digest('hex'); };
- } else {
- O.md5 = function(hex) { throw "unimplemented"; };
- }
-};
-make_offcrypto(OFFCRYPTO, typeof crypto !== "undefined" ? crypto : undefined);
-
-
-/* [MS-XLSB] 2.5.143 */
-function parse_StrRun(data, length) {
- return { ich: data.read_shift(2), ifnt: data.read_shift(2) };
-}
-
-/* [MS-XLSB] 2.1.7.121 */
-function parse_RichStr(data, length) {
- var start = data.l;
- var flags = data.read_shift(1);
- var str = parse_XLWideString(data);
- var rgsStrRun = [];
- var z = { t: str, h: str };
- if((flags & 1) !== 0) { /* fRichStr */
- /* TODO: formatted string */
- var dwSizeStrRun = data.read_shift(4);
- for(var i = 0; i != dwSizeStrRun; ++i) rgsStrRun.push(parse_StrRun(data));
- z.r = rgsStrRun;
- }
- else z.r = "" + escapexml(str) + "";
- if((flags & 2) !== 0) { /* fExtStr */
- /* TODO: phonetic string */
- }
- data.l = start + length;
- return z;
-}
-function write_RichStr(str, o) {
- /* TODO: formatted string */
- if(o == null) o = new_buf(5+2*str.t.length);
- o.write_shift(1,0);
- write_XLWideString(str.t, o);
- return o;
-}
-
-/* [MS-XLSB] 2.5.9 */
-function parse_XLSBCell(data) {
- var col = data.read_shift(4);
- var iStyleRef = data.read_shift(2);
- iStyleRef += data.read_shift(1) <<16;
- var fPhShow = data.read_shift(1);
- return { c:col, iStyleRef: iStyleRef };
-}
-function write_XLSBCell(cell, o) {
- if(o == null) o = new_buf(8);
- o.write_shift(-4, cell.c);
- o.write_shift(3, cell.iStyleRef === undefined ? cell.iStyleRef : cell.s);
- o.write_shift(1, 0); /* fPhShow */
- return o;
-}
-
-
-/* [MS-XLSB] 2.5.21 */
-function parse_XLSBCodeName (data, length) { return parse_XLWideString(data, length); }
-
-/* [MS-XLSB] 2.5.166 */
-function parse_XLNullableWideString(data) {
- var cchCharacters = data.read_shift(4);
- return cchCharacters === 0 || cchCharacters === 0xFFFFFFFF ? "" : data.read_shift(cchCharacters, 'dbcs');
-}
-function write_XLNullableWideString(data, o) {
- if(!o) o = new_buf(127);
- o.write_shift(4, data.length > 0 ? data.length : 0xFFFFFFFF);
- if(data.length > 0) o.write_shift(0, data, 'dbcs');
- return o;
-}
-
-/* [MS-XLSB] 2.5.168 */
-function parse_XLWideString(data) {
- var cchCharacters = data.read_shift(4);
- return cchCharacters === 0 ? "" : data.read_shift(cchCharacters, 'dbcs');
-}
-function write_XLWideString(data, o) {
- if(o == null) o = new_buf(4+2*data.length);
- o.write_shift(4, data.length);
- if(data.length > 0) o.write_shift(0, data, 'dbcs');
- return o;
-}
-
-/* [MS-XLSB] 2.5.114 */
-var parse_RelID = parse_XLNullableWideString;
-var write_RelID = write_XLNullableWideString;
-
-
-/* [MS-XLSB] 2.5.122 */
-/* [MS-XLS] 2.5.217 */
-function parse_RkNumber(data) {
- var b = data.slice(data.l, data.l+4);
- var fX100 = b[0] & 1, fInt = b[0] & 2;
- data.l+=4;
- b[0] &= 0xFC; // b[0] &= ~3;
- var RK = fInt === 0 ? __double([0,0,0,0,b[0],b[1],b[2],b[3]],0) : __readInt32LE(b,0)>>2;
- return fX100 ? RK/100 : RK;
-}
-
-/* [MS-XLSB] 2.5.153 */
-function parse_UncheckedRfX(data) {
- var cell = {s: {}, e: {}};
- cell.s.r = data.read_shift(4);
- cell.e.r = data.read_shift(4);
- cell.s.c = data.read_shift(4);
- cell.e.c = data.read_shift(4);
- return cell;
-}
-
-function write_UncheckedRfX(r, o) {
- if(!o) o = new_buf(16);
- o.write_shift(4, r.s.r);
- o.write_shift(4, r.e.r);
- o.write_shift(4, r.s.c);
- o.write_shift(4, r.e.c);
- return o;
-}
-
-/* [MS-XLSB] 2.5.171 */
-/* [MS-XLS] 2.5.342 */
-function parse_Xnum(data, length) { return data.read_shift(8, 'f'); }
-function write_Xnum(data, o) { return (o || new_buf(8)).write_shift(8, 'f', data); }
-
-/* [MS-XLSB] 2.5.198.2 */
-var BErr = {
- 0x00: "#NULL!",
- 0x07: "#DIV/0!",
- 0x0F: "#VALUE!",
- 0x17: "#REF!",
- 0x1D: "#NAME?",
- 0x24: "#NUM!",
- 0x2A: "#N/A",
- 0x2B: "#GETTING_DATA",
- 0xFF: "#WTF?"
-};
-var RBErr = evert_num(BErr);
-
-/* [MS-XLSB] 2.4.321 BrtColor */
-function parse_BrtColor(data, length) {
- var out = {};
- var d = data.read_shift(1);
- out.fValidRGB = d & 1;
- out.xColorType = d >>> 1;
- out.index = data.read_shift(1);
- out.nTintAndShade = data.read_shift(2, 'i');
- out.bRed = data.read_shift(1);
- out.bGreen = data.read_shift(1);
- out.bBlue = data.read_shift(1);
- out.bAlpha = data.read_shift(1);
-}
-
-/* [MS-XLSB] 2.5.52 */
-function parse_FontFlags(data, length) {
- var d = data.read_shift(1);
- data.l++;
- var out = {
- fItalic: d & 0x2,
- fStrikeout: d & 0x8,
- fOutline: d & 0x10,
- fShadow: d & 0x20,
- fCondense: d & 0x40,
- fExtend: d & 0x80
- };
- return out;
-}
-/* [MS-OLEPS] 2.2 PropertyType */
-{
- var VT_EMPTY = 0x0000;
- var VT_NULL = 0x0001;
- var VT_I2 = 0x0002;
- var VT_I4 = 0x0003;
- var VT_R4 = 0x0004;
- var VT_R8 = 0x0005;
- var VT_CY = 0x0006;
- var VT_DATE = 0x0007;
- var VT_BSTR = 0x0008;
- var VT_ERROR = 0x000A;
- var VT_BOOL = 0x000B;
- var VT_VARIANT = 0x000C;
- var VT_DECIMAL = 0x000E;
- var VT_I1 = 0x0010;
- var VT_UI1 = 0x0011;
- var VT_UI2 = 0x0012;
- var VT_UI4 = 0x0013;
- var VT_I8 = 0x0014;
- var VT_UI8 = 0x0015;
- var VT_INT = 0x0016;
- var VT_UINT = 0x0017;
- var VT_LPSTR = 0x001E;
- var VT_LPWSTR = 0x001F;
- var VT_FILETIME = 0x0040;
- var VT_BLOB = 0x0041;
- var VT_STREAM = 0x0042;
- var VT_STORAGE = 0x0043;
- var VT_STREAMED_Object = 0x0044;
- var VT_STORED_Object = 0x0045;
- var VT_BLOB_Object = 0x0046;
- var VT_CF = 0x0047;
- var VT_CLSID = 0x0048;
- var VT_VERSIONED_STREAM = 0x0049;
- var VT_VECTOR = 0x1000;
- var VT_ARRAY = 0x2000;
-
- var VT_STRING = 0x0050; // 2.3.3.1.11 VtString
- var VT_USTR = 0x0051; // 2.3.3.1.12 VtUnalignedString
- var VT_CUSTOM = [VT_STRING, VT_USTR];
-}
-
-/* [MS-OSHARED] 2.3.3.2.2.1 Document Summary Information PIDDSI */
-var DocSummaryPIDDSI = {
- 0x01: { n: 'CodePage', t: VT_I2 },
- 0x02: { n: 'Category', t: VT_STRING },
- 0x03: { n: 'PresentationFormat', t: VT_STRING },
- 0x04: { n: 'ByteCount', t: VT_I4 },
- 0x05: { n: 'LineCount', t: VT_I4 },
- 0x06: { n: 'ParagraphCount', t: VT_I4 },
- 0x07: { n: 'SlideCount', t: VT_I4 },
- 0x08: { n: 'NoteCount', t: VT_I4 },
- 0x09: { n: 'HiddenCount', t: VT_I4 },
- 0x0a: { n: 'MultimediaClipCount', t: VT_I4 },
- 0x0b: { n: 'Scale', t: VT_BOOL },
- 0x0c: { n: 'HeadingPair', t: VT_VECTOR | VT_VARIANT },
- 0x0d: { n: 'DocParts', t: VT_VECTOR | VT_LPSTR },
- 0x0e: { n: 'Manager', t: VT_STRING },
- 0x0f: { n: 'Company', t: VT_STRING },
- 0x10: { n: 'LinksDirty', t: VT_BOOL },
- 0x11: { n: 'CharacterCount', t: VT_I4 },
- 0x13: { n: 'SharedDoc', t: VT_BOOL },
- 0x16: { n: 'HLinksChanged', t: VT_BOOL },
- 0x17: { n: 'AppVersion', t: VT_I4, p: 'version' },
- 0x1A: { n: 'ContentType', t: VT_STRING },
- 0x1B: { n: 'ContentStatus', t: VT_STRING },
- 0x1C: { n: 'Language', t: VT_STRING },
- 0x1D: { n: 'Version', t: VT_STRING },
- 0xFF: {}
-};
-
-/* [MS-OSHARED] 2.3.3.2.1.1 Summary Information Property Set PIDSI */
-var SummaryPIDSI = {
- 0x01: { n: 'CodePage', t: VT_I2 },
- 0x02: { n: 'Title', t: VT_STRING },
- 0x03: { n: 'Subject', t: VT_STRING },
- 0x04: { n: 'Author', t: VT_STRING },
- 0x05: { n: 'Keywords', t: VT_STRING },
- 0x06: { n: 'Comments', t: VT_STRING },
- 0x07: { n: 'Template', t: VT_STRING },
- 0x08: { n: 'LastAuthor', t: VT_STRING },
- 0x09: { n: 'RevNumber', t: VT_STRING },
- 0x0A: { n: 'EditTime', t: VT_FILETIME },
- 0x0B: { n: 'LastPrinted', t: VT_FILETIME },
- 0x0C: { n: 'CreatedDate', t: VT_FILETIME },
- 0x0D: { n: 'ModifiedDate', t: VT_FILETIME },
- 0x0E: { n: 'PageCount', t: VT_I4 },
- 0x0F: { n: 'WordCount', t: VT_I4 },
- 0x10: { n: 'CharCount', t: VT_I4 },
- 0x11: { n: 'Thumbnail', t: VT_CF },
- 0x12: { n: 'ApplicationName', t: VT_LPSTR },
- 0x13: { n: 'DocumentSecurity', t: VT_I4 },
- 0xFF: {}
-};
-
-/* [MS-OLEPS] 2.18 */
-var SpecialProperties = {
- 0x80000000: { n: 'Locale', t: VT_UI4 },
- 0x80000003: { n: 'Behavior', t: VT_UI4 },
- 0x72627262: {}
-};
-
-(function() {
- for(var y in SpecialProperties) if(SpecialProperties.hasOwnProperty(y))
- DocSummaryPIDDSI[y] = SummaryPIDSI[y] = SpecialProperties[y];
-})();
-
-/* [MS-XLS] 2.4.63 Country/Region codes */
-var CountryEnum = {
- 0x0001: "US", // United States
- 0x0002: "CA", // Canada
- 0x0003: "", // Latin America (except Brazil)
- 0x0007: "RU", // Russia
- 0x0014: "EG", // Egypt
- 0x001E: "GR", // Greece
- 0x001F: "NL", // Netherlands
- 0x0020: "BE", // Belgium
- 0x0021: "FR", // France
- 0x0022: "ES", // Spain
- 0x0024: "HU", // Hungary
- 0x0027: "IT", // Italy
- 0x0029: "CH", // Switzerland
- 0x002B: "AT", // Austria
- 0x002C: "GB", // United Kingdom
- 0x002D: "DK", // Denmark
- 0x002E: "SE", // Sweden
- 0x002F: "NO", // Norway
- 0x0030: "PL", // Poland
- 0x0031: "DE", // Germany
- 0x0034: "MX", // Mexico
- 0x0037: "BR", // Brazil
- 0x003d: "AU", // Australia
- 0x0040: "NZ", // New Zealand
- 0x0042: "TH", // Thailand
- 0x0051: "JP", // Japan
- 0x0052: "KR", // Korea
- 0x0054: "VN", // Viet Nam
- 0x0056: "CN", // China
- 0x005A: "TR", // Turkey
- 0x0069: "JS", // Ramastan
- 0x00D5: "DZ", // Algeria
- 0x00D8: "MA", // Morocco
- 0x00DA: "LY", // Libya
- 0x015F: "PT", // Portugal
- 0x0162: "IS", // Iceland
- 0x0166: "FI", // Finland
- 0x01A4: "CZ", // Czech Republic
- 0x0376: "TW", // Taiwan
- 0x03C1: "LB", // Lebanon
- 0x03C2: "JO", // Jordan
- 0x03C3: "SY", // Syria
- 0x03C4: "IQ", // Iraq
- 0x03C5: "KW", // Kuwait
- 0x03C6: "SA", // Saudi Arabia
- 0x03CB: "AE", // United Arab Emirates
- 0x03CC: "IL", // Israel
- 0x03CE: "QA", // Qatar
- 0x03D5: "IR", // Iran
- 0xFFFF: "US" // United States
-};
-
-/* [MS-XLS] 2.5.127 */
-var XLSFillPattern = [
- null,
- 'solid',
- 'mediumGray',
- 'darkGray',
- 'lightGray',
- 'darkHorizontal',
- 'darkVertical',
- 'darkDown',
- 'darkUp',
- 'darkGrid',
- 'darkTrellis',
- 'lightHorizontal',
- 'lightVertical',
- 'lightDown',
- 'lightUp',
- 'lightGrid',
- 'lightTrellis',
- 'gray125',
- 'gray0625'
-];
-
-function rgbify(arr) { return arr.map(function(x) { return [(x>>16)&255,(x>>8)&255,x&255]; }); }
-
-/* [MS-XLS] 2.5.161 */
-var XLSIcv = rgbify([
- /* Color Constants */
- 0x000000,
- 0xFFFFFF,
- 0xFF0000,
- 0x00FF00,
- 0x0000FF,
- 0xFFFF00,
- 0xFF00FF,
- 0x00FFFF,
-
- /* Defaults */
- 0x000000,
- 0xFFFFFF,
- 0xFF0000,
- 0x00FF00,
- 0x0000FF,
- 0xFFFF00,
- 0xFF00FF,
- 0x00FFFF,
-
- 0x800000,
- 0x008000,
- 0x000080,
- 0x808000,
- 0x800080,
- 0x008080,
- 0xC0C0C0,
- 0x808080,
- 0x9999FF,
- 0x993366,
- 0xFFFFCC,
- 0xCCFFFF,
- 0x660066,
- 0xFF8080,
- 0x0066CC,
- 0xCCCCFF,
-
- 0x000080,
- 0xFF00FF,
- 0xFFFF00,
- 0x00FFFF,
- 0x800080,
- 0x800000,
- 0x008080,
- 0x0000FF,
- 0x00CCFF,
- 0xCCFFFF,
- 0xCCFFCC,
- 0xFFFF99,
- 0x99CCFF,
- 0xFF99CC,
- 0xCC99FF,
- 0xFFCC99,
-
- 0x3366FF,
- 0x33CCCC,
- 0x99CC00,
- 0xFFCC00,
- 0xFF9900,
- 0xFF6600,
- 0x666699,
- 0x969696,
- 0x003366,
- 0x339966,
- 0x003300,
- 0x333300,
- 0x993300,
- 0x993366,
- 0x333399,
- 0x333333,
-
- /* Sheet */
- 0xFFFFFF,
- 0x000000
-]);
-
-/* Parts enumerated in OPC spec, MS-XLSB and MS-XLSX */
-/* 12.3 Part Summary */
-/* 14.2 Part Summary */
-/* [MS-XLSX] 2.1 Part Enumerations */
-/* [MS-XLSB] 2.1.7 Part Enumeration */
-var ct2type = {
- /* Workbook */
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": "workbooks",
-
- /* Worksheet */
- "application/vnd.ms-excel.binIndexWs": "TODO", /* Binary Index */
-
- /* Chartsheet */
- "application/vnd.ms-excel.chartsheet": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": "TODO",
-
- /* Dialogsheet */
- "application/vnd.ms-excel.dialogsheet": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": "TODO",
-
- /* Macrosheet */
- "application/vnd.ms-excel.macrosheet": "TODO",
- "application/vnd.ms-excel.macrosheet+xml": "TODO",
- "application/vnd.ms-excel.intlmacrosheet": "TODO",
- "application/vnd.ms-excel.binIndexMs": "TODO", /* Binary Index */
-
- /* File Properties */
- "application/vnd.openxmlformats-package.core-properties+xml": "coreprops",
- "application/vnd.openxmlformats-officedocument.custom-properties+xml": "custprops",
- "application/vnd.openxmlformats-officedocument.extended-properties+xml": "extprops",
-
- /* Custom Data Properties */
- "application/vnd.openxmlformats-officedocument.customXmlProperties+xml": "TODO",
-
- /* Comments */
- "application/vnd.ms-excel.comments": "comments",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": "comments",
-
- /* PivotTable */
- "application/vnd.ms-excel.pivotTable": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml": "TODO",
-
- /* Calculation Chain */
- "application/vnd.ms-excel.calcChain": "calcchains",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml": "calcchains",
-
- /* Printer Settings */
- "application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings": "TODO",
-
- /* ActiveX */
- "application/vnd.ms-office.activeX": "TODO",
- "application/vnd.ms-office.activeX+xml": "TODO",
-
- /* Custom Toolbars */
- "application/vnd.ms-excel.attachedToolbars": "TODO",
-
- /* External Data Connections */
- "application/vnd.ms-excel.connections": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": "TODO",
-
- /* External Links */
- "application/vnd.ms-excel.externalLink": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml": "TODO",
-
- /* Metadata */
- "application/vnd.ms-excel.sheetMetadata": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml": "TODO",
-
- /* PivotCache */
- "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",
-
- /* Query Table */
- "application/vnd.ms-excel.queryTable": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml": "TODO",
-
- /* Shared Workbook */
- "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",
-
- /* Single Cell Table */
- "application/vnd.ms-excel.tableSingleCells": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml": "TODO",
-
- /* Slicer */
- "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",
-
- /* Sort Map */
- "application/vnd.ms-excel.wsSortMap": "TODO",
-
- /* Table */
- "application/vnd.ms-excel.table": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": "TODO",
-
- /* Themes */
- "application/vnd.openxmlformats-officedocument.theme+xml": "themes",
-
- /* Timeline */
- "application/vnd.ms-excel.Timeline+xml": "TODO", /* verify */
- "application/vnd.ms-excel.TimelineCache+xml": "TODO", /* verify */
-
- /* VBA */
- "application/vnd.ms-office.vbaProject": "vba",
- "application/vnd.ms-office.vbaProjectSignature": "vba",
-
- /* Volatile Dependencies */
- "application/vnd.ms-office.volatileDependencies": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml": "TODO",
-
- /* Control Properties */
- "application/vnd.ms-excel.controlproperties+xml": "TODO",
-
- /* Data Model */
- "application/vnd.openxmlformats-officedocument.model+data": "TODO",
-
- /* Survey */
- "application/vnd.ms-excel.Survey+xml": "TODO",
-
- /* Drawing */
- "application/vnd.openxmlformats-officedocument.drawing+xml": "TODO",
- "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": "TODO",
- "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",
-
- /* VML */
- "application/vnd.openxmlformats-officedocument.vmlDrawing": "TODO",
-
- "application/vnd.openxmlformats-package.relationships+xml": "rels",
- "application/vnd.openxmlformats-officedocument.oleObject": "TODO",
-
- "sheet": "js"
-};
-
-var CT_LIST = (function(){
- var o = {
- 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",
- xltx: "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"
- },
- strs: { /* Shared Strings */
- xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",
- xlsb: "application/vnd.ms-excel.sharedStrings"
- },
- sheets: {
- xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",
- xlsb: "application/vnd.ms-excel.worksheet"
- },
- styles: {/* Styles */
- xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
- xlsb: "application/vnd.ms-excel.styles"
- }
- };
- keys(o).forEach(function(k) { if(!o[k].xlsm) o[k].xlsm = o[k].xlsx; });
- keys(o).forEach(function(k){ keys(o[k]).forEach(function(v) { ct2type[o[k][v]] = k; }); });
- return o;
-})();
-
-var type2ct = evert_arr(ct2type);
-
-XMLNS.CT = 'http://schemas.openxmlformats.org/package/2006/content-types';
-
-function parse_ct(data, opts) {
- var ctext = {};
- if(!data || !data.match) return data;
- var ct = { workbooks: [], sheets: [], calcchains: [], themes: [], styles: [],
- coreprops: [], extprops: [], custprops: [], strs:[], comments: [], vba: [],
- TODO:[], rels:[], xmlns: "" };
- (data.match(tagregex)||[]).forEach(function(x) {
- var y = parsexmltag(x);
- switch(y[0].replace(nsregex,"<")) {
- case ' 0 ? ct.calcchains[0] : "";
- ct.sst = ct.strs.length > 0 ? ct.strs[0] : "";
- ct.style = ct.styles.length > 0 ? ct.styles[0] : "";
- ct.defaults = ctext;
- delete ct.calcchains;
- return ct;
-}
-
-var CTYPE_XML_ROOT = writextag('Types', null, {
- 'xmlns': XMLNS.CT,
- 'xmlns:xsd': XMLNS.xsd,
- 'xmlns:xsi': XMLNS.xsi
-});
-
-var CTYPE_DEFAULTS = [
- ['xml', 'application/xml'],
- ['bin', 'application/vnd.ms-excel.sheet.binary.macroEnabled.main'],
- ['rels', type2ct.rels[0]]
-].map(function(x) {
- return writextag('Default', null, {'Extension':x[0], 'ContentType': x[1]});
-});
-
-function write_ct(ct, opts) {
- var o = [], v;
- o[o.length] = (XML_HEADER);
- o[o.length] = (CTYPE_XML_ROOT);
- o = o.concat(CTYPE_DEFAULTS);
- var f1 = function(w) {
- if(ct[w] && ct[w].length > 0) {
- v = ct[w][0];
- o[o.length] = (writextag('Override', null, {
- 'PartName': (v[0] == '/' ? "":"/") + v,
- 'ContentType': CT_LIST[w][opts.bookType || 'xlsx']
- }));
- }
- };
- var f2 = function(w) {
- ct[w].forEach(function(v) {
- o[o.length] = (writextag('Override', null, {
- 'PartName': (v[0] == '/' ? "":"/") + v,
- 'ContentType': CT_LIST[w][opts.bookType || 'xlsx']
- }));
- });
- };
- var f3 = function(t) {
- (ct[t]||[]).forEach(function(v) {
- o[o.length] = (writextag('Override', null, {
- 'PartName': (v[0] == '/' ? "":"/") + v,
- 'ContentType': type2ct[t][0]
- }));
- });
- };
- f1('workbooks');
- f2('sheets');
- f3('themes');
- ['strs', 'styles'].forEach(f1);
- ['coreprops', 'extprops', 'custprops'].forEach(f3);
- if(o.length>2){ o[o.length] = (''); o[1]=o[1].replace("/>",">"); }
- return o.join("");
-}
-/* 9.3.2 OPC Relationships Markup */
-var RELS = {
- WB: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
- SHEET: "http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument"
-};
-
-function parse_rels(data, currentFilePath) {
- if (!data) return data;
- if (currentFilePath.charAt(0) !== '/') {
- currentFilePath = '/'+currentFilePath;
- }
- var rels = {};
- var hash = {};
- var resolveRelativePathIntoAbsolute = function (to) {
- var toksFrom = currentFilePath.split('/');
- toksFrom.pop(); // folder path
- var toksTo = to.split('/');
- var reversed = [];
- while (toksTo.length !== 0) {
- var tokTo = toksTo.shift();
- if (tokTo === '..') {
- toksFrom.pop();
- } else if (tokTo !== '.') {
- toksFrom.push(tokTo);
- }
- }
- return toksFrom.join('/');
- };
-
- data.match(tagregex).forEach(function(x) {
- var y = parsexmltag(x);
- /* 9.3.2.2 OPC_Relationships */
- if (y[0] === '2){ o[o.length] = (''); o[1]=o[1].replace("/>",">"); }
- return o.join("");
-}
-/* ECMA-376 Part II 11.1 Core Properties Part */
-/* [MS-OSHARED] 2.3.3.2.[1-2].1 (PIDSI/PIDDSI) */
-var CORE_PROPS = [
- ["cp:category", "Category"],
- ["cp:contentStatus", "ContentStatus"],
- ["cp:keywords", "Keywords"],
- ["cp:lastModifiedBy", "LastAuthor"],
- ["cp:lastPrinted", "LastPrinted"],
- ["cp:revision", "RevNumber"],
- ["cp:version", "Version"],
- ["dc:creator", "Author"],
- ["dc:description", "Comments"],
- ["dc:identifier", "Identifier"],
- ["dc:language", "Language"],
- ["dc:subject", "Subject"],
- ["dc:title", "Title"],
- ["dcterms:created", "CreatedDate", 'date'],
- ["dcterms:modified", "ModifiedDate", 'date']
-];
-
-XMLNS.CORE_PROPS = "http://schemas.openxmlformats.org/package/2006/metadata/core-properties";
-RELS.CORE_PROPS = 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties';
-
-var CORE_PROPS_REGEX = (function() {
- var r = new Array(CORE_PROPS.length);
- for(var i = 0; i < CORE_PROPS.length; ++i) {
- var f = CORE_PROPS[i];
- var g = "(?:"+ f[0].substr(0,f[0].indexOf(":")) +":)"+ f[0].substr(f[0].indexOf(":")+1);
- r[i] = new RegExp("<" + g + "[^>]*>(.*)<\/" + g + ">");
- }
- return r;
-})();
-
-function parse_core_props(data) {
- var p = {};
-
- for(var i = 0; i < CORE_PROPS.length; ++i) {
- var f = CORE_PROPS[i], cur = data.match(CORE_PROPS_REGEX[i]);
- if(cur != null && cur.length > 0) p[f[1]] = cur[1];
- if(f[2] === 'date' && p[f[1]]) p[f[1]] = new Date(p[f[1]]);
- }
-
- return p;
-}
-
-var CORE_PROPS_XML_ROOT = writextag('cp:coreProperties', null, {
- //'xmlns': XMLNS.CORE_PROPS,
- 'xmlns:cp': XMLNS.CORE_PROPS,
- 'xmlns:dc': XMLNS.dc,
- 'xmlns:dcterms': XMLNS.dcterms,
- 'xmlns:dcmitype': XMLNS.dcmitype,
- 'xmlns:xsi': XMLNS.xsi
-});
-
-function cp_doit(f, g, h, o, p) {
- if(p[f] != null || g == null || g === "") return;
- p[f] = g;
- o[o.length] = (h ? writextag(f,g,h) : writetag(f,g));
-}
-
-function write_core_props(cp, opts) {
- var o = [XML_HEADER, CORE_PROPS_XML_ROOT], p = {};
- if(!cp) return o.join("");
-
-
- if(cp.CreatedDate != null) cp_doit("dcterms:created", typeof cp.CreatedDate === "string" ? cp.CreatedDate : write_w3cdtf(cp.CreatedDate, opts.WTF), {"xsi:type":"dcterms:W3CDTF"}, o, p);
- if(cp.ModifiedDate != null) cp_doit("dcterms:modified", typeof cp.ModifiedDate === "string" ? cp.ModifiedDate : write_w3cdtf(cp.ModifiedDate, opts.WTF), {"xsi:type":"dcterms:W3CDTF"}, o, p);
-
- for(var i = 0; i != CORE_PROPS.length; ++i) { var f = CORE_PROPS[i]; cp_doit(f[0], cp[f[1]], null, o, p); }
- if(o.length>2){ o[o.length] = (''); o[1]=o[1].replace("/>",">"); }
- return o.join("");
-}
-/* 15.2.12.3 Extended File Properties Part */
-/* [MS-OSHARED] 2.3.3.2.[1-2].1 (PIDSI/PIDDSI) */
-var EXT_PROPS = [
- ["Application", "Application", "string"],
- ["AppVersion", "AppVersion", "string"],
- ["Company", "Company", "string"],
- ["DocSecurity", "DocSecurity", "string"],
- ["Manager", "Manager", "string"],
- ["HyperlinksChanged", "HyperlinksChanged", "bool"],
- ["SharedDoc", "SharedDoc", "bool"],
- ["LinksUpToDate", "LinksUpToDate", "bool"],
- ["ScaleCrop", "ScaleCrop", "bool"],
- ["HeadingPairs", "HeadingPairs", "raw"],
- ["TitlesOfParts", "TitlesOfParts", "raw"]
-];
-
-XMLNS.EXT_PROPS = "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties";
-RELS.EXT_PROPS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties';
-
-function parse_ext_props(data, p) {
- var q = {}; if(!p) p = {};
-
- EXT_PROPS.forEach(function(f) {
- switch(f[2]) {
- case "string": p[f[1]] = (data.match(matchtag(f[0]))||[])[1]; break;
- case "bool": p[f[1]] = (data.match(matchtag(f[0]))||[])[1] === "true"; break;
- case "raw":
- var cur = data.match(new RegExp("<" + f[0] + "[^>]*>(.*)<\/" + f[0] + ">"));
- if(cur && cur.length > 0) q[f[1]] = cur[1];
- break;
- }
- });
-
- if(q.HeadingPairs && q.TitlesOfParts) {
- var v = parseVector(q.HeadingPairs);
- var j = 0, widx = 0;
- for(var i = 0; i !== v.length; ++i) {
- switch(v[i].v) {
- case "Worksheets": widx = j; p.Worksheets = +(v[++i].v); break;
- case "Named Ranges": ++i; break; // TODO: Handle Named Ranges
- }
- }
- var parts = parseVector(q.TitlesOfParts).map(function(x) { return utf8read(x.v); });
- p.SheetNames = parts.slice(widx, widx + p.Worksheets);
- }
- return p;
-}
-
-var EXT_PROPS_XML_ROOT = writextag('Properties', null, {
- 'xmlns': XMLNS.EXT_PROPS,
- 'xmlns:vt': XMLNS.vt
-});
-
-function write_ext_props(cp, opts) {
- var o = [], p = {}, W = writextag;
- if(!cp) cp = {};
- cp.Application = "SheetJS";
- o[o.length] = (XML_HEADER);
- o[o.length] = (EXT_PROPS_XML_ROOT);
-
- EXT_PROPS.forEach(function(f) {
- if(cp[f[1]] === undefined) return;
- var v;
- switch(f[2]) {
- case 'string': v = cp[f[1]]; break;
- case 'bool': v = cp[f[1]] ? 'true' : 'false'; break;
- }
- if(v !== undefined) o[o.length] = (W(f[0], v));
- });
-
- /* TODO: HeadingPairs, TitlesOfParts */
- o[o.length] = (W('HeadingPairs', W('vt:vector', W('vt:variant', 'Worksheets')+W('vt:variant', W('vt:i4', String(cp.Worksheets))), {size:2, baseType:"variant"})));
- o[o.length] = (W('TitlesOfParts', W('vt:vector', cp.SheetNames.map(function(s) { return "" + s + ""; }).join(""), {size: cp.Worksheets, baseType:"lpstr"})));
- if(o.length>2){ o[o.length] = (''); o[1]=o[1].replace("/>",">"); }
- return o.join("");
-}
-/* 15.2.12.2 Custom File Properties Part */
-XMLNS.CUST_PROPS = "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties";
-RELS.CUST_PROPS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties';
-
-var custregex = /<[^>]+>[^<]*/g;
-function parse_cust_props(data, opts) {
- var p = {}, name;
- var m = data.match(custregex);
- if(m) for(var i = 0; i != m.length; ++i) {
- var x = m[i], y = parsexmltag(x);
- switch(y[0]) {
- case '': name = null; break;
- default: if (x.indexOf('');
- var type = toks[0].substring(4), text = toks[1];
- /* 22.4.2.32 (CT_Variant). Omit the binary types from 22.4 (Variant Types) */
- switch(type) {
- case 'lpstr': case 'lpwstr': case 'bstr': case 'lpwstr':
- p[name] = unescapexml(text);
- break;
- case 'bool':
- p[name] = parsexmlbool(text, '');
- break;
- case 'i1': case 'i2': case 'i4': case 'i8': case 'int': case 'uint':
- p[name] = parseInt(text, 10);
- break;
- case 'r4': case 'r8': case 'decimal':
- p[name] = parseFloat(text);
- break;
- case 'filetime': case 'date':
- p[name] = new Date(text);
- break;
- case 'cy': case 'error':
- p[name] = unescapexml(text);
- break;
- default:
- if(typeof console !== 'undefined') console.warn('Unexpected', x, type, toks);
- }
- } else if(x.substr(0,2) === "") {
- } else if(opts.WTF) throw new Error(x);
- }
- }
- return p;
-}
-
-var CUST_PROPS_XML_ROOT = writextag('Properties', null, {
- 'xmlns': XMLNS.CUST_PROPS,
- 'xmlns:vt': XMLNS.vt
-});
-
-function write_cust_props(cp, opts) {
- var o = [XML_HEADER, CUST_PROPS_XML_ROOT];
- if(!cp) return o.join("");
- var pid = 1;
- keys(cp).forEach(function custprop(k) { ++pid;
- o[o.length] = (writextag('property', write_vt(cp[k]), {
- 'fmtid': '{D5CDD505-2E9C-101B-9397-08002B2CF9AE}',
- 'pid': pid,
- 'name': k
- }));
- });
- if(o.length>2){ o[o.length] = ''; o[1]=o[1].replace("/>",">"); }
- return o.join("");
-}
-function xlml_set_prop(Props, tag, val) {
- /* TODO: Normalize the properties */
- switch(tag) {
- case 'Description': tag = 'Comments'; break;
- }
- Props[tag] = val;
-}
-
-/* [MS-DTYP] 2.3.3 FILETIME */
-/* [MS-OLEDS] 2.1.3 FILETIME (Packet Version) */
-/* [MS-OLEPS] 2.8 FILETIME (Packet Version) */
-function parse_FILETIME(blob) {
- var dwLowDateTime = blob.read_shift(4), dwHighDateTime = blob.read_shift(4);
- return new Date(((dwHighDateTime/1e7*Math.pow(2,32) + dwLowDateTime/1e7) - 11644473600)*1000).toISOString().replace(/\.000/,"");
-}
-
-/* [MS-OSHARED] 2.3.3.1.4 Lpstr */
-function parse_lpstr(blob, type, pad) {
- var str = blob.read_shift(0, 'lpstr');
- if(pad) blob.l += (4 - ((str.length+1) & 3)) & 3;
- return str;
-}
-
-/* [MS-OSHARED] 2.3.3.1.6 Lpwstr */
-function parse_lpwstr(blob, type, pad) {
- var str = blob.read_shift(0, 'lpwstr');
- if(pad) blob.l += (4 - ((str.length+1) & 3)) & 3;
- return str;
-}
-
-
-/* [MS-OSHARED] 2.3.3.1.11 VtString */
-/* [MS-OSHARED] 2.3.3.1.12 VtUnalignedString */
-function parse_VtStringBase(blob, stringType, pad) {
- if(stringType === 0x1F /*VT_LPWSTR*/) return parse_lpwstr(blob);
- return parse_lpstr(blob, stringType, pad);
-}
-
-function parse_VtString(blob, t, pad) { return parse_VtStringBase(blob, t, pad === false ? 0: 4); }
-function parse_VtUnalignedString(blob, t) { if(!t) throw new Error("dafuq?"); return parse_VtStringBase(blob, t, 0); }
-
-/* [MS-OSHARED] 2.3.3.1.9 VtVecUnalignedLpstrValue */
-function parse_VtVecUnalignedLpstrValue(blob) {
- var length = blob.read_shift(4);
- var ret = [];
- for(var i = 0; i != length; ++i) ret[i] = blob.read_shift(0, 'lpstr');
- return ret;
-}
-
-/* [MS-OSHARED] 2.3.3.1.10 VtVecUnalignedLpstr */
-function parse_VtVecUnalignedLpstr(blob) {
- return parse_VtVecUnalignedLpstrValue(blob);
-}
-
-/* [MS-OSHARED] 2.3.3.1.13 VtHeadingPair */
-function parse_VtHeadingPair(blob) {
- var headingString = parse_TypedPropertyValue(blob, VT_USTR);
- var headerParts = parse_TypedPropertyValue(blob, VT_I4);
- return [headingString, headerParts];
-}
-
-/* [MS-OSHARED] 2.3.3.1.14 VtVecHeadingPairValue */
-function parse_VtVecHeadingPairValue(blob) {
- var cElements = blob.read_shift(4);
- var out = [];
- for(var i = 0; i != cElements / 2; ++i) out.push(parse_VtHeadingPair(blob));
- return out;
-}
-
-/* [MS-OSHARED] 2.3.3.1.15 VtVecHeadingPair */
-function parse_VtVecHeadingPair(blob) {
- // NOTE: When invoked, wType & padding were already consumed
- return parse_VtVecHeadingPairValue(blob);
-}
-
-/* [MS-OLEPS] 2.18.1 Dictionary (uses 2.17, 2.16) */
-function parse_dictionary(blob,CodePage) {
- var cnt = blob.read_shift(4);
- var dict = {};
- for(var j = 0; j != cnt; ++j) {
- var pid = blob.read_shift(4);
- var len = blob.read_shift(4);
- dict[pid] = blob.read_shift(len, (CodePage === 0x4B0 ?'utf16le':'utf8')).replace(chr0,'').replace(chr1,'!');
- }
- if(blob.l & 3) blob.l = (blob.l>>2+1)<<2;
- return dict;
-}
-
-/* [MS-OLEPS] 2.9 BLOB */
-function parse_BLOB(blob) {
- var size = blob.read_shift(4);
- var bytes = blob.slice(blob.l,blob.l+size);
- if(size & 3 > 0) blob.l += (4 - (size & 3)) & 3;
- return bytes;
-}
-
-/* [MS-OLEPS] 2.11 ClipboardData */
-function parse_ClipboardData(blob) {
- // TODO
- var o = {};
- o.Size = blob.read_shift(4);
- //o.Format = blob.read_shift(4);
- blob.l += o.Size;
- return o;
-}
-
-/* [MS-OLEPS] 2.14 Vector and Array Property Types */
-function parse_VtVector(blob, cb) {
- /* [MS-OLEPS] 2.14.2 VectorHeader */
-/* var Length = blob.read_shift(4);
- var o = [];
- for(var i = 0; i != Length; ++i) {
- o.push(cb(blob));
- }
- return o;*/
-}
-
-/* [MS-OLEPS] 2.15 TypedPropertyValue */
-function parse_TypedPropertyValue(blob, type, _opts) {
- var t = blob.read_shift(2), ret, opts = _opts||{};
- blob.l += 2;
- if(type !== VT_VARIANT)
- if(t !== type && VT_CUSTOM.indexOf(type)===-1) throw new Error('Expected type ' + type + ' saw ' + t);
- switch(type === VT_VARIANT ? t : type) {
- case 0x02 /*VT_I2*/: ret = blob.read_shift(2, 'i'); if(!opts.raw) blob.l += 2; return ret;
- case 0x03 /*VT_I4*/: ret = blob.read_shift(4, 'i'); return ret;
- case 0x0B /*VT_BOOL*/: return blob.read_shift(4) !== 0x0;
- case 0x13 /*VT_UI4*/: ret = blob.read_shift(4); return ret;
- case 0x1E /*VT_LPSTR*/: return parse_lpstr(blob, t, 4).replace(chr0,'');
- case 0x1F /*VT_LPWSTR*/: return parse_lpwstr(blob);
- case 0x40 /*VT_FILETIME*/: return parse_FILETIME(blob);
- case 0x41 /*VT_BLOB*/: return parse_BLOB(blob);
- case 0x47 /*VT_CF*/: return parse_ClipboardData(blob);
- case 0x50 /*VT_STRING*/: return parse_VtString(blob, t, !opts.raw && 4).replace(chr0,'');
- case 0x51 /*VT_USTR*/: return parse_VtUnalignedString(blob, t, 4).replace(chr0,'');
- case 0x100C /*VT_VECTOR|VT_VARIANT*/: return parse_VtVecHeadingPair(blob);
- case 0x101E /*VT_LPSTR*/: return parse_VtVecUnalignedLpstr(blob);
- default: throw new Error("TypedPropertyValue unrecognized type " + type + " " + t);
- }
-}
-/* [MS-OLEPS] 2.14.2 VectorHeader */
-/*function parse_VTVectorVariant(blob) {
- var Length = blob.read_shift(4);
-
- if(Length & 1 !== 0) throw new Error("VectorHeader Length=" + Length + " must be even");
- var o = [];
- for(var i = 0; i != Length; ++i) {
- o.push(parse_TypedPropertyValue(blob, VT_VARIANT));
- }
- return o;
-}*/
-
-/* [MS-OLEPS] 2.20 PropertySet */
-function parse_PropertySet(blob, PIDSI) {
- var start_addr = blob.l;
- var size = blob.read_shift(4);
- var NumProps = blob.read_shift(4);
- var Props = [], i = 0;
- var CodePage = 0;
- var Dictionary = -1, DictObj;
- for(i = 0; i != NumProps; ++i) {
- var PropID = blob.read_shift(4);
- var Offset = blob.read_shift(4);
- Props[i] = [PropID, Offset + start_addr];
- }
- var PropH = {};
- for(i = 0; i != NumProps; ++i) {
- if(blob.l !== Props[i][1]) {
- var fail = true;
- if(i>0 && PIDSI) switch(PIDSI[Props[i-1][0]].t) {
- case 0x02 /*VT_I2*/: if(blob.l +2 === Props[i][1]) { blob.l+=2; fail = false; } break;
- case 0x50 /*VT_STRING*/: if(blob.l <= Props[i][1]) { blob.l=Props[i][1]; fail = false; } break;
- case 0x100C /*VT_VECTOR|VT_VARIANT*/: if(blob.l <= Props[i][1]) { blob.l=Props[i][1]; fail = false; } break;
- }
- if(!PIDSI && blob.l <= Props[i][1]) { fail=false; blob.l = Props[i][1]; }
- if(fail) throw new Error("Read Error: Expected address " + Props[i][1] + ' at ' + blob.l + ' :' + i);
- }
- if(PIDSI) {
- var piddsi = PIDSI[Props[i][0]];
- PropH[piddsi.n] = parse_TypedPropertyValue(blob, piddsi.t, {raw:true});
- if(piddsi.p === 'version') PropH[piddsi.n] = String(PropH[piddsi.n] >> 16) + "." + String(PropH[piddsi.n] & 0xFFFF);
- if(piddsi.n == "CodePage") switch(PropH[piddsi.n]) {
- case 0: PropH[piddsi.n] = 1252;
- /* falls through */
- case 10000: // OSX Roman
- case 1252: // Windows Latin
-
- case 874: // SB Windows Thai
- case 1250: // SB Windows Central Europe
- case 1251: // SB Windows Cyrillic
- case 1253: // SB Windows Greek
- case 1254: // SB Windows Turkish
- case 1255: // SB Windows Hebrew
- case 1256: // SB Windows Arabic
- case 1257: // SB Windows Baltic
- case 1258: // SB Windows Vietnam
-
- case 932: // DB Windows Japanese Shift-JIS
- case 936: // DB Windows Simplified Chinese GBK
- case 949: // DB Windows Korean
- case 950: // DB Windows Traditional Chinese Big5
-
- case 1200: // UTF16LE
- case 1201: // UTF16BE
- case 65000: case -536: // UTF-7
- case 65001: case -535: // UTF-8
- set_cp(CodePage = PropH[piddsi.n]); break;
- default: throw new Error("Unsupported CodePage: " + PropH[piddsi.n]);
- }
- } else {
- if(Props[i][0] === 0x1) {
- CodePage = PropH.CodePage = parse_TypedPropertyValue(blob, VT_I2);
- set_cp(CodePage);
- if(Dictionary !== -1) {
- var oldpos = blob.l;
- blob.l = Props[Dictionary][1];
- DictObj = parse_dictionary(blob,CodePage);
- blob.l = oldpos;
- }
- } else if(Props[i][0] === 0) {
- if(CodePage === 0) { Dictionary = i; blob.l = Props[i+1][1]; continue; }
- DictObj = parse_dictionary(blob,CodePage);
- } else {
- var name = DictObj[Props[i][0]];
- var val;
- /* [MS-OSHARED] 2.3.3.2.3.1.2 + PROPVARIANT */
- switch(blob[blob.l]) {
- case 0x41 /*VT_BLOB*/: blob.l += 4; val = parse_BLOB(blob); break;
- case 0x1E /*VT_LPSTR*/: blob.l += 4; val = parse_VtString(blob, blob[blob.l-4]); break;
- case 0x1F /*VT_LPWSTR*/: blob.l += 4; val = parse_VtString(blob, blob[blob.l-4]); break;
- case 0x03 /*VT_I4*/: blob.l += 4; val = blob.read_shift(4, 'i'); break;
- case 0x13 /*VT_UI4*/: blob.l += 4; val = blob.read_shift(4); break;
- case 0x05 /*VT_R8*/: blob.l += 4; val = blob.read_shift(8, 'f'); break;
- case 0x0B /*VT_BOOL*/: blob.l += 4; val = parsebool(blob, 4); break;
- case 0x40 /*VT_FILETIME*/: blob.l += 4; val = new Date(parse_FILETIME(blob)); break;
- default: throw new Error("unparsed value: " + blob[blob.l]);
- }
- PropH[name] = val;
- }
- }
- }
- blob.l = start_addr + size; /* step ahead to skip padding */
- return PropH;
-}
-
-/* [MS-OLEPS] 2.21 PropertySetStream */
-function parse_PropertySetStream(file, PIDSI) {
- var blob = file.content;
- prep_blob(blob, 0);
-
- var NumSets, FMTID0, FMTID1, Offset0, Offset1;
- blob.chk('feff', 'Byte Order: ');
-
- var vers = blob.read_shift(2); // TODO: check version
- var SystemIdentifier = blob.read_shift(4);
- blob.chk(CFB.utils.consts.HEADER_CLSID, 'CLSID: ');
- NumSets = blob.read_shift(4);
- if(NumSets !== 1 && NumSets !== 2) throw "Unrecognized #Sets: " + NumSets;
- FMTID0 = blob.read_shift(16); Offset0 = blob.read_shift(4);
-
- if(NumSets === 1 && Offset0 !== blob.l) throw "Length mismatch";
- else if(NumSets === 2) { FMTID1 = blob.read_shift(16); Offset1 = blob.read_shift(4); }
- var PSet0 = parse_PropertySet(blob, PIDSI);
-
- var rval = { SystemIdentifier: SystemIdentifier };
- for(var y in PSet0) rval[y] = PSet0[y];
- //rval.blob = blob;
- rval.FMTID = FMTID0;
- //rval.PSet0 = PSet0;
- if(NumSets === 1) return rval;
- if(blob.l !== Offset1) throw "Length mismatch 2: " + blob.l + " !== " + Offset1;
- var PSet1;
- try { PSet1 = parse_PropertySet(blob, null); } catch(e) { }
- for(y in PSet1) rval[y] = PSet1[y];
- rval.FMTID = [FMTID0, FMTID1]; // TODO: verify FMTID0/1
- return rval;
-}
-
-
-function parsenoop2(blob, length) { blob.read_shift(length); return null; }
-
-function parslurp(blob, length, cb) {
- var arr = [], target = blob.l + length;
- while(blob.l < target) arr.push(cb(blob, target - blob.l));
- if(target !== blob.l) throw new Error("Slurp error");
- return arr;
-}
-
-function parslurp2(blob, length, cb) {
- var arr = [], target = blob.l + length, len = blob.read_shift(2);
- while(len-- !== 0) arr.push(cb(blob, target - blob.l));
- if(target !== blob.l) throw new Error("Slurp error");
- return arr;
-}
-
-function parsebool(blob, length) { return blob.read_shift(length) === 0x1; }
-
-function parseuint16(blob) { return blob.read_shift(2, 'u'); }
-function parseuint16a(blob, length) { return parslurp(blob,length,parseuint16);}
-
-/* --- 2.5 Structures --- */
-
-/* [MS-XLS] 2.5.14 Boolean */
-var parse_Boolean = parsebool;
-
-/* [MS-XLS] 2.5.10 Bes (boolean or error) */
-function parse_Bes(blob) {
- var v = blob.read_shift(1), t = blob.read_shift(1);
- return t === 0x01 ? v : v === 0x01;
-}
-
-/* [MS-XLS] 2.5.240 ShortXLUnicodeString */
-function parse_ShortXLUnicodeString(blob, length, opts) {
- var cch = blob.read_shift(1);
- var width = 1, encoding = 'sbcs-cont';
- var cp = current_codepage;
- if(opts && opts.biff >= 8) current_codepage = 1200;
- if(opts === undefined || opts.biff !== 5) {
- var fHighByte = blob.read_shift(1);
- if(fHighByte) { width = 2; encoding = 'dbcs-cont'; }
- }
- var o = cch ? blob.read_shift(cch, encoding) : "";
- current_codepage = cp;
- return o;
-}
-
-/* 2.5.293 XLUnicodeRichExtendedString */
-function parse_XLUnicodeRichExtendedString(blob) {
- var cp = current_codepage;
- current_codepage = 1200;
- var cch = blob.read_shift(2), flags = blob.read_shift(1);
- var fHighByte = flags & 0x1, fExtSt = flags & 0x4, fRichSt = flags & 0x8;
- var width = 1 + (flags & 0x1); // 0x0 -> utf8, 0x1 -> dbcs
- var cRun, cbExtRst;
- var z = {};
- if(fRichSt) cRun = blob.read_shift(2);
- if(fExtSt) cbExtRst = blob.read_shift(4);
- var encoding = (flags & 0x1) ? 'dbcs-cont' : 'sbcs-cont';
- var msg = cch === 0 ? "" : blob.read_shift(cch, encoding);
- if(fRichSt) blob.l += 4 * cRun; //TODO: parse this
- if(fExtSt) blob.l += cbExtRst; //TODO: parse this
- z.t = msg;
- if(!fRichSt) { z.raw = "" + z.t + ""; z.r = z.t; }
- current_codepage = cp;
- return z;
-}
-
-/* 2.5.296 XLUnicodeStringNoCch */
-function parse_XLUnicodeStringNoCch(blob, cch, opts) {
- var retval;
- var fHighByte = blob.read_shift(1);
- if(fHighByte===0) { retval = blob.read_shift(cch, 'sbcs-cont'); }
- else { retval = blob.read_shift(cch, 'dbcs-cont'); }
- return retval;
-}
-
-/* 2.5.294 XLUnicodeString */
-function parse_XLUnicodeString(blob, length, opts) {
- var cch = blob.read_shift(opts !== undefined && opts.biff > 0 && opts.biff < 8 ? 1 : 2);
- if(cch === 0) { blob.l++; return ""; }
- return parse_XLUnicodeStringNoCch(blob, cch, opts);
-}
-/* BIFF5 override */
-function parse_XLUnicodeString2(blob, length, opts) {
- if(opts.biff !== 5 && opts.biff !== 2) return parse_XLUnicodeString(blob, length, opts);
- var cch = blob.read_shift(1);
- if(cch === 0) { blob.l++; return ""; }
- return blob.read_shift(cch, 'sbcs-cont');
-}
-
-/* [MS-XLS] 2.5.61 ControlInfo */
-var parse_ControlInfo = parsenoop;
-
-/* [MS-OSHARED] 2.3.7.6 URLMoniker TODO: flags */
-var parse_URLMoniker = function(blob, length) {
- var len = blob.read_shift(4), start = blob.l;
- var extra = false;
- if(len > 24) {
- /* look ahead */
- blob.l += len - 24;
- if(blob.read_shift(16) === "795881f43b1d7f48af2c825dc4852763") extra = true;
- blob.l = start;
- }
- var url = blob.read_shift((extra?len-24:len)>>1, 'utf16le').replace(chr0,"");
- if(extra) blob.l += 24;
- return url;
-};
-
-/* [MS-OSHARED] 2.3.7.8 FileMoniker TODO: all fields */
-var parse_FileMoniker = function(blob, length) {
- var cAnti = blob.read_shift(2);
- var ansiLength = blob.read_shift(4);
- var ansiPath = blob.read_shift(ansiLength, 'cstr');
- var endServer = blob.read_shift(2);
- var versionNumber = blob.read_shift(2);
- var cbUnicodePathSize = blob.read_shift(4);
- if(cbUnicodePathSize === 0) return ansiPath.replace(/\\/g,"/");
- var cbUnicodePathBytes = blob.read_shift(4);
- var usKeyValue = blob.read_shift(2);
- var unicodePath = blob.read_shift(cbUnicodePathBytes>>1, 'utf16le').replace(chr0,"");
- return unicodePath;
-};
-
-/* [MS-OSHARED] 2.3.7.2 HyperlinkMoniker TODO: all the monikers */
-var parse_HyperlinkMoniker = function(blob, length) {
- var clsid = blob.read_shift(16); length -= 16;
- switch(clsid) {
- case "e0c9ea79f9bace118c8200aa004ba90b": return parse_URLMoniker(blob, length);
- case "0303000000000000c000000000000046": return parse_FileMoniker(blob, length);
- default: throw "unsupported moniker " + clsid;
- }
-};
-
-/* [MS-OSHARED] 2.3.7.9 HyperlinkString */
-var parse_HyperlinkString = function(blob, length) {
- var len = blob.read_shift(4);
- var o = blob.read_shift(len, 'utf16le').replace(chr0, "");
- return o;
-};
-
-/* [MS-OSHARED] 2.3.7.1 Hyperlink Object TODO: unify params with XLSX */
-var parse_Hyperlink = function(blob, length) {
- var end = blob.l + length;
- var sVer = blob.read_shift(4);
- if(sVer !== 2) throw new Error("Unrecognized streamVersion: " + sVer);
- var flags = blob.read_shift(2);
- blob.l += 2;
- var displayName, targetFrameName, moniker, oleMoniker, location, guid, fileTime;
- if(flags & 0x0010) displayName = parse_HyperlinkString(blob, end - blob.l);
- if(flags & 0x0080) targetFrameName = parse_HyperlinkString(blob, end - blob.l);
- if((flags & 0x0101) === 0x0101) moniker = parse_HyperlinkString(blob, end - blob.l);
- if((flags & 0x0101) === 0x0001) oleMoniker = parse_HyperlinkMoniker(blob, end - blob.l);
- if(flags & 0x0008) location = parse_HyperlinkString(blob, end - blob.l);
- if(flags & 0x0020) guid = blob.read_shift(16);
- if(flags & 0x0040) fileTime = parse_FILETIME(blob, 8);
- blob.l = end;
- var target = (targetFrameName||moniker||oleMoniker);
- if(location) target+="#"+location;
- return {Target: target};
-};
-
-/* 2.5.178 LongRGBA */
-function parse_LongRGBA(blob, length) { var r = blob.read_shift(1), g = blob.read_shift(1), b = blob.read_shift(1), a = blob.read_shift(1); return [r,g,b,a]; }
-
-/* 2.5.177 LongRGB */
-function parse_LongRGB(blob, length) { var x = parse_LongRGBA(blob, length); x[3] = 0; return x; }
-
-
-/* --- MS-XLS --- */
-
-/* 2.5.19 */
-function parse_XLSCell(blob, length) {
- var rw = blob.read_shift(2); // 0-indexed
- var col = blob.read_shift(2);
- var ixfe = blob.read_shift(2);
- return {r:rw, c:col, ixfe:ixfe};
-}
-
-/* 2.5.134 */
-function parse_frtHeader(blob) {
- var rt = blob.read_shift(2);
- var flags = blob.read_shift(2); // TODO: parse these flags
- blob.l += 8;
- return {type: rt, flags: flags};
-}
-
-
-
-function parse_OptXLUnicodeString(blob, length, opts) { return length === 0 ? "" : parse_XLUnicodeString2(blob, length, opts); }
-
-/* 2.5.158 */
-var HIDEOBJENUM = ['SHOWALL', 'SHOWPLACEHOLDER', 'HIDEALL'];
-var parse_HideObjEnum = parseuint16;
-
-/* 2.5.344 */
-function parse_XTI(blob, length) {
- var iSupBook = blob.read_shift(2), itabFirst = blob.read_shift(2,'i'), itabLast = blob.read_shift(2,'i');
- return [iSupBook, itabFirst, itabLast];
-}
-
-/* 2.5.218 */
-function parse_RkRec(blob, length) {
- var ixfe = blob.read_shift(2);
- var RK = parse_RkNumber(blob);
- //console.log("::", ixfe, RK,";;");
- return [ixfe, RK];
-}
-
-/* 2.5.1 */
-function parse_AddinUdf(blob, length) {
- blob.l += 4; length -= 4;
- var l = blob.l + length;
- var udfName = parse_ShortXLUnicodeString(blob, length);
- var cb = blob.read_shift(2);
- l -= blob.l;
- if(cb !== l) throw "Malformed AddinUdf: padding = " + l + " != " + cb;
- blob.l += cb;
- return udfName;
-}
-
-/* 2.5.209 TODO: Check sizes */
-function parse_Ref8U(blob, length) {
- var rwFirst = blob.read_shift(2);
- var rwLast = blob.read_shift(2);
- var colFirst = blob.read_shift(2);
- var colLast = blob.read_shift(2);
- return {s:{c:colFirst, r:rwFirst}, e:{c:colLast,r:rwLast}};
-}
-
-/* 2.5.211 */
-function parse_RefU(blob, length) {
- var rwFirst = blob.read_shift(2);
- var rwLast = blob.read_shift(2);
- var colFirst = blob.read_shift(1);
- var colLast = blob.read_shift(1);
- return {s:{c:colFirst, r:rwFirst}, e:{c:colLast,r:rwLast}};
-}
-
-/* 2.5.207 */
-var parse_Ref = parse_RefU;
-
-/* 2.5.143 */
-function parse_FtCmo(blob, length) {
- blob.l += 4;
- var ot = blob.read_shift(2);
- var id = blob.read_shift(2);
- var flags = blob.read_shift(2);
- blob.l+=12;
- return [id, ot, flags];
-}
-
-/* 2.5.149 */
-function parse_FtNts(blob, length) {
- var out = {};
- blob.l += 4;
- blob.l += 16; // GUID TODO
- out.fSharedNote = blob.read_shift(2);
- blob.l += 4;
- return out;
-}
-
-/* 2.5.142 */
-function parse_FtCf(blob, length) {
- var out = {};
- blob.l += 4;
- blob.cf = blob.read_shift(2);
- return out;
-}
-
-/* 2.5.140 - 2.5.154 and friends */
-var FtTab = {
- 0x15: parse_FtCmo,
- 0x13: parsenoop, /* FtLbsData */
- 0x12: function(blob, length) { blob.l += 12; }, /* FtCblsData */
- 0x11: function(blob, length) { blob.l += 8; }, /* FtRboData */
- 0x10: parsenoop, /* FtEdoData */
- 0x0F: parsenoop, /* FtGboData */
- 0x0D: parse_FtNts, /* FtNts */
- 0x0C: function(blob, length) { blob.l += 24; }, /* FtSbs */
- 0x0B: function(blob, length) { blob.l += 10; }, /* FtRbo */
- 0x0A: function(blob, length) { blob.l += 16; }, /* FtCbls */
- 0x09: parsenoop, /* FtPictFmla */
- 0x08: function(blob, length) { blob.l += 6; }, /* FtPioGrbit */
- 0x07: parse_FtCf, /* FtCf */
- 0x06: function(blob, length) { blob.l += 6; }, /* FtGmo */
- 0x04: parsenoop, /* FtMacro */
- 0x00: function(blob, length) { blob.l += 4; } /* FtEnding */
-};
-function parse_FtArray(blob, length, ot) {
- var s = blob.l;
- var fts = [];
- while(blob.l < s + length) {
- var ft = blob.read_shift(2);
- blob.l-=2;
- try {
- fts.push(FtTab[ft](blob, s + length - blob.l));
- } catch(e) { blob.l = s + length; return fts; }
- }
- if(blob.l != s + length) blob.l = s + length; //throw "bad Object Ft-sequence";
- return fts;
-}
-
-/* 2.5.129 */
-var parse_FontIndex = parseuint16;
-
-/* --- 2.4 Records --- */
-
-/* 2.4.21 */
-function parse_BOF(blob, length) {
- var o = {};
- o.BIFFVer = blob.read_shift(2); length -= 2;
- switch(o.BIFFVer) {
- case 0x0600: /* BIFF8 */
- case 0x0500: /* BIFF5 */
- case 0x0002: case 0x0007: /* BIFF2 */
- break;
- default: throw "Unexpected BIFF Ver " + o.BIFFVer;
- }
- blob.read_shift(length);
- return o;
-}
-
-
-/* 2.4.146 */
-function parse_InterfaceHdr(blob, length) {
- if(length === 0) return 0x04b0;
- var q;
- if((q=blob.read_shift(2))!==0x04b0) throw 'InterfaceHdr codePage ' + q;
- return 0x04b0;
-}
-
-
-/* 2.4.349 */
-function parse_WriteAccess(blob, length, opts) {
- if(opts.enc) { blob.l += length; return ""; }
- var l = blob.l;
- // TODO: make sure XLUnicodeString doesnt overrun
- var UserName = parse_XLUnicodeString(blob, 0, opts);
- blob.read_shift(length + l - blob.l);
- return UserName;
-}
-
-/* 2.4.28 */
-function parse_BoundSheet8(blob, length, opts) {
- var pos = blob.read_shift(4);
- var hidden = blob.read_shift(1) >> 6;
- var dt = blob.read_shift(1);
- switch(dt) {
- case 0: dt = 'Worksheet'; break;
- case 1: dt = 'Macrosheet'; break;
- case 2: dt = 'Chartsheet'; break;
- case 6: dt = 'VBAModule'; break;
- }
- var name = parse_ShortXLUnicodeString(blob, 0, opts);
- if(name.length === 0) name = "Sheet1";
- return { pos:pos, hs:hidden, dt:dt, name:name };
-}
-
-/* 2.4.265 TODO */
-function parse_SST(blob, length) {
- var cnt = blob.read_shift(4);
- var ucnt = blob.read_shift(4);
- var strs = [];
- for(var i = 0; i != ucnt; ++i) {
- strs.push(parse_XLUnicodeRichExtendedString(blob));
- }
- strs.Count = cnt; strs.Unique = ucnt;
- return strs;
-}
-
-/* 2.4.107 */
-function parse_ExtSST(blob, length) {
- var extsst = {};
- extsst.dsst = blob.read_shift(2);
- blob.l += length-2;
- return extsst;
-}
-
-
-/* 2.4.221 TODO*/
-function parse_Row(blob, length) {
- var rw = blob.read_shift(2), col = blob.read_shift(2), Col = blob.read_shift(2), rht = blob.read_shift(2);
- blob.read_shift(4); // reserved(2), unused(2)
- var flags = blob.read_shift(1); // various flags
- blob.read_shift(1); // reserved
- blob.read_shift(2); //ixfe, other flags
- return {r:rw, c:col, cnt:Col-col};
-}
-
-
-/* 2.4.125 */
-function parse_ForceFullCalculation(blob, length) {
- var header = parse_frtHeader(blob);
- if(header.type != 0x08A3) throw "Invalid Future Record " + header.type;
- var fullcalc = blob.read_shift(4);
- return fullcalc !== 0x0;
-}
-
-
-var parse_CompressPictures = parsenoop2; /* 2.4.55 Not interesting */
-
-
-
-/* 2.4.215 rt */
-function parse_RecalcId(blob, length) {
- blob.read_shift(2);
- return blob.read_shift(4);
-}
-
-/* 2.4.87 */
-function parse_DefaultRowHeight (blob, length) {
- var f = blob.read_shift(2), miyRw;
- miyRw = blob.read_shift(2); // flags & 0x02 -> hidden, else empty
- var fl = {Unsynced:f&1,DyZero:(f&2)>>1,ExAsc:(f&4)>>2,ExDsc:(f&8)>>3};
- return [fl, miyRw];
-}
-
-/* 2.4.345 TODO */
-function parse_Window1(blob, length) {
- var xWn = blob.read_shift(2), yWn = blob.read_shift(2), dxWn = blob.read_shift(2), dyWn = blob.read_shift(2);
- var flags = blob.read_shift(2), iTabCur = blob.read_shift(2), iTabFirst = blob.read_shift(2);
- var ctabSel = blob.read_shift(2), wTabRatio = blob.read_shift(2);
- return { Pos: [xWn, yWn], Dim: [dxWn, dyWn], Flags: flags, CurTab: iTabCur,
- FirstTab: iTabFirst, Selected: ctabSel, TabRatio: wTabRatio };
-}
-
-/* 2.4.122 TODO */
-function parse_Font(blob, length, opts) {
- blob.l += 14;
- var name = parse_ShortXLUnicodeString(blob, 0, opts);
- return name;
-}
-
-/* 2.4.149 */
-function parse_LabelSst(blob, length) {
- var cell = parse_XLSCell(blob);
- cell.isst = blob.read_shift(4);
- return cell;
-}
-
-/* 2.4.148 */
-function parse_Label(blob, length, opts) {
- var cell = parse_XLSCell(blob, 6);
- var str = parse_XLUnicodeString(blob, length-6, opts);
- cell.val = str;
- return cell;
-}
-
-/* 2.4.126 Number Formats */
-function parse_Format(blob, length, opts) {
- var ifmt = blob.read_shift(2);
- var fmtstr = parse_XLUnicodeString2(blob, 0, opts);
- return [ifmt, fmtstr];
-}
-
-/* 2.4.90 */
-function parse_Dimensions(blob, length) {
- var w = length === 10 ? 2 : 4;
- var r = blob.read_shift(w), R = blob.read_shift(w),
- c = blob.read_shift(2), C = blob.read_shift(2);
- blob.l += 2;
- return {s: {r:r, c:c}, e: {r:R, c:C}};
-}
-
-/* 2.4.220 */
-function parse_RK(blob, length) {
- var rw = blob.read_shift(2), col = blob.read_shift(2);
- var rkrec = parse_RkRec(blob);
- return {r:rw, c:col, ixfe:rkrec[0], rknum:rkrec[1]};
-}
-
-/* 2.4.175 */
-function parse_MulRk(blob, length) {
- var target = blob.l + length - 2;
- var rw = blob.read_shift(2), col = blob.read_shift(2);
- var rkrecs = [];
- while(blob.l < target) rkrecs.push(parse_RkRec(blob));
- if(blob.l !== target) throw "MulRK read error";
- var lastcol = blob.read_shift(2);
- if(rkrecs.length != lastcol - col + 1) throw "MulRK length mismatch";
- return {r:rw, c:col, C:lastcol, rkrec:rkrecs};
-}
-
-/* 2.5.20 2.5.249 TODO */
-function parse_CellStyleXF(blob, length, style) {
- var o = {};
- var a = blob.read_shift(4), b = blob.read_shift(4);
- var c = blob.read_shift(4), d = blob.read_shift(2);
- o.patternType = XLSFillPattern[c >> 26];
- o.icvFore = d & 0x7F;
- o.icvBack = (d >> 7) & 0x7F;
- return o;
-}
-function parse_CellXF(blob, length) {return parse_CellStyleXF(blob,length,0);}
-function parse_StyleXF(blob, length) {return parse_CellStyleXF(blob,length,1);}
-
-/* 2.4.353 TODO: actually do this right */
-function parse_XF(blob, length) {
- var o = {};
- o.ifnt = blob.read_shift(2); o.ifmt = blob.read_shift(2); o.flags = blob.read_shift(2);
- o.fStyle = (o.flags >> 2) & 0x01;
- length -= 6;
- o.data = parse_CellStyleXF(blob, length, o.fStyle);
- return o;
-}
-
-/* 2.4.134 */
-function parse_Guts(blob, length) {
- blob.l += 4;
- var out = [blob.read_shift(2), blob.read_shift(2)];
- if(out[0] !== 0) out[0]--;
- if(out[1] !== 0) out[1]--;
- if(out[0] > 7 || out[1] > 7) throw "Bad Gutters: " + out;
- return out;
-}
-
-/* 2.4.24 */
-function parse_BoolErr(blob, length) {
- var cell = parse_XLSCell(blob, 6);
- var val = parse_Bes(blob, 2);
- cell.val = val;
- cell.t = (val === true || val === false) ? 'b' : 'e';
- return cell;
-}
-
-/* 2.4.180 Number */
-function parse_Number(blob, length) {
- var cell = parse_XLSCell(blob, 6);
- var xnum = parse_Xnum(blob, 8);
- cell.val = xnum;
- return cell;
-}
-
-var parse_XLHeaderFooter = parse_OptXLUnicodeString; // TODO: parse 2.4.136
-
-/* 2.4.271 */
-function parse_SupBook(blob, length, opts) {
- var end = blob.l + length;
- var ctab = blob.read_shift(2);
- var cch = blob.read_shift(2);
- var virtPath;
- if(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);
- var rgst = blob.read_shift(end - blob.l);
- opts.sbcch = cch;
- return [cch, ctab, virtPath, rgst];
-}
-
-/* 2.4.105 TODO */
-function parse_ExternName(blob, length, opts) {
- var flags = blob.read_shift(2);
- var body;
- var o = {
- fBuiltIn: flags & 0x01,
- fWantAdvise: (flags >>> 1) & 0x01,
- fWantPict: (flags >>> 2) & 0x01,
- fOle: (flags >>> 3) & 0x01,
- fOleLink: (flags >>> 4) & 0x01,
- cf: (flags >>> 5) & 0x3FF,
- fIcon: flags >>> 15 & 0x01
- };
- if(opts.sbcch === 0x3A01) body = parse_AddinUdf(blob, length-2);
- //else throw new Error("unsupported SupBook cch: " + opts.sbcch);
- o.body = body || blob.read_shift(length-2);
- return o;
-}
-
-/* 2.4.150 TODO */
-function parse_Lbl(blob, length, opts) {
- if(opts.biff < 8) return parse_Label(blob, length, opts);
- var target = blob.l + length;
- var flags = blob.read_shift(2);
- var chKey = blob.read_shift(1);
- var cch = blob.read_shift(1);
- var cce = blob.read_shift(2);
- blob.l += 2;
- var itab = blob.read_shift(2);
- blob.l += 4;
- var name = parse_XLUnicodeStringNoCch(blob, cch, opts);
- var rgce = parse_NameParsedFormula(blob, target - blob.l, opts, cce);
- return {
- chKey: chKey,
- Name: name,
- rgce: rgce
- };
-}
-
-/* 2.4.106 TODO: verify supbook manipulation */
-function parse_ExternSheet(blob, length, opts) {
- if(opts.biff < 8) return parse_ShortXLUnicodeString(blob, length, opts);
- var o = parslurp2(blob,length,parse_XTI);
- var oo = [];
- if(opts.sbcch === 0x0401) {
- for(var i = 0; i != o.length; ++i) oo.push(opts.snames[o[i][1]]);
- return oo;
- }
- else return o;
-}
-
-/* 2.4.260 */
-function parse_ShrFmla(blob, length, opts) {
- var ref = parse_RefU(blob, 6);
- blob.l++;
- var cUse = blob.read_shift(1);
- length -= 8;
- return [parse_SharedParsedFormula(blob, length, opts), cUse];
-}
-
-/* 2.4.4 TODO */
-function parse_Array(blob, length, opts) {
- var ref = parse_Ref(blob, 6);
- blob.l += 6; length -= 12; /* TODO: fAlwaysCalc */
- return [ref, parse_ArrayParsedFormula(blob, length, opts, ref)];
-}
-
-/* 2.4.173 */
-function parse_MTRSettings(blob, length) {
- var fMTREnabled = blob.read_shift(4) !== 0x00;
- var fUserSetThreadCount = blob.read_shift(4) !== 0x00;
- var cUserThreadCount = blob.read_shift(4);
- return [fMTREnabled, fUserSetThreadCount, cUserThreadCount];
-}
-
-/* 2.5.186 TODO: BIFF5 */
-function parse_NoteSh(blob, length, opts) {
- if(opts.biff < 8) return;
- var row = blob.read_shift(2), col = blob.read_shift(2);
- var flags = blob.read_shift(2), idObj = blob.read_shift(2);
- var stAuthor = parse_XLUnicodeString2(blob, 0, opts);
- if(opts.biff < 8) blob.read_shift(1);
- return [{r:row,c:col}, stAuthor, idObj, flags];
-}
-
-/* 2.4.179 */
-function parse_Note(blob, length, opts) {
- /* TODO: Support revisions */
- return parse_NoteSh(blob, length, opts);
-}
-
-/* 2.4.168 */
-function parse_MergeCells(blob, length) {
- var merges = [];
- var cmcs = blob.read_shift(2);
- while (cmcs--) merges.push(parse_Ref8U(blob,length));
- return merges;
-}
-
-/* 2.4.181 TODO: parse all the things! */
-function parse_Obj(blob, length) {
- var cmo = parse_FtCmo(blob, 22); // id, ot, flags
- var fts = parse_FtArray(blob, length-22, cmo[1]);
- return { cmo: cmo, ft:fts };
-}
-
-/* 2.4.329 TODO: parse properly */
-function parse_TxO(blob, length, opts) {
- var s = blob.l;
-try {
- blob.l += 4;
- var ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];
- var controlInfo;
- if([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6;
- else controlInfo = parse_ControlInfo(blob, 6, opts);
- var cchText = blob.read_shift(2);
- var cbRuns = blob.read_shift(2);
- var ifntEmpty = parse_FontIndex(blob, 2);
- var len = blob.read_shift(2);
- blob.l += len;
- //var fmla = parse_ObjFmla(blob, s + length - blob.l);
-
- var texts = "";
- for(var i = 1; i < blob.lens.length-1; ++i) {
- if(blob.l-s != blob.lens[i]) throw "TxO: bad continue record";
- var hdr = blob[blob.l];
- var t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1);
- texts += t;
- if(texts.length >= (hdr ? cchText : 2*cchText)) break;
- }
- if(texts.length !== cchText && texts.length !== cchText*2) {
- throw "cchText: " + cchText + " != " + texts.length;
- }
-
- blob.l = s + length;
- /* 2.5.272 TxORuns */
-// var rgTxoRuns = [];
-// for(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;
-// var cchText2 = blob.read_shift(2);
-// if(cchText2 !== cchText) throw "TxOLastRun mismatch: " + cchText2 + " " + cchText;
-// blob.l += 6;
-// if(s + length != blob.l) throw "TxO " + (s + length) + ", at " + blob.l;
- return { t: texts };
-} catch(e) { blob.l = s + length; return { t: texts||"" }; }
-}
-
-/* 2.4.140 */
-var parse_HLink = function(blob, length) {
- var ref = parse_Ref8U(blob, 8);
- blob.l += 16; /* CLSID */
- var hlink = parse_Hyperlink(blob, length-24);
- return [ref, hlink];
-};
-
-/* 2.4.141 */
-var parse_HLinkTooltip = function(blob, length) {
- var end = blob.l + length;
- blob.read_shift(2);
- var ref = parse_Ref8U(blob, 8);
- var wzTooltip = blob.read_shift((length-10)/2, 'dbcs-cont');
- wzTooltip = wzTooltip.replace(chr0,"");
- return [ref, wzTooltip];
-};
-
-/* 2.4.63 */
-function parse_Country(blob, length) {
- var o = [], d;
- d = blob.read_shift(2); o[0] = CountryEnum[d] || d;
- d = blob.read_shift(2); o[1] = CountryEnum[d] || d;
- return o;
-}
-
-/* 2.4.50 ClrtClient */
-function parse_ClrtClient(blob, length) {
- var ccv = blob.read_shift(2);
- var o = [];
- while(ccv-->0) o.push(parse_LongRGB(blob, 8));
- return o;
-}
-
-/* 2.4.188 */
-function parse_Palette(blob, length) {
- var ccv = blob.read_shift(2);
- var o = [];
- while(ccv-->0) o.push(parse_LongRGB(blob, 8));
- return o;
-}
-
-/* 2.4.354 */
-function parse_XFCRC(blob, length) {
- blob.l += 2;
- var o = {cxfs:0, crc:0};
- o.cxfs = blob.read_shift(2);
- o.crc = blob.read_shift(4);
- return o;
-}
-
-
-var parse_Style = parsenoop;
-var parse_StyleExt = parsenoop;
-
-var parse_ColInfo = parsenoop;
-
-var parse_Window2 = parsenoop;
-
-
-var parse_Backup = parsebool; /* 2.4.14 */
-var parse_Blank = parse_XLSCell; /* 2.4.20 Just the cell */
-var parse_BottomMargin = parse_Xnum; /* 2.4.27 */
-var parse_BuiltInFnGroupCount = parseuint16; /* 2.4.30 0x0E or 0x10 but excel 2011 generates 0x11? */
-var parse_CalcCount = parseuint16; /* 2.4.31 #Iterations */
-var parse_CalcDelta = parse_Xnum; /* 2.4.32 */
-var parse_CalcIter = parsebool; /* 2.4.33 1=iterative calc */
-var parse_CalcMode = parseuint16; /* 2.4.34 0=manual, 1=auto (def), 2=table */
-var parse_CalcPrecision = parsebool; /* 2.4.35 */
-var parse_CalcRefMode = parsenoop2; /* 2.4.36 */
-var parse_CalcSaveRecalc = parsebool; /* 2.4.37 */
-var parse_CodePage = parseuint16; /* 2.4.52 */
-var parse_Compat12 = parsebool; /* 2.4.54 true = no compatibility check */
-var parse_Date1904 = parsebool; /* 2.4.77 - 1=1904,0=1900 */
-var parse_DefColWidth = parseuint16; /* 2.4.89 */
-var parse_DSF = parsenoop2; /* 2.4.94 -- MUST be ignored */
-var parse_EntExU2 = parsenoop2; /* 2.4.102 -- Explicitly says to ignore */
-var parse_EOF = parsenoop2; /* 2.4.103 */
-var parse_Excel9File = parsenoop2; /* 2.4.104 -- Optional and unused */
-var parse_FeatHdr = parsenoop2; /* 2.4.112 */
-var parse_FontX = parseuint16; /* 2.4.123 */
-var parse_Footer = parse_XLHeaderFooter; /* 2.4.124 */
-var parse_GridSet = parseuint16; /* 2.4.132, =1 */
-var parse_HCenter = parsebool; /* 2.4.135 sheet centered horizontal on print */
-var parse_Header = parse_XLHeaderFooter; /* 2.4.136 */
-var parse_HideObj = parse_HideObjEnum; /* 2.4.139 */
-var parse_InterfaceEnd = parsenoop2; /* 2.4.145 -- noop */
-var parse_LeftMargin = parse_Xnum; /* 2.4.151 */
-var parse_Mms = parsenoop2; /* 2.4.169 -- Explicitly says to ignore */
-var parse_ObjProtect = parsebool; /* 2.4.183 -- must be 1 if present */
-var parse_Password = parseuint16; /* 2.4.191 */
-var parse_PrintGrid = parsebool; /* 2.4.202 */
-var parse_PrintRowCol = parsebool; /* 2.4.203 */
-var parse_PrintSize = parseuint16; /* 2.4.204 0:3 */
-var parse_Prot4Rev = parsebool; /* 2.4.205 */
-var parse_Prot4RevPass = parseuint16; /* 2.4.206 */
-var parse_Protect = parsebool; /* 2.4.207 */
-var parse_RefreshAll = parsebool; /* 2.4.217 -- must be 0 if not template */
-var parse_RightMargin = parse_Xnum; /* 2.4.219 */
-var parse_RRTabId = parseuint16a; /* 2.4.241 */
-var parse_ScenarioProtect = parsebool; /* 2.4.245 */
-var parse_Scl = parseuint16a; /* 2.4.247 num, den */
-var parse_String = parse_XLUnicodeString; /* 2.4.268 */
-var parse_SxBool = parsebool; /* 2.4.274 */
-var parse_TopMargin = parse_Xnum; /* 2.4.328 */
-var parse_UsesELFs = parsebool; /* 2.4.337 -- should be 0 */
-var parse_VCenter = parsebool; /* 2.4.342 */
-var parse_WinProtect = parsebool; /* 2.4.347 */
-var parse_WriteProtect = parsenoop; /* 2.4.350 empty record */
-
-
-/* ---- */
-var parse_VerticalPageBreaks = parsenoop;
-var parse_HorizontalPageBreaks = parsenoop;
-var parse_Selection = parsenoop;
-var parse_Continue = parsenoop;
-var parse_Pane = parsenoop;
-var parse_Pls = parsenoop;
-var parse_DCon = parsenoop;
-var parse_DConRef = parsenoop;
-var parse_DConName = parsenoop;
-var parse_XCT = parsenoop;
-var parse_CRN = parsenoop;
-var parse_FileSharing = parsenoop;
-var parse_Uncalced = parsenoop;
-var parse_Template = parsenoop;
-var parse_Intl = parsenoop;
-var parse_WsBool = parsenoop;
-var parse_Sort = parsenoop;
-var parse_Sync = parsenoop;
-var parse_LPr = parsenoop;
-var parse_DxGCol = parsenoop;
-var parse_FnGroupName = parsenoop;
-var parse_FilterMode = parsenoop;
-var parse_AutoFilterInfo = parsenoop;
-var parse_AutoFilter = parsenoop;
-var parse_Setup = parsenoop;
-var parse_ScenMan = parsenoop;
-var parse_SCENARIO = parsenoop;
-var parse_SxView = parsenoop;
-var parse_Sxvd = parsenoop;
-var parse_SXVI = parsenoop;
-var parse_SxIvd = parsenoop;
-var parse_SXLI = parsenoop;
-var parse_SXPI = parsenoop;
-var parse_DocRoute = parsenoop;
-var parse_RecipName = parsenoop;
-var parse_MulBlank = parsenoop;
-var parse_SXDI = parsenoop;
-var parse_SXDB = parsenoop;
-var parse_SXFDB = parsenoop;
-var parse_SXDBB = parsenoop;
-var parse_SXNum = parsenoop;
-var parse_SxErr = parsenoop;
-var parse_SXInt = parsenoop;
-var parse_SXString = parsenoop;
-var parse_SXDtr = parsenoop;
-var parse_SxNil = parsenoop;
-var parse_SXTbl = parsenoop;
-var parse_SXTBRGIITM = parsenoop;
-var parse_SxTbpg = parsenoop;
-var parse_ObProj = parsenoop;
-var parse_SXStreamID = parsenoop;
-var parse_DBCell = parsenoop;
-var parse_SXRng = parsenoop;
-var parse_SxIsxoper = parsenoop;
-var parse_BookBool = parsenoop;
-var parse_DbOrParamQry = parsenoop;
-var parse_OleObjectSize = parsenoop;
-var parse_SXVS = parsenoop;
-var parse_BkHim = parsenoop;
-var parse_MsoDrawingGroup = parsenoop;
-var parse_MsoDrawing = parsenoop;
-var parse_MsoDrawingSelection = parsenoop;
-var parse_PhoneticInfo = parsenoop;
-var parse_SxRule = parsenoop;
-var parse_SXEx = parsenoop;
-var parse_SxFilt = parsenoop;
-var parse_SxDXF = parsenoop;
-var parse_SxItm = parsenoop;
-var parse_SxName = parsenoop;
-var parse_SxSelect = parsenoop;
-var parse_SXPair = parsenoop;
-var parse_SxFmla = parsenoop;
-var parse_SxFormat = parsenoop;
-var parse_SXVDEx = parsenoop;
-var parse_SXFormula = parsenoop;
-var parse_SXDBEx = parsenoop;
-var parse_RRDInsDel = parsenoop;
-var parse_RRDHead = parsenoop;
-var parse_RRDChgCell = parsenoop;
-var parse_RRDRenSheet = parsenoop;
-var parse_RRSort = parsenoop;
-var parse_RRDMove = parsenoop;
-var parse_RRFormat = parsenoop;
-var parse_RRAutoFmt = parsenoop;
-var parse_RRInsertSh = parsenoop;
-var parse_RRDMoveBegin = parsenoop;
-var parse_RRDMoveEnd = parsenoop;
-var parse_RRDInsDelBegin = parsenoop;
-var parse_RRDInsDelEnd = parsenoop;
-var parse_RRDConflict = parsenoop;
-var parse_RRDDefName = parsenoop;
-var parse_RRDRstEtxp = parsenoop;
-var parse_LRng = parsenoop;
-var parse_CUsr = parsenoop;
-var parse_CbUsr = parsenoop;
-var parse_UsrInfo = parsenoop;
-var parse_UsrExcl = parsenoop;
-var parse_FileLock = parsenoop;
-var parse_RRDInfo = parsenoop;
-var parse_BCUsrs = parsenoop;
-var parse_UsrChk = parsenoop;
-var parse_UserBView = parsenoop;
-var parse_UserSViewBegin = parsenoop; // overloaded
-var parse_UserSViewEnd = parsenoop;
-var parse_RRDUserView = parsenoop;
-var parse_Qsi = parsenoop;
-var parse_CondFmt = parsenoop;
-var parse_CF = parsenoop;
-var parse_DVal = parsenoop;
-var parse_DConBin = parsenoop;
-var parse_Lel = parsenoop;
-var parse_XLSCodeName = parse_XLUnicodeString;
-var parse_SXFDBType = parsenoop;
-var parse_ObNoMacros = parsenoop;
-var parse_Dv = parsenoop;
-var parse_Index = parsenoop;
-var parse_Table = parsenoop;
-var parse_BigName = parsenoop;
-var parse_ContinueBigName = parsenoop;
-var parse_WebPub = parsenoop;
-var parse_QsiSXTag = parsenoop;
-var parse_DBQueryExt = parsenoop;
-var parse_ExtString = parsenoop;
-var parse_TxtQry = parsenoop;
-var parse_Qsir = parsenoop;
-var parse_Qsif = parsenoop;
-var parse_RRDTQSIF = parsenoop;
-var parse_OleDbConn = parsenoop;
-var parse_WOpt = parsenoop;
-var parse_SXViewEx = parsenoop;
-var parse_SXTH = parsenoop;
-var parse_SXPIEx = parsenoop;
-var parse_SXVDTEx = parsenoop;
-var parse_SXViewEx9 = parsenoop;
-var parse_ContinueFrt = parsenoop;
-var parse_RealTimeData = parsenoop;
-var parse_ChartFrtInfo = parsenoop;
-var parse_FrtWrapper = parsenoop;
-var parse_StartBlock = parsenoop;
-var parse_EndBlock = parsenoop;
-var parse_StartObject = parsenoop;
-var parse_EndObject = parsenoop;
-var parse_CatLab = parsenoop;
-var parse_YMult = parsenoop;
-var parse_SXViewLink = parsenoop;
-var parse_PivotChartBits = parsenoop;
-var parse_FrtFontList = parsenoop;
-var parse_SheetExt = parsenoop;
-var parse_BookExt = parsenoop;
-var parse_SXAddl = parsenoop;
-var parse_CrErr = parsenoop;
-var parse_HFPicture = parsenoop;
-var parse_Feat = parsenoop;
-var parse_DataLabExt = parsenoop;
-var parse_DataLabExtContents = parsenoop;
-var parse_CellWatch = parsenoop;
-var parse_FeatHdr11 = parsenoop;
-var parse_Feature11 = parsenoop;
-var parse_DropDownObjIds = parsenoop;
-var parse_ContinueFrt11 = parsenoop;
-var parse_DConn = parsenoop;
-var parse_List12 = parsenoop;
-var parse_Feature12 = parsenoop;
-var parse_CondFmt12 = parsenoop;
-var parse_CF12 = parsenoop;
-var parse_CFEx = parsenoop;
-var parse_AutoFilter12 = parsenoop;
-var parse_ContinueFrt12 = parsenoop;
-var parse_MDTInfo = parsenoop;
-var parse_MDXStr = parsenoop;
-var parse_MDXTuple = parsenoop;
-var parse_MDXSet = parsenoop;
-var parse_MDXProp = parsenoop;
-var parse_MDXKPI = parsenoop;
-var parse_MDB = parsenoop;
-var parse_PLV = parsenoop;
-var parse_DXF = parsenoop;
-var parse_TableStyles = parsenoop;
-var parse_TableStyle = parsenoop;
-var parse_TableStyleElement = parsenoop;
-var parse_NamePublish = parsenoop;
-var parse_NameCmt = parsenoop;
-var parse_SortData = parsenoop;
-var parse_GUIDTypeLib = parsenoop;
-var parse_FnGrp12 = parsenoop;
-var parse_NameFnGrp12 = parsenoop;
-var parse_HeaderFooter = parsenoop;
-var parse_CrtLayout12 = parsenoop;
-var parse_CrtMlFrt = parsenoop;
-var parse_CrtMlFrtContinue = parsenoop;
-var parse_ShapePropsStream = parsenoop;
-var parse_TextPropsStream = parsenoop;
-var parse_RichTextStream = parsenoop;
-var parse_CrtLayout12A = parsenoop;
-var parse_Units = parsenoop;
-var parse_Chart = parsenoop;
-var parse_Series = parsenoop;
-var parse_DataFormat = parsenoop;
-var parse_LineFormat = parsenoop;
-var parse_MarkerFormat = parsenoop;
-var parse_AreaFormat = parsenoop;
-var parse_PieFormat = parsenoop;
-var parse_AttachedLabel = parsenoop;
-var parse_SeriesText = parsenoop;
-var parse_ChartFormat = parsenoop;
-var parse_Legend = parsenoop;
-var parse_SeriesList = parsenoop;
-var parse_Bar = parsenoop;
-var parse_Line = parsenoop;
-var parse_Pie = parsenoop;
-var parse_Area = parsenoop;
-var parse_Scatter = parsenoop;
-var parse_CrtLine = parsenoop;
-var parse_Axis = parsenoop;
-var parse_Tick = parsenoop;
-var parse_ValueRange = parsenoop;
-var parse_CatSerRange = parsenoop;
-var parse_AxisLine = parsenoop;
-var parse_CrtLink = parsenoop;
-var parse_DefaultText = parsenoop;
-var parse_Text = parsenoop;
-var parse_ObjectLink = parsenoop;
-var parse_Frame = parsenoop;
-var parse_Begin = parsenoop;
-var parse_End = parsenoop;
-var parse_PlotArea = parsenoop;
-var parse_Chart3d = parsenoop;
-var parse_PicF = parsenoop;
-var parse_DropBar = parsenoop;
-var parse_Radar = parsenoop;
-var parse_Surf = parsenoop;
-var parse_RadarArea = parsenoop;
-var parse_AxisParent = parsenoop;
-var parse_LegendException = parsenoop;
-var parse_ShtProps = parsenoop;
-var parse_SerToCrt = parsenoop;
-var parse_AxesUsed = parsenoop;
-var parse_SBaseRef = parsenoop;
-var parse_SerParent = parsenoop;
-var parse_SerAuxTrend = parsenoop;
-var parse_IFmtRecord = parsenoop;
-var parse_Pos = parsenoop;
-var parse_AlRuns = parsenoop;
-var parse_BRAI = parsenoop;
-var parse_SerAuxErrBar = parsenoop;
-var parse_SerFmt = parsenoop;
-var parse_Chart3DBarShape = parsenoop;
-var parse_Fbi = parsenoop;
-var parse_BopPop = parsenoop;
-var parse_AxcExt = parsenoop;
-var parse_Dat = parsenoop;
-var parse_PlotGrowth = parsenoop;
-var parse_SIIndex = parsenoop;
-var parse_GelFrame = parsenoop;
-var parse_BopPopCustom = parsenoop;
-var parse_Fbi2 = parsenoop;
-
-/* --- Specific to versions before BIFF8 --- */
-function parse_BIFF5String(blob) {
- var len = blob.read_shift(1);
- return blob.read_shift(len, 'sbcs-cont');
-}
-
-/* BIFF2_??? where ??? is the name from [XLS] */
-function parse_BIFF2STR(blob, length, opts) {
- var cell = parse_XLSCell(blob, 6);
- ++blob.l;
- var str = parse_XLUnicodeString2(blob, length-7, opts);
- cell.val = str;
- return cell;
-}
-
-function parse_BIFF2NUM(blob, length, opts) {
- var cell = parse_XLSCell(blob, 6);
- ++blob.l;
- var num = parse_Xnum(blob, 8);
- cell.val = num;
- return cell;
-}
-
-/* 18.4.1 charset to codepage mapping */
-var CS2CP = {
- 0: 1252, /* ANSI */
- 1: 65001, /* DEFAULT */
- 2: 65001, /* SYMBOL */
- 77: 10000, /* MAC */
- 128: 932, /* SHIFTJIS */
- 129: 949, /* HANGUL */
- 130: 1361, /* JOHAB */
- 134: 936, /* GB2312 */
- 136: 950, /* CHINESEBIG5 */
- 161: 1253, /* GREEK */
- 162: 1254, /* TURKISH */
- 163: 1258, /* VIETNAMESE */
- 177: 1255, /* HEBREW */
- 178: 1256, /* ARABIC */
- 186: 1257, /* BALTIC */
- 204: 1251, /* RUSSIAN */
- 222: 874, /* THAI */
- 238: 1250, /* EASTEUROPE */
- 255: 1252, /* OEM */
- 69: 6969 /* MISC */
-};
-
-/* Parse a list of tags */
-var parse_rs = (function parse_rs_factory() {
- var tregex = matchtag("t"), rpregex = matchtag("rPr"), rregex = //g, rend = /<\/r>/, nlregex = /\r\n/g;
- /* 18.4.7 rPr CT_RPrElt */
- var parse_rpr = function parse_rpr(rpr, intro, outro) {
- var font = {}, cp = 65001;
- var m = rpr.match(tagregex), i = 0;
- if(m) for(;i!=m.length; ++i) {
- var y = parsexmltag(m[i]);
- switch(y[0]) {
- /* 18.8.12 condense CT_BooleanProperty */
- /* ** not required . */
- case '': break;
-
- /* 18.4.1 charset CT_IntProperty TODO */
- case '': break;
-
- /* 18.4.5 rFont CT_FontName */
- case '': font.strike = 1; break;
- case '': break;
-
- /* 18.4.13 u CT_UnderlineProperty */
- case '': font.u = 1; break;
- case '': break;
-
- /* 18.8.2 b */
- case '': font.b = 1; break;
- case '': break;
-
- /* 18.8.26 i */
- case '': font.i = 1; break;
- case '': break;
-
- /* 18.3.1.15 color CT_Color TODO: tint, theme, auto, indexed */
- case '');
- outro.push("");
- return cp;
- };
-
- /* 18.4.4 r CT_RElt */
- function parse_r(r) {
- var terms = [[],"",[]];
- /* 18.4.12 t ST_Xstring */
- var t = r.match(tregex), cp = 65001;
- if(!isval(t)) return "";
- terms[1] = t[1];
-
- var rpr = r.match(rpregex);
- if(isval(rpr)) cp = parse_rpr(rpr[1], terms[0], terms[2]);
-
- return terms[0].join("") + terms[1].replace(nlregex,'
') + terms[2].join("");
- }
- return function parse_rs(rs) {
- return rs.replace(rregex,"").split(rend).map(parse_r).join("");
- };
-})();
-
-/* 18.4.8 si CT_Rst */
-var sitregex = /]*>([^<]*)<\/t>/g, sirregex = //;
-function parse_si(x, opts) {
- var html = opts ? opts.cellHTML : true;
- var z = {};
- if(!x) return null;
- var y;
- /* 18.4.12 t ST_Xstring (Plaintext String) */
- if(x.charCodeAt(1) === 116) {
- z.t = utf8read(unescapexml(x.substr(x.indexOf(">")+1).split(/<\/t>/)[0]));
- z.r = x;
- if(html) z.h = z.t;
- }
- /* 18.4.4 r CT_RElt (Rich Text Run) */
- else if((y = x.match(sirregex))) {
- z.r = x;
- z.t = utf8read(unescapexml(x.match(sitregex).join("").replace(tagregex,"")));
- if(html) z.h = parse_rs(x);
- }
- /* 18.4.3 phoneticPr CT_PhoneticPr (TODO: needed for Asian support) */
- /* 18.4.6 rPh CT_PhoneticRun (TODO: needed for Asian support) */
- return z;
-}
-
-/* 18.4 Shared String Table */
-var sstr0 = /]*)>([\s\S]*)<\/sst>/;
-var sstr1 = /<(?:si|sstItem)>/g;
-var sstr2 = /<\/(?:si|sstItem)>/;
-function parse_sst_xml(data, opts) {
- var s = [], ss;
- /* 18.4.9 sst CT_Sst */
- var sst = data.match(sstr0);
- if(isval(sst)) {
- ss = sst[2].replace(sstr1,"").split(sstr2);
- for(var i = 0; i != ss.length; ++i) {
- var o = parse_si(ss[i], opts);
- if(o != null) s[s.length] = o;
- }
- sst = parsexmltag(sst[1]); s.Count = sst.count; s.Unique = sst.uniqueCount;
- }
- return s;
-}
-
-RELS.SST = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings";
-var straywsregex = /^\s|\s$|[\t\n\r]/;
-function write_sst_xml(sst, opts) {
- if(!opts.bookSST) return "";
- var o = [XML_HEADER];
- o[o.length] = (writextag('sst', null, {
- xmlns: XMLNS.main[0],
- count: sst.Count,
- uniqueCount: sst.Unique
- }));
- for(var i = 0; i != sst.length; ++i) { if(sst[i] == null) continue;
- var s = sst[i];
- var sitag = "";
- if(s.r) sitag += s.r;
- else {
- sitag += "" + escapexml(s.t) + "";
- }
- sitag += "";
- o[o.length] = (sitag);
- }
- if(o.length>2){ o[o.length] = (''); o[1]=o[1].replace("/>",">"); }
- return o.join("");
-}
-/* [MS-XLSB] 2.4.219 BrtBeginSst */
-function parse_BrtBeginSst(data, length) {
- return [data.read_shift(4), data.read_shift(4)];
-}
-
-/* [MS-XLSB] 2.1.7.45 Shared Strings */
-function parse_sst_bin(data, opts) {
- var s = [];
- var pass = false;
- recordhopper(data, function hopper_sst(val, R, RT) {
- switch(R.n) {
- case 'BrtBeginSst': s.Count = val[0]; s.Unique = val[1]; break;
- case 'BrtSSTItem': s.push(val); break;
- case 'BrtEndSst': return true;
- /* TODO: produce a test case with a future record */
- case 'BrtFRTBegin': pass = true; break;
- case 'BrtFRTEnd': pass = false; break;
- default: if(!pass || opts.WTF) throw new Error("Unexpected record " + RT + " " + R.n);
- }
- });
- return s;
-}
-
-function write_BrtBeginSst(sst, o) {
- if(!o) o = new_buf(8);
- o.write_shift(4, sst.Count);
- o.write_shift(4, sst.Unique);
- return o;
-}
-
-var write_BrtSSTItem = write_RichStr;
-
-function write_sst_bin(sst, opts) {
- var ba = buf_array();
- write_record(ba, "BrtBeginSst", write_BrtBeginSst(sst));
- for(var i = 0; i < sst.length; ++i) write_record(ba, "BrtSSTItem", write_BrtSSTItem(sst[i]));
- write_record(ba, "BrtEndSst");
- return ba.end();
-}
-function _JS2ANSI(str) { if(typeof cptable !== 'undefined') return cptable.utils.encode(1252, str); return str.split("").map(function(x) { return x.charCodeAt(0); }); }
-
-/* [MS-OFFCRYPTO] 2.1.4 Version */
-function parse_Version(blob, length) {
- var o = {};
- o.Major = blob.read_shift(2);
- o.Minor = blob.read_shift(2);
- return o;
-}
-/* [MS-OFFCRYPTO] 2.3.2 Encryption Header */
-function parse_EncryptionHeader(blob, length) {
- var o = {};
- o.Flags = blob.read_shift(4);
-
- // Check if SizeExtra is 0x00000000
- var tmp = blob.read_shift(4);
- if(tmp !== 0) throw 'Unrecognized SizeExtra: ' + tmp;
-
- o.AlgID = blob.read_shift(4);
- switch(o.AlgID) {
- case 0: case 0x6801: case 0x660E: case 0x660F: case 0x6610: break;
- default: throw 'Unrecognized encryption algorithm: ' + o.AlgID;
- }
- parsenoop(blob, length-12);
- return o;
-}
-
-/* [MS-OFFCRYPTO] 2.3.3 Encryption Verifier */
-function parse_EncryptionVerifier(blob, length) {
- return parsenoop(blob, length);
-}
-/* [MS-OFFCRYPTO] 2.3.5.1 RC4 CryptoAPI Encryption Header */
-function parse_RC4CryptoHeader(blob, length) {
- var o = {};
- var vers = o.EncryptionVersionInfo = parse_Version(blob, 4); length -= 4;
- if(vers.Minor != 2) throw 'unrecognized minor version code: ' + vers.Minor;
- if(vers.Major > 4 || vers.Major < 2) throw 'unrecognized major version code: ' + vers.Major;
- o.Flags = blob.read_shift(4); length -= 4;
- var sz = blob.read_shift(4); length -= 4;
- o.EncryptionHeader = parse_EncryptionHeader(blob, sz); length -= sz;
- o.EncryptionVerifier = parse_EncryptionVerifier(blob, length);
- return o;
-}
-/* [MS-OFFCRYPTO] 2.3.6.1 RC4 Encryption Header */
-function parse_RC4Header(blob, length) {
- var o = {};
- var vers = o.EncryptionVersionInfo = parse_Version(blob, 4); length -= 4;
- if(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;
- o.Salt = blob.read_shift(16);
- o.EncryptedVerifier = blob.read_shift(16);
- o.EncryptedVerifierHash = blob.read_shift(16);
- return o;
-}
-
-/* [MS-OFFCRYPTO] 2.3.7.1 Binary Document Password Verifier Derivation */
-function crypto_CreatePasswordVerifier_Method1(Password) {
- var Verifier = 0x0000, PasswordArray;
- var PasswordDecoded = _JS2ANSI(Password);
- var len = PasswordDecoded.length + 1, i, PasswordByte;
- var Intermediate1, Intermediate2, Intermediate3;
- PasswordArray = new_raw_buf(len);
- PasswordArray[0] = PasswordDecoded.length;
- for(i = 1; i != len; ++i) PasswordArray[i] = PasswordDecoded[i-1];
- for(i = len-1; i >= 0; --i) {
- PasswordByte = PasswordArray[i];
- Intermediate1 = ((Verifier & 0x4000) === 0x0000) ? 0 : 1;
- Intermediate2 = (Verifier << 1) & 0x7FFF;
- Intermediate3 = Intermediate1 | Intermediate2;
- Verifier = Intermediate3 ^ PasswordByte;
- }
- return Verifier ^ 0xCE4B;
-}
-
-/* [MS-OFFCRYPTO] 2.3.7.2 Binary Document XOR Array Initialization */
-var crypto_CreateXorArray_Method1 = (function() {
- var PadArray = [0xBB, 0xFF, 0xFF, 0xBA, 0xFF, 0xFF, 0xB9, 0x80, 0x00, 0xBE, 0x0F, 0x00, 0xBF, 0x0F, 0x00];
- var InitialCode = [0xE1F0, 0x1D0F, 0xCC9C, 0x84C0, 0x110C, 0x0E10, 0xF1CE, 0x313E, 0x1872, 0xE139, 0xD40F, 0x84F9, 0x280C, 0xA96A, 0x4EC3];
- var XorMatrix = [0xAEFC, 0x4DD9, 0x9BB2, 0x2745, 0x4E8A, 0x9D14, 0x2A09, 0x7B61, 0xF6C2, 0xFDA5, 0xEB6B, 0xC6F7, 0x9DCF, 0x2BBF, 0x4563, 0x8AC6, 0x05AD, 0x0B5A, 0x16B4, 0x2D68, 0x5AD0, 0x0375, 0x06EA, 0x0DD4, 0x1BA8, 0x3750, 0x6EA0, 0xDD40, 0xD849, 0xA0B3, 0x5147, 0xA28E, 0x553D, 0xAA7A, 0x44D5, 0x6F45, 0xDE8A, 0xAD35, 0x4A4B, 0x9496, 0x390D, 0x721A, 0xEB23, 0xC667, 0x9CEF, 0x29FF, 0x53FE, 0xA7FC, 0x5FD9, 0x47D3, 0x8FA6, 0x0F6D, 0x1EDA, 0x3DB4, 0x7B68, 0xF6D0, 0xB861, 0x60E3, 0xC1C6, 0x93AD, 0x377B, 0x6EF6, 0xDDEC, 0x45A0, 0x8B40, 0x06A1, 0x0D42, 0x1A84, 0x3508, 0x6A10, 0xAA51, 0x4483, 0x8906, 0x022D, 0x045A, 0x08B4, 0x1168, 0x76B4, 0xED68, 0xCAF1, 0x85C3, 0x1BA7, 0x374E, 0x6E9C, 0x3730, 0x6E60, 0xDCC0, 0xA9A1, 0x4363, 0x86C6, 0x1DAD, 0x3331, 0x6662, 0xCCC4, 0x89A9, 0x0373, 0x06E6, 0x0DCC, 0x1021, 0x2042, 0x4084, 0x8108, 0x1231, 0x2462, 0x48C4];
- var Ror = function(Byte) { return ((Byte/2) | (Byte*128)) & 0xFF; };
- var XorRor = function(byte1, byte2) { return Ror(byte1 ^ byte2); };
- var CreateXorKey_Method1 = function(Password) {
- var XorKey = InitialCode[Password.length - 1];
- var CurrentElement = 0x68;
- for(var i = Password.length-1; i >= 0; --i) {
- var Char = Password[i];
- for(var j = 0; j != 7; ++j) {
- if(Char & 0x40) XorKey ^= XorMatrix[CurrentElement];
- Char *= 2; --CurrentElement;
- }
- }
- return XorKey;
- };
- return function(password) {
- var Password = _JS2ANSI(password);
- var XorKey = CreateXorKey_Method1(Password);
- var Index = Password.length;
- var ObfuscationArray = new_raw_buf(16);
- for(var i = 0; i != 16; ++i) ObfuscationArray[i] = 0x00;
- var Temp, PasswordLastChar, PadIndex;
- if((Index & 1) === 1) {
- Temp = XorKey >> 8;
- ObfuscationArray[Index] = XorRor(PadArray[0], Temp);
- --Index;
- Temp = XorKey & 0xFF;
- PasswordLastChar = Password[Password.length - 1];
- ObfuscationArray[Index] = XorRor(PasswordLastChar, Temp);
- }
- while(Index > 0) {
- --Index;
- Temp = XorKey >> 8;
- ObfuscationArray[Index] = XorRor(Password[Index], Temp);
- --Index;
- Temp = XorKey & 0xFF;
- ObfuscationArray[Index] = XorRor(Password[Index], Temp);
- }
- Index = 15;
- PadIndex = 15 - Password.length;
- while(PadIndex > 0) {
- Temp = XorKey >> 8;
- ObfuscationArray[Index] = XorRor(PadArray[PadIndex], Temp);
- --Index;
- --PadIndex;
- Temp = XorKey & 0xFF;
- ObfuscationArray[Index] = XorRor(Password[Index], Temp);
- --Index;
- --PadIndex;
- }
- return ObfuscationArray;
- };
-})();
-
-/* [MS-OFFCRYPTO] 2.3.7.3 Binary Document XOR Data Transformation Method 1 */
-var crypto_DecryptData_Method1 = function(password, Data, XorArrayIndex, XorArray, O) {
- /* If XorArray is set, use it; if O is not set, make changes in-place */
- if(!O) O = Data;
- if(!XorArray) XorArray = crypto_CreateXorArray_Method1(password);
- var Index, Value;
- for(Index = 0; Index != Data.length; ++Index) {
- Value = Data[Index];
- Value ^= XorArray[XorArrayIndex];
- Value = ((Value>>5) | (Value<<3)) & 0xFF;
- O[Index] = Value;
- ++XorArrayIndex;
- }
- return [O, XorArrayIndex, XorArray];
-};
-
-var crypto_MakeXorDecryptor = function(password) {
- var XorArrayIndex = 0, XorArray = crypto_CreateXorArray_Method1(password);
- return function(Data) {
- var O = crypto_DecryptData_Method1(null, Data, XorArrayIndex, XorArray);
- XorArrayIndex = O[1];
- return O[0];
- };
-};
-
-/* 2.5.343 */
-function parse_XORObfuscation(blob, length, opts, out) {
- var o = { key: parseuint16(blob), verificationBytes: parseuint16(blob) };
- if(opts.password) o.verifier = crypto_CreatePasswordVerifier_Method1(opts.password);
- out.valid = o.verificationBytes === o.verifier;
- if(out.valid) out.insitu_decrypt = crypto_MakeXorDecryptor(opts.password);
- return o;
-}
-
-/* 2.4.117 */
-function parse_FilePassHeader(blob, length, oo) {
- var o = oo || {}; o.Info = blob.read_shift(2); blob.l -= 2;
- if(o.Info === 1) o.Data = parse_RC4Header(blob, length);
- else o.Data = parse_RC4CryptoHeader(blob, length);
- return o;
-}
-function parse_FilePass(blob, length, opts) {
- var o = { Type: blob.read_shift(2) }; /* wEncryptionType */
- if(o.Type) parse_FilePassHeader(blob, length-2, o);
- else parse_XORObfuscation(blob, length-2, opts, o);
- return o;
-}
-
-
-function hex2RGB(h) {
- var o = h.substr(h[0]==="#"?1:0,6);
- return [parseInt(o.substr(0,2),16),parseInt(o.substr(0,2),16),parseInt(o.substr(0,2),16)];
-}
-function rgb2Hex(rgb) {
- for(var i=0,o=1; i!=3; ++i) o = o*256 + (rgb[i]>255?255:rgb[i]<0?0:rgb[i]);
- return o.toString(16).toUpperCase().substr(1);
-}
-
-function rgb2HSL(rgb) {
- var R = rgb[0]/255, G = rgb[1]/255, B=rgb[2]/255;
- var M = Math.max(R, G, B), m = Math.min(R, G, B), C = M - m;
- if(C === 0) return [0, 0, R];
-
- var H6 = 0, S = 0, L2 = (M + m);
- S = C / (L2 > 1 ? 2 - L2 : L2);
- switch(M){
- case R: H6 = ((G - B) / C + 6)%6; break;
- case G: H6 = ((B - R) / C + 2); break;
- case B: H6 = ((R - G) / C + 4); break;
- }
- return [H6 / 6, S, L2 / 2];
-}
-
-function hsl2RGB(hsl){
- var H = hsl[0], S = hsl[1], L = hsl[2];
- var C = S * 2 * (L < 0.5 ? L : 1 - L), m = L - C/2;
- var rgb = [m,m,m], h6 = 6*H;
-
- var X;
- if(S !== 0) switch(h6|0) {
- case 0: case 6: X = C * h6; rgb[0] += C; rgb[1] += X; break;
- case 1: X = C * (2 - h6); rgb[0] += X; rgb[1] += C; break;
- case 2: X = C * (h6 - 2); rgb[1] += C; rgb[2] += X; break;
- case 3: X = C * (4 - h6); rgb[1] += X; rgb[2] += C; break;
- case 4: X = C * (h6 - 4); rgb[2] += C; rgb[0] += X; break;
- case 5: X = C * (6 - h6); rgb[2] += X; rgb[0] += C; break;
- }
- for(var i = 0; i != 3; ++i) rgb[i] = Math.round(rgb[i]*255);
- return rgb;
-}
-
-/* 18.8.3 bgColor tint algorithm */
-function rgb_tint(hex, tint) {
- if(tint === 0) return hex;
- var hsl = rgb2HSL(hex2RGB(hex));
- if (tint < 0) hsl[2] = hsl[2] * (1 + tint);
- else hsl[2] = 1 - (1 - hsl[2]) * (1 - tint);
- return rgb2Hex(hsl2RGB(hsl));
-}
-
-/* 18.3.1.13 width calculations */
-var DEF_MDW = 7, MAX_MDW = 15, MIN_MDW = 1, MDW = DEF_MDW;
-function width2px(width) { return (( width + ((128/MDW)|0)/256 )* MDW )|0; }
-function px2char(px) { return (((px - 5)/MDW * 100 + 0.5)|0)/100; }
-function char2width(chr) { return (((chr * MDW + 5)/MDW*256)|0)/256; }
-function cycle_width(collw) { return char2width(px2char(width2px(collw))); }
-function find_mdw(collw, coll) {
- if(cycle_width(collw) != collw) {
- for(MDW=DEF_MDW; MDW>MIN_MDW; --MDW) if(cycle_width(collw) === collw) break;
- if(MDW === MIN_MDW) for(MDW=DEF_MDW+1; MDW': case '': break;
-
- /* 18.8.20 fill CT_Fill */
- case '': break;
- case '': styles.Fills.push(fill); fill = {}; break;
-
- /* 18.8.32 patternFill CT_PatternFill */
- case '': case '': break;
-
- /* 18.8.3 bgColor CT_Color */
- case '': case '': break;
-
- /* 18.8.19 fgColor CT_Color */
- case '': case '': break;
-
- default: if(opts.WTF) throw 'unrecognized ' + y[0] + ' in fills';
- }
- });
-}
-
-/* 18.8.31 numFmts CT_NumFmts */
-function parse_numFmts(t, opts) {
- styles.NumberFmt = [];
- var k = keys(SSF._table);
- for(var i=0; i < k.length; ++i) styles.NumberFmt[k[i]] = SSF._table[k[i]];
- var m = t[0].match(tagregex);
- for(i=0; i < m.length; ++i) {
- var y = parsexmltag(m[i]);
- switch(y[0]) {
- case '': case '': case '': break;
- case '0) SSF.load(f,j);
- } break;
- default: if(opts.WTF) throw 'unrecognized ' + y[0] + ' in numFmts';
- }
- }
-}
-
-function write_numFmts(NF, opts) {
- var o = [""];
- [[5,8],[23,26],[41,44],[63,66],[164,392]].forEach(function(r) {
- for(var i = r[0]; i <= r[1]; ++i) if(NF[i] !== undefined) o[o.length] = (writextag('numFmt',null,{numFmtId:i,formatCode:escapexml(NF[i])}));
- });
- if(o.length === 1) return "";
- o[o.length] = ("");
- o[0] = writextag('numFmts', null, { count:o.length-2 }).replace("/>", ">");
- return o.join("");
-}
-
-/* 18.8.10 cellXfs CT_CellXfs */
-function parse_cellXfs(t, opts) {
- styles.CellXf = [];
- t[0].match(tagregex).forEach(function(x) {
- var y = parsexmltag(x);
- switch(y[0]) {
- case '': case '': case '': break;
-
- /* 18.8.45 xf CT_Xf */
- case '': break;
-
- /* 18.8.1 alignment CT_CellAlignment */
- case '': break;
-
- /* 18.8.33 protection CT_CellProtection */
- case '': case '': break;
-
- case '': break;
- case '");
- if(o.length === 2) return "";
- o[0] = writextag('cellXfs',null, {count:o.length-2}).replace("/>",">");
- return o.join("");
-}
-
-/* 18.8 Styles CT_Stylesheet*/
-var parse_sty_xml= (function make_pstyx() {
-var numFmtRegex = /]*)>.*<\/numFmts>/;
-var cellXfRegex = /]*)>.*<\/cellXfs>/;
-var fillsRegex = /]*)>.*<\/fills>/;
-
-return function parse_sty_xml(data, opts) {
- /* 18.8.39 styleSheet CT_Stylesheet */
- var t;
-
- /* numFmts CT_NumFmts ? */
- if((t=data.match(numFmtRegex))) parse_numFmts(t, opts);
-
- /* fonts CT_Fonts ? */
- /*if((t=data.match(/]*)>.*<\/fonts>/))) parse_fonts(t, opts);*/
-
- /* fills CT_Fills */
- if((t=data.match(fillsRegex))) parse_fills(t, opts);
-
- /* borders CT_Borders ? */
- /* cellStyleXfs CT_CellStyleXfs ? */
-
- /* cellXfs CT_CellXfs ? */
- if((t=data.match(cellXfRegex))) parse_cellXfs(t, opts);
-
- /* dxfs CT_Dxfs ? */
- /* tableStyles CT_TableStyles ? */
- /* colors CT_Colors ? */
- /* extLst CT_ExtensionList ? */
-
- return styles;
-};
-})();
-
-var STYLES_XML_ROOT = writextag('styleSheet', null, {
- 'xmlns': XMLNS.main[0],
- 'xmlns:vt': XMLNS.vt
-});
-
-RELS.STY = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles";
-
-function write_sty_xml(wb, opts) {
- var o = [XML_HEADER, STYLES_XML_ROOT], w;
- if((w = write_numFmts(wb.SSF)) != null) o[o.length] = w;
- o[o.length] = ('');
- o[o.length] = ('');
- o[o.length] = ('');
- o[o.length] = ('');
- if((w = write_cellXfs(opts.cellXfs))) o[o.length] = (w);
- o[o.length] = ('');
- o[o.length] = ('');
- o[o.length] = ('');
-
- if(o.length>2){ o[o.length] = (''); o[1]=o[1].replace("/>",">"); }
- return o.join("");
-}
-/* [MS-XLSB] 2.4.651 BrtFmt */
-function parse_BrtFmt(data, length) {
- var ifmt = data.read_shift(2);
- var stFmtCode = parse_XLWideString(data,length-2);
- return [ifmt, stFmtCode];
-}
-
-/* [MS-XLSB] 2.4.653 BrtFont TODO */
-function parse_BrtFont(data, length) {
- var out = {flags:{}};
- out.dyHeight = data.read_shift(2);
- out.grbit = parse_FontFlags(data, 2);
- out.bls = data.read_shift(2);
- out.sss = data.read_shift(2);
- out.uls = data.read_shift(1);
- out.bFamily = data.read_shift(1);
- out.bCharSet = data.read_shift(1);
- data.l++;
- out.brtColor = parse_BrtColor(data, 8);
- out.bFontScheme = data.read_shift(1);
- out.name = parse_XLWideString(data, length - 21);
-
- out.flags.Bold = out.bls === 0x02BC;
- out.flags.Italic = out.grbit.fItalic;
- out.flags.Strikeout = out.grbit.fStrikeout;
- out.flags.Outline = out.grbit.fOutline;
- out.flags.Shadow = out.grbit.fShadow;
- out.flags.Condense = out.grbit.fCondense;
- out.flags.Extend = out.grbit.fExtend;
- out.flags.Sub = out.sss & 0x2;
- out.flags.Sup = out.sss & 0x1;
- return out;
-}
-
-/* [MS-XLSB] 2.4.816 BrtXF */
-function parse_BrtXF(data, length) {
- var ixfeParent = data.read_shift(2);
- var ifmt = data.read_shift(2);
- parsenoop(data, length-4);
- return {ixfe:ixfeParent, ifmt:ifmt };
-}
-
-/* [MS-XLSB] 2.1.7.50 Styles */
-function parse_sty_bin(data, opts) {
- styles.NumberFmt = [];
- for(var y in SSF._table) styles.NumberFmt[y] = SSF._table[y];
-
- styles.CellXf = [];
- var state = ""; /* TODO: this should be a stack */
- var pass = false;
- recordhopper(data, function hopper_sty(val, R, RT) {
- switch(R.n) {
- case 'BrtFmt':
- styles.NumberFmt[val[0]] = val[1]; SSF.load(val[1], val[0]);
- break;
- case 'BrtFont': break; /* TODO */
- case 'BrtKnownFonts': break; /* TODO */
- case 'BrtFill': break; /* TODO */
- case 'BrtBorder': break; /* TODO */
- case 'BrtXF':
- if(state === "CELLXFS") {
- styles.CellXf.push(val);
- }
- break; /* TODO */
- case 'BrtStyle': break; /* TODO */
- case 'BrtDXF': break; /* TODO */
- case 'BrtMRUColor': break; /* TODO */
- case 'BrtIndexedColor': break; /* TODO */
- case 'BrtBeginStyleSheet': break;
- case 'BrtEndStyleSheet': break;
- case 'BrtBeginTableStyle': break;
- case 'BrtTableStyleElement': break;
- case 'BrtEndTableStyle': break;
- case 'BrtBeginFmts': state = "FMTS"; break;
- case 'BrtEndFmts': state = ""; break;
- case 'BrtBeginFonts': state = "FONTS"; break;
- case 'BrtEndFonts': state = ""; break;
- case 'BrtACBegin': state = "ACFONTS"; break;
- case 'BrtACEnd': state = ""; break;
- case 'BrtBeginFills': state = "FILLS"; break;
- case 'BrtEndFills': state = ""; break;
- case 'BrtBeginBorders': state = "BORDERS"; break;
- case 'BrtEndBorders': state = ""; break;
- case 'BrtBeginCellStyleXFs': state = "CELLSTYLEXFS"; break;
- case 'BrtEndCellStyleXFs': state = ""; break;
- case 'BrtBeginCellXFs': state = "CELLXFS"; break;
- case 'BrtEndCellXFs': state = ""; break;
- case 'BrtBeginStyles': state = "STYLES"; break;
- case 'BrtEndStyles': state = ""; break;
- case 'BrtBeginDXFs': state = "DXFS"; break;
- case 'BrtEndDXFs': state = ""; break;
- case 'BrtBeginTableStyles': state = "TABLESTYLES"; break;
- case 'BrtEndTableStyles': state = ""; break;
- case 'BrtBeginColorPalette': state = "COLORPALETTE"; break;
- case 'BrtEndColorPalette': state = ""; break;
- case 'BrtBeginIndexedColors': state = "INDEXEDCOLORS"; break;
- case 'BrtEndIndexedColors': state = ""; break;
- case 'BrtBeginMRUColors': state = "MRUCOLORS"; break;
- case 'BrtEndMRUColors': state = ""; break;
- case 'BrtFRTBegin': pass = true; break;
- case 'BrtFRTEnd': pass = false; break;
- case 'BrtBeginStyleSheetExt14': break;
- case 'BrtBeginSlicerStyles': break;
- case 'BrtEndSlicerStyles': break;
- case 'BrtBeginTimelineStylesheetExt15': break;
- case 'BrtEndTimelineStylesheetExt15': break;
- case 'BrtBeginTimelineStyles': break;
- case 'BrtEndTimelineStyles': break;
- case 'BrtEndStyleSheetExt14': break;
- default: if(!pass || opts.WTF) throw new Error("Unexpected record " + RT + " " + R.n);
- }
- });
- return styles;
-}
-
-/* [MS-XLSB] 2.1.7.50 Styles */
-function write_sty_bin(data, opts) {
- var ba = buf_array();
- write_record(ba, "BrtBeginStyleSheet");
- /* [FMTS] */
- /* [FONTS] */
- /* [FILLS] */
- /* [BORDERS] */
- /* CELLSTYLEXFS */
- /* CELLXFS*/
- /* STYLES */
- /* DXFS */
- /* TABLESTYLES */
- /* [COLORPALETTE] */
- /* FRTSTYLESHEET*/
- write_record(ba, "BrtEndStyleSheet");
- return ba.end();
-}
-RELS.THEME = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";
-
-/* 20.1.6.2 clrScheme CT_ColorScheme */
-function parse_clrScheme(t, opts) {
- themes.themeElements.clrScheme = [];
- var color = {};
- t[0].match(tagregex).forEach(function(x) {
- var y = parsexmltag(x);
- switch(y[0]) {
- case '': break;
-
- /* 20.1.2.3.32 srgbClr CT_SRgbColor */
- case '':
- case '':
- /* 20.1.4.1.10 dk2 (Dark 2) */
- case '':
- case '':
- /* 20.1.4.1.22 lt1 (Light 1) */
- case '':
- case '':
- /* 20.1.4.1.23 lt2 (Light 2) */
- case '':
- case '':
- /* 20.1.4.1.1 accent1 (Accent 1) */
- case '':
- case '':
- /* 20.1.4.1.2 accent2 (Accent 2) */
- case '':
- case '':
- /* 20.1.4.1.3 accent3 (Accent 3) */
- case '':
- case '':
- /* 20.1.4.1.4 accent4 (Accent 4) */
- case '':
- case '':
- /* 20.1.4.1.5 accent5 (Accent 5) */
- case '':
- case '':
- /* 20.1.4.1.6 accent6 (Accent 6) */
- case '':
- case '':
- /* 20.1.4.1.19 hlink (Hyperlink) */
- case '':
- case '':
- /* 20.1.4.1.15 folHlink (Followed Hyperlink) */
- case '':
- case '':
- if (y[0][1] === '/') {
- themes.themeElements.clrScheme.push(color);
- color = {};
- } else {
- color.name = y[0].substring(3, y[0].length - 1);
- }
- break;
-
- default: if(opts.WTF) throw 'unrecognized ' + y[0] + ' in clrScheme';
- }
- });
-}
-
-/* 20.1.4.1.18 fontScheme CT_FontScheme */
-function parse_fontScheme(t, opts) { }
-
-/* 20.1.4.1.15 fmtScheme CT_StyleMatrix */
-function parse_fmtScheme(t, opts) { }
-
-var clrsregex = /]*)>[^\u2603]*<\/a:clrScheme>/;
-var fntsregex = /]*)>[^\u2603]*<\/a:fontScheme>/;
-var fmtsregex = /]*)>[^\u2603]*<\/a:fmtScheme>/;
-
-/* 20.1.6.10 themeElements CT_BaseStyles */
-function parse_themeElements(data, opts) {
- themes.themeElements = {};
-
- var t;
-
- [
- /* clrScheme CT_ColorScheme */
- ['clrScheme', clrsregex, parse_clrScheme],
- /* fontScheme CT_FontScheme */
- ['fontScheme', fntsregex, parse_fontScheme],
- /* fmtScheme CT_StyleMatrix */
- ['fmtScheme', fmtsregex, parse_fmtScheme]
- ].forEach(function(m) {
- if(!(t=data.match(m[1]))) throw m[0] + ' not found in themeElements';
- m[2](t, opts);
- });
-}
-
-var themeltregex = /]*)>[^\u2603]*<\/a:themeElements>/;
-
-/* 14.2.7 Theme Part */
-function parse_theme_xml(data, opts) {
- /* 20.1.6.9 theme CT_OfficeStyleSheet */
- if(!data || data.length === 0) return themes;
-
- var t;
-
- /* themeElements CT_BaseStyles */
- if(!(t=data.match(themeltregex))) throw 'themeElements not found in theme';
- parse_themeElements(t[0], opts);
-
- return themes;
-}
-
-function write_theme() { return '\n'; }
-/* [MS-XLS] 2.4.326 TODO: payload is a zip file */
-function parse_Theme(blob, length) {
- var dwThemeVersion = blob.read_shift(4);
- if(dwThemeVersion === 124226) return;
- blob.l += length-4;
-}
-
-/* 2.5.49 */
-function parse_ColorTheme(blob, length) { return blob.read_shift(4); }
-
-/* 2.5.155 */
-function parse_FullColorExt(blob, length) {
- var o = {};
- o.xclrType = blob.read_shift(2);
- o.nTintShade = blob.read_shift(2);
- switch(o.xclrType) {
- case 0: blob.l += 4; break;
- case 1: o.xclrValue = parse_IcvXF(blob, 4); break;
- case 2: o.xclrValue = parse_LongRGBA(blob, 4); break;
- case 3: o.xclrValue = parse_ColorTheme(blob, 4); break;
- case 4: blob.l += 4; break;
- }
- blob.l += 8;
- return o;
-}
-
-/* 2.5.164 TODO: read 7 bits*/
-function parse_IcvXF(blob, length) {
- return parsenoop(blob, length);
-}
-
-/* 2.5.280 */
-function parse_XFExtGradient(blob, length) {
- return parsenoop(blob, length);
-}
-
-/* 2.5.108 */
-function parse_ExtProp(blob, length) {
- var extType = blob.read_shift(2);
- var cb = blob.read_shift(2);
- var o = [extType];
- switch(extType) {
- case 0x04: case 0x05: case 0x07: case 0x08:
- case 0x09: case 0x0A: case 0x0B: case 0x0D:
- o[1] = parse_FullColorExt(blob, cb); break;
- case 0x06: o[1] = parse_XFExtGradient(blob, cb); break;
- case 0x0E: case 0x0F: o[1] = blob.read_shift(cb === 5 ? 1 : 2); break;
- default: throw new Error("Unrecognized ExtProp type: " + extType + " " + cb);
- }
- return o;
-}
-
-/* 2.4.355 */
-function parse_XFExt(blob, length) {
- var end = blob.l + length;
- blob.l += 2;
- var ixfe = blob.read_shift(2);
- blob.l += 2;
- var cexts = blob.read_shift(2);
- var ext = [];
- while(cexts-- > 0) ext.push(parse_ExtProp(blob, end-blob.l));
- return {ixfe:ixfe, ext:ext};
-}
-
-/* xf is an XF, see parse_XFExt for xfext */
-function update_xfext(xf, xfext) {
- xfext.forEach(function(xfe) {
- switch(xfe[0]) { /* 2.5.108 extPropData */
- case 0x04: break; /* foreground color */
- case 0x05: break; /* background color */
- case 0x07: case 0x08: case 0x09: case 0x0a: break;
- case 0x0d: break; /* text color */
- case 0x0e: break; /* font scheme */
- default: throw "bafuq" + xfe[0].toString(16);
- }
- });
-}
-
-/* 18.6 Calculation Chain */
-function parse_cc_xml(data, opts) {
- var d = [];
- var l = 0, i = 1;
- (data.match(tagregex)||[]).forEach(function(x) {
- var y = parsexmltag(x);
- switch(y[0]) {
- case '': case '': break;
- /* 18.6.1 c CT_CalcCell 1 */
- case ' thisCell.r) range.s.r = thisCell.r;
- if(range.e.r < thisCell.r) range.e.r = thisCell.r;
- if(range.s.c > thisCell.c) range.s.c = thisCell.c;
- if(range.e.c < thisCell.c) range.e.c = thisCell.c;
- var encoded = encode_range(range);
- if (encoded !== sheet["!ref"]) sheet["!ref"] = encoded;
- }
-
- if (!cell.c) cell.c = [];
- var o = {a: comment.author, t: comment.t, r: comment.r};
- if(comment.h) o.h = comment.h;
- cell.c.push(o);
- });
-}
-
-/* 18.7.3 CT_Comment */
-function parse_comments_xml(data, opts) {
- if(data.match(/<(?:\w+:)?comments *\/>/)) return [];
- var authors = [];
- var commentList = [];
- data.match(/<(?:\w+:)?authors>([^\u2603]*)<\/(?:\w+:)?authors>/)[1].split(/<\/\w*:?author>/).forEach(function(x) {
- if(x === "" || x.trim() === "") return;
- authors.push(x.match(/<(?:\w+:)?author[^>]*>(.*)/)[1]);
- });
- (data.match(/<(?:\w+:)?commentList>([^\u2603]*)<\/(?:\w+:)?commentList>/)||["",""])[1].split(/<\/\w*:?comment>/).forEach(function(x, index) {
- if(x === "" || x.trim() === "") return;
- var y = parsexmltag(x.match(/<(?:\w+:)?comment[^>]*>/)[0]);
- var comment = { author: y.authorId && authors[y.authorId] ? authors[y.authorId] : undefined, ref: y.ref, guid: y.guid };
- var cell = decode_cell(y.ref);
- if(opts.sheetRows && opts.sheetRows <= cell.r) return;
- var textMatch = x.match(/([^\u2603]*)<\/text>/);
- if (!textMatch || !textMatch[1]) return; // a comment may contain an empty text tag.
- var rt = parse_si(textMatch[1]);
- comment.r = rt.r;
- comment.t = rt.t;
- if(opts.cellHTML) comment.h = rt.h;
- commentList.push(comment);
- });
- return commentList;
-}
-
-function write_comments_xml(data, opts) { }
-/* [MS-XLSB] 2.4.28 BrtBeginComment */
-function parse_BrtBeginComment(data, length) {
- var out = {};
- out.iauthor = data.read_shift(4);
- var rfx = parse_UncheckedRfX(data, 16);
- out.rfx = rfx.s;
- out.ref = encode_cell(rfx.s);
- data.l += 16; /*var guid = parse_GUID(data); */
- return out;
-}
-
-/* [MS-XLSB] 2.4.324 BrtCommentAuthor */
-var parse_BrtCommentAuthor = parse_XLWideString;
-
-/* [MS-XLSB] 2.4.325 BrtCommentText */
-var parse_BrtCommentText = parse_RichStr;
-
-/* [MS-XLSB] 2.1.7.8 Comments */
-function parse_comments_bin(data, opts) {
- var out = [];
- var authors = [];
- var c = {};
- var pass = false;
- recordhopper(data, function hopper_cmnt(val, R, RT) {
- switch(R.n) {
- case 'BrtCommentAuthor': authors.push(val); break;
- case 'BrtBeginComment': c = val; break;
- case 'BrtCommentText': c.t = val.t; c.h = val.h; c.r = val.r; break;
- case 'BrtEndComment':
- c.author = authors[c.iauthor];
- delete c.iauthor;
- if(opts.sheetRows && opts.sheetRows <= c.rfx.r) break;
- delete c.rfx; out.push(c); break;
- case 'BrtBeginComments': break;
- case 'BrtEndComments': break;
- case 'BrtBeginCommentAuthors': break;
- case 'BrtEndCommentAuthors': break;
- case 'BrtBeginCommentList': break;
- case 'BrtEndCommentList': break;
- default: if(!pass || opts.WTF) throw new Error("Unexpected record " + RT + " " + R.n);
- }
- });
- return out;
-}
-
-function write_comments_bin(data, opts) { }
-/* TODO: it will be useful to parse the function str */
-var rc_to_a1 = (function(){
- var rcregex = /(^|[^A-Za-z])R(\[?)(-?\d+|)\]?C(\[?)(-?\d+|)\]?/g;
- var rcbase;
- function rcfunc($$,$1,$2,$3,$4,$5) {
- var R = $3.length>0?parseInt($3,10)|0:0, C = $5.length>0?parseInt($5,10)|0:0;
- if(C<0 && $4.length === 0) C=0;
- if($4.length > 0) C += rcbase.c;
- if($2.length > 0) R += rcbase.r;
- return $1 + encode_col(C) + encode_row(R);
- }
- return function rc_to_a1(fstr, base) {
- rcbase = base;
- return fstr.replace(rcregex, rcfunc);
- };
-})();
-
-/* --- formula references point to MS-XLS --- */
-/* Small helpers */
-function parseread(l) { return function(blob, length) { blob.l+=l; return; }; }
-function parseread1(blob, length) { blob.l+=1; return; }
-
-/* Rgce Helpers */
-
-/* 2.5.51 */
-function parse_ColRelU(blob, length) {
- var c = blob.read_shift(2);
- return [c & 0x3FFF, (c >> 14) & 1, (c >> 15) & 1];
-}
-
-/* 2.5.198.105 */
-function parse_RgceArea(blob, length) {
- var r=blob.read_shift(2), R=blob.read_shift(2);
- var c=parse_ColRelU(blob, 2);
- var C=parse_ColRelU(blob, 2);
- return { s:{r:r, c:c[0], cRel:c[1], rRel:c[2]}, e:{r:R, c:C[0], cRel:C[1], rRel:C[2]} };
-}
-
-/* 2.5.198.105 TODO */
-function parse_RgceAreaRel(blob, length) {
- var r=blob.read_shift(2), R=blob.read_shift(2);
- var c=parse_ColRelU(blob, 2);
- var C=parse_ColRelU(blob, 2);
- return { s:{r:r, c:c[0], cRel:c[1], rRel:c[2]}, e:{r:R, c:C[0], cRel:C[1], rRel:C[2]} };
-}
-
-/* 2.5.198.109 */
-function parse_RgceLoc(blob, length) {
- var r = blob.read_shift(2);
- var c = parse_ColRelU(blob, 2);
- return {r:r, c:c[0], cRel:c[1], rRel:c[2]};
-}
-
-/* 2.5.198.111 */
-function parse_RgceLocRel(blob, length) {
- var r = blob.read_shift(2);
- var cl = blob.read_shift(2);
- var cRel = (cl & 0x8000) >> 15, rRel = (cl & 0x4000) >> 14;
- cl &= 0x3FFF;
- if(cRel !== 0) while(cl >= 0x100) cl -= 0x100;
- return {r:r,c:cl,cRel:cRel,rRel:rRel};
-}
-
-/* Ptg Tokens */
-
-/* 2.5.198.27 */
-function parse_PtgArea(blob, length) {
- var type = (blob[blob.l++] & 0x60) >> 5;
- var area = parse_RgceArea(blob, 8);
- return [type, area];
-}
-
-/* 2.5.198.28 */
-function parse_PtgArea3d(blob, length) {
- var type = (blob[blob.l++] & 0x60) >> 5;
- var ixti = blob.read_shift(2);
- var area = parse_RgceArea(blob, 8);
- return [type, ixti, area];
-}
-
-/* 2.5.198.29 */
-function parse_PtgAreaErr(blob, length) {
- var type = (blob[blob.l++] & 0x60) >> 5;
- blob.l += 8;
- return [type];
-}
-/* 2.5.198.30 */
-function parse_PtgAreaErr3d(blob, length) {
- var type = (blob[blob.l++] & 0x60) >> 5;
- var ixti = blob.read_shift(2);
- blob.l += 8;
- return [type, ixti];
-}
-
-/* 2.5.198.31 */
-function parse_PtgAreaN(blob, length) {
- var type = (blob[blob.l++] & 0x60) >> 5;
- var area = parse_RgceAreaRel(blob, 8);
- return [type, area];
-}
-
-/* 2.5.198.32 -- ignore this and look in PtgExtraArray for shape + values */
-function parse_PtgArray(blob, length) {
- var type = (blob[blob.l++] & 0x60) >> 5;
- blob.l += 7;
- return [type];
-}
-
-/* 2.5.198.33 */
-function parse_PtgAttrBaxcel(blob, length) {
- var bitSemi = blob[blob.l+1] & 0x01; /* 1 = volatile */
- var bitBaxcel = 1;
- blob.l += 4;
- return [bitSemi, bitBaxcel];
-}
-
-/* 2.5.198.34 */
-function parse_PtgAttrChoose(blob, length) {
- blob.l +=2;
- var offset = blob.read_shift(2);
- var o = [];
- /* offset is 1 less than the number of elements */
- for(var i = 0; i <= offset; ++i) o.push(blob.read_shift(2));
- return o;
-}
-
-/* 2.5.198.35 */
-function parse_PtgAttrGoto(blob, length) {
- var bitGoto = (blob[blob.l+1] & 0xFF) ? 1 : 0;
- blob.l += 2;
- return [bitGoto, blob.read_shift(2)];
-}
-
-/* 2.5.198.36 */
-function parse_PtgAttrIf(blob, length) {
- var bitIf = (blob[blob.l+1] & 0xFF) ? 1 : 0;
- blob.l += 2;
- return [bitIf, blob.read_shift(2)];
-}
-
-/* 2.5.198.37 */
-function parse_PtgAttrSemi(blob, length) {
- var bitSemi = (blob[blob.l+1] & 0xFF) ? 1 : 0;
- blob.l += 4;
- return [bitSemi];
-}
-
-/* 2.5.198.40 (used by PtgAttrSpace and PtgAttrSpaceSemi) */
-function parse_PtgAttrSpaceType(blob, length) {
- var type = blob.read_shift(1), cch = blob.read_shift(1);
- return [type, cch];
-}
-
-/* 2.5.198.38 */
-function parse_PtgAttrSpace(blob, length) {
- blob.read_shift(2);
- return parse_PtgAttrSpaceType(blob, 2);
-}
-
-/* 2.5.198.39 */
-function parse_PtgAttrSpaceSemi(blob, length) {
- blob.read_shift(2);
- return parse_PtgAttrSpaceType(blob, 2);
-}
-
-/* 2.5.198.84 TODO */
-function parse_PtgRef(blob, length) {
- var ptg = blob[blob.l] & 0x1F;
- var type = (blob[blob.l] & 0x60)>>5;
- blob.l += 1;
- var loc = parse_RgceLoc(blob,4);
- return [type, loc];
-}
-
-/* 2.5.198.88 TODO */
-function parse_PtgRefN(blob, length) {
- var ptg = blob[blob.l] & 0x1F;
- var type = (blob[blob.l] & 0x60)>>5;
- blob.l += 1;
- var loc = parse_RgceLocRel(blob,4);
- return [type, loc];
-}
-
-/* 2.5.198.85 TODO */
-function parse_PtgRef3d(blob, length) {
- var ptg = blob[blob.l] & 0x1F;
- var type = (blob[blob.l] & 0x60)>>5;
- blob.l += 1;
- var ixti = blob.read_shift(2); // XtiIndex
- var loc = parse_RgceLoc(blob,4);
- return [type, ixti, loc];
-}
-
-
-/* 2.5.198.62 TODO */
-function parse_PtgFunc(blob, length) {
- var ptg = blob[blob.l] & 0x1F;
- var type = (blob[blob.l] & 0x60)>>5;
- blob.l += 1;
- var iftab = blob.read_shift(2);
- return [FtabArgc[iftab], Ftab[iftab]];
-}
-/* 2.5.198.63 TODO */
-function parse_PtgFuncVar(blob, length) {
- blob.l++;
- var cparams = blob.read_shift(1), tab = parsetab(blob);
- return [cparams, (tab[0] === 0 ? Ftab : Cetab)[tab[1]]];
-}
-
-function parsetab(blob, length) {
- return [blob[blob.l+1]>>7, blob.read_shift(2) & 0x7FFF];
-}
-
-/* 2.5.198.41 */
-var parse_PtgAttrSum = parseread(4);
-/* 2.5.198.43 */
-var parse_PtgConcat = parseread1;
-
-/* 2.5.198.58 */
-function parse_PtgExp(blob, length) {
- blob.l++;
- var row = blob.read_shift(2);
- var col = blob.read_shift(2);
- return [row, col];
-}
-
-/* 2.5.198.57 */
-function parse_PtgErr(blob, length) { blob.l++; return BErr[blob.read_shift(1)]; }
-
-/* 2.5.198.66 TODO */
-function parse_PtgInt(blob, length) { blob.l++; return blob.read_shift(2); }
-
-/* 2.5.198.42 */
-function parse_PtgBool(blob, length) { blob.l++; return blob.read_shift(1)!==0;}
-
-/* 2.5.198.79 */
-function parse_PtgNum(blob, length) { blob.l++; return parse_Xnum(blob, 8); }
-
-/* 2.5.198.89 */
-function parse_PtgStr(blob, length) { blob.l++; return parse_ShortXLUnicodeString(blob); }
-
-/* 2.5.192.112 + 2.5.192.11{3,4,5,6,7} */
-function parse_SerAr(blob) {
- var val = [];
- switch((val[0] = blob.read_shift(1))) {
- /* 2.5.192.113 */
- case 0x04: /* SerBool -- boolean */
- val[1] = parsebool(blob, 1) ? 'TRUE' : 'FALSE';
- blob.l += 7; break;
- /* 2.5.192.114 */
- case 0x10: /* SerErr -- error */
- val[1] = BErr[blob[blob.l]];
- blob.l += 8; break;
- /* 2.5.192.115 */
- case 0x00: /* SerNil -- honestly, I'm not sure how to reproduce this */
- blob.l += 8; break;
- /* 2.5.192.116 */
- case 0x01: /* SerNum -- Xnum */
- val[1] = parse_Xnum(blob, 8); break;
- /* 2.5.192.117 */
- case 0x02: /* SerStr -- XLUnicodeString (<256 chars) */
- val[1] = parse_XLUnicodeString(blob); break;
- // default: throw "Bad SerAr: " + val[0]; /* Unreachable */
- }
- return val;
-}
-
-/* 2.5.198.61 */
-function parse_PtgExtraMem(blob, cce) {
- var count = blob.read_shift(2);
- var out = [];
- for(var i = 0; i != count; ++i) out.push(parse_Ref8U(blob, 8));
- return out;
-}
-
-/* 2.5.198.59 */
-function parse_PtgExtraArray(blob) {
- var cols = 1 + blob.read_shift(1); //DColByteU
- var rows = 1 + blob.read_shift(2); //DRw
- for(var i = 0, o=[]; i != rows && (o[i] = []); ++i)
- for(var j = 0; j != cols; ++j) o[i][j] = parse_SerAr(blob);
- return o;
-}
-
-/* 2.5.198.76 */
-function parse_PtgName(blob, length) {
- var type = (blob.read_shift(1) >>> 5) & 0x03;
- var nameindex = blob.read_shift(4);
- return [type, 0, nameindex];
-}
-
-/* 2.5.198.77 */
-function parse_PtgNameX(blob, length) {
- var type = (blob.read_shift(1) >>> 5) & 0x03;
- var ixti = blob.read_shift(2); // XtiIndex
- var nameindex = blob.read_shift(4);
- return [type, ixti, nameindex];
-}
-
-/* 2.5.198.70 */
-function parse_PtgMemArea(blob, length) {
- var type = (blob.read_shift(1) >>> 5) & 0x03;
- blob.l += 4;
- var cce = blob.read_shift(2);
- return [type, cce];
-}
-
-/* 2.5.198.72 */
-function parse_PtgMemFunc(blob, length) {
- var type = (blob.read_shift(1) >>> 5) & 0x03;
- var cce = blob.read_shift(2);
- return [type, cce];
-}
-
-
-/* 2.5.198.86 */
-function parse_PtgRefErr(blob, length) {
- var type = (blob.read_shift(1) >>> 5) & 0x03;
- blob.l += 4;
- return [type];
-}
-
-/* 2.5.198.26 */
-var parse_PtgAdd = parseread1;
-/* 2.5.198.45 */
-var parse_PtgDiv = parseread1;
-/* 2.5.198.56 */
-var parse_PtgEq = parseread1;
-/* 2.5.198.64 */
-var parse_PtgGe = parseread1;
-/* 2.5.198.65 */
-var parse_PtgGt = parseread1;
-/* 2.5.198.67 */
-var parse_PtgIsect = parseread1;
-/* 2.5.198.68 */
-var parse_PtgLe = parseread1;
-/* 2.5.198.69 */
-var parse_PtgLt = parseread1;
-/* 2.5.198.74 */
-var parse_PtgMissArg = parseread1;
-/* 2.5.198.75 */
-var parse_PtgMul = parseread1;
-/* 2.5.198.78 */
-var parse_PtgNe = parseread1;
-/* 2.5.198.80 */
-var parse_PtgParen = parseread1;
-/* 2.5.198.81 */
-var parse_PtgPercent = parseread1;
-/* 2.5.198.82 */
-var parse_PtgPower = parseread1;
-/* 2.5.198.83 */
-var parse_PtgRange = parseread1;
-/* 2.5.198.90 */
-var parse_PtgSub = parseread1;
-/* 2.5.198.93 */
-var parse_PtgUminus = parseread1;
-/* 2.5.198.94 */
-var parse_PtgUnion = parseread1;
-/* 2.5.198.95 */
-var parse_PtgUplus = parseread1;
-
-/* 2.5.198.71 */
-var parse_PtgMemErr = parsenoop;
-/* 2.5.198.73 */
-var parse_PtgMemNoMem = parsenoop;
-/* 2.5.198.87 */
-var parse_PtgRefErr3d = parsenoop;
-/* 2.5.198.92 */
-var parse_PtgTbl = parsenoop;
-
-/* 2.5.198.25 */
-var PtgTypes = {
- 0x01: { n:'PtgExp', f:parse_PtgExp },
- 0x02: { n:'PtgTbl', f:parse_PtgTbl },
- 0x03: { n:'PtgAdd', f:parse_PtgAdd },
- 0x04: { n:'PtgSub', f:parse_PtgSub },
- 0x05: { n:'PtgMul', f:parse_PtgMul },
- 0x06: { n:'PtgDiv', f:parse_PtgDiv },
- 0x07: { n:'PtgPower', f:parse_PtgPower },
- 0x08: { n:'PtgConcat', f:parse_PtgConcat },
- 0x09: { n:'PtgLt', f:parse_PtgLt },
- 0x0A: { n:'PtgLe', f:parse_PtgLe },
- 0x0B: { n:'PtgEq', f:parse_PtgEq },
- 0x0C: { n:'PtgGe', f:parse_PtgGe },
- 0x0D: { n:'PtgGt', f:parse_PtgGt },
- 0x0E: { n:'PtgNe', f:parse_PtgNe },
- 0x0F: { n:'PtgIsect', f:parse_PtgIsect },
- 0x10: { n:'PtgUnion', f:parse_PtgUnion },
- 0x11: { n:'PtgRange', f:parse_PtgRange },
- 0x12: { n:'PtgUplus', f:parse_PtgUplus },
- 0x13: { n:'PtgUminus', f:parse_PtgUminus },
- 0x14: { n:'PtgPercent', f:parse_PtgPercent },
- 0x15: { n:'PtgParen', f:parse_PtgParen },
- 0x16: { n:'PtgMissArg', f:parse_PtgMissArg },
- 0x17: { n:'PtgStr', f:parse_PtgStr },
- 0x1C: { n:'PtgErr', f:parse_PtgErr },
- 0x1D: { n:'PtgBool', f:parse_PtgBool },
- 0x1E: { n:'PtgInt', f:parse_PtgInt },
- 0x1F: { n:'PtgNum', f:parse_PtgNum },
- 0x20: { n:'PtgArray', f:parse_PtgArray },
- 0x21: { n:'PtgFunc', f:parse_PtgFunc },
- 0x22: { n:'PtgFuncVar', f:parse_PtgFuncVar },
- 0x23: { n:'PtgName', f:parse_PtgName },
- 0x24: { n:'PtgRef', f:parse_PtgRef },
- 0x25: { n:'PtgArea', f:parse_PtgArea },
- 0x26: { n:'PtgMemArea', f:parse_PtgMemArea },
- 0x27: { n:'PtgMemErr', f:parse_PtgMemErr },
- 0x28: { n:'PtgMemNoMem', f:parse_PtgMemNoMem },
- 0x29: { n:'PtgMemFunc', f:parse_PtgMemFunc },
- 0x2A: { n:'PtgRefErr', f:parse_PtgRefErr },
- 0x2B: { n:'PtgAreaErr', f:parse_PtgAreaErr },
- 0x2C: { n:'PtgRefN', f:parse_PtgRefN },
- 0x2D: { n:'PtgAreaN', f:parse_PtgAreaN },
- 0x39: { n:'PtgNameX', f:parse_PtgNameX },
- 0x3A: { n:'PtgRef3d', f:parse_PtgRef3d },
- 0x3B: { n:'PtgArea3d', f:parse_PtgArea3d },
- 0x3C: { n:'PtgRefErr3d', f:parse_PtgRefErr3d },
- 0x3D: { n:'PtgAreaErr3d', f:parse_PtgAreaErr3d },
- 0xFF: {}
-};
-/* These are duplicated in the PtgTypes table */
-var PtgDupes = {
- 0x40: 0x20, 0x60: 0x20,
- 0x41: 0x21, 0x61: 0x21,
- 0x42: 0x22, 0x62: 0x22,
- 0x43: 0x23, 0x63: 0x23,
- 0x44: 0x24, 0x64: 0x24,
- 0x45: 0x25, 0x65: 0x25,
- 0x46: 0x26, 0x66: 0x26,
- 0x47: 0x27, 0x67: 0x27,
- 0x48: 0x28, 0x68: 0x28,
- 0x49: 0x29, 0x69: 0x29,
- 0x4A: 0x2A, 0x6A: 0x2A,
- 0x4B: 0x2B, 0x6B: 0x2B,
- 0x4C: 0x2C, 0x6C: 0x2C,
- 0x4D: 0x2D, 0x6D: 0x2D,
- 0x59: 0x39, 0x79: 0x39,
- 0x5A: 0x3A, 0x7A: 0x3A,
- 0x5B: 0x3B, 0x7B: 0x3B,
- 0x5C: 0x3C, 0x7C: 0x3C,
- 0x5D: 0x3D, 0x7D: 0x3D
-};
-(function(){for(var y in PtgDupes) PtgTypes[y] = PtgTypes[PtgDupes[y]];})();
-
-var Ptg18 = {};
-var Ptg19 = {
- 0x01: { n:'PtgAttrSemi', f:parse_PtgAttrSemi },
- 0x02: { n:'PtgAttrIf', f:parse_PtgAttrIf },
- 0x04: { n:'PtgAttrChoose', f:parse_PtgAttrChoose },
- 0x08: { n:'PtgAttrGoto', f:parse_PtgAttrGoto },
- 0x10: { n:'PtgAttrSum', f:parse_PtgAttrSum },
- 0x20: { n:'PtgAttrBaxcel', f:parse_PtgAttrBaxcel },
- 0x40: { n:'PtgAttrSpace', f:parse_PtgAttrSpace },
- 0x41: { n:'PtgAttrSpaceSemi', f:parse_PtgAttrSpaceSemi },
- 0xFF: {}
-};
-
-/* 2.4.127 TODO */
-function parse_Formula(blob, length, opts) {
- var cell = parse_XLSCell(blob, 6);
- var val = parse_FormulaValue(blob,8);
- var flags = blob.read_shift(1);
- blob.read_shift(1);
- var chn = blob.read_shift(4);
- var cbf = "";
- if(opts.biff === 5) blob.l += length-20;
- else cbf = parse_XLSCellParsedFormula(blob, length-20, opts);
- return {cell:cell, val:val[0], formula:cbf, shared: (flags >> 3) & 1, tt:val[1]};
-}
-
-/* 2.5.133 TODO: how to emit empty strings? */
-function parse_FormulaValue(blob) {
- var b;
- if(__readUInt16LE(blob,blob.l + 6) !== 0xFFFF) return [parse_Xnum(blob),'n'];
- switch(blob[blob.l]) {
- case 0x00: blob.l += 8; return ["String", 's'];
- case 0x01: b = blob[blob.l+2] === 0x1; blob.l += 8; return [b,'b'];
- case 0x02: b = blob[blob.l+2]; blob.l += 8; return [b,'e'];
- case 0x03: blob.l += 8; return ["",'s'];
- }
-}
-
-/* 2.5.198.103 */
-function parse_RgbExtra(blob, length, rgce, opts) {
- if(opts.biff < 8) return parsenoop(blob, length);
- var target = blob.l + length;
- var o = [];
- for(var i = 0; i !== rgce.length; ++i) {
- switch(rgce[i][0]) {
- case 'PtgArray': /* PtgArray -> PtgExtraArray */
- rgce[i][1] = parse_PtgExtraArray(blob);
- o.push(rgce[i][1]);
- break;
- case 'PtgMemArea': /* PtgMemArea -> PtgExtraMem */
- rgce[i][2] = parse_PtgExtraMem(blob, rgce[i][1]);
- o.push(rgce[i][2]);
- break;
- default: break;
- }
- }
- length = target - blob.l;
- if(length !== 0) o.push(parsenoop(blob, length));
- return o;
-}
-
-/* 2.5.198.21 */
-function parse_NameParsedFormula(blob, length, opts, cce) {
- var target = blob.l + length;
- var rgce = parse_Rgce(blob, cce);
- var rgcb;
- if(target !== blob.l) rgcb = parse_RgbExtra(blob, target - blob.l, rgce, opts);
- return [rgce, rgcb];
-}
-
-/* 2.5.198.3 TODO */
-function parse_XLSCellParsedFormula(blob, length, opts) {
- var target = blob.l + length;
- var rgcb, cce = blob.read_shift(2); // length of rgce
- if(cce == 0xFFFF) return [[],parsenoop(blob, length-2)];
- var rgce = parse_Rgce(blob, cce);
- if(length !== cce + 2) rgcb = parse_RgbExtra(blob, length - cce - 2, rgce, opts);
- return [rgce, rgcb];
-}
-
-/* 2.5.198.118 TODO */
-function parse_SharedParsedFormula(blob, length, opts) {
- var target = blob.l + length;
- var rgcb, cce = blob.read_shift(2); // length of rgce
- var rgce = parse_Rgce(blob, cce);
- if(cce == 0xFFFF) return [[],parsenoop(blob, length-2)];
- if(length !== cce + 2) rgcb = parse_RgbExtra(blob, target - cce - 2, rgce, opts);
- return [rgce, rgcb];
-}
-
-/* 2.5.198.1 TODO */
-function parse_ArrayParsedFormula(blob, length, opts, ref) {
- var target = blob.l + length;
- var rgcb, cce = blob.read_shift(2); // length of rgce
- if(cce == 0xFFFF) return [[],parsenoop(blob, length-2)];
- var rgce = parse_Rgce(blob, cce);
- if(length !== cce + 2) rgcb = parse_RgbExtra(blob, target - cce - 2, rgce, opts);
- return [rgce, rgcb];
-}
-
-/* 2.5.198.104 */
-function parse_Rgce(blob, length) {
- var target = blob.l + length;
- var R, id, ptgs = [];
- while(target != blob.l) {
- length = target - blob.l;
- id = blob[blob.l];
- R = PtgTypes[id];
- //console.log("ptg", id, R)
- if(id === 0x18 || id === 0x19) {
- id = blob[blob.l + 1];
- R = (id === 0x18 ? Ptg18 : Ptg19)[id];
- }
- if(!R || !R.f) { ptgs.push(parsenoop(blob, length)); }
- else { ptgs.push([R.n, R.f(blob, length)]); }
- }
- return ptgs;
-}
-
-function mapper(x) { return x.map(function f2(y) { return y[1];}).join(",");}
-
-/* 2.2.2 + Magic TODO */
-function stringify_formula(formula, range, cell, supbooks, opts) {
- if(opts !== undefined && opts.biff === 5) return "BIFF5??";
- var _range = range !== undefined ? range : {s:{c:0, r:0}};
- var stack = [], e1, e2, type, c, ixti, nameidx, r;
- if(!formula[0] || !formula[0][0]) return "";
- //console.log("--",cell,formula[0])
- for(var ff = 0, fflen = formula[0].length; ff < fflen; ++ff) {
- var f = formula[0][ff];
- //console.log("++",f, stack)
- switch(f[0]) {
- /* 2.2.2.1 Unary Operator Tokens */
- /* 2.5.198.93 */
- case 'PtgUminus': stack.push("-" + stack.pop()); break;
- /* 2.5.198.95 */
- case 'PtgUplus': stack.push("+" + stack.pop()); break;
- /* 2.5.198.81 */
- case 'PtgPercent': stack.push(stack.pop() + "%"); break;
-
- /* 2.2.2.1 Binary Value Operator Token */
- /* 2.5.198.26 */
- case 'PtgAdd':
- e1 = stack.pop(); e2 = stack.pop();
- stack.push(e2+"+"+e1);
- break;
- /* 2.5.198.90 */
- case 'PtgSub':
- e1 = stack.pop(); e2 = stack.pop();
- stack.push(e2+"-"+e1);
- break;
- /* 2.5.198.75 */
- case 'PtgMul':
- e1 = stack.pop(); e2 = stack.pop();
- stack.push(e2+"*"+e1);
- break;
- /* 2.5.198.45 */
- case 'PtgDiv':
- e1 = stack.pop(); e2 = stack.pop();
- stack.push(e2+"/"+e1);
- break;
- /* 2.5.198.82 */
- case 'PtgPower':
- e1 = stack.pop(); e2 = stack.pop();
- stack.push(e2+"^"+e1);
- break;
- /* 2.5.198.43 */
- case 'PtgConcat':
- e1 = stack.pop(); e2 = stack.pop();
- stack.push(e2+"&"+e1);
- break;
- /* 2.5.198.69 */
- case 'PtgLt':
- e1 = stack.pop(); e2 = stack.pop();
- stack.push(e2+"<"+e1);
- break;
- /* 2.5.198.68 */
- case 'PtgLe':
- e1 = stack.pop(); e2 = stack.pop();
- stack.push(e2+"<="+e1);
- break;
- /* 2.5.198.56 */
- case 'PtgEq':
- e1 = stack.pop(); e2 = stack.pop();
- stack.push(e2+"="+e1);
- break;
- /* 2.5.198.64 */
- case 'PtgGe':
- e1 = stack.pop(); e2 = stack.pop();
- stack.push(e2+">="+e1);
- break;
- /* 2.5.198.65 */
- case 'PtgGt':
- e1 = stack.pop(); e2 = stack.pop();
- stack.push(e2+">"+e1);
- break;
- /* 2.5.198.78 */
- case 'PtgNe':
- e1 = stack.pop(); e2 = stack.pop();
- stack.push(e2+"<>"+e1);
- break;
-
- /* 2.2.2.1 Binary Reference Operator Token */
- /* 2.5.198.67 */
- case 'PtgIsect':
- e1 = stack.pop(); e2 = stack.pop();
- stack.push(e2+" "+e1);
- break;
- case 'PtgUnion':
- e1 = stack.pop(); e2 = stack.pop();
- stack.push(e2+","+e1);
- break;
- case 'PtgRange': break;
-
- /* 2.2.2.3 Control Tokens "can be ignored" */
- /* 2.5.198.34 */
- case 'PtgAttrChoose': break;
- /* 2.5.198.35 */
- case 'PtgAttrGoto': break;
- /* 2.5.198.36 */
- case 'PtgAttrIf': break;
-
-
- /* 2.5.198.84 */
- case 'PtgRef':
- type = f[1][0]; c = shift_cell_xls(decode_cell(encode_cell(f[1][1])), _range);
- stack.push(encode_cell(c));
- break;
- /* 2.5.198.88 */
- case 'PtgRefN':
- type = f[1][0]; c = shift_cell_xls(decode_cell(encode_cell(f[1][1])), cell);
- stack.push(encode_cell(c));
- break;
- case 'PtgRef3d': // TODO: lots of stuff
- type = f[1][0]; ixti = f[1][1]; c = shift_cell_xls(f[1][2], _range);
- stack.push(supbooks[1][ixti+1]+"!"+encode_cell(c));
- break;
-
- /* Function Call */
- /* 2.5.198.62 */
- case 'PtgFunc':
- /* 2.5.198.63 */
- case 'PtgFuncVar':
- /* f[1] = [argc, func] */
- var argc = f[1][0], func = f[1][1];
- if(!argc) argc = 0;
- var args = stack.slice(-argc);
- stack.length -= argc;
- if(func === 'User') func = args.shift();
- stack.push(func + "(" + args.join(",") + ")");
- break;
-
- /* 2.5.198.42 */
- case 'PtgBool': stack.push(f[1] ? "TRUE" : "FALSE"); break;
- /* 2.5.198.66 */
- case 'PtgInt': stack.push(f[1]); break;
- /* 2.5.198.79 TODO: precision? */
- case 'PtgNum': stack.push(String(f[1])); break;
- /* 2.5.198.89 */
- case 'PtgStr': stack.push('"' + f[1] + '"'); break;
- /* 2.5.198.57 */
- case 'PtgErr': stack.push(f[1]); break;
- /* 2.5.198.27 TODO: fixed points */
- case 'PtgArea':
- type = f[1][0]; r = shift_range_xls(f[1][1], _range);
- stack.push(encode_range(r));
- break;
- /* 2.5.198.28 */
- case 'PtgArea3d': // TODO: lots of stuff
- type = f[1][0]; ixti = f[1][1]; r = f[1][2];
- stack.push(supbooks[1][ixti+1]+"!"+encode_range(r));
- break;
- /* 2.5.198.41 */
- case 'PtgAttrSum':
- stack.push("SUM(" + stack.pop() + ")");
- break;
-
- /* Expression Prefixes */
- /* 2.5.198.37 */
- case 'PtgAttrSemi': break;
-
- /* 2.5.97.60 TODO: do something different for revisions */
- case 'PtgName':
- /* f[1] = type, 0, nameindex */
- nameidx = f[1][2];
- var lbl = supbooks[0][nameidx];
- var name = lbl.Name;
- if(name in XLSXFutureFunctions) name = XLSXFutureFunctions[name];
- stack.push(name);
- break;
-
- /* 2.5.97.61 TODO: do something different for revisions */
- case 'PtgNameX':
- /* f[1] = type, ixti, nameindex */
- var bookidx = f[1][1]; nameidx = f[1][2]; var externbook;
- /* TODO: Properly handle missing values */
- if(supbooks[bookidx+1]) externbook = supbooks[bookidx+1][nameidx];
- else if(supbooks[bookidx-1]) externbook = supbooks[bookidx-1][nameidx];
- if(!externbook) externbook = {body: "??NAMEX??"};
- stack.push(externbook.body);
- break;
-
- /* 2.2.2.4 Display Tokens */
- /* 2.5.198.80 */
- case 'PtgParen': stack.push('(' + stack.pop() + ')'); break;
-
- /* 2.5.198.86 */
- case 'PtgRefErr': stack.push('#REF!'); break;
-
- /* */
- /* 2.5.198.58 TODO */
- case 'PtgExp':
- c = {c:f[1][1],r:f[1][0]};
- var q = {c: cell.c, r:cell.r};
- if(supbooks.sharedf[encode_cell(c)]) {
- var parsedf = (supbooks.sharedf[encode_cell(c)]);
- stack.push(stringify_formula(parsedf, _range, q, supbooks, opts));
- }
- else {
- var fnd = false;
- for(e1=0;e1!=supbooks.arrayf.length; ++e1) {
- /* TODO: should be something like range_has */
- e2 = supbooks.arrayf[e1];
- if(c.c < e2[0].s.c || c.c > e2[0].e.c) continue;
- if(c.r < e2[0].s.r || c.r > e2[0].e.r) continue;
- stack.push(stringify_formula(e2[1], _range, q, supbooks, opts));
- }
- if(!fnd) stack.push(f[1]);
- }
- break;
-
- /* 2.5.198.32 TODO */
- case 'PtgArray':
- stack.push("{" + f[1].map(mapper).join(";") + "}");
- break;
-
- /* 2.2.2.5 Mem Tokens */
- /* 2.5.198.70 TODO: confirm this is a non-display */
- case 'PtgMemArea':
- //stack.push("(" + f[2].map(encode_range).join(",") + ")");
- break;
-
- /* 2.5.198.38 TODO */
- case 'PtgAttrSpace': break;
-
- /* 2.5.198.92 TODO */
- case 'PtgTbl': break;
-
- /* 2.5.198.71 */
- case 'PtgMemErr': break;
-
- /* 2.5.198.74 */
- case 'PtgMissArg':
- stack.push("");
- break;
-
- /* 2.5.198.29 TODO */
- case 'PtgAreaErr': break;
-
- /* 2.5.198.31 TODO */
- case 'PtgAreaN': stack.push(""); break;
-
- /* 2.5.198.87 TODO */
- case 'PtgRefErr3d': break;
-
- /* 2.5.198.72 TODO */
- case 'PtgMemFunc': break;
-
- default: throw 'Unrecognized Formula Token: ' + f;
- }
- //console.log("::",f, stack)
- }
- //console.log("--",stack);
- return stack[0];
-}
-
-/* [MS-XLSB] 2.5.97.4 CellParsedFormula TODO: use similar logic to js-xls */
-function parse_XLSBCellParsedFormula(data, length) {
- var cce = data.read_shift(4);
- return parsenoop(data, length-4);
-}
-/* [MS-XLS] 2.5.198.44 */
-var PtgDataType = {
- 0x1: "REFERENCE", // reference to range
- 0x2: "VALUE", // single value
- 0x3: "ARRAY" // array of values
-};
-
-/* [MS-XLS] 2.5.198.4 */
-var Cetab = {
- 0x0000: 'BEEP',
- 0x0001: 'OPEN',
- 0x0002: 'OPEN.LINKS',
- 0x0003: 'CLOSE.ALL',
- 0x0004: 'SAVE',
- 0x0005: 'SAVE.AS',
- 0x0006: 'FILE.DELETE',
- 0x0007: 'PAGE.SETUP',
- 0x0008: 'PRINT',
- 0x0009: 'PRINTER.SETUP',
- 0x000A: 'QUIT',
- 0x000B: 'NEW.WINDOW',
- 0x000C: 'ARRANGE.ALL',
- 0x000D: 'WINDOW.SIZE',
- 0x000E: 'WINDOW.MOVE',
- 0x000F: 'FULL',
- 0x0010: 'CLOSE',
- 0x0011: 'RUN',
- 0x0016: 'SET.PRINT.AREA',
- 0x0017: 'SET.PRINT.TITLES',
- 0x0018: 'SET.PAGE.BREAK',
- 0x0019: 'REMOVE.PAGE.BREAK',
- 0x001A: 'FONT',
- 0x001B: 'DISPLAY',
- 0x001C: 'PROTECT.DOCUMENT',
- 0x001D: 'PRECISION',
- 0x001E: 'A1.R1C1',
- 0x001F: 'CALCULATE.NOW',
- 0x0020: 'CALCULATION',
- 0x0022: 'DATA.FIND',
- 0x0023: 'EXTRACT',
- 0x0024: 'DATA.DELETE',
- 0x0025: 'SET.DATABASE',
- 0x0026: 'SET.CRITERIA',
- 0x0027: 'SORT',
- 0x0028: 'DATA.SERIES',
- 0x0029: 'TABLE',
- 0x002A: 'FORMAT.NUMBER',
- 0x002B: 'ALIGNMENT',
- 0x002C: 'STYLE',
- 0x002D: 'BORDER',
- 0x002E: 'CELL.PROTECTION',
- 0x002F: 'COLUMN.WIDTH',
- 0x0030: 'UNDO',
- 0x0031: 'CUT',
- 0x0032: 'COPY',
- 0x0033: 'PASTE',
- 0x0034: 'CLEAR',
- 0x0035: 'PASTE.SPECIAL',
- 0x0036: 'EDIT.DELETE',
- 0x0037: 'INSERT',
- 0x0038: 'FILL.RIGHT',
- 0x0039: 'FILL.DOWN',
- 0x003D: 'DEFINE.NAME',
- 0x003E: 'CREATE.NAMES',
- 0x003F: 'FORMULA.GOTO',
- 0x0040: 'FORMULA.FIND',
- 0x0041: 'SELECT.LAST.CELL',
- 0x0042: 'SHOW.ACTIVE.CELL',
- 0x0043: 'GALLERY.AREA',
- 0x0044: 'GALLERY.BAR',
- 0x0045: 'GALLERY.COLUMN',
- 0x0046: 'GALLERY.LINE',
- 0x0047: 'GALLERY.PIE',
- 0x0048: 'GALLERY.SCATTER',
- 0x0049: 'COMBINATION',
- 0x004A: 'PREFERRED',
- 0x004B: 'ADD.OVERLAY',
- 0x004C: 'GRIDLINES',
- 0x004D: 'SET.PREFERRED',
- 0x004E: 'AXES',
- 0x004F: 'LEGEND',
- 0x0050: 'ATTACH.TEXT',
- 0x0051: 'ADD.ARROW',
- 0x0052: 'SELECT.CHART',
- 0x0053: 'SELECT.PLOT.AREA',
- 0x0054: 'PATTERNS',
- 0x0055: 'MAIN.CHART',
- 0x0056: 'OVERLAY',
- 0x0057: 'SCALE',
- 0x0058: 'FORMAT.LEGEND',
- 0x0059: 'FORMAT.TEXT',
- 0x005A: 'EDIT.REPEAT',
- 0x005B: 'PARSE',
- 0x005C: 'JUSTIFY',
- 0x005D: 'HIDE',
- 0x005E: 'UNHIDE',
- 0x005F: 'WORKSPACE',
- 0x0060: 'FORMULA',
- 0x0061: 'FORMULA.FILL',
- 0x0062: 'FORMULA.ARRAY',
- 0x0063: 'DATA.FIND.NEXT',
- 0x0064: 'DATA.FIND.PREV',
- 0x0065: 'FORMULA.FIND.NEXT',
- 0x0066: 'FORMULA.FIND.PREV',
- 0x0067: 'ACTIVATE',
- 0x0068: 'ACTIVATE.NEXT',
- 0x0069: 'ACTIVATE.PREV',
- 0x006A: 'UNLOCKED.NEXT',
- 0x006B: 'UNLOCKED.PREV',
- 0x006C: 'COPY.PICTURE',
- 0x006D: 'SELECT',
- 0x006E: 'DELETE.NAME',
- 0x006F: 'DELETE.FORMAT',
- 0x0070: 'VLINE',
- 0x0071: 'HLINE',
- 0x0072: 'VPAGE',
- 0x0073: 'HPAGE',
- 0x0074: 'VSCROLL',
- 0x0075: 'HSCROLL',
- 0x0076: 'ALERT',
- 0x0077: 'NEW',
- 0x0078: 'CANCEL.COPY',
- 0x0079: 'SHOW.CLIPBOARD',
- 0x007A: 'MESSAGE',
- 0x007C: 'PASTE.LINK',
- 0x007D: 'APP.ACTIVATE',
- 0x007E: 'DELETE.ARROW',
- 0x007F: 'ROW.HEIGHT',
- 0x0080: 'FORMAT.MOVE',
- 0x0081: 'FORMAT.SIZE',
- 0x0082: 'FORMULA.REPLACE',
- 0x0083: 'SEND.KEYS',
- 0x0084: 'SELECT.SPECIAL',
- 0x0085: 'APPLY.NAMES',
- 0x0086: 'REPLACE.FONT',
- 0x0087: 'FREEZE.PANES',
- 0x0088: 'SHOW.INFO',
- 0x0089: 'SPLIT',
- 0x008A: 'ON.WINDOW',
- 0x008B: 'ON.DATA',
- 0x008C: 'DISABLE.INPUT',
- 0x008E: 'OUTLINE',
- 0x008F: 'LIST.NAMES',
- 0x0090: 'FILE.CLOSE',
- 0x0091: 'SAVE.WORKBOOK',
- 0x0092: 'DATA.FORM',
- 0x0093: 'COPY.CHART',
- 0x0094: 'ON.TIME',
- 0x0095: 'WAIT',
- 0x0096: 'FORMAT.FONT',
- 0x0097: 'FILL.UP',
- 0x0098: 'FILL.LEFT',
- 0x0099: 'DELETE.OVERLAY',
- 0x009B: 'SHORT.MENUS',
- 0x009F: 'SET.UPDATE.STATUS',
- 0x00A1: 'COLOR.PALETTE',
- 0x00A2: 'DELETE.STYLE',
- 0x00A3: 'WINDOW.RESTORE',
- 0x00A4: 'WINDOW.MAXIMIZE',
- 0x00A6: 'CHANGE.LINK',
- 0x00A7: 'CALCULATE.DOCUMENT',
- 0x00A8: 'ON.KEY',
- 0x00A9: 'APP.RESTORE',
- 0x00AA: 'APP.MOVE',
- 0x00AB: 'APP.SIZE',
- 0x00AC: 'APP.MINIMIZE',
- 0x00AD: 'APP.MAXIMIZE',
- 0x00AE: 'BRING.TO.FRONT',
- 0x00AF: 'SEND.TO.BACK',
- 0x00B9: 'MAIN.CHART.TYPE',
- 0x00BA: 'OVERLAY.CHART.TYPE',
- 0x00BB: 'SELECT.END',
- 0x00BC: 'OPEN.MAIL',
- 0x00BD: 'SEND.MAIL',
- 0x00BE: 'STANDARD.FONT',
- 0x00BF: 'CONSOLIDATE',
- 0x00C0: 'SORT.SPECIAL',
- 0x00C1: 'GALLERY.3D.AREA',
- 0x00C2: 'GALLERY.3D.COLUMN',
- 0x00C3: 'GALLERY.3D.LINE',
- 0x00C4: 'GALLERY.3D.PIE',
- 0x00C5: 'VIEW.3D',
- 0x00C6: 'GOAL.SEEK',
- 0x00C7: 'WORKGROUP',
- 0x00C8: 'FILL.GROUP',
- 0x00C9: 'UPDATE.LINK',
- 0x00CA: 'PROMOTE',
- 0x00CB: 'DEMOTE',
- 0x00CC: 'SHOW.DETAIL',
- 0x00CE: 'UNGROUP',
- 0x00CF: 'OBJECT.PROPERTIES',
- 0x00D0: 'SAVE.NEW.OBJECT',
- 0x00D1: 'SHARE',
- 0x00D2: 'SHARE.NAME',
- 0x00D3: 'DUPLICATE',
- 0x00D4: 'APPLY.STYLE',
- 0x00D5: 'ASSIGN.TO.OBJECT',
- 0x00D6: 'OBJECT.PROTECTION',
- 0x00D7: 'HIDE.OBJECT',
- 0x00D8: 'SET.EXTRACT',
- 0x00D9: 'CREATE.PUBLISHER',
- 0x00DA: 'SUBSCRIBE.TO',
- 0x00DB: 'ATTRIBUTES',
- 0x00DC: 'SHOW.TOOLBAR',
- 0x00DE: 'PRINT.PREVIEW',
- 0x00DF: 'EDIT.COLOR',
- 0x00E0: 'SHOW.LEVELS',
- 0x00E1: 'FORMAT.MAIN',
- 0x00E2: 'FORMAT.OVERLAY',
- 0x00E3: 'ON.RECALC',
- 0x00E4: 'EDIT.SERIES',
- 0x00E5: 'DEFINE.STYLE',
- 0x00F0: 'LINE.PRINT',
- 0x00F3: 'ENTER.DATA',
- 0x00F9: 'GALLERY.RADAR',
- 0x00FA: 'MERGE.STYLES',
- 0x00FB: 'EDITION.OPTIONS',
- 0x00FC: 'PASTE.PICTURE',
- 0x00FD: 'PASTE.PICTURE.LINK',
- 0x00FE: 'SPELLING',
- 0x0100: 'ZOOM',
- 0x0103: 'INSERT.OBJECT',
- 0x0104: 'WINDOW.MINIMIZE',
- 0x0109: 'SOUND.NOTE',
- 0x010A: 'SOUND.PLAY',
- 0x010B: 'FORMAT.SHAPE',
- 0x010C: 'EXTEND.POLYGON',
- 0x010D: 'FORMAT.AUTO',
- 0x0110: 'GALLERY.3D.BAR',
- 0x0111: 'GALLERY.3D.SURFACE',
- 0x0112: 'FILL.AUTO',
- 0x0114: 'CUSTOMIZE.TOOLBAR',
- 0x0115: 'ADD.TOOL',
- 0x0116: 'EDIT.OBJECT',
- 0x0117: 'ON.DOUBLECLICK',
- 0x0118: 'ON.ENTRY',
- 0x0119: 'WORKBOOK.ADD',
- 0x011A: 'WORKBOOK.MOVE',
- 0x011B: 'WORKBOOK.COPY',
- 0x011C: 'WORKBOOK.OPTIONS',
- 0x011D: 'SAVE.WORKSPACE',
- 0x0120: 'CHART.WIZARD',
- 0x0121: 'DELETE.TOOL',
- 0x0122: 'MOVE.TOOL',
- 0x0123: 'WORKBOOK.SELECT',
- 0x0124: 'WORKBOOK.ACTIVATE',
- 0x0125: 'ASSIGN.TO.TOOL',
- 0x0127: 'COPY.TOOL',
- 0x0128: 'RESET.TOOL',
- 0x0129: 'CONSTRAIN.NUMERIC',
- 0x012A: 'PASTE.TOOL',
- 0x012E: 'WORKBOOK.NEW',
- 0x0131: 'SCENARIO.CELLS',
- 0x0132: 'SCENARIO.DELETE',
- 0x0133: 'SCENARIO.ADD',
- 0x0134: 'SCENARIO.EDIT',
- 0x0135: 'SCENARIO.SHOW',
- 0x0136: 'SCENARIO.SHOW.NEXT',
- 0x0137: 'SCENARIO.SUMMARY',
- 0x0138: 'PIVOT.TABLE.WIZARD',
- 0x0139: 'PIVOT.FIELD.PROPERTIES',
- 0x013A: 'PIVOT.FIELD',
- 0x013B: 'PIVOT.ITEM',
- 0x013C: 'PIVOT.ADD.FIELDS',
- 0x013E: 'OPTIONS.CALCULATION',
- 0x013F: 'OPTIONS.EDIT',
- 0x0140: 'OPTIONS.VIEW',
- 0x0141: 'ADDIN.MANAGER',
- 0x0142: 'MENU.EDITOR',
- 0x0143: 'ATTACH.TOOLBARS',
- 0x0144: 'VBAActivate',
- 0x0145: 'OPTIONS.CHART',
- 0x0148: 'VBA.INSERT.FILE',
- 0x014A: 'VBA.PROCEDURE.DEFINITION',
- 0x0150: 'ROUTING.SLIP',
- 0x0152: 'ROUTE.DOCUMENT',
- 0x0153: 'MAIL.LOGON',
- 0x0156: 'INSERT.PICTURE',
- 0x0157: 'EDIT.TOOL',
- 0x0158: 'GALLERY.DOUGHNUT',
- 0x015E: 'CHART.TREND',
- 0x0160: 'PIVOT.ITEM.PROPERTIES',
- 0x0162: 'WORKBOOK.INSERT',
- 0x0163: 'OPTIONS.TRANSITION',
- 0x0164: 'OPTIONS.GENERAL',
- 0x0172: 'FILTER.ADVANCED',
- 0x0175: 'MAIL.ADD.MAILER',
- 0x0176: 'MAIL.DELETE.MAILER',
- 0x0177: 'MAIL.REPLY',
- 0x0178: 'MAIL.REPLY.ALL',
- 0x0179: 'MAIL.FORWARD',
- 0x017A: 'MAIL.NEXT.LETTER',
- 0x017B: 'DATA.LABEL',
- 0x017C: 'INSERT.TITLE',
- 0x017D: 'FONT.PROPERTIES',
- 0x017E: 'MACRO.OPTIONS',
- 0x017F: 'WORKBOOK.HIDE',
- 0x0180: 'WORKBOOK.UNHIDE',
- 0x0181: 'WORKBOOK.DELETE',
- 0x0182: 'WORKBOOK.NAME',
- 0x0184: 'GALLERY.CUSTOM',
- 0x0186: 'ADD.CHART.AUTOFORMAT',
- 0x0187: 'DELETE.CHART.AUTOFORMAT',
- 0x0188: 'CHART.ADD.DATA',
- 0x0189: 'AUTO.OUTLINE',
- 0x018A: 'TAB.ORDER',
- 0x018B: 'SHOW.DIALOG',
- 0x018C: 'SELECT.ALL',
- 0x018D: 'UNGROUP.SHEETS',
- 0x018E: 'SUBTOTAL.CREATE',
- 0x018F: 'SUBTOTAL.REMOVE',
- 0x0190: 'RENAME.OBJECT',
- 0x019C: 'WORKBOOK.SCROLL',
- 0x019D: 'WORKBOOK.NEXT',
- 0x019E: 'WORKBOOK.PREV',
- 0x019F: 'WORKBOOK.TAB.SPLIT',
- 0x01A0: 'FULL.SCREEN',
- 0x01A1: 'WORKBOOK.PROTECT',
- 0x01A4: 'SCROLLBAR.PROPERTIES',
- 0x01A5: 'PIVOT.SHOW.PAGES',
- 0x01A6: 'TEXT.TO.COLUMNS',
- 0x01A7: 'FORMAT.CHARTTYPE',
- 0x01A8: 'LINK.FORMAT',
- 0x01A9: 'TRACER.DISPLAY',
- 0x01AE: 'TRACER.NAVIGATE',
- 0x01AF: 'TRACER.CLEAR',
- 0x01B0: 'TRACER.ERROR',
- 0x01B1: 'PIVOT.FIELD.GROUP',
- 0x01B2: 'PIVOT.FIELD.UNGROUP',
- 0x01B3: 'CHECKBOX.PROPERTIES',
- 0x01B4: 'LABEL.PROPERTIES',
- 0x01B5: 'LISTBOX.PROPERTIES',
- 0x01B6: 'EDITBOX.PROPERTIES',
- 0x01B7: 'PIVOT.REFRESH',
- 0x01B8: 'LINK.COMBO',
- 0x01B9: 'OPEN.TEXT',
- 0x01BA: 'HIDE.DIALOG',
- 0x01BB: 'SET.DIALOG.FOCUS',
- 0x01BC: 'ENABLE.OBJECT',
- 0x01BD: 'PUSHBUTTON.PROPERTIES',
- 0x01BE: 'SET.DIALOG.DEFAULT',
- 0x01BF: 'FILTER',
- 0x01C0: 'FILTER.SHOW.ALL',
- 0x01C1: 'CLEAR.OUTLINE',
- 0x01C2: 'FUNCTION.WIZARD',
- 0x01C3: 'ADD.LIST.ITEM',
- 0x01C4: 'SET.LIST.ITEM',
- 0x01C5: 'REMOVE.LIST.ITEM',
- 0x01C6: 'SELECT.LIST.ITEM',
- 0x01C7: 'SET.CONTROL.VALUE',
- 0x01C8: 'SAVE.COPY.AS',
- 0x01CA: 'OPTIONS.LISTS.ADD',
- 0x01CB: 'OPTIONS.LISTS.DELETE',
- 0x01CC: 'SERIES.AXES',
- 0x01CD: 'SERIES.X',
- 0x01CE: 'SERIES.Y',
- 0x01CF: 'ERRORBAR.X',
- 0x01D0: 'ERRORBAR.Y',
- 0x01D1: 'FORMAT.CHART',
- 0x01D2: 'SERIES.ORDER',
- 0x01D3: 'MAIL.LOGOFF',
- 0x01D4: 'CLEAR.ROUTING.SLIP',
- 0x01D5: 'APP.ACTIVATE.MICROSOFT',
- 0x01D6: 'MAIL.EDIT.MAILER',
- 0x01D7: 'ON.SHEET',
- 0x01D8: 'STANDARD.WIDTH',
- 0x01D9: 'SCENARIO.MERGE',
- 0x01DA: 'SUMMARY.INFO',
- 0x01DB: 'FIND.FILE',
- 0x01DC: 'ACTIVE.CELL.FONT',
- 0x01DD: 'ENABLE.TIPWIZARD',
- 0x01DE: 'VBA.MAKE.ADDIN',
- 0x01E0: 'INSERTDATATABLE',
- 0x01E1: 'WORKGROUP.OPTIONS',
- 0x01E2: 'MAIL.SEND.MAILER',
- 0x01E5: 'AUTOCORRECT',
- 0x01E9: 'POST.DOCUMENT',
- 0x01EB: 'PICKLIST',
- 0x01ED: 'VIEW.SHOW',
- 0x01EE: 'VIEW.DEFINE',
- 0x01EF: 'VIEW.DELETE',
- 0x01FD: 'SHEET.BACKGROUND',
- 0x01FE: 'INSERT.MAP.OBJECT',
- 0x01FF: 'OPTIONS.MENONO',
- 0x0205: 'MSOCHECKS',
- 0x0206: 'NORMAL',
- 0x0207: 'LAYOUT',
- 0x0208: 'RM.PRINT.AREA',
- 0x0209: 'CLEAR.PRINT.AREA',
- 0x020A: 'ADD.PRINT.AREA',
- 0x020B: 'MOVE.BRK',
- 0x0221: 'HIDECURR.NOTE',
- 0x0222: 'HIDEALL.NOTES',
- 0x0223: 'DELETE.NOTE',
- 0x0224: 'TRAVERSE.NOTES',
- 0x0225: 'ACTIVATE.NOTES',
- 0x026C: 'PROTECT.REVISIONS',
- 0x026D: 'UNPROTECT.REVISIONS',
- 0x0287: 'OPTIONS.ME',
- 0x028D: 'WEB.PUBLISH',
- 0x029B: 'NEWWEBQUERY',
- 0x02A1: 'PIVOT.TABLE.CHART',
- 0x02F1: 'OPTIONS.SAVE',
- 0x02F3: 'OPTIONS.SPELL',
- 0x0328: 'HIDEALL.INKANNOTS'
-};
-
-/* [MS-XLS] 2.5.198.17 */
-var Ftab = {
- 0x0000: 'COUNT',
- 0x0001: 'IF',
- 0x0002: 'ISNA',
- 0x0003: 'ISERROR',
- 0x0004: 'SUM',
- 0x0005: 'AVERAGE',
- 0x0006: 'MIN',
- 0x0007: 'MAX',
- 0x0008: 'ROW',
- 0x0009: 'COLUMN',
- 0x000A: 'NA',
- 0x000B: 'NPV',
- 0x000C: 'STDEV',
- 0x000D: 'DOLLAR',
- 0x000E: 'FIXED',
- 0x000F: 'SIN',
- 0x0010: 'COS',
- 0x0011: 'TAN',
- 0x0012: 'ATAN',
- 0x0013: 'PI',
- 0x0014: 'SQRT',
- 0x0015: 'EXP',
- 0x0016: 'LN',
- 0x0017: 'LOG10',
- 0x0018: 'ABS',
- 0x0019: 'INT',
- 0x001A: 'SIGN',
- 0x001B: 'ROUND',
- 0x001C: 'LOOKUP',
- 0x001D: 'INDEX',
- 0x001E: 'REPT',
- 0x001F: 'MID',
- 0x0020: 'LEN',
- 0x0021: 'VALUE',
- 0x0022: 'TRUE',
- 0x0023: 'FALSE',
- 0x0024: 'AND',
- 0x0025: 'OR',
- 0x0026: 'NOT',
- 0x0027: 'MOD',
- 0x0028: 'DCOUNT',
- 0x0029: 'DSUM',
- 0x002A: 'DAVERAGE',
- 0x002B: 'DMIN',
- 0x002C: 'DMAX',
- 0x002D: 'DSTDEV',
- 0x002E: 'VAR',
- 0x002F: 'DVAR',
- 0x0030: 'TEXT',
- 0x0031: 'LINEST',
- 0x0032: 'TREND',
- 0x0033: 'LOGEST',
- 0x0034: 'GROWTH',
- 0x0035: 'GOTO',
- 0x0036: 'HALT',
- 0x0037: 'RETURN',
- 0x0038: 'PV',
- 0x0039: 'FV',
- 0x003A: 'NPER',
- 0x003B: 'PMT',
- 0x003C: 'RATE',
- 0x003D: 'MIRR',
- 0x003E: 'IRR',
- 0x003F: 'RAND',
- 0x0040: 'MATCH',
- 0x0041: 'DATE',
- 0x0042: 'TIME',
- 0x0043: 'DAY',
- 0x0044: 'MONTH',
- 0x0045: 'YEAR',
- 0x0046: 'WEEKDAY',
- 0x0047: 'HOUR',
- 0x0048: 'MINUTE',
- 0x0049: 'SECOND',
- 0x004A: 'NOW',
- 0x004B: 'AREAS',
- 0x004C: 'ROWS',
- 0x004D: 'COLUMNS',
- 0x004E: 'OFFSET',
- 0x004F: 'ABSREF',
- 0x0050: 'RELREF',
- 0x0051: 'ARGUMENT',
- 0x0052: 'SEARCH',
- 0x0053: 'TRANSPOSE',
- 0x0054: 'ERROR',
- 0x0055: 'STEP',
- 0x0056: 'TYPE',
- 0x0057: 'ECHO',
- 0x0058: 'SET.NAME',
- 0x0059: 'CALLER',
- 0x005A: 'DEREF',
- 0x005B: 'WINDOWS',
- 0x005C: 'SERIES',
- 0x005D: 'DOCUMENTS',
- 0x005E: 'ACTIVE.CELL',
- 0x005F: 'SELECTION',
- 0x0060: 'RESULT',
- 0x0061: 'ATAN2',
- 0x0062: 'ASIN',
- 0x0063: 'ACOS',
- 0x0064: 'CHOOSE',
- 0x0065: 'HLOOKUP',
- 0x0066: 'VLOOKUP',
- 0x0067: 'LINKS',
- 0x0068: 'INPUT',
- 0x0069: 'ISREF',
- 0x006A: 'GET.FORMULA',
- 0x006B: 'GET.NAME',
- 0x006C: 'SET.VALUE',
- 0x006D: 'LOG',
- 0x006E: 'EXEC',
- 0x006F: 'CHAR',
- 0x0070: 'LOWER',
- 0x0071: 'UPPER',
- 0x0072: 'PROPER',
- 0x0073: 'LEFT',
- 0x0074: 'RIGHT',
- 0x0075: 'EXACT',
- 0x0076: 'TRIM',
- 0x0077: 'REPLACE',
- 0x0078: 'SUBSTITUTE',
- 0x0079: 'CODE',
- 0x007A: 'NAMES',
- 0x007B: 'DIRECTORY',
- 0x007C: 'FIND',
- 0x007D: 'CELL',
- 0x007E: 'ISERR',
- 0x007F: 'ISTEXT',
- 0x0080: 'ISNUMBER',
- 0x0081: 'ISBLANK',
- 0x0082: 'T',
- 0x0083: 'N',
- 0x0084: 'FOPEN',
- 0x0085: 'FCLOSE',
- 0x0086: 'FSIZE',
- 0x0087: 'FREADLN',
- 0x0088: 'FREAD',
- 0x0089: 'FWRITELN',
- 0x008A: 'FWRITE',
- 0x008B: 'FPOS',
- 0x008C: 'DATEVALUE',
- 0x008D: 'TIMEVALUE',
- 0x008E: 'SLN',
- 0x008F: 'SYD',
- 0x0090: 'DDB',
- 0x0091: 'GET.DEF',
- 0x0092: 'REFTEXT',
- 0x0093: 'TEXTREF',
- 0x0094: 'INDIRECT',
- 0x0095: 'REGISTER',
- 0x0096: 'CALL',
- 0x0097: 'ADD.BAR',
- 0x0098: 'ADD.MENU',
- 0x0099: 'ADD.COMMAND',
- 0x009A: 'ENABLE.COMMAND',
- 0x009B: 'CHECK.COMMAND',
- 0x009C: 'RENAME.COMMAND',
- 0x009D: 'SHOW.BAR',
- 0x009E: 'DELETE.MENU',
- 0x009F: 'DELETE.COMMAND',
- 0x00A0: 'GET.CHART.ITEM',
- 0x00A1: 'DIALOG.BOX',
- 0x00A2: 'CLEAN',
- 0x00A3: 'MDETERM',
- 0x00A4: 'MINVERSE',
- 0x00A5: 'MMULT',
- 0x00A6: 'FILES',
- 0x00A7: 'IPMT',
- 0x00A8: 'PPMT',
- 0x00A9: 'COUNTA',
- 0x00AA: 'CANCEL.KEY',
- 0x00AB: 'FOR',
- 0x00AC: 'WHILE',
- 0x00AD: 'BREAK',
- 0x00AE: 'NEXT',
- 0x00AF: 'INITIATE',
- 0x00B0: 'REQUEST',
- 0x00B1: 'POKE',
- 0x00B2: 'EXECUTE',
- 0x00B3: 'TERMINATE',
- 0x00B4: 'RESTART',
- 0x00B5: 'HELP',
- 0x00B6: 'GET.BAR',
- 0x00B7: 'PRODUCT',
- 0x00B8: 'FACT',
- 0x00B9: 'GET.CELL',
- 0x00BA: 'GET.WORKSPACE',
- 0x00BB: 'GET.WINDOW',
- 0x00BC: 'GET.DOCUMENT',
- 0x00BD: 'DPRODUCT',
- 0x00BE: 'ISNONTEXT',
- 0x00BF: 'GET.NOTE',
- 0x00C0: 'NOTE',
- 0x00C1: 'STDEVP',
- 0x00C2: 'VARP',
- 0x00C3: 'DSTDEVP',
- 0x00C4: 'DVARP',
- 0x00C5: 'TRUNC',
- 0x00C6: 'ISLOGICAL',
- 0x00C7: 'DCOUNTA',
- 0x00C8: 'DELETE.BAR',
- 0x00C9: 'UNREGISTER',
- 0x00CC: 'USDOLLAR',
- 0x00CD: 'FINDB',
- 0x00CE: 'SEARCHB',
- 0x00CF: 'REPLACEB',
- 0x00D0: 'LEFTB',
- 0x00D1: 'RIGHTB',
- 0x00D2: 'MIDB',
- 0x00D3: 'LENB',
- 0x00D4: 'ROUNDUP',
- 0x00D5: 'ROUNDDOWN',
- 0x00D6: 'ASC',
- 0x00D7: 'DBCS',
- 0x00D8: 'RANK',
- 0x00DB: 'ADDRESS',
- 0x00DC: 'DAYS360',
- 0x00DD: 'TODAY',
- 0x00DE: 'VDB',
- 0x00DF: 'ELSE',
- 0x00E0: 'ELSE.IF',
- 0x00E1: 'END.IF',
- 0x00E2: 'FOR.CELL',
- 0x00E3: 'MEDIAN',
- 0x00E4: 'SUMPRODUCT',
- 0x00E5: 'SINH',
- 0x00E6: 'COSH',
- 0x00E7: 'TANH',
- 0x00E8: 'ASINH',
- 0x00E9: 'ACOSH',
- 0x00EA: 'ATANH',
- 0x00EB: 'DGET',
- 0x00EC: 'CREATE.OBJECT',
- 0x00ED: 'VOLATILE',
- 0x00EE: 'LAST.ERROR',
- 0x00EF: 'CUSTOM.UNDO',
- 0x00F0: 'CUSTOM.REPEAT',
- 0x00F1: 'FORMULA.CONVERT',
- 0x00F2: 'GET.LINK.INFO',
- 0x00F3: 'TEXT.BOX',
- 0x00F4: 'INFO',
- 0x00F5: 'GROUP',
- 0x00F6: 'GET.OBJECT',
- 0x00F7: 'DB',
- 0x00F8: 'PAUSE',
- 0x00FB: 'RESUME',
- 0x00FC: 'FREQUENCY',
- 0x00FD: 'ADD.TOOLBAR',
- 0x00FE: 'DELETE.TOOLBAR',
- 0x00FF: 'User',
- 0x0100: 'RESET.TOOLBAR',
- 0x0101: 'EVALUATE',
- 0x0102: 'GET.TOOLBAR',
- 0x0103: 'GET.TOOL',
- 0x0104: 'SPELLING.CHECK',
- 0x0105: 'ERROR.TYPE',
- 0x0106: 'APP.TITLE',
- 0x0107: 'WINDOW.TITLE',
- 0x0108: 'SAVE.TOOLBAR',
- 0x0109: 'ENABLE.TOOL',
- 0x010A: 'PRESS.TOOL',
- 0x010B: 'REGISTER.ID',
- 0x010C: 'GET.WORKBOOK',
- 0x010D: 'AVEDEV',
- 0x010E: 'BETADIST',
- 0x010F: 'GAMMALN',
- 0x0110: 'BETAINV',
- 0x0111: 'BINOMDIST',
- 0x0112: 'CHIDIST',
- 0x0113: 'CHIINV',
- 0x0114: 'COMBIN',
- 0x0115: 'CONFIDENCE',
- 0x0116: 'CRITBINOM',
- 0x0117: 'EVEN',
- 0x0118: 'EXPONDIST',
- 0x0119: 'FDIST',
- 0x011A: 'FINV',
- 0x011B: 'FISHER',
- 0x011C: 'FISHERINV',
- 0x011D: 'FLOOR',
- 0x011E: 'GAMMADIST',
- 0x011F: 'GAMMAINV',
- 0x0120: 'CEILING',
- 0x0121: 'HYPGEOMDIST',
- 0x0122: 'LOGNORMDIST',
- 0x0123: 'LOGINV',
- 0x0124: 'NEGBINOMDIST',
- 0x0125: 'NORMDIST',
- 0x0126: 'NORMSDIST',
- 0x0127: 'NORMINV',
- 0x0128: 'NORMSINV',
- 0x0129: 'STANDARDIZE',
- 0x012A: 'ODD',
- 0x012B: 'PERMUT',
- 0x012C: 'POISSON',
- 0x012D: 'TDIST',
- 0x012E: 'WEIBULL',
- 0x012F: 'SUMXMY2',
- 0x0130: 'SUMX2MY2',
- 0x0131: 'SUMX2PY2',
- 0x0132: 'CHITEST',
- 0x0133: 'CORREL',
- 0x0134: 'COVAR',
- 0x0135: 'FORECAST',
- 0x0136: 'FTEST',
- 0x0137: 'INTERCEPT',
- 0x0138: 'PEARSON',
- 0x0139: 'RSQ',
- 0x013A: 'STEYX',
- 0x013B: 'SLOPE',
- 0x013C: 'TTEST',
- 0x013D: 'PROB',
- 0x013E: 'DEVSQ',
- 0x013F: 'GEOMEAN',
- 0x0140: 'HARMEAN',
- 0x0141: 'SUMSQ',
- 0x0142: 'KURT',
- 0x0143: 'SKEW',
- 0x0144: 'ZTEST',
- 0x0145: 'LARGE',
- 0x0146: 'SMALL',
- 0x0147: 'QUARTILE',
- 0x0148: 'PERCENTILE',
- 0x0149: 'PERCENTRANK',
- 0x014A: 'MODE',
- 0x014B: 'TRIMMEAN',
- 0x014C: 'TINV',
- 0x014E: 'MOVIE.COMMAND',
- 0x014F: 'GET.MOVIE',
- 0x0150: 'CONCATENATE',
- 0x0151: 'POWER',
- 0x0152: 'PIVOT.ADD.DATA',
- 0x0153: 'GET.PIVOT.TABLE',
- 0x0154: 'GET.PIVOT.FIELD',
- 0x0155: 'GET.PIVOT.ITEM',
- 0x0156: 'RADIANS',
- 0x0157: 'DEGREES',
- 0x0158: 'SUBTOTAL',
- 0x0159: 'SUMIF',
- 0x015A: 'COUNTIF',
- 0x015B: 'COUNTBLANK',
- 0x015C: 'SCENARIO.GET',
- 0x015D: 'OPTIONS.LISTS.GET',
- 0x015E: 'ISPMT',
- 0x015F: 'DATEDIF',
- 0x0160: 'DATESTRING',
- 0x0161: 'NUMBERSTRING',
- 0x0162: 'ROMAN',
- 0x0163: 'OPEN.DIALOG',
- 0x0164: 'SAVE.DIALOG',
- 0x0165: 'VIEW.GET',
- 0x0166: 'GETPIVOTDATA',
- 0x0167: 'HYPERLINK',
- 0x0168: 'PHONETIC',
- 0x0169: 'AVERAGEA',
- 0x016A: 'MAXA',
- 0x016B: 'MINA',
- 0x016C: 'STDEVPA',
- 0x016D: 'VARPA',
- 0x016E: 'STDEVA',
- 0x016F: 'VARA',
- 0x0170: 'BAHTTEXT',
- 0x0171: 'THAIDAYOFWEEK',
- 0x0172: 'THAIDIGIT',
- 0x0173: 'THAIMONTHOFYEAR',
- 0x0174: 'THAINUMSOUND',
- 0x0175: 'THAINUMSTRING',
- 0x0176: 'THAISTRINGLENGTH',
- 0x0177: 'ISTHAIDIGIT',
- 0x0178: 'ROUNDBAHTDOWN',
- 0x0179: 'ROUNDBAHTUP',
- 0x017A: 'THAIYEAR',
- 0x017B: 'RTD'
-};
-var FtabArgc = {
- 0x0002: 1, /* ISNA */
- 0x0003: 1, /* ISERROR */
- 0x000F: 1, /* SIN */
- 0x0010: 1, /* COS */
- 0x0011: 1, /* TAN */
- 0x0012: 1, /* ATAN */
- 0x0014: 1, /* SQRT */
- 0x0015: 1, /* EXP */
- 0x0016: 1, /* LN */
- 0x0017: 1, /* LOG10 */
- 0x0018: 1, /* ABS */
- 0x0019: 1, /* INT */
- 0x001A: 1, /* SIGN */
- 0x001B: 2, /* ROUND */
- 0x001E: 2, /* REPT */
- 0x001F: 3, /* MID */
- 0x0020: 1, /* LEN */
- 0x0021: 1, /* VALUE */
- 0x0026: 1, /* NOT */
- 0x0027: 2, /* MOD */
- 0x0028: 3, /* DCOUNT */
- 0x0029: 3, /* DSUM */
- 0x002A: 3, /* DAVERAGE */
- 0x002B: 3, /* DMIN */
- 0x002C: 3, /* DMAX */
- 0x002D: 3, /* DSTDEV */
- 0x002F: 3, /* DVAR */
- 0x0030: 2, /* TEXT */
- 0x0035: 1, /* GOTO */
- 0x003D: 3, /* MIRR */
- 0x0041: 3, /* DATE */
- 0x0042: 3, /* TIME */
- 0x0043: 1, /* DAY */
- 0x0044: 1, /* MONTH */
- 0x0045: 1, /* YEAR */
- 0x0047: 1, /* HOUR */
- 0x0048: 1, /* MINUTE */
- 0x0049: 1, /* SECOND */
- 0x004B: 1, /* AREAS */
- 0x004C: 1, /* ROWS */
- 0x004D: 1, /* COLUMNS */
- 0x004F: 2, /* ABSREF */
- 0x0050: 2, /* RELREF */
- 0x0053: 1, /* TRANSPOSE */
- 0x0056: 1, /* TYPE */
- 0x005A: 1, /* DEREF */
- 0x0061: 2, /* ATAN2 */
- 0x0062: 1, /* ASIN */
- 0x0063: 1, /* ACOS */
- 0x0069: 1, /* ISREF */
- 0x006F: 1, /* CHAR */
- 0x0070: 1, /* LOWER */
- 0x0071: 1, /* UPPER */
- 0x0072: 1, /* PROPER */
- 0x0075: 2, /* EXACT */
- 0x0076: 1, /* TRIM */
- 0x0077: 4, /* REPLACE */
- 0x0079: 1, /* CODE */
- 0x007E: 1, /* ISERR */
- 0x007F: 1, /* ISTEXT */
- 0x0080: 1, /* ISNUMBER */
- 0x0081: 1, /* ISBLANK */
- 0x0082: 1, /* T */
- 0x0083: 1, /* N */
- 0x0085: 1, /* FCLOSE */
- 0x0086: 1, /* FSIZE */
- 0x0087: 1, /* FREADLN */
- 0x0088: 2, /* FREAD */
- 0x0089: 2, /* FWRITELN */
- 0x008A: 2, /* FWRITE */
- 0x008C: 1, /* DATEVALUE */
- 0x008D: 1, /* TIMEVALUE */
- 0x008E: 3, /* SLN */
- 0x008F: 4, /* SYD */
- 0x00A2: 1, /* CLEAN */
- 0x00A3: 1, /* MDETERM */
- 0x00A4: 1, /* MINVERSE */
- 0x00A5: 2, /* MMULT */
- 0x00AC: 1, /* WHILE */
- 0x00AF: 2, /* INITIATE */
- 0x00B0: 2, /* REQUEST */
- 0x00B1: 3, /* POKE */
- 0x00B2: 2, /* EXECUTE */
- 0x00B3: 1, /* TERMINATE */
- 0x00B8: 1, /* FACT */
- 0x00BD: 3, /* DPRODUCT */
- 0x00BE: 1, /* ISNONTEXT */
- 0x00C3: 3, /* DSTDEVP */
- 0x00C4: 3, /* DVARP */
- 0x00C6: 1, /* ISLOGICAL */
- 0x00C7: 3, /* DCOUNTA */
- 0x00C9: 1, /* UNREGISTER */
- 0x00CF: 4, /* REPLACEB */
- 0x00D2: 3, /* MIDB */
- 0x00D3: 1, /* LENB */
- 0x00D4: 2, /* ROUNDUP */
- 0x00D5: 2, /* ROUNDDOWN */
- 0x00D6: 1, /* ASC */
- 0x00D7: 1, /* DBCS */
- 0x00E5: 1, /* SINH */
- 0x00E6: 1, /* COSH */
- 0x00E7: 1, /* TANH */
- 0x00E8: 1, /* ASINH */
- 0x00E9: 1, /* ACOSH */
- 0x00EA: 1, /* ATANH */
- 0x00EB: 3, /* DGET */
- 0x00F4: 1, /* INFO */
- 0x00FC: 2, /* FREQUENCY */
- 0x0101: 1, /* EVALUATE */
- 0x0105: 1, /* ERROR.TYPE */
- 0x010F: 1, /* GAMMALN */
- 0x0111: 4, /* BINOMDIST */
- 0x0112: 2, /* CHIDIST */
- 0x0113: 2, /* CHIINV */
- 0x0114: 2, /* COMBIN */
- 0x0115: 3, /* CONFIDENCE */
- 0x0116: 3, /* CRITBINOM */
- 0x0117: 1, /* EVEN */
- 0x0118: 3, /* EXPONDIST */
- 0x0119: 3, /* FDIST */
- 0x011A: 3, /* FINV */
- 0x011B: 1, /* FISHER */
- 0x011C: 1, /* FISHERINV */
- 0x011D: 2, /* FLOOR */
- 0x011E: 4, /* GAMMADIST */
- 0x011F: 3, /* GAMMAINV */
- 0x0120: 2, /* CEILING */
- 0x0121: 4, /* HYPGEOMDIST */
- 0x0122: 3, /* LOGNORMDIST */
- 0x0123: 3, /* LOGINV */
- 0x0124: 3, /* NEGBINOMDIST */
- 0x0125: 4, /* NORMDIST */
- 0x0126: 1, /* NORMSDIST */
- 0x0127: 3, /* NORMINV */
- 0x0128: 1, /* NORMSINV */
- 0x0129: 3, /* STANDARDIZE */
- 0x012A: 1, /* ODD */
- 0x012B: 2, /* PERMUT */
- 0x012C: 3, /* POISSON */
- 0x012D: 3, /* TDIST */
- 0x012E: 4, /* WEIBULL */
- 0x012F: 2, /* SUMXMY2 */
- 0x0130: 2, /* SUMX2MY2 */
- 0x0131: 2, /* SUMX2PY2 */
- 0x0132: 2, /* CHITEST */
- 0x0133: 2, /* CORREL */
- 0x0134: 2, /* COVAR */
- 0x0135: 3, /* FORECAST */
- 0x0136: 2, /* FTEST */
- 0x0137: 2, /* INTERCEPT */
- 0x0138: 2, /* PEARSON */
- 0x0139: 2, /* RSQ */
- 0x013A: 2, /* STEYX */
- 0x013B: 2, /* SLOPE */
- 0x013C: 4, /* TTEST */
- 0x0145: 2, /* LARGE */
- 0x0146: 2, /* SMALL */
- 0x0147: 2, /* QUARTILE */
- 0x0148: 2, /* PERCENTILE */
- 0x014B: 2, /* TRIMMEAN */
- 0x014C: 2, /* TINV */
- 0x0151: 2, /* POWER */
- 0x0156: 1, /* RADIANS */
- 0x0157: 1, /* DEGREES */
- 0x015A: 2, /* COUNTIF */
- 0x015B: 1, /* COUNTBLANK */
- 0x015E: 4, /* ISPMT */
- 0x015F: 3, /* DATEDIF */
- 0x0160: 1, /* DATESTRING */
- 0x0161: 2, /* NUMBERSTRING */
- 0x0168: 1, /* PHONETIC */
- 0x0170: 1, /* BAHTTEXT */
- 0x0171: 1, /* THAIDAYOFWEEK */
- 0x0172: 1, /* THAIDIGIT */
- 0x0173: 1, /* THAIMONTHOFYEAR */
- 0x0174: 1, /* THAINUMSOUND */
- 0x0175: 1, /* THAINUMSTRING */
- 0x0176: 1, /* THAISTRINGLENGTH */
- 0x0177: 1, /* ISTHAIDIGIT */
- 0x0178: 1, /* ROUNDBAHTDOWN */
- 0x0179: 1, /* ROUNDBAHTUP */
- 0x017A: 1, /* THAIYEAR */
- 0xFFFF: 0
-};
-/* [MS-XLSX] 2.2.3 Functions */
-var XLSXFutureFunctions = {
- "_xlfn.ACOT": "ACOT",
- "_xlfn.ACOTH": "ACOTH",
- "_xlfn.AGGREGATE": "AGGREGATE",
- "_xlfn.ARABIC": "ARABIC",
- "_xlfn.AVERAGEIF": "AVERAGEIF",
- "_xlfn.AVERAGEIFS": "AVERAGEIFS",
- "_xlfn.BASE": "BASE",
- "_xlfn.BETA.DIST": "BETA.DIST",
- "_xlfn.BETA.INV": "BETA.INV",
- "_xlfn.BINOM.DIST": "BINOM.DIST",
- "_xlfn.BINOM.DIST.RANGE": "BINOM.DIST.RANGE",
- "_xlfn.BINOM.INV": "BINOM.INV",
- "_xlfn.BITAND": "BITAND",
- "_xlfn.BITLSHIFT": "BITLSHIFT",
- "_xlfn.BITOR": "BITOR",
- "_xlfn.BITRSHIFT": "BITRSHIFT",
- "_xlfn.BITXOR": "BITXOR",
- "_xlfn.CEILING.MATH": "CEILING.MATH",
- "_xlfn.CEILING.PRECISE": "CEILING.PRECISE",
- "_xlfn.CHISQ.DIST": "CHISQ.DIST",
- "_xlfn.CHISQ.DIST.RT": "CHISQ.DIST.RT",
- "_xlfn.CHISQ.INV": "CHISQ.INV",
- "_xlfn.CHISQ.INV.RT": "CHISQ.INV.RT",
- "_xlfn.CHISQ.TEST": "CHISQ.TEST",
- "_xlfn.COMBINA": "COMBINA",
- "_xlfn.CONFIDENCE.NORM": "CONFIDENCE.NORM",
- "_xlfn.CONFIDENCE.T": "CONFIDENCE.T",
- "_xlfn.COT": "COT",
- "_xlfn.COTH": "COTH",
- "_xlfn.COUNTIFS": "COUNTIFS",
- "_xlfn.COVARIANCE.P": "COVARIANCE.P",
- "_xlfn.COVARIANCE.S": "COVARIANCE.S",
- "_xlfn.CSC": "CSC",
- "_xlfn.CSCH": "CSCH",
- "_xlfn.DAYS": "DAYS",
- "_xlfn.DECIMAL": "DECIMAL",
- "_xlfn.ECMA.CEILING": "ECMA.CEILING",
- "_xlfn.ERF.PRECISE": "ERF.PRECISE",
- "_xlfn.ERFC.PRECISE": "ERFC.PRECISE",
- "_xlfn.EXPON.DIST": "EXPON.DIST",
- "_xlfn.F.DIST": "F.DIST",
- "_xlfn.F.DIST.RT": "F.DIST.RT",
- "_xlfn.F.INV": "F.INV",
- "_xlfn.F.INV.RT": "F.INV.RT",
- "_xlfn.F.TEST": "F.TEST",
- "_xlfn.FILTERXML": "FILTERXML",
- "_xlfn.FLOOR.MATH": "FLOOR.MATH",
- "_xlfn.FLOOR.PRECISE": "FLOOR.PRECISE",
- "_xlfn.FORMULATEXT": "FORMULATEXT",
- "_xlfn.GAMMA": "GAMMA",
- "_xlfn.GAMMA.DIST": "GAMMA.DIST",
- "_xlfn.GAMMA.INV": "GAMMA.INV",
- "_xlfn.GAMMALN.PRECISE": "GAMMALN.PRECISE",
- "_xlfn.GAUSS": "GAUSS",
- "_xlfn.HYPGEOM.DIST": "HYPGEOM.DIST",
- "_xlfn.IFNA": "IFNA",
- "_xlfn.IFERROR": "IFERROR",
- "_xlfn.IMCOSH": "IMCOSH",
- "_xlfn.IMCOT": "IMCOT",
- "_xlfn.IMCSC": "IMCSC",
- "_xlfn.IMCSCH": "IMCSCH",
- "_xlfn.IMSEC": "IMSEC",
- "_xlfn.IMSECH": "IMSECH",
- "_xlfn.IMSINH": "IMSINH",
- "_xlfn.IMTAN": "IMTAN",
- "_xlfn.ISFORMULA": "ISFORMULA",
- "_xlfn.ISO.CEILING": "ISO.CEILING",
- "_xlfn.ISOWEEKNUM": "ISOWEEKNUM",
- "_xlfn.LOGNORM.DIST": "LOGNORM.DIST",
- "_xlfn.LOGNORM.INV": "LOGNORM.INV",
- "_xlfn.MODE.MULT": "MODE.MULT",
- "_xlfn.MODE.SNGL": "MODE.SNGL",
- "_xlfn.MUNIT": "MUNIT",
- "_xlfn.NEGBINOM.DIST": "NEGBINOM.DIST",
- "_xlfn.NETWORKDAYS.INTL": "NETWORKDAYS.INTL",
- "_xlfn.NIGBINOM": "NIGBINOM",
- "_xlfn.NORM.DIST": "NORM.DIST",
- "_xlfn.NORM.INV": "NORM.INV",
- "_xlfn.NORM.S.DIST": "NORM.S.DIST",
- "_xlfn.NORM.S.INV": "NORM.S.INV",
- "_xlfn.NUMBERVALUE": "NUMBERVALUE",
- "_xlfn.PDURATION": "PDURATION",
- "_xlfn.PERCENTILE.EXC": "PERCENTILE.EXC",
- "_xlfn.PERCENTILE.INC": "PERCENTILE.INC",
- "_xlfn.PERCENTRANK.EXC": "PERCENTRANK.EXC",
- "_xlfn.PERCENTRANK.INC": "PERCENTRANK.INC",
- "_xlfn.PERMUTATIONA": "PERMUTATIONA",
- "_xlfn.PHI": "PHI",
- "_xlfn.POISSON.DIST": "POISSON.DIST",
- "_xlfn.QUARTILE.EXC": "QUARTILE.EXC",
- "_xlfn.QUARTILE.INC": "QUARTILE.INC",
- "_xlfn.QUERYSTRING": "QUERYSTRING",
- "_xlfn.RANK.AVG": "RANK.AVG",
- "_xlfn.RANK.EQ": "RANK.EQ",
- "_xlfn.RRI": "RRI",
- "_xlfn.SEC": "SEC",
- "_xlfn.SECH": "SECH",
- "_xlfn.SHEET": "SHEET",
- "_xlfn.SHEETS": "SHEETS",
- "_xlfn.SKEW.P": "SKEW.P",
- "_xlfn.STDEV.P": "STDEV.P",
- "_xlfn.STDEV.S": "STDEV.S",
- "_xlfn.SUMIFS": "SUMIFS",
- "_xlfn.T.DIST": "T.DIST",
- "_xlfn.T.DIST.2T": "T.DIST.2T",
- "_xlfn.T.DIST.RT": "T.DIST.RT",
- "_xlfn.T.INV": "T.INV",
- "_xlfn.T.INV.2T": "T.INV.2T",
- "_xlfn.T.TEST": "T.TEST",
- "_xlfn.UNICHAR": "UNICHAR",
- "_xlfn.UNICODE": "UNICODE",
- "_xlfn.VAR.P": "VAR.P",
- "_xlfn.VAR.S": "VAR.S",
- "_xlfn.WEBSERVICE": "WEBSERVICE",
- "_xlfn.WEIBULL.DIST": "WEIBULL.DIST",
- "_xlfn.WORKDAY.INTL": "WORKDAY.INTL",
- "_xlfn.XOR": "XOR",
- "_xlfn.Z.TEST": "Z.TEST"
-};
-
-var strs = {}; // shared strings
-var _ssfopts = {}; // spreadsheet formatting options
-
-RELS.WS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet";
-
-function get_sst_id(sst, str) {
- for(var i = 0, len = sst.length; i < len; ++i) if(sst[i].t === str) { sst.Count ++; return i; }
- sst[len] = {t:str}; sst.Count ++; sst.Unique ++; return len;
-}
-
-function get_cell_style(styles, cell, opts) {
- var z = opts.revssf[cell.z != null ? cell.z : "General"];
- for(var i = 0, len = styles.length; i != len; ++i) if(styles[i].numFmtId === z) return i;
- styles[len] = {
- numFmtId:z,
- fontId:0,
- fillId:0,
- borderId:0,
- xfId:0,
- applyNumberFormat:1
- };
- return len;
-}
-
-function safe_format(p, fmtid, fillid, opts) {
- try {
- if(p.t === 'e') p.w = p.w || BErr[p.v];
- else if(fmtid === 0) {
- if(p.t === 'n') {
- if((p.v|0) === p.v) p.w = SSF._general_int(p.v,_ssfopts);
- else p.w = SSF._general_num(p.v,_ssfopts);
- }
- else if(p.t === 'd') {
- var dd = datenum(p.v);
- if((dd|0) === dd) p.w = SSF._general_int(dd,_ssfopts);
- else p.w = SSF._general_num(dd,_ssfopts);
- }
- else if(p.v === undefined) return "";
- else p.w = SSF._general(p.v,_ssfopts);
- }
- else if(p.t === 'd') p.w = SSF.format(fmtid,datenum(p.v),_ssfopts);
- else p.w = SSF.format(fmtid,p.v,_ssfopts);
- if(opts.cellNF) p.z = SSF._table[fmtid];
- } catch(e) { if(opts.WTF) throw e; }
- if(fillid) try {
- p.s = styles.Fills[fillid];
- if (p.s.fgColor && p.s.fgColor.theme) {
- p.s.fgColor.rgb = rgb_tint(themes.themeElements.clrScheme[p.s.fgColor.theme].rgb, p.s.fgColor.tint || 0);
- if(opts.WTF) p.s.fgColor.raw_rgb = themes.themeElements.clrScheme[p.s.fgColor.theme].rgb;
- }
- if (p.s.bgColor && p.s.bgColor.theme) {
- p.s.bgColor.rgb = rgb_tint(themes.themeElements.clrScheme[p.s.bgColor.theme].rgb, p.s.bgColor.tint || 0);
- if(opts.WTF) p.s.bgColor.raw_rgb = themes.themeElements.clrScheme[p.s.bgColor.theme].rgb;
- }
- } catch(e) { if(opts.WTF) throw e; }
-}
-function parse_ws_xml_dim(ws, s) {
- var d = safe_decode_range(s);
- if(d.s.r<=d.e.r && d.s.c<=d.e.c && d.s.r>=0 && d.s.c>=0) ws["!ref"] = encode_range(d);
-}
-var mergecregex = //g;
-var sheetdataregex = /<(?:\w+:)?sheetData>([^\u2603]*)<\/(?:\w+:)?sheetData>/;
-var hlinkregex = /]*\/>/g;
-var dimregex = /"(\w*:\w*)"/;
-var colregex = /]*\/>/g;
-/* 18.3 Worksheets */
-function parse_ws_xml(data, opts, rels) {
- if(!data) return data;
- /* 18.3.1.99 worksheet CT_Worksheet */
- var s = {};
-
- /* 18.3.1.35 dimension CT_SheetDimension ? */
- var ridx = data.indexOf(" 0) {
- var ref = data.substr(ridx,50).match(dimregex);
- if(ref != null) parse_ws_xml_dim(s, ref[1]);
- }
-
- /* 18.3.1.55 mergeCells CT_MergeCells */
- var mergecells = [];
- if(data.indexOf("")!==-1) {
- var merges = data.match(mergecregex);
- for(ridx = 0; ridx != merges.length; ++ridx)
- mergecells[ridx] = safe_decode_range(merges[ridx].substr(merges[ridx].indexOf("\"")+1));
- }
-
- /* 18.3.1.17 cols CT_Cols */
- var columns = [];
- if(opts.cellStyles && data.indexOf("")!==-1) {
- /* 18.3.1.13 col CT_Col */
- var cols = data.match(colregex);
- parse_ws_xml_cols(columns, cols);
- }
-
- var refguess = {s: {r:1000000, c:1000000}, e: {r:0, c:0} };
-
- /* 18.3.1.80 sheetData CT_SheetData ? */
- var mtch=data.match(sheetdataregex);
- if(mtch) parse_ws_xml_data(mtch[1], s, opts, refguess);
-
- /* 18.3.1.48 hyperlinks CT_Hyperlinks */
- if(data.indexOf("")!==-1) parse_ws_xml_hlinks(s, data.match(hlinkregex), rels);
-
- if(!s["!ref"] && refguess.e.c >= refguess.s.c && refguess.e.r >= refguess.s.r) s["!ref"] = encode_range(refguess);
- if(opts.sheetRows > 0 && s["!ref"]) {
- var tmpref = safe_decode_range(s["!ref"]);
- if(opts.sheetRows < +tmpref.e.r) {
- tmpref.e.r = opts.sheetRows - 1;
- if(tmpref.e.r > refguess.e.r) tmpref.e.r = refguess.e.r;
- if(tmpref.e.r < tmpref.s.r) tmpref.s.r = tmpref.e.r;
- if(tmpref.e.c > refguess.e.c) tmpref.e.c = refguess.e.c;
- if(tmpref.e.c < tmpref.s.c) tmpref.s.c = tmpref.e.c;
- s["!fullref"] = s["!ref"];
- s["!ref"] = encode_range(tmpref);
- }
- }
- if(mergecells.length > 0) s["!merges"] = mergecells;
- if(columns.length > 0) s["!cols"] = columns;
- return s;
-}
-
-function write_ws_xml_merges(merges) {
- if(merges.length == 0) return "";
- var o = '';
- for(var i = 0; i != merges.length; ++i) o += '';
- return o + '';
-}
-
-function parse_ws_xml_hlinks(s, data, rels) {
- for(var i = 0; i != data.length; ++i) {
- var val = parsexmltag(data[i], true);
- if(!val.ref) return;
- var rel = rels ? rels['!id'][val.id] : null;
- if(rel) {
- val.Target = rel.Target;
- if(val.location) val.Target += "#"+val.location;
- val.Rel = rel;
- } else {
- val.Target = val.location;
- rel = {Target: val.location, TargetMode: 'Internal'};
- val.Rel = rel;
- }
- var rng = safe_decode_range(val.ref);
- for(var R=rng.s.r;R<=rng.e.r;++R) for(var C=rng.s.c;C<=rng.e.c;++C) {
- var addr = encode_cell({c:C,r:R});
- if(!s[addr]) s[addr] = {t:"stub",v:undefined};
- s[addr].l = val;
- }
- }
-}
-
-function parse_ws_xml_cols(columns, cols) {
- var seencol = false;
- for(var coli = 0; coli != cols.length; ++coli) {
- var coll = parsexmltag(cols[coli], true);
- var colm=parseInt(coll.min, 10)-1, colM=parseInt(coll.max,10)-1;
- delete coll.min; delete coll.max;
- if(!seencol && coll.width) { seencol = true; find_mdw(+coll.width, coll); }
- if(coll.width) {
- coll.wpx = width2px(+coll.width);
- coll.wch = px2char(coll.wpx);
- coll.MDW = MDW;
- }
- while(colm <= colM) columns[colm++] = coll;
- }
-}
-
-function write_ws_xml_cols(ws, cols) {
- var o = [""], col, width;
- for(var i = 0; i != cols.length; ++i) {
- if(!(col = cols[i])) continue;
- var p = {min:i+1,max:i+1};
- /* wch (chars), wpx (pixels) */
- width = -1;
- if(col.wpx) width = px2char(col.wpx);
- else if(col.wch) width = col.wch;
- if(width > -1) { p.width = char2width(width); p.customWidth= 1; }
- o[o.length] = (writextag('col', null, p));
- }
- o[o.length] = "";
- return o.join("");
-}
-
-function write_ws_xml_cell(cell, ref, ws, opts, idx, wb) {
- if(cell.v === undefined) return "";
- var vv = "";
- var oldt = cell.t, oldv = cell.v;
- switch(cell.t) {
- case 'b': vv = cell.v ? "1" : "0"; break;
- case 'n': vv = ''+cell.v; break;
- case 'e': vv = BErr[cell.v]; break;
- case 'd':
- if(opts.cellDates) vv = new Date(cell.v).toISOString();
- else {
- cell.t = 'n';
- vv = ''+(cell.v = datenum(cell.v));
- if(typeof cell.z === 'undefined') cell.z = SSF._table[14];
- }
- break;
- default: vv = cell.v; break;
- }
- var v = writetag('v', escapexml(vv)), o = {r:ref};
- /* TODO: cell style */
- var os = get_cell_style(opts.cellXfs, cell, opts);
- if(os !== 0) o.s = os;
- switch(cell.t) {
- case 'n': break;
- case 'd': o.t = "d"; break;
- case 'b': o.t = "b"; break;
- case 'e': o.t = "e"; break;
- default:
- if(opts.bookSST) {
- v = writetag('v', ''+get_sst_id(opts.Strings, cell.v));
- o.t = "s"; break;
- }
- o.t = "str"; break;
- }
- if(cell.t != oldt) { cell.t = oldt; cell.v = oldv; }
- return writextag('c', v, o);
-}
-
-var parse_ws_xml_data = (function parse_ws_xml_data_factory() {
- var cellregex = /<(?:\w+:)?c[ >]/, rowregex = /<\/(?:\w+:)?row>/;
- var rregex = /r=["']([^"']*)["']/, isregex = /([\S\s]*?)<\/is>/;
- var match_v = matchtag("v"), match_f = matchtag("f");
-
-return function parse_ws_xml_data(sdata, s, opts, guess) {
- var ri = 0, x = "", cells = [], cref = [], idx = 0, i=0, cc=0, d="", p;
- var tag, tagr = 0, tagc = 0;
- var sstr;
- var fmtid = 0, fillid = 0, do_format = Array.isArray(styles.CellXf), cf;
- for(var marr = sdata.split(rowregex), mt = 0, marrlen = marr.length; mt != marrlen; ++mt) {
- x = marr[mt].trim();
- var xlen = x.length;
- if(xlen === 0) continue;
-
- /* 18.3.1.73 row CT_Row */
- for(ri = 0; ri < xlen; ++ri) if(x.charCodeAt(ri) === 62) break; ++ri;
- tag = parsexmltag(x.substr(0,ri), true);
- /* SpreadSheetGear uses implicit r/c */
- tagr = typeof tag.r !== 'undefined' ? parseInt(tag.r, 10) : tagr+1; tagc = -1;
- if(opts.sheetRows && opts.sheetRows < tagr) continue;
- if(guess.s.r > tagr - 1) guess.s.r = tagr - 1;
- if(guess.e.r < tagr - 1) guess.e.r = tagr - 1;
-
- /* 18.3.1.4 c CT_Cell */
- cells = x.substr(ri).split(cellregex);
- for(ri = typeof tag.r === 'undefined' ? 0 : 1; ri != cells.length; ++ri) {
- x = cells[ri].trim();
- if(x.length === 0) continue;
- cref = x.match(rregex); idx = ri; i=0; cc=0;
- x = "":"") + x;
- if(cref !== null && cref.length === 2) {
- idx = 0; d=cref[1];
- for(i=0; i != d.length; ++i) {
- if((cc=d.charCodeAt(i)-64) < 1 || cc > 26) break;
- idx = 26*idx + cc;
- }
- --idx;
- tagc = idx;
- } else ++tagc;
- for(i = 0; i != x.length; ++i) if(x.charCodeAt(i) === 62) break; ++i;
- tag = parsexmltag(x.substr(0,i), true);
- if(!tag.r) tag.r = utils.encode_cell({r:tagr-1, c:tagc});
- d = x.substr(i);
- p = {t:""};
-
- if((cref=d.match(match_v))!== null && cref[1] !== '') p.v=unescapexml(cref[1]);
- if(opts.cellFormula && (cref=d.match(match_f))!== null) p.f=unescapexml(cref[1]);
-
- /* SCHEMA IS ACTUALLY INCORRECT HERE. IF A CELL HAS NO T, EMIT "" */
- if(tag.t === undefined && p.v === undefined) {
- if(!opts.sheetStubs) continue;
- p.t = "stub";
- }
- else p.t = tag.t || "n";
- if(guess.s.c > idx) guess.s.c = idx;
- if(guess.e.c < idx) guess.e.c = idx;
- /* 18.18.11 t ST_CellType */
- switch(p.t) {
- case 'n': p.v = parseFloat(p.v); break;
- case 's':
- sstr = strs[parseInt(p.v, 10)];
- p.v = sstr.t;
- p.r = sstr.r;
- if(opts.cellHTML) p.h = sstr.h;
- break;
- case 'str':
- p.t = "s";
- p.v = (p.v!=null) ? utf8read(p.v) : '';
- if(opts.cellHTML) p.h = p.v;
- break;
- case 'inlineStr':
- cref = d.match(isregex);
- p.t = 's';
- if(cref !== null) { sstr = parse_si(cref[1]); p.v = sstr.t; } else p.v = "";
- break; // inline string
- case 'b': p.v = parsexmlbool(p.v); break;
- case 'd':
- if(!opts.cellDates) { p.v = datenum(p.v); p.t = 'n'; }
- break;
- /* error string in .v, number in .v */
- case 'e': p.w = p.v; p.v = RBErr[p.v]; break;
- }
- /* formatting */
- fmtid = fillid = 0;
- if(do_format && tag.s !== undefined) {
- cf = styles.CellXf[tag.s];
- if(cf != null) {
- if(cf.numFmtId != null) fmtid = cf.numFmtId;
- if(opts.cellStyles && cf.fillId != null) fillid = cf.fillId;
- }
- }
- safe_format(p, fmtid, fillid, opts);
- s[tag.r] = p;
- }
- }
-}; })();
-
-function write_ws_xml_data(ws, opts, idx, wb) {
- var o = [], r = [], range = safe_decode_range(ws['!ref']), cell, ref, rr = "", cols = [], R, C;
- for(C = range.s.c; C <= range.e.c; ++C) cols[C] = encode_col(C);
- for(R = range.s.r; R <= range.e.r; ++R) {
- r = [];
- rr = encode_row(R);
- for(C = range.s.c; C <= range.e.c; ++C) {
- ref = cols[C] + rr;
- if(ws[ref] === undefined) continue;
- if((cell = write_ws_xml_cell(ws[ref], ref, ws, opts, idx, wb)) != null) r.push(cell);
- }
- if(r.length > 0) o[o.length] = (writextag('row', r.join(""), {r:rr}));
- }
- return o.join("");
-}
-
-var WS_XML_ROOT = writextag('worksheet', null, {
- 'xmlns': XMLNS.main[0],
- 'xmlns:r': XMLNS.r
-});
-
-function write_ws_xml(idx, opts, wb) {
- var o = [XML_HEADER, WS_XML_ROOT];
- var s = wb.SheetNames[idx], sidx = 0, rdata = "";
- var ws = wb.Sheets[s];
- if(ws === undefined) ws = {};
- var ref = ws['!ref']; if(ref === undefined) ref = 'A1';
- o[o.length] = (writextag('dimension', null, {'ref': ref}));
-
- if(ws['!cols'] !== undefined && ws['!cols'].length > 0) o[o.length] = (write_ws_xml_cols(ws, ws['!cols']));
- o[sidx = o.length] = '';
- if(ws['!ref'] !== undefined) {
- rdata = write_ws_xml_data(ws, opts, idx, wb);
- if(rdata.length > 0) o[o.length] = (rdata);
- }
- if(o.length>sidx+1) { o[o.length] = (''); o[sidx]=o[sidx].replace("/>",">"); }
-
- if(ws['!merges'] !== undefined && ws['!merges'].length > 0) o[o.length] = (write_ws_xml_merges(ws['!merges']));
-
- if(o.length>2) { o[o.length] = (''); o[1]=o[1].replace("/>",">"); }
- return o.join("");
-}
-
-/* [MS-XLSB] 2.4.718 BrtRowHdr */
-function parse_BrtRowHdr(data, length) {
- var z = [];
- z.r = data.read_shift(4);
- data.l += length-4;
- return z;
-}
-
-/* [MS-XLSB] 2.4.812 BrtWsDim */
-var parse_BrtWsDim = parse_UncheckedRfX;
-var write_BrtWsDim = write_UncheckedRfX;
-
-/* [MS-XLSB] 2.4.815 BrtWsProp */
-function parse_BrtWsProp(data, length) {
- var z = {};
- /* TODO: pull flags */
- data.l += 19;
- z.name = parse_XLSBCodeName(data, length - 19);
- return z;
-}
-
-/* [MS-XLSB] 2.4.303 BrtCellBlank */
-function parse_BrtCellBlank(data, length) {
- var cell = parse_XLSBCell(data);
- return [cell];
-}
-function write_BrtCellBlank(cell, val, o) {
- if(o == null) o = new_buf(8);
- return write_XLSBCell(val, o);
-}
-
-
-/* [MS-XLSB] 2.4.304 BrtCellBool */
-function parse_BrtCellBool(data, length) {
- var cell = parse_XLSBCell(data);
- var fBool = data.read_shift(1);
- return [cell, fBool, 'b'];
-}
-
-/* [MS-XLSB] 2.4.305 BrtCellError */
-function parse_BrtCellError(data, length) {
- var cell = parse_XLSBCell(data);
- var fBool = data.read_shift(1);
- return [cell, fBool, 'e'];
-}
-
-/* [MS-XLSB] 2.4.308 BrtCellIsst */
-function parse_BrtCellIsst(data, length) {
- var cell = parse_XLSBCell(data);
- var isst = data.read_shift(4);
- return [cell, isst, 's'];
-}
-
-/* [MS-XLSB] 2.4.310 BrtCellReal */
-function parse_BrtCellReal(data, length) {
- var cell = parse_XLSBCell(data);
- var value = parse_Xnum(data);
- return [cell, value, 'n'];
-}
-
-/* [MS-XLSB] 2.4.311 BrtCellRk */
-function parse_BrtCellRk(data, length) {
- var cell = parse_XLSBCell(data);
- var value = parse_RkNumber(data);
- return [cell, value, 'n'];
-}
-
-/* [MS-XLSB] 2.4.314 BrtCellSt */
-function parse_BrtCellSt(data, length) {
- var cell = parse_XLSBCell(data);
- var value = parse_XLWideString(data);
- return [cell, value, 'str'];
-}
-
-/* [MS-XLSB] 2.4.647 BrtFmlaBool */
-function parse_BrtFmlaBool(data, length, opts) {
- var cell = parse_XLSBCell(data);
- var value = data.read_shift(1);
- var o = [cell, value, 'b'];
- if(opts.cellFormula) {
- var formula = parse_XLSBCellParsedFormula(data, length-9);
- o[3] = ""; /* TODO */
- }
- else data.l += length-9;
- return o;
-}
-
-/* [MS-XLSB] 2.4.648 BrtFmlaError */
-function parse_BrtFmlaError(data, length, opts) {
- var cell = parse_XLSBCell(data);
- var value = data.read_shift(1);
- var o = [cell, value, 'e'];
- if(opts.cellFormula) {
- var formula = parse_XLSBCellParsedFormula(data, length-9);
- o[3] = ""; /* TODO */
- }
- else data.l += length-9;
- return o;
-}
-
-/* [MS-XLSB] 2.4.649 BrtFmlaNum */
-function parse_BrtFmlaNum(data, length, opts) {
- var cell = parse_XLSBCell(data);
- var value = parse_Xnum(data);
- var o = [cell, value, 'n'];
- if(opts.cellFormula) {
- var formula = parse_XLSBCellParsedFormula(data, length - 16);
- o[3] = ""; /* TODO */
- }
- else data.l += length-16;
- return o;
-}
-
-/* [MS-XLSB] 2.4.650 BrtFmlaString */
-function parse_BrtFmlaString(data, length, opts) {
- var start = data.l;
- var cell = parse_XLSBCell(data);
- var value = parse_XLWideString(data);
- var o = [cell, value, 'str'];
- if(opts.cellFormula) {
- var formula = parse_XLSBCellParsedFormula(data, start + length - data.l);
- }
- else data.l = start + length;
- return o;
-}
-
-/* [MS-XLSB] 2.4.676 BrtMergeCell */
-var parse_BrtMergeCell = parse_UncheckedRfX;
-
-/* [MS-XLSB] 2.4.656 BrtHLink */
-function parse_BrtHLink(data, length, opts) {
- var end = data.l + length;
- var rfx = parse_UncheckedRfX(data, 16);
- var relId = parse_XLNullableWideString(data);
- var loc = parse_XLWideString(data);
- var tooltip = parse_XLWideString(data);
- var display = parse_XLWideString(data);
- data.l = end;
- return {rfx:rfx, relId:relId, loc:loc, tooltip:tooltip, display:display};
-}
-
-/* [MS-XLSB] 2.1.7.61 Worksheet */
-function parse_ws_bin(data, opts, rels) {
- if(!data) return data;
- if(!rels) rels = {'!id':{}};
- var s = {};
-
- var ref;
- var refguess = {s: {r:1000000, c:1000000}, e: {r:0, c:0} };
-
- var pass = false, end = false;
- var row, p, cf, R, C, addr, sstr, rr;
- var mergecells = [];
- recordhopper(data, function ws_parse(val, R) {
- if(end) return;
- switch(R.n) {
- case 'BrtWsDim': ref = val; break;
- case 'BrtRowHdr':
- row = val;
- if(opts.sheetRows && opts.sheetRows <= row.r) end=true;
- rr = encode_row(row.r);
- break;
-
- case 'BrtFmlaBool':
- case 'BrtFmlaError':
- case 'BrtFmlaNum':
- case 'BrtFmlaString':
- case 'BrtCellBool':
- case 'BrtCellError':
- case 'BrtCellIsst':
- case 'BrtCellReal':
- case 'BrtCellRk':
- case 'BrtCellSt':
- p = {t:val[2]};
- switch(val[2]) {
- case 'n': p.v = val[1]; break;
- case 's': sstr = strs[val[1]]; p.v = sstr.t; p.r = sstr.r; break;
- case 'b': p.v = val[1] ? true : false; break;
- case 'e': p.v = val[1]; p.w = BErr[p.v]; break;
- case 'str': p.t = 's'; p.v = utf8read(val[1]); break;
- }
- if(opts.cellFormula && val.length > 3) p.f = val[3];
- if((cf = styles.CellXf[val[0].iStyleRef])) safe_format(p,cf.ifmt,null,opts);
- s[encode_col(C=val[0].c) + rr] = p;
- if(refguess.s.r > row.r) refguess.s.r = row.r;
- if(refguess.s.c > C) refguess.s.c = C;
- if(refguess.e.r < row.r) refguess.e.r = row.r;
- if(refguess.e.c < C) refguess.e.c = C;
- break;
-
- case 'BrtCellBlank': if(!opts.sheetStubs) break;
- p = {t:'s',v:undefined};
- s[encode_col(C=val[0].c) + rr] = p;
- if(refguess.s.r > row.r) refguess.s.r = row.r;
- if(refguess.s.c > C) refguess.s.c = C;
- if(refguess.e.r < row.r) refguess.e.r = row.r;
- if(refguess.e.c < C) refguess.e.c = C;
- break;
-
- /* Merge Cells */
- case 'BrtBeginMergeCells': break;
- case 'BrtEndMergeCells': break;
- case 'BrtMergeCell': mergecells.push(val); break;
-
- case 'BrtHLink':
- var rel = rels['!id'][val.relId];
- if(rel) {
- val.Target = rel.Target;
- if(val.loc) val.Target += "#"+val.loc;
- val.Rel = rel;
- }
- for(R=val.rfx.s.r;R<=val.rfx.e.r;++R) for(C=val.rfx.s.c;C<=val.rfx.e.c;++C) {
- addr = encode_cell({c:C,r:R});
- if(!s[addr]) s[addr] = {t:'s',v:undefined};
- s[addr].l = val;
- }
- break;
-
- case 'BrtArrFmla': break; // TODO
- case 'BrtShrFmla': break; // TODO
- case 'BrtBeginSheet': break;
- case 'BrtWsProp': break; // TODO
- case 'BrtSheetCalcProp': break; // TODO
- case 'BrtBeginWsViews': break; // TODO
- case 'BrtBeginWsView': break; // TODO
- case 'BrtPane': break; // TODO
- case 'BrtSel': break; // TODO
- case 'BrtEndWsView': break; // TODO
- case 'BrtEndWsViews': break; // TODO
- case 'BrtACBegin': break; // TODO
- case 'BrtRwDescent': break; // TODO
- case 'BrtACEnd': break; // TODO
- case 'BrtWsFmtInfoEx14': break; // TODO
- case 'BrtWsFmtInfo': break; // TODO
- case 'BrtBeginColInfos': break; // TODO
- case 'BrtColInfo': break; // TODO
- case 'BrtEndColInfos': break; // TODO
- case 'BrtBeginSheetData': break; // TODO
- case 'BrtEndSheetData': break; // TODO
- case 'BrtSheetProtection': break; // TODO
- case 'BrtPrintOptions': break; // TODO
- case 'BrtMargins': break; // TODO
- case 'BrtPageSetup': break; // TODO
- case 'BrtFRTBegin': pass = true; break;
- case 'BrtFRTEnd': pass = false; break;
- case 'BrtEndSheet': break; // TODO
- case 'BrtDrawing': break; // TODO
- case 'BrtLegacyDrawing': break; // TODO
- case 'BrtLegacyDrawingHF': break; // TODO
- case 'BrtPhoneticInfo': break; // TODO
- case 'BrtBeginHeaderFooter': break; // TODO
- case 'BrtEndHeaderFooter': break; // TODO
- case 'BrtBrk': break; // TODO
- case 'BrtBeginRwBrk': break; // TODO
- case 'BrtEndRwBrk': break; // TODO
- case 'BrtBeginColBrk': break; // TODO
- case 'BrtEndColBrk': break; // TODO
- case 'BrtBeginUserShViews': break; // TODO
- case 'BrtBeginUserShView': break; // TODO
- case 'BrtEndUserShView': break; // TODO
- case 'BrtEndUserShViews': break; // TODO
- case 'BrtBkHim': break; // TODO
- case 'BrtBeginOleObjects': break; // TODO
- case 'BrtOleObject': break; // TODO
- case 'BrtEndOleObjects': break; // TODO
- case 'BrtBeginListParts': break; // TODO
- case 'BrtListPart': break; // TODO
- case 'BrtEndListParts': break; // TODO
- case 'BrtBeginSortState': break; // TODO
- case 'BrtBeginSortCond': break; // TODO
- case 'BrtEndSortCond': break; // TODO
- case 'BrtEndSortState': break; // TODO
- case 'BrtBeginConditionalFormatting': break; // TODO
- case 'BrtEndConditionalFormatting': break; // TODO
- case 'BrtBeginCFRule': break; // TODO
- case 'BrtEndCFRule': break; // TODO
- case 'BrtBeginDVals': break; // TODO
- case 'BrtDVal': break; // TODO
- case 'BrtEndDVals': break; // TODO
- case 'BrtRangeProtection': break; // TODO
- case 'BrtBeginDCon': break; // TODO
- case 'BrtEndDCon': break; // TODO
- case 'BrtBeginDRefs': break;
- case 'BrtDRef': break;
- case 'BrtEndDRefs': break;
-
- /* ActiveX */
- case 'BrtBeginActiveXControls': break;
- case 'BrtActiveX': break;
- case 'BrtEndActiveXControls': break;
-
- /* AutoFilter */
- case 'BrtBeginAFilter': break;
- case 'BrtEndAFilter': break;
- case 'BrtBeginFilterColumn': break;
- case 'BrtBeginFilters': break;
- case 'BrtFilter': break;
- case 'BrtEndFilters': break;
- case 'BrtEndFilterColumn': break;
- case 'BrtDynamicFilter': break;
- case 'BrtTop10Filter': break;
- case 'BrtBeginCustomFilters': break;
- case 'BrtCustomFilter': break;
- case 'BrtEndCustomFilters': break;
-
- /* Smart Tags */
- case 'BrtBeginSmartTags': break;
- case 'BrtBeginCellSmartTags': break;
- case 'BrtBeginCellSmartTag': break;
- case 'BrtCellSmartTagProperty': break;
- case 'BrtEndCellSmartTag': break;
- case 'BrtEndCellSmartTags': break;
- case 'BrtEndSmartTags': break;
-
- /* Cell Watch */
- case 'BrtBeginCellWatches': break;
- case 'BrtCellWatch': break;
- case 'BrtEndCellWatches': break;
-
- /* Table */
- case 'BrtTable': break;
-
- /* Ignore Cell Errors */
- case 'BrtBeginCellIgnoreECs': break;
- case 'BrtCellIgnoreEC': break;
- case 'BrtEndCellIgnoreECs': break;
-
- default: if(!pass || opts.WTF) throw new Error("Unexpected record " + R.n);
- }
- }, opts);
- if(!s["!ref"] && (refguess.s.r < 1000000 || ref.e.r > 0 || ref.e.c > 0 || ref.s.r > 0 || ref.s.c > 0)) s["!ref"] = encode_range(ref);
- if(opts.sheetRows && s["!ref"]) {
- var tmpref = safe_decode_range(s["!ref"]);
- if(opts.sheetRows < +tmpref.e.r) {
- tmpref.e.r = opts.sheetRows - 1;
- if(tmpref.e.r > refguess.e.r) tmpref.e.r = refguess.e.r;
- if(tmpref.e.r < tmpref.s.r) tmpref.s.r = tmpref.e.r;
- if(tmpref.e.c > refguess.e.c) tmpref.e.c = refguess.e.c;
- if(tmpref.e.c < tmpref.s.c) tmpref.s.c = tmpref.e.c;
- s["!fullref"] = s["!ref"];
- s["!ref"] = encode_range(tmpref);
- }
- }
- if(mergecells.length > 0) s["!merges"] = mergecells;
- return s;
-}
-
-/* TODO: something useful -- this is a stub */
-function write_ws_bin_cell(ba, cell, R, C, opts) {
- if(cell.v === undefined) return "";
- var vv = "";
- switch(cell.t) {
- case 'b': vv = cell.v ? "1" : "0"; break;
- case 'n': case 'e': vv = ''+cell.v; break;
- default: vv = cell.v; break;
- }
- var o = {r:R, c:C};
- /* TODO: cell style */
- o.s = get_cell_style(opts.cellXfs, cell, opts);
- switch(cell.t) {
- case 's': case 'str':
- if(opts.bookSST) {
- vv = get_sst_id(opts.Strings, cell.v);
- o.t = "s"; break;
- }
- o.t = "str"; break;
- case 'n': break;
- case 'b': o.t = "b"; break;
- case 'e': o.t = "e"; break;
- }
- write_record(ba, "BrtCellBlank", write_BrtCellBlank(cell, o));
-}
-
-function write_CELLTABLE(ba, ws, idx, opts, wb) {
- var range = safe_decode_range(ws['!ref'] || "A1"), ref, rr = "", cols = [];
- write_record(ba, 'BrtBeginSheetData');
- for(var R = range.s.r; R <= range.e.r; ++R) {
- rr = encode_row(R);
- /* [ACCELLTABLE] */
- /* BrtRowHdr */
- for(var C = range.s.c; C <= range.e.c; ++C) {
- /* *16384CELL */
- if(R === range.s.r) cols[C] = encode_col(C);
- ref = cols[C] + rr;
- if(!ws[ref]) continue;
- /* write cell */
- write_ws_bin_cell(ba, ws[ref], R, C, opts);
- }
- }
- write_record(ba, 'BrtEndSheetData');
-}
-
-function write_ws_bin(idx, opts, wb) {
- var ba = buf_array();
- var s = wb.SheetNames[idx], ws = wb.Sheets[s] || {};
- var r = safe_decode_range(ws['!ref'] || "A1");
- write_record(ba, "BrtBeginSheet");
- /* [BrtWsProp] */
- write_record(ba, "BrtWsDim", write_BrtWsDim(r));
- /* [WSVIEWS2] */
- /* [WSFMTINFO] */
- /* *COLINFOS */
- write_CELLTABLE(ba, ws, idx, opts, wb);
- /* [BrtSheetCalcProp] */
- /* [[BrtSheetProtectionIso] BrtSheetProtection] */
- /* *([BrtRangeProtectionIso] BrtRangeProtection) */
- /* [SCENMAN] */
- /* [AUTOFILTER] */
- /* [SORTSTATE] */
- /* [DCON] */
- /* [USERSHVIEWS] */
- /* [MERGECELLS] */
- /* [BrtPhoneticInfo] */
- /* *CONDITIONALFORMATTING */
- /* [DVALS] */
- /* *BrtHLink */
- /* [BrtPrintOptions] */
- /* [BrtMargins] */
- /* [BrtPageSetup] */
- /* [HEADERFOOTER] */
- /* [RWBRK] */
- /* [COLBRK] */
- /* *BrtBigName */
- /* [CELLWATCHES] */
- /* [IGNOREECS] */
- /* [SMARTTAGS] */
- /* [BrtDrawing] */
- /* [BrtLegacyDrawing] */
- /* [BrtLegacyDrawingHF] */
- /* [BrtBkHim] */
- /* [OLEOBJECTS] */
- /* [ACTIVEXCONTROLS] */
- /* [WEBPUBITEMS] */
- /* [LISTPARTS] */
- /* FRTWORKSHEET */
- write_record(ba, "BrtEndSheet");
- return ba.end();
-}
-/* 18.2.28 (CT_WorkbookProtection) Defaults */
-var WBPropsDef = [
- ['allowRefreshQuery', '0'],
- ['autoCompressPictures', '1'],
- ['backupFile', '0'],
- ['checkCompatibility', '0'],
- ['codeName', ''],
- ['date1904', '0'],
- ['dateCompatibility', '1'],
- //['defaultThemeVersion', '0'],
- ['filterPrivacy', '0'],
- ['hidePivotFieldList', '0'],
- ['promptedSolutions', '0'],
- ['publishItems', '0'],
- ['refreshAllConnections', false],
- ['saveExternalLinkValues', '1'],
- ['showBorderUnselectedTables', '1'],
- ['showInkAnnotation', '1'],
- ['showObjects', 'all'],
- ['showPivotChartFilter', '0']
- //['updateLinks', 'userSet']
-];
-
-/* 18.2.30 (CT_BookView) Defaults */
-var WBViewDef = [
- ['activeTab', '0'],
- ['autoFilterDateGrouping', '1'],
- ['firstSheet', '0'],
- ['minimized', '0'],
- ['showHorizontalScroll', '1'],
- ['showSheetTabs', '1'],
- ['showVerticalScroll', '1'],
- ['tabRatio', '600'],
- ['visibility', 'visible']
- //window{Height,Width}, {x,y}Window
-];
-
-/* 18.2.19 (CT_Sheet) Defaults */
-var SheetDef = [
- ['state', 'visible']
-];
-
-/* 18.2.2 (CT_CalcPr) Defaults */
-var CalcPrDef = [
- ['calcCompleted', 'true'],
- ['calcMode', 'auto'],
- ['calcOnSave', 'true'],
- ['concurrentCalc', 'true'],
- ['fullCalcOnLoad', 'false'],
- ['fullPrecision', 'true'],
- ['iterate', 'false'],
- ['iterateCount', '100'],
- ['iterateDelta', '0.001'],
- ['refMode', 'A1']
-];
-
-/* 18.2.3 (CT_CustomWorkbookView) Defaults */
-var CustomWBViewDef = [
- ['autoUpdate', 'false'],
- ['changesSavedWin', 'false'],
- ['includeHiddenRowCol', 'true'],
- ['includePrintSettings', 'true'],
- ['maximized', 'false'],
- ['minimized', 'false'],
- ['onlySync', 'false'],
- ['personalView', 'false'],
- ['showComments', 'commIndicator'],
- ['showFormulaBar', 'true'],
- ['showHorizontalScroll', 'true'],
- ['showObjects', 'all'],
- ['showSheetTabs', 'true'],
- ['showStatusbar', 'true'],
- ['showVerticalScroll', 'true'],
- ['tabRatio', '600'],
- ['xWindow', '0'],
- ['yWindow', '0']
-];
-
-function push_defaults_array(target, defaults) {
- for(var j = 0; j != target.length; ++j) { var w = target[j];
- for(var i=0; i != defaults.length; ++i) { var z = defaults[i];
- if(w[z[0]] == null) w[z[0]] = z[1];
- }
- }
-}
-function push_defaults(target, defaults) {
- for(var i = 0; i != defaults.length; ++i) { var z = defaults[i];
- if(target[z[0]] == null) target[z[0]] = z[1];
- }
-}
-
-function parse_wb_defaults(wb) {
- push_defaults(wb.WBProps, WBPropsDef);
- push_defaults(wb.CalcPr, CalcPrDef);
-
- push_defaults_array(wb.WBView, WBViewDef);
- push_defaults_array(wb.Sheets, SheetDef);
-
- _ssfopts.date1904 = parsexmlbool(wb.WBProps.date1904, 'date1904');
-}
-/* 18.2 Workbook */
-var wbnsregex = /<\w+:workbook/;
-function parse_wb_xml(data, opts) {
- var wb = { AppVersion:{}, WBProps:{}, WBView:[], Sheets:[], CalcPr:{}, xmlns: "" };
- var pass = false, xmlns = "xmlns";
- data.match(tagregex).forEach(function xml_wb(x) {
- var y = parsexmltag(x);
- switch(strip_ns(y[0])) {
- case '': break;
-
- /* 18.2.13 fileVersion CT_FileVersion ? */
- case '': break;
-
- /* 18.2.12 fileSharing CT_FileSharing ? */
- case '': break;
-
- /* 18.2.28 workbookPr CT_WorkbookPr ? */
- case '': delete y[0]; wb.WBProps = y; break;
-
- /* 18.2.29 workbookProtection CT_WorkbookProtection ? */
- case '': break;
-
- /* 18.2.1 bookViews CT_BookViews ? */
- case '': case '': break;
- /* 18.2.30 workbookView CT_BookView + */
- case '': case '': break; // aggregate sheet
- /* 18.2.19 sheet CT_Sheet + */
- case '': break;
- /* 18.2.14 functionGroup CT_FunctionGroup + */
- case '': case '': break;
- /* 18.2.8 externalReference CT_ExternalReference + */
- case '': break;
- case '': case '': pass=false; break;
- /* 18.2.5 definedName CT_DefinedName + */
- case '': case '': break;
-
- /* 18.2.2 calcPr CT_CalcPr ? */
- case '': delete y[0]; wb.CalcPr = y; break;
-
- /* 18.2.16 oleSize CT_OleSize ? (ref required) */
- case '': case '': case '': break;
-
- /* 18.2.18 pivotCaches CT_PivotCaches ? */
- case '': case '': case '': break;
-
- /* 18.2.23 smartTagTypes CT_SmartTagTypes ? */
- case '': case '': break;
- /* 18.2.22 smartTagType CT_SmartTagType ? */
- case '': break;
-
- /* 18.2.11 fileRecoveryPr CT_FileRecoveryPr ? */
- case '': break;
-
- /* 18.2.26 webPublishObjects CT_WebPublishObjects ? */
- case '': case '': break;
- /* 18.2.25 webPublishObject CT_WebPublishObject ? */
- case '': case '': case '': break;
- /* 18.2.7 ext CT_Extension + */
- case '': pass=false; break;
-
- /* Others */
- case '': pass=false; break;
-
- default: if(!pass && opts.WTF) throw 'unrecognized ' + y[0] + ' in workbook';
- }
- });
- if(XMLNS.main.indexOf(wb.xmlns) === -1) throw new Error("Unknown Namespace: " + wb.xmlns);
-
- parse_wb_defaults(wb);
-
- return wb;
-}
-
-var WB_XML_ROOT = writextag('workbook', null, {
- 'xmlns': XMLNS.main[0],
- //'xmlns:mx': XMLNS.mx,
- //'xmlns:s': XMLNS.main[0],
- 'xmlns:r': XMLNS.r
-});
-
-function safe1904(wb) {
- /* TODO: store date1904 somewhere else */
- try { return parsexmlbool(wb.Workbook.WBProps.date1904) ? "true" : "false"; } catch(e) { return "false"; }
-}
-
-function write_wb_xml(wb, opts) {
- var o = [XML_HEADER];
- o[o.length] = WB_XML_ROOT;
- o[o.length] = (writextag('workbookPr', null, {date1904:safe1904(wb)}));
- o[o.length] = "";
- for(var i = 0; i != wb.SheetNames.length; ++i)
- o[o.length] = (writextag('sheet',null,{name:wb.SheetNames[i].substr(0,31), sheetId:""+(i+1), "r:id":"rId"+(i+1)}));
- o[o.length] = "";
- if(o.length>2){ o[o.length] = ''; o[1]=o[1].replace("/>",">"); }
- return o.join("");
-}
-/* [MS-XLSB] 2.4.301 BrtBundleSh */
-function parse_BrtBundleSh(data, length) {
- var z = {};
- z.hsState = data.read_shift(4); //ST_SheetState
- z.iTabID = data.read_shift(4);
- z.strRelID = parse_RelID(data,length-8);
- z.name = parse_XLWideString(data);
- return z;
-}
-function write_BrtBundleSh(data, o) {
- if(!o) o = new_buf(127);
- o.write_shift(4, data.hsState);
- o.write_shift(4, data.iTabID);
- write_RelID(data.strRelID, o);
- write_XLWideString(data.name.substr(0,31), o);
- return o;
-}
-
-/* [MS-XLSB] 2.4.807 BrtWbProp */
-function parse_BrtWbProp(data, length) {
- data.read_shift(4);
- var dwThemeVersion = data.read_shift(4);
- var strName = (length > 8) ? parse_XLWideString(data) : "";
- return [dwThemeVersion, strName];
-}
-function write_BrtWbProp(data, o) {
- if(!o) o = new_buf(8);
- o.write_shift(4, 0);
- o.write_shift(4, 0);
- return o;
-}
-
-function parse_BrtFRTArchID$(data, length) {
- var o = {};
- data.read_shift(4);
- o.ArchID = data.read_shift(4);
- data.l += length - 8;
- return o;
-}
-
-/* [MS-XLSB] 2.1.7.60 Workbook */
-function parse_wb_bin(data, opts) {
- var wb = { AppVersion:{}, WBProps:{}, WBView:[], Sheets:[], CalcPr:{}, xmlns: "" };
- var pass = false, z;
-
- recordhopper(data, function hopper_wb(val, R) {
- switch(R.n) {
- case 'BrtBundleSh': wb.Sheets.push(val); break;
-
- case 'BrtBeginBook': break;
- case 'BrtFileVersion': break;
- case 'BrtWbProp': break;
- case 'BrtACBegin': break;
- case 'BrtAbsPath15': break;
- case 'BrtACEnd': break;
- case 'BrtWbFactoid': break;
- /*case 'BrtBookProtectionIso': break;*/
- case 'BrtBookProtection': break;
- case 'BrtBeginBookViews': break;
- case 'BrtBookView': break;
- case 'BrtEndBookViews': break;
- case 'BrtBeginBundleShs': break;
- case 'BrtEndBundleShs': break;
- case 'BrtBeginFnGroup': break;
- case 'BrtEndFnGroup': break;
- case 'BrtBeginExternals': break;
- case 'BrtSupSelf': break;
- case 'BrtSupBookSrc': break;
- case 'BrtExternSheet': break;
- case 'BrtEndExternals': break;
- case 'BrtName': break;
- case 'BrtCalcProp': break;
- case 'BrtUserBookView': break;
- case 'BrtBeginPivotCacheIDs': break;
- case 'BrtBeginPivotCacheID': break;
- case 'BrtEndPivotCacheID': break;
- case 'BrtEndPivotCacheIDs': break;
- case 'BrtWebOpt': break;
- case 'BrtFileRecover': break;
- case 'BrtFileSharing': break;
- /*case 'BrtBeginWebPubItems': break;
- case 'BrtBeginWebPubItem': break;
- case 'BrtEndWebPubItem': break;
- case 'BrtEndWebPubItems': break;*/
-
- /* Smart Tags */
- case 'BrtBeginSmartTagTypes': break;
- case 'BrtSmartTagType': break;
- case 'BrtEndSmartTagTypes': break;
-
- case 'BrtFRTBegin': pass = true; break;
- case 'BrtFRTArchID$': break;
- case 'BrtWorkBookPr15': break;
- case 'BrtFRTEnd': pass = false; break;
- case 'BrtEndBook': break;
- default: if(!pass || opts.WTF) throw new Error("Unexpected record " + R.n);
- }
- });
-
- parse_wb_defaults(wb);
-
- return wb;
-}
-
-/* [MS-XLSB] 2.1.7.60 Workbook */
-function write_BUNDLESHS(ba, wb, opts) {
- write_record(ba, "BrtBeginBundleShs");
- for(var idx = 0; idx != wb.SheetNames.length; ++idx) {
- var d = { hsState: 0, iTabID: idx+1, strRelID: 'rId' + (idx+1), name: wb.SheetNames[idx] };
- write_record(ba, "BrtBundleSh", write_BrtBundleSh(d));
- }
- write_record(ba, "BrtEndBundleShs");
-}
-
-/* [MS-XLSB] 2.4.643 BrtFileVersion */
-function write_BrtFileVersion(data, o) {
- if(!o) o = new_buf(127);
- for(var i = 0; i != 4; ++i) o.write_shift(4, 0);
- write_XLWideString("SheetJS", o);
- write_XLWideString(XLSX.version, o);
- write_XLWideString(XLSX.version, o);
- write_XLWideString("7262", o);
- o.length = o.l;
- return o;
-}
-
-/* [MS-XLSB] 2.1.7.60 Workbook */
-function write_BOOKVIEWS(ba, wb, opts) {
- write_record(ba, "BrtBeginBookViews");
- /* 1*(BrtBookView *FRT) */
- write_record(ba, "BrtEndBookViews");
-}
-
-/* [MS-XLSB] 2.4.302 BrtCalcProp */
-function write_BrtCalcProp(data, o) {
- if(!o) o = new_buf(26);
- o.write_shift(4,0); /* force recalc */
- o.write_shift(4,1);
- o.write_shift(4,0);
- write_Xnum(0, o);
- o.write_shift(-4, 1023);
- o.write_shift(1, 0x33);
- o.write_shift(1, 0x00);
- return o;
-}
-
-function write_BrtFileRecover(data, o) {
- if(!o) o = new_buf(1);
- o.write_shift(1,0);
- return o;
-}
-
-/* [MS-XLSB] 2.1.7.60 Workbook */
-function write_wb_bin(wb, opts) {
- var ba = buf_array();
- write_record(ba, "BrtBeginBook");
- write_record(ba, "BrtFileVersion", write_BrtFileVersion());
- /* [[BrtFileSharingIso] BrtFileSharing] */
- write_record(ba, "BrtWbProp", write_BrtWbProp());
- /* [ACABSPATH] */
- /* [[BrtBookProtectionIso] BrtBookProtection] */
- write_BOOKVIEWS(ba, wb, opts);
- write_BUNDLESHS(ba, wb, opts);
- /* [FNGROUP] */
- /* [EXTERNALS] */
- /* *BrtName */
- write_record(ba, "BrtCalcProp", write_BrtCalcProp());
- /* [BrtOleSize] */
- /* *(BrtUserBookView *FRT) */
- /* [PIVOTCACHEIDS] */
- /* [BrtWbFactoid] */
- /* [SMARTTAGTYPES] */
- /* [BrtWebOpt] */
- write_record(ba, "BrtFileRecover", write_BrtFileRecover());
- /* [WEBPUBITEMS] */
- /* [CRERRS] */
- /* FRTWORKBOOK */
- write_record(ba, "BrtEndBook");
-
- return ba.end();
-}
-function parse_wb(data, name, opts) {
- return (name.substr(-4)===".bin" ? parse_wb_bin : parse_wb_xml)(data, opts);
-}
-
-function parse_ws(data, name, opts, rels) {
- return (name.substr(-4)===".bin" ? parse_ws_bin : parse_ws_xml)(data, opts, rels);
-}
-
-function parse_sty(data, name, opts) {
- return (name.substr(-4)===".bin" ? parse_sty_bin : parse_sty_xml)(data, opts);
-}
-
-function parse_theme(data, name, opts) {
- return parse_theme_xml(data, opts);
-}
-
-function parse_sst(data, name, opts) {
- return (name.substr(-4)===".bin" ? parse_sst_bin : parse_sst_xml)(data, opts);
-}
-
-function parse_cmnt(data, name, opts) {
- return (name.substr(-4)===".bin" ? parse_comments_bin : parse_comments_xml)(data, opts);
-}
-
-function parse_cc(data, name, opts) {
- return (name.substr(-4)===".bin" ? parse_cc_bin : parse_cc_xml)(data, opts);
-}
-
-function write_wb(wb, name, opts) {
- return (name.substr(-4)===".bin" ? write_wb_bin : write_wb_xml)(wb, opts);
-}
-
-function write_ws(data, name, opts, wb) {
- return (name.substr(-4)===".bin" ? write_ws_bin : write_ws_xml)(data, opts, wb);
-}
-
-function write_sty(data, name, opts) {
- return (name.substr(-4)===".bin" ? write_sty_bin : write_sty_xml)(data, opts);
-}
-
-function write_sst(data, name, opts) {
- return (name.substr(-4)===".bin" ? write_sst_bin : write_sst_xml)(data, opts);
-}
-/*
-function write_cmnt(data, name, opts) {
- return (name.substr(-4)===".bin" ? write_comments_bin : write_comments_xml)(data, opts);
-}
-
-function write_cc(data, name, opts) {
- return (name.substr(-4)===".bin" ? write_cc_bin : write_cc_xml)(data, opts);
-}
-*/
-var attregexg2=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g;
-var attregex2=/([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/;
-var _chr = function(c) { return String.fromCharCode(c); };
-function xlml_parsexmltag(tag, skip_root) {
- var words = tag.split(/\s+/);
- var z = []; if(!skip_root) z[0] = words[0];
- if(words.length === 1) return z;
- var m = tag.match(attregexg2), y, j, w, i;
- if(m) for(i = 0; i != m.length; ++i) {
- y = m[i].match(attregex2);
- if((j=y[1].indexOf(":")) === -1) z[y[1]] = y[2].substr(1,y[2].length-2);
- else {
- if(y[1].substr(0,6) === "xmlns:") w = "xmlns"+y[1].substr(6);
- else w = y[1].substr(j+1);
- z[w] = y[2].substr(1,y[2].length-2);
- }
- }
- return z;
-}
-function xlml_parsexmltagobj(tag) {
- var words = tag.split(/\s+/);
- var z = {};
- if(words.length === 1) return z;
- var m = tag.match(attregexg2), y, j, w, i;
- if(m) for(i = 0; i != m.length; ++i) {
- y = m[i].match(attregex2);
- if((j=y[1].indexOf(":")) === -1) z[y[1]] = y[2].substr(1,y[2].length-2);
- else {
- if(y[1].substr(0,6) === "xmlns:") w = "xmlns"+y[1].substr(6);
- else w = y[1].substr(j+1);
- z[w] = y[2].substr(1,y[2].length-2);
- }
- }
- return z;
-}
-
-// ----
-
-function xlml_format(format, value) {
- var fmt = XLMLFormatMap[format] || unescapexml(format);
- if(fmt === "General") return SSF._general(value);
- return SSF.format(fmt, value);
-}
-
-function xlml_set_custprop(Custprops, Rn, cp, val) {
- switch((cp[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]) {
- case "boolean": val = parsexmlbool(val); break;
- case "i2": case "int": val = parseInt(val, 10); break;
- case "r4": case "float": val = parseFloat(val); break;
- case "date": case "dateTime.tz": val = new Date(val); break;
- case "i8": case "string": case "fixed": case "uuid": case "bin.base64": break;
- default: throw "bad custprop:" + cp[0];
- }
- Custprops[unescapexml(Rn[3])] = val;
-}
-
-function safe_format_xlml(cell, nf, o) {
- try {
- if(cell.t === 'e') { cell.w = cell.w || BErr[cell.v]; }
- else if(nf === "General") {
- if(cell.t === 'n') {
- if((cell.v|0) === cell.v) cell.w = SSF._general_int(cell.v);
- else cell.w = SSF._general_num(cell.v);
- }
- else cell.w = SSF._general(cell.v);
- }
- else cell.w = xlml_format(nf||"General", cell.v);
- if(o.cellNF) cell.z = XLMLFormatMap[nf]||nf||"General";
- } catch(e) { if(o.WTF) throw e; }
-}
-
-function process_style_xlml(styles, stag, opts) {
- if(opts.cellStyles) {
- if(stag.Interior) {
- var I = stag.Interior;
- if(I.Pattern) I.patternType = XLMLPatternTypeMap[I.Pattern] || I.Pattern;
- }
- }
- styles[stag.ID] = stag;
-}
-
-/* TODO: there must exist some form of OSP-blessed spec */
-function parse_xlml_data(xml, ss, data, cell, base, styles, csty, row, o) {
- var nf = "General", sid = cell.StyleID, S = {}; o = o || {};
- var interiors = [];
- if(sid === undefined && row) sid = row.StyleID;
- if(sid === undefined && csty) sid = csty.StyleID;
- while(styles[sid] !== undefined) {
- if(styles[sid].nf) nf = styles[sid].nf;
- if(styles[sid].Interior) interiors.push(styles[sid].Interior);
- if(!styles[sid].Parent) break;
- sid = styles[sid].Parent;
- }
- switch(data.Type) {
- case 'Boolean':
- cell.t = 'b';
- cell.v = parsexmlbool(xml);
- break;
- case 'String':
- cell.t = 's'; cell.r = xlml_fixstr(unescapexml(xml));
- cell.v = xml.indexOf("<") > -1 ? ss : cell.r;
- break;
- case 'DateTime':
- cell.v = (Date.parse(xml) - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
- if(cell.v !== cell.v) cell.v = unescapexml(xml);
- else if(cell.v >= 1 && cell.v<60) cell.v = cell.v -1;
- if(!nf || nf == "General") nf = "yyyy-mm-dd";
- /* falls through */
- case 'Number':
- if(cell.v === undefined) cell.v=+xml;
- if(!cell.t) cell.t = 'n';
- break;
- case 'Error': cell.t = 'e'; cell.v = RBErr[xml]; cell.w = xml; break;
- default: cell.t = 's'; cell.v = xlml_fixstr(ss); break;
- }
- safe_format_xlml(cell, nf, o);
- if(o.cellFormula != null && cell.Formula) {
- cell.f = rc_to_a1(unescapexml(cell.Formula), base);
- cell.Formula = undefined;
- }
- if(o.cellStyles) {
- interiors.forEach(function(x) {
- if(!S.patternType && x.patternType) S.patternType = x.patternType;
- });
- cell.s = S;
- }
- cell.ixfe = cell.StyleID !== undefined ? cell.StyleID : 'Default';
-}
-
-function xlml_clean_comment(comment) {
- comment.t = comment.v;
- comment.v = comment.w = comment.ixfe = undefined;
-}
-
-function xlml_normalize(d) {
- if(has_buf && Buffer.isBuffer(d)) return d.toString('utf8');
- if(typeof d === 'string') return d;
- throw "badf";
-}
-
-/* TODO: Everything */
-var xlmlregex = /<(\/?)([a-z0-9]*:|)(\w+)[^>]*>/mg;
-function parse_xlml_xml(d, opts) {
- var str = xlml_normalize(d);
- var Rn;
- var state = [], tmp;
- var sheets = {}, sheetnames = [], cursheet = {}, sheetname = "";
- var table = {}, cell = {}, row = {}, dtag, didx;
- var c = 0, r = 0;
- var refguess = {s: {r:1000000, c:1000000}, e: {r:0, c:0} };
- var styles = {}, stag = {};
- var ss = "", fidx = 0;
- var mergecells = [];
- var Props = {}, Custprops = {}, pidx = 0, cp = {};
- var comments = [], comment = {};
- var cstys = [], csty;
- xlmlregex.lastIndex = 0;
- while((Rn = xlmlregex.exec(str))) switch(Rn[3]) {
- case 'Data':
- if(state[state.length-1][1]) break;
- if(Rn[1]==='/') parse_xlml_data(str.slice(didx, Rn.index), ss, dtag, state[state.length-1][0]=="Comment"?comment:cell, {c:c,r:r}, styles, cstys[c], row, opts);
- else { ss = ""; dtag = xlml_parsexmltag(Rn[0]); didx = Rn.index + Rn[0].length; }
- break;
- case 'Cell':
- if(Rn[1]==='/'){
- if(comments.length > 0) cell.c = comments;
- if((!opts.sheetRows || opts.sheetRows > r) && cell.v !== undefined) cursheet[encode_col(c) + encode_row(r)] = cell;
- if(cell.HRef) {
- cell.l = {Target:cell.HRef, tooltip:cell.HRefScreenTip};
- cell.HRef = cell.HRefScreenTip = undefined;
- }
- if(cell.MergeAcross || cell.MergeDown) {
- var cc = c + (parseInt(cell.MergeAcross,10)|0);
- var rr = r + (parseInt(cell.MergeDown,10)|0);
- mergecells.push({s:{c:c,r:r},e:{c:cc,r:rr}});
- }
- ++c;
- if(cell.MergeAcross) c += +cell.MergeAcross;
- } else {
- cell = xlml_parsexmltagobj(Rn[0]);
- if(cell.Index) c = +cell.Index - 1;
- if(c < refguess.s.c) refguess.s.c = c;
- if(c > refguess.e.c) refguess.e.c = c;
- if(Rn[0].substr(-2) === "/>") ++c;
- comments = [];
- }
- break;
- case 'Row':
- if(Rn[1]==='/' || Rn[0].substr(-2) === "/>") {
- if(r < refguess.s.r) refguess.s.r = r;
- if(r > refguess.e.r) refguess.e.r = r;
- if(Rn[0].substr(-2) === "/>") {
- row = xlml_parsexmltag(Rn[0]);
- if(row.Index) r = +row.Index - 1;
- }
- c = 0; ++r;
- } else {
- row = xlml_parsexmltag(Rn[0]);
- if(row.Index) r = +row.Index - 1;
- }
- break;
- case 'Worksheet': /* TODO: read range from FullRows/FullColumns */
- if(Rn[1]==='/'){
- if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;
- sheetnames.push(sheetname);
- if(refguess.s.r <= refguess.e.r && refguess.s.c <= refguess.e.c) cursheet["!ref"] = encode_range(refguess);
- if(mergecells.length) cursheet["!merges"] = mergecells;
- sheets[sheetname] = cursheet;
- } else {
- refguess = {s: {r:1000000, c:1000000}, e: {r:0, c:0} };
- r = c = 0;
- state.push([Rn[3], false]);
- tmp = xlml_parsexmltag(Rn[0]);
- sheetname = tmp.Name;
- cursheet = {};
- mergecells = [];
- }
- break;
- case 'Table':
- if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;}
- else if(Rn[0].slice(-2) == "/>") break;
- else {
- table = xlml_parsexmltag(Rn[0]);
- state.push([Rn[3], false]);
- cstys = [];
- }
- break;
-
- case 'Style':
- if(Rn[1]==='/') process_style_xlml(styles, stag, opts);
- else stag = xlml_parsexmltag(Rn[0]);
- break;
-
- case 'NumberFormat':
- stag.nf = xlml_parsexmltag(Rn[0]).Format || "General";
- break;
-
- case 'Column':
- if(state[state.length-1][0] !== 'Table') break;
- csty = xlml_parsexmltag(Rn[0]);
- cstys[(csty.Index-1||cstys.length)] = csty;
- for(var i = 0; i < +csty.Span; ++i) cstys[cstys.length] = csty;
- break;
-
- case 'NamedRange': break;
- case 'NamedCell': break;
- case 'B': break;
- case 'I': break;
- case 'U': break;
- case 'S': break;
- case 'Sub': break;
- case 'Sup': break;
- case 'Span': break;
- case 'Border': break;
- case 'Alignment': break;
- case 'Borders': break;
- case 'Font':
- if(Rn[0].substr(-2) === "/>") break;
- else if(Rn[1]==="/") ss += str.slice(fidx, Rn.index);
- else fidx = Rn.index + Rn[0].length;
- break;
- case 'Interior':
- if(!opts.cellStyles) break;
- stag.Interior = xlml_parsexmltag(Rn[0]);
- break;
- case 'Protection': break;
-
- case 'Author':
- case 'Title':
- case 'Description':
- case 'Created':
- case 'Keywords':
- case 'Subject':
- case 'Category':
- case 'Company':
- case 'LastAuthor':
- case 'LastSaved':
- case 'LastPrinted':
- case 'Version':
- case 'Revision':
- case 'TotalTime':
- case 'HyperlinkBase':
- case 'Manager':
- if(Rn[0].substr(-2) === "/>") break;
- else if(Rn[1]==="/") xlml_set_prop(Props, Rn[3], str.slice(pidx, Rn.index));
- else pidx = Rn.index + Rn[0].length;
- break;
- case 'Paragraphs': break;
-
- case 'Styles':
- case 'Workbook':
- if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;}
- else state.push([Rn[3], false]);
- break;
-
- case 'Comment':
- if(Rn[1]==='/'){
- if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;
- xlml_clean_comment(comment);
- comments.push(comment);
- } else {
- state.push([Rn[3], false]);
- tmp = xlml_parsexmltag(Rn[0]);
- comment = {a:tmp.Author};
- }
- break;
-
- case 'Name': break;
-
- case 'ComponentOptions':
- case 'DocumentProperties':
- case 'CustomDocumentProperties':
- case 'OfficeDocumentSettings':
- case 'PivotTable':
- case 'PivotCache':
- case 'Names':
- case 'MapInfo':
- case 'PageBreaks':
- case 'QueryTable':
- case 'DataValidation':
- case 'AutoFilter':
- case 'Sorting':
- case 'Schema':
- case 'data':
- case 'ConditionalFormatting':
- case 'SmartTagType':
- case 'SmartTags':
- case 'ExcelWorkbook':
- case 'WorkbookOptions':
- case 'WorksheetOptions':
- if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;}
- else if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], true]);
- break;
-
- default:
- var seen = true;
- switch(state[state.length-1][0]) {
- /* OfficeDocumentSettings */
- case 'OfficeDocumentSettings': switch(Rn[3]) {
- case 'AllowPNG': break;
- case 'RemovePersonalInformation': break;
- case 'DownloadComponents': break;
- case 'LocationOfComponents': break;
- case 'Colors': break;
- case 'Color': break;
- case 'Index': break;
- case 'RGB': break;
- case 'PixelsPerInch': break;
- case 'TargetScreenSize': break;
- case 'ReadOnlyRecommended': break;
- default: seen = false;
- } break;
-
- /* ComponentOptions */
- case 'ComponentOptions': switch(Rn[3]) {
- case 'Toolbar': break;
- case 'HideOfficeLogo': break;
- case 'SpreadsheetAutoFit': break;
- case 'Label': break;
- case 'Caption': break;
- case 'MaxHeight': break;
- case 'MaxWidth': break;
- case 'NextSheetNumber': break;
- default: seen = false;
- } break;
-
- /* ExcelWorkbook */
- case 'ExcelWorkbook': switch(Rn[3]) {
- case 'WindowHeight': break;
- case 'WindowWidth': break;
- case 'WindowTopX': break;
- case 'WindowTopY': break;
- case 'TabRatio': break;
- case 'ProtectStructure': break;
- case 'ProtectWindows': break;
- case 'ActiveSheet': break;
- case 'DisplayInkNotes': break;
- case 'FirstVisibleSheet': break;
- case 'SupBook': break;
- case 'SheetName': break;
- case 'SheetIndex': break;
- case 'SheetIndexFirst': break;
- case 'SheetIndexLast': break;
- case 'Dll': break;
- case 'AcceptLabelsInFormulas': break;
- case 'DoNotSaveLinkValues': break;
- case 'Date1904': break;
- case 'Iteration': break;
- case 'MaxIterations': break;
- case 'MaxChange': break;
- case 'Path': break;
- case 'Xct': break;
- case 'Count': break;
- case 'SelectedSheets': break;
- case 'Calculation': break;
- case 'Uncalced': break;
- case 'StartupPrompt': break;
- case 'Crn': break;
- case 'ExternName': break;
- case 'Formula': break;
- case 'ColFirst': break;
- case 'ColLast': break;
- case 'WantAdvise': break;
- case 'Boolean': break;
- case 'Error': break;
- case 'Text': break;
- case 'OLE': break;
- case 'NoAutoRecover': break;
- case 'PublishObjects': break;
- case 'DoNotCalculateBeforeSave': break;
- case 'Number': break;
- case 'RefModeR1C1': break;
- case 'EmbedSaveSmartTags': break;
- default: seen = false;
- } break;
-
- /* WorkbookOptions */
- case 'WorkbookOptions': switch(Rn[3]) {
- case 'OWCVersion': break;
- case 'Height': break;
- case 'Width': break;
- default: seen = false;
- } break;
-
- /* WorksheetOptions */
- case 'WorksheetOptions': switch(Rn[3]) {
- case 'Unsynced': break;
- case 'Visible': break;
- case 'Print': break;
- case 'Panes': break;
- case 'Scale': break;
- case 'Pane': break;
- case 'Number': break;
- case 'Layout': break;
- case 'Header': break;
- case 'Footer': break;
- case 'PageSetup': break;
- case 'PageMargins': break;
- case 'Selected': break;
- case 'ProtectObjects': break;
- case 'EnableSelection': break;
- case 'ProtectScenarios': break;
- case 'ValidPrinterInfo': break;
- case 'HorizontalResolution': break;
- case 'VerticalResolution': break;
- case 'NumberofCopies': break;
- case 'ActiveRow': break;
- case 'ActiveCol': break;
- case 'ActivePane': break;
- case 'TopRowVisible': break;
- case 'TopRowBottomPane': break;
- case 'LeftColumnVisible': break;
- case 'LeftColumnRightPane': break;
- case 'FitToPage': break;
- case 'RangeSelection': break;
- case 'PaperSizeIndex': break;
- case 'PageLayoutZoom': break;
- case 'PageBreakZoom': break;
- case 'FilterOn': break;
- case 'DoNotDisplayGridlines': break;
- case 'SplitHorizontal': break;
- case 'SplitVertical': break;
- case 'FreezePanes': break;
- case 'FrozenNoSplit': break;
- case 'FitWidth': break;
- case 'FitHeight': break;
- case 'CommentsLayout': break;
- case 'Zoom': break;
- case 'LeftToRight': break;
- case 'Gridlines': break;
- case 'AllowSort': break;
- case 'AllowFilter': break;
- case 'AllowInsertRows': break;
- case 'AllowDeleteRows': break;
- case 'AllowInsertCols': break;
- case 'AllowDeleteCols': break;
- case 'AllowInsertHyperlinks': break;
- case 'AllowFormatCells': break;
- case 'AllowSizeCols': break;
- case 'AllowSizeRows': break;
- case 'NoSummaryRowsBelowDetail': break;
- case 'TabColorIndex': break;
- case 'DoNotDisplayHeadings': break;
- case 'ShowPageLayoutZoom': break;
- case 'NoSummaryColumnsRightDetail': break;
- case 'BlackAndWhite': break;
- case 'DoNotDisplayZeros': break;
- case 'DisplayPageBreak': break;
- case 'RowColHeadings': break;
- case 'DoNotDisplayOutline': break;
- case 'NoOrientation': break;
- case 'AllowUsePivotTables': break;
- case 'ZeroHeight': break;
- case 'ViewableRange': break;
- case 'Selection': break;
- case 'ProtectContents': break;
- default: seen = false;
- } break;
-
- /* PivotTable */
- case 'PivotTable': case 'PivotCache': switch(Rn[3]) {
- case 'ImmediateItemsOnDrop': break;
- case 'ShowPageMultipleItemLabel': break;
- case 'CompactRowIndent': break;
- case 'Location': break;
- case 'PivotField': break;
- case 'Orientation': break;
- case 'LayoutForm': break;
- case 'LayoutSubtotalLocation': break;
- case 'LayoutCompactRow': break;
- case 'Position': break;
- case 'PivotItem': break;
- case 'DataType': break;
- case 'DataField': break;
- case 'SourceName': break;
- case 'ParentField': break;
- case 'PTLineItems': break;
- case 'PTLineItem': break;
- case 'CountOfSameItems': break;
- case 'Item': break;
- case 'ItemType': break;
- case 'PTSource': break;
- case 'CacheIndex': break;
- case 'ConsolidationReference': break;
- case 'FileName': break;
- case 'Reference': break;
- case 'NoColumnGrand': break;
- case 'NoRowGrand': break;
- case 'BlankLineAfterItems': break;
- case 'Hidden': break;
- case 'Subtotal': break;
- case 'BaseField': break;
- case 'MapChildItems': break;
- case 'Function': break;
- case 'RefreshOnFileOpen': break;
- case 'PrintSetTitles': break;
- case 'MergeLabels': break;
- case 'DefaultVersion': break;
- case 'RefreshName': break;
- case 'RefreshDate': break;
- case 'RefreshDateCopy': break;
- case 'VersionLastRefresh': break;
- case 'VersionLastUpdate': break;
- case 'VersionUpdateableMin': break;
- case 'VersionRefreshableMin': break;
- case 'Calculation': break;
- default: seen = false;
- } break;
-
- /* PageBreaks */
- case 'PageBreaks': switch(Rn[3]) {
- case 'ColBreaks': break;
- case 'ColBreak': break;
- case 'RowBreaks': break;
- case 'RowBreak': break;
- case 'ColStart': break;
- case 'ColEnd': break;
- case 'RowEnd': break;
- default: seen = false;
- } break;
-
- /* AutoFilter */
- case 'AutoFilter': switch(Rn[3]) {
- case 'AutoFilterColumn': break;
- case 'AutoFilterCondition': break;
- case 'AutoFilterAnd': break;
- case 'AutoFilterOr': break;
- default: seen = false;
- } break;
-
- /* QueryTable */
- case 'QueryTable': switch(Rn[3]) {
- case 'Id': break;
- case 'AutoFormatFont': break;
- case 'AutoFormatPattern': break;
- case 'QuerySource': break;
- case 'QueryType': break;
- case 'EnableRedirections': break;
- case 'RefreshedInXl9': break;
- case 'URLString': break;
- case 'HTMLTables': break;
- case 'Connection': break;
- case 'CommandText': break;
- case 'RefreshInfo': break;
- case 'NoTitles': break;
- case 'NextId': break;
- case 'ColumnInfo': break;
- case 'OverwriteCells': break;
- case 'DoNotPromptForFile': break;
- case 'TextWizardSettings': break;
- case 'Source': break;
- case 'Number': break;
- case 'Decimal': break;
- case 'ThousandSeparator': break;
- case 'TrailingMinusNumbers': break;
- case 'FormatSettings': break;
- case 'FieldType': break;
- case 'Delimiters': break;
- case 'Tab': break;
- case 'Comma': break;
- case 'AutoFormatName': break;
- case 'VersionLastEdit': break;
- case 'VersionLastRefresh': break;
- default: seen = false;
- } break;
-
- /* Sorting */
- case 'Sorting':
- /* ConditionalFormatting */
- case 'ConditionalFormatting':
- /* DataValidation */
- case 'DataValidation': switch(Rn[3]) {
- case 'Range': break;
- case 'Type': break;
- case 'Min': break;
- case 'Max': break;
- case 'Sort': break;
- case 'Descending': break;
- case 'Order': break;
- case 'CaseSensitive': break;
- case 'Value': break;
- case 'ErrorStyle': break;
- case 'ErrorMessage': break;
- case 'ErrorTitle': break;
- case 'CellRangeList': break;
- case 'InputMessage': break;
- case 'InputTitle': break;
- case 'ComboHide': break;
- case 'InputHide': break;
- case 'Condition': break;
- case 'Qualifier': break;
- case 'UseBlank': break;
- case 'Value1': break;
- case 'Value2': break;
- case 'Format': break;
- default: seen = false;
- } break;
-
- /* MapInfo (schema) */
- case 'MapInfo': case 'Schema': case 'data': switch(Rn[3]) {
- case 'Map': break;
- case 'Entry': break;
- case 'Range': break;
- case 'XPath': break;
- case 'Field': break;
- case 'XSDType': break;
- case 'FilterOn': break;
- case 'Aggregate': break;
- case 'ElementType': break;
- case 'AttributeType': break;
- /* These are from xsd (XML Schema Definition) */
- case 'schema':
- case 'element':
- case 'complexType':
- case 'datatype':
- case 'all':
- case 'attribute':
- case 'extends': break;
-
- case 'row': break;
- default: seen = false;
- } break;
-
- /* SmartTags (can be anything) */
- case 'SmartTags': break;
-
- default: seen = false; break;
- }
- if(seen) break;
- /* CustomDocumentProperties */
- if(!state[state.length-1][1]) throw 'Unrecognized tag: ' + Rn[3] + "|" + state.join("|");
- if(state[state.length-1][0]==='CustomDocumentProperties') {
- if(Rn[0].substr(-2) === "/>") break;
- else if(Rn[1]==="/") xlml_set_custprop(Custprops, Rn, cp, str.slice(pidx, Rn.index));
- else { cp = Rn; pidx = Rn.index + Rn[0].length; }
- break;
- }
- if(opts.WTF) throw 'Unrecognized tag: ' + Rn[3] + "|" + state.join("|");
- }
- var out = {};
- if(!opts.bookSheets && !opts.bookProps) out.Sheets = sheets;
- out.SheetNames = sheetnames;
- out.SSF = SSF.get_table();
- out.Props = Props;
- out.Custprops = Custprops;
- return out;
-}
-
-function parse_xlml(data, opts) {
- fix_read_opts(opts=opts||{});
- switch(opts.type||"base64") {
- case "base64": return parse_xlml_xml(Base64.decode(data), opts);
- case "binary": case "buffer": case "file": return parse_xlml_xml(data, opts);
- case "array": return parse_xlml_xml(data.map(_chr).join(""), opts);
- }
-}
-
-function write_xlml(wb, opts) { }
-
-/* [MS-OLEDS] 2.3.8 CompObjStream */
-function parse_compobj(obj) {
- var v = {};
- var o = obj.content;
-
- /* [MS-OLEDS] 2.3.7 CompObjHeader -- All fields MUST be ignored */
- var l = 28, m;
- m = __lpstr(o, l);
- l += 4 + __readUInt32LE(o,l);
- v.UserType = m;
-
- /* [MS-OLEDS] 2.3.1 ClipboardFormatOrAnsiString */
- m = __readUInt32LE(o,l); l+= 4;
- switch(m) {
- case 0x00000000: break;
- case 0xffffffff: case 0xfffffffe: l+=4; break;
- default:
- if(m > 0x190) throw new Error("Unsupported Clipboard: " + m.toString(16));
- l += m;
- }
-
- m = __lpstr(o, l); l += m.length === 0 ? 0 : 5 + m.length; v.Reserved1 = m;
-
- if((m = __readUInt32LE(o,l)) !== 0x71b2e9f4) return v;
- throw "Unsupported Unicode Extension";
-}
-
-/* 2.4.58 Continue logic */
-function slurp(R, blob, length, opts) {
- var l = length;
- var bufs = [];
- var d = blob.slice(blob.l,blob.l+l);
- if(opts && opts.enc && opts.enc.insitu_decrypt) switch(R.n) {
- case 'BOF': case 'FilePass': case 'FileLock': case 'InterfaceHdr': case 'RRDInfo': case 'RRDHead': case 'UsrExcl': break;
- default:
- if(d.length === 0) break;
- opts.enc.insitu_decrypt(d);
- }
- bufs.push(d);
- blob.l += l;
- var next = (XLSRecordEnum[__readUInt16LE(blob,blob.l)]);
- while(next != null && next.n === 'Continue') {
- l = __readUInt16LE(blob,blob.l+2);
- bufs.push(blob.slice(blob.l+4,blob.l+4+l));
- blob.l += 4+l;
- next = (XLSRecordEnum[__readUInt16LE(blob, blob.l)]);
- }
- var b = bconcat(bufs);
- prep_blob(b, 0);
- var ll = 0; b.lens = [];
- for(var j = 0; j < bufs.length; ++j) { b.lens.push(ll); ll += bufs[j].length; }
- return R.f(b, b.length, opts);
-}
-
-function safe_format_xf(p, opts, date1904) {
- if(!p.XF) return;
- try {
- var fmtid = p.XF.ifmt||0;
- if(p.t === 'e') { p.w = p.w || BErr[p.v]; }
- else if(fmtid === 0) {
- if(p.t === 'n') {
- if((p.v|0) === p.v) p.w = SSF._general_int(p.v);
- else p.w = SSF._general_num(p.v);
- }
- else p.w = SSF._general(p.v);
- }
- else p.w = SSF.format(fmtid,p.v, {date1904:date1904||false});
- if(opts.cellNF) p.z = SSF._table[fmtid];
- } catch(e) { if(opts.WTF) throw e; }
-}
-
-function make_cell(val, ixfe, t) {
- return {v:val, ixfe:ixfe, t:t};
-}
-
-// 2.3.2
-function parse_workbook(blob, options) {
- var wb = {opts:{}};
- var Sheets = {};
- var out = {};
- var Directory = {};
- var found_sheet = false;
- var range = {};
- var last_formula = null;
- var sst = [];
- var cur_sheet = "";
- var Preamble = {};
- var lastcell, last_cell, cc, cmnt, rng, rngC, rngR;
- var shared_formulae = {};
- var array_formulae = []; /* TODO: something more clever */
- var temp_val;
- var country;
- var cell_valid = true;
- var XFs = []; /* XF records */
- var palette = [];
- var get_rgb = function getrgb(icv) {
- if(icv < 8) return XLSIcv[icv];
- if(icv < 64) return palette[icv-8] || XLSIcv[icv];
- return XLSIcv[icv];
- };
- var process_cell_style = function pcs(cell, line) {
- var xfd = line.XF.data;
- if(!xfd || !xfd.patternType) return;
- line.s = {};
- line.s.patternType = xfd.patternType;
- var t;
- if((t = rgb2Hex(get_rgb(xfd.icvFore)))) { line.s.fgColor = {rgb:t}; }
- if((t = rgb2Hex(get_rgb(xfd.icvBack)))) { line.s.bgColor = {rgb:t}; }
- };
- var addcell = function addcell(cell, line, options) {
- if(!cell_valid) return;
- if(options.cellStyles && line.XF && line.XF.data) process_cell_style(cell, line);
- lastcell = cell;
- last_cell = encode_cell(cell);
- if(range.s) {
- if(cell.r < range.s.r) range.s.r = cell.r;
- if(cell.c < range.s.c) range.s.c = cell.c;
- }
- if(range.e) {
- if(cell.r + 1 > range.e.r) range.e.r = cell.r + 1;
- if(cell.c + 1 > range.e.c) range.e.c = cell.c + 1;
- }
- if(options.sheetRows && lastcell.r >= options.sheetRows) cell_valid = false;
- else out[last_cell] = line;
- };
- var opts = {
- enc: false, // encrypted
- sbcch: 0, // cch in the preceding SupBook
- snames: [], // sheetnames
- sharedf: shared_formulae, // shared formulae by address
- arrayf: array_formulae, // array formulae array
- rrtabid: [], // RRTabId
- lastuser: "", // Last User from WriteAccess
- biff: 8, // BIFF version
- codepage: 0, // CP from CodePage record
- winlocked: 0, // fLockWn from WinProtect
- wtf: false
- };
- if(options.password) opts.password = options.password;
- var mergecells = [];
- var objects = [];
- var supbooks = [[]]; // 1-indexed, will hold extern names
- var sbc = 0, sbci = 0, sbcli = 0;
- supbooks.SheetNames = opts.snames;
- supbooks.sharedf = opts.sharedf;
- supbooks.arrayf = opts.arrayf;
- var last_Rn = '';
- var file_depth = 0; /* TODO: make a real stack */
-
- /* explicit override for some broken writers */
- opts.codepage = 1200;
- set_cp(1200);
-
- while(blob.l < blob.length - 1) {
- var s = blob.l;
- var RecordType = blob.read_shift(2);
- if(RecordType === 0 && last_Rn === 'EOF') break;
- var length = (blob.l === blob.length ? 0 : blob.read_shift(2)), y;
- var R = XLSRecordEnum[RecordType];
- if(R && R.f) {
- if(options.bookSheets) {
- if(last_Rn === 'BoundSheet8' && R.n !== 'BoundSheet8') break;
- }
- last_Rn = R.n;
- if(R.r === 2 || R.r == 12) {
- var rt = blob.read_shift(2); length -= 2;
- if(!opts.enc && rt !== RecordType) throw "rt mismatch";
- if(R.r == 12){ blob.l += 10; length -= 10; } // skip FRT
- }
- //console.error(R,blob.l,length,blob.length);
- var val;
- if(R.n === 'EOF') val = R.f(blob, length, opts);
- else val = slurp(R, blob, length, opts);
- var Rn = R.n;
- /* BIFF5 overrides */
- if(opts.biff === 5 || opts.biff === 2) switch(Rn) {
- case 'Lbl': Rn = 'Label'; break;
- }
- /* nested switch statements to workaround V8 128 limit */
- switch(Rn) {
- /* Workbook Options */
- case 'Date1904': wb.opts.Date1904 = val; break;
- case 'WriteProtect': wb.opts.WriteProtect = true; break;
- case 'FilePass':
- if(!opts.enc) blob.l = 0;
- opts.enc = val;
- if(opts.WTF) console.error(val);
- if(!options.password) throw new Error("File is password-protected");
- if(val.Type !== 0) throw new Error("Encryption scheme unsupported");
- if(!val.valid) throw new Error("Password is incorrect");
- break;
- case 'WriteAccess': opts.lastuser = val; break;
- case 'FileSharing': break; //TODO
- case 'CodePage':
- /* overrides based on test cases */
- if(val === 0x5212) val = 1200;
- else if(val === 0x8001) val = 1252;
- opts.codepage = val;
- set_cp(val);
- break;
- case 'RRTabId': opts.rrtabid = val; break;
- case 'WinProtect': opts.winlocked = val; break;
- case 'Template': break; // TODO
- case 'RefreshAll': wb.opts.RefreshAll = val; break;
- case 'BookBool': break; // TODO
- case 'UsesELFs': /* if(val) console.error("Unsupported ELFs"); */ break;
- case 'MTRSettings': {
- if(val[0] && val[1]) throw "Unsupported threads: " + val;
- } break; // TODO: actually support threads
- case 'CalcCount': wb.opts.CalcCount = val; break;
- case 'CalcDelta': wb.opts.CalcDelta = val; break;
- case 'CalcIter': wb.opts.CalcIter = val; break;
- case 'CalcMode': wb.opts.CalcMode = val; break;
- case 'CalcPrecision': wb.opts.CalcPrecision = val; break;
- case 'CalcSaveRecalc': wb.opts.CalcSaveRecalc = val; break;
- case 'CalcRefMode': opts.CalcRefMode = val; break; // TODO: implement R1C1
- case 'Uncalced': break;
- case 'ForceFullCalculation': wb.opts.FullCalc = val; break;
- case 'WsBool': break; // TODO
- case 'XF': XFs.push(val); break;
- case 'ExtSST': break; // TODO
- case 'BookExt': break; // TODO
- case 'RichTextStream': break;
- case 'BkHim': break;
-
- case 'SupBook': supbooks[++sbc] = [val]; sbci = 0; break;
- case 'ExternName': supbooks[sbc][++sbci] = val; break;
- case 'Index': break; // TODO
- case 'Lbl': supbooks[0][++sbcli] = val; break;
- case 'ExternSheet': supbooks[sbc] = supbooks[sbc].concat(val); sbci += val.length; break;
-
- case 'Protect': out["!protect"] = val; break; /* for sheet or book */
- case 'Password': if(val !== 0 && opts.WTF) console.error("Password verifier: " + val); break;
- case 'Prot4Rev': case 'Prot4RevPass': break; /*TODO: Revision Control*/
-
- case 'BoundSheet8': {
- Directory[val.pos] = val;
- opts.snames.push(val.name);
- } break;
- case 'EOF': {
- if(--file_depth) break;
- if(range.e) {
- out["!range"] = range;
- if(range.e.r > 0 && range.e.c > 0) {
- range.e.r--; range.e.c--;
- out["!ref"] = encode_range(range);
- range.e.r++; range.e.c++;
- }
- if(mergecells.length > 0) out["!merges"] = mergecells;
- if(objects.length > 0) out["!objects"] = objects;
- }
- if(cur_sheet === "") Preamble = out; else Sheets[cur_sheet] = out;
- out = {};
- } break;
- case 'BOF': {
- if(opts.biff !== 8);
- else if(val.BIFFVer === 0x0500) opts.biff = 5;
- else if(val.BIFFVer === 0x0002) opts.biff = 2;
- else if(val.BIFFVer === 0x0007) opts.biff = 2;
- if(file_depth++) break;
- cell_valid = true;
- out = {};
- if(opts.biff === 2) {
- if(cur_sheet === "") cur_sheet = "Sheet1";
- range = {s:{r:0,c:0},e:{r:0,c:0}};
- }
- else cur_sheet = (Directory[s] || {name:""}).name;
- mergecells = [];
- objects = [];
- } break;
- case 'Number': case 'BIFF2NUM': {
- temp_val = {ixfe: val.ixfe, XF: XFs[val.ixfe], v:val.val, t:'n'};
- if(temp_val.XF) safe_format_xf(temp_val, options, wb.opts.Date1904);
- addcell({c:val.c, r:val.r}, temp_val, options);
- } break;
- case 'BoolErr': {
- temp_val = {ixfe: val.ixfe, XF: XFs[val.ixfe], v:val.val, t:val.t};
- if(temp_val.XF) safe_format_xf(temp_val, options, wb.opts.Date1904);
- addcell({c:val.c, r:val.r}, temp_val, options);
- } break;
- case 'RK': {
- temp_val = {ixfe: val.ixfe, XF: XFs[val.ixfe], v:val.rknum, t:'n'};
- if(temp_val.XF) safe_format_xf(temp_val, options, wb.opts.Date1904);
- addcell({c:val.c, r:val.r}, temp_val, options);
- } break;
- case 'MulRk': {
- for(var j = val.c; j <= val.C; ++j) {
- var ixfe = val.rkrec[j-val.c][0];
- temp_val= {ixfe:ixfe, XF:XFs[ixfe], v:val.rkrec[j-val.c][1], t:'n'};
- if(temp_val.XF) safe_format_xf(temp_val, options, wb.opts.Date1904);
- addcell({c:j, r:val.r}, temp_val, options);
- }
- } break;
- case 'Formula': {
- switch(val.val) {
- case 'String': last_formula = val; break;
- case 'Array Formula': throw "Array Formula unsupported";
- default:
- temp_val = {v:val.val, ixfe:val.cell.ixfe, t:val.tt};
- temp_val.XF = XFs[temp_val.ixfe];
- if(options.cellFormula) temp_val.f = "="+stringify_formula(val.formula,range,val.cell,supbooks, opts);
- if(temp_val.XF) safe_format_xf(temp_val, options, wb.opts.Date1904);
- addcell(val.cell, temp_val, options);
- last_formula = val;
- }
- } break;
- case 'String': {
- if(last_formula) {
- last_formula.val = val;
- temp_val = {v:last_formula.val, ixfe:last_formula.cell.ixfe, t:'s'};
- temp_val.XF = XFs[temp_val.ixfe];
- if(options.cellFormula) temp_val.f = "="+stringify_formula(last_formula.formula, range, last_formula.cell, supbooks, opts);
- if(temp_val.XF) safe_format_xf(temp_val, options, wb.opts.Date1904);
- addcell(last_formula.cell, temp_val, options);
- last_formula = null;
- }
- } break;
- case 'Array': {
- array_formulae.push(val);
- } break;
- case 'ShrFmla': {
- if(!cell_valid) break;
- //if(options.cellFormula) out[last_cell].f = stringify_formula(val[0], range, lastcell, supbooks, opts);
- /* TODO: capture range */
- shared_formulae[encode_cell(last_formula.cell)]= val[0];
- } break;
- case 'LabelSst':
- //temp_val={v:sst[val.isst].t, ixfe:val.ixfe, t:'s'};
- temp_val=make_cell(sst[val.isst].t, val.ixfe, 's');
- temp_val.XF = XFs[temp_val.ixfe];
- if(temp_val.XF) safe_format_xf(temp_val, options, wb.opts.Date1904);
- addcell({c:val.c, r:val.r}, temp_val, options);
- break;
- case 'Label': case 'BIFF2STR':
- /* Some writers erroneously write Label */
- temp_val=make_cell(val.val, val.ixfe, 's');
- temp_val.XF = XFs[temp_val.ixfe];
- if(temp_val.XF) safe_format_xf(temp_val, options, wb.opts.Date1904);
- addcell({c:val.c, r:val.r}, temp_val, options);
- break;
- case 'Dimensions': {
- if(file_depth === 1) range = val; /* TODO: stack */
- } break;
- case 'SST': {
- sst = val;
- } break;
- case 'Format': { /* val = [id, fmt] */
- SSF.load(val[1], val[0]);
- } break;
-
- case 'MergeCells': mergecells = mergecells.concat(val); break;
-
- case 'Obj': objects[val.cmo[0]] = opts.lastobj = val; break;
- case 'TxO': opts.lastobj.TxO = val; break;
-
- case 'HLink': {
- for(rngR = val[0].s.r; rngR <= val[0].e.r; ++rngR)
- for(rngC = val[0].s.c; rngC <= val[0].e.c; ++rngC)
- if(out[encode_cell({c:rngC,r:rngR})])
- out[encode_cell({c:rngC,r:rngR})].l = val[1];
- } break;
- case 'HLinkTooltip': {
- for(rngR = val[0].s.r; rngR <= val[0].e.r; ++rngR)
- for(rngC = val[0].s.c; rngC <= val[0].e.c; ++rngC)
- if(out[encode_cell({c:rngC,r:rngR})])
- out[encode_cell({c:rngC,r:rngR})].l.tooltip = val[1];
- } break;
-
- /* Comments */
- case 'Note': {
- if(opts.biff <= 5 && opts.biff >= 2) break; /* TODO: BIFF5 */
- cc = out[encode_cell(val[0])];
- var noteobj = objects[val[2]];
- if(!cc) break;
- if(!cc.c) cc.c = [];
- cmnt = {a:val[1],t:noteobj.TxO.t};
- cc.c.push(cmnt);
- } break;
-
- default: switch(R.n) { /* nested */
- case 'ClrtClient': break;
- case 'XFExt': update_xfext(XFs[val.ixfe], val.ext); break;
-
- case 'NameCmt': break;
- case 'Header': break; // TODO
- case 'Footer': break; // TODO
- case 'HCenter': break; // TODO
- case 'VCenter': break; // TODO
- case 'Pls': break; // TODO
- case 'Setup': break; // TODO
- case 'DefColWidth': break; // TODO
- case 'GCW': break;
- case 'LHRecord': break;
- case 'ColInfo': break; // TODO
- case 'Row': break; // TODO
- case 'DBCell': break; // TODO
- case 'MulBlank': break; // TODO
- case 'EntExU2': break; // TODO
- case 'SxView': break; // TODO
- case 'Sxvd': break; // TODO
- case 'SXVI': break; // TODO
- case 'SXVDEx': break; // TODO
- case 'SxIvd': break; // TODO
- case 'SXDI': break; // TODO
- case 'SXLI': break; // TODO
- case 'SXEx': break; // TODO
- case 'QsiSXTag': break; // TODO
- case 'Selection': break;
- case 'Feat': break;
- case 'FeatHdr': case 'FeatHdr11': break;
- case 'Feature11': case 'Feature12': case 'List12': break;
- case 'Blank': break;
- case 'Country': country = val; break;
- case 'RecalcId': break;
- case 'DefaultRowHeight': case 'DxGCol': break; // TODO: htmlify
- case 'Fbi': case 'Fbi2': case 'GelFrame': break;
- case 'Font': break; // TODO
- case 'XFCRC': break; // TODO
- case 'Style': break; // TODO
- case 'StyleExt': break; // TODO
- case 'Palette': palette = val; break; // TODO
- case 'Theme': break; // TODO
- /* Protection */
- case 'ScenarioProtect': break;
- case 'ObjProtect': break;
-
- /* Conditional Formatting */
- case 'CondFmt12': break;
-
- /* Table */
- case 'Table': break; // TODO
- case 'TableStyles': break; // TODO
- case 'TableStyle': break; // TODO
- case 'TableStyleElement': break; // TODO
-
- /* PivotTable */
- case 'SXStreamID': break; // TODO
- case 'SXVS': break; // TODO
- case 'DConRef': break; // TODO
- case 'SXAddl': break; // TODO
- case 'DConBin': break; // TODO
- case 'DConName': break; // TODO
- case 'SXPI': break; // TODO
- case 'SxFormat': break; // TODO
- case 'SxSelect': break; // TODO
- case 'SxRule': break; // TODO
- case 'SxFilt': break; // TODO
- case 'SxItm': break; // TODO
- case 'SxDXF': break; // TODO
-
- /* Scenario Manager */
- case 'ScenMan': break;
-
- /* Data Consolidation */
- case 'DCon': break;
-
- /* Watched Cell */
- case 'CellWatch': break;
-
- /* Print Settings */
- case 'PrintRowCol': break;
- case 'PrintGrid': break;
- case 'PrintSize': break;
-
- case 'XCT': break;
- case 'CRN': break;
-
- case 'Scl': {
- //console.log("Zoom Level:", val[0]/val[1],val);
- } break;
- case 'SheetExt': {
-
- } break;
- case 'SheetExtOptional': {
-
- } break;
-
- /* VBA */
- case 'ObNoMacros': {
-
- } break;
- case 'ObProj': {
-
- } break;
- case 'CodeName': {
-
- } break;
- case 'GUIDTypeLib': {
-
- } break;
-
- case 'WOpt': break; // TODO: WTF?
- case 'PhoneticInfo': break;
-
- case 'OleObjectSize': break;
-
- /* Differential Formatting */
- case 'DXF': case 'DXFN': case 'DXFN12': case 'DXFN12List': case 'DXFN12NoCB': break;
-
- /* Data Validation */
- case 'Dv': case 'DVal': break;
-
- /* Data Series */
- case 'BRAI': case 'Series': case 'SeriesText': break;
-
- /* Data Connection */
- case 'DConn': break;
- case 'DbOrParamQry': break;
- case 'DBQueryExt': break;
-
- /* Formatting */
- case 'IFmtRecord': break;
- case 'CondFmt': case 'CF': case 'CF12': case 'CFEx': break;
-
- /* Explicitly Ignored */
- case 'Excel9File': break;
- case 'Units': break;
- case 'InterfaceHdr': case 'Mms': case 'InterfaceEnd': case 'DSF': case 'BuiltInFnGroupCount':
- /* View Stuff */
- case 'Window1': case 'Window2': case 'HideObj': case 'GridSet': case 'Guts':
- case 'UserBView': case 'UserSViewBegin': case 'UserSViewEnd':
- case 'Pane': break;
- default: switch(R.n) { /* nested */
- /* Chart */
- case 'Dat':
- case 'Begin': case 'End':
- case 'StartBlock': case 'EndBlock':
- case 'Frame': case 'Area':
- case 'Axis': case 'AxisLine': case 'Tick': break;
- case 'AxesUsed':
- case 'CrtLayout12': case 'CrtLayout12A': case 'CrtLink': case 'CrtLine': case 'CrtMlFrt': case 'CrtMlFrtContinue': break;
- case 'LineFormat': case 'AreaFormat':
- case 'Chart': case 'Chart3d': case 'Chart3DBarShape': case 'ChartFormat': case 'ChartFrtInfo': break;
- case 'PlotArea': case 'PlotGrowth': break;
- case 'SeriesList': case 'SerParent': case 'SerAuxTrend': break;
- case 'DataFormat': case 'SerToCrt': case 'FontX': break;
- case 'CatSerRange': case 'AxcExt': case 'SerFmt': break;
- case 'ShtProps': break;
- case 'DefaultText': case 'Text': case 'CatLab': break;
- case 'DataLabExtContents': break;
- case 'Legend': case 'LegendException': break;
- case 'Pie': case 'Scatter': break;
- case 'PieFormat': case 'MarkerFormat': break;
- case 'StartObject': case 'EndObject': break;
- case 'AlRuns': case 'ObjectLink': break;
- case 'SIIndex': break;
- case 'AttachedLabel': case 'YMult': break;
-
- /* Chart Group */
- case 'Line': case 'Bar': break;
- case 'Surf': break;
-
- /* Axis Group */
- case 'AxisParent': break;
- case 'Pos': break;
- case 'ValueRange': break;
-
- /* Pivot Chart */
- case 'SXViewEx9': break; // TODO
- case 'SXViewLink': break;
- case 'PivotChartBits': break;
- case 'SBaseRef': break;
- case 'TextPropsStream': break;
-
- /* Chart Misc */
- case 'LnExt': break;
- case 'MkrExt': break;
- case 'CrtCoopt': break;
-
- /* Query Table */
- case 'Qsi': case 'Qsif': case 'Qsir': case 'QsiSXTag': break;
- case 'TxtQry': break;
-
- /* Filter */
- case 'FilterMode': break;
- case 'AutoFilter': case 'AutoFilterInfo': break;
- case 'AutoFilter12': break;
- case 'DropDownObjIds': break;
- case 'Sort': break;
- case 'SortData': break;
-
- /* Drawing */
- case 'ShapePropsStream': break;
- case 'MsoDrawing': case 'MsoDrawingGroup': case 'MsoDrawingSelection': break;
- case 'ImData': break;
- /* Pub Stuff */
- case 'WebPub': case 'AutoWebPub':
-
- /* Print Stuff */
- case 'RightMargin': case 'LeftMargin': case 'TopMargin': case 'BottomMargin':
- case 'HeaderFooter': case 'HFPicture': case 'PLV':
- case 'HorizontalPageBreaks': case 'VerticalPageBreaks':
- /* Behavioral */
- case 'Backup': case 'CompressPictures': case 'Compat12': break;
-
- /* Should not Happen */
- case 'Continue': case 'ContinueFrt12': break;
-
- /* Future Records */
- case 'FrtFontList': case 'FrtWrapper': break;
-
- /* BIFF5 records */
- case 'ExternCount': break;
- case 'RString': break;
- case 'TabIdConf': case 'Radar': case 'RadarArea': case 'DropBar': case 'Intl': case 'CoordList': case 'SerAuxErrBar': break;
-
- default: switch(R.n) { /* nested */
- /* Miscellaneous */
- case 'SCENARIO': case 'DConBin': case 'PicF': case 'DataLabExt':
- case 'Lel': case 'BopPop': case 'BopPopCustom': case 'RealTimeData':
- case 'Name': break;
- default: if(options.WTF) throw 'Unrecognized Record ' + R.n;
- }}}}
- } else blob.l += length;
- }
- var sheetnamesraw = opts.biff === 2 ? ['Sheet1'] : Object.keys(Directory).sort(function(a,b) { return Number(a) - Number(b); }).map(function(x){return Directory[x].name;});
- var sheetnames = sheetnamesraw.slice();
- wb.Directory=sheetnamesraw;
- wb.SheetNames=sheetnamesraw;
- if(!options.bookSheets) wb.Sheets=Sheets;
- wb.Preamble=Preamble;
- wb.Strings = sst;
- wb.SSF = SSF.get_table();
- if(opts.enc) wb.Encryption = opts.enc;
- wb.Metadata = {};
- if(country !== undefined) wb.Metadata.Country = country;
- return wb;
-}
-
-function parse_xlscfb(cfb, options) {
-if(!options) options = {};
-fix_read_opts(options);
-reset_cp();
-var CompObj, Summary, Workbook;
-if(cfb.find) {
- CompObj = cfb.find('!CompObj');
- Summary = cfb.find('!SummaryInformation');
- Workbook = cfb.find('/Workbook');
-} else {
- prep_blob(cfb, 0);
- Workbook = {content: cfb};
-}
-
-if(!Workbook) Workbook = cfb.find('/Book');
-var CompObjP, SummaryP, WorkbookP;
-
-if(CompObj) CompObjP = parse_compobj(CompObj);
-if(options.bookProps && !options.bookSheets) WorkbookP = {};
-else {
- if(Workbook) WorkbookP = parse_workbook(Workbook.content, options, !!Workbook.find);
- else throw new Error("Cannot find Workbook stream");
-}
-
-if(cfb.find) parse_props(cfb);
-
-var props = {};
-for(var y in cfb.Summary) props[y] = cfb.Summary[y];
-for(y in cfb.DocSummary) props[y] = cfb.DocSummary[y];
-WorkbookP.Props = WorkbookP.Custprops = props; /* TODO: split up properties */
-if(options.bookFiles) WorkbookP.cfb = cfb;
-WorkbookP.CompObjP = CompObjP;
-return WorkbookP;
-}
-
-/* TODO: WTF */
-function parse_props(cfb) {
- /* [MS-OSHARED] 2.3.3.2.2 Document Summary Information Property Set */
- var DSI = cfb.find('!DocumentSummaryInformation');
- if(DSI) try { cfb.DocSummary = parse_PropertySetStream(DSI, DocSummaryPIDDSI); } catch(e) {}
-
- /* [MS-OSHARED] 2.3.3.2.1 Summary Information Property Set*/
- var SI = cfb.find('!SummaryInformation');
- if(SI) try { cfb.Summary = parse_PropertySetStream(SI, SummaryPIDSI); } catch(e) {}
-}
-
-/* [MS-XLSB] 2.3 Record Enumeration */
-var XLSBRecordEnum = {
- 0x0000: { n:"BrtRowHdr", f:parse_BrtRowHdr },
- 0x0001: { n:"BrtCellBlank", f:parse_BrtCellBlank },
- 0x0002: { n:"BrtCellRk", f:parse_BrtCellRk },
- 0x0003: { n:"BrtCellError", f:parse_BrtCellError },
- 0x0004: { n:"BrtCellBool", f:parse_BrtCellBool },
- 0x0005: { n:"BrtCellReal", f:parse_BrtCellReal },
- 0x0006: { n:"BrtCellSt", f:parse_BrtCellSt },
- 0x0007: { n:"BrtCellIsst", f:parse_BrtCellIsst },
- 0x0008: { n:"BrtFmlaString", f:parse_BrtFmlaString },
- 0x0009: { n:"BrtFmlaNum", f:parse_BrtFmlaNum },
- 0x000A: { n:"BrtFmlaBool", f:parse_BrtFmlaBool },
- 0x000B: { n:"BrtFmlaError", f:parse_BrtFmlaError },
- 0x0010: { n:"BrtFRTArchID$", f:parse_BrtFRTArchID$ },
- 0x0013: { n:"BrtSSTItem", f:parse_RichStr },
- 0x0014: { n:"BrtPCDIMissing", f:parsenoop },
- 0x0015: { n:"BrtPCDINumber", f:parsenoop },
- 0x0016: { n:"BrtPCDIBoolean", f:parsenoop },
- 0x0017: { n:"BrtPCDIError", f:parsenoop },
- 0x0018: { n:"BrtPCDIString", f:parsenoop },
- 0x0019: { n:"BrtPCDIDatetime", f:parsenoop },
- 0x001A: { n:"BrtPCDIIndex", f:parsenoop },
- 0x001B: { n:"BrtPCDIAMissing", f:parsenoop },
- 0x001C: { n:"BrtPCDIANumber", f:parsenoop },
- 0x001D: { n:"BrtPCDIABoolean", f:parsenoop },
- 0x001E: { n:"BrtPCDIAError", f:parsenoop },
- 0x001F: { n:"BrtPCDIAString", f:parsenoop },
- 0x0020: { n:"BrtPCDIADatetime", f:parsenoop },
- 0x0021: { n:"BrtPCRRecord", f:parsenoop },
- 0x0022: { n:"BrtPCRRecordDt", f:parsenoop },
- 0x0023: { n:"BrtFRTBegin", f:parsenoop },
- 0x0024: { n:"BrtFRTEnd", f:parsenoop },
- 0x0025: { n:"BrtACBegin", f:parsenoop },
- 0x0026: { n:"BrtACEnd", f:parsenoop },
- 0x0027: { n:"BrtName", f:parsenoop },
- 0x0028: { n:"BrtIndexRowBlock", f:parsenoop },
- 0x002A: { n:"BrtIndexBlock", f:parsenoop },
- 0x002B: { n:"BrtFont", f:parse_BrtFont },
- 0x002C: { n:"BrtFmt", f:parse_BrtFmt },
- 0x002D: { n:"BrtFill", f:parsenoop },
- 0x002E: { n:"BrtBorder", f:parsenoop },
- 0x002F: { n:"BrtXF", f:parse_BrtXF },
- 0x0030: { n:"BrtStyle", f:parsenoop },
- 0x0031: { n:"BrtCellMeta", f:parsenoop },
- 0x0032: { n:"BrtValueMeta", f:parsenoop },
- 0x0033: { n:"BrtMdb", f:parsenoop },
- 0x0034: { n:"BrtBeginFmd", f:parsenoop },
- 0x0035: { n:"BrtEndFmd", f:parsenoop },
- 0x0036: { n:"BrtBeginMdx", f:parsenoop },
- 0x0037: { n:"BrtEndMdx", f:parsenoop },
- 0x0038: { n:"BrtBeginMdxTuple", f:parsenoop },
- 0x0039: { n:"BrtEndMdxTuple", f:parsenoop },
- 0x003A: { n:"BrtMdxMbrIstr", f:parsenoop },
- 0x003B: { n:"BrtStr", f:parsenoop },
- 0x003C: { n:"BrtColInfo", f:parsenoop },
- 0x003E: { n:"BrtCellRString", f:parsenoop },
- 0x003F: { n:"BrtCalcChainItem$", f:parse_BrtCalcChainItem$ },
- 0x0040: { n:"BrtDVal", f:parsenoop },
- 0x0041: { n:"BrtSxvcellNum", f:parsenoop },
- 0x0042: { n:"BrtSxvcellStr", f:parsenoop },
- 0x0043: { n:"BrtSxvcellBool", f:parsenoop },
- 0x0044: { n:"BrtSxvcellErr", f:parsenoop },
- 0x0045: { n:"BrtSxvcellDate", f:parsenoop },
- 0x0046: { n:"BrtSxvcellNil", f:parsenoop },
- 0x0080: { n:"BrtFileVersion", f:parsenoop },
- 0x0081: { n:"BrtBeginSheet", f:parsenoop },
- 0x0082: { n:"BrtEndSheet", f:parsenoop },
- 0x0083: { n:"BrtBeginBook", f:parsenoop, p:0 },
- 0x0084: { n:"BrtEndBook", f:parsenoop },
- 0x0085: { n:"BrtBeginWsViews", f:parsenoop },
- 0x0086: { n:"BrtEndWsViews", f:parsenoop },
- 0x0087: { n:"BrtBeginBookViews", f:parsenoop },
- 0x0088: { n:"BrtEndBookViews", f:parsenoop },
- 0x0089: { n:"BrtBeginWsView", f:parsenoop },
- 0x008A: { n:"BrtEndWsView", f:parsenoop },
- 0x008B: { n:"BrtBeginCsViews", f:parsenoop },
- 0x008C: { n:"BrtEndCsViews", f:parsenoop },
- 0x008D: { n:"BrtBeginCsView", f:parsenoop },
- 0x008E: { n:"BrtEndCsView", f:parsenoop },
- 0x008F: { n:"BrtBeginBundleShs", f:parsenoop },
- 0x0090: { n:"BrtEndBundleShs", f:parsenoop },
- 0x0091: { n:"BrtBeginSheetData", f:parsenoop },
- 0x0092: { n:"BrtEndSheetData", f:parsenoop },
- 0x0093: { n:"BrtWsProp", f:parse_BrtWsProp },
- 0x0094: { n:"BrtWsDim", f:parse_BrtWsDim, p:16 },
- 0x0097: { n:"BrtPane", f:parsenoop },
- 0x0098: { n:"BrtSel", f:parsenoop },
- 0x0099: { n:"BrtWbProp", f:parse_BrtWbProp },
- 0x009A: { n:"BrtWbFactoid", f:parsenoop },
- 0x009B: { n:"BrtFileRecover", f:parsenoop },
- 0x009C: { n:"BrtBundleSh", f:parse_BrtBundleSh },
- 0x009D: { n:"BrtCalcProp", f:parsenoop },
- 0x009E: { n:"BrtBookView", f:parsenoop },
- 0x009F: { n:"BrtBeginSst", f:parse_BrtBeginSst },
- 0x00A0: { n:"BrtEndSst", f:parsenoop },
- 0x00A1: { n:"BrtBeginAFilter", f:parsenoop },
- 0x00A2: { n:"BrtEndAFilter", f:parsenoop },
- 0x00A3: { n:"BrtBeginFilterColumn", f:parsenoop },
- 0x00A4: { n:"BrtEndFilterColumn", f:parsenoop },
- 0x00A5: { n:"BrtBeginFilters", f:parsenoop },
- 0x00A6: { n:"BrtEndFilters", f:parsenoop },
- 0x00A7: { n:"BrtFilter", f:parsenoop },
- 0x00A8: { n:"BrtColorFilter", f:parsenoop },
- 0x00A9: { n:"BrtIconFilter", f:parsenoop },
- 0x00AA: { n:"BrtTop10Filter", f:parsenoop },
- 0x00AB: { n:"BrtDynamicFilter", f:parsenoop },
- 0x00AC: { n:"BrtBeginCustomFilters", f:parsenoop },
- 0x00AD: { n:"BrtEndCustomFilters", f:parsenoop },
- 0x00AE: { n:"BrtCustomFilter", f:parsenoop },
- 0x00AF: { n:"BrtAFilterDateGroupItem", f:parsenoop },
- 0x00B0: { n:"BrtMergeCell", f:parse_BrtMergeCell },
- 0x00B1: { n:"BrtBeginMergeCells", f:parsenoop },
- 0x00B2: { n:"BrtEndMergeCells", f:parsenoop },
- 0x00B3: { n:"BrtBeginPivotCacheDef", f:parsenoop },
- 0x00B4: { n:"BrtEndPivotCacheDef", f:parsenoop },
- 0x00B5: { n:"BrtBeginPCDFields", f:parsenoop },
- 0x00B6: { n:"BrtEndPCDFields", f:parsenoop },
- 0x00B7: { n:"BrtBeginPCDField", f:parsenoop },
- 0x00B8: { n:"BrtEndPCDField", f:parsenoop },
- 0x00B9: { n:"BrtBeginPCDSource", f:parsenoop },
- 0x00BA: { n:"BrtEndPCDSource", f:parsenoop },
- 0x00BB: { n:"BrtBeginPCDSRange", f:parsenoop },
- 0x00BC: { n:"BrtEndPCDSRange", f:parsenoop },
- 0x00BD: { n:"BrtBeginPCDFAtbl", f:parsenoop },
- 0x00BE: { n:"BrtEndPCDFAtbl", f:parsenoop },
- 0x00BF: { n:"BrtBeginPCDIRun", f:parsenoop },
- 0x00C0: { n:"BrtEndPCDIRun", f:parsenoop },
- 0x00C1: { n:"BrtBeginPivotCacheRecords", f:parsenoop },
- 0x00C2: { n:"BrtEndPivotCacheRecords", f:parsenoop },
- 0x00C3: { n:"BrtBeginPCDHierarchies", f:parsenoop },
- 0x00C4: { n:"BrtEndPCDHierarchies", f:parsenoop },
- 0x00C5: { n:"BrtBeginPCDHierarchy", f:parsenoop },
- 0x00C6: { n:"BrtEndPCDHierarchy", f:parsenoop },
- 0x00C7: { n:"BrtBeginPCDHFieldsUsage", f:parsenoop },
- 0x00C8: { n:"BrtEndPCDHFieldsUsage", f:parsenoop },
- 0x00C9: { n:"BrtBeginExtConnection", f:parsenoop },
- 0x00CA: { n:"BrtEndExtConnection", f:parsenoop },
- 0x00CB: { n:"BrtBeginECDbProps", f:parsenoop },
- 0x00CC: { n:"BrtEndECDbProps", f:parsenoop },
- 0x00CD: { n:"BrtBeginECOlapProps", f:parsenoop },
- 0x00CE: { n:"BrtEndECOlapProps", f:parsenoop },
- 0x00CF: { n:"BrtBeginPCDSConsol", f:parsenoop },
- 0x00D0: { n:"BrtEndPCDSConsol", f:parsenoop },
- 0x00D1: { n:"BrtBeginPCDSCPages", f:parsenoop },
- 0x00D2: { n:"BrtEndPCDSCPages", f:parsenoop },
- 0x00D3: { n:"BrtBeginPCDSCPage", f:parsenoop },
- 0x00D4: { n:"BrtEndPCDSCPage", f:parsenoop },
- 0x00D5: { n:"BrtBeginPCDSCPItem", f:parsenoop },
- 0x00D6: { n:"BrtEndPCDSCPItem", f:parsenoop },
- 0x00D7: { n:"BrtBeginPCDSCSets", f:parsenoop },
- 0x00D8: { n:"BrtEndPCDSCSets", f:parsenoop },
- 0x00D9: { n:"BrtBeginPCDSCSet", f:parsenoop },
- 0x00DA: { n:"BrtEndPCDSCSet", f:parsenoop },
- 0x00DB: { n:"BrtBeginPCDFGroup", f:parsenoop },
- 0x00DC: { n:"BrtEndPCDFGroup", f:parsenoop },
- 0x00DD: { n:"BrtBeginPCDFGItems", f:parsenoop },
- 0x00DE: { n:"BrtEndPCDFGItems", f:parsenoop },
- 0x00DF: { n:"BrtBeginPCDFGRange", f:parsenoop },
- 0x00E0: { n:"BrtEndPCDFGRange", f:parsenoop },
- 0x00E1: { n:"BrtBeginPCDFGDiscrete", f:parsenoop },
- 0x00E2: { n:"BrtEndPCDFGDiscrete", f:parsenoop },
- 0x00E3: { n:"BrtBeginPCDSDTupleCache", f:parsenoop },
- 0x00E4: { n:"BrtEndPCDSDTupleCache", f:parsenoop },
- 0x00E5: { n:"BrtBeginPCDSDTCEntries", f:parsenoop },
- 0x00E6: { n:"BrtEndPCDSDTCEntries", f:parsenoop },
- 0x00E7: { n:"BrtBeginPCDSDTCEMembers", f:parsenoop },
- 0x00E8: { n:"BrtEndPCDSDTCEMembers", f:parsenoop },
- 0x00E9: { n:"BrtBeginPCDSDTCEMember", f:parsenoop },
- 0x00EA: { n:"BrtEndPCDSDTCEMember", f:parsenoop },
- 0x00EB: { n:"BrtBeginPCDSDTCQueries", f:parsenoop },
- 0x00EC: { n:"BrtEndPCDSDTCQueries", f:parsenoop },
- 0x00ED: { n:"BrtBeginPCDSDTCQuery", f:parsenoop },
- 0x00EE: { n:"BrtEndPCDSDTCQuery", f:parsenoop },
- 0x00EF: { n:"BrtBeginPCDSDTCSets", f:parsenoop },
- 0x00F0: { n:"BrtEndPCDSDTCSets", f:parsenoop },
- 0x00F1: { n:"BrtBeginPCDSDTCSet", f:parsenoop },
- 0x00F2: { n:"BrtEndPCDSDTCSet", f:parsenoop },
- 0x00F3: { n:"BrtBeginPCDCalcItems", f:parsenoop },
- 0x00F4: { n:"BrtEndPCDCalcItems", f:parsenoop },
- 0x00F5: { n:"BrtBeginPCDCalcItem", f:parsenoop },
- 0x00F6: { n:"BrtEndPCDCalcItem", f:parsenoop },
- 0x00F7: { n:"BrtBeginPRule", f:parsenoop },
- 0x00F8: { n:"BrtEndPRule", f:parsenoop },
- 0x00F9: { n:"BrtBeginPRFilters", f:parsenoop },
- 0x00FA: { n:"BrtEndPRFilters", f:parsenoop },
- 0x00FB: { n:"BrtBeginPRFilter", f:parsenoop },
- 0x00FC: { n:"BrtEndPRFilter", f:parsenoop },
- 0x00FD: { n:"BrtBeginPNames", f:parsenoop },
- 0x00FE: { n:"BrtEndPNames", f:parsenoop },
- 0x00FF: { n:"BrtBeginPName", f:parsenoop },
- 0x0100: { n:"BrtEndPName", f:parsenoop },
- 0x0101: { n:"BrtBeginPNPairs", f:parsenoop },
- 0x0102: { n:"BrtEndPNPairs", f:parsenoop },
- 0x0103: { n:"BrtBeginPNPair", f:parsenoop },
- 0x0104: { n:"BrtEndPNPair", f:parsenoop },
- 0x0105: { n:"BrtBeginECWebProps", f:parsenoop },
- 0x0106: { n:"BrtEndECWebProps", f:parsenoop },
- 0x0107: { n:"BrtBeginEcWpTables", f:parsenoop },
- 0x0108: { n:"BrtEndECWPTables", f:parsenoop },
- 0x0109: { n:"BrtBeginECParams", f:parsenoop },
- 0x010A: { n:"BrtEndECParams", f:parsenoop },
- 0x010B: { n:"BrtBeginECParam", f:parsenoop },
- 0x010C: { n:"BrtEndECParam", f:parsenoop },
- 0x010D: { n:"BrtBeginPCDKPIs", f:parsenoop },
- 0x010E: { n:"BrtEndPCDKPIs", f:parsenoop },
- 0x010F: { n:"BrtBeginPCDKPI", f:parsenoop },
- 0x0110: { n:"BrtEndPCDKPI", f:parsenoop },
- 0x0111: { n:"BrtBeginDims", f:parsenoop },
- 0x0112: { n:"BrtEndDims", f:parsenoop },
- 0x0113: { n:"BrtBeginDim", f:parsenoop },
- 0x0114: { n:"BrtEndDim", f:parsenoop },
- 0x0115: { n:"BrtIndexPartEnd", f:parsenoop },
- 0x0116: { n:"BrtBeginStyleSheet", f:parsenoop },
- 0x0117: { n:"BrtEndStyleSheet", f:parsenoop },
- 0x0118: { n:"BrtBeginSXView", f:parsenoop },
- 0x0119: { n:"BrtEndSXVI", f:parsenoop },
- 0x011A: { n:"BrtBeginSXVI", f:parsenoop },
- 0x011B: { n:"BrtBeginSXVIs", f:parsenoop },
- 0x011C: { n:"BrtEndSXVIs", f:parsenoop },
- 0x011D: { n:"BrtBeginSXVD", f:parsenoop },
- 0x011E: { n:"BrtEndSXVD", f:parsenoop },
- 0x011F: { n:"BrtBeginSXVDs", f:parsenoop },
- 0x0120: { n:"BrtEndSXVDs", f:parsenoop },
- 0x0121: { n:"BrtBeginSXPI", f:parsenoop },
- 0x0122: { n:"BrtEndSXPI", f:parsenoop },
- 0x0123: { n:"BrtBeginSXPIs", f:parsenoop },
- 0x0124: { n:"BrtEndSXPIs", f:parsenoop },
- 0x0125: { n:"BrtBeginSXDI", f:parsenoop },
- 0x0126: { n:"BrtEndSXDI", f:parsenoop },
- 0x0127: { n:"BrtBeginSXDIs", f:parsenoop },
- 0x0128: { n:"BrtEndSXDIs", f:parsenoop },
- 0x0129: { n:"BrtBeginSXLI", f:parsenoop },
- 0x012A: { n:"BrtEndSXLI", f:parsenoop },
- 0x012B: { n:"BrtBeginSXLIRws", f:parsenoop },
- 0x012C: { n:"BrtEndSXLIRws", f:parsenoop },
- 0x012D: { n:"BrtBeginSXLICols", f:parsenoop },
- 0x012E: { n:"BrtEndSXLICols", f:parsenoop },
- 0x012F: { n:"BrtBeginSXFormat", f:parsenoop },
- 0x0130: { n:"BrtEndSXFormat", f:parsenoop },
- 0x0131: { n:"BrtBeginSXFormats", f:parsenoop },
- 0x0132: { n:"BrtEndSxFormats", f:parsenoop },
- 0x0133: { n:"BrtBeginSxSelect", f:parsenoop },
- 0x0134: { n:"BrtEndSxSelect", f:parsenoop },
- 0x0135: { n:"BrtBeginISXVDRws", f:parsenoop },
- 0x0136: { n:"BrtEndISXVDRws", f:parsenoop },
- 0x0137: { n:"BrtBeginISXVDCols", f:parsenoop },
- 0x0138: { n:"BrtEndISXVDCols", f:parsenoop },
- 0x0139: { n:"BrtEndSXLocation", f:parsenoop },
- 0x013A: { n:"BrtBeginSXLocation", f:parsenoop },
- 0x013B: { n:"BrtEndSXView", f:parsenoop },
- 0x013C: { n:"BrtBeginSXTHs", f:parsenoop },
- 0x013D: { n:"BrtEndSXTHs", f:parsenoop },
- 0x013E: { n:"BrtBeginSXTH", f:parsenoop },
- 0x013F: { n:"BrtEndSXTH", f:parsenoop },
- 0x0140: { n:"BrtBeginISXTHRws", f:parsenoop },
- 0x0141: { n:"BrtEndISXTHRws", f:parsenoop },
- 0x0142: { n:"BrtBeginISXTHCols", f:parsenoop },
- 0x0143: { n:"BrtEndISXTHCols", f:parsenoop },
- 0x0144: { n:"BrtBeginSXTDMPS", f:parsenoop },
- 0x0145: { n:"BrtEndSXTDMPs", f:parsenoop },
- 0x0146: { n:"BrtBeginSXTDMP", f:parsenoop },
- 0x0147: { n:"BrtEndSXTDMP", f:parsenoop },
- 0x0148: { n:"BrtBeginSXTHItems", f:parsenoop },
- 0x0149: { n:"BrtEndSXTHItems", f:parsenoop },
- 0x014A: { n:"BrtBeginSXTHItem", f:parsenoop },
- 0x014B: { n:"BrtEndSXTHItem", f:parsenoop },
- 0x014C: { n:"BrtBeginMetadata", f:parsenoop },
- 0x014D: { n:"BrtEndMetadata", f:parsenoop },
- 0x014E: { n:"BrtBeginEsmdtinfo", f:parsenoop },
- 0x014F: { n:"BrtMdtinfo", f:parsenoop },
- 0x0150: { n:"BrtEndEsmdtinfo", f:parsenoop },
- 0x0151: { n:"BrtBeginEsmdb", f:parsenoop },
- 0x0152: { n:"BrtEndEsmdb", f:parsenoop },
- 0x0153: { n:"BrtBeginEsfmd", f:parsenoop },
- 0x0154: { n:"BrtEndEsfmd", f:parsenoop },
- 0x0155: { n:"BrtBeginSingleCells", f:parsenoop },
- 0x0156: { n:"BrtEndSingleCells", f:parsenoop },
- 0x0157: { n:"BrtBeginList", f:parsenoop },
- 0x0158: { n:"BrtEndList", f:parsenoop },
- 0x0159: { n:"BrtBeginListCols", f:parsenoop },
- 0x015A: { n:"BrtEndListCols", f:parsenoop },
- 0x015B: { n:"BrtBeginListCol", f:parsenoop },
- 0x015C: { n:"BrtEndListCol", f:parsenoop },
- 0x015D: { n:"BrtBeginListXmlCPr", f:parsenoop },
- 0x015E: { n:"BrtEndListXmlCPr", f:parsenoop },
- 0x015F: { n:"BrtListCCFmla", f:parsenoop },
- 0x0160: { n:"BrtListTrFmla", f:parsenoop },
- 0x0161: { n:"BrtBeginExternals", f:parsenoop },
- 0x0162: { n:"BrtEndExternals", f:parsenoop },
- 0x0163: { n:"BrtSupBookSrc", f:parsenoop },
- 0x0165: { n:"BrtSupSelf", f:parsenoop },
- 0x0166: { n:"BrtSupSame", f:parsenoop },
- 0x0167: { n:"BrtSupTabs", f:parsenoop },
- 0x0168: { n:"BrtBeginSupBook", f:parsenoop },
- 0x0169: { n:"BrtPlaceholderName", f:parsenoop },
- 0x016A: { n:"BrtExternSheet", f:parsenoop },
- 0x016B: { n:"BrtExternTableStart", f:parsenoop },
- 0x016C: { n:"BrtExternTableEnd", f:parsenoop },
- 0x016E: { n:"BrtExternRowHdr", f:parsenoop },
- 0x016F: { n:"BrtExternCellBlank", f:parsenoop },
- 0x0170: { n:"BrtExternCellReal", f:parsenoop },
- 0x0171: { n:"BrtExternCellBool", f:parsenoop },
- 0x0172: { n:"BrtExternCellError", f:parsenoop },
- 0x0173: { n:"BrtExternCellString", f:parsenoop },
- 0x0174: { n:"BrtBeginEsmdx", f:parsenoop },
- 0x0175: { n:"BrtEndEsmdx", f:parsenoop },
- 0x0176: { n:"BrtBeginMdxSet", f:parsenoop },
- 0x0177: { n:"BrtEndMdxSet", f:parsenoop },
- 0x0178: { n:"BrtBeginMdxMbrProp", f:parsenoop },
- 0x0179: { n:"BrtEndMdxMbrProp", f:parsenoop },
- 0x017A: { n:"BrtBeginMdxKPI", f:parsenoop },
- 0x017B: { n:"BrtEndMdxKPI", f:parsenoop },
- 0x017C: { n:"BrtBeginEsstr", f:parsenoop },
- 0x017D: { n:"BrtEndEsstr", f:parsenoop },
- 0x017E: { n:"BrtBeginPRFItem", f:parsenoop },
- 0x017F: { n:"BrtEndPRFItem", f:parsenoop },
- 0x0180: { n:"BrtBeginPivotCacheIDs", f:parsenoop },
- 0x0181: { n:"BrtEndPivotCacheIDs", f:parsenoop },
- 0x0182: { n:"BrtBeginPivotCacheID", f:parsenoop },
- 0x0183: { n:"BrtEndPivotCacheID", f:parsenoop },
- 0x0184: { n:"BrtBeginISXVIs", f:parsenoop },
- 0x0185: { n:"BrtEndISXVIs", f:parsenoop },
- 0x0186: { n:"BrtBeginColInfos", f:parsenoop },
- 0x0187: { n:"BrtEndColInfos", f:parsenoop },
- 0x0188: { n:"BrtBeginRwBrk", f:parsenoop },
- 0x0189: { n:"BrtEndRwBrk", f:parsenoop },
- 0x018A: { n:"BrtBeginColBrk", f:parsenoop },
- 0x018B: { n:"BrtEndColBrk", f:parsenoop },
- 0x018C: { n:"BrtBrk", f:parsenoop },
- 0x018D: { n:"BrtUserBookView", f:parsenoop },
- 0x018E: { n:"BrtInfo", f:parsenoop },
- 0x018F: { n:"BrtCUsr", f:parsenoop },
- 0x0190: { n:"BrtUsr", f:parsenoop },
- 0x0191: { n:"BrtBeginUsers", f:parsenoop },
- 0x0193: { n:"BrtEOF", f:parsenoop },
- 0x0194: { n:"BrtUCR", f:parsenoop },
- 0x0195: { n:"BrtRRInsDel", f:parsenoop },
- 0x0196: { n:"BrtRREndInsDel", f:parsenoop },
- 0x0197: { n:"BrtRRMove", f:parsenoop },
- 0x0198: { n:"BrtRREndMove", f:parsenoop },
- 0x0199: { n:"BrtRRChgCell", f:parsenoop },
- 0x019A: { n:"BrtRREndChgCell", f:parsenoop },
- 0x019B: { n:"BrtRRHeader", f:parsenoop },
- 0x019C: { n:"BrtRRUserView", f:parsenoop },
- 0x019D: { n:"BrtRRRenSheet", f:parsenoop },
- 0x019E: { n:"BrtRRInsertSh", f:parsenoop },
- 0x019F: { n:"BrtRRDefName", f:parsenoop },
- 0x01A0: { n:"BrtRRNote", f:parsenoop },
- 0x01A1: { n:"BrtRRConflict", f:parsenoop },
- 0x01A2: { n:"BrtRRTQSIF", f:parsenoop },
- 0x01A3: { n:"BrtRRFormat", f:parsenoop },
- 0x01A4: { n:"BrtRREndFormat", f:parsenoop },
- 0x01A5: { n:"BrtRRAutoFmt", f:parsenoop },
- 0x01A6: { n:"BrtBeginUserShViews", f:parsenoop },
- 0x01A7: { n:"BrtBeginUserShView", f:parsenoop },
- 0x01A8: { n:"BrtEndUserShView", f:parsenoop },
- 0x01A9: { n:"BrtEndUserShViews", f:parsenoop },
- 0x01AA: { n:"BrtArrFmla", f:parsenoop },
- 0x01AB: { n:"BrtShrFmla", f:parsenoop },
- 0x01AC: { n:"BrtTable", f:parsenoop },
- 0x01AD: { n:"BrtBeginExtConnections", f:parsenoop },
- 0x01AE: { n:"BrtEndExtConnections", f:parsenoop },
- 0x01AF: { n:"BrtBeginPCDCalcMems", f:parsenoop },
- 0x01B0: { n:"BrtEndPCDCalcMems", f:parsenoop },
- 0x01B1: { n:"BrtBeginPCDCalcMem", f:parsenoop },
- 0x01B2: { n:"BrtEndPCDCalcMem", f:parsenoop },
- 0x01B3: { n:"BrtBeginPCDHGLevels", f:parsenoop },
- 0x01B4: { n:"BrtEndPCDHGLevels", f:parsenoop },
- 0x01B5: { n:"BrtBeginPCDHGLevel", f:parsenoop },
- 0x01B6: { n:"BrtEndPCDHGLevel", f:parsenoop },
- 0x01B7: { n:"BrtBeginPCDHGLGroups", f:parsenoop },
- 0x01B8: { n:"BrtEndPCDHGLGroups", f:parsenoop },
- 0x01B9: { n:"BrtBeginPCDHGLGroup", f:parsenoop },
- 0x01BA: { n:"BrtEndPCDHGLGroup", f:parsenoop },
- 0x01BB: { n:"BrtBeginPCDHGLGMembers", f:parsenoop },
- 0x01BC: { n:"BrtEndPCDHGLGMembers", f:parsenoop },
- 0x01BD: { n:"BrtBeginPCDHGLGMember", f:parsenoop },
- 0x01BE: { n:"BrtEndPCDHGLGMember", f:parsenoop },
- 0x01BF: { n:"BrtBeginQSI", f:parsenoop },
- 0x01C0: { n:"BrtEndQSI", f:parsenoop },
- 0x01C1: { n:"BrtBeginQSIR", f:parsenoop },
- 0x01C2: { n:"BrtEndQSIR", f:parsenoop },
- 0x01C3: { n:"BrtBeginDeletedNames", f:parsenoop },
- 0x01C4: { n:"BrtEndDeletedNames", f:parsenoop },
- 0x01C5: { n:"BrtBeginDeletedName", f:parsenoop },
- 0x01C6: { n:"BrtEndDeletedName", f:parsenoop },
- 0x01C7: { n:"BrtBeginQSIFs", f:parsenoop },
- 0x01C8: { n:"BrtEndQSIFs", f:parsenoop },
- 0x01C9: { n:"BrtBeginQSIF", f:parsenoop },
- 0x01CA: { n:"BrtEndQSIF", f:parsenoop },
- 0x01CB: { n:"BrtBeginAutoSortScope", f:parsenoop },
- 0x01CC: { n:"BrtEndAutoSortScope", f:parsenoop },
- 0x01CD: { n:"BrtBeginConditionalFormatting", f:parsenoop },
- 0x01CE: { n:"BrtEndConditionalFormatting", f:parsenoop },
- 0x01CF: { n:"BrtBeginCFRule", f:parsenoop },
- 0x01D0: { n:"BrtEndCFRule", f:parsenoop },
- 0x01D1: { n:"BrtBeginIconSet", f:parsenoop },
- 0x01D2: { n:"BrtEndIconSet", f:parsenoop },
- 0x01D3: { n:"BrtBeginDatabar", f:parsenoop },
- 0x01D4: { n:"BrtEndDatabar", f:parsenoop },
- 0x01D5: { n:"BrtBeginColorScale", f:parsenoop },
- 0x01D6: { n:"BrtEndColorScale", f:parsenoop },
- 0x01D7: { n:"BrtCFVO", f:parsenoop },
- 0x01D8: { n:"BrtExternValueMeta", f:parsenoop },
- 0x01D9: { n:"BrtBeginColorPalette", f:parsenoop },
- 0x01DA: { n:"BrtEndColorPalette", f:parsenoop },
- 0x01DB: { n:"BrtIndexedColor", f:parsenoop },
- 0x01DC: { n:"BrtMargins", f:parsenoop },
- 0x01DD: { n:"BrtPrintOptions", f:parsenoop },
- 0x01DE: { n:"BrtPageSetup", f:parsenoop },
- 0x01DF: { n:"BrtBeginHeaderFooter", f:parsenoop },
- 0x01E0: { n:"BrtEndHeaderFooter", f:parsenoop },
- 0x01E1: { n:"BrtBeginSXCrtFormat", f:parsenoop },
- 0x01E2: { n:"BrtEndSXCrtFormat", f:parsenoop },
- 0x01E3: { n:"BrtBeginSXCrtFormats", f:parsenoop },
- 0x01E4: { n:"BrtEndSXCrtFormats", f:parsenoop },
- 0x01E5: { n:"BrtWsFmtInfo", f:parsenoop },
- 0x01E6: { n:"BrtBeginMgs", f:parsenoop },
- 0x01E7: { n:"BrtEndMGs", f:parsenoop },
- 0x01E8: { n:"BrtBeginMGMaps", f:parsenoop },
- 0x01E9: { n:"BrtEndMGMaps", f:parsenoop },
- 0x01EA: { n:"BrtBeginMG", f:parsenoop },
- 0x01EB: { n:"BrtEndMG", f:parsenoop },
- 0x01EC: { n:"BrtBeginMap", f:parsenoop },
- 0x01ED: { n:"BrtEndMap", f:parsenoop },
- 0x01EE: { n:"BrtHLink", f:parse_BrtHLink },
- 0x01EF: { n:"BrtBeginDCon", f:parsenoop },
- 0x01F0: { n:"BrtEndDCon", f:parsenoop },
- 0x01F1: { n:"BrtBeginDRefs", f:parsenoop },
- 0x01F2: { n:"BrtEndDRefs", f:parsenoop },
- 0x01F3: { n:"BrtDRef", f:parsenoop },
- 0x01F4: { n:"BrtBeginScenMan", f:parsenoop },
- 0x01F5: { n:"BrtEndScenMan", f:parsenoop },
- 0x01F6: { n:"BrtBeginSct", f:parsenoop },
- 0x01F7: { n:"BrtEndSct", f:parsenoop },
- 0x01F8: { n:"BrtSlc", f:parsenoop },
- 0x01F9: { n:"BrtBeginDXFs", f:parsenoop },
- 0x01FA: { n:"BrtEndDXFs", f:parsenoop },
- 0x01FB: { n:"BrtDXF", f:parsenoop },
- 0x01FC: { n:"BrtBeginTableStyles", f:parsenoop },
- 0x01FD: { n:"BrtEndTableStyles", f:parsenoop },
- 0x01FE: { n:"BrtBeginTableStyle", f:parsenoop },
- 0x01FF: { n:"BrtEndTableStyle", f:parsenoop },
- 0x0200: { n:"BrtTableStyleElement", f:parsenoop },
- 0x0201: { n:"BrtTableStyleClient", f:parsenoop },
- 0x0202: { n:"BrtBeginVolDeps", f:parsenoop },
- 0x0203: { n:"BrtEndVolDeps", f:parsenoop },
- 0x0204: { n:"BrtBeginVolType", f:parsenoop },
- 0x0205: { n:"BrtEndVolType", f:parsenoop },
- 0x0206: { n:"BrtBeginVolMain", f:parsenoop },
- 0x0207: { n:"BrtEndVolMain", f:parsenoop },
- 0x0208: { n:"BrtBeginVolTopic", f:parsenoop },
- 0x0209: { n:"BrtEndVolTopic", f:parsenoop },
- 0x020A: { n:"BrtVolSubtopic", f:parsenoop },
- 0x020B: { n:"BrtVolRef", f:parsenoop },
- 0x020C: { n:"BrtVolNum", f:parsenoop },
- 0x020D: { n:"BrtVolErr", f:parsenoop },
- 0x020E: { n:"BrtVolStr", f:parsenoop },
- 0x020F: { n:"BrtVolBool", f:parsenoop },
- 0x0210: { n:"BrtBeginCalcChain$", f:parsenoop },
- 0x0211: { n:"BrtEndCalcChain$", f:parsenoop },
- 0x0212: { n:"BrtBeginSortState", f:parsenoop },
- 0x0213: { n:"BrtEndSortState", f:parsenoop },
- 0x0214: { n:"BrtBeginSortCond", f:parsenoop },
- 0x0215: { n:"BrtEndSortCond", f:parsenoop },
- 0x0216: { n:"BrtBookProtection", f:parsenoop },
- 0x0217: { n:"BrtSheetProtection", f:parsenoop },
- 0x0218: { n:"BrtRangeProtection", f:parsenoop },
- 0x0219: { n:"BrtPhoneticInfo", f:parsenoop },
- 0x021A: { n:"BrtBeginECTxtWiz", f:parsenoop },
- 0x021B: { n:"BrtEndECTxtWiz", f:parsenoop },
- 0x021C: { n:"BrtBeginECTWFldInfoLst", f:parsenoop },
- 0x021D: { n:"BrtEndECTWFldInfoLst", f:parsenoop },
- 0x021E: { n:"BrtBeginECTwFldInfo", f:parsenoop },
- 0x0224: { n:"BrtFileSharing", f:parsenoop },
- 0x0225: { n:"BrtOleSize", f:parsenoop },
- 0x0226: { n:"BrtDrawing", f:parsenoop },
- 0x0227: { n:"BrtLegacyDrawing", f:parsenoop },
- 0x0228: { n:"BrtLegacyDrawingHF", f:parsenoop },
- 0x0229: { n:"BrtWebOpt", f:parsenoop },
- 0x022A: { n:"BrtBeginWebPubItems", f:parsenoop },
- 0x022B: { n:"BrtEndWebPubItems", f:parsenoop },
- 0x022C: { n:"BrtBeginWebPubItem", f:parsenoop },
- 0x022D: { n:"BrtEndWebPubItem", f:parsenoop },
- 0x022E: { n:"BrtBeginSXCondFmt", f:parsenoop },
- 0x022F: { n:"BrtEndSXCondFmt", f:parsenoop },
- 0x0230: { n:"BrtBeginSXCondFmts", f:parsenoop },
- 0x0231: { n:"BrtEndSXCondFmts", f:parsenoop },
- 0x0232: { n:"BrtBkHim", f:parsenoop },
- 0x0234: { n:"BrtColor", f:parsenoop },
- 0x0235: { n:"BrtBeginIndexedColors", f:parsenoop },
- 0x0236: { n:"BrtEndIndexedColors", f:parsenoop },
- 0x0239: { n:"BrtBeginMRUColors", f:parsenoop },
- 0x023A: { n:"BrtEndMRUColors", f:parsenoop },
- 0x023C: { n:"BrtMRUColor", f:parsenoop },
- 0x023D: { n:"BrtBeginDVals", f:parsenoop },
- 0x023E: { n:"BrtEndDVals", f:parsenoop },
- 0x0241: { n:"BrtSupNameStart", f:parsenoop },
- 0x0242: { n:"BrtSupNameValueStart", f:parsenoop },
- 0x0243: { n:"BrtSupNameValueEnd", f:parsenoop },
- 0x0244: { n:"BrtSupNameNum", f:parsenoop },
- 0x0245: { n:"BrtSupNameErr", f:parsenoop },
- 0x0246: { n:"BrtSupNameSt", f:parsenoop },
- 0x0247: { n:"BrtSupNameNil", f:parsenoop },
- 0x0248: { n:"BrtSupNameBool", f:parsenoop },
- 0x0249: { n:"BrtSupNameFmla", f:parsenoop },
- 0x024A: { n:"BrtSupNameBits", f:parsenoop },
- 0x024B: { n:"BrtSupNameEnd", f:parsenoop },
- 0x024C: { n:"BrtEndSupBook", f:parsenoop },
- 0x024D: { n:"BrtCellSmartTagProperty", f:parsenoop },
- 0x024E: { n:"BrtBeginCellSmartTag", f:parsenoop },
- 0x024F: { n:"BrtEndCellSmartTag", f:parsenoop },
- 0x0250: { n:"BrtBeginCellSmartTags", f:parsenoop },
- 0x0251: { n:"BrtEndCellSmartTags", f:parsenoop },
- 0x0252: { n:"BrtBeginSmartTags", f:parsenoop },
- 0x0253: { n:"BrtEndSmartTags", f:parsenoop },
- 0x0254: { n:"BrtSmartTagType", f:parsenoop },
- 0x0255: { n:"BrtBeginSmartTagTypes", f:parsenoop },
- 0x0256: { n:"BrtEndSmartTagTypes", f:parsenoop },
- 0x0257: { n:"BrtBeginSXFilters", f:parsenoop },
- 0x0258: { n:"BrtEndSXFilters", f:parsenoop },
- 0x0259: { n:"BrtBeginSXFILTER", f:parsenoop },
- 0x025A: { n:"BrtEndSXFilter", f:parsenoop },
- 0x025B: { n:"BrtBeginFills", f:parsenoop },
- 0x025C: { n:"BrtEndFills", f:parsenoop },
- 0x025D: { n:"BrtBeginCellWatches", f:parsenoop },
- 0x025E: { n:"BrtEndCellWatches", f:parsenoop },
- 0x025F: { n:"BrtCellWatch", f:parsenoop },
- 0x0260: { n:"BrtBeginCRErrs", f:parsenoop },
- 0x0261: { n:"BrtEndCRErrs", f:parsenoop },
- 0x0262: { n:"BrtCrashRecErr", f:parsenoop },
- 0x0263: { n:"BrtBeginFonts", f:parsenoop },
- 0x0264: { n:"BrtEndFonts", f:parsenoop },
- 0x0265: { n:"BrtBeginBorders", f:parsenoop },
- 0x0266: { n:"BrtEndBorders", f:parsenoop },
- 0x0267: { n:"BrtBeginFmts", f:parsenoop },
- 0x0268: { n:"BrtEndFmts", f:parsenoop },
- 0x0269: { n:"BrtBeginCellXFs", f:parsenoop },
- 0x026A: { n:"BrtEndCellXFs", f:parsenoop },
- 0x026B: { n:"BrtBeginStyles", f:parsenoop },
- 0x026C: { n:"BrtEndStyles", f:parsenoop },
- 0x0271: { n:"BrtBigName", f:parsenoop },
- 0x0272: { n:"BrtBeginCellStyleXFs", f:parsenoop },
- 0x0273: { n:"BrtEndCellStyleXFs", f:parsenoop },
- 0x0274: { n:"BrtBeginComments", f:parsenoop },
- 0x0275: { n:"BrtEndComments", f:parsenoop },
- 0x0276: { n:"BrtBeginCommentAuthors", f:parsenoop },
- 0x0277: { n:"BrtEndCommentAuthors", f:parsenoop },
- 0x0278: { n:"BrtCommentAuthor", f:parse_BrtCommentAuthor },
- 0x0279: { n:"BrtBeginCommentList", f:parsenoop },
- 0x027A: { n:"BrtEndCommentList", f:parsenoop },
- 0x027B: { n:"BrtBeginComment", f:parse_BrtBeginComment},
- 0x027C: { n:"BrtEndComment", f:parsenoop },
- 0x027D: { n:"BrtCommentText", f:parse_BrtCommentText },
- 0x027E: { n:"BrtBeginOleObjects", f:parsenoop },
- 0x027F: { n:"BrtOleObject", f:parsenoop },
- 0x0280: { n:"BrtEndOleObjects", f:parsenoop },
- 0x0281: { n:"BrtBeginSxrules", f:parsenoop },
- 0x0282: { n:"BrtEndSxRules", f:parsenoop },
- 0x0283: { n:"BrtBeginActiveXControls", f:parsenoop },
- 0x0284: { n:"BrtActiveX", f:parsenoop },
- 0x0285: { n:"BrtEndActiveXControls", f:parsenoop },
- 0x0286: { n:"BrtBeginPCDSDTCEMembersSortBy", f:parsenoop },
- 0x0288: { n:"BrtBeginCellIgnoreECs", f:parsenoop },
- 0x0289: { n:"BrtCellIgnoreEC", f:parsenoop },
- 0x028A: { n:"BrtEndCellIgnoreECs", f:parsenoop },
- 0x028B: { n:"BrtCsProp", f:parsenoop },
- 0x028C: { n:"BrtCsPageSetup", f:parsenoop },
- 0x028D: { n:"BrtBeginUserCsViews", f:parsenoop },
- 0x028E: { n:"BrtEndUserCsViews", f:parsenoop },
- 0x028F: { n:"BrtBeginUserCsView", f:parsenoop },
- 0x0290: { n:"BrtEndUserCsView", f:parsenoop },
- 0x0291: { n:"BrtBeginPcdSFCIEntries", f:parsenoop },
- 0x0292: { n:"BrtEndPCDSFCIEntries", f:parsenoop },
- 0x0293: { n:"BrtPCDSFCIEntry", f:parsenoop },
- 0x0294: { n:"BrtBeginListParts", f:parsenoop },
- 0x0295: { n:"BrtListPart", f:parsenoop },
- 0x0296: { n:"BrtEndListParts", f:parsenoop },
- 0x0297: { n:"BrtSheetCalcProp", f:parsenoop },
- 0x0298: { n:"BrtBeginFnGroup", f:parsenoop },
- 0x0299: { n:"BrtFnGroup", f:parsenoop },
- 0x029A: { n:"BrtEndFnGroup", f:parsenoop },
- 0x029B: { n:"BrtSupAddin", f:parsenoop },
- 0x029C: { n:"BrtSXTDMPOrder", f:parsenoop },
- 0x029D: { n:"BrtCsProtection", f:parsenoop },
- 0x029F: { n:"BrtBeginWsSortMap", f:parsenoop },
- 0x02A0: { n:"BrtEndWsSortMap", f:parsenoop },
- 0x02A1: { n:"BrtBeginRRSort", f:parsenoop },
- 0x02A2: { n:"BrtEndRRSort", f:parsenoop },
- 0x02A3: { n:"BrtRRSortItem", f:parsenoop },
- 0x02A4: { n:"BrtFileSharingIso", f:parsenoop },
- 0x02A5: { n:"BrtBookProtectionIso", f:parsenoop },
- 0x02A6: { n:"BrtSheetProtectionIso", f:parsenoop },
- 0x02A7: { n:"BrtCsProtectionIso", f:parsenoop },
- 0x02A8: { n:"BrtRangeProtectionIso", f:parsenoop },
- 0x0400: { n:"BrtRwDescent", f:parsenoop },
- 0x0401: { n:"BrtKnownFonts", f:parsenoop },
- 0x0402: { n:"BrtBeginSXTupleSet", f:parsenoop },
- 0x0403: { n:"BrtEndSXTupleSet", f:parsenoop },
- 0x0404: { n:"BrtBeginSXTupleSetHeader", f:parsenoop },
- 0x0405: { n:"BrtEndSXTupleSetHeader", f:parsenoop },
- 0x0406: { n:"BrtSXTupleSetHeaderItem", f:parsenoop },
- 0x0407: { n:"BrtBeginSXTupleSetData", f:parsenoop },
- 0x0408: { n:"BrtEndSXTupleSetData", f:parsenoop },
- 0x0409: { n:"BrtBeginSXTupleSetRow", f:parsenoop },
- 0x040A: { n:"BrtEndSXTupleSetRow", f:parsenoop },
- 0x040B: { n:"BrtSXTupleSetRowItem", f:parsenoop },
- 0x040C: { n:"BrtNameExt", f:parsenoop },
- 0x040D: { n:"BrtPCDH14", f:parsenoop },
- 0x040E: { n:"BrtBeginPCDCalcMem14", f:parsenoop },
- 0x040F: { n:"BrtEndPCDCalcMem14", f:parsenoop },
- 0x0410: { n:"BrtSXTH14", f:parsenoop },
- 0x0411: { n:"BrtBeginSparklineGroup", f:parsenoop },
- 0x0412: { n:"BrtEndSparklineGroup", f:parsenoop },
- 0x0413: { n:"BrtSparkline", f:parsenoop },
- 0x0414: { n:"BrtSXDI14", f:parsenoop },
- 0x0415: { n:"BrtWsFmtInfoEx14", f:parsenoop },
- 0x0416: { n:"BrtBeginConditionalFormatting14", f:parsenoop },
- 0x0417: { n:"BrtEndConditionalFormatting14", f:parsenoop },
- 0x0418: { n:"BrtBeginCFRule14", f:parsenoop },
- 0x0419: { n:"BrtEndCFRule14", f:parsenoop },
- 0x041A: { n:"BrtCFVO14", f:parsenoop },
- 0x041B: { n:"BrtBeginDatabar14", f:parsenoop },
- 0x041C: { n:"BrtBeginIconSet14", f:parsenoop },
- 0x041D: { n:"BrtDVal14", f:parsenoop },
- 0x041E: { n:"BrtBeginDVals14", f:parsenoop },
- 0x041F: { n:"BrtColor14", f:parsenoop },
- 0x0420: { n:"BrtBeginSparklines", f:parsenoop },
- 0x0421: { n:"BrtEndSparklines", f:parsenoop },
- 0x0422: { n:"BrtBeginSparklineGroups", f:parsenoop },
- 0x0423: { n:"BrtEndSparklineGroups", f:parsenoop },
- 0x0425: { n:"BrtSXVD14", f:parsenoop },
- 0x0426: { n:"BrtBeginSxview14", f:parsenoop },
- 0x0427: { n:"BrtEndSxview14", f:parsenoop },
- 0x042A: { n:"BrtBeginPCD14", f:parsenoop },
- 0x042B: { n:"BrtEndPCD14", f:parsenoop },
- 0x042C: { n:"BrtBeginExtConn14", f:parsenoop },
- 0x042D: { n:"BrtEndExtConn14", f:parsenoop },
- 0x042E: { n:"BrtBeginSlicerCacheIDs", f:parsenoop },
- 0x042F: { n:"BrtEndSlicerCacheIDs", f:parsenoop },
- 0x0430: { n:"BrtBeginSlicerCacheID", f:parsenoop },
- 0x0431: { n:"BrtEndSlicerCacheID", f:parsenoop },
- 0x0433: { n:"BrtBeginSlicerCache", f:parsenoop },
- 0x0434: { n:"BrtEndSlicerCache", f:parsenoop },
- 0x0435: { n:"BrtBeginSlicerCacheDef", f:parsenoop },
- 0x0436: { n:"BrtEndSlicerCacheDef", f:parsenoop },
- 0x0437: { n:"BrtBeginSlicersEx", f:parsenoop },
- 0x0438: { n:"BrtEndSlicersEx", f:parsenoop },
- 0x0439: { n:"BrtBeginSlicerEx", f:parsenoop },
- 0x043A: { n:"BrtEndSlicerEx", f:parsenoop },
- 0x043B: { n:"BrtBeginSlicer", f:parsenoop },
- 0x043C: { n:"BrtEndSlicer", f:parsenoop },
- 0x043D: { n:"BrtSlicerCachePivotTables", f:parsenoop },
- 0x043E: { n:"BrtBeginSlicerCacheOlapImpl", f:parsenoop },
- 0x043F: { n:"BrtEndSlicerCacheOlapImpl", f:parsenoop },
- 0x0440: { n:"BrtBeginSlicerCacheLevelsData", f:parsenoop },
- 0x0441: { n:"BrtEndSlicerCacheLevelsData", f:parsenoop },
- 0x0442: { n:"BrtBeginSlicerCacheLevelData", f:parsenoop },
- 0x0443: { n:"BrtEndSlicerCacheLevelData", f:parsenoop },
- 0x0444: { n:"BrtBeginSlicerCacheSiRanges", f:parsenoop },
- 0x0445: { n:"BrtEndSlicerCacheSiRanges", f:parsenoop },
- 0x0446: { n:"BrtBeginSlicerCacheSiRange", f:parsenoop },
- 0x0447: { n:"BrtEndSlicerCacheSiRange", f:parsenoop },
- 0x0448: { n:"BrtSlicerCacheOlapItem", f:parsenoop },
- 0x0449: { n:"BrtBeginSlicerCacheSelections", f:parsenoop },
- 0x044A: { n:"BrtSlicerCacheSelection", f:parsenoop },
- 0x044B: { n:"BrtEndSlicerCacheSelections", f:parsenoop },
- 0x044C: { n:"BrtBeginSlicerCacheNative", f:parsenoop },
- 0x044D: { n:"BrtEndSlicerCacheNative", f:parsenoop },
- 0x044E: { n:"BrtSlicerCacheNativeItem", f:parsenoop },
- 0x044F: { n:"BrtRangeProtection14", f:parsenoop },
- 0x0450: { n:"BrtRangeProtectionIso14", f:parsenoop },
- 0x0451: { n:"BrtCellIgnoreEC14", f:parsenoop },
- 0x0457: { n:"BrtList14", f:parsenoop },
- 0x0458: { n:"BrtCFIcon", f:parsenoop },
- 0x0459: { n:"BrtBeginSlicerCachesPivotCacheIDs", f:parsenoop },
- 0x045A: { n:"BrtEndSlicerCachesPivotCacheIDs", f:parsenoop },
- 0x045B: { n:"BrtBeginSlicers", f:parsenoop },
- 0x045C: { n:"BrtEndSlicers", f:parsenoop },
- 0x045D: { n:"BrtWbProp14", f:parsenoop },
- 0x045E: { n:"BrtBeginSXEdit", f:parsenoop },
- 0x045F: { n:"BrtEndSXEdit", f:parsenoop },
- 0x0460: { n:"BrtBeginSXEdits", f:parsenoop },
- 0x0461: { n:"BrtEndSXEdits", f:parsenoop },
- 0x0462: { n:"BrtBeginSXChange", f:parsenoop },
- 0x0463: { n:"BrtEndSXChange", f:parsenoop },
- 0x0464: { n:"BrtBeginSXChanges", f:parsenoop },
- 0x0465: { n:"BrtEndSXChanges", f:parsenoop },
- 0x0466: { n:"BrtSXTupleItems", f:parsenoop },
- 0x0468: { n:"BrtBeginSlicerStyle", f:parsenoop },
- 0x0469: { n:"BrtEndSlicerStyle", f:parsenoop },
- 0x046A: { n:"BrtSlicerStyleElement", f:parsenoop },
- 0x046B: { n:"BrtBeginStyleSheetExt14", f:parsenoop },
- 0x046C: { n:"BrtEndStyleSheetExt14", f:parsenoop },
- 0x046D: { n:"BrtBeginSlicerCachesPivotCacheID", f:parsenoop },
- 0x046E: { n:"BrtEndSlicerCachesPivotCacheID", f:parsenoop },
- 0x046F: { n:"BrtBeginConditionalFormattings", f:parsenoop },
- 0x0470: { n:"BrtEndConditionalFormattings", f:parsenoop },
- 0x0471: { n:"BrtBeginPCDCalcMemExt", f:parsenoop },
- 0x0472: { n:"BrtEndPCDCalcMemExt", f:parsenoop },
- 0x0473: { n:"BrtBeginPCDCalcMemsExt", f:parsenoop },
- 0x0474: { n:"BrtEndPCDCalcMemsExt", f:parsenoop },
- 0x0475: { n:"BrtPCDField14", f:parsenoop },
- 0x0476: { n:"BrtBeginSlicerStyles", f:parsenoop },
- 0x0477: { n:"BrtEndSlicerStyles", f:parsenoop },
- 0x0478: { n:"BrtBeginSlicerStyleElements", f:parsenoop },
- 0x0479: { n:"BrtEndSlicerStyleElements", f:parsenoop },
- 0x047A: { n:"BrtCFRuleExt", f:parsenoop },
- 0x047B: { n:"BrtBeginSXCondFmt14", f:parsenoop },
- 0x047C: { n:"BrtEndSXCondFmt14", f:parsenoop },
- 0x047D: { n:"BrtBeginSXCondFmts14", f:parsenoop },
- 0x047E: { n:"BrtEndSXCondFmts14", f:parsenoop },
- 0x0480: { n:"BrtBeginSortCond14", f:parsenoop },
- 0x0481: { n:"BrtEndSortCond14", f:parsenoop },
- 0x0482: { n:"BrtEndDVals14", f:parsenoop },
- 0x0483: { n:"BrtEndIconSet14", f:parsenoop },
- 0x0484: { n:"BrtEndDatabar14", f:parsenoop },
- 0x0485: { n:"BrtBeginColorScale14", f:parsenoop },
- 0x0486: { n:"BrtEndColorScale14", f:parsenoop },
- 0x0487: { n:"BrtBeginSxrules14", f:parsenoop },
- 0x0488: { n:"BrtEndSxrules14", f:parsenoop },
- 0x0489: { n:"BrtBeginPRule14", f:parsenoop },
- 0x048A: { n:"BrtEndPRule14", f:parsenoop },
- 0x048B: { n:"BrtBeginPRFilters14", f:parsenoop },
- 0x048C: { n:"BrtEndPRFilters14", f:parsenoop },
- 0x048D: { n:"BrtBeginPRFilter14", f:parsenoop },
- 0x048E: { n:"BrtEndPRFilter14", f:parsenoop },
- 0x048F: { n:"BrtBeginPRFItem14", f:parsenoop },
- 0x0490: { n:"BrtEndPRFItem14", f:parsenoop },
- 0x0491: { n:"BrtBeginCellIgnoreECs14", f:parsenoop },
- 0x0492: { n:"BrtEndCellIgnoreECs14", f:parsenoop },
- 0x0493: { n:"BrtDxf14", f:parsenoop },
- 0x0494: { n:"BrtBeginDxF14s", f:parsenoop },
- 0x0495: { n:"BrtEndDxf14s", f:parsenoop },
- 0x0499: { n:"BrtFilter14", f:parsenoop },
- 0x049A: { n:"BrtBeginCustomFilters14", f:parsenoop },
- 0x049C: { n:"BrtCustomFilter14", f:parsenoop },
- 0x049D: { n:"BrtIconFilter14", f:parsenoop },
- 0x049E: { n:"BrtPivotCacheConnectionName", f:parsenoop },
- 0x0800: { n:"BrtBeginDecoupledPivotCacheIDs", f:parsenoop },
- 0x0801: { n:"BrtEndDecoupledPivotCacheIDs", f:parsenoop },
- 0x0802: { n:"BrtDecoupledPivotCacheID", f:parsenoop },
- 0x0803: { n:"BrtBeginPivotTableRefs", f:parsenoop },
- 0x0804: { n:"BrtEndPivotTableRefs", f:parsenoop },
- 0x0805: { n:"BrtPivotTableRef", f:parsenoop },
- 0x0806: { n:"BrtSlicerCacheBookPivotTables", f:parsenoop },
- 0x0807: { n:"BrtBeginSxvcells", f:parsenoop },
- 0x0808: { n:"BrtEndSxvcells", f:parsenoop },
- 0x0809: { n:"BrtBeginSxRow", f:parsenoop },
- 0x080A: { n:"BrtEndSxRow", f:parsenoop },
- 0x080C: { n:"BrtPcdCalcMem15", f:parsenoop },
- 0x0813: { n:"BrtQsi15", f:parsenoop },
- 0x0814: { n:"BrtBeginWebExtensions", f:parsenoop },
- 0x0815: { n:"BrtEndWebExtensions", f:parsenoop },
- 0x0816: { n:"BrtWebExtension", f:parsenoop },
- 0x0817: { n:"BrtAbsPath15", f:parsenoop },
- 0x0818: { n:"BrtBeginPivotTableUISettings", f:parsenoop },
- 0x0819: { n:"BrtEndPivotTableUISettings", f:parsenoop },
- 0x081B: { n:"BrtTableSlicerCacheIDs", f:parsenoop },
- 0x081C: { n:"BrtTableSlicerCacheID", f:parsenoop },
- 0x081D: { n:"BrtBeginTableSlicerCache", f:parsenoop },
- 0x081E: { n:"BrtEndTableSlicerCache", f:parsenoop },
- 0x081F: { n:"BrtSxFilter15", f:parsenoop },
- 0x0820: { n:"BrtBeginTimelineCachePivotCacheIDs", f:parsenoop },
- 0x0821: { n:"BrtEndTimelineCachePivotCacheIDs", f:parsenoop },
- 0x0822: { n:"BrtTimelineCachePivotCacheID", f:parsenoop },
- 0x0823: { n:"BrtBeginTimelineCacheIDs", f:parsenoop },
- 0x0824: { n:"BrtEndTimelineCacheIDs", f:parsenoop },
- 0x0825: { n:"BrtBeginTimelineCacheID", f:parsenoop },
- 0x0826: { n:"BrtEndTimelineCacheID", f:parsenoop },
- 0x0827: { n:"BrtBeginTimelinesEx", f:parsenoop },
- 0x0828: { n:"BrtEndTimelinesEx", f:parsenoop },
- 0x0829: { n:"BrtBeginTimelineEx", f:parsenoop },
- 0x082A: { n:"BrtEndTimelineEx", f:parsenoop },
- 0x082B: { n:"BrtWorkBookPr15", f:parsenoop },
- 0x082C: { n:"BrtPCDH15", f:parsenoop },
- 0x082D: { n:"BrtBeginTimelineStyle", f:parsenoop },
- 0x082E: { n:"BrtEndTimelineStyle", f:parsenoop },
- 0x082F: { n:"BrtTimelineStyleElement", f:parsenoop },
- 0x0830: { n:"BrtBeginTimelineStylesheetExt15", f:parsenoop },
- 0x0831: { n:"BrtEndTimelineStylesheetExt15", f:parsenoop },
- 0x0832: { n:"BrtBeginTimelineStyles", f:parsenoop },
- 0x0833: { n:"BrtEndTimelineStyles", f:parsenoop },
- 0x0834: { n:"BrtBeginTimelineStyleElements", f:parsenoop },
- 0x0835: { n:"BrtEndTimelineStyleElements", f:parsenoop },
- 0x0836: { n:"BrtDxf15", f:parsenoop },
- 0x0837: { n:"BrtBeginDxfs15", f:parsenoop },
- 0x0838: { n:"brtEndDxfs15", f:parsenoop },
- 0x0839: { n:"BrtSlicerCacheHideItemsWithNoData", f:parsenoop },
- 0x083A: { n:"BrtBeginItemUniqueNames", f:parsenoop },
- 0x083B: { n:"BrtEndItemUniqueNames", f:parsenoop },
- 0x083C: { n:"BrtItemUniqueName", f:parsenoop },
- 0x083D: { n:"BrtBeginExtConn15", f:parsenoop },
- 0x083E: { n:"BrtEndExtConn15", f:parsenoop },
- 0x083F: { n:"BrtBeginOledbPr15", f:parsenoop },
- 0x0840: { n:"BrtEndOledbPr15", f:parsenoop },
- 0x0841: { n:"BrtBeginDataFeedPr15", f:parsenoop },
- 0x0842: { n:"BrtEndDataFeedPr15", f:parsenoop },
- 0x0843: { n:"BrtTextPr15", f:parsenoop },
- 0x0844: { n:"BrtRangePr15", f:parsenoop },
- 0x0845: { n:"BrtDbCommand15", f:parsenoop },
- 0x0846: { n:"BrtBeginDbTables15", f:parsenoop },
- 0x0847: { n:"BrtEndDbTables15", f:parsenoop },
- 0x0848: { n:"BrtDbTable15", f:parsenoop },
- 0x0849: { n:"BrtBeginDataModel", f:parsenoop },
- 0x084A: { n:"BrtEndDataModel", f:parsenoop },
- 0x084B: { n:"BrtBeginModelTables", f:parsenoop },
- 0x084C: { n:"BrtEndModelTables", f:parsenoop },
- 0x084D: { n:"BrtModelTable", f:parsenoop },
- 0x084E: { n:"BrtBeginModelRelationships", f:parsenoop },
- 0x084F: { n:"BrtEndModelRelationships", f:parsenoop },
- 0x0850: { n:"BrtModelRelationship", f:parsenoop },
- 0x0851: { n:"BrtBeginECTxtWiz15", f:parsenoop },
- 0x0852: { n:"BrtEndECTxtWiz15", f:parsenoop },
- 0x0853: { n:"BrtBeginECTWFldInfoLst15", f:parsenoop },
- 0x0854: { n:"BrtEndECTWFldInfoLst15", f:parsenoop },
- 0x0855: { n:"BrtBeginECTWFldInfo15", f:parsenoop },
- 0x0856: { n:"BrtFieldListActiveItem", f:parsenoop },
- 0x0857: { n:"BrtPivotCacheIdVersion", f:parsenoop },
- 0x0858: { n:"BrtSXDI15", f:parsenoop },
- 0xFFFF: { n:"", f:parsenoop }
-};
-
-var evert_RE = evert_key(XLSBRecordEnum, 'n');
-
-/* [MS-XLS] 2.3 Record Enumeration */
-var XLSRecordEnum = {
- 0x0003: { n:"BIFF2NUM", f:parse_BIFF2NUM },
- 0x0004: { n:"BIFF2STR", f:parse_BIFF2STR },
- 0x0006: { n:"Formula", f:parse_Formula },
- 0x0009: { n:'BOF', f:parse_BOF },
- 0x000a: { n:'EOF', f:parse_EOF },
- 0x000c: { n:"CalcCount", f:parse_CalcCount },
- 0x000d: { n:"CalcMode", f:parse_CalcMode },
- 0x000e: { n:"CalcPrecision", f:parse_CalcPrecision },
- 0x000f: { n:"CalcRefMode", f:parse_CalcRefMode },
- 0x0010: { n:"CalcDelta", f:parse_CalcDelta },
- 0x0011: { n:"CalcIter", f:parse_CalcIter },
- 0x0012: { n:"Protect", f:parse_Protect },
- 0x0013: { n:"Password", f:parse_Password },
- 0x0014: { n:"Header", f:parse_Header },
- 0x0015: { n:"Footer", f:parse_Footer },
- 0x0017: { n:"ExternSheet", f:parse_ExternSheet },
- 0x0018: { n:"Lbl", f:parse_Lbl },
- 0x0019: { n:"WinProtect", f:parse_WinProtect },
- 0x001a: { n:"VerticalPageBreaks", f:parse_VerticalPageBreaks },
- 0x001b: { n:"HorizontalPageBreaks", f:parse_HorizontalPageBreaks },
- 0x001c: { n:"Note", f:parse_Note },
- 0x001d: { n:"Selection", f:parse_Selection },
- 0x0022: { n:"Date1904", f:parse_Date1904 },
- 0x0023: { n:"ExternName", f:parse_ExternName },
- 0x0026: { n:"LeftMargin", f:parse_LeftMargin },
- 0x0027: { n:"RightMargin", f:parse_RightMargin },
- 0x0028: { n:"TopMargin", f:parse_TopMargin },
- 0x0029: { n:"BottomMargin", f:parse_BottomMargin },
- 0x002a: { n:"PrintRowCol", f:parse_PrintRowCol },
- 0x002b: { n:"PrintGrid", f:parse_PrintGrid },
- 0x002f: { n:"FilePass", f:parse_FilePass },
- 0x0031: { n:"Font", f:parse_Font },
- 0x0033: { n:"PrintSize", f:parse_PrintSize },
- 0x003c: { n:"Continue", f:parse_Continue },
- 0x003d: { n:"Window1", f:parse_Window1 },
- 0x0040: { n:"Backup", f:parse_Backup },
- 0x0041: { n:"Pane", f:parse_Pane },
- 0x0042: { n:'CodePage', f:parse_CodePage },
- 0x004d: { n:"Pls", f:parse_Pls },
- 0x0050: { n:"DCon", f:parse_DCon },
- 0x0051: { n:"DConRef", f:parse_DConRef },
- 0x0052: { n:"DConName", f:parse_DConName },
- 0x0055: { n:"DefColWidth", f:parse_DefColWidth },
- 0x0059: { n:"XCT", f:parse_XCT },
- 0x005a: { n:"CRN", f:parse_CRN },
- 0x005b: { n:"FileSharing", f:parse_FileSharing },
- 0x005c: { n:'WriteAccess', f:parse_WriteAccess },
- 0x005d: { n:"Obj", f:parse_Obj },
- 0x005e: { n:"Uncalced", f:parse_Uncalced },
- 0x005f: { n:"CalcSaveRecalc", f:parse_CalcSaveRecalc },
- 0x0060: { n:"Template", f:parse_Template },
- 0x0061: { n:"Intl", f:parse_Intl },
- 0x0063: { n:"ObjProtect", f:parse_ObjProtect },
- 0x007d: { n:"ColInfo", f:parse_ColInfo },
- 0x0080: { n:"Guts", f:parse_Guts },
- 0x0081: { n:"WsBool", f:parse_WsBool },
- 0x0082: { n:"GridSet", f:parse_GridSet },
- 0x0083: { n:"HCenter", f:parse_HCenter },
- 0x0084: { n:"VCenter", f:parse_VCenter },
- 0x0085: { n:'BoundSheet8', f:parse_BoundSheet8 },
- 0x0086: { n:"WriteProtect", f:parse_WriteProtect },
- 0x008c: { n:"Country", f:parse_Country },
- 0x008d: { n:"HideObj", f:parse_HideObj },
- 0x0090: { n:"Sort", f:parse_Sort },
- 0x0092: { n:"Palette", f:parse_Palette },
- 0x0097: { n:"Sync", f:parse_Sync },
- 0x0098: { n:"LPr", f:parse_LPr },
- 0x0099: { n:"DxGCol", f:parse_DxGCol },
- 0x009a: { n:"FnGroupName", f:parse_FnGroupName },
- 0x009b: { n:"FilterMode", f:parse_FilterMode },
- 0x009c: { n:"BuiltInFnGroupCount", f:parse_BuiltInFnGroupCount },
- 0x009d: { n:"AutoFilterInfo", f:parse_AutoFilterInfo },
- 0x009e: { n:"AutoFilter", f:parse_AutoFilter },
- 0x00a0: { n:"Scl", f:parse_Scl },
- 0x00a1: { n:"Setup", f:parse_Setup },
- 0x00ae: { n:"ScenMan", f:parse_ScenMan },
- 0x00af: { n:"SCENARIO", f:parse_SCENARIO },
- 0x00b0: { n:"SxView", f:parse_SxView },
- 0x00b1: { n:"Sxvd", f:parse_Sxvd },
- 0x00b2: { n:"SXVI", f:parse_SXVI },
- 0x00b4: { n:"SxIvd", f:parse_SxIvd },
- 0x00b5: { n:"SXLI", f:parse_SXLI },
- 0x00b6: { n:"SXPI", f:parse_SXPI },
- 0x00b8: { n:"DocRoute", f:parse_DocRoute },
- 0x00b9: { n:"RecipName", f:parse_RecipName },
- 0x00bd: { n:"MulRk", f:parse_MulRk },
- 0x00be: { n:"MulBlank", f:parse_MulBlank },
- 0x00c1: { n:'Mms', f:parse_Mms },
- 0x00c5: { n:"SXDI", f:parse_SXDI },
- 0x00c6: { n:"SXDB", f:parse_SXDB },
- 0x00c7: { n:"SXFDB", f:parse_SXFDB },
- 0x00c8: { n:"SXDBB", f:parse_SXDBB },
- 0x00c9: { n:"SXNum", f:parse_SXNum },
- 0x00ca: { n:"SxBool", f:parse_SxBool },
- 0x00cb: { n:"SxErr", f:parse_SxErr },
- 0x00cc: { n:"SXInt", f:parse_SXInt },
- 0x00cd: { n:"SXString", f:parse_SXString },
- 0x00ce: { n:"SXDtr", f:parse_SXDtr },
- 0x00cf: { n:"SxNil", f:parse_SxNil },
- 0x00d0: { n:"SXTbl", f:parse_SXTbl },
- 0x00d1: { n:"SXTBRGIITM", f:parse_SXTBRGIITM },
- 0x00d2: { n:"SxTbpg", f:parse_SxTbpg },
- 0x00d3: { n:"ObProj", f:parse_ObProj },
- 0x00d5: { n:"SXStreamID", f:parse_SXStreamID },
- 0x00d7: { n:"DBCell", f:parse_DBCell },
- 0x00d8: { n:"SXRng", f:parse_SXRng },
- 0x00d9: { n:"SxIsxoper", f:parse_SxIsxoper },
- 0x00da: { n:"BookBool", f:parse_BookBool },
- 0x00dc: { n:"DbOrParamQry", f:parse_DbOrParamQry },
- 0x00dd: { n:"ScenarioProtect", f:parse_ScenarioProtect },
- 0x00de: { n:"OleObjectSize", f:parse_OleObjectSize },
- 0x00e0: { n:"XF", f:parse_XF },
- 0x00e1: { n:'InterfaceHdr', f:parse_InterfaceHdr },
- 0x00e2: { n:'InterfaceEnd', f:parse_InterfaceEnd },
- 0x00e3: { n:"SXVS", f:parse_SXVS },
- 0x00e5: { n:"MergeCells", f:parse_MergeCells },
- 0x00e9: { n:"BkHim", f:parse_BkHim },
- 0x00eb: { n:"MsoDrawingGroup", f:parse_MsoDrawingGroup },
- 0x00ec: { n:"MsoDrawing", f:parse_MsoDrawing },
- 0x00ed: { n:"MsoDrawingSelection", f:parse_MsoDrawingSelection },
- 0x00ef: { n:"PhoneticInfo", f:parse_PhoneticInfo },
- 0x00f0: { n:"SxRule", f:parse_SxRule },
- 0x00f1: { n:"SXEx", f:parse_SXEx },
- 0x00f2: { n:"SxFilt", f:parse_SxFilt },
- 0x00f4: { n:"SxDXF", f:parse_SxDXF },
- 0x00f5: { n:"SxItm", f:parse_SxItm },
- 0x00f6: { n:"SxName", f:parse_SxName },
- 0x00f7: { n:"SxSelect", f:parse_SxSelect },
- 0x00f8: { n:"SXPair", f:parse_SXPair },
- 0x00f9: { n:"SxFmla", f:parse_SxFmla },
- 0x00fb: { n:"SxFormat", f:parse_SxFormat },
- 0x00fc: { n:"SST", f:parse_SST },
- 0x00fd: { n:"LabelSst", f:parse_LabelSst },
- 0x00ff: { n:"ExtSST", f:parse_ExtSST },
- 0x0100: { n:"SXVDEx", f:parse_SXVDEx },
- 0x0103: { n:"SXFormula", f:parse_SXFormula },
- 0x0122: { n:"SXDBEx", f:parse_SXDBEx },
- 0x0137: { n:"RRDInsDel", f:parse_RRDInsDel },
- 0x0138: { n:"RRDHead", f:parse_RRDHead },
- 0x013b: { n:"RRDChgCell", f:parse_RRDChgCell },
- 0x013d: { n:"RRTabId", f:parse_RRTabId },
- 0x013e: { n:"RRDRenSheet", f:parse_RRDRenSheet },
- 0x013f: { n:"RRSort", f:parse_RRSort },
- 0x0140: { n:"RRDMove", f:parse_RRDMove },
- 0x014a: { n:"RRFormat", f:parse_RRFormat },
- 0x014b: { n:"RRAutoFmt", f:parse_RRAutoFmt },
- 0x014d: { n:"RRInsertSh", f:parse_RRInsertSh },
- 0x014e: { n:"RRDMoveBegin", f:parse_RRDMoveBegin },
- 0x014f: { n:"RRDMoveEnd", f:parse_RRDMoveEnd },
- 0x0150: { n:"RRDInsDelBegin", f:parse_RRDInsDelBegin },
- 0x0151: { n:"RRDInsDelEnd", f:parse_RRDInsDelEnd },
- 0x0152: { n:"RRDConflict", f:parse_RRDConflict },
- 0x0153: { n:"RRDDefName", f:parse_RRDDefName },
- 0x0154: { n:"RRDRstEtxp", f:parse_RRDRstEtxp },
- 0x015f: { n:"LRng", f:parse_LRng },
- 0x0160: { n:"UsesELFs", f:parse_UsesELFs },
- 0x0161: { n:"DSF", f:parse_DSF },
- 0x0191: { n:"CUsr", f:parse_CUsr },
- 0x0192: { n:"CbUsr", f:parse_CbUsr },
- 0x0193: { n:"UsrInfo", f:parse_UsrInfo },
- 0x0194: { n:"UsrExcl", f:parse_UsrExcl },
- 0x0195: { n:"FileLock", f:parse_FileLock },
- 0x0196: { n:"RRDInfo", f:parse_RRDInfo },
- 0x0197: { n:"BCUsrs", f:parse_BCUsrs },
- 0x0198: { n:"UsrChk", f:parse_UsrChk },
- 0x01a9: { n:"UserBView", f:parse_UserBView },
- 0x01aa: { n:"UserSViewBegin", f:parse_UserSViewBegin },
- 0x01ab: { n:"UserSViewEnd", f:parse_UserSViewEnd },
- 0x01ac: { n:"RRDUserView", f:parse_RRDUserView },
- 0x01ad: { n:"Qsi", f:parse_Qsi },
- 0x01ae: { n:"SupBook", f:parse_SupBook },
- 0x01af: { n:"Prot4Rev", f:parse_Prot4Rev },
- 0x01b0: { n:"CondFmt", f:parse_CondFmt },
- 0x01b1: { n:"CF", f:parse_CF },
- 0x01b2: { n:"DVal", f:parse_DVal },
- 0x01b5: { n:"DConBin", f:parse_DConBin },
- 0x01b6: { n:"TxO", f:parse_TxO },
- 0x01b7: { n:"RefreshAll", f:parse_RefreshAll },
- 0x01b8: { n:"HLink", f:parse_HLink },
- 0x01b9: { n:"Lel", f:parse_Lel },
- 0x01ba: { n:"CodeName", f:parse_XLSCodeName },
- 0x01bb: { n:"SXFDBType", f:parse_SXFDBType },
- 0x01bc: { n:"Prot4RevPass", f:parse_Prot4RevPass },
- 0x01bd: { n:"ObNoMacros", f:parse_ObNoMacros },
- 0x01be: { n:"Dv", f:parse_Dv },
- 0x01c0: { n:"Excel9File", f:parse_Excel9File },
- 0x01c1: { n:"RecalcId", f:parse_RecalcId, r:2},
- 0x01c2: { n:"EntExU2", f:parse_EntExU2 },
- 0x0200: { n:"Dimensions", f:parse_Dimensions },
- 0x0201: { n:"Blank", f:parse_Blank },
- 0x0203: { n:"Number", f:parse_Number },
- 0x0204: { n:"Label", f:parse_Label },
- 0x0205: { n:"BoolErr", f:parse_BoolErr },
- 0x0207: { n:"String", f:parse_String },
- 0x0208: { n:'Row', f:parse_Row },
- 0x020b: { n:"Index", f:parse_Index },
- 0x0221: { n:"Array", f:parse_Array },
- 0x0225: { n:"DefaultRowHeight", f:parse_DefaultRowHeight },
- 0x0236: { n:"Table", f:parse_Table },
- 0x023e: { n:"Window2", f:parse_Window2 },
- 0x027e: { n:"RK", f:parse_RK },
- 0x0293: { n:"Style", f:parse_Style },
- 0x0418: { n:"BigName", f:parse_BigName },
- 0x041e: { n:"Format", f:parse_Format },
- 0x043c: { n:"ContinueBigName", f:parse_ContinueBigName },
- 0x04bc: { n:"ShrFmla", f:parse_ShrFmla },
- 0x0800: { n:"HLinkTooltip", f:parse_HLinkTooltip },
- 0x0801: { n:"WebPub", f:parse_WebPub },
- 0x0802: { n:"QsiSXTag", f:parse_QsiSXTag },
- 0x0803: { n:"DBQueryExt", f:parse_DBQueryExt },
- 0x0804: { n:"ExtString", f:parse_ExtString },
- 0x0805: { n:"TxtQry", f:parse_TxtQry },
- 0x0806: { n:"Qsir", f:parse_Qsir },
- 0x0807: { n:"Qsif", f:parse_Qsif },
- 0x0808: { n:"RRDTQSIF", f:parse_RRDTQSIF },
- 0x0809: { n:'BOF', f:parse_BOF },
- 0x080a: { n:"OleDbConn", f:parse_OleDbConn },
- 0x080b: { n:"WOpt", f:parse_WOpt },
- 0x080c: { n:"SXViewEx", f:parse_SXViewEx },
- 0x080d: { n:"SXTH", f:parse_SXTH },
- 0x080e: { n:"SXPIEx", f:parse_SXPIEx },
- 0x080f: { n:"SXVDTEx", f:parse_SXVDTEx },
- 0x0810: { n:"SXViewEx9", f:parse_SXViewEx9 },
- 0x0812: { n:"ContinueFrt", f:parse_ContinueFrt },
- 0x0813: { n:"RealTimeData", f:parse_RealTimeData },
- 0x0850: { n:"ChartFrtInfo", f:parse_ChartFrtInfo },
- 0x0851: { n:"FrtWrapper", f:parse_FrtWrapper },
- 0x0852: { n:"StartBlock", f:parse_StartBlock },
- 0x0853: { n:"EndBlock", f:parse_EndBlock },
- 0x0854: { n:"StartObject", f:parse_StartObject },
- 0x0855: { n:"EndObject", f:parse_EndObject },
- 0x0856: { n:"CatLab", f:parse_CatLab },
- 0x0857: { n:"YMult", f:parse_YMult },
- 0x0858: { n:"SXViewLink", f:parse_SXViewLink },
- 0x0859: { n:"PivotChartBits", f:parse_PivotChartBits },
- 0x085a: { n:"FrtFontList", f:parse_FrtFontList },
- 0x0862: { n:"SheetExt", f:parse_SheetExt },
- 0x0863: { n:"BookExt", f:parse_BookExt, r:12},
- 0x0864: { n:"SXAddl", f:parse_SXAddl },
- 0x0865: { n:"CrErr", f:parse_CrErr },
- 0x0866: { n:"HFPicture", f:parse_HFPicture },
- 0x0867: { n:'FeatHdr', f:parse_FeatHdr },
- 0x0868: { n:"Feat", f:parse_Feat },
- 0x086a: { n:"DataLabExt", f:parse_DataLabExt },
- 0x086b: { n:"DataLabExtContents", f:parse_DataLabExtContents },
- 0x086c: { n:"CellWatch", f:parse_CellWatch },
- 0x0871: { n:"FeatHdr11", f:parse_FeatHdr11 },
- 0x0872: { n:"Feature11", f:parse_Feature11 },
- 0x0874: { n:"DropDownObjIds", f:parse_DropDownObjIds },
- 0x0875: { n:"ContinueFrt11", f:parse_ContinueFrt11 },
- 0x0876: { n:"DConn", f:parse_DConn },
- 0x0877: { n:"List12", f:parse_List12 },
- 0x0878: { n:"Feature12", f:parse_Feature12 },
- 0x0879: { n:"CondFmt12", f:parse_CondFmt12 },
- 0x087a: { n:"CF12", f:parse_CF12 },
- 0x087b: { n:"CFEx", f:parse_CFEx },
- 0x087c: { n:"XFCRC", f:parse_XFCRC, r:12 },
- 0x087d: { n:"XFExt", f:parse_XFExt, r:12 },
- 0x087e: { n:"AutoFilter12", f:parse_AutoFilter12 },
- 0x087f: { n:"ContinueFrt12", f:parse_ContinueFrt12 },
- 0x0884: { n:"MDTInfo", f:parse_MDTInfo },
- 0x0885: { n:"MDXStr", f:parse_MDXStr },
- 0x0886: { n:"MDXTuple", f:parse_MDXTuple },
- 0x0887: { n:"MDXSet", f:parse_MDXSet },
- 0x0888: { n:"MDXProp", f:parse_MDXProp },
- 0x0889: { n:"MDXKPI", f:parse_MDXKPI },
- 0x088a: { n:"MDB", f:parse_MDB },
- 0x088b: { n:"PLV", f:parse_PLV },
- 0x088c: { n:"Compat12", f:parse_Compat12, r:12 },
- 0x088d: { n:"DXF", f:parse_DXF },
- 0x088e: { n:"TableStyles", f:parse_TableStyles, r:12 },
- 0x088f: { n:"TableStyle", f:parse_TableStyle },
- 0x0890: { n:"TableStyleElement", f:parse_TableStyleElement },
- 0x0892: { n:"StyleExt", f:parse_StyleExt },
- 0x0893: { n:"NamePublish", f:parse_NamePublish },
- 0x0894: { n:"NameCmt", f:parse_NameCmt },
- 0x0895: { n:"SortData", f:parse_SortData },
- 0x0896: { n:"Theme", f:parse_Theme, r:12 },
- 0x0897: { n:"GUIDTypeLib", f:parse_GUIDTypeLib },
- 0x0898: { n:"FnGrp12", f:parse_FnGrp12 },
- 0x0899: { n:"NameFnGrp12", f:parse_NameFnGrp12 },
- 0x089a: { n:"MTRSettings", f:parse_MTRSettings, r:12 },
- 0x089b: { n:"CompressPictures", f:parse_CompressPictures },
- 0x089c: { n:"HeaderFooter", f:parse_HeaderFooter },
- 0x089d: { n:"CrtLayout12", f:parse_CrtLayout12 },
- 0x089e: { n:"CrtMlFrt", f:parse_CrtMlFrt },
- 0x089f: { n:"CrtMlFrtContinue", f:parse_CrtMlFrtContinue },
- 0x08a3: { n:"ForceFullCalculation", f:parse_ForceFullCalculation },
- 0x08a4: { n:"ShapePropsStream", f:parse_ShapePropsStream },
- 0x08a5: { n:"TextPropsStream", f:parse_TextPropsStream },
- 0x08a6: { n:"RichTextStream", f:parse_RichTextStream },
- 0x08a7: { n:"CrtLayout12A", f:parse_CrtLayout12A },
- 0x1001: { n:"Units", f:parse_Units },
- 0x1002: { n:"Chart", f:parse_Chart },
- 0x1003: { n:"Series", f:parse_Series },
- 0x1006: { n:"DataFormat", f:parse_DataFormat },
- 0x1007: { n:"LineFormat", f:parse_LineFormat },
- 0x1009: { n:"MarkerFormat", f:parse_MarkerFormat },
- 0x100a: { n:"AreaFormat", f:parse_AreaFormat },
- 0x100b: { n:"PieFormat", f:parse_PieFormat },
- 0x100c: { n:"AttachedLabel", f:parse_AttachedLabel },
- 0x100d: { n:"SeriesText", f:parse_SeriesText },
- 0x1014: { n:"ChartFormat", f:parse_ChartFormat },
- 0x1015: { n:"Legend", f:parse_Legend },
- 0x1016: { n:"SeriesList", f:parse_SeriesList },
- 0x1017: { n:"Bar", f:parse_Bar },
- 0x1018: { n:"Line", f:parse_Line },
- 0x1019: { n:"Pie", f:parse_Pie },
- 0x101a: { n:"Area", f:parse_Area },
- 0x101b: { n:"Scatter", f:parse_Scatter },
- 0x101c: { n:"CrtLine", f:parse_CrtLine },
- 0x101d: { n:"Axis", f:parse_Axis },
- 0x101e: { n:"Tick", f:parse_Tick },
- 0x101f: { n:"ValueRange", f:parse_ValueRange },
- 0x1020: { n:"CatSerRange", f:parse_CatSerRange },
- 0x1021: { n:"AxisLine", f:parse_AxisLine },
- 0x1022: { n:"CrtLink", f:parse_CrtLink },
- 0x1024: { n:"DefaultText", f:parse_DefaultText },
- 0x1025: { n:"Text", f:parse_Text },
- 0x1026: { n:"FontX", f:parse_FontX },
- 0x1027: { n:"ObjectLink", f:parse_ObjectLink },
- 0x1032: { n:"Frame", f:parse_Frame },
- 0x1033: { n:"Begin", f:parse_Begin },
- 0x1034: { n:"End", f:parse_End },
- 0x1035: { n:"PlotArea", f:parse_PlotArea },
- 0x103a: { n:"Chart3d", f:parse_Chart3d },
- 0x103c: { n:"PicF", f:parse_PicF },
- 0x103d: { n:"DropBar", f:parse_DropBar },
- 0x103e: { n:"Radar", f:parse_Radar },
- 0x103f: { n:"Surf", f:parse_Surf },
- 0x1040: { n:"RadarArea", f:parse_RadarArea },
- 0x1041: { n:"AxisParent", f:parse_AxisParent },
- 0x1043: { n:"LegendException", f:parse_LegendException },
- 0x1044: { n:"ShtProps", f:parse_ShtProps },
- 0x1045: { n:"SerToCrt", f:parse_SerToCrt },
- 0x1046: { n:"AxesUsed", f:parse_AxesUsed },
- 0x1048: { n:"SBaseRef", f:parse_SBaseRef },
- 0x104a: { n:"SerParent", f:parse_SerParent },
- 0x104b: { n:"SerAuxTrend", f:parse_SerAuxTrend },
- 0x104e: { n:"IFmtRecord", f:parse_IFmtRecord },
- 0x104f: { n:"Pos", f:parse_Pos },
- 0x1050: { n:"AlRuns", f:parse_AlRuns },
- 0x1051: { n:"BRAI", f:parse_BRAI },
- 0x105b: { n:"SerAuxErrBar", f:parse_SerAuxErrBar },
- 0x105c: { n:"ClrtClient", f:parse_ClrtClient },
- 0x105d: { n:"SerFmt", f:parse_SerFmt },
- 0x105f: { n:"Chart3DBarShape", f:parse_Chart3DBarShape },
- 0x1060: { n:"Fbi", f:parse_Fbi },
- 0x1061: { n:"BopPop", f:parse_BopPop },
- 0x1062: { n:"AxcExt", f:parse_AxcExt },
- 0x1063: { n:"Dat", f:parse_Dat },
- 0x1064: { n:"PlotGrowth", f:parse_PlotGrowth },
- 0x1065: { n:"SIIndex", f:parse_SIIndex },
- 0x1066: { n:"GelFrame", f:parse_GelFrame },
- 0x1067: { n:"BopPopCustom", f:parse_BopPopCustom },
- 0x1068: { n:"Fbi2", f:parse_Fbi2 },
-
- /* These are specified in an older version of the spec */
- 0x0016: { n:"ExternCount", f:parsenoop },
- 0x007e: { n:"RK", f:parsenoop }, /* Not necessarily same as 0x027e */
- 0x007f: { n:"ImData", f:parsenoop },
- 0x0087: { n:"Addin", f:parsenoop },
- 0x0088: { n:"Edg", f:parsenoop },
- 0x0089: { n:"Pub", f:parsenoop },
- 0x0091: { n:"Sub", f:parsenoop },
- 0x0094: { n:"LHRecord", f:parsenoop },
- 0x0095: { n:"LHNGraph", f:parsenoop },
- 0x0096: { n:"Sound", f:parsenoop },
- 0x00a9: { n:"CoordList", f:parsenoop },
- 0x00ab: { n:"GCW", f:parsenoop },
- 0x00bc: { n:"ShrFmla", f:parsenoop }, /* Not necessarily same as 0x04bc */
- 0x00c2: { n:"AddMenu", f:parsenoop },
- 0x00c3: { n:"DelMenu", f:parsenoop },
- 0x00d6: { n:"RString", f:parsenoop },
- 0x00df: { n:"UDDesc", f:parsenoop },
- 0x00ea: { n:"TabIdConf", f:parsenoop },
- 0x0162: { n:"XL5Modify", f:parsenoop },
- 0x01a5: { n:"FileSharing2", f:parsenoop },
- 0x0218: { n:"Name", f:parsenoop },
- 0x0223: { n:"ExternName", f:parse_ExternName },
- 0x0231: { n:"Font", f:parsenoop },
- 0x0406: { n:"Formula", f:parse_Formula },
- 0x086d: { n:"FeatInfo", f:parsenoop },
- 0x0873: { n:"FeatInfo11", f:parsenoop },
- 0x0881: { n:"SXAddl12", f:parsenoop },
- 0x08c0: { n:"AutoWebPub", f:parsenoop },
- 0x08c1: { n:"ListObj", f:parsenoop },
- 0x08c2: { n:"ListField", f:parsenoop },
- 0x08c3: { n:"ListDV", f:parsenoop },
- 0x08c4: { n:"ListCondFmt", f:parsenoop },
- 0x08c5: { n:"ListCF", f:parsenoop },
- 0x08c6: { n:"FMQry", f:parsenoop },
- 0x08c7: { n:"FMSQry", f:parsenoop },
- 0x08c8: { n:"PLV", f:parsenoop }, /* supposedly PLV for Excel 11 */
- 0x08c9: { n:"LnExt", f:parsenoop },
- 0x08ca: { n:"MkrExt", f:parsenoop },
- 0x08cb: { n:"CrtCoopt", f:parsenoop },
-
- 0x0000: {}
-};
-
-
-/* Helper function to call out to ODS parser */
-function parse_ods(zip, opts) {
- if(typeof module !== "undefined" && typeof require !== 'undefined' && typeof ODS === 'undefined') ODS = require('./od' + 's');
- if(typeof ODS === 'undefined' || !ODS.parse_ods) throw new Error("Unsupported ODS");
- return ODS.parse_ods(zip, opts);
-}
-function fix_opts_func(defaults) {
- return function fix_opts(opts) {
- for(var i = 0; i != defaults.length; ++i) {
- var d = defaults[i];
- if(opts[d[0]] === undefined) opts[d[0]] = d[1];
- if(d[2] === 'n') opts[d[0]] = Number(opts[d[0]]);
- }
- };
-}
-
-var fix_read_opts = fix_opts_func([
- ['cellNF', false], /* emit cell number format string as .z */
- ['cellHTML', true], /* emit html string as .h */
- ['cellFormula', true], /* emit formulae as .f */
- ['cellStyles', false], /* emits style/theme as .s */
- ['cellDates', false], /* emit date cells with type `d` */
-
- ['sheetStubs', false], /* emit empty cells */
- ['sheetRows', 0, 'n'], /* read n rows (0 = read all rows) */
-
- ['bookDeps', false], /* parse calculation chains */
- ['bookSheets', false], /* only try to get sheet names (no Sheets) */
- ['bookProps', false], /* only try to get properties (no Sheets) */
- ['bookFiles', false], /* include raw file structure (keys, files, cfb) */
- ['bookVBA', false], /* include vba raw data (vbaraw) */
-
- ['password',''], /* password */
- ['WTF', false] /* WTF mode (throws errors) */
-]);
-
-
-var fix_write_opts = fix_opts_func([
- ['cellDates', false], /* write date cells with type `d` */
-
- ['bookSST', false], /* Generate Shared String Table */
-
- ['bookType', 'xlsx'], /* Type of workbook (xlsx/m/b) */
-
- ['WTF', false] /* WTF mode (throws errors) */
-]);
-function safe_parse_wbrels(wbrels, sheets) {
- if(!wbrels) return 0;
- try {
- wbrels = sheets.map(function pwbr(w) { return [w.name, wbrels['!id'][w.id].Target]; });
- } catch(e) { return null; }
- return !wbrels || wbrels.length === 0 ? null : wbrels;
-}
-
-function safe_parse_ws(zip, path, relsPath, sheet, sheetRels, sheets, opts) {
- try {
- sheetRels[sheet]=parse_rels(getzipdata(zip, relsPath, true), path);
- sheets[sheet]=parse_ws(getzipdata(zip, path),path,opts,sheetRels[sheet]);
- } catch(e) { if(opts.WTF) throw e; }
-}
-
-var nodirs = function nodirs(x){return x.substr(-1) != '/';};
-function parse_zip(zip, opts) {
- make_ssf(SSF);
- opts = opts || {};
- fix_read_opts(opts);
- reset_cp();
-
- /* OpenDocument Part 3 Section 2.2.1 OpenDocument Package */
- if(safegetzipfile(zip, 'META-INF/manifest.xml')) return parse_ods(zip, opts);
-
- var entries = keys(zip.files).filter(nodirs).sort();
- var dir = parse_ct(getzipdata(zip, '[Content_Types].xml'), opts);
- var xlsb = false;
- var sheets, binname;
- if(dir.workbooks.length === 0) {
- binname = "xl/workbook.xml";
- if(getzipdata(zip,binname, true)) dir.workbooks.push(binname);
- }
- if(dir.workbooks.length === 0) {
- binname = "xl/workbook.bin";
- if(!getzipfile(zip,binname,true)) throw new Error("Could not find workbook");
- dir.workbooks.push(binname);
- xlsb = true;
- }
- if(dir.workbooks[0].substr(-3) == "bin") xlsb = true;
- if(xlsb) set_cp(1200);
-
- if(!opts.bookSheets && !opts.bookProps) {
- strs = [];
- if(dir.sst) strs=parse_sst(getzipdata(zip, dir.sst.replace(/^\//,'')), dir.sst, opts);
-
- styles = {};
- if(dir.style) styles = parse_sty(getzipdata(zip, dir.style.replace(/^\//,'')),dir.style, opts);
-
- themes = {};
- if(opts.cellStyles && dir.themes.length) themes = parse_theme(getzipdata(zip, dir.themes[0].replace(/^\//,''), true),dir.themes[0], opts);
- }
-
- var wb = parse_wb(getzipdata(zip, dir.workbooks[0].replace(/^\//,'')), dir.workbooks[0], opts);
-
- var props = {}, propdata = "";
-
- if(dir.coreprops.length !== 0) {
- propdata = getzipdata(zip, dir.coreprops[0].replace(/^\//,''), true);
- if(propdata) props = parse_core_props(propdata);
- if(dir.extprops.length !== 0) {
- propdata = getzipdata(zip, dir.extprops[0].replace(/^\//,''), true);
- if(propdata) parse_ext_props(propdata, props);
- }
- }
-
- var custprops = {};
- if(!opts.bookSheets || opts.bookProps) {
- if (dir.custprops.length !== 0) {
- propdata = getzipdata(zip, dir.custprops[0].replace(/^\//,''), true);
- if(propdata) custprops = parse_cust_props(propdata, opts);
- }
- }
-
- var out = {};
- if(opts.bookSheets || opts.bookProps) {
- if(props.Worksheets && props.SheetNames.length > 0) sheets=props.SheetNames;
- else if(wb.Sheets) sheets = wb.Sheets.map(function pluck(x){ return x.name; });
- if(opts.bookProps) { out.Props = props; out.Custprops = custprops; }
- if(typeof sheets !== 'undefined') out.SheetNames = sheets;
- if(opts.bookSheets ? out.SheetNames : opts.bookProps) return out;
- }
- sheets = {};
-
- var deps = {};
- if(opts.bookDeps && dir.calcchain) deps=parse_cc(getzipdata(zip, dir.calcchain.replace(/^\//,'')),dir.calcchain,opts);
-
- var i=0;
- var sheetRels = {};
- var path, relsPath;
- if(!props.Worksheets) {
- var wbsheets = wb.Sheets;
- props.Worksheets = wbsheets.length;
- props.SheetNames = [];
- for(var j = 0; j != wbsheets.length; ++j) {
- props.SheetNames[j] = wbsheets[j].name;
- }
- }
-
- var wbext = xlsb ? "bin" : "xml";
- var wbrelsfile = 'xl/_rels/workbook.' + wbext + '.rels';
- var wbrels = parse_rels(getzipdata(zip, wbrelsfile, true), wbrelsfile);
- if(wbrels) wbrels = safe_parse_wbrels(wbrels, wb.Sheets);
- /* Numbers iOS hack */
- var nmode = (getzipdata(zip,"xl/worksheets/sheet.xml",true))?1:0;
- for(i = 0; i != props.Worksheets; ++i) {
- if(wbrels) path = 'xl/' + (wbrels[i][1]).replace(/[\/]?xl\//, "");
- else {
- path = 'xl/worksheets/sheet'+(i+1-nmode)+"." + wbext;
- path = path.replace(/sheet0\./,"sheet.");
- }
- relsPath = path.replace(/^(.*)(\/)([^\/]*)$/, "$1/_rels/$3.rels");
- safe_parse_ws(zip, path, relsPath, props.SheetNames[i], sheetRels, sheets, opts);
- }
-
- if(dir.comments) parse_comments(zip, dir.comments, sheets, sheetRels, opts);
-
- out = {
- Directory: dir,
- Workbook: wb,
- Props: props,
- Custprops: custprops,
- Deps: deps,
- Sheets: sheets,
- SheetNames: props.SheetNames,
- Strings: strs,
- Styles: styles,
- Themes: themes,
- SSF: SSF.get_table()
- };
- if(opts.bookFiles) {
- out.keys = entries;
- out.files = zip.files;
- }
- if(opts.bookVBA) {
- if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,dir.vba[0],true);
- else if(dir.defaults.bin === 'application/vnd.ms-office.vbaProject') out.vbaraw = getzipdata(zip,'xl/vbaProject.bin',true);
- }
- return out;
-}
-function add_rels(rels, rId, f, type, relobj) {
- if(!relobj) relobj = {};
- if(!rels['!id']) rels['!id'] = {};
- relobj.Id = 'rId' + rId;
- relobj.Type = type;
- relobj.Target = f;
- if(rels['!id'][relobj.Id]) throw new Error("Cannot rewrite rId " + rId);
- rels['!id'][relobj.Id] = relobj;
- rels[('/' + relobj.Target).replace("//","/")] = relobj;
-}
-
-function write_zip(wb, opts) {
- if(wb && !wb.SSF) {
- wb.SSF = SSF.get_table();
- }
- if(wb && wb.SSF) {
- make_ssf(SSF); SSF.load_table(wb.SSF);
- opts.revssf = evert_num(wb.SSF); opts.revssf[wb.SSF[65535]] = 0;
- }
- opts.rels = {}; opts.wbrels = {};
- opts.Strings = []; opts.Strings.Count = 0; opts.Strings.Unique = 0;
- var wbext = opts.bookType == "xlsb" ? "bin" : "xml";
- var ct = { workbooks: [], sheets: [], calcchains: [], themes: [], styles: [],
- coreprops: [], extprops: [], custprops: [], strs:[], comments: [], vba: [],
- TODO:[], rels:[], xmlns: "" };
- fix_write_opts(opts = opts || {});
- var zip = new jszip();
- var f = "", rId = 0;
-
- opts.cellXfs = [];
- get_cell_style(opts.cellXfs, {}, {revssf:{"General":0}});
-
- f = "docProps/core.xml";
- zip.file(f, write_core_props(wb.Props, opts));
- ct.coreprops.push(f);
- add_rels(opts.rels, 2, f, RELS.CORE_PROPS);
-
- f = "docProps/app.xml";
- if(!wb.Props) wb.Props = {};
- wb.Props.SheetNames = wb.SheetNames;
- wb.Props.Worksheets = wb.SheetNames.length;
- zip.file(f, write_ext_props(wb.Props, opts));
- ct.extprops.push(f);
- add_rels(opts.rels, 3, f, RELS.EXT_PROPS);
-
- if(wb.Custprops !== wb.Props && keys(wb.Custprops||{}).length > 0) {
- f = "docProps/custom.xml";
- zip.file(f, write_cust_props(wb.Custprops, opts));
- ct.custprops.push(f);
- add_rels(opts.rels, 4, f, RELS.CUST_PROPS);
- }
-
- f = "xl/workbook." + wbext;
- zip.file(f, write_wb(wb, f, opts));
- ct.workbooks.push(f);
- add_rels(opts.rels, 1, f, RELS.WB);
-
- for(rId=1;rId <= wb.SheetNames.length; ++rId) {
- f = "xl/worksheets/sheet" + rId + "." + wbext;
- zip.file(f, write_ws(rId-1, f, opts, wb));
- ct.sheets.push(f);
- add_rels(opts.wbrels, rId, "worksheets/sheet" + rId + "." + wbext, RELS.WS);
- }
-
- if(opts.Strings != null && opts.Strings.length > 0) {
- f = "xl/sharedStrings." + wbext;
- zip.file(f, write_sst(opts.Strings, f, opts));
- ct.strs.push(f);
- add_rels(opts.wbrels, ++rId, "sharedStrings." + wbext, RELS.SST);
- }
-
- /* TODO: something more intelligent with themes */
-
- f = "xl/theme/theme1.xml";
- zip.file(f, write_theme());
- ct.themes.push(f);
- add_rels(opts.wbrels, ++rId, "theme/theme1.xml", RELS.THEME);
-
- /* TODO: something more intelligent with styles */
-
- f = "xl/styles." + wbext;
- zip.file(f, write_sty(wb, f, opts));
- ct.styles.push(f);
- add_rels(opts.wbrels, ++rId, "styles." + wbext, RELS.STY);
-
- zip.file("[Content_Types].xml", write_ct(ct, opts));
- zip.file('_rels/.rels', write_rels(opts.rels));
- zip.file('xl/_rels/workbook.' + wbext + '.rels', write_rels(opts.wbrels));
- return zip;
-}
-function firstbyte(f,o) {
- switch((o||{}).type || "base64") {
- case 'buffer': return f[0];
- case 'base64': return Base64.decode(f.substr(0,12)).charCodeAt(0);
- case 'binary': return f.charCodeAt(0);
- case 'array': return f[0];
- default: throw new Error("Unrecognized type " + o.type);
- }
-}
-
-function read_zip(data, opts) {
- var zip, d = data;
- var o = opts||{};
- if(!o.type) o.type = (has_buf && Buffer.isBuffer(data)) ? "buffer" : "base64";
- switch(o.type) {
- case "base64": zip = new jszip(d, { base64:true }); break;
- case "binary": case "array": zip = new jszip(d, { base64:false }); break;
- case "buffer": zip = new jszip(d); break;
- case "file": zip=new jszip(d=_fs.readFileSync(data)); break;
- default: throw new Error("Unrecognized type " + o.type);
- }
- return parse_zip(zip, o);
-}
-
-function readSync(data, opts) {
- var zip, d = data, isfile = false, n;
- var o = opts||{};
- if(!o.type) o.type = (has_buf && Buffer.isBuffer(data)) ? "buffer" : "base64";
- if(o.type == "file") { isfile = true; o.type = "buffer"; d = _fs.readFileSync(data); }
- switch((n = firstbyte(d, o))) {
- case 0xD0:
- if(isfile) o.type = "file";
- return parse_xlscfb(CFB.read(data, o), o);
- case 0x09: return parse_xlscfb(s2a(o.type === 'base64' ? Base64.decode(data) : data), o);
- case 0x3C: return parse_xlml(d, o);
- case 0x50:
- if(isfile) o.type = "file";
- return read_zip(data, opts);
- default: throw new Error("Unsupported file " + n);
- }
-}
-
-function readFileSync(data, opts) {
- var o = opts||{}; o.type = 'file';
- return readSync(data, o);
-}
-function write_zip_type(wb, opts) {
- var o = opts||{};
- var z = write_zip(wb, o);
- switch(o.type) {
- case "base64": return z.generate({type:"base64"});
- case "binary": return z.generate({type:"string"});
- case "buffer": return z.generate({type:"nodebuffer"});
- case "file": return _fs.writeFileSync(o.file, z.generate({type:"nodebuffer"}));
- default: throw new Error("Unrecognized type " + o.type);
- }
-}
-
-function writeSync(wb, opts) {
- var o = opts||{};
- switch(o.bookType) {
- case 'xml': return write_xlml(wb, o);
- default: return write_zip_type(wb, o);
- }
-}
-
-function writeFileSync(wb, filename, opts) {
- var o = opts||{}; o.type = 'file';
- o.file = filename;
- switch(o.file.substr(-5).toLowerCase()) {
- case '.xlsx': o.bookType = 'xlsx'; break;
- case '.xlsm': o.bookType = 'xlsm'; break;
- case '.xlsb': o.bookType = 'xlsb'; break;
- default: switch(o.file.substr(-4).toLowerCase()) {
- case '.xls': o.bookType = 'xls'; break;
- case '.xml': o.bookType = 'xml'; break;
- }}
- return writeSync(wb, o);
-}
-
-function decode_row(rowstr) { return parseInt(unfix_row(rowstr),10) - 1; }
-function encode_row(row) { return "" + (row + 1); }
-function fix_row(cstr) { return cstr.replace(/([A-Z]|^)(\d+)$/,"$1$$$2"); }
-function unfix_row(cstr) { return cstr.replace(/\$(\d+)$/,"$1"); }
-
-function decode_col(colstr) { var c = unfix_col(colstr), d = 0, i = 0; for(; i !== c.length; ++i) d = 26*d + c.charCodeAt(i) - 64; return d - 1; }
-function encode_col(col) { var s=""; for(++col; col; col=Math.floor((col-1)/26)) s = String.fromCharCode(((col-1)%26) + 65) + s; return s; }
-function fix_col(cstr) { return cstr.replace(/^([A-Z])/,"$$$1"); }
-function unfix_col(cstr) { return cstr.replace(/^\$([A-Z])/,"$1"); }
-
-function split_cell(cstr) { return cstr.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(","); }
-function decode_cell(cstr) { var splt = split_cell(cstr); return { c:decode_col(splt[0]), r:decode_row(splt[1]) }; }
-function encode_cell(cell) { return encode_col(cell.c) + encode_row(cell.r); }
-function fix_cell(cstr) { return fix_col(fix_row(cstr)); }
-function unfix_cell(cstr) { return unfix_col(unfix_row(cstr)); }
-function decode_range(range) { var x =range.split(":").map(decode_cell); return {s:x[0],e:x[x.length-1]}; }
-function encode_range(cs,ce) {
- if(ce === undefined || typeof ce === 'number') return encode_range(cs.s, cs.e);
- if(typeof cs !== 'string') cs = encode_cell(cs); if(typeof ce !== 'string') ce = encode_cell(ce);
- return cs == ce ? cs : cs + ":" + ce;
-}
-
-function safe_decode_range(range) {
- var o = {s:{c:0,r:0},e:{c:0,r:0}};
- var idx = 0, i = 0, cc = 0;
- var len = range.length;
- for(idx = 0; i < len; ++i) {
- if((cc=range.charCodeAt(i)-64) < 1 || cc > 26) break;
- idx = 26*idx + cc;
- }
- o.s.c = --idx;
-
- for(idx = 0; i < len; ++i) {
- if((cc=range.charCodeAt(i)-48) < 0 || cc > 9) break;
- idx = 10*idx + cc;
- }
- o.s.r = --idx;
-
- if(i === len || range.charCodeAt(++i) === 58) { o.e.c=o.s.c; o.e.r=o.s.r; return o; }
-
- for(idx = 0; i != len; ++i) {
- if((cc=range.charCodeAt(i)-64) < 1 || cc > 26) break;
- idx = 26*idx + cc;
- }
- o.e.c = --idx;
-
- for(idx = 0; i != len; ++i) {
- if((cc=range.charCodeAt(i)-48) < 0 || cc > 9) break;
- idx = 10*idx + cc;
- }
- o.e.r = --idx;
- return o;
-}
-
-function safe_format_cell(cell, v) {
- if(cell.z !== undefined) try { return (cell.w = SSF.format(cell.z, v)); } catch(e) { }
- if(!cell.XF) return v;
- try { return (cell.w = SSF.format(cell.XF.ifmt||0, v)); } catch(e) { return ''+v; }
-}
-
-function format_cell(cell, v) {
- if(cell == null || cell.t == null) return "";
- if(cell.w !== undefined) return cell.w;
- if(v === undefined) return safe_format_cell(cell, cell.v);
- return safe_format_cell(cell, v);
-}
-
-function sheet_to_json(sheet, opts){
- var val, row, range, header = 0, offset = 1, r, hdr = [], isempty, R, C, v;
- var o = opts != null ? opts : {};
- var raw = o.raw;
- if(sheet == null || sheet["!ref"] == null) return [];
- range = o.range !== undefined ? o.range : sheet["!ref"];
- if(o.header === 1) header = 1;
- else if(o.header === "A") header = 2;
- else if(Array.isArray(o.header)) header = 3;
- switch(typeof range) {
- case 'string': r = safe_decode_range(range); break;
- case 'number': r = safe_decode_range(sheet["!ref"]); r.s.r = range; break;
- default: r = range;
- }
- if(header > 0) offset = 0;
- var rr = encode_row(r.s.r);
- var cols = new Array(r.e.c-r.s.c+1);
- var out = new Array(r.e.r-r.s.r-offset+1);
- var outi = 0;
- for(C = r.s.c; C <= r.e.c; ++C) {
- cols[C] = encode_col(C);
- val = sheet[cols[C] + rr];
- switch(header) {
- case 1: hdr[C] = C; break;
- case 2: hdr[C] = cols[C]; break;
- case 3: hdr[C] = o.header[C - r.s.c]; break;
- default:
- if(val === undefined) continue;
- hdr[C] = format_cell(val);
- }
- }
-
- for (R = r.s.r + offset; R <= r.e.r; ++R) {
- rr = encode_row(R);
- isempty = true;
- if(header === 1) row = [];
- else {
- row = {};
- if(Object.defineProperty) Object.defineProperty(row, '__rowNum__', {value:R, enumerable:false});
- else row.__rowNum__ = R;
- }
- for (C = r.s.c; C <= r.e.c; ++C) {
- val = sheet[cols[C] + rr];
- if(val === undefined || val.t === undefined) continue;
- v = val.v;
- switch(val.t){
- case 'e': continue;
- case 's': break;
- case 'b': case 'n': break;
- default: throw 'unrecognized type ' + val.t;
- }
- if(v !== undefined) {
- row[hdr[C]] = raw ? v : format_cell(val,v);
- isempty = false;
- }
- }
- if(isempty === false || header === 1) out[outi++] = row;
- }
- out.length = outi;
- return out;
-}
-
-function sheet_to_row_object_array(sheet, opts) { return sheet_to_json(sheet, opts != null ? opts : {}); }
-
-function sheet_to_csv(sheet, opts) {
- var out = "", txt = "", qreg = /"/g;
- var o = opts == null ? {} : opts;
- if(sheet == null || sheet["!ref"] == null) return "";
- var r = safe_decode_range(sheet["!ref"]);
- var FS = o.FS !== undefined ? o.FS : ",", fs = FS.charCodeAt(0);
- var RS = o.RS !== undefined ? o.RS : "\n", rs = RS.charCodeAt(0);
- var row = "", rr = "", cols = [];
- var i = 0, cc = 0, val;
- var R = 0, C = 0;
- for(C = r.s.c; C <= r.e.c; ++C) cols[C] = encode_col(C);
- for(R = r.s.r; R <= r.e.r; ++R) {
- row = "";
- rr = encode_row(R);
- for(C = r.s.c; C <= r.e.c; ++C) {
- val = sheet[cols[C] + rr];
- txt = val !== undefined ? ''+format_cell(val) : "";
- for(i = 0, cc = 0; i !== txt.length; ++i) if((cc = txt.charCodeAt(i)) === fs || cc === rs || cc === 34) {
- txt = "\"" + txt.replace(qreg, '""') + "\""; break; }
- row += (C === r.s.c ? "" : FS) + txt;
- }
- out += row + RS;
- }
- return out;
-}
-var make_csv = sheet_to_csv;
-
-function sheet_to_formulae(sheet) {
- var cmds, y = "", x, val="";
- if(sheet == null || sheet["!ref"] == null) return "";
- var r = safe_decode_range(sheet['!ref']), rr = "", cols = [], C;
- cmds = new Array((r.e.r-r.s.r+1)*(r.e.c-r.s.c+1));
- var i = 0;
- for(C = r.s.c; C <= r.e.c; ++C) cols[C] = encode_col(C);
- for(var R = r.s.r; R <= r.e.r; ++R) {
- rr = encode_row(R);
- for(C = r.s.c; C <= r.e.c; ++C) {
- y = cols[C] + rr;
- x = sheet[y];
- val = "";
- if(x === undefined) continue;
- if(x.f != null) val = x.f;
- else if(x.w !== undefined) val = "'" + x.w;
- else if(x.v === undefined) continue;
- else val = ""+x.v;
- cmds[i++] = y + "=" + val;
- }
- }
- cmds.length = i;
- return cmds;
-}
-
-var utils = {
- encode_col: encode_col,
- encode_row: encode_row,
- encode_cell: encode_cell,
- encode_range: encode_range,
- decode_col: decode_col,
- decode_row: decode_row,
- split_cell: split_cell,
- decode_cell: decode_cell,
- decode_range: decode_range,
- format_cell: format_cell,
- get_formulae: sheet_to_formulae,
- make_csv: sheet_to_csv,
- make_json: sheet_to_json,
- make_formulae: sheet_to_formulae,
- sheet_to_csv: sheet_to_csv,
- sheet_to_json: sheet_to_json,
- sheet_to_formulae: sheet_to_formulae,
- sheet_to_row_object_array: sheet_to_row_object_array
-};
-XLSX.parse_xlscfb = parse_xlscfb;
-XLSX.parse_zip = parse_zip;
-XLSX.read = readSync; //xlsread
-XLSX.readFile = readFileSync; //readFile
-XLSX.readFileSync = readFileSync;
-XLSX.write = writeSync;
-XLSX.writeFile = writeFileSync;
-XLSX.writeFileSync = writeFileSync;
-XLSX.utils = utils;
-XLSX.CFB = CFB;
-XLSX.SSF = SSF;
-})(typeof exports !== 'undefined' ? exports : XLSX);
-var XLS = XLSX;
diff --git a/plugins/tiddlywiki/xlsx-utils/importer.js b/plugins/tiddlywiki/xlsx-utils/importer.js
index d634ca55d..2bb963ab6 100644
--- a/plugins/tiddlywiki/xlsx-utils/importer.js
+++ b/plugins/tiddlywiki/xlsx-utils/importer.js
@@ -132,6 +132,9 @@ XLSXImporter.prototype.processField = function(fieldImportSpecTitle) {
value = $tw.utils.stringifyDate(new Date((cell.v - (25567 + 2)) * 86400 * 1000));
}
break;
+ case "number":
+ value = cell.v.toString();
+ break;
case "string":
// Intentional fall-through
default:
diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid
index 9b7104cbd..cb53840bf 100644
--- a/themes/tiddlywiki/vanilla/base.tid
+++ b/themes/tiddlywiki/vanilla/base.tid
@@ -2889,6 +2889,22 @@ button > .tc-toc-caption{
** Dirty indicator
*/
+html body svg.tc-image-save-button-dynamic .tc-image-save-button-dynamic-clean {
+ visibility: visible;
+}
+
+html body svg.tc-image-save-button-dynamic .tc-image-save-button-dynamic-dirty {
+ visibility: hidden;
+}
+
+html body.tc-dirty svg.tc-image-save-button-dynamic .tc-image-save-button-dynamic-clean {
+ visibility: hidden;
+}
+
+html body.tc-dirty svg.tc-image-save-button-dynamic .tc-image-save-button-dynamic-dirty {
+ visibility: visible;
+}
+
html body.tc-dirty span.tc-dirty-indicator, html body.tc-dirty span.tc-dirty-indicator svg {
fill: <>;
color: <>;