!function(e,t){if("function"==typeof define&&define.amd)define([],t);else if("function"==typeof define)define(t);else if("undefined"!=typeof module&&module.exports){var l=require("jszip"),r=require("fs");module.exports=t(l,r)}else e.oxml=t()}(this,function(e,t){var l,r,n;return function(e){function t(e,t){return _.call(e,t)}function o(e,t){var l,r,n,o,s,i,a,u,f,d,c,h=t&&t.split("/"),m=y.map,p=m&&m["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&C.test(e[s])&&(e[s]=e[s].replace(C,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),f=0;f<e.length;f++)if("."===(c=e[f]))e.splice(f,1),f-=1;else if(".."===c){if(0===f||1===f&&".."===e[2]||".."===e[f-1])continue;f>0&&(e.splice(f-1,2),f-=2)}e=e.join("/")}if((h||p)&&m){for(f=(l=e.split("/")).length;f>0;f-=1){if(r=l.slice(0,f).join("/"),h)for(d=h.length;d>0;d-=1)if((n=m[h.slice(0,d).join("/")])&&(n=n[r])){o=n,i=f;break}if(o)break;!a&&p&&p[r]&&(a=p[r],u=f)}!o&&a&&(o=a,i=u),o&&(l.splice(0,i,o),e=l.join("/"))}return e}function s(t,l){return function(){var r=b.call(arguments,0);return"string"!=typeof r[0]&&1===r.length&&r.push(null),c.apply(e,r.concat([t,l]))}}function i(e){return function(t){p[e]=t}}function a(l){if(t(v,l)){var r=v[l];delete v[l],g[l]=!0,d.apply(e,r)}if(!t(p,l)&&!t(g,l))throw new Error("No "+l);return p[l]}function u(e){var t,l=e?e.indexOf("!"):-1;return l>-1&&(t=e.substring(0,l),e=e.substring(l+1,e.length)),[t,e]}function f(e){return e?u(e):[]}var d,c,h,m,p={},v={},y={},g={},_=Object.prototype.hasOwnProperty,b=[].slice,C=/\.js$/;h=function(e,t){var l,r=u(e),n=r[0],s=t[1];return e=r[1],n&&(l=a(n=o(n,s))),n?e=l&&l.normalize?l.normalize(e,function(e){return function(t){return o(t,e)}}(s)):o(e,s):(n=(r=u(e=o(e,s)))[0],e=r[1],n&&(l=a(n))),{f:n?n+"!"+e:e,n:e,pr:n,p:l}},m={require:function(e){return s(e)},exports:function(e){var t=p[e];return void 0!==t?t:p[e]={}},module:function(e){return{id:e,uri:"",exports:p[e],config:function(e){return function(){return y&&y.config&&y.config[e]||{}}}(e)}}},d=function(l,r,n,o){var u,d,c,y,_,b,C,w=[],x=typeof n;if(o=o||l,b=f(o),"undefined"===x||"function"===x){for(r=!r.length&&n.length?["require","exports","module"]:r,_=0;_<r.length;_+=1)if(y=h(r[_],b),"require"===(d=y.f))w[_]=m.require(l);else if("exports"===d)w[_]=m.exports(l),C=!0;else if("module"===d)u=w[_]=m.module(l);else if(t(p,d)||t(v,d)||t(g,d))w[_]=a(d);else{if(!y.p)throw new Error(l+" missing "+d);y.p.load(y.n,s(o,!0),i(d),{}),w[_]=p[d]}c=n?n.apply(p[l],w):void 0,l&&(u&&u.exports!==e&&u.exports!==p[l]?p[l]=u.exports:c===e&&C||(p[l]=c))}else l&&(p[l]=n)},l=r=c=function(t,l,r,n,o){if("string"==typeof t)return m[t]?m[t](l):a(h(t,f(l)).f);if(!t.splice){if((y=t).deps&&c(y.deps,y.callback),!l)return;l.splice?(t=l,l=r,r=null):t=e}return l=l||function(){},"function"==typeof r&&(r=n,n=o),n?d(e,t,l,r):setTimeout(function(){d(e,t,l,r)},4),c},c.config=function(e){return c(e)},l._defined=p,(n=function(e,l,r){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");l.splice||(r=l,l=[]),t(p,e)||t(v,e)||(v[e]=[e,l,r])}).amd={jQuery:!0}}(),n("build/almond",function(){}),n("fileHandler",[],function(){"use strict";var e=function(){this.className="FileHandler"};return e.prototype=function(){var e=function(e,t){this.className="CompressedFile",this._zip=e,this._fs=t};return e.prototype=function(){return{addFile:function(e,t,l,r){var n;l&&(n=this._zip.folder(l)),r?(n||this._zip).file(t,e,r):(n||this._zip).file(t,e)},saveFile:function(e,t){var l=this._zip,r=this._fs;return"undefined"!=typeof window?l.generateAsync({type:"blob"}).then(function(r){try{if(window.saveAs)return saveAs(r,e);var n=window.URL.createObjectURL(r),o=document.createElement("a");if(o.setAttribute("href",n),o.setAttribute("download",e),o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),t)t(l);else if("undefined"!=typeof Promise)return new Promise(function(e,t){e(l)})}catch(e){if(t)t(null,"Err: Not able to create file object.");else if("undefined"!=typeof Promise)return new Promise(function(e,t){t("Err: Not able to create file object.")})}}):t?(l.generateNodeStream({type:"nodebuffer",streamFiles:!0}).pipe(r.createWriteStream(e)),void t(l)):new Promise(function(t,n){l.generateNodeStream({type:"nodebuffer",streamFiles:!0}).pipe(r.createWriteStream(e)),t(l)})}}}(),{createFile:function(t,l){return new e(t,l)}}}(),e}),n("contentFile",[],function(){var e=function(e){this.className="ContentFile",this._file=e};return e.prototype=function(){return{attach:function(e){var t=this.generateContent(e);e.addFile(t,this.fileName,this.folderName),this.attachChild&&this.attachChild(e)}}}(),e}),n("contentString",[],function(){var e=function(e){e&&(this.template=e)};return e.prototype=function(){var e=function(){var e=arguments;return this.template=this.template.replace(/{(\d+)}/g,function(t,l){return void 0!==e[l]?e[l]:t}),this.template},t=function(){return this.template};return{format:e,toString:t}}(),e}),n("xmlContentString",["contentString"],function(e){var t=function(t){this.className="XMLContentString",this.rootNode=t.rootNode,this.nameSpaces=t.nameSpaces,this.template='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';for(var l=new e("<{0}{1}{3}>{2}</{0}>"),r="",n="",o=0;o<this.nameSpaces.length;o++){var s=new e(' xmlns{0}="{1}"');"string"==typeof this.nameSpaces[o]?r+=s.format("",this.nameSpaces[o]):r+=s.format(this.nameSpaces[o].attribute?":"+this.nameSpaces[o].attribute:"",this.nameSpaces[o].value)}if(t.attributes)for(var i in t.attributes){var a=new e(' {0}="{1}"');n+=a.format(i,t.attributes[i])}this.template+=l.format(this.rootNode,r,"{0}",n)};return t.prototype=Object.create(e.prototype),t}),n("oxml_rels",["contentFile","contentString","xmlContentString"],function(e,t,l){"use strict";var r=function(e,t){this.className="Relation",this.fileName=e,this.folderName=t,this.relations=[]};return r.prototype=Object.create(e.prototype),r.prototype.addRelation=function(e,t,l){this.relations.push({Id:e,Type:t,Target:l})},r.prototype.generateContent=function(){var e,r=new l({rootNode:"Relationships",nameSpaces:["http://schemas.openxmlformats.org/package/2006/relationships"]}),n="";for(e=0;e<this.relations.length;e++){n+=new t('<Relationship Id="{0}" Type="{1}" Target="{2}"/>').format(this.relations[e].Id,this.relations[e].Type,this.relations[e].Target)}return r.format(n)},{createRelation:function(e,t){return new r(e,t)}}}),n("oxml_content_types",["contentFile","contentString","xmlContentString"],function(e,t,l){"use strict";var r=function(){this.className="ContentTypes",this._contentType={contentTypes:[]},this.fileName="[Content_Types].xml"};return r.prototype=Object.create(e.prototype),r.prototype.generateContent=function(){var e,r=new l({rootNode:"Types",nameSpaces:["http://schemas.openxmlformats.org/package/2006/content-types"]}),n="";for(e=0;e<this._contentType.contentTypes.length;e++){var o=new t('<{0} ContentType="{1}"{2}{3}/>'),s=this._contentType.contentTypes[e];n+=o.format(s.name,s.contentType,s.Extension?' Extension="'+s.Extension+'"':"",s.PartName?' PartName="'+s.PartName+'"':"")}return r.format(n)},r.prototype.addContentType=function(e,t,l){var r={name:e,contentType:t};for(var n in l)r[n]=l[n];this._contentType.contentTypes.push(r)},{createContentType:function(){return new r}}}),n("oxml_table",["xmlContentString","contentFile"],function(e,t){"use strict";var l=function(e,t,l,r,n,s,i){var a=parseInt(t.match(/\d+/)[0],10),u=parseInt(l.match(/\d+/)[0],10),f=t.match(/\D+/)[0].toUpperCase().charCodeAt()-64,d=l.match(/\D+/)[0].toUpperCase().charCodeAt()-64,c={rid:n,displayName:e,columns:r,fromCell:t,toCell:l,fromRow:a,toRow:u,fromColumn:f,toColumn:d};o(s,c,i),this.className="Table",this.fileName="table"+n+".xml",this.folderName="workbook/tables",this._table=c,this.rid=n,this._sheet=i};l.prototype=Object.create(t.prototype),l.prototype.generateContent=function(){var t=new e({rootNode:"table",nameSpaces:["http://schemas.openxmlformats.org/spreadsheetml/2006/main"],attributes:{totalsRowShown:"0",ref:this._table.fromCell+":"+this._table.toCell,displayName:this._table.displayName,name:this._table.displayName,id:this._table.rid}}),l="";if(this._table.filters){l+='<autoFilter ref="'+this._table.fromCell+":"+this._table.toCell+'">';for(var r=0;r<this._table.filters.length;r++){if(l+='<filterColumn colId="'+this._table.filters[r].column+'">',"default"===this._table.filters[r].values[0].type){l+="<filters>";for(var n=0;n<this._table.filters[r].values.length;n++)l+='<filter val="'+this._table.filters[r].values[n].value+'"/>';l+="</filters>"}else if("custom"===this._table.filters[r].values[0].type){l+='<customFilters and="'+(this._table.filters[r].values[0].and?"1":"0")+'">';for(var n=0;n<this._table.filters[r].values.length;n++)l+='<customFilter operator="'+this._table.filters[r].values[n].operator+'" val="'+this._table.filters[r].values[n].value+'"/>';l+="</customFilters>"}l+="</filterColumn>"}l+="</autoFilter>"}this._table.sort&&(l+='<sortState caseSensitive="'+(this._table.sort.caseSensitive?"1":"0")+'" ref="'+this._table.sort.dataRange+'">',l+="<sortCondition"+("ascending"===this._table.sort.direction?"":' descending="1"')+' ref="'+this._table.sort.range+'"/>',l+="</sortState>"),l+='<tableColumns count="'+this._table.columns.length+'">';for(var r=0;r<this._table.columns.length;r++)l+='<tableColumn name="'+this._table.columns[r]+'" id="'+(r+1)+'"/>';var o="";return this._table.tableStyle&&(o='<tableStyleInfo name="'+this._table.tableStyle.name+'" showColumnStripes="'+(this._table.tableStyle.showColumnStripes?"1":"0")+'" showRowStripes="'+(this._table.tableStyle.showRowStripes?"1":"0")+'" showLastColumn="'+(this._table.tableStyle.showLastColumn?"1":"0")+'" showFirstColumn="'+(this._table.tableStyle.showFirstColumn?"1":"0")+'"/>'),l+="</tableColumns>"+o,t.format(l)},l.prototype.tableOptions=function(){return a(this._table,this._sheet,this.relId)};var r=function(e,t,l){if(t.filters||(t.filters=[]),"object"==typeof e.filters&&e.filters.length)for(var r=0;r<e.filters.length;r++)if(e.filters[r].column){var n;if(e.filters[r].value)n=[],n.push({value:e.filters[r].value,type:e.filters[r].type||"default",operator:e.filters[r].operator||null,and:!1!==e.filters[r].and}),s(l,e.filters[r].column-1,[e.filters[r].value],t.fromCell,t.toCell,e.filters[r].operator);else if(e.filters[r].values&&"object"==typeof e.filters[r].values&&e.filters[r].values.length){n=[];for(var o=0;o<e.filters[r].values.length;o++)n.push({value:e.filters[r].values[o],type:e.filters[r].type||"default",operator:e.filters[r].operator||null,and:!1!==e.filters[r].and});s(l,e.filters[r].column-1,e.filters[r].values,t.fromCell,t.toCell,e.filters[r].operator)}t.filters.push({column:e.filters[r].column-1,values:n})}},n=function(e,t){var l={},r=t.fromColumn-1,n=t.toColumn-1,o=t.fromRow,s=t.toRow;"number"==typeof e.sort?(r=String.fromCharCode(e.sort+r+64),l.direction="ascending",l.caseSensitive=!0):"object"==typeof e.sort&&!e.sort.length&&e.sort.column&&(r=String.fromCharCode(e.sort.column+r+64),l.direction=e.sort.direction||"ascending",l.caseSensitive=void 0===e.sort.caseSensitive||e.sort.caseSensitive),l.range=r+(o+1)+":"+r+s,l.dataRange=String.fromCharCode(t.fromColumn+64)+(o+1)+":"+String.fromCharCode(n+65)+s,t.sort=l},o=function(e,t,l){e&&(e.filters&&r(e,t,l),e.sort&&n(e,t))},s=function(e,t,l,r,n,o){var s=parseInt(r.match(/\d+/)[0],10),i=parseInt(n.match(/\d+/)[0],10);t+=r.match(/\D+/)[0].toUpperCase().charCodeAt()-65;for(var a=s;a<i;a++){var u=!1;if(e.values[a])if(!o||"greaterThan"!==o&&"greaterThanOrEqual"!==o&&"lessThan"!==o&&"lessThanOrEqual"!==o)u="notEqual"===o?l.indexOf(e.values[a][t].value)>-1:!(l.indexOf(e.values[a][t].value)>-1);else{u=!0;for(var f=0;f<l.length;f++){switch(o){case"greaterThan":e.values[a][t].value>l[f]&&(u=!1);break;case"greaterThanOrEqual":case"lessThan":case"lessThanOrEqual":e.values[a][t].value>=l[f]&&(u=!1)}if(!u)break}}u&&(e.values[a].hidden=!0)}},i=function(e,t,l,r){var n=l._workBook.createStyles(),o=n.addTableStyle(e,t,r);r.tableStyle={name:t,showColumnStripes:!(!o.evenColumn&&!o.oddColumn),showRowStripes:!(!o.evenRow&&!o.oddRow),showLastColumn:!!o.lastColumn,showFirstColumn:!!o.firstColumn}},a=function(e,t,l){return{name:e.displayName,columns:e.columns,fromCell:e.fromCell,toCell:e.toCell,sort:e.sort,filters:e.filters,set:function(r){return o(r,e,t),a(e,t,l)},style:function(r,n){return n||(n="customTableStyle"+l),i(r,n,t,e),a(e,t,l)}}};return{addTable:function(e,t,r,n,o,s,i){return new l(e,t,r,n,o,s,i)}}}),n("oxml_sheet",["oxml_table","oxml_rels","xmlContentString","contentFile"],function(e,t,l,r){"use strict";var n=function(e,t,l,r,n){this.className="Worksheet",this.fileName="sheet"+t+".xml",this.folderName="workbook/sheets",this.xlsxContentTypes=n,this._sheet={sheetName:e,sheetId:t,rId:l,values:[],_workBook:r}};n.prototype=Object.create(r.prototype);var o=function(e,t,l,r){if(!e)return"";var n=e.styleIndex?'s="'+e.styleIndex+'"':"";if("numeric"===e.type)return'<c r="'+t+'" '+n+"><v>"+e.value+"</v></c>";if("sharedString"===e.type)return'<c r="'+t+'" t="s" '+n+"><v>"+e.value+"</v></c>";if("sharedFormula"===e.type){var o="";return e.value&&"function"==typeof e.value?o="<v>"+e.value(l+1,r+1)+"</v>":void 0!==e.value&&null!==e.value&&(o="<v>"+e.value+"</v>"),e.formula?'<c  r="'+t+'" '+n+'><f t="shared" ref="'+e.range+'" si="'+e.si+'">'+e.formula+"</f>"+o+"</c>":'<c  r="'+t+'" '+n+'><f t="shared" si="'+e.si+'"></f>'+o+"</c>"}if("string"===e.type)return'<c r="'+t+'" t="inlineStr" '+n+"><is><t>"+e.value+"</t></is></c>";if("formula"===e.type){var o="";return e.value&&"function"==typeof e.value?o="<v>"+e.value(l+1,r+1)+"</v>":void 0!==e.value&&null!==e.value&&(o="<v>"+e.value+"</v>"),'<c r="'+t+'" '+n+"><f>"+e.formula+"</f>"+o+"</c>"}},s=function(e){var t={};return e._rels.relations.length&&(t=e._rels.relations[e._rels.relations.length-1]),parseInt((t.Id||"rId0").replace("rId",""),10)+1},i=function(e){for(var t,l="";e>0;){t=e%26;var r=(e-t)/26;0===t&&(t=26),e=r,l=String.fromCharCode(64+t)+l}return l};n.prototype.generateContent=function(e){var t=0,r="<sheetData>";if(this._sheet.values&&this._sheet.values.length)for(t=0;t<this._sheet.values.length;t++)if(this._sheet.values[t]&&this._sheet.values[t].length>0){var n=this._sheet.values[t].hidden?' hidden="1" ':"";r+='<row r="'+(t+1)+'"'+n+">";var s=0;for(s=0;s<this._sheet.values[t].length;s++){var a=i(s+1),u=this._sheet.values[t][s],f=a+(t+1),d=o(u,f,t,s);r+=d}r+="</row>"}r+="</sheetData>";var c="";if(this._sheet._mergeCells&&this._sheet._mergeCells.length){c+='<mergeCells count="'+this._sheet._mergeCells.length+'">';for(var h=0;h<this._sheet._mergeCells.length;h++)c+='<mergeCell ref="'+this._sheet._mergeCells[0]+'"/>';c+="</mergeCells>"}var m="";if(this._sheet.tables&&this._sheet.tables.length){m+='<tableParts count="'+this._sheet.tables.length+'">';for(var p=0;p<this._sheet.tables.length;p++)m+='<tablePart r:id="rId'+this._sheet.tables[p].rid+'"/>',e&&this._sheet.tables[p].attach(e);m+="</tableParts>"}return new l({rootNode:"worksheet",nameSpaces:["http://schemas.openxmlformats.org/spreadsheetml/2006/main",{value:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",attribute:"r"}]}).format(r+c+m)},n.prototype.attachChild=function(e){this._sheet._rels&&this._sheet._rels.attach(e)};var a=function(e,t){if(void 0===e||null===e)return null;if("object"==typeof e){if(!(void 0!==e.value&&null!==e.value||e.formula&&"formula"===e.type))return null;if(e.type)return"sharedString"===e.type?"number"==typeof e.value?{type:e.type,value:e.value}:(e.value=t._workBook.createSharedString(e.value,t._workBook),{type:e.type,value:e.value}):"formula"===e.type?{type:e.type,formula:e.formula,value:e.value}:"numeric"===e.type||"string"===e.type?{type:e.type,value:e.value}:null;e=e.value}return"number"==typeof e?{type:"numeric",value:e}:"string"==typeof e?{type:"string",value:e}:null},u=function(e,t,l,r,n,o){var s,i;if(n){n.cellIndices=o;i=t._workBook.createStyles().addStyles(n)}for(s=0;s<e.length;s++)if(void 0!==e[s]||null!==e[s]){var u=s+l-1;if(t.values[u]||(t.values[u]=[]),"object"==typeof e[s]&&e[s].length>=0){var f;for(f=0;f<e[s].length;f++){var d=a(e[s][f],t);d&&(i&&(d.styleIndex=i.index),i||!t.values[u][f+r-1]?t.values[u][f+r-1]=d:(t.values[u][f+r-1].value=d.value,t.values[u][f+r-1].type=d.type))}}else{var d=a(e[s],t);d&&(i&&(d.styleIndex=i.index),i||!t.values[u][r-1]?t.values[u][r-1]=d:(t.values[u][r-1].value=d.value,t.values[u][r-1].type=d.type))}}},f=function(e,t,l,r,n){var o=i(r)+l,s=l-1;if(void 0!==e&&null!==e){if(t.values[s]||(t.values[s]=[]),e=a(e,t),n){n.cellIndex=o;var u=t._workBook.createStyles();e.styleIndex=u.addStyles(n).index}e&&!e.styleIndex&&t.values[s][r-1]&&(e.styleIndex=t.values[s][r-1].styleIndex),t.values[s][r-1]=e}return d(t,o,s,r-1)},d=function(e,t,l,r){return{style:function(n){return n.cellIndex=t,h(e,n,l,r),d(e,t,l,r)},value:e.values[l]&&e.values[l][r]?e.values[l][r].value:null,type:e.values[l]&&e.values[l][r]?e.values[l][r].type:null,cellIndex:t,rowIndex:l+1,columnIndex:i(r+1),formula:e.values[l]&&e.values[l][r]?e.values[l][r].formula:void 0,set:function(n,o){return p(e,l+1,r+1,n,o),this.value=e.values[l]&&e.values[l][r]?e.values[l][r].value:null,this.formula=e.values[l]&&e.values[l][r]?e.values[l][r].formula:void 0,this.type=e.values[l]&&e.values[l][r]?e.values[l][r].type:null,d(e,t,l,r)}}},c=function(e,t,l,r,n,o,s,a,u){var f,y=[];for(f=0;f<l.length;f++){var g=l[f].rowIndex,_=l[f].columnIndex,b=e.values[g]&&e.values[g][_]?e.values[g][_].value:null,C=e.values[g]&&e.values[g][_]?e.values[g][_].formula:void 0,w=e.values[g]&&e.values[g][_]?e.values[g][_].type:null,x=i(_+1)+(g+1),S="sharedFormula"===w?e.values[g][_].si:void 0;y.push({style:function(t){return t.cellIndex=this.cellIndex,h(e,t,this.rowIndex-1,this.columnIndex.toUpperCase().charCodeAt()-65),d(e,this.cellIndex,this.rowIndex-1,this.columnIndex.toUpperCase().charCodeAt()-65)},rowIndex:g+1,columnIndex:i(_+1),value:b,formula:C,cellIndex:x,sharedFormulaIndex:S,type:w,set:function(t,l){return p(e,g+1,_+1,t,l),this.value=e.values[g]&&e.values[g][_]?e.values[g][_].value:null,this.formula=e.values[g]&&e.values[g][_]?e.values[g][_].formula:void 0,this.type=e.values[g]&&e.values[g][_]?e.values[g][_].type:null,d(e,x,g,_)}})}return{style:function(i){return i.cellIndices=t,m(e,i,l),c(e,t,l,r,n,o,s)},cellIndices:t,cells:y,set:function(i,f){var d=[];if(!(i&&i.length&&s&&o))return c(e,t,l,r,n,o,s);if(a||u)for(var h=0;h<this.cells.length&&h<i.length;h++)d.push(i[h]);if(a)i=[d];else if(u)i=d;else{for(var d=[],h=0;h<i.length&&h<o;h++)if(i[h]){var m=[];if(i[h].length>s){for(var p=0;p<i[h].length&&p<s;p++)m.push(i[h][p]);i[h]=m}d.push(i[h])}else d.push([]);i=d}v(e,r,n,o,s,i,f,!1,a,u);var y=c(e,t,l,r,n,o,s);return this.cells=y.cells,y}}},h=function(e,t,l,r){var n=e._workBook.createStyles(),o=n.addStyles(t).index;e.values[l]||(e.values[l]=[]),e.values[l][r]||(e.values[l][r]={value:"",type:"string"}),e.values[l][r].styleIndex=o},m=function(e,t,l){for(var r=e._workBook.createStyles(),n=r.addStyles(t).index,o=0;o<l.length;o++)e.values[l[o].rowIndex]||(e.values[l[o].rowIndex]=[]),e.values[l[o].rowIndex][l[o].columnIndex]||(e.values[l[o].rowIndex][l[o].columnIndex]={type:"string",value:""}),e.values[l[o].rowIndex][l[o].columnIndex].styleIndex=n};n.prototype.sharedFormula=function(e,t,l,r){var n,o=[],s=[];if(e&&l&&t){var a;if("object"==typeof l&&!l.length){if(!l.formula)return;a=l.value,l=l.formula}var u=e.match(/\D+/)[0],f=e.match(/\d+/)[0];if(this._sheet._sharedFormula){n=this._sheet._sharedFormula[this._sheet._sharedFormula.length-1].si+1}else this._sheet._sharedFormula=[],n=0;this._sheet._sharedFormula.push({si:n,fromCell:e,toCell:t,formula:l});var d=u.toUpperCase().charCodeAt()-65,h=parseInt(f,10);this._sheet.values[h-1]||(this._sheet.values[h-1]=[]),this._sheet.values[h-1][d]={type:"sharedFormula",si:n,formula:l,range:e+":"+t,value:a},o.push(i(d+1)+h),s.push({rowIndex:h-1,columnIndex:d});var m,p;if(t&&(m=t.match(/\D+/)[0],p=t.match(/\d+/)[0]),p===f){var v=m.toUpperCase().charCodeAt()-65;for(d++;d<=v;d++)this._sheet.values[h-1][d]={type:"sharedFormula",si:n,value:a},o.push(i(d+1)+h),s.push({rowIndex:h-1,columnIndex:d})}else if(m===u){var y=parseInt(p,10);for(h++;h<=y;h++)this._sheet.values[h-1]||(this._sheet.values[h-1]=[]),o.push(i(d+1)+h),s.push({rowIndex:h-1,columnIndex:d}),this._sheet.values[h-1][d]={type:"sharedFormula",si:n,value:a}}if(r){r.cellIndices=o;var g;g=this._sheet._workBook.createStyles().addStyles(r);for(var _=0;_<s.length;_++)this._sheet.values[s[_].rowIndex][s[_].columnIndex].styleIndex=g.index}return c(this._sheet,o,s)}};var p=function(e,t,l,r,n){if(t&&l&&"number"==typeof t&&"number"==typeof l){if(n||void 0!==r&&null!==r)return n||"object"!=typeof r||r.type||void 0!==r.value&&null!==r.value?void 0===r||null===r?y(e,t,l,n):f(r,e,t,l,n):y(e,t,l,r);var o=i(l)+t;return d(e,o,t-1,l-1)}};n.prototype.cell=function(e,t,l,r){return p(this._sheet,e,t,l,r)},n.prototype.row=function(e,t,l,r){var n=this._sheet.values[e-1]?this._sheet.values[e-1].length-t+1:0;return v(this._sheet,e,t,1,l&&Array.isArray(l)?l.length:l?1:n,l?[l]:null,r,!0,!0,!1)},n.prototype.column=function(e,t,l,r){var n=0;return l&&l.length||(n=this._sheet.values&&this._sheet.values.length&&this._sheet.values.length>e?this._sheet.values.length-e+1:0),v(this._sheet,e,t,l&&Array.isArray(l)?l.length:l?1:n,1,l,r,!0,!1,!0)},n.prototype.grid=function(e,t,l,r){var n,o=0,s=0;if(l&&l.length)for(o=l.length,n=0;n<l.length;n++)l[n]&&l[n].length&&(s=s<l[n].length?l[n].length:s);else if(this._sheet.values&&this._sheet.values.length){o=this._sheet.values.length-e+1;for(var n=0;n<this._sheet.values.length;n++)this._sheet.values[n]&&this._sheet.values[n].length&&(s=s<this._sheet.values[n].length-t+1?this._sheet.values[n].length-t+1:s)}return v(this._sheet,e,t,o,s,l,r,!0,!1)},n.prototype.table=function(e,t,l,r){var n=g(this._sheet,this.xlsxContentTypes,e,t,l,r);return n?n.tableOptions():void 0},n.prototype.merge=function(e){return e&&"string"==typeof e?(this._sheet._mergeCells||(this._sheet._mergeCells=[]),this._sheet._mergeCells.push(e),this):this};var v=function(e,t,l,r,n,o,s,a,f,d){if(t&&l&&"number"==typeof t&&"number"==typeof l&&"number"==typeof r&&"number"==typeof n){for(var h=[],p=[],v=r,y=t-1;v>0;y++,v--){var g=n;e.values[y]||(e.values[y]=[]);for(var _=l-1;g>0;_++,g--)p.push(i(_+1)+(y+1)),h.push({rowIndex:y,columnIndex:_})}if(s||o){if(void 0===o||null===o){if(s.cellIndices=p,m(e,s,h),!a)return;return c(e,p,h,t,l,r,n,f,d)}if(u(o,e,t,l,s,p),!a)return;return c(e,p,h,t,l,r,n,f,d)}return c(e,p,h,t,l,r,n,f,d)}},y=function(e,t,l,r){var n=i(l-1)+t;return r.cellIndex=n,h(e,r,t-1,l-1),d(e,n,t-1,l-1)},g=function(t,l,r,n,o,s){var i=[],a=n.match(/\D+/)[0].toUpperCase().charCodeAt()-65,u=parseInt(n.match(/\d+/)[0],10),f=o.match(/\D+/)[0].toUpperCase().charCodeAt()-65,d=t.values[u-1];if(d){for(var c=a;c<=f;c++)i.push(d[c]&&d[c].value?d[c].value:"");var h=_("table",l,t);t.tables||(t.tables=[]);var m=e.addTable(r,n,o,i,h,s,t);return t.tables.push(m),m}},_=function(e,l,r){r._rels||(r._rels=t.createRelation("sheet"+r.sheetId+".xml.rels","workbook/sheets/_rels"));var n,o,i,a,u=s(r);switch(e){case"table":n="http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",o="../tables/table"+u+".xml",i="application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",a="/workbook/tables/table"+u+".xml";break;case"drawing":n="http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",o="../drawings/drawing"+u+".xml",i="application/vnd.openxmlformats-officedocument.drawing+xml",a="/workbook/drawings/drawing"+u+".xml"}return r._rels.addRelation("rId"+u,n,o),l.addContentType("Override",i,{PartName:a}),u};return{createSheet:function(e,t,l,r,o){return new n(e,t,l,r,o)}}}),n("utils",[],function(){return sortObject=function(e){if("object"!=typeof e||e.length)return e;var t={},l=[];for(var r in e)l.push(r);l.sort();for(var n in l)t[l[n]]=sortObject(e[l[n]]);return t},{stringify:function(e){return JSON.stringify(sortObject(e))}}}),n("oxml_xlsx_font",["utils"],function(e){var t=function(e){var t,r="";r+='<fonts count="'+e._fontsCount+'">';for(t in e._fonts){var n=JSON.parse(t);r+=l(n)}return r+="</fonts>"},l=function(e){var t="<font>";return t+=e.strike?"<strike/>":"",t+=e.italic?"<i/>":"",t+=e.bold?"<b/>":"",t+=e.underline?"<u/>":"",t+=e.size?'<sz val="'+e.size+'"/>':"",t+=e.color?'<color rgb="'+e.color+'"/>':"",t+=e.name?'<name val="'+e.name+'"/>':"",t+=e.family?'<family val="'+e.family+'"/>':"",t+=e.scheme?'<scheme val="'+e.scheme+'"/>':"",t+="</font>"},r=function(e){var t={};return t.bold=!!e.bold,t.italic=!!e.italic,t.underline=!!e.underline,t.size=e.fontSize||!1,t.color=e.fontColor||!1,t.name=e.fontName||!1,t.family=e.fontFamily||!1,t.scheme=e.scheme||!1,t.strike=!!e.strike,t},n=function(t,l){return l._fonts[e.stringify(t)]},o=function(e,t){for(var l,r=0,n=0,o=0;o<t.length;o++)for(var s=t[0];r<e.styles.length;r++)if((void 0!==e.styles[r].cellIndices[s]||null!==e.styles[r].cellIndices[s])&&(l=e.styles[r],n++,Object.keys(l.cellIndices).length!==t.length||n>1||0===l._font))return!1;return!!l&&l._font},s=function(t,l){var r=l._fontsCount++;return l._fonts[e.stringify(t)]=""+r,l._fonts[e.stringify(t)]},i=function(t,l,r){return u(t,l,r,!0),r._fonts[e.stringify(t)]=l,l},a=function(e,t){var l=r(e);if(t){for(var n in l)l[n]&&(t[n]=l[n]);return t}return l},u=function(t,l,r,n){var o;for(var s in r._fonts)if(r._fonts[s]===l){o=JSON.parse(s);break}n&&delete r._fonts[e.stringify(o)];for(var s in t)t[s]&&(o[s]=t[s]),t[s]=o[s];return t},f=function(e,t){var l,r=0;for(l=0;l<t.styles.length;l++)if(t.styles[l]._font===e&&(r+=Object.keys(t.styles[l].cellIndices).length)>1)return r;return r},d=function(e,t){var l,a=!1,u=r(t),f=e._fonts?n(u,e):null;return void 0!==f&&null!==f?l=f:a=!0,l||!1!==(f=o(e,t.cellIndices))&&(l=i(u,f,e)),void 0!==l&&null!==l||(l=s(u,e)),{font:u,fontIndex:l,newStyleCreated:a}};return{createTableFont:a,getFontForCell:function(e,t,l){var o,a=!1,d=r(t),c=e._fonts?n(d,e):null;if(void 0!==c&&null!==c?o=c:a=!0,l&&l._font){f(l._font,e)<=1?o=i(d,l._font,e):(d=u(d,l._font,e),c=n(d,e),void 0!==c&&null!==c?o=c:(o=null,a=!0))}return void 0!==o&&null!==o||(o=s(d,e)),{font:d,fontIndex:o,newStyleCreated:a}},getFontForCells:d,generateContent:t,generateSingleContent:l}}),n("oxml_xlsx_num_format",["utils"],function(e){var t=function(e){var t="";if(e._numFormats){t+='<numFmts count="'+Object.keys(e._numFormats).length+'">';var l;for(l in e._numFormats){var r=JSON.parse(l);t+='<numFmt numFmtId="'+e._numFormats[l]+'" formatCode="'+r.formatString+'"/>'}t+="</numFmts>"}return t},l=function(e){var t={};return t.formatString=e.numberFormat,t},r=function(t,l){return l._numFormats[e.stringify(t)]},n=function(t,l){l._numFormats||(l._numFormats={},l._numFormatsCount=200);var r=l._numFormatsCount++;return l._numFormats[e.stringify(t)]=""+r,l._numFormats[e.stringify(t)]},o=function(t,l,r){var n;for(var o in r._numFormats)if(r._numFormats[o]===l){n=JSON.parse(o);break}return t.formatString?(delete r._numFormats[e.stringify(n)],r._numFormats[e.stringify(t)]=l):t.formatString=n.formatString,l},s=function(e,t){var l,r=0;for(l=0;l<t.styles.length;l++)if(t.styles[l]._numFormat===e&&(r+=Object.keys(t.styles[l].cellIndices).length)>1)return r;return r},i=function(e,t){for(var l,r=0,n=0,o=0;o<t.length;o++)for(var s=t[0];r<e.styles.length;r++)if((void 0!==e.styles[r].cellIndices[s]||null!==e.styles[r].cellIndices[s])&&(l=e.styles[r],n++,Object.keys(l.cellIndices).length!==t.length||n>1))return!1;return!!l&&l._numFormat},a=function(e,t){var s,a=!1,u=l(t),f=e._numFormats?r(u,e):null;return void 0!==f&&null!==f?s=f:u.formatString&&(a=!0),s||!1!==(f=i(e,t.cellIndices))&&(s=o(u,f,e)),void 0!==s&&null!==s||!u.formatString||(s=n(u,e)),{numFormat:u,numFormatIndex:s||!1,newStyleCreated:a}};return{generateContent:t,getNumFormatForCell:function(e,t,i){var a,u=!1,f=l(t),d=e._numFormats?r(f,e):null;if(void 0!==d&&null!==d?a=d:f.formatString&&(u=!0),i&&i._numFormat){s(i._numFormat,e)<=1&&e._numFormats&&(a=o(f,i._numFormat,e))}return void 0!==a&&null!==a||!f.formatString||(a=n(f,e)),{numFormat:f,numFormatIndex:a||!1,newStyleCreated:u}},getNumFormatForCells:a}}),n("oxml_xlsx_border",["utils"],function(e){var t=function(e,t){if(e.style||e.color){return"<"+t+(e.style?' style="'+e.style+'"':"")+">"+(e.color?'<color rgb="'+e.color+'"/>':"")+"</"+t+">"}return"<"+t+"/>"},l=function(e){var t,l="";l+='<borders count="'+e._bordersCount+'">';for(t in e._borders){var n=JSON.parse(t);l+=n?r(n):"<border />"}return l+="</borders>"},r=function(e){var l="<border>";return l+=t(e.left,"left"),l+=t(e.right,"right"),l+=t(e.top,"top"),l+=t(e.bottom,"bottom"),l+=t(e.diagonal,"diagonal"),l+="</border>"},n=function(e){var t={};return!!e.border&&(t.left={color:!!e.border.left&&e.border.left.color||e.border.color||!1,style:!!e.border.left&&e.border.left.style||e.border.style||!1},t.top={color:!!e.border.top&&e.border.top.color||e.border.color||!1,style:!!e.border.top&&e.border.top.style||e.border.style||!1},t.bottom={color:!!e.border.bottom&&e.border.bottom.color||e.border.color||!1,style:!!e.border.bottom&&e.border.bottom.style||e.border.style||!1},t.right={color:!!e.border.right&&e.border.right.color||e.border.color||!1,style:!!e.border.right&&e.border.right.style||e.border.style||!1},t.diagonal={color:!!e.border.diagonal&&e.border.diagonal.color||e.border.color||!1,style:!!e.border.diagonal&&e.border.diagonal.style||e.border.style||!1},t.isValid=t.left.style||t.top.style||t.bottom.style||t.right.style||t.diagonal.style||t.left.color||t.top.color||t.bottom.color||t.right.color||t.diagonal.color,!!t.isValid&&t)},o=function(t,l){return l._borders[e.stringify(t)]},s=function(t,l){var r=l._bordersCount++;return l._borders[e.stringify(t)]=""+r,l._borders[e.stringify(t)]},i=function(e,t){for(var l,r=0,n=0,o=0;o<t.length;o++)for(var s=t[0];r<e.styles.length;r++)if((void 0!==e.styles[r].cellIndices[s]||null!==e.styles[r].cellIndices[s])&&(l=e.styles[r],n++,Object.keys(l.cellIndices).length!==t.length||n>1||0===l._border))return!1;return!!l&&l._border},a=function(t,l,r){return f(t,l,r,!0),r._borders[e.stringify(t)]=l,l},u=function(e,t){var l=n(e);if(t){for(var r in l)l[r]&&(l[r].color||l[r].style)&&(t[r]=l[r]);return t}return l},f=function(t,l,r,n){var o;for(var s in r._borders)if(r._borders[s]===l){o=JSON.parse(s);break}if(n&&delete r._borders[e.stringify(o)],t)for(var s in t)(t[s].color||t[s].style)&&(o[s]=t[s]),t[s]=o[s];else t=o;return t},d=function(e,t){var l,r=0;for(l=0;l<t.styles.length;l++)if(t.styles[l]._border===e&&(r+=Object.keys(t.styles[l].cellIndices).length)>1)return r;return r};return{createTableBorder:u,getBorderForCell:function(e,t,l){var r,i=!1,u=n(t),c=e._borders?o(u,e):null;if(void 0!==c&&null!==c?r=c:i=!0,l&&l._border&&l._border!==c){d(l._border,e)<=1&&(r=a(u,l._border,e))}return void 0!==r&&null!==r||(l&&l._border&&(u=f(u,l._border,e,!1)),r=s(u,e)),{border:u,borderIndex:r,newStyleCreated:i}},getBorderForCells:function(e,t){var l,r=!1,u=n(t),f=e._borders?o(u,e):null;return void 0!==f&&null!==f?l=f:r=!0,f=i(e,t.cellIndices),!1!==f&&(l=a(u,f,e)),void 0!==l&&null!==l||(l=s(u,e)),{border:u,borderIndex:l,newStyleCreated:r}},generateContent:l,generateSingleContent:r}}),n("oxml_xlsx_fill",["utils"],function(e){var t=function(e){var t,r="";r+='<fills count="'+e._fillsCount+'">';for(t in e._fills){var n=JSON.parse(t);r+=n?l(n):"<fill/>"}return r+="</fills>"},l=function(e){var t="<fill>";if(e.pattern){var l=e.pattern||"none",r=e.fgColor?'<fgColor rgb="'+e.fgColor+'"/>':"";r+=e.bgColor?'<bgColor rgb="'+e.bgColor+'"/>':"",t+='<patternFill patternType="'+l+'">'+r+"</patternFill>"}else if(e.gradient){var n=e.gradient.type?' type="'+e.gradient.type+'"':"",o=e.gradient.left?' left="'+e.gradient.left+'"':"",s=e.gradient.right?' right="'+e.gradient.right+'"':"",i=e.gradient.top?' top="'+e.gradient.top+'"':"",a=e.gradient.bottom?' bottom="'+e.gradient.bottom+'"':"",u=e.gradient.degree?' degree="'+e.gradient.degree+'"':""
;t+="<gradientFill"+n+o+s+i+a+u+">";for(var f=0;f<e.gradient.stops.length;f++)t+='<stop position="'+e.gradient.stops[f].position+'">',t+='<color rgb="'+e.gradient.stops[f].color+'"/></stop>';t+="</gradientFill>"}return t+"</fill>"},r=function(e){if(e.fill&&e.fill.pattern){var t={};return t.pattern=e.fill.pattern,t.fgColor=e.fill.foreColor||!1,t.bgColor=e.fill.backColor||e.fill.color||!1,t}if(e.fill&&e.fill.gradient&&e.fill.gradient.stops){var t={};t.gradient={},t.gradient.degree=e.fill.gradient.degree||!1,t.gradient.bottom=e.fill.gradient.bottom||!1,t.gradient.left=e.fill.gradient.left||!1,t.gradient.right=e.fill.gradient.right||!1,t.gradient.top=e.fill.gradient.top||!1,t.gradient.type=e.fill.gradient.type||!1,t.gradient.stops=[];for(var l=0;l<e.fill.gradient.stops.length;l++){var r={};r.position=e.fill.gradient.stops[l].position||0,r.color=e.fill.gradient.stops[l].color||!1,t.gradient.stops.push(r)}return t}return!1},n=function(t,l){return l._fills[e.stringify(t)]},o=function(t,l){var r=l._fillsCount++;return l._fills[e.stringify(t)]=""+r,l._fills[e.stringify(t)]},s=function(e,t){for(var l,r=0,n=0,o=0;o<t.length;o++)for(var s=t[0];r<e.styles.length;r++)if((void 0!==e.styles[r].cellIndices[s]||null!==e.styles[r].cellIndices[s])&&(l=e.styles[r],n++,Object.keys(l.cellIndices).length!==t.length||n>1||0===l._fill))return!1;return!!l&&l._fill},i=function(t,l,r){return u(t,l,r,!0),r._fills[e.stringify(t)]=l,l},a=function(e,t){return r(e)||t||!1},u=function(t,l,r,n){var o;for(var s in r._fills)if(r._fills[s]===l){o=JSON.parse(s);break}n&&delete r._fills[e.stringify(o)];for(var s in t)t[s]&&(o[s]=t[s]),t[s]=o[s];return t},f=function(e,t){var l,a=!1,u=r(t),f=e._fills?n(u,e):null;return void 0!==f&&null!==f?l=f:a=!0,l||!1!==(f=s(e,t.cellIndices))&&(l=i(u,f,e)),void 0!==l&&null!==l||(l=o(u,e)),{fill:u,fillIndex:l,newStyleCreated:a}},d=function(e,t){var l,r=0;for(l=0;l<t.styles.length;l++)if(t.styles[l]._fill===e&&(r+=Object.keys(t.styles[l].cellIndices).length)>1)return r;return r};return{createTableFill:a,generateContent:t,getFillForCell:function(e,t,l){var s,a=!1,f=r(t),c=e._fills?n(f,e):null;if(void 0!==c&&null!==c?s=c:a=!0,l&&l._fill&&f){d(l._fill,e)<=1&&(s=i(f,l._fill,e))}return void 0!==s&&null!==s||(l&&l._fill&&(f=u(f,l._fill,e,!1)),s=o(f,e)),!s&&l&&l._fill&&(s=l._fill),{fill:f,fillIndex:s,newStyleCreated:a}},getFillForCells:f,generateSingleContent:l}}),n("oxml_xlsx_styles",["utils","oxml_xlsx_font","oxml_xlsx_num_format","oxml_xlsx_border","oxml_xlsx_fill","xmlContentString","contentFile"],function(e,t,l,r,n,o,s){"use strict";var i=function(t,l,r){var n=f(t,l,r),o={sheetId:n,fileName:"style"+n+".xml",styles:[],_fonts:{},_borders:{},_fills:{},_fontsCount:1,_bordersCount:1,_fillsCount:2},s={bold:!1,italic:!1,underline:!1,size:!1,color:!1,strike:!1,family:!1,name:!1,scheme:!1};o._fonts[e.stringify(s)]=0,o._borders[!1]=0,o._fills[!1]=0;var i={pattern:"gray125",fgColor:!1,bgColor:!1};o._fills[e.stringify(i)]=1,this.className="Style",this.fileName=o.fileName,this.folderName="workbook",this._styles=o};i.prototype=Object.create(s.prototype),i.prototype.generateContent=function(){var e=new o({rootNode:"styleSheet",nameSpaces:["http://schemas.openxmlformats.org/spreadsheetml/2006/main"]}),s="",i=0;for(s+=l.generateContent(this._styles),s+=t.generateContent(this._styles),s+=n.generateContent(this._styles),s+=r.generateContent(this._styles),s+='<cellStyleXfs count="1"><xf /></cellStyleXfs>',s+='<cellXfs count="'+(parseInt(this._styles.styles.length,10)+1)+'"><xf />',i=0;i<this._styles.styles.length;i++){var u=this._styles.styles[i]._numFormat?' numFmtId="'+this._styles.styles[i]._numFormat+'" ':"",f=this._styles.styles[i]._border?' borderId="'+this._styles.styles[i]._border+'" ':"",d=this._styles.styles[i]._fill?' fillId="'+this._styles.styles[i]._fill+'" ':"",c=this._styles.styles[i]._hAlignment||this._styles.styles[i]._vAlignment?"><alignment"+(this._styles.styles[i]._vAlignment?' vertical="'+this._styles.styles[i]._vAlignment+'"':"")+(this._styles.styles[i]._hAlignment?' horizontal="'+this._styles.styles[i]._hAlignment+'"':"")+"/>":"";s+='<xf fontId="'+this._styles.styles[i]._font+'" '+u+f+d+(c?c+"</xf>":" />")}var h="";return this._styles.tableStyles&&this._styles.tableStyles.length&&(h=a(this._styles)),s+="</cellXfs>"+h,e.format(s)};var a=function(e){for(var t,l=0,r="",n=0,o="",s=0;s<e.tableStyles.length;s++){var i;l++,n++,t=1,o+=u(e.tableStyles[s]),i='<tableStyleElement dxfId="'+(l-1)+'" type="wholeTable"/>',e.tableStyles[s].evenColumn&&(l++,t++,i+='<tableStyleElement dxfId="'+(l-1)+'" type="secondColumnStripe"/>',o+=u(e.tableStyles[s].evenColumn)),e.tableStyles[s].oddColumn&&(l++,t++,i+='<tableStyleElement dxfId="'+(l-1)+'" type="firstColumnStripe"/>',o+=u(e.tableStyles[s].oddColumn)),e.tableStyles[s].evenRow&&(l++,t++,i+='<tableStyleElement dxfId="'+(l-1)+'" type="secondRowStripe"/>',o+=u(e.tableStyles[s].evenRow)),e.tableStyles[s].oddRow&&(l++,t++,i+='<tableStyleElement dxfId="'+(l-1)+'" type="firstRowStripe"/>',o+=u(e.tableStyles[s].oddRow)),e.tableStyles[s].firstColumn&&(l++,t++,i+='<tableStyleElement dxfId="'+(l-1)+'" type="firstColumn"/>',o+=u(e.tableStyles[s].firstColumn)),e.tableStyles[s].lastColumn&&(l++,t++,i+='<tableStyleElement dxfId="'+(l-1)+'" type="lastColumn"/>',o+=u(e.tableStyles[s].lastColumn)),e.tableStyles[s].firstRow&&(l++,t++,i+='<tableStyleElement dxfId="'+(l-1)+'" type="headerRow"/>',o+=u(e.tableStyles[s].firstRow)),e.tableStyles[s].lastRow&&(l++,t++,i+='<tableStyleElement dxfId="'+(l-1)+'" type="totalRow"/>',o+=u(e.tableStyles[s].lastRow)),e.tableStyles[s].firstRowFirstCell&&(l++,t++,i+='<tableStyleElement dxfId="'+(l-1)+'" type="firstHeaderCell"/>',o+=u(e.tableStyles[s].firstRowFirstCell)),e.tableStyles[s].firstRowLastCell&&(l++,t++,i+='<tableStyleElement dxfId="'+(l-1)+'" type="lastHeaderCell"/>',o+=u(e.tableStyles[s].firstRowLastCell)),e.tableStyles[s].lastRowFirstCell&&(l++,t++,i+='<tableStyleElement dxfId="'+(l-1)+'" type="firstTotalCell"/>',o+=u(e.tableStyles[s].lastRowFirstCell)),e.tableStyles[s].lastRowLastCell&&(l++,t++,i+='<tableStyleElement dxfId="'+(l-1)+'" type="lastTotalCell"/>',o+=u(e.tableStyles[s].lastRowLastCell)),r+='<tableStyle count="'+t+'" name="'+e.tableStyles[s].name+'">'+i+"</tableStyle>"}return r='<tableStyles count="'+n+'">'+r+"</tableStyles>",o='<dxfs count="'+l+'">'+o+"</dxfs>"+r},u=function(e){var l="<dxf>";return e.font&&(l+=t.generateSingleContent(e.font)),e.fill&&(l+=n.generateSingleContent(e.fill)),e.border&&(l+=r.generateSingleContent(e.border)),l+="</dxf>"},f=function(e,t,l){var r=e.getLastSheet(),n=parseInt((r.Id||"rId0").replace("rId",""),10)+1;return l.addContentType("Override","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",{PartName:"/workbook/style"+n+".xml"}),t.addRelation("rId"+n,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles","style"+n+".xml"),n},d=function(e,t){for(var l=0;l<e.styles.length;l++)if(void 0!==e.styles[l].cellIndices[t]&&null!==e.styles[l].cellIndices[t])return e.styles[l];return null},c=function(e,t){for(var l=0;l<e.styles.length;l++)if(e.styles[l]._font===t._font&&e.styles[l]._numFormat===t._numFormat)return e.styles[l];return null},h=function(e){if(e.hAlignment)switch(e.hAlignment.toLowerCase()){case"left":e.hAlignment="left";break;case"center":e.hAlignment="center";break;case"right":e.hAlignment="right";break;default:e.hAlignment=void 0}if(e.vAlignment)switch(e.vAlignment.toLowerCase()){case"top":e.vAlignment="top";break;case"center":e.vAlignment="center";break;default:e.vAlignment=void 0}return e};i.prototype.addStyles=function(e){if(e=h(e),e.cellIndex||e.cellIndices){var o,s,i,a,u,f=!1;if(e.cellIndex){if(o=d(this._styles,e.cellIndex),s=t.getFontForCell(this._styles,e,o),i=l.getNumFormatForCell(this._styles,e,o),a=r.getBorderForCell(this._styles,e,o),u=n.getFillForCell(this._styles,e,o),f=f||s.newStyleCreated||a.newStyleCreated||u.newStyleCreated||e.hAlignment||e.vAlignment,o){if(o._font===s.fontIndex&&o._numFormat===i.numFormatIndex&&o._border===a.borderIndex&&o._fill===u.fillIndex)return o;if(1===Object.keys(o.cellIndices).length)return o._font=s.fontIndex,o._numFormat=i.numFormatIndex,o._border=a.borderIndex,o._fill=u.fillIndex,o._hAlignment=e.hAlignment,o._vAlignment=e.vAlignment,o;delete o.cellIndices[e.cellIndex]}return!f&&(o=c(this._styles,{_font:s.fontIndex,_numFormat:i.numFormatIndex,_border:a.borderIndex,_fill:u.fillIndex,_hAlignment:e.hAlignment,_vAlignment:e.vAlignment}))?(o.cellIndices[e.cellIndex]=Object.keys(o.cellIndices).length,o):(o={_font:s.fontIndex,_numFormat:i.numFormatIndex||!1,_border:a.borderIndex,_fill:u.fillIndex,_hAlignment:e.hAlignment,_vAlignment:e.vAlignment,cellIndices:{}},o.cellIndices[e.cellIndex]=0,o.index=""+(parseInt(this._styles.styles.length,10)+1),this._styles.styles.push(o),o)}if(e.cellIndices){var m;if(s=t.getFontForCells(this._styles,e),i=l.getNumFormatForCells(this._styles,e),a=r.getBorderForCells(this._styles,e),u=n.getFillForCells(this._styles,e),!(f=f||s.newStyleCreated||i.newStyleCreated||a.newStyleCreated||u.newStyleCreated||e.hAlignment||e.vAlignment)&&(o=c(this._styles,{_font:s.fontIndex,_numFormat:i.numFormatIndex,_border:a.borderIndex,_fill:u.fillIndex,_hAlignment:e.hAlignment,_vAlignment:e.vAlignment}))){for(m=0;m<e.cellIndices.length;m++){var p=e.cellIndices[m],v=d(this._styles,p);v&&delete v.cellIndices[p],o.cellIndices[p]=Object.keys(o.cellIndices).length}return o}for(o={_font:s.fontIndex,_numFormat:i.numFormatIndex,_border:a.borderIndex,_fill:u.fillIndex,_hAlignment:e.hAlignment,_vAlignment:e.vAlignment,cellIndices:{}},m=0;m<e.cellIndices.length;m++){var p=e.cellIndices[m],v=d(this._styles,p);if(v&&delete v.cellIndices[p],o.cellIndices[p]=Object.keys(o.cellIndices).length,v&&!Object.keys(v.cellIndices).length){for(var y in o)v[y]=o[y];return v}}return o.index=""+(parseInt(this._styles.styles.length,10)+1),this._styles.styles.push(o),o}}},i.prototype.addTableStyle=function(e,t,l){this._styles.tableStyles||(this._styles.tableStyles=[]);var r;if(l&&l.tableStyle)for(var n=0;n<this._styles.tableStyles.length;n++)if(l.tableStyle.name===this._styles.tableStyles[n].name){r=this._styles.tableStyles[n];break}var o=m(e,r);if(o.name=t,e.evenColumn?o.evenColumn=m(e.evenColumn,r&&r.evenColumn):r&&r.evenColumn&&(o.evenColumn=r.evenColumn),e.oddColumn?o.oddColumn=m(e.oddColumn,r&&r.oddColumn):r&&r.oddColumn&&(o.oddColumn=r.oddColumn),e.evenRow?o.evenRow=m(e.evenRow,r&&r.evenRow):r&&r.evenRow&&(o.evenRow=r.evenRow),e.oddRow?o.oddRow=m(e.oddRow,r&&r.oddRow):r&&r.oddRow&&(o.oddRow=r.oddRow),e.firstColumn?o.firstColumn=m(e.firstColumn,r&&r.firstColumn):r&&r.firstColumn&&(o.firstColumn=r.firstColumn),e.lastColumn?o.lastColumn=m(e.lastColumn,r&&r.lastColumn):r&&r.lastColumn&&(o.lastColumn=r.lastColumn),e.firstRow?o.firstRow=m(e.firstRow,r&&r.firstRow):r&&r.firstRow&&(o.firstRow=r.firstRow),e.lastRow?o.lastRow=m(e.lastRow,r&&r.lastRow):r&&r.lastRow&&(o.lastRow=r.lastRow),e.firstRowFirstCell?o.firstRowFirstCell=m(e.firstRowFirstCell,r&&r.firstRowFirstCell):r&&r.firstRowFirstCell&&(o.firstRowFirstCell=r.firstRowFirstCell),e.firstRowLastCell?o.firstRowLastCell=m(e.firstRowLastCell,r&&r.firstRowLastCell):r&&r.firstRowLastCell&&(o.firstRowLastCell=r.firstRowLastCell),e.lastRowFirstCell?o.lastRowFirstCell=m(e.lastRowFirstCell,r&&r.lastRowFirstCell):r&&r.lastRowFirstCell&&(o.lastRowFirstCell=r.lastRowFirstCell),e.lastRowLastCell?o.lastRowLastCell=m(e.lastRowLastCell,r&&r.lastRowLastCell):r&&r.lastRowLastCell&&(o.lastRowLastCell=r.lastRowLastCell),r){for(var n=0;n<this._styles.tableStyles.length;n++)if(l.tableStyle.name===this._styles.tableStyles[n].name){this._styles.tableStyles[n]=o;break}}else this._styles.tableStyles.push(o);return o};var m=function(e,l){var o={};return o.font=t.createTableFont(e,l?l.font:null),o.fill=n.createTableFill(e,l?l.fill:null),o.border=r.createTableBorder(e),o};return{createStyle:function(e,t,l){return new i(e,t,l)}}}),n("oxml_workbook",["oxml_rels","oxml_sheet","oxml_xlsx_styles","xmlContentString","contentString","contentFile"],function(e,t,l,r,n,o){"use strict";var s=function(t,l){this.className="Workbook",this.fileName="workbook.xml",this.folderName="workbook",this._workBook={sheets:[],xlsxContentTypes:t,xlsxRels:l,_rels:e.createRelation("workbook.xml.rels","workbook/_rels")}};s.prototype=Object.create(o.prototype);var i=function(e){if(e._sharedStrings&&Object.keys(e._sharedStrings).length){var t=new r({rootNode:"sst",nameSpaces:["http://schemas.openxmlformats.org/spreadsheetml/2006/main"]}),l="";for(var n in e._sharedStrings)l+="<si><t>"+n+"</t></si>";return t.format(l)}return""};return s.prototype.generateContent=function(e){var t,l=new r({rootNode:"workbook",nameSpaces:["http://schemas.openxmlformats.org/spreadsheetml/2006/main",{value:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",attribute:"r"}]}),o="<sheets>";for(t=0;t<this._workBook.sheets.length;t++){o+=new n('<sheet name="{0}" sheetId="{1}" r:id="{2}"/>').format(this._workBook.sheets[t]._sheet.sheetName,this._workBook.sheets[t]._sheet.sheetId,this._workBook.sheets[t]._sheet.rId),e&&this._workBook.sheets[t].attach(e)}return o+="</sheets>",l.format(o)},s.prototype.getLastSheet=function(){return this._workBook._rels.relations.length?this._workBook._rels.relations[this._workBook._rels.relations.length-1]:{}},s.prototype.addSheet=function(e){var l=this.getLastSheet(),r=parseInt((l.Id||"rId0").replace("rId",""),10)+1;e=e||"sheet"+r,this._workBook._rels.addRelation("rId"+r,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","sheets/sheet"+r+".xml");var n=t.createSheet(e,r,"rId"+r,this,this._workBook.xlsxContentTypes);return this._workBook.sheets.push(n),this._workBook.xlsxContentTypes.addContentType("Override","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",{PartName:"/workbook/sheets/sheet"+r+".xml"}),n},s.prototype.attachChild=function(e){this._workBook._rels.attach(e);var t=i(this._workBook);t&&e.addFile(t,"sharedstrings.xml","workbook"),this._workBook._styles&&this._workBook._styles.attach(e)},s.prototype.createSharedString=function(e){if(e){if(!this._workBook._sharedStrings){this._workBook._sharedStrings={},this._workBook.xlsxContentTypes.addContentType("Override","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",{PartName:"/workbook/sharedstrings.xml"});var t=this.getLastSheet(),l=parseInt((t.Id||"rId0").replace("rId",""),10)+1;this._workBook._rels.addRelation("rId"+l,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings","sharedstrings.xml")}return isNaN(this._workBook._sharedStrings[e])&&(this._workBook._sharedStrings[e]=Object.keys(this._workBook._sharedStrings).length||0),this._workBook._sharedStrings[e]}},s.prototype.getSharedString=function(e){return this._workBook._sharedStrings[e]},s.prototype.createStyles=function(){return this._workBook._styles||(this._workBook._styles=l.createStyle(this,this._workBook._rels,this._workBook.xlsxContentTypes)),this._workBook._styles},{createWorkbook:function(e,t){return new s(e,t)}}}),n("oxml_xlsx",["fileHandler","oxml_content_types","oxml_rels","oxml_workbook"],function(l,r,n,o){"use strict";var s={},i=function(r,n,o){try{var s,i;if("undefined"==typeof window)s=e(),i=t;else if("undefined"==typeof JSZip){if(n)n("Err: JSZip reference not found.");else if("undefined"!=typeof Promise)return new Promise(function(e,t){t("Err: JSZip reference not found.")})}else s=new JSZip;var a=(new l).createFile(s,i);return o.contentTypes.attach(a),o._rels.attach(a),o.workBook.attach(a),a.saveFile(r,n)}catch(e){if(n)n("Err: Not able to create Workbook.");else if("undefined"!=typeof Promise)return new Promise(function(e,t){t("Err: Not able to create Workbook.")})}},a=function(){var e={};e.contentTypes=r.createContentType(),e.contentTypes.addContentType("Default","application/vnd.openxmlformats-package.relationships+xml",{Extension:"rels"}),e.contentTypes.addContentType("Default","application/xml",{Extension:"xml"}),e.contentTypes.addContentType("Override","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",{PartName:"/workbook/workbook.xml"}),e._rels=n.createRelation(".rels","_rels"),e._rels.addRelation("rId1","http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument","workbook/workbook.xml"),e.workBook=o.createWorkbook(e.contentTypes,e._rels);var t=function(t,l){return i(t,l,e)};return{_xlsx:e,sheet:e.workBook.addSheet.bind(e.workBook),download:t}};return s.xlsx=a,"undefined"==typeof window||window.oxml||(window.oxml=s),s}),r("oxml_xlsx")});