@univerjs/sheets-conditional-formatting-ui 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cjs/index.js CHANGED
@@ -1,175 +1,170 @@
1
- "use strict";var Pr=Object.defineProperty;var Nr=(t,e,r)=>e in t?Pr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var xe=(t,e,r)=>Nr(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("@univerjs/core"),u=require("@univerjs/sheets-conditional-formatting"),X=require("@univerjs/sheets"),ee=require("@univerjs/ui"),_=require("react/jsx-runtime"),N=require("react"),oe=require("@univerjs/design"),rn=require("@univerjs/engine-formula"),de=require("@univerjs/sheets-ui"),lr=require("react-dom"),be=require("rxjs"),ft=require("@univerjs/sheets-formula-ui"),ur=require("@univerjs/engine-render"),it=require("rxjs/operators"),an={type:w.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i}=e,c=t.get(u.ConditionalFormattingRuleModel),y=t.get(w.ICommandService),p=t.get(w.IUniverInstanceService),S=X.getSheetCommandTarget(p);if(!S)return!1;const{unitId:v,subUnitId:R}=S,x=c.createCfId(v,R),T={ranges:r,cfId:x,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.average,operator:i,style:n}};return y.executeCommand(u.AddConditionalRuleMutation.id,{unitId:v,subUnitId:R,rule:T})}},pt={type:w.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(t,e){if(!e)return!1;const{rule:r}=e,n=t.get(w.IUndoRedoService),o=t.get(w.ICommandService),i=t.get(u.ConditionalFormattingRuleModel),c=t.get(w.IUniverInstanceService),y=X.getSheetCommandTarget(c);if(!y)return!1;const{unitId:p,subUnitId:S}=y,v=i.createCfId(p,S),R={unitId:p,subUnitId:S,rule:{...r,cfId:r.cfId||v}},x=u.AddConditionalRuleMutationUndoFactory(t,R),T=o.syncExecuteCommand(u.AddConditionalRuleMutation.id,R);return T&&n.pushUndoRedo({unitID:p,redoMutations:[{id:u.AddConditionalRuleMutation.id,params:R}],undoMutations:[x]}),T}},sn={type:w.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,config:n,stopIfTrue:o}=e,i=t.get(u.ConditionalFormattingRuleModel),c=t.get(w.ICommandService),y=t.get(w.IUniverInstanceService),p=X.getSheetCommandTarget(y);if(!p)return!1;const{unitId:S,subUnitId:v}=p,R=i.createCfId(S,v),x={ranges:r,cfId:R,stopIfTrue:!!o,rule:{type:u.CFRuleType.colorScale,config:n}};return c.executeCommand(u.AddConditionalRuleMutation.id,{unitId:S,subUnitId:v,rule:x})}},ln={type:w.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,min:n,max:o,nativeColor:i,positiveColor:c,isGradient:y,stopIfTrue:p,isShowValue:S}=e,v=t.get(u.ConditionalFormattingRuleModel),R=t.get(w.IUniverInstanceService),x=X.getSheetCommandTarget(R);if(!x)return!1;const{unitId:T,subUnitId:b}=x,I=t.get(w.ICommandService),h=v.createCfId(T,b),a={ranges:r,cfId:h,stopIfTrue:!!p,rule:{type:u.CFRuleType.dataBar,isShowValue:S,config:{min:n,max:o,nativeColor:i,positiveColor:c,isGradient:y}}};return I.executeCommand(u.AddConditionalRuleMutation.id,{unitId:T,subUnitId:b,rule:a})}},un={type:w.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o}=e,i=t.get(u.ConditionalFormattingRuleModel),c=t.get(w.ICommandService),y=t.get(w.IUniverInstanceService),p=X.getSheetCommandTarget(y);if(!p)return!1;const{unitId:S,subUnitId:v}=p,R=i.createCfId(S,v),x={ranges:r,cfId:R,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.duplicateValues,style:n}};return c.executeCommand(u.AddConditionalRuleMutation.id,{unitId:S,subUnitId:v,rule:x})}},cn={type:w.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i,value:c}=e,y=t.get(u.ConditionalFormattingRuleModel),p=t.get(w.ICommandService),S=t.get(w.IUniverInstanceService),v=X.getSheetCommandTarget(S);if(!v)return!1;const{unitId:R,subUnitId:x}=v,T=y.createCfId(R,x);let b;if([u.CFNumberOperator.between,u.CFNumberOperator.notBetween].includes(i)){const I=c;if(I.length!==2||!Array.isArray(I))return!1;b={ranges:r,cfId:T,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.number,operator:i,style:n,value:I}}}else{const I=c;if(typeof I!="number")return!1;b={ranges:r,cfId:T,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.number,operator:i,style:n,value:I}}}return p.executeCommand(u.AddConditionalRuleMutation.id,{unitId:R,subUnitId:x,rule:b})}},dn={type:w.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,isPercent:i,isBottom:c,value:y}=e,p=t.get(u.ConditionalFormattingRuleModel),S=t.get(w.IUniverInstanceService),v=t.get(w.ICommandService),R=X.getSheetCommandTarget(S);if(!R)return!1;const{unitId:x,subUnitId:T}=R,b=p.createCfId(x,T),I={ranges:r,cfId:b,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.rank,isPercent:i,isBottom:c,style:n,value:y}};return v.executeCommand(u.AddConditionalRuleMutation.id,{unitId:x,subUnitId:T,rule:I})}},fn={type:w.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i,value:c}=e,y=t.get(u.ConditionalFormattingRuleModel),p=t.get(w.IUniverInstanceService),S=X.getSheetCommandTarget(p);if(!S)return!1;const{unitId:v,subUnitId:R}=S,x=t.get(w.ICommandService),T=y.createCfId(v,R),b={ranges:r,cfId:T,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.text,operator:i,style:n,value:c}};return x.executeCommand(u.AddConditionalRuleMutation.id,{unitId:v,subUnitId:R,rule:b})}},pn={type:w.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i}=e,c=t.get(u.ConditionalFormattingRuleModel),y=t.get(w.IUniverInstanceService),p=t.get(w.ICommandService),S=X.getSheetCommandTarget(y);if(!S)return!1;const{unitId:v,subUnitId:R}=S,x=c.createCfId(v,R),T={ranges:r,cfId:x,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.timePeriod,operator:i,style:n}};return p.executeCommand(u.AddConditionalRuleMutation.id,{unitId:v,subUnitId:R,rule:T})}},hn={type:w.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o}=e,i=t.get(u.ConditionalFormattingRuleModel),c=t.get(w.IUniverInstanceService),y=t.get(w.ICommandService),p=X.getSheetCommandTarget(c);if(!p)return!1;const{unitId:S,subUnitId:v}=p,R=i.createCfId(S,v),x={ranges:r,cfId:R,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.uniqueValues,style:n}};return y.executeCommand(u.AddConditionalRuleMutation.id,{unitId:S,subUnitId:v,rule:x})}},Vt={type:w.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(t,e){var I;if(!e)return!1;const r=t.get(u.ConditionalFormattingRuleModel),n=t.get(w.IUniverInstanceService),o=t.get(w.ICommandService),i=t.get(w.IUndoRedoService),c=t.get(X.SheetsSelectionsService),y=X.getSheetCommandTarget(n,e);if(!y)return!1;const{unitId:p,subUnitId:S}=y,v=((I=c.getCurrentSelections())==null?void 0:I.map(h=>h.range))||[],R=r.getSubunitRules(p,S);if(!(R!=null&&R.length)||!v.length)return!1;const x=[],T=[];R.forEach(h=>{const a=new w.ObjectMatrix;h.ranges.forEach(d=>{w.Range.foreach(d,(C,l)=>{a.setValue(C,l,1)})}),v.forEach(d=>{w.Range.foreach(d,(C,l)=>{a.realDeleteValue(C,l)})});const s=X.findAllRectangle(X.createTopMatrixFromMatrix(a));if(s.length){const d={...h,ranges:s},C={unitId:p,subUnitId:S,rule:d},l=u.setConditionalRuleMutationUndoFactory(t,C);x.push({id:u.SetConditionalRuleMutation.id,params:C}),T.push(...l)}else{const d={unitId:p,subUnitId:S,cfId:h.cfId},C=u.DeleteConditionalRuleMutationUndoFactory(t,d);x.push({id:u.DeleteConditionalRuleMutation.id,params:d}),T.push(...C)}});const b=w.sequenceExecute(x,o).result;return b&&i.pushUndoRedo({unitID:p,redoMutations:x,undoMutations:T}),b}},ht={type:w.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(t,e){const r=t.get(u.ConditionalFormattingRuleModel),n=t.get(w.IUniverInstanceService),o=t.get(w.ICommandService),i=t.get(w.IUndoRedoService),c=X.getSheetCommandTarget(n,e);if(!c)return!1;const{unitId:y,subUnitId:p}=c,S=r.getSubunitRules(y,p);if(!(S!=null&&S.length))return!1;const v=S.map(b=>({cfId:b.cfId,unitId:y,subUnitId:p})),R=v.map(b=>({id:u.DeleteConditionalRuleMutation.id,params:b})),x=v.map(b=>u.DeleteConditionalRuleMutationUndoFactory(t,b)[0]),T=w.sequenceExecute(R,o).result;return T&&i.pushUndoRedo({unitID:y,redoMutations:R,undoMutations:x}),T}},at={type:w.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(w.IUndoRedoService),n=t.get(w.ICommandService),o=t.get(w.IUniverInstanceService),i=X.getSheetCommandTarget(o,e);if(!i)return!1;const{unitId:c,subUnitId:y}=i,p={unitId:c,subUnitId:y,cfId:e.cfId},S=u.DeleteConditionalRuleMutationUndoFactory(t,p),v=n.syncExecuteCommand(u.DeleteConditionalRuleMutation.id,p);return v&&r.pushUndoRedo({unitID:c,undoMutations:S,redoMutations:[{id:u.DeleteConditionalRuleMutation.id,params:p}]}),v}},zt={type:w.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(w.IUndoRedoService),n=t.get(w.ICommandService),o=t.get(w.IUniverInstanceService),i=t.get(u.ConditionalFormattingRuleModel),c=X.getSheetCommandTarget(o,e);if(!c)return!1;const{unitId:y,subUnitId:p}=c,S=u.transformSupportSymmetryAnchor(e.start,e.end,i.getSubunitRules(y,p)||[],I=>I.cfId);if(!S)return!1;const[v,R]=S,x={unitId:y,subUnitId:p,start:v,end:R},T=u.MoveConditionalRuleMutationUndoFactory(x),b=n.syncExecuteCommand(u.MoveConditionalRuleMutation.id,x);return b&&r.pushUndoRedo({unitID:y,redoMutations:[{id:u.MoveConditionalRuleMutation.id,params:x}],undoMutations:T}),b}},kt={type:w.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(w.IUndoRedoService),n=t.get(w.ICommandService),o=t.get(w.IUniverInstanceService),i=X.getSheetCommandTarget(o,e);if(!i)return!1;const{unitId:c,subUnitId:y}=i,p={unitId:c,subUnitId:y,rule:e.rule},S=u.setConditionalRuleMutationUndoFactory(t,p),v=n.syncExecuteCommand(u.SetConditionalRuleMutation.id,p);return v&&r.pushUndoRedo({unitID:c,undoMutations:S,redoMutations:[{id:u.SetConditionalRuleMutation.id,params:p}]}),v}},jr="univer-conditional-formatting-wrap",Lr="univer-title",Ur="univer-label",Vr="univer-label-container",zr="univer-m-t-base",kr="univer-m-t-sm",$r="univer-m-t-xl",Ar="univer-m-l-sm",qr="univer-m-l-xl",Wr="univer-m-l-xxs",Hr="univer-m-l-0",Br="univer-m-r-0",z={conditionalFormattingWrap:jr,title:Lr,label:Ur,labelContainer:Vr,mTBase:zr,mTSm:kr,mTXl:$r,mLSm:Ar,mLXl:qr,mLXxs:Wr,mL0:Hr,mR0:Br};var Ce=function(){return Ce=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Ce.apply(this,arguments)},Gr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]]);return r},$e=N.forwardRef(function(t,e){var r=t.icon,n=t.id,o=t.className,i=t.extend,c=Gr(t,["icon","id","className","extend"]),y="univerjs-icon univerjs-icon-".concat(n," ").concat(o||"").trim(),p=N.useRef("_".concat(Kr()));return cr(r,"".concat(n),{defIds:r.defIds,idSuffix:p.current},Ce({ref:e,className:y},c),i)});function cr(t,e,r,n,o){return N.createElement(t.tag,Ce(Ce({key:e},Xr(t,r,o)),n),(Yr(t,r).children||[]).map(function(i,c){return cr(i,"".concat(e,"-").concat(t.tag,"-").concat(c),r,void 0,o)}))}function Xr(t,e,r){var n=Ce({},t.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1),t.tag==="mask"&&n.id&&(n.id=n.id+e.idSuffix),Object.entries(n).forEach(function(i){var c=i[0],y=i[1];c==="mask"&&typeof y=="string"&&(n[c]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))});var o=e.defIds;return!o||o.length===0||(t.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(function(i){var c=i[0],y=i[1];typeof y=="string"&&(n[c]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),n}function Yr(t,e){var r,n=e.defIds;return!n||n.length===0?t:t.tag==="defs"&&(!((r=t.children)===null||r===void 0)&&r.length)?Ce(Ce({},t),{children:t.children.map(function(o){return typeof o.attrs.id=="string"&&n&&n.indexOf(o.attrs.id)>-1?Ce(Ce({},o),{attrs:Ce(Ce({},o.attrs),{id:o.attrs.id+e.idSuffix})}):o})}):t}function Kr(){return Math.random().toString(36).substring(2,8)}$e.displayName="UniverIcon";var Zr={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"}}]},Ot=N.forwardRef(function(t,e){return N.createElement($e,Object.assign({},t,{id:"delete-single",ref:e,icon:Zr}))});Ot.displayName="DeleteSingle";var Jr={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"}}]},dr=N.forwardRef(function(t,e){return N.createElement($e,Object.assign({},t,{id:"increase-single",ref:e,icon:Jr}))});dr.displayName="IncreaseSingle";var Qr={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"}}]},$t=N.forwardRef(function(t,e){return N.createElement($e,Object.assign({},t,{id:"more-down-single",ref:e,icon:Qr}))});$t.displayName="MoreDownSingle";var eo={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"}}]}]},fr=N.forwardRef(function(t,e){return N.createElement($e,Object.assign({},t,{id:"sequence-single",ref:e,icon:eo}))});fr.displayName="SequenceSingle";var to={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_436_41",style:{maskType:"alpha"},width:17,height:17,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0.35 0.48H16.35V16.48H0.35z"}}]},{tag:"g",attrs:{mask:"url(#mask0_436_41)",fillRule:"evenodd",clipRule:"evenodd"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2.27177 13.714L13.5855 2.40025L14.434 3.24878L3.1203 14.5625L2.27177 13.714Z"}},{tag:"path",attrs:{fill:"#E5E5E5",d:"M4.2603 1.82495L2.89617 1.82495C2.23343 1.82495 1.69617 2.36221 1.69617 3.02495L1.69617 4.38908L3.02617 4.38908L3.02617 3.15495L4.2603 3.15495L4.2603 1.82495ZM15.0092 4.38908L15.0092 3.02495C15.0092 2.36221 14.4719 1.82495 13.8092 1.82495L12.4451 1.82495L12.4451 3.15495L13.6792 3.15495L13.6792 4.38908L15.0092 4.38908ZM6.98856 1.82495L6.98856 3.15495L9.71681 3.15495L9.71681 1.82495L6.98856 1.82495ZM15.0092 7.11734L13.6792 7.11734L13.6792 9.84559L15.0092 9.84559L15.0092 7.11734ZM15.0092 12.5739L13.6792 12.5739L13.6792 13.808L12.4451 13.808L12.4451 15.138L13.8092 15.138C14.4719 15.138 15.0092 14.6007 15.0092 13.938L15.0092 12.5739ZM9.71681 15.138L9.71681 13.808L6.98856 13.808L6.98856 15.138L9.71681 15.138ZM4.2603 15.138L4.2603 13.808L3.02617 13.808L3.02617 12.5739L1.69617 12.5739L1.69617 13.938C1.69617 14.6007 2.23343 15.138 2.89617 15.138L4.2603 15.138ZM1.69617 9.8456L3.02617 9.8456L3.02617 7.11734L1.69617 7.11734L1.69617 9.8456Z"}}]}]},mt=N.forwardRef(function(t,e){return N.createElement($e,Object.assign({},t,{id:"slash-single",ref:e,icon:to}))});mt.displayName="SlashSingle";function no(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function pr(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}),r}var Ht={exports:{}},We={},ot={exports:{}},ro=ot.exports,bn;function mn(){return bn||(bn=1,function(t,e){(function(r,n){n(e)})(ro,function(r){function n(A){return function(se,O,M,P,V,Y,q){return A(se,O,q)}}function o(A){return function(se,O,M,P){if(!se||!O||typeof se!="object"||typeof O!="object")return A(se,O,M,P);var V=P.get(se),Y=P.get(O);if(V&&Y)return V===O&&Y===se;P.set(se,O),P.set(O,se);var q=A(se,O,M,P);return P.delete(se),P.delete(O),q}}function i(A,J){var se={};for(var O in A)se[O]=A[O];for(var O in J)se[O]=J[O];return se}function c(A){return A.constructor===Object||A.constructor==null}function y(A){return typeof A.then=="function"}function p(A,J){return A===J||A!==A&&J!==J}var S="[object Arguments]",v="[object Boolean]",R="[object Date]",x="[object RegExp]",T="[object Map]",b="[object Number]",I="[object Object]",h="[object Set]",a="[object String]",s=Object.prototype.toString;function d(A){var J=A.areArraysEqual,se=A.areDatesEqual,O=A.areMapsEqual,M=A.areObjectsEqual,P=A.areRegExpsEqual,V=A.areSetsEqual,Y=A.createIsNestedEqual,q=Y(Z);function Z(K,te,ce){if(K===te)return!0;if(!K||!te||typeof K!="object"||typeof te!="object")return K!==K&&te!==te;if(c(K)&&c(te))return M(K,te,q,ce);var Me=Array.isArray(K),ye=Array.isArray(te);if(Me||ye)return Me===ye&&J(K,te,q,ce);var me=s.call(K);return me!==s.call(te)?!1:me===R?se(K,te,q,ce):me===x?P(K,te,q,ce):me===T?O(K,te,q,ce):me===h?V(K,te,q,ce):me===I||me===S?y(K)||y(te)?!1:M(K,te,q,ce):me===v||me===b||me===a?p(K.valueOf(),te.valueOf()):!1}return Z}function C(A,J,se,O){var M=A.length;if(J.length!==M)return!1;for(;M-- >0;)if(!se(A[M],J[M],M,M,A,J,O))return!1;return!0}var l=o(C);function m(A,J){return p(A.valueOf(),J.valueOf())}function f(A,J,se,O){var M=A.size===J.size;if(!M)return!1;if(!A.size)return!0;var P={},V=0;return A.forEach(function(Y,q){if(M){var Z=!1,K=0;J.forEach(function(te,ce){!Z&&!P[K]&&(Z=se(q,ce,V,K,A,J,O)&&se(Y,te,q,ce,A,J,O))&&(P[K]=!0),K++}),V++,M=Z}}),M}var g=o(f),F="_owner",j=Object.prototype.hasOwnProperty;function U(A,J,se,O){var M=Object.keys(A),P=M.length;if(Object.keys(J).length!==P)return!1;for(var V;P-- >0;){if(V=M[P],V===F){var Y=!!A.$$typeof,q=!!J.$$typeof;if((Y||q)&&Y!==q)return!1}if(!j.call(J,V)||!se(A[V],J[V],V,V,A,J,O))return!1}return!0}var L=o(U);function E(A,J){return A.source===J.source&&A.flags===J.flags}function D(A,J,se,O){var M=A.size===J.size;if(!M)return!1;if(!A.size)return!0;var P={};return A.forEach(function(V,Y){if(M){var q=!1,Z=0;J.forEach(function(K,te){!q&&!P[Z]&&(q=se(V,K,Y,te,A,J,O))&&(P[Z]=!0),Z++}),M=q}}),M}var k=o(D),B=Object.freeze({areArraysEqual:C,areDatesEqual:m,areMapsEqual:f,areObjectsEqual:U,areRegExpsEqual:E,areSetsEqual:D,createIsNestedEqual:n}),G=Object.freeze({areArraysEqual:l,areDatesEqual:m,areMapsEqual:g,areObjectsEqual:L,areRegExpsEqual:E,areSetsEqual:k,createIsNestedEqual:n}),ne=d(B);function Q(A,J){return ne(A,J,void 0)}var W=d(i(B,{createIsNestedEqual:function(){return p}}));function $(A,J){return W(A,J,void 0)}var re=d(G);function ie(A,J){return re(A,J,new WeakMap)}var le=d(i(G,{createIsNestedEqual:function(){return p}}));function pe(A,J){return le(A,J,new WeakMap)}function ge(A){return d(i(B,A(B)))}function Se(A){var J=d(i(G,A(G)));return function(se,O,M){return M===void 0&&(M=new WeakMap),J(se,O,M)}}r.circularDeepEqual=ie,r.circularShallowEqual=pe,r.createCustomCircularEqual=Se,r.createCustomEqual=ge,r.deepEqual=Q,r.sameValueZeroEqual=p,r.shallowEqual=$,Object.defineProperty(r,"__esModule",{value:!0})})}(ot,ot.exports)),ot.exports}var yt={exports:{}},Rn;function gn(){if(Rn)return yt.exports;Rn=1;function t(r){var n,o,i="";if(typeof r=="string"||typeof r=="number")i+=r;else if(typeof r=="object")if(Array.isArray(r)){var c=r.length;for(n=0;n<c;n++)r[n]&&(o=t(r[n]))&&(i&&(i+=" "),i+=o)}else for(o in r)r[o]&&(i&&(i+=" "),i+=o);return i}function e(){for(var r,n,o=0,i="",c=arguments.length;o<c;o++)(r=arguments[o])&&(n=t(r))&&(i&&(i+=" "),i+=n);return i}return yt.exports=e,yt.exports.clsx=e,yt.exports}var ae={},Bt,Tn;function oo(){return Tn||(Tn=1,Bt=function(e,r,n){return e===r?!0:e.className===r.className&&n(e.style,r.style)&&e.width===r.width&&e.autoSize===r.autoSize&&e.cols===r.cols&&e.draggableCancel===r.draggableCancel&&e.draggableHandle===r.draggableHandle&&n(e.verticalCompact,r.verticalCompact)&&n(e.compactType,r.compactType)&&n(e.layout,r.layout)&&n(e.margin,r.margin)&&n(e.containerPadding,r.containerPadding)&&e.rowHeight===r.rowHeight&&e.maxRows===r.maxRows&&e.isBounded===r.isBounded&&e.isDraggable===r.isDraggable&&e.isResizable===r.isResizable&&e.allowOverlap===r.allowOverlap&&e.preventCollision===r.preventCollision&&e.useCSSTransforms===r.useCSSTransforms&&e.transformScale===r.transformScale&&e.isDroppable===r.isDroppable&&n(e.resizeHandles,r.resizeHandles)&&n(e.resizeHandle,r.resizeHandle)&&e.onLayoutChange===r.onLayoutChange&&e.onDragStart===r.onDragStart&&e.onDrag===r.onDrag&&e.onDragStop===r.onDragStop&&e.onResizeStart===r.onResizeStart&&e.onResize===r.onResize&&e.onResizeStop===r.onResizeStop&&e.onDrop===r.onDrop&&n(e.droppingItem,r.droppingItem)&&n(e.innerRef,r.innerRef)}),Bt}var In;function Ae(){if(In)return ae;In=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.bottom=n,ae.childrenEqual=p,ae.cloneLayout=o,ae.cloneLayoutItem=y,ae.collides=v,ae.compact=R,ae.compactItem=b,ae.compactType=A,ae.correctBounds=I,ae.fastPositionEqual=S,ae.fastRGLPropsEqual=void 0,ae.getAllCollisions=s,ae.getFirstCollision=a,ae.getLayoutItem=h,ae.getStatics=d,ae.modifyLayout=i,ae.moveElement=C,ae.moveElementAwayFromCollision=l,ae.noop=void 0,ae.perc=m,ae.resizeItemInDirection=W,ae.setTopLeft=re,ae.setTransform=$,ae.sortLayoutItems=ie,ae.sortLayoutItemsByColRow=pe,ae.sortLayoutItemsByRowCol=le,ae.synchronizeLayoutWithChildren=ge,ae.validateLayout=Se,ae.withLayoutItem=c;var t=mn(),e=r(N);function r(O){return O&&O.__esModule?O:{default:O}}function n(O){let M=0,P;for(let V=0,Y=O.length;V<Y;V++)P=O[V].y+O[V].h,P>M&&(M=P);return M}function o(O){const M=Array(O.length);for(let P=0,V=O.length;P<V;P++)M[P]=y(O[P]);return M}function i(O,M){const P=Array(O.length);for(let V=0,Y=O.length;V<Y;V++)M.i===O[V].i?P[V]=M:P[V]=O[V];return P}function c(O,M,P){let V=h(O,M);return V?(V=P(y(V)),O=i(O,V),[O,V]):[O,null]}function y(O){return{w:O.w,h:O.h,x:O.x,y:O.y,i:O.i,minW:O.minW,maxW:O.maxW,minH:O.minH,maxH:O.maxH,moved:!!O.moved,static:!!O.static,isDraggable:O.isDraggable,isResizable:O.isResizable,resizeHandles:O.resizeHandles,isBounded:O.isBounded}}function p(O,M){return(0,t.deepEqual)(e.default.Children.map(O,P=>P==null?void 0:P.key),e.default.Children.map(M,P=>P==null?void 0:P.key))&&(0,t.deepEqual)(e.default.Children.map(O,P=>P==null?void 0:P.props["data-grid"]),e.default.Children.map(M,P=>P==null?void 0:P.props["data-grid"]))}ae.fastRGLPropsEqual=oo();function S(O,M){return O.left===M.left&&O.top===M.top&&O.width===M.width&&O.height===M.height}function v(O,M){return!(O.i===M.i||O.x+O.w<=M.x||O.x>=M.x+M.w||O.y+O.h<=M.y||O.y>=M.y+M.h)}function R(O,M,P,V){const Y=d(O),q=ie(O,M),Z=Array(O.length);for(let K=0,te=q.length;K<te;K++){let ce=y(q[K]);ce.static||(ce=b(Y,ce,M,P,q,V),Y.push(ce)),Z[O.indexOf(q[K])]=ce,ce.moved=!1}return Z}const x={x:"w",y:"h"};function T(O,M,P,V){const Y=x[V];M[V]+=1;const q=O.map(Z=>Z.i).indexOf(M.i);for(let Z=q+1;Z<O.length;Z++){const K=O[Z];if(!K.static){if(K.y>M.y+M.h)break;v(M,K)&&T(O,K,P+M[Y],V)}}M[V]=P}function b(O,M,P,V,Y,q){const Z=P==="vertical",K=P==="horizontal";if(Z)for(M.y=Math.min(n(O),M.y);M.y>0&&!a(O,M);)M.y--;else if(K)for(;M.x>0&&!a(O,M);)M.x--;let te;for(;(te=a(O,M))&&!(P===null&&q);)if(K?T(Y,M,te.x+te.w,"x"):T(Y,M,te.y+te.h,"y"),K&&M.x+M.w>V)for(M.x=V-M.w,M.y++;M.x>0&&!a(O,M);)M.x--;return M.y=Math.max(M.y,0),M.x=Math.max(M.x,0),M}function I(O,M){const P=d(O);for(let V=0,Y=O.length;V<Y;V++){const q=O[V];if(q.x+q.w>M.cols&&(q.x=M.cols-q.w),q.x<0&&(q.x=0,q.w=M.cols),!q.static)P.push(q);else for(;a(P,q);)q.y++}return O}function h(O,M){for(let P=0,V=O.length;P<V;P++)if(O[P].i===M)return O[P]}function a(O,M){for(let P=0,V=O.length;P<V;P++)if(v(O[P],M))return O[P]}function s(O,M){return O.filter(P=>v(P,M))}function d(O){return O.filter(M=>M.static)}function C(O,M,P,V,Y,q,Z,K,te){if(M.static&&M.isDraggable!==!0||M.y===V&&M.x===P)return O;`${M.i}${String(P)}${String(V)}${M.x}${M.y}`;const ce=M.x,Me=M.y;typeof P=="number"&&(M.x=P),typeof V=="number"&&(M.y=V),M.moved=!0;let ye=ie(O,Z);(Z==="vertical"&&typeof V=="number"?Me>=V:Z==="horizontal"&&typeof P=="number"?ce>=P:!1)&&(ye=ye.reverse());const je=s(ye,M),vt=je.length>0;if(vt&&te)return o(O);if(vt&&q)return`${M.i}`,M.x=ce,M.y=Me,M.moved=!1,O;for(let Wt=0,Dr=je.length;Wt<Dr;Wt++){const Fe=je[Wt];`${M.i}${M.x}${M.y}${Fe.i}${Fe.x}${Fe.y}`,!Fe.moved&&(Fe.static?O=l(O,Fe,M,Y,Z):O=l(O,M,Fe,Y,Z))}return O}function l(O,M,P,V,Y,q){const Z=Y==="horizontal",K=Y==="vertical",te=M.static;if(V){V=!1;const ye={x:Z?Math.max(M.x-P.w,0):P.x,y:K?Math.max(M.y-P.h,0):P.y,w:P.w,h:P.h,i:"-1"},me=a(O,ye),je=me&&me.y+me.h>M.y,vt=me&&M.x+M.w>me.x;if(me){if(je&&K)return C(O,P,void 0,M.y+1,V,te,Y);if(je&&Y==null)return M.y=P.y,P.y=P.y+P.h,O;if(vt&&Z)return C(O,M,P.x,void 0,V,te,Y)}else return`${P.i}${ye.x}${ye.y}`,C(O,P,Z?ye.x:void 0,K?ye.y:void 0,V,te,Y)}const ce=Z?P.x+1:void 0,Me=K?P.y+1:void 0;return ce==null&&Me==null?O:C(O,P,Z?P.x+1:void 0,K?P.y+1:void 0,V,te,Y)}function m(O){return O*100+"%"}const f=(O,M,P,V)=>O+P>V?M:P,g=(O,M,P)=>O<0?M:P,F=O=>Math.max(0,O),j=O=>Math.max(0,O),U=(O,M,P)=>{let{left:V,height:Y,width:q}=M;const Z=O.top-(Y-O.height);return{left:V,width:q,height:g(Z,O.height,Y),top:j(Z)}},L=(O,M,P)=>{let{top:V,left:Y,height:q,width:Z}=M;return{top:V,height:q,width:f(O.left,O.width,Z,P),left:F(Y)}},E=(O,M,P)=>{let{top:V,height:Y,width:q}=M;const Z=O.left-(q-O.width);return{height:Y,width:Z<0?O.width:f(O.left,O.width,q,P),top:j(V),left:F(Z)}},D=(O,M,P)=>{let{top:V,left:Y,height:q,width:Z}=M;return{width:Z,left:Y,height:g(V,O.height,q),top:j(V)}},Q={n:U,ne:function(){return U(arguments.length<=0?void 0:arguments[0],L(...arguments))},e:L,se:function(){return D(arguments.length<=0?void 0:arguments[0],L(...arguments))},s:D,sw:function(){return D(arguments.length<=0?void 0:arguments[0],E(...arguments))},w:E,nw:function(){return U(arguments.length<=0?void 0:arguments[0],E(...arguments))}};function W(O,M,P,V){const Y=Q[O];return Y?Y(M,{...M,...P},V):P}function $(O){let{top:M,left:P,width:V,height:Y}=O;const q=`translate(${P}px,${M}px)`;return{transform:q,WebkitTransform:q,MozTransform:q,msTransform:q,OTransform:q,width:`${V}px`,height:`${Y}px`,position:"absolute"}}function re(O){let{top:M,left:P,width:V,height:Y}=O;return{top:`${M}px`,left:`${P}px`,width:`${V}px`,height:`${Y}px`,position:"absolute"}}function ie(O,M){return M==="horizontal"?pe(O):M==="vertical"?le(O):O}function le(O){return O.slice(0).sort(function(M,P){return M.y>P.y||M.y===P.y&&M.x>P.x?1:M.y===P.y&&M.x===P.x?0:-1})}function pe(O){return O.slice(0).sort(function(M,P){return M.x>P.x||M.x===P.x&&M.y>P.y?1:-1})}function ge(O,M,P,V,Y){O=O||[];const q=[];e.default.Children.forEach(M,K=>{if((K==null?void 0:K.key)==null)return;const te=h(O,String(K.key)),ce=K.props["data-grid"];te&&ce==null?q.push(y(te)):ce?q.push(y({...ce,i:K.key})):q.push(y({w:1,h:1,x:0,y:n(q),i:String(K.key)}))});const Z=I(q,{cols:P});return Y?Z:R(Z,V,P)}function Se(O){let M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const P=["x","y","w","h"];if(!Array.isArray(O))throw new Error(M+" must be an array!");for(let V=0,Y=O.length;V<Y;V++){const q=O[V];for(let Z=0;Z<P.length;Z++)if(typeof q[P[Z]]!="number")throw new Error("ReactGridLayout: "+M+"["+V+"]."+P[Z]+" must be a number!")}}function A(O){const{verticalCompact:M,compactType:P}=O||{};return M===!1?null:P}function J(){}const se=()=>{};return ae.noop=se,ae}var Te={},wn;function vn(){if(wn)return Te;wn=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.calcGridColWidth=t,Te.calcGridItemPosition=r,Te.calcGridItemWHPx=e,Te.calcWH=o,Te.calcXY=n,Te.clamp=i;function t(c){const{margin:y,containerPadding:p,containerWidth:S,cols:v}=c;return(S-y[0]*(v-1)-p[0]*2)/v}function e(c,y,p){return Number.isFinite(c)?Math.round(y*c+Math.max(0,c-1)*p):c}function r(c,y,p,S,v,R){const{margin:x,containerPadding:T,rowHeight:b}=c,I=t(c),h={};return R&&R.resizing?(h.width=Math.round(R.resizing.width),h.height=Math.round(R.resizing.height)):(h.width=e(S,I,x[0]),h.height=e(v,b,x[1])),R&&R.dragging?(h.top=Math.round(R.dragging.top),h.left=Math.round(R.dragging.left)):R&&R.resizing&&typeof R.resizing.top=="number"&&typeof R.resizing.left=="number"?(h.top=Math.round(R.resizing.top),h.left=Math.round(R.resizing.left)):(h.top=Math.round((b+x[1])*p+T[1]),h.left=Math.round((I+x[0])*y+T[0])),h}function n(c,y,p,S,v){const{margin:R,cols:x,rowHeight:T,maxRows:b}=c,I=t(c);let h=Math.round((p-R[0])/(I+R[0])),a=Math.round((y-R[1])/(T+R[1]));return h=i(h,0,x-S),a=i(a,0,b-v),{x:h,y:a}}function o(c,y,p,S,v,R){const{margin:x,maxRows:T,cols:b,rowHeight:I}=c,h=t(c);let a=Math.round((y+x[0])/(h+x[0])),s=Math.round((p+x[1])/(I+x[1])),d=i(a,0,b-S),C=i(s,0,T-v);return["sw","w","nw"].indexOf(R)!==-1&&(d=i(a,0,b)),["nw","n","ne"].indexOf(R)!==-1&&(C=i(s,0,T)),{w:d,h:C}}function i(c,y,p){return Math.max(Math.min(c,p),y)}return Te}var He={},Gt={exports:{}},Xt,xn;function io(){if(xn)return Xt;xn=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Xt=t,Xt}var Yt,_n;function ao(){if(_n)return Yt;_n=1;var t=io();function e(){}function r(){}return r.resetWarningCache=e,Yt=function(){function n(c,y,p,S,v,R){if(R!==t){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}n.isRequired=n;function o(){return n}var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:e};return i.PropTypes=i,i},Yt}var En;function Oe(){return En||(En=1,Gt.exports=ao()()),Gt.exports}var Be={exports:{}},Kt={};function hr(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=hr(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function On(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=hr(t))&&(n&&(n+=" "),n+=e);return n}const so=Object.freeze(Object.defineProperty({__proto__:null,clsx:On,default:On},Symbol.toStringTag,{value:"Module"})),lo=pr(so);var fe={},_e={},Mn;function At(){if(Mn)return _e;Mn=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.dontSetMe=o,_e.findInArray=t,_e.int=n,_e.isFunction=e,_e.isNum=r;function t(i,c){for(let y=0,p=i.length;y<p;y++)if(c.apply(c,[i[y],y,i]))return i[y]}function e(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Function]"}function r(i){return typeof i=="number"&&!isNaN(i)}function n(i){return parseInt(i,10)}function o(i,c,y){if(i[c])return new Error("Invalid prop ".concat(c," passed to ").concat(y," - do not set this, set it on the child."))}return _e}var Ee={},Fn;function uo(){if(Fn)return Ee;Fn=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.browserPrefixToKey=r,Ee.browserPrefixToStyle=n,Ee.default=void 0,Ee.getPrefix=e;const t=["Moz","Webkit","O","ms"];function e(){var i;let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const y=(i=window.document)===null||i===void 0||(i=i.documentElement)===null||i===void 0?void 0:i.style;if(!y||c in y)return"";for(let p=0;p<t.length;p++)if(r(c,t[p])in y)return t[p];return""}function r(i,c){return c?"".concat(c).concat(o(i)):i}function n(i,c){return c?"-".concat(c.toLowerCase(),"-").concat(i):i}function o(i){let c="",y=!0;for(let p=0;p<i.length;p++)y?(c+=i[p].toUpperCase(),y=!1):i[p]==="-"?y=!0:c+=i[p];return c}return Ee.default=e(),Ee}var Dn;function yn(){if(Dn)return fe;Dn=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.addClassName=l,fe.addEvent=y,fe.addUserSelectStyles=d,fe.createCSSTransform=b,fe.createSVGTransform=I,fe.getTouch=a,fe.getTouchIdentifier=s,fe.getTranslation=h,fe.innerHeight=R,fe.innerWidth=x,fe.matchesSelector=i,fe.matchesSelectorAndParentsTo=c,fe.offsetXYFromParent=T,fe.outerHeight=S,fe.outerWidth=v,fe.removeClassName=m,fe.removeEvent=p,fe.removeUserSelectStyles=C;var t=At(),e=n(uo());function r(f){if(typeof WeakMap!="function")return null;var g=new WeakMap,F=new WeakMap;return(r=function(j){return j?F:g})(f)}function n(f,g){if(f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var F=r(g);if(F&&F.has(f))return F.get(f);var j={},U=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var L in f)if(L!=="default"&&Object.prototype.hasOwnProperty.call(f,L)){var E=U?Object.getOwnPropertyDescriptor(f,L):null;E&&(E.get||E.set)?Object.defineProperty(j,L,E):j[L]=f[L]}return j.default=f,F&&F.set(f,j),j}let o="";function i(f,g){return o||(o=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(F){return(0,t.isFunction)(f[F])})),(0,t.isFunction)(f[o])?f[o](g):!1}function c(f,g,F){let j=f;do{if(i(j,g))return!0;if(j===F)return!1;j=j.parentNode}while(j);return!1}function y(f,g,F,j){if(!f)return;const U={capture:!0,...j};f.addEventListener?f.addEventListener(g,F,U):f.attachEvent?f.attachEvent("on"+g,F):f["on"+g]=F}function p(f,g,F,j){if(!f)return;const U={capture:!0,...j};f.removeEventListener?f.removeEventListener(g,F,U):f.detachEvent?f.detachEvent("on"+g,F):f["on"+g]=null}function S(f){let g=f.clientHeight;const F=f.ownerDocument.defaultView.getComputedStyle(f);return g+=(0,t.int)(F.borderTopWidth),g+=(0,t.int)(F.borderBottomWidth),g}function v(f){let g=f.clientWidth;const F=f.ownerDocument.defaultView.getComputedStyle(f);return g+=(0,t.int)(F.borderLeftWidth),g+=(0,t.int)(F.borderRightWidth),g}function R(f){let g=f.clientHeight;const F=f.ownerDocument.defaultView.getComputedStyle(f);return g-=(0,t.int)(F.paddingTop),g-=(0,t.int)(F.paddingBottom),g}function x(f){let g=f.clientWidth;const F=f.ownerDocument.defaultView.getComputedStyle(f);return g-=(0,t.int)(F.paddingLeft),g-=(0,t.int)(F.paddingRight),g}function T(f,g,F){const U=g===g.ownerDocument.body?{left:0,top:0}:g.getBoundingClientRect(),L=(f.clientX+g.scrollLeft-U.left)/F,E=(f.clientY+g.scrollTop-U.top)/F;return{x:L,y:E}}function b(f,g){const F=h(f,g,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:F}}function I(f,g){return h(f,g,"")}function h(f,g,F){let{x:j,y:U}=f,L="translate(".concat(j).concat(F,",").concat(U).concat(F,")");if(g){const E="".concat(typeof g.x=="string"?g.x:g.x+F),D="".concat(typeof g.y=="string"?g.y:g.y+F);L="translate(".concat(E,", ").concat(D,")")+L}return L}function a(f,g){return f.targetTouches&&(0,t.findInArray)(f.targetTouches,F=>g===F.identifier)||f.changedTouches&&(0,t.findInArray)(f.changedTouches,F=>g===F.identifier)}function s(f){if(f.targetTouches&&f.targetTouches[0])return f.targetTouches[0].identifier;if(f.changedTouches&&f.changedTouches[0])return f.changedTouches[0].identifier}function d(f){if(!f)return;let g=f.getElementById("react-draggable-style-el");g||(g=f.createElement("style"),g.type="text/css",g.id="react-draggable-style-el",g.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
1
+ "use strict";var xr=Object.defineProperty;var Ir=(t,e,r)=>e in t?xr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Ie=(t,e,r)=>Ir(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("@univerjs/core"),u=require("@univerjs/sheets-conditional-formatting"),Y=require("@univerjs/sheets"),ee=require("@univerjs/ui"),I=require("react/jsx-runtime"),j=require("react"),Q=require("@univerjs/design"),Yt=require("@univerjs/engine-formula"),de=require("@univerjs/sheets-ui"),tr=require("react-dom"),Se=require("rxjs"),dt=require("@univerjs/sheets-formula-ui"),nr=require("@univerjs/engine-render"),it=require("rxjs/operators"),Zt={type:x.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i}=e,c=t.get(u.ConditionalFormattingRuleModel),y=t.get(x.ICommandService),p=t.get(x.IUniverInstanceService),S=Y.getSheetCommandTarget(p);if(!S)return!1;const{unitId:v,subUnitId:T}=S,_=c.createCfId(v,T),w={ranges:r,cfId:_,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.average,operator:i,style:n}};return y.executeCommand(u.AddConditionalRuleMutation.id,{unitId:v,subUnitId:T,rule:w})}},Jt={type:x.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,config:n,stopIfTrue:o}=e,i=t.get(u.ConditionalFormattingRuleModel),c=t.get(x.ICommandService),y=t.get(x.IUniverInstanceService),p=Y.getSheetCommandTarget(y);if(!p)return!1;const{unitId:S,subUnitId:v}=p,T=i.createCfId(S,v),_={ranges:r,cfId:T,stopIfTrue:!!o,rule:{type:u.CFRuleType.colorScale,config:n}};return c.executeCommand(u.AddConditionalRuleMutation.id,{unitId:S,subUnitId:v,rule:_})}},Qt={type:x.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,min:n,max:o,nativeColor:i,positiveColor:c,isGradient:y,stopIfTrue:p,isShowValue:S}=e,v=t.get(u.ConditionalFormattingRuleModel),T=t.get(x.IUniverInstanceService),_=Y.getSheetCommandTarget(T);if(!_)return!1;const{unitId:w,subUnitId:b}=_,R=t.get(x.ICommandService),h=v.createCfId(w,b),a={ranges:r,cfId:h,stopIfTrue:!!p,rule:{type:u.CFRuleType.dataBar,isShowValue:S,config:{min:n,max:o,nativeColor:i,positiveColor:c,isGradient:y}}};return R.executeCommand(u.AddConditionalRuleMutation.id,{unitId:w,subUnitId:b,rule:a})}},en={type:x.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o}=e,i=t.get(u.ConditionalFormattingRuleModel),c=t.get(x.ICommandService),y=t.get(x.IUniverInstanceService),p=Y.getSheetCommandTarget(y);if(!p)return!1;const{unitId:S,subUnitId:v}=p,T=i.createCfId(S,v),_={ranges:r,cfId:T,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.duplicateValues,style:n}};return c.executeCommand(u.AddConditionalRuleMutation.id,{unitId:S,subUnitId:v,rule:_})}},tn={type:x.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i,value:c}=e,y=t.get(u.ConditionalFormattingRuleModel),p=t.get(x.ICommandService),S=t.get(x.IUniverInstanceService),v=Y.getSheetCommandTarget(S);if(!v)return!1;const{unitId:T,subUnitId:_}=v,w=y.createCfId(T,_);let b;if([u.CFNumberOperator.between,u.CFNumberOperator.notBetween].includes(i)){const R=c;if(R.length!==2||!Array.isArray(R))return!1;b={ranges:r,cfId:w,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.number,operator:i,style:n,value:R}}}else{const R=c;if(typeof R!="number")return!1;b={ranges:r,cfId:w,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.number,operator:i,style:n,value:R}}}return p.executeCommand(u.AddConditionalRuleMutation.id,{unitId:T,subUnitId:_,rule:b})}},nn={type:x.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,isPercent:i,isBottom:c,value:y}=e,p=t.get(u.ConditionalFormattingRuleModel),S=t.get(x.IUniverInstanceService),v=t.get(x.ICommandService),T=Y.getSheetCommandTarget(S);if(!T)return!1;const{unitId:_,subUnitId:w}=T,b=p.createCfId(_,w),R={ranges:r,cfId:b,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.rank,isPercent:i,isBottom:c,style:n,value:y}};return v.executeCommand(u.AddConditionalRuleMutation.id,{unitId:_,subUnitId:w,rule:R})}},rn={type:x.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i,value:c}=e,y=t.get(u.ConditionalFormattingRuleModel),p=t.get(x.IUniverInstanceService),S=Y.getSheetCommandTarget(p);if(!S)return!1;const{unitId:v,subUnitId:T}=S,_=t.get(x.ICommandService),w=y.createCfId(v,T),b={ranges:r,cfId:w,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.text,operator:i,style:n,value:c}};return _.executeCommand(u.AddConditionalRuleMutation.id,{unitId:v,subUnitId:T,rule:b})}},on={type:x.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i}=e,c=t.get(u.ConditionalFormattingRuleModel),y=t.get(x.IUniverInstanceService),p=t.get(x.ICommandService),S=Y.getSheetCommandTarget(y);if(!S)return!1;const{unitId:v,subUnitId:T}=S,_=c.createCfId(v,T),w={ranges:r,cfId:_,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.timePeriod,operator:i,style:n}};return p.executeCommand(u.AddConditionalRuleMutation.id,{unitId:v,subUnitId:T,rule:w})}},an={type:x.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o}=e,i=t.get(u.ConditionalFormattingRuleModel),c=t.get(x.IUniverInstanceService),y=t.get(x.ICommandService),p=Y.getSheetCommandTarget(c);if(!p)return!1;const{unitId:S,subUnitId:v}=p,T=i.createCfId(S,v),_={ranges:r,cfId:T,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.uniqueValues,style:n}};return y.executeCommand(u.AddConditionalRuleMutation.id,{unitId:S,subUnitId:v,rule:_})}},_r="univer-conditional-formatting-wrap",Er="univer-title",Or="univer-label",Pr="univer-label-container",Fr="univer-m-t-base",Dr="univer-m-t-sm",Mr="univer-m-t-xl",Nr="univer-m-l-sm",jr="univer-m-l-xl",Lr="univer-m-l-xxs",Ur="univer-m-l-0",Vr="univer-m-r-0",z={conditionalFormattingWrap:_r,title:Er,label:Or,labelContainer:Pr,mTBase:Fr,mTSm:Dr,mTXl:Mr,mLSm:Nr,mLXl:jr,mLXxs:Lr,mL0:Ur,mR0:Vr};var Ce=function(){return Ce=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Ce.apply(this,arguments)},zr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]]);return r},$e=j.forwardRef(function(t,e){var r=t.icon,n=t.id,o=t.className,i=t.extend,c=zr(t,["icon","id","className","extend"]),y="univerjs-icon univerjs-icon-".concat(n," ").concat(o||"").trim(),p=j.useRef("_".concat(Ar()));return rr(r,"".concat(n),{defIds:r.defIds,idSuffix:p.current},Ce({ref:e,className:y},c),i)});function rr(t,e,r,n,o){return j.createElement(t.tag,Ce(Ce({key:e},kr(t,r,o)),n),($r(t,r).children||[]).map(function(i,c){return rr(i,"".concat(e,"-").concat(t.tag,"-").concat(c),r,void 0,o)}))}function kr(t,e,r){var n=Ce({},t.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1),t.tag==="mask"&&n.id&&(n.id=n.id+e.idSuffix),Object.entries(n).forEach(function(i){var c=i[0],y=i[1];c==="mask"&&typeof y=="string"&&(n[c]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))});var o=e.defIds;return!o||o.length===0||(t.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(function(i){var c=i[0],y=i[1];typeof y=="string"&&(n[c]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),n}function $r(t,e){var r,n=e.defIds;return!n||n.length===0?t:t.tag==="defs"&&(!((r=t.children)===null||r===void 0)&&r.length)?Ce(Ce({},t),{children:t.children.map(function(o){return typeof o.attrs.id=="string"&&n&&n.indexOf(o.attrs.id)>-1?Ce(Ce({},o),{attrs:Ce(Ce({},o.attrs),{id:o.attrs.id+e.idSuffix})}):o})}):t}function Ar(){return Math.random().toString(36).substring(2,8)}$e.displayName="UniverIcon";var qr={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"}}]},xt=j.forwardRef(function(t,e){return j.createElement($e,Object.assign({},t,{id:"delete-single",ref:e,icon:qr}))});xt.displayName="DeleteSingle";var Wr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},or=j.forwardRef(function(t,e){return j.createElement($e,Object.assign({},t,{id:"increase-single",ref:e,icon:Wr}))});or.displayName="IncreaseSingle";var Hr={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"}}]},Nt=j.forwardRef(function(t,e){return j.createElement($e,Object.assign({},t,{id:"more-down-single",ref:e,icon:Hr}))});Nt.displayName="MoreDownSingle";var Br={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"}}]}]},ir=j.forwardRef(function(t,e){return j.createElement($e,Object.assign({},t,{id:"sequence-single",ref:e,icon:Br}))});ir.displayName="SequenceSingle";var Gr={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"}}]}]},ft=j.forwardRef(function(t,e){return j.createElement($e,Object.assign({},t,{id:"slash-single",ref:e,icon:Gr}))});ft.displayName="SlashSingle";function Xr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ar(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}),r}var Vt={exports:{}},We={},ot={exports:{}},Yr=ot.exports,pn;function sn(){return pn||(pn=1,function(t,e){(function(r,n){n(e)})(Yr,function(r){function n($){return function(ae,O,P,M,V,G,A){return $(ae,O,A)}}function o($){return function(ae,O,P,M){if(!ae||!O||typeof ae!="object"||typeof O!="object")return $(ae,O,P,M);var V=M.get(ae),G=M.get(O);if(V&&G)return V===O&&G===ae;M.set(ae,O),M.set(O,ae);var A=$(ae,O,P,M);return M.delete(ae),M.delete(O),A}}function i($,J){var ae={};for(var O in $)ae[O]=$[O];for(var O in J)ae[O]=J[O];return ae}function c($){return $.constructor===Object||$.constructor==null}function y($){return typeof $.then=="function"}function p($,J){return $===J||$!==$&&J!==J}var S="[object Arguments]",v="[object Boolean]",T="[object Date]",_="[object RegExp]",w="[object Map]",b="[object Number]",R="[object Object]",h="[object Set]",a="[object String]",s=Object.prototype.toString;function f($){var J=$.areArraysEqual,ae=$.areDatesEqual,O=$.areMapsEqual,P=$.areObjectsEqual,M=$.areRegExpsEqual,V=$.areSetsEqual,G=$.createIsNestedEqual,A=G(K);function K(X,te,ce){if(X===te)return!0;if(!X||!te||typeof X!="object"||typeof te!="object")return X!==X&&te!==te;if(c(X)&&c(te))return P(X,te,A,ce);var Pe=Array.isArray(X),ye=Array.isArray(te);if(Pe||ye)return Pe===ye&&J(X,te,A,ce);var me=s.call(X);return me!==s.call(te)?!1:me===T?ae(X,te,A,ce):me===_?M(X,te,A,ce):me===w?O(X,te,A,ce):me===h?V(X,te,A,ce):me===R||me===S?y(X)||y(te)?!1:P(X,te,A,ce):me===v||me===b||me===a?p(X.valueOf(),te.valueOf()):!1}return K}function C($,J,ae,O){var P=$.length;if(J.length!==P)return!1;for(;P-- >0;)if(!ae($[P],J[P],P,P,$,J,O))return!1;return!0}var l=o(C);function m($,J){return p($.valueOf(),J.valueOf())}function d($,J,ae,O){var P=$.size===J.size;if(!P)return!1;if(!$.size)return!0;var M={},V=0;return $.forEach(function(G,A){if(P){var K=!1,X=0;J.forEach(function(te,ce){!K&&!M[X]&&(K=ae(A,ce,V,X,$,J,O)&&ae(G,te,A,ce,$,J,O))&&(M[X]=!0),X++}),V++,P=K}}),P}var g=o(d),F="_owner",D=Object.prototype.hasOwnProperty;function U($,J,ae,O){var P=Object.keys($),M=P.length;if(Object.keys(J).length!==M)return!1;for(var V;M-- >0;){if(V=P[M],V===F){var G=!!$.$$typeof,A=!!J.$$typeof;if((G||A)&&G!==A)return!1}if(!D.call(J,V)||!ae($[V],J[V],V,V,$,J,O))return!1}return!0}var L=o(U);function E($,J){return $.source===J.source&&$.flags===J.flags}function N($,J,ae,O){var P=$.size===J.size;if(!P)return!1;if(!$.size)return!0;var M={};return $.forEach(function(V,G){if(P){var A=!1,K=0;J.forEach(function(X,te){!A&&!M[K]&&(A=ae(V,X,G,te,$,J,O))&&(M[K]=!0),K++}),P=A}}),P}var W=o(N),B=Object.freeze({areArraysEqual:C,areDatesEqual:m,areMapsEqual:d,areObjectsEqual:U,areRegExpsEqual:E,areSetsEqual:N,createIsNestedEqual:n}),Z=Object.freeze({areArraysEqual:l,areDatesEqual:m,areMapsEqual:g,areObjectsEqual:L,areRegExpsEqual:E,areSetsEqual:W,createIsNestedEqual:n}),se=f(B);function re($,J){return se($,J,void 0)}var q=f(i(B,{createIsNestedEqual:function(){return p}}));function k($,J){return q($,J,void 0)}var ne=f(Z);function oe($,J){return ne($,J,new WeakMap)}var le=f(i(Z,{createIsNestedEqual:function(){return p}}));function pe($,J){return le($,J,new WeakMap)}function ge($){return f(i(B,$(B)))}function be($){var J=f(i(Z,$(Z)));return function(ae,O,P){return P===void 0&&(P=new WeakMap),J(ae,O,P)}}r.circularDeepEqual=oe,r.circularShallowEqual=pe,r.createCustomCircularEqual=be,r.createCustomEqual=ge,r.deepEqual=re,r.sameValueZeroEqual=p,r.shallowEqual=k,Object.defineProperty(r,"__esModule",{value:!0})})}(ot,ot.exports)),ot.exports}var mt={exports:{}},hn;function ln(){if(hn)return mt.exports;hn=1;function t(r){var n,o,i="";if(typeof r=="string"||typeof r=="number")i+=r;else if(typeof r=="object")if(Array.isArray(r)){var c=r.length;for(n=0;n<c;n++)r[n]&&(o=t(r[n]))&&(i&&(i+=" "),i+=o)}else for(o in r)r[o]&&(i&&(i+=" "),i+=o);return i}function e(){for(var r,n,o=0,i="",c=arguments.length;o<c;o++)(r=arguments[o])&&(n=t(r))&&(i&&(i+=" "),i+=n);return i}return mt.exports=e,mt.exports.clsx=e,mt.exports}var ie={},zt,mn;function Kr(){return mn||(mn=1,zt=function(e,r,n){return e===r?!0:e.className===r.className&&n(e.style,r.style)&&e.width===r.width&&e.autoSize===r.autoSize&&e.cols===r.cols&&e.draggableCancel===r.draggableCancel&&e.draggableHandle===r.draggableHandle&&n(e.verticalCompact,r.verticalCompact)&&n(e.compactType,r.compactType)&&n(e.layout,r.layout)&&n(e.margin,r.margin)&&n(e.containerPadding,r.containerPadding)&&e.rowHeight===r.rowHeight&&e.maxRows===r.maxRows&&e.isBounded===r.isBounded&&e.isDraggable===r.isDraggable&&e.isResizable===r.isResizable&&e.allowOverlap===r.allowOverlap&&e.preventCollision===r.preventCollision&&e.useCSSTransforms===r.useCSSTransforms&&e.transformScale===r.transformScale&&e.isDroppable===r.isDroppable&&n(e.resizeHandles,r.resizeHandles)&&n(e.resizeHandle,r.resizeHandle)&&e.onLayoutChange===r.onLayoutChange&&e.onDragStart===r.onDragStart&&e.onDrag===r.onDrag&&e.onDragStop===r.onDragStop&&e.onResizeStart===r.onResizeStart&&e.onResize===r.onResize&&e.onResizeStop===r.onResizeStop&&e.onDrop===r.onDrop&&n(e.droppingItem,r.droppingItem)&&n(e.innerRef,r.innerRef)}),zt}var gn;function Ae(){if(gn)return ie;gn=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.bottom=n,ie.childrenEqual=p,ie.cloneLayout=o,ie.cloneLayoutItem=y,ie.collides=v,ie.compact=T,ie.compactItem=b,ie.compactType=$,ie.correctBounds=R,ie.fastPositionEqual=S,ie.fastRGLPropsEqual=void 0,ie.getAllCollisions=s,ie.getFirstCollision=a,ie.getLayoutItem=h,ie.getStatics=f,ie.modifyLayout=i,ie.moveElement=C,ie.moveElementAwayFromCollision=l,ie.noop=void 0,ie.perc=m,ie.resizeItemInDirection=q,ie.setTopLeft=ne,ie.setTransform=k,ie.sortLayoutItems=oe,ie.sortLayoutItemsByColRow=pe,ie.sortLayoutItemsByRowCol=le,ie.synchronizeLayoutWithChildren=ge,ie.validateLayout=be,ie.withLayoutItem=c;var t=sn(),e=r(j);function r(O){return O&&O.__esModule?O:{default:O}}function n(O){let P=0,M;for(let V=0,G=O.length;V<G;V++)M=O[V].y+O[V].h,M>P&&(P=M);return P}function o(O){const P=Array(O.length);for(let M=0,V=O.length;M<V;M++)P[M]=y(O[M]);return P}function i(O,P){const M=Array(O.length);for(let V=0,G=O.length;V<G;V++)P.i===O[V].i?M[V]=P:M[V]=O[V];return M}function c(O,P,M){let V=h(O,P);return V?(V=M(y(V)),O=i(O,V),[O,V]):[O,null]}function y(O){return{w:O.w,h:O.h,x:O.x,y:O.y,i:O.i,minW:O.minW,maxW:O.maxW,minH:O.minH,maxH:O.maxH,moved:!!O.moved,static:!!O.static,isDraggable:O.isDraggable,isResizable:O.isResizable,resizeHandles:O.resizeHandles,isBounded:O.isBounded}}function p(O,P){return(0,t.deepEqual)(e.default.Children.map(O,M=>M==null?void 0:M.key),e.default.Children.map(P,M=>M==null?void 0:M.key))&&(0,t.deepEqual)(e.default.Children.map(O,M=>M==null?void 0:M.props["data-grid"]),e.default.Children.map(P,M=>M==null?void 0:M.props["data-grid"]))}ie.fastRGLPropsEqual=Kr();function S(O,P){return O.left===P.left&&O.top===P.top&&O.width===P.width&&O.height===P.height}function v(O,P){return!(O.i===P.i||O.x+O.w<=P.x||O.x>=P.x+P.w||O.y+O.h<=P.y||O.y>=P.y+P.h)}function T(O,P,M,V){const G=f(O),A=oe(O,P),K=Array(O.length);for(let X=0,te=A.length;X<te;X++){let ce=y(A[X]);ce.static||(ce=b(G,ce,P,M,A,V),G.push(ce)),K[O.indexOf(A[X])]=ce,ce.moved=!1}return K}const _={x:"w",y:"h"};function w(O,P,M,V){const G=_[V];P[V]+=1;const A=O.map(K=>K.i).indexOf(P.i);for(let K=A+1;K<O.length;K++){const X=O[K];if(!X.static){if(X.y>P.y+P.h)break;v(P,X)&&w(O,X,M+P[G],V)}}P[V]=M}function b(O,P,M,V,G,A){const K=M==="vertical",X=M==="horizontal";if(K)for(P.y=Math.min(n(O),P.y);P.y>0&&!a(O,P);)P.y--;else if(X)for(;P.x>0&&!a(O,P);)P.x--;let te;for(;(te=a(O,P))&&!(M===null&&A);)if(X?w(G,P,te.x+te.w,"x"):w(G,P,te.y+te.h,"y"),X&&P.x+P.w>V)for(P.x=V-P.w,P.y++;P.x>0&&!a(O,P);)P.x--;return P.y=Math.max(P.y,0),P.x=Math.max(P.x,0),P}function R(O,P){const M=f(O);for(let V=0,G=O.length;V<G;V++){const A=O[V];if(A.x+A.w>P.cols&&(A.x=P.cols-A.w),A.x<0&&(A.x=0,A.w=P.cols),!A.static)M.push(A);else for(;a(M,A);)A.y++}return O}function h(O,P){for(let M=0,V=O.length;M<V;M++)if(O[M].i===P)return O[M]}function a(O,P){for(let M=0,V=O.length;M<V;M++)if(v(O[M],P))return O[M]}function s(O,P){return O.filter(M=>v(M,P))}function f(O){return O.filter(P=>P.static)}function C(O,P,M,V,G,A,K,X,te){if(P.static&&P.isDraggable!==!0||P.y===V&&P.x===M)return O;`${P.i}${String(M)}${String(V)}${P.x}${P.y}`;const ce=P.x,Pe=P.y;typeof M=="number"&&(P.x=M),typeof V=="number"&&(P.y=V),P.moved=!0;let ye=oe(O,K);(K==="vertical"&&typeof V=="number"?Pe>=V:K==="horizontal"&&typeof M=="number"?ce>=M:!1)&&(ye=ye.reverse());const je=s(ye,P),ht=je.length>0;if(ht&&te)return o(O);if(ht&&A)return`${P.i}`,P.x=ce,P.y=Pe,P.moved=!1,O;for(let Ut=0,wr=je.length;Ut<wr;Ut++){const Fe=je[Ut];`${P.i}${P.x}${P.y}${Fe.i}${Fe.x}${Fe.y}`,!Fe.moved&&(Fe.static?O=l(O,Fe,P,G,K):O=l(O,P,Fe,G,K))}return O}function l(O,P,M,V,G,A){const K=G==="horizontal",X=G==="vertical",te=P.static;if(V){V=!1;const ye={x:K?Math.max(P.x-M.w,0):M.x,y:X?Math.max(P.y-M.h,0):M.y,w:M.w,h:M.h,i:"-1"},me=a(O,ye),je=me&&me.y+me.h>P.y,ht=me&&P.x+P.w>me.x;if(me){if(je&&X)return C(O,M,void 0,P.y+1,V,te,G);if(je&&G==null)return P.y=M.y,M.y=M.y+M.h,O;if(ht&&K)return C(O,P,M.x,void 0,V,te,G)}else return`${M.i}${ye.x}${ye.y}`,C(O,M,K?ye.x:void 0,X?ye.y:void 0,V,te,G)}const ce=K?M.x+1:void 0,Pe=X?M.y+1:void 0;return ce==null&&Pe==null?O:C(O,M,K?M.x+1:void 0,X?M.y+1:void 0,V,te,G)}function m(O){return O*100+"%"}const d=(O,P,M,V)=>O+M>V?P:M,g=(O,P,M)=>O<0?P:M,F=O=>Math.max(0,O),D=O=>Math.max(0,O),U=(O,P,M)=>{let{left:V,height:G,width:A}=P;const K=O.top-(G-O.height);return{left:V,width:A,height:g(K,O.height,G),top:D(K)}},L=(O,P,M)=>{let{top:V,left:G,height:A,width:K}=P;return{top:V,height:A,width:d(O.left,O.width,K,M),left:F(G)}},E=(O,P,M)=>{let{top:V,height:G,width:A}=P;const K=O.left-(A-O.width);return{height:G,width:K<0?O.width:d(O.left,O.width,A,M),top:D(V),left:F(K)}},N=(O,P,M)=>{let{top:V,left:G,height:A,width:K}=P;return{width:K,left:G,height:g(V,O.height,A),top:D(V)}},re={n:U,ne:function(){return U(arguments.length<=0?void 0:arguments[0],L(...arguments))},e:L,se:function(){return N(arguments.length<=0?void 0:arguments[0],L(...arguments))},s:N,sw:function(){return N(arguments.length<=0?void 0:arguments[0],E(...arguments))},w:E,nw:function(){return U(arguments.length<=0?void 0:arguments[0],E(...arguments))}};function q(O,P,M,V){const G=re[O];return G?G(P,{...P,...M},V):M}function k(O){let{top:P,left:M,width:V,height:G}=O;const A=`translate(${M}px,${P}px)`;return{transform:A,WebkitTransform:A,MozTransform:A,msTransform:A,OTransform:A,width:`${V}px`,height:`${G}px`,position:"absolute"}}function ne(O){let{top:P,left:M,width:V,height:G}=O;return{top:`${P}px`,left:`${M}px`,width:`${V}px`,height:`${G}px`,position:"absolute"}}function oe(O,P){return P==="horizontal"?pe(O):P==="vertical"?le(O):O}function le(O){return O.slice(0).sort(function(P,M){return P.y>M.y||P.y===M.y&&P.x>M.x?1:P.y===M.y&&P.x===M.x?0:-1})}function pe(O){return O.slice(0).sort(function(P,M){return P.x>M.x||P.x===M.x&&P.y>M.y?1:-1})}function ge(O,P,M,V,G){O=O||[];const A=[];e.default.Children.forEach(P,X=>{if((X==null?void 0:X.key)==null)return;const te=h(O,String(X.key)),ce=X.props["data-grid"];te&&ce==null?A.push(y(te)):ce?A.push(y({...ce,i:X.key})):A.push(y({w:1,h:1,x:0,y:n(A),i:String(X.key)}))});const K=R(A,{cols:M});return G?K:T(K,V,M)}function be(O){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const M=["x","y","w","h"];if(!Array.isArray(O))throw new Error(P+" must be an array!");for(let V=0,G=O.length;V<G;V++){const A=O[V];for(let K=0;K<M.length;K++)if(typeof A[M[K]]!="number")throw new Error("ReactGridLayout: "+P+"["+V+"]."+M[K]+" must be a number!")}}function $(O){const{verticalCompact:P,compactType:M}=O||{};return P===!1?null:M}function J(){}const ae=()=>{};return ie.noop=ae,ie}var Te={},vn;function un(){if(vn)return Te;vn=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.calcGridColWidth=t,Te.calcGridItemPosition=r,Te.calcGridItemWHPx=e,Te.calcWH=o,Te.calcXY=n,Te.clamp=i;function t(c){const{margin:y,containerPadding:p,containerWidth:S,cols:v}=c;return(S-y[0]*(v-1)-p[0]*2)/v}function e(c,y,p){return Number.isFinite(c)?Math.round(y*c+Math.max(0,c-1)*p):c}function r(c,y,p,S,v,T){const{margin:_,containerPadding:w,rowHeight:b}=c,R=t(c),h={};return T&&T.resizing?(h.width=Math.round(T.resizing.width),h.height=Math.round(T.resizing.height)):(h.width=e(S,R,_[0]),h.height=e(v,b,_[1])),T&&T.dragging?(h.top=Math.round(T.dragging.top),h.left=Math.round(T.dragging.left)):T&&T.resizing&&typeof T.resizing.top=="number"&&typeof T.resizing.left=="number"?(h.top=Math.round(T.resizing.top),h.left=Math.round(T.resizing.left)):(h.top=Math.round((b+_[1])*p+w[1]),h.left=Math.round((R+_[0])*y+w[0])),h}function n(c,y,p,S,v){const{margin:T,cols:_,rowHeight:w,maxRows:b}=c,R=t(c);let h=Math.round((p-T[0])/(R+T[0])),a=Math.round((y-T[1])/(w+T[1]));return h=i(h,0,_-S),a=i(a,0,b-v),{x:h,y:a}}function o(c,y,p,S,v,T){const{margin:_,maxRows:w,cols:b,rowHeight:R}=c,h=t(c);let a=Math.round((y+_[0])/(h+_[0])),s=Math.round((p+_[1])/(R+_[1])),f=i(a,0,b-S),C=i(s,0,w-v);return["sw","w","nw"].indexOf(T)!==-1&&(f=i(a,0,b)),["nw","n","ne"].indexOf(T)!==-1&&(C=i(s,0,w)),{w:f,h:C}}function i(c,y,p){return Math.max(Math.min(c,p),y)}return Te}var He={},kt={exports:{}},$t,yn;function Zr(){if(yn)return $t;yn=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return $t=t,$t}var At,Cn;function Jr(){if(Cn)return At;Cn=1;var t=Zr();function e(){}function r(){}return r.resetWarningCache=e,At=function(){function n(c,y,p,S,v,T){if(T!==t){var _=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 _.name="Invariant Violation",_}}n.isRequired=n;function o(){return n}var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:e};return i.PropTypes=i,i},At}var bn;function Oe(){return bn||(bn=1,kt.exports=Jr()()),kt.exports}var Be={exports:{}},qt={};function sr(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=sr(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function Sn(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=sr(t))&&(n&&(n+=" "),n+=e);return n}const Qr=Object.freeze(Object.defineProperty({__proto__:null,clsx:Sn,default:Sn},Symbol.toStringTag,{value:"Module"})),eo=ar(Qr);var fe={},_e={},Rn;function jt(){if(Rn)return _e;Rn=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.dontSetMe=o,_e.findInArray=t,_e.int=n,_e.isFunction=e,_e.isNum=r;function t(i,c){for(let y=0,p=i.length;y<p;y++)if(c.apply(c,[i[y],y,i]))return i[y]}function e(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Function]"}function r(i){return typeof i=="number"&&!isNaN(i)}function n(i){return parseInt(i,10)}function o(i,c,y){if(i[c])return new Error("Invalid prop ".concat(c," passed to ").concat(y," - do not set this, set it on the child."))}return _e}var Ee={},Tn;function to(){if(Tn)return Ee;Tn=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.browserPrefixToKey=r,Ee.browserPrefixToStyle=n,Ee.default=void 0,Ee.getPrefix=e;const t=["Moz","Webkit","O","ms"];function e(){var i;let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const y=(i=window.document)===null||i===void 0||(i=i.documentElement)===null||i===void 0?void 0:i.style;if(!y||c in y)return"";for(let p=0;p<t.length;p++)if(r(c,t[p])in y)return t[p];return""}function r(i,c){return c?"".concat(c).concat(o(i)):i}function n(i,c){return c?"-".concat(c.toLowerCase(),"-").concat(i):i}function o(i){let c="",y=!0;for(let p=0;p<i.length;p++)y?(c+=i[p].toUpperCase(),y=!1):i[p]==="-"?y=!0:c+=i[p];return c}return Ee.default=e(),Ee}var wn;function cn(){if(wn)return fe;wn=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.addClassName=l,fe.addEvent=y,fe.addUserSelectStyles=f,fe.createCSSTransform=b,fe.createSVGTransform=R,fe.getTouch=a,fe.getTouchIdentifier=s,fe.getTranslation=h,fe.innerHeight=T,fe.innerWidth=_,fe.matchesSelector=i,fe.matchesSelectorAndParentsTo=c,fe.offsetXYFromParent=w,fe.outerHeight=S,fe.outerWidth=v,fe.removeClassName=m,fe.removeEvent=p,fe.removeUserSelectStyles=C;var t=jt(),e=n(to());function r(d){if(typeof WeakMap!="function")return null;var g=new WeakMap,F=new WeakMap;return(r=function(D){return D?F:g})(d)}function n(d,g){if(d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var F=r(g);if(F&&F.has(d))return F.get(d);var D={},U=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var L in d)if(L!=="default"&&Object.prototype.hasOwnProperty.call(d,L)){var E=U?Object.getOwnPropertyDescriptor(d,L):null;E&&(E.get||E.set)?Object.defineProperty(D,L,E):D[L]=d[L]}return D.default=d,F&&F.set(d,D),D}let o="";function i(d,g){return o||(o=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(F){return(0,t.isFunction)(d[F])})),(0,t.isFunction)(d[o])?d[o](g):!1}function c(d,g,F){let D=d;do{if(i(D,g))return!0;if(D===F)return!1;D=D.parentNode}while(D);return!1}function y(d,g,F,D){if(!d)return;const U={capture:!0,...D};d.addEventListener?d.addEventListener(g,F,U):d.attachEvent?d.attachEvent("on"+g,F):d["on"+g]=F}function p(d,g,F,D){if(!d)return;const U={capture:!0,...D};d.removeEventListener?d.removeEventListener(g,F,U):d.detachEvent?d.detachEvent("on"+g,F):d["on"+g]=null}function S(d){let g=d.clientHeight;const F=d.ownerDocument.defaultView.getComputedStyle(d);return g+=(0,t.int)(F.borderTopWidth),g+=(0,t.int)(F.borderBottomWidth),g}function v(d){let g=d.clientWidth;const F=d.ownerDocument.defaultView.getComputedStyle(d);return g+=(0,t.int)(F.borderLeftWidth),g+=(0,t.int)(F.borderRightWidth),g}function T(d){let g=d.clientHeight;const F=d.ownerDocument.defaultView.getComputedStyle(d);return g-=(0,t.int)(F.paddingTop),g-=(0,t.int)(F.paddingBottom),g}function _(d){let g=d.clientWidth;const F=d.ownerDocument.defaultView.getComputedStyle(d);return g-=(0,t.int)(F.paddingLeft),g-=(0,t.int)(F.paddingRight),g}function w(d,g,F){const U=g===g.ownerDocument.body?{left:0,top:0}:g.getBoundingClientRect(),L=(d.clientX+g.scrollLeft-U.left)/F,E=(d.clientY+g.scrollTop-U.top)/F;return{x:L,y:E}}function b(d,g){const F=h(d,g,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:F}}function R(d,g){return h(d,g,"")}function h(d,g,F){let{x:D,y:U}=d,L="translate(".concat(D).concat(F,",").concat(U).concat(F,")");if(g){const E="".concat(typeof g.x=="string"?g.x:g.x+F),N="".concat(typeof g.y=="string"?g.y:g.y+F);L="translate(".concat(E,", ").concat(N,")")+L}return L}function a(d,g){return d.targetTouches&&(0,t.findInArray)(d.targetTouches,F=>g===F.identifier)||d.changedTouches&&(0,t.findInArray)(d.changedTouches,F=>g===F.identifier)}function s(d){if(d.targetTouches&&d.targetTouches[0])return d.targetTouches[0].identifier;if(d.changedTouches&&d.changedTouches[0])return d.changedTouches[0].identifier}function f(d){if(!d)return;let g=d.getElementById("react-draggable-style-el");g||(g=d.createElement("style"),g.type="text/css",g.id="react-draggable-style-el",g.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
2
2
  `,g.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
3
- `,f.getElementsByTagName("head")[0].appendChild(g)),f.body&&l(f.body,"react-draggable-transparent-selection")}function C(f){if(f)try{if(f.body&&m(f.body,"react-draggable-transparent-selection"),f.selection)f.selection.empty();else{const g=(f.defaultView||window).getSelection();g&&g.type!=="Caret"&&g.removeAllRanges()}}catch{}}function l(f,g){f.classList?f.classList.add(g):f.className.match(new RegExp("(?:^|\\s)".concat(g,"(?!\\S)")))||(f.className+=" ".concat(g))}function m(f,g){f.classList?f.classList.remove(g):f.className=f.className.replace(new RegExp("(?:^|\\s)".concat(g,"(?!\\S)"),"g"),"")}return fe}var Re={},Pn;function mr(){if(Pn)return Re;Pn=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.canDragX=o,Re.canDragY=i,Re.createCoreData=y,Re.createDraggableData=p,Re.getBoundPosition=r,Re.getControlPosition=c,Re.snapToGrid=n;var t=At(),e=yn();function r(R,x,T){if(!R.props.bounds)return[x,T];let{bounds:b}=R.props;b=typeof b=="string"?b:S(b);const I=v(R);if(typeof b=="string"){const{ownerDocument:h}=I,a=h.defaultView;let s;if(b==="parent"?s=I.parentNode:s=h.querySelector(b),!(s instanceof a.HTMLElement))throw new Error('Bounds selector "'+b+'" could not find an element.');const d=s,C=a.getComputedStyle(I),l=a.getComputedStyle(d);b={left:-I.offsetLeft+(0,t.int)(l.paddingLeft)+(0,t.int)(C.marginLeft),top:-I.offsetTop+(0,t.int)(l.paddingTop)+(0,t.int)(C.marginTop),right:(0,e.innerWidth)(d)-(0,e.outerWidth)(I)-I.offsetLeft+(0,t.int)(l.paddingRight)-(0,t.int)(C.marginRight),bottom:(0,e.innerHeight)(d)-(0,e.outerHeight)(I)-I.offsetTop+(0,t.int)(l.paddingBottom)-(0,t.int)(C.marginBottom)}}return(0,t.isNum)(b.right)&&(x=Math.min(x,b.right)),(0,t.isNum)(b.bottom)&&(T=Math.min(T,b.bottom)),(0,t.isNum)(b.left)&&(x=Math.max(x,b.left)),(0,t.isNum)(b.top)&&(T=Math.max(T,b.top)),[x,T]}function n(R,x,T){const b=Math.round(x/R[0])*R[0],I=Math.round(T/R[1])*R[1];return[b,I]}function o(R){return R.props.axis==="both"||R.props.axis==="x"}function i(R){return R.props.axis==="both"||R.props.axis==="y"}function c(R,x,T){const b=typeof x=="number"?(0,e.getTouch)(R,x):null;if(typeof x=="number"&&!b)return null;const I=v(T),h=T.props.offsetParent||I.offsetParent||I.ownerDocument.body;return(0,e.offsetXYFromParent)(b||R,h,T.props.scale)}function y(R,x,T){const b=!(0,t.isNum)(R.lastX),I=v(R);return b?{node:I,deltaX:0,deltaY:0,lastX:x,lastY:T,x,y:T}:{node:I,deltaX:x-R.lastX,deltaY:T-R.lastY,lastX:R.lastX,lastY:R.lastY,x,y:T}}function p(R,x){const T=R.props.scale;return{node:x.node,x:R.state.x+x.deltaX/T,y:R.state.y+x.deltaY/T,deltaX:x.deltaX/T,deltaY:x.deltaY/T,lastX:R.state.x,lastY:R.state.y}}function S(R){return{left:R.left,top:R.top,right:R.right,bottom:R.bottom}}function v(R){const x=R.findDOMNode();if(!x)throw new Error("<DraggableCore>: Unmounted during event!");return x}return Re}var Ge={},Ct={},Nn;function gr(){if(Nn)return Ct;Nn=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.default=t;function t(){}return Ct}var jn;function co(){if(jn)return Ge;jn=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.default=void 0;var t=S(N),e=y(Oe()),r=y(lr),n=yn(),o=mr(),i=At(),c=y(gr());function y(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(p=function(d){return d?s:a})(h)}function S(h,a){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(a);if(s&&s.has(h))return s.get(h);var d={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var m=C?Object.getOwnPropertyDescriptor(h,l):null;m&&(m.get||m.set)?Object.defineProperty(d,l,m):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function v(h,a,s){return a=R(a),a in h?Object.defineProperty(h,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[a]=s,h}function R(h){var a=x(h,"string");return typeof a=="symbol"?a:String(a)}function x(h,a){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,a);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(h)}const T={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let b=T.mouse,I=class extends t.Component{constructor(){super(...arguments),v(this,"dragging",!1),v(this,"lastX",NaN),v(this,"lastY",NaN),v(this,"touchIdentifier",null),v(this,"mounted",!1),v(this,"handleDragStart",a=>{if(this.props.onMouseDown(a),!this.props.allowAnyClick&&typeof a.button=="number"&&a.button!==0)return!1;const s=this.findDOMNode();if(!s||!s.ownerDocument||!s.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:d}=s;if(this.props.disabled||!(a.target instanceof d.defaultView.Node)||this.props.handle&&!(0,n.matchesSelectorAndParentsTo)(a.target,this.props.handle,s)||this.props.cancel&&(0,n.matchesSelectorAndParentsTo)(a.target,this.props.cancel,s))return;a.type==="touchstart"&&a.preventDefault();const C=(0,n.getTouchIdentifier)(a);this.touchIdentifier=C;const l=(0,o.getControlPosition)(a,C,this);if(l==null)return;const{x:m,y:f}=l,g=(0,o.createCoreData)(this,m,f);(0,c.default)("DraggableCore: handleDragStart: %j",g),(0,c.default)("calling",this.props.onStart),!(this.props.onStart(a,g)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,n.addUserSelectStyles)(d),this.dragging=!0,this.lastX=m,this.lastY=f,(0,n.addEvent)(d,b.move,this.handleDrag),(0,n.addEvent)(d,b.stop,this.handleDragStop))}),v(this,"handleDrag",a=>{const s=(0,o.getControlPosition)(a,this.touchIdentifier,this);if(s==null)return;let{x:d,y:C}=s;if(Array.isArray(this.props.grid)){let f=d-this.lastX,g=C-this.lastY;if([f,g]=(0,o.snapToGrid)(this.props.grid,f,g),!f&&!g)return;d=this.lastX+f,C=this.lastY+g}const l=(0,o.createCoreData)(this,d,C);if((0,c.default)("DraggableCore: handleDrag: %j",l),this.props.onDrag(a,l)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const g=document.createEvent("MouseEvents");g.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(g)}return}this.lastX=d,this.lastY=C}),v(this,"handleDragStop",a=>{if(!this.dragging)return;const s=(0,o.getControlPosition)(a,this.touchIdentifier,this);if(s==null)return;let{x:d,y:C}=s;if(Array.isArray(this.props.grid)){let g=d-this.lastX||0,F=C-this.lastY||0;[g,F]=(0,o.snapToGrid)(this.props.grid,g,F),d=this.lastX+g,C=this.lastY+F}const l=(0,o.createCoreData)(this,d,C);if(this.props.onStop(a,l)===!1||this.mounted===!1)return!1;const f=this.findDOMNode();f&&this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(f.ownerDocument),(0,c.default)("DraggableCore: handleDragStop: %j",l),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,f&&((0,c.default)("DraggableCore: Removing handlers"),(0,n.removeEvent)(f.ownerDocument,b.move,this.handleDrag),(0,n.removeEvent)(f.ownerDocument,b.stop,this.handleDragStop))}),v(this,"onMouseDown",a=>(b=T.mouse,this.handleDragStart(a))),v(this,"onMouseUp",a=>(b=T.mouse,this.handleDragStop(a))),v(this,"onTouchStart",a=>(b=T.touch,this.handleDragStart(a))),v(this,"onTouchEnd",a=>(b=T.touch,this.handleDragStop(a)))}componentDidMount(){this.mounted=!0;const a=this.findDOMNode();a&&(0,n.addEvent)(a,T.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const a=this.findDOMNode();if(a){const{ownerDocument:s}=a;(0,n.removeEvent)(s,T.mouse.move,this.handleDrag),(0,n.removeEvent)(s,T.touch.move,this.handleDrag),(0,n.removeEvent)(s,T.mouse.stop,this.handleDragStop),(0,n.removeEvent)(s,T.touch.stop,this.handleDragStop),(0,n.removeEvent)(a,T.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(s)}}findDOMNode(){var a,s;return(a=this.props)!==null&&a!==void 0&&a.nodeRef?(s=this.props)===null||s===void 0||(s=s.nodeRef)===null||s===void 0?void 0:s.current:r.default.findDOMNode(this)}render(){return t.cloneElement(t.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Ge.default=I,v(I,"displayName","DraggableCore"),v(I,"propTypes",{allowAnyClick:e.default.bool,children:e.default.node.isRequired,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:function(h,a){if(h[a]&&h[a].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:e.default.arrayOf(e.default.number),handle:e.default.string,cancel:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number,className:i.dontSetMe,style:i.dontSetMe,transform:i.dontSetMe}),v(I,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Ge}var Ln;function fo(){return Ln||(Ln=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return p.default}}),t.default=void 0;var e=x(N),r=v(Oe()),n=v(lr),o=v(lo),i=yn(),c=mr(),y=At(),p=v(co()),S=v(gr());function v(s){return s&&s.__esModule?s:{default:s}}function R(s){if(typeof WeakMap!="function")return null;var d=new WeakMap,C=new WeakMap;return(R=function(l){return l?C:d})(s)}function x(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var C=R(d);if(C&&C.has(s))return C.get(s);var l={},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var g=m?Object.getOwnPropertyDescriptor(s,f):null;g&&(g.get||g.set)?Object.defineProperty(l,f,g):l[f]=s[f]}return l.default=s,C&&C.set(s,l),l}function T(){return T=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var C=arguments[d];for(var l in C)Object.prototype.hasOwnProperty.call(C,l)&&(s[l]=C[l])}return s},T.apply(this,arguments)}function b(s,d,C){return d=I(d),d in s?Object.defineProperty(s,d,{value:C,enumerable:!0,configurable:!0,writable:!0}):s[d]=C,s}function I(s){var d=h(s,"string");return typeof d=="symbol"?d:String(d)}function h(s,d){if(typeof s!="object"||s===null)return s;var C=s[Symbol.toPrimitive];if(C!==void 0){var l=C.call(s,d);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}class a extends e.Component{static getDerivedStateFromProps(d,C){let{position:l}=d,{prevPropsPosition:m}=C;return l&&(!m||l.x!==m.x||l.y!==m.y)?((0,S.default)("Draggable: getDerivedStateFromProps %j",{position:l,prevPropsPosition:m}),{x:l.x,y:l.y,prevPropsPosition:{...l}}):null}constructor(d){super(d),b(this,"onDragStart",(C,l)=>{if((0,S.default)("Draggable: onDragStart: %j",l),this.props.onStart(C,(0,c.createDraggableData)(this,l))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),b(this,"onDrag",(C,l)=>{if(!this.state.dragging)return!1;(0,S.default)("Draggable: onDrag: %j",l);const m=(0,c.createDraggableData)(this,l),f={x:m.x,y:m.y,slackX:0,slackY:0};if(this.props.bounds){const{x:F,y:j}=f;f.x+=this.state.slackX,f.y+=this.state.slackY;const[U,L]=(0,c.getBoundPosition)(this,f.x,f.y);f.x=U,f.y=L,f.slackX=this.state.slackX+(F-f.x),f.slackY=this.state.slackY+(j-f.y),m.x=f.x,m.y=f.y,m.deltaX=f.x-this.state.x,m.deltaY=f.y-this.state.y}if(this.props.onDrag(C,m)===!1)return!1;this.setState(f)}),b(this,"onDragStop",(C,l)=>{if(!this.state.dragging||this.props.onStop(C,(0,c.createDraggableData)(this,l))===!1)return!1;(0,S.default)("Draggable: onDragStop: %j",l);const f={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:F,y:j}=this.props.position;f.x=F,f.y=j}this.setState(f)}),this.state={dragging:!1,dragged:!1,x:d.position?d.position.x:d.defaultPosition.x,y:d.position?d.position.y:d.defaultPosition.y,prevPropsPosition:{...d.position},slackX:0,slackY:0,isElementSVG:!1},d.position&&!(d.onDrag||d.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 d,C;return(d=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&d!==void 0?d:n.default.findDOMNode(this)}render(){const{axis:d,bounds:C,children:l,defaultPosition:m,defaultClassName:f,defaultClassNameDragging:g,defaultClassNameDragged:F,position:j,positionOffset:U,scale:L,...E}=this.props;let D={},k=null;const G=!!!j||this.state.dragging,ne=j||m,Q={x:(0,c.canDragX)(this)&&G?this.state.x:ne.x,y:(0,c.canDragY)(this)&&G?this.state.y:ne.y};this.state.isElementSVG?k=(0,i.createSVGTransform)(Q,U):D=(0,i.createCSSTransform)(Q,U);const W=(0,o.default)(l.props.className||"",f,{[g]:this.state.dragging,[F]:this.state.dragged});return e.createElement(p.default,T({},E,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(l),{className:W,style:{...l.props.style,...D},transform:k}))}}t.default=a,b(a,"displayName","Draggable"),b(a,"propTypes",{...p.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:y.dontSetMe,style:y.dontSetMe,transform:y.dontSetMe}),b(a,"defaultProps",{...p.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Kt)),Kt}var Un;function Cn(){if(Un)return Be.exports;Un=1;const{default:t,DraggableCore:e}=fo();return Be.exports=t,Be.exports.default=t,Be.exports.DraggableCore=e,Be.exports}var Xe={exports:{}},Ye={},St={},Vn;function po(){if(Vn)return St;Vn=1,St.__esModule=!0,St.cloneElement=y;var t=e(N);function e(p){return p&&p.__esModule?p:{default:p}}function r(p,S){var v=Object.keys(p);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(p);S&&(R=R.filter(function(x){return Object.getOwnPropertyDescriptor(p,x).enumerable})),v.push.apply(v,R)}return v}function n(p){for(var S=1;S<arguments.length;S++){var v=arguments[S]!=null?arguments[S]:{};S%2?r(Object(v),!0).forEach(function(R){o(p,R,v[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(v)):r(Object(v)).forEach(function(R){Object.defineProperty(p,R,Object.getOwnPropertyDescriptor(v,R))})}return p}function o(p,S,v){return S=i(S),S in p?Object.defineProperty(p,S,{value:v,enumerable:!0,configurable:!0,writable:!0}):p[S]=v,p}function i(p){var S=c(p,"string");return typeof S=="symbol"?S:String(S)}function c(p,S){if(typeof p!="object"||p===null)return p;var v=p[Symbol.toPrimitive];if(v!==void 0){var R=v.call(p,S);if(typeof R!="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(p)}function y(p,S){return S.style&&p.props.style&&(S.style=n(n({},p.props.style),S.style)),S.className&&p.props.className&&(S.className=p.props.className+" "+S.className),t.default.cloneElement(p,S)}return St}var Ke={},zn;function vr(){if(zn)return Ke;zn=1,Ke.__esModule=!0,Ke.resizableProps=void 0;var t=e(Oe());Cn();function e(n){return n&&n.__esModule?n:{default:n}}var r={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:t.default.node,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){for(var o=arguments.length,i=new Array(o),c=0;c<o;c++)i[c]=arguments[c];var y=i[0];if(y.axis==="both"||y.axis==="y"){var p;return(p=t.default.number).isRequired.apply(p,i)}return t.default.number.apply(t.default,i)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var o=arguments.length,i=new Array(o),c=0;c<o;c++)i[c]=arguments[c];var y=i[0];if(y.axis==="both"||y.axis==="x"){var p;return(p=t.default.number).isRequired.apply(p,i)}return t.default.number.apply(t.default,i)}};return Ke.resizableProps=r,Ke}var kn;function yr(){if(kn)return Ye;kn=1,Ye.__esModule=!0,Ye.default=void 0;var t=c(N),e=Cn(),r=po(),n=vr(),o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function i(a){if(typeof WeakMap!="function")return null;var s=new WeakMap,d=new WeakMap;return(i=function(l){return l?d:s})(a)}function c(a,s){if(a&&a.__esModule)return a;if(a===null||typeof a!="object"&&typeof a!="function")return{default:a};var d=i(s);if(d&&d.has(a))return d.get(a);var C={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var m in a)if(m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)){var f=l?Object.getOwnPropertyDescriptor(a,m):null;f&&(f.get||f.set)?Object.defineProperty(C,m,f):C[m]=a[m]}return C.default=a,d&&d.set(a,C),C}function y(){return y=Object.assign?Object.assign.bind():function(a){for(var s=1;s<arguments.length;s++){var d=arguments[s];for(var C in d)Object.prototype.hasOwnProperty.call(d,C)&&(a[C]=d[C])}return a},y.apply(this,arguments)}function p(a,s){if(a==null)return{};var d={},C=Object.keys(a),l,m;for(m=0;m<C.length;m++)l=C[m],!(s.indexOf(l)>=0)&&(d[l]=a[l]);return d}function S(a,s){var d=Object.keys(a);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(a);s&&(C=C.filter(function(l){return Object.getOwnPropertyDescriptor(a,l).enumerable})),d.push.apply(d,C)}return d}function v(a){for(var s=1;s<arguments.length;s++){var d=arguments[s]!=null?arguments[s]:{};s%2?S(Object(d),!0).forEach(function(C){R(a,C,d[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(d)):S(Object(d)).forEach(function(C){Object.defineProperty(a,C,Object.getOwnPropertyDescriptor(d,C))})}return a}function R(a,s,d){return s=x(s),s in a?Object.defineProperty(a,s,{value:d,enumerable:!0,configurable:!0,writable:!0}):a[s]=d,a}function x(a){var s=T(a,"string");return typeof s=="symbol"?s:String(s)}function T(a,s){if(typeof a!="object"||a===null)return a;var d=a[Symbol.toPrimitive];if(d!==void 0){var C=d.call(a,s);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}function b(a,s){a.prototype=Object.create(s.prototype),a.prototype.constructor=a,I(a,s)}function I(a,s){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,l){return C.__proto__=l,C},I(a,s)}var h=function(a){b(s,a);function s(){for(var C,l=arguments.length,m=new Array(l),f=0;f<l;f++)m[f]=arguments[f];return C=a.call.apply(a,[this].concat(m))||this,C.handleRefs={},C.lastHandleRect=null,C.slack=null,C}var d=s.prototype;return d.componentWillUnmount=function(){this.resetData()},d.resetData=function(){this.lastHandleRect=this.slack=null},d.runConstraints=function(l,m){var f=this.props,g=f.minConstraints,F=f.maxConstraints,j=f.lockAspectRatio;if(!g&&!F&&!j)return[l,m];if(j){var U=this.props.width/this.props.height,L=l-this.props.width,E=m-this.props.height;Math.abs(L)>Math.abs(E*U)?m=l/U:l=m*U}var D=l,k=m,B=this.slack||[0,0],G=B[0],ne=B[1];return l+=G,m+=ne,g&&(l=Math.max(g[0],l),m=Math.max(g[1],m)),F&&(l=Math.min(F[0],l),m=Math.min(F[1],m)),this.slack=[G+(D-l),ne+(k-m)],[l,m]},d.resizeHandler=function(l,m){var f=this;return function(g,F){var j=F.node,U=F.deltaX,L=F.deltaY;l==="onResizeStart"&&f.resetData();var E=(f.props.axis==="both"||f.props.axis==="x")&&m!=="n"&&m!=="s",D=(f.props.axis==="both"||f.props.axis==="y")&&m!=="e"&&m!=="w";if(!(!E&&!D)){var k=m[0],B=m[m.length-1],G=j.getBoundingClientRect();if(f.lastHandleRect!=null){if(B==="w"){var ne=G.left-f.lastHandleRect.left;U+=ne}if(k==="n"){var Q=G.top-f.lastHandleRect.top;L+=Q}}f.lastHandleRect=G,B==="w"&&(U=-U),k==="n"&&(L=-L);var W=f.props.width+(E?U/f.props.transformScale:0),$=f.props.height+(D?L/f.props.transformScale:0),re=f.runConstraints(W,$);W=re[0],$=re[1];var ie=W!==f.props.width||$!==f.props.height,le=typeof f.props[l]=="function"?f.props[l]:null,pe=l==="onResize"&&!ie;le&&!pe&&(g.persist==null||g.persist(),le(g,{node:j,size:{width:W,height:$},handle:m})),l==="onResizeStop"&&f.resetData()}}},d.renderResizeHandle=function(l,m){var f=this.props.handle;if(!f)return t.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+l,ref:m});if(typeof f=="function")return f(l,m);var g=typeof f.type=="string",F=v({ref:m},g?{}:{handleAxis:l});return t.cloneElement(f,F)},d.render=function(){var l=this,m=this.props,f=m.children,g=m.className,F=m.draggableOpts;m.width,m.height,m.handle,m.handleSize,m.lockAspectRatio,m.axis,m.minConstraints,m.maxConstraints,m.onResize,m.onResizeStop,m.onResizeStart;var j=m.resizeHandles;m.transformScale;var U=p(m,o);return(0,r.cloneElement)(f,v(v({},U),{},{className:(g?g+" ":"")+"react-resizable",children:[].concat(f.props.children,j.map(function(L){var E,D=(E=l.handleRefs[L])!=null?E:l.handleRefs[L]=t.createRef();return t.createElement(e.DraggableCore,y({},F,{nodeRef:D,key:"resizableHandle-"+L,onStop:l.resizeHandler("onResizeStop",L),onStart:l.resizeHandler("onResizeStart",L),onDrag:l.resizeHandler("onResize",L)}),l.renderResizeHandle(L,D))}))}))},s}(t.Component);return Ye.default=h,h.propTypes=n.resizableProps,h.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},Ye}var Ze={},$n;function ho(){if($n)return Ze;$n=1,Ze.__esModule=!0,Ze.default=void 0;var t=y(N),e=i(Oe()),r=i(yr()),n=vr(),o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function i(s){return s&&s.__esModule?s:{default:s}}function c(s){if(typeof WeakMap!="function")return null;var d=new WeakMap,C=new WeakMap;return(c=function(m){return m?C:d})(s)}function y(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var C=c(d);if(C&&C.has(s))return C.get(s);var l={},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var g=m?Object.getOwnPropertyDescriptor(s,f):null;g&&(g.get||g.set)?Object.defineProperty(l,f,g):l[f]=s[f]}return l.default=s,C&&C.set(s,l),l}function p(){return p=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var C=arguments[d];for(var l in C)Object.prototype.hasOwnProperty.call(C,l)&&(s[l]=C[l])}return s},p.apply(this,arguments)}function S(s,d){var C=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);d&&(l=l.filter(function(m){return Object.getOwnPropertyDescriptor(s,m).enumerable})),C.push.apply(C,l)}return C}function v(s){for(var d=1;d<arguments.length;d++){var C=arguments[d]!=null?arguments[d]:{};d%2?S(Object(C),!0).forEach(function(l){R(s,l,C[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(C)):S(Object(C)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(C,l))})}return s}function R(s,d,C){return d=x(d),d in s?Object.defineProperty(s,d,{value:C,enumerable:!0,configurable:!0,writable:!0}):s[d]=C,s}function x(s){var d=T(s,"string");return typeof d=="symbol"?d:String(d)}function T(s,d){if(typeof s!="object"||s===null)return s;var C=s[Symbol.toPrimitive];if(C!==void 0){var l=C.call(s,d);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}function b(s,d){if(s==null)return{};var C={},l=Object.keys(s),m,f;for(f=0;f<l.length;f++)m=l[f],!(d.indexOf(m)>=0)&&(C[m]=s[m]);return C}function I(s,d){s.prototype=Object.create(d.prototype),s.prototype.constructor=s,h(s,d)}function h(s,d){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,m){return l.__proto__=m,l},h(s,d)}var a=function(s){I(d,s);function d(){for(var l,m=arguments.length,f=new Array(m),g=0;g<m;g++)f[g]=arguments[g];return l=s.call.apply(s,[this].concat(f))||this,l.state={width:l.props.width,height:l.props.height,propsWidth:l.props.width,propsHeight:l.props.height},l.onResize=function(F,j){var U=j.size;l.props.onResize?(F.persist==null||F.persist(),l.setState(U,function(){return l.props.onResize&&l.props.onResize(F,j)})):l.setState(U)},l}d.getDerivedStateFromProps=function(m,f){return f.propsWidth!==m.width||f.propsHeight!==m.height?{width:m.width,height:m.height,propsWidth:m.width,propsHeight:m.height}:null};var C=d.prototype;return C.render=function(){var m=this.props,f=m.handle,g=m.handleSize;m.onResize;var F=m.onResizeStart,j=m.onResizeStop,U=m.draggableOpts,L=m.minConstraints,E=m.maxConstraints,D=m.lockAspectRatio,k=m.axis;m.width,m.height;var B=m.resizeHandles,G=m.style,ne=m.transformScale,Q=b(m,o);return t.createElement(r.default,{axis:k,draggableOpts:U,handle:f,handleSize:g,height:this.state.height,lockAspectRatio:D,maxConstraints:E,minConstraints:L,onResizeStart:F,onResize:this.onResize,onResizeStop:j,resizeHandles:B,transformScale:ne,width:this.state.width},t.createElement("div",p({},Q,{style:v(v({},G),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},d}(t.Component);return Ze.default=a,a.propTypes=v(v({},n.resizableProps),{},{children:e.default.element}),Ze}var An;function mo(){return An||(An=1,Xe.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Xe.exports.Resizable=yr().default,Xe.exports.ResizableBox=ho().default),Xe.exports}var Ie={},qn;function Cr(){if(qn)return Ie;qn=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.resizeHandleType=Ie.resizeHandleAxesType=Ie.default=void 0;var t=r(Oe()),e=r(N);function r(i){return i&&i.__esModule?i:{default:i}}const n=Ie.resizeHandleAxesType=t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),o=Ie.resizeHandleType=t.default.oneOfType([t.default.node,t.default.func]);return Ie.default={className:t.default.string,style:t.default.object,width:t.default.number,autoSize:t.default.bool,cols:t.default.number,draggableCancel:t.default.string,draggableHandle:t.default.string,verticalCompact:function(i){i.verticalCompact},compactType:t.default.oneOf(["vertical","horizontal"]),layout:function(i){var c=i.layout;c!==void 0&&Ae().validateLayout(c,"layout")},margin:t.default.arrayOf(t.default.number),containerPadding:t.default.arrayOf(t.default.number),rowHeight:t.default.number,maxRows:t.default.number,isBounded:t.default.bool,isDraggable:t.default.bool,isResizable:t.default.bool,allowOverlap:t.default.bool,preventCollision:t.default.bool,useCSSTransforms:t.default.bool,transformScale:t.default.number,isDroppable:t.default.bool,resizeHandles:n,resizeHandle:o,onLayoutChange:t.default.func,onDragStart:t.default.func,onDrag:t.default.func,onDragStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,onResizeStop:t.default.func,onDrop:t.default.func,droppingItem:t.default.shape({i:t.default.string.isRequired,w:t.default.number.isRequired,h:t.default.number.isRequired}),children:function(i,c){const y=i[c],p={};e.default.Children.forEach(y,function(S){if((S==null?void 0:S.key)!=null){if(p[S.key])throw new Error('Duplicate child key "'+S.key+'" found! This will cause problems in ReactGridLayout.');p[S.key]=!0}})},innerRef:t.default.any},Ie}var Wn;function go(){if(Wn)return He;Wn=1,Object.defineProperty(He,"__esModule",{value:!0}),He.default=void 0;var t=p(N),e=p(Oe()),r=Cn(),n=mo(),o=Ae(),i=vn(),c=Cr(),y=p(gn());function p(T){return T&&T.__esModule?T:{default:T}}function S(T,b,I){return b=v(b),b in T?Object.defineProperty(T,b,{value:I,enumerable:!0,configurable:!0,writable:!0}):T[b]=I,T}function v(T){var b=R(T,"string");return typeof b=="symbol"?b:String(b)}function R(T,b){if(typeof T!="object"||T===null)return T;var I=T[Symbol.toPrimitive];if(I!==void 0){var h=I.call(T,b);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(T)}let x=class extends t.default.Component{constructor(){super(...arguments),S(this,"state",{resizing:null,dragging:null,className:""}),S(this,"elementRef",t.default.createRef()),S(this,"onDragStart",(b,I)=>{let{node:h}=I;const{onDragStart:a,transformScale:s}=this.props;if(!a)return;const d={top:0,left:0},{offsetParent:C}=h;if(!C)return;const l=C.getBoundingClientRect(),m=h.getBoundingClientRect(),f=m.left/s,g=l.left/s,F=m.top/s,j=l.top/s;d.left=f-g+C.scrollLeft,d.top=F-j+C.scrollTop,this.setState({dragging:d});const{x:U,y:L}=(0,i.calcXY)(this.getPositionParams(),d.top,d.left,this.props.w,this.props.h);return a.call(this,this.props.i,U,L,{e:b,node:h,newPosition:d})}),S(this,"onDrag",(b,I)=>{let{node:h,deltaX:a,deltaY:s}=I;const{onDrag:d}=this.props;if(!d)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let C=this.state.dragging.top+s,l=this.state.dragging.left+a;const{isBounded:m,i:f,w:g,h:F,containerWidth:j}=this.props,U=this.getPositionParams();if(m){const{offsetParent:B}=h;if(B){const{margin:G,rowHeight:ne,containerPadding:Q}=this.props,W=B.clientHeight-(0,i.calcGridItemWHPx)(F,ne,G[1]);C=(0,i.clamp)(C-Q[1],0,W);const $=(0,i.calcGridColWidth)(U),re=j-(0,i.calcGridItemWHPx)(g,$,G[0]);l=(0,i.clamp)(l-Q[0],0,re)}}const L={top:C,left:l};this.setState({dragging:L});const{containerPadding:E}=this.props,{x:D,y:k}=(0,i.calcXY)(U,C-E[1],l-E[0],g,F);return d.call(this,f,D,k,{e:b,node:h,newPosition:L})}),S(this,"onDragStop",(b,I)=>{let{node:h}=I;const{onDragStop:a}=this.props;if(!a)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:s,h:d,i:C,containerPadding:l}=this.props,{left:m,top:f}=this.state.dragging,g={top:f,left:m};this.setState({dragging:null});const{x:F,y:j}=(0,i.calcXY)(this.getPositionParams(),f-l[1],m-l[0],s,d);return a.call(this,C,F,j,{e:b,node:h,newPosition:g})}),S(this,"onResizeStop",(b,I,h)=>this.onResizeHandler(b,I,h,"onResizeStop")),S(this,"onResizeStart",(b,I,h)=>this.onResizeHandler(b,I,h,"onResizeStart")),S(this,"onResize",(b,I,h)=>this.onResizeHandler(b,I,h,"onResize"))}shouldComponentUpdate(b,I){if(this.props.children!==b.children||this.props.droppingPosition!==b.droppingPosition)return!0;const h=(0,i.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),a=(0,i.calcGridItemPosition)(this.getPositionParams(b),b.x,b.y,b.w,b.h,I);return!(0,o.fastPositionEqual)(h,a)||this.props.useCSSTransforms!==b.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(b){this.moveDroppingItem(b)}moveDroppingItem(b){const{droppingPosition:I}=this.props;if(!I)return;const h=this.elementRef.current;if(!h)return;const a=b.droppingPosition||{left:0,top:0},{dragging:s}=this.state,d=s&&I.left!==a.left||I.top!==a.top;if(!s)this.onDragStart(I.e,{node:h,deltaX:I.left,deltaY:I.top});else if(d){const C=I.left-s.left,l=I.top-s.top;this.onDrag(I.e,{node:h,deltaX:C,deltaY:l})}}getPositionParams(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:b.cols,containerPadding:b.containerPadding,containerWidth:b.containerWidth,margin:b.margin,maxRows:b.maxRows,rowHeight:b.rowHeight}}createStyle(b){const{usePercentages:I,containerWidth:h,useCSSTransforms:a}=this.props;let s;return a?s=(0,o.setTransform)(b):(s=(0,o.setTopLeft)(b),I&&(s.left=(0,o.perc)(b.left/h),s.width=(0,o.perc)(b.width/h))),s}mixinDraggable(b,I){return t.default.createElement(r.DraggableCore,{disabled:!I,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},b)}curryResizeHandler(b,I){return(h,a)=>I(h,a,b)}mixinResizable(b,I,h){const{cols:a,minW:s,minH:d,maxW:C,maxH:l,transformScale:m,resizeHandles:f,resizeHandle:g}=this.props,F=this.getPositionParams(),j=(0,i.calcGridItemPosition)(F,0,0,a,0).width,U=(0,i.calcGridItemPosition)(F,0,0,s,d),L=(0,i.calcGridItemPosition)(F,0,0,C,l),E=[U.width,U.height],D=[Math.min(L.width,j),Math.min(L.height,1/0)];return t.default.createElement(n.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:I.width,height:I.height,minConstraints:E,maxConstraints:D,onResizeStop:this.curryResizeHandler(I,this.onResizeStop),onResizeStart:this.curryResizeHandler(I,this.onResizeStart),onResize:this.curryResizeHandler(I,this.onResize),transformScale:m,resizeHandles:f,handle:g},b)}onResizeHandler(b,I,h,a){let{node:s,size:d,handle:C}=I;const l=this.props[a];if(!l)return;const{x:m,y:f,i:g,maxH:F,minH:j,containerWidth:U}=this.props,{minW:L,maxW:E}=this.props;let D=d;s&&(D=(0,o.resizeItemInDirection)(C,h,d,U),this.setState({resizing:a==="onResizeStop"?null:D}));let{w:k,h:B}=(0,i.calcWH)(this.getPositionParams(),D.width,D.height,m,f,C);k=(0,i.clamp)(k,Math.max(L,1),E),B=(0,i.clamp)(B,j,F),l.call(this,g,k,B,{e:b,node:s,size:D,handle:C})}render(){const{x:b,y:I,w:h,h:a,isDraggable:s,isResizable:d,droppingPosition:C,useCSSTransforms:l}=this.props,m=(0,i.calcGridItemPosition)(this.getPositionParams(),b,I,h,a,this.state),f=t.default.Children.only(this.props.children);let g=t.default.cloneElement(f,{ref:this.elementRef,className:(0,y.default)("react-grid-item",f.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":s,"react-draggable-dragging":!!this.state.dragging,dropping:!!C,cssTransforms:l}),style:{...this.props.style,...f.props.style,...this.createStyle(m)}});return g=this.mixinResizable(g,m,d),g=this.mixinDraggable(g,s),g}};return He.default=x,S(x,"propTypes",{children:e.default.element,cols:e.default.number.isRequired,containerWidth:e.default.number.isRequired,rowHeight:e.default.number.isRequired,margin:e.default.array.isRequired,maxRows:e.default.number.isRequired,containerPadding:e.default.array.isRequired,x:e.default.number.isRequired,y:e.default.number.isRequired,w:e.default.number.isRequired,h:e.default.number.isRequired,minW:function(T,b){const I=T[b];if(typeof I!="number")return new Error("minWidth not Number");if(I>T.w||I>T.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(T,b){const I=T[b];if(typeof I!="number")return new Error("maxWidth not Number");if(I<T.w||I<T.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(T,b){const I=T[b];if(typeof I!="number")return new Error("minHeight not Number");if(I>T.h||I>T.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(T,b){const I=T[b];if(typeof I!="number")return new Error("maxHeight not Number");if(I<T.h||I<T.minH)return new Error("maxHeight smaller than item height/minHeight")},i:e.default.string.isRequired,resizeHandles:c.resizeHandleAxesType,resizeHandle:c.resizeHandleType,onDragStop:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,isDraggable:e.default.bool.isRequired,isResizable:e.default.bool.isRequired,isBounded:e.default.bool.isRequired,static:e.default.bool,useCSSTransforms:e.default.bool.isRequired,transformScale:e.default.number,className:e.default.string,handle:e.default.string,cancel:e.default.string,droppingPosition:e.default.shape({e:e.default.object.isRequired,left:e.default.number.isRequired,top:e.default.number.isRequired})}),S(x,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),He}var Hn;function Sr(){if(Hn)return We;Hn=1,Object.defineProperty(We,"__esModule",{value:!0}),We.default=void 0;var t=S(N),e=mn(),r=y(gn()),n=Ae(),o=vn(),i=y(go()),c=y(Cr());function y(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(p=function(d){return d?s:a})(h)}function S(h,a){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(a);if(s&&s.has(h))return s.get(h);var d={__proto__:null},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var m=C?Object.getOwnPropertyDescriptor(h,l):null;m&&(m.get||m.set)?Object.defineProperty(d,l,m):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function v(h,a,s){return a=R(a),a in h?Object.defineProperty(h,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[a]=s,h}function R(h){var a=x(h,"string");return typeof a=="symbol"?a:String(a)}function x(h,a){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,a);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(h)}const T="react-grid-layout";let b=!1;try{b=/firefox/i.test(navigator.userAgent)}catch{}let I=class extends t.Component{constructor(){super(...arguments),v(this,"state",{activeDrag:null,layout:(0,n.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,n.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),v(this,"dragEnterCounter",0),v(this,"onDragStart",(a,s,d,C)=>{let{e:l,node:m}=C;const{layout:f}=this.state,g=(0,n.getLayoutItem)(f,a);if(!g)return;const F={w:g.w,h:g.h,x:g.x,y:g.y,placeholder:!0,i:a};return this.setState({oldDragItem:(0,n.cloneLayoutItem)(g),oldLayout:f,activeDrag:F}),this.props.onDragStart(f,g,g,null,l,m)}),v(this,"onDrag",(a,s,d,C)=>{let{e:l,node:m}=C;const{oldDragItem:f}=this.state;let{layout:g}=this.state;const{cols:F,allowOverlap:j,preventCollision:U}=this.props,L=(0,n.getLayoutItem)(g,a);if(!L)return;const E={w:L.w,h:L.h,x:L.x,y:L.y,placeholder:!0,i:a};g=(0,n.moveElement)(g,L,s,d,!0,U,(0,n.compactType)(this.props),F,j),this.props.onDrag(g,f,L,E,l,m),this.setState({layout:j?g:(0,n.compact)(g,(0,n.compactType)(this.props),F),activeDrag:E})}),v(this,"onDragStop",(a,s,d,C)=>{let{e:l,node:m}=C;if(!this.state.activeDrag)return;const{oldDragItem:f}=this.state;let{layout:g}=this.state;const{cols:F,preventCollision:j,allowOverlap:U}=this.props,L=(0,n.getLayoutItem)(g,a);if(!L)return;g=(0,n.moveElement)(g,L,s,d,!0,j,(0,n.compactType)(this.props),F,U);const D=U?g:(0,n.compact)(g,(0,n.compactType)(this.props),F);this.props.onDragStop(D,f,L,null,l,m);const{oldLayout:k}=this.state;this.setState({activeDrag:null,layout:D,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(D,k)}),v(this,"onResizeStart",(a,s,d,C)=>{let{e:l,node:m}=C;const{layout:f}=this.state,g=(0,n.getLayoutItem)(f,a);g&&(this.setState({oldResizeItem:(0,n.cloneLayoutItem)(g),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(f,g,g,null,l,m))}),v(this,"onResize",(a,s,d,C)=>{let{e:l,node:m,size:f,handle:g}=C;const{oldResizeItem:F}=this.state,{layout:j}=this.state,{cols:U,preventCollision:L,allowOverlap:E}=this.props;let D=!1,k,B,G;const[ne,Q]=(0,n.withLayoutItem)(j,a,$=>{let re;return B=$.x,G=$.y,["sw","w","nw","n","ne"].indexOf(g)!==-1&&(["sw","nw","w"].indexOf(g)!==-1&&(B=$.x+($.w-s),s=$.x!==B&&B<0?$.w:s,B=B<0?0:B),["ne","n","nw"].indexOf(g)!==-1&&(G=$.y+($.h-d),d=$.y!==G&&G<0?$.h:d,G=G<0?0:G),D=!0),L&&!E&&(re=(0,n.getAllCollisions)(j,{...$,w:s,h:d,x:B,y:G}).filter(le=>le.i!==$.i).length>0,re&&(G=$.y,d=$.h,B=$.x,s=$.w,D=!1)),$.w=s,$.h=d,$});if(!Q)return;k=ne,D&&(k=(0,n.moveElement)(ne,Q,B,G,!0,this.props.preventCollision,(0,n.compactType)(this.props),U,E));const W={w:Q.w,h:Q.h,x:Q.x,y:Q.y,static:!0,i:a};this.props.onResize(k,F,Q,W,l,m),this.setState({layout:E?k:(0,n.compact)(k,(0,n.compactType)(this.props),U),activeDrag:W})}),v(this,"onResizeStop",(a,s,d,C)=>{let{e:l,node:m}=C;const{layout:f,oldResizeItem:g}=this.state,{cols:F,allowOverlap:j}=this.props,U=(0,n.getLayoutItem)(f,a),L=j?f:(0,n.compact)(f,(0,n.compactType)(this.props),F);this.props.onResizeStop(L,g,U,null,l,m);const{oldLayout:E}=this.state;this.setState({activeDrag:null,layout:L,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(L,E)}),v(this,"onDragOver",a=>{var ne;if(a.preventDefault(),a.stopPropagation(),b&&!((ne=a.nativeEvent.target)!=null&&ne.classList.contains(T)))return!1;const{droppingItem:s,onDropDragOver:d,margin:C,cols:l,rowHeight:m,maxRows:f,width:g,containerPadding:F,transformScale:j}=this.props,U=d==null?void 0:d(a);if(U===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const L={...s,...U},{layout:E}=this.state,D=a.currentTarget.getBoundingClientRect(),k=a.clientX-D.left,B=a.clientY-D.top,G={left:k/j,top:B/j,e:a};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:Q,top:W}=this.state.droppingPosition;(Q!=k||W!=B)&&this.setState({droppingPosition:G})}}else{const Q={cols:l,margin:C,maxRows:f,rowHeight:m,containerWidth:g,containerPadding:F||C},W=(0,o.calcXY)(Q,B,k,L.w,L.h);this.setState({droppingDOMNode:t.createElement("div",{key:L.i}),droppingPosition:G,layout:[...E,{...L,x:W.x,y:W.y,static:!1,isDraggable:!0}]})}}),v(this,"removeDroppingPlaceholder",()=>{const{droppingItem:a,cols:s}=this.props,{layout:d}=this.state,C=(0,n.compact)(d.filter(l=>l.i!==a.i),(0,n.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:C,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),v(this,"onDragLeave",a=>{a.preventDefault(),a.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),v(this,"onDragEnter",a=>{a.preventDefault(),a.stopPropagation(),this.dragEnterCounter++}),v(this,"onDrop",a=>{a.preventDefault(),a.stopPropagation();const{droppingItem:s}=this.props,{layout:d}=this.state,C=d.find(l=>l.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(d,C,a)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(a,s){let d;return s.activeDrag?null:(!(0,e.deepEqual)(a.layout,s.propsLayout)||a.compactType!==s.compactType?d=a.layout:(0,n.childrenEqual)(a.children,s.children)||(d=s.layout),d?{layout:(0,n.synchronizeLayoutWithChildren)(d,a.children,a.cols,(0,n.compactType)(a),a.allowOverlap),compactType:a.compactType,children:a.children,propsLayout:a.layout}:null)}shouldComponentUpdate(a,s){return this.props.children!==a.children||!(0,n.fastRGLPropsEqual)(this.props,a,e.deepEqual)||this.state.activeDrag!==s.activeDrag||this.state.mounted!==s.mounted||this.state.droppingPosition!==s.droppingPosition}componentDidUpdate(a,s){if(!this.state.activeDrag){const d=this.state.layout,C=s.layout;this.onLayoutMaybeChanged(d,C)}}containerHeight(){if(!this.props.autoSize)return;const a=(0,n.bottom)(this.state.layout),s=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return a*this.props.rowHeight+(a-1)*this.props.margin[1]+s*2+"px"}onLayoutMaybeChanged(a,s){s||(s=this.state.layout),(0,e.deepEqual)(s,a)||this.props.onLayoutChange(a)}placeholder(){const{activeDrag:a}=this.state;if(!a)return null;const{width:s,cols:d,margin:C,containerPadding:l,rowHeight:m,maxRows:f,useCSSTransforms:g,transformScale:F}=this.props;return t.createElement(i.default,{w:a.w,h:a.h,x:a.x,y:a.y,i:a.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:s,cols:d,margin:C,containerPadding:l||C,maxRows:f,rowHeight:m,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:g,transformScale:F},t.createElement("div",null))}processGridItem(a,s){if(!a||!a.key)return;const d=(0,n.getLayoutItem)(this.state.layout,String(a.key));if(!d)return null;const{width:C,cols:l,margin:m,containerPadding:f,rowHeight:g,maxRows:F,isDraggable:j,isResizable:U,isBounded:L,useCSSTransforms:E,transformScale:D,draggableCancel:k,draggableHandle:B,resizeHandles:G,resizeHandle:ne}=this.props,{mounted:Q,droppingPosition:W}=this.state,$=typeof d.isDraggable=="boolean"?d.isDraggable:!d.static&&j,re=typeof d.isResizable=="boolean"?d.isResizable:!d.static&&U,ie=d.resizeHandles||G,le=$&&L&&d.isBounded!==!1;return t.createElement(i.default,{containerWidth:C,cols:l,margin:m,containerPadding:f||m,maxRows:F,rowHeight:g,cancel:k,handle:B,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:$,isResizable:re,isBounded:le,useCSSTransforms:E&&Q,usePercentages:!Q,transformScale:D,w:d.w,h:d.h,x:d.x,y:d.y,i:d.i,minH:d.minH,minW:d.minW,maxH:d.maxH,maxW:d.maxW,static:d.static,droppingPosition:s?W:void 0,resizeHandles:ie,resizeHandle:ne},a)}render(){const{className:a,style:s,isDroppable:d,innerRef:C}=this.props,l=(0,r.default)(T,a),m={height:this.containerHeight(),...s};return t.createElement("div",{ref:C,className:l,style:m,onDrop:d?this.onDrop:n.noop,onDragLeave:d?this.onDragLeave:n.noop,onDragEnter:d?this.onDragEnter:n.noop,onDragOver:d?this.onDragOver:n.noop},t.Children.map(this.props.children,f=>this.processGridItem(f)),d&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return We.default=I,v(I,"displayName","ReactGridLayout"),v(I,"propTypes",c.default),v(I,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:n.noop,onDragStart:n.noop,onDrag:n.noop,onDragStop:n.noop,onResizeStart:n.noop,onResize:n.noop,onResizeStop:n.noop,onDrop:n.noop,onDropDragOver:n.noop}),We}var Je={},De={},Bn;function br(){if(Bn)return De;Bn=1,Object.defineProperty(De,"__esModule",{value:!0}),De.findOrGenerateResponsiveLayout=n,De.getBreakpointFromWidth=e,De.getColsFromBreakpoint=r,De.sortBreakpoints=o;var t=Ae();function e(i,c){const y=o(i);let p=y[0];for(let S=1,v=y.length;S<v;S++){const R=y[S];c>i[R]&&(p=R)}return p}function r(i,c){if(!c[i])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+i+" is missing!");return c[i]}function n(i,c,y,p,S,v){if(i[y])return(0,t.cloneLayout)(i[y]);let R=i[p];const x=o(c),T=x.slice(x.indexOf(y));for(let b=0,I=T.length;b<I;b++){const h=T[b];if(i[h]){R=i[h];break}}return R=(0,t.cloneLayout)(R||[]),(0,t.compact)((0,t.correctBounds)(R,{cols:S}),v,S)}function o(i){return Object.keys(i).sort(function(y,p){return i[y]-i[p]})}return De}var Gn;function vo(){if(Gn)return Je;Gn=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.default=void 0;var t=p(N),e=c(Oe()),r=mn(),n=Ae(),o=br(),i=c(Sr());function c(h){return h&&h.__esModule?h:{default:h}}function y(h){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(y=function(d){return d?s:a})(h)}function p(h,a){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=y(a);if(s&&s.has(h))return s.get(h);var d={__proto__:null},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var m=C?Object.getOwnPropertyDescriptor(h,l):null;m&&(m.get||m.set)?Object.defineProperty(d,l,m):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function S(){return S=Object.assign?Object.assign.bind():function(h){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var d in s)Object.prototype.hasOwnProperty.call(s,d)&&(h[d]=s[d])}return h},S.apply(this,arguments)}function v(h,a,s){return a=R(a),a in h?Object.defineProperty(h,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[a]=s,h}function R(h){var a=x(h,"string");return typeof a=="symbol"?a:String(a)}function x(h,a){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,a);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(h)}const T=h=>Object.prototype.toString.call(h);function b(h,a){return h==null?null:Array.isArray(h)?h:h[a]}let I=class extends t.Component{constructor(){super(...arguments),v(this,"state",this.generateInitialState()),v(this,"onLayoutChange",a=>{this.props.onLayoutChange(a,{...this.props.layouts,[this.state.breakpoint]:a})})}generateInitialState(){const{width:a,breakpoints:s,layouts:d,cols:C}=this.props,l=(0,o.getBreakpointFromWidth)(s,a),m=(0,o.getColsFromBreakpoint)(l,C),f=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,o.findOrGenerateResponsiveLayout)(d,s,l,l,m,f),breakpoint:l,cols:m}}static getDerivedStateFromProps(a,s){if(!(0,r.deepEqual)(a.layouts,s.layouts)){const{breakpoint:d,cols:C}=s;return{layout:(0,o.findOrGenerateResponsiveLayout)(a.layouts,a.breakpoints,d,d,C,a.compactType),layouts:a.layouts}}return null}componentDidUpdate(a){(this.props.width!=a.width||this.props.breakpoint!==a.breakpoint||!(0,r.deepEqual)(this.props.breakpoints,a.breakpoints)||!(0,r.deepEqual)(this.props.cols,a.cols))&&this.onWidthChange(a)}onWidthChange(a){const{breakpoints:s,cols:d,layouts:C,compactType:l}=this.props,m=this.props.breakpoint||(0,o.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),f=this.state.breakpoint,g=(0,o.getColsFromBreakpoint)(m,d),F={...C};if(f!==m||a.breakpoints!==s||a.cols!==d){f in F||(F[f]=(0,n.cloneLayout)(this.state.layout));let L=(0,o.findOrGenerateResponsiveLayout)(F,s,m,f,g,l);L=(0,n.synchronizeLayoutWithChildren)(L,this.props.children,g,l,this.props.allowOverlap),F[m]=L,this.props.onLayoutChange(L,F),this.props.onBreakpointChange(m,g),this.setState({breakpoint:m,layout:L,cols:g})}const j=b(this.props.margin,m),U=b(this.props.containerPadding,m);this.props.onWidthChange(this.props.width,j,g,U)}render(){const{breakpoint:a,breakpoints:s,cols:d,layouts:C,margin:l,containerPadding:m,onBreakpointChange:f,onLayoutChange:g,onWidthChange:F,...j}=this.props;return t.createElement(i.default,S({},j,{margin:b(l,this.state.breakpoint),containerPadding:b(m,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return Je.default=I,v(I,"propTypes",{breakpoint:e.default.string,breakpoints:e.default.object,allowOverlap:e.default.bool,cols:e.default.object,margin:e.default.oneOfType([e.default.array,e.default.object]),containerPadding:e.default.oneOfType([e.default.array,e.default.object]),layouts(h,a){if(T(h[a])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+T(h[a]));Object.keys(h[a]).forEach(s=>{if(!(s in h.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,n.validateLayout)(h.layouts[s],"layouts."+s)})},width:e.default.number.isRequired,onBreakpointChange:e.default.func,onLayoutChange:e.default.func,onWidthChange:e.default.func}),v(I,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:n.noop,onLayoutChange:n.noop,onWidthChange:n.noop}),Je}var bt={},Rr=function(){if(typeof Map<"u")return Map;function t(e,r){var n=-1;return e.some(function(o,i){return o[0]===r?(n=i,!0):!1}),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(r){var n=t(this.__entries__,r),o=this.__entries__[n];return o&&o[1]},e.prototype.set=function(r,n){var o=t(this.__entries__,r);~o?this.__entries__[o][1]=n:this.__entries__.push([r,n])},e.prototype.delete=function(r){var n=this.__entries__,o=t(n,r);~o&&n.splice(o,1)},e.prototype.has=function(r){return!!~t(this.__entries__,r)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var o=0,i=this.__entries__;o<i.length;o++){var c=i[o];r.call(n,c[1],c[0])}},e}()}(),on=typeof window<"u"&&typeof document<"u"&&window.document===document,Mt=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),yo=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Mt):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),Co=2;function So(t,e){var r=!1,n=!1,o=0;function i(){r&&(r=!1,t()),n&&y()}function c(){yo(i)}function y(){var p=Date.now();if(r){if(p-o<Co)return;n=!0}else r=!0,n=!1,setTimeout(c,e);o=p}return y}var bo=20,Ro=["top","right","bottom","left","width","height","size","weight"],To=typeof MutationObserver<"u",Io=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=So(this.refresh.bind(this),bo)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var r=this.observers_,n=r.indexOf(e);~n&&r.splice(n,1),!r.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(r){return r.gatherActive(),r.hasActive()});return e.forEach(function(r){return r.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!on||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),To?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!on||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var r=e.propertyName,n=r===void 0?"":r,o=Ro.some(function(i){return!!~n.indexOf(i)});o&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),Tr=function(t,e){for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];Object.defineProperty(t,o,{value:e[o],enumerable:!1,writable:!1,configurable:!0})}return t},ze=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Mt},Ir=qt(0,0,0,0);function Ft(t){return parseFloat(t)||0}function Xn(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return e.reduce(function(n,o){var i=t["border-"+o+"-width"];return n+Ft(i)},0)}function wo(t){for(var e=["top","right","bottom","left"],r={},n=0,o=e;n<o.length;n++){var i=o[n],c=t["padding-"+i];r[i]=Ft(c)}return r}function xo(t){var e=t.getBBox();return qt(0,0,e.width,e.height)}function _o(t){var e=t.clientWidth,r=t.clientHeight;if(!e&&!r)return Ir;var n=ze(t).getComputedStyle(t),o=wo(n),i=o.left+o.right,c=o.top+o.bottom,y=Ft(n.width),p=Ft(n.height);if(n.boxSizing==="border-box"&&(Math.round(y+i)!==e&&(y-=Xn(n,"left","right")+i),Math.round(p+c)!==r&&(p-=Xn(n,"top","bottom")+c)),!Oo(t)){var S=Math.round(y+i)-e,v=Math.round(p+c)-r;Math.abs(S)!==1&&(y-=S),Math.abs(v)!==1&&(p-=v)}return qt(o.left,o.top,y,p)}var Eo=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof ze(t).SVGGraphicsElement}:function(t){return t instanceof ze(t).SVGElement&&typeof t.getBBox=="function"}}();function Oo(t){return t===ze(t).document.documentElement}function Mo(t){return on?Eo(t)?xo(t):_o(t):Ir}function Fo(t){var e=t.x,r=t.y,n=t.width,o=t.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,c=Object.create(i.prototype);return Tr(c,{x:e,y:r,width:n,height:o,top:r,right:e+n,bottom:o+r,left:e}),c}function qt(t,e,r,n){return{x:t,y:e,width:r,height:n}}var Do=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=qt(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=Mo(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},t}(),Po=function(){function t(e,r){var n=Fo(r);Tr(this,{target:e,contentRect:n})}return t}(),No=function(){function t(e,r,n){if(this.activeObservations_=[],this.observations_=new Rr,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=r,this.callbackCtx_=n}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ze(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)||(r.set(e,new Do(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ze(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)&&(r.delete(e),r.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&e.activeObservations_.push(r)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new Po(n.target,n.broadcastRect())});this.callback_.call(e,r,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),wr=typeof WeakMap<"u"?new WeakMap:new Rr,xr=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=Io.getInstance(),n=new No(e,r,this);wr.set(this,n)}return t}();["observe","unobserve","disconnect"].forEach(function(t){xr.prototype[t]=function(){var e;return(e=wr.get(this))[t].apply(e,arguments)}});var jo=function(){return typeof Mt.ResizeObserver<"u"?Mt.ResizeObserver:xr}();const Lo=Object.freeze(Object.defineProperty({__proto__:null,default:jo},Symbol.toStringTag,{value:"Module"})),Uo=pr(Lo);var Yn;function Vo(){if(Yn)return bt;Yn=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.default=x;var t=c(N),e=o(Oe()),r=o(Uo),n=o(gn());function o(T){return T&&T.__esModule?T:{default:T}}function i(T){if(typeof WeakMap!="function")return null;var b=new WeakMap,I=new WeakMap;return(i=function(h){return h?I:b})(T)}function c(T,b){if(T&&T.__esModule)return T;if(T===null||typeof T!="object"&&typeof T!="function")return{default:T};var I=i(b);if(I&&I.has(T))return I.get(T);var h={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in T)if(s!=="default"&&Object.prototype.hasOwnProperty.call(T,s)){var d=a?Object.getOwnPropertyDescriptor(T,s):null;d&&(d.get||d.set)?Object.defineProperty(h,s,d):h[s]=T[s]}return h.default=T,I&&I.set(T,h),h}function y(){return y=Object.assign?Object.assign.bind():function(T){for(var b=1;b<arguments.length;b++){var I=arguments[b];for(var h in I)Object.prototype.hasOwnProperty.call(I,h)&&(T[h]=I[h])}return T},y.apply(this,arguments)}function p(T,b,I){return b=S(b),b in T?Object.defineProperty(T,b,{value:I,enumerable:!0,configurable:!0,writable:!0}):T[b]=I,T}function S(T){var b=v(T,"string");return typeof b=="symbol"?b:String(b)}function v(T,b){if(typeof T!="object"||T===null)return T;var I=T[Symbol.toPrimitive];if(I!==void 0){var h=I.call(T,b);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(T)}const R="react-grid-layout";function x(T){var b;return b=class extends t.Component{constructor(){super(...arguments),p(this,"state",{width:1280}),p(this,"elementRef",t.createRef()),p(this,"mounted",!1),p(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new r.default(a=>{if(this.elementRef.current instanceof HTMLElement){const d=a[0].contentRect.width;this.setState({width:d})}});const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.observe(h)}componentWillUnmount(){this.mounted=!1;const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.unobserve(h),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:h,...a}=this.props;return h&&!this.mounted?t.createElement("div",{className:(0,n.default)(this.props.className,R),style:this.props.style,ref:this.elementRef}):t.createElement(T,y({innerRef:this.elementRef},a,this.state))}},p(b,"defaultProps",{measureBeforeMount:!1}),p(b,"propTypes",{measureBeforeMount:e.default.bool}),b}return bt}var Kn;function zo(){return Kn||(Kn=1,function(t){t.exports=Sr().default,t.exports.utils=Ae(),t.exports.calculateUtils=vn(),t.exports.Responsive=vo().default,t.exports.Responsive.utils=br(),t.exports.WidthProvider=Vo().default}(Ht)),Ht.exports}var ko=zo();const $o=no(ko);var Ao=Object.getOwnPropertyDescriptor,qo=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ao(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},Wo=(t,e)=>(r,n)=>e(r,n,t);let ke=class extends w.Disposable{constructor(e){super();xe(this,"_initLocal",()=>{});xe(this,"_findReplaceIndex",e=>{const r=/\{([^}]+)?\}/g,n=[];let o=r.exec(e);for(;o;)n.push({startIndex:o.index,key:Number(o[1]),endIndex:o.index+o[0].length-1}),o=r.exec(e);return n});this._localeService=e,this._initLocal()}tWithReactNode(e,...r){const n=this._localeService.getLocales(),o=e.split("."),i=n&&this._localeService.resolveKeyPath(n,o);if(typeof i=="string"){const c=[];return this._findReplaceIndex(i).forEach((y,p,S)=>{const v=S[p-1]||{endIndex:-1};if(v.endIndex+1<y.startIndex){const R=i.slice(v.endIndex+1,y.startIndex);R&&c.push(R)}if(r[y.key]&&c.push(r[y.key]),p===S.length-1){const R=i.slice(y.endIndex+1);R&&c.push(R)}}),c}return[]}};ke=qo([Wo(0,w.Inject(w.LocaleService))],ke);const Ho="univer-cf-preview",Rt={cfPreview:Ho},qe=t=>{var o,i;const e=t.rule;if(!e)return null;const r=N.useMemo(()=>{if(e.type===u.CFRuleType.colorScale){const c=e.config.map((S,v)=>({color:new w.ColorKit(S.color),value:v})),y=c.length-1;return new Array(5).fill("").map((S,v,R)=>v*y/(R.length-1)).map(S=>u.getColorScaleFromValue(c,S))}return null},[e]),n=N.useMemo(()=>{if(e.type===u.CFRuleType.iconSet)return e.config.map(c=>{const y=u.iconMap[c.iconType];return y&&y[Number(c.iconId)]})},[e]);switch(e.type){case u.CFRuleType.dataBar:{const{isGradient:c}=e.config,y={width:"50%",height:"100%"},p=c?`linear-gradient(to right, ${e.config.positiveColor||u.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,S=c?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||u.defaultDataBarNativeColor})`:e.config.nativeColor;return _.jsxs("div",{className:Rt.cfPreview,children:[_.jsx("div",{style:{...y,background:S,border:`1px solid ${e.config.nativeColor||u.defaultDataBarNativeColor}`}}),_.jsx("div",{style:{...y,background:p,border:`1px solid ${e.config.positiveColor||u.defaultDataBarPositiveColor}`}})]})}case u.CFRuleType.colorScale:return r&&_.jsx("div",{className:Rt.cfPreview,children:r.map((c,y)=>_.jsx("div",{style:{width:`${100/r.length}%`,height:"100%",background:c}},y))});case u.CFRuleType.iconSet:return n&&_.jsx("div",{className:Rt.cfPreview,children:n.map((c,y)=>c?_.jsx("img",{style:{height:"100%"},src:c},y):_.jsx(mt,{},y))});case u.CFRuleType.highlightCell:{const{ul:c,st:y,it:p,bl:S,bg:v,cl:R}=e.style,x=(c==null?void 0:c.s)===w.BooleanNumber.TRUE,T=(y==null?void 0:y.s)===w.BooleanNumber.TRUE,b=p===w.BooleanNumber.TRUE,I=S===w.BooleanNumber.TRUE,h=(o=v==null?void 0:v.rgb)!=null?o:u.DEFAULT_BG_COLOR,a=(i=R==null?void 0:R.rgb)!=null?i:u.DEFAULT_FONT_COLOR,s={fontWeight:I?"bold":void 0,fontStyle:b?"italic":void 0,textDecoration:`${x?"underline":""} ${T?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:a};return _.jsx("div",{style:s,className:Rt.cfPreview,children:"123"})}}return null},Bo="univer-cf-rule-list",Go="univer-rule-selector",Xo="univer-select",Yo="univer-btn-list",Ko="univer-gap",Zo="univer-icon",Jo="univer-disabled",Qo="univer-rule-item",ei="univer-rule-describe",ti="univer-rule-type",ni="univer-rule-range",ri="univer-active",oi="univer-draggableHandle",ii="univer-delete-item",ai="univer-grid-layout-wrap",he={cfRuleList:Bo,ruleSelector:Go,select:Xo,btnList:Yo,gap:Ko,icon:Zo,disabled:Jo,ruleItem:Qo,ruleDescribe:ei,ruleType:ti,ruleRange:ni,active:ri,draggableHandle:oi,deleteItem:ii,gridLayoutWrap:ai},si=(t,e)=>{const r=t.rule;switch(r.type){case u.CFRuleType.colorScale:return e.t("sheet.cf.ruleType.colorScale");case u.CFRuleType.dataBar:return e.t("sheet.cf.ruleType.dataBar");case u.CFRuleType.iconSet:return e.t("sheet.cf.ruleType.iconSet");case u.CFRuleType.highlightCell:switch(r.subType){case u.CFSubRuleType.average:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,e.t("sheet.cf.subRuleType.average"))}case u.CFSubRuleType.duplicateValues:return e.t("sheet.cf.subRuleType.duplicateValues");case u.CFSubRuleType.uniqueValues:return e.t("sheet.cf.subRuleType.uniqueValues");case u.CFSubRuleType.number:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,...Array.isArray(r.value)?r.value.map(o=>String(o)):[String(r.value||"")])}case u.CFSubRuleType.text:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,r.value||"")}case u.CFSubRuleType.timePeriod:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`)}case u.CFSubRuleType.rank:return r.isPercent?r.isBottom?e.t("sheet.cf.preview.describe.bottomNPercent",String(r.value)):e.t("sheet.cf.preview.describe.topNPercent",String(r.value)):r.isBottom?e.t("sheet.cf.preview.describe.bottomN",String(r.value)):e.t("sheet.cf.preview.describe.topN",String(r.value));case u.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let Zn=0;const li=t=>{const{onClick:e}=t,r=ee.useDependency(u.ConditionalFormattingRuleModel),n=ee.useDependency(w.IUniverInstanceService),o=ee.useDependency(X.SheetsSelectionsService),i=ee.useDependency(w.ICommandService),c=ee.useDependency(w.LocaleService),y=ee.useDependency(w.Injector),p=ee.useDependency(ke),S=ee.useObservable(()=>n.getCurrentTypeOfUnit$(w.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),v=S.getUnitId(),R=S.getActiveSheet();if(!R)throw new Error("No active sheet found");const x=R.getSheetId(),[T,b]=N.useState([]),[I,h]=N.useState("2"),[a,s]=N.useState(0),[d,C]=N.useState(-1),[l,m]=N.useState(Zn),f=N.useRef(null),g=[{label:c.t("sheet.cf.panel.workSheet"),value:"2"},{label:c.t("sheet.cf.panel.selectedRange"),value:"1"}],F=()=>{const W=r.getSubunitRules(v,x);if(!W||!W.length)return[];if(I==="1"){const $=o.getCurrentLastSelection();if(!$)return[];const re=$.range;return W.filter(le=>le.ranges.some(pe=>w.Rectangle.intersects(pe,re)))}else if(I==="2")return[...W];return[]},[j,U]=N.useState(F);de.useHighlightRange(T),N.useEffect(()=>{const W=i.onCommandExecuted($=>{$.id===X.SetWorksheetActiveOperation.id&&s(Math.random())});return()=>W.dispose()}),N.useEffect(()=>{U(F)},[I,a,v,x]),N.useEffect(()=>{if(I==="2")return;const W=new be.Observable($=>{const re=[X.SetSelectionsOperation.id,u.AddConditionalRuleMutation.id,u.SetConditionalRuleMutation.id,u.DeleteConditionalRuleMutation.id,u.MoveConditionalRuleMutation.id],ie=i.onCommandExecuted(le=>{const{id:pe,params:ge}=le,Se=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId();re.includes(pe)&&ge.unitId===Se&&$.next(null)});return()=>ie.dispose()}).pipe(be.debounceTime(16)).subscribe(()=>{U(F)});return()=>{W.unsubscribe()}},[n,I,v,x]),N.useEffect(()=>{const W=r.$ruleChange.subscribe(()=>{s(Math.random())});return()=>W.unsubscribe()},[r]),N.useEffect(()=>{const W=()=>{var le;const ie=Math.max(0,(((le=f.current)==null?void 0:le.getBoundingClientRect().width)||0)-8);return Zn=ie,ie},re=new be.Observable(ie=>{const le=document.querySelector(".univer-sidebar");if(le){let pe=setTimeout(()=>{ie.next()},150);const ge=()=>{pe&&clearTimeout(pe),pe=null},Se=A=>{A.propertyName==="width"&&(ge(),ie.next())};return le.addEventListener("transitionend",Se),()=>{ge(),le.removeEventListener("transitionend",Se)}}}).pipe(be.debounceTime(16)).subscribe(()=>{m(W())});return()=>{re.unsubscribe()}},[]);const L=W=>{var ie;const $=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),re=(ie=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:ie.getSheetId();if(!$||!re)throw new Error("No active sheet found");i.executeCommand(at.id,{unitId:$,subUnitId:re,cfId:W.cfId})},E=(W,$)=>{C($.y)},D=(W,$,re)=>{var A;C(-1);const ie=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),le=(A=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:A.getSheetId();if(!ie||!le)throw new Error("No active sheet found");const pe=J=>{const se=j.length;return Math.min(se-1,Math.max(0,J))},ge=j[pe($.y)].cfId,Se=j[pe(re.y)].cfId;ge!==Se&&i.executeCommand(zt.id,{unitId:ie,subUnitId:le,start:{id:ge,type:"self"},end:{id:Se,type:re.y>$.y?"after":"before"}})},k=()=>{t.onCreate()},B=()=>{I==="2"?i.executeCommand(ht.id):I==="1"&&j.map($=>({unitId:v,subUnitId:x,cfId:$.cfId})).forEach($=>{i.executeCommand(at.id,$)})},G=N.useMemo(()=>{const W=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET),$=W.getActiveSheet();return j.filter(re=>{const ie=re.ranges;return X.checkRangesEditablePermission(y,W.getUnitId(),$.getSheetId(),ie)})},[j]),ne=G.map((W,$)=>({i:W.cfId,x:0,w:12,y:$,h:1,isResizable:!1})),Q=N.useMemo(()=>{const W=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET),$=W.getActiveSheet();return j.every(re=>{const ie=re.ranges;return X.checkRangesEditablePermission(y,W.getUnitId(),$.getSheetId(),ie)})},[j]);return _.jsxs("div",{className:he.cfRuleList,children:[_.jsxs("div",{className:he.ruleSelector,children:[_.jsx("div",{children:p.tWithReactNode("sheet.cf.panel.managerRuleSelect",_.jsx(oe.Select,{className:he.select,options:g,value:I,onChange:W=>{h(W)}})).map((W,$)=>_.jsx("span",{children:W},$))}),_.jsxs("div",{className:he.btnList,children:[_.jsx(oe.Tooltip,{title:c.t("sheet.cf.panel.createRule"),placement:"bottom",children:_.jsx("div",{className:`
3
+ `,d.getElementsByTagName("head")[0].appendChild(g)),d.body&&l(d.body,"react-draggable-transparent-selection")}function C(d){if(d)try{if(d.body&&m(d.body,"react-draggable-transparent-selection"),d.selection)d.selection.empty();else{const g=(d.defaultView||window).getSelection();g&&g.type!=="Caret"&&g.removeAllRanges()}}catch{}}function l(d,g){d.classList?d.classList.add(g):d.className.match(new RegExp("(?:^|\\s)".concat(g,"(?!\\S)")))||(d.className+=" ".concat(g))}function m(d,g){d.classList?d.classList.remove(g):d.className=d.className.replace(new RegExp("(?:^|\\s)".concat(g,"(?!\\S)"),"g"),"")}return fe}var Re={},xn;function lr(){if(xn)return Re;xn=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.canDragX=o,Re.canDragY=i,Re.createCoreData=y,Re.createDraggableData=p,Re.getBoundPosition=r,Re.getControlPosition=c,Re.snapToGrid=n;var t=jt(),e=cn();function r(T,_,w){if(!T.props.bounds)return[_,w];let{bounds:b}=T.props;b=typeof b=="string"?b:S(b);const R=v(T);if(typeof b=="string"){const{ownerDocument:h}=R,a=h.defaultView;let s;if(b==="parent"?s=R.parentNode:s=h.querySelector(b),!(s instanceof a.HTMLElement))throw new Error('Bounds selector "'+b+'" could not find an element.');const f=s,C=a.getComputedStyle(R),l=a.getComputedStyle(f);b={left:-R.offsetLeft+(0,t.int)(l.paddingLeft)+(0,t.int)(C.marginLeft),top:-R.offsetTop+(0,t.int)(l.paddingTop)+(0,t.int)(C.marginTop),right:(0,e.innerWidth)(f)-(0,e.outerWidth)(R)-R.offsetLeft+(0,t.int)(l.paddingRight)-(0,t.int)(C.marginRight),bottom:(0,e.innerHeight)(f)-(0,e.outerHeight)(R)-R.offsetTop+(0,t.int)(l.paddingBottom)-(0,t.int)(C.marginBottom)}}return(0,t.isNum)(b.right)&&(_=Math.min(_,b.right)),(0,t.isNum)(b.bottom)&&(w=Math.min(w,b.bottom)),(0,t.isNum)(b.left)&&(_=Math.max(_,b.left)),(0,t.isNum)(b.top)&&(w=Math.max(w,b.top)),[_,w]}function n(T,_,w){const b=Math.round(_/T[0])*T[0],R=Math.round(w/T[1])*T[1];return[b,R]}function o(T){return T.props.axis==="both"||T.props.axis==="x"}function i(T){return T.props.axis==="both"||T.props.axis==="y"}function c(T,_,w){const b=typeof _=="number"?(0,e.getTouch)(T,_):null;if(typeof _=="number"&&!b)return null;const R=v(w),h=w.props.offsetParent||R.offsetParent||R.ownerDocument.body;return(0,e.offsetXYFromParent)(b||T,h,w.props.scale)}function y(T,_,w){const b=!(0,t.isNum)(T.lastX),R=v(T);return b?{node:R,deltaX:0,deltaY:0,lastX:_,lastY:w,x:_,y:w}:{node:R,deltaX:_-T.lastX,deltaY:w-T.lastY,lastX:T.lastX,lastY:T.lastY,x:_,y:w}}function p(T,_){const w=T.props.scale;return{node:_.node,x:T.state.x+_.deltaX/w,y:T.state.y+_.deltaY/w,deltaX:_.deltaX/w,deltaY:_.deltaY/w,lastX:T.state.x,lastY:T.state.y}}function S(T){return{left:T.left,top:T.top,right:T.right,bottom:T.bottom}}function v(T){const _=T.findDOMNode();if(!_)throw new Error("<DraggableCore>: Unmounted during event!");return _}return Re}var Ge={},gt={},In;function ur(){if(In)return gt;In=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.default=t;function t(){}return gt}var _n;function no(){if(_n)return Ge;_n=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.default=void 0;var t=S(j),e=y(Oe()),r=y(tr),n=cn(),o=lr(),i=jt(),c=y(ur());function y(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(p=function(f){return f?s:a})(h)}function S(h,a){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(a);if(s&&s.has(h))return s.get(h);var f={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var m=C?Object.getOwnPropertyDescriptor(h,l):null;m&&(m.get||m.set)?Object.defineProperty(f,l,m):f[l]=h[l]}return f.default=h,s&&s.set(h,f),f}function v(h,a,s){return a=T(a),a in h?Object.defineProperty(h,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[a]=s,h}function T(h){var a=_(h,"string");return typeof a=="symbol"?a:String(a)}function _(h,a){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,a);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(h)}const w={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let b=w.mouse,R=class extends t.Component{constructor(){super(...arguments),v(this,"dragging",!1),v(this,"lastX",NaN),v(this,"lastY",NaN),v(this,"touchIdentifier",null),v(this,"mounted",!1),v(this,"handleDragStart",a=>{if(this.props.onMouseDown(a),!this.props.allowAnyClick&&typeof a.button=="number"&&a.button!==0)return!1;const s=this.findDOMNode();if(!s||!s.ownerDocument||!s.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:f}=s;if(this.props.disabled||!(a.target instanceof f.defaultView.Node)||this.props.handle&&!(0,n.matchesSelectorAndParentsTo)(a.target,this.props.handle,s)||this.props.cancel&&(0,n.matchesSelectorAndParentsTo)(a.target,this.props.cancel,s))return;a.type==="touchstart"&&a.preventDefault();const C=(0,n.getTouchIdentifier)(a);this.touchIdentifier=C;const l=(0,o.getControlPosition)(a,C,this);if(l==null)return;const{x:m,y:d}=l,g=(0,o.createCoreData)(this,m,d);(0,c.default)("DraggableCore: handleDragStart: %j",g),(0,c.default)("calling",this.props.onStart),!(this.props.onStart(a,g)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,n.addUserSelectStyles)(f),this.dragging=!0,this.lastX=m,this.lastY=d,(0,n.addEvent)(f,b.move,this.handleDrag),(0,n.addEvent)(f,b.stop,this.handleDragStop))}),v(this,"handleDrag",a=>{const s=(0,o.getControlPosition)(a,this.touchIdentifier,this);if(s==null)return;let{x:f,y:C}=s;if(Array.isArray(this.props.grid)){let d=f-this.lastX,g=C-this.lastY;if([d,g]=(0,o.snapToGrid)(this.props.grid,d,g),!d&&!g)return;f=this.lastX+d,C=this.lastY+g}const l=(0,o.createCoreData)(this,f,C);if((0,c.default)("DraggableCore: handleDrag: %j",l),this.props.onDrag(a,l)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const g=document.createEvent("MouseEvents");g.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(g)}return}this.lastX=f,this.lastY=C}),v(this,"handleDragStop",a=>{if(!this.dragging)return;const s=(0,o.getControlPosition)(a,this.touchIdentifier,this);if(s==null)return;let{x:f,y:C}=s;if(Array.isArray(this.props.grid)){let g=f-this.lastX||0,F=C-this.lastY||0;[g,F]=(0,o.snapToGrid)(this.props.grid,g,F),f=this.lastX+g,C=this.lastY+F}const l=(0,o.createCoreData)(this,f,C);if(this.props.onStop(a,l)===!1||this.mounted===!1)return!1;const d=this.findDOMNode();d&&this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(d.ownerDocument),(0,c.default)("DraggableCore: handleDragStop: %j",l),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,d&&((0,c.default)("DraggableCore: Removing handlers"),(0,n.removeEvent)(d.ownerDocument,b.move,this.handleDrag),(0,n.removeEvent)(d.ownerDocument,b.stop,this.handleDragStop))}),v(this,"onMouseDown",a=>(b=w.mouse,this.handleDragStart(a))),v(this,"onMouseUp",a=>(b=w.mouse,this.handleDragStop(a))),v(this,"onTouchStart",a=>(b=w.touch,this.handleDragStart(a))),v(this,"onTouchEnd",a=>(b=w.touch,this.handleDragStop(a)))}componentDidMount(){this.mounted=!0;const a=this.findDOMNode();a&&(0,n.addEvent)(a,w.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const a=this.findDOMNode();if(a){const{ownerDocument:s}=a;(0,n.removeEvent)(s,w.mouse.move,this.handleDrag),(0,n.removeEvent)(s,w.touch.move,this.handleDrag),(0,n.removeEvent)(s,w.mouse.stop,this.handleDragStop),(0,n.removeEvent)(s,w.touch.stop,this.handleDragStop),(0,n.removeEvent)(a,w.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(s)}}findDOMNode(){var a,s;return(a=this.props)!==null&&a!==void 0&&a.nodeRef?(s=this.props)===null||s===void 0||(s=s.nodeRef)===null||s===void 0?void 0:s.current:r.default.findDOMNode(this)}render(){return t.cloneElement(t.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Ge.default=R,v(R,"displayName","DraggableCore"),v(R,"propTypes",{allowAnyClick:e.default.bool,children:e.default.node.isRequired,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:function(h,a){if(h[a]&&h[a].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:e.default.arrayOf(e.default.number),handle:e.default.string,cancel:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number,className:i.dontSetMe,style:i.dontSetMe,transform:i.dontSetMe}),v(R,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Ge}var En;function ro(){return En||(En=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return p.default}}),t.default=void 0;var e=_(j),r=v(Oe()),n=v(tr),o=v(eo),i=cn(),c=lr(),y=jt(),p=v(no()),S=v(ur());function v(s){return s&&s.__esModule?s:{default:s}}function T(s){if(typeof WeakMap!="function")return null;var f=new WeakMap,C=new WeakMap;return(T=function(l){return l?C:f})(s)}function _(s,f){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var C=T(f);if(C&&C.has(s))return C.get(s);var l={},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var g=m?Object.getOwnPropertyDescriptor(s,d):null;g&&(g.get||g.set)?Object.defineProperty(l,d,g):l[d]=s[d]}return l.default=s,C&&C.set(s,l),l}function w(){return w=Object.assign?Object.assign.bind():function(s){for(var f=1;f<arguments.length;f++){var C=arguments[f];for(var l in C)Object.prototype.hasOwnProperty.call(C,l)&&(s[l]=C[l])}return s},w.apply(this,arguments)}function b(s,f,C){return f=R(f),f in s?Object.defineProperty(s,f,{value:C,enumerable:!0,configurable:!0,writable:!0}):s[f]=C,s}function R(s){var f=h(s,"string");return typeof f=="symbol"?f:String(f)}function h(s,f){if(typeof s!="object"||s===null)return s;var C=s[Symbol.toPrimitive];if(C!==void 0){var l=C.call(s,f);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(s)}class a extends e.Component{static getDerivedStateFromProps(f,C){let{position:l}=f,{prevPropsPosition:m}=C;return l&&(!m||l.x!==m.x||l.y!==m.y)?((0,S.default)("Draggable: getDerivedStateFromProps %j",{position:l,prevPropsPosition:m}),{x:l.x,y:l.y,prevPropsPosition:{...l}}):null}constructor(f){super(f),b(this,"onDragStart",(C,l)=>{if((0,S.default)("Draggable: onDragStart: %j",l),this.props.onStart(C,(0,c.createDraggableData)(this,l))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),b(this,"onDrag",(C,l)=>{if(!this.state.dragging)return!1;(0,S.default)("Draggable: onDrag: %j",l);const m=(0,c.createDraggableData)(this,l),d={x:m.x,y:m.y,slackX:0,slackY:0};if(this.props.bounds){const{x:F,y:D}=d;d.x+=this.state.slackX,d.y+=this.state.slackY;const[U,L]=(0,c.getBoundPosition)(this,d.x,d.y);d.x=U,d.y=L,d.slackX=this.state.slackX+(F-d.x),d.slackY=this.state.slackY+(D-d.y),m.x=d.x,m.y=d.y,m.deltaX=d.x-this.state.x,m.deltaY=d.y-this.state.y}if(this.props.onDrag(C,m)===!1)return!1;this.setState(d)}),b(this,"onDragStop",(C,l)=>{if(!this.state.dragging||this.props.onStop(C,(0,c.createDraggableData)(this,l))===!1)return!1;(0,S.default)("Draggable: onDragStop: %j",l);const d={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:F,y:D}=this.props.position;d.x=F,d.y=D}this.setState(d)}),this.state={dragging:!1,dragged:!1,x:f.position?f.position.x:f.defaultPosition.x,y:f.position?f.position.y:f.defaultPosition.y,prevPropsPosition:{...f.position},slackX:0,slackY:0,isElementSVG:!1},f.position&&!(f.onDrag||f.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var f,C;return(f=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&f!==void 0?f:n.default.findDOMNode(this)}render(){const{axis:f,bounds:C,children:l,defaultPosition:m,defaultClassName:d,defaultClassNameDragging:g,defaultClassNameDragged:F,position:D,positionOffset:U,scale:L,...E}=this.props;let N={},W=null;const Z=!!!D||this.state.dragging,se=D||m,re={x:(0,c.canDragX)(this)&&Z?this.state.x:se.x,y:(0,c.canDragY)(this)&&Z?this.state.y:se.y};this.state.isElementSVG?W=(0,i.createSVGTransform)(re,U):N=(0,i.createCSSTransform)(re,U);const q=(0,o.default)(l.props.className||"",d,{[g]:this.state.dragging,[F]:this.state.dragged});return e.createElement(p.default,w({},E,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(l),{className:q,style:{...l.props.style,...N},transform:W}))}}t.default=a,b(a,"displayName","Draggable"),b(a,"propTypes",{...p.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:y.dontSetMe,style:y.dontSetMe,transform:y.dontSetMe}),b(a,"defaultProps",{...p.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(qt)),qt}var On;function dn(){if(On)return Be.exports;On=1;const{default:t,DraggableCore:e}=ro();return Be.exports=t,Be.exports.default=t,Be.exports.DraggableCore=e,Be.exports}var Xe={exports:{}},Ye={},vt={},Pn;function oo(){if(Pn)return vt;Pn=1,vt.__esModule=!0,vt.cloneElement=y;var t=e(j);function e(p){return p&&p.__esModule?p:{default:p}}function r(p,S){var v=Object.keys(p);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(p);S&&(T=T.filter(function(_){return Object.getOwnPropertyDescriptor(p,_).enumerable})),v.push.apply(v,T)}return v}function n(p){for(var S=1;S<arguments.length;S++){var v=arguments[S]!=null?arguments[S]:{};S%2?r(Object(v),!0).forEach(function(T){o(p,T,v[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(v)):r(Object(v)).forEach(function(T){Object.defineProperty(p,T,Object.getOwnPropertyDescriptor(v,T))})}return p}function o(p,S,v){return S=i(S),S in p?Object.defineProperty(p,S,{value:v,enumerable:!0,configurable:!0,writable:!0}):p[S]=v,p}function i(p){var S=c(p,"string");return typeof S=="symbol"?S:String(S)}function c(p,S){if(typeof p!="object"||p===null)return p;var v=p[Symbol.toPrimitive];if(v!==void 0){var T=v.call(p,S);if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(p)}function y(p,S){return S.style&&p.props.style&&(S.style=n(n({},p.props.style),S.style)),S.className&&p.props.className&&(S.className=p.props.className+" "+S.className),t.default.cloneElement(p,S)}return vt}var Ke={},Fn;function cr(){if(Fn)return Ke;Fn=1,Ke.__esModule=!0,Ke.resizableProps=void 0;var t=e(Oe());dn();function e(n){return n&&n.__esModule?n:{default:n}}var r={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:t.default.node,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){for(var o=arguments.length,i=new Array(o),c=0;c<o;c++)i[c]=arguments[c];var y=i[0];if(y.axis==="both"||y.axis==="y"){var p;return(p=t.default.number).isRequired.apply(p,i)}return t.default.number.apply(t.default,i)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var o=arguments.length,i=new Array(o),c=0;c<o;c++)i[c]=arguments[c];var y=i[0];if(y.axis==="both"||y.axis==="x"){var p;return(p=t.default.number).isRequired.apply(p,i)}return t.default.number.apply(t.default,i)}};return Ke.resizableProps=r,Ke}var Dn;function dr(){if(Dn)return Ye;Dn=1,Ye.__esModule=!0,Ye.default=void 0;var t=c(j),e=dn(),r=oo(),n=cr(),o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function i(a){if(typeof WeakMap!="function")return null;var s=new WeakMap,f=new WeakMap;return(i=function(l){return l?f:s})(a)}function c(a,s){if(a&&a.__esModule)return a;if(a===null||typeof a!="object"&&typeof a!="function")return{default:a};var f=i(s);if(f&&f.has(a))return f.get(a);var C={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var m in a)if(m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)){var d=l?Object.getOwnPropertyDescriptor(a,m):null;d&&(d.get||d.set)?Object.defineProperty(C,m,d):C[m]=a[m]}return C.default=a,f&&f.set(a,C),C}function y(){return y=Object.assign?Object.assign.bind():function(a){for(var s=1;s<arguments.length;s++){var f=arguments[s];for(var C in f)Object.prototype.hasOwnProperty.call(f,C)&&(a[C]=f[C])}return a},y.apply(this,arguments)}function p(a,s){if(a==null)return{};var f={},C=Object.keys(a),l,m;for(m=0;m<C.length;m++)l=C[m],!(s.indexOf(l)>=0)&&(f[l]=a[l]);return f}function S(a,s){var f=Object.keys(a);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(a);s&&(C=C.filter(function(l){return Object.getOwnPropertyDescriptor(a,l).enumerable})),f.push.apply(f,C)}return f}function v(a){for(var s=1;s<arguments.length;s++){var f=arguments[s]!=null?arguments[s]:{};s%2?S(Object(f),!0).forEach(function(C){T(a,C,f[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(f)):S(Object(f)).forEach(function(C){Object.defineProperty(a,C,Object.getOwnPropertyDescriptor(f,C))})}return a}function T(a,s,f){return s=_(s),s in a?Object.defineProperty(a,s,{value:f,enumerable:!0,configurable:!0,writable:!0}):a[s]=f,a}function _(a){var s=w(a,"string");return typeof s=="symbol"?s:String(s)}function w(a,s){if(typeof a!="object"||a===null)return a;var f=a[Symbol.toPrimitive];if(f!==void 0){var C=f.call(a,s);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}function b(a,s){a.prototype=Object.create(s.prototype),a.prototype.constructor=a,R(a,s)}function R(a,s){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,l){return C.__proto__=l,C},R(a,s)}var h=function(a){b(s,a);function s(){for(var C,l=arguments.length,m=new Array(l),d=0;d<l;d++)m[d]=arguments[d];return C=a.call.apply(a,[this].concat(m))||this,C.handleRefs={},C.lastHandleRect=null,C.slack=null,C}var f=s.prototype;return f.componentWillUnmount=function(){this.resetData()},f.resetData=function(){this.lastHandleRect=this.slack=null},f.runConstraints=function(l,m){var d=this.props,g=d.minConstraints,F=d.maxConstraints,D=d.lockAspectRatio;if(!g&&!F&&!D)return[l,m];if(D){var U=this.props.width/this.props.height,L=l-this.props.width,E=m-this.props.height;Math.abs(L)>Math.abs(E*U)?m=l/U:l=m*U}var N=l,W=m,B=this.slack||[0,0],Z=B[0],se=B[1];return l+=Z,m+=se,g&&(l=Math.max(g[0],l),m=Math.max(g[1],m)),F&&(l=Math.min(F[0],l),m=Math.min(F[1],m)),this.slack=[Z+(N-l),se+(W-m)],[l,m]},f.resizeHandler=function(l,m){var d=this;return function(g,F){var D=F.node,U=F.deltaX,L=F.deltaY;l==="onResizeStart"&&d.resetData();var E=(d.props.axis==="both"||d.props.axis==="x")&&m!=="n"&&m!=="s",N=(d.props.axis==="both"||d.props.axis==="y")&&m!=="e"&&m!=="w";if(!(!E&&!N)){var W=m[0],B=m[m.length-1],Z=D.getBoundingClientRect();if(d.lastHandleRect!=null){if(B==="w"){var se=Z.left-d.lastHandleRect.left;U+=se}if(W==="n"){var re=Z.top-d.lastHandleRect.top;L+=re}}d.lastHandleRect=Z,B==="w"&&(U=-U),W==="n"&&(L=-L);var q=d.props.width+(E?U/d.props.transformScale:0),k=d.props.height+(N?L/d.props.transformScale:0),ne=d.runConstraints(q,k);q=ne[0],k=ne[1];var oe=q!==d.props.width||k!==d.props.height,le=typeof d.props[l]=="function"?d.props[l]:null,pe=l==="onResize"&&!oe;le&&!pe&&(g.persist==null||g.persist(),le(g,{node:D,size:{width:q,height:k},handle:m})),l==="onResizeStop"&&d.resetData()}}},f.renderResizeHandle=function(l,m){var d=this.props.handle;if(!d)return t.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+l,ref:m});if(typeof d=="function")return d(l,m);var g=typeof d.type=="string",F=v({ref:m},g?{}:{handleAxis:l});return t.cloneElement(d,F)},f.render=function(){var l=this,m=this.props,d=m.children,g=m.className,F=m.draggableOpts;m.width,m.height,m.handle,m.handleSize,m.lockAspectRatio,m.axis,m.minConstraints,m.maxConstraints,m.onResize,m.onResizeStop,m.onResizeStart;var D=m.resizeHandles;m.transformScale;var U=p(m,o);return(0,r.cloneElement)(d,v(v({},U),{},{className:(g?g+" ":"")+"react-resizable",children:[].concat(d.props.children,D.map(function(L){var E,N=(E=l.handleRefs[L])!=null?E:l.handleRefs[L]=t.createRef();return t.createElement(e.DraggableCore,y({},F,{nodeRef:N,key:"resizableHandle-"+L,onStop:l.resizeHandler("onResizeStop",L),onStart:l.resizeHandler("onResizeStart",L),onDrag:l.resizeHandler("onResize",L)}),l.renderResizeHandle(L,N))}))}))},s}(t.Component);return Ye.default=h,h.propTypes=n.resizableProps,h.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},Ye}var Ze={},Mn;function io(){if(Mn)return Ze;Mn=1,Ze.__esModule=!0,Ze.default=void 0;var t=y(j),e=i(Oe()),r=i(dr()),n=cr(),o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function i(s){return s&&s.__esModule?s:{default:s}}function c(s){if(typeof WeakMap!="function")return null;var f=new WeakMap,C=new WeakMap;return(c=function(m){return m?C:f})(s)}function y(s,f){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var C=c(f);if(C&&C.has(s))return C.get(s);var l={},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var g=m?Object.getOwnPropertyDescriptor(s,d):null;g&&(g.get||g.set)?Object.defineProperty(l,d,g):l[d]=s[d]}return l.default=s,C&&C.set(s,l),l}function p(){return p=Object.assign?Object.assign.bind():function(s){for(var f=1;f<arguments.length;f++){var C=arguments[f];for(var l in C)Object.prototype.hasOwnProperty.call(C,l)&&(s[l]=C[l])}return s},p.apply(this,arguments)}function S(s,f){var C=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);f&&(l=l.filter(function(m){return Object.getOwnPropertyDescriptor(s,m).enumerable})),C.push.apply(C,l)}return C}function v(s){for(var f=1;f<arguments.length;f++){var C=arguments[f]!=null?arguments[f]:{};f%2?S(Object(C),!0).forEach(function(l){T(s,l,C[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(C)):S(Object(C)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(C,l))})}return s}function T(s,f,C){return f=_(f),f in s?Object.defineProperty(s,f,{value:C,enumerable:!0,configurable:!0,writable:!0}):s[f]=C,s}function _(s){var f=w(s,"string");return typeof f=="symbol"?f:String(f)}function w(s,f){if(typeof s!="object"||s===null)return s;var C=s[Symbol.toPrimitive];if(C!==void 0){var l=C.call(s,f);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(s)}function b(s,f){if(s==null)return{};var C={},l=Object.keys(s),m,d;for(d=0;d<l.length;d++)m=l[d],!(f.indexOf(m)>=0)&&(C[m]=s[m]);return C}function R(s,f){s.prototype=Object.create(f.prototype),s.prototype.constructor=s,h(s,f)}function h(s,f){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,m){return l.__proto__=m,l},h(s,f)}var a=function(s){R(f,s);function f(){for(var l,m=arguments.length,d=new Array(m),g=0;g<m;g++)d[g]=arguments[g];return l=s.call.apply(s,[this].concat(d))||this,l.state={width:l.props.width,height:l.props.height,propsWidth:l.props.width,propsHeight:l.props.height},l.onResize=function(F,D){var U=D.size;l.props.onResize?(F.persist==null||F.persist(),l.setState(U,function(){return l.props.onResize&&l.props.onResize(F,D)})):l.setState(U)},l}f.getDerivedStateFromProps=function(m,d){return d.propsWidth!==m.width||d.propsHeight!==m.height?{width:m.width,height:m.height,propsWidth:m.width,propsHeight:m.height}:null};var C=f.prototype;return C.render=function(){var m=this.props,d=m.handle,g=m.handleSize;m.onResize;var F=m.onResizeStart,D=m.onResizeStop,U=m.draggableOpts,L=m.minConstraints,E=m.maxConstraints,N=m.lockAspectRatio,W=m.axis;m.width,m.height;var B=m.resizeHandles,Z=m.style,se=m.transformScale,re=b(m,o);return t.createElement(r.default,{axis:W,draggableOpts:U,handle:d,handleSize:g,height:this.state.height,lockAspectRatio:N,maxConstraints:E,minConstraints:L,onResizeStart:F,onResize:this.onResize,onResizeStop:D,resizeHandles:B,transformScale:se,width:this.state.width},t.createElement("div",p({},re,{style:v(v({},Z),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},f}(t.Component);return Ze.default=a,a.propTypes=v(v({},n.resizableProps),{},{children:e.default.element}),Ze}var Nn;function ao(){return Nn||(Nn=1,Xe.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Xe.exports.Resizable=dr().default,Xe.exports.ResizableBox=io().default),Xe.exports}var we={},jn;function fr(){if(jn)return we;jn=1,Object.defineProperty(we,"__esModule",{value:!0}),we.resizeHandleType=we.resizeHandleAxesType=we.default=void 0;var t=r(Oe()),e=r(j);function r(i){return i&&i.__esModule?i:{default:i}}const n=we.resizeHandleAxesType=t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),o=we.resizeHandleType=t.default.oneOfType([t.default.node,t.default.func]);return we.default={className:t.default.string,style:t.default.object,width:t.default.number,autoSize:t.default.bool,cols:t.default.number,draggableCancel:t.default.string,draggableHandle:t.default.string,verticalCompact:function(i){i.verticalCompact},compactType:t.default.oneOf(["vertical","horizontal"]),layout:function(i){var c=i.layout;c!==void 0&&Ae().validateLayout(c,"layout")},margin:t.default.arrayOf(t.default.number),containerPadding:t.default.arrayOf(t.default.number),rowHeight:t.default.number,maxRows:t.default.number,isBounded:t.default.bool,isDraggable:t.default.bool,isResizable:t.default.bool,allowOverlap:t.default.bool,preventCollision:t.default.bool,useCSSTransforms:t.default.bool,transformScale:t.default.number,isDroppable:t.default.bool,resizeHandles:n,resizeHandle:o,onLayoutChange:t.default.func,onDragStart:t.default.func,onDrag:t.default.func,onDragStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,onResizeStop:t.default.func,onDrop:t.default.func,droppingItem:t.default.shape({i:t.default.string.isRequired,w:t.default.number.isRequired,h:t.default.number.isRequired}),children:function(i,c){const y=i[c],p={};e.default.Children.forEach(y,function(S){if((S==null?void 0:S.key)!=null){if(p[S.key])throw new Error('Duplicate child key "'+S.key+'" found! This will cause problems in ReactGridLayout.');p[S.key]=!0}})},innerRef:t.default.any},we}var Ln;function so(){if(Ln)return He;Ln=1,Object.defineProperty(He,"__esModule",{value:!0}),He.default=void 0;var t=p(j),e=p(Oe()),r=dn(),n=ao(),o=Ae(),i=un(),c=fr(),y=p(ln());function p(w){return w&&w.__esModule?w:{default:w}}function S(w,b,R){return b=v(b),b in w?Object.defineProperty(w,b,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[b]=R,w}function v(w){var b=T(w,"string");return typeof b=="symbol"?b:String(b)}function T(w,b){if(typeof w!="object"||w===null)return w;var R=w[Symbol.toPrimitive];if(R!==void 0){var h=R.call(w,b);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(w)}let _=class extends t.default.Component{constructor(){super(...arguments),S(this,"state",{resizing:null,dragging:null,className:""}),S(this,"elementRef",t.default.createRef()),S(this,"onDragStart",(b,R)=>{let{node:h}=R;const{onDragStart:a,transformScale:s}=this.props;if(!a)return;const f={top:0,left:0},{offsetParent:C}=h;if(!C)return;const l=C.getBoundingClientRect(),m=h.getBoundingClientRect(),d=m.left/s,g=l.left/s,F=m.top/s,D=l.top/s;f.left=d-g+C.scrollLeft,f.top=F-D+C.scrollTop,this.setState({dragging:f});const{x:U,y:L}=(0,i.calcXY)(this.getPositionParams(),f.top,f.left,this.props.w,this.props.h);return a.call(this,this.props.i,U,L,{e:b,node:h,newPosition:f})}),S(this,"onDrag",(b,R)=>{let{node:h,deltaX:a,deltaY:s}=R;const{onDrag:f}=this.props;if(!f)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let C=this.state.dragging.top+s,l=this.state.dragging.left+a;const{isBounded:m,i:d,w:g,h:F,containerWidth:D}=this.props,U=this.getPositionParams();if(m){const{offsetParent:B}=h;if(B){const{margin:Z,rowHeight:se,containerPadding:re}=this.props,q=B.clientHeight-(0,i.calcGridItemWHPx)(F,se,Z[1]);C=(0,i.clamp)(C-re[1],0,q);const k=(0,i.calcGridColWidth)(U),ne=D-(0,i.calcGridItemWHPx)(g,k,Z[0]);l=(0,i.clamp)(l-re[0],0,ne)}}const L={top:C,left:l};this.setState({dragging:L});const{containerPadding:E}=this.props,{x:N,y:W}=(0,i.calcXY)(U,C-E[1],l-E[0],g,F);return f.call(this,d,N,W,{e:b,node:h,newPosition:L})}),S(this,"onDragStop",(b,R)=>{let{node:h}=R;const{onDragStop:a}=this.props;if(!a)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:s,h:f,i:C,containerPadding:l}=this.props,{left:m,top:d}=this.state.dragging,g={top:d,left:m};this.setState({dragging:null});const{x:F,y:D}=(0,i.calcXY)(this.getPositionParams(),d-l[1],m-l[0],s,f);return a.call(this,C,F,D,{e:b,node:h,newPosition:g})}),S(this,"onResizeStop",(b,R,h)=>this.onResizeHandler(b,R,h,"onResizeStop")),S(this,"onResizeStart",(b,R,h)=>this.onResizeHandler(b,R,h,"onResizeStart")),S(this,"onResize",(b,R,h)=>this.onResizeHandler(b,R,h,"onResize"))}shouldComponentUpdate(b,R){if(this.props.children!==b.children||this.props.droppingPosition!==b.droppingPosition)return!0;const h=(0,i.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),a=(0,i.calcGridItemPosition)(this.getPositionParams(b),b.x,b.y,b.w,b.h,R);return!(0,o.fastPositionEqual)(h,a)||this.props.useCSSTransforms!==b.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(b){this.moveDroppingItem(b)}moveDroppingItem(b){const{droppingPosition:R}=this.props;if(!R)return;const h=this.elementRef.current;if(!h)return;const a=b.droppingPosition||{left:0,top:0},{dragging:s}=this.state,f=s&&R.left!==a.left||R.top!==a.top;if(!s)this.onDragStart(R.e,{node:h,deltaX:R.left,deltaY:R.top});else if(f){const C=R.left-s.left,l=R.top-s.top;this.onDrag(R.e,{node:h,deltaX:C,deltaY:l})}}getPositionParams(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:b.cols,containerPadding:b.containerPadding,containerWidth:b.containerWidth,margin:b.margin,maxRows:b.maxRows,rowHeight:b.rowHeight}}createStyle(b){const{usePercentages:R,containerWidth:h,useCSSTransforms:a}=this.props;let s;return a?s=(0,o.setTransform)(b):(s=(0,o.setTopLeft)(b),R&&(s.left=(0,o.perc)(b.left/h),s.width=(0,o.perc)(b.width/h))),s}mixinDraggable(b,R){return t.default.createElement(r.DraggableCore,{disabled:!R,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},b)}curryResizeHandler(b,R){return(h,a)=>R(h,a,b)}mixinResizable(b,R,h){const{cols:a,minW:s,minH:f,maxW:C,maxH:l,transformScale:m,resizeHandles:d,resizeHandle:g}=this.props,F=this.getPositionParams(),D=(0,i.calcGridItemPosition)(F,0,0,a,0).width,U=(0,i.calcGridItemPosition)(F,0,0,s,f),L=(0,i.calcGridItemPosition)(F,0,0,C,l),E=[U.width,U.height],N=[Math.min(L.width,D),Math.min(L.height,1/0)];return t.default.createElement(n.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:R.width,height:R.height,minConstraints:E,maxConstraints:N,onResizeStop:this.curryResizeHandler(R,this.onResizeStop),onResizeStart:this.curryResizeHandler(R,this.onResizeStart),onResize:this.curryResizeHandler(R,this.onResize),transformScale:m,resizeHandles:d,handle:g},b)}onResizeHandler(b,R,h,a){let{node:s,size:f,handle:C}=R;const l=this.props[a];if(!l)return;const{x:m,y:d,i:g,maxH:F,minH:D,containerWidth:U}=this.props,{minW:L,maxW:E}=this.props;let N=f;s&&(N=(0,o.resizeItemInDirection)(C,h,f,U),this.setState({resizing:a==="onResizeStop"?null:N}));let{w:W,h:B}=(0,i.calcWH)(this.getPositionParams(),N.width,N.height,m,d,C);W=(0,i.clamp)(W,Math.max(L,1),E),B=(0,i.clamp)(B,D,F),l.call(this,g,W,B,{e:b,node:s,size:N,handle:C})}render(){const{x:b,y:R,w:h,h:a,isDraggable:s,isResizable:f,droppingPosition:C,useCSSTransforms:l}=this.props,m=(0,i.calcGridItemPosition)(this.getPositionParams(),b,R,h,a,this.state),d=t.default.Children.only(this.props.children);let g=t.default.cloneElement(d,{ref:this.elementRef,className:(0,y.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":s,"react-draggable-dragging":!!this.state.dragging,dropping:!!C,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(m)}});return g=this.mixinResizable(g,m,f),g=this.mixinDraggable(g,s),g}};return He.default=_,S(_,"propTypes",{children:e.default.element,cols:e.default.number.isRequired,containerWidth:e.default.number.isRequired,rowHeight:e.default.number.isRequired,margin:e.default.array.isRequired,maxRows:e.default.number.isRequired,containerPadding:e.default.array.isRequired,x:e.default.number.isRequired,y:e.default.number.isRequired,w:e.default.number.isRequired,h:e.default.number.isRequired,minW:function(w,b){const R=w[b];if(typeof R!="number")return new Error("minWidth not Number");if(R>w.w||R>w.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(w,b){const R=w[b];if(typeof R!="number")return new Error("maxWidth not Number");if(R<w.w||R<w.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(w,b){const R=w[b];if(typeof R!="number")return new Error("minHeight not Number");if(R>w.h||R>w.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(w,b){const R=w[b];if(typeof R!="number")return new Error("maxHeight not Number");if(R<w.h||R<w.minH)return new Error("maxHeight smaller than item height/minHeight")},i:e.default.string.isRequired,resizeHandles:c.resizeHandleAxesType,resizeHandle:c.resizeHandleType,onDragStop:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,isDraggable:e.default.bool.isRequired,isResizable:e.default.bool.isRequired,isBounded:e.default.bool.isRequired,static:e.default.bool,useCSSTransforms:e.default.bool.isRequired,transformScale:e.default.number,className:e.default.string,handle:e.default.string,cancel:e.default.string,droppingPosition:e.default.shape({e:e.default.object.isRequired,left:e.default.number.isRequired,top:e.default.number.isRequired})}),S(_,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),He}var Un;function pr(){if(Un)return We;Un=1,Object.defineProperty(We,"__esModule",{value:!0}),We.default=void 0;var t=S(j),e=sn(),r=y(ln()),n=Ae(),o=un(),i=y(so()),c=y(fr());function y(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(p=function(f){return f?s:a})(h)}function S(h,a){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(a);if(s&&s.has(h))return s.get(h);var f={__proto__:null},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var m=C?Object.getOwnPropertyDescriptor(h,l):null;m&&(m.get||m.set)?Object.defineProperty(f,l,m):f[l]=h[l]}return f.default=h,s&&s.set(h,f),f}function v(h,a,s){return a=T(a),a in h?Object.defineProperty(h,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[a]=s,h}function T(h){var a=_(h,"string");return typeof a=="symbol"?a:String(a)}function _(h,a){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,a);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(h)}const w="react-grid-layout";let b=!1;try{b=/firefox/i.test(navigator.userAgent)}catch{}let R=class extends t.Component{constructor(){super(...arguments),v(this,"state",{activeDrag:null,layout:(0,n.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,n.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),v(this,"dragEnterCounter",0),v(this,"onDragStart",(a,s,f,C)=>{let{e:l,node:m}=C;const{layout:d}=this.state,g=(0,n.getLayoutItem)(d,a);if(!g)return;const F={w:g.w,h:g.h,x:g.x,y:g.y,placeholder:!0,i:a};return this.setState({oldDragItem:(0,n.cloneLayoutItem)(g),oldLayout:d,activeDrag:F}),this.props.onDragStart(d,g,g,null,l,m)}),v(this,"onDrag",(a,s,f,C)=>{let{e:l,node:m}=C;const{oldDragItem:d}=this.state;let{layout:g}=this.state;const{cols:F,allowOverlap:D,preventCollision:U}=this.props,L=(0,n.getLayoutItem)(g,a);if(!L)return;const E={w:L.w,h:L.h,x:L.x,y:L.y,placeholder:!0,i:a};g=(0,n.moveElement)(g,L,s,f,!0,U,(0,n.compactType)(this.props),F,D),this.props.onDrag(g,d,L,E,l,m),this.setState({layout:D?g:(0,n.compact)(g,(0,n.compactType)(this.props),F),activeDrag:E})}),v(this,"onDragStop",(a,s,f,C)=>{let{e:l,node:m}=C;if(!this.state.activeDrag)return;const{oldDragItem:d}=this.state;let{layout:g}=this.state;const{cols:F,preventCollision:D,allowOverlap:U}=this.props,L=(0,n.getLayoutItem)(g,a);if(!L)return;g=(0,n.moveElement)(g,L,s,f,!0,D,(0,n.compactType)(this.props),F,U);const N=U?g:(0,n.compact)(g,(0,n.compactType)(this.props),F);this.props.onDragStop(N,d,L,null,l,m);const{oldLayout:W}=this.state;this.setState({activeDrag:null,layout:N,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(N,W)}),v(this,"onResizeStart",(a,s,f,C)=>{let{e:l,node:m}=C;const{layout:d}=this.state,g=(0,n.getLayoutItem)(d,a);g&&(this.setState({oldResizeItem:(0,n.cloneLayoutItem)(g),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(d,g,g,null,l,m))}),v(this,"onResize",(a,s,f,C)=>{let{e:l,node:m,size:d,handle:g}=C;const{oldResizeItem:F}=this.state,{layout:D}=this.state,{cols:U,preventCollision:L,allowOverlap:E}=this.props;let N=!1,W,B,Z;const[se,re]=(0,n.withLayoutItem)(D,a,k=>{let ne;return B=k.x,Z=k.y,["sw","w","nw","n","ne"].indexOf(g)!==-1&&(["sw","nw","w"].indexOf(g)!==-1&&(B=k.x+(k.w-s),s=k.x!==B&&B<0?k.w:s,B=B<0?0:B),["ne","n","nw"].indexOf(g)!==-1&&(Z=k.y+(k.h-f),f=k.y!==Z&&Z<0?k.h:f,Z=Z<0?0:Z),N=!0),L&&!E&&(ne=(0,n.getAllCollisions)(D,{...k,w:s,h:f,x:B,y:Z}).filter(le=>le.i!==k.i).length>0,ne&&(Z=k.y,f=k.h,B=k.x,s=k.w,N=!1)),k.w=s,k.h=f,k});if(!re)return;W=se,N&&(W=(0,n.moveElement)(se,re,B,Z,!0,this.props.preventCollision,(0,n.compactType)(this.props),U,E));const q={w:re.w,h:re.h,x:re.x,y:re.y,static:!0,i:a};this.props.onResize(W,F,re,q,l,m),this.setState({layout:E?W:(0,n.compact)(W,(0,n.compactType)(this.props),U),activeDrag:q})}),v(this,"onResizeStop",(a,s,f,C)=>{let{e:l,node:m}=C;const{layout:d,oldResizeItem:g}=this.state,{cols:F,allowOverlap:D}=this.props,U=(0,n.getLayoutItem)(d,a),L=D?d:(0,n.compact)(d,(0,n.compactType)(this.props),F);this.props.onResizeStop(L,g,U,null,l,m);const{oldLayout:E}=this.state;this.setState({activeDrag:null,layout:L,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(L,E)}),v(this,"onDragOver",a=>{var se;if(a.preventDefault(),a.stopPropagation(),b&&!((se=a.nativeEvent.target)!=null&&se.classList.contains(w)))return!1;const{droppingItem:s,onDropDragOver:f,margin:C,cols:l,rowHeight:m,maxRows:d,width:g,containerPadding:F,transformScale:D}=this.props,U=f==null?void 0:f(a);if(U===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const L={...s,...U},{layout:E}=this.state,N=a.currentTarget.getBoundingClientRect(),W=a.clientX-N.left,B=a.clientY-N.top,Z={left:W/D,top:B/D,e:a};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:re,top:q}=this.state.droppingPosition;(re!=W||q!=B)&&this.setState({droppingPosition:Z})}}else{const re={cols:l,margin:C,maxRows:d,rowHeight:m,containerWidth:g,containerPadding:F||C},q=(0,o.calcXY)(re,B,W,L.w,L.h);this.setState({droppingDOMNode:t.createElement("div",{key:L.i}),droppingPosition:Z,layout:[...E,{...L,x:q.x,y:q.y,static:!1,isDraggable:!0}]})}}),v(this,"removeDroppingPlaceholder",()=>{const{droppingItem:a,cols:s}=this.props,{layout:f}=this.state,C=(0,n.compact)(f.filter(l=>l.i!==a.i),(0,n.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:C,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),v(this,"onDragLeave",a=>{a.preventDefault(),a.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),v(this,"onDragEnter",a=>{a.preventDefault(),a.stopPropagation(),this.dragEnterCounter++}),v(this,"onDrop",a=>{a.preventDefault(),a.stopPropagation();const{droppingItem:s}=this.props,{layout:f}=this.state,C=f.find(l=>l.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(f,C,a)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(a,s){let f;return s.activeDrag?null:(!(0,e.deepEqual)(a.layout,s.propsLayout)||a.compactType!==s.compactType?f=a.layout:(0,n.childrenEqual)(a.children,s.children)||(f=s.layout),f?{layout:(0,n.synchronizeLayoutWithChildren)(f,a.children,a.cols,(0,n.compactType)(a),a.allowOverlap),compactType:a.compactType,children:a.children,propsLayout:a.layout}:null)}shouldComponentUpdate(a,s){return this.props.children!==a.children||!(0,n.fastRGLPropsEqual)(this.props,a,e.deepEqual)||this.state.activeDrag!==s.activeDrag||this.state.mounted!==s.mounted||this.state.droppingPosition!==s.droppingPosition}componentDidUpdate(a,s){if(!this.state.activeDrag){const f=this.state.layout,C=s.layout;this.onLayoutMaybeChanged(f,C)}}containerHeight(){if(!this.props.autoSize)return;const a=(0,n.bottom)(this.state.layout),s=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return a*this.props.rowHeight+(a-1)*this.props.margin[1]+s*2+"px"}onLayoutMaybeChanged(a,s){s||(s=this.state.layout),(0,e.deepEqual)(s,a)||this.props.onLayoutChange(a)}placeholder(){const{activeDrag:a}=this.state;if(!a)return null;const{width:s,cols:f,margin:C,containerPadding:l,rowHeight:m,maxRows:d,useCSSTransforms:g,transformScale:F}=this.props;return t.createElement(i.default,{w:a.w,h:a.h,x:a.x,y:a.y,i:a.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:s,cols:f,margin:C,containerPadding:l||C,maxRows:d,rowHeight:m,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:g,transformScale:F},t.createElement("div",null))}processGridItem(a,s){if(!a||!a.key)return;const f=(0,n.getLayoutItem)(this.state.layout,String(a.key));if(!f)return null;const{width:C,cols:l,margin:m,containerPadding:d,rowHeight:g,maxRows:F,isDraggable:D,isResizable:U,isBounded:L,useCSSTransforms:E,transformScale:N,draggableCancel:W,draggableHandle:B,resizeHandles:Z,resizeHandle:se}=this.props,{mounted:re,droppingPosition:q}=this.state,k=typeof f.isDraggable=="boolean"?f.isDraggable:!f.static&&D,ne=typeof f.isResizable=="boolean"?f.isResizable:!f.static&&U,oe=f.resizeHandles||Z,le=k&&L&&f.isBounded!==!1;return t.createElement(i.default,{containerWidth:C,cols:l,margin:m,containerPadding:d||m,maxRows:F,rowHeight:g,cancel:W,handle:B,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:k,isResizable:ne,isBounded:le,useCSSTransforms:E&&re,usePercentages:!re,transformScale:N,w:f.w,h:f.h,x:f.x,y:f.y,i:f.i,minH:f.minH,minW:f.minW,maxH:f.maxH,maxW:f.maxW,static:f.static,droppingPosition:s?q:void 0,resizeHandles:oe,resizeHandle:se},a)}render(){const{className:a,style:s,isDroppable:f,innerRef:C}=this.props,l=(0,r.default)(w,a),m={height:this.containerHeight(),...s};return t.createElement("div",{ref:C,className:l,style:m,onDrop:f?this.onDrop:n.noop,onDragLeave:f?this.onDragLeave:n.noop,onDragEnter:f?this.onDragEnter:n.noop,onDragOver:f?this.onDragOver:n.noop},t.Children.map(this.props.children,d=>this.processGridItem(d)),f&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return We.default=R,v(R,"displayName","ReactGridLayout"),v(R,"propTypes",c.default),v(R,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:n.noop,onDragStart:n.noop,onDrag:n.noop,onDragStop:n.noop,onResizeStart:n.noop,onResize:n.noop,onResizeStop:n.noop,onDrop:n.noop,onDropDragOver:n.noop}),We}var Je={},De={},Vn;function hr(){if(Vn)return De;Vn=1,Object.defineProperty(De,"__esModule",{value:!0}),De.findOrGenerateResponsiveLayout=n,De.getBreakpointFromWidth=e,De.getColsFromBreakpoint=r,De.sortBreakpoints=o;var t=Ae();function e(i,c){const y=o(i);let p=y[0];for(let S=1,v=y.length;S<v;S++){const T=y[S];c>i[T]&&(p=T)}return p}function r(i,c){if(!c[i])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+i+" is missing!");return c[i]}function n(i,c,y,p,S,v){if(i[y])return(0,t.cloneLayout)(i[y]);let T=i[p];const _=o(c),w=_.slice(_.indexOf(y));for(let b=0,R=w.length;b<R;b++){const h=w[b];if(i[h]){T=i[h];break}}return T=(0,t.cloneLayout)(T||[]),(0,t.compact)((0,t.correctBounds)(T,{cols:S}),v,S)}function o(i){return Object.keys(i).sort(function(y,p){return i[y]-i[p]})}return De}var zn;function lo(){if(zn)return Je;zn=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.default=void 0;var t=p(j),e=c(Oe()),r=sn(),n=Ae(),o=hr(),i=c(pr());function c(h){return h&&h.__esModule?h:{default:h}}function y(h){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(y=function(f){return f?s:a})(h)}function p(h,a){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=y(a);if(s&&s.has(h))return s.get(h);var f={__proto__:null},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var m=C?Object.getOwnPropertyDescriptor(h,l):null;m&&(m.get||m.set)?Object.defineProperty(f,l,m):f[l]=h[l]}return f.default=h,s&&s.set(h,f),f}function S(){return S=Object.assign?Object.assign.bind():function(h){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var f in s)Object.prototype.hasOwnProperty.call(s,f)&&(h[f]=s[f])}return h},S.apply(this,arguments)}function v(h,a,s){return a=T(a),a in h?Object.defineProperty(h,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[a]=s,h}function T(h){var a=_(h,"string");return typeof a=="symbol"?a:String(a)}function _(h,a){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,a);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(h)}const w=h=>Object.prototype.toString.call(h);function b(h,a){return h==null?null:Array.isArray(h)?h:h[a]}let R=class extends t.Component{constructor(){super(...arguments),v(this,"state",this.generateInitialState()),v(this,"onLayoutChange",a=>{this.props.onLayoutChange(a,{...this.props.layouts,[this.state.breakpoint]:a})})}generateInitialState(){const{width:a,breakpoints:s,layouts:f,cols:C}=this.props,l=(0,o.getBreakpointFromWidth)(s,a),m=(0,o.getColsFromBreakpoint)(l,C),d=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,o.findOrGenerateResponsiveLayout)(f,s,l,l,m,d),breakpoint:l,cols:m}}static getDerivedStateFromProps(a,s){if(!(0,r.deepEqual)(a.layouts,s.layouts)){const{breakpoint:f,cols:C}=s;return{layout:(0,o.findOrGenerateResponsiveLayout)(a.layouts,a.breakpoints,f,f,C,a.compactType),layouts:a.layouts}}return null}componentDidUpdate(a){(this.props.width!=a.width||this.props.breakpoint!==a.breakpoint||!(0,r.deepEqual)(this.props.breakpoints,a.breakpoints)||!(0,r.deepEqual)(this.props.cols,a.cols))&&this.onWidthChange(a)}onWidthChange(a){const{breakpoints:s,cols:f,layouts:C,compactType:l}=this.props,m=this.props.breakpoint||(0,o.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),d=this.state.breakpoint,g=(0,o.getColsFromBreakpoint)(m,f),F={...C};if(d!==m||a.breakpoints!==s||a.cols!==f){d in F||(F[d]=(0,n.cloneLayout)(this.state.layout));let L=(0,o.findOrGenerateResponsiveLayout)(F,s,m,d,g,l);L=(0,n.synchronizeLayoutWithChildren)(L,this.props.children,g,l,this.props.allowOverlap),F[m]=L,this.props.onLayoutChange(L,F),this.props.onBreakpointChange(m,g),this.setState({breakpoint:m,layout:L,cols:g})}const D=b(this.props.margin,m),U=b(this.props.containerPadding,m);this.props.onWidthChange(this.props.width,D,g,U)}render(){const{breakpoint:a,breakpoints:s,cols:f,layouts:C,margin:l,containerPadding:m,onBreakpointChange:d,onLayoutChange:g,onWidthChange:F,...D}=this.props;return t.createElement(i.default,S({},D,{margin:b(l,this.state.breakpoint),containerPadding:b(m,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return Je.default=R,v(R,"propTypes",{breakpoint:e.default.string,breakpoints:e.default.object,allowOverlap:e.default.bool,cols:e.default.object,margin:e.default.oneOfType([e.default.array,e.default.object]),containerPadding:e.default.oneOfType([e.default.array,e.default.object]),layouts(h,a){if(w(h[a])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+w(h[a]));Object.keys(h[a]).forEach(s=>{if(!(s in h.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,n.validateLayout)(h.layouts[s],"layouts."+s)})},width:e.default.number.isRequired,onBreakpointChange:e.default.func,onLayoutChange:e.default.func,onWidthChange:e.default.func}),v(R,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:n.noop,onLayoutChange:n.noop,onWidthChange:n.noop}),Je}var yt={},mr=function(){if(typeof Map<"u")return Map;function t(e,r){var n=-1;return e.some(function(o,i){return o[0]===r?(n=i,!0):!1}),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(r){var n=t(this.__entries__,r),o=this.__entries__[n];return o&&o[1]},e.prototype.set=function(r,n){var o=t(this.__entries__,r);~o?this.__entries__[o][1]=n:this.__entries__.push([r,n])},e.prototype.delete=function(r){var n=this.__entries__,o=t(n,r);~o&&n.splice(o,1)},e.prototype.has=function(r){return!!~t(this.__entries__,r)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var o=0,i=this.__entries__;o<i.length;o++){var c=i[o];r.call(n,c[1],c[0])}},e}()}(),Kt=typeof window<"u"&&typeof document<"u"&&window.document===document,It=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")()}(),uo=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(It):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),co=2;function fo(t,e){var r=!1,n=!1,o=0;function i(){r&&(r=!1,t()),n&&y()}function c(){uo(i)}function y(){var p=Date.now();if(r){if(p-o<co)return;n=!0}else r=!0,n=!1,setTimeout(c,e);o=p}return y}var po=20,ho=["top","right","bottom","left","width","height","size","weight"],mo=typeof MutationObserver<"u",go=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=fo(this.refresh.bind(this),po)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var r=this.observers_,n=r.indexOf(e);~n&&r.splice(n,1),!r.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(r){return r.gatherActive(),r.hasActive()});return e.forEach(function(r){return r.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!Kt||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mo?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!Kt||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var r=e.propertyName,n=r===void 0?"":r,o=ho.some(function(i){return!!~n.indexOf(i)});o&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),gr=function(t,e){for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];Object.defineProperty(t,o,{value:e[o],enumerable:!1,writable:!1,configurable:!0})}return t},ze=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||It},vr=Lt(0,0,0,0);function _t(t){return parseFloat(t)||0}function kn(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return e.reduce(function(n,o){var i=t["border-"+o+"-width"];return n+_t(i)},0)}function vo(t){for(var e=["top","right","bottom","left"],r={},n=0,o=e;n<o.length;n++){var i=o[n],c=t["padding-"+i];r[i]=_t(c)}return r}function yo(t){var e=t.getBBox();return Lt(0,0,e.width,e.height)}function Co(t){var e=t.clientWidth,r=t.clientHeight;if(!e&&!r)return vr;var n=ze(t).getComputedStyle(t),o=vo(n),i=o.left+o.right,c=o.top+o.bottom,y=_t(n.width),p=_t(n.height);if(n.boxSizing==="border-box"&&(Math.round(y+i)!==e&&(y-=kn(n,"left","right")+i),Math.round(p+c)!==r&&(p-=kn(n,"top","bottom")+c)),!So(t)){var S=Math.round(y+i)-e,v=Math.round(p+c)-r;Math.abs(S)!==1&&(y-=S),Math.abs(v)!==1&&(p-=v)}return Lt(o.left,o.top,y,p)}var bo=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof ze(t).SVGGraphicsElement}:function(t){return t instanceof ze(t).SVGElement&&typeof t.getBBox=="function"}}();function So(t){return t===ze(t).document.documentElement}function Ro(t){return Kt?bo(t)?yo(t):Co(t):vr}function To(t){var e=t.x,r=t.y,n=t.width,o=t.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,c=Object.create(i.prototype);return gr(c,{x:e,y:r,width:n,height:o,top:r,right:e+n,bottom:o+r,left:e}),c}function Lt(t,e,r,n){return{x:t,y:e,width:r,height:n}}var wo=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Lt(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=Ro(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},t}(),xo=function(){function t(e,r){var n=To(r);gr(this,{target:e,contentRect:n})}return t}(),Io=function(){function t(e,r,n){if(this.activeObservations_=[],this.observations_=new mr,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=r,this.callbackCtx_=n}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ze(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)||(r.set(e,new wo(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ze(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)&&(r.delete(e),r.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&e.activeObservations_.push(r)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new xo(n.target,n.broadcastRect())});this.callback_.call(e,r,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),yr=typeof WeakMap<"u"?new WeakMap:new mr,Cr=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=go.getInstance(),n=new Io(e,r,this);yr.set(this,n)}return t}();["observe","unobserve","disconnect"].forEach(function(t){Cr.prototype[t]=function(){var e;return(e=yr.get(this))[t].apply(e,arguments)}});var _o=function(){return typeof It.ResizeObserver<"u"?It.ResizeObserver:Cr}();const Eo=Object.freeze(Object.defineProperty({__proto__:null,default:_o},Symbol.toStringTag,{value:"Module"})),Oo=ar(Eo);var $n;function Po(){if($n)return yt;$n=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.default=_;var t=c(j),e=o(Oe()),r=o(Oo),n=o(ln());function o(w){return w&&w.__esModule?w:{default:w}}function i(w){if(typeof WeakMap!="function")return null;var b=new WeakMap,R=new WeakMap;return(i=function(h){return h?R:b})(w)}function c(w,b){if(w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var R=i(b);if(R&&R.has(w))return R.get(w);var h={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in w)if(s!=="default"&&Object.prototype.hasOwnProperty.call(w,s)){var f=a?Object.getOwnPropertyDescriptor(w,s):null;f&&(f.get||f.set)?Object.defineProperty(h,s,f):h[s]=w[s]}return h.default=w,R&&R.set(w,h),h}function y(){return y=Object.assign?Object.assign.bind():function(w){for(var b=1;b<arguments.length;b++){var R=arguments[b];for(var h in R)Object.prototype.hasOwnProperty.call(R,h)&&(w[h]=R[h])}return w},y.apply(this,arguments)}function p(w,b,R){return b=S(b),b in w?Object.defineProperty(w,b,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[b]=R,w}function S(w){var b=v(w,"string");return typeof b=="symbol"?b:String(b)}function v(w,b){if(typeof w!="object"||w===null)return w;var R=w[Symbol.toPrimitive];if(R!==void 0){var h=R.call(w,b);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(w)}const T="react-grid-layout";function _(w){var b;return b=class extends t.Component{constructor(){super(...arguments),p(this,"state",{width:1280}),p(this,"elementRef",t.createRef()),p(this,"mounted",!1),p(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new r.default(a=>{if(this.elementRef.current instanceof HTMLElement){const f=a[0].contentRect.width;this.setState({width:f})}});const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.observe(h)}componentWillUnmount(){this.mounted=!1;const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.unobserve(h),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:h,...a}=this.props;return h&&!this.mounted?t.createElement("div",{className:(0,n.default)(this.props.className,T),style:this.props.style,ref:this.elementRef}):t.createElement(w,y({innerRef:this.elementRef},a,this.state))}},p(b,"defaultProps",{measureBeforeMount:!1}),p(b,"propTypes",{measureBeforeMount:e.default.bool}),b}return yt}var An;function Fo(){return An||(An=1,function(t){t.exports=pr().default,t.exports.utils=Ae(),t.exports.calculateUtils=un(),t.exports.Responsive=lo().default,t.exports.Responsive.utils=hr(),t.exports.WidthProvider=Po().default}(Vt)),Vt.exports}var Do=Fo();const Mo=Xr(Do);var No=Object.getOwnPropertyDescriptor,jo=(t,e,r,n)=>{for(var o=n>1?void 0:n?No(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},Lo=(t,e)=>(r,n)=>e(r,n,t);let ke=class extends x.Disposable{constructor(e){super();Ie(this,"_initLocal",()=>{});Ie(this,"_findReplaceIndex",e=>{const r=/\{([^}]+)?\}/g,n=[];let o=r.exec(e);for(;o;)n.push({startIndex:o.index,key:Number(o[1]),endIndex:o.index+o[0].length-1}),o=r.exec(e);return n});this._localeService=e,this._initLocal()}tWithReactNode(e,...r){const n=this._localeService.getLocales(),o=e.split("."),i=n&&this._localeService.resolveKeyPath(n,o);if(typeof i=="string"){const c=[];return this._findReplaceIndex(i).forEach((y,p,S)=>{const v=S[p-1]||{endIndex:-1};if(v.endIndex+1<y.startIndex){const T=i.slice(v.endIndex+1,y.startIndex);T&&c.push(T)}if(r[y.key]&&c.push(r[y.key]),p===S.length-1){const T=i.slice(y.endIndex+1);T&&c.push(T)}}),c}return[]}};ke=jo([Lo(0,x.Inject(x.LocaleService))],ke);const Uo="univer-cf-preview",Ct={cfPreview:Uo},qe=t=>{var o,i;const e=t.rule;if(!e)return null;const r=j.useMemo(()=>{if(e.type===u.CFRuleType.colorScale){const c=e.config.map((S,v)=>({color:new x.ColorKit(S.color),value:v})),y=c.length-1;return new Array(5).fill("").map((S,v,T)=>v*y/(T.length-1)).map(S=>u.getColorScaleFromValue(c,S))}return null},[e]),n=j.useMemo(()=>{if(e.type===u.CFRuleType.iconSet)return e.config.map(c=>{const y=u.iconMap[c.iconType];return y&&y[Number(c.iconId)]})},[e]);switch(e.type){case u.CFRuleType.dataBar:{const{isGradient:c}=e.config,y={width:"50%",height:"100%"},p=c?`linear-gradient(to right, ${e.config.positiveColor||u.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,S=c?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||u.defaultDataBarNativeColor})`:e.config.nativeColor;return I.jsxs("div",{className:Ct.cfPreview,children:[I.jsx("div",{style:{...y,background:S,border:`1px solid ${e.config.nativeColor||u.defaultDataBarNativeColor}`}}),I.jsx("div",{style:{...y,background:p,border:`1px solid ${e.config.positiveColor||u.defaultDataBarPositiveColor}`}})]})}case u.CFRuleType.colorScale:return r&&I.jsx("div",{className:Ct.cfPreview,children:r.map((c,y)=>I.jsx("div",{style:{width:`${100/r.length}%`,height:"100%",background:c}},y))});case u.CFRuleType.iconSet:return n&&I.jsx("div",{className:Ct.cfPreview,children:n.map((c,y)=>c?I.jsx("img",{style:{height:"100%"},src:c},y):I.jsx(ft,{},y))});case u.CFRuleType.highlightCell:{const{ul:c,st:y,it:p,bl:S,bg:v,cl:T}=e.style,_=(c==null?void 0:c.s)===x.BooleanNumber.TRUE,w=(y==null?void 0:y.s)===x.BooleanNumber.TRUE,b=p===x.BooleanNumber.TRUE,R=S===x.BooleanNumber.TRUE,h=(o=v==null?void 0:v.rgb)!=null?o:u.DEFAULT_BG_COLOR,a=(i=T==null?void 0:T.rgb)!=null?i:u.DEFAULT_FONT_COLOR,s={fontWeight:R?"bold":void 0,fontStyle:b?"italic":void 0,textDecoration:`${_?"underline":""} ${w?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:a};return I.jsx("div",{style:s,className:Ct.cfPreview,children:"123"})}}return null},Vo="univer-cf-rule-list",zo="univer-rule-selector",ko="univer-select",$o="univer-btn-list",Ao="univer-gap",qo="univer-icon",Wo="univer-disabled",Ho="univer-rule-item",Bo="univer-rule-describe",Go="univer-rule-type",Xo="univer-rule-range",Yo="univer-active",Ko="univer-draggableHandle",Zo="univer-delete-item",Jo="univer-grid-layout-wrap",he={cfRuleList:Vo,ruleSelector:zo,select:ko,btnList:$o,gap:Ao,icon:qo,disabled:Wo,ruleItem:Ho,ruleDescribe:Bo,ruleType:Go,ruleRange:Xo,active:Yo,draggableHandle:Ko,deleteItem:Zo,gridLayoutWrap:Jo},Qo=(t,e)=>{const r=t.rule;switch(r.type){case u.CFRuleType.colorScale:return e.t("sheet.cf.ruleType.colorScale");case u.CFRuleType.dataBar:return e.t("sheet.cf.ruleType.dataBar");case u.CFRuleType.iconSet:return e.t("sheet.cf.ruleType.iconSet");case u.CFRuleType.highlightCell:switch(r.subType){case u.CFSubRuleType.average:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,e.t("sheet.cf.subRuleType.average"))}case u.CFSubRuleType.duplicateValues:return e.t("sheet.cf.subRuleType.duplicateValues");case u.CFSubRuleType.uniqueValues:return e.t("sheet.cf.subRuleType.uniqueValues");case u.CFSubRuleType.number:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,...Array.isArray(r.value)?r.value.map(o=>String(o)):[String(r.value||"")])}case u.CFSubRuleType.text:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,r.value||"")}case u.CFSubRuleType.timePeriod:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`)}case u.CFSubRuleType.rank:return r.isPercent?r.isBottom?e.t("sheet.cf.preview.describe.bottomNPercent",String(r.value)):e.t("sheet.cf.preview.describe.topNPercent",String(r.value)):r.isBottom?e.t("sheet.cf.preview.describe.bottomN",String(r.value)):e.t("sheet.cf.preview.describe.topN",String(r.value));case u.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let qn=0;const ei=t=>{const{onClick:e}=t,r=ee.useDependency(u.ConditionalFormattingRuleModel),n=ee.useDependency(x.IUniverInstanceService),o=ee.useDependency(Y.SheetsSelectionsService),i=ee.useDependency(x.ICommandService),c=ee.useDependency(x.LocaleService),y=ee.useDependency(x.Injector),p=ee.useDependency(ke),S=ee.useObservable(()=>n.getCurrentTypeOfUnit$(x.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),v=S.getUnitId(),T=S.getActiveSheet();if(!T)throw new Error("No active sheet found");const _=T.getSheetId(),[w,b]=j.useState([]),[R,h]=j.useState("2"),[a,s]=j.useState(0),[f,C]=j.useState(-1),[l,m]=j.useState(qn),d=j.useRef(null),g=[{label:c.t("sheet.cf.panel.workSheet"),value:"2"},{label:c.t("sheet.cf.panel.selectedRange"),value:"1"}],F=()=>{const q=r.getSubunitRules(v,_);if(!q||!q.length)return[];if(R==="1"){const k=o.getCurrentLastSelection();if(!k)return[];const ne=k.range;return q.filter(le=>le.ranges.some(pe=>x.Rectangle.intersects(pe,ne)))}else if(R==="2")return[...q];return[]},[D,U]=j.useState(F);de.useHighlightRange(w),j.useEffect(()=>{const q=i.onCommandExecuted(k=>{k.id===Y.SetWorksheetActiveOperation.id&&s(Math.random())});return()=>q.dispose()}),j.useEffect(()=>{U(F)},[R,a,v,_]),j.useEffect(()=>{if(R==="2")return;const q=new Se.Observable(k=>{const ne=[Y.SetSelectionsOperation.id,u.AddConditionalRuleMutation.id,u.SetConditionalRuleMutation.id,u.DeleteConditionalRuleMutation.id,u.MoveConditionalRuleMutation.id],oe=i.onCommandExecuted(le=>{const{id:pe,params:ge}=le,be=n.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET).getUnitId();ne.includes(pe)&&ge.unitId===be&&k.next(null)});return()=>oe.dispose()}).pipe(Se.debounceTime(16)).subscribe(()=>{U(F)});return()=>{q.unsubscribe()}},[n,R,v,_]),j.useEffect(()=>{const q=r.$ruleChange.subscribe(()=>{s(Math.random())});return()=>q.unsubscribe()},[r]),j.useEffect(()=>{const q=()=>{var le;const oe=Math.max(0,(((le=d.current)==null?void 0:le.getBoundingClientRect().width)||0)-8);return qn=oe,oe},ne=new Se.Observable(oe=>{const le=document.querySelector(".univer-sidebar");if(le){let pe=setTimeout(()=>{oe.next()},150);const ge=()=>{pe&&clearTimeout(pe),pe=null},be=$=>{$.propertyName==="width"&&(ge(),oe.next())};return le.addEventListener("transitionend",be),()=>{ge(),le.removeEventListener("transitionend",be)}}}).pipe(Se.debounceTime(16)).subscribe(()=>{m(q())});return()=>{ne.unsubscribe()}},[]);const L=q=>{var oe;const k=n.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET).getUnitId(),ne=(oe=n.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:oe.getSheetId();if(!k||!ne)throw new Error("No active sheet found");i.executeCommand(u.DeleteCfCommand.id,{unitId:k,subUnitId:ne,cfId:q.cfId})},E=(q,k)=>{C(k.y)},N=(q,k,ne)=>{var $;C(-1);const oe=n.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET).getUnitId(),le=($=n.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:$.getSheetId();if(!oe||!le)throw new Error("No active sheet found");const pe=J=>{const ae=D.length;return Math.min(ae-1,Math.max(0,J))},ge=D[pe(k.y)].cfId,be=D[pe(ne.y)].cfId;ge!==be&&i.executeCommand(u.MoveCfCommand.id,{unitId:oe,subUnitId:le,start:{id:ge,type:"self"},end:{id:be,type:ne.y>k.y?"after":"before"}})},W=()=>{t.onCreate()},B=()=>{R==="2"?i.executeCommand(u.ClearWorksheetCfCommand.id):R==="1"&&D.map(k=>({unitId:v,subUnitId:_,cfId:k.cfId})).forEach(k=>{i.executeCommand(u.DeleteCfCommand.id,k)})},Z=j.useMemo(()=>{const q=n.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET),k=q.getActiveSheet();return D.filter(ne=>{const oe=ne.ranges;return Y.checkRangesEditablePermission(y,q.getUnitId(),k.getSheetId(),oe)})},[D]),se=Z.map((q,k)=>({i:q.cfId,x:0,w:12,y:k,h:1,isResizable:!1})),re=j.useMemo(()=>{const q=n.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET),k=q.getActiveSheet();return D.every(ne=>{const oe=ne.ranges;return Y.checkRangesEditablePermission(y,q.getUnitId(),k.getSheetId(),oe)})},[D]);return I.jsxs("div",{className:he.cfRuleList,children:[I.jsxs("div",{className:he.ruleSelector,children:[I.jsx("div",{children:p.tWithReactNode("sheet.cf.panel.managerRuleSelect",I.jsx(Q.Select,{className:he.select,options:g,value:R,onChange:q=>{h(q)}})).map((q,k)=>I.jsx("span",{children:q},k))}),I.jsxs("div",{className:he.btnList,children:[I.jsx(Q.Tooltip,{title:c.t("sheet.cf.panel.createRule"),placement:"bottom",children:I.jsx("div",{className:`
4
4
  ${he.icon}
5
- `,onClick:k,children:_.jsx(dr,{})})}),j.length&&Q?_.jsx(oe.Tooltip,{title:c.t("sheet.cf.panel.clear"),placement:"bottom",children:_.jsx("div",{className:`
5
+ `,onClick:W,children:I.jsx(or,{})})}),D.length&&re?I.jsx(Q.Tooltip,{title:c.t("sheet.cf.panel.clear"),placement:"bottom",children:I.jsx("div",{className:`
6
6
  ${he.gap}
7
7
  ${he.icon}
8
- `,onClick:B,children:_.jsx(Ot,{})})}):_.jsx("div",{className:`
9
- ${he.gap}
10
- ${he.disabled}
11
- `,children:_.jsx(Ot,{})})]})]}),_.jsx("div",{ref:f,className:he.gridLayoutWrap,children:l?_.jsx($o,{onDragStop:D,onDragStart:E,layout:ne,cols:12,rowHeight:60,width:l,margin:[0,10],draggableHandle:".draggableHandle",children:G==null?void 0:G.map((W,$)=>_.jsx("div",{children:_.jsxs("div",{onMouseMove:()=>{W.ranges!==T&&b(W.ranges)},onMouseLeave:()=>b([]),onClick:()=>{e(W)},className:`
8
+ `,onClick:B,children:I.jsx(xt,{})})}):I.jsx("div",{className:`
9
+ ${he.gap}
10
+ ${he.disabled}
11
+ `,children:I.jsx(xt,{})})]})]}),I.jsx("div",{ref:d,className:he.gridLayoutWrap,children:l?I.jsx(Mo,{onDragStop:N,onDragStart:E,layout:se,cols:12,rowHeight:60,width:l,margin:[0,10],draggableHandle:".draggableHandle",children:Z==null?void 0:Z.map((q,k)=>I.jsx("div",{children:I.jsxs("div",{onMouseMove:()=>{q.ranges!==w&&b(q.ranges)},onMouseLeave:()=>b([]),onClick:()=>{e(q)},className:`
12
12
  ${he.ruleItem}
13
- ${d===$?he.active:""}
14
- `,children:[_.jsx("div",{className:`
13
+ ${f===k?he.active:""}
14
+ `,children:[I.jsx("div",{className:`
15
15
  ${he.draggableHandle}
16
16
  draggableHandle
17
- `,onClick:re=>re.stopPropagation(),children:_.jsx(fr,{})}),_.jsxs("div",{className:he.ruleDescribe,children:[_.jsx("div",{className:he.ruleType,children:si(W,c)}),_.jsx("div",{className:he.ruleRange,children:W.ranges.map(re=>rn.serializeRange(re)).join(",")})]}),_.jsx("div",{className:he.preview,children:_.jsx(qe,{rule:W.rule})}),_.jsx("div",{className:`
17
+ `,onClick:ne=>ne.stopPropagation(),children:I.jsx(ir,{})}),I.jsxs("div",{className:he.ruleDescribe,children:[I.jsx("div",{className:he.ruleType,children:Qo(q,c)}),I.jsx("div",{className:he.ruleRange,children:q.ranges.map(ne=>Yt.serializeRange(ne)).join(",")})]}),I.jsx("div",{className:he.preview,children:I.jsx(qe,{rule:q.rule})}),I.jsx("div",{className:`
18
18
  ${he.deleteItem}
19
- ${d===$?he.active:""}
20
- `,onClick:re=>{re.stopPropagation(),L(W),b([])},children:_.jsx(Ot,{})})]})},`${W.cfId}`))}):null})]})},ui="univer-cf-color-picker",ci="univer-cf-color-picker-icon",di="univer-icon-dropdown",Zt={cfColorPicker:ui,cfColorPickerIcon:ci,iconDropdown:di},Ne=t=>{const{color:e,onChange:r,disable:n=!1,iconId:o="PaintBucket",className:i,isNeedDropdownIcon:c=!0}=t,y=ee.useDependency(ee.ComponentManager),p=N.useMemo(()=>new w.ColorKit(e),[e]),S=y.get(o);return S&&(n?_.jsx(S,{className:i,extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}):_.jsx(oe.DropdownLegacy,{overlay:_.jsx("div",{className:`
21
- ${Zt.cfColorPicker}
22
- `,children:_.jsx(oe.ColorPicker,{value:e,onChange:r})}),children:_.jsxs("span",{className:`
23
- ${Zt.cfColorPickerIcon}
24
- ${i}
25
- `,children:[_.jsx(S,{extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}),c&&_.jsx($t,{className:Zt.iconDropdown})]})}))},fi="univer-cf-rule-style-editor",pi="univer-cf-preview-wrap",hi="univer-text",mi="univer-position-relative",gi="univer-btn-list",vi="univer-util-item",yi="univer-icon-set",Ci="univer-render-config",Si="univer-flex",bi="univer-width45",Ri="univer-icon-wrap",Ti="univer-icon",Ii="univer-dropdown-icon",wi="univer-error-input",xi="univer-error-text",_i="univer-icon-group-list",Ei="univer-title",Oi="univer-group",Mi="univer-item-content",Fi="univer-item-wrap",Di="univer-item",Pi="univer-icon-item-list-wrap",Ni="univer-none",ji="univer-icon-item-list",Li="univer-width100",Ui="univer-stress",H={cfRuleStyleEditor:fi,cfPreviewWrap:pi,text:hi,positionRelative:mi,btnList:gi,utilItem:vi,iconSet:yi,renderConfig:Ci,flex:Si,width45:bi,iconWrap:Ri,icon:Ti,dropdownIcon:Ii,errorInput:wi,errorText:xi,iconGroupList:_i,title:Ei,group:Oi,itemContent:Mi,itemWrap:Fi,item:Di,iconItemListWrap:Pi,none:Ni,iconItemList:ji,width100:Li,stress:Ui},Pe=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),Jt=t=>{var b;const{type:e,className:r,onChange:n,id:o,value:i}=t,c=ee.useDependency(w.IUniverInstanceService),y=c.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),p=(b=c.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:b.getSheetId(),S=N.useMemo(()=>String(i).startsWith("=")?String(i):"=",[i]),v=N.useMemo(()=>[u.CFValueType.max,u.CFValueType.min,"none"].includes(e)?{disabled:!0}:[u.CFValueType.percent,u.CFValueType.percentile].includes(e)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[e]),R=N.useRef({}),[x,T]=N.useState(!1);return ee.useSidebarClick(I=>{var a;const h=(a=R.current)==null?void 0:a.handleOutClick;h&&h(I,()=>T(!1))}),e===u.CFValueType.formula?_.jsx("div",{style:{width:"100%",marginLeft:4},children:_.jsx(ft.FormulaEditor,{initValue:S,unitId:y,subUnitId:p,isFocus:x,onChange:(I="")=>{n(I||"")},onFocus:()=>T(!0),actions:R.current})}):_.jsx(oe.InputNumber,{className:r,value:Number(t.value)||0,onChange:I=>t.onChange(I||0),...v})},Vi=t=>{var L;const{interceptorManager:e}=t,r=ee.useDependency(w.LocaleService),n=((L=t.rule)==null?void 0:L.type)===u.CFRuleType.colorScale?t.rule:void 0,o=[Pe(u.CFValueType.num,r),Pe(u.CFValueType.percent,r),Pe(u.CFValueType.percentile,r),Pe(u.CFValueType.formula,r)],i=[Pe(u.CFValueType.min,r),...o],c=[Pe("none",r),...o],y=[Pe(u.CFValueType.max,r),...o],[p,S]=N.useState(()=>{var D;const E=u.CFValueType.min;return n&&((D=n.config[0])==null?void 0:D.value.type)||E}),[v,R]=N.useState(()=>{var D;const E="none";return!n||n.config.length!==3?E:((D=n.config[1])==null?void 0:D.value.type)||E}),[x,T]=N.useState(()=>{var D;const E=u.CFValueType.max;return n&&((D=n.config[n.config.length-1])==null?void 0:D.value.type)||E}),[b,I]=N.useState(()=>{if(!n)return 10;const D=n.config[0];return(D==null?void 0:D.value.value)===void 0?10:D==null?void 0:D.value.value}),[h,a]=N.useState(()=>{var k;if(!n||n.config.length!==3)return 50;const D=(k=n.config[1])==null?void 0:k.value.value;return D===void 0?50:D}),[s,d]=N.useState(()=>{var k;if(!n)return 90;const D=(k=n.config[n.config.length-1])==null?void 0:k.value.value;return D===void 0?90:D}),[C,l]=N.useState(()=>{var D;const E="#d0d9fb";return n&&((D=n.config[0])==null?void 0:D.color)||E}),[m,f]=N.useState(()=>{var D;const E="#7790f3";return!n||n.config.length!==3?E:((D=n.config[1])==null?void 0:D.color)||E}),[g,F]=N.useState(()=>{var D;const E="#2e55ef";return n&&((D=n.config[n.config.length-1])==null?void 0:D.color)||E}),j=N.useMemo(()=>E=>{const{minType:D,medianType:k,maxType:B,minValue:G,medianValue:ne,maxValue:Q,minColor:W,medianColor:$,maxColor:re}=E,ie=[];return ie.push({color:W,value:{type:D,value:G}}),k!=="none"&&ie.push({color:$,value:{type:k,value:ne}}),ie.push({color:re,value:{type:B,value:Q}}),{config:ie.map((pe,ge)=>({...pe,index:ge})),type:u.CFRuleType.colorScale}},[]);N.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return j({minType:p,medianType:v,maxType:x,minValue:b,medianValue:h,maxValue:s,minColor:C,medianColor:m,maxColor:g})}}),[j,p,v,x,b,h,s,C,m,g,e]);const U=E=>{t.onChange(j(E))};return _.jsxs("div",{children:[_.jsx("div",{className:z.title,children:r.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
26
- ${H.cfPreviewWrap}
27
- `,children:_.jsx(qe,{rule:j({minType:p,medianType:v,maxType:x,minValue:b,medianValue:h,maxValue:s,minColor:C,medianColor:m,maxColor:g})})}),_.jsx("div",{className:z.label,children:r.t("sheet.cf.valueType.min")}),_.jsxs("div",{className:`
28
- ${z.labelContainer}
29
- ${z.mTSm}
30
- `,children:[_.jsx(oe.Select,{style:{flexShrink:0},options:i,value:p,onChange:E=>{S(E);const D=u.createDefaultValueByValueType(E,10);I(D),U({minType:E,medianType:v,maxType:x,minValue:D,medianValue:h,maxValue:s,minColor:C,medianColor:m,maxColor:g})}}),_.jsx(Jt,{id:"min",className:`
19
+ ${f===k?he.active:""}
20
+ `,onClick:ne=>{ne.stopPropagation(),L(q),b([])},children:I.jsx(xt,{})})]})},`${q.cfId}`))}):null})]})},ti="univer-cf-color-picker-icon",ni="univer-icon-dropdown",Wn={cfColorPickerIcon:ti,iconDropdown:ni},Ne=t=>{const{color:e,onChange:r,disable:n=!1,iconId:o="PaintBucket",className:i,isNeedDropdownIcon:c=!0}=t,y=ee.useDependency(ee.ComponentManager),p=j.useMemo(()=>new x.ColorKit(e),[e]),S=y.get(o);return S&&(n?I.jsx(S,{className:i,extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}):I.jsx(Q.Dropdown,{overlay:I.jsx("div",{className:"univer-rounded-lg univer-p-4",children:I.jsx(Q.ColorPicker,{value:e,onChange:r})}),children:I.jsxs("span",{className:`
21
+ ${Wn.cfColorPickerIcon}
22
+ ${i}
23
+ `,children:[I.jsx(S,{extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}),c&&I.jsx(Nt,{className:Wn.iconDropdown})]})}))},ri="univer-cf-rule-style-editor",oi="univer-cf-error-text",ii="univer-cf-preview-wrap",ai="univer-text",si="univer-position-relative",li="univer-btn-list",ui="univer-util-item",ci="univer-icon-set",di="univer-render-config",fi="univer-flex",pi="univer-width45",hi="univer-icon-wrap",mi="univer-icon",gi="univer-dropdown-icon",vi="univer-error-input",yi="univer-error-text",Ci="univer-icon-group-list",bi="univer-title",Si="univer-group",Ri="univer-item-content",Ti="univer-item-wrap",wi="univer-item",xi="univer-icon-item-list-wrap",Ii="univer-none",_i="univer-icon-item-list",Ei="univer-width100",Oi="univer-stress",H={cfRuleStyleEditor:ri,cfErrorText:oi,cfPreviewWrap:ii,text:ai,positionRelative:si,btnList:li,utilItem:ui,iconSet:ci,renderConfig:di,flex:fi,width45:pi,iconWrap:hi,icon:mi,dropdownIcon:gi,errorInput:vi,errorText:yi,iconGroupList:Ci,title:bi,group:Si,itemContent:Ri,itemWrap:Ti,item:wi,iconItemListWrap:xi,none:Ii,iconItemList:_i,width100:Ei,stress:Oi},Me=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),Wt=t=>{var b;const{type:e,className:r,onChange:n,id:o,value:i}=t,c=ee.useDependency(x.IUniverInstanceService),y=c.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET).getUnitId(),p=(b=c.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:b.getSheetId(),S=j.useMemo(()=>String(i).startsWith("=")?String(i):"=",[i]),v=j.useMemo(()=>[u.CFValueType.max,u.CFValueType.min,"none"].includes(e)?{disabled:!0}:[u.CFValueType.percent,u.CFValueType.percentile].includes(e)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[e]),T=j.useRef({}),[_,w]=j.useState(!1);return ee.useSidebarClick(R=>{var a;const h=(a=T.current)==null?void 0:a.handleOutClick;h&&h(R,()=>w(!1))}),e===u.CFValueType.formula?I.jsx("div",{style:{width:"100%",marginLeft:4},children:I.jsx(dt.FormulaEditor,{initValue:S,unitId:y,subUnitId:p,isFocus:_,onChange:(R="")=>{n(R||"")},onFocus:()=>w(!0),actions:T.current})}):I.jsx(Q.InputNumber,{className:r,value:Number(t.value)||0,onChange:R=>t.onChange(R||0),...v})},Pi=t=>{var L;const{interceptorManager:e}=t,r=ee.useDependency(x.LocaleService),n=((L=t.rule)==null?void 0:L.type)===u.CFRuleType.colorScale?t.rule:void 0,o=[Me(u.CFValueType.num,r),Me(u.CFValueType.percent,r),Me(u.CFValueType.percentile,r),Me(u.CFValueType.formula,r)],i=[Me(u.CFValueType.min,r),...o],c=[Me("none",r),...o],y=[Me(u.CFValueType.max,r),...o],[p,S]=j.useState(()=>{var N;const E=u.CFValueType.min;return n&&((N=n.config[0])==null?void 0:N.value.type)||E}),[v,T]=j.useState(()=>{var N;const E="none";return!n||n.config.length!==3?E:((N=n.config[1])==null?void 0:N.value.type)||E}),[_,w]=j.useState(()=>{var N;const E=u.CFValueType.max;return n&&((N=n.config[n.config.length-1])==null?void 0:N.value.type)||E}),[b,R]=j.useState(()=>{if(!n)return 10;const N=n.config[0];return(N==null?void 0:N.value.value)===void 0?10:N==null?void 0:N.value.value}),[h,a]=j.useState(()=>{var W;if(!n||n.config.length!==3)return 50;const N=(W=n.config[1])==null?void 0:W.value.value;return N===void 0?50:N}),[s,f]=j.useState(()=>{var W;if(!n)return 90;const N=(W=n.config[n.config.length-1])==null?void 0:W.value.value;return N===void 0?90:N}),[C,l]=j.useState(()=>{var N;const E="#d0d9fb";return n&&((N=n.config[0])==null?void 0:N.color)||E}),[m,d]=j.useState(()=>{var N;const E="#7790f3";return!n||n.config.length!==3?E:((N=n.config[1])==null?void 0:N.color)||E}),[g,F]=j.useState(()=>{var N;const E="#2e55ef";return n&&((N=n.config[n.config.length-1])==null?void 0:N.color)||E}),D=j.useMemo(()=>E=>{const{minType:N,medianType:W,maxType:B,minValue:Z,medianValue:se,maxValue:re,minColor:q,medianColor:k,maxColor:ne}=E,oe=[];return oe.push({color:q,value:{type:N,value:Z}}),W!=="none"&&oe.push({color:k,value:{type:W,value:se}}),oe.push({color:ne,value:{type:B,value:re}}),{config:oe.map((pe,ge)=>({...pe,index:ge})),type:u.CFRuleType.colorScale}},[]);j.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return D({minType:p,medianType:v,maxType:_,minValue:b,medianValue:h,maxValue:s,minColor:C,medianColor:m,maxColor:g})}}),[D,p,v,_,b,h,s,C,m,g,e]);const U=E=>{t.onChange(D(E))};return I.jsxs("div",{children:[I.jsx("div",{className:z.title,children:r.t("sheet.cf.panel.styleRule")}),I.jsx("div",{className:`
24
+ ${H.cfPreviewWrap}
25
+ `,children:I.jsx(qe,{rule:D({minType:p,medianType:v,maxType:_,minValue:b,medianValue:h,maxValue:s,minColor:C,medianColor:m,maxColor:g})})}),I.jsx("div",{className:z.label,children:r.t("sheet.cf.valueType.min")}),I.jsxs("div",{className:Q.clsx(`
26
+ ${z.labelContainer}
27
+ ${z.mTSm}
28
+ `,"univer-box-border univer-h-7"),children:[I.jsx(Q.Select,{style:{flexShrink:0},options:i,value:p,onChange:E=>{S(E);const N=u.createDefaultValueByValueType(E,10);R(N),U({minType:E,medianType:v,maxType:_,minValue:N,medianValue:h,maxValue:s,minColor:C,medianColor:m,maxColor:g})}}),I.jsx(Wt,{id:"min",className:`
31
29
  ${z.mLXxs}
32
- `,value:b,type:p,onChange:E=>{I(E),U({minType:p,medianType:v,maxType:x,minValue:E,medianValue:h,maxValue:s,minColor:C,medianColor:m,maxColor:g})}}),_.jsx(Ne,{className:z.mLXxs,color:C,onChange:E=>{l(E),U({minType:p,medianType:v,maxType:x,minValue:b,medianValue:h,maxValue:s,minColor:E,medianColor:m,maxColor:g})}})]}),_.jsx("div",{className:z.label,children:r.t("sheet.cf.panel.medianValue")}),_.jsxs("div",{className:`
33
- ${z.labelContainer}
34
- ${z.mTSm}
35
- `,children:[_.jsx(oe.Select,{style:{flexShrink:0},options:c,value:v,onChange:E=>{R(E);const D=u.createDefaultValueByValueType(E,50);a(D),U({minType:p,medianType:E,maxType:x,minValue:b,medianValue:D,maxValue:s,minColor:C,medianColor:m,maxColor:g})}}),_.jsx(Jt,{id:"median",className:`
30
+ `,value:b,type:p,onChange:E=>{R(E),U({minType:p,medianType:v,maxType:_,minValue:E,medianValue:h,maxValue:s,minColor:C,medianColor:m,maxColor:g})}}),I.jsx(Ne,{className:z.mLXxs,color:C,onChange:E=>{l(E),U({minType:p,medianType:v,maxType:_,minValue:b,medianValue:h,maxValue:s,minColor:E,medianColor:m,maxColor:g})}})]}),I.jsx("div",{className:z.label,children:r.t("sheet.cf.panel.medianValue")}),I.jsxs("div",{className:Q.clsx(`
31
+ ${z.labelContainer}
32
+ ${z.mTSm}
33
+ `,"univer-box-border univer-h-7"),children:[I.jsx(Q.Select,{style:{flexShrink:0},options:c,value:v,onChange:E=>{T(E);const N=u.createDefaultValueByValueType(E,50);a(N),U({minType:p,medianType:E,maxType:_,minValue:b,medianValue:N,maxValue:s,minColor:C,medianColor:m,maxColor:g})}}),I.jsx(Wt,{id:"median",className:`
36
34
  ${z.mLXxs}
37
- `,value:h,type:v,onChange:E=>{a(E),U({minType:p,medianType:v,maxType:x,minValue:b,medianValue:E,maxValue:s,minColor:C,medianColor:m,maxColor:g})}}),v!=="none"&&_.jsx(Ne,{className:z.mLXxs,color:m,onChange:E=>{f(E),U({minType:p,medianType:v,maxType:x,minValue:b,medianValue:h,maxValue:s,minColor:C,medianColor:E,maxColor:g})}})]}),_.jsx("div",{className:z.label,children:r.t("sheet.cf.valueType.max")}),_.jsxs("div",{className:`
38
- ${z.labelContainer}
39
- ${z.mTSm}
40
- `,children:[_.jsx(oe.Select,{style:{flexShrink:0},options:y,value:x,onChange:E=>{T(E);const D=u.createDefaultValueByValueType(E,90);d(D),U({minType:p,medianType:v,maxType:E,minValue:b,medianValue:h,maxValue:D,minColor:C,medianColor:m,maxColor:g})}}),_.jsx(Jt,{id:"max",className:`
35
+ `,value:h,type:v,onChange:E=>{a(E),U({minType:p,medianType:v,maxType:_,minValue:b,medianValue:E,maxValue:s,minColor:C,medianColor:m,maxColor:g})}}),v!=="none"&&I.jsx(Ne,{className:z.mLXxs,color:m,onChange:E=>{d(E),U({minType:p,medianType:v,maxType:_,minValue:b,medianValue:h,maxValue:s,minColor:C,medianColor:E,maxColor:g})}})]}),I.jsx("div",{className:z.label,children:r.t("sheet.cf.valueType.max")}),I.jsxs("div",{className:Q.clsx(`
36
+ ${z.labelContainer}
37
+ ${z.mTSm}
38
+ `,"univer-box-border univer-h-7"),children:[I.jsx(Q.Select,{style:{flexShrink:0},options:y,value:_,onChange:E=>{w(E);const N=u.createDefaultValueByValueType(E,90);f(N),U({minType:p,medianType:v,maxType:E,minValue:b,medianValue:h,maxValue:N,minColor:C,medianColor:m,maxColor:g})}}),I.jsx(Wt,{id:"max",className:`
41
39
  ${z.mLXxs}
42
- `,value:s,type:x,onChange:E=>{d(E),U({minType:p,medianType:v,maxType:x,minValue:b,medianValue:h,maxValue:E,minColor:C,medianColor:m,maxColor:g})}}),_.jsx(Ne,{className:z.mLXxs,color:g,onChange:E=>{F(E),U({minType:p,medianType:v,maxType:x,minValue:b,medianValue:h,maxValue:s,minColor:C,medianColor:m,maxColor:E})}})]})]})},Le=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),Jn=t=>{var I;const{onChange:e,className:r,value:n,type:o,id:i,disabled:c=!1}=t,y=ee.useDependency(w.IUniverInstanceService),p=y.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),S=(I=y.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:I.getSheetId(),v=N.useRef({}),[R,x]=N.useState(!1);ee.useSidebarClick(h=>{var s;const a=(s=v.current)==null?void 0:s.handleOutClick;a&&a(h,()=>x(!1))});const T=N.useRef(n),b=N.useMemo(()=>[u.CFValueType.percentile,u.CFValueType.percent].includes(o)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[o]);if(o===u.CFValueType.formula){const h=String(T.current).startsWith("=")?String(T.current)||"":"=";return _.jsx("div",{style:{width:"100%",marginLeft:12},children:_.jsx(ft.FormulaEditor,{initValue:h,unitId:p,subUnitId:S,isFocus:R,onChange:(a="")=>{e(a||"")},onFocus:()=>x(!0),actions:v.current})})}return _.jsx(oe.InputNumber,{className:r,value:Number(n)||0,disabled:c,onChange:h=>{e(h||0)},...b})},zi=t=>{var L;const{interceptorManager:e}=t,r=ee.useDependency(w.LocaleService),n=((L=t.rule)==null?void 0:L.type)===u.CFRuleType.dataBar?t.rule:void 0,[o,i]=N.useState(()=>{var D;const E="0";return n?(D=n.config)!=null&&D.isGradient?"1":"0":E}),[c,y]=N.useState(()=>{var E;return n&&((E=n.config)==null?void 0:E.positiveColor)||u.defaultDataBarPositiveColor}),[p,S]=N.useState(()=>{var E;return n&&((E=n.config)==null?void 0:E.nativeColor)||u.defaultDataBarNativeColor}),v=[Le(u.CFValueType.num,r),Le(u.CFValueType.percent,r),Le(u.CFValueType.percentile,r),Le(u.CFValueType.formula,r)],R=[Le(u.CFValueType.min,r),...v],x=[Le(u.CFValueType.max,r),...v],[T,b]=N.useState(()=>{var D;const E=R[0].value;return n&&((D=n.config)==null?void 0:D.min.type)||E}),[I,h]=N.useState(()=>{var D;const E=x[0].value;return n&&((D=n.config)==null?void 0:D.max.type)||E}),[a,s]=N.useState(()=>{var k;if(!n)return 0;const D=((k=n.config)==null?void 0:k.min)||{};return D.type===u.CFValueType.formula?D.value||"=":D.value||0}),[d,C]=N.useState(()=>{var k;if(!n)return 100;const D=((k=n.config)==null?void 0:k.max)||{};return D.type===u.CFValueType.formula?D.value||"=":D.value===void 0?100:D.value}),[l,m]=N.useState(()=>n?n.isShowValue===void 0?!0:!!n.isShowValue:!0),f=E=>({config:{min:{type:E.minValueType,value:E.minValue},max:{type:E.maxValueType,value:E.maxValue},isGradient:E.isGradient==="1",positiveColor:E.positiveColor||u.defaultDataBarPositiveColor,nativeColor:E.nativeColor||u.defaultDataBarNativeColor},type:u.CFRuleType.dataBar,isShowValue:E.isShowValue});N.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return f({isGradient:o,minValue:a,minValueType:T,maxValue:d,maxValueType:I,positiveColor:c,nativeColor:p,isShowValue:l})}}),[o,a,T,d,I,c,p,e,l]);const g=E=>{t.onChange(f(E))},F=E=>{y(E),g({isGradient:o,minValue:a,minValueType:T,maxValue:d,maxValueType:I,positiveColor:E,nativeColor:p,isShowValue:l})},j=E=>{S(E),g({isGradient:o,minValue:a,minValueType:T,maxValue:d,maxValueType:I,positiveColor:c,nativeColor:E,isShowValue:l})},U=E=>v.map(D=>D.value).includes(E);return _.jsxs("div",{children:[_.jsx("div",{className:z.title,children:r.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
40
+ `,value:s,type:_,onChange:E=>{f(E),U({minType:p,medianType:v,maxType:_,minValue:b,medianValue:h,maxValue:E,minColor:C,medianColor:m,maxColor:g})}}),I.jsx(Ne,{className:z.mLXxs,color:g,onChange:E=>{F(E),U({minType:p,medianType:v,maxType:_,minValue:b,medianValue:h,maxValue:s,minColor:C,medianColor:m,maxColor:E})}})]})]})},Le=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),Hn=t=>{var R;const{onChange:e,className:r,value:n,type:o,id:i,disabled:c=!1}=t,y=ee.useDependency(x.IUniverInstanceService),p=y.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET).getUnitId(),S=(R=y.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:R.getSheetId(),v=j.useRef({}),[T,_]=j.useState(!1);ee.useSidebarClick(h=>{var s;const a=(s=v.current)==null?void 0:s.handleOutClick;a&&a(h,()=>_(!1))});const w=j.useRef(n),b=j.useMemo(()=>[u.CFValueType.percentile,u.CFValueType.percent].includes(o)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[o]);if(o===u.CFValueType.formula){const h=String(w.current).startsWith("=")?String(w.current)||"":"=";return I.jsx("div",{style:{width:"100%",marginLeft:12},children:I.jsx(dt.FormulaEditor,{initValue:h,unitId:p,subUnitId:S,isFocus:T,onChange:(a="")=>{e(a||"")},onFocus:()=>_(!0),actions:v.current})})}return I.jsx(Q.InputNumber,{className:r,value:Number(n)||0,disabled:c,onChange:h=>{e(h||0)},...b})},Fi=t=>{var L;const{interceptorManager:e}=t,r=ee.useDependency(x.LocaleService),n=((L=t.rule)==null?void 0:L.type)===u.CFRuleType.dataBar?t.rule:void 0,[o,i]=j.useState(()=>{var N;const E="0";return n?(N=n.config)!=null&&N.isGradient?"1":"0":E}),[c,y]=j.useState(()=>{var E;return n&&((E=n.config)==null?void 0:E.positiveColor)||u.defaultDataBarPositiveColor}),[p,S]=j.useState(()=>{var E;return n&&((E=n.config)==null?void 0:E.nativeColor)||u.defaultDataBarNativeColor}),v=[Le(u.CFValueType.num,r),Le(u.CFValueType.percent,r),Le(u.CFValueType.percentile,r),Le(u.CFValueType.formula,r)],T=[Le(u.CFValueType.min,r),...v],_=[Le(u.CFValueType.max,r),...v],[w,b]=j.useState(()=>{var N;const E=T[0].value;return n&&((N=n.config)==null?void 0:N.min.type)||E}),[R,h]=j.useState(()=>{var N;const E=_[0].value;return n&&((N=n.config)==null?void 0:N.max.type)||E}),[a,s]=j.useState(()=>{var W;if(!n)return 0;const N=((W=n.config)==null?void 0:W.min)||{};return N.type===u.CFValueType.formula?N.value||"=":N.value||0}),[f,C]=j.useState(()=>{var W;if(!n)return 100;const N=((W=n.config)==null?void 0:W.max)||{};return N.type===u.CFValueType.formula?N.value||"=":N.value===void 0?100:N.value}),[l,m]=j.useState(()=>n?n.isShowValue===void 0?!0:!!n.isShowValue:!0),d=E=>({config:{min:{type:E.minValueType,value:E.minValue},max:{type:E.maxValueType,value:E.maxValue},isGradient:E.isGradient==="1",positiveColor:E.positiveColor||u.defaultDataBarPositiveColor,nativeColor:E.nativeColor||u.defaultDataBarNativeColor},type:u.CFRuleType.dataBar,isShowValue:E.isShowValue});j.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return d({isGradient:o,minValue:a,minValueType:w,maxValue:f,maxValueType:R,positiveColor:c,nativeColor:p,isShowValue:l})}}),[o,a,w,f,R,c,p,e,l]);const g=E=>{t.onChange(d(E))},F=E=>{y(E),g({isGradient:o,minValue:a,minValueType:w,maxValue:f,maxValueType:R,positiveColor:E,nativeColor:p,isShowValue:l})},D=E=>{S(E),g({isGradient:o,minValue:a,minValueType:w,maxValue:f,maxValueType:R,positiveColor:c,nativeColor:E,isShowValue:l})},U=E=>v.map(N=>N.value).includes(E);return I.jsxs("div",{children:[I.jsx("div",{className:z.title,children:r.t("sheet.cf.panel.styleRule")}),I.jsx("div",{className:`
43
41
  ${H.cfPreviewWrap}
44
- `,children:_.jsx(qe,{rule:f({isGradient:o,minValue:a,minValueType:T,maxValue:d,maxValueType:I,positiveColor:c,nativeColor:p,isShowValue:l})})}),_.jsxs("div",{children:[_.jsx("div",{className:z.label,children:r.t("sheet.cf.panel.fillType")}),_.jsxs("div",{className:`
42
+ `,children:I.jsx(qe,{rule:d({isGradient:o,minValue:a,minValueType:w,maxValue:f,maxValueType:R,positiveColor:c,nativeColor:p,isShowValue:l})})}),I.jsxs("div",{children:[I.jsx("div",{className:z.label,children:r.t("sheet.cf.panel.fillType")}),I.jsxs("div",{className:`
45
43
  ${z.mTSm}
46
44
  ${z.mLXxs}
47
45
  ${z.labelContainer}
48
- `,children:[_.jsxs(oe.RadioGroup,{value:o,onChange:E=>{i(E),g({isGradient:E,minValue:a,minValueType:T,maxValue:d,maxValueType:I,positiveColor:c,nativeColor:p,isShowValue:l})},children:[_.jsx(oe.Radio,{value:"0",children:_.jsx("span",{className:H.text,children:r.t("sheet.cf.panel.pureColor")})}),_.jsx(oe.Radio,{value:"1",children:_.jsx("span",{className:H.text,children:r.t("sheet.cf.panel.gradient")})})]}),_.jsxs("div",{className:`
46
+ `,children:[I.jsxs(Q.RadioGroup,{value:o,onChange:E=>{i(E),g({isGradient:E,minValue:a,minValueType:w,maxValue:f,maxValueType:R,positiveColor:c,nativeColor:p,isShowValue:l})},children:[I.jsx(Q.Radio,{value:"0",children:I.jsx("span",{className:H.text,children:r.t("sheet.cf.panel.pureColor")})}),I.jsx(Q.Radio,{value:"1",children:I.jsx("span",{className:H.text,children:r.t("sheet.cf.panel.gradient")})})]}),I.jsxs("div",{className:`
49
47
  ${H.utilItem}
50
48
  ${z.mLXl}
51
- `,children:[_.jsx(oe.Checkbox,{checked:!l,onChange:E=>{m(!E),g({isGradient:E,minValue:a,minValueType:T,maxValue:d,maxValueType:I,positiveColor:c,nativeColor:p,isShowValue:!E})}}),r.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),_.jsxs("div",{children:[_.jsx("div",{className:z.label,children:r.t("sheet.cf.panel.colorSet")}),_.jsxs("div",{className:`
49
+ `,children:[I.jsx(Q.Checkbox,{checked:!l,onChange:E=>{m(!E),g({isGradient:E,minValue:a,minValueType:w,maxValue:f,maxValueType:R,positiveColor:c,nativeColor:p,isShowValue:!E})}}),r.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),I.jsxs("div",{children:[I.jsx("div",{className:z.label,children:r.t("sheet.cf.panel.colorSet")}),I.jsxs("div",{className:`
52
50
  ${z.labelContainer}
53
51
  ${z.mTSm}
54
52
  ${z.mLXxs}
55
- `,children:[_.jsxs("div",{className:`
53
+ `,children:[I.jsxs("div",{className:`
56
54
  ${z.labelContainer}
57
- `,children:[_.jsx("div",{className:`
55
+ `,children:[I.jsx("div",{className:`
58
56
  ${H.text}
59
- `,children:r.t("sheet.cf.panel.native")}),_.jsx(Ne,{color:p,onChange:j})]}),_.jsxs("div",{className:`
57
+ `,children:r.t("sheet.cf.panel.native")}),I.jsx(Ne,{color:p,onChange:D})]}),I.jsxs("div",{className:`
60
58
  ${z.labelContainer}
61
59
  ${z.mLSm}
62
- `,children:[_.jsx("div",{className:`
60
+ `,children:[I.jsx("div",{className:`
63
61
  ${H.text}
64
- `,children:r.t("sheet.cf.panel.positive")}),_.jsx(Ne,{color:c,onChange:F})]})]})]}),_.jsxs("div",{children:[_.jsx("div",{className:z.label,children:r.t("sheet.cf.valueType.min")}),_.jsxs("div",{className:`
62
+ `,children:r.t("sheet.cf.panel.positive")}),I.jsx(Ne,{color:c,onChange:F})]})]})]}),I.jsxs("div",{children:[I.jsx("div",{className:z.label,children:r.t("sheet.cf.valueType.min")}),I.jsxs("div",{className:`
65
63
  ${z.mTSm}
66
64
  ${z.labelContainer}
67
- `,children:[_.jsx(oe.Select,{style:{width:"50%",flexShrink:0},options:R,value:T,onChange:E=>{b(E);const D=u.createDefaultValueByValueType(E,10);s(D),g({isGradient:o,minValue:D,minValueType:E,maxValue:d,maxValueType:I,positiveColor:c,nativeColor:p,isShowValue:l})}}),_.jsx(Jn,{disabled:!U(T),id:"min",type:T,className:z.mLSm,value:a,onChange:E=>{s(E||0),g({isGradient:o,minValue:E||0,minValueType:T,maxValue:d,maxValueType:I,positiveColor:c,nativeColor:p,isShowValue:l})}})]}),_.jsx("div",{className:z.label,children:r.t("sheet.cf.valueType.max")}),_.jsxs("div",{className:`
65
+ `,children:[I.jsx(Q.Select,{style:{width:"50%",flexShrink:0},options:T,value:w,onChange:E=>{b(E);const N=u.createDefaultValueByValueType(E,10);s(N),g({isGradient:o,minValue:N,minValueType:E,maxValue:f,maxValueType:R,positiveColor:c,nativeColor:p,isShowValue:l})}}),I.jsx(Hn,{disabled:!U(w),id:"min",type:w,className:z.mLSm,value:a,onChange:E=>{s(E||0),g({isGradient:o,minValue:E||0,minValueType:w,maxValue:f,maxValueType:R,positiveColor:c,nativeColor:p,isShowValue:l})}})]}),I.jsx("div",{className:z.label,children:r.t("sheet.cf.valueType.max")}),I.jsxs("div",{className:`
68
66
  ${z.mTSm}
69
67
  ${z.labelContainer}
70
- `,children:[_.jsx(oe.Select,{style:{width:"50%",flexShrink:0},options:x,value:I,onChange:E=>{h(E);const D=u.createDefaultValueByValueType(E,90);C(D),g({isGradient:o,minValue:a,minValueType:T,maxValue:D,maxValueType:E,positiveColor:c,nativeColor:p,isShowValue:l})}}),_.jsx(Jn,{disabled:!U(I),id:"max",type:I,className:z.mLSm,value:d,onChange:E=>{C(E||0),g({isGradient:o,minValue:a,minValueType:T,maxValue:E||0,maxValueType:I,positiveColor:c,nativeColor:p,isShowValue:l})}})]})]})]})};function _r(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(r=_r(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Tt(){for(var t,e,r=0,n="",o=arguments.length;r<o;r++)(t=arguments[r])&&(e=_r(t))&&(n&&(n+=" "),n+=e);return n}const ki="univer-cf-style-edit",$i="univer-button-item",Ai="univer-isActive",we={cfStyleEdit:ki,buttonItem:$i,isActive:Ai},It=t=>[w.BooleanNumber.FALSE,void 0].includes(t)?w.BooleanNumber.TRUE:w.BooleanNumber.FALSE,wt=t=>t!==w.BooleanNumber.FALSE,Sn=t=>{const{style:e,onChange:r,className:n}=t,o=ee.useDependency(ee.ComponentManager),[i,c]=N.useState(()=>{if(e!=null&&e.bl)return e.bl}),[y,p]=N.useState(()=>{if(e!=null&&e.it)return e.it}),[S,v]=N.useState(()=>{if(e!=null&&e.ul)return e.ul.s}),[R,x]=N.useState(()=>{if(e!=null&&e.st)return e.st.s}),[T,b]=N.useState(()=>{var m;const l="#2f56ef";return(m=e==null?void 0:e.cl)!=null&&m.rgb?e.cl.rgb:l}),[I,h]=N.useState(()=>{var m;const l="#e8ecfc";return(m=e==null?void 0:e.bg)!=null&&m.rgb?e.bg.rgb:l}),a=o.get("BoldSingle"),s=o.get("ItalicSingle"),d=o.get("UnderlineSingle"),C=o.get("StrikethroughSingle");return N.useEffect(()=>{const l={bl:i,it:y};T!==void 0&&(l.cl={rgb:T}),I!==void 0&&(l.bg={rgb:I}),R!==void 0&&(l.st={s:R}),S!==void 0&&(l.ul={s:S}),r(u.removeUndefinedAttr(l))},[i,y,S,R,T,I]),_.jsxs("div",{className:`
71
- ${we.cfStyleEdit}
72
- ${n}
73
- `,children:[a&&_.jsx("div",{className:Tt({[we.isActive]:wt(i||w.BooleanNumber.FALSE)},we.buttonItem),onClick:()=>c(It(i)),children:_.jsx(a,{})}),s&&_.jsx("div",{className:Tt({[we.isActive]:wt(y||w.BooleanNumber.FALSE)},we.buttonItem),onClick:()=>p(It(y)),children:_.jsx(s,{})}),d&&_.jsx("div",{className:Tt({[we.isActive]:wt(S||w.BooleanNumber.FALSE)},we.buttonItem),onClick:()=>v(It(S)),children:_.jsx(d,{})}),C&&_.jsx("div",{className:Tt({[we.isActive]:wt(R||w.BooleanNumber.FALSE)},we.buttonItem),onClick:()=>x(It(R)),children:_.jsx(C,{})}),_.jsx(Ne,{color:T,onChange:b,iconId:"FontColor"}),_.jsx(Ne,{color:I,onChange:h,iconId:"PaintBucket"})]})},qi=t=>{var C;const{onChange:e,interceptorManager:r}=t,n=ee.useDependency(w.LocaleService),i=ee.useDependency(w.IUniverInstanceService).getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET),c=i.getActiveSheet(),y=((C=t.rule)==null?void 0:C.type)===u.CFRuleType.highlightCell?t.rule:void 0,p=N.useRef(null),[S,v]=N.useState(!1),R=N.useRef({}),[x,T]=N.useState({}),[b,I]=N.useState(()=>(y==null?void 0:y.subType)===u.CFSubRuleType.formula?y.value:"="),[h,a]=N.useState(void 0),s=l=>({style:l.style,value:b,type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.formula});N.useEffect(()=>r.intercept(r.getInterceptPoints().submit,{handler(){return s({style:x})}}),[x,b,r]),N.useEffect(()=>r.intercept(r.getInterceptPoints().beforeSubmit,{handler:(m,f,g)=>h||b.length===1||!b.startsWith("=")?(a(n.t("sheet.cf.errorMessage.formulaError")),!1):g(m)}),[h,b]);const d=l=>{e(s(l))};return ee.useSidebarClick(l=>{var f;const m=(f=R.current)==null?void 0:f.handleOutClick;m&&m(l,()=>v(!1))}),_.jsxs("div",{ref:p,children:[_.jsx("div",{className:`
68
+ `,children:[I.jsx(Q.Select,{style:{width:"50%",flexShrink:0},options:_,value:R,onChange:E=>{h(E);const N=u.createDefaultValueByValueType(E,90);C(N),g({isGradient:o,minValue:a,minValueType:w,maxValue:N,maxValueType:E,positiveColor:c,nativeColor:p,isShowValue:l})}}),I.jsx(Hn,{disabled:!U(R),id:"max",type:R,className:z.mLSm,value:f,onChange:E=>{C(E||0),g({isGradient:o,minValue:a,minValueType:w,maxValue:E||0,maxValueType:R,positiveColor:c,nativeColor:p,isShowValue:l})}})]})]})]})},Di="univer-cf-style-edit",Mi="univer-button-item",Ni="univer-isActive",xe={cfStyleEdit:Di,buttonItem:Mi,isActive:Ni},bt=t=>[x.BooleanNumber.FALSE,void 0].includes(t)?x.BooleanNumber.TRUE:x.BooleanNumber.FALSE,St=t=>t!==x.BooleanNumber.FALSE,fn=t=>{const{style:e,onChange:r,className:n}=t,o=ee.useDependency(ee.ComponentManager),[i,c]=j.useState(()=>{if(e!=null&&e.bl)return e.bl}),[y,p]=j.useState(()=>{if(e!=null&&e.it)return e.it}),[S,v]=j.useState(()=>{if(e!=null&&e.ul)return e.ul.s}),[T,_]=j.useState(()=>{if(e!=null&&e.st)return e.st.s}),[w,b]=j.useState(()=>{var m;const l="#2f56ef";return(m=e==null?void 0:e.cl)!=null&&m.rgb?e.cl.rgb:l}),[R,h]=j.useState(()=>{var m;const l="#e8ecfc";return(m=e==null?void 0:e.bg)!=null&&m.rgb?e.bg.rgb:l}),a=o.get("BoldSingle"),s=o.get("ItalicSingle"),f=o.get("UnderlineSingle"),C=o.get("StrikethroughSingle");return j.useEffect(()=>{const l={bl:i,it:y};w!==void 0&&(l.cl={rgb:w}),R!==void 0&&(l.bg={rgb:R}),T!==void 0&&(l.st={s:T}),S!==void 0&&(l.ul={s:S}),r(u.removeUndefinedAttr(l))},[i,y,S,T,w,R]),I.jsxs("div",{className:Q.clsx(xe.cfStyleEdit,n),children:[a&&I.jsx("div",{className:Q.clsx({[xe.isActive]:St(i||x.BooleanNumber.FALSE)},xe.buttonItem),onClick:()=>c(bt(i)),children:I.jsx(a,{})}),s&&I.jsx("div",{className:Q.clsx({[xe.isActive]:St(y||x.BooleanNumber.FALSE)},xe.buttonItem),onClick:()=>p(bt(y)),children:I.jsx(s,{})}),f&&I.jsx("div",{className:Q.clsx({[xe.isActive]:St(S||x.BooleanNumber.FALSE)},xe.buttonItem),onClick:()=>v(bt(S)),children:I.jsx(f,{})}),C&&I.jsx("div",{className:Q.clsx({[xe.isActive]:St(T||x.BooleanNumber.FALSE)},xe.buttonItem),onClick:()=>_(bt(T)),children:I.jsx(C,{})}),I.jsx(Ne,{color:w,onChange:b,iconId:"FontColor"}),I.jsx(Ne,{color:R,onChange:h,iconId:"PaintBucket"})]})},ji=t=>{var C;const{onChange:e,interceptorManager:r}=t,n=ee.useDependency(x.LocaleService),i=ee.useDependency(x.IUniverInstanceService).getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET),c=i.getActiveSheet(),y=((C=t.rule)==null?void 0:C.type)===u.CFRuleType.highlightCell?t.rule:void 0,p=j.useRef(null),[S,v]=j.useState(!1),T=j.useRef({}),[_,w]=j.useState({}),[b,R]=j.useState(()=>(y==null?void 0:y.subType)===u.CFSubRuleType.formula?y.value:"="),[h,a]=j.useState(void 0),s=l=>({style:l.style,value:b,type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.formula});j.useEffect(()=>r.intercept(r.getInterceptPoints().submit,{handler(){return s({style:_})}}),[_,b,r]),j.useEffect(()=>r.intercept(r.getInterceptPoints().beforeSubmit,{handler:(m,d,g)=>h||b.length===1||!b.startsWith("=")?(a(n.t("sheet.cf.errorMessage.formulaError")),!1):g(m)}),[h,b]);const f=l=>{e(s(l))};return ee.useSidebarClick(l=>{var d;const m=(d=T.current)==null?void 0:d.handleOutClick;m&&m(l,()=>v(!1))}),I.jsxs("div",{ref:p,children:[I.jsx("div",{className:`
74
69
  ${z.title}
75
70
  ${z.mTBase}
76
- `,children:n.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
71
+ `,children:n.t("sheet.cf.panel.styleRule")}),I.jsx("div",{className:`
77
72
  ${z.mTSm}
78
- `,children:_.jsx(ft.FormulaEditor,{onChange:l=>{I(l),d({style:x})},onVerify:(l,m)=>{!l||m.length===1?a(n.t("sheet.cf.errorMessage.formulaError")):a(void 0)},errorText:h,onFocus:()=>{v(!0)},actions:R.current,isFocus:S,initValue:b,unitId:i.getUnitId(),subUnitId:c==null?void 0:c.getSheetId()})}),_.jsx("div",{className:`
73
+ `,children:I.jsx(dt.FormulaEditor,{onChange:l=>{R(l),f({style:_})},onVerify:(l,m)=>{!l||m.length===1?a(n.t("sheet.cf.errorMessage.formulaError")):a(void 0)},errorText:h,onFocus:()=>{v(!0)},actions:T.current,isFocus:S,initValue:b,unitId:i.getUnitId(),subUnitId:c==null?void 0:c.getSheetId()})}),I.jsx("div",{className:`
79
74
  ${H.cfPreviewWrap}
80
- `,children:_.jsx(qe,{rule:s({style:x})})}),_.jsx(Sn,{style:y==null?void 0:y.style,className:`
75
+ `,children:I.jsx(qe,{rule:s({style:_})})}),I.jsx(fn,{style:y==null?void 0:y.style,className:`
81
76
  ${z.mTSm}
82
- `,onChange:l=>{T(l),d({style:l})}})]})},xt=t=>_.jsxs("div",{style:{position:"relative"},children:[_.jsx("div",{style:{position:"absolute",zIndex:999,bottom:"-13px",fontSize:"10px",color:"red"},children:t.errorText}),t.children]}),ue=(t,e)=>({label:e.t(`sheet.cf.operator.${t}`),value:t}),Wi=t=>{const{type:e,operator:r,onChange:n,value:o,interceptorManager:i}=t,c=ee.useDependency(w.LocaleService),[y,p]=N.useState(()=>typeof o=="number"?o:0),[S,v]=N.useState(""),[R,x]=N.useState(()=>typeof o=="string"?o:""),[T,b]=N.useState(""),[I,h]=N.useState(()=>Array.isArray(o)?o[0]===void 0?0:o[0]:0),[a,s]=N.useState(""),[d,C]=N.useState(()=>Array.isArray(o)?o[1]===void 0?100:o[1]:100),[l,m]=N.useState("");switch(N.useEffect(()=>{switch(e){case u.CFSubRuleType.text:{[u.CFTextOperator.beginsWith,u.CFTextOperator.endsWith,u.CFTextOperator.containsText,u.CFTextOperator.notContainsText,u.CFTextOperator.equal,u.CFTextOperator.notEqual].includes(r)&&n(R);break}case u.CFSubRuleType.number:{[u.CFNumberOperator.equal,u.CFNumberOperator.notEqual,u.CFNumberOperator.greaterThan,u.CFNumberOperator.greaterThanOrEqual,u.CFNumberOperator.lessThan,u.CFNumberOperator.lessThanOrEqual].includes(r)&&n(y),[u.CFNumberOperator.between,u.CFNumberOperator.notBetween].includes(r)&&n([I,d]);break}}},[e]),N.useEffect(()=>{const f=i.intercept(i.getInterceptPoints().beforeSubmit,{handler:(g,F,j)=>{switch(e){case u.CFSubRuleType.text:if([u.CFTextOperator.beginsWith,u.CFTextOperator.containsText,u.CFTextOperator.endsWith,u.CFTextOperator.notEqual,u.CFTextOperator.notContainsText,u.CFTextOperator.equal].includes(r))return R?j(g):(b(c.t("sheet.cf.errorMessage.notBlank")),!1)}return j(g)}});return()=>{f()}},[e,y,R,r]),e){case u.CFSubRuleType.text:{if([u.CFTextOperator.beginsWith,u.CFTextOperator.endsWith,u.CFTextOperator.containsText,u.CFTextOperator.notContainsText,u.CFTextOperator.equal,u.CFTextOperator.notEqual].includes(r)){const f=g=>{x(g),n(g)};return _.jsx("div",{className:`
77
+ `,onChange:l=>{w(l),f({style:l})}})]})},Rt=t=>I.jsxs("div",{style:{position:"relative"},children:[I.jsx("div",{style:{position:"absolute",zIndex:999,bottom:"-13px",fontSize:"10px",color:"red"},children:t.errorText}),t.children]}),ue=(t,e)=>({label:e.t(`sheet.cf.operator.${t}`),value:t}),Li=t=>{const{type:e,operator:r,onChange:n,value:o,interceptorManager:i}=t,c=ee.useDependency(x.LocaleService),[y,p]=j.useState(()=>typeof o=="number"?o:0),[S,v]=j.useState(""),[T,_]=j.useState(()=>typeof o=="string"?o:""),[w,b]=j.useState(""),[R,h]=j.useState(()=>Array.isArray(o)?o[0]===void 0?0:o[0]:0),[a,s]=j.useState(""),[f,C]=j.useState(()=>Array.isArray(o)?o[1]===void 0?100:o[1]:100),[l,m]=j.useState("");switch(j.useEffect(()=>{switch(e){case u.CFSubRuleType.text:{[u.CFTextOperator.beginsWith,u.CFTextOperator.endsWith,u.CFTextOperator.containsText,u.CFTextOperator.notContainsText,u.CFTextOperator.equal,u.CFTextOperator.notEqual].includes(r)&&n(T);break}case u.CFSubRuleType.number:{[u.CFNumberOperator.equal,u.CFNumberOperator.notEqual,u.CFNumberOperator.greaterThan,u.CFNumberOperator.greaterThanOrEqual,u.CFNumberOperator.lessThan,u.CFNumberOperator.lessThanOrEqual].includes(r)&&n(y),[u.CFNumberOperator.between,u.CFNumberOperator.notBetween].includes(r)&&n([R,f]);break}}},[e]),j.useEffect(()=>{const d=i.intercept(i.getInterceptPoints().beforeSubmit,{handler:(g,F,D)=>{switch(e){case u.CFSubRuleType.text:if([u.CFTextOperator.beginsWith,u.CFTextOperator.containsText,u.CFTextOperator.endsWith,u.CFTextOperator.notEqual,u.CFTextOperator.notContainsText,u.CFTextOperator.equal].includes(r))return T?D(g):(b(c.t("sheet.cf.errorMessage.notBlank")),!1)}return D(g)}});return()=>{d()}},[e,y,T,r]),e){case u.CFSubRuleType.text:{if([u.CFTextOperator.beginsWith,u.CFTextOperator.endsWith,u.CFTextOperator.containsText,u.CFTextOperator.notContainsText,u.CFTextOperator.equal,u.CFTextOperator.notEqual].includes(r)){const d=g=>{_(g),n(g)};return I.jsx("div",{className:`
83
78
  ${z.mTSm}
84
- `,children:_.jsx(xt,{errorText:T,children:_.jsx(oe.Input,{className:H.width100,value:R,onChange:g=>{b(""),f(g)}})})})}break}case u.CFSubRuleType.number:{if([u.CFNumberOperator.equal,u.CFNumberOperator.notEqual,u.CFNumberOperator.greaterThan,u.CFNumberOperator.greaterThanOrEqual,u.CFNumberOperator.lessThan,u.CFNumberOperator.lessThanOrEqual].includes(r)){const f=g=>{p(g||0),n(g||0),v("")};return _.jsx("div",{className:`
79
+ `,children:I.jsx(Rt,{errorText:w,children:I.jsx(Q.Input,{className:H.width100,value:T,onChange:g=>{b(""),d(g)}})})})}break}case u.CFSubRuleType.number:{if([u.CFNumberOperator.equal,u.CFNumberOperator.notEqual,u.CFNumberOperator.greaterThan,u.CFNumberOperator.greaterThanOrEqual,u.CFNumberOperator.lessThan,u.CFNumberOperator.lessThanOrEqual].includes(r)){const d=g=>{p(g||0),n(g||0),v("")};return I.jsx("div",{className:`
85
80
  ${z.mTSm}
86
- `,children:_.jsx(xt,{errorText:S,children:_.jsx(oe.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:H.width100,value:y,onChange:f})})})}if([u.CFNumberOperator.between,u.CFNumberOperator.notBetween].includes(r)){const f=F=>{h(F||0),n([F||0,d]),s("")},g=F=>{C(F||0),n([I,F||0]),m("")};return _.jsxs("div",{className:`
81
+ `,children:I.jsx(Rt,{errorText:S,children:I.jsx(Q.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:H.width100,value:y,onChange:d})})})}if([u.CFNumberOperator.between,u.CFNumberOperator.notBetween].includes(r)){const d=F=>{h(F||0),n([F||0,f]),s("")},g=F=>{C(F||0),n([R,F||0]),m("")};return I.jsxs("div",{className:`
87
82
  ${z.mTSm}
88
83
  ${z.labelContainer}
89
- `,children:[_.jsx(xt,{errorText:a,children:_.jsx(oe.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:I,onChange:f})}),_.jsx(xt,{errorText:l,children:_.jsx(oe.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`
84
+ `,children:[I.jsx(Rt,{errorText:a,children:I.jsx(Q.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:R,onChange:d})}),I.jsx(Rt,{errorText:l,children:I.jsx(Q.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`
90
85
  ${z.mLSm}
91
- `,value:d,onChange:g})})]})}}}return null},Qn=(t,e)=>{switch(t){case u.CFSubRuleType.text:return[ue(u.CFTextOperator.containsText,e),ue(u.CFTextOperator.notContainsText,e),ue(u.CFTextOperator.beginsWith,e),ue(u.CFTextOperator.endsWith,e),ue(u.CFTextOperator.equal,e),ue(u.CFTextOperator.notEqual,e),ue(u.CFTextOperator.containsBlanks,e),ue(u.CFTextOperator.notContainsBlanks,e),ue(u.CFTextOperator.containsErrors,e),ue(u.CFTextOperator.notContainsErrors,e)];case u.CFSubRuleType.number:return[ue(u.CFNumberOperator.between,e),ue(u.CFNumberOperator.notBetween,e),ue(u.CFNumberOperator.equal,e),ue(u.CFNumberOperator.notEqual,e),ue(u.CFNumberOperator.greaterThan,e),ue(u.CFNumberOperator.greaterThanOrEqual,e),ue(u.CFNumberOperator.lessThan,e),ue(u.CFNumberOperator.lessThanOrEqual,e)];case u.CFSubRuleType.timePeriod:return[ue(u.CFTimePeriodOperator.yesterday,e),ue(u.CFTimePeriodOperator.today,e),ue(u.CFTimePeriodOperator.tomorrow,e),ue(u.CFTimePeriodOperator.last7Days,e),ue(u.CFTimePeriodOperator.lastWeek,e),ue(u.CFTimePeriodOperator.thisWeek,e),ue(u.CFTimePeriodOperator.nextWeek,e),ue(u.CFTimePeriodOperator.lastMonth,e),ue(u.CFTimePeriodOperator.thisMonth,e),ue(u.CFTimePeriodOperator.nextMonth,e)]}},er=t=>{var C;const{interceptorManager:e,onChange:r}=t,n=ee.useDependency(w.LocaleService),o=((C=t.rule)==null?void 0:C.type)===u.CFRuleType.highlightCell?t.rule:void 0,[i,c]=N.useState(()=>{const l=u.CFSubRuleType.text;return o&&o.subType||l}),y=[{value:u.CFSubRuleType.text,label:n.t("sheet.cf.subRuleType.text")},{value:u.CFSubRuleType.number,label:n.t("sheet.cf.subRuleType.number")},{value:u.CFSubRuleType.timePeriod,label:n.t("sheet.cf.subRuleType.timePeriod")},{value:u.CFSubRuleType.duplicateValues,label:n.t("sheet.cf.subRuleType.duplicateValues")},{value:u.CFSubRuleType.uniqueValues,label:n.t("sheet.cf.subRuleType.uniqueValues")}],p=N.useMemo(()=>Qn(i,n),[i]),[S,v]=N.useState(()=>{const l=p?p[0].value:void 0;return o&&o.operator||l}),[R,x]=N.useState(()=>{var f;const l="";return o?(f=o.value)!=null?f:u.createDefaultValue(o.subType,o.operator):l}),[T,b]=N.useState({}),I=N.useMemo(()=>l=>{var m,f,g,F,j,U,L,E,D,k,B,G,ne,Q,W;switch(l.subType||i){case u.CFSubRuleType.text:{if([u.CFTextOperator.beginsWith,u.CFTextOperator.endsWith,u.CFTextOperator.containsText,u.CFTextOperator.notContainsText,u.CFTextOperator.equal,u.CFTextOperator.notEqual].includes(S))return{type:u.CFRuleType.highlightCell,subType:(m=l.subType)!=null?m:i,operator:(f=l.operator)!=null?f:S,style:(g=l.style)!=null?g:T,value:(F=l.value)!=null?F:R};break}case u.CFSubRuleType.number:{if([u.CFNumberOperator.equal,u.CFNumberOperator.notEqual,u.CFNumberOperator.greaterThan,u.CFNumberOperator.greaterThanOrEqual,u.CFNumberOperator.lessThan,u.CFNumberOperator.lessThanOrEqual].includes(S))return{type:u.CFRuleType.highlightCell,subType:(j=l.subType)!=null?j:i,operator:(U=l.operator)!=null?U:S,style:(L=l.style)!=null?L:T,value:(E=l.value)!=null?E:R};if([u.CFNumberOperator.between,u.CFNumberOperator.notBetween].includes(S))return{type:u.CFRuleType.highlightCell,subType:(D=l.subType)!=null?D:i,operator:(k=l.operator)!=null?k:S,style:(B=l.style)!=null?B:T,value:(G=l.value)!=null?G:R};break}}return{type:u.CFRuleType.highlightCell,subType:(ne=l.subType)!=null?ne:i,operator:(Q=l.operator)!=null?Q:S,style:(W=l.style)!=null?W:T}},[i,S,R,T]);N.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return I({})}}),[I,e]),N.useEffect(()=>{y.some(l=>l.value===i)||c(y[0].value)},[y]);const h=l=>{const m=l,f=Qn(m,n),g=f&&f[0].value;c(m),v(g),g&&x(u.createDefaultValue(m,g)),r(I({subType:m,operator:g}))},a=l=>{const m=l;v(m),r(I({operator:m}))},s=l=>{x(l),r(I({value:l}))},d=N.useMemo(()=>`${i}_${S}_${Math.random()}`,[i,S]);return _.jsxs("div",{children:[_.jsx("div",{className:`
86
+ `,value:f,onChange:g})})]})}}}return null},Bn=(t,e)=>{switch(t){case u.CFSubRuleType.text:return[ue(u.CFTextOperator.containsText,e),ue(u.CFTextOperator.notContainsText,e),ue(u.CFTextOperator.beginsWith,e),ue(u.CFTextOperator.endsWith,e),ue(u.CFTextOperator.equal,e),ue(u.CFTextOperator.notEqual,e),ue(u.CFTextOperator.containsBlanks,e),ue(u.CFTextOperator.notContainsBlanks,e),ue(u.CFTextOperator.containsErrors,e),ue(u.CFTextOperator.notContainsErrors,e)];case u.CFSubRuleType.number:return[ue(u.CFNumberOperator.between,e),ue(u.CFNumberOperator.notBetween,e),ue(u.CFNumberOperator.equal,e),ue(u.CFNumberOperator.notEqual,e),ue(u.CFNumberOperator.greaterThan,e),ue(u.CFNumberOperator.greaterThanOrEqual,e),ue(u.CFNumberOperator.lessThan,e),ue(u.CFNumberOperator.lessThanOrEqual,e)];case u.CFSubRuleType.timePeriod:return[ue(u.CFTimePeriodOperator.yesterday,e),ue(u.CFTimePeriodOperator.today,e),ue(u.CFTimePeriodOperator.tomorrow,e),ue(u.CFTimePeriodOperator.last7Days,e),ue(u.CFTimePeriodOperator.lastWeek,e),ue(u.CFTimePeriodOperator.thisWeek,e),ue(u.CFTimePeriodOperator.nextWeek,e),ue(u.CFTimePeriodOperator.lastMonth,e),ue(u.CFTimePeriodOperator.thisMonth,e),ue(u.CFTimePeriodOperator.nextMonth,e)]}},Gn=t=>{var C;const{interceptorManager:e,onChange:r}=t,n=ee.useDependency(x.LocaleService),o=((C=t.rule)==null?void 0:C.type)===u.CFRuleType.highlightCell?t.rule:void 0,[i,c]=j.useState(()=>{const l=u.CFSubRuleType.text;return o&&o.subType||l}),y=[{value:u.CFSubRuleType.text,label:n.t("sheet.cf.subRuleType.text")},{value:u.CFSubRuleType.number,label:n.t("sheet.cf.subRuleType.number")},{value:u.CFSubRuleType.timePeriod,label:n.t("sheet.cf.subRuleType.timePeriod")},{value:u.CFSubRuleType.duplicateValues,label:n.t("sheet.cf.subRuleType.duplicateValues")},{value:u.CFSubRuleType.uniqueValues,label:n.t("sheet.cf.subRuleType.uniqueValues")}],p=j.useMemo(()=>Bn(i,n),[i]),[S,v]=j.useState(()=>{const l=p?p[0].value:void 0;return o&&o.operator||l}),[T,_]=j.useState(()=>{var d;const l="";return o?(d=o.value)!=null?d:u.createDefaultValue(o.subType,o.operator):l}),[w,b]=j.useState({}),R=j.useMemo(()=>l=>{var m,d,g,F,D,U,L,E,N,W,B,Z,se,re,q;switch(l.subType||i){case u.CFSubRuleType.text:{if([u.CFTextOperator.beginsWith,u.CFTextOperator.endsWith,u.CFTextOperator.containsText,u.CFTextOperator.notContainsText,u.CFTextOperator.equal,u.CFTextOperator.notEqual].includes(S))return{type:u.CFRuleType.highlightCell,subType:(m=l.subType)!=null?m:i,operator:(d=l.operator)!=null?d:S,style:(g=l.style)!=null?g:w,value:(F=l.value)!=null?F:T};break}case u.CFSubRuleType.number:{if([u.CFNumberOperator.equal,u.CFNumberOperator.notEqual,u.CFNumberOperator.greaterThan,u.CFNumberOperator.greaterThanOrEqual,u.CFNumberOperator.lessThan,u.CFNumberOperator.lessThanOrEqual].includes(S))return{type:u.CFRuleType.highlightCell,subType:(D=l.subType)!=null?D:i,operator:(U=l.operator)!=null?U:S,style:(L=l.style)!=null?L:w,value:(E=l.value)!=null?E:T};if([u.CFNumberOperator.between,u.CFNumberOperator.notBetween].includes(S))return{type:u.CFRuleType.highlightCell,subType:(N=l.subType)!=null?N:i,operator:(W=l.operator)!=null?W:S,style:(B=l.style)!=null?B:w,value:(Z=l.value)!=null?Z:T};break}}return{type:u.CFRuleType.highlightCell,subType:(se=l.subType)!=null?se:i,operator:(re=l.operator)!=null?re:S,style:(q=l.style)!=null?q:w}},[i,S,T,w]);j.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return R({})}}),[R,e]),j.useEffect(()=>{y.some(l=>l.value===i)||c(y[0].value)},[y]);const h=l=>{const m=l,d=Bn(m,n),g=d&&d[0].value;c(m),v(g),g&&_(u.createDefaultValue(m,g)),r(R({subType:m,operator:g}))},a=l=>{const m=l;v(m),r(R({operator:m}))},s=l=>{_(l),r(R({value:l}))},f=j.useMemo(()=>`${i}_${S}_${Math.random()}`,[i,S]);return I.jsxs("div",{children:[I.jsx("div",{className:`
92
87
  ${z.title}
93
88
  ${z.mTBase}
94
- `,children:n.t("sheet.cf.panel.styleRule")}),_.jsx(oe.Select,{className:`
89
+ `,children:n.t("sheet.cf.panel.styleRule")}),I.jsx(Q.Select,{className:`
95
90
  ${z.mTSm}
96
91
  ${H.width100}
97
- `,onChange:h,value:i,options:y}),(p==null?void 0:p.length)&&_.jsx(oe.Select,{className:`
92
+ `,onChange:h,value:i,options:y}),(p==null?void 0:p.length)&&I.jsx(Q.Select,{className:`
98
93
  ${z.mTSm}
99
94
  ${H.width100}
100
- `,onChange:a,value:S||"",options:p}),_.jsx(Wi,{value:R,interceptorManager:e,type:i,operator:S,rule:o,onChange:s},d),_.jsx("div",{className:`
95
+ `,onChange:a,value:S||"",options:p}),I.jsx(Li,{value:T,interceptorManager:e,type:i,operator:S,rule:o,onChange:s},f),I.jsx("div",{className:`
101
96
  ${H.cfPreviewWrap}
102
- `,children:_.jsx(qe,{rule:I({})})}),_.jsx(Sn,{style:o==null?void 0:o.style,className:`
97
+ `,children:I.jsx(qe,{rule:R({})})}),I.jsx(fn,{style:o==null?void 0:o.style,className:`
103
98
  ${z.mLXxs}
104
- `,onChange:l=>{b(l),r(I({style:l}))}})]})},Er=(t,e)=>(u.iconMap[t]||[])[Number(e)]||"",Hi=t=>{var p;const e=ee.useDependency(w.IUniverInstanceService),r=e.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),n=(p=e.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:p.getSheetId(),o=N.useMemo(()=>t.error?H.errorInput:"",[t.error]),i=N.useRef({}),[c,y]=N.useState(!1);return ee.useSidebarClick(S=>{var R;const v=(R=i.current)==null?void 0:R.handleOutClick;v&&v(S,()=>y(!1))}),_.jsx("div",{className:H.positionRelative,children:t.type!==u.CFValueType.formula?_.jsxs(_.Fragment,{children:[_.jsx(oe.InputNumber,{className:o,value:Number(t.value)||0,onChange:S=>t.onChange(S!=null?S:0)}),t.error&&_.jsx("div",{className:H.errorText,children:t.error})]}):_.jsx("div",{style:{width:"100%"},children:_.jsx(ft.FormulaEditor,{initValue:String(t.value),unitId:r,subUnitId:n,isFocus:c,onChange:(S="")=>{const v=S||"";t.onChange(v)},onFocus:()=>y(!0),actions:i.current})})})},tr=(t,e,r)=>({operator:u.CFNumberOperator.greaterThan,value:{type:u.CFValueType.num,value:(r.length-1-e)*10},iconType:t,iconId:String(e)}),Bi=N.forwardRef((t,e)=>{const r=ee.useDependency(w.LocaleService),n=o=>{t.onClick(o)};return _.jsx("div",{ref:e,className:H.iconGroupList,children:u.iconGroup.map((o,i)=>_.jsxs("div",{className:H.group,children:[_.jsx("div",{className:H.title,children:r.t(o.title)}),_.jsx("div",{className:H.itemContent,children:o.group.map(c=>_.jsx("div",{className:H.itemWrap,onClick:()=>{n(c.name)},children:_.jsx("div",{className:H.item,children:c.list.map((y,p)=>_.jsx("img",{className:H.icon,src:y},p))})},c.name))})]},i))})}),Gi=t=>{const e=N.useMemo(()=>{const n=[];for(const o in u.iconMap){const i=u.iconMap[o],c=o;i.forEach((y,p)=>{n.push({iconType:c,base64:y,iconId:String(p)})})}return n},[]),r=n=>{t.onClick(n.iconType,n.iconId)};return _.jsxs("div",{className:H.iconItemListWrap,children:[_.jsxs("div",{className:H.none,onClick:()=>r({iconType:u.EMPTY_ICON_TYPE,iconId:""}),children:[_.jsx(mt,{className:H.icon}),_.jsx("span",{children:"无单元格图标"})]}),_.jsx("div",{className:H.iconItemList,children:e.map(n=>_.jsx("div",{className:H.item,children:_.jsx("img",{onClick:()=>r(n),className:`
99
+ `,onChange:l=>{b(l),r(R({style:l}))}})]})},br=(t,e)=>(u.iconMap[t]||[])[Number(e)]||"",Ui=t=>{var p;const e=ee.useDependency(x.IUniverInstanceService),r=e.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET).getUnitId(),n=(p=e.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:p.getSheetId(),o=j.useMemo(()=>t.error?H.errorInput:"",[t.error]),i=j.useRef({}),[c,y]=j.useState(!1);return ee.useSidebarClick(S=>{var T;const v=(T=i.current)==null?void 0:T.handleOutClick;v&&v(S,()=>y(!1))}),I.jsx("div",{className:H.positionRelative,children:t.type!==u.CFValueType.formula?I.jsxs(I.Fragment,{children:[I.jsx(Q.InputNumber,{className:o,value:Number(t.value)||0,onChange:S=>t.onChange(S!=null?S:0)}),t.error&&I.jsx("div",{className:H.errorText,children:t.error})]}):I.jsx("div",{style:{width:"100%"},children:I.jsx(dt.FormulaEditor,{initValue:String(t.value),unitId:r,subUnitId:n,isFocus:c,onChange:(S="")=>{const v=S||"";t.onChange(v)},onFocus:()=>y(!0),actions:i.current})})})},Xn=(t,e,r)=>({operator:u.CFNumberOperator.greaterThan,value:{type:u.CFValueType.num,value:(r.length-1-e)*10},iconType:t,iconId:String(e)}),Vi=j.forwardRef((t,e)=>{const r=ee.useDependency(x.LocaleService),n=o=>{t.onClick(o)};return I.jsx("div",{ref:e,className:H.iconGroupList,children:u.iconGroup.map((o,i)=>I.jsxs("div",{className:H.group,children:[I.jsx("div",{className:H.title,children:r.t(o.title)}),I.jsx("div",{className:H.itemContent,children:o.group.map(c=>I.jsx("div",{className:H.itemWrap,onClick:()=>{n(c.name)},children:I.jsx("div",{className:H.item,children:c.list.map((y,p)=>I.jsx("img",{className:H.icon,src:y},p))})},c.name))})]},i))})}),zi=t=>{const e=j.useMemo(()=>{const n=[];for(const o in u.iconMap){const i=u.iconMap[o],c=o;i.forEach((y,p)=>{n.push({iconType:c,base64:y,iconId:String(p)})})}return n},[]),r=n=>{t.onClick(n.iconType,n.iconId)};return I.jsxs("div",{className:H.iconItemListWrap,children:[I.jsxs("div",{className:H.none,onClick:()=>r({iconType:u.EMPTY_ICON_TYPE,iconId:""}),children:[I.jsx(ft,{className:H.icon}),I.jsx("span",{children:"无单元格图标"})]}),I.jsx("div",{className:H.iconItemList,children:e.map(n=>I.jsx("div",{className:H.item,children:I.jsx("img",{onClick:()=>r(n),className:`
105
100
  ${H.icon}
106
- `,src:n.base64})},`${n.iconType}_${n.iconId}`))})]})},Xi=t=>{const{onChange:e,configList:r,errorMap:n={}}=t,o=ee.useDependency(w.LocaleService),i=[{label:o.t(`sheet.cf.symbol.${u.CFNumberOperator.greaterThan}`),value:u.CFNumberOperator.greaterThan},{label:o.t(`sheet.cf.symbol.${u.CFNumberOperator.greaterThanOrEqual}`),value:u.CFNumberOperator.greaterThanOrEqual}],c=[{label:o.t(`sheet.cf.valueType.${u.CFValueType.num}`),value:u.CFValueType.num},{label:o.t(`sheet.cf.valueType.${u.CFValueType.percent}`),value:u.CFValueType.percent},{label:o.t(`sheet.cf.valueType.${u.CFValueType.percentile}`),value:u.CFValueType.percentile},{label:o.t(`sheet.cf.valueType.${u.CFValueType.formula}`),value:u.CFValueType.formula}],y=(R,x)=>{e([String(x),"value","value"],R)},p=(R,x)=>{e([String(x),"operator"],R);const T=u.createDefaultValue(u.CFSubRuleType.number,R);y(T,x)},S=(R,x)=>{e([String(x),"value","type"],R);const T=r[x],b=u.createDefaultValue(u.CFSubRuleType.number,T.operator);y(b,x)};return N.useMemo(()=>r.map((R,x)=>{const T=n[x],b=Er(R.iconType,R.iconId),I=x===r.length-1,h=x===0,a=r[x-1],s=(a==null?void 0:a.value.type)===u.CFValueType.formula?o.t("sheet.cf.valueType.formula"):a==null?void 0:a.value.value,d=(C,l)=>{const m={...R,iconId:l,iconType:C};e([String(x)],m)};return _.jsxs("div",{className:`
107
- ${x?z.mTXl:z.mTSm}
108
- `,children:[_.jsxs("div",{className:`
101
+ `,src:n.base64})},`${n.iconType}_${n.iconId}`))})]})},ki=t=>{const{onChange:e,configList:r,errorMap:n={}}=t,o=ee.useDependency(x.LocaleService),i=[{label:o.t(`sheet.cf.symbol.${u.CFNumberOperator.greaterThan}`),value:u.CFNumberOperator.greaterThan},{label:o.t(`sheet.cf.symbol.${u.CFNumberOperator.greaterThanOrEqual}`),value:u.CFNumberOperator.greaterThanOrEqual}],c=[{label:o.t(`sheet.cf.valueType.${u.CFValueType.num}`),value:u.CFValueType.num},{label:o.t(`sheet.cf.valueType.${u.CFValueType.percent}`),value:u.CFValueType.percent},{label:o.t(`sheet.cf.valueType.${u.CFValueType.percentile}`),value:u.CFValueType.percentile},{label:o.t(`sheet.cf.valueType.${u.CFValueType.formula}`),value:u.CFValueType.formula}],y=(T,_)=>{e([String(_),"value","value"],T)},p=(T,_)=>{e([String(_),"operator"],T);const w=u.createDefaultValue(u.CFSubRuleType.number,T);y(w,_)},S=(T,_)=>{e([String(_),"value","type"],T);const w=r[_],b=u.createDefaultValue(u.CFSubRuleType.number,w.operator);y(b,_)};return j.useMemo(()=>r.map((T,_)=>{const w=n[_],b=br(T.iconType,T.iconId),R=_===r.length-1,h=_===0,a=r[_-1],s=(a==null?void 0:a.value.type)===u.CFValueType.formula?o.t("sheet.cf.valueType.formula"):a==null?void 0:a.value.value,f=(C,l)=>{const m={...T,iconId:l,iconType:C};e([String(_)],m)};return I.jsxs("div",{className:`
102
+ ${_?z.mTXl:z.mTSm}
103
+ `,children:[I.jsxs("div",{className:`
109
104
  ${z.label}
110
105
  ${H.flex}
111
- `,children:[_.jsxs("div",{className:`
106
+ `,children:[I.jsxs("div",{className:`
112
107
  ${H.width45}
113
- `,children:[o.t("sheet.cf.iconSet.icon"),x+1]}),_.jsx("div",{className:`
108
+ `,children:[o.t("sheet.cf.iconSet.icon"),_+1]}),I.jsx("div",{className:`
114
109
  ${H.width45}
115
- `,children:_.jsxs(_.Fragment,{children:[!h&&!I&&o.t("sheet.cf.iconSet.rule"),!h&&!I&&_.jsxs("span",{className:H.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${u.getOppositeOperator(a.operator)}`),s,I?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),_.jsxs("div",{className:`
110
+ `,children:I.jsxs(I.Fragment,{children:[!h&&!R&&o.t("sheet.cf.iconSet.rule"),!h&&!R&&I.jsxs("span",{className:H.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${u.getOppositeOperator(a.operator)}`),s,R?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),I.jsxs("div",{className:`
116
111
  ${H.flex}
117
112
  ${z.mTSm}
118
- `,children:[_.jsx("div",{className:`
113
+ `,children:[I.jsx("div",{className:`
119
114
  ${H.iconWrap}
120
115
  ${H.width45}
121
- `,children:_.jsx(oe.DropdownLegacy,{overlay:_.jsx(Gi,{onClick:d,iconId:R.iconId,iconType:R.iconType}),children:_.jsxs("div",{className:H.dropdownIcon,children:[b?_.jsx("img",{src:b,className:H.icon}):_.jsx(mt,{className:H.icon}),_.jsx($t,{})]})})}),I?_.jsxs("div",{className:`
116
+ `,children:I.jsx(Q.Dropdown,{overlay:I.jsx("div",{className:"univer-rounded-lg univer-p-4",children:I.jsx(zi,{onClick:f,iconId:T.iconId,iconType:T.iconType})}),children:I.jsxs("div",{className:Q.clsx(H.dropdownIcon,"univer-box-border univer-h-7"),children:[b?I.jsx("img",{src:b,className:H.icon}):I.jsx(ft,{className:H.icon}),I.jsx(Nt,{})]})})}),R?I.jsxs("div",{className:`
122
117
  ${H.width45}
123
118
  ${z.label}
124
- `,style:{marginTop:0},children:[o.t("sheet.cf.iconSet.rule"),_.jsxs("span",{className:H.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${u.getOppositeOperator(a.operator)}`),s,I?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]}):_.jsx(oe.Select,{className:`
119
+ `,style:{marginTop:0},children:[o.t("sheet.cf.iconSet.rule"),I.jsxs("span",{className:H.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${u.getOppositeOperator(a.operator)}`),s,R?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]}):I.jsx(Q.Select,{className:`
125
120
  ${z.mL0}
126
121
  ${H.width45}
127
122
  ${z.mR0}
128
- `,options:i,value:R.operator,onChange:C=>{p(C,x)}})]}),I?_.jsx("div",{}):_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:`
123
+ `,options:i,value:T.operator,onChange:C=>{p(C,_)}})]}),R?I.jsx("div",{}):I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:`
129
124
  ${z.mTSm}
130
125
  ${z.label}
131
126
  ${H.flex}
132
- `,children:[_.jsx("div",{className:`
127
+ `,children:[I.jsx("div",{className:`
133
128
  ${H.width45}
134
- `,children:o.t("sheet.cf.iconSet.type")}),_.jsx("div",{className:`
129
+ `,children:o.t("sheet.cf.iconSet.type")}),I.jsx("div",{className:`
135
130
  ${H.width45}
136
- `,children:o.t("sheet.cf.iconSet.value")})]}),_.jsxs("div",{className:`
131
+ `,children:o.t("sheet.cf.iconSet.value")})]}),I.jsxs("div",{className:`
137
132
  ${z.mTSm}
138
133
  ${H.flex}
139
- `,children:[_.jsx(oe.Select,{style:{flexShrink:0},className:`
134
+ `,children:[I.jsx(Q.Select,{style:{flexShrink:0},className:`
140
135
  ${H.width45}
141
136
  ${z.mL0}
142
- `,options:c,value:R.value.type,onChange:C=>{S(C,x)}}),_.jsx("div",{className:`
137
+ `,options:c,value:T.value.type,onChange:C=>{S(C,_)}}),I.jsx("div",{className:`
143
138
  ${z.mL0}
144
139
  ${H.width45}
145
- `,children:_.jsx(Hi,{id:x,type:R.value.type,error:T,value:R.value.value||"",onChange:C=>y(C,x)})})]})]})]},x)}),[r,n])},Yi=t=>{var C;const{interceptorManager:e}=t,r=((C=t.rule)==null?void 0:C.type)===u.CFRuleType.iconSet?t.rule:void 0,n=ee.useDependency(w.LocaleService),[o,i]=N.useState({}),[c,y]=N.useState(()=>{const l=Object.keys(u.iconMap)[0];if(r&&r.config.length){const m=r.config[0].iconType;if(!r.config.some(g=>g.iconType!==m))return m}return l}),[p,S]=N.useState(()=>{if(r&&r.config.length)return w.Tools.deepClone(r==null?void 0:r.config);const l=u.iconMap[c]||[];return new Array(l.length).fill("").map((m,f,g)=>f===g.length-1?{operator:u.CFNumberOperator.lessThanOrEqual,value:{type:u.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:c,iconId:String(f)}:tr(c,f,g))}),[v,R]=N.useState(()=>r?!!r.isShowValue:!0),x=N.useMemo(()=>{const l=p.map(m=>Er(m.iconType,m.iconId));return _.jsx("div",{className:H.iconWrap,children:l.map((m,f)=>m?_.jsx("img",{className:H.icon,src:m},f):_.jsx(mt,{className:H.icon},f))})},[p]),T=l=>{if(l.reduce((f,g,F)=>f.preType&&!f.result||l.length-1===F?f:g.value.type===u.CFValueType.formula?{preType:u.CFValueType.formula,result:!1}:f.preType?{result:f.preType===g.value.type,preType:g.value.type}:{result:!0,preType:g.value.type},{result:!0,preType:""}).result&&[u.CFValueType.num,u.CFValueType.percent,u.CFValueType.percentile].includes(l[0].value.type)){const f={};return l.forEach((g,F,j)=>{if(F-1<0||F===j.length-1)return;const L=l[F-1],E=u.getOppositeOperator(L.operator);u.compareWithNumber({operator:E,value:L.value.value},g.value.value)||(f[F]=`${n.t(`sheet.cf.form.${E}`,String(L.value.value))} `)}),f}return{}},b=(l,m)=>{w.get(p,l)!==m&&(w.set(p,l,m),S([...p]),i(T(p)))},I=l=>{y(l);const m=u.iconMap[l]||[],f=new Array(m.length).fill("").map((g,F,j)=>tr(l,F,j));S(f),i(T(f))};N.useEffect(()=>{const l=e.intercept(e.getInterceptPoints().submit,{handler(){return{type:u.CFRuleType.iconSet,isShowValue:v,config:p}}});return()=>{l()}},[v,p,e]),N.useEffect(()=>{const l=e.intercept(e.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(o).length===0}});return()=>{l()}},[v,p,e,o]);const h=()=>{const l=p.map(m=>({...m}));p.forEach((m,f)=>{const g=p.length-1-f,F=l[g];m.iconId=F.iconId,m.iconType=F.iconType}),S([...p])},a=ee.useDependency(ee.ILayoutService),[s,d]=N.useState();return ee.useScrollYOverContainer(s,a.rootContainerElement),_.jsxs("div",{className:H.iconSet,children:[_.jsx("div",{className:z.title,children:n.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
140
+ `,children:I.jsx(Ui,{id:_,type:T.value.type,error:w,value:T.value.value||"",onChange:C=>y(C,_)})})]})]})]},_)}),[r,n])},$i=t=>{var C;const{interceptorManager:e}=t,r=((C=t.rule)==null?void 0:C.type)===u.CFRuleType.iconSet?t.rule:void 0,n=ee.useDependency(x.LocaleService),[o,i]=j.useState({}),[c,y]=j.useState(()=>{const l=Object.keys(u.iconMap)[0];if(r&&r.config.length){const m=r.config[0].iconType;if(!r.config.some(g=>g.iconType!==m))return m}return l}),[p,S]=j.useState(()=>{if(r&&r.config.length)return x.Tools.deepClone(r==null?void 0:r.config);const l=u.iconMap[c]||[];return new Array(l.length).fill("").map((m,d,g)=>d===g.length-1?{operator:u.CFNumberOperator.lessThanOrEqual,value:{type:u.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:c,iconId:String(d)}:Xn(c,d,g))}),[v,T]=j.useState(()=>r?!!r.isShowValue:!0),_=j.useMemo(()=>{const l=p.map(m=>br(m.iconType,m.iconId));return I.jsx("div",{className:H.iconWrap,children:l.map((m,d)=>m?I.jsx("img",{className:H.icon,src:m},d):I.jsx(ft,{className:H.icon},d))})},[p]),w=l=>{if(l.reduce((d,g,F)=>d.preType&&!d.result||l.length-1===F?d:g.value.type===u.CFValueType.formula?{preType:u.CFValueType.formula,result:!1}:d.preType?{result:d.preType===g.value.type,preType:g.value.type}:{result:!0,preType:g.value.type},{result:!0,preType:""}).result&&[u.CFValueType.num,u.CFValueType.percent,u.CFValueType.percentile].includes(l[0].value.type)){const d={};return l.forEach((g,F,D)=>{if(F-1<0||F===D.length-1)return;const L=l[F-1],E=u.getOppositeOperator(L.operator);u.compareWithNumber({operator:E,value:L.value.value},g.value.value)||(d[F]=`${n.t(`sheet.cf.form.${E}`,String(L.value.value))} `)}),d}return{}},b=(l,m)=>{x.get(p,l)!==m&&(x.set(p,l,m),S([...p]),i(w(p)))},R=l=>{y(l);const m=u.iconMap[l]||[],d=new Array(m.length).fill("").map((g,F,D)=>Xn(l,F,D));S(d),i(w(d))};j.useEffect(()=>{const l=e.intercept(e.getInterceptPoints().submit,{handler(){return{type:u.CFRuleType.iconSet,isShowValue:v,config:p}}});return()=>{l()}},[v,p,e]),j.useEffect(()=>{const l=e.intercept(e.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(o).length===0}});return()=>{l()}},[v,p,e,o]);const h=()=>{const l=p.map(m=>({...m}));p.forEach((m,d)=>{const g=p.length-1-d,F=l[g];m.iconId=F.iconId,m.iconType=F.iconType}),S([...p])},a=ee.useDependency(ee.ILayoutService),[s,f]=j.useState();return ee.useScrollYOverContainer(s,a.rootContainerElement),I.jsxs("div",{className:H.iconSet,children:[I.jsx("div",{className:z.title,children:n.t("sheet.cf.panel.styleRule")}),I.jsx("div",{className:`
146
141
  ${z.mTSm}
147
- `,children:_.jsx(oe.DropdownLegacy,{placement:"bottomLeft",overlay:_.jsx(Bi,{ref:l=>{!s&&l&&d(l)},iconType:c,onClick:I}),children:_.jsxs("div",{className:H.dropdownIcon,style:{width:"unset"},children:[x,_.jsx($t,{})]})})}),_.jsxs("div",{className:`
142
+ `,children:I.jsx(Q.Dropdown,{overlay:I.jsx("div",{className:"univer-rounded-lg univer-p-4",children:I.jsx(Vi,{ref:l=>{!s&&l&&f(l)},iconType:c,onClick:R})}),children:I.jsxs("div",{className:Q.clsx(H.dropdownIcon,"univer-box-border univer-h-7 univer-w-auto"),children:[_,I.jsx(Nt,{})]})})}),I.jsxs("div",{className:`
148
143
  ${z.mTSm}
149
144
  ${H.renderConfig}
150
- `,children:[_.jsxs("div",{className:H.utilItem,children:[_.jsx(oe.Checkbox,{onChange:h}),n.t("sheet.cf.iconSet.reverseIconOrder")]}),_.jsxs("div",{className:`
145
+ `,children:[I.jsxs("div",{className:H.utilItem,children:[I.jsx(Q.Checkbox,{onChange:h}),n.t("sheet.cf.iconSet.reverseIconOrder")]}),I.jsxs("div",{className:`
151
146
  ${H.utilItem}
152
147
  ${z.mLXl}
153
- `,children:[_.jsx(oe.Checkbox,{checked:!v,onChange:l=>{R(!l)}}),n.t("sheet.cf.iconSet.onlyShowIcon")]})]}),_.jsx(Xi,{errorMap:o,onChange:b,configList:p})]})},Ki=t=>{var h;const{onChange:e,interceptorManager:r}=t,n=ee.useDependency(w.LocaleService),o=((h=t.rule)==null?void 0:h.type)===u.CFRuleType.highlightCell?t.rule:void 0,i=[{label:n.t("sheet.cf.panel.isNotBottom"),value:"isNotBottom"},{label:n.t("sheet.cf.panel.isBottom"),value:"isBottom"},{label:n.t("sheet.cf.panel.greaterThanAverage"),value:"greaterThanAverage"},{label:n.t("sheet.cf.panel.lessThanAverage"),value:"lessThanAverage"}],[c,y]=N.useState(()=>{const a=i[0].value,s=o==null?void 0:o.type;if(!o)return a;switch(s){case u.CFRuleType.highlightCell:switch(o.subType){case u.CFSubRuleType.average:return[u.CFNumberOperator.greaterThan,u.CFNumberOperator.greaterThanOrEqual].includes(o.operator)?"greaterThanAverage":[u.CFNumberOperator.lessThan,u.CFNumberOperator.lessThanOrEqual].includes(o.operator)?"lessThanAverage":a;case u.CFSubRuleType.rank:return o.isBottom?"isBottom":"isNotBottom"}}return a}),[p,S]=N.useState(()=>{const s=o==null?void 0:o.type;if(!o)return 10;switch(s){case u.CFRuleType.highlightCell:switch(o.subType){case u.CFSubRuleType.rank:return o.value||10}}return 10}),[v,R]=N.useState(()=>{const s=o==null?void 0:o.type;if(!o)return!1;switch(s){case u.CFRuleType.highlightCell:switch(o.subType){case u.CFSubRuleType.rank:return o.isPercent||!1}}return!1}),[x,T]=N.useState({}),b=a=>{const{type:s,isPercent:d,value:C,style:l}=a;if(s==="isNotBottom")return{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.rank,isPercent:d,isBottom:!1,value:C,style:l};if(s==="isBottom")return{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.rank,isPercent:d,isBottom:!0,value:C,style:l};if(s==="greaterThanAverage")return{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.average,operator:u.CFNumberOperator.greaterThan,style:l};if(s==="lessThanAverage")return{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.average,operator:u.CFNumberOperator.lessThan,style:l}};N.useEffect(()=>r.intercept(r.getInterceptPoints().submit,{handler(){return b({type:c,isPercent:v,value:p,style:x})}}),[c,v,p,x,r]);const I=a=>{e(b(a))};return _.jsxs("div",{children:[_.jsx("div",{className:`
148
+ `,children:[I.jsx(Q.Checkbox,{checked:!v,onChange:l=>{T(!l)}}),n.t("sheet.cf.iconSet.onlyShowIcon")]})]}),I.jsx(ki,{errorMap:o,onChange:b,configList:p})]})},Ai=t=>{var h;const{onChange:e,interceptorManager:r}=t,n=ee.useDependency(x.LocaleService),o=((h=t.rule)==null?void 0:h.type)===u.CFRuleType.highlightCell?t.rule:void 0,i=[{label:n.t("sheet.cf.panel.isNotBottom"),value:"isNotBottom"},{label:n.t("sheet.cf.panel.isBottom"),value:"isBottom"},{label:n.t("sheet.cf.panel.greaterThanAverage"),value:"greaterThanAverage"},{label:n.t("sheet.cf.panel.lessThanAverage"),value:"lessThanAverage"}],[c,y]=j.useState(()=>{const a=i[0].value,s=o==null?void 0:o.type;if(!o)return a;switch(s){case u.CFRuleType.highlightCell:switch(o.subType){case u.CFSubRuleType.average:return[u.CFNumberOperator.greaterThan,u.CFNumberOperator.greaterThanOrEqual].includes(o.operator)?"greaterThanAverage":[u.CFNumberOperator.lessThan,u.CFNumberOperator.lessThanOrEqual].includes(o.operator)?"lessThanAverage":a;case u.CFSubRuleType.rank:return o.isBottom?"isBottom":"isNotBottom"}}return a}),[p,S]=j.useState(()=>{const s=o==null?void 0:o.type;if(!o)return 10;switch(s){case u.CFRuleType.highlightCell:switch(o.subType){case u.CFSubRuleType.rank:return o.value||10}}return 10}),[v,T]=j.useState(()=>{const s=o==null?void 0:o.type;if(!o)return!1;switch(s){case u.CFRuleType.highlightCell:switch(o.subType){case u.CFSubRuleType.rank:return o.isPercent||!1}}return!1}),[_,w]=j.useState({}),b=a=>{const{type:s,isPercent:f,value:C,style:l}=a;if(s==="isNotBottom")return{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.rank,isPercent:f,isBottom:!1,value:C,style:l};if(s==="isBottom")return{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.rank,isPercent:f,isBottom:!0,value:C,style:l};if(s==="greaterThanAverage")return{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.average,operator:u.CFNumberOperator.greaterThan,style:l};if(s==="lessThanAverage")return{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.average,operator:u.CFNumberOperator.lessThan,style:l}};j.useEffect(()=>r.intercept(r.getInterceptPoints().submit,{handler(){return b({type:c,isPercent:v,value:p,style:_})}}),[c,v,p,_,r]);const R=a=>{e(b(a))};return I.jsxs("div",{children:[I.jsx("div",{className:`
154
149
  ${z.title}
155
150
  ${z.mTBase}
156
- `,children:n.t("sheet.cf.panel.styleRule")}),_.jsx(oe.Select,{className:`
151
+ `,children:n.t("sheet.cf.panel.styleRule")}),I.jsx(Q.Select,{className:`
157
152
  ${H.width100}
158
153
  ${z.mTSm}
159
- `,value:c,options:i,onChange:a=>{y(a),I({type:a,isPercent:v,value:p,style:x})}}),["isNotBottom","isBottom"].includes(c)&&_.jsxs("div",{className:`
154
+ `,value:c,options:i,onChange:a=>{y(a),R({type:a,isPercent:v,value:p,style:_})}}),["isNotBottom","isBottom"].includes(c)&&I.jsxs("div",{className:`
160
155
  ${z.labelContainer}
161
156
  ${z.mTSm}
162
- `,children:[_.jsx(oe.InputNumber,{min:1,max:1e3,value:p,onChange:a=>{const s=a||0;S(s),I({type:c,isPercent:v,value:s,style:x})}}),_.jsxs("div",{className:`
157
+ `,children:[I.jsx(Q.InputNumber,{min:1,max:1e3,value:p,onChange:a=>{const s=a||0;S(s),R({type:c,isPercent:v,value:s,style:_})}}),I.jsxs("div",{className:`
163
158
  ${z.mLSm}
164
159
  ${z.labelContainer}
165
160
  ${H.text}
166
- `,children:[_.jsx(oe.Checkbox,{checked:v,onChange:a=>{R(!!a),I({type:c,isPercent:!!a,value:p,style:x})}}),n.t("sheet.cf.valueType.percent")]})]}),_.jsx("div",{className:`
161
+ `,children:[I.jsx(Q.Checkbox,{checked:v,onChange:a=>{T(!!a),R({type:c,isPercent:!!a,value:p,style:_})}}),n.t("sheet.cf.valueType.percent")]})]}),I.jsx("div",{className:`
167
162
  ${H.cfPreviewWrap}
168
- `,children:_.jsx(qe,{rule:b({type:c,isPercent:v,value:p,style:x})})}),_.jsx(Sn,{style:o==null?void 0:o.style,className:`
163
+ `,children:I.jsx(qe,{rule:b({type:c,isPercent:v,value:p,style:_})})}),I.jsx(fn,{style:o==null?void 0:o.style,className:`
169
164
  ${z.mTSm}
170
- `,onChange:a=>{T(a),I({type:c,isPercent:v,value:p,style:a})}})]})},Zi=w.createInterceptorKey("beforeSubmit"),Ji=w.createInterceptorKey("submit"),nr=t=>t.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),rr=t=>{var e;return(e=t.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()},Qi=t=>{var j,U,L;const e=ee.useDependency(w.LocaleService),r=ee.useDependency(w.ICommandService),n=ee.useDependency(w.IUniverInstanceService),o=ee.useDependency(u.ConditionalFormattingRuleModel),i=ee.useDependency(X.SheetsSelectionsService),c=nr(n),y=rr(n),[p,S]=N.useState(!0),v=N.useRef({}),[R,x]=N.useState(void 0),T=N.useRef((U=(j=t.rule)==null?void 0:j.ranges)!=null?U:[]),b=N.useMemo(()=>{var D,k,B;let E=(D=t.rule)==null?void 0:D.ranges;return E!=null&&E.length||(E=(B=(k=i.getCurrentSelections())==null?void 0:k.map(G=>G.range))!=null?B:[]),T.current=E,E!=null&&E.length?E.map(G=>{const ne=rn.serializeRange(G);return ne==="NaN"?"":ne}).filter(G=>!!G).join(","):""},[t.rule]),I=[{label:e.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:e.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:e.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:e.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:e.t("sheet.cf.ruleType.formula"),value:"5"},{label:e.t("sheet.cf.ruleType.iconSet"),value:"6"}],[h,a]=N.useState(()=>{var k,B;const E=(k=t.rule)==null?void 0:k.rule.type,D=I[0].value;if(!E)return D;switch(E){case u.CFRuleType.highlightCell:{switch((B=t.rule)==null?void 0:B.rule.subType){case u.CFSubRuleType.number:case u.CFSubRuleType.text:case u.CFSubRuleType.duplicateValues:case u.CFSubRuleType.uniqueValues:case u.CFSubRuleType.timePeriod:return"1";case u.CFSubRuleType.average:case u.CFSubRuleType.rank:return"2";case u.CFSubRuleType.formula:return"5"}break}case u.CFRuleType.dataBar:return"3";case u.CFRuleType.colorScale:return"4";case u.CFRuleType.iconSet:return"6"}return D}),s=N.useRef(void 0),d=N.useMemo(()=>new w.InterceptorManager({beforeSubmit:Zi,submit:Ji}),[]),C=N.useMemo(()=>{switch(h){case"1":return er;case"2":return Ki;case"3":return zi;case"4":return Vi;case"5":return qi;case"6":return Yi;default:return er}},[h]);N.useEffect(()=>{const E=r.onCommandExecuted(D=>{if(D.id===X.RemoveSheetMutation.id){const k=D.params;k.subUnitId===y&&k.unitId===c&&t.onCancel()}D.id===X.SetWorksheetActiveOperation.id&&t.onCancel()});return()=>E.dispose()},[]);const l=E=>{s.current=E},m=E=>{const D=E.split(",").filter(k=>!!k).map(rn.deserializeRangeWithSheet).map(k=>k.range);T.current=D},f=()=>{if(R)return;const D=(()=>{const B=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!B)throw new Error("No active sheet found");return T.current.map(Q=>X.setEndForRange(Q,B.getRowCount(),B.getColumnCount())).filter(Q=>!(Number.isNaN(Q.startRow)||Number.isNaN(Q.startColumn)))})();if(d.fetchThroughInterceptors(d.getInterceptPoints().beforeSubmit)(!0,null)){const B=d.fetchThroughInterceptors(d.getInterceptPoints().submit)(null,null);if(B){const G=nr(n),ne=rr(n);if(!G||!ne)throw new Error("No active sheet found");let Q={};t.rule&&t.rule.cfId?(Q={...t.rule,ranges:D,rule:B},r.executeCommand(kt.id,{unitId:G,subUnitId:ne,rule:Q}),t.onCancel()):(Q={cfId:o.createCfId(G,ne),ranges:D,rule:B,stopIfTrue:!1},r.executeCommand(pt.id,{unitId:G,subUnitId:ne,rule:Q}),t.onCancel())}}},g=()=>{t.onCancel()},F=(E,D)=>{E?D.length<1?x(e.t("sheet.cf.errorMessage.rangeError")):x(void 0):x(e.t("sheet.cf.errorMessage.rangeError"))};return ee.useSidebarClick(E=>{var k;const D=(k=v.current)==null?void 0:k.handleOutClick;D&&D(E,()=>S(!1))}),_.jsxs("div",{className:H.cfRuleStyleEditor,children:[_.jsx("div",{className:z.title,children:e.t("sheet.cf.panel.range")}),_.jsx("div",{className:`
171
- ${z.mTBase}
172
- `,children:_.jsx(ft.RangeSelector,{unitId:c,errorText:R,subUnitId:y,initValue:b,onChange:m,onVerify:F,onFocus:()=>S(!0),isFocus:p,actions:v.current})}),_.jsx("div",{className:z.title,children:e.t("sheet.cf.panel.styleType")}),_.jsx("div",{className:z.mTBase,children:_.jsx(oe.Select,{className:H.width100,value:h,options:I,onChange:E=>a(E)})}),_.jsx(C,{interceptorManager:d,rule:(L=t.rule)==null?void 0:L.rule,onChange:l}),_.jsxs("div",{className:`
173
- ${z.mTBase}
174
- ${H.btnList}
175
- `,children:[_.jsx(oe.Button,{size:"small",onClick:g,children:e.t("sheet.cf.panel.cancel")}),_.jsx(oe.Button,{className:z.mLSm,size:"small",type:"primary",onClick:f,children:e.t("sheet.cf.panel.submit")})]})]})},ea=t=>{const[e,r]=N.useState(t.rule),[n,o]=N.useState(!!t.rule),i=()=>{o(!0)},c=()=>{o(!1),r(void 0)},y=p=>{r(p),o(!0)};return _.jsx("div",{className:z.conditionalFormattingWrap,children:n?_.jsx(Qi,{onCancel:c,rule:e}):_.jsx(li,{onClick:y,onCreate:i})})};var ta=Object.getOwnPropertyDescriptor,na=(t,e,r,n)=>{for(var o=n>1?void 0:n?ta(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},Qe=(t,e)=>(r,n)=>e(r,n,t);const _t="sheet.conditional.formatting.panel";let st=class extends w.Disposable{constructor(e,r,n,o,i){super();xe(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=r,this._componentManager=n,this._sidebarService=o,this._localeService=i,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(w.UniverInstanceType.UNIVER_SHEET).subscribe(c=>{var y;c||(y=this._sidebarDisposable)==null||y.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(c=>{c.id===_t&&(c.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const r={id:_t,header:{title:this._localeService.t("sheet.cf.title")},children:{label:_t,rule:e,key:w.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(r)}_initPanel(){this._componentManager.register(_t,ea)}};st=na([Qe(0,w.IUniverInstanceService),Qe(1,w.Inject(w.Injector)),Qe(2,w.Inject(ee.ComponentManager)),Qe(3,w.Inject(ee.ISidebarService)),Qe(4,w.Inject(w.LocaleService))],st);var ve=(t=>(t[t.createRule=1]="createRule",t[t.viewRule=2]="viewRule",t[t.highlightCell=3]="highlightCell",t[t.rank=4]="rank",t[t.formula=5]="formula",t[t.colorScale=6]="colorScale",t[t.dataBar=7]="dataBar",t[t.icon=8]="icon",t[t.clearRangeRules=9]="clearRangeRules",t[t.clearWorkSheetRules=10]="clearWorkSheetRules",t))(ve||{});const gt={id:"sheet.operation.open.conditional.formatting.panel",type:w.CommandType.OPERATION,handler:(t,e)=>{var y;const r=t.get(st),n=t.get(X.SheetsSelectionsService),o=t.get(w.ICommandService),i=((y=n.getCurrentSelections())==null?void 0:y.map(p=>p.range))||[];switch(e.value){case 3:{r.openPanel({...u.createDefaultRule(),ranges:i});break}case 4:{const p={...u.createDefaultRule,ranges:i,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.rank}};r.openPanel(p);break}case 5:{const p={...u.createDefaultRule,ranges:i,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.formula,value:"="}};r.openPanel(p);break}case 6:{const p={...u.createDefaultRule,ranges:i,rule:{type:u.CFRuleType.colorScale,config:[]}};r.openPanel(p);break}case 7:{const p={...u.createDefaultRule,ranges:i,rule:{type:u.CFRuleType.dataBar,isShowValue:!0}};r.openPanel(p);break}case 8:{const p={...u.createDefaultRule,ranges:i,rule:{type:u.CFRuleType.iconSet,config:[],isShowValue:!0}};r.openPanel(p);break}case 2:{r.openPanel();break}case 1:{r.openPanel({...u.createDefaultRule(),ranges:i});break}case 9:{o.executeCommand(Vt.id,{ranges:i});break}case 10:{o.executeCommand(ht.id);break}}return!0}};var ra=Object.getOwnPropertyDescriptor,oa=(t,e,r,n)=>{for(var o=n>1?void 0:n?ra(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},et=(t,e)=>(r,n)=>e(r,n,t);let lt=class extends w.Disposable{constructor(e,r,n,o,i){super();xe(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=r,this._injector=n,this._conditionalFormattingViewModel=o,this._univerInstanceService=i,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:u.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,r,n)=>this._collectConditionalRule(e,r,n),onPasteCells:(e,r,n,o)=>{const{copyType:i=de.COPY_TYPE.COPY,pasteType:c}=o,{range:y}=e||{},{range:p}=r;return this._generateConditionalFormattingMutations(p,{copyType:i,pasteType:c,copyRange:y})}}))}_collectConditionalRule(e,r,n){const o=new w.ObjectMatrix,i={};this._copyInfo={matrix:o,info:{unitId:e,subUnitId:r,cfMap:i}};const c=this._injector.invoke(v=>de.rangeToDiscreteRange(n,v,e,r));if(!c)return;const{rows:y,cols:p}=c,S=new Set;y.forEach((v,R)=>{p.forEach((x,T)=>{const b=this._conditionalFormattingViewModel.getCellCfs(e,r,v,x);b&&(b.forEach(I=>S.add(I.cfId)),o.setValue(R,T,b.map(I=>I.cfId)))})}),S.forEach(v=>{const R=this._conditionalFormattingRuleModel.getRule(e,r,v);R&&(i[v]=R.rule)})}_generateConditionalFormattingMutations(e,r){const n=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET),o=n.getActiveSheet(),i=n.getUnitId();if(!o)return{redos:[],undos:[]};const c=o.getSheetId();if(r.copyType===de.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!r.copyRange)return{redos:[],undos:[]};if(![de.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,de.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,de.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(r.pasteType))return{redos:[],undos:[]};const{ranges:[p,S],mapFunc:v}=de.virtualizeDiscreteRanges([r.copyRange,e]),R=de.getRepeatRange(p,S,!0),x={};w.Range.foreach(S,(l,m)=>{const{row:f,col:g}=v(l,m),F=this._conditionalFormattingViewModel.getCellCfs(i,c,f,g);F&&F.forEach(j=>{if(!x[j.cfId]){const U=new w.ObjectMatrix;x[j.cfId]=U;const L=this._conditionalFormattingRuleModel.getRule(i,c,j.cfId);L==null||L.ranges.forEach(E=>{w.Range.foreach(E,(D,k)=>{U.setValue(D,k,1)})})}x[j.cfId].realDeleteValue(f,g)})});const{matrix:T,info:b}=this._copyInfo,I=[];let h=this._conditionalFormattingRuleModel.createCfId(i,c);const a={},s=l=>{if(a[l])return a[l];const m=b==null?void 0:b.cfMap[l],f=[...this._conditionalFormattingRuleModel.getSubunitRules(i,c)||[],...I].find(g=>w.Tools.diffValue(g.rule,m));if(f)return a[l]=f,f;{const g={rule:m,cfId:h,ranges:[],stopIfTrue:!1};return a[l]=g,I.push(g),h=`${Number(h)+1}`,g}};R.forEach(l=>{T&&T.forValue((m,f,g)=>{const F=w.Rectangle.getPositionRange({startRow:m,endRow:m,startColumn:f,endColumn:f},l.startRange),{row:j,col:U}=v(F.startRow,F.startColumn);g.forEach(L=>{if(!x[L]){const E=s(L),D=new w.ObjectMatrix;x[L]=D,E.ranges.forEach(k=>{w.Range.foreach(k,(B,G)=>{D.setValue(B,G,1)})})}x[L].setValue(j,U,1)})})});const d=[],C=[];for(const l in x){const m=x[l],f=X.findAllRectangle(X.createTopMatrixFromMatrix(m));if(!f.length){const g={unitId:i,subUnitId:c,cfId:l};d.push({id:u.DeleteConditionalRuleMutation.id,params:g}),C.push(...u.DeleteConditionalRuleMutationUndoFactory(this._injector,g))}if(I.some(g=>g.cfId===l)){const g=s(l),F={unitId:i,subUnitId:c,rule:{...g,ranges:f}};d.push({id:u.AddConditionalRuleMutation.id,params:F}),C.push(u.AddConditionalRuleMutationUndoFactory(this._injector,F))}else{const g=this._conditionalFormattingRuleModel.getRule(i,c,l);if(!g)continue;const F={unitId:i,subUnitId:c,rule:{...g,ranges:f}};d.push({id:u.SetConditionalRuleMutation.id,params:F}),C.push(...u.setConditionalRuleMutationUndoFactory(this._injector,F))}}return{redos:d,undos:C}}};lt=oa([et(0,w.Inject(de.ISheetClipboardService)),et(1,w.Inject(u.ConditionalFormattingRuleModel)),et(2,w.Inject(w.Injector)),et(3,w.Inject(u.ConditionalFormattingViewModel)),et(4,w.Inject(w.IUniverInstanceService))],lt);var ia=Object.getOwnPropertyDescriptor,aa=(t,e,r,n)=>{for(var o=n>1?void 0:n?ia(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},Qt=(t,e)=>(r,n)=>e(r,n,t);let ut=class extends w.Disposable{constructor(t,e,r){super(),this._localeService=t,this._commandService=e,this._sheetPermissionCheckController=r,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{t.id===pt.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[X.WorkbookEditablePermission],rangeTypes:[X.RangeProtectionPermissionEditPoint],worksheetTypes:[X.WorksheetEditPermission,X.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")))}))}};ut=aa([Qt(0,w.Inject(w.LocaleService)),Qt(1,w.ICommandService),Qt(2,w.Inject(X.SheetPermissionCheckController))],ut);var sa=Object.getOwnPropertyDescriptor,la=(t,e,r,n)=>{for(var o=n>1?void 0:n?sa(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},Et=(t,e)=>(r,n)=>e(r,n,t);let ct=class extends w.Disposable{constructor(t,e,r,n){super(),this._conditionalFormattingRuleModel=t,this._univerInstanceService=e,this._injector=r,this._refRangeService=n,this._initRefRange()}_initRefRange(){const t=new Map,e=(n,o,i)=>`${n}_${o}_${i}`,r=(n,o,i)=>{const c=p=>{const S=[...i.ranges],v=S.map(x=>X.handleDefaultRangeChangeWithEffectRefCommands(x,p)).filter(x=>!!x);if(u.isRangesEqual(v,S))return{redos:[],undos:[]};if(v.length){const x={unitId:n,subUnitId:o,rule:{...i,ranges:v}},T=[{id:u.SetConditionalRuleMutation.id,params:x}],b=u.setConditionalRuleMutationUndoFactory(this._injector,x);return{redos:T,undos:b}}else{const x={unitId:n,subUnitId:o,cfId:i.cfId},T=[{id:u.DeleteConditionalRuleMutation.id,params:x}],b=u.DeleteConditionalRuleMutationUndoFactory(this._injector,x);return{redos:T,undos:b}}},y=[];i.ranges.forEach(p=>{const S=this._refRangeService.registerRefRange(p,c);y.push(()=>S.dispose())}),t.set(e(n,o,i.cfId),()=>y.forEach(p=>p()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:o,subUnitId:i,rule:c}=n,y=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!(n.unitId!==y.getUnitId()||n.subUnitId!==(p==null?void 0:p.getSheetId())))switch(n.type){case"add":{r(n.unitId,n.subUnitId,n.rule);break}case"delete":{const S=t.get(e(o,i,c.cfId));S&&S();break}case"set":{const S=t.get(e(o,i,c.cfId));S&&S(),r(n.unitId,n.subUnitId,n.rule)}}})),this.disposeWithMe(w.toDisposable(()=>{t.forEach(n=>{n()}),t.clear()}))}};ct=la([Et(0,w.Inject(u.ConditionalFormattingRuleModel)),Et(1,w.Inject(w.IUniverInstanceService)),Et(2,w.Inject(w.Injector)),Et(3,w.Inject(X.RefRangeService))],ct);var ua=Object.getOwnPropertyDescriptor,ca=(t,e,r,n)=>{for(var o=n>1?void 0:n?ua(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},Ue=(t,e)=>(r,n)=>e(r,n,t);let dt=class extends w.Disposable{constructor(e,r,n,o,i,c){super();xe(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=r,this._univerInstanceService=n,this._renderManagerService=o,this._conditionalFormattingViewModel=i,this._conditionalFormattingRuleModel=c,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var r,n,o;const e=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=this._renderManagerService.getRenderById(e))==null||r.with(de.SheetSkeletonManagerService).reCalculate(),(o=(n=this._renderManagerService.getRenderById(e))==null?void 0:n.mainComponent)==null||o.makeDirty()}_initSkeleton(){this.disposeWithMe(be.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(it.bufferTime(16),it.filter(e=>!!e.length),it.filter(e=>{const r=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const n=r.getActiveSheet();return n?e.filter(o=>o.unitId===r.getUnitId()&&o.subUnitId===n.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(X.INTERCEPTOR_POINT.CELL_CONTENT,{effect:w.InterceptorEffectEnum.Style,handler:(e,r,n)=>{const o=this._conditionalFormattingService.composeStyle(r.unitId,r.subUnitId,r.row,r.col);if(!o)return n(e);const i=r.workbook.getStyles(),y={...(typeof(e==null?void 0:e.s)=="string"?i.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},p={...e,s:y};return o.style&&Object.assign(y,o.style),p.fontRenderExtension||(p.fontRenderExtension={},o.isShowValue!==void 0&&(p.fontRenderExtension.isSkip=!o.isShowValue)),o.dataBar&&(p.dataBar=o.dataBar),o.iconSet&&(p.iconSet=o.iconSet,p.fontRenderExtension.leftOffset=u.DEFAULT_PADDING+u.DEFAULT_WIDTH),n(p)},priority:10}))}};dt=ca([Ue(0,w.Inject(X.SheetInterceptorService)),Ue(1,w.Inject(u.ConditionalFormattingService)),Ue(2,w.Inject(w.IUniverInstanceService)),Ue(3,w.Inject(ur.IRenderManagerService)),Ue(4,w.Inject(u.ConditionalFormattingViewModel)),Ue(5,w.Inject(u.ConditionalFormattingRuleModel))],dt);const Or="sheets-conditional-formatting-ui.config",Dt={};var da=Object.defineProperty,fa=Object.getOwnPropertyDescriptor,pa=(t,e,r)=>e in t?da(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ha=(t,e,r,n)=>{for(var o=n>1?void 0:n?fa(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},en=(t,e)=>(r,n)=>e(r,n,t),Mr=(t,e,r)=>pa(t,typeof e!="symbol"?e+"":e,r);exports.UniverSheetsConditionalFormattingMobileUIPlugin=class extends w.Plugin{constructor(e=Dt,r,n,o){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=o;const{menu:i,...c}=w.merge({},Dt,this._config);i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(Or,c),this._initCommand(),this._injector.add([dt]),this._injector.add([ct]),this._injector.add([lt]),this._injector.add([ut]),this._injector.add([ke])}_initCommand(){[an,sn,ln,un,cn,dn,fn,pn,hn,gt,at,kt,zt,pt,Vt,ht].forEach(e=>{this._commandService.registerCommand(e)})}};Mr(exports.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${u.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`);Mr(exports.UniverSheetsConditionalFormattingMobileUIPlugin,"type",w.UniverInstanceType.UNIVER_SHEET);exports.UniverSheetsConditionalFormattingMobileUIPlugin=ha([w.DependentOn(u.UniverSheetsConditionalFormattingPlugin),en(1,w.Inject(w.Injector)),en(2,w.Inject(w.ICommandService)),en(3,w.IConfigService)],exports.UniverSheetsConditionalFormattingMobileUIPlugin);var ma=Object.getOwnPropertyDescriptor,ga=(t,e,r,n)=>{for(var o=n>1?void 0:n?ma(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},tt=(t,e)=>(r,n)=>e(r,n,t);let Pt=class extends w.Disposable{constructor(t,e,r,n,o){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=r,this._conditionalFormattingRuleModel=n,this._conditionalFormattingViewModel=o,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(o,i,c,y,p)=>{var T;const S=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),v=(T=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:T.getSheetId();if(!S||!v)return;const R={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},x={startRow:i.row,startColumn:i.col,endColumn:i.col,endRow:i.row};w.Range.foreach(c,(b,I)=>{const h=w.Rectangle.getPositionRange({startRow:b,startColumn:I,endColumn:I,endRow:b},R),a=w.Rectangle.getPositionRange({startRow:b,startColumn:I,endColumn:I,endRow:b},x),{row:s,col:d}=p(h.startRow,h.startColumn),C=this._conditionalFormattingViewModel.getCellCfs(S,v,s,d),{row:l,col:m}=p(a.startRow,a.startColumn),f=this._conditionalFormattingViewModel.getCellCfs(S,v,l,m);f&&f.forEach(g=>{let F=y.get(g.cfId);if(!y.get(g.cfId)){const j=this._conditionalFormattingRuleModel.getRule(S,v,g.cfId);if(!j)return;F=new w.ObjectMatrix,j.ranges.forEach(U=>{w.Range.foreach(U,(L,E)=>{F.setValue(L,E,1)})}),y.set(g.cfId,F)}F.realDeleteValue(l,m)}),C&&C.forEach(g=>{let F=y.get(g.cfId);if(!y.get(g.cfId)){const j=this._conditionalFormattingRuleModel.getRule(S,v,g.cfId);if(!j)return;F=new w.ObjectMatrix,j.ranges.forEach(U=>{w.Range.foreach(U,(L,E)=>{F.setValue(L,E,1)})}),y.set(g.cfId,F)}F.setValue(l,m,1)})})},r=(o,i)=>{var a,s,d;const c=(a=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET))==null?void 0:a.getUnitId(),y=(d=(s=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:d.getSheetId(),p=new Map,S=[],v=[];if(!c||!y)return t();const R=de.virtualizeDiscreteRanges([o,i]),[x,T]=R.ranges,{mapFunc:b}=R,I={row:x.startRow,col:x.startColumn};return de.getAutoFillRepeatRange(x,T).forEach(C=>{e(I,C.repeatStartCell,C.relativeRange,p,b)}),p.forEach((C,l)=>{const m=this._conditionalFormattingRuleModel.getRule(c,y,l);if(!m)return;const f=X.findAllRectangle(X.createTopMatrixFromMatrix(C));if(f.length){const g={unitId:c,subUnitId:y,rule:{...m,ranges:f}};S.push({id:u.SetConditionalRuleMutation.id,params:g}),v.push(...u.setConditionalRuleMutationUndoFactory(this._injector,g))}else{const g={unitId:c,subUnitId:y,cfId:m.cfId};S.push({id:u.DeleteConditionalRuleMutation.id,params:g}),v.push(...u.DeleteConditionalRuleMutationUndoFactory(this._injector,g))}}),{undos:v,redos:S}},n={id:u.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(o,i,c)=>{if(c===de.APPLY_TYPE.COPY||c===de.APPLY_TYPE.ONLY_FORMAT||c===de.APPLY_TYPE.SERIES){const{source:y,target:p}=o;return r(y,p)}return t()}};this.disposeWithMe(this._autoFillService.addHook(n))}};Pt=ga([tt(0,w.Inject(w.Injector)),tt(1,w.Inject(w.IUniverInstanceService)),tt(2,w.Inject(de.IAutoFillService)),tt(3,w.Inject(u.ConditionalFormattingRuleModel)),tt(4,w.Inject(u.ConditionalFormattingViewModel))],Pt);var va=Object.getOwnPropertyDescriptor,ya=(t,e,r,n)=>{for(var o=n>1?void 0:n?va(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},nt=(t,e)=>(r,n)=>e(r,n,t);exports.ConditionalFormattingClearController=class extends w.Disposable{constructor(e,r,n,o,i){super(),this._injector=e,this._univerInstanceService=r,this._sheetInterceptorService=n,this._selectionManagerService=o,this._conditionalFormattingRuleModel=i,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var i;const r=[],n=[],o={redos:r,undos:n};if([X.ClearSelectionFormatCommand.id,X.ClearSelectionAllCommand.id].includes(e.id)){const c=(i=this._selectionManagerService.getCurrentSelections())==null?void 0:i.map(b=>b.range);if(!c)return o;const y=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!p)return o;const S=y.getUnitId(),v=p.getSheetId(),R=this._conditionalFormattingRuleModel.getSubunitRules(S,v);if(!R||!R.length)return o;const{redos:x,undos:T}=or(this._injector,R,c,S,v);r.push(...x),n.push(...T)}return o}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:r,ranges:n})=>{const o=[],i=[],c={redos:o,undos:i};if(!n||!n.length)return c;const y=this._conditionalFormattingRuleModel.getSubunitRules(e,r);if(!y||!y.length)return c;const{redos:p,undos:S}=or(this._injector,y,n,e,r);return o.push(...p),i.push(...S),c}}))}};exports.ConditionalFormattingClearController=ya([nt(0,w.Inject(w.Injector)),nt(1,w.Inject(w.IUniverInstanceService)),nt(2,w.Inject(X.SheetInterceptorService)),nt(3,w.Inject(X.SheetsSelectionsService)),nt(4,w.Inject(u.ConditionalFormattingRuleModel))],exports.ConditionalFormattingClearController);function or(t,e,r,n,o){const i=[],c=[];return e.filter(y=>r.some(p=>y.ranges.some(S=>w.Rectangle.getIntersects(S,p)))).forEach(y=>{const S=new X.RangeMergeUtil().add(...y.ranges).subtract(...r).merge();if(S.length){const v={id:u.SetConditionalRuleMutation.id,params:{unitId:n,subUnitId:o,rule:{...y,ranges:S}}},R=u.setConditionalRuleMutationUndoFactory(t,v.params);i.push(v),c.push(...R)}else{const v={id:u.DeleteConditionalRuleMutation.id,params:{unitId:n,subUnitId:o,cfId:y.cfId}},R=u.DeleteConditionalRuleMutationUndoFactory(t,v.params);i.push(v),c.push(...R)}}),{redos:i,undos:c}}var Ca=Object.getOwnPropertyDescriptor,Sa=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ca(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},ir=(t,e)=>(r,n)=>e(r,n,t);let Nt=class extends w.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(w.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(X.AFTER_CELL_EDIT,{handler:(t,e,r)=>{var c,y,p;t||r(t);const n=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col),o=(c=n==null?void 0:n.style)!=null?c:{},i=Object.keys(o);if(t!=null&&t.p)return(p=(y=t.p.body)==null?void 0:y.textRuns)==null||p.forEach(S=>{S.ts&&i.forEach(v=>{var R;(R=S.ts)==null||delete R[v]})}),r(t);{const S={...(typeof(t==null?void 0:t.s)=="string"?e.workbook.getStyles().get(t.s):t==null?void 0:t.s)||{}};i.forEach(R=>{delete S[R]});const v={...t,s:{...S}};return r(v)}}})))}};Nt=Sa([ir(0,w.Inject(X.SheetInterceptorService)),ir(1,w.Inject(u.ConditionalFormattingService))],Nt);const ar=[X.SetWorksheetActiveOperation.id,u.AddConditionalRuleMutation.id,u.SetConditionalRuleMutation.id,u.DeleteConditionalRuleMutation.id,u.MoveConditionalRuleMutation.id],rt=[{label:"sheet.cf.ruleType.highlightCell",value:ve.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:ve.rank},{label:"sheet.cf.ruleType.formula",value:ve.formula},{label:"sheet.cf.ruleType.colorScale",value:ve.colorScale},{label:"sheet.cf.ruleType.dataBar",value:ve.dataBar},{label:"sheet.cf.ruleType.iconSet",value:ve.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:ve.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:ve.createRule},{label:"sheet.cf.menu.clearRangeRules",value:ve.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:ve.clearWorkSheetRules}],ba=t=>{const e=t.get(X.SheetsSelectionsService),r=t.get(w.ICommandService),n=t.get(w.IUniverInstanceService),o=t.get(u.ConditionalFormattingRuleModel),i=new be.Observable(p=>be.merge(e.selectionMoveEnd$,e.selectionSet$,new be.Observable(S=>{const v=r.onCommandExecuted(R=>{var I;const{id:x,params:T}=R,b=(I=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET))==null?void 0:I.getUnitId();ar.includes(x)&&T.unitId===b&&S.next(null)});return()=>v.dispose()})).pipe(it.debounceTime(16)).subscribe(()=>{var I;const S=((I=e.getCurrentSelections())==null?void 0:I.map(h=>h.range))||[],v=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET);if(!v)return;const R=v.getActiveSheet();if(!R)return;const b=(o.getSubunitRules(v.getUnitId(),R.getSheetId())||[]).filter(h=>h.ranges.some(a=>S.some(s=>w.Rectangle.intersects(s,a)))).map(h=>h.ranges).every(h=>X.checkRangesEditablePermission(t,v.getUnitId(),R.getSheetId(),h));p.next(b)})),c=new be.Observable(p=>new be.Observable(S=>{const v=r.onCommandExecuted(R=>{var I;const{id:x,params:T}=R,b=(I=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET))==null?void 0:I.getUnitId();ar.includes(x)&&T.unitId===b&&S.next(null)});return()=>v.dispose()}).pipe(it.debounceTime(16)).subscribe(()=>{const S=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET);if(!S)return;const v=S.getActiveSheet();if(!v)return;const R=o.getSubunitRules(S.getUnitId(),v.getSheetId())||[];if(!R.length)return p.next(!1),!1;const x=R.map(T=>T.ranges).every(T=>X.checkRangesEditablePermission(t,S.getUnitId(),v.getSheetId(),T));p.next(x)})),y=new be.Observable(p=>{i.subscribe(S=>{const v=rt.find(R=>R.value===ve.clearRangeRules);v&&(v.disabled=!S,p.next(rt))}),c.subscribe(S=>{const v=rt.find(R=>R.value===ve.clearWorkSheetRules);v&&(v.disabled=!S,p.next(rt))}),p.next(rt)});return{id:gt.id,type:ee.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:y,hidden$:ee.getMenuHiddenObservable(t,w.UniverInstanceType.UNIVER_SHEET),disabled$:de.getCurrentRangeDisable$(t,{workbookTypes:[X.WorkbookEditablePermission],worksheetTypes:[X.WorksheetSetCellStylePermission,X.WorksheetEditPermission],rangeTypes:[X.RangeProtectionPermissionEditPoint]})}},Ra={[ee.RibbonStartGroup.FORMULAS_INSERT]:{[gt.id]:{order:0,menuItemFactory:ba}}};var Ta=Object.getOwnPropertyDescriptor,Ia=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ta(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},sr=(t,e)=>(r,n)=>e(r,n,t);let jt=class extends w.Disposable{constructor(e,r){super();xe(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=r,this._menuManagerService.mergeMenu(Ra)}};jt=Ia([sr(0,w.Inject(w.Injector)),sr(1,ee.IMenuManagerService)],jt);var wa=Object.getOwnPropertyDescriptor,xa=(t,e,r,n)=>{for(var o=n>1?void 0:n?wa(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},Ve=(t,e)=>(r,n)=>e(r,n,t);const _a=(t,e)=>{const r=v=>v.endRow-v.startRow+1,n=v=>v.endColumn-v.startColumn+1,o=r(e)%r(t),i=n(e)%n(t),c=Math.floor(r(e)/r(t)),y=Math.floor(n(e)/n(t)),p=[],S={startRow:0,endRow:r(t)-1,startColumn:0,endColumn:n(t)-1};if(r(e)===1&&n(e)===1){const v={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return p.push({repeatRelativeRange:S,startRange:v}),p}for(let v=0;v<c+(o?.1:0);v++)for(let R=0;R<y+(i?.1:0);R++){const x=r(t)*v,T=n(t)*R,b={startRow:x+e.startRow,endRow:x+e.startRow,startColumn:T+e.startColumn,endColumn:T+e.startColumn};let I=S;v===c&&o&&(I={...I},I.endRow=I.endRow-(r(t)-o)),R===y&&i&&(I={...I},I.endColumn=I.endColumn-(n(t)-i)),p.push({repeatRelativeRange:I,startRange:b})}return p};let Lt=class extends w.Disposable{constructor(e,r,n,o,i,c){super();xe(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=r,this._formatPainterService=n,this._sheetsSelectionsService=o,this._conditionalFormattingRuleModel=i,this._conditionalFormattingViewModel=c,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),r=(i,c,y,p,S)=>{const{unitId:v,subUnitId:R}=this._painterConfig,{targetUnitId:x,targetSubUnitId:T}=S,b={startRow:i.row,startColumn:i.col,endColumn:i.col,endRow:i.row},I={startRow:c.row,startColumn:c.col,endColumn:c.col,endRow:c.row};w.Range.foreach(y,(h,a)=>{const s=w.Rectangle.getPositionRange({startRow:h,startColumn:a,endColumn:a,endRow:h},b),d=w.Rectangle.getPositionRange({startRow:h,startColumn:a,endColumn:a,endRow:h},I),C=this._conditionalFormattingViewModel.getCellCfs(v,R,s.startRow,s.startColumn),l=this._conditionalFormattingViewModel.getCellCfs(x,T,d.startRow,d.startColumn);l&&l.forEach(m=>{let f=p.get(m.cfId);if(!p.get(m.cfId)){const g=this._conditionalFormattingRuleModel.getRule(x,T,m.cfId);if(!g)return;f=new w.ObjectMatrix,g.ranges.forEach(F=>{w.Range.foreach(F,(j,U)=>{f.setValue(j,U,1)})}),p.set(m.cfId,f)}f.realDeleteValue(d.startRow,d.startColumn)}),C&&C.forEach(m=>{const f=p.get(m.cfId);f&&f.setValue(d.startRow,d.startColumn,1)})})},n=(i,c,y)=>{var s;const{range:p,unitId:S,subUnitId:v}=this._painterConfig,R=i!==S||v!==c,x=new Map,T=[],b=[];if(!i||!c||!S||!v)return e();const I=(s=this._conditionalFormattingRuleModel.getSubunitRules(S,v))!=null?s:[];I==null||I.forEach(d=>{const{ranges:C,cfId:l}=d;if(C.some(m=>w.Rectangle.intersects(p,m))){const m=new w.ObjectMatrix;R||C.forEach(f=>{w.Range.foreach(f,(g,F)=>{m.setValue(g,F,1)})}),x.set(l,m)}});const h={row:p.startRow,col:p.startColumn};return _a(p,y).forEach(d=>{r(h,{row:d.startRange.startRow,col:d.startRange.startColumn},d.repeatRelativeRange,x,{targetUnitId:i,targetSubUnitId:c})}),x.forEach((d,C)=>{if(R){const l=this._conditionalFormattingRuleModel.getRule(i,c,C),m=X.findAllRectangle(X.createTopMatrixFromMatrix(d));if(l)if(m.length){const f={unitId:i,subUnitId:c,rule:{...l,ranges:m}};T.push({id:u.SetConditionalRuleMutation.id,params:f}),b.push(...u.setConditionalRuleMutationUndoFactory(this._injector,f))}else{const f={unitId:i,subUnitId:c,cfId:l.cfId};T.push({id:u.DeleteConditionalRuleMutation.id,params:f}),b.push(...u.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}else if(m.length){const f=this._conditionalFormattingRuleModel.getRule(S,v,C);if(f){const g={unitId:i,subUnitId:c,rule:{...w.Tools.deepClone(f),cfId:this._conditionalFormattingRuleModel.createCfId(i,c),ranges:m}};T.push({id:u.AddConditionalRuleMutation.id,params:g}),b.push(u.AddConditionalRuleMutationUndoFactory(this._injector,g))}}}else{const l=this._conditionalFormattingRuleModel.getRule(S,v,C);if(!l)return;const m=X.findAllRectangle(X.createTopMatrixFromMatrix(d));if(m.length){const f={unitId:S,subUnitId:v,rule:{...l,ranges:m}};T.push({id:u.SetConditionalRuleMutation.id,params:f}),b.push(...u.setConditionalRuleMutationUndoFactory(this._injector,f))}else{const f={unitId:S,subUnitId:v,cfId:l.cfId};T.push({id:u.DeleteConditionalRuleMutation.id,params:f}),b.push(...u.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}}}),{undos:b,redos:T}},o={id:u.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:i=>{var c,y,p;switch(i){case de.FormatPainterStatus.INFINITE:case de.FormatPainterStatus.ONCE:{const S=(c=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET))==null?void 0:c.getUnitId(),v=(p=(y=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getActiveSheet())==null?void 0:p.getSheetId(),R=this._sheetsSelectionsService.getCurrentLastSelection(),x=R==null?void 0:R.range;S&&v&&x&&(this._painterConfig={unitId:S,subUnitId:v,range:x});break}case de.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(i,c,y)=>this._painterConfig?n(i,c,y):{redos:[],undos:[]}};this._formatPainterService.addHook(o)}};Lt=xa([Ve(0,w.Inject(w.Injector)),Ve(1,w.Inject(w.IUniverInstanceService)),Ve(2,w.Inject(de.IFormatPainterService)),Ve(3,w.Inject(X.SheetsSelectionsService)),Ve(4,w.Inject(u.ConditionalFormattingRuleModel)),Ve(5,w.Inject(u.ConditionalFormattingViewModel))],Lt);var Ea=Object.getOwnPropertyDescriptor,Oa=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ea(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},tn=(t,e)=>(r,n)=>e(r,n,t);let Ut=class extends w.Disposable{constructor(t,e,r){super(),this._conditionalFormattingViewModel=t,this._univerInstanceService=e,this._renderManagerService=r,this._init()}_init(){const t=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET),e=r=>{const n=r.getUnitId(),o=this._renderManagerService.getRenderById(n);if(!o)return;const i=o.with(de.SheetSkeletonManagerService);this.disposeWithMe(i.currentSkeleton$.subscribe(c=>{if(c){const y=c.skeleton.rowColumnSegment,p=y.endColumn-y.startColumn+1,v=(y.endRow-y.startRow+1)*p*9,R=Math.max(u.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,v);this._conditionalFormattingViewModel.setCacheLength(R)}}))};t&&e(t),this._univerInstanceService.getCurrentTypeOfUnit$(w.UniverInstanceType.UNIVER_SHEET).subscribe(r=>{r&&e(r)})}};Ut=Oa([tn(0,w.Inject(u.ConditionalFormattingViewModel)),tn(1,w.IUniverInstanceService),tn(2,ur.IRenderManagerService)],Ut);var Ma=Object.defineProperty,Fa=Object.getOwnPropertyDescriptor,Da=(t,e,r)=>e in t?Ma(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Pa=(t,e,r,n)=>{for(var o=n>1?void 0:n?Fa(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},nn=(t,e)=>(r,n)=>e(r,n,t),Fr=(t,e,r)=>Da(t,typeof e!="symbol"?e+"":e,r);exports.UniverSheetsConditionalFormattingUIPlugin=class extends w.Plugin{constructor(e=Dt,r,n,o){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=o;const{menu:i,...c}=w.merge({},Dt,this._config);i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(Or,c),this._initCommand()}onStarting(){w.registerDependencies(this._injector,[[dt],[ct],[lt],[Pt],[ut],[st],[jt],[ke],[Nt],[exports.ConditionalFormattingClearController],[Lt],[Ut]]),w.touchDependencies(this._injector,[[dt]])}onReady(){w.touchDependencies(this._injector,[[jt],[st]])}onRendered(){w.touchDependencies(this._injector,[[Pt],[exports.ConditionalFormattingClearController],[lt],[Nt],[ke],[Lt],[ut],[ct],[Ut]])}_initCommand(){[an,sn,ln,un,cn,dn,fn,pn,hn,gt,at,kt,zt,pt,Vt,ht].forEach(e=>{this._commandService.registerCommand(e)})}};Fr(exports.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${u.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`);Fr(exports.UniverSheetsConditionalFormattingUIPlugin,"type",w.UniverInstanceType.UNIVER_SHEET);exports.UniverSheetsConditionalFormattingUIPlugin=Pa([w.DependentOn(u.UniverSheetsConditionalFormattingPlugin),nn(1,w.Inject(w.Injector)),nn(2,w.Inject(w.ICommandService)),nn(3,w.IConfigService)],exports.UniverSheetsConditionalFormattingUIPlugin);exports.AddAverageCfCommand=an;exports.AddCfCommand=pt;exports.AddColorScaleConditionalRuleCommand=sn;exports.AddDataBarConditionalRuleCommand=ln;exports.AddDuplicateValuesCfCommand=un;exports.AddNumberCfCommand=cn;exports.AddRankCfCommand=dn;exports.AddTextCfCommand=fn;exports.AddTimePeriodCfCommand=pn;exports.AddUniqueValuesCfCommand=hn;exports.ClearRangeCfCommand=Vt;exports.ClearWorksheetCfCommand=ht;exports.DeleteCfCommand=at;exports.MoveCfCommand=zt;exports.OpenConditionalFormattingOperator=gt;exports.SetCfCommand=kt;
165
+ `,onChange:a=>{w(a),R({type:c,isPercent:v,value:p,style:a})}})]})},qi=x.createInterceptorKey("beforeSubmit"),Wi=x.createInterceptorKey("submit"),Yn=t=>t.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET).getUnitId(),Kn=t=>{var e;return(e=t.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()},Hi=t=>{var d,g,F;const e=ee.useDependency(x.LocaleService),r=ee.useDependency(x.ICommandService),n=ee.useDependency(x.IUniverInstanceService),o=ee.useDependency(u.ConditionalFormattingRuleModel),i=ee.useDependency(Y.SheetsSelectionsService),c=Yn(n),y=Kn(n),[p,S]=j.useState(void 0),v=j.useRef((g=(d=t.rule)==null?void 0:d.ranges)!=null?g:[]),T=j.useMemo(()=>{var U,L,E;let D=(U=t.rule)==null?void 0:U.ranges;return D!=null&&D.length||(D=(E=(L=i.getCurrentSelections())==null?void 0:L.map(N=>N.range))!=null?E:[]),v.current=D,D!=null&&D.length?D.map(N=>{const W=Yt.serializeRange(N);return W==="NaN"?"":W}).filter(N=>!!N).join(","):""},[t.rule]),_=[{label:e.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:e.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:e.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:e.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:e.t("sheet.cf.ruleType.formula"),value:"5"},{label:e.t("sheet.cf.ruleType.iconSet"),value:"6"}],[w,b]=j.useState(()=>{var L,E;const D=(L=t.rule)==null?void 0:L.rule.type,U=_[0].value;if(!D)return U;switch(D){case u.CFRuleType.highlightCell:{switch((E=t.rule)==null?void 0:E.rule.subType){case u.CFSubRuleType.number:case u.CFSubRuleType.text:case u.CFSubRuleType.duplicateValues:case u.CFSubRuleType.uniqueValues:case u.CFSubRuleType.timePeriod:return"1";case u.CFSubRuleType.average:case u.CFSubRuleType.rank:return"2";case u.CFSubRuleType.formula:return"5"}break}case u.CFRuleType.dataBar:return"3";case u.CFRuleType.colorScale:return"4";case u.CFRuleType.iconSet:return"6"}return U}),R=j.useRef(void 0),h=j.useMemo(()=>new x.InterceptorManager({beforeSubmit:qi,submit:Wi}),[]),a=j.useMemo(()=>{switch(w){case"1":return Gn;case"2":return Ai;case"3":return Fi;case"4":return Pi;case"5":return ji;case"6":return $i;default:return Gn}},[w]);j.useEffect(()=>{const D=r.onCommandExecuted(U=>{if(U.id===Y.RemoveSheetMutation.id){const L=U.params;L.subUnitId===y&&L.unitId===c&&t.onCancel()}U.id===Y.SetWorksheetActiveOperation.id&&t.onCancel()});return()=>D.dispose()},[]);const s=D=>{R.current=D},f=D=>{const U=D.split(",").filter(L=>!!L).map(Yt.deserializeRangeWithSheet).map(L=>L.range);v.current=U},C=()=>{if(p)return;const U=(()=>{const E=n.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!E)throw new Error("No active sheet found");return v.current.map(B=>Y.setEndForRange(B,E.getRowCount(),E.getColumnCount())).filter(B=>!(Number.isNaN(B.startRow)||Number.isNaN(B.startColumn)))})();if(h.fetchThroughInterceptors(h.getInterceptPoints().beforeSubmit)(!0,null)){const E=h.fetchThroughInterceptors(h.getInterceptPoints().submit)(null,null);if(E){const N=Yn(n),W=Kn(n);if(!N||!W)throw new Error("No active sheet found");let B={};t.rule&&t.rule.cfId?(B={...t.rule,ranges:U,rule:E},r.executeCommand(u.SetCfCommand.id,{unitId:N,subUnitId:W,rule:B}),t.onCancel()):(B={cfId:o.createCfId(N,W),ranges:U,rule:E,stopIfTrue:!1},r.executeCommand(u.AddCfCommand.id,{unitId:N,subUnitId:W,rule:B}),t.onCancel())}}},l=()=>{t.onCancel()},m=(D,U)=>{D?U.length<1?S(e.t("sheet.cf.errorMessage.rangeError")):S(void 0):S(e.t("sheet.cf.errorMessage.rangeError"))};return I.jsxs("div",{className:H.cfRuleStyleEditor,children:[I.jsx("div",{className:z.title,children:e.t("sheet.cf.panel.range")}),I.jsxs("div",{className:`
166
+ ${z.mTBase}
167
+ `,children:[I.jsx(dt.RangeSelector,{unitId:c,subUnitId:y,initialValue:T,onChange:(D,U)=>f(U),onVerify:m}),p&&I.jsx("div",{className:H.cfErrorText,children:p})]}),I.jsx("div",{className:z.title,children:e.t("sheet.cf.panel.styleType")}),I.jsx("div",{className:z.mTBase,children:I.jsx(Q.Select,{className:H.width100,value:w,options:_,onChange:D=>b(D)})}),I.jsx(a,{interceptorManager:h,rule:(F=t.rule)==null?void 0:F.rule,onChange:s}),I.jsxs("div",{className:`
168
+ ${z.mTBase}
169
+ ${H.btnList}
170
+ `,children:[I.jsx(Q.Button,{size:"small",onClick:l,children:e.t("sheet.cf.panel.cancel")}),I.jsx(Q.Button,{className:z.mLSm,size:"small",type:"primary",onClick:C,children:e.t("sheet.cf.panel.submit")})]})]})},Bi=t=>{const[e,r]=j.useState(t.rule),[n,o]=j.useState(!!t.rule),i=()=>{o(!0)},c=()=>{o(!1),r(void 0)},y=p=>{r(p),o(!0)};return I.jsx("div",{className:z.conditionalFormattingWrap,children:n?I.jsx(Hi,{onCancel:c,rule:e}):I.jsx(ei,{onClick:y,onCreate:i})})};var Gi=Object.getOwnPropertyDescriptor,Xi=(t,e,r,n)=>{for(var o=n>1?void 0:n?Gi(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},Qe=(t,e)=>(r,n)=>e(r,n,t);const Tt="sheet.conditional.formatting.panel";let at=class extends x.Disposable{constructor(e,r,n,o,i){super();Ie(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=r,this._componentManager=n,this._sidebarService=o,this._localeService=i,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(x.UniverInstanceType.UNIVER_SHEET).subscribe(c=>{var y;c||(y=this._sidebarDisposable)==null||y.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(c=>{c.id===Tt&&(c.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const r={id:Tt,header:{title:this._localeService.t("sheet.cf.title")},children:{label:Tt,rule:e,key:x.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(r)}_initPanel(){this._componentManager.register(Tt,Bi)}};at=Xi([Qe(0,x.IUniverInstanceService),Qe(1,x.Inject(x.Injector)),Qe(2,x.Inject(ee.ComponentManager)),Qe(3,x.Inject(ee.ISidebarService)),Qe(4,x.Inject(x.LocaleService))],at);var ve=(t=>(t[t.createRule=1]="createRule",t[t.viewRule=2]="viewRule",t[t.highlightCell=3]="highlightCell",t[t.rank=4]="rank",t[t.formula=5]="formula",t[t.colorScale=6]="colorScale",t[t.dataBar=7]="dataBar",t[t.icon=8]="icon",t[t.clearRangeRules=9]="clearRangeRules",t[t.clearWorkSheetRules=10]="clearWorkSheetRules",t))(ve||{});const pt={id:"sheet.operation.open.conditional.formatting.panel",type:x.CommandType.OPERATION,handler:(t,e)=>{var y;const r=t.get(at),n=t.get(Y.SheetsSelectionsService),o=t.get(x.ICommandService),i=((y=n.getCurrentSelections())==null?void 0:y.map(p=>p.range))||[];switch(e.value){case 3:{r.openPanel({...u.createDefaultRule(),ranges:i});break}case 4:{const p={...u.createDefaultRule,ranges:i,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.rank}};r.openPanel(p);break}case 5:{const p={...u.createDefaultRule,ranges:i,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.formula,value:"="}};r.openPanel(p);break}case 6:{const p={...u.createDefaultRule,ranges:i,rule:{type:u.CFRuleType.colorScale,config:[]}};r.openPanel(p);break}case 7:{const p={...u.createDefaultRule,ranges:i,rule:{type:u.CFRuleType.dataBar,isShowValue:!0}};r.openPanel(p);break}case 8:{const p={...u.createDefaultRule,ranges:i,rule:{type:u.CFRuleType.iconSet,config:[],isShowValue:!0}};r.openPanel(p);break}case 2:{r.openPanel();break}case 1:{r.openPanel({...u.createDefaultRule(),ranges:i});break}case 9:{o.executeCommand(u.ClearRangeCfCommand.id,{ranges:i});break}case 10:{o.executeCommand(u.ClearWorksheetCfCommand.id);break}}return!0}};var Yi=Object.getOwnPropertyDescriptor,Ki=(t,e,r,n)=>{for(var o=n>1?void 0:n?Yi(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},et=(t,e)=>(r,n)=>e(r,n,t);let st=class extends x.Disposable{constructor(e,r,n,o,i){super();Ie(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=r,this._injector=n,this._conditionalFormattingViewModel=o,this._univerInstanceService=i,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:u.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,r,n)=>this._collectConditionalRule(e,r,n),onPasteCells:(e,r,n,o)=>{const{copyType:i=de.COPY_TYPE.COPY,pasteType:c}=o,{range:y}=e||{},{range:p}=r;return this._generateConditionalFormattingMutations(p,{copyType:i,pasteType:c,copyRange:y})}}))}_collectConditionalRule(e,r,n){const o=new x.ObjectMatrix,i={};this._copyInfo={matrix:o,info:{unitId:e,subUnitId:r,cfMap:i}};const c=this._injector.invoke(v=>Y.rangeToDiscreteRange(n,v,e,r));if(!c)return;const{rows:y,cols:p}=c,S=new Set;y.forEach((v,T)=>{p.forEach((_,w)=>{const b=this._conditionalFormattingViewModel.getCellCfs(e,r,v,_);b&&(b.forEach(R=>S.add(R.cfId)),o.setValue(T,w,b.map(R=>R.cfId)))})}),S.forEach(v=>{const T=this._conditionalFormattingRuleModel.getRule(e,r,v);T&&(i[v]=T.rule)})}_generateConditionalFormattingMutations(e,r){const n=this._univerInstanceService.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET),o=n.getActiveSheet(),i=n.getUnitId();if(!o)return{redos:[],undos:[]};const c=o.getSheetId();if(r.copyType===de.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!r.copyRange)return{redos:[],undos:[]};if(![de.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,de.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,de.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(r.pasteType))return{redos:[],undos:[]};const{ranges:[p,S],mapFunc:v}=de.virtualizeDiscreteRanges([r.copyRange,e]),T=de.getRepeatRange(p,S,!0),_={};x.Range.foreach(S,(l,m)=>{const{row:d,col:g}=v(l,m),F=this._conditionalFormattingViewModel.getCellCfs(i,c,d,g);F&&F.forEach(D=>{if(!_[D.cfId]){const U=new x.ObjectMatrix;_[D.cfId]=U;const L=this._conditionalFormattingRuleModel.getRule(i,c,D.cfId);L==null||L.ranges.forEach(E=>{x.Range.foreach(E,(N,W)=>{U.setValue(N,W,1)})})}_[D.cfId].realDeleteValue(d,g)})});const{matrix:w,info:b}=this._copyInfo,R=[];let h=this._conditionalFormattingRuleModel.createCfId(i,c);const a={},s=l=>{if(a[l])return a[l];const m=b==null?void 0:b.cfMap[l],d=[...this._conditionalFormattingRuleModel.getSubunitRules(i,c)||[],...R].find(g=>x.Tools.diffValue(g.rule,m));if(d)return a[l]=d,d;{const g={rule:m,cfId:h,ranges:[],stopIfTrue:!1};return a[l]=g,R.push(g),h=`${Number(h)+1}`,g}};T.forEach(l=>{w&&w.forValue((m,d,g)=>{const F=x.Rectangle.getPositionRange({startRow:m,endRow:m,startColumn:d,endColumn:d},l.startRange),{row:D,col:U}=v(F.startRow,F.startColumn);g.forEach(L=>{if(!_[L]){const E=s(L),N=new x.ObjectMatrix;_[L]=N,E.ranges.forEach(W=>{x.Range.foreach(W,(B,Z)=>{N.setValue(B,Z,1)})})}_[L].setValue(D,U,1)})})});const f=[],C=[];for(const l in _){const m=_[l],d=Y.findAllRectangle(Y.createTopMatrixFromMatrix(m));if(!d.length){const g={unitId:i,subUnitId:c,cfId:l};f.push({id:u.DeleteConditionalRuleMutation.id,params:g}),C.push(...u.DeleteConditionalRuleMutationUndoFactory(this._injector,g))}if(R.some(g=>g.cfId===l)){const g=s(l),F={unitId:i,subUnitId:c,rule:{...g,ranges:d}};f.push({id:u.AddConditionalRuleMutation.id,params:F}),C.push(u.AddConditionalRuleMutationUndoFactory(this._injector,F))}else{const g=this._conditionalFormattingRuleModel.getRule(i,c,l);if(!g)continue;const F={unitId:i,subUnitId:c,rule:{...g,ranges:d}};f.push({id:u.SetConditionalRuleMutation.id,params:F}),C.push(...u.setConditionalRuleMutationUndoFactory(this._injector,F))}}return{redos:f,undos:C}}};st=Ki([et(0,x.Inject(de.ISheetClipboardService)),et(1,x.Inject(u.ConditionalFormattingRuleModel)),et(2,x.Inject(x.Injector)),et(3,x.Inject(u.ConditionalFormattingViewModel)),et(4,x.Inject(x.IUniverInstanceService))],st);var Zi=Object.getOwnPropertyDescriptor,Ji=(t,e,r,n)=>{for(var o=n>1?void 0:n?Zi(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},Ht=(t,e)=>(r,n)=>e(r,n,t);let lt=class extends x.Disposable{constructor(t,e,r){super(),this._localeService=t,this._commandService=e,this._sheetPermissionCheckController=r,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{t.id===u.AddCfCommand.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[Y.WorkbookEditablePermission],rangeTypes:[Y.RangeProtectionPermissionEditPoint],worksheetTypes:[Y.WorksheetEditPermission,Y.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")))}))}};lt=Ji([Ht(0,x.Inject(x.LocaleService)),Ht(1,x.ICommandService),Ht(2,x.Inject(Y.SheetPermissionCheckController))],lt);var Qi=Object.getOwnPropertyDescriptor,ea=(t,e,r,n)=>{for(var o=n>1?void 0:n?Qi(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},wt=(t,e)=>(r,n)=>e(r,n,t);let ut=class extends x.Disposable{constructor(t,e,r,n){super(),this._conditionalFormattingRuleModel=t,this._univerInstanceService=e,this._injector=r,this._refRangeService=n,this._initRefRange()}_initRefRange(){const t=new Map,e=(n,o,i)=>`${n}_${o}_${i}`,r=(n,o,i)=>{const c=p=>{const S=[...i.ranges],v=S.map(_=>Y.handleDefaultRangeChangeWithEffectRefCommands(_,p)).filter(_=>!!_);if(u.isRangesEqual(v,S))return{redos:[],undos:[]};if(v.length){const _={unitId:n,subUnitId:o,rule:{...i,ranges:v}},w=[{id:u.SetConditionalRuleMutation.id,params:_}],b=u.setConditionalRuleMutationUndoFactory(this._injector,_);return{redos:w,undos:b}}else{const _={unitId:n,subUnitId:o,cfId:i.cfId},w=[{id:u.DeleteConditionalRuleMutation.id,params:_}],b=u.DeleteConditionalRuleMutationUndoFactory(this._injector,_);return{redos:w,undos:b}}},y=[];i.ranges.forEach(p=>{const S=this._refRangeService.registerRefRange(p,c);y.push(()=>S.dispose())}),t.set(e(n,o,i.cfId),()=>y.forEach(p=>p()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:o,subUnitId:i,rule:c}=n,y=this._univerInstanceService.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!(n.unitId!==y.getUnitId()||n.subUnitId!==(p==null?void 0:p.getSheetId())))switch(n.type){case"add":{r(n.unitId,n.subUnitId,n.rule);break}case"delete":{const S=t.get(e(o,i,c.cfId));S&&S();break}case"set":{const S=t.get(e(o,i,c.cfId));S&&S(),r(n.unitId,n.subUnitId,n.rule)}}})),this.disposeWithMe(x.toDisposable(()=>{t.forEach(n=>{n()}),t.clear()}))}};ut=ea([wt(0,x.Inject(u.ConditionalFormattingRuleModel)),wt(1,x.Inject(x.IUniverInstanceService)),wt(2,x.Inject(x.Injector)),wt(3,x.Inject(Y.RefRangeService))],ut);var ta=Object.getOwnPropertyDescriptor,na=(t,e,r,n)=>{for(var o=n>1?void 0:n?ta(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},Ue=(t,e)=>(r,n)=>e(r,n,t);let ct=class extends x.Disposable{constructor(e,r,n,o,i,c){super();Ie(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=r,this._univerInstanceService=n,this._renderManagerService=o,this._conditionalFormattingViewModel=i,this._conditionalFormattingRuleModel=c,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var r,n,o;const e=this._univerInstanceService.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=this._renderManagerService.getRenderById(e))==null||r.with(de.SheetSkeletonManagerService).reCalculate(),(o=(n=this._renderManagerService.getRenderById(e))==null?void 0:n.mainComponent)==null||o.makeDirty()}_initSkeleton(){this.disposeWithMe(Se.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(it.bufferTime(16),it.filter(e=>!!e.length),it.filter(e=>{const r=this._univerInstanceService.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const n=r.getActiveSheet();return n?e.filter(o=>o.unitId===r.getUnitId()&&o.subUnitId===n.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(Y.INTERCEPTOR_POINT.CELL_CONTENT,{effect:x.InterceptorEffectEnum.Style,handler:(e,r,n)=>{const o=this._conditionalFormattingService.composeStyle(r.unitId,r.subUnitId,r.row,r.col);if(!o)return n(e);const i=r.workbook.getStyles(),y={...(typeof(e==null?void 0:e.s)=="string"?i.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},p={...e,s:y};return o.style&&Object.assign(y,o.style),p.fontRenderExtension||(p.fontRenderExtension={},o.isShowValue!==void 0&&(p.fontRenderExtension.isSkip=!o.isShowValue)),o.dataBar&&(p.dataBar=o.dataBar),o.iconSet&&(p.iconSet=o.iconSet,p.fontRenderExtension.leftOffset=u.DEFAULT_PADDING+u.DEFAULT_WIDTH),n(p)},priority:10}))}};ct=na([Ue(0,x.Inject(Y.SheetInterceptorService)),Ue(1,x.Inject(u.ConditionalFormattingService)),Ue(2,x.Inject(x.IUniverInstanceService)),Ue(3,x.Inject(nr.IRenderManagerService)),Ue(4,x.Inject(u.ConditionalFormattingViewModel)),Ue(5,x.Inject(u.ConditionalFormattingRuleModel))],ct);const Sr="sheets-conditional-formatting-ui.config",Et={};var ra=Object.defineProperty,oa=Object.getOwnPropertyDescriptor,ia=(t,e,r)=>e in t?ra(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,aa=(t,e,r,n)=>{for(var o=n>1?void 0:n?oa(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},Bt=(t,e)=>(r,n)=>e(r,n,t),Rr=(t,e,r)=>ia(t,typeof e!="symbol"?e+"":e,r);exports.UniverSheetsConditionalFormattingMobileUIPlugin=class extends x.Plugin{constructor(e=Et,r,n,o){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=o;const{menu:i,...c}=x.merge({},Et,this._config);i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(Sr,c),this._initCommand(),this._injector.add([ct]),this._injector.add([ut]),this._injector.add([st]),this._injector.add([lt]),this._injector.add([ke])}_initCommand(){[Zt,Jt,Qt,en,tn,nn,rn,on,an,pt].forEach(e=>{this._commandService.registerCommand(e)})}};Rr(exports.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${u.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`);Rr(exports.UniverSheetsConditionalFormattingMobileUIPlugin,"type",x.UniverInstanceType.UNIVER_SHEET);exports.UniverSheetsConditionalFormattingMobileUIPlugin=aa([x.DependentOn(u.UniverSheetsConditionalFormattingPlugin),Bt(1,x.Inject(x.Injector)),Bt(2,x.Inject(x.ICommandService)),Bt(3,x.IConfigService)],exports.UniverSheetsConditionalFormattingMobileUIPlugin);var sa=Object.getOwnPropertyDescriptor,la=(t,e,r,n)=>{for(var o=n>1?void 0:n?sa(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},tt=(t,e)=>(r,n)=>e(r,n,t);let Ot=class extends x.Disposable{constructor(t,e,r,n,o){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=r,this._conditionalFormattingRuleModel=n,this._conditionalFormattingViewModel=o,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(o,i,c,y,p)=>{var w;const S=this._univerInstanceService.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET).getUnitId(),v=(w=this._univerInstanceService.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:w.getSheetId();if(!S||!v)return;const T={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},_={startRow:i.row,startColumn:i.col,endColumn:i.col,endRow:i.row};x.Range.foreach(c,(b,R)=>{const h=x.Rectangle.getPositionRange({startRow:b,startColumn:R,endColumn:R,endRow:b},T),a=x.Rectangle.getPositionRange({startRow:b,startColumn:R,endColumn:R,endRow:b},_),{row:s,col:f}=p(h.startRow,h.startColumn),C=this._conditionalFormattingViewModel.getCellCfs(S,v,s,f),{row:l,col:m}=p(a.startRow,a.startColumn),d=this._conditionalFormattingViewModel.getCellCfs(S,v,l,m);d&&d.forEach(g=>{let F=y.get(g.cfId);if(!y.get(g.cfId)){const D=this._conditionalFormattingRuleModel.getRule(S,v,g.cfId);if(!D)return;F=new x.ObjectMatrix,D.ranges.forEach(U=>{x.Range.foreach(U,(L,E)=>{F.setValue(L,E,1)})}),y.set(g.cfId,F)}F.realDeleteValue(l,m)}),C&&C.forEach(g=>{let F=y.get(g.cfId);if(!y.get(g.cfId)){const D=this._conditionalFormattingRuleModel.getRule(S,v,g.cfId);if(!D)return;F=new x.ObjectMatrix,D.ranges.forEach(U=>{x.Range.foreach(U,(L,E)=>{F.setValue(L,E,1)})}),y.set(g.cfId,F)}F.setValue(l,m,1)})})},r=(o,i)=>{var a,s,f;const c=(a=this._univerInstanceService.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET))==null?void 0:a.getUnitId(),y=(f=(s=this._univerInstanceService.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:f.getSheetId(),p=new Map,S=[],v=[];if(!c||!y)return t();const T=de.virtualizeDiscreteRanges([o,i]),[_,w]=T.ranges,{mapFunc:b}=T,R={row:_.startRow,col:_.startColumn};return de.getAutoFillRepeatRange(_,w).forEach(C=>{e(R,C.repeatStartCell,C.relativeRange,p,b)}),p.forEach((C,l)=>{const m=this._conditionalFormattingRuleModel.getRule(c,y,l);if(!m)return;const d=Y.findAllRectangle(Y.createTopMatrixFromMatrix(C));if(d.length){const g={unitId:c,subUnitId:y,rule:{...m,ranges:d}};S.push({id:u.SetConditionalRuleMutation.id,params:g}),v.push(...u.setConditionalRuleMutationUndoFactory(this._injector,g))}else{const g={unitId:c,subUnitId:y,cfId:m.cfId};S.push({id:u.DeleteConditionalRuleMutation.id,params:g}),v.push(...u.DeleteConditionalRuleMutationUndoFactory(this._injector,g))}}),{undos:v,redos:S}},n={id:u.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(o,i,c)=>{if(c===de.APPLY_TYPE.COPY||c===de.APPLY_TYPE.ONLY_FORMAT||c===de.APPLY_TYPE.SERIES){const{source:y,target:p}=o;return r(y,p)}return t()}};this.disposeWithMe(this._autoFillService.addHook(n))}};Ot=la([tt(0,x.Inject(x.Injector)),tt(1,x.Inject(x.IUniverInstanceService)),tt(2,x.Inject(de.IAutoFillService)),tt(3,x.Inject(u.ConditionalFormattingRuleModel)),tt(4,x.Inject(u.ConditionalFormattingViewModel))],Ot);var ua=Object.getOwnPropertyDescriptor,ca=(t,e,r,n)=>{for(var o=n>1?void 0:n?ua(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},nt=(t,e)=>(r,n)=>e(r,n,t);exports.ConditionalFormattingClearController=class extends x.Disposable{constructor(e,r,n,o,i){super(),this._injector=e,this._univerInstanceService=r,this._sheetInterceptorService=n,this._selectionManagerService=o,this._conditionalFormattingRuleModel=i,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var i;const r=[],n=[],o={redos:r,undos:n};if([Y.ClearSelectionFormatCommand.id,Y.ClearSelectionAllCommand.id].includes(e.id)){const c=(i=this._selectionManagerService.getCurrentSelections())==null?void 0:i.map(b=>b.range);if(!c)return o;const y=this._univerInstanceService.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!p)return o;const S=y.getUnitId(),v=p.getSheetId(),T=this._conditionalFormattingRuleModel.getSubunitRules(S,v);if(!T||!T.length)return o;const{redos:_,undos:w}=Zn(this._injector,T,c,S,v);r.push(..._),n.push(...w)}return o}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:r,ranges:n})=>{const o=[],i=[],c={redos:o,undos:i};if(!n||!n.length)return c;const y=this._conditionalFormattingRuleModel.getSubunitRules(e,r);if(!y||!y.length)return c;const{redos:p,undos:S}=Zn(this._injector,y,n,e,r);return o.push(...p),i.push(...S),c}}))}};exports.ConditionalFormattingClearController=ca([nt(0,x.Inject(x.Injector)),nt(1,x.Inject(x.IUniverInstanceService)),nt(2,x.Inject(Y.SheetInterceptorService)),nt(3,x.Inject(Y.SheetsSelectionsService)),nt(4,x.Inject(u.ConditionalFormattingRuleModel))],exports.ConditionalFormattingClearController);function Zn(t,e,r,n,o){const i=[],c=[];return e.filter(y=>r.some(p=>y.ranges.some(S=>x.Rectangle.getIntersects(S,p)))).forEach(y=>{const S=new Y.RangeMergeUtil().add(...y.ranges).subtract(...r).merge();if(S.length){const v={id:u.SetConditionalRuleMutation.id,params:{unitId:n,subUnitId:o,rule:{...y,ranges:S}}},T=u.setConditionalRuleMutationUndoFactory(t,v.params);i.push(v),c.push(...T)}else{const v={id:u.DeleteConditionalRuleMutation.id,params:{unitId:n,subUnitId:o,cfId:y.cfId}},T=u.DeleteConditionalRuleMutationUndoFactory(t,v.params);i.push(v),c.push(...T)}}),{redos:i,undos:c}}var da=Object.getOwnPropertyDescriptor,fa=(t,e,r,n)=>{for(var o=n>1?void 0:n?da(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},Jn=(t,e)=>(r,n)=>e(r,n,t);let Pt=class extends x.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(x.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(Y.AFTER_CELL_EDIT,{handler:(t,e,r)=>{var c,y,p;t||r(t);const n=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col),o=(c=n==null?void 0:n.style)!=null?c:{},i=Object.keys(o);if(t!=null&&t.p)return(p=(y=t.p.body)==null?void 0:y.textRuns)==null||p.forEach(S=>{S.ts&&i.forEach(v=>{var T;(T=S.ts)==null||delete T[v]})}),r(t);{const S={...(typeof(t==null?void 0:t.s)=="string"?e.workbook.getStyles().get(t.s):t==null?void 0:t.s)||{}};i.forEach(T=>{delete S[T]});const v={...t,s:{...S}};return r(v)}}})))}};Pt=fa([Jn(0,x.Inject(Y.SheetInterceptorService)),Jn(1,x.Inject(u.ConditionalFormattingService))],Pt);const Qn=[Y.SetWorksheetActiveOperation.id,u.AddConditionalRuleMutation.id,u.SetConditionalRuleMutation.id,u.DeleteConditionalRuleMutation.id,u.MoveConditionalRuleMutation.id],rt=[{label:{name:"sheet.cf.ruleType.highlightCell",selectable:!1},value:ve.highlightCell},{label:{name:"sheet.cf.panel.rankAndAverage",selectable:!1},value:ve.rank},{label:{name:"sheet.cf.ruleType.formula",selectable:!1},value:ve.formula},{label:{name:"sheet.cf.ruleType.colorScale",selectable:!1},value:ve.colorScale},{label:{name:"sheet.cf.ruleType.dataBar",selectable:!1},value:ve.dataBar},{label:{name:"sheet.cf.ruleType.iconSet",selectable:!1},value:ve.icon},{label:{name:"sheet.cf.menu.manageConditionalFormatting",selectable:!1},value:ve.viewRule},{label:{name:"sheet.cf.menu.createConditionalFormatting",selectable:!1},value:ve.createRule},{label:{name:"sheet.cf.menu.clearRangeRules",selectable:!1},value:ve.clearRangeRules,disabled:!1},{label:{name:"sheet.cf.menu.clearWorkSheetRules",selectable:!1},value:ve.clearWorkSheetRules}],pa=t=>{const e=t.get(Y.SheetsSelectionsService),r=t.get(x.ICommandService),n=t.get(x.IUniverInstanceService),o=t.get(u.ConditionalFormattingRuleModel),i=new Se.Observable(p=>Se.merge(e.selectionMoveEnd$,e.selectionSet$,new Se.Observable(S=>{const v=r.onCommandExecuted(T=>{var R;const{id:_,params:w}=T,b=(R=n.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET))==null?void 0:R.getUnitId();Qn.includes(_)&&w.unitId===b&&S.next(null)});return()=>v.dispose()})).pipe(it.debounceTime(16)).subscribe(()=>{var R;const S=((R=e.getCurrentSelections())==null?void 0:R.map(h=>h.range))||[],v=n.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET);if(!v)return;const T=v.getActiveSheet();if(!T)return;const b=(o.getSubunitRules(v.getUnitId(),T.getSheetId())||[]).filter(h=>h.ranges.some(a=>S.some(s=>x.Rectangle.intersects(s,a)))).map(h=>h.ranges).every(h=>Y.checkRangesEditablePermission(t,v.getUnitId(),T.getSheetId(),h));p.next(b)})),c=new Se.Observable(p=>new Se.Observable(S=>{const v=r.onCommandExecuted(T=>{var R;const{id:_,params:w}=T,b=(R=n.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET))==null?void 0:R.getUnitId();Qn.includes(_)&&w.unitId===b&&S.next(null)});return()=>v.dispose()}).pipe(it.debounceTime(16)).subscribe(()=>{const S=n.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET);if(!S)return;const v=S.getActiveSheet();if(!v)return;const T=o.getSubunitRules(S.getUnitId(),v.getSheetId())||[];if(!T.length)return p.next(!1),!1;const _=T.map(w=>w.ranges).every(w=>Y.checkRangesEditablePermission(t,S.getUnitId(),v.getSheetId(),w));p.next(_)})),y=new Se.Observable(p=>{i.subscribe(S=>{const v=rt.find(T=>T.value===ve.clearRangeRules);v&&(v.disabled=!S,p.next(rt))}),c.subscribe(S=>{const v=rt.find(T=>T.value===ve.clearWorkSheetRules);v&&(v.disabled=!S,p.next(rt))}),p.next(rt)});return{id:pt.id,type:ee.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:y,hidden$:ee.getMenuHiddenObservable(t,x.UniverInstanceType.UNIVER_SHEET),disabled$:de.getCurrentRangeDisable$(t,{workbookTypes:[Y.WorkbookEditablePermission],worksheetTypes:[Y.WorksheetSetCellStylePermission,Y.WorksheetEditPermission],rangeTypes:[Y.RangeProtectionPermissionEditPoint]})}},ha={[ee.RibbonStartGroup.FORMULAS_INSERT]:{[pt.id]:{order:0,menuItemFactory:pa}}};var ma=Object.getOwnPropertyDescriptor,ga=(t,e,r,n)=>{for(var o=n>1?void 0:n?ma(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},er=(t,e)=>(r,n)=>e(r,n,t);let Ft=class extends x.Disposable{constructor(e,r){super();Ie(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=r,this._menuManagerService.mergeMenu(ha)}};Ft=ga([er(0,x.Inject(x.Injector)),er(1,ee.IMenuManagerService)],Ft);var va=Object.getOwnPropertyDescriptor,ya=(t,e,r,n)=>{for(var o=n>1?void 0:n?va(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},Ve=(t,e)=>(r,n)=>e(r,n,t);const Ca=(t,e)=>{const r=v=>v.endRow-v.startRow+1,n=v=>v.endColumn-v.startColumn+1,o=r(e)%r(t),i=n(e)%n(t),c=Math.floor(r(e)/r(t)),y=Math.floor(n(e)/n(t)),p=[],S={startRow:0,endRow:r(t)-1,startColumn:0,endColumn:n(t)-1};if(r(e)===1&&n(e)===1){const v={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return p.push({repeatRelativeRange:S,startRange:v}),p}for(let v=0;v<c+(o?.1:0);v++)for(let T=0;T<y+(i?.1:0);T++){const _=r(t)*v,w=n(t)*T,b={startRow:_+e.startRow,endRow:_+e.startRow,startColumn:w+e.startColumn,endColumn:w+e.startColumn};let R=S;v===c&&o&&(R={...R},R.endRow=R.endRow-(r(t)-o)),T===y&&i&&(R={...R},R.endColumn=R.endColumn-(n(t)-i)),p.push({repeatRelativeRange:R,startRange:b})}return p};let Dt=class extends x.Disposable{constructor(e,r,n,o,i,c){super();Ie(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=r,this._formatPainterService=n,this._sheetsSelectionsService=o,this._conditionalFormattingRuleModel=i,this._conditionalFormattingViewModel=c,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),r=(i,c,y,p,S)=>{const{unitId:v,subUnitId:T}=this._painterConfig,{targetUnitId:_,targetSubUnitId:w}=S,b={startRow:i.row,startColumn:i.col,endColumn:i.col,endRow:i.row},R={startRow:c.row,startColumn:c.col,endColumn:c.col,endRow:c.row};x.Range.foreach(y,(h,a)=>{const s=x.Rectangle.getPositionRange({startRow:h,startColumn:a,endColumn:a,endRow:h},b),f=x.Rectangle.getPositionRange({startRow:h,startColumn:a,endColumn:a,endRow:h},R),C=this._conditionalFormattingViewModel.getCellCfs(v,T,s.startRow,s.startColumn),l=this._conditionalFormattingViewModel.getCellCfs(_,w,f.startRow,f.startColumn);l&&l.forEach(m=>{let d=p.get(m.cfId);if(!p.get(m.cfId)){const g=this._conditionalFormattingRuleModel.getRule(_,w,m.cfId);if(!g)return;d=new x.ObjectMatrix,g.ranges.forEach(F=>{x.Range.foreach(F,(D,U)=>{d.setValue(D,U,1)})}),p.set(m.cfId,d)}d.realDeleteValue(f.startRow,f.startColumn)}),C&&C.forEach(m=>{const d=p.get(m.cfId);d&&d.setValue(f.startRow,f.startColumn,1)})})},n=(i,c,y)=>{var s;const{range:p,unitId:S,subUnitId:v}=this._painterConfig,T=i!==S||v!==c,_=new Map,w=[],b=[];if(!i||!c||!S||!v)return e();const R=(s=this._conditionalFormattingRuleModel.getSubunitRules(S,v))!=null?s:[];R==null||R.forEach(f=>{const{ranges:C,cfId:l}=f;if(C.some(m=>x.Rectangle.intersects(p,m))){const m=new x.ObjectMatrix;T||C.forEach(d=>{x.Range.foreach(d,(g,F)=>{m.setValue(g,F,1)})}),_.set(l,m)}});const h={row:p.startRow,col:p.startColumn};return Ca(p,y).forEach(f=>{r(h,{row:f.startRange.startRow,col:f.startRange.startColumn},f.repeatRelativeRange,_,{targetUnitId:i,targetSubUnitId:c})}),_.forEach((f,C)=>{if(T){const l=this._conditionalFormattingRuleModel.getRule(i,c,C),m=Y.findAllRectangle(Y.createTopMatrixFromMatrix(f));if(l)if(m.length){const d={unitId:i,subUnitId:c,rule:{...l,ranges:m}};w.push({id:u.SetConditionalRuleMutation.id,params:d}),b.push(...u.setConditionalRuleMutationUndoFactory(this._injector,d))}else{const d={unitId:i,subUnitId:c,cfId:l.cfId};w.push({id:u.DeleteConditionalRuleMutation.id,params:d}),b.push(...u.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}else if(m.length){const d=this._conditionalFormattingRuleModel.getRule(S,v,C);if(d){const g={unitId:i,subUnitId:c,rule:{...x.Tools.deepClone(d),cfId:this._conditionalFormattingRuleModel.createCfId(i,c),ranges:m}};w.push({id:u.AddConditionalRuleMutation.id,params:g}),b.push(u.AddConditionalRuleMutationUndoFactory(this._injector,g))}}}else{const l=this._conditionalFormattingRuleModel.getRule(S,v,C);if(!l)return;const m=Y.findAllRectangle(Y.createTopMatrixFromMatrix(f));if(m.length){const d={unitId:S,subUnitId:v,rule:{...l,ranges:m}};w.push({id:u.SetConditionalRuleMutation.id,params:d}),b.push(...u.setConditionalRuleMutationUndoFactory(this._injector,d))}else{const d={unitId:S,subUnitId:v,cfId:l.cfId};w.push({id:u.DeleteConditionalRuleMutation.id,params:d}),b.push(...u.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}}}),{undos:b,redos:w}},o={id:u.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:i=>{var c,y,p;switch(i){case de.FormatPainterStatus.INFINITE:case de.FormatPainterStatus.ONCE:{const S=(c=this._univerInstanceService.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET))==null?void 0:c.getUnitId(),v=(p=(y=this._univerInstanceService.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getActiveSheet())==null?void 0:p.getSheetId(),T=this._sheetsSelectionsService.getCurrentLastSelection(),_=T==null?void 0:T.range;S&&v&&_&&(this._painterConfig={unitId:S,subUnitId:v,range:_});break}case de.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(i,c,y)=>this._painterConfig?n(i,c,y):{redos:[],undos:[]}};this._formatPainterService.addHook(o)}};Dt=ya([Ve(0,x.Inject(x.Injector)),Ve(1,x.Inject(x.IUniverInstanceService)),Ve(2,x.Inject(de.IFormatPainterService)),Ve(3,x.Inject(Y.SheetsSelectionsService)),Ve(4,x.Inject(u.ConditionalFormattingRuleModel)),Ve(5,x.Inject(u.ConditionalFormattingViewModel))],Dt);var ba=Object.getOwnPropertyDescriptor,Sa=(t,e,r,n)=>{for(var o=n>1?void 0:n?ba(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},Gt=(t,e)=>(r,n)=>e(r,n,t);let Mt=class extends x.Disposable{constructor(t,e,r){super(),this._conditionalFormattingViewModel=t,this._univerInstanceService=e,this._renderManagerService=r,this._init()}_init(){const t=this._univerInstanceService.getCurrentUnitForType(x.UniverInstanceType.UNIVER_SHEET),e=r=>{const n=r.getUnitId(),o=this._renderManagerService.getRenderById(n);if(!o)return;const i=o.with(de.SheetSkeletonManagerService);this.disposeWithMe(i.currentSkeleton$.subscribe(c=>{if(c){const y=c.skeleton.rowColumnSegment,p=y.endColumn-y.startColumn+1,v=(y.endRow-y.startRow+1)*p*9,T=Math.max(u.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,v);this._conditionalFormattingViewModel.setCacheLength(T)}}))};t&&e(t),this._univerInstanceService.getCurrentTypeOfUnit$(x.UniverInstanceType.UNIVER_SHEET).subscribe(r=>{r&&e(r)})}};Mt=Sa([Gt(0,x.Inject(u.ConditionalFormattingViewModel)),Gt(1,x.IUniverInstanceService),Gt(2,nr.IRenderManagerService)],Mt);var Ra=Object.defineProperty,Ta=Object.getOwnPropertyDescriptor,wa=(t,e,r)=>e in t?Ra(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,xa=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ta(e,r):e,i=t.length-1,c;i>=0;i--)(c=t[i])&&(o=c(o)||o);return o},Xt=(t,e)=>(r,n)=>e(r,n,t),Tr=(t,e,r)=>wa(t,typeof e!="symbol"?e+"":e,r);exports.UniverSheetsConditionalFormattingUIPlugin=class extends x.Plugin{constructor(e=Et,r,n,o){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=o;const{menu:i,...c}=x.merge({},Et,this._config);i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(Sr,c),this._initCommand()}onStarting(){x.registerDependencies(this._injector,[[ct],[ut],[st],[Ot],[lt],[at],[Ft],[ke],[Pt],[exports.ConditionalFormattingClearController],[Dt],[Mt]]),x.touchDependencies(this._injector,[[ct]])}onReady(){x.touchDependencies(this._injector,[[Ft],[at]])}onRendered(){x.touchDependencies(this._injector,[[Ot],[exports.ConditionalFormattingClearController],[st],[Pt],[ke],[Dt],[lt],[ut],[Mt]])}_initCommand(){[Zt,Jt,Qt,en,tn,nn,rn,on,an,pt].forEach(e=>{this._commandService.registerCommand(e)})}};Tr(exports.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${u.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`);Tr(exports.UniverSheetsConditionalFormattingUIPlugin,"type",x.UniverInstanceType.UNIVER_SHEET);exports.UniverSheetsConditionalFormattingUIPlugin=xa([x.DependentOn(u.UniverSheetsConditionalFormattingPlugin),Xt(1,x.Inject(x.Injector)),Xt(2,x.Inject(x.ICommandService)),Xt(3,x.IConfigService)],exports.UniverSheetsConditionalFormattingUIPlugin);exports.AddAverageCfCommand=Zt;exports.AddColorScaleConditionalRuleCommand=Jt;exports.AddDataBarConditionalRuleCommand=Qt;exports.AddDuplicateValuesCfCommand=en;exports.AddNumberCfCommand=tn;exports.AddRankCfCommand=nn;exports.AddTextCfCommand=rn;exports.AddTimePeriodCfCommand=on;exports.AddUniqueValuesCfCommand=an;exports.OpenConditionalFormattingOperator=pt;