@univerjs/sheets-conditional-formatting-ui 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +26 -26
- package/lib/es/index.js +712 -673
- package/lib/index.css +1 -1
- package/lib/types/menu/manage-rule.d.ts +1 -1
- package/lib/umd/index.js +26 -26
- package/package.json +14 -14
package/lib/cjs/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var $r=Object.defineProperty;var zr=(t,e,r)=>e in t?$r(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var _e=(t,e,r)=>zr(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("@univerjs/core"),c=require("@univerjs/sheets-conditional-formatting"),G=require("@univerjs/sheets"),me=require("@univerjs/ui"),N=require("react"),re=require("@univerjs/design"),on=require("@univerjs/engine-formula"),ce=require("@univerjs/sheets-ui"),dr=require("react-dom"),be=require("rxjs"),pt=require("@univerjs/sheets-formula-ui"),fr=require("@univerjs/engine-render"),at=require("rxjs/operators"),sn={type:S.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i}=e,l=t.get(c.ConditionalFormattingRuleModel),v=t.get(S.ICommandService),p=t.get(S.IUniverInstanceService),R=G.getSheetCommandTarget(p);if(!R)return!1;const{unitId:m,subUnitId:b}=R,x=l.createCfId(m,b),I={ranges:r,cfId:x,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:i,style:n}};return v.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:b,rule:I})}},ht={type:S.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(t,e){if(!e)return!1;const{rule:r}=e,n=t.get(S.IUndoRedoService),o=t.get(S.ICommandService),i=t.get(c.ConditionalFormattingRuleModel),l=t.get(S.IUniverInstanceService),v=G.getSheetCommandTarget(l);if(!v)return!1;const{unitId:p,subUnitId:R}=v,m=i.createCfId(p,R),b={unitId:p,subUnitId:R,rule:{...r,cfId:r.cfId||m}},x=c.AddConditionalRuleMutationUndoFactory(t,b),I=o.syncExecuteCommand(c.AddConditionalRuleMutation.id,b);return I&&n.pushUndoRedo({unitID:p,redoMutations:[{id:c.AddConditionalRuleMutation.id,params:b}],undoMutations:[x]}),I}},ln={type:S.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,config:n,stopIfTrue:o}=e,i=t.get(c.ConditionalFormattingRuleModel),l=t.get(S.ICommandService),v=t.get(S.IUniverInstanceService),p=G.getSheetCommandTarget(v);if(!p)return!1;const{unitId:R,subUnitId:m}=p,b=i.createCfId(R,m),x={ranges:r,cfId:b,stopIfTrue:!!o,rule:{type:c.CFRuleType.colorScale,config:n}};return l.executeCommand(c.AddConditionalRuleMutation.id,{unitId:R,subUnitId:m,rule:x})}},un={type:S.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,min:n,max:o,nativeColor:i,positiveColor:l,isGradient:v,stopIfTrue:p,isShowValue:R}=e,m=t.get(c.ConditionalFormattingRuleModel),b=t.get(S.IUniverInstanceService),x=G.getSheetCommandTarget(b);if(!x)return!1;const{unitId:I,subUnitId:T}=x,w=t.get(S.ICommandService),h=m.createCfId(I,T),a={ranges:r,cfId:h,stopIfTrue:!!p,rule:{type:c.CFRuleType.dataBar,isShowValue:R,config:{min:n,max:o,nativeColor:i,positiveColor:l,isGradient:v}}};return w.executeCommand(c.AddConditionalRuleMutation.id,{unitId:I,subUnitId:T,rule:a})}},cn={type:S.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o}=e,i=t.get(c.ConditionalFormattingRuleModel),l=t.get(S.ICommandService),v=t.get(S.IUniverInstanceService),p=G.getSheetCommandTarget(v);if(!p)return!1;const{unitId:R,subUnitId:m}=p,b=i.createCfId(R,m),x={ranges:r,cfId:b,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.duplicateValues,style:n}};return l.executeCommand(c.AddConditionalRuleMutation.id,{unitId:R,subUnitId:m,rule:x})}},dn={type:S.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i,value:l}=e,v=t.get(c.ConditionalFormattingRuleModel),p=t.get(S.ICommandService),R=t.get(S.IUniverInstanceService),m=G.getSheetCommandTarget(R);if(!m)return!1;const{unitId:b,subUnitId:x}=m,I=v.createCfId(b,x);let T;if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(i)){const w=l;if(w.length!==2||!Array.isArray(w))return!1;T={ranges:r,cfId:I,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:i,style:n,value:w}}}else{const w=l;if(typeof w!="number")return!1;T={ranges:r,cfId:I,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:i,style:n,value:w}}}return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:x,rule:T})}},fn={type:S.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,isPercent:i,isBottom:l,value:v}=e,p=t.get(c.ConditionalFormattingRuleModel),R=t.get(S.IUniverInstanceService),m=t.get(S.ICommandService),b=G.getSheetCommandTarget(R);if(!b)return!1;const{unitId:x,subUnitId:I}=b,T=p.createCfId(x,I),w={ranges:r,cfId:T,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:i,isBottom:l,style:n,value:v}};return m.executeCommand(c.AddConditionalRuleMutation.id,{unitId:x,subUnitId:I,rule:w})}},pn={type:S.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i,value:l}=e,v=t.get(c.ConditionalFormattingRuleModel),p=t.get(S.IUniverInstanceService),R=G.getSheetCommandTarget(p);if(!R)return!1;const{unitId:m,subUnitId:b}=R,x=t.get(S.ICommandService),I=v.createCfId(m,b),T={ranges:r,cfId:I,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.text,operator:i,style:n,value:l}};return x.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:b,rule:T})}},hn={type:S.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i}=e,l=t.get(c.ConditionalFormattingRuleModel),v=t.get(S.IUniverInstanceService),p=t.get(S.ICommandService),R=G.getSheetCommandTarget(v);if(!R)return!1;const{unitId:m,subUnitId:b}=R,x=l.createCfId(m,b),I={ranges:r,cfId:x,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.timePeriod,operator:i,style:n}};return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:b,rule:I})}},mn={type:S.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o}=e,i=t.get(c.ConditionalFormattingRuleModel),l=t.get(S.IUniverInstanceService),v=t.get(S.ICommandService),p=G.getSheetCommandTarget(l);if(!p)return!1;const{unitId:R,subUnitId:m}=p,b=i.createCfId(R,m),x={ranges:r,cfId:b,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.uniqueValues,style:n}};return v.executeCommand(c.AddConditionalRuleMutation.id,{unitId:R,subUnitId:m,rule:x})}},Vt={type:S.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(t,e){var w;if(!e)return!1;const r=t.get(c.ConditionalFormattingRuleModel),n=t.get(S.IUniverInstanceService),o=t.get(S.ICommandService),i=t.get(S.IUndoRedoService),l=t.get(G.SheetsSelectionsService),v=G.getSheetCommandTarget(n,e);if(!v)return!1;const{unitId:p,subUnitId:R}=v,m=((w=l.getCurrentSelections())==null?void 0:w.map(h=>h.range))||[],b=r.getSubunitRules(p,R);if(!(b!=null&&b.length)||!m.length)return!1;const x=[],I=[];b.forEach(h=>{const a=new S.ObjectMatrix;h.ranges.forEach(f=>{S.Range.foreach(f,(y,u)=>{a.setValue(y,u,1)})}),m.forEach(f=>{S.Range.foreach(f,(y,u)=>{a.realDeleteValue(y,u)})});const s=G.findAllRectangle(G.createTopMatrixFromMatrix(a));if(s.length){const f={...h,ranges:s},y={unitId:p,subUnitId:R,rule:f},u=c.setConditionalRuleMutationUndoFactory(t,y);x.push({id:c.SetConditionalRuleMutation.id,params:y}),I.push(...u)}else{const f={unitId:p,subUnitId:R,cfId:h.cfId},y=c.DeleteConditionalRuleMutationUndoFactory(t,f);x.push({id:c.DeleteConditionalRuleMutation.id,params:f}),I.push(...y)}});const T=S.sequenceExecute(x,o).result;return T&&i.pushUndoRedo({unitID:p,redoMutations:x,undoMutations:I}),T}},mt={type:S.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(t,e){const r=t.get(c.ConditionalFormattingRuleModel),n=t.get(S.IUniverInstanceService),o=t.get(S.ICommandService),i=t.get(S.IUndoRedoService),l=G.getSheetCommandTarget(n,e);if(!l)return!1;const{unitId:v,subUnitId:p}=l,R=r.getSubunitRules(v,p);if(!(R!=null&&R.length))return!1;const m=R.map(T=>({cfId:T.cfId,unitId:v,subUnitId:p})),b=m.map(T=>({id:c.DeleteConditionalRuleMutation.id,params:T})),x=m.map(T=>c.DeleteConditionalRuleMutationUndoFactory(t,T)[0]),I=S.sequenceExecute(b,o).result;return I&&i.pushUndoRedo({unitID:v,redoMutations:b,undoMutations:x}),I}},st={type:S.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(S.IUndoRedoService),n=t.get(S.ICommandService),o=t.get(S.IUniverInstanceService),i=G.getSheetCommandTarget(o,e);if(!i)return!1;const{unitId:l,subUnitId:v}=i,p={unitId:l,subUnitId:v,cfId:e.cfId},R=c.DeleteConditionalRuleMutationUndoFactory(t,p),m=n.syncExecuteCommand(c.DeleteConditionalRuleMutation.id,p);return m&&r.pushUndoRedo({unitID:l,undoMutations:R,redoMutations:[{id:c.DeleteConditionalRuleMutation.id,params:p}]}),m}},$t={type:S.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(S.IUndoRedoService),n=t.get(S.ICommandService),o=t.get(S.IUniverInstanceService),i=t.get(c.ConditionalFormattingRuleModel),l=G.getSheetCommandTarget(o,e);if(!l)return!1;const{unitId:v,subUnitId:p}=l,R=c.transformSupportSymmetryAnchor(e.start,e.end,i.getSubunitRules(v,p)||[],w=>w.cfId);if(!R)return!1;const[m,b]=R,x={unitId:v,subUnitId:p,start:m,end:b},I=c.MoveConditionalRuleMutationUndoFactory(x),T=n.syncExecuteCommand(c.MoveConditionalRuleMutation.id,x);return T&&r.pushUndoRedo({unitID:v,redoMutations:[{id:c.MoveConditionalRuleMutation.id,params:x}],undoMutations:I}),T}},zt={type:S.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(S.IUndoRedoService),n=t.get(S.ICommandService),o=t.get(S.IUniverInstanceService),i=G.getSheetCommandTarget(o,e);if(!i)return!1;const{unitId:l,subUnitId:v}=i,p={unitId:l,subUnitId:v,rule:e.rule},R=c.setConditionalRuleMutationUndoFactory(t,p),m=n.syncExecuteCommand(c.SetConditionalRuleMutation.id,p);return m&&r.pushUndoRedo({unitID:l,undoMutations:R,redoMutations:[{id:c.SetConditionalRuleMutation.id,params:p}]}),m}};function Ar(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function pr(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}),r}var kt={exports:{}},He={};/**
|
|
1
|
+
"use strict";var $r=Object.defineProperty;var zr=(t,e,r)=>e in t?$r(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var _e=(t,e,r)=>zr(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("@univerjs/core"),c=require("@univerjs/sheets-conditional-formatting"),G=require("@univerjs/sheets"),me=require("@univerjs/ui"),N=require("react"),re=require("@univerjs/design"),an=require("@univerjs/engine-formula"),ce=require("@univerjs/sheets-ui"),fr=require("react-dom"),be=require("rxjs"),pt=require("@univerjs/sheets-formula-ui"),pr=require("@univerjs/engine-render"),at=require("rxjs/operators"),ln={type:S.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i}=e,l=t.get(c.ConditionalFormattingRuleModel),v=t.get(S.ICommandService),p=t.get(S.IUniverInstanceService),R=G.getSheetCommandTarget(p);if(!R)return!1;const{unitId:m,subUnitId:b}=R,x=l.createCfId(m,b),I={ranges:r,cfId:x,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:i,style:n}};return v.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:b,rule:I})}},ht={type:S.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(t,e){if(!e)return!1;const{rule:r}=e,n=t.get(S.IUndoRedoService),o=t.get(S.ICommandService),i=t.get(c.ConditionalFormattingRuleModel),l=t.get(S.IUniverInstanceService),v=G.getSheetCommandTarget(l);if(!v)return!1;const{unitId:p,subUnitId:R}=v,m=i.createCfId(p,R),b={unitId:p,subUnitId:R,rule:{...r,cfId:r.cfId||m}},x=c.AddConditionalRuleMutationUndoFactory(t,b),I=o.syncExecuteCommand(c.AddConditionalRuleMutation.id,b);return I&&n.pushUndoRedo({unitID:p,redoMutations:[{id:c.AddConditionalRuleMutation.id,params:b}],undoMutations:[x]}),I}},un={type:S.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,config:n,stopIfTrue:o}=e,i=t.get(c.ConditionalFormattingRuleModel),l=t.get(S.ICommandService),v=t.get(S.IUniverInstanceService),p=G.getSheetCommandTarget(v);if(!p)return!1;const{unitId:R,subUnitId:m}=p,b=i.createCfId(R,m),x={ranges:r,cfId:b,stopIfTrue:!!o,rule:{type:c.CFRuleType.colorScale,config:n}};return l.executeCommand(c.AddConditionalRuleMutation.id,{unitId:R,subUnitId:m,rule:x})}},cn={type:S.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,min:n,max:o,nativeColor:i,positiveColor:l,isGradient:v,stopIfTrue:p,isShowValue:R}=e,m=t.get(c.ConditionalFormattingRuleModel),b=t.get(S.IUniverInstanceService),x=G.getSheetCommandTarget(b);if(!x)return!1;const{unitId:I,subUnitId:T}=x,w=t.get(S.ICommandService),h=m.createCfId(I,T),a={ranges:r,cfId:h,stopIfTrue:!!p,rule:{type:c.CFRuleType.dataBar,isShowValue:R,config:{min:n,max:o,nativeColor:i,positiveColor:l,isGradient:v}}};return w.executeCommand(c.AddConditionalRuleMutation.id,{unitId:I,subUnitId:T,rule:a})}},dn={type:S.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o}=e,i=t.get(c.ConditionalFormattingRuleModel),l=t.get(S.ICommandService),v=t.get(S.IUniverInstanceService),p=G.getSheetCommandTarget(v);if(!p)return!1;const{unitId:R,subUnitId:m}=p,b=i.createCfId(R,m),x={ranges:r,cfId:b,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.duplicateValues,style:n}};return l.executeCommand(c.AddConditionalRuleMutation.id,{unitId:R,subUnitId:m,rule:x})}},fn={type:S.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i,value:l}=e,v=t.get(c.ConditionalFormattingRuleModel),p=t.get(S.ICommandService),R=t.get(S.IUniverInstanceService),m=G.getSheetCommandTarget(R);if(!m)return!1;const{unitId:b,subUnitId:x}=m,I=v.createCfId(b,x);let T;if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(i)){const w=l;if(w.length!==2||!Array.isArray(w))return!1;T={ranges:r,cfId:I,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:i,style:n,value:w}}}else{const w=l;if(typeof w!="number")return!1;T={ranges:r,cfId:I,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:i,style:n,value:w}}}return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:x,rule:T})}},pn={type:S.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,isPercent:i,isBottom:l,value:v}=e,p=t.get(c.ConditionalFormattingRuleModel),R=t.get(S.IUniverInstanceService),m=t.get(S.ICommandService),b=G.getSheetCommandTarget(R);if(!b)return!1;const{unitId:x,subUnitId:I}=b,T=p.createCfId(x,I),w={ranges:r,cfId:T,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:i,isBottom:l,style:n,value:v}};return m.executeCommand(c.AddConditionalRuleMutation.id,{unitId:x,subUnitId:I,rule:w})}},hn={type:S.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i,value:l}=e,v=t.get(c.ConditionalFormattingRuleModel),p=t.get(S.IUniverInstanceService),R=G.getSheetCommandTarget(p);if(!R)return!1;const{unitId:m,subUnitId:b}=R,x=t.get(S.ICommandService),I=v.createCfId(m,b),T={ranges:r,cfId:I,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.text,operator:i,style:n,value:l}};return x.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:b,rule:T})}},mn={type:S.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i}=e,l=t.get(c.ConditionalFormattingRuleModel),v=t.get(S.IUniverInstanceService),p=t.get(S.ICommandService),R=G.getSheetCommandTarget(v);if(!R)return!1;const{unitId:m,subUnitId:b}=R,x=l.createCfId(m,b),I={ranges:r,cfId:x,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.timePeriod,operator:i,style:n}};return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:b,rule:I})}},gn={type:S.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o}=e,i=t.get(c.ConditionalFormattingRuleModel),l=t.get(S.IUniverInstanceService),v=t.get(S.ICommandService),p=G.getSheetCommandTarget(l);if(!p)return!1;const{unitId:R,subUnitId:m}=p,b=i.createCfId(R,m),x={ranges:r,cfId:b,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.uniqueValues,style:n}};return v.executeCommand(c.AddConditionalRuleMutation.id,{unitId:R,subUnitId:m,rule:x})}},$t={type:S.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(t,e){var w;if(!e)return!1;const r=t.get(c.ConditionalFormattingRuleModel),n=t.get(S.IUniverInstanceService),o=t.get(S.ICommandService),i=t.get(S.IUndoRedoService),l=t.get(G.SheetsSelectionsService),v=G.getSheetCommandTarget(n,e);if(!v)return!1;const{unitId:p,subUnitId:R}=v,m=((w=l.getCurrentSelections())==null?void 0:w.map(h=>h.range))||[],b=r.getSubunitRules(p,R);if(!(b!=null&&b.length)||!m.length)return!1;const x=[],I=[];b.forEach(h=>{const a=new S.ObjectMatrix;h.ranges.forEach(f=>{S.Range.foreach(f,(y,u)=>{a.setValue(y,u,1)})}),m.forEach(f=>{S.Range.foreach(f,(y,u)=>{a.realDeleteValue(y,u)})});const s=G.findAllRectangle(G.createTopMatrixFromMatrix(a));if(s.length){const f={...h,ranges:s},y={unitId:p,subUnitId:R,rule:f},u=c.setConditionalRuleMutationUndoFactory(t,y);x.push({id:c.SetConditionalRuleMutation.id,params:y}),I.push(...u)}else{const f={unitId:p,subUnitId:R,cfId:h.cfId},y=c.DeleteConditionalRuleMutationUndoFactory(t,f);x.push({id:c.DeleteConditionalRuleMutation.id,params:f}),I.push(...y)}});const T=S.sequenceExecute(x,o).result;return T&&i.pushUndoRedo({unitID:p,redoMutations:x,undoMutations:I}),T}},mt={type:S.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(t,e){const r=t.get(c.ConditionalFormattingRuleModel),n=t.get(S.IUniverInstanceService),o=t.get(S.ICommandService),i=t.get(S.IUndoRedoService),l=G.getSheetCommandTarget(n,e);if(!l)return!1;const{unitId:v,subUnitId:p}=l,R=r.getSubunitRules(v,p);if(!(R!=null&&R.length))return!1;const m=R.map(T=>({cfId:T.cfId,unitId:v,subUnitId:p})),b=m.map(T=>({id:c.DeleteConditionalRuleMutation.id,params:T})),x=m.map(T=>c.DeleteConditionalRuleMutationUndoFactory(t,T)[0]),I=S.sequenceExecute(b,o).result;return I&&i.pushUndoRedo({unitID:v,redoMutations:b,undoMutations:x}),I}},st={type:S.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(S.IUndoRedoService),n=t.get(S.ICommandService),o=t.get(S.IUniverInstanceService),i=G.getSheetCommandTarget(o,e);if(!i)return!1;const{unitId:l,subUnitId:v}=i,p={unitId:l,subUnitId:v,cfId:e.cfId},R=c.DeleteConditionalRuleMutationUndoFactory(t,p),m=n.syncExecuteCommand(c.DeleteConditionalRuleMutation.id,p);return m&&r.pushUndoRedo({unitID:l,undoMutations:R,redoMutations:[{id:c.DeleteConditionalRuleMutation.id,params:p}]}),m}},zt={type:S.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(S.IUndoRedoService),n=t.get(S.ICommandService),o=t.get(S.IUniverInstanceService),i=t.get(c.ConditionalFormattingRuleModel),l=G.getSheetCommandTarget(o,e);if(!l)return!1;const{unitId:v,subUnitId:p}=l,R=c.transformSupportSymmetryAnchor(e.start,e.end,i.getSubunitRules(v,p)||[],w=>w.cfId);if(!R)return!1;const[m,b]=R,x={unitId:v,subUnitId:p,start:m,end:b},I=c.MoveConditionalRuleMutationUndoFactory(x),T=n.syncExecuteCommand(c.MoveConditionalRuleMutation.id,x);return T&&r.pushUndoRedo({unitID:v,redoMutations:[{id:c.MoveConditionalRuleMutation.id,params:x}],undoMutations:I}),T}},At={type:S.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(S.IUndoRedoService),n=t.get(S.ICommandService),o=t.get(S.IUniverInstanceService),i=G.getSheetCommandTarget(o,e);if(!i)return!1;const{unitId:l,subUnitId:v}=i,p={unitId:l,subUnitId:v,rule:e.rule},R=c.setConditionalRuleMutationUndoFactory(t,p),m=n.syncExecuteCommand(c.SetConditionalRuleMutation.id,p);return m&&r.pushUndoRedo({unitID:l,undoMutations:R,redoMutations:[{id:c.SetConditionalRuleMutation.id,params:p}]}),m}};function Ar(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function hr(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}),r}var Bt={exports:{}},He={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Rn;function qr(){if(Rn)return He;Rn=1;var t=N,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(v,p,R){var m,b={},x=null,I=null;R!==void 0&&(x=""+R),p.key!==void 0&&(x=""+p.key),p.ref!==void 0&&(I=p.ref);for(m in p)n.call(p,m)&&!i.hasOwnProperty(m)&&(b[m]=p[m]);if(v&&v.defaultProps)for(m in p=v.defaultProps,p)b[m]===void 0&&(b[m]=p[m]);return{$$typeof:e,type:v,key:x,ref:I,props:b,_owner:o.current}}return He.Fragment=r,He.jsx=l,He.jsxs=l,He}var Tn;function Wr(){return Tn||(Tn=1,kt.exports=qr()),kt.exports}var _=Wr();const Hr="univer-conditional-formatting-wrap",kr="univer-cf-rule-item",Br="univer-preview",Gr="univer-create-rule",Xr="univer-button",Yr="univer-title",Kr="univer-label",Zr="univer-label-container",Jr="univer-input-width",Qr="univer-m-t-base",eo="univer-m-t-sm",to="univer-m-t-xl",no="univer-m-l-sm",ro="univer-m-l-xl",oo="univer-m-l-xxs",io="univer-m-l-0",ao="univer-m-r-0",$={conditionalFormattingWrap:Hr,cfRuleItem:kr,preview:Br,createRule:Gr,button:Xr,title:Yr,label:Kr,labelContainer:Zr,inputWidth:Jr,mTBase:Qr,mTSm:eo,mTXl:to,mLSm:no,mLXl:ro,mLXxs:oo,mL0:io,mR0:ao};var Ce=function(){return Ce=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Ce.apply(this,arguments)},so=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]]);return r},Ae=N.forwardRef(function(t,e){var r=t.icon,n=t.id,o=t.className,i=t.extend,l=so(t,["icon","id","className","extend"]),v="univerjs-icon univerjs-icon-".concat(n," ").concat(o||"").trim(),p=N.useRef("_".concat(co()));return hr(r,"".concat(n),{defIds:r.defIds,idSuffix:p.current},Ce({ref:e,className:v},l),i)});function hr(t,e,r,n,o){return N.createElement(t.tag,Ce(Ce({key:e},lo(t,r,o)),n),(uo(t,r).children||[]).map(function(i,l){return hr(i,"".concat(e,"-").concat(t.tag,"-").concat(l),r,void 0,o)}))}function lo(t,e,r){var n=Ce({},t.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1);var o=e.defIds;return!o||o.length===0||(t.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(function(i){var l=i[0],v=i[1];typeof v=="string"&&(n[l]=v.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),n}function uo(t,e){var r,n=e.defIds;return!n||n.length===0?t:t.tag==="defs"&&(!((r=t.children)===null||r===void 0)&&r.length)?Ce(Ce({},t),{children:t.children.map(function(o){return typeof o.attrs.id=="string"&&n&&n.indexOf(o.attrs.id)>-1?Ce(Ce({},o),{attrs:Ce(Ce({},o.attrs),{id:o.attrs.id+e.idSuffix})}):o})}):t}function co(){return Math.random().toString(36).substring(2,8)}Ae.displayName="UniverIcon";var fo={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Pt=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"delete-single",ref:e,icon:fo}))});Pt.displayName="DeleteSingle";var po={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},mr=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"increase-single",ref:e,icon:po}))});mr.displayName="IncreaseSingle";var ho={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},At=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"more-down-single",ref:e,icon:ho}))});At.displayName="MoreDownSingle";var mo={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_622_8",style:{maskType:"alpha"},width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0 0H16V16H0z"}}]},{tag:"g",attrs:{fill:"currentColor",mask:"url(#mask0_622_8)"},children:[{tag:"path",attrs:{d:"M6 5C6.55228 5 7 4.55228 7 4 7 3.44772 6.55228 3 6 3 5.44772 3 5 3.44772 5 4 5 4.55228 5.44772 5 6 5zM6 9C6.55228 9 7 8.55229 7 8 7 7.44772 6.55228 7 6 7 5.44772 7 5 7.44772 5 8 5 8.55229 5.44772 9 6 9zM7 12C7 12.5523 6.55228 13 6 13 5.44772 13 5 12.5523 5 12 5 11.4477 5.44772 11 6 11 6.55228 11 7 11.4477 7 12zM10 5C10.5523 5 11 4.55228 11 4 11 3.44772 10.5523 3 10 3 9.44771 3 9 3.44772 9 4 9 4.55228 9.44771 5 10 5zM11 8C11 8.55229 10.5523 9 10 9 9.44771 9 9 8.55229 9 8 9 7.44772 9.44771 7 10 7 10.5523 7 11 7.44772 11 8zM10 13C10.5523 13 11 12.5523 11 12 11 11.4477 10.5523 11 10 11 9.44771 11 9 11.4477 9 12 9 12.5523 9.44771 13 10 13z"}}]}]},gr=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"sequence-single",ref:e,icon:mo}))});gr.displayName="SequenceSingle";var go={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_436_41",style:{maskType:"alpha"},width:17,height:17,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0.35 0.48H16.35V16.48H0.35z"}}]},{tag:"g",attrs:{mask:"url(#mask0_436_41)",fillRule:"evenodd",clipRule:"evenodd"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2.27177 13.714L13.5855 2.40025L14.434 3.24878L3.1203 14.5625L2.27177 13.714Z"}},{tag:"path",attrs:{fill:"#E5E5E5",d:"M4.2603 1.82495L2.89617 1.82495C2.23343 1.82495 1.69617 2.36221 1.69617 3.02495L1.69617 4.38908L3.02617 4.38908L3.02617 3.15495L4.2603 3.15495L4.2603 1.82495ZM15.0092 4.38908L15.0092 3.02495C15.0092 2.36221 14.4719 1.82495 13.8092 1.82495L12.4451 1.82495L12.4451 3.15495L13.6792 3.15495L13.6792 4.38908L15.0092 4.38908ZM6.98856 1.82495L6.98856 3.15495L9.71681 3.15495L9.71681 1.82495L6.98856 1.82495ZM15.0092 7.11734L13.6792 7.11734L13.6792 9.84559L15.0092 9.84559L15.0092 7.11734ZM15.0092 12.5739L13.6792 12.5739L13.6792 13.808L12.4451 13.808L12.4451 15.138L13.8092 15.138C14.4719 15.138 15.0092 14.6007 15.0092 13.938L15.0092 12.5739ZM9.71681 15.138L9.71681 13.808L6.98856 13.808L6.98856 15.138L9.71681 15.138ZM4.2603 15.138L4.2603 13.808L3.02617 13.808L3.02617 12.5739L1.69617 12.5739L1.69617 13.938C1.69617 14.6007 2.23343 15.138 2.89617 15.138L4.2603 15.138ZM1.69617 9.8456L3.02617 9.8456L3.02617 7.11734L1.69617 7.11734L1.69617 9.8456Z"}}]}]},gt=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"slash-single",ref:e,icon:go}))});gt.displayName="SlashSingle";var Bt={exports:{}},ke={},it={exports:{}},vo=it.exports,In;function gn(){return In||(In=1,function(t,e){(function(r,n){n(e)})(vo,function(r){function n(q){return function(ae,O,P,D,V,Y,W){return q(ae,O,W)}}function o(q){return function(ae,O,P,D){if(!ae||!O||typeof ae!="object"||typeof O!="object")return q(ae,O,P,D);var V=D.get(ae),Y=D.get(O);if(V&&Y)return V===O&&Y===ae;D.set(ae,O),D.set(O,ae);var W=q(ae,O,P,D);return D.delete(ae),D.delete(O),W}}function i(q,J){var ae={};for(var O in q)ae[O]=q[O];for(var O in J)ae[O]=J[O];return ae}function l(q){return q.constructor===Object||q.constructor==null}function v(q){return typeof q.then=="function"}function p(q,J){return q===J||q!==q&&J!==J}var R="[object Arguments]",m="[object Boolean]",b="[object Date]",x="[object RegExp]",I="[object Map]",T="[object Number]",w="[object Object]",h="[object Set]",a="[object String]",s=Object.prototype.toString;function f(q){var J=q.areArraysEqual,ae=q.areDatesEqual,O=q.areMapsEqual,P=q.areObjectsEqual,D=q.areRegExpsEqual,V=q.areSetsEqual,Y=q.createIsNestedEqual,W=Y(Z);function Z(K,ee,ue){if(K===ee)return!0;if(!K||!ee||typeof K!="object"||typeof ee!="object")return K!==K&&ee!==ee;if(l(K)&&l(ee))return P(K,ee,W,ue);var Pe=Array.isArray(K),ye=Array.isArray(ee);if(Pe||ye)return Pe===ye&&J(K,ee,W,ue);var he=s.call(K);return he!==s.call(ee)?!1:he===b?ae(K,ee,W,ue):he===x?D(K,ee,W,ue):he===I?O(K,ee,W,ue):he===h?V(K,ee,W,ue):he===w||he===R?v(K)||v(ee)?!1:P(K,ee,W,ue):he===m||he===T||he===a?p(K.valueOf(),ee.valueOf()):!1}return Z}function y(q,J,ae,O){var P=q.length;if(J.length!==P)return!1;for(;P-- >0;)if(!ae(q[P],J[P],P,P,q,J,O))return!1;return!0}var u=o(y);function g(q,J){return p(q.valueOf(),J.valueOf())}function d(q,J,ae,O){var P=q.size===J.size;if(!P)return!1;if(!q.size)return!0;var D={},V=0;return q.forEach(function(Y,W){if(P){var Z=!1,K=0;J.forEach(function(ee,ue){!Z&&!D[K]&&(Z=ae(W,ue,V,K,q,J,O)&&ae(Y,ee,W,ue,q,J,O))&&(D[K]=!0),K++}),V++,P=Z}}),P}var C=o(d),M="_owner",j=Object.prototype.hasOwnProperty;function U(q,J,ae,O){var P=Object.keys(q),D=P.length;if(Object.keys(J).length!==D)return!1;for(var V;D-- >0;){if(V=P[D],V===M){var Y=!!q.$$typeof,W=!!J.$$typeof;if((Y||W)&&Y!==W)return!1}if(!j.call(J,V)||!ae(q[V],J[V],V,V,q,J,O))return!1}return!0}var L=o(U);function E(q,J){return q.source===J.source&&q.flags===J.flags}function F(q,J,ae,O){var P=q.size===J.size;if(!P)return!1;if(!q.size)return!0;var D={};return q.forEach(function(V,Y){if(P){var W=!1,Z=0;J.forEach(function(K,ee){!W&&!D[Z]&&(W=ae(V,K,Y,ee,q,J,O))&&(D[Z]=!0),Z++}),P=W}}),P}var z=o(F),B=Object.freeze({areArraysEqual:y,areDatesEqual:g,areMapsEqual:d,areObjectsEqual:U,areRegExpsEqual:E,areSetsEqual:F,createIsNestedEqual:n}),X=Object.freeze({areArraysEqual:u,areDatesEqual:g,areMapsEqual:C,areObjectsEqual:L,areRegExpsEqual:E,areSetsEqual:z,createIsNestedEqual:n}),te=f(B);function Q(q,J){return te(q,J,void 0)}var H=f(i(B,{createIsNestedEqual:function(){return p}}));function A(q,J){return H(q,J,void 0)}var ne=f(X);function oe(q,J){return ne(q,J,new WeakMap)}var se=f(i(X,{createIsNestedEqual:function(){return p}}));function fe(q,J){return se(q,J,new WeakMap)}function ge(q){return f(i(B,q(B)))}function Se(q){var J=f(i(X,q(X)));return function(ae,O,P){return P===void 0&&(P=new WeakMap),J(ae,O,P)}}r.circularDeepEqual=oe,r.circularShallowEqual=fe,r.createCustomCircularEqual=Se,r.createCustomEqual=ge,r.deepEqual=Q,r.sameValueZeroEqual=p,r.shallowEqual=A,Object.defineProperty(r,"__esModule",{value:!0})})}(it,it.exports)),it.exports}var Ct={exports:{}},wn;function vn(){if(wn)return Ct.exports;wn=1;function t(r){var n,o,i="";if(typeof r=="string"||typeof r=="number")i+=r;else if(typeof r=="object")if(Array.isArray(r)){var l=r.length;for(n=0;n<l;n++)r[n]&&(o=t(r[n]))&&(i&&(i+=" "),i+=o)}else for(o in r)r[o]&&(i&&(i+=" "),i+=o);return i}function e(){for(var r,n,o=0,i="",l=arguments.length;o<l;o++)(r=arguments[o])&&(n=t(r))&&(i&&(i+=" "),i+=n);return i}return Ct.exports=e,Ct.exports.clsx=e,Ct.exports}var ie={},Gt,_n;function yo(){return _n||(_n=1,Gt=function(e,r,n){return e===r?!0:e.className===r.className&&n(e.style,r.style)&&e.width===r.width&&e.autoSize===r.autoSize&&e.cols===r.cols&&e.draggableCancel===r.draggableCancel&&e.draggableHandle===r.draggableHandle&&n(e.verticalCompact,r.verticalCompact)&&n(e.compactType,r.compactType)&&n(e.layout,r.layout)&&n(e.margin,r.margin)&&n(e.containerPadding,r.containerPadding)&&e.rowHeight===r.rowHeight&&e.maxRows===r.maxRows&&e.isBounded===r.isBounded&&e.isDraggable===r.isDraggable&&e.isResizable===r.isResizable&&e.allowOverlap===r.allowOverlap&&e.preventCollision===r.preventCollision&&e.useCSSTransforms===r.useCSSTransforms&&e.transformScale===r.transformScale&&e.isDroppable===r.isDroppable&&n(e.resizeHandles,r.resizeHandles)&&n(e.resizeHandle,r.resizeHandle)&&e.onLayoutChange===r.onLayoutChange&&e.onDragStart===r.onDragStart&&e.onDrag===r.onDrag&&e.onDragStop===r.onDragStop&&e.onResizeStart===r.onResizeStart&&e.onResize===r.onResize&&e.onResizeStop===r.onResizeStop&&e.onDrop===r.onDrop&&n(e.droppingItem,r.droppingItem)&&n(e.innerRef,r.innerRef)}),Gt}var xn;function qe(){if(xn)return ie;xn=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.bottom=n,ie.childrenEqual=p,ie.cloneLayout=o,ie.cloneLayoutItem=v,ie.collides=m,ie.compact=b,ie.compactItem=T,ie.compactType=q,ie.correctBounds=w,ie.fastPositionEqual=R,ie.fastRGLPropsEqual=void 0,ie.getAllCollisions=s,ie.getFirstCollision=a,ie.getLayoutItem=h,ie.getStatics=f,ie.modifyLayout=i,ie.moveElement=y,ie.moveElementAwayFromCollision=u,ie.noop=void 0,ie.perc=g,ie.resizeItemInDirection=H,ie.setTopLeft=ne,ie.setTransform=A,ie.sortLayoutItems=oe,ie.sortLayoutItemsByColRow=fe,ie.sortLayoutItemsByRowCol=se,ie.synchronizeLayoutWithChildren=ge,ie.validateLayout=Se,ie.withLayoutItem=l;var t=gn(),e=r(N);function r(O){return O&&O.__esModule?O:{default:O}}function n(O){let P=0,D;for(let V=0,Y=O.length;V<Y;V++)D=O[V].y+O[V].h,D>P&&(P=D);return P}function o(O){const P=Array(O.length);for(let D=0,V=O.length;D<V;D++)P[D]=v(O[D]);return P}function i(O,P){const D=Array(O.length);for(let V=0,Y=O.length;V<Y;V++)P.i===O[V].i?D[V]=P:D[V]=O[V];return D}function l(O,P,D){let V=h(O,P);return V?(V=D(v(V)),O=i(O,V),[O,V]):[O,null]}function v(O){return{w:O.w,h:O.h,x:O.x,y:O.y,i:O.i,minW:O.minW,maxW:O.maxW,minH:O.minH,maxH:O.maxH,moved:!!O.moved,static:!!O.static,isDraggable:O.isDraggable,isResizable:O.isResizable,resizeHandles:O.resizeHandles,isBounded:O.isBounded}}function p(O,P){return(0,t.deepEqual)(e.default.Children.map(O,D=>D==null?void 0:D.key),e.default.Children.map(P,D=>D==null?void 0:D.key))&&(0,t.deepEqual)(e.default.Children.map(O,D=>D==null?void 0:D.props["data-grid"]),e.default.Children.map(P,D=>D==null?void 0:D.props["data-grid"]))}ie.fastRGLPropsEqual=yo();function R(O,P){return O.left===P.left&&O.top===P.top&&O.width===P.width&&O.height===P.height}function m(O,P){return!(O.i===P.i||O.x+O.w<=P.x||O.x>=P.x+P.w||O.y+O.h<=P.y||O.y>=P.y+P.h)}function b(O,P,D,V){const Y=f(O),W=oe(O,P),Z=Array(O.length);for(let K=0,ee=W.length;K<ee;K++){let ue=v(W[K]);ue.static||(ue=T(Y,ue,P,D,W,V),Y.push(ue)),Z[O.indexOf(W[K])]=ue,ue.moved=!1}return Z}const x={x:"w",y:"h"};function I(O,P,D,V){const Y=x[V];P[V]+=1;const W=O.map(Z=>Z.i).indexOf(P.i);for(let Z=W+1;Z<O.length;Z++){const K=O[Z];if(!K.static){if(K.y>P.y+P.h)break;m(P,K)&&I(O,K,D+P[Y],V)}}P[V]=D}function T(O,P,D,V,Y,W){const Z=D==="vertical",K=D==="horizontal";if(Z)for(P.y=Math.min(n(O),P.y);P.y>0&&!a(O,P);)P.y--;else if(K)for(;P.x>0&&!a(O,P);)P.x--;let ee;for(;(ee=a(O,P))&&!(D===null&&W);)if(K?I(Y,P,ee.x+ee.w,"x"):I(Y,P,ee.y+ee.h,"y"),K&&P.x+P.w>V)for(P.x=V-P.w,P.y++;P.x>0&&!a(O,P);)P.x--;return P.y=Math.max(P.y,0),P.x=Math.max(P.x,0),P}function w(O,P){const D=f(O);for(let V=0,Y=O.length;V<Y;V++){const W=O[V];if(W.x+W.w>P.cols&&(W.x=P.cols-W.w),W.x<0&&(W.x=0,W.w=P.cols),!W.static)D.push(W);else for(;a(D,W);)W.y++}return O}function h(O,P){for(let D=0,V=O.length;D<V;D++)if(O[D].i===P)return O[D]}function a(O,P){for(let D=0,V=O.length;D<V;D++)if(m(O[D],P))return O[D]}function s(O,P){return O.filter(D=>m(D,P))}function f(O){return O.filter(P=>P.static)}function y(O,P,D,V,Y,W,Z,K,ee){if(P.static&&P.isDraggable!==!0||P.y===V&&P.x===D)return O;`${P.i}${String(D)}${String(V)}${P.x}${P.y}`;const ue=P.x,Pe=P.y;typeof D=="number"&&(P.x=D),typeof V=="number"&&(P.y=V),P.moved=!0;let ye=oe(O,Z);(Z==="vertical"&&typeof V=="number"?Pe>=V:Z==="horizontal"&&typeof D=="number"?ue>=D:!1)&&(ye=ye.reverse());const je=s(ye,P),yt=je.length>0;if(yt&&ee)return o(O);if(yt&&W)return`${P.i}`,P.x=ue,P.y=Pe,P.moved=!1,O;for(let Ht=0,Vr=je.length;Ht<Vr;Ht++){const Me=je[Ht];`${P.i}${P.x}${P.y}${Me.i}${Me.x}${Me.y}`,!Me.moved&&(Me.static?O=u(O,Me,P,Y,Z):O=u(O,P,Me,Y,Z))}return O}function u(O,P,D,V,Y,W){const Z=Y==="horizontal",K=Y==="vertical",ee=P.static;if(V){V=!1;const ye={x:Z?Math.max(P.x-D.w,0):D.x,y:K?Math.max(P.y-D.h,0):D.y,w:D.w,h:D.h,i:"-1"},he=a(O,ye),je=he&&he.y+he.h>P.y,yt=he&&P.x+P.w>he.x;if(he){if(je&&K)return y(O,D,void 0,P.y+1,V,ee,Y);if(je&&Y==null)return P.y=D.y,D.y=D.y+D.h,O;if(yt&&Z)return y(O,P,D.x,void 0,V,ee,Y)}else return`${D.i}${ye.x}${ye.y}`,y(O,D,Z?ye.x:void 0,K?ye.y:void 0,V,ee,Y)}const ue=Z?D.x+1:void 0,Pe=K?D.y+1:void 0;return ue==null&&Pe==null?O:y(O,D,Z?D.x+1:void 0,K?D.y+1:void 0,V,ee,Y)}function g(O){return O*100+"%"}const d=(O,P,D,V)=>O+D>V?P:D,C=(O,P,D)=>O<0?P:D,M=O=>Math.max(0,O),j=O=>Math.max(0,O),U=(O,P,D)=>{let{left:V,height:Y,width:W}=P;const Z=O.top-(Y-O.height);return{left:V,width:W,height:C(Z,O.height,Y),top:j(Z)}},L=(O,P,D)=>{let{top:V,left:Y,height:W,width:Z}=P;return{top:V,height:W,width:d(O.left,O.width,Z,D),left:M(Y)}},E=(O,P,D)=>{let{top:V,height:Y,width:W}=P;const Z=O.left-(W-O.width);return{height:Y,width:Z<0?O.width:d(O.left,O.width,W,D),top:j(V),left:M(Z)}},F=(O,P,D)=>{let{top:V,left:Y,height:W,width:Z}=P;return{width:Z,left:Y,height:C(V,O.height,W),top:j(V)}},Q={n:U,ne:function(){return U(arguments.length<=0?void 0:arguments[0],L(...arguments))},e:L,se:function(){return F(arguments.length<=0?void 0:arguments[0],L(...arguments))},s:F,sw:function(){return F(arguments.length<=0?void 0:arguments[0],E(...arguments))},w:E,nw:function(){return U(arguments.length<=0?void 0:arguments[0],E(...arguments))}};function H(O,P,D,V){const Y=Q[O];return Y?Y(P,{...P,...D},V):D}function A(O){let{top:P,left:D,width:V,height:Y}=O;const W=`translate(${D}px,${P}px)`;return{transform:W,WebkitTransform:W,MozTransform:W,msTransform:W,OTransform:W,width:`${V}px`,height:`${Y}px`,position:"absolute"}}function ne(O){let{top:P,left:D,width:V,height:Y}=O;return{top:`${P}px`,left:`${D}px`,width:`${V}px`,height:`${Y}px`,position:"absolute"}}function oe(O,P){return P==="horizontal"?fe(O):P==="vertical"?se(O):O}function se(O){return O.slice(0).sort(function(P,D){return P.y>D.y||P.y===D.y&&P.x>D.x?1:P.y===D.y&&P.x===D.x?0:-1})}function fe(O){return O.slice(0).sort(function(P,D){return P.x>D.x||P.x===D.x&&P.y>D.y?1:-1})}function ge(O,P,D,V,Y){O=O||[];const W=[];e.default.Children.forEach(P,K=>{if((K==null?void 0:K.key)==null)return;const ee=h(O,String(K.key)),ue=K.props["data-grid"];ee&&ue==null?W.push(v(ee)):ue?W.push(v({...ue,i:K.key})):W.push(v({w:1,h:1,x:0,y:n(W),i:String(K.key)}))});const Z=w(W,{cols:D});return Y?Z:b(Z,V,D)}function Se(O){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const D=["x","y","w","h"];if(!Array.isArray(O))throw new Error(P+" must be an array!");for(let V=0,Y=O.length;V<Y;V++){const W=O[V];for(let Z=0;Z<D.length;Z++)if(typeof W[D[Z]]!="number")throw new Error("ReactGridLayout: "+P+"["+V+"]."+D[Z]+" must be a number!")}}function q(O){const{verticalCompact:P,compactType:D}=O||{};return P===!1?null:D}function J(){}const ae=()=>{};return ie.noop=ae,ie}var Te={},En;function yn(){if(En)return Te;En=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.calcGridColWidth=t,Te.calcGridItemPosition=r,Te.calcGridItemWHPx=e,Te.calcWH=o,Te.calcXY=n,Te.clamp=i;function t(l){const{margin:v,containerPadding:p,containerWidth:R,cols:m}=l;return(R-v[0]*(m-1)-p[0]*2)/m}function e(l,v,p){return Number.isFinite(l)?Math.round(v*l+Math.max(0,l-1)*p):l}function r(l,v,p,R,m,b){const{margin:x,containerPadding:I,rowHeight:T}=l,w=t(l),h={};return b&&b.resizing?(h.width=Math.round(b.resizing.width),h.height=Math.round(b.resizing.height)):(h.width=e(R,w,x[0]),h.height=e(m,T,x[1])),b&&b.dragging?(h.top=Math.round(b.dragging.top),h.left=Math.round(b.dragging.left)):b&&b.resizing&&typeof b.resizing.top=="number"&&typeof b.resizing.left=="number"?(h.top=Math.round(b.resizing.top),h.left=Math.round(b.resizing.left)):(h.top=Math.round((T+x[1])*p+I[1]),h.left=Math.round((w+x[0])*v+I[0])),h}function n(l,v,p,R,m){const{margin:b,cols:x,rowHeight:I,maxRows:T}=l,w=t(l);let h=Math.round((p-b[0])/(w+b[0])),a=Math.round((v-b[1])/(I+b[1]));return h=i(h,0,x-R),a=i(a,0,T-m),{x:h,y:a}}function o(l,v,p,R,m,b){const{margin:x,maxRows:I,cols:T,rowHeight:w}=l,h=t(l);let a=Math.round((v+x[0])/(h+x[0])),s=Math.round((p+x[1])/(w+x[1])),f=i(a,0,T-R),y=i(s,0,I-m);return["sw","w","nw"].indexOf(b)!==-1&&(f=i(a,0,T)),["nw","n","ne"].indexOf(b)!==-1&&(y=i(s,0,I)),{w:f,h:y}}function i(l,v,p){return Math.max(Math.min(l,p),v)}return Te}var Be={},Xt={exports:{}},Yt,On;function Co(){if(On)return Yt;On=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Yt=t,Yt}var Kt,Pn;function So(){if(Pn)return Kt;Pn=1;var t=Co();function e(){}function r(){}return r.resetWarningCache=e,Kt=function(){function n(l,v,p,R,m,b){if(b!==t){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}n.isRequired=n;function o(){return n}var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:e};return i.PropTypes=i,i},Kt}var Mn;function Oe(){return Mn||(Mn=1,Xt.exports=So()()),Xt.exports}var Ge={exports:{}},Zt={};function vr(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=vr(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function Fn(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=vr(t))&&(n&&(n+=" "),n+=e);return n}const bo=Object.freeze(Object.defineProperty({__proto__:null,clsx:Fn,default:Fn},Symbol.toStringTag,{value:"Module"})),Ro=pr(bo);var de={},xe={},Dn;function qt(){if(Dn)return xe;Dn=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.dontSetMe=o,xe.findInArray=t,xe.int=n,xe.isFunction=e,xe.isNum=r;function t(i,l){for(let v=0,p=i.length;v<p;v++)if(l.apply(l,[i[v],v,i]))return i[v]}function e(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Function]"}function r(i){return typeof i=="number"&&!isNaN(i)}function n(i){return parseInt(i,10)}function o(i,l,v){if(i[l])return new Error("Invalid prop ".concat(l," passed to ").concat(v," - do not set this, set it on the child."))}return xe}var Ee={},Nn;function To(){if(Nn)return Ee;Nn=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.browserPrefixToKey=r,Ee.browserPrefixToStyle=n,Ee.default=void 0,Ee.getPrefix=e;const t=["Moz","Webkit","O","ms"];function e(){var i;let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const v=(i=window.document)===null||i===void 0||(i=i.documentElement)===null||i===void 0?void 0:i.style;if(!v||l in v)return"";for(let p=0;p<t.length;p++)if(r(l,t[p])in v)return t[p];return""}function r(i,l){return l?"".concat(l).concat(o(i)):i}function n(i,l){return l?"-".concat(l.toLowerCase(),"-").concat(i):i}function o(i){let l="",v=!0;for(let p=0;p<i.length;p++)v?(l+=i[p].toUpperCase(),v=!1):i[p]==="-"?v=!0:l+=i[p];return l}return Ee.default=e(),Ee}var jn;function Cn(){if(jn)return de;jn=1,Object.defineProperty(de,"__esModule",{value:!0}),de.addClassName=u,de.addEvent=v,de.addUserSelectStyles=f,de.createCSSTransform=T,de.createSVGTransform=w,de.getTouch=a,de.getTouchIdentifier=s,de.getTranslation=h,de.innerHeight=b,de.innerWidth=x,de.matchesSelector=i,de.matchesSelectorAndParentsTo=l,de.offsetXYFromParent=I,de.outerHeight=R,de.outerWidth=m,de.removeClassName=g,de.removeEvent=p,de.removeUserSelectStyles=y;var t=qt(),e=n(To());function r(d){if(typeof WeakMap!="function")return null;var C=new WeakMap,M=new WeakMap;return(r=function(j){return j?M:C})(d)}function n(d,C){if(d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var M=r(C);if(M&&M.has(d))return M.get(d);var j={},U=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var L in d)if(L!=="default"&&Object.prototype.hasOwnProperty.call(d,L)){var E=U?Object.getOwnPropertyDescriptor(d,L):null;E&&(E.get||E.set)?Object.defineProperty(j,L,E):j[L]=d[L]}return j.default=d,M&&M.set(d,j),j}let o="";function i(d,C){return o||(o=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(M){return(0,t.isFunction)(d[M])})),(0,t.isFunction)(d[o])?d[o](C):!1}function l(d,C,M){let j=d;do{if(i(j,C))return!0;if(j===M)return!1;j=j.parentNode}while(j);return!1}function v(d,C,M,j){if(!d)return;const U={capture:!0,...j};d.addEventListener?d.addEventListener(C,M,U):d.attachEvent?d.attachEvent("on"+C,M):d["on"+C]=M}function p(d,C,M,j){if(!d)return;const U={capture:!0,...j};d.removeEventListener?d.removeEventListener(C,M,U):d.detachEvent?d.detachEvent("on"+C,M):d["on"+C]=null}function R(d){let C=d.clientHeight;const M=d.ownerDocument.defaultView.getComputedStyle(d);return C+=(0,t.int)(M.borderTopWidth),C+=(0,t.int)(M.borderBottomWidth),C}function m(d){let C=d.clientWidth;const M=d.ownerDocument.defaultView.getComputedStyle(d);return C+=(0,t.int)(M.borderLeftWidth),C+=(0,t.int)(M.borderRightWidth),C}function b(d){let C=d.clientHeight;const M=d.ownerDocument.defaultView.getComputedStyle(d);return C-=(0,t.int)(M.paddingTop),C-=(0,t.int)(M.paddingBottom),C}function x(d){let C=d.clientWidth;const M=d.ownerDocument.defaultView.getComputedStyle(d);return C-=(0,t.int)(M.paddingLeft),C-=(0,t.int)(M.paddingRight),C}function I(d,C,M){const U=C===C.ownerDocument.body?{left:0,top:0}:C.getBoundingClientRect(),L=(d.clientX+C.scrollLeft-U.left)/M,E=(d.clientY+C.scrollTop-U.top)/M;return{x:L,y:E}}function T(d,C){const M=h(d,C,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:M}}function w(d,C){return h(d,C,"")}function h(d,C,M){let{x:j,y:U}=d,L="translate(".concat(j).concat(M,",").concat(U).concat(M,")");if(C){const E="".concat(typeof C.x=="string"?C.x:C.x+M),F="".concat(typeof C.y=="string"?C.y:C.y+M);L="translate(".concat(E,", ").concat(F,")")+L}return L}function a(d,C){return d.targetTouches&&(0,t.findInArray)(d.targetTouches,M=>C===M.identifier)||d.changedTouches&&(0,t.findInArray)(d.changedTouches,M=>C===M.identifier)}function s(d){if(d.targetTouches&&d.targetTouches[0])return d.targetTouches[0].identifier;if(d.changedTouches&&d.changedTouches[0])return d.changedTouches[0].identifier}function f(d){if(!d)return;let C=d.getElementById("react-draggable-style-el");C||(C=d.createElement("style"),C.type="text/css",C.id="react-draggable-style-el",C.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
9
|
+
*/var Tn;function qr(){if(Tn)return He;Tn=1;var t=N,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(v,p,R){var m,b={},x=null,I=null;R!==void 0&&(x=""+R),p.key!==void 0&&(x=""+p.key),p.ref!==void 0&&(I=p.ref);for(m in p)n.call(p,m)&&!i.hasOwnProperty(m)&&(b[m]=p[m]);if(v&&v.defaultProps)for(m in p=v.defaultProps,p)b[m]===void 0&&(b[m]=p[m]);return{$$typeof:e,type:v,key:x,ref:I,props:b,_owner:o.current}}return He.Fragment=r,He.jsx=l,He.jsxs=l,He}var In;function Wr(){return In||(In=1,Bt.exports=qr()),Bt.exports}var _=Wr();const Hr="univer-conditional-formatting-wrap",kr="univer-cf-rule-item",Br="univer-preview",Gr="univer-create-rule",Xr="univer-button",Yr="univer-title",Kr="univer-label",Zr="univer-label-container",Jr="univer-input-width",Qr="univer-m-t-base",eo="univer-m-t-sm",to="univer-m-t-xl",no="univer-m-l-sm",ro="univer-m-l-xl",oo="univer-m-l-xxs",io="univer-m-l-0",ao="univer-m-r-0",$={conditionalFormattingWrap:Hr,cfRuleItem:kr,preview:Br,createRule:Gr,button:Xr,title:Yr,label:Kr,labelContainer:Zr,inputWidth:Jr,mTBase:Qr,mTSm:eo,mTXl:to,mLSm:no,mLXl:ro,mLXxs:oo,mL0:io,mR0:ao};var Ce=function(){return Ce=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Ce.apply(this,arguments)},so=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]]);return r},Ae=N.forwardRef(function(t,e){var r=t.icon,n=t.id,o=t.className,i=t.extend,l=so(t,["icon","id","className","extend"]),v="univerjs-icon univerjs-icon-".concat(n," ").concat(o||"").trim(),p=N.useRef("_".concat(co()));return mr(r,"".concat(n),{defIds:r.defIds,idSuffix:p.current},Ce({ref:e,className:v},l),i)});function mr(t,e,r,n,o){return N.createElement(t.tag,Ce(Ce({key:e},lo(t,r,o)),n),(uo(t,r).children||[]).map(function(i,l){return mr(i,"".concat(e,"-").concat(t.tag,"-").concat(l),r,void 0,o)}))}function lo(t,e,r){var n=Ce({},t.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1);var o=e.defIds;return!o||o.length===0||(t.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(function(i){var l=i[0],v=i[1];typeof v=="string"&&(n[l]=v.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),n}function uo(t,e){var r,n=e.defIds;return!n||n.length===0?t:t.tag==="defs"&&(!((r=t.children)===null||r===void 0)&&r.length)?Ce(Ce({},t),{children:t.children.map(function(o){return typeof o.attrs.id=="string"&&n&&n.indexOf(o.attrs.id)>-1?Ce(Ce({},o),{attrs:Ce(Ce({},o.attrs),{id:o.attrs.id+e.idSuffix})}):o})}):t}function co(){return Math.random().toString(36).substring(2,8)}Ae.displayName="UniverIcon";var fo={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Pt=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"delete-single",ref:e,icon:fo}))});Pt.displayName="DeleteSingle";var po={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},gr=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"increase-single",ref:e,icon:po}))});gr.displayName="IncreaseSingle";var ho={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},qt=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"more-down-single",ref:e,icon:ho}))});qt.displayName="MoreDownSingle";var mo={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_622_8",style:{maskType:"alpha"},width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0 0H16V16H0z"}}]},{tag:"g",attrs:{fill:"currentColor",mask:"url(#mask0_622_8)"},children:[{tag:"path",attrs:{d:"M6 5C6.55228 5 7 4.55228 7 4 7 3.44772 6.55228 3 6 3 5.44772 3 5 3.44772 5 4 5 4.55228 5.44772 5 6 5zM6 9C6.55228 9 7 8.55229 7 8 7 7.44772 6.55228 7 6 7 5.44772 7 5 7.44772 5 8 5 8.55229 5.44772 9 6 9zM7 12C7 12.5523 6.55228 13 6 13 5.44772 13 5 12.5523 5 12 5 11.4477 5.44772 11 6 11 6.55228 11 7 11.4477 7 12zM10 5C10.5523 5 11 4.55228 11 4 11 3.44772 10.5523 3 10 3 9.44771 3 9 3.44772 9 4 9 4.55228 9.44771 5 10 5zM11 8C11 8.55229 10.5523 9 10 9 9.44771 9 9 8.55229 9 8 9 7.44772 9.44771 7 10 7 10.5523 7 11 7.44772 11 8zM10 13C10.5523 13 11 12.5523 11 12 11 11.4477 10.5523 11 10 11 9.44771 11 9 11.4477 9 12 9 12.5523 9.44771 13 10 13z"}}]}]},vr=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"sequence-single",ref:e,icon:mo}))});vr.displayName="SequenceSingle";var go={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_436_41",style:{maskType:"alpha"},width:17,height:17,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0.35 0.48H16.35V16.48H0.35z"}}]},{tag:"g",attrs:{mask:"url(#mask0_436_41)",fillRule:"evenodd",clipRule:"evenodd"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2.27177 13.714L13.5855 2.40025L14.434 3.24878L3.1203 14.5625L2.27177 13.714Z"}},{tag:"path",attrs:{fill:"#E5E5E5",d:"M4.2603 1.82495L2.89617 1.82495C2.23343 1.82495 1.69617 2.36221 1.69617 3.02495L1.69617 4.38908L3.02617 4.38908L3.02617 3.15495L4.2603 3.15495L4.2603 1.82495ZM15.0092 4.38908L15.0092 3.02495C15.0092 2.36221 14.4719 1.82495 13.8092 1.82495L12.4451 1.82495L12.4451 3.15495L13.6792 3.15495L13.6792 4.38908L15.0092 4.38908ZM6.98856 1.82495L6.98856 3.15495L9.71681 3.15495L9.71681 1.82495L6.98856 1.82495ZM15.0092 7.11734L13.6792 7.11734L13.6792 9.84559L15.0092 9.84559L15.0092 7.11734ZM15.0092 12.5739L13.6792 12.5739L13.6792 13.808L12.4451 13.808L12.4451 15.138L13.8092 15.138C14.4719 15.138 15.0092 14.6007 15.0092 13.938L15.0092 12.5739ZM9.71681 15.138L9.71681 13.808L6.98856 13.808L6.98856 15.138L9.71681 15.138ZM4.2603 15.138L4.2603 13.808L3.02617 13.808L3.02617 12.5739L1.69617 12.5739L1.69617 13.938C1.69617 14.6007 2.23343 15.138 2.89617 15.138L4.2603 15.138ZM1.69617 9.8456L3.02617 9.8456L3.02617 7.11734L1.69617 7.11734L1.69617 9.8456Z"}}]}]},gt=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"slash-single",ref:e,icon:go}))});gt.displayName="SlashSingle";var Gt={exports:{}},ke={},it={exports:{}},vo=it.exports,wn;function vn(){return wn||(wn=1,function(t,e){(function(r,n){n(e)})(vo,function(r){function n(q){return function(ae,O,P,D,V,Y,W){return q(ae,O,W)}}function o(q){return function(ae,O,P,D){if(!ae||!O||typeof ae!="object"||typeof O!="object")return q(ae,O,P,D);var V=D.get(ae),Y=D.get(O);if(V&&Y)return V===O&&Y===ae;D.set(ae,O),D.set(O,ae);var W=q(ae,O,P,D);return D.delete(ae),D.delete(O),W}}function i(q,J){var ae={};for(var O in q)ae[O]=q[O];for(var O in J)ae[O]=J[O];return ae}function l(q){return q.constructor===Object||q.constructor==null}function v(q){return typeof q.then=="function"}function p(q,J){return q===J||q!==q&&J!==J}var R="[object Arguments]",m="[object Boolean]",b="[object Date]",x="[object RegExp]",I="[object Map]",T="[object Number]",w="[object Object]",h="[object Set]",a="[object String]",s=Object.prototype.toString;function f(q){var J=q.areArraysEqual,ae=q.areDatesEqual,O=q.areMapsEqual,P=q.areObjectsEqual,D=q.areRegExpsEqual,V=q.areSetsEqual,Y=q.createIsNestedEqual,W=Y(Z);function Z(K,ee,ue){if(K===ee)return!0;if(!K||!ee||typeof K!="object"||typeof ee!="object")return K!==K&&ee!==ee;if(l(K)&&l(ee))return P(K,ee,W,ue);var Pe=Array.isArray(K),ye=Array.isArray(ee);if(Pe||ye)return Pe===ye&&J(K,ee,W,ue);var he=s.call(K);return he!==s.call(ee)?!1:he===b?ae(K,ee,W,ue):he===x?D(K,ee,W,ue):he===I?O(K,ee,W,ue):he===h?V(K,ee,W,ue):he===w||he===R?v(K)||v(ee)?!1:P(K,ee,W,ue):he===m||he===T||he===a?p(K.valueOf(),ee.valueOf()):!1}return Z}function y(q,J,ae,O){var P=q.length;if(J.length!==P)return!1;for(;P-- >0;)if(!ae(q[P],J[P],P,P,q,J,O))return!1;return!0}var u=o(y);function g(q,J){return p(q.valueOf(),J.valueOf())}function d(q,J,ae,O){var P=q.size===J.size;if(!P)return!1;if(!q.size)return!0;var D={},V=0;return q.forEach(function(Y,W){if(P){var Z=!1,K=0;J.forEach(function(ee,ue){!Z&&!D[K]&&(Z=ae(W,ue,V,K,q,J,O)&&ae(Y,ee,W,ue,q,J,O))&&(D[K]=!0),K++}),V++,P=Z}}),P}var C=o(d),M="_owner",j=Object.prototype.hasOwnProperty;function U(q,J,ae,O){var P=Object.keys(q),D=P.length;if(Object.keys(J).length!==D)return!1;for(var V;D-- >0;){if(V=P[D],V===M){var Y=!!q.$$typeof,W=!!J.$$typeof;if((Y||W)&&Y!==W)return!1}if(!j.call(J,V)||!ae(q[V],J[V],V,V,q,J,O))return!1}return!0}var L=o(U);function E(q,J){return q.source===J.source&&q.flags===J.flags}function F(q,J,ae,O){var P=q.size===J.size;if(!P)return!1;if(!q.size)return!0;var D={};return q.forEach(function(V,Y){if(P){var W=!1,Z=0;J.forEach(function(K,ee){!W&&!D[Z]&&(W=ae(V,K,Y,ee,q,J,O))&&(D[Z]=!0),Z++}),P=W}}),P}var z=o(F),B=Object.freeze({areArraysEqual:y,areDatesEqual:g,areMapsEqual:d,areObjectsEqual:U,areRegExpsEqual:E,areSetsEqual:F,createIsNestedEqual:n}),X=Object.freeze({areArraysEqual:u,areDatesEqual:g,areMapsEqual:C,areObjectsEqual:L,areRegExpsEqual:E,areSetsEqual:z,createIsNestedEqual:n}),te=f(B);function Q(q,J){return te(q,J,void 0)}var H=f(i(B,{createIsNestedEqual:function(){return p}}));function A(q,J){return H(q,J,void 0)}var ne=f(X);function oe(q,J){return ne(q,J,new WeakMap)}var se=f(i(X,{createIsNestedEqual:function(){return p}}));function fe(q,J){return se(q,J,new WeakMap)}function ge(q){return f(i(B,q(B)))}function Se(q){var J=f(i(X,q(X)));return function(ae,O,P){return P===void 0&&(P=new WeakMap),J(ae,O,P)}}r.circularDeepEqual=oe,r.circularShallowEqual=fe,r.createCustomCircularEqual=Se,r.createCustomEqual=ge,r.deepEqual=Q,r.sameValueZeroEqual=p,r.shallowEqual=A,Object.defineProperty(r,"__esModule",{value:!0})})}(it,it.exports)),it.exports}var Ct={exports:{}},_n;function yn(){if(_n)return Ct.exports;_n=1;function t(r){var n,o,i="";if(typeof r=="string"||typeof r=="number")i+=r;else if(typeof r=="object")if(Array.isArray(r)){var l=r.length;for(n=0;n<l;n++)r[n]&&(o=t(r[n]))&&(i&&(i+=" "),i+=o)}else for(o in r)r[o]&&(i&&(i+=" "),i+=o);return i}function e(){for(var r,n,o=0,i="",l=arguments.length;o<l;o++)(r=arguments[o])&&(n=t(r))&&(i&&(i+=" "),i+=n);return i}return Ct.exports=e,Ct.exports.clsx=e,Ct.exports}var ie={},Xt,xn;function yo(){return xn||(xn=1,Xt=function(e,r,n){return e===r?!0:e.className===r.className&&n(e.style,r.style)&&e.width===r.width&&e.autoSize===r.autoSize&&e.cols===r.cols&&e.draggableCancel===r.draggableCancel&&e.draggableHandle===r.draggableHandle&&n(e.verticalCompact,r.verticalCompact)&&n(e.compactType,r.compactType)&&n(e.layout,r.layout)&&n(e.margin,r.margin)&&n(e.containerPadding,r.containerPadding)&&e.rowHeight===r.rowHeight&&e.maxRows===r.maxRows&&e.isBounded===r.isBounded&&e.isDraggable===r.isDraggable&&e.isResizable===r.isResizable&&e.allowOverlap===r.allowOverlap&&e.preventCollision===r.preventCollision&&e.useCSSTransforms===r.useCSSTransforms&&e.transformScale===r.transformScale&&e.isDroppable===r.isDroppable&&n(e.resizeHandles,r.resizeHandles)&&n(e.resizeHandle,r.resizeHandle)&&e.onLayoutChange===r.onLayoutChange&&e.onDragStart===r.onDragStart&&e.onDrag===r.onDrag&&e.onDragStop===r.onDragStop&&e.onResizeStart===r.onResizeStart&&e.onResize===r.onResize&&e.onResizeStop===r.onResizeStop&&e.onDrop===r.onDrop&&n(e.droppingItem,r.droppingItem)&&n(e.innerRef,r.innerRef)}),Xt}var En;function qe(){if(En)return ie;En=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.bottom=n,ie.childrenEqual=p,ie.cloneLayout=o,ie.cloneLayoutItem=v,ie.collides=m,ie.compact=b,ie.compactItem=T,ie.compactType=q,ie.correctBounds=w,ie.fastPositionEqual=R,ie.fastRGLPropsEqual=void 0,ie.getAllCollisions=s,ie.getFirstCollision=a,ie.getLayoutItem=h,ie.getStatics=f,ie.modifyLayout=i,ie.moveElement=y,ie.moveElementAwayFromCollision=u,ie.noop=void 0,ie.perc=g,ie.resizeItemInDirection=H,ie.setTopLeft=ne,ie.setTransform=A,ie.sortLayoutItems=oe,ie.sortLayoutItemsByColRow=fe,ie.sortLayoutItemsByRowCol=se,ie.synchronizeLayoutWithChildren=ge,ie.validateLayout=Se,ie.withLayoutItem=l;var t=vn(),e=r(N);function r(O){return O&&O.__esModule?O:{default:O}}function n(O){let P=0,D;for(let V=0,Y=O.length;V<Y;V++)D=O[V].y+O[V].h,D>P&&(P=D);return P}function o(O){const P=Array(O.length);for(let D=0,V=O.length;D<V;D++)P[D]=v(O[D]);return P}function i(O,P){const D=Array(O.length);for(let V=0,Y=O.length;V<Y;V++)P.i===O[V].i?D[V]=P:D[V]=O[V];return D}function l(O,P,D){let V=h(O,P);return V?(V=D(v(V)),O=i(O,V),[O,V]):[O,null]}function v(O){return{w:O.w,h:O.h,x:O.x,y:O.y,i:O.i,minW:O.minW,maxW:O.maxW,minH:O.minH,maxH:O.maxH,moved:!!O.moved,static:!!O.static,isDraggable:O.isDraggable,isResizable:O.isResizable,resizeHandles:O.resizeHandles,isBounded:O.isBounded}}function p(O,P){return(0,t.deepEqual)(e.default.Children.map(O,D=>D==null?void 0:D.key),e.default.Children.map(P,D=>D==null?void 0:D.key))&&(0,t.deepEqual)(e.default.Children.map(O,D=>D==null?void 0:D.props["data-grid"]),e.default.Children.map(P,D=>D==null?void 0:D.props["data-grid"]))}ie.fastRGLPropsEqual=yo();function R(O,P){return O.left===P.left&&O.top===P.top&&O.width===P.width&&O.height===P.height}function m(O,P){return!(O.i===P.i||O.x+O.w<=P.x||O.x>=P.x+P.w||O.y+O.h<=P.y||O.y>=P.y+P.h)}function b(O,P,D,V){const Y=f(O),W=oe(O,P),Z=Array(O.length);for(let K=0,ee=W.length;K<ee;K++){let ue=v(W[K]);ue.static||(ue=T(Y,ue,P,D,W,V),Y.push(ue)),Z[O.indexOf(W[K])]=ue,ue.moved=!1}return Z}const x={x:"w",y:"h"};function I(O,P,D,V){const Y=x[V];P[V]+=1;const W=O.map(Z=>Z.i).indexOf(P.i);for(let Z=W+1;Z<O.length;Z++){const K=O[Z];if(!K.static){if(K.y>P.y+P.h)break;m(P,K)&&I(O,K,D+P[Y],V)}}P[V]=D}function T(O,P,D,V,Y,W){const Z=D==="vertical",K=D==="horizontal";if(Z)for(P.y=Math.min(n(O),P.y);P.y>0&&!a(O,P);)P.y--;else if(K)for(;P.x>0&&!a(O,P);)P.x--;let ee;for(;(ee=a(O,P))&&!(D===null&&W);)if(K?I(Y,P,ee.x+ee.w,"x"):I(Y,P,ee.y+ee.h,"y"),K&&P.x+P.w>V)for(P.x=V-P.w,P.y++;P.x>0&&!a(O,P);)P.x--;return P.y=Math.max(P.y,0),P.x=Math.max(P.x,0),P}function w(O,P){const D=f(O);for(let V=0,Y=O.length;V<Y;V++){const W=O[V];if(W.x+W.w>P.cols&&(W.x=P.cols-W.w),W.x<0&&(W.x=0,W.w=P.cols),!W.static)D.push(W);else for(;a(D,W);)W.y++}return O}function h(O,P){for(let D=0,V=O.length;D<V;D++)if(O[D].i===P)return O[D]}function a(O,P){for(let D=0,V=O.length;D<V;D++)if(m(O[D],P))return O[D]}function s(O,P){return O.filter(D=>m(D,P))}function f(O){return O.filter(P=>P.static)}function y(O,P,D,V,Y,W,Z,K,ee){if(P.static&&P.isDraggable!==!0||P.y===V&&P.x===D)return O;`${P.i}${String(D)}${String(V)}${P.x}${P.y}`;const ue=P.x,Pe=P.y;typeof D=="number"&&(P.x=D),typeof V=="number"&&(P.y=V),P.moved=!0;let ye=oe(O,Z);(Z==="vertical"&&typeof V=="number"?Pe>=V:Z==="horizontal"&&typeof D=="number"?ue>=D:!1)&&(ye=ye.reverse());const je=s(ye,P),yt=je.length>0;if(yt&&ee)return o(O);if(yt&&W)return`${P.i}`,P.x=ue,P.y=Pe,P.moved=!1,O;for(let kt=0,Vr=je.length;kt<Vr;kt++){const Me=je[kt];`${P.i}${P.x}${P.y}${Me.i}${Me.x}${Me.y}`,!Me.moved&&(Me.static?O=u(O,Me,P,Y,Z):O=u(O,P,Me,Y,Z))}return O}function u(O,P,D,V,Y,W){const Z=Y==="horizontal",K=Y==="vertical",ee=P.static;if(V){V=!1;const ye={x:Z?Math.max(P.x-D.w,0):D.x,y:K?Math.max(P.y-D.h,0):D.y,w:D.w,h:D.h,i:"-1"},he=a(O,ye),je=he&&he.y+he.h>P.y,yt=he&&P.x+P.w>he.x;if(he){if(je&&K)return y(O,D,void 0,P.y+1,V,ee,Y);if(je&&Y==null)return P.y=D.y,D.y=D.y+D.h,O;if(yt&&Z)return y(O,P,D.x,void 0,V,ee,Y)}else return`${D.i}${ye.x}${ye.y}`,y(O,D,Z?ye.x:void 0,K?ye.y:void 0,V,ee,Y)}const ue=Z?D.x+1:void 0,Pe=K?D.y+1:void 0;return ue==null&&Pe==null?O:y(O,D,Z?D.x+1:void 0,K?D.y+1:void 0,V,ee,Y)}function g(O){return O*100+"%"}const d=(O,P,D,V)=>O+D>V?P:D,C=(O,P,D)=>O<0?P:D,M=O=>Math.max(0,O),j=O=>Math.max(0,O),U=(O,P,D)=>{let{left:V,height:Y,width:W}=P;const Z=O.top-(Y-O.height);return{left:V,width:W,height:C(Z,O.height,Y),top:j(Z)}},L=(O,P,D)=>{let{top:V,left:Y,height:W,width:Z}=P;return{top:V,height:W,width:d(O.left,O.width,Z,D),left:M(Y)}},E=(O,P,D)=>{let{top:V,height:Y,width:W}=P;const Z=O.left-(W-O.width);return{height:Y,width:Z<0?O.width:d(O.left,O.width,W,D),top:j(V),left:M(Z)}},F=(O,P,D)=>{let{top:V,left:Y,height:W,width:Z}=P;return{width:Z,left:Y,height:C(V,O.height,W),top:j(V)}},Q={n:U,ne:function(){return U(arguments.length<=0?void 0:arguments[0],L(...arguments))},e:L,se:function(){return F(arguments.length<=0?void 0:arguments[0],L(...arguments))},s:F,sw:function(){return F(arguments.length<=0?void 0:arguments[0],E(...arguments))},w:E,nw:function(){return U(arguments.length<=0?void 0:arguments[0],E(...arguments))}};function H(O,P,D,V){const Y=Q[O];return Y?Y(P,{...P,...D},V):D}function A(O){let{top:P,left:D,width:V,height:Y}=O;const W=`translate(${D}px,${P}px)`;return{transform:W,WebkitTransform:W,MozTransform:W,msTransform:W,OTransform:W,width:`${V}px`,height:`${Y}px`,position:"absolute"}}function ne(O){let{top:P,left:D,width:V,height:Y}=O;return{top:`${P}px`,left:`${D}px`,width:`${V}px`,height:`${Y}px`,position:"absolute"}}function oe(O,P){return P==="horizontal"?fe(O):P==="vertical"?se(O):O}function se(O){return O.slice(0).sort(function(P,D){return P.y>D.y||P.y===D.y&&P.x>D.x?1:P.y===D.y&&P.x===D.x?0:-1})}function fe(O){return O.slice(0).sort(function(P,D){return P.x>D.x||P.x===D.x&&P.y>D.y?1:-1})}function ge(O,P,D,V,Y){O=O||[];const W=[];e.default.Children.forEach(P,K=>{if((K==null?void 0:K.key)==null)return;const ee=h(O,String(K.key)),ue=K.props["data-grid"];ee&&ue==null?W.push(v(ee)):ue?W.push(v({...ue,i:K.key})):W.push(v({w:1,h:1,x:0,y:n(W),i:String(K.key)}))});const Z=w(W,{cols:D});return Y?Z:b(Z,V,D)}function Se(O){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const D=["x","y","w","h"];if(!Array.isArray(O))throw new Error(P+" must be an array!");for(let V=0,Y=O.length;V<Y;V++){const W=O[V];for(let Z=0;Z<D.length;Z++)if(typeof W[D[Z]]!="number")throw new Error("ReactGridLayout: "+P+"["+V+"]."+D[Z]+" must be a number!")}}function q(O){const{verticalCompact:P,compactType:D}=O||{};return P===!1?null:D}function J(){}const ae=()=>{};return ie.noop=ae,ie}var Te={},On;function Cn(){if(On)return Te;On=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.calcGridColWidth=t,Te.calcGridItemPosition=r,Te.calcGridItemWHPx=e,Te.calcWH=o,Te.calcXY=n,Te.clamp=i;function t(l){const{margin:v,containerPadding:p,containerWidth:R,cols:m}=l;return(R-v[0]*(m-1)-p[0]*2)/m}function e(l,v,p){return Number.isFinite(l)?Math.round(v*l+Math.max(0,l-1)*p):l}function r(l,v,p,R,m,b){const{margin:x,containerPadding:I,rowHeight:T}=l,w=t(l),h={};return b&&b.resizing?(h.width=Math.round(b.resizing.width),h.height=Math.round(b.resizing.height)):(h.width=e(R,w,x[0]),h.height=e(m,T,x[1])),b&&b.dragging?(h.top=Math.round(b.dragging.top),h.left=Math.round(b.dragging.left)):b&&b.resizing&&typeof b.resizing.top=="number"&&typeof b.resizing.left=="number"?(h.top=Math.round(b.resizing.top),h.left=Math.round(b.resizing.left)):(h.top=Math.round((T+x[1])*p+I[1]),h.left=Math.round((w+x[0])*v+I[0])),h}function n(l,v,p,R,m){const{margin:b,cols:x,rowHeight:I,maxRows:T}=l,w=t(l);let h=Math.round((p-b[0])/(w+b[0])),a=Math.round((v-b[1])/(I+b[1]));return h=i(h,0,x-R),a=i(a,0,T-m),{x:h,y:a}}function o(l,v,p,R,m,b){const{margin:x,maxRows:I,cols:T,rowHeight:w}=l,h=t(l);let a=Math.round((v+x[0])/(h+x[0])),s=Math.round((p+x[1])/(w+x[1])),f=i(a,0,T-R),y=i(s,0,I-m);return["sw","w","nw"].indexOf(b)!==-1&&(f=i(a,0,T)),["nw","n","ne"].indexOf(b)!==-1&&(y=i(s,0,I)),{w:f,h:y}}function i(l,v,p){return Math.max(Math.min(l,p),v)}return Te}var Be={},Yt={exports:{}},Kt,Pn;function Co(){if(Pn)return Kt;Pn=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Kt=t,Kt}var Zt,Mn;function So(){if(Mn)return Zt;Mn=1;var t=Co();function e(){}function r(){}return r.resetWarningCache=e,Zt=function(){function n(l,v,p,R,m,b){if(b!==t){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}n.isRequired=n;function o(){return n}var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:e};return i.PropTypes=i,i},Zt}var Fn;function Oe(){return Fn||(Fn=1,Yt.exports=So()()),Yt.exports}var Ge={exports:{}},Jt={};function yr(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=yr(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function Dn(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=yr(t))&&(n&&(n+=" "),n+=e);return n}const bo=Object.freeze(Object.defineProperty({__proto__:null,clsx:Dn,default:Dn},Symbol.toStringTag,{value:"Module"})),Ro=hr(bo);var de={},xe={},Nn;function Wt(){if(Nn)return xe;Nn=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.dontSetMe=o,xe.findInArray=t,xe.int=n,xe.isFunction=e,xe.isNum=r;function t(i,l){for(let v=0,p=i.length;v<p;v++)if(l.apply(l,[i[v],v,i]))return i[v]}function e(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Function]"}function r(i){return typeof i=="number"&&!isNaN(i)}function n(i){return parseInt(i,10)}function o(i,l,v){if(i[l])return new Error("Invalid prop ".concat(l," passed to ").concat(v," - do not set this, set it on the child."))}return xe}var Ee={},jn;function To(){if(jn)return Ee;jn=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.browserPrefixToKey=r,Ee.browserPrefixToStyle=n,Ee.default=void 0,Ee.getPrefix=e;const t=["Moz","Webkit","O","ms"];function e(){var i;let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const v=(i=window.document)===null||i===void 0||(i=i.documentElement)===null||i===void 0?void 0:i.style;if(!v||l in v)return"";for(let p=0;p<t.length;p++)if(r(l,t[p])in v)return t[p];return""}function r(i,l){return l?"".concat(l).concat(o(i)):i}function n(i,l){return l?"-".concat(l.toLowerCase(),"-").concat(i):i}function o(i){let l="",v=!0;for(let p=0;p<i.length;p++)v?(l+=i[p].toUpperCase(),v=!1):i[p]==="-"?v=!0:l+=i[p];return l}return Ee.default=e(),Ee}var Ln;function Sn(){if(Ln)return de;Ln=1,Object.defineProperty(de,"__esModule",{value:!0}),de.addClassName=u,de.addEvent=v,de.addUserSelectStyles=f,de.createCSSTransform=T,de.createSVGTransform=w,de.getTouch=a,de.getTouchIdentifier=s,de.getTranslation=h,de.innerHeight=b,de.innerWidth=x,de.matchesSelector=i,de.matchesSelectorAndParentsTo=l,de.offsetXYFromParent=I,de.outerHeight=R,de.outerWidth=m,de.removeClassName=g,de.removeEvent=p,de.removeUserSelectStyles=y;var t=Wt(),e=n(To());function r(d){if(typeof WeakMap!="function")return null;var C=new WeakMap,M=new WeakMap;return(r=function(j){return j?M:C})(d)}function n(d,C){if(d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var M=r(C);if(M&&M.has(d))return M.get(d);var j={},U=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var L in d)if(L!=="default"&&Object.prototype.hasOwnProperty.call(d,L)){var E=U?Object.getOwnPropertyDescriptor(d,L):null;E&&(E.get||E.set)?Object.defineProperty(j,L,E):j[L]=d[L]}return j.default=d,M&&M.set(d,j),j}let o="";function i(d,C){return o||(o=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(M){return(0,t.isFunction)(d[M])})),(0,t.isFunction)(d[o])?d[o](C):!1}function l(d,C,M){let j=d;do{if(i(j,C))return!0;if(j===M)return!1;j=j.parentNode}while(j);return!1}function v(d,C,M,j){if(!d)return;const U={capture:!0,...j};d.addEventListener?d.addEventListener(C,M,U):d.attachEvent?d.attachEvent("on"+C,M):d["on"+C]=M}function p(d,C,M,j){if(!d)return;const U={capture:!0,...j};d.removeEventListener?d.removeEventListener(C,M,U):d.detachEvent?d.detachEvent("on"+C,M):d["on"+C]=null}function R(d){let C=d.clientHeight;const M=d.ownerDocument.defaultView.getComputedStyle(d);return C+=(0,t.int)(M.borderTopWidth),C+=(0,t.int)(M.borderBottomWidth),C}function m(d){let C=d.clientWidth;const M=d.ownerDocument.defaultView.getComputedStyle(d);return C+=(0,t.int)(M.borderLeftWidth),C+=(0,t.int)(M.borderRightWidth),C}function b(d){let C=d.clientHeight;const M=d.ownerDocument.defaultView.getComputedStyle(d);return C-=(0,t.int)(M.paddingTop),C-=(0,t.int)(M.paddingBottom),C}function x(d){let C=d.clientWidth;const M=d.ownerDocument.defaultView.getComputedStyle(d);return C-=(0,t.int)(M.paddingLeft),C-=(0,t.int)(M.paddingRight),C}function I(d,C,M){const U=C===C.ownerDocument.body?{left:0,top:0}:C.getBoundingClientRect(),L=(d.clientX+C.scrollLeft-U.left)/M,E=(d.clientY+C.scrollTop-U.top)/M;return{x:L,y:E}}function T(d,C){const M=h(d,C,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:M}}function w(d,C){return h(d,C,"")}function h(d,C,M){let{x:j,y:U}=d,L="translate(".concat(j).concat(M,",").concat(U).concat(M,")");if(C){const E="".concat(typeof C.x=="string"?C.x:C.x+M),F="".concat(typeof C.y=="string"?C.y:C.y+M);L="translate(".concat(E,", ").concat(F,")")+L}return L}function a(d,C){return d.targetTouches&&(0,t.findInArray)(d.targetTouches,M=>C===M.identifier)||d.changedTouches&&(0,t.findInArray)(d.changedTouches,M=>C===M.identifier)}function s(d){if(d.targetTouches&&d.targetTouches[0])return d.targetTouches[0].identifier;if(d.changedTouches&&d.changedTouches[0])return d.changedTouches[0].identifier}function f(d){if(!d)return;let C=d.getElementById("react-draggable-style-el");C||(C=d.createElement("style"),C.type="text/css",C.id="react-draggable-style-el",C.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
10
10
|
`,C.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
11
|
-
`,d.getElementsByTagName("head")[0].appendChild(C)),d.body&&u(d.body,"react-draggable-transparent-selection")}function y(d){if(d)try{if(d.body&&g(d.body,"react-draggable-transparent-selection"),d.selection)d.selection.empty();else{const C=(d.defaultView||window).getSelection();C&&C.type!=="Caret"&&C.removeAllRanges()}}catch{}}function u(d,C){d.classList?d.classList.add(C):d.className.match(new RegExp("(?:^|\\s)".concat(C,"(?!\\S)")))||(d.className+=" ".concat(C))}function g(d,C){d.classList?d.classList.remove(C):d.className=d.className.replace(new RegExp("(?:^|\\s)".concat(C,"(?!\\S)"),"g"),"")}return de}var Re={},Ln;function yr(){if(Ln)return Re;Ln=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.canDragX=o,Re.canDragY=i,Re.createCoreData=v,Re.createDraggableData=p,Re.getBoundPosition=r,Re.getControlPosition=l,Re.snapToGrid=n;var t=qt(),e=Cn();function r(b,x,I){if(!b.props.bounds)return[x,I];let{bounds:T}=b.props;T=typeof T=="string"?T:R(T);const w=m(b);if(typeof T=="string"){const{ownerDocument:h}=w,a=h.defaultView;let s;if(T==="parent"?s=w.parentNode:s=h.querySelector(T),!(s instanceof a.HTMLElement))throw new Error('Bounds selector "'+T+'" could not find an element.');const f=s,y=a.getComputedStyle(w),u=a.getComputedStyle(f);T={left:-w.offsetLeft+(0,t.int)(u.paddingLeft)+(0,t.int)(y.marginLeft),top:-w.offsetTop+(0,t.int)(u.paddingTop)+(0,t.int)(y.marginTop),right:(0,e.innerWidth)(f)-(0,e.outerWidth)(w)-w.offsetLeft+(0,t.int)(u.paddingRight)-(0,t.int)(y.marginRight),bottom:(0,e.innerHeight)(f)-(0,e.outerHeight)(w)-w.offsetTop+(0,t.int)(u.paddingBottom)-(0,t.int)(y.marginBottom)}}return(0,t.isNum)(T.right)&&(x=Math.min(x,T.right)),(0,t.isNum)(T.bottom)&&(I=Math.min(I,T.bottom)),(0,t.isNum)(T.left)&&(x=Math.max(x,T.left)),(0,t.isNum)(T.top)&&(I=Math.max(I,T.top)),[x,I]}function n(b,x,I){const T=Math.round(x/b[0])*b[0],w=Math.round(I/b[1])*b[1];return[T,w]}function o(b){return b.props.axis==="both"||b.props.axis==="x"}function i(b){return b.props.axis==="both"||b.props.axis==="y"}function l(b,x,I){const T=typeof x=="number"?(0,e.getTouch)(b,x):null;if(typeof x=="number"&&!T)return null;const w=m(I),h=I.props.offsetParent||w.offsetParent||w.ownerDocument.body;return(0,e.offsetXYFromParent)(T||b,h,I.props.scale)}function v(b,x,I){const T=!(0,t.isNum)(b.lastX),w=m(b);return T?{node:w,deltaX:0,deltaY:0,lastX:x,lastY:I,x,y:I}:{node:w,deltaX:x-b.lastX,deltaY:I-b.lastY,lastX:b.lastX,lastY:b.lastY,x,y:I}}function p(b,x){const I=b.props.scale;return{node:x.node,x:b.state.x+x.deltaX/I,y:b.state.y+x.deltaY/I,deltaX:x.deltaX/I,deltaY:x.deltaY/I,lastX:b.state.x,lastY:b.state.y}}function R(b){return{left:b.left,top:b.top,right:b.right,bottom:b.bottom}}function m(b){const x=b.findDOMNode();if(!x)throw new Error("<DraggableCore>: Unmounted during event!");return x}return Re}var Xe={},St={},Un;function Cr(){if(Un)return St;Un=1,Object.defineProperty(St,"__esModule",{value:!0}),St.default=t;function t(){}return St}var Vn;function Io(){if(Vn)return Xe;Vn=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.default=void 0;var t=R(N),e=v(Oe()),r=v(dr),n=Cn(),o=yr(),i=qt(),l=v(Cr());function v(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(p=function(f){return f?s:a})(h)}function R(h,a){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(a);if(s&&s.has(h))return s.get(h);var f={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in h)if(u!=="default"&&Object.prototype.hasOwnProperty.call(h,u)){var g=y?Object.getOwnPropertyDescriptor(h,u):null;g&&(g.get||g.set)?Object.defineProperty(f,u,g):f[u]=h[u]}return f.default=h,s&&s.set(h,f),f}function m(h,a,s){return a=b(a),a in h?Object.defineProperty(h,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[a]=s,h}function b(h){var a=x(h,"string");return typeof a=="symbol"?a:String(a)}function x(h,a){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,a||"default");if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(h)}const I={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let T=I.mouse,w=class extends t.Component{constructor(){super(...arguments),m(this,"dragging",!1),m(this,"lastX",NaN),m(this,"lastY",NaN),m(this,"touchIdentifier",null),m(this,"mounted",!1),m(this,"handleDragStart",a=>{if(this.props.onMouseDown(a),!this.props.allowAnyClick&&typeof a.button=="number"&&a.button!==0)return!1;const s=this.findDOMNode();if(!s||!s.ownerDocument||!s.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:f}=s;if(this.props.disabled||!(a.target instanceof f.defaultView.Node)||this.props.handle&&!(0,n.matchesSelectorAndParentsTo)(a.target,this.props.handle,s)||this.props.cancel&&(0,n.matchesSelectorAndParentsTo)(a.target,this.props.cancel,s))return;a.type==="touchstart"&&a.preventDefault();const y=(0,n.getTouchIdentifier)(a);this.touchIdentifier=y;const u=(0,o.getControlPosition)(a,y,this);if(u==null)return;const{x:g,y:d}=u,C=(0,o.createCoreData)(this,g,d);(0,l.default)("DraggableCore: handleDragStart: %j",C),(0,l.default)("calling",this.props.onStart),!(this.props.onStart(a,C)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,n.addUserSelectStyles)(f),this.dragging=!0,this.lastX=g,this.lastY=d,(0,n.addEvent)(f,T.move,this.handleDrag),(0,n.addEvent)(f,T.stop,this.handleDragStop))}),m(this,"handleDrag",a=>{const s=(0,o.getControlPosition)(a,this.touchIdentifier,this);if(s==null)return;let{x:f,y}=s;if(Array.isArray(this.props.grid)){let d=f-this.lastX,C=y-this.lastY;if([d,C]=(0,o.snapToGrid)(this.props.grid,d,C),!d&&!C)return;f=this.lastX+d,y=this.lastY+C}const u=(0,o.createCoreData)(this,f,y);if((0,l.default)("DraggableCore: handleDrag: %j",u),this.props.onDrag(a,u)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const C=document.createEvent("MouseEvents");C.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(C)}return}this.lastX=f,this.lastY=y}),m(this,"handleDragStop",a=>{if(!this.dragging)return;const s=(0,o.getControlPosition)(a,this.touchIdentifier,this);if(s==null)return;let{x:f,y}=s;if(Array.isArray(this.props.grid)){let C=f-this.lastX||0,M=y-this.lastY||0;[C,M]=(0,o.snapToGrid)(this.props.grid,C,M),f=this.lastX+C,y=this.lastY+M}const u=(0,o.createCoreData)(this,f,y);if(this.props.onStop(a,u)===!1||this.mounted===!1)return!1;const d=this.findDOMNode();d&&this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(d.ownerDocument),(0,l.default)("DraggableCore: handleDragStop: %j",u),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,d&&((0,l.default)("DraggableCore: Removing handlers"),(0,n.removeEvent)(d.ownerDocument,T.move,this.handleDrag),(0,n.removeEvent)(d.ownerDocument,T.stop,this.handleDragStop))}),m(this,"onMouseDown",a=>(T=I.mouse,this.handleDragStart(a))),m(this,"onMouseUp",a=>(T=I.mouse,this.handleDragStop(a))),m(this,"onTouchStart",a=>(T=I.touch,this.handleDragStart(a))),m(this,"onTouchEnd",a=>(T=I.touch,this.handleDragStop(a)))}componentDidMount(){this.mounted=!0;const a=this.findDOMNode();a&&(0,n.addEvent)(a,I.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const a=this.findDOMNode();if(a){const{ownerDocument:s}=a;(0,n.removeEvent)(s,I.mouse.move,this.handleDrag),(0,n.removeEvent)(s,I.touch.move,this.handleDrag),(0,n.removeEvent)(s,I.mouse.stop,this.handleDragStop),(0,n.removeEvent)(s,I.touch.stop,this.handleDragStop),(0,n.removeEvent)(a,I.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(s)}}findDOMNode(){var a,s;return(a=this.props)!==null&&a!==void 0&&a.nodeRef?(s=this.props)===null||s===void 0||(s=s.nodeRef)===null||s===void 0?void 0:s.current:r.default.findDOMNode(this)}render(){return t.cloneElement(t.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Xe.default=w,m(w,"displayName","DraggableCore"),m(w,"propTypes",{allowAnyClick:e.default.bool,children:e.default.node.isRequired,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:function(h,a){if(h[a]&&h[a].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:e.default.arrayOf(e.default.number),handle:e.default.string,cancel:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number,className:i.dontSetMe,style:i.dontSetMe,transform:i.dontSetMe}),m(w,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Xe}var $n;function wo(){return $n||($n=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return p.default}}),t.default=void 0;var e=x(N),r=m(Oe()),n=m(dr),o=m(Ro),i=Cn(),l=yr(),v=qt(),p=m(Io()),R=m(Cr());function m(s){return s&&s.__esModule?s:{default:s}}function b(s){if(typeof WeakMap!="function")return null;var f=new WeakMap,y=new WeakMap;return(b=function(u){return u?y:f})(s)}function x(s,f){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var y=b(f);if(y&&y.has(s))return y.get(s);var u={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var C=g?Object.getOwnPropertyDescriptor(s,d):null;C&&(C.get||C.set)?Object.defineProperty(u,d,C):u[d]=s[d]}return u.default=s,y&&y.set(s,u),u}function I(){return I=Object.assign?Object.assign.bind():function(s){for(var f=1;f<arguments.length;f++){var y=arguments[f];for(var u in y)Object.prototype.hasOwnProperty.call(y,u)&&(s[u]=y[u])}return s},I.apply(this,arguments)}function T(s,f,y){return f=w(f),f in s?Object.defineProperty(s,f,{value:y,enumerable:!0,configurable:!0,writable:!0}):s[f]=y,s}function w(s){var f=h(s,"string");return typeof f=="symbol"?f:String(f)}function h(s,f){if(typeof s!="object"||s===null)return s;var y=s[Symbol.toPrimitive];if(y!==void 0){var u=y.call(s,f||"default");if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(s)}class a extends e.Component{static getDerivedStateFromProps(f,y){let{position:u}=f,{prevPropsPosition:g}=y;return u&&(!g||u.x!==g.x||u.y!==g.y)?((0,R.default)("Draggable: getDerivedStateFromProps %j",{position:u,prevPropsPosition:g}),{x:u.x,y:u.y,prevPropsPosition:{...u}}):null}constructor(f){super(f),T(this,"onDragStart",(y,u)=>{if((0,R.default)("Draggable: onDragStart: %j",u),this.props.onStart(y,(0,l.createDraggableData)(this,u))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),T(this,"onDrag",(y,u)=>{if(!this.state.dragging)return!1;(0,R.default)("Draggable: onDrag: %j",u);const g=(0,l.createDraggableData)(this,u),d={x:g.x,y:g.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:j}=d;d.x+=this.state.slackX,d.y+=this.state.slackY;const[U,L]=(0,l.getBoundPosition)(this,d.x,d.y);d.x=U,d.y=L,d.slackX=this.state.slackX+(M-d.x),d.slackY=this.state.slackY+(j-d.y),g.x=d.x,g.y=d.y,g.deltaX=d.x-this.state.x,g.deltaY=d.y-this.state.y}if(this.props.onDrag(y,g)===!1)return!1;this.setState(d)}),T(this,"onDragStop",(y,u)=>{if(!this.state.dragging||this.props.onStop(y,(0,l.createDraggableData)(this,u))===!1)return!1;(0,R.default)("Draggable: onDragStop: %j",u);const d={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:M,y:j}=this.props.position;d.x=M,d.y=j}this.setState(d)}),this.state={dragging:!1,dragged:!1,x:f.position?f.position.x:f.defaultPosition.x,y:f.position?f.position.y:f.defaultPosition.y,prevPropsPosition:{...f.position},slackX:0,slackY:0,isElementSVG:!1},f.position&&!(f.onDrag||f.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var f,y;return(f=(y=this.props)===null||y===void 0||(y=y.nodeRef)===null||y===void 0?void 0:y.current)!==null&&f!==void 0?f:n.default.findDOMNode(this)}render(){const{axis:f,bounds:y,children:u,defaultPosition:g,defaultClassName:d,defaultClassNameDragging:C,defaultClassNameDragged:M,position:j,positionOffset:U,scale:L,...E}=this.props;let F={},z=null;const X=!!!j||this.state.dragging,te=j||g,Q={x:(0,l.canDragX)(this)&&X?this.state.x:te.x,y:(0,l.canDragY)(this)&&X?this.state.y:te.y};this.state.isElementSVG?z=(0,i.createSVGTransform)(Q,U):F=(0,i.createCSSTransform)(Q,U);const H=(0,o.default)(u.props.className||"",d,{[C]:this.state.dragging,[M]:this.state.dragged});return e.createElement(p.default,I({},E,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(u),{className:H,style:{...u.props.style,...F},transform:z}))}}t.default=a,T(a,"displayName","Draggable"),T(a,"propTypes",{...p.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:v.dontSetMe,style:v.dontSetMe,transform:v.dontSetMe}),T(a,"defaultProps",{...p.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Zt)),Zt}var zn;function Sn(){if(zn)return Ge.exports;zn=1;const{default:t,DraggableCore:e}=wo();return Ge.exports=t,Ge.exports.default=t,Ge.exports.DraggableCore=e,Ge.exports}var Ye={exports:{}},Ke={},bt={},An;function _o(){if(An)return bt;An=1,bt.__esModule=!0,bt.cloneElement=v;var t=e(N);function e(p){return p&&p.__esModule?p:{default:p}}function r(p,R){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(p);R&&(b=b.filter(function(x){return Object.getOwnPropertyDescriptor(p,x).enumerable})),m.push.apply(m,b)}return m}function n(p){for(var R=1;R<arguments.length;R++){var m=arguments[R]!=null?arguments[R]:{};R%2?r(Object(m),!0).forEach(function(b){o(p,b,m[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):r(Object(m)).forEach(function(b){Object.defineProperty(p,b,Object.getOwnPropertyDescriptor(m,b))})}return p}function o(p,R,m){return R=i(R),R in p?Object.defineProperty(p,R,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[R]=m,p}function i(p){var R=l(p,"string");return typeof R=="symbol"?R:String(R)}function l(p,R){if(typeof p!="object"||p===null)return p;var m=p[Symbol.toPrimitive];if(m!==void 0){var b=m.call(p,R||"default");if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(p)}function v(p,R){return R.style&&p.props.style&&(R.style=n(n({},p.props.style),R.style)),R.className&&p.props.className&&(R.className=p.props.className+" "+R.className),t.default.cloneElement(p,R)}return bt}var Ze={},qn;function Sr(){if(qn)return Ze;qn=1,Ze.__esModule=!0,Ze.resizableProps=void 0;var t=e(Oe());Sn();function e(n){return n&&n.__esModule?n:{default:n}}var r={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:t.default.node,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){for(var o=arguments.length,i=new Array(o),l=0;l<o;l++)i[l]=arguments[l];var v=i[0];if(v.axis==="both"||v.axis==="y"){var p;return(p=t.default.number).isRequired.apply(p,i)}return t.default.number.apply(t.default,i)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var o=arguments.length,i=new Array(o),l=0;l<o;l++)i[l]=arguments[l];var v=i[0];if(v.axis==="both"||v.axis==="x"){var p;return(p=t.default.number).isRequired.apply(p,i)}return t.default.number.apply(t.default,i)}};return Ze.resizableProps=r,Ze}var Wn;function br(){if(Wn)return Ke;Wn=1,Ke.__esModule=!0,Ke.default=void 0;var t=l(N),e=Sn(),r=_o(),n=Sr(),o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function i(a){if(typeof WeakMap!="function")return null;var s=new WeakMap,f=new WeakMap;return(i=function(u){return u?f:s})(a)}function l(a,s){if(a&&a.__esModule)return a;if(a===null||typeof a!="object"&&typeof a!="function")return{default:a};var f=i(s);if(f&&f.has(a))return f.get(a);var y={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if(g!=="default"&&Object.prototype.hasOwnProperty.call(a,g)){var d=u?Object.getOwnPropertyDescriptor(a,g):null;d&&(d.get||d.set)?Object.defineProperty(y,g,d):y[g]=a[g]}return y.default=a,f&&f.set(a,y),y}function v(){return v=Object.assign?Object.assign.bind():function(a){for(var s=1;s<arguments.length;s++){var f=arguments[s];for(var y in f)Object.prototype.hasOwnProperty.call(f,y)&&(a[y]=f[y])}return a},v.apply(this,arguments)}function p(a,s){if(a==null)return{};var f={},y=Object.keys(a),u,g;for(g=0;g<y.length;g++)u=y[g],!(s.indexOf(u)>=0)&&(f[u]=a[u]);return f}function R(a,s){var f=Object.keys(a);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(a);s&&(y=y.filter(function(u){return Object.getOwnPropertyDescriptor(a,u).enumerable})),f.push.apply(f,y)}return f}function m(a){for(var s=1;s<arguments.length;s++){var f=arguments[s]!=null?arguments[s]:{};s%2?R(Object(f),!0).forEach(function(y){b(a,y,f[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(f)):R(Object(f)).forEach(function(y){Object.defineProperty(a,y,Object.getOwnPropertyDescriptor(f,y))})}return a}function b(a,s,f){return s=x(s),s in a?Object.defineProperty(a,s,{value:f,enumerable:!0,configurable:!0,writable:!0}):a[s]=f,a}function x(a){var s=I(a,"string");return typeof s=="symbol"?s:String(s)}function I(a,s){if(typeof a!="object"||a===null)return a;var f=a[Symbol.toPrimitive];if(f!==void 0){var y=f.call(a,s||"default");if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}function T(a,s){a.prototype=Object.create(s.prototype),a.prototype.constructor=a,w(a,s)}function w(a,s){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(y,u){return y.__proto__=u,y},w(a,s)}var h=function(a){T(s,a);function s(){for(var y,u=arguments.length,g=new Array(u),d=0;d<u;d++)g[d]=arguments[d];return y=a.call.apply(a,[this].concat(g))||this,y.handleRefs={},y.lastHandleRect=null,y.slack=null,y}var f=s.prototype;return f.componentWillUnmount=function(){this.resetData()},f.resetData=function(){this.lastHandleRect=this.slack=null},f.runConstraints=function(u,g){var d=this.props,C=d.minConstraints,M=d.maxConstraints,j=d.lockAspectRatio;if(!C&&!M&&!j)return[u,g];if(j){var U=this.props.width/this.props.height,L=u-this.props.width,E=g-this.props.height;Math.abs(L)>Math.abs(E*U)?g=u/U:u=g*U}var F=u,z=g,B=this.slack||[0,0],X=B[0],te=B[1];return u+=X,g+=te,C&&(u=Math.max(C[0],u),g=Math.max(C[1],g)),M&&(u=Math.min(M[0],u),g=Math.min(M[1],g)),this.slack=[X+(F-u),te+(z-g)],[u,g]},f.resizeHandler=function(u,g){var d=this;return function(C,M){var j=M.node,U=M.deltaX,L=M.deltaY;u==="onResizeStart"&&d.resetData();var E=(d.props.axis==="both"||d.props.axis==="x")&&g!=="n"&&g!=="s",F=(d.props.axis==="both"||d.props.axis==="y")&&g!=="e"&&g!=="w";if(!(!E&&!F)){var z=g[0],B=g[g.length-1],X=j.getBoundingClientRect();if(d.lastHandleRect!=null){if(B==="w"){var te=X.left-d.lastHandleRect.left;U+=te}if(z==="n"){var Q=X.top-d.lastHandleRect.top;L+=Q}}d.lastHandleRect=X,B==="w"&&(U=-U),z==="n"&&(L=-L);var H=d.props.width+(E?U/d.props.transformScale:0),A=d.props.height+(F?L/d.props.transformScale:0),ne=d.runConstraints(H,A);H=ne[0],A=ne[1];var oe=H!==d.props.width||A!==d.props.height,se=typeof d.props[u]=="function"?d.props[u]:null,fe=u==="onResize"&&!oe;se&&!fe&&(C.persist==null||C.persist(),se(C,{node:j,size:{width:H,height:A},handle:g})),u==="onResizeStop"&&d.resetData()}}},f.renderResizeHandle=function(u,g){var d=this.props.handle;if(!d)return t.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+u,ref:g});if(typeof d=="function")return d(u,g);var C=typeof d.type=="string",M=m({ref:g},C?{}:{handleAxis:u});return t.cloneElement(d,M)},f.render=function(){var u=this,g=this.props,d=g.children,C=g.className,M=g.draggableOpts;g.width,g.height,g.handle,g.handleSize,g.lockAspectRatio,g.axis,g.minConstraints,g.maxConstraints,g.onResize,g.onResizeStop,g.onResizeStart;var j=g.resizeHandles;g.transformScale;var U=p(g,o);return(0,r.cloneElement)(d,m(m({},U),{},{className:(C?C+" ":"")+"react-resizable",children:[].concat(d.props.children,j.map(function(L){var E,F=(E=u.handleRefs[L])!=null?E:u.handleRefs[L]=t.createRef();return t.createElement(e.DraggableCore,v({},M,{nodeRef:F,key:"resizableHandle-"+L,onStop:u.resizeHandler("onResizeStop",L),onStart:u.resizeHandler("onResizeStart",L),onDrag:u.resizeHandler("onResize",L)}),u.renderResizeHandle(L,F))}))}))},s}(t.Component);return Ke.default=h,h.propTypes=n.resizableProps,h.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},Ke}var Je={},Hn;function xo(){if(Hn)return Je;Hn=1,Je.__esModule=!0,Je.default=void 0;var t=v(N),e=i(Oe()),r=i(br()),n=Sr(),o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function i(s){return s&&s.__esModule?s:{default:s}}function l(s){if(typeof WeakMap!="function")return null;var f=new WeakMap,y=new WeakMap;return(l=function(g){return g?y:f})(s)}function v(s,f){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var y=l(f);if(y&&y.has(s))return y.get(s);var u={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var C=g?Object.getOwnPropertyDescriptor(s,d):null;C&&(C.get||C.set)?Object.defineProperty(u,d,C):u[d]=s[d]}return u.default=s,y&&y.set(s,u),u}function p(){return p=Object.assign?Object.assign.bind():function(s){for(var f=1;f<arguments.length;f++){var y=arguments[f];for(var u in y)Object.prototype.hasOwnProperty.call(y,u)&&(s[u]=y[u])}return s},p.apply(this,arguments)}function R(s,f){var y=Object.keys(s);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(s);f&&(u=u.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),y.push.apply(y,u)}return y}function m(s){for(var f=1;f<arguments.length;f++){var y=arguments[f]!=null?arguments[f]:{};f%2?R(Object(y),!0).forEach(function(u){b(s,u,y[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(y)):R(Object(y)).forEach(function(u){Object.defineProperty(s,u,Object.getOwnPropertyDescriptor(y,u))})}return s}function b(s,f,y){return f=x(f),f in s?Object.defineProperty(s,f,{value:y,enumerable:!0,configurable:!0,writable:!0}):s[f]=y,s}function x(s){var f=I(s,"string");return typeof f=="symbol"?f:String(f)}function I(s,f){if(typeof s!="object"||s===null)return s;var y=s[Symbol.toPrimitive];if(y!==void 0){var u=y.call(s,f||"default");if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(s)}function T(s,f){if(s==null)return{};var y={},u=Object.keys(s),g,d;for(d=0;d<u.length;d++)g=u[d],!(f.indexOf(g)>=0)&&(y[g]=s[g]);return y}function w(s,f){s.prototype=Object.create(f.prototype),s.prototype.constructor=s,h(s,f)}function h(s,f){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(u,g){return u.__proto__=g,u},h(s,f)}var a=function(s){w(f,s);function f(){for(var u,g=arguments.length,d=new Array(g),C=0;C<g;C++)d[C]=arguments[C];return u=s.call.apply(s,[this].concat(d))||this,u.state={width:u.props.width,height:u.props.height,propsWidth:u.props.width,propsHeight:u.props.height},u.onResize=function(M,j){var U=j.size;u.props.onResize?(M.persist==null||M.persist(),u.setState(U,function(){return u.props.onResize&&u.props.onResize(M,j)})):u.setState(U)},u}f.getDerivedStateFromProps=function(g,d){return d.propsWidth!==g.width||d.propsHeight!==g.height?{width:g.width,height:g.height,propsWidth:g.width,propsHeight:g.height}:null};var y=f.prototype;return y.render=function(){var g=this.props,d=g.handle,C=g.handleSize;g.onResize;var M=g.onResizeStart,j=g.onResizeStop,U=g.draggableOpts,L=g.minConstraints,E=g.maxConstraints,F=g.lockAspectRatio,z=g.axis;g.width,g.height;var B=g.resizeHandles,X=g.style,te=g.transformScale,Q=T(g,o);return t.createElement(r.default,{axis:z,draggableOpts:U,handle:d,handleSize:C,height:this.state.height,lockAspectRatio:F,maxConstraints:E,minConstraints:L,onResizeStart:M,onResize:this.onResize,onResizeStop:j,resizeHandles:B,transformScale:te,width:this.state.width},t.createElement("div",p({},Q,{style:m(m({},X),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},f}(t.Component);return Je.default=a,a.propTypes=m(m({},n.resizableProps),{},{children:e.default.element}),Je}var kn;function Eo(){return kn||(kn=1,Ye.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Ye.exports.Resizable=br().default,Ye.exports.ResizableBox=xo().default),Ye.exports}var Ie={},Bn;function Rr(){if(Bn)return Ie;Bn=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.resizeHandleType=Ie.resizeHandleAxesType=Ie.default=void 0;var t=r(Oe()),e=r(N);function r(i){return i&&i.__esModule?i:{default:i}}const n=Ie.resizeHandleAxesType=t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),o=Ie.resizeHandleType=t.default.oneOfType([t.default.node,t.default.func]);return Ie.default={className:t.default.string,style:t.default.object,width:t.default.number,autoSize:t.default.bool,cols:t.default.number,draggableCancel:t.default.string,draggableHandle:t.default.string,verticalCompact:function(i){i.verticalCompact},compactType:t.default.oneOf(["vertical","horizontal"]),layout:function(i){var l=i.layout;l!==void 0&&qe().validateLayout(l,"layout")},margin:t.default.arrayOf(t.default.number),containerPadding:t.default.arrayOf(t.default.number),rowHeight:t.default.number,maxRows:t.default.number,isBounded:t.default.bool,isDraggable:t.default.bool,isResizable:t.default.bool,allowOverlap:t.default.bool,preventCollision:t.default.bool,useCSSTransforms:t.default.bool,transformScale:t.default.number,isDroppable:t.default.bool,resizeHandles:n,resizeHandle:o,onLayoutChange:t.default.func,onDragStart:t.default.func,onDrag:t.default.func,onDragStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,onResizeStop:t.default.func,onDrop:t.default.func,droppingItem:t.default.shape({i:t.default.string.isRequired,w:t.default.number.isRequired,h:t.default.number.isRequired}),children:function(i,l){const v=i[l],p={};e.default.Children.forEach(v,function(R){if((R==null?void 0:R.key)!=null){if(p[R.key])throw new Error('Duplicate child key "'+R.key+'" found! This will cause problems in ReactGridLayout.');p[R.key]=!0}})},innerRef:t.default.any},Ie}var Gn;function Oo(){if(Gn)return Be;Gn=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.default=void 0;var t=p(N),e=p(Oe()),r=Sn(),n=Eo(),o=qe(),i=yn(),l=Rr(),v=p(vn());function p(I){return I&&I.__esModule?I:{default:I}}function R(I,T,w){return T=m(T),T in I?Object.defineProperty(I,T,{value:w,enumerable:!0,configurable:!0,writable:!0}):I[T]=w,I}function m(I){var T=b(I,"string");return typeof T=="symbol"?T:String(T)}function b(I,T){if(typeof I!="object"||I===null)return I;var w=I[Symbol.toPrimitive];if(w!==void 0){var h=w.call(I,T||"default");if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(I)}let x=class extends t.default.Component{constructor(){super(...arguments),R(this,"state",{resizing:null,dragging:null,className:""}),R(this,"elementRef",t.default.createRef()),R(this,"onDragStart",(T,w)=>{let{node:h}=w;const{onDragStart:a,transformScale:s}=this.props;if(!a)return;const f={top:0,left:0},{offsetParent:y}=h;if(!y)return;const u=y.getBoundingClientRect(),g=h.getBoundingClientRect(),d=g.left/s,C=u.left/s,M=g.top/s,j=u.top/s;f.left=d-C+y.scrollLeft,f.top=M-j+y.scrollTop,this.setState({dragging:f});const{x:U,y:L}=(0,i.calcXY)(this.getPositionParams(),f.top,f.left,this.props.w,this.props.h);return a.call(this,this.props.i,U,L,{e:T,node:h,newPosition:f})}),R(this,"onDrag",(T,w)=>{let{node:h,deltaX:a,deltaY:s}=w;const{onDrag:f}=this.props;if(!f)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let y=this.state.dragging.top+s,u=this.state.dragging.left+a;const{isBounded:g,i:d,w:C,h:M,containerWidth:j}=this.props,U=this.getPositionParams();if(g){const{offsetParent:B}=h;if(B){const{margin:X,rowHeight:te,containerPadding:Q}=this.props,H=B.clientHeight-(0,i.calcGridItemWHPx)(M,te,X[1]);y=(0,i.clamp)(y-Q[1],0,H);const A=(0,i.calcGridColWidth)(U),ne=j-(0,i.calcGridItemWHPx)(C,A,X[0]);u=(0,i.clamp)(u-Q[0],0,ne)}}const L={top:y,left:u};this.setState({dragging:L});const{containerPadding:E}=this.props,{x:F,y:z}=(0,i.calcXY)(U,y-E[1],u-E[0],C,M);return f.call(this,d,F,z,{e:T,node:h,newPosition:L})}),R(this,"onDragStop",(T,w)=>{let{node:h}=w;const{onDragStop:a}=this.props;if(!a)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:s,h:f,i:y,containerPadding:u}=this.props,{left:g,top:d}=this.state.dragging,C={top:d,left:g};this.setState({dragging:null});const{x:M,y:j}=(0,i.calcXY)(this.getPositionParams(),d-u[1],g-u[0],s,f);return a.call(this,y,M,j,{e:T,node:h,newPosition:C})}),R(this,"onResizeStop",(T,w,h)=>this.onResizeHandler(T,w,h,"onResizeStop")),R(this,"onResizeStart",(T,w,h)=>this.onResizeHandler(T,w,h,"onResizeStart")),R(this,"onResize",(T,w,h)=>this.onResizeHandler(T,w,h,"onResize"))}shouldComponentUpdate(T,w){if(this.props.children!==T.children||this.props.droppingPosition!==T.droppingPosition)return!0;const h=(0,i.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),a=(0,i.calcGridItemPosition)(this.getPositionParams(T),T.x,T.y,T.w,T.h,w);return!(0,o.fastPositionEqual)(h,a)||this.props.useCSSTransforms!==T.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(T){this.moveDroppingItem(T)}moveDroppingItem(T){const{droppingPosition:w}=this.props;if(!w)return;const h=this.elementRef.current;if(!h)return;const a=T.droppingPosition||{left:0,top:0},{dragging:s}=this.state,f=s&&w.left!==a.left||w.top!==a.top;if(!s)this.onDragStart(w.e,{node:h,deltaX:w.left,deltaY:w.top});else if(f){const y=w.left-s.left,u=w.top-s.top;this.onDrag(w.e,{node:h,deltaX:y,deltaY:u})}}getPositionParams(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:T.cols,containerPadding:T.containerPadding,containerWidth:T.containerWidth,margin:T.margin,maxRows:T.maxRows,rowHeight:T.rowHeight}}createStyle(T){const{usePercentages:w,containerWidth:h,useCSSTransforms:a}=this.props;let s;return a?s=(0,o.setTransform)(T):(s=(0,o.setTopLeft)(T),w&&(s.left=(0,o.perc)(T.left/h),s.width=(0,o.perc)(T.width/h))),s}mixinDraggable(T,w){return t.default.createElement(r.DraggableCore,{disabled:!w,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},T)}curryResizeHandler(T,w){return(h,a)=>w(h,a,T)}mixinResizable(T,w,h){const{cols:a,minW:s,minH:f,maxW:y,maxH:u,transformScale:g,resizeHandles:d,resizeHandle:C}=this.props,M=this.getPositionParams(),j=(0,i.calcGridItemPosition)(M,0,0,a,0).width,U=(0,i.calcGridItemPosition)(M,0,0,s,f),L=(0,i.calcGridItemPosition)(M,0,0,y,u),E=[U.width,U.height],F=[Math.min(L.width,j),Math.min(L.height,1/0)];return t.default.createElement(n.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:w.width,height:w.height,minConstraints:E,maxConstraints:F,onResizeStop:this.curryResizeHandler(w,this.onResizeStop),onResizeStart:this.curryResizeHandler(w,this.onResizeStart),onResize:this.curryResizeHandler(w,this.onResize),transformScale:g,resizeHandles:d,handle:C},T)}onResizeHandler(T,w,h,a){let{node:s,size:f,handle:y}=w;const u=this.props[a];if(!u)return;const{x:g,y:d,i:C,maxH:M,minH:j,containerWidth:U}=this.props,{minW:L,maxW:E}=this.props;let F=f;s&&(F=(0,o.resizeItemInDirection)(y,h,f,U),this.setState({resizing:a==="onResizeStop"?null:F}));let{w:z,h:B}=(0,i.calcWH)(this.getPositionParams(),F.width,F.height,g,d,y);z=(0,i.clamp)(z,Math.max(L,1),E),B=(0,i.clamp)(B,j,M),u.call(this,C,z,B,{e:T,node:s,size:F,handle:y})}render(){const{x:T,y:w,w:h,h:a,isDraggable:s,isResizable:f,droppingPosition:y,useCSSTransforms:u}=this.props,g=(0,i.calcGridItemPosition)(this.getPositionParams(),T,w,h,a,this.state),d=t.default.Children.only(this.props.children);let C=t.default.cloneElement(d,{ref:this.elementRef,className:(0,v.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":s,"react-draggable-dragging":!!this.state.dragging,dropping:!!y,cssTransforms:u}),style:{...this.props.style,...d.props.style,...this.createStyle(g)}});return C=this.mixinResizable(C,g,f),C=this.mixinDraggable(C,s),C}};return Be.default=x,R(x,"propTypes",{children:e.default.element,cols:e.default.number.isRequired,containerWidth:e.default.number.isRequired,rowHeight:e.default.number.isRequired,margin:e.default.array.isRequired,maxRows:e.default.number.isRequired,containerPadding:e.default.array.isRequired,x:e.default.number.isRequired,y:e.default.number.isRequired,w:e.default.number.isRequired,h:e.default.number.isRequired,minW:function(I,T){const w=I[T];if(typeof w!="number")return new Error("minWidth not Number");if(w>I.w||w>I.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(I,T){const w=I[T];if(typeof w!="number")return new Error("maxWidth not Number");if(w<I.w||w<I.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(I,T){const w=I[T];if(typeof w!="number")return new Error("minHeight not Number");if(w>I.h||w>I.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(I,T){const w=I[T];if(typeof w!="number")return new Error("maxHeight not Number");if(w<I.h||w<I.minH)return new Error("maxHeight smaller than item height/minHeight")},i:e.default.string.isRequired,resizeHandles:l.resizeHandleAxesType,resizeHandle:l.resizeHandleType,onDragStop:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,isDraggable:e.default.bool.isRequired,isResizable:e.default.bool.isRequired,isBounded:e.default.bool.isRequired,static:e.default.bool,useCSSTransforms:e.default.bool.isRequired,transformScale:e.default.number,className:e.default.string,handle:e.default.string,cancel:e.default.string,droppingPosition:e.default.shape({e:e.default.object.isRequired,left:e.default.number.isRequired,top:e.default.number.isRequired})}),R(x,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Be}var Xn;function Tr(){if(Xn)return ke;Xn=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.default=void 0;var t=R(N),e=gn(),r=v(vn()),n=qe(),o=yn(),i=v(Oo()),l=v(Rr());function v(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(p=function(f){return f?s:a})(h)}function R(h,a){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(a);if(s&&s.has(h))return s.get(h);var f={__proto__:null},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in h)if(u!=="default"&&Object.prototype.hasOwnProperty.call(h,u)){var g=y?Object.getOwnPropertyDescriptor(h,u):null;g&&(g.get||g.set)?Object.defineProperty(f,u,g):f[u]=h[u]}return f.default=h,s&&s.set(h,f),f}function m(h,a,s){return a=b(a),a in h?Object.defineProperty(h,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[a]=s,h}function b(h){var a=x(h,"string");return typeof a=="symbol"?a:String(a)}function x(h,a){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,a||"default");if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(h)}const I="react-grid-layout";let T=!1;try{T=/firefox/i.test(navigator.userAgent)}catch{}let w=class extends t.Component{constructor(){super(...arguments),m(this,"state",{activeDrag:null,layout:(0,n.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,n.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),m(this,"dragEnterCounter",0),m(this,"onDragStart",(a,s,f,y)=>{let{e:u,node:g}=y;const{layout:d}=this.state,C=(0,n.getLayoutItem)(d,a);if(!C)return;const M={w:C.w,h:C.h,x:C.x,y:C.y,placeholder:!0,i:a};return this.setState({oldDragItem:(0,n.cloneLayoutItem)(C),oldLayout:d,activeDrag:M}),this.props.onDragStart(d,C,C,null,u,g)}),m(this,"onDrag",(a,s,f,y)=>{let{e:u,node:g}=y;const{oldDragItem:d}=this.state;let{layout:C}=this.state;const{cols:M,allowOverlap:j,preventCollision:U}=this.props,L=(0,n.getLayoutItem)(C,a);if(!L)return;const E={w:L.w,h:L.h,x:L.x,y:L.y,placeholder:!0,i:a};C=(0,n.moveElement)(C,L,s,f,!0,U,(0,n.compactType)(this.props),M,j),this.props.onDrag(C,d,L,E,u,g),this.setState({layout:j?C:(0,n.compact)(C,(0,n.compactType)(this.props),M),activeDrag:E})}),m(this,"onDragStop",(a,s,f,y)=>{let{e:u,node:g}=y;if(!this.state.activeDrag)return;const{oldDragItem:d}=this.state;let{layout:C}=this.state;const{cols:M,preventCollision:j,allowOverlap:U}=this.props,L=(0,n.getLayoutItem)(C,a);if(!L)return;C=(0,n.moveElement)(C,L,s,f,!0,j,(0,n.compactType)(this.props),M,U);const F=U?C:(0,n.compact)(C,(0,n.compactType)(this.props),M);this.props.onDragStop(F,d,L,null,u,g);const{oldLayout:z}=this.state;this.setState({activeDrag:null,layout:F,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(F,z)}),m(this,"onResizeStart",(a,s,f,y)=>{let{e:u,node:g}=y;const{layout:d}=this.state,C=(0,n.getLayoutItem)(d,a);C&&(this.setState({oldResizeItem:(0,n.cloneLayoutItem)(C),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(d,C,C,null,u,g))}),m(this,"onResize",(a,s,f,y)=>{let{e:u,node:g,size:d,handle:C}=y;const{oldResizeItem:M}=this.state,{layout:j}=this.state,{cols:U,preventCollision:L,allowOverlap:E}=this.props;let F=!1,z,B,X;const[te,Q]=(0,n.withLayoutItem)(j,a,A=>{let ne;return B=A.x,X=A.y,["sw","w","nw","n","ne"].indexOf(C)!==-1&&(["sw","nw","w"].indexOf(C)!==-1&&(B=A.x+(A.w-s),s=A.x!==B&&B<0?A.w:s,B=B<0?0:B),["ne","n","nw"].indexOf(C)!==-1&&(X=A.y+(A.h-f),f=A.y!==X&&X<0?A.h:f,X=X<0?0:X),F=!0),L&&!E&&(ne=(0,n.getAllCollisions)(j,{...A,w:s,h:f,x:B,y:X}).filter(se=>se.i!==A.i).length>0,ne&&(X=A.y,f=A.h,B=A.x,s=A.w,F=!1)),A.w=s,A.h=f,A});if(!Q)return;z=te,F&&(z=(0,n.moveElement)(te,Q,B,X,!0,this.props.preventCollision,(0,n.compactType)(this.props),U,E));const H={w:Q.w,h:Q.h,x:Q.x,y:Q.y,static:!0,i:a};this.props.onResize(z,M,Q,H,u,g),this.setState({layout:E?z:(0,n.compact)(z,(0,n.compactType)(this.props),U),activeDrag:H})}),m(this,"onResizeStop",(a,s,f,y)=>{let{e:u,node:g}=y;const{layout:d,oldResizeItem:C}=this.state,{cols:M,allowOverlap:j}=this.props,U=(0,n.getLayoutItem)(d,a),L=j?d:(0,n.compact)(d,(0,n.compactType)(this.props),M);this.props.onResizeStop(L,C,U,null,u,g);const{oldLayout:E}=this.state;this.setState({activeDrag:null,layout:L,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(L,E)}),m(this,"onDragOver",a=>{var te;if(a.preventDefault(),a.stopPropagation(),T&&!((te=a.nativeEvent.target)!=null&&te.classList.contains(I)))return!1;const{droppingItem:s,onDropDragOver:f,margin:y,cols:u,rowHeight:g,maxRows:d,width:C,containerPadding:M,transformScale:j}=this.props,U=f==null?void 0:f(a);if(U===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const L={...s,...U},{layout:E}=this.state,F=a.currentTarget.getBoundingClientRect(),z=a.clientX-F.left,B=a.clientY-F.top,X={left:z/j,top:B/j,e:a};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:Q,top:H}=this.state.droppingPosition;(Q!=z||H!=B)&&this.setState({droppingPosition:X})}}else{const Q={cols:u,margin:y,maxRows:d,rowHeight:g,containerWidth:C,containerPadding:M||y},H=(0,o.calcXY)(Q,B,z,L.w,L.h);this.setState({droppingDOMNode:t.createElement("div",{key:L.i}),droppingPosition:X,layout:[...E,{...L,x:H.x,y:H.y,static:!1,isDraggable:!0}]})}}),m(this,"removeDroppingPlaceholder",()=>{const{droppingItem:a,cols:s}=this.props,{layout:f}=this.state,y=(0,n.compact)(f.filter(u=>u.i!==a.i),(0,n.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:y,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),m(this,"onDragLeave",a=>{a.preventDefault(),a.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),m(this,"onDragEnter",a=>{a.preventDefault(),a.stopPropagation(),this.dragEnterCounter++}),m(this,"onDrop",a=>{a.preventDefault(),a.stopPropagation();const{droppingItem:s}=this.props,{layout:f}=this.state,y=f.find(u=>u.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(f,y,a)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(a,s){let f;return s.activeDrag?null:(!(0,e.deepEqual)(a.layout,s.propsLayout)||a.compactType!==s.compactType?f=a.layout:(0,n.childrenEqual)(a.children,s.children)||(f=s.layout),f?{layout:(0,n.synchronizeLayoutWithChildren)(f,a.children,a.cols,(0,n.compactType)(a),a.allowOverlap),compactType:a.compactType,children:a.children,propsLayout:a.layout}:null)}shouldComponentUpdate(a,s){return this.props.children!==a.children||!(0,n.fastRGLPropsEqual)(this.props,a,e.deepEqual)||this.state.activeDrag!==s.activeDrag||this.state.mounted!==s.mounted||this.state.droppingPosition!==s.droppingPosition}componentDidUpdate(a,s){if(!this.state.activeDrag){const f=this.state.layout,y=s.layout;this.onLayoutMaybeChanged(f,y)}}containerHeight(){if(!this.props.autoSize)return;const a=(0,n.bottom)(this.state.layout),s=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return a*this.props.rowHeight+(a-1)*this.props.margin[1]+s*2+"px"}onLayoutMaybeChanged(a,s){s||(s=this.state.layout),(0,e.deepEqual)(s,a)||this.props.onLayoutChange(a)}placeholder(){const{activeDrag:a}=this.state;if(!a)return null;const{width:s,cols:f,margin:y,containerPadding:u,rowHeight:g,maxRows:d,useCSSTransforms:C,transformScale:M}=this.props;return t.createElement(i.default,{w:a.w,h:a.h,x:a.x,y:a.y,i:a.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:s,cols:f,margin:y,containerPadding:u||y,maxRows:d,rowHeight:g,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:C,transformScale:M},t.createElement("div",null))}processGridItem(a,s){if(!a||!a.key)return;const f=(0,n.getLayoutItem)(this.state.layout,String(a.key));if(!f)return null;const{width:y,cols:u,margin:g,containerPadding:d,rowHeight:C,maxRows:M,isDraggable:j,isResizable:U,isBounded:L,useCSSTransforms:E,transformScale:F,draggableCancel:z,draggableHandle:B,resizeHandles:X,resizeHandle:te}=this.props,{mounted:Q,droppingPosition:H}=this.state,A=typeof f.isDraggable=="boolean"?f.isDraggable:!f.static&&j,ne=typeof f.isResizable=="boolean"?f.isResizable:!f.static&&U,oe=f.resizeHandles||X,se=A&&L&&f.isBounded!==!1;return t.createElement(i.default,{containerWidth:y,cols:u,margin:g,containerPadding:d||g,maxRows:M,rowHeight:C,cancel:z,handle:B,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:A,isResizable:ne,isBounded:se,useCSSTransforms:E&&Q,usePercentages:!Q,transformScale:F,w:f.w,h:f.h,x:f.x,y:f.y,i:f.i,minH:f.minH,minW:f.minW,maxH:f.maxH,maxW:f.maxW,static:f.static,droppingPosition:s?H:void 0,resizeHandles:oe,resizeHandle:te},a)}render(){const{className:a,style:s,isDroppable:f,innerRef:y}=this.props,u=(0,r.default)(I,a),g={height:this.containerHeight(),...s};return t.createElement("div",{ref:y,className:u,style:g,onDrop:f?this.onDrop:n.noop,onDragLeave:f?this.onDragLeave:n.noop,onDragEnter:f?this.onDragEnter:n.noop,onDragOver:f?this.onDragOver:n.noop},t.Children.map(this.props.children,d=>this.processGridItem(d)),f&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return ke.default=w,m(w,"displayName","ReactGridLayout"),m(w,"propTypes",l.default),m(w,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:n.noop,onDragStart:n.noop,onDrag:n.noop,onDragStop:n.noop,onResizeStart:n.noop,onResize:n.noop,onResizeStop:n.noop,onDrop:n.noop,onDropDragOver:n.noop}),ke}var Qe={},Fe={},Yn;function Ir(){if(Yn)return Fe;Yn=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.findOrGenerateResponsiveLayout=n,Fe.getBreakpointFromWidth=e,Fe.getColsFromBreakpoint=r,Fe.sortBreakpoints=o;var t=qe();function e(i,l){const v=o(i);let p=v[0];for(let R=1,m=v.length;R<m;R++){const b=v[R];l>i[b]&&(p=b)}return p}function r(i,l){if(!l[i])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+i+" is missing!");return l[i]}function n(i,l,v,p,R,m){if(i[v])return(0,t.cloneLayout)(i[v]);let b=i[p];const x=o(l),I=x.slice(x.indexOf(v));for(let T=0,w=I.length;T<w;T++){const h=I[T];if(i[h]){b=i[h];break}}return b=(0,t.cloneLayout)(b||[]),(0,t.compact)((0,t.correctBounds)(b,{cols:R}),m,R)}function o(i){return Object.keys(i).sort(function(v,p){return i[v]-i[p]})}return Fe}var Kn;function Po(){if(Kn)return Qe;Kn=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.default=void 0;var t=p(N),e=l(Oe()),r=gn(),n=qe(),o=Ir(),i=l(Tr());function l(h){return h&&h.__esModule?h:{default:h}}function v(h){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(v=function(f){return f?s:a})(h)}function p(h,a){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=v(a);if(s&&s.has(h))return s.get(h);var f={__proto__:null},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in h)if(u!=="default"&&Object.prototype.hasOwnProperty.call(h,u)){var g=y?Object.getOwnPropertyDescriptor(h,u):null;g&&(g.get||g.set)?Object.defineProperty(f,u,g):f[u]=h[u]}return f.default=h,s&&s.set(h,f),f}function R(){return R=Object.assign?Object.assign.bind():function(h){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var f in s)Object.prototype.hasOwnProperty.call(s,f)&&(h[f]=s[f])}return h},R.apply(this,arguments)}function m(h,a,s){return a=b(a),a in h?Object.defineProperty(h,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[a]=s,h}function b(h){var a=x(h,"string");return typeof a=="symbol"?a:String(a)}function x(h,a){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,a||"default");if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(h)}const I=h=>Object.prototype.toString.call(h);function T(h,a){return h==null?null:Array.isArray(h)?h:h[a]}let w=class extends t.Component{constructor(){super(...arguments),m(this,"state",this.generateInitialState()),m(this,"onLayoutChange",a=>{this.props.onLayoutChange(a,{...this.props.layouts,[this.state.breakpoint]:a})})}generateInitialState(){const{width:a,breakpoints:s,layouts:f,cols:y}=this.props,u=(0,o.getBreakpointFromWidth)(s,a),g=(0,o.getColsFromBreakpoint)(u,y),d=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,o.findOrGenerateResponsiveLayout)(f,s,u,u,g,d),breakpoint:u,cols:g}}static getDerivedStateFromProps(a,s){if(!(0,r.deepEqual)(a.layouts,s.layouts)){const{breakpoint:f,cols:y}=s;return{layout:(0,o.findOrGenerateResponsiveLayout)(a.layouts,a.breakpoints,f,f,y,a.compactType),layouts:a.layouts}}return null}componentDidUpdate(a){(this.props.width!=a.width||this.props.breakpoint!==a.breakpoint||!(0,r.deepEqual)(this.props.breakpoints,a.breakpoints)||!(0,r.deepEqual)(this.props.cols,a.cols))&&this.onWidthChange(a)}onWidthChange(a){const{breakpoints:s,cols:f,layouts:y,compactType:u}=this.props,g=this.props.breakpoint||(0,o.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),d=this.state.breakpoint,C=(0,o.getColsFromBreakpoint)(g,f),M={...y};if(d!==g||a.breakpoints!==s||a.cols!==f){d in M||(M[d]=(0,n.cloneLayout)(this.state.layout));let L=(0,o.findOrGenerateResponsiveLayout)(M,s,g,d,C,u);L=(0,n.synchronizeLayoutWithChildren)(L,this.props.children,C,u,this.props.allowOverlap),M[g]=L,this.props.onLayoutChange(L,M),this.props.onBreakpointChange(g,C),this.setState({breakpoint:g,layout:L,cols:C})}const j=T(this.props.margin,g),U=T(this.props.containerPadding,g);this.props.onWidthChange(this.props.width,j,C,U)}render(){const{breakpoint:a,breakpoints:s,cols:f,layouts:y,margin:u,containerPadding:g,onBreakpointChange:d,onLayoutChange:C,onWidthChange:M,...j}=this.props;return t.createElement(i.default,R({},j,{margin:T(u,this.state.breakpoint),containerPadding:T(g,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return Qe.default=w,m(w,"propTypes",{breakpoint:e.default.string,breakpoints:e.default.object,allowOverlap:e.default.bool,cols:e.default.object,margin:e.default.oneOfType([e.default.array,e.default.object]),containerPadding:e.default.oneOfType([e.default.array,e.default.object]),layouts(h,a){if(I(h[a])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+I(h[a]));Object.keys(h[a]).forEach(s=>{if(!(s in h.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,n.validateLayout)(h.layouts[s],"layouts."+s)})},width:e.default.number.isRequired,onBreakpointChange:e.default.func,onLayoutChange:e.default.func,onWidthChange:e.default.func}),m(w,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:n.noop,onLayoutChange:n.noop,onWidthChange:n.noop}),Qe}var Rt={},wr=function(){if(typeof Map<"u")return Map;function t(e,r){var n=-1;return e.some(function(o,i){return o[0]===r?(n=i,!0):!1}),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(r){var n=t(this.__entries__,r),o=this.__entries__[n];return o&&o[1]},e.prototype.set=function(r,n){var o=t(this.__entries__,r);~o?this.__entries__[o][1]=n:this.__entries__.push([r,n])},e.prototype.delete=function(r){var n=this.__entries__,o=t(n,r);~o&&n.splice(o,1)},e.prototype.has=function(r){return!!~t(this.__entries__,r)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var o=0,i=this.__entries__;o<i.length;o++){var l=i[o];r.call(n,l[1],l[0])}},e}()}(),an=typeof window<"u"&&typeof document<"u"&&window.document===document,Mt=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Mo=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Mt):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),Fo=2;function Do(t,e){var r=!1,n=!1,o=0;function i(){r&&(r=!1,t()),n&&v()}function l(){Mo(i)}function v(){var p=Date.now();if(r){if(p-o<Fo)return;n=!0}else r=!0,n=!1,setTimeout(l,e);o=p}return v}var No=20,jo=["top","right","bottom","left","width","height","size","weight"],Lo=typeof MutationObserver<"u",Uo=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Do(this.refresh.bind(this),No)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var r=this.observers_,n=r.indexOf(e);~n&&r.splice(n,1),!r.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(r){return r.gatherActive(),r.hasActive()});return e.forEach(function(r){return r.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!an||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Lo?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!an||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var r=e.propertyName,n=r===void 0?"":r,o=jo.some(function(i){return!!~n.indexOf(i)});o&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),_r=function(t,e){for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];Object.defineProperty(t,o,{value:e[o],enumerable:!1,writable:!1,configurable:!0})}return t},$e=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Mt},xr=Wt(0,0,0,0);function Ft(t){return parseFloat(t)||0}function Zn(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return e.reduce(function(n,o){var i=t["border-"+o+"-width"];return n+Ft(i)},0)}function Vo(t){for(var e=["top","right","bottom","left"],r={},n=0,o=e;n<o.length;n++){var i=o[n],l=t["padding-"+i];r[i]=Ft(l)}return r}function $o(t){var e=t.getBBox();return Wt(0,0,e.width,e.height)}function zo(t){var e=t.clientWidth,r=t.clientHeight;if(!e&&!r)return xr;var n=$e(t).getComputedStyle(t),o=Vo(n),i=o.left+o.right,l=o.top+o.bottom,v=Ft(n.width),p=Ft(n.height);if(n.boxSizing==="border-box"&&(Math.round(v+i)!==e&&(v-=Zn(n,"left","right")+i),Math.round(p+l)!==r&&(p-=Zn(n,"top","bottom")+l)),!qo(t)){var R=Math.round(v+i)-e,m=Math.round(p+l)-r;Math.abs(R)!==1&&(v-=R),Math.abs(m)!==1&&(p-=m)}return Wt(o.left,o.top,v,p)}var Ao=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof $e(t).SVGGraphicsElement}:function(t){return t instanceof $e(t).SVGElement&&typeof t.getBBox=="function"}}();function qo(t){return t===$e(t).document.documentElement}function Wo(t){return an?Ao(t)?$o(t):zo(t):xr}function Ho(t){var e=t.x,r=t.y,n=t.width,o=t.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,l=Object.create(i.prototype);return _r(l,{x:e,y:r,width:n,height:o,top:r,right:e+n,bottom:o+r,left:e}),l}function Wt(t,e,r,n){return{x:t,y:e,width:r,height:n}}var ko=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Wt(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=Wo(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},t}(),Bo=function(){function t(e,r){var n=Ho(r);_r(this,{target:e,contentRect:n})}return t}(),Go=function(){function t(e,r,n){if(this.activeObservations_=[],this.observations_=new wr,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=r,this.callbackCtx_=n}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof $e(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)||(r.set(e,new ko(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof $e(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)&&(r.delete(e),r.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&e.activeObservations_.push(r)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new Bo(n.target,n.broadcastRect())});this.callback_.call(e,r,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),Er=typeof WeakMap<"u"?new WeakMap:new wr,Or=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=Uo.getInstance(),n=new Go(e,r,this);Er.set(this,n)}return t}();["observe","unobserve","disconnect"].forEach(function(t){Or.prototype[t]=function(){var e;return(e=Er.get(this))[t].apply(e,arguments)}});var Xo=function(){return typeof Mt.ResizeObserver<"u"?Mt.ResizeObserver:Or}();const Yo=Object.freeze(Object.defineProperty({__proto__:null,default:Xo},Symbol.toStringTag,{value:"Module"})),Ko=pr(Yo);var Jn;function Zo(){if(Jn)return Rt;Jn=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.default=x;var t=l(N),e=o(Oe()),r=o(Ko),n=o(vn());function o(I){return I&&I.__esModule?I:{default:I}}function i(I){if(typeof WeakMap!="function")return null;var T=new WeakMap,w=new WeakMap;return(i=function(h){return h?w:T})(I)}function l(I,T){if(I&&I.__esModule)return I;if(I===null||typeof I!="object"&&typeof I!="function")return{default:I};var w=i(T);if(w&&w.has(I))return w.get(I);var h={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in I)if(s!=="default"&&Object.prototype.hasOwnProperty.call(I,s)){var f=a?Object.getOwnPropertyDescriptor(I,s):null;f&&(f.get||f.set)?Object.defineProperty(h,s,f):h[s]=I[s]}return h.default=I,w&&w.set(I,h),h}function v(){return v=Object.assign?Object.assign.bind():function(I){for(var T=1;T<arguments.length;T++){var w=arguments[T];for(var h in w)Object.prototype.hasOwnProperty.call(w,h)&&(I[h]=w[h])}return I},v.apply(this,arguments)}function p(I,T,w){return T=R(T),T in I?Object.defineProperty(I,T,{value:w,enumerable:!0,configurable:!0,writable:!0}):I[T]=w,I}function R(I){var T=m(I,"string");return typeof T=="symbol"?T:String(T)}function m(I,T){if(typeof I!="object"||I===null)return I;var w=I[Symbol.toPrimitive];if(w!==void 0){var h=w.call(I,T||"default");if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(I)}const b="react-grid-layout";function x(I){var T;return T=class extends t.Component{constructor(){super(...arguments),p(this,"state",{width:1280}),p(this,"elementRef",t.createRef()),p(this,"mounted",!1),p(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new r.default(a=>{if(this.elementRef.current instanceof HTMLElement){const f=a[0].contentRect.width;this.setState({width:f})}});const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.observe(h)}componentWillUnmount(){this.mounted=!1;const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.unobserve(h),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:h,...a}=this.props;return h&&!this.mounted?t.createElement("div",{className:(0,n.default)(this.props.className,b),style:this.props.style,ref:this.elementRef}):t.createElement(I,v({innerRef:this.elementRef},a,this.state))}},p(T,"defaultProps",{measureBeforeMount:!1}),p(T,"propTypes",{measureBeforeMount:e.default.bool}),T}return Rt}var Qn;function Jo(){return Qn||(Qn=1,function(t){t.exports=Tr().default,t.exports.utils=qe(),t.exports.calculateUtils=yn(),t.exports.Responsive=Po().default,t.exports.Responsive.utils=Ir(),t.exports.WidthProvider=Zo().default}(Bt)),Bt.exports}var Qo=Jo();const ei=Ar(Qo);var ti=Object.defineProperty,ni=Object.getOwnPropertyDescriptor,ri=(t,e,r,n)=>{for(var o=n>1?void 0:n?ni(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&ti(e,r,o),o},oi=(t,e)=>(r,n)=>e(r,n,t);let ze=class extends S.Disposable{constructor(e){super();_e(this,"_initLocal",()=>{});_e(this,"_findReplaceIndex",e=>{const r=/\{([^}]+)?\}/g,n=[];let o=r.exec(e);for(;o;)n.push({startIndex:o.index,key:Number(o[1]),endIndex:o.index+o[0].length-1}),o=r.exec(e);return n});this._localeService=e,this._initLocal()}tWithReactNode(e,...r){const n=this._localeService.getLocales(),o=e.split("."),i=n&&this._localeService.resolveKeyPath(n,o);if(typeof i=="string"){const l=[];return this._findReplaceIndex(i).forEach((v,p,R)=>{const m=R[p-1]||{startIndex:0,endIndex:-1};if(m.endIndex+1<v.startIndex){const b=i.slice(m.endIndex+1,v.startIndex);b&&l.push(b)}if(r[v.key]&&l.push(r[v.key]),p===R.length-1){const b=i.slice(v.endIndex+1);b&&l.push(b)}}),l}return[]}};ze=ri([oi(0,S.Inject(S.LocaleService))],ze);const ii="univer-cf-preview",Tt={cfPreview:ii},We=t=>{var o,i;const e=t.rule;if(!e)return null;const r=N.useMemo(()=>{if(e.type===c.CFRuleType.colorScale){const l=e.config.map((R,m)=>({color:new S.ColorKit(R.color),value:m})),v=l.length-1;return new Array(5).fill("").map((R,m,b)=>m*v/(b.length-1)).map(R=>c.getColorScaleFromValue(l,R))}return null},[e]),n=N.useMemo(()=>{if(e.type===c.CFRuleType.iconSet)return e.config.map(l=>{const v=c.iconMap[l.iconType];return v&&v[Number(l.iconId)]})},[e]);switch(e.type){case c.CFRuleType.dataBar:{const{isGradient:l}=e.config,v={width:"50%",height:"100%"},p=l?`linear-gradient(to right, ${e.config.positiveColor||c.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,R=l?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||c.defaultDataBarNativeColor})`:e.config.nativeColor;return _.jsxs("div",{className:Tt.cfPreview,children:[_.jsx("div",{style:{...v,background:R,border:`1px solid ${e.config.nativeColor||c.defaultDataBarNativeColor}`}}),_.jsx("div",{style:{...v,background:p,border:`1px solid ${e.config.positiveColor||c.defaultDataBarPositiveColor}`}})]})}case c.CFRuleType.colorScale:return r&&_.jsx("div",{className:Tt.cfPreview,children:r.map((l,v)=>_.jsx("div",{style:{width:`${100/r.length}%`,height:"100%",background:l}},v))});case c.CFRuleType.iconSet:return n&&_.jsx("div",{className:Tt.cfPreview,children:n.map((l,v)=>l?_.jsx("img",{style:{height:"100%"},src:l},v):_.jsx(gt,{},v))});case c.CFRuleType.highlightCell:{const{ul:l,st:v,it:p,bl:R,bg:m,cl:b}=e.style,x=(l==null?void 0:l.s)===S.BooleanNumber.TRUE,I=(v==null?void 0:v.s)===S.BooleanNumber.TRUE,T=p===S.BooleanNumber.TRUE,w=R===S.BooleanNumber.TRUE,h=(o=m==null?void 0:m.rgb)!=null?o:c.DEFAULT_BG_COLOR,a=(i=b==null?void 0:b.rgb)!=null?i:c.DEFAULT_FONT_COLOR,s={fontWeight:w?"bold":void 0,fontStyle:T?"italic":void 0,textDecoration:`${x?"underline":""} ${I?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:a};return _.jsx("div",{style:s,className:Tt.cfPreview,children:"123"})}}return null},ai="univer-cf-rule-list",si="univer-rule-selector",li="univer-select",ui="univer-select-selector",ci="univer-select-selection-item",di="univer-select-selection-search-input",fi="univer-btn-list",pi="univer-gap",hi="univer-icon",mi="univer-disabled",gi="univer-rule-item",vi="univer-rule-describe",yi="univer-rule-type",Ci="univer-rule-range",Si="univer-active",bi="univer-draggableHandle",Ri="univer-delete-item",Ti="univer-grid-layout-wrap",Ii="univer-react-grid-item",pe={cfRuleList:ai,ruleSelector:si,select:li,selectSelector:ui,selectSelectionItem:ci,selectSelectionSearchInput:di,btnList:fi,gap:pi,icon:hi,disabled:mi,ruleItem:gi,ruleDescribe:vi,ruleType:yi,ruleRange:Ci,active:Si,draggableHandle:bi,deleteItem:Ri,gridLayoutWrap:Ti,reactGridItem:Ii},wi=(t,e)=>{const r=t.rule;switch(r.type){case c.CFRuleType.colorScale:return e.t("sheet.cf.ruleType.colorScale");case c.CFRuleType.dataBar:return e.t("sheet.cf.ruleType.dataBar");case c.CFRuleType.iconSet:return e.t("sheet.cf.ruleType.iconSet");case c.CFRuleType.highlightCell:switch(r.subType){case c.CFSubRuleType.average:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,e.t("sheet.cf.subRuleType.average"))}case c.CFSubRuleType.duplicateValues:return e.t("sheet.cf.subRuleType.duplicateValues");case c.CFSubRuleType.uniqueValues:return e.t("sheet.cf.subRuleType.uniqueValues");case c.CFSubRuleType.number:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,...Array.isArray(r.value)?r.value.map(o=>String(o)):[String(r.value||"")])}case c.CFSubRuleType.text:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,r.value||"")}case c.CFSubRuleType.timePeriod:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`)}case c.CFSubRuleType.rank:return r.isPercent?r.isBottom?e.t("sheet.cf.preview.describe.bottomNPercent",String(r.value)):e.t("sheet.cf.preview.describe.topNPercent",String(r.value)):r.isBottom?e.t("sheet.cf.preview.describe.bottomN",String(r.value)):e.t("sheet.cf.preview.describe.topN",String(r.value));case c.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let er=0;const _i=t=>{const{onClick:e}=t,r=S.useDependency(c.ConditionalFormattingRuleModel),n=S.useDependency(S.IUniverInstanceService),o=S.useDependency(G.SheetsSelectionsService),i=S.useDependency(S.ICommandService),l=S.useDependency(S.LocaleService),v=S.useDependency(S.Injector),p=S.useDependency(ze),R=me.useObservable(()=>n.getCurrentTypeOfUnit$(S.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),m=R.getUnitId(),b=R.getActiveSheet();if(!b)throw new Error("No active sheet found");const x=b.getSheetId(),[I,T]=N.useState([]),[w,h]=N.useState("2"),[a,s]=N.useState(0),[f,y]=N.useState(-1),[u,g]=N.useState(er),d=N.useRef(null),C=[{label:l.t("sheet.cf.panel.workSheet"),value:"2"},{label:l.t("sheet.cf.panel.selectedRange"),value:"1"}],M=()=>{const H=r.getSubunitRules(m,x);if(!H||!H.length)return[];if(w==="1"){const A=o.getCurrentLastSelection();if(!A)return[];const ne=A.range;return H.filter(se=>se.ranges.some(fe=>S.Rectangle.intersects(fe,ne)))}else if(w==="2")return[...H];return[]},[j,U]=N.useState(M);ce.useHighlightRange(I),N.useEffect(()=>{const H=i.onCommandExecuted(A=>{A.id===G.SetWorksheetActiveOperation.id&&s(Math.random())});return()=>H.dispose()}),N.useEffect(()=>{U(M)},[w,a,m,x]),N.useEffect(()=>{if(w==="2")return;const H=new be.Observable(A=>{const ne=[G.SetSelectionsOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],oe=i.onCommandExecuted(se=>{const{id:fe,params:ge}=se,Se=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getUnitId();ne.includes(fe)&&ge.unitId===Se&&A.next(null)});return()=>oe.dispose()}).pipe(be.debounceTime(16)).subscribe(()=>{U(M)});return()=>{H.unsubscribe()}},[n,w,m,x]),N.useEffect(()=>{const H=r.$ruleChange.subscribe(()=>{s(Math.random())});return()=>H.unsubscribe()},[r]),N.useEffect(()=>{const H=()=>{var se;const oe=Math.max(0,(((se=d.current)==null?void 0:se.getBoundingClientRect().width)||0)-8);return er=oe,oe},ne=new be.Observable(oe=>{const se=document.querySelector(".univer-sidebar");if(se){let fe=setTimeout(()=>{oe.next()},150);const ge=()=>{fe&&clearTimeout(fe),fe=null},Se=q=>{q.propertyName==="width"&&(ge(),oe.next())};return se.addEventListener("transitionend",Se),()=>{ge(),se.removeEventListener("transitionend",Se)}}}).pipe(be.debounceTime(16)).subscribe(()=>{g(H())});return()=>{ne.unsubscribe()}},[]);const L=H=>{var oe;const A=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getUnitId(),ne=(oe=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:oe.getSheetId();if(!A||!ne)throw new Error("No active sheet found");i.executeCommand(st.id,{unitId:A,subUnitId:ne,cfId:H.cfId})},E=(H,A)=>{y(A.y)},F=(H,A,ne)=>{var q;y(-1);const oe=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getUnitId(),se=(q=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:q.getSheetId();if(!oe||!se)throw new Error("No active sheet found");const fe=J=>{const ae=j.length;return Math.min(ae-1,Math.max(0,J))},ge=j[fe(A.y)].cfId,Se=j[fe(ne.y)].cfId;ge!==Se&&i.executeCommand($t.id,{unitId:oe,subUnitId:se,start:{id:ge,type:"self"},end:{id:Se,type:ne.y>A.y?"after":"before"}})},z=()=>{t.onCreate()},B=()=>{w==="2"?i.executeCommand(mt.id):w==="1"&&j.map(A=>({unitId:m,subUnitId:x,cfId:A.cfId})).forEach(A=>{i.executeCommand(st.id,A)})},X=N.useMemo(()=>{const H=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET),A=H.getActiveSheet();return j.filter(ne=>{const oe=ne.ranges;return G.checkRangesEditablePermission(v,H.getUnitId(),A.getSheetId(),oe)})},[j]),te=X.map((H,A)=>({i:H.cfId,x:0,w:12,y:A,h:1,isResizable:!1})),Q=N.useMemo(()=>{const H=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET),A=H.getActiveSheet();return j.every(ne=>{const oe=ne.ranges;return G.checkRangesEditablePermission(v,H.getUnitId(),A.getSheetId(),oe)})},[j]);return _.jsxs("div",{className:pe.cfRuleList,children:[_.jsxs("div",{className:pe.ruleSelector,children:[_.jsx("div",{children:p.tWithReactNode("sheet.cf.panel.managerRuleSelect",_.jsx(re.Select,{className:pe.select,options:C,value:w,onChange:H=>{h(H)}})).map((H,A)=>_.jsx("span",{children:H},A))}),_.jsxs("div",{className:pe.btnList,children:[_.jsx(re.Tooltip,{title:l.t("sheet.cf.panel.createRule"),placement:"bottom",children:_.jsx("div",{className:`
|
|
11
|
+
`,d.getElementsByTagName("head")[0].appendChild(C)),d.body&&u(d.body,"react-draggable-transparent-selection")}function y(d){if(d)try{if(d.body&&g(d.body,"react-draggable-transparent-selection"),d.selection)d.selection.empty();else{const C=(d.defaultView||window).getSelection();C&&C.type!=="Caret"&&C.removeAllRanges()}}catch{}}function u(d,C){d.classList?d.classList.add(C):d.className.match(new RegExp("(?:^|\\s)".concat(C,"(?!\\S)")))||(d.className+=" ".concat(C))}function g(d,C){d.classList?d.classList.remove(C):d.className=d.className.replace(new RegExp("(?:^|\\s)".concat(C,"(?!\\S)"),"g"),"")}return de}var Re={},Un;function Cr(){if(Un)return Re;Un=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.canDragX=o,Re.canDragY=i,Re.createCoreData=v,Re.createDraggableData=p,Re.getBoundPosition=r,Re.getControlPosition=l,Re.snapToGrid=n;var t=Wt(),e=Sn();function r(b,x,I){if(!b.props.bounds)return[x,I];let{bounds:T}=b.props;T=typeof T=="string"?T:R(T);const w=m(b);if(typeof T=="string"){const{ownerDocument:h}=w,a=h.defaultView;let s;if(T==="parent"?s=w.parentNode:s=h.querySelector(T),!(s instanceof a.HTMLElement))throw new Error('Bounds selector "'+T+'" could not find an element.');const f=s,y=a.getComputedStyle(w),u=a.getComputedStyle(f);T={left:-w.offsetLeft+(0,t.int)(u.paddingLeft)+(0,t.int)(y.marginLeft),top:-w.offsetTop+(0,t.int)(u.paddingTop)+(0,t.int)(y.marginTop),right:(0,e.innerWidth)(f)-(0,e.outerWidth)(w)-w.offsetLeft+(0,t.int)(u.paddingRight)-(0,t.int)(y.marginRight),bottom:(0,e.innerHeight)(f)-(0,e.outerHeight)(w)-w.offsetTop+(0,t.int)(u.paddingBottom)-(0,t.int)(y.marginBottom)}}return(0,t.isNum)(T.right)&&(x=Math.min(x,T.right)),(0,t.isNum)(T.bottom)&&(I=Math.min(I,T.bottom)),(0,t.isNum)(T.left)&&(x=Math.max(x,T.left)),(0,t.isNum)(T.top)&&(I=Math.max(I,T.top)),[x,I]}function n(b,x,I){const T=Math.round(x/b[0])*b[0],w=Math.round(I/b[1])*b[1];return[T,w]}function o(b){return b.props.axis==="both"||b.props.axis==="x"}function i(b){return b.props.axis==="both"||b.props.axis==="y"}function l(b,x,I){const T=typeof x=="number"?(0,e.getTouch)(b,x):null;if(typeof x=="number"&&!T)return null;const w=m(I),h=I.props.offsetParent||w.offsetParent||w.ownerDocument.body;return(0,e.offsetXYFromParent)(T||b,h,I.props.scale)}function v(b,x,I){const T=!(0,t.isNum)(b.lastX),w=m(b);return T?{node:w,deltaX:0,deltaY:0,lastX:x,lastY:I,x,y:I}:{node:w,deltaX:x-b.lastX,deltaY:I-b.lastY,lastX:b.lastX,lastY:b.lastY,x,y:I}}function p(b,x){const I=b.props.scale;return{node:x.node,x:b.state.x+x.deltaX/I,y:b.state.y+x.deltaY/I,deltaX:x.deltaX/I,deltaY:x.deltaY/I,lastX:b.state.x,lastY:b.state.y}}function R(b){return{left:b.left,top:b.top,right:b.right,bottom:b.bottom}}function m(b){const x=b.findDOMNode();if(!x)throw new Error("<DraggableCore>: Unmounted during event!");return x}return Re}var Xe={},St={},Vn;function Sr(){if(Vn)return St;Vn=1,Object.defineProperty(St,"__esModule",{value:!0}),St.default=t;function t(){}return St}var $n;function Io(){if($n)return Xe;$n=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.default=void 0;var t=R(N),e=v(Oe()),r=v(fr),n=Sn(),o=Cr(),i=Wt(),l=v(Sr());function v(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(p=function(f){return f?s:a})(h)}function R(h,a){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(a);if(s&&s.has(h))return s.get(h);var f={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in h)if(u!=="default"&&Object.prototype.hasOwnProperty.call(h,u)){var g=y?Object.getOwnPropertyDescriptor(h,u):null;g&&(g.get||g.set)?Object.defineProperty(f,u,g):f[u]=h[u]}return f.default=h,s&&s.set(h,f),f}function m(h,a,s){return a=b(a),a in h?Object.defineProperty(h,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[a]=s,h}function b(h){var a=x(h,"string");return typeof a=="symbol"?a:String(a)}function x(h,a){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,a||"default");if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(h)}const I={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let T=I.mouse,w=class extends t.Component{constructor(){super(...arguments),m(this,"dragging",!1),m(this,"lastX",NaN),m(this,"lastY",NaN),m(this,"touchIdentifier",null),m(this,"mounted",!1),m(this,"handleDragStart",a=>{if(this.props.onMouseDown(a),!this.props.allowAnyClick&&typeof a.button=="number"&&a.button!==0)return!1;const s=this.findDOMNode();if(!s||!s.ownerDocument||!s.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:f}=s;if(this.props.disabled||!(a.target instanceof f.defaultView.Node)||this.props.handle&&!(0,n.matchesSelectorAndParentsTo)(a.target,this.props.handle,s)||this.props.cancel&&(0,n.matchesSelectorAndParentsTo)(a.target,this.props.cancel,s))return;a.type==="touchstart"&&a.preventDefault();const y=(0,n.getTouchIdentifier)(a);this.touchIdentifier=y;const u=(0,o.getControlPosition)(a,y,this);if(u==null)return;const{x:g,y:d}=u,C=(0,o.createCoreData)(this,g,d);(0,l.default)("DraggableCore: handleDragStart: %j",C),(0,l.default)("calling",this.props.onStart),!(this.props.onStart(a,C)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,n.addUserSelectStyles)(f),this.dragging=!0,this.lastX=g,this.lastY=d,(0,n.addEvent)(f,T.move,this.handleDrag),(0,n.addEvent)(f,T.stop,this.handleDragStop))}),m(this,"handleDrag",a=>{const s=(0,o.getControlPosition)(a,this.touchIdentifier,this);if(s==null)return;let{x:f,y}=s;if(Array.isArray(this.props.grid)){let d=f-this.lastX,C=y-this.lastY;if([d,C]=(0,o.snapToGrid)(this.props.grid,d,C),!d&&!C)return;f=this.lastX+d,y=this.lastY+C}const u=(0,o.createCoreData)(this,f,y);if((0,l.default)("DraggableCore: handleDrag: %j",u),this.props.onDrag(a,u)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const C=document.createEvent("MouseEvents");C.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(C)}return}this.lastX=f,this.lastY=y}),m(this,"handleDragStop",a=>{if(!this.dragging)return;const s=(0,o.getControlPosition)(a,this.touchIdentifier,this);if(s==null)return;let{x:f,y}=s;if(Array.isArray(this.props.grid)){let C=f-this.lastX||0,M=y-this.lastY||0;[C,M]=(0,o.snapToGrid)(this.props.grid,C,M),f=this.lastX+C,y=this.lastY+M}const u=(0,o.createCoreData)(this,f,y);if(this.props.onStop(a,u)===!1||this.mounted===!1)return!1;const d=this.findDOMNode();d&&this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(d.ownerDocument),(0,l.default)("DraggableCore: handleDragStop: %j",u),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,d&&((0,l.default)("DraggableCore: Removing handlers"),(0,n.removeEvent)(d.ownerDocument,T.move,this.handleDrag),(0,n.removeEvent)(d.ownerDocument,T.stop,this.handleDragStop))}),m(this,"onMouseDown",a=>(T=I.mouse,this.handleDragStart(a))),m(this,"onMouseUp",a=>(T=I.mouse,this.handleDragStop(a))),m(this,"onTouchStart",a=>(T=I.touch,this.handleDragStart(a))),m(this,"onTouchEnd",a=>(T=I.touch,this.handleDragStop(a)))}componentDidMount(){this.mounted=!0;const a=this.findDOMNode();a&&(0,n.addEvent)(a,I.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const a=this.findDOMNode();if(a){const{ownerDocument:s}=a;(0,n.removeEvent)(s,I.mouse.move,this.handleDrag),(0,n.removeEvent)(s,I.touch.move,this.handleDrag),(0,n.removeEvent)(s,I.mouse.stop,this.handleDragStop),(0,n.removeEvent)(s,I.touch.stop,this.handleDragStop),(0,n.removeEvent)(a,I.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(s)}}findDOMNode(){var a,s;return(a=this.props)!==null&&a!==void 0&&a.nodeRef?(s=this.props)===null||s===void 0||(s=s.nodeRef)===null||s===void 0?void 0:s.current:r.default.findDOMNode(this)}render(){return t.cloneElement(t.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Xe.default=w,m(w,"displayName","DraggableCore"),m(w,"propTypes",{allowAnyClick:e.default.bool,children:e.default.node.isRequired,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:function(h,a){if(h[a]&&h[a].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:e.default.arrayOf(e.default.number),handle:e.default.string,cancel:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number,className:i.dontSetMe,style:i.dontSetMe,transform:i.dontSetMe}),m(w,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Xe}var zn;function wo(){return zn||(zn=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return p.default}}),t.default=void 0;var e=x(N),r=m(Oe()),n=m(fr),o=m(Ro),i=Sn(),l=Cr(),v=Wt(),p=m(Io()),R=m(Sr());function m(s){return s&&s.__esModule?s:{default:s}}function b(s){if(typeof WeakMap!="function")return null;var f=new WeakMap,y=new WeakMap;return(b=function(u){return u?y:f})(s)}function x(s,f){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var y=b(f);if(y&&y.has(s))return y.get(s);var u={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var C=g?Object.getOwnPropertyDescriptor(s,d):null;C&&(C.get||C.set)?Object.defineProperty(u,d,C):u[d]=s[d]}return u.default=s,y&&y.set(s,u),u}function I(){return I=Object.assign?Object.assign.bind():function(s){for(var f=1;f<arguments.length;f++){var y=arguments[f];for(var u in y)Object.prototype.hasOwnProperty.call(y,u)&&(s[u]=y[u])}return s},I.apply(this,arguments)}function T(s,f,y){return f=w(f),f in s?Object.defineProperty(s,f,{value:y,enumerable:!0,configurable:!0,writable:!0}):s[f]=y,s}function w(s){var f=h(s,"string");return typeof f=="symbol"?f:String(f)}function h(s,f){if(typeof s!="object"||s===null)return s;var y=s[Symbol.toPrimitive];if(y!==void 0){var u=y.call(s,f||"default");if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(s)}class a extends e.Component{static getDerivedStateFromProps(f,y){let{position:u}=f,{prevPropsPosition:g}=y;return u&&(!g||u.x!==g.x||u.y!==g.y)?((0,R.default)("Draggable: getDerivedStateFromProps %j",{position:u,prevPropsPosition:g}),{x:u.x,y:u.y,prevPropsPosition:{...u}}):null}constructor(f){super(f),T(this,"onDragStart",(y,u)=>{if((0,R.default)("Draggable: onDragStart: %j",u),this.props.onStart(y,(0,l.createDraggableData)(this,u))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),T(this,"onDrag",(y,u)=>{if(!this.state.dragging)return!1;(0,R.default)("Draggable: onDrag: %j",u);const g=(0,l.createDraggableData)(this,u),d={x:g.x,y:g.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:j}=d;d.x+=this.state.slackX,d.y+=this.state.slackY;const[U,L]=(0,l.getBoundPosition)(this,d.x,d.y);d.x=U,d.y=L,d.slackX=this.state.slackX+(M-d.x),d.slackY=this.state.slackY+(j-d.y),g.x=d.x,g.y=d.y,g.deltaX=d.x-this.state.x,g.deltaY=d.y-this.state.y}if(this.props.onDrag(y,g)===!1)return!1;this.setState(d)}),T(this,"onDragStop",(y,u)=>{if(!this.state.dragging||this.props.onStop(y,(0,l.createDraggableData)(this,u))===!1)return!1;(0,R.default)("Draggable: onDragStop: %j",u);const d={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:M,y:j}=this.props.position;d.x=M,d.y=j}this.setState(d)}),this.state={dragging:!1,dragged:!1,x:f.position?f.position.x:f.defaultPosition.x,y:f.position?f.position.y:f.defaultPosition.y,prevPropsPosition:{...f.position},slackX:0,slackY:0,isElementSVG:!1},f.position&&!(f.onDrag||f.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var f,y;return(f=(y=this.props)===null||y===void 0||(y=y.nodeRef)===null||y===void 0?void 0:y.current)!==null&&f!==void 0?f:n.default.findDOMNode(this)}render(){const{axis:f,bounds:y,children:u,defaultPosition:g,defaultClassName:d,defaultClassNameDragging:C,defaultClassNameDragged:M,position:j,positionOffset:U,scale:L,...E}=this.props;let F={},z=null;const X=!!!j||this.state.dragging,te=j||g,Q={x:(0,l.canDragX)(this)&&X?this.state.x:te.x,y:(0,l.canDragY)(this)&&X?this.state.y:te.y};this.state.isElementSVG?z=(0,i.createSVGTransform)(Q,U):F=(0,i.createCSSTransform)(Q,U);const H=(0,o.default)(u.props.className||"",d,{[C]:this.state.dragging,[M]:this.state.dragged});return e.createElement(p.default,I({},E,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(u),{className:H,style:{...u.props.style,...F},transform:z}))}}t.default=a,T(a,"displayName","Draggable"),T(a,"propTypes",{...p.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:v.dontSetMe,style:v.dontSetMe,transform:v.dontSetMe}),T(a,"defaultProps",{...p.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Jt)),Jt}var An;function bn(){if(An)return Ge.exports;An=1;const{default:t,DraggableCore:e}=wo();return Ge.exports=t,Ge.exports.default=t,Ge.exports.DraggableCore=e,Ge.exports}var Ye={exports:{}},Ke={},bt={},qn;function _o(){if(qn)return bt;qn=1,bt.__esModule=!0,bt.cloneElement=v;var t=e(N);function e(p){return p&&p.__esModule?p:{default:p}}function r(p,R){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(p);R&&(b=b.filter(function(x){return Object.getOwnPropertyDescriptor(p,x).enumerable})),m.push.apply(m,b)}return m}function n(p){for(var R=1;R<arguments.length;R++){var m=arguments[R]!=null?arguments[R]:{};R%2?r(Object(m),!0).forEach(function(b){o(p,b,m[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):r(Object(m)).forEach(function(b){Object.defineProperty(p,b,Object.getOwnPropertyDescriptor(m,b))})}return p}function o(p,R,m){return R=i(R),R in p?Object.defineProperty(p,R,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[R]=m,p}function i(p){var R=l(p,"string");return typeof R=="symbol"?R:String(R)}function l(p,R){if(typeof p!="object"||p===null)return p;var m=p[Symbol.toPrimitive];if(m!==void 0){var b=m.call(p,R||"default");if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(p)}function v(p,R){return R.style&&p.props.style&&(R.style=n(n({},p.props.style),R.style)),R.className&&p.props.className&&(R.className=p.props.className+" "+R.className),t.default.cloneElement(p,R)}return bt}var Ze={},Wn;function br(){if(Wn)return Ze;Wn=1,Ze.__esModule=!0,Ze.resizableProps=void 0;var t=e(Oe());bn();function e(n){return n&&n.__esModule?n:{default:n}}var r={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:t.default.node,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){for(var o=arguments.length,i=new Array(o),l=0;l<o;l++)i[l]=arguments[l];var v=i[0];if(v.axis==="both"||v.axis==="y"){var p;return(p=t.default.number).isRequired.apply(p,i)}return t.default.number.apply(t.default,i)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var o=arguments.length,i=new Array(o),l=0;l<o;l++)i[l]=arguments[l];var v=i[0];if(v.axis==="both"||v.axis==="x"){var p;return(p=t.default.number).isRequired.apply(p,i)}return t.default.number.apply(t.default,i)}};return Ze.resizableProps=r,Ze}var Hn;function Rr(){if(Hn)return Ke;Hn=1,Ke.__esModule=!0,Ke.default=void 0;var t=l(N),e=bn(),r=_o(),n=br(),o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function i(a){if(typeof WeakMap!="function")return null;var s=new WeakMap,f=new WeakMap;return(i=function(u){return u?f:s})(a)}function l(a,s){if(a&&a.__esModule)return a;if(a===null||typeof a!="object"&&typeof a!="function")return{default:a};var f=i(s);if(f&&f.has(a))return f.get(a);var y={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if(g!=="default"&&Object.prototype.hasOwnProperty.call(a,g)){var d=u?Object.getOwnPropertyDescriptor(a,g):null;d&&(d.get||d.set)?Object.defineProperty(y,g,d):y[g]=a[g]}return y.default=a,f&&f.set(a,y),y}function v(){return v=Object.assign?Object.assign.bind():function(a){for(var s=1;s<arguments.length;s++){var f=arguments[s];for(var y in f)Object.prototype.hasOwnProperty.call(f,y)&&(a[y]=f[y])}return a},v.apply(this,arguments)}function p(a,s){if(a==null)return{};var f={},y=Object.keys(a),u,g;for(g=0;g<y.length;g++)u=y[g],!(s.indexOf(u)>=0)&&(f[u]=a[u]);return f}function R(a,s){var f=Object.keys(a);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(a);s&&(y=y.filter(function(u){return Object.getOwnPropertyDescriptor(a,u).enumerable})),f.push.apply(f,y)}return f}function m(a){for(var s=1;s<arguments.length;s++){var f=arguments[s]!=null?arguments[s]:{};s%2?R(Object(f),!0).forEach(function(y){b(a,y,f[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(f)):R(Object(f)).forEach(function(y){Object.defineProperty(a,y,Object.getOwnPropertyDescriptor(f,y))})}return a}function b(a,s,f){return s=x(s),s in a?Object.defineProperty(a,s,{value:f,enumerable:!0,configurable:!0,writable:!0}):a[s]=f,a}function x(a){var s=I(a,"string");return typeof s=="symbol"?s:String(s)}function I(a,s){if(typeof a!="object"||a===null)return a;var f=a[Symbol.toPrimitive];if(f!==void 0){var y=f.call(a,s||"default");if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}function T(a,s){a.prototype=Object.create(s.prototype),a.prototype.constructor=a,w(a,s)}function w(a,s){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(y,u){return y.__proto__=u,y},w(a,s)}var h=function(a){T(s,a);function s(){for(var y,u=arguments.length,g=new Array(u),d=0;d<u;d++)g[d]=arguments[d];return y=a.call.apply(a,[this].concat(g))||this,y.handleRefs={},y.lastHandleRect=null,y.slack=null,y}var f=s.prototype;return f.componentWillUnmount=function(){this.resetData()},f.resetData=function(){this.lastHandleRect=this.slack=null},f.runConstraints=function(u,g){var d=this.props,C=d.minConstraints,M=d.maxConstraints,j=d.lockAspectRatio;if(!C&&!M&&!j)return[u,g];if(j){var U=this.props.width/this.props.height,L=u-this.props.width,E=g-this.props.height;Math.abs(L)>Math.abs(E*U)?g=u/U:u=g*U}var F=u,z=g,B=this.slack||[0,0],X=B[0],te=B[1];return u+=X,g+=te,C&&(u=Math.max(C[0],u),g=Math.max(C[1],g)),M&&(u=Math.min(M[0],u),g=Math.min(M[1],g)),this.slack=[X+(F-u),te+(z-g)],[u,g]},f.resizeHandler=function(u,g){var d=this;return function(C,M){var j=M.node,U=M.deltaX,L=M.deltaY;u==="onResizeStart"&&d.resetData();var E=(d.props.axis==="both"||d.props.axis==="x")&&g!=="n"&&g!=="s",F=(d.props.axis==="both"||d.props.axis==="y")&&g!=="e"&&g!=="w";if(!(!E&&!F)){var z=g[0],B=g[g.length-1],X=j.getBoundingClientRect();if(d.lastHandleRect!=null){if(B==="w"){var te=X.left-d.lastHandleRect.left;U+=te}if(z==="n"){var Q=X.top-d.lastHandleRect.top;L+=Q}}d.lastHandleRect=X,B==="w"&&(U=-U),z==="n"&&(L=-L);var H=d.props.width+(E?U/d.props.transformScale:0),A=d.props.height+(F?L/d.props.transformScale:0),ne=d.runConstraints(H,A);H=ne[0],A=ne[1];var oe=H!==d.props.width||A!==d.props.height,se=typeof d.props[u]=="function"?d.props[u]:null,fe=u==="onResize"&&!oe;se&&!fe&&(C.persist==null||C.persist(),se(C,{node:j,size:{width:H,height:A},handle:g})),u==="onResizeStop"&&d.resetData()}}},f.renderResizeHandle=function(u,g){var d=this.props.handle;if(!d)return t.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+u,ref:g});if(typeof d=="function")return d(u,g);var C=typeof d.type=="string",M=m({ref:g},C?{}:{handleAxis:u});return t.cloneElement(d,M)},f.render=function(){var u=this,g=this.props,d=g.children,C=g.className,M=g.draggableOpts;g.width,g.height,g.handle,g.handleSize,g.lockAspectRatio,g.axis,g.minConstraints,g.maxConstraints,g.onResize,g.onResizeStop,g.onResizeStart;var j=g.resizeHandles;g.transformScale;var U=p(g,o);return(0,r.cloneElement)(d,m(m({},U),{},{className:(C?C+" ":"")+"react-resizable",children:[].concat(d.props.children,j.map(function(L){var E,F=(E=u.handleRefs[L])!=null?E:u.handleRefs[L]=t.createRef();return t.createElement(e.DraggableCore,v({},M,{nodeRef:F,key:"resizableHandle-"+L,onStop:u.resizeHandler("onResizeStop",L),onStart:u.resizeHandler("onResizeStart",L),onDrag:u.resizeHandler("onResize",L)}),u.renderResizeHandle(L,F))}))}))},s}(t.Component);return Ke.default=h,h.propTypes=n.resizableProps,h.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},Ke}var Je={},kn;function xo(){if(kn)return Je;kn=1,Je.__esModule=!0,Je.default=void 0;var t=v(N),e=i(Oe()),r=i(Rr()),n=br(),o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function i(s){return s&&s.__esModule?s:{default:s}}function l(s){if(typeof WeakMap!="function")return null;var f=new WeakMap,y=new WeakMap;return(l=function(g){return g?y:f})(s)}function v(s,f){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var y=l(f);if(y&&y.has(s))return y.get(s);var u={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var C=g?Object.getOwnPropertyDescriptor(s,d):null;C&&(C.get||C.set)?Object.defineProperty(u,d,C):u[d]=s[d]}return u.default=s,y&&y.set(s,u),u}function p(){return p=Object.assign?Object.assign.bind():function(s){for(var f=1;f<arguments.length;f++){var y=arguments[f];for(var u in y)Object.prototype.hasOwnProperty.call(y,u)&&(s[u]=y[u])}return s},p.apply(this,arguments)}function R(s,f){var y=Object.keys(s);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(s);f&&(u=u.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),y.push.apply(y,u)}return y}function m(s){for(var f=1;f<arguments.length;f++){var y=arguments[f]!=null?arguments[f]:{};f%2?R(Object(y),!0).forEach(function(u){b(s,u,y[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(y)):R(Object(y)).forEach(function(u){Object.defineProperty(s,u,Object.getOwnPropertyDescriptor(y,u))})}return s}function b(s,f,y){return f=x(f),f in s?Object.defineProperty(s,f,{value:y,enumerable:!0,configurable:!0,writable:!0}):s[f]=y,s}function x(s){var f=I(s,"string");return typeof f=="symbol"?f:String(f)}function I(s,f){if(typeof s!="object"||s===null)return s;var y=s[Symbol.toPrimitive];if(y!==void 0){var u=y.call(s,f||"default");if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(s)}function T(s,f){if(s==null)return{};var y={},u=Object.keys(s),g,d;for(d=0;d<u.length;d++)g=u[d],!(f.indexOf(g)>=0)&&(y[g]=s[g]);return y}function w(s,f){s.prototype=Object.create(f.prototype),s.prototype.constructor=s,h(s,f)}function h(s,f){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(u,g){return u.__proto__=g,u},h(s,f)}var a=function(s){w(f,s);function f(){for(var u,g=arguments.length,d=new Array(g),C=0;C<g;C++)d[C]=arguments[C];return u=s.call.apply(s,[this].concat(d))||this,u.state={width:u.props.width,height:u.props.height,propsWidth:u.props.width,propsHeight:u.props.height},u.onResize=function(M,j){var U=j.size;u.props.onResize?(M.persist==null||M.persist(),u.setState(U,function(){return u.props.onResize&&u.props.onResize(M,j)})):u.setState(U)},u}f.getDerivedStateFromProps=function(g,d){return d.propsWidth!==g.width||d.propsHeight!==g.height?{width:g.width,height:g.height,propsWidth:g.width,propsHeight:g.height}:null};var y=f.prototype;return y.render=function(){var g=this.props,d=g.handle,C=g.handleSize;g.onResize;var M=g.onResizeStart,j=g.onResizeStop,U=g.draggableOpts,L=g.minConstraints,E=g.maxConstraints,F=g.lockAspectRatio,z=g.axis;g.width,g.height;var B=g.resizeHandles,X=g.style,te=g.transformScale,Q=T(g,o);return t.createElement(r.default,{axis:z,draggableOpts:U,handle:d,handleSize:C,height:this.state.height,lockAspectRatio:F,maxConstraints:E,minConstraints:L,onResizeStart:M,onResize:this.onResize,onResizeStop:j,resizeHandles:B,transformScale:te,width:this.state.width},t.createElement("div",p({},Q,{style:m(m({},X),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},f}(t.Component);return Je.default=a,a.propTypes=m(m({},n.resizableProps),{},{children:e.default.element}),Je}var Bn;function Eo(){return Bn||(Bn=1,Ye.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Ye.exports.Resizable=Rr().default,Ye.exports.ResizableBox=xo().default),Ye.exports}var Ie={},Gn;function Tr(){if(Gn)return Ie;Gn=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.resizeHandleType=Ie.resizeHandleAxesType=Ie.default=void 0;var t=r(Oe()),e=r(N);function r(i){return i&&i.__esModule?i:{default:i}}const n=Ie.resizeHandleAxesType=t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),o=Ie.resizeHandleType=t.default.oneOfType([t.default.node,t.default.func]);return Ie.default={className:t.default.string,style:t.default.object,width:t.default.number,autoSize:t.default.bool,cols:t.default.number,draggableCancel:t.default.string,draggableHandle:t.default.string,verticalCompact:function(i){i.verticalCompact},compactType:t.default.oneOf(["vertical","horizontal"]),layout:function(i){var l=i.layout;l!==void 0&&qe().validateLayout(l,"layout")},margin:t.default.arrayOf(t.default.number),containerPadding:t.default.arrayOf(t.default.number),rowHeight:t.default.number,maxRows:t.default.number,isBounded:t.default.bool,isDraggable:t.default.bool,isResizable:t.default.bool,allowOverlap:t.default.bool,preventCollision:t.default.bool,useCSSTransforms:t.default.bool,transformScale:t.default.number,isDroppable:t.default.bool,resizeHandles:n,resizeHandle:o,onLayoutChange:t.default.func,onDragStart:t.default.func,onDrag:t.default.func,onDragStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,onResizeStop:t.default.func,onDrop:t.default.func,droppingItem:t.default.shape({i:t.default.string.isRequired,w:t.default.number.isRequired,h:t.default.number.isRequired}),children:function(i,l){const v=i[l],p={};e.default.Children.forEach(v,function(R){if((R==null?void 0:R.key)!=null){if(p[R.key])throw new Error('Duplicate child key "'+R.key+'" found! This will cause problems in ReactGridLayout.');p[R.key]=!0}})},innerRef:t.default.any},Ie}var Xn;function Oo(){if(Xn)return Be;Xn=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.default=void 0;var t=p(N),e=p(Oe()),r=bn(),n=Eo(),o=qe(),i=Cn(),l=Tr(),v=p(yn());function p(I){return I&&I.__esModule?I:{default:I}}function R(I,T,w){return T=m(T),T in I?Object.defineProperty(I,T,{value:w,enumerable:!0,configurable:!0,writable:!0}):I[T]=w,I}function m(I){var T=b(I,"string");return typeof T=="symbol"?T:String(T)}function b(I,T){if(typeof I!="object"||I===null)return I;var w=I[Symbol.toPrimitive];if(w!==void 0){var h=w.call(I,T||"default");if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(I)}let x=class extends t.default.Component{constructor(){super(...arguments),R(this,"state",{resizing:null,dragging:null,className:""}),R(this,"elementRef",t.default.createRef()),R(this,"onDragStart",(T,w)=>{let{node:h}=w;const{onDragStart:a,transformScale:s}=this.props;if(!a)return;const f={top:0,left:0},{offsetParent:y}=h;if(!y)return;const u=y.getBoundingClientRect(),g=h.getBoundingClientRect(),d=g.left/s,C=u.left/s,M=g.top/s,j=u.top/s;f.left=d-C+y.scrollLeft,f.top=M-j+y.scrollTop,this.setState({dragging:f});const{x:U,y:L}=(0,i.calcXY)(this.getPositionParams(),f.top,f.left,this.props.w,this.props.h);return a.call(this,this.props.i,U,L,{e:T,node:h,newPosition:f})}),R(this,"onDrag",(T,w)=>{let{node:h,deltaX:a,deltaY:s}=w;const{onDrag:f}=this.props;if(!f)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let y=this.state.dragging.top+s,u=this.state.dragging.left+a;const{isBounded:g,i:d,w:C,h:M,containerWidth:j}=this.props,U=this.getPositionParams();if(g){const{offsetParent:B}=h;if(B){const{margin:X,rowHeight:te,containerPadding:Q}=this.props,H=B.clientHeight-(0,i.calcGridItemWHPx)(M,te,X[1]);y=(0,i.clamp)(y-Q[1],0,H);const A=(0,i.calcGridColWidth)(U),ne=j-(0,i.calcGridItemWHPx)(C,A,X[0]);u=(0,i.clamp)(u-Q[0],0,ne)}}const L={top:y,left:u};this.setState({dragging:L});const{containerPadding:E}=this.props,{x:F,y:z}=(0,i.calcXY)(U,y-E[1],u-E[0],C,M);return f.call(this,d,F,z,{e:T,node:h,newPosition:L})}),R(this,"onDragStop",(T,w)=>{let{node:h}=w;const{onDragStop:a}=this.props;if(!a)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:s,h:f,i:y,containerPadding:u}=this.props,{left:g,top:d}=this.state.dragging,C={top:d,left:g};this.setState({dragging:null});const{x:M,y:j}=(0,i.calcXY)(this.getPositionParams(),d-u[1],g-u[0],s,f);return a.call(this,y,M,j,{e:T,node:h,newPosition:C})}),R(this,"onResizeStop",(T,w,h)=>this.onResizeHandler(T,w,h,"onResizeStop")),R(this,"onResizeStart",(T,w,h)=>this.onResizeHandler(T,w,h,"onResizeStart")),R(this,"onResize",(T,w,h)=>this.onResizeHandler(T,w,h,"onResize"))}shouldComponentUpdate(T,w){if(this.props.children!==T.children||this.props.droppingPosition!==T.droppingPosition)return!0;const h=(0,i.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),a=(0,i.calcGridItemPosition)(this.getPositionParams(T),T.x,T.y,T.w,T.h,w);return!(0,o.fastPositionEqual)(h,a)||this.props.useCSSTransforms!==T.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(T){this.moveDroppingItem(T)}moveDroppingItem(T){const{droppingPosition:w}=this.props;if(!w)return;const h=this.elementRef.current;if(!h)return;const a=T.droppingPosition||{left:0,top:0},{dragging:s}=this.state,f=s&&w.left!==a.left||w.top!==a.top;if(!s)this.onDragStart(w.e,{node:h,deltaX:w.left,deltaY:w.top});else if(f){const y=w.left-s.left,u=w.top-s.top;this.onDrag(w.e,{node:h,deltaX:y,deltaY:u})}}getPositionParams(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:T.cols,containerPadding:T.containerPadding,containerWidth:T.containerWidth,margin:T.margin,maxRows:T.maxRows,rowHeight:T.rowHeight}}createStyle(T){const{usePercentages:w,containerWidth:h,useCSSTransforms:a}=this.props;let s;return a?s=(0,o.setTransform)(T):(s=(0,o.setTopLeft)(T),w&&(s.left=(0,o.perc)(T.left/h),s.width=(0,o.perc)(T.width/h))),s}mixinDraggable(T,w){return t.default.createElement(r.DraggableCore,{disabled:!w,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},T)}curryResizeHandler(T,w){return(h,a)=>w(h,a,T)}mixinResizable(T,w,h){const{cols:a,minW:s,minH:f,maxW:y,maxH:u,transformScale:g,resizeHandles:d,resizeHandle:C}=this.props,M=this.getPositionParams(),j=(0,i.calcGridItemPosition)(M,0,0,a,0).width,U=(0,i.calcGridItemPosition)(M,0,0,s,f),L=(0,i.calcGridItemPosition)(M,0,0,y,u),E=[U.width,U.height],F=[Math.min(L.width,j),Math.min(L.height,1/0)];return t.default.createElement(n.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:w.width,height:w.height,minConstraints:E,maxConstraints:F,onResizeStop:this.curryResizeHandler(w,this.onResizeStop),onResizeStart:this.curryResizeHandler(w,this.onResizeStart),onResize:this.curryResizeHandler(w,this.onResize),transformScale:g,resizeHandles:d,handle:C},T)}onResizeHandler(T,w,h,a){let{node:s,size:f,handle:y}=w;const u=this.props[a];if(!u)return;const{x:g,y:d,i:C,maxH:M,minH:j,containerWidth:U}=this.props,{minW:L,maxW:E}=this.props;let F=f;s&&(F=(0,o.resizeItemInDirection)(y,h,f,U),this.setState({resizing:a==="onResizeStop"?null:F}));let{w:z,h:B}=(0,i.calcWH)(this.getPositionParams(),F.width,F.height,g,d,y);z=(0,i.clamp)(z,Math.max(L,1),E),B=(0,i.clamp)(B,j,M),u.call(this,C,z,B,{e:T,node:s,size:F,handle:y})}render(){const{x:T,y:w,w:h,h:a,isDraggable:s,isResizable:f,droppingPosition:y,useCSSTransforms:u}=this.props,g=(0,i.calcGridItemPosition)(this.getPositionParams(),T,w,h,a,this.state),d=t.default.Children.only(this.props.children);let C=t.default.cloneElement(d,{ref:this.elementRef,className:(0,v.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":s,"react-draggable-dragging":!!this.state.dragging,dropping:!!y,cssTransforms:u}),style:{...this.props.style,...d.props.style,...this.createStyle(g)}});return C=this.mixinResizable(C,g,f),C=this.mixinDraggable(C,s),C}};return Be.default=x,R(x,"propTypes",{children:e.default.element,cols:e.default.number.isRequired,containerWidth:e.default.number.isRequired,rowHeight:e.default.number.isRequired,margin:e.default.array.isRequired,maxRows:e.default.number.isRequired,containerPadding:e.default.array.isRequired,x:e.default.number.isRequired,y:e.default.number.isRequired,w:e.default.number.isRequired,h:e.default.number.isRequired,minW:function(I,T){const w=I[T];if(typeof w!="number")return new Error("minWidth not Number");if(w>I.w||w>I.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(I,T){const w=I[T];if(typeof w!="number")return new Error("maxWidth not Number");if(w<I.w||w<I.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(I,T){const w=I[T];if(typeof w!="number")return new Error("minHeight not Number");if(w>I.h||w>I.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(I,T){const w=I[T];if(typeof w!="number")return new Error("maxHeight not Number");if(w<I.h||w<I.minH)return new Error("maxHeight smaller than item height/minHeight")},i:e.default.string.isRequired,resizeHandles:l.resizeHandleAxesType,resizeHandle:l.resizeHandleType,onDragStop:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,isDraggable:e.default.bool.isRequired,isResizable:e.default.bool.isRequired,isBounded:e.default.bool.isRequired,static:e.default.bool,useCSSTransforms:e.default.bool.isRequired,transformScale:e.default.number,className:e.default.string,handle:e.default.string,cancel:e.default.string,droppingPosition:e.default.shape({e:e.default.object.isRequired,left:e.default.number.isRequired,top:e.default.number.isRequired})}),R(x,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Be}var Yn;function Ir(){if(Yn)return ke;Yn=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.default=void 0;var t=R(N),e=vn(),r=v(yn()),n=qe(),o=Cn(),i=v(Oo()),l=v(Tr());function v(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(p=function(f){return f?s:a})(h)}function R(h,a){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(a);if(s&&s.has(h))return s.get(h);var f={__proto__:null},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in h)if(u!=="default"&&Object.prototype.hasOwnProperty.call(h,u)){var g=y?Object.getOwnPropertyDescriptor(h,u):null;g&&(g.get||g.set)?Object.defineProperty(f,u,g):f[u]=h[u]}return f.default=h,s&&s.set(h,f),f}function m(h,a,s){return a=b(a),a in h?Object.defineProperty(h,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[a]=s,h}function b(h){var a=x(h,"string");return typeof a=="symbol"?a:String(a)}function x(h,a){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,a||"default");if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(h)}const I="react-grid-layout";let T=!1;try{T=/firefox/i.test(navigator.userAgent)}catch{}let w=class extends t.Component{constructor(){super(...arguments),m(this,"state",{activeDrag:null,layout:(0,n.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,n.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),m(this,"dragEnterCounter",0),m(this,"onDragStart",(a,s,f,y)=>{let{e:u,node:g}=y;const{layout:d}=this.state,C=(0,n.getLayoutItem)(d,a);if(!C)return;const M={w:C.w,h:C.h,x:C.x,y:C.y,placeholder:!0,i:a};return this.setState({oldDragItem:(0,n.cloneLayoutItem)(C),oldLayout:d,activeDrag:M}),this.props.onDragStart(d,C,C,null,u,g)}),m(this,"onDrag",(a,s,f,y)=>{let{e:u,node:g}=y;const{oldDragItem:d}=this.state;let{layout:C}=this.state;const{cols:M,allowOverlap:j,preventCollision:U}=this.props,L=(0,n.getLayoutItem)(C,a);if(!L)return;const E={w:L.w,h:L.h,x:L.x,y:L.y,placeholder:!0,i:a};C=(0,n.moveElement)(C,L,s,f,!0,U,(0,n.compactType)(this.props),M,j),this.props.onDrag(C,d,L,E,u,g),this.setState({layout:j?C:(0,n.compact)(C,(0,n.compactType)(this.props),M),activeDrag:E})}),m(this,"onDragStop",(a,s,f,y)=>{let{e:u,node:g}=y;if(!this.state.activeDrag)return;const{oldDragItem:d}=this.state;let{layout:C}=this.state;const{cols:M,preventCollision:j,allowOverlap:U}=this.props,L=(0,n.getLayoutItem)(C,a);if(!L)return;C=(0,n.moveElement)(C,L,s,f,!0,j,(0,n.compactType)(this.props),M,U);const F=U?C:(0,n.compact)(C,(0,n.compactType)(this.props),M);this.props.onDragStop(F,d,L,null,u,g);const{oldLayout:z}=this.state;this.setState({activeDrag:null,layout:F,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(F,z)}),m(this,"onResizeStart",(a,s,f,y)=>{let{e:u,node:g}=y;const{layout:d}=this.state,C=(0,n.getLayoutItem)(d,a);C&&(this.setState({oldResizeItem:(0,n.cloneLayoutItem)(C),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(d,C,C,null,u,g))}),m(this,"onResize",(a,s,f,y)=>{let{e:u,node:g,size:d,handle:C}=y;const{oldResizeItem:M}=this.state,{layout:j}=this.state,{cols:U,preventCollision:L,allowOverlap:E}=this.props;let F=!1,z,B,X;const[te,Q]=(0,n.withLayoutItem)(j,a,A=>{let ne;return B=A.x,X=A.y,["sw","w","nw","n","ne"].indexOf(C)!==-1&&(["sw","nw","w"].indexOf(C)!==-1&&(B=A.x+(A.w-s),s=A.x!==B&&B<0?A.w:s,B=B<0?0:B),["ne","n","nw"].indexOf(C)!==-1&&(X=A.y+(A.h-f),f=A.y!==X&&X<0?A.h:f,X=X<0?0:X),F=!0),L&&!E&&(ne=(0,n.getAllCollisions)(j,{...A,w:s,h:f,x:B,y:X}).filter(se=>se.i!==A.i).length>0,ne&&(X=A.y,f=A.h,B=A.x,s=A.w,F=!1)),A.w=s,A.h=f,A});if(!Q)return;z=te,F&&(z=(0,n.moveElement)(te,Q,B,X,!0,this.props.preventCollision,(0,n.compactType)(this.props),U,E));const H={w:Q.w,h:Q.h,x:Q.x,y:Q.y,static:!0,i:a};this.props.onResize(z,M,Q,H,u,g),this.setState({layout:E?z:(0,n.compact)(z,(0,n.compactType)(this.props),U),activeDrag:H})}),m(this,"onResizeStop",(a,s,f,y)=>{let{e:u,node:g}=y;const{layout:d,oldResizeItem:C}=this.state,{cols:M,allowOverlap:j}=this.props,U=(0,n.getLayoutItem)(d,a),L=j?d:(0,n.compact)(d,(0,n.compactType)(this.props),M);this.props.onResizeStop(L,C,U,null,u,g);const{oldLayout:E}=this.state;this.setState({activeDrag:null,layout:L,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(L,E)}),m(this,"onDragOver",a=>{var te;if(a.preventDefault(),a.stopPropagation(),T&&!((te=a.nativeEvent.target)!=null&&te.classList.contains(I)))return!1;const{droppingItem:s,onDropDragOver:f,margin:y,cols:u,rowHeight:g,maxRows:d,width:C,containerPadding:M,transformScale:j}=this.props,U=f==null?void 0:f(a);if(U===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const L={...s,...U},{layout:E}=this.state,F=a.currentTarget.getBoundingClientRect(),z=a.clientX-F.left,B=a.clientY-F.top,X={left:z/j,top:B/j,e:a};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:Q,top:H}=this.state.droppingPosition;(Q!=z||H!=B)&&this.setState({droppingPosition:X})}}else{const Q={cols:u,margin:y,maxRows:d,rowHeight:g,containerWidth:C,containerPadding:M||y},H=(0,o.calcXY)(Q,B,z,L.w,L.h);this.setState({droppingDOMNode:t.createElement("div",{key:L.i}),droppingPosition:X,layout:[...E,{...L,x:H.x,y:H.y,static:!1,isDraggable:!0}]})}}),m(this,"removeDroppingPlaceholder",()=>{const{droppingItem:a,cols:s}=this.props,{layout:f}=this.state,y=(0,n.compact)(f.filter(u=>u.i!==a.i),(0,n.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:y,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),m(this,"onDragLeave",a=>{a.preventDefault(),a.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),m(this,"onDragEnter",a=>{a.preventDefault(),a.stopPropagation(),this.dragEnterCounter++}),m(this,"onDrop",a=>{a.preventDefault(),a.stopPropagation();const{droppingItem:s}=this.props,{layout:f}=this.state,y=f.find(u=>u.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(f,y,a)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(a,s){let f;return s.activeDrag?null:(!(0,e.deepEqual)(a.layout,s.propsLayout)||a.compactType!==s.compactType?f=a.layout:(0,n.childrenEqual)(a.children,s.children)||(f=s.layout),f?{layout:(0,n.synchronizeLayoutWithChildren)(f,a.children,a.cols,(0,n.compactType)(a),a.allowOverlap),compactType:a.compactType,children:a.children,propsLayout:a.layout}:null)}shouldComponentUpdate(a,s){return this.props.children!==a.children||!(0,n.fastRGLPropsEqual)(this.props,a,e.deepEqual)||this.state.activeDrag!==s.activeDrag||this.state.mounted!==s.mounted||this.state.droppingPosition!==s.droppingPosition}componentDidUpdate(a,s){if(!this.state.activeDrag){const f=this.state.layout,y=s.layout;this.onLayoutMaybeChanged(f,y)}}containerHeight(){if(!this.props.autoSize)return;const a=(0,n.bottom)(this.state.layout),s=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return a*this.props.rowHeight+(a-1)*this.props.margin[1]+s*2+"px"}onLayoutMaybeChanged(a,s){s||(s=this.state.layout),(0,e.deepEqual)(s,a)||this.props.onLayoutChange(a)}placeholder(){const{activeDrag:a}=this.state;if(!a)return null;const{width:s,cols:f,margin:y,containerPadding:u,rowHeight:g,maxRows:d,useCSSTransforms:C,transformScale:M}=this.props;return t.createElement(i.default,{w:a.w,h:a.h,x:a.x,y:a.y,i:a.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:s,cols:f,margin:y,containerPadding:u||y,maxRows:d,rowHeight:g,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:C,transformScale:M},t.createElement("div",null))}processGridItem(a,s){if(!a||!a.key)return;const f=(0,n.getLayoutItem)(this.state.layout,String(a.key));if(!f)return null;const{width:y,cols:u,margin:g,containerPadding:d,rowHeight:C,maxRows:M,isDraggable:j,isResizable:U,isBounded:L,useCSSTransforms:E,transformScale:F,draggableCancel:z,draggableHandle:B,resizeHandles:X,resizeHandle:te}=this.props,{mounted:Q,droppingPosition:H}=this.state,A=typeof f.isDraggable=="boolean"?f.isDraggable:!f.static&&j,ne=typeof f.isResizable=="boolean"?f.isResizable:!f.static&&U,oe=f.resizeHandles||X,se=A&&L&&f.isBounded!==!1;return t.createElement(i.default,{containerWidth:y,cols:u,margin:g,containerPadding:d||g,maxRows:M,rowHeight:C,cancel:z,handle:B,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:A,isResizable:ne,isBounded:se,useCSSTransforms:E&&Q,usePercentages:!Q,transformScale:F,w:f.w,h:f.h,x:f.x,y:f.y,i:f.i,minH:f.minH,minW:f.minW,maxH:f.maxH,maxW:f.maxW,static:f.static,droppingPosition:s?H:void 0,resizeHandles:oe,resizeHandle:te},a)}render(){const{className:a,style:s,isDroppable:f,innerRef:y}=this.props,u=(0,r.default)(I,a),g={height:this.containerHeight(),...s};return t.createElement("div",{ref:y,className:u,style:g,onDrop:f?this.onDrop:n.noop,onDragLeave:f?this.onDragLeave:n.noop,onDragEnter:f?this.onDragEnter:n.noop,onDragOver:f?this.onDragOver:n.noop},t.Children.map(this.props.children,d=>this.processGridItem(d)),f&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return ke.default=w,m(w,"displayName","ReactGridLayout"),m(w,"propTypes",l.default),m(w,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:n.noop,onDragStart:n.noop,onDrag:n.noop,onDragStop:n.noop,onResizeStart:n.noop,onResize:n.noop,onResizeStop:n.noop,onDrop:n.noop,onDropDragOver:n.noop}),ke}var Qe={},Fe={},Kn;function wr(){if(Kn)return Fe;Kn=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.findOrGenerateResponsiveLayout=n,Fe.getBreakpointFromWidth=e,Fe.getColsFromBreakpoint=r,Fe.sortBreakpoints=o;var t=qe();function e(i,l){const v=o(i);let p=v[0];for(let R=1,m=v.length;R<m;R++){const b=v[R];l>i[b]&&(p=b)}return p}function r(i,l){if(!l[i])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+i+" is missing!");return l[i]}function n(i,l,v,p,R,m){if(i[v])return(0,t.cloneLayout)(i[v]);let b=i[p];const x=o(l),I=x.slice(x.indexOf(v));for(let T=0,w=I.length;T<w;T++){const h=I[T];if(i[h]){b=i[h];break}}return b=(0,t.cloneLayout)(b||[]),(0,t.compact)((0,t.correctBounds)(b,{cols:R}),m,R)}function o(i){return Object.keys(i).sort(function(v,p){return i[v]-i[p]})}return Fe}var Zn;function Po(){if(Zn)return Qe;Zn=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.default=void 0;var t=p(N),e=l(Oe()),r=vn(),n=qe(),o=wr(),i=l(Ir());function l(h){return h&&h.__esModule?h:{default:h}}function v(h){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(v=function(f){return f?s:a})(h)}function p(h,a){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=v(a);if(s&&s.has(h))return s.get(h);var f={__proto__:null},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in h)if(u!=="default"&&Object.prototype.hasOwnProperty.call(h,u)){var g=y?Object.getOwnPropertyDescriptor(h,u):null;g&&(g.get||g.set)?Object.defineProperty(f,u,g):f[u]=h[u]}return f.default=h,s&&s.set(h,f),f}function R(){return R=Object.assign?Object.assign.bind():function(h){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var f in s)Object.prototype.hasOwnProperty.call(s,f)&&(h[f]=s[f])}return h},R.apply(this,arguments)}function m(h,a,s){return a=b(a),a in h?Object.defineProperty(h,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[a]=s,h}function b(h){var a=x(h,"string");return typeof a=="symbol"?a:String(a)}function x(h,a){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,a||"default");if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(h)}const I=h=>Object.prototype.toString.call(h);function T(h,a){return h==null?null:Array.isArray(h)?h:h[a]}let w=class extends t.Component{constructor(){super(...arguments),m(this,"state",this.generateInitialState()),m(this,"onLayoutChange",a=>{this.props.onLayoutChange(a,{...this.props.layouts,[this.state.breakpoint]:a})})}generateInitialState(){const{width:a,breakpoints:s,layouts:f,cols:y}=this.props,u=(0,o.getBreakpointFromWidth)(s,a),g=(0,o.getColsFromBreakpoint)(u,y),d=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,o.findOrGenerateResponsiveLayout)(f,s,u,u,g,d),breakpoint:u,cols:g}}static getDerivedStateFromProps(a,s){if(!(0,r.deepEqual)(a.layouts,s.layouts)){const{breakpoint:f,cols:y}=s;return{layout:(0,o.findOrGenerateResponsiveLayout)(a.layouts,a.breakpoints,f,f,y,a.compactType),layouts:a.layouts}}return null}componentDidUpdate(a){(this.props.width!=a.width||this.props.breakpoint!==a.breakpoint||!(0,r.deepEqual)(this.props.breakpoints,a.breakpoints)||!(0,r.deepEqual)(this.props.cols,a.cols))&&this.onWidthChange(a)}onWidthChange(a){const{breakpoints:s,cols:f,layouts:y,compactType:u}=this.props,g=this.props.breakpoint||(0,o.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),d=this.state.breakpoint,C=(0,o.getColsFromBreakpoint)(g,f),M={...y};if(d!==g||a.breakpoints!==s||a.cols!==f){d in M||(M[d]=(0,n.cloneLayout)(this.state.layout));let L=(0,o.findOrGenerateResponsiveLayout)(M,s,g,d,C,u);L=(0,n.synchronizeLayoutWithChildren)(L,this.props.children,C,u,this.props.allowOverlap),M[g]=L,this.props.onLayoutChange(L,M),this.props.onBreakpointChange(g,C),this.setState({breakpoint:g,layout:L,cols:C})}const j=T(this.props.margin,g),U=T(this.props.containerPadding,g);this.props.onWidthChange(this.props.width,j,C,U)}render(){const{breakpoint:a,breakpoints:s,cols:f,layouts:y,margin:u,containerPadding:g,onBreakpointChange:d,onLayoutChange:C,onWidthChange:M,...j}=this.props;return t.createElement(i.default,R({},j,{margin:T(u,this.state.breakpoint),containerPadding:T(g,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return Qe.default=w,m(w,"propTypes",{breakpoint:e.default.string,breakpoints:e.default.object,allowOverlap:e.default.bool,cols:e.default.object,margin:e.default.oneOfType([e.default.array,e.default.object]),containerPadding:e.default.oneOfType([e.default.array,e.default.object]),layouts(h,a){if(I(h[a])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+I(h[a]));Object.keys(h[a]).forEach(s=>{if(!(s in h.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,n.validateLayout)(h.layouts[s],"layouts."+s)})},width:e.default.number.isRequired,onBreakpointChange:e.default.func,onLayoutChange:e.default.func,onWidthChange:e.default.func}),m(w,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:n.noop,onLayoutChange:n.noop,onWidthChange:n.noop}),Qe}var Rt={},_r=function(){if(typeof Map<"u")return Map;function t(e,r){var n=-1;return e.some(function(o,i){return o[0]===r?(n=i,!0):!1}),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(r){var n=t(this.__entries__,r),o=this.__entries__[n];return o&&o[1]},e.prototype.set=function(r,n){var o=t(this.__entries__,r);~o?this.__entries__[o][1]=n:this.__entries__.push([r,n])},e.prototype.delete=function(r){var n=this.__entries__,o=t(n,r);~o&&n.splice(o,1)},e.prototype.has=function(r){return!!~t(this.__entries__,r)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var o=0,i=this.__entries__;o<i.length;o++){var l=i[o];r.call(n,l[1],l[0])}},e}()}(),sn=typeof window<"u"&&typeof document<"u"&&window.document===document,Mt=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Mo=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Mt):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),Fo=2;function Do(t,e){var r=!1,n=!1,o=0;function i(){r&&(r=!1,t()),n&&v()}function l(){Mo(i)}function v(){var p=Date.now();if(r){if(p-o<Fo)return;n=!0}else r=!0,n=!1,setTimeout(l,e);o=p}return v}var No=20,jo=["top","right","bottom","left","width","height","size","weight"],Lo=typeof MutationObserver<"u",Uo=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Do(this.refresh.bind(this),No)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var r=this.observers_,n=r.indexOf(e);~n&&r.splice(n,1),!r.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(r){return r.gatherActive(),r.hasActive()});return e.forEach(function(r){return r.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!sn||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Lo?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!sn||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var r=e.propertyName,n=r===void 0?"":r,o=jo.some(function(i){return!!~n.indexOf(i)});o&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),xr=function(t,e){for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];Object.defineProperty(t,o,{value:e[o],enumerable:!1,writable:!1,configurable:!0})}return t},$e=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Mt},Er=Ht(0,0,0,0);function Ft(t){return parseFloat(t)||0}function Jn(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return e.reduce(function(n,o){var i=t["border-"+o+"-width"];return n+Ft(i)},0)}function Vo(t){for(var e=["top","right","bottom","left"],r={},n=0,o=e;n<o.length;n++){var i=o[n],l=t["padding-"+i];r[i]=Ft(l)}return r}function $o(t){var e=t.getBBox();return Ht(0,0,e.width,e.height)}function zo(t){var e=t.clientWidth,r=t.clientHeight;if(!e&&!r)return Er;var n=$e(t).getComputedStyle(t),o=Vo(n),i=o.left+o.right,l=o.top+o.bottom,v=Ft(n.width),p=Ft(n.height);if(n.boxSizing==="border-box"&&(Math.round(v+i)!==e&&(v-=Jn(n,"left","right")+i),Math.round(p+l)!==r&&(p-=Jn(n,"top","bottom")+l)),!qo(t)){var R=Math.round(v+i)-e,m=Math.round(p+l)-r;Math.abs(R)!==1&&(v-=R),Math.abs(m)!==1&&(p-=m)}return Ht(o.left,o.top,v,p)}var Ao=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof $e(t).SVGGraphicsElement}:function(t){return t instanceof $e(t).SVGElement&&typeof t.getBBox=="function"}}();function qo(t){return t===$e(t).document.documentElement}function Wo(t){return sn?Ao(t)?$o(t):zo(t):Er}function Ho(t){var e=t.x,r=t.y,n=t.width,o=t.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,l=Object.create(i.prototype);return xr(l,{x:e,y:r,width:n,height:o,top:r,right:e+n,bottom:o+r,left:e}),l}function Ht(t,e,r,n){return{x:t,y:e,width:r,height:n}}var ko=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ht(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=Wo(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},t}(),Bo=function(){function t(e,r){var n=Ho(r);xr(this,{target:e,contentRect:n})}return t}(),Go=function(){function t(e,r,n){if(this.activeObservations_=[],this.observations_=new _r,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=r,this.callbackCtx_=n}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof $e(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)||(r.set(e,new ko(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof $e(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)&&(r.delete(e),r.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&e.activeObservations_.push(r)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new Bo(n.target,n.broadcastRect())});this.callback_.call(e,r,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),Or=typeof WeakMap<"u"?new WeakMap:new _r,Pr=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=Uo.getInstance(),n=new Go(e,r,this);Or.set(this,n)}return t}();["observe","unobserve","disconnect"].forEach(function(t){Pr.prototype[t]=function(){var e;return(e=Or.get(this))[t].apply(e,arguments)}});var Xo=function(){return typeof Mt.ResizeObserver<"u"?Mt.ResizeObserver:Pr}();const Yo=Object.freeze(Object.defineProperty({__proto__:null,default:Xo},Symbol.toStringTag,{value:"Module"})),Ko=hr(Yo);var Qn;function Zo(){if(Qn)return Rt;Qn=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.default=x;var t=l(N),e=o(Oe()),r=o(Ko),n=o(yn());function o(I){return I&&I.__esModule?I:{default:I}}function i(I){if(typeof WeakMap!="function")return null;var T=new WeakMap,w=new WeakMap;return(i=function(h){return h?w:T})(I)}function l(I,T){if(I&&I.__esModule)return I;if(I===null||typeof I!="object"&&typeof I!="function")return{default:I};var w=i(T);if(w&&w.has(I))return w.get(I);var h={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in I)if(s!=="default"&&Object.prototype.hasOwnProperty.call(I,s)){var f=a?Object.getOwnPropertyDescriptor(I,s):null;f&&(f.get||f.set)?Object.defineProperty(h,s,f):h[s]=I[s]}return h.default=I,w&&w.set(I,h),h}function v(){return v=Object.assign?Object.assign.bind():function(I){for(var T=1;T<arguments.length;T++){var w=arguments[T];for(var h in w)Object.prototype.hasOwnProperty.call(w,h)&&(I[h]=w[h])}return I},v.apply(this,arguments)}function p(I,T,w){return T=R(T),T in I?Object.defineProperty(I,T,{value:w,enumerable:!0,configurable:!0,writable:!0}):I[T]=w,I}function R(I){var T=m(I,"string");return typeof T=="symbol"?T:String(T)}function m(I,T){if(typeof I!="object"||I===null)return I;var w=I[Symbol.toPrimitive];if(w!==void 0){var h=w.call(I,T||"default");if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(I)}const b="react-grid-layout";function x(I){var T;return T=class extends t.Component{constructor(){super(...arguments),p(this,"state",{width:1280}),p(this,"elementRef",t.createRef()),p(this,"mounted",!1),p(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new r.default(a=>{if(this.elementRef.current instanceof HTMLElement){const f=a[0].contentRect.width;this.setState({width:f})}});const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.observe(h)}componentWillUnmount(){this.mounted=!1;const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.unobserve(h),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:h,...a}=this.props;return h&&!this.mounted?t.createElement("div",{className:(0,n.default)(this.props.className,b),style:this.props.style,ref:this.elementRef}):t.createElement(I,v({innerRef:this.elementRef},a,this.state))}},p(T,"defaultProps",{measureBeforeMount:!1}),p(T,"propTypes",{measureBeforeMount:e.default.bool}),T}return Rt}var er;function Jo(){return er||(er=1,function(t){t.exports=Ir().default,t.exports.utils=qe(),t.exports.calculateUtils=Cn(),t.exports.Responsive=Po().default,t.exports.Responsive.utils=wr(),t.exports.WidthProvider=Zo().default}(Gt)),Gt.exports}var Qo=Jo();const ei=Ar(Qo);var ti=Object.defineProperty,ni=Object.getOwnPropertyDescriptor,ri=(t,e,r,n)=>{for(var o=n>1?void 0:n?ni(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&ti(e,r,o),o},oi=(t,e)=>(r,n)=>e(r,n,t);let ze=class extends S.Disposable{constructor(e){super();_e(this,"_initLocal",()=>{});_e(this,"_findReplaceIndex",e=>{const r=/\{([^}]+)?\}/g,n=[];let o=r.exec(e);for(;o;)n.push({startIndex:o.index,key:Number(o[1]),endIndex:o.index+o[0].length-1}),o=r.exec(e);return n});this._localeService=e,this._initLocal()}tWithReactNode(e,...r){const n=this._localeService.getLocales(),o=e.split("."),i=n&&this._localeService.resolveKeyPath(n,o);if(typeof i=="string"){const l=[];return this._findReplaceIndex(i).forEach((v,p,R)=>{const m=R[p-1]||{startIndex:0,endIndex:-1};if(m.endIndex+1<v.startIndex){const b=i.slice(m.endIndex+1,v.startIndex);b&&l.push(b)}if(r[v.key]&&l.push(r[v.key]),p===R.length-1){const b=i.slice(v.endIndex+1);b&&l.push(b)}}),l}return[]}};ze=ri([oi(0,S.Inject(S.LocaleService))],ze);const ii="univer-cf-preview",Tt={cfPreview:ii},We=t=>{var o,i;const e=t.rule;if(!e)return null;const r=N.useMemo(()=>{if(e.type===c.CFRuleType.colorScale){const l=e.config.map((R,m)=>({color:new S.ColorKit(R.color),value:m})),v=l.length-1;return new Array(5).fill("").map((R,m,b)=>m*v/(b.length-1)).map(R=>c.getColorScaleFromValue(l,R))}return null},[e]),n=N.useMemo(()=>{if(e.type===c.CFRuleType.iconSet)return e.config.map(l=>{const v=c.iconMap[l.iconType];return v&&v[Number(l.iconId)]})},[e]);switch(e.type){case c.CFRuleType.dataBar:{const{isGradient:l}=e.config,v={width:"50%",height:"100%"},p=l?`linear-gradient(to right, ${e.config.positiveColor||c.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,R=l?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||c.defaultDataBarNativeColor})`:e.config.nativeColor;return _.jsxs("div",{className:Tt.cfPreview,children:[_.jsx("div",{style:{...v,background:R,border:`1px solid ${e.config.nativeColor||c.defaultDataBarNativeColor}`}}),_.jsx("div",{style:{...v,background:p,border:`1px solid ${e.config.positiveColor||c.defaultDataBarPositiveColor}`}})]})}case c.CFRuleType.colorScale:return r&&_.jsx("div",{className:Tt.cfPreview,children:r.map((l,v)=>_.jsx("div",{style:{width:`${100/r.length}%`,height:"100%",background:l}},v))});case c.CFRuleType.iconSet:return n&&_.jsx("div",{className:Tt.cfPreview,children:n.map((l,v)=>l?_.jsx("img",{style:{height:"100%"},src:l},v):_.jsx(gt,{},v))});case c.CFRuleType.highlightCell:{const{ul:l,st:v,it:p,bl:R,bg:m,cl:b}=e.style,x=(l==null?void 0:l.s)===S.BooleanNumber.TRUE,I=(v==null?void 0:v.s)===S.BooleanNumber.TRUE,T=p===S.BooleanNumber.TRUE,w=R===S.BooleanNumber.TRUE,h=(o=m==null?void 0:m.rgb)!=null?o:c.DEFAULT_BG_COLOR,a=(i=b==null?void 0:b.rgb)!=null?i:c.DEFAULT_FONT_COLOR,s={fontWeight:w?"bold":void 0,fontStyle:T?"italic":void 0,textDecoration:`${x?"underline":""} ${I?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:a};return _.jsx("div",{style:s,className:Tt.cfPreview,children:"123"})}}return null},ai="univer-cf-rule-list",si="univer-rule-selector",li="univer-select",ui="univer-select-selector",ci="univer-select-selection-item",di="univer-select-selection-search-input",fi="univer-btn-list",pi="univer-gap",hi="univer-icon",mi="univer-disabled",gi="univer-rule-item",vi="univer-rule-describe",yi="univer-rule-type",Ci="univer-rule-range",Si="univer-active",bi="univer-draggableHandle",Ri="univer-delete-item",Ti="univer-grid-layout-wrap",Ii="univer-react-grid-item",pe={cfRuleList:ai,ruleSelector:si,select:li,selectSelector:ui,selectSelectionItem:ci,selectSelectionSearchInput:di,btnList:fi,gap:pi,icon:hi,disabled:mi,ruleItem:gi,ruleDescribe:vi,ruleType:yi,ruleRange:Ci,active:Si,draggableHandle:bi,deleteItem:Ri,gridLayoutWrap:Ti,reactGridItem:Ii},wi=(t,e)=>{const r=t.rule;switch(r.type){case c.CFRuleType.colorScale:return e.t("sheet.cf.ruleType.colorScale");case c.CFRuleType.dataBar:return e.t("sheet.cf.ruleType.dataBar");case c.CFRuleType.iconSet:return e.t("sheet.cf.ruleType.iconSet");case c.CFRuleType.highlightCell:switch(r.subType){case c.CFSubRuleType.average:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,e.t("sheet.cf.subRuleType.average"))}case c.CFSubRuleType.duplicateValues:return e.t("sheet.cf.subRuleType.duplicateValues");case c.CFSubRuleType.uniqueValues:return e.t("sheet.cf.subRuleType.uniqueValues");case c.CFSubRuleType.number:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,...Array.isArray(r.value)?r.value.map(o=>String(o)):[String(r.value||"")])}case c.CFSubRuleType.text:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,r.value||"")}case c.CFSubRuleType.timePeriod:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`)}case c.CFSubRuleType.rank:return r.isPercent?r.isBottom?e.t("sheet.cf.preview.describe.bottomNPercent",String(r.value)):e.t("sheet.cf.preview.describe.topNPercent",String(r.value)):r.isBottom?e.t("sheet.cf.preview.describe.bottomN",String(r.value)):e.t("sheet.cf.preview.describe.topN",String(r.value));case c.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let tr=0;const _i=t=>{const{onClick:e}=t,r=S.useDependency(c.ConditionalFormattingRuleModel),n=S.useDependency(S.IUniverInstanceService),o=S.useDependency(G.SheetsSelectionsService),i=S.useDependency(S.ICommandService),l=S.useDependency(S.LocaleService),v=S.useDependency(S.Injector),p=S.useDependency(ze),R=me.useObservable(()=>n.getCurrentTypeOfUnit$(S.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),m=R.getUnitId(),b=R.getActiveSheet();if(!b)throw new Error("No active sheet found");const x=b.getSheetId(),[I,T]=N.useState([]),[w,h]=N.useState("2"),[a,s]=N.useState(0),[f,y]=N.useState(-1),[u,g]=N.useState(tr),d=N.useRef(null),C=[{label:l.t("sheet.cf.panel.workSheet"),value:"2"},{label:l.t("sheet.cf.panel.selectedRange"),value:"1"}],M=()=>{const H=r.getSubunitRules(m,x);if(!H||!H.length)return[];if(w==="1"){const A=o.getCurrentLastSelection();if(!A)return[];const ne=A.range;return H.filter(se=>se.ranges.some(fe=>S.Rectangle.intersects(fe,ne)))}else if(w==="2")return[...H];return[]},[j,U]=N.useState(M);ce.useHighlightRange(I),N.useEffect(()=>{const H=i.onCommandExecuted(A=>{A.id===G.SetWorksheetActiveOperation.id&&s(Math.random())});return()=>H.dispose()}),N.useEffect(()=>{U(M)},[w,a,m,x]),N.useEffect(()=>{if(w==="2")return;const H=new be.Observable(A=>{const ne=[G.SetSelectionsOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],oe=i.onCommandExecuted(se=>{const{id:fe,params:ge}=se,Se=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getUnitId();ne.includes(fe)&&ge.unitId===Se&&A.next(null)});return()=>oe.dispose()}).pipe(be.debounceTime(16)).subscribe(()=>{U(M)});return()=>{H.unsubscribe()}},[n,w,m,x]),N.useEffect(()=>{const H=r.$ruleChange.subscribe(()=>{s(Math.random())});return()=>H.unsubscribe()},[r]),N.useEffect(()=>{const H=()=>{var se;const oe=Math.max(0,(((se=d.current)==null?void 0:se.getBoundingClientRect().width)||0)-8);return tr=oe,oe},ne=new be.Observable(oe=>{const se=document.querySelector(".univer-sidebar");if(se){let fe=setTimeout(()=>{oe.next()},150);const ge=()=>{fe&&clearTimeout(fe),fe=null},Se=q=>{q.propertyName==="width"&&(ge(),oe.next())};return se.addEventListener("transitionend",Se),()=>{ge(),se.removeEventListener("transitionend",Se)}}}).pipe(be.debounceTime(16)).subscribe(()=>{g(H())});return()=>{ne.unsubscribe()}},[]);const L=H=>{var oe;const A=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getUnitId(),ne=(oe=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:oe.getSheetId();if(!A||!ne)throw new Error("No active sheet found");i.executeCommand(st.id,{unitId:A,subUnitId:ne,cfId:H.cfId})},E=(H,A)=>{y(A.y)},F=(H,A,ne)=>{var q;y(-1);const oe=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getUnitId(),se=(q=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:q.getSheetId();if(!oe||!se)throw new Error("No active sheet found");const fe=J=>{const ae=j.length;return Math.min(ae-1,Math.max(0,J))},ge=j[fe(A.y)].cfId,Se=j[fe(ne.y)].cfId;ge!==Se&&i.executeCommand(zt.id,{unitId:oe,subUnitId:se,start:{id:ge,type:"self"},end:{id:Se,type:ne.y>A.y?"after":"before"}})},z=()=>{t.onCreate()},B=()=>{w==="2"?i.executeCommand(mt.id):w==="1"&&j.map(A=>({unitId:m,subUnitId:x,cfId:A.cfId})).forEach(A=>{i.executeCommand(st.id,A)})},X=N.useMemo(()=>{const H=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET),A=H.getActiveSheet();return j.filter(ne=>{const oe=ne.ranges;return G.checkRangesEditablePermission(v,H.getUnitId(),A.getSheetId(),oe)})},[j]),te=X.map((H,A)=>({i:H.cfId,x:0,w:12,y:A,h:1,isResizable:!1})),Q=N.useMemo(()=>{const H=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET),A=H.getActiveSheet();return j.every(ne=>{const oe=ne.ranges;return G.checkRangesEditablePermission(v,H.getUnitId(),A.getSheetId(),oe)})},[j]);return _.jsxs("div",{className:pe.cfRuleList,children:[_.jsxs("div",{className:pe.ruleSelector,children:[_.jsx("div",{children:p.tWithReactNode("sheet.cf.panel.managerRuleSelect",_.jsx(re.Select,{className:pe.select,options:C,value:w,onChange:H=>{h(H)}})).map((H,A)=>_.jsx("span",{children:H},A))}),_.jsxs("div",{className:pe.btnList,children:[_.jsx(re.Tooltip,{title:l.t("sheet.cf.panel.createRule"),placement:"bottom",children:_.jsx("div",{className:`
|
|
12
12
|
${pe.icon}
|
|
13
|
-
`,onClick:z,children:_.jsx(
|
|
13
|
+
`,onClick:z,children:_.jsx(gr,{})})}),j.length&&Q?_.jsx(re.Tooltip,{title:l.t("sheet.cf.panel.clear"),placement:"bottom",children:_.jsx("div",{className:`
|
|
14
14
|
${pe.gap}
|
|
15
15
|
${pe.icon}
|
|
16
16
|
`,onClick:B,children:_.jsx(Pt,{})})}):_.jsx("div",{className:`
|
|
@@ -23,32 +23,32 @@
|
|
|
23
23
|
${pe.draggableHandle}
|
|
24
24
|
|
|
25
25
|
draggableHandle
|
|
26
|
-
`,onClick:ne=>ne.stopPropagation(),children:_.jsx(
|
|
26
|
+
`,onClick:ne=>ne.stopPropagation(),children:_.jsx(vr,{})}),_.jsxs("div",{className:pe.ruleDescribe,children:[_.jsx("div",{className:pe.ruleType,children:wi(H,l)}),_.jsx("div",{className:pe.ruleRange,children:H.ranges.map(ne=>an.serializeRange(ne)).join(",")})]}),_.jsx("div",{className:pe.preview,children:_.jsx(We,{rule:H.rule})}),_.jsx("div",{className:`
|
|
27
27
|
${pe.deleteItem}
|
|
28
28
|
${f===A?pe.active:""}
|
|
29
|
-
`,onClick:ne=>{ne.stopPropagation(),L(H),T([])},children:_.jsx(Pt,{})})]})},`${H.cfId}`))}):null})]})},xi="univer-cf-color-picker",Ei="univer-cf-color-picker-icon",Oi="univer-icon-dropdown",
|
|
30
|
-
${
|
|
29
|
+
`,onClick:ne=>{ne.stopPropagation(),L(H),T([])},children:_.jsx(Pt,{})})]})},`${H.cfId}`))}):null})]})},xi="univer-cf-color-picker",Ei="univer-cf-color-picker-icon",Oi="univer-icon-dropdown",Qt={cfColorPicker:xi,cfColorPickerIcon:Ei,iconDropdown:Oi},Ne=t=>{const{color:e,onChange:r,disable:n=!1,iconId:o="PaintBucket",className:i,isNeedDropdownIcon:l=!0}=t,v=S.useDependency(me.ComponentManager),p=N.useMemo(()=>new S.ColorKit(e),[e]),R=v.get(o);return R&&(n?_.jsx(R,{className:i,extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}):_.jsx(re.DropdownLegacy,{overlay:_.jsx("div",{className:`
|
|
30
|
+
${Qt.cfColorPicker}
|
|
31
31
|
`,children:_.jsx(re.ColorPicker,{color:e,onChange:r})}),children:_.jsxs("span",{className:`
|
|
32
|
-
${
|
|
32
|
+
${Qt.cfColorPickerIcon}
|
|
33
33
|
${i}
|
|
34
|
-
`,children:[_.jsx(R,{extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}),l&&_.jsx(
|
|
34
|
+
`,children:[_.jsx(R,{extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}),l&&_.jsx(qt,{className:Qt.iconDropdown})]})}))},Pi="univer-cf-rule-style-editor",Mi="univer-cf-preview-wrap",Fi="univer-text",Di="univer-position-relative",Ni="univer-btn-list",ji="univer-util-item",Li="univer-icon-set",Ui="univer-render-config",Vi="univer-flex",$i="univer-width45",zi="univer-icon-wrap",Ai="univer-icon",qi="univer-dropdown-icon",Wi="univer-error-input",Hi="univer-error-text",ki="univer-icon-group-list",Bi="univer-title",Gi="univer-group",Xi="univer-item-content",Yi="univer-item-wrap",Ki="univer-item",Zi="univer-icon-item-list-wrap",Ji="univer-none",Qi="univer-icon-item-list",ea="univer-width100",ta="univer-stress",k={cfRuleStyleEditor:Pi,cfPreviewWrap:Mi,text:Fi,positionRelative:Di,btnList:Ni,utilItem:ji,iconSet:Li,renderConfig:Ui,flex:Vi,width45:$i,iconWrap:zi,icon:Ai,dropdownIcon:qi,errorInput:Wi,errorText:Hi,iconGroupList:ki,title:Bi,group:Gi,itemContent:Xi,itemWrap:Yi,item:Ki,iconItemListWrap:Zi,none:Ji,iconItemList:Qi,width100:ea,stress:ta},De=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),en=t=>{var T;const{type:e,className:r,onChange:n,id:o,value:i}=t,l=S.useDependency(S.IUniverInstanceService),v=l.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getUnitId(),p=(T=l.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:T.getSheetId(),R=N.useMemo(()=>String(i).startsWith("=")?String(i):"=",[i]),m=N.useMemo(()=>[c.CFValueType.max,c.CFValueType.min,"none"].includes(e)?{disabled:!0}:[c.CFValueType.percent,c.CFValueType.percentile].includes(e)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[e]),b=N.useRef({}),[x,I]=N.useState(!1);return me.useSidebarClick(w=>{var a;const h=(a=b.current)==null?void 0:a.handleOutClick;h&&h(w,()=>I(!1))}),e===c.CFValueType.formula?_.jsx("div",{style:{width:"100%",marginLeft:4},children:_.jsx(pt.FormulaEditor,{initValue:R,unitId:v,subUnitId:p,isFocus:x,onChange:(w="")=>{n(w||"")},onFocus:()=>I(!0),actions:b.current})}):_.jsx(re.InputNumber,{className:r,value:Number(t.value)||0,onChange:w=>t.onChange(w||0),...m})},na=t=>{var L;const{interceptorManager:e}=t,r=S.useDependency(S.LocaleService),n=((L=t.rule)==null?void 0:L.type)===c.CFRuleType.colorScale?t.rule:void 0,o=[De(c.CFValueType.num,r),De(c.CFValueType.percent,r),De(c.CFValueType.percentile,r),De(c.CFValueType.formula,r)],i=[De(c.CFValueType.min,r),...o],l=[De("none",r),...o],v=[De(c.CFValueType.max,r),...o],[p,R]=N.useState(()=>{var F;const E=c.CFValueType.min;return n&&((F=n.config[0])==null?void 0:F.value.type)||E}),[m,b]=N.useState(()=>{var F;const E="none";return!n||n.config.length!==3?E:((F=n.config[1])==null?void 0:F.value.type)||E}),[x,I]=N.useState(()=>{var F;const E=c.CFValueType.max;return n&&((F=n.config[n.config.length-1])==null?void 0:F.value.type)||E}),[T,w]=N.useState(()=>{if(!n)return 10;const F=n.config[0];return(F==null?void 0:F.value.value)===void 0?10:F==null?void 0:F.value.value}),[h,a]=N.useState(()=>{var z;if(!n||n.config.length!==3)return 50;const F=(z=n.config[1])==null?void 0:z.value.value;return F===void 0?50:F}),[s,f]=N.useState(()=>{var z;if(!n)return 90;const F=(z=n.config[n.config.length-1])==null?void 0:z.value.value;return F===void 0?90:F}),[y,u]=N.useState(()=>{var F;const E="#d0d9fb";return n&&((F=n.config[0])==null?void 0:F.color)||E}),[g,d]=N.useState(()=>{var F;const E="#7790f3";return!n||n.config.length!==3?E:((F=n.config[1])==null?void 0:F.color)||E}),[C,M]=N.useState(()=>{var F;const E="#2e55ef";return n&&((F=n.config[n.config.length-1])==null?void 0:F.color)||E}),j=N.useMemo(()=>E=>{const{minType:F,medianType:z,maxType:B,minValue:X,medianValue:te,maxValue:Q,minColor:H,medianColor:A,maxColor:ne}=E,oe=[];return oe.push({color:H,value:{type:F,value:X}}),z!=="none"&&oe.push({color:A,value:{type:z,value:te}}),oe.push({color:ne,value:{type:B,value:Q}}),{config:oe.map((fe,ge)=>({...fe,index:ge})),type:c.CFRuleType.colorScale}},[]);N.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return j({minType:p,medianType:m,maxType:x,minValue:T,medianValue:h,maxValue:s,minColor:y,medianColor:g,maxColor:C})}}),[j,p,m,x,T,h,s,y,g,C,e]);const U=E=>{t.onChange(j(E))};return _.jsxs("div",{children:[_.jsx("div",{className:$.title,children:r.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
|
|
35
35
|
${k.cfPreviewWrap}
|
|
36
36
|
`,children:_.jsx(We,{rule:j({minType:p,medianType:m,maxType:x,minValue:T,medianValue:h,maxValue:s,minColor:y,medianColor:g,maxColor:C})})}),_.jsx("div",{className:$.label,children:r.t("sheet.cf.valueType.min")}),_.jsxs("div",{className:`
|
|
37
37
|
${$.labelContainer}
|
|
38
38
|
${$.mTSm}
|
|
39
|
-
`,children:[_.jsx(re.Select,{style:{flexShrink:0},options:i,value:p,onChange:E=>{R(E);const F=c.createDefaultValueByValueType(E,10);w(F),U({minType:E,medianType:m,maxType:x,minValue:F,medianValue:h,maxValue:s,minColor:y,medianColor:g,maxColor:C})}}),_.jsx(
|
|
39
|
+
`,children:[_.jsx(re.Select,{style:{flexShrink:0},options:i,value:p,onChange:E=>{R(E);const F=c.createDefaultValueByValueType(E,10);w(F),U({minType:E,medianType:m,maxType:x,minValue:F,medianValue:h,maxValue:s,minColor:y,medianColor:g,maxColor:C})}}),_.jsx(en,{id:"min",className:`
|
|
40
40
|
${$.mLXxs}
|
|
41
41
|
`,value:T,type:p,onChange:E=>{w(E),U({minType:p,medianType:m,maxType:x,minValue:E,medianValue:h,maxValue:s,minColor:y,medianColor:g,maxColor:C})}}),_.jsx(Ne,{className:$.mLXxs,color:y,onChange:E=>{u(E),U({minType:p,medianType:m,maxType:x,minValue:T,medianValue:h,maxValue:s,minColor:E,medianColor:g,maxColor:C})}})]}),_.jsx("div",{className:$.label,children:r.t("sheet.cf.panel.medianValue")}),_.jsxs("div",{className:`
|
|
42
42
|
${$.labelContainer}
|
|
43
43
|
${$.mTSm}
|
|
44
|
-
`,children:[_.jsx(re.Select,{style:{flexShrink:0},options:l,value:m,onChange:E=>{b(E);const F=c.createDefaultValueByValueType(E,50);a(F),U({minType:p,medianType:E,maxType:x,minValue:T,medianValue:F,maxValue:s,minColor:y,medianColor:g,maxColor:C})}}),_.jsx(
|
|
44
|
+
`,children:[_.jsx(re.Select,{style:{flexShrink:0},options:l,value:m,onChange:E=>{b(E);const F=c.createDefaultValueByValueType(E,50);a(F),U({minType:p,medianType:E,maxType:x,minValue:T,medianValue:F,maxValue:s,minColor:y,medianColor:g,maxColor:C})}}),_.jsx(en,{id:"median",className:`
|
|
45
45
|
${$.mLXxs}
|
|
46
46
|
`,value:h,type:m,onChange:E=>{a(E),U({minType:p,medianType:m,maxType:x,minValue:T,medianValue:E,maxValue:s,minColor:y,medianColor:g,maxColor:C})}}),m!=="none"&&_.jsx(Ne,{className:$.mLXxs,color:g,onChange:E=>{d(E),U({minType:p,medianType:m,maxType:x,minValue:T,medianValue:h,maxValue:s,minColor:y,medianColor:E,maxColor:C})}})]}),_.jsx("div",{className:$.label,children:r.t("sheet.cf.valueType.max")}),_.jsxs("div",{className:`
|
|
47
47
|
${$.labelContainer}
|
|
48
48
|
${$.mTSm}
|
|
49
|
-
`,children:[_.jsx(re.Select,{style:{flexShrink:0},options:v,value:x,onChange:E=>{I(E);const F=c.createDefaultValueByValueType(E,90);f(F),U({minType:p,medianType:m,maxType:E,minValue:T,medianValue:h,maxValue:F,minColor:y,medianColor:g,maxColor:C})}}),_.jsx(
|
|
49
|
+
`,children:[_.jsx(re.Select,{style:{flexShrink:0},options:v,value:x,onChange:E=>{I(E);const F=c.createDefaultValueByValueType(E,90);f(F),U({minType:p,medianType:m,maxType:E,minValue:T,medianValue:h,maxValue:F,minColor:y,medianColor:g,maxColor:C})}}),_.jsx(en,{id:"max",className:`
|
|
50
50
|
${$.mLXxs}
|
|
51
|
-
`,value:s,type:x,onChange:E=>{f(E),U({minType:p,medianType:m,maxType:x,minValue:T,medianValue:h,maxValue:E,minColor:y,medianColor:g,maxColor:C})}}),_.jsx(Ne,{className:$.mLXxs,color:C,onChange:E=>{M(E),U({minType:p,medianType:m,maxType:x,minValue:T,medianValue:h,maxValue:s,minColor:y,medianColor:g,maxColor:E})}})]})]})},Le=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),
|
|
51
|
+
`,value:s,type:x,onChange:E=>{f(E),U({minType:p,medianType:m,maxType:x,minValue:T,medianValue:h,maxValue:E,minColor:y,medianColor:g,maxColor:C})}}),_.jsx(Ne,{className:$.mLXxs,color:C,onChange:E=>{M(E),U({minType:p,medianType:m,maxType:x,minValue:T,medianValue:h,maxValue:s,minColor:y,medianColor:g,maxColor:E})}})]})]})},Le=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),nr=t=>{var w;const{onChange:e,className:r,value:n,type:o,id:i,disabled:l=!1}=t,v=S.useDependency(S.IUniverInstanceService),p=v.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getUnitId(),R=(w=v.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:w.getSheetId(),m=N.useRef({}),[b,x]=N.useState(!1);me.useSidebarClick(h=>{var s;const a=(s=m.current)==null?void 0:s.handleOutClick;a&&a(h,()=>x(!1))});const I=N.useRef(n),T=N.useMemo(()=>[c.CFValueType.percentile,c.CFValueType.percent].includes(o)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[o]);if(o===c.CFValueType.formula){const h=String(I.current).startsWith("=")?String(I.current)||"":"=";return _.jsx("div",{style:{width:"100%",marginLeft:12},children:_.jsx(pt.FormulaEditor,{initValue:h,unitId:p,subUnitId:R,isFocus:b,onChange:(a="")=>{e(a||"")},onFocus:()=>x(!0),actions:m.current})})}return _.jsx(re.InputNumber,{className:r,value:Number(n)||0,disabled:l,onChange:h=>{e(h||0)},...T})},ra=t=>{var L;const{interceptorManager:e}=t,r=S.useDependency(S.LocaleService),n=((L=t.rule)==null?void 0:L.type)===c.CFRuleType.dataBar?t.rule:void 0,[o,i]=N.useState(()=>{var F;const E="0";return n?(F=n.config)!=null&&F.isGradient?"1":"0":E}),[l,v]=N.useState(()=>{var E;return n&&((E=n.config)==null?void 0:E.positiveColor)||c.defaultDataBarPositiveColor}),[p,R]=N.useState(()=>{var E;return n&&((E=n.config)==null?void 0:E.nativeColor)||c.defaultDataBarNativeColor}),m=[Le(c.CFValueType.num,r),Le(c.CFValueType.percent,r),Le(c.CFValueType.percentile,r),Le(c.CFValueType.formula,r)],b=[Le(c.CFValueType.min,r),...m],x=[Le(c.CFValueType.max,r),...m],[I,T]=N.useState(()=>{var F;const E=b[0].value;return n&&((F=n.config)==null?void 0:F.min.type)||E}),[w,h]=N.useState(()=>{var F;const E=x[0].value;return n&&((F=n.config)==null?void 0:F.max.type)||E}),[a,s]=N.useState(()=>{var z;if(!n)return 0;const F=((z=n.config)==null?void 0:z.min)||{};return F.type===c.CFValueType.formula?F.value||"=":F.value||0}),[f,y]=N.useState(()=>{var z;if(!n)return 100;const F=((z=n.config)==null?void 0:z.max)||{};return F.type===c.CFValueType.formula?F.value||"=":F.value===void 0?100:F.value}),[u,g]=N.useState(()=>n?n.isShowValue===void 0?!0:!!n.isShowValue:!0),d=E=>({config:{min:{type:E.minValueType,value:E.minValue},max:{type:E.maxValueType,value:E.maxValue},isGradient:E.isGradient==="1",positiveColor:E.positiveColor||c.defaultDataBarPositiveColor,nativeColor:E.nativeColor||c.defaultDataBarNativeColor},type:c.CFRuleType.dataBar,isShowValue:E.isShowValue});N.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return d({isGradient:o,minValue:a,minValueType:I,maxValue:f,maxValueType:w,positiveColor:l,nativeColor:p,isShowValue:u})}}),[o,a,I,f,w,l,p,e,u]);const C=E=>{t.onChange(d(E))},M=E=>{v(E),C({isGradient:o,minValue:a,minValueType:I,maxValue:f,maxValueType:w,positiveColor:E,nativeColor:p,isShowValue:u})},j=E=>{R(E),C({isGradient:o,minValue:a,minValueType:I,maxValue:f,maxValueType:w,positiveColor:l,nativeColor:E,isShowValue:u})},U=E=>m.map(F=>F.value).includes(E);return _.jsxs("div",{children:[_.jsx("div",{className:$.title,children:r.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
|
|
52
52
|
${k.cfPreviewWrap}
|
|
53
53
|
`,children:_.jsx(We,{rule:d({isGradient:o,minValue:a,minValueType:I,maxValue:f,maxValueType:w,positiveColor:l,nativeColor:p,isShowValue:u})})}),_.jsxs("div",{children:[_.jsx("div",{className:$.label,children:r.t("sheet.cf.panel.fillType")}),_.jsxs("div",{className:`
|
|
54
54
|
${$.mTSm}
|
|
@@ -73,10 +73,10 @@
|
|
|
73
73
|
`,children:r.t("sheet.cf.panel.positive")}),_.jsx(Ne,{color:l,onChange:M})]})]})]}),_.jsxs("div",{children:[_.jsx("div",{className:$.label,children:r.t("sheet.cf.valueType.min")}),_.jsxs("div",{className:`
|
|
74
74
|
${$.mTSm}
|
|
75
75
|
${$.labelContainer}
|
|
76
|
-
`,children:[_.jsx(re.Select,{style:{width:"50%",flexShrink:0},options:b,value:I,onChange:E=>{T(E);const F=c.createDefaultValueByValueType(E,10);s(F),C({isGradient:o,minValue:F,minValueType:E,maxValue:f,maxValueType:w,positiveColor:l,nativeColor:p,isShowValue:u})}}),_.jsx(
|
|
76
|
+
`,children:[_.jsx(re.Select,{style:{width:"50%",flexShrink:0},options:b,value:I,onChange:E=>{T(E);const F=c.createDefaultValueByValueType(E,10);s(F),C({isGradient:o,minValue:F,minValueType:E,maxValue:f,maxValueType:w,positiveColor:l,nativeColor:p,isShowValue:u})}}),_.jsx(nr,{disabled:!U(I),id:"min",type:I,className:$.mLSm,value:a,onChange:E=>{s(E||0),C({isGradient:o,minValue:E||0,minValueType:I,maxValue:f,maxValueType:w,positiveColor:l,nativeColor:p,isShowValue:u})}})]}),_.jsx("div",{className:$.label,children:r.t("sheet.cf.valueType.max")}),_.jsxs("div",{className:`
|
|
77
77
|
${$.mTSm}
|
|
78
78
|
${$.labelContainer}
|
|
79
|
-
`,children:[_.jsx(re.Select,{style:{width:"50%",flexShrink:0},options:x,value:w,onChange:E=>{h(E);const F=c.createDefaultValueByValueType(E,90);y(F),C({isGradient:o,minValue:a,minValueType:I,maxValue:F,maxValueType:E,positiveColor:l,nativeColor:p,isShowValue:u})}}),_.jsx(
|
|
79
|
+
`,children:[_.jsx(re.Select,{style:{width:"50%",flexShrink:0},options:x,value:w,onChange:E=>{h(E);const F=c.createDefaultValueByValueType(E,90);y(F),C({isGradient:o,minValue:a,minValueType:I,maxValue:F,maxValueType:E,positiveColor:l,nativeColor:p,isShowValue:u})}}),_.jsx(nr,{disabled:!U(w),id:"max",type:w,className:$.mLSm,value:f,onChange:E=>{y(E||0),C({isGradient:o,minValue:a,minValueType:I,maxValue:E||0,maxValueType:w,positiveColor:l,nativeColor:p,isShowValue:u})}})]})]})]})};function Mr(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(r=Mr(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function It(){for(var t,e,r=0,n="",o=arguments.length;r<o;r++)(t=arguments[r])&&(e=Mr(t))&&(n&&(n+=" "),n+=e);return n}const oa="univer-cf-style-edit",ia="univer-button-item",aa="univer-isActive",we={cfStyleEdit:oa,buttonItem:ia,isActive:aa},wt=t=>[S.BooleanNumber.FALSE,void 0].includes(t)?S.BooleanNumber.TRUE:S.BooleanNumber.FALSE,_t=t=>t!==S.BooleanNumber.FALSE,Rn=t=>{const{style:e,onChange:r,className:n}=t,o=S.useDependency(me.ComponentManager),[i,l]=N.useState(()=>{if(e!=null&&e.bl)return e.bl}),[v,p]=N.useState(()=>{if(e!=null&&e.it)return e.it}),[R,m]=N.useState(()=>{if(e!=null&&e.ul)return e.ul.s}),[b,x]=N.useState(()=>{if(e!=null&&e.st)return e.st.s}),[I,T]=N.useState(()=>{var g;const u="#2f56ef";return(g=e==null?void 0:e.cl)!=null&&g.rgb?e.cl.rgb:u}),[w,h]=N.useState(()=>{var g;const u="#e8ecfc";return(g=e==null?void 0:e.bg)!=null&&g.rgb?e.bg.rgb:u}),a=o.get("BoldSingle"),s=o.get("ItalicSingle"),f=o.get("UnderlineSingle"),y=o.get("StrikethroughSingle");return N.useEffect(()=>{const u={bl:i,it:v};I!==void 0&&(u.cl={rgb:I}),w!==void 0&&(u.bg={rgb:w}),b!==void 0&&(u.st={s:b}),R!==void 0&&(u.ul={s:R}),r(c.removeUndefinedAttr(u))},[i,v,R,b,I,w]),_.jsxs("div",{className:`
|
|
80
80
|
${we.cfStyleEdit}
|
|
81
81
|
${n}
|
|
82
82
|
`,children:[a&&_.jsx("div",{className:It({[we.isActive]:_t(i||S.BooleanNumber.FALSE)},we.buttonItem),onClick:()=>l(wt(i)),children:_.jsx(a,{})}),s&&_.jsx("div",{className:It({[we.isActive]:_t(v||S.BooleanNumber.FALSE)},we.buttonItem),onClick:()=>p(wt(v)),children:_.jsx(s,{})}),f&&_.jsx("div",{className:It({[we.isActive]:_t(R||S.BooleanNumber.FALSE)},we.buttonItem),onClick:()=>m(wt(R)),children:_.jsx(f,{})}),y&&_.jsx("div",{className:It({[we.isActive]:_t(b||S.BooleanNumber.FALSE)},we.buttonItem),onClick:()=>x(wt(b)),children:_.jsx(y,{})}),_.jsx(Ne,{color:I,onChange:T,iconId:"FontColor"}),_.jsx(Ne,{color:w,onChange:h,iconId:"PaintBucket"})]})},sa=t=>{var y;const{onChange:e,interceptorManager:r}=t,n=S.useDependency(S.LocaleService),i=S.useDependency(S.IUniverInstanceService).getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET),l=i.getActiveSheet(),v=((y=t.rule)==null?void 0:y.type)===c.CFRuleType.highlightCell?t.rule:void 0,p=N.useRef(null),[R,m]=N.useState(!1),b=N.useRef({}),[x,I]=N.useState({}),[T,w]=N.useState(()=>(v==null?void 0:v.subType)===c.CFSubRuleType.formula?v.value:"="),[h,a]=N.useState(void 0),s=u=>({style:u.style,value:T,type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula});N.useEffect(()=>r.intercept(r.getInterceptPoints().submit,{handler(){return s({style:x,formula:T})}}),[x,T,r]),N.useEffect(()=>r.intercept(r.getInterceptPoints().beforeSubmit,{handler:(g,d,C)=>h||T.length===1||!T.startsWith("=")?(a(n.t("sheet.cf.errorMessage.formulaError")),!1):C(g)}),[h,T]);const f=u=>{e(s(u))};return me.useSidebarClick(u=>{var d;const g=(d=b.current)==null?void 0:d.handleOutClick;g&&g(u,()=>m(!1))}),_.jsxs("div",{ref:p,children:[_.jsx("div",{className:`
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
${$.mTSm}
|
|
87
87
|
`,children:_.jsx(pt.FormulaEditor,{onChange:u=>{w(u),f({style:x,formula:u})},onVerify:(u,g)=>{!u||g.length===1?a(n.t("sheet.cf.errorMessage.formulaError")):a(void 0)},errorText:h,onFocus:()=>{m(!0)},actions:b.current,isFocus:R,initValue:T,unitId:i.getUnitId(),subUnitId:l==null?void 0:l.getSheetId()})}),_.jsx("div",{className:`
|
|
88
88
|
${k.cfPreviewWrap}
|
|
89
|
-
`,children:_.jsx(We,{rule:s({style:x,formula:T})})}),_.jsx(
|
|
89
|
+
`,children:_.jsx(We,{rule:s({style:x,formula:T})})}),_.jsx(Rn,{style:v==null?void 0:v.style,className:`
|
|
90
90
|
${$.mTSm}
|
|
91
91
|
`,onChange:u=>{I(u),f({style:u,formula:T})}})]})},xt=t=>_.jsxs("div",{style:{position:"relative"},children:[_.jsx("div",{style:{position:"absolute",zIndex:999,bottom:"-13px",fontSize:"10px",color:"red"},children:t.errorText}),t.children]}),le=(t,e)=>({label:e.t(`sheet.cf.operator.${t}`),value:t}),la=t=>{const{type:e,operator:r,onChange:n,value:o,interceptorManager:i}=t,l=S.useDependency(S.LocaleService),[v,p]=N.useState(()=>typeof o=="number"?o:0),[R,m]=N.useState(""),[b,x]=N.useState(()=>typeof o=="string"?o:""),[I,T]=N.useState(""),[w,h]=N.useState(()=>Array.isArray(o)?o[0]===void 0?0:o[0]:0),[a,s]=N.useState(""),[f,y]=N.useState(()=>Array.isArray(o)?o[1]===void 0?100:o[1]:100),[u,g]=N.useState("");switch(N.useEffect(()=>{switch(e){case c.CFSubRuleType.text:{[c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(r)&&n(b);break}case c.CFSubRuleType.number:{[c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(r)&&n(v),[c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(r)&&n([w,f]);break}}},[e]),N.useEffect(()=>{const d=i.intercept(i.getInterceptPoints().beforeSubmit,{handler:(C,M,j)=>{switch(e){case c.CFSubRuleType.text:if([c.CFTextOperator.beginsWith,c.CFTextOperator.containsText,c.CFTextOperator.endsWith,c.CFTextOperator.notEqual,c.CFTextOperator.notContainsText,c.CFTextOperator.equal].includes(r))return b?j(C):(T(l.t("sheet.cf.errorMessage.notBlank")),!1)}return j(C)}});return()=>{d()}},[e,v,b,r]),e){case c.CFSubRuleType.text:{if([c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(r)){const d=C=>{x(C),n(C)};return _.jsx("div",{className:`
|
|
92
92
|
${$.mTSm}
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
${$.labelContainer}
|
|
98
98
|
`,children:[_.jsx(xt,{errorText:a,children:_.jsx(re.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:w,onChange:d})}),_.jsx(xt,{errorText:u,children:_.jsx(re.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`
|
|
99
99
|
${$.mLSm}
|
|
100
|
-
`,value:f,onChange:C})})]})}}}return null},
|
|
100
|
+
`,value:f,onChange:C})})]})}}}return null},rr=(t,e)=>{switch(t){case c.CFSubRuleType.text:return[le(c.CFTextOperator.containsText,e),le(c.CFTextOperator.notContainsText,e),le(c.CFTextOperator.beginsWith,e),le(c.CFTextOperator.endsWith,e),le(c.CFTextOperator.equal,e),le(c.CFTextOperator.notEqual,e),le(c.CFTextOperator.containsBlanks,e),le(c.CFTextOperator.notContainsBlanks,e),le(c.CFTextOperator.containsErrors,e),le(c.CFTextOperator.notContainsErrors,e)];case c.CFSubRuleType.number:return[le(c.CFNumberOperator.between,e),le(c.CFNumberOperator.notBetween,e),le(c.CFNumberOperator.equal,e),le(c.CFNumberOperator.notEqual,e),le(c.CFNumberOperator.greaterThan,e),le(c.CFNumberOperator.greaterThanOrEqual,e),le(c.CFNumberOperator.lessThan,e),le(c.CFNumberOperator.lessThanOrEqual,e)];case c.CFSubRuleType.timePeriod:return[le(c.CFTimePeriodOperator.yesterday,e),le(c.CFTimePeriodOperator.today,e),le(c.CFTimePeriodOperator.tomorrow,e),le(c.CFTimePeriodOperator.last7Days,e),le(c.CFTimePeriodOperator.lastWeek,e),le(c.CFTimePeriodOperator.thisWeek,e),le(c.CFTimePeriodOperator.nextWeek,e),le(c.CFTimePeriodOperator.lastMonth,e),le(c.CFTimePeriodOperator.thisMonth,e),le(c.CFTimePeriodOperator.nextMonth,e)]}},or=t=>{var y;const{interceptorManager:e,onChange:r}=t,n=S.useDependency(S.LocaleService),o=((y=t.rule)==null?void 0:y.type)===c.CFRuleType.highlightCell?t.rule:void 0,[i,l]=N.useState(()=>{const u=c.CFSubRuleType.text;return o&&o.subType||u}),v=[{value:c.CFSubRuleType.text,label:n.t("sheet.cf.subRuleType.text")},{value:c.CFSubRuleType.number,label:n.t("sheet.cf.subRuleType.number")},{value:c.CFSubRuleType.timePeriod,label:n.t("sheet.cf.subRuleType.timePeriod")},{value:c.CFSubRuleType.duplicateValues,label:n.t("sheet.cf.subRuleType.duplicateValues")},{value:c.CFSubRuleType.uniqueValues,label:n.t("sheet.cf.subRuleType.uniqueValues")}],p=N.useMemo(()=>rr(i,n),[i]),[R,m]=N.useState(()=>{const u=p?p[0].value:void 0;return o&&o.operator||u}),[b,x]=N.useState(()=>{var d;const u="";return o?(d=o.value)!=null?d:c.createDefaultValue(o.subType,o.operator):u}),[I,T]=N.useState({}),w=N.useMemo(()=>u=>{var g,d,C,M,j,U,L,E,F,z,B,X,te,Q,H;switch(u.subType||i){case c.CFSubRuleType.text:{if([c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(R))return{type:c.CFRuleType.highlightCell,subType:(g=u.subType)!=null?g:i,operator:(d=u.operator)!=null?d:R,style:(C=u.style)!=null?C:I,value:(M=u.value)!=null?M:b};break}case c.CFSubRuleType.number:{if([c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(R))return{type:c.CFRuleType.highlightCell,subType:(j=u.subType)!=null?j:i,operator:(U=u.operator)!=null?U:R,style:(L=u.style)!=null?L:I,value:(E=u.value)!=null?E:b};if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(R))return{type:c.CFRuleType.highlightCell,subType:(F=u.subType)!=null?F:i,operator:(z=u.operator)!=null?z:R,style:(B=u.style)!=null?B:I,value:(X=u.value)!=null?X:b};break}}return{type:c.CFRuleType.highlightCell,subType:(te=u.subType)!=null?te:i,operator:(Q=u.operator)!=null?Q:R,style:(H=u.style)!=null?H:I}},[i,R,b,I]);N.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return w({})}}),[w,e]),N.useEffect(()=>{v.some(u=>u.value===i)||l(v[0].value)},[v]);const h=u=>{const g=u,d=rr(g,n),C=d&&d[0].value;l(g),m(C),C&&x(c.createDefaultValue(g,C)),r(w({subType:g,operator:C}))},a=u=>{const g=u;m(g),r(w({operator:g}))},s=u=>{x(u),r(w({value:u}))},f=N.useMemo(()=>`${i}_${R}_${Math.random()}`,[i,R]);return _.jsxs("div",{children:[_.jsx("div",{className:`
|
|
101
101
|
${$.title}
|
|
102
102
|
${$.mTBase}
|
|
103
103
|
`,children:n.t("sheet.cf.panel.styleRule")}),_.jsx(re.Select,{className:`
|
|
@@ -108,11 +108,11 @@
|
|
|
108
108
|
${k.width100}
|
|
109
109
|
`,onChange:a,value:R||"",options:p}),_.jsx(la,{value:b,interceptorManager:e,type:i,operator:R,rule:o,onChange:s},f),_.jsx("div",{className:`
|
|
110
110
|
${k.cfPreviewWrap}
|
|
111
|
-
`,children:_.jsx(We,{rule:w({})})}),_.jsx(
|
|
111
|
+
`,children:_.jsx(We,{rule:w({})})}),_.jsx(Rn,{style:o==null?void 0:o.style,className:`
|
|
112
112
|
${$.mLXxs}
|
|
113
|
-
`,onChange:u=>{T(u),r(w({style:u}))}})]})},
|
|
113
|
+
`,onChange:u=>{T(u),r(w({style:u}))}})]})},Fr=(t,e)=>(c.iconMap[t]||[])[Number(e)]||"",ua=t=>{var p;const e=S.useDependency(S.IUniverInstanceService),r=e.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getUnitId(),n=(p=e.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:p.getSheetId(),o=N.useMemo(()=>t.error?k.errorInput:"",[t.error]),i=N.useRef({}),[l,v]=N.useState(!1);return me.useSidebarClick(R=>{var b;const m=(b=i.current)==null?void 0:b.handleOutClick;m&&m(R,()=>v(!1))}),_.jsx("div",{className:k.positionRelative,children:t.type!==c.CFValueType.formula?_.jsxs(_.Fragment,{children:[_.jsx(re.InputNumber,{className:o,value:Number(t.value)||0,onChange:R=>t.onChange(R!=null?R:0)}),t.error&&_.jsx("div",{className:k.errorText,children:t.error})]}):_.jsx("div",{style:{width:"100%"},children:_.jsx(pt.FormulaEditor,{initValue:String(t.value),unitId:r,subUnitId:n,isFocus:l,onChange:(R="")=>{const m=R||"";t.onChange(m)},onFocus:()=>v(!0),actions:i.current})})})},ir=(t,e,r)=>({operator:c.CFNumberOperator.greaterThan,value:{type:c.CFValueType.num,value:(r.length-1-e)*10},iconType:t,iconId:String(e)}),ca=N.forwardRef((t,e)=>{const r=S.useDependency(S.LocaleService),n=o=>{t.onClick(o)};return _.jsx("div",{ref:e,className:k.iconGroupList,children:c.iconGroup.map((o,i)=>_.jsxs("div",{className:k.group,children:[_.jsx("div",{className:k.title,children:r.t(o.title)}),_.jsx("div",{className:k.itemContent,children:o.group.map(l=>_.jsx("div",{className:k.itemWrap,onClick:()=>{n(l.name)},children:_.jsx("div",{className:k.item,children:l.list.map((v,p)=>_.jsx("img",{className:k.icon,src:v},p))})},l.name))})]},i))})}),da=t=>{const e=N.useMemo(()=>{const n=[];for(const o in c.iconMap){const i=c.iconMap[o],l=o;i.forEach((v,p)=>{n.push({iconType:l,base64:v,iconId:String(p)})})}return n},[]),r=n=>{t.onClick(n.iconType,n.iconId)};return _.jsxs("div",{className:k.iconItemListWrap,children:[_.jsxs("div",{className:k.none,onClick:()=>r({iconType:c.EMPTY_ICON_TYPE,iconId:"",base64:""}),children:[_.jsx(gt,{className:k.icon}),_.jsx("span",{children:"无单元格图标"})]}),_.jsx("div",{className:k.iconItemList,children:e.map(n=>_.jsx("div",{className:k.item,children:_.jsx("img",{onClick:()=>r(n),className:`
|
|
114
114
|
${k.icon}
|
|
115
|
-
`,src:n.base64})},`${n.iconType}_${n.iconId}`))})]})},fa=t=>{const{onChange:e,configList:r,errorMap:n={}}=t,o=S.useDependency(S.LocaleService),i=[{label:o.t(`sheet.cf.symbol.${c.CFNumberOperator.greaterThan}`),value:c.CFNumberOperator.greaterThan},{label:o.t(`sheet.cf.symbol.${c.CFNumberOperator.greaterThanOrEqual}`),value:c.CFNumberOperator.greaterThanOrEqual}],l=[{label:o.t(`sheet.cf.valueType.${c.CFValueType.num}`),value:c.CFValueType.num},{label:o.t(`sheet.cf.valueType.${c.CFValueType.percent}`),value:c.CFValueType.percent},{label:o.t(`sheet.cf.valueType.${c.CFValueType.percentile}`),value:c.CFValueType.percentile},{label:o.t(`sheet.cf.valueType.${c.CFValueType.formula}`),value:c.CFValueType.formula}],v=(b,x)=>{e([String(x),"value","value"],b)},p=(b,x)=>{e([String(x),"operator"],b);const I=c.createDefaultValue(c.CFSubRuleType.number,b);v(I,x)},R=(b,x)=>{e([String(x),"value","type"],b);const I=r[x],T=c.createDefaultValue(c.CFSubRuleType.number,I.operator);v(T,x)};return N.useMemo(()=>r.map((b,x)=>{const I=n[x],T=
|
|
115
|
+
`,src:n.base64})},`${n.iconType}_${n.iconId}`))})]})},fa=t=>{const{onChange:e,configList:r,errorMap:n={}}=t,o=S.useDependency(S.LocaleService),i=[{label:o.t(`sheet.cf.symbol.${c.CFNumberOperator.greaterThan}`),value:c.CFNumberOperator.greaterThan},{label:o.t(`sheet.cf.symbol.${c.CFNumberOperator.greaterThanOrEqual}`),value:c.CFNumberOperator.greaterThanOrEqual}],l=[{label:o.t(`sheet.cf.valueType.${c.CFValueType.num}`),value:c.CFValueType.num},{label:o.t(`sheet.cf.valueType.${c.CFValueType.percent}`),value:c.CFValueType.percent},{label:o.t(`sheet.cf.valueType.${c.CFValueType.percentile}`),value:c.CFValueType.percentile},{label:o.t(`sheet.cf.valueType.${c.CFValueType.formula}`),value:c.CFValueType.formula}],v=(b,x)=>{e([String(x),"value","value"],b)},p=(b,x)=>{e([String(x),"operator"],b);const I=c.createDefaultValue(c.CFSubRuleType.number,b);v(I,x)},R=(b,x)=>{e([String(x),"value","type"],b);const I=r[x],T=c.createDefaultValue(c.CFSubRuleType.number,I.operator);v(T,x)};return N.useMemo(()=>r.map((b,x)=>{const I=n[x],T=Fr(b.iconType,b.iconId),w=x===r.length-1,h=x===0,a=r[x-1],s=(a==null?void 0:a.value.type)===c.CFValueType.formula?o.t("sheet.cf.valueType.formula"):a==null?void 0:a.value.value,f=(y,u)=>{const g={...b,iconId:u,iconType:y};e([String(x)],g)};return _.jsxs("div",{className:`
|
|
116
116
|
${x?$.mTXl:$.mTSm}
|
|
117
117
|
`,children:[_.jsxs("div",{className:`
|
|
118
118
|
${$.label}
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
`,children:[_.jsx("div",{className:`
|
|
128
128
|
${k.iconWrap}
|
|
129
129
|
${k.width45}
|
|
130
|
-
`,children:_.jsx(re.
|
|
130
|
+
`,children:_.jsx(re.DropdownLegacy,{overlay:_.jsx(da,{onClick:f,iconId:b.iconId,iconType:b.iconType}),children:_.jsxs("div",{className:k.dropdownIcon,children:[T?_.jsx("img",{src:T,className:k.icon}):_.jsx(gt,{className:k.icon}),_.jsx(qt,{})]})})}),w?_.jsxs("div",{className:`
|
|
131
131
|
${k.width45}
|
|
132
132
|
${$.label}
|
|
133
133
|
`,style:{marginTop:0},children:[o.t("sheet.cf.iconSet.rule"),_.jsxs("span",{className:k.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${c.getOppositeOperator(a.operator)}`),s,w?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]}):_.jsx(re.Select,{className:`
|
|
@@ -151,9 +151,9 @@
|
|
|
151
151
|
`,options:l,value:b.value.type,onChange:y=>{R(y,x)}}),_.jsx("div",{className:`
|
|
152
152
|
${$.mL0}
|
|
153
153
|
${k.width45}
|
|
154
|
-
`,children:_.jsx(ua,{id:x,type:b.value.type,error:I,value:b.value.value||"",onChange:y=>v(y,x)})})]})]})]},x)}),[r,n])},pa=t=>{var y;const{interceptorManager:e}=t,r=((y=t.rule)==null?void 0:y.type)===c.CFRuleType.iconSet?t.rule:void 0,n=S.useDependency(S.LocaleService),[o,i]=N.useState({}),[l,v]=N.useState(()=>{const u=Object.keys(c.iconMap)[0];if(r&&r.config.length){const g=r.config[0].iconType;if(!r.config.some(C=>C.iconType!==g))return g}return u}),[p,R]=N.useState(()=>{if(r&&r.config.length)return S.Tools.deepClone(r==null?void 0:r.config);const u=c.iconMap[l]||[];return new Array(u.length).fill("").map((g,d,C)=>d===C.length-1?{operator:c.CFNumberOperator.lessThanOrEqual,value:{type:c.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:l,iconId:String(d)}:
|
|
154
|
+
`,children:_.jsx(ua,{id:x,type:b.value.type,error:I,value:b.value.value||"",onChange:y=>v(y,x)})})]})]})]},x)}),[r,n])},pa=t=>{var y;const{interceptorManager:e}=t,r=((y=t.rule)==null?void 0:y.type)===c.CFRuleType.iconSet?t.rule:void 0,n=S.useDependency(S.LocaleService),[o,i]=N.useState({}),[l,v]=N.useState(()=>{const u=Object.keys(c.iconMap)[0];if(r&&r.config.length){const g=r.config[0].iconType;if(!r.config.some(C=>C.iconType!==g))return g}return u}),[p,R]=N.useState(()=>{if(r&&r.config.length)return S.Tools.deepClone(r==null?void 0:r.config);const u=c.iconMap[l]||[];return new Array(u.length).fill("").map((g,d,C)=>d===C.length-1?{operator:c.CFNumberOperator.lessThanOrEqual,value:{type:c.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:l,iconId:String(d)}:ir(l,d,C))}),[m,b]=N.useState(()=>r?!!r.isShowValue:!0),x=N.useMemo(()=>{const u=p.map(g=>Fr(g.iconType,g.iconId));return _.jsx("div",{className:k.iconWrap,children:u.map((g,d)=>g?_.jsx("img",{className:k.icon,src:g},d):_.jsx(gt,{className:k.icon},d))})},[p]),I=u=>{if(u.reduce((d,C,M)=>d.preType&&!d.result||u.length-1===M?d:C.value.type===c.CFValueType.formula?{preType:c.CFValueType.formula,result:!1}:d.preType?{result:d.preType===C.value.type,preType:C.value.type}:{result:!0,preType:C.value.type},{result:!0,preType:""}).result&&[c.CFValueType.num,c.CFValueType.percent,c.CFValueType.percentile].includes(u[0].value.type)){const d={};return u.forEach((C,M,j)=>{if(M-1<0||M===j.length-1)return;const L=u[M-1],E=c.getOppositeOperator(L.operator);c.compareWithNumber({operator:E,value:L.value.value},C.value.value)||(d[M]=`${n.t(`sheet.cf.form.${E}`,String(L.value.value))} `)}),d}return{}},T=(u,g)=>{S.get(p,u)!==g&&(S.set(p,u,g),R([...p]),i(I(p)))},w=u=>{v(u);const g=c.iconMap[u]||[],d=new Array(g.length).fill("").map((C,M,j)=>ir(u,M,j));R(d),i(I(d))};N.useEffect(()=>{const u=e.intercept(e.getInterceptPoints().submit,{handler(){return{type:c.CFRuleType.iconSet,isShowValue:m,config:p}}});return()=>{u()}},[m,p,e]),N.useEffect(()=>{const u=e.intercept(e.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(o).length===0}});return()=>{u()}},[m,p,e,o]);const h=()=>{const u=p.map(g=>({...g}));p.forEach((g,d)=>{const C=p.length-1-d,M=u[C];g.iconId=M.iconId,g.iconType=M.iconType}),R([...p])},a=S.useDependency(me.ILayoutService),[s,f]=N.useState();return me.useScrollYOverContainer(s,a.rootContainerElement),_.jsxs("div",{className:k.iconSet,children:[_.jsx("div",{className:$.title,children:n.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
|
|
155
155
|
${$.mTSm}
|
|
156
|
-
`,children:_.jsx(re.
|
|
156
|
+
`,children:_.jsx(re.DropdownLegacy,{placement:"bottomLeft",overlay:_.jsx(ca,{ref:u=>!s&&u&&f(u),iconType:l,onClick:w}),children:_.jsxs("div",{className:k.dropdownIcon,style:{width:"unset"},children:[x,_.jsx(qt,{})]})})}),_.jsxs("div",{className:`
|
|
157
157
|
${$.mTSm}
|
|
158
158
|
${k.renderConfig}
|
|
159
159
|
`,children:[_.jsxs("div",{className:k.utilItem,children:[_.jsx(re.Checkbox,{onChange:h}),n.t("sheet.cf.iconSet.reverseIconOrder")]}),_.jsxs("div",{className:`
|
|
@@ -174,11 +174,11 @@
|
|
|
174
174
|
${k.text}
|
|
175
175
|
`,children:[_.jsx(re.Checkbox,{checked:m,onChange:a=>{b(!!a),w({type:l,isPercent:!!a,value:p,style:x})}}),n.t("sheet.cf.valueType.percent")]})]}),_.jsx("div",{className:`
|
|
176
176
|
${k.cfPreviewWrap}
|
|
177
|
-
`,children:_.jsx(We,{rule:T({type:l,isPercent:m,value:p,style:x})})}),_.jsx(
|
|
177
|
+
`,children:_.jsx(We,{rule:T({type:l,isPercent:m,value:p,style:x})})}),_.jsx(Rn,{style:o==null?void 0:o.style,className:`
|
|
178
178
|
${$.mTSm}
|
|
179
|
-
`,onChange:a=>{I(a),w({type:l,isPercent:m,value:p,style:a})}})]})},ma=S.createInterceptorKey("beforeSubmit"),ga=S.createInterceptorKey("submit"),
|
|
179
|
+
`,onChange:a=>{I(a),w({type:l,isPercent:m,value:p,style:a})}})]})},ma=S.createInterceptorKey("beforeSubmit"),ga=S.createInterceptorKey("submit"),ar=t=>t.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getUnitId(),sr=t=>{var e;return(e=t.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()},va=t=>{var j,U,L;const e=S.useDependency(S.LocaleService),r=S.useDependency(S.ICommandService),n=S.useDependency(S.IUniverInstanceService),o=S.useDependency(c.ConditionalFormattingRuleModel),i=S.useDependency(G.SheetsSelectionsService),l=ar(n),v=sr(n),[p,R]=N.useState(!0),m=N.useRef({}),[b,x]=N.useState(void 0),I=N.useRef((U=(j=t.rule)==null?void 0:j.ranges)!=null?U:[]),T=N.useMemo(()=>{var F,z,B;let E=(F=t.rule)==null?void 0:F.ranges;return E!=null&&E.length||(E=(B=(z=i.getCurrentSelections())==null?void 0:z.map(X=>X.range))!=null?B:[]),I.current=E,E!=null&&E.length?E.map(X=>{const te=an.serializeRange(X);return te==="NaN"?"":te}).filter(X=>!!X).join(","):""},[t.rule]),w=[{label:e.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:e.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:e.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:e.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:e.t("sheet.cf.ruleType.formula"),value:"5"},{label:e.t("sheet.cf.ruleType.iconSet"),value:"6"}],[h,a]=N.useState(()=>{var z,B;const E=(z=t.rule)==null?void 0:z.rule.type,F=w[0].value;if(!E)return F;switch(E){case c.CFRuleType.highlightCell:{switch((B=t.rule)==null?void 0:B.rule.subType){case c.CFSubRuleType.number:case c.CFSubRuleType.text:case c.CFSubRuleType.duplicateValues:case c.CFSubRuleType.uniqueValues:case c.CFSubRuleType.timePeriod:return"1";case c.CFSubRuleType.average:case c.CFSubRuleType.rank:return"2";case c.CFSubRuleType.formula:return"5"}break}case c.CFRuleType.dataBar:return"3";case c.CFRuleType.colorScale:return"4";case c.CFRuleType.iconSet:return"6"}return F}),s=N.useRef(),f=N.useMemo(()=>new S.InterceptorManager({beforeSubmit:ma,submit:ga}),[]),y=N.useMemo(()=>{switch(h){case"1":return or;case"2":return ha;case"3":return ra;case"4":return na;case"5":return sa;case"6":return pa;default:return or}},[h]);N.useEffect(()=>{const E=r.onCommandExecuted(F=>{if(F.id===G.RemoveSheetMutation.id){const z=F.params;z.subUnitId===v&&z.unitId===l&&t.onCancel()}F.id===G.SetWorksheetActiveOperation.id&&t.onCancel()});return()=>E.dispose()},[]);const u=E=>{s.current=E},g=E=>{const F=E.split(",").filter(z=>!!z).map(an.deserializeRangeWithSheet).map(z=>z.range);I.current=F},d=()=>{if(b)return;const F=(()=>{const B=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!B)throw new Error("No active sheet found");return I.current.map(Q=>G.setEndForRange(Q,B.getRowCount(),B.getColumnCount())).filter(Q=>!(Number.isNaN(Q.startRow)||Number.isNaN(Q.startColumn)))})();if(f.fetchThroughInterceptors(f.getInterceptPoints().beforeSubmit)(!0,null)){const B=f.fetchThroughInterceptors(f.getInterceptPoints().submit)(null,null);if(B){const X=ar(n),te=sr(n);if(!X||!te)throw new Error("No active sheet found");let Q={};t.rule&&t.rule.cfId?(Q={...t.rule,ranges:F,rule:B},r.executeCommand(At.id,{unitId:X,subUnitId:te,rule:Q}),t.onCancel()):(Q={cfId:o.createCfId(X,te),ranges:F,rule:B,stopIfTrue:!1},r.executeCommand(ht.id,{unitId:X,subUnitId:te,rule:Q}),t.onCancel())}}},C=()=>{t.onCancel()},M=(E,F)=>{E?F.length<1?x(e.t("sheet.cf.errorMessage.rangeError")):x(void 0):x(e.t("sheet.cf.errorMessage.rangeError"))};return me.useSidebarClick(E=>{var z;const F=(z=m.current)==null?void 0:z.handleOutClick;F&&F(E,()=>R(!1))}),_.jsxs("div",{className:k.cfRuleStyleEditor,children:[_.jsx("div",{className:$.title,children:e.t("sheet.cf.panel.range")}),_.jsx("div",{className:`
|
|
180
180
|
${$.mTBase}
|
|
181
181
|
`,children:_.jsx(pt.RangeSelector,{unitId:l,errorText:b,subUnitId:v,initValue:T,onChange:g,onVerify:M,onFocus:()=>R(!0),isFocus:p,actions:m.current})}),_.jsx("div",{className:$.title,children:e.t("sheet.cf.panel.styleType")}),_.jsx("div",{className:$.mTBase,children:_.jsx(re.Select,{className:k.width100,value:h,options:w,onChange:E=>a(E)})}),_.jsx(y,{interceptorManager:f,rule:(L=t.rule)==null?void 0:L.rule,onChange:u}),_.jsxs("div",{className:`
|
|
182
182
|
${$.mTBase}
|
|
183
183
|
${k.btnList}
|
|
184
|
-
`,children:[_.jsx(re.Button,{size:"small",onClick:C,children:e.t("sheet.cf.panel.cancel")}),_.jsx(re.Button,{className:$.mLSm,size:"small",type:"primary",onClick:d,children:e.t("sheet.cf.panel.submit")})]})]})},ya=t=>{const[e,r]=N.useState(t.rule),[n,o]=N.useState(!!t.rule),i=()=>{o(!0)},l=()=>{o(!1),r(void 0)},v=p=>{r(p),o(!0)};return _.jsx("div",{className:$.conditionalFormattingWrap,children:n?_.jsx(va,{onCancel:l,rule:e}):_.jsx(_i,{onClick:v,onCreate:i})})};var Ca=Object.defineProperty,Sa=Object.getOwnPropertyDescriptor,ba=(t,e,r,n)=>{for(var o=n>1?void 0:n?Sa(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Ca(e,r,o),o},et=(t,e)=>(r,n)=>e(r,n,t);const Et="sheet.conditional.formatting.panel";let lt=class extends S.Disposable{constructor(e,r,n,o,i){super();_e(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=r,this._componentManager=n,this._sidebarService=o,this._localeService=i,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(S.UniverInstanceType.UNIVER_SHEET).subscribe(l=>{var v;l||(v=this._sidebarDisposable)==null||v.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(l=>{l.id===Et&&(l.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const r={id:Et,header:{title:this._localeService.t("sheet.cf.title")},children:{label:Et,rule:e,key:S.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(r)}_initPanel(){this._componentManager.register(Et,ya)}};lt=ba([et(0,S.IUniverInstanceService),et(1,S.Inject(S.Injector)),et(2,S.Inject(me.ComponentManager)),et(3,S.Inject(me.ISidebarService)),et(4,S.Inject(S.LocaleService))],lt);var ve=(t=>(t[t.createRule=1]="createRule",t[t.viewRule=2]="viewRule",t[t.highlightCell=3]="highlightCell",t[t.rank=4]="rank",t[t.formula=5]="formula",t[t.colorScale=6]="colorScale",t[t.dataBar=7]="dataBar",t[t.icon=8]="icon",t[t.clearRangeRules=9]="clearRangeRules",t[t.clearWorkSheetRules=10]="clearWorkSheetRules",t))(ve||{});const vt={id:"sheet.operation.open.conditional.formatting.panel",type:S.CommandType.OPERATION,handler:(t,e)=>{var v;const r=t.get(lt),n=t.get(G.SheetsSelectionsService),o=t.get(S.ICommandService),i=((v=n.getCurrentSelections())==null?void 0:v.map(p=>p.range))||[];switch(e.value){case 3:{r.openPanel({...c.createDefaultRule(),ranges:i});break}case 4:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank}};r.openPanel(p);break}case 5:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula,value:"="}};r.openPanel(p);break}case 6:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.colorScale,config:[]}};r.openPanel(p);break}case 7:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.dataBar,isShowValue:!0}};r.openPanel(p);break}case 8:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.iconSet,config:[],isShowValue:!0}};r.openPanel(p);break}case 2:{r.openPanel();break}case 1:{r.openPanel({...c.createDefaultRule(),ranges:i});break}case 9:{o.executeCommand(Vt.id,{ranges:i});break}case 10:{o.executeCommand(mt.id);break}}return!0}};var Ra=Object.defineProperty,Ta=Object.getOwnPropertyDescriptor,Ia=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ta(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Ra(e,r,o),o},tt=(t,e)=>(r,n)=>e(r,n,t);let ut=class extends S.Disposable{constructor(e,r,n,o,i){super();_e(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=r,this._injector=n,this._conditionalFormattingViewModel=o,this._univerInstanceService=i,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,r,n)=>this._collectConditionalRule(e,r,n),onPasteCells:(e,r,n,o)=>{const{copyType:i=ce.COPY_TYPE.COPY,pasteType:l}=o,{range:v}=e||{},{range:p}=r;return this._generateConditionalFormattingMutations(p,{copyType:i,pasteType:l,copyRange:v})}}))}_collectConditionalRule(e,r,n){const o=new S.ObjectMatrix,i={};this._copyInfo={matrix:o,info:{unitId:e,subUnitId:r,cfMap:i}};const l=this._injector.invoke(m=>ce.rangeToDiscreteRange(n,m,e,r));if(!l)return;const{rows:v,cols:p}=l,R=new Set;v.forEach((m,b)=>{p.forEach((x,I)=>{const T=this._conditionalFormattingViewModel.getCellCfs(e,r,m,x);T&&(T.forEach(w=>R.add(w.cfId)),o.setValue(b,I,T.map(w=>w.cfId)))})}),R.forEach(m=>{const b=this._conditionalFormattingRuleModel.getRule(e,r,m);b&&(i[m]=b.rule)})}_generateConditionalFormattingMutations(e,r){const n=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET),o=n.getActiveSheet(),i=n.getUnitId();if(!o)return{redos:[],undos:[]};const l=o.getSheetId();if(r.copyType===ce.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!r.copyRange)return{redos:[],undos:[]};if(![ce.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,ce.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,ce.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(r.pasteType))return{redos:[],undos:[]};const{ranges:[v,p],mapFunc:R}=ce.virtualizeDiscreteRanges([r.copyRange,e]),m=ce.getRepeatRange(v,p,!0),b={};S.Range.foreach(p,(y,u)=>{const{row:g,col:d}=R(y,u),C=this._conditionalFormattingViewModel.getCellCfs(i,l,g,d);C&&C.forEach(M=>{if(!b[M.cfId]){const j=new S.ObjectMatrix;b[M.cfId]=j;const U=this._conditionalFormattingRuleModel.getRule(i,l,M.cfId);U==null||U.ranges.forEach(L=>{S.Range.foreach(L,(E,F)=>{j.setValue(E,F,1)})})}b[M.cfId].realDeleteValue(g,d)})});const{matrix:x,info:I}=this._copyInfo,T=[];let w=this._conditionalFormattingRuleModel.createCfId(i,l);const h={},a=y=>{if(h[y])return h[y];const u=I==null?void 0:I.cfMap[y],g=[...this._conditionalFormattingRuleModel.getSubunitRules(i,l)||[],...T].find(d=>S.Tools.diffValue(d.rule,u));if(g)return h[y]=g,g;{const d={rule:u,cfId:w,ranges:[],stopIfTrue:!1};return h[y]=d,T.push(d),w=`${Number(w)+1}`,d}};m.forEach(y=>{x&&x.forValue((u,g,d)=>{const C=S.Rectangle.getPositionRange({startRow:u,endRow:u,startColumn:g,endColumn:g},y.startRange),{row:M,col:j}=R(C.startRow,C.startColumn);d.forEach(U=>{if(!b[U]){const L=a(U),E=new S.ObjectMatrix;b[U]=E,L.ranges.forEach(F=>{S.Range.foreach(F,(z,B)=>{E.setValue(z,B,1)})})}b[U].setValue(M,j,1)})})});const s=[],f=[];for(const y in b){const u=b[y],g=G.findAllRectangle(G.createTopMatrixFromMatrix(u));if(!g.length){const d={unitId:i,subUnitId:l,cfId:y};s.push({id:c.DeleteConditionalRuleMutation.id,params:d}),f.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}if(T.some(d=>d.cfId===y)){const d=a(y),C={unitId:i,subUnitId:l,rule:{...d,ranges:g}};s.push({id:c.AddConditionalRuleMutation.id,params:C}),f.push(c.AddConditionalRuleMutationUndoFactory(this._injector,C))}else{const d=this._conditionalFormattingRuleModel.getRule(i,l,y);if(!d)continue;const C={unitId:i,subUnitId:l,rule:{...d,ranges:g}};s.push({id:c.SetConditionalRuleMutation.id,params:C}),f.push(...c.setConditionalRuleMutationUndoFactory(this._injector,C))}}return{redos:s,undos:f}}};ut=Ia([tt(0,S.Inject(ce.ISheetClipboardService)),tt(1,S.Inject(c.ConditionalFormattingRuleModel)),tt(2,S.Inject(S.Injector)),tt(3,S.Inject(c.ConditionalFormattingViewModel)),tt(4,S.Inject(S.IUniverInstanceService))],ut);var wa=Object.defineProperty,_a=Object.getOwnPropertyDescriptor,xa=(t,e,r,n)=>{for(var o=n>1?void 0:n?_a(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&wa(e,r,o),o},en=(t,e)=>(r,n)=>e(r,n,t);let ct=class extends S.Disposable{constructor(t,e,r){super(),this._localeService=t,this._commandService=e,this._sheetPermissionInterceptorBaseController=r,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{t.id===ht.id&&(this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[G.WorkbookEditablePermission],rangeTypes:[G.RangeProtectionPermissionEditPoint],worksheetTypes:[G.WorksheetEditPermission,G.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr")))}))}};ct=xa([en(0,S.Inject(S.LocaleService)),en(1,S.ICommandService),en(2,S.Inject(ce.SheetPermissionInterceptorBaseController))],ct);var Ea=Object.defineProperty,Oa=Object.getOwnPropertyDescriptor,Pa=(t,e,r,n)=>{for(var o=n>1?void 0:n?Oa(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Ea(e,r,o),o},Ot=(t,e)=>(r,n)=>e(r,n,t);let dt=class extends S.Disposable{constructor(t,e,r,n){super(),this._conditionalFormattingRuleModel=t,this._univerInstanceService=e,this._injector=r,this._refRangeService=n,this._initRefRange()}_initRefRange(){const t=new Map,e=(n,o,i)=>`${n}_${o}_${i}`,r=(n,o,i)=>{const l=p=>{const R=[...i.ranges],m=R.map(x=>G.handleDefaultRangeChangeWithEffectRefCommands(x,p)).filter(x=>!!x);if(c.isRangesEqual(m,R))return{redos:[],undos:[]};if(m.length){const x={unitId:n,subUnitId:o,rule:{...i,ranges:m}},I=[{id:c.SetConditionalRuleMutation.id,params:x}],T=c.setConditionalRuleMutationUndoFactory(this._injector,x);return{redos:I,undos:T}}else{const x={unitId:n,subUnitId:o,cfId:i.cfId},I=[{id:c.DeleteConditionalRuleMutation.id,params:x}],T=c.DeleteConditionalRuleMutationUndoFactory(this._injector,x);return{redos:I,undos:T}}},v=[];i.ranges.forEach(p=>{const R=this._refRangeService.registerRefRange(p,l);v.push(()=>R.dispose())}),t.set(e(n,o,i.cfId),()=>v.forEach(p=>p()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:o,subUnitId:i,rule:l}=n,v=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET),p=v.getActiveSheet();if(!(n.unitId!==v.getUnitId()||n.subUnitId!==(p==null?void 0:p.getSheetId())))switch(n.type){case"add":{r(n.unitId,n.subUnitId,n.rule);break}case"delete":{const R=t.get(e(o,i,l.cfId));R&&R();break}case"set":{const R=t.get(e(o,i,l.cfId));R&&R(),r(n.unitId,n.subUnitId,n.rule)}}})),this.disposeWithMe(S.toDisposable(()=>{t.forEach(n=>{n()}),t.clear()}))}};dt=Pa([Ot(0,S.Inject(c.ConditionalFormattingRuleModel)),Ot(1,S.Inject(S.IUniverInstanceService)),Ot(2,S.Inject(S.Injector)),Ot(3,S.Inject(G.RefRangeService))],dt);var Ma=Object.defineProperty,Fa=Object.getOwnPropertyDescriptor,Da=(t,e,r,n)=>{for(var o=n>1?void 0:n?Fa(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Ma(e,r,o),o},Ue=(t,e)=>(r,n)=>e(r,n,t);let ft=class extends S.Disposable{constructor(e,r,n,o,i,l){super();_e(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=r,this._univerInstanceService=n,this._renderManagerService=o,this._conditionalFormattingViewModel=i,this._conditionalFormattingRuleModel=l,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var r,n,o;const e=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=this._renderManagerService.getRenderById(e))==null||r.with(ce.SheetSkeletonManagerService).reCalculate(),(o=(n=this._renderManagerService.getRenderById(e))==null?void 0:n.mainComponent)==null||o.makeDirty()}_initSkeleton(){this.disposeWithMe(be.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(at.bufferTime(16),at.filter(e=>!!e.length),at.filter(e=>{const r=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const n=r.getActiveSheet();return n?e.filter(o=>o.unitId===r.getUnitId()&&o.subUnitId===n.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(G.INTERCEPTOR_POINT.CELL_CONTENT,{effect:S.InterceptorEffectEnum.Style,handler:(e,r,n)=>{const o=this._conditionalFormattingService.composeStyle(r.unitId,r.subUnitId,r.row,r.col);if(!o)return n(e);const i=r.workbook.getStyles(),v={...(typeof(e==null?void 0:e.s)=="string"?i.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},p={...e,s:v};return o.style&&Object.assign(v,o.style),p.fontRenderExtension||(p.fontRenderExtension={},o.isShowValue!==void 0&&(p.fontRenderExtension.isSkip=!o.isShowValue)),o.dataBar&&(p.dataBar=o.dataBar),o.iconSet&&(p.iconSet=o.iconSet,p.fontRenderExtension.leftOffset=c.DEFAULT_PADDING+c.DEFAULT_WIDTH),n(p)},priority:10}))}};ft=Da([Ue(0,S.Inject(G.SheetInterceptorService)),Ue(1,S.Inject(c.ConditionalFormattingService)),Ue(2,S.Inject(S.IUniverInstanceService)),Ue(3,S.Inject(fr.IRenderManagerService)),Ue(4,S.Inject(c.ConditionalFormattingViewModel)),Ue(5,S.Inject(c.ConditionalFormattingRuleModel))],ft);const Fr="sheets-conditional-formatting-ui.config",Dr={};var Nr=Object.defineProperty,Na=Object.getOwnPropertyDescriptor,ja=(t,e,r)=>e in t?Nr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,La=(t,e,r,n)=>{for(var o=n>1?void 0:n?Na(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Nr(e,r,o),o},tn=(t,e)=>(r,n)=>e(r,n,t),jr=(t,e,r)=>ja(t,typeof e!="symbol"?e+"":e,r);exports.UniverSheetsConditionalFormattingMobileUIPlugin=class extends S.Plugin{constructor(e=Dr,r,n,o){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=o;const{menu:i,...l}=this._config;i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(Fr,l),this._initCommand(),this._injector.add([ft]),this._injector.add([dt]),this._injector.add([ut]),this._injector.add([ct]),this._injector.add([ze])}_initCommand(){[sn,ln,un,cn,dn,fn,pn,hn,mn,vt,st,zt,$t,ht,Vt,mt].forEach(e=>{this._commandService.registerCommand(e)})}};jr(exports.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`);jr(exports.UniverSheetsConditionalFormattingMobileUIPlugin,"type",S.UniverInstanceType.UNIVER_SHEET);exports.UniverSheetsConditionalFormattingMobileUIPlugin=La([S.DependentOn(c.UniverSheetsConditionalFormattingPlugin),tn(1,S.Inject(S.Injector)),tn(2,S.Inject(S.ICommandService)),tn(3,S.IConfigService)],exports.UniverSheetsConditionalFormattingMobileUIPlugin);var Ua=Object.defineProperty,Va=Object.getOwnPropertyDescriptor,$a=(t,e,r,n)=>{for(var o=n>1?void 0:n?Va(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Ua(e,r,o),o},nt=(t,e)=>(r,n)=>e(r,n,t);let Dt=class extends S.Disposable{constructor(t,e,r,n,o){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=r,this._conditionalFormattingRuleModel=n,this._conditionalFormattingViewModel=o,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(o,i,l,v,p)=>{var I;const R=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getUnitId(),m=(I=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:I.getSheetId();if(!R||!m)return;const b={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},x={startRow:i.row,startColumn:i.col,endColumn:i.col,endRow:i.row};S.Range.foreach(l,(T,w)=>{const h=S.Rectangle.getPositionRange({startRow:T,startColumn:w,endColumn:w,endRow:T},b),a=S.Rectangle.getPositionRange({startRow:T,startColumn:w,endColumn:w,endRow:T},x),{row:s,col:f}=p(h.startRow,h.startColumn),y=this._conditionalFormattingViewModel.getCellCfs(R,m,s,f),{row:u,col:g}=p(a.startRow,a.startColumn),d=this._conditionalFormattingViewModel.getCellCfs(R,m,u,g);d&&d.forEach(C=>{let M=v.get(C.cfId);if(!v.get(C.cfId)){const j=this._conditionalFormattingRuleModel.getRule(R,m,C.cfId);if(!j)return;M=new S.ObjectMatrix,j.ranges.forEach(U=>{S.Range.foreach(U,(L,E)=>{M.setValue(L,E,1)})}),v.set(C.cfId,M)}M.realDeleteValue(u,g)}),y&&y.forEach(C=>{let M=v.get(C.cfId);if(!v.get(C.cfId)){const j=this._conditionalFormattingRuleModel.getRule(R,m,C.cfId);if(!j)return;M=new S.ObjectMatrix,j.ranges.forEach(U=>{S.Range.foreach(U,(L,E)=>{M.setValue(L,E,1)})}),v.set(C.cfId,M)}M.setValue(u,g,1)})})},r=(o,i)=>{var a,s,f;const l=(a=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET))==null?void 0:a.getUnitId(),v=(f=(s=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:f.getSheetId(),p=new Map,R=[],m=[];if(!l||!v)return t();const b=ce.virtualizeDiscreteRanges([o,i]),[x,I]=b.ranges,{mapFunc:T}=b,w={row:x.startRow,col:x.startColumn};return ce.getAutoFillRepeatRange(x,I).forEach(y=>{e(w,y.repeatStartCell,y.relativeRange,p,T)}),p.forEach((y,u)=>{const g=this._conditionalFormattingRuleModel.getRule(l,v,u);if(!g)return;const d=G.findAllRectangle(G.createTopMatrixFromMatrix(y));if(d.length){const C={unitId:l,subUnitId:v,rule:{...g,ranges:d}};R.push({id:c.SetConditionalRuleMutation.id,params:C}),m.push(...c.setConditionalRuleMutationUndoFactory(this._injector,C))}else{const C={unitId:l,subUnitId:v,cfId:g.cfId};R.push({id:c.DeleteConditionalRuleMutation.id,params:C}),m.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,C))}}),{undos:m,redos:R}},n={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(o,i,l)=>{if(l===ce.APPLY_TYPE.COPY||l===ce.APPLY_TYPE.ONLY_FORMAT||l===ce.APPLY_TYPE.SERIES){const{source:v,target:p}=o;return r(v,p)}return t()}};this.disposeWithMe(this._autoFillService.addHook(n))}};Dt=$a([nt(0,S.Inject(S.Injector)),nt(1,S.Inject(S.IUniverInstanceService)),nt(2,S.Inject(ce.IAutoFillService)),nt(3,S.Inject(c.ConditionalFormattingRuleModel)),nt(4,S.Inject(c.ConditionalFormattingViewModel))],Dt);var za=Object.defineProperty,Aa=Object.getOwnPropertyDescriptor,qa=(t,e,r,n)=>{for(var o=n>1?void 0:n?Aa(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&za(e,r,o),o},rt=(t,e)=>(r,n)=>e(r,n,t);exports.ConditionalFormattingClearController=class extends S.Disposable{constructor(e,r,n,o,i){super(),this._injector=e,this._univerInstanceService=r,this._sheetInterceptorService=n,this._selectionManagerService=o,this._conditionalFormattingRuleModel=i,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var i;const r=[],n=[],o={redos:r,undos:n};if([G.ClearSelectionFormatCommand.id,G.ClearSelectionAllCommand.id].includes(e.id)){const l=(i=this._selectionManagerService.getCurrentSelections())==null?void 0:i.map(T=>T.range);if(!l)return o;const v=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET),p=v.getActiveSheet();if(!p)return o;const R=v.getUnitId(),m=p.getSheetId(),b=this._conditionalFormattingRuleModel.getSubunitRules(R,m);if(!b||!b.length)return o;const{redos:x,undos:I}=sr(this._injector,b,l,R,m);r.push(...x),n.push(...I)}return o}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:r,ranges:n})=>{const o=[],i=[],l={redos:o,undos:i};if(!n||!n.length)return l;const v=this._conditionalFormattingRuleModel.getSubunitRules(e,r);if(!v||!v.length)return l;const{redos:p,undos:R}=sr(this._injector,v,n,e,r);return o.push(...p),i.push(...R),l}}))}};exports.ConditionalFormattingClearController=qa([rt(0,S.Inject(S.Injector)),rt(1,S.Inject(S.IUniverInstanceService)),rt(2,S.Inject(G.SheetInterceptorService)),rt(3,S.Inject(G.SheetsSelectionsService)),rt(4,S.Inject(c.ConditionalFormattingRuleModel))],exports.ConditionalFormattingClearController);function sr(t,e,r,n,o){const i=[],l=[];return e.filter(v=>r.some(p=>v.ranges.some(R=>S.Rectangle.getIntersects(R,p)))).forEach(v=>{const R=new G.RangeMergeUtil().add(...v.ranges).subtract(...r).merge();if(R.length){const m={id:c.SetConditionalRuleMutation.id,params:{unitId:n,subUnitId:o,rule:{...v,ranges:R}}},b=c.setConditionalRuleMutationUndoFactory(t,m.params);i.push(m),l.push(...b)}else{const m={id:c.DeleteConditionalRuleMutation.id,params:{unitId:n,subUnitId:o,cfId:v.cfId}},b=c.DeleteConditionalRuleMutationUndoFactory(t,m.params);i.push(m),l.push(...b)}}),{redos:i,undos:l}}var Wa=Object.defineProperty,Ha=Object.getOwnPropertyDescriptor,ka=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ha(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Wa(e,r,o),o},lr=(t,e)=>(r,n)=>e(r,n,t);let Nt=class extends S.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(S.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(G.AFTER_CELL_EDIT,{handler:(t,e,r)=>{var l,v,p;t||r(t);const n=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col),o=(l=n==null?void 0:n.style)!=null?l:{},i=Object.keys(o);if(t!=null&&t.p)return(p=(v=t.p.body)==null?void 0:v.textRuns)==null||p.forEach(R=>{R.ts&&i.forEach(m=>{var b;(b=R.ts)==null||delete b[m]})}),r(t);{const R={...(typeof(t==null?void 0:t.s)=="string"?e.workbook.getStyles().get(t.s):t==null?void 0:t.s)||{}};i.forEach(b=>{delete R[b]});const m={...t,s:{...R}};return r(m)}}})))}};Nt=ka([lr(0,S.Inject(G.SheetInterceptorService)),lr(1,S.Inject(c.ConditionalFormattingService))],Nt);const ur=[G.SetWorksheetActiveOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],ot=[{label:"sheet.cf.ruleType.highlightCell",value:ve.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:ve.rank},{label:"sheet.cf.ruleType.formula",value:ve.formula},{label:"sheet.cf.ruleType.colorScale",value:ve.colorScale},{label:"sheet.cf.ruleType.dataBar",value:ve.dataBar},{label:"sheet.cf.ruleType.iconSet",value:ve.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:ve.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:ve.createRule},{label:"sheet.cf.menu.clearRangeRules",value:ve.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:ve.clearWorkSheetRules}],Ba=t=>{const e=t.get(G.SheetsSelectionsService),r=t.get(S.ICommandService),n=t.get(S.IUniverInstanceService),o=t.get(c.ConditionalFormattingRuleModel),i=new be.Observable(p=>be.merge(e.selectionMoveEnd$,new be.Observable(R=>{const m=r.onCommandExecuted(b=>{var w;const{id:x,params:I}=b,T=(w=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET))==null?void 0:w.getUnitId();ur.includes(x)&&I.unitId===T&&R.next(null)});return()=>m.dispose()})).pipe(at.debounceTime(16)).subscribe(()=>{var w;const R=((w=e.getCurrentSelections())==null?void 0:w.map(h=>h.range))||[],m=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET);if(!m)return;const b=m.getActiveSheet();if(!b)return;const T=(o.getSubunitRules(m.getUnitId(),b.getSheetId())||[]).filter(h=>h.ranges.some(a=>R.some(s=>S.Rectangle.intersects(s,a)))).map(h=>h.ranges).every(h=>G.checkRangesEditablePermission(t,m.getUnitId(),b.getSheetId(),h));p.next(T)})),l=new be.Observable(p=>new be.Observable(R=>{const m=r.onCommandExecuted(b=>{var w;const{id:x,params:I}=b,T=(w=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET))==null?void 0:w.getUnitId();ur.includes(x)&&I.unitId===T&&R.next(null)});return()=>m.dispose()}).pipe(at.debounceTime(16)).subscribe(()=>{const R=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET);if(!R)return;const m=R.getActiveSheet();if(!m)return;const b=o.getSubunitRules(R.getUnitId(),m.getSheetId())||[];if(!b.length)return p.next(!1),!1;const x=b.map(I=>I.ranges).every(I=>G.checkRangesEditablePermission(t,R.getUnitId(),m.getSheetId(),I));p.next(x)})),v=new be.Observable(p=>{i.subscribe(R=>{const m=ot.find(b=>b.value===ve.clearRangeRules);m&&(m.disabled=!R,p.next(ot))}),l.subscribe(R=>{const m=ot.find(b=>b.value===ve.clearWorkSheetRules);m&&(m.disabled=!R,p.next(ot))}),p.next(ot)});return{id:vt.id,type:me.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:v,hidden$:me.getMenuHiddenObservable(t,S.UniverInstanceType.UNIVER_SHEET),disabled$:ce.getCurrentRangeDisable$(t,{workbookTypes:[G.WorkbookEditablePermission],worksheetTypes:[G.WorksheetSetCellStylePermission,G.WorksheetEditPermission],rangeTypes:[G.RangeProtectionPermissionEditPoint]})}},Ga={[me.RibbonStartGroup.FORMULAS_INSERT]:{[vt.id]:{order:0,menuItemFactory:Ba}}};var Xa=Object.defineProperty,Ya=Object.getOwnPropertyDescriptor,Ka=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ya(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Xa(e,r,o),o},cr=(t,e)=>(r,n)=>e(r,n,t);let jt=class extends S.Disposable{constructor(e,r){super();_e(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=r,this._menuManagerService.mergeMenu(Ga)}};jt=Ka([cr(0,S.Inject(S.Injector)),cr(1,me.IMenuManagerService)],jt);var Za=Object.defineProperty,Ja=Object.getOwnPropertyDescriptor,Qa=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ja(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Za(e,r,o),o},Ve=(t,e)=>(r,n)=>e(r,n,t);const es=(t,e)=>{const r=m=>m.endRow-m.startRow+1,n=m=>m.endColumn-m.startColumn+1,o=r(e)%r(t),i=n(e)%n(t),l=Math.floor(r(e)/r(t)),v=Math.floor(n(e)/n(t)),p=[],R={startRow:0,endRow:r(t)-1,startColumn:0,endColumn:n(t)-1};if(r(e)===1&&n(e)===1){const m={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return p.push({repeatRelativeRange:R,startRange:m}),p}for(let m=0;m<l+(o?.1:0);m++)for(let b=0;b<v+(i?.1:0);b++){const x=r(t)*m,I=n(t)*b,T={startRow:x+e.startRow,endRow:x+e.startRow,startColumn:I+e.startColumn,endColumn:I+e.startColumn};let w=R;m===l&&o&&(w={...w},w.endRow=w.endRow-(r(t)-o)),b===v&&i&&(w={...w},w.endColumn=w.endColumn-(n(t)-i)),p.push({repeatRelativeRange:w,startRange:T})}return p};let Lt=class extends S.Disposable{constructor(e,r,n,o,i,l){super();_e(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=r,this._formatPainterService=n,this._sheetsSelectionsService=o,this._conditionalFormattingRuleModel=i,this._conditionalFormattingViewModel=l,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),r=(i,l,v,p,R)=>{const{unitId:m,subUnitId:b}=this._painterConfig,{targetUnitId:x,targetSubUnitId:I}=R,T={startRow:i.row,startColumn:i.col,endColumn:i.col,endRow:i.row},w={startRow:l.row,startColumn:l.col,endColumn:l.col,endRow:l.row};S.Range.foreach(v,(h,a)=>{const s=S.Rectangle.getPositionRange({startRow:h,startColumn:a,endColumn:a,endRow:h},T),f=S.Rectangle.getPositionRange({startRow:h,startColumn:a,endColumn:a,endRow:h},w),y=this._conditionalFormattingViewModel.getCellCfs(m,b,s.startRow,s.startColumn),u=this._conditionalFormattingViewModel.getCellCfs(x,I,f.startRow,f.startColumn);u&&u.forEach(g=>{let d=p.get(g.cfId);if(!p.get(g.cfId)){const C=this._conditionalFormattingRuleModel.getRule(x,I,g.cfId);if(!C)return;d=new S.ObjectMatrix,C.ranges.forEach(M=>{S.Range.foreach(M,(j,U)=>{d.setValue(j,U,1)})}),p.set(g.cfId,d)}d.realDeleteValue(f.startRow,f.startColumn)}),y&&y.forEach(g=>{const d=p.get(g.cfId);d&&d.setValue(f.startRow,f.startColumn,1)})})},n=(i,l,v)=>{var s;const{range:p,unitId:R,subUnitId:m}=this._painterConfig,b=i!==R||m!==l,x=new Map,I=[],T=[];if(!i||!l||!R||!m)return e();const w=(s=this._conditionalFormattingRuleModel.getSubunitRules(R,m))!=null?s:[];w==null||w.forEach(f=>{const{ranges:y,cfId:u}=f;if(y.some(g=>S.Rectangle.intersects(p,g))){const g=new S.ObjectMatrix;b||y.forEach(d=>{S.Range.foreach(d,(C,M)=>{g.setValue(C,M,1)})}),x.set(u,g)}});const h={row:p.startRow,col:p.startColumn};return es(p,v).forEach(f=>{r(h,{row:f.startRange.startRow,col:f.startRange.startColumn},f.repeatRelativeRange,x,{targetUnitId:i,targetSubUnitId:l})}),x.forEach((f,y)=>{if(b){const u=this._conditionalFormattingRuleModel.getRule(i,l,y),g=G.findAllRectangle(G.createTopMatrixFromMatrix(f));if(u)if(g.length){const d={unitId:i,subUnitId:l,rule:{...u,ranges:g}};I.push({id:c.SetConditionalRuleMutation.id,params:d}),T.push(...c.setConditionalRuleMutationUndoFactory(this._injector,d))}else{const d={unitId:i,subUnitId:l,cfId:u.cfId};I.push({id:c.DeleteConditionalRuleMutation.id,params:d}),T.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}else if(g.length){const d=this._conditionalFormattingRuleModel.getRule(R,m,y);if(d){const C={unitId:i,subUnitId:l,rule:{...S.Tools.deepClone(d),cfId:this._conditionalFormattingRuleModel.createCfId(i,l),ranges:g}};I.push({id:c.AddConditionalRuleMutation.id,params:C}),T.push(c.AddConditionalRuleMutationUndoFactory(this._injector,C))}}}else{const u=this._conditionalFormattingRuleModel.getRule(R,m,y);if(!u)return;const g=G.findAllRectangle(G.createTopMatrixFromMatrix(f));if(g.length){const d={unitId:R,subUnitId:m,rule:{...u,ranges:g}};I.push({id:c.SetConditionalRuleMutation.id,params:d}),T.push(...c.setConditionalRuleMutationUndoFactory(this._injector,d))}else{const d={unitId:R,subUnitId:m,cfId:u.cfId};I.push({id:c.DeleteConditionalRuleMutation.id,params:d}),T.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}}}),{undos:T,redos:I}},o={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:i=>{var l,v,p;switch(i){case ce.FormatPainterStatus.INFINITE:case ce.FormatPainterStatus.ONCE:{const R=(l=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET))==null?void 0:l.getUnitId(),m=(p=(v=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET))==null?void 0:v.getActiveSheet())==null?void 0:p.getSheetId(),b=this._sheetsSelectionsService.getCurrentLastSelection(),x=b==null?void 0:b.range;R&&m&&x&&(this._painterConfig={unitId:R,subUnitId:m,range:x});break}case ce.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(i,l,v)=>this._painterConfig?n(i,l,v):{redos:[],undos:[]}};this._formatPainterService.addHook(o)}};Lt=Qa([Ve(0,S.Inject(S.Injector)),Ve(1,S.Inject(S.IUniverInstanceService)),Ve(2,S.Inject(ce.IFormatPainterService)),Ve(3,S.Inject(G.SheetsSelectionsService)),Ve(4,S.Inject(c.ConditionalFormattingRuleModel)),Ve(5,S.Inject(c.ConditionalFormattingViewModel))],Lt);var ts=Object.defineProperty,ns=Object.getOwnPropertyDescriptor,rs=(t,e,r,n)=>{for(var o=n>1?void 0:n?ns(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&ts(e,r,o),o},nn=(t,e)=>(r,n)=>e(r,n,t);let Ut=class extends S.Disposable{constructor(t,e,r){super(),this._conditionalFormattingViewModel=t,this._univerInstanceService=e,this._renderManagerService=r,this._init()}_init(){const t=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET),e=r=>{const n=r.getUnitId(),o=this._renderManagerService.getRenderById(n);if(!o)return;const i=o.with(ce.SheetSkeletonManagerService);this.disposeWithMe(i.currentSkeleton$.subscribe(l=>{if(l){const v=l.skeleton.rowColumnSegment,p=v.endColumn-v.startColumn+1,m=(v.endRow-v.startRow+1)*p*9,b=Math.max(c.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,m);this._conditionalFormattingViewModel.setCacheLength(b)}}))};t&&e(t),this._univerInstanceService.getCurrentTypeOfUnit$(S.UniverInstanceType.UNIVER_SHEET).subscribe(r=>{r&&e(r)})}};Ut=rs([nn(0,S.Inject(c.ConditionalFormattingViewModel)),nn(1,S.IUniverInstanceService),nn(2,fr.IRenderManagerService)],Ut);var Lr=Object.defineProperty,os=Object.getOwnPropertyDescriptor,is=(t,e,r)=>e in t?Lr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,as=(t,e,r,n)=>{for(var o=n>1?void 0:n?os(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Lr(e,r,o),o},rn=(t,e)=>(r,n)=>e(r,n,t),Ur=(t,e,r)=>is(t,typeof e!="symbol"?e+"":e,r);exports.UniverSheetsConditionalFormattingUIPlugin=class extends S.Plugin{constructor(e=Dr,r,n,o){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=o;const{menu:i,...l}=this._config;i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(Fr,l),this._initCommand()}onStarting(){S.registerDependencies(this._injector,[[ft],[dt],[ut],[Dt],[ct],[lt],[jt],[ze],[Nt],[exports.ConditionalFormattingClearController],[Lt],[Ut]]),S.touchDependencies(this._injector,[[ft]])}onReady(){S.touchDependencies(this._injector,[[jt],[lt]])}onRendered(){S.touchDependencies(this._injector,[[Dt],[exports.ConditionalFormattingClearController],[ut],[Nt],[ze],[Lt],[ct],[dt],[Ut]])}_initCommand(){[sn,ln,un,cn,dn,fn,pn,hn,mn,vt,st,zt,$t,ht,Vt,mt].forEach(e=>{this._commandService.registerCommand(e)})}};Ur(exports.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`);Ur(exports.UniverSheetsConditionalFormattingUIPlugin,"type",S.UniverInstanceType.UNIVER_SHEET);exports.UniverSheetsConditionalFormattingUIPlugin=as([S.DependentOn(c.UniverSheetsConditionalFormattingPlugin),rn(1,S.Inject(S.Injector)),rn(2,S.Inject(S.ICommandService)),rn(3,S.IConfigService)],exports.UniverSheetsConditionalFormattingUIPlugin);exports.AddAverageCfCommand=sn;exports.AddCfCommand=ht;exports.AddColorScaleConditionalRuleCommand=ln;exports.AddDataBarConditionalRuleCommand=un;exports.AddDuplicateValuesCfCommand=cn;exports.AddNumberCfCommand=dn;exports.AddRankCfCommand=fn;exports.AddTextCfCommand=pn;exports.AddTimePeriodCfCommand=hn;exports.AddUniqueValuesCfCommand=mn;exports.ClearRangeCfCommand=Vt;exports.ClearWorksheetCfCommand=mt;exports.DeleteCfCommand=st;exports.MoveCfCommand=$t;exports.OpenConditionalFormattingOperator=vt;exports.SetCfCommand=zt;
|
|
184
|
+
`,children:[_.jsx(re.Button,{size:"small",onClick:C,children:e.t("sheet.cf.panel.cancel")}),_.jsx(re.Button,{className:$.mLSm,size:"small",type:"primary",onClick:d,children:e.t("sheet.cf.panel.submit")})]})]})},ya=t=>{const[e,r]=N.useState(t.rule),[n,o]=N.useState(!!t.rule),i=()=>{o(!0)},l=()=>{o(!1),r(void 0)},v=p=>{r(p),o(!0)};return _.jsx("div",{className:$.conditionalFormattingWrap,children:n?_.jsx(va,{onCancel:l,rule:e}):_.jsx(_i,{onClick:v,onCreate:i})})};var Ca=Object.defineProperty,Sa=Object.getOwnPropertyDescriptor,ba=(t,e,r,n)=>{for(var o=n>1?void 0:n?Sa(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Ca(e,r,o),o},et=(t,e)=>(r,n)=>e(r,n,t);const Et="sheet.conditional.formatting.panel";let lt=class extends S.Disposable{constructor(e,r,n,o,i){super();_e(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=r,this._componentManager=n,this._sidebarService=o,this._localeService=i,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(S.UniverInstanceType.UNIVER_SHEET).subscribe(l=>{var v;l||(v=this._sidebarDisposable)==null||v.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(l=>{l.id===Et&&(l.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const r={id:Et,header:{title:this._localeService.t("sheet.cf.title")},children:{label:Et,rule:e,key:S.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(r)}_initPanel(){this._componentManager.register(Et,ya)}};lt=ba([et(0,S.IUniverInstanceService),et(1,S.Inject(S.Injector)),et(2,S.Inject(me.ComponentManager)),et(3,S.Inject(me.ISidebarService)),et(4,S.Inject(S.LocaleService))],lt);var ve=(t=>(t[t.createRule=1]="createRule",t[t.viewRule=2]="viewRule",t[t.highlightCell=3]="highlightCell",t[t.rank=4]="rank",t[t.formula=5]="formula",t[t.colorScale=6]="colorScale",t[t.dataBar=7]="dataBar",t[t.icon=8]="icon",t[t.clearRangeRules=9]="clearRangeRules",t[t.clearWorkSheetRules=10]="clearWorkSheetRules",t))(ve||{});const vt={id:"sheet.operation.open.conditional.formatting.panel",type:S.CommandType.OPERATION,handler:(t,e)=>{var v;const r=t.get(lt),n=t.get(G.SheetsSelectionsService),o=t.get(S.ICommandService),i=((v=n.getCurrentSelections())==null?void 0:v.map(p=>p.range))||[];switch(e.value){case 3:{r.openPanel({...c.createDefaultRule(),ranges:i});break}case 4:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank}};r.openPanel(p);break}case 5:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula,value:"="}};r.openPanel(p);break}case 6:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.colorScale,config:[]}};r.openPanel(p);break}case 7:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.dataBar,isShowValue:!0}};r.openPanel(p);break}case 8:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.iconSet,config:[],isShowValue:!0}};r.openPanel(p);break}case 2:{r.openPanel();break}case 1:{r.openPanel({...c.createDefaultRule(),ranges:i});break}case 9:{o.executeCommand($t.id,{ranges:i});break}case 10:{o.executeCommand(mt.id);break}}return!0}};var Ra=Object.defineProperty,Ta=Object.getOwnPropertyDescriptor,Ia=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ta(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Ra(e,r,o),o},tt=(t,e)=>(r,n)=>e(r,n,t);let ut=class extends S.Disposable{constructor(e,r,n,o,i){super();_e(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=r,this._injector=n,this._conditionalFormattingViewModel=o,this._univerInstanceService=i,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,r,n)=>this._collectConditionalRule(e,r,n),onPasteCells:(e,r,n,o)=>{const{copyType:i=ce.COPY_TYPE.COPY,pasteType:l}=o,{range:v}=e||{},{range:p}=r;return this._generateConditionalFormattingMutations(p,{copyType:i,pasteType:l,copyRange:v})}}))}_collectConditionalRule(e,r,n){const o=new S.ObjectMatrix,i={};this._copyInfo={matrix:o,info:{unitId:e,subUnitId:r,cfMap:i}};const l=this._injector.invoke(m=>ce.rangeToDiscreteRange(n,m,e,r));if(!l)return;const{rows:v,cols:p}=l,R=new Set;v.forEach((m,b)=>{p.forEach((x,I)=>{const T=this._conditionalFormattingViewModel.getCellCfs(e,r,m,x);T&&(T.forEach(w=>R.add(w.cfId)),o.setValue(b,I,T.map(w=>w.cfId)))})}),R.forEach(m=>{const b=this._conditionalFormattingRuleModel.getRule(e,r,m);b&&(i[m]=b.rule)})}_generateConditionalFormattingMutations(e,r){const n=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET),o=n.getActiveSheet(),i=n.getUnitId();if(!o)return{redos:[],undos:[]};const l=o.getSheetId();if(r.copyType===ce.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!r.copyRange)return{redos:[],undos:[]};if(![ce.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,ce.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,ce.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(r.pasteType))return{redos:[],undos:[]};const{ranges:[v,p],mapFunc:R}=ce.virtualizeDiscreteRanges([r.copyRange,e]),m=ce.getRepeatRange(v,p,!0),b={};S.Range.foreach(p,(y,u)=>{const{row:g,col:d}=R(y,u),C=this._conditionalFormattingViewModel.getCellCfs(i,l,g,d);C&&C.forEach(M=>{if(!b[M.cfId]){const j=new S.ObjectMatrix;b[M.cfId]=j;const U=this._conditionalFormattingRuleModel.getRule(i,l,M.cfId);U==null||U.ranges.forEach(L=>{S.Range.foreach(L,(E,F)=>{j.setValue(E,F,1)})})}b[M.cfId].realDeleteValue(g,d)})});const{matrix:x,info:I}=this._copyInfo,T=[];let w=this._conditionalFormattingRuleModel.createCfId(i,l);const h={},a=y=>{if(h[y])return h[y];const u=I==null?void 0:I.cfMap[y],g=[...this._conditionalFormattingRuleModel.getSubunitRules(i,l)||[],...T].find(d=>S.Tools.diffValue(d.rule,u));if(g)return h[y]=g,g;{const d={rule:u,cfId:w,ranges:[],stopIfTrue:!1};return h[y]=d,T.push(d),w=`${Number(w)+1}`,d}};m.forEach(y=>{x&&x.forValue((u,g,d)=>{const C=S.Rectangle.getPositionRange({startRow:u,endRow:u,startColumn:g,endColumn:g},y.startRange),{row:M,col:j}=R(C.startRow,C.startColumn);d.forEach(U=>{if(!b[U]){const L=a(U),E=new S.ObjectMatrix;b[U]=E,L.ranges.forEach(F=>{S.Range.foreach(F,(z,B)=>{E.setValue(z,B,1)})})}b[U].setValue(M,j,1)})})});const s=[],f=[];for(const y in b){const u=b[y],g=G.findAllRectangle(G.createTopMatrixFromMatrix(u));if(!g.length){const d={unitId:i,subUnitId:l,cfId:y};s.push({id:c.DeleteConditionalRuleMutation.id,params:d}),f.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}if(T.some(d=>d.cfId===y)){const d=a(y),C={unitId:i,subUnitId:l,rule:{...d,ranges:g}};s.push({id:c.AddConditionalRuleMutation.id,params:C}),f.push(c.AddConditionalRuleMutationUndoFactory(this._injector,C))}else{const d=this._conditionalFormattingRuleModel.getRule(i,l,y);if(!d)continue;const C={unitId:i,subUnitId:l,rule:{...d,ranges:g}};s.push({id:c.SetConditionalRuleMutation.id,params:C}),f.push(...c.setConditionalRuleMutationUndoFactory(this._injector,C))}}return{redos:s,undos:f}}};ut=Ia([tt(0,S.Inject(ce.ISheetClipboardService)),tt(1,S.Inject(c.ConditionalFormattingRuleModel)),tt(2,S.Inject(S.Injector)),tt(3,S.Inject(c.ConditionalFormattingViewModel)),tt(4,S.Inject(S.IUniverInstanceService))],ut);var wa=Object.defineProperty,_a=Object.getOwnPropertyDescriptor,xa=(t,e,r,n)=>{for(var o=n>1?void 0:n?_a(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&wa(e,r,o),o},tn=(t,e)=>(r,n)=>e(r,n,t);let ct=class extends S.Disposable{constructor(t,e,r){super(),this._localeService=t,this._commandService=e,this._sheetPermissionInterceptorBaseController=r,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{t.id===ht.id&&(this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[G.WorkbookEditablePermission],rangeTypes:[G.RangeProtectionPermissionEditPoint],worksheetTypes:[G.WorksheetEditPermission,G.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr")))}))}};ct=xa([tn(0,S.Inject(S.LocaleService)),tn(1,S.ICommandService),tn(2,S.Inject(ce.SheetPermissionInterceptorBaseController))],ct);var Ea=Object.defineProperty,Oa=Object.getOwnPropertyDescriptor,Pa=(t,e,r,n)=>{for(var o=n>1?void 0:n?Oa(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Ea(e,r,o),o},Ot=(t,e)=>(r,n)=>e(r,n,t);let dt=class extends S.Disposable{constructor(t,e,r,n){super(),this._conditionalFormattingRuleModel=t,this._univerInstanceService=e,this._injector=r,this._refRangeService=n,this._initRefRange()}_initRefRange(){const t=new Map,e=(n,o,i)=>`${n}_${o}_${i}`,r=(n,o,i)=>{const l=p=>{const R=[...i.ranges],m=R.map(x=>G.handleDefaultRangeChangeWithEffectRefCommands(x,p)).filter(x=>!!x);if(c.isRangesEqual(m,R))return{redos:[],undos:[]};if(m.length){const x={unitId:n,subUnitId:o,rule:{...i,ranges:m}},I=[{id:c.SetConditionalRuleMutation.id,params:x}],T=c.setConditionalRuleMutationUndoFactory(this._injector,x);return{redos:I,undos:T}}else{const x={unitId:n,subUnitId:o,cfId:i.cfId},I=[{id:c.DeleteConditionalRuleMutation.id,params:x}],T=c.DeleteConditionalRuleMutationUndoFactory(this._injector,x);return{redos:I,undos:T}}},v=[];i.ranges.forEach(p=>{const R=this._refRangeService.registerRefRange(p,l);v.push(()=>R.dispose())}),t.set(e(n,o,i.cfId),()=>v.forEach(p=>p()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:o,subUnitId:i,rule:l}=n,v=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET),p=v.getActiveSheet();if(!(n.unitId!==v.getUnitId()||n.subUnitId!==(p==null?void 0:p.getSheetId())))switch(n.type){case"add":{r(n.unitId,n.subUnitId,n.rule);break}case"delete":{const R=t.get(e(o,i,l.cfId));R&&R();break}case"set":{const R=t.get(e(o,i,l.cfId));R&&R(),r(n.unitId,n.subUnitId,n.rule)}}})),this.disposeWithMe(S.toDisposable(()=>{t.forEach(n=>{n()}),t.clear()}))}};dt=Pa([Ot(0,S.Inject(c.ConditionalFormattingRuleModel)),Ot(1,S.Inject(S.IUniverInstanceService)),Ot(2,S.Inject(S.Injector)),Ot(3,S.Inject(G.RefRangeService))],dt);var Ma=Object.defineProperty,Fa=Object.getOwnPropertyDescriptor,Da=(t,e,r,n)=>{for(var o=n>1?void 0:n?Fa(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Ma(e,r,o),o},Ue=(t,e)=>(r,n)=>e(r,n,t);let ft=class extends S.Disposable{constructor(e,r,n,o,i,l){super();_e(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=r,this._univerInstanceService=n,this._renderManagerService=o,this._conditionalFormattingViewModel=i,this._conditionalFormattingRuleModel=l,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var r,n,o;const e=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=this._renderManagerService.getRenderById(e))==null||r.with(ce.SheetSkeletonManagerService).reCalculate(),(o=(n=this._renderManagerService.getRenderById(e))==null?void 0:n.mainComponent)==null||o.makeDirty()}_initSkeleton(){this.disposeWithMe(be.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(at.bufferTime(16),at.filter(e=>!!e.length),at.filter(e=>{const r=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const n=r.getActiveSheet();return n?e.filter(o=>o.unitId===r.getUnitId()&&o.subUnitId===n.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(G.INTERCEPTOR_POINT.CELL_CONTENT,{effect:S.InterceptorEffectEnum.Style,handler:(e,r,n)=>{const o=this._conditionalFormattingService.composeStyle(r.unitId,r.subUnitId,r.row,r.col);if(!o)return n(e);const i=r.workbook.getStyles(),v={...(typeof(e==null?void 0:e.s)=="string"?i.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},p={...e,s:v};return o.style&&Object.assign(v,o.style),p.fontRenderExtension||(p.fontRenderExtension={},o.isShowValue!==void 0&&(p.fontRenderExtension.isSkip=!o.isShowValue)),o.dataBar&&(p.dataBar=o.dataBar),o.iconSet&&(p.iconSet=o.iconSet,p.fontRenderExtension.leftOffset=c.DEFAULT_PADDING+c.DEFAULT_WIDTH),n(p)},priority:10}))}};ft=Da([Ue(0,S.Inject(G.SheetInterceptorService)),Ue(1,S.Inject(c.ConditionalFormattingService)),Ue(2,S.Inject(S.IUniverInstanceService)),Ue(3,S.Inject(pr.IRenderManagerService)),Ue(4,S.Inject(c.ConditionalFormattingViewModel)),Ue(5,S.Inject(c.ConditionalFormattingRuleModel))],ft);const Dr="sheets-conditional-formatting-ui.config",Dt={};var Nr=Object.defineProperty,Na=Object.getOwnPropertyDescriptor,ja=(t,e,r)=>e in t?Nr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,La=(t,e,r,n)=>{for(var o=n>1?void 0:n?Na(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Nr(e,r,o),o},nn=(t,e)=>(r,n)=>e(r,n,t),jr=(t,e,r)=>ja(t,typeof e!="symbol"?e+"":e,r);exports.UniverSheetsConditionalFormattingMobileUIPlugin=class extends S.Plugin{constructor(e=Dt,r,n,o){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=o;const{menu:i,...l}=S.merge({},Dt,this._config);i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(Dr,l),this._initCommand(),this._injector.add([ft]),this._injector.add([dt]),this._injector.add([ut]),this._injector.add([ct]),this._injector.add([ze])}_initCommand(){[ln,un,cn,dn,fn,pn,hn,mn,gn,vt,st,At,zt,ht,$t,mt].forEach(e=>{this._commandService.registerCommand(e)})}};jr(exports.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`);jr(exports.UniverSheetsConditionalFormattingMobileUIPlugin,"type",S.UniverInstanceType.UNIVER_SHEET);exports.UniverSheetsConditionalFormattingMobileUIPlugin=La([S.DependentOn(c.UniverSheetsConditionalFormattingPlugin),nn(1,S.Inject(S.Injector)),nn(2,S.Inject(S.ICommandService)),nn(3,S.IConfigService)],exports.UniverSheetsConditionalFormattingMobileUIPlugin);var Ua=Object.defineProperty,Va=Object.getOwnPropertyDescriptor,$a=(t,e,r,n)=>{for(var o=n>1?void 0:n?Va(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Ua(e,r,o),o},nt=(t,e)=>(r,n)=>e(r,n,t);let Nt=class extends S.Disposable{constructor(t,e,r,n,o){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=r,this._conditionalFormattingRuleModel=n,this._conditionalFormattingViewModel=o,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(o,i,l,v,p)=>{var I;const R=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getUnitId(),m=(I=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:I.getSheetId();if(!R||!m)return;const b={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},x={startRow:i.row,startColumn:i.col,endColumn:i.col,endRow:i.row};S.Range.foreach(l,(T,w)=>{const h=S.Rectangle.getPositionRange({startRow:T,startColumn:w,endColumn:w,endRow:T},b),a=S.Rectangle.getPositionRange({startRow:T,startColumn:w,endColumn:w,endRow:T},x),{row:s,col:f}=p(h.startRow,h.startColumn),y=this._conditionalFormattingViewModel.getCellCfs(R,m,s,f),{row:u,col:g}=p(a.startRow,a.startColumn),d=this._conditionalFormattingViewModel.getCellCfs(R,m,u,g);d&&d.forEach(C=>{let M=v.get(C.cfId);if(!v.get(C.cfId)){const j=this._conditionalFormattingRuleModel.getRule(R,m,C.cfId);if(!j)return;M=new S.ObjectMatrix,j.ranges.forEach(U=>{S.Range.foreach(U,(L,E)=>{M.setValue(L,E,1)})}),v.set(C.cfId,M)}M.realDeleteValue(u,g)}),y&&y.forEach(C=>{let M=v.get(C.cfId);if(!v.get(C.cfId)){const j=this._conditionalFormattingRuleModel.getRule(R,m,C.cfId);if(!j)return;M=new S.ObjectMatrix,j.ranges.forEach(U=>{S.Range.foreach(U,(L,E)=>{M.setValue(L,E,1)})}),v.set(C.cfId,M)}M.setValue(u,g,1)})})},r=(o,i)=>{var a,s,f;const l=(a=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET))==null?void 0:a.getUnitId(),v=(f=(s=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:f.getSheetId(),p=new Map,R=[],m=[];if(!l||!v)return t();const b=ce.virtualizeDiscreteRanges([o,i]),[x,I]=b.ranges,{mapFunc:T}=b,w={row:x.startRow,col:x.startColumn};return ce.getAutoFillRepeatRange(x,I).forEach(y=>{e(w,y.repeatStartCell,y.relativeRange,p,T)}),p.forEach((y,u)=>{const g=this._conditionalFormattingRuleModel.getRule(l,v,u);if(!g)return;const d=G.findAllRectangle(G.createTopMatrixFromMatrix(y));if(d.length){const C={unitId:l,subUnitId:v,rule:{...g,ranges:d}};R.push({id:c.SetConditionalRuleMutation.id,params:C}),m.push(...c.setConditionalRuleMutationUndoFactory(this._injector,C))}else{const C={unitId:l,subUnitId:v,cfId:g.cfId};R.push({id:c.DeleteConditionalRuleMutation.id,params:C}),m.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,C))}}),{undos:m,redos:R}},n={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(o,i,l)=>{if(l===ce.APPLY_TYPE.COPY||l===ce.APPLY_TYPE.ONLY_FORMAT||l===ce.APPLY_TYPE.SERIES){const{source:v,target:p}=o;return r(v,p)}return t()}};this.disposeWithMe(this._autoFillService.addHook(n))}};Nt=$a([nt(0,S.Inject(S.Injector)),nt(1,S.Inject(S.IUniverInstanceService)),nt(2,S.Inject(ce.IAutoFillService)),nt(3,S.Inject(c.ConditionalFormattingRuleModel)),nt(4,S.Inject(c.ConditionalFormattingViewModel))],Nt);var za=Object.defineProperty,Aa=Object.getOwnPropertyDescriptor,qa=(t,e,r,n)=>{for(var o=n>1?void 0:n?Aa(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&za(e,r,o),o},rt=(t,e)=>(r,n)=>e(r,n,t);exports.ConditionalFormattingClearController=class extends S.Disposable{constructor(e,r,n,o,i){super(),this._injector=e,this._univerInstanceService=r,this._sheetInterceptorService=n,this._selectionManagerService=o,this._conditionalFormattingRuleModel=i,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var i;const r=[],n=[],o={redos:r,undos:n};if([G.ClearSelectionFormatCommand.id,G.ClearSelectionAllCommand.id].includes(e.id)){const l=(i=this._selectionManagerService.getCurrentSelections())==null?void 0:i.map(T=>T.range);if(!l)return o;const v=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET),p=v.getActiveSheet();if(!p)return o;const R=v.getUnitId(),m=p.getSheetId(),b=this._conditionalFormattingRuleModel.getSubunitRules(R,m);if(!b||!b.length)return o;const{redos:x,undos:I}=lr(this._injector,b,l,R,m);r.push(...x),n.push(...I)}return o}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:r,ranges:n})=>{const o=[],i=[],l={redos:o,undos:i};if(!n||!n.length)return l;const v=this._conditionalFormattingRuleModel.getSubunitRules(e,r);if(!v||!v.length)return l;const{redos:p,undos:R}=lr(this._injector,v,n,e,r);return o.push(...p),i.push(...R),l}}))}};exports.ConditionalFormattingClearController=qa([rt(0,S.Inject(S.Injector)),rt(1,S.Inject(S.IUniverInstanceService)),rt(2,S.Inject(G.SheetInterceptorService)),rt(3,S.Inject(G.SheetsSelectionsService)),rt(4,S.Inject(c.ConditionalFormattingRuleModel))],exports.ConditionalFormattingClearController);function lr(t,e,r,n,o){const i=[],l=[];return e.filter(v=>r.some(p=>v.ranges.some(R=>S.Rectangle.getIntersects(R,p)))).forEach(v=>{const R=new G.RangeMergeUtil().add(...v.ranges).subtract(...r).merge();if(R.length){const m={id:c.SetConditionalRuleMutation.id,params:{unitId:n,subUnitId:o,rule:{...v,ranges:R}}},b=c.setConditionalRuleMutationUndoFactory(t,m.params);i.push(m),l.push(...b)}else{const m={id:c.DeleteConditionalRuleMutation.id,params:{unitId:n,subUnitId:o,cfId:v.cfId}},b=c.DeleteConditionalRuleMutationUndoFactory(t,m.params);i.push(m),l.push(...b)}}),{redos:i,undos:l}}var Wa=Object.defineProperty,Ha=Object.getOwnPropertyDescriptor,ka=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ha(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Wa(e,r,o),o},ur=(t,e)=>(r,n)=>e(r,n,t);let jt=class extends S.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(S.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(G.AFTER_CELL_EDIT,{handler:(t,e,r)=>{var l,v,p;t||r(t);const n=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col),o=(l=n==null?void 0:n.style)!=null?l:{},i=Object.keys(o);if(t!=null&&t.p)return(p=(v=t.p.body)==null?void 0:v.textRuns)==null||p.forEach(R=>{R.ts&&i.forEach(m=>{var b;(b=R.ts)==null||delete b[m]})}),r(t);{const R={...(typeof(t==null?void 0:t.s)=="string"?e.workbook.getStyles().get(t.s):t==null?void 0:t.s)||{}};i.forEach(b=>{delete R[b]});const m={...t,s:{...R}};return r(m)}}})))}};jt=ka([ur(0,S.Inject(G.SheetInterceptorService)),ur(1,S.Inject(c.ConditionalFormattingService))],jt);const cr=[G.SetWorksheetActiveOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],ot=[{label:"sheet.cf.ruleType.highlightCell",value:ve.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:ve.rank},{label:"sheet.cf.ruleType.formula",value:ve.formula},{label:"sheet.cf.ruleType.colorScale",value:ve.colorScale},{label:"sheet.cf.ruleType.dataBar",value:ve.dataBar},{label:"sheet.cf.ruleType.iconSet",value:ve.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:ve.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:ve.createRule},{label:"sheet.cf.menu.clearRangeRules",value:ve.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:ve.clearWorkSheetRules}],Ba=t=>{const e=t.get(G.SheetsSelectionsService),r=t.get(S.ICommandService),n=t.get(S.IUniverInstanceService),o=t.get(c.ConditionalFormattingRuleModel),i=new be.Observable(p=>be.merge(e.selectionMoveEnd$,e.selectionSet$,new be.Observable(R=>{const m=r.onCommandExecuted(b=>{var w;const{id:x,params:I}=b,T=(w=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET))==null?void 0:w.getUnitId();cr.includes(x)&&I.unitId===T&&R.next(null)});return()=>m.dispose()})).pipe(at.debounceTime(16)).subscribe(()=>{var w;const R=((w=e.getCurrentSelections())==null?void 0:w.map(h=>h.range))||[],m=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET);if(!m)return;const b=m.getActiveSheet();if(!b)return;const T=(o.getSubunitRules(m.getUnitId(),b.getSheetId())||[]).filter(h=>h.ranges.some(a=>R.some(s=>S.Rectangle.intersects(s,a)))).map(h=>h.ranges).every(h=>G.checkRangesEditablePermission(t,m.getUnitId(),b.getSheetId(),h));p.next(T)})),l=new be.Observable(p=>new be.Observable(R=>{const m=r.onCommandExecuted(b=>{var w;const{id:x,params:I}=b,T=(w=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET))==null?void 0:w.getUnitId();cr.includes(x)&&I.unitId===T&&R.next(null)});return()=>m.dispose()}).pipe(at.debounceTime(16)).subscribe(()=>{const R=n.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET);if(!R)return;const m=R.getActiveSheet();if(!m)return;const b=o.getSubunitRules(R.getUnitId(),m.getSheetId())||[];if(!b.length)return p.next(!1),!1;const x=b.map(I=>I.ranges).every(I=>G.checkRangesEditablePermission(t,R.getUnitId(),m.getSheetId(),I));p.next(x)})),v=new be.Observable(p=>{i.subscribe(R=>{const m=ot.find(b=>b.value===ve.clearRangeRules);m&&(m.disabled=!R,p.next(ot))}),l.subscribe(R=>{const m=ot.find(b=>b.value===ve.clearWorkSheetRules);m&&(m.disabled=!R,p.next(ot))}),p.next(ot)});return{id:vt.id,type:me.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:v,hidden$:me.getMenuHiddenObservable(t,S.UniverInstanceType.UNIVER_SHEET),disabled$:ce.getCurrentRangeDisable$(t,{workbookTypes:[G.WorkbookEditablePermission],worksheetTypes:[G.WorksheetSetCellStylePermission,G.WorksheetEditPermission],rangeTypes:[G.RangeProtectionPermissionEditPoint]})}},Ga={[me.RibbonStartGroup.FORMULAS_INSERT]:{[vt.id]:{order:0,menuItemFactory:Ba}}};var Xa=Object.defineProperty,Ya=Object.getOwnPropertyDescriptor,Ka=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ya(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Xa(e,r,o),o},dr=(t,e)=>(r,n)=>e(r,n,t);let Lt=class extends S.Disposable{constructor(e,r){super();_e(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=r,this._menuManagerService.mergeMenu(Ga)}};Lt=Ka([dr(0,S.Inject(S.Injector)),dr(1,me.IMenuManagerService)],Lt);var Za=Object.defineProperty,Ja=Object.getOwnPropertyDescriptor,Qa=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ja(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Za(e,r,o),o},Ve=(t,e)=>(r,n)=>e(r,n,t);const es=(t,e)=>{const r=m=>m.endRow-m.startRow+1,n=m=>m.endColumn-m.startColumn+1,o=r(e)%r(t),i=n(e)%n(t),l=Math.floor(r(e)/r(t)),v=Math.floor(n(e)/n(t)),p=[],R={startRow:0,endRow:r(t)-1,startColumn:0,endColumn:n(t)-1};if(r(e)===1&&n(e)===1){const m={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return p.push({repeatRelativeRange:R,startRange:m}),p}for(let m=0;m<l+(o?.1:0);m++)for(let b=0;b<v+(i?.1:0);b++){const x=r(t)*m,I=n(t)*b,T={startRow:x+e.startRow,endRow:x+e.startRow,startColumn:I+e.startColumn,endColumn:I+e.startColumn};let w=R;m===l&&o&&(w={...w},w.endRow=w.endRow-(r(t)-o)),b===v&&i&&(w={...w},w.endColumn=w.endColumn-(n(t)-i)),p.push({repeatRelativeRange:w,startRange:T})}return p};let Ut=class extends S.Disposable{constructor(e,r,n,o,i,l){super();_e(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=r,this._formatPainterService=n,this._sheetsSelectionsService=o,this._conditionalFormattingRuleModel=i,this._conditionalFormattingViewModel=l,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),r=(i,l,v,p,R)=>{const{unitId:m,subUnitId:b}=this._painterConfig,{targetUnitId:x,targetSubUnitId:I}=R,T={startRow:i.row,startColumn:i.col,endColumn:i.col,endRow:i.row},w={startRow:l.row,startColumn:l.col,endColumn:l.col,endRow:l.row};S.Range.foreach(v,(h,a)=>{const s=S.Rectangle.getPositionRange({startRow:h,startColumn:a,endColumn:a,endRow:h},T),f=S.Rectangle.getPositionRange({startRow:h,startColumn:a,endColumn:a,endRow:h},w),y=this._conditionalFormattingViewModel.getCellCfs(m,b,s.startRow,s.startColumn),u=this._conditionalFormattingViewModel.getCellCfs(x,I,f.startRow,f.startColumn);u&&u.forEach(g=>{let d=p.get(g.cfId);if(!p.get(g.cfId)){const C=this._conditionalFormattingRuleModel.getRule(x,I,g.cfId);if(!C)return;d=new S.ObjectMatrix,C.ranges.forEach(M=>{S.Range.foreach(M,(j,U)=>{d.setValue(j,U,1)})}),p.set(g.cfId,d)}d.realDeleteValue(f.startRow,f.startColumn)}),y&&y.forEach(g=>{const d=p.get(g.cfId);d&&d.setValue(f.startRow,f.startColumn,1)})})},n=(i,l,v)=>{var s;const{range:p,unitId:R,subUnitId:m}=this._painterConfig,b=i!==R||m!==l,x=new Map,I=[],T=[];if(!i||!l||!R||!m)return e();const w=(s=this._conditionalFormattingRuleModel.getSubunitRules(R,m))!=null?s:[];w==null||w.forEach(f=>{const{ranges:y,cfId:u}=f;if(y.some(g=>S.Rectangle.intersects(p,g))){const g=new S.ObjectMatrix;b||y.forEach(d=>{S.Range.foreach(d,(C,M)=>{g.setValue(C,M,1)})}),x.set(u,g)}});const h={row:p.startRow,col:p.startColumn};return es(p,v).forEach(f=>{r(h,{row:f.startRange.startRow,col:f.startRange.startColumn},f.repeatRelativeRange,x,{targetUnitId:i,targetSubUnitId:l})}),x.forEach((f,y)=>{if(b){const u=this._conditionalFormattingRuleModel.getRule(i,l,y),g=G.findAllRectangle(G.createTopMatrixFromMatrix(f));if(u)if(g.length){const d={unitId:i,subUnitId:l,rule:{...u,ranges:g}};I.push({id:c.SetConditionalRuleMutation.id,params:d}),T.push(...c.setConditionalRuleMutationUndoFactory(this._injector,d))}else{const d={unitId:i,subUnitId:l,cfId:u.cfId};I.push({id:c.DeleteConditionalRuleMutation.id,params:d}),T.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}else if(g.length){const d=this._conditionalFormattingRuleModel.getRule(R,m,y);if(d){const C={unitId:i,subUnitId:l,rule:{...S.Tools.deepClone(d),cfId:this._conditionalFormattingRuleModel.createCfId(i,l),ranges:g}};I.push({id:c.AddConditionalRuleMutation.id,params:C}),T.push(c.AddConditionalRuleMutationUndoFactory(this._injector,C))}}}else{const u=this._conditionalFormattingRuleModel.getRule(R,m,y);if(!u)return;const g=G.findAllRectangle(G.createTopMatrixFromMatrix(f));if(g.length){const d={unitId:R,subUnitId:m,rule:{...u,ranges:g}};I.push({id:c.SetConditionalRuleMutation.id,params:d}),T.push(...c.setConditionalRuleMutationUndoFactory(this._injector,d))}else{const d={unitId:R,subUnitId:m,cfId:u.cfId};I.push({id:c.DeleteConditionalRuleMutation.id,params:d}),T.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}}}),{undos:T,redos:I}},o={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:i=>{var l,v,p;switch(i){case ce.FormatPainterStatus.INFINITE:case ce.FormatPainterStatus.ONCE:{const R=(l=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET))==null?void 0:l.getUnitId(),m=(p=(v=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET))==null?void 0:v.getActiveSheet())==null?void 0:p.getSheetId(),b=this._sheetsSelectionsService.getCurrentLastSelection(),x=b==null?void 0:b.range;R&&m&&x&&(this._painterConfig={unitId:R,subUnitId:m,range:x});break}case ce.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(i,l,v)=>this._painterConfig?n(i,l,v):{redos:[],undos:[]}};this._formatPainterService.addHook(o)}};Ut=Qa([Ve(0,S.Inject(S.Injector)),Ve(1,S.Inject(S.IUniverInstanceService)),Ve(2,S.Inject(ce.IFormatPainterService)),Ve(3,S.Inject(G.SheetsSelectionsService)),Ve(4,S.Inject(c.ConditionalFormattingRuleModel)),Ve(5,S.Inject(c.ConditionalFormattingViewModel))],Ut);var ts=Object.defineProperty,ns=Object.getOwnPropertyDescriptor,rs=(t,e,r,n)=>{for(var o=n>1?void 0:n?ns(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&ts(e,r,o),o},rn=(t,e)=>(r,n)=>e(r,n,t);let Vt=class extends S.Disposable{constructor(t,e,r){super(),this._conditionalFormattingViewModel=t,this._univerInstanceService=e,this._renderManagerService=r,this._init()}_init(){const t=this._univerInstanceService.getCurrentUnitForType(S.UniverInstanceType.UNIVER_SHEET),e=r=>{const n=r.getUnitId(),o=this._renderManagerService.getRenderById(n);if(!o)return;const i=o.with(ce.SheetSkeletonManagerService);this.disposeWithMe(i.currentSkeleton$.subscribe(l=>{if(l){const v=l.skeleton.rowColumnSegment,p=v.endColumn-v.startColumn+1,m=(v.endRow-v.startRow+1)*p*9,b=Math.max(c.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,m);this._conditionalFormattingViewModel.setCacheLength(b)}}))};t&&e(t),this._univerInstanceService.getCurrentTypeOfUnit$(S.UniverInstanceType.UNIVER_SHEET).subscribe(r=>{r&&e(r)})}};Vt=rs([rn(0,S.Inject(c.ConditionalFormattingViewModel)),rn(1,S.IUniverInstanceService),rn(2,pr.IRenderManagerService)],Vt);var Lr=Object.defineProperty,os=Object.getOwnPropertyDescriptor,is=(t,e,r)=>e in t?Lr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,as=(t,e,r,n)=>{for(var o=n>1?void 0:n?os(e,r):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Lr(e,r,o),o},on=(t,e)=>(r,n)=>e(r,n,t),Ur=(t,e,r)=>is(t,typeof e!="symbol"?e+"":e,r);exports.UniverSheetsConditionalFormattingUIPlugin=class extends S.Plugin{constructor(e=Dt,r,n,o){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=o;const{menu:i,...l}=S.merge({},Dt,this._config);i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(Dr,l),this._initCommand()}onStarting(){S.registerDependencies(this._injector,[[ft],[dt],[ut],[Nt],[ct],[lt],[Lt],[ze],[jt],[exports.ConditionalFormattingClearController],[Ut],[Vt]]),S.touchDependencies(this._injector,[[ft]])}onReady(){S.touchDependencies(this._injector,[[Lt],[lt]])}onRendered(){S.touchDependencies(this._injector,[[Nt],[exports.ConditionalFormattingClearController],[ut],[jt],[ze],[Ut],[ct],[dt],[Vt]])}_initCommand(){[ln,un,cn,dn,fn,pn,hn,mn,gn,vt,st,At,zt,ht,$t,mt].forEach(e=>{this._commandService.registerCommand(e)})}};Ur(exports.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`);Ur(exports.UniverSheetsConditionalFormattingUIPlugin,"type",S.UniverInstanceType.UNIVER_SHEET);exports.UniverSheetsConditionalFormattingUIPlugin=as([S.DependentOn(c.UniverSheetsConditionalFormattingPlugin),on(1,S.Inject(S.Injector)),on(2,S.Inject(S.ICommandService)),on(3,S.IConfigService)],exports.UniverSheetsConditionalFormattingUIPlugin);exports.AddAverageCfCommand=ln;exports.AddCfCommand=ht;exports.AddColorScaleConditionalRuleCommand=un;exports.AddDataBarConditionalRuleCommand=cn;exports.AddDuplicateValuesCfCommand=dn;exports.AddNumberCfCommand=fn;exports.AddRankCfCommand=pn;exports.AddTextCfCommand=hn;exports.AddTimePeriodCfCommand=mn;exports.AddUniqueValuesCfCommand=gn;exports.ClearRangeCfCommand=$t;exports.ClearWorksheetCfCommand=mt;exports.DeleteCfCommand=st;exports.MoveCfCommand=zt;exports.OpenConditionalFormattingOperator=vt;exports.SetCfCommand=At;
|