@univerjs/preset-sheets-conditional-formatting 0.10.9 → 0.10.10-experimental.20251016-33b0941

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/index.css CHANGED
@@ -1 +1 @@
1
- .univer-pointer-events-none{pointer-events:none}.univer-absolute{position:absolute}.univer-relative{position:relative}.univer-bottom-\[-13px\]{bottom:-13px}.univer-left-0{left:0}.univer-right-1{right:.25rem}.univer-z-\[999\]{z-index:999}.univer-my-2\.5{margin-top:.625rem;margin-bottom:.625rem}.univer-mb-1{margin-bottom:.25rem}.univer-mb-2{margin-bottom:.5rem}.univer-mb-2\.5{margin-bottom:.625rem}.univer-mb-3{margin-bottom:.75rem}.univer-ml-1{margin-left:.25rem}.univer-ml-2{margin-left:.5rem}.univer-ml-3{margin-left:.75rem}.univer-ml-6{margin-left:1.5rem}.univer-mr-2{margin-right:.5rem}.univer-mt-0{margin-top:0}.univer-mt-1{margin-top:.25rem}.univer-mt-3{margin-top:.75rem}.univer-mt-4{margin-top:1rem}.univer-mt-5{margin-top:1.25rem}.univer-mt-6{margin-top:1.5rem}.univer-box-border{box-sizing:border-box}.univer-flex{display:flex}.univer-grid{display:grid}.univer-hidden{display:none}.univer-size-4{width:1rem;height:1rem}.univer-size-5{width:1.25rem;height:1.25rem}.univer-size-6{width:1.5rem;height:1.5rem}.univer-h-5{height:1.25rem}.univer-h-8{height:2rem}.univer-h-full{height:100%}.univer-w-1\/2{width:50%}.univer-w-36{width:9rem}.univer-w-64{width:16rem}.univer-w-80{width:20rem}.univer-w-\[45\%\]{width:45%}.univer-w-full{width:100%}.univer-min-w-0{min-width:0px}.univer-min-w-\[72px\]{min-width:72px}.univer-max-w-full{max-width:100%}.univer-flex-shrink{flex-shrink:1}.univer-flex-shrink-0{flex-shrink:0}.univer-cursor-grab{cursor:grab}.univer-cursor-pointer{cursor:pointer}.univer-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.univer-flex-col{flex-direction:column}.univer-flex-wrap{flex-wrap:wrap}.univer-items-center{align-items:center}.univer-justify-end{justify-content:flex-end}.univer-justify-center{justify-content:center}.univer-justify-between{justify-content:space-between}.univer-gap-2{gap:.5rem}.univer-gap-4{gap:1rem}.univer-overflow-hidden{overflow:hidden}.univer-rounded{border-radius:.25rem}.univer-rounded-lg{border-radius:.5rem}.univer-rounded-md{border-radius:.375rem}.univer-border{border-width:1px}.univer-border-solid{border-style:solid}.univer-border-red-500{border-color:var(--univer-red-500)}.\!univer-bg-gray-700{background-color:var(--univer-gray-700)!important}.univer-bg-gray-100{background-color:var(--univer-gray-100)}.univer-bg-white{background-color:var(--univer-white)}.univer-fill-primary-600{fill:var(--univer-primary-600)}.univer-p-1{padding:.25rem}.univer-p-4{padding:1rem}.univer-px-1{padding-left:.25rem;padding-right:.25rem}.univer-px-4{padding-left:1rem;padding-right:1rem}.univer-py-2{padding-top:.5rem;padding-bottom:.5rem}.univer-py-4{padding-top:1rem;padding-bottom:1rem}.univer-pl-1{padding-left:.25rem}.univer-pl-5{padding-left:1.25rem}.univer-pr-8{padding-right:2rem}.univer-pt-2{padding-top:.5rem}.univer-text-\[10px\]{font-size:10px}.univer-text-sm{font-size:.875rem;line-height:1.25rem}.univer-text-xs{font-size:.75rem;line-height:1rem}.univer-font-bold{font-weight:700}.univer-font-medium{font-weight:500}.univer-italic{font-style:italic}.univer-text-gray-300{color:var(--univer-gray-300)}.univer-text-gray-400{color:var(--univer-gray-400)}.univer-text-gray-600{color:var(--univer-gray-600)}.univer-text-gray-900{color:var(--univer-gray-900)}.univer-text-red-500{color:var(--univer-red-500)}.univer-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.univer-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:univer-border-primary-600:hover{border-color:var(--univer-primary-600)}.hover\:univer-bg-gray-100:hover{background-color:var(--univer-gray-100)}.hover\:univer-bg-gray-200:hover{background-color:var(--univer-gray-200)}.univer-group:hover .group-hover\:univer-flex{display:flex}.dark\:\!univer-bg-gray-700:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)!important}.dark\:\!univer-text-gray-200:where(.univer-dark,.univer-dark *){color:var(--univer-gray-200)!important}.dark\:\!univer-text-white:where(.univer-dark,.univer-dark *){color:var(--univer-white)!important}.dark\:hover\:\!univer-bg-gray-700:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)!important}.\[\&\>div\:first-child\]\:univer-px-2\.5>div:first-child{padding-left:.625rem;padding-right:.625rem}.\[\&\>div\]\:univer-h-5>div{height:1.25rem}.\[\&\>div\]\:univer-ring-transparent>div{--univer-tw-ring-color: transparent }.\[\&_\.react-grid-item\]\:univer-transition-none .react-grid-item{transition-property:none}.\[\&_\.react-grid-placeholder\]\:univer-rounded .react-grid-placeholder{border-radius:.25rem}.\[\&_\.react-grid-placeholder\]\:\!univer-bg-gray-200 .react-grid-placeholder{background-color:var(--univer-gray-200)!important}
1
+ .univer-pointer-events-none{pointer-events:none}.univer-absolute{position:absolute}.univer-relative{position:relative}.univer-bottom-\[-13px\]{bottom:-13px}.univer-left-0{left:0}.univer-right-1{right:.25rem}.univer-z-\[999\]{z-index:999}.univer-my-2\.5{margin-top:.625rem;margin-bottom:.625rem}.univer-mb-1{margin-bottom:.25rem}.univer-mb-2{margin-bottom:.5rem}.univer-mb-2\.5{margin-bottom:.625rem}.univer-mb-3{margin-bottom:.75rem}.univer-ml-1{margin-left:.25rem}.univer-ml-2{margin-left:.5rem}.univer-ml-3{margin-left:.75rem}.univer-ml-6{margin-left:1.5rem}.univer-mr-2{margin-right:.5rem}.univer-mt-0{margin-top:0}.univer-mt-1{margin-top:.25rem}.univer-mt-3{margin-top:.75rem}.univer-mt-4{margin-top:1rem}.univer-mt-5{margin-top:1.25rem}.univer-mt-6{margin-top:1.5rem}.univer-box-border{box-sizing:border-box}.univer-flex{display:flex}.univer-grid{display:grid}.univer-hidden{display:none}.univer-size-4{width:1rem;height:1rem}.univer-size-5{width:1.25rem;height:1.25rem}.univer-size-6{width:1.5rem;height:1.5rem}.univer-h-5{height:1.25rem}.univer-h-8{height:2rem}.univer-h-full{height:100%}.univer-w-1\/2{width:50%}.univer-w-36{width:9rem}.univer-w-64{width:16rem}.univer-w-80{width:20rem}.univer-w-\[45\%\]{width:45%}.univer-w-full{width:100%}.univer-min-w-0{min-width:0px}.univer-min-w-\[72px\]{min-width:72px}.univer-max-w-full{max-width:100%}.univer-flex-shrink{flex-shrink:1}.univer-flex-shrink-0{flex-shrink:0}.univer-cursor-grab{cursor:grab}.univer-cursor-pointer{cursor:pointer}.univer-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.univer-flex-col{flex-direction:column}.univer-flex-wrap{flex-wrap:wrap}.univer-items-center{align-items:center}.univer-justify-end{justify-content:flex-end}.univer-justify-center{justify-content:center}.univer-justify-between{justify-content:space-between}.univer-gap-2{gap:.5rem}.univer-gap-4{gap:1rem}.univer-overflow-hidden{overflow:hidden}.univer-rounded{border-radius:.25rem}.univer-rounded-lg{border-radius:.5rem}.univer-rounded-md{border-radius:.375rem}.univer-border{border-width:1px}.univer-border-solid{border-style:solid}.univer-border-red-500{border-color:var(--univer-red-500)}.\!univer-bg-gray-700{background-color:var(--univer-gray-700)!important}.univer-bg-gray-100{background-color:var(--univer-gray-100)}.univer-bg-white{background-color:var(--univer-white)}.univer-fill-primary-600{fill:var(--univer-primary-600)}.univer-p-1{padding:.25rem}.univer-p-4{padding:1rem}.univer-px-1{padding-left:.25rem;padding-right:.25rem}.univer-px-4{padding-left:1rem;padding-right:1rem}.univer-py-2{padding-top:.5rem;padding-bottom:.5rem}.univer-py-4{padding-top:1rem;padding-bottom:1rem}.univer-pl-1{padding-left:.25rem}.univer-pl-5{padding-left:1.25rem}.univer-pr-8{padding-right:2rem}.univer-pt-2{padding-top:.5rem}.univer-text-\[10px\]{font-size:10px}.univer-text-sm{font-size:.875rem;line-height:1.25rem}.univer-text-xs{font-size:.75rem;line-height:1rem}.univer-font-bold{font-weight:700}.univer-font-medium{font-weight:500}.univer-italic{font-style:italic}.univer-text-gray-300{color:var(--univer-gray-300)}.univer-text-gray-400{color:var(--univer-gray-400)}.univer-text-gray-600{color:var(--univer-gray-600)}.univer-text-gray-900{color:var(--univer-gray-900)}.univer-text-red-500{color:var(--univer-red-500)}.univer-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.univer-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.univer-group:hover .group-hover\:univer-flex{display:flex}.hover\:univer-border-primary-600:hover{border-color:var(--univer-primary-600)}.hover\:univer-bg-gray-100:hover{background-color:var(--univer-gray-100)}.hover\:univer-bg-gray-200:hover{background-color:var(--univer-gray-200)}.dark\:\!univer-bg-gray-700:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)!important}.dark\:\!univer-text-gray-200:where(.univer-dark,.univer-dark *){color:var(--univer-gray-200)!important}.dark\:\!univer-text-white:where(.univer-dark,.univer-dark *){color:var(--univer-white)!important}.dark\:hover\:\!univer-bg-gray-700:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)!important}.\[\&\>div\:first-child\]\:univer-px-2\.5>div:first-child{padding-left:.625rem;padding-right:.625rem}.\[\&\>div\]\:univer-h-5>div{height:1.25rem}.\[\&\>div\]\:univer-ring-transparent>div{--univer-tw-ring-color: transparent }.\[\&_\.react-grid-item\]\:univer-transition-none .react-grid-item{transition-property:none}.\[\&_\.react-grid-placeholder\]\:univer-rounded .react-grid-placeholder{border-radius:.25rem}.\[\&_\.react-grid-placeholder\]\:\!univer-bg-gray-200 .react-grid-placeholder{background-color:var(--univer-gray-200)!important}
package/lib/umd/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @univerjs/sheets-conditional-formatting/index
2
- (function(C,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("rxjs"),require("@univerjs/engine-formula"),require("rxjs/operators"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","rxjs","@univerjs/engine-formula","rxjs/operators","@univerjs/engine-render"],u):(C=typeof globalThis<"u"?globalThis:C||self,u(C.UniverSheetsConditionalFormatting={},C.UniverCore,C.UniverSheets,C.rxjs,C.UniverEngineFormula,C.rxjs.operators,C.UniverEngineRender))})(this,(function(C,u,p,K,V,i2,q){"use strict";var p0=Object.defineProperty;var A0=(C,u,p)=>u in C?p0(C,u,{enumerable:!0,configurable:!0,writable:!0,value:p}):C[u]=p;var F=(C,u,p)=>A0(C,typeof u!="symbol"?u+"":u,p);var u2;const h2="SHEET_CONDITIONAL_FORMATTING_PLUGIN";var b=(a=>(a.beginsWith="beginsWith",a.endsWith="endsWith",a.containsText="containsText",a.notContainsText="notContainsText",a.equal="equal",a.notEqual="notEqual",a.containsBlanks="containsBlanks",a.notContainsBlanks="notContainsBlanks",a.containsErrors="containsErrors",a.notContainsErrors="notContainsErrors",a))(b||{}),L=(a=>(a.today="today",a.yesterday="yesterday",a.tomorrow="tomorrow",a.last7Days="last7Days",a.thisMonth="thisMonth",a.lastMonth="lastMonth",a.nextMonth="nextMonth",a.thisWeek="thisWeek",a.lastWeek="lastWeek",a.nextWeek="nextWeek",a))(L||{}),E=(a=>(a.greaterThan="greaterThan",a.greaterThanOrEqual="greaterThanOrEqual",a.lessThan="lessThan",a.lessThanOrEqual="lessThanOrEqual",a.notBetween="notBetween",a.between="between",a.equal="equal",a.notEqual="notEqual",a))(E||{}),R=(a=>(a.highlightCell="highlightCell",a.dataBar="dataBar",a.colorScale="colorScale",a.iconSet="iconSet",a))(R||{}),_=(a=>(a.uniqueValues="uniqueValues",a.duplicateValues="duplicateValues",a.rank="rank",a.text="text",a.timePeriod="timePeriod",a.number="number",a.average="average",a.formula="formula",a))(_||{}),x=(a=>(a.num="num",a.min="min",a.max="max",a.percent="percent",a.percentile="percentile",a.formula="formula",a))(x||{});const X2="#fff",Y2="#000000",K2=()=>({cfId:void 0,ranges:[],stopIfTrue:!1,rule:{type:"highlightCell",subType:"text",operator:"containsText"}}),J2=(a,r)=>{switch(a){case"text":{if(["beginsWith","containsText","endsWith","equal","notContainsText","notEqual"].includes(r))return"";break}case"number":return["between","notBetween"].includes(r)?[10,100]:10}return""},z2=(a,r)=>{switch(a){case"formula":return"=";case"max":case"min":return"";case"percent":case"percentile":case"num":return r!==void 0?r:10}return""},O=(a,r,n)=>{if(!r)return null;const e=r.findIndex(t=>n(t)===a.id);if(e<0)return null;switch(a.type){case"after":return e+1;case"before":return e-1;case"self":return e}},E2=(a,r,n,e)=>{if(!n)return null;const t=O(a,n,e);let i=O(r,n,e);if(t===null||i===null||t===i)return;const s=n.splice(t,1)[0];switch(t<i&&(i=O(r,n,e)),r.type){case"before":{n.splice(i+1,0,s);break}case"self":case"after":{n.splice(i,0,s);break}}},g2=(a,r,n,e)=>{if(a.type==="after"&&["after","before"].includes(r.type))return[a,r];const t={...a},i={...r};if(t.type!=="after"){const s=O(t,n,e);if(s===null)return null;if(s-1<0){const o=n[s+1];if(o)t.id=e(o),t.type="before";else return null}else{const o=e(n[s-1]);t.id=o,t.type="after"}}if(!["after","before"].includes(i.type)){const s=O(i,n,e);if(s===null)return null;if(s===0)i.type="before";else if(s-1>=0){const o=e(n[s-1]);i.id=o,i.type="after"}else if(s+1<=n.length-1){const o=e(n[s+1]);i.id=o,i.type="before"}else return null}return t.id===i.id&&t.type===i.type?null:[t,i]},p2=(a,r)=>{if(["after","before"].includes(r.type)){if(a.type==="after")return[r,a];if(a.type==="before")return[r,{...a,type:"self"}]}return null},Q2=(a,r)=>a.id===r.id&&a.type===r.type,A2=()=>`${u.generateRandomId(8)}`;class I{constructor(){F(this,"_model",new Map);F(this,"_ruleChange$",new K.Subject);F(this,"$ruleChange",this._ruleChange$.asObservable())}_ensureList(r,n){let e=this.getSubunitRules(r,n);if(!e){e=[];let t=this._model.get(r);t||(t=new Map,this._model.set(r,t)),t.set(n,e)}return e}getRule(r,n,e){const t=this.getSubunitRules(r,n);return t?t.find(i=>i.cfId===e):null}getUnitRules(r){return this._model.get(r)||null}getSubunitRules(r,n){var t;return((t=this._model.get(r))==null?void 0:t.get(n))||null}deleteRule(r,n,e){const t=this.getSubunitRules(r,n);if(t){const i=t.findIndex(o=>o.cfId===e),s=t[i];s&&(t.splice(i,1),this._ruleChange$.next({rule:s,subUnitId:n,unitId:r,type:"delete"}))}}setRule(r,n,e,t){const s=this._ensureList(r,n).find(o=>o.cfId===t);if(s){const o=u.Tools.deepClone(s);Object.assign(s,e),this._ruleChange$.next({rule:s,subUnitId:n,unitId:r,type:"set",oldRule:o})}}addRule(r,n,e){const t=this._ensureList(r,n);t.find(s=>s.cfId===e.cfId)||t.unshift(e),this._ruleChange$.next({rule:e,subUnitId:n,unitId:r,type:"add"})}moveRulePriority(r,n,e,t){const i=this._ensureList(r,n),s=O(e,i,l=>l.cfId),o=O(t,i,l=>l.cfId);if(o===null||s===null||o===s)return;const d=i[s];d&&(E2(e,t,i,l=>l.cfId),this._ruleChange$.next({rule:d,subUnitId:n,unitId:r,type:"sort"}))}createCfId(r,n){return A2()}deleteUnitId(r){this._model.delete(r)}}const Z={type:u.CommandType.MUTATION,id:"sheet.mutation.move-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:n,subUnitId:e,start:t,end:i}=r;return a.get(I).moveRulePriority(n,e,t,i),!0}},y2=a=>{const{unitId:r,subUnitId:n}=a,e=p2(a.start,a.end);if(!e)return[];const[t,i]=e;return[{id:Z.id,params:{unitId:r,subUnitId:n,start:t,end:i}}]},J=(a,r)=>{const n=a.get(I),{unitId:e,subUnitId:t,cfId:i}=r,s=[...n.getSubunitRules(e,t)||[]],o=s.findIndex(l=>l.cfId===i),d=s[o-1];if(o>-1){const l=s[o],c=[{id:z.id,params:{unitId:e,subUnitId:t,rule:u.Tools.deepClone(l)}}];if(s.splice(o,1),o!==0){const h=s[0];if(h){const g=g2({id:h.cfId,type:"before"},{id:d.cfId,type:"after"},s,w=>w.cfId);if(!g)return c;const[D,m]=g,v={unitId:e,subUnitId:t,start:D,end:m};c.push({id:Z.id,params:v})}}return c}return[]},j={type:u.CommandType.MUTATION,id:"sheet.mutation.delete-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:n,subUnitId:e,cfId:t}=r;return a.get(I).deleteRule(n,e,t),!0}},_2=(a,r)=>({id:j.id,params:{unitId:r.unitId,subUnitId:r.subUnitId,cfId:r.rule.cfId}}),z={type:u.CommandType.MUTATION,id:"sheet.mutation.add-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:n,subUnitId:e,rule:t}=r;return a.get(I).addRule(n,e,t),!0}},M2={type:u.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(a,r){if(!r)return!1;const{rule:n}=r,e=a.get(u.IUndoRedoService),t=a.get(u.ICommandService),i=a.get(I),s=a.get(u.IUniverInstanceService),o=p.getSheetCommandTarget(s,r);if(!o)return!1;const{unitId:d,subUnitId:l}=o,c=i.createCfId(d,l),h={unitId:d,subUnitId:l,rule:{...n,cfId:n.cfId||c}},g=_2(a,h),D=t.syncExecuteCommand(z.id,h);return D&&e.pushUndoRedo({unitID:d,redoMutations:[{id:z.id,params:h}],undoMutations:[g]}),D}},G={type:u.CommandType.MUTATION,id:"sheet.mutation.set-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:n,subUnitId:e,rule:t}=r,i=r.cfId||r.rule.cfId;return a.get(I).setRule(n,e,t,i),!0}},C2=(a,r)=>{const n=a.get(I),{unitId:e,subUnitId:t}=r,i=r.cfId||r.rule.cfId,s=n.getRule(e,t,i);return s?[{id:G.id,params:{unitId:e,subUnitId:t,cfId:i,rule:u.Tools.deepClone(s)}}]:[]},I2={type:u.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(a,r){var v;if(!r)return!1;const n=a.get(I),e=a.get(u.IUniverInstanceService),t=a.get(u.ICommandService),i=a.get(u.IUndoRedoService),s=a.get(p.SheetsSelectionsService),o=p.getSheetCommandTarget(e,r);if(!o)return!1;const{unitId:d,subUnitId:l}=o,c=((v=s.getCurrentSelections())==null?void 0:v.map(w=>w.range))||[],h=n.getSubunitRules(d,l);if(!(h!=null&&h.length)||!c.length)return!1;const g=[],D=[];h.forEach(w=>{const A=new u.ObjectMatrix;w.ranges.forEach(y=>{u.Range.foreach(y,(M,N)=>{A.setValue(M,N,1)})}),c.forEach(y=>{u.Range.foreach(y,(M,N)=>{A.realDeleteValue(M,N)})});const S=p.findAllRectangle(p.createTopMatrixFromMatrix(A));if(S.length){const y={...w,ranges:S},M={unitId:d,subUnitId:l,rule:y},N=C2(a,M);g.push({id:G.id,params:M}),D.push(...N)}else{const y={unitId:d,subUnitId:l,cfId:w.cfId},M=J(a,y);g.push({id:j.id,params:y}),D.push(...M)}});const m=u.sequenceExecute(g,t).result;return m&&i.pushUndoRedo({unitID:d,redoMutations:g,undoMutations:D}),m}},R2={type:u.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(a,r){const n=a.get(I),e=a.get(u.IUniverInstanceService),t=a.get(u.ICommandService),i=a.get(u.IUndoRedoService),s=p.getSheetCommandTarget(e,r);if(!s)return!1;const{unitId:o,subUnitId:d}=s,l=n.getSubunitRules(o,d);if(!(l!=null&&l.length))return!1;const c=l.map(m=>({cfId:m.cfId,unitId:o,subUnitId:d})),h=c.map(m=>({id:j.id,params:m})),g=c.map(m=>J(a,m)[0]),D=u.sequenceExecute(h,t).result;return D&&i.pushUndoRedo({unitID:o,redoMutations:h,undoMutations:g}),D}},x2={type:u.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(a,r){if(!r)return!1;const n=a.get(u.IUndoRedoService),e=a.get(u.ICommandService),t=a.get(u.IUniverInstanceService),i=p.getSheetCommandTarget(t,r);if(!i)return!1;const{unitId:s,subUnitId:o}=i,d={unitId:s,subUnitId:o,cfId:r.cfId},l=J(a,d),c=e.syncExecuteCommand(j.id,d);return c&&n.pushUndoRedo({unitID:s,undoMutations:l,redoMutations:[{id:j.id,params:d}]}),c}},S2={type:u.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(a,r){if(!r)return!1;const n=a.get(u.IUndoRedoService),e=a.get(u.ICommandService),t=a.get(u.IUniverInstanceService),i=a.get(I),s=p.getSheetCommandTarget(t,r);if(!s)return!1;const{unitId:o,subUnitId:d}=s,l=g2(r.start,r.end,i.getSubunitRules(o,d)||[],v=>v.cfId);if(!l)return!1;const[c,h]=l,g={unitId:o,subUnitId:d,start:c,end:h},D=y2(g),m=e.syncExecuteCommand(Z.id,g);return m&&n.pushUndoRedo({unitID:o,redoMutations:[{id:Z.id,params:g}],undoMutations:D}),m}},b2={type:u.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(a,r){if(!r)return!1;const n=a.get(u.IUndoRedoService),e=a.get(u.ICommandService),t=a.get(u.IUniverInstanceService),i=p.getSheetCommandTarget(t,r);if(!i)return!1;const{unitId:s,subUnitId:o}=i,d={unitId:s,subUnitId:o,rule:r.rule,cfId:r.cfId},l=C2(a,d),c=e.syncExecuteCommand(G.id,d);return c&&n.pushUndoRedo({unitID:s,undoMutations:l,redoMutations:[{id:G.id,params:d}]}),c}},Q={type:u.CommandType.MUTATION,id:"sheet.mutation.conditional-formatting-formula-mark-dirty",handler(){return!0}};var e0=Object.getOwnPropertyDescriptor,t0=(a,r,n,e)=>{for(var t=e>1?void 0:e?e0(r,n):r,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=s(t)||t);return t},D2=(a,r)=>(n,e)=>r(n,e,a),T=(a=>(a[a.NOT_REGISTER=1]="NOT_REGISTER",a[a.SUCCESS=2]="SUCCESS",a[a.WAIT=3]="WAIT",a[a.ERROR=4]="ERROR",a))(T||{});const n0=a=>{const r=a&&a[0]&&a[0][0];return(r==null?void 0:r.t)===u.CellValueType.BOOLEAN?r.v===u.BooleanNumber.TRUE||r.v===!0:r?r.v:!1};C.ConditionalFormattingFormulaService=class extends u.Disposable{constructor(n,e,t){super();F(this,"_formulaMap",new Map);F(this,"_result$",new K.Subject);F(this,"result$",this._result$.asObservable());this._commandService=n,this._activeDirtyManagerService=e,this._conditionalFormattingRuleModel=t,this._initFormulaCalculationResultChange(),this._initRuleChange()}_initRuleChange(){const n=e=>{switch(e.type){case R.colorScale:return e.config.some(t=>t.value.type===x.formula);case R.dataBar:return[e.config.max,e.config.min].some(t=>t.type===x.formula);case R.iconSet:return e.config.some(t=>t.value.type===x.formula)}};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(e=>{const{unitId:t,subUnitId:i,rule:s,oldRule:o}=e;e.type==="delete"&&this._removeFormulaByCfId(t,i,s.cfId),e.type==="set"&&(n(s.rule)||o&&n(o.rule))&&this._removeFormulaByCfId(t,i,s.cfId)}))}_initFormulaCalculationResultChange(){this.disposeWithMe(this._commandService.onCommandExecuted(n=>{if(n.id===V.SetFormulaCalculationResultMutation.id){const e=n.params;for(const t in e.unitOtherData)for(const i in e.unitOtherData[t])for(const s in e.unitOtherData[t][i]){const o=new u.ObjectMatrix(e.unitOtherData[t][i][s]),d=this._ensureSubunitFormulaMap(t,i).getValue(s,["formulaId"]);if(!d)continue;const l=d.ranges;if(!l)continue;const c=d.result,h=l[0].startRow,g=l[0].startColumn;o.forValue((v,w,A)=>{c.setValue(h+v,g+w,n0(A))}),d.status=2;const m=this._getAllFormulaResultByCfId(t,i,d.cfId).every(v=>v.status===2);this._result$.next({...d,isAllFinished:m})}}})),this._activeDirtyManagerService.register(Q.id,{commandId:Q.id,getDirtyData(n){return{dirtyUnitOtherFormulaMap:n.params}}})}_ensureSubunitFormulaMap(n,e){let t=this._formulaMap.get(n);t||(t=new Map,this._formulaMap.set(n,t));let i=t.get(e);return i||(i=new u.RefAlias([],["formulaId","id"]),t.set(e,i)),i}getSubUnitFormulaMap(n,e){var t;return(t=this._formulaMap.get(n))==null?void 0:t.get(e)}registerFormulaWithRange(n,e,t,i,s=[{startRow:0,endRow:0,startColumn:0,endColumn:0}]){const o=this._ensureSubunitFormulaMap(n,e),d=this.createCFormulaId(t,i);if(o.getValue(d,["id"]))return;const l=this._createFormulaId(n,e);o.addValue({formulaText:i,unitId:n,subUnitId:e,cfId:t,id:d,ranges:s,formulaId:l,status:3,result:new u.ObjectMatrix});const c={unitId:n,subUnitId:e,formulaMap:{[l]:{f:i,ranges:s}}};this._commandService.executeCommand(V.SetOtherFormulaMutation.id,c,{onlyLocal:!0}).then(()=>{this._commandService.executeCommand(Q.id,{[n]:{[e]:{[l]:!0}}},{onlyLocal:!0})})}_removeFormulaByCfId(n,e,t){const s=this.deleteCache(n,e,t).map(o=>o.formulaId);this._commandService.executeCommand(V.RemoveOtherFormulaMutation.id,{unitId:n,subUnitId:e,formulaIdList:s},{onlyLocal:!0})}getFormulaResultWithCoords(n,e,t,i,s=0,o=0){const d=this.getSubUnitFormulaMap(n,e);if(!d)return{status:1};const l=d.getValue(this.createCFormulaId(t,i),["id"]);return l?l.status===2&&l.result?{result:l.result.getValue(s,o),status:2}:l.status===3?{status:3}:{status:4}:{status:1}}getFormulaMatrix(n,e,t,i){const s=this.getSubUnitFormulaMap(n,e);if(!s)return{status:1};const o=s.getValue(this.createCFormulaId(t,i),["id"]);if(!o)return{status:1};if(o.status===2&&o.result)return{result:o.result,status:2}}deleteCache(n,e,t,i){const s=this.getSubUnitFormulaMap(n,e);if(!s)return[];if(i){const o=this.createCFormulaId(t,i);return s.deleteValue(o,["id"]),[]}else{const o=s.getValues().filter(d=>d.cfId===t);return o.forEach(d=>{s.deleteValue(d.formulaId,["formulaId"])}),o}}_getAllFormulaResultByCfId(n,e,t){const i=this.getSubUnitFormulaMap(n,e);return i?i.getValues().filter(o=>o.cfId===t):[]}_createFormulaId(n,e){return`sheet.cf_${n}_${e}_${u.generateRandomId(8)}`}createCFormulaId(n,e){return`${n}_${e}`}},C.ConditionalFormattingFormulaService=t0([D2(0,u.Inject(u.ICommandService)),D2(1,u.Inject(V.IActiveDirtyManagerService)),D2(2,u.Inject(I))],C.ConditionalFormattingFormulaService);var B=(a=>(a.preComputingStart="preComputingStart",a.preComputing="preComputing",a.preComputingEnd="preComputingEnd",a.preComputingError="preComputingError",a))(B||{});class a2{constructor(r){F(this,"_cache");F(this,"_preComputingStatus$",new K.BehaviorSubject("preComputingStart"));F(this,"preComputingStatus$",this._preComputingStatus$.asObservable().pipe(i2.distinctUntilChanged()));F(this,"_preComputingCache");F(this,"_rule");this._context=r,this._cache=new u.LRUMap(r.limit),this._rule=r.rule,this._preComputingCache=null,this._initClearCacheListener()}setCacheLength(r){this._cache.limit=r}clearCache(){this._cache.clear()}resetPreComputingCache(){this._preComputingStatus$.next("preComputingStart"),this._preComputingCache=null}updateRule(r){this._rule=r,this.resetPreComputingCache()}getCell(r,n){const e=this._createKey(r,n);if(this._preComputingStatus$.getValue()==="preComputing")return this._cache.get(e);let t=this.getPreComputingResult(r,n);if(t===null&&(this._preComputingStatus$.next("preComputingStart"),this.preComputing(r,n,this._getContext()),t=this.getPreComputingResult(r,n),t===null))return this._cache.get(e);if(this._preComputingStatus$.next("preComputingEnd"),this._cache.has(e))return this._cache.get(e);const i=this.getCellResult(r,n,t,this._getContext());return i!==null&&this._setCache(r,n,i),i}setPreComputingCache(r){this._preComputingCache=r}getPreComputingResult(r,n){return this._preComputingCache}_createKey(r,n){return`${r}_${n}`}_setCache(r,n,e){const t=this._createKey(r,n);this._cache.set(t,e)}_getContext(){return{...this._context,rule:this._rule}}_initClearCacheListener(){this.preComputingStatus$.subscribe(r=>{r==="preComputingEnd"&&this.clearCache()})}}class i0 extends a2{preComputing(r,n,e){const t=e.rule,i=e.worksheet,s=new u.ObjectMatrix;!t.rule.config.every(c=>c.value.type===x.num)&&o2(t.ranges,i.getMaxRows()-1,i.getMaxColumns()-1).forEach(h=>{u.Range.foreach(h,(g,D)=>{const m=e.getCellValue(g,D),v=m&&m.v;if(!k(v)&&(m==null?void 0:m.t)===u.CellValueType.NUMBER){const w=Number(v);!Number.isNaN(w)&&s.setValue(g,D,w)}})});const d=[...t.rule.config].sort((c,h)=>c.index-h.index).map(c=>({value:t2(c.value,s,{...e,cfId:t.cfId}),color:new u.ColorKit(c.color)}));if(!d.some(c=>q.isObject(c.value)?c.value.status!==T.SUCCESS:!1)){const c=d.map(h=>h.color).reduce((h,g,D)=>(h.result.push({color:g,value:h.sortValue[D]}),h),{result:[],sortValue:d.map(h=>h.value.result).sort((h,g)=>h-g)}).result;this.setPreComputingCache(c),this._preComputingStatus$.next(B.preComputingEnd);return}this._preComputingStatus$.next(B.preComputing)}getCellResult(r,n,e,t){if(!e)return null;const i=t.getCellValue(r,n);if(i.t===u.CellValueType.NUMBER){const s=Number(i.v);if(!Number.isNaN(s))return V2(e,s)}}}const L2="sheet-conditional-rule-data-bar",f2="#ffbe38",m2="#abd91a",T2="#000",a0=34;class k2 extends q.SheetExtension{constructor(){super(...arguments);F(this,"_paddingRightAndLeft",2);F(this,"_paddingTopAndBottom",2);F(this,"uKey",L2);F(this,"Z_INDEX",a0);F(this,"_radius",1)}draw(n,e,t,i){const{worksheet:s}=t;if(!s)return!1;n.save(),u.Range.foreach(t.rowColumnSegment,(o,d)=>{if(!s.getRowVisible(o)||!s.getColVisible(d))return;const l=s.getCell(o,d);if(l&&l.dataBar){const{color:c,value:h,startPoint:g,isGradient:D}=l.dataBar,m=t.getCellWithCoordByIndex(o,d,!1);let{isMerged:v,isMergedMainCell:w,mergeInfo:A,startY:S,endY:y,startX:M,endX:N}=m;if(v||(w&&(S=A.startY,y=A.endY,M=A.startX,N=A.endX),!this.isRenderDiffRangesByCell(A,i)))return;const c2=N-M,w2=y+q.FIX_ONE_PIXEL_BLUR_OFFSET-S,d2=c2-this._paddingRightAndLeft*2,H2=w2-this._paddingTopAndBottom*2;if(h>0){const Y=Math.max(d2*(1-g/100)*h/100,1),$=M+this._paddingRightAndLeft+g/100*d2,P=S+this._paddingTopAndBottom;if(D){const W=n.createLinearGradient($,P,$+Y,P);W.addColorStop(0,c),W.addColorStop(1,"rgb(255 255 255)"),n.fillStyle=W,n.strokeStyle=c,n.lineWidth=1}else n.fillStyle=c;this._drawRectWithRoundedCorner(n,$,P,Y,H2,!1,!0,!0,!1),D&&n.stroke()}else{const Y=Math.max(d2*g/100*Math.abs(h)/100,1),$=M+this._paddingRightAndLeft+g/100*d2-Y,P=S+this._paddingTopAndBottom;if(D){const W=n.createLinearGradient($,P,$+Y,P);W.addColorStop(0,"rgb(255 255 255)"),W.addColorStop(1,c),n.fillStyle=W,n.strokeStyle=c,n.lineWidth=1}else n.fillStyle=c;this._drawRectWithRoundedCorner(n,$,P,Y,H2,!0,!1,!1,!0),D&&n.stroke()}}}),n.restore()}_drawRectWithRoundedCorner(n,e,t,i,s,o,d,l,c){const h=this._radius;!s||!i||(n.beginPath(),n.moveTo(e+h,t),n.lineTo(e+i-h,t),d?n.arcTo(e+i,t,e+i,t+h,h):n.lineTo(e+i,t),n.lineTo(e+i,t+s-h),l?n.arcTo(e+i,t+s,e+i-h,t+s,h):n.lineTo(e+i,t+s),n.lineTo(e+h,t+s),c?n.arcTo(e,t+s,e,t+s-h,h):n.lineTo(e,t+s),n.lineTo(e,t+h),o?n.arcTo(e,t,e+h,t,h):n.lineTo(e,t),n.closePath(),n.fill())}}q.SpreadsheetExtensionRegistry.add(k2);const r2=a=>Math.max(Math.min(100,a),0),r0=(a,r,n)=>{const e=n(a,r);if(e&&e.t===u.CellValueType.NUMBER){const t=Number(e.v);return Number.isNaN(t)?null:t}return null};class s0 extends a2{preComputing(r,n,e){const t=e.rule,i=t.rule,s=e.worksheet,o=new u.ObjectMatrix;![t.rule.config.max,t.rule.config.min].every(D=>D.type===x.num)&&o2(t.ranges,s.getMaxRows()-1,s.getMaxColumns()-1).forEach(m=>{u.Range.foreach(m,(v,w)=>{const A=e.getCellValue(v,w),S=A&&A.v;if(!k(S)&&(A==null?void 0:A.t)===u.CellValueType.NUMBER){const y=Number(S);!Number.isNaN(y)&&o.setValue(v,w,y)}})});const l=t2(i.config.min,o,{...e,cfId:t.cfId}),c=t2(i.config.max,o,{...e,cfId:t.cfId});let h=0,g=0;if(l.status===T.SUCCESS){const D=Number(l.result);h=Number.isNaN(D)?0:D}else{this._preComputingStatus$.next(B.preComputing);return}if(c.status===T.SUCCESS){const D=Number(c.result),m=Number.isNaN(D)?0:D;g=Math.max(m,h),h=Math.min(m,h);let v=50;if(h<0&&g<=0)v=100;else if(h<0&&g>0){const w=Math.abs(g)+Math.abs(h);v=Math.abs(h)/w*100}else h>=0&&g>0&&(v=0);this.setPreComputingCache({min:h,max:g,startPoint:v}),this._preComputingStatus$.next(B.preComputingEnd);return}this._preComputingStatus$.next(B.preComputing)}getCellResult(r,n,e,t){const{min:i,max:s,startPoint:o}=e,l=t.rule.rule,c=l.isShowValue,h=l.config.isGradient,g=r0(r,n,t.getCellValue);if(!(g===null||g<i||i===s||s<i)){if(g===0)return{color:T2,startPoint:o,value:0,isGradient:h,isShowValue:c};if(i<0&&s<=0){const D=s-i,m=r2((s-g)/D*100);return m===0?void 0:{color:l.config.nativeColor||m2,startPoint:o,value:-m,isGradient:h,isShowValue:c}}else if(i<0&&s>0)if(g>0){const D=r2(Math.min(g/s,1)*100);return D===0?void 0:{color:l.config.positiveColor||f2,startPoint:o,value:D,isGradient:h,isShowValue:c}}else{const D=r2(Math.min(Math.abs(g)/Math.abs(i),1)*100);return D===0?void 0:{color:l.config.nativeColor||m2,startPoint:o,value:-D,isGradient:h,isShowValue:c}}else if(i>=0&&s>0){const D=s-i,m=0,v=r2((1-(s-g)/D)*100);return v===0?void 0:{color:l.config.positiveColor||f2,startPoint:m,value:v,isGradient:h,isShowValue:c}}}}}class l0 extends a2{preComputing(r,n,e){const t=e.rule.rule,i=e.rule.ranges,o=(()=>{switch(t.subType){case _.average:{let d=0,l=0;return i.forEach(c=>{u.Range.foreach(c,(h,g)=>{const D=e.getCellValue(h,g),m=U(D||void 0);D&&D.t===u.CellValueType.NUMBER&&m!==void 0&&(d+=Number(m)||0,l++)})}),{value:d/l,type:t.subType}}case _.uniqueValues:case _.duplicateValues:{const d=new Map;return i.forEach(l=>{u.Range.foreach(l,(c,h)=>{const g=e.getCellValue(c,h),D=U(g||void 0);if(D!==void 0){const m=d.get(D);m?d.set(D,m+1):d.set(D,1)}})}),{value:d,type:t.subType}}case _.rank:{let d=[];i.forEach(h=>{u.Range.foreach(h,(g,D)=>{const m=e.getCellValue(g,D),v=U(m||void 0);m&&m.t===u.CellValueType.NUMBER&&v!==void 0&&d.push(Number(v)||0)})}),d.sort((h,g)=>g-h);const l=e.rule.rule;if(l.isPercent){l.isBottom&&(d=d.toReversed());const h=u.Tools.clamp(l.value,0,100)/100,g=Math.floor(h*d.length),D=u.Tools.clamp(g-1,0,d.length-1);return{value:d[D],type:t.subType}}const c=Math.floor(u.Tools.clamp(l.isBottom?l.value-1:l.value,0,d.length));return l.isBottom?{value:d[d.length-c-1],type:t.subType}:{value:d[Math.max(c-1,0)],type:t.subType}}case _.formula:{const d=t,l=e.accessor.get(C.ConditionalFormattingFormulaService);l.registerFormulaWithRange(e.unitId,e.subUnitId,e.rule.cfId,d.value,e.rule.ranges);const c=l.getFormulaMatrix(e.unitId,e.subUnitId,e.rule.cfId,d.value);return c&&c.status===T.SUCCESS?(this._preComputingStatus$.next(B.preComputingEnd),{value:c.result,type:t.subType}):(this._preComputingStatus$.next(B.preComputing),null)}case _.timePeriod:switch(t.operator){case L.last7Days:return{value:{start:u.dayjs().subtract(7,"day").valueOf(),end:u.dayjs().valueOf()},type:t.subType};case L.lastMonth:return{value:{start:u.dayjs().startOf("month").subtract(1,"month").valueOf(),end:u.dayjs().endOf("month").subtract(1,"month").valueOf()},type:t.subType};case L.lastWeek:return{value:{start:u.dayjs().startOf("week").subtract(1,"week").valueOf(),end:u.dayjs().endOf("week").subtract(1,"week").valueOf()},type:t.subType};case L.nextMonth:return{value:{start:u.dayjs().startOf("month").add(1,"month").valueOf(),end:u.dayjs().endOf("month").add(1,"month").valueOf()},type:t.subType};case L.nextWeek:return{value:{start:u.dayjs().startOf("week").add(1,"week").valueOf(),end:u.dayjs().endOf("week").add(1,"week").valueOf()},type:t.subType};case L.thisMonth:return{value:{start:u.dayjs().startOf("month").valueOf(),end:u.dayjs().endOf("month").valueOf()},type:t.subType};case L.thisWeek:return{value:{start:u.dayjs().startOf("week").valueOf(),end:u.dayjs().endOf("week").valueOf()},type:t.subType};case L.today:return{value:{start:u.dayjs().startOf("day").valueOf(),end:u.dayjs().endOf("day").valueOf()},type:t.subType};case L.tomorrow:return{value:{start:u.dayjs().startOf("day").add(1,"day").valueOf(),end:u.dayjs().endOf("day").add(1,"day").valueOf()},type:t.subType};case L.yesterday:return{value:{start:u.dayjs().startOf("day").subtract(1,"day").valueOf(),end:u.dayjs().endOf("day").subtract(1,"day").valueOf()},type:t.subType}}}})();this.setPreComputingCache(o)}getCellResult(r,n,e,t){const i=t.getCellValue(r,n),s=t.rule.rule;return(()=>{switch(s.subType){case _.number:{const l=i&&Number(i.v),c=(i==null?void 0:i.t)===u.CellValueType.NUMBER,h=s;return c?k(l)||Number.isNaN(l)?void 0:H({operator:h.operator,value:h.value||0},l||0):!![E.notEqual,E.notBetween].includes(h.operator)}case _.text:{const l=s,c=U(i),h=c===null?"":String(c),g=l.value||"";switch(l.operator){case b.beginsWith:return h.startsWith(g);case b.containsBlanks:return/^\s*$/.test(h);case b.notContainsBlanks:return!/^\s*$/.test(h);case b.containsErrors:return V.ERROR_TYPE_SET.has(h);case b.notContainsErrors:return!V.ERROR_TYPE_SET.has(h);case b.containsText:return h.indexOf(g)>-1;case b.notContainsText:return h.indexOf(g)===-1;case b.endsWith:return h.endsWith(g);case b.equal:return h===g;case b.notEqual:return h!==g;default:return!1}}case _.timePeriod:{const l=U(i);if(k(l)||Number.isNaN(Number(l))||(i==null?void 0:i.t)!==u.CellValueType.NUMBER||!e)return;const c=N2(Number(l)),{start:h,end:g}=e.value;return c>=h&&c<=g}case _.average:{const l=i&&i.v,c=Number(l),h=(i==null?void 0:i.t)===u.CellValueType.NUMBER,g=s;if(!h)return E.notEqual===g.operator;if(k(l)||Number.isNaN(c)||!e)return!1;const D=e.value;switch(g.operator){case E.greaterThan:return c>D;case E.greaterThanOrEqual:return c>=D;case E.lessThan:return c<D;case E.lessThanOrEqual:return c<=D;case E.equal:return e2(c,D);case E.notEqual:return!e2(c,D);default:return!1}}case _.rank:{const l=U(i),c=Number(l);if(k(l)||Number.isNaN(c)||(i==null?void 0:i.t)!==u.CellValueType.NUMBER||!e)return!1;const h=e.value;return s.isBottom?c<=h:c>=h}case _.uniqueValues:{const l=U(i);return k(l)||!e?!1:e.value.get(l)===1}case _.duplicateValues:{const l=U(i);return k(l)||!e?!1:e.value.get(l)!==1}case _.formula:{const l=e==null?void 0:e.value;return l?l.getValue(r,n)===!0:!1}}})()?s.style:{}}}const o0=(a,r,n)=>{const e=n(a,r);if(e&&e.t===u.CellValueType.NUMBER){const t=Number(e.v);return Number.isNaN(t)?null:t}return null};class u0 extends a2{preComputing(r,n,e){const t=e.rule.rule,i=e.worksheet,s=new u.ObjectMatrix;!t.config.every(c=>c.value.type===x.num)&&o2(e.rule.ranges,i.getMaxRows()-1,i.getMaxColumns()-1).forEach(h=>{u.Range.foreach(h,(g,D)=>{const m=e.getCellValue(g,D),v=m&&m.v;if(!k(v)&&(m==null?void 0:m.t)===u.CellValueType.NUMBER){const w=Number(v);!Number.isNaN(w)&&s.setValue(g,D,w)}})});const d=t.config.map(c=>t2(c.value,s,{...e,cfId:e.rule.cfId}));if(!d.some(c=>c.status!==T.SUCCESS)){const c=d.map((h,g)=>({operator:t.config[g].operator,value:Number(h.result)||0})).reduce((h,g,D,m)=>{const v=t.config[D];if(!D||D===m.length-1)h.push({...g,iconId:v.iconId,iconType:v.iconType});else{const w=m[D-1];H(w,g.value)||h.push({...g,iconId:v.iconId,iconType:v.iconType})}return h},[]);this.setPreComputingCache(c),this._preComputingStatus$.next(B.preComputingEnd);return}this._preComputingStatus$.next(B.preComputing)}getCellResult(r,n,e,t){if(!e)return null;const i=o0(r,n,t.getCellValue);if(i===null)return;const s=t.rule.rule,o=s.isShowValue===void 0?!0:!!s.isShowValue;for(let d=0;d<e.length;d++){const l=e[d],c={...l},h={...l},{iconId:g,iconType:D}=l;if(d===0){if(H(l,i))return{iconId:g,iconType:D,isShowValue:o}}else{if(d===e.length-1)return{iconId:g,iconType:D,isShowValue:o};{const m=e[d-1];if(h.operator=U2(m.operator),h.value=m.value,H(c,i)&&H(h,i))return{iconId:g,iconType:D,isShowValue:o}}}}}}var c0=Object.getOwnPropertyDescriptor,d0=(a,r,n,e)=>{for(var t=e>1?void 0:e?c0(r,n):r,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=s(t)||t);return t},s2=(a,r)=>(n,e)=>r(n,e,a);const l2=1e3*3*3;C.ConditionalFormattingViewModel=class extends u.Disposable{constructor(n,e,t,i){super();F(this,"_calculateUnitManagers",new Map);F(this,"_rTreeManager",new u.RTree);F(this,"_cellCache",new u.LRUMap(l2));F(this,"_markDirty$",new K.Subject);F(this,"markDirty$",this._markDirty$.asObservable());F(this,"_markRuleDirtyAtOnce",(n,e,t,i=!0)=>{if(this._cellCache.clear(),i){const o=this._ensureCalculateUnitManager(n,e).get(t);o&&o.resetPreComputingCache()}this._markDirty$.next({unitId:n,subUnitId:e,cfId:t})});F(this,"markRuleDirty",(()=>{const n=new K.Subject;return this.disposeWithMe(n.pipe(i2.bufferTime(100),i2.filter(e=>!!e.length),i2.map(e=>{const t=new Set,i=[];return e.forEach(s=>{const o=`${s.unitId}_${s.subUnitId}_${s.cfId}`;if(t.has(o)){if(s.isNeedResetPreComputingCache){const d=i.find(l=>l.cfId===s.cfId);d.isNeedResetPreComputingCache=!0}return}t.add(o),i.push({...s})}),i})).subscribe(e=>{e.forEach(t=>{this._markRuleDirtyAtOnce(t.unitId,t.subUnitId,t.cfId,t.isNeedResetPreComputingCache)})})),(e,t,i,s=!0)=>{n.next({unitId:e,subUnitId:t,cfId:i,isNeedResetPreComputingCache:s})}})());this._injector=n,this._conditionalFormattingRuleModel=e,this._conditionalFormattingFormulaService=t,this._univerInstanceService=i,this._initRuleListener(),this._handleCustomFormulasSeparately(),this._initCFFormulaListener()}_initCFFormulaListener(){this.disposeWithMe(this._conditionalFormattingFormulaService.result$.subscribe(({unitId:n,subUnitId:e,cfId:t,isAllFinished:i})=>{i&&this._markRuleDirtyAtOnce(n,e,t,i)}))}getCellCfs(n,e,t,i){const s=this._createCacheKey(n,e,t,i);if(this._cellCache.has(s))return this._cellCache.get(s);const o=this._getCellCfs(n,e,t,i);return o.length&&this._cellCache.set(s,o),o}_getCellCfs(n,e,t,i){var h;const s=(h=this._conditionalFormattingRuleModel.getSubunitRules(n,e))!=null?h:[],o=this._ensureCalculateUnitManager(n,e),d=this._rTreeManager.bulkSearch([{unitId:n,sheetId:e,range:{startColumn:i,endColumn:i,startRow:t,endRow:t}}]),l=s.filter(g=>d.has(g.cfId));return l.length?l.map(g=>{const D=o.get(g.cfId);return D?{cfId:g.cfId,result:D.getCell(t,i)}:null}).filter(g=>!!g).map((g,D)=>({...g,priority:D})):[]}_handleCustomFormulasSeparately(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{if(n.type==="set"){const{unitId:e,subUnitId:t}=n,i=n.oldRule;i.rule.type===R.highlightCell&&i.rule.subType===_.formula&&this._conditionalFormattingFormulaService.deleteCache(e,t,i.cfId)}}))}_initRuleListener(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:e,subUnitId:t,rule:i}=n,{cfId:s,ranges:o}=i,d=this._ensureCalculateUnitManager(e,t);switch(this.markRuleDirty(e,t,s),n.type){case"add":{this._rTreeManager.bulkInsert(o.map(c=>({unitId:e,sheetId:t,id:s,range:c})));const l=this._createRuleCalculateUnitInstance(e,t,i);if(!l)return;d.set(i.cfId,l);break}case"delete":{this._rTreeManager.bulkRemove(o.map(l=>({unitId:e,sheetId:t,id:s,range:l}))),d.delete(i.cfId);break}case"set":{const l=n.oldRule;if(this._rTreeManager.bulkRemove(l.ranges.map(c=>({unitId:e,sheetId:t,id:l.cfId,range:c}))),this._rTreeManager.bulkInsert(o.map(c=>({unitId:e,sheetId:t,id:s,range:c}))),l.rule.type!==i.rule.type){const c=this._createRuleCalculateUnitInstance(e,t,i);if(!c)return;d.delete(l.cfId),d.set(i.cfId,c)}else{const c=d.get(l.cfId);if(!c)return;c.updateRule(i)}}}}))}_ensureCalculateUnitManager(n,e){let t=this._calculateUnitManagers.get(n);t||(t=new Map,this._calculateUnitManagers.set(n,t));let i=t.get(e);return i||(i=new Map,t.set(e,i)),i}_createRuleCalculateUnitInstance(n,e,t){const i=this._univerInstanceService.getUnit(n),s=i==null?void 0:i.getSheetBySheetId(e);if(!i||!s)return;const o={workbook:i,worksheet:s,unitId:n,subUnitId:e,accessor:this._injector,rule:t,limit:l2,getCellValue:(d,l)=>s.getCellRaw(d,l)||{}};switch(t.rule.type){case R.colorScale:return new i0(o);case R.dataBar:return new s0(o);case R.highlightCell:return new l0(o);case R.iconSet:return new u0(o)}}_createCacheKey(n,e,t,i){return`${n}_${e}_${t}_${i}`}setCacheLength(n=l2){this._cellCache.limit!==n&&(this._cellCache.limit=n,this._calculateUnitManagers.forEach(e=>{e.forEach(t=>{t.forEach(i=>{i.setCacheLength(n)})})}))}},C.ConditionalFormattingViewModel=d0([s2(0,u.Inject(u.Injector)),s2(1,u.Inject(I)),s2(2,u.Inject(C.ConditionalFormattingFormulaService)),s2(3,u.IUniverInstanceService)],C.ConditionalFormattingViewModel);function e2(a,r){return Math.abs(a-r)<Number.EPSILON}const k=a=>[void 0,null].includes(a),U=a=>{var e,t;if(!a)return null;if(a.t===u.CellValueType.BOOLEAN)return a.v===u.BooleanNumber.TRUE?V.BooleanValue.TRUE:V.BooleanValue.FALSE;const r=a.v,n=(t=(e=a.p)==null?void 0:e.body)==null?void 0:t.dataStream.replace(/\r\n$/,"");return k(r)?k(n)?null:n:r},v2=86400;function B2(a,r=!0){if(r&&a>=0){if(a===0)return[1900,1,0];if(a===60)return[1900,2,29];if(a<60)return[1900,a<32?1:2,(a-1)%31+1]}let n=a+68569+2415019;const e=Math.floor(4*n/146097);n=n-Math.floor((146097*e+3)/4);const t=Math.floor(4e3*(n+1)/1461001);n=n-Math.floor(1461*t/4)+31;const i=Math.floor(80*n/2447),s=n-Math.floor(2447*i/80);n=Math.floor(i/11);const o=i+2-12*n;return[100*(e-49)+t+n|0,o|0,s|0]}const N2=a=>{let r=a|0;const n=v2*(a-r);let e=Math.floor(n);n-e>.9999&&(e+=1,e===v2&&(e=0,r+=1));const t=e<0?v2+e:e,[i,s,o]=B2(a,!0),d=Math.floor(t/60/60)%60,l=Math.floor(t/60)%60,c=Math.floor(t)%60;return u.dayjs(`${i}/${s}/${o} ${d}:${l}:${c}`).valueOf()},t2=(a,r,n)=>{switch(a.type){case x.max:{let e=0;return r.forValue((t,i,s)=>{s>e&&(e=s)}),{status:T.SUCCESS,result:e}}case x.min:{let e;return r.forValue((t,i,s)=>{e===void 0&&(e=s),s<e&&(e=s)}),{status:T.SUCCESS,result:e}}case x.percent:{let e,t;r.forValue((o,d,l)=>{(e===void 0||t===void 0)&&(e=l,t=l),l>e&&(e=l),l<t&&(t=l)});const i=(e||0)-(t||0),s=Math.max(Math.min(Number(a.value)||0,100),0);return{status:T.SUCCESS,result:i*(s/100)+(t||0)}}case x.percentile:{const e=r.toNativeArray().sort((l,c)=>l-c),t=Math.max(Math.min(Number(a.value)||0,100),0),i=(e.length-1)*t/100,s=Math.floor(i),o=i-s,d=e[s]+(e[Math.min(s+1,e.length-1)]-e[s])*o;return{status:T.SUCCESS,result:d}}case x.formula:{const{accessor:e,unitId:t,subUnitId:i,cfId:s}=n,o=String(a.value),d=e.get(C.ConditionalFormattingFormulaService);return d.registerFormulaWithRange(t,i,s,o),d.getFormulaResultWithCoords(t,i,s,o)}case x.num:default:{const e=Number(a.value);return{status:T.SUCCESS,result:Number.isNaN(e)?0:e}}}},h0=(a,r,n,e)=>{const{accessor:t}=e,i=t.get(C.ConditionalFormattingViewModel),s=new u.ObjectMatrix;return n.ranges.forEach(o=>{u.Range.foreach(o,(d,l)=>{const c=i.getCellCfs(a,r,d,l);if(c){const h=c.find(g=>g.cfId===n.cfId);h!=null&&h.result&&s.setValue(d,l,h.result)}})}),s},H=(a,r)=>{switch(a.operator){case E.between:{if(typeof a.value!="object"||!a.value.length)return;const n=Math.min(...a.value),e=Math.max(...a.value);return r>=n&&r<=e}case E.notBetween:{if(typeof a.value!="object"||!a.value.length)return;const n=Math.min(...a.value),e=Math.max(...a.value);return!(r>=n&&r<=e)}case E.equal:{const n=a.value||0;return e2(n,r)}case E.notEqual:{const n=a.value||0;return!e2(n,r)}case E.greaterThan:{const n=a.value||0;return r>n}case E.greaterThanOrEqual:{const n=a.value||0;return r>=n}case E.lessThan:{const n=a.value||0;return r<n}case E.lessThanOrEqual:{const n=a.value||0;return r<=n}default:return!1}},U2=a=>{switch(a){case E.greaterThan:return E.lessThanOrEqual;case E.greaterThanOrEqual:return E.lessThan;case E.lessThan:return E.greaterThanOrEqual;case E.lessThanOrEqual:return E.greaterThan}return a},V2=(a,r)=>{const n=i=>i.a!==void 0?i:{...i,a:1},e=a.findIndex(i=>i.value>=r),t=e-1;if(e===0)return a[0].color.toRgbString();if(t>=0){const i=a[t],s=a[e];if(i.color.isValid&&s.color.isValid){const o=n(i.color.toRgb()),d=n(s.color.toRgb()),l=s.value-i.value,c=(r-i.value)/l,h=["r","g","b","a"].reduce((D,m)=>{const v=o[m];return D[m]=(d[m]-v)*c+v,D},{});return new u.ColorKit(h).toRgbString()}}else return a[a.length-1].color.toRgbString()},o2=(a,r,n)=>a.map(e=>{if(e.startColumn>n||e.startRow>r)return null;const t={...e};return t.endRow=Math.min(t.endRow,r),t.endColumn=Math.min(t.endColumn,n),t}).filter(e=>!!e);function g0(a){let r=0;return new u.ObjectMatrix(a).forValue((n,e,t)=>{r=Math.max(Number.isNaN(r)?0:r,Number(t))}),r}const f={feedback:{mistake:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%227.03704%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.87359%206.87332C6.6146%207.13231%206.6146%207.55221%206.87359%207.8112L9.062%209.99961L6.87356%2012.188C6.61457%2012.447%206.61457%2012.8669%206.87356%2013.1259C7.13255%2013.3849%207.55245%2013.3849%207.81144%2013.1259L9.99987%2010.9375L12.1882%2013.1258C12.4472%2013.3848%2012.8671%2013.3848%2013.1261%2013.1258C13.3851%2012.8669%2013.3851%2012.447%2013.1261%2012.188L10.9378%209.99961L13.1261%207.81127C13.3851%207.55228%2013.3851%207.13238%2013.1261%206.87339C12.8671%206.61441%2012.4472%206.61441%2012.1882%206.87339L9.99987%209.06173L7.81147%206.87332C7.55248%206.61433%207.13257%206.61433%206.87359%206.87332Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3C%2Fsvg%3E%0A",warn:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%227.03704%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3Cpath%20d%3D%22M9.16817%206.67735C9.16646%206.61745%209.1656%206.5875%209.16653%206.56236C9.18103%206.16817%209.49136%205.84883%209.88497%205.82306C9.91008%205.82141%209.94004%205.82141%209.99996%205.82141V5.82141C10.0599%205.82141%2010.0899%205.82141%2010.115%205.82306C10.5086%205.84883%2010.8189%206.16817%2010.8334%206.56236C10.8343%206.5875%2010.8335%206.61745%2010.8318%206.67735L10.7043%2011.131C10.6934%2011.5121%2010.3812%2011.8154%209.99995%2011.8154V11.8154C9.61866%2011.8154%209.30655%2011.5121%209.29564%2011.131L9.16817%206.67735Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3Crect%20x%3D%229.31488%22%20y%3D%2212.8086%22%20width%3D%221.37006%22%20height%3D%221.37006%22%20rx%3D%220.685032%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3C%2Fsvg%3E%0A",correct:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M17.037%2010C17.037%2013.8865%2013.8864%2017.0371%209.99999%2017.0371C6.11354%2017.0371%202.96295%2013.8865%202.96295%2010C2.96295%206.1136%206.11354%202.96301%209.99999%202.96301C13.8864%202.96301%2017.037%206.1136%2017.037%2010Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3Cpath%20d%3D%22M13.9239%207.17477C13.6638%206.91472%2013.2422%206.91472%2012.9821%207.17477L8.74433%2011.4126L7.01786%209.6861C6.75781%209.42606%206.33619%209.42606%206.07614%209.6861C5.81609%209.94615%205.81609%2010.3678%206.07614%2010.6278L8.27349%2012.8252C8.53354%2013.0852%208.95516%2013.0852%209.21521%2012.8252L9.2195%2012.8209L13.9239%208.1165C14.1839%207.85645%2014.1839%207.43482%2013.9239%207.17477Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3C%2Fsvg%3E%0A"},star:{starEmpty:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.8451%207.0699%2012.2165%207.33978%2012.6421%207.36863L16.2362%207.61233C16.5693%207.63492%2016.7048%208.05202%2016.4486%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.215%2011.2859%2013.319%2011.6996L14.1979%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6418%2015.5971L10.5908%2013.6817C10.2296%2013.4549%209.77045%2013.4549%209.40924%2013.6817L6.35828%2015.5971C6.07553%2015.7746%205.72072%2015.5168%205.80217%2015.1931L6.68105%2011.6996C6.7851%2011.2859%206.64322%2010.8493%206.31592%2010.5758L3.55145%208.26607C3.29525%208.05202%203.43078%207.63492%203.76386%207.61233L7.358%207.36863C7.78352%207.33978%208.15498%207.0699%208.31391%206.67412L9.65633%203.3312C9.78074%203.0214%2010.2193%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23fff%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fsvg%3E%0A",starIncomplete:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url(%23clip0_613_177)%22%3E%0A%3Cmask%20id%3D%22mask0_613_177%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%2210%22%20y%3D%220%22%20width%3D%2210%22%20height%3D%2220%22%3E%0A%3Crect%20x%3D%2210.3704%22%20y%3D%220.37037%22%20width%3D%229.25926%22%20height%3D%2219.2593%22%20fill%3D%22%23C4C4C4%22%20stroke%3D%22%23F7D564%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fmask%3E%0A%3Cg%20mask%3D%22url(%23mask0_613_177)%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.845%207.0699%2012.2165%207.33978%2012.642%207.36863L16.2361%207.61233C16.5692%207.63492%2016.7047%208.05202%2016.4485%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.2149%2011.2859%2013.3189%2011.6996L14.1978%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6417%2015.5971L10.5908%2013.6817C10.2295%2013.4549%209.77039%2013.4549%209.40918%2013.6817L6.35822%2015.5971C6.07547%2015.7746%205.72066%2015.5168%205.80211%2015.1931L6.68098%2011.6996C6.78504%2011.2859%206.64316%2010.8493%206.31586%2010.5758L3.55139%208.26607C3.29519%208.05202%203.43072%207.63492%203.7638%207.61233L7.35793%207.36863C7.78346%207.33978%208.15491%207.0699%208.31385%206.67412L9.65627%203.3312C9.78068%203.0214%2010.2192%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23fff%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fg%3E%0A%3Cmask%20id%3D%22mask1_613_177%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2210%22%20height%3D%2220%22%3E%0A%3Crect%20width%3D%2210%22%20height%3D%2220%22%20fill%3D%22%23C4C4C4%22%2F%3E%0A%3C%2Fmask%3E%0A%3Cg%20mask%3D%22url(%23mask1_613_177)%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.845%207.0699%2012.2165%207.33978%2012.642%207.36863L16.2361%207.61233C16.5692%207.63492%2016.7047%208.05202%2016.4485%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.2149%2011.2859%2013.3189%2011.6996L14.1978%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6417%2015.5971L10.5908%2013.6817C10.2295%2013.4549%209.77039%2013.4549%209.40918%2013.6817L6.35822%2015.5971C6.07547%2015.7746%205.72066%2015.5168%205.80211%2015.1931L6.68098%2011.6996C6.78504%2011.2859%206.64316%2010.8493%206.31586%2010.5758L3.55139%208.26607C3.29519%208.05202%203.43072%207.63492%203.7638%207.61233L7.35793%207.36863C7.78346%207.33978%208.15491%207.0699%208.31385%206.67412L9.65627%203.3312C9.78068%203.0214%2010.2192%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fg%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_613_177%22%3E%0A%3Crect%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22white%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E%0A",starFull:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.8451%207.0699%2012.2165%207.33978%2012.6421%207.36863L16.2362%207.61233C16.5693%207.63492%2016.7048%208.05202%2016.4486%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.215%2011.2859%2013.319%2011.6996L14.1979%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6418%2015.5971L10.5908%2013.6817C10.2296%2013.4549%209.77045%2013.4549%209.40924%2013.6817L6.35828%2015.5971C6.07553%2015.7746%205.72072%2015.5168%205.80217%2015.1931L6.68105%2011.6996C6.7851%2011.2859%206.64322%2010.8493%206.31592%2010.5758L3.55145%208.26607C3.29525%208.05202%203.43078%207.63492%203.76386%207.61233L7.358%207.36863C7.78352%207.33978%208.15498%207.0699%208.31391%206.67412L9.65633%203.3312C9.78074%203.0214%2010.2193%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fsvg%3E%0A"},progress:{progress0:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress25:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Cpath%20d%3D%22M16.2963%209.99991C16.2963%209.17307%2016.1335%208.35432%2015.8171%207.59042C15.5006%206.82652%2015.0369%206.13242%2014.4522%205.54776C13.8675%204.96309%2013.1734%204.49931%2012.4095%204.18289C11.6456%203.86647%2010.8269%203.70361%2010%203.70361L10%209.99991H16.2963Z%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress50:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Cpath%20d%3D%22M10%2016.2962C11.6699%2016.2962%2013.2714%2015.6328%2014.4522%2014.4521C15.633%2013.2713%2016.2963%2011.6698%2016.2963%209.99991C16.2963%208.33003%2015.633%206.72854%2014.4522%205.54776C13.2714%204.36697%2011.6699%203.70361%2010%203.70361L10%209.99991L10%2016.2962Z%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress75:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Cpath%20d%3D%22M3.70374%209.99991C3.70374%2011.2452%204.07301%2012.4625%204.76485%2013.4979C5.4567%2014.5334%206.44005%2015.3404%207.59054%2015.8169C8.74104%2016.2935%2010.007%2016.4182%2011.2284%2016.1752C12.4497%2015.9323%2013.5716%2015.3326%2014.4522%2014.4521C15.3327%2013.5715%2015.9324%2012.4496%2016.1753%2011.2283C16.4183%2010.0069%2016.2936%208.74092%2015.8171%207.59042C15.3405%206.43992%2014.5335%205.45658%2013.4981%204.76473C12.4626%204.07288%2011.2453%203.70361%2010%203.70361L10%209.99991L3.70374%209.99991Z%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress100:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99991%22%20r%3D%226.2963%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A"},signal:{signal0:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal25:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal50:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal75:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal100:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93933%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70447%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A"},feeling:{guffaw:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M16.887%2010C16.887%2013.8037%2013.8036%2016.8871%209.99999%2016.8871C6.19638%2016.8871%203.11295%2013.8037%203.11295%2010C3.11295%206.19644%206.19638%203.11301%209.99999%203.11301C13.8036%203.11301%2016.887%206.19644%2016.887%2010Z%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M12.5355%2013.5821C13.0482%2013.1841%2013.3951%2012.6107%2013.5405%2012.0327C13.5934%2011.8226%2013.5051%2011.6349%2013.3518%2011.5331C13.2036%2011.4346%2013.0031%2011.4203%2012.8265%2011.5131C11.0615%2012.4407%208.94609%2012.4427%207.1828%2011.513C7.00629%2011.4199%206.80602%2011.4343%206.65798%2011.5329C6.50518%2011.6346%206.41701%2011.8217%206.46844%2012.0312C6.61029%2012.609%206.95079%2013.1833%207.46449%2013.5821C8.14361%2014.1093%209.05608%2014.3999%2010%2014.3999C10.9439%2014.3999%2011.8564%2014.1093%2012.5355%2013.5821Z%22%20fill%3D%22white%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.4%22%2F%3E%0A%3C%2Fsvg%3E%0A",smile:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.03705%2011.8518C7.03705%2011.8518%207.77779%2013.7037%2010%2013.7037C12.2222%2013.7037%2012.963%2011.8518%2012.963%2011.8518%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.962963%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A",noninductive:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.9259%22%20width%3D%221.48148%22%20height%3D%221.11111%22%20rx%3D%220.555556%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.9259%22%20width%3D%221.48148%22%20height%3D%221.11111%22%20rx%3D%220.555556%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.03705%2012.5927C7.03705%2012.5927%208.14816%2012.5927%2010.3704%2012.5927C12.5926%2012.5927%2012.963%2012.5927%2012.963%2012.5927%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.962963%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A",dissatisfied:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.03705%2013.7037C7.03705%2013.7037%207.77779%2011.8519%2010%2011.8519C12.2222%2011.8519%2012.963%2013.7037%2012.963%2013.7037%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.962963%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A",impatient:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.47573%2011.731C6.96306%2012.129%206.61613%2012.7024%206.47071%2013.2804C6.41784%2013.4905%206.50617%2013.6782%206.65942%2013.78C6.80761%2013.8785%207.00813%2013.8928%207.18477%2013.8C8.9498%2012.8724%2011.0652%2012.8704%2012.8285%2013.8002C13.005%2013.8932%2013.2052%2013.8788%2013.3533%2013.7802C13.5061%2013.6785%2013.5942%2013.4914%2013.5428%2013.2819C13.401%2012.7041%2013.0605%2012.1298%2012.5468%2011.731C11.8676%2011.2038%2010.9552%2010.9132%2010.0112%2010.9132C9.06732%2010.9132%208.15485%2011.2038%207.47573%2011.731Z%22%20fill%3D%22white%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.4%22%2F%3E%0A%3C%2Fsvg%3E%0A"},arrow:JSON.parse('{"down-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8.90467%203.99244C8.84611%204.1338%208.84611%204.31301%208.84611%204.67143V13.716L5.92068%2010.7906C5.66724%2010.5371%205.54052%2010.4104%205.39916%2010.3519C5.21067%2010.2738%204.9989%2010.2738%204.81041%2010.3519C4.66905%2010.4104%204.54233%2010.5371%204.28889%2010.7906C4.03545%2011.044%203.90873%2011.1707%203.85018%2011.3121C3.77211%2011.5006%203.77211%2011.7124%203.85018%2011.9008C3.90873%2012.0422%204.03545%2012.1689%204.28889%2012.4224L9.03476%2017.1682C9.07839%2017.2127%209.12737%2017.2617%209.18231%2017.3166L9.18239%2017.3167L9.18241%2017.3167C9.40545%2017.5398%209.53035%2017.6647%209.65346%2017.7313C9.67085%2017.7408%209.6882%2017.7492%209.70577%2017.7564C9.89425%2017.8345%2010.106%2017.8345%2010.2945%2017.7564C10.4359%2017.6979%2010.5626%2017.5712%2010.816%2017.3177C10.8986%2017.2352%2010.9677%2017.1661%2011.0253%2017.1056L15.7095%2012.4214L15.7095%2012.4213C15.963%2012.1679%2016.0897%2012.0412%2016.1482%2011.8998C16.2263%2011.7114%2016.2263%2011.4996%2016.1482%2011.3111C16.0897%2011.1697%2015.963%2011.043%2015.7095%2010.7896C15.4561%2010.5361%2015.3294%2010.4094%2015.188%2010.3509C14.9995%2010.2728%2014.7878%2010.2728%2014.5993%2010.3509C14.4579%2010.4094%2014.3312%2010.5361%2014.0778%2010.7896L14.0777%2010.7896L11.1538%2013.7135V4.67142C11.1538%204.31301%2011.1538%204.1338%2011.0953%203.99244C11.0172%203.80395%2010.8674%203.6542%2010.6789%203.57613C10.5376%203.51758%2010.3584%203.51758%209.99996%203.51758C9.64154%203.51758%209.46233%203.51758%209.32097%203.57613C9.13249%203.6542%208.98274%203.80395%208.90467%203.99244Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","right-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.32508%2011.7609C3.46644%2011.8194%203.64565%2011.8194%204.00407%2011.8194H13.049L10.1235%2014.745C9.87002%2014.9984%209.7433%2015.1251%209.68475%2015.2665C9.60668%2015.455%209.60668%2015.6668%209.68475%2015.8552C9.7433%2015.9966%209.87002%2016.1233%2010.1235%2016.3768C10.3769%2016.6302%2010.5036%2016.7569%2010.645%2016.8155C10.8335%2016.8935%2011.0452%2016.8935%2011.2337%2016.8155C11.3751%2016.7569%2011.5018%2016.6302%2011.7552%2016.3768L16.5105%2011.6215C16.5524%2011.5803%2016.5983%2011.5344%2016.6493%2011.4834L16.6495%2011.4831C16.8561%2011.2765%2016.9785%2011.1542%2017.0484%2011.0394C17.0648%2011.0128%2017.0782%2010.9866%2017.0893%2010.9599C17.1674%2010.7714%2017.1674%2010.5596%2017.0893%2010.3711C17.0308%2010.2298%2016.904%2010.1031%2016.6506%209.84962C16.5685%209.76752%2016.4997%209.69872%2016.4394%209.64123L11.7542%204.95601C11.5007%204.70257%2011.374%204.57585%2011.2327%204.5173C11.0442%204.43923%2010.8324%204.43923%2010.6439%204.5173C10.5026%204.57585%2010.3758%204.70257%2010.1224%204.95601L10.1224%204.95601C9.86895%205.20945%209.74223%205.33617%209.68368%205.47753C9.60561%205.66601%209.60561%205.87779%209.68368%206.06627C9.74223%206.20764%209.86895%206.33436%2010.1224%206.5878L13.0463%209.51175H4.00407C3.64565%209.51175%203.46644%209.51175%203.32508%209.5703C3.1366%209.64837%202.98685%209.79812%202.90877%209.98661C2.85022%2010.128%202.85022%2010.3072%202.85022%2010.6656C2.85022%2011.024%202.85022%2011.2032%202.90877%2011.3446C2.98685%2011.5331%203.1366%2011.6828%203.32508%2011.7609Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","up-green":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M11.0936%2017.3406C11.1522%2017.1992%2011.1522%2017.02%2011.1522%2016.6616V7.61701L14.0776%2010.5424C14.3311%2010.7959%2014.4578%2010.9226%2014.5991%2010.9811C14.7876%2011.0592%2014.9994%2011.0592%2015.1879%2010.9811C15.3292%2010.9226%2015.456%2010.7959%2015.7094%2010.5424C15.9628%2010.289%2016.0896%2010.1623%2016.1481%2010.0209C16.2262%209.83243%2016.2262%209.62066%2016.1481%209.43217C16.0896%209.29081%2015.9628%209.16409%2015.7094%208.91065L10.9645%204.16576C10.9207%204.12105%2010.8714%204.07178%2010.8161%204.01648L10.8159%204.0163C10.5916%203.792%2010.4666%203.66696%2010.3428%203.60058C10.3261%203.59154%2010.3094%203.58358%2010.2925%203.57658C10.104%203.49851%209.89226%203.49851%209.70378%203.57658C9.56242%203.63514%209.4357%203.76186%209.18226%204.0153C9.09955%204.09801%209.03034%204.16722%208.97258%204.22785L4.28878%208.91166C4.03534%209.1651%203.90862%209.29182%203.85006%209.43318C3.77199%209.62166%203.77199%209.83344%203.85006%2010.0219C3.90862%2010.1633%204.03534%2010.29%204.28878%2010.5434C4.54221%2010.7969%204.66893%2010.9236%204.8103%2010.9822C4.99878%2011.0602%205.21056%2011.0602%205.39904%2010.9822C5.5404%2010.9236%205.66712%2010.7969%205.92056%2010.5434L5.92056%2010.5434L8.84449%207.61951V16.6616C8.84449%2017.02%208.84449%2017.1992%208.90305%2017.3406C8.98112%2017.5291%209.13087%2017.6788%209.31935%2017.7569C9.46072%2017.8154%209.63992%2017.8154%209.99834%2017.8154C10.3568%2017.8154%2010.536%2017.8154%2010.6773%2017.7569C10.8658%2017.6788%2011.0156%2017.5291%2011.0936%2017.3406Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndDown-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.5062%206.72126C4.56476%206.86262%204.69148%206.98934%204.94492%207.24278L11.3404%2013.6382L7.20313%2013.6382C6.84471%2013.6382%206.66551%2013.6382%206.52414%2013.6968C6.33566%2013.7749%206.18591%2013.9246%206.10784%2014.1131C6.04928%2014.2545%206.04928%2014.4337%206.04928%2014.7921C6.04928%2015.1505%206.04928%2015.3297%206.10784%2015.4711C6.18591%2015.6596%206.33566%2015.8093%206.52414%2015.8874C6.66551%2015.9459%206.84471%2015.9459%207.20313%2015.9459L13.9194%2015.9459C13.9805%2015.9465%2014.0484%2015.9465%2014.1243%2015.9465H14.1243C14.4353%2015.9465%2014.6114%2015.9465%2014.7449%2015.9082C14.7659%2015.9023%2014.7859%2015.8954%2014.8052%2015.8874C14.9937%2015.8093%2015.1434%2015.6596%2015.2215%2015.4711C15.2801%2015.3297%2015.2801%2015.1505%2015.2801%2014.7921C15.2801%2014.6767%2015.2801%2014.5799%2015.2781%2014.497L15.2781%207.86957C15.2781%207.51115%2015.2781%207.33194%2015.2195%207.19058C15.1415%207.0021%2014.9917%206.85235%2014.8032%206.77428C14.6619%206.71572%2014.4827%206.71572%2014.1243%206.71572C13.7658%206.71572%2013.5866%206.71572%2013.4453%206.77428C13.2568%206.85235%2013.107%207.0021%2013.029%207.19058C12.9704%207.33194%2012.9704%207.51115%2012.9704%207.86957L12.9704%2012.0047L6.5767%205.61099C6.32326%205.35755%206.19654%205.23083%206.05518%205.17228C5.8667%205.09421%205.65492%205.09421%205.46644%205.17228C5.32508%205.23083%205.19836%205.35755%204.94492%205.61099C4.69148%205.86443%204.56476%205.99115%204.5062%206.13251C4.42813%206.32099%204.42813%206.53277%204.5062%206.72126Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndUp-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.05431%2016.1597C6.19567%2016.1012%206.32239%2015.9745%206.57583%2015.721L12.9712%209.32568L12.9712%2013.4626C12.9712%2013.821%2012.9712%2014.0002%2013.0297%2014.1416C13.1078%2014.3301%2013.2576%2014.4798%2013.446%2014.5579C13.5874%2014.6164%2013.7666%2014.6164%2014.125%2014.6164C14.4834%2014.6164%2014.6626%2014.6164%2014.804%2014.5579C14.9925%2014.4798%2015.1422%2014.3301%2015.2203%2014.1416C15.2789%2014.0002%2015.2789%2013.821%2015.2789%2013.4626L15.2789%206.75233C15.2795%206.68972%2015.2795%206.62004%2015.2795%206.54182L15.2795%206.54157C15.2795%206.22585%2015.2795%206.04918%2015.2395%205.91495C15.2339%205.89605%2015.2276%205.878%2015.2203%205.86053C15.1422%205.67204%2014.9925%205.52229%2014.804%205.44422C14.6626%205.38567%2014.4834%205.38567%2014.125%205.38567L14.125%205.38567C14.0075%205.38567%2013.9093%205.38567%2013.8254%205.38773L7.20256%205.38773C6.84414%205.38773%206.66493%205.38773%206.52357%205.44628C6.33509%205.52436%206.18534%205.6741%206.10727%205.86259C6.04871%206.00395%206.04871%206.18315%206.04871%206.54156V6.54157L6.04871%206.54159C6.04871%206.9%206.04871%207.0792%206.10727%207.22056C6.18534%207.40905%206.33509%207.55879%206.52357%207.63687C6.66493%207.69542%206.84414%207.69542%207.20256%207.69542H11.3379L4.94405%2014.0892C4.69061%2014.3427%204.56389%2014.4694%204.50533%2014.6108C4.42726%2014.7992%204.42726%2015.011%204.50533%2015.1995C4.56389%2015.3409%204.69061%2015.4676%204.94405%2015.721C5.19749%2015.9745%205.32421%2016.1012%205.46557%2016.1597C5.65405%2016.2378%205.86583%2016.2378%206.05431%2016.1597Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","down-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8.90467%203.99244C8.84611%204.1338%208.84611%204.31301%208.84611%204.67143V13.716L5.92068%2010.7906C5.66724%2010.5371%205.54052%2010.4104%205.39916%2010.3519C5.21067%2010.2738%204.9989%2010.2738%204.81041%2010.3519C4.66905%2010.4104%204.54233%2010.5371%204.28889%2010.7906C4.03545%2011.044%203.90873%2011.1707%203.85018%2011.3121C3.77211%2011.5006%203.77211%2011.7124%203.85018%2011.9008C3.90873%2012.0422%204.03545%2012.1689%204.28889%2012.4224L9.03476%2017.1682C9.07839%2017.2127%209.12737%2017.2617%209.18231%2017.3166L9.18239%2017.3167L9.18241%2017.3167C9.40545%2017.5398%209.53035%2017.6647%209.65346%2017.7313C9.67085%2017.7408%209.6882%2017.7492%209.70577%2017.7564C9.89425%2017.8345%2010.106%2017.8345%2010.2945%2017.7564C10.4359%2017.6979%2010.5626%2017.5712%2010.816%2017.3177C10.8986%2017.2352%2010.9677%2017.1661%2011.0253%2017.1056L15.7095%2012.4214L15.7095%2012.4213C15.963%2012.1679%2016.0897%2012.0412%2016.1482%2011.8998C16.2263%2011.7114%2016.2263%2011.4996%2016.1482%2011.3111C16.0897%2011.1697%2015.963%2011.043%2015.7095%2010.7896C15.4561%2010.5361%2015.3294%2010.4094%2015.188%2010.3509C14.9995%2010.2728%2014.7878%2010.2728%2014.5993%2010.3509C14.4579%2010.4094%2014.3312%2010.5361%2014.0778%2010.7896L14.0777%2010.7896L11.1538%2013.7135V4.67142C11.1538%204.31301%2011.1538%204.1338%2011.0953%203.99244C11.0172%203.80395%2010.8674%203.6542%2010.6789%203.57613C10.5376%203.51758%2010.3584%203.51758%209.99996%203.51758C9.64154%203.51758%209.46233%203.51758%209.32097%203.57613C9.13249%203.6542%208.98274%203.80395%208.90467%203.99244Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","right-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.32508%2011.7609C3.46644%2011.8194%203.64565%2011.8194%204.00407%2011.8194H13.049L10.1235%2014.745C9.87002%2014.9984%209.7433%2015.1251%209.68475%2015.2665C9.60668%2015.455%209.60668%2015.6668%209.68475%2015.8552C9.7433%2015.9966%209.87002%2016.1233%2010.1235%2016.3768C10.3769%2016.6302%2010.5036%2016.7569%2010.645%2016.8155C10.8335%2016.8935%2011.0452%2016.8935%2011.2337%2016.8155C11.3751%2016.7569%2011.5018%2016.6302%2011.7552%2016.3768L16.5105%2011.6215C16.5524%2011.5803%2016.5983%2011.5344%2016.6493%2011.4834L16.6495%2011.4831C16.8561%2011.2765%2016.9785%2011.1542%2017.0484%2011.0394C17.0648%2011.0128%2017.0782%2010.9866%2017.0893%2010.9599C17.1674%2010.7714%2017.1674%2010.5596%2017.0893%2010.3711C17.0308%2010.2298%2016.904%2010.1031%2016.6506%209.84962C16.5685%209.76752%2016.4997%209.69872%2016.4394%209.64123L11.7542%204.95601C11.5007%204.70257%2011.374%204.57585%2011.2327%204.5173C11.0442%204.43923%2010.8324%204.43923%2010.6439%204.5173C10.5026%204.57585%2010.3758%204.70257%2010.1224%204.95601L10.1224%204.95601C9.86895%205.20945%209.74223%205.33617%209.68368%205.47753C9.60561%205.66601%209.60561%205.87779%209.68368%206.06627C9.74223%206.20764%209.86895%206.33436%2010.1224%206.5878L13.0463%209.51175H4.00407C3.64565%209.51175%203.46644%209.51175%203.32508%209.5703C3.1366%209.64837%202.98685%209.79812%202.90877%209.98661C2.85022%2010.128%202.85022%2010.3072%202.85022%2010.6656C2.85022%2011.024%202.85022%2011.2032%202.90877%2011.3446C2.98685%2011.5331%203.1366%2011.6828%203.32508%2011.7609Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","up-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M11.0936%2017.3406C11.1522%2017.1992%2011.1522%2017.02%2011.1522%2016.6616V7.61701L14.0776%2010.5424C14.3311%2010.7959%2014.4578%2010.9226%2014.5991%2010.9811C14.7876%2011.0592%2014.9994%2011.0592%2015.1879%2010.9811C15.3292%2010.9226%2015.456%2010.7959%2015.7094%2010.5424C15.9628%2010.289%2016.0896%2010.1623%2016.1481%2010.0209C16.2262%209.83243%2016.2262%209.62066%2016.1481%209.43217C16.0896%209.29081%2015.9628%209.16409%2015.7094%208.91065L10.9645%204.16576C10.9207%204.12105%2010.8714%204.07178%2010.8161%204.01648L10.8159%204.0163C10.5916%203.792%2010.4666%203.66696%2010.3428%203.60058C10.3261%203.59154%2010.3094%203.58358%2010.2925%203.57658C10.104%203.49851%209.89226%203.49851%209.70378%203.57658C9.56242%203.63514%209.4357%203.76186%209.18226%204.0153C9.09955%204.09801%209.03034%204.16722%208.97258%204.22785L4.28878%208.91166C4.03534%209.1651%203.90862%209.29182%203.85006%209.43318C3.77199%209.62166%203.77199%209.83344%203.85006%2010.0219C3.90862%2010.1633%204.03534%2010.29%204.28878%2010.5434C4.54221%2010.7969%204.66893%2010.9236%204.8103%2010.9822C4.99878%2011.0602%205.21056%2011.0602%205.39904%2010.9822C5.5404%2010.9236%205.66712%2010.7969%205.92056%2010.5434L5.92056%2010.5434L8.84449%207.61951V16.6616C8.84449%2017.02%208.84449%2017.1992%208.90305%2017.3406C8.98112%2017.5291%209.13087%2017.6788%209.31935%2017.7569C9.46072%2017.8154%209.63992%2017.8154%209.99834%2017.8154C10.3568%2017.8154%2010.536%2017.8154%2010.6773%2017.7569C10.8658%2017.6788%2011.0156%2017.5291%2011.0936%2017.3406Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndDown-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.5062%206.72126C4.56476%206.86262%204.69148%206.98934%204.94492%207.24278L11.3404%2013.6382L7.20313%2013.6382C6.84471%2013.6382%206.66551%2013.6382%206.52414%2013.6968C6.33566%2013.7749%206.18591%2013.9246%206.10784%2014.1131C6.04928%2014.2545%206.04928%2014.4337%206.04928%2014.7921C6.04928%2015.1505%206.04928%2015.3297%206.10784%2015.4711C6.18591%2015.6596%206.33566%2015.8093%206.52414%2015.8874C6.66551%2015.9459%206.84471%2015.9459%207.20313%2015.9459L13.9194%2015.9459C13.9805%2015.9465%2014.0484%2015.9465%2014.1243%2015.9465H14.1243C14.4353%2015.9465%2014.6114%2015.9465%2014.7449%2015.9082C14.7659%2015.9023%2014.7859%2015.8954%2014.8052%2015.8874C14.9937%2015.8093%2015.1434%2015.6596%2015.2215%2015.4711C15.2801%2015.3297%2015.2801%2015.1505%2015.2801%2014.7921C15.2801%2014.6767%2015.2801%2014.5799%2015.2781%2014.497L15.2781%207.86957C15.2781%207.51115%2015.2781%207.33194%2015.2195%207.19058C15.1415%207.0021%2014.9917%206.85235%2014.8032%206.77428C14.6619%206.71572%2014.4827%206.71572%2014.1243%206.71572C13.7658%206.71572%2013.5866%206.71572%2013.4453%206.77428C13.2568%206.85235%2013.107%207.0021%2013.029%207.19058C12.9704%207.33194%2012.9704%207.51115%2012.9704%207.86957L12.9704%2012.0047L6.5767%205.61099C6.32326%205.35755%206.19654%205.23083%206.05518%205.17228C5.8667%205.09421%205.65492%205.09421%205.46644%205.17228C5.32508%205.23083%205.19836%205.35755%204.94492%205.61099C4.69148%205.86443%204.56476%205.99115%204.5062%206.13251C4.42813%206.32099%204.42813%206.53277%204.5062%206.72126Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndUp-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.05431%2016.1597C6.19567%2016.1012%206.32239%2015.9745%206.57583%2015.721L12.9712%209.32568L12.9712%2013.4626C12.9712%2013.821%2012.9712%2014.0002%2013.0297%2014.1416C13.1078%2014.3301%2013.2576%2014.4798%2013.446%2014.5579C13.5874%2014.6164%2013.7666%2014.6164%2014.125%2014.6164C14.4834%2014.6164%2014.6626%2014.6164%2014.804%2014.5579C14.9925%2014.4798%2015.1422%2014.3301%2015.2203%2014.1416C15.2789%2014.0002%2015.2789%2013.821%2015.2789%2013.4626L15.2789%206.75233C15.2795%206.68972%2015.2795%206.62004%2015.2795%206.54182L15.2795%206.54157C15.2795%206.22585%2015.2795%206.04918%2015.2395%205.91495C15.2339%205.89605%2015.2276%205.878%2015.2203%205.86053C15.1422%205.67204%2014.9925%205.52229%2014.804%205.44422C14.6626%205.38567%2014.4834%205.38567%2014.125%205.38567L14.125%205.38567C14.0075%205.38567%2013.9093%205.38567%2013.8254%205.38773L7.20256%205.38773C6.84414%205.38773%206.66493%205.38773%206.52357%205.44628C6.33509%205.52436%206.18534%205.6741%206.10727%205.86259C6.04871%206.00395%206.04871%206.18315%206.04871%206.54156V6.54157L6.04871%206.54159C6.04871%206.9%206.04871%207.0792%206.10727%207.22056C6.18534%207.40905%206.33509%207.55879%206.52357%207.63687C6.66493%207.69542%206.84414%207.69542%207.20256%207.69542H11.3379L4.94405%2014.0892C4.69061%2014.3427%204.56389%2014.4694%204.50533%2014.6108C4.42726%2014.7992%204.42726%2015.011%204.50533%2015.1995C4.56389%2015.3409%204.69061%2015.4676%204.94405%2015.721C5.19749%2015.9745%205.32421%2016.1012%205.46557%2016.1597C5.65405%2016.2378%205.86583%2016.2378%206.05431%2016.1597Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A"}'),shape:{cross:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%223.70374%22%20y%3D%228.14795%22%20width%3D%2212.5926%22%20height%3D%223.7037%22%20rx%3D%220.740741%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A",up:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M9.44533%205.81157C9.74012%205.47858%2010.2598%205.47858%2010.5546%205.81157L16.2868%2012.2867C16.71%2012.7647%2016.3706%2013.5184%2015.7322%2013.5184H4.26776C3.62933%2013.5184%203.28995%2012.7647%203.71313%2012.2867L9.44533%205.81157Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A",down:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10.5547%2014.1884C10.2599%2014.5214%209.74019%2014.5214%209.4454%2014.1884L3.71321%207.71335C3.29002%207.23532%203.6294%206.48161%204.26784%206.48161L15.7322%206.48161C16.3707%206.48161%2016.7101%207.23532%2016.2869%207.71335L10.5547%2014.1884Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","rhomboid-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M2.1415%2011.1984C1.8412%2010.9074%201.8412%2010.4256%202.1415%2010.1346L9.48467%203.01785C9.77196%202.73942%2010.2284%202.73942%2010.5157%203.01786L17.8586%2010.1346C18.1589%2010.4256%2018.1589%2010.9074%2017.8586%2011.1984L10.5157%2018.3151C10.2284%2018.5936%209.77196%2018.5936%209.48467%2018.3152L2.1415%2011.1984Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-greed":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-pink":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23FB9D9D%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-black":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22black%22%2F%3E%0A%3C%2Fsvg%3E%0A","triangle-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url(%23clip0_613_237)%22%3E%0A%3Cpath%20d%3D%22M9.32308%204.41301C9.58368%203.82623%2010.4164%203.82623%2010.677%204.413L15.9526%2016.2917C16.1701%2016.7815%2015.8115%2017.3331%2015.2756%2017.3331H4.72454C4.18858%2017.3331%203.83002%2016.7815%204.04756%2016.2917L9.32308%204.41301Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_613_237%22%3E%0A%3Crect%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22white%22%20transform%3D%22translate(0%200.666504)%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E%0A","indicate-greed":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%222.76941%22%20y%3D%222.76941%22%20width%3D%2214.4612%22%20height%3D%2214.4612%22%20rx%3D%223%22%20fill%3D%22black%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%224.5%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","indicate-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%222.76941%22%20y%3D%222.76941%22%20width%3D%2214.4612%22%20height%3D%2214.4612%22%20rx%3D%223%22%20fill%3D%22black%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%224.5%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","indicate-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%222.76941%22%20y%3D%222.76941%22%20width%3D%2214.4612%22%20height%3D%2214.4612%22%20rx%3D%223%22%20fill%3D%22black%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%224.5%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A"},feedback2:{mistake2:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.12194%206.33702C4.1805%206.47839%204.30722%206.6051%204.56066%206.85854L8.36822%2010.6661L4.56062%2014.4737C4.30718%2014.7272%204.18046%2014.8539%204.12191%2014.9952C4.04384%2015.1837%204.04384%2015.3955%204.12191%2015.584C4.18046%2015.7253%204.30718%2015.8521%204.56062%2016.1055C4.81406%2016.3589%204.94078%2016.4857%205.08214%2016.5442C5.27062%2016.6223%205.4824%2016.6223%205.67089%2016.5442C5.81225%2016.4857%205.93897%2016.3589%206.19241%2016.1055L10%2012.2979L13.8074%2016.1053C14.0609%2016.3588%2014.1876%2016.4855%2014.329%2016.544C14.5174%2016.6221%2014.7292%2016.6221%2014.9177%2016.544C15.0591%2016.4855%2015.1858%2016.3588%2015.4392%2016.1053L15.4392%2016.1053C15.6927%2015.8519%2015.8194%2015.7252%2015.8779%2015.5838C15.956%2015.3953%2015.956%2015.1835%2015.8779%2014.9951C15.8194%2014.8537%2015.6927%2014.727%2015.4392%2014.4735L15.4392%2014.4735L11.6318%2010.6661L15.4392%206.85872C15.6926%206.60528%2015.8193%206.47856%2015.8779%206.3372C15.956%206.14871%2015.956%205.93694%2015.8779%205.74845C15.8193%205.60709%2015.6926%205.48037%2015.4392%205.22693C15.1857%204.97349%2015.059%204.84677%2014.9177%204.78822C14.7292%204.71015%2014.5174%204.71015%2014.3289%204.78822C14.1876%204.84677%2014.0608%204.97349%2013.8074%205.22693L10%209.03433L6.19244%205.22676C5.939%204.97332%205.81228%204.8466%205.67092%204.78805C5.48244%204.70997%205.27066%204.70997%205.08218%204.78805C4.94082%204.8466%204.8141%204.97332%204.56066%205.22676L4.56066%205.22676C4.30722%205.4802%204.1805%205.60692%204.12194%205.74828C4.04387%205.93676%204.04387%206.14854%204.12194%206.33702Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A",warn2:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M8.49778%205.00963C8.48513%204.56774%208.47881%204.3468%208.56086%204.17746C8.63301%204.02856%208.75124%203.90689%208.89802%203.83052C9.06494%203.74365%209.28597%203.74365%209.72805%203.74365H10.272C10.714%203.74365%2010.9351%203.74365%2011.102%203.83052C11.2488%203.9069%2011.367%204.02856%2011.4392%204.17746C11.5212%204.3468%2011.5149%204.56775%2011.5022%205.00964L11.2644%2013.3173C11.2524%2013.737%2011.2464%2013.9468%2011.1609%2014.1065C11.0857%2014.2471%2010.9687%2014.3609%2010.826%2014.432C10.6639%2014.5129%2010.454%2014.5129%2010.0342%2014.5129H9.96582C9.54601%2014.5129%209.33611%2014.5129%209.17397%2014.432C9.0313%2014.3609%208.91426%2014.2471%208.83904%2014.1065C8.75357%2013.9468%208.74756%2013.737%208.73555%2013.3173L8.49778%205.00963Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3Crect%20x%3D%228.76917%22%20y%3D%2215.2817%22%20width%3D%222.46154%22%20height%3D%222.46154%22%20rx%3D%220.769231%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A",correct2:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url(%23clip0_613_248)%22%3E%0A%3Cpath%20d%3D%22M15.689%205.69723C15.5476%205.75578%2015.4209%205.8825%2015.1675%206.13594L7.82436%2013.4791L4.83279%2010.4875C4.57935%2010.2341%204.45263%2010.1073%204.31127%2010.0488C4.12278%209.97071%203.91101%209.97071%203.72252%2010.0488C3.58116%2010.1073%203.45444%2010.2341%203.201%2010.4875C2.94756%2010.7409%202.82084%2010.8676%202.76229%2011.009C2.68422%2011.1975%202.68422%2011.4093%202.76229%2011.5978C2.82084%2011.7391%202.94756%2011.8658%203.201%2012.1193L7.0085%2015.9268C7.26194%2016.1802%207.38866%2016.3069%207.53002%2016.3655C7.7185%2016.4436%207.93028%2016.4436%208.11876%2016.3655C8.26013%2016.3069%208.38685%2016.1802%208.64028%2015.9268C8.66387%2015.9032%208.68636%2015.8807%208.7078%2015.8592L16.7993%207.76772C17.0527%207.51428%2017.1794%207.38756%2017.238%207.2462C17.3161%207.05772%2017.3161%206.84594%2017.238%206.65746C17.1794%206.5161%2017.0527%206.38938%2016.7993%206.13594C16.5458%205.8825%2016.4191%205.75578%2016.2777%205.69723C16.0893%205.61915%2015.8775%205.61915%2015.689%205.69723Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_613_248%22%3E%0A%3Crect%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22white%22%20transform%3D%22translate(0%200.666504)%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E%0A"},flag:{"flag-green":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.4274%204.74935C14.0982%205.1012%2013.1363%205.13675%2012.3604%205.03379C11.5776%204.93009%2010.9487%204.68342%2010.2456%204.40416L10.2246%204.39527C9.53411%204.1212%208.76945%203.8175%207.81312%203.69157C6.84279%203.56268%205.71016%203.61898%204.24802%204.0049C4.09343%204.04217%203.95538%204.13393%203.85649%204.26515C3.7576%204.39636%203.70374%204.55925%203.70374%204.72712V17.3197C3.70374%2017.5162%203.79534%2017.7046%203.92654%2017.8435C4.05773%2017.9824%204.25893%2018.0605%204.44448%2018.0605C4.63002%2018.0605%204.84911%2017.9824%204.98031%2017.8435C5.11151%2017.7046%205.18522%2017.5162%205.18522%2017.3197V14.9123V12.5049C6.24649%2012.2738%206.97081%2012.2605%207.63962%2012.3486C8.42246%2012.4523%209.05139%2012.699%209.75448%2012.9782L9.77546%2012.9871C10.466%2013.2612%2011.2306%2013.5649%2012.1869%2013.6908C13.1601%2013.8197%2014.2976%2013.7627%2015.7667%2013.3738C15.8866%2013.3421%2016.0727%2013.2135%2016.1483%2013.111C16.2238%2013.0084%2016.2963%2012.8204%2016.2963%2012.6553V5.46787C16.2963%205.35535%2016.2721%205.24432%2016.2255%205.1432C16.1788%205.04208%2016.1111%204.95353%2016.0274%204.88428C15.9436%204.81502%2015.846%204.76688%2015.7421%204.7435C15.6382%204.72012%2015.494%204.73173%2015.4274%204.74935Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","flag-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.4274%204.74935C14.0982%205.1012%2013.1363%205.13675%2012.3604%205.03379C11.5776%204.93009%2010.9487%204.68342%2010.2456%204.40416L10.2246%204.39527C9.53411%204.1212%208.76945%203.8175%207.81312%203.69157C6.84279%203.56268%205.71016%203.61898%204.24802%204.0049C4.09343%204.04217%203.95538%204.13393%203.85649%204.26515C3.7576%204.39636%203.70374%204.55925%203.70374%204.72712V17.3197C3.70374%2017.5162%203.79534%2017.7046%203.92654%2017.8435C4.05773%2017.9824%204.25893%2018.0605%204.44448%2018.0605C4.63002%2018.0605%204.84911%2017.9824%204.98031%2017.8435C5.11151%2017.7046%205.18522%2017.5162%205.18522%2017.3197V14.9123V12.5049C6.24649%2012.2738%206.97081%2012.2605%207.63962%2012.3486C8.42246%2012.4523%209.05139%2012.699%209.75448%2012.9782L9.77546%2012.9871C10.466%2013.2612%2011.2306%2013.5649%2012.1869%2013.6908C13.1601%2013.8197%2014.2976%2013.7627%2015.7667%2013.3738C15.8866%2013.3421%2016.0727%2013.2135%2016.1483%2013.111C16.2238%2013.0084%2016.2963%2012.8204%2016.2963%2012.6553V5.46787C16.2963%205.35535%2016.2721%205.24432%2016.2255%205.1432C16.1788%205.04208%2016.1111%204.95353%2016.0274%204.88428C15.9436%204.81502%2015.846%204.76688%2015.7421%204.7435C15.6382%204.72012%2015.494%204.73173%2015.4274%204.74935Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","flag-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.4274%204.74935C14.0982%205.1012%2013.1363%205.13675%2012.3604%205.03379C11.5776%204.93009%2010.9487%204.68342%2010.2456%204.40416L10.2246%204.39527C9.53411%204.1212%208.76945%203.8175%207.81312%203.69157C6.84279%203.56268%205.71016%203.61898%204.24802%204.0049C4.09343%204.04217%203.95538%204.13393%203.85649%204.26515C3.7576%204.39636%203.70374%204.55925%203.70374%204.72712V17.3197C3.70374%2017.5162%203.79534%2017.7046%203.92654%2017.8435C4.05773%2017.9824%204.25893%2018.0605%204.44448%2018.0605C4.63002%2018.0605%204.84911%2017.9824%204.98031%2017.8435C5.11151%2017.7046%205.18522%2017.5162%205.18522%2017.3197V14.9123V12.5049C6.24649%2012.2738%206.97081%2012.2605%207.63962%2012.3486C8.42246%2012.4523%209.05139%2012.699%209.75448%2012.9782L9.77546%2012.9871C10.466%2013.2612%2011.2306%2013.5649%2012.1869%2013.6908C13.1601%2013.8197%2014.2976%2013.7627%2015.7667%2013.3738C15.8866%2013.3421%2016.0727%2013.2135%2016.1483%2013.111C16.2238%2013.0084%2016.2963%2012.8204%2016.2963%2012.6553V5.46787C16.2963%205.35535%2016.2721%205.24432%2016.2255%205.1432C16.1788%205.04208%2016.1111%204.95353%2016.0274%204.88428C15.9436%204.81502%2015.846%204.76688%2015.7421%204.7435C15.6382%204.72012%2015.494%204.73173%2015.4274%204.74935Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A"},cell:{"cell-0":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224%22%20y%3D%224.00098%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%224.00098%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-25":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%224.00098%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-50":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-75":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%2211.251%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-100":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%2211.251%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%2211.251%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3C%2Fsvg%3E%0A"}},O2=[{title:"sheet.cf.iconSet.direction",group:[{name:"3Arrows",list:[f.arrow["up-green"],f.arrow["right-gold"],f.arrow["down-red"]]},{name:"3ArrowsGray",list:[f.arrow["up-gray"],f.arrow["right-gray"],f.arrow["down-gray"]]},{name:"4Arrows",list:[f.arrow["up-green"],f.arrow["rightAndUp-gold"],f.arrow["rightAndDown-gold"],f.arrow["down-red"]]},{name:"4ArrowsGray",list:[f.arrow["up-gray"],f.arrow["rightAndUp-gray"],f.arrow["rightAndDown-gray"],f.arrow["down-gray"]]},{name:"5Arrows",list:[f.arrow["up-green"],f.arrow["rightAndUp-gold"],f.arrow["right-gold"],f.arrow["rightAndDown-gold"],f.arrow["down-red"]]},{name:"5ArrowsGray",list:[f.arrow["up-gray"],f.arrow["rightAndUp-gray"],f.arrow["right-gray"],f.arrow["rightAndDown-gray"],f.arrow["down-gray"]]},{name:"3Triangles",list:[f.shape.up,f.shape.cross,f.shape.down]}]},{title:"sheet.cf.iconSet.shape",group:[{name:"3TrafficLights1",list:[f.shape["roundness-greed"],f.shape["roundness-gold"],f.shape["roundness-red"]]},{name:"3Signs",list:[f.shape["roundness-greed"],f.shape["triangle-gold"],f.shape["rhomboid-red"]]},{name:"3TrafficLights2",list:[f.shape["indicate-greed"],f.shape["indicate-gold"],f.shape["indicate-red"]]},{name:"4RedToBlack",list:[f.shape["roundness-red"],f.shape["roundness-pink"],f.shape["roundness-gray"],f.shape["roundness-black"]]},{name:"4TrafficLights",list:[f.shape["roundness-greed"],f.shape["roundness-gold"],f.shape["roundness-red"],f.shape["roundness-black"]]}]},{title:"sheet.cf.iconSet.mark",group:[{name:"3Symbols",list:[f.feedback.correct,f.feedback.warn,f.feedback.mistake]},{name:"3Symbols2",list:[f.feedback2.correct2,f.feedback2.warn2,f.feedback2.mistake2]},{name:"3Flags",list:[f.flag["flag-green"],f.flag["flag-gold"],f.flag["flag-red"]]}]},{title:"sheet.cf.iconSet.rank",group:[{name:"4Rating",list:[f.signal.signal25,f.signal.signal50,f.signal.signal75,f.signal.signal100]},{name:"5Rating",list:[f.signal.signal0,f.signal.signal25,f.signal.signal50,f.signal.signal75,f.signal.signal100]},{name:"5Quarters",list:[f.progress.progress100,f.progress.progress75,f.progress.progress50,f.progress.progress25,f.progress.progress0]},{name:"_5Felling",list:[f.feeling.guffaw,f.feeling.smile,f.feeling.noninductive,f.feeling.dissatisfied,f.feeling.impatient]},{name:"5Boxes",list:[f.cell["cell-100"],f.cell["cell-75"],f.cell["cell-50"],f.cell["cell-25"],f.cell["cell-0"]]},{name:"3Stars",list:[f.star.starFull,f.star.starIncomplete,f.star.starEmpty]}]}],n2=O2.reduce((a,r)=>{const{group:n}=r;for(const e of n)a[e.name]=e.list;return a},{});for(const a in n2){const r=n2[a];Object.freeze(r)}const j2="EMPTY_ICON_TYPE",C0="ssheets-conditional-formatting.config",$2={};var D0=Object.getOwnPropertyDescriptor,f0=(a,r,n,e)=>{for(var t=e>1?void 0:e?D0(r,n):r,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=s(t)||t);return t},X=(a,r)=>(n,e)=>r(n,e,a);C.ConditionalFormattingService=class extends u.Disposable{constructor(r,n,e,t,i,s){super(),this._conditionalFormattingRuleModel=r,this._injector=n,this._univerInstanceService=e,this._resourceManagerService=t,this._sheetInterceptorService=i,this._commandService=s,this._initCellChange(),this._initSnapshot(),this._initSheetChange()}get _conditionalFormattingViewModelV2(){return this._injector.get(C.ConditionalFormattingViewModel)}composeStyle(r,n,e,t){const i=this._conditionalFormattingViewModelV2.getCellCfs(r,n,e,t);if(i&&(i!=null&&i.length)){const s=i.map(l=>this._conditionalFormattingRuleModel.getRule(r,n,l.cfId)).filter(l=>!!l).reverse(),o=s.findIndex(l=>l==null?void 0:l.stopIfTrue);return o>-1&&s.splice(o+1),s.reduce((l,c)=>{var D;const h=c.rule.type,g=i.find(m=>m.cfId===c.cfId);if(h===R.highlightCell)g.result&&u.merge(l,{style:g.result});else if(h===R.colorScale){const m=g==null?void 0:g.result;m&&typeof m=="string"&&(l.style={...(D=l.style)!=null?D:{},bg:{rgb:m}})}else if(h===R.dataBar){const m=g==null?void 0:g.result;m&&(l.dataBar=m,l.isShowValue=m.isShowValue)}else if(h===R.iconSet){const m=g==null?void 0:g.result;m&&(l.iconSet=m,l.isShowValue=m.isShowValue)}return l},{})}return null}_initSnapshot(){const r=e=>{const t=this._conditionalFormattingRuleModel.getUnitRules(e),i={};return t?(t.forEach((s,o)=>{i[o]=s}),JSON.stringify(i)):""},n=e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:h2,businesses:[u.UniverInstanceType.UNIVER_SHEET],toJson:e=>r(e),parseJson:e=>n(e),onUnLoad:e=>{this._conditionalFormattingRuleModel.deleteUnitId(e)},onLoad:(e,t)=>{Object.keys(t).forEach(i=>{[...t[i]].reverse().forEach(o=>{this._conditionalFormattingRuleModel.addRule(e,i,o)})})}}))}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:r=>{if(r.id===p.RemoveSheetCommand.id){const n=r.params,e=n.unitId||m0(this._univerInstanceService),t=n.subUnitId||v0(this._univerInstanceService);if(!t)return{redos:[],undos:[]};const i=this._conditionalFormattingRuleModel.getSubunitRules(e,t);if(!i)return{redos:[],undos:[]};const s=[],o=[];return i.forEach(d=>{const l={unitId:e,subUnitId:t,cfId:d.cfId};s.push({id:j.id,params:l}),o.push(...J(this._injector,l))}),{redos:s,undos:o}}return{redos:[],undos:[]}}}))}_initCellChange(){this.disposeWithMe(this._commandService.onCommandExecuted(r=>{const n=(e,t,i)=>{const s=new Set;return i.forEach(([o,d])=>{const l=this._conditionalFormattingViewModelV2.getCellCfs(e,t,o,d);l==null||l.forEach(c=>s.add(c.cfId))}),[...s].map(o=>this._conditionalFormattingRuleModel.getRule(e,t,o)).filter(o=>!!o)};switch(r.id){case p.SetRangeValuesMutation.id:{const e=r.params,{subUnitId:t,unitId:i,cellValue:s}=e,o=[];new u.ObjectMatrix(s).forValue((l,c,h)=>{h&&Object.keys(h).some(D=>["p","v"].includes(D))&&o.push([l,c])}),n(i,t,o).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,t,l.cfId)});break}case p.InsertColMutation.id:case p.RemoveColMutation.id:{const{range:e,unitId:t,subUnitId:i}=r.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i),o={...e,endColumn:Number.MAX_SAFE_INTEGER};s&&s.filter(l=>l.ranges.some(c=>u.Rectangle.intersects(c,o))).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,l.cfId)});break}case p.RemoveRowMutation.id:case p.InsertRowMutation.id:{const{range:e,unitId:t,subUnitId:i}=r.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i),o={...e,endRow:Number.MAX_SAFE_INTEGER};s&&s.filter(l=>l.ranges.some(c=>u.Rectangle.intersects(c,o))).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,l.cfId)});break}case p.MoveRowsMutation.id:{const{sourceRange:e,targetRange:t,unitId:i,subUnitId:s}=r.params,o=this._conditionalFormattingRuleModel.getSubunitRules(i,s),d={startRow:Math.min(e.startRow,t.startRow),endRow:Number.MAX_SAFE_INTEGER,startColumn:0,endColumn:Number.MAX_SAFE_INTEGER};o&&o.filter(c=>c.ranges.some(h=>u.Rectangle.intersects(h,d))).forEach(c=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,s,c.cfId)});break}case p.MoveColsMutation.id:{const{sourceRange:e,targetRange:t,unitId:i,subUnitId:s}=r.params,o=this._conditionalFormattingRuleModel.getSubunitRules(i,s),d={startRow:0,endRow:Number.MAX_SAFE_INTEGER,startColumn:Math.min(e.startColumn,t.startColumn),endColumn:Number.MAX_SAFE_INTEGER};o&&o.filter(c=>c.ranges.some(h=>u.Rectangle.intersects(h,d))).forEach(c=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,s,c.cfId)});break}case p.MoveRangeMutation.id:{const{unitId:e,to:t,from:i}=r.params,s=o=>{const d=[];new u.ObjectMatrix(o.value).forValue((c,h)=>{d.push([c,h])}),n(e,o.subUnitId,d).forEach(c=>{this._conditionalFormattingViewModelV2.markRuleDirty(e,o.subUnitId,c.cfId)})};s(t),s(i);break}case p.ReorderRangeMutation.id:{const{range:e,unitId:t,subUnitId:i}=r.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i);s&&s.filter(d=>d.ranges.some(l=>u.Rectangle.intersects(l,e))).forEach(d=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,d.cfId)});break}}}))}},C.ConditionalFormattingService=f0([X(0,u.Inject(I)),X(1,u.Inject(u.Injector)),X(2,u.Inject(u.IUniverInstanceService)),X(3,u.Inject(u.IResourceManagerService)),X(4,u.Inject(p.SheetInterceptorService)),X(5,u.Inject(u.ICommandService))],C.ConditionalFormattingService);const m0=a=>a.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET).getUnitId(),v0=a=>{var r;return(r=a.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:r.getSheetId()};var F0=Object.getOwnPropertyDescriptor,w0=(a,r,n,e)=>{for(var t=e>1?void 0:e?F0(r,n):r,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=s(t)||t);return t},F2=(a,r)=>(n,e)=>r(n,e,a);C.UniverSheetsConditionalFormattingPlugin=(u2=class extends u.Plugin{constructor(r=$2,n,e,t){super(),this._config=r,this._injector=n,this._commandService=e,this._configService=t;const{...i}=u.merge({},$2,this._config);this._configService.setConfig(C0,i),[[C.ConditionalFormattingService],[C.ConditionalFormattingFormulaService],[I],[C.ConditionalFormattingViewModel]].forEach(s=>{this._injector.add(s)}),[M2,I2,R2,x2,S2,b2,z,j,G,Z,Q].forEach(s=>{this._commandService.registerCommand(s)})}onStarting(){this._injector.get(C.ConditionalFormattingService),u.touchDependencies(this._injector,[[C.ConditionalFormattingService],[C.ConditionalFormattingViewModel]])}},F(u2,"pluginName",h2),F(u2,"type",u.UniverInstanceType.UNIVER_SHEET),u2),C.UniverSheetsConditionalFormattingPlugin=w0([F2(1,u.Inject(u.Injector)),F2(2,u.Inject(u.ICommandService)),F2(3,u.IConfigService)],C.UniverSheetsConditionalFormattingPlugin);const P2="sheet-conditional-rule-icon",E0=35,W2=15,q2=2;class Z2 extends q.SheetExtension{constructor(){super();F(this,"_paddingRightAndLeft",q2);F(this,"_width",W2);F(this,"_imageMap",new Map);F(this,"uKey",P2);F(this,"Z_INDEX",E0);F(this,"_radius",1);this._init()}draw(n,e,t,i){const{worksheet:s}=t;if(!s)return!1;n.save(),u.Range.foreach(t.rowColumnSegment,(o,d)=>{if(!s.getRowVisible(o)||!s.getColVisible(d))return;const l=s.getCell(o,d);if(l!=null&&l.iconSet){const{iconType:c,iconId:h}=l.iconSet;if(c===j2)return;const g=this._imageMap.get(this._createKey(c,h));if(!g)return;const D=t.getCellWithCoordByIndex(o,d,!1);let{isMerged:m,isMergedMainCell:v,mergeInfo:w,startY:A,endY:S,startX:y,endX:M}=D;if(m||(v&&(A=w.startY,S=w.endY,y=w.startX,M=w.endX),!this.isRenderDiffRangesByCell(w,i)))return;const N=M-y,c2=S-A;if(this._width>c2||this._width>N+this._paddingRightAndLeft*2)return;const w2=(c2-this._width)/2+A;n.drawImage(g,y+this._paddingRightAndLeft,w2,this._width,this._width)}}),n.restore()}_init(){for(const n in n2)n2[n].forEach((t,i)=>{const s=this._createKey(n,String(i)),o=new Image;o.onload=()=>{this._imageMap.set(s,o)},o.src=t})}_createKey(n,e){return`${n}_${e}`}}q.SpreadsheetExtensionRegistry.add(Z2);function G2(a){if(typeof a!="object"||a===null)return a;const r={};for(const n in a)if(a.hasOwnProperty(n)){const e=G2(a[n]);e!==void 0&&(r[n]=e)}return r}Object.defineProperty(C,"isRangesEqual",{enumerable:!0,get:()=>u.isRangesEqual}),C.AddCfCommand=M2,C.AddConditionalRuleMutation=z,C.AddConditionalRuleMutationUndoFactory=_2,C.CFNumberOperator=E,C.CFRuleType=R,C.CFSubRuleType=_,C.CFTextOperator=b,C.CFTimePeriodOperator=L,C.CFValueType=x,C.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH=l2,C.ClearRangeCfCommand=I2,C.ClearWorksheetCfCommand=R2,C.ConditionalFormattingFormulaMarkDirty=Q,C.ConditionalFormattingIcon=Z2,C.ConditionalFormattingRuleModel=I,C.DEFAULT_BG_COLOR=X2,C.DEFAULT_FONT_COLOR=Y2,C.DEFAULT_PADDING=q2,C.DEFAULT_WIDTH=W2,C.DataBar=k2,C.DeleteCfCommand=x2,C.DeleteConditionalRuleMutation=j,C.DeleteConditionalRuleMutationUndoFactory=J,C.EMPTY_ICON_TYPE=j2,C.FormulaResultStatus=T,C.IconUKey=P2,C.MoveCfCommand=S2,C.MoveConditionalRuleMutation=Z,C.MoveConditionalRuleMutationUndoFactory=y2,C.SHEET_CONDITIONAL_FORMATTING_PLUGIN=h2,C.SetCfCommand=b2,C.SetConditionalRuleMutation=G,C.anchorUndoFactory=p2,C.compareWithNumber=H,C.createCfId=A2,C.createDefaultRule=K2,C.createDefaultValue=J2,C.createDefaultValueByValueType=z2,C.dataBarUKey=L2,C.defaultDataBarNativeColor=m2,C.defaultDataBarPositiveColor=f2,C.defaultPlaceholderColor=T2,C.filterRange=o2,C.findIndexByAnchor=O,C.getCacheStyleMatrix=h0,C.getCellValue=U,C.getColorScaleFromValue=V2,C.getMaxInFormulaResult=g0,C.getOppositeOperator=U2,C.getValueByType=t2,C.iconGroup=O2,C.iconMap=n2,C.isAnchorEqual=Q2,C.isFloatsEqual=e2,C.isNullable=k,C.moveByAnchor=E2,C.removeUndefinedAttr=G2,C.serialTimeToTimestamp=N2,C.setConditionalRuleMutationUndoFactory=C2,C.toYMD_1900=B2,C.transformSupportSymmetryAnchor=g2,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})}));
2
+ (function(C,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("rxjs"),require("@univerjs/engine-formula"),require("rxjs/operators"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","rxjs","@univerjs/engine-formula","rxjs/operators","@univerjs/engine-render"],u):(C=typeof globalThis<"u"?globalThis:C||self,u(C.UniverSheetsConditionalFormatting={},C.UniverCore,C.UniverSheets,C.rxjs,C.UniverEngineFormula,C.rxjs.operators,C.UniverEngineRender))})(this,(function(C,u,p,J,O,r2,G){"use strict";var _0=Object.defineProperty;var M0=(C,u,p)=>u in C?_0(C,u,{enumerable:!0,configurable:!0,writable:!0,value:p}):C[u]=p;var F=(C,u,p)=>M0(C,typeof u!="symbol"?u+"":u,p);var c2;const h2="SHEET_CONDITIONAL_FORMATTING_PLUGIN";var b=(r=>(r.beginsWith="beginsWith",r.endsWith="endsWith",r.containsText="containsText",r.notContainsText="notContainsText",r.equal="equal",r.notEqual="notEqual",r.containsBlanks="containsBlanks",r.notContainsBlanks="notContainsBlanks",r.containsErrors="containsErrors",r.notContainsErrors="notContainsErrors",r))(b||{}),L=(r=>(r.today="today",r.yesterday="yesterday",r.tomorrow="tomorrow",r.last7Days="last7Days",r.thisMonth="thisMonth",r.lastMonth="lastMonth",r.nextMonth="nextMonth",r.thisWeek="thisWeek",r.lastWeek="lastWeek",r.nextWeek="nextWeek",r))(L||{}),E=(r=>(r.greaterThan="greaterThan",r.greaterThanOrEqual="greaterThanOrEqual",r.lessThan="lessThan",r.lessThanOrEqual="lessThanOrEqual",r.notBetween="notBetween",r.between="between",r.equal="equal",r.notEqual="notEqual",r))(E||{}),I=(r=>(r.highlightCell="highlightCell",r.dataBar="dataBar",r.colorScale="colorScale",r.iconSet="iconSet",r))(I||{}),y=(r=>(r.uniqueValues="uniqueValues",r.duplicateValues="duplicateValues",r.rank="rank",r.text="text",r.timePeriod="timePeriod",r.number="number",r.average="average",r.formula="formula",r))(y||{}),R=(r=>(r.num="num",r.min="min",r.max="max",r.percent="percent",r.percentile="percentile",r.formula="formula",r))(R||{});const Y2="#fff",K2="#000000",J2=()=>({cfId:void 0,ranges:[],stopIfTrue:!1,rule:{type:"highlightCell",subType:"text",operator:"containsText"}}),z2=(r,a)=>{switch(r){case"text":{if(["beginsWith","containsText","endsWith","equal","notContainsText","notEqual"].includes(a))return"";break}case"number":return["between","notBetween"].includes(a)?[10,100]:10}return""},Q2=(r,a)=>{switch(r){case"formula":return"=";case"max":case"min":return"";case"percent":case"percentile":case"num":return a!==void 0?a:10}return""},j=(r,a,n)=>{if(!a)return null;const e=a.findIndex(t=>n(t)===r.id);if(e<0)return null;switch(r.type){case"after":return e+1;case"before":return e-1;case"self":return e}},p2=(r,a,n,e)=>{if(!n)return null;const t=j(r,n,e);let i=j(a,n,e);if(t===null||i===null||t===i)return;const s=n.splice(t,1)[0];switch(t<i&&(i=j(a,n,e)),a.type){case"before":{n.splice(i+1,0,s);break}case"self":case"after":{n.splice(i,0,s);break}}},g2=(r,a,n,e)=>{if(r.type==="after"&&["after","before"].includes(a.type))return[r,a];const t={...r},i={...a};if(t.type!=="after"){const s=j(t,n,e);if(s===null)return null;if(s-1<0){const o=n[s+1];if(o)t.id=e(o),t.type="before";else return null}else{const o=e(n[s-1]);t.id=o,t.type="after"}}if(!["after","before"].includes(i.type)){const s=j(i,n,e);if(s===null)return null;if(s===0)i.type="before";else if(s-1>=0){const o=e(n[s-1]);i.id=o,i.type="after"}else if(s+1<=n.length-1){const o=e(n[s+1]);i.id=o,i.type="before"}else return null}return t.id===i.id&&t.type===i.type?null:[t,i]},A2=(r,a)=>{if(["after","before"].includes(a.type)){if(r.type==="after")return[a,r];if(r.type==="before")return[a,{...r,type:"self"}]}return null},e0=(r,a)=>r.id===a.id&&r.type===a.type,y2=()=>`${u.generateRandomId(8)}`;class M{constructor(){F(this,"_model",new Map);F(this,"_ruleChange$",new J.Subject);F(this,"$ruleChange",this._ruleChange$.asObservable())}_ensureList(a,n){let e=this.getSubunitRules(a,n);if(!e){e=[];let t=this._model.get(a);t||(t=new Map,this._model.set(a,t)),t.set(n,e)}return e}getRule(a,n,e){const t=this.getSubunitRules(a,n);return t?t.find(i=>i.cfId===e):null}getUnitRules(a){return this._model.get(a)||null}getSubunitRules(a,n){var t;return((t=this._model.get(a))==null?void 0:t.get(n))||null}deleteRule(a,n,e){const t=this.getSubunitRules(a,n);if(t){const i=t.findIndex(o=>o.cfId===e),s=t[i];s&&(t.splice(i,1),this._ruleChange$.next({rule:s,subUnitId:n,unitId:a,type:"delete"}))}}setRule(a,n,e,t){const s=this._ensureList(a,n).find(o=>o.cfId===t);if(s){const o=u.Tools.deepClone(s);Object.assign(s,e),this._ruleChange$.next({rule:s,subUnitId:n,unitId:a,type:"set",oldRule:o})}}addRule(a,n,e){const t=this._ensureList(a,n);t.find(s=>s.cfId===e.cfId)||t.unshift(e),this._ruleChange$.next({rule:e,subUnitId:n,unitId:a,type:"add"})}moveRulePriority(a,n,e,t){const i=this._ensureList(a,n),s=j(e,i,l=>l.cfId),o=j(t,i,l=>l.cfId);if(o===null||s===null||o===s)return;const d=i[s];d&&(p2(e,t,i,l=>l.cfId),this._ruleChange$.next({rule:d,subUnitId:n,unitId:a,type:"sort"}))}createCfId(a,n){return y2()}deleteUnitId(a){this._model.delete(a)}}const H={type:u.CommandType.MUTATION,id:"sheet.mutation.move-conditional-rule",handler(r,a){if(!a)return!1;const{unitId:n,subUnitId:e,start:t,end:i}=a;return r.get(M).moveRulePriority(n,e,t,i),!0}},_2=r=>{const{unitId:a,subUnitId:n}=r,e=A2(r.start,r.end);if(!e)return[];const[t,i]=e;return[{id:H.id,params:{unitId:a,subUnitId:n,start:t,end:i}}]},z=(r,a)=>{const n=r.get(M),{unitId:e,subUnitId:t,cfId:i}=a,s=[...n.getSubunitRules(e,t)||[]],o=s.findIndex(l=>l.cfId===i),d=s[o-1];if(o>-1){const l=s[o],c=[{id:Q.id,params:{unitId:e,subUnitId:t,rule:u.Tools.deepClone(l)}}];if(s.splice(o,1),o!==0){const h=s[0];if(h){const g=g2({id:h.cfId,type:"before"},{id:d.cfId,type:"after"},s,w=>w.cfId);if(!g)return c;const[D,f]=g,v={unitId:e,subUnitId:t,start:D,end:f};c.push({id:H.id,params:v})}}return c}return[]},$={type:u.CommandType.MUTATION,id:"sheet.mutation.delete-conditional-rule",handler(r,a){if(!a)return!1;const{unitId:n,subUnitId:e,cfId:t}=a;return r.get(M).deleteRule(n,e,t),!0}},M2=(r,a)=>({id:$.id,params:{unitId:a.unitId,subUnitId:a.subUnitId,cfId:a.rule.cfId}}),Q={type:u.CommandType.MUTATION,id:"sheet.mutation.add-conditional-rule",handler(r,a){if(!a)return!1;const{unitId:n,subUnitId:e,rule:t}=a;return r.get(M).addRule(n,e,t),!0}},I2={type:u.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(r,a){if(!a)return!1;const{rule:n}=a,e=r.get(u.IUndoRedoService),t=r.get(u.ICommandService),i=r.get(M),s=r.get(u.IUniverInstanceService),o=p.getSheetCommandTarget(s,a);if(!o)return!1;const{unitId:d,subUnitId:l}=o,c=i.createCfId(d,l),h={unitId:d,subUnitId:l,rule:{...n,cfId:n.cfId||c}},g=M2(r,h),D=t.syncExecuteCommand(Q.id,h);return D&&e.pushUndoRedo({unitID:d,redoMutations:[{id:Q.id,params:h}],undoMutations:[g]}),D}},X={type:u.CommandType.MUTATION,id:"sheet.mutation.set-conditional-rule",handler(r,a){if(!a)return!1;const{unitId:n,subUnitId:e,rule:t}=a,i=a.cfId||a.rule.cfId;return r.get(M).setRule(n,e,t,i),!0}},C2=(r,a)=>{const n=r.get(M),{unitId:e,subUnitId:t}=a,i=a.cfId||a.rule.cfId,s=n.getRule(e,t,i);return s?[{id:X.id,params:{unitId:e,subUnitId:t,cfId:i,rule:u.Tools.deepClone(s)}}]:[]},R2={type:u.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(r,a){var v;if(!a)return!1;const n=r.get(M),e=r.get(u.IUniverInstanceService),t=r.get(u.ICommandService),i=r.get(u.IUndoRedoService),s=r.get(p.SheetsSelectionsService),o=p.getSheetCommandTarget(e,a);if(!o)return!1;const{unitId:d,subUnitId:l}=o,c=((v=s.getCurrentSelections())==null?void 0:v.map(w=>w.range))||[],h=n.getSubunitRules(d,l);if(!(h!=null&&h.length)||!c.length)return!1;const g=[],D=[];h.forEach(w=>{const A=new u.ObjectMatrix;w.ranges.forEach(_=>{u.Range.foreach(_,(S,B)=>{A.setValue(S,B,1)})}),c.forEach(_=>{u.Range.foreach(_,(S,B)=>{A.realDeleteValue(S,B)})});const x=p.findAllRectangle(p.createTopMatrixFromMatrix(A));if(x.length){const _={...w,ranges:x},S={unitId:d,subUnitId:l,rule:_},B=C2(r,S);g.push({id:X.id,params:S}),D.push(...B)}else{const _={unitId:d,subUnitId:l,cfId:w.cfId},S=z(r,_);g.push({id:$.id,params:_}),D.push(...S)}});const f=u.sequenceExecute(g,t).result;return f&&i.pushUndoRedo({unitID:d,redoMutations:g,undoMutations:D}),f}},x2={type:u.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(r,a){const n=r.get(M),e=r.get(u.IUniverInstanceService),t=r.get(u.ICommandService),i=r.get(u.IUndoRedoService),s=p.getSheetCommandTarget(e,a);if(!s)return!1;const{unitId:o,subUnitId:d}=s,l=n.getSubunitRules(o,d);if(!(l!=null&&l.length))return!1;const c=l.map(f=>({cfId:f.cfId,unitId:o,subUnitId:d})),h=c.map(f=>({id:$.id,params:f})),g=c.map(f=>z(r,f)[0]),D=u.sequenceExecute(h,t).result;return D&&i.pushUndoRedo({unitID:o,redoMutations:h,undoMutations:g}),D}},S2={type:u.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(r,a){if(!a)return!1;const n=r.get(u.IUndoRedoService),e=r.get(u.ICommandService),t=r.get(u.IUniverInstanceService),i=p.getSheetCommandTarget(t,a);if(!i)return!1;const{unitId:s,subUnitId:o}=i,d={unitId:s,subUnitId:o,cfId:a.cfId},l=z(r,d),c=e.syncExecuteCommand($.id,d);return c&&n.pushUndoRedo({unitID:s,undoMutations:l,redoMutations:[{id:$.id,params:d}]}),c}},b2={type:u.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(r,a){if(!a)return!1;const n=r.get(u.IUndoRedoService),e=r.get(u.ICommandService),t=r.get(u.IUniverInstanceService),i=r.get(M),s=p.getSheetCommandTarget(t,a);if(!s)return!1;const{unitId:o,subUnitId:d}=s,l=g2(a.start,a.end,i.getSubunitRules(o,d)||[],v=>v.cfId);if(!l)return!1;const[c,h]=l,g={unitId:o,subUnitId:d,start:c,end:h},D=_2(g),f=e.syncExecuteCommand(H.id,g);return f&&n.pushUndoRedo({unitID:o,redoMutations:[{id:H.id,params:g}],undoMutations:D}),f}},L2={type:u.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(r,a){if(!a)return!1;const n=r.get(u.IUndoRedoService),e=r.get(u.ICommandService),t=r.get(u.IUniverInstanceService),i=p.getSheetCommandTarget(t,a);if(!i)return!1;const{unitId:s,subUnitId:o}=i,d={unitId:s,subUnitId:o,rule:a.rule,cfId:a.cfId},l=C2(r,d),c=e.syncExecuteCommand(X.id,d);return c&&n.pushUndoRedo({unitID:s,undoMutations:l,redoMutations:[{id:X.id,params:d}]}),c}},e2={type:u.CommandType.MUTATION,id:"sheet.mutation.conditional-formatting-formula-mark-dirty",handler(){return!0}};var t0=Object.getOwnPropertyDescriptor,n0=(r,a,n,e)=>{for(var t=e>1?void 0:e?t0(a,n):a,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=s(t)||t);return t},D2=(r,a)=>(n,e)=>a(n,e,r),T=(r=>(r[r.NOT_REGISTER=1]="NOT_REGISTER",r[r.SUCCESS=2]="SUCCESS",r[r.WAIT=3]="WAIT",r[r.ERROR=4]="ERROR",r))(T||{});const i0=r=>{const a=r&&r[0]&&r[0][0];return(a==null?void 0:a.t)===u.CellValueType.BOOLEAN?a.v===u.BooleanNumber.TRUE||a.v===!0:a?a.v:!1};C.ConditionalFormattingFormulaService=class extends u.Disposable{constructor(n,e,t){super();F(this,"_formulaMap",new Map);F(this,"_result$",new J.Subject);F(this,"result$",this._result$.asObservable());this._commandService=n,this._activeDirtyManagerService=e,this._conditionalFormattingRuleModel=t,this._initFormulaCalculationResultChange(),this._initRuleChange()}_initRuleChange(){const n=e=>{switch(e.type){case I.colorScale:return e.config.some(t=>t.value.type===R.formula);case I.dataBar:return[e.config.max,e.config.min].some(t=>t.type===R.formula);case I.iconSet:return e.config.some(t=>t.value.type===R.formula)}};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(e=>{const{unitId:t,subUnitId:i,rule:s,oldRule:o}=e;e.type==="delete"&&this._removeFormulaByCfId(t,i,s.cfId),e.type==="set"&&(n(s.rule)||o&&n(o.rule))&&this._removeFormulaByCfId(t,i,s.cfId)}))}_initFormulaCalculationResultChange(){this.disposeWithMe(this._commandService.onCommandExecuted(n=>{if(n.id===O.SetFormulaCalculationResultMutation.id){const e=n.params;for(const t in e.unitOtherData)for(const i in e.unitOtherData[t])for(const s in e.unitOtherData[t][i]){const o=new u.ObjectMatrix(e.unitOtherData[t][i][s]),d=this._ensureSubunitFormulaMap(t,i).getValue(s,["formulaId"]);if(!d)continue;const l=d.ranges;if(!l)continue;const c=d.result,h=l[0].startRow,g=l[0].startColumn;o.forValue((v,w,A)=>{c.setValue(h+v,g+w,i0(A))}),d.status=2;const f=this._getAllFormulaResultByCfId(t,i,d.cfId).every(v=>v.status===2);this._result$.next({...d,isAllFinished:f})}}})),this._activeDirtyManagerService.register(e2.id,{commandId:e2.id,getDirtyData(n){return{dirtyUnitOtherFormulaMap:n.params}}})}_ensureSubunitFormulaMap(n,e){let t=this._formulaMap.get(n);t||(t=new Map,this._formulaMap.set(n,t));let i=t.get(e);return i||(i=new u.RefAlias([],["formulaId","id"]),t.set(e,i)),i}getSubUnitFormulaMap(n,e){var t;return(t=this._formulaMap.get(n))==null?void 0:t.get(e)}registerFormulaWithRange(n,e,t,i,s=[{startRow:0,endRow:0,startColumn:0,endColumn:0}]){const o=this._ensureSubunitFormulaMap(n,e),d=this.createCFormulaId(t,i);if(o.getValue(d,["id"]))return;const l=this._createFormulaId(n,e);o.addValue({formulaText:i,unitId:n,subUnitId:e,cfId:t,id:d,ranges:s,formulaId:l,status:3,result:new u.ObjectMatrix});const c={unitId:n,subUnitId:e,formulaMap:{[l]:{f:i,ranges:s}}};this._commandService.executeCommand(O.SetOtherFormulaMutation.id,c,{onlyLocal:!0}).then(()=>{this._commandService.executeCommand(e2.id,{[n]:{[e]:{[l]:!0}}},{onlyLocal:!0})})}_removeFormulaByCfId(n,e,t){const s=this.deleteCache(n,e,t).map(o=>o.formulaId);this._commandService.executeCommand(O.RemoveOtherFormulaMutation.id,{unitId:n,subUnitId:e,formulaIdList:s},{onlyLocal:!0})}getFormulaResultWithCoords(n,e,t,i,s=0,o=0){const d=this.getSubUnitFormulaMap(n,e);if(!d)return{status:1};const l=d.getValue(this.createCFormulaId(t,i),["id"]);return l?l.status===2&&l.result?{result:l.result.getValue(s,o),status:2}:l.status===3?{status:3}:{status:4}:{status:1}}getFormulaMatrix(n,e,t,i){const s=this.getSubUnitFormulaMap(n,e);if(!s)return{status:1};const o=s.getValue(this.createCFormulaId(t,i),["id"]);if(!o)return{status:1};if(o.status===2&&o.result)return{result:o.result,status:2}}deleteCache(n,e,t,i){const s=this.getSubUnitFormulaMap(n,e);if(!s)return[];if(i){const o=this.createCFormulaId(t,i);return s.deleteValue(o,["id"]),[]}else{const o=s.getValues().filter(d=>d.cfId===t);return o.forEach(d=>{s.deleteValue(d.formulaId,["formulaId"])}),o}}_getAllFormulaResultByCfId(n,e,t){const i=this.getSubUnitFormulaMap(n,e);return i?i.getValues().filter(o=>o.cfId===t):[]}_createFormulaId(n,e){return`sheet.cf_${n}_${e}_${u.generateRandomId(8)}`}createCFormulaId(n,e){return`${n}_${e}`}},C.ConditionalFormattingFormulaService=n0([D2(0,u.Inject(u.ICommandService)),D2(1,u.Inject(O.IActiveDirtyManagerService)),D2(2,u.Inject(M))],C.ConditionalFormattingFormulaService);var U=(r=>(r.preComputingStart="preComputingStart",r.preComputing="preComputing",r.preComputingEnd="preComputingEnd",r.preComputingError="preComputingError",r))(U||{});class a2{constructor(a){F(this,"_cache");F(this,"_preComputingStatus$",new J.BehaviorSubject("preComputingStart"));F(this,"preComputingStatus$",this._preComputingStatus$.asObservable().pipe(r2.distinctUntilChanged()));F(this,"_preComputingCache");F(this,"_rule");this._context=a,this._cache=new u.LRUMap(a.limit),this._rule=a.rule,this._preComputingCache=null,this._initClearCacheListener()}setCacheLength(a){this._cache.limit=a}clearCache(){this._cache.clear()}resetPreComputingCache(){this._preComputingStatus$.next("preComputingStart"),this._preComputingCache=null}updateRule(a){this._rule=a,this.resetPreComputingCache()}getCell(a,n){const e=this._createKey(a,n);if(this._preComputingStatus$.getValue()==="preComputing")return this._cache.get(e);let t=this.getPreComputingResult(a,n);if(t===null&&(this._preComputingStatus$.next("preComputingStart"),this.preComputing(a,n,this._getContext()),t=this.getPreComputingResult(a,n),t===null))return this._cache.get(e);if(this._preComputingStatus$.next("preComputingEnd"),this._cache.has(e))return this._cache.get(e);const i=this.getCellResult(a,n,t,this._getContext());return i!==null&&this._setCache(a,n,i),i}setPreComputingCache(a){this._preComputingCache=a}getPreComputingResult(a,n){return this._preComputingCache}_createKey(a,n){return`${a}_${n}`}_setCache(a,n,e){const t=this._createKey(a,n);this._cache.set(t,e)}_getContext(){return{...this._context,rule:this._rule}}_initClearCacheListener(){this.preComputingStatus$.subscribe(a=>{a==="preComputingEnd"&&this.clearCache()})}}class r0 extends a2{preComputing(a,n,e){const t=e.rule,i=e.worksheet,s=new u.ObjectMatrix;!t.rule.config.every(c=>c.value.type===R.num)&&u2(t.ranges,i.getMaxRows()-1,i.getMaxColumns()-1).forEach(h=>{u.Range.foreach(h,(g,D)=>{const f=e.getCellValue(g,D),v=f&&f.v;if(!k(v)&&(f==null?void 0:f.t)===u.CellValueType.NUMBER){const w=Number(v);!Number.isNaN(w)&&s.setValue(g,D,w)}})});const d=[...t.rule.config].sort((c,h)=>c.index-h.index).map(c=>({value:n2(c.value,s,{...e,cfId:t.cfId}),color:new u.ColorKit(c.color)}));if(!d.some(c=>G.isObject(c.value)?c.value.status!==T.SUCCESS:!1)){const c=d.map(h=>h.color).reduce((h,g,D)=>(h.result.push({color:g,value:h.sortValue[D]}),h),{result:[],sortValue:d.map(h=>h.value.result).sort((h,g)=>h-g)}).result;this.setPreComputingCache(c),this._preComputingStatus$.next(U.preComputingEnd);return}this._preComputingStatus$.next(U.preComputing)}getCellResult(a,n,e,t){if(!e)return null;const i=t.getCellValue(a,n);if(i.t===u.CellValueType.NUMBER){const s=Number(i.v);if(!Number.isNaN(s))return O2(e,s)}}}const T2="sheet-conditional-rule-data-bar",f2="#ffbe38",m2="#abd91a",k2="#000",a0=34,s0=r=>{const{startRow:a,endRow:n,startColumn:e,endColumn:t}=r;return`${a}-${n}-${e}-${t}`};class B2 extends G.SheetExtension{constructor(){super(...arguments);F(this,"_paddingRightAndLeft",2);F(this,"_paddingTopAndBottom",2);F(this,"uKey",T2);F(this,"Z_INDEX",a0);F(this,"_radius",1)}draw(n,e,t,i){const{worksheet:s}=t;if(!s)return!1;const o=new Set;n.save(),u.Range.foreach(t.rowColumnSegment,(d,l)=>{if(!s.getRowVisible(d)||!s.getColVisible(l))return;const c=t.getCellWithCoordByIndex(d,l,!1),{isMerged:h,isMergedMainCell:g,mergeInfo:D}=c;let f=s.getCell(d,l);if(h&&(f=s.getCell(D.startRow,D.startColumn)),!(f!=null&&f.dataBar)||!this.isRenderDiffRangesByCell(D,i))return;if(h||g){const V=s0(D);if(o.has(V))return;o.add(V)}const{color:v,value:w,startPoint:A,isGradient:x}=f.dataBar,{startX:_,endX:S,startY:B,endY:w2}=h||g?D:c,d2=S-_,E2=w2+G.FIX_ONE_PIXEL_BLUR_OFFSET-B,P=d2-this._paddingRightAndLeft*2,X2=E2-this._paddingTopAndBottom*2;if(w>0){const V=Math.max(P*(1-A/100)*w/100,1),W=_+this._paddingRightAndLeft+A/100*P,q=B+this._paddingTopAndBottom;if(x){const Z=n.createLinearGradient(W,q,W+V,q);Z.addColorStop(0,v),Z.addColorStop(1,"rgb(255 255 255)"),n.fillStyle=Z,n.strokeStyle=v,n.lineWidth=1}else n.fillStyle=v;this._drawRectWithRoundedCorner(n,W,q,V,X2,!1,!0,!0,!1),x&&n.stroke()}else{const V=Math.max(P*A/100*Math.abs(w)/100,1),W=_+this._paddingRightAndLeft+A/100*P-V,q=B+this._paddingTopAndBottom;if(x){const Z=n.createLinearGradient(W,q,W+V,q);Z.addColorStop(0,"rgb(255 255 255)"),Z.addColorStop(1,v),n.fillStyle=Z,n.strokeStyle=v,n.lineWidth=1}else n.fillStyle=v;this._drawRectWithRoundedCorner(n,W,q,V,X2,!0,!1,!1,!0),x&&n.stroke()}}),n.restore()}_drawRectWithRoundedCorner(n,e,t,i,s,o,d,l,c){const h=this._radius;!s||!i||(n.beginPath(),n.moveTo(e+h,t),n.lineTo(e+i-h,t),d?n.arcTo(e+i,t,e+i,t+h,h):n.lineTo(e+i,t),n.lineTo(e+i,t+s-h),l?n.arcTo(e+i,t+s,e+i-h,t+s,h):n.lineTo(e+i,t+s),n.lineTo(e+h,t+s),c?n.arcTo(e,t+s,e,t+s-h,h):n.lineTo(e,t+s),n.lineTo(e,t+h),o?n.arcTo(e,t,e+h,t,h):n.lineTo(e,t),n.closePath(),n.fill())}}G.SpreadsheetExtensionRegistry.add(B2);const s2=r=>Math.max(Math.min(100,r),0),l0=(r,a,n)=>{const e=n(r,a);if(e&&e.t===u.CellValueType.NUMBER){const t=Number(e.v);return Number.isNaN(t)?null:t}return null};class o0 extends a2{preComputing(a,n,e){const t=e.rule,i=t.rule,s=e.worksheet,o=new u.ObjectMatrix;![t.rule.config.max,t.rule.config.min].every(D=>D.type===R.num)&&u2(t.ranges,s.getMaxRows()-1,s.getMaxColumns()-1).forEach(f=>{u.Range.foreach(f,(v,w)=>{const A=e.getCellValue(v,w),x=A&&A.v;if(!k(x)&&(A==null?void 0:A.t)===u.CellValueType.NUMBER){const _=Number(x);!Number.isNaN(_)&&o.setValue(v,w,_)}})});const l=n2(i.config.min,o,{...e,cfId:t.cfId}),c=n2(i.config.max,o,{...e,cfId:t.cfId});let h=0,g=0;if(l.status===T.SUCCESS){const D=Number(l.result);h=Number.isNaN(D)?0:D}else{this._preComputingStatus$.next(U.preComputing);return}if(c.status===T.SUCCESS){const D=Number(c.result),f=Number.isNaN(D)?0:D;g=Math.max(f,h),h=Math.min(f,h);let v=50;if(h<0&&g<=0)v=100;else if(h<0&&g>0){const w=Math.abs(g)+Math.abs(h);v=Math.abs(h)/w*100}else h>=0&&g>0&&(v=0);this.setPreComputingCache({min:h,max:g,startPoint:v}),this._preComputingStatus$.next(U.preComputingEnd);return}this._preComputingStatus$.next(U.preComputing)}getCellResult(a,n,e,t){const{min:i,max:s,startPoint:o}=e,l=t.rule.rule,c=l.isShowValue,h=l.config.isGradient,g=l0(a,n,t.getCellValue);if(!(g===null||g<i||i===s||s<i)){if(g===0)return{color:k2,startPoint:o,value:0,isGradient:h,isShowValue:c};if(i<0&&s<=0){const D=s-i,f=s2((s-g)/D*100);return f===0?void 0:{color:l.config.nativeColor||m2,startPoint:o,value:-f,isGradient:h,isShowValue:c}}else if(i<0&&s>0)if(g>0){const D=s2(Math.min(g/s,1)*100);return D===0?void 0:{color:l.config.positiveColor||f2,startPoint:o,value:D,isGradient:h,isShowValue:c}}else{const D=s2(Math.min(Math.abs(g)/Math.abs(i),1)*100);return D===0?void 0:{color:l.config.nativeColor||m2,startPoint:o,value:-D,isGradient:h,isShowValue:c}}else if(i>=0&&s>0){const D=s-i,f=0,v=s2((1-(s-g)/D)*100);return v===0?void 0:{color:l.config.positiveColor||f2,startPoint:f,value:v,isGradient:h,isShowValue:c}}}}}class u0 extends a2{preComputing(a,n,e){const t=e.rule.rule,i=e.rule.ranges,o=(()=>{switch(t.subType){case y.average:{let d=0,l=0;return i.forEach(c=>{u.Range.foreach(c,(h,g)=>{const D=e.getCellValue(h,g),f=N(D||void 0);D&&D.t===u.CellValueType.NUMBER&&f!==void 0&&(d+=Number(f)||0,l++)})}),{value:d/l,type:t.subType}}case y.uniqueValues:case y.duplicateValues:{const d=new Map;return i.forEach(l=>{u.Range.foreach(l,(c,h)=>{const g=e.getCellValue(c,h),D=N(g||void 0);if(D!==void 0){const f=d.get(D);f?d.set(D,f+1):d.set(D,1)}})}),{value:d,type:t.subType}}case y.rank:{let d=[];i.forEach(h=>{u.Range.foreach(h,(g,D)=>{const f=e.getCellValue(g,D),v=N(f||void 0);f&&f.t===u.CellValueType.NUMBER&&v!==void 0&&d.push(Number(v)||0)})}),d.sort((h,g)=>g-h);const l=e.rule.rule;if(l.isPercent){l.isBottom&&(d=d.toReversed());const h=u.Tools.clamp(l.value,0,100)/100,g=Math.floor(h*d.length),D=u.Tools.clamp(g-1,0,d.length-1);return{value:d[D],type:t.subType}}const c=Math.floor(u.Tools.clamp(l.isBottom?l.value-1:l.value,0,d.length));return l.isBottom?{value:d[d.length-c-1],type:t.subType}:{value:d[Math.max(c-1,0)],type:t.subType}}case y.formula:{const d=t,l=e.accessor.get(C.ConditionalFormattingFormulaService);l.registerFormulaWithRange(e.unitId,e.subUnitId,e.rule.cfId,d.value,e.rule.ranges);const c=l.getFormulaMatrix(e.unitId,e.subUnitId,e.rule.cfId,d.value);return c&&c.status===T.SUCCESS?(this._preComputingStatus$.next(U.preComputingEnd),{value:c.result,type:t.subType}):(this._preComputingStatus$.next(U.preComputing),null)}case y.timePeriod:switch(t.operator){case L.last7Days:return{value:{start:u.dayjs().subtract(7,"day").valueOf(),end:u.dayjs().valueOf()},type:t.subType};case L.lastMonth:return{value:{start:u.dayjs().startOf("month").subtract(1,"month").valueOf(),end:u.dayjs().endOf("month").subtract(1,"month").valueOf()},type:t.subType};case L.lastWeek:return{value:{start:u.dayjs().startOf("week").subtract(1,"week").valueOf(),end:u.dayjs().endOf("week").subtract(1,"week").valueOf()},type:t.subType};case L.nextMonth:return{value:{start:u.dayjs().startOf("month").add(1,"month").valueOf(),end:u.dayjs().endOf("month").add(1,"month").valueOf()},type:t.subType};case L.nextWeek:return{value:{start:u.dayjs().startOf("week").add(1,"week").valueOf(),end:u.dayjs().endOf("week").add(1,"week").valueOf()},type:t.subType};case L.thisMonth:return{value:{start:u.dayjs().startOf("month").valueOf(),end:u.dayjs().endOf("month").valueOf()},type:t.subType};case L.thisWeek:return{value:{start:u.dayjs().startOf("week").valueOf(),end:u.dayjs().endOf("week").valueOf()},type:t.subType};case L.today:return{value:{start:u.dayjs().startOf("day").valueOf(),end:u.dayjs().endOf("day").valueOf()},type:t.subType};case L.tomorrow:return{value:{start:u.dayjs().startOf("day").add(1,"day").valueOf(),end:u.dayjs().endOf("day").add(1,"day").valueOf()},type:t.subType};case L.yesterday:return{value:{start:u.dayjs().startOf("day").subtract(1,"day").valueOf(),end:u.dayjs().endOf("day").subtract(1,"day").valueOf()},type:t.subType}}}})();this.setPreComputingCache(o)}getCellResult(a,n,e,t){const i=t.getCellValue(a,n),s=t.rule.rule;return(()=>{switch(s.subType){case y.number:{const l=i&&Number(i.v),c=(i==null?void 0:i.t)===u.CellValueType.NUMBER,h=s;return c?k(l)||Number.isNaN(l)?void 0:Y({operator:h.operator,value:h.value||0},l||0):!![E.notEqual,E.notBetween].includes(h.operator)}case y.text:{const l=s,c=N(i),h=c===null?"":String(c),g=l.value||"";switch(l.operator){case b.beginsWith:return h.startsWith(g);case b.containsBlanks:return/^\s*$/.test(h);case b.notContainsBlanks:return!/^\s*$/.test(h);case b.containsErrors:return O.ERROR_TYPE_SET.has(h);case b.notContainsErrors:return!O.ERROR_TYPE_SET.has(h);case b.containsText:return h.indexOf(g)>-1;case b.notContainsText:return h.indexOf(g)===-1;case b.endsWith:return h.endsWith(g);case b.equal:return h===g;case b.notEqual:return h!==g;default:return!1}}case y.timePeriod:{const l=N(i);if(k(l)||Number.isNaN(Number(l))||(i==null?void 0:i.t)!==u.CellValueType.NUMBER||!e)return;const c=N2(Number(l)),{start:h,end:g}=e.value;return c>=h&&c<=g}case y.average:{const l=i&&i.v,c=Number(l),h=(i==null?void 0:i.t)===u.CellValueType.NUMBER,g=s;if(!h)return E.notEqual===g.operator;if(k(l)||Number.isNaN(c)||!e)return!1;const D=e.value;switch(g.operator){case E.greaterThan:return c>D;case E.greaterThanOrEqual:return c>=D;case E.lessThan:return c<D;case E.lessThanOrEqual:return c<=D;case E.equal:return t2(c,D);case E.notEqual:return!t2(c,D);default:return!1}}case y.rank:{const l=N(i),c=Number(l);if(k(l)||Number.isNaN(c)||(i==null?void 0:i.t)!==u.CellValueType.NUMBER||!e)return!1;const h=e.value;return s.isBottom?c<=h:c>=h}case y.uniqueValues:{const l=N(i);return k(l)||!e?!1:e.value.get(l)===1}case y.duplicateValues:{const l=N(i);return k(l)||!e?!1:e.value.get(l)!==1}case y.formula:{const l=e==null?void 0:e.value;return l?l.getValue(a,n)===!0:!1}}})()?s.style:{}}}const c0=(r,a,n)=>{const e=n(r,a);if(e&&e.t===u.CellValueType.NUMBER){const t=Number(e.v);return Number.isNaN(t)?null:t}return null};class d0 extends a2{preComputing(a,n,e){const t=e.rule.rule,i=e.worksheet,s=new u.ObjectMatrix;!t.config.every(c=>c.value.type===R.num)&&u2(e.rule.ranges,i.getMaxRows()-1,i.getMaxColumns()-1).forEach(h=>{u.Range.foreach(h,(g,D)=>{const f=e.getCellValue(g,D),v=f&&f.v;if(!k(v)&&(f==null?void 0:f.t)===u.CellValueType.NUMBER){const w=Number(v);!Number.isNaN(w)&&s.setValue(g,D,w)}})});const d=t.config.map(c=>n2(c.value,s,{...e,cfId:e.rule.cfId}));if(!d.some(c=>c.status!==T.SUCCESS)){const c=d.map((h,g)=>({operator:t.config[g].operator,value:Number(h.result)||0})).reduce((h,g,D,f)=>{const v=t.config[D];if(!D||D===f.length-1)h.push({...g,iconId:v.iconId,iconType:v.iconType});else{const w=f[D-1];Y(w,g.value)||h.push({...g,iconId:v.iconId,iconType:v.iconType})}return h},[]);this.setPreComputingCache(c),this._preComputingStatus$.next(U.preComputingEnd);return}this._preComputingStatus$.next(U.preComputing)}getCellResult(a,n,e,t){if(!e)return null;const i=c0(a,n,t.getCellValue);if(i===null)return;const s=t.rule.rule,o=s.isShowValue===void 0?!0:!!s.isShowValue;for(let d=0;d<e.length;d++){const l=e[d],c={...l},h={...l},{iconId:g,iconType:D}=l;if(d===0){if(Y(l,i))return{iconId:g,iconType:D,isShowValue:o}}else{if(d===e.length-1)return{iconId:g,iconType:D,isShowValue:o};{const f=e[d-1];if(h.operator=V2(f.operator),h.value=f.value,Y(c,i)&&Y(h,i))return{iconId:g,iconType:D,isShowValue:o}}}}}}var h0=Object.getOwnPropertyDescriptor,g0=(r,a,n,e)=>{for(var t=e>1?void 0:e?h0(a,n):a,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=s(t)||t);return t},l2=(r,a)=>(n,e)=>a(n,e,r);const o2=1e3*3*3;C.ConditionalFormattingViewModel=class extends u.Disposable{constructor(n,e,t,i){super();F(this,"_calculateUnitManagers",new Map);F(this,"_rTreeManager",new u.RTree);F(this,"_cellCache",new u.LRUMap(o2));F(this,"_markDirty$",new J.Subject);F(this,"markDirty$",this._markDirty$.asObservable());F(this,"_markRuleDirtyAtOnce",(n,e,t,i=!0)=>{if(this._cellCache.clear(),i){const o=this._ensureCalculateUnitManager(n,e).get(t);o&&o.resetPreComputingCache()}this._markDirty$.next({unitId:n,subUnitId:e,cfId:t})});F(this,"markRuleDirty",(()=>{const n=new J.Subject;return this.disposeWithMe(n.pipe(r2.bufferTime(100),r2.filter(e=>!!e.length),r2.map(e=>{const t=new Set,i=[];return e.forEach(s=>{const o=`${s.unitId}_${s.subUnitId}_${s.cfId}`;if(t.has(o)){if(s.isNeedResetPreComputingCache){const d=i.find(l=>l.cfId===s.cfId);d.isNeedResetPreComputingCache=!0}return}t.add(o),i.push({...s})}),i})).subscribe(e=>{e.forEach(t=>{this._markRuleDirtyAtOnce(t.unitId,t.subUnitId,t.cfId,t.isNeedResetPreComputingCache)})})),(e,t,i,s=!0)=>{n.next({unitId:e,subUnitId:t,cfId:i,isNeedResetPreComputingCache:s})}})());this._injector=n,this._conditionalFormattingRuleModel=e,this._conditionalFormattingFormulaService=t,this._univerInstanceService=i,this._initRuleListener(),this._handleCustomFormulasSeparately(),this._initCFFormulaListener()}_initCFFormulaListener(){this.disposeWithMe(this._conditionalFormattingFormulaService.result$.subscribe(({unitId:n,subUnitId:e,cfId:t,isAllFinished:i})=>{i&&this._markRuleDirtyAtOnce(n,e,t,i)}))}getCellCfs(n,e,t,i){const s=this._createCacheKey(n,e,t,i);if(this._cellCache.has(s))return this._cellCache.get(s);const o=this._getCellCfs(n,e,t,i);return o.length&&this._cellCache.set(s,o),o}_getCellCfs(n,e,t,i){var h;const s=(h=this._conditionalFormattingRuleModel.getSubunitRules(n,e))!=null?h:[],o=this._ensureCalculateUnitManager(n,e),d=this._rTreeManager.bulkSearch([{unitId:n,sheetId:e,range:{startColumn:i,endColumn:i,startRow:t,endRow:t}}]),l=s.filter(g=>d.has(g.cfId));return l.length?l.map(g=>{const D=o.get(g.cfId);return D?{cfId:g.cfId,result:D.getCell(t,i)}:null}).filter(g=>!!g).map((g,D)=>({...g,priority:D})):[]}dispose(){this._calculateUnitManagers.clear(),this._cellCache.clear(),this._rTreeManager.clear(),super.dispose()}_handleCustomFormulasSeparately(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{if(n.type==="set"){const{unitId:e,subUnitId:t}=n,i=n.oldRule;i.rule.type===I.highlightCell&&i.rule.subType===y.formula&&this._conditionalFormattingFormulaService.deleteCache(e,t,i.cfId)}}))}_initRuleListener(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:e,subUnitId:t,rule:i}=n,{cfId:s,ranges:o}=i,d=this._ensureCalculateUnitManager(e,t);switch(this.markRuleDirty(e,t,s),n.type){case"add":{this._rTreeManager.bulkInsert(o.map(c=>({unitId:e,sheetId:t,id:s,range:c})));const l=this._createRuleCalculateUnitInstance(e,t,i);if(!l)return;d.set(i.cfId,l);break}case"delete":{this._rTreeManager.bulkRemove(o.map(l=>({unitId:e,sheetId:t,id:s,range:l}))),d.delete(i.cfId);break}case"set":{const l=n.oldRule;if(this._rTreeManager.bulkRemove(l.ranges.map(c=>({unitId:e,sheetId:t,id:l.cfId,range:c}))),this._rTreeManager.bulkInsert(o.map(c=>({unitId:e,sheetId:t,id:s,range:c}))),l.rule.type!==i.rule.type){const c=this._createRuleCalculateUnitInstance(e,t,i);if(!c)return;d.delete(l.cfId),d.set(i.cfId,c)}else{const c=d.get(l.cfId);if(!c)return;c.updateRule(i)}}}}))}_ensureCalculateUnitManager(n,e){let t=this._calculateUnitManagers.get(n);t||(t=new Map,this._calculateUnitManagers.set(n,t));let i=t.get(e);return i||(i=new Map,t.set(e,i)),i}_createRuleCalculateUnitInstance(n,e,t){const i=this._univerInstanceService.getUnit(n),s=i==null?void 0:i.getSheetBySheetId(e);if(!i||!s)return;const o={workbook:i,worksheet:s,unitId:n,subUnitId:e,accessor:this._injector,rule:t,limit:o2,getCellValue:(d,l)=>s.getCellRaw(d,l)||{}};switch(t.rule.type){case I.colorScale:return new r0(o);case I.dataBar:return new o0(o);case I.highlightCell:return new u0(o);case I.iconSet:return new d0(o)}}_createCacheKey(n,e,t,i){return`${n}_${e}_${t}_${i}`}setCacheLength(n=o2){this._cellCache.limit!==n&&(this._cellCache.limit=n,this._calculateUnitManagers.forEach(e=>{e.forEach(t=>{t.forEach(i=>{i.setCacheLength(n)})})}))}},C.ConditionalFormattingViewModel=g0([l2(0,u.Inject(u.Injector)),l2(1,u.Inject(M)),l2(2,u.Inject(C.ConditionalFormattingFormulaService)),l2(3,u.IUniverInstanceService)],C.ConditionalFormattingViewModel);function t2(r,a){return Math.abs(r-a)<Number.EPSILON}const k=r=>[void 0,null].includes(r),N=r=>{var e,t;if(!r)return null;if(r.t===u.CellValueType.BOOLEAN)return r.v===u.BooleanNumber.TRUE?O.BooleanValue.TRUE:O.BooleanValue.FALSE;const a=r.v,n=(t=(e=r.p)==null?void 0:e.body)==null?void 0:t.dataStream.replace(/\r\n$/,"");return k(a)?k(n)?null:n:a},v2=86400;function U2(r,a=!0){if(a&&r>=0){if(r===0)return[1900,1,0];if(r===60)return[1900,2,29];if(r<60)return[1900,r<32?1:2,(r-1)%31+1]}let n=r+68569+2415019;const e=Math.floor(4*n/146097);n=n-Math.floor((146097*e+3)/4);const t=Math.floor(4e3*(n+1)/1461001);n=n-Math.floor(1461*t/4)+31;const i=Math.floor(80*n/2447),s=n-Math.floor(2447*i/80);n=Math.floor(i/11);const o=i+2-12*n;return[100*(e-49)+t+n|0,o|0,s|0]}const N2=r=>{let a=r|0;const n=v2*(r-a);let e=Math.floor(n);n-e>.9999&&(e+=1,e===v2&&(e=0,a+=1));const t=e<0?v2+e:e,[i,s,o]=U2(r,!0),d=Math.floor(t/60/60)%60,l=Math.floor(t/60)%60,c=Math.floor(t)%60;return u.dayjs(`${i}/${s}/${o} ${d}:${l}:${c}`).valueOf()},n2=(r,a,n)=>{switch(r.type){case R.max:{let e=0;return a.forValue((t,i,s)=>{s>e&&(e=s)}),{status:T.SUCCESS,result:e}}case R.min:{let e;return a.forValue((t,i,s)=>{e===void 0&&(e=s),s<e&&(e=s)}),{status:T.SUCCESS,result:e}}case R.percent:{let e,t;a.forValue((o,d,l)=>{(e===void 0||t===void 0)&&(e=l,t=l),l>e&&(e=l),l<t&&(t=l)});const i=(e||0)-(t||0),s=Math.max(Math.min(Number(r.value)||0,100),0);return{status:T.SUCCESS,result:i*(s/100)+(t||0)}}case R.percentile:{const e=a.toNativeArray().sort((l,c)=>l-c),t=Math.max(Math.min(Number(r.value)||0,100),0),i=(e.length-1)*t/100,s=Math.floor(i),o=i-s,d=e[s]+(e[Math.min(s+1,e.length-1)]-e[s])*o;return{status:T.SUCCESS,result:d}}case R.formula:{const{accessor:e,unitId:t,subUnitId:i,cfId:s}=n,o=String(r.value),d=e.get(C.ConditionalFormattingFormulaService);return d.registerFormulaWithRange(t,i,s,o),d.getFormulaResultWithCoords(t,i,s,o)}case R.num:default:{const e=Number(r.value);return{status:T.SUCCESS,result:Number.isNaN(e)?0:e}}}},C0=(r,a,n,e)=>{const{accessor:t}=e,i=t.get(C.ConditionalFormattingViewModel),s=new u.ObjectMatrix;return n.ranges.forEach(o=>{u.Range.foreach(o,(d,l)=>{const c=i.getCellCfs(r,a,d,l);if(c){const h=c.find(g=>g.cfId===n.cfId);h!=null&&h.result&&s.setValue(d,l,h.result)}})}),s},Y=(r,a)=>{switch(r.operator){case E.between:{if(typeof r.value!="object"||!r.value.length)return;const n=Math.min(...r.value),e=Math.max(...r.value);return a>=n&&a<=e}case E.notBetween:{if(typeof r.value!="object"||!r.value.length)return;const n=Math.min(...r.value),e=Math.max(...r.value);return!(a>=n&&a<=e)}case E.equal:{const n=r.value||0;return t2(n,a)}case E.notEqual:{const n=r.value||0;return!t2(n,a)}case E.greaterThan:{const n=r.value||0;return a>n}case E.greaterThanOrEqual:{const n=r.value||0;return a>=n}case E.lessThan:{const n=r.value||0;return a<n}case E.lessThanOrEqual:{const n=r.value||0;return a<=n}default:return!1}},V2=r=>{switch(r){case E.greaterThan:return E.lessThanOrEqual;case E.greaterThanOrEqual:return E.lessThan;case E.lessThan:return E.greaterThanOrEqual;case E.lessThanOrEqual:return E.greaterThan}return r},O2=(r,a)=>{const n=i=>i.a!==void 0?i:{...i,a:1},e=r.findIndex(i=>i.value>=a),t=e-1;if(e===0)return r[0].color.toRgbString();if(t>=0){const i=r[t],s=r[e];if(i.color.isValid&&s.color.isValid){const o=n(i.color.toRgb()),d=n(s.color.toRgb()),l=s.value-i.value,c=(a-i.value)/l,h=["r","g","b","a"].reduce((D,f)=>{const v=o[f];return D[f]=(d[f]-v)*c+v,D},{});return new u.ColorKit(h).toRgbString()}}else return r[r.length-1].color.toRgbString()},u2=(r,a,n)=>r.map(e=>{if(e.startColumn>n||e.startRow>a)return null;const t={...e};return t.endRow=Math.min(t.endRow,a),t.endColumn=Math.min(t.endColumn,n),t}).filter(e=>!!e);function D0(r){let a=0;return new u.ObjectMatrix(r).forValue((n,e,t)=>{a=Math.max(Number.isNaN(a)?0:a,Number(t))}),a}const m={feedback:{mistake:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%227.03704%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.87359%206.87332C6.6146%207.13231%206.6146%207.55221%206.87359%207.8112L9.062%209.99961L6.87356%2012.188C6.61457%2012.447%206.61457%2012.8669%206.87356%2013.1259C7.13255%2013.3849%207.55245%2013.3849%207.81144%2013.1259L9.99987%2010.9375L12.1882%2013.1258C12.4472%2013.3848%2012.8671%2013.3848%2013.1261%2013.1258C13.3851%2012.8669%2013.3851%2012.447%2013.1261%2012.188L10.9378%209.99961L13.1261%207.81127C13.3851%207.55228%2013.3851%207.13238%2013.1261%206.87339C12.8671%206.61441%2012.4472%206.61441%2012.1882%206.87339L9.99987%209.06173L7.81147%206.87332C7.55248%206.61433%207.13257%206.61433%206.87359%206.87332Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3C%2Fsvg%3E%0A",warn:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%227.03704%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3Cpath%20d%3D%22M9.16817%206.67735C9.16646%206.61745%209.1656%206.5875%209.16653%206.56236C9.18103%206.16817%209.49136%205.84883%209.88497%205.82306C9.91008%205.82141%209.94004%205.82141%209.99996%205.82141V5.82141C10.0599%205.82141%2010.0899%205.82141%2010.115%205.82306C10.5086%205.84883%2010.8189%206.16817%2010.8334%206.56236C10.8343%206.5875%2010.8335%206.61745%2010.8318%206.67735L10.7043%2011.131C10.6934%2011.5121%2010.3812%2011.8154%209.99995%2011.8154V11.8154C9.61866%2011.8154%209.30655%2011.5121%209.29564%2011.131L9.16817%206.67735Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3Crect%20x%3D%229.31488%22%20y%3D%2212.8086%22%20width%3D%221.37006%22%20height%3D%221.37006%22%20rx%3D%220.685032%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3C%2Fsvg%3E%0A",correct:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M17.037%2010C17.037%2013.8865%2013.8864%2017.0371%209.99999%2017.0371C6.11354%2017.0371%202.96295%2013.8865%202.96295%2010C2.96295%206.1136%206.11354%202.96301%209.99999%202.96301C13.8864%202.96301%2017.037%206.1136%2017.037%2010Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3Cpath%20d%3D%22M13.9239%207.17477C13.6638%206.91472%2013.2422%206.91472%2012.9821%207.17477L8.74433%2011.4126L7.01786%209.6861C6.75781%209.42606%206.33619%209.42606%206.07614%209.6861C5.81609%209.94615%205.81609%2010.3678%206.07614%2010.6278L8.27349%2012.8252C8.53354%2013.0852%208.95516%2013.0852%209.21521%2012.8252L9.2195%2012.8209L13.9239%208.1165C14.1839%207.85645%2014.1839%207.43482%2013.9239%207.17477Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3C%2Fsvg%3E%0A"},star:{starEmpty:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.8451%207.0699%2012.2165%207.33978%2012.6421%207.36863L16.2362%207.61233C16.5693%207.63492%2016.7048%208.05202%2016.4486%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.215%2011.2859%2013.319%2011.6996L14.1979%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6418%2015.5971L10.5908%2013.6817C10.2296%2013.4549%209.77045%2013.4549%209.40924%2013.6817L6.35828%2015.5971C6.07553%2015.7746%205.72072%2015.5168%205.80217%2015.1931L6.68105%2011.6996C6.7851%2011.2859%206.64322%2010.8493%206.31592%2010.5758L3.55145%208.26607C3.29525%208.05202%203.43078%207.63492%203.76386%207.61233L7.358%207.36863C7.78352%207.33978%208.15498%207.0699%208.31391%206.67412L9.65633%203.3312C9.78074%203.0214%2010.2193%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23fff%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fsvg%3E%0A",starIncomplete:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url(%23clip0_613_177)%22%3E%0A%3Cmask%20id%3D%22mask0_613_177%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%2210%22%20y%3D%220%22%20width%3D%2210%22%20height%3D%2220%22%3E%0A%3Crect%20x%3D%2210.3704%22%20y%3D%220.37037%22%20width%3D%229.25926%22%20height%3D%2219.2593%22%20fill%3D%22%23C4C4C4%22%20stroke%3D%22%23F7D564%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fmask%3E%0A%3Cg%20mask%3D%22url(%23mask0_613_177)%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.845%207.0699%2012.2165%207.33978%2012.642%207.36863L16.2361%207.61233C16.5692%207.63492%2016.7047%208.05202%2016.4485%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.2149%2011.2859%2013.3189%2011.6996L14.1978%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6417%2015.5971L10.5908%2013.6817C10.2295%2013.4549%209.77039%2013.4549%209.40918%2013.6817L6.35822%2015.5971C6.07547%2015.7746%205.72066%2015.5168%205.80211%2015.1931L6.68098%2011.6996C6.78504%2011.2859%206.64316%2010.8493%206.31586%2010.5758L3.55139%208.26607C3.29519%208.05202%203.43072%207.63492%203.7638%207.61233L7.35793%207.36863C7.78346%207.33978%208.15491%207.0699%208.31385%206.67412L9.65627%203.3312C9.78068%203.0214%2010.2192%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23fff%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fg%3E%0A%3Cmask%20id%3D%22mask1_613_177%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2210%22%20height%3D%2220%22%3E%0A%3Crect%20width%3D%2210%22%20height%3D%2220%22%20fill%3D%22%23C4C4C4%22%2F%3E%0A%3C%2Fmask%3E%0A%3Cg%20mask%3D%22url(%23mask1_613_177)%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.845%207.0699%2012.2165%207.33978%2012.642%207.36863L16.2361%207.61233C16.5692%207.63492%2016.7047%208.05202%2016.4485%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.2149%2011.2859%2013.3189%2011.6996L14.1978%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6417%2015.5971L10.5908%2013.6817C10.2295%2013.4549%209.77039%2013.4549%209.40918%2013.6817L6.35822%2015.5971C6.07547%2015.7746%205.72066%2015.5168%205.80211%2015.1931L6.68098%2011.6996C6.78504%2011.2859%206.64316%2010.8493%206.31586%2010.5758L3.55139%208.26607C3.29519%208.05202%203.43072%207.63492%203.7638%207.61233L7.35793%207.36863C7.78346%207.33978%208.15491%207.0699%208.31385%206.67412L9.65627%203.3312C9.78068%203.0214%2010.2192%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fg%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_613_177%22%3E%0A%3Crect%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22white%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E%0A",starFull:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.8451%207.0699%2012.2165%207.33978%2012.6421%207.36863L16.2362%207.61233C16.5693%207.63492%2016.7048%208.05202%2016.4486%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.215%2011.2859%2013.319%2011.6996L14.1979%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6418%2015.5971L10.5908%2013.6817C10.2296%2013.4549%209.77045%2013.4549%209.40924%2013.6817L6.35828%2015.5971C6.07553%2015.7746%205.72072%2015.5168%205.80217%2015.1931L6.68105%2011.6996C6.7851%2011.2859%206.64322%2010.8493%206.31592%2010.5758L3.55145%208.26607C3.29525%208.05202%203.43078%207.63492%203.76386%207.61233L7.358%207.36863C7.78352%207.33978%208.15498%207.0699%208.31391%206.67412L9.65633%203.3312C9.78074%203.0214%2010.2193%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fsvg%3E%0A"},progress:{progress0:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress25:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Cpath%20d%3D%22M16.2963%209.99991C16.2963%209.17307%2016.1335%208.35432%2015.8171%207.59042C15.5006%206.82652%2015.0369%206.13242%2014.4522%205.54776C13.8675%204.96309%2013.1734%204.49931%2012.4095%204.18289C11.6456%203.86647%2010.8269%203.70361%2010%203.70361L10%209.99991H16.2963Z%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress50:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Cpath%20d%3D%22M10%2016.2962C11.6699%2016.2962%2013.2714%2015.6328%2014.4522%2014.4521C15.633%2013.2713%2016.2963%2011.6698%2016.2963%209.99991C16.2963%208.33003%2015.633%206.72854%2014.4522%205.54776C13.2714%204.36697%2011.6699%203.70361%2010%203.70361L10%209.99991L10%2016.2962Z%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress75:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Cpath%20d%3D%22M3.70374%209.99991C3.70374%2011.2452%204.07301%2012.4625%204.76485%2013.4979C5.4567%2014.5334%206.44005%2015.3404%207.59054%2015.8169C8.74104%2016.2935%2010.007%2016.4182%2011.2284%2016.1752C12.4497%2015.9323%2013.5716%2015.3326%2014.4522%2014.4521C15.3327%2013.5715%2015.9324%2012.4496%2016.1753%2011.2283C16.4183%2010.0069%2016.2936%208.74092%2015.8171%207.59042C15.3405%206.43992%2014.5335%205.45658%2013.4981%204.76473C12.4626%204.07288%2011.2453%203.70361%2010%203.70361L10%209.99991L3.70374%209.99991Z%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress100:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99991%22%20r%3D%226.2963%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A"},signal:{signal0:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal25:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal50:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal75:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal100:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93933%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70447%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A"},feeling:{guffaw:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M16.887%2010C16.887%2013.8037%2013.8036%2016.8871%209.99999%2016.8871C6.19638%2016.8871%203.11295%2013.8037%203.11295%2010C3.11295%206.19644%206.19638%203.11301%209.99999%203.11301C13.8036%203.11301%2016.887%206.19644%2016.887%2010Z%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M12.5355%2013.5821C13.0482%2013.1841%2013.3951%2012.6107%2013.5405%2012.0327C13.5934%2011.8226%2013.5051%2011.6349%2013.3518%2011.5331C13.2036%2011.4346%2013.0031%2011.4203%2012.8265%2011.5131C11.0615%2012.4407%208.94609%2012.4427%207.1828%2011.513C7.00629%2011.4199%206.80602%2011.4343%206.65798%2011.5329C6.50518%2011.6346%206.41701%2011.8217%206.46844%2012.0312C6.61029%2012.609%206.95079%2013.1833%207.46449%2013.5821C8.14361%2014.1093%209.05608%2014.3999%2010%2014.3999C10.9439%2014.3999%2011.8564%2014.1093%2012.5355%2013.5821Z%22%20fill%3D%22white%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.4%22%2F%3E%0A%3C%2Fsvg%3E%0A",smile:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.03705%2011.8518C7.03705%2011.8518%207.77779%2013.7037%2010%2013.7037C12.2222%2013.7037%2012.963%2011.8518%2012.963%2011.8518%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.962963%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A",noninductive:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.9259%22%20width%3D%221.48148%22%20height%3D%221.11111%22%20rx%3D%220.555556%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.9259%22%20width%3D%221.48148%22%20height%3D%221.11111%22%20rx%3D%220.555556%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.03705%2012.5927C7.03705%2012.5927%208.14816%2012.5927%2010.3704%2012.5927C12.5926%2012.5927%2012.963%2012.5927%2012.963%2012.5927%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.962963%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A",dissatisfied:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.03705%2013.7037C7.03705%2013.7037%207.77779%2011.8519%2010%2011.8519C12.2222%2011.8519%2012.963%2013.7037%2012.963%2013.7037%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.962963%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A",impatient:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.47573%2011.731C6.96306%2012.129%206.61613%2012.7024%206.47071%2013.2804C6.41784%2013.4905%206.50617%2013.6782%206.65942%2013.78C6.80761%2013.8785%207.00813%2013.8928%207.18477%2013.8C8.9498%2012.8724%2011.0652%2012.8704%2012.8285%2013.8002C13.005%2013.8932%2013.2052%2013.8788%2013.3533%2013.7802C13.5061%2013.6785%2013.5942%2013.4914%2013.5428%2013.2819C13.401%2012.7041%2013.0605%2012.1298%2012.5468%2011.731C11.8676%2011.2038%2010.9552%2010.9132%2010.0112%2010.9132C9.06732%2010.9132%208.15485%2011.2038%207.47573%2011.731Z%22%20fill%3D%22white%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.4%22%2F%3E%0A%3C%2Fsvg%3E%0A"},arrow:JSON.parse('{"down-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8.90467%203.99244C8.84611%204.1338%208.84611%204.31301%208.84611%204.67143V13.716L5.92068%2010.7906C5.66724%2010.5371%205.54052%2010.4104%205.39916%2010.3519C5.21067%2010.2738%204.9989%2010.2738%204.81041%2010.3519C4.66905%2010.4104%204.54233%2010.5371%204.28889%2010.7906C4.03545%2011.044%203.90873%2011.1707%203.85018%2011.3121C3.77211%2011.5006%203.77211%2011.7124%203.85018%2011.9008C3.90873%2012.0422%204.03545%2012.1689%204.28889%2012.4224L9.03476%2017.1682C9.07839%2017.2127%209.12737%2017.2617%209.18231%2017.3166L9.18239%2017.3167L9.18241%2017.3167C9.40545%2017.5398%209.53035%2017.6647%209.65346%2017.7313C9.67085%2017.7408%209.6882%2017.7492%209.70577%2017.7564C9.89425%2017.8345%2010.106%2017.8345%2010.2945%2017.7564C10.4359%2017.6979%2010.5626%2017.5712%2010.816%2017.3177C10.8986%2017.2352%2010.9677%2017.1661%2011.0253%2017.1056L15.7095%2012.4214L15.7095%2012.4213C15.963%2012.1679%2016.0897%2012.0412%2016.1482%2011.8998C16.2263%2011.7114%2016.2263%2011.4996%2016.1482%2011.3111C16.0897%2011.1697%2015.963%2011.043%2015.7095%2010.7896C15.4561%2010.5361%2015.3294%2010.4094%2015.188%2010.3509C14.9995%2010.2728%2014.7878%2010.2728%2014.5993%2010.3509C14.4579%2010.4094%2014.3312%2010.5361%2014.0778%2010.7896L14.0777%2010.7896L11.1538%2013.7135V4.67142C11.1538%204.31301%2011.1538%204.1338%2011.0953%203.99244C11.0172%203.80395%2010.8674%203.6542%2010.6789%203.57613C10.5376%203.51758%2010.3584%203.51758%209.99996%203.51758C9.64154%203.51758%209.46233%203.51758%209.32097%203.57613C9.13249%203.6542%208.98274%203.80395%208.90467%203.99244Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","right-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.32508%2011.7609C3.46644%2011.8194%203.64565%2011.8194%204.00407%2011.8194H13.049L10.1235%2014.745C9.87002%2014.9984%209.7433%2015.1251%209.68475%2015.2665C9.60668%2015.455%209.60668%2015.6668%209.68475%2015.8552C9.7433%2015.9966%209.87002%2016.1233%2010.1235%2016.3768C10.3769%2016.6302%2010.5036%2016.7569%2010.645%2016.8155C10.8335%2016.8935%2011.0452%2016.8935%2011.2337%2016.8155C11.3751%2016.7569%2011.5018%2016.6302%2011.7552%2016.3768L16.5105%2011.6215C16.5524%2011.5803%2016.5983%2011.5344%2016.6493%2011.4834L16.6495%2011.4831C16.8561%2011.2765%2016.9785%2011.1542%2017.0484%2011.0394C17.0648%2011.0128%2017.0782%2010.9866%2017.0893%2010.9599C17.1674%2010.7714%2017.1674%2010.5596%2017.0893%2010.3711C17.0308%2010.2298%2016.904%2010.1031%2016.6506%209.84962C16.5685%209.76752%2016.4997%209.69872%2016.4394%209.64123L11.7542%204.95601C11.5007%204.70257%2011.374%204.57585%2011.2327%204.5173C11.0442%204.43923%2010.8324%204.43923%2010.6439%204.5173C10.5026%204.57585%2010.3758%204.70257%2010.1224%204.95601L10.1224%204.95601C9.86895%205.20945%209.74223%205.33617%209.68368%205.47753C9.60561%205.66601%209.60561%205.87779%209.68368%206.06627C9.74223%206.20764%209.86895%206.33436%2010.1224%206.5878L13.0463%209.51175H4.00407C3.64565%209.51175%203.46644%209.51175%203.32508%209.5703C3.1366%209.64837%202.98685%209.79812%202.90877%209.98661C2.85022%2010.128%202.85022%2010.3072%202.85022%2010.6656C2.85022%2011.024%202.85022%2011.2032%202.90877%2011.3446C2.98685%2011.5331%203.1366%2011.6828%203.32508%2011.7609Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","up-green":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M11.0936%2017.3406C11.1522%2017.1992%2011.1522%2017.02%2011.1522%2016.6616V7.61701L14.0776%2010.5424C14.3311%2010.7959%2014.4578%2010.9226%2014.5991%2010.9811C14.7876%2011.0592%2014.9994%2011.0592%2015.1879%2010.9811C15.3292%2010.9226%2015.456%2010.7959%2015.7094%2010.5424C15.9628%2010.289%2016.0896%2010.1623%2016.1481%2010.0209C16.2262%209.83243%2016.2262%209.62066%2016.1481%209.43217C16.0896%209.29081%2015.9628%209.16409%2015.7094%208.91065L10.9645%204.16576C10.9207%204.12105%2010.8714%204.07178%2010.8161%204.01648L10.8159%204.0163C10.5916%203.792%2010.4666%203.66696%2010.3428%203.60058C10.3261%203.59154%2010.3094%203.58358%2010.2925%203.57658C10.104%203.49851%209.89226%203.49851%209.70378%203.57658C9.56242%203.63514%209.4357%203.76186%209.18226%204.0153C9.09955%204.09801%209.03034%204.16722%208.97258%204.22785L4.28878%208.91166C4.03534%209.1651%203.90862%209.29182%203.85006%209.43318C3.77199%209.62166%203.77199%209.83344%203.85006%2010.0219C3.90862%2010.1633%204.03534%2010.29%204.28878%2010.5434C4.54221%2010.7969%204.66893%2010.9236%204.8103%2010.9822C4.99878%2011.0602%205.21056%2011.0602%205.39904%2010.9822C5.5404%2010.9236%205.66712%2010.7969%205.92056%2010.5434L5.92056%2010.5434L8.84449%207.61951V16.6616C8.84449%2017.02%208.84449%2017.1992%208.90305%2017.3406C8.98112%2017.5291%209.13087%2017.6788%209.31935%2017.7569C9.46072%2017.8154%209.63992%2017.8154%209.99834%2017.8154C10.3568%2017.8154%2010.536%2017.8154%2010.6773%2017.7569C10.8658%2017.6788%2011.0156%2017.5291%2011.0936%2017.3406Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndDown-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.5062%206.72126C4.56476%206.86262%204.69148%206.98934%204.94492%207.24278L11.3404%2013.6382L7.20313%2013.6382C6.84471%2013.6382%206.66551%2013.6382%206.52414%2013.6968C6.33566%2013.7749%206.18591%2013.9246%206.10784%2014.1131C6.04928%2014.2545%206.04928%2014.4337%206.04928%2014.7921C6.04928%2015.1505%206.04928%2015.3297%206.10784%2015.4711C6.18591%2015.6596%206.33566%2015.8093%206.52414%2015.8874C6.66551%2015.9459%206.84471%2015.9459%207.20313%2015.9459L13.9194%2015.9459C13.9805%2015.9465%2014.0484%2015.9465%2014.1243%2015.9465H14.1243C14.4353%2015.9465%2014.6114%2015.9465%2014.7449%2015.9082C14.7659%2015.9023%2014.7859%2015.8954%2014.8052%2015.8874C14.9937%2015.8093%2015.1434%2015.6596%2015.2215%2015.4711C15.2801%2015.3297%2015.2801%2015.1505%2015.2801%2014.7921C15.2801%2014.6767%2015.2801%2014.5799%2015.2781%2014.497L15.2781%207.86957C15.2781%207.51115%2015.2781%207.33194%2015.2195%207.19058C15.1415%207.0021%2014.9917%206.85235%2014.8032%206.77428C14.6619%206.71572%2014.4827%206.71572%2014.1243%206.71572C13.7658%206.71572%2013.5866%206.71572%2013.4453%206.77428C13.2568%206.85235%2013.107%207.0021%2013.029%207.19058C12.9704%207.33194%2012.9704%207.51115%2012.9704%207.86957L12.9704%2012.0047L6.5767%205.61099C6.32326%205.35755%206.19654%205.23083%206.05518%205.17228C5.8667%205.09421%205.65492%205.09421%205.46644%205.17228C5.32508%205.23083%205.19836%205.35755%204.94492%205.61099C4.69148%205.86443%204.56476%205.99115%204.5062%206.13251C4.42813%206.32099%204.42813%206.53277%204.5062%206.72126Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndUp-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.05431%2016.1597C6.19567%2016.1012%206.32239%2015.9745%206.57583%2015.721L12.9712%209.32568L12.9712%2013.4626C12.9712%2013.821%2012.9712%2014.0002%2013.0297%2014.1416C13.1078%2014.3301%2013.2576%2014.4798%2013.446%2014.5579C13.5874%2014.6164%2013.7666%2014.6164%2014.125%2014.6164C14.4834%2014.6164%2014.6626%2014.6164%2014.804%2014.5579C14.9925%2014.4798%2015.1422%2014.3301%2015.2203%2014.1416C15.2789%2014.0002%2015.2789%2013.821%2015.2789%2013.4626L15.2789%206.75233C15.2795%206.68972%2015.2795%206.62004%2015.2795%206.54182L15.2795%206.54157C15.2795%206.22585%2015.2795%206.04918%2015.2395%205.91495C15.2339%205.89605%2015.2276%205.878%2015.2203%205.86053C15.1422%205.67204%2014.9925%205.52229%2014.804%205.44422C14.6626%205.38567%2014.4834%205.38567%2014.125%205.38567L14.125%205.38567C14.0075%205.38567%2013.9093%205.38567%2013.8254%205.38773L7.20256%205.38773C6.84414%205.38773%206.66493%205.38773%206.52357%205.44628C6.33509%205.52436%206.18534%205.6741%206.10727%205.86259C6.04871%206.00395%206.04871%206.18315%206.04871%206.54156V6.54157L6.04871%206.54159C6.04871%206.9%206.04871%207.0792%206.10727%207.22056C6.18534%207.40905%206.33509%207.55879%206.52357%207.63687C6.66493%207.69542%206.84414%207.69542%207.20256%207.69542H11.3379L4.94405%2014.0892C4.69061%2014.3427%204.56389%2014.4694%204.50533%2014.6108C4.42726%2014.7992%204.42726%2015.011%204.50533%2015.1995C4.56389%2015.3409%204.69061%2015.4676%204.94405%2015.721C5.19749%2015.9745%205.32421%2016.1012%205.46557%2016.1597C5.65405%2016.2378%205.86583%2016.2378%206.05431%2016.1597Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","down-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8.90467%203.99244C8.84611%204.1338%208.84611%204.31301%208.84611%204.67143V13.716L5.92068%2010.7906C5.66724%2010.5371%205.54052%2010.4104%205.39916%2010.3519C5.21067%2010.2738%204.9989%2010.2738%204.81041%2010.3519C4.66905%2010.4104%204.54233%2010.5371%204.28889%2010.7906C4.03545%2011.044%203.90873%2011.1707%203.85018%2011.3121C3.77211%2011.5006%203.77211%2011.7124%203.85018%2011.9008C3.90873%2012.0422%204.03545%2012.1689%204.28889%2012.4224L9.03476%2017.1682C9.07839%2017.2127%209.12737%2017.2617%209.18231%2017.3166L9.18239%2017.3167L9.18241%2017.3167C9.40545%2017.5398%209.53035%2017.6647%209.65346%2017.7313C9.67085%2017.7408%209.6882%2017.7492%209.70577%2017.7564C9.89425%2017.8345%2010.106%2017.8345%2010.2945%2017.7564C10.4359%2017.6979%2010.5626%2017.5712%2010.816%2017.3177C10.8986%2017.2352%2010.9677%2017.1661%2011.0253%2017.1056L15.7095%2012.4214L15.7095%2012.4213C15.963%2012.1679%2016.0897%2012.0412%2016.1482%2011.8998C16.2263%2011.7114%2016.2263%2011.4996%2016.1482%2011.3111C16.0897%2011.1697%2015.963%2011.043%2015.7095%2010.7896C15.4561%2010.5361%2015.3294%2010.4094%2015.188%2010.3509C14.9995%2010.2728%2014.7878%2010.2728%2014.5993%2010.3509C14.4579%2010.4094%2014.3312%2010.5361%2014.0778%2010.7896L14.0777%2010.7896L11.1538%2013.7135V4.67142C11.1538%204.31301%2011.1538%204.1338%2011.0953%203.99244C11.0172%203.80395%2010.8674%203.6542%2010.6789%203.57613C10.5376%203.51758%2010.3584%203.51758%209.99996%203.51758C9.64154%203.51758%209.46233%203.51758%209.32097%203.57613C9.13249%203.6542%208.98274%203.80395%208.90467%203.99244Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","right-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.32508%2011.7609C3.46644%2011.8194%203.64565%2011.8194%204.00407%2011.8194H13.049L10.1235%2014.745C9.87002%2014.9984%209.7433%2015.1251%209.68475%2015.2665C9.60668%2015.455%209.60668%2015.6668%209.68475%2015.8552C9.7433%2015.9966%209.87002%2016.1233%2010.1235%2016.3768C10.3769%2016.6302%2010.5036%2016.7569%2010.645%2016.8155C10.8335%2016.8935%2011.0452%2016.8935%2011.2337%2016.8155C11.3751%2016.7569%2011.5018%2016.6302%2011.7552%2016.3768L16.5105%2011.6215C16.5524%2011.5803%2016.5983%2011.5344%2016.6493%2011.4834L16.6495%2011.4831C16.8561%2011.2765%2016.9785%2011.1542%2017.0484%2011.0394C17.0648%2011.0128%2017.0782%2010.9866%2017.0893%2010.9599C17.1674%2010.7714%2017.1674%2010.5596%2017.0893%2010.3711C17.0308%2010.2298%2016.904%2010.1031%2016.6506%209.84962C16.5685%209.76752%2016.4997%209.69872%2016.4394%209.64123L11.7542%204.95601C11.5007%204.70257%2011.374%204.57585%2011.2327%204.5173C11.0442%204.43923%2010.8324%204.43923%2010.6439%204.5173C10.5026%204.57585%2010.3758%204.70257%2010.1224%204.95601L10.1224%204.95601C9.86895%205.20945%209.74223%205.33617%209.68368%205.47753C9.60561%205.66601%209.60561%205.87779%209.68368%206.06627C9.74223%206.20764%209.86895%206.33436%2010.1224%206.5878L13.0463%209.51175H4.00407C3.64565%209.51175%203.46644%209.51175%203.32508%209.5703C3.1366%209.64837%202.98685%209.79812%202.90877%209.98661C2.85022%2010.128%202.85022%2010.3072%202.85022%2010.6656C2.85022%2011.024%202.85022%2011.2032%202.90877%2011.3446C2.98685%2011.5331%203.1366%2011.6828%203.32508%2011.7609Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","up-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M11.0936%2017.3406C11.1522%2017.1992%2011.1522%2017.02%2011.1522%2016.6616V7.61701L14.0776%2010.5424C14.3311%2010.7959%2014.4578%2010.9226%2014.5991%2010.9811C14.7876%2011.0592%2014.9994%2011.0592%2015.1879%2010.9811C15.3292%2010.9226%2015.456%2010.7959%2015.7094%2010.5424C15.9628%2010.289%2016.0896%2010.1623%2016.1481%2010.0209C16.2262%209.83243%2016.2262%209.62066%2016.1481%209.43217C16.0896%209.29081%2015.9628%209.16409%2015.7094%208.91065L10.9645%204.16576C10.9207%204.12105%2010.8714%204.07178%2010.8161%204.01648L10.8159%204.0163C10.5916%203.792%2010.4666%203.66696%2010.3428%203.60058C10.3261%203.59154%2010.3094%203.58358%2010.2925%203.57658C10.104%203.49851%209.89226%203.49851%209.70378%203.57658C9.56242%203.63514%209.4357%203.76186%209.18226%204.0153C9.09955%204.09801%209.03034%204.16722%208.97258%204.22785L4.28878%208.91166C4.03534%209.1651%203.90862%209.29182%203.85006%209.43318C3.77199%209.62166%203.77199%209.83344%203.85006%2010.0219C3.90862%2010.1633%204.03534%2010.29%204.28878%2010.5434C4.54221%2010.7969%204.66893%2010.9236%204.8103%2010.9822C4.99878%2011.0602%205.21056%2011.0602%205.39904%2010.9822C5.5404%2010.9236%205.66712%2010.7969%205.92056%2010.5434L5.92056%2010.5434L8.84449%207.61951V16.6616C8.84449%2017.02%208.84449%2017.1992%208.90305%2017.3406C8.98112%2017.5291%209.13087%2017.6788%209.31935%2017.7569C9.46072%2017.8154%209.63992%2017.8154%209.99834%2017.8154C10.3568%2017.8154%2010.536%2017.8154%2010.6773%2017.7569C10.8658%2017.6788%2011.0156%2017.5291%2011.0936%2017.3406Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndDown-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.5062%206.72126C4.56476%206.86262%204.69148%206.98934%204.94492%207.24278L11.3404%2013.6382L7.20313%2013.6382C6.84471%2013.6382%206.66551%2013.6382%206.52414%2013.6968C6.33566%2013.7749%206.18591%2013.9246%206.10784%2014.1131C6.04928%2014.2545%206.04928%2014.4337%206.04928%2014.7921C6.04928%2015.1505%206.04928%2015.3297%206.10784%2015.4711C6.18591%2015.6596%206.33566%2015.8093%206.52414%2015.8874C6.66551%2015.9459%206.84471%2015.9459%207.20313%2015.9459L13.9194%2015.9459C13.9805%2015.9465%2014.0484%2015.9465%2014.1243%2015.9465H14.1243C14.4353%2015.9465%2014.6114%2015.9465%2014.7449%2015.9082C14.7659%2015.9023%2014.7859%2015.8954%2014.8052%2015.8874C14.9937%2015.8093%2015.1434%2015.6596%2015.2215%2015.4711C15.2801%2015.3297%2015.2801%2015.1505%2015.2801%2014.7921C15.2801%2014.6767%2015.2801%2014.5799%2015.2781%2014.497L15.2781%207.86957C15.2781%207.51115%2015.2781%207.33194%2015.2195%207.19058C15.1415%207.0021%2014.9917%206.85235%2014.8032%206.77428C14.6619%206.71572%2014.4827%206.71572%2014.1243%206.71572C13.7658%206.71572%2013.5866%206.71572%2013.4453%206.77428C13.2568%206.85235%2013.107%207.0021%2013.029%207.19058C12.9704%207.33194%2012.9704%207.51115%2012.9704%207.86957L12.9704%2012.0047L6.5767%205.61099C6.32326%205.35755%206.19654%205.23083%206.05518%205.17228C5.8667%205.09421%205.65492%205.09421%205.46644%205.17228C5.32508%205.23083%205.19836%205.35755%204.94492%205.61099C4.69148%205.86443%204.56476%205.99115%204.5062%206.13251C4.42813%206.32099%204.42813%206.53277%204.5062%206.72126Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndUp-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.05431%2016.1597C6.19567%2016.1012%206.32239%2015.9745%206.57583%2015.721L12.9712%209.32568L12.9712%2013.4626C12.9712%2013.821%2012.9712%2014.0002%2013.0297%2014.1416C13.1078%2014.3301%2013.2576%2014.4798%2013.446%2014.5579C13.5874%2014.6164%2013.7666%2014.6164%2014.125%2014.6164C14.4834%2014.6164%2014.6626%2014.6164%2014.804%2014.5579C14.9925%2014.4798%2015.1422%2014.3301%2015.2203%2014.1416C15.2789%2014.0002%2015.2789%2013.821%2015.2789%2013.4626L15.2789%206.75233C15.2795%206.68972%2015.2795%206.62004%2015.2795%206.54182L15.2795%206.54157C15.2795%206.22585%2015.2795%206.04918%2015.2395%205.91495C15.2339%205.89605%2015.2276%205.878%2015.2203%205.86053C15.1422%205.67204%2014.9925%205.52229%2014.804%205.44422C14.6626%205.38567%2014.4834%205.38567%2014.125%205.38567L14.125%205.38567C14.0075%205.38567%2013.9093%205.38567%2013.8254%205.38773L7.20256%205.38773C6.84414%205.38773%206.66493%205.38773%206.52357%205.44628C6.33509%205.52436%206.18534%205.6741%206.10727%205.86259C6.04871%206.00395%206.04871%206.18315%206.04871%206.54156V6.54157L6.04871%206.54159C6.04871%206.9%206.04871%207.0792%206.10727%207.22056C6.18534%207.40905%206.33509%207.55879%206.52357%207.63687C6.66493%207.69542%206.84414%207.69542%207.20256%207.69542H11.3379L4.94405%2014.0892C4.69061%2014.3427%204.56389%2014.4694%204.50533%2014.6108C4.42726%2014.7992%204.42726%2015.011%204.50533%2015.1995C4.56389%2015.3409%204.69061%2015.4676%204.94405%2015.721C5.19749%2015.9745%205.32421%2016.1012%205.46557%2016.1597C5.65405%2016.2378%205.86583%2016.2378%206.05431%2016.1597Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A"}'),shape:{cross:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%223.70374%22%20y%3D%228.14795%22%20width%3D%2212.5926%22%20height%3D%223.7037%22%20rx%3D%220.740741%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A",up:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M9.44533%205.81157C9.74012%205.47858%2010.2598%205.47858%2010.5546%205.81157L16.2868%2012.2867C16.71%2012.7647%2016.3706%2013.5184%2015.7322%2013.5184H4.26776C3.62933%2013.5184%203.28995%2012.7647%203.71313%2012.2867L9.44533%205.81157Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A",down:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10.5547%2014.1884C10.2599%2014.5214%209.74019%2014.5214%209.4454%2014.1884L3.71321%207.71335C3.29002%207.23532%203.6294%206.48161%204.26784%206.48161L15.7322%206.48161C16.3707%206.48161%2016.7101%207.23532%2016.2869%207.71335L10.5547%2014.1884Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","rhomboid-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M2.1415%2011.1984C1.8412%2010.9074%201.8412%2010.4256%202.1415%2010.1346L9.48467%203.01785C9.77196%202.73942%2010.2284%202.73942%2010.5157%203.01786L17.8586%2010.1346C18.1589%2010.4256%2018.1589%2010.9074%2017.8586%2011.1984L10.5157%2018.3151C10.2284%2018.5936%209.77196%2018.5936%209.48467%2018.3152L2.1415%2011.1984Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-greed":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-pink":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23FB9D9D%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-black":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22black%22%2F%3E%0A%3C%2Fsvg%3E%0A","triangle-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url(%23clip0_613_237)%22%3E%0A%3Cpath%20d%3D%22M9.32308%204.41301C9.58368%203.82623%2010.4164%203.82623%2010.677%204.413L15.9526%2016.2917C16.1701%2016.7815%2015.8115%2017.3331%2015.2756%2017.3331H4.72454C4.18858%2017.3331%203.83002%2016.7815%204.04756%2016.2917L9.32308%204.41301Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_613_237%22%3E%0A%3Crect%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22white%22%20transform%3D%22translate(0%200.666504)%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E%0A","indicate-greed":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%222.76941%22%20y%3D%222.76941%22%20width%3D%2214.4612%22%20height%3D%2214.4612%22%20rx%3D%223%22%20fill%3D%22black%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%224.5%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","indicate-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%222.76941%22%20y%3D%222.76941%22%20width%3D%2214.4612%22%20height%3D%2214.4612%22%20rx%3D%223%22%20fill%3D%22black%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%224.5%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","indicate-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%222.76941%22%20y%3D%222.76941%22%20width%3D%2214.4612%22%20height%3D%2214.4612%22%20rx%3D%223%22%20fill%3D%22black%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%224.5%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A"},feedback2:{mistake2:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.12194%206.33702C4.1805%206.47839%204.30722%206.6051%204.56066%206.85854L8.36822%2010.6661L4.56062%2014.4737C4.30718%2014.7272%204.18046%2014.8539%204.12191%2014.9952C4.04384%2015.1837%204.04384%2015.3955%204.12191%2015.584C4.18046%2015.7253%204.30718%2015.8521%204.56062%2016.1055C4.81406%2016.3589%204.94078%2016.4857%205.08214%2016.5442C5.27062%2016.6223%205.4824%2016.6223%205.67089%2016.5442C5.81225%2016.4857%205.93897%2016.3589%206.19241%2016.1055L10%2012.2979L13.8074%2016.1053C14.0609%2016.3588%2014.1876%2016.4855%2014.329%2016.544C14.5174%2016.6221%2014.7292%2016.6221%2014.9177%2016.544C15.0591%2016.4855%2015.1858%2016.3588%2015.4392%2016.1053L15.4392%2016.1053C15.6927%2015.8519%2015.8194%2015.7252%2015.8779%2015.5838C15.956%2015.3953%2015.956%2015.1835%2015.8779%2014.9951C15.8194%2014.8537%2015.6927%2014.727%2015.4392%2014.4735L15.4392%2014.4735L11.6318%2010.6661L15.4392%206.85872C15.6926%206.60528%2015.8193%206.47856%2015.8779%206.3372C15.956%206.14871%2015.956%205.93694%2015.8779%205.74845C15.8193%205.60709%2015.6926%205.48037%2015.4392%205.22693C15.1857%204.97349%2015.059%204.84677%2014.9177%204.78822C14.7292%204.71015%2014.5174%204.71015%2014.3289%204.78822C14.1876%204.84677%2014.0608%204.97349%2013.8074%205.22693L10%209.03433L6.19244%205.22676C5.939%204.97332%205.81228%204.8466%205.67092%204.78805C5.48244%204.70997%205.27066%204.70997%205.08218%204.78805C4.94082%204.8466%204.8141%204.97332%204.56066%205.22676L4.56066%205.22676C4.30722%205.4802%204.1805%205.60692%204.12194%205.74828C4.04387%205.93676%204.04387%206.14854%204.12194%206.33702Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A",warn2:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M8.49778%205.00963C8.48513%204.56774%208.47881%204.3468%208.56086%204.17746C8.63301%204.02856%208.75124%203.90689%208.89802%203.83052C9.06494%203.74365%209.28597%203.74365%209.72805%203.74365H10.272C10.714%203.74365%2010.9351%203.74365%2011.102%203.83052C11.2488%203.9069%2011.367%204.02856%2011.4392%204.17746C11.5212%204.3468%2011.5149%204.56775%2011.5022%205.00964L11.2644%2013.3173C11.2524%2013.737%2011.2464%2013.9468%2011.1609%2014.1065C11.0857%2014.2471%2010.9687%2014.3609%2010.826%2014.432C10.6639%2014.5129%2010.454%2014.5129%2010.0342%2014.5129H9.96582C9.54601%2014.5129%209.33611%2014.5129%209.17397%2014.432C9.0313%2014.3609%208.91426%2014.2471%208.83904%2014.1065C8.75357%2013.9468%208.74756%2013.737%208.73555%2013.3173L8.49778%205.00963Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3Crect%20x%3D%228.76917%22%20y%3D%2215.2817%22%20width%3D%222.46154%22%20height%3D%222.46154%22%20rx%3D%220.769231%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A",correct2:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url(%23clip0_613_248)%22%3E%0A%3Cpath%20d%3D%22M15.689%205.69723C15.5476%205.75578%2015.4209%205.8825%2015.1675%206.13594L7.82436%2013.4791L4.83279%2010.4875C4.57935%2010.2341%204.45263%2010.1073%204.31127%2010.0488C4.12278%209.97071%203.91101%209.97071%203.72252%2010.0488C3.58116%2010.1073%203.45444%2010.2341%203.201%2010.4875C2.94756%2010.7409%202.82084%2010.8676%202.76229%2011.009C2.68422%2011.1975%202.68422%2011.4093%202.76229%2011.5978C2.82084%2011.7391%202.94756%2011.8658%203.201%2012.1193L7.0085%2015.9268C7.26194%2016.1802%207.38866%2016.3069%207.53002%2016.3655C7.7185%2016.4436%207.93028%2016.4436%208.11876%2016.3655C8.26013%2016.3069%208.38685%2016.1802%208.64028%2015.9268C8.66387%2015.9032%208.68636%2015.8807%208.7078%2015.8592L16.7993%207.76772C17.0527%207.51428%2017.1794%207.38756%2017.238%207.2462C17.3161%207.05772%2017.3161%206.84594%2017.238%206.65746C17.1794%206.5161%2017.0527%206.38938%2016.7993%206.13594C16.5458%205.8825%2016.4191%205.75578%2016.2777%205.69723C16.0893%205.61915%2015.8775%205.61915%2015.689%205.69723Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_613_248%22%3E%0A%3Crect%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22white%22%20transform%3D%22translate(0%200.666504)%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E%0A"},flag:{"flag-green":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.4274%204.74935C14.0982%205.1012%2013.1363%205.13675%2012.3604%205.03379C11.5776%204.93009%2010.9487%204.68342%2010.2456%204.40416L10.2246%204.39527C9.53411%204.1212%208.76945%203.8175%207.81312%203.69157C6.84279%203.56268%205.71016%203.61898%204.24802%204.0049C4.09343%204.04217%203.95538%204.13393%203.85649%204.26515C3.7576%204.39636%203.70374%204.55925%203.70374%204.72712V17.3197C3.70374%2017.5162%203.79534%2017.7046%203.92654%2017.8435C4.05773%2017.9824%204.25893%2018.0605%204.44448%2018.0605C4.63002%2018.0605%204.84911%2017.9824%204.98031%2017.8435C5.11151%2017.7046%205.18522%2017.5162%205.18522%2017.3197V14.9123V12.5049C6.24649%2012.2738%206.97081%2012.2605%207.63962%2012.3486C8.42246%2012.4523%209.05139%2012.699%209.75448%2012.9782L9.77546%2012.9871C10.466%2013.2612%2011.2306%2013.5649%2012.1869%2013.6908C13.1601%2013.8197%2014.2976%2013.7627%2015.7667%2013.3738C15.8866%2013.3421%2016.0727%2013.2135%2016.1483%2013.111C16.2238%2013.0084%2016.2963%2012.8204%2016.2963%2012.6553V5.46787C16.2963%205.35535%2016.2721%205.24432%2016.2255%205.1432C16.1788%205.04208%2016.1111%204.95353%2016.0274%204.88428C15.9436%204.81502%2015.846%204.76688%2015.7421%204.7435C15.6382%204.72012%2015.494%204.73173%2015.4274%204.74935Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","flag-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.4274%204.74935C14.0982%205.1012%2013.1363%205.13675%2012.3604%205.03379C11.5776%204.93009%2010.9487%204.68342%2010.2456%204.40416L10.2246%204.39527C9.53411%204.1212%208.76945%203.8175%207.81312%203.69157C6.84279%203.56268%205.71016%203.61898%204.24802%204.0049C4.09343%204.04217%203.95538%204.13393%203.85649%204.26515C3.7576%204.39636%203.70374%204.55925%203.70374%204.72712V17.3197C3.70374%2017.5162%203.79534%2017.7046%203.92654%2017.8435C4.05773%2017.9824%204.25893%2018.0605%204.44448%2018.0605C4.63002%2018.0605%204.84911%2017.9824%204.98031%2017.8435C5.11151%2017.7046%205.18522%2017.5162%205.18522%2017.3197V14.9123V12.5049C6.24649%2012.2738%206.97081%2012.2605%207.63962%2012.3486C8.42246%2012.4523%209.05139%2012.699%209.75448%2012.9782L9.77546%2012.9871C10.466%2013.2612%2011.2306%2013.5649%2012.1869%2013.6908C13.1601%2013.8197%2014.2976%2013.7627%2015.7667%2013.3738C15.8866%2013.3421%2016.0727%2013.2135%2016.1483%2013.111C16.2238%2013.0084%2016.2963%2012.8204%2016.2963%2012.6553V5.46787C16.2963%205.35535%2016.2721%205.24432%2016.2255%205.1432C16.1788%205.04208%2016.1111%204.95353%2016.0274%204.88428C15.9436%204.81502%2015.846%204.76688%2015.7421%204.7435C15.6382%204.72012%2015.494%204.73173%2015.4274%204.74935Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","flag-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.4274%204.74935C14.0982%205.1012%2013.1363%205.13675%2012.3604%205.03379C11.5776%204.93009%2010.9487%204.68342%2010.2456%204.40416L10.2246%204.39527C9.53411%204.1212%208.76945%203.8175%207.81312%203.69157C6.84279%203.56268%205.71016%203.61898%204.24802%204.0049C4.09343%204.04217%203.95538%204.13393%203.85649%204.26515C3.7576%204.39636%203.70374%204.55925%203.70374%204.72712V17.3197C3.70374%2017.5162%203.79534%2017.7046%203.92654%2017.8435C4.05773%2017.9824%204.25893%2018.0605%204.44448%2018.0605C4.63002%2018.0605%204.84911%2017.9824%204.98031%2017.8435C5.11151%2017.7046%205.18522%2017.5162%205.18522%2017.3197V14.9123V12.5049C6.24649%2012.2738%206.97081%2012.2605%207.63962%2012.3486C8.42246%2012.4523%209.05139%2012.699%209.75448%2012.9782L9.77546%2012.9871C10.466%2013.2612%2011.2306%2013.5649%2012.1869%2013.6908C13.1601%2013.8197%2014.2976%2013.7627%2015.7667%2013.3738C15.8866%2013.3421%2016.0727%2013.2135%2016.1483%2013.111C16.2238%2013.0084%2016.2963%2012.8204%2016.2963%2012.6553V5.46787C16.2963%205.35535%2016.2721%205.24432%2016.2255%205.1432C16.1788%205.04208%2016.1111%204.95353%2016.0274%204.88428C15.9436%204.81502%2015.846%204.76688%2015.7421%204.7435C15.6382%204.72012%2015.494%204.73173%2015.4274%204.74935Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A"},cell:{"cell-0":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224%22%20y%3D%224.00098%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%224.00098%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-25":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%224.00098%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-50":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-75":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%2211.251%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-100":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%2211.251%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%2211.251%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3C%2Fsvg%3E%0A"}},j2=[{title:"sheet.cf.iconSet.direction",group:[{name:"3Arrows",list:[m.arrow["up-green"],m.arrow["right-gold"],m.arrow["down-red"]]},{name:"3ArrowsGray",list:[m.arrow["up-gray"],m.arrow["right-gray"],m.arrow["down-gray"]]},{name:"4Arrows",list:[m.arrow["up-green"],m.arrow["rightAndUp-gold"],m.arrow["rightAndDown-gold"],m.arrow["down-red"]]},{name:"4ArrowsGray",list:[m.arrow["up-gray"],m.arrow["rightAndUp-gray"],m.arrow["rightAndDown-gray"],m.arrow["down-gray"]]},{name:"5Arrows",list:[m.arrow["up-green"],m.arrow["rightAndUp-gold"],m.arrow["right-gold"],m.arrow["rightAndDown-gold"],m.arrow["down-red"]]},{name:"5ArrowsGray",list:[m.arrow["up-gray"],m.arrow["rightAndUp-gray"],m.arrow["right-gray"],m.arrow["rightAndDown-gray"],m.arrow["down-gray"]]},{name:"3Triangles",list:[m.shape.up,m.shape.cross,m.shape.down]}]},{title:"sheet.cf.iconSet.shape",group:[{name:"3TrafficLights1",list:[m.shape["roundness-greed"],m.shape["roundness-gold"],m.shape["roundness-red"]]},{name:"3Signs",list:[m.shape["roundness-greed"],m.shape["triangle-gold"],m.shape["rhomboid-red"]]},{name:"3TrafficLights2",list:[m.shape["indicate-greed"],m.shape["indicate-gold"],m.shape["indicate-red"]]},{name:"4RedToBlack",list:[m.shape["roundness-red"],m.shape["roundness-pink"],m.shape["roundness-gray"],m.shape["roundness-black"]]},{name:"4TrafficLights",list:[m.shape["roundness-greed"],m.shape["roundness-gold"],m.shape["roundness-red"],m.shape["roundness-black"]]}]},{title:"sheet.cf.iconSet.mark",group:[{name:"3Symbols",list:[m.feedback.correct,m.feedback.warn,m.feedback.mistake]},{name:"3Symbols2",list:[m.feedback2.correct2,m.feedback2.warn2,m.feedback2.mistake2]},{name:"3Flags",list:[m.flag["flag-green"],m.flag["flag-gold"],m.flag["flag-red"]]}]},{title:"sheet.cf.iconSet.rank",group:[{name:"4Rating",list:[m.signal.signal25,m.signal.signal50,m.signal.signal75,m.signal.signal100]},{name:"5Rating",list:[m.signal.signal0,m.signal.signal25,m.signal.signal50,m.signal.signal75,m.signal.signal100]},{name:"5Quarters",list:[m.progress.progress100,m.progress.progress75,m.progress.progress50,m.progress.progress25,m.progress.progress0]},{name:"_5Felling",list:[m.feeling.guffaw,m.feeling.smile,m.feeling.noninductive,m.feeling.dissatisfied,m.feeling.impatient]},{name:"5Boxes",list:[m.cell["cell-100"],m.cell["cell-75"],m.cell["cell-50"],m.cell["cell-25"],m.cell["cell-0"]]},{name:"3Stars",list:[m.star.starFull,m.star.starIncomplete,m.star.starEmpty]}]}],i2=j2.reduce((r,a)=>{const{group:n}=a;for(const e of n)r[e.name]=e.list;return r},{});for(const r in i2){const a=i2[r];Object.freeze(a)}const $2="EMPTY_ICON_TYPE",f0="ssheets-conditional-formatting.config",P2={};var m0=Object.getOwnPropertyDescriptor,v0=(r,a,n,e)=>{for(var t=e>1?void 0:e?m0(a,n):a,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=s(t)||t);return t},K=(r,a)=>(n,e)=>a(n,e,r);C.ConditionalFormattingService=class extends u.Disposable{constructor(a,n,e,t,i,s){super(),this._conditionalFormattingRuleModel=a,this._injector=n,this._univerInstanceService=e,this._resourceManagerService=t,this._sheetInterceptorService=i,this._commandService=s,this._initCellChange(),this._initSnapshot(),this._initSheetChange()}get _conditionalFormattingViewModelV2(){return this._injector.get(C.ConditionalFormattingViewModel)}composeStyle(a,n,e,t){const i=this._conditionalFormattingViewModelV2.getCellCfs(a,n,e,t);if(i&&(i!=null&&i.length)){const s=i.map(l=>this._conditionalFormattingRuleModel.getRule(a,n,l.cfId)).filter(l=>!!l).reverse(),o=s.findIndex(l=>l==null?void 0:l.stopIfTrue);return o>-1&&s.splice(o+1),s.reduce((l,c)=>{var D;const h=c.rule.type,g=i.find(f=>f.cfId===c.cfId);if(h===I.highlightCell)g.result&&u.merge(l,{style:g.result});else if(h===I.colorScale){const f=g==null?void 0:g.result;f&&typeof f=="string"&&(l.style={...(D=l.style)!=null?D:{},bg:{rgb:f}})}else if(h===I.dataBar){const f=g==null?void 0:g.result;f&&(l.dataBar=f,l.isShowValue=f.isShowValue)}else if(h===I.iconSet){const f=g==null?void 0:g.result;f&&(l.iconSet=f,l.isShowValue=f.isShowValue)}return l},{})}return null}_initSnapshot(){const a=e=>{const t=this._conditionalFormattingRuleModel.getUnitRules(e),i={};return t?(t.forEach((s,o)=>{i[o]=s}),JSON.stringify(i)):""},n=e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:h2,businesses:[u.UniverInstanceType.UNIVER_SHEET],toJson:e=>a(e),parseJson:e=>n(e),onUnLoad:e=>{this._conditionalFormattingRuleModel.deleteUnitId(e),this._conditionalFormattingViewModelV2.dispose()},onLoad:(e,t)=>{Object.keys(t).forEach(i=>{[...t[i]].reverse().forEach(o=>{this._conditionalFormattingRuleModel.addRule(e,i,o)})})}}))}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:a=>{if(a.id===p.RemoveSheetCommand.id){const n=a.params,e=n.unitId||F0(this._univerInstanceService),t=n.subUnitId||w0(this._univerInstanceService);if(!t)return{redos:[],undos:[]};const i=this._conditionalFormattingRuleModel.getSubunitRules(e,t);if(!i)return{redos:[],undos:[]};const s=[],o=[];return i.forEach(d=>{const l={unitId:e,subUnitId:t,cfId:d.cfId};s.push({id:$.id,params:l}),o.push(...z(this._injector,l))}),{redos:s,undos:o}}return{redos:[],undos:[]}}}))}_initCellChange(){this.disposeWithMe(this._commandService.onCommandExecuted(a=>{const n=(e,t,i)=>{const s=new Set;return i.forEach(([o,d])=>{const l=this._conditionalFormattingViewModelV2.getCellCfs(e,t,o,d);l==null||l.forEach(c=>s.add(c.cfId))}),[...s].map(o=>this._conditionalFormattingRuleModel.getRule(e,t,o)).filter(o=>!!o)};switch(a.id){case p.SetRangeValuesMutation.id:{const e=a.params,{subUnitId:t,unitId:i,cellValue:s}=e,o=[];new u.ObjectMatrix(s).forValue((l,c,h)=>{h&&Object.keys(h).some(D=>["p","v"].includes(D))&&o.push([l,c])}),n(i,t,o).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,t,l.cfId)});break}case p.InsertColMutation.id:case p.RemoveColMutation.id:{const{range:e,unitId:t,subUnitId:i}=a.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i),o={...e,endColumn:Number.MAX_SAFE_INTEGER};s&&s.filter(l=>l.ranges.some(c=>u.Rectangle.intersects(c,o))).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,l.cfId)});break}case p.RemoveRowMutation.id:case p.InsertRowMutation.id:{const{range:e,unitId:t,subUnitId:i}=a.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i),o={...e,endRow:Number.MAX_SAFE_INTEGER};s&&s.filter(l=>l.ranges.some(c=>u.Rectangle.intersects(c,o))).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,l.cfId)});break}case p.MoveRowsMutation.id:{const{sourceRange:e,targetRange:t,unitId:i,subUnitId:s}=a.params,o=this._conditionalFormattingRuleModel.getSubunitRules(i,s),d={startRow:Math.min(e.startRow,t.startRow),endRow:Number.MAX_SAFE_INTEGER,startColumn:0,endColumn:Number.MAX_SAFE_INTEGER};o&&o.filter(c=>c.ranges.some(h=>u.Rectangle.intersects(h,d))).forEach(c=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,s,c.cfId)});break}case p.MoveColsMutation.id:{const{sourceRange:e,targetRange:t,unitId:i,subUnitId:s}=a.params,o=this._conditionalFormattingRuleModel.getSubunitRules(i,s),d={startRow:0,endRow:Number.MAX_SAFE_INTEGER,startColumn:Math.min(e.startColumn,t.startColumn),endColumn:Number.MAX_SAFE_INTEGER};o&&o.filter(c=>c.ranges.some(h=>u.Rectangle.intersects(h,d))).forEach(c=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,s,c.cfId)});break}case p.MoveRangeMutation.id:{const{unitId:e,to:t,from:i}=a.params,s=o=>{const d=[];new u.ObjectMatrix(o.value).forValue((c,h)=>{d.push([c,h])}),n(e,o.subUnitId,d).forEach(c=>{this._conditionalFormattingViewModelV2.markRuleDirty(e,o.subUnitId,c.cfId)})};s(t),s(i);break}case p.ReorderRangeMutation.id:{const{range:e,unitId:t,subUnitId:i}=a.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i);s&&s.filter(d=>d.ranges.some(l=>u.Rectangle.intersects(l,e))).forEach(d=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,d.cfId)});break}}}))}},C.ConditionalFormattingService=v0([K(0,u.Inject(M)),K(1,u.Inject(u.Injector)),K(2,u.Inject(u.IUniverInstanceService)),K(3,u.Inject(u.IResourceManagerService)),K(4,u.Inject(p.SheetInterceptorService)),K(5,u.Inject(u.ICommandService))],C.ConditionalFormattingService);const F0=r=>r.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET).getUnitId(),w0=r=>{var a;return(a=r.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:a.getSheetId()};var E0=Object.getOwnPropertyDescriptor,p0=(r,a,n,e)=>{for(var t=e>1?void 0:e?E0(a,n):a,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=s(t)||t);return t},F2=(r,a)=>(n,e)=>a(n,e,r);C.UniverSheetsConditionalFormattingPlugin=(c2=class extends u.Plugin{constructor(a=P2,n,e,t){super(),this._config=a,this._injector=n,this._commandService=e,this._configService=t;const{...i}=u.merge({},P2,this._config);this._configService.setConfig(f0,i),[[C.ConditionalFormattingService],[C.ConditionalFormattingFormulaService],[M],[C.ConditionalFormattingViewModel]].forEach(s=>{this._injector.add(s)}),[I2,R2,x2,S2,b2,L2,Q,$,X,H,e2].forEach(s=>{this._commandService.registerCommand(s)})}onStarting(){this._injector.get(C.ConditionalFormattingService),u.touchDependencies(this._injector,[[C.ConditionalFormattingService],[C.ConditionalFormattingViewModel]])}},F(c2,"pluginName",h2),F(c2,"type",u.UniverInstanceType.UNIVER_SHEET),c2),C.UniverSheetsConditionalFormattingPlugin=p0([F2(1,u.Inject(u.Injector)),F2(2,u.Inject(u.ICommandService)),F2(3,u.IConfigService)],C.UniverSheetsConditionalFormattingPlugin);const W2="sheet-conditional-rule-icon",A0=35,q2=15,Z2=2,y0=r=>{const{startRow:a,endRow:n,startColumn:e,endColumn:t}=r;return`${a}-${n}-${e}-${t}`};class G2 extends G.SheetExtension{constructor(){super();F(this,"_paddingRightAndLeft",Z2);F(this,"_width",q2);F(this,"_imageMap",new Map);F(this,"uKey",W2);F(this,"Z_INDEX",A0);F(this,"_radius",1);this._init()}draw(n,e,t,i){const{worksheet:s}=t;if(!s)return!1;const o=new Set;n.save(),u.Range.foreach(t.rowColumnSegment,(d,l)=>{if(!s.getRowVisible(d)||!s.getColVisible(l))return;const c=t.getCellWithCoordByIndex(d,l,!1),{isMerged:h,isMergedMainCell:g,mergeInfo:D}=c;let f=s.getCell(d,l);if(h&&(f=s.getCell(D.startRow,D.startColumn)),!(f!=null&&f.iconSet))return;const{iconType:v,iconId:w}=f.iconSet;if(v===$2)return;const A=this._imageMap.get(this._createKey(v,w));if(!A||!this.isRenderDiffRangesByCell(D,i))return;if(h||g){const P=y0(D);if(o.has(P))return;o.add(P)}const{startX:x,endX:_,startY:S,endY:B}=h||g?D:c,w2=_-x,d2=B-S;if(this._width>d2||this._width>w2+this._paddingRightAndLeft*2)return;const E2=(d2-this._width)/2+S;n.drawImage(A,x+this._paddingRightAndLeft,E2,this._width,this._width)}),n.restore()}_init(){for(const n in i2)i2[n].forEach((t,i)=>{const s=this._createKey(n,String(i)),o=new Image;o.onload=()=>{this._imageMap.set(s,o)},o.src=t})}_createKey(n,e){return`${n}_${e}`}}G.SpreadsheetExtensionRegistry.add(G2);function H2(r){if(typeof r!="object"||r===null)return r;const a={};for(const n in r)if(r.hasOwnProperty(n)){const e=H2(r[n]);e!==void 0&&(a[n]=e)}return a}Object.defineProperty(C,"isRangesEqual",{enumerable:!0,get:()=>u.isRangesEqual}),C.AddCfCommand=I2,C.AddConditionalRuleMutation=Q,C.AddConditionalRuleMutationUndoFactory=M2,C.CFNumberOperator=E,C.CFRuleType=I,C.CFSubRuleType=y,C.CFTextOperator=b,C.CFTimePeriodOperator=L,C.CFValueType=R,C.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH=o2,C.ClearRangeCfCommand=R2,C.ClearWorksheetCfCommand=x2,C.ConditionalFormattingFormulaMarkDirty=e2,C.ConditionalFormattingIcon=G2,C.ConditionalFormattingRuleModel=M,C.DEFAULT_BG_COLOR=Y2,C.DEFAULT_FONT_COLOR=K2,C.DEFAULT_PADDING=Z2,C.DEFAULT_WIDTH=q2,C.DataBar=B2,C.DeleteCfCommand=S2,C.DeleteConditionalRuleMutation=$,C.DeleteConditionalRuleMutationUndoFactory=z,C.EMPTY_ICON_TYPE=$2,C.FormulaResultStatus=T,C.IconUKey=W2,C.MoveCfCommand=b2,C.MoveConditionalRuleMutation=H,C.MoveConditionalRuleMutationUndoFactory=_2,C.SHEET_CONDITIONAL_FORMATTING_PLUGIN=h2,C.SetCfCommand=L2,C.SetConditionalRuleMutation=X,C.anchorUndoFactory=A2,C.compareWithNumber=Y,C.createCfId=y2,C.createDefaultRule=J2,C.createDefaultValue=z2,C.createDefaultValueByValueType=Q2,C.dataBarUKey=T2,C.defaultDataBarNativeColor=m2,C.defaultDataBarPositiveColor=f2,C.defaultPlaceholderColor=k2,C.filterRange=u2,C.findIndexByAnchor=j,C.getCacheStyleMatrix=C0,C.getCellValue=N,C.getColorScaleFromValue=O2,C.getMaxInFormulaResult=D0,C.getOppositeOperator=V2,C.getValueByType=n2,C.iconGroup=j2,C.iconMap=i2,C.isAnchorEqual=e0,C.isFloatsEqual=t2,C.isNullable=k,C.moveByAnchor=p2,C.removeUndefinedAttr=H2,C.serialTimeToTimestamp=N2,C.setConditionalRuleMutationUndoFactory=C2,C.toYMD_1900=U2,C.transformSupportSymmetryAnchor=g2,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})}));
3
3
 
4
4
 
5
5
  // @univerjs/sheets-conditional-formatting/facade
@@ -7,7 +7,7 @@
7
7
 
8
8
 
9
9
  // @univerjs/sheets-conditional-formatting-ui/index
10
- (function(D,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/ui"),require("react/jsx-runtime"),require("react"),require("@univerjs/design"),require("@univerjs/engine-formula"),require("@univerjs/sheets-formula-ui"),require("@univerjs/sheets-ui"),require("rxjs"),require("@univerjs/engine-render"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","@univerjs/sheets-conditional-formatting","@univerjs/ui","react/jsx-runtime","react","@univerjs/design","@univerjs/engine-formula","@univerjs/sheets-formula-ui","@univerjs/sheets-ui","rxjs","@univerjs/engine-render","rxjs/operators"],i):(D=typeof globalThis<"u"?globalThis:D||self,i(D.UniverSheetsConditionalFormattingUi={},D.UniverCore,D.UniverSheets,D.UniverSheetsConditionalFormatting,D.UniverUi,D.React,D.React,D.UniverDesign,D.UniverEngineFormula,D.UniverSheetsFormulaUi,D.UniverSheetsUi,D.rxjs,D.UniverEngineRender,D.rxjs.operators))})(this,(function(D,i,U,t,j,c,m,O,$e,pe,W,J,ar,fe){"use strict";var Wt=Object.defineProperty;var qt=(D,i,U)=>i in D?Wt(D,i,{enumerable:!0,configurable:!0,writable:!0,value:U}):D[i]=U;var re=(D,i,U)=>qt(D,typeof i!="symbol"?i+"":i,U);const He={type:i.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(r,e){if(!e)return!1;const{ranges:l,style:n,stopIfTrue:a,operator:u}=e,s=r.get(t.ConditionalFormattingRuleModel),v=r.get(i.ICommandService),o=r.get(i.IUniverInstanceService),f=U.getSheetCommandTarget(o);if(!f)return!1;const{unitId:d,subUnitId:p}=f,h=s.createCfId(d,p),b={ranges:l,cfId:h,stopIfTrue:!!a,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.average,operator:u,style:n}};return v.executeCommand(t.AddConditionalRuleMutation.id,{unitId:d,subUnitId:p,rule:b})}},Be={type:i.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(r,e){if(!e)return!1;const{ranges:l,config:n,stopIfTrue:a}=e,u=r.get(t.ConditionalFormattingRuleModel),s=r.get(i.ICommandService),v=r.get(i.IUniverInstanceService),o=U.getSheetCommandTarget(v);if(!o)return!1;const{unitId:f,subUnitId:d}=o,p=u.createCfId(f,d),h={ranges:l,cfId:p,stopIfTrue:!!a,rule:{type:t.CFRuleType.colorScale,config:n}};return s.executeCommand(t.AddConditionalRuleMutation.id,{unitId:f,subUnitId:d,rule:h})}},We={type:i.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(r,e){if(!e)return!1;const{ranges:l,min:n,max:a,nativeColor:u,positiveColor:s,isGradient:v,stopIfTrue:o,isShowValue:f}=e,d=r.get(t.ConditionalFormattingRuleModel),p=r.get(i.IUniverInstanceService),h=U.getSheetCommandTarget(p);if(!h)return!1;const{unitId:b,subUnitId:S}=h,C=r.get(i.ICommandService),N=d.createCfId(b,S),_={ranges:l,cfId:N,stopIfTrue:!!o,rule:{type:t.CFRuleType.dataBar,isShowValue:f,config:{min:n,max:a,nativeColor:u,positiveColor:s,isGradient:v}}};return C.executeCommand(t.AddConditionalRuleMutation.id,{unitId:b,subUnitId:S,rule:_})}},qe={type:i.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(r,e){if(!e)return!1;const{ranges:l,style:n,stopIfTrue:a}=e,u=r.get(t.ConditionalFormattingRuleModel),s=r.get(i.ICommandService),v=r.get(i.IUniverInstanceService),o=U.getSheetCommandTarget(v);if(!o)return!1;const{unitId:f,subUnitId:d}=o,p=u.createCfId(f,d),h={ranges:l,cfId:p,stopIfTrue:!!a,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.duplicateValues,style:n}};return s.executeCommand(t.AddConditionalRuleMutation.id,{unitId:f,subUnitId:d,rule:h})}},Ge={type:i.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(r,e){if(!e)return!1;const{ranges:l,style:n,stopIfTrue:a,operator:u,value:s}=e,v=r.get(t.ConditionalFormattingRuleModel),o=r.get(i.ICommandService),f=r.get(i.IUniverInstanceService),d=U.getSheetCommandTarget(f);if(!d)return!1;const{unitId:p,subUnitId:h}=d,b=v.createCfId(p,h);let S;if([t.CFNumberOperator.between,t.CFNumberOperator.notBetween].includes(u)){const C=s;if(C.length!==2||!Array.isArray(C))return!1;S={ranges:l,cfId:b,stopIfTrue:!!a,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.number,operator:u,style:n,value:C}}}else{const C=s;if(typeof C!="number")return!1;S={ranges:l,cfId:b,stopIfTrue:!!a,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.number,operator:u,style:n,value:C}}}return o.executeCommand(t.AddConditionalRuleMutation.id,{unitId:p,subUnitId:h,rule:S})}},Ze={type:i.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(r,e){if(!e)return!1;const{ranges:l,style:n,stopIfTrue:a,isPercent:u,isBottom:s,value:v}=e,o=r.get(t.ConditionalFormattingRuleModel),f=r.get(i.IUniverInstanceService),d=r.get(i.ICommandService),p=U.getSheetCommandTarget(f);if(!p)return!1;const{unitId:h,subUnitId:b}=p,S=o.createCfId(h,b),C={ranges:l,cfId:S,stopIfTrue:!!a,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.rank,isPercent:u,isBottom:s,style:n,value:v}};return d.executeCommand(t.AddConditionalRuleMutation.id,{unitId:h,subUnitId:b,rule:C})}},ze={type:i.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(r,e){if(!e)return!1;const{ranges:l,style:n,stopIfTrue:a,operator:u,value:s}=e,v=r.get(t.ConditionalFormattingRuleModel),o=r.get(i.IUniverInstanceService),f=U.getSheetCommandTarget(o);if(!f)return!1;const{unitId:d,subUnitId:p}=f,h=r.get(i.ICommandService),b=v.createCfId(d,p),S={ranges:l,cfId:b,stopIfTrue:!!a,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.text,operator:u,style:n,value:s}};return h.executeCommand(t.AddConditionalRuleMutation.id,{unitId:d,subUnitId:p,rule:S})}},Ye={type:i.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(r,e){if(!e)return!1;const{ranges:l,style:n,stopIfTrue:a,operator:u}=e,s=r.get(t.ConditionalFormattingRuleModel),v=r.get(i.IUniverInstanceService),o=r.get(i.ICommandService),f=U.getSheetCommandTarget(v);if(!f)return!1;const{unitId:d,subUnitId:p}=f,h=s.createCfId(d,p),b={ranges:l,cfId:h,stopIfTrue:!!a,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.timePeriod,operator:u,style:n}};return o.executeCommand(t.AddConditionalRuleMutation.id,{unitId:d,subUnitId:p,rule:b})}},Ke={type:i.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(r,e){if(!e)return!1;const{ranges:l,style:n,stopIfTrue:a}=e,u=r.get(t.ConditionalFormattingRuleModel),s=r.get(i.IUniverInstanceService),v=r.get(i.ICommandService),o=U.getSheetCommandTarget(s);if(!o)return!1;const{unitId:f,subUnitId:d}=o,p=u.createCfId(f,d),h={ranges:l,cfId:p,stopIfTrue:!!a,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.uniqueValues,style:n}};return v.executeCommand(t.AddConditionalRuleMutation.id,{unitId:f,subUnitId:d,rule:h})}};var K=function(){return K=Object.assign||function(r){for(var e,l=1,n=arguments.length;l<n;l++){e=arguments[l];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=e[a])}return r},K.apply(this,arguments)},Rr=function(r,e){var l={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(l[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(r);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(r,n[a])&&(l[n[a]]=r[n[a]]);return l},X=m.forwardRef(function(r,e){var l=r.icon,n=r.id,a=r.className,u=r.extend,s=Rr(r,["icon","id","className","extend"]),v="univerjs-icon univerjs-icon-".concat(n," ").concat(a||"").trim(),o=m.useRef("_".concat(Or()));return lr(l,"".concat(n),{defIds:l.defIds,idSuffix:o.current},K({ref:e,className:v},s),u)});function lr(r,e,l,n,a){return m.createElement(r.tag,K(K({key:e},Mr(r,l,a)),n),(Vr(r,l).children||[]).map(function(u,s){return lr(u,"".concat(e,"-").concat(r.tag,"-").concat(s),l,void 0,a)}))}function Mr(r,e,l){var n=K({},r.attrs);l!=null&&l.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=l.colorChannel1),r.tag==="mask"&&n.id&&(n.id=n.id+e.idSuffix),Object.entries(n).forEach(function(u){var s=u[0],v=u[1];s==="mask"&&typeof v=="string"&&(n[s]=v.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))});var a=e.defIds;return!a||a.length===0||(r.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(function(u){var s=u[0],v=u[1];typeof v=="string"&&(n[s]=v.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),n}function Vr(r,e){var l,n=e.defIds;return!n||n.length===0?r:r.tag==="defs"&&(!((l=r.children)===null||l===void 0)&&l.length)?K(K({},r),{children:r.children.map(function(a){return typeof a.attrs.id=="string"&&n&&n.includes(a.attrs.id)?K(K({},a),{attrs:K(K({},a.attrs),{id:a.attrs.id+e.idSuffix})}):a})}):r}function Or(){return Math.random().toString(36).substring(2,8)}X.displayName="UniverIcon";var Ur={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M4.65791 1.30005C3.77355 1.30005 3.05664 2.01696 3.05664 2.90132V12.8588C3.05664 13.8755 3.88086 14.6998 4.89759 14.6998H9.1016C11.2233 14.6998 12.9433 12.9798 12.9433 10.8581C12.9433 9.13925 11.8145 7.68407 10.2578 7.1934C10.8806 6.56856 11.2655 5.70659 11.2655 4.75472C11.2655 2.84676 9.71883 1.30005 7.81087 1.30005H4.65791ZM4.25664 2.90132C4.25664 2.6797 4.4363 2.50005 4.65791 2.50005H7.81087C9.05609 2.50005 10.0655 3.5095 10.0655 4.75472C10.0655 5.99993 9.05609 7.00938 7.81087 7.00938H4.25664V2.90132ZM4.25664 12.8588V8.21636H9.1016C10.5606 8.21636 11.7433 9.39909 11.7433 10.8581C11.7433 12.317 10.5606 13.4998 9.1016 13.4998H4.89759C4.5436 13.4998 4.25664 13.2128 4.25664 12.8588Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ur=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"bold-icon",ref:e,icon:Ur}))});ur.displayName="BoldIcon";var kr={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",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 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.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.64443C14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928L9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171C10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778L9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539C9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263L6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539C5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778L6.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"}}]},Ee=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"delete-icon",ref:e,icon:kr}))});Ee.displayName="DeleteIcon";var Pr={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"colorChannel1",d:"M1.98682 13.4992C1.98682 12.5603 2.74793 11.7992 3.68682 11.7992H14.2868C15.2257 11.7992 15.9868 12.5603 15.9868 13.4992V13.4992C15.9868 14.4381 15.2257 15.1992 14.2868 15.1992H3.68682C2.74793 15.1992 1.98682 14.4381 1.98682 13.4992V13.4992Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M10.3014 1.70389C9.85268 0.479568 8.12109 0.479557 7.67238 1.70389L4.72235 9.75326C4.60832 10.0644 4.76811 10.4091 5.07924 10.5231C5.39038 10.6371 5.73504 10.4773 5.84907 10.1662L6.99975 7.02646C7.03588 7.03324 7.07314 7.03679 7.11123 7.03679H10.9778L12.1247 10.1662C12.2387 10.4773 12.5834 10.6371 12.8945 10.5231C13.2057 10.4091 13.3654 10.0644 13.2514 9.75326L10.3014 1.70389ZM10.538 5.83679L9.17467 2.11682C9.11057 1.94192 8.8632 1.94192 8.7991 2.11682L7.43576 5.83679H10.538Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ir=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"font-color-double-icon",ref:e,icon:Pr}))});ir.displayName="FontColorDoubleIcon";var Dr={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",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"}}]},sr=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"increase-icon",ref:e,icon:Dr}))});sr.displayName="IncreaseIcon";var Lr={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M9.80385 1.40005H11.9997C12.3311 1.40005 12.5997 1.66868 12.5997 2.00005C12.5997 2.33143 12.3311 2.60005 11.9997 2.60005H10.1185L7.12251 13.4001H9.33324C9.66461 13.4001 9.93324 13.6687 9.93324 14.0001C9.93324 14.3314 9.66461 14.6001 9.33324 14.6001H6.34785C6.33847 14.6003 6.32905 14.6003 6.31962 14.6001H3.9999C3.66853 14.6001 3.3999 14.3314 3.3999 14.0001C3.3999 13.6687 3.66853 13.4001 3.9999 13.4001H5.87719L8.87322 2.60005H6.66641C6.33504 2.60005 6.06641 2.33143 6.06641 2.00005C6.06641 1.66868 6.33504 1.40005 6.66641 1.40005H9.52916C9.61698 1.37929 9.71064 1.3781 9.80385 1.40005Z"}}]},cr=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"italic-icon",ref:e,icon:Lr}))});cr.displayName="ItalicIcon";var jr={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",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"}}]},Xe=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"more-down-icon",ref:e,icon:jr}))});Xe.displayName="MoreDownIcon";var Ar={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.01281 1.36643C8.79386 0.585377 10.0602 0.585378 10.8412 1.36643L12.9223 3.44752C13.7034 4.22857 13.7034 5.4949 12.9223 6.27595L9.36445 9.83383C8.5834 10.6149 7.31707 10.6149 6.53602 9.83383L4.45493 7.75273C3.67388 6.97168 3.67388 5.70535 4.45493 4.9243L8.01281 1.36643ZM9.9927 2.21495C9.68028 1.90253 9.17375 1.90253 8.86133 2.21495L5.30346 5.77283L5.29671 5.77966L10.839 6.66224L12.0738 5.42742C12.3862 5.115 12.3862 4.60847 12.0738 4.29605L9.9927 2.21495Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M14.5179 9.48875C14.5179 9.99175 14.1101 10.3995 13.607 10.3995C13.1041 10.3995 12.6963 9.99175 12.6963 9.48875C12.6963 9.1773 13.0455 8.59966 13.3114 8.20487C13.4549 7.99177 13.7591 7.99177 13.9027 8.20486C14.1687 8.59965 14.5179 9.1773 14.5179 9.48875Z"}},{tag:"path",attrs:{fill:"colorChannel1",d:"M1.98682 13.4992C1.98682 12.5603 2.74793 11.7992 3.68682 11.7992H14.2868C15.2257 11.7992 15.9868 12.5603 15.9868 13.4992V13.4992C15.9868 14.4381 15.2257 15.1992 14.2868 15.1992H3.68682C2.74793 15.1992 1.98682 14.4381 1.98682 13.4992V13.4992Z"}}]},or=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"paint-bucket-double-icon",ref:e,icon:Ar}))});or.displayName="PaintBucketDoubleIcon";var Fr={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_622_8",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 4C7 3.44772 6.55228 3 6 3C5.44772 3 5 3.44772 5 4C5 4.55228 5.44772 5 6 5Z"}},{tag:"path",attrs:{d:"M6 9C6.55228 9 7 8.55229 7 8C7 7.44772 6.55228 7 6 7C5.44772 7 5 7.44772 5 8C5 8.55229 5.44772 9 6 9Z"}},{tag:"path",attrs:{d:"M7 12C7 12.5523 6.55228 13 6 13C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11C6.55228 11 7 11.4477 7 12Z"}},{tag:"path",attrs:{d:"M10 5C10.5523 5 11 4.55228 11 4C11 3.44772 10.5523 3 10 3C9.44771 3 9 3.44772 9 4C9 4.55228 9.44771 5 10 5Z"}},{tag:"path",attrs:{d:"M11 8C11 8.55229 10.5523 9 10 9C9.44771 9 9 8.55229 9 8C9 7.44772 9.44771 7 10 7C10.5523 7 11 7.44772 11 8Z"}},{tag:"path",attrs:{d:"M10 13C10.5523 13 11 12.5523 11 12C11 11.4477 10.5523 11 10 11C9.44771 11 9 11.4477 9 12C9 12.5523 9.44771 13 10 13Z"}}]}]},dr=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"sequence-icon",ref:e,icon:Fr}))});dr.displayName="SequenceIcon";var $r={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_436_41",width:17,height:17,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M.35.48H16.35V16.48H.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"}}]}]},he=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"slash-icon",ref:e,icon:$r}))});he.displayName="SlashIcon";var Hr={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.00033 1.20996C6.43345 1.20996 5.23596 1.88077 4.64804 2.94304C4.06338 3.99943 4.15123 5.32084 4.90099 6.47062C5.08199 6.7482 5.45374 6.82648 5.73131 6.64548C6.00888 6.46448 6.08716 6.09273 5.90616 5.81516C5.36418 4.98402 5.35768 4.13897 5.69797 3.52412C6.035 2.91515 6.78176 2.40996 8.00033 2.40996C9.19423 2.40996 10.0017 2.93409 10.5236 3.46755C10.7871 3.73682 10.9756 4.00712 11.0974 4.20903C11.158 4.30951 11.2013 4.39164 11.2284 4.44625C11.2419 4.47351 11.2514 4.49377 11.2568 4.50588L11.2621 4.51771C11.3901 4.82216 11.7407 4.96686 12.046 4.83992C12.3519 4.71267 12.4968 4.36149 12.3695 4.05552L11.8231 4.28278C12.3695 4.05552 12.3697 4.0558 12.3695 4.05552L12.3691 4.05437L12.3685 4.05298L12.367 4.04953L12.3629 4.03993L12.3498 4.01036C12.3388 3.98619 12.3234 3.95326 12.3033 3.91282C12.2632 3.83203 12.2043 3.72072 12.1249 3.58908C11.9666 3.32674 11.7235 2.97805 11.3814 2.62834C10.6921 1.92381 9.59192 1.20996 8.00033 1.20996Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M2.11953 8.5999H7.88935C10.1109 9.46549 10.5895 10.7649 10.4268 11.6869C10.2475 12.703 9.26939 13.5898 8.00009 13.5898C6.63323 13.5898 5.77631 13.0502 5.25534 12.528C4.99021 12.2623 4.80823 11.9965 4.69365 11.7993C4.63659 11.7011 4.59698 11.6211 4.5727 11.5686C4.56059 11.5424 4.55236 11.5231 4.54774 11.512L4.54352 11.5016C4.4267 11.193 4.0823 11.0363 3.77279 11.1516C3.46228 11.2673 3.30438 11.6129 3.4201 11.9234L3.9649 11.7203C3.4201 11.9234 3.41998 11.9231 3.4201 11.9234L3.4206 11.9247L3.42118 11.9263L3.42262 11.9301L3.42661 11.9403C3.42977 11.9484 3.43394 11.9588 3.43914 11.9713C3.44956 11.9965 3.46418 12.0304 3.48334 12.0719C3.52161 12.1547 3.57828 12.2682 3.65608 12.4021C3.81124 12.6692 4.0534 13.0223 4.40584 13.3756C5.12 14.0914 6.27196 14.7898 8.00009 14.7898C9.82574 14.7898 11.3236 13.5101 11.6085 11.8955C11.812 10.7422 11.3901 9.55402 10.2665 8.5999H13.8804C14.2117 8.5999 14.4803 8.33127 14.4803 7.9999C14.4803 7.66853 14.2117 7.3999 13.8804 7.3999H8.01411C8.0048 7.39968 7.99551 7.39969 7.98625 7.3999H2.11953C1.78816 7.3999 1.51953 7.66853 1.51953 7.9999C1.51953 8.33127 1.78816 8.5999 2.11953 8.5999Z"}}]},vr=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"strikethrough-icon",ref:e,icon:Hr}))});vr.displayName="StrikethroughIcon";var Br={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M4.46416 2.03237C4.46416 1.701 4.19553 1.43237 3.86416 1.43237C3.53279 1.43237 3.26416 1.701 3.26416 2.03237V7.33338C3.26416 10.0313 5.35834 12.2667 7.9999 12.2667C10.6415 12.2667 12.7356 10.0313 12.7356 7.33338V2.03237C12.7356 1.701 12.467 1.43237 12.1356 1.43237C11.8043 1.43237 11.5356 1.701 11.5356 2.03237V7.33338C11.5356 9.42194 9.92656 11.0667 7.9999 11.0667C6.07325 11.0667 4.46416 9.42194 4.46416 7.33338V2.03237Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M2.66641 13.4663C2.33504 13.4663 2.06641 13.7349 2.06641 14.0663C2.06641 14.3977 2.33504 14.6663 2.66641 14.6663H13.3331C13.6644 14.6663 13.9331 14.3977 13.9331 14.0663C13.9331 13.7349 13.6644 13.4663 13.3331 13.4663H2.66641Z"}}]},pr=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"underline-icon",ref:e,icon:Br}))});pr.displayName="UnderlineIcon";const te=r=>{const{color:e,onChange:l,disable:n=!1,Icon:a=or,className:u}=r,s=m.useMemo(()=>new i.ColorKit(e),[e]),v=()=>{const o={className:O.clsx("univer-fill-primary-600",n&&u),extend:{colorChannel1:s.isValid?e:""}};return c.jsx(a,{...o})};return n?v():c.jsx(O.Dropdown,{overlay:c.jsx("div",{className:"univer-rounded-lg univer-p-4",children:c.jsx(O.ColorPicker,{value:e,onChange:l})}),children:c.jsx("span",{className:O.clsx("univer-flex univer-cursor-pointer univer-items-center univer-rounded univer-p-1 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",u),children:v()})})},ue=r=>{var u,s,v,o,f;const e=r.rule;if(!e)return null;const l=m.useMemo(()=>{if(e.type===t.CFRuleType.colorScale){const d=e.config.map((b,S)=>({color:new i.ColorKit(b.color),value:S})),p=d.length-1;return new Array(5).fill("").map((b,S,C)=>S*p/(C.length-1)).map(b=>t.getColorScaleFromValue(d,b))}return null},[e]),n=m.useMemo(()=>{if(e.type===t.CFRuleType.iconSet)return e.config.map(d=>{const p=t.iconMap[d.iconType];return p&&p[Number(d.iconId)]})},[e]),a="univer-pointer-events-none univer-flex univer-h-5 univer-min-w-[72px] univer-items-center univer-justify-center univer-text-xs";switch(e.type){case t.CFRuleType.dataBar:{const{isGradient:d}=e.config,p=d?`linear-gradient(to right, ${e.config.positiveColor||t.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,h=d?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||t.defaultDataBarNativeColor})`:e.config.nativeColor;return c.jsxs("div",{className:a,children:[c.jsx("div",{className:"univer-h-full univer-w-1/2 univer-border univer-border-solid",style:{background:h,borderColor:(u=e.config.nativeColor)!=null?u:t.defaultDataBarNativeColor}}),c.jsx("div",{className:"univer-h-full univer-w-1/2 univer-border univer-border-solid",style:{background:p,borderColor:(s=e.config.positiveColor)!=null?s:t.defaultDataBarPositiveColor}})]})}case t.CFRuleType.colorScale:return l&&c.jsx("div",{className:a,children:l.map((d,p)=>c.jsx("div",{className:"univer-h-full",style:{width:`${100/l.length}%`,background:d}},p))});case t.CFRuleType.iconSet:return n&&c.jsx("div",{className:a,children:n.map((d,p)=>d?c.jsx("img",{className:"univer-h-full",src:d,draggable:!1},p):c.jsx(he,{},p))});case t.CFRuleType.highlightCell:{const{ul:d,st:p,it:h,bl:b,bg:S,cl:C}=e.style,N=(d==null?void 0:d.s)===i.BooleanNumber.TRUE,_=(p==null?void 0:p.s)===i.BooleanNumber.TRUE,E=h===i.BooleanNumber.TRUE,M=b===i.BooleanNumber.TRUE,R=(v=S==null?void 0:S.rgb)!=null?v:t.DEFAULT_BG_COLOR,g=(o=C==null?void 0:C.rgb)!=null?o:t.DEFAULT_FONT_COLOR,T={textDecoration:(f=`${N?"underline":""} ${_?"line-through":""}`.replace(/^ /,""))!=null?f:void 0,backgroundColor:R,color:g};return c.jsx("div",{className:O.clsx(a,{"univer-font-bold":M,"univer-italic":E}),style:T,children:"123"})}}},ge=O.clsx("univer-mt-5 univer-px-1 univer-py-2 univer-rounded",O.borderClassName),ne=(r,e)=>({label:e.t(`sheet.cf.valueType.${r}`),value:r}),Je=r=>{var S;const{type:e,className:l,onChange:n,id:a,value:u}=r,s=j.useDependency(i.IUniverInstanceService),v=s.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getUnitId(),o=(S=s.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:S.getSheetId(),f=m.useMemo(()=>String(u).startsWith("=")?String(u):"=",[u]),d=m.useMemo(()=>[t.CFValueType.max,t.CFValueType.min,"none"].includes(e)?{disabled:!0}:[t.CFValueType.percent,t.CFValueType.percentile].includes(e)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[e]),p=m.useRef(null),[h,b]=m.useState(!1);return j.useSidebarClick(C=>{var _;((_=p.current)==null?void 0:_.isClickOutSide(C))&&b(!1)}),e===t.CFValueType.formula?c.jsx("div",{className:"univer-ml-1 univer-w-full",children:c.jsx(pe.FormulaEditor,{ref:p,className:O.clsx("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors hover:univer-border-primary-600 dark:!univer-bg-gray-700 dark:!univer-text-white [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent",O.borderClassName),initValue:f,unitId:v,subUnitId:o,isFocus:h,onChange:(C="")=>{n(C||"")},onFocus:()=>b(!0)})}):c.jsx(O.InputNumber,{className:l,value:Number(r.value)||0,onChange:C=>r.onChange(C||0),...d})},Wr=r=>{var L;const{interceptorManager:e}=r,l=j.useDependency(i.LocaleService),n=((L=r.rule)==null?void 0:L.type)===t.CFRuleType.colorScale?r.rule:void 0,a=[ne(t.CFValueType.num,l),ne(t.CFValueType.percent,l),ne(t.CFValueType.percentile,l),ne(t.CFValueType.formula,l)],u=[ne(t.CFValueType.min,l),...a],s=[ne("none",l),...a],v=[ne(t.CFValueType.max,l),...a],[o,f]=m.useState(()=>{var x;const y=t.CFValueType.min;return n&&((x=n.config[0])==null?void 0:x.value.type)||y}),[d,p]=m.useState(()=>{var x;const y="none";return!n||n.config.length!==3?y:((x=n.config[1])==null?void 0:x.value.type)||y}),[h,b]=m.useState(()=>{var x;const y=t.CFValueType.max;return n&&((x=n.config[n.config.length-1])==null?void 0:x.value.type)||y}),[S,C]=m.useState(()=>{if(!n)return 10;const x=n.config[0];return(x==null?void 0:x.value.value)===void 0?10:x==null?void 0:x.value.value}),[N,_]=m.useState(()=>{var F;if(!n||n.config.length!==3)return 50;const x=(F=n.config[1])==null?void 0:F.value.value;return x===void 0?50:x}),[E,M]=m.useState(()=>{var F;if(!n)return 90;const x=(F=n.config[n.config.length-1])==null?void 0:F.value.value;return x===void 0?90:x}),[R,g]=m.useState(()=>{var x;const y="#d0d9fb";return n&&((x=n.config[0])==null?void 0:x.color)||y}),[T,w]=m.useState(()=>{var x;const y="#7790f3";return!n||n.config.length!==3?y:((x=n.config[1])==null?void 0:x.color)||y}),[I,k]=m.useState(()=>{var x;const y="#2e55ef";return n&&((x=n.config[n.config.length-1])==null?void 0:x.color)||y}),V=m.useMemo(()=>y=>{const{minType:x,medianType:F,maxType:G,minValue:Q,medianValue:ee,maxValue:de,minColor:ve,medianColor:A,maxColor:$}=y,B=[];return B.push({color:ve,value:{type:x,value:Q}}),F!=="none"&&B.push({color:A,value:{type:F,value:ee}}),B.push({color:$,value:{type:G,value:de}}),{config:B.map((Z,z)=>({...Z,index:z})),type:t.CFRuleType.colorScale}},[]);m.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return V({minType:o,medianType:d,maxType:h,minValue:S,medianValue:N,maxValue:E,minColor:R,medianColor:T,maxColor:I})}}),[V,o,d,h,S,N,E,R,T,I,e]);const P=y=>{r.onChange(V(y))};return c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:l.t("sheet.cf.panel.styleRule")}),c.jsx("div",{className:ge,children:c.jsx(ue,{rule:V({minType:o,medianType:d,maxType:h,minValue:S,medianValue:N,maxValue:E,minColor:R,medianColor:T,maxColor:I})})}),c.jsx("div",{className:"univer-mt-3 univer-text-xs univer-text-gray-600 dark:!univer-text-gray-200",children:l.t("sheet.cf.valueType.min")}),c.jsxs("div",{className:"univer-mt-3 univer-flex univer-h-8 univer-items-center",children:[c.jsx(O.Select,{className:"univer-flex-shrink-0",options:u,value:o,onChange:y=>{f(y);const x=t.createDefaultValueByValueType(y,10);C(x),P({minType:y,medianType:d,maxType:h,minValue:x,medianValue:N,maxValue:E,minColor:R,medianColor:T,maxColor:I})}}),c.jsx(Je,{id:"min",className:"univer-ml-1",value:S,type:o,onChange:y=>{C(y),P({minType:o,medianType:d,maxType:h,minValue:y,medianValue:N,maxValue:E,minColor:R,medianColor:T,maxColor:I})}}),c.jsx(te,{className:"univer-ml-1",color:R,onChange:y=>{g(y),P({minType:o,medianType:d,maxType:h,minValue:S,medianValue:N,maxValue:E,minColor:y,medianColor:T,maxColor:I})}})]}),c.jsx("div",{className:"univer-text-gray-600dark:!univer-text-gray-200 univer-mt-3 univer-text-xs",children:l.t("sheet.cf.panel.medianValue")}),c.jsxs("div",{className:"univer-mt-3 univer-flex univer-h-8 univer-items-center",children:[c.jsx(O.Select,{className:"univer-flex-shrink-0",options:s,value:d,onChange:y=>{p(y);const x=t.createDefaultValueByValueType(y,50);_(x),P({minType:o,medianType:y,maxType:h,minValue:S,medianValue:x,maxValue:E,minColor:R,medianColor:T,maxColor:I})}}),c.jsx(Je,{id:"median",className:"univer-ml-1",value:N,type:d,onChange:y=>{_(y),P({minType:o,medianType:d,maxType:h,minValue:S,medianValue:y,maxValue:E,minColor:R,medianColor:T,maxColor:I})}}),d!=="none"&&c.jsx(te,{className:"univer-ml-1",color:T,onChange:y=>{w(y),P({minType:o,medianType:d,maxType:h,minValue:S,medianValue:N,maxValue:E,minColor:R,medianColor:y,maxColor:I})}})]}),c.jsx("div",{className:"univer-mt-3 univer-text-xs univer-text-gray-600 dark:!univer-text-gray-200",children:l.t("sheet.cf.valueType.max")}),c.jsxs("div",{className:"univer-mt-3 univer-flex univer-h-8 univer-items-center",children:[c.jsx(O.Select,{className:"univer-flex-shrink-0",options:v,value:h,onChange:y=>{b(y);const x=t.createDefaultValueByValueType(y,90);M(x),P({minType:o,medianType:d,maxType:y,minValue:S,medianValue:N,maxValue:x,minColor:R,medianColor:T,maxColor:I})}}),c.jsx(Je,{id:"max",className:"univer-ml-1",value:E,type:h,onChange:y=>{M(y),P({minType:o,medianType:d,maxType:h,minValue:S,medianValue:N,maxValue:y,minColor:R,medianColor:T,maxColor:I})}}),c.jsx(te,{className:"univer-ml-1",color:I,onChange:y=>{k(y),P({minType:o,medianType:d,maxType:h,minValue:S,medianValue:N,maxValue:E,minColor:R,medianColor:T,maxColor:y})}})]})]})},ie=(r,e)=>({label:e.t(`sheet.cf.valueType.${r}`),value:r}),fr=r=>{var C;const{onChange:e,className:l,value:n,type:a,id:u,disabled:s=!1}=r,v=j.useDependency(i.IUniverInstanceService),o=v.getCurrentUnitOfType(i.UniverInstanceType.UNIVER_SHEET).getUnitId(),f=(C=v.getCurrentUnitOfType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:C.getSheetId(),d=m.useRef(null),[p,h]=m.useState(!1);j.useSidebarClick(N=>{var E;((E=d.current)==null?void 0:E.isClickOutSide(N))&&h(!1)});const b=m.useRef(n),S=m.useMemo(()=>[t.CFValueType.percentile,t.CFValueType.percent].includes(a)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[a]);if(a===t.CFValueType.formula){const N=String(b.current).startsWith("=")?String(b.current)||"":"=";return c.jsx("div",{className:"univer-ml-3 univer-w-full",children:c.jsx(pe.FormulaEditor,{ref:d,className:O.clsx("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors hover:univer-border-primary-600 dark:!univer-bg-gray-700 dark:!univer-text-white [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent",O.borderClassName),initValue:N,unitId:o,subUnitId:f,isFocus:p,onChange:(_="")=>{e(_||"")},onFocus:()=>h(!0)})})}return c.jsx(O.InputNumber,{className:l,value:Number(n)||0,disabled:s,onChange:N=>{e(N||0)},...S})},qr=r=>{var L;const{interceptorManager:e}=r,l=j.useDependency(i.LocaleService),n=((L=r.rule)==null?void 0:L.type)===t.CFRuleType.dataBar?r.rule:void 0,[a,u]=m.useState(()=>{var x;return n&&(x=n.config)!=null&&x.isGradient?"1":"0"}),[s,v]=m.useState(()=>{var y;return n&&((y=n.config)==null?void 0:y.positiveColor)||t.defaultDataBarPositiveColor}),[o,f]=m.useState(()=>{var y;return n&&((y=n.config)==null?void 0:y.nativeColor)||t.defaultDataBarNativeColor}),d=[ie(t.CFValueType.num,l),ie(t.CFValueType.percent,l),ie(t.CFValueType.percentile,l),ie(t.CFValueType.formula,l)],p=[ie(t.CFValueType.min,l),...d],h=[ie(t.CFValueType.max,l),...d],[b,S]=m.useState(()=>{var x;const y=p[0].value;return n&&((x=n.config)==null?void 0:x.min.type)||y}),[C,N]=m.useState(()=>{var x;const y=h[0].value;return n&&((x=n.config)==null?void 0:x.max.type)||y}),[_,E]=m.useState(()=>{var F;if(!n)return 0;const x=((F=n.config)==null?void 0:F.min)||{};return x.type===t.CFValueType.formula?x.value||"=":x.value||0}),[M,R]=m.useState(()=>{var F;if(!n)return 100;const x=((F=n.config)==null?void 0:F.max)||{};return x.type===t.CFValueType.formula?x.value||"=":x.value===void 0?100:x.value}),[g,T]=m.useState(()=>n?n.isShowValue===void 0?!0:!!n.isShowValue:!0),w=y=>({config:{min:{type:y.minValueType,value:y.minValue},max:{type:y.maxValueType,value:y.maxValue},isGradient:y.isGradient==="1",positiveColor:y.positiveColor||t.defaultDataBarPositiveColor,nativeColor:y.nativeColor||t.defaultDataBarNativeColor},type:t.CFRuleType.dataBar,isShowValue:y.isShowValue});m.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return w({isGradient:a,minValue:_,minValueType:b,maxValue:M,maxValueType:C,positiveColor:s,nativeColor:o,isShowValue:g})}}),[a,_,b,M,C,s,o,e,g]);const I=y=>{r.onChange(w(y))},k=y=>{v(y),I({isGradient:a,minValue:_,minValueType:b,maxValue:M,maxValueType:C,positiveColor:y,nativeColor:o,isShowValue:g})},V=y=>{f(y),I({isGradient:a,minValue:_,minValueType:b,maxValue:M,maxValueType:C,positiveColor:s,nativeColor:y,isShowValue:g})},P=y=>d.map(x=>x.value).includes(y);return c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:l.t("sheet.cf.panel.styleRule")}),c.jsx("div",{className:ge,children:c.jsx(ue,{rule:w({isGradient:a,minValue:_,minValueType:b,maxValue:M,maxValueType:C,positiveColor:s,nativeColor:o,isShowValue:g})})}),c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:l.t("sheet.cf.panel.fillType")}),c.jsxs("div",{className:"univer-ml-1 univer-mt-3 univer-flex univer-items-center",children:[c.jsxs(O.RadioGroup,{value:a,onChange:y=>{u(y),I({isGradient:y,minValue:_,minValueType:b,maxValue:M,maxValueType:C,positiveColor:s,nativeColor:o,isShowValue:g})},children:[c.jsx(O.Radio,{value:"0",children:c.jsx("span",{className:"univer-text-xs",children:l.t("sheet.cf.panel.pureColor")})}),c.jsx(O.Radio,{value:"1",children:c.jsx("span",{className:"univer-text-xs",children:l.t("sheet.cf.panel.gradient")})})]}),c.jsxs("div",{className:"univer-ml-6 univer-flex univer-items-center univer-text-xs",children:[c.jsx(O.Checkbox,{checked:!g,onChange:y=>{T(!y),I({isGradient:y,minValue:_,minValueType:b,maxValue:M,maxValueType:C,positiveColor:s,nativeColor:o,isShowValue:!y})}}),l.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:l.t("sheet.cf.panel.colorSet")}),c.jsxs("div",{className:"univer-ml-1 univer-mt-3 univer-flex univer-items-center",children:[c.jsxs("div",{className:"univer-flex univer-items-center",children:[c.jsx("div",{className:"univer-text-xs",children:l.t("sheet.cf.panel.native")}),c.jsx(te,{color:o,onChange:V})]}),c.jsxs("div",{className:"univer-ml-3 univer-flex univer-items-center",children:[c.jsx("div",{className:"univer-text-xs",children:l.t("sheet.cf.panel.positive")}),c.jsx(te,{color:s,onChange:k})]})]})]}),c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:l.t("sheet.cf.valueType.min")}),c.jsxs("div",{className:"univer-mt-3 univer-flex univer-items-center",children:[c.jsx(O.Select,{className:"univer-w-1/2 univer-flex-shrink-0",options:p,value:b,onChange:y=>{S(y);const x=t.createDefaultValueByValueType(y,10);E(x),I({isGradient:a,minValue:x,minValueType:y,maxValue:M,maxValueType:C,positiveColor:s,nativeColor:o,isShowValue:g})}}),c.jsx(fr,{id:"min",className:"univer-ml-3",disabled:!P(b),type:b,value:_,onChange:y=>{E(y||0),I({isGradient:a,minValue:y||0,minValueType:b,maxValue:M,maxValueType:C,positiveColor:s,nativeColor:o,isShowValue:g})}})]}),c.jsx("div",{className:"univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:l.t("sheet.cf.valueType.max")}),c.jsxs("div",{className:"univer-mt-3 univer-flex univer-items-center",children:[c.jsx(O.Select,{className:"univer-w-1/2 univer-flex-shrink-0",options:h,value:C,onChange:y=>{N(y);const x=t.createDefaultValueByValueType(y,90);R(x),I({isGradient:a,minValue:_,minValueType:b,maxValue:x,maxValueType:y,positiveColor:s,nativeColor:o,isShowValue:g})}}),c.jsx(fr,{className:"univer-ml-3",disabled:!P(C),id:"max",type:C,value:M,onChange:y=>{R(y||0),I({isGradient:a,minValue:_,minValueType:b,maxValue:y||0,maxValueType:C,positiveColor:s,nativeColor:o,isShowValue:g})}})]})]})]})},Re=r=>[i.BooleanNumber.FALSE,void 0].includes(r)?i.BooleanNumber.TRUE:i.BooleanNumber.FALSE,Me=r=>r!==i.BooleanNumber.FALSE,Qe=r=>{const{style:e,onChange:l,className:n}=r,[a,u]=m.useState(()=>{if(e!=null&&e.bl)return e.bl}),[s,v]=m.useState(()=>{if(e!=null&&e.it)return e.it}),[o,f]=m.useState(()=>{if(e!=null&&e.ul)return e.ul.s}),[d,p]=m.useState(()=>{if(e!=null&&e.st)return e.st.s}),[h,b]=m.useState(()=>{var E;const _="#2f56ef";return(E=e==null?void 0:e.cl)!=null&&E.rgb?e.cl.rgb:_}),[S,C]=m.useState(()=>{var E;const _="#e8ecfc";return(E=e==null?void 0:e.bg)!=null&&E.rgb?e.bg.rgb:_});m.useEffect(()=>{const _={bl:a,it:s};h!==void 0&&(_.cl={rgb:h}),S!==void 0&&(_.bg={rgb:S}),d!==void 0&&(_.st={s:d}),o!==void 0&&(_.ul={s:o}),l(t.removeUndefinedAttr(_))},[a,s,o,d,h,S]);const N="univer-flex univer-cursor-pointer univer-items-center univer-rounded univer-px-1";return c.jsxs("div",{className:O.clsx("univer-my-2.5 univer-flex univer-justify-between",n),children:[c.jsx("div",{className:O.clsx(N,{"univer-bg-gray-100 dark:!univer-bg-gray-700":Me(a||i.BooleanNumber.FALSE)}),onClick:()=>u(Re(a)),children:c.jsx(ur,{})}),c.jsx("div",{className:O.clsx(N,{"univer-bg-gray-100 dark:!univer-bg-gray-700":Me(s||i.BooleanNumber.FALSE)}),onClick:()=>v(Re(s)),children:c.jsx(cr,{})}),c.jsx("div",{className:O.clsx(N,{"univer-bg-gray-100 dark:!univer-bg-gray-700":Me(o||i.BooleanNumber.FALSE)}),onClick:()=>f(Re(o)),children:c.jsx(pr,{})}),c.jsx("div",{className:O.clsx(N,{"univer-bg-gray-100 dark:!univer-bg-gray-700":Me(d||i.BooleanNumber.FALSE)}),onClick:()=>p(Re(d)),children:c.jsx(vr,{})}),c.jsx(te,{color:h,onChange:b,Icon:ir}),c.jsx(te,{color:S,onChange:C})]})},Gr=r=>{var R;const{onChange:e,interceptorManager:l}=r,n=j.useDependency(i.LocaleService),u=j.useDependency(i.IUniverInstanceService).getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET),s=u.getActiveSheet(),v=((R=r.rule)==null?void 0:R.type)===t.CFRuleType.highlightCell?r.rule:void 0,o=m.useRef(null),[f,d]=m.useState(!1),p=m.useRef(null),[h,b]=m.useState({}),[S,C]=m.useState(()=>(v==null?void 0:v.subType)===t.CFSubRuleType.formula?v.value:"="),[N,_]=m.useState(void 0),E=g=>({style:g.style,value:S,type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.formula});m.useEffect(()=>l.intercept(l.getInterceptPoints().submit,{handler(){return E({style:h})}}),[h,S,l]),m.useEffect(()=>l.intercept(l.getInterceptPoints().beforeSubmit,{handler:(T,w,I)=>N||S.length===1||!S.startsWith("=")?(_(n.t("sheet.cf.errorMessage.formulaError")),!1):I(T)}),[N,S]);const M=g=>{e(E(g))};return j.useSidebarClick(g=>{var w;((w=p.current)==null?void 0:w.isClickOutSide(g))&&d(!1)}),c.jsxs("div",{ref:o,children:[c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:n.t("sheet.cf.panel.styleRule")}),c.jsx("div",{className:"univer-mt-3",children:c.jsx(pe.FormulaEditor,{ref:p,className:O.clsx("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors hover:univer-border-primary-600 dark:!univer-bg-gray-700 dark:!univer-text-white [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent",O.borderClassName),errorText:N,isFocus:f,initValue:S,unitId:u.getUnitId(),subUnitId:s==null?void 0:s.getSheetId(),onFocus:()=>{d(!0)},onChange:g=>{C(g),M({style:h})},onVerify:(g,T)=>{!g||T.length===1?_(n.t("sheet.cf.errorMessage.formulaError")):_(void 0)}})}),c.jsx("div",{className:ge,children:c.jsx(ue,{rule:E({style:h})})}),c.jsx(Qe,{style:v==null?void 0:v.style,className:"univer-mt-3",onChange:g=>{b(g),M({style:g})}})]})},Ve=r=>c.jsxs("div",{className:"univer-relative",children:[c.jsx("div",{className:"univer-absolute univer-bottom-[-13px] univer-z-[999] univer-text-[10px] univer-text-red-500",children:r.errorText}),r.children]}),H=(r,e)=>({label:e.t(`sheet.cf.operator.${r}`),value:r}),Zr=r=>{const{type:e,operator:l,onChange:n,value:a,interceptorManager:u}=r,s=j.useDependency(i.LocaleService),[v,o]=m.useState(()=>typeof a=="number"?a:0),[f,d]=m.useState(""),[p,h]=m.useState(()=>typeof a=="string"?a:""),[b,S]=m.useState(""),[C,N]=m.useState(()=>Array.isArray(a)?a[0]===void 0?0:a[0]:0),[_,E]=m.useState(""),[M,R]=m.useState(()=>Array.isArray(a)?a[1]===void 0?100:a[1]:100),[g,T]=m.useState("");switch(m.useEffect(()=>{switch(e){case t.CFSubRuleType.text:{[t.CFTextOperator.beginsWith,t.CFTextOperator.endsWith,t.CFTextOperator.containsText,t.CFTextOperator.notContainsText,t.CFTextOperator.equal,t.CFTextOperator.notEqual].includes(l)&&n(p);break}case t.CFSubRuleType.number:{[t.CFNumberOperator.equal,t.CFNumberOperator.notEqual,t.CFNumberOperator.greaterThan,t.CFNumberOperator.greaterThanOrEqual,t.CFNumberOperator.lessThan,t.CFNumberOperator.lessThanOrEqual].includes(l)&&n(v),[t.CFNumberOperator.between,t.CFNumberOperator.notBetween].includes(l)&&n([C,M]);break}}},[e]),m.useEffect(()=>{const w=u.intercept(u.getInterceptPoints().beforeSubmit,{handler:(I,k,V)=>{switch(e){case t.CFSubRuleType.text:if([t.CFTextOperator.beginsWith,t.CFTextOperator.containsText,t.CFTextOperator.endsWith,t.CFTextOperator.notEqual,t.CFTextOperator.notContainsText,t.CFTextOperator.equal].includes(l))return p?V(I):(S(s.t("sheet.cf.errorMessage.notBlank")),!1)}return V(I)}});return()=>{w()}},[e,v,p,l]),e){case t.CFSubRuleType.text:{if([t.CFTextOperator.beginsWith,t.CFTextOperator.endsWith,t.CFTextOperator.containsText,t.CFTextOperator.notContainsText,t.CFTextOperator.equal,t.CFTextOperator.notEqual].includes(l)){const w=I=>{h(I),n(I)};return c.jsx("div",{className:"univer-mt-3",children:c.jsx(Ve,{errorText:b,children:c.jsx(O.Input,{value:p,onChange:I=>{S(""),w(I)}})})})}break}case t.CFSubRuleType.number:{if([t.CFNumberOperator.equal,t.CFNumberOperator.notEqual,t.CFNumberOperator.greaterThan,t.CFNumberOperator.greaterThanOrEqual,t.CFNumberOperator.lessThan,t.CFNumberOperator.lessThanOrEqual].includes(l)){const w=I=>{o(I||0),n(I||0),d("")};return c.jsx("div",{className:"univer-mt-3",children:c.jsx(Ve,{errorText:f,children:c.jsx(O.InputNumber,{className:"univer-w-full",min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:v,onChange:w})})})}if([t.CFNumberOperator.between,t.CFNumberOperator.notBetween].includes(l)){const w=k=>{N(k||0),n([k||0,M]),E("")},I=k=>{R(k||0),n([C,k||0]),T("")};return c.jsxs("div",{className:"univer-mt-3 univer-flex univer-items-center",children:[c.jsx(Ve,{errorText:_,children:c.jsx(O.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:C,onChange:w})}),c.jsx(Ve,{errorText:g,children:c.jsx(O.InputNumber,{className:"univer-ml-3",min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:M,onChange:I})})]})}}}return null},hr=(r,e)=>{switch(r){case t.CFSubRuleType.text:return[H(t.CFTextOperator.containsText,e),H(t.CFTextOperator.notContainsText,e),H(t.CFTextOperator.beginsWith,e),H(t.CFTextOperator.endsWith,e),H(t.CFTextOperator.equal,e),H(t.CFTextOperator.notEqual,e),H(t.CFTextOperator.containsBlanks,e),H(t.CFTextOperator.notContainsBlanks,e),H(t.CFTextOperator.containsErrors,e),H(t.CFTextOperator.notContainsErrors,e)];case t.CFSubRuleType.number:return[H(t.CFNumberOperator.between,e),H(t.CFNumberOperator.notBetween,e),H(t.CFNumberOperator.equal,e),H(t.CFNumberOperator.notEqual,e),H(t.CFNumberOperator.greaterThan,e),H(t.CFNumberOperator.greaterThanOrEqual,e),H(t.CFNumberOperator.lessThan,e),H(t.CFNumberOperator.lessThanOrEqual,e)];case t.CFSubRuleType.timePeriod:return[H(t.CFTimePeriodOperator.yesterday,e),H(t.CFTimePeriodOperator.today,e),H(t.CFTimePeriodOperator.tomorrow,e),H(t.CFTimePeriodOperator.last7Days,e),H(t.CFTimePeriodOperator.lastWeek,e),H(t.CFTimePeriodOperator.thisWeek,e),H(t.CFTimePeriodOperator.nextWeek,e),H(t.CFTimePeriodOperator.lastMonth,e),H(t.CFTimePeriodOperator.thisMonth,e),H(t.CFTimePeriodOperator.nextMonth,e)]}},gr=r=>{var R;const{interceptorManager:e,onChange:l}=r,n=j.useDependency(i.LocaleService),a=((R=r.rule)==null?void 0:R.type)===t.CFRuleType.highlightCell?r.rule:void 0,[u,s]=m.useState(()=>{const g=t.CFSubRuleType.text;return a&&a.subType||g}),v=[{value:t.CFSubRuleType.text,label:n.t("sheet.cf.subRuleType.text")},{value:t.CFSubRuleType.number,label:n.t("sheet.cf.subRuleType.number")},{value:t.CFSubRuleType.timePeriod,label:n.t("sheet.cf.subRuleType.timePeriod")},{value:t.CFSubRuleType.duplicateValues,label:n.t("sheet.cf.subRuleType.duplicateValues")},{value:t.CFSubRuleType.uniqueValues,label:n.t("sheet.cf.subRuleType.uniqueValues")}],o=m.useMemo(()=>hr(u,n),[u]),[f,d]=m.useState(()=>{const g=o?o[0].value:void 0;return a&&a.operator||g}),[p,h]=m.useState(()=>{var w;return a?(w=a.value)!=null?w:t.createDefaultValue(a.subType,a.operator):""}),[b,S]=m.useState({}),C=m.useMemo(()=>g=>{var T,w,I,k,V,P,L,y,x,F,G,Q,ee,de,ve;switch(g.subType||u){case t.CFSubRuleType.text:{if([t.CFTextOperator.beginsWith,t.CFTextOperator.endsWith,t.CFTextOperator.containsText,t.CFTextOperator.notContainsText,t.CFTextOperator.equal,t.CFTextOperator.notEqual].includes(f))return{type:t.CFRuleType.highlightCell,subType:(T=g.subType)!=null?T:u,operator:(w=g.operator)!=null?w:f,style:(I=g.style)!=null?I:b,value:(k=g.value)!=null?k:p};break}case t.CFSubRuleType.number:{if([t.CFNumberOperator.equal,t.CFNumberOperator.notEqual,t.CFNumberOperator.greaterThan,t.CFNumberOperator.greaterThanOrEqual,t.CFNumberOperator.lessThan,t.CFNumberOperator.lessThanOrEqual].includes(f))return{type:t.CFRuleType.highlightCell,subType:(V=g.subType)!=null?V:u,operator:(P=g.operator)!=null?P:f,style:(L=g.style)!=null?L:b,value:(y=g.value)!=null?y:p};if([t.CFNumberOperator.between,t.CFNumberOperator.notBetween].includes(f))return{type:t.CFRuleType.highlightCell,subType:(x=g.subType)!=null?x:u,operator:(F=g.operator)!=null?F:f,style:(G=g.style)!=null?G:b,value:(Q=g.value)!=null?Q:p};break}}return{type:t.CFRuleType.highlightCell,subType:(ee=g.subType)!=null?ee:u,operator:(de=g.operator)!=null?de:f,style:(ve=g.style)!=null?ve:b}},[u,f,p,b]);m.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return C({})}}),[C,e]),m.useEffect(()=>{v.some(g=>g.value===u)||s(v[0].value)},[v]);const N=g=>{const T=g,w=hr(T,n),I=w&&w[0].value;s(T),d(I),I&&h(t.createDefaultValue(T,I)),l(C({subType:T,operator:I}))},_=g=>{const T=g;d(T),l(C({operator:T}))},E=g=>{h(g),l(C({value:g}))},M=m.useMemo(()=>`${u}_${f}_${Math.random()}`,[u,f]);return c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:n.t("sheet.cf.panel.styleRule")}),c.jsxs("div",{className:"univer-flex univer-justify-between univer-gap-4",children:[c.jsx(O.Select,{className:"univer-mt-3 univer-w-full",onChange:N,value:u,options:v}),(o==null?void 0:o.length)&&c.jsx(O.Select,{className:"univer-mt-3 univer-w-full",onChange:_,value:f||"",options:o})]}),c.jsx(Zr,{value:p,interceptorManager:e,type:u,operator:f,rule:a,onChange:E},M),c.jsx("div",{className:ge,children:c.jsx(ue,{rule:C({})})}),c.jsx(Qe,{style:a==null?void 0:a.style,className:"univer-ml-1",onChange:g=>{S(g),l(C({style:g}))}})]})},yr=(r,e)=>(t.iconMap[r]||[])[Number(e)]||"",zr=r=>{var d;const{error:e,type:l,onChange:n}=r,a=j.useDependency(i.IUniverInstanceService),u=a.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getUnitId(),s=(d=a.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:d.getSheetId(),v=m.useRef(null),[o,f]=m.useState(!1);return j.useSidebarClick(p=>{var b;((b=v.current)==null?void 0:b.isClickOutSide(p))&&f(!1)}),c.jsx("div",{className:"univer-relative",children:l!==t.CFValueType.formula?c.jsxs(c.Fragment,{children:[c.jsx(O.InputNumber,{className:O.clsx({"univer-border-red-500":e}),value:Number(r.value)||0,onChange:p=>n(p!=null?p:0)}),e&&c.jsx("div",{className:"univer-absolute univer-text-xs univer-text-red-500",children:e})]}):c.jsx("div",{className:"univer-w-full",children:c.jsx(pe.FormulaEditor,{ref:v,className:O.clsx("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors hover:univer-border-primary-600 dark:!univer-bg-gray-700 dark:!univer-text-white [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent",O.borderClassName),initValue:String(r.value),unitId:u,subUnitId:s,isFocus:o,onChange:(p="")=>{n(p||"")},onFocus:()=>f(!0)})})})},mr=(r,e,l)=>({operator:t.CFNumberOperator.greaterThan,value:{type:t.CFValueType.num,value:(l.length-1-e)*10},iconType:r,iconId:String(e)}),Yr=m.forwardRef((r,e)=>{const{onClick:l}=r,n=j.useDependency(i.LocaleService),a=u=>{l(u)};return c.jsx("div",{ref:e,className:"univer-w-80",children:t.iconGroup.map((u,s)=>c.jsxs("div",{className:"univer-mb-3",children:[c.jsx("div",{className:"univer-mb-1 univer-text-sm",children:n.t(u.title)}),c.jsx("div",{className:"univer-flex univer-flex-wrap",children:u.group.map(v=>c.jsx("div",{className:"univer-mb-1 univer-flex univer-w-1/2 univer-items-center",onClick:()=>{a(v.name)},children:c.jsx("a",{className:"univer-cursor-pointer univer-rounded hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",children:v.list.map((o,f)=>c.jsx("img",{className:"univer-size-5",src:o,draggable:!1},f))})},v.name))})]},s))})}),Kr=r=>{const{onClick:e}=r,l=m.useMemo(()=>{const a=[];for(const u in t.iconMap){const s=t.iconMap[u],v=u;s.forEach((o,f)=>{a.push({iconType:v,base64:o,iconId:String(f)})})}return a},[]),n=a=>{e(a.iconType,a.iconId)};return c.jsxs("div",{children:[c.jsxs("div",{className:"univer-mb-2.5 univer-flex univer-cursor-pointer univer-items-center univer-pl-1",onClick:()=>n({iconType:t.EMPTY_ICON_TYPE,iconId:""}),children:[c.jsx(he,{className:"univer-size-5"}),c.jsx("span",{className:"univer-ml-2",children:"无单元格图标"})]}),c.jsx("div",{className:"univer-flex univer-w-64 univer-flex-wrap",children:l.map(a=>c.jsx("div",{className:"univer-mb-2 univer-mr-2 univer-flex univer-cursor-pointer univer-items-center univer-justify-center univer-rounded hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",children:c.jsx("img",{className:"univer-size-5",src:a.base64,draggable:!1,onClick:()=>n(a)})},`${a.iconType}_${a.iconId}`))})]})},Xr=r=>{const{onChange:e,configList:l,errorMap:n={}}=r,a=j.useDependency(i.LocaleService),u=[{label:a.t(`sheet.cf.symbol.${t.CFNumberOperator.greaterThan}`),value:t.CFNumberOperator.greaterThan},{label:a.t(`sheet.cf.symbol.${t.CFNumberOperator.greaterThanOrEqual}`),value:t.CFNumberOperator.greaterThanOrEqual}],s=[{label:a.t(`sheet.cf.valueType.${t.CFValueType.num}`),value:t.CFValueType.num},{label:a.t(`sheet.cf.valueType.${t.CFValueType.percent}`),value:t.CFValueType.percent},{label:a.t(`sheet.cf.valueType.${t.CFValueType.percentile}`),value:t.CFValueType.percentile},{label:a.t(`sheet.cf.valueType.${t.CFValueType.formula}`),value:t.CFValueType.formula}],v=(p,h)=>{e([String(h),"value","value"],p)},o=(p,h)=>{e([String(h),"operator"],p);const b=t.createDefaultValue(t.CFSubRuleType.number,p);v(b,h)},f=(p,h)=>{e([String(h),"value","type"],p);const b=l[h],S=t.createDefaultValue(t.CFSubRuleType.number,b.operator);v(S,h)};return m.useMemo(()=>l.map((p,h)=>{const b=n[h],S=yr(p.iconType,p.iconId),C=h===l.length-1,N=h===0,_=l[h-1],E=(_==null?void 0:_.value.type)===t.CFValueType.formula?a.t("sheet.cf.valueType.formula"):_==null?void 0:_.value.value,M=(R,g)=>{const T={...p,iconId:g,iconType:R};e([String(h)],T)};return c.jsxs("div",{className:h?"univer-mt-6":"univer-mt-3",children:[c.jsxs("div",{className:"univer-mt-3 univer-flex univer-items-center univer-justify-between univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:[c.jsxs("div",{className:"univer-w-[45%]",children:[a.t("sheet.cf.iconSet.icon"),h+1]}),c.jsx("div",{className:"univer-w-[45%]",children:c.jsxs(c.Fragment,{children:[!N&&!C&&a.t("sheet.cf.iconSet.rule"),!N&&!C&&c.jsxs("span",{className:"univer-font-medium univer-text-gray-600 dark:!univer-text-gray-200",children:[a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${t.getOppositeOperator(_.operator)}`),E,C?"":` ${a.t("sheet.cf.iconSet.and")} `]})]})})]}),c.jsxs("div",{className:"univer-mt-3 univer-grid univer-grid-cols-2 univer-gap-4",children:[c.jsx("div",{className:"univer-flex univer-items-center",children:c.jsx(O.Dropdown,{overlay:c.jsx("div",{className:"univer-rounded-lg univer-p-4",children:c.jsx(Kr,{onClick:M,iconId:p.iconId,iconType:p.iconType})}),children:c.jsxs("div",{className:O.clsx("univer-box-border univer-flex univer-h-8 univer-w-full univer-items-center univer-justify-between univer-rounded-md univer-bg-white univer-px-4 univer-py-2 univer-text-xs univer-text-gray-600 univer-transition-all hover:univer-border-primary-600 dark:!univer-text-gray-200",O.borderClassName),children:[S?c.jsx("img",{src:S,className:"univer-size-4",draggable:!1}):c.jsx(he,{className:"univer-size-4"}),c.jsx(Xe,{})]})})}),C?c.jsxs("div",{className:"univer-mt-0 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:[a.t("sheet.cf.iconSet.rule"),c.jsxs("span",{className:"univer-font-medium",children:[a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${t.getOppositeOperator(_.operator)}`),E,C?"":` ${a.t("sheet.cf.iconSet.and")} `]})]}):c.jsx(O.Select,{options:u,value:p.operator,onChange:R=>{o(R,h)}})]}),C?c.jsx("div",{}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"univer-mt-3 univer-grid univer-grid-cols-2 univer-gap-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:[c.jsx("div",{children:a.t("sheet.cf.iconSet.type")}),c.jsx("div",{children:a.t("sheet.cf.iconSet.value")})]}),c.jsxs("div",{className:"univer-mt-3 univer-grid univer-grid-cols-2 univer-gap-4",children:[c.jsx(O.Select,{options:s,value:p.value.type,onChange:R=>{f(R,h)}}),c.jsx(zr,{id:h,type:p.value.type,error:b,value:p.value.value||"",onChange:R=>{v(R,h)}})]})]})]},h)}),[l,n])},Jr=r=>{var R;const{interceptorManager:e}=r,l=((R=r.rule)==null?void 0:R.type)===t.CFRuleType.iconSet?r.rule:void 0,n=j.useDependency(i.LocaleService),[a,u]=m.useState({}),[s,v]=m.useState(()=>{const g=Object.keys(t.iconMap)[0];if(l&&l.config.length){const T=l.config[0].iconType;if(!l.config.some(I=>I.iconType!==T))return T}return g}),[o,f]=m.useState(()=>{if(l&&l.config.length)return i.Tools.deepClone(l==null?void 0:l.config);const g=t.iconMap[s]||[];return new Array(g.length).fill("").map((T,w,I)=>w===I.length-1?{operator:t.CFNumberOperator.lessThanOrEqual,value:{type:t.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:s,iconId:String(w)}:mr(s,w,I))}),[d,p]=m.useState(()=>l?!!l.isShowValue:!0),h=m.useMemo(()=>{const g=o.map(T=>yr(T.iconType,T.iconId));return c.jsx("div",{className:"univer-flex univer-items-center",children:g.map((T,w)=>T?c.jsx("img",{className:"univer-size-5",src:T},w):c.jsx(he,{className:"univer-size-5"},w))})},[o]),b=g=>{if(g.reduce((w,I,k)=>w.preType&&!w.result||g.length-1===k?w:I.value.type===t.CFValueType.formula?{preType:t.CFValueType.formula,result:!1}:w.preType?{result:w.preType===I.value.type,preType:I.value.type}:{result:!0,preType:I.value.type},{result:!0,preType:""}).result&&[t.CFValueType.num,t.CFValueType.percent,t.CFValueType.percentile].includes(g[0].value.type)){const w={};return g.forEach((I,k,V)=>{if(k-1<0||k===V.length-1)return;const L=g[k-1],y=t.getOppositeOperator(L.operator);t.compareWithNumber({operator:y,value:L.value.value},I.value.value)||(w[k]=`${n.t(`sheet.cf.form.${y}`,String(L.value.value))} `)}),w}return{}},S=(g,T)=>{i.get(o,g)!==T&&(i.set(o,g,T),f([...o]),u(b(o)))},C=g=>{v(g);const T=t.iconMap[g]||[],w=new Array(T.length).fill("").map((I,k,V)=>mr(g,k,V));f(w),u(b(w))};m.useEffect(()=>{const g=e.intercept(e.getInterceptPoints().submit,{handler(){return{type:t.CFRuleType.iconSet,isShowValue:d,config:o}}});return()=>{g()}},[d,o,e]),m.useEffect(()=>{const g=e.intercept(e.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(a).length===0}});return()=>{g()}},[d,o,e,a]);const N=()=>{const g=o.map(T=>({...T}));o.forEach((T,w)=>{const I=o.length-1-w,k=g[I];T.iconId=k.iconId,T.iconType=k.iconType}),f([...o])},_=j.useDependency(j.ILayoutService),[E,M]=m.useState();return j.useScrollYOverContainer(E,_.rootContainerElement),c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-600",children:n.t("sheet.cf.panel.styleRule")}),c.jsx("div",{className:"univer-mt-3",children:c.jsx(O.Dropdown,{overlay:c.jsx("div",{className:"univer-rounded-lg univer-p-4",children:c.jsx(Yr,{ref:g=>{!E&&g&&M(g)},iconType:s,onClick:C})}),children:c.jsxs("div",{className:O.clsx("univer-box-border univer-flex univer-h-8 univer-w-full univer-items-center univer-justify-between univer-rounded-md univer-bg-white univer-px-4 univer-py-2 univer-text-xs univer-text-gray-600 univer-transition-all hover:univer-border-primary-600",O.borderClassName),children:[h,c.jsx(Xe,{})]})})}),c.jsxs("div",{className:"univer-mt-3 univer-flex univer-items-center univer-text-xs",children:[c.jsxs("div",{className:"univer-flex univer-items-center univer-text-xs",children:[c.jsx(O.Checkbox,{onChange:N}),n.t("sheet.cf.iconSet.reverseIconOrder")]}),c.jsxs("div",{className:"univer-ml-6 univer-flex univer-items-center univer-text-xs",children:[c.jsx(O.Checkbox,{checked:!d,onChange:g=>{p(!g)}}),n.t("sheet.cf.iconSet.onlyShowIcon")]})]}),c.jsx(Xr,{errorMap:a,onChange:S,configList:o})]})},Qr=r=>{var N;const{onChange:e,interceptorManager:l}=r,n=j.useDependency(i.LocaleService),a=((N=r.rule)==null?void 0:N.type)===t.CFRuleType.highlightCell?r.rule:void 0,u=[{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"}],[s,v]=m.useState(()=>{const _=u[0].value,E=a==null?void 0:a.type;if(!a)return _;switch(E){case t.CFRuleType.highlightCell:switch(a.subType){case t.CFSubRuleType.average:return[t.CFNumberOperator.greaterThan,t.CFNumberOperator.greaterThanOrEqual].includes(a.operator)?"greaterThanAverage":[t.CFNumberOperator.lessThan,t.CFNumberOperator.lessThanOrEqual].includes(a.operator)?"lessThanAverage":_;case t.CFSubRuleType.rank:return a.isBottom?"isBottom":"isNotBottom"}}return _}),[o,f]=m.useState(()=>{const E=a==null?void 0:a.type;if(!a)return 10;switch(E){case t.CFRuleType.highlightCell:switch(a.subType){case t.CFSubRuleType.rank:return a.value||10}}return 10}),[d,p]=m.useState(()=>{const E=a==null?void 0:a.type;if(!a)return!1;switch(E){case t.CFRuleType.highlightCell:switch(a.subType){case t.CFSubRuleType.rank:return a.isPercent||!1}}return!1}),[h,b]=m.useState({}),S=_=>{const{type:E,isPercent:M,value:R,style:g}=_;if(E==="isNotBottom")return{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.rank,isPercent:M,isBottom:!1,value:R,style:g};if(E==="isBottom")return{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.rank,isPercent:M,isBottom:!0,value:R,style:g};if(E==="greaterThanAverage")return{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.average,operator:t.CFNumberOperator.greaterThan,style:g};if(E==="lessThanAverage")return{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.average,operator:t.CFNumberOperator.lessThan,style:g}};m.useEffect(()=>l.intercept(l.getInterceptPoints().submit,{handler(){return S({type:s,isPercent:d,value:o,style:h})}}),[s,d,o,h,l]);const C=_=>{e(S(_))};return c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:n.t("sheet.cf.panel.styleRule")}),c.jsx(O.Select,{className:"univer-mt-3 univer-w-full",value:s,options:u,onChange:_=>{v(_),C({type:_,isPercent:d,value:o,style:h})}}),["isNotBottom","isBottom"].includes(s)&&c.jsxs("div",{className:"univer-mt-3 univer-flex univer-items-center",children:[c.jsx(O.InputNumber,{min:1,max:1e3,value:o,onChange:_=>{const E=_||0;f(E),C({type:s,isPercent:d,value:E,style:h})}}),c.jsxs("div",{className:"univer-ml-3 univer-flex univer-items-center univer-text-xs",children:[c.jsx(O.Checkbox,{checked:d,onChange:_=>{p(!!_),C({type:s,isPercent:!!_,value:o,style:h})}}),n.t("sheet.cf.valueType.percent")]})]}),c.jsx("div",{className:ge,children:c.jsx(ue,{rule:S({type:s,isPercent:d,value:o,style:h})})}),c.jsx(Qe,{style:a==null?void 0:a.style,className:"univer-mt-3",onChange:_=>{b(_),C({type:s,isPercent:d,value:o,style:_})}})]})},et=i.createInterceptorKey("beforeSubmit"),rt=i.createInterceptorKey("submit"),Cr=r=>r.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getUnitId(),br=r=>{var e;return(e=r.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()},tt=r=>{var w,I,k;const e=j.useDependency(i.LocaleService),l=j.useDependency(i.ICommandService),n=j.useDependency(i.IUniverInstanceService),a=j.useDependency(t.ConditionalFormattingRuleModel),u=j.useDependency(U.SheetsSelectionsService),s=Cr(n),v=br(n),[o,f]=m.useState(void 0),d=m.useRef((I=(w=r.rule)==null?void 0:w.ranges)!=null?I:[]),p=m.useMemo(()=>{var P,L,y;let V=(P=r.rule)==null?void 0:P.ranges;return V!=null&&V.length||(V=(y=(L=u.getCurrentSelections())==null?void 0:L.map(x=>x.range))!=null?y:[]),d.current=V,V!=null&&V.length?V.map(x=>{const F=$e.serializeRange(x);return F==="NaN"?"":F}).filter(x=>!!x).join(","):""},[r.rule]),h=[{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"}],[b,S]=m.useState(()=>{var L,y;const V=(L=r.rule)==null?void 0:L.rule.type,P=h[0].value;if(!V)return P;switch(V){case t.CFRuleType.highlightCell:{switch((y=r.rule)==null?void 0:y.rule.subType){case t.CFSubRuleType.number:case t.CFSubRuleType.text:case t.CFSubRuleType.duplicateValues:case t.CFSubRuleType.uniqueValues:case t.CFSubRuleType.timePeriod:return"1";case t.CFSubRuleType.average:case t.CFSubRuleType.rank:return"2";case t.CFSubRuleType.formula:return"5"}break}case t.CFRuleType.dataBar:return"3";case t.CFRuleType.colorScale:return"4";case t.CFRuleType.iconSet:return"6"}return P}),C=m.useRef(void 0),N=m.useMemo(()=>new i.InterceptorManager({beforeSubmit:et,submit:rt}),[]),_=m.useMemo(()=>{switch(b){case"1":return gr;case"2":return Qr;case"3":return qr;case"4":return Wr;case"5":return Gr;case"6":return Jr;default:return gr}},[b]);m.useEffect(()=>{const V=l.onCommandExecuted(P=>{if(P.id===U.RemoveSheetMutation.id){const L=P.params;L.subUnitId===v&&L.unitId===s&&r.onCancel()}P.id===U.SetWorksheetActiveOperation.id&&r.onCancel()});return()=>V.dispose()},[]);const E=V=>{C.current=V},M=V=>{const P=V.split(",").filter(L=>!!L).map($e.deserializeRangeWithSheet).map(L=>L.range);d.current=P},R=()=>{if(o)return;const P=(()=>{const y=n.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!y)throw new Error("No active sheet found");return d.current.map(G=>U.setEndForRange(G,y.getRowCount(),y.getColumnCount())).filter(G=>!(Number.isNaN(G.startRow)||Number.isNaN(G.startColumn)))})();if(N.fetchThroughInterceptors(N.getInterceptPoints().beforeSubmit)(!0,null)){const y=N.fetchThroughInterceptors(N.getInterceptPoints().submit)(null,null);if(y){const x=Cr(n),F=br(n);if(!x||!F)throw new Error("No active sheet found");let G={};r.rule&&r.rule.cfId?(G={...r.rule,ranges:P,rule:y},l.executeCommand(t.SetCfCommand.id,{unitId:x,subUnitId:F,rule:G}),r.onCancel()):(G={cfId:a.createCfId(x,F),ranges:P,rule:y,stopIfTrue:!1},l.executeCommand(t.AddCfCommand.id,{unitId:x,subUnitId:F,rule:G}),r.onCancel())}}},g=()=>{r.onCancel()},T=(V,P)=>{V?P.length<1?f(e.t("sheet.cf.errorMessage.rangeError")):f(void 0):f(e.t("sheet.cf.errorMessage.rangeError"))};return c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:e.t("sheet.cf.panel.range")}),c.jsxs("div",{className:"univer-mt-4",children:[c.jsx(pe.RangeSelector,{unitId:s,subUnitId:v,initialValue:p,onChange:(V,P)=>M(P),onVerify:T}),o&&c.jsx("div",{className:"univer-mt-1 univer-text-xs univer-text-red-500",children:o})]}),c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:e.t("sheet.cf.panel.styleType")}),c.jsx(O.Select,{className:"univer-mt-4 univer-w-full",value:b,options:h,onChange:V=>S(V)}),c.jsx(_,{interceptorManager:N,rule:(k=r.rule)==null?void 0:k.rule,onChange:E}),c.jsxs("div",{className:"univer-mt-4 univer-flex univer-justify-end",children:[c.jsx(O.Button,{onClick:g,children:e.t("sheet.cf.panel.cancel")}),c.jsx(O.Button,{className:"univer-ml-3",variant:"primary",onClick:R,children:e.t("sheet.cf.panel.submit")})]})]})};var nt=Object.getOwnPropertyDescriptor,at=(r,e,l,n)=>{for(var a=n>1?void 0:n?nt(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},lt=(r,e)=>(l,n)=>e(l,n,r);let se=class extends i.Disposable{constructor(e){super();re(this,"_initLocal",()=>{});re(this,"_findReplaceIndex",e=>{const l=/\{([^}]+)?\}/g,n=[];let a=l.exec(e);for(;a;)n.push({startIndex:a.index,key:Number(a[1]),endIndex:a.index+a[0].length-1}),a=l.exec(e);return n});this._localeService=e,this._initLocal()}tWithReactNode(e,...l){const n=this._localeService.getLocales(),a=e.split("."),u=n&&this._localeService.resolveKeyPath(n,a);if(typeof u=="string"){const s=[];return this._findReplaceIndex(u).forEach((v,o,f)=>{const d=f[o-1]||{endIndex:-1};if(d.endIndex+1<v.startIndex){const p=u.slice(d.endIndex+1,v.startIndex);p&&s.push(p)}if(l[v.key]&&s.push(l[v.key]),o===f.length-1){const p=u.slice(v.endIndex+1);p&&s.push(p)}}),s}return[]}};se=at([lt(0,i.Inject(i.LocaleService))],se);const ut=(r,e)=>{const l=r.rule;switch(l.type){case t.CFRuleType.colorScale:return e.t("sheet.cf.ruleType.colorScale");case t.CFRuleType.dataBar:return e.t("sheet.cf.ruleType.dataBar");case t.CFRuleType.iconSet:return e.t("sheet.cf.ruleType.iconSet");case t.CFRuleType.highlightCell:switch(l.subType){case t.CFSubRuleType.average:{const n=l.operator;return e.t(`sheet.cf.preview.describe.${n}`,e.t("sheet.cf.subRuleType.average"))}case t.CFSubRuleType.duplicateValues:return e.t("sheet.cf.subRuleType.duplicateValues");case t.CFSubRuleType.uniqueValues:return e.t("sheet.cf.subRuleType.uniqueValues");case t.CFSubRuleType.number:{const n=l.operator;return e.t(`sheet.cf.preview.describe.${n}`,...Array.isArray(l.value)?l.value.map(a=>String(a)):[String(l.value||"")])}case t.CFSubRuleType.text:{const n=l.operator;return e.t(`sheet.cf.preview.describe.${n}`,l.value||"")}case t.CFSubRuleType.timePeriod:{const n=l.operator;return e.t(`sheet.cf.preview.describe.${n}`)}case t.CFSubRuleType.rank:return l.isPercent?l.isBottom?e.t("sheet.cf.preview.describe.bottomNPercent",String(l.value)):e.t("sheet.cf.preview.describe.topNPercent",String(l.value)):l.isBottom?e.t("sheet.cf.preview.describe.bottomN",String(l.value)):e.t("sheet.cf.preview.describe.topN",String(l.value));case t.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let Ir=0;const it=r=>{const{onClick:e}=r,l=j.useDependency(t.ConditionalFormattingRuleModel),n=j.useDependency(i.IUniverInstanceService),a=j.useDependency(U.SheetsSelectionsService),u=j.useDependency(i.ICommandService),s=j.useDependency(i.LocaleService),v=j.useDependency(i.Injector),o=j.useDependency(j.ISidebarService),f=j.useDependency(se),d=j.useObservable(()=>n.getCurrentTypeOfUnit$(i.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),p=d.getUnitId(),h=d.getActiveSheet();if(!h)throw new Error("No active sheet found");const b=h.getSheetId(),[S,C]=m.useState([]),[N,_]=m.useState("2"),[E,M]=m.useState(0),[R,g]=m.useState(-1),[T,w]=m.useState(Ir),I=m.useRef(null),k=[{label:s.t("sheet.cf.panel.workSheet"),value:"2"},{label:s.t("sheet.cf.panel.selectedRange"),value:"1"}],V=()=>{const A=l.getSubunitRules(p,b);if(!A||!A.length)return[];if(N==="1"){const $=a.getCurrentLastSelection();if(!$)return[];const B=$.range;return A.filter(Z=>Z.ranges.some(z=>i.Rectangle.intersects(z,B)))}else if(N==="2")return[...A];return[]},[P,L]=m.useState(V);W.useHighlightRange(S),m.useEffect(()=>{const A=u.onCommandExecuted($=>{$.id===U.SetWorksheetActiveOperation.id&&M(Math.random())});return()=>A.dispose()}),m.useEffect(()=>{L(V)},[N,E,p,b]),m.useEffect(()=>{if(N==="2")return;const A=new J.Observable($=>{const B=[U.SetSelectionsOperation.id,t.AddConditionalRuleMutation.id,t.SetConditionalRuleMutation.id,t.DeleteConditionalRuleMutation.id,t.MoveConditionalRuleMutation.id],q=u.onCommandExecuted(Z=>{const{id:z,params:ae}=Z,le=n.getCurrentUnitOfType(i.UniverInstanceType.UNIVER_SHEET).getUnitId();B.includes(z)&&ae.unitId===le&&$.next(null)});return()=>q.dispose()}).pipe(J.debounceTime(16)).subscribe(()=>{L(V)});return()=>{A.unsubscribe()}},[n,N,p,b]),m.useEffect(()=>{const A=l.$ruleChange.subscribe(()=>{M(Math.random())});return()=>A.unsubscribe()},[l]),m.useEffect(()=>{const A=()=>{var Z,z;const q=Math.max(0,((z=(Z=I.current)==null?void 0:Z.getBoundingClientRect().width)!=null?z:0)-8);return Ir=q,q},B=new J.Observable(q=>{const Z=o.getContainer();if(Z){let z=setTimeout(()=>{q.next(void 0)},150);const ae=()=>{z&&clearTimeout(z),z=null},le=Fe=>{Fe.propertyName==="width"&&(ae(),q.next(void 0))};return Z.addEventListener("transitionend",le),()=>{ae(),Z.removeEventListener("transitionend",le)}}}).pipe(J.debounceTime(16)).subscribe(()=>{w(A())});return()=>{B.unsubscribe()}},[]);const y=A=>{var q;const $=n.getCurrentUnitOfType(i.UniverInstanceType.UNIVER_SHEET).getUnitId(),B=(q=n.getCurrentUnitOfType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:q.getSheetId();if(!$||!B)throw new Error("No active sheet found");u.executeCommand(t.DeleteCfCommand.id,{unitId:$,subUnitId:B,cfId:A.cfId})},x=(A,$)=>{g($.y)},F=(A,$,B)=>{var Fe;g(-1);const q=n.getCurrentUnitOfType(i.UniverInstanceType.UNIVER_SHEET).getUnitId(),Z=(Fe=n.getCurrentUnitOfType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:Fe.getSheetId();if(!q||!Z)throw new Error("No active sheet found");const z=Ht=>{const Bt=P.length;return Math.min(Bt-1,Math.max(0,Ht))},ae=P[z($.y)].cfId,le=P[z(B.y)].cfId;ae!==le&&u.executeCommand(t.MoveCfCommand.id,{unitId:q,subUnitId:Z,start:{id:ae,type:"self"},end:{id:le,type:B.y>$.y?"after":"before"}})},G=()=>{r.onCreate()},Q=()=>{N==="2"?u.executeCommand(t.ClearWorksheetCfCommand.id):N==="1"&&P.map($=>({unitId:p,subUnitId:b,cfId:$.cfId})).forEach($=>{u.executeCommand(t.DeleteCfCommand.id,$)})},ee=m.useMemo(()=>{const A=n.getCurrentUnitOfType(i.UniverInstanceType.UNIVER_SHEET),$=A.getActiveSheet();return P.filter(B=>{const q=B.ranges;return U.checkRangesEditablePermission(v,A.getUnitId(),$.getSheetId(),q)})},[P]),de=ee.map((A,$)=>({i:A.cfId,x:0,w:12,y:$,h:1,isResizable:!1})),ve=m.useMemo(()=>{const A=n.getCurrentUnitOfType(i.UniverInstanceType.UNIVER_SHEET),$=A.getActiveSheet();return P.every(B=>{const q=B.ranges;return U.checkRangesEditablePermission(v,A.getUnitId(),$.getSheetId(),q)})},[P]);return c.jsxs("div",{children:[c.jsxs("div",{className:"univer-flex univer-items-center univer-justify-between univer-gap-2 univer-text-sm",children:[c.jsx("div",{className:"univer-flex univer-items-center univer-gap-2",children:f.tWithReactNode("sheet.cf.panel.managerRuleSelect",c.jsx(O.Select,{className:"univer-w-36",options:k,value:N,onChange:A=>{_(A)}})).map((A,$)=>c.jsx("span",{children:A},$))}),c.jsxs("div",{className:"univer-flex univer-justify-end",children:[c.jsx(O.Tooltip,{title:s.t("sheet.cf.panel.createRule"),placement:"bottom",children:c.jsx("a",{className:"univer-size-5 univer-cursor-pointer",onClick:G,children:c.jsx(sr,{})})}),P.length&&ve?c.jsx(O.Tooltip,{title:s.t("sheet.cf.panel.clear"),placement:"bottom",children:c.jsx("a",{className:"univer-size-5 univer-cursor-pointer",onClick:Q,children:c.jsx(Ee,{className:"univer-text-red-500"})})}):c.jsx("div",{children:c.jsx(Ee,{className:"univer-text-gray-300"})})]})]}),c.jsx("div",{ref:I,children:T>0&&c.jsx(O.ReactGridLayout,{className:"[&_.react-grid-item]:univer-transition-none [&_.react-grid-placeholder]:univer-rounded [&_.react-grid-placeholder]:!univer-bg-gray-200",draggableHandle:".draggableHandle",layout:de,cols:12,rowHeight:60,width:T,margin:[0,10],onDragStop:F,onDragStart:x,children:ee==null?void 0:ee.map((A,$)=>c.jsx("div",{children:c.jsxs("div",{className:O.clsx("univer-group univer-relative univer-flex univer-items-center univer-justify-between univer-rounded univer-py-2 univer-pl-5 univer-pr-8 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",{"univer-bg-gray-100 dark:!univer-bg-gray-700":R===$}),onMouseMove:()=>{A.ranges!==S&&C(A.ranges)},onMouseLeave:()=>C([]),onClick:()=>{e(A)},children:[c.jsx("div",{className:O.clsx("univer-absolute univer-left-0 univer-hidden univer-size-5 univer-cursor-grab univer-items-center univer-justify-center univer-rounded group-hover:univer-flex","draggableHandle"),onClick:B=>B.stopPropagation(),children:c.jsx(dr,{})}),c.jsxs("div",{className:"univer-min-w-0 univer-max-w-full univer-flex-shrink univer-overflow-hidden",children:[c.jsx("div",{className:"univer-text-sm univer-text-gray-900 dark:!univer-text-white",children:ut(A,s)}),c.jsx("div",{className:"univer-text-xs univer-text-gray-400",children:A.ranges.map(B=>$e.serializeRange(B)).join(",")})]}),c.jsx("div",{children:c.jsx(ue,{rule:A.rule})}),c.jsx("div",{className:O.clsx("univer-absolute univer-right-1 univer-hidden univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded hover:univer-bg-gray-200 group-hover:univer-flex",{"univer-flex univer-items-center univer-justify-center":R===$}),onClick:B=>{B.stopPropagation(),y(A),C([])},children:c.jsx(Ee,{})})]})},`${A.cfId}`))})})]})},st=r=>{const[e,l]=m.useState(r.rule),[n,a]=m.useState(!!r.rule),u=()=>{a(!0)},s=()=>{a(!1),l(void 0)},v=o=>{l(o),a(!0)};return c.jsx("div",{className:"univer-flex univer-h-full univer-flex-col univer-justify-between univer-py-4",children:n?c.jsx(tt,{onCancel:s,rule:e}):c.jsx(it,{onClick:v,onCreate:u})})};var ct=Object.getOwnPropertyDescriptor,ot=(r,e,l,n)=>{for(var a=n>1?void 0:n?ct(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},ye=(r,e)=>(l,n)=>e(l,n,r);const Oe="sheet.conditional.formatting.panel";let me=class extends i.Disposable{constructor(e,l,n,a,u){super();re(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=l,this._componentManager=n,this._sidebarService=a,this._localeService=u,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(i.UniverInstanceType.UNIVER_SHEET).subscribe(s=>{var v;s||(v=this._sidebarDisposable)==null||v.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(s=>{s.id===Oe&&(s.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const l={id:Oe,header:{title:this._localeService.t("sheet.cf.title")},children:{label:Oe,rule:e,key:i.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(l)}_initPanel(){this.disposeWithMe(this._componentManager.register(Oe,st))}};me=ot([ye(0,i.IUniverInstanceService),ye(1,i.Inject(i.Injector)),ye(2,i.Inject(j.ComponentManager)),ye(3,i.Inject(j.ISidebarService)),ye(4,i.Inject(i.LocaleService))],me);var Y=(r=>(r[r.createRule=1]="createRule",r[r.viewRule=2]="viewRule",r[r.highlightCell=3]="highlightCell",r[r.rank=4]="rank",r[r.formula=5]="formula",r[r.colorScale=6]="colorScale",r[r.dataBar=7]="dataBar",r[r.icon=8]="icon",r[r.clearRangeRules=9]="clearRangeRules",r[r.clearWorkSheetRules=10]="clearWorkSheetRules",r))(Y||{});const Ce={id:"sheet.operation.open.conditional.formatting.panel",type:i.CommandType.OPERATION,handler:(r,e)=>{var v;const l=r.get(me),n=r.get(U.SheetsSelectionsService),a=r.get(i.ICommandService),u=((v=n.getCurrentSelections())==null?void 0:v.map(o=>o.range))||[];switch(e.value){case 3:{l.openPanel({...t.createDefaultRule(),ranges:u});break}case 4:{const o={...t.createDefaultRule,ranges:u,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.rank}};l.openPanel(o);break}case 5:{const o={...t.createDefaultRule,ranges:u,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.formula,value:"="}};l.openPanel(o);break}case 6:{const o={...t.createDefaultRule,ranges:u,rule:{type:t.CFRuleType.colorScale,config:[]}};l.openPanel(o);break}case 7:{const o={...t.createDefaultRule,ranges:u,rule:{type:t.CFRuleType.dataBar,isShowValue:!0}};l.openPanel(o);break}case 8:{const o={...t.createDefaultRule,ranges:u,rule:{type:t.CFRuleType.iconSet,config:[],isShowValue:!0}};l.openPanel(o);break}case 2:{l.openPanel();break}case 1:{l.openPanel({...t.createDefaultRule(),ranges:u});break}case 9:{a.executeCommand(t.ClearRangeCfCommand.id,{ranges:u});break}case 10:{a.executeCommand(t.ClearWorksheetCfCommand.id);break}}return!0}};var dt=Object.getOwnPropertyDescriptor,vt=(r,e,l,n)=>{for(var a=n>1?void 0:n?dt(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},be=(r,e)=>(l,n)=>e(l,n,r);D.ConditionalFormattingClearController=class extends i.Disposable{constructor(e,l,n,a,u){super(),this._injector=e,this._univerInstanceService=l,this._sheetInterceptorService=n,this._selectionManagerService=a,this._conditionalFormattingRuleModel=u,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var u;const l=[],n=[],a={redos:l,undos:n};if([U.ClearSelectionFormatCommand.id,U.ClearSelectionAllCommand.id].includes(e.id)){const s=(u=this._selectionManagerService.getCurrentSelections())==null?void 0:u.map(S=>S.range);if(!s)return a;const v=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET),o=v.getActiveSheet();if(!o)return a;const f=v.getUnitId(),d=o.getSheetId(),p=this._conditionalFormattingRuleModel.getSubunitRules(f,d);if(!p||!p.length)return a;const{redos:h,undos:b}=Sr(this._injector,p,s,f,d);l.push(...h),n.push(...b)}return a}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:l,ranges:n})=>{const a=[],u=[],s={redos:a,undos:u};if(!n||!n.length)return s;const v=this._conditionalFormattingRuleModel.getSubunitRules(e,l);if(!v||!v.length)return s;const{redos:o,undos:f}=Sr(this._injector,v,n,e,l);return a.push(...o),u.push(...f),s}}))}},D.ConditionalFormattingClearController=vt([be(0,i.Inject(i.Injector)),be(1,i.Inject(i.IUniverInstanceService)),be(2,i.Inject(U.SheetInterceptorService)),be(3,i.Inject(U.SheetsSelectionsService)),be(4,i.Inject(t.ConditionalFormattingRuleModel))],D.ConditionalFormattingClearController);function Sr(r,e,l,n,a){const u=[],s=[];return e.filter(v=>l.some(o=>v.ranges.some(f=>i.Rectangle.getIntersects(f,o)))).forEach(v=>{const f=new U.RangeMergeUtil().add(...v.ranges).subtract(...l).merge();if(f.length){const d={id:t.SetConditionalRuleMutation.id,params:{unitId:n,subUnitId:a,rule:{...v,ranges:f}}},p=t.setConditionalRuleMutationUndoFactory(r,d.params);u.push(d),s.push(...p)}else{const d={id:t.DeleteConditionalRuleMutation.id,params:{unitId:n,subUnitId:a,cfId:v.cfId}},p=t.DeleteConditionalRuleMutationUndoFactory(r,d.params);u.push(d),s.push(...p)}}),{redos:u,undos:s}}var pt=Object.getOwnPropertyDescriptor,ft=(r,e,l,n)=>{for(var a=n>1?void 0:n?pt(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},Ie=(r,e)=>(l,n)=>e(l,n,r);let Se=class extends i.Disposable{constructor(e,l,n,a,u){super();re(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=l,this._injector=n,this._conditionalFormattingViewModel=a,this._univerInstanceService=u,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:t.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,l,n)=>this._collectConditionalRule(e,l,n),onPasteCells:(e,l,n,a)=>{const{copyType:u=W.COPY_TYPE.COPY,pasteType:s}=a,{range:v}=e||{},{range:o}=l;return this._generateConditionalFormattingMutations(o,{copyType:u,pasteType:s,copyRange:v})}}))}_collectConditionalRule(e,l,n){const a=new i.ObjectMatrix,u={};this._copyInfo={matrix:a,info:{unitId:e,subUnitId:l,cfMap:u}};const s=this._injector.invoke(d=>U.rangeToDiscreteRange(n,d,e,l));if(!s)return;const{rows:v,cols:o}=s,f=new Set;v.forEach((d,p)=>{o.forEach((h,b)=>{const S=this._conditionalFormattingViewModel.getCellCfs(e,l,d,h);S&&(S.forEach(C=>f.add(C.cfId)),a.setValue(p,b,S.map(C=>C.cfId)))})}),f.forEach(d=>{const p=this._conditionalFormattingRuleModel.getRule(e,l,d);p&&(u[d]=p.rule)})}_generateConditionalFormattingMutations(e,l){const n=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET),a=n.getActiveSheet(),u=n.getUnitId();if(!a)return{redos:[],undos:[]};const s=a.getSheetId();if(l.copyType===W.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!l.copyRange)return{redos:[],undos:[]};if(![W.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,W.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,W.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(l.pasteType))return{redos:[],undos:[]};const{ranges:[o,f],mapFunc:d}=W.virtualizeDiscreteRanges([l.copyRange,e]),p=W.getRepeatRange(o,f,!0),h={};i.Range.foreach(f,(g,T)=>{const{row:w,col:I}=d(g,T),k=this._conditionalFormattingViewModel.getCellCfs(u,s,w,I);k&&k.forEach(V=>{if(!h[V.cfId]){const P=new i.ObjectMatrix;h[V.cfId]=P;const L=this._conditionalFormattingRuleModel.getRule(u,s,V.cfId);L==null||L.ranges.forEach(y=>{i.Range.foreach(y,(x,F)=>{P.setValue(x,F,1)})})}h[V.cfId].realDeleteValue(w,I)})});const{matrix:b,info:S}=this._copyInfo,C=[];let N=this._conditionalFormattingRuleModel.createCfId(u,s);const _={},E=g=>{if(_[g])return _[g];const T=S==null?void 0:S.cfMap[g],w=[...this._conditionalFormattingRuleModel.getSubunitRules(u,s)||[],...C].find(I=>i.Tools.diffValue(I.rule,T));if(w)return _[g]=w,w;{const I={rule:T,cfId:N,ranges:[],stopIfTrue:!1};return _[g]=I,C.push(I),N=`${Number(N)+1}`,I}};p.forEach(g=>{b&&b.forValue((T,w,I)=>{const k=i.Rectangle.getPositionRange({startRow:T,endRow:T,startColumn:w,endColumn:w},g.startRange),{row:V,col:P}=d(k.startRow,k.startColumn);I.forEach(L=>{if(!h[L]){const y=E(L),x=new i.ObjectMatrix;h[L]=x,y.ranges.forEach(F=>{i.Range.foreach(F,(G,Q)=>{x.setValue(G,Q,1)})})}h[L].setValue(V,P,1)})})});const M=[],R=[];for(const g in h){const T=h[g],w=U.findAllRectangle(U.createTopMatrixFromMatrix(T));if(!w.length){const I={unitId:u,subUnitId:s,cfId:g};M.push({id:t.DeleteConditionalRuleMutation.id,params:I}),R.push(...t.DeleteConditionalRuleMutationUndoFactory(this._injector,I))}if(C.some(I=>I.cfId===g)){const I=E(g),k={unitId:u,subUnitId:s,rule:{...I,ranges:w}};M.push({id:t.AddConditionalRuleMutation.id,params:k}),R.push(t.AddConditionalRuleMutationUndoFactory(this._injector,k))}else{const I=this._conditionalFormattingRuleModel.getRule(u,s,g);if(!I)continue;const k={unitId:u,subUnitId:s,rule:{...I,ranges:w}};M.push({id:t.SetConditionalRuleMutation.id,params:k}),R.push(...t.setConditionalRuleMutationUndoFactory(this._injector,k))}}return{redos:M,undos:R}}};Se=ft([Ie(0,i.Inject(W.ISheetClipboardService)),Ie(1,i.Inject(t.ConditionalFormattingRuleModel)),Ie(2,i.Inject(i.Injector)),Ie(3,i.Inject(t.ConditionalFormattingViewModel)),Ie(4,i.Inject(i.IUniverInstanceService))],Se);var ht=Object.getOwnPropertyDescriptor,gt=(r,e,l,n)=>{for(var a=n>1?void 0:n?ht(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},er=(r,e)=>(l,n)=>e(l,n,r);let Te=class extends i.Disposable{constructor(r,e,l){super(),this._localeService=r,this._commandService=e,this._sheetPermissionCheckController=l,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(r=>{r.id===t.AddCfCommand.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[U.WorkbookEditablePermission],rangeTypes:[U.RangeProtectionPermissionEditPoint],worksheetTypes:[U.WorksheetEditPermission,U.WorksheetSetCellStylePermission]},r.params.rule.ranges)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")))}))}};Te=gt([er(0,i.Inject(i.LocaleService)),er(1,i.ICommandService),er(2,i.Inject(U.SheetPermissionCheckController))],Te);var yt=Object.getOwnPropertyDescriptor,mt=(r,e,l,n)=>{for(var a=n>1?void 0:n?yt(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},Ue=(r,e)=>(l,n)=>e(l,n,r);let _e=class extends i.Disposable{constructor(r,e,l,n){super(),this._conditionalFormattingRuleModel=r,this._univerInstanceService=e,this._injector=l,this._refRangeService=n,this._initRefRange()}_initRefRange(){const r=new Map,e=(n,a,u)=>`${n}_${a}_${u}`,l=(n,a,u)=>{const s=o=>{const f=[...u.ranges],d=f.map(h=>U.handleDefaultRangeChangeWithEffectRefCommands(h,o)).filter(h=>!!h);if(t.isRangesEqual(d,f))return{redos:[],undos:[]};if(d.length){const h={unitId:n,subUnitId:a,rule:{...u,ranges:d}},b=[{id:t.SetConditionalRuleMutation.id,params:h}],S=t.setConditionalRuleMutationUndoFactory(this._injector,h);return{redos:b,undos:S}}else{const h={unitId:n,subUnitId:a,cfId:u.cfId},b=[{id:t.DeleteConditionalRuleMutation.id,params:h}],S=t.DeleteConditionalRuleMutationUndoFactory(this._injector,h);return{redos:b,undos:S}}},v=[];u.ranges.forEach(o=>{const f=this._refRangeService.registerRefRange(o,s);v.push(()=>f.dispose())}),r.set(e(n,a,u.cfId),()=>v.forEach(o=>o()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:a,subUnitId:u,rule:s}=n,v=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET),o=v.getActiveSheet();if(!(n.unitId!==v.getUnitId()||n.subUnitId!==(o==null?void 0:o.getSheetId())))switch(n.type){case"add":{l(n.unitId,n.subUnitId,n.rule);break}case"delete":{const f=r.get(e(a,u,s.cfId));f&&f();break}case"set":{const f=r.get(e(a,u,s.cfId));f&&f(),l(n.unitId,n.subUnitId,n.rule)}}})),this.disposeWithMe(i.toDisposable(()=>{r.forEach(n=>{n()}),r.clear()}))}};_e=mt([Ue(0,i.Inject(t.ConditionalFormattingRuleModel)),Ue(1,i.Inject(i.IUniverInstanceService)),Ue(2,i.Inject(i.Injector)),Ue(3,i.Inject(U.RefRangeService))],_e);var Ct=Object.getOwnPropertyDescriptor,bt=(r,e,l,n)=>{for(var a=n>1?void 0:n?Ct(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},ce=(r,e)=>(l,n)=>e(l,n,r);let we=class extends i.Disposable{constructor(e,l,n,a,u,s){super();re(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=l,this._univerInstanceService=n,this._renderManagerService=a,this._conditionalFormattingViewModel=u,this._conditionalFormattingRuleModel=s,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var l,n,a;const e=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getUnitId();(l=this._renderManagerService.getRenderById(e))==null||l.with(W.SheetSkeletonManagerService).reCalculate(),(a=(n=this._renderManagerService.getRenderById(e))==null?void 0:n.mainComponent)==null||a.makeDirty()}_initSkeleton(){this.disposeWithMe(J.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(fe.bufferTime(16),fe.filter(e=>!!e.length),fe.filter(e=>{const l=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!l)return!1;const n=l.getActiveSheet();return n?e.filter(a=>a.unitId===l.getUnitId()&&a.subUnitId===n.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(U.INTERCEPTOR_POINT.CELL_CONTENT,{effect:i.InterceptorEffectEnum.Style,handler:(e,l,n)=>{const a=this._conditionalFormattingService.composeStyle(l.unitId,l.subUnitId,l.row,l.col);if(!a)return n(e);const u=l.workbook.getStyles(),s=(typeof(e==null?void 0:e.s)=="string"?u.get(e==null?void 0:e.s):e==null?void 0:e.s)||{},v=e===l.rawData?{...l.rawData}:e;if(a.style){const o={...s,...a.style};Object.assign(v,{s:o})}return v.fontRenderExtension||(v.fontRenderExtension={},a.isShowValue!==void 0&&(v.fontRenderExtension.isSkip=!a.isShowValue)),a.dataBar&&(v.dataBar=a.dataBar),a.iconSet&&(v.iconSet=a.iconSet,v.fontRenderExtension.leftOffset=t.DEFAULT_PADDING+t.DEFAULT_WIDTH),n(v)},priority:10}))}};we=bt([ce(0,i.Inject(U.SheetInterceptorService)),ce(1,i.Inject(t.ConditionalFormattingService)),ce(2,i.Inject(i.IUniverInstanceService)),ce(3,i.Inject(ar.IRenderManagerService)),ce(4,i.Inject(t.ConditionalFormattingViewModel)),ce(5,i.Inject(t.ConditionalFormattingRuleModel))],we);const Tr="sheets-conditional-formatting-ui.config",ke={};var It=Object.defineProperty,St=Object.getOwnPropertyDescriptor,Tt=(r,e,l)=>e in r?It(r,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[e]=l,_t=(r,e,l,n)=>{for(var a=n>1?void 0:n?St(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},rr=(r,e)=>(l,n)=>e(l,n,r),_r=(r,e,l)=>Tt(r,typeof e!="symbol"?e+"":e,l);D.UniverSheetsConditionalFormattingMobileUIPlugin=class extends i.Plugin{constructor(e=ke,l,n,a){super(),this._config=e,this._injector=l,this._commandService=n,this._configService=a;const{menu:u,...s}=i.merge({},ke,this._config);u&&this._configService.setConfig("menu",u,{merge:!0}),this._configService.setConfig(Tr,s),this._initCommand(),this._injector.add([we]),this._injector.add([_e]),this._injector.add([Se]),this._injector.add([Te]),this._injector.add([se])}_initCommand(){[He,Be,We,qe,Ge,Ze,ze,Ye,Ke,Ce].forEach(e=>{this._commandService.registerCommand(e)})}},_r(D.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${t.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),_r(D.UniverSheetsConditionalFormattingMobileUIPlugin,"type",i.UniverInstanceType.UNIVER_SHEET),D.UniverSheetsConditionalFormattingMobileUIPlugin=_t([i.DependentOn(t.UniverSheetsConditionalFormattingPlugin),rr(1,i.Inject(i.Injector)),rr(2,i.Inject(i.ICommandService)),rr(3,i.IConfigService)],D.UniverSheetsConditionalFormattingMobileUIPlugin);var wt=Object.getOwnPropertyDescriptor,xt=(r,e,l,n)=>{for(var a=n>1?void 0:n?wt(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},xe=(r,e)=>(l,n)=>e(l,n,r);let Pe=class extends i.Disposable{constructor(r,e,l,n,a){super(),this._injector=r,this._univerInstanceService=e,this._autoFillService=l,this._conditionalFormattingRuleModel=n,this._conditionalFormattingViewModel=a,this._initAutoFill()}_initAutoFill(){const r=()=>({redos:[],undos:[]}),e=(a,u,s,v,o)=>{var b;const f=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getUnitId(),d=(b=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:b.getSheetId();if(!f||!d)return;const p={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},h={startRow:u.row,startColumn:u.col,endColumn:u.col,endRow:u.row};i.Range.foreach(s,(S,C)=>{const N=i.Rectangle.getPositionRange({startRow:S,startColumn:C,endColumn:C,endRow:S},p),_=i.Rectangle.getPositionRange({startRow:S,startColumn:C,endColumn:C,endRow:S},h),{row:E,col:M}=o(N.startRow,N.startColumn),R=this._conditionalFormattingViewModel.getCellCfs(f,d,E,M),{row:g,col:T}=o(_.startRow,_.startColumn),w=this._conditionalFormattingViewModel.getCellCfs(f,d,g,T);w&&w.forEach(I=>{let k=v.get(I.cfId);if(!v.get(I.cfId)){const V=this._conditionalFormattingRuleModel.getRule(f,d,I.cfId);if(!V)return;k=new i.ObjectMatrix,V.ranges.forEach(P=>{i.Range.foreach(P,(L,y)=>{k.setValue(L,y,1)})}),v.set(I.cfId,k)}k.realDeleteValue(g,T)}),R&&R.forEach(I=>{let k=v.get(I.cfId);if(!v.get(I.cfId)){const V=this._conditionalFormattingRuleModel.getRule(f,d,I.cfId);if(!V)return;k=new i.ObjectMatrix,V.ranges.forEach(P=>{i.Range.foreach(P,(L,y)=>{k.setValue(L,y,1)})}),v.set(I.cfId,k)}k.setValue(g,T,1)})})},l=(a,u)=>{var _,E,M;const s=(_=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET))==null?void 0:_.getUnitId(),v=(M=(E=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET))==null?void 0:E.getActiveSheet())==null?void 0:M.getSheetId(),o=new Map,f=[],d=[];if(!s||!v)return r();const p=W.virtualizeDiscreteRanges([a,u]),[h,b]=p.ranges,{mapFunc:S}=p,C={row:h.startRow,col:h.startColumn};return W.getAutoFillRepeatRange(h,b).forEach(R=>{e(C,R.repeatStartCell,R.relativeRange,o,S)}),o.forEach((R,g)=>{const T=this._conditionalFormattingRuleModel.getRule(s,v,g);if(!T)return;const w=U.findAllRectangle(U.createTopMatrixFromMatrix(R));if(w.length){const I={unitId:s,subUnitId:v,rule:{...T,ranges:w}};f.push({id:t.SetConditionalRuleMutation.id,params:I}),d.push(...t.setConditionalRuleMutationUndoFactory(this._injector,I))}else{const I={unitId:s,subUnitId:v,cfId:T.cfId};f.push({id:t.DeleteConditionalRuleMutation.id,params:I}),d.push(...t.DeleteConditionalRuleMutationUndoFactory(this._injector,I))}}),{undos:d,redos:f}},n={id:t.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(a,u,s)=>{if(s===W.APPLY_TYPE.COPY||s===W.APPLY_TYPE.ONLY_FORMAT||s===W.APPLY_TYPE.SERIES){const{source:v,target:o}=a;return l(v,o)}return r()}};this.disposeWithMe(this._autoFillService.addHook(n))}};Pe=xt([xe(0,i.Inject(i.Injector)),xe(1,i.Inject(i.IUniverInstanceService)),xe(2,i.Inject(W.IAutoFillService)),xe(3,i.Inject(t.ConditionalFormattingRuleModel)),xe(4,i.Inject(t.ConditionalFormattingViewModel))],Pe);var Nt=Object.getOwnPropertyDescriptor,Et=(r,e,l,n)=>{for(var a=n>1?void 0:n?Nt(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},wr=(r,e)=>(l,n)=>e(l,n,r);let De=class extends i.Disposable{constructor(r,e){super(),this._sheetInterceptorService=r,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(i.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(U.AFTER_CELL_EDIT,{handler:(r,e,l)=>{var s,v,o;r||l(r);const n=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col),a=(s=n==null?void 0:n.style)!=null?s:{},u=Object.keys(a);if(r!=null&&r.p)return(o=(v=r.p.body)==null?void 0:v.textRuns)==null||o.forEach(f=>{f.ts&&u.forEach(d=>{var p;(p=f.ts)==null||delete p[d]})}),l(r);{const f={...(typeof(r==null?void 0:r.s)=="string"?e.workbook.getStyles().get(r.s):r==null?void 0:r.s)||{}};u.forEach(p=>{delete f[p]});const d={...r,s:{...f}};return l(d)}}})))}};De=Et([wr(0,i.Inject(U.SheetInterceptorService)),wr(1,i.Inject(t.ConditionalFormattingService))],De);const xr=[U.SetWorksheetActiveOperation.id,t.AddConditionalRuleMutation.id,t.SetConditionalRuleMutation.id,t.DeleteConditionalRuleMutation.id,t.MoveConditionalRuleMutation.id],Ne=[{label:{name:"sheet.cf.ruleType.highlightCell",selectable:!1},value:Y.highlightCell},{label:{name:"sheet.cf.panel.rankAndAverage",selectable:!1},value:Y.rank},{label:{name:"sheet.cf.ruleType.formula",selectable:!1},value:Y.formula},{label:{name:"sheet.cf.ruleType.colorScale",selectable:!1},value:Y.colorScale},{label:{name:"sheet.cf.ruleType.dataBar",selectable:!1},value:Y.dataBar},{label:{name:"sheet.cf.ruleType.iconSet",selectable:!1},value:Y.icon},{label:{name:"sheet.cf.menu.manageConditionalFormatting",selectable:!1},value:Y.viewRule},{label:{name:"sheet.cf.menu.createConditionalFormatting",selectable:!1},value:Y.createRule},{label:{name:"sheet.cf.menu.clearRangeRules",selectable:!1},value:Y.clearRangeRules,disabled:!1},{label:{name:"sheet.cf.menu.clearWorkSheetRules",selectable:!1},value:Y.clearWorkSheetRules}],Rt=r=>{const e=r.get(U.SheetsSelectionsService),l=r.get(i.ICommandService),n=r.get(i.IUniverInstanceService),a=r.get(t.ConditionalFormattingRuleModel),u=new J.Observable(o=>J.merge(e.selectionMoveEnd$,e.selectionSet$,new J.Observable(f=>{const d=l.onCommandExecuted(p=>{var C;const{id:h,params:b}=p,S=(C=n.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET))==null?void 0:C.getUnitId();xr.includes(h)&&b.unitId===S&&f.next(null)});return()=>d.dispose()})).pipe(fe.debounceTime(16)).subscribe(()=>{var C;const f=((C=e.getCurrentSelections())==null?void 0:C.map(N=>N.range))||[],d=n.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!d)return;const p=d.getActiveSheet();if(!p)return;const S=(a.getSubunitRules(d.getUnitId(),p.getSheetId())||[]).filter(N=>N.ranges.some(_=>f.some(E=>i.Rectangle.intersects(E,_)))).map(N=>N.ranges).every(N=>U.checkRangesEditablePermission(r,d.getUnitId(),p.getSheetId(),N));o.next(S)})),s=new J.Observable(o=>new J.Observable(f=>{const d=l.onCommandExecuted(p=>{var C;const{id:h,params:b}=p,S=(C=n.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET))==null?void 0:C.getUnitId();xr.includes(h)&&b.unitId===S&&f.next(null)});return()=>d.dispose()}).pipe(fe.debounceTime(16)).subscribe(()=>{const f=n.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!f)return;const d=f.getActiveSheet();if(!d)return;const p=a.getSubunitRules(f.getUnitId(),d.getSheetId())||[];if(!p.length)return o.next(!1),!1;const h=p.map(b=>b.ranges).every(b=>U.checkRangesEditablePermission(r,f.getUnitId(),d.getSheetId(),b));o.next(h)})),v=new J.Observable(o=>{u.subscribe(f=>{const d=Ne.find(p=>p.value===Y.clearRangeRules);d&&(d.disabled=!f,o.next(Ne))}),s.subscribe(f=>{const d=Ne.find(p=>p.value===Y.clearWorkSheetRules);d&&(d.disabled=!f,o.next(Ne))}),o.next(Ne)});return{id:Ce.id,type:j.MenuItemType.SELECTOR,icon:"ConditionsDoubleIcon",tooltip:"sheet.cf.title",selections:v,hidden$:j.getMenuHiddenObservable(r,i.UniverInstanceType.UNIVER_SHEET),disabled$:W.getCurrentRangeDisable$(r,{workbookTypes:[U.WorkbookEditablePermission],worksheetTypes:[U.WorksheetSetCellStylePermission,U.WorksheetEditPermission],rangeTypes:[U.RangeProtectionPermissionEditPoint]})}},Mt={[j.RibbonDataGroup.RULES]:{[Ce.id]:{order:1,menuItemFactory:Rt}}};var Vt=Object.getOwnPropertyDescriptor,Ot=(r,e,l,n)=>{for(var a=n>1?void 0:n?Vt(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},Nr=(r,e)=>(l,n)=>e(l,n,r);let Le=class extends i.Disposable{constructor(e,l){super();re(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=l,this._menuManagerService.mergeMenu(Mt)}};Le=Ot([Nr(0,i.Inject(i.Injector)),Nr(1,j.IMenuManagerService)],Le);var Ut=Object.getOwnPropertyDescriptor,kt=(r,e,l,n)=>{for(var a=n>1?void 0:n?Ut(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},oe=(r,e)=>(l,n)=>e(l,n,r);const Pt=(r,e)=>{const l=d=>d.endRow-d.startRow+1,n=d=>d.endColumn-d.startColumn+1,a=l(e)%l(r),u=n(e)%n(r),s=Math.floor(l(e)/l(r)),v=Math.floor(n(e)/n(r)),o=[],f={startRow:0,endRow:l(r)-1,startColumn:0,endColumn:n(r)-1};if(l(e)===1&&n(e)===1){const d={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return o.push({repeatRelativeRange:f,startRange:d}),o}for(let d=0;d<s+(a?.1:0);d++)for(let p=0;p<v+(u?.1:0);p++){const h=l(r)*d,b=n(r)*p,S={startRow:h+e.startRow,endRow:h+e.startRow,startColumn:b+e.startColumn,endColumn:b+e.startColumn};let C=f;d===s&&a&&(C={...C},C.endRow=C.endRow-(l(r)-a)),p===v&&u&&(C={...C},C.endColumn=C.endColumn-(n(r)-u)),o.push({repeatRelativeRange:C,startRange:S})}return o};let je=class extends i.Disposable{constructor(e,l,n,a,u,s){super();re(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=l,this._formatPainterService=n,this._sheetsSelectionsService=a,this._conditionalFormattingRuleModel=u,this._conditionalFormattingViewModel=s,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),l=(u,s,v,o,f)=>{const{unitId:d,subUnitId:p}=this._painterConfig,{targetUnitId:h,targetSubUnitId:b}=f,S={startRow:u.row,startColumn:u.col,endColumn:u.col,endRow:u.row},C={startRow:s.row,startColumn:s.col,endColumn:s.col,endRow:s.row};i.Range.foreach(v,(N,_)=>{const E=i.Rectangle.getPositionRange({startRow:N,startColumn:_,endColumn:_,endRow:N},S),M=i.Rectangle.getPositionRange({startRow:N,startColumn:_,endColumn:_,endRow:N},C),R=this._conditionalFormattingViewModel.getCellCfs(d,p,E.startRow,E.startColumn),g=this._conditionalFormattingViewModel.getCellCfs(h,b,M.startRow,M.startColumn);g&&g.forEach(T=>{let w=o.get(T.cfId);if(!o.get(T.cfId)){const I=this._conditionalFormattingRuleModel.getRule(h,b,T.cfId);if(!I)return;w=new i.ObjectMatrix,I.ranges.forEach(k=>{i.Range.foreach(k,(V,P)=>{w.setValue(V,P,1)})}),o.set(T.cfId,w)}w.realDeleteValue(M.startRow,M.startColumn)}),R&&R.forEach(T=>{const w=o.get(T.cfId);w&&w.setValue(M.startRow,M.startColumn,1)})})},n=(u,s,v)=>{var E;const{range:o,unitId:f,subUnitId:d}=this._painterConfig,p=u!==f||d!==s,h=new Map,b=[],S=[];if(!u||!s||!f||!d)return e();const C=(E=this._conditionalFormattingRuleModel.getSubunitRules(f,d))!=null?E:[];C==null||C.forEach(M=>{const{ranges:R,cfId:g}=M;if(R.some(T=>i.Rectangle.intersects(o,T))){const T=new i.ObjectMatrix;p||R.forEach(w=>{i.Range.foreach(w,(I,k)=>{T.setValue(I,k,1)})}),h.set(g,T)}});const N={row:o.startRow,col:o.startColumn};return Pt(o,v).forEach(M=>{l(N,{row:M.startRange.startRow,col:M.startRange.startColumn},M.repeatRelativeRange,h,{targetUnitId:u,targetSubUnitId:s})}),h.forEach((M,R)=>{if(p){const g=this._conditionalFormattingRuleModel.getRule(u,s,R),T=U.findAllRectangle(U.createTopMatrixFromMatrix(M));if(g)if(T.length){const w={unitId:u,subUnitId:s,rule:{...g,ranges:T}};b.push({id:t.SetConditionalRuleMutation.id,params:w}),S.push(...t.setConditionalRuleMutationUndoFactory(this._injector,w))}else{const w={unitId:u,subUnitId:s,cfId:g.cfId};b.push({id:t.DeleteConditionalRuleMutation.id,params:w}),S.push(...t.DeleteConditionalRuleMutationUndoFactory(this._injector,w))}else if(T.length){const w=this._conditionalFormattingRuleModel.getRule(f,d,R);if(w){const I={unitId:u,subUnitId:s,rule:{...i.Tools.deepClone(w),cfId:this._conditionalFormattingRuleModel.createCfId(u,s),ranges:T}};b.push({id:t.AddConditionalRuleMutation.id,params:I}),S.push(t.AddConditionalRuleMutationUndoFactory(this._injector,I))}}}else{const g=this._conditionalFormattingRuleModel.getRule(f,d,R);if(!g)return;const T=U.findAllRectangle(U.createTopMatrixFromMatrix(M));if(T.length){const w={unitId:f,subUnitId:d,rule:{...g,ranges:T}};b.push({id:t.SetConditionalRuleMutation.id,params:w}),S.push(...t.setConditionalRuleMutationUndoFactory(this._injector,w))}else{const w={unitId:f,subUnitId:d,cfId:g.cfId};b.push({id:t.DeleteConditionalRuleMutation.id,params:w}),S.push(...t.DeleteConditionalRuleMutationUndoFactory(this._injector,w))}}}),{undos:S,redos:b}},a={id:t.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:u=>{var s,v,o;switch(u){case W.FormatPainterStatus.INFINITE:case W.FormatPainterStatus.ONCE:{const f=(s=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getUnitId(),d=(o=(v=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET))==null?void 0:v.getActiveSheet())==null?void 0:o.getSheetId(),p=this._sheetsSelectionsService.getCurrentLastSelection(),h=p==null?void 0:p.range;f&&d&&h&&(this._painterConfig={unitId:f,subUnitId:d,range:h});break}case W.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(u,s,v)=>this._painterConfig?n(u,s,v):{redos:[],undos:[]}};this._formatPainterService.addHook(a)}};je=kt([oe(0,i.Inject(i.Injector)),oe(1,i.Inject(i.IUniverInstanceService)),oe(2,i.Inject(W.IFormatPainterService)),oe(3,i.Inject(U.SheetsSelectionsService)),oe(4,i.Inject(t.ConditionalFormattingRuleModel)),oe(5,i.Inject(t.ConditionalFormattingViewModel))],je);var Dt=Object.getOwnPropertyDescriptor,Lt=(r,e,l,n)=>{for(var a=n>1?void 0:n?Dt(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},tr=(r,e)=>(l,n)=>e(l,n,r);let Ae=class extends i.Disposable{constructor(r,e,l){super(),this._conditionalFormattingViewModel=r,this._univerInstanceService=e,this._renderManagerService=l,this._init()}_init(){const r=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET),e=l=>{const n=l.getUnitId(),a=this._renderManagerService.getRenderById(n);if(!a)return;const u=a.with(W.SheetSkeletonManagerService);this.disposeWithMe(u.currentSkeleton$.subscribe(s=>{if(s){const v=s.skeleton.rowColumnSegment,o=v.endColumn-v.startColumn+1,d=(v.endRow-v.startRow+1)*o*9,p=Math.max(t.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,d);this._conditionalFormattingViewModel.setCacheLength(p)}}))};r&&e(r),this._univerInstanceService.getCurrentTypeOfUnit$(i.UniverInstanceType.UNIVER_SHEET).subscribe(l=>{l&&e(l)})}};Ae=Lt([tr(0,i.Inject(t.ConditionalFormattingViewModel)),tr(1,i.IUniverInstanceService),tr(2,ar.IRenderManagerService)],Ae);var jt=Object.defineProperty,At=Object.getOwnPropertyDescriptor,Ft=(r,e,l)=>e in r?jt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[e]=l,$t=(r,e,l,n)=>{for(var a=n>1?void 0:n?At(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},nr=(r,e)=>(l,n)=>e(l,n,r),Er=(r,e,l)=>Ft(r,typeof e!="symbol"?e+"":e,l);D.UniverSheetsConditionalFormattingUIPlugin=class extends i.Plugin{constructor(e=ke,l,n,a){super(),this._config=e,this._injector=l,this._commandService=n,this._configService=a;const{menu:u,...s}=i.merge({},ke,this._config);u&&this._configService.setConfig("menu",u,{merge:!0}),this._configService.setConfig(Tr,s),this._initCommand()}onStarting(){i.registerDependencies(this._injector,[[we],[_e],[Se],[Pe],[Te],[me],[Le],[se],[De],[D.ConditionalFormattingClearController],[je],[Ae]]),i.touchDependencies(this._injector,[[we]])}onReady(){i.touchDependencies(this._injector,[[Le],[me]])}onRendered(){i.touchDependencies(this._injector,[[Pe],[D.ConditionalFormattingClearController],[Se],[De],[se],[je],[Te],[_e],[Ae]])}_initCommand(){[He,Be,We,qe,Ge,Ze,ze,Ye,Ke,Ce].forEach(e=>{this._commandService.registerCommand(e)})}},Er(D.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${t.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),Er(D.UniverSheetsConditionalFormattingUIPlugin,"type",i.UniverInstanceType.UNIVER_SHEET),D.UniverSheetsConditionalFormattingUIPlugin=$t([i.DependentOn(t.UniverSheetsConditionalFormattingPlugin),nr(1,i.Inject(i.Injector)),nr(2,i.Inject(i.ICommandService)),nr(3,i.IConfigService)],D.UniverSheetsConditionalFormattingUIPlugin),D.AddAverageCfCommand=He,D.AddColorScaleConditionalRuleCommand=Be,D.AddDataBarConditionalRuleCommand=We,D.AddDuplicateValuesCfCommand=qe,D.AddNumberCfCommand=Ge,D.AddRankCfCommand=Ze,D.AddTextCfCommand=ze,D.AddTimePeriodCfCommand=Ye,D.AddUniqueValuesCfCommand=Ke,D.OpenConditionalFormattingOperator=Ce,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})}));
10
+ (function(D,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/ui"),require("react/jsx-runtime"),require("react"),require("@univerjs/design"),require("@univerjs/engine-formula"),require("@univerjs/sheets-formula-ui"),require("@univerjs/sheets-ui"),require("rxjs"),require("@univerjs/engine-render"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","@univerjs/sheets-conditional-formatting","@univerjs/ui","react/jsx-runtime","react","@univerjs/design","@univerjs/engine-formula","@univerjs/sheets-formula-ui","@univerjs/sheets-ui","rxjs","@univerjs/engine-render","rxjs/operators"],i):(D=typeof globalThis<"u"?globalThis:D||self,i(D.UniverSheetsConditionalFormattingUi={},D.UniverCore,D.UniverSheets,D.UniverSheetsConditionalFormatting,D.UniverUi,D.React,D.React,D.UniverDesign,D.UniverEngineFormula,D.UniverSheetsFormulaUi,D.UniverSheetsUi,D.rxjs,D.UniverEngineRender,D.rxjs.operators))})(this,(function(D,i,U,t,j,c,m,O,$e,pe,W,J,ar,fe){"use strict";var Wt=Object.defineProperty;var qt=(D,i,U)=>i in D?Wt(D,i,{enumerable:!0,configurable:!0,writable:!0,value:U}):D[i]=U;var re=(D,i,U)=>qt(D,typeof i!="symbol"?i+"":i,U);const He={type:i.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(r,e){if(!e)return!1;const{ranges:l,style:n,stopIfTrue:a,operator:u}=e,s=r.get(t.ConditionalFormattingRuleModel),v=r.get(i.ICommandService),o=r.get(i.IUniverInstanceService),f=U.getSheetCommandTarget(o);if(!f)return!1;const{unitId:d,subUnitId:p}=f,h=s.createCfId(d,p),b={ranges:l,cfId:h,stopIfTrue:!!a,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.average,operator:u,style:n}};return v.executeCommand(t.AddConditionalRuleMutation.id,{unitId:d,subUnitId:p,rule:b})}},Be={type:i.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(r,e){if(!e)return!1;const{ranges:l,config:n,stopIfTrue:a}=e,u=r.get(t.ConditionalFormattingRuleModel),s=r.get(i.ICommandService),v=r.get(i.IUniverInstanceService),o=U.getSheetCommandTarget(v);if(!o)return!1;const{unitId:f,subUnitId:d}=o,p=u.createCfId(f,d),h={ranges:l,cfId:p,stopIfTrue:!!a,rule:{type:t.CFRuleType.colorScale,config:n}};return s.executeCommand(t.AddConditionalRuleMutation.id,{unitId:f,subUnitId:d,rule:h})}},We={type:i.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(r,e){if(!e)return!1;const{ranges:l,min:n,max:a,nativeColor:u,positiveColor:s,isGradient:v,stopIfTrue:o,isShowValue:f}=e,d=r.get(t.ConditionalFormattingRuleModel),p=r.get(i.IUniverInstanceService),h=U.getSheetCommandTarget(p);if(!h)return!1;const{unitId:b,subUnitId:S}=h,C=r.get(i.ICommandService),N=d.createCfId(b,S),_={ranges:l,cfId:N,stopIfTrue:!!o,rule:{type:t.CFRuleType.dataBar,isShowValue:f,config:{min:n,max:a,nativeColor:u,positiveColor:s,isGradient:v}}};return C.executeCommand(t.AddConditionalRuleMutation.id,{unitId:b,subUnitId:S,rule:_})}},qe={type:i.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(r,e){if(!e)return!1;const{ranges:l,style:n,stopIfTrue:a}=e,u=r.get(t.ConditionalFormattingRuleModel),s=r.get(i.ICommandService),v=r.get(i.IUniverInstanceService),o=U.getSheetCommandTarget(v);if(!o)return!1;const{unitId:f,subUnitId:d}=o,p=u.createCfId(f,d),h={ranges:l,cfId:p,stopIfTrue:!!a,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.duplicateValues,style:n}};return s.executeCommand(t.AddConditionalRuleMutation.id,{unitId:f,subUnitId:d,rule:h})}},Ge={type:i.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(r,e){if(!e)return!1;const{ranges:l,style:n,stopIfTrue:a,operator:u,value:s}=e,v=r.get(t.ConditionalFormattingRuleModel),o=r.get(i.ICommandService),f=r.get(i.IUniverInstanceService),d=U.getSheetCommandTarget(f);if(!d)return!1;const{unitId:p,subUnitId:h}=d,b=v.createCfId(p,h);let S;if([t.CFNumberOperator.between,t.CFNumberOperator.notBetween].includes(u)){const C=s;if(C.length!==2||!Array.isArray(C))return!1;S={ranges:l,cfId:b,stopIfTrue:!!a,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.number,operator:u,style:n,value:C}}}else{const C=s;if(typeof C!="number")return!1;S={ranges:l,cfId:b,stopIfTrue:!!a,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.number,operator:u,style:n,value:C}}}return o.executeCommand(t.AddConditionalRuleMutation.id,{unitId:p,subUnitId:h,rule:S})}},Ze={type:i.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(r,e){if(!e)return!1;const{ranges:l,style:n,stopIfTrue:a,isPercent:u,isBottom:s,value:v}=e,o=r.get(t.ConditionalFormattingRuleModel),f=r.get(i.IUniverInstanceService),d=r.get(i.ICommandService),p=U.getSheetCommandTarget(f);if(!p)return!1;const{unitId:h,subUnitId:b}=p,S=o.createCfId(h,b),C={ranges:l,cfId:S,stopIfTrue:!!a,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.rank,isPercent:u,isBottom:s,style:n,value:v}};return d.executeCommand(t.AddConditionalRuleMutation.id,{unitId:h,subUnitId:b,rule:C})}},ze={type:i.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(r,e){if(!e)return!1;const{ranges:l,style:n,stopIfTrue:a,operator:u,value:s}=e,v=r.get(t.ConditionalFormattingRuleModel),o=r.get(i.IUniverInstanceService),f=U.getSheetCommandTarget(o);if(!f)return!1;const{unitId:d,subUnitId:p}=f,h=r.get(i.ICommandService),b=v.createCfId(d,p),S={ranges:l,cfId:b,stopIfTrue:!!a,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.text,operator:u,style:n,value:s}};return h.executeCommand(t.AddConditionalRuleMutation.id,{unitId:d,subUnitId:p,rule:S})}},Ye={type:i.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(r,e){if(!e)return!1;const{ranges:l,style:n,stopIfTrue:a,operator:u}=e,s=r.get(t.ConditionalFormattingRuleModel),v=r.get(i.IUniverInstanceService),o=r.get(i.ICommandService),f=U.getSheetCommandTarget(v);if(!f)return!1;const{unitId:d,subUnitId:p}=f,h=s.createCfId(d,p),b={ranges:l,cfId:h,stopIfTrue:!!a,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.timePeriod,operator:u,style:n}};return o.executeCommand(t.AddConditionalRuleMutation.id,{unitId:d,subUnitId:p,rule:b})}},Ke={type:i.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(r,e){if(!e)return!1;const{ranges:l,style:n,stopIfTrue:a}=e,u=r.get(t.ConditionalFormattingRuleModel),s=r.get(i.IUniverInstanceService),v=r.get(i.ICommandService),o=U.getSheetCommandTarget(s);if(!o)return!1;const{unitId:f,subUnitId:d}=o,p=u.createCfId(f,d),h={ranges:l,cfId:p,stopIfTrue:!!a,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.uniqueValues,style:n}};return v.executeCommand(t.AddConditionalRuleMutation.id,{unitId:f,subUnitId:d,rule:h})}};var K=function(){return K=Object.assign||function(r){for(var e,l=1,n=arguments.length;l<n;l++){e=arguments[l];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=e[a])}return r},K.apply(this,arguments)},Rr=function(r,e){var l={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(l[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(r);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(r,n[a])&&(l[n[a]]=r[n[a]]);return l},X=m.forwardRef(function(r,e){var l=r.icon,n=r.id,a=r.className,u=r.extend,s=Rr(r,["icon","id","className","extend"]),v="univerjs-icon univerjs-icon-".concat(n," ").concat(a||"").trim(),o=m.useRef("_".concat(Or()));return lr(l,"".concat(n),{defIds:l.defIds,idSuffix:o.current},K({ref:e,className:v},s),u)});function lr(r,e,l,n,a){return m.createElement(r.tag,K(K({key:e},Mr(r,l,a)),n),(Vr(r,l).children||[]).map(function(u,s){return lr(u,"".concat(e,"-").concat(r.tag,"-").concat(s),l,void 0,a)}))}function Mr(r,e,l){var n=K({},r.attrs);l!=null&&l.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=l.colorChannel1),r.tag==="mask"&&n.id&&(n.id=n.id+e.idSuffix),Object.entries(n).forEach(function(u){var s=u[0],v=u[1];s==="mask"&&typeof v=="string"&&(n[s]=v.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))});var a=e.defIds;return!a||a.length===0||(r.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(function(u){var s=u[0],v=u[1];typeof v=="string"&&(n[s]=v.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),n}function Vr(r,e){var l,n=e.defIds;return!n||n.length===0?r:r.tag==="defs"&&(!((l=r.children)===null||l===void 0)&&l.length)?K(K({},r),{children:r.children.map(function(a){return typeof a.attrs.id=="string"&&n&&n.includes(a.attrs.id)?K(K({},a),{attrs:K(K({},a.attrs),{id:a.attrs.id+e.idSuffix})}):a})}):r}function Or(){return Math.random().toString(36).substring(2,8)}X.displayName="UniverIcon";var Ur={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M4.65791 1.30005C3.77355 1.30005 3.05664 2.01696 3.05664 2.90132V12.8588C3.05664 13.8755 3.88086 14.6998 4.89759 14.6998H9.1016C11.2233 14.6998 12.9433 12.9798 12.9433 10.8581C12.9433 9.13925 11.8145 7.68407 10.2578 7.1934C10.8806 6.56856 11.2655 5.70659 11.2655 4.75472C11.2655 2.84676 9.71883 1.30005 7.81087 1.30005H4.65791ZM4.25664 2.90132C4.25664 2.6797 4.4363 2.50005 4.65791 2.50005H7.81087C9.05609 2.50005 10.0655 3.5095 10.0655 4.75472C10.0655 5.99993 9.05609 7.00938 7.81087 7.00938H4.25664V2.90132ZM4.25664 12.8588V8.21636H9.1016C10.5606 8.21636 11.7433 9.39909 11.7433 10.8581C11.7433 12.317 10.5606 13.4998 9.1016 13.4998H4.89759C4.5436 13.4998 4.25664 13.2128 4.25664 12.8588Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ur=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"bold-icon",ref:e,icon:Ur}))});ur.displayName="BoldIcon";var kr={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",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 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.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.64443C14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928L9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171C10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778L9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539C9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263L6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539C5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778L6.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"}}]},Ee=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"delete-icon",ref:e,icon:kr}))});Ee.displayName="DeleteIcon";var Pr={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"colorChannel1",d:"M1.98682 13.4992C1.98682 12.5603 2.74793 11.7992 3.68682 11.7992H14.2868C15.2257 11.7992 15.9868 12.5603 15.9868 13.4992V13.4992C15.9868 14.4381 15.2257 15.1992 14.2868 15.1992H3.68682C2.74793 15.1992 1.98682 14.4381 1.98682 13.4992V13.4992Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M10.3014 1.70389C9.85268 0.479568 8.12109 0.479557 7.67238 1.70389L4.72235 9.75326C4.60832 10.0644 4.76811 10.4091 5.07924 10.5231C5.39038 10.6371 5.73504 10.4773 5.84907 10.1662L6.99975 7.02646C7.03588 7.03324 7.07314 7.03679 7.11123 7.03679H10.9778L12.1247 10.1662C12.2387 10.4773 12.5834 10.6371 12.8945 10.5231C13.2057 10.4091 13.3654 10.0644 13.2514 9.75326L10.3014 1.70389ZM10.538 5.83679L9.17467 2.11682C9.11057 1.94192 8.8632 1.94192 8.7991 2.11682L7.43576 5.83679H10.538Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ir=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"font-color-double-icon",ref:e,icon:Pr}))});ir.displayName="FontColorDoubleIcon";var Dr={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",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"}}]},sr=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"increase-icon",ref:e,icon:Dr}))});sr.displayName="IncreaseIcon";var Lr={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M9.80385 1.40005H11.9997C12.3311 1.40005 12.5997 1.66868 12.5997 2.00005C12.5997 2.33143 12.3311 2.60005 11.9997 2.60005H10.1185L7.12251 13.4001H9.33324C9.66461 13.4001 9.93324 13.6687 9.93324 14.0001C9.93324 14.3314 9.66461 14.6001 9.33324 14.6001H6.34785C6.33847 14.6003 6.32905 14.6003 6.31962 14.6001H3.9999C3.66853 14.6001 3.3999 14.3314 3.3999 14.0001C3.3999 13.6687 3.66853 13.4001 3.9999 13.4001H5.87719L8.87322 2.60005H6.66641C6.33504 2.60005 6.06641 2.33143 6.06641 2.00005C6.06641 1.66868 6.33504 1.40005 6.66641 1.40005H9.52916C9.61698 1.37929 9.71064 1.3781 9.80385 1.40005Z"}}]},cr=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"italic-icon",ref:e,icon:Lr}))});cr.displayName="ItalicIcon";var jr={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",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"}}]},Xe=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"more-down-icon",ref:e,icon:jr}))});Xe.displayName="MoreDownIcon";var Ar={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.01281 1.36643C8.79386 0.585377 10.0602 0.585378 10.8412 1.36643L12.9223 3.44752C13.7034 4.22857 13.7034 5.4949 12.9223 6.27595L9.36445 9.83383C8.5834 10.6149 7.31707 10.6149 6.53602 9.83383L4.45493 7.75273C3.67388 6.97168 3.67388 5.70535 4.45493 4.9243L8.01281 1.36643ZM9.9927 2.21495C9.68028 1.90253 9.17375 1.90253 8.86133 2.21495L5.30346 5.77283L5.29671 5.77966L10.839 6.66224L12.0738 5.42742C12.3862 5.115 12.3862 4.60847 12.0738 4.29605L9.9927 2.21495Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M14.5179 9.48875C14.5179 9.99175 14.1101 10.3995 13.607 10.3995C13.1041 10.3995 12.6963 9.99175 12.6963 9.48875C12.6963 9.1773 13.0455 8.59966 13.3114 8.20487C13.4549 7.99177 13.7591 7.99177 13.9027 8.20486C14.1687 8.59965 14.5179 9.1773 14.5179 9.48875Z"}},{tag:"path",attrs:{fill:"colorChannel1",d:"M1.98682 13.4992C1.98682 12.5603 2.74793 11.7992 3.68682 11.7992H14.2868C15.2257 11.7992 15.9868 12.5603 15.9868 13.4992V13.4992C15.9868 14.4381 15.2257 15.1992 14.2868 15.1992H3.68682C2.74793 15.1992 1.98682 14.4381 1.98682 13.4992V13.4992Z"}}]},or=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"paint-bucket-double-icon",ref:e,icon:Ar}))});or.displayName="PaintBucketDoubleIcon";var Fr={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_622_8",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 4C7 3.44772 6.55228 3 6 3C5.44772 3 5 3.44772 5 4C5 4.55228 5.44772 5 6 5Z"}},{tag:"path",attrs:{d:"M6 9C6.55228 9 7 8.55229 7 8C7 7.44772 6.55228 7 6 7C5.44772 7 5 7.44772 5 8C5 8.55229 5.44772 9 6 9Z"}},{tag:"path",attrs:{d:"M7 12C7 12.5523 6.55228 13 6 13C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11C6.55228 11 7 11.4477 7 12Z"}},{tag:"path",attrs:{d:"M10 5C10.5523 5 11 4.55228 11 4C11 3.44772 10.5523 3 10 3C9.44771 3 9 3.44772 9 4C9 4.55228 9.44771 5 10 5Z"}},{tag:"path",attrs:{d:"M11 8C11 8.55229 10.5523 9 10 9C9.44771 9 9 8.55229 9 8C9 7.44772 9.44771 7 10 7C10.5523 7 11 7.44772 11 8Z"}},{tag:"path",attrs:{d:"M10 13C10.5523 13 11 12.5523 11 12C11 11.4477 10.5523 11 10 11C9.44771 11 9 11.4477 9 12C9 12.5523 9.44771 13 10 13Z"}}]}]},dr=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"sequence-icon",ref:e,icon:Fr}))});dr.displayName="SequenceIcon";var $r={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_436_41",width:17,height:17,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M.35.48H16.35V16.48H.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"}}]}]},he=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"slash-icon",ref:e,icon:$r}))});he.displayName="SlashIcon";var Hr={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.00033 1.20996C6.43345 1.20996 5.23596 1.88077 4.64804 2.94304C4.06338 3.99943 4.15123 5.32084 4.90099 6.47062C5.08199 6.7482 5.45374 6.82648 5.73131 6.64548C6.00888 6.46448 6.08716 6.09273 5.90616 5.81516C5.36418 4.98402 5.35768 4.13897 5.69797 3.52412C6.035 2.91515 6.78176 2.40996 8.00033 2.40996C9.19423 2.40996 10.0017 2.93409 10.5236 3.46755C10.7871 3.73682 10.9756 4.00712 11.0974 4.20903C11.158 4.30951 11.2013 4.39164 11.2284 4.44625C11.2419 4.47351 11.2514 4.49377 11.2568 4.50588L11.2621 4.51771C11.3901 4.82216 11.7407 4.96686 12.046 4.83992C12.3519 4.71267 12.4968 4.36149 12.3695 4.05552L11.8231 4.28278C12.3695 4.05552 12.3697 4.0558 12.3695 4.05552L12.3691 4.05437L12.3685 4.05298L12.367 4.04953L12.3629 4.03993L12.3498 4.01036C12.3388 3.98619 12.3234 3.95326 12.3033 3.91282C12.2632 3.83203 12.2043 3.72072 12.1249 3.58908C11.9666 3.32674 11.7235 2.97805 11.3814 2.62834C10.6921 1.92381 9.59192 1.20996 8.00033 1.20996Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M2.11953 8.5999H7.88935C10.1109 9.46549 10.5895 10.7649 10.4268 11.6869C10.2475 12.703 9.26939 13.5898 8.00009 13.5898C6.63323 13.5898 5.77631 13.0502 5.25534 12.528C4.99021 12.2623 4.80823 11.9965 4.69365 11.7993C4.63659 11.7011 4.59698 11.6211 4.5727 11.5686C4.56059 11.5424 4.55236 11.5231 4.54774 11.512L4.54352 11.5016C4.4267 11.193 4.0823 11.0363 3.77279 11.1516C3.46228 11.2673 3.30438 11.6129 3.4201 11.9234L3.9649 11.7203C3.4201 11.9234 3.41998 11.9231 3.4201 11.9234L3.4206 11.9247L3.42118 11.9263L3.42262 11.9301L3.42661 11.9403C3.42977 11.9484 3.43394 11.9588 3.43914 11.9713C3.44956 11.9965 3.46418 12.0304 3.48334 12.0719C3.52161 12.1547 3.57828 12.2682 3.65608 12.4021C3.81124 12.6692 4.0534 13.0223 4.40584 13.3756C5.12 14.0914 6.27196 14.7898 8.00009 14.7898C9.82574 14.7898 11.3236 13.5101 11.6085 11.8955C11.812 10.7422 11.3901 9.55402 10.2665 8.5999H13.8804C14.2117 8.5999 14.4803 8.33127 14.4803 7.9999C14.4803 7.66853 14.2117 7.3999 13.8804 7.3999H8.01411C8.0048 7.39968 7.99551 7.39969 7.98625 7.3999H2.11953C1.78816 7.3999 1.51953 7.66853 1.51953 7.9999C1.51953 8.33127 1.78816 8.5999 2.11953 8.5999Z"}}]},vr=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"strikethrough-icon",ref:e,icon:Hr}))});vr.displayName="StrikethroughIcon";var Br={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M4.46416 2.03237C4.46416 1.701 4.19553 1.43237 3.86416 1.43237C3.53279 1.43237 3.26416 1.701 3.26416 2.03237V7.33338C3.26416 10.0313 5.35834 12.2667 7.9999 12.2667C10.6415 12.2667 12.7356 10.0313 12.7356 7.33338V2.03237C12.7356 1.701 12.467 1.43237 12.1356 1.43237C11.8043 1.43237 11.5356 1.701 11.5356 2.03237V7.33338C11.5356 9.42194 9.92656 11.0667 7.9999 11.0667C6.07325 11.0667 4.46416 9.42194 4.46416 7.33338V2.03237Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M2.66641 13.4663C2.33504 13.4663 2.06641 13.7349 2.06641 14.0663C2.06641 14.3977 2.33504 14.6663 2.66641 14.6663H13.3331C13.6644 14.6663 13.9331 14.3977 13.9331 14.0663C13.9331 13.7349 13.6644 13.4663 13.3331 13.4663H2.66641Z"}}]},pr=m.forwardRef(function(r,e){return m.createElement(X,Object.assign({},r,{id:"underline-icon",ref:e,icon:Br}))});pr.displayName="UnderlineIcon";const te=r=>{const{color:e,onChange:l,disable:n=!1,Icon:a=or,className:u}=r,s=m.useMemo(()=>new i.ColorKit(e),[e]),v=()=>{const o={className:O.clsx("univer-fill-primary-600",n&&u),extend:{colorChannel1:s.isValid?e:""}};return c.jsx(a,{...o})};return n?v():c.jsx(O.Dropdown,{overlay:c.jsx("div",{className:"univer-rounded-lg univer-p-4",children:c.jsx(O.ColorPicker,{value:e,onChange:l})}),children:c.jsx("span",{className:O.clsx("univer-flex univer-cursor-pointer univer-items-center univer-rounded univer-p-1 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",u),children:v()})})},ue=r=>{var u,s,v,o,f;const e=r.rule;if(!e)return null;const l=m.useMemo(()=>{if(e.type===t.CFRuleType.colorScale){const d=e.config.map((b,S)=>({color:new i.ColorKit(b.color),value:S})),p=d.length-1;return new Array(5).fill("").map((b,S,C)=>S*p/(C.length-1)).map(b=>t.getColorScaleFromValue(d,b))}return null},[e]),n=m.useMemo(()=>{if(e.type===t.CFRuleType.iconSet)return e.config.map(d=>{const p=t.iconMap[d.iconType];return p&&p[Number(d.iconId)]})},[e]),a="univer-pointer-events-none univer-flex univer-h-5 univer-min-w-[72px] univer-items-center univer-justify-center univer-text-xs";switch(e.type){case t.CFRuleType.dataBar:{const{isGradient:d}=e.config,p=d?`linear-gradient(to right, ${e.config.positiveColor||t.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,h=d?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||t.defaultDataBarNativeColor})`:e.config.nativeColor;return c.jsxs("div",{className:a,children:[c.jsx("div",{className:"univer-h-full univer-w-1/2 univer-border univer-border-solid",style:{background:h,borderColor:(u=e.config.nativeColor)!=null?u:t.defaultDataBarNativeColor}}),c.jsx("div",{className:"univer-h-full univer-w-1/2 univer-border univer-border-solid",style:{background:p,borderColor:(s=e.config.positiveColor)!=null?s:t.defaultDataBarPositiveColor}})]})}case t.CFRuleType.colorScale:return l&&c.jsx("div",{className:a,children:l.map((d,p)=>c.jsx("div",{className:"univer-h-full",style:{width:`${100/l.length}%`,background:d}},p))});case t.CFRuleType.iconSet:return n&&c.jsx("div",{className:a,children:n.map((d,p)=>d?c.jsx("img",{className:"univer-h-full",src:d,draggable:!1},p):c.jsx(he,{},p))});case t.CFRuleType.highlightCell:{const{ul:d,st:p,it:h,bl:b,bg:S,cl:C}=e.style,N=(d==null?void 0:d.s)===i.BooleanNumber.TRUE,_=(p==null?void 0:p.s)===i.BooleanNumber.TRUE,E=h===i.BooleanNumber.TRUE,M=b===i.BooleanNumber.TRUE,R=(v=S==null?void 0:S.rgb)!=null?v:t.DEFAULT_BG_COLOR,g=(o=C==null?void 0:C.rgb)!=null?o:t.DEFAULT_FONT_COLOR,T={textDecoration:(f=`${N?"underline":""} ${_?"line-through":""}`.replace(/^ /,""))!=null?f:void 0,backgroundColor:R,color:g};return c.jsx("div",{className:O.clsx(a,{"univer-font-bold":M,"univer-italic":E}),style:T,children:"123"})}}},ge=O.clsx("univer-mt-5 univer-px-1 univer-py-2 univer-rounded",O.borderClassName),ne=(r,e)=>({label:e.t(`sheet.cf.valueType.${r}`),value:r}),Je=r=>{var S;const{type:e,className:l,onChange:n,id:a,value:u}=r,s=j.useDependency(i.IUniverInstanceService),v=s.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getUnitId(),o=(S=s.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:S.getSheetId(),f=m.useMemo(()=>String(u).startsWith("=")?String(u):"=",[u]),d=m.useMemo(()=>[t.CFValueType.max,t.CFValueType.min,"none"].includes(e)?{disabled:!0}:[t.CFValueType.percent,t.CFValueType.percentile].includes(e)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[e]),p=m.useRef(null),[h,b]=m.useState(!1);return j.useSidebarClick(C=>{var _;((_=p.current)==null?void 0:_.isClickOutSide(C))&&b(!1)}),e===t.CFValueType.formula?c.jsx("div",{className:"univer-ml-1 univer-w-full",children:c.jsx(pe.FormulaEditor,{ref:p,className:O.clsx("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors hover:univer-border-primary-600 dark:!univer-bg-gray-700 dark:!univer-text-white [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent",O.borderClassName),initValue:f,unitId:v,subUnitId:o,isFocus:h,onChange:(C="")=>{n(C||"")},onFocus:()=>b(!0)})}):c.jsx(O.InputNumber,{className:l,value:Number(r.value)||0,onChange:C=>r.onChange(C||0),...d})},Wr=r=>{var L;const{interceptorManager:e}=r,l=j.useDependency(i.LocaleService),n=((L=r.rule)==null?void 0:L.type)===t.CFRuleType.colorScale?r.rule:void 0,a=[ne(t.CFValueType.num,l),ne(t.CFValueType.percent,l),ne(t.CFValueType.percentile,l),ne(t.CFValueType.formula,l)],u=[ne(t.CFValueType.min,l),...a],s=[ne("none",l),...a],v=[ne(t.CFValueType.max,l),...a],[o,f]=m.useState(()=>{var x;const y=t.CFValueType.min;return n&&((x=n.config[0])==null?void 0:x.value.type)||y}),[d,p]=m.useState(()=>{var x;const y="none";return!n||n.config.length!==3?y:((x=n.config[1])==null?void 0:x.value.type)||y}),[h,b]=m.useState(()=>{var x;const y=t.CFValueType.max;return n&&((x=n.config[n.config.length-1])==null?void 0:x.value.type)||y}),[S,C]=m.useState(()=>{if(!n)return 10;const x=n.config[0];return(x==null?void 0:x.value.value)===void 0?10:x==null?void 0:x.value.value}),[N,_]=m.useState(()=>{var F;if(!n||n.config.length!==3)return 50;const x=(F=n.config[1])==null?void 0:F.value.value;return x===void 0?50:x}),[E,M]=m.useState(()=>{var F;if(!n)return 90;const x=(F=n.config[n.config.length-1])==null?void 0:F.value.value;return x===void 0?90:x}),[R,g]=m.useState(()=>{var x;const y="#d0d9fb";return n&&((x=n.config[0])==null?void 0:x.color)||y}),[T,w]=m.useState(()=>{var x;const y="#7790f3";return!n||n.config.length!==3?y:((x=n.config[1])==null?void 0:x.color)||y}),[I,k]=m.useState(()=>{var x;const y="#2e55ef";return n&&((x=n.config[n.config.length-1])==null?void 0:x.color)||y}),V=m.useMemo(()=>y=>{const{minType:x,medianType:F,maxType:G,minValue:Q,medianValue:ee,maxValue:de,minColor:ve,medianColor:A,maxColor:$}=y,B=[];return B.push({color:ve,value:{type:x,value:Q}}),F!=="none"&&B.push({color:A,value:{type:F,value:ee}}),B.push({color:$,value:{type:G,value:de}}),{config:B.map((Z,z)=>({...Z,index:z})),type:t.CFRuleType.colorScale}},[]);m.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return V({minType:o,medianType:d,maxType:h,minValue:S,medianValue:N,maxValue:E,minColor:R,medianColor:T,maxColor:I})}}),[V,o,d,h,S,N,E,R,T,I,e]);const P=y=>{r.onChange(V(y))};return c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:l.t("sheet.cf.panel.styleRule")}),c.jsx("div",{className:ge,children:c.jsx(ue,{rule:V({minType:o,medianType:d,maxType:h,minValue:S,medianValue:N,maxValue:E,minColor:R,medianColor:T,maxColor:I})})}),c.jsx("div",{className:"univer-mt-3 univer-text-xs univer-text-gray-600 dark:!univer-text-gray-200",children:l.t("sheet.cf.valueType.min")}),c.jsxs("div",{className:"univer-mt-3 univer-flex univer-h-8 univer-items-center",children:[c.jsx(O.Select,{className:"univer-flex-shrink-0",options:u,value:o,onChange:y=>{f(y);const x=t.createDefaultValueByValueType(y,10);C(x),P({minType:y,medianType:d,maxType:h,minValue:x,medianValue:N,maxValue:E,minColor:R,medianColor:T,maxColor:I})}}),c.jsx(Je,{id:"min",className:"univer-ml-1",value:S,type:o,onChange:y=>{C(y),P({minType:o,medianType:d,maxType:h,minValue:y,medianValue:N,maxValue:E,minColor:R,medianColor:T,maxColor:I})}}),c.jsx(te,{className:"univer-ml-1",color:R,onChange:y=>{g(y),P({minType:o,medianType:d,maxType:h,minValue:S,medianValue:N,maxValue:E,minColor:y,medianColor:T,maxColor:I})}})]}),c.jsx("div",{className:"univer-text-gray-600dark:!univer-text-gray-200 univer-mt-3 univer-text-xs",children:l.t("sheet.cf.panel.medianValue")}),c.jsxs("div",{className:"univer-mt-3 univer-flex univer-h-8 univer-items-center",children:[c.jsx(O.Select,{className:"univer-flex-shrink-0",options:s,value:d,onChange:y=>{p(y);const x=t.createDefaultValueByValueType(y,50);_(x),P({minType:o,medianType:y,maxType:h,minValue:S,medianValue:x,maxValue:E,minColor:R,medianColor:T,maxColor:I})}}),c.jsx(Je,{id:"median",className:"univer-ml-1",value:N,type:d,onChange:y=>{_(y),P({minType:o,medianType:d,maxType:h,minValue:S,medianValue:y,maxValue:E,minColor:R,medianColor:T,maxColor:I})}}),d!=="none"&&c.jsx(te,{className:"univer-ml-1",color:T,onChange:y=>{w(y),P({minType:o,medianType:d,maxType:h,minValue:S,medianValue:N,maxValue:E,minColor:R,medianColor:y,maxColor:I})}})]}),c.jsx("div",{className:"univer-mt-3 univer-text-xs univer-text-gray-600 dark:!univer-text-gray-200",children:l.t("sheet.cf.valueType.max")}),c.jsxs("div",{className:"univer-mt-3 univer-flex univer-h-8 univer-items-center",children:[c.jsx(O.Select,{className:"univer-flex-shrink-0",options:v,value:h,onChange:y=>{b(y);const x=t.createDefaultValueByValueType(y,90);M(x),P({minType:o,medianType:d,maxType:y,minValue:S,medianValue:N,maxValue:x,minColor:R,medianColor:T,maxColor:I})}}),c.jsx(Je,{id:"max",className:"univer-ml-1",value:E,type:h,onChange:y=>{M(y),P({minType:o,medianType:d,maxType:h,minValue:S,medianValue:N,maxValue:y,minColor:R,medianColor:T,maxColor:I})}}),c.jsx(te,{className:"univer-ml-1",color:I,onChange:y=>{k(y),P({minType:o,medianType:d,maxType:h,minValue:S,medianValue:N,maxValue:E,minColor:R,medianColor:T,maxColor:y})}})]})]})},ie=(r,e)=>({label:e.t(`sheet.cf.valueType.${r}`),value:r}),fr=r=>{var C;const{onChange:e,className:l,value:n,type:a,id:u,disabled:s=!1}=r,v=j.useDependency(i.IUniverInstanceService),o=v.getCurrentUnitOfType(i.UniverInstanceType.UNIVER_SHEET).getUnitId(),f=(C=v.getCurrentUnitOfType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:C.getSheetId(),d=m.useRef(null),[p,h]=m.useState(!1);j.useSidebarClick(N=>{var E;((E=d.current)==null?void 0:E.isClickOutSide(N))&&h(!1)});const b=m.useRef(n),S=m.useMemo(()=>[t.CFValueType.percentile,t.CFValueType.percent].includes(a)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[a]);if(a===t.CFValueType.formula){const N=String(b.current).startsWith("=")?String(b.current)||"":"=";return c.jsx("div",{className:"univer-ml-3 univer-w-full",children:c.jsx(pe.FormulaEditor,{ref:d,className:O.clsx("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors hover:univer-border-primary-600 dark:!univer-bg-gray-700 dark:!univer-text-white [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent",O.borderClassName),initValue:N,unitId:o,subUnitId:f,isFocus:p,onChange:(_="")=>{e(_||"")},onFocus:()=>h(!0)})})}return c.jsx(O.InputNumber,{className:l,value:Number(n)||0,disabled:s,onChange:N=>{e(N||0)},...S})},qr=r=>{var L;const{interceptorManager:e}=r,l=j.useDependency(i.LocaleService),n=((L=r.rule)==null?void 0:L.type)===t.CFRuleType.dataBar?r.rule:void 0,[a,u]=m.useState(()=>{var x;return n&&(x=n.config)!=null&&x.isGradient?"1":"0"}),[s,v]=m.useState(()=>{var y;return n&&((y=n.config)==null?void 0:y.positiveColor)||t.defaultDataBarPositiveColor}),[o,f]=m.useState(()=>{var y;return n&&((y=n.config)==null?void 0:y.nativeColor)||t.defaultDataBarNativeColor}),d=[ie(t.CFValueType.num,l),ie(t.CFValueType.percent,l),ie(t.CFValueType.percentile,l),ie(t.CFValueType.formula,l)],p=[ie(t.CFValueType.min,l),...d],h=[ie(t.CFValueType.max,l),...d],[b,S]=m.useState(()=>{var x;const y=p[0].value;return n&&((x=n.config)==null?void 0:x.min.type)||y}),[C,N]=m.useState(()=>{var x;const y=h[0].value;return n&&((x=n.config)==null?void 0:x.max.type)||y}),[_,E]=m.useState(()=>{var F;if(!n)return 0;const x=((F=n.config)==null?void 0:F.min)||{};return x.type===t.CFValueType.formula?x.value||"=":x.value||0}),[M,R]=m.useState(()=>{var F;if(!n)return 100;const x=((F=n.config)==null?void 0:F.max)||{};return x.type===t.CFValueType.formula?x.value||"=":x.value===void 0?100:x.value}),[g,T]=m.useState(()=>n?n.isShowValue===void 0?!0:!!n.isShowValue:!0),w=y=>({config:{min:{type:y.minValueType,value:y.minValue},max:{type:y.maxValueType,value:y.maxValue},isGradient:y.isGradient==="1",positiveColor:y.positiveColor||t.defaultDataBarPositiveColor,nativeColor:y.nativeColor||t.defaultDataBarNativeColor},type:t.CFRuleType.dataBar,isShowValue:y.isShowValue});m.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return w({isGradient:a,minValue:_,minValueType:b,maxValue:M,maxValueType:C,positiveColor:s,nativeColor:o,isShowValue:g})}}),[a,_,b,M,C,s,o,e,g]);const I=y=>{r.onChange(w(y))},k=y=>{v(y),I({isGradient:a,minValue:_,minValueType:b,maxValue:M,maxValueType:C,positiveColor:y,nativeColor:o,isShowValue:g})},V=y=>{f(y),I({isGradient:a,minValue:_,minValueType:b,maxValue:M,maxValueType:C,positiveColor:s,nativeColor:y,isShowValue:g})},P=y=>d.map(x=>x.value).includes(y);return c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:l.t("sheet.cf.panel.styleRule")}),c.jsx("div",{className:ge,children:c.jsx(ue,{rule:w({isGradient:a,minValue:_,minValueType:b,maxValue:M,maxValueType:C,positiveColor:s,nativeColor:o,isShowValue:g})})}),c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:l.t("sheet.cf.panel.fillType")}),c.jsxs("div",{className:"univer-ml-1 univer-mt-3 univer-flex univer-items-center",children:[c.jsxs(O.RadioGroup,{value:a,onChange:y=>{u(y),I({isGradient:y,minValue:_,minValueType:b,maxValue:M,maxValueType:C,positiveColor:s,nativeColor:o,isShowValue:g})},children:[c.jsx(O.Radio,{value:"0",children:c.jsx("span",{className:"univer-text-xs",children:l.t("sheet.cf.panel.pureColor")})}),c.jsx(O.Radio,{value:"1",children:c.jsx("span",{className:"univer-text-xs",children:l.t("sheet.cf.panel.gradient")})})]}),c.jsxs("div",{className:"univer-ml-6 univer-flex univer-items-center univer-text-xs",children:[c.jsx(O.Checkbox,{checked:!g,onChange:y=>{T(!y),I({isGradient:y,minValue:_,minValueType:b,maxValue:M,maxValueType:C,positiveColor:s,nativeColor:o,isShowValue:!y})}}),l.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:l.t("sheet.cf.panel.colorSet")}),c.jsxs("div",{className:"univer-ml-1 univer-mt-3 univer-flex univer-items-center",children:[c.jsxs("div",{className:"univer-flex univer-items-center",children:[c.jsx("div",{className:"univer-text-xs",children:l.t("sheet.cf.panel.native")}),c.jsx(te,{color:o,onChange:V})]}),c.jsxs("div",{className:"univer-ml-3 univer-flex univer-items-center",children:[c.jsx("div",{className:"univer-text-xs",children:l.t("sheet.cf.panel.positive")}),c.jsx(te,{color:s,onChange:k})]})]})]}),c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:l.t("sheet.cf.valueType.min")}),c.jsxs("div",{className:"univer-mt-3 univer-flex univer-items-center",children:[c.jsx(O.Select,{className:"univer-w-1/2 univer-flex-shrink-0",options:p,value:b,onChange:y=>{S(y);const x=t.createDefaultValueByValueType(y,10);E(x),I({isGradient:a,minValue:x,minValueType:y,maxValue:M,maxValueType:C,positiveColor:s,nativeColor:o,isShowValue:g})}}),c.jsx(fr,{id:"min",className:"univer-ml-3",disabled:!P(b),type:b,value:_,onChange:y=>{E(y||0),I({isGradient:a,minValue:y||0,minValueType:b,maxValue:M,maxValueType:C,positiveColor:s,nativeColor:o,isShowValue:g})}})]}),c.jsx("div",{className:"univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:l.t("sheet.cf.valueType.max")}),c.jsxs("div",{className:"univer-mt-3 univer-flex univer-items-center",children:[c.jsx(O.Select,{className:"univer-w-1/2 univer-flex-shrink-0",options:h,value:C,onChange:y=>{N(y);const x=t.createDefaultValueByValueType(y,90);R(x),I({isGradient:a,minValue:_,minValueType:b,maxValue:x,maxValueType:y,positiveColor:s,nativeColor:o,isShowValue:g})}}),c.jsx(fr,{className:"univer-ml-3",disabled:!P(C),id:"max",type:C,value:M,onChange:y=>{R(y||0),I({isGradient:a,minValue:_,minValueType:b,maxValue:y||0,maxValueType:C,positiveColor:s,nativeColor:o,isShowValue:g})}})]})]})]})},Re=r=>[i.BooleanNumber.FALSE,void 0].includes(r)?i.BooleanNumber.TRUE:i.BooleanNumber.FALSE,Me=r=>r!==i.BooleanNumber.FALSE,Qe=r=>{const{style:e,onChange:l,className:n}=r,[a,u]=m.useState(()=>{if(e!=null&&e.bl)return e.bl}),[s,v]=m.useState(()=>{if(e!=null&&e.it)return e.it}),[o,f]=m.useState(()=>{if(e!=null&&e.ul)return e.ul.s}),[d,p]=m.useState(()=>{if(e!=null&&e.st)return e.st.s}),[h,b]=m.useState(()=>{var E;const _="#2f56ef";return(E=e==null?void 0:e.cl)!=null&&E.rgb?e.cl.rgb:_}),[S,C]=m.useState(()=>{var E;const _="#e8ecfc";return(E=e==null?void 0:e.bg)!=null&&E.rgb?e.bg.rgb:_});m.useEffect(()=>{const _={bl:a,it:s};h!==void 0&&(_.cl={rgb:h}),S!==void 0&&(_.bg={rgb:S}),d!==void 0&&(_.st={s:d}),o!==void 0&&(_.ul={s:o}),l(t.removeUndefinedAttr(_))},[a,s,o,d,h,S]);const N="univer-flex univer-cursor-pointer univer-items-center univer-rounded univer-px-1";return c.jsxs("div",{className:O.clsx("univer-my-2.5 univer-flex univer-justify-between",n),children:[c.jsx("div",{className:O.clsx(N,{"univer-bg-gray-100 dark:!univer-bg-gray-700":Me(a||i.BooleanNumber.FALSE)}),onClick:()=>u(Re(a)),children:c.jsx(ur,{})}),c.jsx("div",{className:O.clsx(N,{"univer-bg-gray-100 dark:!univer-bg-gray-700":Me(s||i.BooleanNumber.FALSE)}),onClick:()=>v(Re(s)),children:c.jsx(cr,{})}),c.jsx("div",{className:O.clsx(N,{"univer-bg-gray-100 dark:!univer-bg-gray-700":Me(o||i.BooleanNumber.FALSE)}),onClick:()=>f(Re(o)),children:c.jsx(pr,{})}),c.jsx("div",{className:O.clsx(N,{"univer-bg-gray-100 dark:!univer-bg-gray-700":Me(d||i.BooleanNumber.FALSE)}),onClick:()=>p(Re(d)),children:c.jsx(vr,{})}),c.jsx(te,{color:h,onChange:b,Icon:ir}),c.jsx(te,{color:S,onChange:C})]})},Gr=r=>{var R;const{onChange:e,interceptorManager:l}=r,n=j.useDependency(i.LocaleService),u=j.useDependency(i.IUniverInstanceService).getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET),s=u.getActiveSheet(),v=((R=r.rule)==null?void 0:R.type)===t.CFRuleType.highlightCell?r.rule:void 0,o=m.useRef(null),[f,d]=m.useState(!1),p=m.useRef(null),[h,b]=m.useState({}),[S,C]=m.useState(()=>(v==null?void 0:v.subType)===t.CFSubRuleType.formula?v.value:"="),[N,_]=m.useState(void 0),E=g=>({style:g.style,value:S,type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.formula});m.useEffect(()=>l.intercept(l.getInterceptPoints().submit,{handler(){return E({style:h})}}),[h,S,l]),m.useEffect(()=>l.intercept(l.getInterceptPoints().beforeSubmit,{handler:(T,w,I)=>N||S.length===1||!S.startsWith("=")?(_(n.t("sheet.cf.errorMessage.formulaError")),!1):I(T)}),[N,S]);const M=g=>{e(E(g))};return j.useSidebarClick(g=>{var w;((w=p.current)==null?void 0:w.isClickOutSide(g))&&d(!1)}),c.jsxs("div",{ref:o,children:[c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:n.t("sheet.cf.panel.styleRule")}),c.jsx("div",{className:"univer-mt-3",children:c.jsx(pe.FormulaEditor,{ref:p,className:O.clsx("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors hover:univer-border-primary-600 dark:!univer-bg-gray-700 dark:!univer-text-white [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent",O.borderClassName),errorText:N,isFocus:f,initValue:S,unitId:u.getUnitId(),subUnitId:s==null?void 0:s.getSheetId(),onFocus:()=>{d(!0)},onChange:g=>{C(g),M({style:h})},onVerify:(g,T)=>{!g||T.length===1?_(n.t("sheet.cf.errorMessage.formulaError")):_(void 0)}})}),c.jsx("div",{className:ge,children:c.jsx(ue,{rule:E({style:h})})}),c.jsx(Qe,{style:v==null?void 0:v.style,className:"univer-mt-3",onChange:g=>{b(g),M({style:g})}})]})},Ve=r=>c.jsxs("div",{className:"univer-relative",children:[c.jsx("div",{className:"univer-absolute univer-bottom-[-13px] univer-z-[999] univer-text-[10px] univer-text-red-500",children:r.errorText}),r.children]}),H=(r,e)=>({label:e.t(`sheet.cf.operator.${r}`),value:r}),Zr=r=>{const{type:e,operator:l,onChange:n,value:a,interceptorManager:u}=r,s=j.useDependency(i.LocaleService),[v,o]=m.useState(()=>typeof a=="number"?a:0),[f,d]=m.useState(""),[p,h]=m.useState(()=>typeof a=="string"?a:""),[b,S]=m.useState(""),[C,N]=m.useState(()=>Array.isArray(a)?a[0]===void 0?0:a[0]:0),[_,E]=m.useState(""),[M,R]=m.useState(()=>Array.isArray(a)?a[1]===void 0?100:a[1]:100),[g,T]=m.useState("");switch(m.useEffect(()=>{switch(e){case t.CFSubRuleType.text:{[t.CFTextOperator.beginsWith,t.CFTextOperator.endsWith,t.CFTextOperator.containsText,t.CFTextOperator.notContainsText,t.CFTextOperator.equal,t.CFTextOperator.notEqual].includes(l)&&n(p);break}case t.CFSubRuleType.number:{[t.CFNumberOperator.equal,t.CFNumberOperator.notEqual,t.CFNumberOperator.greaterThan,t.CFNumberOperator.greaterThanOrEqual,t.CFNumberOperator.lessThan,t.CFNumberOperator.lessThanOrEqual].includes(l)&&n(v),[t.CFNumberOperator.between,t.CFNumberOperator.notBetween].includes(l)&&n([C,M]);break}}},[e]),m.useEffect(()=>{const w=u.intercept(u.getInterceptPoints().beforeSubmit,{handler:(I,k,V)=>{switch(e){case t.CFSubRuleType.text:if([t.CFTextOperator.beginsWith,t.CFTextOperator.containsText,t.CFTextOperator.endsWith,t.CFTextOperator.notEqual,t.CFTextOperator.notContainsText,t.CFTextOperator.equal].includes(l))return p?V(I):(S(s.t("sheet.cf.errorMessage.notBlank")),!1)}return V(I)}});return()=>{w()}},[e,v,p,l]),e){case t.CFSubRuleType.text:{if([t.CFTextOperator.beginsWith,t.CFTextOperator.endsWith,t.CFTextOperator.containsText,t.CFTextOperator.notContainsText,t.CFTextOperator.equal,t.CFTextOperator.notEqual].includes(l)){const w=I=>{h(I),n(I)};return c.jsx("div",{className:"univer-mt-3",children:c.jsx(Ve,{errorText:b,children:c.jsx(O.Input,{value:p,onChange:I=>{S(""),w(I)}})})})}break}case t.CFSubRuleType.number:{if([t.CFNumberOperator.equal,t.CFNumberOperator.notEqual,t.CFNumberOperator.greaterThan,t.CFNumberOperator.greaterThanOrEqual,t.CFNumberOperator.lessThan,t.CFNumberOperator.lessThanOrEqual].includes(l)){const w=I=>{o(I||0),n(I||0),d("")};return c.jsx("div",{className:"univer-mt-3",children:c.jsx(Ve,{errorText:f,children:c.jsx(O.InputNumber,{className:"univer-w-full",min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:v,onChange:w})})})}if([t.CFNumberOperator.between,t.CFNumberOperator.notBetween].includes(l)){const w=k=>{N(k||0),n([k||0,M]),E("")},I=k=>{R(k||0),n([C,k||0]),T("")};return c.jsxs("div",{className:"univer-mt-3 univer-flex univer-items-center",children:[c.jsx(Ve,{errorText:_,children:c.jsx(O.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:C,onChange:w})}),c.jsx(Ve,{errorText:g,children:c.jsx(O.InputNumber,{className:"univer-ml-3",min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:M,onChange:I})})]})}}}return null},hr=(r,e)=>{switch(r){case t.CFSubRuleType.text:return[H(t.CFTextOperator.containsText,e),H(t.CFTextOperator.notContainsText,e),H(t.CFTextOperator.beginsWith,e),H(t.CFTextOperator.endsWith,e),H(t.CFTextOperator.equal,e),H(t.CFTextOperator.notEqual,e),H(t.CFTextOperator.containsBlanks,e),H(t.CFTextOperator.notContainsBlanks,e),H(t.CFTextOperator.containsErrors,e),H(t.CFTextOperator.notContainsErrors,e)];case t.CFSubRuleType.number:return[H(t.CFNumberOperator.between,e),H(t.CFNumberOperator.notBetween,e),H(t.CFNumberOperator.equal,e),H(t.CFNumberOperator.notEqual,e),H(t.CFNumberOperator.greaterThan,e),H(t.CFNumberOperator.greaterThanOrEqual,e),H(t.CFNumberOperator.lessThan,e),H(t.CFNumberOperator.lessThanOrEqual,e)];case t.CFSubRuleType.timePeriod:return[H(t.CFTimePeriodOperator.yesterday,e),H(t.CFTimePeriodOperator.today,e),H(t.CFTimePeriodOperator.tomorrow,e),H(t.CFTimePeriodOperator.last7Days,e),H(t.CFTimePeriodOperator.lastWeek,e),H(t.CFTimePeriodOperator.thisWeek,e),H(t.CFTimePeriodOperator.nextWeek,e),H(t.CFTimePeriodOperator.lastMonth,e),H(t.CFTimePeriodOperator.thisMonth,e),H(t.CFTimePeriodOperator.nextMonth,e)]}},gr=r=>{var R;const{interceptorManager:e,onChange:l}=r,n=j.useDependency(i.LocaleService),a=((R=r.rule)==null?void 0:R.type)===t.CFRuleType.highlightCell?r.rule:void 0,[u,s]=m.useState(()=>{const g=t.CFSubRuleType.text;return a&&a.subType||g}),v=[{value:t.CFSubRuleType.text,label:n.t("sheet.cf.subRuleType.text")},{value:t.CFSubRuleType.number,label:n.t("sheet.cf.subRuleType.number")},{value:t.CFSubRuleType.timePeriod,label:n.t("sheet.cf.subRuleType.timePeriod")},{value:t.CFSubRuleType.duplicateValues,label:n.t("sheet.cf.subRuleType.duplicateValues")},{value:t.CFSubRuleType.uniqueValues,label:n.t("sheet.cf.subRuleType.uniqueValues")}],o=m.useMemo(()=>hr(u,n),[u]),[f,d]=m.useState(()=>{const g=o?o[0].value:void 0;return a&&a.operator||g}),[p,h]=m.useState(()=>{var w;return a?(w=a.value)!=null?w:t.createDefaultValue(a.subType,a.operator):""}),[b,S]=m.useState({}),C=m.useMemo(()=>g=>{var T,w,I,k,V,P,L,y,x,F,G,Q,ee,de,ve;switch(g.subType||u){case t.CFSubRuleType.text:{if([t.CFTextOperator.beginsWith,t.CFTextOperator.endsWith,t.CFTextOperator.containsText,t.CFTextOperator.notContainsText,t.CFTextOperator.equal,t.CFTextOperator.notEqual].includes(f))return{type:t.CFRuleType.highlightCell,subType:(T=g.subType)!=null?T:u,operator:(w=g.operator)!=null?w:f,style:(I=g.style)!=null?I:b,value:(k=g.value)!=null?k:p};break}case t.CFSubRuleType.number:{if([t.CFNumberOperator.equal,t.CFNumberOperator.notEqual,t.CFNumberOperator.greaterThan,t.CFNumberOperator.greaterThanOrEqual,t.CFNumberOperator.lessThan,t.CFNumberOperator.lessThanOrEqual].includes(f))return{type:t.CFRuleType.highlightCell,subType:(V=g.subType)!=null?V:u,operator:(P=g.operator)!=null?P:f,style:(L=g.style)!=null?L:b,value:(y=g.value)!=null?y:p};if([t.CFNumberOperator.between,t.CFNumberOperator.notBetween].includes(f))return{type:t.CFRuleType.highlightCell,subType:(x=g.subType)!=null?x:u,operator:(F=g.operator)!=null?F:f,style:(G=g.style)!=null?G:b,value:(Q=g.value)!=null?Q:p};break}}return{type:t.CFRuleType.highlightCell,subType:(ee=g.subType)!=null?ee:u,operator:(de=g.operator)!=null?de:f,style:(ve=g.style)!=null?ve:b}},[u,f,p,b]);m.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return C({})}}),[C,e]),m.useEffect(()=>{v.some(g=>g.value===u)||s(v[0].value)},[v]);const N=g=>{const T=g,w=hr(T,n),I=w&&w[0].value;s(T),d(I),I&&h(t.createDefaultValue(T,I)),l(C({subType:T,operator:I}))},_=g=>{const T=g;d(T),l(C({operator:T}))},E=g=>{h(g),l(C({value:g}))},M=m.useMemo(()=>`${u}_${f}_${Math.random()}`,[u,f]);return c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:n.t("sheet.cf.panel.styleRule")}),c.jsxs("div",{className:"univer-flex univer-justify-between univer-gap-4",children:[c.jsx(O.Select,{className:"univer-mt-3 univer-w-full",onChange:N,value:u,options:v}),(o==null?void 0:o.length)&&c.jsx(O.Select,{className:"univer-mt-3 univer-w-full",onChange:_,value:f||"",options:o})]}),c.jsx(Zr,{value:p,interceptorManager:e,type:u,operator:f,rule:a,onChange:E},M),c.jsx("div",{className:ge,children:c.jsx(ue,{rule:C({})})}),c.jsx(Qe,{style:a==null?void 0:a.style,className:"univer-ml-1",onChange:g=>{S(g),l(C({style:g}))}})]})},yr=(r,e)=>(t.iconMap[r]||[])[Number(e)]||"",zr=r=>{var d;const{error:e,type:l,onChange:n}=r,a=j.useDependency(i.IUniverInstanceService),u=a.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getUnitId(),s=(d=a.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:d.getSheetId(),v=m.useRef(null),[o,f]=m.useState(!1);return j.useSidebarClick(p=>{var b;((b=v.current)==null?void 0:b.isClickOutSide(p))&&f(!1)}),c.jsx("div",{className:"univer-relative",children:l!==t.CFValueType.formula?c.jsxs(c.Fragment,{children:[c.jsx(O.InputNumber,{className:O.clsx({"univer-border-red-500":e}),value:Number(r.value)||0,onChange:p=>n(p!=null?p:0)}),e&&c.jsx("div",{className:"univer-absolute univer-text-xs univer-text-red-500",children:e})]}):c.jsx("div",{className:"univer-w-full",children:c.jsx(pe.FormulaEditor,{ref:v,className:O.clsx("univer-box-border univer-h-8 univer-w-full univer-cursor-pointer univer-items-center univer-rounded-lg univer-bg-white univer-pt-2 univer-transition-colors hover:univer-border-primary-600 dark:!univer-bg-gray-700 dark:!univer-text-white [&>div:first-child]:univer-px-2.5 [&>div]:univer-h-5 [&>div]:univer-ring-transparent",O.borderClassName),initValue:String(r.value),unitId:u,subUnitId:s,isFocus:o,onChange:(p="")=>{n(p||"")},onFocus:()=>f(!0)})})})},mr=(r,e,l)=>({operator:t.CFNumberOperator.greaterThan,value:{type:t.CFValueType.num,value:(l.length-1-e)*10},iconType:r,iconId:String(e)}),Yr=m.forwardRef((r,e)=>{const{onClick:l}=r,n=j.useDependency(i.LocaleService),a=u=>{l(u)};return c.jsx("div",{ref:e,className:"univer-w-80",children:t.iconGroup.map((u,s)=>c.jsxs("div",{className:"univer-mb-3",children:[c.jsx("div",{className:"univer-mb-1 univer-text-sm",children:n.t(u.title)}),c.jsx("div",{className:"univer-flex univer-flex-wrap",children:u.group.map(v=>c.jsx("div",{className:"univer-mb-1 univer-flex univer-w-1/2 univer-items-center",onClick:()=>{a(v.name)},children:c.jsx("a",{className:"univer-cursor-pointer univer-rounded hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",children:v.list.map((o,f)=>c.jsx("img",{className:"univer-size-5",src:o,draggable:!1},f))})},v.name))})]},s))})}),Kr=r=>{const{onClick:e}=r,l=m.useMemo(()=>{const a=[];for(const u in t.iconMap){const s=t.iconMap[u],v=u;s.forEach((o,f)=>{a.push({iconType:v,base64:o,iconId:String(f)})})}return a},[]),n=a=>{e(a.iconType,a.iconId)};return c.jsxs("div",{children:[c.jsxs("div",{className:"univer-mb-2.5 univer-flex univer-cursor-pointer univer-items-center univer-pl-1",onClick:()=>n({iconType:t.EMPTY_ICON_TYPE,iconId:""}),children:[c.jsx(he,{className:"univer-size-5"}),c.jsx("span",{className:"univer-ml-2",children:"无单元格图标"})]}),c.jsx("div",{className:"univer-flex univer-w-64 univer-flex-wrap",children:l.map(a=>c.jsx("div",{className:"univer-mb-2 univer-mr-2 univer-flex univer-cursor-pointer univer-items-center univer-justify-center univer-rounded hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",children:c.jsx("img",{className:"univer-size-5",src:a.base64,draggable:!1,onClick:()=>n(a)})},`${a.iconType}_${a.iconId}`))})]})},Xr=r=>{const{onChange:e,configList:l,errorMap:n={}}=r,a=j.useDependency(i.LocaleService),u=[{label:a.t(`sheet.cf.symbol.${t.CFNumberOperator.greaterThan}`),value:t.CFNumberOperator.greaterThan},{label:a.t(`sheet.cf.symbol.${t.CFNumberOperator.greaterThanOrEqual}`),value:t.CFNumberOperator.greaterThanOrEqual}],s=[{label:a.t(`sheet.cf.valueType.${t.CFValueType.num}`),value:t.CFValueType.num},{label:a.t(`sheet.cf.valueType.${t.CFValueType.percent}`),value:t.CFValueType.percent},{label:a.t(`sheet.cf.valueType.${t.CFValueType.percentile}`),value:t.CFValueType.percentile},{label:a.t(`sheet.cf.valueType.${t.CFValueType.formula}`),value:t.CFValueType.formula}],v=(p,h)=>{e([String(h),"value","value"],p)},o=(p,h)=>{e([String(h),"operator"],p);const b=t.createDefaultValue(t.CFSubRuleType.number,p);v(b,h)},f=(p,h)=>{e([String(h),"value","type"],p);const b=l[h],S=t.createDefaultValue(t.CFSubRuleType.number,b.operator);v(S,h)};return m.useMemo(()=>l.map((p,h)=>{const b=n[h],S=yr(p.iconType,p.iconId),C=h===l.length-1,N=h===0,_=l[h-1],E=(_==null?void 0:_.value.type)===t.CFValueType.formula?a.t("sheet.cf.valueType.formula"):_==null?void 0:_.value.value,M=(R,g)=>{const T={...p,iconId:g,iconType:R};e([String(h)],T)};return c.jsxs("div",{className:h?"univer-mt-6":"univer-mt-3",children:[c.jsxs("div",{className:"univer-mt-3 univer-flex univer-items-center univer-justify-between univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:[c.jsxs("div",{className:"univer-w-[45%]",children:[a.t("sheet.cf.iconSet.icon"),h+1]}),c.jsx("div",{className:"univer-w-[45%]",children:c.jsxs(c.Fragment,{children:[!N&&!C&&a.t("sheet.cf.iconSet.rule"),!N&&!C&&c.jsxs("span",{className:"univer-font-medium univer-text-gray-600 dark:!univer-text-gray-200",children:[a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${t.getOppositeOperator(_.operator)}`),E,C?"":` ${a.t("sheet.cf.iconSet.and")} `]})]})})]}),c.jsxs("div",{className:"univer-mt-3 univer-grid univer-grid-cols-2 univer-gap-4",children:[c.jsx("div",{className:"univer-flex univer-items-center",children:c.jsx(O.Dropdown,{overlay:c.jsx("div",{className:"univer-rounded-lg univer-p-4",children:c.jsx(Kr,{onClick:M,iconId:p.iconId,iconType:p.iconType})}),children:c.jsxs("div",{className:O.clsx("univer-box-border univer-flex univer-h-8 univer-w-full univer-items-center univer-justify-between univer-rounded-md univer-bg-white univer-px-4 univer-py-2 univer-text-xs univer-text-gray-600 univer-transition-all hover:univer-border-primary-600 dark:!univer-text-gray-200",O.borderClassName),children:[S?c.jsx("img",{src:S,className:"univer-size-4",draggable:!1}):c.jsx(he,{className:"univer-size-4"}),c.jsx(Xe,{})]})})}),C?c.jsxs("div",{className:"univer-mt-0 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:[a.t("sheet.cf.iconSet.rule"),c.jsxs("span",{className:"univer-font-medium",children:[a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${t.getOppositeOperator(_.operator)}`),E,C?"":` ${a.t("sheet.cf.iconSet.and")} `]})]}):c.jsx(O.Select,{options:u,value:p.operator,onChange:R=>{o(R,h)}})]}),C?c.jsx("div",{}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"univer-mt-3 univer-grid univer-grid-cols-2 univer-gap-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:[c.jsx("div",{children:a.t("sheet.cf.iconSet.type")}),c.jsx("div",{children:a.t("sheet.cf.iconSet.value")})]}),c.jsxs("div",{className:"univer-mt-3 univer-grid univer-grid-cols-2 univer-gap-4",children:[c.jsx(O.Select,{options:s,value:p.value.type,onChange:R=>{f(R,h)}}),c.jsx(zr,{id:h,type:p.value.type,error:b,value:p.value.value||"",onChange:R=>{v(R,h)}})]})]})]},h)}),[l,n])},Jr=r=>{var R;const{interceptorManager:e}=r,l=((R=r.rule)==null?void 0:R.type)===t.CFRuleType.iconSet?r.rule:void 0,n=j.useDependency(i.LocaleService),[a,u]=m.useState({}),[s,v]=m.useState(()=>{const g=Object.keys(t.iconMap)[0];if(l&&l.config.length){const T=l.config[0].iconType;if(!l.config.some(I=>I.iconType!==T))return T}return g}),[o,f]=m.useState(()=>{if(l&&l.config.length)return i.Tools.deepClone(l==null?void 0:l.config);const g=t.iconMap[s]||[];return new Array(g.length).fill("").map((T,w,I)=>w===I.length-1?{operator:t.CFNumberOperator.lessThanOrEqual,value:{type:t.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:s,iconId:String(w)}:mr(s,w,I))}),[d,p]=m.useState(()=>l?!!l.isShowValue:!0),h=m.useMemo(()=>{const g=o.map(T=>yr(T.iconType,T.iconId));return c.jsx("div",{className:"univer-flex univer-items-center",children:g.map((T,w)=>T?c.jsx("img",{className:"univer-size-5",src:T},w):c.jsx(he,{className:"univer-size-5"},w))})},[o]),b=g=>{if(g.reduce((w,I,k)=>w.preType&&!w.result||g.length-1===k?w:I.value.type===t.CFValueType.formula?{preType:t.CFValueType.formula,result:!1}:w.preType?{result:w.preType===I.value.type,preType:I.value.type}:{result:!0,preType:I.value.type},{result:!0,preType:""}).result&&[t.CFValueType.num,t.CFValueType.percent,t.CFValueType.percentile].includes(g[0].value.type)){const w={};return g.forEach((I,k,V)=>{if(k-1<0||k===V.length-1)return;const L=g[k-1],y=t.getOppositeOperator(L.operator);t.compareWithNumber({operator:y,value:L.value.value},I.value.value)||(w[k]=`${n.t(`sheet.cf.form.${y}`,String(L.value.value))} `)}),w}return{}},S=(g,T)=>{i.get(o,g)!==T&&(i.set(o,g,T),f([...o]),u(b(o)))},C=g=>{v(g);const T=t.iconMap[g]||[],w=new Array(T.length).fill("").map((I,k,V)=>mr(g,k,V));f(w),u(b(w))};m.useEffect(()=>{const g=e.intercept(e.getInterceptPoints().submit,{handler(){return{type:t.CFRuleType.iconSet,isShowValue:d,config:o}}});return()=>{g()}},[d,o,e]),m.useEffect(()=>{const g=e.intercept(e.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(a).length===0}});return()=>{g()}},[d,o,e,a]);const N=()=>{const g=o.map(T=>({...T}));o.forEach((T,w)=>{const I=o.length-1-w,k=g[I];T.iconId=k.iconId,T.iconType=k.iconType}),f([...o])},_=j.useDependency(j.ILayoutService),[E,M]=m.useState();return j.useScrollYOverContainer(E,_.rootContainerElement),c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-600",children:n.t("sheet.cf.panel.styleRule")}),c.jsx("div",{className:"univer-mt-3",children:c.jsx(O.Dropdown,{overlay:c.jsx("div",{className:"univer-rounded-lg univer-p-4",children:c.jsx(Yr,{ref:g=>{!E&&g&&M(g)},iconType:s,onClick:C})}),children:c.jsxs("div",{className:O.clsx("univer-box-border univer-flex univer-h-8 univer-w-full univer-items-center univer-justify-between univer-rounded-md univer-bg-white univer-px-4 univer-py-2 univer-text-xs univer-text-gray-600 univer-transition-all hover:univer-border-primary-600",O.borderClassName),children:[h,c.jsx(Xe,{})]})})}),c.jsxs("div",{className:"univer-mt-3 univer-flex univer-items-center univer-text-xs",children:[c.jsxs("div",{className:"univer-flex univer-items-center univer-text-xs",children:[c.jsx(O.Checkbox,{onChange:N}),n.t("sheet.cf.iconSet.reverseIconOrder")]}),c.jsxs("div",{className:"univer-ml-6 univer-flex univer-items-center univer-text-xs",children:[c.jsx(O.Checkbox,{checked:!d,onChange:g=>{p(!g)}}),n.t("sheet.cf.iconSet.onlyShowIcon")]})]}),c.jsx(Xr,{errorMap:a,onChange:S,configList:o})]})},Qr=r=>{var N;const{onChange:e,interceptorManager:l}=r,n=j.useDependency(i.LocaleService),a=((N=r.rule)==null?void 0:N.type)===t.CFRuleType.highlightCell?r.rule:void 0,u=[{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"}],[s,v]=m.useState(()=>{const _=u[0].value,E=a==null?void 0:a.type;if(!a)return _;switch(E){case t.CFRuleType.highlightCell:switch(a.subType){case t.CFSubRuleType.average:return[t.CFNumberOperator.greaterThan,t.CFNumberOperator.greaterThanOrEqual].includes(a.operator)?"greaterThanAverage":[t.CFNumberOperator.lessThan,t.CFNumberOperator.lessThanOrEqual].includes(a.operator)?"lessThanAverage":_;case t.CFSubRuleType.rank:return a.isBottom?"isBottom":"isNotBottom"}}return _}),[o,f]=m.useState(()=>{const E=a==null?void 0:a.type;if(!a)return 10;switch(E){case t.CFRuleType.highlightCell:switch(a.subType){case t.CFSubRuleType.rank:return a.value||10}}return 10}),[d,p]=m.useState(()=>{const E=a==null?void 0:a.type;if(!a)return!1;switch(E){case t.CFRuleType.highlightCell:switch(a.subType){case t.CFSubRuleType.rank:return a.isPercent||!1}}return!1}),[h,b]=m.useState({}),S=_=>{const{type:E,isPercent:M,value:R,style:g}=_;if(E==="isNotBottom")return{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.rank,isPercent:M,isBottom:!1,value:R,style:g};if(E==="isBottom")return{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.rank,isPercent:M,isBottom:!0,value:R,style:g};if(E==="greaterThanAverage")return{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.average,operator:t.CFNumberOperator.greaterThan,style:g};if(E==="lessThanAverage")return{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.average,operator:t.CFNumberOperator.lessThan,style:g}};m.useEffect(()=>l.intercept(l.getInterceptPoints().submit,{handler(){return S({type:s,isPercent:d,value:o,style:h})}}),[s,d,o,h,l]);const C=_=>{e(S(_))};return c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:n.t("sheet.cf.panel.styleRule")}),c.jsx(O.Select,{className:"univer-mt-3 univer-w-full",value:s,options:u,onChange:_=>{v(_),C({type:_,isPercent:d,value:o,style:h})}}),["isNotBottom","isBottom"].includes(s)&&c.jsxs("div",{className:"univer-mt-3 univer-flex univer-items-center",children:[c.jsx(O.InputNumber,{min:1,max:1e3,value:o,onChange:_=>{const E=_||0;f(E),C({type:s,isPercent:d,value:E,style:h})}}),c.jsxs("div",{className:"univer-ml-3 univer-flex univer-items-center univer-text-xs",children:[c.jsx(O.Checkbox,{checked:d,onChange:_=>{p(!!_),C({type:s,isPercent:!!_,value:o,style:h})}}),n.t("sheet.cf.valueType.percent")]})]}),c.jsx("div",{className:ge,children:c.jsx(ue,{rule:S({type:s,isPercent:d,value:o,style:h})})}),c.jsx(Qe,{style:a==null?void 0:a.style,className:"univer-mt-3",onChange:_=>{b(_),C({type:s,isPercent:d,value:o,style:_})}})]})},et=i.createInterceptorKey("beforeSubmit"),rt=i.createInterceptorKey("submit"),Cr=r=>r.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getUnitId(),br=r=>{var e;return(e=r.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()},tt=r=>{var w,I,k;const e=j.useDependency(i.LocaleService),l=j.useDependency(i.ICommandService),n=j.useDependency(i.IUniverInstanceService),a=j.useDependency(t.ConditionalFormattingRuleModel),u=j.useDependency(U.SheetsSelectionsService),s=Cr(n),v=br(n),[o,f]=m.useState(void 0),d=m.useRef((I=(w=r.rule)==null?void 0:w.ranges)!=null?I:[]),p=m.useMemo(()=>{var P,L,y;let V=(P=r.rule)==null?void 0:P.ranges;return V!=null&&V.length||(V=(y=(L=u.getCurrentSelections())==null?void 0:L.map(x=>x.range))!=null?y:[]),d.current=V,V!=null&&V.length?V.map(x=>{const F=$e.serializeRange(x);return F==="NaN"?"":F}).filter(x=>!!x).join(","):""},[r.rule]),h=[{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"}],[b,S]=m.useState(()=>{var L,y;const V=(L=r.rule)==null?void 0:L.rule.type,P=h[0].value;if(!V)return P;switch(V){case t.CFRuleType.highlightCell:{switch((y=r.rule)==null?void 0:y.rule.subType){case t.CFSubRuleType.number:case t.CFSubRuleType.text:case t.CFSubRuleType.duplicateValues:case t.CFSubRuleType.uniqueValues:case t.CFSubRuleType.timePeriod:return"1";case t.CFSubRuleType.average:case t.CFSubRuleType.rank:return"2";case t.CFSubRuleType.formula:return"5"}break}case t.CFRuleType.dataBar:return"3";case t.CFRuleType.colorScale:return"4";case t.CFRuleType.iconSet:return"6"}return P}),C=m.useRef(void 0),N=m.useMemo(()=>new i.InterceptorManager({beforeSubmit:et,submit:rt}),[]),_=m.useMemo(()=>{switch(b){case"1":return gr;case"2":return Qr;case"3":return qr;case"4":return Wr;case"5":return Gr;case"6":return Jr;default:return gr}},[b]);m.useEffect(()=>{const V=l.onCommandExecuted(P=>{if(P.id===U.RemoveSheetMutation.id){const L=P.params;L.subUnitId===v&&L.unitId===s&&r.onCancel()}P.id===U.SetWorksheetActiveOperation.id&&r.onCancel()});return()=>V.dispose()},[]);const E=V=>{C.current=V},M=V=>{const P=V.split(",").filter(L=>!!L).map($e.deserializeRangeWithSheet).map(L=>L.range);d.current=P},R=()=>{if(o)return;const P=(()=>{const y=n.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!y)throw new Error("No active sheet found");return d.current.map(G=>U.setEndForRange(G,y.getRowCount(),y.getColumnCount())).filter(G=>!(Number.isNaN(G.startRow)||Number.isNaN(G.startColumn)))})();if(N.fetchThroughInterceptors(N.getInterceptPoints().beforeSubmit)(!0,null)){const y=N.fetchThroughInterceptors(N.getInterceptPoints().submit)(null,null);if(y){const x=Cr(n),F=br(n);if(!x||!F)throw new Error("No active sheet found");let G={};r.rule&&r.rule.cfId?(G={...r.rule,ranges:P,rule:y},l.executeCommand(t.SetCfCommand.id,{unitId:x,subUnitId:F,rule:G}),r.onCancel()):(G={cfId:a.createCfId(x,F),ranges:P,rule:y,stopIfTrue:!1},l.executeCommand(t.AddCfCommand.id,{unitId:x,subUnitId:F,rule:G}),r.onCancel())}}},g=()=>{r.onCancel()},T=(V,P)=>{V?P.length<1?f(e.t("sheet.cf.errorMessage.rangeError")):f(void 0):f(e.t("sheet.cf.errorMessage.rangeError"))};return c.jsxs("div",{children:[c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:e.t("sheet.cf.panel.range")}),c.jsxs("div",{className:"univer-mt-4",children:[c.jsx(pe.RangeSelector,{unitId:s,subUnitId:v,initialValue:p,onChange:(V,P)=>M(P),onVerify:T}),o&&c.jsx("div",{className:"univer-mt-1 univer-text-xs univer-text-red-500",children:o})]}),c.jsx("div",{className:"univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",children:e.t("sheet.cf.panel.styleType")}),c.jsx(O.Select,{className:"univer-mt-4 univer-w-full",value:b,options:h,onChange:V=>S(V)}),c.jsx(_,{interceptorManager:N,rule:(k=r.rule)==null?void 0:k.rule,onChange:E}),c.jsxs("div",{className:"univer-mt-4 univer-flex univer-justify-end",children:[c.jsx(O.Button,{onClick:g,children:e.t("sheet.cf.panel.cancel")}),c.jsx(O.Button,{className:"univer-ml-3",variant:"primary",onClick:R,children:e.t("sheet.cf.panel.submit")})]})]})};var nt=Object.getOwnPropertyDescriptor,at=(r,e,l,n)=>{for(var a=n>1?void 0:n?nt(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},lt=(r,e)=>(l,n)=>e(l,n,r);let se=class extends i.Disposable{constructor(e){super();re(this,"_initLocal",()=>{});re(this,"_findReplaceIndex",e=>{const l=/\{([^}]+)?\}/g,n=[];let a=l.exec(e);for(;a;)n.push({startIndex:a.index,key:Number(a[1]),endIndex:a.index+a[0].length-1}),a=l.exec(e);return n});this._localeService=e,this._initLocal()}tWithReactNode(e,...l){const n=this._localeService.getLocales(),a=e.split("."),u=n&&this._localeService.resolveKeyPath(n,a);if(typeof u=="string"){const s=[];return this._findReplaceIndex(u).forEach((v,o,f)=>{const d=f[o-1]||{endIndex:-1};if(d.endIndex+1<v.startIndex){const p=u.slice(d.endIndex+1,v.startIndex);p&&s.push(p)}if(l[v.key]&&s.push(l[v.key]),o===f.length-1){const p=u.slice(v.endIndex+1);p&&s.push(p)}}),s}return[]}};se=at([lt(0,i.Inject(i.LocaleService))],se);const ut=(r,e)=>{const l=r.rule;switch(l.type){case t.CFRuleType.colorScale:return e.t("sheet.cf.ruleType.colorScale");case t.CFRuleType.dataBar:return e.t("sheet.cf.ruleType.dataBar");case t.CFRuleType.iconSet:return e.t("sheet.cf.ruleType.iconSet");case t.CFRuleType.highlightCell:switch(l.subType){case t.CFSubRuleType.average:{const n=l.operator;return e.t(`sheet.cf.preview.describe.${n}`,e.t("sheet.cf.subRuleType.average"))}case t.CFSubRuleType.duplicateValues:return e.t("sheet.cf.subRuleType.duplicateValues");case t.CFSubRuleType.uniqueValues:return e.t("sheet.cf.subRuleType.uniqueValues");case t.CFSubRuleType.number:{const n=l.operator;return e.t(`sheet.cf.preview.describe.${n}`,...Array.isArray(l.value)?l.value.map(a=>String(a)):[String(l.value||"")])}case t.CFSubRuleType.text:{const n=l.operator;return e.t(`sheet.cf.preview.describe.${n}`,l.value||"")}case t.CFSubRuleType.timePeriod:{const n=l.operator;return e.t(`sheet.cf.preview.describe.${n}`)}case t.CFSubRuleType.rank:return l.isPercent?l.isBottom?e.t("sheet.cf.preview.describe.bottomNPercent",String(l.value)):e.t("sheet.cf.preview.describe.topNPercent",String(l.value)):l.isBottom?e.t("sheet.cf.preview.describe.bottomN",String(l.value)):e.t("sheet.cf.preview.describe.topN",String(l.value));case t.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let Ir=0;const it=r=>{const{onClick:e}=r,l=j.useDependency(t.ConditionalFormattingRuleModel),n=j.useDependency(i.IUniverInstanceService),a=j.useDependency(U.SheetsSelectionsService),u=j.useDependency(i.ICommandService),s=j.useDependency(i.LocaleService),v=j.useDependency(i.Injector),o=j.useDependency(j.ISidebarService),f=j.useDependency(se),d=j.useObservable(()=>n.getCurrentTypeOfUnit$(i.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),p=d.getUnitId(),h=d.getActiveSheet();if(!h)throw new Error("No active sheet found");const b=h.getSheetId(),[S,C]=m.useState([]),[N,_]=m.useState("2"),[E,M]=m.useState(0),[R,g]=m.useState(-1),[T,w]=m.useState(Ir),I=m.useRef(null),k=[{label:s.t("sheet.cf.panel.workSheet"),value:"2"},{label:s.t("sheet.cf.panel.selectedRange"),value:"1"}],V=()=>{const A=l.getSubunitRules(p,b);if(!A||!A.length)return[];if(N==="1"){const $=a.getCurrentLastSelection();if(!$)return[];const B=$.range;return A.filter(Z=>Z.ranges.some(z=>i.Rectangle.intersects(z,B)))}else if(N==="2")return[...A];return[]},[P,L]=m.useState(V);W.useHighlightRange(S),m.useEffect(()=>{const A=u.onCommandExecuted($=>{$.id===U.SetWorksheetActiveOperation.id&&M(Math.random())});return()=>A.dispose()}),m.useEffect(()=>{L(V)},[N,E,p,b]),m.useEffect(()=>{if(N==="2")return;const A=new J.Observable($=>{const B=[U.SetSelectionsOperation.id,t.AddConditionalRuleMutation.id,t.SetConditionalRuleMutation.id,t.DeleteConditionalRuleMutation.id,t.MoveConditionalRuleMutation.id],q=u.onCommandExecuted(Z=>{const{id:z,params:ae}=Z,le=n.getCurrentUnitOfType(i.UniverInstanceType.UNIVER_SHEET).getUnitId();B.includes(z)&&ae.unitId===le&&$.next(null)});return()=>q.dispose()}).pipe(J.debounceTime(16)).subscribe(()=>{L(V)});return()=>{A.unsubscribe()}},[n,N,p,b]),m.useEffect(()=>{const A=l.$ruleChange.subscribe(()=>{M(Math.random())});return()=>A.unsubscribe()},[l]),m.useEffect(()=>{const A=()=>{var Z,z;const q=Math.max(0,((z=(Z=I.current)==null?void 0:Z.getBoundingClientRect().width)!=null?z:0)-8);return Ir=q,q},B=new J.Observable(q=>{const Z=o.getContainer();if(Z){let z=setTimeout(()=>{q.next(void 0)},150);const ae=()=>{z&&clearTimeout(z),z=null},le=Fe=>{Fe.propertyName==="width"&&(ae(),q.next(void 0))};return Z.addEventListener("transitionend",le),()=>{ae(),Z.removeEventListener("transitionend",le)}}}).pipe(J.debounceTime(16)).subscribe(()=>{w(A())});return()=>{B.unsubscribe()}},[]);const y=A=>{var q;const $=n.getCurrentUnitOfType(i.UniverInstanceType.UNIVER_SHEET).getUnitId(),B=(q=n.getCurrentUnitOfType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:q.getSheetId();if(!$||!B)throw new Error("No active sheet found");u.executeCommand(t.DeleteCfCommand.id,{unitId:$,subUnitId:B,cfId:A.cfId})},x=(A,$)=>{g($.y)},F=(A,$,B)=>{var Fe;g(-1);const q=n.getCurrentUnitOfType(i.UniverInstanceType.UNIVER_SHEET).getUnitId(),Z=(Fe=n.getCurrentUnitOfType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:Fe.getSheetId();if(!q||!Z)throw new Error("No active sheet found");const z=Ht=>{const Bt=P.length;return Math.min(Bt-1,Math.max(0,Ht))},ae=P[z($.y)].cfId,le=P[z(B.y)].cfId;ae!==le&&u.executeCommand(t.MoveCfCommand.id,{unitId:q,subUnitId:Z,start:{id:ae,type:"self"},end:{id:le,type:B.y>$.y?"after":"before"}})},G=()=>{r.onCreate()},Q=()=>{N==="2"?u.executeCommand(t.ClearWorksheetCfCommand.id):N==="1"&&P.map($=>({unitId:p,subUnitId:b,cfId:$.cfId})).forEach($=>{u.executeCommand(t.DeleteCfCommand.id,$)})},ee=m.useMemo(()=>{const A=n.getCurrentUnitOfType(i.UniverInstanceType.UNIVER_SHEET),$=A.getActiveSheet();return P.filter(B=>{const q=B.ranges;return U.checkRangesEditablePermission(v,A.getUnitId(),$.getSheetId(),q)})},[P]),de=ee.map((A,$)=>({i:A.cfId,x:0,w:12,y:$,h:1,isResizable:!1})),ve=m.useMemo(()=>{const A=n.getCurrentUnitOfType(i.UniverInstanceType.UNIVER_SHEET),$=A.getActiveSheet();return P.every(B=>{const q=B.ranges;return U.checkRangesEditablePermission(v,A.getUnitId(),$.getSheetId(),q)})},[P]);return c.jsxs("div",{children:[c.jsxs("div",{className:"univer-flex univer-items-center univer-justify-between univer-gap-2 univer-text-sm",children:[c.jsx("div",{className:"univer-flex univer-items-center univer-gap-2",children:f.tWithReactNode("sheet.cf.panel.managerRuleSelect",c.jsx(O.Select,{className:"univer-w-36",options:k,value:N,onChange:A=>{_(A)}})).map((A,$)=>c.jsx("span",{children:A},$))}),c.jsxs("div",{className:"univer-flex univer-justify-end",children:[c.jsx(O.Tooltip,{title:s.t("sheet.cf.panel.createRule"),placement:"bottom",children:c.jsx("a",{className:"univer-size-5 univer-cursor-pointer",onClick:G,children:c.jsx(sr,{})})}),P.length&&ve?c.jsx(O.Tooltip,{title:s.t("sheet.cf.panel.clear"),placement:"bottom",children:c.jsx("a",{className:"univer-size-5 univer-cursor-pointer",onClick:Q,children:c.jsx(Ee,{className:"univer-text-red-500"})})}):c.jsx("div",{children:c.jsx(Ee,{className:"univer-text-gray-300"})})]})]}),c.jsx("div",{ref:I,children:T>0&&c.jsx(O.ReactGridLayout,{className:"[&_.react-grid-item]:univer-transition-none [&_.react-grid-placeholder]:univer-rounded [&_.react-grid-placeholder]:!univer-bg-gray-200",draggableHandle:".draggableHandle",layout:de,cols:12,rowHeight:60,width:T,margin:[0,10],onDragStop:F,onDragStart:x,children:ee==null?void 0:ee.map((A,$)=>c.jsx("div",{children:c.jsxs("div",{className:O.clsx("univer-group univer-relative univer-flex univer-items-center univer-justify-between univer-rounded univer-py-2 univer-pl-5 univer-pr-8 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",{"univer-bg-gray-100 dark:!univer-bg-gray-700":R===$}),onMouseMove:()=>{A.ranges!==S&&C(A.ranges)},onMouseLeave:()=>C([]),onClick:()=>{e(A)},children:[c.jsx("div",{className:O.clsx("univer-absolute univer-left-0 univer-hidden univer-size-5 univer-cursor-grab univer-items-center univer-justify-center univer-rounded group-hover:univer-flex","draggableHandle"),onClick:B=>B.stopPropagation(),children:c.jsx(dr,{})}),c.jsxs("div",{className:"univer-min-w-0 univer-max-w-full univer-flex-shrink univer-overflow-hidden",children:[c.jsx("div",{className:"univer-text-sm univer-text-gray-900 dark:!univer-text-white",children:ut(A,s)}),c.jsx("div",{className:"univer-text-xs univer-text-gray-400",children:A.ranges.map(B=>$e.serializeRange(B)).join(",")})]}),c.jsx("div",{children:c.jsx(ue,{rule:A.rule})}),c.jsx("div",{className:O.clsx("univer-absolute univer-right-1 univer-hidden univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded group-hover:univer-flex hover:univer-bg-gray-200",{"univer-flex univer-items-center univer-justify-center":R===$}),onClick:B=>{B.stopPropagation(),y(A),C([])},children:c.jsx(Ee,{})})]})},`${A.cfId}`))})})]})},st=r=>{const[e,l]=m.useState(r.rule),[n,a]=m.useState(!!r.rule),u=()=>{a(!0)},s=()=>{a(!1),l(void 0)},v=o=>{l(o),a(!0)};return c.jsx("div",{className:"univer-flex univer-h-full univer-flex-col univer-justify-between univer-py-4",children:n?c.jsx(tt,{onCancel:s,rule:e}):c.jsx(it,{onClick:v,onCreate:u})})};var ct=Object.getOwnPropertyDescriptor,ot=(r,e,l,n)=>{for(var a=n>1?void 0:n?ct(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},ye=(r,e)=>(l,n)=>e(l,n,r);const Oe="sheet.conditional.formatting.panel";let me=class extends i.Disposable{constructor(e,l,n,a,u){super();re(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=l,this._componentManager=n,this._sidebarService=a,this._localeService=u,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(i.UniverInstanceType.UNIVER_SHEET).subscribe(s=>{var v;s||(v=this._sidebarDisposable)==null||v.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(s=>{s.id===Oe&&(s.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const l={id:Oe,header:{title:this._localeService.t("sheet.cf.title")},children:{label:Oe,rule:e,key:i.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(l)}_initPanel(){this.disposeWithMe(this._componentManager.register(Oe,st))}};me=ot([ye(0,i.IUniverInstanceService),ye(1,i.Inject(i.Injector)),ye(2,i.Inject(j.ComponentManager)),ye(3,i.Inject(j.ISidebarService)),ye(4,i.Inject(i.LocaleService))],me);var Y=(r=>(r[r.createRule=1]="createRule",r[r.viewRule=2]="viewRule",r[r.highlightCell=3]="highlightCell",r[r.rank=4]="rank",r[r.formula=5]="formula",r[r.colorScale=6]="colorScale",r[r.dataBar=7]="dataBar",r[r.icon=8]="icon",r[r.clearRangeRules=9]="clearRangeRules",r[r.clearWorkSheetRules=10]="clearWorkSheetRules",r))(Y||{});const Ce={id:"sheet.operation.open.conditional.formatting.panel",type:i.CommandType.OPERATION,handler:(r,e)=>{var v;const l=r.get(me),n=r.get(U.SheetsSelectionsService),a=r.get(i.ICommandService),u=((v=n.getCurrentSelections())==null?void 0:v.map(o=>o.range))||[];switch(e.value){case 3:{l.openPanel({...t.createDefaultRule(),ranges:u});break}case 4:{const o={...t.createDefaultRule,ranges:u,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.rank}};l.openPanel(o);break}case 5:{const o={...t.createDefaultRule,ranges:u,rule:{type:t.CFRuleType.highlightCell,subType:t.CFSubRuleType.formula,value:"="}};l.openPanel(o);break}case 6:{const o={...t.createDefaultRule,ranges:u,rule:{type:t.CFRuleType.colorScale,config:[]}};l.openPanel(o);break}case 7:{const o={...t.createDefaultRule,ranges:u,rule:{type:t.CFRuleType.dataBar,isShowValue:!0}};l.openPanel(o);break}case 8:{const o={...t.createDefaultRule,ranges:u,rule:{type:t.CFRuleType.iconSet,config:[],isShowValue:!0}};l.openPanel(o);break}case 2:{l.openPanel();break}case 1:{l.openPanel({...t.createDefaultRule(),ranges:u});break}case 9:{a.executeCommand(t.ClearRangeCfCommand.id,{ranges:u});break}case 10:{a.executeCommand(t.ClearWorksheetCfCommand.id);break}}return!0}};var dt=Object.getOwnPropertyDescriptor,vt=(r,e,l,n)=>{for(var a=n>1?void 0:n?dt(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},be=(r,e)=>(l,n)=>e(l,n,r);D.ConditionalFormattingClearController=class extends i.Disposable{constructor(e,l,n,a,u){super(),this._injector=e,this._univerInstanceService=l,this._sheetInterceptorService=n,this._selectionManagerService=a,this._conditionalFormattingRuleModel=u,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var u;const l=[],n=[],a={redos:l,undos:n};if([U.ClearSelectionFormatCommand.id,U.ClearSelectionAllCommand.id].includes(e.id)){const s=(u=this._selectionManagerService.getCurrentSelections())==null?void 0:u.map(S=>S.range);if(!s)return a;const v=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET),o=v.getActiveSheet();if(!o)return a;const f=v.getUnitId(),d=o.getSheetId(),p=this._conditionalFormattingRuleModel.getSubunitRules(f,d);if(!p||!p.length)return a;const{redos:h,undos:b}=Sr(this._injector,p,s,f,d);l.push(...h),n.push(...b)}return a}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:l,ranges:n})=>{const a=[],u=[],s={redos:a,undos:u};if(!n||!n.length)return s;const v=this._conditionalFormattingRuleModel.getSubunitRules(e,l);if(!v||!v.length)return s;const{redos:o,undos:f}=Sr(this._injector,v,n,e,l);return a.push(...o),u.push(...f),s}}))}},D.ConditionalFormattingClearController=vt([be(0,i.Inject(i.Injector)),be(1,i.Inject(i.IUniverInstanceService)),be(2,i.Inject(U.SheetInterceptorService)),be(3,i.Inject(U.SheetsSelectionsService)),be(4,i.Inject(t.ConditionalFormattingRuleModel))],D.ConditionalFormattingClearController);function Sr(r,e,l,n,a){const u=[],s=[];return e.filter(v=>l.some(o=>v.ranges.some(f=>i.Rectangle.getIntersects(f,o)))).forEach(v=>{const f=new U.RangeMergeUtil().add(...v.ranges).subtract(...l).merge();if(f.length){const d={id:t.SetConditionalRuleMutation.id,params:{unitId:n,subUnitId:a,rule:{...v,ranges:f}}},p=t.setConditionalRuleMutationUndoFactory(r,d.params);u.push(d),s.push(...p)}else{const d={id:t.DeleteConditionalRuleMutation.id,params:{unitId:n,subUnitId:a,cfId:v.cfId}},p=t.DeleteConditionalRuleMutationUndoFactory(r,d.params);u.push(d),s.push(...p)}}),{redos:u,undos:s}}var pt=Object.getOwnPropertyDescriptor,ft=(r,e,l,n)=>{for(var a=n>1?void 0:n?pt(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},Ie=(r,e)=>(l,n)=>e(l,n,r);let Se=class extends i.Disposable{constructor(e,l,n,a,u){super();re(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=l,this._injector=n,this._conditionalFormattingViewModel=a,this._univerInstanceService=u,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:t.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,l,n)=>this._collectConditionalRule(e,l,n),onPasteCells:(e,l,n,a)=>{const{copyType:u=W.COPY_TYPE.COPY,pasteType:s}=a,{range:v}=e||{},{range:o}=l;return this._generateConditionalFormattingMutations(o,{copyType:u,pasteType:s,copyRange:v})}}))}_collectConditionalRule(e,l,n){const a=new i.ObjectMatrix,u={};this._copyInfo={matrix:a,info:{unitId:e,subUnitId:l,cfMap:u}};const s=this._injector.invoke(d=>U.rangeToDiscreteRange(n,d,e,l));if(!s)return;const{rows:v,cols:o}=s,f=new Set;v.forEach((d,p)=>{o.forEach((h,b)=>{const S=this._conditionalFormattingViewModel.getCellCfs(e,l,d,h);S&&(S.forEach(C=>f.add(C.cfId)),a.setValue(p,b,S.map(C=>C.cfId)))})}),f.forEach(d=>{const p=this._conditionalFormattingRuleModel.getRule(e,l,d);p&&(u[d]=p.rule)})}_generateConditionalFormattingMutations(e,l){const n=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET),a=n.getActiveSheet(),u=n.getUnitId();if(!a)return{redos:[],undos:[]};const s=a.getSheetId();if(l.copyType===W.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!l.copyRange)return{redos:[],undos:[]};if(![W.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,W.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,W.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(l.pasteType))return{redos:[],undos:[]};const{ranges:[o,f],mapFunc:d}=W.virtualizeDiscreteRanges([l.copyRange,e]),p=W.getRepeatRange(o,f,!0),h={};i.Range.foreach(f,(g,T)=>{const{row:w,col:I}=d(g,T),k=this._conditionalFormattingViewModel.getCellCfs(u,s,w,I);k&&k.forEach(V=>{if(!h[V.cfId]){const P=new i.ObjectMatrix;h[V.cfId]=P;const L=this._conditionalFormattingRuleModel.getRule(u,s,V.cfId);L==null||L.ranges.forEach(y=>{i.Range.foreach(y,(x,F)=>{P.setValue(x,F,1)})})}h[V.cfId].realDeleteValue(w,I)})});const{matrix:b,info:S}=this._copyInfo,C=[];let N=this._conditionalFormattingRuleModel.createCfId(u,s);const _={},E=g=>{if(_[g])return _[g];const T=S==null?void 0:S.cfMap[g],w=[...this._conditionalFormattingRuleModel.getSubunitRules(u,s)||[],...C].find(I=>i.Tools.diffValue(I.rule,T));if(w)return _[g]=w,w;{const I={rule:T,cfId:N,ranges:[],stopIfTrue:!1};return _[g]=I,C.push(I),N=`${Number(N)+1}`,I}};p.forEach(g=>{b&&b.forValue((T,w,I)=>{const k=i.Rectangle.getPositionRange({startRow:T,endRow:T,startColumn:w,endColumn:w},g.startRange),{row:V,col:P}=d(k.startRow,k.startColumn);I.forEach(L=>{if(!h[L]){const y=E(L),x=new i.ObjectMatrix;h[L]=x,y.ranges.forEach(F=>{i.Range.foreach(F,(G,Q)=>{x.setValue(G,Q,1)})})}h[L].setValue(V,P,1)})})});const M=[],R=[];for(const g in h){const T=h[g],w=U.findAllRectangle(U.createTopMatrixFromMatrix(T));if(!w.length){const I={unitId:u,subUnitId:s,cfId:g};M.push({id:t.DeleteConditionalRuleMutation.id,params:I}),R.push(...t.DeleteConditionalRuleMutationUndoFactory(this._injector,I))}if(C.some(I=>I.cfId===g)){const I=E(g),k={unitId:u,subUnitId:s,rule:{...I,ranges:w}};M.push({id:t.AddConditionalRuleMutation.id,params:k}),R.push(t.AddConditionalRuleMutationUndoFactory(this._injector,k))}else{const I=this._conditionalFormattingRuleModel.getRule(u,s,g);if(!I)continue;const k={unitId:u,subUnitId:s,rule:{...I,ranges:w}};M.push({id:t.SetConditionalRuleMutation.id,params:k}),R.push(...t.setConditionalRuleMutationUndoFactory(this._injector,k))}}return{redos:M,undos:R}}};Se=ft([Ie(0,i.Inject(W.ISheetClipboardService)),Ie(1,i.Inject(t.ConditionalFormattingRuleModel)),Ie(2,i.Inject(i.Injector)),Ie(3,i.Inject(t.ConditionalFormattingViewModel)),Ie(4,i.Inject(i.IUniverInstanceService))],Se);var ht=Object.getOwnPropertyDescriptor,gt=(r,e,l,n)=>{for(var a=n>1?void 0:n?ht(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},er=(r,e)=>(l,n)=>e(l,n,r);let Te=class extends i.Disposable{constructor(r,e,l){super(),this._localeService=r,this._commandService=e,this._sheetPermissionCheckController=l,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(r=>{r.id===t.AddCfCommand.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[U.WorkbookEditablePermission],rangeTypes:[U.RangeProtectionPermissionEditPoint],worksheetTypes:[U.WorksheetEditPermission,U.WorksheetSetCellStylePermission]},r.params.rule.ranges)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")))}))}};Te=gt([er(0,i.Inject(i.LocaleService)),er(1,i.ICommandService),er(2,i.Inject(U.SheetPermissionCheckController))],Te);var yt=Object.getOwnPropertyDescriptor,mt=(r,e,l,n)=>{for(var a=n>1?void 0:n?yt(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},Ue=(r,e)=>(l,n)=>e(l,n,r);let _e=class extends i.Disposable{constructor(r,e,l,n){super(),this._conditionalFormattingRuleModel=r,this._univerInstanceService=e,this._injector=l,this._refRangeService=n,this._initRefRange()}_initRefRange(){const r=new Map,e=(n,a,u)=>`${n}_${a}_${u}`,l=(n,a,u)=>{const s=o=>{const f=[...u.ranges],d=f.map(h=>U.handleDefaultRangeChangeWithEffectRefCommands(h,o)).filter(h=>!!h);if(t.isRangesEqual(d,f))return{redos:[],undos:[]};if(d.length){const h={unitId:n,subUnitId:a,rule:{...u,ranges:d}},b=[{id:t.SetConditionalRuleMutation.id,params:h}],S=t.setConditionalRuleMutationUndoFactory(this._injector,h);return{redos:b,undos:S}}else{const h={unitId:n,subUnitId:a,cfId:u.cfId},b=[{id:t.DeleteConditionalRuleMutation.id,params:h}],S=t.DeleteConditionalRuleMutationUndoFactory(this._injector,h);return{redos:b,undos:S}}},v=[];u.ranges.forEach(o=>{const f=this._refRangeService.registerRefRange(o,s);v.push(()=>f.dispose())}),r.set(e(n,a,u.cfId),()=>v.forEach(o=>o()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:a,subUnitId:u,rule:s}=n,v=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET),o=v.getActiveSheet();if(!(n.unitId!==v.getUnitId()||n.subUnitId!==(o==null?void 0:o.getSheetId())))switch(n.type){case"add":{l(n.unitId,n.subUnitId,n.rule);break}case"delete":{const f=r.get(e(a,u,s.cfId));f&&f();break}case"set":{const f=r.get(e(a,u,s.cfId));f&&f(),l(n.unitId,n.subUnitId,n.rule)}}})),this.disposeWithMe(i.toDisposable(()=>{r.forEach(n=>{n()}),r.clear()}))}};_e=mt([Ue(0,i.Inject(t.ConditionalFormattingRuleModel)),Ue(1,i.Inject(i.IUniverInstanceService)),Ue(2,i.Inject(i.Injector)),Ue(3,i.Inject(U.RefRangeService))],_e);var Ct=Object.getOwnPropertyDescriptor,bt=(r,e,l,n)=>{for(var a=n>1?void 0:n?Ct(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},ce=(r,e)=>(l,n)=>e(l,n,r);let we=class extends i.Disposable{constructor(e,l,n,a,u,s){super();re(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=l,this._univerInstanceService=n,this._renderManagerService=a,this._conditionalFormattingViewModel=u,this._conditionalFormattingRuleModel=s,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var l,n,a;const e=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getUnitId();(l=this._renderManagerService.getRenderById(e))==null||l.with(W.SheetSkeletonManagerService).reCalculate(),(a=(n=this._renderManagerService.getRenderById(e))==null?void 0:n.mainComponent)==null||a.makeDirty()}_initSkeleton(){this.disposeWithMe(J.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(fe.bufferTime(16),fe.filter(e=>!!e.length),fe.filter(e=>{const l=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!l)return!1;const n=l.getActiveSheet();return n?e.filter(a=>a.unitId===l.getUnitId()&&a.subUnitId===n.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(U.INTERCEPTOR_POINT.CELL_CONTENT,{effect:i.InterceptorEffectEnum.Style,handler:(e,l,n)=>{const a=this._conditionalFormattingService.composeStyle(l.unitId,l.subUnitId,l.row,l.col);if(!a)return n(e);const u=l.workbook.getStyles(),s=(typeof(e==null?void 0:e.s)=="string"?u.get(e==null?void 0:e.s):e==null?void 0:e.s)||{},v=e===l.rawData?{...l.rawData}:e;if(a.style){const o={...s,...a.style};Object.assign(v,{s:o})}return v.fontRenderExtension||(v.fontRenderExtension={},a.isShowValue!==void 0&&(v.fontRenderExtension.isSkip=!a.isShowValue)),a.dataBar&&(v.dataBar=a.dataBar),a.iconSet&&(v.iconSet=a.iconSet,v.fontRenderExtension.leftOffset=t.DEFAULT_PADDING+t.DEFAULT_WIDTH),n(v)},priority:10}))}};we=bt([ce(0,i.Inject(U.SheetInterceptorService)),ce(1,i.Inject(t.ConditionalFormattingService)),ce(2,i.Inject(i.IUniverInstanceService)),ce(3,i.Inject(ar.IRenderManagerService)),ce(4,i.Inject(t.ConditionalFormattingViewModel)),ce(5,i.Inject(t.ConditionalFormattingRuleModel))],we);const Tr="sheets-conditional-formatting-ui.config",ke={};var It=Object.defineProperty,St=Object.getOwnPropertyDescriptor,Tt=(r,e,l)=>e in r?It(r,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[e]=l,_t=(r,e,l,n)=>{for(var a=n>1?void 0:n?St(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},rr=(r,e)=>(l,n)=>e(l,n,r),_r=(r,e,l)=>Tt(r,typeof e!="symbol"?e+"":e,l);D.UniverSheetsConditionalFormattingMobileUIPlugin=class extends i.Plugin{constructor(e=ke,l,n,a){super(),this._config=e,this._injector=l,this._commandService=n,this._configService=a;const{menu:u,...s}=i.merge({},ke,this._config);u&&this._configService.setConfig("menu",u,{merge:!0}),this._configService.setConfig(Tr,s),this._initCommand(),this._injector.add([we]),this._injector.add([_e]),this._injector.add([Se]),this._injector.add([Te]),this._injector.add([se])}_initCommand(){[He,Be,We,qe,Ge,Ze,ze,Ye,Ke,Ce].forEach(e=>{this._commandService.registerCommand(e)})}},_r(D.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${t.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),_r(D.UniverSheetsConditionalFormattingMobileUIPlugin,"type",i.UniverInstanceType.UNIVER_SHEET),D.UniverSheetsConditionalFormattingMobileUIPlugin=_t([i.DependentOn(t.UniverSheetsConditionalFormattingPlugin),rr(1,i.Inject(i.Injector)),rr(2,i.Inject(i.ICommandService)),rr(3,i.IConfigService)],D.UniverSheetsConditionalFormattingMobileUIPlugin);var wt=Object.getOwnPropertyDescriptor,xt=(r,e,l,n)=>{for(var a=n>1?void 0:n?wt(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},xe=(r,e)=>(l,n)=>e(l,n,r);let Pe=class extends i.Disposable{constructor(r,e,l,n,a){super(),this._injector=r,this._univerInstanceService=e,this._autoFillService=l,this._conditionalFormattingRuleModel=n,this._conditionalFormattingViewModel=a,this._initAutoFill()}_initAutoFill(){const r=()=>({redos:[],undos:[]}),e=(a,u,s,v,o)=>{var b;const f=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getUnitId(),d=(b=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:b.getSheetId();if(!f||!d)return;const p={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},h={startRow:u.row,startColumn:u.col,endColumn:u.col,endRow:u.row};i.Range.foreach(s,(S,C)=>{const N=i.Rectangle.getPositionRange({startRow:S,startColumn:C,endColumn:C,endRow:S},p),_=i.Rectangle.getPositionRange({startRow:S,startColumn:C,endColumn:C,endRow:S},h),{row:E,col:M}=o(N.startRow,N.startColumn),R=this._conditionalFormattingViewModel.getCellCfs(f,d,E,M),{row:g,col:T}=o(_.startRow,_.startColumn),w=this._conditionalFormattingViewModel.getCellCfs(f,d,g,T);w&&w.forEach(I=>{let k=v.get(I.cfId);if(!v.get(I.cfId)){const V=this._conditionalFormattingRuleModel.getRule(f,d,I.cfId);if(!V)return;k=new i.ObjectMatrix,V.ranges.forEach(P=>{i.Range.foreach(P,(L,y)=>{k.setValue(L,y,1)})}),v.set(I.cfId,k)}k.realDeleteValue(g,T)}),R&&R.forEach(I=>{let k=v.get(I.cfId);if(!v.get(I.cfId)){const V=this._conditionalFormattingRuleModel.getRule(f,d,I.cfId);if(!V)return;k=new i.ObjectMatrix,V.ranges.forEach(P=>{i.Range.foreach(P,(L,y)=>{k.setValue(L,y,1)})}),v.set(I.cfId,k)}k.setValue(g,T,1)})})},l=(a,u)=>{var _,E,M;const s=(_=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET))==null?void 0:_.getUnitId(),v=(M=(E=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET))==null?void 0:E.getActiveSheet())==null?void 0:M.getSheetId(),o=new Map,f=[],d=[];if(!s||!v)return r();const p=W.virtualizeDiscreteRanges([a,u]),[h,b]=p.ranges,{mapFunc:S}=p,C={row:h.startRow,col:h.startColumn};return W.getAutoFillRepeatRange(h,b).forEach(R=>{e(C,R.repeatStartCell,R.relativeRange,o,S)}),o.forEach((R,g)=>{const T=this._conditionalFormattingRuleModel.getRule(s,v,g);if(!T)return;const w=U.findAllRectangle(U.createTopMatrixFromMatrix(R));if(w.length){const I={unitId:s,subUnitId:v,rule:{...T,ranges:w}};f.push({id:t.SetConditionalRuleMutation.id,params:I}),d.push(...t.setConditionalRuleMutationUndoFactory(this._injector,I))}else{const I={unitId:s,subUnitId:v,cfId:T.cfId};f.push({id:t.DeleteConditionalRuleMutation.id,params:I}),d.push(...t.DeleteConditionalRuleMutationUndoFactory(this._injector,I))}}),{undos:d,redos:f}},n={id:t.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(a,u,s)=>{if(s===W.APPLY_TYPE.COPY||s===W.APPLY_TYPE.ONLY_FORMAT||s===W.APPLY_TYPE.SERIES){const{source:v,target:o}=a;return l(v,o)}return r()}};this.disposeWithMe(this._autoFillService.addHook(n))}};Pe=xt([xe(0,i.Inject(i.Injector)),xe(1,i.Inject(i.IUniverInstanceService)),xe(2,i.Inject(W.IAutoFillService)),xe(3,i.Inject(t.ConditionalFormattingRuleModel)),xe(4,i.Inject(t.ConditionalFormattingViewModel))],Pe);var Nt=Object.getOwnPropertyDescriptor,Et=(r,e,l,n)=>{for(var a=n>1?void 0:n?Nt(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},wr=(r,e)=>(l,n)=>e(l,n,r);let De=class extends i.Disposable{constructor(r,e){super(),this._sheetInterceptorService=r,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(i.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(U.AFTER_CELL_EDIT,{handler:(r,e,l)=>{var s,v,o;r||l(r);const n=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col),a=(s=n==null?void 0:n.style)!=null?s:{},u=Object.keys(a);if(r!=null&&r.p)return(o=(v=r.p.body)==null?void 0:v.textRuns)==null||o.forEach(f=>{f.ts&&u.forEach(d=>{var p;(p=f.ts)==null||delete p[d]})}),l(r);{const f={...(typeof(r==null?void 0:r.s)=="string"?e.workbook.getStyles().get(r.s):r==null?void 0:r.s)||{}};u.forEach(p=>{delete f[p]});const d={...r,s:{...f}};return l(d)}}})))}};De=Et([wr(0,i.Inject(U.SheetInterceptorService)),wr(1,i.Inject(t.ConditionalFormattingService))],De);const xr=[U.SetWorksheetActiveOperation.id,t.AddConditionalRuleMutation.id,t.SetConditionalRuleMutation.id,t.DeleteConditionalRuleMutation.id,t.MoveConditionalRuleMutation.id],Ne=[{label:{name:"sheet.cf.ruleType.highlightCell",selectable:!1},value:Y.highlightCell},{label:{name:"sheet.cf.panel.rankAndAverage",selectable:!1},value:Y.rank},{label:{name:"sheet.cf.ruleType.formula",selectable:!1},value:Y.formula},{label:{name:"sheet.cf.ruleType.colorScale",selectable:!1},value:Y.colorScale},{label:{name:"sheet.cf.ruleType.dataBar",selectable:!1},value:Y.dataBar},{label:{name:"sheet.cf.ruleType.iconSet",selectable:!1},value:Y.icon},{label:{name:"sheet.cf.menu.manageConditionalFormatting",selectable:!1},value:Y.viewRule},{label:{name:"sheet.cf.menu.createConditionalFormatting",selectable:!1},value:Y.createRule},{label:{name:"sheet.cf.menu.clearRangeRules",selectable:!1},value:Y.clearRangeRules,disabled:!1},{label:{name:"sheet.cf.menu.clearWorkSheetRules",selectable:!1},value:Y.clearWorkSheetRules}],Rt=r=>{const e=r.get(U.SheetsSelectionsService),l=r.get(i.ICommandService),n=r.get(i.IUniverInstanceService),a=r.get(t.ConditionalFormattingRuleModel),u=new J.Observable(o=>J.merge(e.selectionMoveEnd$,e.selectionSet$,new J.Observable(f=>{const d=l.onCommandExecuted(p=>{var C;const{id:h,params:b}=p,S=(C=n.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET))==null?void 0:C.getUnitId();xr.includes(h)&&b.unitId===S&&f.next(null)});return()=>d.dispose()})).pipe(fe.debounceTime(16)).subscribe(()=>{var C;const f=((C=e.getCurrentSelections())==null?void 0:C.map(N=>N.range))||[],d=n.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!d)return;const p=d.getActiveSheet();if(!p)return;const S=(a.getSubunitRules(d.getUnitId(),p.getSheetId())||[]).filter(N=>N.ranges.some(_=>f.some(E=>i.Rectangle.intersects(E,_)))).map(N=>N.ranges).every(N=>U.checkRangesEditablePermission(r,d.getUnitId(),p.getSheetId(),N));o.next(S)})),s=new J.Observable(o=>new J.Observable(f=>{const d=l.onCommandExecuted(p=>{var C;const{id:h,params:b}=p,S=(C=n.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET))==null?void 0:C.getUnitId();xr.includes(h)&&b.unitId===S&&f.next(null)});return()=>d.dispose()}).pipe(fe.debounceTime(16)).subscribe(()=>{const f=n.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET);if(!f)return;const d=f.getActiveSheet();if(!d)return;const p=a.getSubunitRules(f.getUnitId(),d.getSheetId())||[];if(!p.length)return o.next(!1),!1;const h=p.map(b=>b.ranges).every(b=>U.checkRangesEditablePermission(r,f.getUnitId(),d.getSheetId(),b));o.next(h)})),v=new J.Observable(o=>{u.subscribe(f=>{const d=Ne.find(p=>p.value===Y.clearRangeRules);d&&(d.disabled=!f,o.next(Ne))}),s.subscribe(f=>{const d=Ne.find(p=>p.value===Y.clearWorkSheetRules);d&&(d.disabled=!f,o.next(Ne))}),o.next(Ne)});return{id:Ce.id,type:j.MenuItemType.SELECTOR,icon:"ConditionsDoubleIcon",tooltip:"sheet.cf.title",selections:v,hidden$:j.getMenuHiddenObservable(r,i.UniverInstanceType.UNIVER_SHEET),disabled$:W.getCurrentRangeDisable$(r,{workbookTypes:[U.WorkbookEditablePermission],worksheetTypes:[U.WorksheetSetCellStylePermission,U.WorksheetEditPermission],rangeTypes:[U.RangeProtectionPermissionEditPoint]})}},Mt={[j.RibbonDataGroup.RULES]:{[Ce.id]:{order:1,menuItemFactory:Rt}}};var Vt=Object.getOwnPropertyDescriptor,Ot=(r,e,l,n)=>{for(var a=n>1?void 0:n?Vt(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},Nr=(r,e)=>(l,n)=>e(l,n,r);let Le=class extends i.Disposable{constructor(e,l){super();re(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=l,this._menuManagerService.mergeMenu(Mt)}};Le=Ot([Nr(0,i.Inject(i.Injector)),Nr(1,j.IMenuManagerService)],Le);var Ut=Object.getOwnPropertyDescriptor,kt=(r,e,l,n)=>{for(var a=n>1?void 0:n?Ut(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},oe=(r,e)=>(l,n)=>e(l,n,r);const Pt=(r,e)=>{const l=d=>d.endRow-d.startRow+1,n=d=>d.endColumn-d.startColumn+1,a=l(e)%l(r),u=n(e)%n(r),s=Math.floor(l(e)/l(r)),v=Math.floor(n(e)/n(r)),o=[],f={startRow:0,endRow:l(r)-1,startColumn:0,endColumn:n(r)-1};if(l(e)===1&&n(e)===1){const d={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return o.push({repeatRelativeRange:f,startRange:d}),o}for(let d=0;d<s+(a?.1:0);d++)for(let p=0;p<v+(u?.1:0);p++){const h=l(r)*d,b=n(r)*p,S={startRow:h+e.startRow,endRow:h+e.startRow,startColumn:b+e.startColumn,endColumn:b+e.startColumn};let C=f;d===s&&a&&(C={...C},C.endRow=C.endRow-(l(r)-a)),p===v&&u&&(C={...C},C.endColumn=C.endColumn-(n(r)-u)),o.push({repeatRelativeRange:C,startRange:S})}return o};let je=class extends i.Disposable{constructor(e,l,n,a,u,s){super();re(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=l,this._formatPainterService=n,this._sheetsSelectionsService=a,this._conditionalFormattingRuleModel=u,this._conditionalFormattingViewModel=s,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),l=(u,s,v,o,f)=>{const{unitId:d,subUnitId:p}=this._painterConfig,{targetUnitId:h,targetSubUnitId:b}=f,S={startRow:u.row,startColumn:u.col,endColumn:u.col,endRow:u.row},C={startRow:s.row,startColumn:s.col,endColumn:s.col,endRow:s.row};i.Range.foreach(v,(N,_)=>{const E=i.Rectangle.getPositionRange({startRow:N,startColumn:_,endColumn:_,endRow:N},S),M=i.Rectangle.getPositionRange({startRow:N,startColumn:_,endColumn:_,endRow:N},C),R=this._conditionalFormattingViewModel.getCellCfs(d,p,E.startRow,E.startColumn),g=this._conditionalFormattingViewModel.getCellCfs(h,b,M.startRow,M.startColumn);g&&g.forEach(T=>{let w=o.get(T.cfId);if(!o.get(T.cfId)){const I=this._conditionalFormattingRuleModel.getRule(h,b,T.cfId);if(!I)return;w=new i.ObjectMatrix,I.ranges.forEach(k=>{i.Range.foreach(k,(V,P)=>{w.setValue(V,P,1)})}),o.set(T.cfId,w)}w.realDeleteValue(M.startRow,M.startColumn)}),R&&R.forEach(T=>{const w=o.get(T.cfId);w&&w.setValue(M.startRow,M.startColumn,1)})})},n=(u,s,v)=>{var E;const{range:o,unitId:f,subUnitId:d}=this._painterConfig,p=u!==f||d!==s,h=new Map,b=[],S=[];if(!u||!s||!f||!d)return e();const C=(E=this._conditionalFormattingRuleModel.getSubunitRules(f,d))!=null?E:[];C==null||C.forEach(M=>{const{ranges:R,cfId:g}=M;if(R.some(T=>i.Rectangle.intersects(o,T))){const T=new i.ObjectMatrix;p||R.forEach(w=>{i.Range.foreach(w,(I,k)=>{T.setValue(I,k,1)})}),h.set(g,T)}});const N={row:o.startRow,col:o.startColumn};return Pt(o,v).forEach(M=>{l(N,{row:M.startRange.startRow,col:M.startRange.startColumn},M.repeatRelativeRange,h,{targetUnitId:u,targetSubUnitId:s})}),h.forEach((M,R)=>{if(p){const g=this._conditionalFormattingRuleModel.getRule(u,s,R),T=U.findAllRectangle(U.createTopMatrixFromMatrix(M));if(g)if(T.length){const w={unitId:u,subUnitId:s,rule:{...g,ranges:T}};b.push({id:t.SetConditionalRuleMutation.id,params:w}),S.push(...t.setConditionalRuleMutationUndoFactory(this._injector,w))}else{const w={unitId:u,subUnitId:s,cfId:g.cfId};b.push({id:t.DeleteConditionalRuleMutation.id,params:w}),S.push(...t.DeleteConditionalRuleMutationUndoFactory(this._injector,w))}else if(T.length){const w=this._conditionalFormattingRuleModel.getRule(f,d,R);if(w){const I={unitId:u,subUnitId:s,rule:{...i.Tools.deepClone(w),cfId:this._conditionalFormattingRuleModel.createCfId(u,s),ranges:T}};b.push({id:t.AddConditionalRuleMutation.id,params:I}),S.push(t.AddConditionalRuleMutationUndoFactory(this._injector,I))}}}else{const g=this._conditionalFormattingRuleModel.getRule(f,d,R);if(!g)return;const T=U.findAllRectangle(U.createTopMatrixFromMatrix(M));if(T.length){const w={unitId:f,subUnitId:d,rule:{...g,ranges:T}};b.push({id:t.SetConditionalRuleMutation.id,params:w}),S.push(...t.setConditionalRuleMutationUndoFactory(this._injector,w))}else{const w={unitId:f,subUnitId:d,cfId:g.cfId};b.push({id:t.DeleteConditionalRuleMutation.id,params:w}),S.push(...t.DeleteConditionalRuleMutationUndoFactory(this._injector,w))}}}),{undos:S,redos:b}},a={id:t.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:u=>{var s,v,o;switch(u){case W.FormatPainterStatus.INFINITE:case W.FormatPainterStatus.ONCE:{const f=(s=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getUnitId(),d=(o=(v=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET))==null?void 0:v.getActiveSheet())==null?void 0:o.getSheetId(),p=this._sheetsSelectionsService.getCurrentLastSelection(),h=p==null?void 0:p.range;f&&d&&h&&(this._painterConfig={unitId:f,subUnitId:d,range:h});break}case W.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(u,s,v)=>this._painterConfig?n(u,s,v):{redos:[],undos:[]}};this._formatPainterService.addHook(a)}};je=kt([oe(0,i.Inject(i.Injector)),oe(1,i.Inject(i.IUniverInstanceService)),oe(2,i.Inject(W.IFormatPainterService)),oe(3,i.Inject(U.SheetsSelectionsService)),oe(4,i.Inject(t.ConditionalFormattingRuleModel)),oe(5,i.Inject(t.ConditionalFormattingViewModel))],je);var Dt=Object.getOwnPropertyDescriptor,Lt=(r,e,l,n)=>{for(var a=n>1?void 0:n?Dt(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},tr=(r,e)=>(l,n)=>e(l,n,r);let Ae=class extends i.Disposable{constructor(r,e,l){super(),this._conditionalFormattingViewModel=r,this._univerInstanceService=e,this._renderManagerService=l,this._init()}_init(){const r=this._univerInstanceService.getCurrentUnitForType(i.UniverInstanceType.UNIVER_SHEET),e=l=>{const n=l.getUnitId(),a=this._renderManagerService.getRenderById(n);if(!a)return;const u=a.with(W.SheetSkeletonManagerService);this.disposeWithMe(u.currentSkeleton$.subscribe(s=>{if(s){const v=s.skeleton.rowColumnSegment,o=v.endColumn-v.startColumn+1,d=(v.endRow-v.startRow+1)*o*9,p=Math.max(t.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,d);this._conditionalFormattingViewModel.setCacheLength(p)}}))};r&&e(r),this._univerInstanceService.getCurrentTypeOfUnit$(i.UniverInstanceType.UNIVER_SHEET).subscribe(l=>{l&&e(l)})}};Ae=Lt([tr(0,i.Inject(t.ConditionalFormattingViewModel)),tr(1,i.IUniverInstanceService),tr(2,ar.IRenderManagerService)],Ae);var jt=Object.defineProperty,At=Object.getOwnPropertyDescriptor,Ft=(r,e,l)=>e in r?jt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[e]=l,$t=(r,e,l,n)=>{for(var a=n>1?void 0:n?At(e,l):e,u=r.length-1,s;u>=0;u--)(s=r[u])&&(a=s(a)||a);return a},nr=(r,e)=>(l,n)=>e(l,n,r),Er=(r,e,l)=>Ft(r,typeof e!="symbol"?e+"":e,l);D.UniverSheetsConditionalFormattingUIPlugin=class extends i.Plugin{constructor(e=ke,l,n,a){super(),this._config=e,this._injector=l,this._commandService=n,this._configService=a;const{menu:u,...s}=i.merge({},ke,this._config);u&&this._configService.setConfig("menu",u,{merge:!0}),this._configService.setConfig(Tr,s),this._initCommand()}onStarting(){i.registerDependencies(this._injector,[[we],[_e],[Se],[Pe],[Te],[me],[Le],[se],[De],[D.ConditionalFormattingClearController],[je],[Ae]]),i.touchDependencies(this._injector,[[we]])}onReady(){i.touchDependencies(this._injector,[[Le],[me]])}onRendered(){i.touchDependencies(this._injector,[[Pe],[D.ConditionalFormattingClearController],[Se],[De],[se],[je],[Te],[_e],[Ae]])}_initCommand(){[He,Be,We,qe,Ge,Ze,ze,Ye,Ke,Ce].forEach(e=>{this._commandService.registerCommand(e)})}},Er(D.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${t.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),Er(D.UniverSheetsConditionalFormattingUIPlugin,"type",i.UniverInstanceType.UNIVER_SHEET),D.UniverSheetsConditionalFormattingUIPlugin=$t([i.DependentOn(t.UniverSheetsConditionalFormattingPlugin),nr(1,i.Inject(i.Injector)),nr(2,i.Inject(i.ICommandService)),nr(3,i.IConfigService)],D.UniverSheetsConditionalFormattingUIPlugin),D.AddAverageCfCommand=He,D.AddColorScaleConditionalRuleCommand=Be,D.AddDataBarConditionalRuleCommand=We,D.AddDuplicateValuesCfCommand=qe,D.AddNumberCfCommand=Ge,D.AddRankCfCommand=Ze,D.AddTextCfCommand=ze,D.AddTimePeriodCfCommand=Ye,D.AddUniqueValuesCfCommand=Ke,D.OpenConditionalFormattingOperator=Ce,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})}));
11
11
 
12
12
 
13
13
  // index
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/preset-sheets-conditional-formatting",
3
- "version": "0.10.9",
3
+ "version": "0.10.10-experimental.20251016-33b0941",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "author": "DreamNum Co., Ltd. <developer@univer.ai>",
@@ -58,21 +58,21 @@
58
58
  "rxjs": ">=7.0.0"
59
59
  },
60
60
  "dependencies": {
61
- "@univerjs/sheets-conditional-formatting": "0.10.9",
62
- "@univerjs/sheets-conditional-formatting-ui": "0.10.9"
61
+ "@univerjs/sheets-conditional-formatting": "0.10.10-experimental.20251016-33b0941",
62
+ "@univerjs/sheets-conditional-formatting-ui": "0.10.10-experimental.20251016-33b0941"
63
63
  },
64
64
  "devDependencies": {
65
- "@univerjs/core": "0.10.9",
65
+ "@univerjs/core": "0.10.10-experimental.20251016-33b0941",
66
66
  "react": "18.3.1",
67
67
  "react-dom": "18.3.1",
68
68
  "rxjs": "7.8.2",
69
- "typescript": "^5.9.2",
70
- "@univerjs-infra/shared": "0.10.9"
69
+ "typescript": "^5.9.3",
70
+ "@univerjs-infra/shared": "0.10.10"
71
71
  },
72
72
  "scripts": {
73
73
  "prebuild:preset": "tsx prepare.ts",
74
74
  "build:preset": "tsx build.ts",
75
- "lint:types": "tsc --noEmit"
75
+ "typecheck": "tsc --noEmit"
76
76
  },
77
77
  "module": "./lib/es/index.js"
78
78
  }