@univerjs/preset-sheets-conditional-formatting 0.5.0-nightly.202411230627 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/umd/index.js +3 -3
- package/package.json +5 -5
package/lib/umd/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
// @univerjs/sheets-conditional-formatting-ui/index
|
|
6
|
-
(function(V,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("@univerjs/core"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets"),require("@univerjs/ui"),require("react"),require("@univerjs/design"),require("@univerjs/sheets-ui"),require("@univerjs/engine-formula"),require("react-dom"),require("rxjs"),require("@univerjs/sheets-formula-ui"),require("@univerjs/engine-render"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-conditional-formatting","@univerjs/sheets","@univerjs/ui","react","@univerjs/design","@univerjs/sheets-ui","@univerjs/engine-formula","react-dom","rxjs","@univerjs/sheets-formula-ui","@univerjs/engine-render","rxjs/operators"],d):(V=typeof globalThis<"u"?globalThis:V||self,d(V.UniverSheetsConditionalFormattingUi={},V.UniverCore,V.UniverSheetsConditionalFormatting,V.UniverSheets,V.UniverUi,V.React,V.UniverDesign,V.UniverSheetsUi,V.UniverEngineFormula,V.ReactDOM,V.rxjs,V.UniverSheetsFormulaUi,V.UniverEngineRender,V.rxjs.operators))})(this,function(V,d,l,L,ge,
|
|
6
|
+
(function(V,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("@univerjs/core"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets"),require("@univerjs/ui"),require("react"),require("@univerjs/design"),require("@univerjs/sheets-ui"),require("@univerjs/engine-formula"),require("react-dom"),require("rxjs"),require("@univerjs/sheets-formula-ui"),require("@univerjs/engine-render"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-conditional-formatting","@univerjs/sheets","@univerjs/ui","react","@univerjs/design","@univerjs/sheets-ui","@univerjs/engine-formula","react-dom","rxjs","@univerjs/sheets-formula-ui","@univerjs/engine-render","rxjs/operators"],d):(V=typeof globalThis<"u"?globalThis:V||self,d(V.UniverSheetsConditionalFormattingUi={},V.UniverCore,V.UniverSheetsConditionalFormatting,V.UniverSheets,V.UniverUi,V.React,V.UniverDesign,V.UniverSheetsUi,V.UniverEngineFormula,V.ReactDOM,V.rxjs,V.UniverSheetsFormulaUi,V.UniverEngineRender,V.rxjs.operators))})(this,function(V,d,l,L,ge,w,$,ae,bn,Ir,Me,pt,ta,We){"use strict";var eu=Object.defineProperty;var tu=(V,d,l)=>d in V?eu(V,d,{enumerable:!0,configurable:!0,writable:!0,value:l}):V[d]=l;var Ge=(V,d,l)=>tu(V,typeof d!="symbol"?d+"":d,l);const Rn={type:d.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:o,operator:a}=e,i=t.get(l.ConditionalFormattingRuleModel),u=t.get(d.ICommandService),s=t.get(d.IUniverInstanceService),c=L.getSheetCommandTarget(s);if(!c)return!1;const{unitId:f,subUnitId:p}=c,h=i.createCfId(f,p),v={ranges:n,cfId:h,stopIfTrue:!!o,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.average,operator:a,style:r}};return u.executeCommand(l.AddConditionalRuleMutation.id,{unitId:f,subUnitId:p,rule:v})}},Cn={type:d.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,config:r,stopIfTrue:o}=e,a=t.get(l.ConditionalFormattingRuleModel),i=t.get(d.ICommandService),u=t.get(d.IUniverInstanceService),s=L.getSheetCommandTarget(u);if(!s)return!1;const{unitId:c,subUnitId:f}=s,p=a.createCfId(c,f),h={ranges:n,cfId:p,stopIfTrue:!!o,rule:{type:l.CFRuleType.colorScale,config:r}};return i.executeCommand(l.AddConditionalRuleMutation.id,{unitId:c,subUnitId:f,rule:h})}},Tn={type:d.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,min:r,max:o,nativeColor:a,positiveColor:i,isGradient:u,stopIfTrue:s,isShowValue:c}=e,f=t.get(l.ConditionalFormattingRuleModel),p=t.get(d.IUniverInstanceService),h=L.getSheetCommandTarget(p);if(!h)return!1;const{unitId:v,subUnitId:b}=h,y=t.get(d.ICommandService),O=f.createCfId(v,b),C={ranges:n,cfId:O,stopIfTrue:!!s,rule:{type:l.CFRuleType.dataBar,isShowValue:c,config:{min:r,max:o,nativeColor:a,positiveColor:i,isGradient:u}}};return y.executeCommand(l.AddConditionalRuleMutation.id,{unitId:v,subUnitId:b,rule:C})}},In={type:d.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:o}=e,a=t.get(l.ConditionalFormattingRuleModel),i=t.get(d.ICommandService),u=t.get(d.IUniverInstanceService),s=L.getSheetCommandTarget(u);if(!s)return!1;const{unitId:c,subUnitId:f}=s,p=a.createCfId(c,f),h={ranges:n,cfId:p,stopIfTrue:!!o,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.duplicateValues,style:r}};return i.executeCommand(l.AddConditionalRuleMutation.id,{unitId:c,subUnitId:f,rule:h})}},wn={type:d.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:o,operator:a,value:i}=e,u=t.get(l.ConditionalFormattingRuleModel),s=t.get(d.ICommandService),c=t.get(d.IUniverInstanceService),f=L.getSheetCommandTarget(c);if(!f)return!1;const{unitId:p,subUnitId:h}=f,v=u.createCfId(p,h);let b;if([l.CFNumberOperator.between,l.CFNumberOperator.notBetween].includes(a)){const y=i;if(y.length!==2||!Array.isArray(y))return!1;b={ranges:n,cfId:v,stopIfTrue:!!o,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.number,operator:a,style:r,value:y}}}else{const y=i;if(typeof y!="number")return!1;b={ranges:n,cfId:v,stopIfTrue:!!o,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.number,operator:a,style:r,value:y}}}return s.executeCommand(l.AddConditionalRuleMutation.id,{unitId:p,subUnitId:h,rule:b})}},_n={type:d.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:o,isPercent:a,isBottom:i,value:u}=e,s=t.get(l.ConditionalFormattingRuleModel),c=t.get(d.IUniverInstanceService),f=t.get(d.ICommandService),p=L.getSheetCommandTarget(c);if(!p)return!1;const{unitId:h,subUnitId:v}=p,b=s.createCfId(h,v),y={ranges:n,cfId:b,stopIfTrue:!!o,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.rank,isPercent:a,isBottom:i,style:r,value:u}};return f.executeCommand(l.AddConditionalRuleMutation.id,{unitId:h,subUnitId:v,rule:y})}},xn={type:d.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:o,operator:a,value:i}=e,u=t.get(l.ConditionalFormattingRuleModel),s=t.get(d.IUniverInstanceService),c=L.getSheetCommandTarget(s);if(!c)return!1;const{unitId:f,subUnitId:p}=c,h=t.get(d.ICommandService),v=u.createCfId(f,p),b={ranges:n,cfId:v,stopIfTrue:!!o,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.text,operator:a,style:r,value:i}};return h.executeCommand(l.AddConditionalRuleMutation.id,{unitId:f,subUnitId:p,rule:b})}},En={type:d.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:o,operator:a}=e,i=t.get(l.ConditionalFormattingRuleModel),u=t.get(d.IUniverInstanceService),s=t.get(d.ICommandService),c=L.getSheetCommandTarget(u);if(!c)return!1;const{unitId:f,subUnitId:p}=c,h=i.createCfId(f,p),v={ranges:n,cfId:h,stopIfTrue:!!o,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.timePeriod,operator:a,style:r}};return s.executeCommand(l.AddConditionalRuleMutation.id,{unitId:f,subUnitId:p,rule:v})}},On={type:d.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:o}=e,a=t.get(l.ConditionalFormattingRuleModel),i=t.get(d.IUniverInstanceService),u=t.get(d.ICommandService),s=L.getSheetCommandTarget(i);if(!s)return!1;const{unitId:c,subUnitId:f}=s,p=a.createCfId(c,f),h={ranges:n,cfId:p,stopIfTrue:!!o,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.uniqueValues,style:r}};return u.executeCommand(l.AddConditionalRuleMutation.id,{unitId:c,subUnitId:f,rule:h})}},Vt={type:d.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(t,e){var y;if(!e)return!1;const n=t.get(l.ConditionalFormattingRuleModel),r=t.get(d.IUniverInstanceService),o=t.get(d.ICommandService),a=t.get(d.IUndoRedoService),i=t.get(L.SheetsSelectionsService),u=L.getSheetCommandTarget(r,e);if(!u)return!1;const{unitId:s,subUnitId:c}=u,f=((y=i.getCurrentSelections())==null?void 0:y.map(O=>O.range))||[],p=n.getSubunitRules(s,c);if(!(p!=null&&p.length)||!f.length)return!1;const h=[],v=[];p.forEach(O=>{const C=new d.ObjectMatrix;O.ranges.forEach(R=>{d.Range.foreach(R,(x,m)=>{C.setValue(x,m,1)})}),f.forEach(R=>{d.Range.foreach(R,(x,m)=>{C.realDeleteValue(x,m)})});const _=L.findAllRectangle(L.createTopMatrixFromMatrix(C));if(_.length){const R={...O,ranges:_},x={unitId:s,subUnitId:c,rule:R},m=l.setConditionalRuleMutationUndoFactory(t,x);h.push({id:l.SetConditionalRuleMutation.id,params:x}),v.push(...m)}else{const R={unitId:s,subUnitId:c,cfId:O.cfId},x=l.DeleteConditionalRuleMutationUndoFactory(t,R);h.push({id:l.DeleteConditionalRuleMutation.id,params:R}),v.push(...x)}});const b=d.sequenceExecute(h,o).result;return b&&a.pushUndoRedo({unitID:s,redoMutations:h,undoMutations:v}),b}},ht={type:d.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(t,e){const n=t.get(l.ConditionalFormattingRuleModel),r=t.get(d.IUniverInstanceService),o=t.get(d.ICommandService),a=t.get(d.IUndoRedoService),i=L.getSheetCommandTarget(r,e);if(!i)return!1;const{unitId:u,subUnitId:s}=i,c=n.getSubunitRules(u,s);if(!(c!=null&&c.length))return!1;const f=c.map(b=>({cfId:b.cfId,unitId:u,subUnitId:s})),p=f.map(b=>({id:l.DeleteConditionalRuleMutation.id,params:b})),h=f.map(b=>l.DeleteConditionalRuleMutationUndoFactory(t,b)[0]),v=d.sequenceExecute(p,o).result;return v&&a.pushUndoRedo({unitID:u,redoMutations:p,undoMutations:h}),v}};var na=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ra(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function wr(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return t[r]}})}),n}var _r={exports:{}},Ut={};/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.min.js
|
|
9
9
|
*
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
*
|
|
12
12
|
* This source code is licensed under the MIT license found in the
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
|
-
*/var oa=_,aa=Symbol.for("react.element"),ia=Symbol.for("react.fragment"),sa=Object.prototype.hasOwnProperty,la=oa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ua={key:!0,ref:!0,__self:!0,__source:!0};function xr(t,e,n){var r,o={},a=null,i=null;n!==void 0&&(a=""+n),e.key!==void 0&&(a=""+e.key),e.ref!==void 0&&(i=e.ref);for(r in e)sa.call(e,r)&&!ua.hasOwnProperty(r)&&(o[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)o[r]===void 0&&(o[r]=e[r]);return{$$typeof:aa,type:t,key:a,ref:i,props:o,_owner:la.current}}Ut.Fragment=ia,Ut.jsx=xr,Ut.jsxs=xr,_r.exports=Ut;var g=_r.exports;const P={conditionalFormattingWrap:"univer-conditional-formatting-wrap",cfRuleItem:"univer-cf-rule-item",preview:"univer-preview",createRule:"univer-create-rule",button:"univer-button",title:"univer-title",label:"univer-label",labelContainer:"univer-label-container",inputWidth:"univer-input-width",mTBase:"univer-m-t-base",mTSm:"univer-m-t-sm",mTXl:"univer-m-t-xl",mLSm:"univer-m-l-sm",mLXl:"univer-m-l-xl",mLXxs:"univer-m-l-xxs",mL0:"univer-m-l-0",mR0:"univer-m-r-0"};var _e=function(){return _e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},_e.apply(this,arguments)},ca=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n},tt=_.forwardRef(function(t,e){var n=t.icon,r=t.id,o=t.className,a=t.extend,i=ca(t,["icon","id","className","extend"]),u="univerjs-icon univerjs-icon-".concat(r," ").concat(o||"").trim(),s=_.useRef("_".concat(pa()));return Er(n,"".concat(r),{defIds:n.defIds,idSuffix:s.current},_e({ref:e,className:u},i),a)});function Er(t,e,n,r,o){return _.createElement(t.tag,_e(_e({key:e},da(t,n,o)),r),(fa(t,n).children||[]).map(function(a,i){return Er(a,"".concat(e,"-").concat(t.tag,"-").concat(i),n,void 0,o)}))}function da(t,e,n){var r=_e({},t.attrs);n!=null&&n.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=n.colorChannel1);var o=e.defIds;return!o||o.length===0||(t.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+e.idSuffix),Object.entries(r).forEach(function(a){var i=a[0],u=a[1];typeof u=="string"&&(r[i]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),r}function fa(t,e){var n,r=e.defIds;return!r||r.length===0?t:t.tag==="defs"&&(!((n=t.children)===null||n===void 0)&&n.length)?_e(_e({},t),{children:t.children.map(function(o){return typeof o.attrs.id=="string"&&r&&r.indexOf(o.attrs.id)>-1?_e(_e({},o),{attrs:_e(_e({},o.attrs),{id:o.attrs.id+e.idSuffix})}):o})}):t}function pa(){return Math.random().toString(36).substring(2,8)}tt.displayName="UniverIcon";var ha={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},zt=_.forwardRef(function(t,e){return _.createElement(tt,Object.assign({},t,{id:"delete-single",ref:e,icon:ha}))});zt.displayName="DeleteSingle";var ma={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Or=_.forwardRef(function(t,e){return _.createElement(tt,Object.assign({},t,{id:"increase-single",ref:e,icon:ma}))});Or.displayName="IncreaseSingle";var ga={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},At=_.forwardRef(function(t,e){return _.createElement(tt,Object.assign({},t,{id:"more-down-single",ref:e,icon:ga}))});At.displayName="MoreDownSingle";var va={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"}}]}]},Mr=_.forwardRef(function(t,e){return _.createElement(tt,Object.assign({},t,{id:"sequence-single",ref:e,icon:va}))});Mr.displayName="SequenceSingle";var ya={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"}}]}]},mt=_.forwardRef(function(t,e){return _.createElement(tt,Object.assign({},t,{id:"slash-single",ref:e,icon:ya}))});mt.displayName="SlashSingle";var Pr={exports:{}},gt={},Mn={exports:{}};(function(t,e){(function(n,r){r(e)})(na,function(n){function r(D){return function(Z,J,Q,le,he,xe,ue){return D(Z,J,ue)}}function o(D){return function(Z,J,Q,le){if(!Z||!J||typeof Z!="object"||typeof J!="object")return D(Z,J,Q,le);var he=le.get(Z),xe=le.get(J);if(he&&xe)return he===J&&xe===Z;le.set(Z,J),le.set(J,Z);var ue=D(Z,J,Q,le);return le.delete(Z),le.delete(J),ue}}function a(D,k){var Z={};for(var J in D)Z[J]=D[J];for(var J in k)Z[J]=k[J];return Z}function i(D){return D.constructor===Object||D.constructor==null}function u(D){return typeof D.then=="function"}function s(D,k){return D===k||D!==D&&k!==k}var c="[object Arguments]",f="[object Boolean]",p="[object Date]",h="[object RegExp]",v="[object Map]",b="[object Number]",y="[object Object]",O="[object Set]",C="[object String]",I=Object.prototype.toString;function R(D){var k=D.areArraysEqual,Z=D.areDatesEqual,J=D.areMapsEqual,Q=D.areObjectsEqual,le=D.areRegExpsEqual,he=D.areSetsEqual,xe=D.createIsNestedEqual,ue=xe(Le);function Le(oe,ce,Ve){if(oe===ce)return!0;if(!oe||!ce||typeof oe!="object"||typeof ce!="object")return oe!==oe&&ce!==ce;if(i(oe)&&i(ce))return Q(oe,ce,ue,Ve);var Qo=Array.isArray(oe),ea=Array.isArray(ce);if(Qo||ea)return Qo===ea&&k(oe,ce,ue,Ve);var Ue=I.call(oe);return Ue!==I.call(ce)?!1:Ue===p?Z(oe,ce,ue,Ve):Ue===h?le(oe,ce,ue,Ve):Ue===v?J(oe,ce,ue,Ve):Ue===O?he(oe,ce,ue,Ve):Ue===y||Ue===c?u(oe)||u(ce)?!1:Q(oe,ce,ue,Ve):Ue===f||Ue===b||Ue===C?s(oe.valueOf(),ce.valueOf()):!1}return Le}function x(D,k,Z,J){var Q=D.length;if(k.length!==Q)return!1;for(;Q-- >0;)if(!Z(D[Q],k[Q],Q,Q,D,k,J))return!1;return!0}var m=o(x);function w(D,k){return s(D.valueOf(),k.valueOf())}function T(D,k,Z,J){var Q=D.size===k.size;if(!Q)return!1;if(!D.size)return!0;var le={},he=0;return D.forEach(function(xe,ue){if(Q){var Le=!1,oe=0;k.forEach(function(ce,Ve){!Le&&!le[oe]&&(Le=Z(ue,Ve,he,oe,D,k,J)&&Z(xe,ce,ue,Ve,D,k,J))&&(le[oe]=!0),oe++}),he++,Q=Le}}),Q}var E=o(T),N="_owner",U=Object.prototype.hasOwnProperty;function F(D,k,Z,J){var Q=Object.keys(D),le=Q.length;if(Object.keys(k).length!==le)return!1;for(var he;le-- >0;){if(he=Q[le],he===N){var xe=!!D.$$typeof,ue=!!k.$$typeof;if((xe||ue)&&xe!==ue)return!1}if(!U.call(k,he)||!Z(D[he],k[he],he,he,D,k,J))return!1}return!0}var X=o(F);function S(D,k){return D.source===k.source&&D.flags===k.flags}function M(D,k,Z,J){var Q=D.size===k.size;if(!Q)return!1;if(!D.size)return!0;var le={};return D.forEach(function(he,xe){if(Q){var ue=!1,Le=0;k.forEach(function(oe,ce){!ue&&!le[Le]&&(ue=Z(he,oe,xe,ce,D,k,J))&&(le[Le]=!0),Le++}),Q=ue}}),Q}var W=o(M),te=Object.freeze({areArraysEqual:x,areDatesEqual:w,areMapsEqual:T,areObjectsEqual:F,areRegExpsEqual:S,areSetsEqual:M,createIsNestedEqual:r}),q=Object.freeze({areArraysEqual:m,areDatesEqual:w,areMapsEqual:E,areObjectsEqual:X,areRegExpsEqual:S,areSetsEqual:W,createIsNestedEqual:r}),de=R(te);function se(D,k){return de(D,k,void 0)}var z=R(a(te,{createIsNestedEqual:function(){return s}}));function Y(D,k){return z(D,k,void 0)}var ne=R(q);function re(D,k){return ne(D,k,new WeakMap)}var pe=R(a(q,{createIsNestedEqual:function(){return s}}));function Ce(D,k){return pe(D,k,new WeakMap)}function Oe(D){return R(a(te,D(te)))}function ke(D){var k=R(a(q,D(q)));return function(Z,J,Q){return Q===void 0&&(Q=new WeakMap),k(Z,J,Q)}}n.circularDeepEqual=re,n.circularShallowEqual=Ce,n.createCustomCircularEqual=ke,n.createCustomEqual=Oe,n.deepEqual=se,n.sameValueZeroEqual=s,n.shallowEqual=Y,Object.defineProperty(n,"__esModule",{value:!0})})})(Mn,Mn.exports);var Pn=Mn.exports,Dn={exports:{}};function Dr(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=Dr(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function Nr(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=Dr(t))&&(r&&(r+=" "),r+=e);return r}Dn.exports=Nr,Dn.exports.clsx=Nr;var Nn=Dn.exports,G={},Sa=function(e,n,r){return e===n?!0:e.className===n.className&&r(e.style,n.style)&&e.width===n.width&&e.autoSize===n.autoSize&&e.cols===n.cols&&e.draggableCancel===n.draggableCancel&&e.draggableHandle===n.draggableHandle&&r(e.verticalCompact,n.verticalCompact)&&r(e.compactType,n.compactType)&&r(e.layout,n.layout)&&r(e.margin,n.margin)&&r(e.containerPadding,n.containerPadding)&&e.rowHeight===n.rowHeight&&e.maxRows===n.maxRows&&e.isBounded===n.isBounded&&e.isDraggable===n.isDraggable&&e.isResizable===n.isResizable&&e.allowOverlap===n.allowOverlap&&e.preventCollision===n.preventCollision&&e.useCSSTransforms===n.useCSSTransforms&&e.transformScale===n.transformScale&&e.isDroppable===n.isDroppable&&r(e.resizeHandles,n.resizeHandles)&&r(e.resizeHandle,n.resizeHandle)&&e.onLayoutChange===n.onLayoutChange&&e.onDragStart===n.onDragStart&&e.onDrag===n.onDrag&&e.onDragStop===n.onDragStop&&e.onResizeStart===n.onResizeStart&&e.onResize===n.onResize&&e.onResizeStop===n.onResizeStop&&e.onDrop===n.onDrop&&r(e.droppingItem,n.droppingItem)&&r(e.innerRef,n.innerRef)};Object.defineProperty(G,"__esModule",{value:!0}),G.bottom=jn,G.childrenEqual=Ca,G.cloneLayout=Lr,G.cloneLayoutItem=$e,G.collides=kt,G.compact=Ur,G.compactItem=zr,G.compactType=Da,G.correctBounds=Ar,G.fastPositionEqual=Ta,G.fastRGLPropsEqual=void 0,G.getAllCollisions=kr,G.getFirstCollision=Xe,G.getLayoutItem=Vn,G.getStatics=Un,G.modifyLayout=Vr,G.moveElement=yt,G.moveElementAwayFromCollision=zn,G.noop=void 0,G.perc=Ia,G.resizeItemInDirection=xa,G.setTopLeft=Oa,G.setTransform=Ea,G.sortLayoutItems=Bn,G.sortLayoutItemsByColRow=Gr,G.sortLayoutItemsByRowCol=Br,G.synchronizeLayoutWithChildren=Ma,G.validateLayout=Pa,G.withLayoutItem=Ra;var jr=Pn,vt=ba(_);function ba(t){return t&&t.__esModule?t:{default:t}}function jn(t){let e=0,n;for(let r=0,o=t.length;r<o;r++)n=t[r].y+t[r].h,n>e&&(e=n);return e}function Lr(t){const e=Array(t.length);for(let n=0,r=t.length;n<r;n++)e[n]=$e(t[n]);return e}function Vr(t,e){const n=Array(t.length);for(let r=0,o=t.length;r<o;r++)e.i===t[r].i?n[r]=e:n[r]=t[r];return n}function Ra(t,e,n){let r=Vn(t,e);return r?(r=n($e(r)),t=Vr(t,r),[t,r]):[t,null]}function $e(t){return{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,minW:t.minW,maxW:t.maxW,minH:t.minH,maxH:t.maxH,moved:!!t.moved,static:!!t.static,isDraggable:t.isDraggable,isResizable:t.isResizable,resizeHandles:t.resizeHandles,isBounded:t.isBounded}}function Ca(t,e){return(0,jr.deepEqual)(vt.default.Children.map(t,n=>n==null?void 0:n.key),vt.default.Children.map(e,n=>n==null?void 0:n.key))&&(0,jr.deepEqual)(vt.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]),vt.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]))}G.fastRGLPropsEqual=Sa;function Ta(t,e){return t.left===e.left&&t.top===e.top&&t.width===e.width&&t.height===e.height}function kt(t,e){return!(t.i===e.i||t.x+t.w<=e.x||t.x>=e.x+e.w||t.y+t.h<=e.y||t.y>=e.y+e.h)}function Ur(t,e,n,r){const o=Un(t),a=Bn(t,e),i=Array(t.length);for(let u=0,s=a.length;u<s;u++){let c=$e(a[u]);c.static||(c=zr(o,c,e,n,a,r),o.push(c)),i[t.indexOf(a[u])]=c,c.moved=!1}return i}const wa={x:"w",y:"h"};function Ln(t,e,n,r){const o=wa[r];e[r]+=1;const a=t.map(i=>i.i).indexOf(e.i);for(let i=a+1;i<t.length;i++){const u=t[i];if(!u.static){if(u.y>e.y+e.h)break;kt(e,u)&&Ln(t,u,n+e[o],r)}}e[r]=n}function zr(t,e,n,r,o,a){const i=n==="vertical",u=n==="horizontal";if(i)for(e.y=Math.min(jn(t),e.y);e.y>0&&!Xe(t,e);)e.y--;else if(u)for(;e.x>0&&!Xe(t,e);)e.x--;let s;for(;(s=Xe(t,e))&&!(n===null&&a);)if(u?Ln(o,e,s.x+s.w,"x"):Ln(o,e,s.y+s.h,"y"),u&&e.x+e.w>r)for(e.x=r-e.w,e.y++;e.x>0&&!Xe(t,e);)e.x--;return e.y=Math.max(e.y,0),e.x=Math.max(e.x,0),e}function Ar(t,e){const n=Un(t);for(let r=0,o=t.length;r<o;r++){const a=t[r];if(a.x+a.w>e.cols&&(a.x=e.cols-a.w),a.x<0&&(a.x=0,a.w=e.cols),!a.static)n.push(a);else for(;Xe(n,a);)a.y++}return t}function Vn(t,e){for(let n=0,r=t.length;n<r;n++)if(t[n].i===e)return t[n]}function Xe(t,e){for(let n=0,r=t.length;n<r;n++)if(kt(t[n],e))return t[n]}function kr(t,e){return t.filter(n=>kt(n,e))}function Un(t){return t.filter(e=>e.static)}function yt(t,e,n,r,o,a,i,u,s){if(e.static&&e.isDraggable!==!0||e.y===r&&e.x===n)return t;`${e.i}${String(n)}${String(r)}${e.x}${e.y}`;const c=e.x,f=e.y;typeof n=="number"&&(e.x=n),typeof r=="number"&&(e.y=r),e.moved=!0;let p=Bn(t,i);(i==="vertical"&&typeof r=="number"?f>=r:i==="horizontal"&&typeof n=="number"?c>=n:!1)&&(p=p.reverse());const v=kr(p,e),b=v.length>0;if(b&&s)return Lr(t);if(b&&a)return`${e.i}`,e.x=c,e.y=f,e.moved=!1,t;for(let y=0,O=v.length;y<O;y++){const C=v[y];`${e.i}${e.x}${e.y}${C.i}${C.x}${C.y}`,!C.moved&&(C.static?t=zn(t,C,e,o,i):t=zn(t,e,C,o,i))}return t}function zn(t,e,n,r,o,a){const i=o==="horizontal",u=o==="vertical",s=e.static;if(r){r=!1;const p={x:i?Math.max(e.x-n.w,0):n.x,y:u?Math.max(e.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},h=Xe(t,p),v=h&&h.y+h.h>e.y,b=h&&e.x+e.w>h.x;if(h){if(v&&u)return yt(t,n,void 0,e.y+1,r,s,o);if(v&&o==null)return e.y=n.y,n.y=n.y+n.h,t;if(b&&i)return yt(t,e,n.x,void 0,r,s,o)}else return`${n.i}${p.x}${p.y}`,yt(t,n,i?p.x:void 0,u?p.y:void 0,r,s,o)}const c=i?n.x+1:void 0,f=u?n.y+1:void 0;return c==null&&f==null?t:yt(t,n,i?n.x+1:void 0,u?n.y+1:void 0,r,s,o)}function Ia(t){return t*100+"%"}const Wr=(t,e,n,r)=>t+n>r?e:n,Hr=(t,e,n)=>t<0?e:n,Fr=t=>Math.max(0,t),An=t=>Math.max(0,t),kn=(t,e,n)=>{let{left:r,height:o,width:a}=e;const i=t.top-(o-t.height);return{left:r,width:a,height:Hr(i,t.height,o),top:An(i)}},Wn=(t,e,n)=>{let{top:r,left:o,height:a,width:i}=e;return{top:r,height:a,width:Wr(t.left,t.width,i,n),left:Fr(o)}},Hn=(t,e,n)=>{let{top:r,height:o,width:a}=e;const i=t.left-(a-t.width);return{height:o,width:i<0?t.width:Wr(t.left,t.width,a,n),top:An(r),left:Fr(i)}},Fn=(t,e,n)=>{let{top:r,left:o,height:a,width:i}=e;return{width:i,left:o,height:Hr(r,t.height,a),top:An(r)}},_a={n:kn,ne:function(){return kn(arguments.length<=0?void 0:arguments[0],Wn(...arguments))},e:Wn,se:function(){return Fn(arguments.length<=0?void 0:arguments[0],Wn(...arguments))},s:Fn,sw:function(){return Fn(arguments.length<=0?void 0:arguments[0],Hn(...arguments))},w:Hn,nw:function(){return kn(arguments.length<=0?void 0:arguments[0],Hn(...arguments))}};function xa(t,e,n,r){const o=_a[t];return o?o(e,{...e,...n},r):n}function Ea(t){let{top:e,left:n,width:r,height:o}=t;const a=`translate(${n}px,${e}px)`;return{transform:a,WebkitTransform:a,MozTransform:a,msTransform:a,OTransform:a,width:`${r}px`,height:`${o}px`,position:"absolute"}}function Oa(t){let{top:e,left:n,width:r,height:o}=t;return{top:`${e}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function Bn(t,e){return e==="horizontal"?Gr(t):e==="vertical"?Br(t):t}function Br(t){return t.slice(0).sort(function(e,n){return e.y>n.y||e.y===n.y&&e.x>n.x?1:e.y===n.y&&e.x===n.x?0:-1})}function Gr(t){return t.slice(0).sort(function(e,n){return e.x>n.x||e.x===n.x&&e.y>n.y?1:-1})}function Ma(t,e,n,r,o){t=t||[];const a=[];vt.default.Children.forEach(e,u=>{if((u==null?void 0:u.key)==null)return;const s=Vn(t,String(u.key)),c=u.props["data-grid"];s&&c==null?a.push($e(s)):c?a.push($e({...c,i:u.key})):a.push($e({w:1,h:1,x:0,y:jn(a),i:String(u.key)}))});const i=Ar(a,{cols:n});return o?i:Ur(i,r,n)}function Pa(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(t))throw new Error(e+" must be an array!");for(let r=0,o=t.length;r<o;r++){const a=t[r];for(let i=0;i<n.length;i++){const u=n[i],s=a[u];if(typeof s!="number"||Number.isNaN(s))throw new Error(`ReactGridLayout: ${e}[${r}].${u} must be a number! Received: ${s} (${typeof s})`)}if(typeof a.i<"u"&&typeof a.i!="string")throw new Error(`ReactGridLayout: ${e}[${r}].i must be a string! Received: ${a.i} (${typeof a.i})`)}}function Da(t){const{verticalCompact:e,compactType:n}=t||{};return e===!1?null:n}function Tu(){}const Na=()=>{};G.noop=Na;var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.calcGridColWidth=Wt,Pe.calcGridItemPosition=ja,Pe.calcGridItemWHPx=Gn,Pe.calcWH=Va,Pe.calcXY=La,Pe.clamp=Ye;function Wt(t){const{margin:e,containerPadding:n,containerWidth:r,cols:o}=t;return(r-e[0]*(o-1)-n[0]*2)/o}function Gn(t,e,n){return Number.isFinite(t)?Math.round(e*t+Math.max(0,t-1)*n):t}function ja(t,e,n,r,o,a){const{margin:i,containerPadding:u,rowHeight:s}=t,c=Wt(t),f={};return a&&a.resizing?(f.width=Math.round(a.resizing.width),f.height=Math.round(a.resizing.height)):(f.width=Gn(r,c,i[0]),f.height=Gn(o,s,i[1])),a&&a.dragging?(f.top=Math.round(a.dragging.top),f.left=Math.round(a.dragging.left)):a&&a.resizing&&typeof a.resizing.top=="number"&&typeof a.resizing.left=="number"?(f.top=Math.round(a.resizing.top),f.left=Math.round(a.resizing.left)):(f.top=Math.round((s+i[1])*n+u[1]),f.left=Math.round((c+i[0])*e+u[0])),f}function La(t,e,n,r,o){const{margin:a,containerPadding:i,cols:u,rowHeight:s,maxRows:c}=t,f=Wt(t);let p=Math.round((n-i[0])/(f+a[0])),h=Math.round((e-i[1])/(s+a[1]));return p=Ye(p,0,u-r),h=Ye(h,0,c-o),{x:p,y:h}}function Va(t,e,n,r,o,a){const{margin:i,maxRows:u,cols:s,rowHeight:c}=t,f=Wt(t);let p=Math.round((e+i[0])/(f+i[0])),h=Math.round((n+i[1])/(c+i[1])),v=Ye(p,0,s-r),b=Ye(h,0,u-o);return["sw","w","nw"].indexOf(a)!==-1&&(v=Ye(p,0,s)),["nw","n","ne"].indexOf(a)!==-1&&(b=Ye(h,0,u)),{w:v,h:b}}function Ye(t,e,n){return Math.max(Math.min(t,n),e)}var Ht={},$r={exports:{}},Ua="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",za=Ua,Aa=za;function Xr(){}function Yr(){}Yr.resetWarningCache=Xr;var ka=function(){function t(r,o,a,i,u,s){if(s!==Aa){var c=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 c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Yr,resetWarningCache:Xr};return n.PropTypes=n,n};$r.exports=ka();var He=$r.exports,Ft={exports:{}},qr={};function Kr(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=Kr(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function Zr(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=Kr(t))&&(r&&(r+=" "),r+=e);return r}const Wa=Ir(Object.freeze(Object.defineProperty({__proto__:null,clsx:Zr,default:Zr},Symbol.toStringTag,{value:"Module"})));var ie={},De={};Object.defineProperty(De,"__esModule",{value:!0}),De.dontSetMe=$a,De.findInArray=Ha,De.int=Ga,De.isFunction=Fa,De.isNum=Ba;function Ha(t,e){for(let n=0,r=t.length;n<r;n++)if(e.apply(e,[t[n],n,t]))return t[n]}function Fa(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Function]"}function Ba(t){return typeof t=="number"&&!isNaN(t)}function Ga(t){return parseInt(t,10)}function $a(t,e,n){if(t[e])return new Error("Invalid prop ".concat(e," passed to ").concat(n," - do not set this, set it on the child."))}var qe={};Object.defineProperty(qe,"__esModule",{value:!0}),qe.browserPrefixToKey=Qr,qe.browserPrefixToStyle=Xa,qe.default=void 0,qe.getPrefix=Jr;const $n=["Moz","Webkit","O","ms"];function Jr(){var t;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(t=window.document)===null||t===void 0||(t=t.documentElement)===null||t===void 0?void 0:t.style;if(!n||e in n)return"";for(let r=0;r<$n.length;r++)if(Qr(e,$n[r])in n)return $n[r];return""}function Qr(t,e){return e?"".concat(e).concat(Ya(t)):t}function Xa(t,e){return e?"-".concat(e.toLowerCase(),"-").concat(t):t}function Ya(t){let e="",n=!0;for(let r=0;r<t.length;r++)n?(e+=t[r].toUpperCase(),n=!1):t[r]==="-"?n=!0:e+=t[r];return e}qe.default=Jr(),Object.defineProperty(ie,"__esModule",{value:!0}),ie.addClassName=ro,ie.addEvent=Za,ie.addUserSelectStyles=li,ie.createCSSTransform=oi,ie.createSVGTransform=ai,ie.getTouch=ii,ie.getTouchIdentifier=si,ie.getTranslation=Xn,ie.innerHeight=ti,ie.innerWidth=ni,ie.matchesSelector=no,ie.matchesSelectorAndParentsTo=Ka,ie.offsetXYFromParent=ri,ie.outerHeight=Qa,ie.outerWidth=ei,ie.removeClassName=oo,ie.removeEvent=Ja,ie.removeUserSelectStyles=ui;var Te=De,eo=qa(qe);function to(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(to=function(r){return r?n:e})(t)}function qa(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=to(e);if(n&&n.has(t))return n.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}let Bt="";function no(t,e){return Bt||(Bt=(0,Te.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Te.isFunction)(t[n])})),(0,Te.isFunction)(t[Bt])?t[Bt](e):!1}function Ka(t,e,n){let r=t;do{if(no(r,e))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function Za(t,e,n,r){if(!t)return;const o={capture:!0,...r};t.addEventListener?t.addEventListener(e,n,o):t.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n}function Ja(t,e,n,r){if(!t)return;const o={capture:!0,...r};t.removeEventListener?t.removeEventListener(e,n,o):t.detachEvent?t.detachEvent("on"+e,n):t["on"+e]=null}function Qa(t){let e=t.clientHeight;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=(0,Te.int)(n.borderTopWidth),e+=(0,Te.int)(n.borderBottomWidth),e}function ei(t){let e=t.clientWidth;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=(0,Te.int)(n.borderLeftWidth),e+=(0,Te.int)(n.borderRightWidth),e}function ti(t){let e=t.clientHeight;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=(0,Te.int)(n.paddingTop),e-=(0,Te.int)(n.paddingBottom),e}function ni(t){let e=t.clientWidth;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=(0,Te.int)(n.paddingLeft),e-=(0,Te.int)(n.paddingRight),e}function ri(t,e,n){const o=e===e.ownerDocument.body?{left:0,top:0}:e.getBoundingClientRect(),a=(t.clientX+e.scrollLeft-o.left)/n,i=(t.clientY+e.scrollTop-o.top)/n;return{x:a,y:i}}function oi(t,e){const n=Xn(t,e,"px");return{[(0,eo.browserPrefixToKey)("transform",eo.default)]:n}}function ai(t,e){return Xn(t,e,"")}function Xn(t,e,n){let{x:r,y:o}=t,a="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(e){const i="".concat(typeof e.x=="string"?e.x:e.x+n),u="".concat(typeof e.y=="string"?e.y:e.y+n);a="translate(".concat(i,", ").concat(u,")")+a}return a}function ii(t,e){return t.targetTouches&&(0,Te.findInArray)(t.targetTouches,n=>e===n.identifier)||t.changedTouches&&(0,Te.findInArray)(t.changedTouches,n=>e===n.identifier)}function si(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function li(t){if(!t)return;let e=t.getElementById("react-draggable-style-el");e||(e=t.createElement("style"),e.type="text/css",e.id="react-draggable-style-el",e.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
14
|
+
*/var oa=w,aa=Symbol.for("react.element"),ia=Symbol.for("react.fragment"),sa=Object.prototype.hasOwnProperty,la=oa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ua={key:!0,ref:!0,__self:!0,__source:!0};function xr(t,e,n){var r,o={},a=null,i=null;n!==void 0&&(a=""+n),e.key!==void 0&&(a=""+e.key),e.ref!==void 0&&(i=e.ref);for(r in e)sa.call(e,r)&&!ua.hasOwnProperty(r)&&(o[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)o[r]===void 0&&(o[r]=e[r]);return{$$typeof:aa,type:t,key:a,ref:i,props:o,_owner:la.current}}Ut.Fragment=ia,Ut.jsx=xr,Ut.jsxs=xr,_r.exports=Ut;var g=_r.exports;const P={conditionalFormattingWrap:"univer-conditional-formatting-wrap",cfRuleItem:"univer-cf-rule-item",preview:"univer-preview",createRule:"univer-create-rule",button:"univer-button",title:"univer-title",label:"univer-label",labelContainer:"univer-label-container",inputWidth:"univer-input-width",mTBase:"univer-m-t-base",mTSm:"univer-m-t-sm",mTXl:"univer-m-t-xl",mLSm:"univer-m-l-sm",mLXl:"univer-m-l-xl",mLXxs:"univer-m-l-xxs",mL0:"univer-m-l-0",mR0:"univer-m-r-0"};var _e=function(){return _e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},_e.apply(this,arguments)},ca=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n},tt=w.forwardRef(function(t,e){var n=t.icon,r=t.id,o=t.className,a=t.extend,i=ca(t,["icon","id","className","extend"]),u="univerjs-icon univerjs-icon-".concat(r," ").concat(o||"").trim(),s=w.useRef("_".concat(pa()));return Er(n,"".concat(r),{defIds:n.defIds,idSuffix:s.current},_e({ref:e,className:u},i),a)});function Er(t,e,n,r,o){return w.createElement(t.tag,_e(_e({key:e},da(t,n,o)),r),(fa(t,n).children||[]).map(function(a,i){return Er(a,"".concat(e,"-").concat(t.tag,"-").concat(i),n,void 0,o)}))}function da(t,e,n){var r=_e({},t.attrs);n!=null&&n.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=n.colorChannel1);var o=e.defIds;return!o||o.length===0||(t.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+e.idSuffix),Object.entries(r).forEach(function(a){var i=a[0],u=a[1];typeof u=="string"&&(r[i]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),r}function fa(t,e){var n,r=e.defIds;return!r||r.length===0?t:t.tag==="defs"&&(!((n=t.children)===null||n===void 0)&&n.length)?_e(_e({},t),{children:t.children.map(function(o){return typeof o.attrs.id=="string"&&r&&r.indexOf(o.attrs.id)>-1?_e(_e({},o),{attrs:_e(_e({},o.attrs),{id:o.attrs.id+e.idSuffix})}):o})}):t}function pa(){return Math.random().toString(36).substring(2,8)}tt.displayName="UniverIcon";var ha={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},zt=w.forwardRef(function(t,e){return w.createElement(tt,Object.assign({},t,{id:"delete-single",ref:e,icon:ha}))});zt.displayName="DeleteSingle";var ma={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Or=w.forwardRef(function(t,e){return w.createElement(tt,Object.assign({},t,{id:"increase-single",ref:e,icon:ma}))});Or.displayName="IncreaseSingle";var ga={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},At=w.forwardRef(function(t,e){return w.createElement(tt,Object.assign({},t,{id:"more-down-single",ref:e,icon:ga}))});At.displayName="MoreDownSingle";var va={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"}}]}]},Mr=w.forwardRef(function(t,e){return w.createElement(tt,Object.assign({},t,{id:"sequence-single",ref:e,icon:va}))});Mr.displayName="SequenceSingle";var ya={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"}}]}]},mt=w.forwardRef(function(t,e){return w.createElement(tt,Object.assign({},t,{id:"slash-single",ref:e,icon:ya}))});mt.displayName="SlashSingle";var Pr={exports:{}},gt={},Mn={exports:{}};(function(t,e){(function(n,r){r(e)})(na,function(n){function r(N){return function(Z,J,Q,le,he,xe,ue){return N(Z,J,ue)}}function o(N){return function(Z,J,Q,le){if(!Z||!J||typeof Z!="object"||typeof J!="object")return N(Z,J,Q,le);var he=le.get(Z),xe=le.get(J);if(he&&xe)return he===J&&xe===Z;le.set(Z,J),le.set(J,Z);var ue=N(Z,J,Q,le);return le.delete(Z),le.delete(J),ue}}function a(N,k){var Z={};for(var J in N)Z[J]=N[J];for(var J in k)Z[J]=k[J];return Z}function i(N){return N.constructor===Object||N.constructor==null}function u(N){return typeof N.then=="function"}function s(N,k){return N===k||N!==N&&k!==k}var c="[object Arguments]",f="[object Boolean]",p="[object Date]",h="[object RegExp]",v="[object Map]",b="[object Number]",y="[object Object]",O="[object Set]",C="[object String]",_=Object.prototype.toString;function R(N){var k=N.areArraysEqual,Z=N.areDatesEqual,J=N.areMapsEqual,Q=N.areObjectsEqual,le=N.areRegExpsEqual,he=N.areSetsEqual,xe=N.createIsNestedEqual,ue=xe(Le);function Le(oe,ce,Ve){if(oe===ce)return!0;if(!oe||!ce||typeof oe!="object"||typeof ce!="object")return oe!==oe&&ce!==ce;if(i(oe)&&i(ce))return Q(oe,ce,ue,Ve);var Qo=Array.isArray(oe),ea=Array.isArray(ce);if(Qo||ea)return Qo===ea&&k(oe,ce,ue,Ve);var Ue=_.call(oe);return Ue!==_.call(ce)?!1:Ue===p?Z(oe,ce,ue,Ve):Ue===h?le(oe,ce,ue,Ve):Ue===v?J(oe,ce,ue,Ve):Ue===O?he(oe,ce,ue,Ve):Ue===y||Ue===c?u(oe)||u(ce)?!1:Q(oe,ce,ue,Ve):Ue===f||Ue===b||Ue===C?s(oe.valueOf(),ce.valueOf()):!1}return Le}function x(N,k,Z,J){var Q=N.length;if(k.length!==Q)return!1;for(;Q-- >0;)if(!Z(N[Q],k[Q],Q,Q,N,k,J))return!1;return!0}var m=o(x);function T(N,k){return s(N.valueOf(),k.valueOf())}function I(N,k,Z,J){var Q=N.size===k.size;if(!Q)return!1;if(!N.size)return!0;var le={},he=0;return N.forEach(function(xe,ue){if(Q){var Le=!1,oe=0;k.forEach(function(ce,Ve){!Le&&!le[oe]&&(Le=Z(ue,Ve,he,oe,N,k,J)&&Z(xe,ce,ue,Ve,N,k,J))&&(le[oe]=!0),oe++}),he++,Q=Le}}),Q}var E=o(I),D="_owner",U=Object.prototype.hasOwnProperty;function F(N,k,Z,J){var Q=Object.keys(N),le=Q.length;if(Object.keys(k).length!==le)return!1;for(var he;le-- >0;){if(he=Q[le],he===D){var xe=!!N.$$typeof,ue=!!k.$$typeof;if((xe||ue)&&xe!==ue)return!1}if(!U.call(k,he)||!Z(N[he],k[he],he,he,N,k,J))return!1}return!0}var X=o(F);function S(N,k){return N.source===k.source&&N.flags===k.flags}function M(N,k,Z,J){var Q=N.size===k.size;if(!Q)return!1;if(!N.size)return!0;var le={};return N.forEach(function(he,xe){if(Q){var ue=!1,Le=0;k.forEach(function(oe,ce){!ue&&!le[Le]&&(ue=Z(he,oe,xe,ce,N,k,J))&&(le[Le]=!0),Le++}),Q=ue}}),Q}var W=o(M),te=Object.freeze({areArraysEqual:x,areDatesEqual:T,areMapsEqual:I,areObjectsEqual:F,areRegExpsEqual:S,areSetsEqual:M,createIsNestedEqual:r}),q=Object.freeze({areArraysEqual:m,areDatesEqual:T,areMapsEqual:E,areObjectsEqual:X,areRegExpsEqual:S,areSetsEqual:W,createIsNestedEqual:r}),de=R(te);function se(N,k){return de(N,k,void 0)}var z=R(a(te,{createIsNestedEqual:function(){return s}}));function Y(N,k){return z(N,k,void 0)}var ne=R(q);function re(N,k){return ne(N,k,new WeakMap)}var pe=R(a(q,{createIsNestedEqual:function(){return s}}));function Ce(N,k){return pe(N,k,new WeakMap)}function Oe(N){return R(a(te,N(te)))}function ke(N){var k=R(a(q,N(q)));return function(Z,J,Q){return Q===void 0&&(Q=new WeakMap),k(Z,J,Q)}}n.circularDeepEqual=re,n.circularShallowEqual=Ce,n.createCustomCircularEqual=ke,n.createCustomEqual=Oe,n.deepEqual=se,n.sameValueZeroEqual=s,n.shallowEqual=Y,Object.defineProperty(n,"__esModule",{value:!0})})})(Mn,Mn.exports);var Pn=Mn.exports,Dn={exports:{}};function Dr(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=Dr(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function Nr(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=Dr(t))&&(r&&(r+=" "),r+=e);return r}Dn.exports=Nr,Dn.exports.clsx=Nr;var Nn=Dn.exports,G={},Sa=function(e,n,r){return e===n?!0:e.className===n.className&&r(e.style,n.style)&&e.width===n.width&&e.autoSize===n.autoSize&&e.cols===n.cols&&e.draggableCancel===n.draggableCancel&&e.draggableHandle===n.draggableHandle&&r(e.verticalCompact,n.verticalCompact)&&r(e.compactType,n.compactType)&&r(e.layout,n.layout)&&r(e.margin,n.margin)&&r(e.containerPadding,n.containerPadding)&&e.rowHeight===n.rowHeight&&e.maxRows===n.maxRows&&e.isBounded===n.isBounded&&e.isDraggable===n.isDraggable&&e.isResizable===n.isResizable&&e.allowOverlap===n.allowOverlap&&e.preventCollision===n.preventCollision&&e.useCSSTransforms===n.useCSSTransforms&&e.transformScale===n.transformScale&&e.isDroppable===n.isDroppable&&r(e.resizeHandles,n.resizeHandles)&&r(e.resizeHandle,n.resizeHandle)&&e.onLayoutChange===n.onLayoutChange&&e.onDragStart===n.onDragStart&&e.onDrag===n.onDrag&&e.onDragStop===n.onDragStop&&e.onResizeStart===n.onResizeStart&&e.onResize===n.onResize&&e.onResizeStop===n.onResizeStop&&e.onDrop===n.onDrop&&r(e.droppingItem,n.droppingItem)&&r(e.innerRef,n.innerRef)};Object.defineProperty(G,"__esModule",{value:!0}),G.bottom=jn,G.childrenEqual=Ca,G.cloneLayout=Lr,G.cloneLayoutItem=$e,G.collides=kt,G.compact=Ur,G.compactItem=zr,G.compactType=Da,G.correctBounds=Ar,G.fastPositionEqual=Ta,G.fastRGLPropsEqual=void 0,G.getAllCollisions=kr,G.getFirstCollision=Xe,G.getLayoutItem=Vn,G.getStatics=Un,G.modifyLayout=Vr,G.moveElement=yt,G.moveElementAwayFromCollision=zn,G.noop=void 0,G.perc=wa,G.resizeItemInDirection=xa,G.setTopLeft=Oa,G.setTransform=Ea,G.sortLayoutItems=Bn,G.sortLayoutItemsByColRow=Gr,G.sortLayoutItemsByRowCol=Br,G.synchronizeLayoutWithChildren=Ma,G.validateLayout=Pa,G.withLayoutItem=Ra;var jr=Pn,vt=ba(w);function ba(t){return t&&t.__esModule?t:{default:t}}function jn(t){let e=0,n;for(let r=0,o=t.length;r<o;r++)n=t[r].y+t[r].h,n>e&&(e=n);return e}function Lr(t){const e=Array(t.length);for(let n=0,r=t.length;n<r;n++)e[n]=$e(t[n]);return e}function Vr(t,e){const n=Array(t.length);for(let r=0,o=t.length;r<o;r++)e.i===t[r].i?n[r]=e:n[r]=t[r];return n}function Ra(t,e,n){let r=Vn(t,e);return r?(r=n($e(r)),t=Vr(t,r),[t,r]):[t,null]}function $e(t){return{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,minW:t.minW,maxW:t.maxW,minH:t.minH,maxH:t.maxH,moved:!!t.moved,static:!!t.static,isDraggable:t.isDraggable,isResizable:t.isResizable,resizeHandles:t.resizeHandles,isBounded:t.isBounded}}function Ca(t,e){return(0,jr.deepEqual)(vt.default.Children.map(t,n=>n==null?void 0:n.key),vt.default.Children.map(e,n=>n==null?void 0:n.key))&&(0,jr.deepEqual)(vt.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]),vt.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]))}G.fastRGLPropsEqual=Sa;function Ta(t,e){return t.left===e.left&&t.top===e.top&&t.width===e.width&&t.height===e.height}function kt(t,e){return!(t.i===e.i||t.x+t.w<=e.x||t.x>=e.x+e.w||t.y+t.h<=e.y||t.y>=e.y+e.h)}function Ur(t,e,n,r){const o=Un(t),a=Bn(t,e),i=Array(t.length);for(let u=0,s=a.length;u<s;u++){let c=$e(a[u]);c.static||(c=zr(o,c,e,n,a,r),o.push(c)),i[t.indexOf(a[u])]=c,c.moved=!1}return i}const Ia={x:"w",y:"h"};function Ln(t,e,n,r){const o=Ia[r];e[r]+=1;const a=t.map(i=>i.i).indexOf(e.i);for(let i=a+1;i<t.length;i++){const u=t[i];if(!u.static){if(u.y>e.y+e.h)break;kt(e,u)&&Ln(t,u,n+e[o],r)}}e[r]=n}function zr(t,e,n,r,o,a){const i=n==="vertical",u=n==="horizontal";if(i)for(e.y=Math.min(jn(t),e.y);e.y>0&&!Xe(t,e);)e.y--;else if(u)for(;e.x>0&&!Xe(t,e);)e.x--;let s;for(;(s=Xe(t,e))&&!(n===null&&a);)if(u?Ln(o,e,s.x+s.w,"x"):Ln(o,e,s.y+s.h,"y"),u&&e.x+e.w>r)for(e.x=r-e.w,e.y++;e.x>0&&!Xe(t,e);)e.x--;return e.y=Math.max(e.y,0),e.x=Math.max(e.x,0),e}function Ar(t,e){const n=Un(t);for(let r=0,o=t.length;r<o;r++){const a=t[r];if(a.x+a.w>e.cols&&(a.x=e.cols-a.w),a.x<0&&(a.x=0,a.w=e.cols),!a.static)n.push(a);else for(;Xe(n,a);)a.y++}return t}function Vn(t,e){for(let n=0,r=t.length;n<r;n++)if(t[n].i===e)return t[n]}function Xe(t,e){for(let n=0,r=t.length;n<r;n++)if(kt(t[n],e))return t[n]}function kr(t,e){return t.filter(n=>kt(n,e))}function Un(t){return t.filter(e=>e.static)}function yt(t,e,n,r,o,a,i,u,s){if(e.static&&e.isDraggable!==!0||e.y===r&&e.x===n)return t;`${e.i}${String(n)}${String(r)}${e.x}${e.y}`;const c=e.x,f=e.y;typeof n=="number"&&(e.x=n),typeof r=="number"&&(e.y=r),e.moved=!0;let p=Bn(t,i);(i==="vertical"&&typeof r=="number"?f>=r:i==="horizontal"&&typeof n=="number"?c>=n:!1)&&(p=p.reverse());const v=kr(p,e),b=v.length>0;if(b&&s)return Lr(t);if(b&&a)return`${e.i}`,e.x=c,e.y=f,e.moved=!1,t;for(let y=0,O=v.length;y<O;y++){const C=v[y];`${e.i}${e.x}${e.y}${C.i}${C.x}${C.y}`,!C.moved&&(C.static?t=zn(t,C,e,o,i):t=zn(t,e,C,o,i))}return t}function zn(t,e,n,r,o,a){const i=o==="horizontal",u=o==="vertical",s=e.static;if(r){r=!1;const p={x:i?Math.max(e.x-n.w,0):n.x,y:u?Math.max(e.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},h=Xe(t,p),v=h&&h.y+h.h>e.y,b=h&&e.x+e.w>h.x;if(h){if(v&&u)return yt(t,n,void 0,e.y+1,r,s,o);if(v&&o==null)return e.y=n.y,n.y=n.y+n.h,t;if(b&&i)return yt(t,e,n.x,void 0,r,s,o)}else return`${n.i}${p.x}${p.y}`,yt(t,n,i?p.x:void 0,u?p.y:void 0,r,s,o)}const c=i?n.x+1:void 0,f=u?n.y+1:void 0;return c==null&&f==null?t:yt(t,n,i?n.x+1:void 0,u?n.y+1:void 0,r,s,o)}function wa(t){return t*100+"%"}const Wr=(t,e,n,r)=>t+n>r?e:n,Hr=(t,e,n)=>t<0?e:n,Fr=t=>Math.max(0,t),An=t=>Math.max(0,t),kn=(t,e,n)=>{let{left:r,height:o,width:a}=e;const i=t.top-(o-t.height);return{left:r,width:a,height:Hr(i,t.height,o),top:An(i)}},Wn=(t,e,n)=>{let{top:r,left:o,height:a,width:i}=e;return{top:r,height:a,width:Wr(t.left,t.width,i,n),left:Fr(o)}},Hn=(t,e,n)=>{let{top:r,height:o,width:a}=e;const i=t.left-(a-t.width);return{height:o,width:i<0?t.width:Wr(t.left,t.width,a,n),top:An(r),left:Fr(i)}},Fn=(t,e,n)=>{let{top:r,left:o,height:a,width:i}=e;return{width:i,left:o,height:Hr(r,t.height,a),top:An(r)}},_a={n:kn,ne:function(){return kn(arguments.length<=0?void 0:arguments[0],Wn(...arguments))},e:Wn,se:function(){return Fn(arguments.length<=0?void 0:arguments[0],Wn(...arguments))},s:Fn,sw:function(){return Fn(arguments.length<=0?void 0:arguments[0],Hn(...arguments))},w:Hn,nw:function(){return kn(arguments.length<=0?void 0:arguments[0],Hn(...arguments))}};function xa(t,e,n,r){const o=_a[t];return o?o(e,{...e,...n},r):n}function Ea(t){let{top:e,left:n,width:r,height:o}=t;const a=`translate(${n}px,${e}px)`;return{transform:a,WebkitTransform:a,MozTransform:a,msTransform:a,OTransform:a,width:`${r}px`,height:`${o}px`,position:"absolute"}}function Oa(t){let{top:e,left:n,width:r,height:o}=t;return{top:`${e}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function Bn(t,e){return e==="horizontal"?Gr(t):e==="vertical"?Br(t):t}function Br(t){return t.slice(0).sort(function(e,n){return e.y>n.y||e.y===n.y&&e.x>n.x?1:e.y===n.y&&e.x===n.x?0:-1})}function Gr(t){return t.slice(0).sort(function(e,n){return e.x>n.x||e.x===n.x&&e.y>n.y?1:-1})}function Ma(t,e,n,r,o){t=t||[];const a=[];vt.default.Children.forEach(e,u=>{if((u==null?void 0:u.key)==null)return;const s=Vn(t,String(u.key)),c=u.props["data-grid"];s&&c==null?a.push($e(s)):c?a.push($e({...c,i:u.key})):a.push($e({w:1,h:1,x:0,y:jn(a),i:String(u.key)}))});const i=Ar(a,{cols:n});return o?i:Ur(i,r,n)}function Pa(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(t))throw new Error(e+" must be an array!");for(let r=0,o=t.length;r<o;r++){const a=t[r];for(let i=0;i<n.length;i++)if(typeof a[n[i]]!="number")throw new Error("ReactGridLayout: "+e+"["+r+"]."+n[i]+" must be a number!")}}function Da(t){const{verticalCompact:e,compactType:n}=t||{};return e===!1?null:n}function Tu(){}const Na=()=>{};G.noop=Na;var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.calcGridColWidth=Wt,Pe.calcGridItemPosition=ja,Pe.calcGridItemWHPx=Gn,Pe.calcWH=Va,Pe.calcXY=La,Pe.clamp=Ye;function Wt(t){const{margin:e,containerPadding:n,containerWidth:r,cols:o}=t;return(r-e[0]*(o-1)-n[0]*2)/o}function Gn(t,e,n){return Number.isFinite(t)?Math.round(e*t+Math.max(0,t-1)*n):t}function ja(t,e,n,r,o,a){const{margin:i,containerPadding:u,rowHeight:s}=t,c=Wt(t),f={};return a&&a.resizing?(f.width=Math.round(a.resizing.width),f.height=Math.round(a.resizing.height)):(f.width=Gn(r,c,i[0]),f.height=Gn(o,s,i[1])),a&&a.dragging?(f.top=Math.round(a.dragging.top),f.left=Math.round(a.dragging.left)):a&&a.resizing&&typeof a.resizing.top=="number"&&typeof a.resizing.left=="number"?(f.top=Math.round(a.resizing.top),f.left=Math.round(a.resizing.left)):(f.top=Math.round((s+i[1])*n+u[1]),f.left=Math.round((c+i[0])*e+u[0])),f}function La(t,e,n,r,o){const{margin:a,cols:i,rowHeight:u,maxRows:s}=t,c=Wt(t);let f=Math.round((n-a[0])/(c+a[0])),p=Math.round((e-a[1])/(u+a[1]));return f=Ye(f,0,i-r),p=Ye(p,0,s-o),{x:f,y:p}}function Va(t,e,n,r,o,a){const{margin:i,maxRows:u,cols:s,rowHeight:c}=t,f=Wt(t);let p=Math.round((e+i[0])/(f+i[0])),h=Math.round((n+i[1])/(c+i[1])),v=Ye(p,0,s-r),b=Ye(h,0,u-o);return["sw","w","nw"].indexOf(a)!==-1&&(v=Ye(p,0,s)),["nw","n","ne"].indexOf(a)!==-1&&(b=Ye(h,0,u)),{w:v,h:b}}function Ye(t,e,n){return Math.max(Math.min(t,n),e)}var Ht={},$r={exports:{}},Ua="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",za=Ua,Aa=za;function Xr(){}function Yr(){}Yr.resetWarningCache=Xr;var ka=function(){function t(r,o,a,i,u,s){if(s!==Aa){var c=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 c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Yr,resetWarningCache:Xr};return n.PropTypes=n,n};$r.exports=ka();var He=$r.exports,Ft={exports:{}},qr={};function Kr(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=Kr(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function Zr(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=Kr(t))&&(r&&(r+=" "),r+=e);return r}const Wa=wr(Object.freeze(Object.defineProperty({__proto__:null,clsx:Zr,default:Zr},Symbol.toStringTag,{value:"Module"})));var ie={},De={};Object.defineProperty(De,"__esModule",{value:!0}),De.dontSetMe=$a,De.findInArray=Ha,De.int=Ga,De.isFunction=Fa,De.isNum=Ba;function Ha(t,e){for(let n=0,r=t.length;n<r;n++)if(e.apply(e,[t[n],n,t]))return t[n]}function Fa(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Function]"}function Ba(t){return typeof t=="number"&&!isNaN(t)}function Ga(t){return parseInt(t,10)}function $a(t,e,n){if(t[e])return new Error("Invalid prop ".concat(e," passed to ").concat(n," - do not set this, set it on the child."))}var qe={};Object.defineProperty(qe,"__esModule",{value:!0}),qe.browserPrefixToKey=Qr,qe.browserPrefixToStyle=Xa,qe.default=void 0,qe.getPrefix=Jr;const $n=["Moz","Webkit","O","ms"];function Jr(){var t;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(t=window.document)===null||t===void 0||(t=t.documentElement)===null||t===void 0?void 0:t.style;if(!n||e in n)return"";for(let r=0;r<$n.length;r++)if(Qr(e,$n[r])in n)return $n[r];return""}function Qr(t,e){return e?"".concat(e).concat(Ya(t)):t}function Xa(t,e){return e?"-".concat(e.toLowerCase(),"-").concat(t):t}function Ya(t){let e="",n=!0;for(let r=0;r<t.length;r++)n?(e+=t[r].toUpperCase(),n=!1):t[r]==="-"?n=!0:e+=t[r];return e}qe.default=Jr(),Object.defineProperty(ie,"__esModule",{value:!0}),ie.addClassName=ro,ie.addEvent=Za,ie.addUserSelectStyles=li,ie.createCSSTransform=oi,ie.createSVGTransform=ai,ie.getTouch=ii,ie.getTouchIdentifier=si,ie.getTranslation=Xn,ie.innerHeight=ti,ie.innerWidth=ni,ie.matchesSelector=no,ie.matchesSelectorAndParentsTo=Ka,ie.offsetXYFromParent=ri,ie.outerHeight=Qa,ie.outerWidth=ei,ie.removeClassName=oo,ie.removeEvent=Ja,ie.removeUserSelectStyles=ui;var Te=De,eo=qa(qe);function to(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(to=function(r){return r?n:e})(t)}function qa(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=to(e);if(n&&n.has(t))return n.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}let Bt="";function no(t,e){return Bt||(Bt=(0,Te.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Te.isFunction)(t[n])})),(0,Te.isFunction)(t[Bt])?t[Bt](e):!1}function Ka(t,e,n){let r=t;do{if(no(r,e))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function Za(t,e,n,r){if(!t)return;const o={capture:!0,...r};t.addEventListener?t.addEventListener(e,n,o):t.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n}function Ja(t,e,n,r){if(!t)return;const o={capture:!0,...r};t.removeEventListener?t.removeEventListener(e,n,o):t.detachEvent?t.detachEvent("on"+e,n):t["on"+e]=null}function Qa(t){let e=t.clientHeight;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=(0,Te.int)(n.borderTopWidth),e+=(0,Te.int)(n.borderBottomWidth),e}function ei(t){let e=t.clientWidth;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=(0,Te.int)(n.borderLeftWidth),e+=(0,Te.int)(n.borderRightWidth),e}function ti(t){let e=t.clientHeight;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=(0,Te.int)(n.paddingTop),e-=(0,Te.int)(n.paddingBottom),e}function ni(t){let e=t.clientWidth;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=(0,Te.int)(n.paddingLeft),e-=(0,Te.int)(n.paddingRight),e}function ri(t,e,n){const o=e===e.ownerDocument.body?{left:0,top:0}:e.getBoundingClientRect(),a=(t.clientX+e.scrollLeft-o.left)/n,i=(t.clientY+e.scrollTop-o.top)/n;return{x:a,y:i}}function oi(t,e){const n=Xn(t,e,"px");return{[(0,eo.browserPrefixToKey)("transform",eo.default)]:n}}function ai(t,e){return Xn(t,e,"")}function Xn(t,e,n){let{x:r,y:o}=t,a="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(e){const i="".concat(typeof e.x=="string"?e.x:e.x+n),u="".concat(typeof e.y=="string"?e.y:e.y+n);a="translate(".concat(i,", ").concat(u,")")+a}return a}function ii(t,e){return t.targetTouches&&(0,Te.findInArray)(t.targetTouches,n=>e===n.identifier)||t.changedTouches&&(0,Te.findInArray)(t.changedTouches,n=>e===n.identifier)}function si(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function li(t){if(!t)return;let e=t.getElementById("react-draggable-style-el");e||(e=t.createElement("style"),e.type="text/css",e.id="react-draggable-style-el",e.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
15
15
|
`,e.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
16
|
-
`,t.getElementsByTagName("head")[0].appendChild(e)),t.body&&ro(t.body,"react-draggable-transparent-selection")}function ui(t){if(t)try{if(t.body&&oo(t.body,"react-draggable-transparent-selection"),t.selection)t.selection.empty();else{const e=(t.defaultView||window).getSelection();e&&e.type!=="Caret"&&e.removeAllRanges()}}catch{}}function ro(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)")))||(t.className+=" ".concat(e))}function oo(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)"),"g"),"")}var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.canDragX=fi,Ne.canDragY=pi,Ne.createCoreData=mi,Ne.createDraggableData=gi,Ne.getBoundPosition=ci,Ne.getControlPosition=hi,Ne.snapToGrid=di;var we=De,nt=ie;function ci(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:r}=t.props;r=typeof r=="string"?r:vi(r);const o=Yn(t);if(typeof r=="string"){const{ownerDocument:a}=o,i=a.defaultView;let u;if(r==="parent"?u=o.parentNode:u=a.querySelector(r),!(u instanceof i.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const s=u,c=i.getComputedStyle(o),f=i.getComputedStyle(s);r={left:-o.offsetLeft+(0,we.int)(f.paddingLeft)+(0,we.int)(c.marginLeft),top:-o.offsetTop+(0,we.int)(f.paddingTop)+(0,we.int)(c.marginTop),right:(0,nt.innerWidth)(s)-(0,nt.outerWidth)(o)-o.offsetLeft+(0,we.int)(f.paddingRight)-(0,we.int)(c.marginRight),bottom:(0,nt.innerHeight)(s)-(0,nt.outerHeight)(o)-o.offsetTop+(0,we.int)(f.paddingBottom)-(0,we.int)(c.marginBottom)}}return(0,we.isNum)(r.right)&&(e=Math.min(e,r.right)),(0,we.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,we.isNum)(r.left)&&(e=Math.max(e,r.left)),(0,we.isNum)(r.top)&&(n=Math.max(n,r.top)),[e,n]}function di(t,e,n){const r=Math.round(e/t[0])*t[0],o=Math.round(n/t[1])*t[1];return[r,o]}function fi(t){return t.props.axis==="both"||t.props.axis==="x"}function pi(t){return t.props.axis==="both"||t.props.axis==="y"}function hi(t,e,n){const r=typeof e=="number"?(0,nt.getTouch)(t,e):null;if(typeof e=="number"&&!r)return null;const o=Yn(n),a=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,nt.offsetXYFromParent)(r||t,a,n.props.scale)}function mi(t,e,n){const r=!(0,we.isNum)(t.lastX),o=Yn(t);return r?{node:o,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:o,deltaX:e-t.lastX,deltaY:n-t.lastY,lastX:t.lastX,lastY:t.lastY,x:e,y:n}}function gi(t,e){const n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function vi(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function Yn(t){const e=t.findDOMNode();if(!e)throw new Error("<DraggableCore>: Unmounted during event!");return e}var Gt={},$t={};Object.defineProperty($t,"__esModule",{value:!0}),$t.default=yi;function yi(){}Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.default=void 0;var qn=bi(_),be=Zn(He),Si=Zn(wr),ve=ie,Fe=Ne,Kn=De,St=Zn($t);function Zn(t){return t&&t.__esModule?t:{default:t}}function ao(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(ao=function(r){return r?n:e})(t)}function bi(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=ao(e);if(n&&n.has(t))return n.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}function Se(t,e,n){return e=Ri(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ri(t){var e=Ci(t,"string");return typeof e=="symbol"?e:String(e)}function Ci(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Ee={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Be=Ee.mouse,Xt=class extends qn.Component{constructor(){super(...arguments),Se(this,"dragging",!1),Se(this,"lastX",NaN),Se(this,"lastY",NaN),Se(this,"touchIdentifier",null),Se(this,"mounted",!1),Se(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&typeof e.button=="number"&&e.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||!(e.target instanceof r.defaultView.Node)||this.props.handle&&!(0,ve.matchesSelectorAndParentsTo)(e.target,this.props.handle,n)||this.props.cancel&&(0,ve.matchesSelectorAndParentsTo)(e.target,this.props.cancel,n))return;e.type==="touchstart"&&e.preventDefault();const o=(0,ve.getTouchIdentifier)(e);this.touchIdentifier=o;const a=(0,Fe.getControlPosition)(e,o,this);if(a==null)return;const{x:i,y:u}=a,s=(0,Fe.createCoreData)(this,i,u);(0,St.default)("DraggableCore: handleDragStart: %j",s),(0,St.default)("calling",this.props.onStart),!(this.props.onStart(e,s)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,ve.addUserSelectStyles)(r),this.dragging=!0,this.lastX=i,this.lastY=u,(0,ve.addEvent)(r,Be.move,this.handleDrag),(0,ve.addEvent)(r,Be.stop,this.handleDragStop))}),Se(this,"handleDrag",e=>{const n=(0,Fe.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let u=r-this.lastX,s=o-this.lastY;if([u,s]=(0,Fe.snapToGrid)(this.props.grid,u,s),!u&&!s)return;r=this.lastX+u,o=this.lastY+s}const a=(0,Fe.createCoreData)(this,r,o);if((0,St.default)("DraggableCore: handleDrag: %j",a),this.props.onDrag(e,a)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const s=document.createEvent("MouseEvents");s.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(s)}return}this.lastX=r,this.lastY=o}),Se(this,"handleDragStop",e=>{if(!this.dragging)return;const n=(0,Fe.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let s=r-this.lastX||0,c=o-this.lastY||0;[s,c]=(0,Fe.snapToGrid)(this.props.grid,s,c),r=this.lastX+s,o=this.lastY+c}const a=(0,Fe.createCoreData)(this,r,o);if(this.props.onStop(e,a)===!1||this.mounted===!1)return!1;const u=this.findDOMNode();u&&this.props.enableUserSelectHack&&(0,ve.removeUserSelectStyles)(u.ownerDocument),(0,St.default)("DraggableCore: handleDragStop: %j",a),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,u&&((0,St.default)("DraggableCore: Removing handlers"),(0,ve.removeEvent)(u.ownerDocument,Be.move,this.handleDrag),(0,ve.removeEvent)(u.ownerDocument,Be.stop,this.handleDragStop))}),Se(this,"onMouseDown",e=>(Be=Ee.mouse,this.handleDragStart(e))),Se(this,"onMouseUp",e=>(Be=Ee.mouse,this.handleDragStop(e))),Se(this,"onTouchStart",e=>(Be=Ee.touch,this.handleDragStart(e))),Se(this,"onTouchEnd",e=>(Be=Ee.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,ve.addEvent)(e,Ee.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:n}=e;(0,ve.removeEvent)(n,Ee.mouse.move,this.handleDrag),(0,ve.removeEvent)(n,Ee.touch.move,this.handleDrag),(0,ve.removeEvent)(n,Ee.mouse.stop,this.handleDragStop),(0,ve.removeEvent)(n,Ee.touch.stop,this.handleDragStop),(0,ve.removeEvent)(e,Ee.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,ve.removeUserSelectStyles)(n)}}findDOMNode(){var e,n;return(e=this.props)!==null&&e!==void 0&&e.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:Si.default.findDOMNode(this)}render(){return qn.cloneElement(qn.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Gt.default=Xt,Se(Xt,"displayName","DraggableCore"),Se(Xt,"propTypes",{allowAnyClick:be.default.bool,children:be.default.node.isRequired,disabled:be.default.bool,enableUserSelectHack:be.default.bool,offsetParent:function(t,e){if(t[e]&&t[e].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:be.default.arrayOf(be.default.number),handle:be.default.string,cancel:be.default.string,nodeRef:be.default.object,onStart:be.default.func,onDrag:be.default.func,onStop:be.default.func,onMouseDown:be.default.func,scale:be.default.number,className:Kn.dontSetMe,style:Kn.dontSetMe,transform:Kn.dontSetMe}),Se(Xt,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return s.default}}),t.default=void 0;var e=h(_),n=f(He),r=f(wr),o=f(Wa),a=ie,i=Ne,u=De,s=f(Gt),c=f($t);function f(I){return I&&I.__esModule?I:{default:I}}function p(I){if(typeof WeakMap!="function")return null;var R=new WeakMap,x=new WeakMap;return(p=function(m){return m?x:R})(I)}function h(I,R){if(I&&I.__esModule)return I;if(I===null||typeof I!="object"&&typeof I!="function")return{default:I};var x=p(R);if(x&&x.has(I))return x.get(I);var m={},w=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in I)if(T!=="default"&&Object.prototype.hasOwnProperty.call(I,T)){var E=w?Object.getOwnPropertyDescriptor(I,T):null;E&&(E.get||E.set)?Object.defineProperty(m,T,E):m[T]=I[T]}return m.default=I,x&&x.set(I,m),m}function v(){return v=Object.assign?Object.assign.bind():function(I){for(var R=1;R<arguments.length;R++){var x=arguments[R];for(var m in x)Object.prototype.hasOwnProperty.call(x,m)&&(I[m]=x[m])}return I},v.apply(this,arguments)}function b(I,R,x){return R=y(R),R in I?Object.defineProperty(I,R,{value:x,enumerable:!0,configurable:!0,writable:!0}):I[R]=x,I}function y(I){var R=O(I,"string");return typeof R=="symbol"?R:String(R)}function O(I,R){if(typeof I!="object"||I===null)return I;var x=I[Symbol.toPrimitive];if(x!==void 0){var m=x.call(I,R||"default");if(typeof m!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(I)}class C extends e.Component{static getDerivedStateFromProps(R,x){let{position:m}=R,{prevPropsPosition:w}=x;return m&&(!w||m.x!==w.x||m.y!==w.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:m,prevPropsPosition:w}),{x:m.x,y:m.y,prevPropsPosition:{...m}}):null}constructor(R){super(R),b(this,"onDragStart",(x,m)=>{if((0,c.default)("Draggable: onDragStart: %j",m),this.props.onStart(x,(0,i.createDraggableData)(this,m))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),b(this,"onDrag",(x,m)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",m);const w=(0,i.createDraggableData)(this,m),T={x:w.x,y:w.y,slackX:0,slackY:0};if(this.props.bounds){const{x:N,y:U}=T;T.x+=this.state.slackX,T.y+=this.state.slackY;const[F,X]=(0,i.getBoundPosition)(this,T.x,T.y);T.x=F,T.y=X,T.slackX=this.state.slackX+(N-T.x),T.slackY=this.state.slackY+(U-T.y),w.x=T.x,w.y=T.y,w.deltaX=T.x-this.state.x,w.deltaY=T.y-this.state.y}if(this.props.onDrag(x,w)===!1)return!1;this.setState(T)}),b(this,"onDragStop",(x,m)=>{if(!this.state.dragging||this.props.onStop(x,(0,i.createDraggableData)(this,m))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",m);const T={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:N,y:U}=this.props.position;T.x=N,T.y=U}this.setState(T)}),this.state={dragging:!1,dragged:!1,x:R.position?R.position.x:R.defaultPosition.x,y:R.position?R.position.y:R.defaultPosition.y,prevPropsPosition:{...R.position},slackX:0,slackY:0,isElementSVG:!1},R.position&&!(R.onDrag||R.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 R,x;return(R=(x=this.props)===null||x===void 0||(x=x.nodeRef)===null||x===void 0?void 0:x.current)!==null&&R!==void 0?R:r.default.findDOMNode(this)}render(){const{axis:R,bounds:x,children:m,defaultPosition:w,defaultClassName:T,defaultClassNameDragging:E,defaultClassNameDragged:N,position:U,positionOffset:F,scale:X,...S}=this.props;let M={},W=null;const q=!!!U||this.state.dragging,de=U||w,se={x:(0,i.canDragX)(this)&&q?this.state.x:de.x,y:(0,i.canDragY)(this)&&q?this.state.y:de.y};this.state.isElementSVG?W=(0,a.createSVGTransform)(se,F):M=(0,a.createCSSTransform)(se,F);const z=(0,o.default)(m.props.className||"",T,{[E]:this.state.dragging,[N]:this.state.dragged});return e.createElement(s.default,v({},S,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(m),{className:z,style:{...m.props.style,...M},transform:W}))}}t.default=C,b(C,"displayName","Draggable"),b(C,"propTypes",{...s.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:u.dontSetMe,style:u.dontSetMe,transform:u.dontSetMe}),b(C,"defaultProps",{...s.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(qr);const{default:io,DraggableCore:Ti}=qr;Ft.exports=io,Ft.exports.default=io,Ft.exports.DraggableCore=Ti;var so=Ft.exports,Yt={exports:{}},bt={},Jn={};Jn.__esModule=!0,Jn.cloneElement=Oi;var wi=Ii(_);function Ii(t){return t&&t.__esModule?t:{default:t}}function lo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function uo(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?lo(Object(n),!0).forEach(function(r){_i(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lo(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function _i(t,e,n){return e=xi(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xi(t){var e=Ei(t,"string");return typeof e=="symbol"?e:String(e)}function Ei(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Oi(t,e){return e.style&&t.props.style&&(e.style=uo(uo({},t.props.style),e.style)),e.className&&t.props.className&&(e.className=t.props.className+" "+e.className),wi.default.cloneElement(t,e)}var Rt={};Rt.__esModule=!0,Rt.resizableProps=void 0;var H=Mi(He);function Mi(t){return t&&t.__esModule?t:{default:t}}var Pi={axis:H.default.oneOf(["both","x","y","none"]),className:H.default.string,children:H.default.element.isRequired,draggableOpts:H.default.shape({allowAnyClick:H.default.bool,cancel:H.default.string,children:H.default.node,disabled:H.default.bool,enableUserSelectHack:H.default.bool,offsetParent:H.default.node,grid:H.default.arrayOf(H.default.number),handle:H.default.string,nodeRef:H.default.object,onStart:H.default.func,onDrag:H.default.func,onStop:H.default.func,onMouseDown:H.default.func,scale:H.default.number}),height:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var a;return(a=H.default.number).isRequired.apply(a,n)}return H.default.number.apply(H.default,n)},handle:H.default.oneOfType([H.default.node,H.default.func]),handleSize:H.default.arrayOf(H.default.number),lockAspectRatio:H.default.bool,maxConstraints:H.default.arrayOf(H.default.number),minConstraints:H.default.arrayOf(H.default.number),onResizeStop:H.default.func,onResizeStart:H.default.func,onResize:H.default.func,resizeHandles:H.default.arrayOf(H.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:H.default.number,width:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var a;return(a=H.default.number).isRequired.apply(a,n)}return H.default.number.apply(H.default,n)}};Rt.resizableProps=Pi,bt.__esModule=!0,bt.default=void 0;var Ct=Vi(_),Di=so,Ni=Jn,ji=Rt,Li=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function co(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(co=function(o){return o?n:e})(t)}function Vi(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=co(e);if(n&&n.has(t))return n.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}function Qn(){return Qn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Qn.apply(this,arguments)}function Ui(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,a;for(a=0;a<r.length;a++)o=r[a],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}function fo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function er(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?fo(Object(n),!0).forEach(function(r){zi(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fo(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function zi(t,e,n){return e=Ai(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ai(t){var e=ki(t,"string");return typeof e=="symbol"?e:String(e)}function ki(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Wi(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,tr(t,e)}function tr(t,e){return tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},tr(t,e)}var nr=function(t){Wi(e,t);function e(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,[this].concat(a))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=e.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,a){var i=this.props,u=i.minConstraints,s=i.maxConstraints,c=i.lockAspectRatio;if(!u&&!s&&!c)return[o,a];if(c){var f=this.props.width/this.props.height,p=o-this.props.width,h=a-this.props.height;Math.abs(p)>Math.abs(h*f)?a=o/f:o=a*f}var v=o,b=a,y=this.slack||[0,0],O=y[0],C=y[1];return o+=O,a+=C,u&&(o=Math.max(u[0],o),a=Math.max(u[1],a)),s&&(o=Math.min(s[0],o),a=Math.min(s[1],a)),this.slack=[O+(v-o),C+(b-a)],[o,a]},n.resizeHandler=function(o,a){var i=this;return function(u,s){var c=s.node,f=s.deltaX,p=s.deltaY;o==="onResizeStart"&&i.resetData();var h=(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(!(!h&&!v)){var b=a[0],y=a[a.length-1],O=c.getBoundingClientRect();if(i.lastHandleRect!=null){if(y==="w"){var C=O.left-i.lastHandleRect.left;f+=C}if(b==="n"){var I=O.top-i.lastHandleRect.top;p+=I}}i.lastHandleRect=O,y==="w"&&(f=-f),b==="n"&&(p=-p);var R=i.props.width+(h?f/i.props.transformScale:0),x=i.props.height+(v?p/i.props.transformScale:0),m=i.runConstraints(R,x);R=m[0],x=m[1];var w=R!==i.props.width||x!==i.props.height,T=typeof i.props[o]=="function"?i.props[o]:null,E=o==="onResize"&&!w;T&&!E&&(u.persist==null||u.persist(),T(u,{node:c,size:{width:R,height:x},handle:a})),o==="onResizeStop"&&i.resetData()}}},n.renderResizeHandle=function(o,a){var i=this.props.handle;if(!i)return Ct.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:a});if(typeof i=="function")return i(o,a);var u=typeof i.type=="string",s=er({ref:a},u?{}:{handleAxis:o});return Ct.cloneElement(i,s)},n.render=function(){var o=this,a=this.props,i=a.children,u=a.className,s=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 c=a.resizeHandles;a.transformScale;var f=Ui(a,Li);return(0,Ni.cloneElement)(i,er(er({},f),{},{className:(u?u+" ":"")+"react-resizable",children:[].concat(i.props.children,c.map(function(p){var h,v=(h=o.handleRefs[p])!=null?h:o.handleRefs[p]=Ct.createRef();return Ct.createElement(Di.DraggableCore,Qn({},s,{nodeRef:v,key:"resizableHandle-"+p,onStop:o.resizeHandler("onResizeStop",p),onStart:o.resizeHandler("onResizeStart",p),onDrag:o.resizeHandler("onResize",p)}),o.renderResizeHandle(p,v))}))}))},e}(Ct.Component);bt.default=nr,nr.propTypes=ji.resizableProps,nr.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var qt={};qt.__esModule=!0,qt.default=void 0;var rr=$i(_),Hi=po(He),Fi=po(bt),Bi=Rt,Gi=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function po(t){return t&&t.__esModule?t:{default:t}}function ho(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(ho=function(o){return o?n:e})(t)}function $i(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=ho(e);if(n&&n.has(t))return n.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}function or(){return or=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},or.apply(this,arguments)}function mo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function Kt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?mo(Object(n),!0).forEach(function(r){Xi(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mo(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Xi(t,e,n){return e=Yi(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yi(t){var e=qi(t,"string");return typeof e=="symbol"?e:String(e)}function qi(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ki(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,a;for(a=0;a<r.length;a++)o=r[a],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}function Zi(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,ar(t,e)}function ar(t,e){return ar=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},ar(t,e)}var go=function(t){Zi(e,t);function e(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,[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(u,s){var c=s.size;r.props.onResize?(u.persist==null||u.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(u,s)})):r.setState(c)},r}e.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=e.prototype;return n.render=function(){var o=this.props,a=o.handle,i=o.handleSize;o.onResize;var u=o.onResizeStart,s=o.onResizeStop,c=o.draggableOpts,f=o.minConstraints,p=o.maxConstraints,h=o.lockAspectRatio,v=o.axis;o.width,o.height;var b=o.resizeHandles,y=o.style,O=o.transformScale,C=Ki(o,Gi);return rr.createElement(Fi.default,{axis:v,draggableOpts:c,handle:a,handleSize:i,height:this.state.height,lockAspectRatio:h,maxConstraints:p,minConstraints:f,onResizeStart:u,onResize:this.onResize,onResizeStop:s,resizeHandles:b,transformScale:O,width:this.state.width},rr.createElement("div",or({},C,{style:Kt(Kt({},y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},e}(rr.Component);qt.default=go,go.propTypes=Kt(Kt({},Bi.resizableProps),{},{children:Hi.default.element}),Yt.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Yt.exports.Resizable=bt.default,Yt.exports.ResizableBox=qt.default;var Ji=Yt.exports,ze={};Object.defineProperty(ze,"__esModule",{value:!0}),ze.resizeHandleType=ze.resizeHandleAxesType=ze.default=void 0;var B=vo(He),Qi=vo(_);function vo(t){return t&&t.__esModule?t:{default:t}}const es=ze.resizeHandleAxesType=B.default.arrayOf(B.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),ts=ze.resizeHandleType=B.default.oneOfType([B.default.node,B.default.func]);ze.default={className:B.default.string,style:B.default.object,width:B.default.number,autoSize:B.default.bool,cols:B.default.number,draggableCancel:B.default.string,draggableHandle:B.default.string,verticalCompact:function(t){t.verticalCompact},compactType:B.default.oneOf(["vertical","horizontal"]),layout:function(t){var e=t.layout;e!==void 0&&G.validateLayout(e,"layout")},margin:B.default.arrayOf(B.default.number),containerPadding:B.default.arrayOf(B.default.number),rowHeight:B.default.number,maxRows:B.default.number,isBounded:B.default.bool,isDraggable:B.default.bool,isResizable:B.default.bool,allowOverlap:B.default.bool,preventCollision:B.default.bool,useCSSTransforms:B.default.bool,transformScale:B.default.number,isDroppable:B.default.bool,resizeHandles:es,resizeHandle:ts,onLayoutChange:B.default.func,onDragStart:B.default.func,onDrag:B.default.func,onDragStop:B.default.func,onResizeStart:B.default.func,onResize:B.default.func,onResizeStop:B.default.func,onDrop:B.default.func,droppingItem:B.default.shape({i:B.default.string.isRequired,w:B.default.number.isRequired,h:B.default.number.isRequired}),children:function(t,e){const n=t[e],r={};Qi.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:B.default.any},Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.default=void 0;var rt=ir(_),K=ir(He),ns=so,rs=Ji,ot=G,me=Pe,yo=ze,os=ir(Nn);function ir(t){return t&&t.__esModule?t:{default:t}}function je(t,e,n){return e=as(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function as(t){var e=is(t,"string");return typeof e=="symbol"?e:String(e)}function is(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class sr extends rt.default.Component{constructor(){super(...arguments),je(this,"state",{resizing:null,dragging:null,className:""}),je(this,"elementRef",rt.default.createRef()),je(this,"onDragStart",(e,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:a}=this.props;if(!o)return;const i={top:0,left:0},{offsetParent:u}=r;if(!u)return;const s=u.getBoundingClientRect(),c=r.getBoundingClientRect(),f=c.left/a,p=s.left/a,h=c.top/a,v=s.top/a;i.left=f-p+u.scrollLeft,i.top=h-v+u.scrollTop,this.setState({dragging:i});const{x:b,y}=(0,me.calcXY)(this.getPositionParams(),i.top,i.left,this.props.w,this.props.h);return o.call(this,this.props.i,b,y,{e,node:r,newPosition:i})}),je(this,"onDrag",(e,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 u=this.state.dragging.top+a,s=this.state.dragging.left+o;const{isBounded:c,i:f,w:p,h,containerWidth:v}=this.props,b=this.getPositionParams();if(c){const{offsetParent:I}=r;if(I){const{margin:R,rowHeight:x,containerPadding:m}=this.props,w=I.clientHeight-(0,me.calcGridItemWHPx)(h,x,R[1]);u=(0,me.clamp)(u-m[1],0,w);const T=(0,me.calcGridColWidth)(b),E=v-(0,me.calcGridItemWHPx)(p,T,R[0]);s=(0,me.clamp)(s-m[0],0,E)}}const y={top:u,left:s};this.setState({dragging:y});const{x:O,y:C}=(0,me.calcXY)(b,u,s,p,h);return i.call(this,f,O,C,{e,node:r,newPosition:y})}),je(this,"onDragStop",(e,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:u}=this.props,{left:s,top:c}=this.state.dragging,f={top:c,left:s};this.setState({dragging:null});const{x:p,y:h}=(0,me.calcXY)(this.getPositionParams(),c,s,a,i);return o.call(this,u,p,h,{e,node:r,newPosition:f})}),je(this,"onResizeStop",(e,n,r)=>this.onResizeHandler(e,n,r,"onResizeStop")),je(this,"onResizeStart",(e,n,r)=>this.onResizeHandler(e,n,r,"onResizeStart")),je(this,"onResize",(e,n,r)=>this.onResizeHandler(e,n,r,"onResize"))}shouldComponentUpdate(e,n){if(this.props.children!==e.children||this.props.droppingPosition!==e.droppingPosition)return!0;const r=(0,me.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,me.calcGridItemPosition)(this.getPositionParams(e),e.x,e.y,e.w,e.h,n);return!(0,ot.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==e.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(e){this.moveDroppingItem(e)}moveDroppingItem(e){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=e.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 u=n.left-a.left,s=n.top-a.top;this.onDrag(n.e,{node:r,deltaX:u,deltaY:s})}}getPositionParams(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:e.cols,containerPadding:e.containerPadding,containerWidth:e.containerWidth,margin:e.margin,maxRows:e.maxRows,rowHeight:e.rowHeight}}createStyle(e){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let a;return o?a=(0,ot.setTransform)(e):(a=(0,ot.setTopLeft)(e),n&&(a.left=(0,ot.perc)(e.left/r),a.width=(0,ot.perc)(e.width/r))),a}mixinDraggable(e,n){return rt.default.createElement(ns.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},e)}curryResizeHandler(e,n){return(r,o)=>n(r,o,e)}mixinResizable(e,n,r){const{cols:o,minW:a,minH:i,maxW:u,maxH:s,transformScale:c,resizeHandles:f,resizeHandle:p}=this.props,h=this.getPositionParams(),v=(0,me.calcGridItemPosition)(h,0,0,o,0).width,b=(0,me.calcGridItemPosition)(h,0,0,a,i),y=(0,me.calcGridItemPosition)(h,0,0,u,s),O=[b.width,b.height],C=[Math.min(y.width,v),Math.min(y.height,1/0)];return rt.default.createElement(rs.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:O,maxConstraints:C,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:f,handle:p},e)}onResizeHandler(e,n,r,o){let{node:a,size:i,handle:u}=n;const s=this.props[o];if(!s)return;const{x:c,y:f,i:p,maxH:h,minH:v,containerWidth:b}=this.props,{minW:y,maxW:O}=this.props;let C=i;a&&(C=(0,ot.resizeItemInDirection)(u,r,i,b),this.setState({resizing:o==="onResizeStop"?null:C}));let{w:I,h:R}=(0,me.calcWH)(this.getPositionParams(),C.width,C.height,c,f,u);I=(0,me.clamp)(I,Math.max(y,1),O),R=(0,me.clamp)(R,v,h),s.call(this,p,I,R,{e,node:a,size:C,handle:u})}render(){const{x:e,y:n,w:r,h:o,isDraggable:a,isResizable:i,droppingPosition:u,useCSSTransforms:s}=this.props,c=(0,me.calcGridItemPosition)(this.getPositionParams(),e,n,r,o,this.state),f=rt.default.Children.only(this.props.children);let p=rt.default.cloneElement(f,{ref:this.elementRef,className:(0,os.default)("react-grid-item",f.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":a,"react-draggable-dragging":!!this.state.dragging,dropping:!!u,cssTransforms:s}),style:{...this.props.style,...f.props.style,...this.createStyle(c)}});return p=this.mixinResizable(p,c,i),p=this.mixinDraggable(p,a),p}}Ht.default=sr,je(sr,"propTypes",{children:K.default.element,cols:K.default.number.isRequired,containerWidth:K.default.number.isRequired,rowHeight:K.default.number.isRequired,margin:K.default.array.isRequired,maxRows:K.default.number.isRequired,containerPadding:K.default.array.isRequired,x:K.default.number.isRequired,y:K.default.number.isRequired,w:K.default.number.isRequired,h:K.default.number.isRequired,minW:function(t,e){const n=t[e];if(typeof n!="number")return new Error("minWidth not Number");if(n>t.w||n>t.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(t,e){const n=t[e];if(typeof n!="number")return new Error("maxWidth not Number");if(n<t.w||n<t.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(t,e){const n=t[e];if(typeof n!="number")return new Error("minHeight not Number");if(n>t.h||n>t.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(t,e){const n=t[e];if(typeof n!="number")return new Error("maxHeight not Number");if(n<t.h||n<t.minH)return new Error("maxHeight smaller than item height/minHeight")},i:K.default.string.isRequired,resizeHandles:yo.resizeHandleAxesType,resizeHandle:yo.resizeHandleType,onDragStop:K.default.func,onDragStart:K.default.func,onDrag:K.default.func,onResizeStop:K.default.func,onResizeStart:K.default.func,onResize:K.default.func,isDraggable:K.default.bool.isRequired,isResizable:K.default.bool.isRequired,isBounded:K.default.bool.isRequired,static:K.default.bool,useCSSTransforms:K.default.bool.isRequired,transformScale:K.default.number,className:K.default.string,handle:K.default.string,cancel:K.default.string,droppingPosition:K.default.shape({e:K.default.object.isRequired,left:K.default.number.isRequired,top:K.default.number.isRequired})}),je(sr,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(gt,"__esModule",{value:!0}),gt.default=void 0;var Ke=cs(_),lr=Pn,ss=ur(Nn),A=G,ls=Pe,So=ur(Ht),us=ur(ze);function ur(t){return t&&t.__esModule?t:{default:t}}function bo(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(bo=function(r){return r?n:e})(t)}function cs(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=bo(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}function ye(t,e,n){return e=ds(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ds(t){var e=fs(t,"string");return typeof e=="symbol"?e:String(e)}function fs(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Ro="react-grid-layout";let Co=!1;try{Co=/firefox/i.test(navigator.userAgent)}catch{}class Zt extends Ke.Component{constructor(){super(...arguments),ye(this,"state",{activeDrag:null,layout:(0,A.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,A.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),ye(this,"dragEnterCounter",0),ye(this,"onDragStart",(e,n,r,o)=>{let{e:a,node:i}=o;const{layout:u}=this.state,s=(0,A.getLayoutItem)(u,e);if(!s)return;const c={w:s.w,h:s.h,x:s.x,y:s.y,placeholder:!0,i:e};return this.setState({oldDragItem:(0,A.cloneLayoutItem)(s),oldLayout:u,activeDrag:c}),this.props.onDragStart(u,s,s,null,a,i)}),ye(this,"onDrag",(e,n,r,o)=>{let{e:a,node:i}=o;const{oldDragItem:u}=this.state;let{layout:s}=this.state;const{cols:c,allowOverlap:f,preventCollision:p}=this.props,h=(0,A.getLayoutItem)(s,e);if(!h)return;const v={w:h.w,h:h.h,x:h.x,y:h.y,placeholder:!0,i:e};s=(0,A.moveElement)(s,h,n,r,!0,p,(0,A.compactType)(this.props),c,f),this.props.onDrag(s,u,h,v,a,i),this.setState({layout:f?s:(0,A.compact)(s,(0,A.compactType)(this.props),c),activeDrag:v})}),ye(this,"onDragStop",(e,n,r,o)=>{let{e:a,node:i}=o;if(!this.state.activeDrag)return;const{oldDragItem:u}=this.state;let{layout:s}=this.state;const{cols:c,preventCollision:f,allowOverlap:p}=this.props,h=(0,A.getLayoutItem)(s,e);if(!h)return;s=(0,A.moveElement)(s,h,n,r,!0,f,(0,A.compactType)(this.props),c,p);const b=p?s:(0,A.compact)(s,(0,A.compactType)(this.props),c);this.props.onDragStop(b,u,h,null,a,i);const{oldLayout:y}=this.state;this.setState({activeDrag:null,layout:b,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(b,y)}),ye(this,"onResizeStart",(e,n,r,o)=>{let{e:a,node:i}=o;const{layout:u}=this.state,s=(0,A.getLayoutItem)(u,e);s&&(this.setState({oldResizeItem:(0,A.cloneLayoutItem)(s),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(u,s,s,null,a,i))}),ye(this,"onResize",(e,n,r,o)=>{let{e:a,node:i,size:u,handle:s}=o;const{oldResizeItem:c}=this.state,{layout:f}=this.state,{cols:p,preventCollision:h,allowOverlap:v}=this.props;let b=!1,y,O,C;const[I,R]=(0,A.withLayoutItem)(f,e,m=>{let w;return O=m.x,C=m.y,["sw","w","nw","n","ne"].indexOf(s)!==-1&&(["sw","nw","w"].indexOf(s)!==-1&&(O=m.x+(m.w-n),n=m.x!==O&&O<0?m.w:n,O=O<0?0:O),["ne","n","nw"].indexOf(s)!==-1&&(C=m.y+(m.h-r),r=m.y!==C&&C<0?m.h:r,C=C<0?0:C),b=!0),h&&!v&&(w=(0,A.getAllCollisions)(f,{...m,w:n,h:r,x:O,y:C}).filter(E=>E.i!==m.i).length>0,w&&(C=m.y,r=m.h,O=m.x,n=m.w,b=!1)),m.w=n,m.h=r,m});if(!R)return;y=I,b&&(y=(0,A.moveElement)(I,R,O,C,!0,this.props.preventCollision,(0,A.compactType)(this.props),p,v));const x={w:R.w,h:R.h,x:R.x,y:R.y,static:!0,i:e};this.props.onResize(y,c,R,x,a,i),this.setState({layout:v?y:(0,A.compact)(y,(0,A.compactType)(this.props),p),activeDrag:x})}),ye(this,"onResizeStop",(e,n,r,o)=>{let{e:a,node:i}=o;const{layout:u,oldResizeItem:s}=this.state,{cols:c,allowOverlap:f}=this.props,p=(0,A.getLayoutItem)(u,e),h=f?u:(0,A.compact)(u,(0,A.compactType)(this.props),c);this.props.onResizeStop(h,s,p,null,a,i);const{oldLayout:v}=this.state;this.setState({activeDrag:null,layout:h,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(h,v)}),ye(this,"onDragOver",e=>{var I;if(e.preventDefault(),e.stopPropagation(),Co&&!((I=e.nativeEvent.target)!=null&&I.classList.contains(Ro)))return!1;const{droppingItem:n,onDropDragOver:r,margin:o,cols:a,rowHeight:i,maxRows:u,width:s,containerPadding:c,transformScale:f}=this.props,p=r==null?void 0:r(e);if(p===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const h={...n,...p},{layout:v}=this.state,b=e.currentTarget.getBoundingClientRect(),y=e.clientX-b.left,O=e.clientY-b.top,C={left:y/f,top:O/f,e};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:R,top:x}=this.state.droppingPosition;(R!=y||x!=O)&&this.setState({droppingPosition:C})}}else{const R={cols:a,margin:o,maxRows:u,rowHeight:i,containerWidth:s,containerPadding:c||o},x=(0,ls.calcXY)(R,O,y,h.w,h.h);this.setState({droppingDOMNode:Ke.createElement("div",{key:h.i}),droppingPosition:C,layout:[...v,{...h,x:x.x,y:x.y,static:!1,isDraggable:!0}]})}}),ye(this,"removeDroppingPlaceholder",()=>{const{droppingItem:e,cols:n}=this.props,{layout:r}=this.state,o=(0,A.compact)(r.filter(a=>a.i!==e.i),(0,A.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),ye(this,"onDragLeave",e=>{e.preventDefault(),e.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),ye(this,"onDragEnter",e=>{e.preventDefault(),e.stopPropagation(),this.dragEnterCounter++}),ye(this,"onDrop",e=>{e.preventDefault(),e.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,e)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(e,n){let r;return n.activeDrag?null:(!(0,lr.deepEqual)(e.layout,n.propsLayout)||e.compactType!==n.compactType?r=e.layout:(0,A.childrenEqual)(e.children,n.children)||(r=n.layout),r?{layout:(0,A.synchronizeLayoutWithChildren)(r,e.children,e.cols,(0,A.compactType)(e),e.allowOverlap),compactType:e.compactType,children:e.children,propsLayout:e.layout}:null)}shouldComponentUpdate(e,n){return this.props.children!==e.children||!(0,A.fastRGLPropsEqual)(this.props,e,lr.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(e,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const e=(0,A.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return e*this.props.rowHeight+(e-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(e,n){n||(n=this.state.layout),(0,lr.deepEqual)(n,e)||this.props.onLayoutChange(e)}placeholder(){const{activeDrag:e}=this.state;if(!e)return null;const{width:n,cols:r,margin:o,containerPadding:a,rowHeight:i,maxRows:u,useCSSTransforms:s,transformScale:c}=this.props;return Ke.createElement(So.default,{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:n,cols:r,margin:o,containerPadding:a||o,maxRows:u,rowHeight:i,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:s,transformScale:c},Ke.createElement("div",null))}processGridItem(e,n){if(!e||!e.key)return;const r=(0,A.getLayoutItem)(this.state.layout,String(e.key));if(!r)return null;const{width:o,cols:a,margin:i,containerPadding:u,rowHeight:s,maxRows:c,isDraggable:f,isResizable:p,isBounded:h,useCSSTransforms:v,transformScale:b,draggableCancel:y,draggableHandle:O,resizeHandles:C,resizeHandle:I}=this.props,{mounted:R,droppingPosition:x}=this.state,m=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&f,w=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&p,T=r.resizeHandles||C,E=m&&h&&r.isBounded!==!1;return Ke.createElement(So.default,{containerWidth:o,cols:a,margin:i,containerPadding:u||i,maxRows:c,rowHeight:s,cancel:y,handle:O,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:m,isResizable:w,isBounded:E,useCSSTransforms:v&&R,usePercentages:!R,transformScale:b,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?x:void 0,resizeHandles:T,resizeHandle:I},e)}render(){const{className:e,style:n,isDroppable:r,innerRef:o}=this.props,a=(0,ss.default)(Ro,e),i={height:this.containerHeight(),...n};return Ke.createElement("div",{ref:o,className:a,style:i,onDrop:r?this.onDrop:A.noop,onDragLeave:r?this.onDragLeave:A.noop,onDragEnter:r?this.onDragEnter:A.noop,onDragOver:r?this.onDragOver:A.noop},Ke.Children.map(this.props.children,u=>this.processGridItem(u)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}gt.default=Zt,ye(Zt,"displayName","ReactGridLayout"),ye(Zt,"propTypes",us.default),ye(Zt,"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:A.noop,onDragStart:A.noop,onDrag:A.noop,onDragStop:A.noop,onResizeStart:A.noop,onResize:A.noop,onResizeStop:A.noop,onDrop:A.noop,onDropDragOver:A.noop});var Jt={},Ze={};Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.findOrGenerateResponsiveLayout=ms,Ze.getBreakpointFromWidth=ps,Ze.getColsFromBreakpoint=hs,Ze.sortBreakpoints=cr;var Qt=G;function ps(t,e){const n=cr(t);let r=n[0];for(let o=1,a=n.length;o<a;o++){const i=n[o];e>t[i]&&(r=i)}return r}function hs(t,e){if(!e[t])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+t+" is missing!");return e[t]}function ms(t,e,n,r,o,a){if(t[n])return(0,Qt.cloneLayout)(t[n]);let i=t[r];const u=cr(e),s=u.slice(u.indexOf(n));for(let c=0,f=s.length;c<f;c++){const p=s[c];if(t[p]){i=t[p];break}}return i=(0,Qt.cloneLayout)(i||[]),(0,Qt.compact)((0,Qt.correctBounds)(i,{cols:o}),a,o)}function cr(t){return Object.keys(t).sort(function(n,r){return t[n]-t[r]})}Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.default=void 0;var To=vs(_),Re=wo(He),dr=Pn,at=G,Je=Ze,gs=wo(gt);function wo(t){return t&&t.__esModule?t:{default:t}}function Io(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Io=function(r){return r?n:e})(t)}function vs(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=Io(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}function fr(){return fr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},fr.apply(this,arguments)}function en(t,e,n){return e=ys(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ys(t){var e=Ss(t,"string");return typeof e=="symbol"?e:String(e)}function Ss(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const _o=t=>Object.prototype.toString.call(t);function tn(t,e){return t==null?null:Array.isArray(t)?t:t[e]}class pr extends To.Component{constructor(){super(...arguments),en(this,"state",this.generateInitialState()),en(this,"onLayoutChange",e=>{this.props.onLayoutChange(e,{...this.props.layouts,[this.state.breakpoint]:e})})}generateInitialState(){const{width:e,breakpoints:n,layouts:r,cols:o}=this.props,a=(0,Je.getBreakpointFromWidth)(n,e),i=(0,Je.getColsFromBreakpoint)(a,o),u=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Je.findOrGenerateResponsiveLayout)(r,n,a,a,i,u),breakpoint:a,cols:i}}static getDerivedStateFromProps(e,n){if(!(0,dr.deepEqual)(e.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,Je.findOrGenerateResponsiveLayout)(e.layouts,e.breakpoints,r,r,o,e.compactType),layouts:e.layouts}}return null}componentDidUpdate(e){(this.props.width!=e.width||this.props.breakpoint!==e.breakpoint||!(0,dr.deepEqual)(this.props.breakpoints,e.breakpoints)||!(0,dr.deepEqual)(this.props.cols,e.cols))&&this.onWidthChange(e)}onWidthChange(e){const{breakpoints:n,cols:r,layouts:o,compactType:a}=this.props,i=this.props.breakpoint||(0,Je.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),u=this.state.breakpoint,s=(0,Je.getColsFromBreakpoint)(i,r),c={...o};if(u!==i||e.breakpoints!==n||e.cols!==r){u in c||(c[u]=(0,at.cloneLayout)(this.state.layout));let h=(0,Je.findOrGenerateResponsiveLayout)(c,n,i,u,s,a);h=(0,at.synchronizeLayoutWithChildren)(h,this.props.children,s,a,this.props.allowOverlap),c[i]=h,this.props.onBreakpointChange(i,s),this.props.onLayoutChange(h,c),this.setState({breakpoint:i,layout:h,cols:s})}const f=tn(this.props.margin,i),p=tn(this.props.containerPadding,i);this.props.onWidthChange(this.props.width,f,s,p)}render(){const{breakpoint:e,breakpoints:n,cols:r,layouts:o,margin:a,containerPadding:i,onBreakpointChange:u,onLayoutChange:s,onWidthChange:c,...f}=this.props;return To.createElement(gs.default,fr({},f,{margin:tn(a,this.state.breakpoint),containerPadding:tn(i,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Jt.default=pr,en(pr,"propTypes",{breakpoint:Re.default.string,breakpoints:Re.default.object,allowOverlap:Re.default.bool,cols:Re.default.object,margin:Re.default.oneOfType([Re.default.array,Re.default.object]),containerPadding:Re.default.oneOfType([Re.default.array,Re.default.object]),layouts(t,e){if(_o(t[e])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+_o(t[e]));Object.keys(t[e]).forEach(n=>{if(!(n in t.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,at.validateLayout)(t.layouts[n],"layouts."+n)})},width:Re.default.number.isRequired,onBreakpointChange:Re.default.func,onLayoutChange:Re.default.func,onWidthChange:Re.default.func}),en(pr,"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:at.noop,onLayoutChange:at.noop,onWidthChange:at.noop});var hr={},xo=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(o,a){return o[0]===n?(r=a,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(n){var r=t(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},e.prototype.set=function(n,r){var o=t(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,o=t(r,n);~o&&r.splice(o,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.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])}},e}()}(),mr=typeof window<"u"&&typeof document<"u"&&window.document===document,nn=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")()}(),bs=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(nn):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),Rs=2;function Cs(t,e){var n=!1,r=!1,o=0;function a(){n&&(n=!1,t()),r&&u()}function i(){bs(a)}function u(){var s=Date.now();if(n){if(s-o<Rs)return;r=!0}else n=!0,r=!1,setTimeout(i,e);o=s}return u}var Ts=20,ws=["top","right","bottom","left","width","height","size","weight"],Is=typeof MutationObserver<"u",_s=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Cs(this.refresh.bind(this),Ts)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var n=this.observers_,r=n.indexOf(e);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return e.forEach(function(n){return n.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!mr||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Is?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!mr||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,r=n===void 0?"":n,o=ws.some(function(a){return!!~r.indexOf(a)});o&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),Eo=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];Object.defineProperty(t,o,{value:e[o],enumerable:!1,writable:!1,configurable:!0})}return t},it=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||nn},Oo=on(0,0,0,0);function rn(t){return parseFloat(t)||0}function Mo(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(r,o){var a=t["border-"+o+"-width"];return r+rn(a)},0)}function xs(t){for(var e=["top","right","bottom","left"],n={},r=0,o=e;r<o.length;r++){var a=o[r],i=t["padding-"+a];n[a]=rn(i)}return n}function Es(t){var e=t.getBBox();return on(0,0,e.width,e.height)}function Os(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return Oo;var r=it(t).getComputedStyle(t),o=xs(r),a=o.left+o.right,i=o.top+o.bottom,u=rn(r.width),s=rn(r.height);if(r.boxSizing==="border-box"&&(Math.round(u+a)!==e&&(u-=Mo(r,"left","right")+a),Math.round(s+i)!==n&&(s-=Mo(r,"top","bottom")+i)),!Ps(t)){var c=Math.round(u+a)-e,f=Math.round(s+i)-n;Math.abs(c)!==1&&(u-=c),Math.abs(f)!==1&&(s-=f)}return on(o.left,o.top,u,s)}var Ms=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof it(t).SVGGraphicsElement}:function(t){return t instanceof it(t).SVGElement&&typeof t.getBBox=="function"}}();function Ps(t){return t===it(t).document.documentElement}function Ds(t){return mr?Ms(t)?Es(t):Os(t):Oo}function Ns(t){var e=t.x,n=t.y,r=t.width,o=t.height,a=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,i=Object.create(a.prototype);return Eo(i,{x:e,y:n,width:r,height:o,top:n,right:e+r,bottom:o+n,left:e}),i}function on(t,e,n,r){return{x:t,y:e,width:n,height:r}}var js=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=on(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=Ds(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},t}(),Ls=function(){function t(e,n){var r=Ns(n);Eo(this,{target:e,contentRect:r})}return t}(),Vs=function(){function t(e,n,r){if(this.activeObservations_=[],this.observations_=new xo,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=n,this.callbackCtx_=r}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof it(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new js(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof it(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new Ls(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),Po=typeof WeakMap<"u"?new WeakMap:new xo,Do=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=_s.getInstance(),r=new Vs(e,n,this);Po.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){Do.prototype[t]=function(){var e;return(e=Po.get(this))[t].apply(e,arguments)}});var Us=function(){return typeof nn.ResizeObserver<"u"?nn.ResizeObserver:Do}();const zs=Ir(Object.freeze(Object.defineProperty({__proto__:null,default:Us},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(hr,"__esModule",{value:!0}),hr.default=$s;var an=Hs(_),As=gr(He),ks=gr(zs),Ws=gr(Nn);function gr(t){return t&&t.__esModule?t:{default:t}}function No(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(No=function(r){return r?n:e})(t)}function Hs(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=No(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}function vr(){return vr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},vr.apply(this,arguments)}function st(t,e,n){return e=Fs(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fs(t){var e=Bs(t,"string");return typeof e=="symbol"?e:String(e)}function Bs(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Gs="react-grid-layout";function $s(t){var e;return e=class extends an.Component{constructor(){super(...arguments),st(this,"state",{width:1280}),st(this,"elementRef",an.createRef()),st(this,"mounted",!1),st(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new ks.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?an.createElement("div",{className:(0,Ws.default)(this.props.className,Gs),style:this.props.style,ref:this.elementRef}):an.createElement(t,vr({innerRef:this.elementRef},o,this.state))}},st(e,"defaultProps",{measureBeforeMount:!1}),st(e,"propTypes",{measureBeforeMount:As.default.bool}),e}(function(t){t.exports=gt.default,t.exports.utils=G,t.exports.calculateUtils=Pe,t.exports.Responsive=Jt.default,t.exports.Responsive.utils=Ze,t.exports.WidthProvider=hr.default})(Pr);var Xs=Pr.exports;const Ys=ra(Xs),Tt={type:d.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(t,e){if(!e)return!1;const n=t.get(d.IUndoRedoService),r=t.get(d.ICommandService),o=t.get(d.IUniverInstanceService),a=L.getSheetCommandTarget(o,e);if(!a)return!1;const{unitId:i,subUnitId:u}=a,s={unitId:i,subUnitId:u,cfId:e.cfId},c=l.DeleteConditionalRuleMutationUndoFactory(t,s),f=r.syncExecuteCommand(l.DeleteConditionalRuleMutation.id,s);return f&&n.pushUndoRedo({unitID:i,undoMutations:c,redoMutations:[{id:l.DeleteConditionalRuleMutation.id,params:s}]}),f}},sn={type:d.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(t,e){if(!e)return!1;const n=t.get(d.IUndoRedoService),r=t.get(d.ICommandService),o=t.get(d.IUniverInstanceService),a=t.get(l.ConditionalFormattingRuleModel),i=L.getSheetCommandTarget(o,e);if(!i)return!1;const{unitId:u,subUnitId:s}=i,c=l.transformSupportSymmetryAnchor(e.start,e.end,a.getSubunitRules(u,s)||[],y=>y.cfId);if(!c)return!1;const[f,p]=c,h={unitId:u,subUnitId:s,start:f,end:p},v=l.MoveConditionalRuleMutationUndoFactory(h),b=r.syncExecuteCommand(l.MoveConditionalRuleMutation.id,h);return b&&n.pushUndoRedo({unitID:u,redoMutations:[{id:l.MoveConditionalRuleMutation.id,params:h}],undoMutations:v}),b}},ln={cfPreview:"univer-cf-preview"},lt=t=>{var o,a;const e=t.rule;if(!e)return null;const n=_.useMemo(()=>{if(e.type===l.CFRuleType.colorScale){const i=e.config.map((c,f)=>({color:new d.ColorKit(c.color),value:f})),u=i.length-1;return new Array(5).fill("").map((c,f,p)=>f*u/(p.length-1)).map(c=>l.getColorScaleFromValue(i,c))}return null},[e]),r=_.useMemo(()=>{if(e.type===l.CFRuleType.iconSet)return e.config.map(i=>{const u=l.iconMap[i.iconType];return u&&u[Number(i.iconId)]})},[e]);switch(e.type){case l.CFRuleType.dataBar:{const{isGradient:i}=e.config,u={width:"50%",height:"100%"},s=i?`linear-gradient(to right, ${e.config.positiveColor||l.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,c=i?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||l.defaultDataBarNativeColor})`:e.config.nativeColor;return g.jsxs("div",{className:ln.cfPreview,children:[g.jsx("div",{style:{...u,background:c,border:`1px solid ${e.config.nativeColor||l.defaultDataBarNativeColor}`}}),g.jsx("div",{style:{...u,background:s,border:`1px solid ${e.config.positiveColor||l.defaultDataBarPositiveColor}`}})]})}case l.CFRuleType.colorScale:return n&&g.jsx("div",{className:ln.cfPreview,children:n.map((i,u)=>g.jsx("div",{style:{width:`${100/n.length}%`,height:"100%",background:i}},u))});case l.CFRuleType.iconSet:return r&&g.jsx("div",{className:ln.cfPreview,children:r.map((i,u)=>i?g.jsx("img",{style:{height:"100%"},src:i},u):g.jsx(mt,{},u))});case l.CFRuleType.highlightCell:{const{ul:i,st:u,it:s,bl:c,bg:f,cl:p}=e.style,h=(i==null?void 0:i.s)===d.BooleanNumber.TRUE,v=(u==null?void 0:u.s)===d.BooleanNumber.TRUE,b=s===d.BooleanNumber.TRUE,y=c===d.BooleanNumber.TRUE,O=(o=f==null?void 0:f.rgb)!=null?o:l.DEFAULT_BG_COLOR,C=(a=p==null?void 0:p.rgb)!=null?a:l.DEFAULT_FONT_COLOR,I={fontWeight:y?"bold":void 0,fontStyle:b?"italic":void 0,textDecoration:`${h?"underline":""} ${v?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:O,color:C};return g.jsx("div",{style:I,className:ln.cfPreview,children:"123"})}}return null};var qs=Object.defineProperty,Ks=Object.getOwnPropertyDescriptor,Zs=(t,e,n,r)=>{for(var o=r>1?void 0:r?Ks(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&qs(e,n,o),o},Js=(t,e)=>(n,r)=>e(n,r,t);let ut=class extends d.Disposable{constructor(e){super();Ge(this,"_initLocal",()=>{});Ge(this,"_findReplaceIndex",e=>{const n=/\{([^}]+)?\}/g,r=[];let o=n.exec(e);for(;o;)r.push({startIndex:o.index,key:Number(o[1]),endIndex:o.index+o[0].length-1}),o=n.exec(e);return r});this._localeService=e,this._initLocal()}tWithReactNode(e,...n){const r=this._localeService.getLocales(),o=e.split("."),a=r&&this._localeService.resolveKeyPath(r,o);if(typeof a=="string"){const i=[];return this._findReplaceIndex(a).forEach((u,s,c)=>{const f=c[s-1]||{startIndex:0,endIndex:-1};if(f.endIndex+1<u.startIndex){const p=a.slice(f.endIndex+1,u.startIndex);p&&i.push(p)}if(n[u.key]&&i.push(n[u.key]),s===c.length-1){const p=a.slice(u.endIndex+1);p&&i.push(p)}}),i}return[]}};ut=Zs([Js(0,d.Inject(d.LocaleService))],ut);const fe={cfRuleList:"univer-cf-rule-list",ruleSelector:"univer-rule-selector",select:"univer-select",selectSelector:"univer-select-selector",selectSelectionItem:"univer-select-selection-item",selectSelectionSearchInput:"univer-select-selection-search-input",btnList:"univer-btn-list",gap:"univer-gap",icon:"univer-icon",disabled:"univer-disabled",ruleItem:"univer-rule-item",ruleDescribe:"univer-rule-describe",ruleType:"univer-rule-type",ruleRange:"univer-rule-range",active:"univer-active",draggableHandle:"univer-draggableHandle",deleteItem:"univer-delete-item",gridLayoutWrap:"univer-grid-layout-wrap",reactGridItem:"univer-react-grid-item"},Qs=(t,e)=>{const n=t.rule;switch(n.type){case l.CFRuleType.colorScale:return e.t("sheet.cf.ruleType.colorScale");case l.CFRuleType.dataBar:return e.t("sheet.cf.ruleType.dataBar");case l.CFRuleType.iconSet:return e.t("sheet.cf.ruleType.iconSet");case l.CFRuleType.highlightCell:switch(n.subType){case l.CFSubRuleType.average:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,e.t("sheet.cf.subRuleType.average"))}case l.CFSubRuleType.duplicateValues:return e.t("sheet.cf.subRuleType.duplicateValues");case l.CFSubRuleType.uniqueValues:return e.t("sheet.cf.subRuleType.uniqueValues");case l.CFSubRuleType.number:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,...Array.isArray(n.value)?n.value.map(o=>String(o)):[String(n.value||"")])}case l.CFSubRuleType.text:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,n.value||"")}case l.CFSubRuleType.timePeriod:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`)}case l.CFSubRuleType.rank:return n.isPercent?n.isBottom?e.t("sheet.cf.preview.describe.bottomNPercent",String(n.value)):e.t("sheet.cf.preview.describe.topNPercent",String(n.value)):n.isBottom?e.t("sheet.cf.preview.describe.bottomN",String(n.value)):e.t("sheet.cf.preview.describe.topN",String(n.value));case l.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let jo=0;const el=t=>{const{onClick:e}=t,n=d.useDependency(l.ConditionalFormattingRuleModel),r=d.useDependency(d.IUniverInstanceService),o=d.useDependency(L.SheetsSelectionsService),a=d.useDependency(d.ICommandService),i=d.useDependency(d.LocaleService),u=d.useDependency(d.Injector),s=d.useDependency(ut),c=ge.useObservable(()=>r.getCurrentTypeOfUnit$(d.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),f=c.getUnitId(),p=c.getActiveSheet();if(!p)throw new Error("No active sheet found");const h=p.getSheetId(),[v,b]=_.useState([]),[y,O]=_.useState("2"),[C,I]=_.useState(0),[R,x]=_.useState(-1),[m,w]=_.useState(jo),T=_.useRef(null),E=[{label:i.t("sheet.cf.panel.workSheet"),value:"2"},{label:i.t("sheet.cf.panel.selectedRange"),value:"1"}],N=()=>{const z=n.getSubunitRules(f,h);if(!z||!z.length)return[];if(y==="1"){const Y=o.getCurrentLastSelection();if(!Y)return[];const ne=Y.range;return z.filter(pe=>pe.ranges.some(Ce=>d.Rectangle.intersects(Ce,ne)))}else if(y==="2")return[...z];return[]},[U,F]=_.useState(N);ae.useHighlightRange(v),_.useEffect(()=>{const z=a.onCommandExecuted(Y=>{Y.id===L.SetWorksheetActiveOperation.id&&I(Math.random())});return()=>z.dispose()}),_.useEffect(()=>{F(N)},[y,C,f,h]),_.useEffect(()=>{if(y==="2")return;const z=new Me.Observable(Y=>{const ne=[L.SetSelectionsOperation.id,l.AddConditionalRuleMutation.id,l.SetConditionalRuleMutation.id,l.DeleteConditionalRuleMutation.id,l.MoveConditionalRuleMutation.id],re=a.onCommandExecuted(pe=>{const{id:Ce,params:Oe}=pe,ke=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId();ne.includes(Ce)&&Oe.unitId===ke&&Y.next(null)});return()=>re.dispose()}).pipe(Me.debounceTime(16)).subscribe(()=>{F(N)});return()=>{z.unsubscribe()}},[r,y,f,h]),_.useEffect(()=>{const z=n.$ruleChange.subscribe(()=>{I(Math.random())});return()=>z.unsubscribe()},[n]),_.useEffect(()=>{const z=()=>{var pe;const re=Math.max(0,(((pe=T.current)==null?void 0:pe.getBoundingClientRect().width)||0)-8);return jo=re,re},ne=new Me.Observable(re=>{const pe=document.querySelector(".univer-sidebar");if(pe){let Ce=setTimeout(()=>{re.next()},150);const Oe=()=>{Ce&&clearTimeout(Ce),Ce=null},ke=D=>{D.propertyName==="width"&&(Oe(),re.next())};return pe.addEventListener("transitionend",ke),()=>{Oe(),pe.removeEventListener("transitionend",ke)}}}).pipe(Me.debounceTime(16)).subscribe(()=>{w(z())});return()=>{ne.unsubscribe()}},[]);const X=z=>{var re;const Y=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),ne=(re=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:re.getSheetId();if(!Y||!ne)throw new Error("No active sheet found");a.executeCommand(Tt.id,{unitId:Y,subUnitId:ne,cfId:z.cfId})},S=(z,Y)=>{x(Y.y)},M=(z,Y,ne)=>{var D;x(-1);const re=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),pe=(D=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:D.getSheetId();if(!re||!pe)throw new Error("No active sheet found");const Ce=k=>{const Z=U.length;return Math.min(Z-1,Math.max(0,k))},Oe=U[Ce(Y.y)].cfId,ke=U[Ce(ne.y)].cfId;Oe!==ke&&a.executeCommand(sn.id,{unitId:re,subUnitId:pe,start:{id:Oe,type:"self"},end:{id:ke,type:ne.y>Y.y?"after":"before"}})},W=()=>{t.onCreate()},te=()=>{y==="2"?a.executeCommand(ht.id):y==="1"&&U.map(Y=>({unitId:f,subUnitId:h,cfId:Y.cfId})).forEach(Y=>{a.executeCommand(Tt.id,Y)})},q=_.useMemo(()=>{const z=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET),Y=z.getActiveSheet();return U.filter(ne=>{const re=ne.ranges;return L.checkRangesEditablePermission(u,z.getUnitId(),Y.getSheetId(),re)})},[U]),de=q.map((z,Y)=>({i:z.cfId,x:0,w:12,y:Y,h:1,isResizable:!1})),se=_.useMemo(()=>{const z=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET),Y=z.getActiveSheet();return U.every(ne=>{const re=ne.ranges;return L.checkRangesEditablePermission(u,z.getUnitId(),Y.getSheetId(),re)})},[U]);return g.jsxs("div",{className:fe.cfRuleList,children:[g.jsxs("div",{className:fe.ruleSelector,children:[g.jsx("div",{children:s.tWithReactNode("sheet.cf.panel.managerRuleSelect",g.jsx($.Select,{className:fe.select,options:E,value:y,onChange:z=>{O(z)}})).map((z,Y)=>g.jsx("span",{children:z},Y))}),g.jsxs("div",{className:fe.btnList,children:[g.jsx($.Tooltip,{title:i.t("sheet.cf.panel.createRule"),placement:"bottom",children:g.jsx("div",{className:`${fe.icon}`,onClick:W,children:g.jsx(Or,{})})}),U.length&&se?g.jsx($.Tooltip,{title:i.t("sheet.cf.panel.clear"),placement:"bottom",children:g.jsx("div",{className:`${fe.gap} ${fe.icon}`,onClick:te,children:g.jsx(zt,{})})}):g.jsx("div",{className:`${fe.gap} ${fe.disabled}`,children:g.jsx(zt,{})})]})]}),g.jsx("div",{ref:T,className:fe.gridLayoutWrap,children:m?g.jsx(Ys,{onDragStop:M,onDragStart:S,layout:de,cols:12,rowHeight:60,width:m,margin:[0,10],draggableHandle:".draggableHandle",children:q==null?void 0:q.map((z,Y)=>g.jsx("div",{children:g.jsxs("div",{onMouseMove:()=>{z.ranges!==v&&b(z.ranges)},onMouseLeave:()=>b([]),onClick:()=>{e(z)},className:`${fe.ruleItem} ${R===Y?fe.active:""}`,children:[g.jsx("div",{className:`${fe.draggableHandle} draggableHandle`,onClick:ne=>ne.stopPropagation(),children:g.jsx(Mr,{})}),g.jsxs("div",{className:fe.ruleDescribe,children:[g.jsx("div",{className:fe.ruleType,children:Qs(z,i)}),g.jsx("div",{className:fe.ruleRange,children:z.ranges.map(ne=>bn.serializeRange(ne)).join(",")})]}),g.jsx("div",{className:fe.preview,children:g.jsx(lt,{rule:z.rule})}),g.jsx("div",{className:`${fe.deleteItem} ${R===Y?fe.active:""}`,onClick:ne=>{ne.stopPropagation(),X(z),b([])},children:g.jsx(zt,{})})]})},`${z.cfId}`))}):null})]})},wt={type:d.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(t,e){if(!e)return!1;const{rule:n}=e,r=t.get(d.IUndoRedoService),o=t.get(d.ICommandService),a=t.get(l.ConditionalFormattingRuleModel),i=t.get(d.IUniverInstanceService),u=L.getSheetCommandTarget(i);if(!u)return!1;const{unitId:s,subUnitId:c}=u,f=a.createCfId(s,c),p={unitId:s,subUnitId:c,rule:{...n,cfId:n.cfId||f}},h=l.AddConditionalRuleMutationUndoFactory(t,p),v=o.syncExecuteCommand(l.AddConditionalRuleMutation.id,p);return v&&r.pushUndoRedo({unitID:s,redoMutations:[{id:l.AddConditionalRuleMutation.id,params:p}],undoMutations:[h]}),v}},un={type:d.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(t,e){if(!e)return!1;const n=t.get(d.IUndoRedoService),r=t.get(d.ICommandService),o=t.get(d.IUniverInstanceService),a=L.getSheetCommandTarget(o,e);if(!a)return!1;const{unitId:i,subUnitId:u}=a,s={unitId:i,subUnitId:u,rule:e.rule},c=l.setConditionalRuleMutationUndoFactory(t,s),f=r.syncExecuteCommand(l.SetConditionalRuleMutation.id,s);return f&&n.pushUndoRedo({unitID:i,undoMutations:c,redoMutations:[{id:l.SetConditionalRuleMutation.id,params:s}]}),f}},yr={cfColorPicker:"univer-cf-color-picker",cfColorPickerIcon:"univer-cf-color-picker-icon",iconDropdown:"univer-icon-dropdown"},Qe=t=>{const{color:e,onChange:n,disable:r=!1,iconId:o="PaintBucket",className:a,isNeedDropdownIcon:i=!0}=t,u=d.useDependency(ge.ComponentManager),s=_.useMemo(()=>new d.ColorKit(e),[e]),c=u.get(o);return c&&(r?g.jsx(c,{className:a,extend:{colorChannel1:s.isValid?e:"rgb(var(--primary-color))"}}):g.jsx($.Dropdown,{overlay:g.jsx("div",{className:`${yr.cfColorPicker} `,children:g.jsx($.ColorPicker,{color:e,onChange:n})}),children:g.jsxs("span",{className:`${yr.cfColorPickerIcon} ${a}`,children:[g.jsx(c,{extend:{colorChannel1:s.isValid?e:"rgb(var(--primary-color))"}}),i&&g.jsx(At,{className:yr.iconDropdown})]})}))},j={cfRuleStyleEditor:"univer-cf-rule-style-editor",cfPreviewWrap:"univer-cf-preview-wrap",text:"univer-text",positionRelative:"univer-position-relative",btnList:"univer-btn-list",utilItem:"univer-util-item",iconSet:"univer-icon-set",renderConfig:"univer-render-config",flex:"univer-flex",width45:"univer-width45",iconWrap:"univer-icon-wrap",icon:"univer-icon",dropdownIcon:"univer-dropdown-icon",errorInput:"univer-error-input",errorText:"univer-error-text",iconGroupList:"univer-icon-group-list",title:"univer-title",group:"univer-group",itemContent:"univer-item-content",itemWrap:"univer-item-wrap",item:"univer-item",iconItemListWrap:"univer-icon-item-list-wrap",none:"univer-none",iconItemList:"univer-icon-item-list",width100:"univer-width100",stress:"univer-stress"},et=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),Sr=t=>{var b;const{type:e,className:n,onChange:r,id:o,value:a}=t,i=d.useDependency(d.IUniverInstanceService),u=i.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),s=(b=i.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:b.getSheetId(),c=_.useMemo(()=>String(a).startsWith("=")?String(a):"=",[a]),f=_.useMemo(()=>[l.CFValueType.max,l.CFValueType.min,"none"].includes(e)?{disabled:!0}:[l.CFValueType.percent,l.CFValueType.percentile].includes(e)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[e]),p=_.useRef({}),[h,v]=_.useState(!1);return ge.useSidebarClick(y=>{var C;const O=(C=p.current)==null?void 0:C.handleOutClick;O&&O(y,()=>v(!1))}),e===l.CFValueType.formula?g.jsx("div",{style:{width:"100%",marginLeft:4},children:g.jsx(pt.FormulaEditor,{initValue:c,unitId:u,subUnitId:s,isFocus:h,onChange:(y="")=>{r(y||"")},onFocus:()=>v(!0),actions:p.current})}):g.jsx($.InputNumber,{className:n,value:Number(t.value)||0,onChange:y=>t.onChange(y||0),...f})},tl=t=>{var X;const{interceptorManager:e}=t,n=d.useDependency(d.LocaleService),r=((X=t.rule)==null?void 0:X.type)===l.CFRuleType.colorScale?t.rule:void 0,o=[et(l.CFValueType.num,n),et(l.CFValueType.percent,n),et(l.CFValueType.percentile,n),et(l.CFValueType.formula,n)],a=[et(l.CFValueType.min,n),...o],i=[et("none",n),...o],u=[et(l.CFValueType.max,n),...o],[s,c]=_.useState(()=>{var M;const S=l.CFValueType.min;return r&&((M=r.config[0])==null?void 0:M.value.type)||S}),[f,p]=_.useState(()=>{var M;const S="none";return!r||r.config.length!==3?S:((M=r.config[1])==null?void 0:M.value.type)||S}),[h,v]=_.useState(()=>{var M;const S=l.CFValueType.max;return r&&((M=r.config[r.config.length-1])==null?void 0:M.value.type)||S}),[b,y]=_.useState(()=>{if(!r)return 10;const M=r.config[0];return(M==null?void 0:M.value.value)===void 0?10:M==null?void 0:M.value.value}),[O,C]=_.useState(()=>{var W;if(!r||r.config.length!==3)return 50;const M=(W=r.config[1])==null?void 0:W.value.value;return M===void 0?50:M}),[I,R]=_.useState(()=>{var W;if(!r)return 90;const M=(W=r.config[r.config.length-1])==null?void 0:W.value.value;return M===void 0?90:M}),[x,m]=_.useState(()=>{var M;const S="#d0d9fb";return r&&((M=r.config[0])==null?void 0:M.color)||S}),[w,T]=_.useState(()=>{var M;const S="#7790f3";return!r||r.config.length!==3?S:((M=r.config[1])==null?void 0:M.color)||S}),[E,N]=_.useState(()=>{var M;const S="#2e55ef";return r&&((M=r.config[r.config.length-1])==null?void 0:M.color)||S}),U=_.useMemo(()=>S=>{const{minType:M,medianType:W,maxType:te,minValue:q,medianValue:de,maxValue:se,minColor:z,medianColor:Y,maxColor:ne}=S,re=[];return re.push({color:z,value:{type:M,value:q}}),W!=="none"&&re.push({color:Y,value:{type:W,value:de}}),re.push({color:ne,value:{type:te,value:se}}),{config:re.map((Ce,Oe)=>({...Ce,index:Oe})),type:l.CFRuleType.colorScale}},[]);_.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return U({minType:s,medianType:f,maxType:h,minValue:b,medianValue:O,maxValue:I,minColor:x,medianColor:w,maxColor:E})}}),[U,s,f,h,b,O,I,x,w,E,e]);const F=S=>{t.onChange(U(S))};return g.jsxs("div",{children:[g.jsx("div",{className:P.title,children:n.t("sheet.cf.panel.styleRule")}),g.jsx("div",{className:`${j.cfPreviewWrap}`,children:g.jsx(lt,{rule:U({minType:s,medianType:f,maxType:h,minValue:b,medianValue:O,maxValue:I,minColor:x,medianColor:w,maxColor:E})})}),g.jsx("div",{className:P.label,children:n.t("sheet.cf.valueType.min")}),g.jsxs("div",{className:`${P.labelContainer} ${P.mTSm}`,children:[g.jsx($.Select,{style:{flexShrink:0},options:a,value:s,onChange:S=>{c(S);const M=l.createDefaultValueByValueType(S,10);y(M),F({minType:S,medianType:f,maxType:h,minValue:M,medianValue:O,maxValue:I,minColor:x,medianColor:w,maxColor:E})}}),g.jsx(Sr,{id:"min",className:`${P.mLXxs}`,value:b,type:s,onChange:S=>{y(S),F({minType:s,medianType:f,maxType:h,minValue:S,medianValue:O,maxValue:I,minColor:x,medianColor:w,maxColor:E})}}),g.jsx(Qe,{className:P.mLXxs,color:x,onChange:S=>{m(S),F({minType:s,medianType:f,maxType:h,minValue:b,medianValue:O,maxValue:I,minColor:S,medianColor:w,maxColor:E})}})]}),g.jsx("div",{className:P.label,children:n.t("sheet.cf.panel.medianValue")}),g.jsxs("div",{className:`${P.labelContainer} ${P.mTSm}`,children:[g.jsx($.Select,{style:{flexShrink:0},options:i,value:f,onChange:S=>{p(S);const M=l.createDefaultValueByValueType(S,50);C(M),F({minType:s,medianType:S,maxType:h,minValue:b,medianValue:M,maxValue:I,minColor:x,medianColor:w,maxColor:E})}}),g.jsx(Sr,{id:"median",className:` ${P.mLXxs}`,value:O,type:f,onChange:S=>{C(S),F({minType:s,medianType:f,maxType:h,minValue:b,medianValue:S,maxValue:I,minColor:x,medianColor:w,maxColor:E})}}),f!=="none"&&g.jsx(Qe,{className:P.mLXxs,color:w,onChange:S=>{T(S),F({minType:s,medianType:f,maxType:h,minValue:b,medianValue:O,maxValue:I,minColor:x,medianColor:S,maxColor:E})}})]}),g.jsx("div",{className:P.label,children:n.t("sheet.cf.valueType.max")}),g.jsxs("div",{className:`${P.labelContainer} ${P.mTSm}`,children:[g.jsx($.Select,{style:{flexShrink:0},options:u,value:h,onChange:S=>{v(S);const M=l.createDefaultValueByValueType(S,90);R(M),F({minType:s,medianType:f,maxType:S,minValue:b,medianValue:O,maxValue:M,minColor:x,medianColor:w,maxColor:E})}}),g.jsx(Sr,{id:"max",className:`${P.mLXxs}`,value:I,type:h,onChange:S=>{R(S),F({minType:s,medianType:f,maxType:h,minValue:b,medianValue:O,maxValue:S,minColor:x,medianColor:w,maxColor:E})}}),g.jsx(Qe,{className:P.mLXxs,color:E,onChange:S=>{N(S),F({minType:s,medianType:f,maxType:h,minValue:b,medianValue:O,maxValue:I,minColor:x,medianColor:w,maxColor:S})}})]})]})},ct=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),Lo=t=>{var y;const{onChange:e,className:n,value:r,type:o,id:a,disabled:i=!1}=t,u=d.useDependency(d.IUniverInstanceService),s=u.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),c=(y=u.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:y.getSheetId(),f=_.useRef({}),[p,h]=_.useState(!1);ge.useSidebarClick(O=>{var I;const C=(I=f.current)==null?void 0:I.handleOutClick;C&&C(O,()=>h(!1))});const v=_.useRef(r),b=_.useMemo(()=>[l.CFValueType.percentile,l.CFValueType.percent].includes(o)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[o]);if(o===l.CFValueType.formula){const O=String(v.current).startsWith("=")?String(v.current)||"":"=";return g.jsx("div",{style:{width:"100%",marginLeft:12},children:g.jsx(pt.FormulaEditor,{initValue:O,unitId:s,subUnitId:c,isFocus:p,onChange:(C="")=>{e(C||"")},onFocus:()=>h(!0),actions:f.current})})}return g.jsx($.InputNumber,{className:n,value:Number(r)||0,disabled:i,onChange:O=>{e(O||0)},...b})},nl=t=>{var X;const{interceptorManager:e}=t,n=d.useDependency(d.LocaleService),r=((X=t.rule)==null?void 0:X.type)===l.CFRuleType.dataBar?t.rule:void 0,[o,a]=_.useState(()=>{var M;const S="0";return r?(M=r.config)!=null&&M.isGradient?"1":"0":S}),[i,u]=_.useState(()=>{var S;return r&&((S=r.config)==null?void 0:S.positiveColor)||l.defaultDataBarPositiveColor}),[s,c]=_.useState(()=>{var S;return r&&((S=r.config)==null?void 0:S.nativeColor)||l.defaultDataBarNativeColor}),f=[ct(l.CFValueType.num,n),ct(l.CFValueType.percent,n),ct(l.CFValueType.percentile,n),ct(l.CFValueType.formula,n)],p=[ct(l.CFValueType.min,n),...f],h=[ct(l.CFValueType.max,n),...f],[v,b]=_.useState(()=>{var M;const S=p[0].value;return r&&((M=r.config)==null?void 0:M.min.type)||S}),[y,O]=_.useState(()=>{var M;const S=h[0].value;return r&&((M=r.config)==null?void 0:M.max.type)||S}),[C,I]=_.useState(()=>{var W;if(!r)return 0;const M=((W=r.config)==null?void 0:W.min)||{};return M.type===l.CFValueType.formula?M.value||"=":M.value||0}),[R,x]=_.useState(()=>{var W;if(!r)return 100;const M=((W=r.config)==null?void 0:W.max)||{};return M.type===l.CFValueType.formula?M.value||"=":M.value===void 0?100:M.value}),[m,w]=_.useState(()=>r?r.isShowValue===void 0?!0:!!r.isShowValue:!0),T=S=>({config:{min:{type:S.minValueType,value:S.minValue},max:{type:S.maxValueType,value:S.maxValue},isGradient:S.isGradient==="1",positiveColor:S.positiveColor||l.defaultDataBarPositiveColor,nativeColor:S.nativeColor||l.defaultDataBarNativeColor},type:l.CFRuleType.dataBar,isShowValue:S.isShowValue});_.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return T({isGradient:o,minValue:C,minValueType:v,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:m})}}),[o,C,v,R,y,i,s,e,m]);const E=S=>{t.onChange(T(S))},N=S=>{u(S),E({isGradient:o,minValue:C,minValueType:v,maxValue:R,maxValueType:y,positiveColor:S,nativeColor:s,isShowValue:m})},U=S=>{c(S),E({isGradient:o,minValue:C,minValueType:v,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:S,isShowValue:m})},F=S=>f.map(M=>M.value).includes(S);return g.jsxs("div",{children:[g.jsx("div",{className:P.title,children:n.t("sheet.cf.panel.styleRule")}),g.jsx("div",{className:`${j.cfPreviewWrap}`,children:g.jsx(lt,{rule:T({isGradient:o,minValue:C,minValueType:v,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:m})})}),g.jsxs("div",{children:[g.jsx("div",{className:P.label,children:n.t("sheet.cf.panel.fillType")}),g.jsxs("div",{className:`${P.mTSm} ${P.mLXxs} ${P.labelContainer} `,children:[g.jsxs($.RadioGroup,{value:o,onChange:S=>{a(S),E({isGradient:S,minValue:C,minValueType:v,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:m})},children:[g.jsx($.Radio,{value:"0",children:g.jsx("span",{className:j.text,children:n.t("sheet.cf.panel.pureColor")})}),g.jsx($.Radio,{value:"1",children:g.jsx("span",{className:j.text,children:n.t("sheet.cf.panel.gradient")})})]}),g.jsxs("div",{className:`${j.utilItem} ${P.mLXl}`,children:[g.jsx($.Checkbox,{checked:!m,onChange:S=>{w(!S),E({isGradient:S,minValue:C,minValueType:v,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:!S})}}),n.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),g.jsxs("div",{children:[g.jsx("div",{className:P.label,children:n.t("sheet.cf.panel.colorSet")}),g.jsxs("div",{className:`${P.labelContainer} ${P.mTSm} ${P.mLXxs}`,children:[g.jsxs("div",{className:`${P.labelContainer}`,children:[g.jsx("div",{className:`${j.text}`,children:n.t("sheet.cf.panel.native")}),g.jsx(Qe,{color:s,onChange:U})]}),g.jsxs("div",{className:`${P.labelContainer} ${P.mLSm} `,children:[g.jsx("div",{className:`${j.text} `,children:n.t("sheet.cf.panel.positive")}),g.jsx(Qe,{color:i,onChange:N})]})]})]}),g.jsxs("div",{children:[g.jsx("div",{className:P.label,children:n.t("sheet.cf.valueType.min")}),g.jsxs("div",{className:`${P.mTSm} ${P.labelContainer}`,children:[g.jsx($.Select,{style:{width:"50%",flexShrink:0},options:p,value:v,onChange:S=>{b(S);const M=l.createDefaultValueByValueType(S,10);I(M),E({isGradient:o,minValue:M,minValueType:S,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:m})}}),g.jsx(Lo,{disabled:!F(v),id:"min",type:v,className:P.mLSm,value:C,onChange:S=>{I(S||0),E({isGradient:o,minValue:S||0,minValueType:v,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:m})}})]}),g.jsx("div",{className:P.label,children:n.t("sheet.cf.valueType.max")}),g.jsxs("div",{className:`${P.mTSm} ${P.labelContainer}`,children:[g.jsx($.Select,{style:{width:"50%",flexShrink:0},options:h,value:y,onChange:S=>{O(S);const M=l.createDefaultValueByValueType(S,90);x(M),E({isGradient:o,minValue:C,minValueType:v,maxValue:M,maxValueType:S,positiveColor:i,nativeColor:s,isShowValue:m})}}),g.jsx(Lo,{disabled:!F(y),id:"max",type:y,className:P.mLSm,value:R,onChange:S=>{x(S||0),E({isGradient:o,minValue:C,minValueType:v,maxValue:S||0,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:m})}})]})]})]})};function Vo(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=Vo(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function cn(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=Vo(t))&&(r&&(r+=" "),r+=e);return r}const Ae={cfStyleEdit:"univer-cf-style-edit",buttonItem:"univer-button-item",isActive:"univer-isActive"},dn=t=>[d.BooleanNumber.FALSE,void 0].includes(t)?d.BooleanNumber.TRUE:d.BooleanNumber.FALSE,fn=t=>t!==d.BooleanNumber.FALSE,br=t=>{const{style:e,onChange:n,className:r}=t,o=d.useDependency(ge.ComponentManager),[a,i]=_.useState(()=>{if(e!=null&&e.bl)return e.bl}),[u,s]=_.useState(()=>{if(e!=null&&e.it)return e.it}),[c,f]=_.useState(()=>{if(e!=null&&e.ul)return e.ul.s}),[p,h]=_.useState(()=>{if(e!=null&&e.st)return e.st.s}),[v,b]=_.useState(()=>{var w;const m="#2f56ef";return(w=e==null?void 0:e.cl)!=null&&w.rgb?e.cl.rgb:m}),[y,O]=_.useState(()=>{var w;const m="#e8ecfc";return(w=e==null?void 0:e.bg)!=null&&w.rgb?e.bg.rgb:m}),C=o.get("BoldSingle"),I=o.get("ItalicSingle"),R=o.get("UnderlineSingle"),x=o.get("StrikethroughSingle");return _.useEffect(()=>{const m={bl:a,it:u};v!==void 0&&(m.cl={rgb:v}),y!==void 0&&(m.bg={rgb:y}),p!==void 0&&(m.st={s:p}),c!==void 0&&(m.ul={s:c}),n(l.removeUndefinedAttr(m))},[a,u,c,p,v,y]),g.jsxs("div",{className:`${Ae.cfStyleEdit} ${r}`,children:[C&&g.jsx("div",{className:cn({[Ae.isActive]:fn(a||d.BooleanNumber.FALSE)},Ae.buttonItem),onClick:()=>i(dn(a)),children:g.jsx(C,{})}),I&&g.jsx("div",{className:cn({[Ae.isActive]:fn(u||d.BooleanNumber.FALSE)},Ae.buttonItem),onClick:()=>s(dn(u)),children:g.jsx(I,{})}),R&&g.jsx("div",{className:cn({[Ae.isActive]:fn(c||d.BooleanNumber.FALSE)},Ae.buttonItem),onClick:()=>f(dn(c)),children:g.jsx(R,{})}),x&&g.jsx("div",{className:cn({[Ae.isActive]:fn(p||d.BooleanNumber.FALSE)},Ae.buttonItem),onClick:()=>h(dn(p)),children:g.jsx(x,{})}),g.jsx(Qe,{color:v,onChange:b,iconId:"FontColor"}),g.jsx(Qe,{color:y,onChange:O,iconId:"PaintBucket"})]})},rl=t=>{var x;const{onChange:e,interceptorManager:n}=t,r=d.useDependency(d.LocaleService),a=d.useDependency(d.IUniverInstanceService).getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET),i=a.getActiveSheet(),u=((x=t.rule)==null?void 0:x.type)===l.CFRuleType.highlightCell?t.rule:void 0,s=_.useRef(null),[c,f]=_.useState(!1),p=_.useRef({}),[h,v]=_.useState({}),[b,y]=_.useState(()=>(u==null?void 0:u.subType)===l.CFSubRuleType.formula?u.value:"="),[O,C]=_.useState(void 0),I=m=>({style:m.style,value:b,type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.formula});_.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return I({style:h,formula:b})}}),[h,b,n]),_.useEffect(()=>n.intercept(n.getInterceptPoints().beforeSubmit,{handler:(w,T,E)=>O||b.length===1||!b.startsWith("=")?(C(r.t("sheet.cf.errorMessage.formulaError")),!1):E(w)}),[O,b]);const R=m=>{e(I(m))};return ge.useSidebarClick(m=>{var T;const w=(T=p.current)==null?void 0:T.handleOutClick;w&&w(m,()=>f(!1))}),g.jsxs("div",{ref:s,children:[g.jsx("div",{className:`${P.title} ${P.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),g.jsx("div",{className:`${P.mTSm}`,children:g.jsx(pt.FormulaEditor,{onChange:m=>{y(m),R({style:h,formula:m})},onVerify:(m,w)=>{!m||w.length===1?C(r.t("sheet.cf.errorMessage.formulaError")):C(void 0)},errorText:O,onFocus:()=>{f(!0)},actions:p.current,isFocus:c,initValue:b,unitId:a.getUnitId(),subUnitId:i==null?void 0:i.getSheetId()})}),g.jsx("div",{className:`${j.cfPreviewWrap} `,children:g.jsx(lt,{rule:I({style:h,formula:b})})}),g.jsx(br,{style:u==null?void 0:u.style,className:`${P.mTSm} `,onChange:m=>{v(m),R({style:m,formula:b})}})]})},pn=t=>g.jsxs("div",{style:{position:"relative"},children:[g.jsx("div",{style:{position:"absolute",zIndex:999,bottom:"-13px",fontSize:"10px",color:"red"},children:t.errorText}),t.children]}),ee=(t,e)=>({label:e.t(`sheet.cf.operator.${t}`),value:t}),ol=t=>{const{type:e,operator:n,onChange:r,value:o,interceptorManager:a}=t,i=d.useDependency(d.LocaleService),[u,s]=_.useState(()=>typeof o=="number"?o:0),[c,f]=_.useState(""),[p,h]=_.useState(()=>typeof o=="string"?o:""),[v,b]=_.useState(""),[y,O]=_.useState(()=>Array.isArray(o)?o[0]===void 0?0:o[0]:0),[C,I]=_.useState(""),[R,x]=_.useState(()=>Array.isArray(o)?o[1]===void 0?100:o[1]:100),[m,w]=_.useState("");switch(_.useEffect(()=>{switch(e){case l.CFSubRuleType.text:{[l.CFTextOperator.beginsWith,l.CFTextOperator.endsWith,l.CFTextOperator.containsText,l.CFTextOperator.notContainsText,l.CFTextOperator.equal,l.CFTextOperator.notEqual].includes(n)&&r(p);break}case l.CFSubRuleType.number:{[l.CFNumberOperator.equal,l.CFNumberOperator.notEqual,l.CFNumberOperator.greaterThan,l.CFNumberOperator.greaterThanOrEqual,l.CFNumberOperator.lessThan,l.CFNumberOperator.lessThanOrEqual].includes(n)&&r(u),[l.CFNumberOperator.between,l.CFNumberOperator.notBetween].includes(n)&&r([y,R]);break}}},[e]),_.useEffect(()=>{const T=a.intercept(a.getInterceptPoints().beforeSubmit,{handler:(E,N,U)=>{switch(e){case l.CFSubRuleType.text:if([l.CFTextOperator.beginsWith,l.CFTextOperator.containsText,l.CFTextOperator.endsWith,l.CFTextOperator.notEqual,l.CFTextOperator.notContainsText,l.CFTextOperator.equal].includes(n))return p?U(E):(b(i.t("sheet.cf.errorMessage.notBlank")),!1)}return U(E)}});return()=>{T()}},[e,u,p,n]),e){case l.CFSubRuleType.text:{if([l.CFTextOperator.beginsWith,l.CFTextOperator.endsWith,l.CFTextOperator.containsText,l.CFTextOperator.notContainsText,l.CFTextOperator.equal,l.CFTextOperator.notEqual].includes(n)){const T=E=>{h(E),r(E)};return g.jsx("div",{className:`${P.mTSm}`,children:g.jsx(pn,{errorText:v,children:g.jsx($.Input,{className:j.width100,value:p,onChange:E=>{b(""),T(E)}})})})}break}case l.CFSubRuleType.number:{if([l.CFNumberOperator.equal,l.CFNumberOperator.notEqual,l.CFNumberOperator.greaterThan,l.CFNumberOperator.greaterThanOrEqual,l.CFNumberOperator.lessThan,l.CFNumberOperator.lessThanOrEqual].includes(n)){const T=E=>{s(E||0),r(E||0),f("")};return g.jsx("div",{className:`${P.mTSm}`,children:g.jsx(pn,{errorText:c,children:g.jsx($.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:j.width100,value:u,onChange:T})})})}if([l.CFNumberOperator.between,l.CFNumberOperator.notBetween].includes(n)){const T=N=>{O(N||0),r([N||0,R]),I("")},E=N=>{x(N||0),r([y,N||0]),w("")};return g.jsxs("div",{className:`${P.mTSm} ${P.labelContainer} `,children:[g.jsx(pn,{errorText:C,children:g.jsx($.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:y,onChange:T})}),g.jsx(pn,{errorText:m,children:g.jsx($.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`${P.mLSm}`,value:R,onChange:E})})]})}}}return null},Uo=(t,e)=>{switch(t){case l.CFSubRuleType.text:return[ee(l.CFTextOperator.containsText,e),ee(l.CFTextOperator.notContainsText,e),ee(l.CFTextOperator.beginsWith,e),ee(l.CFTextOperator.endsWith,e),ee(l.CFTextOperator.equal,e),ee(l.CFTextOperator.notEqual,e),ee(l.CFTextOperator.containsBlanks,e),ee(l.CFTextOperator.notContainsBlanks,e),ee(l.CFTextOperator.containsErrors,e),ee(l.CFTextOperator.notContainsErrors,e)];case l.CFSubRuleType.number:return[ee(l.CFNumberOperator.between,e),ee(l.CFNumberOperator.notBetween,e),ee(l.CFNumberOperator.equal,e),ee(l.CFNumberOperator.notEqual,e),ee(l.CFNumberOperator.greaterThan,e),ee(l.CFNumberOperator.greaterThanOrEqual,e),ee(l.CFNumberOperator.lessThan,e),ee(l.CFNumberOperator.lessThanOrEqual,e)];case l.CFSubRuleType.timePeriod:return[ee(l.CFTimePeriodOperator.yesterday,e),ee(l.CFTimePeriodOperator.today,e),ee(l.CFTimePeriodOperator.tomorrow,e),ee(l.CFTimePeriodOperator.last7Days,e),ee(l.CFTimePeriodOperator.lastWeek,e),ee(l.CFTimePeriodOperator.thisWeek,e),ee(l.CFTimePeriodOperator.nextWeek,e),ee(l.CFTimePeriodOperator.lastMonth,e),ee(l.CFTimePeriodOperator.thisMonth,e),ee(l.CFTimePeriodOperator.nextMonth,e)]}},zo=t=>{var x;const{interceptorManager:e,onChange:n}=t,r=d.useDependency(d.LocaleService),o=((x=t.rule)==null?void 0:x.type)===l.CFRuleType.highlightCell?t.rule:void 0,[a,i]=_.useState(()=>{const m=l.CFSubRuleType.text;return o&&o.subType||m}),u=[{value:l.CFSubRuleType.text,label:r.t("sheet.cf.subRuleType.text")},{value:l.CFSubRuleType.number,label:r.t("sheet.cf.subRuleType.number")},{value:l.CFSubRuleType.timePeriod,label:r.t("sheet.cf.subRuleType.timePeriod")},{value:l.CFSubRuleType.duplicateValues,label:r.t("sheet.cf.subRuleType.duplicateValues")},{value:l.CFSubRuleType.uniqueValues,label:r.t("sheet.cf.subRuleType.uniqueValues")}],s=_.useMemo(()=>Uo(a,r),[a]),[c,f]=_.useState(()=>{const m=s?s[0].value:void 0;return o&&o.operator||m}),[p,h]=_.useState(()=>{var T;const m="";return o?(T=o.value)!=null?T:l.createDefaultValue(o.subType,o.operator):m}),[v,b]=_.useState({}),y=_.useMemo(()=>m=>{var w,T,E,N,U,F,X,S,M,W,te,q,de,se,z;switch(m.subType||a){case l.CFSubRuleType.text:{if([l.CFTextOperator.beginsWith,l.CFTextOperator.endsWith,l.CFTextOperator.containsText,l.CFTextOperator.notContainsText,l.CFTextOperator.equal,l.CFTextOperator.notEqual].includes(c))return{type:l.CFRuleType.highlightCell,subType:(w=m.subType)!=null?w:a,operator:(T=m.operator)!=null?T:c,style:(E=m.style)!=null?E:v,value:(N=m.value)!=null?N:p};break}case l.CFSubRuleType.number:{if([l.CFNumberOperator.equal,l.CFNumberOperator.notEqual,l.CFNumberOperator.greaterThan,l.CFNumberOperator.greaterThanOrEqual,l.CFNumberOperator.lessThan,l.CFNumberOperator.lessThanOrEqual].includes(c))return{type:l.CFRuleType.highlightCell,subType:(U=m.subType)!=null?U:a,operator:(F=m.operator)!=null?F:c,style:(X=m.style)!=null?X:v,value:(S=m.value)!=null?S:p};if([l.CFNumberOperator.between,l.CFNumberOperator.notBetween].includes(c))return{type:l.CFRuleType.highlightCell,subType:(M=m.subType)!=null?M:a,operator:(W=m.operator)!=null?W:c,style:(te=m.style)!=null?te:v,value:(q=m.value)!=null?q:p};break}}return{type:l.CFRuleType.highlightCell,subType:(de=m.subType)!=null?de:a,operator:(se=m.operator)!=null?se:c,style:(z=m.style)!=null?z:v}},[a,c,p,v]);_.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return y({})}}),[y,e]),_.useEffect(()=>{u.some(m=>m.value===a)||i(u[0].value)},[u]);const O=m=>{const w=m,T=Uo(w,r),E=T&&T[0].value;i(w),f(E),E&&h(l.createDefaultValue(w,E)),n(y({subType:w,operator:E}))},C=m=>{const w=m;f(w),n(y({operator:w}))},I=m=>{h(m),n(y({value:m}))},R=_.useMemo(()=>`${a}_${c}_${Math.random()}`,[a,c]);return g.jsxs("div",{children:[g.jsx("div",{className:`${P.title} ${P.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),g.jsx($.Select,{className:`${P.mTSm} ${j.width100}`,onChange:O,value:a,options:u}),(s==null?void 0:s.length)&&g.jsx($.Select,{className:`${P.mTSm} ${j.width100}`,onChange:C,value:c||"",options:s}),g.jsx(ol,{value:p,interceptorManager:e,type:a,operator:c,rule:o,onChange:I},R),g.jsx("div",{className:`${j.cfPreviewWrap}`,children:g.jsx(lt,{rule:y({})})}),g.jsx(br,{style:o==null?void 0:o.style,className:`${P.mLXxs}`,onChange:m=>{b(m),n(y({style:m}))}})]})},Ao=(t,e)=>(l.iconMap[t]||[])[Number(e)]||"",al=t=>{var s;const e=d.useDependency(d.IUniverInstanceService),n=e.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),r=(s=e.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:s.getSheetId(),o=_.useMemo(()=>t.error?j.errorInput:"",[t.error]),a=_.useRef({}),[i,u]=_.useState(!1);return ge.useSidebarClick(c=>{var p;const f=(p=a.current)==null?void 0:p.handleOutClick;f&&f(c,()=>u(!1))}),g.jsx("div",{className:j.positionRelative,children:t.type!==l.CFValueType.formula?g.jsxs(g.Fragment,{children:[g.jsx($.InputNumber,{className:o,value:Number(t.value)||0,onChange:c=>t.onChange(c!=null?c:0)}),t.error&&g.jsx("div",{className:j.errorText,children:t.error})]}):g.jsx("div",{style:{width:"100%"},children:g.jsx(pt.FormulaEditor,{initValue:String(t.value),unitId:n,subUnitId:r,isFocus:i,onChange:(c="")=>{const f=c||"";t.onChange(f)},onFocus:()=>u(!0),actions:a.current})})})},ko=(t,e,n)=>({operator:l.CFNumberOperator.greaterThan,value:{type:l.CFValueType.num,value:(n.length-1-e)*10},iconType:t,iconId:String(e)}),il=_.forwardRef((t,e)=>{const n=d.useDependency(d.LocaleService),r=o=>{t.onClick(o)};return g.jsx("div",{ref:e,className:j.iconGroupList,children:l.iconGroup.map((o,a)=>g.jsxs("div",{className:j.group,children:[g.jsx("div",{className:j.title,children:n.t(o.title)}),g.jsx("div",{className:j.itemContent,children:o.group.map(i=>g.jsx("div",{className:j.itemWrap,onClick:()=>{r(i.name)},children:g.jsx("div",{className:j.item,children:i.list.map((u,s)=>g.jsx("img",{className:j.icon,src:u},s))})},i.name))})]},a))})}),sl=t=>{const e=_.useMemo(()=>{const r=[];for(const o in l.iconMap){const a=l.iconMap[o],i=o;a.forEach((u,s)=>{r.push({iconType:i,base64:u,iconId:String(s)})})}return r},[]),n=r=>{t.onClick(r.iconType,r.iconId)};return g.jsxs("div",{className:j.iconItemListWrap,children:[g.jsxs("div",{className:j.none,onClick:()=>n({iconType:l.EMPTY_ICON_TYPE,iconId:"",base64:""}),children:[g.jsx(mt,{className:j.icon}),g.jsx("span",{children:"无单元格图标"})]}),g.jsx("div",{className:j.iconItemList,children:e.map(r=>g.jsx("div",{className:j.item,children:g.jsx("img",{onClick:()=>n(r),className:`${j.icon}`,src:r.base64})},`${r.iconType}_${r.iconId}`))})]})},ll=t=>{const{onChange:e,configList:n,errorMap:r={}}=t,o=d.useDependency(d.LocaleService),a=[{label:o.t(`sheet.cf.symbol.${l.CFNumberOperator.greaterThan}`),value:l.CFNumberOperator.greaterThan},{label:o.t(`sheet.cf.symbol.${l.CFNumberOperator.greaterThanOrEqual}`),value:l.CFNumberOperator.greaterThanOrEqual}],i=[{label:o.t(`sheet.cf.valueType.${l.CFValueType.num}`),value:l.CFValueType.num},{label:o.t(`sheet.cf.valueType.${l.CFValueType.percent}`),value:l.CFValueType.percent},{label:o.t(`sheet.cf.valueType.${l.CFValueType.percentile}`),value:l.CFValueType.percentile},{label:o.t(`sheet.cf.valueType.${l.CFValueType.formula}`),value:l.CFValueType.formula}],u=(p,h)=>{e([String(h),"value","value"],p)},s=(p,h)=>{e([String(h),"operator"],p);const v=l.createDefaultValue(l.CFSubRuleType.number,p);u(v,h)},c=(p,h)=>{e([String(h),"value","type"],p);const v=n[h],b=l.createDefaultValue(l.CFSubRuleType.number,v.operator);u(b,h)};return _.useMemo(()=>n.map((p,h)=>{const v=r[h],b=Ao(p.iconType,p.iconId),y=h===n.length-1,O=h===0,C=n[h-1],I=(C==null?void 0:C.value.type)===l.CFValueType.formula?o.t("sheet.cf.valueType.formula"):C==null?void 0:C.value.value,R=(x,m)=>{const w={...p,iconId:m,iconType:x};e([String(h)],w)};return g.jsxs("div",{className:`${h?P.mTXl:P.mTSm}`,children:[g.jsxs("div",{className:`${P.label} ${j.flex}`,children:[g.jsxs("div",{className:`${j.width45}`,children:[o.t("sheet.cf.iconSet.icon"),h+1]}),g.jsx("div",{className:`${j.width45}`,children:g.jsxs(g.Fragment,{children:[!O&&!y&&o.t("sheet.cf.iconSet.rule"),!O&&!y&&g.jsxs("span",{className:j.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${l.getOppositeOperator(C.operator)}`),I,y?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),g.jsxs("div",{className:`${j.flex} ${P.mTSm}`,children:[g.jsx("div",{className:`${j.iconWrap} ${j.width45}`,children:g.jsx($.Dropdown,{overlay:g.jsx(sl,{onClick:R,iconId:p.iconId,iconType:p.iconType}),children:g.jsxs("div",{className:j.dropdownIcon,children:[b?g.jsx("img",{src:b,className:j.icon}):g.jsx(mt,{className:j.icon}),g.jsx(At,{})]})})}),y?g.jsxs("div",{className:`${j.width45} ${P.label}`,style:{marginTop:0},children:[o.t("sheet.cf.iconSet.rule"),g.jsxs("span",{className:j.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${l.getOppositeOperator(C.operator)}`),I,y?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]}):g.jsx($.Select,{className:`${P.mL0} ${j.width45} ${P.mR0}`,options:a,value:p.operator,onChange:x=>{s(x,h)}})]}),y?g.jsx("div",{}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:`${P.mTSm} ${P.label} ${j.flex}`,children:[g.jsx("div",{className:`${j.width45}`,children:o.t("sheet.cf.iconSet.type")}),g.jsx("div",{className:`${j.width45}`,children:o.t("sheet.cf.iconSet.value")})]}),g.jsxs("div",{className:`${P.mTSm} ${j.flex}`,children:[g.jsx($.Select,{style:{flexShrink:0},className:`${j.width45} ${P.mL0}`,options:i,value:p.value.type,onChange:x=>{c(x,h)}}),g.jsx("div",{className:`${P.mL0} ${j.width45}`,children:g.jsx(al,{id:h,type:p.value.type,error:v,value:p.value.value||"",onChange:x=>u(x,h)})})]})]})]},h)}),[n,r])},ul=t=>{var x;const{interceptorManager:e}=t,n=((x=t.rule)==null?void 0:x.type)===l.CFRuleType.iconSet?t.rule:void 0,r=d.useDependency(d.LocaleService),[o,a]=_.useState({}),[i,u]=_.useState(()=>{const m=Object.keys(l.iconMap)[0];if(n&&n.config.length){const w=n.config[0].iconType;if(!n.config.some(E=>E.iconType!==w))return w}return m}),[s,c]=_.useState(()=>{if(n&&n.config.length)return d.Tools.deepClone(n==null?void 0:n.config);const m=l.iconMap[i]||[];return new Array(m.length).fill("").map((w,T,E)=>T===E.length-1?{operator:l.CFNumberOperator.lessThanOrEqual,value:{type:l.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:i,iconId:String(T)}:ko(i,T,E))}),[f,p]=_.useState(()=>n?!!n.isShowValue:!0),h=_.useMemo(()=>{const m=s.map(w=>Ao(w.iconType,w.iconId));return g.jsx("div",{className:j.iconWrap,children:m.map((w,T)=>w?g.jsx("img",{className:j.icon,src:w},T):g.jsx(mt,{className:j.icon},T))})},[s]),v=m=>{if(m.reduce((T,E,N)=>T.preType&&!T.result||m.length-1===N?T:E.value.type===l.CFValueType.formula?{preType:l.CFValueType.formula,result:!1}:T.preType?{result:T.preType===E.value.type,preType:E.value.type}:{result:!0,preType:E.value.type},{result:!0,preType:""}).result&&[l.CFValueType.num,l.CFValueType.percent,l.CFValueType.percentile].includes(m[0].value.type)){const T={};return m.forEach((E,N,U)=>{if(N-1<0||N===U.length-1)return;const X=m[N-1],S=l.getOppositeOperator(X.operator);l.compareWithNumber({operator:S,value:X.value.value},E.value.value)||(T[N]=`${r.t(`sheet.cf.form.${S}`,String(X.value.value))} `)}),T}return{}},b=(m,w)=>{d.get(s,m)!==w&&(d.set(s,m,w),c([...s]),a(v(s)))},y=m=>{u(m);const w=l.iconMap[m]||[],T=new Array(w.length).fill("").map((E,N,U)=>ko(m,N,U));c(T),a(v(T))};_.useEffect(()=>{const m=e.intercept(e.getInterceptPoints().submit,{handler(){return{type:l.CFRuleType.iconSet,isShowValue:f,config:s}}});return()=>{m()}},[f,s,e]),_.useEffect(()=>{const m=e.intercept(e.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(o).length===0}});return()=>{m()}},[f,s,e,o]);const O=()=>{const m=s.map(w=>({...w}));s.forEach((w,T)=>{const E=s.length-1-T,N=m[E];w.iconId=N.iconId,w.iconType=N.iconType}),c([...s])},C=d.useDependency(ge.ILayoutService),[I,R]=_.useState();return ge.useScrollYOverContainer(I,C.rootContainerElement),g.jsxs("div",{className:j.iconSet,children:[g.jsx("div",{className:P.title,children:r.t("sheet.cf.panel.styleRule")}),g.jsx("div",{className:`${P.mTSm}`,children:g.jsx($.Dropdown,{placement:"bottomLeft",overlay:g.jsx(il,{ref:m=>!I&&m&&R(m),iconType:i,onClick:y}),children:g.jsxs("div",{className:j.dropdownIcon,style:{width:"unset"},children:[h,g.jsx(At,{})]})})}),g.jsxs("div",{className:`${P.mTSm} ${j.renderConfig}`,children:[g.jsxs("div",{className:j.utilItem,children:[g.jsx($.Checkbox,{onChange:O}),r.t("sheet.cf.iconSet.reverseIconOrder")]}),g.jsxs("div",{className:`${j.utilItem} ${P.mLXl}`,children:[g.jsx($.Checkbox,{checked:!f,onChange:m=>{p(!m)}}),r.t("sheet.cf.iconSet.onlyShowIcon")]})]}),g.jsx(ll,{errorMap:o,onChange:b,configList:s})]})},cl=t=>{var O;const{onChange:e,interceptorManager:n}=t,r=d.useDependency(d.LocaleService),o=((O=t.rule)==null?void 0:O.type)===l.CFRuleType.highlightCell?t.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,u]=_.useState(()=>{const C=a[0].value,I=o==null?void 0:o.type;if(!o)return C;switch(I){case l.CFRuleType.highlightCell:switch(o.subType){case l.CFSubRuleType.average:return[l.CFNumberOperator.greaterThan,l.CFNumberOperator.greaterThanOrEqual].includes(o.operator)?"greaterThanAverage":[l.CFNumberOperator.lessThan,l.CFNumberOperator.lessThanOrEqual].includes(o.operator)?"lessThanAverage":C;case l.CFSubRuleType.rank:return o.isBottom?"isBottom":"isNotBottom"}}return C}),[s,c]=_.useState(()=>{const I=o==null?void 0:o.type;if(!o)return 10;switch(I){case l.CFRuleType.highlightCell:switch(o.subType){case l.CFSubRuleType.rank:return o.value||10}}return 10}),[f,p]=_.useState(()=>{const I=o==null?void 0:o.type;if(!o)return!1;switch(I){case l.CFRuleType.highlightCell:switch(o.subType){case l.CFSubRuleType.rank:return o.isPercent||!1}}return!1}),[h,v]=_.useState({}),b=C=>{const{type:I,isPercent:R,value:x,style:m}=C;if(I==="isNotBottom")return{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.rank,isPercent:R,isBottom:!1,value:x,style:m};if(I==="isBottom")return{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.rank,isPercent:R,isBottom:!0,value:x,style:m};if(I==="greaterThanAverage")return{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.average,operator:l.CFNumberOperator.greaterThan,style:m};if(I==="lessThanAverage")return{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.average,operator:l.CFNumberOperator.lessThan,style:m}};_.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return b({type:i,isPercent:f,value:s,style:h})}}),[i,f,s,h,n]);const y=C=>{e(b(C))};return g.jsxs("div",{children:[g.jsx("div",{className:`${P.title} ${P.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),g.jsx($.Select,{className:`${j.width100} ${P.mTSm}`,value:i,options:a,onChange:C=>{u(C),y({type:C,isPercent:f,value:s,style:h})}}),["isNotBottom","isBottom"].includes(i)&&g.jsxs("div",{className:`${P.labelContainer} ${P.mTSm}`,children:[g.jsx($.InputNumber,{min:1,max:1e3,value:s,onChange:C=>{const I=C||0;c(I),y({type:i,isPercent:f,value:I,style:h})}}),g.jsxs("div",{className:`${P.mLSm} ${P.labelContainer} ${j.text}`,children:[g.jsx($.Checkbox,{checked:f,onChange:C=>{p(!!C),y({type:i,isPercent:!!C,value:s,style:h})}}),r.t("sheet.cf.valueType.percent")]})]}),g.jsx("div",{className:`${j.cfPreviewWrap} `,children:g.jsx(lt,{rule:b({type:i,isPercent:f,value:s,style:h})})}),g.jsx(br,{style:o==null?void 0:o.style,className:`${P.mTSm} `,onChange:C=>{v(C),y({type:i,isPercent:f,value:s,style:C})}})]})},dl=d.createInterceptorKey("beforeSubmit"),fl=d.createInterceptorKey("submit"),Wo=t=>t.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),Ho=t=>{var e;return(e=t.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()},pl=t=>{var U,F,X;const e=d.useDependency(d.LocaleService),n=d.useDependency(d.ICommandService),r=d.useDependency(d.IUniverInstanceService),o=d.useDependency(l.ConditionalFormattingRuleModel),a=d.useDependency(L.SheetsSelectionsService),i=Wo(r),u=Ho(r),[s,c]=_.useState(!0),f=_.useRef({}),[p,h]=_.useState(void 0),v=_.useRef((F=(U=t.rule)==null?void 0:U.ranges)!=null?F:[]),b=_.useMemo(()=>{var M,W,te;let S=(M=t.rule)==null?void 0:M.ranges;return S!=null&&S.length||(S=(te=(W=a.getCurrentSelections())==null?void 0:W.map(q=>q.range))!=null?te:[]),v.current=S,S!=null&&S.length?S.map(q=>{const de=bn.serializeRange(q);return de==="NaN"?"":de}).filter(q=>!!q).join(","):""},[t.rule]),y=[{label:e.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:e.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:e.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:e.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:e.t("sheet.cf.ruleType.formula"),value:"5"},{label:e.t("sheet.cf.ruleType.iconSet"),value:"6"}],[O,C]=_.useState(()=>{var W,te;const S=(W=t.rule)==null?void 0:W.rule.type,M=y[0].value;if(!S)return M;switch(S){case l.CFRuleType.highlightCell:{switch((te=t.rule)==null?void 0:te.rule.subType){case l.CFSubRuleType.number:case l.CFSubRuleType.text:case l.CFSubRuleType.duplicateValues:case l.CFSubRuleType.uniqueValues:case l.CFSubRuleType.timePeriod:return"1";case l.CFSubRuleType.average:case l.CFSubRuleType.rank:return"2";case l.CFSubRuleType.formula:return"5"}break}case l.CFRuleType.dataBar:return"3";case l.CFRuleType.colorScale:return"4";case l.CFRuleType.iconSet:return"6"}return M}),I=_.useRef(),R=_.useMemo(()=>new d.InterceptorManager({beforeSubmit:dl,submit:fl}),[]),x=_.useMemo(()=>{switch(O){case"1":return zo;case"2":return cl;case"3":return nl;case"4":return tl;case"5":return rl;case"6":return ul;default:return zo}},[O]);_.useEffect(()=>{const S=n.onCommandExecuted(M=>{if(M.id===L.RemoveSheetMutation.id){const W=M.params;W.subUnitId===u&&W.unitId===i&&t.onCancel()}M.id===L.SetWorksheetActiveOperation.id&&t.onCancel()});return()=>S.dispose()},[]);const m=S=>{I.current=S},w=S=>{const M=S.split(",").filter(W=>!!W).map(bn.deserializeRangeWithSheet).map(W=>W.range);v.current=M},T=()=>{if(p)return;const M=(()=>{const te=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!te)throw new Error("No active sheet found");return v.current.map(se=>L.setEndForRange(se,te.getRowCount(),te.getColumnCount())).filter(se=>!(Number.isNaN(se.startRow)||Number.isNaN(se.startColumn)))})();if(R.fetchThroughInterceptors(R.getInterceptPoints().beforeSubmit)(!0,null)){const te=R.fetchThroughInterceptors(R.getInterceptPoints().submit)(null,null);if(te){const q=Wo(r),de=Ho(r);if(!q||!de)throw new Error("No active sheet found");let se={};t.rule&&t.rule.cfId?(se={...t.rule,ranges:M,rule:te},n.executeCommand(un.id,{unitId:q,subUnitId:de,rule:se}),t.onCancel()):(se={cfId:o.createCfId(q,de),ranges:M,rule:te,stopIfTrue:!1},n.executeCommand(wt.id,{unitId:q,subUnitId:de,rule:se}),t.onCancel())}}},E=()=>{t.onCancel()},N=(S,M)=>{S?M.length<1?h(e.t("sheet.cf.errorMessage.rangeError")):h(void 0):h(e.t("sheet.cf.errorMessage.rangeError"))};return ge.useSidebarClick(S=>{var W;const M=(W=f.current)==null?void 0:W.handleOutClick;M&&M(S,()=>c(!1))}),g.jsxs("div",{className:j.cfRuleStyleEditor,children:[g.jsx("div",{className:P.title,children:e.t("sheet.cf.panel.range")}),g.jsx("div",{className:`${P.mTBase}`,children:g.jsx(pt.RangeSelector,{unitId:i,errorText:p,subUnitId:u,initValue:b,onChange:w,onVerify:N,onFocus:()=>c(!0),isFocus:s,actions:f.current})}),g.jsx("div",{className:P.title,children:e.t("sheet.cf.panel.styleType")}),g.jsx("div",{className:P.mTBase,children:g.jsx($.Select,{className:j.width100,value:O,options:y,onChange:S=>C(S)})}),g.jsx(x,{interceptorManager:R,rule:(X=t.rule)==null?void 0:X.rule,onChange:m}),g.jsxs("div",{className:`${P.mTBase} ${j.btnList}`,children:[g.jsx($.Button,{size:"small",onClick:E,children:e.t("sheet.cf.panel.cancel")}),g.jsx($.Button,{className:P.mLSm,size:"small",type:"primary",onClick:T,children:e.t("sheet.cf.panel.submit")})]})]})},hl=t=>{const[e,n]=_.useState(t.rule),[r,o]=_.useState(!!t.rule),a=()=>{o(!0)},i=()=>{o(!1),n(void 0)},u=s=>{n(s),o(!0)};return g.jsx("div",{className:P.conditionalFormattingWrap,children:r?g.jsx(pl,{onCancel:i,rule:e}):g.jsx(el,{onClick:u,onCreate:a})})};var ml=Object.defineProperty,gl=Object.getOwnPropertyDescriptor,vl=(t,e,n,r)=>{for(var o=r>1?void 0:r?gl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&ml(e,n,o),o},It=(t,e)=>(n,r)=>e(n,r,t);const hn="sheet.conditional.formatting.panel";let _t=class extends d.Disposable{constructor(e,n,r,o,a){super();Ge(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=n,this._componentManager=r,this._sidebarService=o,this._localeService=a,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(d.UniverInstanceType.UNIVER_SHEET).subscribe(i=>{var u;i||(u=this._sidebarDisposable)==null||u.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(i=>{i.id===hn&&(i.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const n={id:hn,header:{title:this._localeService.t("sheet.cf.title")},children:{label:hn,rule:e,key:d.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(n)}_initPanel(){this._componentManager.register(hn,hl)}};_t=vl([It(0,d.IUniverInstanceService),It(1,d.Inject(d.Injector)),It(2,d.Inject(ge.ComponentManager)),It(3,d.Inject(ge.ISidebarService)),It(4,d.Inject(d.LocaleService))],_t);var Ie=(t=>(t[t.createRule=1]="createRule",t[t.viewRule=2]="viewRule",t[t.highlightCell=3]="highlightCell",t[t.rank=4]="rank",t[t.formula=5]="formula",t[t.colorScale=6]="colorScale",t[t.dataBar=7]="dataBar",t[t.icon=8]="icon",t[t.clearRangeRules=9]="clearRangeRules",t[t.clearWorkSheetRules=10]="clearWorkSheetRules",t))(Ie||{});const xt={id:"sheet.operation.open.conditional.formatting.panel",type:d.CommandType.OPERATION,handler:(t,e)=>{var u;const n=t.get(_t),r=t.get(L.SheetsSelectionsService),o=t.get(d.ICommandService),a=((u=r.getCurrentSelections())==null?void 0:u.map(s=>s.range))||[];switch(e.value){case 3:{n.openPanel({...l.createDefaultRule(),ranges:a});break}case 4:{const s={...l.createDefaultRule,ranges:a,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.rank}};n.openPanel(s);break}case 5:{const s={...l.createDefaultRule,ranges:a,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.formula,value:"="}};n.openPanel(s);break}case 6:{const s={...l.createDefaultRule,ranges:a,rule:{type:l.CFRuleType.colorScale,config:[]}};n.openPanel(s);break}case 7:{const s={...l.createDefaultRule,ranges:a,rule:{type:l.CFRuleType.dataBar,isShowValue:!0}};n.openPanel(s);break}case 8:{const s={...l.createDefaultRule,ranges:a,rule:{type:l.CFRuleType.iconSet,config:[],isShowValue:!0}};n.openPanel(s);break}case 2:{n.openPanel();break}case 1:{n.openPanel({...l.createDefaultRule(),ranges:a});break}case 9:{o.executeCommand(Vt.id,{ranges:a});break}case 10:{o.executeCommand(ht.id);break}}return!0}};var yl=Object.defineProperty,Sl=Object.getOwnPropertyDescriptor,bl=(t,e,n,r)=>{for(var o=r>1?void 0:r?Sl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&yl(e,n,o),o},dt=(t,e)=>(n,r)=>e(n,r,t);let Et=class extends d.Disposable{constructor(e,n,r,o,a,i){super();Ge(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=n,this._univerInstanceService=r,this._renderManagerService=o,this._conditionalFormattingViewModel=a,this._conditionalFormattingRuleModel=i,this._initViewModelInterceptor(),this._initViewModel(),this._initSkeleton(),this._initVmEffectByRule(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}markDirtySkeleton(){var n,r,o;const e=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId();(n=this._renderManagerService.getRenderById(e))==null||n.with(ae.SheetSkeletonManagerService).reCalculate(),(o=(r=this._renderManagerService.getRenderById(e))==null?void 0:r.mainComponent)==null||o.makeDirty()}_initSkeleton(){this.disposeWithMe(this._conditionalFormattingViewModel.markDirty$.pipe(We.bufferTime(16),We.filter(e=>{const n=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return r?e.filter(o=>o.unitId===n.getUnitId()&&o.subUnitId===r.getSheetId()).length>0:!1})).subscribe(()=>this.markDirtySkeleton())),this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.pipe(We.bufferTime(16),We.filter(e=>{const n=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return r?e.filter(o=>["sort","delete"].includes(o.type)&&o.unitId===n.getUnitId()&&o.subUnitId===r.getSheetId()).length>0:!1})).subscribe(()=>this.markDirtySkeleton())),this.disposeWithMe(this._conditionalFormattingService.ruleComputeStatus$.pipe(We.bufferTime(16),We.filter(e=>{const n=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return r?e.filter(o=>o.unitId===n.getUnitId()&&o.subUnitId===r.getSheetId()).length>0:!1})).subscribe(()=>this.markDirtySkeleton()))}_initVmEffectByRule(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(e=>{const{rule:n,unitId:r,subUnitId:o}=e;switch(e.type){case"add":{this._handleRuleAdd(r,o,n);return}case"delete":{n.ranges.forEach(a=>{d.Range.foreach(a,(i,u)=>{this._conditionalFormattingViewModel.deleteCellCf(r,o,i,u,n.cfId)})}),this._conditionalFormattingViewModel.markRuleDirty(r,o,n);return}case"set":{this._handleRuleChange(r,o,n,e.oldRule);return}case"sort":{const i=this._conditionalFormattingRuleModel.getSubunitRules(r,o).map(u=>u.cfId).reduce((u,s,c)=>(u.set(s,c),u),new Map);n.ranges.forEach(u=>{d.Range.foreach(u,(s,c)=>{this._conditionalFormattingViewModel.sortCellCf(r,o,s,c,i)})})}}}))}_initViewModel(){let e=!1;this._univerInstanceService.getAllUnitsForType(d.UniverInstanceType.UNIVER_SHEET).forEach(r=>{const o=r.getUnitId(),a=this._conditionalFormattingRuleModel.getUnitRules(o);a&&[...a.keys()].forEach(i=>{a.get(i).forEach(s=>{this._handleRuleAdd(o,i,s),e=!0})})}),e&&this.markDirtySkeleton()}_handleRuleAdd(e,n,r){const a=this._conditionalFormattingRuleModel.getSubunitRules(e,n).map(i=>i.cfId).reduce((i,u,s)=>(i.set(u,s),i),new Map);r.ranges.forEach(i=>{d.Range.foreach(i,(u,s)=>{this._conditionalFormattingViewModel.pushCellCf(e,n,u,s,r.cfId),this._conditionalFormattingViewModel.sortCellCf(e,n,u,s,a)})}),this._conditionalFormattingViewModel.markRuleDirty(e,n,r)}_handleRuleChange(e,n,r,o){const i=this._conditionalFormattingRuleModel.getSubunitRules(e,n).map(c=>c.cfId).reduce((c,f,p)=>(c.set(f,p),c),new Map),u=(c,f)=>{c.ranges.forEach(p=>{d.Range.foreach(p,(h,v)=>{this._conditionalFormattingViewModel.deleteCellCf(e,n,h,v,c.cfId)})}),f.ranges.forEach(p=>{d.Range.foreach(p,(h,v)=>{this._conditionalFormattingViewModel.pushCellCf(e,n,h,v,c.cfId),this._conditionalFormattingViewModel.sortCellCf(e,n,h,v,i)})})},s=this._conditionalFormattingService.interceptorManager.intercept(this._conditionalFormattingService.interceptorManager.getInterceptPoints().beforeUpdateRuleResult,{handler:(c,f,p)=>{if(e===(c==null?void 0:c.unitId)&&n===c.subUnitId&&o.cfId===c.cfId){(this._ruleChangeCacheMap.get(c.cfId)||[]).forEach(v=>{u(v.oldRule,v.rule),v.dispose()}),this._ruleChangeCacheMap.delete(c.cfId);return}p(c)}});if(o.cfId===r.cfId){let c=this._ruleChangeCacheMap.get(o.cfId);c||(c=[],this._ruleChangeCacheMap.set(o.cfId,c)),c.push({oldRule:o,rule:r,dispose:s})}r.ranges.forEach(c=>{d.Range.foreach(c,(f,p)=>{this._conditionalFormattingViewModel.pushCellCf(e,n,f,p,o.cfId)})}),this._conditionalFormattingViewModel.markRuleDirty(e,n,r)}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(L.INTERCEPTOR_POINT.CELL_CONTENT,{effect:d.InterceptorEffectEnum.Style,handler:(e,n,r)=>{const o=this._conditionalFormattingService.composeStyle(n.unitId,n.subUnitId,n.row,n.col);if(!o)return r(e);const a=n.workbook.getStyles(),u={...(typeof(e==null?void 0:e.s)=="string"?a.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},s={...e,s:u};return o.style&&Object.assign(u,o.style),s.fontRenderExtension||(s.fontRenderExtension={},o.isShowValue!==void 0&&(s.fontRenderExtension.isSkip=!o.isShowValue)),o.dataBar&&(s.dataBar=o.dataBar),o.iconSet&&(s.iconSet=o.iconSet,s.fontRenderExtension.leftOffset=l.DEFAULT_PADDING+l.DEFAULT_WIDTH),r(s)},priority:10}))}};Et=bl([dt(0,d.Inject(L.SheetInterceptorService)),dt(1,d.Inject(l.ConditionalFormattingService)),dt(2,d.Inject(d.IUniverInstanceService)),dt(3,d.Inject(ta.IRenderManagerService)),dt(4,d.Inject(l.ConditionalFormattingViewModel)),dt(5,d.Inject(l.ConditionalFormattingRuleModel))],Et);var Rl=Object.defineProperty,Cl=Object.getOwnPropertyDescriptor,Tl=(t,e,n,r)=>{for(var o=r>1?void 0:r?Cl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Rl(e,n,o),o},Ot=(t,e)=>(n,r)=>e(n,r,t);let Mt=class extends d.Disposable{constructor(e,n,r,o,a){super();Ge(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=n,this._injector=r,this._conditionalFormattingViewModel=o,this._univerInstanceService=a,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:l.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,n,r)=>this._collectConditionalRule(e,n,r),onPasteCells:(e,n,r,o)=>{const{copyType:a=ae.COPY_TYPE.COPY,pasteType:i}=o,{range:u}=e||{},{range:s}=n;return this._generateConditionalFormattingMutations(s,{copyType:a,pasteType:i,copyRange:u})}}))}_collectConditionalRule(e,n,r){const o=new d.ObjectMatrix,a={};this._copyInfo={matrix:o,info:{unitId:e,subUnitId:n,cfMap:a}};const i=this._conditionalFormattingViewModel.getMatrix(e,n);if(!i)return;const u=this._injector.invoke(p=>ae.rangeToDiscreteRange(r,p,e,n));if(!u)return;const{rows:s,cols:c}=u,f=new Set;s.forEach((p,h)=>{c.forEach((v,b)=>{const y=this._conditionalFormattingViewModel.getCellCf(e,n,p,v,i);y&&(y.cfList.forEach(O=>f.add(O.cfId)),o.setValue(h,b,y.cfList.map(O=>O.cfId)))})}),f.forEach(p=>{const h=this._conditionalFormattingRuleModel.getRule(e,n,p);h&&(a[p]=h.rule)})}_generateConditionalFormattingMutations(e,n){const r=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET),o=r.getActiveSheet(),a=r.getUnitId();if(!o)return{redos:[],undos:[]};const i=o.getSheetId();if(n.copyType===ae.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!n.copyRange)return{redos:[],undos:[]};if(![ae.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,ae.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,ae.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(n.pasteType))return{redos:[],undos:[]};const{ranges:[u,s],mapFunc:c}=ae.virtualizeDiscreteRanges([n.copyRange,e]),f=ae.getRepeatRange(u,s,!0),p=this._conditionalFormattingViewModel.getMatrix(a,i),h={};d.Range.foreach(s,(m,w)=>{const{row:T,col:E}=c(m,w),N=this._conditionalFormattingViewModel.getCellCf(a,i,T,E,p);N&&N.cfList.forEach(U=>{if(!h[U.cfId]){const F=new d.ObjectMatrix;h[U.cfId]=F;const X=this._conditionalFormattingRuleModel.getRule(a,i,U.cfId);X==null||X.ranges.forEach(S=>{d.Range.foreach(S,(M,W)=>{F.setValue(M,W,1)})})}h[U.cfId].realDeleteValue(T,E)})});const{matrix:v,info:b}=this._copyInfo,y=[];let O=this._conditionalFormattingRuleModel.createCfId(a,i);const C={},I=m=>{if(C[m])return C[m];const w=b==null?void 0:b.cfMap[m],T=[...this._conditionalFormattingRuleModel.getSubunitRules(a,i)||[],...y].find(E=>d.Tools.diffValue(E.rule,w));if(T)return C[m]=T,T;{const E={rule:w,cfId:O,ranges:[],stopIfTrue:!1};return C[m]=E,y.push(E),O=`${Number(O)+1}`,E}};f.forEach(m=>{v&&v.forValue((w,T,E)=>{const N=d.Rectangle.getPositionRange({startRow:w,endRow:w,startColumn:T,endColumn:T},m.startRange),{row:U,col:F}=c(N.startRow,N.startColumn);E.forEach(X=>{if(!h[X]){const S=I(X),M=new d.ObjectMatrix;h[X]=M,S.ranges.forEach(W=>{d.Range.foreach(W,(te,q)=>{M.setValue(te,q,1)})})}h[X].setValue(U,F,1)})})});const R=[],x=[];for(const m in h){const w=h[m],T=L.findAllRectangle(L.createTopMatrixFromMatrix(w));if(!T.length){const E={unitId:a,subUnitId:i,cfId:m};R.push({id:l.DeleteConditionalRuleMutation.id,params:E}),x.push(...l.DeleteConditionalRuleMutationUndoFactory(this._injector,E))}if(y.some(E=>E.cfId===m)){const E=I(m),N={unitId:a,subUnitId:i,rule:{...E,ranges:T}};R.push({id:l.AddConditionalRuleMutation.id,params:N}),x.push(l.AddConditionalRuleMutationUndoFactory(this._injector,N))}else{const E=this._conditionalFormattingRuleModel.getRule(a,i,m);if(!E)continue;const N={unitId:a,subUnitId:i,rule:{...E,ranges:T}};R.push({id:l.SetConditionalRuleMutation.id,params:N}),x.push(...l.setConditionalRuleMutationUndoFactory(this._injector,N))}}return{redos:R,undos:x}}};Mt=Tl([Ot(0,d.Inject(ae.ISheetClipboardService)),Ot(1,d.Inject(l.ConditionalFormattingRuleModel)),Ot(2,d.Inject(d.Injector)),Ot(3,d.Inject(l.ConditionalFormattingViewModel)),Ot(4,d.Inject(d.IUniverInstanceService))],Mt);var wl=Object.defineProperty,Il=Object.getOwnPropertyDescriptor,_l=(t,e,n,r)=>{for(var o=r>1?void 0:r?Il(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&wl(e,n,o),o},mn=(t,e)=>(n,r)=>e(n,r,t);let Pt=class extends d.Disposable{constructor(t,e,n,r){super(),this._conditionalFormattingRuleModel=t,this._univerInstanceService=e,this._injector=n,this._refRangeService=r,this._initRefRange()}_initRefRange(){const t=new Map,e=(r,o,a)=>`${r}_${o}_${a}`,n=(r,o,a)=>{const i=s=>{const c=[...a.ranges],f=c.map(h=>L.handleDefaultRangeChangeWithEffectRefCommands(h,s)).filter(h=>!!h);if(l.isRangesEqual(f,c))return{redos:[],undos:[]};if(f.length){const h={unitId:r,subUnitId:o,rule:{...a,ranges:f}},v=[{id:l.SetConditionalRuleMutation.id,params:h}],b=l.setConditionalRuleMutationUndoFactory(this._injector,h);return{redos:v,undos:b}}else{const h={unitId:r,subUnitId:o,cfId:a.cfId},v=[{id:l.DeleteConditionalRuleMutation.id,params:h}],b=l.DeleteConditionalRuleMutationUndoFactory(this._injector,h);return{redos:v,undos:b}}},u=[];a.ranges.forEach(s=>{const c=this._refRangeService.registerRefRange(s,i);u.push(()=>c.dispose())}),t.set(e(r,o,a.cfId),()=>u.forEach(s=>s()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(r=>{const{unitId:o,subUnitId:a,rule:i}=r,u=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET),s=u.getActiveSheet();if(!(r.unitId!==u.getUnitId()||r.subUnitId!==(s==null?void 0:s.getSheetId())))switch(r.type){case"add":{n(r.unitId,r.subUnitId,r.rule);break}case"delete":{const c=t.get(e(o,a,i.cfId));c&&c();break}case"set":{const c=t.get(e(o,a,i.cfId));c&&c(),n(r.unitId,r.subUnitId,r.rule)}}})),this.disposeWithMe(d.toDisposable(()=>{t.forEach(r=>{r()}),t.clear()}))}};Pt=_l([mn(0,d.Inject(l.ConditionalFormattingRuleModel)),mn(1,d.Inject(d.IUniverInstanceService)),mn(2,d.Inject(d.Injector)),mn(3,d.Inject(L.RefRangeService))],Pt);var xl=Object.defineProperty,El=Object.getOwnPropertyDescriptor,Ol=(t,e,n,r)=>{for(var o=r>1?void 0:r?El(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&xl(e,n,o),o},Rr=(t,e)=>(n,r)=>e(n,r,t);let Dt=class extends d.Disposable{constructor(t,e,n){super(),this._localeService=t,this._commandService=e,this._sheetPermissionInterceptorBaseController=n,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{t.id===wt.id&&(this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[L.WorkbookEditablePermission],rangeTypes:[L.RangeProtectionPermissionEditPoint],worksheetTypes:[L.WorksheetEditPermission,L.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr")))}))}};Dt=Ol([Rr(0,d.Inject(d.LocaleService)),Rr(1,d.ICommandService),Rr(2,d.Inject(ae.SheetPermissionInterceptorBaseController))],Dt);const Fo="sheets-conditional-formatting-ui.config",Bo={};var Go=Object.defineProperty,Ml=Object.getOwnPropertyDescriptor,Pl=(t,e,n)=>e in t?Go(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Dl=(t,e,n,r)=>{for(var o=r>1?void 0:r?Ml(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Go(e,n,o),o},Cr=(t,e)=>(n,r)=>e(n,r,t),$o=(t,e,n)=>Pl(t,typeof e!="symbol"?e+"":e,n);V.UniverSheetsConditionalFormattingMobileUIPlugin=class extends d.Plugin{constructor(e=Bo,n,r,o){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=o;const{menu:a,...i}=this._config;a&&this._configService.setConfig("menu",a,{merge:!0}),this._configService.setConfig(Fo,i),this._initCommand(),this._injector.add([Et]),this._injector.add([Pt]),this._injector.add([Mt]),this._injector.add([Dt]),this._injector.add([ut])}_initCommand(){[Rn,Cn,Tn,wn,In,_n,xn,En,On,xt,Tt,un,sn,wt,Vt,ht].forEach(e=>{this._commandService.registerCommand(e)})}},$o(V.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${l.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),$o(V.UniverSheetsConditionalFormattingMobileUIPlugin,"type",d.UniverInstanceType.UNIVER_SHEET),V.UniverSheetsConditionalFormattingMobileUIPlugin=Dl([d.DependentOn(l.UniverSheetsConditionalFormattingPlugin),Cr(1,d.Inject(d.Injector)),Cr(2,d.Inject(d.ICommandService)),Cr(3,d.IConfigService)],V.UniverSheetsConditionalFormattingMobileUIPlugin);var Nl=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,Ll=(t,e,n,r)=>{for(var o=r>1?void 0:r?jl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Nl(e,n,o),o},Nt=(t,e)=>(n,r)=>e(n,r,t);let gn=class extends d.Disposable{constructor(t,e,n,r,o){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=n,this._conditionalFormattingRuleModel=r,this._conditionalFormattingViewModel=o,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(o,a,i,u,s)=>{var v;const c=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),f=(v=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:v.getSheetId();if(!c||!f)return;const p={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},h={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row};d.Range.foreach(i,(b,y)=>{const O=d.Rectangle.getPositionRange({startRow:b,startColumn:y,endColumn:y,endRow:b},p),C=d.Rectangle.getPositionRange({startRow:b,startColumn:y,endColumn:y,endRow:b},h),{row:I,col:R}=s(O.startRow,O.startColumn),x=this._conditionalFormattingViewModel.getCellCf(c,f,I,R),{row:m,col:w}=s(C.startRow,C.startColumn),T=this._conditionalFormattingViewModel.getCellCf(c,f,m,w);T&&T.cfList.forEach(E=>{let N=u.get(E.cfId);if(!u.get(E.cfId)){const U=this._conditionalFormattingRuleModel.getRule(c,f,E.cfId);if(!U)return;N=new d.ObjectMatrix,U.ranges.forEach(F=>{d.Range.foreach(F,(X,S)=>{N.setValue(X,S,1)})}),u.set(E.cfId,N)}N.realDeleteValue(m,w)}),x&&x.cfList.forEach(E=>{let N=u.get(E.cfId);if(!u.get(E.cfId)){const U=this._conditionalFormattingRuleModel.getRule(c,f,E.cfId);if(!U)return;N=new d.ObjectMatrix,U.ranges.forEach(F=>{d.Range.foreach(F,(X,S)=>{N.setValue(X,S,1)})}),u.set(E.cfId,N)}N.setValue(m,w,1)})})},n=(o,a)=>{var C,I,R;const i=(C=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET))==null?void 0:C.getUnitId(),u=(R=(I=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET))==null?void 0:I.getActiveSheet())==null?void 0:R.getSheetId(),s=new Map,c=[],f=[];if(!i||!u)return t();const p=ae.virtualizeDiscreteRanges([o,a]),[h,v]=p.ranges,{mapFunc:b}=p,y={row:h.startRow,col:h.startColumn};return ae.getAutoFillRepeatRange(h,v).forEach(x=>{e(y,x.repeatStartCell,x.relativeRange,s,b)}),s.forEach((x,m)=>{const w=this._conditionalFormattingRuleModel.getRule(i,u,m);if(!w)return;const T=L.findAllRectangle(L.createTopMatrixFromMatrix(x));if(T.length){const E={unitId:i,subUnitId:u,rule:{...w,ranges:T}};c.push({id:l.SetConditionalRuleMutation.id,params:E}),f.push(...l.setConditionalRuleMutationUndoFactory(this._injector,E))}else{const E={unitId:i,subUnitId:u,cfId:w.cfId};c.push({id:l.DeleteConditionalRuleMutation.id,params:E}),f.push(...l.DeleteConditionalRuleMutationUndoFactory(this._injector,E))}}),{undos:f,redos:c}},r={id:l.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(o,a,i)=>{if(i===ae.APPLY_TYPE.COPY||i===ae.APPLY_TYPE.ONLY_FORMAT||i===ae.APPLY_TYPE.SERIES){const{source:u,target:s}=o;return n(u,s)}return t()}};this.disposeWithMe(this._autoFillService.addHook(r))}};gn=Ll([Nt(0,d.Inject(d.Injector)),Nt(1,d.Inject(d.IUniverInstanceService)),Nt(2,d.Inject(ae.IAutoFillService)),Nt(3,d.Inject(l.ConditionalFormattingRuleModel)),Nt(4,d.Inject(l.ConditionalFormattingViewModel))],gn);var Vl=Object.defineProperty,Ul=Object.getOwnPropertyDescriptor,zl=(t,e,n,r)=>{for(var o=r>1?void 0:r?Ul(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Vl(e,n,o),o},jt=(t,e)=>(n,r)=>e(n,r,t);V.ConditionalFormattingClearController=class extends d.Disposable{constructor(e,n,r,o,a){super(),this._injector=e,this._univerInstanceService=n,this._sheetInterceptorService=r,this._selectionManagerService=o,this._conditionalFormattingRuleModel=a,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var a;const n=[],r=[],o={redos:n,undos:r};if([L.ClearSelectionFormatCommand.id,L.ClearSelectionAllCommand.id].includes(e.id)){const i=(a=this._selectionManagerService.getCurrentSelections())==null?void 0:a.map(b=>b.range);if(!i)return o;const u=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET),s=u.getActiveSheet();if(!s)return o;const c=u.getUnitId(),f=s.getSheetId(),p=this._conditionalFormattingRuleModel.getSubunitRules(c,f);if(!p||!p.length)return o;const{redos:h,undos:v}=Xo(this._injector,p,i,c,f);n.push(...h),r.push(...v)}return o}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:n,ranges:r})=>{const o=[],a=[],i={redos:o,undos:a};if(!r||!r.length)return i;const u=this._conditionalFormattingRuleModel.getSubunitRules(e,n);if(!u||!u.length)return i;const{redos:s,undos:c}=Xo(this._injector,u,r,e,n);return o.push(...s),a.push(...c),i}}))}},V.ConditionalFormattingClearController=zl([jt(0,d.Inject(d.Injector)),jt(1,d.Inject(d.IUniverInstanceService)),jt(2,d.Inject(L.SheetInterceptorService)),jt(3,d.Inject(L.SheetsSelectionsService)),jt(4,d.Inject(l.ConditionalFormattingRuleModel))],V.ConditionalFormattingClearController);function Xo(t,e,n,r,o){const a=[],i=[];return e.filter(u=>n.some(s=>u.ranges.some(c=>d.Rectangle.getIntersects(c,s)))).forEach(u=>{const c=new L.RangeMergeUtil().add(...u.ranges).subtract(...n).merge();if(c.length){const f={id:l.SetConditionalRuleMutation.id,params:{unitId:r,subUnitId:o,rule:{...u,ranges:c}}},p=l.setConditionalRuleMutationUndoFactory(t,f.params);a.push(f),i.push(...p)}else{const f={id:l.DeleteConditionalRuleMutation.id,params:{unitId:r,subUnitId:o,cfId:u.cfId}},p=l.DeleteConditionalRuleMutationUndoFactory(t,f.params);a.push(f),i.push(...p)}}),{redos:a,undos:i}}var Al=Object.defineProperty,kl=Object.getOwnPropertyDescriptor,Wl=(t,e,n,r)=>{for(var o=r>1?void 0:r?kl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Al(e,n,o),o},Yo=(t,e)=>(n,r)=>e(n,r,t);let vn=class extends d.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(d.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(L.AFTER_CELL_EDIT,{handler:(t,e,n)=>{var o,a;const r=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col);if(r!=null&&r.style&&(t!=null&&t.p)){const i=Object.keys(r==null?void 0:r.style);if(i.length>0){const u=d.BuildTextUtils.transform.getPlainText((a=(o=t.p.body)==null?void 0:o.dataStream)!=null?a:""),s={...(typeof t.s=="string"?e.workbook.getStyles().get(t.s):t.s)||{}};i.forEach(f=>{delete s[f]});const c={...t,s:{...s},v:u};return delete c.p,n(c)}}return n(t)}})))}};vn=Wl([Yo(0,d.Inject(L.SheetInterceptorService)),Yo(1,d.Inject(l.ConditionalFormattingService))],vn);const qo=[L.SetWorksheetActiveOperation.id,l.AddConditionalRuleMutation.id,l.SetConditionalRuleMutation.id,l.DeleteConditionalRuleMutation.id,l.MoveConditionalRuleMutation.id],Lt=[{label:"sheet.cf.ruleType.highlightCell",value:Ie.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:Ie.rank},{label:"sheet.cf.ruleType.formula",value:Ie.formula},{label:"sheet.cf.ruleType.colorScale",value:Ie.colorScale},{label:"sheet.cf.ruleType.dataBar",value:Ie.dataBar},{label:"sheet.cf.ruleType.iconSet",value:Ie.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:Ie.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:Ie.createRule},{label:"sheet.cf.menu.clearRangeRules",value:Ie.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:Ie.clearWorkSheetRules}],Hl=t=>{const e=t.get(L.SheetsSelectionsService),n=t.get(d.ICommandService),r=t.get(d.IUniverInstanceService),o=t.get(l.ConditionalFormattingRuleModel),a=new Me.Observable(s=>Me.merge(e.selectionMoveEnd$,new Me.Observable(c=>{const f=n.onCommandExecuted(p=>{var y;const{id:h,params:v}=p,b=(y=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getUnitId();qo.includes(h)&&v.unitId===b&&c.next(null)});return()=>f.dispose()})).pipe(We.debounceTime(16)).subscribe(()=>{var y;const c=((y=e.getCurrentSelections())==null?void 0:y.map(O=>O.range))||[],f=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET);if(!f)return;const p=f.getActiveSheet();if(!p)return;const b=(o.getSubunitRules(f.getUnitId(),p.getSheetId())||[]).filter(O=>O.ranges.some(C=>c.some(I=>d.Rectangle.intersects(I,C)))).map(O=>O.ranges).every(O=>L.checkRangesEditablePermission(t,f.getUnitId(),p.getSheetId(),O));s.next(b)})),i=new Me.Observable(s=>new Me.Observable(c=>{const f=n.onCommandExecuted(p=>{var y;const{id:h,params:v}=p,b=(y=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getUnitId();qo.includes(h)&&v.unitId===b&&c.next(null)});return()=>f.dispose()}).pipe(We.debounceTime(16)).subscribe(()=>{const c=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET);if(!c)return;const f=c.getActiveSheet();if(!f)return;const p=o.getSubunitRules(c.getUnitId(),f.getSheetId())||[];if(!p.length)return s.next(!1),!1;const h=p.map(v=>v.ranges).every(v=>L.checkRangesEditablePermission(t,c.getUnitId(),f.getSheetId(),v));s.next(h)})),u=new Me.Observable(s=>{a.subscribe(c=>{const f=Lt.find(p=>p.value===Ie.clearRangeRules);f&&(f.disabled=!c,s.next(Lt))}),i.subscribe(c=>{const f=Lt.find(p=>p.value===Ie.clearWorkSheetRules);f&&(f.disabled=!c,s.next(Lt))}),s.next(Lt)});return{id:xt.id,type:ge.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:u,hidden$:ge.getMenuHiddenObservable(t,d.UniverInstanceType.UNIVER_SHEET),disabled$:ae.getCurrentRangeDisable$(t,{workbookTypes:[L.WorkbookEditablePermission],worksheetTypes:[L.WorksheetSetCellStylePermission,L.WorksheetEditPermission],rangeTypes:[L.RangeProtectionPermissionEditPoint]})}},Fl={[ge.RibbonStartGroup.FORMULAS_INSERT]:{[xt.id]:{order:0,menuItemFactory:Hl}}};var Bl=Object.defineProperty,Gl=Object.getOwnPropertyDescriptor,$l=(t,e,n,r)=>{for(var o=r>1?void 0:r?Gl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Bl(e,n,o),o},Ko=(t,e)=>(n,r)=>e(n,r,t);let yn=class extends d.Disposable{constructor(e,n){super();Ge(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=n,this._menuManagerService.mergeMenu(Fl)}};yn=$l([Ko(0,d.Inject(d.Injector)),Ko(1,ge.IMenuManagerService)],yn);var Xl=Object.defineProperty,Yl=Object.getOwnPropertyDescriptor,ql=(t,e,n,r)=>{for(var o=r>1?void 0:r?Yl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Xl(e,n,o),o},ft=(t,e)=>(n,r)=>e(n,r,t);const Kl=(t,e)=>{const n=f=>f.endRow-f.startRow+1,r=f=>f.endColumn-f.startColumn+1,o=n(e)%n(t),a=r(e)%r(t),i=Math.floor(n(e)/n(t)),u=Math.floor(r(e)/r(t)),s=[],c={startRow:0,endRow:n(t)-1,startColumn:0,endColumn:r(t)-1};if(n(e)===1&&r(e)===1){const f={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return s.push({repeatRelativeRange:c,startRange:f}),s}for(let f=0;f<i+(o?.1:0);f++)for(let p=0;p<u+(a?.1:0);p++){const h=n(t)*f,v=r(t)*p,b={startRow:h+e.startRow,endRow:h+e.startRow,startColumn:v+e.startColumn,endColumn:v+e.startColumn};let y=c;f===i&&o&&(y={...y},y.endRow=y.endRow-(n(t)-o)),p===u&&a&&(y={...y},y.endColumn=y.endColumn-(r(t)-a)),s.push({repeatRelativeRange:y,startRange:b})}return s};let Sn=class extends d.Disposable{constructor(e,n,r,o,a,i){super();Ge(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=n,this._formatPainterService=r,this._sheetsSelectionsService=o,this._conditionalFormattingRuleModel=a,this._conditionalFormattingViewModel=i,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),n=(a,i,u,s,c)=>{const{unitId:f,subUnitId:p}=this._painterConfig,{targetUnitId:h,targetSubUnitId:v}=c,b={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},y={startRow:i.row,startColumn:i.col,endColumn:i.col,endRow:i.row};d.Range.foreach(u,(O,C)=>{const I=d.Rectangle.getPositionRange({startRow:O,startColumn:C,endColumn:C,endRow:O},b),R=d.Rectangle.getPositionRange({startRow:O,startColumn:C,endColumn:C,endRow:O},y),x=this._conditionalFormattingViewModel.getCellCf(f,p,I.startRow,I.startColumn),m=this._conditionalFormattingViewModel.getCellCf(h,v,R.startRow,R.startColumn);m&&m.cfList.forEach(w=>{let T=s.get(w.cfId);if(!s.get(w.cfId)){const E=this._conditionalFormattingRuleModel.getRule(h,v,w.cfId);if(!E)return;T=new d.ObjectMatrix,E.ranges.forEach(N=>{d.Range.foreach(N,(U,F)=>{T.setValue(U,F,1)})}),s.set(w.cfId,T)}T.realDeleteValue(R.startRow,R.startColumn)}),x&&x.cfList.forEach(w=>{const T=s.get(w.cfId);T&&T.setValue(R.startRow,R.startColumn,1)})})},r=(a,i,u)=>{var I;const{range:s,unitId:c,subUnitId:f}=this._painterConfig,p=a!==c||f!==i,h=new Map,v=[],b=[];if(!a||!i||!c||!f)return e();const y=(I=this._conditionalFormattingRuleModel.getSubunitRules(c,f))!=null?I:[];y==null||y.forEach(R=>{const{ranges:x,cfId:m}=R;if(x.some(w=>d.Rectangle.intersects(s,w))){const w=new d.ObjectMatrix;p||x.forEach(T=>{d.Range.foreach(T,(E,N)=>{w.setValue(E,N,1)})}),h.set(m,w)}});const O={row:s.startRow,col:s.startColumn};return Kl(s,u).forEach(R=>{n(O,{row:R.startRange.startRow,col:R.startRange.startColumn},R.repeatRelativeRange,h,{targetUnitId:a,targetSubUnitId:i})}),h.forEach((R,x)=>{if(p){const m=this._conditionalFormattingRuleModel.getRule(a,i,x),w=L.findAllRectangle(L.createTopMatrixFromMatrix(R));if(m)if(w.length){const T={unitId:a,subUnitId:i,rule:{...m,ranges:w}};v.push({id:l.SetConditionalRuleMutation.id,params:T}),b.push(...l.setConditionalRuleMutationUndoFactory(this._injector,T))}else{const T={unitId:a,subUnitId:i,cfId:m.cfId};v.push({id:l.DeleteConditionalRuleMutation.id,params:T}),b.push(...l.DeleteConditionalRuleMutationUndoFactory(this._injector,T))}else if(w.length){const T=this._conditionalFormattingRuleModel.getRule(c,f,x);if(T){const E={unitId:a,subUnitId:i,rule:{...d.Tools.deepClone(T),cfId:this._conditionalFormattingRuleModel.createCfId(a,i),ranges:w}};v.push({id:l.AddConditionalRuleMutation.id,params:E}),b.push(l.AddConditionalRuleMutationUndoFactory(this._injector,E))}}}else{const m=this._conditionalFormattingRuleModel.getRule(c,f,x);if(!m)return;const w=L.findAllRectangle(L.createTopMatrixFromMatrix(R));if(w.length){const T={unitId:c,subUnitId:f,rule:{...m,ranges:w}};v.push({id:l.SetConditionalRuleMutation.id,params:T}),b.push(...l.setConditionalRuleMutationUndoFactory(this._injector,T))}else{const T={unitId:c,subUnitId:f,cfId:m.cfId};v.push({id:l.DeleteConditionalRuleMutation.id,params:T}),b.push(...l.DeleteConditionalRuleMutationUndoFactory(this._injector,T))}}}),{undos:b,redos:v}},o={id:l.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:a=>{var i,u,s;switch(a){case ae.FormatPainterStatus.INFINITE:case ae.FormatPainterStatus.ONCE:{const c=(i=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET))==null?void 0:i.getUnitId(),f=(s=(u=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET))==null?void 0:u.getActiveSheet())==null?void 0:s.getSheetId(),p=this._sheetsSelectionsService.getCurrentLastSelection(),h=p==null?void 0:p.range;c&&f&&h&&(this._painterConfig={unitId:c,subUnitId:f,range:h});break}case ae.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(a,i,u)=>this._painterConfig?r(a,i,u):{redos:[],undos:[]}};this._formatPainterService.addHook(o)}};Sn=ql([ft(0,d.Inject(d.Injector)),ft(1,d.Inject(d.IUniverInstanceService)),ft(2,d.Inject(ae.IFormatPainterService)),ft(3,d.Inject(L.SheetsSelectionsService)),ft(4,d.Inject(l.ConditionalFormattingRuleModel)),ft(5,d.Inject(l.ConditionalFormattingViewModel))],Sn);var Zo=Object.defineProperty,Zl=Object.getOwnPropertyDescriptor,Jl=(t,e,n)=>e in t?Zo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ql=(t,e,n,r)=>{for(var o=r>1?void 0:r?Zl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Zo(e,n,o),o},Tr=(t,e)=>(n,r)=>e(n,r,t),Jo=(t,e,n)=>Jl(t,typeof e!="symbol"?e+"":e,n);V.UniverSheetsConditionalFormattingUIPlugin=class extends d.Plugin{constructor(e=Bo,n,r,o){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=o;const{menu:a,...i}=this._config;a&&this._configService.setConfig("menu",a,{merge:!0}),this._configService.setConfig(Fo,i),this._initCommand()}onStarting(){d.registerDependencies(this._injector,[[Et],[Pt],[Mt],[gn],[Dt],[_t],[yn],[ut],[vn],[V.ConditionalFormattingClearController],[Sn]]),d.touchDependencies(this._injector,[[Et]])}onReady(){d.touchDependencies(this._injector,[[yn],[_t]])}onRendered(){d.touchDependencies(this._injector,[[gn],[V.ConditionalFormattingClearController],[Mt],[vn],[ut],[Sn],[Dt],[Pt]])}_initCommand(){[Rn,Cn,Tn,wn,In,_n,xn,En,On,xt,Tt,un,sn,wt,Vt,ht].forEach(e=>{this._commandService.registerCommand(e)})}},Jo(V.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${l.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),Jo(V.UniverSheetsConditionalFormattingUIPlugin,"type",d.UniverInstanceType.UNIVER_SHEET),V.UniverSheetsConditionalFormattingUIPlugin=Ql([d.DependentOn(l.UniverSheetsConditionalFormattingPlugin),Tr(1,d.Inject(d.Injector)),Tr(2,d.Inject(d.ICommandService)),Tr(3,d.IConfigService)],V.UniverSheetsConditionalFormattingUIPlugin),V.AddAverageCfCommand=Rn,V.AddCfCommand=wt,V.AddColorScaleConditionalRuleCommand=Cn,V.AddDataBarConditionalRuleCommand=Tn,V.AddDuplicateValuesCfCommand=wn,V.AddNumberCfCommand=In,V.AddRankCfCommand=_n,V.AddTextCfCommand=xn,V.AddTimePeriodCfCommand=En,V.AddUniqueValuesCfCommand=On,V.ClearRangeCfCommand=Vt,V.ClearWorksheetCfCommand=ht,V.DeleteCfCommand=Tt,V.MoveCfCommand=sn,V.OpenConditionalFormattingOperator=xt,V.SetCfCommand=un,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
|
|
16
|
+
`,t.getElementsByTagName("head")[0].appendChild(e)),t.body&&ro(t.body,"react-draggable-transparent-selection")}function ui(t){if(t)try{if(t.body&&oo(t.body,"react-draggable-transparent-selection"),t.selection)t.selection.empty();else{const e=(t.defaultView||window).getSelection();e&&e.type!=="Caret"&&e.removeAllRanges()}}catch{}}function ro(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)")))||(t.className+=" ".concat(e))}function oo(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)"),"g"),"")}var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.canDragX=fi,Ne.canDragY=pi,Ne.createCoreData=mi,Ne.createDraggableData=gi,Ne.getBoundPosition=ci,Ne.getControlPosition=hi,Ne.snapToGrid=di;var Ie=De,nt=ie;function ci(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:r}=t.props;r=typeof r=="string"?r:vi(r);const o=Yn(t);if(typeof r=="string"){const{ownerDocument:a}=o,i=a.defaultView;let u;if(r==="parent"?u=o.parentNode:u=a.querySelector(r),!(u instanceof i.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const s=u,c=i.getComputedStyle(o),f=i.getComputedStyle(s);r={left:-o.offsetLeft+(0,Ie.int)(f.paddingLeft)+(0,Ie.int)(c.marginLeft),top:-o.offsetTop+(0,Ie.int)(f.paddingTop)+(0,Ie.int)(c.marginTop),right:(0,nt.innerWidth)(s)-(0,nt.outerWidth)(o)-o.offsetLeft+(0,Ie.int)(f.paddingRight)-(0,Ie.int)(c.marginRight),bottom:(0,nt.innerHeight)(s)-(0,nt.outerHeight)(o)-o.offsetTop+(0,Ie.int)(f.paddingBottom)-(0,Ie.int)(c.marginBottom)}}return(0,Ie.isNum)(r.right)&&(e=Math.min(e,r.right)),(0,Ie.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Ie.isNum)(r.left)&&(e=Math.max(e,r.left)),(0,Ie.isNum)(r.top)&&(n=Math.max(n,r.top)),[e,n]}function di(t,e,n){const r=Math.round(e/t[0])*t[0],o=Math.round(n/t[1])*t[1];return[r,o]}function fi(t){return t.props.axis==="both"||t.props.axis==="x"}function pi(t){return t.props.axis==="both"||t.props.axis==="y"}function hi(t,e,n){const r=typeof e=="number"?(0,nt.getTouch)(t,e):null;if(typeof e=="number"&&!r)return null;const o=Yn(n),a=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,nt.offsetXYFromParent)(r||t,a,n.props.scale)}function mi(t,e,n){const r=!(0,Ie.isNum)(t.lastX),o=Yn(t);return r?{node:o,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:o,deltaX:e-t.lastX,deltaY:n-t.lastY,lastX:t.lastX,lastY:t.lastY,x:e,y:n}}function gi(t,e){const n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function vi(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function Yn(t){const e=t.findDOMNode();if(!e)throw new Error("<DraggableCore>: Unmounted during event!");return e}var Gt={},$t={};Object.defineProperty($t,"__esModule",{value:!0}),$t.default=yi;function yi(){}Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.default=void 0;var qn=bi(w),be=Zn(He),Si=Zn(Ir),ve=ie,Fe=Ne,Kn=De,St=Zn($t);function Zn(t){return t&&t.__esModule?t:{default:t}}function ao(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(ao=function(r){return r?n:e})(t)}function bi(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=ao(e);if(n&&n.has(t))return n.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}function Se(t,e,n){return e=Ri(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ri(t){var e=Ci(t,"string");return typeof e=="symbol"?e:String(e)}function Ci(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Ee={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Be=Ee.mouse,Xt=class extends qn.Component{constructor(){super(...arguments),Se(this,"dragging",!1),Se(this,"lastX",NaN),Se(this,"lastY",NaN),Se(this,"touchIdentifier",null),Se(this,"mounted",!1),Se(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&typeof e.button=="number"&&e.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||!(e.target instanceof r.defaultView.Node)||this.props.handle&&!(0,ve.matchesSelectorAndParentsTo)(e.target,this.props.handle,n)||this.props.cancel&&(0,ve.matchesSelectorAndParentsTo)(e.target,this.props.cancel,n))return;e.type==="touchstart"&&e.preventDefault();const o=(0,ve.getTouchIdentifier)(e);this.touchIdentifier=o;const a=(0,Fe.getControlPosition)(e,o,this);if(a==null)return;const{x:i,y:u}=a,s=(0,Fe.createCoreData)(this,i,u);(0,St.default)("DraggableCore: handleDragStart: %j",s),(0,St.default)("calling",this.props.onStart),!(this.props.onStart(e,s)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,ve.addUserSelectStyles)(r),this.dragging=!0,this.lastX=i,this.lastY=u,(0,ve.addEvent)(r,Be.move,this.handleDrag),(0,ve.addEvent)(r,Be.stop,this.handleDragStop))}),Se(this,"handleDrag",e=>{const n=(0,Fe.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let u=r-this.lastX,s=o-this.lastY;if([u,s]=(0,Fe.snapToGrid)(this.props.grid,u,s),!u&&!s)return;r=this.lastX+u,o=this.lastY+s}const a=(0,Fe.createCoreData)(this,r,o);if((0,St.default)("DraggableCore: handleDrag: %j",a),this.props.onDrag(e,a)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const s=document.createEvent("MouseEvents");s.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(s)}return}this.lastX=r,this.lastY=o}),Se(this,"handleDragStop",e=>{if(!this.dragging)return;const n=(0,Fe.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let s=r-this.lastX||0,c=o-this.lastY||0;[s,c]=(0,Fe.snapToGrid)(this.props.grid,s,c),r=this.lastX+s,o=this.lastY+c}const a=(0,Fe.createCoreData)(this,r,o);if(this.props.onStop(e,a)===!1||this.mounted===!1)return!1;const u=this.findDOMNode();u&&this.props.enableUserSelectHack&&(0,ve.removeUserSelectStyles)(u.ownerDocument),(0,St.default)("DraggableCore: handleDragStop: %j",a),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,u&&((0,St.default)("DraggableCore: Removing handlers"),(0,ve.removeEvent)(u.ownerDocument,Be.move,this.handleDrag),(0,ve.removeEvent)(u.ownerDocument,Be.stop,this.handleDragStop))}),Se(this,"onMouseDown",e=>(Be=Ee.mouse,this.handleDragStart(e))),Se(this,"onMouseUp",e=>(Be=Ee.mouse,this.handleDragStop(e))),Se(this,"onTouchStart",e=>(Be=Ee.touch,this.handleDragStart(e))),Se(this,"onTouchEnd",e=>(Be=Ee.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,ve.addEvent)(e,Ee.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:n}=e;(0,ve.removeEvent)(n,Ee.mouse.move,this.handleDrag),(0,ve.removeEvent)(n,Ee.touch.move,this.handleDrag),(0,ve.removeEvent)(n,Ee.mouse.stop,this.handleDragStop),(0,ve.removeEvent)(n,Ee.touch.stop,this.handleDragStop),(0,ve.removeEvent)(e,Ee.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,ve.removeUserSelectStyles)(n)}}findDOMNode(){var e,n;return(e=this.props)!==null&&e!==void 0&&e.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:Si.default.findDOMNode(this)}render(){return qn.cloneElement(qn.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Gt.default=Xt,Se(Xt,"displayName","DraggableCore"),Se(Xt,"propTypes",{allowAnyClick:be.default.bool,children:be.default.node.isRequired,disabled:be.default.bool,enableUserSelectHack:be.default.bool,offsetParent:function(t,e){if(t[e]&&t[e].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:be.default.arrayOf(be.default.number),handle:be.default.string,cancel:be.default.string,nodeRef:be.default.object,onStart:be.default.func,onDrag:be.default.func,onStop:be.default.func,onMouseDown:be.default.func,scale:be.default.number,className:Kn.dontSetMe,style:Kn.dontSetMe,transform:Kn.dontSetMe}),Se(Xt,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return s.default}}),t.default=void 0;var e=h(w),n=f(He),r=f(Ir),o=f(Wa),a=ie,i=Ne,u=De,s=f(Gt),c=f($t);function f(_){return _&&_.__esModule?_:{default:_}}function p(_){if(typeof WeakMap!="function")return null;var R=new WeakMap,x=new WeakMap;return(p=function(m){return m?x:R})(_)}function h(_,R){if(_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var x=p(R);if(x&&x.has(_))return x.get(_);var m={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in _)if(I!=="default"&&Object.prototype.hasOwnProperty.call(_,I)){var E=T?Object.getOwnPropertyDescriptor(_,I):null;E&&(E.get||E.set)?Object.defineProperty(m,I,E):m[I]=_[I]}return m.default=_,x&&x.set(_,m),m}function v(){return v=Object.assign?Object.assign.bind():function(_){for(var R=1;R<arguments.length;R++){var x=arguments[R];for(var m in x)Object.prototype.hasOwnProperty.call(x,m)&&(_[m]=x[m])}return _},v.apply(this,arguments)}function b(_,R,x){return R=y(R),R in _?Object.defineProperty(_,R,{value:x,enumerable:!0,configurable:!0,writable:!0}):_[R]=x,_}function y(_){var R=O(_,"string");return typeof R=="symbol"?R:String(R)}function O(_,R){if(typeof _!="object"||_===null)return _;var x=_[Symbol.toPrimitive];if(x!==void 0){var m=x.call(_,R||"default");if(typeof m!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(_)}class C extends e.Component{static getDerivedStateFromProps(R,x){let{position:m}=R,{prevPropsPosition:T}=x;return m&&(!T||m.x!==T.x||m.y!==T.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:m,prevPropsPosition:T}),{x:m.x,y:m.y,prevPropsPosition:{...m}}):null}constructor(R){super(R),b(this,"onDragStart",(x,m)=>{if((0,c.default)("Draggable: onDragStart: %j",m),this.props.onStart(x,(0,i.createDraggableData)(this,m))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),b(this,"onDrag",(x,m)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",m);const T=(0,i.createDraggableData)(this,m),I={x:T.x,y:T.y,slackX:0,slackY:0};if(this.props.bounds){const{x:D,y:U}=I;I.x+=this.state.slackX,I.y+=this.state.slackY;const[F,X]=(0,i.getBoundPosition)(this,I.x,I.y);I.x=F,I.y=X,I.slackX=this.state.slackX+(D-I.x),I.slackY=this.state.slackY+(U-I.y),T.x=I.x,T.y=I.y,T.deltaX=I.x-this.state.x,T.deltaY=I.y-this.state.y}if(this.props.onDrag(x,T)===!1)return!1;this.setState(I)}),b(this,"onDragStop",(x,m)=>{if(!this.state.dragging||this.props.onStop(x,(0,i.createDraggableData)(this,m))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",m);const I={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:D,y:U}=this.props.position;I.x=D,I.y=U}this.setState(I)}),this.state={dragging:!1,dragged:!1,x:R.position?R.position.x:R.defaultPosition.x,y:R.position?R.position.y:R.defaultPosition.y,prevPropsPosition:{...R.position},slackX:0,slackY:0,isElementSVG:!1},R.position&&!(R.onDrag||R.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 R,x;return(R=(x=this.props)===null||x===void 0||(x=x.nodeRef)===null||x===void 0?void 0:x.current)!==null&&R!==void 0?R:r.default.findDOMNode(this)}render(){const{axis:R,bounds:x,children:m,defaultPosition:T,defaultClassName:I,defaultClassNameDragging:E,defaultClassNameDragged:D,position:U,positionOffset:F,scale:X,...S}=this.props;let M={},W=null;const q=!!!U||this.state.dragging,de=U||T,se={x:(0,i.canDragX)(this)&&q?this.state.x:de.x,y:(0,i.canDragY)(this)&&q?this.state.y:de.y};this.state.isElementSVG?W=(0,a.createSVGTransform)(se,F):M=(0,a.createCSSTransform)(se,F);const z=(0,o.default)(m.props.className||"",I,{[E]:this.state.dragging,[D]:this.state.dragged});return e.createElement(s.default,v({},S,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(m),{className:z,style:{...m.props.style,...M},transform:W}))}}t.default=C,b(C,"displayName","Draggable"),b(C,"propTypes",{...s.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:u.dontSetMe,style:u.dontSetMe,transform:u.dontSetMe}),b(C,"defaultProps",{...s.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(qr);const{default:io,DraggableCore:Ti}=qr;Ft.exports=io,Ft.exports.default=io,Ft.exports.DraggableCore=Ti;var so=Ft.exports,Yt={exports:{}},bt={},Jn={};Jn.__esModule=!0,Jn.cloneElement=Oi;var Ii=wi(w);function wi(t){return t&&t.__esModule?t:{default:t}}function lo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function uo(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?lo(Object(n),!0).forEach(function(r){_i(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lo(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function _i(t,e,n){return e=xi(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xi(t){var e=Ei(t,"string");return typeof e=="symbol"?e:String(e)}function Ei(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Oi(t,e){return e.style&&t.props.style&&(e.style=uo(uo({},t.props.style),e.style)),e.className&&t.props.className&&(e.className=t.props.className+" "+e.className),Ii.default.cloneElement(t,e)}var Rt={};Rt.__esModule=!0,Rt.resizableProps=void 0;var H=Mi(He);function Mi(t){return t&&t.__esModule?t:{default:t}}var Pi={axis:H.default.oneOf(["both","x","y","none"]),className:H.default.string,children:H.default.element.isRequired,draggableOpts:H.default.shape({allowAnyClick:H.default.bool,cancel:H.default.string,children:H.default.node,disabled:H.default.bool,enableUserSelectHack:H.default.bool,offsetParent:H.default.node,grid:H.default.arrayOf(H.default.number),handle:H.default.string,nodeRef:H.default.object,onStart:H.default.func,onDrag:H.default.func,onStop:H.default.func,onMouseDown:H.default.func,scale:H.default.number}),height:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var a;return(a=H.default.number).isRequired.apply(a,n)}return H.default.number.apply(H.default,n)},handle:H.default.oneOfType([H.default.node,H.default.func]),handleSize:H.default.arrayOf(H.default.number),lockAspectRatio:H.default.bool,maxConstraints:H.default.arrayOf(H.default.number),minConstraints:H.default.arrayOf(H.default.number),onResizeStop:H.default.func,onResizeStart:H.default.func,onResize:H.default.func,resizeHandles:H.default.arrayOf(H.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:H.default.number,width:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var a;return(a=H.default.number).isRequired.apply(a,n)}return H.default.number.apply(H.default,n)}};Rt.resizableProps=Pi,bt.__esModule=!0,bt.default=void 0;var Ct=Vi(w),Di=so,Ni=Jn,ji=Rt,Li=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function co(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(co=function(o){return o?n:e})(t)}function Vi(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=co(e);if(n&&n.has(t))return n.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}function Qn(){return Qn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Qn.apply(this,arguments)}function Ui(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,a;for(a=0;a<r.length;a++)o=r[a],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}function fo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function er(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?fo(Object(n),!0).forEach(function(r){zi(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fo(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function zi(t,e,n){return e=Ai(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ai(t){var e=ki(t,"string");return typeof e=="symbol"?e:String(e)}function ki(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Wi(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,tr(t,e)}function tr(t,e){return tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},tr(t,e)}var nr=function(t){Wi(e,t);function e(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,[this].concat(a))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=e.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,a){var i=this.props,u=i.minConstraints,s=i.maxConstraints,c=i.lockAspectRatio;if(!u&&!s&&!c)return[o,a];if(c){var f=this.props.width/this.props.height,p=o-this.props.width,h=a-this.props.height;Math.abs(p)>Math.abs(h*f)?a=o/f:o=a*f}var v=o,b=a,y=this.slack||[0,0],O=y[0],C=y[1];return o+=O,a+=C,u&&(o=Math.max(u[0],o),a=Math.max(u[1],a)),s&&(o=Math.min(s[0],o),a=Math.min(s[1],a)),this.slack=[O+(v-o),C+(b-a)],[o,a]},n.resizeHandler=function(o,a){var i=this;return function(u,s){var c=s.node,f=s.deltaX,p=s.deltaY;o==="onResizeStart"&&i.resetData();var h=(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(!(!h&&!v)){var b=a[0],y=a[a.length-1],O=c.getBoundingClientRect();if(i.lastHandleRect!=null){if(y==="w"){var C=O.left-i.lastHandleRect.left;f+=C}if(b==="n"){var _=O.top-i.lastHandleRect.top;p+=_}}i.lastHandleRect=O,y==="w"&&(f=-f),b==="n"&&(p=-p);var R=i.props.width+(h?f/i.props.transformScale:0),x=i.props.height+(v?p/i.props.transformScale:0),m=i.runConstraints(R,x);R=m[0],x=m[1];var T=R!==i.props.width||x!==i.props.height,I=typeof i.props[o]=="function"?i.props[o]:null,E=o==="onResize"&&!T;I&&!E&&(u.persist==null||u.persist(),I(u,{node:c,size:{width:R,height:x},handle:a})),o==="onResizeStop"&&i.resetData()}}},n.renderResizeHandle=function(o,a){var i=this.props.handle;if(!i)return Ct.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:a});if(typeof i=="function")return i(o,a);var u=typeof i.type=="string",s=er({ref:a},u?{}:{handleAxis:o});return Ct.cloneElement(i,s)},n.render=function(){var o=this,a=this.props,i=a.children,u=a.className,s=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 c=a.resizeHandles;a.transformScale;var f=Ui(a,Li);return(0,Ni.cloneElement)(i,er(er({},f),{},{className:(u?u+" ":"")+"react-resizable",children:[].concat(i.props.children,c.map(function(p){var h,v=(h=o.handleRefs[p])!=null?h:o.handleRefs[p]=Ct.createRef();return Ct.createElement(Di.DraggableCore,Qn({},s,{nodeRef:v,key:"resizableHandle-"+p,onStop:o.resizeHandler("onResizeStop",p),onStart:o.resizeHandler("onResizeStart",p),onDrag:o.resizeHandler("onResize",p)}),o.renderResizeHandle(p,v))}))}))},e}(Ct.Component);bt.default=nr,nr.propTypes=ji.resizableProps,nr.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var qt={};qt.__esModule=!0,qt.default=void 0;var rr=$i(w),Hi=po(He),Fi=po(bt),Bi=Rt,Gi=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function po(t){return t&&t.__esModule?t:{default:t}}function ho(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(ho=function(o){return o?n:e})(t)}function $i(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=ho(e);if(n&&n.has(t))return n.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}function or(){return or=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},or.apply(this,arguments)}function mo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function Kt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?mo(Object(n),!0).forEach(function(r){Xi(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mo(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Xi(t,e,n){return e=Yi(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yi(t){var e=qi(t,"string");return typeof e=="symbol"?e:String(e)}function qi(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ki(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,a;for(a=0;a<r.length;a++)o=r[a],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}function Zi(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,ar(t,e)}function ar(t,e){return ar=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},ar(t,e)}var go=function(t){Zi(e,t);function e(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,[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(u,s){var c=s.size;r.props.onResize?(u.persist==null||u.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(u,s)})):r.setState(c)},r}e.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=e.prototype;return n.render=function(){var o=this.props,a=o.handle,i=o.handleSize;o.onResize;var u=o.onResizeStart,s=o.onResizeStop,c=o.draggableOpts,f=o.minConstraints,p=o.maxConstraints,h=o.lockAspectRatio,v=o.axis;o.width,o.height;var b=o.resizeHandles,y=o.style,O=o.transformScale,C=Ki(o,Gi);return rr.createElement(Fi.default,{axis:v,draggableOpts:c,handle:a,handleSize:i,height:this.state.height,lockAspectRatio:h,maxConstraints:p,minConstraints:f,onResizeStart:u,onResize:this.onResize,onResizeStop:s,resizeHandles:b,transformScale:O,width:this.state.width},rr.createElement("div",or({},C,{style:Kt(Kt({},y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},e}(rr.Component);qt.default=go,go.propTypes=Kt(Kt({},Bi.resizableProps),{},{children:Hi.default.element}),Yt.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Yt.exports.Resizable=bt.default,Yt.exports.ResizableBox=qt.default;var Ji=Yt.exports,ze={};Object.defineProperty(ze,"__esModule",{value:!0}),ze.resizeHandleType=ze.resizeHandleAxesType=ze.default=void 0;var B=vo(He),Qi=vo(w);function vo(t){return t&&t.__esModule?t:{default:t}}const es=ze.resizeHandleAxesType=B.default.arrayOf(B.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),ts=ze.resizeHandleType=B.default.oneOfType([B.default.node,B.default.func]);ze.default={className:B.default.string,style:B.default.object,width:B.default.number,autoSize:B.default.bool,cols:B.default.number,draggableCancel:B.default.string,draggableHandle:B.default.string,verticalCompact:function(t){t.verticalCompact},compactType:B.default.oneOf(["vertical","horizontal"]),layout:function(t){var e=t.layout;e!==void 0&&G.validateLayout(e,"layout")},margin:B.default.arrayOf(B.default.number),containerPadding:B.default.arrayOf(B.default.number),rowHeight:B.default.number,maxRows:B.default.number,isBounded:B.default.bool,isDraggable:B.default.bool,isResizable:B.default.bool,allowOverlap:B.default.bool,preventCollision:B.default.bool,useCSSTransforms:B.default.bool,transformScale:B.default.number,isDroppable:B.default.bool,resizeHandles:es,resizeHandle:ts,onLayoutChange:B.default.func,onDragStart:B.default.func,onDrag:B.default.func,onDragStop:B.default.func,onResizeStart:B.default.func,onResize:B.default.func,onResizeStop:B.default.func,onDrop:B.default.func,droppingItem:B.default.shape({i:B.default.string.isRequired,w:B.default.number.isRequired,h:B.default.number.isRequired}),children:function(t,e){const n=t[e],r={};Qi.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:B.default.any},Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.default=void 0;var rt=ir(w),K=ir(He),ns=so,rs=Ji,ot=G,me=Pe,yo=ze,os=ir(Nn);function ir(t){return t&&t.__esModule?t:{default:t}}function je(t,e,n){return e=as(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function as(t){var e=is(t,"string");return typeof e=="symbol"?e:String(e)}function is(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class sr extends rt.default.Component{constructor(){super(...arguments),je(this,"state",{resizing:null,dragging:null,className:""}),je(this,"elementRef",rt.default.createRef()),je(this,"onDragStart",(e,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:a}=this.props;if(!o)return;const i={top:0,left:0},{offsetParent:u}=r;if(!u)return;const s=u.getBoundingClientRect(),c=r.getBoundingClientRect(),f=c.left/a,p=s.left/a,h=c.top/a,v=s.top/a;i.left=f-p+u.scrollLeft,i.top=h-v+u.scrollTop,this.setState({dragging:i});const{x:b,y}=(0,me.calcXY)(this.getPositionParams(),i.top,i.left,this.props.w,this.props.h);return o.call(this,this.props.i,b,y,{e,node:r,newPosition:i})}),je(this,"onDrag",(e,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 u=this.state.dragging.top+a,s=this.state.dragging.left+o;const{isBounded:c,i:f,w:p,h,containerWidth:v}=this.props,b=this.getPositionParams();if(c){const{offsetParent:R}=r;if(R){const{margin:x,rowHeight:m,containerPadding:T}=this.props,I=R.clientHeight-(0,me.calcGridItemWHPx)(h,m,x[1]);u=(0,me.clamp)(u-T[1],0,I);const E=(0,me.calcGridColWidth)(b),D=v-(0,me.calcGridItemWHPx)(p,E,x[0]);s=(0,me.clamp)(s-T[0],0,D)}}const y={top:u,left:s};this.setState({dragging:y});const{containerPadding:O}=this.props,{x:C,y:_}=(0,me.calcXY)(b,u-O[1],s-O[0],p,h);return i.call(this,f,C,_,{e,node:r,newPosition:y})}),je(this,"onDragStop",(e,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:u,containerPadding:s}=this.props,{left:c,top:f}=this.state.dragging,p={top:f,left:c};this.setState({dragging:null});const{x:h,y:v}=(0,me.calcXY)(this.getPositionParams(),f-s[1],c-s[0],a,i);return o.call(this,u,h,v,{e,node:r,newPosition:p})}),je(this,"onResizeStop",(e,n,r)=>this.onResizeHandler(e,n,r,"onResizeStop")),je(this,"onResizeStart",(e,n,r)=>this.onResizeHandler(e,n,r,"onResizeStart")),je(this,"onResize",(e,n,r)=>this.onResizeHandler(e,n,r,"onResize"))}shouldComponentUpdate(e,n){if(this.props.children!==e.children||this.props.droppingPosition!==e.droppingPosition)return!0;const r=(0,me.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,me.calcGridItemPosition)(this.getPositionParams(e),e.x,e.y,e.w,e.h,n);return!(0,ot.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==e.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(e){this.moveDroppingItem(e)}moveDroppingItem(e){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=e.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 u=n.left-a.left,s=n.top-a.top;this.onDrag(n.e,{node:r,deltaX:u,deltaY:s})}}getPositionParams(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:e.cols,containerPadding:e.containerPadding,containerWidth:e.containerWidth,margin:e.margin,maxRows:e.maxRows,rowHeight:e.rowHeight}}createStyle(e){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let a;return o?a=(0,ot.setTransform)(e):(a=(0,ot.setTopLeft)(e),n&&(a.left=(0,ot.perc)(e.left/r),a.width=(0,ot.perc)(e.width/r))),a}mixinDraggable(e,n){return rt.default.createElement(ns.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},e)}curryResizeHandler(e,n){return(r,o)=>n(r,o,e)}mixinResizable(e,n,r){const{cols:o,minW:a,minH:i,maxW:u,maxH:s,transformScale:c,resizeHandles:f,resizeHandle:p}=this.props,h=this.getPositionParams(),v=(0,me.calcGridItemPosition)(h,0,0,o,0).width,b=(0,me.calcGridItemPosition)(h,0,0,a,i),y=(0,me.calcGridItemPosition)(h,0,0,u,s),O=[b.width,b.height],C=[Math.min(y.width,v),Math.min(y.height,1/0)];return rt.default.createElement(rs.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:O,maxConstraints:C,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:f,handle:p},e)}onResizeHandler(e,n,r,o){let{node:a,size:i,handle:u}=n;const s=this.props[o];if(!s)return;const{x:c,y:f,i:p,maxH:h,minH:v,containerWidth:b}=this.props,{minW:y,maxW:O}=this.props;let C=i;a&&(C=(0,ot.resizeItemInDirection)(u,r,i,b),this.setState({resizing:o==="onResizeStop"?null:C}));let{w:_,h:R}=(0,me.calcWH)(this.getPositionParams(),C.width,C.height,c,f,u);_=(0,me.clamp)(_,Math.max(y,1),O),R=(0,me.clamp)(R,v,h),s.call(this,p,_,R,{e,node:a,size:C,handle:u})}render(){const{x:e,y:n,w:r,h:o,isDraggable:a,isResizable:i,droppingPosition:u,useCSSTransforms:s}=this.props,c=(0,me.calcGridItemPosition)(this.getPositionParams(),e,n,r,o,this.state),f=rt.default.Children.only(this.props.children);let p=rt.default.cloneElement(f,{ref:this.elementRef,className:(0,os.default)("react-grid-item",f.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":a,"react-draggable-dragging":!!this.state.dragging,dropping:!!u,cssTransforms:s}),style:{...this.props.style,...f.props.style,...this.createStyle(c)}});return p=this.mixinResizable(p,c,i),p=this.mixinDraggable(p,a),p}}Ht.default=sr,je(sr,"propTypes",{children:K.default.element,cols:K.default.number.isRequired,containerWidth:K.default.number.isRequired,rowHeight:K.default.number.isRequired,margin:K.default.array.isRequired,maxRows:K.default.number.isRequired,containerPadding:K.default.array.isRequired,x:K.default.number.isRequired,y:K.default.number.isRequired,w:K.default.number.isRequired,h:K.default.number.isRequired,minW:function(t,e){const n=t[e];if(typeof n!="number")return new Error("minWidth not Number");if(n>t.w||n>t.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(t,e){const n=t[e];if(typeof n!="number")return new Error("maxWidth not Number");if(n<t.w||n<t.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(t,e){const n=t[e];if(typeof n!="number")return new Error("minHeight not Number");if(n>t.h||n>t.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(t,e){const n=t[e];if(typeof n!="number")return new Error("maxHeight not Number");if(n<t.h||n<t.minH)return new Error("maxHeight smaller than item height/minHeight")},i:K.default.string.isRequired,resizeHandles:yo.resizeHandleAxesType,resizeHandle:yo.resizeHandleType,onDragStop:K.default.func,onDragStart:K.default.func,onDrag:K.default.func,onResizeStop:K.default.func,onResizeStart:K.default.func,onResize:K.default.func,isDraggable:K.default.bool.isRequired,isResizable:K.default.bool.isRequired,isBounded:K.default.bool.isRequired,static:K.default.bool,useCSSTransforms:K.default.bool.isRequired,transformScale:K.default.number,className:K.default.string,handle:K.default.string,cancel:K.default.string,droppingPosition:K.default.shape({e:K.default.object.isRequired,left:K.default.number.isRequired,top:K.default.number.isRequired})}),je(sr,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(gt,"__esModule",{value:!0}),gt.default=void 0;var Ke=cs(w),lr=Pn,ss=ur(Nn),A=G,ls=Pe,So=ur(Ht),us=ur(ze);function ur(t){return t&&t.__esModule?t:{default:t}}function bo(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(bo=function(r){return r?n:e})(t)}function cs(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=bo(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}function ye(t,e,n){return e=ds(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ds(t){var e=fs(t,"string");return typeof e=="symbol"?e:String(e)}function fs(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Ro="react-grid-layout";let Co=!1;try{Co=/firefox/i.test(navigator.userAgent)}catch{}class Zt extends Ke.Component{constructor(){super(...arguments),ye(this,"state",{activeDrag:null,layout:(0,A.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,A.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),ye(this,"dragEnterCounter",0),ye(this,"onDragStart",(e,n,r,o)=>{let{e:a,node:i}=o;const{layout:u}=this.state,s=(0,A.getLayoutItem)(u,e);if(!s)return;const c={w:s.w,h:s.h,x:s.x,y:s.y,placeholder:!0,i:e};return this.setState({oldDragItem:(0,A.cloneLayoutItem)(s),oldLayout:u,activeDrag:c}),this.props.onDragStart(u,s,s,null,a,i)}),ye(this,"onDrag",(e,n,r,o)=>{let{e:a,node:i}=o;const{oldDragItem:u}=this.state;let{layout:s}=this.state;const{cols:c,allowOverlap:f,preventCollision:p}=this.props,h=(0,A.getLayoutItem)(s,e);if(!h)return;const v={w:h.w,h:h.h,x:h.x,y:h.y,placeholder:!0,i:e};s=(0,A.moveElement)(s,h,n,r,!0,p,(0,A.compactType)(this.props),c,f),this.props.onDrag(s,u,h,v,a,i),this.setState({layout:f?s:(0,A.compact)(s,(0,A.compactType)(this.props),c),activeDrag:v})}),ye(this,"onDragStop",(e,n,r,o)=>{let{e:a,node:i}=o;if(!this.state.activeDrag)return;const{oldDragItem:u}=this.state;let{layout:s}=this.state;const{cols:c,preventCollision:f,allowOverlap:p}=this.props,h=(0,A.getLayoutItem)(s,e);if(!h)return;s=(0,A.moveElement)(s,h,n,r,!0,f,(0,A.compactType)(this.props),c,p);const b=p?s:(0,A.compact)(s,(0,A.compactType)(this.props),c);this.props.onDragStop(b,u,h,null,a,i);const{oldLayout:y}=this.state;this.setState({activeDrag:null,layout:b,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(b,y)}),ye(this,"onResizeStart",(e,n,r,o)=>{let{e:a,node:i}=o;const{layout:u}=this.state,s=(0,A.getLayoutItem)(u,e);s&&(this.setState({oldResizeItem:(0,A.cloneLayoutItem)(s),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(u,s,s,null,a,i))}),ye(this,"onResize",(e,n,r,o)=>{let{e:a,node:i,size:u,handle:s}=o;const{oldResizeItem:c}=this.state,{layout:f}=this.state,{cols:p,preventCollision:h,allowOverlap:v}=this.props;let b=!1,y,O,C;const[_,R]=(0,A.withLayoutItem)(f,e,m=>{let T;return O=m.x,C=m.y,["sw","w","nw","n","ne"].indexOf(s)!==-1&&(["sw","nw","w"].indexOf(s)!==-1&&(O=m.x+(m.w-n),n=m.x!==O&&O<0?m.w:n,O=O<0?0:O),["ne","n","nw"].indexOf(s)!==-1&&(C=m.y+(m.h-r),r=m.y!==C&&C<0?m.h:r,C=C<0?0:C),b=!0),h&&!v&&(T=(0,A.getAllCollisions)(f,{...m,w:n,h:r,x:O,y:C}).filter(E=>E.i!==m.i).length>0,T&&(C=m.y,r=m.h,O=m.x,n=m.w,b=!1)),m.w=n,m.h=r,m});if(!R)return;y=_,b&&(y=(0,A.moveElement)(_,R,O,C,!0,this.props.preventCollision,(0,A.compactType)(this.props),p,v));const x={w:R.w,h:R.h,x:R.x,y:R.y,static:!0,i:e};this.props.onResize(y,c,R,x,a,i),this.setState({layout:v?y:(0,A.compact)(y,(0,A.compactType)(this.props),p),activeDrag:x})}),ye(this,"onResizeStop",(e,n,r,o)=>{let{e:a,node:i}=o;const{layout:u,oldResizeItem:s}=this.state,{cols:c,allowOverlap:f}=this.props,p=(0,A.getLayoutItem)(u,e),h=f?u:(0,A.compact)(u,(0,A.compactType)(this.props),c);this.props.onResizeStop(h,s,p,null,a,i);const{oldLayout:v}=this.state;this.setState({activeDrag:null,layout:h,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(h,v)}),ye(this,"onDragOver",e=>{var _;if(e.preventDefault(),e.stopPropagation(),Co&&!((_=e.nativeEvent.target)!=null&&_.classList.contains(Ro)))return!1;const{droppingItem:n,onDropDragOver:r,margin:o,cols:a,rowHeight:i,maxRows:u,width:s,containerPadding:c,transformScale:f}=this.props,p=r==null?void 0:r(e);if(p===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const h={...n,...p},{layout:v}=this.state,b=e.currentTarget.getBoundingClientRect(),y=e.clientX-b.left,O=e.clientY-b.top,C={left:y/f,top:O/f,e};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:R,top:x}=this.state.droppingPosition;(R!=y||x!=O)&&this.setState({droppingPosition:C})}}else{const R={cols:a,margin:o,maxRows:u,rowHeight:i,containerWidth:s,containerPadding:c||o},x=(0,ls.calcXY)(R,O,y,h.w,h.h);this.setState({droppingDOMNode:Ke.createElement("div",{key:h.i}),droppingPosition:C,layout:[...v,{...h,x:x.x,y:x.y,static:!1,isDraggable:!0}]})}}),ye(this,"removeDroppingPlaceholder",()=>{const{droppingItem:e,cols:n}=this.props,{layout:r}=this.state,o=(0,A.compact)(r.filter(a=>a.i!==e.i),(0,A.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),ye(this,"onDragLeave",e=>{e.preventDefault(),e.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),ye(this,"onDragEnter",e=>{e.preventDefault(),e.stopPropagation(),this.dragEnterCounter++}),ye(this,"onDrop",e=>{e.preventDefault(),e.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,e)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(e,n){let r;return n.activeDrag?null:(!(0,lr.deepEqual)(e.layout,n.propsLayout)||e.compactType!==n.compactType?r=e.layout:(0,A.childrenEqual)(e.children,n.children)||(r=n.layout),r?{layout:(0,A.synchronizeLayoutWithChildren)(r,e.children,e.cols,(0,A.compactType)(e),e.allowOverlap),compactType:e.compactType,children:e.children,propsLayout:e.layout}:null)}shouldComponentUpdate(e,n){return this.props.children!==e.children||!(0,A.fastRGLPropsEqual)(this.props,e,lr.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(e,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const e=(0,A.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return e*this.props.rowHeight+(e-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(e,n){n||(n=this.state.layout),(0,lr.deepEqual)(n,e)||this.props.onLayoutChange(e)}placeholder(){const{activeDrag:e}=this.state;if(!e)return null;const{width:n,cols:r,margin:o,containerPadding:a,rowHeight:i,maxRows:u,useCSSTransforms:s,transformScale:c}=this.props;return Ke.createElement(So.default,{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:n,cols:r,margin:o,containerPadding:a||o,maxRows:u,rowHeight:i,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:s,transformScale:c},Ke.createElement("div",null))}processGridItem(e,n){if(!e||!e.key)return;const r=(0,A.getLayoutItem)(this.state.layout,String(e.key));if(!r)return null;const{width:o,cols:a,margin:i,containerPadding:u,rowHeight:s,maxRows:c,isDraggable:f,isResizable:p,isBounded:h,useCSSTransforms:v,transformScale:b,draggableCancel:y,draggableHandle:O,resizeHandles:C,resizeHandle:_}=this.props,{mounted:R,droppingPosition:x}=this.state,m=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&f,T=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&p,I=r.resizeHandles||C,E=m&&h&&r.isBounded!==!1;return Ke.createElement(So.default,{containerWidth:o,cols:a,margin:i,containerPadding:u||i,maxRows:c,rowHeight:s,cancel:y,handle:O,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:m,isResizable:T,isBounded:E,useCSSTransforms:v&&R,usePercentages:!R,transformScale:b,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?x:void 0,resizeHandles:I,resizeHandle:_},e)}render(){const{className:e,style:n,isDroppable:r,innerRef:o}=this.props,a=(0,ss.default)(Ro,e),i={height:this.containerHeight(),...n};return Ke.createElement("div",{ref:o,className:a,style:i,onDrop:r?this.onDrop:A.noop,onDragLeave:r?this.onDragLeave:A.noop,onDragEnter:r?this.onDragEnter:A.noop,onDragOver:r?this.onDragOver:A.noop},Ke.Children.map(this.props.children,u=>this.processGridItem(u)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}gt.default=Zt,ye(Zt,"displayName","ReactGridLayout"),ye(Zt,"propTypes",us.default),ye(Zt,"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:A.noop,onDragStart:A.noop,onDrag:A.noop,onDragStop:A.noop,onResizeStart:A.noop,onResize:A.noop,onResizeStop:A.noop,onDrop:A.noop,onDropDragOver:A.noop});var Jt={},Ze={};Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.findOrGenerateResponsiveLayout=ms,Ze.getBreakpointFromWidth=ps,Ze.getColsFromBreakpoint=hs,Ze.sortBreakpoints=cr;var Qt=G;function ps(t,e){const n=cr(t);let r=n[0];for(let o=1,a=n.length;o<a;o++){const i=n[o];e>t[i]&&(r=i)}return r}function hs(t,e){if(!e[t])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+t+" is missing!");return e[t]}function ms(t,e,n,r,o,a){if(t[n])return(0,Qt.cloneLayout)(t[n]);let i=t[r];const u=cr(e),s=u.slice(u.indexOf(n));for(let c=0,f=s.length;c<f;c++){const p=s[c];if(t[p]){i=t[p];break}}return i=(0,Qt.cloneLayout)(i||[]),(0,Qt.compact)((0,Qt.correctBounds)(i,{cols:o}),a,o)}function cr(t){return Object.keys(t).sort(function(n,r){return t[n]-t[r]})}Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.default=void 0;var To=vs(w),Re=Io(He),dr=Pn,at=G,Je=Ze,gs=Io(gt);function Io(t){return t&&t.__esModule?t:{default:t}}function wo(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(wo=function(r){return r?n:e})(t)}function vs(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=wo(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}function fr(){return fr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},fr.apply(this,arguments)}function en(t,e,n){return e=ys(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ys(t){var e=Ss(t,"string");return typeof e=="symbol"?e:String(e)}function Ss(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const _o=t=>Object.prototype.toString.call(t);function tn(t,e){return t==null?null:Array.isArray(t)?t:t[e]}class pr extends To.Component{constructor(){super(...arguments),en(this,"state",this.generateInitialState()),en(this,"onLayoutChange",e=>{this.props.onLayoutChange(e,{...this.props.layouts,[this.state.breakpoint]:e})})}generateInitialState(){const{width:e,breakpoints:n,layouts:r,cols:o}=this.props,a=(0,Je.getBreakpointFromWidth)(n,e),i=(0,Je.getColsFromBreakpoint)(a,o),u=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Je.findOrGenerateResponsiveLayout)(r,n,a,a,i,u),breakpoint:a,cols:i}}static getDerivedStateFromProps(e,n){if(!(0,dr.deepEqual)(e.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,Je.findOrGenerateResponsiveLayout)(e.layouts,e.breakpoints,r,r,o,e.compactType),layouts:e.layouts}}return null}componentDidUpdate(e){(this.props.width!=e.width||this.props.breakpoint!==e.breakpoint||!(0,dr.deepEqual)(this.props.breakpoints,e.breakpoints)||!(0,dr.deepEqual)(this.props.cols,e.cols))&&this.onWidthChange(e)}onWidthChange(e){const{breakpoints:n,cols:r,layouts:o,compactType:a}=this.props,i=this.props.breakpoint||(0,Je.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),u=this.state.breakpoint,s=(0,Je.getColsFromBreakpoint)(i,r),c={...o};if(u!==i||e.breakpoints!==n||e.cols!==r){u in c||(c[u]=(0,at.cloneLayout)(this.state.layout));let h=(0,Je.findOrGenerateResponsiveLayout)(c,n,i,u,s,a);h=(0,at.synchronizeLayoutWithChildren)(h,this.props.children,s,a,this.props.allowOverlap),c[i]=h,this.props.onLayoutChange(h,c),this.props.onBreakpointChange(i,s),this.setState({breakpoint:i,layout:h,cols:s})}const f=tn(this.props.margin,i),p=tn(this.props.containerPadding,i);this.props.onWidthChange(this.props.width,f,s,p)}render(){const{breakpoint:e,breakpoints:n,cols:r,layouts:o,margin:a,containerPadding:i,onBreakpointChange:u,onLayoutChange:s,onWidthChange:c,...f}=this.props;return To.createElement(gs.default,fr({},f,{margin:tn(a,this.state.breakpoint),containerPadding:tn(i,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Jt.default=pr,en(pr,"propTypes",{breakpoint:Re.default.string,breakpoints:Re.default.object,allowOverlap:Re.default.bool,cols:Re.default.object,margin:Re.default.oneOfType([Re.default.array,Re.default.object]),containerPadding:Re.default.oneOfType([Re.default.array,Re.default.object]),layouts(t,e){if(_o(t[e])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+_o(t[e]));Object.keys(t[e]).forEach(n=>{if(!(n in t.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,at.validateLayout)(t.layouts[n],"layouts."+n)})},width:Re.default.number.isRequired,onBreakpointChange:Re.default.func,onLayoutChange:Re.default.func,onWidthChange:Re.default.func}),en(pr,"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:at.noop,onLayoutChange:at.noop,onWidthChange:at.noop});var hr={},xo=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(o,a){return o[0]===n?(r=a,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(n){var r=t(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},e.prototype.set=function(n,r){var o=t(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,o=t(r,n);~o&&r.splice(o,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.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])}},e}()}(),mr=typeof window<"u"&&typeof document<"u"&&window.document===document,nn=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")()}(),bs=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(nn):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),Rs=2;function Cs(t,e){var n=!1,r=!1,o=0;function a(){n&&(n=!1,t()),r&&u()}function i(){bs(a)}function u(){var s=Date.now();if(n){if(s-o<Rs)return;r=!0}else n=!0,r=!1,setTimeout(i,e);o=s}return u}var Ts=20,Is=["top","right","bottom","left","width","height","size","weight"],ws=typeof MutationObserver<"u",_s=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Cs(this.refresh.bind(this),Ts)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var n=this.observers_,r=n.indexOf(e);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return e.forEach(function(n){return n.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!mr||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ws?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!mr||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,r=n===void 0?"":n,o=Is.some(function(a){return!!~r.indexOf(a)});o&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),Eo=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];Object.defineProperty(t,o,{value:e[o],enumerable:!1,writable:!1,configurable:!0})}return t},it=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||nn},Oo=on(0,0,0,0);function rn(t){return parseFloat(t)||0}function Mo(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(r,o){var a=t["border-"+o+"-width"];return r+rn(a)},0)}function xs(t){for(var e=["top","right","bottom","left"],n={},r=0,o=e;r<o.length;r++){var a=o[r],i=t["padding-"+a];n[a]=rn(i)}return n}function Es(t){var e=t.getBBox();return on(0,0,e.width,e.height)}function Os(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return Oo;var r=it(t).getComputedStyle(t),o=xs(r),a=o.left+o.right,i=o.top+o.bottom,u=rn(r.width),s=rn(r.height);if(r.boxSizing==="border-box"&&(Math.round(u+a)!==e&&(u-=Mo(r,"left","right")+a),Math.round(s+i)!==n&&(s-=Mo(r,"top","bottom")+i)),!Ps(t)){var c=Math.round(u+a)-e,f=Math.round(s+i)-n;Math.abs(c)!==1&&(u-=c),Math.abs(f)!==1&&(s-=f)}return on(o.left,o.top,u,s)}var Ms=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof it(t).SVGGraphicsElement}:function(t){return t instanceof it(t).SVGElement&&typeof t.getBBox=="function"}}();function Ps(t){return t===it(t).document.documentElement}function Ds(t){return mr?Ms(t)?Es(t):Os(t):Oo}function Ns(t){var e=t.x,n=t.y,r=t.width,o=t.height,a=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,i=Object.create(a.prototype);return Eo(i,{x:e,y:n,width:r,height:o,top:n,right:e+r,bottom:o+n,left:e}),i}function on(t,e,n,r){return{x:t,y:e,width:n,height:r}}var js=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=on(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=Ds(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},t}(),Ls=function(){function t(e,n){var r=Ns(n);Eo(this,{target:e,contentRect:r})}return t}(),Vs=function(){function t(e,n,r){if(this.activeObservations_=[],this.observations_=new xo,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=n,this.callbackCtx_=r}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof it(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new js(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof it(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new Ls(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),Po=typeof WeakMap<"u"?new WeakMap:new xo,Do=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=_s.getInstance(),r=new Vs(e,n,this);Po.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){Do.prototype[t]=function(){var e;return(e=Po.get(this))[t].apply(e,arguments)}});var Us=function(){return typeof nn.ResizeObserver<"u"?nn.ResizeObserver:Do}();const zs=wr(Object.freeze(Object.defineProperty({__proto__:null,default:Us},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(hr,"__esModule",{value:!0}),hr.default=$s;var an=Hs(w),As=gr(He),ks=gr(zs),Ws=gr(Nn);function gr(t){return t&&t.__esModule?t:{default:t}}function No(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(No=function(r){return r?n:e})(t)}function Hs(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=No(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}function vr(){return vr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},vr.apply(this,arguments)}function st(t,e,n){return e=Fs(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fs(t){var e=Bs(t,"string");return typeof e=="symbol"?e:String(e)}function Bs(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Gs="react-grid-layout";function $s(t){var e;return e=class extends an.Component{constructor(){super(...arguments),st(this,"state",{width:1280}),st(this,"elementRef",an.createRef()),st(this,"mounted",!1),st(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new ks.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?an.createElement("div",{className:(0,Ws.default)(this.props.className,Gs),style:this.props.style,ref:this.elementRef}):an.createElement(t,vr({innerRef:this.elementRef},o,this.state))}},st(e,"defaultProps",{measureBeforeMount:!1}),st(e,"propTypes",{measureBeforeMount:As.default.bool}),e}(function(t){t.exports=gt.default,t.exports.utils=G,t.exports.calculateUtils=Pe,t.exports.Responsive=Jt.default,t.exports.Responsive.utils=Ze,t.exports.WidthProvider=hr.default})(Pr);var Xs=Pr.exports;const Ys=ra(Xs),Tt={type:d.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(t,e){if(!e)return!1;const n=t.get(d.IUndoRedoService),r=t.get(d.ICommandService),o=t.get(d.IUniverInstanceService),a=L.getSheetCommandTarget(o,e);if(!a)return!1;const{unitId:i,subUnitId:u}=a,s={unitId:i,subUnitId:u,cfId:e.cfId},c=l.DeleteConditionalRuleMutationUndoFactory(t,s),f=r.syncExecuteCommand(l.DeleteConditionalRuleMutation.id,s);return f&&n.pushUndoRedo({unitID:i,undoMutations:c,redoMutations:[{id:l.DeleteConditionalRuleMutation.id,params:s}]}),f}},sn={type:d.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(t,e){if(!e)return!1;const n=t.get(d.IUndoRedoService),r=t.get(d.ICommandService),o=t.get(d.IUniverInstanceService),a=t.get(l.ConditionalFormattingRuleModel),i=L.getSheetCommandTarget(o,e);if(!i)return!1;const{unitId:u,subUnitId:s}=i,c=l.transformSupportSymmetryAnchor(e.start,e.end,a.getSubunitRules(u,s)||[],y=>y.cfId);if(!c)return!1;const[f,p]=c,h={unitId:u,subUnitId:s,start:f,end:p},v=l.MoveConditionalRuleMutationUndoFactory(h),b=r.syncExecuteCommand(l.MoveConditionalRuleMutation.id,h);return b&&n.pushUndoRedo({unitID:u,redoMutations:[{id:l.MoveConditionalRuleMutation.id,params:h}],undoMutations:v}),b}},ln={cfPreview:"univer-cf-preview"},lt=t=>{var o,a;const e=t.rule;if(!e)return null;const n=w.useMemo(()=>{if(e.type===l.CFRuleType.colorScale){const i=e.config.map((c,f)=>({color:new d.ColorKit(c.color),value:f})),u=i.length-1;return new Array(5).fill("").map((c,f,p)=>f*u/(p.length-1)).map(c=>l.getColorScaleFromValue(i,c))}return null},[e]),r=w.useMemo(()=>{if(e.type===l.CFRuleType.iconSet)return e.config.map(i=>{const u=l.iconMap[i.iconType];return u&&u[Number(i.iconId)]})},[e]);switch(e.type){case l.CFRuleType.dataBar:{const{isGradient:i}=e.config,u={width:"50%",height:"100%"},s=i?`linear-gradient(to right, ${e.config.positiveColor||l.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,c=i?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||l.defaultDataBarNativeColor})`:e.config.nativeColor;return g.jsxs("div",{className:ln.cfPreview,children:[g.jsx("div",{style:{...u,background:c,border:`1px solid ${e.config.nativeColor||l.defaultDataBarNativeColor}`}}),g.jsx("div",{style:{...u,background:s,border:`1px solid ${e.config.positiveColor||l.defaultDataBarPositiveColor}`}})]})}case l.CFRuleType.colorScale:return n&&g.jsx("div",{className:ln.cfPreview,children:n.map((i,u)=>g.jsx("div",{style:{width:`${100/n.length}%`,height:"100%",background:i}},u))});case l.CFRuleType.iconSet:return r&&g.jsx("div",{className:ln.cfPreview,children:r.map((i,u)=>i?g.jsx("img",{style:{height:"100%"},src:i},u):g.jsx(mt,{},u))});case l.CFRuleType.highlightCell:{const{ul:i,st:u,it:s,bl:c,bg:f,cl:p}=e.style,h=(i==null?void 0:i.s)===d.BooleanNumber.TRUE,v=(u==null?void 0:u.s)===d.BooleanNumber.TRUE,b=s===d.BooleanNumber.TRUE,y=c===d.BooleanNumber.TRUE,O=(o=f==null?void 0:f.rgb)!=null?o:l.DEFAULT_BG_COLOR,C=(a=p==null?void 0:p.rgb)!=null?a:l.DEFAULT_FONT_COLOR,_={fontWeight:y?"bold":void 0,fontStyle:b?"italic":void 0,textDecoration:`${h?"underline":""} ${v?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:O,color:C};return g.jsx("div",{style:_,className:ln.cfPreview,children:"123"})}}return null};var qs=Object.defineProperty,Ks=Object.getOwnPropertyDescriptor,Zs=(t,e,n,r)=>{for(var o=r>1?void 0:r?Ks(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&qs(e,n,o),o},Js=(t,e)=>(n,r)=>e(n,r,t);let ut=class extends d.Disposable{constructor(e){super();Ge(this,"_initLocal",()=>{});Ge(this,"_findReplaceIndex",e=>{const n=/\{([^}]+)?\}/g,r=[];let o=n.exec(e);for(;o;)r.push({startIndex:o.index,key:Number(o[1]),endIndex:o.index+o[0].length-1}),o=n.exec(e);return r});this._localeService=e,this._initLocal()}tWithReactNode(e,...n){const r=this._localeService.getLocales(),o=e.split("."),a=r&&this._localeService.resolveKeyPath(r,o);if(typeof a=="string"){const i=[];return this._findReplaceIndex(a).forEach((u,s,c)=>{const f=c[s-1]||{startIndex:0,endIndex:-1};if(f.endIndex+1<u.startIndex){const p=a.slice(f.endIndex+1,u.startIndex);p&&i.push(p)}if(n[u.key]&&i.push(n[u.key]),s===c.length-1){const p=a.slice(u.endIndex+1);p&&i.push(p)}}),i}return[]}};ut=Zs([Js(0,d.Inject(d.LocaleService))],ut);const fe={cfRuleList:"univer-cf-rule-list",ruleSelector:"univer-rule-selector",select:"univer-select",selectSelector:"univer-select-selector",selectSelectionItem:"univer-select-selection-item",selectSelectionSearchInput:"univer-select-selection-search-input",btnList:"univer-btn-list",gap:"univer-gap",icon:"univer-icon",disabled:"univer-disabled",ruleItem:"univer-rule-item",ruleDescribe:"univer-rule-describe",ruleType:"univer-rule-type",ruleRange:"univer-rule-range",active:"univer-active",draggableHandle:"univer-draggableHandle",deleteItem:"univer-delete-item",gridLayoutWrap:"univer-grid-layout-wrap",reactGridItem:"univer-react-grid-item"},Qs=(t,e)=>{const n=t.rule;switch(n.type){case l.CFRuleType.colorScale:return e.t("sheet.cf.ruleType.colorScale");case l.CFRuleType.dataBar:return e.t("sheet.cf.ruleType.dataBar");case l.CFRuleType.iconSet:return e.t("sheet.cf.ruleType.iconSet");case l.CFRuleType.highlightCell:switch(n.subType){case l.CFSubRuleType.average:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,e.t("sheet.cf.subRuleType.average"))}case l.CFSubRuleType.duplicateValues:return e.t("sheet.cf.subRuleType.duplicateValues");case l.CFSubRuleType.uniqueValues:return e.t("sheet.cf.subRuleType.uniqueValues");case l.CFSubRuleType.number:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,...Array.isArray(n.value)?n.value.map(o=>String(o)):[String(n.value||"")])}case l.CFSubRuleType.text:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,n.value||"")}case l.CFSubRuleType.timePeriod:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`)}case l.CFSubRuleType.rank:return n.isPercent?n.isBottom?e.t("sheet.cf.preview.describe.bottomNPercent",String(n.value)):e.t("sheet.cf.preview.describe.topNPercent",String(n.value)):n.isBottom?e.t("sheet.cf.preview.describe.bottomN",String(n.value)):e.t("sheet.cf.preview.describe.topN",String(n.value));case l.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let jo=0;const el=t=>{const{onClick:e}=t,n=d.useDependency(l.ConditionalFormattingRuleModel),r=d.useDependency(d.IUniverInstanceService),o=d.useDependency(L.SheetsSelectionsService),a=d.useDependency(d.ICommandService),i=d.useDependency(d.LocaleService),u=d.useDependency(d.Injector),s=d.useDependency(ut),c=ge.useObservable(()=>r.getCurrentTypeOfUnit$(d.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),f=c.getUnitId(),p=c.getActiveSheet();if(!p)throw new Error("No active sheet found");const h=p.getSheetId(),[v,b]=w.useState([]),[y,O]=w.useState("2"),[C,_]=w.useState(0),[R,x]=w.useState(-1),[m,T]=w.useState(jo),I=w.useRef(null),E=[{label:i.t("sheet.cf.panel.workSheet"),value:"2"},{label:i.t("sheet.cf.panel.selectedRange"),value:"1"}],D=()=>{const z=n.getSubunitRules(f,h);if(!z||!z.length)return[];if(y==="1"){const Y=o.getCurrentLastSelection();if(!Y)return[];const ne=Y.range;return z.filter(pe=>pe.ranges.some(Ce=>d.Rectangle.intersects(Ce,ne)))}else if(y==="2")return[...z];return[]},[U,F]=w.useState(D);ae.useHighlightRange(v),w.useEffect(()=>{const z=a.onCommandExecuted(Y=>{Y.id===L.SetWorksheetActiveOperation.id&&_(Math.random())});return()=>z.dispose()}),w.useEffect(()=>{F(D)},[y,C,f,h]),w.useEffect(()=>{if(y==="2")return;const z=new Me.Observable(Y=>{const ne=[L.SetSelectionsOperation.id,l.AddConditionalRuleMutation.id,l.SetConditionalRuleMutation.id,l.DeleteConditionalRuleMutation.id,l.MoveConditionalRuleMutation.id],re=a.onCommandExecuted(pe=>{const{id:Ce,params:Oe}=pe,ke=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId();ne.includes(Ce)&&Oe.unitId===ke&&Y.next(null)});return()=>re.dispose()}).pipe(Me.debounceTime(16)).subscribe(()=>{F(D)});return()=>{z.unsubscribe()}},[r,y,f,h]),w.useEffect(()=>{const z=n.$ruleChange.subscribe(()=>{_(Math.random())});return()=>z.unsubscribe()},[n]),w.useEffect(()=>{const z=()=>{var pe;const re=Math.max(0,(((pe=I.current)==null?void 0:pe.getBoundingClientRect().width)||0)-8);return jo=re,re},ne=new Me.Observable(re=>{const pe=document.querySelector(".univer-sidebar");if(pe){let Ce=setTimeout(()=>{re.next()},150);const Oe=()=>{Ce&&clearTimeout(Ce),Ce=null},ke=N=>{N.propertyName==="width"&&(Oe(),re.next())};return pe.addEventListener("transitionend",ke),()=>{Oe(),pe.removeEventListener("transitionend",ke)}}}).pipe(Me.debounceTime(16)).subscribe(()=>{T(z())});return()=>{ne.unsubscribe()}},[]);const X=z=>{var re;const Y=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),ne=(re=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:re.getSheetId();if(!Y||!ne)throw new Error("No active sheet found");a.executeCommand(Tt.id,{unitId:Y,subUnitId:ne,cfId:z.cfId})},S=(z,Y)=>{x(Y.y)},M=(z,Y,ne)=>{var N;x(-1);const re=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),pe=(N=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:N.getSheetId();if(!re||!pe)throw new Error("No active sheet found");const Ce=k=>{const Z=U.length;return Math.min(Z-1,Math.max(0,k))},Oe=U[Ce(Y.y)].cfId,ke=U[Ce(ne.y)].cfId;Oe!==ke&&a.executeCommand(sn.id,{unitId:re,subUnitId:pe,start:{id:Oe,type:"self"},end:{id:ke,type:ne.y>Y.y?"after":"before"}})},W=()=>{t.onCreate()},te=()=>{y==="2"?a.executeCommand(ht.id):y==="1"&&U.map(Y=>({unitId:f,subUnitId:h,cfId:Y.cfId})).forEach(Y=>{a.executeCommand(Tt.id,Y)})},q=w.useMemo(()=>{const z=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET),Y=z.getActiveSheet();return U.filter(ne=>{const re=ne.ranges;return L.checkRangesEditablePermission(u,z.getUnitId(),Y.getSheetId(),re)})},[U]),de=q.map((z,Y)=>({i:z.cfId,x:0,w:12,y:Y,h:1,isResizable:!1})),se=w.useMemo(()=>{const z=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET),Y=z.getActiveSheet();return U.every(ne=>{const re=ne.ranges;return L.checkRangesEditablePermission(u,z.getUnitId(),Y.getSheetId(),re)})},[U]);return g.jsxs("div",{className:fe.cfRuleList,children:[g.jsxs("div",{className:fe.ruleSelector,children:[g.jsx("div",{children:s.tWithReactNode("sheet.cf.panel.managerRuleSelect",g.jsx($.Select,{className:fe.select,options:E,value:y,onChange:z=>{O(z)}})).map((z,Y)=>g.jsx("span",{children:z},Y))}),g.jsxs("div",{className:fe.btnList,children:[g.jsx($.Tooltip,{title:i.t("sheet.cf.panel.createRule"),placement:"bottom",children:g.jsx("div",{className:`${fe.icon}`,onClick:W,children:g.jsx(Or,{})})}),U.length&&se?g.jsx($.Tooltip,{title:i.t("sheet.cf.panel.clear"),placement:"bottom",children:g.jsx("div",{className:`${fe.gap} ${fe.icon}`,onClick:te,children:g.jsx(zt,{})})}):g.jsx("div",{className:`${fe.gap} ${fe.disabled}`,children:g.jsx(zt,{})})]})]}),g.jsx("div",{ref:I,className:fe.gridLayoutWrap,children:m?g.jsx(Ys,{onDragStop:M,onDragStart:S,layout:de,cols:12,rowHeight:60,width:m,margin:[0,10],draggableHandle:".draggableHandle",children:q==null?void 0:q.map((z,Y)=>g.jsx("div",{children:g.jsxs("div",{onMouseMove:()=>{z.ranges!==v&&b(z.ranges)},onMouseLeave:()=>b([]),onClick:()=>{e(z)},className:`${fe.ruleItem} ${R===Y?fe.active:""}`,children:[g.jsx("div",{className:`${fe.draggableHandle} draggableHandle`,onClick:ne=>ne.stopPropagation(),children:g.jsx(Mr,{})}),g.jsxs("div",{className:fe.ruleDescribe,children:[g.jsx("div",{className:fe.ruleType,children:Qs(z,i)}),g.jsx("div",{className:fe.ruleRange,children:z.ranges.map(ne=>bn.serializeRange(ne)).join(",")})]}),g.jsx("div",{className:fe.preview,children:g.jsx(lt,{rule:z.rule})}),g.jsx("div",{className:`${fe.deleteItem} ${R===Y?fe.active:""}`,onClick:ne=>{ne.stopPropagation(),X(z),b([])},children:g.jsx(zt,{})})]})},`${z.cfId}`))}):null})]})},It={type:d.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(t,e){if(!e)return!1;const{rule:n}=e,r=t.get(d.IUndoRedoService),o=t.get(d.ICommandService),a=t.get(l.ConditionalFormattingRuleModel),i=t.get(d.IUniverInstanceService),u=L.getSheetCommandTarget(i);if(!u)return!1;const{unitId:s,subUnitId:c}=u,f=a.createCfId(s,c),p={unitId:s,subUnitId:c,rule:{...n,cfId:n.cfId||f}},h=l.AddConditionalRuleMutationUndoFactory(t,p),v=o.syncExecuteCommand(l.AddConditionalRuleMutation.id,p);return v&&r.pushUndoRedo({unitID:s,redoMutations:[{id:l.AddConditionalRuleMutation.id,params:p}],undoMutations:[h]}),v}},un={type:d.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(t,e){if(!e)return!1;const n=t.get(d.IUndoRedoService),r=t.get(d.ICommandService),o=t.get(d.IUniverInstanceService),a=L.getSheetCommandTarget(o,e);if(!a)return!1;const{unitId:i,subUnitId:u}=a,s={unitId:i,subUnitId:u,rule:e.rule},c=l.setConditionalRuleMutationUndoFactory(t,s),f=r.syncExecuteCommand(l.SetConditionalRuleMutation.id,s);return f&&n.pushUndoRedo({unitID:i,undoMutations:c,redoMutations:[{id:l.SetConditionalRuleMutation.id,params:s}]}),f}},yr={cfColorPicker:"univer-cf-color-picker",cfColorPickerIcon:"univer-cf-color-picker-icon",iconDropdown:"univer-icon-dropdown"},Qe=t=>{const{color:e,onChange:n,disable:r=!1,iconId:o="PaintBucket",className:a,isNeedDropdownIcon:i=!0}=t,u=d.useDependency(ge.ComponentManager),s=w.useMemo(()=>new d.ColorKit(e),[e]),c=u.get(o);return c&&(r?g.jsx(c,{className:a,extend:{colorChannel1:s.isValid?e:"rgb(var(--primary-color))"}}):g.jsx($.Dropdown,{overlay:g.jsx("div",{className:`${yr.cfColorPicker} `,children:g.jsx($.ColorPicker,{color:e,onChange:n})}),children:g.jsxs("span",{className:`${yr.cfColorPickerIcon} ${a}`,children:[g.jsx(c,{extend:{colorChannel1:s.isValid?e:"rgb(var(--primary-color))"}}),i&&g.jsx(At,{className:yr.iconDropdown})]})}))},j={cfRuleStyleEditor:"univer-cf-rule-style-editor",cfPreviewWrap:"univer-cf-preview-wrap",text:"univer-text",positionRelative:"univer-position-relative",btnList:"univer-btn-list",utilItem:"univer-util-item",iconSet:"univer-icon-set",renderConfig:"univer-render-config",flex:"univer-flex",width45:"univer-width45",iconWrap:"univer-icon-wrap",icon:"univer-icon",dropdownIcon:"univer-dropdown-icon",errorInput:"univer-error-input",errorText:"univer-error-text",iconGroupList:"univer-icon-group-list",title:"univer-title",group:"univer-group",itemContent:"univer-item-content",itemWrap:"univer-item-wrap",item:"univer-item",iconItemListWrap:"univer-icon-item-list-wrap",none:"univer-none",iconItemList:"univer-icon-item-list",width100:"univer-width100",stress:"univer-stress"},et=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),Sr=t=>{var b;const{type:e,className:n,onChange:r,id:o,value:a}=t,i=d.useDependency(d.IUniverInstanceService),u=i.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),s=(b=i.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:b.getSheetId(),c=w.useMemo(()=>String(a).startsWith("=")?String(a):"=",[a]),f=w.useMemo(()=>[l.CFValueType.max,l.CFValueType.min,"none"].includes(e)?{disabled:!0}:[l.CFValueType.percent,l.CFValueType.percentile].includes(e)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[e]),p=w.useRef({}),[h,v]=w.useState(!1);return ge.useSidebarClick(y=>{var C;const O=(C=p.current)==null?void 0:C.handleOutClick;O&&O(y,()=>v(!1))}),e===l.CFValueType.formula?g.jsx("div",{style:{width:"100%",marginLeft:4},children:g.jsx(pt.FormulaEditor,{initValue:c,unitId:u,subUnitId:s,isFocus:h,onChange:(y="")=>{r(y||"")},onFocus:()=>v(!0),actions:p.current})}):g.jsx($.InputNumber,{className:n,value:Number(t.value)||0,onChange:y=>t.onChange(y||0),...f})},tl=t=>{var X;const{interceptorManager:e}=t,n=d.useDependency(d.LocaleService),r=((X=t.rule)==null?void 0:X.type)===l.CFRuleType.colorScale?t.rule:void 0,o=[et(l.CFValueType.num,n),et(l.CFValueType.percent,n),et(l.CFValueType.percentile,n),et(l.CFValueType.formula,n)],a=[et(l.CFValueType.min,n),...o],i=[et("none",n),...o],u=[et(l.CFValueType.max,n),...o],[s,c]=w.useState(()=>{var M;const S=l.CFValueType.min;return r&&((M=r.config[0])==null?void 0:M.value.type)||S}),[f,p]=w.useState(()=>{var M;const S="none";return!r||r.config.length!==3?S:((M=r.config[1])==null?void 0:M.value.type)||S}),[h,v]=w.useState(()=>{var M;const S=l.CFValueType.max;return r&&((M=r.config[r.config.length-1])==null?void 0:M.value.type)||S}),[b,y]=w.useState(()=>{if(!r)return 10;const M=r.config[0];return(M==null?void 0:M.value.value)===void 0?10:M==null?void 0:M.value.value}),[O,C]=w.useState(()=>{var W;if(!r||r.config.length!==3)return 50;const M=(W=r.config[1])==null?void 0:W.value.value;return M===void 0?50:M}),[_,R]=w.useState(()=>{var W;if(!r)return 90;const M=(W=r.config[r.config.length-1])==null?void 0:W.value.value;return M===void 0?90:M}),[x,m]=w.useState(()=>{var M;const S="#d0d9fb";return r&&((M=r.config[0])==null?void 0:M.color)||S}),[T,I]=w.useState(()=>{var M;const S="#7790f3";return!r||r.config.length!==3?S:((M=r.config[1])==null?void 0:M.color)||S}),[E,D]=w.useState(()=>{var M;const S="#2e55ef";return r&&((M=r.config[r.config.length-1])==null?void 0:M.color)||S}),U=w.useMemo(()=>S=>{const{minType:M,medianType:W,maxType:te,minValue:q,medianValue:de,maxValue:se,minColor:z,medianColor:Y,maxColor:ne}=S,re=[];return re.push({color:z,value:{type:M,value:q}}),W!=="none"&&re.push({color:Y,value:{type:W,value:de}}),re.push({color:ne,value:{type:te,value:se}}),{config:re.map((Ce,Oe)=>({...Ce,index:Oe})),type:l.CFRuleType.colorScale}},[]);w.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return U({minType:s,medianType:f,maxType:h,minValue:b,medianValue:O,maxValue:_,minColor:x,medianColor:T,maxColor:E})}}),[U,s,f,h,b,O,_,x,T,E,e]);const F=S=>{t.onChange(U(S))};return g.jsxs("div",{children:[g.jsx("div",{className:P.title,children:n.t("sheet.cf.panel.styleRule")}),g.jsx("div",{className:`${j.cfPreviewWrap}`,children:g.jsx(lt,{rule:U({minType:s,medianType:f,maxType:h,minValue:b,medianValue:O,maxValue:_,minColor:x,medianColor:T,maxColor:E})})}),g.jsx("div",{className:P.label,children:n.t("sheet.cf.valueType.min")}),g.jsxs("div",{className:`${P.labelContainer} ${P.mTSm}`,children:[g.jsx($.Select,{style:{flexShrink:0},options:a,value:s,onChange:S=>{c(S);const M=l.createDefaultValueByValueType(S,10);y(M),F({minType:S,medianType:f,maxType:h,minValue:M,medianValue:O,maxValue:_,minColor:x,medianColor:T,maxColor:E})}}),g.jsx(Sr,{id:"min",className:`${P.mLXxs}`,value:b,type:s,onChange:S=>{y(S),F({minType:s,medianType:f,maxType:h,minValue:S,medianValue:O,maxValue:_,minColor:x,medianColor:T,maxColor:E})}}),g.jsx(Qe,{className:P.mLXxs,color:x,onChange:S=>{m(S),F({minType:s,medianType:f,maxType:h,minValue:b,medianValue:O,maxValue:_,minColor:S,medianColor:T,maxColor:E})}})]}),g.jsx("div",{className:P.label,children:n.t("sheet.cf.panel.medianValue")}),g.jsxs("div",{className:`${P.labelContainer} ${P.mTSm}`,children:[g.jsx($.Select,{style:{flexShrink:0},options:i,value:f,onChange:S=>{p(S);const M=l.createDefaultValueByValueType(S,50);C(M),F({minType:s,medianType:S,maxType:h,minValue:b,medianValue:M,maxValue:_,minColor:x,medianColor:T,maxColor:E})}}),g.jsx(Sr,{id:"median",className:` ${P.mLXxs}`,value:O,type:f,onChange:S=>{C(S),F({minType:s,medianType:f,maxType:h,minValue:b,medianValue:S,maxValue:_,minColor:x,medianColor:T,maxColor:E})}}),f!=="none"&&g.jsx(Qe,{className:P.mLXxs,color:T,onChange:S=>{I(S),F({minType:s,medianType:f,maxType:h,minValue:b,medianValue:O,maxValue:_,minColor:x,medianColor:S,maxColor:E})}})]}),g.jsx("div",{className:P.label,children:n.t("sheet.cf.valueType.max")}),g.jsxs("div",{className:`${P.labelContainer} ${P.mTSm}`,children:[g.jsx($.Select,{style:{flexShrink:0},options:u,value:h,onChange:S=>{v(S);const M=l.createDefaultValueByValueType(S,90);R(M),F({minType:s,medianType:f,maxType:S,minValue:b,medianValue:O,maxValue:M,minColor:x,medianColor:T,maxColor:E})}}),g.jsx(Sr,{id:"max",className:`${P.mLXxs}`,value:_,type:h,onChange:S=>{R(S),F({minType:s,medianType:f,maxType:h,minValue:b,medianValue:O,maxValue:S,minColor:x,medianColor:T,maxColor:E})}}),g.jsx(Qe,{className:P.mLXxs,color:E,onChange:S=>{D(S),F({minType:s,medianType:f,maxType:h,minValue:b,medianValue:O,maxValue:_,minColor:x,medianColor:T,maxColor:S})}})]})]})},ct=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),Lo=t=>{var y;const{onChange:e,className:n,value:r,type:o,id:a,disabled:i=!1}=t,u=d.useDependency(d.IUniverInstanceService),s=u.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),c=(y=u.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:y.getSheetId(),f=w.useRef({}),[p,h]=w.useState(!1);ge.useSidebarClick(O=>{var _;const C=(_=f.current)==null?void 0:_.handleOutClick;C&&C(O,()=>h(!1))});const v=w.useRef(r),b=w.useMemo(()=>[l.CFValueType.percentile,l.CFValueType.percent].includes(o)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[o]);if(o===l.CFValueType.formula){const O=String(v.current).startsWith("=")?String(v.current)||"":"=";return g.jsx("div",{style:{width:"100%",marginLeft:12},children:g.jsx(pt.FormulaEditor,{initValue:O,unitId:s,subUnitId:c,isFocus:p,onChange:(C="")=>{e(C||"")},onFocus:()=>h(!0),actions:f.current})})}return g.jsx($.InputNumber,{className:n,value:Number(r)||0,disabled:i,onChange:O=>{e(O||0)},...b})},nl=t=>{var X;const{interceptorManager:e}=t,n=d.useDependency(d.LocaleService),r=((X=t.rule)==null?void 0:X.type)===l.CFRuleType.dataBar?t.rule:void 0,[o,a]=w.useState(()=>{var M;const S="0";return r?(M=r.config)!=null&&M.isGradient?"1":"0":S}),[i,u]=w.useState(()=>{var S;return r&&((S=r.config)==null?void 0:S.positiveColor)||l.defaultDataBarPositiveColor}),[s,c]=w.useState(()=>{var S;return r&&((S=r.config)==null?void 0:S.nativeColor)||l.defaultDataBarNativeColor}),f=[ct(l.CFValueType.num,n),ct(l.CFValueType.percent,n),ct(l.CFValueType.percentile,n),ct(l.CFValueType.formula,n)],p=[ct(l.CFValueType.min,n),...f],h=[ct(l.CFValueType.max,n),...f],[v,b]=w.useState(()=>{var M;const S=p[0].value;return r&&((M=r.config)==null?void 0:M.min.type)||S}),[y,O]=w.useState(()=>{var M;const S=h[0].value;return r&&((M=r.config)==null?void 0:M.max.type)||S}),[C,_]=w.useState(()=>{var W;if(!r)return 0;const M=((W=r.config)==null?void 0:W.min)||{};return M.type===l.CFValueType.formula?M.value||"=":M.value||0}),[R,x]=w.useState(()=>{var W;if(!r)return 100;const M=((W=r.config)==null?void 0:W.max)||{};return M.type===l.CFValueType.formula?M.value||"=":M.value===void 0?100:M.value}),[m,T]=w.useState(()=>r?r.isShowValue===void 0?!0:!!r.isShowValue:!0),I=S=>({config:{min:{type:S.minValueType,value:S.minValue},max:{type:S.maxValueType,value:S.maxValue},isGradient:S.isGradient==="1",positiveColor:S.positiveColor||l.defaultDataBarPositiveColor,nativeColor:S.nativeColor||l.defaultDataBarNativeColor},type:l.CFRuleType.dataBar,isShowValue:S.isShowValue});w.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return I({isGradient:o,minValue:C,minValueType:v,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:m})}}),[o,C,v,R,y,i,s,e,m]);const E=S=>{t.onChange(I(S))},D=S=>{u(S),E({isGradient:o,minValue:C,minValueType:v,maxValue:R,maxValueType:y,positiveColor:S,nativeColor:s,isShowValue:m})},U=S=>{c(S),E({isGradient:o,minValue:C,minValueType:v,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:S,isShowValue:m})},F=S=>f.map(M=>M.value).includes(S);return g.jsxs("div",{children:[g.jsx("div",{className:P.title,children:n.t("sheet.cf.panel.styleRule")}),g.jsx("div",{className:`${j.cfPreviewWrap}`,children:g.jsx(lt,{rule:I({isGradient:o,minValue:C,minValueType:v,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:m})})}),g.jsxs("div",{children:[g.jsx("div",{className:P.label,children:n.t("sheet.cf.panel.fillType")}),g.jsxs("div",{className:`${P.mTSm} ${P.mLXxs} ${P.labelContainer} `,children:[g.jsxs($.RadioGroup,{value:o,onChange:S=>{a(S),E({isGradient:S,minValue:C,minValueType:v,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:m})},children:[g.jsx($.Radio,{value:"0",children:g.jsx("span",{className:j.text,children:n.t("sheet.cf.panel.pureColor")})}),g.jsx($.Radio,{value:"1",children:g.jsx("span",{className:j.text,children:n.t("sheet.cf.panel.gradient")})})]}),g.jsxs("div",{className:`${j.utilItem} ${P.mLXl}`,children:[g.jsx($.Checkbox,{checked:!m,onChange:S=>{T(!S),E({isGradient:S,minValue:C,minValueType:v,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:!S})}}),n.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),g.jsxs("div",{children:[g.jsx("div",{className:P.label,children:n.t("sheet.cf.panel.colorSet")}),g.jsxs("div",{className:`${P.labelContainer} ${P.mTSm} ${P.mLXxs}`,children:[g.jsxs("div",{className:`${P.labelContainer}`,children:[g.jsx("div",{className:`${j.text}`,children:n.t("sheet.cf.panel.native")}),g.jsx(Qe,{color:s,onChange:U})]}),g.jsxs("div",{className:`${P.labelContainer} ${P.mLSm} `,children:[g.jsx("div",{className:`${j.text} `,children:n.t("sheet.cf.panel.positive")}),g.jsx(Qe,{color:i,onChange:D})]})]})]}),g.jsxs("div",{children:[g.jsx("div",{className:P.label,children:n.t("sheet.cf.valueType.min")}),g.jsxs("div",{className:`${P.mTSm} ${P.labelContainer}`,children:[g.jsx($.Select,{style:{width:"50%",flexShrink:0},options:p,value:v,onChange:S=>{b(S);const M=l.createDefaultValueByValueType(S,10);_(M),E({isGradient:o,minValue:M,minValueType:S,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:m})}}),g.jsx(Lo,{disabled:!F(v),id:"min",type:v,className:P.mLSm,value:C,onChange:S=>{_(S||0),E({isGradient:o,minValue:S||0,minValueType:v,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:m})}})]}),g.jsx("div",{className:P.label,children:n.t("sheet.cf.valueType.max")}),g.jsxs("div",{className:`${P.mTSm} ${P.labelContainer}`,children:[g.jsx($.Select,{style:{width:"50%",flexShrink:0},options:h,value:y,onChange:S=>{O(S);const M=l.createDefaultValueByValueType(S,90);x(M),E({isGradient:o,minValue:C,minValueType:v,maxValue:M,maxValueType:S,positiveColor:i,nativeColor:s,isShowValue:m})}}),g.jsx(Lo,{disabled:!F(y),id:"max",type:y,className:P.mLSm,value:R,onChange:S=>{x(S||0),E({isGradient:o,minValue:C,minValueType:v,maxValue:S||0,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:m})}})]})]})]})};function Vo(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=Vo(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function cn(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=Vo(t))&&(r&&(r+=" "),r+=e);return r}const Ae={cfStyleEdit:"univer-cf-style-edit",buttonItem:"univer-button-item",isActive:"univer-isActive"},dn=t=>[d.BooleanNumber.FALSE,void 0].includes(t)?d.BooleanNumber.TRUE:d.BooleanNumber.FALSE,fn=t=>t!==d.BooleanNumber.FALSE,br=t=>{const{style:e,onChange:n,className:r}=t,o=d.useDependency(ge.ComponentManager),[a,i]=w.useState(()=>{if(e!=null&&e.bl)return e.bl}),[u,s]=w.useState(()=>{if(e!=null&&e.it)return e.it}),[c,f]=w.useState(()=>{if(e!=null&&e.ul)return e.ul.s}),[p,h]=w.useState(()=>{if(e!=null&&e.st)return e.st.s}),[v,b]=w.useState(()=>{var T;const m="#2f56ef";return(T=e==null?void 0:e.cl)!=null&&T.rgb?e.cl.rgb:m}),[y,O]=w.useState(()=>{var T;const m="#e8ecfc";return(T=e==null?void 0:e.bg)!=null&&T.rgb?e.bg.rgb:m}),C=o.get("BoldSingle"),_=o.get("ItalicSingle"),R=o.get("UnderlineSingle"),x=o.get("StrikethroughSingle");return w.useEffect(()=>{const m={bl:a,it:u};v!==void 0&&(m.cl={rgb:v}),y!==void 0&&(m.bg={rgb:y}),p!==void 0&&(m.st={s:p}),c!==void 0&&(m.ul={s:c}),n(l.removeUndefinedAttr(m))},[a,u,c,p,v,y]),g.jsxs("div",{className:`${Ae.cfStyleEdit} ${r}`,children:[C&&g.jsx("div",{className:cn({[Ae.isActive]:fn(a||d.BooleanNumber.FALSE)},Ae.buttonItem),onClick:()=>i(dn(a)),children:g.jsx(C,{})}),_&&g.jsx("div",{className:cn({[Ae.isActive]:fn(u||d.BooleanNumber.FALSE)},Ae.buttonItem),onClick:()=>s(dn(u)),children:g.jsx(_,{})}),R&&g.jsx("div",{className:cn({[Ae.isActive]:fn(c||d.BooleanNumber.FALSE)},Ae.buttonItem),onClick:()=>f(dn(c)),children:g.jsx(R,{})}),x&&g.jsx("div",{className:cn({[Ae.isActive]:fn(p||d.BooleanNumber.FALSE)},Ae.buttonItem),onClick:()=>h(dn(p)),children:g.jsx(x,{})}),g.jsx(Qe,{color:v,onChange:b,iconId:"FontColor"}),g.jsx(Qe,{color:y,onChange:O,iconId:"PaintBucket"})]})},rl=t=>{var x;const{onChange:e,interceptorManager:n}=t,r=d.useDependency(d.LocaleService),a=d.useDependency(d.IUniverInstanceService).getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET),i=a.getActiveSheet(),u=((x=t.rule)==null?void 0:x.type)===l.CFRuleType.highlightCell?t.rule:void 0,s=w.useRef(null),[c,f]=w.useState(!1),p=w.useRef({}),[h,v]=w.useState({}),[b,y]=w.useState(()=>(u==null?void 0:u.subType)===l.CFSubRuleType.formula?u.value:"="),[O,C]=w.useState(void 0),_=m=>({style:m.style,value:b,type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.formula});w.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return _({style:h,formula:b})}}),[h,b,n]),w.useEffect(()=>n.intercept(n.getInterceptPoints().beforeSubmit,{handler:(T,I,E)=>O||b.length===1||!b.startsWith("=")?(C(r.t("sheet.cf.errorMessage.formulaError")),!1):E(T)}),[O,b]);const R=m=>{e(_(m))};return ge.useSidebarClick(m=>{var I;const T=(I=p.current)==null?void 0:I.handleOutClick;T&&T(m,()=>f(!1))}),g.jsxs("div",{ref:s,children:[g.jsx("div",{className:`${P.title} ${P.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),g.jsx("div",{className:`${P.mTSm}`,children:g.jsx(pt.FormulaEditor,{onChange:m=>{y(m),R({style:h,formula:m})},onVerify:(m,T)=>{!m||T.length===1?C(r.t("sheet.cf.errorMessage.formulaError")):C(void 0)},errorText:O,onFocus:()=>{f(!0)},actions:p.current,isFocus:c,initValue:b,unitId:a.getUnitId(),subUnitId:i==null?void 0:i.getSheetId()})}),g.jsx("div",{className:`${j.cfPreviewWrap} `,children:g.jsx(lt,{rule:_({style:h,formula:b})})}),g.jsx(br,{style:u==null?void 0:u.style,className:`${P.mTSm} `,onChange:m=>{v(m),R({style:m,formula:b})}})]})},pn=t=>g.jsxs("div",{style:{position:"relative"},children:[g.jsx("div",{style:{position:"absolute",zIndex:999,bottom:"-13px",fontSize:"10px",color:"red"},children:t.errorText}),t.children]}),ee=(t,e)=>({label:e.t(`sheet.cf.operator.${t}`),value:t}),ol=t=>{const{type:e,operator:n,onChange:r,value:o,interceptorManager:a}=t,i=d.useDependency(d.LocaleService),[u,s]=w.useState(()=>typeof o=="number"?o:0),[c,f]=w.useState(""),[p,h]=w.useState(()=>typeof o=="string"?o:""),[v,b]=w.useState(""),[y,O]=w.useState(()=>Array.isArray(o)?o[0]===void 0?0:o[0]:0),[C,_]=w.useState(""),[R,x]=w.useState(()=>Array.isArray(o)?o[1]===void 0?100:o[1]:100),[m,T]=w.useState("");switch(w.useEffect(()=>{switch(e){case l.CFSubRuleType.text:{[l.CFTextOperator.beginsWith,l.CFTextOperator.endsWith,l.CFTextOperator.containsText,l.CFTextOperator.notContainsText,l.CFTextOperator.equal,l.CFTextOperator.notEqual].includes(n)&&r(p);break}case l.CFSubRuleType.number:{[l.CFNumberOperator.equal,l.CFNumberOperator.notEqual,l.CFNumberOperator.greaterThan,l.CFNumberOperator.greaterThanOrEqual,l.CFNumberOperator.lessThan,l.CFNumberOperator.lessThanOrEqual].includes(n)&&r(u),[l.CFNumberOperator.between,l.CFNumberOperator.notBetween].includes(n)&&r([y,R]);break}}},[e]),w.useEffect(()=>{const I=a.intercept(a.getInterceptPoints().beforeSubmit,{handler:(E,D,U)=>{switch(e){case l.CFSubRuleType.text:if([l.CFTextOperator.beginsWith,l.CFTextOperator.containsText,l.CFTextOperator.endsWith,l.CFTextOperator.notEqual,l.CFTextOperator.notContainsText,l.CFTextOperator.equal].includes(n))return p?U(E):(b(i.t("sheet.cf.errorMessage.notBlank")),!1)}return U(E)}});return()=>{I()}},[e,u,p,n]),e){case l.CFSubRuleType.text:{if([l.CFTextOperator.beginsWith,l.CFTextOperator.endsWith,l.CFTextOperator.containsText,l.CFTextOperator.notContainsText,l.CFTextOperator.equal,l.CFTextOperator.notEqual].includes(n)){const I=E=>{h(E),r(E)};return g.jsx("div",{className:`${P.mTSm}`,children:g.jsx(pn,{errorText:v,children:g.jsx($.Input,{className:j.width100,value:p,onChange:E=>{b(""),I(E)}})})})}break}case l.CFSubRuleType.number:{if([l.CFNumberOperator.equal,l.CFNumberOperator.notEqual,l.CFNumberOperator.greaterThan,l.CFNumberOperator.greaterThanOrEqual,l.CFNumberOperator.lessThan,l.CFNumberOperator.lessThanOrEqual].includes(n)){const I=E=>{s(E||0),r(E||0),f("")};return g.jsx("div",{className:`${P.mTSm}`,children:g.jsx(pn,{errorText:c,children:g.jsx($.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:j.width100,value:u,onChange:I})})})}if([l.CFNumberOperator.between,l.CFNumberOperator.notBetween].includes(n)){const I=D=>{O(D||0),r([D||0,R]),_("")},E=D=>{x(D||0),r([y,D||0]),T("")};return g.jsxs("div",{className:`${P.mTSm} ${P.labelContainer} `,children:[g.jsx(pn,{errorText:C,children:g.jsx($.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:y,onChange:I})}),g.jsx(pn,{errorText:m,children:g.jsx($.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`${P.mLSm}`,value:R,onChange:E})})]})}}}return null},Uo=(t,e)=>{switch(t){case l.CFSubRuleType.text:return[ee(l.CFTextOperator.containsText,e),ee(l.CFTextOperator.notContainsText,e),ee(l.CFTextOperator.beginsWith,e),ee(l.CFTextOperator.endsWith,e),ee(l.CFTextOperator.equal,e),ee(l.CFTextOperator.notEqual,e),ee(l.CFTextOperator.containsBlanks,e),ee(l.CFTextOperator.notContainsBlanks,e),ee(l.CFTextOperator.containsErrors,e),ee(l.CFTextOperator.notContainsErrors,e)];case l.CFSubRuleType.number:return[ee(l.CFNumberOperator.between,e),ee(l.CFNumberOperator.notBetween,e),ee(l.CFNumberOperator.equal,e),ee(l.CFNumberOperator.notEqual,e),ee(l.CFNumberOperator.greaterThan,e),ee(l.CFNumberOperator.greaterThanOrEqual,e),ee(l.CFNumberOperator.lessThan,e),ee(l.CFNumberOperator.lessThanOrEqual,e)];case l.CFSubRuleType.timePeriod:return[ee(l.CFTimePeriodOperator.yesterday,e),ee(l.CFTimePeriodOperator.today,e),ee(l.CFTimePeriodOperator.tomorrow,e),ee(l.CFTimePeriodOperator.last7Days,e),ee(l.CFTimePeriodOperator.lastWeek,e),ee(l.CFTimePeriodOperator.thisWeek,e),ee(l.CFTimePeriodOperator.nextWeek,e),ee(l.CFTimePeriodOperator.lastMonth,e),ee(l.CFTimePeriodOperator.thisMonth,e),ee(l.CFTimePeriodOperator.nextMonth,e)]}},zo=t=>{var x;const{interceptorManager:e,onChange:n}=t,r=d.useDependency(d.LocaleService),o=((x=t.rule)==null?void 0:x.type)===l.CFRuleType.highlightCell?t.rule:void 0,[a,i]=w.useState(()=>{const m=l.CFSubRuleType.text;return o&&o.subType||m}),u=[{value:l.CFSubRuleType.text,label:r.t("sheet.cf.subRuleType.text")},{value:l.CFSubRuleType.number,label:r.t("sheet.cf.subRuleType.number")},{value:l.CFSubRuleType.timePeriod,label:r.t("sheet.cf.subRuleType.timePeriod")},{value:l.CFSubRuleType.duplicateValues,label:r.t("sheet.cf.subRuleType.duplicateValues")},{value:l.CFSubRuleType.uniqueValues,label:r.t("sheet.cf.subRuleType.uniqueValues")}],s=w.useMemo(()=>Uo(a,r),[a]),[c,f]=w.useState(()=>{const m=s?s[0].value:void 0;return o&&o.operator||m}),[p,h]=w.useState(()=>{var I;const m="";return o?(I=o.value)!=null?I:l.createDefaultValue(o.subType,o.operator):m}),[v,b]=w.useState({}),y=w.useMemo(()=>m=>{var T,I,E,D,U,F,X,S,M,W,te,q,de,se,z;switch(m.subType||a){case l.CFSubRuleType.text:{if([l.CFTextOperator.beginsWith,l.CFTextOperator.endsWith,l.CFTextOperator.containsText,l.CFTextOperator.notContainsText,l.CFTextOperator.equal,l.CFTextOperator.notEqual].includes(c))return{type:l.CFRuleType.highlightCell,subType:(T=m.subType)!=null?T:a,operator:(I=m.operator)!=null?I:c,style:(E=m.style)!=null?E:v,value:(D=m.value)!=null?D:p};break}case l.CFSubRuleType.number:{if([l.CFNumberOperator.equal,l.CFNumberOperator.notEqual,l.CFNumberOperator.greaterThan,l.CFNumberOperator.greaterThanOrEqual,l.CFNumberOperator.lessThan,l.CFNumberOperator.lessThanOrEqual].includes(c))return{type:l.CFRuleType.highlightCell,subType:(U=m.subType)!=null?U:a,operator:(F=m.operator)!=null?F:c,style:(X=m.style)!=null?X:v,value:(S=m.value)!=null?S:p};if([l.CFNumberOperator.between,l.CFNumberOperator.notBetween].includes(c))return{type:l.CFRuleType.highlightCell,subType:(M=m.subType)!=null?M:a,operator:(W=m.operator)!=null?W:c,style:(te=m.style)!=null?te:v,value:(q=m.value)!=null?q:p};break}}return{type:l.CFRuleType.highlightCell,subType:(de=m.subType)!=null?de:a,operator:(se=m.operator)!=null?se:c,style:(z=m.style)!=null?z:v}},[a,c,p,v]);w.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return y({})}}),[y,e]),w.useEffect(()=>{u.some(m=>m.value===a)||i(u[0].value)},[u]);const O=m=>{const T=m,I=Uo(T,r),E=I&&I[0].value;i(T),f(E),E&&h(l.createDefaultValue(T,E)),n(y({subType:T,operator:E}))},C=m=>{const T=m;f(T),n(y({operator:T}))},_=m=>{h(m),n(y({value:m}))},R=w.useMemo(()=>`${a}_${c}_${Math.random()}`,[a,c]);return g.jsxs("div",{children:[g.jsx("div",{className:`${P.title} ${P.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),g.jsx($.Select,{className:`${P.mTSm} ${j.width100}`,onChange:O,value:a,options:u}),(s==null?void 0:s.length)&&g.jsx($.Select,{className:`${P.mTSm} ${j.width100}`,onChange:C,value:c||"",options:s}),g.jsx(ol,{value:p,interceptorManager:e,type:a,operator:c,rule:o,onChange:_},R),g.jsx("div",{className:`${j.cfPreviewWrap}`,children:g.jsx(lt,{rule:y({})})}),g.jsx(br,{style:o==null?void 0:o.style,className:`${P.mLXxs}`,onChange:m=>{b(m),n(y({style:m}))}})]})},Ao=(t,e)=>(l.iconMap[t]||[])[Number(e)]||"",al=t=>{var s;const e=d.useDependency(d.IUniverInstanceService),n=e.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),r=(s=e.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:s.getSheetId(),o=w.useMemo(()=>t.error?j.errorInput:"",[t.error]),a=w.useRef({}),[i,u]=w.useState(!1);return ge.useSidebarClick(c=>{var p;const f=(p=a.current)==null?void 0:p.handleOutClick;f&&f(c,()=>u(!1))}),g.jsx("div",{className:j.positionRelative,children:t.type!==l.CFValueType.formula?g.jsxs(g.Fragment,{children:[g.jsx($.InputNumber,{className:o,value:Number(t.value)||0,onChange:c=>t.onChange(c!=null?c:0)}),t.error&&g.jsx("div",{className:j.errorText,children:t.error})]}):g.jsx("div",{style:{width:"100%"},children:g.jsx(pt.FormulaEditor,{initValue:String(t.value),unitId:n,subUnitId:r,isFocus:i,onChange:(c="")=>{const f=c||"";t.onChange(f)},onFocus:()=>u(!0),actions:a.current})})})},ko=(t,e,n)=>({operator:l.CFNumberOperator.greaterThan,value:{type:l.CFValueType.num,value:(n.length-1-e)*10},iconType:t,iconId:String(e)}),il=w.forwardRef((t,e)=>{const n=d.useDependency(d.LocaleService),r=o=>{t.onClick(o)};return g.jsx("div",{ref:e,className:j.iconGroupList,children:l.iconGroup.map((o,a)=>g.jsxs("div",{className:j.group,children:[g.jsx("div",{className:j.title,children:n.t(o.title)}),g.jsx("div",{className:j.itemContent,children:o.group.map(i=>g.jsx("div",{className:j.itemWrap,onClick:()=>{r(i.name)},children:g.jsx("div",{className:j.item,children:i.list.map((u,s)=>g.jsx("img",{className:j.icon,src:u},s))})},i.name))})]},a))})}),sl=t=>{const e=w.useMemo(()=>{const r=[];for(const o in l.iconMap){const a=l.iconMap[o],i=o;a.forEach((u,s)=>{r.push({iconType:i,base64:u,iconId:String(s)})})}return r},[]),n=r=>{t.onClick(r.iconType,r.iconId)};return g.jsxs("div",{className:j.iconItemListWrap,children:[g.jsxs("div",{className:j.none,onClick:()=>n({iconType:l.EMPTY_ICON_TYPE,iconId:"",base64:""}),children:[g.jsx(mt,{className:j.icon}),g.jsx("span",{children:"无单元格图标"})]}),g.jsx("div",{className:j.iconItemList,children:e.map(r=>g.jsx("div",{className:j.item,children:g.jsx("img",{onClick:()=>n(r),className:`${j.icon}`,src:r.base64})},`${r.iconType}_${r.iconId}`))})]})},ll=t=>{const{onChange:e,configList:n,errorMap:r={}}=t,o=d.useDependency(d.LocaleService),a=[{label:o.t(`sheet.cf.symbol.${l.CFNumberOperator.greaterThan}`),value:l.CFNumberOperator.greaterThan},{label:o.t(`sheet.cf.symbol.${l.CFNumberOperator.greaterThanOrEqual}`),value:l.CFNumberOperator.greaterThanOrEqual}],i=[{label:o.t(`sheet.cf.valueType.${l.CFValueType.num}`),value:l.CFValueType.num},{label:o.t(`sheet.cf.valueType.${l.CFValueType.percent}`),value:l.CFValueType.percent},{label:o.t(`sheet.cf.valueType.${l.CFValueType.percentile}`),value:l.CFValueType.percentile},{label:o.t(`sheet.cf.valueType.${l.CFValueType.formula}`),value:l.CFValueType.formula}],u=(p,h)=>{e([String(h),"value","value"],p)},s=(p,h)=>{e([String(h),"operator"],p);const v=l.createDefaultValue(l.CFSubRuleType.number,p);u(v,h)},c=(p,h)=>{e([String(h),"value","type"],p);const v=n[h],b=l.createDefaultValue(l.CFSubRuleType.number,v.operator);u(b,h)};return w.useMemo(()=>n.map((p,h)=>{const v=r[h],b=Ao(p.iconType,p.iconId),y=h===n.length-1,O=h===0,C=n[h-1],_=(C==null?void 0:C.value.type)===l.CFValueType.formula?o.t("sheet.cf.valueType.formula"):C==null?void 0:C.value.value,R=(x,m)=>{const T={...p,iconId:m,iconType:x};e([String(h)],T)};return g.jsxs("div",{className:`${h?P.mTXl:P.mTSm}`,children:[g.jsxs("div",{className:`${P.label} ${j.flex}`,children:[g.jsxs("div",{className:`${j.width45}`,children:[o.t("sheet.cf.iconSet.icon"),h+1]}),g.jsx("div",{className:`${j.width45}`,children:g.jsxs(g.Fragment,{children:[!O&&!y&&o.t("sheet.cf.iconSet.rule"),!O&&!y&&g.jsxs("span",{className:j.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${l.getOppositeOperator(C.operator)}`),_,y?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),g.jsxs("div",{className:`${j.flex} ${P.mTSm}`,children:[g.jsx("div",{className:`${j.iconWrap} ${j.width45}`,children:g.jsx($.Dropdown,{overlay:g.jsx(sl,{onClick:R,iconId:p.iconId,iconType:p.iconType}),children:g.jsxs("div",{className:j.dropdownIcon,children:[b?g.jsx("img",{src:b,className:j.icon}):g.jsx(mt,{className:j.icon}),g.jsx(At,{})]})})}),y?g.jsxs("div",{className:`${j.width45} ${P.label}`,style:{marginTop:0},children:[o.t("sheet.cf.iconSet.rule"),g.jsxs("span",{className:j.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${l.getOppositeOperator(C.operator)}`),_,y?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]}):g.jsx($.Select,{className:`${P.mL0} ${j.width45} ${P.mR0}`,options:a,value:p.operator,onChange:x=>{s(x,h)}})]}),y?g.jsx("div",{}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:`${P.mTSm} ${P.label} ${j.flex}`,children:[g.jsx("div",{className:`${j.width45}`,children:o.t("sheet.cf.iconSet.type")}),g.jsx("div",{className:`${j.width45}`,children:o.t("sheet.cf.iconSet.value")})]}),g.jsxs("div",{className:`${P.mTSm} ${j.flex}`,children:[g.jsx($.Select,{style:{flexShrink:0},className:`${j.width45} ${P.mL0}`,options:i,value:p.value.type,onChange:x=>{c(x,h)}}),g.jsx("div",{className:`${P.mL0} ${j.width45}`,children:g.jsx(al,{id:h,type:p.value.type,error:v,value:p.value.value||"",onChange:x=>u(x,h)})})]})]})]},h)}),[n,r])},ul=t=>{var x;const{interceptorManager:e}=t,n=((x=t.rule)==null?void 0:x.type)===l.CFRuleType.iconSet?t.rule:void 0,r=d.useDependency(d.LocaleService),[o,a]=w.useState({}),[i,u]=w.useState(()=>{const m=Object.keys(l.iconMap)[0];if(n&&n.config.length){const T=n.config[0].iconType;if(!n.config.some(E=>E.iconType!==T))return T}return m}),[s,c]=w.useState(()=>{if(n&&n.config.length)return d.Tools.deepClone(n==null?void 0:n.config);const m=l.iconMap[i]||[];return new Array(m.length).fill("").map((T,I,E)=>I===E.length-1?{operator:l.CFNumberOperator.lessThanOrEqual,value:{type:l.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:i,iconId:String(I)}:ko(i,I,E))}),[f,p]=w.useState(()=>n?!!n.isShowValue:!0),h=w.useMemo(()=>{const m=s.map(T=>Ao(T.iconType,T.iconId));return g.jsx("div",{className:j.iconWrap,children:m.map((T,I)=>T?g.jsx("img",{className:j.icon,src:T},I):g.jsx(mt,{className:j.icon},I))})},[s]),v=m=>{if(m.reduce((I,E,D)=>I.preType&&!I.result||m.length-1===D?I:E.value.type===l.CFValueType.formula?{preType:l.CFValueType.formula,result:!1}:I.preType?{result:I.preType===E.value.type,preType:E.value.type}:{result:!0,preType:E.value.type},{result:!0,preType:""}).result&&[l.CFValueType.num,l.CFValueType.percent,l.CFValueType.percentile].includes(m[0].value.type)){const I={};return m.forEach((E,D,U)=>{if(D-1<0||D===U.length-1)return;const X=m[D-1],S=l.getOppositeOperator(X.operator);l.compareWithNumber({operator:S,value:X.value.value},E.value.value)||(I[D]=`${r.t(`sheet.cf.form.${S}`,String(X.value.value))} `)}),I}return{}},b=(m,T)=>{d.get(s,m)!==T&&(d.set(s,m,T),c([...s]),a(v(s)))},y=m=>{u(m);const T=l.iconMap[m]||[],I=new Array(T.length).fill("").map((E,D,U)=>ko(m,D,U));c(I),a(v(I))};w.useEffect(()=>{const m=e.intercept(e.getInterceptPoints().submit,{handler(){return{type:l.CFRuleType.iconSet,isShowValue:f,config:s}}});return()=>{m()}},[f,s,e]),w.useEffect(()=>{const m=e.intercept(e.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(o).length===0}});return()=>{m()}},[f,s,e,o]);const O=()=>{const m=s.map(T=>({...T}));s.forEach((T,I)=>{const E=s.length-1-I,D=m[E];T.iconId=D.iconId,T.iconType=D.iconType}),c([...s])},C=d.useDependency(ge.ILayoutService),[_,R]=w.useState();return ge.useScrollYOverContainer(_,C.rootContainerElement),g.jsxs("div",{className:j.iconSet,children:[g.jsx("div",{className:P.title,children:r.t("sheet.cf.panel.styleRule")}),g.jsx("div",{className:`${P.mTSm}`,children:g.jsx($.Dropdown,{placement:"bottomLeft",overlay:g.jsx(il,{ref:m=>!_&&m&&R(m),iconType:i,onClick:y}),children:g.jsxs("div",{className:j.dropdownIcon,style:{width:"unset"},children:[h,g.jsx(At,{})]})})}),g.jsxs("div",{className:`${P.mTSm} ${j.renderConfig}`,children:[g.jsxs("div",{className:j.utilItem,children:[g.jsx($.Checkbox,{onChange:O}),r.t("sheet.cf.iconSet.reverseIconOrder")]}),g.jsxs("div",{className:`${j.utilItem} ${P.mLXl}`,children:[g.jsx($.Checkbox,{checked:!f,onChange:m=>{p(!m)}}),r.t("sheet.cf.iconSet.onlyShowIcon")]})]}),g.jsx(ll,{errorMap:o,onChange:b,configList:s})]})},cl=t=>{var O;const{onChange:e,interceptorManager:n}=t,r=d.useDependency(d.LocaleService),o=((O=t.rule)==null?void 0:O.type)===l.CFRuleType.highlightCell?t.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,u]=w.useState(()=>{const C=a[0].value,_=o==null?void 0:o.type;if(!o)return C;switch(_){case l.CFRuleType.highlightCell:switch(o.subType){case l.CFSubRuleType.average:return[l.CFNumberOperator.greaterThan,l.CFNumberOperator.greaterThanOrEqual].includes(o.operator)?"greaterThanAverage":[l.CFNumberOperator.lessThan,l.CFNumberOperator.lessThanOrEqual].includes(o.operator)?"lessThanAverage":C;case l.CFSubRuleType.rank:return o.isBottom?"isBottom":"isNotBottom"}}return C}),[s,c]=w.useState(()=>{const _=o==null?void 0:o.type;if(!o)return 10;switch(_){case l.CFRuleType.highlightCell:switch(o.subType){case l.CFSubRuleType.rank:return o.value||10}}return 10}),[f,p]=w.useState(()=>{const _=o==null?void 0:o.type;if(!o)return!1;switch(_){case l.CFRuleType.highlightCell:switch(o.subType){case l.CFSubRuleType.rank:return o.isPercent||!1}}return!1}),[h,v]=w.useState({}),b=C=>{const{type:_,isPercent:R,value:x,style:m}=C;if(_==="isNotBottom")return{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.rank,isPercent:R,isBottom:!1,value:x,style:m};if(_==="isBottom")return{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.rank,isPercent:R,isBottom:!0,value:x,style:m};if(_==="greaterThanAverage")return{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.average,operator:l.CFNumberOperator.greaterThan,style:m};if(_==="lessThanAverage")return{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.average,operator:l.CFNumberOperator.lessThan,style:m}};w.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return b({type:i,isPercent:f,value:s,style:h})}}),[i,f,s,h,n]);const y=C=>{e(b(C))};return g.jsxs("div",{children:[g.jsx("div",{className:`${P.title} ${P.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),g.jsx($.Select,{className:`${j.width100} ${P.mTSm}`,value:i,options:a,onChange:C=>{u(C),y({type:C,isPercent:f,value:s,style:h})}}),["isNotBottom","isBottom"].includes(i)&&g.jsxs("div",{className:`${P.labelContainer} ${P.mTSm}`,children:[g.jsx($.InputNumber,{min:1,max:1e3,value:s,onChange:C=>{const _=C||0;c(_),y({type:i,isPercent:f,value:_,style:h})}}),g.jsxs("div",{className:`${P.mLSm} ${P.labelContainer} ${j.text}`,children:[g.jsx($.Checkbox,{checked:f,onChange:C=>{p(!!C),y({type:i,isPercent:!!C,value:s,style:h})}}),r.t("sheet.cf.valueType.percent")]})]}),g.jsx("div",{className:`${j.cfPreviewWrap} `,children:g.jsx(lt,{rule:b({type:i,isPercent:f,value:s,style:h})})}),g.jsx(br,{style:o==null?void 0:o.style,className:`${P.mTSm} `,onChange:C=>{v(C),y({type:i,isPercent:f,value:s,style:C})}})]})},dl=d.createInterceptorKey("beforeSubmit"),fl=d.createInterceptorKey("submit"),Wo=t=>t.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),Ho=t=>{var e;return(e=t.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()},pl=t=>{var U,F,X;const e=d.useDependency(d.LocaleService),n=d.useDependency(d.ICommandService),r=d.useDependency(d.IUniverInstanceService),o=d.useDependency(l.ConditionalFormattingRuleModel),a=d.useDependency(L.SheetsSelectionsService),i=Wo(r),u=Ho(r),[s,c]=w.useState(!0),f=w.useRef({}),[p,h]=w.useState(void 0),v=w.useRef((F=(U=t.rule)==null?void 0:U.ranges)!=null?F:[]),b=w.useMemo(()=>{var M,W,te;let S=(M=t.rule)==null?void 0:M.ranges;return S!=null&&S.length||(S=(te=(W=a.getCurrentSelections())==null?void 0:W.map(q=>q.range))!=null?te:[]),v.current=S,S!=null&&S.length?S.map(q=>{const de=bn.serializeRange(q);return de==="NaN"?"":de}).filter(q=>!!q).join(","):""},[t.rule]),y=[{label:e.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:e.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:e.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:e.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:e.t("sheet.cf.ruleType.formula"),value:"5"},{label:e.t("sheet.cf.ruleType.iconSet"),value:"6"}],[O,C]=w.useState(()=>{var W,te;const S=(W=t.rule)==null?void 0:W.rule.type,M=y[0].value;if(!S)return M;switch(S){case l.CFRuleType.highlightCell:{switch((te=t.rule)==null?void 0:te.rule.subType){case l.CFSubRuleType.number:case l.CFSubRuleType.text:case l.CFSubRuleType.duplicateValues:case l.CFSubRuleType.uniqueValues:case l.CFSubRuleType.timePeriod:return"1";case l.CFSubRuleType.average:case l.CFSubRuleType.rank:return"2";case l.CFSubRuleType.formula:return"5"}break}case l.CFRuleType.dataBar:return"3";case l.CFRuleType.colorScale:return"4";case l.CFRuleType.iconSet:return"6"}return M}),_=w.useRef(),R=w.useMemo(()=>new d.InterceptorManager({beforeSubmit:dl,submit:fl}),[]),x=w.useMemo(()=>{switch(O){case"1":return zo;case"2":return cl;case"3":return nl;case"4":return tl;case"5":return rl;case"6":return ul;default:return zo}},[O]);w.useEffect(()=>{const S=n.onCommandExecuted(M=>{if(M.id===L.RemoveSheetMutation.id){const W=M.params;W.subUnitId===u&&W.unitId===i&&t.onCancel()}M.id===L.SetWorksheetActiveOperation.id&&t.onCancel()});return()=>S.dispose()},[]);const m=S=>{_.current=S},T=S=>{const M=S.split(",").filter(W=>!!W).map(bn.deserializeRangeWithSheet).map(W=>W.range);v.current=M},I=()=>{if(p)return;const M=(()=>{const te=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!te)throw new Error("No active sheet found");return v.current.map(se=>L.setEndForRange(se,te.getRowCount(),te.getColumnCount())).filter(se=>!(Number.isNaN(se.startRow)||Number.isNaN(se.startColumn)))})();if(R.fetchThroughInterceptors(R.getInterceptPoints().beforeSubmit)(!0,null)){const te=R.fetchThroughInterceptors(R.getInterceptPoints().submit)(null,null);if(te){const q=Wo(r),de=Ho(r);if(!q||!de)throw new Error("No active sheet found");let se={};t.rule&&t.rule.cfId?(se={...t.rule,ranges:M,rule:te},n.executeCommand(un.id,{unitId:q,subUnitId:de,rule:se}),t.onCancel()):(se={cfId:o.createCfId(q,de),ranges:M,rule:te,stopIfTrue:!1},n.executeCommand(It.id,{unitId:q,subUnitId:de,rule:se}),t.onCancel())}}},E=()=>{t.onCancel()},D=(S,M)=>{S?M.length<1?h(e.t("sheet.cf.errorMessage.rangeError")):h(void 0):h(e.t("sheet.cf.errorMessage.rangeError"))};return ge.useSidebarClick(S=>{var W;const M=(W=f.current)==null?void 0:W.handleOutClick;M&&M(S,()=>c(!1))}),g.jsxs("div",{className:j.cfRuleStyleEditor,children:[g.jsx("div",{className:P.title,children:e.t("sheet.cf.panel.range")}),g.jsx("div",{className:`${P.mTBase}`,children:g.jsx(pt.RangeSelector,{unitId:i,errorText:p,subUnitId:u,initValue:b,onChange:T,onVerify:D,onFocus:()=>c(!0),isFocus:s,actions:f.current})}),g.jsx("div",{className:P.title,children:e.t("sheet.cf.panel.styleType")}),g.jsx("div",{className:P.mTBase,children:g.jsx($.Select,{className:j.width100,value:O,options:y,onChange:S=>C(S)})}),g.jsx(x,{interceptorManager:R,rule:(X=t.rule)==null?void 0:X.rule,onChange:m}),g.jsxs("div",{className:`${P.mTBase} ${j.btnList}`,children:[g.jsx($.Button,{size:"small",onClick:E,children:e.t("sheet.cf.panel.cancel")}),g.jsx($.Button,{className:P.mLSm,size:"small",type:"primary",onClick:I,children:e.t("sheet.cf.panel.submit")})]})]})},hl=t=>{const[e,n]=w.useState(t.rule),[r,o]=w.useState(!!t.rule),a=()=>{o(!0)},i=()=>{o(!1),n(void 0)},u=s=>{n(s),o(!0)};return g.jsx("div",{className:P.conditionalFormattingWrap,children:r?g.jsx(pl,{onCancel:i,rule:e}):g.jsx(el,{onClick:u,onCreate:a})})};var ml=Object.defineProperty,gl=Object.getOwnPropertyDescriptor,vl=(t,e,n,r)=>{for(var o=r>1?void 0:r?gl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&ml(e,n,o),o},wt=(t,e)=>(n,r)=>e(n,r,t);const hn="sheet.conditional.formatting.panel";let _t=class extends d.Disposable{constructor(e,n,r,o,a){super();Ge(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=n,this._componentManager=r,this._sidebarService=o,this._localeService=a,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(d.UniverInstanceType.UNIVER_SHEET).subscribe(i=>{var u;i||(u=this._sidebarDisposable)==null||u.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(i=>{i.id===hn&&(i.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const n={id:hn,header:{title:this._localeService.t("sheet.cf.title")},children:{label:hn,rule:e,key:d.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(n)}_initPanel(){this._componentManager.register(hn,hl)}};_t=vl([wt(0,d.IUniverInstanceService),wt(1,d.Inject(d.Injector)),wt(2,d.Inject(ge.ComponentManager)),wt(3,d.Inject(ge.ISidebarService)),wt(4,d.Inject(d.LocaleService))],_t);var we=(t=>(t[t.createRule=1]="createRule",t[t.viewRule=2]="viewRule",t[t.highlightCell=3]="highlightCell",t[t.rank=4]="rank",t[t.formula=5]="formula",t[t.colorScale=6]="colorScale",t[t.dataBar=7]="dataBar",t[t.icon=8]="icon",t[t.clearRangeRules=9]="clearRangeRules",t[t.clearWorkSheetRules=10]="clearWorkSheetRules",t))(we||{});const xt={id:"sheet.operation.open.conditional.formatting.panel",type:d.CommandType.OPERATION,handler:(t,e)=>{var u;const n=t.get(_t),r=t.get(L.SheetsSelectionsService),o=t.get(d.ICommandService),a=((u=r.getCurrentSelections())==null?void 0:u.map(s=>s.range))||[];switch(e.value){case 3:{n.openPanel({...l.createDefaultRule(),ranges:a});break}case 4:{const s={...l.createDefaultRule,ranges:a,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.rank}};n.openPanel(s);break}case 5:{const s={...l.createDefaultRule,ranges:a,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.formula,value:"="}};n.openPanel(s);break}case 6:{const s={...l.createDefaultRule,ranges:a,rule:{type:l.CFRuleType.colorScale,config:[]}};n.openPanel(s);break}case 7:{const s={...l.createDefaultRule,ranges:a,rule:{type:l.CFRuleType.dataBar,isShowValue:!0}};n.openPanel(s);break}case 8:{const s={...l.createDefaultRule,ranges:a,rule:{type:l.CFRuleType.iconSet,config:[],isShowValue:!0}};n.openPanel(s);break}case 2:{n.openPanel();break}case 1:{n.openPanel({...l.createDefaultRule(),ranges:a});break}case 9:{o.executeCommand(Vt.id,{ranges:a});break}case 10:{o.executeCommand(ht.id);break}}return!0}};var yl=Object.defineProperty,Sl=Object.getOwnPropertyDescriptor,bl=(t,e,n,r)=>{for(var o=r>1?void 0:r?Sl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&yl(e,n,o),o},dt=(t,e)=>(n,r)=>e(n,r,t);let Et=class extends d.Disposable{constructor(e,n,r,o,a,i){super();Ge(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=n,this._univerInstanceService=r,this._renderManagerService=o,this._conditionalFormattingViewModel=a,this._conditionalFormattingRuleModel=i,this._initViewModelInterceptor(),this._initViewModel(),this._initSkeleton(),this._initVmEffectByRule(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}markDirtySkeleton(){var n,r,o;const e=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId();(n=this._renderManagerService.getRenderById(e))==null||n.with(ae.SheetSkeletonManagerService).reCalculate(),(o=(r=this._renderManagerService.getRenderById(e))==null?void 0:r.mainComponent)==null||o.makeDirty()}_initSkeleton(){this.disposeWithMe(this._conditionalFormattingViewModel.markDirty$.pipe(We.bufferTime(16),We.filter(e=>{const n=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return r?e.filter(o=>o.unitId===n.getUnitId()&&o.subUnitId===r.getSheetId()).length>0:!1})).subscribe(()=>this.markDirtySkeleton())),this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.pipe(We.bufferTime(16),We.filter(e=>{const n=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return r?e.filter(o=>["sort","delete"].includes(o.type)&&o.unitId===n.getUnitId()&&o.subUnitId===r.getSheetId()).length>0:!1})).subscribe(()=>this.markDirtySkeleton())),this.disposeWithMe(this._conditionalFormattingService.ruleComputeStatus$.pipe(We.bufferTime(16),We.filter(e=>{const n=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return r?e.filter(o=>o.unitId===n.getUnitId()&&o.subUnitId===r.getSheetId()).length>0:!1})).subscribe(()=>this.markDirtySkeleton()))}_initVmEffectByRule(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(e=>{const{rule:n,unitId:r,subUnitId:o}=e;switch(e.type){case"add":{this._handleRuleAdd(r,o,n);return}case"delete":{n.ranges.forEach(a=>{d.Range.foreach(a,(i,u)=>{this._conditionalFormattingViewModel.deleteCellCf(r,o,i,u,n.cfId)})}),this._conditionalFormattingViewModel.markRuleDirty(r,o,n);return}case"set":{this._handleRuleChange(r,o,n,e.oldRule);return}case"sort":{const i=this._conditionalFormattingRuleModel.getSubunitRules(r,o).map(u=>u.cfId).reduce((u,s,c)=>(u.set(s,c),u),new Map);n.ranges.forEach(u=>{d.Range.foreach(u,(s,c)=>{this._conditionalFormattingViewModel.sortCellCf(r,o,s,c,i)})})}}}))}_initViewModel(){let e=!1;this._univerInstanceService.getAllUnitsForType(d.UniverInstanceType.UNIVER_SHEET).forEach(r=>{const o=r.getUnitId(),a=this._conditionalFormattingRuleModel.getUnitRules(o);a&&[...a.keys()].forEach(i=>{a.get(i).forEach(s=>{this._handleRuleAdd(o,i,s),e=!0})})}),e&&this.markDirtySkeleton()}_handleRuleAdd(e,n,r){const a=this._conditionalFormattingRuleModel.getSubunitRules(e,n).map(i=>i.cfId).reduce((i,u,s)=>(i.set(u,s),i),new Map);r.ranges.forEach(i=>{d.Range.foreach(i,(u,s)=>{this._conditionalFormattingViewModel.pushCellCf(e,n,u,s,r.cfId),this._conditionalFormattingViewModel.sortCellCf(e,n,u,s,a)})}),this._conditionalFormattingViewModel.markRuleDirty(e,n,r)}_handleRuleChange(e,n,r,o){const i=this._conditionalFormattingRuleModel.getSubunitRules(e,n).map(c=>c.cfId).reduce((c,f,p)=>(c.set(f,p),c),new Map),u=(c,f)=>{c.ranges.forEach(p=>{d.Range.foreach(p,(h,v)=>{this._conditionalFormattingViewModel.deleteCellCf(e,n,h,v,c.cfId)})}),f.ranges.forEach(p=>{d.Range.foreach(p,(h,v)=>{this._conditionalFormattingViewModel.pushCellCf(e,n,h,v,c.cfId),this._conditionalFormattingViewModel.sortCellCf(e,n,h,v,i)})})},s=this._conditionalFormattingService.interceptorManager.intercept(this._conditionalFormattingService.interceptorManager.getInterceptPoints().beforeUpdateRuleResult,{handler:(c,f,p)=>{if(e===(c==null?void 0:c.unitId)&&n===c.subUnitId&&o.cfId===c.cfId){(this._ruleChangeCacheMap.get(c.cfId)||[]).forEach(v=>{u(v.oldRule,v.rule),v.dispose()}),this._ruleChangeCacheMap.delete(c.cfId);return}p(c)}});if(o.cfId===r.cfId){let c=this._ruleChangeCacheMap.get(o.cfId);c||(c=[],this._ruleChangeCacheMap.set(o.cfId,c)),c.push({oldRule:o,rule:r,dispose:s})}r.ranges.forEach(c=>{d.Range.foreach(c,(f,p)=>{this._conditionalFormattingViewModel.pushCellCf(e,n,f,p,o.cfId)})}),this._conditionalFormattingViewModel.markRuleDirty(e,n,r)}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(L.INTERCEPTOR_POINT.CELL_CONTENT,{effect:d.InterceptorEffectEnum.Style,handler:(e,n,r)=>{const o=this._conditionalFormattingService.composeStyle(n.unitId,n.subUnitId,n.row,n.col);if(!o)return r(e);const a=n.workbook.getStyles(),u={...(typeof(e==null?void 0:e.s)=="string"?a.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},s={...e,s:u};return o.style&&Object.assign(u,o.style),s.fontRenderExtension||(s.fontRenderExtension={},o.isShowValue!==void 0&&(s.fontRenderExtension.isSkip=!o.isShowValue)),o.dataBar&&(s.dataBar=o.dataBar),o.iconSet&&(s.iconSet=o.iconSet,s.fontRenderExtension.leftOffset=l.DEFAULT_PADDING+l.DEFAULT_WIDTH),r(s)},priority:10}))}};Et=bl([dt(0,d.Inject(L.SheetInterceptorService)),dt(1,d.Inject(l.ConditionalFormattingService)),dt(2,d.Inject(d.IUniverInstanceService)),dt(3,d.Inject(ta.IRenderManagerService)),dt(4,d.Inject(l.ConditionalFormattingViewModel)),dt(5,d.Inject(l.ConditionalFormattingRuleModel))],Et);var Rl=Object.defineProperty,Cl=Object.getOwnPropertyDescriptor,Tl=(t,e,n,r)=>{for(var o=r>1?void 0:r?Cl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Rl(e,n,o),o},Ot=(t,e)=>(n,r)=>e(n,r,t);let Mt=class extends d.Disposable{constructor(e,n,r,o,a){super();Ge(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=n,this._injector=r,this._conditionalFormattingViewModel=o,this._univerInstanceService=a,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:l.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,n,r)=>this._collectConditionalRule(e,n,r),onPasteCells:(e,n,r,o)=>{const{copyType:a=ae.COPY_TYPE.COPY,pasteType:i}=o,{range:u}=e||{},{range:s}=n;return this._generateConditionalFormattingMutations(s,{copyType:a,pasteType:i,copyRange:u})}}))}_collectConditionalRule(e,n,r){const o=new d.ObjectMatrix,a={};this._copyInfo={matrix:o,info:{unitId:e,subUnitId:n,cfMap:a}};const i=this._conditionalFormattingViewModel.getMatrix(e,n);if(!i)return;const u=this._injector.invoke(p=>ae.rangeToDiscreteRange(r,p,e,n));if(!u)return;const{rows:s,cols:c}=u,f=new Set;s.forEach((p,h)=>{c.forEach((v,b)=>{const y=this._conditionalFormattingViewModel.getCellCf(e,n,p,v,i);y&&(y.cfList.forEach(O=>f.add(O.cfId)),o.setValue(h,b,y.cfList.map(O=>O.cfId)))})}),f.forEach(p=>{const h=this._conditionalFormattingRuleModel.getRule(e,n,p);h&&(a[p]=h.rule)})}_generateConditionalFormattingMutations(e,n){const r=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET),o=r.getActiveSheet(),a=r.getUnitId();if(!o)return{redos:[],undos:[]};const i=o.getSheetId();if(n.copyType===ae.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!n.copyRange)return{redos:[],undos:[]};if(![ae.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,ae.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,ae.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(n.pasteType))return{redos:[],undos:[]};const{ranges:[u,s],mapFunc:c}=ae.virtualizeDiscreteRanges([n.copyRange,e]),f=ae.getRepeatRange(u,s,!0),p=this._conditionalFormattingViewModel.getMatrix(a,i),h={};d.Range.foreach(s,(m,T)=>{const{row:I,col:E}=c(m,T),D=this._conditionalFormattingViewModel.getCellCf(a,i,I,E,p);D&&D.cfList.forEach(U=>{if(!h[U.cfId]){const F=new d.ObjectMatrix;h[U.cfId]=F;const X=this._conditionalFormattingRuleModel.getRule(a,i,U.cfId);X==null||X.ranges.forEach(S=>{d.Range.foreach(S,(M,W)=>{F.setValue(M,W,1)})})}h[U.cfId].realDeleteValue(I,E)})});const{matrix:v,info:b}=this._copyInfo,y=[];let O=this._conditionalFormattingRuleModel.createCfId(a,i);const C={},_=m=>{if(C[m])return C[m];const T=b==null?void 0:b.cfMap[m],I=[...this._conditionalFormattingRuleModel.getSubunitRules(a,i)||[],...y].find(E=>d.Tools.diffValue(E.rule,T));if(I)return C[m]=I,I;{const E={rule:T,cfId:O,ranges:[],stopIfTrue:!1};return C[m]=E,y.push(E),O=`${Number(O)+1}`,E}};f.forEach(m=>{v&&v.forValue((T,I,E)=>{const D=d.Rectangle.getPositionRange({startRow:T,endRow:T,startColumn:I,endColumn:I},m.startRange),{row:U,col:F}=c(D.startRow,D.startColumn);E.forEach(X=>{if(!h[X]){const S=_(X),M=new d.ObjectMatrix;h[X]=M,S.ranges.forEach(W=>{d.Range.foreach(W,(te,q)=>{M.setValue(te,q,1)})})}h[X].setValue(U,F,1)})})});const R=[],x=[];for(const m in h){const T=h[m],I=L.findAllRectangle(L.createTopMatrixFromMatrix(T));if(!I.length){const E={unitId:a,subUnitId:i,cfId:m};R.push({id:l.DeleteConditionalRuleMutation.id,params:E}),x.push(...l.DeleteConditionalRuleMutationUndoFactory(this._injector,E))}if(y.some(E=>E.cfId===m)){const E=_(m),D={unitId:a,subUnitId:i,rule:{...E,ranges:I}};R.push({id:l.AddConditionalRuleMutation.id,params:D}),x.push(l.AddConditionalRuleMutationUndoFactory(this._injector,D))}else{const E=this._conditionalFormattingRuleModel.getRule(a,i,m);if(!E)continue;const D={unitId:a,subUnitId:i,rule:{...E,ranges:I}};R.push({id:l.SetConditionalRuleMutation.id,params:D}),x.push(...l.setConditionalRuleMutationUndoFactory(this._injector,D))}}return{redos:R,undos:x}}};Mt=Tl([Ot(0,d.Inject(ae.ISheetClipboardService)),Ot(1,d.Inject(l.ConditionalFormattingRuleModel)),Ot(2,d.Inject(d.Injector)),Ot(3,d.Inject(l.ConditionalFormattingViewModel)),Ot(4,d.Inject(d.IUniverInstanceService))],Mt);var Il=Object.defineProperty,wl=Object.getOwnPropertyDescriptor,_l=(t,e,n,r)=>{for(var o=r>1?void 0:r?wl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Il(e,n,o),o},mn=(t,e)=>(n,r)=>e(n,r,t);let Pt=class extends d.Disposable{constructor(t,e,n,r){super(),this._conditionalFormattingRuleModel=t,this._univerInstanceService=e,this._injector=n,this._refRangeService=r,this._initRefRange()}_initRefRange(){const t=new Map,e=(r,o,a)=>`${r}_${o}_${a}`,n=(r,o,a)=>{const i=s=>{const c=[...a.ranges],f=c.map(h=>L.handleDefaultRangeChangeWithEffectRefCommands(h,s)).filter(h=>!!h);if(l.isRangesEqual(f,c))return{redos:[],undos:[]};if(f.length){const h={unitId:r,subUnitId:o,rule:{...a,ranges:f}},v=[{id:l.SetConditionalRuleMutation.id,params:h}],b=l.setConditionalRuleMutationUndoFactory(this._injector,h);return{redos:v,undos:b}}else{const h={unitId:r,subUnitId:o,cfId:a.cfId},v=[{id:l.DeleteConditionalRuleMutation.id,params:h}],b=l.DeleteConditionalRuleMutationUndoFactory(this._injector,h);return{redos:v,undos:b}}},u=[];a.ranges.forEach(s=>{const c=this._refRangeService.registerRefRange(s,i);u.push(()=>c.dispose())}),t.set(e(r,o,a.cfId),()=>u.forEach(s=>s()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(r=>{const{unitId:o,subUnitId:a,rule:i}=r,u=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET),s=u.getActiveSheet();if(!(r.unitId!==u.getUnitId()||r.subUnitId!==(s==null?void 0:s.getSheetId())))switch(r.type){case"add":{n(r.unitId,r.subUnitId,r.rule);break}case"delete":{const c=t.get(e(o,a,i.cfId));c&&c();break}case"set":{const c=t.get(e(o,a,i.cfId));c&&c(),n(r.unitId,r.subUnitId,r.rule)}}})),this.disposeWithMe(d.toDisposable(()=>{t.forEach(r=>{r()}),t.clear()}))}};Pt=_l([mn(0,d.Inject(l.ConditionalFormattingRuleModel)),mn(1,d.Inject(d.IUniverInstanceService)),mn(2,d.Inject(d.Injector)),mn(3,d.Inject(L.RefRangeService))],Pt);var xl=Object.defineProperty,El=Object.getOwnPropertyDescriptor,Ol=(t,e,n,r)=>{for(var o=r>1?void 0:r?El(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&xl(e,n,o),o},Rr=(t,e)=>(n,r)=>e(n,r,t);let Dt=class extends d.Disposable{constructor(t,e,n){super(),this._localeService=t,this._commandService=e,this._sheetPermissionInterceptorBaseController=n,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{t.id===It.id&&(this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[L.WorkbookEditablePermission],rangeTypes:[L.RangeProtectionPermissionEditPoint],worksheetTypes:[L.WorksheetEditPermission,L.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr")))}))}};Dt=Ol([Rr(0,d.Inject(d.LocaleService)),Rr(1,d.ICommandService),Rr(2,d.Inject(ae.SheetPermissionInterceptorBaseController))],Dt);const Fo="sheets-conditional-formatting-ui.config",Bo={};var Go=Object.defineProperty,Ml=Object.getOwnPropertyDescriptor,Pl=(t,e,n)=>e in t?Go(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Dl=(t,e,n,r)=>{for(var o=r>1?void 0:r?Ml(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Go(e,n,o),o},Cr=(t,e)=>(n,r)=>e(n,r,t),$o=(t,e,n)=>Pl(t,typeof e!="symbol"?e+"":e,n);V.UniverSheetsConditionalFormattingMobileUIPlugin=class extends d.Plugin{constructor(e=Bo,n,r,o){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=o;const{menu:a,...i}=this._config;a&&this._configService.setConfig("menu",a,{merge:!0}),this._configService.setConfig(Fo,i),this._initCommand(),this._injector.add([Et]),this._injector.add([Pt]),this._injector.add([Mt]),this._injector.add([Dt]),this._injector.add([ut])}_initCommand(){[Rn,Cn,Tn,In,wn,_n,xn,En,On,xt,Tt,un,sn,It,Vt,ht].forEach(e=>{this._commandService.registerCommand(e)})}},$o(V.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${l.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),$o(V.UniverSheetsConditionalFormattingMobileUIPlugin,"type",d.UniverInstanceType.UNIVER_SHEET),V.UniverSheetsConditionalFormattingMobileUIPlugin=Dl([d.DependentOn(l.UniverSheetsConditionalFormattingPlugin),Cr(1,d.Inject(d.Injector)),Cr(2,d.Inject(d.ICommandService)),Cr(3,d.IConfigService)],V.UniverSheetsConditionalFormattingMobileUIPlugin);var Nl=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,Ll=(t,e,n,r)=>{for(var o=r>1?void 0:r?jl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Nl(e,n,o),o},Nt=(t,e)=>(n,r)=>e(n,r,t);let gn=class extends d.Disposable{constructor(t,e,n,r,o){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=n,this._conditionalFormattingRuleModel=r,this._conditionalFormattingViewModel=o,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(o,a,i,u,s)=>{var v;const c=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),f=(v=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:v.getSheetId();if(!c||!f)return;const p={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},h={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row};d.Range.foreach(i,(b,y)=>{const O=d.Rectangle.getPositionRange({startRow:b,startColumn:y,endColumn:y,endRow:b},p),C=d.Rectangle.getPositionRange({startRow:b,startColumn:y,endColumn:y,endRow:b},h),{row:_,col:R}=s(O.startRow,O.startColumn),x=this._conditionalFormattingViewModel.getCellCf(c,f,_,R),{row:m,col:T}=s(C.startRow,C.startColumn),I=this._conditionalFormattingViewModel.getCellCf(c,f,m,T);I&&I.cfList.forEach(E=>{let D=u.get(E.cfId);if(!u.get(E.cfId)){const U=this._conditionalFormattingRuleModel.getRule(c,f,E.cfId);if(!U)return;D=new d.ObjectMatrix,U.ranges.forEach(F=>{d.Range.foreach(F,(X,S)=>{D.setValue(X,S,1)})}),u.set(E.cfId,D)}D.realDeleteValue(m,T)}),x&&x.cfList.forEach(E=>{let D=u.get(E.cfId);if(!u.get(E.cfId)){const U=this._conditionalFormattingRuleModel.getRule(c,f,E.cfId);if(!U)return;D=new d.ObjectMatrix,U.ranges.forEach(F=>{d.Range.foreach(F,(X,S)=>{D.setValue(X,S,1)})}),u.set(E.cfId,D)}D.setValue(m,T,1)})})},n=(o,a)=>{var C,_,R;const i=(C=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET))==null?void 0:C.getUnitId(),u=(R=(_=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET))==null?void 0:_.getActiveSheet())==null?void 0:R.getSheetId(),s=new Map,c=[],f=[];if(!i||!u)return t();const p=ae.virtualizeDiscreteRanges([o,a]),[h,v]=p.ranges,{mapFunc:b}=p,y={row:h.startRow,col:h.startColumn};return ae.getAutoFillRepeatRange(h,v).forEach(x=>{e(y,x.repeatStartCell,x.relativeRange,s,b)}),s.forEach((x,m)=>{const T=this._conditionalFormattingRuleModel.getRule(i,u,m);if(!T)return;const I=L.findAllRectangle(L.createTopMatrixFromMatrix(x));if(I.length){const E={unitId:i,subUnitId:u,rule:{...T,ranges:I}};c.push({id:l.SetConditionalRuleMutation.id,params:E}),f.push(...l.setConditionalRuleMutationUndoFactory(this._injector,E))}else{const E={unitId:i,subUnitId:u,cfId:T.cfId};c.push({id:l.DeleteConditionalRuleMutation.id,params:E}),f.push(...l.DeleteConditionalRuleMutationUndoFactory(this._injector,E))}}),{undos:f,redos:c}},r={id:l.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(o,a,i)=>{if(i===ae.APPLY_TYPE.COPY||i===ae.APPLY_TYPE.ONLY_FORMAT||i===ae.APPLY_TYPE.SERIES){const{source:u,target:s}=o;return n(u,s)}return t()}};this.disposeWithMe(this._autoFillService.addHook(r))}};gn=Ll([Nt(0,d.Inject(d.Injector)),Nt(1,d.Inject(d.IUniverInstanceService)),Nt(2,d.Inject(ae.IAutoFillService)),Nt(3,d.Inject(l.ConditionalFormattingRuleModel)),Nt(4,d.Inject(l.ConditionalFormattingViewModel))],gn);var Vl=Object.defineProperty,Ul=Object.getOwnPropertyDescriptor,zl=(t,e,n,r)=>{for(var o=r>1?void 0:r?Ul(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Vl(e,n,o),o},jt=(t,e)=>(n,r)=>e(n,r,t);V.ConditionalFormattingClearController=class extends d.Disposable{constructor(e,n,r,o,a){super(),this._injector=e,this._univerInstanceService=n,this._sheetInterceptorService=r,this._selectionManagerService=o,this._conditionalFormattingRuleModel=a,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var a;const n=[],r=[],o={redos:n,undos:r};if([L.ClearSelectionFormatCommand.id,L.ClearSelectionAllCommand.id].includes(e.id)){const i=(a=this._selectionManagerService.getCurrentSelections())==null?void 0:a.map(b=>b.range);if(!i)return o;const u=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET),s=u.getActiveSheet();if(!s)return o;const c=u.getUnitId(),f=s.getSheetId(),p=this._conditionalFormattingRuleModel.getSubunitRules(c,f);if(!p||!p.length)return o;const{redos:h,undos:v}=Xo(this._injector,p,i,c,f);n.push(...h),r.push(...v)}return o}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:n,ranges:r})=>{const o=[],a=[],i={redos:o,undos:a};if(!r||!r.length)return i;const u=this._conditionalFormattingRuleModel.getSubunitRules(e,n);if(!u||!u.length)return i;const{redos:s,undos:c}=Xo(this._injector,u,r,e,n);return o.push(...s),a.push(...c),i}}))}},V.ConditionalFormattingClearController=zl([jt(0,d.Inject(d.Injector)),jt(1,d.Inject(d.IUniverInstanceService)),jt(2,d.Inject(L.SheetInterceptorService)),jt(3,d.Inject(L.SheetsSelectionsService)),jt(4,d.Inject(l.ConditionalFormattingRuleModel))],V.ConditionalFormattingClearController);function Xo(t,e,n,r,o){const a=[],i=[];return e.filter(u=>n.some(s=>u.ranges.some(c=>d.Rectangle.getIntersects(c,s)))).forEach(u=>{const c=new L.RangeMergeUtil().add(...u.ranges).subtract(...n).merge();if(c.length){const f={id:l.SetConditionalRuleMutation.id,params:{unitId:r,subUnitId:o,rule:{...u,ranges:c}}},p=l.setConditionalRuleMutationUndoFactory(t,f.params);a.push(f),i.push(...p)}else{const f={id:l.DeleteConditionalRuleMutation.id,params:{unitId:r,subUnitId:o,cfId:u.cfId}},p=l.DeleteConditionalRuleMutationUndoFactory(t,f.params);a.push(f),i.push(...p)}}),{redos:a,undos:i}}var Al=Object.defineProperty,kl=Object.getOwnPropertyDescriptor,Wl=(t,e,n,r)=>{for(var o=r>1?void 0:r?kl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Al(e,n,o),o},Yo=(t,e)=>(n,r)=>e(n,r,t);let vn=class extends d.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(d.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(L.AFTER_CELL_EDIT,{handler:(t,e,n)=>{var o,a;const r=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col);if(r!=null&&r.style&&(t!=null&&t.p)){const i=Object.keys(r==null?void 0:r.style);if(i.length>0){const u=d.BuildTextUtils.transform.getPlainText((a=(o=t.p.body)==null?void 0:o.dataStream)!=null?a:""),s={...(typeof t.s=="string"?e.workbook.getStyles().get(t.s):t.s)||{}};i.forEach(f=>{delete s[f]});const c={...t,s:{...s},v:u};return delete c.p,n(c)}}return n(t)}})))}};vn=Wl([Yo(0,d.Inject(L.SheetInterceptorService)),Yo(1,d.Inject(l.ConditionalFormattingService))],vn);const qo=[L.SetWorksheetActiveOperation.id,l.AddConditionalRuleMutation.id,l.SetConditionalRuleMutation.id,l.DeleteConditionalRuleMutation.id,l.MoveConditionalRuleMutation.id],Lt=[{label:"sheet.cf.ruleType.highlightCell",value:we.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:we.rank},{label:"sheet.cf.ruleType.formula",value:we.formula},{label:"sheet.cf.ruleType.colorScale",value:we.colorScale},{label:"sheet.cf.ruleType.dataBar",value:we.dataBar},{label:"sheet.cf.ruleType.iconSet",value:we.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:we.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:we.createRule},{label:"sheet.cf.menu.clearRangeRules",value:we.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:we.clearWorkSheetRules}],Hl=t=>{const e=t.get(L.SheetsSelectionsService),n=t.get(d.ICommandService),r=t.get(d.IUniverInstanceService),o=t.get(l.ConditionalFormattingRuleModel),a=new Me.Observable(s=>Me.merge(e.selectionMoveEnd$,new Me.Observable(c=>{const f=n.onCommandExecuted(p=>{var y;const{id:h,params:v}=p,b=(y=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getUnitId();qo.includes(h)&&v.unitId===b&&c.next(null)});return()=>f.dispose()})).pipe(We.debounceTime(16)).subscribe(()=>{var y;const c=((y=e.getCurrentSelections())==null?void 0:y.map(O=>O.range))||[],f=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET);if(!f)return;const p=f.getActiveSheet();if(!p)return;const b=(o.getSubunitRules(f.getUnitId(),p.getSheetId())||[]).filter(O=>O.ranges.some(C=>c.some(_=>d.Rectangle.intersects(_,C)))).map(O=>O.ranges).every(O=>L.checkRangesEditablePermission(t,f.getUnitId(),p.getSheetId(),O));s.next(b)})),i=new Me.Observable(s=>new Me.Observable(c=>{const f=n.onCommandExecuted(p=>{var y;const{id:h,params:v}=p,b=(y=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getUnitId();qo.includes(h)&&v.unitId===b&&c.next(null)});return()=>f.dispose()}).pipe(We.debounceTime(16)).subscribe(()=>{const c=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET);if(!c)return;const f=c.getActiveSheet();if(!f)return;const p=o.getSubunitRules(c.getUnitId(),f.getSheetId())||[];if(!p.length)return s.next(!1),!1;const h=p.map(v=>v.ranges).every(v=>L.checkRangesEditablePermission(t,c.getUnitId(),f.getSheetId(),v));s.next(h)})),u=new Me.Observable(s=>{a.subscribe(c=>{const f=Lt.find(p=>p.value===we.clearRangeRules);f&&(f.disabled=!c,s.next(Lt))}),i.subscribe(c=>{const f=Lt.find(p=>p.value===we.clearWorkSheetRules);f&&(f.disabled=!c,s.next(Lt))}),s.next(Lt)});return{id:xt.id,type:ge.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:u,hidden$:ge.getMenuHiddenObservable(t,d.UniverInstanceType.UNIVER_SHEET),disabled$:ae.getCurrentRangeDisable$(t,{workbookTypes:[L.WorkbookEditablePermission],worksheetTypes:[L.WorksheetSetCellStylePermission,L.WorksheetEditPermission],rangeTypes:[L.RangeProtectionPermissionEditPoint]})}},Fl={[ge.RibbonStartGroup.FORMULAS_INSERT]:{[xt.id]:{order:0,menuItemFactory:Hl}}};var Bl=Object.defineProperty,Gl=Object.getOwnPropertyDescriptor,$l=(t,e,n,r)=>{for(var o=r>1?void 0:r?Gl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Bl(e,n,o),o},Ko=(t,e)=>(n,r)=>e(n,r,t);let yn=class extends d.Disposable{constructor(e,n){super();Ge(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=n,this._menuManagerService.mergeMenu(Fl)}};yn=$l([Ko(0,d.Inject(d.Injector)),Ko(1,ge.IMenuManagerService)],yn);var Xl=Object.defineProperty,Yl=Object.getOwnPropertyDescriptor,ql=(t,e,n,r)=>{for(var o=r>1?void 0:r?Yl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Xl(e,n,o),o},ft=(t,e)=>(n,r)=>e(n,r,t);const Kl=(t,e)=>{const n=f=>f.endRow-f.startRow+1,r=f=>f.endColumn-f.startColumn+1,o=n(e)%n(t),a=r(e)%r(t),i=Math.floor(n(e)/n(t)),u=Math.floor(r(e)/r(t)),s=[],c={startRow:0,endRow:n(t)-1,startColumn:0,endColumn:r(t)-1};if(n(e)===1&&r(e)===1){const f={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return s.push({repeatRelativeRange:c,startRange:f}),s}for(let f=0;f<i+(o?.1:0);f++)for(let p=0;p<u+(a?.1:0);p++){const h=n(t)*f,v=r(t)*p,b={startRow:h+e.startRow,endRow:h+e.startRow,startColumn:v+e.startColumn,endColumn:v+e.startColumn};let y=c;f===i&&o&&(y={...y},y.endRow=y.endRow-(n(t)-o)),p===u&&a&&(y={...y},y.endColumn=y.endColumn-(r(t)-a)),s.push({repeatRelativeRange:y,startRange:b})}return s};let Sn=class extends d.Disposable{constructor(e,n,r,o,a,i){super();Ge(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=n,this._formatPainterService=r,this._sheetsSelectionsService=o,this._conditionalFormattingRuleModel=a,this._conditionalFormattingViewModel=i,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),n=(a,i,u,s,c)=>{const{unitId:f,subUnitId:p}=this._painterConfig,{targetUnitId:h,targetSubUnitId:v}=c,b={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},y={startRow:i.row,startColumn:i.col,endColumn:i.col,endRow:i.row};d.Range.foreach(u,(O,C)=>{const _=d.Rectangle.getPositionRange({startRow:O,startColumn:C,endColumn:C,endRow:O},b),R=d.Rectangle.getPositionRange({startRow:O,startColumn:C,endColumn:C,endRow:O},y),x=this._conditionalFormattingViewModel.getCellCf(f,p,_.startRow,_.startColumn),m=this._conditionalFormattingViewModel.getCellCf(h,v,R.startRow,R.startColumn);m&&m.cfList.forEach(T=>{let I=s.get(T.cfId);if(!s.get(T.cfId)){const E=this._conditionalFormattingRuleModel.getRule(h,v,T.cfId);if(!E)return;I=new d.ObjectMatrix,E.ranges.forEach(D=>{d.Range.foreach(D,(U,F)=>{I.setValue(U,F,1)})}),s.set(T.cfId,I)}I.realDeleteValue(R.startRow,R.startColumn)}),x&&x.cfList.forEach(T=>{const I=s.get(T.cfId);I&&I.setValue(R.startRow,R.startColumn,1)})})},r=(a,i,u)=>{var _;const{range:s,unitId:c,subUnitId:f}=this._painterConfig,p=a!==c||f!==i,h=new Map,v=[],b=[];if(!a||!i||!c||!f)return e();const y=(_=this._conditionalFormattingRuleModel.getSubunitRules(c,f))!=null?_:[];y==null||y.forEach(R=>{const{ranges:x,cfId:m}=R;if(x.some(T=>d.Rectangle.intersects(s,T))){const T=new d.ObjectMatrix;p||x.forEach(I=>{d.Range.foreach(I,(E,D)=>{T.setValue(E,D,1)})}),h.set(m,T)}});const O={row:s.startRow,col:s.startColumn};return Kl(s,u).forEach(R=>{n(O,{row:R.startRange.startRow,col:R.startRange.startColumn},R.repeatRelativeRange,h,{targetUnitId:a,targetSubUnitId:i})}),h.forEach((R,x)=>{if(p){const m=this._conditionalFormattingRuleModel.getRule(a,i,x),T=L.findAllRectangle(L.createTopMatrixFromMatrix(R));if(m)if(T.length){const I={unitId:a,subUnitId:i,rule:{...m,ranges:T}};v.push({id:l.SetConditionalRuleMutation.id,params:I}),b.push(...l.setConditionalRuleMutationUndoFactory(this._injector,I))}else{const I={unitId:a,subUnitId:i,cfId:m.cfId};v.push({id:l.DeleteConditionalRuleMutation.id,params:I}),b.push(...l.DeleteConditionalRuleMutationUndoFactory(this._injector,I))}else if(T.length){const I=this._conditionalFormattingRuleModel.getRule(c,f,x);if(I){const E={unitId:a,subUnitId:i,rule:{...d.Tools.deepClone(I),cfId:this._conditionalFormattingRuleModel.createCfId(a,i),ranges:T}};v.push({id:l.AddConditionalRuleMutation.id,params:E}),b.push(l.AddConditionalRuleMutationUndoFactory(this._injector,E))}}}else{const m=this._conditionalFormattingRuleModel.getRule(c,f,x);if(!m)return;const T=L.findAllRectangle(L.createTopMatrixFromMatrix(R));if(T.length){const I={unitId:c,subUnitId:f,rule:{...m,ranges:T}};v.push({id:l.SetConditionalRuleMutation.id,params:I}),b.push(...l.setConditionalRuleMutationUndoFactory(this._injector,I))}else{const I={unitId:c,subUnitId:f,cfId:m.cfId};v.push({id:l.DeleteConditionalRuleMutation.id,params:I}),b.push(...l.DeleteConditionalRuleMutationUndoFactory(this._injector,I))}}}),{undos:b,redos:v}},o={id:l.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:a=>{var i,u,s;switch(a){case ae.FormatPainterStatus.INFINITE:case ae.FormatPainterStatus.ONCE:{const c=(i=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET))==null?void 0:i.getUnitId(),f=(s=(u=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET))==null?void 0:u.getActiveSheet())==null?void 0:s.getSheetId(),p=this._sheetsSelectionsService.getCurrentLastSelection(),h=p==null?void 0:p.range;c&&f&&h&&(this._painterConfig={unitId:c,subUnitId:f,range:h});break}case ae.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(a,i,u)=>this._painterConfig?r(a,i,u):{redos:[],undos:[]}};this._formatPainterService.addHook(o)}};Sn=ql([ft(0,d.Inject(d.Injector)),ft(1,d.Inject(d.IUniverInstanceService)),ft(2,d.Inject(ae.IFormatPainterService)),ft(3,d.Inject(L.SheetsSelectionsService)),ft(4,d.Inject(l.ConditionalFormattingRuleModel)),ft(5,d.Inject(l.ConditionalFormattingViewModel))],Sn);var Zo=Object.defineProperty,Zl=Object.getOwnPropertyDescriptor,Jl=(t,e,n)=>e in t?Zo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ql=(t,e,n,r)=>{for(var o=r>1?void 0:r?Zl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Zo(e,n,o),o},Tr=(t,e)=>(n,r)=>e(n,r,t),Jo=(t,e,n)=>Jl(t,typeof e!="symbol"?e+"":e,n);V.UniverSheetsConditionalFormattingUIPlugin=class extends d.Plugin{constructor(e=Bo,n,r,o){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=o;const{menu:a,...i}=this._config;a&&this._configService.setConfig("menu",a,{merge:!0}),this._configService.setConfig(Fo,i),this._initCommand()}onStarting(){d.registerDependencies(this._injector,[[Et],[Pt],[Mt],[gn],[Dt],[_t],[yn],[ut],[vn],[V.ConditionalFormattingClearController],[Sn]]),d.touchDependencies(this._injector,[[Et]])}onReady(){d.touchDependencies(this._injector,[[yn],[_t]])}onRendered(){d.touchDependencies(this._injector,[[gn],[V.ConditionalFormattingClearController],[Mt],[vn],[ut],[Sn],[Dt],[Pt]])}_initCommand(){[Rn,Cn,Tn,In,wn,_n,xn,En,On,xt,Tt,un,sn,It,Vt,ht].forEach(e=>{this._commandService.registerCommand(e)})}},Jo(V.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${l.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),Jo(V.UniverSheetsConditionalFormattingUIPlugin,"type",d.UniverInstanceType.UNIVER_SHEET),V.UniverSheetsConditionalFormattingUIPlugin=Ql([d.DependentOn(l.UniverSheetsConditionalFormattingPlugin),Tr(1,d.Inject(d.Injector)),Tr(2,d.Inject(d.ICommandService)),Tr(3,d.IConfigService)],V.UniverSheetsConditionalFormattingUIPlugin),V.AddAverageCfCommand=Rn,V.AddCfCommand=It,V.AddColorScaleConditionalRuleCommand=Cn,V.AddDataBarConditionalRuleCommand=Tn,V.AddDuplicateValuesCfCommand=In,V.AddNumberCfCommand=wn,V.AddRankCfCommand=_n,V.AddTextCfCommand=xn,V.AddTimePeriodCfCommand=En,V.AddUniqueValuesCfCommand=On,V.ClearRangeCfCommand=Vt,V.ClearWorksheetCfCommand=ht,V.DeleteCfCommand=Tt,V.MoveCfCommand=sn,V.OpenConditionalFormattingOperator=xt,V.SetCfCommand=un,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
// index
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/preset-sheets-conditional-formatting",
|
|
3
|
-
"version": "0.5.0
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
"rxjs": ">=7.0.0"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@univerjs/sheets-conditional-formatting": "0.5.0
|
|
58
|
-
"@univerjs/sheets-conditional-formatting-ui": "0.5.0
|
|
57
|
+
"@univerjs/sheets-conditional-formatting": "0.5.0",
|
|
58
|
+
"@univerjs/sheets-conditional-formatting-ui": "0.5.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@univerjs/core": "0.5.0
|
|
61
|
+
"@univerjs/core": "0.5.0",
|
|
62
62
|
"typescript": "^5.6.3",
|
|
63
|
-
"@univerjs-infra/shared": "0.5.0
|
|
63
|
+
"@univerjs-infra/shared": "0.5.0"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"prebuild": "tsx prepare.ts",
|