/*!
 * 
 * Spread.Sheets Library 11.0.0
 * 
 * Copyright(c) GrapeCity, Inc.  All rights reserved.
 * 
 * Licensed under the SpreadJS Commercial License.
 * us.sales@grapecity.com
 * http://www.grapecity.com/en/licensing/grapecity/
 * 
 * 
 */
var GC=GC||{};GC.Spread=GC.Spread||{},GC.Spread.Sheets=GC.Spread.Sheets||{},GC.Spread.Sheets.OutlineColumn=function(a){var b={};function c(d){if(b[d])return b[d].exports;var e=b[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,c),e.loaded=!0,e.exports}return c.m=a,c.c=b,c.p="/assets/",c(0)}([function(a,b,c){!function(){"use strict";var b=c(1);c(4),a.exports=b}()},function(a,b,c){!function(){"use strict";var b,d,e,f,g,h=c(2),i=c(3),j=c(4).commands,k=c(4).outlineColumnCheckStatus,l=i.k,m=l.ac,n=h.GC$,o=n.each,p=n.isEmptyObject,q=i.j.Fa,r=5,s=6,t=6,u=3,v=16,w=16,x=16,y=16,z=void 0,A={columnIndex:z,showCheckBox:!1,showImage:!1,images:z,showIndicator:!0,expandIndicator:z,collapseIndicator:z,maxLevel:10};function B(a){return a.expandIndicator||a.collapseIndicator}function C(a,b){return a.outlineColumn&&a.outlineColumn.options()&&a.outlineColumn.options().columnIndex===b}function D(a,b,c){var d=b.x+c.x,e=c.y+c.height/2-b.height/2,f=b.height,g=b.width;c.x+c.width<d+g||(a.save(),a.beginPath(),a.strokeStyle="black",a.strokeRect(d,e,g,f),a.fillStyle="white",a.fillRect(d,e,g,f),b.checkStatus&&(a.beginPath(),a.lineWidth=g/5,a.moveTo(d+g/6,e+f/2),a.lineTo(d+2*g/5,e+5/7*f),a.lineTo(d+5/6*g,e+f/6),a.stroke()),a.restore())}function E(a,b,c,d){var e=b.collapsed,f=b.x+c.x,g=c.y+c.height/2-b.height/2,h=b.height,i=b.width;c.x+c.width<f+i||(e?b.expandIndicator?F(a,b.expandIndicator,b,c,d):(a.save(),a.fillStyle="black",a.beginPath(),a.moveTo(f,g),a.lineTo(f,g+h),a.lineTo(f+i,g+h/2),a.fill(),a.restore()):b.collapseIndicator?F(a,b.collapseIndicator,b,c,d):(a.save(),a.fillStyle="black",a.beginPath(),a.moveTo(f,g+h),a.lineTo(f+i,g+h),a.lineTo(f+i,g),a.fill(),a.restore()))}function F(a,b,c,d,e){var f,g=c.x+d.x,h=d.y+d.height/2-c.height/2,i=c.width,j=c.height;if(!(d.x+d.width<g+i)&&b&&"none"!==b&&e)try{e.ko(b)?(f=e.lo(b),a.drawImage(f,g,h,i,j)):e.fo(b)}catch(a){}}function G(a,b,c){var d,e=a.rowOutlines.getLevel(b);q(c)&&(c=!a.rowOutlines.getCollapsed(b)),d={cmd:"expandRowOutline",collapsed:c,index:b,level:e+1,sheetName:a.name()},a.wu().execute(d)}function H(a,b,c,d){q(d)&&(d=!a.outlineColumn.getCheckStatus(b));var e={cmd:"updateOutlineColumnCheckStatus",row:b,col:c,status:d,sheetName:a.name()};a.wu().execute(e)}function I(a,b,c){var d,e,f,g=a.getLevel(b);if(c!==g+1)for(d=c-(g+1),e=0,f=Math.abs(d);e<f;e++)d>0?a.group(b,1):a.ungroupRange(b,1)}function J(a,b,c,d,e,f,g){var h,i,j,k,l,m,n,o,p=K(c,"showIndicator");p?(h=a._zoomFactor,i=a.getRowCount(),j=!!a.rowOutlines.isCollapsed(b+1),k=r*h,l=s*h,m=null,n=null,c.expandIndicator&&(m=c.expandIndicator,j&&(k=x*h,l=y*h)),c.collapseIndicator&&(n=c.collapseIndicator,j||(k=x*h,l=y*h)),b<i-1&&(o=a.getStyle(b+1,d),o&&o.textIndent>e?g.indicator={x:f.value+u*h,y:-l/2,width:k,height:l,collapsed:j,collapseIndicator:n,expandIndicator:m}:delete g.indicator),f.value+=2*u*h+k):delete g.indicator}function K(a,b){return q(a[b])?A[b]:a[b]}function L(a,b,c,d,e,f){var g,h,i,j=q(c.showCheckBox)?A.showCheckBox:c.showCheckBox;j?(g=a.Mp(),h=!q(f.checkBox)&&(f.checkBox.checkStatus||!!g.getValueForKey(b,d,k)),i=a._zoomFactor,f.checkBox={x:e.value+u*i,y:-t*i,width:2*t*i,height:2*t*i,checkStatus:h},e.value+=2*u*i+2*t*i):delete f.checkBox}function M(a,b,c,d,e){var f,g,h,i,j,k=q(c.showImage)?A.showImage:c.showImage;k?(f=c.images,g=a._zoomFactor,f&&f.length&&(h=b>f.length-1?f[f.length-1]:f[b],i=d.value+u*g,j=0,e.images={image:h,x:i,y:j,width:v*g,height:w*g},d.value+=2*u*g+v*g)):delete e.images}function N(a,b,c){var d,e,f,g,h=a.outlineColumn.options(),i=h.columnIndex;if(!q(i))return d={value:0},e=0,f=a.getStyle(b,i),f&&f.textIndent&&(e=f.textIndent),0!==b&&(g=a.rowOutlines.getLevel(b-1),e-g>=3&&(e=g+2)),d.value+=8*e,I(a.rowOutlines,b,e),J(a,b,h,i,e,d,c),L(a,b,h,i,d,c),M(a,e,h,d,c),c.cellContent={left:d.value,x:d.value,y:0,width:-d.value,height:0},c}b=function(a){this.kj=a,this.outlineColumnOptions={},this.$e=0},b.prototype={LRa:function(a,b){return this.ZQa(b)?this.Kia.QR[a].cellContent.left:null},options:function(a){var b=this,c=b.YQa;return m(arguments)?(b.YQa=a,b.refresh(),b):c},refresh:function(){var a=this.kj;q(this.YQa)||q(this.YQa.columnIndex)||0===this.$e&&(a.suspendPaint(),a.outlineColumn.Kia.updateModel(),a.resumePaint())},setCheckStatus:function(a,b){var c=this.YQa.columnIndex;q(c)||H(this.kj,a,c,b)},getCheckStatus:function(a){var b,c;if(m(arguments))return this.kj.outlineColumn.Kia.getCheckStatus(a);for(b=[],c=this.kj.getRowCount(),a=0;a<c;a++)b[a]=this.kj.outlineColumn.Kia.getCheckStatus(a);return b},setCollapsed:function(a,b){G(this.kj,a,b)},getCollapsed:function(a){var b,c;if(m(arguments))return this.kj.outlineColumn.Kia.getCollapsed(a);for(b=[],c=this.kj.getRowCount(),a=0;a<c;a++)b[a]=this.kj.outlineColumn.Kia.getCollapsed(a);return b},XQa:function(a){return this.YQa&&this.YQa.columnIndex===a},ZQa:function(){return this.YQa&&!q(this.YQa.columnIndex)},Lia:function(){this.$e++},Mia:function(){this.$e>0&&this.$e--,0===this.$e&&this.refresh()},Nia:function(a,b){this.kj.outlineColumn.Kia.insertRows(a,b)},Oia:function(){return A},Pia:function(){return{TRIANGLE_HEIGHT:r,TRIANGLE_BASE:s,CHECKBOX_RADIUS:t,GAP:u,IMAGE_WIDTH:v,IMAGE_HEIGHT:w,INDICATOR_IMAGE_WIDTH:x,INDICATOR_IMAGE_HEIGHT:y}},Gka:function(a){var b,c,d=this;for(b in a)a.hasOwnProperty(b)&&(c=d.Kia.QR[b]=d.Kia.QR[b]||{},c.checkBox={checkStatus:a[b].checked})}},d=function(){function a(a){var b=this;b.kj=a,b.QR={}}var b={updateIndicatorCollapsed:function(a,b){var c=this;q(c.QR[a])||q(c.QR[a].indicator)||(c.QR[a].indicator.collapsed=b)},updateCheckStatus:function(a,b){var c=this;q(c.QR[a])||(c.QR[a].checkBox.checkStatus=b)},getCheckStatus:function(a){var b=this;return q(b.QR[a])||q(b.QR[a].checkBox)?null:b.QR[a].checkBox.checkStatus},getCollapsed:function(a){var b=this;return!q(b.QR[a])&&!q(b.QR[a].indicator)&&b.QR[a].indicator.collapsed},updateModel:function(){var a,b=this,c=b.kj,d=c.getRowCount();for(c.rowOutlines.direction(0),a=0;a<d;a++)b.QR[a]=b.QR[a]||{},N(c,a,b.QR[a])},insertRows:function(a,b){var c,d,e,f=this.kj,g=f.outlineColumn.options();q(g)||(c=g.columnIndex,q(c)||(d=f.getStyle(a-1,c),e=0,d&&d.textIndent&&(e=d.textIndent),f.getRange(a,c,b,1).textIndent(e)))}};return n.extend(a.prototype,b),a}(),e={init:function(){var a=this;a.outlineColumn=new b(a),a.outlineColumn.Kia=new d(a)},toJson:function(a){var b,c,d,e,f,g,h;function i(a,b){var c=A[a];return c===b}if(b=this.outlineColumn.YQa,c=this.outlineColumn.Kia.QR,!q(b)){if(d={},o(A,function(a){e=b[a],q(e)||i(a,e)||(d[a]=e)}),f={},b.showCheckBox)for(g in c)c.hasOwnProperty(g)&&(h=c[g].checkBox.checkStatus,h&&(f[g]={checked:h}));p(f)||(d.data=f),a.outlineColumnOptions=d}},fromJson:function(a){var b,c,d,e=a.outlineColumnOptions,f=this;if(e){if(e.kj=f,b=e.data){c={};for(d in e)"data"!==d&&(c[d]=e[d]);this.outlineColumn.Gka(b)}this.outlineColumn.options(q(c)?e:c),this.outlineColumn.refresh()}},onLayoutChanged:function(a){var b,c,d=this,e=a.changeType,f=a.rowCount,g=a.row;if("addRows"===e)d.outlineColumn.Nia(g,f),d.outlineColumn.refresh();else if("deleteRows"===e)d.outlineColumn.refresh();else if("zoomSheet"===e)d.outlineColumn.refresh();else if("invalidateLayout"===e&&d.outlineColumn.Kia.QR&&!p(d.outlineColumn.Kia.QR)&&d.rowOutlines.items&&!p(d.rowOutlines.items)){b=d.rowOutlines.items;for(c in b)b.hasOwnProperty(c)&&d.outlineColumn.Kia.updateIndicatorCollapsed(parseInt(c),d.rowOutlines.isCollapsed(parseInt(c)+1))}},sortRangeChanged:function(a){for(var b=this.outlineColumn,c=a.column,d=a.columnCount,e=c;b.XQa(e)&&e<=c+d;)b.refresh(),e+=1}},h.Worksheet.$n("outlineColumn",e),f={paintCellPadding:function(a){var b,c=a.options.rect,d=a.options.context.sheet,e=a.options.context,f=e.row,g=e.col,h=a.ctx;C(d,g)&&c.width>0&&c.height>0&&(b=d.outlineColumn.Kia.QR[f],b&&(h.save(),b.indicator&&E(h,b.indicator,c,e.imageLoader),b.checkBox&&D(h,b.checkBox,c),b.images&&F(h,b.images.image,b.images,c,e.imageLoader),h.restore(),b.cellContent&&(c.x+=b.cellContent.left,c.width-=b.cellContent.left)))},getCellPaddingRect:function(a){var b,c=a.options.rect,d=a.options.context.sheet,e=a.options.context,f=e.row,g=e.col;C(d,g)&&c.width>0&&c.height>0&&(b=d.outlineColumn.Kia.QR[f],b&&b.cellContent&&(c.x+=b.cellContent.left,c.width-=b.cellContent.left))},getCellPaddingHitInfo:function(a){var b,c,d=a.context.sheet,e=a.context.col,f=a.context.row,g=a.x,h=a.y,i=a.cellRect;a.paddingHitInfo=null,C(d,e)&&(b=d.outlineColumn.Kia.QR[f],b&&(b.indicator&&(c=b.indicator.x,g>=b.indicator.x+i.x&&g<b.indicator.x+i.x+b.indicator.width&&(a.paddingHitInfo={x:g,y:h,row:f,col:e,outlineColumnHitInfo:{indicator:!0}})),b.checkBox&&(c||(c=b.checkBox.x),g>=b.checkBox.x+i.x&&g<b.checkBox.x+i.x+b.checkBox.width&&(a.paddingHitInfo={x:g,y:h,row:f,col:e,outlineColumnHitInfo:{checkBox:!0}})),b.images&&(c||(c=b.images.x),g>=b.images.x+i.x&&g<b.images.x+i.x+b.images.width&&(a.paddingHitInfo={x:g,y:h,row:f,col:e,outlineColumnHitInfo:{image:!0}})),c&&g>=i.x&&g<i.x+c&&(a.paddingHitInfo={x:g,y:h,row:f,col:e,outlineColumnHitInfo:{blank:!0}})))},processMouseDownOnCellPadding:function(a){var b=a.sheet,c=a.row,d=a.col,e=a.outlineColumnHitInfo;q(e)||(e.indicator?G(b,c):e.checkBox?H(b,c,d):e.image||e.blank)},getOutlineColumnOffset:function(a){var b,c=a.context.sheet,d=a.context.col;C(c,d)&&(b=c.outlineColumn.options(),K(b,"showIndicator")&&(a.value+=u,B(b)?a.value+=x:a.value+=r,a.value+=u),K(b,"showCheckBox")&&(a.value+=u,a.value+=2*t,a.value+=u),K(b,"showImage")&&(a.value+=u,a.value+=v,a.value+=u))}},h.CellTypes.Base.$n("outlineColumn",f),g={init:function(){j.$Qa(this.commandManager())}},h.Workbook.$n("outlineColumn",g),a.exports={OutlineColumn:b}}()},function(a,b){a.exports=GC.Spread.Sheets},function(a,b){a.exports=GC.Spread.Common},function(a,b,c){!function(){"use strict";var b,d,e,f=c(2),g=c(3),h=f.GC$,i=f.Commands,j=i.ActionBase,k=g.j.Fa,l="increaseCellIndent",m="decreaseCellIndent",n="updateOutlineColumnCheckStatus",o="outlineColumnCheckStatus",p=i.h4;function q(a,b,c,d){return r(a,b,c,d)}function r(a,b,c,d){var e,f,g,h,i,j,l,m,n,o,p=k(d)?a.getActiveColumnIndex():d;if(!a.outlineColumn.XQa(p))return null;if(e=b?1:-1,f=a.getActiveRowIndex(),g=a.getSelections()[0].rowCount,i=!0,k(c))for(c={},i=!1,h=f;h<g+f;h++)0!==h&&(j=a.rowOutlines.getLevel(h),b&&(l=a.rowOutlines.getLevel(h-1),j>l&&!c[h-1])||(m=j+e,n=a.outlineColumn.options(),o=k(n.maxLevel)?a.outlineColumn.Oia().maxLevel:n.maxLevel,o&&m+1>o||m+1<0||(c[h]={row:h,original:j+1,current:m+1},i=!0)));return i?c:null}function s(a,b,c){var d,e,f;if(!k(c)&&!k(b)){d=c,a.outlineColumn.Lia(),a.suspendPaint();for(e in b)Object.prototype.hasOwnProperty.call(b,e)&&(f=b[e],a.getCell(f.row,d).textIndent(f.original));a.resumePaint(),a.outlineColumn.Mia()}}function t(a,b,c,d){var e,f,g,h=r(a,b,c,d);if(!h)return null;e=k(d)?a.getActiveColumnIndex():d,a.outlineColumn.Lia(),a.suspendPaint();for(f in h)Object.prototype.hasOwnProperty.call(h,f)&&(g=h[f],a.getCell(g.row,e).textIndent(g.current));return a.resumePaint(),a.outlineColumn.Mia(),{changingRows:h,changingCols:e}}b=function(a){h.inherit(b,a);function b(b,c){a.call(this),this.kj=b,this.VQ=c}var c={canExecute:function(){return q(this.kj,!0,this.VQ.changingRows,this.VQ.changingColumns)},canUndo:function(){return!0},execute:function(){if(this.canExecute()){var a=t(this.kj,!0,this.VQ.changingRows,this.VQ.changingColumns);return this.VQ.changingRows=a.changingRows,this.VQ.changingColumns=a.changingCols,!0}return!1},undo:function(){return s(this.kj,this.VQ.changingRows,this.VQ.changingColumns),!0}};return h.extend(b.prototype,c),b}(j),d=function(a){h.inherit(b,a);function b(b,c){a.call(this),this.kj=b,this.VQ=c}var c={canExecute:function(){return q(this.kj,!1,this.VQ.changingRows,this.VQ.changingColumns)},canUndo:function(){return!0},execute:function(){if(this.canExecute()){var a=t(this.kj,!1,this.VQ.changingRows,this.VQ.changingColumns);return this.VQ.changingRows=a.changingRows,this.VQ.changingColumns=a.changingCols,!0}return!1},undo:function(){return s(this.kj,this.VQ.changingRows,this.VQ.changingColumns),!0}};return h.extend(b.prototype,c),b}(j),e=function(a){h.inherit(b,a);function b(b,c){a.call(this),this.kj=b,this.VQ=c}function c(a,b,c,d){var e,f,g,h,i,j,l,m=a.Mp();if(k(d)&&(d=!m.getValueForKey(b,c,o)),e=0,f=0,h=a.rowOutlines.getLevel(b),m.setValueForKey(b,c,o,d),a.outlineColumn.Kia.updateCheckStatus(b,d),i=a.rowOutlines.find(b+1,h+1),null!==i)for(j=i.start;j<i.end+1;j++)m.setValueForKey(j,c,o,d),a.outlineColumn.Kia.updateCheckStatus(j,d);for(i=a.rowOutlines.find(b,h);null!==i&&null!==i.parent;){if(i.start>0){for(e=i.start-1,f=a.rowOutlines.getLevel(e),m.setValueForKey(e,c,o,d),a.outlineColumn.Kia.updateCheckStatus(e,d),g=a.rowOutlines.find(e+1,f+1),j=g.start;j<g.end+1;j++)if(l=m.getValueForKey(j,c,o),l!==d){m.setValueForKey(e,c,o,!1),a.outlineColumn.Kia.updateCheckStatus(e,!1);break}j===g.end+1&&d===!0&&(m.setValueForKey(e,c,o,!0),a.outlineColumn.Kia.updateCheckStatus(e,!0))}i=i.parent}}var d={canExecute:function(){return!0},canUndo:function(){return!0},execute:function(){var a=this,b=a.kj,d=a.VQ,e=d.row,f=d.col,g=d.status;return c(b,e,f,g),b.outlineColumn.refresh(),!0},undo:function(){var a=this,b=a.kj,d=a.VQ,e=d.row,f=d.col;return c(b,e,f),b.outlineColumn.refresh(),!0}};return h.extend(b.prototype,d),b}(j),i[l]={canUndo:!0,execute:function(a,c,d){return c.cmd=l,p(a,b,c,d)}},i[m]={canUndo:!0,execute:function(a,b,c){return b.cmd=m,p(a,d,b,c)}},i[n]={canUndo:!0,execute:function(a,b,c){return p(a,e,b,c)}},i.$Qa=function(a){var b=f.Ul.sl(),c=!b,d=b;a.register(l,i[l],221,c,!1,!0,d),a.register(m,i[m],219,c,!1,!0,d),a.register(n,i[n])},a.exports={commands:i,outlineColumnCheckStatus:o}}()}]);