@univerjs/sheets-conditional-formatting-ui 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +3 -3
- package/lib/es/index.js +3555 -3491
- package/lib/locale/en-US.json +154 -0
- package/lib/locale/ru-RU.json +154 -0
- package/lib/locale/zh-CN.json +154 -0
- package/lib/types/controllers/cf.menu.controller.d.ts +7 -2
- package/lib/types/controllers/cf.permission.controller.d.ts +10 -0
- package/lib/types/controllers/cf.render.controller.d.ts +9 -4
- package/lib/types/index.d.ts +6 -1
- package/lib/types/menu/manage-rule.d.ts +2 -2
- package/lib/types/plugin.d.ts +3 -1
- package/lib/umd/index.js +3 -3
- package/package.json +25 -23
- package/lib/types/components/hook/useHighlightRange.d.ts +0 -3
- package/lib/types/locale/index.d.ts +0 -18
package/lib/umd/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(X,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("@univerjs/core"),require("@wendellhu/redi"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets"),require("@univerjs/ui"),require("rxjs"),require("rxjs/operators"),require("react"),require("@univerjs/design"),require("@wendellhu/redi/react-bindings"),require("@univerjs/engine-formula"),require("clsx"),require("react-dom"),require("@univerjs/sheets-ui"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@wendellhu/redi","@univerjs/sheets-conditional-formatting","@univerjs/sheets","@univerjs/ui","rxjs","rxjs/operators","react","@univerjs/design","@wendellhu/redi/react-bindings","@univerjs/engine-formula","clsx","react-dom","@univerjs/sheets-ui","@univerjs/engine-render"],m):(X=typeof globalThis<"u"?globalThis:X||self,m(X.UniverSheetsConditionalFormattingUi={},X.UniverCore,X["@wendellhu/redi"],X.UniverSheetsConditionalFormatting,X.UniverSheets,X.UniverUi,X.rxjs,X.rxjs.operators,X.React,X.UniverDesign,X["@wendellhu/redi/react-bindings"],X.UniverEngineFormula,X.clsx,X.ReactDOM,X.UniverSheetsUi,X.UniverEngineRender))})(this,function(X,m,V,s,H,ve,Ce,Ee,_,G,te,wr,We,_r,le,wo){"use strict";var wd=Object.defineProperty;var _d=(X,m,V)=>m in X?wd(X,m,{enumerable:!0,configurable:!0,writable:!0,value:V}):X[m]=V;var Ge=(X,m,V)=>(_d(X,typeof m!="symbol"?m+"":m,V),V);var Lt;const _o={type:m.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=t,i=e.get(s.ConditionalFormattingRuleModel),u=e.get(m.ICommandService),l=e.get(m.IUniverInstanceService),c=H.getSheetCommandTarget(l);if(!c)return!1;const{unitId:d,subUnitId:h}=c,f=i.createCfId(d,h),v={ranges:n,cfId:f,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.average,operator:o,style:r}};return u.executeCommand(s.AddConditionalRuleMutation.id,{unitId:d,subUnitId:h,rule:v})}},Io={type:m.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,config:r,stopIfTrue:a}=t,o=e.get(s.ConditionalFormattingRuleModel),i=e.get(m.ICommandService),u=e.get(m.IUniverInstanceService),l=H.getSheetCommandTarget(u);if(!l)return!1;const{unitId:c,subUnitId:d}=l,h=o.createCfId(c,d),f={ranges:n,cfId:h,stopIfTrue:!!a,rule:{type:s.CFRuleType.colorScale,config:r}};return i.executeCommand(s.AddConditionalRuleMutation.id,{unitId:c,subUnitId:d,rule:f})}},xo={type:m.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,min:r,max:a,nativeColor:o,positiveColor:i,isGradient:u,stopIfTrue:l,isShowValue:c}=t,d=e.get(s.ConditionalFormattingRuleModel),h=e.get(m.IUniverInstanceService),f=H.getSheetCommandTarget(h);if(!f)return!1;const{unitId:v,subUnitId:y}=f,T=e.get(m.ICommandService),x=d.createCfId(v,y),w={ranges:n,cfId:x,stopIfTrue:!!l,rule:{type:s.CFRuleType.dataBar,isShowValue:c,config:{min:r,max:a,nativeColor:o,positiveColor:i,isGradient:u}}};return T.executeCommand(s.AddConditionalRuleMutation.id,{unitId:v,subUnitId:y,rule:w})}},Oo={type:m.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a}=t,o=e.get(s.ConditionalFormattingRuleModel),i=e.get(m.ICommandService),u=e.get(m.IUniverInstanceService),l=H.getSheetCommandTarget(u);if(!l)return!1;const{unitId:c,subUnitId:d}=l,h=o.createCfId(c,d),f={ranges:n,cfId:h,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.duplicateValues,style:r}};return i.executeCommand(s.AddConditionalRuleMutation.id,{unitId:c,subUnitId:d,rule:f})}},Eo={type:m.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:i}=t,u=e.get(s.ConditionalFormattingRuleModel),l=e.get(m.ICommandService),c=e.get(m.IUniverInstanceService),d=H.getSheetCommandTarget(c);if(!d)return!1;const{unitId:h,subUnitId:f}=d,v=u.createCfId(h,f);let y;if([s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(o)){const T=i;if(T.length!==2||!Array.isArray(T))return!1;y={ranges:n,cfId:v,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.number,operator:o,style:r,value:T}}}else{const T=i;if(typeof T!="number")return!1;y={ranges:n,cfId:v,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.number,operator:o,style:r,value:T}}}return l.executeCommand(s.AddConditionalRuleMutation.id,{unitId:h,subUnitId:f,rule:y})}},Mo={type:m.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,isPercent:o,isBottom:i,value:u}=t,l=e.get(s.ConditionalFormattingRuleModel),c=e.get(m.IUniverInstanceService),d=e.get(m.ICommandService),h=H.getSheetCommandTarget(c);if(!h)return!1;const{unitId:f,subUnitId:v}=h,y=l.createCfId(f,v),T={ranges:n,cfId:y,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank,isPercent:o,isBottom:i,style:r,value:u}};return d.executeCommand(s.AddConditionalRuleMutation.id,{unitId:f,subUnitId:v,rule:T})}},Do={type:m.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:i}=t,u=e.get(s.ConditionalFormattingRuleModel),l=e.get(m.IUniverInstanceService),c=H.getSheetCommandTarget(l);if(!c)return!1;const{unitId:d,subUnitId:h}=c,f=e.get(m.ICommandService),v=u.createCfId(d,h),y={ranges:n,cfId:v,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.text,operator:o,style:r,value:i}};return f.executeCommand(s.AddConditionalRuleMutation.id,{unitId:d,subUnitId:h,rule:y})}},Po={type:m.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=t,i=e.get(s.ConditionalFormattingRuleModel),u=e.get(m.IUniverInstanceService),l=e.get(m.ICommandService),c=H.getSheetCommandTarget(u);if(!c)return!1;const{unitId:d,subUnitId:h}=c,f=i.createCfId(d,h),v={ranges:n,cfId:f,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.timePeriod,operator:o,style:r}};return l.executeCommand(s.AddConditionalRuleMutation.id,{unitId:d,subUnitId:h,rule:v})}},No={type:m.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a}=t,o=e.get(s.ConditionalFormattingRuleModel),i=e.get(m.IUniverInstanceService),u=e.get(m.ICommandService),l=H.getSheetCommandTarget(i);if(!l)return!1;const{unitId:c,subUnitId:d}=l,h=o.createCfId(c,d),f={ranges:n,cfId:h,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.uniqueValues,style:r}};return u.executeCommand(s.AddConditionalRuleMutation.id,{unitId:c,subUnitId:d,rule:f})}},Ir={type:m.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(e,t){var T;if(!t)return!1;const n=e.get(s.ConditionalFormattingRuleModel),r=e.get(m.IUniverInstanceService),a=e.get(m.ICommandService),o=e.get(m.IUndoRedoService),i=e.get(H.SelectionManagerService),u=H.getSheetCommandTarget(r,t);if(!u)return!1;const{unitId:l,subUnitId:c}=u,d=((T=i.getSelections())==null?void 0:T.map(x=>x.range))||[],h=n.getSubunitRules(l,c);if(!(h!=null&&h.length)||!d.length)return!1;const f=[],v=[];h.forEach(x=>{const w=new m.ObjectMatrix;x.ranges.forEach(S=>{m.Range.foreach(S,(C,g)=>{w.setValue(C,g,1)})}),d.forEach(S=>{m.Range.foreach(S,(C,g)=>{w.realDeleteValue(C,g)})});const b=H.findAllRectangle(H.createTopMatrixFromMatrix(w));if(b.length){const S={...x,ranges:b},C={unitId:l,subUnitId:c,rule:S},g=s.setConditionalRuleMutationUndoFactory(e,C);f.push({id:s.SetConditionalRuleMutation.id,params:C}),v.push(...g)}else{const S={unitId:l,subUnitId:c,cfId:x.cfId},C=s.DeleteConditionalRuleMutationUndoFactory(e,S);f.push({id:s.DeleteConditionalRuleMutation.id,params:S}),v.push(...C)}});const y=m.sequenceExecute(f,a).result;return y&&o.pushUndoRedo({unitID:l,redoMutations:f,undoMutations:v}),y}},Tn={type:m.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(e,t){const n=e.get(s.ConditionalFormattingRuleModel),r=e.get(m.IUniverInstanceService),a=e.get(m.ICommandService),o=e.get(m.IUndoRedoService),i=H.getSheetCommandTarget(r,t);if(!i)return!1;const{unitId:u,subUnitId:l}=i,c=n.getSubunitRules(u,l);if(!(c!=null&&c.length))return!1;const d=c.map(y=>({cfId:y.cfId,unitId:u,subUnitId:l})),h=d.map(y=>({id:s.DeleteConditionalRuleMutation.id,params:y})),f=d.map(y=>s.DeleteConditionalRuleMutationUndoFactory(e,y)[0]),v=m.sequenceExecute(h,a).result;return v&&o.pushUndoRedo({unitID:u,redoMutations:h,undoMutations:f}),v}};var xe=function(){return xe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},xe.apply(this,arguments)},jo=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n},qe=_.forwardRef(function(e,t){var n=e.icon,r=e.id,a=e.className,o=e.extend,i=jo(e,["icon","id","className","extend"]),u="univerjs-icon univerjs-icon-".concat(r," ").concat(a||"").trim(),l=_.useRef("_".concat(Uo()));return xr(n,"".concat(r),{defIds:n.defIds,idSuffix:l.current},xe({ref:t,className:u},i),o)});function xr(e,t,n,r,a){return _.createElement(e.tag,xe(xe({key:t},Lo(e,n,a)),r),(Vo(e,n).children||[]).map(function(o,i){return xr(o,"".concat(t,"-").concat(e.tag,"-").concat(i),n,void 0,a)}))}function Lo(e,t,n){var r=xe({},e.attrs);n!=null&&n.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=n.colorChannel1);var a=t.defIds;return!a||a.length===0||(e.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+t.idSuffix),Object.entries(r).forEach(function(o){var i=o[0],u=o[1];typeof u=="string"&&(r[i]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),r}function Vo(e,t){var n,r=t.defIds;return!r||r.length===0?e:e.tag==="defs"&&(!((n=e.children)===null||n===void 0)&&n.length)?xe(xe({},e),{children:e.children.map(function(a){return typeof a.attrs.id=="string"&&r&&r.indexOf(a.attrs.id)>-1?xe(xe({},a),{attrs:xe(xe({},a.attrs),{id:a.attrs.id+t.idSuffix})}):a})}):e}function Uo(){return Math.random().toString(36).substring(2,8)}qe.displayName="UniverIcon";var zo={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"colorChannel1",d:"M5.59 1.51H10.46V14.459999999999999H5.59z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.34863 2.53325C1.34863 1.87051 1.88589 1.33325 2.54863 1.33325H13.482C14.1447 1.33325 14.682 1.87051 14.682 2.53325V13.4666C14.682 14.1294 14.1447 14.6666 13.482 14.6666H2.54863C1.88589 14.6666 1.34863 14.1294 1.34863 13.4666V2.53325ZM13.082 2.63325C13.2477 2.63325 13.382 2.76757 13.382 2.93325V5.09946C13.382 5.26515 13.2477 5.39946 13.082 5.39946H10.9708C10.8052 5.39946 10.6708 5.26515 10.6708 5.09946V2.93325C10.6708 2.76757 10.8052 2.63325 10.9708 2.63325H13.082ZM9.37085 2.93325C9.37085 2.76757 9.23653 2.63325 9.07085 2.63325H6.95974C6.79406 2.63325 6.65974 2.76757 6.65974 2.93325V5.09946C6.65974 5.26515 6.79406 5.39946 6.95974 5.39946L9.07085 5.39946C9.23654 5.39946 9.37085 5.26515 9.37085 5.09946V2.93325ZM5.35974 2.93325C5.35974 2.76757 5.22543 2.63325 5.05974 2.63325H2.94863C2.78295 2.63325 2.64863 2.76757 2.64863 2.93325V5.09946C2.64863 5.26515 2.78295 5.39946 2.94863 5.39946H5.05974C5.22543 5.39946 5.35974 5.26515 5.35974 5.09946V2.93325ZM2.94863 6.69946C2.78295 6.69946 2.64863 6.83378 2.64863 6.99946V9.11045C2.64863 9.27613 2.78295 9.41045 2.94863 9.41045H5.05974C5.22543 9.41045 5.35974 9.27613 5.35974 9.11045V6.99946C5.35974 6.83378 5.22543 6.69946 5.05974 6.69946H2.94863ZM2.94863 10.7104C2.78295 10.7104 2.64863 10.8448 2.64863 11.0104V13.0666C2.64863 13.2323 2.78295 13.3666 2.94863 13.3666H5.05974C5.22543 13.3666 5.35974 13.2323 5.35974 13.0666V11.0104C5.35974 10.8448 5.22543 10.7104 5.05974 10.7104H2.94863ZM6.65974 13.0666C6.65974 13.2323 6.79406 13.3666 6.95974 13.3666H9.07085C9.23653 13.3666 9.37085 13.2323 9.37085 13.0666V11.0104C9.37085 10.8448 9.23653 10.7104 9.07085 10.7104L6.95974 10.7104C6.79406 10.7104 6.65974 10.8448 6.65974 11.0104V13.0666ZM10.6708 13.0666C10.6708 13.2323 10.8052 13.3666 10.9708 13.3666H13.082C13.2477 13.3666 13.382 13.2323 13.382 13.0666V11.0104C13.382 10.8448 13.2477 10.7104 13.082 10.7104H10.9708C10.8052 10.7104 10.6708 10.8448 10.6708 11.0104V13.0666ZM13.082 9.41045C13.2477 9.41045 13.382 9.27613 13.382 9.11045V6.99946C13.382 6.83378 13.2477 6.69946 13.082 6.69946H10.9708C10.8052 6.69946 10.6708 6.83378 10.6708 6.99946V9.11045C10.6708 9.27613 10.8052 9.41045 10.9708 9.41045H13.082ZM6.95974 9.41045C6.79406 9.41045 6.65974 9.27613 6.65974 9.11045V6.99946C6.65974 6.83378 6.79406 6.69946 6.95974 6.69946L9.07085 6.69946C9.23653 6.69946 9.37085 6.83378 9.37085 6.99946V9.11045C9.37085 9.27613 9.23653 9.41045 9.07085 9.41045H6.95974Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Or=_.forwardRef(function(e,t){return _.createElement(qe,Object.assign({},e,{id:"conditions",ref:t,icon:zo}))});Or.displayName="Conditions";const Ao=Or;var ko={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M6.78662 6.17993C7.12169 6.17993 7.39331 6.45156 7.39331 6.78662V10.7301C7.39331 11.0652 7.12169 11.3368 6.78662 11.3368 6.45156 11.3368 6.17993 11.0652 6.17993 10.7301V6.78662C6.17993 6.45156 6.45156 6.17993 6.78662 6.17993zM9.82007 6.78662C9.82007 6.45156 9.54844 6.17993 9.21338 6.17993 8.87831 6.17993 8.60669 6.45156 8.60669 6.78662V10.7301C8.60669 11.0652 8.87831 11.3368 9.21338 11.3368 9.54844 11.3368 9.82007 11.0652 9.82007 10.7301V6.78662z"}},{tag:"path",attrs:{fill:"currentColor",d:"M6.57094 1.32642C6.34938 1.32642 6.14544 1.44719 6.03894 1.64148L5.21395 3.14648H1.93311C1.59804 3.14648 1.32642 3.41811 1.32642 3.75317C1.32642 4.08824 1.59804 4.35986 1.93311 4.35986H2.84314V14.0669C2.84314 14.402 3.11476 14.6736 3.44983 14.6736H12.5502C12.8852 14.6736 13.1569 14.402 13.1569 14.0669V4.35986H14.0669C14.402 4.35986 14.6736 4.08824 14.6736 3.75317C14.6736 3.41811 14.402 3.14648 14.0669 3.14648H10.7895L9.98357 1.64602C9.87785 1.4492 9.67252 1.32642 9.44911 1.32642H6.57094ZM9.4122 3.14648L9.08632 2.53979H6.93024L6.59767 3.14648H9.4122ZM4.05652 4.35986V13.4602H11.9435V4.35986H4.05652Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Er=_.forwardRef(function(e,t){return _.createElement(qe,Object.assign({},e,{id:"delete-single",ref:t,icon:ko}))});Er.displayName="DeleteSingle";const Rn=Er;var Ho={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_102_249",style:{maskType:"alpha"},width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0 0H16V16H0z"}}]},{tag:"g",attrs:{mask:"url(#mask0_102_249)"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.74717 2.0944C8.74717 1.68671 8.41279 1.3562 8.00032 1.3562C7.58785 1.3562 7.25347 1.68671 7.25347 2.0944V7.26186H2.02541C1.61294 7.26186 1.27856 7.59237 1.27856 8.00007C1.27856 8.40777 1.61294 8.73827 2.02541 8.73827H7.25347V13.9057C7.25347 14.3134 7.58785 14.6439 8.00032 14.6439C8.41279 14.6439 8.74717 14.3134 8.74717 13.9057V8.73827H13.975C14.3874 8.73827 14.7218 8.40777 14.7218 8.00007C14.7218 7.59237 14.3874 7.26186 13.975 7.26186H8.74717V2.0944Z"}}]}]},Mr=_.forwardRef(function(e,t){return _.createElement(qe,Object.assign({},e,{id:"increase-single",ref:t,icon:Ho}))});Mr.displayName="IncreaseSingle";const Wo=Mr;var $o={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_102_556",style:{maskType:"alpha"},width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0 0H16V16H0z"}}]},{tag:"g",attrs:{mask:"url(#mask0_102_556)"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M0.629584 3.99986C1.13729 3.4922 1.9604 3.49224 2.46806 3.99995L7.57569 9.10806C7.81 9.3424 8.18992 9.3424 8.42424 9.10808L13.5323 3.99998C14.04 3.4923 14.8631 3.4923 15.3708 3.99998C15.8785 4.50766 15.8785 5.33078 15.3708 5.83846L9.41415 11.7951C8.63307 12.5762 7.36669 12.5762 6.58565 11.7951L0.629497 5.83834C0.121839 5.33063 0.121879 4.50752 0.629584 3.99986Z",fillRule:"evenodd",clipRule:"evenodd"}}]}]},Dr=_.forwardRef(function(e,t){return _.createElement(qe,Object.assign({},e,{id:"more-down-single",ref:t,icon:$o}))});Dr.displayName="MoreDownSingle";const Cn=Dr;var Bo={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"}}]}]},Pr=_.forwardRef(function(e,t){return _.createElement(qe,Object.assign({},e,{id:"sequence-single",ref:t,icon:Bo}))});Pr.displayName="SequenceSingle";const Fo=Pr;var Go={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_436_41",style:{maskType:"alpha"},width:17,height:17,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0.35 0.48H16.35V16.48H0.35z"}}]},{tag:"g",attrs:{mask:"url(#mask0_436_41)",fillRule:"evenodd",clipRule:"evenodd"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2.27177 13.714L13.5855 2.40025L14.434 3.24878L3.1203 14.5625L2.27177 13.714Z"}},{tag:"path",attrs:{fill:"#E5E5E5",d:"M4.2603 1.82495L2.89617 1.82495C2.23343 1.82495 1.69617 2.36221 1.69617 3.02495L1.69617 4.38908L3.02617 4.38908L3.02617 3.15495L4.2603 3.15495L4.2603 1.82495ZM15.0092 4.38908L15.0092 3.02495C15.0092 2.36221 14.4719 1.82495 13.8092 1.82495L12.4451 1.82495L12.4451 3.15495L13.6792 3.15495L13.6792 4.38908L15.0092 4.38908ZM6.98856 1.82495L6.98856 3.15495L9.71681 3.15495L9.71681 1.82495L6.98856 1.82495ZM15.0092 7.11734L13.6792 7.11734L13.6792 9.84559L15.0092 9.84559L15.0092 7.11734ZM15.0092 12.5739L13.6792 12.5739L13.6792 13.808L12.4451 13.808L12.4451 15.138L13.8092 15.138C14.4719 15.138 15.0092 14.6007 15.0092 13.938L15.0092 12.5739ZM9.71681 15.138L9.71681 13.808L6.98856 13.808L6.98856 15.138L9.71681 15.138ZM4.2603 15.138L4.2603 13.808L3.02617 13.808L3.02617 12.5739L1.69617 12.5739L1.69617 13.938C1.69617 14.6007 2.23343 15.138 2.89617 15.138L4.2603 15.138ZM1.69617 9.8456L3.02617 9.8456L3.02617 7.11734L1.69617 7.11734L1.69617 9.8456Z"}}]}]},Nr=_.forwardRef(function(e,t){return _.createElement(qe,Object.assign({},e,{id:"slash-single",ref:t,icon:Go}))});Nr.displayName="SlashSingle";const Ut=Nr,jr=[H.SetWorksheetActiveOperation.id,s.AddConditionalRuleMutation.id,s.SetConditionalRuleMutation.id,s.DeleteConditionalRuleMutation.id,s.MoveConditionalRuleMutation.id],qo=e=>{const t="conditional-formatting-menu-icon";return e.register(t,Ao),n=>{const r=n.get(m.LocaleService),a=n.get(H.SelectionManagerService),o=n.get(m.ICommandService),i=n.get(m.IUniverInstanceService),u=n.get(s.ConditionalFormattingRuleModel),l=new Ce.Observable(h=>Ce.merge(a.selectionMoveEnd$,new Ce.Observable(f=>{const v=o.onCommandExecuted(y=>{var b;const{id:T,params:x}=y,w=(b=i.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:b.getUnitId();jr.includes(T)&&x.unitId===w&&f.next(null)});return()=>v.dispose()})).pipe(Ee.debounceTime(16)).subscribe(()=>{var x;const f=((x=a.getSelections())==null?void 0:x.map(w=>w.range))||[],v=i.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!v)return;const T=(u.getSubunitRules(v.getUnitId(),v.getActiveSheet().getSheetId())||[]).filter(w=>w.ranges.some(b=>f.some(S=>m.Rectangle.intersects(S,b))));h.next(!!T.length)})),c=new Ce.Observable(h=>Ce.merge(a.selectionMoveEnd$,new Ce.Observable(f=>{const v=o.onCommandExecuted(y=>{var b;const{id:T,params:x}=y,w=(b=i.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:b.getUnitId();jr.includes(T)&&x.unitId===w&&f.next(null)});return()=>v.dispose()})).pipe(Ee.debounceTime(16)).subscribe(()=>{const f=i.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!f)return;const v=u.getSubunitRules(f.getUnitId(),f.getActiveSheet().getSheetId())||[];h.next(!!v.length)})),d=new Ce.Observable(h=>{const f=Xo(r);l.subscribe(v=>{const y=f.find(T=>T.value===Ie.clearRangeRules);y&&(y.disabled=!v,h.next(f))}),c.subscribe(v=>{const y=f.find(T=>T.value===Ie.clearWorkSheetRules);y&&(y.disabled=!v,h.next(f))}),h.next(f)});return{id:So.id,type:ve.MenuItemType.SELECTOR,group:ve.MenuGroup.TOOLBAR_FORMULAS_INSERT,positions:[ve.MenuPosition.TOOLBAR_START],icon:t,tooltip:r.t("sheet.cf.title"),selections:d,hidden$:ve.getMenuHiddenObservable(n,m.UniverInstanceType.UNIVER_SHEET)}}};function Xo(e){return[{label:e.t("sheet.cf.ruleType.highlightCell"),value:Ie.highlightCell},{label:e.t("sheet.cf.panel.rankAndAverage"),value:Ie.rank},{label:e.t("sheet.cf.ruleType.formula"),value:Ie.formula},{label:e.t("sheet.cf.ruleType.colorScale"),value:Ie.colorScale},{label:e.t("sheet.cf.ruleType.dataBar"),value:Ie.dataBar},{label:e.t("sheet.cf.ruleType.iconSet"),value:Ie.icon},{label:e.t("sheet.cf.menu.manageConditionalFormatting"),value:Ie.viewRule},{label:e.t("sheet.cf.menu.createConditionalFormatting"),value:Ie.createRule},{label:e.t("sheet.cf.menu.clearRangeRules"),value:Ie.clearRangeRules,disabled:!1},{label:e.t("sheet.cf.menu.clearWorkSheetRules"),value:Ie.clearWorkSheetRules}]}var Ae=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Yo(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var Lr={exports:{}},zt={};/**
|
|
1
|
+
(function(B,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("@univerjs/core"),require("@wendellhu/redi"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets"),require("@univerjs/ui"),require("rxjs"),require("rxjs/operators"),require("@univerjs/sheets-ui"),require("react"),require("@univerjs/design"),require("@wendellhu/redi/react-bindings"),require("@univerjs/engine-formula"),require("clsx"),require("react-dom"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@wendellhu/redi","@univerjs/sheets-conditional-formatting","@univerjs/sheets","@univerjs/ui","rxjs","rxjs/operators","@univerjs/sheets-ui","react","@univerjs/design","@wendellhu/redi/react-bindings","@univerjs/engine-formula","clsx","react-dom","@univerjs/engine-render"],m):(B=typeof globalThis<"u"?globalThis:B||self,m(B.UniverSheetsConditionalFormattingUi={},B.UniverCore,B["@wendellhu/redi"],B.UniverSheetsConditionalFormatting,B.UniverSheets,B.UniverUi,B.rxjs,B.rxjs.operators,B.UniverSheetsUi,B.React,B.UniverDesign,B["@wendellhu/redi/react-bindings"],B.UniverEngineFormula,B.clsx,B.ReactDOM,B.UniverEngineRender))})(this,function(B,m,U,s,V,Te,we,De,le,I,q,ne,Or,qe,Er,wo){"use strict";var wd=Object.defineProperty;var Id=(B,m,U)=>m in B?wd(B,m,{enumerable:!0,configurable:!0,writable:!0,value:U}):B[m]=U;var Ze=(B,m,U)=>(Id(B,typeof m!="symbol"?m+"":m,U),U);var kt;const Io={type:m.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=t,i=e.get(s.ConditionalFormattingRuleModel),u=e.get(m.ICommandService),l=e.get(m.IUniverInstanceService),c=V.getSheetCommandTarget(l);if(!c)return!1;const{unitId:d,subUnitId:p}=c,f=i.createCfId(d,p),v={ranges:n,cfId:f,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.average,operator:o,style:r}};return u.executeCommand(s.AddConditionalRuleMutation.id,{unitId:d,subUnitId:p,rule:v})}},xo={type:m.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,config:r,stopIfTrue:a}=t,o=e.get(s.ConditionalFormattingRuleModel),i=e.get(m.ICommandService),u=e.get(m.IUniverInstanceService),l=V.getSheetCommandTarget(u);if(!l)return!1;const{unitId:c,subUnitId:d}=l,p=o.createCfId(c,d),f={ranges:n,cfId:p,stopIfTrue:!!a,rule:{type:s.CFRuleType.colorScale,config:r}};return i.executeCommand(s.AddConditionalRuleMutation.id,{unitId:c,subUnitId:d,rule:f})}},Oo={type:m.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,min:r,max:a,nativeColor:o,positiveColor:i,isGradient:u,stopIfTrue:l,isShowValue:c}=t,d=e.get(s.ConditionalFormattingRuleModel),p=e.get(m.IUniverInstanceService),f=V.getSheetCommandTarget(p);if(!f)return!1;const{unitId:v,subUnitId:y}=f,b=e.get(m.ICommandService),x=d.createCfId(v,y),_={ranges:n,cfId:x,stopIfTrue:!!l,rule:{type:s.CFRuleType.dataBar,isShowValue:c,config:{min:r,max:a,nativeColor:o,positiveColor:i,isGradient:u}}};return b.executeCommand(s.AddConditionalRuleMutation.id,{unitId:v,subUnitId:y,rule:_})}},Eo={type:m.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a}=t,o=e.get(s.ConditionalFormattingRuleModel),i=e.get(m.ICommandService),u=e.get(m.IUniverInstanceService),l=V.getSheetCommandTarget(u);if(!l)return!1;const{unitId:c,subUnitId:d}=l,p=o.createCfId(c,d),f={ranges:n,cfId:p,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.duplicateValues,style:r}};return i.executeCommand(s.AddConditionalRuleMutation.id,{unitId:c,subUnitId:d,rule:f})}},Po={type:m.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:i}=t,u=e.get(s.ConditionalFormattingRuleModel),l=e.get(m.ICommandService),c=e.get(m.IUniverInstanceService),d=V.getSheetCommandTarget(c);if(!d)return!1;const{unitId:p,subUnitId:f}=d,v=u.createCfId(p,f);let y;if([s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(o)){const b=i;if(b.length!==2||!Array.isArray(b))return!1;y={ranges:n,cfId:v,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.number,operator:o,style:r,value:b}}}else{const b=i;if(typeof b!="number")return!1;y={ranges:n,cfId:v,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.number,operator:o,style:r,value:b}}}return l.executeCommand(s.AddConditionalRuleMutation.id,{unitId:p,subUnitId:f,rule:y})}},Do={type:m.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,isPercent:o,isBottom:i,value:u}=t,l=e.get(s.ConditionalFormattingRuleModel),c=e.get(m.IUniverInstanceService),d=e.get(m.ICommandService),p=V.getSheetCommandTarget(c);if(!p)return!1;const{unitId:f,subUnitId:v}=p,y=l.createCfId(f,v),b={ranges:n,cfId:y,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank,isPercent:o,isBottom:i,style:r,value:u}};return d.executeCommand(s.AddConditionalRuleMutation.id,{unitId:f,subUnitId:v,rule:b})}},Mo={type:m.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:i}=t,u=e.get(s.ConditionalFormattingRuleModel),l=e.get(m.IUniverInstanceService),c=V.getSheetCommandTarget(l);if(!c)return!1;const{unitId:d,subUnitId:p}=c,f=e.get(m.ICommandService),v=u.createCfId(d,p),y={ranges:n,cfId:v,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.text,operator:o,style:r,value:i}};return f.executeCommand(s.AddConditionalRuleMutation.id,{unitId:d,subUnitId:p,rule:y})}},No={type:m.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=t,i=e.get(s.ConditionalFormattingRuleModel),u=e.get(m.IUniverInstanceService),l=e.get(m.ICommandService),c=V.getSheetCommandTarget(u);if(!c)return!1;const{unitId:d,subUnitId:p}=c,f=i.createCfId(d,p),v={ranges:n,cfId:f,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.timePeriod,operator:o,style:r}};return l.executeCommand(s.AddConditionalRuleMutation.id,{unitId:d,subUnitId:p,rule:v})}},jo={type:m.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a}=t,o=e.get(s.ConditionalFormattingRuleModel),i=e.get(m.IUniverInstanceService),u=e.get(m.ICommandService),l=V.getSheetCommandTarget(i);if(!l)return!1;const{unitId:c,subUnitId:d}=l,p=o.createCfId(c,d),f={ranges:n,cfId:p,stopIfTrue:!!a,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.uniqueValues,style:r}};return u.executeCommand(s.AddConditionalRuleMutation.id,{unitId:c,subUnitId:d,rule:f})}},Pr={type:m.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(e,t){var b;if(!t)return!1;const n=e.get(s.ConditionalFormattingRuleModel),r=e.get(m.IUniverInstanceService),a=e.get(m.ICommandService),o=e.get(m.IUndoRedoService),i=e.get(V.SelectionManagerService),u=V.getSheetCommandTarget(r,t);if(!u)return!1;const{unitId:l,subUnitId:c}=u,d=((b=i.getSelections())==null?void 0:b.map(x=>x.range))||[],p=n.getSubunitRules(l,c);if(!(p!=null&&p.length)||!d.length)return!1;const f=[],v=[];p.forEach(x=>{const _=new m.ObjectMatrix;x.ranges.forEach(S=>{m.Range.foreach(S,(R,g)=>{_.setValue(R,g,1)})}),d.forEach(S=>{m.Range.foreach(S,(R,g)=>{_.realDeleteValue(R,g)})});const T=V.findAllRectangle(V.createTopMatrixFromMatrix(_));if(T.length){const S={...x,ranges:T},R={unitId:l,subUnitId:c,rule:S},g=s.setConditionalRuleMutationUndoFactory(e,R);f.push({id:s.SetConditionalRuleMutation.id,params:R}),v.push(...g)}else{const S={unitId:l,subUnitId:c,cfId:x.cfId},R=s.DeleteConditionalRuleMutationUndoFactory(e,S);f.push({id:s.DeleteConditionalRuleMutation.id,params:S}),v.push(...R)}});const y=m.sequenceExecute(f,a).result;return y&&o.pushUndoRedo({unitID:l,redoMutations:f,undoMutations:v}),y}},_n={type:m.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(e,t){const n=e.get(s.ConditionalFormattingRuleModel),r=e.get(m.IUniverInstanceService),a=e.get(m.ICommandService),o=e.get(m.IUndoRedoService),i=V.getSheetCommandTarget(r,t);if(!i)return!1;const{unitId:u,subUnitId:l}=i,c=n.getSubunitRules(u,l);if(!(c!=null&&c.length))return!1;const d=c.map(y=>({cfId:y.cfId,unitId:u,subUnitId:l})),p=d.map(y=>({id:s.DeleteConditionalRuleMutation.id,params:y})),f=d.map(y=>s.DeleteConditionalRuleMutationUndoFactory(e,y)[0]),v=m.sequenceExecute(p,a).result;return v&&o.pushUndoRedo({unitID:u,redoMutations:p,undoMutations:f}),v}};var $e=(e=>(e[e.View=0]="View",e[e.Edit=1]="Edit",e[e.ManageCollaborator=2]="ManageCollaborator",e[e.Print=3]="Print",e[e.Duplicate=4]="Duplicate",e[e.Comment=5]="Comment",e[e.Copy=6]="Copy",e[e.Share=7]="Share",e[e.Export=8]="Export",e[e.MoveWorksheet=9]="MoveWorksheet",e[e.DeleteWorksheet=10]="DeleteWorksheet",e[e.HideWorksheet=11]="HideWorksheet",e[e.RenameWorksheet=12]="RenameWorksheet",e[e.CreateWorksheet=13]="CreateWorksheet",e[e.SetWorksheetStyle=14]="SetWorksheetStyle",e[e.EditWorksheetCell=15]="EditWorksheetCell",e[e.InsertHyperlink=16]="InsertHyperlink",e[e.Sort=17]="Sort",e[e.Filter=18]="Filter",e[e.PivotTable=19]="PivotTable",e[e.FloatImg=20]="FloatImg",e[e.History=21]="History",e[e.RwHgtClWdt=22]="RwHgtClWdt",e[e.ViemRwHgtClWdt=23]="ViemRwHgtClWdt",e[e.ViewFilter=24]="ViewFilter",e[e.MoveSheet=25]="MoveSheet",e[e.DeleteSheet=26]="DeleteSheet",e[e.HideSheet=27]="HideSheet",e[e.CopySheet=28]="CopySheet",e[e.RenameSheet=29]="RenameSheet",e[e.CreateSheet=30]="CreateSheet",e[e.SelectProtectedCells=31]="SelectProtectedCells",e[e.SelectUnProtectedCells=32]="SelectUnProtectedCells",e[e.SetCellStyle=33]="SetCellStyle",e[e.SetCellValue=34]="SetCellValue",e[e.SetRowStyle=35]="SetRowStyle",e[e.SetColumnStyle=36]="SetColumnStyle",e[e.InsertRow=37]="InsertRow",e[e.InsertColumn=38]="InsertColumn",e[e.DeleteRow=39]="DeleteRow",e[e.DeleteColumn=40]="DeleteColumn",e[e.EditExtraObject=41]="EditExtraObject",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))($e||{});const Dr=[V.SetWorksheetActiveOperation.id,s.AddConditionalRuleMutation.id,s.SetConditionalRuleMutation.id,s.DeleteConditionalRuleMutation.id,s.MoveConditionalRuleMutation.id],Lo=e=>{const t=[{label:"sheet.cf.ruleType.highlightCell",value:Oe.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:Oe.rank},{label:"sheet.cf.ruleType.formula",value:Oe.formula},{label:"sheet.cf.ruleType.colorScale",value:Oe.colorScale},{label:"sheet.cf.ruleType.dataBar",value:Oe.dataBar},{label:"sheet.cf.ruleType.iconSet",value:Oe.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:Oe.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:Oe.createRule},{label:"sheet.cf.menu.clearRangeRules",value:Oe.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:Oe.clearWorkSheetRules}],n=e.get(V.SelectionManagerService),r=e.get(m.ICommandService),a=e.get(m.IUniverInstanceService),o=e.get(s.ConditionalFormattingRuleModel),i=new we.Observable(c=>we.merge(n.selectionMoveEnd$,new we.Observable(d=>{const p=r.onCommandExecuted(f=>{var x;const{id:v,params:y}=f,b=(x=a.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:x.getUnitId();Dr.includes(v)&&y.unitId===b&&d.next(null)});return()=>p.dispose()})).pipe(De.debounceTime(16)).subscribe(()=>{var y;const d=((y=n.getSelections())==null?void 0:y.map(b=>b.range))||[],p=a.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!p)return;const v=(o.getSubunitRules(p.getUnitId(),p.getActiveSheet().getSheetId())||[]).filter(b=>b.ranges.some(x=>d.some(_=>m.Rectangle.intersects(_,x))));c.next(!!v.length)})),u=new we.Observable(c=>we.merge(n.selectionMoveEnd$,new we.Observable(d=>{const p=r.onCommandExecuted(f=>{var x;const{id:v,params:y}=f,b=(x=a.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:x.getUnitId();Dr.includes(v)&&y.unitId===b&&d.next(null)});return()=>p.dispose()})).pipe(De.debounceTime(16)).subscribe(()=>{const d=a.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!d)return;const p=d.getActiveSheet(),v=(o.getSubunitRules(d.getUnitId(),d.getActiveSheet().getSheetId())||[]).some(y=>y.ranges.some(x=>{var g,O;const{startRow:_,startColumn:T,endRow:S,endColumn:R}=x;for(let E=_;E<=S;E++)for(let w=T;w<=R;w++){const j=(O=(g=p.getCell(E,w))==null?void 0:g.selectionProtection)==null?void 0:O[0];if((j==null?void 0:j[$e.Edit])===!1||(j==null?void 0:j[$e.View])===!1)return!0}return!1}));c.next(!v)})),l=new we.Observable(c=>{i.subscribe(d=>{const p=t.find(f=>f.value===Oe.clearRangeRules);p&&(p.disabled=!d,c.next(t))}),u.subscribe(d=>{const p=t.find(f=>f.value===Oe.clearWorkSheetRules);p&&(p.disabled=!d,c.next(t))}),c.next(t)});return{id:bo.id,type:Te.MenuItemType.SELECTOR,group:Te.MenuGroup.TOOLBAR_FORMULAS_INSERT,positions:[Te.MenuPosition.TOOLBAR_START],icon:"Conditions",tooltip:"sheet.cf.title",selections:l,hidden$:Te.getMenuHiddenObservable(e,m.UniverInstanceType.UNIVER_SHEET),disabled$:le.getCurrentRangeDisable$(e,{workbookTypes:[V.WorkbookEditablePermission],worksheetTypes:[V.WorksheetSetCellStylePermission,V.WorksheetEditPermission],rangeTypes:[V.RangeProtectionPermissionEditPoint]})}};var Be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Vo(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var Mr={exports:{}},Wt={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Ko=_,Zo=Symbol.for("react.element"),Jo=Symbol.for("react.fragment"),Qo=Object.prototype.hasOwnProperty,ei=Ko.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ti={key:!0,ref:!0,__self:!0,__source:!0};function Vr(e,t,n){var r,a={},o=null,i=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)Qo.call(t,r)&&!ti.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)a[r]===void 0&&(a[r]=t[r]);return{$$typeof:Zo,type:e,key:o,ref:i,props:a,_owner:ei.current}}zt.Fragment=Jo,zt.jsx=Vr,zt.jsxs=Vr,Lr.exports=zt;var p=Lr.exports;const D={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 Ur={exports:{}},bt={},_n={exports:{}};(function(e,t){(function(n,r){r(t)})(Ae,function(n){function r(N){return function(ee,K,Z,oe,de,Oe,ie){return N(ee,K,ie)}}function a(N){return function(ee,K,Z,oe){if(!ee||!K||typeof ee!="object"||typeof K!="object")return N(ee,K,Z,oe);var de=oe.get(ee),Oe=oe.get(K);if(de&&Oe)return de===K&&Oe===ee;oe.set(ee,K),oe.set(K,ee);var ie=N(ee,K,Z,oe);return oe.delete(ee),oe.delete(K),ie}}function o(N,k){var ee={};for(var K in N)ee[K]=N[K];for(var K in k)ee[K]=k[K];return ee}function i(N){return N.constructor===Object||N.constructor==null}function u(N){return typeof N.then=="function"}function l(N,k){return N===k||N!==N&&k!==k}var c="[object Arguments]",d="[object Boolean]",h="[object Date]",f="[object RegExp]",v="[object Map]",y="[object Number]",T="[object Object]",x="[object Set]",w="[object String]",b=Object.prototype.toString;function S(N){var k=N.areArraysEqual,ee=N.areDatesEqual,K=N.areMapsEqual,Z=N.areObjectsEqual,oe=N.areRegExpsEqual,de=N.areSetsEqual,Oe=N.createIsNestedEqual,ie=Oe(Ve);function Ve(re,se,Ue){if(re===se)return!0;if(!re||!se||typeof re!="object"||typeof se!="object")return re!==re&&se!==se;if(i(re)&&i(se))return Z(re,se,ie,Ue);var Ro=Array.isArray(re),Co=Array.isArray(se);if(Ro||Co)return Ro===Co&&k(re,se,ie,Ue);var ze=b.call(re);return ze!==b.call(se)?!1:ze===h?ee(re,se,ie,Ue):ze===f?oe(re,se,ie,Ue):ze===v?K(re,se,ie,Ue):ze===x?de(re,se,ie,Ue):ze===T||ze===c?u(re)||u(se)?!1:Z(re,se,ie,Ue):ze===d||ze===y||ze===w?l(re.valueOf(),se.valueOf()):!1}return Ve}function C(N,k,ee,K){var Z=N.length;if(k.length!==Z)return!1;for(;Z-- >0;)if(!ee(N[Z],k[Z],Z,Z,N,k,K))return!1;return!0}var g=a(C);function O(N,k){return l(N.valueOf(),k.valueOf())}function M(N,k,ee,K){var Z=N.size===k.size;if(!Z)return!1;if(!N.size)return!0;var oe={},de=0;return N.forEach(function(Oe,ie){if(Z){var Ve=!1,re=0;k.forEach(function(se,Ue){!Ve&&!oe[re]&&(Ve=ee(ie,Ue,de,re,N,k,K)&&ee(Oe,se,ie,Ue,N,k,K))&&(oe[re]=!0),re++}),de++,Z=Ve}}),Z}var I=a(M),j="_owner",L=Object.prototype.hasOwnProperty;function U(N,k,ee,K){var Z=Object.keys(N),oe=Z.length;if(Object.keys(k).length!==oe)return!1;for(var de;oe-- >0;){if(de=Z[oe],de===j){var Oe=!!N.$$typeof,ie=!!k.$$typeof;if((Oe||ie)&&Oe!==ie)return!1}if(!L.call(k,de)||!ee(N[de],k[de],de,de,N,k,K))return!1}return!0}var F=a(U);function R(N,k){return N.source===k.source&&N.flags===k.flags}function E(N,k,ee,K){var Z=N.size===k.size;if(!Z)return!1;if(!N.size)return!0;var oe={};return N.forEach(function(de,Oe){if(Z){var ie=!1,Ve=0;k.forEach(function(re,se){!ie&&!oe[Ve]&&(ie=ee(de,re,Oe,se,N,k,K))&&(oe[Ve]=!0),Ve++}),Z=ie}}),Z}var J=a(E),be=Object.freeze({areArraysEqual:C,areDatesEqual:O,areMapsEqual:M,areObjectsEqual:U,areRegExpsEqual:R,areSetsEqual:E,createIsNestedEqual:r}),z=Object.freeze({areArraysEqual:g,areDatesEqual:O,areMapsEqual:I,areObjectsEqual:F,areRegExpsEqual:R,areSetsEqual:J,createIsNestedEqual:r}),q=S(be);function ne(N,k){return q(N,k,void 0)}var ce=S(o(be,{createIsNestedEqual:function(){return l}}));function me(N,k){return ce(N,k,void 0)}var Te=S(z);function Re(N,k){return Te(N,k,new WeakMap)}var Le=S(o(z,{createIsNestedEqual:function(){return l}}));function lt(N,k){return Le(N,k,new WeakMap)}function Vt(N){return S(o(be,N(be)))}function Cd(N){var k=S(o(z,N(z)));return function(ee,K,Z){return Z===void 0&&(Z=new WeakMap),k(ee,K,Z)}}n.circularDeepEqual=Re,n.circularShallowEqual=lt,n.createCustomCircularEqual=Cd,n.createCustomEqual=Vt,n.deepEqual=ne,n.sameValueZeroEqual=l,n.shallowEqual=me,Object.defineProperty(n,"__esModule",{value:!0})})})(_n,_n.exports);var In=_n.exports,B={},ni=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(B,"__esModule",{value:!0}),B.bottom=xn,B.childrenEqual=oi,B.cloneLayout=Ar,B.cloneLayoutItem=Xe,B.collides=At,B.compact=Hr,B.compactItem=Wr,B.compactType=mi,B.correctBounds=$r,B.fastPositionEqual=ii,B.fastRGLPropsEqual=void 0,B.getAllCollisions=Br,B.getFirstCollision=Ye,B.getLayoutItem=En,B.getStatics=Mn,B.modifyLayout=kr,B.moveElement=Rt,B.moveElementAwayFromCollision=Dn,B.noop=void 0,B.perc=li,B.resizeItemInDirection=ci,B.setTopLeft=fi,B.setTransform=di,B.sortLayoutItems=Un,B.sortLayoutItemsByColRow=Yr,B.sortLayoutItemsByRowCol=Xr,B.synchronizeLayoutWithChildren=pi,B.validateLayout=hi,B.withLayoutItem=ai;var zr=In,Tt=ri(_);function ri(e){return e&&e.__esModule?e:{default:e}}function xn(e){let t=0,n;for(let r=0,a=e.length;r<a;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function Ar(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Xe(e[n]);return t}function kr(e,t){const n=Array(e.length);for(let r=0,a=e.length;r<a;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function ai(e,t,n){let r=En(e,t);return r?(r=n(Xe(r)),e=kr(e,r),[e,r]):[e,null]}function Xe(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function oi(e,t){return(0,zr.deepEqual)(Tt.default.Children.map(e,n=>n==null?void 0:n.key),Tt.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,zr.deepEqual)(Tt.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Tt.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}B.fastRGLPropsEqual=ni;function ii(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function At(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Hr(e,t,n,r){const a=Mn(e),o=Un(e,t),i=Array(e.length);for(let u=0,l=o.length;u<l;u++){let c=Xe(o[u]);c.static||(c=Wr(a,c,t,n,o,r),a.push(c)),i[e.indexOf(o[u])]=c,c.moved=!1}return i}const si={x:"w",y:"h"};function On(e,t,n,r){const a=si[r];t[r]+=1;const o=e.map(i=>i.i).indexOf(t.i);for(let i=o+1;i<e.length;i++){const u=e[i];if(!u.static){if(u.y>t.y+t.h)break;At(t,u)&&On(e,u,n+t[a],r)}}t[r]=n}function Wr(e,t,n,r,a,o){const i=n==="vertical",u=n==="horizontal";if(i)for(t.y=Math.min(xn(e),t.y);t.y>0&&!Ye(e,t);)t.y--;else if(u)for(;t.x>0&&!Ye(e,t);)t.x--;let l;for(;(l=Ye(e,t))&&!(n===null&&o);)if(u?On(a,t,l.x+l.w,"x"):On(a,t,l.y+l.h,"y"),u&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Ye(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function $r(e,t){const n=Mn(e);for(let r=0,a=e.length;r<a;r++){const o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;Ye(n,o);)o.y++}return e}function En(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Ye(e,t){for(let n=0,r=e.length;n<r;n++)if(At(e[n],t))return e[n]}function Br(e,t){return e.filter(n=>At(n,t))}function Mn(e){return e.filter(t=>t.static)}function Rt(e,t,n,r,a,o,i,u,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let h=Un(e,i);(i==="vertical"&&typeof r=="number"?d>=r:i==="horizontal"&&typeof n=="number"?c>=n:!1)&&(h=h.reverse());const v=Br(h,t),y=v.length>0;if(y&&l)return Ar(e);if(y&&o)return`${t.i}`,t.x=c,t.y=d,t.moved=!1,e;for(let T=0,x=v.length;T<x;T++){const w=v[T];`${t.i}${t.x}${t.y}${w.i}${w.x}${w.y}`,!w.moved&&(w.static?e=Dn(e,w,t,a,i):e=Dn(e,t,w,a,i))}return e}function Dn(e,t,n,r,a,o){const i=a==="horizontal",u=a==="vertical",l=t.static;if(r){r=!1;const h={x:i?Math.max(t.x-n.w,0):n.x,y:u?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},f=Ye(e,h),v=f&&f.y+f.h>t.y,y=f&&t.x+t.w>f.x;if(f){if(v&&u)return Rt(e,n,void 0,t.y+1,r,l,a);if(v&&a==null)return t.y=n.y,n.y=n.y+n.h,e;if(y&&i)return Rt(e,t,n.x,void 0,r,l,a)}else return`${n.i}${h.x}${h.y}`,Rt(e,n,i?h.x:void 0,u?h.y:void 0,r,l,a)}const c=i?n.x+1:void 0,d=u?n.y+1:void 0;return c==null&&d==null?e:Rt(e,n,i?n.x+1:void 0,u?n.y+1:void 0,r,l,a)}function li(e){return e*100+"%"}const Fr=(e,t,n,r)=>e+n>r?t:n,Gr=(e,t,n)=>e<0?t:n,qr=e=>Math.max(0,e),Pn=e=>Math.max(0,e),Nn=(e,t,n)=>{let{left:r,height:a,width:o}=t;const i=e.top-(a-e.height);return{left:r,width:o,height:Gr(i,e.height,a),top:Pn(i)}},jn=(e,t,n)=>{let{top:r,left:a,height:o,width:i}=t;return{top:r,height:o,width:Fr(e.left,e.width,i,n),left:qr(a)}},Ln=(e,t,n)=>{let{top:r,height:a,width:o}=t;const i=e.left-(o-e.width);return{height:a,width:i<0?e.width:Fr(e.left,e.width,o,n),top:Pn(r),left:qr(i)}},Vn=(e,t,n)=>{let{top:r,left:a,height:o,width:i}=t;return{width:i,left:a,height:Gr(r,e.height,o),top:Pn(r)}},ui={n:Nn,ne:function(){return Nn(arguments.length<=0?void 0:arguments[0],jn(...arguments))},e:jn,se:function(){return Vn(arguments.length<=0?void 0:arguments[0],jn(...arguments))},s:Vn,sw:function(){return Vn(arguments.length<=0?void 0:arguments[0],Ln(...arguments))},w:Ln,nw:function(){return Nn(arguments.length<=0?void 0:arguments[0],Ln(...arguments))}};function ci(e,t,n,r){const a=ui[e];return a?a(t,{...t,...n},r):n}function di(e){let{top:t,left:n,width:r,height:a}=e;const o=`translate(${n}px,${t}px)`;return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:`${r}px`,height:`${a}px`,position:"absolute"}}function fi(e){let{top:t,left:n,width:r,height:a}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${a}px`,position:"absolute"}}function Un(e,t){return t==="horizontal"?Yr(e):t==="vertical"?Xr(e):e}function Xr(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function Yr(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function pi(e,t,n,r,a){e=e||[];const o=[];Tt.default.Children.forEach(t,u=>{if((u==null?void 0:u.key)==null)return;const l=En(e,String(u.key)),c=u.props["data-grid"];l&&c==null?o.push(Xe(l)):c?o.push(Xe({...c,i:u.key})):o.push(Xe({w:1,h:1,x:0,y:xn(o),i:String(u.key)}))});const i=$r(o,{cols:n});return a?i:Hr(i,r,n)}function hi(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,a=e.length;r<a;r++){const o=e[r];for(let i=0;i<n.length;i++)if(typeof o[n[i]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[i]+" must be a number!")}}function mi(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function qd(){}const gi=()=>{};B.noop=gi;var De={};Object.defineProperty(De,"__esModule",{value:!0}),De.calcGridColWidth=kt,De.calcGridItemPosition=vi,De.calcGridItemWHPx=zn,De.calcWH=Si,De.calcXY=yi,De.clamp=Ke;function kt(e){const{margin:t,containerPadding:n,containerWidth:r,cols:a}=e;return(r-t[0]*(a-1)-n[0]*2)/a}function zn(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function vi(e,t,n,r,a,o){const{margin:i,containerPadding:u,rowHeight:l}=e,c=kt(e),d={};return o&&o.resizing?(d.width=Math.round(o.resizing.width),d.height=Math.round(o.resizing.height)):(d.width=zn(r,c,i[0]),d.height=zn(a,l,i[1])),o&&o.dragging?(d.top=Math.round(o.dragging.top),d.left=Math.round(o.dragging.left)):o&&o.resizing&&typeof o.resizing.top=="number"&&typeof o.resizing.left=="number"?(d.top=Math.round(o.resizing.top),d.left=Math.round(o.resizing.left)):(d.top=Math.round((l+i[1])*n+u[1]),d.left=Math.round((c+i[0])*t+u[0])),d}function yi(e,t,n,r,a){const{margin:o,cols:i,rowHeight:u,maxRows:l}=e,c=kt(e);let d=Math.round((n-o[0])/(c+o[0])),h=Math.round((t-o[1])/(u+o[1]));return d=Ke(d,0,i-r),h=Ke(h,0,l-a),{x:d,y:h}}function Si(e,t,n,r,a,o){const{margin:i,maxRows:u,cols:l,rowHeight:c}=e,d=kt(e);let h=Math.round((t+i[0])/(d+i[0])),f=Math.round((n+i[1])/(c+i[1])),v=Ke(h,0,l-r),y=Ke(f,0,u-a);return["sw","w","nw"].indexOf(o)!==-1&&(v=Ke(h,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(y=Ke(f,0,u)),{w:v,h:y}}function Ke(e,t,n){return Math.max(Math.min(e,n),t)}var Ht={},Kr={exports:{}},bi="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Ti=bi,Ri=Ti;function Zr(){}function Jr(){}Jr.resetWarningCache=Zr;var Ci=function(){function e(r,a,o,i,u,l){if(l!==Ri){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}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Jr,resetWarningCache:Zr};return n.PropTypes=n,n};Kr.exports=Ci();var $e=Kr.exports,Wt={exports:{}},Qr={},ae={},Pe={};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.dontSetMe=Oi,Pe.findInArray=wi,Pe.int=xi,Pe.isFunction=_i,Pe.isNum=Ii;function wi(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function _i(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function Ii(e){return typeof e=="number"&&!isNaN(e)}function xi(e){return parseInt(e,10)}function Oi(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var Ze={};Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.browserPrefixToKey=ta,Ze.browserPrefixToStyle=Ei,Ze.default=void 0,Ze.getPrefix=ea;const An=["Moz","Webkit","O","ms"];function ea(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<An.length;r++)if(ta(t,An[r])in n)return An[r];return""}function ta(e,t){return t?"".concat(t).concat(Mi(e)):e}function Ei(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function Mi(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}Ze.default=ea(),Object.defineProperty(ae,"__esModule",{value:!0}),ae.addClassName=oa,ae.addEvent=Ni,ae.addUserSelectStyles=Bi,ae.createCSSTransform=ki,ae.createSVGTransform=Hi,ae.getTouch=Wi,ae.getTouchIdentifier=$i,ae.getTranslation=kn,ae.innerHeight=Ui,ae.innerWidth=zi,ae.matchesSelector=aa,ae.matchesSelectorAndParentsTo=Pi,ae.offsetXYFromParent=Ai,ae.outerHeight=Li,ae.outerWidth=Vi,ae.removeClassName=ia,ae.removeEvent=ji,ae.removeUserSelectStyles=Fi;var we=Pe,na=Di(Ze);function ra(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ra=function(r){return r?n:t})(e)}function Di(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ra(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}let $t="";function aa(e,t){return $t||($t=(0,we.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,we.isFunction)(e[n])})),(0,we.isFunction)(e[$t])?e[$t](t):!1}function Pi(e,t,n){let r=e;do{if(aa(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function Ni(e,t,n,r){if(!e)return;const a={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,a):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function ji(e,t,n,r){if(!e)return;const a={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,a):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function Li(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,we.int)(n.borderTopWidth),t+=(0,we.int)(n.borderBottomWidth),t}function Vi(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,we.int)(n.borderLeftWidth),t+=(0,we.int)(n.borderRightWidth),t}function Ui(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,we.int)(n.paddingTop),t-=(0,we.int)(n.paddingBottom),t}function zi(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,we.int)(n.paddingLeft),t-=(0,we.int)(n.paddingRight),t}function Ai(e,t,n){const a=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-a.left)/n,i=(e.clientY+t.scrollTop-a.top)/n;return{x:o,y:i}}function ki(e,t){const n=kn(e,t,"px");return{[(0,na.browserPrefixToKey)("transform",na.default)]:n}}function Hi(e,t){return kn(e,t,"")}function kn(e,t,n){let{x:r,y:a}=e,o="translate(".concat(r).concat(n,",").concat(a).concat(n,")");if(t){const i="".concat(typeof t.x=="string"?t.x:t.x+n),u="".concat(typeof t.y=="string"?t.y:t.y+n);o="translate(".concat(i,", ").concat(u,")")+o}return o}function Wi(e,t){return e.targetTouches&&(0,we.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,we.findInArray)(e.changedTouches,n=>t===n.identifier)}function $i(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Bi(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
9
|
+
*/var Uo=I,ko=Symbol.for("react.element"),Wo=Symbol.for("react.fragment"),zo=Object.prototype.hasOwnProperty,Ao=Uo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ho={key:!0,ref:!0,__self:!0,__source:!0};function Nr(e,t,n){var r,a={},o=null,i=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)zo.call(t,r)&&!Ho.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)a[r]===void 0&&(a[r]=t[r]);return{$$typeof:ko,type:e,key:o,ref:i,props:a,_owner:Ao.current}}Wt.Fragment=Wo,Wt.jsx=Nr,Wt.jsxs=Nr,Mr.exports=Wt;var h=Mr.exports;const D={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 Ee=function(){return Ee=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Ee.apply(this,arguments)},$o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n},dt=I.forwardRef(function(e,t){var n=e.icon,r=e.id,a=e.className,o=e.extend,i=$o(e,["icon","id","className","extend"]),u="univerjs-icon univerjs-icon-".concat(r," ").concat(a||"").trim(),l=I.useRef("_".concat(Go()));return jr(n,"".concat(r),{defIds:n.defIds,idSuffix:l.current},Ee({ref:t,className:u},i),o)});function jr(e,t,n,r,a){return I.createElement(e.tag,Ee(Ee({key:t},Bo(e,n,a)),r),(Fo(e,n).children||[]).map(function(o,i){return jr(o,"".concat(t,"-").concat(e.tag,"-").concat(i),n,void 0,a)}))}function Bo(e,t,n){var r=Ee({},e.attrs);n!=null&&n.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=n.colorChannel1);var a=t.defIds;return!a||a.length===0||(e.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+t.idSuffix),Object.entries(r).forEach(function(o){var i=o[0],u=o[1];typeof u=="string"&&(r[i]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),r}function Fo(e,t){var n,r=t.defIds;return!r||r.length===0?e:e.tag==="defs"&&(!((n=e.children)===null||n===void 0)&&n.length)?Ee(Ee({},e),{children:e.children.map(function(a){return typeof a.attrs.id=="string"&&r&&r.indexOf(a.attrs.id)>-1?Ee(Ee({},a),{attrs:Ee(Ee({},a.attrs),{id:a.attrs.id+t.idSuffix})}):a})}):e}function Go(){return Math.random().toString(36).substring(2,8)}dt.displayName="UniverIcon";var qo={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"}}]},Lr=I.forwardRef(function(e,t){return I.createElement(dt,Object.assign({},e,{id:"delete-single",ref:t,icon:qo}))});Lr.displayName="DeleteSingle";const In=Lr;var Xo={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"}}]},Vr=I.forwardRef(function(e,t){return I.createElement(dt,Object.assign({},e,{id:"increase-single",ref:t,icon:Xo}))});Vr.displayName="IncreaseSingle";const Yo=Vr;var Ko={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"}}]},Ur=I.forwardRef(function(e,t){return I.createElement(dt,Object.assign({},e,{id:"more-down-single",ref:t,icon:Ko}))});Ur.displayName="MoreDownSingle";const xn=Ur;var Zo={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"}}]}]},kr=I.forwardRef(function(e,t){return I.createElement(dt,Object.assign({},e,{id:"sequence-single",ref:t,icon:Zo}))});kr.displayName="SequenceSingle";const Jo=kr;var Qo={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"}}]}]},Wr=I.forwardRef(function(e,t){return I.createElement(dt,Object.assign({},e,{id:"slash-single",ref:t,icon:Qo}))});Wr.displayName="SlashSingle";const zt=Wr;var zr={exports:{}},_t={},On={exports:{}};(function(e,t){(function(n,r){r(t)})(Be,function(n){function r(M){return function(J,Y,X,re,se,Se,te){return M(J,Y,te)}}function a(M){return function(J,Y,X,re){if(!J||!Y||typeof J!="object"||typeof Y!="object")return M(J,Y,X,re);var se=re.get(J),Se=re.get(Y);if(se&&Se)return se===Y&&Se===J;re.set(J,Y),re.set(Y,J);var te=M(J,Y,X,re);return re.delete(J),re.delete(Y),te}}function o(M,W){var J={};for(var Y in M)J[Y]=M[Y];for(var Y in W)J[Y]=W[Y];return J}function i(M){return M.constructor===Object||M.constructor==null}function u(M){return typeof M.then=="function"}function l(M,W){return M===W||M!==M&&W!==W}var c="[object Arguments]",d="[object Boolean]",p="[object Date]",f="[object RegExp]",v="[object Map]",y="[object Number]",b="[object Object]",x="[object Set]",_="[object String]",T=Object.prototype.toString;function S(M){var W=M.areArraysEqual,J=M.areDatesEqual,Y=M.areMapsEqual,X=M.areObjectsEqual,re=M.areRegExpsEqual,se=M.areSetsEqual,Se=M.createIsNestedEqual,te=Se(ze);function ze(ae,ue,Ae){if(ae===ue)return!0;if(!ae||!ue||typeof ae!="object"||typeof ue!="object")return ae!==ae&&ue!==ue;if(i(ae)&&i(ue))return X(ae,ue,te,Ae);var Co=Array.isArray(ae),_o=Array.isArray(ue);if(Co||_o)return Co===_o&&W(ae,ue,te,Ae);var He=T.call(ae);return He!==T.call(ue)?!1:He===p?J(ae,ue,te,Ae):He===f?re(ae,ue,te,Ae):He===v?Y(ae,ue,te,Ae):He===x?se(ae,ue,te,Ae):He===b||He===c?u(ae)||u(ue)?!1:X(ae,ue,te,Ae):He===d||He===y||He===_?l(ae.valueOf(),ue.valueOf()):!1}return ze}function R(M,W,J,Y){var X=M.length;if(W.length!==X)return!1;for(;X-- >0;)if(!J(M[X],W[X],X,X,M,W,Y))return!1;return!0}var g=a(R);function O(M,W){return l(M.valueOf(),W.valueOf())}function E(M,W,J,Y){var X=M.size===W.size;if(!X)return!1;if(!M.size)return!0;var re={},se=0;return M.forEach(function(Se,te){if(X){var ze=!1,ae=0;W.forEach(function(ue,Ae){!ze&&!re[ae]&&(ze=J(te,Ae,se,ae,M,W,Y)&&J(Se,ue,te,Ae,M,W,Y))&&(re[ae]=!0),ae++}),se++,X=ze}}),X}var w=a(E),j="_owner",L=Object.prototype.hasOwnProperty;function k(M,W,J,Y){var X=Object.keys(M),re=X.length;if(Object.keys(W).length!==re)return!1;for(var se;re-- >0;){if(se=X[re],se===j){var Se=!!M.$$typeof,te=!!W.$$typeof;if((Se||te)&&Se!==te)return!1}if(!L.call(W,se)||!J(M[se],W[se],se,se,M,W,Y))return!1}return!0}var G=a(k);function C(M,W){return M.source===W.source&&M.flags===W.flags}function P(M,W,J,Y){var X=M.size===W.size;if(!X)return!1;if(!M.size)return!0;var re={};return M.forEach(function(se,Se){if(X){var te=!1,ze=0;W.forEach(function(ae,ue){!te&&!re[ze]&&(te=J(se,ae,Se,ue,M,W,Y))&&(re[ze]=!0),ze++}),X=te}}),X}var Q=a(P),_e=Object.freeze({areArraysEqual:R,areDatesEqual:O,areMapsEqual:E,areObjectsEqual:k,areRegExpsEqual:C,areSetsEqual:P,createIsNestedEqual:r}),ve=Object.freeze({areArraysEqual:g,areDatesEqual:O,areMapsEqual:w,areObjectsEqual:G,areRegExpsEqual:C,areSetsEqual:Q,createIsNestedEqual:r}),ye=S(_e);function je(M,W){return ye(M,W,void 0)}var z=S(o(_e,{createIsNestedEqual:function(){return l}}));function Z(M,W){return z(M,W,void 0)}var ie=S(ve);function fe(M,W){return ie(M,W,new WeakMap)}var de=S(o(ve,{createIsNestedEqual:function(){return l}}));function pe(M,W){return de(M,W,new WeakMap)}function Pe(M){return S(o(_e,M(_e)))}function Le(M){var W=S(o(ve,M(ve)));return function(J,Y,X){return X===void 0&&(X=new WeakMap),W(J,Y,X)}}n.circularDeepEqual=fe,n.circularShallowEqual=pe,n.createCustomCircularEqual=Le,n.createCustomEqual=Pe,n.deepEqual=je,n.sameValueZeroEqual=l,n.shallowEqual=Z,Object.defineProperty(n,"__esModule",{value:!0})})})(On,On.exports);var En=On.exports,F={},ei=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(F,"__esModule",{value:!0}),F.bottom=Pn,F.childrenEqual=ri,F.cloneLayout=Hr,F.cloneLayoutItem=Je,F.collides=At,F.compact=Br,F.compactItem=Fr,F.compactType=pi,F.correctBounds=Gr,F.fastPositionEqual=ai,F.fastRGLPropsEqual=void 0,F.getAllCollisions=qr,F.getFirstCollision=Qe,F.getLayoutItem=Mn,F.getStatics=Nn,F.modifyLayout=$r,F.moveElement=It,F.moveElementAwayFromCollision=jn,F.noop=void 0,F.perc=ii,F.resizeItemInDirection=li,F.setTopLeft=ci,F.setTransform=ui,F.sortLayoutItems=zn,F.sortLayoutItemsByColRow=Jr,F.sortLayoutItemsByRowCol=Zr,F.synchronizeLayoutWithChildren=di,F.validateLayout=fi,F.withLayoutItem=ni;var Ar=En,wt=ti(I);function ti(e){return e&&e.__esModule?e:{default:e}}function Pn(e){let t=0,n;for(let r=0,a=e.length;r<a;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function Hr(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Je(e[n]);return t}function $r(e,t){const n=Array(e.length);for(let r=0,a=e.length;r<a;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function ni(e,t,n){let r=Mn(e,t);return r?(r=n(Je(r)),e=$r(e,r),[e,r]):[e,null]}function Je(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function ri(e,t){return(0,Ar.deepEqual)(wt.default.Children.map(e,n=>n==null?void 0:n.key),wt.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,Ar.deepEqual)(wt.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),wt.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}F.fastRGLPropsEqual=ei;function ai(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function At(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Br(e,t,n,r){const a=Nn(e),o=zn(e,t),i=Array(e.length);for(let u=0,l=o.length;u<l;u++){let c=Je(o[u]);c.static||(c=Fr(a,c,t,n,o,r),a.push(c)),i[e.indexOf(o[u])]=c,c.moved=!1}return i}const oi={x:"w",y:"h"};function Dn(e,t,n,r){const a=oi[r];t[r]+=1;const o=e.map(i=>i.i).indexOf(t.i);for(let i=o+1;i<e.length;i++){const u=e[i];if(!u.static){if(u.y>t.y+t.h)break;At(t,u)&&Dn(e,u,n+t[a],r)}}t[r]=n}function Fr(e,t,n,r,a,o){const i=n==="vertical",u=n==="horizontal";if(i)for(t.y=Math.min(Pn(e),t.y);t.y>0&&!Qe(e,t);)t.y--;else if(u)for(;t.x>0&&!Qe(e,t);)t.x--;let l;for(;(l=Qe(e,t))&&!(n===null&&o);)if(u?Dn(a,t,l.x+l.w,"x"):Dn(a,t,l.y+l.h,"y"),u&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Qe(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function Gr(e,t){const n=Nn(e);for(let r=0,a=e.length;r<a;r++){const o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;Qe(n,o);)o.y++}return e}function Mn(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Qe(e,t){for(let n=0,r=e.length;n<r;n++)if(At(e[n],t))return e[n]}function qr(e,t){return e.filter(n=>At(n,t))}function Nn(e){return e.filter(t=>t.static)}function It(e,t,n,r,a,o,i,u,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let p=zn(e,i);(i==="vertical"&&typeof r=="number"?d>=r:i==="horizontal"&&typeof n=="number"?c>=n:!1)&&(p=p.reverse());const v=qr(p,t),y=v.length>0;if(y&&l)return Hr(e);if(y&&o)return`${t.i}`,t.x=c,t.y=d,t.moved=!1,e;for(let b=0,x=v.length;b<x;b++){const _=v[b];`${t.i}${t.x}${t.y}${_.i}${_.x}${_.y}`,!_.moved&&(_.static?e=jn(e,_,t,a,i):e=jn(e,t,_,a,i))}return e}function jn(e,t,n,r,a,o){const i=a==="horizontal",u=a==="vertical",l=t.static;if(r){r=!1;const p={x:i?Math.max(t.x-n.w,0):n.x,y:u?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},f=Qe(e,p),v=f&&f.y+f.h>t.y,y=f&&t.x+t.w>f.x;if(f){if(v&&u)return It(e,n,void 0,t.y+1,r,l,a);if(v&&a==null)return t.y=n.y,n.y=n.y+n.h,e;if(y&&i)return It(e,t,n.x,void 0,r,l,a)}else return`${n.i}${p.x}${p.y}`,It(e,n,i?p.x:void 0,u?p.y:void 0,r,l,a)}const c=i?n.x+1:void 0,d=u?n.y+1:void 0;return c==null&&d==null?e:It(e,n,i?n.x+1:void 0,u?n.y+1:void 0,r,l,a)}function ii(e){return e*100+"%"}const Xr=(e,t,n,r)=>e+n>r?t:n,Yr=(e,t,n)=>e<0?t:n,Kr=e=>Math.max(0,e),Ln=e=>Math.max(0,e),Vn=(e,t,n)=>{let{left:r,height:a,width:o}=t;const i=e.top-(a-e.height);return{left:r,width:o,height:Yr(i,e.height,a),top:Ln(i)}},Un=(e,t,n)=>{let{top:r,left:a,height:o,width:i}=t;return{top:r,height:o,width:Xr(e.left,e.width,i,n),left:Kr(a)}},kn=(e,t,n)=>{let{top:r,height:a,width:o}=t;const i=e.left-(o-e.width);return{height:a,width:i<0?e.width:Xr(e.left,e.width,o,n),top:Ln(r),left:Kr(i)}},Wn=(e,t,n)=>{let{top:r,left:a,height:o,width:i}=t;return{width:i,left:a,height:Yr(r,e.height,o),top:Ln(r)}},si={n:Vn,ne:function(){return Vn(arguments.length<=0?void 0:arguments[0],Un(...arguments))},e:Un,se:function(){return Wn(arguments.length<=0?void 0:arguments[0],Un(...arguments))},s:Wn,sw:function(){return Wn(arguments.length<=0?void 0:arguments[0],kn(...arguments))},w:kn,nw:function(){return Vn(arguments.length<=0?void 0:arguments[0],kn(...arguments))}};function li(e,t,n,r){const a=si[e];return a?a(t,{...t,...n},r):n}function ui(e){let{top:t,left:n,width:r,height:a}=e;const o=`translate(${n}px,${t}px)`;return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:`${r}px`,height:`${a}px`,position:"absolute"}}function ci(e){let{top:t,left:n,width:r,height:a}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${a}px`,position:"absolute"}}function zn(e,t){return t==="horizontal"?Jr(e):t==="vertical"?Zr(e):e}function Zr(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function Jr(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function di(e,t,n,r,a){e=e||[];const o=[];wt.default.Children.forEach(t,u=>{if((u==null?void 0:u.key)==null)return;const l=Mn(e,String(u.key)),c=u.props["data-grid"];l&&c==null?o.push(Je(l)):c?o.push(Je({...c,i:u.key})):o.push(Je({w:1,h:1,x:0,y:Pn(o),i:String(u.key)}))});const i=Gr(o,{cols:n});return a?i:Br(i,r,n)}function fi(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,a=e.length;r<a;r++){const o=e[r];for(let i=0;i<n.length;i++)if(typeof o[n[i]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[i]+" must be a number!")}}function pi(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function Xd(){}const hi=()=>{};F.noop=hi;var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.calcGridColWidth=Ht,Ve.calcGridItemPosition=mi,Ve.calcGridItemWHPx=An,Ve.calcWH=vi,Ve.calcXY=gi,Ve.clamp=et;function Ht(e){const{margin:t,containerPadding:n,containerWidth:r,cols:a}=e;return(r-t[0]*(a-1)-n[0]*2)/a}function An(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function mi(e,t,n,r,a,o){const{margin:i,containerPadding:u,rowHeight:l}=e,c=Ht(e),d={};return o&&o.resizing?(d.width=Math.round(o.resizing.width),d.height=Math.round(o.resizing.height)):(d.width=An(r,c,i[0]),d.height=An(a,l,i[1])),o&&o.dragging?(d.top=Math.round(o.dragging.top),d.left=Math.round(o.dragging.left)):o&&o.resizing&&typeof o.resizing.top=="number"&&typeof o.resizing.left=="number"?(d.top=Math.round(o.resizing.top),d.left=Math.round(o.resizing.left)):(d.top=Math.round((l+i[1])*n+u[1]),d.left=Math.round((c+i[0])*t+u[0])),d}function gi(e,t,n,r,a){const{margin:o,cols:i,rowHeight:u,maxRows:l}=e,c=Ht(e);let d=Math.round((n-o[0])/(c+o[0])),p=Math.round((t-o[1])/(u+o[1]));return d=et(d,0,i-r),p=et(p,0,l-a),{x:d,y:p}}function vi(e,t,n,r,a,o){const{margin:i,maxRows:u,cols:l,rowHeight:c}=e,d=Ht(e);let p=Math.round((t+i[0])/(d+i[0])),f=Math.round((n+i[1])/(c+i[1])),v=et(p,0,l-r),y=et(f,0,u-a);return["sw","w","nw"].indexOf(o)!==-1&&(v=et(p,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(y=et(f,0,u)),{w:v,h:y}}function et(e,t,n){return Math.max(Math.min(e,n),t)}var $t={},Qr={exports:{}},yi="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Si=yi,bi=Si;function ea(){}function ta(){}ta.resetWarningCache=ea;var Ti=function(){function e(r,a,o,i,u,l){if(l!==bi){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}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ta,resetWarningCache:ea};return n.PropTypes=n,n};Qr.exports=Ti();var Xe=Qr.exports,Bt={exports:{}},na={},oe={},Ue={};Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.dontSetMe=Ii,Ue.findInArray=Ri,Ue.int=wi,Ue.isFunction=Ci,Ue.isNum=_i;function Ri(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function Ci(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function _i(e){return typeof e=="number"&&!isNaN(e)}function wi(e){return parseInt(e,10)}function Ii(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var tt={};Object.defineProperty(tt,"__esModule",{value:!0}),tt.browserPrefixToKey=aa,tt.browserPrefixToStyle=xi,tt.default=void 0,tt.getPrefix=ra;const Hn=["Moz","Webkit","O","ms"];function ra(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<Hn.length;r++)if(aa(t,Hn[r])in n)return Hn[r];return""}function aa(e,t){return t?"".concat(t).concat(Oi(e)):e}function xi(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function Oi(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}tt.default=ra(),Object.defineProperty(oe,"__esModule",{value:!0}),oe.addClassName=la,oe.addEvent=Di,oe.addUserSelectStyles=Hi,oe.createCSSTransform=ki,oe.createSVGTransform=Wi,oe.getTouch=zi,oe.getTouchIdentifier=Ai,oe.getTranslation=$n,oe.innerHeight=Li,oe.innerWidth=Vi,oe.matchesSelector=sa,oe.matchesSelectorAndParentsTo=Pi,oe.offsetXYFromParent=Ui,oe.outerHeight=Ni,oe.outerWidth=ji,oe.removeClassName=ua,oe.removeEvent=Mi,oe.removeUserSelectStyles=$i;var Ie=Ue,oa=Ei(tt);function ia(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ia=function(r){return r?n:t})(e)}function Ei(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ia(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}let Ft="";function sa(e,t){return Ft||(Ft=(0,Ie.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Ie.isFunction)(e[n])})),(0,Ie.isFunction)(e[Ft])?e[Ft](t):!1}function Pi(e,t,n){let r=e;do{if(sa(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function Di(e,t,n,r){if(!e)return;const a={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,a):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function Mi(e,t,n,r){if(!e)return;const a={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,a):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function Ni(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Ie.int)(n.borderTopWidth),t+=(0,Ie.int)(n.borderBottomWidth),t}function ji(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Ie.int)(n.borderLeftWidth),t+=(0,Ie.int)(n.borderRightWidth),t}function Li(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Ie.int)(n.paddingTop),t-=(0,Ie.int)(n.paddingBottom),t}function Vi(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Ie.int)(n.paddingLeft),t-=(0,Ie.int)(n.paddingRight),t}function Ui(e,t,n){const a=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-a.left)/n,i=(e.clientY+t.scrollTop-a.top)/n;return{x:o,y:i}}function ki(e,t){const n=$n(e,t,"px");return{[(0,oa.browserPrefixToKey)("transform",oa.default)]:n}}function Wi(e,t){return $n(e,t,"")}function $n(e,t,n){let{x:r,y:a}=e,o="translate(".concat(r).concat(n,",").concat(a).concat(n,")");if(t){const i="".concat(typeof t.x=="string"?t.x:t.x+n),u="".concat(typeof t.y=="string"?t.y:t.y+n);o="translate(".concat(i,", ").concat(u,")")+o}return o}function zi(e,t){return e.targetTouches&&(0,Ie.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Ie.findInArray)(e.changedTouches,n=>t===n.identifier)}function Ai(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Hi(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
10
10
|
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
11
|
-
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&oa(e.body,"react-draggable-transparent-selection")}function Fi(e){if(e)try{if(e.body&&ia(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function oa(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function ia(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.canDragX=Xi,Ne.canDragY=Yi,Ne.createCoreData=Zi,Ne.createDraggableData=Ji,Ne.getBoundPosition=Gi,Ne.getControlPosition=Ki,Ne.snapToGrid=qi;var _e=Pe,ut=ae;function Gi(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:Qi(r);const a=Hn(e);if(typeof r=="string"){const{ownerDocument:o}=a,i=o.defaultView;let u;if(r==="parent"?u=a.parentNode:u=o.querySelector(r),!(u instanceof i.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=u,c=i.getComputedStyle(a),d=i.getComputedStyle(l);r={left:-a.offsetLeft+(0,_e.int)(d.paddingLeft)+(0,_e.int)(c.marginLeft),top:-a.offsetTop+(0,_e.int)(d.paddingTop)+(0,_e.int)(c.marginTop),right:(0,ut.innerWidth)(l)-(0,ut.outerWidth)(a)-a.offsetLeft+(0,_e.int)(d.paddingRight)-(0,_e.int)(c.marginRight),bottom:(0,ut.innerHeight)(l)-(0,ut.outerHeight)(a)-a.offsetTop+(0,_e.int)(d.paddingBottom)-(0,_e.int)(c.marginBottom)}}return(0,_e.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,_e.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,_e.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,_e.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function qi(e,t,n){const r=Math.round(t/e[0])*e[0],a=Math.round(n/e[1])*e[1];return[r,a]}function Xi(e){return e.props.axis==="both"||e.props.axis==="x"}function Yi(e){return e.props.axis==="both"||e.props.axis==="y"}function Ki(e,t,n){const r=typeof t=="number"?(0,ut.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const a=Hn(n),o=n.props.offsetParent||a.offsetParent||a.ownerDocument.body;return(0,ut.offsetXYFromParent)(r||e,o,n.props.scale)}function Zi(e,t,n){const r=!(0,_e.isNum)(e.lastX),a=Hn(e);return r?{node:a,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:a,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function Ji(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function Qi(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Hn(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Bt={},Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.default=es;function es(){}Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.default=void 0;var Wn=ns(_),ye=Bn($e),ts=Bn(_r),pe=ae,Be=Ne,$n=Pe,Ct=Bn(Ft);function Bn(e){return e&&e.__esModule?e:{default:e}}function sa(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(sa=function(r){return r?n:t})(e)}function ns(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=sa(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function ge(e,t,n){return t=rs(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rs(e){var t=as(e,"string");return typeof t=="symbol"?t:String(t)}function as(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Me={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Fe=Me.mouse,Gt=class extends Wn.Component{constructor(){super(...arguments),ge(this,"dragging",!1),ge(this,"lastX",NaN),ge(this,"lastY",NaN),ge(this,"touchIdentifier",null),ge(this,"mounted",!1),ge(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,pe.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,pe.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const a=(0,pe.getTouchIdentifier)(t);this.touchIdentifier=a;const o=(0,Be.getControlPosition)(t,a,this);if(o==null)return;const{x:i,y:u}=o,l=(0,Be.createCoreData)(this,i,u);(0,Ct.default)("DraggableCore: handleDragStart: %j",l),(0,Ct.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,pe.addUserSelectStyles)(r),this.dragging=!0,this.lastX=i,this.lastY=u,(0,pe.addEvent)(r,Fe.move,this.handleDrag),(0,pe.addEvent)(r,Fe.stop,this.handleDragStop))}),ge(this,"handleDrag",t=>{const n=(0,Be.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:a}=n;if(Array.isArray(this.props.grid)){let u=r-this.lastX,l=a-this.lastY;if([u,l]=(0,Be.snapToGrid)(this.props.grid,u,l),!u&&!l)return;r=this.lastX+u,a=this.lastY+l}const o=(0,Be.createCoreData)(this,r,a);if((0,Ct.default)("DraggableCore: handleDrag: %j",o),this.props.onDrag(t,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=a}),ge(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,Be.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:a}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=a-this.lastY||0;[l,c]=(0,Be.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,a=this.lastY+c}const o=(0,Be.createCoreData)(this,r,a);if(this.props.onStop(t,o)===!1||this.mounted===!1)return!1;const u=this.findDOMNode();u&&this.props.enableUserSelectHack&&(0,pe.removeUserSelectStyles)(u.ownerDocument),(0,Ct.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,u&&((0,Ct.default)("DraggableCore: Removing handlers"),(0,pe.removeEvent)(u.ownerDocument,Fe.move,this.handleDrag),(0,pe.removeEvent)(u.ownerDocument,Fe.stop,this.handleDragStop))}),ge(this,"onMouseDown",t=>(Fe=Me.mouse,this.handleDragStart(t))),ge(this,"onMouseUp",t=>(Fe=Me.mouse,this.handleDragStop(t))),ge(this,"onTouchStart",t=>(Fe=Me.touch,this.handleDragStart(t))),ge(this,"onTouchEnd",t=>(Fe=Me.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,pe.addEvent)(t,Me.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,pe.removeEvent)(n,Me.mouse.move,this.handleDrag),(0,pe.removeEvent)(n,Me.touch.move,this.handleDrag),(0,pe.removeEvent)(n,Me.mouse.stop,this.handleDragStop),(0,pe.removeEvent)(n,Me.touch.stop,this.handleDragStop),(0,pe.removeEvent)(t,Me.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,pe.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:ts.default.findDOMNode(this)}render(){return Wn.cloneElement(Wn.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Bt.default=Gt,ge(Gt,"displayName","DraggableCore"),ge(Gt,"propTypes",{allowAnyClick:ye.default.bool,children:ye.default.node.isRequired,disabled:ye.default.bool,enableUserSelectHack:ye.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:ye.default.arrayOf(ye.default.number),handle:ye.default.string,cancel:ye.default.string,nodeRef:ye.default.object,onStart:ye.default.func,onDrag:ye.default.func,onStop:ye.default.func,onMouseDown:ye.default.func,scale:ye.default.number,className:$n.dontSetMe,style:$n.dontSetMe,transform:$n.dontSetMe}),ge(Gt,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=f(_),n=d($e),r=d(_r),a=d(We),o=ae,i=Ne,u=Pe,l=d(Bt),c=d(Ft);function d(b){return b&&b.__esModule?b:{default:b}}function h(b){if(typeof WeakMap!="function")return null;var S=new WeakMap,C=new WeakMap;return(h=function(g){return g?C:S})(b)}function f(b,S){if(!S&&b&&b.__esModule)return b;if(b===null||typeof b!="object"&&typeof b!="function")return{default:b};var C=h(S);if(C&&C.has(b))return C.get(b);var g={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in b)if(M!=="default"&&Object.prototype.hasOwnProperty.call(b,M)){var I=O?Object.getOwnPropertyDescriptor(b,M):null;I&&(I.get||I.set)?Object.defineProperty(g,M,I):g[M]=b[M]}return g.default=b,C&&C.set(b,g),g}function v(){return v=Object.assign?Object.assign.bind():function(b){for(var S=1;S<arguments.length;S++){var C=arguments[S];for(var g in C)Object.prototype.hasOwnProperty.call(C,g)&&(b[g]=C[g])}return b},v.apply(this,arguments)}function y(b,S,C){return S=T(S),S in b?Object.defineProperty(b,S,{value:C,enumerable:!0,configurable:!0,writable:!0}):b[S]=C,b}function T(b){var S=x(b,"string");return typeof S=="symbol"?S:String(S)}function x(b,S){if(typeof b!="object"||b===null)return b;var C=b[Symbol.toPrimitive];if(C!==void 0){var g=C.call(b,S||"default");if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(b)}class w extends t.Component{static getDerivedStateFromProps(S,C){let{position:g}=S,{prevPropsPosition:O}=C;return g&&(!O||g.x!==O.x||g.y!==O.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:g,prevPropsPosition:O}),{x:g.x,y:g.y,prevPropsPosition:{...g}}):null}constructor(S){super(S),y(this,"onDragStart",(C,g)=>{if((0,c.default)("Draggable: onDragStart: %j",g),this.props.onStart(C,(0,i.createDraggableData)(this,g))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),y(this,"onDrag",(C,g)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",g);const O=(0,i.createDraggableData)(this,g),M={x:O.x,y:O.y,slackX:0,slackY:0};if(this.props.bounds){const{x:j,y:L}=M;M.x+=this.state.slackX,M.y+=this.state.slackY;const[U,F]=(0,i.getBoundPosition)(this,M.x,M.y);M.x=U,M.y=F,M.slackX=this.state.slackX+(j-M.x),M.slackY=this.state.slackY+(L-M.y),O.x=M.x,O.y=M.y,O.deltaX=M.x-this.state.x,O.deltaY=M.y-this.state.y}if(this.props.onDrag(C,O)===!1)return!1;this.setState(M)}),y(this,"onDragStop",(C,g)=>{if(!this.state.dragging||this.props.onStop(C,(0,i.createDraggableData)(this,g))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",g);const M={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:j,y:L}=this.props.position;M.x=j,M.y=L}this.setState(M)}),this.state={dragging:!1,dragged:!1,x:S.position?S.position.x:S.defaultPosition.x,y:S.position?S.position.y:S.defaultPosition.y,prevPropsPosition:{...S.position},slackX:0,slackY:0,isElementSVG:!1},S.position&&!(S.onDrag||S.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 S,C;return(S=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&S!==void 0?S:r.default.findDOMNode(this)}render(){const{axis:S,bounds:C,children:g,defaultPosition:O,defaultClassName:M,defaultClassNameDragging:I,defaultClassNameDragged:j,position:L,positionOffset:U,scale:F,...R}=this.props;let E={},J=null;const z=!!!L||this.state.dragging,q=L||O,ne={x:(0,i.canDragX)(this)&&z?this.state.x:q.x,y:(0,i.canDragY)(this)&&z?this.state.y:q.y};this.state.isElementSVG?J=(0,o.createSVGTransform)(ne,U):E=(0,o.createCSSTransform)(ne,U);const ce=(0,a.default)(g.props.className||"",M,{[I]:this.state.dragging,[j]:this.state.dragged});return t.createElement(l.default,v({},R,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(g),{className:ce,style:{...g.props.style,...E},transform:J}))}}e.default=w,y(w,"displayName","Draggable"),y(w,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:u.dontSetMe,style:u.dontSetMe,transform:u.dontSetMe}),y(w,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Qr);const{default:la,DraggableCore:os}=Qr;Wt.exports=la,Wt.exports.default=la,Wt.exports.DraggableCore=os;var ua=Wt.exports,qt={exports:{}},wt={},Fn={};Fn.__esModule=!0,Fn.cloneElement=ds;var is=ss(_);function ss(e){return e&&e.__esModule?e:{default:e}}function ca(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function da(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ca(Object(n),!0).forEach(function(r){ls(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ca(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ls(e,t,n){return t=us(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function us(e){var t=cs(e,"string");return typeof t=="symbol"?t:String(t)}function cs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ds(e,t){return t.style&&e.props.style&&(t.style=da(da({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),is.default.cloneElement(e,t)}var _t={};_t.__esModule=!0,_t.resizableProps=void 0;var W=fs($e);function fs(e){return e&&e.__esModule?e:{default:e}}var ps={axis:W.default.oneOf(["both","x","y","none"]),className:W.default.string,children:W.default.element.isRequired,draggableOpts:W.default.shape({allowAnyClick:W.default.bool,cancel:W.default.string,children:W.default.node,disabled:W.default.bool,enableUserSelectHack:W.default.bool,offsetParent:W.default.node,grid:W.default.arrayOf(W.default.number),handle:W.default.string,nodeRef:W.default.object,onStart:W.default.func,onDrag:W.default.func,onStop:W.default.func,onMouseDown:W.default.func,scale:W.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(a.axis==="both"||a.axis==="y"){var o;return(o=W.default.number).isRequired.apply(o,n)}return W.default.number.apply(W.default,n)},handle:W.default.oneOfType([W.default.node,W.default.func]),handleSize:W.default.arrayOf(W.default.number),lockAspectRatio:W.default.bool,maxConstraints:W.default.arrayOf(W.default.number),minConstraints:W.default.arrayOf(W.default.number),onResizeStop:W.default.func,onResizeStart:W.default.func,onResize:W.default.func,resizeHandles:W.default.arrayOf(W.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:W.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(a.axis==="both"||a.axis==="x"){var o;return(o=W.default.number).isRequired.apply(o,n)}return W.default.number.apply(W.default,n)}};_t.resizableProps=ps,wt.__esModule=!0,wt.default=void 0;var It=ys(_),hs=ua,ms=Fn,gs=_t,vs=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function fa(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(fa=function(a){return a?n:t})(e)}function ys(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=fa(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Gn(){return Gn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gn.apply(this,arguments)}function Ss(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function pa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function qn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pa(Object(n),!0).forEach(function(r){bs(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pa(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bs(e,t,n){return t=Ts(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ts(e){var t=Rs(e,"string");return typeof t=="symbol"?t:String(t)}function Rs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cs(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Xn(e,t)}function Xn(e,t){return Xn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Xn(e,t)}var Yn=function(e){Cs(t,e);function t(){for(var r,a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return r=e.call.apply(e,[this].concat(o))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(a,o){var i=this.props,u=i.minConstraints,l=i.maxConstraints,c=i.lockAspectRatio;if(!u&&!l&&!c)return[a,o];if(c){var d=this.props.width/this.props.height,h=a-this.props.width,f=o-this.props.height;Math.abs(h)>Math.abs(f*d)?o=a/d:a=o*d}var v=a,y=o,T=this.slack||[0,0],x=T[0],w=T[1];return a+=x,o+=w,u&&(a=Math.max(u[0],a),o=Math.max(u[1],o)),l&&(a=Math.min(l[0],a),o=Math.min(l[1],o)),this.slack=[x+(v-a),w+(y-o)],[a,o]},n.resizeHandler=function(a,o){var i=this;return function(u,l){var c=l.node,d=l.deltaX,h=l.deltaY;a==="onResizeStart"&&i.resetData();var f=(i.props.axis==="both"||i.props.axis==="x")&&o!=="n"&&o!=="s",v=(i.props.axis==="both"||i.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!f&&!v)){var y=o[0],T=o[o.length-1],x=c.getBoundingClientRect();if(i.lastHandleRect!=null){if(T==="w"){var w=x.left-i.lastHandleRect.left;d+=w}if(y==="n"){var b=x.top-i.lastHandleRect.top;h+=b}}i.lastHandleRect=x,T==="w"&&(d=-d),y==="n"&&(h=-h);var S=i.props.width+(f?d/i.props.transformScale:0),C=i.props.height+(v?h/i.props.transformScale:0),g=i.runConstraints(S,C);S=g[0],C=g[1];var O=S!==i.props.width||C!==i.props.height,M=typeof i.props[a]=="function"?i.props[a]:null,I=a==="onResize"&&!O;M&&!I&&(u.persist==null||u.persist(),M(u,{node:c,size:{width:S,height:C},handle:o})),a==="onResizeStop"&&i.resetData()}}},n.renderResizeHandle=function(a,o){var i=this.props.handle;if(!i)return It.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+a,ref:o});if(typeof i=="function")return i(a,o);var u=typeof i.type=="string",l=qn({ref:o},u?{}:{handleAxis:a});return It.cloneElement(i,l)},n.render=function(){var a=this,o=this.props,i=o.children,u=o.className,l=o.draggableOpts;o.width,o.height,o.handle,o.handleSize,o.lockAspectRatio,o.axis,o.minConstraints,o.maxConstraints,o.onResize,o.onResizeStop,o.onResizeStart;var c=o.resizeHandles;o.transformScale;var d=Ss(o,vs);return(0,ms.cloneElement)(i,qn(qn({},d),{},{className:(u?u+" ":"")+"react-resizable",children:[].concat(i.props.children,c.map(function(h){var f,v=(f=a.handleRefs[h])!=null?f:a.handleRefs[h]=It.createRef();return It.createElement(hs.DraggableCore,Gn({},l,{nodeRef:v,key:"resizableHandle-"+h,onStop:a.resizeHandler("onResizeStop",h),onStart:a.resizeHandler("onResizeStart",h),onDrag:a.resizeHandler("onResize",h)}),a.renderResizeHandle(h,v))}))}))},t}(It.Component);wt.default=Yn,Yn.propTypes=gs.resizableProps,Yn.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Xt={};Xt.__esModule=!0,Xt.default=void 0;var Kn=Os(_),ws=ha($e),_s=ha(wt),Is=_t,xs=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function ha(e){return e&&e.__esModule?e:{default:e}}function ma(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ma=function(a){return a?n:t})(e)}function Os(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ma(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Zn(){return Zn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zn.apply(this,arguments)}function ga(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ga(Object(n),!0).forEach(function(r){Es(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ga(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Es(e,t,n){return t=Ms(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ms(e){var t=Ds(e,"string");return typeof t=="symbol"?t:String(t)}function Ds(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ps(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Ns(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Jn(e,t)}function Jn(e,t){return Jn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Jn(e,t)}var va=function(e){Ns(t,e);function t(){for(var r,a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return r=e.call.apply(e,[this].concat(o))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(u,l){var c=l.size;r.props.onResize?(u.persist==null||u.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(u,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(a,o){return o.propsWidth!==a.width||o.propsHeight!==a.height?{width:a.width,height:a.height,propsWidth:a.width,propsHeight:a.height}:null};var n=t.prototype;return n.render=function(){var a=this.props,o=a.handle,i=a.handleSize;a.onResize;var u=a.onResizeStart,l=a.onResizeStop,c=a.draggableOpts,d=a.minConstraints,h=a.maxConstraints,f=a.lockAspectRatio,v=a.axis;a.width,a.height;var y=a.resizeHandles,T=a.style,x=a.transformScale,w=Ps(a,xs);return Kn.createElement(_s.default,{axis:v,draggableOpts:c,handle:o,handleSize:i,height:this.state.height,lockAspectRatio:f,maxConstraints:h,minConstraints:d,onResizeStart:u,onResize:this.onResize,onResizeStop:l,resizeHandles:y,transformScale:x,width:this.state.width},Kn.createElement("div",Zn({},w,{style:Yt(Yt({},T),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Kn.Component);Xt.default=va,va.propTypes=Yt(Yt({},Is.resizableProps),{},{children:ws.default.element}),qt.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},qt.exports.Resizable=wt.default,qt.exports.ResizableBox=Xt.default;var js=qt.exports,ke={};Object.defineProperty(ke,"__esModule",{value:!0}),ke.resizeHandleType=ke.resizeHandleAxesType=ke.default=void 0;var $=ya($e),Ls=ya(_);function ya(e){return e&&e.__esModule?e:{default:e}}const Vs=ke.resizeHandleAxesType=$.default.arrayOf($.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),Us=ke.resizeHandleType=$.default.oneOfType([$.default.node,$.default.func]);ke.default={className:$.default.string,style:$.default.object,width:$.default.number,autoSize:$.default.bool,cols:$.default.number,draggableCancel:$.default.string,draggableHandle:$.default.string,verticalCompact:function(e){e.verticalCompact},compactType:$.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&B.validateLayout(t,"layout")},margin:$.default.arrayOf($.default.number),containerPadding:$.default.arrayOf($.default.number),rowHeight:$.default.number,maxRows:$.default.number,isBounded:$.default.bool,isDraggable:$.default.bool,isResizable:$.default.bool,allowOverlap:$.default.bool,preventCollision:$.default.bool,useCSSTransforms:$.default.bool,transformScale:$.default.number,isDroppable:$.default.bool,resizeHandles:Vs,resizeHandle:Us,onLayoutChange:$.default.func,onDragStart:$.default.func,onDrag:$.default.func,onDragStop:$.default.func,onResizeStart:$.default.func,onResize:$.default.func,onResizeStop:$.default.func,onDrop:$.default.func,droppingItem:$.default.shape({i:$.default.string.isRequired,w:$.default.number.isRequired,h:$.default.number.isRequired}),children:function(e,t){const n=e[t],r={};Ls.default.Children.forEach(n,function(a){if((a==null?void 0:a.key)!=null){if(r[a.key])throw new Error('Duplicate child key "'+a.key+'" found! This will cause problems in ReactGridLayout.');r[a.key]=!0}})},innerRef:$.default.any},Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.default=void 0;var ct=Qn(_),Y=Qn($e),zs=ua,As=js,dt=B,fe=De,Sa=ke,ks=Qn(We);function Qn(e){return e&&e.__esModule?e:{default:e}}function je(e,t,n){return t=Hs(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hs(e){var t=Ws(e,"string");return typeof t=="symbol"?t:String(t)}function Ws(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class er extends ct.default.Component{constructor(){super(...arguments),je(this,"state",{resizing:null,dragging:null,className:""}),je(this,"elementRef",ct.default.createRef()),je(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:a,transformScale:o}=this.props;if(!a)return;const i={top:0,left:0},{offsetParent:u}=r;if(!u)return;const l=u.getBoundingClientRect(),c=r.getBoundingClientRect(),d=c.left/o,h=l.left/o,f=c.top/o,v=l.top/o;i.left=d-h+u.scrollLeft,i.top=f-v+u.scrollTop,this.setState({dragging:i});const{x:y,y:T}=(0,fe.calcXY)(this.getPositionParams(),i.top,i.left,this.props.w,this.props.h);return a.call(this,this.props.i,y,T,{e:t,node:r,newPosition:i})}),je(this,"onDrag",(t,n)=>{let{node:r,deltaX:a,deltaY:o}=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+o,l=this.state.dragging.left+a;const{isBounded:c,i:d,w:h,h:f,containerWidth:v}=this.props,y=this.getPositionParams();if(c){const{offsetParent:S}=r;if(S){const{margin:C,rowHeight:g,containerPadding:O}=this.props,M=S.clientHeight-(0,fe.calcGridItemWHPx)(f,g,C[1]);u=(0,fe.clamp)(u-O[1],0,M);const I=(0,fe.calcGridColWidth)(y),j=v-(0,fe.calcGridItemWHPx)(h,I,C[0]);l=(0,fe.clamp)(l-O[0],0,j)}}const T={top:u,left:l};this.setState({dragging:T});const{containerPadding:x}=this.props,{x:w,y:b}=(0,fe.calcXY)(y,u-x[1],l-x[0],h,f);return i.call(this,d,w,b,{e:t,node:r,newPosition:T})}),je(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:a}=this.props;if(!a)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:o,h:i,i:u,containerPadding:l}=this.props,{left:c,top:d}=this.state.dragging,h={top:d,left:c};this.setState({dragging:null});const{x:f,y:v}=(0,fe.calcXY)(this.getPositionParams(),d-l[1],c-l[0],o,i);return a.call(this,u,f,v,{e:t,node:r,newPosition:h})}),je(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),je(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),je(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,fe.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),a=(0,fe.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,dt.fastPositionEqual)(r,a)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const a=t.droppingPosition||{left:0,top:0},{dragging:o}=this.state,i=o&&n.left!==a.left||n.top!==a.top;if(!o)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(i){const u=n.left-o.left,l=n.top-o.top;this.onDrag(n.e,{node:r,deltaX:u,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:a}=this.props;let o;return a?o=(0,dt.setTransform)(t):(o=(0,dt.setTopLeft)(t),n&&(o.left=(0,dt.perc)(t.left/r),o.width=(0,dt.perc)(t.width/r))),o}mixinDraggable(t,n){return ct.default.createElement(zs.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,a)=>n(r,a,t)}mixinResizable(t,n,r){const{cols:a,minW:o,minH:i,maxW:u,maxH:l,transformScale:c,resizeHandles:d,resizeHandle:h}=this.props,f=this.getPositionParams(),v=(0,fe.calcGridItemPosition)(f,0,0,a,0).width,y=(0,fe.calcGridItemPosition)(f,0,0,o,i),T=(0,fe.calcGridItemPosition)(f,0,0,u,l),x=[y.width,y.height],w=[Math.min(T.width,v),Math.min(T.height,1/0)];return ct.default.createElement(As.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:w,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:d,handle:h},t)}onResizeHandler(t,n,r,a){let{node:o,size:i,handle:u}=n;const l=this.props[a];if(!l)return;const{x:c,y:d,i:h,maxH:f,minH:v,containerWidth:y}=this.props,{minW:T,maxW:x}=this.props;let w=i;o&&(w=(0,dt.resizeItemInDirection)(u,r,i,y),this.setState({resizing:a==="onResizeStop"?null:w}));let{w:b,h:S}=(0,fe.calcWH)(this.getPositionParams(),w.width,w.height,c,d,u);b=(0,fe.clamp)(b,Math.max(T,1),x),S=(0,fe.clamp)(S,v,f),l.call(this,h,b,S,{e:t,node:o,size:w,handle:u})}render(){const{x:t,y:n,w:r,h:a,isDraggable:o,isResizable:i,droppingPosition:u,useCSSTransforms:l}=this.props,c=(0,fe.calcGridItemPosition)(this.getPositionParams(),t,n,r,a,this.state),d=ct.default.Children.only(this.props.children);let h=ct.default.cloneElement(d,{ref:this.elementRef,className:(0,ks.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":o,"react-draggable-dragging":!!this.state.dragging,dropping:!!u,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(c)}});return h=this.mixinResizable(h,c,i),h=this.mixinDraggable(h,o),h}}Ht.default=er,je(er,"propTypes",{children:Y.default.element,cols:Y.default.number.isRequired,containerWidth:Y.default.number.isRequired,rowHeight:Y.default.number.isRequired,margin:Y.default.array.isRequired,maxRows:Y.default.number.isRequired,containerPadding:Y.default.array.isRequired,x:Y.default.number.isRequired,y:Y.default.number.isRequired,w:Y.default.number.isRequired,h:Y.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:Y.default.string.isRequired,resizeHandles:Sa.resizeHandleAxesType,resizeHandle:Sa.resizeHandleType,onDragStop:Y.default.func,onDragStart:Y.default.func,onDrag:Y.default.func,onResizeStop:Y.default.func,onResizeStart:Y.default.func,onResize:Y.default.func,isDraggable:Y.default.bool.isRequired,isResizable:Y.default.bool.isRequired,isBounded:Y.default.bool.isRequired,static:Y.default.bool,useCSSTransforms:Y.default.bool.isRequired,transformScale:Y.default.number,className:Y.default.string,handle:Y.default.string,cancel:Y.default.string,droppingPosition:Y.default.shape({e:Y.default.object.isRequired,left:Y.default.number.isRequired,top:Y.default.number.isRequired})}),je(er,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(bt,"__esModule",{value:!0}),bt.default=void 0;var Je=Gs(_),tr=In,$s=nr(We),A=B,Bs=De,ba=nr(Ht),Fs=nr(ke);function nr(e){return e&&e.__esModule?e:{default:e}}function Ta(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Ta=function(r){return r?n:t})(e)}function Gs(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Ta(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function he(e,t,n){return t=qs(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qs(e){var t=Xs(e,"string");return typeof t=="symbol"?t:String(t)}function Xs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Ra="react-grid-layout";let Ca=!1;try{Ca=/firefox/i.test(navigator.userAgent)}catch{}class Kt extends Je.Component{constructor(){super(...arguments),he(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:[]}),he(this,"dragEnterCounter",0),he(this,"onDragStart",(t,n,r,a)=>{let{e:o,node:i}=a;const{layout:u}=this.state,l=(0,A.getLayoutItem)(u,t);if(!l)return;const c={w:l.w,h:l.h,x:l.x,y:l.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,A.cloneLayoutItem)(l),oldLayout:u,activeDrag:c}),this.props.onDragStart(u,l,l,null,o,i)}),he(this,"onDrag",(t,n,r,a)=>{let{e:o,node:i}=a;const{oldDragItem:u}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:d,preventCollision:h}=this.props,f=(0,A.getLayoutItem)(l,t);if(!f)return;const v={w:f.w,h:f.h,x:f.x,y:f.y,placeholder:!0,i:t};l=(0,A.moveElement)(l,f,n,r,!0,h,(0,A.compactType)(this.props),c,d),this.props.onDrag(l,u,f,v,o,i),this.setState({layout:d?l:(0,A.compact)(l,(0,A.compactType)(this.props),c),activeDrag:v})}),he(this,"onDragStop",(t,n,r,a)=>{let{e:o,node:i}=a;if(!this.state.activeDrag)return;const{oldDragItem:u}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:d,allowOverlap:h}=this.props,f=(0,A.getLayoutItem)(l,t);if(!f)return;l=(0,A.moveElement)(l,f,n,r,!0,d,(0,A.compactType)(this.props),c,h);const y=h?l:(0,A.compact)(l,(0,A.compactType)(this.props),c);this.props.onDragStop(y,u,f,null,o,i);const{oldLayout:T}=this.state;this.setState({activeDrag:null,layout:y,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(y,T)}),he(this,"onResizeStart",(t,n,r,a)=>{let{e:o,node:i}=a;const{layout:u}=this.state,l=(0,A.getLayoutItem)(u,t);l&&(this.setState({oldResizeItem:(0,A.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(u,l,l,null,o,i))}),he(this,"onResize",(t,n,r,a)=>{let{e:o,node:i,size:u,handle:l}=a;const{oldResizeItem:c}=this.state,{layout:d}=this.state,{cols:h,preventCollision:f,allowOverlap:v}=this.props;let y=!1,T,x,w;const[b,S]=(0,A.withLayoutItem)(d,t,g=>{let O;return x=g.x,w=g.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=g.x+(g.w-n),n=g.x!==x&&x<0?g.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(w=g.y+(g.h-r),r=g.y!==w&&w<0?g.h:r,w=w<0?0:w),y=!0),f&&!v&&(O=(0,A.getAllCollisions)(d,{...g,w:n,h:r,x,y:w}).filter(I=>I.i!==g.i).length>0,O&&(w=g.y,r=g.h,x=g.x,n=g.w,y=!1)),g.w=n,g.h=r,g});if(!S)return;T=b,y&&(T=(0,A.moveElement)(b,S,x,w,!0,this.props.preventCollision,(0,A.compactType)(this.props),h,v));const C={w:S.w,h:S.h,x:S.x,y:S.y,static:!0,i:t};this.props.onResize(T,c,S,C,o,i),this.setState({layout:v?T:(0,A.compact)(T,(0,A.compactType)(this.props),h),activeDrag:C})}),he(this,"onResizeStop",(t,n,r,a)=>{let{e:o,node:i}=a;const{layout:u,oldResizeItem:l}=this.state,{cols:c,allowOverlap:d}=this.props,h=(0,A.getLayoutItem)(u,t),f=d?u:(0,A.compact)(u,(0,A.compactType)(this.props),c);this.props.onResizeStop(f,l,h,null,o,i);const{oldLayout:v}=this.state;this.setState({activeDrag:null,layout:f,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(f,v)}),he(this,"onDragOver",t=>{var b;if(t.preventDefault(),t.stopPropagation(),Ca&&!((b=t.nativeEvent.target)!=null&&b.classList.contains(Ra)))return!1;const{droppingItem:n,onDropDragOver:r,margin:a,cols:o,rowHeight:i,maxRows:u,width:l,containerPadding:c,transformScale:d}=this.props,h=r==null?void 0:r(t);if(h===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const f={...n,...h},{layout:v}=this.state,y=t.currentTarget.getBoundingClientRect(),T=t.clientX-y.left,x=t.clientY-y.top,w={left:T/d,top:x/d,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:S,top:C}=this.state.droppingPosition;(S!=T||C!=x)&&this.setState({droppingPosition:w})}}else{const S={cols:o,margin:a,maxRows:u,rowHeight:i,containerWidth:l,containerPadding:c||a},C=(0,Bs.calcXY)(S,x,T,f.w,f.h);this.setState({droppingDOMNode:Je.createElement("div",{key:f.i}),droppingPosition:w,layout:[...v,{...f,x:C.x,y:C.y,static:!1,isDraggable:!0}]})}}),he(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,a=(0,A.compact)(r.filter(o=>o.i!==t.i),(0,A.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:a,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),he(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),he(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),he(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,a=r.find(o=>o.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,a,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,tr.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,A.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,A.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,A.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,A.fastRGLPropsEqual)(this.props,t,tr.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,a=n.layout;this.onLayoutMaybeChanged(r,a)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,A.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,tr.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:a,containerPadding:o,rowHeight:i,maxRows:u,useCSSTransforms:l,transformScale:c}=this.props;return Je.createElement(ba.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:n,cols:r,margin:a,containerPadding:o||a,maxRows:u,rowHeight:i,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},Je.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,A.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:a,cols:o,margin:i,containerPadding:u,rowHeight:l,maxRows:c,isDraggable:d,isResizable:h,isBounded:f,useCSSTransforms:v,transformScale:y,draggableCancel:T,draggableHandle:x,resizeHandles:w,resizeHandle:b}=this.props,{mounted:S,droppingPosition:C}=this.state,g=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&d,O=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&h,M=r.resizeHandles||w,I=g&&f&&r.isBounded!==!1;return Je.createElement(ba.default,{containerWidth:a,cols:o,margin:i,containerPadding:u||i,maxRows:c,rowHeight:l,cancel:T,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:g,isResizable:O,isBounded:I,useCSSTransforms:v&&S,usePercentages:!S,transformScale:y,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?C:void 0,resizeHandles:M,resizeHandle:b},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:a}=this.props,o=(0,$s.default)(Ra,t),i={height:this.containerHeight(),...n};return Je.createElement("div",{ref:a,className:o,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},Je.Children.map(this.props.children,u=>this.processGridItem(u)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}bt.default=Kt,he(Kt,"displayName","ReactGridLayout"),he(Kt,"propTypes",Fs.default),he(Kt,"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 Zt={},Qe={};Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.findOrGenerateResponsiveLayout=Zs,Qe.getBreakpointFromWidth=Ys,Qe.getColsFromBreakpoint=Ks,Qe.sortBreakpoints=rr;var Jt=B;function Ys(e,t){const n=rr(e);let r=n[0];for(let a=1,o=n.length;a<o;a++){const i=n[a];t>e[i]&&(r=i)}return r}function Ks(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function Zs(e,t,n,r,a,o){if(e[n])return(0,Jt.cloneLayout)(e[n]);let i=e[r];const u=rr(t),l=u.slice(u.indexOf(n));for(let c=0,d=l.length;c<d;c++){const h=l[c];if(e[h]){i=e[h];break}}return i=(0,Jt.cloneLayout)(i||[]),(0,Jt.compact)((0,Jt.correctBounds)(i,{cols:a}),o,a)}function rr(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.default=void 0;var wa=Qs(_),Se=_a($e),ar=In,ft=B,et=Qe,Js=_a(bt);function _a(e){return e&&e.__esModule?e:{default:e}}function Ia(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Ia=function(r){return r?n:t})(e)}function Qs(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Ia(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function or(){return or=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},or.apply(this,arguments)}function Qt(e,t,n){return t=el(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function el(e){var t=tl(e,"string");return typeof t=="symbol"?t:String(t)}function tl(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const xa=e=>Object.prototype.toString.call(e);function en(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class ir extends wa.Component{constructor(){super(...arguments),Qt(this,"state",this.generateInitialState()),Qt(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:a}=this.props,o=(0,et.getBreakpointFromWidth)(n,t),i=(0,et.getColsFromBreakpoint)(o,a),u=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,et.findOrGenerateResponsiveLayout)(r,n,o,o,i,u),breakpoint:o,cols:i}}static getDerivedStateFromProps(t,n){if(!(0,ar.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:a}=n;return{layout:(0,et.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,a,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,ar.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,ar.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:a,compactType:o}=this.props,i=this.props.breakpoint||(0,et.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),u=this.state.breakpoint,l=(0,et.getColsFromBreakpoint)(i,r),c={...a};if(u!==i||t.breakpoints!==n||t.cols!==r){u in c||(c[u]=(0,ft.cloneLayout)(this.state.layout));let f=(0,et.findOrGenerateResponsiveLayout)(c,n,i,u,l,o);f=(0,ft.synchronizeLayoutWithChildren)(f,this.props.children,l,o,this.props.allowOverlap),c[i]=f,this.props.onLayoutChange(f,c),this.props.onBreakpointChange(i,l),this.setState({breakpoint:i,layout:f,cols:l})}const d=en(this.props.margin,i),h=en(this.props.containerPadding,i);this.props.onWidthChange(this.props.width,d,l,h)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:a,margin:o,containerPadding:i,onBreakpointChange:u,onLayoutChange:l,onWidthChange:c,...d}=this.props;return wa.createElement(Js.default,or({},d,{margin:en(o,this.state.breakpoint),containerPadding:en(i,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Zt.default=ir,Qt(ir,"propTypes",{breakpoint:Se.default.string,breakpoints:Se.default.object,allowOverlap:Se.default.bool,cols:Se.default.object,margin:Se.default.oneOfType([Se.default.array,Se.default.object]),containerPadding:Se.default.oneOfType([Se.default.array,Se.default.object]),layouts(e,t){if(xa(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+xa(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,ft.validateLayout)(e.layouts[n],"layouts."+n)})},width:Se.default.number.isRequired,onBreakpointChange:Se.default.func,onLayoutChange:Se.default.func,onWidthChange:Se.default.func}),Qt(ir,"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:ft.noop,onLayoutChange:ft.noop,onWidthChange:ft.noop});var sr={},Oa=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(a,o){return a[0]===n?(r=o,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),a=this.__entries__[r];return a&&a[1]},t.prototype.set=function(n,r){var a=e(this.__entries__,n);~a?this.__entries__[a][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,a=e(r,n);~a&&r.splice(a,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var a=0,o=this.__entries__;a<o.length;a++){var i=o[a];n.call(r,i[1],i[0])}},t}()}(),lr=typeof window<"u"&&typeof document<"u"&&window.document===document,tn=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")()}(),nl=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(tn):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),rl=2;function al(e,t){var n=!1,r=!1,a=0;function o(){n&&(n=!1,e()),r&&u()}function i(){nl(o)}function u(){var l=Date.now();if(n){if(l-a<rl)return;r=!0}else n=!0,r=!1,setTimeout(i,t);a=l}return u}var ol=20,il=["top","right","bottom","left","width","height","size","weight"],sl=typeof MutationObserver<"u",ll=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=al(this.refresh.bind(this),ol)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!lr||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),sl?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!lr||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,a=il.some(function(o){return!!~r.indexOf(o)});a&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Ea=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var a=r[n];Object.defineProperty(e,a,{value:t[a],enumerable:!1,writable:!1,configurable:!0})}return e},pt=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||tn},Ma=rn(0,0,0,0);function nn(e){return parseFloat(e)||0}function Da(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,a){var o=e["border-"+a+"-width"];return r+nn(o)},0)}function ul(e){for(var t=["top","right","bottom","left"],n={},r=0,a=t;r<a.length;r++){var o=a[r],i=e["padding-"+o];n[o]=nn(i)}return n}function cl(e){var t=e.getBBox();return rn(0,0,t.width,t.height)}function dl(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Ma;var r=pt(e).getComputedStyle(e),a=ul(r),o=a.left+a.right,i=a.top+a.bottom,u=nn(r.width),l=nn(r.height);if(r.boxSizing==="border-box"&&(Math.round(u+o)!==t&&(u-=Da(r,"left","right")+o),Math.round(l+i)!==n&&(l-=Da(r,"top","bottom")+i)),!pl(e)){var c=Math.round(u+o)-t,d=Math.round(l+i)-n;Math.abs(c)!==1&&(u-=c),Math.abs(d)!==1&&(l-=d)}return rn(a.left,a.top,u,l)}var fl=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof pt(e).SVGGraphicsElement}:function(e){return e instanceof pt(e).SVGElement&&typeof e.getBBox=="function"}}();function pl(e){return e===pt(e).document.documentElement}function hl(e){return lr?fl(e)?cl(e):dl(e):Ma}function ml(e){var t=e.x,n=e.y,r=e.width,a=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,i=Object.create(o.prototype);return Ea(i,{x:t,y:n,width:r,height:a,top:n,right:t+r,bottom:a+n,left:t}),i}function rn(e,t,n,r){return{x:e,y:t,width:n,height:r}}var gl=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=rn(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=hl(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),vl=function(){function e(t,n){var r=ml(n);Ea(this,{target:t,contentRect:r})}return e}(),yl=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new Oa,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof pt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new gl(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof pt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new vl(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Pa=typeof WeakMap<"u"?new WeakMap:new Oa,Na=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=ll.getInstance(),r=new yl(t,n,this);Pa.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Na.prototype[e]=function(){var t;return(t=Pa.get(this))[e].apply(t,arguments)}});var Sl=function(){return typeof tn.ResizeObserver<"u"?tn.ResizeObserver:Na}();const bl=Yo(Object.freeze(Object.defineProperty({__proto__:null,default:Sl},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(sr,"__esModule",{value:!0}),sr.default=Ol;var an=wl(_),Tl=ur($e),Rl=ur(bl),Cl=ur(We);function ur(e){return e&&e.__esModule?e:{default:e}}function ja(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ja=function(r){return r?n:t})(e)}function wl(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ja(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function cr(){return cr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cr.apply(this,arguments)}function ht(e,t,n){return t=_l(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _l(e){var t=Il(e,"string");return typeof t=="symbol"?t:String(t)}function Il(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const xl="react-grid-layout";function Ol(e){var t;return t=class extends an.Component{constructor(){super(...arguments),ht(this,"state",{width:1280}),ht(this,"elementRef",an.createRef()),ht(this,"mounted",!1),ht(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new Rl.default(a=>{if(this.elementRef.current instanceof HTMLElement){const i=a[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,...a}=this.props;return r&&!this.mounted?an.createElement("div",{className:(0,Cl.default)(this.props.className,xl),style:this.props.style,ref:this.elementRef}):an.createElement(e,cr({innerRef:this.elementRef},a,this.state))}},ht(t,"defaultProps",{measureBeforeMount:!1}),ht(t,"propTypes",{measureBeforeMount:Tl.default.bool}),t}(function(e){e.exports=bt.default,e.exports.utils=B,e.exports.calculateUtils=De,e.exports.Responsive=Zt.default,e.exports.Responsive.utils=Qe,e.exports.WidthProvider=sr.default})(Ur);var El=Ur.exports;const Ml=wn(El),dr={type:m.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(e,t){if(!t)return!1;const n=e.get(m.IUndoRedoService),r=e.get(m.ICommandService),a=e.get(m.IUniverInstanceService),o=H.getSheetCommandTarget(a,t);if(!o)return!1;const{unitId:i,subUnitId:u}=o,l={unitId:i,subUnitId:u,cfId:t.cfId},c=s.DeleteConditionalRuleMutationUndoFactory(e,l),d=r.syncExecuteCommand(s.DeleteConditionalRuleMutation.id,l);return d&&n.pushUndoRedo({unitID:i,undoMutations:c,redoMutations:[{id:s.DeleteConditionalRuleMutation.id,params:l}]}),d}},La={type:m.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(e,t){if(!t)return!1;const n=e.get(m.IUndoRedoService),r=e.get(m.ICommandService),a=e.get(m.IUniverInstanceService),o=e.get(s.ConditionalFormattingRuleModel),i=H.getSheetCommandTarget(a,t);if(!i)return!1;const{unitId:u,subUnitId:l}=i,c=s.transformSupportSymmetryAnchor(t.start,t.end,o.getSubunitRules(u,l)||[],T=>T.cfId);if(!c)return!1;const[d,h]=c,f={unitId:u,subUnitId:l,start:d,end:h},v=s.MoveConditionalRuleMutationUndoFactory(f),y=r.syncExecuteCommand(s.MoveConditionalRuleMutation.id,f);return y&&n.pushUndoRedo({unitID:u,redoMutations:[{id:s.MoveConditionalRuleMutation.id,params:f}],undoMutations:v}),y}},on={cfPreview:"univer-cf-preview"},mt=e=>{var a,o;const t=e.rule;if(!t)return null;const n=_.useMemo(()=>{if(t.type===s.CFRuleType.colorScale){const i=t.config.map((c,d)=>({color:new m.ColorKit(c.color),value:d})),u=i.length-1;return new Array(5).fill("").map((c,d,h)=>d*u/(h.length-1)).map(c=>s.getColorScaleFromValue(i,c))}return null},[t]),r=_.useMemo(()=>{if(t.type===s.CFRuleType.iconSet)return t.config.map(i=>{const u=s.iconMap[i.iconType];return u&&u[Number(i.iconId)]})},[t]);switch(t.type){case s.CFRuleType.dataBar:{const{isGradient:i}=t.config,u={width:"50%",height:"100%"},l=i?`linear-gradient(to right, ${t.config.positiveColor}, rgb(255 255 255))`:t.config.positiveColor,c=i?`linear-gradient(to right, rgb(255 255 255),${t.config.nativeColor})`:t.config.nativeColor;return p.jsxs("div",{className:on.cfPreview,children:[p.jsx("div",{style:{...u,background:c,border:`1px solid ${t.config.nativeColor}`}}),p.jsx("div",{style:{...u,background:l,border:`1px solid ${t.config.positiveColor}`}})]})}case s.CFRuleType.colorScale:return n&&p.jsx("div",{className:on.cfPreview,children:n.map((i,u)=>p.jsx("div",{style:{width:`${100/n.length}%`,height:"100%",background:i}},u))});case s.CFRuleType.iconSet:return r&&p.jsx("div",{className:on.cfPreview,children:r.map((i,u)=>i?p.jsx("img",{style:{height:"100%"},src:i},u):p.jsx(Ut,{},u))});case s.CFRuleType.highlightCell:{const{ul:i,st:u,it:l,bl:c,bg:d,cl:h}=t.style,f=(i==null?void 0:i.s)===m.BooleanNumber.TRUE,v=(u==null?void 0:u.s)===m.BooleanNumber.TRUE,y=l===m.BooleanNumber.TRUE,T=c===m.BooleanNumber.TRUE,x=(a=d==null?void 0:d.rgb)!=null?a:s.DEFAULT_BG_COLOR,w=(o=h==null?void 0:h.rgb)!=null?o:s.DEFAULT_FONT_COLOR,b={fontWeight:T?"bold":void 0,fontStyle:y?"italic":void 0,textDecoration:`${f?"underline":""} ${v?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:x,color:w};return p.jsx("div",{style:b,className:on.cfPreview,children:"123"})}}return null},Dl={sheet:{cf:{title:"Conditional Formatting",menu:{manageConditionalFormatting:"Manage Conditional Formatting",createConditionalFormatting:"Create Conditional Formatting",clearRangeRules:"Clear Rules for Selected Range",clearWorkSheetRules:"Clear Rules for Entire Sheet"},form:{lessThan:"The value must be less than {0}",lessThanOrEqual:"The value must be less than or equal to {0}",greaterThan:"The value must be greater than {0}",greaterThanOrEqual:"The value must be greater than or equal to {0}",rangeSelector:"Select Range or Enter Value"},iconSet:{direction:"Direction",shape:"Shape",mark:"Mark",rank:"Rank",rule:"Rule",icon:"Icon",type:"Type",value:"Value",reverseIconOrder:"Reverse Icon Order",and:"And",when:"When",onlyShowIcon:"Only Show Icon"},symbol:{greaterThan:">",greaterThanOrEqual:">=",lessThan:"<",lessThanOrEqual:"<="},panel:{createRule:"Create Rule",clear:"Clear All Rules",range:"Apply Range",styleType:"Style Type",submit:"Submit",cancel:"Cancel",rankAndAverage:"Top/Bottom/Average",styleRule:"Style Rule",isNotBottom:"Top",isBottom:"Bottom",greaterThanAverage:"Greater Than Average",lessThanAverage:"Less Than Average",medianValue:"Median Value",fillType:"Fill Type",pureColor:"Solid Color",gradient:"Gradient",colorSet:"Color Set",positive:"Positive",native:"Negative",workSheet:"Entire Sheet",selectedRange:"Selected Range",managerRuleSelect:"Manage {0} Rules",onlyShowDataBar:"Only Show Data Bars"},preview:{describe:{beginsWith:"Begins with {0}",endsWith:"Ends with {0}",containsText:"Text contains {0}",notContainsText:"Text does not contain {0}",equal:"Equal to {0}",notEqual:"Not equal to {0}",containsBlanks:"Contains Blanks",notContainsBlanks:"Does not contain Blanks",containsErrors:"Contains Errors",notContainsErrors:"Does not contain Errors",greaterThan:"Greater than {0}",greaterThanOrEqual:"Greater than or equal to {0}",lessThan:"Less than {0}",lessThanOrEqual:"Less than or equal to {0}",notBetween:"Not between {0} and {1}",between:"Between {0} and {1}",yesterday:"Yesterday",tomorrow:"Tomorrow",last7Days:"Last 7 Days",thisMonth:"This Month",lastMonth:"Last Month",nextMonth:"Next Month",thisWeek:"This Week",lastWeek:"Last Week",nextWeek:"Next Week",today:"Today",topN:"Top {0}",bottomN:"Bottom {0}",topNPercent:"Top {0}%",bottomNPercent:"Bottom {0}%"}},operator:{beginsWith:"Begins with",endsWith:"Ends with",containsText:"Text contains",notContainsText:"Text does not contain",equal:"Equal to",notEqual:"Not equal to",containsBlanks:"Contains Blanks",notContainsBlanks:"Does not contain Blanks",containsErrors:"Contains Errors",notContainsErrors:"Does not contain Errors",greaterThan:"Greater than",greaterThanOrEqual:"Greater than or equal to",lessThan:"Less than",lessThanOrEqual:"Less than or equal to",notBetween:"Not between",between:"Between",yesterday:"Yesterday",tomorrow:"Tomorrow",last7Days:"Last 7 Days",thisMonth:"This Month",lastMonth:"Last Month",nextMonth:"Next Month",thisWeek:"This Week",lastWeek:"Last Week",nextWeek:"Next Week",today:"Today"},ruleType:{highlightCell:"Highlight Cell",dataBar:"Data Bar",colorScale:"Color Scale",formula:"Custom Formula",iconSet:"Icon Set",duplicateValues:"Duplicate Values",uniqueValues:"Unique Values"},subRuleType:{uniqueValues:"Unique Values",duplicateValues:"Duplicate Values",rank:"Rank",text:"Text",timePeriod:"Time Period",number:"Number",average:"Average"},valueType:{num:"Number",min:"Minimum",max:"Maximum",percent:"Percentage",percentile:"Percentile",formula:"Formula",none:"None"}}}},Va={sheet:{cf:{title:"条件格式",menu:{manageConditionalFormatting:"管理条件格式",createConditionalFormatting:"新建条件格式",clearRangeRules:"清除所选区域的规则",clearWorkSheetRules:"清除整个工作表的规则"},form:{lessThan:"该值必须小于 {0}",lessThanOrEqual:"该值必须小于等于 {0}",greaterThan:"该值必大于 {0}",greaterThanOrEqual:"该值必大于等于 {0}",rangeSelector:"选择范围或者输入值"},iconSet:{direction:"方向",shape:"形状",mark:"标记",rank:"等级",rule:"规则",icon:"图标",type:"类型",value:"值",reverseIconOrder:"反转图标次序",and:"且",when:"当值",onlyShowIcon:"仅显示图标"},symbol:{greaterThan:">",greaterThanOrEqual:">=",lessThan:"<",lessThanOrEqual:"<="},panel:{createRule:"新增规则",clear:"清空所有规则",range:"应用范围",styleType:"样式类型",submit:"确认",cancel:"取消",rankAndAverage:"最前/最后/平均值",styleRule:"样式规则",isNotBottom:"最前",isBottom:"最后",greaterThanAverage:"大于平均值",lessThanAverage:"小于平均值",medianValue:"中间值",fillType:"填充方式",pureColor:"纯色",gradient:"渐变",colorSet:"颜色设置",positive:"正值",native:"负值",workSheet:"整张工作表",selectedRange:"所选单元格",managerRuleSelect:"管理 {0} 的规则",onlyShowDataBar:"仅显示数据条"},preview:{describe:{beginsWith:"开头为{0}",endsWith:"结尾为{0}",containsText:"文本包含{0}",notContainsText:"文本不包含{0}",equal:"等于{0}",notEqual:"不等于{0}",containsBlanks:"为空",notContainsBlanks:"不为空",containsErrors:"错误",notContainsErrors:"非错误",greaterThan:"大于{0}",greaterThanOrEqual:"大于等于{0}",lessThan:"小于{0}",lessThanOrEqual:"小于等于{0}",notBetween:"不介于{0}和{1}之间",between:"介于{0}和{1}之间",yesterday:"昨日",tomorrow:"明日",last7Days:"最近7天",thisMonth:"本月",lastMonth:"上个月",nextMonth:"下个月",thisWeek:"本周",lastWeek:"上周",nextWeek:"下周",today:"今日",topN:"前{0}项",bottomN:"后{0}项",topNPercent:"前{0}%",bottomNPercent:"后{0}%"}},operator:{beginsWith:"开头为",endsWith:"结尾为",containsText:"文本包含",notContainsText:"文本不包含",equal:"等于",notEqual:"不等于",containsBlanks:"为空",notContainsBlanks:"不为空",containsErrors:"错误",notContainsErrors:"非错误",greaterThan:"大于",greaterThanOrEqual:"大于等于",lessThan:"小于",lessThanOrEqual:"小于等于",notBetween:"不介于",between:"介于",yesterday:"昨日",tomorrow:"明日",last7Days:"最近 7 天",thisMonth:"本月",lastMonth:"上个月",nextMonth:"下个月",thisWeek:"本周",lastWeek:"上周",nextWeek:"下周",today:"今日"},ruleType:{highlightCell:"突出显示单元格",dataBar:"数据条",colorScale:"色阶",formula:"自定义公式",iconSet:"图标集",duplicateValues:"重复值",uniqueValues:"唯一值"},subRuleType:{uniqueValues:"唯一值",duplicateValues:"重复值",rank:"最前最后",text:"文本",timePeriod:"时间日期",number:"数值",average:"平均值"},valueType:{num:"数值",min:"最小值",max:"最大值",percent:"百分比",percentile:"百分点",formula:"公式",none:"无"}}}},Pl={sheet:{cf:{title:"Условное форматирование",menu:{manageConditionalFormatting:"Управление условным форматированием",createConditionalFormatting:"Создание условного форматирования",clearRangeRules:"Очистить правила для выбранного диапазона",clearWorkSheetRules:"Очистить правила для всего листа"},form:{lessThan:"Значение должно быть меньше {0}",lessThanOrEqual:"Значение должно быть меньше или равно {0}",greaterThan:"Значение должно быть больше {0}",greaterThanOrEqual:"Значение должно быть больше или равно {0}",rangeSelector:"Выберите диапазон или введите значение"},iconSet:{direction:"Направление",shape:"Форма",mark:"Знак",rank:"Ранг",rule:"Правило",icon:"Иконка",type:"Тип",value:"Значение",reverseIconOrder:"Обратный порядок иконок",and:"И",when:"Когда",onlyShowIcon:"Показывать только иконку"},symbol:{greaterThan:">",greaterThanOrEqual:">=",lessThan:"<",lessThanOrEqual:"<="},panel:{createRule:"Создать правило",clear:"Очистить все правила",range:"Применить диапазон",styleType:"Тип стиля",submit:"Подтвердить",cancel:"Отменить",rankAndAverage:"Верх/Низ/Среднее",styleRule:"Правило стиля",isNotBottom:"Верх",isBottom:"Низ",greaterThanAverage:"Больше среднего",lessThanAverage:"Меньше среднего",medianValue:"Медианное значение",fillType:"Тип заполнения",pureColor:"Сплошной цвет",gradient:"Градиент",colorSet:"Набор цветов",positive:"Положительный",native:"Отрицательный",workSheet:"Весь лист",selectedRange:"Выбранный диапазон",managerRuleSelect:"Управление правилами {0}",onlyShowDataBar:"Показывать только гистограммы данных"},preview:{describe:{beginsWith:"Начинается с {0}",endsWith:"Заканчивается на {0}",containsText:"Содержит текст {0}",notContainsText:"Не содержит текст {0}",equal:"Равно {0}",notEqual:"Не равно {0}",containsBlanks:"Содержит пустые ячейки",notContainsBlanks:"Не содержит пустых ячеек",containsErrors:"Содержит ошибки",notContainsErrors:"Не содержит ошибок",greaterThan:"Больше чем {0}",greaterThanOrEqual:"Больше или равно {0}",lessThan:"Меньше чем {0}",lessThanOrEqual:"Меньше или равно {0}",notBetween:"Не между {0} и {1}",between:"Между {0} и {1}",yesterday:"Вчера",tomorrow:"Завтра",last7Days:"Последние 7 дней",thisMonth:"Этот месяц",lastMonth:"Прошлый месяц",nextMonth:"Следующий месяц",thisWeek:"Эта неделя",lastWeek:"Прошлая неделя",nextWeek:"Следующая неделя",today:"Сегодня",topN:"Топ {0}",bottomN:"Низ {0}",topNPercent:"Топ {0}%",bottomNPercent:"Низ {0}%"}},operator:{beginsWith:"Начинается с",endsWith:"Заканчивается на",containsText:"Содержит текст",notContainsText:"Не содержит текст",equal:"Равно",notEqual:"Не равно",containsBlanks:"Содержит пустые ячейки",notContainsBlanks:"Не содержит пустых ячеек",containsErrors:"Содержит ошибки",notContainsErrors:"Не содержит ошибок",greaterThan:"Больше чем",greaterThanOrEqual:"Больше или равно",lessThan:"Меньше чем",lessThanOrEqual:"Меньше или равно",notBetween:"Не между",between:"Между",yesterday:"Вчера",tomorrow:"Завтра",last7Days:"Последние 7 дней",thisMonth:"Этот месяц",lastMonth:"Прошлый месяц",nextMonth:"Следующий месяц",thisWeek:"Эта неделя",lastWeek:"Прошлая неделя",nextWeek:"Следующая неделя",today:"Сегодня"},ruleType:{highlightCell:"Выделение ячеек",dataBar:"Гистограмма данных",colorScale:"Цветовая шкала",formula:"Пользовательская формула",iconSet:"Набор иконок",duplicateValues:"Дублирующиеся значения",uniqueValues:"Уникальные значения"},subRuleType:{uniqueValues:"Уникальные значения",duplicateValues:"Дублирующиеся значения",rank:"Ранг",text:"Текст",timePeriod:"Период времени",number:"Число",average:"Среднее"},valueType:{num:"Число",min:"Минимум",max:"Максимум",percent:"Процент",percentile:"Процентиль",formula:"Формула",none:"Нет"}}}};var Nl=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,Ll=(e,t,n,r)=>{for(var a=r>1?void 0:r?jl(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Nl(t,n,a),a},Vl=(e,t)=>(n,r)=>t(n,r,e);let xt=class extends m.Disposable{constructor(t){super();Ge(this,"_initLocal",()=>{this._localeService.load({zhCN:Va})});Ge(this,"_findReplaceIndex",t=>{const n=/\{([^}]+)?\}/g,r=[];let a=n.exec(t);for(;a;)r.push({startIndex:a.index,key:Number(a[1]),endIndex:a.index+a[0].length-1}),a=n.exec(t);return r});this._localeService=t,this._initLocal()}tWithReactNode(t,...n){const r=this._localeService.getLocales(),a=t.split("."),o=r&&this._localeService.resolveKeyPath(r,a);if(typeof o=="string"){const i=[];return this._findReplaceIndex(o).forEach((u,l,c)=>{const d=c[l-1]||{startIndex:0,endIndex:-1};if(d.endIndex+1<u.startIndex){const h=o.slice(d.endIndex+1,u.startIndex);h&&i.push(h)}if(n[u.key]&&i.push(n[u.key]),l===c.length-1){const h=o.slice(u.endIndex+1);h&&i.push(h)}}),i}return[]}};xt=Ll([m.OnLifecycle(m.LifecycleStages.Rendered,xt),Vl(0,V.Inject(m.LocaleService))],xt);const Ul=(e=[])=>{const t=te.useDependency(le.IMarkSelectionService);_.useEffect(()=>{const n=e.map(r=>t.addShape({range:r,style:{hasAutoFill:!1,fill:"rgba(73, 184, 17, 0.05)",strokeWidth:1,stroke:"#49B811",widgets:{}},primary:{startColumn:r.startColumn,endColumn:r.endColumn,startRow:r.startRow,endRow:r.endRow,actualRow:r.startRow,actualColumn:r.startColumn,isMerged:!1,isMergedMainCell:!1}}));return()=>{n.forEach(r=>{r&&t.removeShape(r)})}},[e])},ue={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"},zl=(e,t)=>{const n=e.rule;switch(n.type){case s.CFRuleType.colorScale:return t.t("sheet.cf.ruleType.colorScale");case s.CFRuleType.dataBar:return t.t("sheet.cf.ruleType.dataBar");case s.CFRuleType.iconSet:return t.t("sheet.cf.ruleType.iconSet");case s.CFRuleType.highlightCell:switch(n.subType){case s.CFSubRuleType.average:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,t.t("sheet.cf.subRuleType.average"))}case s.CFSubRuleType.duplicateValues:return t.t("sheet.cf.subRuleType.duplicateValues");case s.CFSubRuleType.uniqueValues:return t.t("sheet.cf.subRuleType.uniqueValues");case s.CFSubRuleType.number:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,...Array.isArray(n.value)?n.value.map(a=>String(a)):[String(n.value||"")])}case s.CFSubRuleType.text:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,n.value||"")}case s.CFSubRuleType.timePeriod:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`)}case s.CFSubRuleType.rank:return n.isPercent?n.isBottom?t.t("sheet.cf.preview.describe.bottomNPercent",String(n.value)):t.t("sheet.cf.preview.describe.topNPercent",String(n.value)):n.isBottom?t.t("sheet.cf.preview.describe.bottomN",String(n.value)):t.t("sheet.cf.preview.describe.topN",String(n.value));case s.CFSubRuleType.formula:return t.t("sheet.cf.ruleType.formula")}}};let Ua=0;const Al=e=>{const{onClick:t}=e,n=te.useDependency(s.ConditionalFormattingRuleModel),r=te.useDependency(m.IUniverInstanceService),a=te.useDependency(H.SelectionManagerService),o=te.useDependency(m.ICommandService),i=te.useDependency(m.LocaleService),u=te.useDependency(xt),l=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),c=l.getUnitId(),h=l.getActiveSheet().getSheetId(),[f,v]=_.useState([]),[y,T]=_.useState("2"),[x,w]=_.useState(0),[b,S]=_.useState(-1),[C,g]=_.useState(Ua),O=_.useRef(null),M=[{label:i.t("sheet.cf.panel.workSheet"),value:"2"},{label:i.t("sheet.cf.panel.selectedRange"),value:"1"}],I=()=>{const z=n.getSubunitRules(c,h);if(!z||!z.length)return[];if(y==="1"){const q=a.getLast();if(!q)return[];const ne=q.range;return z.filter(me=>me.ranges.some(Te=>m.Rectangle.intersects(Te,ne)))}else if(y==="2")return z;return[]},[j,L]=_.useState(I);Ul(f),_.useEffect(()=>{const z=o.onCommandExecuted(q=>{q.id===H.SetWorksheetActiveOperation.id&&w(Math.random())});return()=>z.dispose()}),_.useEffect(()=>{L(I)},[y,x,c,h]),_.useEffect(()=>{if(y==="2")return;const z=new Ce.Observable(q=>{const ne=[H.SetSelectionsOperation.id,s.AddConditionalRuleMutation.id,s.SetConditionalRuleMutation.id,s.DeleteConditionalRuleMutation.id,s.MoveConditionalRuleMutation.id],ce=o.onCommandExecuted(me=>{const{id:Te,params:Re}=me,Le=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId();ne.includes(Te)&&Re.unitId===Le&&q.next(null)});return()=>ce.dispose()}).pipe(Ce.debounceTime(16)).subscribe(()=>{L(I)});return()=>{z.unsubscribe()}},[r,y,c,h]),_.useEffect(()=>{const z=n.$ruleChange.subscribe(()=>{w(Math.random())});return()=>z.unsubscribe()},[n]),_.useEffect(()=>{const z=()=>{var me;const ce=Math.max(0,(((me=O.current)==null?void 0:me.getBoundingClientRect().width)||0)-8);return Ua=ce,ce},ne=new Ce.Observable(ce=>{const me=document.querySelector(".univer-sidebar");if(me){let Te=setTimeout(()=>{ce.next()},150);const Re=()=>{Te&&clearTimeout(Te),Te=null},Le=lt=>{lt.propertyName==="width"&&(Re(),ce.next())};return me.addEventListener("transitionend",Le),()=>{Re(),me.removeEventListener("transitionend",Le)}}}).pipe(Ce.debounceTime(16)).subscribe(()=>{g(z())});return()=>{ne.unsubscribe()}},[]);const U=z=>{const q=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),ne=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId();o.executeCommand(dr.id,{unitId:q,subUnitId:ne,cfId:z.cfId})},F=(z,q)=>{S(q.y)},R=(z,q,ne)=>{S(-1);const ce=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),me=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),Te=lt=>{const Vt=j.length;return Math.min(Vt-1,Math.max(0,lt))},Re=j[Te(q.y)].cfId,Le=j[Te(ne.y)].cfId;Re!==Le&&o.executeCommand(La.id,{unitId:ce,subUnitId:me,start:{id:Re,type:"self"},end:{id:Le,type:ne.y>q.y?"after":"before"}})},E=()=>{e.onCreate()},J=()=>{y==="2"?o.executeCommand(Tn.id):y==="1"&&j.map(q=>({unitId:c,subUnitId:h,cfId:q.cfId})).forEach(q=>{o.executeCommand(dr.id,q)})},be=j.map((z,q)=>({i:z.cfId,x:0,w:12,y:q,h:1,isResizable:!1}));return p.jsxs("div",{className:ue.cfRuleList,children:[p.jsxs("div",{className:ue.ruleSelector,children:[p.jsx("div",{children:u.tWithReactNode("sheet.cf.panel.managerRuleSelect",p.jsx(G.Select,{className:ue.select,options:M,value:y,onChange:z=>{T(z)}})).map((z,q)=>p.jsx("span",{children:z},q))}),p.jsxs("div",{className:ue.btnList,children:[p.jsx(G.Tooltip,{title:i.t("sheet.cf.panel.createRule"),placement:"bottom",children:p.jsx("div",{className:`${ue.icon}`,onClick:E,children:p.jsx(Wo,{})})}),j.length?p.jsx(G.Tooltip,{title:i.t("sheet.cf.panel.clear"),placement:"bottom",children:p.jsx("div",{className:`${ue.gap} ${ue.icon}`,onClick:J,children:p.jsx(Rn,{})})}):p.jsx("div",{className:`${ue.gap} ${ue.disabled}`,children:p.jsx(Rn,{})})]})]}),p.jsx("div",{ref:O,className:ue.gridLayoutWrap,children:C?p.jsx(Ml,{onDragStop:R,onDragStart:F,layout:be,cols:12,rowHeight:60,width:C,margin:[0,10],draggableHandle:".draggableHandle",children:j.map((z,q)=>p.jsx("div",{children:p.jsxs("div",{onMouseMove:()=>{z.ranges!==f&&v(z.ranges)},onMouseLeave:()=>v([]),onClick:()=>t(z),className:`${ue.ruleItem} ${b===q?ue.active:""}`,children:[p.jsx("div",{className:`${ue.draggableHandle} draggableHandle`,onClick:ne=>ne.stopPropagation(),children:p.jsx(Fo,{})}),p.jsxs("div",{className:ue.ruleDescribe,children:[p.jsx("div",{className:ue.ruleType,children:zl(z,i)}),p.jsx("div",{className:ue.ruleRange,children:z.ranges.map(ne=>wr.serializeRange(ne)).join(",")})]}),p.jsx("div",{className:ue.preview,children:p.jsx(mt,{rule:z.rule})}),p.jsx("div",{className:`${ue.deleteItem} ${b===q?ue.active:""}`,onClick:ne=>{ne.stopPropagation(),U(z)},children:p.jsx(Rn,{})})]})},`${z.cfId}`))}):null})]})},za={type:m.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(e,t){if(!t)return!1;const{rule:n}=t,r=e.get(m.IUndoRedoService),a=e.get(m.ICommandService),o=e.get(s.ConditionalFormattingRuleModel),i=e.get(m.IUniverInstanceService),u=H.getSheetCommandTarget(i);if(!u)return!1;const{unitId:l,subUnitId:c}=u,d=o.createCfId(l,c),h={unitId:l,subUnitId:c,rule:{...n,cfId:n.cfId||d}},f=s.AddConditionalRuleMutationUndoFactory(e,h),v=a.syncExecuteCommand(s.AddConditionalRuleMutation.id,h);return v&&r.pushUndoRedo({unitID:l,redoMutations:[{id:s.AddConditionalRuleMutation.id,params:h}],undoMutations:[f]}),v}},Aa={type:m.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(e,t){if(!t)return!1;const n=e.get(m.IUndoRedoService),r=e.get(m.ICommandService),a=e.get(m.IUniverInstanceService),o=H.getSheetCommandTarget(a,t);if(!o)return!1;const{unitId:i,subUnitId:u}=o,l={unitId:i,subUnitId:u,rule:t.rule},c=s.setConditionalRuleMutationUndoFactory(e,l),d=r.syncExecuteCommand(s.SetConditionalRuleMutation.id,l);return d&&n.pushUndoRedo({unitID:i,undoMutations:c,redoMutations:[{id:s.SetConditionalRuleMutation.id,params:l}]}),d}},kl=m.createInterceptorKey("beforeSubmit"),Hl=m.createInterceptorKey("submit"),fr={cfColorPicker:"univer-cf-color-picker",cfColorPickerIcon:"univer-cf-color-picker-icon",iconDropdown:"univer-icon-dropdown"},tt=e=>{const{color:t,onChange:n,disable:r=!1,iconId:a="PaintBucket",className:o,isNeedDropdownIcon:i=!0}=e,u=te.useDependency(ve.ComponentManager),l=_.useMemo(()=>new m.ColorKit(t),[t]),c=u.get(a);return c&&(r?p.jsx(c,{className:o,extend:{colorChannel1:l.isValid?t:"rgb(var(--primary-color))"}}):p.jsx(G.Dropdown,{overlay:p.jsx("div",{className:`${fr.cfColorPicker} `,children:p.jsx(G.ColorPicker,{color:t,onChange:n})}),children:p.jsxs("span",{className:`${fr.cfColorPickerIcon} ${o}`,children:[p.jsx(c,{extend:{colorChannel1:l.isValid?t:"rgb(var(--primary-color))"}}),i&&p.jsx(Cn,{className:fr.iconDropdown})]})}))},P={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"},nt=(e,t)=>({label:t.t(`sheet.cf.valueType.${e}`),value:e}),pr=e=>{const{type:t,className:n,onChange:r,id:a,value:o}=e,i=te.useDependency(m.IUniverInstanceService),u=i.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),l=i.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),c=_.useMemo(()=>String(o).startsWith("=")?String(o):"=",[o]),d=_.useMemo(()=>[s.CFValueType.max,s.CFValueType.min,"none"].includes(t)?{disabled:!0}:[s.CFValueType.percent,s.CFValueType.percentile].includes(t)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[t]);return t===s.CFValueType.formula?p.jsx(ve.TextEditor,{openForSheetSubUnitId:l,openForSheetUnitId:u,id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_colo_scale_${a}`),value:c,style:{maxWidth:"50%",marginLeft:4},canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(h="")=>{r(h||"")}}):p.jsx(G.InputNumber,{className:n,value:Number(e.value)||0,onChange:h=>e.onChange(h||0),...d})},Wl=e=>{var F;const{interceptorManager:t}=e,n=te.useDependency(m.LocaleService),r=((F=e.rule)==null?void 0:F.type)===s.CFRuleType.colorScale?e.rule:void 0,a=[nt(s.CFValueType.num,n),nt(s.CFValueType.percent,n),nt(s.CFValueType.percentile,n),nt(s.CFValueType.formula,n)],o=[nt(s.CFValueType.min,n),...a],i=[nt("none",n),...a],u=[nt(s.CFValueType.max,n),...a],[l,c]=_.useState(()=>{var E;const R=s.CFValueType.min;return r&&((E=r.config[0])==null?void 0:E.value.type)||R}),[d,h]=_.useState(()=>{var E;const R="none";return!r||r.config.length!==3?R:((E=r.config[1])==null?void 0:E.value.type)||R}),[f,v]=_.useState(()=>{var E;const R=s.CFValueType.max;return r&&((E=r.config[r.config.length-1])==null?void 0:E.value.type)||R}),[y,T]=_.useState(()=>{if(!r)return 10;const E=r.config[0];return(E==null?void 0:E.value.value)===void 0?10:E==null?void 0:E.value.value}),[x,w]=_.useState(()=>{var J;if(!r||r.config.length!==3)return 50;const E=(J=r.config[1])==null?void 0:J.value.value;return E===void 0?50:E}),[b,S]=_.useState(()=>{var J;if(!r)return 90;const E=(J=r.config[r.config.length-1])==null?void 0:J.value.value;return E===void 0?90:E}),[C,g]=_.useState(()=>{var E;const R="#d0d9fb";return r&&((E=r.config[0])==null?void 0:E.color)||R}),[O,M]=_.useState(()=>{var E;const R="#7790f3";return!r||r.config.length!==3?R:((E=r.config[1])==null?void 0:E.color)||R}),[I,j]=_.useState(()=>{var E;const R="#2e55ef";return r&&((E=r.config[r.config.length-1])==null?void 0:E.color)||R}),L=_.useMemo(()=>R=>{const{minType:E,medianType:J,maxType:be,minValue:z,medianValue:q,maxValue:ne,minColor:ce,medianColor:me,maxColor:Te}=R,Re=[];return Re.push({color:ce,value:{type:E,value:z}}),J!=="none"&&Re.push({color:me,value:{type:J,value:q}}),Re.push({color:Te,value:{type:be,value:ne}}),{config:Re.map((lt,Vt)=>({...lt,index:Vt})),type:s.CFRuleType.colorScale}},[]);_.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return L({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:b,minColor:C,medianColor:O,maxColor:I})}}),[L,l,d,f,y,x,b,C,O,I,t]);const U=R=>{e.onChange(L(R))};return p.jsxs("div",{children:[p.jsx("div",{className:D.title,children:n.t("sheet.cf.panel.styleRule")}),p.jsx("div",{className:`${P.cfPreviewWrap}`,children:p.jsx(mt,{rule:L({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:b,minColor:C,medianColor:O,maxColor:I})})}),p.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.min")}),p.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[p.jsx(G.Select,{options:o,value:l,onChange:R=>{c(R);const E=s.createDefaultValueByValueType(R,10);T(E),U({minType:R,medianType:d,maxType:f,minValue:E,medianValue:x,maxValue:b,minColor:C,medianColor:O,maxColor:I})}}),p.jsx(pr,{id:"min",className:`${D.mLXxs}`,value:y,type:l,onChange:R=>{T(R),U({minType:l,medianType:d,maxType:f,minValue:R,medianValue:x,maxValue:b,minColor:C,medianColor:O,maxColor:I})}}),p.jsx(tt,{className:D.mLXxs,color:C,onChange:R=>{g(R),U({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:b,minColor:R,medianColor:O,maxColor:I})}})]}),p.jsx("div",{className:D.label,children:n.t("sheet.cf.panel.medianValue")}),p.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[p.jsx(G.Select,{options:i,value:d,onChange:R=>{h(R);const E=s.createDefaultValueByValueType(R,50);w(E),U({minType:l,medianType:R,maxType:f,minValue:y,medianValue:E,maxValue:b,minColor:C,medianColor:O,maxColor:I})}}),p.jsx(pr,{id:"median",className:` ${D.mLXxs}`,value:x,type:d,onChange:R=>{w(R),U({minType:l,medianType:d,maxType:f,minValue:y,medianValue:R,maxValue:b,minColor:C,medianColor:O,maxColor:I})}}),d!=="none"&&p.jsx(tt,{className:D.mLXxs,color:O,onChange:R=>{M(R),U({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:b,minColor:C,medianColor:R,maxColor:I})}})]}),p.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.max")}),p.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[p.jsx(G.Select,{options:u,value:f,onChange:R=>{v(R);const E=s.createDefaultValueByValueType(R,90);S(E),U({minType:l,medianType:d,maxType:R,minValue:y,medianValue:x,maxValue:E,minColor:C,medianColor:O,maxColor:I})}}),p.jsx(pr,{id:"max",className:`${D.mLXxs}`,value:b,type:f,onChange:R=>{S(R),U({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:R,minColor:C,medianColor:O,maxColor:I})}}),p.jsx(tt,{className:D.mLXxs,color:I,onChange:R=>{j(R),U({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:b,minColor:C,medianColor:O,maxColor:R})}})]})]})},gt=(e,t)=>({label:t.t(`sheet.cf.valueType.${e}`),value:e}),ka=e=>{const{onChange:t,className:n,value:r,type:a,id:o,disabled:i=!1}=e,u=te.useDependency(m.IUniverInstanceService),l=u.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),c=u.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),d=_.useRef(r),h=_.useMemo(()=>[s.CFValueType.percentile,s.CFValueType.percent].includes(a)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[a]);if(a===s.CFValueType.formula){const f=String(d.current).startsWith("=")?String(d.current)||"":"=";return p.jsx(ve.TextEditor,{id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_data_bar_${o}`),value:f,openForSheetSubUnitId:c,openForSheetUnitId:l,style:{width:"47%",marginLeft:14},canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(v="")=>{t(v||"")}})}return p.jsx(G.InputNumber,{className:n,value:Number(r)||0,disabled:i,onChange:f=>{t(f||0)},...h})},$l=e=>{var F;const{interceptorManager:t}=e,n=te.useDependency(m.LocaleService),r=((F=e.rule)==null?void 0:F.type)===s.CFRuleType.dataBar?e.rule:void 0,[a,o]=_.useState(()=>{var E;const R="0";return r?(E=r.config)!=null&&E.isGradient?"1":"0":R}),[i,u]=_.useState(()=>{var E;const R="#abd91a";return r&&((E=r.config)==null?void 0:E.positiveColor)||R}),[l,c]=_.useState(()=>{var E;const R="#ffbe38";return r&&((E=r.config)==null?void 0:E.nativeColor)||R}),d=[gt(s.CFValueType.num,n),gt(s.CFValueType.percent,n),gt(s.CFValueType.percentile,n),gt(s.CFValueType.formula,n)],h=[gt(s.CFValueType.min,n),...d],f=[gt(s.CFValueType.max,n),...d],[v,y]=_.useState(()=>{var E;const R=h[0].value;return r&&((E=r.config)==null?void 0:E.min.type)||R}),[T,x]=_.useState(()=>{var E;const R=f[0].value;return r&&((E=r.config)==null?void 0:E.max.type)||R}),[w,b]=_.useState(()=>{var J;if(!r)return 0;const E=((J=r.config)==null?void 0:J.min)||{};return E.type===s.CFValueType.formula?E.value||"=":E.value||0}),[S,C]=_.useState(()=>{var J;if(!r)return 100;const E=((J=r.config)==null?void 0:J.max)||{};return E.type===s.CFValueType.formula?E.value||"=":E.value===void 0?100:E.value}),[g,O]=_.useState(()=>r?r.isShowValue===void 0?!0:!!r.isShowValue:!0),M=R=>({config:{min:{type:R.minValueType,value:R.minValue},max:{type:R.maxValueType,value:R.maxValue},isGradient:R.isGradient==="1",positiveColor:R.positiveColor,nativeColor:R.nativeColor},type:s.CFRuleType.dataBar,isShowValue:R.isShowValue});_.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return M({isGradient:a,minValue:w,minValueType:v,maxValue:S,maxValueType:T,positiveColor:i,nativeColor:l,isShowValue:g})}}),[a,w,v,S,T,i,l,t,g]);const I=R=>{e.onChange(M(R))},j=R=>{u(R),I({isGradient:a,minValue:w,minValueType:v,maxValue:S,maxValueType:T,positiveColor:R,nativeColor:l,isShowValue:g})},L=R=>{c(R),I({isGradient:a,minValue:w,minValueType:v,maxValue:S,maxValueType:T,positiveColor:i,nativeColor:R,isShowValue:g})},U=R=>d.map(E=>E.value).includes(R);return p.jsxs("div",{children:[p.jsx("div",{className:D.title,children:n.t("sheet.cf.panel.styleRule")}),p.jsx("div",{className:`${P.cfPreviewWrap}`,children:p.jsx(mt,{rule:M({isGradient:a,minValue:w,minValueType:v,maxValue:S,maxValueType:T,positiveColor:i,nativeColor:l,isShowValue:g})})}),p.jsxs("div",{children:[p.jsx("div",{className:D.label,children:n.t("sheet.cf.panel.fillType")}),p.jsxs("div",{className:`${D.mTSm} ${D.mLXxs} ${D.labelContainer} `,children:[p.jsxs(G.RadioGroup,{value:a,onChange:R=>{o(R),I({isGradient:R,minValue:w,minValueType:v,maxValue:S,maxValueType:T,positiveColor:i,nativeColor:l,isShowValue:g})},children:[p.jsx(G.Radio,{value:"0",children:p.jsx("span",{className:P.text,children:n.t("sheet.cf.panel.pureColor")})}),p.jsx(G.Radio,{value:"1",children:p.jsx("span",{className:P.text,children:n.t("sheet.cf.panel.gradient")})})]}),p.jsxs("div",{className:`${P.utilItem} ${D.mLXl}`,children:[p.jsx(G.Checkbox,{checked:!g,onChange:R=>{O(!R),I({isGradient:R,minValue:w,minValueType:v,maxValue:S,maxValueType:T,positiveColor:i,nativeColor:l,isShowValue:!R})}}),n.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),p.jsxs("div",{children:[p.jsx("div",{className:D.label,children:n.t("sheet.cf.panel.colorSet")}),p.jsxs("div",{className:`${D.labelContainer} ${D.mTSm} ${D.mLXxs}`,children:[p.jsxs("div",{className:`${D.labelContainer}`,children:[p.jsx("div",{className:`${P.text}`,children:n.t("sheet.cf.panel.native")}),p.jsx(tt,{color:l,onChange:L})]}),p.jsxs("div",{className:`${D.labelContainer} ${D.mLSm} `,children:[p.jsx("div",{className:`${P.text} `,children:n.t("sheet.cf.panel.positive")}),p.jsx(tt,{color:i,onChange:j})]})]})]}),p.jsxs("div",{children:[p.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.min")}),p.jsxs("div",{className:`${D.mTSm} ${D.labelContainer}`,children:[p.jsx(G.Select,{options:h,value:v,onChange:R=>{y(R);const E=s.createDefaultValueByValueType(R,10);b(E),I({isGradient:a,minValue:E,minValueType:R,maxValue:S,maxValueType:T,positiveColor:i,nativeColor:l,isShowValue:g})}}),p.jsx(ka,{disabled:!U(v),id:"min",type:v,className:D.mLSm,value:w,onChange:R=>{b(R||0),I({isGradient:a,minValue:R||0,minValueType:v,maxValue:S,maxValueType:T,positiveColor:i,nativeColor:l,isShowValue:g})}})]}),p.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.max")}),p.jsxs("div",{className:`${D.mTSm} ${D.labelContainer}`,children:[p.jsx(G.Select,{options:f,value:T,onChange:R=>{x(R);const E=s.createDefaultValueByValueType(R,90);C(E),I({isGradient:a,minValue:w,minValueType:v,maxValue:E,maxValueType:R,positiveColor:i,nativeColor:l,isShowValue:g})}}),p.jsx(ka,{disabled:!U(T),id:"max",type:T,className:D.mLSm,value:S,onChange:R=>{C(R||0),I({isGradient:a,minValue:w,minValueType:v,maxValue:R||0,maxValueType:T,positiveColor:i,nativeColor:l,isShowValue:g})}})]})]})]})},He={cfStyleEdit:"univer-cf-style-edit",buttonItem:"univer-button-item",isActive:"univer-isActive"},sn=e=>[m.BooleanNumber.FALSE,void 0].includes(e)?m.BooleanNumber.TRUE:m.BooleanNumber.FALSE,ln=e=>e!==m.BooleanNumber.FALSE,hr=e=>{const{style:t,onChange:n,className:r}=e,a=te.useDependency(ve.ComponentManager),[o,i]=_.useState(()=>{if(t!=null&&t.bl)return t.bl}),[u,l]=_.useState(()=>{if(t!=null&&t.it)return t.it}),[c,d]=_.useState(()=>{if(t!=null&&t.ul)return t.ul.s}),[h,f]=_.useState(()=>{if(t!=null&&t.st)return t.st.s}),[v,y]=_.useState(()=>{var O;const g="#2f56ef";return(O=t==null?void 0:t.cl)!=null&&O.rgb?t.cl.rgb:g}),[T,x]=_.useState(()=>{var O;const g="#e8ecfc";return(O=t==null?void 0:t.bg)!=null&&O.rgb?t.bg.rgb:g}),w=a.get("BoldSingle"),b=a.get("ItalicSingle"),S=a.get("UnderlineSingle"),C=a.get("StrikethroughSingle");return _.useEffect(()=>{const g={bl:o,it:u};v!==void 0&&(g.cl={rgb:v}),T!==void 0&&(g.bg={rgb:T}),h!==void 0&&(g.st={s:h}),c!==void 0&&(g.ul={s:c}),n(s.removeUndefinedAttr(g))},[o,u,c,h,v,T]),p.jsxs("div",{className:`${He.cfStyleEdit} ${r}`,children:[w&&p.jsx("div",{className:We({[He.isActive]:ln(o||m.BooleanNumber.FALSE)},He.buttonItem),onClick:()=>i(sn(o)),children:p.jsx(w,{})}),b&&p.jsx("div",{className:We({[He.isActive]:ln(u||m.BooleanNumber.FALSE)},He.buttonItem),onClick:()=>l(sn(u)),children:p.jsx(b,{})}),S&&p.jsx("div",{className:We({[He.isActive]:ln(c||m.BooleanNumber.FALSE)},He.buttonItem),onClick:()=>d(sn(c)),children:p.jsx(S,{})}),C&&p.jsx("div",{className:We({[He.isActive]:ln(h||m.BooleanNumber.FALSE)},He.buttonItem),onClick:()=>f(sn(h)),children:p.jsx(C,{})}),p.jsx(tt,{color:v,onChange:y,iconId:"FontColor"}),p.jsx(tt,{color:T,onChange:x,iconId:"PaintBucket"})]})},Bl=e=>{var x;const{onChange:t,interceptorManager:n}=e,r=te.useDependency(m.LocaleService),a=((x=e.rule)==null?void 0:x.type)===s.CFRuleType.highlightCell?e.rule:void 0,o=[{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 w=o[0].value,b=a==null?void 0:a.type;if(!a)return w;switch(b){case s.CFRuleType.highlightCell:switch(a.subType){case s.CFSubRuleType.average:return[s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual].includes(a.operator)?"greaterThanAverage":[s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(a.operator)?"lessThanAverage":w;case s.CFSubRuleType.rank:return a.isBottom?"isBottom":"isNotBottom"}}return w}),[l,c]=_.useState(()=>{const b=a==null?void 0:a.type;if(!a)return 10;switch(b){case s.CFRuleType.highlightCell:switch(a.subType){case s.CFSubRuleType.rank:return a.value||10}}return 10}),[d,h]=_.useState(()=>{const b=a==null?void 0:a.type;if(!a)return!1;switch(b){case s.CFRuleType.highlightCell:switch(a.subType){case s.CFSubRuleType.rank:return a.isPercent||!1}}return!1}),[f,v]=_.useState({}),y=w=>{const{type:b,isPercent:S,value:C,style:g}=w;if(b==="isNotBottom")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank,isPercent:S,isBottom:!1,value:C,style:g};if(b==="isBottom")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank,isPercent:S,isBottom:!0,value:C,style:g};if(b==="greaterThanAverage")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.average,operator:s.CFNumberOperator.greaterThan,style:g};if(b==="lessThanAverage")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.average,operator:s.CFNumberOperator.lessThan,style:g}};_.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return y({type:i,isPercent:d,value:l,style:f})}}),[i,d,l,f,n]);const T=w=>{t(y(w))};return p.jsxs("div",{children:[p.jsx("div",{className:`${D.title} ${D.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),p.jsx(G.Select,{className:`${P.width100} ${D.mTSm}`,value:i,options:o,onChange:w=>{u(w),T({type:w,isPercent:d,value:l,style:f})}}),["isNotBottom","isBottom"].includes(i)&&p.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[p.jsx(G.InputNumber,{min:1,max:1e3,value:l,onChange:w=>{const b=w||0;c(b),T({type:i,isPercent:d,value:b,style:f})}}),p.jsxs("div",{className:`${D.mLSm} ${D.labelContainer} ${P.text}`,children:[p.jsx(G.Checkbox,{checked:d,onChange:w=>{h(!!w),T({type:i,isPercent:!!w,value:l,style:f})}}),r.t("sheet.cf.valueType.percent")]})]}),p.jsx("div",{className:`${P.cfPreviewWrap} `,children:p.jsx(mt,{rule:y({type:i,isPercent:d,value:l,style:f})})}),p.jsx(hr,{style:a==null?void 0:a.style,className:`${D.mTSm} `,onChange:w=>{v(w),T({type:i,isPercent:d,value:l,style:w})}})]})},Q=(e,t)=>({label:t.t(`sheet.cf.operator.${e}`),value:e}),Fl=e=>{const{type:t,operator:n,onChange:r,value:a}=e,[o,i]=_.useState(()=>typeof a=="number"?a:0),[u,l]=_.useState(()=>typeof a=="string"?a:""),[c,d]=_.useState(()=>Array.isArray(a)?a[0]===void 0?0:a[0]:0),[h,f]=_.useState(()=>Array.isArray(a)?a[1]===void 0?100:a[1]:100);switch(_.useEffect(()=>{switch(t){case s.CFSubRuleType.text:{[s.CFTextOperator.beginsWith,s.CFTextOperator.endsWith,s.CFTextOperator.containsText,s.CFTextOperator.notContainsText,s.CFTextOperator.equal,s.CFTextOperator.notEqual].includes(n)&&r(u);break}case s.CFSubRuleType.number:{[s.CFNumberOperator.equal,s.CFNumberOperator.notEqual,s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual,s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(n)&&r(o),[s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(n)&&r([c,h]);break}}},[t]),t){case s.CFSubRuleType.text:{if([s.CFTextOperator.beginsWith,s.CFTextOperator.endsWith,s.CFTextOperator.containsText,s.CFTextOperator.notContainsText,s.CFTextOperator.equal,s.CFTextOperator.notEqual].includes(n)){const v=y=>{l(y),r(y)};return p.jsx("div",{className:`${D.mTSm}`,children:p.jsx(G.Input,{className:P.width100,value:u,onChange:v})})}break}case s.CFSubRuleType.number:{if([s.CFNumberOperator.equal,s.CFNumberOperator.notEqual,s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual,s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(n)){const v=y=>{i(y||0),r(y||0)};return p.jsx("div",{className:`${D.mTSm}`,children:p.jsx(G.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:P.width100,value:o,onChange:v})})}if([s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(n)){const v=T=>{d(T||0),r([T||0,h])},y=T=>{f(T||0),r([c,T||0])};return p.jsxs("div",{className:`${D.mTSm} ${D.labelContainer} `,children:[p.jsx(G.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:c,onChange:v}),p.jsx(G.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`${D.mLSm}`,value:h,onChange:y})]})}}}return null},Ha=(e,t)=>{switch(e){case s.CFSubRuleType.text:return[Q(s.CFTextOperator.containsText,t),Q(s.CFTextOperator.notContainsText,t),Q(s.CFTextOperator.beginsWith,t),Q(s.CFTextOperator.endsWith,t),Q(s.CFTextOperator.equal,t),Q(s.CFTextOperator.notEqual,t),Q(s.CFTextOperator.containsBlanks,t),Q(s.CFTextOperator.notContainsBlanks,t),Q(s.CFTextOperator.containsErrors,t),Q(s.CFTextOperator.notContainsErrors,t)];case s.CFSubRuleType.number:return[Q(s.CFNumberOperator.between,t),Q(s.CFNumberOperator.notBetween,t),Q(s.CFNumberOperator.equal,t),Q(s.CFNumberOperator.notEqual,t),Q(s.CFNumberOperator.greaterThan,t),Q(s.CFNumberOperator.greaterThanOrEqual,t),Q(s.CFNumberOperator.lessThan,t),Q(s.CFNumberOperator.lessThanOrEqual,t)];case s.CFSubRuleType.timePeriod:return[Q(s.CFTimePeriodOperator.yesterday,t),Q(s.CFTimePeriodOperator.today,t),Q(s.CFTimePeriodOperator.tomorrow,t),Q(s.CFTimePeriodOperator.last7Days,t),Q(s.CFTimePeriodOperator.lastWeek,t),Q(s.CFTimePeriodOperator.thisWeek,t),Q(s.CFTimePeriodOperator.nextWeek,t),Q(s.CFTimePeriodOperator.lastMonth,t),Q(s.CFTimePeriodOperator.thisMonth,t),Q(s.CFTimePeriodOperator.nextMonth,t)]}},Wa=e=>{var C;const{interceptorManager:t,onChange:n}=e,r=te.useDependency(m.LocaleService),a=((C=e.rule)==null?void 0:C.type)===s.CFRuleType.highlightCell?e.rule:void 0,[o,i]=_.useState(()=>{const g=s.CFSubRuleType.text;return a&&a.subType||g}),u=[{value:s.CFSubRuleType.text,label:r.t("sheet.cf.subRuleType.text")},{value:s.CFSubRuleType.number,label:r.t("sheet.cf.subRuleType.number")},{value:s.CFSubRuleType.timePeriod,label:r.t("sheet.cf.subRuleType.timePeriod")},{value:s.CFSubRuleType.duplicateValues,label:r.t("sheet.cf.subRuleType.duplicateValues")},{value:s.CFSubRuleType.uniqueValues,label:r.t("sheet.cf.subRuleType.uniqueValues")}],l=_.useMemo(()=>Ha(o,r),[o]),[c,d]=_.useState(()=>{const g=l?l[0].value:void 0;return a&&a.operator||g}),[h,f]=_.useState(()=>{var M;const g="";return a?(M=a.value)!=null?M:s.createDefaultValue(a.subType,a.operator):g}),[v,y]=_.useState({}),T=_.useMemo(()=>g=>{var O,M,I,j,L,U,F,R,E,J,be,z,q,ne,ce;switch(g.subType||o){case s.CFSubRuleType.text:{if([s.CFTextOperator.beginsWith,s.CFTextOperator.endsWith,s.CFTextOperator.containsText,s.CFTextOperator.notContainsText,s.CFTextOperator.equal,s.CFTextOperator.notEqual].includes(c))return{type:s.CFRuleType.highlightCell,subType:(O=g.subType)!=null?O:o,operator:(M=g.operator)!=null?M:c,style:(I=g.style)!=null?I:v,value:(j=g.value)!=null?j:h};break}case s.CFSubRuleType.number:{if([s.CFNumberOperator.equal,s.CFNumberOperator.notEqual,s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual,s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(c))return{type:s.CFRuleType.highlightCell,subType:(L=g.subType)!=null?L:o,operator:(U=g.operator)!=null?U:c,style:(F=g.style)!=null?F:v,value:(R=g.value)!=null?R:h};if([s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(c))return{type:s.CFRuleType.highlightCell,subType:(E=g.subType)!=null?E:o,operator:(J=g.operator)!=null?J:c,style:(be=g.style)!=null?be:v,value:(z=g.value)!=null?z:h};break}}return{type:s.CFRuleType.highlightCell,subType:(q=g.subType)!=null?q:o,operator:(ne=g.operator)!=null?ne:c,style:(ce=g.style)!=null?ce:v}},[o,c,h,v]);_.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return T({})}}),[T,t]),_.useEffect(()=>{u.some(g=>g.value===o)||i(u[0].value)},[u]);const x=g=>{const O=g,M=Ha(O,r),I=M&&M[0].value;i(O),d(I),I&&f(s.createDefaultValue(O,I)),n(T({subType:O,operator:I}))},w=g=>{const O=g;d(O),n(T({operator:O}))},b=g=>{f(g),n(T({value:g}))},S=_.useMemo(()=>`${o}_${c}_${Math.random()}`,[o,c]);return p.jsxs("div",{children:[p.jsx("div",{className:`${D.title} ${D.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),p.jsx(G.Select,{className:`${D.mTSm} ${P.width100}`,onChange:x,value:o,options:u}),(l==null?void 0:l.length)&&p.jsx(G.Select,{className:`${D.mTSm} ${P.width100}`,onChange:w,value:c||"",options:l}),p.jsx(Fl,{value:h,interceptorManager:t,type:o,operator:c,rule:a,onChange:b},S),p.jsx("div",{className:`${P.cfPreviewWrap}`,children:p.jsx(mt,{rule:T({})})}),p.jsx(hr,{style:a==null?void 0:a.style,className:`${D.mLXxs}`,onChange:g=>{y(g),n(T({style:g}))}})]})},Gl=e=>{var y;const{onChange:t,interceptorManager:n}=e,r=te.useDependency(m.LocaleService),o=te.useDependency(m.IUniverInstanceService).getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),i=o.getActiveSheet(),u=((y=e.rule)==null?void 0:y.type)===s.CFRuleType.highlightCell?e.rule:void 0,[l,c]=_.useState({}),[d,h]=_.useState(()=>(u==null?void 0:u.subType)===s.CFSubRuleType.formula?u.value:"="),f=T=>({style:T.style,value:d,type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.formula});_.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return f({style:l,formula:d})}}),[l,d,n]);const v=T=>{t(f(T))};return p.jsxs("div",{children:[p.jsx("div",{className:`${D.title} ${D.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),p.jsx("div",{className:`${D.mTSm}`,children:p.jsx(ve.TextEditor,{id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_formula`),openForSheetSubUnitId:i.getSheetId(),openForSheetUnitId:o.getUnitId(),value:d,canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(T="")=>{const x=T||"";h(x),v({style:l,formula:x})}})}),p.jsx("div",{className:`${P.cfPreviewWrap} `,children:p.jsx(mt,{rule:f({style:l,formula:d})})}),p.jsx(hr,{style:u==null?void 0:u.style,className:`${D.mTSm} `,onChange:T=>{c(T),v({style:T,formula:d})}})]})};var ql="Expected a function",$a="__lodash_hash_undefined__",Ba=1/0,Xl=9007199254740991,Yl="[object Function]",Kl="[object GeneratorFunction]",Zl="[object Symbol]",Jl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ql=/^\w*$/,eu=/^\./,tu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nu=/[\\^$.*+?()[\]{}|]/g,ru=/\\(\\)?/g,au=/^\[object .+?Constructor\]$/,ou=/^(?:0|[1-9]\d*)$/,iu=typeof Ae=="object"&&Ae&&Ae.Object===Object&&Ae,su=typeof self=="object"&&self&&self.Object===Object&&self,mr=iu||su||Function("return this")();function lu(e,t){return e==null?void 0:e[t]}function uu(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var cu=Array.prototype,du=Function.prototype,Fa=Object.prototype,gr=mr["__core-js_shared__"],Ga=function(){var e=/[^.]+$/.exec(gr&&gr.keys&&gr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),qa=du.toString,un=Fa.hasOwnProperty,Xa=Fa.toString,fu=RegExp("^"+qa.call(un).replace(nu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ya=mr.Symbol,pu=cu.splice,hu=Ja(mr,"Map"),Ot=Ja(Object,"create"),Ka=Ya?Ya.prototype:void 0,Za=Ka?Ka.toString:void 0;function rt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function mu(){this.__data__=Ot?Ot(null):{}}function gu(e){return this.has(e)&&delete this.__data__[e]}function vu(e){var t=this.__data__;if(Ot){var n=t[e];return n===$a?void 0:n}return un.call(t,e)?t[e]:void 0}function yu(e){var t=this.__data__;return Ot?t[e]!==void 0:un.call(t,e)}function Su(e,t){var n=this.__data__;return n[e]=Ot&&t===void 0?$a:t,this}rt.prototype.clear=mu,rt.prototype.delete=gu,rt.prototype.get=vu,rt.prototype.has=yu,rt.prototype.set=Su;function vt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function bu(){this.__data__=[]}function Tu(e){var t=this.__data__,n=cn(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():pu.call(t,n,1),!0}function Ru(e){var t=this.__data__,n=cn(t,e);return n<0?void 0:t[n][1]}function Cu(e){return cn(this.__data__,e)>-1}function wu(e,t){var n=this.__data__,r=cn(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}vt.prototype.clear=bu,vt.prototype.delete=Tu,vt.prototype.get=Ru,vt.prototype.has=Cu,vt.prototype.set=wu;function at(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function _u(){this.__data__={hash:new rt,map:new(hu||vt),string:new rt}}function Iu(e){return dn(this,e).delete(e)}function xu(e){return dn(this,e).get(e)}function Ou(e){return dn(this,e).has(e)}function Eu(e,t){return dn(this,e).set(e,t),this}at.prototype.clear=_u,at.prototype.delete=Iu,at.prototype.get=xu,at.prototype.has=Ou,at.prototype.set=Eu;function Mu(e,t,n){var r=e[t];(!(un.call(e,t)&&Qa(r,n))||n===void 0&&!(t in e))&&(e[t]=n)}function cn(e,t){for(var n=e.length;n--;)if(Qa(e[n][0],t))return n;return-1}function Du(e){if(!fn(e)||zu(e))return!1;var t=Wu(e)||uu(e)?fu:au;return t.test(Hu(e))}function Pu(e,t,n,r){if(!fn(e))return e;t=Vu(t,e)?[t]:ju(t);for(var a=-1,o=t.length,i=o-1,u=e;u!=null&&++a<o;){var l=ku(t[a]),c=n;if(a!=i){var d=u[l];c=r?r(d,l,u):void 0,c===void 0&&(c=fn(d)?d:Lu(t[a+1])?[]:{})}Mu(u,l,c),u=u[l]}return e}function Nu(e){if(typeof e=="string")return e;if(yr(e))return Za?Za.call(e):"";var t=e+"";return t=="0"&&1/e==-Ba?"-0":t}function ju(e){return eo(e)?e:Au(e)}function dn(e,t){var n=e.__data__;return Uu(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Ja(e,t){var n=lu(e,t);return Du(n)?n:void 0}function Lu(e,t){return t=t==null?Xl:t,!!t&&(typeof e=="number"||ou.test(e))&&e>-1&&e%1==0&&e<t}function Vu(e,t){if(eo(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||yr(e)?!0:Ql.test(e)||!Jl.test(e)||t!=null&&e in Object(t)}function Uu(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function zu(e){return!!Ga&&Ga in e}var Au=vr(function(e){e=Bu(e);var t=[];return eu.test(e)&&t.push(""),e.replace(tu,function(n,r,a,o){t.push(a?o.replace(ru,"$1"):r||n)}),t});function ku(e){if(typeof e=="string"||yr(e))return e;var t=e+"";return t=="0"&&1/e==-Ba?"-0":t}function Hu(e){if(e!=null){try{return qa.call(e)}catch{}try{return e+""}catch{}}return""}function vr(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError(ql);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var i=e.apply(this,r);return n.cache=o.set(a,i),i};return n.cache=new(vr.Cache||at),n}vr.Cache=at;function Qa(e,t){return e===t||e!==e&&t!==t}var eo=Array.isArray;function Wu(e){var t=fn(e)?Xa.call(e):"";return t==Yl||t==Kl}function fn(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function $u(e){return!!e&&typeof e=="object"}function yr(e){return typeof e=="symbol"||$u(e)&&Xa.call(e)==Zl}function Bu(e){return e==null?"":Nu(e)}function Fu(e,t,n){return e==null?e:Pu(e,t,n)}var Gu=Fu;const qu=wn(Gu);var Xu="Expected a function",to="__lodash_hash_undefined__",no=1/0,Yu="[object Function]",Ku="[object GeneratorFunction]",Zu="[object Symbol]",Ju=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qu=/^\w*$/,ec=/^\./,tc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nc=/[\\^$.*+?()[\]{}|]/g,rc=/\\(\\)?/g,ac=/^\[object .+?Constructor\]$/,oc=typeof Ae=="object"&&Ae&&Ae.Object===Object&&Ae,ic=typeof self=="object"&&self&&self.Object===Object&&self,Sr=oc||ic||Function("return this")();function sc(e,t){return e==null?void 0:e[t]}function lc(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var uc=Array.prototype,cc=Function.prototype,ro=Object.prototype,br=Sr["__core-js_shared__"],ao=function(){var e=/[^.]+$/.exec(br&&br.keys&&br.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),oo=cc.toString,Tr=ro.hasOwnProperty,io=ro.toString,dc=RegExp("^"+oo.call(Tr).replace(nc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),so=Sr.Symbol,fc=uc.splice,pc=co(Sr,"Map"),Et=co(Object,"create"),lo=so?so.prototype:void 0,uo=lo?lo.toString:void 0;function ot(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function hc(){this.__data__=Et?Et(null):{}}function mc(e){return this.has(e)&&delete this.__data__[e]}function gc(e){var t=this.__data__;if(Et){var n=t[e];return n===to?void 0:n}return Tr.call(t,e)?t[e]:void 0}function vc(e){var t=this.__data__;return Et?t[e]!==void 0:Tr.call(t,e)}function yc(e,t){var n=this.__data__;return n[e]=Et&&t===void 0?to:t,this}ot.prototype.clear=hc,ot.prototype.delete=mc,ot.prototype.get=gc,ot.prototype.has=vc,ot.prototype.set=yc;function yt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Sc(){this.__data__=[]}function bc(e){var t=this.__data__,n=pn(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():fc.call(t,n,1),!0}function Tc(e){var t=this.__data__,n=pn(t,e);return n<0?void 0:t[n][1]}function Rc(e){return pn(this.__data__,e)>-1}function Cc(e,t){var n=this.__data__,r=pn(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}yt.prototype.clear=Sc,yt.prototype.delete=bc,yt.prototype.get=Tc,yt.prototype.has=Rc,yt.prototype.set=Cc;function it(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function wc(){this.__data__={hash:new ot,map:new(pc||yt),string:new ot}}function _c(e){return hn(this,e).delete(e)}function Ic(e){return hn(this,e).get(e)}function xc(e){return hn(this,e).has(e)}function Oc(e,t){return hn(this,e).set(e,t),this}it.prototype.clear=wc,it.prototype.delete=_c,it.prototype.get=Ic,it.prototype.has=xc,it.prototype.set=Oc;function pn(e,t){for(var n=e.length;n--;)if(Ac(e[n][0],t))return n;return-1}function Ec(e,t){t=Nc(t,e)?[t]:Pc(t);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Uc(t[n++])];return n&&n==r?e:void 0}function Mc(e){if(!po(e)||Lc(e))return!1;var t=kc(e)||lc(e)?dc:ac;return t.test(zc(e))}function Dc(e){if(typeof e=="string")return e;if(Cr(e))return uo?uo.call(e):"";var t=e+"";return t=="0"&&1/e==-no?"-0":t}function Pc(e){return fo(e)?e:Vc(e)}function hn(e,t){var n=e.__data__;return jc(t)?n[typeof t=="string"?"string":"hash"]:n.map}function co(e,t){var n=sc(e,t);return Mc(n)?n:void 0}function Nc(e,t){if(fo(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Cr(e)?!0:Qu.test(e)||!Ju.test(e)||t!=null&&e in Object(t)}function jc(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Lc(e){return!!ao&&ao in e}var Vc=Rr(function(e){e=Wc(e);var t=[];return ec.test(e)&&t.push(""),e.replace(tc,function(n,r,a,o){t.push(a?o.replace(rc,"$1"):r||n)}),t});function Uc(e){if(typeof e=="string"||Cr(e))return e;var t=e+"";return t=="0"&&1/e==-no?"-0":t}function zc(e){if(e!=null){try{return oo.call(e)}catch{}try{return e+""}catch{}}return""}function Rr(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError(Xu);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var i=e.apply(this,r);return n.cache=o.set(a,i),i};return n.cache=new(Rr.Cache||it),n}Rr.Cache=it;function Ac(e,t){return e===t||e!==e&&t!==t}var fo=Array.isArray;function kc(e){var t=po(e)?io.call(e):"";return t==Yu||t==Ku}function po(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Hc(e){return!!e&&typeof e=="object"}function Cr(e){return typeof e=="symbol"||Hc(e)&&io.call(e)==Zu}function Wc(e){return e==null?"":Dc(e)}function $c(e,t,n){var r=e==null?void 0:Ec(e,t);return r===void 0?n:r}var Bc=$c;const Fc=wn(Bc),ho=(e,t)=>(s.iconMap[e]||[])[Number(t)]||"",Gc=e=>{const t=te.useDependency(m.IUniverInstanceService),n=t.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),r=t.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),a=_.useMemo(()=>e.error?P.errorInput:"",[e.error]);return p.jsx("div",{className:P.positionRelative,children:e.type!==s.CFValueType.formula?p.jsxs(p.Fragment,{children:[p.jsx(G.InputNumber,{className:a,value:Number(e.value)||0,onChange:o=>e.onChange(o!=null?o:0)}),e.error&&p.jsx("div",{className:P.errorText,children:e.error})]}):p.jsx(ve.TextEditor,{id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_icon_set_${e.id}`),value:String(e.value).startsWith("=")?String(e.value):"=",openForSheetSubUnitId:r,openForSheetUnitId:n,canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(o="")=>{const i=o||"";e.onChange(i)}})})},mo=(e,t,n)=>({operator:s.CFNumberOperator.greaterThan,value:{type:s.CFValueType.num,value:(n.length-1-t)*10},iconType:e,iconId:String(t)}),qc=e=>{const t=te.useDependency(m.LocaleService),n=r=>{e.onClick(r)};return p.jsx("div",{className:P.iconGroupList,children:s.iconGroup.map((r,a)=>p.jsxs("div",{className:P.group,children:[p.jsx("div",{className:P.title,children:t.t(r.title)}),p.jsx("div",{className:P.itemContent,children:r.group.map(o=>p.jsx("div",{className:P.itemWrap,onClick:()=>{n(o.name)},children:p.jsx("div",{className:P.item,children:o.list.map((i,u)=>p.jsx("img",{className:P.icon,src:i},u))})},o.name))})]},a))})},Xc=e=>{const t=_.useMemo(()=>{const r=[];for(const a in s.iconMap){const o=s.iconMap[a],i=a;o.forEach((u,l)=>{r.push({iconType:i,base64:u,iconId:String(l)})})}return r},[]),n=r=>{e.onClick(r.iconType,r.iconId)};return p.jsxs("div",{className:P.iconItemListWrap,children:[p.jsxs("div",{className:P.none,onClick:()=>n({iconType:s.EMPTY_ICON_TYPE,iconId:"",base64:""}),children:[p.jsx(Ut,{className:P.icon}),p.jsx("span",{children:"无单元格图标"})]}),p.jsx("div",{className:P.iconItemList,children:t.map(r=>p.jsx("div",{className:P.item,children:p.jsx("img",{onClick:()=>n(r),className:`${P.icon}`,src:r.base64})},`${r.iconType}_${r.iconId}`))})]})},Yc=e=>{const{onChange:t,configList:n,errorMap:r={}}=e,a=te.useDependency(m.LocaleService),o=[{label:a.t(`sheet.cf.symbol.${s.CFNumberOperator.greaterThan}`),value:s.CFNumberOperator.greaterThan},{label:a.t(`sheet.cf.symbol.${s.CFNumberOperator.greaterThanOrEqual}`),value:s.CFNumberOperator.greaterThanOrEqual}],i=[{label:a.t(`sheet.cf.valueType.${s.CFValueType.num}`),value:s.CFValueType.num},{label:a.t(`sheet.cf.valueType.${s.CFValueType.percent}`),value:s.CFValueType.percent},{label:a.t(`sheet.cf.valueType.${s.CFValueType.percentile}`),value:s.CFValueType.percentile},{label:a.t(`sheet.cf.valueType.${s.CFValueType.formula}`),value:s.CFValueType.formula}],u=(h,f)=>{t([String(f),"value","value"],h)},l=(h,f)=>{t([String(f),"operator"],h);const v=s.createDefaultValue(s.CFSubRuleType.number,h);u(v,f)},c=(h,f)=>{t([String(f),"value","type"],h)};return _.useMemo(()=>n.map((h,f)=>{const v=r[f],y=ho(h.iconType,h.iconId),T=f===n.length-1,x=f===0,w=n[f-1],b=(w==null?void 0:w.value.type)===s.CFValueType.formula?a.t("sheet.cf.valueType.formula"):w==null?void 0:w.value.value,S=(C,g)=>{const O={...h,iconId:g,iconType:C};t([String(f)],O)};return p.jsxs("div",{className:`${f?D.mTXl:D.mTSm}`,children:[p.jsxs("div",{className:`${D.label} ${P.flex}`,children:[p.jsxs("div",{className:`${P.width45}`,children:[a.t("sheet.cf.iconSet.icon"),f+1]}),p.jsx("div",{className:`${P.width45}`,children:p.jsxs(p.Fragment,{children:[!x&&!T&&a.t("sheet.cf.iconSet.rule"),!x&&!T&&p.jsxs("span",{className:P.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${s.getOppositeOperator(w.operator)}`),b,T?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),p.jsxs("div",{className:`${P.flex} ${D.mTSm}`,children:[p.jsx("div",{className:`${P.iconWrap} ${P.width45}`,children:p.jsx(G.Dropdown,{overlay:p.jsx(Xc,{onClick:S,iconId:h.iconId,iconType:h.iconType}),children:p.jsxs("div",{className:P.dropdownIcon,children:[y?p.jsx("img",{src:y,className:P.icon}):p.jsx(Ut,{className:P.icon}),p.jsx(Cn,{})]})})}),T?p.jsxs("div",{className:`${P.width45} ${D.label}`,style:{marginTop:0},children:[a.t("sheet.cf.iconSet.rule"),p.jsxs("span",{className:P.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${s.getOppositeOperator(w.operator)}`),b,T?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]}):p.jsx(G.Select,{className:`${D.mL0} ${P.width45} ${D.mR0}`,options:o,value:h.operator,onChange:C=>{l(C,f)}})]}),T?p.jsx("div",{}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:`${D.mTSm} ${D.label} ${P.flex}`,children:[p.jsx("div",{className:`${P.width45}`,children:a.t("sheet.cf.iconSet.type")}),p.jsx("div",{className:`${P.width45}`,children:a.t("sheet.cf.iconSet.value")})]}),p.jsxs("div",{className:`${D.mTSm} ${P.flex}`,children:[p.jsx(G.Select,{className:`${P.width45} ${D.mL0}`,options:i,value:h.value.type,onChange:C=>{c(C,f)}}),p.jsx("div",{className:`${D.mL0} ${P.width45}`,children:p.jsx(Gc,{id:f,type:h.value.type,error:v,value:h.value.value||"",onChange:C=>u(C,f)})})]})]})]},f)}),[n,r])},Kc=e=>{var w;const{interceptorManager:t}=e,n=((w=e.rule)==null?void 0:w.type)===s.CFRuleType.iconSet?e.rule:void 0,r=te.useDependency(m.LocaleService),[a,o]=_.useState({}),[i,u]=_.useState(()=>{const b=Object.keys(s.iconMap)[0];if(n&&n.config.length){const S=n.config[0].iconType;if(!n.config.some(g=>g.iconType!==S))return S}return b}),[l,c]=_.useState(()=>{if(n&&n.config.length)return m.Tools.deepClone(n==null?void 0:n.config);const b=s.iconMap[i]||[];return new Array(b.length).fill("").map((S,C,g)=>C===g.length-1?{operator:s.CFNumberOperator.lessThanOrEqual,value:{type:s.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:i,iconId:String(C)}:mo(i,C,g))}),[d,h]=_.useState(()=>n?!!n.isShowValue:!0),f=_.useMemo(()=>{const b=l.map(S=>ho(S.iconType,S.iconId));return p.jsx("div",{className:P.iconWrap,children:b.map((S,C)=>S?p.jsx("img",{className:P.icon,src:S},C):p.jsx(Ut,{className:P.icon},C))})},[l]),v=b=>{if(b.reduce((C,g,O)=>C.preType&&!C.result||b.length-1===O?C:g.value.type===s.CFValueType.formula?{preType:s.CFValueType.formula,result:!1}:C.preType?{result:C.preType===g.value.type,preType:g.value.type}:{result:!0,preType:g.value.type},{result:!0,preType:""}).result&&[s.CFValueType.num,s.CFValueType.percent,s.CFValueType.percentile].includes(b[0].value.type)){const C={};return b.forEach((g,O,M)=>{if(O-1<0||O===M.length-1)return;const j=b[O-1],L=s.getOppositeOperator(j.operator);s.compareWithNumber({operator:L,value:j.value.value},g.value.value)||(C[O]=`${r.t(`sheet.cf.form.${L}`,String(j.value.value))} `)}),C}return{}},y=(b,S)=>{Fc(l,b)!==S&&(qu(l,b,S),c([...l]),o(v(l)))},T=b=>{u(b);const S=s.iconMap[b]||[],C=new Array(S.length).fill("").map((g,O,M)=>mo(b,O,M));c(C),o(v(C))};_.useEffect(()=>{const b=t.intercept(t.getInterceptPoints().submit,{handler(){return{type:s.CFRuleType.iconSet,isShowValue:d,config:l}}});return()=>{b()}},[d,l,t]),_.useEffect(()=>{const b=t.intercept(t.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(a).length===0}});return()=>{b()}},[d,l,t,a]);const x=()=>{const b=l.map(S=>({...S}));l.forEach((S,C)=>{const g=l.length-1-C,O=b[g];S.iconId=O.iconId,S.iconType=O.iconType}),c([...l])};return p.jsxs("div",{className:P.iconSet,children:[p.jsx("div",{className:D.title,children:r.t("sheet.cf.panel.styleRule")}),p.jsx("div",{className:`${D.mTSm}`,children:p.jsx(G.Dropdown,{overlay:p.jsx(qc,{iconType:i,onClick:T}),children:p.jsxs("div",{className:P.dropdownIcon,style:{width:"unset"},children:[f,p.jsx(Cn,{})]})})}),p.jsxs("div",{className:`${D.mTSm} ${P.renderConfig}`,children:[p.jsxs("div",{className:P.utilItem,children:[p.jsx(G.Checkbox,{onChange:x}),r.t("sheet.cf.iconSet.reverseIconOrder")]}),p.jsxs("div",{className:`${P.utilItem} ${D.mLXl}`,children:[p.jsx(G.Checkbox,{checked:!d,onChange:b=>{h(!b)}}),r.t("sheet.cf.iconSet.onlyShowIcon")]})]}),p.jsx(Yc,{errorMap:a,onChange:y,configList:l})]})},go=e=>e.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),vo=e=>e.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),Zc=e=>{var C,g,O,M;const t=te.useDependency(m.LocaleService),n=te.useDependency(m.ICommandService),r=te.useDependency(m.IUniverInstanceService),a=te.useDependency(s.ConditionalFormattingRuleModel),o=te.useDependency(H.SelectionManagerService),i=go(r),u=vo(r),l=_.useRef((g=(C=e.rule)==null?void 0:C.ranges)!=null?g:[]),c=_.useMemo(()=>{var j,L;let I=(j=e.rule)==null?void 0:j.ranges;return I!=null&&I.length||(I=(L=o.getSelectionRanges())!=null?L:[]),l.current=I,I!=null&&I.length?I.map(U=>{const F=wr.serializeRange(U);return F==="NaN"?"":F}).filter(U=>!!U).join(","):""},[e.rule]),d=[{label:t.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:t.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:t.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:t.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:t.t("sheet.cf.ruleType.formula"),value:"5"},{label:t.t("sheet.cf.ruleType.iconSet"),value:"6"}],[h,f]=_.useState(()=>{var L,U;const I=(L=e.rule)==null?void 0:L.rule.type,j=d[0].value;if(!I)return j;switch(I){case s.CFRuleType.highlightCell:{switch((U=e.rule)==null?void 0:U.rule.subType){case s.CFSubRuleType.number:case s.CFSubRuleType.text:case s.CFSubRuleType.duplicateValues:case s.CFSubRuleType.uniqueValues:case s.CFSubRuleType.timePeriod:return"1";case s.CFSubRuleType.average:case s.CFSubRuleType.rank:return"2";case s.CFSubRuleType.formula:return"5"}break}case s.CFRuleType.dataBar:return"3";case s.CFRuleType.colorScale:return"4";case s.CFRuleType.iconSet:return"6"}return j}),v=_.useRef(),y=_.useMemo(()=>new m.InterceptorManager({beforeSubmit:kl,submit:Hl}),[]),T=_.useMemo(()=>{switch(h){case"1":return Wa;case"2":return Bl;case"3":return $l;case"4":return Wl;case"5":return Gl;case"6":return Kc;default:return Wa}},[h]);_.useEffect(()=>{var I;if(((I=e.rule)==null?void 0:I.cfId)!==void 0){const j=n.onCommandExecuted(L=>{if(L.id===H.RemoveSheetMutation.id){const U=L.params;U.subUnitId===u&&U.unitId===i&&e.onCancel()}L.id===H.SetWorksheetActiveOperation.id&&e.onCancel()});return()=>j.dispose()}},[(O=e.rule)==null?void 0:O.cfId]);const x=I=>{v.current=I},w=I=>{l.current=I.map(j=>j.range)},b=()=>{const I=y.fetchThroughInterceptors(y.getInterceptPoints().beforeSubmit)(!0,null),j=()=>{const L=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet();return l.current.map(R=>H.setEndForRange(R,L.getRowCount(),L.getColumnCount())).filter(R=>!(Number.isNaN(R.startRow)||Number.isNaN(R.startColumn)))};if(I){const L=y.fetchThroughInterceptors(y.getInterceptPoints().submit)(null,null),U=j();if(L&&U.length){const F=go(r),R=vo(r);let E={};e.rule&&e.rule.cfId?(E={...e.rule,ranges:U,rule:L},n.executeCommand(Aa.id,{unitId:F,subUnitId:R,rule:E}),e.onCancel()):(E={cfId:a.createCfId(F,R),ranges:U,rule:L,stopIfTrue:!1},n.executeCommand(za.id,{unitId:F,subUnitId:R,rule:E}),e.onCancel())}}},S=()=>{e.onCancel()};return p.jsxs("div",{className:P.cfRuleStyleEditor,children:[p.jsx("div",{className:D.title,children:t.t("sheet.cf.panel.range")}),p.jsx("div",{className:`${D.mTBase}`,children:p.jsx(ve.RangeSelector,{placeholder:t.t("sheet.cf.form.rangeSelector"),width:"100%",openForSheetSubUnitId:u,openForSheetUnitId:i,value:c,id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_rangeSelector`),onChange:w})}),p.jsx("div",{className:D.title,children:t.t("sheet.cf.panel.styleType")}),p.jsx("div",{className:D.mTBase,children:p.jsx(G.Select,{className:P.width100,value:h,options:d,onChange:I=>f(I)})}),p.jsx(T,{interceptorManager:y,rule:(M=e.rule)==null?void 0:M.rule,onChange:x}),p.jsxs("div",{className:`${D.mTBase} ${P.btnList}`,children:[p.jsx(G.Button,{size:"small",onClick:S,children:t.t("sheet.cf.panel.cancel")}),p.jsx(G.Button,{className:D.mLSm,size:"small",type:"primary",onClick:b,children:t.t("sheet.cf.panel.submit")})]})]})},Jc=e=>{const[t,n]=_.useState(e.rule),[r,a]=_.useState(!!e.rule),o=()=>{a(!0)},i=()=>{a(!1),n(void 0)},u=l=>{n(l),a(!0)};return p.jsx("div",{className:D.conditionalFormattingWrap,children:r?p.jsx(Zc,{onCancel:i,rule:t}):p.jsx(Al,{onClick:u,onCreate:o})})};var Qc=Object.defineProperty,ed=Object.getOwnPropertyDescriptor,td=(e,t,n,r)=>{for(var a=r>1?void 0:r?ed(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Qc(t,n,a),a},St=(e,t)=>(n,r)=>t(n,r,e);const yo="sheet.conditional.formatting.panel";let Mt=class extends m.Disposable{constructor(t,n,r,a,o,i){super();Ge(this,"_sidebarDisposable",null);this._univerInstanceService=t,this._injector=n,this._componentManager=r,this._menuService=a,this._sidebarService=o,this._localeService=i,this._initMenu(),this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(m.UniverInstanceType.UNIVER_SHEET).subscribe(u=>{var l;u||(l=this._sidebarDisposable)==null||l.dispose()}))}openPanel(t){const n={header:{title:this._localeService.t("sheet.cf.title")},children:{label:yo,rule:t},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(n)}_initMenu(){this._menuService.addMenuItem(qo(this._componentManager)(this._injector))}_initPanel(){this._componentManager.register(yo,Jc)}};Mt=td([m.OnLifecycle(m.LifecycleStages.Ready,Mt),St(0,m.IUniverInstanceService),St(1,V.Inject(V.Injector)),St(2,V.Inject(ve.ComponentManager)),St(3,V.Inject(ve.IMenuService)),St(4,V.Inject(ve.ISidebarService)),St(5,V.Inject(m.LocaleService))],Mt);var Ie=(e=>(e[e.createRule=1]="createRule",e[e.viewRule=2]="viewRule",e[e.highlightCell=3]="highlightCell",e[e.rank=4]="rank",e[e.formula=5]="formula",e[e.colorScale=6]="colorScale",e[e.dataBar=7]="dataBar",e[e.icon=8]="icon",e[e.clearRangeRules=9]="clearRangeRules",e[e.clearWorkSheetRules=10]="clearWorkSheetRules",e))(Ie||{});const So={id:"sheet.operation.open.conditional.formatting.panel",type:m.CommandType.OPERATION,handler:(e,t)=>{const n=e.get(Mt),r=e.get(H.SelectionManagerService),a=e.get(m.ICommandService),o=r.getSelectionRanges()||[];switch(t.value){case 3:{n.openPanel({...s.createDefaultRule(),ranges:o});break}case 4:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank}};n.openPanel(u);break}case 5:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.formula,value:"="}};n.openPanel(u);break}case 6:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.colorScale,config:[]}};n.openPanel(u);break}case 7:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.dataBar,isShowValue:!0}};n.openPanel(u);break}case 8:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.iconSet,config:[],isShowValue:!0}};n.openPanel(u);break}case 2:{n.openPanel();break}case 1:{n.openPanel({...s.createDefaultRule(),ranges:o});break}case 9:{a.executeCommand(Ir.id,{ranges:o});break}case 10:{a.executeCommand(Tn.id);break}}return!0}};var nd=Object.defineProperty,rd=Object.getOwnPropertyDescriptor,ad=(e,t,n,r)=>{for(var a=r>1?void 0:r?rd(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&nd(t,n,a),a},st=(e,t)=>(n,r)=>t(n,r,e);let mn=class extends m.Disposable{constructor(e,t,n,r,a,o,i){super(),this._sheetInterceptorService=e,this._conditionalFormattingService=t,this._univerInstanceService=n,this._renderManagerService=r,this._conditionalFormattingViewModel=a,this._conditionalFormattingRuleModel=o,this._sheetSkeletonManagerService=i,this._initViewModelInterceptor(),this._initSkeleton(),this._initRender()}_initRender(){const e=[[s.dataBarUKey,s.DataBar],[s.IconUKey,s.ConditionalFormattingIcon]],t=r=>{const a=r&&this._renderManagerService.getRenderById(r),o=a&&a.mainComponent;o&&e.forEach(([i,u])=>{o.getExtensionByKey(i)||o.register(new u)})};this.disposeWithMe(this._renderManagerService.currentRender$.subscribe(r=>{r&&t(r)}));const n=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);n&&t(n.getUnitId())}_initSkeleton(){const e=()=>{var n,r;this._sheetSkeletonManagerService.reCalculate();const t=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=(n=this._renderManagerService.getRenderById(t))==null?void 0:n.mainComponent)==null||r.makeDirty()};this.disposeWithMe(this._conditionalFormattingViewModel.markDirty$.pipe(Ee.bufferTime(16),Ee.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return t.filter(a=>a.unitId===n.getUnitId()&&a.subUnitId===r.getSheetId()).length>0})).subscribe(e)),this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.pipe(Ee.bufferTime(16),Ee.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return t.filter(a=>["sort","delete"].includes(a.type)&&a.unitId===n.getUnitId()&&a.subUnitId===r.getSheetId()).length>0})).subscribe(e)),this.disposeWithMe(this._conditionalFormattingService.ruleComputeStatus$.pipe(Ee.bufferTime(16),Ee.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return t.filter(a=>a.unitId===n.getUnitId()&&a.subUnitId===r.getSheetId()).length>0})).subscribe(e))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(H.INTERCEPTOR_POINT.CELL_CONTENT,{handler:(e,t,n)=>{const r=this._conditionalFormattingService.composeStyle(t.unitId,t.subUnitId,t.row,t.col);if(!r)return n(e);const a=t.workbook.getStyles(),i={...(typeof(e==null?void 0:e.s)=="string"?a.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},u={...e,s:i};return r.style&&Object.assign(i,r.style),u.fontRenderExtension||(u.fontRenderExtension={},r.isShowValue!==void 0&&(u.fontRenderExtension.isSkip=!r.isShowValue)),r.dataBar&&(u.dataBar=r.dataBar),r.iconSet&&(u.iconSet=r.iconSet,u.fontRenderExtension.leftOffset=s.DEFAULT_PADDING+s.DEFAULT_WIDTH),n(u)}}))}};mn=ad([m.OnLifecycle(m.LifecycleStages.Rendered,mn),st(0,V.Inject(H.SheetInterceptorService)),st(1,V.Inject(s.ConditionalFormattingService)),st(2,V.Inject(m.IUniverInstanceService)),st(3,V.Inject(wo.IRenderManagerService)),st(4,V.Inject(s.ConditionalFormattingViewModel)),st(5,V.Inject(s.ConditionalFormattingRuleModel)),st(6,V.Inject(le.SheetSkeletonManagerService))],mn);var od=Object.defineProperty,id=Object.getOwnPropertyDescriptor,sd=(e,t,n,r)=>{for(var a=r>1?void 0:r?id(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&od(t,n,a),a},Dt=(e,t)=>(n,r)=>t(n,r,e);let gn=class extends m.Disposable{constructor(t,n,r,a,o){super();Ge(this,"_copyInfo");this._sheetClipboardService=t,this._conditionalFormattingRuleModel=n,this._injector=r,this._conditionalFormattingViewModel=a,this._univerInstanceService=o,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:s.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(t,n,r)=>this._collectConditionalRule(t,n,r),onPasteCells:(t,n,r,a)=>{const{copyType:o=le.COPY_TYPE.COPY,pasteType:i}=a,{range:u}=t||{},{range:l}=n;return this._generateConditionalFormattingMutations(l,{copyType:o,pasteType:i,copyRange:u})}}))}_collectConditionalRule(t,n,r){const a=new m.ObjectMatrix,o={};this._copyInfo={matrix:a,info:{unitId:t,subUnitId:n,cfMap:o}};const i=this._conditionalFormattingViewModel.getMatrix(t,n);if(!i)return;const u={get:this._injector.get.bind(this._injector)},l=le.rangeToDiscreteRange(r,u,t,n);if(!l)return;const{rows:c,cols:d}=l,h=new Set;c.forEach((f,v)=>{d.forEach((y,T)=>{const x=this._conditionalFormattingViewModel.getCellCf(t,n,f,y,i);x&&(x.cfList.forEach(w=>h.add(w.cfId)),a.setValue(v,T,x.cfList.map(w=>w.cfId)))})}),h.forEach(f=>{const v=this._conditionalFormattingRuleModel.getRule(t,n,f);v&&(o[f]=v.rule)})}_generateConditionalFormattingMutations(t,n){const r=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),a=r.getActiveSheet(),o=r.getUnitId(),i=a.getSheetId();if(n.copyType===le.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!n.copyRange)return{redos:[],undos:[]};if(![le.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,le.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,le.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(n.pasteType))return{redos:[],undos:[]};const{ranges:[u,l],mapFunc:c}=le.virtualizeDiscreteRanges([n.copyRange,t]),d=le.getRepeatRange(u,l,!0),h=this._conditionalFormattingViewModel.getMatrix(o,i),f={};m.Range.foreach(l,(g,O)=>{const{row:M,col:I}=c(g,O),j=this._conditionalFormattingViewModel.getCellCf(o,i,M,I,h);j&&j.cfList.forEach(L=>{if(!f[L.cfId]){const U=new m.ObjectMatrix;f[L.cfId]=U;const F=this._conditionalFormattingRuleModel.getRule(o,i,L.cfId);F==null||F.ranges.forEach(R=>{m.Range.foreach(R,(E,J)=>{U.setValue(E,J,1)})})}f[L.cfId].realDeleteValue(M,I)})});const{matrix:v,info:y}=this._copyInfo,T=[];let x=this._conditionalFormattingRuleModel.createCfId(o,i);const w={},b=g=>{if(w[g])return w[g];const O=y==null?void 0:y.cfMap[g],M=[...this._conditionalFormattingRuleModel.getSubunitRules(o,i)||[],...T].find(I=>m.Tools.diffValue(I.rule,O));if(M)return w[g]=M,M;{const I={rule:O,cfId:x,ranges:[],stopIfTrue:!1};return w[g]=I,T.push(I),x=`${Number(x)+1}`,I}};d.forEach(g=>{v&&v.forValue((O,M,I)=>{const j=m.Rectangle.getPositionRange({startRow:O,endRow:O,startColumn:M,endColumn:M},g.startRange),{row:L,col:U}=c(j.startRow,j.startColumn);I.forEach(F=>{if(!f[F]){const R=b(F),E=new m.ObjectMatrix;f[F]=E,R.ranges.forEach(J=>{m.Range.foreach(J,(be,z)=>{E.setValue(be,z,1)})})}f[F].setValue(L,U,1)})})});const S=[],C=[];for(const g in f){const O=f[g],M=H.findAllRectangle(H.createTopMatrixFromMatrix(O));if(!M.length){const I={unitId:o,subUnitId:i,cfId:g};S.push({id:s.DeleteConditionalRuleMutation.id,params:I}),C.push(...s.DeleteConditionalRuleMutationUndoFactory(this._injector,I))}if(T.some(I=>I.cfId===g)){const I=b(g),j={unitId:o,subUnitId:i,rule:{...I,ranges:M}};S.push({id:s.AddConditionalRuleMutation.id,params:j}),C.push(s.AddConditionalRuleMutationUndoFactory(this._injector,j))}else{const I=this._conditionalFormattingRuleModel.getRule(o,i,g);if(!I)continue;const j={unitId:o,subUnitId:i,rule:{...I,ranges:M}};S.push({id:s.SetConditionalRuleMutation.id,params:j}),C.push(...s.setConditionalRuleMutationUndoFactory(this._injector,j))}}return{redos:S,undos:C}}};gn=sd([m.OnLifecycle(m.LifecycleStages.Rendered,gn),Dt(0,V.Inject(le.ISheetClipboardService)),Dt(1,V.Inject(s.ConditionalFormattingRuleModel)),Dt(2,V.Inject(V.Injector)),Dt(3,V.Inject(s.ConditionalFormattingViewModel)),Dt(4,V.Inject(m.IUniverInstanceService))],gn);var ld=Object.defineProperty,ud=Object.getOwnPropertyDescriptor,cd=(e,t,n,r)=>{for(var a=r>1?void 0:r?ud(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&ld(t,n,a),a},Pt=(e,t)=>(n,r)=>t(n,r,e);let vn=class extends m.Disposable{constructor(e,t,n,r,a){super(),this._injector=e,this._univerInstanceService=t,this._autoFillService=n,this._conditionalFormattingRuleModel=r,this._conditionalFormattingViewModel=a,this._initAutoFill()}_initAutoFill(){const e=()=>({redos:[],undos:[]}),t=(a,o,i,u,l)=>{const c=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),d=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),h={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},f={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row};m.Range.foreach(i,(v,y)=>{const T=m.Rectangle.getPositionRange({startRow:v,startColumn:y,endColumn:y,endRow:v},h),x=m.Rectangle.getPositionRange({startRow:v,startColumn:y,endColumn:y,endRow:v},f),{row:w,col:b}=l(T.startRow,T.startColumn),S=this._conditionalFormattingViewModel.getCellCf(c,d,w,b),{row:C,col:g}=l(x.startRow,x.startColumn),O=this._conditionalFormattingViewModel.getCellCf(c,d,C,g);O&&O.cfList.forEach(M=>{let I=u.get(M.cfId);if(!u.get(M.cfId)){const j=this._conditionalFormattingRuleModel.getRule(c,d,M.cfId);if(!j)return;I=new m.ObjectMatrix,j.ranges.forEach(L=>{m.Range.foreach(L,(U,F)=>{I.setValue(U,F,1)})}),u.set(M.cfId,I)}I.realDeleteValue(C,g)}),S&&S.cfList.forEach(M=>{let I=u.get(M.cfId);if(!u.get(M.cfId)){const j=this._conditionalFormattingRuleModel.getRule(c,d,M.cfId);if(!j)return;I=new m.ObjectMatrix,j.ranges.forEach(L=>{m.Range.foreach(L,(U,F)=>{I.setValue(U,F,1)})}),u.set(M.cfId,I)}I.setValue(C,g,1)})})},n=(a,o)=>{var w,b;const i=(w=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:w.getUnitId(),u=(b=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:b.getActiveSheet().getSheetId(),l=new Map,c=[],d=[];if(!i||!u)return e();const h=le.virtualizeDiscreteRanges([a,o]),[f,v]=h.ranges,{mapFunc:y}=h,T={row:f.startRow,col:f.startColumn};return le.getAutoFillRepeatRange(f,v).forEach(S=>{t(T,S.repeatStartCell,S.relativeRange,l,y)}),l.forEach((S,C)=>{const g=this._conditionalFormattingRuleModel.getRule(i,u,C);if(!g)return;const O=H.findAllRectangle(H.createTopMatrixFromMatrix(S)),M={unitId:i,subUnitId:u,rule:{...g,ranges:O}};c.push({id:s.SetConditionalRuleMutation.id,params:M}),d.push(...s.setConditionalRuleMutationUndoFactory(this._injector,M))}),{undos:d,redos:c}},r={id:s.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(a,o,i)=>{if(i===le.APPLY_TYPE.COPY||i===le.APPLY_TYPE.ONLY_FORMAT||i===le.APPLY_TYPE.SERIES){const{source:u,target:l}=a;return n(u,l)}return e()}};this.disposeWithMe(this._autoFillService.addHook(r))}};vn=cd([m.OnLifecycle(m.LifecycleStages.Rendered,vn),Pt(0,V.Inject(V.Injector)),Pt(1,V.Inject(m.IUniverInstanceService)),Pt(2,V.Inject(le.IAutoFillService)),Pt(3,V.Inject(s.ConditionalFormattingRuleModel)),Pt(4,V.Inject(s.ConditionalFormattingViewModel))],vn);var dd=Object.defineProperty,fd=Object.getOwnPropertyDescriptor,pd=(e,t,n,r)=>{for(var a=r>1?void 0:r?fd(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&dd(t,n,a),a},Nt=(e,t)=>(n,r)=>t(n,r,e);let yn=class extends m.Disposable{constructor(e,t,n,r,a){super(),this._conditionalFormattingRuleModel=e,this._univerInstanceService=t,this._injector=n,this._sheetSkeletonManagerService=r,this._refRangeService=a,this._initRefRange()}_initRefRange(){const e=new Map,t=(r,a,o)=>`${r}_${a}_${o}`,n=(r,a,o)=>{const i=l=>{const c=[...o.ranges],d=c.map(f=>H.handleDefaultRangeChangeWithEffectRefCommands(f,l)).filter(f=>!!f);if(s.isRangesEqual(d,c))return{redos:[],undos:[]};if(d.length){const f={unitId:r,subUnitId:a,rule:{...o,ranges:d}},v=[{id:s.SetConditionalRuleMutation.id,params:f}],y=s.setConditionalRuleMutationUndoFactory(this._injector,f);return{redos:v,undos:y}}else{const f={unitId:r,subUnitId:a,cfId:o.cfId},v=[{id:s.DeleteConditionalRuleMutation.id,params:f}],y=s.DeleteConditionalRuleMutationUndoFactory(this._injector,f);return{redos:v,undos:y}}},u=[];o.ranges.forEach(l=>{const c=this._refRangeService.registerRefRange(l,i);u.push(()=>c.dispose())}),e.set(t(r,a,o.cfId),()=>u.forEach(l=>l()))};this.disposeWithMe(Ce.merge(this._sheetSkeletonManagerService.currentSkeleton$.pipe(Ee.map(r=>r==null?void 0:r.sheetId),Ee.distinctUntilChanged())).pipe(Ee.switchMap(()=>new Ce.Observable(r=>{const a=new m.DisposableCollection;return r.next(a),()=>{a.dispose()}}))).subscribe(r=>{r.add(m.toDisposable(this._conditionalFormattingRuleModel.$ruleChange.subscribe(a=>{const{unitId:o,subUnitId:i,rule:u}=a,l=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),c=l.getActiveSheet();if(!(a.unitId!==l.getUnitId()||a.subUnitId!==c.getSheetId()))switch(a.type){case"add":{n(a.unitId,a.subUnitId,a.rule);break}case"delete":{const d=e.get(t(o,i,u.cfId));d&&d();break}case"set":{const d=e.get(t(o,i,u.cfId));d&&d(),n(a.unitId,a.subUnitId,a.rule)}}})))})),this.disposeWithMe(m.toDisposable(()=>{e.forEach(r=>{r()}),e.clear()}))}};yn=pd([m.OnLifecycle(m.LifecycleStages.Rendered,yn),Nt(0,V.Inject(s.ConditionalFormattingRuleModel)),Nt(1,V.Inject(m.IUniverInstanceService)),Nt(2,V.Inject(V.Injector)),Nt(3,V.Inject(le.SheetSkeletonManagerService)),Nt(4,V.Inject(H.RefRangeService))],yn);var hd=Object.defineProperty,md=Object.getOwnPropertyDescriptor,gd=(e,t,n,r)=>{for(var a=r>1?void 0:r?md(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&hd(t,n,a),a},bo=(e,t)=>(n,r)=>t(n,r,e);let Sn=class extends m.Disposable{constructor(e,t){super(),this._editorBridgeService=e,this._conditionalFormattingService=t,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(m.toDisposable(this._editorBridgeService.interceptor.intercept(this._editorBridgeService.interceptor.getInterceptPoints().AFTER_CELL_EDIT,{handler:(e,t,n)=>{const r=this._conditionalFormattingService.composeStyle(t.unitId,t.subUnitId,t.row,t.col);if(r!=null&&r.style&&(e!=null&&e.p)){const a=Object.keys(r==null?void 0:r.style);if(a.length>0){const o=s.getStringFromDataStream(e.p),i={...(typeof e.s=="string"?t.workbook.getStyles().get(e.s):e.s)||{}};a.forEach(l=>{delete i[l]});const u={...e,s:{...i},v:o};return delete u.p,n(u)}}return n(e)}})))}};Sn=gd([m.OnLifecycle(m.LifecycleStages.Rendered,Sn),bo(0,V.Inject(le.IEditorBridgeService)),bo(1,V.Inject(s.ConditionalFormattingService))],Sn);var vd=Object.defineProperty,yd=Object.getOwnPropertyDescriptor,Sd=(e,t,n,r)=>{for(var a=r>1?void 0:r?yd(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&vd(t,n,a),a},jt=(e,t)=>(n,r)=>t(n,r,e);let bn=class extends m.Disposable{constructor(e,t,n,r,a){super(),this._injector=e,this._univerInstanceService=t,this._sheetInterceptorService=n,this._selectionManagerService=r,this._conditionalFormattingRuleModel=a,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{const t=[],n=[],r={redos:t,undos:n};if([H.ClearSelectionFormatCommand.id,H.ClearSelectionAllCommand.id].includes(e.id)){const a=this._selectionManagerService.getSelectionRanges();if(!a)return r;const o=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),i=o.getActiveSheet(),u=this._conditionalFormattingRuleModel.getSubunitRules(o.getUnitId(),i.getSheetId());if(!u||!u.length)return r;u.filter(l=>a.some(c=>l.ranges.some(d=>m.Rectangle.getIntersects(d,c)))).forEach(l=>{const d=new H.RangeMergeUtil().add(...l.ranges).subtract(...a).merge();if(d.length){const h={id:s.SetConditionalRuleMutation.id,params:{unitId:o.getUnitId(),subUnitId:i.getSheetId(),rule:{...l,ranges:d}}},f=s.setConditionalRuleMutationUndoFactory(this._injector,h.params);t.push(h),n.push(...f)}else{const h={id:s.DeleteConditionalRuleMutation.id,params:{unitId:o.getUnitId(),subUnitId:i.getSheetId(),cfId:l.cfId}},f=s.DeleteConditionalRuleMutationUndoFactory(this._injector,h.params);t.push(h),n.push(...f)}})}return r}}))}};bn=Sd([m.OnLifecycle(m.LifecycleStages.Rendered,bn),jt(0,V.Inject(V.Injector)),jt(1,V.Inject(m.IUniverInstanceService)),jt(2,V.Inject(H.SheetInterceptorService)),jt(3,V.Inject(H.SelectionManagerService)),jt(4,V.Inject(s.ConditionalFormattingRuleModel))],bn);var bd=Object.defineProperty,Td=Object.getOwnPropertyDescriptor,Rd=(e,t,n,r)=>{for(var a=r>1?void 0:r?Td(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&bd(t,n,a),a},To=(e,t)=>(n,r)=>t(n,r,e);X.UniverSheetsConditionalFormattingUIPlugin=(Lt=class extends m.Plugin{constructor(t,n,r){super(),this._injector=n,this._commandService=r,this._initCommand(),s.SheetsConditionalFormattingPlugin.dependencyList.forEach(a=>{this._injector.add(a)}),this._injector.add([mn]),this._injector.add([yn]),this._injector.add([gn]),this._injector.add([vn]),this._injector.add([Mt]),this._injector.add([xt]),this._injector.add([Sn]),this._injector.add([bn])}_initCommand(){[...s.SheetsConditionalFormattingPlugin.mutationList,...X.UniverSheetsConditionalFormattingUIPlugin.commandList].forEach(t=>{this._commandService.registerCommand(t)})}},Ge(Lt,"pluginName",s.SHEET_CONDITIONAL_FORMATTING_PLUGIN),Ge(Lt,"type",m.UniverInstanceType.UNIVER_SHEET),Ge(Lt,"commandList",[_o,Io,xo,Oo,Eo,Mo,Do,Po,No,So,dr,Aa,La,za,Ir,Tn]),Lt),X.UniverSheetsConditionalFormattingUIPlugin=Rd([To(1,V.Inject(V.Injector)),To(2,V.Inject(m.ICommandService))],X.UniverSheetsConditionalFormattingUIPlugin),X.enUS=Dl,X.ruRU=Pl,X.zhCN=Va,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})});
|
|
11
|
+
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&la(e.body,"react-draggable-transparent-selection")}function $i(e){if(e)try{if(e.body&&ua(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function la(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function ua(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var ke={};Object.defineProperty(ke,"__esModule",{value:!0}),ke.canDragX=Gi,ke.canDragY=qi,ke.createCoreData=Yi,ke.createDraggableData=Ki,ke.getBoundPosition=Bi,ke.getControlPosition=Xi,ke.snapToGrid=Fi;var xe=Ue,ft=oe;function Bi(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:Zi(r);const a=Bn(e);if(typeof r=="string"){const{ownerDocument:o}=a,i=o.defaultView;let u;if(r==="parent"?u=a.parentNode:u=o.querySelector(r),!(u instanceof i.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=u,c=i.getComputedStyle(a),d=i.getComputedStyle(l);r={left:-a.offsetLeft+(0,xe.int)(d.paddingLeft)+(0,xe.int)(c.marginLeft),top:-a.offsetTop+(0,xe.int)(d.paddingTop)+(0,xe.int)(c.marginTop),right:(0,ft.innerWidth)(l)-(0,ft.outerWidth)(a)-a.offsetLeft+(0,xe.int)(d.paddingRight)-(0,xe.int)(c.marginRight),bottom:(0,ft.innerHeight)(l)-(0,ft.outerHeight)(a)-a.offsetTop+(0,xe.int)(d.paddingBottom)-(0,xe.int)(c.marginBottom)}}return(0,xe.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,xe.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,xe.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,xe.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function Fi(e,t,n){const r=Math.round(t/e[0])*e[0],a=Math.round(n/e[1])*e[1];return[r,a]}function Gi(e){return e.props.axis==="both"||e.props.axis==="x"}function qi(e){return e.props.axis==="both"||e.props.axis==="y"}function Xi(e,t,n){const r=typeof t=="number"?(0,ft.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const a=Bn(n),o=n.props.offsetParent||a.offsetParent||a.ownerDocument.body;return(0,ft.offsetXYFromParent)(r||e,o,n.props.scale)}function Yi(e,t,n){const r=!(0,xe.isNum)(e.lastX),a=Bn(e);return r?{node:a,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:a,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function Ki(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function Zi(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Bn(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Gt={},qt={};Object.defineProperty(qt,"__esModule",{value:!0}),qt.default=Ji;function Ji(){}Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.default=void 0;var Fn=es(I),Re=qn(Xe),Qi=qn(Er),me=oe,Ye=ke,Gn=Ue,xt=qn(qt);function qn(e){return e&&e.__esModule?e:{default:e}}function ca(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ca=function(r){return r?n:t})(e)}function es(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ca(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function be(e,t,n){return t=ts(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ts(e){var t=ns(e,"string");return typeof t=="symbol"?t:String(t)}function ns(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Me={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Ke=Me.mouse,Xt=class extends Fn.Component{constructor(){super(...arguments),be(this,"dragging",!1),be(this,"lastX",NaN),be(this,"lastY",NaN),be(this,"touchIdentifier",null),be(this,"mounted",!1),be(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,me.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,me.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const a=(0,me.getTouchIdentifier)(t);this.touchIdentifier=a;const o=(0,Ye.getControlPosition)(t,a,this);if(o==null)return;const{x:i,y:u}=o,l=(0,Ye.createCoreData)(this,i,u);(0,xt.default)("DraggableCore: handleDragStart: %j",l),(0,xt.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,me.addUserSelectStyles)(r),this.dragging=!0,this.lastX=i,this.lastY=u,(0,me.addEvent)(r,Ke.move,this.handleDrag),(0,me.addEvent)(r,Ke.stop,this.handleDragStop))}),be(this,"handleDrag",t=>{const n=(0,Ye.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:a}=n;if(Array.isArray(this.props.grid)){let u=r-this.lastX,l=a-this.lastY;if([u,l]=(0,Ye.snapToGrid)(this.props.grid,u,l),!u&&!l)return;r=this.lastX+u,a=this.lastY+l}const o=(0,Ye.createCoreData)(this,r,a);if((0,xt.default)("DraggableCore: handleDrag: %j",o),this.props.onDrag(t,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=a}),be(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,Ye.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:a}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=a-this.lastY||0;[l,c]=(0,Ye.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,a=this.lastY+c}const o=(0,Ye.createCoreData)(this,r,a);if(this.props.onStop(t,o)===!1||this.mounted===!1)return!1;const u=this.findDOMNode();u&&this.props.enableUserSelectHack&&(0,me.removeUserSelectStyles)(u.ownerDocument),(0,xt.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,u&&((0,xt.default)("DraggableCore: Removing handlers"),(0,me.removeEvent)(u.ownerDocument,Ke.move,this.handleDrag),(0,me.removeEvent)(u.ownerDocument,Ke.stop,this.handleDragStop))}),be(this,"onMouseDown",t=>(Ke=Me.mouse,this.handleDragStart(t))),be(this,"onMouseUp",t=>(Ke=Me.mouse,this.handleDragStop(t))),be(this,"onTouchStart",t=>(Ke=Me.touch,this.handleDragStart(t))),be(this,"onTouchEnd",t=>(Ke=Me.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,me.addEvent)(t,Me.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,me.removeEvent)(n,Me.mouse.move,this.handleDrag),(0,me.removeEvent)(n,Me.touch.move,this.handleDrag),(0,me.removeEvent)(n,Me.mouse.stop,this.handleDragStop),(0,me.removeEvent)(n,Me.touch.stop,this.handleDragStop),(0,me.removeEvent)(t,Me.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,me.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:Qi.default.findDOMNode(this)}render(){return Fn.cloneElement(Fn.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Gt.default=Xt,be(Xt,"displayName","DraggableCore"),be(Xt,"propTypes",{allowAnyClick:Re.default.bool,children:Re.default.node.isRequired,disabled:Re.default.bool,enableUserSelectHack:Re.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Re.default.arrayOf(Re.default.number),handle:Re.default.string,cancel:Re.default.string,nodeRef:Re.default.object,onStart:Re.default.func,onDrag:Re.default.func,onStop:Re.default.func,onMouseDown:Re.default.func,scale:Re.default.number,className:Gn.dontSetMe,style:Gn.dontSetMe,transform:Gn.dontSetMe}),be(Xt,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=f(I),n=d(Xe),r=d(Er),a=d(qe),o=oe,i=ke,u=Ue,l=d(Gt),c=d(qt);function d(T){return T&&T.__esModule?T:{default:T}}function p(T){if(typeof WeakMap!="function")return null;var S=new WeakMap,R=new WeakMap;return(p=function(g){return g?R:S})(T)}function f(T,S){if(!S&&T&&T.__esModule)return T;if(T===null||typeof T!="object"&&typeof T!="function")return{default:T};var R=p(S);if(R&&R.has(T))return R.get(T);var g={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in T)if(E!=="default"&&Object.prototype.hasOwnProperty.call(T,E)){var w=O?Object.getOwnPropertyDescriptor(T,E):null;w&&(w.get||w.set)?Object.defineProperty(g,E,w):g[E]=T[E]}return g.default=T,R&&R.set(T,g),g}function v(){return v=Object.assign?Object.assign.bind():function(T){for(var S=1;S<arguments.length;S++){var R=arguments[S];for(var g in R)Object.prototype.hasOwnProperty.call(R,g)&&(T[g]=R[g])}return T},v.apply(this,arguments)}function y(T,S,R){return S=b(S),S in T?Object.defineProperty(T,S,{value:R,enumerable:!0,configurable:!0,writable:!0}):T[S]=R,T}function b(T){var S=x(T,"string");return typeof S=="symbol"?S:String(S)}function x(T,S){if(typeof T!="object"||T===null)return T;var R=T[Symbol.toPrimitive];if(R!==void 0){var g=R.call(T,S||"default");if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(T)}class _ extends t.Component{static getDerivedStateFromProps(S,R){let{position:g}=S,{prevPropsPosition:O}=R;return g&&(!O||g.x!==O.x||g.y!==O.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:g,prevPropsPosition:O}),{x:g.x,y:g.y,prevPropsPosition:{...g}}):null}constructor(S){super(S),y(this,"onDragStart",(R,g)=>{if((0,c.default)("Draggable: onDragStart: %j",g),this.props.onStart(R,(0,i.createDraggableData)(this,g))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),y(this,"onDrag",(R,g)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",g);const O=(0,i.createDraggableData)(this,g),E={x:O.x,y:O.y,slackX:0,slackY:0};if(this.props.bounds){const{x:j,y:L}=E;E.x+=this.state.slackX,E.y+=this.state.slackY;const[k,G]=(0,i.getBoundPosition)(this,E.x,E.y);E.x=k,E.y=G,E.slackX=this.state.slackX+(j-E.x),E.slackY=this.state.slackY+(L-E.y),O.x=E.x,O.y=E.y,O.deltaX=E.x-this.state.x,O.deltaY=E.y-this.state.y}if(this.props.onDrag(R,O)===!1)return!1;this.setState(E)}),y(this,"onDragStop",(R,g)=>{if(!this.state.dragging||this.props.onStop(R,(0,i.createDraggableData)(this,g))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",g);const E={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:j,y:L}=this.props.position;E.x=j,E.y=L}this.setState(E)}),this.state={dragging:!1,dragged:!1,x:S.position?S.position.x:S.defaultPosition.x,y:S.position?S.position.y:S.defaultPosition.y,prevPropsPosition:{...S.position},slackX:0,slackY:0,isElementSVG:!1},S.position&&!(S.onDrag||S.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 S,R;return(S=(R=this.props)===null||R===void 0||(R=R.nodeRef)===null||R===void 0?void 0:R.current)!==null&&S!==void 0?S:r.default.findDOMNode(this)}render(){const{axis:S,bounds:R,children:g,defaultPosition:O,defaultClassName:E,defaultClassNameDragging:w,defaultClassNameDragged:j,position:L,positionOffset:k,scale:G,...C}=this.props;let P={},Q=null;const ve=!!!L||this.state.dragging,ye=L||O,je={x:(0,i.canDragX)(this)&&ve?this.state.x:ye.x,y:(0,i.canDragY)(this)&&ve?this.state.y:ye.y};this.state.isElementSVG?Q=(0,o.createSVGTransform)(je,k):P=(0,o.createCSSTransform)(je,k);const z=(0,a.default)(g.props.className||"",E,{[w]:this.state.dragging,[j]:this.state.dragged});return t.createElement(l.default,v({},C,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(g),{className:z,style:{...g.props.style,...P},transform:Q}))}}e.default=_,y(_,"displayName","Draggable"),y(_,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:u.dontSetMe,style:u.dontSetMe,transform:u.dontSetMe}),y(_,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(na);const{default:da,DraggableCore:rs}=na;Bt.exports=da,Bt.exports.default=da,Bt.exports.DraggableCore=rs;var fa=Bt.exports,Yt={exports:{}},Ot={},Xn={};Xn.__esModule=!0,Xn.cloneElement=us;var as=os(I);function os(e){return e&&e.__esModule?e:{default:e}}function pa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ha(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pa(Object(n),!0).forEach(function(r){is(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pa(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function is(e,t,n){return t=ss(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ss(e){var t=ls(e,"string");return typeof t=="symbol"?t:String(t)}function ls(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function us(e,t){return t.style&&e.props.style&&(t.style=ha(ha({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),as.default.cloneElement(e,t)}var Et={};Et.__esModule=!0,Et.resizableProps=void 0;var H=cs(Xe);function cs(e){return e&&e.__esModule?e:{default:e}}var ds={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 t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(a.axis==="both"||a.axis==="y"){var o;return(o=H.default.number).isRequired.apply(o,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 t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(a.axis==="both"||a.axis==="x"){var o;return(o=H.default.number).isRequired.apply(o,n)}return H.default.number.apply(H.default,n)}};Et.resizableProps=ds,Ot.__esModule=!0,Ot.default=void 0;var Pt=gs(I),fs=fa,ps=Xn,hs=Et,ms=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function ma(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ma=function(a){return a?n:t})(e)}function gs(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ma(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Yn(){return Yn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yn.apply(this,arguments)}function vs(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function ga(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Kn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ga(Object(n),!0).forEach(function(r){ys(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ga(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ys(e,t,n){return t=Ss(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ss(e){var t=bs(e,"string");return typeof t=="symbol"?t:String(t)}function bs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ts(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Zn(e,t)}function Zn(e,t){return Zn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Zn(e,t)}var Jn=function(e){Ts(t,e);function t(){for(var r,a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return r=e.call.apply(e,[this].concat(o))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(a,o){var i=this.props,u=i.minConstraints,l=i.maxConstraints,c=i.lockAspectRatio;if(!u&&!l&&!c)return[a,o];if(c){var d=this.props.width/this.props.height,p=a-this.props.width,f=o-this.props.height;Math.abs(p)>Math.abs(f*d)?o=a/d:a=o*d}var v=a,y=o,b=this.slack||[0,0],x=b[0],_=b[1];return a+=x,o+=_,u&&(a=Math.max(u[0],a),o=Math.max(u[1],o)),l&&(a=Math.min(l[0],a),o=Math.min(l[1],o)),this.slack=[x+(v-a),_+(y-o)],[a,o]},n.resizeHandler=function(a,o){var i=this;return function(u,l){var c=l.node,d=l.deltaX,p=l.deltaY;a==="onResizeStart"&&i.resetData();var f=(i.props.axis==="both"||i.props.axis==="x")&&o!=="n"&&o!=="s",v=(i.props.axis==="both"||i.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!f&&!v)){var y=o[0],b=o[o.length-1],x=c.getBoundingClientRect();if(i.lastHandleRect!=null){if(b==="w"){var _=x.left-i.lastHandleRect.left;d+=_}if(y==="n"){var T=x.top-i.lastHandleRect.top;p+=T}}i.lastHandleRect=x,b==="w"&&(d=-d),y==="n"&&(p=-p);var S=i.props.width+(f?d/i.props.transformScale:0),R=i.props.height+(v?p/i.props.transformScale:0),g=i.runConstraints(S,R);S=g[0],R=g[1];var O=S!==i.props.width||R!==i.props.height,E=typeof i.props[a]=="function"?i.props[a]:null,w=a==="onResize"&&!O;E&&!w&&(u.persist==null||u.persist(),E(u,{node:c,size:{width:S,height:R},handle:o})),a==="onResizeStop"&&i.resetData()}}},n.renderResizeHandle=function(a,o){var i=this.props.handle;if(!i)return Pt.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+a,ref:o});if(typeof i=="function")return i(a,o);var u=typeof i.type=="string",l=Kn({ref:o},u?{}:{handleAxis:a});return Pt.cloneElement(i,l)},n.render=function(){var a=this,o=this.props,i=o.children,u=o.className,l=o.draggableOpts;o.width,o.height,o.handle,o.handleSize,o.lockAspectRatio,o.axis,o.minConstraints,o.maxConstraints,o.onResize,o.onResizeStop,o.onResizeStart;var c=o.resizeHandles;o.transformScale;var d=vs(o,ms);return(0,ps.cloneElement)(i,Kn(Kn({},d),{},{className:(u?u+" ":"")+"react-resizable",children:[].concat(i.props.children,c.map(function(p){var f,v=(f=a.handleRefs[p])!=null?f:a.handleRefs[p]=Pt.createRef();return Pt.createElement(fs.DraggableCore,Yn({},l,{nodeRef:v,key:"resizableHandle-"+p,onStop:a.resizeHandler("onResizeStop",p),onStart:a.resizeHandler("onResizeStart",p),onDrag:a.resizeHandler("onResize",p)}),a.renderResizeHandle(p,v))}))}))},t}(Pt.Component);Ot.default=Jn,Jn.propTypes=hs.resizableProps,Jn.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Kt={};Kt.__esModule=!0,Kt.default=void 0;var Qn=Is(I),Rs=va(Xe),Cs=va(Ot),_s=Et,ws=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function va(e){return e&&e.__esModule?e:{default:e}}function ya(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(ya=function(a){return a?n:t})(e)}function Is(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=ya(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function er(){return er=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},er.apply(this,arguments)}function Sa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Zt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Sa(Object(n),!0).forEach(function(r){xs(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sa(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xs(e,t,n){return t=Os(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Os(e){var t=Es(e,"string");return typeof t=="symbol"?t:String(t)}function Es(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ps(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Ds(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,tr(e,t)}function tr(e,t){return tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},tr(e,t)}var ba=function(e){Ds(t,e);function t(){for(var r,a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return r=e.call.apply(e,[this].concat(o))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(u,l){var c=l.size;r.props.onResize?(u.persist==null||u.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(u,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(a,o){return o.propsWidth!==a.width||o.propsHeight!==a.height?{width:a.width,height:a.height,propsWidth:a.width,propsHeight:a.height}:null};var n=t.prototype;return n.render=function(){var a=this.props,o=a.handle,i=a.handleSize;a.onResize;var u=a.onResizeStart,l=a.onResizeStop,c=a.draggableOpts,d=a.minConstraints,p=a.maxConstraints,f=a.lockAspectRatio,v=a.axis;a.width,a.height;var y=a.resizeHandles,b=a.style,x=a.transformScale,_=Ps(a,ws);return Qn.createElement(Cs.default,{axis:v,draggableOpts:c,handle:o,handleSize:i,height:this.state.height,lockAspectRatio:f,maxConstraints:p,minConstraints:d,onResizeStart:u,onResize:this.onResize,onResizeStop:l,resizeHandles:y,transformScale:x,width:this.state.width},Qn.createElement("div",er({},_,{style:Zt(Zt({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Qn.Component);Kt.default=ba,ba.propTypes=Zt(Zt({},_s.resizableProps),{},{children:Rs.default.element}),Yt.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Yt.exports.Resizable=Ot.default,Yt.exports.ResizableBox=Kt.default;var Ms=Yt.exports,Fe={};Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.resizeHandleType=Fe.resizeHandleAxesType=Fe.default=void 0;var $=Ta(Xe),Ns=Ta(I);function Ta(e){return e&&e.__esModule?e:{default:e}}const js=Fe.resizeHandleAxesType=$.default.arrayOf($.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),Ls=Fe.resizeHandleType=$.default.oneOfType([$.default.node,$.default.func]);Fe.default={className:$.default.string,style:$.default.object,width:$.default.number,autoSize:$.default.bool,cols:$.default.number,draggableCancel:$.default.string,draggableHandle:$.default.string,verticalCompact:function(e){e.verticalCompact},compactType:$.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&F.validateLayout(t,"layout")},margin:$.default.arrayOf($.default.number),containerPadding:$.default.arrayOf($.default.number),rowHeight:$.default.number,maxRows:$.default.number,isBounded:$.default.bool,isDraggable:$.default.bool,isResizable:$.default.bool,allowOverlap:$.default.bool,preventCollision:$.default.bool,useCSSTransforms:$.default.bool,transformScale:$.default.number,isDroppable:$.default.bool,resizeHandles:js,resizeHandle:Ls,onLayoutChange:$.default.func,onDragStart:$.default.func,onDrag:$.default.func,onDragStop:$.default.func,onResizeStart:$.default.func,onResize:$.default.func,onResizeStop:$.default.func,onDrop:$.default.func,droppingItem:$.default.shape({i:$.default.string.isRequired,w:$.default.number.isRequired,h:$.default.number.isRequired}),children:function(e,t){const n=e[t],r={};Ns.default.Children.forEach(n,function(a){if((a==null?void 0:a.key)!=null){if(r[a.key])throw new Error('Duplicate child key "'+a.key+'" found! This will cause problems in ReactGridLayout.');r[a.key]=!0}})},innerRef:$.default.any},Object.defineProperty($t,"__esModule",{value:!0}),$t.default=void 0;var pt=nr(I),K=nr(Xe),Vs=fa,Us=Ms,ht=F,he=Ve,Ra=Fe,ks=nr(qe);function nr(e){return e&&e.__esModule?e:{default:e}}function We(e,t,n){return t=Ws(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ws(e){var t=zs(e,"string");return typeof t=="symbol"?t:String(t)}function zs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class rr extends pt.default.Component{constructor(){super(...arguments),We(this,"state",{resizing:null,dragging:null,className:""}),We(this,"elementRef",pt.default.createRef()),We(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:a,transformScale:o}=this.props;if(!a)return;const i={top:0,left:0},{offsetParent:u}=r;if(!u)return;const l=u.getBoundingClientRect(),c=r.getBoundingClientRect(),d=c.left/o,p=l.left/o,f=c.top/o,v=l.top/o;i.left=d-p+u.scrollLeft,i.top=f-v+u.scrollTop,this.setState({dragging:i});const{x:y,y:b}=(0,he.calcXY)(this.getPositionParams(),i.top,i.left,this.props.w,this.props.h);return a.call(this,this.props.i,y,b,{e:t,node:r,newPosition:i})}),We(this,"onDrag",(t,n)=>{let{node:r,deltaX:a,deltaY:o}=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+o,l=this.state.dragging.left+a;const{isBounded:c,i:d,w:p,h:f,containerWidth:v}=this.props,y=this.getPositionParams();if(c){const{offsetParent:S}=r;if(S){const{margin:R,rowHeight:g,containerPadding:O}=this.props,E=S.clientHeight-(0,he.calcGridItemWHPx)(f,g,R[1]);u=(0,he.clamp)(u-O[1],0,E);const w=(0,he.calcGridColWidth)(y),j=v-(0,he.calcGridItemWHPx)(p,w,R[0]);l=(0,he.clamp)(l-O[0],0,j)}}const b={top:u,left:l};this.setState({dragging:b});const{containerPadding:x}=this.props,{x:_,y:T}=(0,he.calcXY)(y,u-x[1],l-x[0],p,f);return i.call(this,d,_,T,{e:t,node:r,newPosition:b})}),We(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:a}=this.props;if(!a)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:o,h:i,i:u,containerPadding:l}=this.props,{left:c,top:d}=this.state.dragging,p={top:d,left:c};this.setState({dragging:null});const{x:f,y:v}=(0,he.calcXY)(this.getPositionParams(),d-l[1],c-l[0],o,i);return a.call(this,u,f,v,{e:t,node:r,newPosition:p})}),We(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),We(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),We(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,he.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),a=(0,he.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,ht.fastPositionEqual)(r,a)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const a=t.droppingPosition||{left:0,top:0},{dragging:o}=this.state,i=o&&n.left!==a.left||n.top!==a.top;if(!o)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(i){const u=n.left-o.left,l=n.top-o.top;this.onDrag(n.e,{node:r,deltaX:u,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:a}=this.props;let o;return a?o=(0,ht.setTransform)(t):(o=(0,ht.setTopLeft)(t),n&&(o.left=(0,ht.perc)(t.left/r),o.width=(0,ht.perc)(t.width/r))),o}mixinDraggable(t,n){return pt.default.createElement(Vs.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,a)=>n(r,a,t)}mixinResizable(t,n,r){const{cols:a,minW:o,minH:i,maxW:u,maxH:l,transformScale:c,resizeHandles:d,resizeHandle:p}=this.props,f=this.getPositionParams(),v=(0,he.calcGridItemPosition)(f,0,0,a,0).width,y=(0,he.calcGridItemPosition)(f,0,0,o,i),b=(0,he.calcGridItemPosition)(f,0,0,u,l),x=[y.width,y.height],_=[Math.min(b.width,v),Math.min(b.height,1/0)];return pt.default.createElement(Us.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:_,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:d,handle:p},t)}onResizeHandler(t,n,r,a){let{node:o,size:i,handle:u}=n;const l=this.props[a];if(!l)return;const{x:c,y:d,i:p,maxH:f,minH:v,containerWidth:y}=this.props,{minW:b,maxW:x}=this.props;let _=i;o&&(_=(0,ht.resizeItemInDirection)(u,r,i,y),this.setState({resizing:a==="onResizeStop"?null:_}));let{w:T,h:S}=(0,he.calcWH)(this.getPositionParams(),_.width,_.height,c,d,u);T=(0,he.clamp)(T,Math.max(b,1),x),S=(0,he.clamp)(S,v,f),l.call(this,p,T,S,{e:t,node:o,size:_,handle:u})}render(){const{x:t,y:n,w:r,h:a,isDraggable:o,isResizable:i,droppingPosition:u,useCSSTransforms:l}=this.props,c=(0,he.calcGridItemPosition)(this.getPositionParams(),t,n,r,a,this.state),d=pt.default.Children.only(this.props.children);let p=pt.default.cloneElement(d,{ref:this.elementRef,className:(0,ks.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":o,"react-draggable-dragging":!!this.state.dragging,dropping:!!u,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(c)}});return p=this.mixinResizable(p,c,i),p=this.mixinDraggable(p,o),p}}$t.default=rr,We(rr,"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(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:K.default.string.isRequired,resizeHandles:Ra.resizeHandleAxesType,resizeHandle:Ra.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})}),We(rr,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(_t,"__esModule",{value:!0}),_t.default=void 0;var nt=Bs(I),ar=En,As=or(qe),A=F,Hs=Ve,Ca=or($t),$s=or(Fe);function or(e){return e&&e.__esModule?e:{default:e}}function _a(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(_a=function(r){return r?n:t})(e)}function Bs(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=_a(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function ge(e,t,n){return t=Fs(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fs(e){var t=Gs(e,"string");return typeof t=="symbol"?t:String(t)}function Gs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const wa="react-grid-layout";let Ia=!1;try{Ia=/firefox/i.test(navigator.userAgent)}catch{}class Jt extends nt.Component{constructor(){super(...arguments),ge(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:[]}),ge(this,"dragEnterCounter",0),ge(this,"onDragStart",(t,n,r,a)=>{let{e:o,node:i}=a;const{layout:u}=this.state,l=(0,A.getLayoutItem)(u,t);if(!l)return;const c={w:l.w,h:l.h,x:l.x,y:l.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,A.cloneLayoutItem)(l),oldLayout:u,activeDrag:c}),this.props.onDragStart(u,l,l,null,o,i)}),ge(this,"onDrag",(t,n,r,a)=>{let{e:o,node:i}=a;const{oldDragItem:u}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:d,preventCollision:p}=this.props,f=(0,A.getLayoutItem)(l,t);if(!f)return;const v={w:f.w,h:f.h,x:f.x,y:f.y,placeholder:!0,i:t};l=(0,A.moveElement)(l,f,n,r,!0,p,(0,A.compactType)(this.props),c,d),this.props.onDrag(l,u,f,v,o,i),this.setState({layout:d?l:(0,A.compact)(l,(0,A.compactType)(this.props),c),activeDrag:v})}),ge(this,"onDragStop",(t,n,r,a)=>{let{e:o,node:i}=a;if(!this.state.activeDrag)return;const{oldDragItem:u}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:d,allowOverlap:p}=this.props,f=(0,A.getLayoutItem)(l,t);if(!f)return;l=(0,A.moveElement)(l,f,n,r,!0,d,(0,A.compactType)(this.props),c,p);const y=p?l:(0,A.compact)(l,(0,A.compactType)(this.props),c);this.props.onDragStop(y,u,f,null,o,i);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:y,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(y,b)}),ge(this,"onResizeStart",(t,n,r,a)=>{let{e:o,node:i}=a;const{layout:u}=this.state,l=(0,A.getLayoutItem)(u,t);l&&(this.setState({oldResizeItem:(0,A.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(u,l,l,null,o,i))}),ge(this,"onResize",(t,n,r,a)=>{let{e:o,node:i,size:u,handle:l}=a;const{oldResizeItem:c}=this.state,{layout:d}=this.state,{cols:p,preventCollision:f,allowOverlap:v}=this.props;let y=!1,b,x,_;const[T,S]=(0,A.withLayoutItem)(d,t,g=>{let O;return x=g.x,_=g.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=g.x+(g.w-n),n=g.x!==x&&x<0?g.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(_=g.y+(g.h-r),r=g.y!==_&&_<0?g.h:r,_=_<0?0:_),y=!0),f&&!v&&(O=(0,A.getAllCollisions)(d,{...g,w:n,h:r,x,y:_}).filter(w=>w.i!==g.i).length>0,O&&(_=g.y,r=g.h,x=g.x,n=g.w,y=!1)),g.w=n,g.h=r,g});if(!S)return;b=T,y&&(b=(0,A.moveElement)(T,S,x,_,!0,this.props.preventCollision,(0,A.compactType)(this.props),p,v));const R={w:S.w,h:S.h,x:S.x,y:S.y,static:!0,i:t};this.props.onResize(b,c,S,R,o,i),this.setState({layout:v?b:(0,A.compact)(b,(0,A.compactType)(this.props),p),activeDrag:R})}),ge(this,"onResizeStop",(t,n,r,a)=>{let{e:o,node:i}=a;const{layout:u,oldResizeItem:l}=this.state,{cols:c,allowOverlap:d}=this.props,p=(0,A.getLayoutItem)(u,t),f=d?u:(0,A.compact)(u,(0,A.compactType)(this.props),c);this.props.onResizeStop(f,l,p,null,o,i);const{oldLayout:v}=this.state;this.setState({activeDrag:null,layout:f,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(f,v)}),ge(this,"onDragOver",t=>{var T;if(t.preventDefault(),t.stopPropagation(),Ia&&!((T=t.nativeEvent.target)!=null&&T.classList.contains(wa)))return!1;const{droppingItem:n,onDropDragOver:r,margin:a,cols:o,rowHeight:i,maxRows:u,width:l,containerPadding:c,transformScale:d}=this.props,p=r==null?void 0:r(t);if(p===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const f={...n,...p},{layout:v}=this.state,y=t.currentTarget.getBoundingClientRect(),b=t.clientX-y.left,x=t.clientY-y.top,_={left:b/d,top:x/d,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:S,top:R}=this.state.droppingPosition;(S!=b||R!=x)&&this.setState({droppingPosition:_})}}else{const S={cols:o,margin:a,maxRows:u,rowHeight:i,containerWidth:l,containerPadding:c||a},R=(0,Hs.calcXY)(S,x,b,f.w,f.h);this.setState({droppingDOMNode:nt.createElement("div",{key:f.i}),droppingPosition:_,layout:[...v,{...f,x:R.x,y:R.y,static:!1,isDraggable:!0}]})}}),ge(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,a=(0,A.compact)(r.filter(o=>o.i!==t.i),(0,A.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:a,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),ge(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),ge(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),ge(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,a=r.find(o=>o.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,a,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,ar.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,A.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,A.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,A.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,A.fastRGLPropsEqual)(this.props,t,ar.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,a=n.layout;this.onLayoutMaybeChanged(r,a)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,A.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,ar.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:a,containerPadding:o,rowHeight:i,maxRows:u,useCSSTransforms:l,transformScale:c}=this.props;return nt.createElement(Ca.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:n,cols:r,margin:a,containerPadding:o||a,maxRows:u,rowHeight:i,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},nt.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,A.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:a,cols:o,margin:i,containerPadding:u,rowHeight:l,maxRows:c,isDraggable:d,isResizable:p,isBounded:f,useCSSTransforms:v,transformScale:y,draggableCancel:b,draggableHandle:x,resizeHandles:_,resizeHandle:T}=this.props,{mounted:S,droppingPosition:R}=this.state,g=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&d,O=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&p,E=r.resizeHandles||_,w=g&&f&&r.isBounded!==!1;return nt.createElement(Ca.default,{containerWidth:a,cols:o,margin:i,containerPadding:u||i,maxRows:c,rowHeight:l,cancel:b,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:g,isResizable:O,isBounded:w,useCSSTransforms:v&&S,usePercentages:!S,transformScale:y,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?R:void 0,resizeHandles:E,resizeHandle:T},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:a}=this.props,o=(0,As.default)(wa,t),i={height:this.containerHeight(),...n};return nt.createElement("div",{ref:a,className:o,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},nt.Children.map(this.props.children,u=>this.processGridItem(u)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}_t.default=Jt,ge(Jt,"displayName","ReactGridLayout"),ge(Jt,"propTypes",$s.default),ge(Jt,"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 Qt={},rt={};Object.defineProperty(rt,"__esModule",{value:!0}),rt.findOrGenerateResponsiveLayout=Ys,rt.getBreakpointFromWidth=qs,rt.getColsFromBreakpoint=Xs,rt.sortBreakpoints=ir;var en=F;function qs(e,t){const n=ir(e);let r=n[0];for(let a=1,o=n.length;a<o;a++){const i=n[a];t>e[i]&&(r=i)}return r}function Xs(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function Ys(e,t,n,r,a,o){if(e[n])return(0,en.cloneLayout)(e[n]);let i=e[r];const u=ir(t),l=u.slice(u.indexOf(n));for(let c=0,d=l.length;c<d;c++){const p=l[c];if(e[p]){i=e[p];break}}return i=(0,en.cloneLayout)(i||[]),(0,en.compact)((0,en.correctBounds)(i,{cols:a}),o,a)}function ir(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.default=void 0;var xa=Zs(I),Ce=Oa(Xe),sr=En,mt=F,at=rt,Ks=Oa(_t);function Oa(e){return e&&e.__esModule?e:{default:e}}function Ea(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Ea=function(r){return r?n:t})(e)}function Zs(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Ea(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function lr(){return lr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lr.apply(this,arguments)}function tn(e,t,n){return t=Js(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Js(e){var t=Qs(e,"string");return typeof t=="symbol"?t:String(t)}function Qs(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Pa=e=>Object.prototype.toString.call(e);function nn(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class ur extends xa.Component{constructor(){super(...arguments),tn(this,"state",this.generateInitialState()),tn(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:a}=this.props,o=(0,at.getBreakpointFromWidth)(n,t),i=(0,at.getColsFromBreakpoint)(o,a),u=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,at.findOrGenerateResponsiveLayout)(r,n,o,o,i,u),breakpoint:o,cols:i}}static getDerivedStateFromProps(t,n){if(!(0,sr.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:a}=n;return{layout:(0,at.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,a,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,sr.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,sr.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:a,compactType:o}=this.props,i=this.props.breakpoint||(0,at.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),u=this.state.breakpoint,l=(0,at.getColsFromBreakpoint)(i,r),c={...a};if(u!==i||t.breakpoints!==n||t.cols!==r){u in c||(c[u]=(0,mt.cloneLayout)(this.state.layout));let f=(0,at.findOrGenerateResponsiveLayout)(c,n,i,u,l,o);f=(0,mt.synchronizeLayoutWithChildren)(f,this.props.children,l,o,this.props.allowOverlap),c[i]=f,this.props.onLayoutChange(f,c),this.props.onBreakpointChange(i,l),this.setState({breakpoint:i,layout:f,cols:l})}const d=nn(this.props.margin,i),p=nn(this.props.containerPadding,i);this.props.onWidthChange(this.props.width,d,l,p)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:a,margin:o,containerPadding:i,onBreakpointChange:u,onLayoutChange:l,onWidthChange:c,...d}=this.props;return xa.createElement(Ks.default,lr({},d,{margin:nn(o,this.state.breakpoint),containerPadding:nn(i,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Qt.default=ur,tn(ur,"propTypes",{breakpoint:Ce.default.string,breakpoints:Ce.default.object,allowOverlap:Ce.default.bool,cols:Ce.default.object,margin:Ce.default.oneOfType([Ce.default.array,Ce.default.object]),containerPadding:Ce.default.oneOfType([Ce.default.array,Ce.default.object]),layouts(e,t){if(Pa(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+Pa(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,mt.validateLayout)(e.layouts[n],"layouts."+n)})},width:Ce.default.number.isRequired,onBreakpointChange:Ce.default.func,onLayoutChange:Ce.default.func,onWidthChange:Ce.default.func}),tn(ur,"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:mt.noop,onLayoutChange:mt.noop,onWidthChange:mt.noop});var cr={},Da=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(a,o){return a[0]===n?(r=o,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),a=this.__entries__[r];return a&&a[1]},t.prototype.set=function(n,r){var a=e(this.__entries__,n);~a?this.__entries__[a][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,a=e(r,n);~a&&r.splice(a,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var a=0,o=this.__entries__;a<o.length;a++){var i=o[a];n.call(r,i[1],i[0])}},t}()}(),dr=typeof window<"u"&&typeof document<"u"&&window.document===document,rn=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")()}(),el=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(rn):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),tl=2;function nl(e,t){var n=!1,r=!1,a=0;function o(){n&&(n=!1,e()),r&&u()}function i(){el(o)}function u(){var l=Date.now();if(n){if(l-a<tl)return;r=!0}else n=!0,r=!1,setTimeout(i,t);a=l}return u}var rl=20,al=["top","right","bottom","left","width","height","size","weight"],ol=typeof MutationObserver<"u",il=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=nl(this.refresh.bind(this),rl)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!dr||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ol?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!dr||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,a=al.some(function(o){return!!~r.indexOf(o)});a&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Ma=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var a=r[n];Object.defineProperty(e,a,{value:t[a],enumerable:!1,writable:!1,configurable:!0})}return e},gt=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||rn},Na=on(0,0,0,0);function an(e){return parseFloat(e)||0}function ja(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,a){var o=e["border-"+a+"-width"];return r+an(o)},0)}function sl(e){for(var t=["top","right","bottom","left"],n={},r=0,a=t;r<a.length;r++){var o=a[r],i=e["padding-"+o];n[o]=an(i)}return n}function ll(e){var t=e.getBBox();return on(0,0,t.width,t.height)}function ul(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Na;var r=gt(e).getComputedStyle(e),a=sl(r),o=a.left+a.right,i=a.top+a.bottom,u=an(r.width),l=an(r.height);if(r.boxSizing==="border-box"&&(Math.round(u+o)!==t&&(u-=ja(r,"left","right")+o),Math.round(l+i)!==n&&(l-=ja(r,"top","bottom")+i)),!dl(e)){var c=Math.round(u+o)-t,d=Math.round(l+i)-n;Math.abs(c)!==1&&(u-=c),Math.abs(d)!==1&&(l-=d)}return on(a.left,a.top,u,l)}var cl=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof gt(e).SVGGraphicsElement}:function(e){return e instanceof gt(e).SVGElement&&typeof e.getBBox=="function"}}();function dl(e){return e===gt(e).document.documentElement}function fl(e){return dr?cl(e)?ll(e):ul(e):Na}function pl(e){var t=e.x,n=e.y,r=e.width,a=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,i=Object.create(o.prototype);return Ma(i,{x:t,y:n,width:r,height:a,top:n,right:t+r,bottom:a+n,left:t}),i}function on(e,t,n,r){return{x:e,y:t,width:n,height:r}}var hl=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=on(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=fl(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),ml=function(){function e(t,n){var r=pl(n);Ma(this,{target:t,contentRect:r})}return e}(),gl=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new Da,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof gt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new hl(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof gt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new ml(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),La=typeof WeakMap<"u"?new WeakMap:new Da,Va=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=il.getInstance(),r=new gl(t,n,this);La.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Va.prototype[e]=function(){var t;return(t=La.get(this))[e].apply(t,arguments)}});var vl=function(){return typeof rn.ResizeObserver<"u"?rn.ResizeObserver:Va}();const yl=Vo(Object.freeze(Object.defineProperty({__proto__:null,default:vl},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(cr,"__esModule",{value:!0}),cr.default=Il;var sn=Rl(I),Sl=fr(Xe),bl=fr(yl),Tl=fr(qe);function fr(e){return e&&e.__esModule?e:{default:e}}function Ua(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Ua=function(r){return r?n:t})(e)}function Rl(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Ua(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var i=a?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function pr(){return pr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pr.apply(this,arguments)}function vt(e,t,n){return t=Cl(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cl(e){var t=_l(e,"string");return typeof t=="symbol"?t:String(t)}function _l(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const wl="react-grid-layout";function Il(e){var t;return t=class extends sn.Component{constructor(){super(...arguments),vt(this,"state",{width:1280}),vt(this,"elementRef",sn.createRef()),vt(this,"mounted",!1),vt(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new bl.default(a=>{if(this.elementRef.current instanceof HTMLElement){const i=a[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,...a}=this.props;return r&&!this.mounted?sn.createElement("div",{className:(0,Tl.default)(this.props.className,wl),style:this.props.style,ref:this.elementRef}):sn.createElement(e,pr({innerRef:this.elementRef},a,this.state))}},vt(t,"defaultProps",{measureBeforeMount:!1}),vt(t,"propTypes",{measureBeforeMount:Sl.default.bool}),t}(function(e){e.exports=_t.default,e.exports.utils=F,e.exports.calculateUtils=Ve,e.exports.Responsive=Qt.default,e.exports.Responsive.utils=rt,e.exports.WidthProvider=cr.default})(zr);var xl=zr.exports;const Ol=wn(xl),hr={type:m.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(e,t){if(!t)return!1;const n=e.get(m.IUndoRedoService),r=e.get(m.ICommandService),a=e.get(m.IUniverInstanceService),o=V.getSheetCommandTarget(a,t);if(!o)return!1;const{unitId:i,subUnitId:u}=o,l={unitId:i,subUnitId:u,cfId:t.cfId},c=s.DeleteConditionalRuleMutationUndoFactory(e,l),d=r.syncExecuteCommand(s.DeleteConditionalRuleMutation.id,l);return d&&n.pushUndoRedo({unitID:i,undoMutations:c,redoMutations:[{id:s.DeleteConditionalRuleMutation.id,params:l}]}),d}},ka={type:m.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(e,t){if(!t)return!1;const n=e.get(m.IUndoRedoService),r=e.get(m.ICommandService),a=e.get(m.IUniverInstanceService),o=e.get(s.ConditionalFormattingRuleModel),i=V.getSheetCommandTarget(a,t);if(!i)return!1;const{unitId:u,subUnitId:l}=i,c=s.transformSupportSymmetryAnchor(t.start,t.end,o.getSubunitRules(u,l)||[],b=>b.cfId);if(!c)return!1;const[d,p]=c,f={unitId:u,subUnitId:l,start:d,end:p},v=s.MoveConditionalRuleMutationUndoFactory(f),y=r.syncExecuteCommand(s.MoveConditionalRuleMutation.id,f);return y&&n.pushUndoRedo({unitID:u,redoMutations:[{id:s.MoveConditionalRuleMutation.id,params:f}],undoMutations:v}),y}},ln={cfPreview:"univer-cf-preview"},yt=e=>{var a,o;const t=e.rule;if(!t)return null;const n=I.useMemo(()=>{if(t.type===s.CFRuleType.colorScale){const i=t.config.map((c,d)=>({color:new m.ColorKit(c.color),value:d})),u=i.length-1;return new Array(5).fill("").map((c,d,p)=>d*u/(p.length-1)).map(c=>s.getColorScaleFromValue(i,c))}return null},[t]),r=I.useMemo(()=>{if(t.type===s.CFRuleType.iconSet)return t.config.map(i=>{const u=s.iconMap[i.iconType];return u&&u[Number(i.iconId)]})},[t]);switch(t.type){case s.CFRuleType.dataBar:{const{isGradient:i}=t.config,u={width:"50%",height:"100%"},l=i?`linear-gradient(to right, ${t.config.positiveColor}, rgb(255 255 255))`:t.config.positiveColor,c=i?`linear-gradient(to right, rgb(255 255 255),${t.config.nativeColor})`:t.config.nativeColor;return h.jsxs("div",{className:ln.cfPreview,children:[h.jsx("div",{style:{...u,background:c,border:`1px solid ${t.config.nativeColor}`}}),h.jsx("div",{style:{...u,background:l,border:`1px solid ${t.config.positiveColor}`}})]})}case s.CFRuleType.colorScale:return n&&h.jsx("div",{className:ln.cfPreview,children:n.map((i,u)=>h.jsx("div",{style:{width:`${100/n.length}%`,height:"100%",background:i}},u))});case s.CFRuleType.iconSet:return r&&h.jsx("div",{className:ln.cfPreview,children:r.map((i,u)=>i?h.jsx("img",{style:{height:"100%"},src:i},u):h.jsx(zt,{},u))});case s.CFRuleType.highlightCell:{const{ul:i,st:u,it:l,bl:c,bg:d,cl:p}=t.style,f=(i==null?void 0:i.s)===m.BooleanNumber.TRUE,v=(u==null?void 0:u.s)===m.BooleanNumber.TRUE,y=l===m.BooleanNumber.TRUE,b=c===m.BooleanNumber.TRUE,x=(a=d==null?void 0:d.rgb)!=null?a:s.DEFAULT_BG_COLOR,_=(o=p==null?void 0:p.rgb)!=null?o:s.DEFAULT_FONT_COLOR,T={fontWeight:b?"bold":void 0,fontStyle:y?"italic":void 0,textDecoration:`${f?"underline":""} ${v?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:x,color:_};return h.jsx("div",{style:T,className:ln.cfPreview,children:"123"})}}return null};var El=Object.defineProperty,Pl=Object.getOwnPropertyDescriptor,Dl=(e,t,n,r)=>{for(var a=r>1?void 0:r?Pl(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&El(t,n,a),a},Ml=(e,t)=>(n,r)=>t(n,r,e);let Dt=class extends m.Disposable{constructor(t){super();Ze(this,"_initLocal",()=>{});Ze(this,"_findReplaceIndex",t=>{const n=/\{([^}]+)?\}/g,r=[];let a=n.exec(t);for(;a;)r.push({startIndex:a.index,key:Number(a[1]),endIndex:a.index+a[0].length-1}),a=n.exec(t);return r});this._localeService=t,this._initLocal()}tWithReactNode(t,...n){const r=this._localeService.getLocales(),a=t.split("."),o=r&&this._localeService.resolveKeyPath(r,a);if(typeof o=="string"){const i=[];return this._findReplaceIndex(o).forEach((u,l,c)=>{const d=c[l-1]||{startIndex:0,endIndex:-1};if(d.endIndex+1<u.startIndex){const p=o.slice(d.endIndex+1,u.startIndex);p&&i.push(p)}if(n[u.key]&&i.push(n[u.key]),l===c.length-1){const p=o.slice(u.endIndex+1);p&&i.push(p)}}),i}return[]}};Dt=Dl([m.OnLifecycle(m.LifecycleStages.Rendered,Dt),Ml(0,U.Inject(m.LocaleService))],Dt);const ce={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"},Nl=(e,t)=>{const n=e.rule;switch(n.type){case s.CFRuleType.colorScale:return t.t("sheet.cf.ruleType.colorScale");case s.CFRuleType.dataBar:return t.t("sheet.cf.ruleType.dataBar");case s.CFRuleType.iconSet:return t.t("sheet.cf.ruleType.iconSet");case s.CFRuleType.highlightCell:switch(n.subType){case s.CFSubRuleType.average:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,t.t("sheet.cf.subRuleType.average"))}case s.CFSubRuleType.duplicateValues:return t.t("sheet.cf.subRuleType.duplicateValues");case s.CFSubRuleType.uniqueValues:return t.t("sheet.cf.subRuleType.uniqueValues");case s.CFSubRuleType.number:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,...Array.isArray(n.value)?n.value.map(a=>String(a)):[String(n.value||"")])}case s.CFSubRuleType.text:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,n.value||"")}case s.CFSubRuleType.timePeriod:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`)}case s.CFSubRuleType.rank:return n.isPercent?n.isBottom?t.t("sheet.cf.preview.describe.bottomNPercent",String(n.value)):t.t("sheet.cf.preview.describe.topNPercent",String(n.value)):n.isBottom?t.t("sheet.cf.preview.describe.bottomN",String(n.value)):t.t("sheet.cf.preview.describe.topN",String(n.value));case s.CFSubRuleType.formula:return t.t("sheet.cf.ruleType.formula")}}};let Wa=0;const jl=e=>{const{onClick:t}=e,n=ne.useDependency(s.ConditionalFormattingRuleModel),r=ne.useDependency(m.IUniverInstanceService),a=ne.useDependency(V.SelectionManagerService),o=ne.useDependency(m.ICommandService),i=ne.useDependency(m.LocaleService),u=ne.useDependency(Dt),l=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),c=l.getUnitId(),p=l.getActiveSheet().getSheetId(),[f,v]=I.useState([]),[y,b]=I.useState("2"),[x,_]=I.useState(0),[T,S]=I.useState(-1),[R,g]=I.useState(Wa),O=I.useRef(null),E=[{label:i.t("sheet.cf.panel.workSheet"),value:"2"},{label:i.t("sheet.cf.panel.selectedRange"),value:"1"}],w=()=>{const z=n.getSubunitRules(c,p);if(!z||!z.length)return[];if(y==="1"){const Z=a.getLast();if(!Z)return[];const ie=Z.range;return z.filter(de=>de.ranges.some(pe=>m.Rectangle.intersects(pe,ie)))}else if(y==="2")return z;return[]},j=z=>{const ie=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet();return z.map(de=>{const pe=de.ranges;return(pe==null?void 0:pe.some(Le=>{var X,re;const{startRow:M,startColumn:W,endRow:J,endColumn:Y}=Le;for(let se=M;se<=J;se++)for(let Se=W;Se<=Y;Se++){const te=(re=(X=ie.getCell(se,Se))==null?void 0:X.selectionProtection)==null?void 0:re[0];if((te==null?void 0:te[$e.Edit])===!1||(te==null?void 0:te[$e.View])===!1)return!0}return!1}))?{...de,disable:!0}:{...de}})},[L,k]=I.useState(w);le.useHighlightRange(f),I.useEffect(()=>{const z=o.onCommandExecuted(Z=>{Z.id===V.SetWorksheetActiveOperation.id&&_(Math.random())});return()=>z.dispose()}),I.useEffect(()=>{k(w)},[y,x,c,p]),I.useEffect(()=>{if(y==="2")return;const z=new we.Observable(Z=>{const ie=[V.SetSelectionsOperation.id,s.AddConditionalRuleMutation.id,s.SetConditionalRuleMutation.id,s.DeleteConditionalRuleMutation.id,s.MoveConditionalRuleMutation.id],fe=o.onCommandExecuted(de=>{const{id:pe,params:Pe}=de,Le=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId();ie.includes(pe)&&Pe.unitId===Le&&Z.next(null)});return()=>fe.dispose()}).pipe(we.debounceTime(16)).subscribe(()=>{k(w)});return()=>{z.unsubscribe()}},[r,y,c,p]),I.useEffect(()=>{const z=n.$ruleChange.subscribe(()=>{_(Math.random())});return()=>z.unsubscribe()},[n]),I.useEffect(()=>{const z=()=>{var de;const fe=Math.max(0,(((de=O.current)==null?void 0:de.getBoundingClientRect().width)||0)-8);return Wa=fe,fe},ie=new we.Observable(fe=>{const de=document.querySelector(".univer-sidebar");if(de){let pe=setTimeout(()=>{fe.next()},150);const Pe=()=>{pe&&clearTimeout(pe),pe=null},Le=M=>{M.propertyName==="width"&&(Pe(),fe.next())};return de.addEventListener("transitionend",Le),()=>{Pe(),de.removeEventListener("transitionend",Le)}}}).pipe(we.debounceTime(16)).subscribe(()=>{g(z())});return()=>{ie.unsubscribe()}},[]);const G=z=>{const Z=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),ie=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId();o.executeCommand(hr.id,{unitId:Z,subUnitId:ie,cfId:z.cfId})},C=(z,Z)=>{S(Z.y)},P=(z,Z,ie)=>{S(-1);const fe=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),de=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),pe=M=>{const W=L.length;return Math.min(W-1,Math.max(0,M))},Pe=L[pe(Z.y)].cfId,Le=L[pe(ie.y)].cfId;Pe!==Le&&o.executeCommand(ka.id,{unitId:fe,subUnitId:de,start:{id:Pe,type:"self"},end:{id:Le,type:ie.y>Z.y?"after":"before"}})},Q=()=>{e.onCreate()},_e=()=>{y==="2"?o.executeCommand(_n.id):y==="1"&&L.map(Z=>({unitId:c,subUnitId:p,cfId:Z.cfId})).forEach(Z=>{o.executeCommand(hr.id,Z)})},ve=L.map((z,Z)=>({i:z.cfId,x:0,w:12,y:Z,h:1,isResizable:!1})),ye=j(L),je=ye==null?void 0:ye.some(z=>z.disable);return h.jsxs("div",{className:ce.cfRuleList,children:[h.jsxs("div",{className:ce.ruleSelector,children:[h.jsx("div",{children:u.tWithReactNode("sheet.cf.panel.managerRuleSelect",h.jsx(q.Select,{className:ce.select,options:E,value:y,onChange:z=>{b(z)}})).map((z,Z)=>h.jsx("span",{children:z},Z))}),h.jsxs("div",{className:ce.btnList,children:[h.jsx(q.Tooltip,{title:i.t("sheet.cf.panel.createRule"),placement:"bottom",children:h.jsx("div",{className:`${ce.icon}`,onClick:Q,children:h.jsx(Yo,{})})}),L.length&&!je?h.jsx(q.Tooltip,{title:i.t("sheet.cf.panel.clear"),placement:"bottom",children:h.jsx("div",{className:`${ce.gap} ${ce.icon}`,onClick:_e,children:h.jsx(In,{})})}):h.jsx("div",{className:`${ce.gap} ${ce.disabled}`,children:h.jsx(In,{})})]})]}),h.jsx("div",{ref:O,className:ce.gridLayoutWrap,children:R?h.jsx(Ol,{onDragStop:P,onDragStart:C,layout:ve,cols:12,rowHeight:60,width:R,margin:[0,10],draggableHandle:".draggableHandle",children:ye==null?void 0:ye.map((z,Z)=>h.jsx("div",{children:h.jsxs("div",{onMouseMove:()=>{z.ranges!==f&&v(z.ranges)},onMouseLeave:()=>v([]),onClick:()=>{z.disable||t(z)},className:`${ce.ruleItem} ${T===Z?ce.active:""}`,children:[h.jsx("div",{className:`${ce.draggableHandle} draggableHandle`,onClick:ie=>ie.stopPropagation(),children:h.jsx(Jo,{})}),h.jsxs("div",{className:ce.ruleDescribe,children:[h.jsx("div",{className:ce.ruleType,children:Nl(z,i)}),h.jsx("div",{className:ce.ruleRange,children:z.ranges.map(ie=>Or.serializeRange(ie)).join(",")})]}),h.jsx("div",{className:ce.preview,children:h.jsx(yt,{rule:z.rule})}),!z.disable&&h.jsx("div",{className:`${ce.deleteItem} ${T===Z?ce.active:""}`,onClick:ie=>{ie.stopPropagation(),G(z)},children:h.jsx(In,{})})]})},`${z.cfId}`))}):null})]})},un={type:m.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(e,t){if(!t)return!1;const{rule:n}=t,r=e.get(m.IUndoRedoService),a=e.get(m.ICommandService),o=e.get(s.ConditionalFormattingRuleModel),i=e.get(m.IUniverInstanceService),u=V.getSheetCommandTarget(i);if(!u)return!1;const{unitId:l,subUnitId:c}=u,d=o.createCfId(l,c),p={unitId:l,subUnitId:c,rule:{...n,cfId:n.cfId||d}},f=s.AddConditionalRuleMutationUndoFactory(e,p),v=a.syncExecuteCommand(s.AddConditionalRuleMutation.id,p);return v&&r.pushUndoRedo({unitID:l,redoMutations:[{id:s.AddConditionalRuleMutation.id,params:p}],undoMutations:[f]}),v}},za={type:m.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(e,t){if(!t)return!1;const n=e.get(m.IUndoRedoService),r=e.get(m.ICommandService),a=e.get(m.IUniverInstanceService),o=V.getSheetCommandTarget(a,t);if(!o)return!1;const{unitId:i,subUnitId:u}=o,l={unitId:i,subUnitId:u,rule:t.rule},c=s.setConditionalRuleMutationUndoFactory(e,l),d=r.syncExecuteCommand(s.SetConditionalRuleMutation.id,l);return d&&n.pushUndoRedo({unitID:i,undoMutations:c,redoMutations:[{id:s.SetConditionalRuleMutation.id,params:l}]}),d}},Ll=m.createInterceptorKey("beforeSubmit"),Vl=m.createInterceptorKey("submit"),mr={cfColorPicker:"univer-cf-color-picker",cfColorPickerIcon:"univer-cf-color-picker-icon",iconDropdown:"univer-icon-dropdown"},ot=e=>{const{color:t,onChange:n,disable:r=!1,iconId:a="PaintBucket",className:o,isNeedDropdownIcon:i=!0}=e,u=ne.useDependency(Te.ComponentManager),l=I.useMemo(()=>new m.ColorKit(t),[t]),c=u.get(a);return c&&(r?h.jsx(c,{className:o,extend:{colorChannel1:l.isValid?t:"rgb(var(--primary-color))"}}):h.jsx(q.Dropdown,{overlay:h.jsx("div",{className:`${mr.cfColorPicker} `,children:h.jsx(q.ColorPicker,{color:t,onChange:n})}),children:h.jsxs("span",{className:`${mr.cfColorPickerIcon} ${o}`,children:[h.jsx(c,{extend:{colorChannel1:l.isValid?t:"rgb(var(--primary-color))"}}),i&&h.jsx(xn,{className:mr.iconDropdown})]})}))},N={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"},it=(e,t)=>({label:t.t(`sheet.cf.valueType.${e}`),value:e}),gr=e=>{const{type:t,className:n,onChange:r,id:a,value:o}=e,i=ne.useDependency(m.IUniverInstanceService),u=i.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),l=i.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),c=I.useMemo(()=>String(o).startsWith("=")?String(o):"=",[o]),d=I.useMemo(()=>[s.CFValueType.max,s.CFValueType.min,"none"].includes(t)?{disabled:!0}:[s.CFValueType.percent,s.CFValueType.percentile].includes(t)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[t]);return t===s.CFValueType.formula?h.jsx(Te.TextEditor,{openForSheetSubUnitId:l,openForSheetUnitId:u,id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_colo_scale_${a}`),value:c,style:{maxWidth:"50%",marginLeft:4},canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(p="")=>{r(p||"")}}):h.jsx(q.InputNumber,{className:n,value:Number(e.value)||0,onChange:p=>e.onChange(p||0),...d})},Ul=e=>{var G;const{interceptorManager:t}=e,n=ne.useDependency(m.LocaleService),r=((G=e.rule)==null?void 0:G.type)===s.CFRuleType.colorScale?e.rule:void 0,a=[it(s.CFValueType.num,n),it(s.CFValueType.percent,n),it(s.CFValueType.percentile,n),it(s.CFValueType.formula,n)],o=[it(s.CFValueType.min,n),...a],i=[it("none",n),...a],u=[it(s.CFValueType.max,n),...a],[l,c]=I.useState(()=>{var P;const C=s.CFValueType.min;return r&&((P=r.config[0])==null?void 0:P.value.type)||C}),[d,p]=I.useState(()=>{var P;const C="none";return!r||r.config.length!==3?C:((P=r.config[1])==null?void 0:P.value.type)||C}),[f,v]=I.useState(()=>{var P;const C=s.CFValueType.max;return r&&((P=r.config[r.config.length-1])==null?void 0:P.value.type)||C}),[y,b]=I.useState(()=>{if(!r)return 10;const P=r.config[0];return(P==null?void 0:P.value.value)===void 0?10:P==null?void 0:P.value.value}),[x,_]=I.useState(()=>{var Q;if(!r||r.config.length!==3)return 50;const P=(Q=r.config[1])==null?void 0:Q.value.value;return P===void 0?50:P}),[T,S]=I.useState(()=>{var Q;if(!r)return 90;const P=(Q=r.config[r.config.length-1])==null?void 0:Q.value.value;return P===void 0?90:P}),[R,g]=I.useState(()=>{var P;const C="#d0d9fb";return r&&((P=r.config[0])==null?void 0:P.color)||C}),[O,E]=I.useState(()=>{var P;const C="#7790f3";return!r||r.config.length!==3?C:((P=r.config[1])==null?void 0:P.color)||C}),[w,j]=I.useState(()=>{var P;const C="#2e55ef";return r&&((P=r.config[r.config.length-1])==null?void 0:P.color)||C}),L=I.useMemo(()=>C=>{const{minType:P,medianType:Q,maxType:_e,minValue:ve,medianValue:ye,maxValue:je,minColor:z,medianColor:Z,maxColor:ie}=C,fe=[];return fe.push({color:z,value:{type:P,value:ve}}),Q!=="none"&&fe.push({color:Z,value:{type:Q,value:ye}}),fe.push({color:ie,value:{type:_e,value:je}}),{config:fe.map((pe,Pe)=>({...pe,index:Pe})),type:s.CFRuleType.colorScale}},[]);I.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return L({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:T,minColor:R,medianColor:O,maxColor:w})}}),[L,l,d,f,y,x,T,R,O,w,t]);const k=C=>{e.onChange(L(C))};return h.jsxs("div",{children:[h.jsx("div",{className:D.title,children:n.t("sheet.cf.panel.styleRule")}),h.jsx("div",{className:`${N.cfPreviewWrap}`,children:h.jsx(yt,{rule:L({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:T,minColor:R,medianColor:O,maxColor:w})})}),h.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.min")}),h.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[h.jsx(q.Select,{options:o,value:l,onChange:C=>{c(C);const P=s.createDefaultValueByValueType(C,10);b(P),k({minType:C,medianType:d,maxType:f,minValue:P,medianValue:x,maxValue:T,minColor:R,medianColor:O,maxColor:w})}}),h.jsx(gr,{id:"min",className:`${D.mLXxs}`,value:y,type:l,onChange:C=>{b(C),k({minType:l,medianType:d,maxType:f,minValue:C,medianValue:x,maxValue:T,minColor:R,medianColor:O,maxColor:w})}}),h.jsx(ot,{className:D.mLXxs,color:R,onChange:C=>{g(C),k({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:T,minColor:C,medianColor:O,maxColor:w})}})]}),h.jsx("div",{className:D.label,children:n.t("sheet.cf.panel.medianValue")}),h.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[h.jsx(q.Select,{options:i,value:d,onChange:C=>{p(C);const P=s.createDefaultValueByValueType(C,50);_(P),k({minType:l,medianType:C,maxType:f,minValue:y,medianValue:P,maxValue:T,minColor:R,medianColor:O,maxColor:w})}}),h.jsx(gr,{id:"median",className:` ${D.mLXxs}`,value:x,type:d,onChange:C=>{_(C),k({minType:l,medianType:d,maxType:f,minValue:y,medianValue:C,maxValue:T,minColor:R,medianColor:O,maxColor:w})}}),d!=="none"&&h.jsx(ot,{className:D.mLXxs,color:O,onChange:C=>{E(C),k({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:T,minColor:R,medianColor:C,maxColor:w})}})]}),h.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.max")}),h.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[h.jsx(q.Select,{options:u,value:f,onChange:C=>{v(C);const P=s.createDefaultValueByValueType(C,90);S(P),k({minType:l,medianType:d,maxType:C,minValue:y,medianValue:x,maxValue:P,minColor:R,medianColor:O,maxColor:w})}}),h.jsx(gr,{id:"max",className:`${D.mLXxs}`,value:T,type:f,onChange:C=>{S(C),k({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:C,minColor:R,medianColor:O,maxColor:w})}}),h.jsx(ot,{className:D.mLXxs,color:w,onChange:C=>{j(C),k({minType:l,medianType:d,maxType:f,minValue:y,medianValue:x,maxValue:T,minColor:R,medianColor:O,maxColor:C})}})]})]})},St=(e,t)=>({label:t.t(`sheet.cf.valueType.${e}`),value:e}),Aa=e=>{const{onChange:t,className:n,value:r,type:a,id:o,disabled:i=!1}=e,u=ne.useDependency(m.IUniverInstanceService),l=u.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),c=u.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),d=I.useRef(r),p=I.useMemo(()=>[s.CFValueType.percentile,s.CFValueType.percent].includes(a)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[a]);if(a===s.CFValueType.formula){const f=String(d.current).startsWith("=")?String(d.current)||"":"=";return h.jsx(Te.TextEditor,{id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_data_bar_${o}`),value:f,openForSheetSubUnitId:c,openForSheetUnitId:l,style:{width:"47%",marginLeft:14},canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(v="")=>{t(v||"")}})}return h.jsx(q.InputNumber,{className:n,value:Number(r)||0,disabled:i,onChange:f=>{t(f||0)},...p})},kl=e=>{var G;const{interceptorManager:t}=e,n=ne.useDependency(m.LocaleService),r=((G=e.rule)==null?void 0:G.type)===s.CFRuleType.dataBar?e.rule:void 0,[a,o]=I.useState(()=>{var P;const C="0";return r?(P=r.config)!=null&&P.isGradient?"1":"0":C}),[i,u]=I.useState(()=>{var P;const C="#abd91a";return r&&((P=r.config)==null?void 0:P.positiveColor)||C}),[l,c]=I.useState(()=>{var P;const C="#ffbe38";return r&&((P=r.config)==null?void 0:P.nativeColor)||C}),d=[St(s.CFValueType.num,n),St(s.CFValueType.percent,n),St(s.CFValueType.percentile,n),St(s.CFValueType.formula,n)],p=[St(s.CFValueType.min,n),...d],f=[St(s.CFValueType.max,n),...d],[v,y]=I.useState(()=>{var P;const C=p[0].value;return r&&((P=r.config)==null?void 0:P.min.type)||C}),[b,x]=I.useState(()=>{var P;const C=f[0].value;return r&&((P=r.config)==null?void 0:P.max.type)||C}),[_,T]=I.useState(()=>{var Q;if(!r)return 0;const P=((Q=r.config)==null?void 0:Q.min)||{};return P.type===s.CFValueType.formula?P.value||"=":P.value||0}),[S,R]=I.useState(()=>{var Q;if(!r)return 100;const P=((Q=r.config)==null?void 0:Q.max)||{};return P.type===s.CFValueType.formula?P.value||"=":P.value===void 0?100:P.value}),[g,O]=I.useState(()=>r?r.isShowValue===void 0?!0:!!r.isShowValue:!0),E=C=>({config:{min:{type:C.minValueType,value:C.minValue},max:{type:C.maxValueType,value:C.maxValue},isGradient:C.isGradient==="1",positiveColor:C.positiveColor,nativeColor:C.nativeColor},type:s.CFRuleType.dataBar,isShowValue:C.isShowValue});I.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return E({isGradient:a,minValue:_,minValueType:v,maxValue:S,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:g})}}),[a,_,v,S,b,i,l,t,g]);const w=C=>{e.onChange(E(C))},j=C=>{u(C),w({isGradient:a,minValue:_,minValueType:v,maxValue:S,maxValueType:b,positiveColor:C,nativeColor:l,isShowValue:g})},L=C=>{c(C),w({isGradient:a,minValue:_,minValueType:v,maxValue:S,maxValueType:b,positiveColor:i,nativeColor:C,isShowValue:g})},k=C=>d.map(P=>P.value).includes(C);return h.jsxs("div",{children:[h.jsx("div",{className:D.title,children:n.t("sheet.cf.panel.styleRule")}),h.jsx("div",{className:`${N.cfPreviewWrap}`,children:h.jsx(yt,{rule:E({isGradient:a,minValue:_,minValueType:v,maxValue:S,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:g})})}),h.jsxs("div",{children:[h.jsx("div",{className:D.label,children:n.t("sheet.cf.panel.fillType")}),h.jsxs("div",{className:`${D.mTSm} ${D.mLXxs} ${D.labelContainer} `,children:[h.jsxs(q.RadioGroup,{value:a,onChange:C=>{o(C),w({isGradient:C,minValue:_,minValueType:v,maxValue:S,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:g})},children:[h.jsx(q.Radio,{value:"0",children:h.jsx("span",{className:N.text,children:n.t("sheet.cf.panel.pureColor")})}),h.jsx(q.Radio,{value:"1",children:h.jsx("span",{className:N.text,children:n.t("sheet.cf.panel.gradient")})})]}),h.jsxs("div",{className:`${N.utilItem} ${D.mLXl}`,children:[h.jsx(q.Checkbox,{checked:!g,onChange:C=>{O(!C),w({isGradient:C,minValue:_,minValueType:v,maxValue:S,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:!C})}}),n.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),h.jsxs("div",{children:[h.jsx("div",{className:D.label,children:n.t("sheet.cf.panel.colorSet")}),h.jsxs("div",{className:`${D.labelContainer} ${D.mTSm} ${D.mLXxs}`,children:[h.jsxs("div",{className:`${D.labelContainer}`,children:[h.jsx("div",{className:`${N.text}`,children:n.t("sheet.cf.panel.native")}),h.jsx(ot,{color:l,onChange:L})]}),h.jsxs("div",{className:`${D.labelContainer} ${D.mLSm} `,children:[h.jsx("div",{className:`${N.text} `,children:n.t("sheet.cf.panel.positive")}),h.jsx(ot,{color:i,onChange:j})]})]})]}),h.jsxs("div",{children:[h.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.min")}),h.jsxs("div",{className:`${D.mTSm} ${D.labelContainer}`,children:[h.jsx(q.Select,{options:p,value:v,onChange:C=>{y(C);const P=s.createDefaultValueByValueType(C,10);T(P),w({isGradient:a,minValue:P,minValueType:C,maxValue:S,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:g})}}),h.jsx(Aa,{disabled:!k(v),id:"min",type:v,className:D.mLSm,value:_,onChange:C=>{T(C||0),w({isGradient:a,minValue:C||0,minValueType:v,maxValue:S,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:g})}})]}),h.jsx("div",{className:D.label,children:n.t("sheet.cf.valueType.max")}),h.jsxs("div",{className:`${D.mTSm} ${D.labelContainer}`,children:[h.jsx(q.Select,{options:f,value:b,onChange:C=>{x(C);const P=s.createDefaultValueByValueType(C,90);R(P),w({isGradient:a,minValue:_,minValueType:v,maxValue:P,maxValueType:C,positiveColor:i,nativeColor:l,isShowValue:g})}}),h.jsx(Aa,{disabled:!k(b),id:"max",type:b,className:D.mLSm,value:S,onChange:C=>{R(C||0),w({isGradient:a,minValue:_,minValueType:v,maxValue:C||0,maxValueType:b,positiveColor:i,nativeColor:l,isShowValue:g})}})]})]})]})},Ge={cfStyleEdit:"univer-cf-style-edit",buttonItem:"univer-button-item",isActive:"univer-isActive"},cn=e=>[m.BooleanNumber.FALSE,void 0].includes(e)?m.BooleanNumber.TRUE:m.BooleanNumber.FALSE,dn=e=>e!==m.BooleanNumber.FALSE,vr=e=>{const{style:t,onChange:n,className:r}=e,a=ne.useDependency(Te.ComponentManager),[o,i]=I.useState(()=>{if(t!=null&&t.bl)return t.bl}),[u,l]=I.useState(()=>{if(t!=null&&t.it)return t.it}),[c,d]=I.useState(()=>{if(t!=null&&t.ul)return t.ul.s}),[p,f]=I.useState(()=>{if(t!=null&&t.st)return t.st.s}),[v,y]=I.useState(()=>{var O;const g="#2f56ef";return(O=t==null?void 0:t.cl)!=null&&O.rgb?t.cl.rgb:g}),[b,x]=I.useState(()=>{var O;const g="#e8ecfc";return(O=t==null?void 0:t.bg)!=null&&O.rgb?t.bg.rgb:g}),_=a.get("BoldSingle"),T=a.get("ItalicSingle"),S=a.get("UnderlineSingle"),R=a.get("StrikethroughSingle");return I.useEffect(()=>{const g={bl:o,it:u};v!==void 0&&(g.cl={rgb:v}),b!==void 0&&(g.bg={rgb:b}),p!==void 0&&(g.st={s:p}),c!==void 0&&(g.ul={s:c}),n(s.removeUndefinedAttr(g))},[o,u,c,p,v,b]),h.jsxs("div",{className:`${Ge.cfStyleEdit} ${r}`,children:[_&&h.jsx("div",{className:qe({[Ge.isActive]:dn(o||m.BooleanNumber.FALSE)},Ge.buttonItem),onClick:()=>i(cn(o)),children:h.jsx(_,{})}),T&&h.jsx("div",{className:qe({[Ge.isActive]:dn(u||m.BooleanNumber.FALSE)},Ge.buttonItem),onClick:()=>l(cn(u)),children:h.jsx(T,{})}),S&&h.jsx("div",{className:qe({[Ge.isActive]:dn(c||m.BooleanNumber.FALSE)},Ge.buttonItem),onClick:()=>d(cn(c)),children:h.jsx(S,{})}),R&&h.jsx("div",{className:qe({[Ge.isActive]:dn(p||m.BooleanNumber.FALSE)},Ge.buttonItem),onClick:()=>f(cn(p)),children:h.jsx(R,{})}),h.jsx(ot,{color:v,onChange:y,iconId:"FontColor"}),h.jsx(ot,{color:b,onChange:x,iconId:"PaintBucket"})]})},Wl=e=>{var x;const{onChange:t,interceptorManager:n}=e,r=ne.useDependency(m.LocaleService),a=((x=e.rule)==null?void 0:x.type)===s.CFRuleType.highlightCell?e.rule:void 0,o=[{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]=I.useState(()=>{const _=o[0].value,T=a==null?void 0:a.type;if(!a)return _;switch(T){case s.CFRuleType.highlightCell:switch(a.subType){case s.CFSubRuleType.average:return[s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual].includes(a.operator)?"greaterThanAverage":[s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(a.operator)?"lessThanAverage":_;case s.CFSubRuleType.rank:return a.isBottom?"isBottom":"isNotBottom"}}return _}),[l,c]=I.useState(()=>{const T=a==null?void 0:a.type;if(!a)return 10;switch(T){case s.CFRuleType.highlightCell:switch(a.subType){case s.CFSubRuleType.rank:return a.value||10}}return 10}),[d,p]=I.useState(()=>{const T=a==null?void 0:a.type;if(!a)return!1;switch(T){case s.CFRuleType.highlightCell:switch(a.subType){case s.CFSubRuleType.rank:return a.isPercent||!1}}return!1}),[f,v]=I.useState({}),y=_=>{const{type:T,isPercent:S,value:R,style:g}=_;if(T==="isNotBottom")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank,isPercent:S,isBottom:!1,value:R,style:g};if(T==="isBottom")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank,isPercent:S,isBottom:!0,value:R,style:g};if(T==="greaterThanAverage")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.average,operator:s.CFNumberOperator.greaterThan,style:g};if(T==="lessThanAverage")return{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.average,operator:s.CFNumberOperator.lessThan,style:g}};I.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return y({type:i,isPercent:d,value:l,style:f})}}),[i,d,l,f,n]);const b=_=>{t(y(_))};return h.jsxs("div",{children:[h.jsx("div",{className:`${D.title} ${D.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),h.jsx(q.Select,{className:`${N.width100} ${D.mTSm}`,value:i,options:o,onChange:_=>{u(_),b({type:_,isPercent:d,value:l,style:f})}}),["isNotBottom","isBottom"].includes(i)&&h.jsxs("div",{className:`${D.labelContainer} ${D.mTSm}`,children:[h.jsx(q.InputNumber,{min:1,max:1e3,value:l,onChange:_=>{const T=_||0;c(T),b({type:i,isPercent:d,value:T,style:f})}}),h.jsxs("div",{className:`${D.mLSm} ${D.labelContainer} ${N.text}`,children:[h.jsx(q.Checkbox,{checked:d,onChange:_=>{p(!!_),b({type:i,isPercent:!!_,value:l,style:f})}}),r.t("sheet.cf.valueType.percent")]})]}),h.jsx("div",{className:`${N.cfPreviewWrap} `,children:h.jsx(yt,{rule:y({type:i,isPercent:d,value:l,style:f})})}),h.jsx(vr,{style:a==null?void 0:a.style,className:`${D.mTSm} `,onChange:_=>{v(_),b({type:i,isPercent:d,value:l,style:_})}})]})},ee=(e,t)=>({label:t.t(`sheet.cf.operator.${e}`),value:e}),zl=e=>{const{type:t,operator:n,onChange:r,value:a}=e,[o,i]=I.useState(()=>typeof a=="number"?a:0),[u,l]=I.useState(()=>typeof a=="string"?a:""),[c,d]=I.useState(()=>Array.isArray(a)?a[0]===void 0?0:a[0]:0),[p,f]=I.useState(()=>Array.isArray(a)?a[1]===void 0?100:a[1]:100);switch(I.useEffect(()=>{switch(t){case s.CFSubRuleType.text:{[s.CFTextOperator.beginsWith,s.CFTextOperator.endsWith,s.CFTextOperator.containsText,s.CFTextOperator.notContainsText,s.CFTextOperator.equal,s.CFTextOperator.notEqual].includes(n)&&r(u);break}case s.CFSubRuleType.number:{[s.CFNumberOperator.equal,s.CFNumberOperator.notEqual,s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual,s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(n)&&r(o),[s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(n)&&r([c,p]);break}}},[t]),t){case s.CFSubRuleType.text:{if([s.CFTextOperator.beginsWith,s.CFTextOperator.endsWith,s.CFTextOperator.containsText,s.CFTextOperator.notContainsText,s.CFTextOperator.equal,s.CFTextOperator.notEqual].includes(n)){const v=y=>{l(y),r(y)};return h.jsx("div",{className:`${D.mTSm}`,children:h.jsx(q.Input,{className:N.width100,value:u,onChange:v})})}break}case s.CFSubRuleType.number:{if([s.CFNumberOperator.equal,s.CFNumberOperator.notEqual,s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual,s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(n)){const v=y=>{i(y||0),r(y||0)};return h.jsx("div",{className:`${D.mTSm}`,children:h.jsx(q.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:N.width100,value:o,onChange:v})})}if([s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(n)){const v=b=>{d(b||0),r([b||0,p])},y=b=>{f(b||0),r([c,b||0])};return h.jsxs("div",{className:`${D.mTSm} ${D.labelContainer} `,children:[h.jsx(q.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:c,onChange:v}),h.jsx(q.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`${D.mLSm}`,value:p,onChange:y})]})}}}return null},Ha=(e,t)=>{switch(e){case s.CFSubRuleType.text:return[ee(s.CFTextOperator.containsText,t),ee(s.CFTextOperator.notContainsText,t),ee(s.CFTextOperator.beginsWith,t),ee(s.CFTextOperator.endsWith,t),ee(s.CFTextOperator.equal,t),ee(s.CFTextOperator.notEqual,t),ee(s.CFTextOperator.containsBlanks,t),ee(s.CFTextOperator.notContainsBlanks,t),ee(s.CFTextOperator.containsErrors,t),ee(s.CFTextOperator.notContainsErrors,t)];case s.CFSubRuleType.number:return[ee(s.CFNumberOperator.between,t),ee(s.CFNumberOperator.notBetween,t),ee(s.CFNumberOperator.equal,t),ee(s.CFNumberOperator.notEqual,t),ee(s.CFNumberOperator.greaterThan,t),ee(s.CFNumberOperator.greaterThanOrEqual,t),ee(s.CFNumberOperator.lessThan,t),ee(s.CFNumberOperator.lessThanOrEqual,t)];case s.CFSubRuleType.timePeriod:return[ee(s.CFTimePeriodOperator.yesterday,t),ee(s.CFTimePeriodOperator.today,t),ee(s.CFTimePeriodOperator.tomorrow,t),ee(s.CFTimePeriodOperator.last7Days,t),ee(s.CFTimePeriodOperator.lastWeek,t),ee(s.CFTimePeriodOperator.thisWeek,t),ee(s.CFTimePeriodOperator.nextWeek,t),ee(s.CFTimePeriodOperator.lastMonth,t),ee(s.CFTimePeriodOperator.thisMonth,t),ee(s.CFTimePeriodOperator.nextMonth,t)]}},$a=e=>{var R;const{interceptorManager:t,onChange:n}=e,r=ne.useDependency(m.LocaleService),a=((R=e.rule)==null?void 0:R.type)===s.CFRuleType.highlightCell?e.rule:void 0,[o,i]=I.useState(()=>{const g=s.CFSubRuleType.text;return a&&a.subType||g}),u=[{value:s.CFSubRuleType.text,label:r.t("sheet.cf.subRuleType.text")},{value:s.CFSubRuleType.number,label:r.t("sheet.cf.subRuleType.number")},{value:s.CFSubRuleType.timePeriod,label:r.t("sheet.cf.subRuleType.timePeriod")},{value:s.CFSubRuleType.duplicateValues,label:r.t("sheet.cf.subRuleType.duplicateValues")},{value:s.CFSubRuleType.uniqueValues,label:r.t("sheet.cf.subRuleType.uniqueValues")}],l=I.useMemo(()=>Ha(o,r),[o]),[c,d]=I.useState(()=>{const g=l?l[0].value:void 0;return a&&a.operator||g}),[p,f]=I.useState(()=>{var E;const g="";return a?(E=a.value)!=null?E:s.createDefaultValue(a.subType,a.operator):g}),[v,y]=I.useState({}),b=I.useMemo(()=>g=>{var O,E,w,j,L,k,G,C,P,Q,_e,ve,ye,je,z;switch(g.subType||o){case s.CFSubRuleType.text:{if([s.CFTextOperator.beginsWith,s.CFTextOperator.endsWith,s.CFTextOperator.containsText,s.CFTextOperator.notContainsText,s.CFTextOperator.equal,s.CFTextOperator.notEqual].includes(c))return{type:s.CFRuleType.highlightCell,subType:(O=g.subType)!=null?O:o,operator:(E=g.operator)!=null?E:c,style:(w=g.style)!=null?w:v,value:(j=g.value)!=null?j:p};break}case s.CFSubRuleType.number:{if([s.CFNumberOperator.equal,s.CFNumberOperator.notEqual,s.CFNumberOperator.greaterThan,s.CFNumberOperator.greaterThanOrEqual,s.CFNumberOperator.lessThan,s.CFNumberOperator.lessThanOrEqual].includes(c))return{type:s.CFRuleType.highlightCell,subType:(L=g.subType)!=null?L:o,operator:(k=g.operator)!=null?k:c,style:(G=g.style)!=null?G:v,value:(C=g.value)!=null?C:p};if([s.CFNumberOperator.between,s.CFNumberOperator.notBetween].includes(c))return{type:s.CFRuleType.highlightCell,subType:(P=g.subType)!=null?P:o,operator:(Q=g.operator)!=null?Q:c,style:(_e=g.style)!=null?_e:v,value:(ve=g.value)!=null?ve:p};break}}return{type:s.CFRuleType.highlightCell,subType:(ye=g.subType)!=null?ye:o,operator:(je=g.operator)!=null?je:c,style:(z=g.style)!=null?z:v}},[o,c,p,v]);I.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return b({})}}),[b,t]),I.useEffect(()=>{u.some(g=>g.value===o)||i(u[0].value)},[u]);const x=g=>{const O=g,E=Ha(O,r),w=E&&E[0].value;i(O),d(w),w&&f(s.createDefaultValue(O,w)),n(b({subType:O,operator:w}))},_=g=>{const O=g;d(O),n(b({operator:O}))},T=g=>{f(g),n(b({value:g}))},S=I.useMemo(()=>`${o}_${c}_${Math.random()}`,[o,c]);return h.jsxs("div",{children:[h.jsx("div",{className:`${D.title} ${D.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),h.jsx(q.Select,{className:`${D.mTSm} ${N.width100}`,onChange:x,value:o,options:u}),(l==null?void 0:l.length)&&h.jsx(q.Select,{className:`${D.mTSm} ${N.width100}`,onChange:_,value:c||"",options:l}),h.jsx(zl,{value:p,interceptorManager:t,type:o,operator:c,rule:a,onChange:T},S),h.jsx("div",{className:`${N.cfPreviewWrap}`,children:h.jsx(yt,{rule:b({})})}),h.jsx(vr,{style:a==null?void 0:a.style,className:`${D.mLXxs}`,onChange:g=>{y(g),n(b({style:g}))}})]})},Al=e=>{var y;const{onChange:t,interceptorManager:n}=e,r=ne.useDependency(m.LocaleService),o=ne.useDependency(m.IUniverInstanceService).getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),i=o.getActiveSheet(),u=((y=e.rule)==null?void 0:y.type)===s.CFRuleType.highlightCell?e.rule:void 0,[l,c]=I.useState({}),[d,p]=I.useState(()=>(u==null?void 0:u.subType)===s.CFSubRuleType.formula?u.value:"="),f=b=>({style:b.style,value:d,type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.formula});I.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return f({style:l,formula:d})}}),[l,d,n]);const v=b=>{t(f(b))};return h.jsxs("div",{children:[h.jsx("div",{className:`${D.title} ${D.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),h.jsx("div",{className:`${D.mTSm}`,children:h.jsx(Te.TextEditor,{id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_formula`),openForSheetSubUnitId:i.getSheetId(),openForSheetUnitId:o.getUnitId(),value:d,canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(b="")=>{const x=b||"";p(x),v({style:l,formula:x})}})}),h.jsx("div",{className:`${N.cfPreviewWrap} `,children:h.jsx(yt,{rule:f({style:l,formula:d})})}),h.jsx(vr,{style:u==null?void 0:u.style,className:`${D.mTSm} `,onChange:b=>{c(b),v({style:b,formula:d})}})]})};var Hl="Expected a function",Ba="__lodash_hash_undefined__",Fa=1/0,$l=9007199254740991,Bl="[object Function]",Fl="[object GeneratorFunction]",Gl="[object Symbol]",ql=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xl=/^\w*$/,Yl=/^\./,Kl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zl=/[\\^$.*+?()[\]{}|]/g,Jl=/\\(\\)?/g,Ql=/^\[object .+?Constructor\]$/,eu=/^(?:0|[1-9]\d*)$/,tu=typeof Be=="object"&&Be&&Be.Object===Object&&Be,nu=typeof self=="object"&&self&&self.Object===Object&&self,yr=tu||nu||Function("return this")();function ru(e,t){return e==null?void 0:e[t]}function au(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var ou=Array.prototype,iu=Function.prototype,Ga=Object.prototype,Sr=yr["__core-js_shared__"],qa=function(){var e=/[^.]+$/.exec(Sr&&Sr.keys&&Sr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Xa=iu.toString,fn=Ga.hasOwnProperty,Ya=Ga.toString,su=RegExp("^"+Xa.call(fn).replace(Zl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ka=yr.Symbol,lu=ou.splice,uu=Qa(yr,"Map"),Mt=Qa(Object,"create"),Za=Ka?Ka.prototype:void 0,Ja=Za?Za.toString:void 0;function st(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function cu(){this.__data__=Mt?Mt(null):{}}function du(e){return this.has(e)&&delete this.__data__[e]}function fu(e){var t=this.__data__;if(Mt){var n=t[e];return n===Ba?void 0:n}return fn.call(t,e)?t[e]:void 0}function pu(e){var t=this.__data__;return Mt?t[e]!==void 0:fn.call(t,e)}function hu(e,t){var n=this.__data__;return n[e]=Mt&&t===void 0?Ba:t,this}st.prototype.clear=cu,st.prototype.delete=du,st.prototype.get=fu,st.prototype.has=pu,st.prototype.set=hu;function bt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function mu(){this.__data__=[]}function gu(e){var t=this.__data__,n=pn(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():lu.call(t,n,1),!0}function vu(e){var t=this.__data__,n=pn(t,e);return n<0?void 0:t[n][1]}function yu(e){return pn(this.__data__,e)>-1}function Su(e,t){var n=this.__data__,r=pn(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}bt.prototype.clear=mu,bt.prototype.delete=gu,bt.prototype.get=vu,bt.prototype.has=yu,bt.prototype.set=Su;function lt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function bu(){this.__data__={hash:new st,map:new(uu||bt),string:new st}}function Tu(e){return hn(this,e).delete(e)}function Ru(e){return hn(this,e).get(e)}function Cu(e){return hn(this,e).has(e)}function _u(e,t){return hn(this,e).set(e,t),this}lt.prototype.clear=bu,lt.prototype.delete=Tu,lt.prototype.get=Ru,lt.prototype.has=Cu,lt.prototype.set=_u;function wu(e,t,n){var r=e[t];(!(fn.call(e,t)&&eo(r,n))||n===void 0&&!(t in e))&&(e[t]=n)}function pn(e,t){for(var n=e.length;n--;)if(eo(e[n][0],t))return n;return-1}function Iu(e){if(!mn(e)||Nu(e))return!1;var t=Uu(e)||au(e)?su:Ql;return t.test(Vu(e))}function xu(e,t,n,r){if(!mn(e))return e;t=Du(t,e)?[t]:Eu(t);for(var a=-1,o=t.length,i=o-1,u=e;u!=null&&++a<o;){var l=Lu(t[a]),c=n;if(a!=i){var d=u[l];c=r?r(d,l,u):void 0,c===void 0&&(c=mn(d)?d:Pu(t[a+1])?[]:{})}wu(u,l,c),u=u[l]}return e}function Ou(e){if(typeof e=="string")return e;if(Tr(e))return Ja?Ja.call(e):"";var t=e+"";return t=="0"&&1/e==-Fa?"-0":t}function Eu(e){return to(e)?e:ju(e)}function hn(e,t){var n=e.__data__;return Mu(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Qa(e,t){var n=ru(e,t);return Iu(n)?n:void 0}function Pu(e,t){return t=t==null?$l:t,!!t&&(typeof e=="number"||eu.test(e))&&e>-1&&e%1==0&&e<t}function Du(e,t){if(to(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Tr(e)?!0:Xl.test(e)||!ql.test(e)||t!=null&&e in Object(t)}function Mu(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Nu(e){return!!qa&&qa in e}var ju=br(function(e){e=Wu(e);var t=[];return Yl.test(e)&&t.push(""),e.replace(Kl,function(n,r,a,o){t.push(a?o.replace(Jl,"$1"):r||n)}),t});function Lu(e){if(typeof e=="string"||Tr(e))return e;var t=e+"";return t=="0"&&1/e==-Fa?"-0":t}function Vu(e){if(e!=null){try{return Xa.call(e)}catch{}try{return e+""}catch{}}return""}function br(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError(Hl);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var i=e.apply(this,r);return n.cache=o.set(a,i),i};return n.cache=new(br.Cache||lt),n}br.Cache=lt;function eo(e,t){return e===t||e!==e&&t!==t}var to=Array.isArray;function Uu(e){var t=mn(e)?Ya.call(e):"";return t==Bl||t==Fl}function mn(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function ku(e){return!!e&&typeof e=="object"}function Tr(e){return typeof e=="symbol"||ku(e)&&Ya.call(e)==Gl}function Wu(e){return e==null?"":Ou(e)}function zu(e,t,n){return e==null?e:xu(e,t,n)}var Au=zu;const Hu=wn(Au);var $u="Expected a function",no="__lodash_hash_undefined__",ro=1/0,Bu="[object Function]",Fu="[object GeneratorFunction]",Gu="[object Symbol]",qu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xu=/^\w*$/,Yu=/^\./,Ku=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zu=/[\\^$.*+?()[\]{}|]/g,Ju=/\\(\\)?/g,Qu=/^\[object .+?Constructor\]$/,ec=typeof Be=="object"&&Be&&Be.Object===Object&&Be,tc=typeof self=="object"&&self&&self.Object===Object&&self,Rr=ec||tc||Function("return this")();function nc(e,t){return e==null?void 0:e[t]}function rc(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var ac=Array.prototype,oc=Function.prototype,ao=Object.prototype,Cr=Rr["__core-js_shared__"],oo=function(){var e=/[^.]+$/.exec(Cr&&Cr.keys&&Cr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),io=oc.toString,_r=ao.hasOwnProperty,so=ao.toString,ic=RegExp("^"+io.call(_r).replace(Zu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),lo=Rr.Symbol,sc=ac.splice,lc=fo(Rr,"Map"),Nt=fo(Object,"create"),uo=lo?lo.prototype:void 0,co=uo?uo.toString:void 0;function ut(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function uc(){this.__data__=Nt?Nt(null):{}}function cc(e){return this.has(e)&&delete this.__data__[e]}function dc(e){var t=this.__data__;if(Nt){var n=t[e];return n===no?void 0:n}return _r.call(t,e)?t[e]:void 0}function fc(e){var t=this.__data__;return Nt?t[e]!==void 0:_r.call(t,e)}function pc(e,t){var n=this.__data__;return n[e]=Nt&&t===void 0?no:t,this}ut.prototype.clear=uc,ut.prototype.delete=cc,ut.prototype.get=dc,ut.prototype.has=fc,ut.prototype.set=pc;function Tt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function hc(){this.__data__=[]}function mc(e){var t=this.__data__,n=gn(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():sc.call(t,n,1),!0}function gc(e){var t=this.__data__,n=gn(t,e);return n<0?void 0:t[n][1]}function vc(e){return gn(this.__data__,e)>-1}function yc(e,t){var n=this.__data__,r=gn(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}Tt.prototype.clear=hc,Tt.prototype.delete=mc,Tt.prototype.get=gc,Tt.prototype.has=vc,Tt.prototype.set=yc;function ct(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Sc(){this.__data__={hash:new ut,map:new(lc||Tt),string:new ut}}function bc(e){return vn(this,e).delete(e)}function Tc(e){return vn(this,e).get(e)}function Rc(e){return vn(this,e).has(e)}function Cc(e,t){return vn(this,e).set(e,t),this}ct.prototype.clear=Sc,ct.prototype.delete=bc,ct.prototype.get=Tc,ct.prototype.has=Rc,ct.prototype.set=Cc;function gn(e,t){for(var n=e.length;n--;)if(jc(e[n][0],t))return n;return-1}function _c(e,t){t=Oc(t,e)?[t]:xc(t);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Mc(t[n++])];return n&&n==r?e:void 0}function wc(e){if(!ho(e)||Pc(e))return!1;var t=Lc(e)||rc(e)?ic:Qu;return t.test(Nc(e))}function Ic(e){if(typeof e=="string")return e;if(Ir(e))return co?co.call(e):"";var t=e+"";return t=="0"&&1/e==-ro?"-0":t}function xc(e){return po(e)?e:Dc(e)}function vn(e,t){var n=e.__data__;return Ec(t)?n[typeof t=="string"?"string":"hash"]:n.map}function fo(e,t){var n=nc(e,t);return wc(n)?n:void 0}function Oc(e,t){if(po(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Ir(e)?!0:Xu.test(e)||!qu.test(e)||t!=null&&e in Object(t)}function Ec(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Pc(e){return!!oo&&oo in e}var Dc=wr(function(e){e=Uc(e);var t=[];return Yu.test(e)&&t.push(""),e.replace(Ku,function(n,r,a,o){t.push(a?o.replace(Ju,"$1"):r||n)}),t});function Mc(e){if(typeof e=="string"||Ir(e))return e;var t=e+"";return t=="0"&&1/e==-ro?"-0":t}function Nc(e){if(e!=null){try{return io.call(e)}catch{}try{return e+""}catch{}}return""}function wr(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError($u);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var i=e.apply(this,r);return n.cache=o.set(a,i),i};return n.cache=new(wr.Cache||ct),n}wr.Cache=ct;function jc(e,t){return e===t||e!==e&&t!==t}var po=Array.isArray;function Lc(e){var t=ho(e)?so.call(e):"";return t==Bu||t==Fu}function ho(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Vc(e){return!!e&&typeof e=="object"}function Ir(e){return typeof e=="symbol"||Vc(e)&&so.call(e)==Gu}function Uc(e){return e==null?"":Ic(e)}function kc(e,t,n){var r=e==null?void 0:_c(e,t);return r===void 0?n:r}var Wc=kc;const zc=wn(Wc),mo=(e,t)=>(s.iconMap[e]||[])[Number(t)]||"",Ac=e=>{const t=ne.useDependency(m.IUniverInstanceService),n=t.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),r=t.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),a=I.useMemo(()=>e.error?N.errorInput:"",[e.error]);return h.jsx("div",{className:N.positionRelative,children:e.type!==s.CFValueType.formula?h.jsxs(h.Fragment,{children:[h.jsx(q.InputNumber,{className:a,value:Number(e.value)||0,onChange:o=>e.onChange(o!=null?o:0)}),e.error&&h.jsx("div",{className:N.errorText,children:e.error})]}):h.jsx(Te.TextEditor,{id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_icon_set_${e.id}`),value:String(e.value).startsWith("=")?String(e.value):"=",openForSheetSubUnitId:r,openForSheetUnitId:n,canvasStyle:{fontSize:10},onlyInputFormula:!0,onChange:(o="")=>{const i=o||"";e.onChange(i)}})})},go=(e,t,n)=>({operator:s.CFNumberOperator.greaterThan,value:{type:s.CFValueType.num,value:(n.length-1-t)*10},iconType:e,iconId:String(t)}),Hc=e=>{const t=ne.useDependency(m.LocaleService),n=r=>{e.onClick(r)};return h.jsx("div",{className:N.iconGroupList,children:s.iconGroup.map((r,a)=>h.jsxs("div",{className:N.group,children:[h.jsx("div",{className:N.title,children:t.t(r.title)}),h.jsx("div",{className:N.itemContent,children:r.group.map(o=>h.jsx("div",{className:N.itemWrap,onClick:()=>{n(o.name)},children:h.jsx("div",{className:N.item,children:o.list.map((i,u)=>h.jsx("img",{className:N.icon,src:i},u))})},o.name))})]},a))})},$c=e=>{const t=I.useMemo(()=>{const r=[];for(const a in s.iconMap){const o=s.iconMap[a],i=a;o.forEach((u,l)=>{r.push({iconType:i,base64:u,iconId:String(l)})})}return r},[]),n=r=>{e.onClick(r.iconType,r.iconId)};return h.jsxs("div",{className:N.iconItemListWrap,children:[h.jsxs("div",{className:N.none,onClick:()=>n({iconType:s.EMPTY_ICON_TYPE,iconId:"",base64:""}),children:[h.jsx(zt,{className:N.icon}),h.jsx("span",{children:"无单元格图标"})]}),h.jsx("div",{className:N.iconItemList,children:t.map(r=>h.jsx("div",{className:N.item,children:h.jsx("img",{onClick:()=>n(r),className:`${N.icon}`,src:r.base64})},`${r.iconType}_${r.iconId}`))})]})},Bc=e=>{const{onChange:t,configList:n,errorMap:r={}}=e,a=ne.useDependency(m.LocaleService),o=[{label:a.t(`sheet.cf.symbol.${s.CFNumberOperator.greaterThan}`),value:s.CFNumberOperator.greaterThan},{label:a.t(`sheet.cf.symbol.${s.CFNumberOperator.greaterThanOrEqual}`),value:s.CFNumberOperator.greaterThanOrEqual}],i=[{label:a.t(`sheet.cf.valueType.${s.CFValueType.num}`),value:s.CFValueType.num},{label:a.t(`sheet.cf.valueType.${s.CFValueType.percent}`),value:s.CFValueType.percent},{label:a.t(`sheet.cf.valueType.${s.CFValueType.percentile}`),value:s.CFValueType.percentile},{label:a.t(`sheet.cf.valueType.${s.CFValueType.formula}`),value:s.CFValueType.formula}],u=(p,f)=>{t([String(f),"value","value"],p)},l=(p,f)=>{t([String(f),"operator"],p);const v=s.createDefaultValue(s.CFSubRuleType.number,p);u(v,f)},c=(p,f)=>{t([String(f),"value","type"],p)};return I.useMemo(()=>n.map((p,f)=>{const v=r[f],y=mo(p.iconType,p.iconId),b=f===n.length-1,x=f===0,_=n[f-1],T=(_==null?void 0:_.value.type)===s.CFValueType.formula?a.t("sheet.cf.valueType.formula"):_==null?void 0:_.value.value,S=(R,g)=>{const O={...p,iconId:g,iconType:R};t([String(f)],O)};return h.jsxs("div",{className:`${f?D.mTXl:D.mTSm}`,children:[h.jsxs("div",{className:`${D.label} ${N.flex}`,children:[h.jsxs("div",{className:`${N.width45}`,children:[a.t("sheet.cf.iconSet.icon"),f+1]}),h.jsx("div",{className:`${N.width45}`,children:h.jsxs(h.Fragment,{children:[!x&&!b&&a.t("sheet.cf.iconSet.rule"),!x&&!b&&h.jsxs("span",{className:N.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${s.getOppositeOperator(_.operator)}`),T,b?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),h.jsxs("div",{className:`${N.flex} ${D.mTSm}`,children:[h.jsx("div",{className:`${N.iconWrap} ${N.width45}`,children:h.jsx(q.Dropdown,{overlay:h.jsx($c,{onClick:S,iconId:p.iconId,iconType:p.iconType}),children:h.jsxs("div",{className:N.dropdownIcon,children:[y?h.jsx("img",{src:y,className:N.icon}):h.jsx(zt,{className:N.icon}),h.jsx(xn,{})]})})}),b?h.jsxs("div",{className:`${N.width45} ${D.label}`,style:{marginTop:0},children:[a.t("sheet.cf.iconSet.rule"),h.jsxs("span",{className:N.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${s.getOppositeOperator(_.operator)}`),T,b?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]}):h.jsx(q.Select,{className:`${D.mL0} ${N.width45} ${D.mR0}`,options:o,value:p.operator,onChange:R=>{l(R,f)}})]}),b?h.jsx("div",{}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:`${D.mTSm} ${D.label} ${N.flex}`,children:[h.jsx("div",{className:`${N.width45}`,children:a.t("sheet.cf.iconSet.type")}),h.jsx("div",{className:`${N.width45}`,children:a.t("sheet.cf.iconSet.value")})]}),h.jsxs("div",{className:`${D.mTSm} ${N.flex}`,children:[h.jsx(q.Select,{className:`${N.width45} ${D.mL0}`,options:i,value:p.value.type,onChange:R=>{c(R,f)}}),h.jsx("div",{className:`${D.mL0} ${N.width45}`,children:h.jsx(Ac,{id:f,type:p.value.type,error:v,value:p.value.value||"",onChange:R=>u(R,f)})})]})]})]},f)}),[n,r])},Fc=e=>{var _;const{interceptorManager:t}=e,n=((_=e.rule)==null?void 0:_.type)===s.CFRuleType.iconSet?e.rule:void 0,r=ne.useDependency(m.LocaleService),[a,o]=I.useState({}),[i,u]=I.useState(()=>{const T=Object.keys(s.iconMap)[0];if(n&&n.config.length){const S=n.config[0].iconType;if(!n.config.some(g=>g.iconType!==S))return S}return T}),[l,c]=I.useState(()=>{if(n&&n.config.length)return m.Tools.deepClone(n==null?void 0:n.config);const T=s.iconMap[i]||[];return new Array(T.length).fill("").map((S,R,g)=>R===g.length-1?{operator:s.CFNumberOperator.lessThanOrEqual,value:{type:s.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:i,iconId:String(R)}:go(i,R,g))}),[d,p]=I.useState(()=>n?!!n.isShowValue:!0),f=I.useMemo(()=>{const T=l.map(S=>mo(S.iconType,S.iconId));return h.jsx("div",{className:N.iconWrap,children:T.map((S,R)=>S?h.jsx("img",{className:N.icon,src:S},R):h.jsx(zt,{className:N.icon},R))})},[l]),v=T=>{if(T.reduce((R,g,O)=>R.preType&&!R.result||T.length-1===O?R:g.value.type===s.CFValueType.formula?{preType:s.CFValueType.formula,result:!1}:R.preType?{result:R.preType===g.value.type,preType:g.value.type}:{result:!0,preType:g.value.type},{result:!0,preType:""}).result&&[s.CFValueType.num,s.CFValueType.percent,s.CFValueType.percentile].includes(T[0].value.type)){const R={};return T.forEach((g,O,E)=>{if(O-1<0||O===E.length-1)return;const j=T[O-1],L=s.getOppositeOperator(j.operator);s.compareWithNumber({operator:L,value:j.value.value},g.value.value)||(R[O]=`${r.t(`sheet.cf.form.${L}`,String(j.value.value))} `)}),R}return{}},y=(T,S)=>{zc(l,T)!==S&&(Hu(l,T,S),c([...l]),o(v(l)))},b=T=>{u(T);const S=s.iconMap[T]||[],R=new Array(S.length).fill("").map((g,O,E)=>go(T,O,E));c(R),o(v(R))};I.useEffect(()=>{const T=t.intercept(t.getInterceptPoints().submit,{handler(){return{type:s.CFRuleType.iconSet,isShowValue:d,config:l}}});return()=>{T()}},[d,l,t]),I.useEffect(()=>{const T=t.intercept(t.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(a).length===0}});return()=>{T()}},[d,l,t,a]);const x=()=>{const T=l.map(S=>({...S}));l.forEach((S,R)=>{const g=l.length-1-R,O=T[g];S.iconId=O.iconId,S.iconType=O.iconType}),c([...l])};return h.jsxs("div",{className:N.iconSet,children:[h.jsx("div",{className:D.title,children:r.t("sheet.cf.panel.styleRule")}),h.jsx("div",{className:`${D.mTSm}`,children:h.jsx(q.Dropdown,{overlay:h.jsx(Hc,{iconType:i,onClick:b}),children:h.jsxs("div",{className:N.dropdownIcon,style:{width:"unset"},children:[f,h.jsx(xn,{})]})})}),h.jsxs("div",{className:`${D.mTSm} ${N.renderConfig}`,children:[h.jsxs("div",{className:N.utilItem,children:[h.jsx(q.Checkbox,{onChange:x}),r.t("sheet.cf.iconSet.reverseIconOrder")]}),h.jsxs("div",{className:`${N.utilItem} ${D.mLXl}`,children:[h.jsx(q.Checkbox,{checked:!d,onChange:T=>{p(!T)}}),r.t("sheet.cf.iconSet.onlyShowIcon")]})]}),h.jsx(Bc,{errorMap:a,onChange:y,configList:l})]})},vo=e=>e.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),yo=e=>e.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),Gc=e=>{var R,g,O,E;const t=ne.useDependency(m.LocaleService),n=ne.useDependency(m.ICommandService),r=ne.useDependency(m.IUniverInstanceService),a=ne.useDependency(s.ConditionalFormattingRuleModel),o=ne.useDependency(V.SelectionManagerService),i=vo(r),u=yo(r),l=I.useRef((g=(R=e.rule)==null?void 0:R.ranges)!=null?g:[]),c=I.useMemo(()=>{var j,L;let w=(j=e.rule)==null?void 0:j.ranges;return w!=null&&w.length||(w=(L=o.getSelectionRanges())!=null?L:[]),l.current=w,w!=null&&w.length?w.map(k=>{const G=Or.serializeRange(k);return G==="NaN"?"":G}).filter(k=>!!k).join(","):""},[e.rule]),d=[{label:t.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:t.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:t.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:t.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:t.t("sheet.cf.ruleType.formula"),value:"5"},{label:t.t("sheet.cf.ruleType.iconSet"),value:"6"}],[p,f]=I.useState(()=>{var L,k;const w=(L=e.rule)==null?void 0:L.rule.type,j=d[0].value;if(!w)return j;switch(w){case s.CFRuleType.highlightCell:{switch((k=e.rule)==null?void 0:k.rule.subType){case s.CFSubRuleType.number:case s.CFSubRuleType.text:case s.CFSubRuleType.duplicateValues:case s.CFSubRuleType.uniqueValues:case s.CFSubRuleType.timePeriod:return"1";case s.CFSubRuleType.average:case s.CFSubRuleType.rank:return"2";case s.CFSubRuleType.formula:return"5"}break}case s.CFRuleType.dataBar:return"3";case s.CFRuleType.colorScale:return"4";case s.CFRuleType.iconSet:return"6"}return j}),v=I.useRef(),y=I.useMemo(()=>new m.InterceptorManager({beforeSubmit:Ll,submit:Vl}),[]),b=I.useMemo(()=>{switch(p){case"1":return $a;case"2":return Wl;case"3":return kl;case"4":return Ul;case"5":return Al;case"6":return Fc;default:return $a}},[p]);I.useEffect(()=>{var w;if(((w=e.rule)==null?void 0:w.cfId)!==void 0){const j=n.onCommandExecuted(L=>{if(L.id===V.RemoveSheetMutation.id){const k=L.params;k.subUnitId===u&&k.unitId===i&&e.onCancel()}L.id===V.SetWorksheetActiveOperation.id&&e.onCancel()});return()=>j.dispose()}},[(O=e.rule)==null?void 0:O.cfId]);const x=w=>{v.current=w},_=w=>{l.current=w.map(j=>j.range)},T=()=>{const w=y.fetchThroughInterceptors(y.getInterceptPoints().beforeSubmit)(!0,null),j=()=>{const L=r.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet();return l.current.map(C=>V.setEndForRange(C,L.getRowCount(),L.getColumnCount())).filter(C=>!(Number.isNaN(C.startRow)||Number.isNaN(C.startColumn)))};if(w){const L=y.fetchThroughInterceptors(y.getInterceptPoints().submit)(null,null),k=j();if(L&&k.length){const G=vo(r),C=yo(r);let P={};e.rule&&e.rule.cfId?(P={...e.rule,ranges:k,rule:L},n.executeCommand(za.id,{unitId:G,subUnitId:C,rule:P}),e.onCancel()):(P={cfId:a.createCfId(G,C),ranges:k,rule:L,stopIfTrue:!1},n.executeCommand(un.id,{unitId:G,subUnitId:C,rule:P}),e.onCancel())}}},S=()=>{e.onCancel()};return h.jsxs("div",{className:N.cfRuleStyleEditor,children:[h.jsx("div",{className:D.title,children:t.t("sheet.cf.panel.range")}),h.jsx("div",{className:`${D.mTBase}`,children:h.jsx(Te.RangeSelector,{placeholder:t.t("sheet.cf.form.rangeSelector"),width:"100%",openForSheetSubUnitId:u,openForSheetUnitId:i,value:c,id:m.createInternalEditorID(`${s.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_rangeSelector`),onChange:_})}),h.jsx("div",{className:D.title,children:t.t("sheet.cf.panel.styleType")}),h.jsx("div",{className:D.mTBase,children:h.jsx(q.Select,{className:N.width100,value:p,options:d,onChange:w=>f(w)})}),h.jsx(b,{interceptorManager:y,rule:(E=e.rule)==null?void 0:E.rule,onChange:x}),h.jsxs("div",{className:`${D.mTBase} ${N.btnList}`,children:[h.jsx(q.Button,{size:"small",onClick:S,children:t.t("sheet.cf.panel.cancel")}),h.jsx(q.Button,{className:D.mLSm,size:"small",type:"primary",onClick:T,children:t.t("sheet.cf.panel.submit")})]})]})},qc=e=>{const[t,n]=I.useState(e.rule),[r,a]=I.useState(!!e.rule),o=()=>{a(!0)},i=()=>{a(!1),n(void 0)},u=l=>{n(l),a(!0)};return h.jsx("div",{className:D.conditionalFormattingWrap,children:r?h.jsx(Gc,{onCancel:i,rule:t}):h.jsx(jl,{onClick:u,onCreate:o})})};var Xc=Object.defineProperty,Yc=Object.getOwnPropertyDescriptor,Kc=(e,t,n,r)=>{for(var a=r>1?void 0:r?Yc(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Xc(t,n,a),a},Rt=(e,t)=>(n,r)=>t(n,r,e);const Zc={},So="sheet.conditional.formatting.panel";let Ct=class extends m.Disposable{constructor(t,n,r,a,o,i,u){super();Ze(this,"_sidebarDisposable",null);this._config=t,this._univerInstanceService=n,this._injector=r,this._componentManager=a,this._menuService=o,this._sidebarService=i,this._localeService=u,this._initMenu(),this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(m.UniverInstanceType.UNIVER_SHEET).subscribe(l=>{var c;l||(c=this._sidebarDisposable)==null||c.dispose()}))}openPanel(t){const n={header:{title:this._localeService.t("sheet.cf.title")},children:{label:So,rule:t},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(n)}_initMenu(){const{menu:t={}}=this._config;this._menuService.addMenuItem(Lo(this._injector),t)}_initPanel(){this._componentManager.register(So,qc)}};Ct=Kc([m.OnLifecycle(m.LifecycleStages.Ready,Ct),Rt(1,m.IUniverInstanceService),Rt(2,U.Inject(U.Injector)),Rt(3,U.Inject(Te.ComponentManager)),Rt(4,U.Inject(Te.IMenuService)),Rt(5,U.Inject(Te.ISidebarService)),Rt(6,U.Inject(m.LocaleService))],Ct);var Oe=(e=>(e[e.createRule=1]="createRule",e[e.viewRule=2]="viewRule",e[e.highlightCell=3]="highlightCell",e[e.rank=4]="rank",e[e.formula=5]="formula",e[e.colorScale=6]="colorScale",e[e.dataBar=7]="dataBar",e[e.icon=8]="icon",e[e.clearRangeRules=9]="clearRangeRules",e[e.clearWorkSheetRules=10]="clearWorkSheetRules",e))(Oe||{});const bo={id:"sheet.operation.open.conditional.formatting.panel",type:m.CommandType.OPERATION,handler:(e,t)=>{const n=e.get(Ct),r=e.get(V.SelectionManagerService),a=e.get(m.ICommandService),o=r.getSelectionRanges()||[];switch(t.value){case 3:{n.openPanel({...s.createDefaultRule(),ranges:o});break}case 4:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.rank}};n.openPanel(u);break}case 5:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.highlightCell,subType:s.CFSubRuleType.formula,value:"="}};n.openPanel(u);break}case 6:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.colorScale,config:[]}};n.openPanel(u);break}case 7:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.dataBar,isShowValue:!0}};n.openPanel(u);break}case 8:{const u={...s.createDefaultRule,ranges:o,rule:{type:s.CFRuleType.iconSet,config:[],isShowValue:!0}};n.openPanel(u);break}case 2:{n.openPanel();break}case 1:{n.openPanel({...s.createDefaultRule(),ranges:o});break}case 9:{a.executeCommand(Pr.id,{ranges:o});break}case 10:{a.executeCommand(_n.id);break}}return!0}};var Jc=Object.defineProperty,Qc=Object.getOwnPropertyDescriptor,ed=(e,t,n,r)=>{for(var a=r>1?void 0:r?Qc(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Jc(t,n,a),a},Ne=(e,t)=>(n,r)=>t(n,r,e);let yn=class extends m.Disposable{constructor(e,t,n,r,a,o,i,u,l,c,d){super(),this._sheetInterceptorService=e,this._conditionalFormattingService=t,this._univerInstanceService=n,this._renderManagerService=r,this._conditionalFormattingViewModel=a,this._conditionalFormattingRuleModel=o,this._sheetSkeletonManagerService=i,this._selectionProtectionRenderModel=u,this._rangeProtectionRuleModel=l,this._worksheetProtectionRuleModel=c,this._permissionService=d,this._initViewModelInterceptor(),this._initSkeleton()}_initSkeleton(){const e=()=>{var n,r;this._sheetSkeletonManagerService.reCalculate();const t=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=(n=this._renderManagerService.getRenderById(t))==null?void 0:n.mainComponent)==null||r.makeDirty()};this.disposeWithMe(this._conditionalFormattingViewModel.markDirty$.pipe(De.bufferTime(16),De.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return t.filter(a=>a.unitId===n.getUnitId()&&a.subUnitId===r.getSheetId()).length>0})).subscribe(e)),this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.pipe(De.bufferTime(16),De.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return t.filter(a=>["sort","delete"].includes(a.type)&&a.unitId===n.getUnitId()&&a.subUnitId===r.getSheetId()).length>0})).subscribe(e)),this.disposeWithMe(this._conditionalFormattingService.ruleComputeStatus$.pipe(De.bufferTime(16),De.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return t.filter(a=>a.unitId===n.getUnitId()&&a.subUnitId===r.getSheetId()).length>0})).subscribe(e))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(V.INTERCEPTOR_POINT.CELL_CONTENT,{handler:(e,t,n)=>{const r=this._conditionalFormattingService.composeStyle(t.unitId,t.subUnitId,t.row,t.col);if(!r)return n(e);const a=t.workbook.getStyles(),i={...(typeof(e==null?void 0:e.s)=="string"?a.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},u={...e,s:i};return r.style&&Object.assign(i,r.style),u.fontRenderExtension||(u.fontRenderExtension={},r.isShowValue!==void 0&&(u.fontRenderExtension.isSkip=!r.isShowValue)),r.dataBar&&(u.dataBar=r.dataBar),r.iconSet&&(u.iconSet=r.iconSet,u.fontRenderExtension.leftOffset=s.DEFAULT_PADDING+s.DEFAULT_WIDTH),n(u)},priority:10}))}_initViewModelByRangeInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(V.INTERCEPTOR_POINT.CELL_CONTENT,{handler:(e={},t,n)=>{const{unitId:r,subUnitId:a,row:o,col:i}=t,u=this._selectionProtectionRenderModel.getCellInfo(r,a,o,i).filter(l=>!!l.ruleId).map(l=>{const c=this._rangeProtectionRuleModel.getRule(r,a,l.ruleId)||{};return{...l,ranges:c.ranges}}).filter(l=>!!l.ranges);if(u.length){const l=u.some(f=>!(f!=null&&f[$e.View])),c={...e,selectionProtection:u},{dataBar:d,iconSet:p}=c;return l&&(d&&(d.isSkip=!0),p&&(p.isSkip=!0)),n(c)}return n(e)}}))}_initViewModelBySheetInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(V.INTERCEPTOR_POINT.CELL_CONTENT,{handler:(e={},t,n)=>{var i,u,l,c,d;const{unitId:r,subUnitId:a}=t,o=this._worksheetProtectionRuleModel.getRule(r,a);if(o!=null&&o.permissionId&&o.name){const p=[{[$e.View]:(u=(i=this._permissionService.getPermissionPoint(new V.WorksheetViewPermission(r,a).id))==null?void 0:i.value)!=null?u:!1,[$e.Edit]:(c=(l=this._permissionService.getPermissionPoint(new V.WorksheetEditPermission(r,a).id))==null?void 0:l.value)!=null?c:!1}],f=!((d=p[0])!=null&&d[$e.View]),v={...e,hasWorksheetRule:!0,selectionProtection:p},{dataBar:y,iconSet:b}=v;return f&&(y&&(y.isSkip=!0),b&&(b.isSkip=!0)),n(v)}return n(e)}}))}};yn=ed([m.OnLifecycle(m.LifecycleStages.Rendered,yn),Ne(0,U.Inject(V.SheetInterceptorService)),Ne(1,U.Inject(s.ConditionalFormattingService)),Ne(2,U.Inject(m.IUniverInstanceService)),Ne(3,U.Inject(wo.IRenderManagerService)),Ne(4,U.Inject(s.ConditionalFormattingViewModel)),Ne(5,U.Inject(s.ConditionalFormattingRuleModel)),Ne(6,U.Inject(le.SheetSkeletonManagerService)),Ne(7,U.Inject(V.RangeProtectionRenderModel)),Ne(8,U.Inject(V.RangeProtectionRuleModel)),Ne(9,U.Inject(V.WorksheetProtectionRuleModel)),Ne(10,m.IPermissionService)],yn);var td=Object.defineProperty,nd=Object.getOwnPropertyDescriptor,rd=(e,t,n,r)=>{for(var a=r>1?void 0:r?nd(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&td(t,n,a),a},jt=(e,t)=>(n,r)=>t(n,r,e);let Sn=class extends m.Disposable{constructor(t,n,r,a,o){super();Ze(this,"_copyInfo");this._sheetClipboardService=t,this._conditionalFormattingRuleModel=n,this._injector=r,this._conditionalFormattingViewModel=a,this._univerInstanceService=o,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:s.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(t,n,r)=>this._collectConditionalRule(t,n,r),onPasteCells:(t,n,r,a)=>{const{copyType:o=le.COPY_TYPE.COPY,pasteType:i}=a,{range:u}=t||{},{range:l}=n;return this._generateConditionalFormattingMutations(l,{copyType:o,pasteType:i,copyRange:u})}}))}_collectConditionalRule(t,n,r){const a=new m.ObjectMatrix,o={};this._copyInfo={matrix:a,info:{unitId:t,subUnitId:n,cfMap:o}};const i=this._conditionalFormattingViewModel.getMatrix(t,n);if(!i)return;const u={get:this._injector.get.bind(this._injector)},l=le.rangeToDiscreteRange(r,u,t,n);if(!l)return;const{rows:c,cols:d}=l,p=new Set;c.forEach((f,v)=>{d.forEach((y,b)=>{const x=this._conditionalFormattingViewModel.getCellCf(t,n,f,y,i);x&&(x.cfList.forEach(_=>p.add(_.cfId)),a.setValue(v,b,x.cfList.map(_=>_.cfId)))})}),p.forEach(f=>{const v=this._conditionalFormattingRuleModel.getRule(t,n,f);v&&(o[f]=v.rule)})}_generateConditionalFormattingMutations(t,n){const r=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),a=r.getActiveSheet(),o=r.getUnitId(),i=a.getSheetId();if(n.copyType===le.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!n.copyRange)return{redos:[],undos:[]};if(![le.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,le.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,le.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(n.pasteType))return{redos:[],undos:[]};const{ranges:[u,l],mapFunc:c}=le.virtualizeDiscreteRanges([n.copyRange,t]),d=le.getRepeatRange(u,l,!0),p=this._conditionalFormattingViewModel.getMatrix(o,i),f={};m.Range.foreach(l,(g,O)=>{const{row:E,col:w}=c(g,O),j=this._conditionalFormattingViewModel.getCellCf(o,i,E,w,p);j&&j.cfList.forEach(L=>{if(!f[L.cfId]){const k=new m.ObjectMatrix;f[L.cfId]=k;const G=this._conditionalFormattingRuleModel.getRule(o,i,L.cfId);G==null||G.ranges.forEach(C=>{m.Range.foreach(C,(P,Q)=>{k.setValue(P,Q,1)})})}f[L.cfId].realDeleteValue(E,w)})});const{matrix:v,info:y}=this._copyInfo,b=[];let x=this._conditionalFormattingRuleModel.createCfId(o,i);const _={},T=g=>{if(_[g])return _[g];const O=y==null?void 0:y.cfMap[g],E=[...this._conditionalFormattingRuleModel.getSubunitRules(o,i)||[],...b].find(w=>m.Tools.diffValue(w.rule,O));if(E)return _[g]=E,E;{const w={rule:O,cfId:x,ranges:[],stopIfTrue:!1};return _[g]=w,b.push(w),x=`${Number(x)+1}`,w}};d.forEach(g=>{v&&v.forValue((O,E,w)=>{const j=m.Rectangle.getPositionRange({startRow:O,endRow:O,startColumn:E,endColumn:E},g.startRange),{row:L,col:k}=c(j.startRow,j.startColumn);w.forEach(G=>{if(!f[G]){const C=T(G),P=new m.ObjectMatrix;f[G]=P,C.ranges.forEach(Q=>{m.Range.foreach(Q,(_e,ve)=>{P.setValue(_e,ve,1)})})}f[G].setValue(L,k,1)})})});const S=[],R=[];for(const g in f){const O=f[g],E=V.findAllRectangle(V.createTopMatrixFromMatrix(O));if(!E.length){const w={unitId:o,subUnitId:i,cfId:g};S.push({id:s.DeleteConditionalRuleMutation.id,params:w}),R.push(...s.DeleteConditionalRuleMutationUndoFactory(this._injector,w))}if(b.some(w=>w.cfId===g)){const w=T(g),j={unitId:o,subUnitId:i,rule:{...w,ranges:E}};S.push({id:s.AddConditionalRuleMutation.id,params:j}),R.push(s.AddConditionalRuleMutationUndoFactory(this._injector,j))}else{const w=this._conditionalFormattingRuleModel.getRule(o,i,g);if(!w)continue;const j={unitId:o,subUnitId:i,rule:{...w,ranges:E}};S.push({id:s.SetConditionalRuleMutation.id,params:j}),R.push(...s.setConditionalRuleMutationUndoFactory(this._injector,j))}}return{redos:S,undos:R}}};Sn=rd([m.OnLifecycle(m.LifecycleStages.Rendered,Sn),jt(0,U.Inject(le.ISheetClipboardService)),jt(1,U.Inject(s.ConditionalFormattingRuleModel)),jt(2,U.Inject(U.Injector)),jt(3,U.Inject(s.ConditionalFormattingViewModel)),jt(4,U.Inject(m.IUniverInstanceService))],Sn);var ad=Object.defineProperty,od=Object.getOwnPropertyDescriptor,id=(e,t,n,r)=>{for(var a=r>1?void 0:r?od(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&ad(t,n,a),a},Lt=(e,t)=>(n,r)=>t(n,r,e);let bn=class extends m.Disposable{constructor(e,t,n,r,a){super(),this._injector=e,this._univerInstanceService=t,this._autoFillService=n,this._conditionalFormattingRuleModel=r,this._conditionalFormattingViewModel=a,this._initAutoFill()}_initAutoFill(){const e=()=>({redos:[],undos:[]}),t=(a,o,i,u,l)=>{const c=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),d=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet().getSheetId(),p={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},f={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row};m.Range.foreach(i,(v,y)=>{const b=m.Rectangle.getPositionRange({startRow:v,startColumn:y,endColumn:y,endRow:v},p),x=m.Rectangle.getPositionRange({startRow:v,startColumn:y,endColumn:y,endRow:v},f),{row:_,col:T}=l(b.startRow,b.startColumn),S=this._conditionalFormattingViewModel.getCellCf(c,d,_,T),{row:R,col:g}=l(x.startRow,x.startColumn),O=this._conditionalFormattingViewModel.getCellCf(c,d,R,g);O&&O.cfList.forEach(E=>{let w=u.get(E.cfId);if(!u.get(E.cfId)){const j=this._conditionalFormattingRuleModel.getRule(c,d,E.cfId);if(!j)return;w=new m.ObjectMatrix,j.ranges.forEach(L=>{m.Range.foreach(L,(k,G)=>{w.setValue(k,G,1)})}),u.set(E.cfId,w)}w.realDeleteValue(R,g)}),S&&S.cfList.forEach(E=>{let w=u.get(E.cfId);if(!u.get(E.cfId)){const j=this._conditionalFormattingRuleModel.getRule(c,d,E.cfId);if(!j)return;w=new m.ObjectMatrix,j.ranges.forEach(L=>{m.Range.foreach(L,(k,G)=>{w.setValue(k,G,1)})}),u.set(E.cfId,w)}w.setValue(R,g,1)})})},n=(a,o)=>{var _,T;const i=(_=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:_.getUnitId(),u=(T=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:T.getActiveSheet().getSheetId(),l=new Map,c=[],d=[];if(!i||!u)return e();const p=le.virtualizeDiscreteRanges([a,o]),[f,v]=p.ranges,{mapFunc:y}=p,b={row:f.startRow,col:f.startColumn};return le.getAutoFillRepeatRange(f,v).forEach(S=>{t(b,S.repeatStartCell,S.relativeRange,l,y)}),l.forEach((S,R)=>{const g=this._conditionalFormattingRuleModel.getRule(i,u,R);if(!g)return;const O=V.findAllRectangle(V.createTopMatrixFromMatrix(S)),E={unitId:i,subUnitId:u,rule:{...g,ranges:O}};c.push({id:s.SetConditionalRuleMutation.id,params:E}),d.push(...s.setConditionalRuleMutationUndoFactory(this._injector,E))}),{undos:d,redos:c}},r={id:s.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(a,o,i)=>{if(i===le.APPLY_TYPE.COPY||i===le.APPLY_TYPE.ONLY_FORMAT||i===le.APPLY_TYPE.SERIES){const{source:u,target:l}=a;return n(u,l)}return e()}};this.disposeWithMe(this._autoFillService.addHook(r))}};bn=id([m.OnLifecycle(m.LifecycleStages.Rendered,bn),Lt(0,U.Inject(U.Injector)),Lt(1,U.Inject(m.IUniverInstanceService)),Lt(2,U.Inject(le.IAutoFillService)),Lt(3,U.Inject(s.ConditionalFormattingRuleModel)),Lt(4,U.Inject(s.ConditionalFormattingViewModel))],bn);var sd=Object.defineProperty,ld=Object.getOwnPropertyDescriptor,ud=(e,t,n,r)=>{for(var a=r>1?void 0:r?ld(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&sd(t,n,a),a},Vt=(e,t)=>(n,r)=>t(n,r,e);let Tn=class extends m.Disposable{constructor(e,t,n,r,a){super(),this._conditionalFormattingRuleModel=e,this._univerInstanceService=t,this._injector=n,this._sheetSkeletonManagerService=r,this._refRangeService=a,this._initRefRange()}_initRefRange(){const e=new Map,t=(r,a,o)=>`${r}_${a}_${o}`,n=(r,a,o)=>{const i=l=>{const c=[...o.ranges],d=c.map(f=>V.handleDefaultRangeChangeWithEffectRefCommands(f,l)).filter(f=>!!f);if(s.isRangesEqual(d,c))return{redos:[],undos:[]};if(d.length){const f={unitId:r,subUnitId:a,rule:{...o,ranges:d}},v=[{id:s.SetConditionalRuleMutation.id,params:f}],y=s.setConditionalRuleMutationUndoFactory(this._injector,f);return{redos:v,undos:y}}else{const f={unitId:r,subUnitId:a,cfId:o.cfId},v=[{id:s.DeleteConditionalRuleMutation.id,params:f}],y=s.DeleteConditionalRuleMutationUndoFactory(this._injector,f);return{redos:v,undos:y}}},u=[];o.ranges.forEach(l=>{const c=this._refRangeService.registerRefRange(l,i);u.push(()=>c.dispose())}),e.set(t(r,a,o.cfId),()=>u.forEach(l=>l()))};this.disposeWithMe(we.merge(this._sheetSkeletonManagerService.currentSkeleton$.pipe(De.map(r=>r==null?void 0:r.sheetId),De.distinctUntilChanged())).pipe(De.switchMap(()=>new we.Observable(r=>{const a=new m.DisposableCollection;return r.next(a),()=>{a.dispose()}}))).subscribe(r=>{r.add(m.toDisposable(this._conditionalFormattingRuleModel.$ruleChange.subscribe(a=>{const{unitId:o,subUnitId:i,rule:u}=a,l=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),c=l.getActiveSheet();if(!(a.unitId!==l.getUnitId()||a.subUnitId!==c.getSheetId()))switch(a.type){case"add":{n(a.unitId,a.subUnitId,a.rule);break}case"delete":{const d=e.get(t(o,i,u.cfId));d&&d();break}case"set":{const d=e.get(t(o,i,u.cfId));d&&d(),n(a.unitId,a.subUnitId,a.rule)}}})))})),this.disposeWithMe(m.toDisposable(()=>{e.forEach(r=>{r()}),e.clear()}))}};Tn=ud([m.OnLifecycle(m.LifecycleStages.Rendered,Tn),Vt(0,U.Inject(s.ConditionalFormattingRuleModel)),Vt(1,U.Inject(m.IUniverInstanceService)),Vt(2,U.Inject(U.Injector)),Vt(3,U.Inject(le.SheetSkeletonManagerService)),Vt(4,U.Inject(V.RefRangeService))],Tn);var cd=Object.defineProperty,dd=Object.getOwnPropertyDescriptor,fd=(e,t,n,r)=>{for(var a=r>1?void 0:r?dd(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&cd(t,n,a),a},To=(e,t)=>(n,r)=>t(n,r,e);let Rn=class extends m.Disposable{constructor(e,t){super(),this._editorBridgeService=e,this._conditionalFormattingService=t,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(m.toDisposable(this._editorBridgeService.interceptor.intercept(this._editorBridgeService.interceptor.getInterceptPoints().AFTER_CELL_EDIT,{handler:(e,t,n)=>{const r=this._conditionalFormattingService.composeStyle(t.unitId,t.subUnitId,t.row,t.col);if(r!=null&&r.style&&(e!=null&&e.p)){const a=Object.keys(r==null?void 0:r.style);if(a.length>0){const o=s.getStringFromDataStream(e.p),i={...(typeof e.s=="string"?t.workbook.getStyles().get(e.s):e.s)||{}};a.forEach(l=>{delete i[l]});const u={...e,s:{...i},v:o};return delete u.p,n(u)}}return n(e)}})))}};Rn=fd([m.OnLifecycle(m.LifecycleStages.Rendered,Rn),To(0,U.Inject(le.IEditorBridgeService)),To(1,U.Inject(s.ConditionalFormattingService))],Rn);var pd=Object.defineProperty,hd=Object.getOwnPropertyDescriptor,md=(e,t,n,r)=>{for(var a=r>1?void 0:r?hd(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&pd(t,n,a),a},Ut=(e,t)=>(n,r)=>t(n,r,e);B.ConditionalFormattingClearController=class extends m.Disposable{constructor(t,n,r,a,o){super(),this._injector=t,this._univerInstanceService=n,this._sheetInterceptorService=r,this._selectionManagerService=a,this._conditionalFormattingRuleModel=o,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:t=>{const n=[],r=[],a={redos:n,undos:r};if([V.ClearSelectionFormatCommand.id,V.ClearSelectionAllCommand.id].includes(t.id)){const o=this._selectionManagerService.getSelectionRanges();if(!o)return a;const i=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),u=i.getActiveSheet(),l=this._conditionalFormattingRuleModel.getSubunitRules(i.getUnitId(),u.getSheetId());if(!l||!l.length)return a;l.filter(c=>o.some(d=>c.ranges.some(p=>m.Rectangle.getIntersects(p,d)))).forEach(c=>{const p=new V.RangeMergeUtil().add(...c.ranges).subtract(...o).merge();if(p.length){const f={id:s.SetConditionalRuleMutation.id,params:{unitId:i.getUnitId(),subUnitId:u.getSheetId(),rule:{...c,ranges:p}}},v=s.setConditionalRuleMutationUndoFactory(this._injector,f.params);n.push(f),r.push(...v)}else{const f={id:s.DeleteConditionalRuleMutation.id,params:{unitId:i.getUnitId(),subUnitId:u.getSheetId(),cfId:c.cfId}},v=s.DeleteConditionalRuleMutationUndoFactory(this._injector,f.params);n.push(f),r.push(...v)}})}return a}}))}},B.ConditionalFormattingClearController=md([m.OnLifecycle(m.LifecycleStages.Rendered,B.ConditionalFormattingClearController),Ut(0,U.Inject(U.Injector)),Ut(1,U.Inject(m.IUniverInstanceService)),Ut(2,U.Inject(V.SheetInterceptorService)),Ut(3,U.Inject(V.SelectionManagerService)),Ut(4,U.Inject(s.ConditionalFormattingRuleModel))],B.ConditionalFormattingClearController);var gd=Object.defineProperty,vd=Object.getOwnPropertyDescriptor,yd=(e,t,n,r)=>{for(var a=r>1?void 0:r?vd(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&gd(t,n,a),a},xr=(e,t)=>(n,r)=>t(n,r,e);let Cn=class extends m.Disposable{constructor(e,t,n){super(),this._localeService=e,this._commandService=t,this._sheetPermissionInterceptorBaseController=n,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{e.id===un.id&&(this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[V.WorkbookEditablePermission],rangeTypes:[V.RangeProtectionPermissionEditPoint],worksheetTypes:[V.WorksheetEditPermission,V.WorksheetSetCellStylePermission]},e.params.rule.ranges)||this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr")))}))}};Cn=yd([m.OnLifecycle(m.LifecycleStages.Rendered,Cn),xr(0,U.Inject(m.LocaleService)),xr(1,m.ICommandService),xr(2,U.Inject(le.SheetPermissionInterceptorBaseController))],Cn);var Sd=Object.defineProperty,bd=Object.getOwnPropertyDescriptor,Td=(e,t,n,r)=>{for(var a=r>1?void 0:r?bd(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Sd(t,n,a),a},Ro=(e,t)=>(n,r)=>t(n,r,e);B.UniverSheetsConditionalFormattingUIPlugin=(kt=class extends m.Plugin{constructor(t={},n,r){super(),this._config=t,this._injector=n,this._commandService=r,this._config=m.Tools.deepMerge({},Zc,this._config),this._initCommand(),s.SheetsConditionalFormattingPlugin.dependencyList.forEach(a=>{this._injector.add(a)}),this._injector.add([yn]),this._injector.add([Tn]),this._injector.add([Sn]),this._injector.add([bn]),this._injector.add([Cn]),this._injector.add([Ct,{useFactory:()=>this._injector.createInstance(Ct,this._config)}]),this._injector.add([Dt]),this._injector.add([Rn]),this._injector.add([B.ConditionalFormattingClearController])}_initCommand(){[...s.SheetsConditionalFormattingPlugin.mutationList,...B.UniverSheetsConditionalFormattingUIPlugin.commandList].forEach(t=>{this._commandService.registerCommand(t)})}},Ze(kt,"pluginName",s.SHEET_CONDITIONAL_FORMATTING_PLUGIN),Ze(kt,"type",m.UniverInstanceType.UNIVER_SHEET),Ze(kt,"commandList",[Io,xo,Oo,Eo,Po,Do,Mo,No,jo,bo,hr,za,ka,un,Pr,_n]),kt),B.UniverSheetsConditionalFormattingUIPlugin=Td([Ro(1,U.Inject(U.Injector)),Ro(2,U.Inject(m.ICommandService))],B.UniverSheetsConditionalFormattingUIPlugin);const Rd=Object.freeze(Object.defineProperty({__proto__:null,default:{sheet:{cf:{title:"Conditional Formatting",menu:{manageConditionalFormatting:"Manage Conditional Formatting",createConditionalFormatting:"Create Conditional Formatting",clearRangeRules:"Clear Rules for Selected Range",clearWorkSheetRules:"Clear Rules for Entire Sheet"},form:{lessThan:"The value must be less than {0}",lessThanOrEqual:"The value must be less than or equal to {0}",greaterThan:"The value must be greater than {0}",greaterThanOrEqual:"The value must be greater than or equal to {0}",rangeSelector:"Select Range or Enter Value"},iconSet:{direction:"Direction",shape:"Shape",mark:"Mark",rank:"Rank",rule:"Rule",icon:"Icon",type:"Type",value:"Value",reverseIconOrder:"Reverse Icon Order",and:"And",when:"When",onlyShowIcon:"Only Show Icon"},symbol:{greaterThan:">",greaterThanOrEqual:">=",lessThan:"<",lessThanOrEqual:"<="},panel:{createRule:"Create Rule",clear:"Clear All Rules",range:"Apply Range",styleType:"Style Type",submit:"Submit",cancel:"Cancel",rankAndAverage:"Top/Bottom/Average",styleRule:"Style Rule",isNotBottom:"Top",isBottom:"Bottom",greaterThanAverage:"Greater Than Average",lessThanAverage:"Less Than Average",medianValue:"Median Value",fillType:"Fill Type",pureColor:"Solid Color",gradient:"Gradient",colorSet:"Color Set",positive:"Positive",native:"Negative",workSheet:"Entire Sheet",selectedRange:"Selected Range",managerRuleSelect:"Manage {0} Rules",onlyShowDataBar:"Only Show Data Bars"},preview:{describe:{beginsWith:"Begins with {0}",endsWith:"Ends with {0}",containsText:"Text contains {0}",notContainsText:"Text does not contain {0}",equal:"Equal to {0}",notEqual:"Not equal to {0}",containsBlanks:"Contains Blanks",notContainsBlanks:"Does not contain Blanks",containsErrors:"Contains Errors",notContainsErrors:"Does not contain Errors",greaterThan:"Greater than {0}",greaterThanOrEqual:"Greater than or equal to {0}",lessThan:"Less than {0}",lessThanOrEqual:"Less than or equal to {0}",notBetween:"Not between {0} and {1}",between:"Between {0} and {1}",yesterday:"Yesterday",tomorrow:"Tomorrow",last7Days:"Last 7 Days",thisMonth:"This Month",lastMonth:"Last Month",nextMonth:"Next Month",thisWeek:"This Week",lastWeek:"Last Week",nextWeek:"Next Week",today:"Today",topN:"Top {0}",bottomN:"Bottom {0}",topNPercent:"Top {0}%",bottomNPercent:"Bottom {0}%"}},operator:{beginsWith:"Begins with",endsWith:"Ends with",containsText:"Text contains",notContainsText:"Text does not contain",equal:"Equal to",notEqual:"Not equal to",containsBlanks:"Contains Blanks",notContainsBlanks:"Does not contain Blanks",containsErrors:"Contains Errors",notContainsErrors:"Does not contain Errors",greaterThan:"Greater than",greaterThanOrEqual:"Greater than or equal to",lessThan:"Less than",lessThanOrEqual:"Less than or equal to",notBetween:"Not between",between:"Between",yesterday:"Yesterday",tomorrow:"Tomorrow",last7Days:"Last 7 Days",thisMonth:"This Month",lastMonth:"Last Month",nextMonth:"Next Month",thisWeek:"This Week",lastWeek:"Last Week",nextWeek:"Next Week",today:"Today"},ruleType:{highlightCell:"Highlight Cell",dataBar:"Data Bar",colorScale:"Color Scale",formula:"Custom Formula",iconSet:"Icon Set",duplicateValues:"Duplicate Values",uniqueValues:"Unique Values"},subRuleType:{uniqueValues:"Unique Values",duplicateValues:"Duplicate Values",rank:"Rank",text:"Text",timePeriod:"Time Period",number:"Number",average:"Average"},valueType:{num:"Number",min:"Minimum",max:"Maximum",percent:"Percentage",percentile:"Percentile",formula:"Formula",none:"None"}}}}},Symbol.toStringTag,{value:"Module"})),Cd=Object.freeze(Object.defineProperty({__proto__:null,default:{sheet:{cf:{title:"条件格式",menu:{manageConditionalFormatting:"管理条件格式",createConditionalFormatting:"新建条件格式",clearRangeRules:"清除所选区域的规则",clearWorkSheetRules:"清除整个工作表的规则"},form:{lessThan:"该值必须小于 {0}",lessThanOrEqual:"该值必须小于等于 {0}",greaterThan:"该值必大于 {0}",greaterThanOrEqual:"该值必大于等于 {0}",rangeSelector:"选择范围或者输入值"},iconSet:{direction:"方向",shape:"形状",mark:"标记",rank:"等级",rule:"规则",icon:"图标",type:"类型",value:"值",reverseIconOrder:"反转图标次序",and:"且",when:"当值",onlyShowIcon:"仅显示图标"},symbol:{greaterThan:">",greaterThanOrEqual:">=",lessThan:"<",lessThanOrEqual:"<="},panel:{createRule:"新增规则",clear:"清空所有规则",range:"应用范围",styleType:"样式类型",submit:"确认",cancel:"取消",rankAndAverage:"最前/最后/平均值",styleRule:"样式规则",isNotBottom:"最前",isBottom:"最后",greaterThanAverage:"大于平均值",lessThanAverage:"小于平均值",medianValue:"中间值",fillType:"填充方式",pureColor:"纯色",gradient:"渐变",colorSet:"颜色设置",positive:"正值",native:"负值",workSheet:"整张工作表",selectedRange:"所选单元格",managerRuleSelect:"管理 {0} 的规则",onlyShowDataBar:"仅显示数据条"},preview:{describe:{beginsWith:"开头为{0}",endsWith:"结尾为{0}",containsText:"文本包含{0}",notContainsText:"文本不包含{0}",equal:"等于{0}",notEqual:"不等于{0}",containsBlanks:"为空",notContainsBlanks:"不为空",containsErrors:"错误",notContainsErrors:"非错误",greaterThan:"大于{0}",greaterThanOrEqual:"大于等于{0}",lessThan:"小于{0}",lessThanOrEqual:"小于等于{0}",notBetween:"不介于{0}和{1}之间",between:"介于{0}和{1}之间",yesterday:"昨日",tomorrow:"明日",last7Days:"最近7天",thisMonth:"本月",lastMonth:"上个月",nextMonth:"下个月",thisWeek:"本周",lastWeek:"上周",nextWeek:"下周",today:"今日",topN:"前{0}项",bottomN:"后{0}项",topNPercent:"前{0}%",bottomNPercent:"后{0}%"}},operator:{beginsWith:"开头为",endsWith:"结尾为",containsText:"文本包含",notContainsText:"文本不包含",equal:"等于",notEqual:"不等于",containsBlanks:"为空",notContainsBlanks:"不为空",containsErrors:"错误",notContainsErrors:"非错误",greaterThan:"大于",greaterThanOrEqual:"大于等于",lessThan:"小于",lessThanOrEqual:"小于等于",notBetween:"不介于",between:"介于",yesterday:"昨日",tomorrow:"明日",last7Days:"最近 7 天",thisMonth:"本月",lastMonth:"上个月",nextMonth:"下个月",thisWeek:"本周",lastWeek:"上周",nextWeek:"下周",today:"今日"},ruleType:{highlightCell:"突出显示单元格",dataBar:"数据条",colorScale:"色阶",formula:"自定义公式",iconSet:"图标集",duplicateValues:"重复值",uniqueValues:"唯一值"},subRuleType:{uniqueValues:"唯一值",duplicateValues:"重复值",rank:"最前最后",text:"文本",timePeriod:"时间日期",number:"数值",average:"平均值"},valueType:{num:"数值",min:"最小值",max:"最大值",percent:"百分比",percentile:"百分点",formula:"公式",none:"无"}}}}},Symbol.toStringTag,{value:"Module"})),_d=Object.freeze(Object.defineProperty({__proto__:null,default:{sheet:{cf:{title:"Условное форматирование",menu:{manageConditionalFormatting:"Управление условным форматированием",createConditionalFormatting:"Создание условного форматирования",clearRangeRules:"Очистить правила для выбранного диапазона",clearWorkSheetRules:"Очистить правила для всего листа"},form:{lessThan:"Значение должно быть меньше {0}",lessThanOrEqual:"Значение должно быть меньше или равно {0}",greaterThan:"Значение должно быть больше {0}",greaterThanOrEqual:"Значение должно быть больше или равно {0}",rangeSelector:"Выберите диапазон или введите значение"},iconSet:{direction:"Направление",shape:"Форма",mark:"Знак",rank:"Ранг",rule:"Правило",icon:"Иконка",type:"Тип",value:"Значение",reverseIconOrder:"Обратный порядок иконок",and:"И",when:"Когда",onlyShowIcon:"Показывать только иконку"},symbol:{greaterThan:">",greaterThanOrEqual:">=",lessThan:"<",lessThanOrEqual:"<="},panel:{createRule:"Создать правило",clear:"Очистить все правила",range:"Применить диапазон",styleType:"Тип стиля",submit:"Подтвердить",cancel:"Отменить",rankAndAverage:"Верх/Низ/Среднее",styleRule:"Правило стиля",isNotBottom:"Верх",isBottom:"Низ",greaterThanAverage:"Больше среднего",lessThanAverage:"Меньше среднего",medianValue:"Медианное значение",fillType:"Тип заполнения",pureColor:"Сплошной цвет",gradient:"Градиент",colorSet:"Набор цветов",positive:"Положительный",native:"Отрицательный",workSheet:"Весь лист",selectedRange:"Выбранный диапазон",managerRuleSelect:"Управление правилами {0}",onlyShowDataBar:"Показывать только гистограммы данных"},preview:{describe:{beginsWith:"Начинается с {0}",endsWith:"Заканчивается на {0}",containsText:"Содержит текст {0}",notContainsText:"Не содержит текст {0}",equal:"Равно {0}",notEqual:"Не равно {0}",containsBlanks:"Содержит пустые ячейки",notContainsBlanks:"Не содержит пустых ячеек",containsErrors:"Содержит ошибки",notContainsErrors:"Не содержит ошибок",greaterThan:"Больше чем {0}",greaterThanOrEqual:"Больше или равно {0}",lessThan:"Меньше чем {0}",lessThanOrEqual:"Меньше или равно {0}",notBetween:"Не между {0} и {1}",between:"Между {0} и {1}",yesterday:"Вчера",tomorrow:"Завтра",last7Days:"Последние 7 дней",thisMonth:"Этот месяц",lastMonth:"Прошлый месяц",nextMonth:"Следующий месяц",thisWeek:"Эта неделя",lastWeek:"Прошлая неделя",nextWeek:"Следующая неделя",today:"Сегодня",topN:"Топ {0}",bottomN:"Низ {0}",topNPercent:"Топ {0}%",bottomNPercent:"Низ {0}%"}},operator:{beginsWith:"Начинается с",endsWith:"Заканчивается на",containsText:"Содержит текст",notContainsText:"Не содержит текст",equal:"Равно",notEqual:"Не равно",containsBlanks:"Содержит пустые ячейки",notContainsBlanks:"Не содержит пустых ячеек",containsErrors:"Содержит ошибки",notContainsErrors:"Не содержит ошибок",greaterThan:"Больше чем",greaterThanOrEqual:"Больше или равно",lessThan:"Меньше чем",lessThanOrEqual:"Меньше или равно",notBetween:"Не между",between:"Между",yesterday:"Вчера",tomorrow:"Завтра",last7Days:"Последние 7 дней",thisMonth:"Этот месяц",lastMonth:"Прошлый месяц",nextMonth:"Следующий месяц",thisWeek:"Эта неделя",lastWeek:"Прошлая неделя",nextWeek:"Следующая неделя",today:"Сегодня"},ruleType:{highlightCell:"Выделение ячеек",dataBar:"Гистограмма данных",colorScale:"Цветовая шкала",formula:"Пользовательская формула",iconSet:"Набор иконок",duplicateValues:"Дублирующиеся значения",uniqueValues:"Уникальные значения"},subRuleType:{uniqueValues:"Уникальные значения",duplicateValues:"Дублирующиеся значения",rank:"Ранг",text:"Текст",timePeriod:"Период времени",number:"Число",average:"Среднее"},valueType:{num:"Число",min:"Минимум",max:"Максимум",percent:"Процент",percentile:"Процентиль",formula:"Формула",none:"Нет"}}}}},Symbol.toStringTag,{value:"Module"}));B.AddCfCommand=un,B.enUS=Rd,B.ruRU=_d,B.zhCN=Cd,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});
|