@univerjs/sheets-conditional-formatting 0.20.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cjs/index.js CHANGED
@@ -1 +1,3007 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`@univerjs/core`),t=require(`@univerjs/sheets`),n=require(`rxjs`),r=require(`@univerjs/engine-formula`),i=require(`rxjs/operators`),a=require(`@univerjs/engine-render`);const o=`SHEET_CONDITIONAL_FORMATTING_PLUGIN`;let s=function(e){return e.beginsWith=`beginsWith`,e.endsWith=`endsWith`,e.containsText=`containsText`,e.notContainsText=`notContainsText`,e.equal=`equal`,e.notEqual=`notEqual`,e.containsBlanks=`containsBlanks`,e.notContainsBlanks=`notContainsBlanks`,e.containsErrors=`containsErrors`,e.notContainsErrors=`notContainsErrors`,e}({}),c=function(e){return e.today=`today`,e.yesterday=`yesterday`,e.tomorrow=`tomorrow`,e.last7Days=`last7Days`,e.thisMonth=`thisMonth`,e.lastMonth=`lastMonth`,e.nextMonth=`nextMonth`,e.thisWeek=`thisWeek`,e.lastWeek=`lastWeek`,e.nextWeek=`nextWeek`,e}({}),l=function(e){return e.greaterThan=`greaterThan`,e.greaterThanOrEqual=`greaterThanOrEqual`,e.lessThan=`lessThan`,e.lessThanOrEqual=`lessThanOrEqual`,e.notBetween=`notBetween`,e.between=`between`,e.equal=`equal`,e.notEqual=`notEqual`,e}({}),u=function(e){return e.highlightCell=`highlightCell`,e.dataBar=`dataBar`,e.colorScale=`colorScale`,e.iconSet=`iconSet`,e}({}),d=function(e){return e.uniqueValues=`uniqueValues`,e.duplicateValues=`duplicateValues`,e.rank=`rank`,e.text=`text`,e.timePeriod=`timePeriod`,e.number=`number`,e.average=`average`,e.formula=`formula`,e}({}),f=function(e){return e.num=`num`,e.min=`min`,e.max=`max`,e.percent=`percent`,e.percentile=`percentile`,e.formula=`formula`,e}({});const p=()=>({cfId:void 0,ranges:[],stopIfTrue:!1,rule:{type:u.highlightCell,subType:d.text,operator:s.containsText}}),m=(e,t)=>{switch(e){case d.text:if([s.beginsWith,s.containsText,s.endsWith,s.equal,s.notContainsText,s.notEqual].includes(t))return``;break;case d.number:return[l.between,l.notBetween].includes(t)?[10,100]:10}return``},h=(e,t)=>{switch(e){case f.formula:return`=`;case f.max:case f.min:return``;case f.percent:case f.percentile:case f.num:return t===void 0?10:t}return``},g=(e,t,n)=>{if(!t)return null;let r=t.findIndex(t=>n(t)===e.id);if(r<0)return null;switch(e.type){case`after`:return r+1;case`before`:return r-1;case`self`:return r}},_=(e,t,n,r)=>{if(!n)return null;let i=g(e,n,r),a=g(t,n,r);if(i===null||a===null||i===a)return;let o=n.splice(i,1)[0];switch(i<a&&(a=g(t,n,r)),t.type){case`before`:n.splice(a+1,0,o);break;case`self`:case`after`:n.splice(a,0,o);break}},v=(e,t,n,r)=>{if(e.type===`after`&&[`after`,`before`].includes(t.type))return[e,t];let i={...e},a={...t};if(i.type!==`after`){let e=g(i,n,r);if(e===null)return null;if(e-1<0){let t=n[e+1];if(t)i.id=r(t),i.type=`before`;else return null}else i.id=r(n[e-1]),i.type=`after`}if(![`after`,`before`].includes(a.type)){let e=g(a,n,r);if(e===null)return null;if(e===0)a.type=`before`;else if(e-1>=0)a.id=r(n[e-1]),a.type=`after`;else if(e+1<=n.length-1)a.id=r(n[e+1]),a.type=`before`;else return null}return i.id===a.id&&i.type===a.type?null:[i,a]},y=(e,t)=>{if([`after`,`before`].includes(t.type)){if(e.type===`after`)return[t,e];if(e.type===`before`)return[t,{...e,type:`self`}]}return null},b=(e,t)=>e.id===t.id&&e.type===t.type,x=()=>`${(0,e.generateRandomId)(8)}`;function S(e){"@babel/helpers - typeof";return S=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},S(e)}function C(e,t){if(S(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(S(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function w(e){var t=C(e,`string`);return S(t)==`symbol`?t:t+``}function T(e,t,n){return(t=w(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var E=class{constructor(){T(this,`_model`,new Map),T(this,`_ruleChange$`,new n.Subject),T(this,`$ruleChange`,this._ruleChange$.asObservable())}_ensureList(e,t){let n=this.getSubunitRules(e,t);if(!n){n=[];let r=this._model.get(e);r||(r=new Map,this._model.set(e,r)),r.set(t,n)}return n}getRule(e,t,n){let r=this.getSubunitRules(e,t);return r?r.find(e=>e.cfId===n):null}getUnitRules(e){return this._model.get(e)||null}getSubunitRules(e,t){var n;return((n=this._model.get(e))==null?void 0:n.get(t))||null}getAll(){return this._model}deleteRule(e,t,n){let r=this.getSubunitRules(e,t);if(r){let i=r.findIndex(e=>e.cfId===n),a=r[i];a&&(r.splice(i,1),this._ruleChange$.next({rule:a,subUnitId:t,unitId:e,type:`delete`}))}}setRule(t,n,r,i){let a=this._ensureList(t,n).find(e=>e.cfId===i);if(a){let i=e.Tools.deepClone(a);Object.assign(a,r),this._ruleChange$.next({rule:a,subUnitId:n,unitId:t,type:`set`,oldRule:i})}}addRule(e,t,n){let r=this._ensureList(e,t);r.find(e=>e.cfId===n.cfId)||r.unshift(n),this._ruleChange$.next({rule:n,subUnitId:t,unitId:e,type:`add`})}moveRulePriority(e,t,n,r){let i=this._ensureList(e,t),a=g(n,i,e=>e.cfId),o=g(r,i,e=>e.cfId);if(o===null||a===null||o===a)return;let s=i[a];s&&(_(n,r,i,e=>e.cfId),this._ruleChange$.next({rule:s,subUnitId:t,unitId:e,type:`sort`}))}createCfId(e,t){return x()}deleteUnitId(e){this._model.delete(e)}};const D={type:e.CommandType.MUTATION,id:`sheet.mutation.move-conditional-rule`,handler(e,t){if(!t)return!1;let{unitId:n,subUnitId:r,start:i,end:a}=t;return e.get(E).moveRulePriority(n,r,i,a),!0}},ee=e=>{let{unitId:t,subUnitId:n}=e,r=y(e.start,e.end);if(!r)return[];let[i,a]=r;return[{id:D.id,params:{unitId:t,subUnitId:n,start:i,end:a}}]},O=(t,n)=>{let r=t.get(E),{unitId:i,subUnitId:a,cfId:o}=n,s=[...r.getSubunitRules(i,a)||[]],c=s.findIndex(e=>e.cfId===o),l=s[c-1];if(c>-1){let t=s[c],n=[{id:j.id,params:{unitId:i,subUnitId:a,rule:e.Tools.deepClone(t)}}];if(s.splice(c,1),c!==0){let e=s[0];if(e){let t=v({id:e.cfId,type:`before`},{id:l.cfId,type:`after`},s,e=>e.cfId);if(!t)return n;let[r,o]=t,c={unitId:i,subUnitId:a,start:r,end:o};n.push({id:D.id,params:c})}}return n}return[]},k={type:e.CommandType.MUTATION,id:`sheet.mutation.delete-conditional-rule`,handler(e,t){if(!t)return!1;let{unitId:n,subUnitId:r,cfId:i}=t;return e.get(E).deleteRule(n,r,i),!0}},A=(e,t)=>({id:k.id,params:{unitId:t.unitId,subUnitId:t.subUnitId,cfId:t.rule.cfId}}),j={type:e.CommandType.MUTATION,id:`sheet.mutation.add-conditional-rule`,handler(e,t){if(!t)return!1;let{unitId:n,subUnitId:r,rule:i}=t;return e.get(E).addRule(n,r,i),!0}},te={type:e.CommandType.COMMAND,id:`sheet.command.add-conditional-rule`,handler(n,r){if(!r)return!1;let{rule:i}=r,a=n.get(e.IUndoRedoService),o=n.get(e.ICommandService),s=n.get(E),c=(0,t.getSheetCommandTarget)(n.get(e.IUniverInstanceService),r);if(!c)return!1;let{unitId:l,subUnitId:u}=c,d=s.createCfId(l,u),f={unitId:l,subUnitId:u,rule:{...i,cfId:i.cfId||d}},p=A(n,f),m=o.syncExecuteCommand(j.id,f);return m&&a.pushUndoRedo({unitID:l,redoMutations:[{id:j.id,params:f}],undoMutations:[p]}),m}},M={type:e.CommandType.MUTATION,id:`sheet.mutation.set-conditional-rule`,handler(e,t){if(!t)return!1;let{unitId:n,subUnitId:r,rule:i}=t,a=t.cfId||t.rule.cfId;return e.get(E).setRule(n,r,i,a),!0}},N=(t,n)=>{let r=t.get(E),{unitId:i,subUnitId:a}=n,o=n.cfId||n.rule.cfId,s=r.getRule(i,a,o);return s?[{id:M.id,params:{unitId:i,subUnitId:a,cfId:o,rule:e.Tools.deepClone(s)}}]:[]},ne={type:e.CommandType.COMMAND,id:`sheet.command.clear-range-conditional-rule`,handler(n,r){var i;if(!r)return!1;let a=n.get(E),o=n.get(e.IUniverInstanceService),s=n.get(e.ICommandService),c=n.get(e.IUndoRedoService),l=n.get(t.SheetsSelectionsService),u=(0,t.getSheetCommandTarget)(o,r);if(!u)return!1;let{unitId:d,subUnitId:f}=u,p=((i=l.getCurrentSelections())==null?void 0:i.map(e=>e.range))||[],m=a.getSubunitRules(d,f);if(!(m!=null&&m.length)||!p.length)return!1;let h=[],g=[];m.forEach(r=>{let i=new e.ObjectMatrix;r.ranges.forEach(t=>{e.Range.foreach(t,(e,t)=>{i.setValue(e,t,1)})}),p.forEach(t=>{e.Range.foreach(t,(e,t)=>{i.realDeleteValue(e,t)})});let a=(0,t.findAllRectangle)((0,t.createTopMatrixFromMatrix)(i));if(a.length){let e={unitId:d,subUnitId:f,rule:{...r,ranges:a}},t=N(n,e);h.push({id:M.id,params:e}),g.push(...t)}else{let e={unitId:d,subUnitId:f,cfId:r.cfId},t=O(n,e);h.push({id:k.id,params:e}),g.push(...t)}});let _=(0,e.sequenceExecute)(h,s).result;return _&&c.pushUndoRedo({unitID:d,redoMutations:h,undoMutations:g}),_}},re={type:e.CommandType.COMMAND,id:`sheet.command.clear-worksheet-conditional-rule`,handler(n,r){let i=n.get(E),a=n.get(e.IUniverInstanceService),o=n.get(e.ICommandService),s=n.get(e.IUndoRedoService),c=(0,t.getSheetCommandTarget)(a,r);if(!c)return!1;let{unitId:l,subUnitId:u}=c,d=i.getSubunitRules(l,u);if(!(d!=null&&d.length))return!1;let f=d.map(e=>({cfId:e.cfId,unitId:l,subUnitId:u})),p=f.map(e=>({id:k.id,params:e})),m=f.map(e=>O(n,e)[0]),h=(0,e.sequenceExecute)(p,o).result;return h&&s.pushUndoRedo({unitID:l,redoMutations:p,undoMutations:m}),h}},P={type:e.CommandType.COMMAND,id:`sheet.command.delete-conditional-rule`,handler(n,r){if(!r)return!1;let i=n.get(e.IUndoRedoService),a=n.get(e.ICommandService),o=(0,t.getSheetCommandTarget)(n.get(e.IUniverInstanceService),r);if(!o)return!1;let{unitId:s,subUnitId:c}=o,l={unitId:s,subUnitId:c,cfId:r.cfId},u=O(n,l),d=a.syncExecuteCommand(k.id,l);return d&&i.pushUndoRedo({unitID:s,undoMutations:u,redoMutations:[{id:k.id,params:l}]}),d}},ie={type:e.CommandType.COMMAND,id:`sheet.command.move-conditional-rule`,handler(n,r){if(!r)return!1;let i=n.get(e.IUndoRedoService),a=n.get(e.ICommandService),o=n.get(e.IUniverInstanceService),s=n.get(E),c=(0,t.getSheetCommandTarget)(o,r);if(!c)return!1;let{unitId:l,subUnitId:u}=c,d=v(r.start,r.end,s.getSubunitRules(l,u)||[],e=>e.cfId);if(!d)return!1;let[f,p]=d,m={unitId:l,subUnitId:u,start:f,end:p},h=ee(m),g=a.syncExecuteCommand(D.id,m);return g&&i.pushUndoRedo({unitID:l,redoMutations:[{id:D.id,params:m}],undoMutations:h}),g}},ae={type:e.CommandType.COMMAND,id:`sheet.command.set-conditional-rule`,handler(n,r){if(!r)return!1;let i=n.get(e.IUndoRedoService),a=n.get(e.ICommandService),o=(0,t.getSheetCommandTarget)(n.get(e.IUniverInstanceService),r);if(!o)return!1;let{unitId:s,subUnitId:c}=o,l={unitId:s,subUnitId:c,rule:r.rule,cfId:r.cfId},u=N(n,l),d=a.syncExecuteCommand(M.id,l);return d&&i.pushUndoRedo({unitID:s,undoMutations:u,redoMutations:[{id:M.id,params:l}]}),d}};function F(e,t){return function(n,r){t(n,r,e)}}function I(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let L=class extends e.Disposable{constructor(e,t){super(),this._registerOtherFormulaService=e,this._conditionalFormattingRuleModel=t,T(this,`_formulaMap`,new Map),T(this,`_result$`,new n.Subject),T(this,`result$`,this._result$.asObservable()),this._initFormulaResultChange(),this._initRuleChange()}_initRuleChange(){let e=e=>{switch(e.type){case u.colorScale:return e.config.some(e=>e.value.type===f.formula);case u.dataBar:return[e.config.max,e.config.min].some(e=>e.type===f.formula);case u.iconSet:return e.config.some(e=>e.value.type===f.formula)}};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(t=>{let{unitId:n,subUnitId:r,rule:i,oldRule:a}=t;t.type===`delete`&&this._removeFormulaByCfId(n,r,i.cfId),t.type===`set`&&(e(i.rule)||a&&e(a.rule))&&this._removeFormulaByCfId(n,r,i.cfId),t.type===`add`&&this._registerRuleFormulas(n,r,i)}))}_registerRuleFormulas(e,t,n){switch(n.rule.type){case u.highlightCell:if(n.rule.subType===d.formula){let r=n.rule.value;r&&this.registerFormulaWithRange(e,t,n.cfId,r,n.ranges)}break}}_initFormulaResultChange(){this.disposeWithMe(this._registerOtherFormulaService.formulaResult$.subscribe(e=>{for(let t in e)for(let n in e[t]){let i=e[t][n];for(let e of i){let i=this._ensureSubunitFormulaMap(t,n).getValue(e.formulaId,[`formulaId`]);if(!i)continue;let a=this._getAllFormulaResultByCfId(t,n,i.cfId).every(e=>{let i=this._registerOtherFormulaService.getFormulaValueSync(t,n,e.formulaId);return(i==null?void 0:i.status)===r.FormulaResultStatus.SUCCESS});this._result$.next({...i,isAllFinished:a})}}}))}_ensureSubunitFormulaMap(t,n){let r=this._formulaMap.get(t);r||(r=new Map,this._formulaMap.set(t,r));let i=r.get(n);return i||(i=new e.RefAlias([],[`formulaId`,`id`]),r.set(n,i)),i}getSubUnitFormulaMap(e,t){var n;return(n=this._formulaMap.get(e))==null?void 0:n.get(t)}registerFormulaWithRange(e,t,n,i,a=[{startRow:0,endRow:0,startColumn:0,endColumn:0}]){let o=this._ensureSubunitFormulaMap(e,t),s=this.createCFormulaId(n,i);if(o.getValue(s,[`id`]))return;let c=this._registerOtherFormulaService.registerFormulaWithRange(e,t,i,a,void 0,r.OtherFormulaBizType.CONDITIONAL_FORMATTING,n);o.addValue({formulaText:i,unitId:e,subUnitId:t,cfId:n,id:s,formulaId:c})}_removeFormulaByCfId(e,t,n){let r=this.deleteCache(e,t,n).map(e=>e.formulaId);this._registerOtherFormulaService.deleteFormula(e,t,r)}getFormulaResultWithCoords(e,t,n,i,a=0,o=0){let s=this.getSubUnitFormulaMap(e,t);if(!s)return{status:r.FormulaResultStatus.NOT_REGISTER};let c=s.getValue(this.createCFormulaId(n,i),[`id`]);if(!c)return{status:r.FormulaResultStatus.NOT_REGISTER};let l=this._registerOtherFormulaService.getFormulaValueSync(e,t,c.formulaId);if(!l)return{status:r.FormulaResultStatus.NOT_REGISTER};if(l.status===r.FormulaResultStatus.SUCCESS&&l.result){var u;let e=(u=l.result[a])==null?void 0:u[o];return{result:this._getCellValue(e),status:r.FormulaResultStatus.SUCCESS}}return{status:l.status}}getFormulaMatrix(t,n,i,a){let o=this.getSubUnitFormulaMap(t,n);if(!o)return{status:r.FormulaResultStatus.NOT_REGISTER};let s=o.getValue(this.createCFormulaId(i,a),[`id`]);if(!s)return{status:r.FormulaResultStatus.NOT_REGISTER};let c=this._registerOtherFormulaService.getFormulaValueSync(t,n,s.formulaId);if(!c)return{status:r.FormulaResultStatus.NOT_REGISTER};if(c.status===r.FormulaResultStatus.SUCCESS&&c.result){let t=new e.ObjectMatrix;return new e.ObjectMatrix(c.result).forValue((e,n,r)=>{t.setValue(e,n,this._getCellValue(r))}),{result:t,status:r.FormulaResultStatus.SUCCESS}}return{status:c.status}}_getCellValue(t){if(!t||!t[0]||!t[0][0])return!1;let n=t[0][0];return(n==null?void 0:n.t)===e.CellValueType.BOOLEAN?n.v===e.BooleanNumber.TRUE||n.v===!0:n==null?void 0:n.v}deleteCache(e,t,n,r){let i=this.getSubUnitFormulaMap(e,t);if(!i)return[];if(r){let e=this.createCFormulaId(n,r);return i.deleteValue(e,[`id`]),[]}else{let e=i.getValues().filter(e=>e.cfId===n);return e.forEach(e=>{i.deleteValue(e.formulaId,[`formulaId`])}),e}}_getAllFormulaResultByCfId(e,t,n){let r=this.getSubUnitFormulaMap(e,t);return r?r.getValues().filter(e=>e.cfId===n):[]}createCFormulaId(e,t){return`${e}_${t}`}};L=I([F(0,(0,e.Inject)(r.RegisterOtherFormulaService)),F(1,(0,e.Inject)(E))],L);let R=function(e){return e.preComputingStart=`preComputingStart`,e.preComputing=`preComputing`,e.preComputingEnd=`preComputingEnd`,e.preComputingError=`preComputingError`,e}({});var z=class{constructor(t){this._context=t,T(this,`_cache`,void 0),T(this,`_preComputingStatus$`,new n.BehaviorSubject(R.preComputingStart)),T(this,`preComputingStatus$`,this._preComputingStatus$.asObservable().pipe((0,i.distinctUntilChanged)())),T(this,`_preComputingCache`,void 0),T(this,`_rule`,void 0),this._cache=new e.LRUMap(t.limit),this._rule=t.rule,this._preComputingCache=null,this._initClearCacheListener()}setCacheLength(e){this._cache.limit=e}clearCache(){this._cache.clear()}resetPreComputingCache(){this._preComputingStatus$.next(R.preComputingStart),this._preComputingCache=null}updateRule(e){this._rule=e,this.resetPreComputingCache()}getCell(e,t){let n=this._createKey(e,t);if(this._preComputingStatus$.getValue()===R.preComputing)return this._cache.get(n);let r=this.getPreComputingResult(e,t);if(r===null&&(this._preComputingStatus$.next(R.preComputingStart),this.preComputing(e,t,this._getContext()),r=this.getPreComputingResult(e,t),r===null)||(this._preComputingStatus$.next(R.preComputingEnd),this._cache.has(n)))return this._cache.get(n);let i=this.getCellResult(e,t,r,this._getContext());return i!==null&&this._setCache(e,t,i),i}setPreComputingCache(e){this._preComputingCache=e}getPreComputingResult(e,t){return this._preComputingCache}_createKey(e,t){return`${e}_${t}`}_setCache(e,t,n){let r=this._createKey(e,t);this._cache.set(r,n)}_getContext(){return{...this._context,rule:this._rule}}_initClearCacheListener(){this.preComputingStatus$.subscribe(e=>{e===R.preComputingEnd&&this.clearCache()})}},oe=class extends z{preComputing(t,n,i){let o=i.rule,s=i.worksheet,c=new e.ObjectMatrix;o.rule.config.every(e=>e.value.type===f.num)||Y(o.ranges,s.getMaxRows()-1,s.getMaxColumns()-1).forEach(t=>{e.Range.foreach(t,(t,n)=>{let r=i.getCellValue(t,n),a=r&&r.v;if(!W(a)&&(r==null?void 0:r.t)===e.CellValueType.NUMBER){let e=Number(a);!Number.isNaN(e)&&c.setValue(t,n,e)}})});let l=[...o.rule.config].sort((e,t)=>e.index-t.index).map(t=>({value:q(t.value,c,{...i,cfId:o.cfId}),color:new e.ColorKit(t.color)}));if(!l.some(e=>(0,a.isObject)(e.value)?e.value.status!==r.FormulaResultStatus.SUCCESS:!1)){let e=l.map(e=>e.color).reduce((e,t,n)=>(e.result.push({color:t,value:e.sortValue[n]}),e),{result:[],sortValue:l.map(e=>e.value.result).sort((e,t)=>e-t)}).result;this.setPreComputingCache(e),this._preComputingStatus$.next(R.preComputingEnd);return}this._preComputingStatus$.next(R.preComputing)}getCellResult(t,n,r,i){if(!r)return null;let a=i.getCellValue(t,n);if(a.t===e.CellValueType.NUMBER){let e=Number(a.v);if(!Number.isNaN(e))return be(r,e)}}};const se=`sheet-conditional-rule-data-bar`,ce=`#000`,le=e=>{let{startRow:t,endRow:n,startColumn:r,endColumn:i}=e;return`${t}-${n}-${r}-${i}`};var ue=class extends a.SheetExtension{constructor(...e){super(...e),T(this,`_paddingRightAndLeft`,2),T(this,`_paddingTopAndBottom`,2),T(this,`uKey`,se),T(this,`Z_INDEX`,34),T(this,`_radius`,1)}draw(t,n,r,i){let{worksheet:o}=r;if(!o)return!1;let s=new Set;t.save(),e.Range.foreach(r.rowColumnSegment,(e,n)=>{if(!o.getRowVisible(e)||!o.getColVisible(n))return;let c=r.getCellWithCoordByIndex(e,n,!1),{isMerged:l,isMergedMainCell:u,mergeInfo:d}=c,f=o.getCell(e,n);if(l&&(f=o.getCell(d.startRow,d.startColumn)),!(f!=null&&f.dataBar)||!this.isRenderDiffRangesByCell(d,i))return;if(l||u){let e=le(d);if(s.has(e))return;s.add(e)}let{color:p,value:m,startPoint:h,isGradient:g}=f.dataBar,{startX:_,endX:v,startY:y,endY:b}=l||u?d:c,x=v-_,S=b+a.FIX_ONE_PIXEL_BLUR_OFFSET-y,C=x-this._paddingRightAndLeft*2,w=S-this._paddingTopAndBottom*2;if(m>0){let e=Math.max(C*(1-h/100)*m/100,1),n=_+this._paddingRightAndLeft+h/100*C,r=y+this._paddingTopAndBottom;if(g){let i=t.createLinearGradient(n,r,n+e,r);i.addColorStop(0,p),i.addColorStop(1,`rgb(255 255 255)`),t.fillStyle=i,t.strokeStyle=p,t.lineWidth=1}else t.fillStyle=p;this._drawRectWithRoundedCorner(t,n,r,e,w,!1,!0,!0,!1),g&&t.stroke()}else{let e=Math.max(C*h/100*Math.abs(m)/100,1),n=_+this._paddingRightAndLeft+h/100*C-e,r=y+this._paddingTopAndBottom;if(g){let i=t.createLinearGradient(n,r,n+e,r);i.addColorStop(0,`rgb(255 255 255)`),i.addColorStop(1,p),t.fillStyle=i,t.strokeStyle=p,t.lineWidth=1}else t.fillStyle=p;this._drawRectWithRoundedCorner(t,n,r,e,w,!0,!1,!1,!0),g&&t.stroke()}}),t.restore()}_drawRectWithRoundedCorner(e,t,n,r,i,a,o,s,c){let l=this._radius;!i||!r||(e.beginPath(),e.moveTo(t+l,n),e.lineTo(t+r-l,n),o?e.arcTo(t+r,n,t+r,n+l,l):e.lineTo(t+r,n),e.lineTo(t+r,n+i-l),s?e.arcTo(t+r,n+i,t+r-l,n+i,l):e.lineTo(t+r,n+i),e.lineTo(t+l,n+i),c?e.arcTo(t,n+i,t,n+i-l,l):e.lineTo(t,n+i),e.lineTo(t,n+l),a?e.arcTo(t,n,t+l,n,l):e.lineTo(t,n),e.closePath(),e.fill())}};a.SpreadsheetExtensionRegistry.add(ue);const B=e=>Math.max(Math.min(100,e),0),de=(t,n,r)=>{let i=r(t,n);if(i&&i.t===e.CellValueType.NUMBER){let e=Number(i.v);return Number.isNaN(e)?null:e}return null};var fe=class extends z{preComputing(t,n,i){let a=i.rule,o=a.rule,s=i.worksheet,c=new e.ObjectMatrix;[a.rule.config.max,a.rule.config.min].every(e=>e.type===f.num)||Y(a.ranges,s.getMaxRows()-1,s.getMaxColumns()-1).forEach(t=>{e.Range.foreach(t,(t,n)=>{let r=i.getCellValue(t,n),a=r&&r.v;if(!W(a)&&(r==null?void 0:r.t)===e.CellValueType.NUMBER){let e=Number(a);!Number.isNaN(e)&&c.setValue(t,n,e)}})});let l=q(o.config.min,c,{...i,cfId:a.cfId}),u=q(o.config.max,c,{...i,cfId:a.cfId}),d=0,p=0;if(l.status===r.FormulaResultStatus.SUCCESS){let e=Number(l.result);d=Number.isNaN(e)?0:e}else{this._preComputingStatus$.next(R.preComputing);return}if(u.status===r.FormulaResultStatus.SUCCESS){let e=Number(u.result),t=Number.isNaN(e)?0:e;p=Math.max(t,d),d=Math.min(t,d);let n=50;if(d<0&&p<=0)n=100;else if(d<0&&p>0){let e=Math.abs(p)+Math.abs(d);n=Math.abs(d)/e*100}else d>=0&&p>0&&(n=0);this.setPreComputingCache({min:d,max:p,startPoint:n}),this._preComputingStatus$.next(R.preComputingEnd);return}this._preComputingStatus$.next(R.preComputing)}getCellResult(e,t,n,r){let{min:i,max:a,startPoint:o}=n,s=r.rule.rule,c=s.isShowValue,l=s.config.isGradient,u=de(e,t,r.getCellValue);if(!(u===null||u<i||i===a||a<i)){if(u===0)return{color:ce,startPoint:o,value:0,isGradient:l,isShowValue:c};if(i<0&&a<=0){let e=a-i,t=B((a-u)/e*100);return t===0?void 0:{color:s.config.nativeColor||`#abd91a`,startPoint:o,value:-t,isGradient:l,isShowValue:c}}else if(i<0&&a>0)if(u>0){let e=B(Math.min(u/a,1)*100);return e===0?void 0:{color:s.config.positiveColor||`#ffbe38`,startPoint:o,value:e,isGradient:l,isShowValue:c}}else{let e=B(Math.min(Math.abs(u)/Math.abs(i),1)*100);return e===0?void 0:{color:s.config.nativeColor||`#abd91a`,startPoint:o,value:-e,isGradient:l,isShowValue:c}}else if(i>=0&&a>0){let e=a-i,t=B((1-(a-u)/e)*100);return t===0?void 0:{color:s.config.positiveColor||`#ffbe38`,startPoint:0,value:t,isGradient:l,isShowValue:c}}}}},pe=class extends z{preComputing(t,n,i){let a=i.rule.rule,o=Y(i.rule.ranges,i.worksheet.getMaxRows()-1,i.worksheet.getMaxColumns()-1),s=(()=>{switch(a.subType){case d.average:{let t=0,n=0;return o.forEach(r=>{e.Range.foreach(r,(r,a)=>{let o=i.getCellValue(r,a),s=G(o);o&&o.t===e.CellValueType.NUMBER&&!W(s)&&(t+=Number(s)||0,n++)})}),{value:t/n,type:a.subType}}case d.uniqueValues:case d.duplicateValues:{let t=new Map;return o.forEach(n=>{e.Range.foreach(n,(e,n)=>{let r=G(i.getCellValue(e,n));if(!W(r)){let e=t.get(r);e?t.set(r,e+1):t.set(r,1)}})}),{value:t,type:a.subType}}case d.rank:{let t=[];o.forEach(n=>{e.Range.foreach(n,(n,r)=>{let a=i.getCellValue(n,r),o=G(a);a&&a.t===e.CellValueType.NUMBER&&!W(o)&&t.push(Number(o)||0)})}),t.sort((e,t)=>t-e);let n=i.rule.rule;if(n.isPercent){n.isBottom&&(t=t.toReversed());let r=e.Tools.clamp(n.value,0,100)/100,i=Math.floor(r*t.length),o=e.Tools.clamp(i-1,0,t.length-1);return{value:t[o],type:a.subType}}let r=Math.floor(e.Tools.clamp(n.isBottom?n.value-1:n.value,0,t.length));return n.isBottom?{value:t[t.length-r-1],type:a.subType}:{value:t[Math.max(r-1,0)],type:a.subType}}case d.formula:{let e=a,t=i.accessor.get(L);t.registerFormulaWithRange(i.unitId,i.subUnitId,i.rule.cfId,e.value,i.rule.ranges);let n=t.getFormulaMatrix(i.unitId,i.subUnitId,i.rule.cfId,e.value);return n&&n.status===r.FormulaResultStatus.SUCCESS?(this._preComputingStatus$.next(R.preComputingEnd),{value:n.result,type:a.subType}):(this._preComputingStatus$.next(R.preComputing),null)}case d.timePeriod:switch(a.operator){case c.last7Days:return{value:{start:(0,e.dateKit)().subtract(7,`day`).valueOf(),end:(0,e.dateKit)().valueOf()},type:a.subType};case c.lastMonth:return{value:{start:(0,e.dateKit)().startOf(`month`).subtract(1,`month`).valueOf(),end:(0,e.dateKit)().endOf(`month`).subtract(1,`month`).valueOf()},type:a.subType};case c.lastWeek:return{value:{start:(0,e.dateKit)().startOf(`week`).subtract(1,`week`).valueOf(),end:(0,e.dateKit)().endOf(`week`).subtract(1,`week`).valueOf()},type:a.subType};case c.nextMonth:return{value:{start:(0,e.dateKit)().startOf(`month`).add(1,`month`).valueOf(),end:(0,e.dateKit)().endOf(`month`).add(1,`month`).valueOf()},type:a.subType};case c.nextWeek:return{value:{start:(0,e.dateKit)().startOf(`week`).add(1,`week`).valueOf(),end:(0,e.dateKit)().endOf(`week`).add(1,`week`).valueOf()},type:a.subType};case c.thisMonth:return{value:{start:(0,e.dateKit)().startOf(`month`).valueOf(),end:(0,e.dateKit)().endOf(`month`).valueOf()},type:a.subType};case c.thisWeek:return{value:{start:(0,e.dateKit)().startOf(`week`).valueOf(),end:(0,e.dateKit)().endOf(`week`).valueOf()},type:a.subType};case c.today:return{value:{start:(0,e.dateKit)().startOf(`day`).valueOf(),end:(0,e.dateKit)().endOf(`day`).valueOf()},type:a.subType};case c.tomorrow:return{value:{start:(0,e.dateKit)().startOf(`day`).add(1,`day`).valueOf(),end:(0,e.dateKit)().endOf(`day`).add(1,`day`).valueOf()},type:a.subType};case c.yesterday:return{value:{start:(0,e.dateKit)().startOf(`day`).subtract(1,`day`).valueOf(),end:(0,e.dateKit)().endOf(`day`).subtract(1,`day`).valueOf()},type:a.subType}}}})();this.setPreComputingCache(s)}getCellResult(t,n,i,a){let o=a.getCellValue(t,n),c=a.rule.rule;return(()=>{switch(c.subType){case d.number:{let t=o&&Number(o.v),n=(o==null?void 0:o.t)===e.CellValueType.NUMBER,r=c;return n?W(t)||Number.isNaN(t)?void 0:J({operator:r.operator,value:r.value||0},t||0):!![l.notEqual,l.notBetween].includes(r.operator)}case d.text:{let e=c,t=G(o),n=W(t)?``:String(t),i=e.value||``;switch(e.operator){case s.beginsWith:return n.startsWith(i);case s.containsBlanks:return/^\s*$/.test(n);case s.notContainsBlanks:return!/^\s*$/.test(n);case s.containsErrors:return r.ERROR_TYPE_SET.has(n);case s.notContainsErrors:return!r.ERROR_TYPE_SET.has(n);case s.containsText:return n.indexOf(i)>-1;case s.notContainsText:return n.indexOf(i)===-1;case s.endsWith:return n.endsWith(i);case s.equal:return n===i;case s.notEqual:return n!==i;default:return!1}}case d.timePeriod:{let t=G(o);if(W(t)||Number.isNaN(Number(t))||(o==null?void 0:o.t)!==e.CellValueType.NUMBER||!i)return;let n=_e(Number(t)),{start:r,end:a}=i.value;return n>=r&&n<=a}case d.average:{let t=o&&o.v,n=Number(t),r=(o==null?void 0:o.t)===e.CellValueType.NUMBER,a=c;if(!r)return l.notEqual===a.operator;if(W(t)||Number.isNaN(n)||!i)return!1;let s=i.value;switch(a.operator){case l.greaterThan:return n>s;case l.greaterThanOrEqual:return n>=s;case l.lessThan:return n<s;case l.lessThanOrEqual:return n<=s;case l.equal:return U(n,s);case l.notEqual:return!U(n,s);default:return!1}}case d.rank:{let t=G(o),n=Number(t);if(W(t)||Number.isNaN(n)||(o==null?void 0:o.t)!==e.CellValueType.NUMBER||!i)return!1;let r=i.value;return c.isBottom?n<=r:n>=r}case d.uniqueValues:{let e=G(o);return W(e)||!i?!1:i.value.get(e)===1}case d.duplicateValues:{let e=G(o);if(W(e)||!i)return!1;let t=i.value.get(e);return t&&t!==1}case d.formula:{let e=i==null?void 0:i.value;if(e){let r=a.rule.ranges[0],i=t-r.startRow,o=n-r.startColumn;return e.getValue(i,o)===!0}return!1}}})()?c.style:{}}};const me=(t,n,r)=>{let i=r(t,n);if(i&&i.t===e.CellValueType.NUMBER){let e=Number(i.v);return Number.isNaN(e)?null:e}return null};var he=class extends z{preComputing(t,n,i){let a=i.rule.rule,o=i.worksheet,s=new e.ObjectMatrix;a.config.every(e=>e.value.type===f.num)||Y(i.rule.ranges,o.getMaxRows()-1,o.getMaxColumns()-1).forEach(t=>{e.Range.foreach(t,(t,n)=>{let r=i.getCellValue(t,n),a=r&&r.v;if(!W(a)&&(r==null?void 0:r.t)===e.CellValueType.NUMBER){let e=Number(a);!Number.isNaN(e)&&s.setValue(t,n,e)}})});let c=a.config.map(e=>q(e.value,s,{...i,cfId:i.rule.cfId}));if(!c.some(e=>e.status!==r.FormulaResultStatus.SUCCESS)){let e=c.map((e,t)=>({operator:a.config[t].operator,value:Number(e.result)||0})).reduce((e,t,n,r)=>{let i=a.config[n];if(!n||n===r.length-1)e.push({...t,iconId:i.iconId,iconType:i.iconType});else{let a=r[n-1];J(a,t.value)||e.push({...t,iconId:i.iconId,iconType:i.iconType})}return e},[]);this.setPreComputingCache(e),this._preComputingStatus$.next(R.preComputingEnd);return}this._preComputingStatus$.next(R.preComputing)}getCellResult(e,t,n,r){if(!n)return null;let i=me(e,t,r.getCellValue);if(i===null)return;let a=r.rule.rule,o=a.isShowValue===void 0?!0:!!a.isShowValue;for(let e=0;e<n.length;e++){let t=n[e],r={...t},a={...t},{iconId:s,iconType:c}=t;if(e===0){if(J(t,i))return{iconId:s,iconType:c,isShowValue:o}}else if(e===n.length-1)return{iconId:s,iconType:c,isShowValue:o};else{let t=n[e-1];if(a.operator=ye(t.operator),a.value=t.value,J(r,i)&&J(a,i))return{iconId:s,iconType:c,isShowValue:o}}}}};const V=1e3*3*3;let H=class extends e.Disposable{constructor(t,r,a,o){super(),this._injector=t,this._conditionalFormattingRuleModel=r,this._conditionalFormattingFormulaService=a,this._univerInstanceService=o,T(this,`_calculateUnitManagers`,new Map),T(this,`_rTreeManager`,new e.RTree),T(this,`_cellCache`,new e.LRUMap(V)),T(this,`_markDirty$`,new n.Subject),T(this,`markDirty$`,this._markDirty$.asObservable()),T(this,`_markRuleDirtyAtOnce`,(e,t,n,r=!0)=>{if(this._cellCache.clear(),r){let r=this._ensureCalculateUnitManager(e,t).get(n);r&&r.resetPreComputingCache()}this._markDirty$.next({unitId:e,subUnitId:t,cfId:n})}),T(this,`markRuleDirty`,(()=>{let e=new n.Subject;return this.disposeWithMe(e.pipe((0,i.bufferTime)(100),(0,i.filter)(e=>!!e.length),(0,i.map)(e=>{let t=new Set,n=[];return e.forEach(e=>{let r=`${e.unitId}_${e.subUnitId}_${e.cfId}`;if(t.has(r)){if(e.isNeedResetPreComputingCache){let t=n.find(t=>t.cfId===e.cfId);t.isNeedResetPreComputingCache=!0}return}t.add(r),n.push({...e})}),n})).subscribe(e=>{e.forEach(e=>{this._markRuleDirtyAtOnce(e.unitId,e.subUnitId,e.cfId,e.isNeedResetPreComputingCache)})})),(t,n,r,i=!0)=>{e.next({unitId:t,subUnitId:n,cfId:r,isNeedResetPreComputingCache:i})}})()),this._initRuleListener(),this._handleCustomFormulasSeparately(),this._initCFFormulaListener()}_initCFFormulaListener(){this.disposeWithMe(this._conditionalFormattingFormulaService.result$.subscribe(({unitId:e,subUnitId:t,cfId:n,isAllFinished:r})=>{r&&this._markRuleDirtyAtOnce(e,t,n,r)}))}getCellCfs(e,t,n,r){let i=this._createCacheKey(e,t,n,r);if(this._cellCache.has(i))return this._cellCache.get(i);let a=this._getCellCfs(e,t,n,r);return a.length&&this._cellCache.set(i,a),a}_getCellCfs(e,t,n,r){var i;let a=(i=this._conditionalFormattingRuleModel.getSubunitRules(e,t))==null?[]:i,o=this._ensureCalculateUnitManager(e,t),s=this._rTreeManager.bulkSearch([{unitId:e,sheetId:t,range:{startColumn:r,endColumn:r,startRow:n,endRow:n}}]),c=a.filter(e=>s.has(e.cfId));return c.length?c.map(e=>{let t=o.get(e.cfId);return t?{cfId:e.cfId,result:t.getCell(n,r)}:null}).filter(e=>!!e).map((e,t)=>({...e,priority:t})):[]}dispose(){this.clearCache(),super.dispose()}clearCache(){this._calculateUnitManagers.clear(),this._cellCache.clear(),this._rTreeManager.clear()}_handleCustomFormulasSeparately(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(e=>{if(e.type===`set`){let{unitId:t,subUnitId:n}=e,r=e.oldRule;r.rule.type===u.highlightCell&&r.rule.subType===d.formula&&this._conditionalFormattingFormulaService.deleteCache(t,n,r.cfId)}}))}_initRuleListener(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(e=>{let{unitId:t,subUnitId:n,rule:r}=e,{cfId:i,ranges:a}=r,o=this._ensureCalculateUnitManager(t,n);switch(this.markRuleDirty(t,n,i),e.type){case`add`:{this._rTreeManager.bulkInsert(a.map(e=>({unitId:t,sheetId:n,id:i,range:e})));let e=this._createRuleCalculateUnitInstance(t,n,r);if(!e)return;o.set(r.cfId,e);break}case`delete`:this._rTreeManager.bulkRemove(a.map(e=>({unitId:t,sheetId:n,id:i,range:e}))),o.delete(r.cfId);break;case`set`:{let s=e.oldRule;if(this._rTreeManager.bulkRemove(s.ranges.map(e=>({unitId:t,sheetId:n,id:s.cfId,range:e}))),this._rTreeManager.bulkInsert(a.map(e=>({unitId:t,sheetId:n,id:i,range:e}))),s.rule.type!==r.rule.type){let e=this._createRuleCalculateUnitInstance(t,n,r);if(!e)return;o.delete(s.cfId),o.set(r.cfId,e)}else{let e=o.get(s.cfId);if(!e)return;e.updateRule(r)}}}}))}_ensureCalculateUnitManager(e,t){let n=this._calculateUnitManagers.get(e);n||(n=new Map,this._calculateUnitManagers.set(e,n));let r=n.get(t);return r||(r=new Map,n.set(t,r)),r}_createRuleCalculateUnitInstance(e,t,n){let r=this._univerInstanceService.getUnit(e),i=r==null?void 0:r.getSheetBySheetId(t);if(!r||!i)return;let a={workbook:r,worksheet:i,unitId:e,subUnitId:t,accessor:this._injector,rule:n,limit:V,getCellValue:(e,t)=>i.getCellRaw(e,t)||{}};switch(n.rule.type){case u.colorScale:return new oe(a);case u.dataBar:return new fe(a);case u.highlightCell:return new pe(a);case u.iconSet:return new he(a)}}_createCacheKey(e,t,n,r){return`${e}_${t}_${n}_${r}`}setCacheLength(e=V){this._cellCache.limit!==e&&(this._cellCache.limit=e,this._calculateUnitManagers.forEach(t=>{t.forEach(t=>{t.forEach(t=>{t.setCacheLength(e)})})}))}};H=I([F(0,(0,e.Inject)(e.Injector)),F(1,(0,e.Inject)(E)),F(2,(0,e.Inject)(L)),F(3,e.IUniverInstanceService)],H);function U(e,t){return Math.abs(e-t)<2**-52}const W=e=>e==null||typeof e==`string`&&e.trim()===``,G=t=>{var n;if(!t)return null;if(t.t===e.CellValueType.BOOLEAN)return t.v===e.BooleanNumber.TRUE?r.BooleanValue.TRUE:r.BooleanValue.FALSE;let i=t.v,a=(n=t.p)==null||(n=n.body)==null?void 0:n.dataStream.replace(/\r\n$/,``);return W(i)?W(a)?null:a:i},K=86400;function ge(e,t=!0){if(t&&e>=0){if(e===0)return[1900,1,0];if(e===60)return[1900,2,29];if(e<60)return[1900,e<32?1:2,(e-1)%31+1]}let n=e+68569+2415019,r=Math.floor(4*n/146097);n-=Math.floor((146097*r+3)/4);let i=Math.floor(4e3*(n+1)/1461001);n=n-Math.floor(1461*i/4)+31;let a=Math.floor(80*n/2447),o=n-Math.floor(2447*a/80);n=Math.floor(a/11);let s=a+2-12*n;return[100*(r-49)+i+n|0,s|0,o|0]}const _e=t=>{let n=t|0,r=K*(t-n),i=Math.floor(r);r-i>.9999&&(i+=1,i===K&&(i=0,n+=1));let a=i<0?K+i:i,[o,s,c]=ge(t,!0);return(0,e.dateKit)(`${o}/${s}/${c} ${Math.floor(a/60/60)%60}:${Math.floor(a/60)%60}:${Math.floor(a)%60}`).valueOf()},q=(e,t,n)=>{switch(e.type){case f.max:{let e=0;return t.forValue((t,n,r)=>{r>e&&(e=r)}),{status:r.FormulaResultStatus.SUCCESS,result:e}}case f.min:{let e;return t.forValue((t,n,r)=>{e===void 0&&(e=r),r<e&&(e=r)}),{status:r.FormulaResultStatus.SUCCESS,result:e}}case f.percent:{let n,i;t.forValue((e,t,r)=>{(n===void 0||i===void 0)&&(n=r,i=r),r>n&&(n=r),r<i&&(i=r)});let a=(n||0)-(i||0),o=Math.max(Math.min(Number(e.value)||0,100),0);return{status:r.FormulaResultStatus.SUCCESS,result:o/100*a+(i||0)}}case f.percentile:{let n=t.toNativeArray().sort((e,t)=>e-t),i=Math.max(Math.min(Number(e.value)||0,100),0),a=(n.length-1)*i/100,o=Math.floor(a),s=a-o,c=n[o]+(n[Math.min(o+1,n.length-1)]-n[o])*s;return{status:r.FormulaResultStatus.SUCCESS,result:c}}case f.formula:{let{accessor:t,unitId:r,subUnitId:i,cfId:a}=n,o=String(e.value),s=t.get(L);return s.registerFormulaWithRange(r,i,a,o),s.getFormulaResultWithCoords(r,i,a,o)}case f.num:default:{let t=Number(e.value);return{status:r.FormulaResultStatus.SUCCESS,result:Number.isNaN(t)?0:t}}}},ve=(t,n,r,i)=>{let{accessor:a}=i,o=a.get(H),s=new e.ObjectMatrix;return r.ranges.forEach(i=>{e.Range.foreach(i,(e,i)=>{let a=o.getCellCfs(t,n,e,i);if(a){let t=a.find(e=>e.cfId===r.cfId);t!=null&&t.result&&s.setValue(e,i,t.result)}})}),s},J=(e,t)=>{switch(e.operator){case l.between:{if(typeof e.value!=`object`||!e.value.length)return;let n=Math.min(...e.value),r=Math.max(...e.value);return t>=n&&t<=r}case l.notBetween:{if(typeof e.value!=`object`||!e.value.length)return;let n=Math.min(...e.value),r=Math.max(...e.value);return!(t>=n&&t<=r)}case l.equal:return U(e.value||0,t);case l.notEqual:return!U(e.value||0,t);case l.greaterThan:return t>(e.value||0);case l.greaterThanOrEqual:return t>=(e.value||0);case l.lessThan:return t<(e.value||0);case l.lessThanOrEqual:return t<=(e.value||0);default:return!1}},ye=e=>{switch(e){case l.greaterThan:return l.lessThanOrEqual;case l.greaterThanOrEqual:return l.lessThan;case l.lessThan:return l.greaterThanOrEqual;case l.lessThanOrEqual:return l.greaterThan}return e},be=(t,n)=>{let r=e=>e.a===void 0?{...e,a:1}:e,i=t.findIndex(e=>e.value>=n),a=i-1;if(i===0)return t[0].color.toRgbString();if(a>=0){let o=t[a],s=t[i];if(o.color.isValid&&s.color.isValid){let t=r(o.color.toRgb()),i=r(s.color.toRgb()),a=s.value-o.value,c=(n-o.value)/a;return new e.ColorKit([`r`,`g`,`b`,`a`].reduce((e,n)=>{let r=t[n];return e[n]=(i[n]-r)*c+r,e},{})).toRgbString()}}else return t[t.length-1].color.toRgbString()},Y=(e,t,n)=>e.map(e=>{if(e.startColumn>n||e.startRow>t)return null;let r={...e};return r.endRow=Math.min(r.endRow,t),r.endColumn=Math.min(r.endColumn,n),r}).filter(e=>!!e);function xe(t){let n=0;return new e.ObjectMatrix(t).forValue((e,t,r)=>{n=Math.max(Number.isNaN(n)?0:n,Number(r))}),n}const X={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%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%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%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:{"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`,"rhomboid-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%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%23FFBD37%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`}},Se=[{title:`sheet.cf.iconSet.direction`,group:[{name:`3Arrows`,list:[X.arrow[`up-green`],X.arrow[`right-gold`],X.arrow[`down-red`]]},{name:`3ArrowsGray`,list:[X.arrow[`up-gray`],X.arrow[`right-gray`],X.arrow[`down-gray`]]},{name:`4Arrows`,list:[X.arrow[`up-green`],X.arrow[`rightAndUp-gold`],X.arrow[`rightAndDown-gold`],X.arrow[`down-red`]]},{name:`4ArrowsGray`,list:[X.arrow[`up-gray`],X.arrow[`rightAndUp-gray`],X.arrow[`rightAndDown-gray`],X.arrow[`down-gray`]]},{name:`5Arrows`,list:[X.arrow[`up-green`],X.arrow[`rightAndUp-gold`],X.arrow[`right-gold`],X.arrow[`rightAndDown-gold`],X.arrow[`down-red`]]},{name:`5ArrowsGray`,list:[X.arrow[`up-gray`],X.arrow[`rightAndUp-gray`],X.arrow[`right-gray`],X.arrow[`rightAndDown-gray`],X.arrow[`down-gray`]]},{name:`3Triangles`,list:[X.shape.up,X.shape.cross,X.shape.down]}]},{title:`sheet.cf.iconSet.shape`,group:[{name:`3TrafficLights1`,list:[X.shape[`roundness-greed`],X.shape[`roundness-gold`],X.shape[`roundness-red`]]},{name:`3Signs`,list:[X.shape[`roundness-greed`],X.shape[`triangle-gold`],X.shape[`rhomboid-red`]]},{name:`3TrafficLights2`,list:[X.shape[`indicate-greed`],X.shape[`indicate-gold`],X.shape[`indicate-red`]]},{name:`4RedToBlack`,list:[X.shape[`roundness-red`],X.shape[`roundness-pink`],X.shape[`roundness-gray`],X.shape[`roundness-black`]]},{name:`4TrafficLights`,list:[X.shape[`roundness-greed`],X.shape[`roundness-gold`],X.shape[`roundness-red`],X.shape[`roundness-black`]]}]},{title:`sheet.cf.iconSet.mark`,group:[{name:`3Symbols`,list:[X.feedback.correct,X.feedback.warn,X.feedback.mistake]},{name:`3Symbols2`,list:[X.feedback2.correct2,X.feedback2.warn2,X.feedback2.mistake2]},{name:`3Flags`,list:[X.flag[`flag-green`],X.flag[`flag-gold`],X.flag[`flag-red`]]}]},{title:`sheet.cf.iconSet.rank`,group:[{name:`4Rating`,list:[X.signal.signal25,X.signal.signal50,X.signal.signal75,X.signal.signal100]},{name:`5Rating`,list:[X.signal.signal0,X.signal.signal25,X.signal.signal50,X.signal.signal75,X.signal.signal100]},{name:`5Quarters`,list:[X.progress.progress100,X.progress.progress75,X.progress.progress50,X.progress.progress25,X.progress.progress0]},{name:`_5Felling`,list:[X.feeling.guffaw,X.feeling.smile,X.feeling.noninductive,X.feeling.dissatisfied,X.feeling.impatient]},{name:`5Boxes`,list:[X.cell[`cell-100`],X.cell[`cell-75`],X.cell[`cell-50`],X.cell[`cell-25`],X.cell[`cell-0`]]},{name:`3Stars`,list:[X.star.starFull,X.star.starIncomplete,X.star.starEmpty]}]}],Z=Se.reduce((e,t)=>{let{group:n}=t;for(let t of n)e[t.name]=t.list;return e},{});for(let e in Z){let t=Z[e];Object.freeze(t)}var Ce=`@univerjs/sheets-conditional-formatting`,we=`0.20.1`;const Te=`ssheets-conditional-formatting.config`;Symbol(Te);const Ee={};let Q=class extends e.Disposable{get _conditionalFormattingViewModelV2(){return this._injector.get(H)}constructor(e,t,n,r,i,a){super(),this._conditionalFormattingRuleModel=e,this._injector=t,this._univerInstanceService=n,this._resourceManagerService=r,this._sheetInterceptorService=i,this._commandService=a,this._initCellChange(),this._initSnapshot(),this._initSheetChange()}composeStyle(t,n,r,i){let a=this._conditionalFormattingViewModelV2.getCellCfs(t,n,r,i);if(!(a!=null&&a.length))return null;let o=[],s=-1;for(let e of a){let r=this._conditionalFormattingRuleModel.getRule(t,n,e.cfId);r&&(o.push({rule:r,cacheItem:e}),s===-1&&r.stopIfTrue&&(s=o.length-1))}if(!o.length)return null;let c=s>-1?o.slice(0,s+1):o,l={};for(let t=c.length-1;t>=0;t--){let{rule:n,cacheItem:r}=c[t],i=n.rule.type;if(i===u.highlightCell)r.result&&(0,e.merge)(l,{style:r.result});else if(i===u.colorScale){let e=r.result;e&&typeof e==`string`&&(l.style={...l.style||{},bg:{rgb:e}})}else if(i===u.dataBar){let e=r.result;e&&(l.dataBar=e,l.isShowValue=e.isShowValue)}else if(i===u.iconSet){let e=r.result;e&&(l.iconSet=e,l.isShowValue=e.isShowValue)}}return l}_initSnapshot(){let t=e=>{let t=this._conditionalFormattingRuleModel.getUnitRules(e),n={};return t?(t.forEach((e,t)=>{n[t]=e}),JSON.stringify(n)):``},n=e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:o,businesses:[e.UniverInstanceType.UNIVER_SHEET],toJson:e=>t(e),parseJson:e=>n(e),onUnLoad:t=>{this._conditionalFormattingRuleModel.deleteUnitId(t),!(0,e.isInternalEditorID)(t)&&this._conditionalFormattingViewModelV2.clearCache()},onLoad:(e,t)=>{Object.keys(t).forEach(n=>{[...t[n]].reverse().forEach(t=>{this._conditionalFormattingRuleModel.addRule(e,n,t)})})}}))}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{if(e.id===t.RemoveSheetCommand.id){let n=e.params,r=(0,t.getSheetCommandTarget)(this._univerInstanceService,n);if(!r)return{redos:[],undos:[]};let{unitId:i,subUnitId:a}=r,o=this._conditionalFormattingRuleModel.getSubunitRules(i,a);if(!o)return{redos:[],undos:[]};let s=[],c=[];return o.forEach(e=>{let t={unitId:i,subUnitId:a,cfId:e.cfId};s.push({id:k.id,params:t}),c.push(...O(this._injector,t))}),{redos:s,undos:c}}else if(e.id===t.CopySheetCommand.id){let n=e.params,r=(0,t.getSheetCommandTarget)(this._univerInstanceService,n);if(!r)return{redos:[],undos:[]};let{unitId:i,subUnitId:a}=r,{targetSubUnitId:o}=n,s=this._conditionalFormattingRuleModel.getSubunitRules(i,a);if(!s)return{redos:[],undos:[]};let c=[],l=[];return s.forEach(e=>{let t={unitId:i,subUnitId:o,rule:{...e,cfId:this._conditionalFormattingRuleModel.createCfId(i,o)}};c.push({id:j.id,params:t}),l.push(A(this._injector,t))}),{redos:c,undos:l}}return{redos:[],undos:[]}}}))}_initCellChange(){this.disposeWithMe(this._commandService.onCommandExecuted(n=>{let r=(e,t,n)=>{let r=new Set;return n.forEach(([n,i])=>{let a=this._conditionalFormattingViewModelV2.getCellCfs(e,t,n,i);a==null||a.forEach(e=>r.add(e.cfId))}),[...r].map(n=>this._conditionalFormattingRuleModel.getRule(e,t,n)).filter(e=>!!e)};switch(n.id){case t.SetRangeValuesMutation.id:{let{subUnitId:t,unitId:i,cellValue:a}=n.params,o=[];new e.ObjectMatrix(a).forValue((e,t,n)=>{n&&Object.keys(n).some(e=>[`p`,`v`].includes(e))&&o.push([e,t])}),r(i,t,o).forEach(e=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,t,e.cfId)});break}case t.InsertColMutation.id:case t.RemoveColMutation.id:{let r=n.params,i=(0,t.getSheetCommandTarget)(this._univerInstanceService,r);if(!i)return;let{worksheet:a,unitId:o,subUnitId:s}=i,{range:c}=r,l={...c,endColumn:a.getColumnCount()-1},u=this._conditionalFormattingRuleModel.getSubunitRules(o,s);u&&u.filter(t=>t.ranges.some(t=>e.Rectangle.intersects(t,l))).forEach(e=>{this._conditionalFormattingViewModelV2.markRuleDirty(o,s,e.cfId)});break}case t.RemoveRowMutation.id:case t.InsertRowMutation.id:{let r=n.params,i=(0,t.getSheetCommandTarget)(this._univerInstanceService,r);if(!i)return;let{worksheet:a,unitId:o,subUnitId:s}=i,{range:c}=r,l={...c,endRow:a.getRowCount()-1},u=this._conditionalFormattingRuleModel.getSubunitRules(o,s);u&&u.filter(t=>t.ranges.some(t=>e.Rectangle.intersects(t,l))).forEach(e=>{this._conditionalFormattingViewModelV2.markRuleDirty(o,s,e.cfId)});break}case t.MoveRowsMutation.id:{let r=n.params,i=(0,t.getSheetCommandTarget)(this._univerInstanceService,r);if(!i)return;let{worksheet:a,unitId:o,subUnitId:s}=i,{sourceRange:c,targetRange:l}=r,u={startRow:Math.min(c.startRow,l.startRow),endRow:a.getRowCount()-1,startColumn:0,endColumn:a.getColumnCount()-1},d=this._conditionalFormattingRuleModel.getSubunitRules(o,s);d&&d.filter(t=>t.ranges.some(t=>e.Rectangle.intersects(t,u))).forEach(e=>{this._conditionalFormattingViewModelV2.markRuleDirty(o,s,e.cfId)});break}case t.MoveColsMutation.id:{let r=n.params,i=(0,t.getSheetCommandTarget)(this._univerInstanceService,r);if(!i)return;let{worksheet:a,unitId:o,subUnitId:s}=i,{sourceRange:c,targetRange:l}=r,u={startRow:0,endRow:a.getRowCount()-1,startColumn:Math.min(c.startColumn,l.startColumn),endColumn:a.getColumnCount()-1},d=this._conditionalFormattingRuleModel.getSubunitRules(o,s);d&&d.filter(t=>t.ranges.some(t=>e.Rectangle.intersects(t,u))).forEach(e=>{this._conditionalFormattingViewModelV2.markRuleDirty(o,s,e.cfId)});break}case t.MoveRangeMutation.id:{let{unitId:t,to:i,from:a}=n.params,o=n=>{let i=[];new e.ObjectMatrix(n.value).forValue((e,t)=>{i.push([e,t])}),r(t,n.subUnitId,i).forEach(e=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,n.subUnitId,e.cfId)})};o(i),o(a);break}case t.ReorderRangeMutation.id:{let{range:t,unitId:r,subUnitId:i}=n.params,a=this._conditionalFormattingRuleModel.getSubunitRules(r,i);a&&a.filter(n=>n.ranges.some(n=>e.Rectangle.intersects(n,t))).forEach(e=>{this._conditionalFormattingViewModelV2.markRuleDirty(r,i,e.cfId)});break}}}))}};Q=I([F(0,(0,e.Inject)(E)),F(1,(0,e.Inject)(e.Injector)),F(2,(0,e.Inject)(e.IUniverInstanceService)),F(3,(0,e.Inject)(e.IResourceManagerService)),F(4,(0,e.Inject)(t.SheetInterceptorService)),F(5,(0,e.Inject)(e.ICommandService))],Q);let $=class extends e.Plugin{constructor(t=Ee,n,r,i){super(),this._config=t,this._injector=n,this._commandService=r,this._configService=i;let{...a}=(0,e.merge)({},Ee,this._config);this._configService.setConfig(Te,a),[[Q],[L],[E],[H]].forEach(e=>{this._injector.add(e)}),[te,ne,re,P,ie,ae,j,k,M,D].forEach(e=>{this._commandService.registerCommand(e)})}onStarting(){this._injector.get(Q),(0,e.touchDependencies)(this._injector,[[Q],[H]])}};T($,`pluginName`,o),T($,`packageName`,Ce),T($,`version`,we),T($,`type`,e.UniverInstanceType.UNIVER_SHEET),$=I([(0,e.DependentOn)(r.UniverFormulaEnginePlugin),F(1,(0,e.Inject)(e.Injector)),F(2,(0,e.Inject)(e.ICommandService)),F(3,e.IConfigService)],$);const De=`sheet-conditional-rule-icon`,Oe=e=>{let{startRow:t,endRow:n,startColumn:r,endColumn:i}=e;return`${t}-${n}-${r}-${i}`};var ke=class extends a.SheetExtension{constructor(){super(),T(this,`_paddingRightAndLeft`,2),T(this,`_width`,15),T(this,`_imageMap`,new Map),T(this,`uKey`,De),T(this,`Z_INDEX`,35),T(this,`_radius`,1),this._init()}draw(t,n,r,i){let{worksheet:a}=r;if(!a)return!1;let o=new Set;t.save(),e.Range.foreach(r.rowColumnSegment,(e,n)=>{if(!a.getRowVisible(e)||!a.getColVisible(n))return;let s=r.getCellWithCoordByIndex(e,n,!1),{isMerged:c,isMergedMainCell:l,mergeInfo:u}=s,d=a.getCell(e,n);if(c&&(d=a.getCell(u.startRow,u.startColumn)),!(d!=null&&d.iconSet))return;let{iconType:f,iconId:p}=d.iconSet;if(f===`EMPTY_ICON_TYPE`)return;let m=this._imageMap.get(this._createKey(f,p));if(!m||!this.isRenderDiffRangesByCell(u,i))return;if(c||l){let e=Oe(u);if(o.has(e))return;o.add(e)}let{startX:h,endX:g,startY:_,endY:v}=c||l?u:s,y=g-h,b=v-_;if(this._width>b||this._width>y+this._paddingRightAndLeft*2)return;let x=(b-this._width)/2+_;t.drawImage(m,h+this._paddingRightAndLeft,x,this._width,this._width)}),t.restore()}_init(){for(let e in Z)Z[e].forEach((t,n)=>{let r=this._createKey(e,String(n)),i=new Image;i.onload=()=>{this._imageMap.set(r,i)},i.src=t})}_createKey(e,t){return`${e}_${t}`}};a.SpreadsheetExtensionRegistry.add(ke);function Ae(e){if(typeof e!=`object`||!e)return e;let t={};for(let n in e)if(e.hasOwnProperty(n)){let r=Ae(e[n]);r!==void 0&&(t[n]=r)}return t}exports.AddCfCommand=te,exports.AddConditionalRuleMutation=j,exports.AddConditionalRuleMutationUndoFactory=A,exports.CFNumberOperator=l,exports.CFRuleType=u,exports.CFSubRuleType=d,exports.CFTextOperator=s,exports.CFTimePeriodOperator=c,exports.CFValueType=f,exports.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH=V,exports.ClearRangeCfCommand=ne,exports.ClearWorksheetCfCommand=re,Object.defineProperty(exports,`ConditionalFormattingFormulaService`,{enumerable:!0,get:function(){return L}}),exports.ConditionalFormattingIcon=ke,exports.ConditionalFormattingRuleModel=E,Object.defineProperty(exports,`ConditionalFormattingService`,{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,`ConditionalFormattingViewModel`,{enumerable:!0,get:function(){return H}}),exports.DEFAULT_BG_COLOR=`#fff`,exports.DEFAULT_FONT_COLOR=`#000000`,exports.DEFAULT_PADDING=2,exports.DEFAULT_WIDTH=15,exports.DataBar=ue,exports.DeleteCfCommand=P,exports.DeleteConditionalRuleMutation=k,exports.DeleteConditionalRuleMutationUndoFactory=O,exports.EMPTY_ICON_TYPE=`EMPTY_ICON_TYPE`,exports.IconUKey=De,exports.MoveCfCommand=ie,exports.MoveConditionalRuleMutation=D,exports.MoveConditionalRuleMutationUndoFactory=ee,exports.SHEET_CONDITIONAL_FORMATTING_PLUGIN=o,exports.SetCfCommand=ae,exports.SetConditionalRuleMutation=M,Object.defineProperty(exports,`UniverSheetsConditionalFormattingPlugin`,{enumerable:!0,get:function(){return $}}),exports.anchorUndoFactory=y,exports.compareWithNumber=J,exports.createCfId=x,exports.createDefaultRule=p,exports.createDefaultValue=m,exports.createDefaultValueByValueType=h,exports.dataBarUKey=se,exports.defaultDataBarNativeColor=`#abd91a`,exports.defaultDataBarPositiveColor=`#ffbe38`,exports.defaultPlaceholderColor=ce,exports.filterRange=Y,exports.findIndexByAnchor=g,exports.getCacheStyleMatrix=ve,exports.getCellValue=G,exports.getColorScaleFromValue=be,exports.getMaxInFormulaResult=xe,exports.getOppositeOperator=ye,exports.getValueByType=q,exports.iconGroup=Se,exports.iconMap=Z,exports.isAnchorEqual=b,exports.isFloatsEqual=U,exports.isNullable=W,Object.defineProperty(exports,`isRangesEqual`,{enumerable:!0,get:function(){return e.isRangesEqual}}),exports.moveByAnchor=_,exports.removeUndefinedAttr=Ae,exports.serialTimeToTimestamp=_e,exports.setConditionalRuleMutationUndoFactory=N,exports.toYMD_1900=ge,exports.transformSupportSymmetryAnchor=v;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ let _univerjs_core = require("@univerjs/core");
3
+ let _univerjs_sheets = require("@univerjs/sheets");
4
+ let rxjs = require("rxjs");
5
+ let _univerjs_engine_formula = require("@univerjs/engine-formula");
6
+ let rxjs_operators = require("rxjs/operators");
7
+ let _univerjs_engine_render = require("@univerjs/engine-render");
8
+
9
+ //#region src/base/const.ts
10
+ const SHEET_CONDITIONAL_FORMATTING_PLUGIN = "SHEET_CONDITIONAL_FORMATTING_PLUGIN";
11
+ let CFTextOperator = /* @__PURE__ */ function(CFTextOperator) {
12
+ CFTextOperator["beginsWith"] = "beginsWith";
13
+ CFTextOperator["endsWith"] = "endsWith";
14
+ CFTextOperator["containsText"] = "containsText";
15
+ CFTextOperator["notContainsText"] = "notContainsText";
16
+ CFTextOperator["equal"] = "equal";
17
+ CFTextOperator["notEqual"] = "notEqual";
18
+ CFTextOperator["containsBlanks"] = "containsBlanks";
19
+ CFTextOperator["notContainsBlanks"] = "notContainsBlanks";
20
+ CFTextOperator["containsErrors"] = "containsErrors";
21
+ CFTextOperator["notContainsErrors"] = "notContainsErrors";
22
+ return CFTextOperator;
23
+ }({});
24
+ let CFTimePeriodOperator = /* @__PURE__ */ function(CFTimePeriodOperator) {
25
+ CFTimePeriodOperator["today"] = "today";
26
+ CFTimePeriodOperator["yesterday"] = "yesterday";
27
+ CFTimePeriodOperator["tomorrow"] = "tomorrow";
28
+ CFTimePeriodOperator["last7Days"] = "last7Days";
29
+ CFTimePeriodOperator["thisMonth"] = "thisMonth";
30
+ CFTimePeriodOperator["lastMonth"] = "lastMonth";
31
+ CFTimePeriodOperator["nextMonth"] = "nextMonth";
32
+ CFTimePeriodOperator["thisWeek"] = "thisWeek";
33
+ CFTimePeriodOperator["lastWeek"] = "lastWeek";
34
+ CFTimePeriodOperator["nextWeek"] = "nextWeek";
35
+ return CFTimePeriodOperator;
36
+ }({});
37
+ let CFNumberOperator = /* @__PURE__ */ function(CFNumberOperator) {
38
+ CFNumberOperator["greaterThan"] = "greaterThan";
39
+ CFNumberOperator["greaterThanOrEqual"] = "greaterThanOrEqual";
40
+ CFNumberOperator["lessThan"] = "lessThan";
41
+ CFNumberOperator["lessThanOrEqual"] = "lessThanOrEqual";
42
+ CFNumberOperator["notBetween"] = "notBetween";
43
+ CFNumberOperator["between"] = "between";
44
+ CFNumberOperator["equal"] = "equal";
45
+ CFNumberOperator["notEqual"] = "notEqual";
46
+ return CFNumberOperator;
47
+ }({});
48
+ let CFRuleType = /* @__PURE__ */ function(CFRuleType) {
49
+ CFRuleType["highlightCell"] = "highlightCell";
50
+ CFRuleType["dataBar"] = "dataBar";
51
+ CFRuleType["colorScale"] = "colorScale";
52
+ CFRuleType["iconSet"] = "iconSet";
53
+ return CFRuleType;
54
+ }({});
55
+ let CFSubRuleType = /* @__PURE__ */ function(CFSubRuleType) {
56
+ CFSubRuleType["uniqueValues"] = "uniqueValues";
57
+ CFSubRuleType["duplicateValues"] = "duplicateValues";
58
+ CFSubRuleType["rank"] = "rank";
59
+ CFSubRuleType["text"] = "text";
60
+ CFSubRuleType["timePeriod"] = "timePeriod";
61
+ CFSubRuleType["number"] = "number";
62
+ CFSubRuleType["average"] = "average";
63
+ CFSubRuleType["formula"] = "formula";
64
+ return CFSubRuleType;
65
+ }({});
66
+ let CFValueType = /* @__PURE__ */ function(CFValueType) {
67
+ CFValueType["num"] = "num";
68
+ CFValueType["min"] = "min";
69
+ CFValueType["max"] = "max";
70
+ CFValueType["percent"] = "percent";
71
+ CFValueType["percentile"] = "percentile";
72
+ CFValueType["formula"] = "formula";
73
+ return CFValueType;
74
+ }({});
75
+ const DEFAULT_BG_COLOR = "#fff";
76
+ const DEFAULT_FONT_COLOR = "#000000";
77
+ const createDefaultRule = () => ({
78
+ cfId: void 0,
79
+ ranges: [],
80
+ stopIfTrue: false,
81
+ rule: {
82
+ type: CFRuleType.highlightCell,
83
+ subType: CFSubRuleType.text,
84
+ operator: CFTextOperator.containsText
85
+ }
86
+ });
87
+ const createDefaultValue = (subType, operator) => {
88
+ switch (subType) {
89
+ case CFSubRuleType.text:
90
+ if ([
91
+ CFTextOperator.beginsWith,
92
+ CFTextOperator.containsText,
93
+ CFTextOperator.endsWith,
94
+ CFTextOperator.equal,
95
+ CFTextOperator.notContainsText,
96
+ CFTextOperator.notEqual
97
+ ].includes(operator)) return "";
98
+ break;
99
+ case CFSubRuleType.number:
100
+ if ([CFNumberOperator.between, CFNumberOperator.notBetween].includes(operator)) return [10, 100];
101
+ return 10;
102
+ }
103
+ return "";
104
+ };
105
+ const createDefaultValueByValueType = (type, defaultValue) => {
106
+ switch (type) {
107
+ case CFValueType.formula: return "=";
108
+ case CFValueType.max:
109
+ case CFValueType.min: return "";
110
+ case CFValueType.percent:
111
+ case CFValueType.percentile:
112
+ case CFValueType.num: return defaultValue !== void 0 ? defaultValue : 10;
113
+ }
114
+ return "";
115
+ };
116
+
117
+ //#endregion
118
+ //#region src/utils/anchor.ts
119
+ const findIndexByAnchor = (anchor, ruleList, get) => {
120
+ if (!ruleList) return null;
121
+ const anchorIndex = ruleList.findIndex((rule) => get(rule) === anchor.id);
122
+ if (anchorIndex < 0) return null;
123
+ switch (anchor.type) {
124
+ case "after": return anchorIndex + 1;
125
+ case "before": return anchorIndex - 1;
126
+ case "self": return anchorIndex;
127
+ }
128
+ };
129
+ /**
130
+ * This function has side effects that modify the ruleList
131
+ * @param {IAnchor} start
132
+ * @param {IAnchor} end
133
+ * @param {ReturnType<ConditionalFormattingRuleModel['getSubunitRules']>} ruleList
134
+ * @return {*}
135
+ */
136
+ const moveByAnchor = (start, end, ruleList, get) => {
137
+ if (!ruleList) return null;
138
+ const startIndex = findIndexByAnchor(start, ruleList, get);
139
+ let endIndex = findIndexByAnchor(end, ruleList, get);
140
+ if (startIndex === null || endIndex === null || startIndex === endIndex) return;
141
+ const rule = ruleList.splice(startIndex, 1)[0];
142
+ if (startIndex < endIndex) endIndex = findIndexByAnchor(end, ruleList, get);
143
+ switch (end.type) {
144
+ case "before":
145
+ ruleList.splice(endIndex + 1, 0, rule);
146
+ break;
147
+ case "self":
148
+ case "after":
149
+ ruleList.splice(endIndex, 0, rule);
150
+ break;
151
+ }
152
+ };
153
+ /**
154
+ * Only [after,after] and [after,before] can support symmetric operations
155
+ */
156
+ const transformSupportSymmetryAnchor = (start, end, ruleList, get) => {
157
+ if (start.type === "after" && ["after", "before"].includes(end.type)) return [start, end];
158
+ const _start = { ...start };
159
+ const _end = { ...end };
160
+ if (_start.type !== "after") {
161
+ const index = findIndexByAnchor(_start, ruleList, get);
162
+ if (index === null) return null;
163
+ if (index - 1 < 0) {
164
+ const nextItem = ruleList[index + 1];
165
+ if (!nextItem) return null;
166
+ else {
167
+ _start.id = get(nextItem);
168
+ _start.type = "before";
169
+ }
170
+ } else {
171
+ _start.id = get(ruleList[index - 1]);
172
+ _start.type = "after";
173
+ }
174
+ }
175
+ if (!["after", "before"].includes(_end.type)) {
176
+ const index = findIndexByAnchor(_end, ruleList, get);
177
+ if (index === null) return null;
178
+ if (index === 0) _end.type = "before";
179
+ else if (index - 1 >= 0) {
180
+ _end.id = get(ruleList[index - 1]);
181
+ _end.type = "after";
182
+ } else if (index + 1 <= ruleList.length - 1) {
183
+ _end.id = get(ruleList[index + 1]);
184
+ _end.type = "before";
185
+ } else return null;
186
+ }
187
+ if (_start.id === _end.id && _start.type === _end.type) return null;
188
+ return [_start, _end];
189
+ };
190
+ const anchorUndoFactory = (start, end) => {
191
+ if (["after", "before"].includes(end.type)) {
192
+ if (start.type === "after") return [end, start];
193
+ else if (start.type === "before") return [end, {
194
+ ...start,
195
+ type: "self"
196
+ }];
197
+ }
198
+ return null;
199
+ };
200
+ const isAnchorEqual = (anchor1, anchor2) => {
201
+ return anchor1.id === anchor2.id && anchor1.type === anchor2.type;
202
+ };
203
+
204
+ //#endregion
205
+ //#region src/utils/create-cf-id.ts
206
+ /**
207
+ * Copyright 2023-present DreamNum Co., Ltd.
208
+ *
209
+ * Licensed under the Apache License, Version 2.0 (the "License");
210
+ * you may not use this file except in compliance with the License.
211
+ * You may obtain a copy of the License at
212
+ *
213
+ * http://www.apache.org/licenses/LICENSE-2.0
214
+ *
215
+ * Unless required by applicable law or agreed to in writing, software
216
+ * distributed under the License is distributed on an "AS IS" BASIS,
217
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
218
+ * See the License for the specific language governing permissions and
219
+ * limitations under the License.
220
+ */
221
+ const createCfId = () => `${(0, _univerjs_core.generateRandomId)(8)}`;
222
+
223
+ //#endregion
224
+ //#region \0@oxc-project+runtime@0.124.0/helpers/typeof.js
225
+ function _typeof(o) {
226
+ "@babel/helpers - typeof";
227
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
228
+ return typeof o;
229
+ } : function(o) {
230
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
231
+ }, _typeof(o);
232
+ }
233
+
234
+ //#endregion
235
+ //#region \0@oxc-project+runtime@0.124.0/helpers/toPrimitive.js
236
+ function toPrimitive(t, r) {
237
+ if ("object" != _typeof(t) || !t) return t;
238
+ var e = t[Symbol.toPrimitive];
239
+ if (void 0 !== e) {
240
+ var i = e.call(t, r || "default");
241
+ if ("object" != _typeof(i)) return i;
242
+ throw new TypeError("@@toPrimitive must return a primitive value.");
243
+ }
244
+ return ("string" === r ? String : Number)(t);
245
+ }
246
+
247
+ //#endregion
248
+ //#region \0@oxc-project+runtime@0.124.0/helpers/toPropertyKey.js
249
+ function toPropertyKey(t) {
250
+ var i = toPrimitive(t, "string");
251
+ return "symbol" == _typeof(i) ? i : i + "";
252
+ }
253
+
254
+ //#endregion
255
+ //#region \0@oxc-project+runtime@0.124.0/helpers/defineProperty.js
256
+ function _defineProperty(e, r, t) {
257
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
258
+ value: t,
259
+ enumerable: !0,
260
+ configurable: !0,
261
+ writable: !0
262
+ }) : e[r] = t, e;
263
+ }
264
+
265
+ //#endregion
266
+ //#region src/models/conditional-formatting-rule-model.ts
267
+ var ConditionalFormattingRuleModel = class {
268
+ constructor() {
269
+ _defineProperty(this, "_model", /* @__PURE__ */ new Map());
270
+ _defineProperty(this, "_ruleChange$", new rxjs.Subject());
271
+ _defineProperty(this, "$ruleChange", this._ruleChange$.asObservable());
272
+ }
273
+ _ensureList(unitId, subUnitId) {
274
+ let list = this.getSubunitRules(unitId, subUnitId);
275
+ if (!list) {
276
+ list = [];
277
+ let unitMap = this._model.get(unitId);
278
+ if (!unitMap) {
279
+ unitMap = /* @__PURE__ */ new Map();
280
+ this._model.set(unitId, unitMap);
281
+ }
282
+ unitMap.set(subUnitId, list);
283
+ }
284
+ return list;
285
+ }
286
+ getRule(unitId, subUnitId, cfId) {
287
+ const list = this.getSubunitRules(unitId, subUnitId);
288
+ if (list) return list.find((item) => item.cfId === cfId);
289
+ return null;
290
+ }
291
+ getUnitRules(unitId) {
292
+ return this._model.get(unitId) || null;
293
+ }
294
+ getSubunitRules(unitId, subUnitId) {
295
+ var _this$_model$get;
296
+ return ((_this$_model$get = this._model.get(unitId)) === null || _this$_model$get === void 0 ? void 0 : _this$_model$get.get(subUnitId)) || null;
297
+ }
298
+ getAll() {
299
+ return this._model;
300
+ }
301
+ deleteRule(unitId, subUnitId, cfId) {
302
+ const list = this.getSubunitRules(unitId, subUnitId);
303
+ if (list) {
304
+ const index = list.findIndex((e) => e.cfId === cfId);
305
+ const rule = list[index];
306
+ if (rule) {
307
+ list.splice(index, 1);
308
+ this._ruleChange$.next({
309
+ rule,
310
+ subUnitId,
311
+ unitId,
312
+ type: "delete"
313
+ });
314
+ }
315
+ }
316
+ }
317
+ setRule(unitId, subUnitId, rule, oldCfId) {
318
+ const oldRule = this._ensureList(unitId, subUnitId).find((item) => item.cfId === oldCfId);
319
+ if (oldRule) {
320
+ const cloneRule = _univerjs_core.Tools.deepClone(oldRule);
321
+ Object.assign(oldRule, rule);
322
+ this._ruleChange$.next({
323
+ rule: oldRule,
324
+ subUnitId,
325
+ unitId,
326
+ type: "set",
327
+ oldRule: cloneRule
328
+ });
329
+ }
330
+ }
331
+ addRule(unitId, subUnitId, rule) {
332
+ const list = this._ensureList(unitId, subUnitId);
333
+ if (!list.find((item) => item.cfId === rule.cfId)) list.unshift(rule);
334
+ this._ruleChange$.next({
335
+ rule,
336
+ subUnitId,
337
+ unitId,
338
+ type: "add"
339
+ });
340
+ }
341
+ /**
342
+ * example [1,2,3,4,5,6],if you move behind 5 to 2, then cfId=5,targetId=2.
343
+ * if targetId does not exist, it defaults to top
344
+ */
345
+ moveRulePriority(unitId, subUnitId, start, end) {
346
+ const list = this._ensureList(unitId, subUnitId);
347
+ const curIndex = findIndexByAnchor(start, list, (rule) => rule.cfId);
348
+ const targetCfIndex = findIndexByAnchor(end, list, (rule) => rule.cfId);
349
+ if (targetCfIndex === null || curIndex === null || targetCfIndex === curIndex) return;
350
+ const rule = list[curIndex];
351
+ if (rule) {
352
+ moveByAnchor(start, end, list, (rule) => rule.cfId);
353
+ this._ruleChange$.next({
354
+ rule,
355
+ subUnitId,
356
+ unitId,
357
+ type: "sort"
358
+ });
359
+ }
360
+ }
361
+ createCfId(_unitId, _subUnitId) {
362
+ return createCfId();
363
+ }
364
+ deleteUnitId(unitId) {
365
+ this._model.delete(unitId);
366
+ }
367
+ };
368
+
369
+ //#endregion
370
+ //#region src/commands/mutations/move-conditional-rule.mutation.ts
371
+ const MoveConditionalRuleMutation = {
372
+ type: _univerjs_core.CommandType.MUTATION,
373
+ id: "sheet.mutation.move-conditional-rule",
374
+ handler(accessor, params) {
375
+ if (!params) return false;
376
+ const { unitId, subUnitId, start, end } = params;
377
+ accessor.get(ConditionalFormattingRuleModel).moveRulePriority(unitId, subUnitId, start, end);
378
+ return true;
379
+ }
380
+ };
381
+ const MoveConditionalRuleMutationUndoFactory = (param) => {
382
+ const { unitId, subUnitId } = param;
383
+ const undo = anchorUndoFactory(param.start, param.end);
384
+ if (!undo) return [];
385
+ const [start, end] = undo;
386
+ return [{
387
+ id: MoveConditionalRuleMutation.id,
388
+ params: {
389
+ unitId,
390
+ subUnitId,
391
+ start,
392
+ end
393
+ }
394
+ }];
395
+ };
396
+
397
+ //#endregion
398
+ //#region src/commands/mutations/delete-conditional-rule.mutation.ts
399
+ const DeleteConditionalRuleMutationUndoFactory = (accessor, param) => {
400
+ const conditionalFormattingRuleModel = accessor.get(ConditionalFormattingRuleModel);
401
+ const { unitId, subUnitId, cfId } = param;
402
+ const ruleList = [...conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId) || []];
403
+ const index = ruleList.findIndex((item) => item.cfId === cfId);
404
+ const beforeRule = ruleList[index - 1];
405
+ if (index > -1) {
406
+ const rule = ruleList[index];
407
+ const result = [{
408
+ id: AddConditionalRuleMutation.id,
409
+ params: {
410
+ unitId,
411
+ subUnitId,
412
+ rule: _univerjs_core.Tools.deepClone(rule)
413
+ }
414
+ }];
415
+ ruleList.splice(index, 1);
416
+ if (index !== 0) {
417
+ const firstRule = ruleList[0];
418
+ if (firstRule) {
419
+ const transformResult = transformSupportSymmetryAnchor({
420
+ id: firstRule.cfId,
421
+ type: "before"
422
+ }, {
423
+ id: beforeRule.cfId,
424
+ type: "after"
425
+ }, ruleList, (rule) => rule.cfId);
426
+ if (!transformResult) return result;
427
+ const [start, end] = transformResult;
428
+ const params = {
429
+ unitId,
430
+ subUnitId,
431
+ start,
432
+ end
433
+ };
434
+ result.push({
435
+ id: MoveConditionalRuleMutation.id,
436
+ params
437
+ });
438
+ }
439
+ }
440
+ return result;
441
+ }
442
+ return [];
443
+ };
444
+ const DeleteConditionalRuleMutation = {
445
+ type: _univerjs_core.CommandType.MUTATION,
446
+ id: "sheet.mutation.delete-conditional-rule",
447
+ handler(accessor, params) {
448
+ if (!params) return false;
449
+ const { unitId, subUnitId, cfId } = params;
450
+ accessor.get(ConditionalFormattingRuleModel).deleteRule(unitId, subUnitId, cfId);
451
+ return true;
452
+ }
453
+ };
454
+
455
+ //#endregion
456
+ //#region src/commands/mutations/add-conditional-rule.mutation.ts
457
+ const AddConditionalRuleMutationUndoFactory = (accessor, param) => {
458
+ return {
459
+ id: DeleteConditionalRuleMutation.id,
460
+ params: {
461
+ unitId: param.unitId,
462
+ subUnitId: param.subUnitId,
463
+ cfId: param.rule.cfId
464
+ }
465
+ };
466
+ };
467
+ const AddConditionalRuleMutation = {
468
+ type: _univerjs_core.CommandType.MUTATION,
469
+ id: "sheet.mutation.add-conditional-rule",
470
+ handler(accessor, params) {
471
+ if (!params) return false;
472
+ const { unitId, subUnitId, rule } = params;
473
+ accessor.get(ConditionalFormattingRuleModel).addRule(unitId, subUnitId, rule);
474
+ return true;
475
+ }
476
+ };
477
+
478
+ //#endregion
479
+ //#region src/commands/commands/add-cf.command.ts
480
+ const AddCfCommand = {
481
+ type: _univerjs_core.CommandType.COMMAND,
482
+ id: "sheet.command.add-conditional-rule",
483
+ handler(accessor, params) {
484
+ if (!params) return false;
485
+ const { rule } = params;
486
+ const undoRedoService = accessor.get(_univerjs_core.IUndoRedoService);
487
+ const commandService = accessor.get(_univerjs_core.ICommandService);
488
+ const conditionalFormattingRuleModel = accessor.get(ConditionalFormattingRuleModel);
489
+ const target = (0, _univerjs_sheets.getSheetCommandTarget)(accessor.get(_univerjs_core.IUniverInstanceService), params);
490
+ if (!target) return false;
491
+ const { unitId, subUnitId } = target;
492
+ const cfId = conditionalFormattingRuleModel.createCfId(unitId, subUnitId);
493
+ const config = {
494
+ unitId,
495
+ subUnitId,
496
+ rule: {
497
+ ...rule,
498
+ cfId: rule.cfId || cfId
499
+ }
500
+ };
501
+ const undo = AddConditionalRuleMutationUndoFactory(accessor, config);
502
+ const result = commandService.syncExecuteCommand(AddConditionalRuleMutation.id, config);
503
+ if (result) undoRedoService.pushUndoRedo({
504
+ unitID: unitId,
505
+ redoMutations: [{
506
+ id: AddConditionalRuleMutation.id,
507
+ params: config
508
+ }],
509
+ undoMutations: [undo]
510
+ });
511
+ return result;
512
+ }
513
+ };
514
+
515
+ //#endregion
516
+ //#region src/commands/mutations/set-conditional-rule.mutation.ts
517
+ const SetConditionalRuleMutation = {
518
+ type: _univerjs_core.CommandType.MUTATION,
519
+ id: "sheet.mutation.set-conditional-rule",
520
+ handler(accessor, params) {
521
+ if (!params) return false;
522
+ const { unitId, subUnitId, rule } = params;
523
+ const cfId = params.cfId || params.rule.cfId;
524
+ accessor.get(ConditionalFormattingRuleModel).setRule(unitId, subUnitId, rule, cfId);
525
+ return true;
526
+ }
527
+ };
528
+ const setConditionalRuleMutationUndoFactory = (accessor, param) => {
529
+ const conditionalFormattingRuleModel = accessor.get(ConditionalFormattingRuleModel);
530
+ const { unitId, subUnitId } = param;
531
+ const cfId = param.cfId || param.rule.cfId;
532
+ const rule = conditionalFormattingRuleModel.getRule(unitId, subUnitId, cfId);
533
+ if (rule) return [{
534
+ id: SetConditionalRuleMutation.id,
535
+ params: {
536
+ unitId,
537
+ subUnitId,
538
+ cfId,
539
+ rule: _univerjs_core.Tools.deepClone(rule)
540
+ }
541
+ }];
542
+ return [];
543
+ };
544
+
545
+ //#endregion
546
+ //#region src/commands/commands/clear-range-cf.command.ts
547
+ const ClearRangeCfCommand = {
548
+ type: _univerjs_core.CommandType.COMMAND,
549
+ id: "sheet.command.clear-range-conditional-rule",
550
+ handler(accessor, params) {
551
+ var _selectionManagerServ;
552
+ if (!params) return false;
553
+ const conditionalFormattingRuleModel = accessor.get(ConditionalFormattingRuleModel);
554
+ const univerInstanceService = accessor.get(_univerjs_core.IUniverInstanceService);
555
+ const commandService = accessor.get(_univerjs_core.ICommandService);
556
+ const undoRedoService = accessor.get(_univerjs_core.IUndoRedoService);
557
+ const selectionManagerService = accessor.get(_univerjs_sheets.SheetsSelectionsService);
558
+ const target = (0, _univerjs_sheets.getSheetCommandTarget)(univerInstanceService, params);
559
+ if (!target) return false;
560
+ const { unitId, subUnitId } = target;
561
+ const ranges = ((_selectionManagerServ = selectionManagerService.getCurrentSelections()) === null || _selectionManagerServ === void 0 ? void 0 : _selectionManagerServ.map((selection) => selection.range)) || [];
562
+ const allRuleList = conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId);
563
+ if (!(allRuleList === null || allRuleList === void 0 ? void 0 : allRuleList.length) || !ranges.length) return false;
564
+ const redos = [];
565
+ const undos = [];
566
+ allRuleList.forEach((oldRule) => {
567
+ const matrix = new _univerjs_core.ObjectMatrix();
568
+ oldRule.ranges.forEach((range) => {
569
+ _univerjs_core.Range.foreach(range, (row, col) => {
570
+ matrix.setValue(row, col, 1);
571
+ });
572
+ });
573
+ ranges.forEach((range) => {
574
+ _univerjs_core.Range.foreach(range, (row, col) => {
575
+ matrix.realDeleteValue(row, col);
576
+ });
577
+ });
578
+ const newRanges = (0, _univerjs_sheets.findAllRectangle)((0, _univerjs_sheets.createTopMatrixFromMatrix)(matrix));
579
+ if (newRanges.length) {
580
+ const params = {
581
+ unitId,
582
+ subUnitId,
583
+ rule: {
584
+ ...oldRule,
585
+ ranges: newRanges
586
+ }
587
+ };
588
+ const undo = setConditionalRuleMutationUndoFactory(accessor, params);
589
+ redos.push({
590
+ id: SetConditionalRuleMutation.id,
591
+ params
592
+ });
593
+ undos.push(...undo);
594
+ } else {
595
+ const params = {
596
+ unitId,
597
+ subUnitId,
598
+ cfId: oldRule.cfId
599
+ };
600
+ const undo = DeleteConditionalRuleMutationUndoFactory(accessor, params);
601
+ redos.push({
602
+ id: DeleteConditionalRuleMutation.id,
603
+ params
604
+ });
605
+ undos.push(...undo);
606
+ }
607
+ });
608
+ const result = (0, _univerjs_core.sequenceExecute)(redos, commandService).result;
609
+ if (result) undoRedoService.pushUndoRedo({
610
+ unitID: unitId,
611
+ redoMutations: redos,
612
+ undoMutations: undos
613
+ });
614
+ return result;
615
+ }
616
+ };
617
+
618
+ //#endregion
619
+ //#region src/commands/commands/clear-worksheet-cf.command.ts
620
+ const ClearWorksheetCfCommand = {
621
+ type: _univerjs_core.CommandType.COMMAND,
622
+ id: "sheet.command.clear-worksheet-conditional-rule",
623
+ handler(accessor, params) {
624
+ const conditionalFormattingRuleModel = accessor.get(ConditionalFormattingRuleModel);
625
+ const univerInstanceService = accessor.get(_univerjs_core.IUniverInstanceService);
626
+ const commandService = accessor.get(_univerjs_core.ICommandService);
627
+ const undoRedoService = accessor.get(_univerjs_core.IUndoRedoService);
628
+ const target = (0, _univerjs_sheets.getSheetCommandTarget)(univerInstanceService, params);
629
+ if (!target) return false;
630
+ const { unitId, subUnitId } = target;
631
+ const ruleList = conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId);
632
+ if (!(ruleList === null || ruleList === void 0 ? void 0 : ruleList.length)) return false;
633
+ const configList = ruleList.map((rule) => ({
634
+ cfId: rule.cfId,
635
+ unitId,
636
+ subUnitId
637
+ }));
638
+ const redos = configList.map((config) => ({
639
+ id: DeleteConditionalRuleMutation.id,
640
+ params: config
641
+ }));
642
+ const undos = configList.map((config) => DeleteConditionalRuleMutationUndoFactory(accessor, config)[0]);
643
+ const result = (0, _univerjs_core.sequenceExecute)(redos, commandService).result;
644
+ if (result) undoRedoService.pushUndoRedo({
645
+ unitID: unitId,
646
+ redoMutations: redos,
647
+ undoMutations: undos
648
+ });
649
+ return result;
650
+ }
651
+ };
652
+
653
+ //#endregion
654
+ //#region src/commands/commands/delete-cf.command.ts
655
+ const DeleteCfCommand = {
656
+ type: _univerjs_core.CommandType.COMMAND,
657
+ id: "sheet.command.delete-conditional-rule",
658
+ handler(accessor, params) {
659
+ if (!params) return false;
660
+ const undoRedoService = accessor.get(_univerjs_core.IUndoRedoService);
661
+ const commandService = accessor.get(_univerjs_core.ICommandService);
662
+ const target = (0, _univerjs_sheets.getSheetCommandTarget)(accessor.get(_univerjs_core.IUniverInstanceService), params);
663
+ if (!target) return false;
664
+ const { unitId, subUnitId } = target;
665
+ const config = {
666
+ unitId,
667
+ subUnitId,
668
+ cfId: params.cfId
669
+ };
670
+ const undos = DeleteConditionalRuleMutationUndoFactory(accessor, config);
671
+ const result = commandService.syncExecuteCommand(DeleteConditionalRuleMutation.id, config);
672
+ if (result) undoRedoService.pushUndoRedo({
673
+ unitID: unitId,
674
+ undoMutations: undos,
675
+ redoMutations: [{
676
+ id: DeleteConditionalRuleMutation.id,
677
+ params: config
678
+ }]
679
+ });
680
+ return result;
681
+ }
682
+ };
683
+
684
+ //#endregion
685
+ //#region src/commands/commands/move-cf.command.ts
686
+ const MoveCfCommand = {
687
+ type: _univerjs_core.CommandType.COMMAND,
688
+ id: "sheet.command.move-conditional-rule",
689
+ handler(accessor, params) {
690
+ if (!params) return false;
691
+ const undoRedoService = accessor.get(_univerjs_core.IUndoRedoService);
692
+ const commandService = accessor.get(_univerjs_core.ICommandService);
693
+ const univerInstanceService = accessor.get(_univerjs_core.IUniverInstanceService);
694
+ const conditionalFormattingRuleModel = accessor.get(ConditionalFormattingRuleModel);
695
+ const target = (0, _univerjs_sheets.getSheetCommandTarget)(univerInstanceService, params);
696
+ if (!target) return false;
697
+ const { unitId, subUnitId } = target;
698
+ const anchorList = transformSupportSymmetryAnchor(params.start, params.end, conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId) || [], (rule) => rule.cfId);
699
+ if (!anchorList) return false;
700
+ const [start, end] = anchorList;
701
+ const config = {
702
+ unitId,
703
+ subUnitId,
704
+ start,
705
+ end
706
+ };
707
+ const undos = MoveConditionalRuleMutationUndoFactory(config);
708
+ const result = commandService.syncExecuteCommand(MoveConditionalRuleMutation.id, config);
709
+ if (result) undoRedoService.pushUndoRedo({
710
+ unitID: unitId,
711
+ redoMutations: [{
712
+ id: MoveConditionalRuleMutation.id,
713
+ params: config
714
+ }],
715
+ undoMutations: undos
716
+ });
717
+ return result;
718
+ }
719
+ };
720
+
721
+ //#endregion
722
+ //#region src/commands/commands/set-cf.command.ts
723
+ const SetCfCommand = {
724
+ type: _univerjs_core.CommandType.COMMAND,
725
+ id: "sheet.command.set-conditional-rule",
726
+ handler(accessor, params) {
727
+ if (!params) return false;
728
+ const undoRedoService = accessor.get(_univerjs_core.IUndoRedoService);
729
+ const commandService = accessor.get(_univerjs_core.ICommandService);
730
+ const target = (0, _univerjs_sheets.getSheetCommandTarget)(accessor.get(_univerjs_core.IUniverInstanceService), params);
731
+ if (!target) return false;
732
+ const { unitId, subUnitId } = target;
733
+ const config = {
734
+ unitId,
735
+ subUnitId,
736
+ rule: params.rule,
737
+ cfId: params.cfId
738
+ };
739
+ const undos = setConditionalRuleMutationUndoFactory(accessor, config);
740
+ const result = commandService.syncExecuteCommand(SetConditionalRuleMutation.id, config);
741
+ if (result) undoRedoService.pushUndoRedo({
742
+ unitID: unitId,
743
+ undoMutations: undos,
744
+ redoMutations: [{
745
+ id: SetConditionalRuleMutation.id,
746
+ params: config
747
+ }]
748
+ });
749
+ return result;
750
+ }
751
+ };
752
+
753
+ //#endregion
754
+ //#region \0@oxc-project+runtime@0.124.0/helpers/decorateParam.js
755
+ function __decorateParam(paramIndex, decorator) {
756
+ return function(target, key) {
757
+ decorator(target, key, paramIndex);
758
+ };
759
+ }
760
+
761
+ //#endregion
762
+ //#region \0@oxc-project+runtime@0.124.0/helpers/decorate.js
763
+ function __decorate(decorators, target, key, desc) {
764
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
765
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
766
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
767
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
768
+ }
769
+
770
+ //#endregion
771
+ //#region src/services/conditional-formatting-formula.service.ts
772
+ let ConditionalFormattingFormulaService = class ConditionalFormattingFormulaService extends _univerjs_core.Disposable {
773
+ constructor(_registerOtherFormulaService, _conditionalFormattingRuleModel) {
774
+ super();
775
+ this._registerOtherFormulaService = _registerOtherFormulaService;
776
+ this._conditionalFormattingRuleModel = _conditionalFormattingRuleModel;
777
+ _defineProperty(this, "_formulaMap", /* @__PURE__ */ new Map());
778
+ _defineProperty(this, "_result$", new rxjs.Subject());
779
+ _defineProperty(this, "result$", this._result$.asObservable());
780
+ this._initFormulaResultChange();
781
+ this._initRuleChange();
782
+ }
783
+ _initRuleChange() {
784
+ const isNeedMarkFormulaDirty = (rule) => {
785
+ switch (rule.type) {
786
+ case CFRuleType.colorScale: return rule.config.some((item) => item.value.type === CFValueType.formula);
787
+ case CFRuleType.dataBar: return [rule.config.max, rule.config.min].some((item) => item.type === CFValueType.formula);
788
+ case CFRuleType.iconSet: return rule.config.some((item) => item.value.type === CFValueType.formula);
789
+ }
790
+ };
791
+ this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe((option) => {
792
+ const { unitId, subUnitId, rule, oldRule } = option;
793
+ if (option.type === "delete") this._removeFormulaByCfId(unitId, subUnitId, rule.cfId);
794
+ if (option.type === "set") {
795
+ if (isNeedMarkFormulaDirty(rule.rule) || oldRule && isNeedMarkFormulaDirty(oldRule.rule)) this._removeFormulaByCfId(unitId, subUnitId, rule.cfId);
796
+ }
797
+ if (option.type === "add") this._registerRuleFormulas(unitId, subUnitId, rule);
798
+ }));
799
+ }
800
+ /**
801
+ * Register formulas for a specific rule based on its type
802
+ */
803
+ _registerRuleFormulas(unitId, subUnitId, rule) {
804
+ switch (rule.rule.type) {
805
+ case CFRuleType.highlightCell:
806
+ if (rule.rule.subType === CFSubRuleType.formula) {
807
+ const formulaText = rule.rule.value;
808
+ if (formulaText) this.registerFormulaWithRange(unitId, subUnitId, rule.cfId, formulaText, rule.ranges);
809
+ }
810
+ break;
811
+ }
812
+ }
813
+ _initFormulaResultChange() {
814
+ this.disposeWithMe(this._registerOtherFormulaService.formulaResult$.subscribe((results) => {
815
+ for (const unitId in results) for (const subUnitId in results[unitId]) {
816
+ const subUnitResults = results[unitId][subUnitId];
817
+ for (const formulaResult of subUnitResults) {
818
+ const formulaMapAlias = this._ensureSubunitFormulaMap(unitId, subUnitId).getValue(formulaResult.formulaId, ["formulaId"]);
819
+ if (!formulaMapAlias) continue;
820
+ const isAllFinished = this._getAllFormulaResultByCfId(unitId, subUnitId, formulaMapAlias.cfId).every((item) => {
821
+ const result = this._registerOtherFormulaService.getFormulaValueSync(unitId, subUnitId, item.formulaId);
822
+ return (result === null || result === void 0 ? void 0 : result.status) === _univerjs_engine_formula.FormulaResultStatus.SUCCESS;
823
+ });
824
+ this._result$.next({
825
+ ...formulaMapAlias,
826
+ isAllFinished
827
+ });
828
+ }
829
+ }
830
+ }));
831
+ }
832
+ _ensureSubunitFormulaMap(unitId, subUnitId) {
833
+ let unitMap = this._formulaMap.get(unitId);
834
+ if (!unitMap) {
835
+ unitMap = /* @__PURE__ */ new Map();
836
+ this._formulaMap.set(unitId, unitMap);
837
+ }
838
+ let subUnitMap = unitMap.get(subUnitId);
839
+ if (!subUnitMap) {
840
+ subUnitMap = new _univerjs_core.RefAlias([], ["formulaId", "id"]);
841
+ unitMap.set(subUnitId, subUnitMap);
842
+ }
843
+ return subUnitMap;
844
+ }
845
+ getSubUnitFormulaMap(unitId, subUnitId) {
846
+ var _this$_formulaMap$get;
847
+ return (_this$_formulaMap$get = this._formulaMap.get(unitId)) === null || _this$_formulaMap$get === void 0 ? void 0 : _this$_formulaMap$get.get(subUnitId);
848
+ }
849
+ registerFormulaWithRange(unitId, subUnitId, cfId, formulaText, ranges = [{
850
+ startRow: 0,
851
+ endRow: 0,
852
+ startColumn: 0,
853
+ endColumn: 0
854
+ }]) {
855
+ const formulaMap = this._ensureSubunitFormulaMap(unitId, subUnitId);
856
+ const cfFormulaId = this.createCFormulaId(cfId, formulaText);
857
+ if (formulaMap.getValue(cfFormulaId, ["id"])) return;
858
+ const formulaId = this._registerOtherFormulaService.registerFormulaWithRange(unitId, subUnitId, formulaText, ranges, void 0, _univerjs_engine_formula.OtherFormulaBizType.CONDITIONAL_FORMATTING, cfId);
859
+ formulaMap.addValue({
860
+ formulaText,
861
+ unitId,
862
+ subUnitId,
863
+ cfId,
864
+ id: cfFormulaId,
865
+ formulaId
866
+ });
867
+ }
868
+ _removeFormulaByCfId(unitId, subUnitId, cfId) {
869
+ const formulaIdList = this.deleteCache(unitId, subUnitId, cfId).map((item) => item.formulaId);
870
+ this._registerOtherFormulaService.deleteFormula(unitId, subUnitId, formulaIdList);
871
+ }
872
+ getFormulaResultWithCoords(unitId, subUnitId, cfId, formulaText, row = 0, col = 0) {
873
+ const map = this.getSubUnitFormulaMap(unitId, subUnitId);
874
+ if (!map) return { status: _univerjs_engine_formula.FormulaResultStatus.NOT_REGISTER };
875
+ const item = map.getValue(this.createCFormulaId(cfId, formulaText), ["id"]);
876
+ if (!item) return { status: _univerjs_engine_formula.FormulaResultStatus.NOT_REGISTER };
877
+ const formulaResult = this._registerOtherFormulaService.getFormulaValueSync(unitId, subUnitId, item.formulaId);
878
+ if (!formulaResult) return { status: _univerjs_engine_formula.FormulaResultStatus.NOT_REGISTER };
879
+ if (formulaResult.status === _univerjs_engine_formula.FormulaResultStatus.SUCCESS && formulaResult.result) {
880
+ var _formulaResult$result;
881
+ const cellData = (_formulaResult$result = formulaResult.result[row]) === null || _formulaResult$result === void 0 ? void 0 : _formulaResult$result[col];
882
+ return {
883
+ result: this._getCellValue(cellData),
884
+ status: _univerjs_engine_formula.FormulaResultStatus.SUCCESS
885
+ };
886
+ }
887
+ return { status: formulaResult.status };
888
+ }
889
+ getFormulaMatrix(unitId, subUnitId, cfId, formulaText) {
890
+ const map = this.getSubUnitFormulaMap(unitId, subUnitId);
891
+ if (!map) return { status: _univerjs_engine_formula.FormulaResultStatus.NOT_REGISTER };
892
+ const item = map.getValue(this.createCFormulaId(cfId, formulaText), ["id"]);
893
+ if (!item) return { status: _univerjs_engine_formula.FormulaResultStatus.NOT_REGISTER };
894
+ const formulaResult = this._registerOtherFormulaService.getFormulaValueSync(unitId, subUnitId, item.formulaId);
895
+ if (!formulaResult) return { status: _univerjs_engine_formula.FormulaResultStatus.NOT_REGISTER };
896
+ if (formulaResult.status === _univerjs_engine_formula.FormulaResultStatus.SUCCESS && formulaResult.result) {
897
+ const result = new _univerjs_core.ObjectMatrix();
898
+ new _univerjs_core.ObjectMatrix(formulaResult.result).forValue((row, col, cellData) => {
899
+ result.setValue(row, col, this._getCellValue(cellData));
900
+ });
901
+ return {
902
+ result,
903
+ status: _univerjs_engine_formula.FormulaResultStatus.SUCCESS
904
+ };
905
+ }
906
+ return { status: formulaResult.status };
907
+ }
908
+ _getCellValue(cellData) {
909
+ if (!cellData || !cellData[0] || !cellData[0][0]) return false;
910
+ const cell = cellData[0][0];
911
+ if ((cell === null || cell === void 0 ? void 0 : cell.t) === _univerjs_core.CellValueType.BOOLEAN) return cell.v === _univerjs_core.BooleanNumber.TRUE || cell.v === true;
912
+ return cell === null || cell === void 0 ? void 0 : cell.v;
913
+ }
914
+ /**
915
+ * If `formulaText` is not provided, then all caches related to `cfId` will be deleted.
916
+ */
917
+ deleteCache(unitId, subUnitId, cfId, formulaText) {
918
+ const map = this.getSubUnitFormulaMap(unitId, subUnitId);
919
+ if (!map) return [];
920
+ if (formulaText) {
921
+ const key = this.createCFormulaId(cfId, formulaText);
922
+ map.deleteValue(key, ["id"]);
923
+ return [];
924
+ } else {
925
+ const values = map.getValues().filter((v) => v.cfId === cfId);
926
+ values.forEach((e) => {
927
+ map.deleteValue(e.formulaId, ["formulaId"]);
928
+ });
929
+ return values;
930
+ }
931
+ }
932
+ _getAllFormulaResultByCfId(unitId, subUnitId, cfId) {
933
+ const map = this.getSubUnitFormulaMap(unitId, subUnitId);
934
+ if (!map) return [];
935
+ return map.getValues().filter((v) => v.cfId === cfId);
936
+ }
937
+ /**
938
+ * A conditional formatting may have multiple formulas;if the formulas are identical,then the results will be consistent.
939
+ */
940
+ createCFormulaId(cfId, formulaText) {
941
+ return `${cfId}_${formulaText}`;
942
+ }
943
+ };
944
+ ConditionalFormattingFormulaService = __decorate([__decorateParam(0, (0, _univerjs_core.Inject)(_univerjs_engine_formula.RegisterOtherFormulaService)), __decorateParam(1, (0, _univerjs_core.Inject)(ConditionalFormattingRuleModel))], ConditionalFormattingFormulaService);
945
+
946
+ //#endregion
947
+ //#region src/models/calculate-unit-v2/base-calculate-unit.ts
948
+ let CalculateEmitStatus = /* @__PURE__ */ function(CalculateEmitStatus) {
949
+ CalculateEmitStatus["preComputingStart"] = "preComputingStart";
950
+ CalculateEmitStatus["preComputing"] = "preComputing";
951
+ CalculateEmitStatus["preComputingEnd"] = "preComputingEnd";
952
+ CalculateEmitStatus["preComputingError"] = "preComputingError";
953
+ return CalculateEmitStatus;
954
+ }({});
955
+ /**
956
+ * Processing Main Path Calculation Logic
957
+ */
958
+ var BaseCalculateUnit = class {
959
+ constructor(_context) {
960
+ this._context = _context;
961
+ _defineProperty(this, "_cache", void 0);
962
+ _defineProperty(this, "_preComputingStatus$", new rxjs.BehaviorSubject(CalculateEmitStatus.preComputingStart));
963
+ _defineProperty(this, "preComputingStatus$", this._preComputingStatus$.asObservable().pipe((0, rxjs_operators.distinctUntilChanged)()));
964
+ _defineProperty(this, "_preComputingCache", void 0);
965
+ _defineProperty(this, "_rule", void 0);
966
+ this._cache = new _univerjs_core.LRUMap(_context.limit);
967
+ this._rule = _context.rule;
968
+ this._preComputingCache = null;
969
+ this._initClearCacheListener();
970
+ }
971
+ setCacheLength(length) {
972
+ this._cache.limit = length;
973
+ }
974
+ clearCache() {
975
+ this._cache.clear();
976
+ }
977
+ resetPreComputingCache() {
978
+ this._preComputingStatus$.next(CalculateEmitStatus.preComputingStart);
979
+ this._preComputingCache = null;
980
+ }
981
+ updateRule(rule) {
982
+ this._rule = rule;
983
+ this.resetPreComputingCache();
984
+ }
985
+ getCell(row, col) {
986
+ const key = this._createKey(row, col);
987
+ if (this._preComputingStatus$.getValue() === CalculateEmitStatus.preComputing) return this._cache.get(key);
988
+ let preComputingResult = this.getPreComputingResult(row, col);
989
+ if (preComputingResult === null) {
990
+ this._preComputingStatus$.next(CalculateEmitStatus.preComputingStart);
991
+ this.preComputing(row, col, this._getContext());
992
+ preComputingResult = this.getPreComputingResult(row, col);
993
+ if (preComputingResult === null) return this._cache.get(key);
994
+ }
995
+ this._preComputingStatus$.next(CalculateEmitStatus.preComputingEnd);
996
+ if (this._cache.has(key)) return this._cache.get(key);
997
+ const result = this.getCellResult(row, col, preComputingResult, this._getContext());
998
+ if (result !== null) this._setCache(row, col, result);
999
+ return result;
1000
+ }
1001
+ setPreComputingCache(v) {
1002
+ this._preComputingCache = v;
1003
+ }
1004
+ getPreComputingResult(_row, _col) {
1005
+ return this._preComputingCache;
1006
+ }
1007
+ _createKey(row, col) {
1008
+ return `${row}_${col}`;
1009
+ }
1010
+ _setCache(row, col, v) {
1011
+ const key = this._createKey(row, col);
1012
+ this._cache.set(key, v);
1013
+ }
1014
+ _getContext() {
1015
+ return {
1016
+ ...this._context,
1017
+ rule: this._rule
1018
+ };
1019
+ }
1020
+ _initClearCacheListener() {
1021
+ this.preComputingStatus$.subscribe((e) => {
1022
+ if (e === CalculateEmitStatus.preComputingEnd) this.clearCache();
1023
+ });
1024
+ }
1025
+ };
1026
+
1027
+ //#endregion
1028
+ //#region src/models/calculate-unit-v2/color-scale-calculate-unit.ts
1029
+ var ColorScaleCalculateUnit = class extends BaseCalculateUnit {
1030
+ preComputing(_row, _col, context) {
1031
+ const rule = context.rule;
1032
+ const worksheet = context.worksheet;
1033
+ const matrix = new _univerjs_core.ObjectMatrix();
1034
+ if (!rule.rule.config.every((item) => item.value.type === CFValueType.num)) filterRange(rule.ranges, worksheet.getMaxRows() - 1, worksheet.getMaxColumns() - 1).forEach((range) => {
1035
+ _univerjs_core.Range.foreach(range, (row, col) => {
1036
+ const cell = context.getCellValue(row, col);
1037
+ const v = cell && cell.v;
1038
+ if (!isNullable(v) && (cell === null || cell === void 0 ? void 0 : cell.t) === _univerjs_core.CellValueType.NUMBER) {
1039
+ const _value = Number(v);
1040
+ !Number.isNaN(_value) && matrix.setValue(row, col, _value);
1041
+ }
1042
+ });
1043
+ });
1044
+ const _configList = [...rule.rule.config].sort((a, b) => a.index - b.index).map((config) => {
1045
+ return {
1046
+ value: getValueByType(config.value, matrix, {
1047
+ ...context,
1048
+ cfId: rule.cfId
1049
+ }),
1050
+ color: new _univerjs_core.ColorKit(config.color)
1051
+ };
1052
+ });
1053
+ if (!_configList.some((item) => (0, _univerjs_engine_render.isObject)(item.value) ? item.value.status !== _univerjs_engine_formula.FormulaResultStatus.SUCCESS : false)) {
1054
+ const colorList = _configList.map((item) => item.color).reduce((result, color, index) => {
1055
+ result.result.push({
1056
+ color,
1057
+ value: result.sortValue[index]
1058
+ });
1059
+ return result;
1060
+ }, {
1061
+ result: [],
1062
+ sortValue: _configList.map((item) => item.value.result).sort((a, b) => a - b)
1063
+ }).result;
1064
+ this.setPreComputingCache(colorList);
1065
+ this._preComputingStatus$.next(CalculateEmitStatus.preComputingEnd);
1066
+ return;
1067
+ }
1068
+ this._preComputingStatus$.next(CalculateEmitStatus.preComputing);
1069
+ }
1070
+ getCellResult(row, col, preComputingResult, context) {
1071
+ if (!preComputingResult) return null;
1072
+ const cell = context.getCellValue(row, col);
1073
+ if (cell.t === _univerjs_core.CellValueType.NUMBER) {
1074
+ const v = Number(cell.v);
1075
+ if (!Number.isNaN(v)) return getColorScaleFromValue(preComputingResult, v);
1076
+ }
1077
+ }
1078
+ };
1079
+
1080
+ //#endregion
1081
+ //#region src/render/data-bar.render.ts
1082
+ const dataBarUKey = "sheet-conditional-rule-data-bar";
1083
+ const defaultDataBarPositiveColor = "#ffbe38";
1084
+ const defaultDataBarNativeColor = "#abd91a";
1085
+ const defaultPlaceholderColor = "#000";
1086
+ const EXTENSION_Z_INDEX$1 = 34;
1087
+ const stringifyRange$1 = (range) => {
1088
+ const { startRow, endRow, startColumn, endColumn } = range;
1089
+ return `${startRow}-${endRow}-${startColumn}-${endColumn}`;
1090
+ };
1091
+ var DataBar = class extends _univerjs_engine_render.SheetExtension {
1092
+ constructor(..._args) {
1093
+ super(..._args);
1094
+ _defineProperty(this, "_paddingRightAndLeft", 2);
1095
+ _defineProperty(this, "_paddingTopAndBottom", 2);
1096
+ _defineProperty(this, "uKey", dataBarUKey);
1097
+ _defineProperty(this, "Z_INDEX", EXTENSION_Z_INDEX$1);
1098
+ _defineProperty(this, "_radius", 1);
1099
+ }
1100
+ draw(ctx, _parentScale, spreadsheetSkeleton, diffRanges) {
1101
+ const { worksheet } = spreadsheetSkeleton;
1102
+ if (!worksheet) return false;
1103
+ const mergeCellRendered = /* @__PURE__ */ new Set();
1104
+ ctx.save();
1105
+ _univerjs_core.Range.foreach(spreadsheetSkeleton.rowColumnSegment, (row, col) => {
1106
+ if (!worksheet.getRowVisible(row) || !worksheet.getColVisible(col)) return;
1107
+ const primaryWithCoord = spreadsheetSkeleton.getCellWithCoordByIndex(row, col, false);
1108
+ const { isMerged, isMergedMainCell, mergeInfo } = primaryWithCoord;
1109
+ let cellData = worksheet.getCell(row, col);
1110
+ if (isMerged) cellData = worksheet.getCell(mergeInfo.startRow, mergeInfo.startColumn);
1111
+ if (!(cellData === null || cellData === void 0 ? void 0 : cellData.dataBar)) return;
1112
+ if (!this.isRenderDiffRangesByCell(mergeInfo, diffRanges)) return;
1113
+ if (isMerged || isMergedMainCell) {
1114
+ const rangeStr = stringifyRange$1(mergeInfo);
1115
+ if (mergeCellRendered.has(rangeStr)) return;
1116
+ mergeCellRendered.add(rangeStr);
1117
+ }
1118
+ const { color, value, startPoint, isGradient } = cellData.dataBar;
1119
+ const { startX, endX, startY, endY } = isMerged || isMergedMainCell ? mergeInfo : primaryWithCoord;
1120
+ const borderWidth = endX - startX;
1121
+ const borderHeight = endY + _univerjs_engine_render.FIX_ONE_PIXEL_BLUR_OFFSET - startY;
1122
+ const width = borderWidth - this._paddingRightAndLeft * 2;
1123
+ const height = borderHeight - this._paddingTopAndBottom * 2;
1124
+ if (value > 0) {
1125
+ const dataBarWidth = Math.max(width * (1 - startPoint / 100) * value / 100, 1);
1126
+ const x0 = startX + this._paddingRightAndLeft + startPoint / 100 * width;
1127
+ const y0 = startY + this._paddingTopAndBottom;
1128
+ if (isGradient) {
1129
+ const gradient = ctx.createLinearGradient(x0, y0, x0 + dataBarWidth, y0);
1130
+ gradient.addColorStop(0, color);
1131
+ gradient.addColorStop(1, "rgb(255 255 255)");
1132
+ ctx.fillStyle = gradient;
1133
+ ctx.strokeStyle = color;
1134
+ ctx.lineWidth = 1;
1135
+ } else ctx.fillStyle = color;
1136
+ this._drawRectWithRoundedCorner(ctx, x0, y0, dataBarWidth, height, false, true, true, false);
1137
+ if (isGradient) ctx.stroke();
1138
+ } else {
1139
+ const dataBarWidth = Math.max(width * startPoint / 100 * Math.abs(value) / 100, 1);
1140
+ const x0 = startX + this._paddingRightAndLeft + startPoint / 100 * width - dataBarWidth;
1141
+ const y0 = startY + this._paddingTopAndBottom;
1142
+ if (isGradient) {
1143
+ const gradient = ctx.createLinearGradient(x0, y0, x0 + dataBarWidth, y0);
1144
+ gradient.addColorStop(0, "rgb(255 255 255)");
1145
+ gradient.addColorStop(1, color);
1146
+ ctx.fillStyle = gradient;
1147
+ ctx.strokeStyle = color;
1148
+ ctx.lineWidth = 1;
1149
+ } else ctx.fillStyle = color;
1150
+ this._drawRectWithRoundedCorner(ctx, x0, y0, dataBarWidth, height, true, false, false, true);
1151
+ if (isGradient) ctx.stroke();
1152
+ }
1153
+ });
1154
+ ctx.restore();
1155
+ }
1156
+ _drawRectWithRoundedCorner(ctx, x, y, width, height, topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius) {
1157
+ const radius = this._radius;
1158
+ if (!height || !width) return;
1159
+ ctx.beginPath();
1160
+ ctx.moveTo(x + radius, y);
1161
+ ctx.lineTo(x + width - radius, y);
1162
+ if (topRightRadius) ctx.arcTo(x + width, y, x + width, y + radius, radius);
1163
+ else ctx.lineTo(x + width, y);
1164
+ ctx.lineTo(x + width, y + height - radius);
1165
+ if (bottomRightRadius) ctx.arcTo(x + width, y + height, x + width - radius, y + height, radius);
1166
+ else ctx.lineTo(x + width, y + height);
1167
+ ctx.lineTo(x + radius, y + height);
1168
+ if (bottomLeftRadius) ctx.arcTo(x, y + height, x, y + height - radius, radius);
1169
+ else ctx.lineTo(x, y + height);
1170
+ ctx.lineTo(x, y + radius);
1171
+ if (topLeftRadius) ctx.arcTo(x, y, x + radius, y, radius);
1172
+ else ctx.lineTo(x, y);
1173
+ ctx.closePath();
1174
+ ctx.fill();
1175
+ }
1176
+ };
1177
+ _univerjs_engine_render.SpreadsheetExtensionRegistry.add(DataBar);
1178
+
1179
+ //#endregion
1180
+ //#region src/models/calculate-unit-v2/data-bar-calculate-unit.ts
1181
+ const getSafeValue = (v) => Math.max(Math.min(100, v), 0);
1182
+ const getValue$1 = (row, col, getCell) => {
1183
+ const cell = getCell(row, col);
1184
+ if (cell && cell.t === _univerjs_core.CellValueType.NUMBER) {
1185
+ const value = Number(cell.v);
1186
+ return Number.isNaN(value) ? null : value;
1187
+ }
1188
+ return null;
1189
+ };
1190
+ var DataBarCalculateUnit = class extends BaseCalculateUnit {
1191
+ preComputing(row, col, context) {
1192
+ const rule = context.rule;
1193
+ const ruleConfig = rule.rule;
1194
+ const worksheet = context.worksheet;
1195
+ const matrix = new _univerjs_core.ObjectMatrix();
1196
+ if (![rule.rule.config.max, rule.rule.config.min].every((e) => e.type === CFValueType.num)) filterRange(rule.ranges, worksheet.getMaxRows() - 1, worksheet.getMaxColumns() - 1).forEach((range) => {
1197
+ _univerjs_core.Range.foreach(range, (row, col) => {
1198
+ const cell = context.getCellValue(row, col);
1199
+ const v = cell && cell.v;
1200
+ if (!isNullable(v) && (cell === null || cell === void 0 ? void 0 : cell.t) === _univerjs_core.CellValueType.NUMBER) {
1201
+ const _value = Number(v);
1202
+ !Number.isNaN(_value) && matrix.setValue(row, col, _value);
1203
+ }
1204
+ });
1205
+ });
1206
+ const _min = getValueByType(ruleConfig.config.min, matrix, {
1207
+ ...context,
1208
+ cfId: rule.cfId
1209
+ });
1210
+ const _max = getValueByType(ruleConfig.config.max, matrix, {
1211
+ ...context,
1212
+ cfId: rule.cfId
1213
+ });
1214
+ let min = 0;
1215
+ let max = 0;
1216
+ if (_min.status === _univerjs_engine_formula.FormulaResultStatus.SUCCESS) {
1217
+ const v = Number(_min.result);
1218
+ min = Number.isNaN(v) ? 0 : v;
1219
+ } else {
1220
+ this._preComputingStatus$.next(CalculateEmitStatus.preComputing);
1221
+ return;
1222
+ }
1223
+ if (_max.status === _univerjs_engine_formula.FormulaResultStatus.SUCCESS) {
1224
+ const maxResult = Number(_max.result);
1225
+ const v = Number.isNaN(maxResult) ? 0 : maxResult;
1226
+ max = Math.max(v, min);
1227
+ min = Math.min(v, min);
1228
+ let startPoint = 50;
1229
+ if (min < 0 && max <= 0) startPoint = 100;
1230
+ else if (min < 0 && max > 0) {
1231
+ const length = Math.abs(max) + Math.abs(min);
1232
+ startPoint = Math.abs(min) / length * 100;
1233
+ } else if (min >= 0 && max > 0) startPoint = 0;
1234
+ this.setPreComputingCache({
1235
+ min,
1236
+ max,
1237
+ startPoint
1238
+ });
1239
+ this._preComputingStatus$.next(CalculateEmitStatus.preComputingEnd);
1240
+ return;
1241
+ }
1242
+ this._preComputingStatus$.next(CalculateEmitStatus.preComputing);
1243
+ }
1244
+ getCellResult(row, col, preComputingResult, context) {
1245
+ const { min, max, startPoint } = preComputingResult;
1246
+ const ruleConfig = context.rule.rule;
1247
+ const isShowValue = ruleConfig.isShowValue;
1248
+ const isGradient = ruleConfig.config.isGradient;
1249
+ const value = getValue$1(row, col, context.getCellValue);
1250
+ if (value === null || value < min || min === max || max < min) return;
1251
+ if (value === 0) return {
1252
+ color: defaultPlaceholderColor,
1253
+ startPoint,
1254
+ value: 0,
1255
+ isGradient,
1256
+ isShowValue
1257
+ };
1258
+ if (min < 0 && max <= 0) {
1259
+ const length = max - min;
1260
+ const v = getSafeValue((max - value) / length * 100);
1261
+ if (v === 0) return;
1262
+ return {
1263
+ color: ruleConfig.config.nativeColor || "#abd91a",
1264
+ startPoint,
1265
+ value: -v,
1266
+ isGradient,
1267
+ isShowValue
1268
+ };
1269
+ } else if (min < 0 && max > 0) if (value > 0) {
1270
+ const v = getSafeValue(Math.min(value / max, 1) * 100);
1271
+ if (v === 0) return;
1272
+ return {
1273
+ color: ruleConfig.config.positiveColor || "#ffbe38",
1274
+ startPoint,
1275
+ value: v,
1276
+ isGradient,
1277
+ isShowValue
1278
+ };
1279
+ } else {
1280
+ const v = getSafeValue(Math.min(Math.abs(value) / Math.abs(min), 1) * 100);
1281
+ if (v === 0) return;
1282
+ return {
1283
+ color: ruleConfig.config.nativeColor || "#abd91a",
1284
+ startPoint,
1285
+ value: -v,
1286
+ isGradient,
1287
+ isShowValue
1288
+ };
1289
+ }
1290
+ else if (min >= 0 && max > 0) {
1291
+ const length = max - min;
1292
+ const startPoint = 0;
1293
+ const v = getSafeValue((1 - (max - value) / length) * 100);
1294
+ if (v === 0) return;
1295
+ return {
1296
+ color: ruleConfig.config.positiveColor || "#ffbe38",
1297
+ startPoint,
1298
+ value: v,
1299
+ isGradient,
1300
+ isShowValue
1301
+ };
1302
+ }
1303
+ }
1304
+ };
1305
+
1306
+ //#endregion
1307
+ //#region src/models/calculate-unit-v2/highlight-cell-calculate-unit.ts
1308
+ var HighlightCellCalculateUnit = class extends BaseCalculateUnit {
1309
+ preComputing(row, col, context) {
1310
+ const ruleConfig = context.rule.rule;
1311
+ const ranges = filterRange(context.rule.ranges, context.worksheet.getMaxRows() - 1, context.worksheet.getMaxColumns() - 1);
1312
+ const getCache = () => {
1313
+ switch (ruleConfig.subType) {
1314
+ case CFSubRuleType.average: {
1315
+ let sum = 0;
1316
+ let count = 0;
1317
+ ranges.forEach((range) => {
1318
+ _univerjs_core.Range.foreach(range, (row, col) => {
1319
+ const cell = context.getCellValue(row, col);
1320
+ const v = getCellValue(cell);
1321
+ if (cell && cell.t === _univerjs_core.CellValueType.NUMBER && !isNullable(v)) {
1322
+ sum += Number(v) || 0;
1323
+ count++;
1324
+ }
1325
+ });
1326
+ });
1327
+ return {
1328
+ value: sum / count,
1329
+ type: ruleConfig.subType
1330
+ };
1331
+ }
1332
+ case CFSubRuleType.uniqueValues:
1333
+ case CFSubRuleType.duplicateValues: {
1334
+ const cacheMap = /* @__PURE__ */ new Map();
1335
+ ranges.forEach((range) => {
1336
+ _univerjs_core.Range.foreach(range, (row, col) => {
1337
+ const v = getCellValue(context.getCellValue(row, col));
1338
+ if (!isNullable(v)) {
1339
+ const cache = cacheMap.get(v);
1340
+ if (cache) cacheMap.set(v, cache + 1);
1341
+ else cacheMap.set(v, 1);
1342
+ }
1343
+ });
1344
+ });
1345
+ return {
1346
+ value: cacheMap,
1347
+ type: ruleConfig.subType
1348
+ };
1349
+ }
1350
+ case CFSubRuleType.rank: {
1351
+ let allValue = [];
1352
+ ranges.forEach((range) => {
1353
+ _univerjs_core.Range.foreach(range, (row, col) => {
1354
+ const cell = context.getCellValue(row, col);
1355
+ const v = getCellValue(cell);
1356
+ if (cell && cell.t === _univerjs_core.CellValueType.NUMBER && !isNullable(v)) allValue.push(Number(v) || 0);
1357
+ });
1358
+ });
1359
+ allValue.sort((a, b) => b - a);
1360
+ const configRule = context.rule.rule;
1361
+ if (configRule.isPercent) {
1362
+ if (configRule.isBottom) allValue = allValue.toReversed();
1363
+ const threshold = _univerjs_core.Tools.clamp(configRule.value, 0, 100) / 100;
1364
+ const targetIndex = Math.floor(threshold * allValue.length);
1365
+ const safeIndex = _univerjs_core.Tools.clamp(targetIndex - 1, 0, allValue.length - 1);
1366
+ return {
1367
+ value: allValue[safeIndex],
1368
+ type: ruleConfig.subType
1369
+ };
1370
+ }
1371
+ const targetIndex = Math.floor(_univerjs_core.Tools.clamp(configRule.isBottom ? configRule.value - 1 : configRule.value, 0, allValue.length));
1372
+ if (configRule.isBottom) return {
1373
+ value: allValue[allValue.length - targetIndex - 1],
1374
+ type: ruleConfig.subType
1375
+ };
1376
+ else return {
1377
+ value: allValue[Math.max(targetIndex - 1, 0)],
1378
+ type: ruleConfig.subType
1379
+ };
1380
+ }
1381
+ case CFSubRuleType.formula: {
1382
+ const _ruleConfig = ruleConfig;
1383
+ const conditionalFormattingFormulaService = context.accessor.get(ConditionalFormattingFormulaService);
1384
+ conditionalFormattingFormulaService.registerFormulaWithRange(context.unitId, context.subUnitId, context.rule.cfId, _ruleConfig.value, context.rule.ranges);
1385
+ const result = conditionalFormattingFormulaService.getFormulaMatrix(context.unitId, context.subUnitId, context.rule.cfId, _ruleConfig.value);
1386
+ if (result && result.status === _univerjs_engine_formula.FormulaResultStatus.SUCCESS) {
1387
+ this._preComputingStatus$.next(CalculateEmitStatus.preComputingEnd);
1388
+ return {
1389
+ value: result.result,
1390
+ type: ruleConfig.subType
1391
+ };
1392
+ } else this._preComputingStatus$.next(CalculateEmitStatus.preComputing);
1393
+ return null;
1394
+ }
1395
+ case CFSubRuleType.timePeriod: switch (ruleConfig.operator) {
1396
+ case CFTimePeriodOperator.last7Days: return {
1397
+ value: {
1398
+ start: (0, _univerjs_core.dateKit)().subtract(7, "day").valueOf(),
1399
+ end: (0, _univerjs_core.dateKit)().valueOf()
1400
+ },
1401
+ type: ruleConfig.subType
1402
+ };
1403
+ case CFTimePeriodOperator.lastMonth: return {
1404
+ value: {
1405
+ start: (0, _univerjs_core.dateKit)().startOf("month").subtract(1, "month").valueOf(),
1406
+ end: (0, _univerjs_core.dateKit)().endOf("month").subtract(1, "month").valueOf()
1407
+ },
1408
+ type: ruleConfig.subType
1409
+ };
1410
+ case CFTimePeriodOperator.lastWeek: return {
1411
+ value: {
1412
+ start: (0, _univerjs_core.dateKit)().startOf("week").subtract(1, "week").valueOf(),
1413
+ end: (0, _univerjs_core.dateKit)().endOf("week").subtract(1, "week").valueOf()
1414
+ },
1415
+ type: ruleConfig.subType
1416
+ };
1417
+ case CFTimePeriodOperator.nextMonth: return {
1418
+ value: {
1419
+ start: (0, _univerjs_core.dateKit)().startOf("month").add(1, "month").valueOf(),
1420
+ end: (0, _univerjs_core.dateKit)().endOf("month").add(1, "month").valueOf()
1421
+ },
1422
+ type: ruleConfig.subType
1423
+ };
1424
+ case CFTimePeriodOperator.nextWeek: return {
1425
+ value: {
1426
+ start: (0, _univerjs_core.dateKit)().startOf("week").add(1, "week").valueOf(),
1427
+ end: (0, _univerjs_core.dateKit)().endOf("week").add(1, "week").valueOf()
1428
+ },
1429
+ type: ruleConfig.subType
1430
+ };
1431
+ case CFTimePeriodOperator.thisMonth: return {
1432
+ value: {
1433
+ start: (0, _univerjs_core.dateKit)().startOf("month").valueOf(),
1434
+ end: (0, _univerjs_core.dateKit)().endOf("month").valueOf()
1435
+ },
1436
+ type: ruleConfig.subType
1437
+ };
1438
+ case CFTimePeriodOperator.thisWeek: return {
1439
+ value: {
1440
+ start: (0, _univerjs_core.dateKit)().startOf("week").valueOf(),
1441
+ end: (0, _univerjs_core.dateKit)().endOf("week").valueOf()
1442
+ },
1443
+ type: ruleConfig.subType
1444
+ };
1445
+ case CFTimePeriodOperator.today: return {
1446
+ value: {
1447
+ start: (0, _univerjs_core.dateKit)().startOf("day").valueOf(),
1448
+ end: (0, _univerjs_core.dateKit)().endOf("day").valueOf()
1449
+ },
1450
+ type: ruleConfig.subType
1451
+ };
1452
+ case CFTimePeriodOperator.tomorrow: return {
1453
+ value: {
1454
+ start: (0, _univerjs_core.dateKit)().startOf("day").add(1, "day").valueOf(),
1455
+ end: (0, _univerjs_core.dateKit)().endOf("day").add(1, "day").valueOf()
1456
+ },
1457
+ type: ruleConfig.subType
1458
+ };
1459
+ case CFTimePeriodOperator.yesterday: return {
1460
+ value: {
1461
+ start: (0, _univerjs_core.dateKit)().startOf("day").subtract(1, "day").valueOf(),
1462
+ end: (0, _univerjs_core.dateKit)().endOf("day").subtract(1, "day").valueOf()
1463
+ },
1464
+ type: ruleConfig.subType
1465
+ };
1466
+ }
1467
+ }
1468
+ };
1469
+ const result = getCache();
1470
+ this.setPreComputingCache(result);
1471
+ }
1472
+ getCellResult(row, col, preComputingResult, context) {
1473
+ const cellValue = context.getCellValue(row, col);
1474
+ const ruleConfig = context.rule.rule;
1475
+ const run = () => {
1476
+ switch (ruleConfig.subType) {
1477
+ case CFSubRuleType.number: {
1478
+ const v = cellValue && Number(cellValue.v);
1479
+ const isNumber = (cellValue === null || cellValue === void 0 ? void 0 : cellValue.t) === _univerjs_core.CellValueType.NUMBER;
1480
+ const subRuleConfig = ruleConfig;
1481
+ if (!isNumber) {
1482
+ if ([CFNumberOperator.notEqual, CFNumberOperator.notBetween].includes(subRuleConfig.operator)) return true;
1483
+ return false;
1484
+ }
1485
+ if (isNullable(v) || Number.isNaN(v)) return;
1486
+ return compareWithNumber({
1487
+ operator: subRuleConfig.operator,
1488
+ value: subRuleConfig.value || 0
1489
+ }, v || 0);
1490
+ }
1491
+ case CFSubRuleType.text: {
1492
+ const subRuleConfig = ruleConfig;
1493
+ const value = getCellValue(cellValue);
1494
+ const v = isNullable(value) ? "" : String(value);
1495
+ const condition = subRuleConfig.value || "";
1496
+ switch (subRuleConfig.operator) {
1497
+ case CFTextOperator.beginsWith: return v.startsWith(condition);
1498
+ case CFTextOperator.containsBlanks: return /^\s*$/.test(v);
1499
+ case CFTextOperator.notContainsBlanks: return !/^\s*$/.test(v);
1500
+ case CFTextOperator.containsErrors: return _univerjs_engine_formula.ERROR_TYPE_SET.has(v);
1501
+ case CFTextOperator.notContainsErrors: return !_univerjs_engine_formula.ERROR_TYPE_SET.has(v);
1502
+ case CFTextOperator.containsText: return v.indexOf(condition) > -1;
1503
+ case CFTextOperator.notContainsText: return v.indexOf(condition) === -1;
1504
+ case CFTextOperator.endsWith: return v.endsWith(condition);
1505
+ case CFTextOperator.equal: return v === condition;
1506
+ case CFTextOperator.notEqual: return v !== condition;
1507
+ default: return false;
1508
+ }
1509
+ }
1510
+ case CFSubRuleType.timePeriod: {
1511
+ const value = getCellValue(cellValue);
1512
+ if (isNullable(value) || Number.isNaN(Number(value)) || (cellValue === null || cellValue === void 0 ? void 0 : cellValue.t) !== _univerjs_core.CellValueType.NUMBER || !preComputingResult) return;
1513
+ const v = serialTimeToTimestamp(Number(value));
1514
+ const { start, end } = preComputingResult.value;
1515
+ return v >= start && v <= end;
1516
+ }
1517
+ case CFSubRuleType.average: {
1518
+ const value = cellValue && cellValue.v;
1519
+ const v = Number(value);
1520
+ const isNumber = (cellValue === null || cellValue === void 0 ? void 0 : cellValue.t) === _univerjs_core.CellValueType.NUMBER;
1521
+ const subRuleConfig = ruleConfig;
1522
+ if (!isNumber) {
1523
+ if (CFNumberOperator.notEqual === subRuleConfig.operator) return true;
1524
+ return false;
1525
+ }
1526
+ if (isNullable(value) || Number.isNaN(v) || !preComputingResult) return false;
1527
+ const average = preComputingResult.value;
1528
+ switch (subRuleConfig.operator) {
1529
+ case CFNumberOperator.greaterThan: return v > average;
1530
+ case CFNumberOperator.greaterThanOrEqual: return v >= average;
1531
+ case CFNumberOperator.lessThan: return v < average;
1532
+ case CFNumberOperator.lessThanOrEqual: return v <= average;
1533
+ case CFNumberOperator.equal: return isFloatsEqual(v, average);
1534
+ case CFNumberOperator.notEqual: return !isFloatsEqual(v, average);
1535
+ default: return false;
1536
+ }
1537
+ }
1538
+ case CFSubRuleType.rank: {
1539
+ const value = getCellValue(cellValue);
1540
+ const v = Number(value);
1541
+ if (isNullable(value) || Number.isNaN(v) || (cellValue === null || cellValue === void 0 ? void 0 : cellValue.t) !== _univerjs_core.CellValueType.NUMBER || !preComputingResult) return false;
1542
+ const targetValue = preComputingResult.value;
1543
+ if (ruleConfig.isBottom) return v <= targetValue;
1544
+ else return v >= targetValue;
1545
+ }
1546
+ case CFSubRuleType.uniqueValues: {
1547
+ const value = getCellValue(cellValue);
1548
+ if (isNullable(value) || !preComputingResult) return false;
1549
+ return preComputingResult.value.get(value) === 1;
1550
+ }
1551
+ case CFSubRuleType.duplicateValues: {
1552
+ const value = getCellValue(cellValue);
1553
+ if (isNullable(value) || !preComputingResult) return false;
1554
+ const uniqueCacheValue = preComputingResult.value.get(value);
1555
+ return uniqueCacheValue && uniqueCacheValue !== 1;
1556
+ }
1557
+ case CFSubRuleType.formula: {
1558
+ const cache = preComputingResult === null || preComputingResult === void 0 ? void 0 : preComputingResult.value;
1559
+ if (cache) {
1560
+ const firstRange = context.rule.ranges[0];
1561
+ const relativeRow = row - firstRange.startRow;
1562
+ const relativeCol = col - firstRange.startColumn;
1563
+ return cache.getValue(relativeRow, relativeCol) === true;
1564
+ }
1565
+ return false;
1566
+ }
1567
+ }
1568
+ };
1569
+ return run() ? ruleConfig.style : {};
1570
+ }
1571
+ };
1572
+
1573
+ //#endregion
1574
+ //#region src/models/calculate-unit-v2/icon-set-calculate-unit.ts
1575
+ const getValue = (row, col, getCell) => {
1576
+ const cell = getCell(row, col);
1577
+ if (cell && cell.t === _univerjs_core.CellValueType.NUMBER) {
1578
+ const value = Number(cell.v);
1579
+ return Number.isNaN(value) ? null : value;
1580
+ }
1581
+ return null;
1582
+ };
1583
+ var IconSetCalculateUnit = class extends BaseCalculateUnit {
1584
+ preComputing(_row, _col, context) {
1585
+ const ruleConfig = context.rule.rule;
1586
+ const worksheet = context.worksheet;
1587
+ const matrix = new _univerjs_core.ObjectMatrix();
1588
+ if (!ruleConfig.config.every((e) => e.value.type === CFValueType.num)) filterRange(context.rule.ranges, worksheet.getMaxRows() - 1, worksheet.getMaxColumns() - 1).forEach((range) => {
1589
+ _univerjs_core.Range.foreach(range, (row, col) => {
1590
+ const cell = context.getCellValue(row, col);
1591
+ const v = cell && cell.v;
1592
+ if (!isNullable(v) && (cell === null || cell === void 0 ? void 0 : cell.t) === _univerjs_core.CellValueType.NUMBER) {
1593
+ const _value = Number(v);
1594
+ !Number.isNaN(_value) && matrix.setValue(row, col, _value);
1595
+ }
1596
+ });
1597
+ });
1598
+ const splitValueResult = ruleConfig.config.map((v) => getValueByType(v.value, matrix, {
1599
+ ...context,
1600
+ cfId: context.rule.cfId
1601
+ }));
1602
+ if (!splitValueResult.some((item) => item.status !== _univerjs_engine_formula.FormulaResultStatus.SUCCESS)) {
1603
+ const splitValue = splitValueResult.map((item, index) => ({
1604
+ operator: ruleConfig.config[index].operator,
1605
+ value: Number(item.result) || 0
1606
+ })).reduce((result, cur, index, list) => {
1607
+ const item = ruleConfig.config[index];
1608
+ if (!index || index === list.length - 1) result.push({
1609
+ ...cur,
1610
+ iconId: item.iconId,
1611
+ iconType: item.iconType
1612
+ });
1613
+ else {
1614
+ const pre = list[index - 1];
1615
+ if (!compareWithNumber(pre, cur.value)) result.push({
1616
+ ...cur,
1617
+ iconId: item.iconId,
1618
+ iconType: item.iconType
1619
+ });
1620
+ }
1621
+ return result;
1622
+ }, []);
1623
+ this.setPreComputingCache(splitValue);
1624
+ this._preComputingStatus$.next(CalculateEmitStatus.preComputingEnd);
1625
+ return;
1626
+ }
1627
+ this._preComputingStatus$.next(CalculateEmitStatus.preComputing);
1628
+ }
1629
+ getCellResult(row, col, preComputingResult, context) {
1630
+ if (!preComputingResult) return null;
1631
+ const value = getValue(row, col, context.getCellValue);
1632
+ if (value === null) return;
1633
+ const ruleConfig = context.rule.rule;
1634
+ const isShowValue = ruleConfig.isShowValue === void 0 ? true : !!ruleConfig.isShowValue;
1635
+ for (let index = 0; index < preComputingResult.length; index++) {
1636
+ const item = preComputingResult[index];
1637
+ const start = { ...item };
1638
+ const end = { ...item };
1639
+ const { iconId, iconType } = item;
1640
+ if (index === 0) {
1641
+ if (compareWithNumber(item, value)) return {
1642
+ iconId,
1643
+ iconType,
1644
+ isShowValue
1645
+ };
1646
+ } else if (index === preComputingResult.length - 1) return {
1647
+ iconId,
1648
+ iconType,
1649
+ isShowValue
1650
+ };
1651
+ else {
1652
+ const pre = preComputingResult[index - 1];
1653
+ end.operator = getOppositeOperator(pre.operator);
1654
+ end.value = pre.value;
1655
+ if (compareWithNumber(start, value) && compareWithNumber(end, value)) return {
1656
+ iconId,
1657
+ iconType,
1658
+ isShowValue
1659
+ };
1660
+ }
1661
+ }
1662
+ }
1663
+ };
1664
+
1665
+ //#endregion
1666
+ //#region src/models/conditional-formatting-view-model.ts
1667
+ const CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH = 1e3 * 3 * 3;
1668
+ let ConditionalFormattingViewModel = class ConditionalFormattingViewModel extends _univerjs_core.Disposable {
1669
+ constructor(_injector, _conditionalFormattingRuleModel, _conditionalFormattingFormulaService, _univerInstanceService) {
1670
+ super();
1671
+ this._injector = _injector;
1672
+ this._conditionalFormattingRuleModel = _conditionalFormattingRuleModel;
1673
+ this._conditionalFormattingFormulaService = _conditionalFormattingFormulaService;
1674
+ this._univerInstanceService = _univerInstanceService;
1675
+ _defineProperty(this, "_calculateUnitManagers", /* @__PURE__ */ new Map());
1676
+ _defineProperty(this, "_rTreeManager", new _univerjs_core.RTree());
1677
+ _defineProperty(this, "_cellCache", new _univerjs_core.LRUMap(CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH));
1678
+ _defineProperty(this, "_markDirty$", new rxjs.Subject());
1679
+ _defineProperty(this, "markDirty$", this._markDirty$.asObservable());
1680
+ _defineProperty(this, "_markRuleDirtyAtOnce", (unitId, subUnitId, cfId, isNeedResetPreComputingCache = true) => {
1681
+ this._cellCache.clear();
1682
+ if (isNeedResetPreComputingCache) {
1683
+ const calculateUnit = this._ensureCalculateUnitManager(unitId, subUnitId).get(cfId);
1684
+ if (calculateUnit) calculateUnit.resetPreComputingCache();
1685
+ }
1686
+ this._markDirty$.next({
1687
+ unitId,
1688
+ subUnitId,
1689
+ cfId
1690
+ });
1691
+ });
1692
+ _defineProperty(this, "markRuleDirty", (() => {
1693
+ const rxItem = new rxjs.Subject();
1694
+ this.disposeWithMe(rxItem.pipe((0, rxjs_operators.bufferTime)(100), (0, rxjs_operators.filter)((e) => !!e.length), (0, rxjs_operators.map)((list) => {
1695
+ const set = /* @__PURE__ */ new Set();
1696
+ const result = [];
1697
+ list.forEach((item) => {
1698
+ const kye = `${item.unitId}_${item.subUnitId}_${item.cfId}`;
1699
+ if (set.has(kye)) {
1700
+ if (item.isNeedResetPreComputingCache) {
1701
+ const i = result.find((e) => e.cfId === item.cfId);
1702
+ i.isNeedResetPreComputingCache = true;
1703
+ }
1704
+ return;
1705
+ }
1706
+ set.add(kye);
1707
+ result.push({ ...item });
1708
+ });
1709
+ return result;
1710
+ })).subscribe((list) => {
1711
+ list.forEach((item) => {
1712
+ this._markRuleDirtyAtOnce(item.unitId, item.subUnitId, item.cfId, item.isNeedResetPreComputingCache);
1713
+ });
1714
+ }));
1715
+ return (unitId, subUnitId, cfId, isNeedResetPreComputingCache = true) => {
1716
+ rxItem.next({
1717
+ unitId,
1718
+ subUnitId,
1719
+ cfId,
1720
+ isNeedResetPreComputingCache
1721
+ });
1722
+ };
1723
+ })());
1724
+ this._initRuleListener();
1725
+ this._handleCustomFormulasSeparately();
1726
+ this._initCFFormulaListener();
1727
+ }
1728
+ _initCFFormulaListener() {
1729
+ this.disposeWithMe(this._conditionalFormattingFormulaService.result$.subscribe(({ unitId, subUnitId, cfId, isAllFinished }) => {
1730
+ if (isAllFinished) this._markRuleDirtyAtOnce(unitId, subUnitId, cfId, isAllFinished);
1731
+ }));
1732
+ }
1733
+ getCellCfs(unitId, subUnitId, row, col) {
1734
+ const key = this._createCacheKey(unitId, subUnitId, row, col);
1735
+ if (this._cellCache.has(key)) return this._cellCache.get(key);
1736
+ const result = this._getCellCfs(unitId, subUnitId, row, col);
1737
+ if (result.length) this._cellCache.set(key, result);
1738
+ return result;
1739
+ }
1740
+ _getCellCfs(unitId, subUnitId, row, col) {
1741
+ var _this$_conditionalFor;
1742
+ const subunitRules = (_this$_conditionalFor = this._conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId)) !== null && _this$_conditionalFor !== void 0 ? _this$_conditionalFor : [];
1743
+ const _calculateUnitManagers = this._ensureCalculateUnitManager(unitId, subUnitId);
1744
+ const list = this._rTreeManager.bulkSearch([{
1745
+ unitId,
1746
+ sheetId: subUnitId,
1747
+ range: {
1748
+ startColumn: col,
1749
+ endColumn: col,
1750
+ startRow: row,
1751
+ endRow: row
1752
+ }
1753
+ }]);
1754
+ const rules = subunitRules.filter((rule) => list.has(rule.cfId));
1755
+ if (!rules.length) return [];
1756
+ return rules.map((rule) => {
1757
+ const calculateUnit = _calculateUnitManagers.get(rule.cfId);
1758
+ if (!calculateUnit) return null;
1759
+ return {
1760
+ cfId: rule.cfId,
1761
+ result: calculateUnit.getCell(row, col)
1762
+ };
1763
+ }).filter((e) => !!e).map((e, index) => ({
1764
+ ...e,
1765
+ priority: index
1766
+ }));
1767
+ }
1768
+ dispose() {
1769
+ this.clearCache();
1770
+ super.dispose();
1771
+ }
1772
+ clearCache() {
1773
+ this._calculateUnitManagers.clear();
1774
+ this._cellCache.clear();
1775
+ this._rTreeManager.clear();
1776
+ }
1777
+ _handleCustomFormulasSeparately() {
1778
+ this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe((e) => {
1779
+ if (e.type === "set") {
1780
+ const { unitId, subUnitId } = e;
1781
+ const oldRule = e.oldRule;
1782
+ if (oldRule.rule.type === CFRuleType.highlightCell && oldRule.rule.subType === CFSubRuleType.formula) this._conditionalFormattingFormulaService.deleteCache(unitId, subUnitId, oldRule.cfId);
1783
+ }
1784
+ }));
1785
+ }
1786
+ _initRuleListener() {
1787
+ this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe((e) => {
1788
+ const { unitId, subUnitId, rule } = e;
1789
+ const { cfId, ranges } = rule;
1790
+ const calculateUnitManager = this._ensureCalculateUnitManager(unitId, subUnitId);
1791
+ this.markRuleDirty(unitId, subUnitId, cfId);
1792
+ switch (e.type) {
1793
+ case "add": {
1794
+ this._rTreeManager.bulkInsert(ranges.map((r) => ({
1795
+ unitId,
1796
+ sheetId: subUnitId,
1797
+ id: cfId,
1798
+ range: r
1799
+ })));
1800
+ const instance = this._createRuleCalculateUnitInstance(unitId, subUnitId, rule);
1801
+ if (!instance) return;
1802
+ calculateUnitManager.set(rule.cfId, instance);
1803
+ break;
1804
+ }
1805
+ case "delete":
1806
+ this._rTreeManager.bulkRemove(ranges.map((r) => ({
1807
+ unitId,
1808
+ sheetId: subUnitId,
1809
+ id: cfId,
1810
+ range: r
1811
+ })));
1812
+ calculateUnitManager.delete(rule.cfId);
1813
+ break;
1814
+ case "set": {
1815
+ const oldRule = e.oldRule;
1816
+ this._rTreeManager.bulkRemove(oldRule.ranges.map((r) => ({
1817
+ unitId,
1818
+ sheetId: subUnitId,
1819
+ id: oldRule.cfId,
1820
+ range: r
1821
+ })));
1822
+ this._rTreeManager.bulkInsert(ranges.map((r) => ({
1823
+ unitId,
1824
+ sheetId: subUnitId,
1825
+ id: cfId,
1826
+ range: r
1827
+ })));
1828
+ if (oldRule.rule.type !== rule.rule.type) {
1829
+ const instance = this._createRuleCalculateUnitInstance(unitId, subUnitId, rule);
1830
+ if (!instance) return;
1831
+ calculateUnitManager.delete(oldRule.cfId);
1832
+ calculateUnitManager.set(rule.cfId, instance);
1833
+ } else {
1834
+ const instance = calculateUnitManager.get(oldRule.cfId);
1835
+ if (!instance) return;
1836
+ instance.updateRule(rule);
1837
+ }
1838
+ }
1839
+ }
1840
+ }));
1841
+ }
1842
+ _ensureCalculateUnitManager(unitId, subUnitId) {
1843
+ let unitMap = this._calculateUnitManagers.get(unitId);
1844
+ if (!unitMap) {
1845
+ unitMap = /* @__PURE__ */ new Map();
1846
+ this._calculateUnitManagers.set(unitId, unitMap);
1847
+ }
1848
+ let subUnitMap = unitMap.get(subUnitId);
1849
+ if (!subUnitMap) {
1850
+ subUnitMap = /* @__PURE__ */ new Map();
1851
+ unitMap.set(subUnitId, subUnitMap);
1852
+ }
1853
+ return subUnitMap;
1854
+ }
1855
+ _createRuleCalculateUnitInstance(unitId, subUnitId, rule) {
1856
+ const workbook = this._univerInstanceService.getUnit(unitId);
1857
+ const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(subUnitId);
1858
+ if (!workbook || !worksheet) return;
1859
+ const context = {
1860
+ workbook,
1861
+ worksheet,
1862
+ unitId,
1863
+ subUnitId,
1864
+ accessor: this._injector,
1865
+ rule,
1866
+ limit: CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,
1867
+ getCellValue: (row, col) => worksheet.getCellRaw(row, col) || {}
1868
+ };
1869
+ switch (rule.rule.type) {
1870
+ case CFRuleType.colorScale: return new ColorScaleCalculateUnit(context);
1871
+ case CFRuleType.dataBar: return new DataBarCalculateUnit(context);
1872
+ case CFRuleType.highlightCell: return new HighlightCellCalculateUnit(context);
1873
+ case CFRuleType.iconSet: return new IconSetCalculateUnit(context);
1874
+ }
1875
+ }
1876
+ _createCacheKey(unitId, subUnitId, row, col) {
1877
+ return `${unitId}_${subUnitId}_${row}_${col}`;
1878
+ }
1879
+ setCacheLength(length = CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH) {
1880
+ if (this._cellCache.limit === length) return;
1881
+ this._cellCache.limit = length;
1882
+ this._calculateUnitManagers.forEach((subunitMap) => {
1883
+ subunitMap.forEach((unitMap) => {
1884
+ unitMap.forEach((unit) => {
1885
+ unit.setCacheLength(length);
1886
+ });
1887
+ });
1888
+ });
1889
+ }
1890
+ };
1891
+ ConditionalFormattingViewModel = __decorate([
1892
+ __decorateParam(0, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
1893
+ __decorateParam(1, (0, _univerjs_core.Inject)(ConditionalFormattingRuleModel)),
1894
+ __decorateParam(2, (0, _univerjs_core.Inject)(ConditionalFormattingFormulaService)),
1895
+ __decorateParam(3, _univerjs_core.IUniverInstanceService)
1896
+ ], ConditionalFormattingViewModel);
1897
+
1898
+ //#endregion
1899
+ //#region src/models/calculate-unit-v2/utils.ts
1900
+ function isFloatsEqual(a, b) {
1901
+ return Math.abs(a - b) < Number.EPSILON;
1902
+ }
1903
+ const isNullable = (v) => v === null || v === void 0 || typeof v === "string" && v.trim() === "";
1904
+ const getCellValue = (cell) => {
1905
+ var _cell$p;
1906
+ if (!cell) return null;
1907
+ if (cell.t === _univerjs_core.CellValueType.BOOLEAN) return cell.v === _univerjs_core.BooleanNumber.TRUE ? _univerjs_engine_formula.BooleanValue.TRUE : _univerjs_engine_formula.BooleanValue.FALSE;
1908
+ const v = cell.v;
1909
+ const dataStream = (_cell$p = cell.p) === null || _cell$p === void 0 || (_cell$p = _cell$p.body) === null || _cell$p === void 0 ? void 0 : _cell$p.dataStream.replace(/\r\n$/, "");
1910
+ return !isNullable(v) ? v : !isNullable(dataStream) ? dataStream : null;
1911
+ };
1912
+ const DAY_SIZE = 86400;
1913
+ function toYMD_1900(ord, leap1900 = true) {
1914
+ if (leap1900 && ord >= 0) {
1915
+ if (ord === 0) return [
1916
+ 1900,
1917
+ 1,
1918
+ 0
1919
+ ];
1920
+ if (ord === 60) return [
1921
+ 1900,
1922
+ 2,
1923
+ 29
1924
+ ];
1925
+ if (ord < 60) return [
1926
+ 1900,
1927
+ ord < 32 ? 1 : 2,
1928
+ (ord - 1) % 31 + 1
1929
+ ];
1930
+ }
1931
+ let l = ord + 68569 + 2415019;
1932
+ const n = Math.floor(4 * l / 146097);
1933
+ l = l - Math.floor((146097 * n + 3) / 4);
1934
+ const i = Math.floor(4e3 * (l + 1) / 1461001);
1935
+ l = l - Math.floor(1461 * i / 4) + 31;
1936
+ const j = Math.floor(80 * l / 2447);
1937
+ const nDay = l - Math.floor(2447 * j / 80);
1938
+ l = Math.floor(j / 11);
1939
+ const nMonth = j + 2 - 12 * l;
1940
+ return [
1941
+ 100 * (n - 49) + i + l | 0,
1942
+ nMonth | 0,
1943
+ nDay | 0
1944
+ ];
1945
+ }
1946
+ const serialTimeToTimestamp = (value) => {
1947
+ let date = value | 0;
1948
+ const t = DAY_SIZE * (value - date);
1949
+ let time = Math.floor(t);
1950
+ if (t - time > .9999) {
1951
+ time += 1;
1952
+ if (time === DAY_SIZE) {
1953
+ time = 0;
1954
+ date += 1;
1955
+ }
1956
+ }
1957
+ const x = time < 0 ? DAY_SIZE + time : time;
1958
+ const [y, m, d] = toYMD_1900(value, true);
1959
+ return (0, _univerjs_core.dateKit)(`${y}/${m}/${d} ${Math.floor(x / 60 / 60) % 60}:${Math.floor(x / 60) % 60}:${Math.floor(x) % 60}`).valueOf();
1960
+ };
1961
+ const getValueByType = (value, matrix, context) => {
1962
+ switch (value.type) {
1963
+ case CFValueType.max: {
1964
+ let max = 0;
1965
+ matrix.forValue((row, col, value) => {
1966
+ if (value > max) max = value;
1967
+ });
1968
+ return {
1969
+ status: _univerjs_engine_formula.FormulaResultStatus.SUCCESS,
1970
+ result: max
1971
+ };
1972
+ }
1973
+ case CFValueType.min: {
1974
+ let min;
1975
+ matrix.forValue((row, col, value) => {
1976
+ if (min === void 0) min = value;
1977
+ if (value < min) min = value;
1978
+ });
1979
+ return {
1980
+ status: _univerjs_engine_formula.FormulaResultStatus.SUCCESS,
1981
+ result: min
1982
+ };
1983
+ }
1984
+ case CFValueType.percent: {
1985
+ let max;
1986
+ let min;
1987
+ matrix.forValue((row, col, value) => {
1988
+ if (max === void 0 || min === void 0) {
1989
+ max = value;
1990
+ min = value;
1991
+ }
1992
+ if (value > max) max = value;
1993
+ if (value < min) min = value;
1994
+ });
1995
+ const length = (max || 0) - (min || 0);
1996
+ const v = Math.max(Math.min(Number(value.value) || 0, 100), 0);
1997
+ return {
1998
+ status: _univerjs_engine_formula.FormulaResultStatus.SUCCESS,
1999
+ result: length * (v / 100) + (min || 0)
2000
+ };
2001
+ }
2002
+ case CFValueType.percentile: {
2003
+ const list = matrix.toNativeArray().sort((a, b) => a - b);
2004
+ const v = Math.max(Math.min(Number(value.value) || 0, 100), 0);
2005
+ const index = (list.length - 1) * v / 100;
2006
+ const intIndex = Math.floor(index);
2007
+ const decimalIndex = index - intIndex;
2008
+ const result = list[intIndex] + (list[Math.min(intIndex + 1, list.length - 1)] - list[intIndex]) * decimalIndex;
2009
+ return {
2010
+ status: _univerjs_engine_formula.FormulaResultStatus.SUCCESS,
2011
+ result
2012
+ };
2013
+ }
2014
+ case CFValueType.formula: {
2015
+ const { accessor, unitId, subUnitId, cfId } = context;
2016
+ const formulaText = String(value.value);
2017
+ const conditionalFormattingFormulaService = accessor.get(ConditionalFormattingFormulaService);
2018
+ conditionalFormattingFormulaService.registerFormulaWithRange(unitId, subUnitId, cfId, formulaText);
2019
+ return conditionalFormattingFormulaService.getFormulaResultWithCoords(unitId, subUnitId, cfId, formulaText);
2020
+ }
2021
+ case CFValueType.num:
2022
+ default: {
2023
+ const v = Number(value.value);
2024
+ return {
2025
+ status: _univerjs_engine_formula.FormulaResultStatus.SUCCESS,
2026
+ result: Number.isNaN(v) ? 0 : v
2027
+ };
2028
+ }
2029
+ }
2030
+ };
2031
+ const getCacheStyleMatrix = (unitId, subUnitId, rule, context) => {
2032
+ const { accessor } = context;
2033
+ const conditionalFormattingViewModel = accessor.get(ConditionalFormattingViewModel);
2034
+ const matrix = new _univerjs_core.ObjectMatrix();
2035
+ rule.ranges.forEach((range) => {
2036
+ _univerjs_core.Range.foreach(range, (row, col) => {
2037
+ const cellCfItem = conditionalFormattingViewModel.getCellCfs(unitId, subUnitId, row, col);
2038
+ if (cellCfItem) {
2039
+ const item = cellCfItem.find((item) => item.cfId === rule.cfId);
2040
+ !(item === null || item === void 0) && item.result && matrix.setValue(row, col, item.result);
2041
+ }
2042
+ });
2043
+ });
2044
+ return matrix;
2045
+ };
2046
+ const compareWithNumber = (config, v) => {
2047
+ switch (config.operator) {
2048
+ case CFNumberOperator.between: {
2049
+ if (typeof config.value !== "object" || !config.value.length) return;
2050
+ const start = Math.min(...config.value);
2051
+ const end = Math.max(...config.value);
2052
+ return v >= start && v <= end;
2053
+ }
2054
+ case CFNumberOperator.notBetween: {
2055
+ if (typeof config.value !== "object" || !config.value.length) return;
2056
+ const start = Math.min(...config.value);
2057
+ const end = Math.max(...config.value);
2058
+ return !(v >= start && v <= end);
2059
+ }
2060
+ case CFNumberOperator.equal: return isFloatsEqual(config.value || 0, v);
2061
+ case CFNumberOperator.notEqual: return !isFloatsEqual(config.value || 0, v);
2062
+ case CFNumberOperator.greaterThan: return v > (config.value || 0);
2063
+ case CFNumberOperator.greaterThanOrEqual: return v >= (config.value || 0);
2064
+ case CFNumberOperator.lessThan: return v < (config.value || 0);
2065
+ case CFNumberOperator.lessThanOrEqual: return v <= (config.value || 0);
2066
+ default: return false;
2067
+ }
2068
+ };
2069
+ const getOppositeOperator = (operator) => {
2070
+ switch (operator) {
2071
+ case CFNumberOperator.greaterThan: return CFNumberOperator.lessThanOrEqual;
2072
+ case CFNumberOperator.greaterThanOrEqual: return CFNumberOperator.lessThan;
2073
+ case CFNumberOperator.lessThan: return CFNumberOperator.greaterThanOrEqual;
2074
+ case CFNumberOperator.lessThanOrEqual: return CFNumberOperator.greaterThan;
2075
+ }
2076
+ return operator;
2077
+ };
2078
+ const getColorScaleFromValue = (colorList, value) => {
2079
+ const prefixRgba = (rgb) => {
2080
+ if (rgb.a !== void 0) return rgb;
2081
+ else return {
2082
+ ...rgb,
2083
+ a: 1
2084
+ };
2085
+ };
2086
+ const index = colorList.findIndex((item) => item.value >= value);
2087
+ const preIndex = index - 1;
2088
+ if (index === 0) return colorList[0].color.toRgbString();
2089
+ else if (preIndex >= 0) {
2090
+ const minItem = colorList[preIndex];
2091
+ const maxItem = colorList[index];
2092
+ if (minItem.color.isValid && maxItem.color.isValid) {
2093
+ const minRgb = prefixRgba(minItem.color.toRgb());
2094
+ const maxRgb = prefixRgba(maxItem.color.toRgb());
2095
+ const length = maxItem.value - minItem.value;
2096
+ const v = (value - minItem.value) / length;
2097
+ return new _univerjs_core.ColorKit([
2098
+ "r",
2099
+ "g",
2100
+ "b",
2101
+ "a"
2102
+ ].reduce((obj, key) => {
2103
+ const minV = minRgb[key];
2104
+ obj[key] = (maxRgb[key] - minV) * v + minV;
2105
+ return obj;
2106
+ }, {})).toRgbString();
2107
+ }
2108
+ } else return colorList[colorList.length - 1].color.toRgbString();
2109
+ };
2110
+ const filterRange = (ranges, maxRow, maxCol) => {
2111
+ return ranges.map((range) => {
2112
+ if (range.startColumn > maxCol || range.startRow > maxRow) return null;
2113
+ const _range = { ...range };
2114
+ _range.endRow = Math.min(_range.endRow, maxRow);
2115
+ _range.endColumn = Math.min(_range.endColumn, maxCol);
2116
+ return _range;
2117
+ }).filter((range) => !!range);
2118
+ };
2119
+ function getMaxInFormulaResult(result) {
2120
+ let max = 0;
2121
+ new _univerjs_core.ObjectMatrix(result).forValue((row, col, value) => {
2122
+ max = Math.max(Number.isNaN(max) ? 0 : max, Number(value));
2123
+ });
2124
+ return max;
2125
+ }
2126
+
2127
+ //#endregion
2128
+ //#region src/assets/icon-map.ts
2129
+ const ICON_MAP = {
2130
+ "feedback": {
2131
+ "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",
2132
+ "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",
2133
+ "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"
2134
+ },
2135
+ "star": {
2136
+ "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",
2137
+ "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%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%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%2Fsvg%3E%0A",
2138
+ "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"
2139
+ },
2140
+ "progress": {
2141
+ "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",
2142
+ "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",
2143
+ "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",
2144
+ "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",
2145
+ "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"
2146
+ },
2147
+ "signal": {
2148
+ "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",
2149
+ "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",
2150
+ "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",
2151
+ "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",
2152
+ "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"
2153
+ },
2154
+ "feeling": {
2155
+ "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",
2156
+ "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",
2157
+ "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",
2158
+ "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",
2159
+ "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"
2160
+ },
2161
+ "arrow": {
2162
+ "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",
2163
+ "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",
2164
+ "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",
2165
+ "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",
2166
+ "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",
2167
+ "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",
2168
+ "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",
2169
+ "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",
2170
+ "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",
2171
+ "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"
2172
+ },
2173
+ "shape": {
2174
+ "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",
2175
+ "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",
2176
+ "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",
2177
+ "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",
2178
+ "rhomboid-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%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%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A",
2179
+ "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",
2180
+ "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",
2181
+ "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",
2182
+ "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",
2183
+ "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",
2184
+ "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",
2185
+ "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",
2186
+ "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",
2187
+ "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",
2188
+ "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"
2189
+ },
2190
+ "feedback2": {
2191
+ "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",
2192
+ "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",
2193
+ "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"
2194
+ },
2195
+ "flag": {
2196
+ "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",
2197
+ "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",
2198
+ "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"
2199
+ },
2200
+ "cell": {
2201
+ "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",
2202
+ "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",
2203
+ "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",
2204
+ "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",
2205
+ "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"
2206
+ }
2207
+ };
2208
+
2209
+ //#endregion
2210
+ //#region src/models/icon-map.ts
2211
+ /**
2212
+ * Copyright 2023-present DreamNum Co., Ltd.
2213
+ *
2214
+ * Licensed under the Apache License, Version 2.0 (the "License");
2215
+ * you may not use this file except in compliance with the License.
2216
+ * You may obtain a copy of the License at
2217
+ *
2218
+ * http://www.apache.org/licenses/LICENSE-2.0
2219
+ *
2220
+ * Unless required by applicable law or agreed to in writing, software
2221
+ * distributed under the License is distributed on an "AS IS" BASIS,
2222
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2223
+ * See the License for the specific language governing permissions and
2224
+ * limitations under the License.
2225
+ */
2226
+ const iconGroup = [
2227
+ {
2228
+ title: "sheet.cf.iconSet.direction",
2229
+ group: [
2230
+ {
2231
+ name: "3Arrows",
2232
+ list: [
2233
+ ICON_MAP.arrow["up-green"],
2234
+ ICON_MAP.arrow["right-gold"],
2235
+ ICON_MAP.arrow["down-red"]
2236
+ ]
2237
+ },
2238
+ {
2239
+ name: "3ArrowsGray",
2240
+ list: [
2241
+ ICON_MAP.arrow["up-gray"],
2242
+ ICON_MAP.arrow["right-gray"],
2243
+ ICON_MAP.arrow["down-gray"]
2244
+ ]
2245
+ },
2246
+ {
2247
+ name: "4Arrows",
2248
+ list: [
2249
+ ICON_MAP.arrow["up-green"],
2250
+ ICON_MAP.arrow["rightAndUp-gold"],
2251
+ ICON_MAP.arrow["rightAndDown-gold"],
2252
+ ICON_MAP.arrow["down-red"]
2253
+ ]
2254
+ },
2255
+ {
2256
+ name: "4ArrowsGray",
2257
+ list: [
2258
+ ICON_MAP.arrow["up-gray"],
2259
+ ICON_MAP.arrow["rightAndUp-gray"],
2260
+ ICON_MAP.arrow["rightAndDown-gray"],
2261
+ ICON_MAP.arrow["down-gray"]
2262
+ ]
2263
+ },
2264
+ {
2265
+ name: "5Arrows",
2266
+ list: [
2267
+ ICON_MAP.arrow["up-green"],
2268
+ ICON_MAP.arrow["rightAndUp-gold"],
2269
+ ICON_MAP.arrow["right-gold"],
2270
+ ICON_MAP.arrow["rightAndDown-gold"],
2271
+ ICON_MAP.arrow["down-red"]
2272
+ ]
2273
+ },
2274
+ {
2275
+ name: "5ArrowsGray",
2276
+ list: [
2277
+ ICON_MAP.arrow["up-gray"],
2278
+ ICON_MAP.arrow["rightAndUp-gray"],
2279
+ ICON_MAP.arrow["right-gray"],
2280
+ ICON_MAP.arrow["rightAndDown-gray"],
2281
+ ICON_MAP.arrow["down-gray"]
2282
+ ]
2283
+ },
2284
+ {
2285
+ name: "3Triangles",
2286
+ list: [
2287
+ ICON_MAP.shape.up,
2288
+ ICON_MAP.shape.cross,
2289
+ ICON_MAP.shape.down
2290
+ ]
2291
+ }
2292
+ ]
2293
+ },
2294
+ {
2295
+ title: "sheet.cf.iconSet.shape",
2296
+ group: [
2297
+ {
2298
+ name: "3TrafficLights1",
2299
+ list: [
2300
+ ICON_MAP.shape["roundness-greed"],
2301
+ ICON_MAP.shape["roundness-gold"],
2302
+ ICON_MAP.shape["roundness-red"]
2303
+ ]
2304
+ },
2305
+ {
2306
+ name: "3Signs",
2307
+ list: [
2308
+ ICON_MAP.shape["roundness-greed"],
2309
+ ICON_MAP.shape["triangle-gold"],
2310
+ ICON_MAP.shape["rhomboid-red"]
2311
+ ]
2312
+ },
2313
+ {
2314
+ name: "3TrafficLights2",
2315
+ list: [
2316
+ ICON_MAP.shape["indicate-greed"],
2317
+ ICON_MAP.shape["indicate-gold"],
2318
+ ICON_MAP.shape["indicate-red"]
2319
+ ]
2320
+ },
2321
+ {
2322
+ name: "4RedToBlack",
2323
+ list: [
2324
+ ICON_MAP.shape["roundness-red"],
2325
+ ICON_MAP.shape["roundness-pink"],
2326
+ ICON_MAP.shape["roundness-gray"],
2327
+ ICON_MAP.shape["roundness-black"]
2328
+ ]
2329
+ },
2330
+ {
2331
+ name: "4TrafficLights",
2332
+ list: [
2333
+ ICON_MAP.shape["roundness-greed"],
2334
+ ICON_MAP.shape["roundness-gold"],
2335
+ ICON_MAP.shape["roundness-red"],
2336
+ ICON_MAP.shape["roundness-black"]
2337
+ ]
2338
+ }
2339
+ ]
2340
+ },
2341
+ {
2342
+ title: "sheet.cf.iconSet.mark",
2343
+ group: [
2344
+ {
2345
+ name: "3Symbols",
2346
+ list: [
2347
+ ICON_MAP.feedback.correct,
2348
+ ICON_MAP.feedback.warn,
2349
+ ICON_MAP.feedback.mistake
2350
+ ]
2351
+ },
2352
+ {
2353
+ name: "3Symbols2",
2354
+ list: [
2355
+ ICON_MAP.feedback2.correct2,
2356
+ ICON_MAP.feedback2.warn2,
2357
+ ICON_MAP.feedback2.mistake2
2358
+ ]
2359
+ },
2360
+ {
2361
+ name: "3Flags",
2362
+ list: [
2363
+ ICON_MAP.flag["flag-green"],
2364
+ ICON_MAP.flag["flag-gold"],
2365
+ ICON_MAP.flag["flag-red"]
2366
+ ]
2367
+ }
2368
+ ]
2369
+ },
2370
+ {
2371
+ title: "sheet.cf.iconSet.rank",
2372
+ group: [
2373
+ {
2374
+ name: "4Rating",
2375
+ list: [
2376
+ ICON_MAP.signal.signal25,
2377
+ ICON_MAP.signal.signal50,
2378
+ ICON_MAP.signal.signal75,
2379
+ ICON_MAP.signal.signal100
2380
+ ]
2381
+ },
2382
+ {
2383
+ name: "5Rating",
2384
+ list: [
2385
+ ICON_MAP.signal.signal0,
2386
+ ICON_MAP.signal.signal25,
2387
+ ICON_MAP.signal.signal50,
2388
+ ICON_MAP.signal.signal75,
2389
+ ICON_MAP.signal.signal100
2390
+ ]
2391
+ },
2392
+ {
2393
+ name: "5Quarters",
2394
+ list: [
2395
+ ICON_MAP.progress.progress100,
2396
+ ICON_MAP.progress.progress75,
2397
+ ICON_MAP.progress.progress50,
2398
+ ICON_MAP.progress.progress25,
2399
+ ICON_MAP.progress.progress0
2400
+ ]
2401
+ },
2402
+ {
2403
+ name: "_5Felling",
2404
+ list: [
2405
+ ICON_MAP.feeling.guffaw,
2406
+ ICON_MAP.feeling.smile,
2407
+ ICON_MAP.feeling.noninductive,
2408
+ ICON_MAP.feeling.dissatisfied,
2409
+ ICON_MAP.feeling.impatient
2410
+ ]
2411
+ },
2412
+ {
2413
+ name: "5Boxes",
2414
+ list: [
2415
+ ICON_MAP.cell["cell-100"],
2416
+ ICON_MAP.cell["cell-75"],
2417
+ ICON_MAP.cell["cell-50"],
2418
+ ICON_MAP.cell["cell-25"],
2419
+ ICON_MAP.cell["cell-0"]
2420
+ ]
2421
+ },
2422
+ {
2423
+ name: "3Stars",
2424
+ list: [
2425
+ ICON_MAP.star.starFull,
2426
+ ICON_MAP.star.starIncomplete,
2427
+ ICON_MAP.star.starEmpty
2428
+ ]
2429
+ }
2430
+ ]
2431
+ }
2432
+ ];
2433
+ const iconMap = iconGroup.reduce((result, cur) => {
2434
+ const { group } = cur;
2435
+ for (const v of group) result[v.name] = v.list;
2436
+ return result;
2437
+ }, {});
2438
+ for (const key in iconMap) {
2439
+ const v = iconMap[key];
2440
+ Object.freeze(v);
2441
+ }
2442
+ const EMPTY_ICON_TYPE = "EMPTY_ICON_TYPE";
2443
+
2444
+ //#endregion
2445
+ //#region package.json
2446
+ var name = "@univerjs/sheets-conditional-formatting";
2447
+ var version = "0.21.0";
2448
+
2449
+ //#endregion
2450
+ //#region src/config/config.ts
2451
+ /**
2452
+ * Copyright 2023-present DreamNum Co., Ltd.
2453
+ *
2454
+ * Licensed under the Apache License, Version 2.0 (the "License");
2455
+ * you may not use this file except in compliance with the License.
2456
+ * You may obtain a copy of the License at
2457
+ *
2458
+ * http://www.apache.org/licenses/LICENSE-2.0
2459
+ *
2460
+ * Unless required by applicable law or agreed to in writing, software
2461
+ * distributed under the License is distributed on an "AS IS" BASIS,
2462
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2463
+ * See the License for the specific language governing permissions and
2464
+ * limitations under the License.
2465
+ */
2466
+ const SHEETS_CONDITIONAL_FORMATTING_PLUGIN_CONFIG_KEY = "ssheets-conditional-formatting.config";
2467
+ const configSymbol = Symbol(SHEETS_CONDITIONAL_FORMATTING_PLUGIN_CONFIG_KEY);
2468
+ const defaultPluginConfig = {};
2469
+
2470
+ //#endregion
2471
+ //#region src/services/conditional-formatting.service.ts
2472
+ let ConditionalFormattingService = class ConditionalFormattingService extends _univerjs_core.Disposable {
2473
+ get _conditionalFormattingViewModelV2() {
2474
+ return this._injector.get(ConditionalFormattingViewModel);
2475
+ }
2476
+ constructor(_conditionalFormattingRuleModel, _injector, _univerInstanceService, _resourceManagerService, _sheetInterceptorService, _commandService) {
2477
+ super();
2478
+ this._conditionalFormattingRuleModel = _conditionalFormattingRuleModel;
2479
+ this._injector = _injector;
2480
+ this._univerInstanceService = _univerInstanceService;
2481
+ this._resourceManagerService = _resourceManagerService;
2482
+ this._sheetInterceptorService = _sheetInterceptorService;
2483
+ this._commandService = _commandService;
2484
+ this._initCellChange();
2485
+ this._initSnapshot();
2486
+ this._initSheetChange();
2487
+ }
2488
+ composeStyle(unitId, subUnitId, row, col) {
2489
+ const cellCfs = this._conditionalFormattingViewModelV2.getCellCfs(unitId, subUnitId, row, col);
2490
+ if (!(cellCfs === null || cellCfs === void 0 ? void 0 : cellCfs.length)) return null;
2491
+ const matchedRules = [];
2492
+ let stopIfTrueIndex = -1;
2493
+ for (const cacheItem of cellCfs) {
2494
+ const rule = this._conditionalFormattingRuleModel.getRule(unitId, subUnitId, cacheItem.cfId);
2495
+ if (!rule) continue;
2496
+ matchedRules.push({
2497
+ rule,
2498
+ cacheItem
2499
+ });
2500
+ if (stopIfTrueIndex === -1 && rule.stopIfTrue) stopIfTrueIndex = matchedRules.length - 1;
2501
+ }
2502
+ if (!matchedRules.length) return null;
2503
+ const effectiveRules = stopIfTrueIndex > -1 ? matchedRules.slice(0, stopIfTrueIndex + 1) : matchedRules;
2504
+ const result = {};
2505
+ for (let i = effectiveRules.length - 1; i >= 0; i--) {
2506
+ const { rule, cacheItem } = effectiveRules[i];
2507
+ const type = rule.rule.type;
2508
+ if (type === CFRuleType.highlightCell) cacheItem.result && (0, _univerjs_core.merge)(result, { style: cacheItem.result });
2509
+ else if (type === CFRuleType.colorScale) {
2510
+ const ruleCache = cacheItem.result;
2511
+ if (ruleCache && typeof ruleCache === "string") result.style = {
2512
+ ...result.style || {},
2513
+ bg: { rgb: ruleCache }
2514
+ };
2515
+ } else if (type === CFRuleType.dataBar) {
2516
+ const ruleCache = cacheItem.result;
2517
+ if (ruleCache) {
2518
+ result.dataBar = ruleCache;
2519
+ result.isShowValue = ruleCache.isShowValue;
2520
+ }
2521
+ } else if (type === CFRuleType.iconSet) {
2522
+ const ruleCache = cacheItem.result;
2523
+ if (ruleCache) {
2524
+ result.iconSet = ruleCache;
2525
+ result.isShowValue = ruleCache.isShowValue;
2526
+ }
2527
+ }
2528
+ }
2529
+ return result;
2530
+ }
2531
+ _initSnapshot() {
2532
+ const toJson = (unitID) => {
2533
+ const map = this._conditionalFormattingRuleModel.getUnitRules(unitID);
2534
+ const resultMap = {};
2535
+ if (map) {
2536
+ map.forEach((v, key) => {
2537
+ resultMap[key] = v;
2538
+ });
2539
+ return JSON.stringify(resultMap);
2540
+ }
2541
+ return "";
2542
+ };
2543
+ const parseJson = (json) => {
2544
+ if (!json) return {};
2545
+ try {
2546
+ return JSON.parse(json);
2547
+ } catch (err) {
2548
+ return {};
2549
+ }
2550
+ };
2551
+ this.disposeWithMe(this._resourceManagerService.registerPluginResource({
2552
+ pluginName: SHEET_CONDITIONAL_FORMATTING_PLUGIN,
2553
+ businesses: [_univerjs_core.UniverInstanceType.UNIVER_SHEET],
2554
+ toJson: (unitID) => toJson(unitID),
2555
+ parseJson: (json) => parseJson(json),
2556
+ onUnLoad: (unitID) => {
2557
+ this._conditionalFormattingRuleModel.deleteUnitId(unitID);
2558
+ if ((0, _univerjs_core.isInternalEditorID)(unitID)) return;
2559
+ this._conditionalFormattingViewModelV2.clearCache();
2560
+ },
2561
+ onLoad: (unitID, value) => {
2562
+ Object.keys(value).forEach((subunitId) => {
2563
+ [...value[subunitId]].reverse().forEach((rule) => {
2564
+ this._conditionalFormattingRuleModel.addRule(unitID, subunitId, rule);
2565
+ });
2566
+ });
2567
+ }
2568
+ }));
2569
+ }
2570
+ _initSheetChange() {
2571
+ this.disposeWithMe(this._sheetInterceptorService.interceptCommand({ getMutations: (commandInfo) => {
2572
+ if (commandInfo.id === _univerjs_sheets.RemoveSheetCommand.id) {
2573
+ const params = commandInfo.params;
2574
+ const target = (0, _univerjs_sheets.getSheetCommandTarget)(this._univerInstanceService, params);
2575
+ if (!target) return {
2576
+ redos: [],
2577
+ undos: []
2578
+ };
2579
+ const { unitId, subUnitId } = target;
2580
+ const ruleList = this._conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId);
2581
+ if (!ruleList) return {
2582
+ redos: [],
2583
+ undos: []
2584
+ };
2585
+ const redos = [];
2586
+ const undos = [];
2587
+ ruleList.forEach((item) => {
2588
+ const params = {
2589
+ unitId,
2590
+ subUnitId,
2591
+ cfId: item.cfId
2592
+ };
2593
+ redos.push({
2594
+ id: DeleteConditionalRuleMutation.id,
2595
+ params
2596
+ });
2597
+ undos.push(...DeleteConditionalRuleMutationUndoFactory(this._injector, params));
2598
+ });
2599
+ return {
2600
+ redos,
2601
+ undos
2602
+ };
2603
+ } else if (commandInfo.id === _univerjs_sheets.CopySheetCommand.id) {
2604
+ const params = commandInfo.params;
2605
+ const target = (0, _univerjs_sheets.getSheetCommandTarget)(this._univerInstanceService, params);
2606
+ if (!target) return {
2607
+ redos: [],
2608
+ undos: []
2609
+ };
2610
+ const { unitId, subUnitId } = target;
2611
+ const { targetSubUnitId } = params;
2612
+ const ruleList = this._conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId);
2613
+ if (!ruleList) return {
2614
+ redos: [],
2615
+ undos: []
2616
+ };
2617
+ const redos = [];
2618
+ const undos = [];
2619
+ ruleList.forEach((item) => {
2620
+ const params = {
2621
+ unitId,
2622
+ subUnitId: targetSubUnitId,
2623
+ rule: {
2624
+ ...item,
2625
+ cfId: this._conditionalFormattingRuleModel.createCfId(unitId, targetSubUnitId)
2626
+ }
2627
+ };
2628
+ redos.push({
2629
+ id: AddConditionalRuleMutation.id,
2630
+ params
2631
+ });
2632
+ undos.push(AddConditionalRuleMutationUndoFactory(this._injector, params));
2633
+ });
2634
+ return {
2635
+ redos,
2636
+ undos
2637
+ };
2638
+ }
2639
+ return {
2640
+ redos: [],
2641
+ undos: []
2642
+ };
2643
+ } }));
2644
+ }
2645
+ _initCellChange() {
2646
+ this.disposeWithMe(this._commandService.onCommandExecuted((commandInfo) => {
2647
+ const collectRule = (unitId, subUnitId, cellData) => {
2648
+ const ruleIds = /* @__PURE__ */ new Set();
2649
+ cellData.forEach(([row, col]) => {
2650
+ const ruleItem = this._conditionalFormattingViewModelV2.getCellCfs(unitId, subUnitId, row, col);
2651
+ ruleItem === null || ruleItem === void 0 || ruleItem.forEach((item) => ruleIds.add(item.cfId));
2652
+ });
2653
+ return [...ruleIds].map((cfId) => this._conditionalFormattingRuleModel.getRule(unitId, subUnitId, cfId)).filter((rule) => !!rule);
2654
+ };
2655
+ switch (commandInfo.id) {
2656
+ case _univerjs_sheets.SetRangeValuesMutation.id: {
2657
+ const { subUnitId, unitId, cellValue } = commandInfo.params;
2658
+ const cellMatrix = [];
2659
+ new _univerjs_core.ObjectMatrix(cellValue).forValue((row, col, value) => {
2660
+ if (value && Object.keys(value).some((key) => ["p", "v"].includes(key))) cellMatrix.push([row, col]);
2661
+ });
2662
+ collectRule(unitId, subUnitId, cellMatrix).forEach((rule) => {
2663
+ this._conditionalFormattingViewModelV2.markRuleDirty(unitId, subUnitId, rule.cfId);
2664
+ });
2665
+ break;
2666
+ }
2667
+ case _univerjs_sheets.InsertColMutation.id:
2668
+ case _univerjs_sheets.RemoveColMutation.id: {
2669
+ const params = commandInfo.params;
2670
+ const target = (0, _univerjs_sheets.getSheetCommandTarget)(this._univerInstanceService, params);
2671
+ if (!target) return;
2672
+ const { worksheet, unitId, subUnitId } = target;
2673
+ const { range } = params;
2674
+ const effectRange = {
2675
+ ...range,
2676
+ endColumn: worksheet.getColumnCount() - 1
2677
+ };
2678
+ const allRules = this._conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId);
2679
+ if (allRules) allRules.filter((rule) => rule.ranges.some((ruleRange) => _univerjs_core.Rectangle.intersects(ruleRange, effectRange))).forEach((rule) => {
2680
+ this._conditionalFormattingViewModelV2.markRuleDirty(unitId, subUnitId, rule.cfId);
2681
+ });
2682
+ break;
2683
+ }
2684
+ case _univerjs_sheets.RemoveRowMutation.id:
2685
+ case _univerjs_sheets.InsertRowMutation.id: {
2686
+ const params = commandInfo.params;
2687
+ const target = (0, _univerjs_sheets.getSheetCommandTarget)(this._univerInstanceService, params);
2688
+ if (!target) return;
2689
+ const { worksheet, unitId, subUnitId } = target;
2690
+ const { range } = params;
2691
+ const effectRange = {
2692
+ ...range,
2693
+ endRow: worksheet.getRowCount() - 1
2694
+ };
2695
+ const allRules = this._conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId);
2696
+ if (allRules) allRules.filter((rule) => rule.ranges.some((ruleRange) => _univerjs_core.Rectangle.intersects(ruleRange, effectRange))).forEach((rule) => {
2697
+ this._conditionalFormattingViewModelV2.markRuleDirty(unitId, subUnitId, rule.cfId);
2698
+ });
2699
+ break;
2700
+ }
2701
+ case _univerjs_sheets.MoveRowsMutation.id: {
2702
+ const params = commandInfo.params;
2703
+ const target = (0, _univerjs_sheets.getSheetCommandTarget)(this._univerInstanceService, params);
2704
+ if (!target) return;
2705
+ const { worksheet, unitId, subUnitId } = target;
2706
+ const { sourceRange, targetRange } = params;
2707
+ const effectRange = {
2708
+ startRow: Math.min(sourceRange.startRow, targetRange.startRow),
2709
+ endRow: worksheet.getRowCount() - 1,
2710
+ startColumn: 0,
2711
+ endColumn: worksheet.getColumnCount() - 1
2712
+ };
2713
+ const allRules = this._conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId);
2714
+ if (allRules) allRules.filter((rule) => rule.ranges.some((ruleRange) => _univerjs_core.Rectangle.intersects(ruleRange, effectRange))).forEach((rule) => {
2715
+ this._conditionalFormattingViewModelV2.markRuleDirty(unitId, subUnitId, rule.cfId);
2716
+ });
2717
+ break;
2718
+ }
2719
+ case _univerjs_sheets.MoveColsMutation.id: {
2720
+ const params = commandInfo.params;
2721
+ const target = (0, _univerjs_sheets.getSheetCommandTarget)(this._univerInstanceService, params);
2722
+ if (!target) return;
2723
+ const { worksheet, unitId, subUnitId } = target;
2724
+ const { sourceRange, targetRange } = params;
2725
+ const effectRange = {
2726
+ startRow: 0,
2727
+ endRow: worksheet.getRowCount() - 1,
2728
+ startColumn: Math.min(sourceRange.startColumn, targetRange.startColumn),
2729
+ endColumn: worksheet.getColumnCount() - 1
2730
+ };
2731
+ const allRules = this._conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId);
2732
+ if (allRules) allRules.filter((rule) => rule.ranges.some((ruleRange) => _univerjs_core.Rectangle.intersects(ruleRange, effectRange))).forEach((rule) => {
2733
+ this._conditionalFormattingViewModelV2.markRuleDirty(unitId, subUnitId, rule.cfId);
2734
+ });
2735
+ break;
2736
+ }
2737
+ case _univerjs_sheets.MoveRangeMutation.id: {
2738
+ const { unitId, to, from } = commandInfo.params;
2739
+ const handleSubUnit = (value) => {
2740
+ const cellMatrix = [];
2741
+ new _univerjs_core.ObjectMatrix(value.value).forValue((row, col) => {
2742
+ cellMatrix.push([row, col]);
2743
+ });
2744
+ collectRule(unitId, value.subUnitId, cellMatrix).forEach((rule) => {
2745
+ this._conditionalFormattingViewModelV2.markRuleDirty(unitId, value.subUnitId, rule.cfId);
2746
+ });
2747
+ };
2748
+ handleSubUnit(to);
2749
+ handleSubUnit(from);
2750
+ break;
2751
+ }
2752
+ case _univerjs_sheets.ReorderRangeMutation.id: {
2753
+ const { range, unitId, subUnitId } = commandInfo.params;
2754
+ const allRules = this._conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId);
2755
+ if (allRules) allRules.filter((rule) => rule.ranges.some((ruleRange) => _univerjs_core.Rectangle.intersects(ruleRange, range))).forEach((rule) => {
2756
+ this._conditionalFormattingViewModelV2.markRuleDirty(unitId, subUnitId, rule.cfId);
2757
+ });
2758
+ break;
2759
+ }
2760
+ }
2761
+ }));
2762
+ }
2763
+ };
2764
+ ConditionalFormattingService = __decorate([
2765
+ __decorateParam(0, (0, _univerjs_core.Inject)(ConditionalFormattingRuleModel)),
2766
+ __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
2767
+ __decorateParam(2, (0, _univerjs_core.Inject)(_univerjs_core.IUniverInstanceService)),
2768
+ __decorateParam(3, (0, _univerjs_core.Inject)(_univerjs_core.IResourceManagerService)),
2769
+ __decorateParam(4, (0, _univerjs_core.Inject)(_univerjs_sheets.SheetInterceptorService)),
2770
+ __decorateParam(5, (0, _univerjs_core.Inject)(_univerjs_core.ICommandService))
2771
+ ], ConditionalFormattingService);
2772
+
2773
+ //#endregion
2774
+ //#region src/plugin.ts
2775
+ let UniverSheetsConditionalFormattingPlugin = class UniverSheetsConditionalFormattingPlugin extends _univerjs_core.Plugin {
2776
+ constructor(_config = defaultPluginConfig, _injector, _commandService, _configService) {
2777
+ super();
2778
+ this._config = _config;
2779
+ this._injector = _injector;
2780
+ this._commandService = _commandService;
2781
+ this._configService = _configService;
2782
+ const { ...rest } = (0, _univerjs_core.merge)({}, defaultPluginConfig, this._config);
2783
+ this._configService.setConfig(SHEETS_CONDITIONAL_FORMATTING_PLUGIN_CONFIG_KEY, rest);
2784
+ [
2785
+ [ConditionalFormattingService],
2786
+ [ConditionalFormattingFormulaService],
2787
+ [ConditionalFormattingRuleModel],
2788
+ [ConditionalFormattingViewModel]
2789
+ ].forEach((dependency) => {
2790
+ this._injector.add(dependency);
2791
+ });
2792
+ [
2793
+ AddCfCommand,
2794
+ ClearRangeCfCommand,
2795
+ ClearWorksheetCfCommand,
2796
+ DeleteCfCommand,
2797
+ MoveCfCommand,
2798
+ SetCfCommand,
2799
+ AddConditionalRuleMutation,
2800
+ DeleteConditionalRuleMutation,
2801
+ SetConditionalRuleMutation,
2802
+ MoveConditionalRuleMutation
2803
+ ].forEach((m) => {
2804
+ this._commandService.registerCommand(m);
2805
+ });
2806
+ }
2807
+ onStarting() {
2808
+ this._injector.get(ConditionalFormattingService);
2809
+ (0, _univerjs_core.touchDependencies)(this._injector, [[ConditionalFormattingService], [ConditionalFormattingViewModel]]);
2810
+ }
2811
+ };
2812
+ _defineProperty(UniverSheetsConditionalFormattingPlugin, "pluginName", SHEET_CONDITIONAL_FORMATTING_PLUGIN);
2813
+ _defineProperty(UniverSheetsConditionalFormattingPlugin, "packageName", name);
2814
+ _defineProperty(UniverSheetsConditionalFormattingPlugin, "version", version);
2815
+ _defineProperty(UniverSheetsConditionalFormattingPlugin, "type", _univerjs_core.UniverInstanceType.UNIVER_SHEET);
2816
+ UniverSheetsConditionalFormattingPlugin = __decorate([
2817
+ (0, _univerjs_core.DependentOn)(_univerjs_engine_formula.UniverFormulaEnginePlugin),
2818
+ __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
2819
+ __decorateParam(2, (0, _univerjs_core.Inject)(_univerjs_core.ICommandService)),
2820
+ __decorateParam(3, _univerjs_core.IConfigService)
2821
+ ], UniverSheetsConditionalFormattingPlugin);
2822
+
2823
+ //#endregion
2824
+ //#region src/render/icon.render.ts
2825
+ const IconUKey = "sheet-conditional-rule-icon";
2826
+ const EXTENSION_Z_INDEX = 35;
2827
+ const DEFAULT_WIDTH = 15;
2828
+ const DEFAULT_PADDING = 2;
2829
+ const stringifyRange = (range) => {
2830
+ const { startRow, endRow, startColumn, endColumn } = range;
2831
+ return `${startRow}-${endRow}-${startColumn}-${endColumn}`;
2832
+ };
2833
+ var ConditionalFormattingIcon = class extends _univerjs_engine_render.SheetExtension {
2834
+ constructor() {
2835
+ super();
2836
+ _defineProperty(this, "_paddingRightAndLeft", 2);
2837
+ _defineProperty(this, "_width", 15);
2838
+ _defineProperty(this, "_imageMap", /* @__PURE__ */ new Map());
2839
+ _defineProperty(this, "uKey", IconUKey);
2840
+ _defineProperty(this, "Z_INDEX", EXTENSION_Z_INDEX);
2841
+ _defineProperty(this, "_radius", 1);
2842
+ this._init();
2843
+ }
2844
+ draw(ctx, _parentScale, spreadsheetSkeleton, diffRanges) {
2845
+ const { worksheet } = spreadsheetSkeleton;
2846
+ if (!worksheet) return false;
2847
+ const mergeCellRendered = /* @__PURE__ */ new Set();
2848
+ ctx.save();
2849
+ _univerjs_core.Range.foreach(spreadsheetSkeleton.rowColumnSegment, (row, col) => {
2850
+ if (!worksheet.getRowVisible(row) || !worksheet.getColVisible(col)) return;
2851
+ const primaryWithCoord = spreadsheetSkeleton.getCellWithCoordByIndex(row, col, false);
2852
+ const { isMerged, isMergedMainCell, mergeInfo } = primaryWithCoord;
2853
+ let cellData = worksheet.getCell(row, col);
2854
+ if (isMerged) cellData = worksheet.getCell(mergeInfo.startRow, mergeInfo.startColumn);
2855
+ if (!(cellData === null || cellData === void 0 ? void 0 : cellData.iconSet)) return;
2856
+ const { iconType, iconId } = cellData.iconSet;
2857
+ if (iconType === "EMPTY_ICON_TYPE") return;
2858
+ const icon = this._imageMap.get(this._createKey(iconType, iconId));
2859
+ if (!icon) return;
2860
+ if (!this.isRenderDiffRangesByCell(mergeInfo, diffRanges)) return;
2861
+ if (isMerged || isMergedMainCell) {
2862
+ const rangeStr = stringifyRange(mergeInfo);
2863
+ if (mergeCellRendered.has(rangeStr)) return;
2864
+ mergeCellRendered.add(rangeStr);
2865
+ }
2866
+ const { startX, endX, startY, endY } = isMerged || isMergedMainCell ? mergeInfo : primaryWithCoord;
2867
+ const borderWidth = endX - startX;
2868
+ const borderHeight = endY - startY;
2869
+ if (this._width > borderHeight || this._width > borderWidth + this._paddingRightAndLeft * 2) return;
2870
+ const y = (borderHeight - this._width) / 2 + startY;
2871
+ ctx.drawImage(icon, startX + this._paddingRightAndLeft, y, this._width, this._width);
2872
+ });
2873
+ ctx.restore();
2874
+ }
2875
+ _init() {
2876
+ for (const type in iconMap) iconMap[type].forEach((base64, index) => {
2877
+ const key = this._createKey(type, String(index));
2878
+ const image = new Image();
2879
+ image.onload = () => {
2880
+ this._imageMap.set(key, image);
2881
+ };
2882
+ image.src = base64;
2883
+ });
2884
+ }
2885
+ _createKey(iconType, iconIndex) {
2886
+ return `${iconType}_${iconIndex}`;
2887
+ }
2888
+ };
2889
+ _univerjs_engine_render.SpreadsheetExtensionRegistry.add(ConditionalFormattingIcon);
2890
+
2891
+ //#endregion
2892
+ //#region src/utils/remove-undefined-attr.ts
2893
+ /**
2894
+ * Copyright 2023-present DreamNum Co., Ltd.
2895
+ *
2896
+ * Licensed under the Apache License, Version 2.0 (the "License");
2897
+ * you may not use this file except in compliance with the License.
2898
+ * You may obtain a copy of the License at
2899
+ *
2900
+ * http://www.apache.org/licenses/LICENSE-2.0
2901
+ *
2902
+ * Unless required by applicable law or agreed to in writing, software
2903
+ * distributed under the License is distributed on an "AS IS" BASIS,
2904
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2905
+ * See the License for the specific language governing permissions and
2906
+ * limitations under the License.
2907
+ */
2908
+ function removeUndefinedAttr(obj) {
2909
+ if (typeof obj !== "object" || obj === null) return obj;
2910
+ const result = {};
2911
+ for (const key in obj) if (obj.hasOwnProperty(key)) {
2912
+ const value = removeUndefinedAttr(obj[key]);
2913
+ if (value !== void 0) result[key] = value;
2914
+ }
2915
+ return result;
2916
+ }
2917
+
2918
+ //#endregion
2919
+ exports.AddCfCommand = AddCfCommand;
2920
+ exports.AddConditionalRuleMutation = AddConditionalRuleMutation;
2921
+ exports.AddConditionalRuleMutationUndoFactory = AddConditionalRuleMutationUndoFactory;
2922
+ exports.CFNumberOperator = CFNumberOperator;
2923
+ exports.CFRuleType = CFRuleType;
2924
+ exports.CFSubRuleType = CFSubRuleType;
2925
+ exports.CFTextOperator = CFTextOperator;
2926
+ exports.CFTimePeriodOperator = CFTimePeriodOperator;
2927
+ exports.CFValueType = CFValueType;
2928
+ exports.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH = CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH;
2929
+ exports.ClearRangeCfCommand = ClearRangeCfCommand;
2930
+ exports.ClearWorksheetCfCommand = ClearWorksheetCfCommand;
2931
+ Object.defineProperty(exports, 'ConditionalFormattingFormulaService', {
2932
+ enumerable: true,
2933
+ get: function () {
2934
+ return ConditionalFormattingFormulaService;
2935
+ }
2936
+ });
2937
+ exports.ConditionalFormattingIcon = ConditionalFormattingIcon;
2938
+ exports.ConditionalFormattingRuleModel = ConditionalFormattingRuleModel;
2939
+ Object.defineProperty(exports, 'ConditionalFormattingService', {
2940
+ enumerable: true,
2941
+ get: function () {
2942
+ return ConditionalFormattingService;
2943
+ }
2944
+ });
2945
+ Object.defineProperty(exports, 'ConditionalFormattingViewModel', {
2946
+ enumerable: true,
2947
+ get: function () {
2948
+ return ConditionalFormattingViewModel;
2949
+ }
2950
+ });
2951
+ exports.DEFAULT_BG_COLOR = DEFAULT_BG_COLOR;
2952
+ exports.DEFAULT_FONT_COLOR = DEFAULT_FONT_COLOR;
2953
+ exports.DEFAULT_PADDING = DEFAULT_PADDING;
2954
+ exports.DEFAULT_WIDTH = DEFAULT_WIDTH;
2955
+ exports.DataBar = DataBar;
2956
+ exports.DeleteCfCommand = DeleteCfCommand;
2957
+ exports.DeleteConditionalRuleMutation = DeleteConditionalRuleMutation;
2958
+ exports.DeleteConditionalRuleMutationUndoFactory = DeleteConditionalRuleMutationUndoFactory;
2959
+ exports.EMPTY_ICON_TYPE = EMPTY_ICON_TYPE;
2960
+ exports.IconUKey = IconUKey;
2961
+ exports.MoveCfCommand = MoveCfCommand;
2962
+ exports.MoveConditionalRuleMutation = MoveConditionalRuleMutation;
2963
+ exports.MoveConditionalRuleMutationUndoFactory = MoveConditionalRuleMutationUndoFactory;
2964
+ exports.SHEET_CONDITIONAL_FORMATTING_PLUGIN = SHEET_CONDITIONAL_FORMATTING_PLUGIN;
2965
+ exports.SetCfCommand = SetCfCommand;
2966
+ exports.SetConditionalRuleMutation = SetConditionalRuleMutation;
2967
+ Object.defineProperty(exports, 'UniverSheetsConditionalFormattingPlugin', {
2968
+ enumerable: true,
2969
+ get: function () {
2970
+ return UniverSheetsConditionalFormattingPlugin;
2971
+ }
2972
+ });
2973
+ exports.anchorUndoFactory = anchorUndoFactory;
2974
+ exports.compareWithNumber = compareWithNumber;
2975
+ exports.createCfId = createCfId;
2976
+ exports.createDefaultRule = createDefaultRule;
2977
+ exports.createDefaultValue = createDefaultValue;
2978
+ exports.createDefaultValueByValueType = createDefaultValueByValueType;
2979
+ exports.dataBarUKey = dataBarUKey;
2980
+ exports.defaultDataBarNativeColor = defaultDataBarNativeColor;
2981
+ exports.defaultDataBarPositiveColor = defaultDataBarPositiveColor;
2982
+ exports.defaultPlaceholderColor = defaultPlaceholderColor;
2983
+ exports.filterRange = filterRange;
2984
+ exports.findIndexByAnchor = findIndexByAnchor;
2985
+ exports.getCacheStyleMatrix = getCacheStyleMatrix;
2986
+ exports.getCellValue = getCellValue;
2987
+ exports.getColorScaleFromValue = getColorScaleFromValue;
2988
+ exports.getMaxInFormulaResult = getMaxInFormulaResult;
2989
+ exports.getOppositeOperator = getOppositeOperator;
2990
+ exports.getValueByType = getValueByType;
2991
+ exports.iconGroup = iconGroup;
2992
+ exports.iconMap = iconMap;
2993
+ exports.isAnchorEqual = isAnchorEqual;
2994
+ exports.isFloatsEqual = isFloatsEqual;
2995
+ exports.isNullable = isNullable;
2996
+ Object.defineProperty(exports, 'isRangesEqual', {
2997
+ enumerable: true,
2998
+ get: function () {
2999
+ return _univerjs_core.isRangesEqual;
3000
+ }
3001
+ });
3002
+ exports.moveByAnchor = moveByAnchor;
3003
+ exports.removeUndefinedAttr = removeUndefinedAttr;
3004
+ exports.serialTimeToTimestamp = serialTimeToTimestamp;
3005
+ exports.setConditionalRuleMutationUndoFactory = setConditionalRuleMutationUndoFactory;
3006
+ exports.toYMD_1900 = toYMD_1900;
3007
+ exports.transformSupportSymmetryAnchor = transformSupportSymmetryAnchor;