@nebula.js/sn-kpi
Version:
KPI supernova
15 lines (14 loc) • 301 kB
JavaScript
/*
* @nebula.js/sn-kpi v2.4.0
* Copyright (c) 2026 QlikTech International AB
* Released under the MIT license.
*/
import{useState as e,useEffect as t,useMemo as n,useInteractionState as r,useTheme as o,useOptions as i,useElement as a,useLayout as s,useRect as l,useTranslator as u,useAppLayout as c,useApp as p,useEmbed as f,useModel as m,usePromise as d,useImperativeHandle as h,onTakeSnapshot as g}from"@nebula.js/stardust";import y,{forwardRef as b,Suspense as v,lazy as q,useRef as x,useState as D,useEffect as S,createElement as E}from"react";import{styled as A,Box as C,Typography as I,Tooltip as w}from"@mui/material";import T from"react-dom";function M(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var N,F,L={exports:{}},k={};var O=(F||(F=1,L.exports=function(){if(N)return k;N=1;var e=y,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(e,n,a){var s,l={},u=null,c=null;for(s in void 0!==a&&(u=""+a),void 0!==n.key&&(u=""+n.key),void 0!==n.ref&&(c=n.ref),n)r.call(n,s)&&!i.hasOwnProperty(s)&&(l[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===l[s]&&(l[s]=n[s]);return{$$typeof:t,type:e,key:u,ref:c,props:l,_owner:o.current}}return k.Fragment=n,k.jsx=a,k.jsxs=a,k}()),L.exports);const P=b(((e,t)=>O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:O.jsx("path",{d:"M9 1v1H2v12h12V7h1v7a1 1 0 0 1-.883.993L14 15H2a1 1 0 0 1-.993-.883L1 14V2a1 1 0 0 1 .883-.993L2 1zm7-1v5h-1V1.706l-4.5 4.501-.707-.707L14.292 1H11V0z"})})));var V,_;var R=function(){if(_)return V;_=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},i=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,o=e.call(n,"constructor"),i=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!o&&!i)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return V=function e(){var t,n,r,l,u,c,p=arguments[0],f=1,m=arguments.length,d=!1;for("boolean"==typeof p&&(d=p,p=arguments[1]||{},f=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});f<m;++f)if(null!=(t=arguments[f]))for(n in t)r=s(p,n),p!==(l=s(t,n))&&(d&&l&&(i(l)||(u=o(l)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&i(r)?r:{},a(p,{name:n,newValue:e(d,c,l)})):void 0!==l&&a(p,{name:n,newValue:l}));return p},V}(),j=M(R);
/**
* @preserve IntegraXor Web SCADA - JavaScript Number Formatter
* http://www.integraxor.com/
* author: KPL, KHL
* (c)2011 ecava
* Dual licensed under the MIT or GPL Version 2 licenses.
*/
function H(e,t){if(!e||isNaN(+t))return t;const n=(t="-"===e.charAt(0)?-t:+t)<0?t=-t:0,r=e.match(/[^\d\-\+#]/g),o=r?.[r.length-1]||".",i=r&&r[1]&&r[0]||",";e=e.split(o);t=""+ +(t=t.toFixed(e[1]?.length));const a=e[1]?.lastIndexOf("0"),s=t.split(".");(!s[1]||s[1]&&s[1].length<=a)&&(t=(+t).toFixed(a+1));const l=e[0].split(i);e[0]=l.join("");const u=e[0]?.indexOf("0");if(u>-1)for(;s[0].length<e[0].length-u;)s[0]=`0${s[0]}`;else 0==+s[0]&&(s[0]="");(t=t.split("."))[0]=s[0];const c=l[1]&&l[l.length-1].length;if(c){const e=t[0];let n="";const r=e.length%c;for(let t=0,o=e.length;t<o;t++)n+=e.charAt(t),!((t-r+1)%c)&&t<o-c&&(n+=i);t[0]=n}return t[1]=e[1]&&t[1]?o+t[1]:"",(n?"-":"")+t[0]+t[1]}const z=e=>e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&"),$={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},B=/%$/,U=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,W=/^\(oct\)/i,Y=/^\(dec\)/i,G=/^\(hex\)/i,X=/^\(bin\)/i,K=/^\(rom\)/i,Z=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i;function J(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function Q(e,t,n){let r;return U.test(t)?e=J(e,Number(/\d{2}/.exec(t)[0]),t,n):W.test(t)?e=J(e,8,t,n):Y.test(t)?e=J(e,10,t,n):G.test(t)?e=J(e,16,t,n):X.test(t)?e=J(e,2,t,n):K.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",o=Number(String(e).slice(-3));const i=(e-o)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;o>0;)for(n=0;n<a.length;n++)if(a[n]<=o){r+=s[n],o-=a[n];break}for(n=0;n<i;n++)r=`M${r}`;t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase());return r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}class ee{constructor(e,t,n,r,o){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=o||"numeric",this.abbreviations=function(e){if(!e||!e.qNumericalAbbreviation)return $;const t={};return e.qNumericalAbbreviation.split(";").forEach((e=>{const n=e.split(":");2===n.length&&(t[n[0]]=n[1])})),t}(e),this.prepare()}clone(){const e=new ee(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}};const r=this._prepared;e=e.split(";"),r.positive.pattern=e[0],r.negative.pattern=e[1],Z.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Z.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1;r.positive.isFunctional&&(!r.negative||r.negative&&r.negative.isFunctional)||(te(r.positive,t,n),r.negative&&te(r.negative,t,n))}formatValue(e){let t,n,r,o,i,a,s,l=this._prepared,u="",c="";if(Number.isNaN(+e))return e;if(!1===l.pattern)return e.toString();e<0&&l.negative?(l=l.negative,e=-e):l=l.positive;const p=l.d,f=l.t;if(l.isFunctional)e=Q(e,l.pattern,p);else{if(l.percentage&&(e*=100),l.abbreviate){const t=this.abbreviations,r=Object.keys(t).map((e=>parseInt(e,10))).sort(((e,t)=>e>t?1:-1));let o,a,s=r[0];for(i=0,n=Number(Number(e).toExponential().split("e")[1]);s<=n&&i<r.length;)i++,s=r[i];i>0&&(o=r[i-1]),o&&n>0&&o>0?a=o:(n<0&&o<0||!o)&&(s<0&&s-n<=l.maxPrecision?a=s:o<=n&&!(s>0&&-n<=l.maxPrecision)&&(a=o)),a&&(u=t[a],e/=10**a)}if(r=Math.abs(e),t=l.temp,a=l.numericPattern,s=a.split(p)[1],"I"===this.type&&(e=Math.round(e)),o=e,s||"#"!==a.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number(e.toFixed(Math.min(20,s?s.length:0)).split(".")[0]);let n=a.split(p)[0];if(n+=p,e=H(n,t)||"0",s){const t=Math.max(0,Math.min(14,s.length)),n=s.replace(/#+$/,"").length;let o=(r%1+Number.EPSILON).toFixed(t);for(o=o.slice(2).replace(/0+$/,""),i=o.length;i<n;i++)o+="0";o&&(e+=p+o)}else 0===t&&(o=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=o.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),c=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",p));else{for(a+=p,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),i=0;i<t;i++)a+="#";e=H(a,e)}e=e.replace(l.numericRegex,(e=>e===f?l.groupTemp:e===p?l.decTemp:"")),o<0&&!/^-/.test(e)&&(e=`-${e}`)}return l.prefix+e+c+u+l.postfix}}function te(e,t,n){let r,o,i=e.pattern;i.indexOf("A")>=0&&(i=i.replace("A",""),e.abbreviate=!0);const a=function(e,t){t&&(t=z(t));e&&(e=z(e));return new RegExp(`(?:[#0]+${e})?[#0]+(?:${t}[#0]+)?`)}(t,n);let s=i.match(a);s=s?s[0]:"";const l=s?i.substr(0,i.indexOf(s)):i,u=s?i.substring(i.indexOf(s)+s.length):"";s||(s=i?"#":"##########"),t&&t===n&&(r=s.split(n),o=r.pop(),s=r.join("")+n+o,t="");const c=t;t=/,/.test(n)?"¤":",",c&&(s=s.replace(ne(c,"g"),t));const p=n;n=".",p&&(s=s.replace(ne(p,"g"),n));let f=s.match(/#/g);f=f?f.length:0;const m=i.split(p);let d;m[1]&&(d=m[1].match(/#|0/g)),e.prefix=l||"",e.postfix=u||"",e.pattern=i,e.maxPrecision=d?d.length:2,e.percentage=B.test(i),e.numericPattern=s||"",e.numericRegex=new RegExp(`${ne(t,null,!0)}|${ne(n,null,!0)}`,"g"),e.groupTemp=c,e.decTemp=p,e.t=t,e.d=n,e.temp=f}function ne(e,t,n){const r=z(e);return n?r:new RegExp(r||"",t)}ee.getStaticFormatter=function(){return{prepare(){},formatValue:e=>`${e}`}};const re=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],oe=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ie=["January","February","March","April","May","June","July","August","September","October","November","December"],ae=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function se(e,t){for(let n=e.length;n<t;n++)e=`0${e}`;return e}function le(e){let t=e.toString().split(".");return t[1]?(t=Number(`0.${t[1]}`),t):0}function ue(e){const t=e,n=24*le(t),r=60*le(n),o=60*le(r),i=1e3*le(o);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(o),f:Math.round(i)}}class ce{constructor(e,t){const n=e||{};n.qCalendarStrings||(n.qCalendarStrings={qLongDayNames:re,qDayNames:oe,qLongMonthNames:ie,qMonthNames:ae}),this.localeInfo=n,this.locale_days=n.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=n.qCalendarStrings.qDayNames.slice(),this.locale_months=n.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=n.qCalendarStrings.qMonthNames.slice(),this.pattern=t}clone(){const e=new ce(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+\]|\[|\]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getHours(),r=e.getDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getFullYear(),month:e.getMonth(),day:r,date:e.getDate(),h:n,m:e.getMinutes(),s:e.getSeconds(),f:e.getMilliseconds(),t:e.getHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t=`-${t}`),r=function(e,t){const n=ue(e),r=n.d;let o=n.h,i=n.m,a=n.s;const s=n.f;let l,u=0;return/w+|t+/gi.test(t)&&(l=new Date(1899,11,30+Math.floor(e),0,0,86400*(e-Math.floor(e))),Number.isNaN(+l.getTime())&&(l=null)),/D+/gi.test(t)||(o+=24*r),/h+/gi.test(t)||(i+=60*o),/m+/gi.test(t)||(a+=60*i),/w+/gi.test(t)&&(u=l?l.getDay()-1:0,u<0&&(u=6)),{year:0,month:0,day:u,date:r,h:o,m:i,s:a,f:s,t:l?l.getHours()>=12?"pm":"am":""}}(e,t));const o=function(e,t){return{"Y+|y+":{Y:`${Number(`${t.year}`.slice(-2))}`,YY:se(`${t.year}`.slice(-2),2),YYY:se(`${t.year}`.slice(-3),3),def:e=>se(`${t.year}`,e.length)},"M+":{M:t.month+1,MM:se(`${t.month+1}`,2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:se(`${t.day}`,2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>se(`${t.date}`,e.length)},"h+|H+":{h:t.h,def:e=>se(`${t.h}`,e.length)},"m+":{m:t.m,def:e=>se(`${t.m}`,e.length)},"s+|S+":{s:t.s,def:e=>se(`${t.s}`,e.length)},"f+|F+":{def(e){let n=`${t.f}`;const r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),i=[];for(const e in o)i.push(e);const a=new RegExp(i.join("|"),"g"),s=t.replace(a,(e=>{let t,n,r;for(n in o)if(t=new RegExp(n),t.test(e))break;if(!t)return"";for(const t in o[n])if(t===e||t.toLowerCase()===e){r=o[n][t],void 0===r&&(r=o[n][t.toLowerCase()]);break}return void 0===r&&(r=o[n].def),"function"==typeof r&&(r=r(e)),r}));return s}}ce.parseInterval=ue;const pe="U",fe="I",me="R",de="F",he="M",ge="D",ye="T",be="TS",ve="IV";class qe{constructor(e,t,n,r,o){const i=e||{};this.localeInfo=i,this.pattern=t||"",this.decimalDelimiter="string"==typeof r?r:"string"==typeof i.qDecimalSep?i.qDecimalSep:".",this.thousandDelimiter="string"==typeof n?n:"string"==typeof i.qThousandSep&&this.decimalDelimiter!==i.qThousandSep?i.qThousandSep:"",this.type=o||pe,o===pe&&(this.pattern=`#${this.decimalDelimiter}##A`),this._numberFormatter=new ee(e),this._dateFormatter=new ce(e),this.prepare()}clone(){return new qe(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type)}prepare(e,t,n){if(e||(e=this.pattern),!e)switch(this.type){case fe:e="##############";break;case me:e=Array(this.localeInfo.qnDec||11).join("#");break;case de:e=`#${this.localeInfo.qDecimalSep}`||`.${Array(this.localeInfo.qnDec||4).join("#")}`;break;case he:e=this.localeInfo.qMoneyFmt,n||(n=this.localeInfo.qMoneyDecimalSep||"."),t||n===this.localeInfo.qMoneyThousandSep||(t=this.localeInfo.qMoneyThousandSep);break;case ge:e=this.localeInfo.qDateFmt||"YYYY-MM-DD";break;case be:e=this.localeInfo.qTimestampFmt||"YYYY-MM-DD hh:mm:ss";break;case ye:case ve:e=this.localeInfo.qTimeFmt||"hh:mm:ss";break;default:e="##########"}this._numberFormatter.pattern=this.pattern,this._dateFormatter.pattern=this.pattern,this._numberFormatter.thousandDelimiter=this.thousandDelimiter,this._numberFormatter.decimalDelimiter=this.decimalDelimiter,this._numberFormatter.type=this.type,this._numberFormatter.prepare(e,t,n),this._prepared={pattern:e,t:t,d:n}}formatValue(e,t){let n;const r=this._prepared;if("NaN"===e||"number"==typeof e&&Number.isNaN(+e))return"-";if(Number.isNaN(+e)||"number"!=typeof e)return`${e}`;switch(this.type){case ge:case ye:case be:return n=new Date(1899,11,30+Math.floor(e),0,0,86400*(e-Math.floor(e))),Number.isNaN(+n.getTime())?this._numberFormatter.format(e,"0",r.t,r.d):this._dateFormatter.format(n,t||r.pattern);case ve:return this._dateFormatter.format(e,r.pattern);default:return this._numberFormatter.formatValue(e)}}format(e,t,n,r){return"NaN"===e||"number"==typeof e&&Number.isNaN(+e)?"-":Number.isNaN(+e)||"number"!=typeof e?`${e}`:(this.prepare(t,n,r),this.formatValue(e))}createPatternFromRange(e,t,n){let r,o="";const i=Number(Number(e).toExponential().split("e")[1]),a=Number(Number(t).toExponential().split("e")[1]),s=Math.min(Math.abs(i),Math.abs(a)),l=Math.abs(t-e);let u;const c=Number(Number(l/50).toExponential().split("e")[1]);let p;if(p=Math.abs(c),0===l)return`0${this.decimalDelimiter}##${n?"A":""}`;if(c>=0?p=n?Math.max(2,s-c):0:(u=(n?s-s%3:0)*(a<0?1:-1),p-=u),this.thousandDelimiter?o+=`#${this.thousandDelimiter}##0`:o+="0",p)for(o+=this.decimalDelimiter,r=0;r<p;r++)o+="#";return o+(n?"A":"")}}class xe{constructor(e,t){this.localeInfo=e;const n=this.getFormattersForMeasures(t);let r=j(!0,[],n);if(r&&1===r.length&&t[0].isCustomFormatted)r=null;else{let e=0;for(let n=0;n<r.length;n++)t[n].isCustomFormatted&&(r[n]=null,e++);e===r.length&&(r=null)}this.measureFormatters=r,this.combinedMeasuresFormatter=this.getFormatterFromFormatters(n)}createFormatter(){return new qe(this.localeInfo)}getLocaleInfo(){return this.localeInfo||{}}getFormatters(){return this.measureFormatters||[]}getMeasureFormatter(e){if(this.measureFormatters&&this.measureFormatters[e])return this.measureFormatters[e]}getCombinedMeasuresFormatter(){return this.combinedMeasuresFormatter}formatMeasure(e,t){const n=this.measureFormatters[t];return n?n.format(e):e}getFormatterFromFormatters(e){let t,n,r,o=0,i=0,a=0;const s=e?e.filter((e=>!!e.values&&!Number.isNaN(+e.values.range))):[];let l,u;return e&&e.length&&(e.forEach((e=>("U"===e.type||e.values&&Number.isNaN(+e.values.range)?i++:["D","T","TS","IV"].includes(e.type)?o=1:a=1,e.prepare(),e))),s.length&&(t=s.reduce(((e,t)=>Math.min(t.values.min,e)),s[0].values.min),n=s.reduce(((e,t)=>Math.max(t.values.max,e)),s[0].values.max),r=Math.abs(n-t)),o+a>1?(u=e.filter((e=>"datetime"!==e.type))[0]||{},l=new qe(this.localeInfo,u.pattern,u.thousandDelimiter,u.decimalDelimiter,"U"),Number.isNaN(+r)||(l.pattern=l.createPatternFromRange(t,n,!0))):o+a===1&&0===i?(u=e[0]||{},l=new qe(this.localeInfo,u.pattern,u.thousandDelimiter,u.decimalDelimiter,u.type)):(u=e.filter((e=>"U"!==e.type)),u=u.length?u[0]:e[0]||{},l=new qe(this.localeInfo,u.pattern,u.thousandDelimiter,u.decimalDelimiter,u.type),Number.isNaN(+r)||"U"!==u.type||(l.pattern=l.createPatternFromRange(t,n,!0))),l.prepare()),l||(l=new qe(this.localeInfo,"0")),l}getFormattersForMeasures(e,t){let n,r=[];return e&&e.length&&(n=t?e.filter(((e,n)=>t.indexOf(n)>=0)):e,r=n.map((function(e){const t=function(e){return!!e.qIsAutoFormat&&["M","D","T","TS","IV"].indexOf(e.qNumFormat.qType)<0}(e),n=new qe(this.localeInfo,e.qNumFormat.qFmt,e.qNumFormat.qThou,e.qNumFormat.qDec,t?"U":e.qNumFormat.qType),r=Math.abs(e.qMax-e.qMin),o=Number.isNaN(+r);return n.values={min:e.qMin,max:e.qMax,range:r},!o&&t&&(n.pattern=n.createPatternFromRange(e.qMin,e.qMax,!0)),n.prepare(),n}),this)),r}}function De(e,t){return!Number.isNaN(+e)&&"U"===t?.type}function Se(e,t){if("U"===t.type){const n=t.clone();return n.pattern=function(e){let t="0";const n=e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0;if(n){t+=".";for(let e=0;e<n;e++)t+="0"}return`${t}A`}(e),n.prepare(),n}return t}function Ee(e,t,n){const r={...n};return r.components[0].getText=e,r.components[1].getText=t,{layoutInfo:r,text:e()}}const Ae=e=>e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&"),{useState:Ce,useEffect:Ie}=y,we=({endValue:e,duration:t,formatter:n})=>{const[r,o]=Ce(e),[i,a]=Ce(null),s=(e,n,r,i,l)=>{if(i-l>=t)return void a(Math.random());o(n=e+(1-(l+t-i)/t)*r),window.requestAnimationFrame((t=>{s(e,n,r,t,l)}))};return Ie((()=>{if(r!==e){const t=performance.now();s(r,r,e-r,t,t)}}),[e]),Ie((()=>{null!==i&&o(e)}),[i]),O.jsx(O.Fragment,{children:n.format(r)})},{entries:Te,setPrototypeOf:Me,isFrozen:Ne,getPrototypeOf:Fe,getOwnPropertyDescriptor:Le}=Object;let{freeze:ke,seal:Oe,create:Pe}=Object,{apply:Ve,construct:_e}="undefined"!=typeof Reflect&&Reflect;ke||(ke=function(e){return e}),Oe||(Oe=function(e){return e}),Ve||(Ve=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return e.apply(t,r)}),_e||(_e=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const Re=et(Array.prototype.forEach),je=et(Array.prototype.lastIndexOf),He=et(Array.prototype.pop),ze=et(Array.prototype.push),$e=et(Array.prototype.splice),Be=et(String.prototype.toLowerCase),Ue=et(String.prototype.toString),We=et(String.prototype.match),Ye=et(String.prototype.replace),Ge=et(String.prototype.indexOf),Xe=et(String.prototype.trim),Ke=et(Object.prototype.hasOwnProperty),Ze=et(RegExp.prototype.test),Je=(Qe=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _e(Qe,t)});var Qe;function et(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Ve(e,t,r)}}function tt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Be;Me&&Me(e,null);let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(Ne(t)||(t[r]=e),o=e)}e[o]=!0}return e}function nt(e){for(let t=0;t<e.length;t++){Ke(e,t)||(e[t]=null)}return e}function rt(e){const t=Pe(null);for(const[n,r]of Te(e)){Ke(e,n)&&(Array.isArray(r)?t[n]=nt(r):r&&"object"==typeof r&&r.constructor===Object?t[n]=rt(r):t[n]=r)}return t}function ot(e,t){for(;null!==e;){const n=Le(e,t);if(n){if(n.get)return et(n.get);if("function"==typeof n.value)return et(n.value)}e=Fe(e)}return function(){return null}}const it=ke(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),at=ke(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),st=ke(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),lt=ke(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ut=ke(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ct=ke(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pt=ke(["#text"]),ft=ke(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),mt=ke(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),dt=ke(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ht=ke(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),gt=Oe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),yt=Oe(/<%[\w\W]*|[\w\W]*%>/gm),bt=Oe(/\$\{[\w\W]*/gm),vt=Oe(/^data-[\-\w.\u00B7-\uFFFF]+$/),qt=Oe(/^aria-[\-\w]+$/),xt=Oe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Dt=Oe(/^(?:\w+script|data):/i),St=Oe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Et=Oe(/^html$/i),At=Oe(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ct=Object.freeze({__proto__:null,ARIA_ATTR:qt,ATTR_WHITESPACE:St,CUSTOM_ELEMENT:At,DATA_ATTR:vt,DOCTYPE_NAME:Et,ERB_EXPR:yt,IS_ALLOWED_URI:xt,IS_SCRIPT_OR_DATA:Dt,MUSTACHE_EXPR:gt,TMPLIT_EXPR:bt});const It=1,wt=3,Tt=7,Mt=8,Nt=9,Ft=function(){return"undefined"==typeof window?null:window};var Lt=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ft();const n=t=>e(t);if(n.version="3.3.1",n.removed=[],!t||!t.document||t.document.nodeType!==Nt||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const o=r,i=o.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:u,NodeFilter:c,NamedNodeMap:p=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:f,DOMParser:m,trustedTypes:d}=t,h=u.prototype,g=ot(h,"cloneNode"),y=ot(h,"remove"),b=ot(h,"nextSibling"),v=ot(h,"childNodes"),q=ot(h,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let x,D="";const{implementation:S,createNodeIterator:E,createDocumentFragment:A,getElementsByTagName:C}=r,{importNode:I}=o;let w={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof Te&&"function"==typeof q&&S&&void 0!==S.createHTMLDocument;const{MUSTACHE_EXPR:T,ERB_EXPR:M,TMPLIT_EXPR:N,DATA_ATTR:F,ARIA_ATTR:L,IS_SCRIPT_OR_DATA:k,ATTR_WHITESPACE:O,CUSTOM_ELEMENT:P}=Ct;let{IS_ALLOWED_URI:V}=Ct,_=null;const R=tt({},[...it,...at,...st,...ut,...pt]);let j=null;const H=tt({},[...ft,...mt,...dt,...ht]);let z=Object.seal(Pe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,B=null;const U=Object.seal(Pe(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let W=!0,Y=!0,G=!1,X=!0,K=!1,Z=!0,J=!1,Q=!1,ee=!1,te=!1,ne=!1,re=!1,oe=!0,ie=!1,ae=!0,se=!1,le={},ue=null;const ce=tt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let pe=null;const fe=tt({},["audio","video","img","source","image","track"]);let me=null;const de=tt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),he="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",ye="http://www.w3.org/1999/xhtml";let be=ye,ve=!1,qe=null;const xe=tt({},[he,ge,ye],Ue);let De=tt({},["mi","mo","mn","ms","mtext"]),Se=tt({},["annotation-xml"]);const Ee=tt({},["title","style","font","a","script"]);let Ae=null;const Ce=["application/xhtml+xml","text/html"];let Ie=null,we=null;const Me=r.createElement("form"),Ne=function(e){return e instanceof RegExp||e instanceof Function},Fe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!we||we!==e){if(e&&"object"==typeof e||(e={}),e=rt(e),Ae=-1===Ce.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ie="application/xhtml+xml"===Ae?Ue:Be,_=Ke(e,"ALLOWED_TAGS")?tt({},e.ALLOWED_TAGS,Ie):R,j=Ke(e,"ALLOWED_ATTR")?tt({},e.ALLOWED_ATTR,Ie):H,qe=Ke(e,"ALLOWED_NAMESPACES")?tt({},e.ALLOWED_NAMESPACES,Ue):xe,me=Ke(e,"ADD_URI_SAFE_ATTR")?tt(rt(de),e.ADD_URI_SAFE_ATTR,Ie):de,pe=Ke(e,"ADD_DATA_URI_TAGS")?tt(rt(fe),e.ADD_DATA_URI_TAGS,Ie):fe,ue=Ke(e,"FORBID_CONTENTS")?tt({},e.FORBID_CONTENTS,Ie):ce,$=Ke(e,"FORBID_TAGS")?tt({},e.FORBID_TAGS,Ie):rt({}),B=Ke(e,"FORBID_ATTR")?tt({},e.FORBID_ATTR,Ie):rt({}),le=!!Ke(e,"USE_PROFILES")&&e.USE_PROFILES,W=!1!==e.ALLOW_ARIA_ATTR,Y=!1!==e.ALLOW_DATA_ATTR,G=e.ALLOW_UNKNOWN_PROTOCOLS||!1,X=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,K=e.SAFE_FOR_TEMPLATES||!1,Z=!1!==e.SAFE_FOR_XML,J=e.WHOLE_DOCUMENT||!1,te=e.RETURN_DOM||!1,ne=e.RETURN_DOM_FRAGMENT||!1,re=e.RETURN_TRUSTED_TYPE||!1,ee=e.FORCE_BODY||!1,oe=!1!==e.SANITIZE_DOM,ie=e.SANITIZE_NAMED_PROPS||!1,ae=!1!==e.KEEP_CONTENT,se=e.IN_PLACE||!1,V=e.ALLOWED_URI_REGEXP||xt,be=e.NAMESPACE||ye,De=e.MATHML_TEXT_INTEGRATION_POINTS||De,Se=e.HTML_INTEGRATION_POINTS||Se,z=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ne(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ne(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(z.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),K&&(Y=!1),ne&&(te=!0),le&&(_=tt({},pt),j=[],!0===le.html&&(tt(_,it),tt(j,ft)),!0===le.svg&&(tt(_,at),tt(j,mt),tt(j,ht)),!0===le.svgFilters&&(tt(_,st),tt(j,mt),tt(j,ht)),!0===le.mathMl&&(tt(_,ut),tt(j,dt),tt(j,ht))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?U.tagCheck=e.ADD_TAGS:(_===R&&(_=rt(_)),tt(_,e.ADD_TAGS,Ie))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?U.attributeCheck=e.ADD_ATTR:(j===H&&(j=rt(j)),tt(j,e.ADD_ATTR,Ie))),e.ADD_URI_SAFE_ATTR&&tt(me,e.ADD_URI_SAFE_ATTR,Ie),e.FORBID_CONTENTS&&(ue===ce&&(ue=rt(ue)),tt(ue,e.FORBID_CONTENTS,Ie)),e.ADD_FORBID_CONTENTS&&(ue===ce&&(ue=rt(ue)),tt(ue,e.ADD_FORBID_CONTENTS,Ie)),ae&&(_["#text"]=!0),J&&tt(_,["html","head","body"]),_.table&&(tt(_,["tbody"]),delete $.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Je('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Je('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=e.TRUSTED_TYPES_POLICY,D=x.createHTML("")}else void 0===x&&(x=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(d,i)),null!==x&&"string"==typeof D&&(D=x.createHTML(""));ke&&ke(e),we=e}},Le=tt({},[...at,...st,...lt]),Oe=tt({},[...ut,...ct]),Ve=function(e){ze(n.removed,{element:e});try{q(e).removeChild(e)}catch(t){y(e)}},_e=function(e,t){try{ze(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){ze(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(te||ne)try{Ve(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Qe=function(e){let t=null,n=null;if(ee)e="<remove></remove>"+e;else{const t=We(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ae&&be===ye&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=x?x.createHTML(e):e;if(be===ye)try{t=(new m).parseFromString(o,Ae)}catch(e){}if(!t||!t.documentElement){t=S.createDocument(be,"template",null);try{t.documentElement.innerHTML=ve?D:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),be===ye?C.call(t,J?"html":"body")[0]:J?t.documentElement:i},et=function(e){return E.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},nt=function(e){return e instanceof f&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof p)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},gt=function(e){return"function"==typeof l&&e instanceof l};function yt(e,t,r){Re(e,(e=>{e.call(n,t,r,we)}))}const bt=function(e){let t=null;if(yt(w.beforeSanitizeElements,e,null),nt(e))return Ve(e),!0;const r=Ie(e.nodeName);if(yt(w.uponSanitizeElement,e,{tagName:r,allowedTags:_}),Z&&e.hasChildNodes()&&!gt(e.firstElementChild)&&Ze(/<[/\w!]/g,e.innerHTML)&&Ze(/<[/\w!]/g,e.textContent))return Ve(e),!0;if(e.nodeType===Tt)return Ve(e),!0;if(Z&&e.nodeType===Mt&&Ze(/<[/\w]/g,e.data))return Ve(e),!0;if(!(U.tagCheck instanceof Function&&U.tagCheck(r))&&(!_[r]||$[r])){if(!$[r]&&qt(r)){if(z.tagNameCheck instanceof RegExp&&Ze(z.tagNameCheck,r))return!1;if(z.tagNameCheck instanceof Function&&z.tagNameCheck(r))return!1}if(ae&&!ue[r]){const t=q(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const o=g(n[r],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,b(e))}}}return Ve(e),!0}return e instanceof u&&!function(e){let t=q(e);t&&t.tagName||(t={namespaceURI:be,tagName:"template"});const n=Be(e.tagName),r=Be(t.tagName);return!!qe[e.namespaceURI]&&(e.namespaceURI===ge?t.namespaceURI===ye?"svg"===n:t.namespaceURI===he?"svg"===n&&("annotation-xml"===r||De[r]):Boolean(Le[n]):e.namespaceURI===he?t.namespaceURI===ye?"math"===n:t.namespaceURI===ge?"math"===n&&Se[r]:Boolean(Oe[n]):e.namespaceURI===ye?!(t.namespaceURI===ge&&!Se[r])&&!(t.namespaceURI===he&&!De[r])&&!Oe[n]&&(Ee[n]||!Le[n]):!("application/xhtml+xml"!==Ae||!qe[e.namespaceURI]))}(e)?(Ve(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!Ze(/<\/no(script|embed|frames)/i,e.innerHTML)?(K&&e.nodeType===wt&&(t=e.textContent,Re([T,M,N],(e=>{t=Ye(t,e," ")})),e.textContent!==t&&(ze(n.removed,{element:e.cloneNode()}),e.textContent=t)),yt(w.afterSanitizeElements,e,null),!1):(Ve(e),!0)},vt=function(e,t,n){if(oe&&("id"===t||"name"===t)&&(n in r||n in Me))return!1;if(Y&&!B[t]&&Ze(F,t));else if(W&&Ze(L,t));else if(U.attributeCheck instanceof Function&&U.attributeCheck(t,e));else if(!j[t]||B[t]){if(!(qt(e)&&(z.tagNameCheck instanceof RegExp&&Ze(z.tagNameCheck,e)||z.tagNameCheck instanceof Function&&z.tagNameCheck(e))&&(z.attributeNameCheck instanceof RegExp&&Ze(z.attributeNameCheck,t)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(t,e))||"is"===t&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&Ze(z.tagNameCheck,n)||z.tagNameCheck instanceof Function&&z.tagNameCheck(n))))return!1}else if(me[t]);else if(Ze(V,Ye(n,O,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Ge(n,"data:")||!pe[e]){if(G&&!Ze(k,Ye(n,O,"")));else if(n)return!1}else;return!0},qt=function(e){return"annotation-xml"!==e&&We(e,P)},Dt=function(e){yt(w.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||nt(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j,forceKeepAttr:void 0};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:s,value:l}=i,u=Ie(a),c=l;let p="value"===a?c:Xe(c);if(r.attrName=u,r.attrValue=p,r.keepAttr=!0,r.forceKeepAttr=void 0,yt(w.uponSanitizeAttribute,e,r),p=r.attrValue,!ie||"id"!==u&&"name"!==u||(_e(a,e),p="user-content-"+p),Z&&Ze(/((--!?|])>)|<\/(style|title|textarea)/i,p)){_e(a,e);continue}if("attributename"===u&&We(p,"href")){_e(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){_e(a,e);continue}if(!X&&Ze(/\/>/i,p)){_e(a,e);continue}K&&Re([T,M,N],(e=>{p=Ye(p,e," ")}));const f=Ie(e.nodeName);if(vt(f,u,p)){if(x&&"object"==typeof d&&"function"==typeof d.getAttributeType)if(s);else switch(d.getAttributeType(f,u)){case"TrustedHTML":p=x.createHTML(p);break;case"TrustedScriptURL":p=x.createScriptURL(p)}if(p!==c)try{s?e.setAttributeNS(s,a,p):e.setAttribute(a,p),nt(e)?Ve(e):He(n.removed)}catch(t){_e(a,e)}}else _e(a,e)}yt(w.afterSanitizeAttributes,e,null)},St=function e(t){let n=null;const r=et(t);for(yt(w.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)yt(w.uponSanitizeShadowNode,n,null),bt(n),Dt(n),n.content instanceof a&&e(n.content);yt(w.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,s=null,u=null;if(ve=!e,ve&&(e="\x3c!--\x3e"),"string"!=typeof e&&!gt(e)){if("function"!=typeof e.toString)throw Je("toString is not a function");if("string"!=typeof(e=e.toString()))throw Je("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Q||Fe(t),n.removed=[],"string"==typeof e&&(se=!1),se){if(e.nodeName){const t=Ie(e.nodeName);if(!_[t]||$[t])throw Je("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)r=Qe("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),i.nodeType===It&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!te&&!K&&!J&&-1===e.indexOf("<"))return x&&re?x.createHTML(e):e;if(r=Qe(e),!r)return te?null:re?D:""}r&&ee&&Ve(r.firstChild);const c=et(se?e:r);for(;s=c.nextNode();)bt(s),Dt(s),s.content instanceof a&&St(s.content);if(se)return e;if(te){if(ne)for(u=A.call(r.ownerDocument);r.firstChild;)u.appendChild(r.firstChild);else u=r;return(j.shadowroot||j.shadowrootmode)&&(u=I.call(o,u,!0)),u}let p=J?r.outerHTML:r.innerHTML;return J&&_["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&Ze(Et,r.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+p),K&&Re([T,M,N],(e=>{p=Ye(p,e," ")})),x&&re?x.createHTML(p):p},n.setConfig=function(){Fe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Q=!0},n.clearConfig=function(){we=null,Q=!1},n.isValidAttribute=function(e,t,n){we||Fe({});const r=Ie(e),o=Ie(t);return vt(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&ze(w[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=je(w[e],t);return-1===n?void 0:$e(w[e],n,1)[0]}return He(w[e])},n.removeHooks=function(e){w[e]=[]},n.removeAllHooks=function(){w={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),kt={fromSearchString:function(e){if(!e)return[];"?"===e[0]&&(e=e.substr(1));const t=[];return e.split("&").forEach((e=>{if(!e)return;const n=e.indexOf("=");let r,o="",i=!1;-1===n?r=e:(r=e.slice(0,n),o=e.slice(n+1),i=!0),t.push(function(e,t,n){return{key:Ot(e),value:Ot(t),useEqualSign:n}}(r,o,i))})),t}};function Ot(e){try{return decodeURIComponent(e)}catch{return e}}function Pt(e){if(!(this instanceof Pt))throw new Error("Url needs to be called with the new keyword");if(!e)throw new Error("Url needs a string to operate on");const t=function(e){const t={authorityAndPath:"",search:"",hash:""};let n=e.indexOf("#");-1!==n&&(t.hash=e.substr(n),e=e.substr(0,n));n=e.indexOf("?"),-1!==n&&(t.search=e.substr(n),e=e.substr(0,n));return t.authorityAndPath=e,t}(e);Object.defineProperties(this,{authorityAndPath:{value:t.authorityAndPath},search:{value:t.search},hash:{value:t.hash},searchParams:{get:()=>kt.fromSearchString(t.search)}})}function Vt(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";")}Pt.encodeAuthorityAndPath=function(e){return encodeURI(e).replace(/%5B/gi,"[").replace(/%5D/gi,"]").replace(/%25/gi,"%")},Pt.encodeSearchParams=function(e){let t,n="";for(let r=0;r<e.length;r++)t=e[r],n+=0===r?"?":"&",n+=Vt(t.key),t.value?n+=`=${Vt(t.value)}`:n+=t.useEqualSign?"=":"";return n};var _t=Pt;var Rt,jt=class{_hasNext(){return null!=this._input&&(0!==this._input.length&&this._index<this._input.length)}constructor(e){this._input=e,this._pushback=null,this._temp=null,this._index=0,this._mark=0}pushback(e){this._pushback=e}index(){return this._index}hasNext(){return null!=this._pushback||this._hasNext()}next(){if(null!=this._pushback){const e=this._pushback;return this._pushback=null,e}return this._hasNext()?this._input.charAt(this._index++):null}nextHex(){const e=this.next();return null==e?null:e.match(/[0-9A-Fa-f]/)?e:null}peek(e){return e?!(!this._pushback||this._pushback!==e)||!!this._hasNext()&&this._input.charAt(this._index)===e:this._pushback?this._pushback:this._hasNext()?this._input.charAt(this._index):null}mark(){this._temp=this._pushback,this._mark=this._index}reset(){this._pushback=this._temp,this._index=this._mark}remainder(){let e=this._input.substr(this._index);return null!=this._pushback&&(e=this._pushback+e),e}},Ht=class{decode(e){let t="";const n=new jt(e);let r;for(;n.hasNext();)r=this.decodeCharacter(n),t+=null!=r?r:n.next();return t}decodeCharacter(e){return e.next()}},zt=e=>e>=0&&e<=1114111,$t=e=>e.match(/[\s]/),Bt=class extends Ht{decodeCharacter(e){e.mark();const t=e.next();let n,r,o;if(null==t||"\\"!==t)return e.reset(),null;const i=e.next();if(null==i)return e.reset(),null;switch(i){case"\r":e.peek("\n")&&e.next();case"\n":case"\f":case"\0":return this.decodeCharacter(e)}if("NaN"===parseInt(i,16))return i;for(n=i,r=0;r<5&&(o=e.next(),null!=o&&!$t(o));r++){if("NaN"===parseInt(o,16)){e.pushback(o);break}n+=o}const a=parseInt(n,16);return zt(a)?String.fromCharCode(a):"�"}},Ut=class e{constructor(e,t){this._key=e,this._value=t}getKey(){return this._key}getValue(){return this._value}equals(t){return t instanceof e&&(this._key===t._key&&this._value===t._value)}static newInstanceIfNeeded(){let t,n,r=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=r.length):(n=arguments[1],t=arguments[2]),t&&r?(r.length>n&&(r=r.substr(0,n)),new e(r,t)):null}},Wt=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,r){let o,i;if(t.length===n)return i=this._value,this.setValue(r),i;const a=t.charAt(n);return this._nextMap?(o=this._nextMap[a],o||(o=new e,this._nextMap[a]=o)):(this._nextMap={},o=new e,this._nextMap[a]=o),o.put(t,n+1,r)}get(e,t){if(e.length<=t)return this._value;const n=this.getNextNode(e.charAt(t));return n?n.get(e,t+1):null}getLongestMatch(e,t){if(e.length<=t)return Ut.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return Ut.newInstanceIfNeeded(e,t,this._value);const r=n.getLongestMatch(e,t+1);return r||Ut.newInstanceIfNeeded(e,t,this._value)}},Yt=class{constructor(){this.clear()}getLongestMatch(e){return this.root&&e?this.root.getLongestMatch(e,0):null}getMaxKeyLength(){return this.maxKeyLen}clear(){this.root=null,this.maxKeyLen=0,this.size=0}put(e,t){this.root||(this.root=new Wt);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}},Gt=(()=>{const e=[],t=[],n=new Yt;let r,o,i;for(r in e["""]="34",e["&"]="38",e["<"]="60",e[">"]="62",e[" "]="160",e["¡"]="161",e["¢"]="162",e["£"]="163",e["¤"]="164",e["¥"]="165",e["¦"]="166",e["§"]="167",e["¨"]="168",e["©"]="169",e["ª"]="170",e["«"]="171",e["¬"]="172",e["­"]="173",e["®"]="174",e["¯"]="175",e["°"]="176",e["±"]="177",e["²"]="178",e["³"]="179",e["´"]="180",e["µ"]="181",e["¶"]="182",e["·"]="183",e["¸"]="184",e["¹"]="185",e["º"]="186",e["»"]="187",e["¼"]="188",e["½"]="189",e["¾"]="190",e["¿"]="191",e["À"]="192",e["Á"]="193",e["Â"]="194",e["Ã"]="195",e["Ä"]="196",e["Å"]="197",e["Æ"]="198",e["Ç"]="199",e["È"]="200",e["É"]="201",e["Ê"]="202",e["Ë"]="203",e["Ì"]="204",e["Í"]="205",e["Î"]="206",e["Ï"]="207",e["Ð"]="208",e["Ñ"]="209",e["Ò"]="210",e["Ó"]="211",e["Ô"]="212",e["Õ"]="213",e["Ö"]="214",e["×"]="215",e["Ø"]="216",e["Ù"]="217",e["Ú"]="218",e["Û"]="219",e["Ü"]="220",e["Ý"]="221",e["Þ"]="222",e["ß"]="223",e["à"]="224",e["á"]="225",e["â"]="226",e["ã"]="227",e["ä"]="228",e["å"]="229",e["æ"]="230",e["ç"]="231",e["è"]="232",e["é"]="233",e["ê"]="234",e["ë"]="235",e["ì"]="236",e["í"]="237",e["î"]="238",e["ï"]="239",e["ð"]="240",e["ñ"]="241",e["ò"]="242",e["ó"]="243",e["ô"]="244",e["õ"]="245",e["ö"]="246",e["÷"]="247",e["ø"]="248",e["ù"]="249",e["ú"]="250",e["û"]="251",e["ü"]="252",e["ý"]="253",e["þ"]="254",e["ÿ"]="255",e["&OElig"]="338",e["&oelig"]="339",e["&Scaron"]="352",e["&scaron"]="353",e["&Yuml"]="376",e["&fnof"]="402",e["&circ"]="710",e["&tilde"]="732",e["&Alpha"]="913",e["&Beta"]="914",e["&Gamma"]="915",e["&Delta"]="916",e["&Epsilon"]="917",e["&Zeta"]="918",e["&Eta"]="919",e["&Theta"]="920",e["&Iota"]="921",e["&Kappa"]="922",e["&Lambda"]="923",e["&Mu"]="924",e["&Nu"]="925",e["&Xi"]="926",e["&Omicron"]="927",e["&Pi"]="928",e["&Rho"]="929",e["&Sigma"]="931",e["&Tau"]="932",e["&Upsilon"]="933",e["&Phi"]="934",e["&Chi"]="935",e["&Psi"]="936",e["&Omega"]="937",e["&alpha"]="945",e["&beta"]="946",e["&gamma"]="947",e["&delta"]="948",e["&epsilon"]="949",e["&zeta"]="950",e["&eta"]="951",e["&theta"]="952",e["&iota"]="953",e["&kappa"]="954",e["&lambda"]="955",e["&mu"]="956",e["&nu"]="957",e["&xi"]="958",e["&omicron"]="959",e["&pi"]="960",e["&rho"]="961",e["&sigmaf"]="962",e["&sigma"]="963",e["&tau"]="964",e["&upsilon"]="965",e["&phi"]="966",e["&chi"]="967",e["&psi"]="968",e["&omega"]="969",e["&thetasym"]="977",e["&upsih"]="978",e["&piv"]="982",e["&ensp"]="8194",e["&emsp"]="8195",e["&thinsp"]="8201",e["&zwnj"]="8204",e["&zwj"]="8205",e["&lrm"]="8206",e["&rlm"]="8207",e["&ndash"]="8211",e["&mdash"]="8212",e["&lsquo"]="8216",e["&rsquo"]="8217",e["&sbquo"]="8218",e["&ldquo"]="8220",e["&rdquo"]="8221",e["&bdquo"]="8222",e["&dagger"]="8224",e["&Dagger"]="8225",e["&bull"]="8226",e["&hellip"]="8230",e["&permil"]="8240",e["&prime"]="8242",e["&Prime"]="8243",e["&lsaquo"]="8249",e["&rsaquo"]="8250",e["&oline"]="8254",e["&frasl"]="8260",e["&euro"]="8364",e["&image"]="8365",e["&weierp"]="8472",e["&real"]="8476",e["&trade"]="8482",e["&alefsym"]="8501",e["&larr"]="8592",e["&uarr"]="8593",e["&rarr"]="8594",e["&darr"]="8595",e["&harr"]="8596",e["&crarr"]="8629",e["&lArr"]="8656",e["&uArr"]="8657",e["&rArr"]="8658",e["&dArr"]="8659",e["&hArr"]="8660",e["&forall"]="8704",e["&part"]="8706",e["&exist"]="8707",e["&empty"]="8709",e["&nabla"]="8711",e["&isin"]="8712",e["¬in"]="8713",e["&ni"]="8715",e["&prod"]="8719",e["&sum"]="8721",e["&minus"]="8722",e["&lowast"]="8727",e["&radic"]="8730",e["&prop"]="8733",e["&infin"]="8734",e["&ang"]="8736",e["&and"]="8743",e["&or"]="8744",e["&cap"]="8745",e["&cup"]="8746",e["&int"]="8747",e["&there4"]="8756",e["&sim"]="8764",e["&cong"]="8773",e["&asymp"]="8776",e["&ne"]="8800",e["&equiv"]="8801",e["&le"]="8804",e["&ge"]="8805",e["&sub"]="8834",e["&sup"]="8835",e["&nsub"]="8836",e["&sube"]="8838",e["&supe"]="8839",e["&oplus"]="8853",e["&otimes"]="8855",e["&perp"]="8869",e["&sdot"]="8901",e["&lceil"]="8968",e["&rceil"]="8969",e["&lfloor"]="8970",e["&rfloor"]="8971",e["&lang"]="9001",e["&rang"]="9002",e["&loz"]="9674",e["&spades"]="9824",e["&clubs"]="9827",e["&hearts"]="9829",e["&diams"]="9830",e)"function"!=typeof e[r]&&e.hasOwnProperty(r)&&(t[e[r]]=r);for(o in t)"function"!=typeof t[o]&&t.hasOwnProperty(o)&&(i=t[o].toLowerCase().substr(1),n.put(i,String.fromCharCode(o)));return n})(),Xt=class extends Ht{decodeCharacter(e){let t;e.mark();const n=e.next();if(null==n||"&"!==n)return e.reset(),null;const r=e.next();if(null==r)return e.reset(),null;if("#"===r){if(t=this.