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