@univerjs/sheets-conditional-formatting-ui 0.1.10 → 0.1.11

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.
Files changed (41) hide show
  1. package/lib/cjs/index.js +3 -3
  2. package/lib/es/index.js +1055 -892
  3. package/lib/types/commands/commands/add-average-cf.command.d.ts +1 -1
  4. package/lib/types/commands/commands/add-cf.command.d.ts +1 -1
  5. package/lib/types/commands/commands/add-color-scale-cf.command.d.ts +1 -1
  6. package/lib/types/commands/commands/add-data-bar-cf.command.d.ts +1 -1
  7. package/lib/types/commands/commands/add-duplicate-values-cf.command.d.ts +1 -1
  8. package/lib/types/commands/commands/add-number-cf.command.d.ts +1 -1
  9. package/lib/types/commands/commands/add-rank-cf.command.d.ts +1 -1
  10. package/lib/types/commands/commands/add-text-cf.command.d.ts +1 -1
  11. package/lib/types/commands/commands/add-time-period-cf.command.d.ts +1 -1
  12. package/lib/types/commands/commands/add-unique-values-cf.command.d.ts +1 -1
  13. package/lib/types/commands/commands/move-cf.command.d.ts +1 -1
  14. package/lib/types/commands/commands/set-cf.command.d.ts +1 -1
  15. package/lib/types/components/conditional-style-editor/index.d.ts +1 -1
  16. package/lib/types/components/panel/index.d.ts +1 -1
  17. package/lib/types/components/panel/rule-edit/colorScale.d.ts +1 -1
  18. package/lib/types/components/panel/rule-edit/dataBar.d.ts +1 -1
  19. package/lib/types/components/panel/rule-edit/formula.d.ts +1 -1
  20. package/lib/types/components/panel/rule-edit/highlightCell.d.ts +2 -2
  21. package/lib/types/components/panel/rule-edit/iconSet.d.ts +2 -2
  22. package/lib/types/components/panel/rule-edit/index.d.ts +1 -1
  23. package/lib/types/components/panel/rule-edit/rank.d.ts +1 -1
  24. package/lib/types/components/panel/rule-edit/type.d.ts +1 -1
  25. package/lib/types/components/panel/rule-list/index.d.ts +1 -1
  26. package/lib/types/components/preview/index.d.ts +1 -1
  27. package/lib/types/controllers/cf.auto-fill.controller.d.ts +3 -3
  28. package/lib/types/controllers/cf.clear.controller.d.ts +3 -3
  29. package/lib/types/controllers/cf.copy-paste.controller.d.ts +3 -3
  30. package/lib/types/controllers/cf.editor.controller.d.ts +2 -2
  31. package/lib/types/controllers/cf.i18n.controller.d.ts +1 -1
  32. package/lib/types/controllers/cf.menu.controller.d.ts +6 -4
  33. package/lib/types/controllers/cf.ref-range.controller.d.ts +4 -4
  34. package/lib/types/controllers/cf.render.controller.d.ts +4 -4
  35. package/lib/types/index.d.ts +1 -1
  36. package/lib/types/locale/index.d.ts +1 -0
  37. package/lib/types/locale/ru-RU.d.ts +4 -0
  38. package/lib/types/menu/manage-rule.d.ts +1 -1
  39. package/lib/types/plugin.d.ts +1 -1
  40. package/lib/umd/index.js +3 -3
  41. package/package.json +23 -23
package/lib/cjs/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var _i=Object.defineProperty;var wi=(e,t,n)=>t in e?_i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Be=(e,t,n)=>(wi(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@univerjs/core"),z=require("@wendellhu/redi"),s=require("@univerjs/sheets-conditional-formatting"),H=require("@univerjs/sheets"),be=require("@univerjs/ui"),_e=require("rxjs"),Ee=require("rxjs/operators"),w=require("react"),G=require("@univerjs/design"),te=require("@wendellhu/redi/react-bindings"),no=require("@univerjs/engine-formula"),ke=require("clsx"),ro=require("react-dom"),ce=require("@univerjs/sheets-ui"),Ii=require("@univerjs/engine-render"),xi={type:g.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:o,operator:i}=t,a=e.get(s.ConditionalFormattingRuleModel),c=e.get(g.ICommandService),l=e.get(g.IUniverInstanceService),u=H.getSheetCommandTarget(l);if(!u)return!1;const{unitId:d,subUnitId:h}=u,f=a.createCfId(d,h),v={ranges:n,cfId:f,stopIfTrue:!!o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.average,operator:i,style:r}};return c.executeCommand(s.AddConditionalRuleMutation.id,{unitId:d,subUnitId:h,rule:v})}},Oi={type:g.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,config:r,stopIfTrue:o}=t,i=e.get(s.ConditionalFormattingRuleModel),a=e.get(g.ICommandService),c=e.get(g.IUniverInstanceService),l=H.getSheetCommandTarget(c);if(!l)return!1;const{unitId:u,subUnitId:d}=l,h=i.createCfId(u,d),f={ranges:n,cfId:h,stopIfTrue:!!o,rule:{type:s.CFRuleType.colorScale,config:r}};return a.executeCommand(s.AddConditionalRuleMutation.id,{unitId:u,subUnitId:d,rule:f})}},Ei={type:g.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,min:r,max:o,nativeColor:i,positiveColor:a,isGradient:c,stopIfTrue:l,isShowValue:u}=t,d=e.get(s.ConditionalFormattingRuleModel),h=e.get(g.IUniverInstanceService),f=H.getSheetCommandTarget(h);if(!f)return!1;const{unitId:v,subUnitId:y}=f,b=e.get(g.ICommandService),x=d.createCfId(v,y),_={ranges:n,cfId:x,stopIfTrue:!!l,rule:{type:s.CFRuleType.dataBar,isShowValue:u,config:{min:r,max:o,nativeColor:i,positiveColor:a,isGradient:c}}};return b.executeCommand(s.AddConditionalRuleMutation.id,{unitId:v,subUnitId:y,rule:_})}},Mi={type:g.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:o}=t,i=e.get(s.ConditionalFormattingRuleModel),a=e.get(g.ICommandService),c=e.get(g.IUniverInstanceService),l=H.getSheetCommandTarget(c);if(!l)return!1;const{unitId:u,subUnitId:d}=l,h=i.createCfId(u,d),f={ranges:n,cfId:h,stopIfTrue:!!o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.duplicateValues,style:r}};return a.executeCommand(s.AddConditionalRuleMutation.id,{unitId:u,subUnitId:d,rule:f})}},Di={type:g.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:o,operator:i,value:a}=t,c=e.get(s.ConditionalFormattingRuleModel),l=e.get(g.ICommandService),u=e.get(g.IUniverInstanceService),d=H.getSheetCommandTarget(u);if(!d)return!1;const{unitId:h,subUnitId:f}=d,v=c.createCfId(h,f);let y;if([s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(i)){const b=a;if(b.length!==2||!Array.isArray(b))return!1;y={ranges:n,cfId:v,stopIfTrue:!!o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.number,operator:i,style:r,value:b}}}else{const b=a;if(typeof b!="number")return!1;y={ranges:n,cfId:v,stopIfTrue:!!o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.number,operator:i,style:r,value:b}}}return l.executeCommand(s.AddConditionalRuleMutation.id,{unitId:h,subUnitId:f,rule:y})}},Pi={type:g.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:o,isPercent:i,isBottom:a,value:c}=t,l=e.get(s.ConditionalFormattingRuleModel),u=e.get(g.IUniverInstanceService),d=e.get(g.ICommandService),h=H.getSheetCommandTarget(u);if(!h)return!1;const{unitId:f,subUnitId:v}=h,y=l.createCfId(f,v),b={ranges:n,cfId:y,stopIfTrue:!!o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank,isPercent:i,isBottom:a,style:r,value:c}};return d.executeCommand(s.AddConditionalRuleMutation.id,{unitId:f,subUnitId:v,rule:b})}},Ni={type:g.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:o,operator:i,value:a}=t,c=e.get(s.ConditionalFormattingRuleModel),l=e.get(g.IUniverInstanceService),u=H.getSheetCommandTarget(l);if(!u)return!1;const{unitId:d,subUnitId:h}=u,f=e.get(g.ICommandService),v=c.createCfId(d,h),y={ranges:n,cfId:v,stopIfTrue:!!o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.text,operator:i,style:r,value:a}};return f.executeCommand(s.AddConditionalRuleMutation.id,{unitId:d,subUnitId:h,rule:y})}},Fi={type:g.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:o,operator:i}=t,a=e.get(s.ConditionalFormattingRuleModel),c=e.get(g.IUniverInstanceService),l=e.get(g.ICommandService),u=H.getSheetCommandTarget(c);if(!u)return!1;const{unitId:d,subUnitId:h}=u,f=a.createCfId(d,h),v={ranges:n,cfId:f,stopIfTrue:!!o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.timePeriod,operator:i,style:r}};return l.executeCommand(s.AddConditionalRuleMutation.id,{unitId:d,subUnitId:h,rule:v})}},$i={type:g.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:o}=t,i=e.get(s.ConditionalFormattingRuleModel),a=e.get(g.IUniverInstanceService),c=e.get(g.ICommandService),l=H.getSheetCommandTarget(a);if(!l)return!1;const{unitId:u,subUnitId:d}=l,h=i.createCfId(u,d),f={ranges:n,cfId:h,stopIfTrue:!!o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.uniqueValues,style:r}};return c.executeCommand(s.AddConditionalRuleMutation.id,{unitId:u,subUnitId:d,rule:f})}},oo={type:g.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(e,t){var b;if(!t)return!1;const n=e.get(s.ConditionalFormattingRuleModel),r=e.get(g.IUniverInstanceService),o=e.get(g.ICommandService),i=e.get(g.IUndoRedoService),a=e.get(H.SelectionManagerService),c=H.getSheetCommandTarget(r,t);if(!c)return!1;const{unitId:l,subUnitId:u}=c,d=((b=a.getSelections())==null?void 0:b.map(x=>x.range))||[],h=n.getSubunitRules(l,u);if(!(h!=null&&h.length)||!d.length)return!1;const f=[],v=[];h.forEach(x=>{const _=new g.ObjectMatrix;x.ranges.forEach(C=>{g.Range.foreach(C,(R,m)=>{_.setValue(R,m,1)})}),d.forEach(C=>{g.Range.foreach(C,(R,m)=>{_.realDeleteValue(R,m)})});const S=H.findAllRectangle(H.createTopMatrixFromMatrix(_));if(S.length){const C={...x,ranges:S},R={unitId:l,subUnitId:u,rule:C},m=s.setConditionalRuleMutationUndoFactory(e,R);f.push({id:s.SetConditionalRuleMutation.id,params:R}),v.push(...m)}else{const C={unitId:l,subUnitId:u,cfId:x.cfId},R=s.DeleteConditionalRuleMutationUndoFactory(e,C);f.push({id:s.DeleteConditionalRuleMutation.id,params:C}),v.push(...R)}});const y=g.sequenceExecute(f,o).result;return y&&i.pushUndoRedo({unitID:l,redoMutations:f,undoMutations:v}),y}},Wn={type:g.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(e,t){const n=e.get(s.ConditionalFormattingRuleModel),r=e.get(g.IUniverInstanceService),o=e.get(g.ICommandService),i=e.get(g.IUndoRedoService),a=H.getSheetCommandTarget(r,t);if(!a)return!1;const{unitId:c,subUnitId:l}=a,u=n.getSubunitRules(c,l);if(!(u!=null&&u.length))return!1;const d=u.map(y=>({cfId:y.cfId,unitId:c,subUnitId:l})),h=d.map(y=>({id:s.DeleteConditionalRuleMutation.id,params:y})),f=d.map(y=>s.DeleteConditionalRuleMutationUndoFactory(e,y)[0]),v=g.sequenceExecute(h,o).result;return v&&i.pushUndoRedo({unitID:c,redoMutations:h,undoMutations:f}),v}};var xe=function(){return xe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},xe.apply(this,arguments)},ji=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},rt=w.forwardRef(function(e,t){var n=e.icon,r=e.id,o=e.className,i=e.extend,a=ji(e,["icon","id","className","extend"]),c="univerjs-icon univerjs-icon-".concat(r," ").concat(o||"").trim(),l=w.useRef("_".concat(Ui()));return io(n,"".concat(r),{defIds:n.defIds,idSuffix:l.current},xe({ref:t,className:c},a),i)});function io(e,t,n,r,o){return w.createElement(e.tag,xe(xe({key:t},Li(e,n,o)),r),(Vi(e,n).children||[]).map(function(i,a){return io(i,"".concat(t,"-").concat(e.tag,"-").concat(a),n,void 0,o)}))}function Li(e,t,n){var r=xe({},e.attrs);n!=null&&n.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=n.colorChannel1);var o=t.defIds;return!o||o.length===0||(e.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+t.idSuffix),Object.entries(r).forEach(function(i){var a=i[0],c=i[1];typeof c=="string"&&(r[a]=c.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),r}function Vi(e,t){var n,r=t.defIds;return!r||r.length===0?e:e.tag==="defs"&&(!((n=e.children)===null||n===void 0)&&n.length)?xe(xe({},e),{children:e.children.map(function(o){return typeof o.attrs.id=="string"&&r&&r.indexOf(o.attrs.id)>-1?xe(xe({},o),{attrs:xe(xe({},o.attrs),{id:o.attrs.id+t.idSuffix})}):o})}):e}function Ui(){return Math.random().toString(36).substring(2,8)}rt.displayName="UniverIcon";var zi={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"colorChannel1",d:"M5.59 1.51H10.46V14.459999999999999H5.59z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.34863 2.53325C1.34863 1.87051 1.88589 1.33325 2.54863 1.33325H13.482C14.1447 1.33325 14.682 1.87051 14.682 2.53325V13.4666C14.682 14.1294 14.1447 14.6666 13.482 14.6666H2.54863C1.88589 14.6666 1.34863 14.1294 1.34863 13.4666V2.53325ZM13.082 2.63325C13.2477 2.63325 13.382 2.76757 13.382 2.93325V5.09946C13.382 5.26515 13.2477 5.39946 13.082 5.39946H10.9708C10.8052 5.39946 10.6708 5.26515 10.6708 5.09946V2.93325C10.6708 2.76757 10.8052 2.63325 10.9708 2.63325H13.082ZM9.37085 2.93325C9.37085 2.76757 9.23653 2.63325 9.07085 2.63325H6.95974C6.79406 2.63325 6.65974 2.76757 6.65974 2.93325V5.09946C6.65974 5.26515 6.79406 5.39946 6.95974 5.39946L9.07085 5.39946C9.23654 5.39946 9.37085 5.26515 9.37085 5.09946V2.93325ZM5.35974 2.93325C5.35974 2.76757 5.22543 2.63325 5.05974 2.63325H2.94863C2.78295 2.63325 2.64863 2.76757 2.64863 2.93325V5.09946C2.64863 5.26515 2.78295 5.39946 2.94863 5.39946H5.05974C5.22543 5.39946 5.35974 5.26515 5.35974 5.09946V2.93325ZM2.94863 6.69946C2.78295 6.69946 2.64863 6.83378 2.64863 6.99946V9.11045C2.64863 9.27613 2.78295 9.41045 2.94863 9.41045H5.05974C5.22543 9.41045 5.35974 9.27613 5.35974 9.11045V6.99946C5.35974 6.83378 5.22543 6.69946 5.05974 6.69946H2.94863ZM2.94863 10.7104C2.78295 10.7104 2.64863 10.8448 2.64863 11.0104V13.0666C2.64863 13.2323 2.78295 13.3666 2.94863 13.3666H5.05974C5.22543 13.3666 5.35974 13.2323 5.35974 13.0666V11.0104C5.35974 10.8448 5.22543 10.7104 5.05974 10.7104H2.94863ZM6.65974 13.0666C6.65974 13.2323 6.79406 13.3666 6.95974 13.3666H9.07085C9.23653 13.3666 9.37085 13.2323 9.37085 13.0666V11.0104C9.37085 10.8448 9.23653 10.7104 9.07085 10.7104L6.95974 10.7104C6.79406 10.7104 6.65974 10.8448 6.65974 11.0104V13.0666ZM10.6708 13.0666C10.6708 13.2323 10.8052 13.3666 10.9708 13.3666H13.082C13.2477 13.3666 13.382 13.2323 13.382 13.0666V11.0104C13.382 10.8448 13.2477 10.7104 13.082 10.7104H10.9708C10.8052 10.7104 10.6708 10.8448 10.6708 11.0104V13.0666ZM13.082 9.41045C13.2477 9.41045 13.382 9.27613 13.382 9.11045V6.99946C13.382 6.83378 13.2477 6.69946 13.082 6.69946H10.9708C10.8052 6.69946 10.6708 6.83378 10.6708 6.99946V9.11045C10.6708 9.27613 10.8052 9.41045 10.9708 9.41045H13.082ZM6.95974 9.41045C6.79406 9.41045 6.65974 9.27613 6.65974 9.11045V6.99946C6.65974 6.83378 6.79406 6.69946 6.95974 6.69946L9.07085 6.69946C9.23653 6.69946 9.37085 6.83378 9.37085 6.99946V9.11045C9.37085 9.27613 9.23653 9.41045 9.07085 9.41045H6.95974Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ao=w.forwardRef(function(e,t){return w.createElement(rt,Object.assign({},e,{id:"conditions",ref:t,icon:zi}))});ao.displayName="Conditions";const Ai=ao;var Hi={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M6.78662 6.17993C7.12169 6.17993 7.39331 6.45156 7.39331 6.78662V10.7301C7.39331 11.0652 7.12169 11.3368 6.78662 11.3368 6.45156 11.3368 6.17993 11.0652 6.17993 10.7301V6.78662C6.17993 6.45156 6.45156 6.17993 6.78662 6.17993zM9.82007 6.78662C9.82007 6.45156 9.54844 6.17993 9.21338 6.17993 8.87831 6.17993 8.60669 6.45156 8.60669 6.78662V10.7301C8.60669 11.0652 8.87831 11.3368 9.21338 11.3368 9.54844 11.3368 9.82007 11.0652 9.82007 10.7301V6.78662z"}},{tag:"path",attrs:{fill:"currentColor",d:"M6.57094 1.32642C6.34938 1.32642 6.14544 1.44719 6.03894 1.64148L5.21395 3.14648H1.93311C1.59804 3.14648 1.32642 3.41811 1.32642 3.75317C1.32642 4.08824 1.59804 4.35986 1.93311 4.35986H2.84314V14.0669C2.84314 14.402 3.11476 14.6736 3.44983 14.6736H12.5502C12.8852 14.6736 13.1569 14.402 13.1569 14.0669V4.35986H14.0669C14.402 4.35986 14.6736 4.08824 14.6736 3.75317C14.6736 3.41811 14.402 3.14648 14.0669 3.14648H10.7895L9.98357 1.64602C9.87785 1.4492 9.67252 1.32642 9.44911 1.32642H6.57094ZM9.4122 3.14648L9.08632 2.53979H6.93024L6.59767 3.14648H9.4122ZM4.05652 4.35986V13.4602H11.9435V4.35986H4.05652Z",fillRule:"evenodd",clipRule:"evenodd"}}]},so=w.forwardRef(function(e,t){return w.createElement(rt,Object.assign({},e,{id:"delete-single",ref:t,icon:Hi}))});so.displayName="DeleteSingle";const Sn=so;var ki={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_102_249",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:{mask:"url(#mask0_102_249)"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.74717 2.0944C8.74717 1.68671 8.41279 1.3562 8.00032 1.3562C7.58785 1.3562 7.25347 1.68671 7.25347 2.0944V7.26186H2.02541C1.61294 7.26186 1.27856 7.59237 1.27856 8.00007C1.27856 8.40777 1.61294 8.73827 2.02541 8.73827H7.25347V13.9057C7.25347 14.3134 7.58785 14.6439 8.00032 14.6439C8.41279 14.6439 8.74717 14.3134 8.74717 13.9057V8.73827H13.975C14.3874 8.73827 14.7218 8.40777 14.7218 8.00007C14.7218 7.59237 14.3874 7.26186 13.975 7.26186H8.74717V2.0944Z"}}]}]},lo=w.forwardRef(function(e,t){return w.createElement(rt,Object.assign({},e,{id:"increase-single",ref:t,icon:ki}))});lo.displayName="IncreaseSingle";const Wi=lo;var qi={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_102_556",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:{mask:"url(#mask0_102_556)"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M0.629584 3.99986C1.13729 3.4922 1.9604 3.49224 2.46806 3.99995L7.57569 9.10806C7.81 9.3424 8.18992 9.3424 8.42424 9.10808L13.5323 3.99998C14.04 3.4923 14.8631 3.4923 15.3708 3.99998C15.8785 4.50766 15.8785 5.33078 15.3708 5.83846L9.41415 11.7951C8.63307 12.5762 7.36669 12.5762 6.58565 11.7951L0.629497 5.83834C0.121839 5.33063 0.121879 4.50752 0.629584 3.99986Z",fillRule:"evenodd",clipRule:"evenodd"}}]}]},co=w.forwardRef(function(e,t){return w.createElement(rt,Object.assign({},e,{id:"more-down-single",ref:t,icon:qi}))});co.displayName="MoreDownSingle";const qn=co;var Bi={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"}}]}]},uo=w.forwardRef(function(e,t){return w.createElement(rt,Object.assign({},e,{id:"sequence-single",ref:t,icon:Bi}))});uo.displayName="SequenceSingle";const Gi=uo;var Xi={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"}}]}]},fo=w.forwardRef(function(e,t){return w.createElement(rt,Object.assign({},e,{id:"slash-single",ref:t,icon:Xi}))});fo.displayName="SlashSingle";const en=fo,wr=[H.SetWorksheetActiveOperation.id,s.AddConditionalRuleMutation.id,s.SetConditionalRuleMutation.id,s.DeleteConditionalRuleMutation.id,s.MoveConditionalRuleMutation.id],Yi=e=>{const t="conditional-formatting-menu-icon";return e.register(t,Ai),n=>{const r=n.get(g.LocaleService),o=n.get(H.SelectionManagerService),i=n.get(g.ICommandService),a=n.get(g.IUniverInstanceService),c=n.get(s.ConditionalFormattingRuleModel),l=new _e.Observable(h=>_e.merge(o.selectionMoveEnd$,new _e.Observable(f=>{const v=i.onCommandExecuted(y=>{var S;const{id:b,params:x}=y,_=(S=a.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET))==null?void 0:S.getUnitId();wr.includes(b)&&x.unitId===_&&f.next(null)});return()=>v.dispose()})).pipe(Ee.debounceTime(16)).subscribe(()=>{var x;const f=((x=o.getSelections())==null?void 0:x.map(_=>_.range))||[],v=a.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET);if(!v)return;const b=(c.getSubunitRules(v.getUnitId(),v.getActiveSheet().getSheetId())||[]).filter(_=>_.ranges.some(S=>f.some(C=>g.Rectangle.intersects(C,S))));h.next(!!b.length)})),u=new _e.Observable(h=>_e.merge(o.selectionMoveEnd$,new _e.Observable(f=>{const v=i.onCommandExecuted(y=>{var S;const{id:b,params:x}=y,_=(S=a.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET))==null?void 0:S.getUnitId();wr.includes(b)&&x.unitId===_&&f.next(null)});return()=>v.dispose()})).pipe(Ee.debounceTime(16)).subscribe(()=>{const f=a.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET);if(!f)return;const v=c.getSubunitRules(f.getUnitId(),f.getActiveSheet().getSheetId())||[];h.next(!!v.length)})),d=new _e.Observable(h=>{const f=Ki(r);l.subscribe(v=>{const y=f.find(b=>b.value===Re.clearRangeRules);y&&(y.disabled=!v,h.next(f))}),u.subscribe(v=>{const y=f.find(b=>b.value===Re.clearWorkSheetRules);y&&(y.disabled=!v,h.next(f))}),h.next(f)});return{id:Ti.id,type:be.MenuItemType.SELECTOR,group:be.MenuGroup.TOOLBAR_FORMULAS_INSERT,positions:[be.MenuPosition.TOOLBAR_START],icon:t,tooltip:r.t("sheet.cf.title"),selections:d,hidden$:be.getMenuHiddenObservable(n,g.UniverInstanceType.UNIVER_SHEET)}}};function Ki(e){return[{label:e.t("sheet.cf.ruleType.highlightCell"),value:Re.highlightCell},{label:e.t("sheet.cf.panel.rankAndAverage"),value:Re.rank},{label:e.t("sheet.cf.ruleType.formula"),value:Re.formula},{label:e.t("sheet.cf.ruleType.colorScale"),value:Re.colorScale},{label:e.t("sheet.cf.ruleType.dataBar"),value:Re.dataBar},{label:e.t("sheet.cf.ruleType.iconSet"),value:Re.icon},{label:e.t("sheet.cf.menu.manageConditionalFormatting"),value:Re.viewRule},{label:e.t("sheet.cf.menu.createConditionalFormatting"),value:Re.createRule},{label:e.t("sheet.cf.menu.clearRangeRules"),value:Re.clearRangeRules,disabled:!1},{label:e.t("sheet.cf.menu.clearWorkSheetRules"),value:Re.clearWorkSheetRules}]}var Ue=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Zi(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var po={exports:{}},tn={};/**
1
+ "use strict";var _a=Object.defineProperty;var wa=(e,t,n)=>t in e?_a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ae=(e,t,n)=>(wa(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@univerjs/core"),z=require("@wendellhu/redi"),s=require("@univerjs/sheets-conditional-formatting"),k=require("@univerjs/sheets"),be=require("@univerjs/ui"),_e=require("rxjs"),Ee=require("rxjs/operators"),w=require("react"),G=require("@univerjs/design"),te=require("@wendellhu/redi/react-bindings"),no=require("@univerjs/engine-formula"),We=require("clsx"),ro=require("react-dom"),ce=require("@univerjs/sheets-ui"),Ia=require("@univerjs/engine-render"),xa={type:g.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:o,operator:a}=t,i=e.get(s.ConditionalFormattingRuleModel),c=e.get(g.ICommandService),l=e.get(g.IUniverInstanceService),u=k.getSheetCommandTarget(l);if(!u)return!1;const{unitId:d,subUnitId:h}=u,f=i.createCfId(d,h),v={ranges:n,cfId:f,stopIfTrue:!!o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.average,operator:a,style:r}};return c.executeCommand(s.AddConditionalRuleMutation.id,{unitId:d,subUnitId:h,rule:v})}},Oa={type:g.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,config:r,stopIfTrue:o}=t,a=e.get(s.ConditionalFormattingRuleModel),i=e.get(g.ICommandService),c=e.get(g.IUniverInstanceService),l=k.getSheetCommandTarget(c);if(!l)return!1;const{unitId:u,subUnitId:d}=l,h=a.createCfId(u,d),f={ranges:n,cfId:h,stopIfTrue:!!o,rule:{type:s.CFRuleType.colorScale,config:r}};return i.executeCommand(s.AddConditionalRuleMutation.id,{unitId:u,subUnitId:d,rule:f})}},Ea={type:g.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,min:r,max:o,nativeColor:a,positiveColor:i,isGradient:c,stopIfTrue:l,isShowValue:u}=t,d=e.get(s.ConditionalFormattingRuleModel),h=e.get(g.IUniverInstanceService),f=k.getSheetCommandTarget(h);if(!f)return!1;const{unitId:v,subUnitId:y}=f,b=e.get(g.ICommandService),x=d.createCfId(v,y),_={ranges:n,cfId:x,stopIfTrue:!!l,rule:{type:s.CFRuleType.dataBar,isShowValue:u,config:{min:r,max:o,nativeColor:a,positiveColor:i,isGradient:c}}};return b.executeCommand(s.AddConditionalRuleMutation.id,{unitId:v,subUnitId:y,rule:_})}},Ma={type:g.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:o}=t,a=e.get(s.ConditionalFormattingRuleModel),i=e.get(g.ICommandService),c=e.get(g.IUniverInstanceService),l=k.getSheetCommandTarget(c);if(!l)return!1;const{unitId:u,subUnitId:d}=l,h=a.createCfId(u,d),f={ranges:n,cfId:h,stopIfTrue:!!o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.duplicateValues,style:r}};return i.executeCommand(s.AddConditionalRuleMutation.id,{unitId:u,subUnitId:d,rule:f})}},Da={type:g.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:o,operator:a,value:i}=t,c=e.get(s.ConditionalFormattingRuleModel),l=e.get(g.ICommandService),u=e.get(g.IUniverInstanceService),d=k.getSheetCommandTarget(u);if(!d)return!1;const{unitId:h,subUnitId:f}=d,v=c.createCfId(h,f);let y;if([s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(a)){const b=i;if(b.length!==2||!Array.isArray(b))return!1;y={ranges:n,cfId:v,stopIfTrue:!!o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.number,operator:a,style:r,value:b}}}else{const b=i;if(typeof b!="number")return!1;y={ranges:n,cfId:v,stopIfTrue:!!o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.number,operator:a,style:r,value:b}}}return l.executeCommand(s.AddConditionalRuleMutation.id,{unitId:h,subUnitId:f,rule:y})}},Pa={type:g.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:o,isPercent:a,isBottom:i,value:c}=t,l=e.get(s.ConditionalFormattingRuleModel),u=e.get(g.IUniverInstanceService),d=e.get(g.ICommandService),h=k.getSheetCommandTarget(u);if(!h)return!1;const{unitId:f,subUnitId:v}=h,y=l.createCfId(f,v),b={ranges:n,cfId:y,stopIfTrue:!!o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank,isPercent:a,isBottom:i,style:r,value:c}};return d.executeCommand(s.AddConditionalRuleMutation.id,{unitId:f,subUnitId:v,rule:b})}},Na={type:g.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:o,operator:a,value:i}=t,c=e.get(s.ConditionalFormattingRuleModel),l=e.get(g.IUniverInstanceService),u=k.getSheetCommandTarget(l);if(!u)return!1;const{unitId:d,subUnitId:h}=u,f=e.get(g.ICommandService),v=c.createCfId(d,h),y={ranges:n,cfId:v,stopIfTrue:!!o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.text,operator:a,style:r,value:i}};return f.executeCommand(s.AddConditionalRuleMutation.id,{unitId:d,subUnitId:h,rule:y})}},Fa={type:g.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:o,operator:a}=t,i=e.get(s.ConditionalFormattingRuleModel),c=e.get(g.IUniverInstanceService),l=e.get(g.ICommandService),u=k.getSheetCommandTarget(c);if(!u)return!1;const{unitId:d,subUnitId:h}=u,f=i.createCfId(d,h),v={ranges:n,cfId:f,stopIfTrue:!!o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.timePeriod,operator:a,style:r}};return l.executeCommand(s.AddConditionalRuleMutation.id,{unitId:d,subUnitId:h,rule:v})}},$a={type:g.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:o}=t,a=e.get(s.ConditionalFormattingRuleModel),i=e.get(g.IUniverInstanceService),c=e.get(g.ICommandService),l=k.getSheetCommandTarget(i);if(!l)return!1;const{unitId:u,subUnitId:d}=l,h=a.createCfId(u,d),f={ranges:n,cfId:h,stopIfTrue:!!o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.uniqueValues,style:r}};return c.executeCommand(s.AddConditionalRuleMutation.id,{unitId:u,subUnitId:d,rule:f})}},oo={type:g.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(e,t){var b;if(!t)return!1;const n=e.get(s.ConditionalFormattingRuleModel),r=e.get(g.IUniverInstanceService),o=e.get(g.ICommandService),a=e.get(g.IUndoRedoService),i=e.get(k.SelectionManagerService),c=k.getSheetCommandTarget(r,t);if(!c)return!1;const{unitId:l,subUnitId:u}=c,d=((b=i.getSelections())==null?void 0:b.map(x=>x.range))||[],h=n.getSubunitRules(l,u);if(!(h!=null&&h.length)||!d.length)return!1;const f=[],v=[];h.forEach(x=>{const _=new g.ObjectMatrix;x.ranges.forEach(C=>{g.Range.foreach(C,(R,m)=>{_.setValue(R,m,1)})}),d.forEach(C=>{g.Range.foreach(C,(R,m)=>{_.realDeleteValue(R,m)})});const S=k.findAllRectangle(k.createTopMatrixFromMatrix(_));if(S.length){const C={...x,ranges:S},R={unitId:l,subUnitId:u,rule:C},m=s.setConditionalRuleMutationUndoFactory(e,R);f.push({id:s.SetConditionalRuleMutation.id,params:R}),v.push(...m)}else{const C={unitId:l,subUnitId:u,cfId:x.cfId},R=s.DeleteConditionalRuleMutationUndoFactory(e,C);f.push({id:s.DeleteConditionalRuleMutation.id,params:C}),v.push(...R)}});const y=g.sequenceExecute(f,o).result;return y&&a.pushUndoRedo({unitID:l,redoMutations:f,undoMutations:v}),y}},Wn={type:g.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(e,t){const n=e.get(s.ConditionalFormattingRuleModel),r=e.get(g.IUniverInstanceService),o=e.get(g.ICommandService),a=e.get(g.IUndoRedoService),i=k.getSheetCommandTarget(r,t);if(!i)return!1;const{unitId:c,subUnitId:l}=i,u=n.getSubunitRules(c,l);if(!(u!=null&&u.length))return!1;const d=u.map(y=>({cfId:y.cfId,unitId:c,subUnitId:l})),h=d.map(y=>({id:s.DeleteConditionalRuleMutation.id,params:y})),f=d.map(y=>s.DeleteConditionalRuleMutationUndoFactory(e,y)[0]),v=g.sequenceExecute(h,o).result;return v&&a.pushUndoRedo({unitID:c,redoMutations:h,undoMutations:f}),v}};var xe=function(){return xe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},xe.apply(this,arguments)},ja=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},rt=w.forwardRef(function(e,t){var n=e.icon,r=e.id,o=e.className,a=e.extend,i=ja(e,["icon","id","className","extend"]),c="univerjs-icon univerjs-icon-".concat(r," ").concat(o||"").trim(),l=w.useRef("_".concat(Ua()));return ao(n,"".concat(r),{defIds:n.defIds,idSuffix:l.current},xe({ref:t,className:c},i),a)});function ao(e,t,n,r,o){return w.createElement(e.tag,xe(xe({key:t},La(e,n,o)),r),(Va(e,n).children||[]).map(function(a,i){return ao(a,"".concat(t,"-").concat(e.tag,"-").concat(i),n,void 0,o)}))}function La(e,t,n){var r=xe({},e.attrs);n!=null&&n.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=n.colorChannel1);var o=t.defIds;return!o||o.length===0||(e.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+t.idSuffix),Object.entries(r).forEach(function(a){var i=a[0],c=a[1];typeof c=="string"&&(r[i]=c.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),r}function Va(e,t){var n,r=t.defIds;return!r||r.length===0?e:e.tag==="defs"&&(!((n=e.children)===null||n===void 0)&&n.length)?xe(xe({},e),{children:e.children.map(function(o){return typeof o.attrs.id=="string"&&r&&r.indexOf(o.attrs.id)>-1?xe(xe({},o),{attrs:xe(xe({},o.attrs),{id:o.attrs.id+t.idSuffix})}):o})}):e}function Ua(){return Math.random().toString(36).substring(2,8)}rt.displayName="UniverIcon";var za={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"colorChannel1",d:"M5.59 1.51H10.46V14.459999999999999H5.59z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.34863 2.53325C1.34863 1.87051 1.88589 1.33325 2.54863 1.33325H13.482C14.1447 1.33325 14.682 1.87051 14.682 2.53325V13.4666C14.682 14.1294 14.1447 14.6666 13.482 14.6666H2.54863C1.88589 14.6666 1.34863 14.1294 1.34863 13.4666V2.53325ZM13.082 2.63325C13.2477 2.63325 13.382 2.76757 13.382 2.93325V5.09946C13.382 5.26515 13.2477 5.39946 13.082 5.39946H10.9708C10.8052 5.39946 10.6708 5.26515 10.6708 5.09946V2.93325C10.6708 2.76757 10.8052 2.63325 10.9708 2.63325H13.082ZM9.37085 2.93325C9.37085 2.76757 9.23653 2.63325 9.07085 2.63325H6.95974C6.79406 2.63325 6.65974 2.76757 6.65974 2.93325V5.09946C6.65974 5.26515 6.79406 5.39946 6.95974 5.39946L9.07085 5.39946C9.23654 5.39946 9.37085 5.26515 9.37085 5.09946V2.93325ZM5.35974 2.93325C5.35974 2.76757 5.22543 2.63325 5.05974 2.63325H2.94863C2.78295 2.63325 2.64863 2.76757 2.64863 2.93325V5.09946C2.64863 5.26515 2.78295 5.39946 2.94863 5.39946H5.05974C5.22543 5.39946 5.35974 5.26515 5.35974 5.09946V2.93325ZM2.94863 6.69946C2.78295 6.69946 2.64863 6.83378 2.64863 6.99946V9.11045C2.64863 9.27613 2.78295 9.41045 2.94863 9.41045H5.05974C5.22543 9.41045 5.35974 9.27613 5.35974 9.11045V6.99946C5.35974 6.83378 5.22543 6.69946 5.05974 6.69946H2.94863ZM2.94863 10.7104C2.78295 10.7104 2.64863 10.8448 2.64863 11.0104V13.0666C2.64863 13.2323 2.78295 13.3666 2.94863 13.3666H5.05974C5.22543 13.3666 5.35974 13.2323 5.35974 13.0666V11.0104C5.35974 10.8448 5.22543 10.7104 5.05974 10.7104H2.94863ZM6.65974 13.0666C6.65974 13.2323 6.79406 13.3666 6.95974 13.3666H9.07085C9.23653 13.3666 9.37085 13.2323 9.37085 13.0666V11.0104C9.37085 10.8448 9.23653 10.7104 9.07085 10.7104L6.95974 10.7104C6.79406 10.7104 6.65974 10.8448 6.65974 11.0104V13.0666ZM10.6708 13.0666C10.6708 13.2323 10.8052 13.3666 10.9708 13.3666H13.082C13.2477 13.3666 13.382 13.2323 13.382 13.0666V11.0104C13.382 10.8448 13.2477 10.7104 13.082 10.7104H10.9708C10.8052 10.7104 10.6708 10.8448 10.6708 11.0104V13.0666ZM13.082 9.41045C13.2477 9.41045 13.382 9.27613 13.382 9.11045V6.99946C13.382 6.83378 13.2477 6.69946 13.082 6.69946H10.9708C10.8052 6.69946 10.6708 6.83378 10.6708 6.99946V9.11045C10.6708 9.27613 10.8052 9.41045 10.9708 9.41045H13.082ZM6.95974 9.41045C6.79406 9.41045 6.65974 9.27613 6.65974 9.11045V6.99946C6.65974 6.83378 6.79406 6.69946 6.95974 6.69946L9.07085 6.69946C9.23653 6.69946 9.37085 6.83378 9.37085 6.99946V9.11045C9.37085 9.27613 9.23653 9.41045 9.07085 9.41045H6.95974Z",fillRule:"evenodd",clipRule:"evenodd"}}]},io=w.forwardRef(function(e,t){return w.createElement(rt,Object.assign({},e,{id:"conditions",ref:t,icon:za}))});io.displayName="Conditions";const Aa=io;var ka={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M6.78662 6.17993C7.12169 6.17993 7.39331 6.45156 7.39331 6.78662V10.7301C7.39331 11.0652 7.12169 11.3368 6.78662 11.3368 6.45156 11.3368 6.17993 11.0652 6.17993 10.7301V6.78662C6.17993 6.45156 6.45156 6.17993 6.78662 6.17993zM9.82007 6.78662C9.82007 6.45156 9.54844 6.17993 9.21338 6.17993 8.87831 6.17993 8.60669 6.45156 8.60669 6.78662V10.7301C8.60669 11.0652 8.87831 11.3368 9.21338 11.3368 9.54844 11.3368 9.82007 11.0652 9.82007 10.7301V6.78662z"}},{tag:"path",attrs:{fill:"currentColor",d:"M6.57094 1.32642C6.34938 1.32642 6.14544 1.44719 6.03894 1.64148L5.21395 3.14648H1.93311C1.59804 3.14648 1.32642 3.41811 1.32642 3.75317C1.32642 4.08824 1.59804 4.35986 1.93311 4.35986H2.84314V14.0669C2.84314 14.402 3.11476 14.6736 3.44983 14.6736H12.5502C12.8852 14.6736 13.1569 14.402 13.1569 14.0669V4.35986H14.0669C14.402 4.35986 14.6736 4.08824 14.6736 3.75317C14.6736 3.41811 14.402 3.14648 14.0669 3.14648H10.7895L9.98357 1.64602C9.87785 1.4492 9.67252 1.32642 9.44911 1.32642H6.57094ZM9.4122 3.14648L9.08632 2.53979H6.93024L6.59767 3.14648H9.4122ZM4.05652 4.35986V13.4602H11.9435V4.35986H4.05652Z",fillRule:"evenodd",clipRule:"evenodd"}}]},so=w.forwardRef(function(e,t){return w.createElement(rt,Object.assign({},e,{id:"delete-single",ref:t,icon:ka}))});so.displayName="DeleteSingle";const Sn=so;var Ha={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_102_249",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:{mask:"url(#mask0_102_249)"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.74717 2.0944C8.74717 1.68671 8.41279 1.3562 8.00032 1.3562C7.58785 1.3562 7.25347 1.68671 7.25347 2.0944V7.26186H2.02541C1.61294 7.26186 1.27856 7.59237 1.27856 8.00007C1.27856 8.40777 1.61294 8.73827 2.02541 8.73827H7.25347V13.9057C7.25347 14.3134 7.58785 14.6439 8.00032 14.6439C8.41279 14.6439 8.74717 14.3134 8.74717 13.9057V8.73827H13.975C14.3874 8.73827 14.7218 8.40777 14.7218 8.00007C14.7218 7.59237 14.3874 7.26186 13.975 7.26186H8.74717V2.0944Z"}}]}]},lo=w.forwardRef(function(e,t){return w.createElement(rt,Object.assign({},e,{id:"increase-single",ref:t,icon:Ha}))});lo.displayName="IncreaseSingle";const Wa=lo;var qa={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_102_556",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:{mask:"url(#mask0_102_556)"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M0.629584 3.99986C1.13729 3.4922 1.9604 3.49224 2.46806 3.99995L7.57569 9.10806C7.81 9.3424 8.18992 9.3424 8.42424 9.10808L13.5323 3.99998C14.04 3.4923 14.8631 3.4923 15.3708 3.99998C15.8785 4.50766 15.8785 5.33078 15.3708 5.83846L9.41415 11.7951C8.63307 12.5762 7.36669 12.5762 6.58565 11.7951L0.629497 5.83834C0.121839 5.33063 0.121879 4.50752 0.629584 3.99986Z",fillRule:"evenodd",clipRule:"evenodd"}}]}]},co=w.forwardRef(function(e,t){return w.createElement(rt,Object.assign({},e,{id:"more-down-single",ref:t,icon:qa}))});co.displayName="MoreDownSingle";const qn=co;var Ba={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"}}]}]},uo=w.forwardRef(function(e,t){return w.createElement(rt,Object.assign({},e,{id:"sequence-single",ref:t,icon:Ba}))});uo.displayName="SequenceSingle";const Ga=uo;var Xa={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"}}]}]},fo=w.forwardRef(function(e,t){return w.createElement(rt,Object.assign({},e,{id:"slash-single",ref:t,icon:Xa}))});fo.displayName="SlashSingle";const en=fo,wr=[k.SetWorksheetActiveOperation.id,s.AddConditionalRuleMutation.id,s.SetConditionalRuleMutation.id,s.DeleteConditionalRuleMutation.id,s.MoveConditionalRuleMutation.id],Ya=e=>{const t="conditional-formatting-menu-icon";return e.register(t,Aa),n=>{const r=n.get(g.LocaleService),o=n.get(k.SelectionManagerService),a=n.get(g.ICommandService),i=n.get(g.IUniverInstanceService),c=n.get(s.ConditionalFormattingRuleModel),l=new _e.Observable(h=>_e.merge(o.selectionMoveEnd$,new _e.Observable(f=>{const v=a.onCommandExecuted(y=>{var S;const{id:b,params:x}=y,_=(S=i.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET))==null?void 0:S.getUnitId();wr.includes(b)&&x.unitId===_&&f.next(null)});return()=>v.dispose()})).pipe(Ee.debounceTime(16)).subscribe(()=>{var x;const f=((x=o.getSelections())==null?void 0:x.map(_=>_.range))||[],v=i.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET);if(!v)return;const b=(c.getSubunitRules(v.getUnitId(),v.getActiveSheet().getSheetId())||[]).filter(_=>_.ranges.some(S=>f.some(C=>g.Rectangle.intersects(C,S))));h.next(!!b.length)})),u=new _e.Observable(h=>_e.merge(o.selectionMoveEnd$,new _e.Observable(f=>{const v=a.onCommandExecuted(y=>{var S;const{id:b,params:x}=y,_=(S=i.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET))==null?void 0:S.getUnitId();wr.includes(b)&&x.unitId===_&&f.next(null)});return()=>v.dispose()})).pipe(Ee.debounceTime(16)).subscribe(()=>{const f=i.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET);if(!f)return;const v=c.getSubunitRules(f.getUnitId(),f.getActiveSheet().getSheetId())||[];h.next(!!v.length)})),d=new _e.Observable(h=>{const f=Ka(r);l.subscribe(v=>{const y=f.find(b=>b.value===Re.clearRangeRules);y&&(y.disabled=!v,h.next(f))}),u.subscribe(v=>{const y=f.find(b=>b.value===Re.clearWorkSheetRules);y&&(y.disabled=!v,h.next(f))}),h.next(f)});return{id:Ta.id,type:be.MenuItemType.SELECTOR,group:be.MenuGroup.TOOLBAR_FORMULAS_INSERT,positions:[be.MenuPosition.TOOLBAR_START],icon:t,tooltip:r.t("sheet.cf.title"),selections:d,hidden$:be.getMenuHiddenObservable(n,g.UniverInstanceType.UNIVER_SHEET)}}};function Ka(e){return[{label:e.t("sheet.cf.ruleType.highlightCell"),value:Re.highlightCell},{label:e.t("sheet.cf.panel.rankAndAverage"),value:Re.rank},{label:e.t("sheet.cf.ruleType.formula"),value:Re.formula},{label:e.t("sheet.cf.ruleType.colorScale"),value:Re.colorScale},{label:e.t("sheet.cf.ruleType.dataBar"),value:Re.dataBar},{label:e.t("sheet.cf.ruleType.iconSet"),value:Re.icon},{label:e.t("sheet.cf.menu.manageConditionalFormatting"),value:Re.viewRule},{label:e.t("sheet.cf.menu.createConditionalFormatting"),value:Re.createRule},{label:e.t("sheet.cf.menu.clearRangeRules"),value:Re.clearRangeRules,disabled:!1},{label:e.t("sheet.cf.menu.clearWorkSheetRules"),value:Re.clearWorkSheetRules}]}var Ue=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Za(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var po={exports:{}},tn={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,6 +6,6 @@
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 Ji=w,Qi=Symbol.for("react.element"),ea=Symbol.for("react.fragment"),ta=Object.prototype.hasOwnProperty,na=Ji.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ra={key:!0,ref:!0,__self:!0,__source:!0};function ho(e,t,n){var r,o={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)ta.call(t,r)&&!ra.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Qi,type:e,key:i,ref:a,props:o,_owner:na.current}}tn.Fragment=ea;tn.jsx=ho;tn.jsxs=ho;po.exports=tn;var p=po.exports;const oa="univer-conditional-formatting-wrap",ia="univer-cf-rule-item",aa="univer-preview",sa="univer-create-rule",la="univer-button",ca="univer-title",ua="univer-label",da="univer-label-container",fa="univer-input-width",pa="univer-m-t-base",ha="univer-m-t-sm",ga="univer-m-t-xl",ma="univer-m-l-sm",va="univer-m-l-xl",ya="univer-m-l-xxs",Ca="univer-m-l-0",Sa="univer-m-r-0",D={conditionalFormattingWrap:oa,cfRuleItem:ia,preview:aa,createRule:sa,button:la,title:ca,label:ua,labelContainer:da,inputWidth:fa,mTBase:pa,mTSm:ha,mTXl:ga,mLSm:ma,mLXl:va,mLXxs:ya,mL0:Ca,mR0:Sa};var go={exports:{}},Nt={},Pn={exports:{}};(function(e,t){(function(n,r){r(t)})(Ue,function(n){function r(N){return function(J,Y,K,oe,ue,Ie,ie){return N(J,Y,ie)}}function o(N){return function(J,Y,K,oe){if(!J||!Y||typeof J!="object"||typeof Y!="object")return N(J,Y,K,oe);var ue=oe.get(J),Ie=oe.get(Y);if(ue&&Ie)return ue===Y&&Ie===J;oe.set(J,Y),oe.set(Y,J);var ie=N(J,Y,K,oe);return oe.delete(J),oe.delete(Y),ie}}function i(N,U){var J={};for(var Y in N)J[Y]=N[Y];for(var Y in U)J[Y]=U[Y];return J}function a(N){return N.constructor===Object||N.constructor==null}function c(N){return typeof N.then=="function"}function l(N,U){return N===U||N!==N&&U!==U}var u="[object Arguments]",d="[object Boolean]",h="[object Date]",f="[object RegExp]",v="[object Map]",y="[object Number]",b="[object Object]",x="[object Set]",_="[object String]",S=Object.prototype.toString;function C(N){var U=N.areArraysEqual,J=N.areDatesEqual,Y=N.areMapsEqual,K=N.areObjectsEqual,oe=N.areRegExpsEqual,ue=N.areSetsEqual,Ie=N.createIsNestedEqual,ie=Ie(De);function De(ne,ae,Pe){if(ne===ae)return!0;if(!ne||!ae||typeof ne!="object"||typeof ae!="object")return ne!==ne&&ae!==ae;if(a(ne)&&a(ae))return K(ne,ae,ie,Pe);var Rr=Array.isArray(ne),_r=Array.isArray(ae);if(Rr||_r)return Rr===_r&&U(ne,ae,ie,Pe);var Ne=S.call(ne);return Ne!==S.call(ae)?!1:Ne===h?J(ne,ae,ie,Pe):Ne===f?oe(ne,ae,ie,Pe):Ne===v?Y(ne,ae,ie,Pe):Ne===x?ue(ne,ae,ie,Pe):Ne===b||Ne===u?c(ne)||c(ae)?!1:K(ne,ae,ie,Pe):Ne===d||Ne===y||Ne===_?l(ne.valueOf(),ae.valueOf()):!1}return De}function R(N,U,J,Y){var K=N.length;if(U.length!==K)return!1;for(;K-- >0;)if(!J(N[K],U[K],K,K,N,U,Y))return!1;return!0}var m=o(R);function O(N,U){return l(N.valueOf(),U.valueOf())}function M(N,U,J,Y){var K=N.size===U.size;if(!K)return!1;if(!N.size)return!0;var oe={},ue=0;return N.forEach(function(Ie,ie){if(K){var De=!1,ne=0;U.forEach(function(ae,Pe){!De&&!oe[ne]&&(De=J(ie,Pe,ue,ne,N,U,Y)&&J(Ie,ae,ie,Pe,N,U,Y))&&(oe[ne]=!0),ne++}),ue++,K=De}}),K}var I=o(M),F="_owner",$=Object.prototype.hasOwnProperty;function j(N,U,J,Y){var K=Object.keys(N),oe=K.length;if(Object.keys(U).length!==oe)return!1;for(var ue;oe-- >0;){if(ue=K[oe],ue===F){var Ie=!!N.$$typeof,ie=!!U.$$typeof;if((Ie||ie)&&Ie!==ie)return!1}if(!$.call(U,ue)||!J(N[ue],U[ue],ue,ue,N,U,Y))return!1}return!0}var q=o(j);function T(N,U){return N.source===U.source&&N.flags===U.flags}function E(N,U,J,Y){var K=N.size===U.size;if(!K)return!1;if(!N.size)return!0;var oe={};return N.forEach(function(ue,Ie){if(K){var ie=!1,De=0;U.forEach(function(ne,ae){!ie&&!oe[De]&&(ie=J(ue,ne,Ie,ae,N,U,Y))&&(oe[De]=!0),De++}),K=ie}}),K}var Z=o(E),me=Object.freeze({areArraysEqual:R,areDatesEqual:O,areMapsEqual:M,areObjectsEqual:j,areRegExpsEqual:T,areSetsEqual:E,createIsNestedEqual:r}),L=Object.freeze({areArraysEqual:m,areDatesEqual:O,areMapsEqual:I,areObjectsEqual:q,areRegExpsEqual:T,areSetsEqual:Z,createIsNestedEqual:r}),B=C(me);function ee(N,U){return B(N,U,void 0)}var se=C(i(me,{createIsNestedEqual:function(){return l}}));function fe(N,U){return se(N,U,void 0)}var ve=C(L);function ye(N,U){return ve(N,U,new WeakMap)}var Me=C(i(L,{createIsNestedEqual:function(){return l}}));function qe(N,U){return Me(N,U,new WeakMap)}function yt(N){return C(i(me,N(me)))}function Ri(N){var U=C(i(L,N(L)));return function(J,Y,K){return K===void 0&&(K=new WeakMap),U(J,Y,K)}}n.circularDeepEqual=ye,n.circularShallowEqual=qe,n.createCustomCircularEqual=Ri,n.createCustomEqual=yt,n.deepEqual=ee,n.sameValueZeroEqual=l,n.shallowEqual=fe,Object.defineProperty(n,"__esModule",{value:!0})})})(Pn,Pn.exports);var Gn=Pn.exports,W={},ba=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(W,"__esModule",{value:!0});W.bottom=Xn;W.childrenEqual=_a;W.cloneLayout=mo;W.cloneLayoutItem=Qe;W.collides=nn;W.compact=yo;W.compactItem=Co;W.compactType=Va;W.correctBounds=So;W.fastPositionEqual=wa;W.fastRGLPropsEqual=void 0;W.getAllCollisions=bo;W.getFirstCollision=Ze;W.getLayoutItem=Yn;W.getStatics=Kn;W.modifyLayout=vo;W.moveElement=Ot;W.moveElementAwayFromCollision=Fn;W.noop=void 0;W.perc=xa;W.resizeItemInDirection=Na;W.setTopLeft=$a;W.setTransform=Fa;W.sortLayoutItems=nr;W.sortLayoutItemsByColRow=Io;W.sortLayoutItemsByRowCol=wo;W.synchronizeLayoutWithChildren=ja;W.validateLayout=La;W.withLayoutItem=Ra;var Ir=Gn,xt=Ta(w);function Ta(e){return e&&e.__esModule?e:{default:e}}function Xn(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function mo(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Qe(e[n]);return t}function vo(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function Ra(e,t,n){let r=Yn(e,t);return r?(r=n(Qe(r)),e=vo(e,r),[e,r]):[e,null]}function Qe(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function _a(e,t){return(0,Ir.deepEqual)(xt.default.Children.map(e,n=>n==null?void 0:n.key),xt.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,Ir.deepEqual)(xt.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),xt.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}W.fastRGLPropsEqual=ba;function wa(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function nn(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function yo(e,t,n,r){const o=Kn(e),i=nr(e,t),a=Array(e.length);for(let c=0,l=i.length;c<l;c++){let u=Qe(i[c]);u.static||(u=Co(o,u,t,n,i,r),o.push(u)),a[e.indexOf(i[c])]=u,u.moved=!1}return a}const Ia={x:"w",y:"h"};function Nn(e,t,n,r){const o=Ia[r];t[r]+=1;const i=e.map(a=>a.i).indexOf(t.i);for(let a=i+1;a<e.length;a++){const c=e[a];if(!c.static){if(c.y>t.y+t.h)break;nn(t,c)&&Nn(e,c,n+t[o],r)}}t[r]=n}function Co(e,t,n,r,o,i){const a=n==="vertical",c=n==="horizontal";if(a)for(t.y=Math.min(Xn(e),t.y);t.y>0&&!Ze(e,t);)t.y--;else if(c)for(;t.x>0&&!Ze(e,t);)t.x--;let l;for(;(l=Ze(e,t))&&!(n===null&&i);)if(c?Nn(o,t,l.x+l.w,"x"):Nn(o,t,l.y+l.h,"y"),c&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Ze(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function So(e,t){const n=Kn(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Ze(n,i);)i.y++}return e}function Yn(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Ze(e,t){for(let n=0,r=e.length;n<r;n++)if(nn(e[n],t))return e[n]}function bo(e,t){return e.filter(n=>nn(n,t))}function Kn(e){return e.filter(t=>t.static)}function Ot(e,t,n,r,o,i,a,c,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const u=t.x,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let h=nr(e,a);(a==="vertical"&&typeof r=="number"?d>=r:a==="horizontal"&&typeof n=="number"?u>=n:!1)&&(h=h.reverse());const v=bo(h,t),y=v.length>0;if(y&&l)return mo(e);if(y&&i)return`${t.i}`,t.x=u,t.y=d,t.moved=!1,e;for(let b=0,x=v.length;b<x;b++){const _=v[b];`${t.i}${t.x}${t.y}${_.i}${_.x}${_.y}`,!_.moved&&(_.static?e=Fn(e,_,t,o,a):e=Fn(e,t,_,o,a))}return e}function Fn(e,t,n,r,o,i){const a=o==="horizontal",c=o==="vertical",l=t.static;if(r){r=!1;const h={x:a?Math.max(t.x-n.w,0):n.x,y:c?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},f=Ze(e,h),v=f&&f.y+f.h>t.y,y=f&&t.x+t.w>f.x;if(f){if(v&&c)return Ot(e,n,void 0,t.y+1,r,l,o);if(v&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(y&&a)return Ot(e,t,n.x,void 0,r,l,o)}else return`${n.i}${h.x}${h.y}`,Ot(e,n,a?h.x:void 0,c?h.y:void 0,r,l,o)}const u=a?n.x+1:void 0,d=c?n.y+1:void 0;return u==null&&d==null?e:Ot(e,n,a?n.x+1:void 0,c?n.y+1:void 0,r,l,o)}function xa(e){return e*100+"%"}const To=(e,t,n,r)=>e+n>r?t:n,Ro=(e,t,n)=>e<0?t:n,_o=e=>Math.max(0,e),Zn=e=>Math.max(0,e),Jn=(e,t,n)=>{let{left:r,height:o,width:i}=t;const a=e.top-(o-e.height);return{left:r,width:i,height:Ro(a,e.height,o),top:Zn(a)}},Qn=(e,t,n)=>{let{top:r,left:o,height:i,width:a}=t;return{top:r,height:i,width:To(e.left,e.width,a,n),left:_o(o)}},er=(e,t,n)=>{let{top:r,height:o,width:i}=t;const a=e.left-(i-e.width);return{height:o,width:a<0?e.width:To(e.left,e.width,i,n),top:Zn(r),left:_o(a)}},tr=(e,t,n)=>{let{top:r,left:o,height:i,width:a}=t;return{width:a,left:o,height:Ro(r,e.height,i),top:Zn(r)}},Oa=function(){return Jn(arguments.length<=0?void 0:arguments[0],Qn(...arguments))},Ea=function(){return Jn(arguments.length<=0?void 0:arguments[0],er(...arguments))},Ma=function(){return tr(arguments.length<=0?void 0:arguments[0],Qn(...arguments))},Da=function(){return tr(arguments.length<=0?void 0:arguments[0],er(...arguments))},Pa={n:Jn,ne:Oa,e:Qn,se:Ma,s:tr,sw:Da,w:er,nw:Ea};function Na(e,t,n,r){const o=Pa[e];return o?o(t,{...t,...n},r):n}function Fa(e){let{top:t,left:n,width:r,height:o}=e;const i=`translate(${n}px,${t}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${r}px`,height:`${o}px`,position:"absolute"}}function $a(e){let{top:t,left:n,width:r,height:o}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function nr(e,t){return t==="horizontal"?Io(e):t==="vertical"?wo(e):e}function wo(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function Io(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function ja(e,t,n,r,o){e=e||[];const i=[];xt.default.Children.forEach(t,c=>{if((c==null?void 0:c.key)==null)return;const l=Yn(e,String(c.key)),u=c.props["data-grid"];l&&u==null?i.push(Qe(l)):u?i.push(Qe({...u,i:c.key})):i.push(Qe({w:1,h:1,x:0,y:Xn(i),i:String(c.key)}))});const a=So(i,{cols:n});return o?a:yo(a,r,n)}function La(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let a=0;a<n.length;a++)if(typeof i[n[a]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[a]+" must be a number!")}}function Va(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const Ua=()=>{};W.noop=Ua;var $e={};Object.defineProperty($e,"__esModule",{value:!0});$e.calcGridColWidth=rn;$e.calcGridItemPosition=za;$e.calcGridItemWHPx=$n;$e.calcWH=Ha;$e.calcXY=Aa;$e.clamp=Je;function rn(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function $n(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function za(e,t,n,r,o,i){const{margin:a,containerPadding:c,rowHeight:l}=e,u=rn(e),d={};return i&&i.resizing?(d.width=Math.round(i.resizing.width),d.height=Math.round(i.resizing.height)):(d.width=$n(r,u,a[0]),d.height=$n(o,l,a[1])),i&&i.dragging?(d.top=Math.round(i.dragging.top),d.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(d.top=Math.round(i.resizing.top),d.left=Math.round(i.resizing.left)):(d.top=Math.round((l+a[1])*n+c[1]),d.left=Math.round((u+a[0])*t+c[0])),d}function Aa(e,t,n,r,o){const{margin:i,cols:a,rowHeight:c,maxRows:l}=e,u=rn(e);let d=Math.round((n-i[0])/(u+i[0])),h=Math.round((t-i[1])/(c+i[1]));return d=Je(d,0,a-r),h=Je(h,0,l-o),{x:d,y:h}}function Ha(e,t,n,r,o,i){const{margin:a,maxRows:c,cols:l,rowHeight:u}=e,d=rn(e);let h=Math.round((t+a[0])/(d+a[0])),f=Math.round((n+a[1])/(u+a[1])),v=Je(h,0,l-r),y=Je(f,0,c-o);return["sw","w","nw"].indexOf(i)!==-1&&(v=Je(h,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(y=Je(f,0,c)),{w:v,h:y}}function Je(e,t,n){return Math.max(Math.min(e,n),t)}var on={},xo={exports:{}},ka="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Wa=ka,qa=Wa;function Oo(){}function Eo(){}Eo.resetWarningCache=Oo;var Ba=function(){function e(r,o,i,a,c,l){if(l!==qa){var u=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 u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Eo,resetWarningCache:Oo};return n.PropTypes=n,n};xo.exports=Ba();var We=xo.exports,an={exports:{}},Mo={},re={},je={};Object.defineProperty(je,"__esModule",{value:!0});je.dontSetMe=Za;je.findInArray=Ga;je.int=Ka;je.isFunction=Xa;je.isNum=Ya;function Ga(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function Xa(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function Ya(e){return typeof e=="number"&&!isNaN(e)}function Ka(e){return parseInt(e,10)}function Za(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var ot={};Object.defineProperty(ot,"__esModule",{value:!0});ot.browserPrefixToKey=Po;ot.browserPrefixToStyle=Ja;ot.default=void 0;ot.getPrefix=Do;const bn=["Moz","Webkit","O","ms"];function Do(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<bn.length;r++)if(Po(t,bn[r])in n)return bn[r];return""}function Po(e,t){return t?"".concat(t).concat(Qa(e)):e}function Ja(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function Qa(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}ot.default=Do();Object.defineProperty(re,"__esModule",{value:!0});re.addClassName=$o;re.addEvent=ns;re.addUserSelectStyles=ps;re.createCSSTransform=cs;re.createSVGTransform=us;re.getTouch=ds;re.getTouchIdentifier=fs;re.getTranslation=rr;re.innerHeight=as;re.innerWidth=ss;re.matchesSelector=Fo;re.matchesSelectorAndParentsTo=ts;re.offsetXYFromParent=ls;re.outerHeight=os;re.outerWidth=is;re.removeClassName=jo;re.removeEvent=rs;re.removeUserSelectStyles=hs;var we=je,xr=es(ot);function No(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(No=function(r){return r?n:t})(e)}function es(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=No(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let jt="";function Fo(e,t){return jt||(jt=(0,we.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,we.isFunction)(e[n])})),(0,we.isFunction)(e[jt])?e[jt](t):!1}function ts(e,t,n){let r=e;do{if(Fo(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function ns(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function rs(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function os(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,we.int)(n.borderTopWidth),t+=(0,we.int)(n.borderBottomWidth),t}function is(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,we.int)(n.borderLeftWidth),t+=(0,we.int)(n.borderRightWidth),t}function as(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,we.int)(n.paddingTop),t-=(0,we.int)(n.paddingBottom),t}function ss(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,we.int)(n.paddingLeft),t-=(0,we.int)(n.paddingRight),t}function ls(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-o.left)/n,a=(e.clientY+t.scrollTop-o.top)/n;return{x:i,y:a}}function cs(e,t){const n=rr(e,t,"px");return{[(0,xr.browserPrefixToKey)("transform",xr.default)]:n}}function us(e,t){return rr(e,t,"")}function rr(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const a="".concat(typeof t.x=="string"?t.x:t.x+n),c="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(a,", ").concat(c,")")+i}return i}function ds(e,t){return e.targetTouches&&(0,we.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,we.findInArray)(e.changedTouches,n=>t===n.identifier)}function fs(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function ps(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
9
+ */var Ja=w,Qa=Symbol.for("react.element"),ei=Symbol.for("react.fragment"),ti=Object.prototype.hasOwnProperty,ni=Ja.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ri={key:!0,ref:!0,__self:!0,__source:!0};function ho(e,t,n){var r,o={},a=null,i=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)ti.call(t,r)&&!ri.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Qa,type:e,key:a,ref:i,props:o,_owner:ni.current}}tn.Fragment=ei;tn.jsx=ho;tn.jsxs=ho;po.exports=tn;var p=po.exports;const oi="univer-conditional-formatting-wrap",ai="univer-cf-rule-item",ii="univer-preview",si="univer-create-rule",li="univer-button",ci="univer-title",ui="univer-label",di="univer-label-container",fi="univer-input-width",pi="univer-m-t-base",hi="univer-m-t-sm",gi="univer-m-t-xl",mi="univer-m-l-sm",vi="univer-m-l-xl",yi="univer-m-l-xxs",Ci="univer-m-l-0",Si="univer-m-r-0",D={conditionalFormattingWrap:oi,cfRuleItem:ai,preview:ii,createRule:si,button:li,title:ci,label:ui,labelContainer:di,inputWidth:fi,mTBase:pi,mTSm:hi,mTXl:gi,mLSm:mi,mLXl:vi,mLXxs:yi,mL0:Ci,mR0:Si};var go={exports:{}},Nt={},Pn={exports:{}};(function(e,t){(function(n,r){r(t)})(Ue,function(n){function r(N){return function(J,Y,K,oe,ue,Ie,ae){return N(J,Y,ae)}}function o(N){return function(J,Y,K,oe){if(!J||!Y||typeof J!="object"||typeof Y!="object")return N(J,Y,K,oe);var ue=oe.get(J),Ie=oe.get(Y);if(ue&&Ie)return ue===Y&&Ie===J;oe.set(J,Y),oe.set(Y,J);var ae=N(J,Y,K,oe);return oe.delete(J),oe.delete(Y),ae}}function a(N,U){var J={};for(var Y in N)J[Y]=N[Y];for(var Y in U)J[Y]=U[Y];return J}function i(N){return N.constructor===Object||N.constructor==null}function c(N){return typeof N.then=="function"}function l(N,U){return N===U||N!==N&&U!==U}var u="[object Arguments]",d="[object Boolean]",h="[object Date]",f="[object RegExp]",v="[object Map]",y="[object Number]",b="[object Object]",x="[object Set]",_="[object String]",S=Object.prototype.toString;function C(N){var U=N.areArraysEqual,J=N.areDatesEqual,Y=N.areMapsEqual,K=N.areObjectsEqual,oe=N.areRegExpsEqual,ue=N.areSetsEqual,Ie=N.createIsNestedEqual,ae=Ie(De);function De(ne,ie,Pe){if(ne===ie)return!0;if(!ne||!ie||typeof ne!="object"||typeof ie!="object")return ne!==ne&&ie!==ie;if(i(ne)&&i(ie))return K(ne,ie,ae,Pe);var Rr=Array.isArray(ne),_r=Array.isArray(ie);if(Rr||_r)return Rr===_r&&U(ne,ie,ae,Pe);var Ne=S.call(ne);return Ne!==S.call(ie)?!1:Ne===h?J(ne,ie,ae,Pe):Ne===f?oe(ne,ie,ae,Pe):Ne===v?Y(ne,ie,ae,Pe):Ne===x?ue(ne,ie,ae,Pe):Ne===b||Ne===u?c(ne)||c(ie)?!1:K(ne,ie,ae,Pe):Ne===d||Ne===y||Ne===_?l(ne.valueOf(),ie.valueOf()):!1}return De}function R(N,U,J,Y){var K=N.length;if(U.length!==K)return!1;for(;K-- >0;)if(!J(N[K],U[K],K,K,N,U,Y))return!1;return!0}var m=o(R);function O(N,U){return l(N.valueOf(),U.valueOf())}function M(N,U,J,Y){var K=N.size===U.size;if(!K)return!1;if(!N.size)return!0;var oe={},ue=0;return N.forEach(function(Ie,ae){if(K){var De=!1,ne=0;U.forEach(function(ie,Pe){!De&&!oe[ne]&&(De=J(ae,Pe,ue,ne,N,U,Y)&&J(Ie,ie,ae,Pe,N,U,Y))&&(oe[ne]=!0),ne++}),ue++,K=De}}),K}var I=o(M),F="_owner",$=Object.prototype.hasOwnProperty;function j(N,U,J,Y){var K=Object.keys(N),oe=K.length;if(Object.keys(U).length!==oe)return!1;for(var ue;oe-- >0;){if(ue=K[oe],ue===F){var Ie=!!N.$$typeof,ae=!!U.$$typeof;if((Ie||ae)&&Ie!==ae)return!1}if(!$.call(U,ue)||!J(N[ue],U[ue],ue,ue,N,U,Y))return!1}return!0}var q=o(j);function T(N,U){return N.source===U.source&&N.flags===U.flags}function E(N,U,J,Y){var K=N.size===U.size;if(!K)return!1;if(!N.size)return!0;var oe={};return N.forEach(function(ue,Ie){if(K){var ae=!1,De=0;U.forEach(function(ne,ie){!ae&&!oe[De]&&(ae=J(ue,ne,Ie,ie,N,U,Y))&&(oe[De]=!0),De++}),K=ae}}),K}var Z=o(E),me=Object.freeze({areArraysEqual:R,areDatesEqual:O,areMapsEqual:M,areObjectsEqual:j,areRegExpsEqual:T,areSetsEqual:E,createIsNestedEqual:r}),L=Object.freeze({areArraysEqual:m,areDatesEqual:O,areMapsEqual:I,areObjectsEqual:q,areRegExpsEqual:T,areSetsEqual:Z,createIsNestedEqual:r}),B=C(me);function ee(N,U){return B(N,U,void 0)}var se=C(a(me,{createIsNestedEqual:function(){return l}}));function fe(N,U){return se(N,U,void 0)}var ve=C(L);function ye(N,U){return ve(N,U,new WeakMap)}var Me=C(a(L,{createIsNestedEqual:function(){return l}}));function Be(N,U){return Me(N,U,new WeakMap)}function Ct(N){return C(a(me,N(me)))}function Ra(N){var U=C(a(L,N(L)));return function(J,Y,K){return K===void 0&&(K=new WeakMap),U(J,Y,K)}}n.circularDeepEqual=ye,n.circularShallowEqual=Be,n.createCustomCircularEqual=Ra,n.createCustomEqual=Ct,n.deepEqual=ee,n.sameValueZeroEqual=l,n.shallowEqual=fe,Object.defineProperty(n,"__esModule",{value:!0})})})(Pn,Pn.exports);var Gn=Pn.exports,W={},bi=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(W,"__esModule",{value:!0});W.bottom=Xn;W.childrenEqual=_i;W.cloneLayout=mo;W.cloneLayoutItem=Qe;W.collides=nn;W.compact=yo;W.compactItem=Co;W.compactType=Vi;W.correctBounds=So;W.fastPositionEqual=wi;W.fastRGLPropsEqual=void 0;W.getAllCollisions=bo;W.getFirstCollision=Ze;W.getLayoutItem=Yn;W.getStatics=Kn;W.modifyLayout=vo;W.moveElement=Ot;W.moveElementAwayFromCollision=Fn;W.noop=void 0;W.perc=xi;W.resizeItemInDirection=Ni;W.setTopLeft=$i;W.setTransform=Fi;W.sortLayoutItems=nr;W.sortLayoutItemsByColRow=Io;W.sortLayoutItemsByRowCol=wo;W.synchronizeLayoutWithChildren=ji;W.validateLayout=Li;W.withLayoutItem=Ri;var Ir=Gn,xt=Ti(w);function Ti(e){return e&&e.__esModule?e:{default:e}}function Xn(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function mo(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Qe(e[n]);return t}function vo(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function Ri(e,t,n){let r=Yn(e,t);return r?(r=n(Qe(r)),e=vo(e,r),[e,r]):[e,null]}function Qe(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function _i(e,t){return(0,Ir.deepEqual)(xt.default.Children.map(e,n=>n==null?void 0:n.key),xt.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,Ir.deepEqual)(xt.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),xt.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}W.fastRGLPropsEqual=bi;function wi(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function nn(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function yo(e,t,n,r){const o=Kn(e),a=nr(e,t),i=Array(e.length);for(let c=0,l=a.length;c<l;c++){let u=Qe(a[c]);u.static||(u=Co(o,u,t,n,a,r),o.push(u)),i[e.indexOf(a[c])]=u,u.moved=!1}return i}const Ii={x:"w",y:"h"};function Nn(e,t,n,r){const o=Ii[r];t[r]+=1;const a=e.map(i=>i.i).indexOf(t.i);for(let i=a+1;i<e.length;i++){const c=e[i];if(!c.static){if(c.y>t.y+t.h)break;nn(t,c)&&Nn(e,c,n+t[o],r)}}t[r]=n}function Co(e,t,n,r,o,a){const i=n==="vertical",c=n==="horizontal";if(i)for(t.y=Math.min(Xn(e),t.y);t.y>0&&!Ze(e,t);)t.y--;else if(c)for(;t.x>0&&!Ze(e,t);)t.x--;let l;for(;(l=Ze(e,t))&&!(n===null&&a);)if(c?Nn(o,t,l.x+l.w,"x"):Nn(o,t,l.y+l.h,"y"),c&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Ze(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function So(e,t){const n=Kn(e);for(let r=0,o=e.length;r<o;r++){const a=e[r];if(a.x+a.w>t.cols&&(a.x=t.cols-a.w),a.x<0&&(a.x=0,a.w=t.cols),!a.static)n.push(a);else for(;Ze(n,a);)a.y++}return e}function Yn(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Ze(e,t){for(let n=0,r=e.length;n<r;n++)if(nn(e[n],t))return e[n]}function bo(e,t){return e.filter(n=>nn(n,t))}function Kn(e){return e.filter(t=>t.static)}function Ot(e,t,n,r,o,a,i,c,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const u=t.x,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let h=nr(e,i);(i==="vertical"&&typeof r=="number"?d>=r:i==="horizontal"&&typeof n=="number"?u>=n:!1)&&(h=h.reverse());const v=bo(h,t),y=v.length>0;if(y&&l)return mo(e);if(y&&a)return`${t.i}`,t.x=u,t.y=d,t.moved=!1,e;for(let b=0,x=v.length;b<x;b++){const _=v[b];`${t.i}${t.x}${t.y}${_.i}${_.x}${_.y}`,!_.moved&&(_.static?e=Fn(e,_,t,o,i):e=Fn(e,t,_,o,i))}return e}function Fn(e,t,n,r,o,a){const i=o==="horizontal",c=o==="vertical",l=t.static;if(r){r=!1;const h={x:i?Math.max(t.x-n.w,0):n.x,y:c?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},f=Ze(e,h),v=f&&f.y+f.h>t.y,y=f&&t.x+t.w>f.x;if(f){if(v&&c)return Ot(e,n,void 0,t.y+1,r,l,o);if(v&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(y&&i)return Ot(e,t,n.x,void 0,r,l,o)}else return`${n.i}${h.x}${h.y}`,Ot(e,n,i?h.x:void 0,c?h.y:void 0,r,l,o)}const u=i?n.x+1:void 0,d=c?n.y+1:void 0;return u==null&&d==null?e:Ot(e,n,i?n.x+1:void 0,c?n.y+1:void 0,r,l,o)}function xi(e){return e*100+"%"}const To=(e,t,n,r)=>e+n>r?t:n,Ro=(e,t,n)=>e<0?t:n,_o=e=>Math.max(0,e),Zn=e=>Math.max(0,e),Jn=(e,t,n)=>{let{left:r,height:o,width:a}=t;const i=e.top-(o-e.height);return{left:r,width:a,height:Ro(i,e.height,o),top:Zn(i)}},Qn=(e,t,n)=>{let{top:r,left:o,height:a,width:i}=t;return{top:r,height:a,width:To(e.left,e.width,i,n),left:_o(o)}},er=(e,t,n)=>{let{top:r,height:o,width:a}=t;const i=e.left-(a-e.width);return{height:o,width:i<0?e.width:To(e.left,e.width,a,n),top:Zn(r),left:_o(i)}},tr=(e,t,n)=>{let{top:r,left:o,height:a,width:i}=t;return{width:i,left:o,height:Ro(r,e.height,a),top:Zn(r)}},Oi=function(){return Jn(arguments.length<=0?void 0:arguments[0],Qn(...arguments))},Ei=function(){return Jn(arguments.length<=0?void 0:arguments[0],er(...arguments))},Mi=function(){return tr(arguments.length<=0?void 0:arguments[0],Qn(...arguments))},Di=function(){return tr(arguments.length<=0?void 0:arguments[0],er(...arguments))},Pi={n:Jn,ne:Oi,e:Qn,se:Mi,s:tr,sw:Di,w:er,nw:Ei};function Ni(e,t,n,r){const o=Pi[e];return o?o(t,{...t,...n},r):n}function Fi(e){let{top:t,left:n,width:r,height:o}=e;const a=`translate(${n}px,${t}px)`;return{transform:a,WebkitTransform:a,MozTransform:a,msTransform:a,OTransform:a,width:`${r}px`,height:`${o}px`,position:"absolute"}}function $i(e){let{top:t,left:n,width:r,height:o}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function nr(e,t){return t==="horizontal"?Io(e):t==="vertical"?wo(e):e}function wo(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function Io(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function ji(e,t,n,r,o){e=e||[];const a=[];xt.default.Children.forEach(t,c=>{if((c==null?void 0:c.key)==null)return;const l=Yn(e,String(c.key)),u=c.props["data-grid"];l&&u==null?a.push(Qe(l)):u?a.push(Qe({...u,i:c.key})):a.push(Qe({w:1,h:1,x:0,y:Xn(a),i:String(c.key)}))});const i=So(a,{cols:n});return o?i:yo(i,r,n)}function Li(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const a=e[r];for(let i=0;i<n.length;i++)if(typeof a[n[i]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[i]+" must be a number!")}}function Vi(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const Ui=()=>{};W.noop=Ui;var $e={};Object.defineProperty($e,"__esModule",{value:!0});$e.calcGridColWidth=rn;$e.calcGridItemPosition=zi;$e.calcGridItemWHPx=$n;$e.calcWH=ki;$e.calcXY=Ai;$e.clamp=Je;function rn(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function $n(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function zi(e,t,n,r,o,a){const{margin:i,containerPadding:c,rowHeight:l}=e,u=rn(e),d={};return a&&a.resizing?(d.width=Math.round(a.resizing.width),d.height=Math.round(a.resizing.height)):(d.width=$n(r,u,i[0]),d.height=$n(o,l,i[1])),a&&a.dragging?(d.top=Math.round(a.dragging.top),d.left=Math.round(a.dragging.left)):a&&a.resizing&&typeof a.resizing.top=="number"&&typeof a.resizing.left=="number"?(d.top=Math.round(a.resizing.top),d.left=Math.round(a.resizing.left)):(d.top=Math.round((l+i[1])*n+c[1]),d.left=Math.round((u+i[0])*t+c[0])),d}function Ai(e,t,n,r,o){const{margin:a,cols:i,rowHeight:c,maxRows:l}=e,u=rn(e);let d=Math.round((n-a[0])/(u+a[0])),h=Math.round((t-a[1])/(c+a[1]));return d=Je(d,0,i-r),h=Je(h,0,l-o),{x:d,y:h}}function ki(e,t,n,r,o,a){const{margin:i,maxRows:c,cols:l,rowHeight:u}=e,d=rn(e);let h=Math.round((t+i[0])/(d+i[0])),f=Math.round((n+i[1])/(u+i[1])),v=Je(h,0,l-r),y=Je(f,0,c-o);return["sw","w","nw"].indexOf(a)!==-1&&(v=Je(h,0,l)),["nw","n","ne"].indexOf(a)!==-1&&(y=Je(f,0,c)),{w:v,h:y}}function Je(e,t,n){return Math.max(Math.min(e,n),t)}var on={},xo={exports:{}},Hi="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Wi=Hi,qi=Wi;function Oo(){}function Eo(){}Eo.resetWarningCache=Oo;var Bi=function(){function e(r,o,a,i,c,l){if(l!==qi){var u=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 u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Eo,resetWarningCache:Oo};return n.PropTypes=n,n};xo.exports=Bi();var qe=xo.exports,an={exports:{}},Mo={},re={},je={};Object.defineProperty(je,"__esModule",{value:!0});je.dontSetMe=Zi;je.findInArray=Gi;je.int=Ki;je.isFunction=Xi;je.isNum=Yi;function Gi(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function Xi(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function Yi(e){return typeof e=="number"&&!isNaN(e)}function Ki(e){return parseInt(e,10)}function Zi(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var ot={};Object.defineProperty(ot,"__esModule",{value:!0});ot.browserPrefixToKey=Po;ot.browserPrefixToStyle=Ji;ot.default=void 0;ot.getPrefix=Do;const bn=["Moz","Webkit","O","ms"];function Do(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<bn.length;r++)if(Po(t,bn[r])in n)return bn[r];return""}function Po(e,t){return t?"".concat(t).concat(Qi(e)):e}function Ji(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function Qi(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}ot.default=Do();Object.defineProperty(re,"__esModule",{value:!0});re.addClassName=$o;re.addEvent=ns;re.addUserSelectStyles=ps;re.createCSSTransform=cs;re.createSVGTransform=us;re.getTouch=ds;re.getTouchIdentifier=fs;re.getTranslation=rr;re.innerHeight=is;re.innerWidth=ss;re.matchesSelector=Fo;re.matchesSelectorAndParentsTo=ts;re.offsetXYFromParent=ls;re.outerHeight=os;re.outerWidth=as;re.removeClassName=jo;re.removeEvent=rs;re.removeUserSelectStyles=hs;var we=je,xr=es(ot);function No(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(No=function(r){return r?n:t})(e)}function es(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=No(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}let jt="";function Fo(e,t){return jt||(jt=(0,we.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,we.isFunction)(e[n])})),(0,we.isFunction)(e[jt])?e[jt](t):!1}function ts(e,t,n){let r=e;do{if(Fo(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function ns(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function rs(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function os(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,we.int)(n.borderTopWidth),t+=(0,we.int)(n.borderBottomWidth),t}function as(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,we.int)(n.borderLeftWidth),t+=(0,we.int)(n.borderRightWidth),t}function is(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,we.int)(n.paddingTop),t-=(0,we.int)(n.paddingBottom),t}function ss(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,we.int)(n.paddingLeft),t-=(0,we.int)(n.paddingRight),t}function ls(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),a=(e.clientX+t.scrollLeft-o.left)/n,i=(e.clientY+t.scrollTop-o.top)/n;return{x:a,y:i}}function cs(e,t){const n=rr(e,t,"px");return{[(0,xr.browserPrefixToKey)("transform",xr.default)]:n}}function us(e,t){return rr(e,t,"")}function rr(e,t,n){let{x:r,y:o}=e,a="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const i="".concat(typeof t.x=="string"?t.x:t.x+n),c="".concat(typeof t.y=="string"?t.y:t.y+n);a="translate(".concat(i,", ").concat(c,")")+a}return a}function ds(e,t){return e.targetTouches&&(0,we.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,we.findInArray)(e.changedTouches,n=>t===n.identifier)}function fs(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function ps(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
10
10
  `,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
11
- `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&$o(e.body,"react-draggable-transparent-selection")}function hs(e){if(e)try{if(e.body&&jo(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function $o(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function jo(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Le={};Object.defineProperty(Le,"__esModule",{value:!0});Le.canDragX=vs;Le.canDragY=ys;Le.createCoreData=Ss;Le.createDraggableData=bs;Le.getBoundPosition=gs;Le.getControlPosition=Cs;Le.snapToGrid=ms;var Te=je,ft=re;function gs(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:Ts(r);const o=or(e);if(typeof r=="string"){const{ownerDocument:i}=o,a=i.defaultView;let c;if(r==="parent"?c=o.parentNode:c=i.querySelector(r),!(c instanceof a.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=c,u=a.getComputedStyle(o),d=a.getComputedStyle(l);r={left:-o.offsetLeft+(0,Te.int)(d.paddingLeft)+(0,Te.int)(u.marginLeft),top:-o.offsetTop+(0,Te.int)(d.paddingTop)+(0,Te.int)(u.marginTop),right:(0,ft.innerWidth)(l)-(0,ft.outerWidth)(o)-o.offsetLeft+(0,Te.int)(d.paddingRight)-(0,Te.int)(u.marginRight),bottom:(0,ft.innerHeight)(l)-(0,ft.outerHeight)(o)-o.offsetTop+(0,Te.int)(d.paddingBottom)-(0,Te.int)(u.marginBottom)}}return(0,Te.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Te.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Te.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Te.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function ms(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function vs(e){return e.props.axis==="both"||e.props.axis==="x"}function ys(e){return e.props.axis==="both"||e.props.axis==="y"}function Cs(e,t,n){const r=typeof t=="number"?(0,ft.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=or(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,ft.offsetXYFromParent)(r||e,i,n.props.scale)}function Ss(e,t,n){const r=!(0,Te.isNum)(e.lastX),o=or(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function bs(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function Ts(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function or(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var sn={},ln={};Object.defineProperty(ln,"__esModule",{value:!0});ln.default=Rs;function Rs(){}Object.defineProperty(sn,"__esModule",{value:!0});sn.default=void 0;var Tn=ws(w),Ce=ir(We),_s=ir(ro),pe=re,Ae=Le,Rn=je,Ct=ir(ln);function ir(e){return e&&e.__esModule?e:{default:e}}function Lo(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Lo=function(r){return r?n:t})(e)}function ws(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Lo(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function ge(e,t,n){return t=Is(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Is(e){var t=xs(e,"string");return typeof t=="symbol"?t:String(t)}function xs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Oe={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let He=Oe.mouse,cn=class extends Tn.Component{constructor(){super(...arguments),ge(this,"dragging",!1),ge(this,"lastX",NaN),ge(this,"lastY",NaN),ge(this,"touchIdentifier",null),ge(this,"mounted",!1),ge(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,pe.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,pe.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,pe.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,Ae.getControlPosition)(t,o,this);if(i==null)return;const{x:a,y:c}=i,l=(0,Ae.createCoreData)(this,a,c);(0,Ct.default)("DraggableCore: handleDragStart: %j",l),(0,Ct.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,pe.addUserSelectStyles)(r),this.dragging=!0,this.lastX=a,this.lastY=c,(0,pe.addEvent)(r,He.move,this.handleDrag),(0,pe.addEvent)(r,He.stop,this.handleDragStop))}),ge(this,"handleDrag",t=>{const n=(0,Ae.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let c=r-this.lastX,l=o-this.lastY;if([c,l]=(0,Ae.snapToGrid)(this.props.grid,c,l),!c&&!l)return;r=this.lastX+c,o=this.lastY+l}const i=(0,Ae.createCoreData)(this,r,o);if((0,Ct.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),ge(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,Ae.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,u=o-this.lastY||0;[l,u]=(0,Ae.snapToGrid)(this.props.grid,l,u),r=this.lastX+l,o=this.lastY+u}const i=(0,Ae.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const c=this.findDOMNode();c&&this.props.enableUserSelectHack&&(0,pe.removeUserSelectStyles)(c.ownerDocument),(0,Ct.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,c&&((0,Ct.default)("DraggableCore: Removing handlers"),(0,pe.removeEvent)(c.ownerDocument,He.move,this.handleDrag),(0,pe.removeEvent)(c.ownerDocument,He.stop,this.handleDragStop))}),ge(this,"onMouseDown",t=>(He=Oe.mouse,this.handleDragStart(t))),ge(this,"onMouseUp",t=>(He=Oe.mouse,this.handleDragStop(t))),ge(this,"onTouchStart",t=>(He=Oe.touch,this.handleDragStart(t))),ge(this,"onTouchEnd",t=>(He=Oe.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,pe.addEvent)(t,Oe.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,pe.removeEvent)(n,Oe.mouse.move,this.handleDrag),(0,pe.removeEvent)(n,Oe.touch.move,this.handleDrag),(0,pe.removeEvent)(n,Oe.mouse.stop,this.handleDragStop),(0,pe.removeEvent)(n,Oe.touch.stop,this.handleDragStop),(0,pe.removeEvent)(t,Oe.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,pe.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:_s.default.findDOMNode(this)}render(){return Tn.cloneElement(Tn.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};sn.default=cn;ge(cn,"displayName","DraggableCore");ge(cn,"propTypes",{allowAnyClick:Ce.default.bool,children:Ce.default.node.isRequired,disabled:Ce.default.bool,enableUserSelectHack:Ce.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Ce.default.arrayOf(Ce.default.number),handle:Ce.default.string,cancel:Ce.default.string,nodeRef:Ce.default.object,onStart:Ce.default.func,onDrag:Ce.default.func,onStop:Ce.default.func,onMouseDown:Ce.default.func,scale:Ce.default.number,className:Rn.dontSetMe,style:Rn.dontSetMe,transform:Rn.dontSetMe});ge(cn,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=f(w),n=d(We),r=d(ro),o=d(ke),i=re,a=Le,c=je,l=d(sn),u=d(ln);function d(S){return S&&S.__esModule?S:{default:S}}function h(S){if(typeof WeakMap!="function")return null;var C=new WeakMap,R=new WeakMap;return(h=function(m){return m?R:C})(S)}function f(S,C){if(!C&&S&&S.__esModule)return S;if(S===null||typeof S!="object"&&typeof S!="function")return{default:S};var R=h(C);if(R&&R.has(S))return R.get(S);var m={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in S)if(M!=="default"&&Object.prototype.hasOwnProperty.call(S,M)){var I=O?Object.getOwnPropertyDescriptor(S,M):null;I&&(I.get||I.set)?Object.defineProperty(m,M,I):m[M]=S[M]}return m.default=S,R&&R.set(S,m),m}function v(){return v=Object.assign?Object.assign.bind():function(S){for(var C=1;C<arguments.length;C++){var R=arguments[C];for(var m in R)Object.prototype.hasOwnProperty.call(R,m)&&(S[m]=R[m])}return S},v.apply(this,arguments)}function y(S,C,R){return C=b(C),C in S?Object.defineProperty(S,C,{value:R,enumerable:!0,configurable:!0,writable:!0}):S[C]=R,S}function b(S){var C=x(S,"string");return typeof C=="symbol"?C:String(C)}function x(S,C){if(typeof S!="object"||S===null)return S;var R=S[Symbol.toPrimitive];if(R!==void 0){var m=R.call(S,C||"default");if(typeof m!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(S)}class _ extends t.Component{static getDerivedStateFromProps(C,R){let{position:m}=C,{prevPropsPosition:O}=R;return m&&(!O||m.x!==O.x||m.y!==O.y)?((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:m,prevPropsPosition:O}),{x:m.x,y:m.y,prevPropsPosition:{...m}}):null}constructor(C){super(C),y(this,"onDragStart",(R,m)=>{if((0,u.default)("Draggable: onDragStart: %j",m),this.props.onStart(R,(0,a.createDraggableData)(this,m))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),y(this,"onDrag",(R,m)=>{if(!this.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",m);const O=(0,a.createDraggableData)(this,m),M={x:O.x,y:O.y,slackX:0,slackY:0};if(this.props.bounds){const{x:F,y:$}=M;M.x+=this.state.slackX,M.y+=this.state.slackY;const[j,q]=(0,a.getBoundPosition)(this,M.x,M.y);M.x=j,M.y=q,M.slackX=this.state.slackX+(F-M.x),M.slackY=this.state.slackY+($-M.y),O.x=M.x,O.y=M.y,O.deltaX=M.x-this.state.x,O.deltaY=M.y-this.state.y}if(this.props.onDrag(R,O)===!1)return!1;this.setState(M)}),y(this,"onDragStop",(R,m)=>{if(!this.state.dragging||this.props.onStop(R,(0,a.createDraggableData)(this,m))===!1)return!1;(0,u.default)("Draggable: onDragStop: %j",m);const M={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:F,y:$}=this.props.position;M.x=F,M.y=$}this.setState(M)}),this.state={dragging:!1,dragged:!1,x:C.position?C.position.x:C.defaultPosition.x,y:C.position?C.position.y:C.defaultPosition.y,prevPropsPosition:{...C.position},slackX:0,slackY:0,isElementSVG:!1},C.position&&!(C.onDrag||C.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 C,R;return(C=(R=this.props)===null||R===void 0||(R=R.nodeRef)===null||R===void 0?void 0:R.current)!==null&&C!==void 0?C:r.default.findDOMNode(this)}render(){const{axis:C,bounds:R,children:m,defaultPosition:O,defaultClassName:M,defaultClassNameDragging:I,defaultClassNameDragged:F,position:$,positionOffset:j,scale:q,...T}=this.props;let E={},Z=null;const L=!!!$||this.state.dragging,B=$||O,ee={x:(0,a.canDragX)(this)&&L?this.state.x:B.x,y:(0,a.canDragY)(this)&&L?this.state.y:B.y};this.state.isElementSVG?Z=(0,i.createSVGTransform)(ee,j):E=(0,i.createCSSTransform)(ee,j);const se=(0,o.default)(m.props.className||"",M,{[I]:this.state.dragging,[F]:this.state.dragged});return t.createElement(l.default,v({},T,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(m),{className:se,style:{...m.props.style,...E},transform:Z}))}}e.default=_,y(_,"displayName","Draggable"),y(_,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),y(_,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(Mo);const{default:Vo,DraggableCore:Os}=Mo;an.exports=Vo;an.exports.default=Vo;an.exports.DraggableCore=Os;var Uo=an.exports,un={exports:{}},Ft={},ar={};ar.__esModule=!0;ar.cloneElement=Fs;var Es=Ms(w);function Ms(e){return e&&e.__esModule?e:{default:e}}function Or(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Er(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Or(Object(n),!0).forEach(function(r){Ds(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Or(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ds(e,t,n){return t=Ps(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ps(e){var t=Ns(e,"string");return typeof t=="symbol"?t:String(t)}function Ns(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fs(e,t){return t.style&&e.props.style&&(t.style=Er(Er({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),Es.default.cloneElement(e,t)}var $t={};$t.__esModule=!0;$t.resizableProps=void 0;var A=$s(We);function $s(e){return e&&e.__esModule?e:{default:e}}var js={axis:A.default.oneOf(["both","x","y","none"]),className:A.default.string,children:A.default.element.isRequired,draggableOpts:A.default.shape({allowAnyClick:A.default.bool,cancel:A.default.string,children:A.default.node,disabled:A.default.bool,enableUserSelectHack:A.default.bool,offsetParent:A.default.node,grid:A.default.arrayOf(A.default.number),handle:A.default.string,nodeRef:A.default.object,onStart:A.default.func,onDrag:A.default.func,onStop:A.default.func,onMouseDown:A.default.func,scale:A.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=A.default.number).isRequired.apply(i,n)}return A.default.number.apply(A.default,n)},handle:A.default.oneOfType([A.default.node,A.default.func]),handleSize:A.default.arrayOf(A.default.number),lockAspectRatio:A.default.bool,maxConstraints:A.default.arrayOf(A.default.number),minConstraints:A.default.arrayOf(A.default.number),onResizeStop:A.default.func,onResizeStart:A.default.func,onResize:A.default.func,resizeHandles:A.default.arrayOf(A.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:A.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=A.default.number).isRequired.apply(i,n)}return A.default.number.apply(A.default,n)}};$t.resizableProps=js;Ft.__esModule=!0;Ft.default=void 0;var St=As(w),Ls=Uo,Vs=ar,Us=$t,zs=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function zo(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(zo=function(o){return o?n:t})(e)}function As(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=zo(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function jn(){return jn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jn.apply(this,arguments)}function Hs(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Mr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function _n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Mr(Object(n),!0).forEach(function(r){ks(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mr(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ks(e,t,n){return t=Ws(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ws(e){var t=qs(e,"string");return typeof t=="symbol"?t:String(t)}function qs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bs(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ln(e,t)}function Ln(e,t){return Ln=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Ln(e,t)}var sr=function(e){Bs(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var a=this.props,c=a.minConstraints,l=a.maxConstraints,u=a.lockAspectRatio;if(!c&&!l&&!u)return[o,i];if(u){var d=this.props.width/this.props.height,h=o-this.props.width,f=i-this.props.height;Math.abs(h)>Math.abs(f*d)?i=o/d:o=i*d}var v=o,y=i,b=this.slack||[0,0],x=b[0],_=b[1];return o+=x,i+=_,c&&(o=Math.max(c[0],o),i=Math.max(c[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[x+(v-o),_+(y-i)],[o,i]},n.resizeHandler=function(o,i){var a=this;return function(c,l){var u=l.node,d=l.deltaX,h=l.deltaY;o==="onResizeStart"&&a.resetData();var f=(a.props.axis==="both"||a.props.axis==="x")&&i!=="n"&&i!=="s",v=(a.props.axis==="both"||a.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!f&&!v)){var y=i[0],b=i[i.length-1],x=u.getBoundingClientRect();if(a.lastHandleRect!=null){if(b==="w"){var _=x.left-a.lastHandleRect.left;d+=_}if(y==="n"){var S=x.top-a.lastHandleRect.top;h+=S}}a.lastHandleRect=x,b==="w"&&(d=-d),y==="n"&&(h=-h);var C=a.props.width+(f?d/a.props.transformScale:0),R=a.props.height+(v?h/a.props.transformScale:0),m=a.runConstraints(C,R);C=m[0],R=m[1];var O=C!==a.props.width||R!==a.props.height,M=typeof a.props[o]=="function"?a.props[o]:null,I=o==="onResize"&&!O;M&&!I&&(c.persist==null||c.persist(),M(c,{node:u,size:{width:C,height:R},handle:i})),o==="onResizeStop"&&a.resetData()}}},n.renderResizeHandle=function(o,i){var a=this.props.handle;if(!a)return St.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof a=="function")return a(o,i);var c=typeof a.type=="string",l=_n({ref:i},c?{}:{handleAxis:o});return St.cloneElement(a,l)},n.render=function(){var o=this,i=this.props,a=i.children,c=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var u=i.resizeHandles;i.transformScale;var d=Hs(i,zs);return(0,Vs.cloneElement)(a,_n(_n({},d),{},{className:(c?c+" ":"")+"react-resizable",children:[].concat(a.props.children,u.map(function(h){var f,v=(f=o.handleRefs[h])!=null?f:o.handleRefs[h]=St.createRef();return St.createElement(Ls.DraggableCore,jn({},l,{nodeRef:v,key:"resizableHandle-"+h,onStop:o.resizeHandler("onResizeStop",h),onStart:o.resizeHandler("onResizeStart",h),onDrag:o.resizeHandler("onResize",h)}),o.renderResizeHandle(h,v))}))}))},t}(St.Component);Ft.default=sr;sr.propTypes=Us.resizableProps;sr.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var dn={};dn.__esModule=!0;dn.default=void 0;var wn=Zs(w),Gs=Ao(We),Xs=Ao(Ft),Ys=$t,Ks=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function Ao(e){return e&&e.__esModule?e:{default:e}}function Ho(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Ho=function(o){return o?n:t})(e)}function Zs(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Ho(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Vn(){return Vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vn.apply(this,arguments)}function Dr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dr(Object(n),!0).forEach(function(r){Js(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dr(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Js(e,t,n){return t=Qs(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qs(e){var t=el(e,"string");return typeof t=="symbol"?t:String(t)}function el(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tl(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function nl(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Un(e,t)}function Un(e,t){return Un=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Un(e,t)}var ko=function(e){nl(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(c,l){var u=l.size;r.props.onResize?(c.persist==null||c.persist(),r.setState(u,function(){return r.props.onResize&&r.props.onResize(c,l)})):r.setState(u)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,a=o.handleSize;o.onResize;var c=o.onResizeStart,l=o.onResizeStop,u=o.draggableOpts,d=o.minConstraints,h=o.maxConstraints,f=o.lockAspectRatio,v=o.axis;o.width,o.height;var y=o.resizeHandles,b=o.style,x=o.transformScale,_=tl(o,Ks);return wn.createElement(Xs.default,{axis:v,draggableOpts:u,handle:i,handleSize:a,height:this.state.height,lockAspectRatio:f,maxConstraints:h,minConstraints:d,onResizeStart:c,onResize:this.onResize,onResizeStop:l,resizeHandles:y,transformScale:x,width:this.state.width},wn.createElement("div",Vn({},_,{style:Yt(Yt({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(wn.Component);dn.default=ko;ko.propTypes=Yt(Yt({},Ys.resizableProps),{},{children:Gs.default.element});un.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};un.exports.Resizable=Ft.default;un.exports.ResizableBox=dn.default;var rl=un.exports,ze={};Object.defineProperty(ze,"__esModule",{value:!0});ze.resizeHandleType=ze.resizeHandleAxesType=ze.default=void 0;var k=Wo(We),ol=Wo(w);function Wo(e){return e&&e.__esModule?e:{default:e}}const il=ze.resizeHandleAxesType=k.default.arrayOf(k.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),al=ze.resizeHandleType=k.default.oneOfType([k.default.node,k.default.func]);ze.default={className:k.default.string,style:k.default.object,width:k.default.number,autoSize:k.default.bool,cols:k.default.number,draggableCancel:k.default.string,draggableHandle:k.default.string,verticalCompact:function(e){e.verticalCompact},compactType:k.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&W.validateLayout(t,"layout")},margin:k.default.arrayOf(k.default.number),containerPadding:k.default.arrayOf(k.default.number),rowHeight:k.default.number,maxRows:k.default.number,isBounded:k.default.bool,isDraggable:k.default.bool,isResizable:k.default.bool,allowOverlap:k.default.bool,preventCollision:k.default.bool,useCSSTransforms:k.default.bool,transformScale:k.default.number,isDroppable:k.default.bool,resizeHandles:il,resizeHandle:al,onLayoutChange:k.default.func,onDragStart:k.default.func,onDrag:k.default.func,onDragStop:k.default.func,onResizeStart:k.default.func,onResize:k.default.func,onResizeStop:k.default.func,onDrop:k.default.func,droppingItem:k.default.shape({i:k.default.string.isRequired,w:k.default.number.isRequired,h:k.default.number.isRequired}),children:function(e,t){const n=e[t],r={};ol.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:k.default.any};Object.defineProperty(on,"__esModule",{value:!0});on.default=void 0;var lt=lr(w),X=lr(We),sl=Uo,ll=rl,ct=W,de=$e,Pr=ze,cl=lr(ke);function lr(e){return e&&e.__esModule?e:{default:e}}function Fe(e,t,n){return t=ul(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ul(e){var t=dl(e,"string");return typeof t=="symbol"?t:String(t)}function dl(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class cr extends lt.default.Component{constructor(){super(...arguments),Fe(this,"state",{resizing:null,dragging:null,className:""}),Fe(this,"elementRef",lt.default.createRef()),Fe(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const a={top:0,left:0},{offsetParent:c}=r;if(!c)return;const l=c.getBoundingClientRect(),u=r.getBoundingClientRect(),d=u.left/i,h=l.left/i,f=u.top/i,v=l.top/i;a.left=d-h+c.scrollLeft,a.top=f-v+c.scrollTop,this.setState({dragging:a});const{x:y,y:b}=(0,de.calcXY)(this.getPositionParams(),a.top,a.left,this.props.w,this.props.h);return o.call(this,this.props.i,y,b,{e:t,node:r,newPosition:a})}),Fe(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:a}=this.props;if(!a)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let c=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:u,i:d,w:h,h:f,containerWidth:v}=this.props,y=this.getPositionParams();if(u){const{offsetParent:C}=r;if(C){const{margin:R,rowHeight:m,containerPadding:O}=this.props,M=C.clientHeight-(0,de.calcGridItemWHPx)(f,m,R[1]);c=(0,de.clamp)(c-O[1],0,M);const I=(0,de.calcGridColWidth)(y),F=v-(0,de.calcGridItemWHPx)(h,I,R[0]);l=(0,de.clamp)(l-O[0],0,F)}}const b={top:c,left:l};this.setState({dragging:b});const{containerPadding:x}=this.props,{x:_,y:S}=(0,de.calcXY)(y,c-x[1],l-x[0],h,f);return a.call(this,d,_,S,{e:t,node:r,newPosition:b})}),Fe(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:a,i:c,containerPadding:l}=this.props,{left:u,top:d}=this.state.dragging,h={top:d,left:u};this.setState({dragging:null});const{x:f,y:v}=(0,de.calcXY)(this.getPositionParams(),d-l[1],u-l[0],i,a);return o.call(this,c,f,v,{e:t,node:r,newPosition:h})}),Fe(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Fe(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Fe(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,de.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,de.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,ct.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,a=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(a){const c=n.left-i.left,l=n.top-i.top;this.onDrag(n.e,{node:r,deltaX:c,deltaY:l})}}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:n,containerWidth:r,useCSSTransforms:o}=this.props;let i;return o?i=(0,ct.setTransform)(t):(i=(0,ct.setTopLeft)(t),n&&(i.left=(0,ct.perc)(t.left/r),i.width=(0,ct.perc)(t.width/r))),i}mixinDraggable(t,n){return lt.default.createElement(sl.DraggableCore,{disabled:!n,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,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:a,maxW:c,maxH:l,transformScale:u,resizeHandles:d,resizeHandle:h}=this.props,f=this.getPositionParams(),v=(0,de.calcGridItemPosition)(f,0,0,o,0).width,y=(0,de.calcGridItemPosition)(f,0,0,i,a),b=(0,de.calcGridItemPosition)(f,0,0,c,l),x=[y.width,y.height],_=[Math.min(b.width,v),Math.min(b.height,1/0)];return lt.default.createElement(ll.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:_,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:u,resizeHandles:d,handle:h},t)}onResizeHandler(t,n,r,o){let{node:i,size:a,handle:c}=n;const l=this.props[o];if(!l)return;const{x:u,y:d,i:h,maxH:f,minH:v,containerWidth:y}=this.props,{minW:b,maxW:x}=this.props;let _=a;i&&(_=(0,ct.resizeItemInDirection)(c,r,a,y),this.setState({resizing:o==="onResizeStop"?null:_}));let{w:S,h:C}=(0,de.calcWH)(this.getPositionParams(),_.width,_.height,u,d,c);S=(0,de.clamp)(S,Math.max(b,1),x),C=(0,de.clamp)(C,v,f),l.call(this,h,S,C,{e:t,node:i,size:_,handle:c})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:a,droppingPosition:c,useCSSTransforms:l}=this.props,u=(0,de.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),d=lt.default.Children.only(this.props.children);let h=lt.default.cloneElement(d,{ref:this.elementRef,className:(0,cl.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!c,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(u)}});return h=this.mixinResizable(h,u,a),h=this.mixinDraggable(h,i),h}}on.default=cr;Fe(cr,"propTypes",{children:X.default.element,cols:X.default.number.isRequired,containerWidth:X.default.number.isRequired,rowHeight:X.default.number.isRequired,margin:X.default.array.isRequired,maxRows:X.default.number.isRequired,containerPadding:X.default.array.isRequired,x:X.default.number.isRequired,y:X.default.number.isRequired,w:X.default.number.isRequired,h:X.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:X.default.string.isRequired,resizeHandles:Pr.resizeHandleAxesType,resizeHandle:Pr.resizeHandleType,onDragStop:X.default.func,onDragStart:X.default.func,onDrag:X.default.func,onResizeStop:X.default.func,onResizeStart:X.default.func,onResize:X.default.func,isDraggable:X.default.bool.isRequired,isResizable:X.default.bool.isRequired,isBounded:X.default.bool.isRequired,static:X.default.bool,useCSSTransforms:X.default.bool.isRequired,transformScale:X.default.number,className:X.default.string,handle:X.default.string,cancel:X.default.string,droppingPosition:X.default.shape({e:X.default.object.isRequired,left:X.default.number.isRequired,top:X.default.number.isRequired})});Fe(cr,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(Nt,"__esModule",{value:!0});Nt.default=void 0;var Ge=gl(w),In=Gn,fl=ur(ke),V=W,pl=$e,Nr=ur(on),hl=ur(ze);function ur(e){return e&&e.__esModule?e:{default:e}}function qo(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(qo=function(r){return r?n:t})(e)}function gl(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=qo(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function he(e,t,n){return t=ml(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ml(e){var t=vl(e,"string");return typeof t=="symbol"?t:String(t)}function vl(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Fr="react-grid-layout";let Bo=!1;try{Bo=/firefox/i.test(navigator.userAgent)}catch{}class fn extends Ge.Component{constructor(){super(...arguments),he(this,"state",{activeDrag:null,layout:(0,V.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,V.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),he(this,"dragEnterCounter",0),he(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:c}=this.state,l=(0,V.getLayoutItem)(c,t);if(!l)return;const u={w:l.w,h:l.h,x:l.x,y:l.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,V.cloneLayoutItem)(l),oldLayout:c,activeDrag:u}),this.props.onDragStart(c,l,l,null,i,a)}),he(this,"onDrag",(t,n,r,o)=>{let{e:i,node:a}=o;const{oldDragItem:c}=this.state;let{layout:l}=this.state;const{cols:u,allowOverlap:d,preventCollision:h}=this.props,f=(0,V.getLayoutItem)(l,t);if(!f)return;const v={w:f.w,h:f.h,x:f.x,y:f.y,placeholder:!0,i:t};l=(0,V.moveElement)(l,f,n,r,!0,h,(0,V.compactType)(this.props),u,d),this.props.onDrag(l,c,f,v,i,a),this.setState({layout:d?l:(0,V.compact)(l,(0,V.compactType)(this.props),u),activeDrag:v})}),he(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:a}=o;if(!this.state.activeDrag)return;const{oldDragItem:c}=this.state;let{layout:l}=this.state;const{cols:u,preventCollision:d,allowOverlap:h}=this.props,f=(0,V.getLayoutItem)(l,t);if(!f)return;l=(0,V.moveElement)(l,f,n,r,!0,d,(0,V.compactType)(this.props),u,h);const y=h?l:(0,V.compact)(l,(0,V.compactType)(this.props),u);this.props.onDragStop(y,c,f,null,i,a);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:y,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(y,b)}),he(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:c}=this.state,l=(0,V.getLayoutItem)(c,t);l&&(this.setState({oldResizeItem:(0,V.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(c,l,l,null,i,a))}),he(this,"onResize",(t,n,r,o)=>{let{e:i,node:a,size:c,handle:l}=o;const{oldResizeItem:u}=this.state,{layout:d}=this.state,{cols:h,preventCollision:f,allowOverlap:v}=this.props;let y=!1,b,x,_;const[S,C]=(0,V.withLayoutItem)(d,t,m=>{let O;return x=m.x,_=m.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=m.x+(m.w-n),n=m.x!==x&&x<0?m.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(_=m.y+(m.h-r),r=m.y!==_&&_<0?m.h:r,_=_<0?0:_),y=!0),f&&!v&&(O=(0,V.getAllCollisions)(d,{...m,w:n,h:r,x,y:_}).filter(I=>I.i!==m.i).length>0,O&&(_=m.y,r=m.h,x=m.x,n=m.w,y=!1)),m.w=n,m.h=r,m});if(!C)return;b=S,y&&(b=(0,V.moveElement)(S,C,x,_,!0,this.props.preventCollision,(0,V.compactType)(this.props),h,v));const R={w:C.w,h:C.h,x:C.x,y:C.y,static:!0,i:t};this.props.onResize(b,u,C,R,i,a),this.setState({layout:v?b:(0,V.compact)(b,(0,V.compactType)(this.props),h),activeDrag:R})}),he(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:a}=o;const{layout:c,oldResizeItem:l}=this.state,{cols:u,allowOverlap:d}=this.props,h=(0,V.getLayoutItem)(c,t),f=d?c:(0,V.compact)(c,(0,V.compactType)(this.props),u);this.props.onResizeStop(f,l,h,null,i,a);const{oldLayout:v}=this.state;this.setState({activeDrag:null,layout:f,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(f,v)}),he(this,"onDragOver",t=>{var S;if(t.preventDefault(),t.stopPropagation(),Bo&&!((S=t.nativeEvent.target)!=null&&S.classList.contains(Fr)))return!1;const{droppingItem:n,onDropDragOver:r,margin:o,cols:i,rowHeight:a,maxRows:c,width:l,containerPadding:u,transformScale:d}=this.props,h=r==null?void 0:r(t);if(h===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const f={...n,...h},{layout:v}=this.state,y=t.currentTarget.getBoundingClientRect(),b=t.clientX-y.left,x=t.clientY-y.top,_={left:b/d,top:x/d,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:C,top:R}=this.state.droppingPosition;(C!=b||R!=x)&&this.setState({droppingPosition:_})}}else{const C={cols:i,margin:o,maxRows:c,rowHeight:a,containerWidth:l,containerPadding:u||o},R=(0,pl.calcXY)(C,x,b,f.w,f.h);this.setState({droppingDOMNode:Ge.createElement("div",{key:f.i}),droppingPosition:_,layout:[...v,{...f,x:R.x,y:R.y,static:!1,isDraggable:!0}]})}}),he(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,V.compact)(r.filter(i=>i.i!==t.i),(0,V.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),he(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),he(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),he(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,In.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,V.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,V.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,V.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,V.fastRGLPropsEqual)(this.props,t,In.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,V.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,In.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:a,maxRows:c,useCSSTransforms:l,transformScale:u}=this.props;return Ge.createElement(Nr.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:c,rowHeight:a,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:u},Ge.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,V.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:a,containerPadding:c,rowHeight:l,maxRows:u,isDraggable:d,isResizable:h,isBounded:f,useCSSTransforms:v,transformScale:y,draggableCancel:b,draggableHandle:x,resizeHandles:_,resizeHandle:S}=this.props,{mounted:C,droppingPosition:R}=this.state,m=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&d,O=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&h,M=r.resizeHandles||_,I=m&&f&&r.isBounded!==!1;return Ge.createElement(Nr.default,{containerWidth:o,cols:i,margin:a,containerPadding:c||a,maxRows:u,rowHeight:l,cancel:b,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:m,isResizable:O,isBounded:I,useCSSTransforms:v&&C,usePercentages:!C,transformScale:y,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?R:void 0,resizeHandles:M,resizeHandle:S},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,fl.default)(Fr,t),a={height:this.containerHeight(),...n};return Ge.createElement("div",{ref:o,className:i,style:a,onDrop:r?this.onDrop:V.noop,onDragLeave:r?this.onDragLeave:V.noop,onDragEnter:r?this.onDragEnter:V.noop,onDragOver:r?this.onDragOver:V.noop},Ge.Children.map(this.props.children,c=>this.processGridItem(c)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}Nt.default=fn;he(fn,"displayName","ReactGridLayout");he(fn,"propTypes",hl.default);he(fn,"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:V.noop,onDragStart:V.noop,onDrag:V.noop,onDragStop:V.noop,onResizeStart:V.noop,onResize:V.noop,onResizeStop:V.noop,onDrop:V.noop,onDropDragOver:V.noop});var pn={},it={};Object.defineProperty(it,"__esModule",{value:!0});it.findOrGenerateResponsiveLayout=Sl;it.getBreakpointFromWidth=yl;it.getColsFromBreakpoint=Cl;it.sortBreakpoints=dr;var Lt=W;function yl(e,t){const n=dr(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const a=n[o];t>e[a]&&(r=a)}return r}function Cl(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function Sl(e,t,n,r,o,i){if(e[n])return(0,Lt.cloneLayout)(e[n]);let a=e[r];const c=dr(t),l=c.slice(c.indexOf(n));for(let u=0,d=l.length;u<d;u++){const h=l[u];if(e[h]){a=e[h];break}}return a=(0,Lt.cloneLayout)(a||[]),(0,Lt.compact)((0,Lt.correctBounds)(a,{cols:o}),i,o)}function dr(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(pn,"__esModule",{value:!0});pn.default=void 0;var $r=Tl(w),Se=Go(We),xn=Gn,pt=W,Xe=it,bl=Go(Nt);function Go(e){return e&&e.__esModule?e:{default:e}}function Xo(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Xo=function(r){return r?n:t})(e)}function Tl(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Xo(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function zn(){return zn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zn.apply(this,arguments)}function Kt(e,t,n){return t=Rl(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rl(e){var t=_l(e,"string");return typeof t=="symbol"?t:String(t)}function _l(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const jr=e=>Object.prototype.toString.call(e);function Vt(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class fr extends $r.Component{constructor(){super(...arguments),Kt(this,"state",this.generateInitialState()),Kt(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,Xe.getBreakpointFromWidth)(n,t),a=(0,Xe.getColsFromBreakpoint)(i,o),c=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Xe.findOrGenerateResponsiveLayout)(r,n,i,i,a,c),breakpoint:i,cols:a}}static getDerivedStateFromProps(t,n){if(!(0,xn.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,Xe.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,xn.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,xn.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,a=this.props.breakpoint||(0,Xe.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),c=this.state.breakpoint,l=(0,Xe.getColsFromBreakpoint)(a,r),u={...o};if(c!==a||t.breakpoints!==n||t.cols!==r){c in u||(u[c]=(0,pt.cloneLayout)(this.state.layout));let f=(0,Xe.findOrGenerateResponsiveLayout)(u,n,a,c,l,i);f=(0,pt.synchronizeLayoutWithChildren)(f,this.props.children,l,i,this.props.allowOverlap),u[a]=f,this.props.onLayoutChange(f,u),this.props.onBreakpointChange(a,l),this.setState({breakpoint:a,layout:f,cols:l})}const d=Vt(this.props.margin,a),h=Vt(this.props.containerPadding,a);this.props.onWidthChange(this.props.width,d,l,h)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:a,onBreakpointChange:c,onLayoutChange:l,onWidthChange:u,...d}=this.props;return $r.createElement(bl.default,zn({},d,{margin:Vt(i,this.state.breakpoint),containerPadding:Vt(a,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}pn.default=fr;Kt(fr,"propTypes",{breakpoint:Se.default.string,breakpoints:Se.default.object,allowOverlap:Se.default.bool,cols:Se.default.object,margin:Se.default.oneOfType([Se.default.array,Se.default.object]),containerPadding:Se.default.oneOfType([Se.default.array,Se.default.object]),layouts(e,t){if(jr(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+jr(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,pt.validateLayout)(e.layouts[n],"layouts."+n)})},width:Se.default.number.isRequired,onBreakpointChange:Se.default.func,onLayoutChange:Se.default.func,onWidthChange:Se.default.func});Kt(fr,"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:pt.noop,onLayoutChange:pt.noop,onWidthChange:pt.noop});var pr={},Yo=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var a=i[o];n.call(r,a[1],a[0])}},t}()}(),An=typeof window<"u"&&typeof document<"u"&&window.document===document,Zt=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")()}(),wl=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Zt):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),Il=2;function xl(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&c()}function a(){wl(i)}function c(){var l=Date.now();if(n){if(l-o<Il)return;r=!0}else n=!0,r=!1,setTimeout(a,t);o=l}return c}var Ol=20,El=["top","right","bottom","left","width","height","size","weight"],Ml=typeof MutationObserver<"u",Dl=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=xl(this.refresh.bind(this),Ol)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!An||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Ml?(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)},e.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)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=El.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Ko=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},ht=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Zt},Zo=hn(0,0,0,0);function Jt(e){return parseFloat(e)||0}function Lr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+Jt(i)},0)}function Pl(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],a=e["padding-"+i];n[i]=Jt(a)}return n}function Nl(e){var t=e.getBBox();return hn(0,0,t.width,t.height)}function Fl(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Zo;var r=ht(e).getComputedStyle(e),o=Pl(r),i=o.left+o.right,a=o.top+o.bottom,c=Jt(r.width),l=Jt(r.height);if(r.boxSizing==="border-box"&&(Math.round(c+i)!==t&&(c-=Lr(r,"left","right")+i),Math.round(l+a)!==n&&(l-=Lr(r,"top","bottom")+a)),!jl(e)){var u=Math.round(c+i)-t,d=Math.round(l+a)-n;Math.abs(u)!==1&&(c-=u),Math.abs(d)!==1&&(l-=d)}return hn(o.left,o.top,c,l)}var $l=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof ht(e).SVGGraphicsElement}:function(e){return e instanceof ht(e).SVGElement&&typeof e.getBBox=="function"}}();function jl(e){return e===ht(e).document.documentElement}function Ll(e){return An?$l(e)?Nl(e):Fl(e):Zo}function Vl(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,a=Object.create(i.prototype);return Ko(a,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),a}function hn(e,t,n,r){return{x:e,y:t,width:n,height:r}}var Ul=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=hn(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=Ll(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),zl=function(){function e(t,n){var r=Vl(n);Ko(this,{target:t,contentRect:r})}return e}(),Al=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new Yo,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ht(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new Ul(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ht(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new zl(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Jo=typeof WeakMap<"u"?new WeakMap:new Yo,Qo=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Dl.getInstance(),r=new Al(t,n,this);Jo.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Qo.prototype[e]=function(){var t;return(t=Jo.get(this))[e].apply(t,arguments)}});var Hl=function(){return typeof Zt.ResizeObserver<"u"?Zt.ResizeObserver:Qo}();const kl=Object.freeze(Object.defineProperty({__proto__:null,default:Hl},Symbol.toStringTag,{value:"Module"})),Wl=Zi(kl);Object.defineProperty(pr,"__esModule",{value:!0});pr.default=Jl;var Ut=Xl(w),ql=hr(We),Bl=hr(Wl),Gl=hr(ke);function hr(e){return e&&e.__esModule?e:{default:e}}function ei(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ei=function(r){return r?n:t})(e)}function Xl(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ei(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Hn(){return Hn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hn.apply(this,arguments)}function ut(e,t,n){return t=Yl(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yl(e){var t=Kl(e,"string");return typeof t=="symbol"?t:String(t)}function Kl(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Zl="react-grid-layout";function Jl(e){var t;return t=class extends Ut.Component{constructor(){super(...arguments),ut(this,"state",{width:1280}),ut(this,"elementRef",Ut.createRef()),ut(this,"mounted",!1),ut(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new Bl.default(o=>{if(this.elementRef.current instanceof HTMLElement){const a=o[0].contentRect.width;this.setState({width:a})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?Ut.createElement("div",{className:(0,Gl.default)(this.props.className,Zl),style:this.props.style,ref:this.elementRef}):Ut.createElement(e,Hn({innerRef:this.elementRef},o,this.state))}},ut(t,"defaultProps",{measureBeforeMount:!1}),ut(t,"propTypes",{measureBeforeMount:ql.default.bool}),t}(function(e){e.exports=Nt.default,e.exports.utils=W,e.exports.calculateUtils=$e,e.exports.Responsive=pn.default,e.exports.Responsive.utils=it,e.exports.WidthProvider=pr.default})(go);var Ql=go.exports;const ec=Bn(Ql),kn={type:g.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(e,t){if(!t)return!1;const n=e.get(g.IUndoRedoService),r=e.get(g.ICommandService),o=e.get(g.IUniverInstanceService),i=H.getSheetCommandTarget(o,t);if(!i)return!1;const{unitId:a,subUnitId:c}=i,l={unitId:a,subUnitId:c,cfId:t.cfId},u=s.DeleteConditionalRuleMutationUndoFactory(e,l),d=r.syncExecuteCommand(s.DeleteConditionalRuleMutation.id,l);return d&&n.pushUndoRedo({unitID:a,undoMutations:u,redoMutations:[{id:s.DeleteConditionalRuleMutation.id,params:l}]}),d}},ti={type:g.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(e,t){if(!t)return!1;const n=e.get(g.IUndoRedoService),r=e.get(g.ICommandService),o=e.get(g.IUniverInstanceService),i=e.get(s.ConditionalFormattingRuleModel),a=H.getSheetCommandTarget(o,t);if(!a)return!1;const{unitId:c,subUnitId:l}=a,u=s.transformSupportSymmetryAnchor(t.start,t.end,i.getSubunitRules(c,l)||[],b=>b.cfId);if(!u)return!1;const[d,h]=u,f={unitId:c,subUnitId:l,start:d,end:h},v=s.MoveConditionalRuleMutationUndoFactory(f),y=r.syncExecuteCommand(s.MoveConditionalRuleMutation.id,f);return y&&n.pushUndoRedo({unitID:c,redoMutations:[{id:s.MoveConditionalRuleMutation.id,params:f}],undoMutations:v}),y}},tc="univer-cf-preview",zt={cfPreview:tc},gt=e=>{var o,i;const t=e.rule;if(!t)return null;const n=w.useMemo(()=>{if(t.type===s.CFRuleType.colorScale){const a=t.config.map((u,d)=>({color:new g.ColorKit(u.color),value:d})),c=a.length-1;return new Array(5).fill("").map((u,d,h)=>d*c/(h.length-1)).map(u=>s.getColorScaleFromValue(a,u))}return null},[t]),r=w.useMemo(()=>{if(t.type===s.CFRuleType.iconSet)return t.config.map(a=>{const c=s.iconMap[a.iconType];return c&&c[Number(a.iconId)]})},[t]);switch(t.type){case s.CFRuleType.dataBar:{const{isGradient:a}=t.config,c={width:"50%",height:"100%"},l=a?`linear-gradient(to right, ${t.config.positiveColor}, rgb(255 255 255))`:t.config.positiveColor,u=a?`linear-gradient(to right, rgb(255 255 255),${t.config.nativeColor})`:t.config.nativeColor;return p.jsxs("div",{className:zt.cfPreview,children:[p.jsx("div",{style:{...c,background:u,border:`1px solid ${t.config.nativeColor}`}}),p.jsx("div",{style:{...c,background:l,border:`1px solid ${t.config.positiveColor}`}})]})}case s.CFRuleType.colorScale:return n&&p.jsx("div",{className:zt.cfPreview,children:n.map((a,c)=>p.jsx("div",{style:{width:`${100/n.length}%`,height:"100%",background:a}},c))});case s.CFRuleType.iconSet:return r&&p.jsx("div",{className:zt.cfPreview,children:r.map((a,c)=>a?p.jsx("img",{style:{height:"100%"},src:a},c):p.jsx(en,{},c))});case s.CFRuleType.highlightCell:{const{ul:a,st:c,it:l,bl:u,bg:d,cl:h}=t.style,f=(a==null?void 0:a.s)===g.BooleanNumber.TRUE,v=(c==null?void 0:c.s)===g.BooleanNumber.TRUE,y=l===g.BooleanNumber.TRUE,b=u===g.BooleanNumber.TRUE,x=(o=d==null?void 0:d.rgb)!=null?o:s.DEFAULT_BG_COLOR,_=(i=h==null?void 0:h.rgb)!=null?i:s.DEFAULT_FONT_COLOR,S={fontWeight:b?"bold":void 0,fontStyle:y?"italic":void 0,textDecoration:`${f?"underline":""} ${v?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:x,color:_};return p.jsx("div",{style:S,className:zt.cfPreview,children:"123"})}}return null},nc={sheet:{cf:{title:"Conditional Formatting",menu:{manageConditionalFormatting:"Manage Conditional Formatting",createConditionalFormatting:"Create Conditional Formatting",clearRangeRules:"Clear Rules for Selected Range",clearWorkSheetRules:"Clear Rules for Entire Sheet"},form:{lessThan:"The value must be less than {0}",lessThanOrEqual:"The value must be less than or equal to {0}",greaterThan:"The value must be greater than {0}",greaterThanOrEqual:"The value must be greater than or equal to {0}",rangeSelector:"Select Range or Enter Value"},iconSet:{direction:"Direction",shape:"Shape",mark:"Mark",rank:"Rank",rule:"Rule",icon:"Icon",type:"Type",value:"Value",reverseIconOrder:"Reverse Icon Order",and:"And",when:"When",onlyShowIcon:"Only Show Icon"},symbol:{greaterThan:">",greaterThanOrEqual:">=",lessThan:"<",lessThanOrEqual:"<="},panel:{createRule:"Create Rule",clear:"Clear All Rules",range:"Apply Range",styleType:"Style Type",submit:"Submit",cancel:"Cancel",rankAndAverage:"Top/Bottom/Average",styleRule:"Style Rule",isNotBottom:"Top",isBottom:"Bottom",greaterThanAverage:"Greater Than Average",lessThanAverage:"Less Than Average",medianValue:"Median Value",fillType:"Fill Type",pureColor:"Solid Color",gradient:"Gradient",colorSet:"Color Set",positive:"Positive",native:"Negative",workSheet:"Entire Sheet",selectedRange:"Selected Range",managerRuleSelect:"Manage {0} Rules",onlyShowDataBar:"Only Show Data Bars"},preview:{describe:{beginsWith:"Begins with {0}",endsWith:"Ends with {0}",containsText:"Text contains {0}",notContainsText:"Text does not contain {0}",equal:"Equal to {0}",notEqual:"Not equal to {0}",containsBlanks:"Contains Blanks",notContainsBlanks:"Does not contain Blanks",containsErrors:"Contains Errors",notContainsErrors:"Does not contain Errors",greaterThan:"Greater than {0}",greaterThanOrEqual:"Greater than or equal to {0}",lessThan:"Less than {0}",lessThanOrEqual:"Less than or equal to {0}",notBetween:"Not between {0} and {1}",between:"Between {0} and {1}",yesterday:"Yesterday",tomorrow:"Tomorrow",last7Days:"Last 7 Days",thisMonth:"This Month",lastMonth:"Last Month",nextMonth:"Next Month",thisWeek:"This Week",lastWeek:"Last Week",nextWeek:"Next Week",today:"Today",topN:"Top {0}",bottomN:"Bottom {0}",topNPercent:"Top {0}%",bottomNPercent:"Bottom {0}%"}},operator:{beginsWith:"Begins with",endsWith:"Ends with",containsText:"Text contains",notContainsText:"Text does not contain",equal:"Equal to",notEqual:"Not equal to",containsBlanks:"Contains Blanks",notContainsBlanks:"Does not contain Blanks",containsErrors:"Contains Errors",notContainsErrors:"Does not contain Errors",greaterThan:"Greater than",greaterThanOrEqual:"Greater than or equal to",lessThan:"Less than",lessThanOrEqual:"Less than or equal to",notBetween:"Not between",between:"Between",yesterday:"Yesterday",tomorrow:"Tomorrow",last7Days:"Last 7 Days",thisMonth:"This Month",lastMonth:"Last Month",nextMonth:"Next Month",thisWeek:"This Week",lastWeek:"Last Week",nextWeek:"Next Week",today:"Today"},ruleType:{highlightCell:"Highlight Cell",dataBar:"Data Bar",colorScale:"Color Scale",formula:"Custom Formula",iconSet:"Icon Set",duplicateValues:"Duplicate Values",uniqueValues:"Unique Values"},subRuleType:{uniqueValues:"Unique Values",duplicateValues:"Duplicate Values",rank:"Rank",text:"Text",timePeriod:"Time Period",number:"Number",average:"Average"},valueType:{num:"Number",min:"Minimum",max:"Maximum",percent:"Percentage",percentile:"Percentile",formula:"Formula",none:"None"}}}},rc=nc,oc={sheet:{cf:{title:"条件格式",menu:{manageConditionalFormatting:"管理条件格式",createConditionalFormatting:"新建条件格式",clearRangeRules:"清除所选区域的规则",clearWorkSheetRules:"清除整个工作表的规则"},form:{lessThan:"该值必须小于 {0}",lessThanOrEqual:"该值必须小于等于 {0}",greaterThan:"该值必大于 {0}",greaterThanOrEqual:"该值必大于等于 {0}",rangeSelector:"选择范围或者输入值"},iconSet:{direction:"方向",shape:"形状",mark:"标记",rank:"等级",rule:"规则",icon:"图标",type:"类型",value:"值",reverseIconOrder:"反转图标次序",and:"且",when:"当值",onlyShowIcon:"仅显示图标"},symbol:{greaterThan:">",greaterThanOrEqual:">=",lessThan:"<",lessThanOrEqual:"<="},panel:{createRule:"新增规则",clear:"清空所有规则",range:"应用范围",styleType:"样式类型",submit:"确认",cancel:"取消",rankAndAverage:"最前/最后/平均值",styleRule:"样式规则",isNotBottom:"最前",isBottom:"最后",greaterThanAverage:"大于平均值",lessThanAverage:"小于平均值",medianValue:"中间值",fillType:"填充方式",pureColor:"纯色",gradient:"渐变",colorSet:"颜色设置",positive:"正值",native:"负值",workSheet:"整张工作表",selectedRange:"所选单元格",managerRuleSelect:"管理 {0} 的规则",onlyShowDataBar:"仅显示数据条"},preview:{describe:{beginsWith:"开头为{0}",endsWith:"结尾为{0}",containsText:"文本包含{0}",notContainsText:"文本不包含{0}",equal:"等于{0}",notEqual:"不等于{0}",containsBlanks:"为空",notContainsBlanks:"不为空",containsErrors:"错误",notContainsErrors:"非错误",greaterThan:"大于{0}",greaterThanOrEqual:"大于等于{0}",lessThan:"小于{0}",lessThanOrEqual:"小于等于{0}",notBetween:"不介于{0}和{1}之间",between:"介于{0}和{1}之间",yesterday:"昨日",tomorrow:"明日",last7Days:"最近7天",thisMonth:"本月",lastMonth:"上个月",nextMonth:"下个月",thisWeek:"本周",lastWeek:"上周",nextWeek:"下周",today:"今日",topN:"前{0}项",bottomN:"后{0}项",topNPercent:"前{0}%",bottomNPercent:"后{0}%"}},operator:{beginsWith:"开头为",endsWith:"结尾为",containsText:"文本包含",notContainsText:"文本不包含",equal:"等于",notEqual:"不等于",containsBlanks:"为空",notContainsBlanks:"不为空",containsErrors:"错误",notContainsErrors:"非错误",greaterThan:"大于",greaterThanOrEqual:"大于等于",lessThan:"小于",lessThanOrEqual:"小于等于",notBetween:"不介于",between:"介于",yesterday:"昨日",tomorrow:"明日",last7Days:"最近 7 天",thisMonth:"本月",lastMonth:"上个月",nextMonth:"下个月",thisWeek:"本周",lastWeek:"上周",nextWeek:"下周",today:"今日"},ruleType:{highlightCell:"突出显示单元格",dataBar:"数据条",colorScale:"色阶",formula:"自定义公式",iconSet:"图标集",duplicateValues:"重复值",uniqueValues:"唯一值"},subRuleType:{uniqueValues:"唯一值",duplicateValues:"重复值",rank:"最前最后",text:"文本",timePeriod:"时间日期",number:"数值",average:"平均值"},valueType:{num:"数值",min:"最小值",max:"最大值",percent:"百分比",percentile:"百分点",formula:"公式",none:"无"}}}},ni=oc;var ic=Object.defineProperty,ac=Object.getOwnPropertyDescriptor,sc=(e,t,n,r)=>{for(var o=r>1?void 0:r?ac(t,n):t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=(r?a(t,n,o):a(o))||o);return r&&o&&ic(t,n,o),o},lc=(e,t)=>(n,r)=>t(n,r,e);let Et=class extends g.Disposable{constructor(t){super();Be(this,"_initLocal",()=>{this._localeService.load({zhCN:ni})});Be(this,"_findReplaceIndex",t=>{const n=/\{([^}]+)?\}/g,r=[];let o=n.exec(t);for(;o;)r.push({startIndex:o.index,key:Number(o[1]),endIndex:o.index+o[0].length-1}),o=n.exec(t);return r});this._localeService=t,this._initLocal()}tWithReactNode(t,...n){const r=this._localeService.getLocales(),o=t.split("."),i=r&&this._localeService.resolveKeyPath(r,o);if(typeof i=="string"){const a=[];return this._findReplaceIndex(i).forEach((c,l,u)=>{const d=u[l-1]||{startIndex:0,endIndex:-1};if(d.endIndex+1<c.startIndex){const h=i.slice(d.endIndex+1,c.startIndex);h&&a.push(h)}if(n[c.key]&&a.push(n[c.key]),l===u.length-1){const h=i.slice(c.endIndex+1);h&&a.push(h)}}),a}return[]}};Et=sc([g.OnLifecycle(g.LifecycleStages.Rendered,Et),lc(0,z.Inject(g.LocaleService))],Et);const cc=(e=[])=>{const t=te.useDependency(ce.IMarkSelectionService);w.useEffect(()=>{const n=e.map(r=>t.addShape({range:r,style:{hasAutoFill:!1,fill:"rgba(73, 184, 17, 0.05)",strokeWidth:1,stroke:"#49B811",widgets:{}},primary:{startColumn:r.startColumn,endColumn:r.endColumn,startRow:r.startRow,endRow:r.endRow,actualRow:r.startRow,actualColumn:r.startColumn,isMerged:!1,isMergedMainCell:!1}}));return()=>{n.forEach(r=>{r&&t.removeShape(r)})}},[e])},uc="univer-cf-rule-list",dc="univer-rule-selector",fc="univer-select",pc="univer-select-selector",hc="univer-select-selection-item",gc="univer-select-selection-search-input",mc="univer-btn-list",vc="univer-gap",yc="univer-icon",Cc="univer-disabled",Sc="univer-rule-item",bc="univer-rule-describe",Tc="univer-rule-type",Rc="univer-rule-range",_c="univer-active",wc="univer-draggableHandle",Ic="univer-delete-item",xc="univer-grid-layout-wrap",Oc="univer-react-grid-item",le={cfRuleList:uc,ruleSelector:dc,select:fc,selectSelector:pc,selectSelectionItem:hc,selectSelectionSearchInput:gc,btnList:mc,gap:vc,icon:yc,disabled:Cc,ruleItem:Sc,ruleDescribe:bc,ruleType:Tc,ruleRange:Rc,active:_c,draggableHandle:wc,deleteItem:Ic,gridLayoutWrap:xc,reactGridItem:Oc},Ec=(e,t)=>{const n=e.rule;switch(n.type){case s.CFRuleType.colorScale:return t.t("sheet.cf.ruleType.colorScale");case s.CFRuleType.dataBar:return t.t("sheet.cf.ruleType.dataBar");case s.CFRuleType.iconSet:return t.t("sheet.cf.ruleType.iconSet");case s.CFRuleType.highlightCell:switch(n.subType){case s.CFSubRuleType.average:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,t.t("sheet.cf.subRuleType.average"))}case s.CFSubRuleType.duplicateValues:return t.t("sheet.cf.subRuleType.duplicateValues");case s.CFSubRuleType.uniqueValues:return t.t("sheet.cf.subRuleType.uniqueValues");case s.CFSubRuleType.number:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,...Array.isArray(n.value)?n.value.map(o=>String(o)):[String(n.value||"")])}case s.CFSubRuleType.text:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,n.value||"")}case s.CFSubRuleType.timePeriod:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`)}case s.CFSubRuleType.rank:return n.isPercent?n.isBottom?t.t("sheet.cf.preview.describe.bottomNPercent",String(n.value)):t.t("sheet.cf.preview.describe.topNPercent",String(n.value)):n.isBottom?t.t("sheet.cf.preview.describe.bottomN",String(n.value)):t.t("sheet.cf.preview.describe.topN",String(n.value));case s.CFSubRuleType.formula:return t.t("sheet.cf.ruleType.formula")}}};let Vr=0;const Mc=e=>{const{onClick:t}=e,n=te.useDependency(s.ConditionalFormattingRuleModel),r=te.useDependency(g.IUniverInstanceService),o=te.useDependency(H.SelectionManagerService),i=te.useDependency(g.ICommandService),a=te.useDependency(g.LocaleService),c=te.useDependency(Et),l=r.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET),u=l.getUnitId(),h=l.getActiveSheet().getSheetId(),[f,v]=w.useState([]),[y,b]=w.useState("2"),[x,_]=w.useState(0),[S,C]=w.useState(-1),[R,m]=w.useState(Vr),O=w.useRef(null),M=[{label:a.t("sheet.cf.panel.workSheet"),value:"2"},{label:a.t("sheet.cf.panel.selectedRange"),value:"1"}],I=()=>{const L=n.getSubunitRules(u,h);if(!L||!L.length)return[];if(y==="1"){const B=o.getLast();if(!B)return[];const ee=B.range;return L.filter(fe=>fe.ranges.some(ve=>g.Rectangle.intersects(ve,ee)))}else if(y==="2")return L;return[]},[F,$]=w.useState(I);cc(f),w.useEffect(()=>{const L=i.onCommandExecuted(B=>{B.id===H.SetWorksheetActiveOperation.id&&_(Math.random())});return()=>L.dispose()}),w.useEffect(()=>{$(I)},[y,x,u,h]),w.useEffect(()=>{if(y==="2")return;const L=new _e.Observable(B=>{const ee=[H.SetSelectionsOperation.id,s.AddConditionalRuleMutation.id,s.SetConditionalRuleMutation.id,s.DeleteConditionalRuleMutation.id,s.MoveConditionalRuleMutation.id],se=i.onCommandExecuted(fe=>{const{id:ve,params:ye}=fe,Me=r.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getUnitId();ee.includes(ve)&&ye.unitId===Me&&B.next(null)});return()=>se.dispose()}).pipe(_e.debounceTime(16)).subscribe(()=>{$(I)});return()=>{L.unsubscribe()}},[r,y,u,h]),w.useEffect(()=>{const L=n.$ruleChange.subscribe(()=>{_(Math.random())});return()=>L.unsubscribe()},[n]),w.useEffect(()=>{const L=()=>{var fe;const se=Math.max(0,(((fe=O.current)==null?void 0:fe.getBoundingClientRect().width)||0)-8);return Vr=se,se},ee=new _e.Observable(se=>{const fe=document.querySelector(".univer-sidebar");if(fe){let ve=setTimeout(()=>{se.next()},150);const ye=()=>{ve&&clearTimeout(ve),ve=null},Me=qe=>{qe.propertyName==="width"&&(ye(),se.next())};return fe.addEventListener("transitionend",Me),()=>{ye(),fe.removeEventListener("transitionend",Me)}}}).pipe(_e.debounceTime(16)).subscribe(()=>{m(L())});return()=>{ee.unsubscribe()}},[]);const j=L=>{const B=r.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getUnitId(),ee=r.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId();i.executeCommand(kn.id,{unitId:B,subUnitId:ee,cfId:L.cfId})},q=(L,B)=>{C(B.y)},T=(L,B,ee)=>{C(-1);const se=r.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getUnitId(),fe=r.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),ve=qe=>{const yt=F.length;return Math.min(yt-1,Math.max(0,qe))},ye=F[ve(B.y)].cfId,Me=F[ve(ee.y)].cfId;ye!==Me&&i.executeCommand(ti.id,{unitId:se,subUnitId:fe,start:{id:ye,type:"self"},end:{id:Me,type:ee.y>B.y?"after":"before"}})},E=()=>{e.onCreate()},Z=()=>{y==="2"?i.executeCommand(Wn.id):y==="1"&&F.map(B=>({unitId:u,subUnitId:h,cfId:B.cfId})).forEach(B=>{i.executeCommand(kn.id,B)})},me=F.map((L,B)=>({i:L.cfId,x:0,w:12,y:B,h:1,isResizable:!1}));return p.jsxs("div",{className:le.cfRuleList,children:[p.jsxs("div",{className:le.ruleSelector,children:[p.jsx("div",{children:c.tWithReactNode("sheet.cf.panel.managerRuleSelect",p.jsx(G.Select,{className:le.select,options:M,value:y,onChange:L=>{b(L)}})).map((L,B)=>p.jsx("span",{children:L},B))}),p.jsxs("div",{className:le.btnList,children:[p.jsx(G.Tooltip,{title:a.t("sheet.cf.panel.createRule"),placement:"bottom",children:p.jsx("div",{className:`${le.icon}`,onClick:E,children:p.jsx(Wi,{})})}),F.length?p.jsx(G.Tooltip,{title:a.t("sheet.cf.panel.clear"),placement:"bottom",children:p.jsx("div",{className:`${le.gap} ${le.icon}`,onClick:Z,children:p.jsx(Sn,{})})}):p.jsx("div",{className:`${le.gap} ${le.disabled}`,children:p.jsx(Sn,{})})]})]}),p.jsx("div",{ref:O,className:le.gridLayoutWrap,children:R?p.jsx(ec,{onDragStop:T,onDragStart:q,layout:me,cols:12,rowHeight:60,width:R,margin:[0,10],draggableHandle:".draggableHandle",children:F.map((L,B)=>p.jsx("div",{children:p.jsxs("div",{onMouseMove:()=>{L.ranges!==f&&v(L.ranges)},onMouseLeave:()=>v([]),onClick:()=>t(L),className:`${le.ruleItem} ${S===B?le.active:""}`,children:[p.jsx("div",{className:`${le.draggableHandle} draggableHandle`,onClick:ee=>ee.stopPropagation(),children:p.jsx(Gi,{})}),p.jsxs("div",{className:le.ruleDescribe,children:[p.jsx("div",{className:le.ruleType,children:Ec(L,a)}),p.jsx("div",{className:le.ruleRange,children:L.ranges.map(ee=>no.serializeRange(ee)).join(",")})]}),p.jsx("div",{className:le.preview,children:p.jsx(gt,{rule:L.rule})}),p.jsx("div",{className:`${le.deleteItem} ${S===B?le.active:""}`,onClick:ee=>{ee.stopPropagation(),j(L)},children:p.jsx(Sn,{})})]})},`${L.cfId}`))}):null})]})},ri={type:g.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(e,t){if(!t)return!1;const{rule:n}=t,r=e.get(g.IUndoRedoService),o=e.get(g.ICommandService),i=e.get(s.ConditionalFormattingRuleModel),a=e.get(g.IUniverInstanceService),c=H.getSheetCommandTarget(a);if(!c)return!1;const{unitId:l,subUnitId:u}=c,d=i.createCfId(l,u),h={unitId:l,subUnitId:u,rule:{...n,cfId:n.cfId||d}},f=s.AddConditionalRuleMutationUndoFactory(e,h),v=o.syncExecuteCommand(s.AddConditionalRuleMutation.id,h);return v&&r.pushUndoRedo({unitID:l,redoMutations:[{id:s.AddConditionalRuleMutation.id,params:h}],undoMutations:[f]}),v}},oi={type:g.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(e,t){if(!t)return!1;const n=e.get(g.IUndoRedoService),r=e.get(g.ICommandService),o=e.get(g.IUniverInstanceService),i=H.getSheetCommandTarget(o,t);if(!i)return!1;const{unitId:a,subUnitId:c}=i,l={unitId:a,subUnitId:c,rule:t.rule},u=s.setConditionalRuleMutationUndoFactory(e,l),d=r.syncExecuteCommand(s.SetConditionalRuleMutation.id,l);return d&&n.pushUndoRedo({unitID:a,undoMutations:u,redoMutations:[{id:s.SetConditionalRuleMutation.id,params:l}]}),d}},Dc=g.createInterceptorKey("beforeSubmit"),Pc=g.createInterceptorKey("submit"),Nc="univer-cf-color-picker",Fc="univer-cf-color-picker-icon",$c="univer-icon-dropdown",On={cfColorPicker:Nc,cfColorPickerIcon:Fc,iconDropdown:$c},et=e=>{const{color:t,onChange:n,disable:r=!1,iconId:o="PaintBucket",className:i,isNeedDropdownIcon:a=!0}=e,c=te.useDependency(be.ComponentManager),l=w.useMemo(()=>new g.ColorKit(t),[t]),u=c.get(o);return u&&(r?p.jsx(u,{className:i,extend:{colorChannel1:l.isValid?t:"rgb(var(--primary-color))"}}):p.jsx(G.Dropdown,{overlay:p.jsx("div",{className:`${On.cfColorPicker} `,children:p.jsx(G.ColorPicker,{color:t,onChange:n})}),children:p.jsxs("span",{className:`${On.cfColorPickerIcon} ${i}`,children:[p.jsx(u,{extend:{colorChannel1:l.isValid?t:"rgb(var(--primary-color))"}}),a&&p.jsx(qn,{className:On.iconDropdown})]})}))},jc="univer-cf-rule-style-editor",Lc="univer-cf-preview-wrap",Vc="univer-text",Uc="univer-position-relative",zc="univer-btn-list",Ac="univer-util-item",Hc="univer-icon-set",kc="univer-render-config",Wc="univer-flex",qc="univer-width45",Bc="univer-icon-wrap",Gc="univer-icon",Xc="univer-dropdown-icon",Yc="univer-error-input",Kc="univer-error-text",Zc="univer-icon-group-list",Jc="univer-title",Qc="univer-group",eu="univer-item-content",tu="univer-item-wrap",nu="univer-item",ru="univer-icon-item-list-wrap",ou="univer-none",iu="univer-icon-item-list",au="univer-width100",su="univer-stress",P={cfRuleStyleEditor:jc,cfPreviewWrap:Lc,text:Vc,positionRelative:Uc,btnList:zc,utilItem:Ac,iconSet:Hc,renderConfig:kc,flex:Wc,width45:qc,iconWrap:Bc,icon:Gc,dropdownIcon:Xc,errorInput:Yc,errorText:Kc,iconGroupList:Zc,title:Jc,group:Qc,itemContent:eu,itemWrap:tu,item:nu,iconItemListWrap:ru,none:ou,iconItemList:iu,width100:au,stress:su},Ye=(e,t)=>({label:t.t(`sheet.cf.valueType.${e}`),value:e}),En=e=>{const{type:t,className:n,onChange:r,id:o,value:i}=e,a=te.useDependency(g.IUniverInstanceService),c=a.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getUnitId(),l=a.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),u=w.useMemo(()=>String(i).startsWith("=")?String(i):"=",[i]),d=w.useMemo(()=>[s.CFValueType.max,s.CFValueType.min,"none"].includes(t)?{disabled:!0}:[s.CFValueType.percent,s.CFValueType.percentile].includes(t)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[t]);return t===s.CFValueType.formula?p.jsx(be.TextEditor,{openForSheetSubUnitId:l,openForSheetUnitId:c,id:g.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_colo_scale_${o}`),value:u,style:{maxWidth:"50%",marginLeft:4},canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(h="")=>{r(h||"")}}):p.jsx(G.InputNumber,{className:n,value:Number(e.value)||0,onChange:h=>e.onChange(h||0),...d})},lu=e=>{var q;const{interceptorManager:t}=e,n=te.useDependency(g.LocaleService),r=((q=e.rule)==null?void 0:q.type)===s.CFRuleType.colorScale?e.rule:void 0,o=[Ye(s.CFValueType.num,n),Ye(s.CFValueType.percent,n),Ye(s.CFValueType.percentile,n),Ye(s.CFValueType.formula,n)],i=[Ye(s.CFValueType.min,n),...o],a=[Ye("none",n),...o],c=[Ye(s.CFValueType.max,n),...o],[l,u]=w.useState(()=>{var E;const T=s.CFValueType.min;return r&&((E=r.config[0])==null?void 0:E.value.type)||T}),[d,h]=w.useState(()=>{var E;const T="none";return!r||r.config.length!==3?T:((E=r.config[1])==null?void 0:E.value.type)||T}),[f,v]=w.useState(()=>{var E;const T=s.CFValueType.max;return r&&((E=r.config[r.config.length-1])==null?void 0:E.value.type)||T}),[y,b]=w.useState(()=>{if(!r)return 10;const E=r.config[0];return(E==null?void 0:E.value.value)===void 0?10:E==null?void 0:E.value.value}),[x,_]=w.useState(()=>{var Z;if(!r||r.config.length!==3)return 50;const E=(Z=r.config[1])==null?void 0:Z.value.value;return E===void 0?50:E}),[S,C]=w.useState(()=>{var Z;if(!r)return 90;const E=(Z=r.config[r.config.length-1])==null?void 0:Z.value.value;return E===void 0?90:E}),[R,m]=w.useState(()=>{var E;const T="#d0d9fb";return r&&((E=r.config[0])==null?void 0:E.color)||T}),[O,M]=w.useState(()=>{var E;const T="#7790f3";return!r||r.config.length!==3?T:((E=r.config[1])==null?void 0:E.color)||T}),[I,F]=w.useState(()=>{var E;const T="#2e55ef";return r&&((E=r.config[r.config.length-1])==null?void 0:E.color)||T}),$=w.useMemo(()=>T=>{const{minType:E,medianType:Z,maxType:me,minValue:L,medianValue:B,maxValue:ee,minColor:se,medianColor:fe,maxColor:ve}=T,ye=[];return ye.push({color:se,value:{type:E,value:L}}),Z!=="none"&&ye.push({color:fe,value:{type:Z,value:B}}),ye.push({color:ve,value:{type:me,value:ee}}),{config:ye.map((qe,yt)=>({...qe,index:yt})),type:s.CFRuleType.colorScale}},[]);w.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return $({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:S,minColor:R,medianColor:O,maxColor:I})}}),[$,l,d,f,y,x,S,R,O,I,t]);const j=T=>{e.onChange($(T))};return p.jsxs("div",{children:[p.jsx("div",{className:D.title,children:n.t("sheet.cf.panel.styleRule")}),p.jsx("div",{className:`${P.cfPreviewWrap}`,children:p.jsx(gt,{rule:$({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:S,minColor:R,medianColor:O,maxColor:I})})}),p.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.min")}),p.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[p.jsx(G.Select,{options:i,value:l,onChange:T=>{u(T);const E=s.createDefaultValueByValueType(T,10);b(E),j({minType:T,medianType:d,maxType:f,minValue:E,medianValue:x,maxValue:S,minColor:R,medianColor:O,maxColor:I})}}),p.jsx(En,{id:"min",className:`${D.mLXxs}`,value:y,type:l,onChange:T=>{b(T),j({minType:l,medianType:d,maxType:f,minValue:T,medianValue:x,maxValue:S,minColor:R,medianColor:O,maxColor:I})}}),p.jsx(et,{className:D.mLXxs,color:R,onChange:T=>{m(T),j({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:S,minColor:T,medianColor:O,maxColor:I})}})]}),p.jsx("div",{className:D.label,children:n.t("sheet.cf.panel.medianValue")}),p.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[p.jsx(G.Select,{options:a,value:d,onChange:T=>{h(T);const E=s.createDefaultValueByValueType(T,50);_(E),j({minType:l,medianType:T,maxType:f,minValue:y,medianValue:E,maxValue:S,minColor:R,medianColor:O,maxColor:I})}}),p.jsx(En,{id:"median",className:` ${D.mLXxs}`,value:x,type:d,onChange:T=>{_(T),j({minType:l,medianType:d,maxType:f,minValue:y,medianValue:T,maxValue:S,minColor:R,medianColor:O,maxColor:I})}}),d!=="none"&&p.jsx(et,{className:D.mLXxs,color:O,onChange:T=>{M(T),j({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:S,minColor:R,medianColor:T,maxColor:I})}})]}),p.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.max")}),p.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[p.jsx(G.Select,{options:c,value:f,onChange:T=>{v(T);const E=s.createDefaultValueByValueType(T,90);C(E),j({minType:l,medianType:d,maxType:T,minValue:y,medianValue:x,maxValue:E,minColor:R,medianColor:O,maxColor:I})}}),p.jsx(En,{id:"max",className:`${D.mLXxs}`,value:S,type:f,onChange:T=>{C(T),j({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:T,minColor:R,medianColor:O,maxColor:I})}}),p.jsx(et,{className:D.mLXxs,color:I,onChange:T=>{F(T),j({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:S,minColor:R,medianColor:O,maxColor:T})}})]})]})},dt=(e,t)=>({label:t.t(`sheet.cf.valueType.${e}`),value:e}),Ur=e=>{const{onChange:t,className:n,value:r,type:o,id:i,disabled:a=!1}=e,c=te.useDependency(g.IUniverInstanceService),l=c.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getUnitId(),u=c.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),d=w.useRef(r),h=w.useMemo(()=>[s.CFValueType.percentile,s.CFValueType.percent].includes(o)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[o]);if(o===s.CFValueType.formula){const f=String(d.current).startsWith("=")?String(d.current)||"":"=";return p.jsx(be.TextEditor,{id:g.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_data_bar_${i}`),value:f,openForSheetSubUnitId:u,openForSheetUnitId:l,style:{width:"47%",marginLeft:14},canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(v="")=>{t(v||"")}})}return p.jsx(G.InputNumber,{className:n,value:Number(r)||0,disabled:a,onChange:f=>{t(f||0)},...h})},cu=e=>{var q;const{interceptorManager:t}=e,n=te.useDependency(g.LocaleService),r=((q=e.rule)==null?void 0:q.type)===s.CFRuleType.dataBar?e.rule:void 0,[o,i]=w.useState(()=>{var E;const T="0";return r?(E=r.config)!=null&&E.isGradient?"1":"0":T}),[a,c]=w.useState(()=>{var E;const T="#abd91a";return r&&((E=r.config)==null?void 0:E.positiveColor)||T}),[l,u]=w.useState(()=>{var E;const T="#ffbe38";return r&&((E=r.config)==null?void 0:E.nativeColor)||T}),d=[dt(s.CFValueType.num,n),dt(s.CFValueType.percent,n),dt(s.CFValueType.percentile,n),dt(s.CFValueType.formula,n)],h=[dt(s.CFValueType.min,n),...d],f=[dt(s.CFValueType.max,n),...d],[v,y]=w.useState(()=>{var E;const T=h[0].value;return r&&((E=r.config)==null?void 0:E.min.type)||T}),[b,x]=w.useState(()=>{var E;const T=f[0].value;return r&&((E=r.config)==null?void 0:E.max.type)||T}),[_,S]=w.useState(()=>{var Z;if(!r)return 0;const E=((Z=r.config)==null?void 0:Z.min)||{};return E.type===s.CFValueType.formula?E.value||"=":E.value||0}),[C,R]=w.useState(()=>{var Z;if(!r)return 100;const E=((Z=r.config)==null?void 0:Z.max)||{};return E.type===s.CFValueType.formula?E.value||"=":E.value===void 0?100:E.value}),[m,O]=w.useState(()=>r?r.isShowValue===void 0?!0:!!r.isShowValue:!0),M=T=>({config:{min:{type:T.minValueType,value:T.minValue},max:{type:T.maxValueType,value:T.maxValue},isGradient:T.isGradient==="1",positiveColor:T.positiveColor,nativeColor:T.nativeColor},type:s.CFRuleType.dataBar,isShowValue:T.isShowValue});w.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return M({isGradient:o,minValue:_,minValueType:v,maxValue:C,maxValueType:b,positiveColor:a,nativeColor:l,isShowValue:m})}}),[o,_,v,C,b,a,l,t,m]);const I=T=>{e.onChange(M(T))},F=T=>{c(T),I({isGradient:o,minValue:_,minValueType:v,maxValue:C,maxValueType:b,positiveColor:T,nativeColor:l,isShowValue:m})},$=T=>{u(T),I({isGradient:o,minValue:_,minValueType:v,maxValue:C,maxValueType:b,positiveColor:a,nativeColor:T,isShowValue:m})},j=T=>d.map(E=>E.value).includes(T);return p.jsxs("div",{children:[p.jsx("div",{className:D.title,children:n.t("sheet.cf.panel.styleRule")}),p.jsx("div",{className:`${P.cfPreviewWrap}`,children:p.jsx(gt,{rule:M({isGradient:o,minValue:_,minValueType:v,maxValue:C,maxValueType:b,positiveColor:a,nativeColor:l,isShowValue:m})})}),p.jsxs("div",{children:[p.jsx("div",{className:D.label,children:n.t("sheet.cf.panel.fillType")}),p.jsxs("div",{className:`${D.mTSm} ${D.mLXxs} ${D.labelContainer} `,children:[p.jsxs(G.RadioGroup,{value:o,onChange:T=>{i(T),I({isGradient:T,minValue:_,minValueType:v,maxValue:C,maxValueType:b,positiveColor:a,nativeColor:l,isShowValue:m})},children:[p.jsx(G.Radio,{value:"0",children:p.jsx("span",{className:P.text,children:n.t("sheet.cf.panel.pureColor")})}),p.jsx(G.Radio,{value:"1",children:p.jsx("span",{className:P.text,children:n.t("sheet.cf.panel.gradient")})})]}),p.jsxs("div",{className:`${P.utilItem} ${D.mLXl}`,children:[p.jsx(G.Checkbox,{checked:!m,onChange:T=>{O(!T),I({isGradient:T,minValue:_,minValueType:v,maxValue:C,maxValueType:b,positiveColor:a,nativeColor:l,isShowValue:!T})}}),n.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),p.jsxs("div",{children:[p.jsx("div",{className:D.label,children:n.t("sheet.cf.panel.colorSet")}),p.jsxs("div",{className:`${D.labelContainer} ${D.mTSm} ${D.mLXxs}`,children:[p.jsxs("div",{className:`${D.labelContainer}`,children:[p.jsx("div",{className:`${P.text}`,children:n.t("sheet.cf.panel.native")}),p.jsx(et,{color:l,onChange:$})]}),p.jsxs("div",{className:`${D.labelContainer} ${D.mLSm} `,children:[p.jsx("div",{className:`${P.text} `,children:n.t("sheet.cf.panel.positive")}),p.jsx(et,{color:a,onChange:F})]})]})]}),p.jsxs("div",{children:[p.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.min")}),p.jsxs("div",{className:`${D.mTSm} ${D.labelContainer}`,children:[p.jsx(G.Select,{options:h,value:v,onChange:T=>{y(T);const E=s.createDefaultValueByValueType(T,10);S(E),I({isGradient:o,minValue:E,minValueType:T,maxValue:C,maxValueType:b,positiveColor:a,nativeColor:l,isShowValue:m})}}),p.jsx(Ur,{disabled:!j(v),id:"min",type:v,className:D.mLSm,value:_,onChange:T=>{S(T||0),I({isGradient:o,minValue:T||0,minValueType:v,maxValue:C,maxValueType:b,positiveColor:a,nativeColor:l,isShowValue:m})}})]}),p.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.max")}),p.jsxs("div",{className:`${D.mTSm} ${D.labelContainer}`,children:[p.jsx(G.Select,{options:f,value:b,onChange:T=>{x(T);const E=s.createDefaultValueByValueType(T,90);R(E),I({isGradient:o,minValue:_,minValueType:v,maxValue:E,maxValueType:T,positiveColor:a,nativeColor:l,isShowValue:m})}}),p.jsx(Ur,{disabled:!j(b),id:"max",type:b,className:D.mLSm,value:C,onChange:T=>{R(T||0),I({isGradient:o,minValue:_,minValueType:v,maxValue:T||0,maxValueType:b,positiveColor:a,nativeColor:l,isShowValue:m})}})]})]})]})},uu="univer-cf-style-edit",du="univer-button-item",fu="univer-isActive",Ve={cfStyleEdit:uu,buttonItem:du,isActive:fu},At=e=>[g.BooleanNumber.FALSE,void 0].includes(e)?g.BooleanNumber.TRUE:g.BooleanNumber.FALSE,Ht=e=>e!==g.BooleanNumber.FALSE,gr=e=>{const{style:t,onChange:n,className:r}=e,o=te.useDependency(be.ComponentManager),[i,a]=w.useState(()=>{if(t!=null&&t.bl)return t.bl}),[c,l]=w.useState(()=>{if(t!=null&&t.it)return t.it}),[u,d]=w.useState(()=>{if(t!=null&&t.ul)return t.ul.s}),[h,f]=w.useState(()=>{if(t!=null&&t.st)return t.st.s}),[v,y]=w.useState(()=>{var O;const m="#2f56ef";return(O=t==null?void 0:t.cl)!=null&&O.rgb?t.cl.rgb:m}),[b,x]=w.useState(()=>{var O;const m="#e8ecfc";return(O=t==null?void 0:t.bg)!=null&&O.rgb?t.bg.rgb:m}),_=o.get("BoldSingle"),S=o.get("ItalicSingle"),C=o.get("UnderlineSingle"),R=o.get("StrikethroughSingle");return w.useEffect(()=>{const m={bl:i,it:c};v!==void 0&&(m.cl={rgb:v}),b!==void 0&&(m.bg={rgb:b}),h!==void 0&&(m.st={s:h}),u!==void 0&&(m.ul={s:u}),n(s.removeUndefinedAttr(m))},[i,c,u,h,v,b]),p.jsxs("div",{className:`${Ve.cfStyleEdit} ${r}`,children:[_&&p.jsx("div",{className:ke({[Ve.isActive]:Ht(i||g.BooleanNumber.FALSE)},Ve.buttonItem),onClick:()=>a(At(i)),children:p.jsx(_,{})}),S&&p.jsx("div",{className:ke({[Ve.isActive]:Ht(c||g.BooleanNumber.FALSE)},Ve.buttonItem),onClick:()=>l(At(c)),children:p.jsx(S,{})}),C&&p.jsx("div",{className:ke({[Ve.isActive]:Ht(u||g.BooleanNumber.FALSE)},Ve.buttonItem),onClick:()=>d(At(u)),children:p.jsx(C,{})}),R&&p.jsx("div",{className:ke({[Ve.isActive]:Ht(h||g.BooleanNumber.FALSE)},Ve.buttonItem),onClick:()=>f(At(h)),children:p.jsx(R,{})}),p.jsx(et,{color:v,onChange:y,iconId:"FontColor"}),p.jsx(et,{color:b,onChange:x,iconId:"PaintBucket"})]})},pu=e=>{var x;const{onChange:t,interceptorManager:n}=e,r=te.useDependency(g.LocaleService),o=((x=e.rule)==null?void 0:x.type)===s.CFRuleType.highlightCell?e.rule:void 0,i=[{label:r.t("sheet.cf.panel.isNotBottom"),value:"isNotBottom"},{label:r.t("sheet.cf.panel.isBottom"),value:"isBottom"},{label:r.t("sheet.cf.panel.greaterThanAverage"),value:"greaterThanAverage"},{label:r.t("sheet.cf.panel.lessThanAverage"),value:"lessThanAverage"}],[a,c]=w.useState(()=>{const _=i[0].value,S=o==null?void 0:o.type;if(!o)return _;switch(S){case s.CFRuleType.highlightCell:switch(o.subType){case s.CFSubRuleType.average:return[s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual].includes(o.operator)?"greaterThanAverage":[s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(o.operator)?"lessThanAverage":_;case s.CFSubRuleType.rank:return o.isBottom?"isBottom":"isNotBottom"}}return _}),[l,u]=w.useState(()=>{const S=o==null?void 0:o.type;if(!o)return 10;switch(S){case s.CFRuleType.highlightCell:switch(o.subType){case s.CFSubRuleType.rank:return o.value||10}}return 10}),[d,h]=w.useState(()=>{const S=o==null?void 0:o.type;if(!o)return!1;switch(S){case s.CFRuleType.highlightCell:switch(o.subType){case s.CFSubRuleType.rank:return o.isPercent||!1}}return!1}),[f,v]=w.useState({}),y=_=>{const{type:S,isPercent:C,value:R,style:m}=_;if(S==="isNotBottom")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank,isPercent:C,isBottom:!1,value:R,style:m};if(S==="isBottom")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank,isPercent:C,isBottom:!0,value:R,style:m};if(S==="greaterThanAverage")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.average,operator:s.CFNumberOperator.greaterThan,style:m};if(S==="lessThanAverage")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.average,operator:s.CFNumberOperator.lessThan,style:m}};w.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return y({type:a,isPercent:d,value:l,style:f})}}),[a,d,l,f,n]);const b=_=>{t(y(_))};return p.jsxs("div",{children:[p.jsx("div",{className:`${D.title} ${D.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),p.jsx(G.Select,{className:`${P.width100} ${D.mTSm}`,value:a,options:i,onChange:_=>{c(_),b({type:_,isPercent:d,value:l,style:f})}}),["isNotBottom","isBottom"].includes(a)&&p.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[p.jsx(G.InputNumber,{min:1,max:1e3,value:l,onChange:_=>{const S=_||0;u(S),b({type:a,isPercent:d,value:S,style:f})}}),p.jsxs("div",{className:`${D.mLSm} ${D.labelContainer} ${P.text}`,children:[p.jsx(G.Checkbox,{checked:d,onChange:_=>{h(!!_),b({type:a,isPercent:!!_,value:l,style:f})}}),r.t("sheet.cf.valueType.percent")]})]}),p.jsx("div",{className:`${P.cfPreviewWrap} `,children:p.jsx(gt,{rule:y({type:a,isPercent:d,value:l,style:f})})}),p.jsx(gr,{style:o==null?void 0:o.style,className:`${D.mTSm} `,onChange:_=>{v(_),b({type:a,isPercent:d,value:l,style:_})}})]})},Q=(e,t)=>({label:t.t(`sheet.cf.operator.${e}`),value:e}),hu=e=>{const{type:t,operator:n,onChange:r,value:o}=e,[i,a]=w.useState(()=>typeof o=="number"?o:0),[c,l]=w.useState(()=>typeof o=="string"?o:""),[u,d]=w.useState(()=>Array.isArray(o)?o[0]===void 0?0:o[0]:0),[h,f]=w.useState(()=>Array.isArray(o)?o[1]===void 0?100:o[1]:100);switch(w.useEffect(()=>{switch(t){case s.CFSubRuleType.text:{[s.CFTextOperator.beginsWith,s.CFTextOperator.endsWith,s.CFTextOperator.containsText,s.CFTextOperator.notContainsText,s.CFTextOperator.equal,s.CFTextOperator.notEqual].includes(n)&&r(c);break}case s.CFSubRuleType.number:{[s.CFNumberOperator.equal,s.CFNumberOperator.notEqual,s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual,s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(n)&&r(i),[s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(n)&&r([u,h]);break}}},[t]),t){case s.CFSubRuleType.text:{if([s.CFTextOperator.beginsWith,s.CFTextOperator.endsWith,s.CFTextOperator.containsText,s.CFTextOperator.notContainsText,s.CFTextOperator.equal,s.CFTextOperator.notEqual].includes(n)){const v=y=>{l(y),r(y)};return p.jsx("div",{className:`${D.mTSm}`,children:p.jsx(G.Input,{className:P.width100,value:c,onChange:v})})}break}case s.CFSubRuleType.number:{if([s.CFNumberOperator.equal,s.CFNumberOperator.notEqual,s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual,s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(n)){const v=y=>{a(y||0),r(y||0)};return p.jsx("div",{className:`${D.mTSm}`,children:p.jsx(G.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:P.width100,value:i,onChange:v})})}if([s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(n)){const v=b=>{d(b||0),r([b||0,h])},y=b=>{f(b||0),r([u,b||0])};return p.jsxs("div",{className:`${D.mTSm} ${D.labelContainer} `,children:[p.jsx(G.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:u,onChange:v}),p.jsx(G.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`${D.mLSm}`,value:h,onChange:y})]})}}}return null},zr=(e,t)=>{switch(e){case s.CFSubRuleType.text:return[Q(s.CFTextOperator.containsText,t),Q(s.CFTextOperator.notContainsText,t),Q(s.CFTextOperator.beginsWith,t),Q(s.CFTextOperator.endsWith,t),Q(s.CFTextOperator.equal,t),Q(s.CFTextOperator.notEqual,t),Q(s.CFTextOperator.containsBlanks,t),Q(s.CFTextOperator.notContainsBlanks,t),Q(s.CFTextOperator.containsErrors,t),Q(s.CFTextOperator.notContainsErrors,t)];case s.CFSubRuleType.number:return[Q(s.CFNumberOperator.between,t),Q(s.CFNumberOperator.notBetween,t),Q(s.CFNumberOperator.equal,t),Q(s.CFNumberOperator.notEqual,t),Q(s.CFNumberOperator.greaterThan,t),Q(s.CFNumberOperator.greaterThanOrEqual,t),Q(s.CFNumberOperator.lessThan,t),Q(s.CFNumberOperator.lessThanOrEqual,t)];case s.CFSubRuleType.timePeriod:return[Q(s.CFTimePeriodOperator.yesterday,t),Q(s.CFTimePeriodOperator.today,t),Q(s.CFTimePeriodOperator.tomorrow,t),Q(s.CFTimePeriodOperator.last7Days,t),Q(s.CFTimePeriodOperator.lastWeek,t),Q(s.CFTimePeriodOperator.thisWeek,t),Q(s.CFTimePeriodOperator.nextWeek,t),Q(s.CFTimePeriodOperator.lastMonth,t),Q(s.CFTimePeriodOperator.thisMonth,t),Q(s.CFTimePeriodOperator.nextMonth,t)]}},Ar=e=>{var R;const{interceptorManager:t,onChange:n}=e,r=te.useDependency(g.LocaleService),o=((R=e.rule)==null?void 0:R.type)===s.CFRuleType.highlightCell?e.rule:void 0,[i,a]=w.useState(()=>{const m=s.CFSubRuleType.text;return o&&o.subType||m}),c=[{value:s.CFSubRuleType.text,label:r.t("sheet.cf.subRuleType.text")},{value:s.CFSubRuleType.number,label:r.t("sheet.cf.subRuleType.number")},{value:s.CFSubRuleType.timePeriod,label:r.t("sheet.cf.subRuleType.timePeriod")},{value:s.CFSubRuleType.duplicateValues,label:r.t("sheet.cf.subRuleType.duplicateValues")},{value:s.CFSubRuleType.uniqueValues,label:r.t("sheet.cf.subRuleType.uniqueValues")}],l=w.useMemo(()=>zr(i,r),[i]),[u,d]=w.useState(()=>{const m=l?l[0].value:void 0;return o&&o.operator||m}),[h,f]=w.useState(()=>{var M;const m="";return o?(M=o.value)!=null?M:s.createDefaultValue(o.subType,o.operator):m}),[v,y]=w.useState({}),b=w.useMemo(()=>m=>{var O,M,I,F,$,j,q,T,E,Z,me,L,B,ee,se;switch(m.subType||i){case s.CFSubRuleType.text:{if([s.CFTextOperator.beginsWith,s.CFTextOperator.endsWith,s.CFTextOperator.containsText,s.CFTextOperator.notContainsText,s.CFTextOperator.equal,s.CFTextOperator.notEqual].includes(u))return{type:s.CFRuleType.highlightCell,subType:(O=m.subType)!=null?O:i,operator:(M=m.operator)!=null?M:u,style:(I=m.style)!=null?I:v,value:(F=m.value)!=null?F:h};break}case s.CFSubRuleType.number:{if([s.CFNumberOperator.equal,s.CFNumberOperator.notEqual,s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual,s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(u))return{type:s.CFRuleType.highlightCell,subType:($=m.subType)!=null?$:i,operator:(j=m.operator)!=null?j:u,style:(q=m.style)!=null?q:v,value:(T=m.value)!=null?T:h};if([s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(u))return{type:s.CFRuleType.highlightCell,subType:(E=m.subType)!=null?E:i,operator:(Z=m.operator)!=null?Z:u,style:(me=m.style)!=null?me:v,value:(L=m.value)!=null?L:h};break}}return{type:s.CFRuleType.highlightCell,subType:(B=m.subType)!=null?B:i,operator:(ee=m.operator)!=null?ee:u,style:(se=m.style)!=null?se:v}},[i,u,h,v]);w.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return b({})}}),[b,t]),w.useEffect(()=>{c.some(m=>m.value===i)||a(c[0].value)},[c]);const x=m=>{const O=m,M=zr(O,r),I=M&&M[0].value;a(O),d(I),I&&f(s.createDefaultValue(O,I)),n(b({subType:O,operator:I}))},_=m=>{const O=m;d(O),n(b({operator:O}))},S=m=>{f(m),n(b({value:m}))},C=w.useMemo(()=>`${i}_${u}_${Math.random()}`,[i,u]);return p.jsxs("div",{children:[p.jsx("div",{className:`${D.title} ${D.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),p.jsx(G.Select,{className:`${D.mTSm} ${P.width100}`,onChange:x,value:i,options:c}),(l==null?void 0:l.length)&&p.jsx(G.Select,{className:`${D.mTSm} ${P.width100}`,onChange:_,value:u||"",options:l}),p.jsx(hu,{value:h,interceptorManager:t,type:i,operator:u,rule:o,onChange:S},C),p.jsx("div",{className:`${P.cfPreviewWrap}`,children:p.jsx(gt,{rule:b({})})}),p.jsx(gr,{style:o==null?void 0:o.style,className:`${D.mLXxs}`,onChange:m=>{y(m),n(b({style:m}))}})]})},gu=e=>{var y;const{onChange:t,interceptorManager:n}=e,r=te.useDependency(g.LocaleService),i=te.useDependency(g.IUniverInstanceService).getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET),a=i.getActiveSheet(),c=((y=e.rule)==null?void 0:y.type)===s.CFRuleType.highlightCell?e.rule:void 0,[l,u]=w.useState({}),[d,h]=w.useState(()=>(c==null?void 0:c.subType)===s.CFSubRuleType.formula?c.value:"="),f=b=>({style:b.style,value:d,type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.formula});w.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return f({style:l,formula:d})}}),[l,d,n]);const v=b=>{t(f(b))};return p.jsxs("div",{children:[p.jsx("div",{className:`${D.title} ${D.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),p.jsx("div",{className:`${D.mTSm}`,children:p.jsx(be.TextEditor,{id:g.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_formula`),openForSheetSubUnitId:a.getSheetId(),openForSheetUnitId:i.getUnitId(),value:d,canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(b="")=>{const x=b||"";h(x),v({style:l,formula:x})}})}),p.jsx("div",{className:`${P.cfPreviewWrap} `,children:p.jsx(gt,{rule:f({style:l,formula:d})})}),p.jsx(gr,{style:c==null?void 0:c.style,className:`${D.mTSm} `,onChange:b=>{u(b),v({style:b,formula:d})}})]})};var mu="Expected a function",ii="__lodash_hash_undefined__",ai=1/0,vu=9007199254740991,yu="[object Function]",Cu="[object GeneratorFunction]",Su="[object Symbol]",bu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tu=/^\w*$/,Ru=/^\./,_u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wu=/[\\^$.*+?()[\]{}|]/g,Iu=/\\(\\)?/g,xu=/^\[object .+?Constructor\]$/,Ou=/^(?:0|[1-9]\d*)$/,Eu=typeof Ue=="object"&&Ue&&Ue.Object===Object&&Ue,Mu=typeof self=="object"&&self&&self.Object===Object&&self,mr=Eu||Mu||Function("return this")();function Du(e,t){return e==null?void 0:e[t]}function Pu(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var Nu=Array.prototype,Fu=Function.prototype,si=Object.prototype,Mn=mr["__core-js_shared__"],Hr=function(){var e=/[^.]+$/.exec(Mn&&Mn.keys&&Mn.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),li=Fu.toString,gn=si.hasOwnProperty,ci=si.toString,$u=RegExp("^"+li.call(gn).replace(wu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),kr=mr.Symbol,ju=Nu.splice,Lu=ui(mr,"Map"),Dt=ui(Object,"create"),Wr=kr?kr.prototype:void 0,qr=Wr?Wr.toString:void 0;function tt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Vu(){this.__data__=Dt?Dt(null):{}}function Uu(e){return this.has(e)&&delete this.__data__[e]}function zu(e){var t=this.__data__;if(Dt){var n=t[e];return n===ii?void 0:n}return gn.call(t,e)?t[e]:void 0}function Au(e){var t=this.__data__;return Dt?t[e]!==void 0:gn.call(t,e)}function Hu(e,t){var n=this.__data__;return n[e]=Dt&&t===void 0?ii:t,this}tt.prototype.clear=Vu;tt.prototype.delete=Uu;tt.prototype.get=zu;tt.prototype.has=Au;tt.prototype.set=Hu;function mt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ku(){this.__data__=[]}function Wu(e){var t=this.__data__,n=mn(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():ju.call(t,n,1),!0}function qu(e){var t=this.__data__,n=mn(t,e);return n<0?void 0:t[n][1]}function Bu(e){return mn(this.__data__,e)>-1}function Gu(e,t){var n=this.__data__,r=mn(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}mt.prototype.clear=ku;mt.prototype.delete=Wu;mt.prototype.get=qu;mt.prototype.has=Bu;mt.prototype.set=Gu;function at(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Xu(){this.__data__={hash:new tt,map:new(Lu||mt),string:new tt}}function Yu(e){return vn(this,e).delete(e)}function Ku(e){return vn(this,e).get(e)}function Zu(e){return vn(this,e).has(e)}function Ju(e,t){return vn(this,e).set(e,t),this}at.prototype.clear=Xu;at.prototype.delete=Yu;at.prototype.get=Ku;at.prototype.has=Zu;at.prototype.set=Ju;function Qu(e,t,n){var r=e[t];(!(gn.call(e,t)&&di(r,n))||n===void 0&&!(t in e))&&(e[t]=n)}function mn(e,t){for(var n=e.length;n--;)if(di(e[n][0],t))return n;return-1}function ed(e){if(!Qt(e)||sd(e))return!1;var t=dd(e)||Pu(e)?$u:xu;return t.test(ud(e))}function td(e,t,n,r){if(!Qt(e))return e;t=id(t,e)?[t]:rd(t);for(var o=-1,i=t.length,a=i-1,c=e;c!=null&&++o<i;){var l=cd(t[o]),u=n;if(o!=a){var d=c[l];u=r?r(d,l,c):void 0,u===void 0&&(u=Qt(d)?d:od(t[o+1])?[]:{})}Qu(c,l,u),c=c[l]}return e}function nd(e){if(typeof e=="string")return e;if(yr(e))return qr?qr.call(e):"";var t=e+"";return t=="0"&&1/e==-ai?"-0":t}function rd(e){return fi(e)?e:ld(e)}function vn(e,t){var n=e.__data__;return ad(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ui(e,t){var n=Du(e,t);return ed(n)?n:void 0}function od(e,t){return t=t==null?vu:t,!!t&&(typeof e=="number"||Ou.test(e))&&e>-1&&e%1==0&&e<t}function id(e,t){if(fi(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||yr(e)?!0:Tu.test(e)||!bu.test(e)||t!=null&&e in Object(t)}function ad(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function sd(e){return!!Hr&&Hr in e}var ld=vr(function(e){e=pd(e);var t=[];return Ru.test(e)&&t.push(""),e.replace(_u,function(n,r,o,i){t.push(o?i.replace(Iu,"$1"):r||n)}),t});function cd(e){if(typeof e=="string"||yr(e))return e;var t=e+"";return t=="0"&&1/e==-ai?"-0":t}function ud(e){if(e!=null){try{return li.call(e)}catch{}try{return e+""}catch{}}return""}function vr(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError(mu);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(vr.Cache||at),n}vr.Cache=at;function di(e,t){return e===t||e!==e&&t!==t}var fi=Array.isArray;function dd(e){var t=Qt(e)?ci.call(e):"";return t==yu||t==Cu}function Qt(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function fd(e){return!!e&&typeof e=="object"}function yr(e){return typeof e=="symbol"||fd(e)&&ci.call(e)==Su}function pd(e){return e==null?"":nd(e)}function hd(e,t,n){return e==null?e:td(e,t,n)}var gd=hd;const md=Bn(gd);var vd="Expected a function",pi="__lodash_hash_undefined__",hi=1/0,yd="[object Function]",Cd="[object GeneratorFunction]",Sd="[object Symbol]",bd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Td=/^\w*$/,Rd=/^\./,_d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wd=/[\\^$.*+?()[\]{}|]/g,Id=/\\(\\)?/g,xd=/^\[object .+?Constructor\]$/,Od=typeof Ue=="object"&&Ue&&Ue.Object===Object&&Ue,Ed=typeof self=="object"&&self&&self.Object===Object&&self,Cr=Od||Ed||Function("return this")();function Md(e,t){return e==null?void 0:e[t]}function Dd(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var Pd=Array.prototype,Nd=Function.prototype,gi=Object.prototype,Dn=Cr["__core-js_shared__"],Br=function(){var e=/[^.]+$/.exec(Dn&&Dn.keys&&Dn.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),mi=Nd.toString,Sr=gi.hasOwnProperty,vi=gi.toString,Fd=RegExp("^"+mi.call(Sr).replace(wd,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gr=Cr.Symbol,$d=Pd.splice,jd=yi(Cr,"Map"),Pt=yi(Object,"create"),Xr=Gr?Gr.prototype:void 0,Yr=Xr?Xr.toString:void 0;function nt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ld(){this.__data__=Pt?Pt(null):{}}function Vd(e){return this.has(e)&&delete this.__data__[e]}function Ud(e){var t=this.__data__;if(Pt){var n=t[e];return n===pi?void 0:n}return Sr.call(t,e)?t[e]:void 0}function zd(e){var t=this.__data__;return Pt?t[e]!==void 0:Sr.call(t,e)}function Ad(e,t){var n=this.__data__;return n[e]=Pt&&t===void 0?pi:t,this}nt.prototype.clear=Ld;nt.prototype.delete=Vd;nt.prototype.get=Ud;nt.prototype.has=zd;nt.prototype.set=Ad;function vt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Hd(){this.__data__=[]}function kd(e){var t=this.__data__,n=yn(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():$d.call(t,n,1),!0}function Wd(e){var t=this.__data__,n=yn(t,e);return n<0?void 0:t[n][1]}function qd(e){return yn(this.__data__,e)>-1}function Bd(e,t){var n=this.__data__,r=yn(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}vt.prototype.clear=Hd;vt.prototype.delete=kd;vt.prototype.get=Wd;vt.prototype.has=qd;vt.prototype.set=Bd;function st(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Gd(){this.__data__={hash:new nt,map:new(jd||vt),string:new nt}}function Xd(e){return Cn(this,e).delete(e)}function Yd(e){return Cn(this,e).get(e)}function Kd(e){return Cn(this,e).has(e)}function Zd(e,t){return Cn(this,e).set(e,t),this}st.prototype.clear=Gd;st.prototype.delete=Xd;st.prototype.get=Yd;st.prototype.has=Kd;st.prototype.set=Zd;function yn(e,t){for(var n=e.length;n--;)if(cf(e[n][0],t))return n;return-1}function Jd(e,t){t=nf(t,e)?[t]:tf(t);for(var n=0,r=t.length;e!=null&&n<r;)e=e[sf(t[n++])];return n&&n==r?e:void 0}function Qd(e){if(!Si(e)||of(e))return!1;var t=uf(e)||Dd(e)?Fd:xd;return t.test(lf(e))}function ef(e){if(typeof e=="string")return e;if(Tr(e))return Yr?Yr.call(e):"";var t=e+"";return t=="0"&&1/e==-hi?"-0":t}function tf(e){return Ci(e)?e:af(e)}function Cn(e,t){var n=e.__data__;return rf(t)?n[typeof t=="string"?"string":"hash"]:n.map}function yi(e,t){var n=Md(e,t);return Qd(n)?n:void 0}function nf(e,t){if(Ci(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Tr(e)?!0:Td.test(e)||!bd.test(e)||t!=null&&e in Object(t)}function rf(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function of(e){return!!Br&&Br in e}var af=br(function(e){e=ff(e);var t=[];return Rd.test(e)&&t.push(""),e.replace(_d,function(n,r,o,i){t.push(o?i.replace(Id,"$1"):r||n)}),t});function sf(e){if(typeof e=="string"||Tr(e))return e;var t=e+"";return t=="0"&&1/e==-hi?"-0":t}function lf(e){if(e!=null){try{return mi.call(e)}catch{}try{return e+""}catch{}}return""}function br(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError(vd);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(br.Cache||st),n}br.Cache=st;function cf(e,t){return e===t||e!==e&&t!==t}var Ci=Array.isArray;function uf(e){var t=Si(e)?vi.call(e):"";return t==yd||t==Cd}function Si(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function df(e){return!!e&&typeof e=="object"}function Tr(e){return typeof e=="symbol"||df(e)&&vi.call(e)==Sd}function ff(e){return e==null?"":ef(e)}function pf(e,t,n){var r=e==null?void 0:Jd(e,t);return r===void 0?n:r}var hf=pf;const gf=Bn(hf),bi=(e,t)=>(s.iconMap[e]||[])[Number(t)]||"",mf=e=>{const t=te.useDependency(g.IUniverInstanceService),n=t.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getUnitId(),r=t.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),o=w.useMemo(()=>e.error?P.errorInput:"",[e.error]);return p.jsx("div",{className:P.positionRelative,children:e.type!==s.CFValueType.formula?p.jsxs(p.Fragment,{children:[p.jsx(G.InputNumber,{className:o,value:Number(e.value)||0,onChange:i=>e.onChange(i!=null?i:0)}),e.error&&p.jsx("div",{className:P.errorText,children:e.error})]}):p.jsx(be.TextEditor,{id:g.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_icon_set_${e.id}`),value:String(e.value).startsWith("=")?String(e.value):"=",openForSheetSubUnitId:r,openForSheetUnitId:n,canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(i="")=>{const a=i||"";e.onChange(a)}})})},Kr=(e,t,n)=>({operator:s.CFNumberOperator.greaterThan,value:{type:s.CFValueType.num,value:(n.length-1-t)*10},iconType:e,iconId:String(t)}),vf=e=>{const t=te.useDependency(g.LocaleService),n=r=>{e.onClick(r)};return p.jsx("div",{className:P.iconGroupList,children:s.iconGroup.map((r,o)=>p.jsxs("div",{className:P.group,children:[p.jsx("div",{className:P.title,children:t.t(r.title)}),p.jsx("div",{className:P.itemContent,children:r.group.map(i=>p.jsx("div",{className:P.itemWrap,onClick:()=>{n(i.name)},children:p.jsx("div",{className:P.item,children:i.list.map((a,c)=>p.jsx("img",{className:P.icon,src:a},c))})},i.name))})]},o))})},yf=e=>{const t=w.useMemo(()=>{const r=[];for(const o in s.iconMap){const i=s.iconMap[o],a=o;i.forEach((c,l)=>{r.push({iconType:a,base64:c,iconId:String(l)})})}return r},[]),n=r=>{e.onClick(r.iconType,r.iconId)};return p.jsxs("div",{className:P.iconItemListWrap,children:[p.jsxs("div",{className:P.none,onClick:()=>n({iconType:s.EMPTY_ICON_TYPE,iconId:"",base64:""}),children:[p.jsx(en,{className:P.icon}),p.jsx("span",{children:"无单元格图标"})]}),p.jsx("div",{className:P.iconItemList,children:t.map(r=>p.jsx("div",{className:P.item,children:p.jsx("img",{onClick:()=>n(r),className:`${P.icon}`,src:r.base64})},`${r.iconType}_${r.iconId}`))})]})},Cf=e=>{const{onChange:t,configList:n,errorMap:r={}}=e,o=te.useDependency(g.LocaleService),i=[{label:o.t(`sheet.cf.symbol.${s.CFNumberOperator.greaterThan}`),value:s.CFNumberOperator.greaterThan},{label:o.t(`sheet.cf.symbol.${s.CFNumberOperator.greaterThanOrEqual}`),value:s.CFNumberOperator.greaterThanOrEqual}],a=[{label:o.t(`sheet.cf.valueType.${s.CFValueType.num}`),value:s.CFValueType.num},{label:o.t(`sheet.cf.valueType.${s.CFValueType.percent}`),value:s.CFValueType.percent},{label:o.t(`sheet.cf.valueType.${s.CFValueType.percentile}`),value:s.CFValueType.percentile},{label:o.t(`sheet.cf.valueType.${s.CFValueType.formula}`),value:s.CFValueType.formula}],c=(h,f)=>{t([String(f),"value","value"],h)},l=(h,f)=>{t([String(f),"operator"],h);const v=s.createDefaultValue(s.CFSubRuleType.number,h);c(v,f)},u=(h,f)=>{t([String(f),"value","type"],h)};return w.useMemo(()=>n.map((h,f)=>{const v=r[f],y=bi(h.iconType,h.iconId),b=f===n.length-1,x=f===0,_=n[f-1],S=(_==null?void 0:_.value.type)===s.CFValueType.formula?o.t("sheet.cf.valueType.formula"):_==null?void 0:_.value.value,C=(R,m)=>{const O={...h,iconId:m,iconType:R};t([String(f)],O)};return p.jsxs("div",{className:`${f?D.mTXl:D.mTSm}`,children:[p.jsxs("div",{className:`${D.label} ${P.flex}`,children:[p.jsxs("div",{className:`${P.width45}`,children:[o.t("sheet.cf.iconSet.icon"),f+1]}),p.jsx("div",{className:`${P.width45}`,children:p.jsxs(p.Fragment,{children:[!x&&!b&&o.t("sheet.cf.iconSet.rule"),!x&&!b&&p.jsxs("span",{className:P.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${s.getOppositeOperator(_.operator)}`),S,b?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),p.jsxs("div",{className:`${P.flex} ${D.mTSm}`,children:[p.jsx("div",{className:`${P.iconWrap} ${P.width45}`,children:p.jsx(G.Dropdown,{overlay:p.jsx(yf,{onClick:C,iconId:h.iconId,iconType:h.iconType}),children:p.jsxs("div",{className:P.dropdownIcon,children:[y?p.jsx("img",{src:y,className:P.icon}):p.jsx(en,{className:P.icon}),p.jsx(qn,{})]})})}),b?p.jsxs("div",{className:`${P.width45} ${D.label}`,style:{marginTop:0},children:[o.t("sheet.cf.iconSet.rule"),p.jsxs("span",{className:P.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${s.getOppositeOperator(_.operator)}`),S,b?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]}):p.jsx(G.Select,{className:`${D.mL0} ${P.width45} ${D.mR0}`,options:i,value:h.operator,onChange:R=>{l(R,f)}})]}),b?p.jsx("div",{}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:`${D.mTSm} ${D.label} ${P.flex}`,children:[p.jsx("div",{className:`${P.width45}`,children:o.t("sheet.cf.iconSet.type")}),p.jsx("div",{className:`${P.width45}`,children:o.t("sheet.cf.iconSet.value")})]}),p.jsxs("div",{className:`${D.mTSm} ${P.flex}`,children:[p.jsx(G.Select,{className:`${P.width45} ${D.mL0}`,options:a,value:h.value.type,onChange:R=>{u(R,f)}}),p.jsx("div",{className:`${D.mL0} ${P.width45}`,children:p.jsx(mf,{id:f,type:h.value.type,error:v,value:h.value.value||"",onChange:R=>c(R,f)})})]})]})]},f)}),[n,r])},Sf=e=>{var _;const{interceptorManager:t}=e,n=((_=e.rule)==null?void 0:_.type)===s.CFRuleType.iconSet?e.rule:void 0,r=te.useDependency(g.LocaleService),[o,i]=w.useState({}),[a,c]=w.useState(()=>{const S=Object.keys(s.iconMap)[0];if(n&&n.config.length){const C=n.config[0].iconType;if(!n.config.some(m=>m.iconType!==C))return C}return S}),[l,u]=w.useState(()=>{if(n&&n.config.length)return g.Tools.deepClone(n==null?void 0:n.config);const S=s.iconMap[a]||[];return new Array(S.length).fill("").map((C,R,m)=>R===m.length-1?{operator:s.CFNumberOperator.lessThanOrEqual,value:{type:s.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:a,iconId:String(R)}:Kr(a,R,m))}),[d,h]=w.useState(()=>n?!!n.isShowValue:!0),f=w.useMemo(()=>{const S=l.map(C=>bi(C.iconType,C.iconId));return p.jsx("div",{className:P.iconWrap,children:S.map((C,R)=>C?p.jsx("img",{className:P.icon,src:C},R):p.jsx(en,{className:P.icon},R))})},[l]),v=S=>{if(S.reduce((R,m,O)=>R.preType&&!R.result||S.length-1===O?R:m.value.type===s.CFValueType.formula?{preType:s.CFValueType.formula,result:!1}:R.preType?{result:R.preType===m.value.type,preType:m.value.type}:{result:!0,preType:m.value.type},{result:!0,preType:""}).result&&[s.CFValueType.num,s.CFValueType.percent,s.CFValueType.percentile].includes(S[0].value.type)){const R={};return S.forEach((m,O,M)=>{if(O-1<0||O===M.length-1)return;const F=S[O-1],$=s.getOppositeOperator(F.operator);s.compareWithNumber({operator:$,value:F.value.value},m.value.value)||(R[O]=`${r.t(`sheet.cf.form.${$}`,String(F.value.value))} `)}),R}return{}},y=(S,C)=>{gf(l,S)!==C&&(md(l,S,C),u([...l]),i(v(l)))},b=S=>{c(S);const C=s.iconMap[S]||[],R=new Array(C.length).fill("").map((m,O,M)=>Kr(S,O,M));u(R),i(v(R))};w.useEffect(()=>{const S=t.intercept(t.getInterceptPoints().submit,{handler(){return{type:s.CFRuleType.iconSet,isShowValue:d,config:l}}});return()=>{S()}},[d,l,t]),w.useEffect(()=>{const S=t.intercept(t.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(o).length===0}});return()=>{S()}},[d,l,t,o]);const x=()=>{const S=l.map(C=>({...C}));l.forEach((C,R)=>{const m=l.length-1-R,O=S[m];C.iconId=O.iconId,C.iconType=O.iconType}),u([...l])};return p.jsxs("div",{className:P.iconSet,children:[p.jsx("div",{className:D.title,children:r.t("sheet.cf.panel.styleRule")}),p.jsx("div",{className:`${D.mTSm}`,children:p.jsx(G.Dropdown,{overlay:p.jsx(vf,{iconType:a,onClick:b}),children:p.jsxs("div",{className:P.dropdownIcon,style:{width:"unset"},children:[f,p.jsx(qn,{})]})})}),p.jsxs("div",{className:`${D.mTSm} ${P.renderConfig}`,children:[p.jsxs("div",{className:P.utilItem,children:[p.jsx(G.Checkbox,{onChange:x}),r.t("sheet.cf.iconSet.reverseIconOrder")]}),p.jsxs("div",{className:`${P.utilItem} ${D.mLXl}`,children:[p.jsx(G.Checkbox,{checked:!d,onChange:S=>{h(!S)}}),r.t("sheet.cf.iconSet.onlyShowIcon")]})]}),p.jsx(Cf,{errorMap:o,onChange:y,configList:l})]})},Zr=e=>e.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getUnitId(),Jr=e=>e.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),bf=e=>{var R,m,O,M;const t=te.useDependency(g.LocaleService),n=te.useDependency(g.ICommandService),r=te.useDependency(g.IUniverInstanceService),o=te.useDependency(s.ConditionalFormattingRuleModel),i=te.useDependency(H.SelectionManagerService),a=Zr(r),c=Jr(r),l=w.useRef((m=(R=e.rule)==null?void 0:R.ranges)!=null?m:[]),u=w.useMemo(()=>{var F,$;let I=(F=e.rule)==null?void 0:F.ranges;return I!=null&&I.length||(I=($=i.getSelectionRanges())!=null?$:[]),l.current=I,I!=null&&I.length?I.map(j=>{const q=no.serializeRange(j);return q==="NaN"?"":q}).filter(j=>!!j).join(","):""},[e.rule]),d=[{label:t.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:t.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:t.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:t.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:t.t("sheet.cf.ruleType.formula"),value:"5"},{label:t.t("sheet.cf.ruleType.iconSet"),value:"6"}],[h,f]=w.useState(()=>{var $,j;const I=($=e.rule)==null?void 0:$.rule.type,F=d[0].value;if(!I)return F;switch(I){case s.CFRuleType.highlightCell:{switch((j=e.rule)==null?void 0:j.rule.subType){case s.CFSubRuleType.number:case s.CFSubRuleType.text:case s.CFSubRuleType.duplicateValues:case s.CFSubRuleType.uniqueValues:case s.CFSubRuleType.timePeriod:return"1";case s.CFSubRuleType.average:case s.CFSubRuleType.rank:return"2";case s.CFSubRuleType.formula:return"5"}break}case s.CFRuleType.dataBar:return"3";case s.CFRuleType.colorScale:return"4";case s.CFRuleType.iconSet:return"6"}return F}),v=w.useRef(),y=w.useMemo(()=>new g.InterceptorManager({beforeSubmit:Dc,submit:Pc}),[]),b=w.useMemo(()=>{switch(h){case"1":return Ar;case"2":return pu;case"3":return cu;case"4":return lu;case"5":return gu;case"6":return Sf;default:return Ar}},[h]);w.useEffect(()=>{var I;if(((I=e.rule)==null?void 0:I.cfId)!==void 0){const F=n.onCommandExecuted($=>{if($.id===H.RemoveSheetMutation.id){const j=$.params;j.subUnitId===c&&j.unitId===a&&e.onCancel()}$.id===H.SetWorksheetActiveOperation.id&&e.onCancel()});return()=>F.dispose()}},[(O=e.rule)==null?void 0:O.cfId]);const x=I=>{v.current=I},_=I=>{l.current=I.map(F=>F.range)},S=()=>{const I=y.fetchThroughInterceptors(y.getInterceptPoints().beforeSubmit)(!0,null),F=()=>{const $=r.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getActiveSheet();return l.current.map(T=>H.setEndForRange(T,$.getRowCount(),$.getColumnCount())).filter(T=>!(Number.isNaN(T.startRow)||Number.isNaN(T.startColumn)))};if(I){const $=y.fetchThroughInterceptors(y.getInterceptPoints().submit)(null,null),j=F();if($&&j.length){const q=Zr(r),T=Jr(r);let E={};e.rule&&e.rule.cfId?(E={...e.rule,ranges:j,rule:$},n.executeCommand(oi.id,{unitId:q,subUnitId:T,rule:E}),e.onCancel()):(E={cfId:o.createCfId(q,T),ranges:j,rule:$,stopIfTrue:!1},n.executeCommand(ri.id,{unitId:q,subUnitId:T,rule:E}),e.onCancel())}}},C=()=>{e.onCancel()};return p.jsxs("div",{className:P.cfRuleStyleEditor,children:[p.jsx("div",{className:D.title,children:t.t("sheet.cf.panel.range")}),p.jsx("div",{className:`${D.mTBase}`,children:p.jsx(be.RangeSelector,{placeholder:t.t("sheet.cf.form.rangeSelector"),width:"100%",openForSheetSubUnitId:c,openForSheetUnitId:a,value:u,id:g.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_rangeSelector`),onChange:_})}),p.jsx("div",{className:D.title,children:t.t("sheet.cf.panel.styleType")}),p.jsx("div",{className:D.mTBase,children:p.jsx(G.Select,{className:P.width100,value:h,options:d,onChange:I=>f(I)})}),p.jsx(b,{interceptorManager:y,rule:(M=e.rule)==null?void 0:M.rule,onChange:x}),p.jsxs("div",{className:`${D.mTBase} ${P.btnList}`,children:[p.jsx(G.Button,{size:"small",onClick:C,children:t.t("sheet.cf.panel.cancel")}),p.jsx(G.Button,{className:D.mLSm,size:"small",type:"primary",onClick:S,children:t.t("sheet.cf.panel.submit")})]})]})},Tf=e=>{const[t,n]=w.useState(e.rule),[r,o]=w.useState(!!e.rule),i=()=>{o(!0)},a=()=>{o(!1),n(void 0)},c=l=>{n(l),o(!0)};return p.jsx("div",{className:D.conditionalFormattingWrap,children:r?p.jsx(bf,{onCancel:a,rule:t}):p.jsx(Mc,{onClick:c,onCreate:i})})};var Rf=Object.defineProperty,_f=Object.getOwnPropertyDescriptor,wf=(e,t,n,r)=>{for(var o=r>1?void 0:r?_f(t,n):t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=(r?a(t,n,o):a(o))||o);return r&&o&&Rf(t,n,o),o},bt=(e,t)=>(n,r)=>t(n,r,e);const Qr="sheet.conditional.formatting.panel";let Mt=class extends g.Disposable{constructor(e,t,n,r,o){super(),this._injector=e,this._componentManager=t,this._menuService=n,this._sidebarService=r,this._localeService=o,this._initMenu(),this._initPanel()}openPanel(e){const t={header:{title:this._localeService.t("sheet.cf.title")},children:{label:Qr,rule:e}};this._sidebarService.open(t)}_initMenu(){this._menuService.addMenuItem(Yi(this._componentManager)(this._injector))}_initPanel(){this._componentManager.register(Qr,Tf)}};Mt=wf([g.OnLifecycle(g.LifecycleStages.Ready,Mt),bt(0,z.Inject(z.Injector)),bt(1,z.Inject(be.ComponentManager)),bt(2,z.Inject(be.IMenuService)),bt(3,z.Inject(be.ISidebarService)),bt(4,z.Inject(g.LocaleService))],Mt);var Re=(e=>(e[e.createRule=1]="createRule",e[e.viewRule=2]="viewRule",e[e.highlightCell=3]="highlightCell",e[e.rank=4]="rank",e[e.formula=5]="formula",e[e.colorScale=6]="colorScale",e[e.dataBar=7]="dataBar",e[e.icon=8]="icon",e[e.clearRangeRules=9]="clearRangeRules",e[e.clearWorkSheetRules=10]="clearWorkSheetRules",e))(Re||{});const Ti={id:"sheet.operation.open.conditional.formatting.panel",type:g.CommandType.OPERATION,handler:(e,t)=>{const n=e.get(Mt),r=e.get(H.SelectionManagerService),o=e.get(g.ICommandService),i=r.getSelectionRanges()||[];switch(t.value){case 3:{n.openPanel({...s.createDefaultRule(),ranges:i});break}case 4:{const c={...s.createDefaultRule,ranges:i,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank}};n.openPanel(c);break}case 5:{const c={...s.createDefaultRule,ranges:i,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.formula,value:"="}};n.openPanel(c);break}case 6:{const c={...s.createDefaultRule,ranges:i,rule:{type:s.CFRuleType.colorScale,config:[]}};n.openPanel(c);break}case 7:{const c={...s.createDefaultRule,ranges:i,rule:{type:s.CFRuleType.dataBar,isShowValue:!0}};n.openPanel(c);break}case 8:{const c={...s.createDefaultRule,ranges:i,rule:{type:s.CFRuleType.iconSet,config:[],isShowValue:!0}};n.openPanel(c);break}case 2:{n.openPanel();break}case 1:{n.openPanel({...s.createDefaultRule(),ranges:i});break}case 9:{o.executeCommand(oo.id,{ranges:i});break}case 10:{o.executeCommand(Wn.id);break}}return!0}};var If=Object.defineProperty,xf=Object.getOwnPropertyDescriptor,Of=(e,t,n,r)=>{for(var o=r>1?void 0:r?xf(t,n):t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=(r?a(t,n,o):a(o))||o);return r&&o&&If(t,n,o),o},Ke=(e,t)=>(n,r)=>t(n,r,e);let kt=class extends g.Disposable{constructor(e,t,n,r,o,i,a){super(),this._sheetInterceptorService=e,this._conditionalFormattingService=t,this._univerInstanceService=n,this._renderManagerService=r,this._conditionalFormattingViewModel=o,this._conditionalFormattingRuleModel=i,this._sheetSkeletonManagerService=a,this._initViewModelInterceptor(),this._initSkeleton(),this._initRender()}_initRender(){const e=[[s.dataBarUKey,s.DataBar],[s.IconUKey,s.ConditionalFormattingIcon]],t=r=>{const o=r&&this._renderManagerService.getRenderById(r),i=o&&o.mainComponent;i&&e.forEach(([a,c])=>{i.getExtensionByKey(a)||i.register(new c)})};this.disposeWithMe(this._renderManagerService.currentRender$.subscribe(r=>{r&&t(r)}));const n=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET);n&&t(n.getUnitId())}_initSkeleton(){const e=()=>{var n,r;this._sheetSkeletonManagerService.reCalculate();const t=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=(n=this._renderManagerService.getRenderById(t))==null?void 0:n.mainComponent)==null||r.makeDirty()};this.disposeWithMe(this._conditionalFormattingViewModel.markDirty$.pipe(Ee.bufferTime(16),Ee.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return t.filter(o=>o.unitId===n.getUnitId()&&o.subUnitId===r.getSheetId()).length>0})).subscribe(e)),this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.pipe(Ee.bufferTime(16),Ee.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return t.filter(o=>["sort","delete"].includes(o.type)&&o.unitId===n.getUnitId()&&o.subUnitId===r.getSheetId()).length>0})).subscribe(e)),this.disposeWithMe(this._conditionalFormattingService.ruleComputeStatus$.pipe(Ee.bufferTime(16),Ee.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return t.filter(o=>o.unitId===n.getUnitId()&&o.subUnitId===r.getSheetId()).length>0})).subscribe(e))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(H.INTERCEPTOR_POINT.CELL_CONTENT,{handler:(e,t,n)=>{const r=this._conditionalFormattingService.composeStyle(t.unitId,t.subUnitId,t.row,t.col);if(!r)return n(e);const o=t.workbook.getStyles(),a={...(typeof(e==null?void 0:e.s)=="string"?o.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},c={...e,s:a};return r.style&&Object.assign(a,r.style),c.fontRenderExtension||(c.fontRenderExtension={},r.isShowValue!==void 0&&(c.fontRenderExtension.isSkip=!r.isShowValue)),r.dataBar&&(c.dataBar=r.dataBar),r.iconSet&&(c.iconSet=r.iconSet,c.fontRenderExtension.leftOffset=s.DEFAULT_PADDING+s.DEFAULT_WIDTH),n(c)}}))}};kt=Of([g.OnLifecycle(g.LifecycleStages.Rendered,kt),Ke(0,z.Inject(H.SheetInterceptorService)),Ke(1,z.Inject(s.ConditionalFormattingService)),Ke(2,z.Inject(g.IUniverInstanceService)),Ke(3,z.Inject(Ii.IRenderManagerService)),Ke(4,z.Inject(s.ConditionalFormattingViewModel)),Ke(5,z.Inject(s.ConditionalFormattingRuleModel)),Ke(6,z.Inject(ce.SheetSkeletonManagerService))],kt);var Ef=Object.defineProperty,Mf=Object.getOwnPropertyDescriptor,Df=(e,t,n,r)=>{for(var o=r>1?void 0:r?Mf(t,n):t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=(r?a(t,n,o):a(o))||o);return r&&o&&Ef(t,n,o),o},Tt=(e,t)=>(n,r)=>t(n,r,e);let Wt=class extends g.Disposable{constructor(t,n,r,o,i){super();Be(this,"_copyInfo");this._sheetClipboardService=t,this._conditionalFormattingRuleModel=n,this._injector=r,this._conditionalFormattingViewModel=o,this._univerInstanceService=i,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:s.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(t,n,r)=>this._collectConditionalRule(t,n,r),onPasteCells:(t,n,r,o)=>{const{copyType:i=ce.COPY_TYPE.COPY,pasteType:a}=o,{range:c}=t||{},{range:l}=n;return this._generateConditionalFormattingMutations(l,{copyType:i,pasteType:a,copyRange:c})}}))}_collectConditionalRule(t,n,r){const o=new g.ObjectMatrix,i={};this._copyInfo={matrix:o,info:{unitId:t,subUnitId:n,cfMap:i}};const a=this._conditionalFormattingViewModel.getMatrix(t,n);if(!a)return;const c={get:this._injector.get.bind(this._injector)},l=ce.rangeToDiscreteRange(r,c,t,n);if(!l)return;const{rows:u,cols:d}=l,h=new Set;u.forEach((f,v)=>{d.forEach((y,b)=>{const x=this._conditionalFormattingViewModel.getCellCf(t,n,f,y,a);x&&(x.cfList.forEach(_=>h.add(_.cfId)),o.setValue(v,b,x.cfList.map(_=>_.cfId)))})}),h.forEach(f=>{const v=this._conditionalFormattingRuleModel.getRule(t,n,f);v&&(i[f]=v.rule)})}_generateConditionalFormattingMutations(t,n){const r=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET),o=r.getActiveSheet(),i=r.getUnitId(),a=o.getSheetId();if(n.copyType===ce.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!n.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(n.pasteType))return{redos:[],undos:[]};const{ranges:[c,l],mapFunc:u}=ce.virtualizeDiscreteRanges([n.copyRange,t]),d=ce.getRepeatRange(c,l,!0),h=this._conditionalFormattingViewModel.getMatrix(i,a),f={};g.Range.foreach(l,(m,O)=>{const{row:M,col:I}=u(m,O),F=this._conditionalFormattingViewModel.getCellCf(i,a,M,I,h);F&&F.cfList.forEach($=>{if(!f[$.cfId]){const j=new g.ObjectMatrix;f[$.cfId]=j;const q=this._conditionalFormattingRuleModel.getRule(i,a,$.cfId);q==null||q.ranges.forEach(T=>{g.Range.foreach(T,(E,Z)=>{j.setValue(E,Z,1)})})}f[$.cfId].realDeleteValue(M,I)})});const{matrix:v,info:y}=this._copyInfo,b=[];let x=this._conditionalFormattingRuleModel.createCfId(i,a);const _={},S=m=>{if(_[m])return _[m];const O=y==null?void 0:y.cfMap[m],M=[...this._conditionalFormattingRuleModel.getSubunitRules(i,a)||[],...b].find(I=>g.Tools.diffValue(I.rule,O));if(M)return _[m]=M,M;{const I={rule:O,cfId:x,ranges:[],stopIfTrue:!1};return _[m]=I,b.push(I),x=`${Number(x)+1}`,I}};d.forEach(m=>{v&&v.forValue((O,M,I)=>{const F=g.Rectangle.getPositionRange({startRow:O,endRow:O,startColumn:M,endColumn:M},m.startRange),{row:$,col:j}=u(F.startRow,F.startColumn);I.forEach(q=>{if(!f[q]){const T=S(q),E=new g.ObjectMatrix;f[q]=E,T.ranges.forEach(Z=>{g.Range.foreach(Z,(me,L)=>{E.setValue(me,L,1)})})}f[q].setValue($,j,1)})})});const C=[],R=[];for(const m in f){const O=f[m],M=H.findAllRectangle(H.createTopMatrixFromMatrix(O));if(!M.length){const I={unitId:i,subUnitId:a,cfId:m};C.push({id:s.DeleteConditionalRuleMutation.id,params:I}),R.push(...s.DeleteConditionalRuleMutationUndoFactory(this._injector,I))}if(b.some(I=>I.cfId===m)){const I=S(m),F={unitId:i,subUnitId:a,rule:{...I,ranges:M}};C.push({id:s.AddConditionalRuleMutation.id,params:F}),R.push(s.AddConditionalRuleMutationUndoFactory(this._injector,F))}else{const I=this._conditionalFormattingRuleModel.getRule(i,a,m);if(!I)continue;const F={unitId:i,subUnitId:a,rule:{...I,ranges:M}};C.push({id:s.SetConditionalRuleMutation.id,params:F}),R.push(...s.setConditionalRuleMutationUndoFactory(this._injector,F))}}return{redos:C,undos:R}}};Wt=Df([g.OnLifecycle(g.LifecycleStages.Rendered,Wt),Tt(0,z.Inject(ce.ISheetClipboardService)),Tt(1,z.Inject(s.ConditionalFormattingRuleModel)),Tt(2,z.Inject(z.Injector)),Tt(3,z.Inject(s.ConditionalFormattingViewModel)),Tt(4,z.Inject(g.IUniverInstanceService))],Wt);var Pf=Object.defineProperty,Nf=Object.getOwnPropertyDescriptor,Ff=(e,t,n,r)=>{for(var o=r>1?void 0:r?Nf(t,n):t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=(r?a(t,n,o):a(o))||o);return r&&o&&Pf(t,n,o),o},Rt=(e,t)=>(n,r)=>t(n,r,e);let qt=class extends g.Disposable{constructor(e,t,n,r,o){super(),this._injector=e,this._univerInstanceService=t,this._autoFillService=n,this._conditionalFormattingRuleModel=r,this._conditionalFormattingViewModel=o,this._initAutoFill()}_initAutoFill(){const e=()=>({redos:[],undos:[]}),t=(o,i,a,c,l)=>{const u=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getUnitId(),d=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),h={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},f={startRow:i.row,startColumn:i.col,endColumn:i.col,endRow:i.row};g.Range.foreach(a,(v,y)=>{const b=g.Rectangle.getPositionRange({startRow:v,startColumn:y,endColumn:y,endRow:v},h),x=g.Rectangle.getPositionRange({startRow:v,startColumn:y,endColumn:y,endRow:v},f),{row:_,col:S}=l(b.startRow,b.startColumn),C=this._conditionalFormattingViewModel.getCellCf(u,d,_,S),{row:R,col:m}=l(x.startRow,x.startColumn),O=this._conditionalFormattingViewModel.getCellCf(u,d,R,m);O&&O.cfList.forEach(M=>{let I=c.get(M.cfId);if(!c.get(M.cfId)){const F=this._conditionalFormattingRuleModel.getRule(u,d,M.cfId);if(!F)return;I=new g.ObjectMatrix,F.ranges.forEach($=>{g.Range.foreach($,(j,q)=>{I.setValue(j,q,1)})}),c.set(M.cfId,I)}I.realDeleteValue(R,m)}),C&&C.cfList.forEach(M=>{let I=c.get(M.cfId);if(!c.get(M.cfId)){const F=this._conditionalFormattingRuleModel.getRule(u,d,M.cfId);if(!F)return;I=new g.ObjectMatrix,F.ranges.forEach($=>{g.Range.foreach($,(j,q)=>{I.setValue(j,q,1)})}),c.set(M.cfId,I)}I.setValue(R,m,1)})})},n=(o,i)=>{var _,S;const a=(_=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET))==null?void 0:_.getUnitId(),c=(S=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET))==null?void 0:S.getActiveSheet().getSheetId(),l=new Map,u=[],d=[];if(!a||!c)return e();const h=ce.virtualizeDiscreteRanges([o,i]),[f,v]=h.ranges,{mapFunc:y}=h,b={row:f.startRow,col:f.startColumn};return ce.getAutoFillRepeatRange(f,v).forEach(C=>{t(b,C.repeatStartCell,C.relativeRange,l,y)}),l.forEach((C,R)=>{const m=this._conditionalFormattingRuleModel.getRule(a,c,R);if(!m)return;const O=H.findAllRectangle(H.createTopMatrixFromMatrix(C)),M={unitId:a,subUnitId:c,rule:{...m,ranges:O}};u.push({id:s.SetConditionalRuleMutation.id,params:M}),d.push(...s.setConditionalRuleMutationUndoFactory(this._injector,M))}),{undos:d,redos:u}},r={id:s.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(o,i,a)=>{if(a===ce.APPLY_TYPE.COPY||a===ce.APPLY_TYPE.ONLY_FORMAT||a===ce.APPLY_TYPE.SERIES){const{source:c,target:l}=o;return n(c,l)}return e()}};this.disposeWithMe(this._autoFillService.addHook(r))}};qt=Ff([g.OnLifecycle(g.LifecycleStages.Rendered,qt),Rt(0,z.Inject(z.Injector)),Rt(1,z.Inject(g.IUniverInstanceService)),Rt(2,z.Inject(ce.IAutoFillService)),Rt(3,z.Inject(s.ConditionalFormattingRuleModel)),Rt(4,z.Inject(s.ConditionalFormattingViewModel))],qt);var $f=Object.defineProperty,jf=Object.getOwnPropertyDescriptor,Lf=(e,t,n,r)=>{for(var o=r>1?void 0:r?jf(t,n):t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=(r?a(t,n,o):a(o))||o);return r&&o&&$f(t,n,o),o},_t=(e,t)=>(n,r)=>t(n,r,e);let Bt=class extends g.Disposable{constructor(e,t,n,r,o){super(),this._conditionalFormattingRuleModel=e,this._univerInstanceService=t,this._injector=n,this._sheetSkeletonManagerService=r,this._refRangeService=o,this._initRefRange()}_initRefRange(){const e=new Map,t=(r,o,i)=>`${r}_${o}_${i}`,n=(r,o,i)=>{const a=l=>{const u=[...i.ranges],d=u.map(f=>H.handleDefaultRangeChangeWithEffectRefCommands(f,l)).filter(f=>!!f);if(s.isRangesEqual(d,u))return{redos:[],undos:[]};if(d.length){const f={unitId:r,subUnitId:o,rule:{...i,ranges:d}},v=[{id:s.SetConditionalRuleMutation.id,params:f}],y=s.setConditionalRuleMutationUndoFactory(this._injector,f);return{redos:v,undos:y}}else{const f={unitId:r,subUnitId:o,cfId:i.cfId},v=[{id:s.DeleteConditionalRuleMutation.id,params:f}],y=s.DeleteConditionalRuleMutationUndoFactory(this._injector,f);return{redos:v,undos:y}}},c=[];i.ranges.forEach(l=>{const u=this._refRangeService.registerRefRange(l,a);c.push(()=>u.dispose())}),e.set(t(r,o,i.cfId),()=>c.forEach(l=>l()))};this.disposeWithMe(_e.merge(this._sheetSkeletonManagerService.currentSkeleton$.pipe(Ee.map(r=>r==null?void 0:r.sheetId),Ee.distinctUntilChanged())).pipe(Ee.switchMap(()=>new _e.Observable(r=>{const o=new g.DisposableCollection;return r.next(o),()=>{o.dispose()}}))).subscribe(r=>{r.add(g.toDisposable(this._conditionalFormattingRuleModel.$ruleChange.subscribe(o=>{const{unitId:i,subUnitId:a,rule:c}=o,l=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET),u=l.getActiveSheet();if(!(o.unitId!==l.getUnitId()||o.subUnitId!==u.getSheetId()))switch(o.type){case"add":{n(o.unitId,o.subUnitId,o.rule);break}case"delete":{const d=e.get(t(i,a,c.cfId));d&&d();break}case"set":{const d=e.get(t(i,a,c.cfId));d&&d(),n(o.unitId,o.subUnitId,o.rule)}}})))})),this.disposeWithMe(g.toDisposable(()=>{e.forEach(r=>{r()}),e.clear()}))}};Bt=Lf([g.OnLifecycle(g.LifecycleStages.Rendered,Bt),_t(0,z.Inject(s.ConditionalFormattingRuleModel)),_t(1,z.Inject(g.IUniverInstanceService)),_t(2,z.Inject(z.Injector)),_t(3,z.Inject(ce.SheetSkeletonManagerService)),_t(4,z.Inject(H.RefRangeService))],Bt);var Vf=Object.defineProperty,Uf=Object.getOwnPropertyDescriptor,zf=(e,t,n,r)=>{for(var o=r>1?void 0:r?Uf(t,n):t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=(r?a(t,n,o):a(o))||o);return r&&o&&Vf(t,n,o),o},eo=(e,t)=>(n,r)=>t(n,r,e);let Gt=class extends g.Disposable{constructor(e,t){super(),this._editorBridgeService=e,this._conditionalFormattingService=t,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(g.toDisposable(this._editorBridgeService.interceptor.intercept(this._editorBridgeService.interceptor.getInterceptPoints().AFTER_CELL_EDIT,{handler:(e,t,n)=>{const r=this._conditionalFormattingService.composeStyle(t.unitId,t.subUnitId,t.row,t.col);if(r!=null&&r.style&&(e!=null&&e.p)){const o=Object.keys(r==null?void 0:r.style);if(o.length>0){const i=s.getStringFromDataStream(e.p),a={...(typeof e.s=="string"?t.workbook.getStyles().get(e.s):e.s)||{}};o.forEach(l=>{delete a[l]});const c={...e,s:{...a},v:i};return delete c.p,n(c)}}return n(e)}})))}};Gt=zf([g.OnLifecycle(g.LifecycleStages.Rendered,Gt),eo(0,z.Inject(ce.IEditorBridgeService)),eo(1,z.Inject(s.ConditionalFormattingService))],Gt);var Af=Object.defineProperty,Hf=Object.getOwnPropertyDescriptor,kf=(e,t,n,r)=>{for(var o=r>1?void 0:r?Hf(t,n):t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=(r?a(t,n,o):a(o))||o);return r&&o&&Af(t,n,o),o},wt=(e,t)=>(n,r)=>t(n,r,e);let Xt=class extends g.Disposable{constructor(e,t,n,r,o){super(),this._injector=e,this._univerInstanceService=t,this._sheetInterceptorService=n,this._selectionManagerService=r,this._conditionalFormattingRuleModel=o,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{const t=[],n=[],r={redos:t,undos:n};if([H.ClearSelectionFormatCommand.id,H.ClearSelectionAllCommand.id].includes(e.id)){const o=this._selectionManagerService.getSelectionRanges();if(!o)return r;const i=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET),a=i.getActiveSheet(),c=this._conditionalFormattingRuleModel.getSubunitRules(i.getUnitId(),a.getSheetId());if(!c||!c.length)return r;c.filter(l=>o.some(u=>l.ranges.some(d=>g.Rectangle.getIntersects(d,u)))).forEach(l=>{const d=new H.RangeMergeUtil().add(...l.ranges).subtract(...o).merge();if(d.length){const h={id:s.SetConditionalRuleMutation.id,params:{unitId:i.getUnitId(),subUnitId:a.getSheetId(),rule:{...l,ranges:d}}},f=s.setConditionalRuleMutationUndoFactory(this._injector,h.params);t.push(h),n.push(...f)}else{const h={id:s.DeleteConditionalRuleMutation.id,params:{unitId:i.getUnitId(),subUnitId:a.getSheetId(),cfId:l.cfId}},f=s.DeleteConditionalRuleMutationUndoFactory(this._injector,h.params);t.push(h),n.push(...f)}})}return r}}))}};Xt=kf([g.OnLifecycle(g.LifecycleStages.Rendered,Xt),wt(0,z.Inject(z.Injector)),wt(1,z.Inject(g.IUniverInstanceService)),wt(2,z.Inject(H.SheetInterceptorService)),wt(3,z.Inject(H.SelectionManagerService)),wt(4,z.Inject(s.ConditionalFormattingRuleModel))],Xt);var Wf=Object.defineProperty,qf=Object.getOwnPropertyDescriptor,Bf=(e,t,n,r)=>{for(var o=r>1?void 0:r?qf(t,n):t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=(r?a(t,n,o):a(o))||o);return r&&o&&Wf(t,n,o),o},to=(e,t)=>(n,r)=>t(n,r,e),It;exports.UniverSheetsConditionalFormattingUIPlugin=(It=class extends g.Plugin{constructor(t,n,r){super(),this._injector=n,this._commandService=r,this._initCommand(),s.SheetsConditionalFormattingPlugin.dependencyList.forEach(o=>{this._injector.add(o)}),this._injector.add([kt]),this._injector.add([Bt]),this._injector.add([Wt]),this._injector.add([qt]),this._injector.add([Mt]),this._injector.add([Et]),this._injector.add([Gt]),this._injector.add([Xt])}_initCommand(){[...s.SheetsConditionalFormattingPlugin.mutationList,...exports.UniverSheetsConditionalFormattingUIPlugin.commandList].forEach(t=>{this._commandService.registerCommand(t)})}},Be(It,"pluginName",s.SHEET_CONDITIONAL_FORMATTING_PLUGIN),Be(It,"type",g.UniverInstanceType.UNIVER_SHEET),Be(It,"commandList",[xi,Oi,Ei,Mi,Di,Pi,Ni,Fi,$i,Ti,kn,oi,ti,ri,oo,Wn]),It);exports.UniverSheetsConditionalFormattingUIPlugin=Bf([to(1,z.Inject(z.Injector)),to(2,z.Inject(g.ICommandService))],exports.UniverSheetsConditionalFormattingUIPlugin);exports.enUS=rc;exports.zhCN=ni;
11
+ `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&$o(e.body,"react-draggable-transparent-selection")}function hs(e){if(e)try{if(e.body&&jo(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function $o(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function jo(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Le={};Object.defineProperty(Le,"__esModule",{value:!0});Le.canDragX=vs;Le.canDragY=ys;Le.createCoreData=Ss;Le.createDraggableData=bs;Le.getBoundPosition=gs;Le.getControlPosition=Cs;Le.snapToGrid=ms;var Te=je,pt=re;function gs(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:Ts(r);const o=or(e);if(typeof r=="string"){const{ownerDocument:a}=o,i=a.defaultView;let c;if(r==="parent"?c=o.parentNode:c=a.querySelector(r),!(c instanceof i.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=c,u=i.getComputedStyle(o),d=i.getComputedStyle(l);r={left:-o.offsetLeft+(0,Te.int)(d.paddingLeft)+(0,Te.int)(u.marginLeft),top:-o.offsetTop+(0,Te.int)(d.paddingTop)+(0,Te.int)(u.marginTop),right:(0,pt.innerWidth)(l)-(0,pt.outerWidth)(o)-o.offsetLeft+(0,Te.int)(d.paddingRight)-(0,Te.int)(u.marginRight),bottom:(0,pt.innerHeight)(l)-(0,pt.outerHeight)(o)-o.offsetTop+(0,Te.int)(d.paddingBottom)-(0,Te.int)(u.marginBottom)}}return(0,Te.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Te.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Te.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Te.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function ms(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function vs(e){return e.props.axis==="both"||e.props.axis==="x"}function ys(e){return e.props.axis==="both"||e.props.axis==="y"}function Cs(e,t,n){const r=typeof t=="number"?(0,pt.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=or(n),a=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,pt.offsetXYFromParent)(r||e,a,n.props.scale)}function Ss(e,t,n){const r=!(0,Te.isNum)(e.lastX),o=or(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function bs(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function Ts(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function or(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var sn={},ln={};Object.defineProperty(ln,"__esModule",{value:!0});ln.default=Rs;function Rs(){}Object.defineProperty(sn,"__esModule",{value:!0});sn.default=void 0;var Tn=ws(w),Ce=ar(qe),_s=ar(ro),pe=re,ke=Le,Rn=je,St=ar(ln);function ar(e){return e&&e.__esModule?e:{default:e}}function Lo(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Lo=function(r){return r?n:t})(e)}function ws(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Lo(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function ge(e,t,n){return t=Is(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Is(e){var t=xs(e,"string");return typeof t=="symbol"?t:String(t)}function xs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Oe={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let He=Oe.mouse,cn=class extends Tn.Component{constructor(){super(...arguments),ge(this,"dragging",!1),ge(this,"lastX",NaN),ge(this,"lastY",NaN),ge(this,"touchIdentifier",null),ge(this,"mounted",!1),ge(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,pe.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,pe.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,pe.getTouchIdentifier)(t);this.touchIdentifier=o;const a=(0,ke.getControlPosition)(t,o,this);if(a==null)return;const{x:i,y:c}=a,l=(0,ke.createCoreData)(this,i,c);(0,St.default)("DraggableCore: handleDragStart: %j",l),(0,St.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,pe.addUserSelectStyles)(r),this.dragging=!0,this.lastX=i,this.lastY=c,(0,pe.addEvent)(r,He.move,this.handleDrag),(0,pe.addEvent)(r,He.stop,this.handleDragStop))}),ge(this,"handleDrag",t=>{const n=(0,ke.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let c=r-this.lastX,l=o-this.lastY;if([c,l]=(0,ke.snapToGrid)(this.props.grid,c,l),!c&&!l)return;r=this.lastX+c,o=this.lastY+l}const a=(0,ke.createCoreData)(this,r,o);if((0,St.default)("DraggableCore: handleDrag: %j",a),this.props.onDrag(t,a)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),ge(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,ke.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,u=o-this.lastY||0;[l,u]=(0,ke.snapToGrid)(this.props.grid,l,u),r=this.lastX+l,o=this.lastY+u}const a=(0,ke.createCoreData)(this,r,o);if(this.props.onStop(t,a)===!1||this.mounted===!1)return!1;const c=this.findDOMNode();c&&this.props.enableUserSelectHack&&(0,pe.removeUserSelectStyles)(c.ownerDocument),(0,St.default)("DraggableCore: handleDragStop: %j",a),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,c&&((0,St.default)("DraggableCore: Removing handlers"),(0,pe.removeEvent)(c.ownerDocument,He.move,this.handleDrag),(0,pe.removeEvent)(c.ownerDocument,He.stop,this.handleDragStop))}),ge(this,"onMouseDown",t=>(He=Oe.mouse,this.handleDragStart(t))),ge(this,"onMouseUp",t=>(He=Oe.mouse,this.handleDragStop(t))),ge(this,"onTouchStart",t=>(He=Oe.touch,this.handleDragStart(t))),ge(this,"onTouchEnd",t=>(He=Oe.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,pe.addEvent)(t,Oe.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,pe.removeEvent)(n,Oe.mouse.move,this.handleDrag),(0,pe.removeEvent)(n,Oe.touch.move,this.handleDrag),(0,pe.removeEvent)(n,Oe.mouse.stop,this.handleDragStop),(0,pe.removeEvent)(n,Oe.touch.stop,this.handleDragStop),(0,pe.removeEvent)(t,Oe.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,pe.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:_s.default.findDOMNode(this)}render(){return Tn.cloneElement(Tn.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};sn.default=cn;ge(cn,"displayName","DraggableCore");ge(cn,"propTypes",{allowAnyClick:Ce.default.bool,children:Ce.default.node.isRequired,disabled:Ce.default.bool,enableUserSelectHack:Ce.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Ce.default.arrayOf(Ce.default.number),handle:Ce.default.string,cancel:Ce.default.string,nodeRef:Ce.default.object,onStart:Ce.default.func,onDrag:Ce.default.func,onStop:Ce.default.func,onMouseDown:Ce.default.func,scale:Ce.default.number,className:Rn.dontSetMe,style:Rn.dontSetMe,transform:Rn.dontSetMe});ge(cn,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=f(w),n=d(qe),r=d(ro),o=d(We),a=re,i=Le,c=je,l=d(sn),u=d(ln);function d(S){return S&&S.__esModule?S:{default:S}}function h(S){if(typeof WeakMap!="function")return null;var C=new WeakMap,R=new WeakMap;return(h=function(m){return m?R:C})(S)}function f(S,C){if(!C&&S&&S.__esModule)return S;if(S===null||typeof S!="object"&&typeof S!="function")return{default:S};var R=h(C);if(R&&R.has(S))return R.get(S);var m={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in S)if(M!=="default"&&Object.prototype.hasOwnProperty.call(S,M)){var I=O?Object.getOwnPropertyDescriptor(S,M):null;I&&(I.get||I.set)?Object.defineProperty(m,M,I):m[M]=S[M]}return m.default=S,R&&R.set(S,m),m}function v(){return v=Object.assign?Object.assign.bind():function(S){for(var C=1;C<arguments.length;C++){var R=arguments[C];for(var m in R)Object.prototype.hasOwnProperty.call(R,m)&&(S[m]=R[m])}return S},v.apply(this,arguments)}function y(S,C,R){return C=b(C),C in S?Object.defineProperty(S,C,{value:R,enumerable:!0,configurable:!0,writable:!0}):S[C]=R,S}function b(S){var C=x(S,"string");return typeof C=="symbol"?C:String(C)}function x(S,C){if(typeof S!="object"||S===null)return S;var R=S[Symbol.toPrimitive];if(R!==void 0){var m=R.call(S,C||"default");if(typeof m!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(S)}class _ extends t.Component{static getDerivedStateFromProps(C,R){let{position:m}=C,{prevPropsPosition:O}=R;return m&&(!O||m.x!==O.x||m.y!==O.y)?((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:m,prevPropsPosition:O}),{x:m.x,y:m.y,prevPropsPosition:{...m}}):null}constructor(C){super(C),y(this,"onDragStart",(R,m)=>{if((0,u.default)("Draggable: onDragStart: %j",m),this.props.onStart(R,(0,i.createDraggableData)(this,m))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),y(this,"onDrag",(R,m)=>{if(!this.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",m);const O=(0,i.createDraggableData)(this,m),M={x:O.x,y:O.y,slackX:0,slackY:0};if(this.props.bounds){const{x:F,y:$}=M;M.x+=this.state.slackX,M.y+=this.state.slackY;const[j,q]=(0,i.getBoundPosition)(this,M.x,M.y);M.x=j,M.y=q,M.slackX=this.state.slackX+(F-M.x),M.slackY=this.state.slackY+($-M.y),O.x=M.x,O.y=M.y,O.deltaX=M.x-this.state.x,O.deltaY=M.y-this.state.y}if(this.props.onDrag(R,O)===!1)return!1;this.setState(M)}),y(this,"onDragStop",(R,m)=>{if(!this.state.dragging||this.props.onStop(R,(0,i.createDraggableData)(this,m))===!1)return!1;(0,u.default)("Draggable: onDragStop: %j",m);const M={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:F,y:$}=this.props.position;M.x=F,M.y=$}this.setState(M)}),this.state={dragging:!1,dragged:!1,x:C.position?C.position.x:C.defaultPosition.x,y:C.position?C.position.y:C.defaultPosition.y,prevPropsPosition:{...C.position},slackX:0,slackY:0,isElementSVG:!1},C.position&&!(C.onDrag||C.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 C,R;return(C=(R=this.props)===null||R===void 0||(R=R.nodeRef)===null||R===void 0?void 0:R.current)!==null&&C!==void 0?C:r.default.findDOMNode(this)}render(){const{axis:C,bounds:R,children:m,defaultPosition:O,defaultClassName:M,defaultClassNameDragging:I,defaultClassNameDragged:F,position:$,positionOffset:j,scale:q,...T}=this.props;let E={},Z=null;const L=!!!$||this.state.dragging,B=$||O,ee={x:(0,i.canDragX)(this)&&L?this.state.x:B.x,y:(0,i.canDragY)(this)&&L?this.state.y:B.y};this.state.isElementSVG?Z=(0,a.createSVGTransform)(ee,j):E=(0,a.createCSSTransform)(ee,j);const se=(0,o.default)(m.props.className||"",M,{[I]:this.state.dragging,[F]:this.state.dragged});return t.createElement(l.default,v({},T,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(m),{className:se,style:{...m.props.style,...E},transform:Z}))}}e.default=_,y(_,"displayName","Draggable"),y(_,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),y(_,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(Mo);const{default:Vo,DraggableCore:Os}=Mo;an.exports=Vo;an.exports.default=Vo;an.exports.DraggableCore=Os;var Uo=an.exports,un={exports:{}},Ft={},ir={};ir.__esModule=!0;ir.cloneElement=Fs;var Es=Ms(w);function Ms(e){return e&&e.__esModule?e:{default:e}}function Or(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Er(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Or(Object(n),!0).forEach(function(r){Ds(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Or(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ds(e,t,n){return t=Ps(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ps(e){var t=Ns(e,"string");return typeof t=="symbol"?t:String(t)}function Ns(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fs(e,t){return t.style&&e.props.style&&(t.style=Er(Er({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),Es.default.cloneElement(e,t)}var $t={};$t.__esModule=!0;$t.resizableProps=void 0;var A=$s(qe);function $s(e){return e&&e.__esModule?e:{default:e}}var js={axis:A.default.oneOf(["both","x","y","none"]),className:A.default.string,children:A.default.element.isRequired,draggableOpts:A.default.shape({allowAnyClick:A.default.bool,cancel:A.default.string,children:A.default.node,disabled:A.default.bool,enableUserSelectHack:A.default.bool,offsetParent:A.default.node,grid:A.default.arrayOf(A.default.number),handle:A.default.string,nodeRef:A.default.object,onStart:A.default.func,onDrag:A.default.func,onStop:A.default.func,onMouseDown:A.default.func,scale:A.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var a;return(a=A.default.number).isRequired.apply(a,n)}return A.default.number.apply(A.default,n)},handle:A.default.oneOfType([A.default.node,A.default.func]),handleSize:A.default.arrayOf(A.default.number),lockAspectRatio:A.default.bool,maxConstraints:A.default.arrayOf(A.default.number),minConstraints:A.default.arrayOf(A.default.number),onResizeStop:A.default.func,onResizeStart:A.default.func,onResize:A.default.func,resizeHandles:A.default.arrayOf(A.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:A.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var a;return(a=A.default.number).isRequired.apply(a,n)}return A.default.number.apply(A.default,n)}};$t.resizableProps=js;Ft.__esModule=!0;Ft.default=void 0;var bt=As(w),Ls=Uo,Vs=ir,Us=$t,zs=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function zo(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(zo=function(o){return o?n:t})(e)}function As(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=zo(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function jn(){return jn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jn.apply(this,arguments)}function ks(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,a;for(a=0;a<r.length;a++)o=r[a],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Mr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function _n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Mr(Object(n),!0).forEach(function(r){Hs(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mr(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hs(e,t,n){return t=Ws(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ws(e){var t=qs(e,"string");return typeof t=="symbol"?t:String(t)}function qs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bs(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ln(e,t)}function Ln(e,t){return Ln=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Ln(e,t)}var sr=function(e){Bs(t,e);function t(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=e.call.apply(e,[this].concat(a))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,a){var i=this.props,c=i.minConstraints,l=i.maxConstraints,u=i.lockAspectRatio;if(!c&&!l&&!u)return[o,a];if(u){var d=this.props.width/this.props.height,h=o-this.props.width,f=a-this.props.height;Math.abs(h)>Math.abs(f*d)?a=o/d:o=a*d}var v=o,y=a,b=this.slack||[0,0],x=b[0],_=b[1];return o+=x,a+=_,c&&(o=Math.max(c[0],o),a=Math.max(c[1],a)),l&&(o=Math.min(l[0],o),a=Math.min(l[1],a)),this.slack=[x+(v-o),_+(y-a)],[o,a]},n.resizeHandler=function(o,a){var i=this;return function(c,l){var u=l.node,d=l.deltaX,h=l.deltaY;o==="onResizeStart"&&i.resetData();var f=(i.props.axis==="both"||i.props.axis==="x")&&a!=="n"&&a!=="s",v=(i.props.axis==="both"||i.props.axis==="y")&&a!=="e"&&a!=="w";if(!(!f&&!v)){var y=a[0],b=a[a.length-1],x=u.getBoundingClientRect();if(i.lastHandleRect!=null){if(b==="w"){var _=x.left-i.lastHandleRect.left;d+=_}if(y==="n"){var S=x.top-i.lastHandleRect.top;h+=S}}i.lastHandleRect=x,b==="w"&&(d=-d),y==="n"&&(h=-h);var C=i.props.width+(f?d/i.props.transformScale:0),R=i.props.height+(v?h/i.props.transformScale:0),m=i.runConstraints(C,R);C=m[0],R=m[1];var O=C!==i.props.width||R!==i.props.height,M=typeof i.props[o]=="function"?i.props[o]:null,I=o==="onResize"&&!O;M&&!I&&(c.persist==null||c.persist(),M(c,{node:u,size:{width:C,height:R},handle:a})),o==="onResizeStop"&&i.resetData()}}},n.renderResizeHandle=function(o,a){var i=this.props.handle;if(!i)return bt.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:a});if(typeof i=="function")return i(o,a);var c=typeof i.type=="string",l=_n({ref:a},c?{}:{handleAxis:o});return bt.cloneElement(i,l)},n.render=function(){var o=this,a=this.props,i=a.children,c=a.className,l=a.draggableOpts;a.width,a.height,a.handle,a.handleSize,a.lockAspectRatio,a.axis,a.minConstraints,a.maxConstraints,a.onResize,a.onResizeStop,a.onResizeStart;var u=a.resizeHandles;a.transformScale;var d=ks(a,zs);return(0,Vs.cloneElement)(i,_n(_n({},d),{},{className:(c?c+" ":"")+"react-resizable",children:[].concat(i.props.children,u.map(function(h){var f,v=(f=o.handleRefs[h])!=null?f:o.handleRefs[h]=bt.createRef();return bt.createElement(Ls.DraggableCore,jn({},l,{nodeRef:v,key:"resizableHandle-"+h,onStop:o.resizeHandler("onResizeStop",h),onStart:o.resizeHandler("onResizeStart",h),onDrag:o.resizeHandler("onResize",h)}),o.renderResizeHandle(h,v))}))}))},t}(bt.Component);Ft.default=sr;sr.propTypes=Us.resizableProps;sr.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var dn={};dn.__esModule=!0;dn.default=void 0;var wn=Zs(w),Gs=Ao(qe),Xs=Ao(Ft),Ys=$t,Ks=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function Ao(e){return e&&e.__esModule?e:{default:e}}function ko(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ko=function(o){return o?n:t})(e)}function Zs(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ko(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function Vn(){return Vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vn.apply(this,arguments)}function Dr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dr(Object(n),!0).forEach(function(r){Js(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dr(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Js(e,t,n){return t=Qs(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qs(e){var t=el(e,"string");return typeof t=="symbol"?t:String(t)}function el(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tl(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,a;for(a=0;a<r.length;a++)o=r[a],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function nl(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Un(e,t)}function Un(e,t){return Un=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Un(e,t)}var Ho=function(e){nl(t,e);function t(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=e.call.apply(e,[this].concat(a))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(c,l){var u=l.size;r.props.onResize?(c.persist==null||c.persist(),r.setState(u,function(){return r.props.onResize&&r.props.onResize(c,l)})):r.setState(u)},r}t.getDerivedStateFromProps=function(o,a){return a.propsWidth!==o.width||a.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,a=o.handle,i=o.handleSize;o.onResize;var c=o.onResizeStart,l=o.onResizeStop,u=o.draggableOpts,d=o.minConstraints,h=o.maxConstraints,f=o.lockAspectRatio,v=o.axis;o.width,o.height;var y=o.resizeHandles,b=o.style,x=o.transformScale,_=tl(o,Ks);return wn.createElement(Xs.default,{axis:v,draggableOpts:u,handle:a,handleSize:i,height:this.state.height,lockAspectRatio:f,maxConstraints:h,minConstraints:d,onResizeStart:c,onResize:this.onResize,onResizeStop:l,resizeHandles:y,transformScale:x,width:this.state.width},wn.createElement("div",Vn({},_,{style:Yt(Yt({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(wn.Component);dn.default=Ho;Ho.propTypes=Yt(Yt({},Ys.resizableProps),{},{children:Gs.default.element});un.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};un.exports.Resizable=Ft.default;un.exports.ResizableBox=dn.default;var rl=un.exports,ze={};Object.defineProperty(ze,"__esModule",{value:!0});ze.resizeHandleType=ze.resizeHandleAxesType=ze.default=void 0;var H=Wo(qe),ol=Wo(w);function Wo(e){return e&&e.__esModule?e:{default:e}}const al=ze.resizeHandleAxesType=H.default.arrayOf(H.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),il=ze.resizeHandleType=H.default.oneOfType([H.default.node,H.default.func]);ze.default={className:H.default.string,style:H.default.object,width:H.default.number,autoSize:H.default.bool,cols:H.default.number,draggableCancel:H.default.string,draggableHandle:H.default.string,verticalCompact:function(e){e.verticalCompact},compactType:H.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&W.validateLayout(t,"layout")},margin:H.default.arrayOf(H.default.number),containerPadding:H.default.arrayOf(H.default.number),rowHeight:H.default.number,maxRows:H.default.number,isBounded:H.default.bool,isDraggable:H.default.bool,isResizable:H.default.bool,allowOverlap:H.default.bool,preventCollision:H.default.bool,useCSSTransforms:H.default.bool,transformScale:H.default.number,isDroppable:H.default.bool,resizeHandles:al,resizeHandle:il,onLayoutChange:H.default.func,onDragStart:H.default.func,onDrag:H.default.func,onDragStop:H.default.func,onResizeStart:H.default.func,onResize:H.default.func,onResizeStop:H.default.func,onDrop:H.default.func,droppingItem:H.default.shape({i:H.default.string.isRequired,w:H.default.number.isRequired,h:H.default.number.isRequired}),children:function(e,t){const n=e[t],r={};ol.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:H.default.any};Object.defineProperty(on,"__esModule",{value:!0});on.default=void 0;var lt=lr(w),X=lr(qe),sl=Uo,ll=rl,ct=W,de=$e,Pr=ze,cl=lr(We);function lr(e){return e&&e.__esModule?e:{default:e}}function Fe(e,t,n){return t=ul(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ul(e){var t=dl(e,"string");return typeof t=="symbol"?t:String(t)}function dl(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class cr extends lt.default.Component{constructor(){super(...arguments),Fe(this,"state",{resizing:null,dragging:null,className:""}),Fe(this,"elementRef",lt.default.createRef()),Fe(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:a}=this.props;if(!o)return;const i={top:0,left:0},{offsetParent:c}=r;if(!c)return;const l=c.getBoundingClientRect(),u=r.getBoundingClientRect(),d=u.left/a,h=l.left/a,f=u.top/a,v=l.top/a;i.left=d-h+c.scrollLeft,i.top=f-v+c.scrollTop,this.setState({dragging:i});const{x:y,y:b}=(0,de.calcXY)(this.getPositionParams(),i.top,i.left,this.props.w,this.props.h);return o.call(this,this.props.i,y,b,{e:t,node:r,newPosition:i})}),Fe(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:a}=n;const{onDrag:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let c=this.state.dragging.top+a,l=this.state.dragging.left+o;const{isBounded:u,i:d,w:h,h:f,containerWidth:v}=this.props,y=this.getPositionParams();if(u){const{offsetParent:C}=r;if(C){const{margin:R,rowHeight:m,containerPadding:O}=this.props,M=C.clientHeight-(0,de.calcGridItemWHPx)(f,m,R[1]);c=(0,de.clamp)(c-O[1],0,M);const I=(0,de.calcGridColWidth)(y),F=v-(0,de.calcGridItemWHPx)(h,I,R[0]);l=(0,de.clamp)(l-O[0],0,F)}}const b={top:c,left:l};this.setState({dragging:b});const{containerPadding:x}=this.props,{x:_,y:S}=(0,de.calcXY)(y,c-x[1],l-x[0],h,f);return i.call(this,d,_,S,{e:t,node:r,newPosition:b})}),Fe(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:a,h:i,i:c,containerPadding:l}=this.props,{left:u,top:d}=this.state.dragging,h={top:d,left:u};this.setState({dragging:null});const{x:f,y:v}=(0,de.calcXY)(this.getPositionParams(),d-l[1],u-l[0],a,i);return o.call(this,c,f,v,{e:t,node:r,newPosition:h})}),Fe(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Fe(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Fe(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,de.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,de.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,ct.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:a}=this.state,i=a&&n.left!==o.left||n.top!==o.top;if(!a)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(i){const c=n.left-a.left,l=n.top-a.top;this.onDrag(n.e,{node:r,deltaX:c,deltaY:l})}}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:n,containerWidth:r,useCSSTransforms:o}=this.props;let a;return o?a=(0,ct.setTransform)(t):(a=(0,ct.setTopLeft)(t),n&&(a.left=(0,ct.perc)(t.left/r),a.width=(0,ct.perc)(t.width/r))),a}mixinDraggable(t,n){return lt.default.createElement(sl.DraggableCore,{disabled:!n,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,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:a,minH:i,maxW:c,maxH:l,transformScale:u,resizeHandles:d,resizeHandle:h}=this.props,f=this.getPositionParams(),v=(0,de.calcGridItemPosition)(f,0,0,o,0).width,y=(0,de.calcGridItemPosition)(f,0,0,a,i),b=(0,de.calcGridItemPosition)(f,0,0,c,l),x=[y.width,y.height],_=[Math.min(b.width,v),Math.min(b.height,1/0)];return lt.default.createElement(ll.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:_,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:u,resizeHandles:d,handle:h},t)}onResizeHandler(t,n,r,o){let{node:a,size:i,handle:c}=n;const l=this.props[o];if(!l)return;const{x:u,y:d,i:h,maxH:f,minH:v,containerWidth:y}=this.props,{minW:b,maxW:x}=this.props;let _=i;a&&(_=(0,ct.resizeItemInDirection)(c,r,i,y),this.setState({resizing:o==="onResizeStop"?null:_}));let{w:S,h:C}=(0,de.calcWH)(this.getPositionParams(),_.width,_.height,u,d,c);S=(0,de.clamp)(S,Math.max(b,1),x),C=(0,de.clamp)(C,v,f),l.call(this,h,S,C,{e:t,node:a,size:_,handle:c})}render(){const{x:t,y:n,w:r,h:o,isDraggable:a,isResizable:i,droppingPosition:c,useCSSTransforms:l}=this.props,u=(0,de.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),d=lt.default.Children.only(this.props.children);let h=lt.default.cloneElement(d,{ref:this.elementRef,className:(0,cl.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":a,"react-draggable-dragging":!!this.state.dragging,dropping:!!c,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(u)}});return h=this.mixinResizable(h,u,i),h=this.mixinDraggable(h,a),h}}on.default=cr;Fe(cr,"propTypes",{children:X.default.element,cols:X.default.number.isRequired,containerWidth:X.default.number.isRequired,rowHeight:X.default.number.isRequired,margin:X.default.array.isRequired,maxRows:X.default.number.isRequired,containerPadding:X.default.array.isRequired,x:X.default.number.isRequired,y:X.default.number.isRequired,w:X.default.number.isRequired,h:X.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:X.default.string.isRequired,resizeHandles:Pr.resizeHandleAxesType,resizeHandle:Pr.resizeHandleType,onDragStop:X.default.func,onDragStart:X.default.func,onDrag:X.default.func,onResizeStop:X.default.func,onResizeStart:X.default.func,onResize:X.default.func,isDraggable:X.default.bool.isRequired,isResizable:X.default.bool.isRequired,isBounded:X.default.bool.isRequired,static:X.default.bool,useCSSTransforms:X.default.bool.isRequired,transformScale:X.default.number,className:X.default.string,handle:X.default.string,cancel:X.default.string,droppingPosition:X.default.shape({e:X.default.object.isRequired,left:X.default.number.isRequired,top:X.default.number.isRequired})});Fe(cr,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(Nt,"__esModule",{value:!0});Nt.default=void 0;var Ge=gl(w),In=Gn,fl=ur(We),V=W,pl=$e,Nr=ur(on),hl=ur(ze);function ur(e){return e&&e.__esModule?e:{default:e}}function qo(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(qo=function(r){return r?n:t})(e)}function gl(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=qo(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function he(e,t,n){return t=ml(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ml(e){var t=vl(e,"string");return typeof t=="symbol"?t:String(t)}function vl(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Fr="react-grid-layout";let Bo=!1;try{Bo=/firefox/i.test(navigator.userAgent)}catch{}class fn extends Ge.Component{constructor(){super(...arguments),he(this,"state",{activeDrag:null,layout:(0,V.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,V.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),he(this,"dragEnterCounter",0),he(this,"onDragStart",(t,n,r,o)=>{let{e:a,node:i}=o;const{layout:c}=this.state,l=(0,V.getLayoutItem)(c,t);if(!l)return;const u={w:l.w,h:l.h,x:l.x,y:l.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,V.cloneLayoutItem)(l),oldLayout:c,activeDrag:u}),this.props.onDragStart(c,l,l,null,a,i)}),he(this,"onDrag",(t,n,r,o)=>{let{e:a,node:i}=o;const{oldDragItem:c}=this.state;let{layout:l}=this.state;const{cols:u,allowOverlap:d,preventCollision:h}=this.props,f=(0,V.getLayoutItem)(l,t);if(!f)return;const v={w:f.w,h:f.h,x:f.x,y:f.y,placeholder:!0,i:t};l=(0,V.moveElement)(l,f,n,r,!0,h,(0,V.compactType)(this.props),u,d),this.props.onDrag(l,c,f,v,a,i),this.setState({layout:d?l:(0,V.compact)(l,(0,V.compactType)(this.props),u),activeDrag:v})}),he(this,"onDragStop",(t,n,r,o)=>{let{e:a,node:i}=o;if(!this.state.activeDrag)return;const{oldDragItem:c}=this.state;let{layout:l}=this.state;const{cols:u,preventCollision:d,allowOverlap:h}=this.props,f=(0,V.getLayoutItem)(l,t);if(!f)return;l=(0,V.moveElement)(l,f,n,r,!0,d,(0,V.compactType)(this.props),u,h);const y=h?l:(0,V.compact)(l,(0,V.compactType)(this.props),u);this.props.onDragStop(y,c,f,null,a,i);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:y,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(y,b)}),he(this,"onResizeStart",(t,n,r,o)=>{let{e:a,node:i}=o;const{layout:c}=this.state,l=(0,V.getLayoutItem)(c,t);l&&(this.setState({oldResizeItem:(0,V.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(c,l,l,null,a,i))}),he(this,"onResize",(t,n,r,o)=>{let{e:a,node:i,size:c,handle:l}=o;const{oldResizeItem:u}=this.state,{layout:d}=this.state,{cols:h,preventCollision:f,allowOverlap:v}=this.props;let y=!1,b,x,_;const[S,C]=(0,V.withLayoutItem)(d,t,m=>{let O;return x=m.x,_=m.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=m.x+(m.w-n),n=m.x!==x&&x<0?m.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(_=m.y+(m.h-r),r=m.y!==_&&_<0?m.h:r,_=_<0?0:_),y=!0),f&&!v&&(O=(0,V.getAllCollisions)(d,{...m,w:n,h:r,x,y:_}).filter(I=>I.i!==m.i).length>0,O&&(_=m.y,r=m.h,x=m.x,n=m.w,y=!1)),m.w=n,m.h=r,m});if(!C)return;b=S,y&&(b=(0,V.moveElement)(S,C,x,_,!0,this.props.preventCollision,(0,V.compactType)(this.props),h,v));const R={w:C.w,h:C.h,x:C.x,y:C.y,static:!0,i:t};this.props.onResize(b,u,C,R,a,i),this.setState({layout:v?b:(0,V.compact)(b,(0,V.compactType)(this.props),h),activeDrag:R})}),he(this,"onResizeStop",(t,n,r,o)=>{let{e:a,node:i}=o;const{layout:c,oldResizeItem:l}=this.state,{cols:u,allowOverlap:d}=this.props,h=(0,V.getLayoutItem)(c,t),f=d?c:(0,V.compact)(c,(0,V.compactType)(this.props),u);this.props.onResizeStop(f,l,h,null,a,i);const{oldLayout:v}=this.state;this.setState({activeDrag:null,layout:f,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(f,v)}),he(this,"onDragOver",t=>{var S;if(t.preventDefault(),t.stopPropagation(),Bo&&!((S=t.nativeEvent.target)!=null&&S.classList.contains(Fr)))return!1;const{droppingItem:n,onDropDragOver:r,margin:o,cols:a,rowHeight:i,maxRows:c,width:l,containerPadding:u,transformScale:d}=this.props,h=r==null?void 0:r(t);if(h===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const f={...n,...h},{layout:v}=this.state,y=t.currentTarget.getBoundingClientRect(),b=t.clientX-y.left,x=t.clientY-y.top,_={left:b/d,top:x/d,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:C,top:R}=this.state.droppingPosition;(C!=b||R!=x)&&this.setState({droppingPosition:_})}}else{const C={cols:a,margin:o,maxRows:c,rowHeight:i,containerWidth:l,containerPadding:u||o},R=(0,pl.calcXY)(C,x,b,f.w,f.h);this.setState({droppingDOMNode:Ge.createElement("div",{key:f.i}),droppingPosition:_,layout:[...v,{...f,x:R.x,y:R.y,static:!1,isDraggable:!0}]})}}),he(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,V.compact)(r.filter(a=>a.i!==t.i),(0,V.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),he(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),he(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),he(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(a=>a.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,In.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,V.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,V.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,V.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,V.fastRGLPropsEqual)(this.props,t,In.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,V.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,In.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:a,rowHeight:i,maxRows:c,useCSSTransforms:l,transformScale:u}=this.props;return Ge.createElement(Nr.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:n,cols:r,margin:o,containerPadding:a||o,maxRows:c,rowHeight:i,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:u},Ge.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,V.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:a,margin:i,containerPadding:c,rowHeight:l,maxRows:u,isDraggable:d,isResizable:h,isBounded:f,useCSSTransforms:v,transformScale:y,draggableCancel:b,draggableHandle:x,resizeHandles:_,resizeHandle:S}=this.props,{mounted:C,droppingPosition:R}=this.state,m=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&d,O=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&h,M=r.resizeHandles||_,I=m&&f&&r.isBounded!==!1;return Ge.createElement(Nr.default,{containerWidth:o,cols:a,margin:i,containerPadding:c||i,maxRows:u,rowHeight:l,cancel:b,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:m,isResizable:O,isBounded:I,useCSSTransforms:v&&C,usePercentages:!C,transformScale:y,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?R:void 0,resizeHandles:M,resizeHandle:S},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,a=(0,fl.default)(Fr,t),i={height:this.containerHeight(),...n};return Ge.createElement("div",{ref:o,className:a,style:i,onDrop:r?this.onDrop:V.noop,onDragLeave:r?this.onDragLeave:V.noop,onDragEnter:r?this.onDragEnter:V.noop,onDragOver:r?this.onDragOver:V.noop},Ge.Children.map(this.props.children,c=>this.processGridItem(c)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}Nt.default=fn;he(fn,"displayName","ReactGridLayout");he(fn,"propTypes",hl.default);he(fn,"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:V.noop,onDragStart:V.noop,onDrag:V.noop,onDragStop:V.noop,onResizeStart:V.noop,onResize:V.noop,onResizeStop:V.noop,onDrop:V.noop,onDropDragOver:V.noop});var pn={},at={};Object.defineProperty(at,"__esModule",{value:!0});at.findOrGenerateResponsiveLayout=Sl;at.getBreakpointFromWidth=yl;at.getColsFromBreakpoint=Cl;at.sortBreakpoints=dr;var Lt=W;function yl(e,t){const n=dr(e);let r=n[0];for(let o=1,a=n.length;o<a;o++){const i=n[o];t>e[i]&&(r=i)}return r}function Cl(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function Sl(e,t,n,r,o,a){if(e[n])return(0,Lt.cloneLayout)(e[n]);let i=e[r];const c=dr(t),l=c.slice(c.indexOf(n));for(let u=0,d=l.length;u<d;u++){const h=l[u];if(e[h]){i=e[h];break}}return i=(0,Lt.cloneLayout)(i||[]),(0,Lt.compact)((0,Lt.correctBounds)(i,{cols:o}),a,o)}function dr(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(pn,"__esModule",{value:!0});pn.default=void 0;var $r=Tl(w),Se=Go(qe),xn=Gn,ht=W,Xe=at,bl=Go(Nt);function Go(e){return e&&e.__esModule?e:{default:e}}function Xo(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Xo=function(r){return r?n:t})(e)}function Tl(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Xo(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function zn(){return zn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zn.apply(this,arguments)}function Kt(e,t,n){return t=Rl(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rl(e){var t=_l(e,"string");return typeof t=="symbol"?t:String(t)}function _l(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const jr=e=>Object.prototype.toString.call(e);function Vt(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class fr extends $r.Component{constructor(){super(...arguments),Kt(this,"state",this.generateInitialState()),Kt(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,a=(0,Xe.getBreakpointFromWidth)(n,t),i=(0,Xe.getColsFromBreakpoint)(a,o),c=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Xe.findOrGenerateResponsiveLayout)(r,n,a,a,i,c),breakpoint:a,cols:i}}static getDerivedStateFromProps(t,n){if(!(0,xn.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,Xe.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,xn.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,xn.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:a}=this.props,i=this.props.breakpoint||(0,Xe.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),c=this.state.breakpoint,l=(0,Xe.getColsFromBreakpoint)(i,r),u={...o};if(c!==i||t.breakpoints!==n||t.cols!==r){c in u||(u[c]=(0,ht.cloneLayout)(this.state.layout));let f=(0,Xe.findOrGenerateResponsiveLayout)(u,n,i,c,l,a);f=(0,ht.synchronizeLayoutWithChildren)(f,this.props.children,l,a,this.props.allowOverlap),u[i]=f,this.props.onLayoutChange(f,u),this.props.onBreakpointChange(i,l),this.setState({breakpoint:i,layout:f,cols:l})}const d=Vt(this.props.margin,i),h=Vt(this.props.containerPadding,i);this.props.onWidthChange(this.props.width,d,l,h)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:a,containerPadding:i,onBreakpointChange:c,onLayoutChange:l,onWidthChange:u,...d}=this.props;return $r.createElement(bl.default,zn({},d,{margin:Vt(a,this.state.breakpoint),containerPadding:Vt(i,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}pn.default=fr;Kt(fr,"propTypes",{breakpoint:Se.default.string,breakpoints:Se.default.object,allowOverlap:Se.default.bool,cols:Se.default.object,margin:Se.default.oneOfType([Se.default.array,Se.default.object]),containerPadding:Se.default.oneOfType([Se.default.array,Se.default.object]),layouts(e,t){if(jr(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+jr(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,ht.validateLayout)(e.layouts[n],"layouts."+n)})},width:Se.default.number.isRequired,onBreakpointChange:Se.default.func,onLayoutChange:Se.default.func,onWidthChange:Se.default.func});Kt(fr,"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:ht.noop,onLayoutChange:ht.noop,onWidthChange:ht.noop});var pr={},Yo=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,a){return o[0]===n?(r=a,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,a=this.__entries__;o<a.length;o++){var i=a[o];n.call(r,i[1],i[0])}},t}()}(),An=typeof window<"u"&&typeof document<"u"&&window.document===document,Zt=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")()}(),wl=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Zt):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),Il=2;function xl(e,t){var n=!1,r=!1,o=0;function a(){n&&(n=!1,e()),r&&c()}function i(){wl(a)}function c(){var l=Date.now();if(n){if(l-o<Il)return;r=!0}else n=!0,r=!1,setTimeout(i,t);o=l}return c}var Ol=20,El=["top","right","bottom","left","width","height","size","weight"],Ml=typeof MutationObserver<"u",Dl=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=xl(this.refresh.bind(this),Ol)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!An||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Ml?(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)},e.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)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=El.some(function(a){return!!~r.indexOf(a)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Ko=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},gt=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Zt},Zo=hn(0,0,0,0);function Jt(e){return parseFloat(e)||0}function Lr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var a=e["border-"+o+"-width"];return r+Jt(a)},0)}function Pl(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var a=o[r],i=e["padding-"+a];n[a]=Jt(i)}return n}function Nl(e){var t=e.getBBox();return hn(0,0,t.width,t.height)}function Fl(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Zo;var r=gt(e).getComputedStyle(e),o=Pl(r),a=o.left+o.right,i=o.top+o.bottom,c=Jt(r.width),l=Jt(r.height);if(r.boxSizing==="border-box"&&(Math.round(c+a)!==t&&(c-=Lr(r,"left","right")+a),Math.round(l+i)!==n&&(l-=Lr(r,"top","bottom")+i)),!jl(e)){var u=Math.round(c+a)-t,d=Math.round(l+i)-n;Math.abs(u)!==1&&(c-=u),Math.abs(d)!==1&&(l-=d)}return hn(o.left,o.top,c,l)}var $l=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof gt(e).SVGGraphicsElement}:function(e){return e instanceof gt(e).SVGElement&&typeof e.getBBox=="function"}}();function jl(e){return e===gt(e).document.documentElement}function Ll(e){return An?$l(e)?Nl(e):Fl(e):Zo}function Vl(e){var t=e.x,n=e.y,r=e.width,o=e.height,a=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,i=Object.create(a.prototype);return Ko(i,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),i}function hn(e,t,n,r){return{x:e,y:t,width:n,height:r}}var Ul=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=hn(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=Ll(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),zl=function(){function e(t,n){var r=Vl(n);Ko(this,{target:t,contentRect:r})}return e}(),Al=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new Yo,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof gt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new Ul(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof gt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new zl(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Jo=typeof WeakMap<"u"?new WeakMap:new Yo,Qo=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Dl.getInstance(),r=new Al(t,n,this);Jo.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Qo.prototype[e]=function(){var t;return(t=Jo.get(this))[e].apply(t,arguments)}});var kl=function(){return typeof Zt.ResizeObserver<"u"?Zt.ResizeObserver:Qo}();const Hl=Object.freeze(Object.defineProperty({__proto__:null,default:kl},Symbol.toStringTag,{value:"Module"})),Wl=Za(Hl);Object.defineProperty(pr,"__esModule",{value:!0});pr.default=Jl;var Ut=Xl(w),ql=hr(qe),Bl=hr(Wl),Gl=hr(We);function hr(e){return e&&e.__esModule?e:{default:e}}function ea(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ea=function(r){return r?n:t})(e)}function Xl(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ea(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function kn(){return kn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kn.apply(this,arguments)}function ut(e,t,n){return t=Yl(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yl(e){var t=Kl(e,"string");return typeof t=="symbol"?t:String(t)}function Kl(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Zl="react-grid-layout";function Jl(e){var t;return t=class extends Ut.Component{constructor(){super(...arguments),ut(this,"state",{width:1280}),ut(this,"elementRef",Ut.createRef()),ut(this,"mounted",!1),ut(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new Bl.default(o=>{if(this.elementRef.current instanceof HTMLElement){const i=o[0].contentRect.width;this.setState({width:i})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?Ut.createElement("div",{className:(0,Gl.default)(this.props.className,Zl),style:this.props.style,ref:this.elementRef}):Ut.createElement(e,kn({innerRef:this.elementRef},o,this.state))}},ut(t,"defaultProps",{measureBeforeMount:!1}),ut(t,"propTypes",{measureBeforeMount:ql.default.bool}),t}(function(e){e.exports=Nt.default,e.exports.utils=W,e.exports.calculateUtils=$e,e.exports.Responsive=pn.default,e.exports.Responsive.utils=at,e.exports.WidthProvider=pr.default})(go);var Ql=go.exports;const ec=Bn(Ql),Hn={type:g.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(e,t){if(!t)return!1;const n=e.get(g.IUndoRedoService),r=e.get(g.ICommandService),o=e.get(g.IUniverInstanceService),a=k.getSheetCommandTarget(o,t);if(!a)return!1;const{unitId:i,subUnitId:c}=a,l={unitId:i,subUnitId:c,cfId:t.cfId},u=s.DeleteConditionalRuleMutationUndoFactory(e,l),d=r.syncExecuteCommand(s.DeleteConditionalRuleMutation.id,l);return d&&n.pushUndoRedo({unitID:i,undoMutations:u,redoMutations:[{id:s.DeleteConditionalRuleMutation.id,params:l}]}),d}},ta={type:g.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(e,t){if(!t)return!1;const n=e.get(g.IUndoRedoService),r=e.get(g.ICommandService),o=e.get(g.IUniverInstanceService),a=e.get(s.ConditionalFormattingRuleModel),i=k.getSheetCommandTarget(o,t);if(!i)return!1;const{unitId:c,subUnitId:l}=i,u=s.transformSupportSymmetryAnchor(t.start,t.end,a.getSubunitRules(c,l)||[],b=>b.cfId);if(!u)return!1;const[d,h]=u,f={unitId:c,subUnitId:l,start:d,end:h},v=s.MoveConditionalRuleMutationUndoFactory(f),y=r.syncExecuteCommand(s.MoveConditionalRuleMutation.id,f);return y&&n.pushUndoRedo({unitID:c,redoMutations:[{id:s.MoveConditionalRuleMutation.id,params:f}],undoMutations:v}),y}},tc="univer-cf-preview",zt={cfPreview:tc},mt=e=>{var o,a;const t=e.rule;if(!t)return null;const n=w.useMemo(()=>{if(t.type===s.CFRuleType.colorScale){const i=t.config.map((u,d)=>({color:new g.ColorKit(u.color),value:d})),c=i.length-1;return new Array(5).fill("").map((u,d,h)=>d*c/(h.length-1)).map(u=>s.getColorScaleFromValue(i,u))}return null},[t]),r=w.useMemo(()=>{if(t.type===s.CFRuleType.iconSet)return t.config.map(i=>{const c=s.iconMap[i.iconType];return c&&c[Number(i.iconId)]})},[t]);switch(t.type){case s.CFRuleType.dataBar:{const{isGradient:i}=t.config,c={width:"50%",height:"100%"},l=i?`linear-gradient(to right, ${t.config.positiveColor}, rgb(255 255 255))`:t.config.positiveColor,u=i?`linear-gradient(to right, rgb(255 255 255),${t.config.nativeColor})`:t.config.nativeColor;return p.jsxs("div",{className:zt.cfPreview,children:[p.jsx("div",{style:{...c,background:u,border:`1px solid ${t.config.nativeColor}`}}),p.jsx("div",{style:{...c,background:l,border:`1px solid ${t.config.positiveColor}`}})]})}case s.CFRuleType.colorScale:return n&&p.jsx("div",{className:zt.cfPreview,children:n.map((i,c)=>p.jsx("div",{style:{width:`${100/n.length}%`,height:"100%",background:i}},c))});case s.CFRuleType.iconSet:return r&&p.jsx("div",{className:zt.cfPreview,children:r.map((i,c)=>i?p.jsx("img",{style:{height:"100%"},src:i},c):p.jsx(en,{},c))});case s.CFRuleType.highlightCell:{const{ul:i,st:c,it:l,bl:u,bg:d,cl:h}=t.style,f=(i==null?void 0:i.s)===g.BooleanNumber.TRUE,v=(c==null?void 0:c.s)===g.BooleanNumber.TRUE,y=l===g.BooleanNumber.TRUE,b=u===g.BooleanNumber.TRUE,x=(o=d==null?void 0:d.rgb)!=null?o:s.DEFAULT_BG_COLOR,_=(a=h==null?void 0:h.rgb)!=null?a:s.DEFAULT_FONT_COLOR,S={fontWeight:b?"bold":void 0,fontStyle:y?"italic":void 0,textDecoration:`${f?"underline":""} ${v?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:x,color:_};return p.jsx("div",{style:S,className:zt.cfPreview,children:"123"})}}return null},nc={sheet:{cf:{title:"Conditional Formatting",menu:{manageConditionalFormatting:"Manage Conditional Formatting",createConditionalFormatting:"Create Conditional Formatting",clearRangeRules:"Clear Rules for Selected Range",clearWorkSheetRules:"Clear Rules for Entire Sheet"},form:{lessThan:"The value must be less than {0}",lessThanOrEqual:"The value must be less than or equal to {0}",greaterThan:"The value must be greater than {0}",greaterThanOrEqual:"The value must be greater than or equal to {0}",rangeSelector:"Select Range or Enter Value"},iconSet:{direction:"Direction",shape:"Shape",mark:"Mark",rank:"Rank",rule:"Rule",icon:"Icon",type:"Type",value:"Value",reverseIconOrder:"Reverse Icon Order",and:"And",when:"When",onlyShowIcon:"Only Show Icon"},symbol:{greaterThan:">",greaterThanOrEqual:">=",lessThan:"<",lessThanOrEqual:"<="},panel:{createRule:"Create Rule",clear:"Clear All Rules",range:"Apply Range",styleType:"Style Type",submit:"Submit",cancel:"Cancel",rankAndAverage:"Top/Bottom/Average",styleRule:"Style Rule",isNotBottom:"Top",isBottom:"Bottom",greaterThanAverage:"Greater Than Average",lessThanAverage:"Less Than Average",medianValue:"Median Value",fillType:"Fill Type",pureColor:"Solid Color",gradient:"Gradient",colorSet:"Color Set",positive:"Positive",native:"Negative",workSheet:"Entire Sheet",selectedRange:"Selected Range",managerRuleSelect:"Manage {0} Rules",onlyShowDataBar:"Only Show Data Bars"},preview:{describe:{beginsWith:"Begins with {0}",endsWith:"Ends with {0}",containsText:"Text contains {0}",notContainsText:"Text does not contain {0}",equal:"Equal to {0}",notEqual:"Not equal to {0}",containsBlanks:"Contains Blanks",notContainsBlanks:"Does not contain Blanks",containsErrors:"Contains Errors",notContainsErrors:"Does not contain Errors",greaterThan:"Greater than {0}",greaterThanOrEqual:"Greater than or equal to {0}",lessThan:"Less than {0}",lessThanOrEqual:"Less than or equal to {0}",notBetween:"Not between {0} and {1}",between:"Between {0} and {1}",yesterday:"Yesterday",tomorrow:"Tomorrow",last7Days:"Last 7 Days",thisMonth:"This Month",lastMonth:"Last Month",nextMonth:"Next Month",thisWeek:"This Week",lastWeek:"Last Week",nextWeek:"Next Week",today:"Today",topN:"Top {0}",bottomN:"Bottom {0}",topNPercent:"Top {0}%",bottomNPercent:"Bottom {0}%"}},operator:{beginsWith:"Begins with",endsWith:"Ends with",containsText:"Text contains",notContainsText:"Text does not contain",equal:"Equal to",notEqual:"Not equal to",containsBlanks:"Contains Blanks",notContainsBlanks:"Does not contain Blanks",containsErrors:"Contains Errors",notContainsErrors:"Does not contain Errors",greaterThan:"Greater than",greaterThanOrEqual:"Greater than or equal to",lessThan:"Less than",lessThanOrEqual:"Less than or equal to",notBetween:"Not between",between:"Between",yesterday:"Yesterday",tomorrow:"Tomorrow",last7Days:"Last 7 Days",thisMonth:"This Month",lastMonth:"Last Month",nextMonth:"Next Month",thisWeek:"This Week",lastWeek:"Last Week",nextWeek:"Next Week",today:"Today"},ruleType:{highlightCell:"Highlight Cell",dataBar:"Data Bar",colorScale:"Color Scale",formula:"Custom Formula",iconSet:"Icon Set",duplicateValues:"Duplicate Values",uniqueValues:"Unique Values"},subRuleType:{uniqueValues:"Unique Values",duplicateValues:"Duplicate Values",rank:"Rank",text:"Text",timePeriod:"Time Period",number:"Number",average:"Average"},valueType:{num:"Number",min:"Minimum",max:"Maximum",percent:"Percentage",percentile:"Percentile",formula:"Formula",none:"None"}}}},rc=nc,oc={sheet:{cf:{title:"条件格式",menu:{manageConditionalFormatting:"管理条件格式",createConditionalFormatting:"新建条件格式",clearRangeRules:"清除所选区域的规则",clearWorkSheetRules:"清除整个工作表的规则"},form:{lessThan:"该值必须小于 {0}",lessThanOrEqual:"该值必须小于等于 {0}",greaterThan:"该值必大于 {0}",greaterThanOrEqual:"该值必大于等于 {0}",rangeSelector:"选择范围或者输入值"},iconSet:{direction:"方向",shape:"形状",mark:"标记",rank:"等级",rule:"规则",icon:"图标",type:"类型",value:"值",reverseIconOrder:"反转图标次序",and:"且",when:"当值",onlyShowIcon:"仅显示图标"},symbol:{greaterThan:">",greaterThanOrEqual:">=",lessThan:"<",lessThanOrEqual:"<="},panel:{createRule:"新增规则",clear:"清空所有规则",range:"应用范围",styleType:"样式类型",submit:"确认",cancel:"取消",rankAndAverage:"最前/最后/平均值",styleRule:"样式规则",isNotBottom:"最前",isBottom:"最后",greaterThanAverage:"大于平均值",lessThanAverage:"小于平均值",medianValue:"中间值",fillType:"填充方式",pureColor:"纯色",gradient:"渐变",colorSet:"颜色设置",positive:"正值",native:"负值",workSheet:"整张工作表",selectedRange:"所选单元格",managerRuleSelect:"管理 {0} 的规则",onlyShowDataBar:"仅显示数据条"},preview:{describe:{beginsWith:"开头为{0}",endsWith:"结尾为{0}",containsText:"文本包含{0}",notContainsText:"文本不包含{0}",equal:"等于{0}",notEqual:"不等于{0}",containsBlanks:"为空",notContainsBlanks:"不为空",containsErrors:"错误",notContainsErrors:"非错误",greaterThan:"大于{0}",greaterThanOrEqual:"大于等于{0}",lessThan:"小于{0}",lessThanOrEqual:"小于等于{0}",notBetween:"不介于{0}和{1}之间",between:"介于{0}和{1}之间",yesterday:"昨日",tomorrow:"明日",last7Days:"最近7天",thisMonth:"本月",lastMonth:"上个月",nextMonth:"下个月",thisWeek:"本周",lastWeek:"上周",nextWeek:"下周",today:"今日",topN:"前{0}项",bottomN:"后{0}项",topNPercent:"前{0}%",bottomNPercent:"后{0}%"}},operator:{beginsWith:"开头为",endsWith:"结尾为",containsText:"文本包含",notContainsText:"文本不包含",equal:"等于",notEqual:"不等于",containsBlanks:"为空",notContainsBlanks:"不为空",containsErrors:"错误",notContainsErrors:"非错误",greaterThan:"大于",greaterThanOrEqual:"大于等于",lessThan:"小于",lessThanOrEqual:"小于等于",notBetween:"不介于",between:"介于",yesterday:"昨日",tomorrow:"明日",last7Days:"最近 7 天",thisMonth:"本月",lastMonth:"上个月",nextMonth:"下个月",thisWeek:"本周",lastWeek:"上周",nextWeek:"下周",today:"今日"},ruleType:{highlightCell:"突出显示单元格",dataBar:"数据条",colorScale:"色阶",formula:"自定义公式",iconSet:"图标集",duplicateValues:"重复值",uniqueValues:"唯一值"},subRuleType:{uniqueValues:"唯一值",duplicateValues:"重复值",rank:"最前最后",text:"文本",timePeriod:"时间日期",number:"数值",average:"平均值"},valueType:{num:"数值",min:"最小值",max:"最大值",percent:"百分比",percentile:"百分点",formula:"公式",none:"无"}}}},na=oc,ac={sheet:{cf:{title:"Условное форматирование",menu:{manageConditionalFormatting:"Управление условным форматированием",createConditionalFormatting:"Создание условного форматирования",clearRangeRules:"Очистить правила для выбранного диапазона",clearWorkSheetRules:"Очистить правила для всего листа"},form:{lessThan:"Значение должно быть меньше {0}",lessThanOrEqual:"Значение должно быть меньше или равно {0}",greaterThan:"Значение должно быть больше {0}",greaterThanOrEqual:"Значение должно быть больше или равно {0}",rangeSelector:"Выберите диапазон или введите значение"},iconSet:{direction:"Направление",shape:"Форма",mark:"Знак",rank:"Ранг",rule:"Правило",icon:"Иконка",type:"Тип",value:"Значение",reverseIconOrder:"Обратный порядок иконок",and:"И",when:"Когда",onlyShowIcon:"Показывать только иконку"},symbol:{greaterThan:">",greaterThanOrEqual:">=",lessThan:"<",lessThanOrEqual:"<="},panel:{createRule:"Создать правило",clear:"Очистить все правила",range:"Применить диапазон",styleType:"Тип стиля",submit:"Подтвердить",cancel:"Отменить",rankAndAverage:"Верх/Низ/Среднее",styleRule:"Правило стиля",isNotBottom:"Верх",isBottom:"Низ",greaterThanAverage:"Больше среднего",lessThanAverage:"Меньше среднего",medianValue:"Медианное значение",fillType:"Тип заполнения",pureColor:"Сплошной цвет",gradient:"Градиент",colorSet:"Набор цветов",positive:"Положительный",native:"Отрицательный",workSheet:"Весь лист",selectedRange:"Выбранный диапазон",managerRuleSelect:"Управление правилами {0}",onlyShowDataBar:"Показывать только гистограммы данных"},preview:{describe:{beginsWith:"Начинается с {0}",endsWith:"Заканчивается на {0}",containsText:"Содержит текст {0}",notContainsText:"Не содержит текст {0}",equal:"Равно {0}",notEqual:"Не равно {0}",containsBlanks:"Содержит пустые ячейки",notContainsBlanks:"Не содержит пустых ячеек",containsErrors:"Содержит ошибки",notContainsErrors:"Не содержит ошибок",greaterThan:"Больше чем {0}",greaterThanOrEqual:"Больше или равно {0}",lessThan:"Меньше чем {0}",lessThanOrEqual:"Меньше или равно {0}",notBetween:"Не между {0} и {1}",between:"Между {0} и {1}",yesterday:"Вчера",tomorrow:"Завтра",last7Days:"Последние 7 дней",thisMonth:"Этот месяц",lastMonth:"Прошлый месяц",nextMonth:"Следующий месяц",thisWeek:"Эта неделя",lastWeek:"Прошлая неделя",nextWeek:"Следующая неделя",today:"Сегодня",topN:"Топ {0}",bottomN:"Низ {0}",topNPercent:"Топ {0}%",bottomNPercent:"Низ {0}%"}},operator:{beginsWith:"Начинается с",endsWith:"Заканчивается на",containsText:"Содержит текст",notContainsText:"Не содержит текст",equal:"Равно",notEqual:"Не равно",containsBlanks:"Содержит пустые ячейки",notContainsBlanks:"Не содержит пустых ячеек",containsErrors:"Содержит ошибки",notContainsErrors:"Не содержит ошибок",greaterThan:"Больше чем",greaterThanOrEqual:"Больше или равно",lessThan:"Меньше чем",lessThanOrEqual:"Меньше или равно",notBetween:"Не между",between:"Между",yesterday:"Вчера",tomorrow:"Завтра",last7Days:"Последние 7 дней",thisMonth:"Этот месяц",lastMonth:"Прошлый месяц",nextMonth:"Следующий месяц",thisWeek:"Эта неделя",lastWeek:"Прошлая неделя",nextWeek:"Следующая неделя",today:"Сегодня"},ruleType:{highlightCell:"Выделение ячеек",dataBar:"Гистограмма данных",colorScale:"Цветовая шкала",formula:"Пользовательская формула",iconSet:"Набор иконок",duplicateValues:"Дублирующиеся значения",uniqueValues:"Уникальные значения"},subRuleType:{uniqueValues:"Уникальные значения",duplicateValues:"Дублирующиеся значения",rank:"Ранг",text:"Текст",timePeriod:"Период времени",number:"Число",average:"Среднее"},valueType:{num:"Число",min:"Минимум",max:"Максимум",percent:"Процент",percentile:"Процентиль",formula:"Формула",none:"Нет"}}}},ic=ac;var sc=Object.defineProperty,lc=Object.getOwnPropertyDescriptor,cc=(e,t,n,r)=>{for(var o=r>1?void 0:r?lc(t,n):t,a=e.length-1,i;a>=0;a--)(i=e[a])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&sc(t,n,o),o},uc=(e,t)=>(n,r)=>t(n,r,e);let Et=class extends g.Disposable{constructor(t){super();Ae(this,"_initLocal",()=>{this._localeService.load({zhCN:na})});Ae(this,"_findReplaceIndex",t=>{const n=/\{([^}]+)?\}/g,r=[];let o=n.exec(t);for(;o;)r.push({startIndex:o.index,key:Number(o[1]),endIndex:o.index+o[0].length-1}),o=n.exec(t);return r});this._localeService=t,this._initLocal()}tWithReactNode(t,...n){const r=this._localeService.getLocales(),o=t.split("."),a=r&&this._localeService.resolveKeyPath(r,o);if(typeof a=="string"){const i=[];return this._findReplaceIndex(a).forEach((c,l,u)=>{const d=u[l-1]||{startIndex:0,endIndex:-1};if(d.endIndex+1<c.startIndex){const h=a.slice(d.endIndex+1,c.startIndex);h&&i.push(h)}if(n[c.key]&&i.push(n[c.key]),l===u.length-1){const h=a.slice(c.endIndex+1);h&&i.push(h)}}),i}return[]}};Et=cc([g.OnLifecycle(g.LifecycleStages.Rendered,Et),uc(0,z.Inject(g.LocaleService))],Et);const dc=(e=[])=>{const t=te.useDependency(ce.IMarkSelectionService);w.useEffect(()=>{const n=e.map(r=>t.addShape({range:r,style:{hasAutoFill:!1,fill:"rgba(73, 184, 17, 0.05)",strokeWidth:1,stroke:"#49B811",widgets:{}},primary:{startColumn:r.startColumn,endColumn:r.endColumn,startRow:r.startRow,endRow:r.endRow,actualRow:r.startRow,actualColumn:r.startColumn,isMerged:!1,isMergedMainCell:!1}}));return()=>{n.forEach(r=>{r&&t.removeShape(r)})}},[e])},fc="univer-cf-rule-list",pc="univer-rule-selector",hc="univer-select",gc="univer-select-selector",mc="univer-select-selection-item",vc="univer-select-selection-search-input",yc="univer-btn-list",Cc="univer-gap",Sc="univer-icon",bc="univer-disabled",Tc="univer-rule-item",Rc="univer-rule-describe",_c="univer-rule-type",wc="univer-rule-range",Ic="univer-active",xc="univer-draggableHandle",Oc="univer-delete-item",Ec="univer-grid-layout-wrap",Mc="univer-react-grid-item",le={cfRuleList:fc,ruleSelector:pc,select:hc,selectSelector:gc,selectSelectionItem:mc,selectSelectionSearchInput:vc,btnList:yc,gap:Cc,icon:Sc,disabled:bc,ruleItem:Tc,ruleDescribe:Rc,ruleType:_c,ruleRange:wc,active:Ic,draggableHandle:xc,deleteItem:Oc,gridLayoutWrap:Ec,reactGridItem:Mc},Dc=(e,t)=>{const n=e.rule;switch(n.type){case s.CFRuleType.colorScale:return t.t("sheet.cf.ruleType.colorScale");case s.CFRuleType.dataBar:return t.t("sheet.cf.ruleType.dataBar");case s.CFRuleType.iconSet:return t.t("sheet.cf.ruleType.iconSet");case s.CFRuleType.highlightCell:switch(n.subType){case s.CFSubRuleType.average:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,t.t("sheet.cf.subRuleType.average"))}case s.CFSubRuleType.duplicateValues:return t.t("sheet.cf.subRuleType.duplicateValues");case s.CFSubRuleType.uniqueValues:return t.t("sheet.cf.subRuleType.uniqueValues");case s.CFSubRuleType.number:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,...Array.isArray(n.value)?n.value.map(o=>String(o)):[String(n.value||"")])}case s.CFSubRuleType.text:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,n.value||"")}case s.CFSubRuleType.timePeriod:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`)}case s.CFSubRuleType.rank:return n.isPercent?n.isBottom?t.t("sheet.cf.preview.describe.bottomNPercent",String(n.value)):t.t("sheet.cf.preview.describe.topNPercent",String(n.value)):n.isBottom?t.t("sheet.cf.preview.describe.bottomN",String(n.value)):t.t("sheet.cf.preview.describe.topN",String(n.value));case s.CFSubRuleType.formula:return t.t("sheet.cf.ruleType.formula")}}};let Vr=0;const Pc=e=>{const{onClick:t}=e,n=te.useDependency(s.ConditionalFormattingRuleModel),r=te.useDependency(g.IUniverInstanceService),o=te.useDependency(k.SelectionManagerService),a=te.useDependency(g.ICommandService),i=te.useDependency(g.LocaleService),c=te.useDependency(Et),l=r.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET),u=l.getUnitId(),h=l.getActiveSheet().getSheetId(),[f,v]=w.useState([]),[y,b]=w.useState("2"),[x,_]=w.useState(0),[S,C]=w.useState(-1),[R,m]=w.useState(Vr),O=w.useRef(null),M=[{label:i.t("sheet.cf.panel.workSheet"),value:"2"},{label:i.t("sheet.cf.panel.selectedRange"),value:"1"}],I=()=>{const L=n.getSubunitRules(u,h);if(!L||!L.length)return[];if(y==="1"){const B=o.getLast();if(!B)return[];const ee=B.range;return L.filter(fe=>fe.ranges.some(ve=>g.Rectangle.intersects(ve,ee)))}else if(y==="2")return L;return[]},[F,$]=w.useState(I);dc(f),w.useEffect(()=>{const L=a.onCommandExecuted(B=>{B.id===k.SetWorksheetActiveOperation.id&&_(Math.random())});return()=>L.dispose()}),w.useEffect(()=>{$(I)},[y,x,u,h]),w.useEffect(()=>{if(y==="2")return;const L=new _e.Observable(B=>{const ee=[k.SetSelectionsOperation.id,s.AddConditionalRuleMutation.id,s.SetConditionalRuleMutation.id,s.DeleteConditionalRuleMutation.id,s.MoveConditionalRuleMutation.id],se=a.onCommandExecuted(fe=>{const{id:ve,params:ye}=fe,Me=r.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getUnitId();ee.includes(ve)&&ye.unitId===Me&&B.next(null)});return()=>se.dispose()}).pipe(_e.debounceTime(16)).subscribe(()=>{$(I)});return()=>{L.unsubscribe()}},[r,y,u,h]),w.useEffect(()=>{const L=n.$ruleChange.subscribe(()=>{_(Math.random())});return()=>L.unsubscribe()},[n]),w.useEffect(()=>{const L=()=>{var fe;const se=Math.max(0,(((fe=O.current)==null?void 0:fe.getBoundingClientRect().width)||0)-8);return Vr=se,se},ee=new _e.Observable(se=>{const fe=document.querySelector(".univer-sidebar");if(fe){let ve=setTimeout(()=>{se.next()},150);const ye=()=>{ve&&clearTimeout(ve),ve=null},Me=Be=>{Be.propertyName==="width"&&(ye(),se.next())};return fe.addEventListener("transitionend",Me),()=>{ye(),fe.removeEventListener("transitionend",Me)}}}).pipe(_e.debounceTime(16)).subscribe(()=>{m(L())});return()=>{ee.unsubscribe()}},[]);const j=L=>{const B=r.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getUnitId(),ee=r.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId();a.executeCommand(Hn.id,{unitId:B,subUnitId:ee,cfId:L.cfId})},q=(L,B)=>{C(B.y)},T=(L,B,ee)=>{C(-1);const se=r.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getUnitId(),fe=r.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),ve=Be=>{const Ct=F.length;return Math.min(Ct-1,Math.max(0,Be))},ye=F[ve(B.y)].cfId,Me=F[ve(ee.y)].cfId;ye!==Me&&a.executeCommand(ta.id,{unitId:se,subUnitId:fe,start:{id:ye,type:"self"},end:{id:Me,type:ee.y>B.y?"after":"before"}})},E=()=>{e.onCreate()},Z=()=>{y==="2"?a.executeCommand(Wn.id):y==="1"&&F.map(B=>({unitId:u,subUnitId:h,cfId:B.cfId})).forEach(B=>{a.executeCommand(Hn.id,B)})},me=F.map((L,B)=>({i:L.cfId,x:0,w:12,y:B,h:1,isResizable:!1}));return p.jsxs("div",{className:le.cfRuleList,children:[p.jsxs("div",{className:le.ruleSelector,children:[p.jsx("div",{children:c.tWithReactNode("sheet.cf.panel.managerRuleSelect",p.jsx(G.Select,{className:le.select,options:M,value:y,onChange:L=>{b(L)}})).map((L,B)=>p.jsx("span",{children:L},B))}),p.jsxs("div",{className:le.btnList,children:[p.jsx(G.Tooltip,{title:i.t("sheet.cf.panel.createRule"),placement:"bottom",children:p.jsx("div",{className:`${le.icon}`,onClick:E,children:p.jsx(Wa,{})})}),F.length?p.jsx(G.Tooltip,{title:i.t("sheet.cf.panel.clear"),placement:"bottom",children:p.jsx("div",{className:`${le.gap} ${le.icon}`,onClick:Z,children:p.jsx(Sn,{})})}):p.jsx("div",{className:`${le.gap} ${le.disabled}`,children:p.jsx(Sn,{})})]})]}),p.jsx("div",{ref:O,className:le.gridLayoutWrap,children:R?p.jsx(ec,{onDragStop:T,onDragStart:q,layout:me,cols:12,rowHeight:60,width:R,margin:[0,10],draggableHandle:".draggableHandle",children:F.map((L,B)=>p.jsx("div",{children:p.jsxs("div",{onMouseMove:()=>{L.ranges!==f&&v(L.ranges)},onMouseLeave:()=>v([]),onClick:()=>t(L),className:`${le.ruleItem} ${S===B?le.active:""}`,children:[p.jsx("div",{className:`${le.draggableHandle} draggableHandle`,onClick:ee=>ee.stopPropagation(),children:p.jsx(Ga,{})}),p.jsxs("div",{className:le.ruleDescribe,children:[p.jsx("div",{className:le.ruleType,children:Dc(L,i)}),p.jsx("div",{className:le.ruleRange,children:L.ranges.map(ee=>no.serializeRange(ee)).join(",")})]}),p.jsx("div",{className:le.preview,children:p.jsx(mt,{rule:L.rule})}),p.jsx("div",{className:`${le.deleteItem} ${S===B?le.active:""}`,onClick:ee=>{ee.stopPropagation(),j(L)},children:p.jsx(Sn,{})})]})},`${L.cfId}`))}):null})]})},ra={type:g.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(e,t){if(!t)return!1;const{rule:n}=t,r=e.get(g.IUndoRedoService),o=e.get(g.ICommandService),a=e.get(s.ConditionalFormattingRuleModel),i=e.get(g.IUniverInstanceService),c=k.getSheetCommandTarget(i);if(!c)return!1;const{unitId:l,subUnitId:u}=c,d=a.createCfId(l,u),h={unitId:l,subUnitId:u,rule:{...n,cfId:n.cfId||d}},f=s.AddConditionalRuleMutationUndoFactory(e,h),v=o.syncExecuteCommand(s.AddConditionalRuleMutation.id,h);return v&&r.pushUndoRedo({unitID:l,redoMutations:[{id:s.AddConditionalRuleMutation.id,params:h}],undoMutations:[f]}),v}},oa={type:g.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(e,t){if(!t)return!1;const n=e.get(g.IUndoRedoService),r=e.get(g.ICommandService),o=e.get(g.IUniverInstanceService),a=k.getSheetCommandTarget(o,t);if(!a)return!1;const{unitId:i,subUnitId:c}=a,l={unitId:i,subUnitId:c,rule:t.rule},u=s.setConditionalRuleMutationUndoFactory(e,l),d=r.syncExecuteCommand(s.SetConditionalRuleMutation.id,l);return d&&n.pushUndoRedo({unitID:i,undoMutations:u,redoMutations:[{id:s.SetConditionalRuleMutation.id,params:l}]}),d}},Nc=g.createInterceptorKey("beforeSubmit"),Fc=g.createInterceptorKey("submit"),$c="univer-cf-color-picker",jc="univer-cf-color-picker-icon",Lc="univer-icon-dropdown",On={cfColorPicker:$c,cfColorPickerIcon:jc,iconDropdown:Lc},et=e=>{const{color:t,onChange:n,disable:r=!1,iconId:o="PaintBucket",className:a,isNeedDropdownIcon:i=!0}=e,c=te.useDependency(be.ComponentManager),l=w.useMemo(()=>new g.ColorKit(t),[t]),u=c.get(o);return u&&(r?p.jsx(u,{className:a,extend:{colorChannel1:l.isValid?t:"rgb(var(--primary-color))"}}):p.jsx(G.Dropdown,{overlay:p.jsx("div",{className:`${On.cfColorPicker} `,children:p.jsx(G.ColorPicker,{color:t,onChange:n})}),children:p.jsxs("span",{className:`${On.cfColorPickerIcon} ${a}`,children:[p.jsx(u,{extend:{colorChannel1:l.isValid?t:"rgb(var(--primary-color))"}}),i&&p.jsx(qn,{className:On.iconDropdown})]})}))},Vc="univer-cf-rule-style-editor",Uc="univer-cf-preview-wrap",zc="univer-text",Ac="univer-position-relative",kc="univer-btn-list",Hc="univer-util-item",Wc="univer-icon-set",qc="univer-render-config",Bc="univer-flex",Gc="univer-width45",Xc="univer-icon-wrap",Yc="univer-icon",Kc="univer-dropdown-icon",Zc="univer-error-input",Jc="univer-error-text",Qc="univer-icon-group-list",eu="univer-title",tu="univer-group",nu="univer-item-content",ru="univer-item-wrap",ou="univer-item",au="univer-icon-item-list-wrap",iu="univer-none",su="univer-icon-item-list",lu="univer-width100",cu="univer-stress",P={cfRuleStyleEditor:Vc,cfPreviewWrap:Uc,text:zc,positionRelative:Ac,btnList:kc,utilItem:Hc,iconSet:Wc,renderConfig:qc,flex:Bc,width45:Gc,iconWrap:Xc,icon:Yc,dropdownIcon:Kc,errorInput:Zc,errorText:Jc,iconGroupList:Qc,title:eu,group:tu,itemContent:nu,itemWrap:ru,item:ou,iconItemListWrap:au,none:iu,iconItemList:su,width100:lu,stress:cu},Ye=(e,t)=>({label:t.t(`sheet.cf.valueType.${e}`),value:e}),En=e=>{const{type:t,className:n,onChange:r,id:o,value:a}=e,i=te.useDependency(g.IUniverInstanceService),c=i.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getUnitId(),l=i.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),u=w.useMemo(()=>String(a).startsWith("=")?String(a):"=",[a]),d=w.useMemo(()=>[s.CFValueType.max,s.CFValueType.min,"none"].includes(t)?{disabled:!0}:[s.CFValueType.percent,s.CFValueType.percentile].includes(t)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[t]);return t===s.CFValueType.formula?p.jsx(be.TextEditor,{openForSheetSubUnitId:l,openForSheetUnitId:c,id:g.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_colo_scale_${o}`),value:u,style:{maxWidth:"50%",marginLeft:4},canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(h="")=>{r(h||"")}}):p.jsx(G.InputNumber,{className:n,value:Number(e.value)||0,onChange:h=>e.onChange(h||0),...d})},uu=e=>{var q;const{interceptorManager:t}=e,n=te.useDependency(g.LocaleService),r=((q=e.rule)==null?void 0:q.type)===s.CFRuleType.colorScale?e.rule:void 0,o=[Ye(s.CFValueType.num,n),Ye(s.CFValueType.percent,n),Ye(s.CFValueType.percentile,n),Ye(s.CFValueType.formula,n)],a=[Ye(s.CFValueType.min,n),...o],i=[Ye("none",n),...o],c=[Ye(s.CFValueType.max,n),...o],[l,u]=w.useState(()=>{var E;const T=s.CFValueType.min;return r&&((E=r.config[0])==null?void 0:E.value.type)||T}),[d,h]=w.useState(()=>{var E;const T="none";return!r||r.config.length!==3?T:((E=r.config[1])==null?void 0:E.value.type)||T}),[f,v]=w.useState(()=>{var E;const T=s.CFValueType.max;return r&&((E=r.config[r.config.length-1])==null?void 0:E.value.type)||T}),[y,b]=w.useState(()=>{if(!r)return 10;const E=r.config[0];return(E==null?void 0:E.value.value)===void 0?10:E==null?void 0:E.value.value}),[x,_]=w.useState(()=>{var Z;if(!r||r.config.length!==3)return 50;const E=(Z=r.config[1])==null?void 0:Z.value.value;return E===void 0?50:E}),[S,C]=w.useState(()=>{var Z;if(!r)return 90;const E=(Z=r.config[r.config.length-1])==null?void 0:Z.value.value;return E===void 0?90:E}),[R,m]=w.useState(()=>{var E;const T="#d0d9fb";return r&&((E=r.config[0])==null?void 0:E.color)||T}),[O,M]=w.useState(()=>{var E;const T="#7790f3";return!r||r.config.length!==3?T:((E=r.config[1])==null?void 0:E.color)||T}),[I,F]=w.useState(()=>{var E;const T="#2e55ef";return r&&((E=r.config[r.config.length-1])==null?void 0:E.color)||T}),$=w.useMemo(()=>T=>{const{minType:E,medianType:Z,maxType:me,minValue:L,medianValue:B,maxValue:ee,minColor:se,medianColor:fe,maxColor:ve}=T,ye=[];return ye.push({color:se,value:{type:E,value:L}}),Z!=="none"&&ye.push({color:fe,value:{type:Z,value:B}}),ye.push({color:ve,value:{type:me,value:ee}}),{config:ye.map((Be,Ct)=>({...Be,index:Ct})),type:s.CFRuleType.colorScale}},[]);w.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return $({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:S,minColor:R,medianColor:O,maxColor:I})}}),[$,l,d,f,y,x,S,R,O,I,t]);const j=T=>{e.onChange($(T))};return p.jsxs("div",{children:[p.jsx("div",{className:D.title,children:n.t("sheet.cf.panel.styleRule")}),p.jsx("div",{className:`${P.cfPreviewWrap}`,children:p.jsx(mt,{rule:$({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:S,minColor:R,medianColor:O,maxColor:I})})}),p.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.min")}),p.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[p.jsx(G.Select,{options:a,value:l,onChange:T=>{u(T);const E=s.createDefaultValueByValueType(T,10);b(E),j({minType:T,medianType:d,maxType:f,minValue:E,medianValue:x,maxValue:S,minColor:R,medianColor:O,maxColor:I})}}),p.jsx(En,{id:"min",className:`${D.mLXxs}`,value:y,type:l,onChange:T=>{b(T),j({minType:l,medianType:d,maxType:f,minValue:T,medianValue:x,maxValue:S,minColor:R,medianColor:O,maxColor:I})}}),p.jsx(et,{className:D.mLXxs,color:R,onChange:T=>{m(T),j({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:S,minColor:T,medianColor:O,maxColor:I})}})]}),p.jsx("div",{className:D.label,children:n.t("sheet.cf.panel.medianValue")}),p.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[p.jsx(G.Select,{options:i,value:d,onChange:T=>{h(T);const E=s.createDefaultValueByValueType(T,50);_(E),j({minType:l,medianType:T,maxType:f,minValue:y,medianValue:E,maxValue:S,minColor:R,medianColor:O,maxColor:I})}}),p.jsx(En,{id:"median",className:` ${D.mLXxs}`,value:x,type:d,onChange:T=>{_(T),j({minType:l,medianType:d,maxType:f,minValue:y,medianValue:T,maxValue:S,minColor:R,medianColor:O,maxColor:I})}}),d!=="none"&&p.jsx(et,{className:D.mLXxs,color:O,onChange:T=>{M(T),j({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:S,minColor:R,medianColor:T,maxColor:I})}})]}),p.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.max")}),p.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[p.jsx(G.Select,{options:c,value:f,onChange:T=>{v(T);const E=s.createDefaultValueByValueType(T,90);C(E),j({minType:l,medianType:d,maxType:T,minValue:y,medianValue:x,maxValue:E,minColor:R,medianColor:O,maxColor:I})}}),p.jsx(En,{id:"max",className:`${D.mLXxs}`,value:S,type:f,onChange:T=>{C(T),j({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:T,minColor:R,medianColor:O,maxColor:I})}}),p.jsx(et,{className:D.mLXxs,color:I,onChange:T=>{F(T),j({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:S,minColor:R,medianColor:O,maxColor:T})}})]})]})},dt=(e,t)=>({label:t.t(`sheet.cf.valueType.${e}`),value:e}),Ur=e=>{const{onChange:t,className:n,value:r,type:o,id:a,disabled:i=!1}=e,c=te.useDependency(g.IUniverInstanceService),l=c.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getUnitId(),u=c.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),d=w.useRef(r),h=w.useMemo(()=>[s.CFValueType.percentile,s.CFValueType.percent].includes(o)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[o]);if(o===s.CFValueType.formula){const f=String(d.current).startsWith("=")?String(d.current)||"":"=";return p.jsx(be.TextEditor,{id:g.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_data_bar_${a}`),value:f,openForSheetSubUnitId:u,openForSheetUnitId:l,style:{width:"47%",marginLeft:14},canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(v="")=>{t(v||"")}})}return p.jsx(G.InputNumber,{className:n,value:Number(r)||0,disabled:i,onChange:f=>{t(f||0)},...h})},du=e=>{var q;const{interceptorManager:t}=e,n=te.useDependency(g.LocaleService),r=((q=e.rule)==null?void 0:q.type)===s.CFRuleType.dataBar?e.rule:void 0,[o,a]=w.useState(()=>{var E;const T="0";return r?(E=r.config)!=null&&E.isGradient?"1":"0":T}),[i,c]=w.useState(()=>{var E;const T="#abd91a";return r&&((E=r.config)==null?void 0:E.positiveColor)||T}),[l,u]=w.useState(()=>{var E;const T="#ffbe38";return r&&((E=r.config)==null?void 0:E.nativeColor)||T}),d=[dt(s.CFValueType.num,n),dt(s.CFValueType.percent,n),dt(s.CFValueType.percentile,n),dt(s.CFValueType.formula,n)],h=[dt(s.CFValueType.min,n),...d],f=[dt(s.CFValueType.max,n),...d],[v,y]=w.useState(()=>{var E;const T=h[0].value;return r&&((E=r.config)==null?void 0:E.min.type)||T}),[b,x]=w.useState(()=>{var E;const T=f[0].value;return r&&((E=r.config)==null?void 0:E.max.type)||T}),[_,S]=w.useState(()=>{var Z;if(!r)return 0;const E=((Z=r.config)==null?void 0:Z.min)||{};return E.type===s.CFValueType.formula?E.value||"=":E.value||0}),[C,R]=w.useState(()=>{var Z;if(!r)return 100;const E=((Z=r.config)==null?void 0:Z.max)||{};return E.type===s.CFValueType.formula?E.value||"=":E.value===void 0?100:E.value}),[m,O]=w.useState(()=>r?r.isShowValue===void 0?!0:!!r.isShowValue:!0),M=T=>({config:{min:{type:T.minValueType,value:T.minValue},max:{type:T.maxValueType,value:T.maxValue},isGradient:T.isGradient==="1",positiveColor:T.positiveColor,nativeColor:T.nativeColor},type:s.CFRuleType.dataBar,isShowValue:T.isShowValue});w.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return M({isGradient:o,minValue:_,minValueType:v,maxValue:C,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:m})}}),[o,_,v,C,b,i,l,t,m]);const I=T=>{e.onChange(M(T))},F=T=>{c(T),I({isGradient:o,minValue:_,minValueType:v,maxValue:C,maxValueType:b,positiveColor:T,nativeColor:l,isShowValue:m})},$=T=>{u(T),I({isGradient:o,minValue:_,minValueType:v,maxValue:C,maxValueType:b,positiveColor:i,nativeColor:T,isShowValue:m})},j=T=>d.map(E=>E.value).includes(T);return p.jsxs("div",{children:[p.jsx("div",{className:D.title,children:n.t("sheet.cf.panel.styleRule")}),p.jsx("div",{className:`${P.cfPreviewWrap}`,children:p.jsx(mt,{rule:M({isGradient:o,minValue:_,minValueType:v,maxValue:C,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:m})})}),p.jsxs("div",{children:[p.jsx("div",{className:D.label,children:n.t("sheet.cf.panel.fillType")}),p.jsxs("div",{className:`${D.mTSm} ${D.mLXxs} ${D.labelContainer} `,children:[p.jsxs(G.RadioGroup,{value:o,onChange:T=>{a(T),I({isGradient:T,minValue:_,minValueType:v,maxValue:C,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:m})},children:[p.jsx(G.Radio,{value:"0",children:p.jsx("span",{className:P.text,children:n.t("sheet.cf.panel.pureColor")})}),p.jsx(G.Radio,{value:"1",children:p.jsx("span",{className:P.text,children:n.t("sheet.cf.panel.gradient")})})]}),p.jsxs("div",{className:`${P.utilItem} ${D.mLXl}`,children:[p.jsx(G.Checkbox,{checked:!m,onChange:T=>{O(!T),I({isGradient:T,minValue:_,minValueType:v,maxValue:C,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:!T})}}),n.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),p.jsxs("div",{children:[p.jsx("div",{className:D.label,children:n.t("sheet.cf.panel.colorSet")}),p.jsxs("div",{className:`${D.labelContainer} ${D.mTSm} ${D.mLXxs}`,children:[p.jsxs("div",{className:`${D.labelContainer}`,children:[p.jsx("div",{className:`${P.text}`,children:n.t("sheet.cf.panel.native")}),p.jsx(et,{color:l,onChange:$})]}),p.jsxs("div",{className:`${D.labelContainer} ${D.mLSm} `,children:[p.jsx("div",{className:`${P.text} `,children:n.t("sheet.cf.panel.positive")}),p.jsx(et,{color:i,onChange:F})]})]})]}),p.jsxs("div",{children:[p.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.min")}),p.jsxs("div",{className:`${D.mTSm} ${D.labelContainer}`,children:[p.jsx(G.Select,{options:h,value:v,onChange:T=>{y(T);const E=s.createDefaultValueByValueType(T,10);S(E),I({isGradient:o,minValue:E,minValueType:T,maxValue:C,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:m})}}),p.jsx(Ur,{disabled:!j(v),id:"min",type:v,className:D.mLSm,value:_,onChange:T=>{S(T||0),I({isGradient:o,minValue:T||0,minValueType:v,maxValue:C,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:m})}})]}),p.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.max")}),p.jsxs("div",{className:`${D.mTSm} ${D.labelContainer}`,children:[p.jsx(G.Select,{options:f,value:b,onChange:T=>{x(T);const E=s.createDefaultValueByValueType(T,90);R(E),I({isGradient:o,minValue:_,minValueType:v,maxValue:E,maxValueType:T,positiveColor:i,nativeColor:l,isShowValue:m})}}),p.jsx(Ur,{disabled:!j(b),id:"max",type:b,className:D.mLSm,value:C,onChange:T=>{R(T||0),I({isGradient:o,minValue:_,minValueType:v,maxValue:T||0,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:m})}})]})]})]})},fu="univer-cf-style-edit",pu="univer-button-item",hu="univer-isActive",Ve={cfStyleEdit:fu,buttonItem:pu,isActive:hu},At=e=>[g.BooleanNumber.FALSE,void 0].includes(e)?g.BooleanNumber.TRUE:g.BooleanNumber.FALSE,kt=e=>e!==g.BooleanNumber.FALSE,gr=e=>{const{style:t,onChange:n,className:r}=e,o=te.useDependency(be.ComponentManager),[a,i]=w.useState(()=>{if(t!=null&&t.bl)return t.bl}),[c,l]=w.useState(()=>{if(t!=null&&t.it)return t.it}),[u,d]=w.useState(()=>{if(t!=null&&t.ul)return t.ul.s}),[h,f]=w.useState(()=>{if(t!=null&&t.st)return t.st.s}),[v,y]=w.useState(()=>{var O;const m="#2f56ef";return(O=t==null?void 0:t.cl)!=null&&O.rgb?t.cl.rgb:m}),[b,x]=w.useState(()=>{var O;const m="#e8ecfc";return(O=t==null?void 0:t.bg)!=null&&O.rgb?t.bg.rgb:m}),_=o.get("BoldSingle"),S=o.get("ItalicSingle"),C=o.get("UnderlineSingle"),R=o.get("StrikethroughSingle");return w.useEffect(()=>{const m={bl:a,it:c};v!==void 0&&(m.cl={rgb:v}),b!==void 0&&(m.bg={rgb:b}),h!==void 0&&(m.st={s:h}),u!==void 0&&(m.ul={s:u}),n(s.removeUndefinedAttr(m))},[a,c,u,h,v,b]),p.jsxs("div",{className:`${Ve.cfStyleEdit} ${r}`,children:[_&&p.jsx("div",{className:We({[Ve.isActive]:kt(a||g.BooleanNumber.FALSE)},Ve.buttonItem),onClick:()=>i(At(a)),children:p.jsx(_,{})}),S&&p.jsx("div",{className:We({[Ve.isActive]:kt(c||g.BooleanNumber.FALSE)},Ve.buttonItem),onClick:()=>l(At(c)),children:p.jsx(S,{})}),C&&p.jsx("div",{className:We({[Ve.isActive]:kt(u||g.BooleanNumber.FALSE)},Ve.buttonItem),onClick:()=>d(At(u)),children:p.jsx(C,{})}),R&&p.jsx("div",{className:We({[Ve.isActive]:kt(h||g.BooleanNumber.FALSE)},Ve.buttonItem),onClick:()=>f(At(h)),children:p.jsx(R,{})}),p.jsx(et,{color:v,onChange:y,iconId:"FontColor"}),p.jsx(et,{color:b,onChange:x,iconId:"PaintBucket"})]})},gu=e=>{var x;const{onChange:t,interceptorManager:n}=e,r=te.useDependency(g.LocaleService),o=((x=e.rule)==null?void 0:x.type)===s.CFRuleType.highlightCell?e.rule:void 0,a=[{label:r.t("sheet.cf.panel.isNotBottom"),value:"isNotBottom"},{label:r.t("sheet.cf.panel.isBottom"),value:"isBottom"},{label:r.t("sheet.cf.panel.greaterThanAverage"),value:"greaterThanAverage"},{label:r.t("sheet.cf.panel.lessThanAverage"),value:"lessThanAverage"}],[i,c]=w.useState(()=>{const _=a[0].value,S=o==null?void 0:o.type;if(!o)return _;switch(S){case s.CFRuleType.highlightCell:switch(o.subType){case s.CFSubRuleType.average:return[s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual].includes(o.operator)?"greaterThanAverage":[s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(o.operator)?"lessThanAverage":_;case s.CFSubRuleType.rank:return o.isBottom?"isBottom":"isNotBottom"}}return _}),[l,u]=w.useState(()=>{const S=o==null?void 0:o.type;if(!o)return 10;switch(S){case s.CFRuleType.highlightCell:switch(o.subType){case s.CFSubRuleType.rank:return o.value||10}}return 10}),[d,h]=w.useState(()=>{const S=o==null?void 0:o.type;if(!o)return!1;switch(S){case s.CFRuleType.highlightCell:switch(o.subType){case s.CFSubRuleType.rank:return o.isPercent||!1}}return!1}),[f,v]=w.useState({}),y=_=>{const{type:S,isPercent:C,value:R,style:m}=_;if(S==="isNotBottom")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank,isPercent:C,isBottom:!1,value:R,style:m};if(S==="isBottom")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank,isPercent:C,isBottom:!0,value:R,style:m};if(S==="greaterThanAverage")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.average,operator:s.CFNumberOperator.greaterThan,style:m};if(S==="lessThanAverage")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.average,operator:s.CFNumberOperator.lessThan,style:m}};w.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return y({type:i,isPercent:d,value:l,style:f})}}),[i,d,l,f,n]);const b=_=>{t(y(_))};return p.jsxs("div",{children:[p.jsx("div",{className:`${D.title} ${D.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),p.jsx(G.Select,{className:`${P.width100} ${D.mTSm}`,value:i,options:a,onChange:_=>{c(_),b({type:_,isPercent:d,value:l,style:f})}}),["isNotBottom","isBottom"].includes(i)&&p.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[p.jsx(G.InputNumber,{min:1,max:1e3,value:l,onChange:_=>{const S=_||0;u(S),b({type:i,isPercent:d,value:S,style:f})}}),p.jsxs("div",{className:`${D.mLSm} ${D.labelContainer} ${P.text}`,children:[p.jsx(G.Checkbox,{checked:d,onChange:_=>{h(!!_),b({type:i,isPercent:!!_,value:l,style:f})}}),r.t("sheet.cf.valueType.percent")]})]}),p.jsx("div",{className:`${P.cfPreviewWrap} `,children:p.jsx(mt,{rule:y({type:i,isPercent:d,value:l,style:f})})}),p.jsx(gr,{style:o==null?void 0:o.style,className:`${D.mTSm} `,onChange:_=>{v(_),b({type:i,isPercent:d,value:l,style:_})}})]})},Q=(e,t)=>({label:t.t(`sheet.cf.operator.${e}`),value:e}),mu=e=>{const{type:t,operator:n,onChange:r,value:o}=e,[a,i]=w.useState(()=>typeof o=="number"?o:0),[c,l]=w.useState(()=>typeof o=="string"?o:""),[u,d]=w.useState(()=>Array.isArray(o)?o[0]===void 0?0:o[0]:0),[h,f]=w.useState(()=>Array.isArray(o)?o[1]===void 0?100:o[1]:100);switch(w.useEffect(()=>{switch(t){case s.CFSubRuleType.text:{[s.CFTextOperator.beginsWith,s.CFTextOperator.endsWith,s.CFTextOperator.containsText,s.CFTextOperator.notContainsText,s.CFTextOperator.equal,s.CFTextOperator.notEqual].includes(n)&&r(c);break}case s.CFSubRuleType.number:{[s.CFNumberOperator.equal,s.CFNumberOperator.notEqual,s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual,s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(n)&&r(a),[s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(n)&&r([u,h]);break}}},[t]),t){case s.CFSubRuleType.text:{if([s.CFTextOperator.beginsWith,s.CFTextOperator.endsWith,s.CFTextOperator.containsText,s.CFTextOperator.notContainsText,s.CFTextOperator.equal,s.CFTextOperator.notEqual].includes(n)){const v=y=>{l(y),r(y)};return p.jsx("div",{className:`${D.mTSm}`,children:p.jsx(G.Input,{className:P.width100,value:c,onChange:v})})}break}case s.CFSubRuleType.number:{if([s.CFNumberOperator.equal,s.CFNumberOperator.notEqual,s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual,s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(n)){const v=y=>{i(y||0),r(y||0)};return p.jsx("div",{className:`${D.mTSm}`,children:p.jsx(G.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:P.width100,value:a,onChange:v})})}if([s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(n)){const v=b=>{d(b||0),r([b||0,h])},y=b=>{f(b||0),r([u,b||0])};return p.jsxs("div",{className:`${D.mTSm} ${D.labelContainer} `,children:[p.jsx(G.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:u,onChange:v}),p.jsx(G.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`${D.mLSm}`,value:h,onChange:y})]})}}}return null},zr=(e,t)=>{switch(e){case s.CFSubRuleType.text:return[Q(s.CFTextOperator.containsText,t),Q(s.CFTextOperator.notContainsText,t),Q(s.CFTextOperator.beginsWith,t),Q(s.CFTextOperator.endsWith,t),Q(s.CFTextOperator.equal,t),Q(s.CFTextOperator.notEqual,t),Q(s.CFTextOperator.containsBlanks,t),Q(s.CFTextOperator.notContainsBlanks,t),Q(s.CFTextOperator.containsErrors,t),Q(s.CFTextOperator.notContainsErrors,t)];case s.CFSubRuleType.number:return[Q(s.CFNumberOperator.between,t),Q(s.CFNumberOperator.notBetween,t),Q(s.CFNumberOperator.equal,t),Q(s.CFNumberOperator.notEqual,t),Q(s.CFNumberOperator.greaterThan,t),Q(s.CFNumberOperator.greaterThanOrEqual,t),Q(s.CFNumberOperator.lessThan,t),Q(s.CFNumberOperator.lessThanOrEqual,t)];case s.CFSubRuleType.timePeriod:return[Q(s.CFTimePeriodOperator.yesterday,t),Q(s.CFTimePeriodOperator.today,t),Q(s.CFTimePeriodOperator.tomorrow,t),Q(s.CFTimePeriodOperator.last7Days,t),Q(s.CFTimePeriodOperator.lastWeek,t),Q(s.CFTimePeriodOperator.thisWeek,t),Q(s.CFTimePeriodOperator.nextWeek,t),Q(s.CFTimePeriodOperator.lastMonth,t),Q(s.CFTimePeriodOperator.thisMonth,t),Q(s.CFTimePeriodOperator.nextMonth,t)]}},Ar=e=>{var R;const{interceptorManager:t,onChange:n}=e,r=te.useDependency(g.LocaleService),o=((R=e.rule)==null?void 0:R.type)===s.CFRuleType.highlightCell?e.rule:void 0,[a,i]=w.useState(()=>{const m=s.CFSubRuleType.text;return o&&o.subType||m}),c=[{value:s.CFSubRuleType.text,label:r.t("sheet.cf.subRuleType.text")},{value:s.CFSubRuleType.number,label:r.t("sheet.cf.subRuleType.number")},{value:s.CFSubRuleType.timePeriod,label:r.t("sheet.cf.subRuleType.timePeriod")},{value:s.CFSubRuleType.duplicateValues,label:r.t("sheet.cf.subRuleType.duplicateValues")},{value:s.CFSubRuleType.uniqueValues,label:r.t("sheet.cf.subRuleType.uniqueValues")}],l=w.useMemo(()=>zr(a,r),[a]),[u,d]=w.useState(()=>{const m=l?l[0].value:void 0;return o&&o.operator||m}),[h,f]=w.useState(()=>{var M;const m="";return o?(M=o.value)!=null?M:s.createDefaultValue(o.subType,o.operator):m}),[v,y]=w.useState({}),b=w.useMemo(()=>m=>{var O,M,I,F,$,j,q,T,E,Z,me,L,B,ee,se;switch(m.subType||a){case s.CFSubRuleType.text:{if([s.CFTextOperator.beginsWith,s.CFTextOperator.endsWith,s.CFTextOperator.containsText,s.CFTextOperator.notContainsText,s.CFTextOperator.equal,s.CFTextOperator.notEqual].includes(u))return{type:s.CFRuleType.highlightCell,subType:(O=m.subType)!=null?O:a,operator:(M=m.operator)!=null?M:u,style:(I=m.style)!=null?I:v,value:(F=m.value)!=null?F:h};break}case s.CFSubRuleType.number:{if([s.CFNumberOperator.equal,s.CFNumberOperator.notEqual,s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual,s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(u))return{type:s.CFRuleType.highlightCell,subType:($=m.subType)!=null?$:a,operator:(j=m.operator)!=null?j:u,style:(q=m.style)!=null?q:v,value:(T=m.value)!=null?T:h};if([s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(u))return{type:s.CFRuleType.highlightCell,subType:(E=m.subType)!=null?E:a,operator:(Z=m.operator)!=null?Z:u,style:(me=m.style)!=null?me:v,value:(L=m.value)!=null?L:h};break}}return{type:s.CFRuleType.highlightCell,subType:(B=m.subType)!=null?B:a,operator:(ee=m.operator)!=null?ee:u,style:(se=m.style)!=null?se:v}},[a,u,h,v]);w.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return b({})}}),[b,t]),w.useEffect(()=>{c.some(m=>m.value===a)||i(c[0].value)},[c]);const x=m=>{const O=m,M=zr(O,r),I=M&&M[0].value;i(O),d(I),I&&f(s.createDefaultValue(O,I)),n(b({subType:O,operator:I}))},_=m=>{const O=m;d(O),n(b({operator:O}))},S=m=>{f(m),n(b({value:m}))},C=w.useMemo(()=>`${a}_${u}_${Math.random()}`,[a,u]);return p.jsxs("div",{children:[p.jsx("div",{className:`${D.title} ${D.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),p.jsx(G.Select,{className:`${D.mTSm} ${P.width100}`,onChange:x,value:a,options:c}),(l==null?void 0:l.length)&&p.jsx(G.Select,{className:`${D.mTSm} ${P.width100}`,onChange:_,value:u||"",options:l}),p.jsx(mu,{value:h,interceptorManager:t,type:a,operator:u,rule:o,onChange:S},C),p.jsx("div",{className:`${P.cfPreviewWrap}`,children:p.jsx(mt,{rule:b({})})}),p.jsx(gr,{style:o==null?void 0:o.style,className:`${D.mLXxs}`,onChange:m=>{y(m),n(b({style:m}))}})]})},vu=e=>{var y;const{onChange:t,interceptorManager:n}=e,r=te.useDependency(g.LocaleService),a=te.useDependency(g.IUniverInstanceService).getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET),i=a.getActiveSheet(),c=((y=e.rule)==null?void 0:y.type)===s.CFRuleType.highlightCell?e.rule:void 0,[l,u]=w.useState({}),[d,h]=w.useState(()=>(c==null?void 0:c.subType)===s.CFSubRuleType.formula?c.value:"="),f=b=>({style:b.style,value:d,type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.formula});w.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return f({style:l,formula:d})}}),[l,d,n]);const v=b=>{t(f(b))};return p.jsxs("div",{children:[p.jsx("div",{className:`${D.title} ${D.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),p.jsx("div",{className:`${D.mTSm}`,children:p.jsx(be.TextEditor,{id:g.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_formula`),openForSheetSubUnitId:i.getSheetId(),openForSheetUnitId:a.getUnitId(),value:d,canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(b="")=>{const x=b||"";h(x),v({style:l,formula:x})}})}),p.jsx("div",{className:`${P.cfPreviewWrap} `,children:p.jsx(mt,{rule:f({style:l,formula:d})})}),p.jsx(gr,{style:c==null?void 0:c.style,className:`${D.mTSm} `,onChange:b=>{u(b),v({style:b,formula:d})}})]})};var yu="Expected a function",aa="__lodash_hash_undefined__",ia=1/0,Cu=9007199254740991,Su="[object Function]",bu="[object GeneratorFunction]",Tu="[object Symbol]",Ru=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_u=/^\w*$/,wu=/^\./,Iu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xu=/[\\^$.*+?()[\]{}|]/g,Ou=/\\(\\)?/g,Eu=/^\[object .+?Constructor\]$/,Mu=/^(?:0|[1-9]\d*)$/,Du=typeof Ue=="object"&&Ue&&Ue.Object===Object&&Ue,Pu=typeof self=="object"&&self&&self.Object===Object&&self,mr=Du||Pu||Function("return this")();function Nu(e,t){return e==null?void 0:e[t]}function Fu(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var $u=Array.prototype,ju=Function.prototype,sa=Object.prototype,Mn=mr["__core-js_shared__"],kr=function(){var e=/[^.]+$/.exec(Mn&&Mn.keys&&Mn.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),la=ju.toString,gn=sa.hasOwnProperty,ca=sa.toString,Lu=RegExp("^"+la.call(gn).replace(xu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hr=mr.Symbol,Vu=$u.splice,Uu=ua(mr,"Map"),Dt=ua(Object,"create"),Wr=Hr?Hr.prototype:void 0,qr=Wr?Wr.toString:void 0;function tt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function zu(){this.__data__=Dt?Dt(null):{}}function Au(e){return this.has(e)&&delete this.__data__[e]}function ku(e){var t=this.__data__;if(Dt){var n=t[e];return n===aa?void 0:n}return gn.call(t,e)?t[e]:void 0}function Hu(e){var t=this.__data__;return Dt?t[e]!==void 0:gn.call(t,e)}function Wu(e,t){var n=this.__data__;return n[e]=Dt&&t===void 0?aa:t,this}tt.prototype.clear=zu;tt.prototype.delete=Au;tt.prototype.get=ku;tt.prototype.has=Hu;tt.prototype.set=Wu;function vt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function qu(){this.__data__=[]}function Bu(e){var t=this.__data__,n=mn(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Vu.call(t,n,1),!0}function Gu(e){var t=this.__data__,n=mn(t,e);return n<0?void 0:t[n][1]}function Xu(e){return mn(this.__data__,e)>-1}function Yu(e,t){var n=this.__data__,r=mn(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}vt.prototype.clear=qu;vt.prototype.delete=Bu;vt.prototype.get=Gu;vt.prototype.has=Xu;vt.prototype.set=Yu;function it(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ku(){this.__data__={hash:new tt,map:new(Uu||vt),string:new tt}}function Zu(e){return vn(this,e).delete(e)}function Ju(e){return vn(this,e).get(e)}function Qu(e){return vn(this,e).has(e)}function ed(e,t){return vn(this,e).set(e,t),this}it.prototype.clear=Ku;it.prototype.delete=Zu;it.prototype.get=Ju;it.prototype.has=Qu;it.prototype.set=ed;function td(e,t,n){var r=e[t];(!(gn.call(e,t)&&da(r,n))||n===void 0&&!(t in e))&&(e[t]=n)}function mn(e,t){for(var n=e.length;n--;)if(da(e[n][0],t))return n;return-1}function nd(e){if(!Qt(e)||cd(e))return!1;var t=pd(e)||Fu(e)?Lu:Eu;return t.test(fd(e))}function rd(e,t,n,r){if(!Qt(e))return e;t=sd(t,e)?[t]:ad(t);for(var o=-1,a=t.length,i=a-1,c=e;c!=null&&++o<a;){var l=dd(t[o]),u=n;if(o!=i){var d=c[l];u=r?r(d,l,c):void 0,u===void 0&&(u=Qt(d)?d:id(t[o+1])?[]:{})}td(c,l,u),c=c[l]}return e}function od(e){if(typeof e=="string")return e;if(yr(e))return qr?qr.call(e):"";var t=e+"";return t=="0"&&1/e==-ia?"-0":t}function ad(e){return fa(e)?e:ud(e)}function vn(e,t){var n=e.__data__;return ld(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ua(e,t){var n=Nu(e,t);return nd(n)?n:void 0}function id(e,t){return t=t==null?Cu:t,!!t&&(typeof e=="number"||Mu.test(e))&&e>-1&&e%1==0&&e<t}function sd(e,t){if(fa(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||yr(e)?!0:_u.test(e)||!Ru.test(e)||t!=null&&e in Object(t)}function ld(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function cd(e){return!!kr&&kr in e}var ud=vr(function(e){e=gd(e);var t=[];return wu.test(e)&&t.push(""),e.replace(Iu,function(n,r,o,a){t.push(o?a.replace(Ou,"$1"):r||n)}),t});function dd(e){if(typeof e=="string"||yr(e))return e;var t=e+"";return t=="0"&&1/e==-ia?"-0":t}function fd(e){if(e!=null){try{return la.call(e)}catch{}try{return e+""}catch{}}return""}function vr(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError(yu);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=e.apply(this,r);return n.cache=a.set(o,i),i};return n.cache=new(vr.Cache||it),n}vr.Cache=it;function da(e,t){return e===t||e!==e&&t!==t}var fa=Array.isArray;function pd(e){var t=Qt(e)?ca.call(e):"";return t==Su||t==bu}function Qt(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function hd(e){return!!e&&typeof e=="object"}function yr(e){return typeof e=="symbol"||hd(e)&&ca.call(e)==Tu}function gd(e){return e==null?"":od(e)}function md(e,t,n){return e==null?e:rd(e,t,n)}var vd=md;const yd=Bn(vd);var Cd="Expected a function",pa="__lodash_hash_undefined__",ha=1/0,Sd="[object Function]",bd="[object GeneratorFunction]",Td="[object Symbol]",Rd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_d=/^\w*$/,wd=/^\./,Id=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xd=/[\\^$.*+?()[\]{}|]/g,Od=/\\(\\)?/g,Ed=/^\[object .+?Constructor\]$/,Md=typeof Ue=="object"&&Ue&&Ue.Object===Object&&Ue,Dd=typeof self=="object"&&self&&self.Object===Object&&self,Cr=Md||Dd||Function("return this")();function Pd(e,t){return e==null?void 0:e[t]}function Nd(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var Fd=Array.prototype,$d=Function.prototype,ga=Object.prototype,Dn=Cr["__core-js_shared__"],Br=function(){var e=/[^.]+$/.exec(Dn&&Dn.keys&&Dn.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ma=$d.toString,Sr=ga.hasOwnProperty,va=ga.toString,jd=RegExp("^"+ma.call(Sr).replace(xd,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gr=Cr.Symbol,Ld=Fd.splice,Vd=ya(Cr,"Map"),Pt=ya(Object,"create"),Xr=Gr?Gr.prototype:void 0,Yr=Xr?Xr.toString:void 0;function nt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ud(){this.__data__=Pt?Pt(null):{}}function zd(e){return this.has(e)&&delete this.__data__[e]}function Ad(e){var t=this.__data__;if(Pt){var n=t[e];return n===pa?void 0:n}return Sr.call(t,e)?t[e]:void 0}function kd(e){var t=this.__data__;return Pt?t[e]!==void 0:Sr.call(t,e)}function Hd(e,t){var n=this.__data__;return n[e]=Pt&&t===void 0?pa:t,this}nt.prototype.clear=Ud;nt.prototype.delete=zd;nt.prototype.get=Ad;nt.prototype.has=kd;nt.prototype.set=Hd;function yt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Wd(){this.__data__=[]}function qd(e){var t=this.__data__,n=yn(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Ld.call(t,n,1),!0}function Bd(e){var t=this.__data__,n=yn(t,e);return n<0?void 0:t[n][1]}function Gd(e){return yn(this.__data__,e)>-1}function Xd(e,t){var n=this.__data__,r=yn(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}yt.prototype.clear=Wd;yt.prototype.delete=qd;yt.prototype.get=Bd;yt.prototype.has=Gd;yt.prototype.set=Xd;function st(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yd(){this.__data__={hash:new nt,map:new(Vd||yt),string:new nt}}function Kd(e){return Cn(this,e).delete(e)}function Zd(e){return Cn(this,e).get(e)}function Jd(e){return Cn(this,e).has(e)}function Qd(e,t){return Cn(this,e).set(e,t),this}st.prototype.clear=Yd;st.prototype.delete=Kd;st.prototype.get=Zd;st.prototype.has=Jd;st.prototype.set=Qd;function yn(e,t){for(var n=e.length;n--;)if(df(e[n][0],t))return n;return-1}function ef(e,t){t=of(t,e)?[t]:rf(t);for(var n=0,r=t.length;e!=null&&n<r;)e=e[cf(t[n++])];return n&&n==r?e:void 0}function tf(e){if(!Sa(e)||sf(e))return!1;var t=ff(e)||Nd(e)?jd:Ed;return t.test(uf(e))}function nf(e){if(typeof e=="string")return e;if(Tr(e))return Yr?Yr.call(e):"";var t=e+"";return t=="0"&&1/e==-ha?"-0":t}function rf(e){return Ca(e)?e:lf(e)}function Cn(e,t){var n=e.__data__;return af(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ya(e,t){var n=Pd(e,t);return tf(n)?n:void 0}function of(e,t){if(Ca(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Tr(e)?!0:_d.test(e)||!Rd.test(e)||t!=null&&e in Object(t)}function af(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function sf(e){return!!Br&&Br in e}var lf=br(function(e){e=hf(e);var t=[];return wd.test(e)&&t.push(""),e.replace(Id,function(n,r,o,a){t.push(o?a.replace(Od,"$1"):r||n)}),t});function cf(e){if(typeof e=="string"||Tr(e))return e;var t=e+"";return t=="0"&&1/e==-ha?"-0":t}function uf(e){if(e!=null){try{return ma.call(e)}catch{}try{return e+""}catch{}}return""}function br(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError(Cd);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=e.apply(this,r);return n.cache=a.set(o,i),i};return n.cache=new(br.Cache||st),n}br.Cache=st;function df(e,t){return e===t||e!==e&&t!==t}var Ca=Array.isArray;function ff(e){var t=Sa(e)?va.call(e):"";return t==Sd||t==bd}function Sa(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function pf(e){return!!e&&typeof e=="object"}function Tr(e){return typeof e=="symbol"||pf(e)&&va.call(e)==Td}function hf(e){return e==null?"":nf(e)}function gf(e,t,n){var r=e==null?void 0:ef(e,t);return r===void 0?n:r}var mf=gf;const vf=Bn(mf),ba=(e,t)=>(s.iconMap[e]||[])[Number(t)]||"",yf=e=>{const t=te.useDependency(g.IUniverInstanceService),n=t.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getUnitId(),r=t.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),o=w.useMemo(()=>e.error?P.errorInput:"",[e.error]);return p.jsx("div",{className:P.positionRelative,children:e.type!==s.CFValueType.formula?p.jsxs(p.Fragment,{children:[p.jsx(G.InputNumber,{className:o,value:Number(e.value)||0,onChange:a=>e.onChange(a!=null?a:0)}),e.error&&p.jsx("div",{className:P.errorText,children:e.error})]}):p.jsx(be.TextEditor,{id:g.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_icon_set_${e.id}`),value:String(e.value).startsWith("=")?String(e.value):"=",openForSheetSubUnitId:r,openForSheetUnitId:n,canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(a="")=>{const i=a||"";e.onChange(i)}})})},Kr=(e,t,n)=>({operator:s.CFNumberOperator.greaterThan,value:{type:s.CFValueType.num,value:(n.length-1-t)*10},iconType:e,iconId:String(t)}),Cf=e=>{const t=te.useDependency(g.LocaleService),n=r=>{e.onClick(r)};return p.jsx("div",{className:P.iconGroupList,children:s.iconGroup.map((r,o)=>p.jsxs("div",{className:P.group,children:[p.jsx("div",{className:P.title,children:t.t(r.title)}),p.jsx("div",{className:P.itemContent,children:r.group.map(a=>p.jsx("div",{className:P.itemWrap,onClick:()=>{n(a.name)},children:p.jsx("div",{className:P.item,children:a.list.map((i,c)=>p.jsx("img",{className:P.icon,src:i},c))})},a.name))})]},o))})},Sf=e=>{const t=w.useMemo(()=>{const r=[];for(const o in s.iconMap){const a=s.iconMap[o],i=o;a.forEach((c,l)=>{r.push({iconType:i,base64:c,iconId:String(l)})})}return r},[]),n=r=>{e.onClick(r.iconType,r.iconId)};return p.jsxs("div",{className:P.iconItemListWrap,children:[p.jsxs("div",{className:P.none,onClick:()=>n({iconType:s.EMPTY_ICON_TYPE,iconId:"",base64:""}),children:[p.jsx(en,{className:P.icon}),p.jsx("span",{children:"无单元格图标"})]}),p.jsx("div",{className:P.iconItemList,children:t.map(r=>p.jsx("div",{className:P.item,children:p.jsx("img",{onClick:()=>n(r),className:`${P.icon}`,src:r.base64})},`${r.iconType}_${r.iconId}`))})]})},bf=e=>{const{onChange:t,configList:n,errorMap:r={}}=e,o=te.useDependency(g.LocaleService),a=[{label:o.t(`sheet.cf.symbol.${s.CFNumberOperator.greaterThan}`),value:s.CFNumberOperator.greaterThan},{label:o.t(`sheet.cf.symbol.${s.CFNumberOperator.greaterThanOrEqual}`),value:s.CFNumberOperator.greaterThanOrEqual}],i=[{label:o.t(`sheet.cf.valueType.${s.CFValueType.num}`),value:s.CFValueType.num},{label:o.t(`sheet.cf.valueType.${s.CFValueType.percent}`),value:s.CFValueType.percent},{label:o.t(`sheet.cf.valueType.${s.CFValueType.percentile}`),value:s.CFValueType.percentile},{label:o.t(`sheet.cf.valueType.${s.CFValueType.formula}`),value:s.CFValueType.formula}],c=(h,f)=>{t([String(f),"value","value"],h)},l=(h,f)=>{t([String(f),"operator"],h);const v=s.createDefaultValue(s.CFSubRuleType.number,h);c(v,f)},u=(h,f)=>{t([String(f),"value","type"],h)};return w.useMemo(()=>n.map((h,f)=>{const v=r[f],y=ba(h.iconType,h.iconId),b=f===n.length-1,x=f===0,_=n[f-1],S=(_==null?void 0:_.value.type)===s.CFValueType.formula?o.t("sheet.cf.valueType.formula"):_==null?void 0:_.value.value,C=(R,m)=>{const O={...h,iconId:m,iconType:R};t([String(f)],O)};return p.jsxs("div",{className:`${f?D.mTXl:D.mTSm}`,children:[p.jsxs("div",{className:`${D.label} ${P.flex}`,children:[p.jsxs("div",{className:`${P.width45}`,children:[o.t("sheet.cf.iconSet.icon"),f+1]}),p.jsx("div",{className:`${P.width45}`,children:p.jsxs(p.Fragment,{children:[!x&&!b&&o.t("sheet.cf.iconSet.rule"),!x&&!b&&p.jsxs("span",{className:P.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${s.getOppositeOperator(_.operator)}`),S,b?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),p.jsxs("div",{className:`${P.flex} ${D.mTSm}`,children:[p.jsx("div",{className:`${P.iconWrap} ${P.width45}`,children:p.jsx(G.Dropdown,{overlay:p.jsx(Sf,{onClick:C,iconId:h.iconId,iconType:h.iconType}),children:p.jsxs("div",{className:P.dropdownIcon,children:[y?p.jsx("img",{src:y,className:P.icon}):p.jsx(en,{className:P.icon}),p.jsx(qn,{})]})})}),b?p.jsxs("div",{className:`${P.width45} ${D.label}`,style:{marginTop:0},children:[o.t("sheet.cf.iconSet.rule"),p.jsxs("span",{className:P.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${s.getOppositeOperator(_.operator)}`),S,b?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]}):p.jsx(G.Select,{className:`${D.mL0} ${P.width45} ${D.mR0}`,options:a,value:h.operator,onChange:R=>{l(R,f)}})]}),b?p.jsx("div",{}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:`${D.mTSm} ${D.label} ${P.flex}`,children:[p.jsx("div",{className:`${P.width45}`,children:o.t("sheet.cf.iconSet.type")}),p.jsx("div",{className:`${P.width45}`,children:o.t("sheet.cf.iconSet.value")})]}),p.jsxs("div",{className:`${D.mTSm} ${P.flex}`,children:[p.jsx(G.Select,{className:`${P.width45} ${D.mL0}`,options:i,value:h.value.type,onChange:R=>{u(R,f)}}),p.jsx("div",{className:`${D.mL0} ${P.width45}`,children:p.jsx(yf,{id:f,type:h.value.type,error:v,value:h.value.value||"",onChange:R=>c(R,f)})})]})]})]},f)}),[n,r])},Tf=e=>{var _;const{interceptorManager:t}=e,n=((_=e.rule)==null?void 0:_.type)===s.CFRuleType.iconSet?e.rule:void 0,r=te.useDependency(g.LocaleService),[o,a]=w.useState({}),[i,c]=w.useState(()=>{const S=Object.keys(s.iconMap)[0];if(n&&n.config.length){const C=n.config[0].iconType;if(!n.config.some(m=>m.iconType!==C))return C}return S}),[l,u]=w.useState(()=>{if(n&&n.config.length)return g.Tools.deepClone(n==null?void 0:n.config);const S=s.iconMap[i]||[];return new Array(S.length).fill("").map((C,R,m)=>R===m.length-1?{operator:s.CFNumberOperator.lessThanOrEqual,value:{type:s.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:i,iconId:String(R)}:Kr(i,R,m))}),[d,h]=w.useState(()=>n?!!n.isShowValue:!0),f=w.useMemo(()=>{const S=l.map(C=>ba(C.iconType,C.iconId));return p.jsx("div",{className:P.iconWrap,children:S.map((C,R)=>C?p.jsx("img",{className:P.icon,src:C},R):p.jsx(en,{className:P.icon},R))})},[l]),v=S=>{if(S.reduce((R,m,O)=>R.preType&&!R.result||S.length-1===O?R:m.value.type===s.CFValueType.formula?{preType:s.CFValueType.formula,result:!1}:R.preType?{result:R.preType===m.value.type,preType:m.value.type}:{result:!0,preType:m.value.type},{result:!0,preType:""}).result&&[s.CFValueType.num,s.CFValueType.percent,s.CFValueType.percentile].includes(S[0].value.type)){const R={};return S.forEach((m,O,M)=>{if(O-1<0||O===M.length-1)return;const F=S[O-1],$=s.getOppositeOperator(F.operator);s.compareWithNumber({operator:$,value:F.value.value},m.value.value)||(R[O]=`${r.t(`sheet.cf.form.${$}`,String(F.value.value))} `)}),R}return{}},y=(S,C)=>{vf(l,S)!==C&&(yd(l,S,C),u([...l]),a(v(l)))},b=S=>{c(S);const C=s.iconMap[S]||[],R=new Array(C.length).fill("").map((m,O,M)=>Kr(S,O,M));u(R),a(v(R))};w.useEffect(()=>{const S=t.intercept(t.getInterceptPoints().submit,{handler(){return{type:s.CFRuleType.iconSet,isShowValue:d,config:l}}});return()=>{S()}},[d,l,t]),w.useEffect(()=>{const S=t.intercept(t.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(o).length===0}});return()=>{S()}},[d,l,t,o]);const x=()=>{const S=l.map(C=>({...C}));l.forEach((C,R)=>{const m=l.length-1-R,O=S[m];C.iconId=O.iconId,C.iconType=O.iconType}),u([...l])};return p.jsxs("div",{className:P.iconSet,children:[p.jsx("div",{className:D.title,children:r.t("sheet.cf.panel.styleRule")}),p.jsx("div",{className:`${D.mTSm}`,children:p.jsx(G.Dropdown,{overlay:p.jsx(Cf,{iconType:i,onClick:b}),children:p.jsxs("div",{className:P.dropdownIcon,style:{width:"unset"},children:[f,p.jsx(qn,{})]})})}),p.jsxs("div",{className:`${D.mTSm} ${P.renderConfig}`,children:[p.jsxs("div",{className:P.utilItem,children:[p.jsx(G.Checkbox,{onChange:x}),r.t("sheet.cf.iconSet.reverseIconOrder")]}),p.jsxs("div",{className:`${P.utilItem} ${D.mLXl}`,children:[p.jsx(G.Checkbox,{checked:!d,onChange:S=>{h(!S)}}),r.t("sheet.cf.iconSet.onlyShowIcon")]})]}),p.jsx(bf,{errorMap:o,onChange:y,configList:l})]})},Zr=e=>e.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getUnitId(),Jr=e=>e.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),Rf=e=>{var R,m,O,M;const t=te.useDependency(g.LocaleService),n=te.useDependency(g.ICommandService),r=te.useDependency(g.IUniverInstanceService),o=te.useDependency(s.ConditionalFormattingRuleModel),a=te.useDependency(k.SelectionManagerService),i=Zr(r),c=Jr(r),l=w.useRef((m=(R=e.rule)==null?void 0:R.ranges)!=null?m:[]),u=w.useMemo(()=>{var F,$;let I=(F=e.rule)==null?void 0:F.ranges;return I!=null&&I.length||(I=($=a.getSelectionRanges())!=null?$:[]),l.current=I,I!=null&&I.length?I.map(j=>{const q=no.serializeRange(j);return q==="NaN"?"":q}).filter(j=>!!j).join(","):""},[e.rule]),d=[{label:t.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:t.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:t.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:t.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:t.t("sheet.cf.ruleType.formula"),value:"5"},{label:t.t("sheet.cf.ruleType.iconSet"),value:"6"}],[h,f]=w.useState(()=>{var $,j;const I=($=e.rule)==null?void 0:$.rule.type,F=d[0].value;if(!I)return F;switch(I){case s.CFRuleType.highlightCell:{switch((j=e.rule)==null?void 0:j.rule.subType){case s.CFSubRuleType.number:case s.CFSubRuleType.text:case s.CFSubRuleType.duplicateValues:case s.CFSubRuleType.uniqueValues:case s.CFSubRuleType.timePeriod:return"1";case s.CFSubRuleType.average:case s.CFSubRuleType.rank:return"2";case s.CFSubRuleType.formula:return"5"}break}case s.CFRuleType.dataBar:return"3";case s.CFRuleType.colorScale:return"4";case s.CFRuleType.iconSet:return"6"}return F}),v=w.useRef(),y=w.useMemo(()=>new g.InterceptorManager({beforeSubmit:Nc,submit:Fc}),[]),b=w.useMemo(()=>{switch(h){case"1":return Ar;case"2":return gu;case"3":return du;case"4":return uu;case"5":return vu;case"6":return Tf;default:return Ar}},[h]);w.useEffect(()=>{var I;if(((I=e.rule)==null?void 0:I.cfId)!==void 0){const F=n.onCommandExecuted($=>{if($.id===k.RemoveSheetMutation.id){const j=$.params;j.subUnitId===c&&j.unitId===i&&e.onCancel()}$.id===k.SetWorksheetActiveOperation.id&&e.onCancel()});return()=>F.dispose()}},[(O=e.rule)==null?void 0:O.cfId]);const x=I=>{v.current=I},_=I=>{l.current=I.map(F=>F.range)},S=()=>{const I=y.fetchThroughInterceptors(y.getInterceptPoints().beforeSubmit)(!0,null),F=()=>{const $=r.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getActiveSheet();return l.current.map(T=>k.setEndForRange(T,$.getRowCount(),$.getColumnCount())).filter(T=>!(Number.isNaN(T.startRow)||Number.isNaN(T.startColumn)))};if(I){const $=y.fetchThroughInterceptors(y.getInterceptPoints().submit)(null,null),j=F();if($&&j.length){const q=Zr(r),T=Jr(r);let E={};e.rule&&e.rule.cfId?(E={...e.rule,ranges:j,rule:$},n.executeCommand(oa.id,{unitId:q,subUnitId:T,rule:E}),e.onCancel()):(E={cfId:o.createCfId(q,T),ranges:j,rule:$,stopIfTrue:!1},n.executeCommand(ra.id,{unitId:q,subUnitId:T,rule:E}),e.onCancel())}}},C=()=>{e.onCancel()};return p.jsxs("div",{className:P.cfRuleStyleEditor,children:[p.jsx("div",{className:D.title,children:t.t("sheet.cf.panel.range")}),p.jsx("div",{className:`${D.mTBase}`,children:p.jsx(be.RangeSelector,{placeholder:t.t("sheet.cf.form.rangeSelector"),width:"100%",openForSheetSubUnitId:c,openForSheetUnitId:i,value:u,id:g.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_rangeSelector`),onChange:_})}),p.jsx("div",{className:D.title,children:t.t("sheet.cf.panel.styleType")}),p.jsx("div",{className:D.mTBase,children:p.jsx(G.Select,{className:P.width100,value:h,options:d,onChange:I=>f(I)})}),p.jsx(b,{interceptorManager:y,rule:(M=e.rule)==null?void 0:M.rule,onChange:x}),p.jsxs("div",{className:`${D.mTBase} ${P.btnList}`,children:[p.jsx(G.Button,{size:"small",onClick:C,children:t.t("sheet.cf.panel.cancel")}),p.jsx(G.Button,{className:D.mLSm,size:"small",type:"primary",onClick:S,children:t.t("sheet.cf.panel.submit")})]})]})},_f=e=>{const[t,n]=w.useState(e.rule),[r,o]=w.useState(!!e.rule),a=()=>{o(!0)},i=()=>{o(!1),n(void 0)},c=l=>{n(l),o(!0)};return p.jsx("div",{className:D.conditionalFormattingWrap,children:r?p.jsx(Rf,{onCancel:i,rule:t}):p.jsx(Pc,{onClick:c,onCreate:a})})};var wf=Object.defineProperty,If=Object.getOwnPropertyDescriptor,xf=(e,t,n,r)=>{for(var o=r>1?void 0:r?If(t,n):t,a=e.length-1,i;a>=0;a--)(i=e[a])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&wf(t,n,o),o},ft=(e,t)=>(n,r)=>t(n,r,e);const Qr="sheet.conditional.formatting.panel";let Mt=class extends g.Disposable{constructor(t,n,r,o,a,i){super();Ae(this,"_sidebarDisposable",null);this._univerInstanceService=t,this._injector=n,this._componentManager=r,this._menuService=o,this._sidebarService=a,this._localeService=i,this._initMenu(),this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(g.UniverInstanceType.UNIVER_SHEET).subscribe(c=>{var l;c||(l=this._sidebarDisposable)==null||l.dispose()}))}openPanel(t){const n={header:{title:this._localeService.t("sheet.cf.title")},children:{label:Qr,rule:t},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(n)}_initMenu(){this._menuService.addMenuItem(Ya(this._componentManager)(this._injector))}_initPanel(){this._componentManager.register(Qr,_f)}};Mt=xf([g.OnLifecycle(g.LifecycleStages.Ready,Mt),ft(0,g.IUniverInstanceService),ft(1,z.Inject(z.Injector)),ft(2,z.Inject(be.ComponentManager)),ft(3,z.Inject(be.IMenuService)),ft(4,z.Inject(be.ISidebarService)),ft(5,z.Inject(g.LocaleService))],Mt);var Re=(e=>(e[e.createRule=1]="createRule",e[e.viewRule=2]="viewRule",e[e.highlightCell=3]="highlightCell",e[e.rank=4]="rank",e[e.formula=5]="formula",e[e.colorScale=6]="colorScale",e[e.dataBar=7]="dataBar",e[e.icon=8]="icon",e[e.clearRangeRules=9]="clearRangeRules",e[e.clearWorkSheetRules=10]="clearWorkSheetRules",e))(Re||{});const Ta={id:"sheet.operation.open.conditional.formatting.panel",type:g.CommandType.OPERATION,handler:(e,t)=>{const n=e.get(Mt),r=e.get(k.SelectionManagerService),o=e.get(g.ICommandService),a=r.getSelectionRanges()||[];switch(t.value){case 3:{n.openPanel({...s.createDefaultRule(),ranges:a});break}case 4:{const c={...s.createDefaultRule,ranges:a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank}};n.openPanel(c);break}case 5:{const c={...s.createDefaultRule,ranges:a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.formula,value:"="}};n.openPanel(c);break}case 6:{const c={...s.createDefaultRule,ranges:a,rule:{type:s.CFRuleType.colorScale,config:[]}};n.openPanel(c);break}case 7:{const c={...s.createDefaultRule,ranges:a,rule:{type:s.CFRuleType.dataBar,isShowValue:!0}};n.openPanel(c);break}case 8:{const c={...s.createDefaultRule,ranges:a,rule:{type:s.CFRuleType.iconSet,config:[],isShowValue:!0}};n.openPanel(c);break}case 2:{n.openPanel();break}case 1:{n.openPanel({...s.createDefaultRule(),ranges:a});break}case 9:{o.executeCommand(oo.id,{ranges:a});break}case 10:{o.executeCommand(Wn.id);break}}return!0}};var Of=Object.defineProperty,Ef=Object.getOwnPropertyDescriptor,Mf=(e,t,n,r)=>{for(var o=r>1?void 0:r?Ef(t,n):t,a=e.length-1,i;a>=0;a--)(i=e[a])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Of(t,n,o),o},Ke=(e,t)=>(n,r)=>t(n,r,e);let Ht=class extends g.Disposable{constructor(e,t,n,r,o,a,i){super(),this._sheetInterceptorService=e,this._conditionalFormattingService=t,this._univerInstanceService=n,this._renderManagerService=r,this._conditionalFormattingViewModel=o,this._conditionalFormattingRuleModel=a,this._sheetSkeletonManagerService=i,this._initViewModelInterceptor(),this._initSkeleton(),this._initRender()}_initRender(){const e=[[s.dataBarUKey,s.DataBar],[s.IconUKey,s.ConditionalFormattingIcon]],t=r=>{const o=r&&this._renderManagerService.getRenderById(r),a=o&&o.mainComponent;a&&e.forEach(([i,c])=>{a.getExtensionByKey(i)||a.register(new c)})};this.disposeWithMe(this._renderManagerService.currentRender$.subscribe(r=>{r&&t(r)}));const n=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET);n&&t(n.getUnitId())}_initSkeleton(){const e=()=>{var n,r;this._sheetSkeletonManagerService.reCalculate();const t=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=(n=this._renderManagerService.getRenderById(t))==null?void 0:n.mainComponent)==null||r.makeDirty()};this.disposeWithMe(this._conditionalFormattingViewModel.markDirty$.pipe(Ee.bufferTime(16),Ee.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return t.filter(o=>o.unitId===n.getUnitId()&&o.subUnitId===r.getSheetId()).length>0})).subscribe(e)),this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.pipe(Ee.bufferTime(16),Ee.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return t.filter(o=>["sort","delete"].includes(o.type)&&o.unitId===n.getUnitId()&&o.subUnitId===r.getSheetId()).length>0})).subscribe(e)),this.disposeWithMe(this._conditionalFormattingService.ruleComputeStatus$.pipe(Ee.bufferTime(16),Ee.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return t.filter(o=>o.unitId===n.getUnitId()&&o.subUnitId===r.getSheetId()).length>0})).subscribe(e))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(k.INTERCEPTOR_POINT.CELL_CONTENT,{handler:(e,t,n)=>{const r=this._conditionalFormattingService.composeStyle(t.unitId,t.subUnitId,t.row,t.col);if(!r)return n(e);const o=t.workbook.getStyles(),i={...(typeof(e==null?void 0:e.s)=="string"?o.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},c={...e,s:i};return r.style&&Object.assign(i,r.style),c.fontRenderExtension||(c.fontRenderExtension={},r.isShowValue!==void 0&&(c.fontRenderExtension.isSkip=!r.isShowValue)),r.dataBar&&(c.dataBar=r.dataBar),r.iconSet&&(c.iconSet=r.iconSet,c.fontRenderExtension.leftOffset=s.DEFAULT_PADDING+s.DEFAULT_WIDTH),n(c)}}))}};Ht=Mf([g.OnLifecycle(g.LifecycleStages.Rendered,Ht),Ke(0,z.Inject(k.SheetInterceptorService)),Ke(1,z.Inject(s.ConditionalFormattingService)),Ke(2,z.Inject(g.IUniverInstanceService)),Ke(3,z.Inject(Ia.IRenderManagerService)),Ke(4,z.Inject(s.ConditionalFormattingViewModel)),Ke(5,z.Inject(s.ConditionalFormattingRuleModel)),Ke(6,z.Inject(ce.SheetSkeletonManagerService))],Ht);var Df=Object.defineProperty,Pf=Object.getOwnPropertyDescriptor,Nf=(e,t,n,r)=>{for(var o=r>1?void 0:r?Pf(t,n):t,a=e.length-1,i;a>=0;a--)(i=e[a])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Df(t,n,o),o},Tt=(e,t)=>(n,r)=>t(n,r,e);let Wt=class extends g.Disposable{constructor(t,n,r,o,a){super();Ae(this,"_copyInfo");this._sheetClipboardService=t,this._conditionalFormattingRuleModel=n,this._injector=r,this._conditionalFormattingViewModel=o,this._univerInstanceService=a,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:s.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(t,n,r)=>this._collectConditionalRule(t,n,r),onPasteCells:(t,n,r,o)=>{const{copyType:a=ce.COPY_TYPE.COPY,pasteType:i}=o,{range:c}=t||{},{range:l}=n;return this._generateConditionalFormattingMutations(l,{copyType:a,pasteType:i,copyRange:c})}}))}_collectConditionalRule(t,n,r){const o=new g.ObjectMatrix,a={};this._copyInfo={matrix:o,info:{unitId:t,subUnitId:n,cfMap:a}};const i=this._conditionalFormattingViewModel.getMatrix(t,n);if(!i)return;const c={get:this._injector.get.bind(this._injector)},l=ce.rangeToDiscreteRange(r,c,t,n);if(!l)return;const{rows:u,cols:d}=l,h=new Set;u.forEach((f,v)=>{d.forEach((y,b)=>{const x=this._conditionalFormattingViewModel.getCellCf(t,n,f,y,i);x&&(x.cfList.forEach(_=>h.add(_.cfId)),o.setValue(v,b,x.cfList.map(_=>_.cfId)))})}),h.forEach(f=>{const v=this._conditionalFormattingRuleModel.getRule(t,n,f);v&&(a[f]=v.rule)})}_generateConditionalFormattingMutations(t,n){const r=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET),o=r.getActiveSheet(),a=r.getUnitId(),i=o.getSheetId();if(n.copyType===ce.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!n.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(n.pasteType))return{redos:[],undos:[]};const{ranges:[c,l],mapFunc:u}=ce.virtualizeDiscreteRanges([n.copyRange,t]),d=ce.getRepeatRange(c,l,!0),h=this._conditionalFormattingViewModel.getMatrix(a,i),f={};g.Range.foreach(l,(m,O)=>{const{row:M,col:I}=u(m,O),F=this._conditionalFormattingViewModel.getCellCf(a,i,M,I,h);F&&F.cfList.forEach($=>{if(!f[$.cfId]){const j=new g.ObjectMatrix;f[$.cfId]=j;const q=this._conditionalFormattingRuleModel.getRule(a,i,$.cfId);q==null||q.ranges.forEach(T=>{g.Range.foreach(T,(E,Z)=>{j.setValue(E,Z,1)})})}f[$.cfId].realDeleteValue(M,I)})});const{matrix:v,info:y}=this._copyInfo,b=[];let x=this._conditionalFormattingRuleModel.createCfId(a,i);const _={},S=m=>{if(_[m])return _[m];const O=y==null?void 0:y.cfMap[m],M=[...this._conditionalFormattingRuleModel.getSubunitRules(a,i)||[],...b].find(I=>g.Tools.diffValue(I.rule,O));if(M)return _[m]=M,M;{const I={rule:O,cfId:x,ranges:[],stopIfTrue:!1};return _[m]=I,b.push(I),x=`${Number(x)+1}`,I}};d.forEach(m=>{v&&v.forValue((O,M,I)=>{const F=g.Rectangle.getPositionRange({startRow:O,endRow:O,startColumn:M,endColumn:M},m.startRange),{row:$,col:j}=u(F.startRow,F.startColumn);I.forEach(q=>{if(!f[q]){const T=S(q),E=new g.ObjectMatrix;f[q]=E,T.ranges.forEach(Z=>{g.Range.foreach(Z,(me,L)=>{E.setValue(me,L,1)})})}f[q].setValue($,j,1)})})});const C=[],R=[];for(const m in f){const O=f[m],M=k.findAllRectangle(k.createTopMatrixFromMatrix(O));if(!M.length){const I={unitId:a,subUnitId:i,cfId:m};C.push({id:s.DeleteConditionalRuleMutation.id,params:I}),R.push(...s.DeleteConditionalRuleMutationUndoFactory(this._injector,I))}if(b.some(I=>I.cfId===m)){const I=S(m),F={unitId:a,subUnitId:i,rule:{...I,ranges:M}};C.push({id:s.AddConditionalRuleMutation.id,params:F}),R.push(s.AddConditionalRuleMutationUndoFactory(this._injector,F))}else{const I=this._conditionalFormattingRuleModel.getRule(a,i,m);if(!I)continue;const F={unitId:a,subUnitId:i,rule:{...I,ranges:M}};C.push({id:s.SetConditionalRuleMutation.id,params:F}),R.push(...s.setConditionalRuleMutationUndoFactory(this._injector,F))}}return{redos:C,undos:R}}};Wt=Nf([g.OnLifecycle(g.LifecycleStages.Rendered,Wt),Tt(0,z.Inject(ce.ISheetClipboardService)),Tt(1,z.Inject(s.ConditionalFormattingRuleModel)),Tt(2,z.Inject(z.Injector)),Tt(3,z.Inject(s.ConditionalFormattingViewModel)),Tt(4,z.Inject(g.IUniverInstanceService))],Wt);var Ff=Object.defineProperty,$f=Object.getOwnPropertyDescriptor,jf=(e,t,n,r)=>{for(var o=r>1?void 0:r?$f(t,n):t,a=e.length-1,i;a>=0;a--)(i=e[a])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Ff(t,n,o),o},Rt=(e,t)=>(n,r)=>t(n,r,e);let qt=class extends g.Disposable{constructor(e,t,n,r,o){super(),this._injector=e,this._univerInstanceService=t,this._autoFillService=n,this._conditionalFormattingRuleModel=r,this._conditionalFormattingViewModel=o,this._initAutoFill()}_initAutoFill(){const e=()=>({redos:[],undos:[]}),t=(o,a,i,c,l)=>{const u=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getUnitId(),d=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),h={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},f={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row};g.Range.foreach(i,(v,y)=>{const b=g.Rectangle.getPositionRange({startRow:v,startColumn:y,endColumn:y,endRow:v},h),x=g.Rectangle.getPositionRange({startRow:v,startColumn:y,endColumn:y,endRow:v},f),{row:_,col:S}=l(b.startRow,b.startColumn),C=this._conditionalFormattingViewModel.getCellCf(u,d,_,S),{row:R,col:m}=l(x.startRow,x.startColumn),O=this._conditionalFormattingViewModel.getCellCf(u,d,R,m);O&&O.cfList.forEach(M=>{let I=c.get(M.cfId);if(!c.get(M.cfId)){const F=this._conditionalFormattingRuleModel.getRule(u,d,M.cfId);if(!F)return;I=new g.ObjectMatrix,F.ranges.forEach($=>{g.Range.foreach($,(j,q)=>{I.setValue(j,q,1)})}),c.set(M.cfId,I)}I.realDeleteValue(R,m)}),C&&C.cfList.forEach(M=>{let I=c.get(M.cfId);if(!c.get(M.cfId)){const F=this._conditionalFormattingRuleModel.getRule(u,d,M.cfId);if(!F)return;I=new g.ObjectMatrix,F.ranges.forEach($=>{g.Range.foreach($,(j,q)=>{I.setValue(j,q,1)})}),c.set(M.cfId,I)}I.setValue(R,m,1)})})},n=(o,a)=>{var _,S;const i=(_=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET))==null?void 0:_.getUnitId(),c=(S=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET))==null?void 0:S.getActiveSheet().getSheetId(),l=new Map,u=[],d=[];if(!i||!c)return e();const h=ce.virtualizeDiscreteRanges([o,a]),[f,v]=h.ranges,{mapFunc:y}=h,b={row:f.startRow,col:f.startColumn};return ce.getAutoFillRepeatRange(f,v).forEach(C=>{t(b,C.repeatStartCell,C.relativeRange,l,y)}),l.forEach((C,R)=>{const m=this._conditionalFormattingRuleModel.getRule(i,c,R);if(!m)return;const O=k.findAllRectangle(k.createTopMatrixFromMatrix(C)),M={unitId:i,subUnitId:c,rule:{...m,ranges:O}};u.push({id:s.SetConditionalRuleMutation.id,params:M}),d.push(...s.setConditionalRuleMutationUndoFactory(this._injector,M))}),{undos:d,redos:u}},r={id:s.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(o,a,i)=>{if(i===ce.APPLY_TYPE.COPY||i===ce.APPLY_TYPE.ONLY_FORMAT||i===ce.APPLY_TYPE.SERIES){const{source:c,target:l}=o;return n(c,l)}return e()}};this.disposeWithMe(this._autoFillService.addHook(r))}};qt=jf([g.OnLifecycle(g.LifecycleStages.Rendered,qt),Rt(0,z.Inject(z.Injector)),Rt(1,z.Inject(g.IUniverInstanceService)),Rt(2,z.Inject(ce.IAutoFillService)),Rt(3,z.Inject(s.ConditionalFormattingRuleModel)),Rt(4,z.Inject(s.ConditionalFormattingViewModel))],qt);var Lf=Object.defineProperty,Vf=Object.getOwnPropertyDescriptor,Uf=(e,t,n,r)=>{for(var o=r>1?void 0:r?Vf(t,n):t,a=e.length-1,i;a>=0;a--)(i=e[a])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Lf(t,n,o),o},_t=(e,t)=>(n,r)=>t(n,r,e);let Bt=class extends g.Disposable{constructor(e,t,n,r,o){super(),this._conditionalFormattingRuleModel=e,this._univerInstanceService=t,this._injector=n,this._sheetSkeletonManagerService=r,this._refRangeService=o,this._initRefRange()}_initRefRange(){const e=new Map,t=(r,o,a)=>`${r}_${o}_${a}`,n=(r,o,a)=>{const i=l=>{const u=[...a.ranges],d=u.map(f=>k.handleDefaultRangeChangeWithEffectRefCommands(f,l)).filter(f=>!!f);if(s.isRangesEqual(d,u))return{redos:[],undos:[]};if(d.length){const f={unitId:r,subUnitId:o,rule:{...a,ranges:d}},v=[{id:s.SetConditionalRuleMutation.id,params:f}],y=s.setConditionalRuleMutationUndoFactory(this._injector,f);return{redos:v,undos:y}}else{const f={unitId:r,subUnitId:o,cfId:a.cfId},v=[{id:s.DeleteConditionalRuleMutation.id,params:f}],y=s.DeleteConditionalRuleMutationUndoFactory(this._injector,f);return{redos:v,undos:y}}},c=[];a.ranges.forEach(l=>{const u=this._refRangeService.registerRefRange(l,i);c.push(()=>u.dispose())}),e.set(t(r,o,a.cfId),()=>c.forEach(l=>l()))};this.disposeWithMe(_e.merge(this._sheetSkeletonManagerService.currentSkeleton$.pipe(Ee.map(r=>r==null?void 0:r.sheetId),Ee.distinctUntilChanged())).pipe(Ee.switchMap(()=>new _e.Observable(r=>{const o=new g.DisposableCollection;return r.next(o),()=>{o.dispose()}}))).subscribe(r=>{r.add(g.toDisposable(this._conditionalFormattingRuleModel.$ruleChange.subscribe(o=>{const{unitId:a,subUnitId:i,rule:c}=o,l=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET),u=l.getActiveSheet();if(!(o.unitId!==l.getUnitId()||o.subUnitId!==u.getSheetId()))switch(o.type){case"add":{n(o.unitId,o.subUnitId,o.rule);break}case"delete":{const d=e.get(t(a,i,c.cfId));d&&d();break}case"set":{const d=e.get(t(a,i,c.cfId));d&&d(),n(o.unitId,o.subUnitId,o.rule)}}})))})),this.disposeWithMe(g.toDisposable(()=>{e.forEach(r=>{r()}),e.clear()}))}};Bt=Uf([g.OnLifecycle(g.LifecycleStages.Rendered,Bt),_t(0,z.Inject(s.ConditionalFormattingRuleModel)),_t(1,z.Inject(g.IUniverInstanceService)),_t(2,z.Inject(z.Injector)),_t(3,z.Inject(ce.SheetSkeletonManagerService)),_t(4,z.Inject(k.RefRangeService))],Bt);var zf=Object.defineProperty,Af=Object.getOwnPropertyDescriptor,kf=(e,t,n,r)=>{for(var o=r>1?void 0:r?Af(t,n):t,a=e.length-1,i;a>=0;a--)(i=e[a])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&zf(t,n,o),o},eo=(e,t)=>(n,r)=>t(n,r,e);let Gt=class extends g.Disposable{constructor(e,t){super(),this._editorBridgeService=e,this._conditionalFormattingService=t,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(g.toDisposable(this._editorBridgeService.interceptor.intercept(this._editorBridgeService.interceptor.getInterceptPoints().AFTER_CELL_EDIT,{handler:(e,t,n)=>{const r=this._conditionalFormattingService.composeStyle(t.unitId,t.subUnitId,t.row,t.col);if(r!=null&&r.style&&(e!=null&&e.p)){const o=Object.keys(r==null?void 0:r.style);if(o.length>0){const a=s.getStringFromDataStream(e.p),i={...(typeof e.s=="string"?t.workbook.getStyles().get(e.s):e.s)||{}};o.forEach(l=>{delete i[l]});const c={...e,s:{...i},v:a};return delete c.p,n(c)}}return n(e)}})))}};Gt=kf([g.OnLifecycle(g.LifecycleStages.Rendered,Gt),eo(0,z.Inject(ce.IEditorBridgeService)),eo(1,z.Inject(s.ConditionalFormattingService))],Gt);var Hf=Object.defineProperty,Wf=Object.getOwnPropertyDescriptor,qf=(e,t,n,r)=>{for(var o=r>1?void 0:r?Wf(t,n):t,a=e.length-1,i;a>=0;a--)(i=e[a])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Hf(t,n,o),o},wt=(e,t)=>(n,r)=>t(n,r,e);let Xt=class extends g.Disposable{constructor(e,t,n,r,o){super(),this._injector=e,this._univerInstanceService=t,this._sheetInterceptorService=n,this._selectionManagerService=r,this._conditionalFormattingRuleModel=o,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{const t=[],n=[],r={redos:t,undos:n};if([k.ClearSelectionFormatCommand.id,k.ClearSelectionAllCommand.id].includes(e.id)){const o=this._selectionManagerService.getSelectionRanges();if(!o)return r;const a=this._univerInstanceService.getCurrentUnitForType(g.UniverInstanceType.UNIVER_SHEET),i=a.getActiveSheet(),c=this._conditionalFormattingRuleModel.getSubunitRules(a.getUnitId(),i.getSheetId());if(!c||!c.length)return r;c.filter(l=>o.some(u=>l.ranges.some(d=>g.Rectangle.getIntersects(d,u)))).forEach(l=>{const d=new k.RangeMergeUtil().add(...l.ranges).subtract(...o).merge();if(d.length){const h={id:s.SetConditionalRuleMutation.id,params:{unitId:a.getUnitId(),subUnitId:i.getSheetId(),rule:{...l,ranges:d}}},f=s.setConditionalRuleMutationUndoFactory(this._injector,h.params);t.push(h),n.push(...f)}else{const h={id:s.DeleteConditionalRuleMutation.id,params:{unitId:a.getUnitId(),subUnitId:i.getSheetId(),cfId:l.cfId}},f=s.DeleteConditionalRuleMutationUndoFactory(this._injector,h.params);t.push(h),n.push(...f)}})}return r}}))}};Xt=qf([g.OnLifecycle(g.LifecycleStages.Rendered,Xt),wt(0,z.Inject(z.Injector)),wt(1,z.Inject(g.IUniverInstanceService)),wt(2,z.Inject(k.SheetInterceptorService)),wt(3,z.Inject(k.SelectionManagerService)),wt(4,z.Inject(s.ConditionalFormattingRuleModel))],Xt);var Bf=Object.defineProperty,Gf=Object.getOwnPropertyDescriptor,Xf=(e,t,n,r)=>{for(var o=r>1?void 0:r?Gf(t,n):t,a=e.length-1,i;a>=0;a--)(i=e[a])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Bf(t,n,o),o},to=(e,t)=>(n,r)=>t(n,r,e),It;exports.UniverSheetsConditionalFormattingUIPlugin=(It=class extends g.Plugin{constructor(t,n,r){super(),this._injector=n,this._commandService=r,this._initCommand(),s.SheetsConditionalFormattingPlugin.dependencyList.forEach(o=>{this._injector.add(o)}),this._injector.add([Ht]),this._injector.add([Bt]),this._injector.add([Wt]),this._injector.add([qt]),this._injector.add([Mt]),this._injector.add([Et]),this._injector.add([Gt]),this._injector.add([Xt])}_initCommand(){[...s.SheetsConditionalFormattingPlugin.mutationList,...exports.UniverSheetsConditionalFormattingUIPlugin.commandList].forEach(t=>{this._commandService.registerCommand(t)})}},Ae(It,"pluginName",s.SHEET_CONDITIONAL_FORMATTING_PLUGIN),Ae(It,"type",g.UniverInstanceType.UNIVER_SHEET),Ae(It,"commandList",[xa,Oa,Ea,Ma,Da,Pa,Na,Fa,$a,Ta,Hn,oa,ta,ra,oo,Wn]),It);exports.UniverSheetsConditionalFormattingUIPlugin=Xf([to(1,z.Inject(z.Injector)),to(2,z.Inject(g.ICommandService))],exports.UniverSheetsConditionalFormattingUIPlugin);exports.enUS=rc;exports.ruRU=ic;exports.zhCN=na;