/home/nbcgowuy/kdosheleads.com/wp-content/plugins/getgenie/assets/dist/admin/js/blog-wizard.js
(()=>{var Pv=Object.create;var rl=Object.defineProperty;var Av=Object.getOwnPropertyDescriptor;var Nv=Object.getOwnPropertyNames;var Rv=Object.getPrototypeOf,Iv=Object.prototype.hasOwnProperty;var Dr=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+n+'" is not supported')});var vt=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),ui=(n,e)=>{for(var t in e)rl(n,t,{get:e[t],enumerable:!0})},Lv=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Nv(e))!Iv.call(n,s)&&s!==t&&rl(n,s,{get:()=>e[s],enumerable:!(i=Av(e,s))||i.enumerable});return n};var be=(n,e,t)=>(t=n!=null?Pv(Rv(n)):{},Lv(e||!n||!n.__esModule?rl(t,"default",{value:n,enumerable:!0}):t,n));var mu=vt((ll,cl)=>{(function(n,e){typeof Dr=="function"&&typeof ll=="object"&&typeof cl=="object"?cl.exports=e():typeof define=="function"&&define.amd?define(function(){return e()}):n.pluralize=e()})(ll,function(){var n=[],e=[],t={},i={},s={};function r(g){return typeof g=="string"?new RegExp("^"+g+"$","i"):g}function o(g,m){return g===m?m:g===g.toLowerCase()?m.toLowerCase():g===g.toUpperCase()?m.toUpperCase():g[0]===g[0].toUpperCase()?m.charAt(0).toUpperCase()+m.substr(1).toLowerCase():m.toLowerCase()}function a(g,m){return g.replace(/\$(\d{1,2})/g,function(v,x){return m[x]||""})}function c(g,m){return g.replace(m[0],function(v,x){var _=a(m[1],arguments);return o(v===""?g[x-1]:v,_)})}function d(g,m,v){if(!g.length||t.hasOwnProperty(g))return m;for(var x=v.length;x--;){var _=v[x];if(_[0].test(m))return c(m,_)}return m}function h(g,m,v){return function(x){var _=x.toLowerCase();return m.hasOwnProperty(_)?o(x,_):g.hasOwnProperty(_)?o(x,g[_]):d(_,x,v)}}function f(g,m,v,x){return function(_){var S=_.toLowerCase();return m.hasOwnProperty(S)?!0:g.hasOwnProperty(S)?!1:d(S,S,v)===S}}function y(g,m,v){var x=m===1?y.singular(g):y.plural(g);return(v?m+" ":"")+x}return y.plural=h(s,i,n),y.isPlural=f(s,i,n),y.singular=h(i,s,e),y.isSingular=f(i,s,e),y.addPluralRule=function(g,m){n.push([r(g),m])},y.addSingularRule=function(g,m){e.push([r(g),m])},y.addUncountableRule=function(g){if(typeof g=="string"){t[g.toLowerCase()]=!0;return}y.addPluralRule(g,"$0"),y.addSingularRule(g,"$0")},y.addIrregularRule=function(g,m){m=m.toLowerCase(),g=g.toLowerCase(),s[g]=m,i[m]=g},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(g){return y.addIrregularRule(g[0],g[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(g){return y.addPluralRule(g[0],g[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(g){return y.addSingularRule(g[0],g[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(y.addUncountableRule),y})});var yu=vt((eE,$v)=>{$v.exports={"105":"i","192":"A","193":"A","194":"A","195":"A","196":"A","197":"A","199":"C","200":"E","201":"E","202":"E","203":"E","204":"I","205":"I","206":"I","207":"I","209":"N","210":"O","211":"O","212":"O","213":"O","214":"O","216":"O","217":"U","218":"U","219":"U","220":"U","221":"Y","224":"a","225":"a","226":"a","227":"a","228":"a","229":"a","231":"c","232":"e","233":"e","234":"e","235":"e","236":"i","237":"i","238":"i","239":"i","241":"n","242":"o","243":"o","244":"o","245":"o","246":"o","248":"o","249":"u","250":"u","251":"u","252":"u","253":"y","255":"y","256":"A","257":"a","258":"A","259":"a","260":"A","261":"a","262":"C","263":"c","264":"C","265":"c","266":"C","267":"c","268":"C","269":"c","270":"D","271":"d","272":"D","273":"d","274":"E","275":"e","276":"E","277":"e","278":"E","279":"e","280":"E","281":"e","282":"E","283":"e","284":"G","285":"g","286":"G","287":"g","288":"G","289":"g","290":"G","291":"g","292":"H","293":"h","294":"H","295":"h","296":"I","297":"i","298":"I","299":"i","300":"I","301":"i","302":"I","303":"i","304":"I","308":"J","309":"j","310":"K","311":"k","313":"L","314":"l","315":"L","316":"l","317":"L","318":"l","319":"L","320":"l","321":"L","322":"l","323":"N","324":"n","325":"N","326":"n","327":"N","328":"n","332":"O","333":"o","334":"O","335":"o","336":"O","337":"o","338":"O","339":"o","340":"R","341":"r","342":"R","343":"r","344":"R","345":"r","346":"S","347":"s","348":"S","349":"s","350":"S","351":"s","352":"S","353":"s","354":"T","355":"t","356":"T","357":"t","358":"T","359":"t","360":"U","361":"u","362":"U","363":"u","364":"U","365":"u","366":"U","367":"u","368":"U","369":"u","370":"U","371":"u","372":"W","373":"w","374":"Y","375":"y","376":"Y","377":"Z","378":"z","379":"Z","380":"z","381":"Z","382":"z","384":"b","385":"B","386":"B","387":"b","390":"O","391":"C","392":"c","393":"D","394":"D","395":"D","396":"d","398":"E","400":"E","401":"F","402":"f","403":"G","407":"I","408":"K","409":"k","410":"l","412":"M","413":"N","414":"n","415":"O","416":"O","417":"o","420":"P","421":"p","422":"R","427":"t","428":"T","429":"t","430":"T","431":"U","432":"u","434":"V","435":"Y","436":"y","437":"Z","438":"z","461":"A","462":"a","463":"I","464":"i","465":"O","466":"o","467":"U","468":"u","477":"e","484":"G","485":"g","486":"G","487":"g","488":"K","489":"k","490":"O","491":"o","500":"G","501":"g","504":"N","505":"n","512":"A","513":"a","514":"A","515":"a","516":"E","517":"e","518":"E","519":"e","520":"I","521":"i","522":"I","523":"i","524":"O","525":"o","526":"O","527":"o","528":"R","529":"r","530":"R","531":"r","532":"U","533":"u","534":"U","535":"u","536":"S","537":"s","538":"T","539":"t","542":"H","543":"h","544":"N","545":"d","548":"Z","549":"z","550":"A","551":"a","552":"E","553":"e","558":"O","559":"o","562":"Y","563":"y","564":"l","565":"n","566":"t","567":"j","570":"A","571":"C","572":"c","573":"L","574":"T","575":"s","576":"z","579":"B","580":"U","581":"V","582":"E","583":"e","584":"J","585":"j","586":"Q","587":"q","588":"R","589":"r","590":"Y","591":"y","592":"a","593":"a","595":"b","596":"o","597":"c","598":"d","599":"d","600":"e","603":"e","604":"e","605":"e","606":"e","607":"j","608":"g","609":"g","610":"g","613":"h","614":"h","616":"i","618":"i","619":"l","620":"l","621":"l","623":"m","624":"m","625":"m","626":"n","627":"n","628":"n","629":"o","633":"r","634":"r","635":"r","636":"r","637":"r","638":"r","639":"r","640":"r","641":"r","642":"s","647":"t","648":"t","649":"u","651":"v","652":"v","653":"w","654":"y","655":"y","656":"z","657":"z","663":"c","665":"b","666":"e","667":"g","668":"h","669":"j","670":"k","671":"l","672":"q","686":"h","688":"h","690":"j","691":"r","692":"r","694":"r","695":"w","696":"y","737":"l","738":"s","739":"x","780":"v","829":"x","851":"x","867":"a","868":"e","869":"i","870":"o","871":"u","872":"c","873":"d","874":"h","875":"m","876":"r","877":"t","878":"v","879":"x","7424":"a","7427":"b","7428":"c","7429":"d","7431":"e","7432":"e","7433":"i","7434":"j","7435":"k","7436":"l","7437":"m","7438":"n","7439":"o","7440":"o","7441":"o","7442":"o","7443":"o","7446":"o","7447":"o","7448":"p","7449":"r","7450":"r","7451":"t","7452":"u","7453":"u","7454":"u","7455":"m","7456":"v","7457":"w","7458":"z","7522":"i","7523":"r","7524":"u","7525":"v","7680":"A","7681":"a","7682":"B","7683":"b","7684":"B","7685":"b","7686":"B","7687":"b","7690":"D","7691":"d","7692":"D","7693":"d","7694":"D","7695":"d","7696":"D","7697":"d","7698":"D","7699":"d","7704":"E","7705":"e","7706":"E","7707":"e","7710":"F","7711":"f","7712":"G","7713":"g","7714":"H","7715":"h","7716":"H","7717":"h","7718":"H","7719":"h","7720":"H","7721":"h","7722":"H","7723":"h","7724":"I","7725":"i","7728":"K","7729":"k","7730":"K","7731":"k","7732":"K","7733":"k","7734":"L","7735":"l","7738":"L","7739":"l","7740":"L","7741":"l","7742":"M","7743":"m","7744":"M","7745":"m","7746":"M","7747":"m","7748":"N","7749":"n","7750":"N","7751":"n","7752":"N","7753":"n","7754":"N","7755":"n","7764":"P","7765":"p","7766":"P","7767":"p","7768":"R","7769":"r","7770":"R","7771":"r","7774":"R","7775":"r","7776":"S","7777":"s","7778":"S","7779":"s","7786":"T","7787":"t","7788":"T","7789":"t","7790":"T","7791":"t","7792":"T","7793":"t","7794":"U","7795":"u","7796":"U","7797":"u","7798":"U","7799":"u","7804":"V","7805":"v","7806":"V","7807":"v","7808":"W","7809":"w","7810":"W","7811":"w","7812":"W","7813":"w","7814":"W","7815":"w","7816":"W","7817":"w","7818":"X","7819":"x","7820":"X","7821":"x","7822":"Y","7823":"y","7824":"Z","7825":"z","7826":"Z","7827":"z","7828":"Z","7829":"z","7835":"s","7840":"A","7841":"a","7842":"A","7843":"a","7864":"E","7865":"e","7866":"E","7867":"e","7868":"E","7869":"e","7880":"I","7881":"i","7882":"I","7883":"i","7884":"O","7885":"o","7886":"O","7887":"o","7908":"U","7909":"u","7910":"U","7911":"u","7922":"Y","7923":"y","7924":"Y","7925":"y","7926":"Y","7927":"y","7928":"Y","7929":"y","8305":"i","8341":"h","8342":"k","8343":"l","8344":"m","8345":"n","8346":"p","8347":"s","8348":"t","8450":"c","8458":"g","8459":"h","8460":"h","8461":"h","8464":"i","8465":"i","8466":"l","8467":"l","8468":"l","8469":"n","8472":"p","8473":"p","8474":"q","8475":"r","8476":"r","8477":"r","8484":"z","8488":"z","8492":"b","8493":"c","8495":"e","8496":"e","8497":"f","8498":"F","8499":"m","8500":"o","8506":"q","8513":"g","8514":"l","8515":"l","8516":"y","8517":"d","8518":"d","8519":"e","8520":"i","8521":"j","8526":"f","8579":"C","8580":"c","8765":"s","8766":"s","8959":"z","8999":"x","9746":"x","9776":"i","9866":"i","10005":"x","10006":"x","10007":"x","10008":"x","10625":"z","10626":"z","11362":"L","11364":"R","11365":"a","11366":"t","11373":"A","11374":"M","11375":"A","11390":"S","11391":"Z","19904":"i","42893":"H","42922":"H","42923":"E","42924":"G","42925":"L","42928":"K","42929":"T","62937":"x"}});var wu=vt((bu,Or)=>{(function(n,e){typeof define=="function"&&define.amd?define(function(){return e(n,n.document)}):typeof Or<"u"&&Or.exports?Or.exports=e(n,n.document):n.normalize=e(n,n.document)})(typeof window<"u"?window:bu,function(n,e){var t=yu(),i=null,s,r;function o(c,d){return r=s,s=d||t,i=i&&r===s?i:a(s),c.replace(i,function(h){return s[h.charCodeAt(0)]||h})}function a(c){return new RegExp("["+Object.keys(c).map(function(d){return String.fromCharCode(d)}).join(" ")+"]","g")}return o})});var Du=vt((dl,fi)=>{(function(n,e){typeof dl=="object"&&typeof fi<"u"?fi.exports=e():typeof define=="function"&&define.amd?define(e):n.moment=e()})(dl,function(){"use strict";var n;function e(){return n.apply(null,arguments)}function t(l){n=l}function i(l){return l instanceof Array||Object.prototype.toString.call(l)==="[object Array]"}function s(l){return l!=null&&Object.prototype.toString.call(l)==="[object Object]"}function r(l,u){return Object.prototype.hasOwnProperty.call(l,u)}function o(l){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(l).length===0;var u;for(u in l)if(r(l,u))return!1;return!0}function a(l){return l===void 0}function c(l){return typeof l=="number"||Object.prototype.toString.call(l)==="[object Number]"}function d(l){return l instanceof Date||Object.prototype.toString.call(l)==="[object Date]"}function h(l,u){var p=[],b,w=l.length;for(b=0;b<w;++b)p.push(u(l[b],b));return p}function f(l,u){for(var p in u)r(u,p)&&(l[p]=u[p]);return r(u,"toString")&&(l.toString=u.toString),r(u,"valueOf")&&(l.valueOf=u.valueOf),l}function y(l,u,p,b){return $d(l,u,p,b,!0).utc()}function g(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function m(l){return l._pf==null&&(l._pf=g()),l._pf}var v;Array.prototype.some?v=Array.prototype.some:v=function(l){var u=Object(this),p=u.length>>>0,b;for(b=0;b<p;b++)if(b in u&&l.call(this,u[b],b,u))return!0;return!1};function x(l){if(l._isValid==null){var u=m(l),p=v.call(u.parsedDateParts,function(w){return w!=null}),b=!isNaN(l._d.getTime())&&u.overflow<0&&!u.empty&&!u.invalidEra&&!u.invalidMonth&&!u.invalidWeekday&&!u.weekdayMismatch&&!u.nullInput&&!u.invalidFormat&&!u.userInvalidated&&(!u.meridiem||u.meridiem&&p);if(l._strict&&(b=b&&u.charsLeftOver===0&&u.unusedTokens.length===0&&u.bigHour===void 0),Object.isFrozen==null||!Object.isFrozen(l))l._isValid=b;else return b}return l._isValid}function _(l){var u=y(NaN);return l!=null?f(m(u),l):m(u).userInvalidated=!0,u}var S=e.momentProperties=[],k=!1;function D(l,u){var p,b,w,C=S.length;if(a(u._isAMomentObject)||(l._isAMomentObject=u._isAMomentObject),a(u._i)||(l._i=u._i),a(u._f)||(l._f=u._f),a(u._l)||(l._l=u._l),a(u._strict)||(l._strict=u._strict),a(u._tzm)||(l._tzm=u._tzm),a(u._isUTC)||(l._isUTC=u._isUTC),a(u._offset)||(l._offset=u._offset),a(u._pf)||(l._pf=m(u)),a(u._locale)||(l._locale=u._locale),C>0)for(p=0;p<C;p++)b=S[p],w=u[b],a(w)||(l[b]=w);return l}function T(l){D(this,l),this._d=new Date(l._d!=null?l._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),k===!1&&(k=!0,e.updateOffset(this),k=!1)}function M(l){return l instanceof T||l!=null&&l._isAMomentObject!=null}function O(l){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+l)}function E(l,u){var p=!0;return f(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,l),p){var b=[],w,C,P,U=arguments.length;for(C=0;C<U;C++){if(w="",typeof arguments[C]=="object"){w+=`
[`+C+"] ";for(P in arguments[0])r(arguments[0],P)&&(w+=P+": "+arguments[0][P]+", ");w=w.slice(0,-2)}else w=arguments[C];b.push(w)}O(l+`
Arguments: `+Array.prototype.slice.call(b).join("")+`
`+new Error().stack),p=!1}return u.apply(this,arguments)},u)}var A={};function N(l,u){e.deprecationHandler!=null&&e.deprecationHandler(l,u),A[l]||(O(u),A[l]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function I(l){return typeof Function<"u"&&l instanceof Function||Object.prototype.toString.call(l)==="[object Function]"}function B(l){var u,p;for(p in l)r(l,p)&&(u=l[p],I(u)?this[p]=u:this["_"+p]=u);this._config=l,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function z(l,u){var p=f({},l),b;for(b in u)r(u,b)&&(s(l[b])&&s(u[b])?(p[b]={},f(p[b],l[b]),f(p[b],u[b])):u[b]!=null?p[b]=u[b]:delete p[b]);for(b in l)r(l,b)&&!r(u,b)&&s(l[b])&&(p[b]=f({},p[b]));return p}function L(l){l!=null&&this.set(l)}var F;Object.keys?F=Object.keys:F=function(l){var u,p=[];for(u in l)r(l,u)&&p.push(u);return p};var Y={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function V(l,u,p){var b=this._calendar[l]||this._calendar.sameElse;return I(b)?b.call(u,p):b}function G(l,u,p){var b=""+Math.abs(l),w=u-b.length,C=l>=0;return(C?p?"+":"":"-")+Math.pow(10,Math.max(0,w)).toString().substr(1)+b}var le=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,re=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Re={},De={};function H(l,u,p,b){var w=b;typeof b=="string"&&(w=function(){return this[b]()}),l&&(De[l]=w),u&&(De[u[0]]=function(){return G(w.apply(this,arguments),u[1],u[2])}),p&&(De[p]=function(){return this.localeData().ordinal(w.apply(this,arguments),l)})}function tn(l){return l.match(/\[[\s\S]/)?l.replace(/^\[|\]$/g,""):l.replace(/\\/g,"")}function Ue(l){var u=l.match(le),p,b;for(p=0,b=u.length;p<b;p++)De[u[p]]?u[p]=De[u[p]]:u[p]=tn(u[p]);return function(w){var C="",P;for(P=0;P<b;P++)C+=I(u[P])?u[P].call(w,l):u[P];return C}}function tt(l,u){return l.isValid()?(u=kd(u,l.localeData()),Re[u]=Re[u]||Ue(u),Re[u](l)):l.localeData().invalidDate()}function kd(l,u){var p=5;function b(w){return u.longDateFormat(w)||w}for(re.lastIndex=0;p>=0&&re.test(l);)l=l.replace(re,b),re.lastIndex=0,p-=1;return l}var By={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function zy(l){var u=this._longDateFormat[l],p=this._longDateFormat[l.toUpperCase()];return u||!p?u:(this._longDateFormat[l]=p.match(le).map(function(b){return b==="MMMM"||b==="MM"||b==="DD"||b==="dddd"?b.slice(1):b}).join(""),this._longDateFormat[l])}var Wy="Invalid date";function Hy(){return this._invalidDate}var Yy="%d",Vy=/\d{1,2}/;function jy(l){return this._ordinal.replace("%d",l)}var Uy={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function $y(l,u,p,b){var w=this._relativeTime[p];return I(w)?w(l,u,p,b):w.replace(/%d/i,l)}function Gy(l,u){var p=this._relativeTime[l>0?"future":"past"];return I(p)?p(u):p.replace(/%s/i,u)}var Zi={};function Ie(l,u){var p=l.toLowerCase();Zi[p]=Zi[p+"s"]=Zi[u]=l}function nt(l){return typeof l=="string"?Zi[l]||Zi[l.toLowerCase()]:void 0}function Ba(l){var u={},p,b;for(b in l)r(l,b)&&(p=nt(b),p&&(u[p]=l[b]));return u}var Cd={};function Le(l,u){Cd[l]=u}function Ky(l){var u=[],p;for(p in l)r(l,p)&&u.push({unit:p,priority:Cd[p]});return u.sort(function(b,w){return b.priority-w.priority}),u}function ar(l){return l%4===0&&l%100!==0||l%400===0}function it(l){return l<0?Math.ceil(l)||0:Math.floor(l)}function Z(l){var u=+l,p=0;return u!==0&&isFinite(u)&&(p=it(u)),p}function si(l,u){return function(p){return p!=null?(Td(this,l,p),e.updateOffset(this,u),this):lr(this,l)}}function lr(l,u){return l.isValid()?l._d["get"+(l._isUTC?"UTC":"")+u]():NaN}function Td(l,u,p){l.isValid()&&!isNaN(p)&&(u==="FullYear"&&ar(l.year())&&l.month()===1&&l.date()===29?(p=Z(p),l._d["set"+(l._isUTC?"UTC":"")+u](p,l.month(),gr(p,l.month()))):l._d["set"+(l._isUTC?"UTC":"")+u](p))}function qy(l){return l=nt(l),I(this[l])?this[l]():this}function Xy(l,u){if(typeof l=="object"){l=Ba(l);var p=Ky(l),b,w=p.length;for(b=0;b<w;b++)this[p[b].unit](l[p[b].unit])}else if(l=nt(l),I(this[l]))return this[l](u);return this}var Dd=/\d/,$e=/\d\d/,Od=/\d{3}/,za=/\d{4}/,cr=/[+-]?\d{6}/,pe=/\d\d?/,Md=/\d\d\d\d?/,Ed=/\d\d\d\d\d\d?/,dr=/\d{1,3}/,Wa=/\d{1,4}/,ur=/[+-]?\d{1,6}/,ri=/\d+/,hr=/[+-]?\d+/,Zy=/Z|[+-]\d\d:?\d\d/gi,fr=/Z|[+-]\d\d(?::?\d\d)?/gi,Jy=/[+-]?\d+(\.\d{1,3})?/,Ji=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,pr;pr={};function W(l,u,p){pr[l]=I(u)?u:function(b,w){return b&&p?p:u}}function Qy(l,u){return r(pr,l)?pr[l](u._strict,u._locale):new RegExp(eb(l))}function eb(l){return Ge(l.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(u,p,b,w,C){return p||b||w||C}))}function Ge(l){return l.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var Ha={};function ce(l,u){var p,b=u,w;for(typeof l=="string"&&(l=[l]),c(u)&&(b=function(C,P){P[u]=Z(C)}),w=l.length,p=0;p<w;p++)Ha[l[p]]=b}function Qi(l,u){ce(l,function(p,b,w,C){w._w=w._w||{},u(p,w._w,w,C)})}function tb(l,u,p){u!=null&&r(Ha,l)&&Ha[l](u,p._a,p,l)}var Fe=0,Mt=1,wt=2,Oe=3,ht=4,Et=5,Dn=6,nb=7,ib=8;function sb(l,u){return(l%u+u)%u}var Se;Array.prototype.indexOf?Se=Array.prototype.indexOf:Se=function(l){var u;for(u=0;u<this.length;++u)if(this[u]===l)return u;return-1};function gr(l,u){if(isNaN(l)||isNaN(u))return NaN;var p=sb(u,12);return l+=(u-p)/12,p===1?ar(l)?29:28:31-p%7%2}H("M",["MM",2],"Mo",function(){return this.month()+1}),H("MMM",0,0,function(l){return this.localeData().monthsShort(this,l)}),H("MMMM",0,0,function(l){return this.localeData().months(this,l)}),Ie("month","M"),Le("month",8),W("M",pe),W("MM",pe,$e),W("MMM",function(l,u){return u.monthsShortRegex(l)}),W("MMMM",function(l,u){return u.monthsRegex(l)}),ce(["M","MM"],function(l,u){u[Mt]=Z(l)-1}),ce(["MMM","MMMM"],function(l,u,p,b){var w=p._locale.monthsParse(l,b,p._strict);w!=null?u[Mt]=w:m(p).invalidMonth=l});var rb="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Pd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ad=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,ob=Ji,ab=Ji;function lb(l,u){return l?i(this._months)?this._months[l.month()]:this._months[(this._months.isFormat||Ad).test(u)?"format":"standalone"][l.month()]:i(this._months)?this._months:this._months.standalone}function cb(l,u){return l?i(this._monthsShort)?this._monthsShort[l.month()]:this._monthsShort[Ad.test(u)?"format":"standalone"][l.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function db(l,u,p){var b,w,C,P=l.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],b=0;b<12;++b)C=y([2e3,b]),this._shortMonthsParse[b]=this.monthsShort(C,"").toLocaleLowerCase(),this._longMonthsParse[b]=this.months(C,"").toLocaleLowerCase();return p?u==="MMM"?(w=Se.call(this._shortMonthsParse,P),w!==-1?w:null):(w=Se.call(this._longMonthsParse,P),w!==-1?w:null):u==="MMM"?(w=Se.call(this._shortMonthsParse,P),w!==-1?w:(w=Se.call(this._longMonthsParse,P),w!==-1?w:null)):(w=Se.call(this._longMonthsParse,P),w!==-1?w:(w=Se.call(this._shortMonthsParse,P),w!==-1?w:null))}function ub(l,u,p){var b,w,C;if(this._monthsParseExact)return db.call(this,l,u,p);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),b=0;b<12;b++){if(w=y([2e3,b]),p&&!this._longMonthsParse[b]&&(this._longMonthsParse[b]=new RegExp("^"+this.months(w,"").replace(".","")+"$","i"),this._shortMonthsParse[b]=new RegExp("^"+this.monthsShort(w,"").replace(".","")+"$","i")),!p&&!this._monthsParse[b]&&(C="^"+this.months(w,"")+"|^"+this.monthsShort(w,""),this._monthsParse[b]=new RegExp(C.replace(".",""),"i")),p&&u==="MMMM"&&this._longMonthsParse[b].test(l))return b;if(p&&u==="MMM"&&this._shortMonthsParse[b].test(l))return b;if(!p&&this._monthsParse[b].test(l))return b}}function Nd(l,u){var p;if(!l.isValid())return l;if(typeof u=="string"){if(/^\d+$/.test(u))u=Z(u);else if(u=l.localeData().monthsParse(u),!c(u))return l}return p=Math.min(l.date(),gr(l.year(),u)),l._d["set"+(l._isUTC?"UTC":"")+"Month"](u,p),l}function Rd(l){return l!=null?(Nd(this,l),e.updateOffset(this,!0),this):lr(this,"Month")}function hb(){return gr(this.year(),this.month())}function fb(l){return this._monthsParseExact?(r(this,"_monthsRegex")||Id.call(this),l?this._monthsShortStrictRegex:this._monthsShortRegex):(r(this,"_monthsShortRegex")||(this._monthsShortRegex=ob),this._monthsShortStrictRegex&&l?this._monthsShortStrictRegex:this._monthsShortRegex)}function pb(l){return this._monthsParseExact?(r(this,"_monthsRegex")||Id.call(this),l?this._monthsStrictRegex:this._monthsRegex):(r(this,"_monthsRegex")||(this._monthsRegex=ab),this._monthsStrictRegex&&l?this._monthsStrictRegex:this._monthsRegex)}function Id(){function l(P,U){return U.length-P.length}var u=[],p=[],b=[],w,C;for(w=0;w<12;w++)C=y([2e3,w]),u.push(this.monthsShort(C,"")),p.push(this.months(C,"")),b.push(this.months(C,"")),b.push(this.monthsShort(C,""));for(u.sort(l),p.sort(l),b.sort(l),w=0;w<12;w++)u[w]=Ge(u[w]),p[w]=Ge(p[w]);for(w=0;w<24;w++)b[w]=Ge(b[w]);this._monthsRegex=new RegExp("^("+b.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+p.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+u.join("|")+")","i")}H("Y",0,0,function(){var l=this.year();return l<=9999?G(l,4):"+"+l}),H(0,["YY",2],0,function(){return this.year()%100}),H(0,["YYYY",4],0,"year"),H(0,["YYYYY",5],0,"year"),H(0,["YYYYYY",6,!0],0,"year"),Ie("year","y"),Le("year",1),W("Y",hr),W("YY",pe,$e),W("YYYY",Wa,za),W("YYYYY",ur,cr),W("YYYYYY",ur,cr),ce(["YYYYY","YYYYYY"],Fe),ce("YYYY",function(l,u){u[Fe]=l.length===2?e.parseTwoDigitYear(l):Z(l)}),ce("YY",function(l,u){u[Fe]=e.parseTwoDigitYear(l)}),ce("Y",function(l,u){u[Fe]=parseInt(l,10)});function es(l){return ar(l)?366:365}e.parseTwoDigitYear=function(l){return Z(l)+(Z(l)>68?1900:2e3)};var Ld=si("FullYear",!0);function gb(){return ar(this.year())}function mb(l,u,p,b,w,C,P){var U;return l<100&&l>=0?(U=new Date(l+400,u,p,b,w,C,P),isFinite(U.getFullYear())&&U.setFullYear(l)):U=new Date(l,u,p,b,w,C,P),U}function ts(l){var u,p;return l<100&&l>=0?(p=Array.prototype.slice.call(arguments),p[0]=l+400,u=new Date(Date.UTC.apply(null,p)),isFinite(u.getUTCFullYear())&&u.setUTCFullYear(l)):u=new Date(Date.UTC.apply(null,arguments)),u}function mr(l,u,p){var b=7+u-p,w=(7+ts(l,0,b).getUTCDay()-u)%7;return-w+b-1}function Fd(l,u,p,b,w){var C=(7+p-b)%7,P=mr(l,b,w),U=1+7*(u-1)+C+P,X,de;return U<=0?(X=l-1,de=es(X)+U):U>es(l)?(X=l+1,de=U-es(l)):(X=l,de=U),{year:X,dayOfYear:de}}function ns(l,u,p){var b=mr(l.year(),u,p),w=Math.floor((l.dayOfYear()-b-1)/7)+1,C,P;return w<1?(P=l.year()-1,C=w+Pt(P,u,p)):w>Pt(l.year(),u,p)?(C=w-Pt(l.year(),u,p),P=l.year()+1):(P=l.year(),C=w),{week:C,year:P}}function Pt(l,u,p){var b=mr(l,u,p),w=mr(l+1,u,p);return(es(l)-b+w)/7}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),Ie("week","w"),Ie("isoWeek","W"),Le("week",5),Le("isoWeek",5),W("w",pe),W("ww",pe,$e),W("W",pe),W("WW",pe,$e),Qi(["w","ww","W","WW"],function(l,u,p,b){u[b.substr(0,1)]=Z(l)});function yb(l){return ns(l,this._week.dow,this._week.doy).week}var bb={dow:0,doy:6};function wb(){return this._week.dow}function vb(){return this._week.doy}function xb(l){var u=this.localeData().week(this);return l==null?u:this.add((l-u)*7,"d")}function _b(l){var u=ns(this,1,4).week;return l==null?u:this.add((l-u)*7,"d")}H("d",0,"do","day"),H("dd",0,0,function(l){return this.localeData().weekdaysMin(this,l)}),H("ddd",0,0,function(l){return this.localeData().weekdaysShort(this,l)}),H("dddd",0,0,function(l){return this.localeData().weekdays(this,l)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),Ie("day","d"),Ie("weekday","e"),Ie("isoWeekday","E"),Le("day",11),Le("weekday",11),Le("isoWeekday",11),W("d",pe),W("e",pe),W("E",pe),W("dd",function(l,u){return u.weekdaysMinRegex(l)}),W("ddd",function(l,u){return u.weekdaysShortRegex(l)}),W("dddd",function(l,u){return u.weekdaysRegex(l)}),Qi(["dd","ddd","dddd"],function(l,u,p,b){var w=p._locale.weekdaysParse(l,b,p._strict);w!=null?u.d=w:m(p).invalidWeekday=l}),Qi(["d","e","E"],function(l,u,p,b){u[b]=Z(l)});function Sb(l,u){return typeof l!="string"?l:isNaN(l)?(l=u.weekdaysParse(l),typeof l=="number"?l:null):parseInt(l,10)}function kb(l,u){return typeof l=="string"?u.weekdaysParse(l)%7||7:isNaN(l)?null:l}function Ya(l,u){return l.slice(u,7).concat(l.slice(0,u))}var Cb="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Bd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Tb="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Db=Ji,Ob=Ji,Mb=Ji;function Eb(l,u){var p=i(this._weekdays)?this._weekdays:this._weekdays[l&&l!==!0&&this._weekdays.isFormat.test(u)?"format":"standalone"];return l===!0?Ya(p,this._week.dow):l?p[l.day()]:p}function Pb(l){return l===!0?Ya(this._weekdaysShort,this._week.dow):l?this._weekdaysShort[l.day()]:this._weekdaysShort}function Ab(l){return l===!0?Ya(this._weekdaysMin,this._week.dow):l?this._weekdaysMin[l.day()]:this._weekdaysMin}function Nb(l,u,p){var b,w,C,P=l.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],b=0;b<7;++b)C=y([2e3,1]).day(b),this._minWeekdaysParse[b]=this.weekdaysMin(C,"").toLocaleLowerCase(),this._shortWeekdaysParse[b]=this.weekdaysShort(C,"").toLocaleLowerCase(),this._weekdaysParse[b]=this.weekdays(C,"").toLocaleLowerCase();return p?u==="dddd"?(w=Se.call(this._weekdaysParse,P),w!==-1?w:null):u==="ddd"?(w=Se.call(this._shortWeekdaysParse,P),w!==-1?w:null):(w=Se.call(this._minWeekdaysParse,P),w!==-1?w:null):u==="dddd"?(w=Se.call(this._weekdaysParse,P),w!==-1||(w=Se.call(this._shortWeekdaysParse,P),w!==-1)?w:(w=Se.call(this._minWeekdaysParse,P),w!==-1?w:null)):u==="ddd"?(w=Se.call(this._shortWeekdaysParse,P),w!==-1||(w=Se.call(this._weekdaysParse,P),w!==-1)?w:(w=Se.call(this._minWeekdaysParse,P),w!==-1?w:null)):(w=Se.call(this._minWeekdaysParse,P),w!==-1||(w=Se.call(this._weekdaysParse,P),w!==-1)?w:(w=Se.call(this._shortWeekdaysParse,P),w!==-1?w:null))}function Rb(l,u,p){var b,w,C;if(this._weekdaysParseExact)return Nb.call(this,l,u,p);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),b=0;b<7;b++){if(w=y([2e3,1]).day(b),p&&!this._fullWeekdaysParse[b]&&(this._fullWeekdaysParse[b]=new RegExp("^"+this.weekdays(w,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[b]=new RegExp("^"+this.weekdaysShort(w,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[b]=new RegExp("^"+this.weekdaysMin(w,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[b]||(C="^"+this.weekdays(w,"")+"|^"+this.weekdaysShort(w,"")+"|^"+this.weekdaysMin(w,""),this._weekdaysParse[b]=new RegExp(C.replace(".",""),"i")),p&&u==="dddd"&&this._fullWeekdaysParse[b].test(l))return b;if(p&&u==="ddd"&&this._shortWeekdaysParse[b].test(l))return b;if(p&&u==="dd"&&this._minWeekdaysParse[b].test(l))return b;if(!p&&this._weekdaysParse[b].test(l))return b}}function Ib(l){if(!this.isValid())return l!=null?this:NaN;var u=this._isUTC?this._d.getUTCDay():this._d.getDay();return l!=null?(l=Sb(l,this.localeData()),this.add(l-u,"d")):u}function Lb(l){if(!this.isValid())return l!=null?this:NaN;var u=(this.day()+7-this.localeData()._week.dow)%7;return l==null?u:this.add(l-u,"d")}function Fb(l){if(!this.isValid())return l!=null?this:NaN;if(l!=null){var u=kb(l,this.localeData());return this.day(this.day()%7?u:u-7)}else return this.day()||7}function Bb(l){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||Va.call(this),l?this._weekdaysStrictRegex:this._weekdaysRegex):(r(this,"_weekdaysRegex")||(this._weekdaysRegex=Db),this._weekdaysStrictRegex&&l?this._weekdaysStrictRegex:this._weekdaysRegex)}function zb(l){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||Va.call(this),l?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(r(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ob),this._weekdaysShortStrictRegex&&l?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Wb(l){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||Va.call(this),l?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(r(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Mb),this._weekdaysMinStrictRegex&&l?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Va(){function l(ze,Lt){return Lt.length-ze.length}var u=[],p=[],b=[],w=[],C,P,U,X,de;for(C=0;C<7;C++)P=y([2e3,1]).day(C),U=Ge(this.weekdaysMin(P,"")),X=Ge(this.weekdaysShort(P,"")),de=Ge(this.weekdays(P,"")),u.push(U),p.push(X),b.push(de),w.push(U),w.push(X),w.push(de);u.sort(l),p.sort(l),b.sort(l),w.sort(l),this._weekdaysRegex=new RegExp("^("+w.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+p.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+u.join("|")+")","i")}function ja(){return this.hours()%12||12}function Hb(){return this.hours()||24}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,ja),H("k",["kk",2],0,Hb),H("hmm",0,0,function(){return""+ja.apply(this)+G(this.minutes(),2)}),H("hmmss",0,0,function(){return""+ja.apply(this)+G(this.minutes(),2)+G(this.seconds(),2)}),H("Hmm",0,0,function(){return""+this.hours()+G(this.minutes(),2)}),H("Hmmss",0,0,function(){return""+this.hours()+G(this.minutes(),2)+G(this.seconds(),2)});function zd(l,u){H(l,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),u)})}zd("a",!0),zd("A",!1),Ie("hour","h"),Le("hour",13);function Wd(l,u){return u._meridiemParse}W("a",Wd),W("A",Wd),W("H",pe),W("h",pe),W("k",pe),W("HH",pe,$e),W("hh",pe,$e),W("kk",pe,$e),W("hmm",Md),W("hmmss",Ed),W("Hmm",Md),W("Hmmss",Ed),ce(["H","HH"],Oe),ce(["k","kk"],function(l,u,p){var b=Z(l);u[Oe]=b===24?0:b}),ce(["a","A"],function(l,u,p){p._isPm=p._locale.isPM(l),p._meridiem=l}),ce(["h","hh"],function(l,u,p){u[Oe]=Z(l),m(p).bigHour=!0}),ce("hmm",function(l,u,p){var b=l.length-2;u[Oe]=Z(l.substr(0,b)),u[ht]=Z(l.substr(b)),m(p).bigHour=!0}),ce("hmmss",function(l,u,p){var b=l.length-4,w=l.length-2;u[Oe]=Z(l.substr(0,b)),u[ht]=Z(l.substr(b,2)),u[Et]=Z(l.substr(w)),m(p).bigHour=!0}),ce("Hmm",function(l,u,p){var b=l.length-2;u[Oe]=Z(l.substr(0,b)),u[ht]=Z(l.substr(b))}),ce("Hmmss",function(l,u,p){var b=l.length-4,w=l.length-2;u[Oe]=Z(l.substr(0,b)),u[ht]=Z(l.substr(b,2)),u[Et]=Z(l.substr(w))});function Yb(l){return(l+"").toLowerCase().charAt(0)==="p"}var Vb=/[ap]\.?m?\.?/i,jb=si("Hours",!0);function Ub(l,u,p){return l>11?p?"pm":"PM":p?"am":"AM"}var Hd={calendar:Y,longDateFormat:By,invalidDate:Wy,ordinal:Yy,dayOfMonthOrdinalParse:Vy,relativeTime:Uy,months:rb,monthsShort:Pd,week:bb,weekdays:Cb,weekdaysMin:Tb,weekdaysShort:Bd,meridiemParse:Vb},ye={},is={},ss;function $b(l,u){var p,b=Math.min(l.length,u.length);for(p=0;p<b;p+=1)if(l[p]!==u[p])return p;return b}function Yd(l){return l&&l.toLowerCase().replace("_","-")}function Gb(l){for(var u=0,p,b,w,C;u<l.length;){for(C=Yd(l[u]).split("-"),p=C.length,b=Yd(l[u+1]),b=b?b.split("-"):null;p>0;){if(w=yr(C.slice(0,p).join("-")),w)return w;if(b&&b.length>=p&&$b(C,b)>=p-1)break;p--}u++}return ss}function Kb(l){return l.match("^[^/\\\\]*$")!=null}function yr(l){var u=null,p;if(ye[l]===void 0&&typeof fi<"u"&&fi&&fi.exports&&Kb(l))try{u=ss._abbr,p=Dr,p("./locale/"+l),nn(u)}catch{ye[l]=null}return ye[l]}function nn(l,u){var p;return l&&(a(u)?p=At(l):p=Ua(l,u),p?ss=p:typeof console<"u"&&console.warn&&console.warn("Locale "+l+" not found. Did you forget to load it?")),ss._abbr}function Ua(l,u){if(u!==null){var p,b=Hd;if(u.abbr=l,ye[l]!=null)N("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),b=ye[l]._config;else if(u.parentLocale!=null)if(ye[u.parentLocale]!=null)b=ye[u.parentLocale]._config;else if(p=yr(u.parentLocale),p!=null)b=p._config;else return is[u.parentLocale]||(is[u.parentLocale]=[]),is[u.parentLocale].push({name:l,config:u}),null;return ye[l]=new L(z(b,u)),is[l]&&is[l].forEach(function(w){Ua(w.name,w.config)}),nn(l),ye[l]}else return delete ye[l],null}function qb(l,u){if(u!=null){var p,b,w=Hd;ye[l]!=null&&ye[l].parentLocale!=null?ye[l].set(z(ye[l]._config,u)):(b=yr(l),b!=null&&(w=b._config),u=z(w,u),b==null&&(u.abbr=l),p=new L(u),p.parentLocale=ye[l],ye[l]=p),nn(l)}else ye[l]!=null&&(ye[l].parentLocale!=null?(ye[l]=ye[l].parentLocale,l===nn()&&nn(l)):ye[l]!=null&&delete ye[l]);return ye[l]}function At(l){var u;if(l&&l._locale&&l._locale._abbr&&(l=l._locale._abbr),!l)return ss;if(!i(l)){if(u=yr(l),u)return u;l=[l]}return Gb(l)}function Xb(){return F(ye)}function $a(l){var u,p=l._a;return p&&m(l).overflow===-2&&(u=p[Mt]<0||p[Mt]>11?Mt:p[wt]<1||p[wt]>gr(p[Fe],p[Mt])?wt:p[Oe]<0||p[Oe]>24||p[Oe]===24&&(p[ht]!==0||p[Et]!==0||p[Dn]!==0)?Oe:p[ht]<0||p[ht]>59?ht:p[Et]<0||p[Et]>59?Et:p[Dn]<0||p[Dn]>999?Dn:-1,m(l)._overflowDayOfYear&&(u<Fe||u>wt)&&(u=wt),m(l)._overflowWeeks&&u===-1&&(u=nb),m(l)._overflowWeekday&&u===-1&&(u=ib),m(l).overflow=u),l}var Zb=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Jb=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Qb=/Z|[+-]\d\d(?::?\d\d)?/,br=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Ga=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ew=/^\/?Date\((-?\d+)/i,tw=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,nw={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Vd(l){var u,p,b=l._i,w=Zb.exec(b)||Jb.exec(b),C,P,U,X,de=br.length,ze=Ga.length;if(w){for(m(l).iso=!0,u=0,p=de;u<p;u++)if(br[u][1].exec(w[1])){P=br[u][0],C=br[u][2]!==!1;break}if(P==null){l._isValid=!1;return}if(w[3]){for(u=0,p=ze;u<p;u++)if(Ga[u][1].exec(w[3])){U=(w[2]||" ")+Ga[u][0];break}if(U==null){l._isValid=!1;return}}if(!C&&U!=null){l._isValid=!1;return}if(w[4])if(Qb.exec(w[4]))X="Z";else{l._isValid=!1;return}l._f=P+(U||"")+(X||""),qa(l)}else l._isValid=!1}function iw(l,u,p,b,w,C){var P=[sw(l),Pd.indexOf(u),parseInt(p,10),parseInt(b,10),parseInt(w,10)];return C&&P.push(parseInt(C,10)),P}function sw(l){var u=parseInt(l,10);return u<=49?2e3+u:u<=999?1900+u:u}function rw(l){return l.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function ow(l,u,p){if(l){var b=Bd.indexOf(l),w=new Date(u[0],u[1],u[2]).getDay();if(b!==w)return m(p).weekdayMismatch=!0,p._isValid=!1,!1}return!0}function aw(l,u,p){if(l)return nw[l];if(u)return 0;var b=parseInt(p,10),w=b%100,C=(b-w)/100;return C*60+w}function jd(l){var u=tw.exec(rw(l._i)),p;if(u){if(p=iw(u[4],u[3],u[2],u[5],u[6],u[7]),!ow(u[1],p,l))return;l._a=p,l._tzm=aw(u[8],u[9],u[10]),l._d=ts.apply(null,l._a),l._d.setUTCMinutes(l._d.getUTCMinutes()-l._tzm),m(l).rfc2822=!0}else l._isValid=!1}function lw(l){var u=ew.exec(l._i);if(u!==null){l._d=new Date(+u[1]);return}if(Vd(l),l._isValid===!1)delete l._isValid;else return;if(jd(l),l._isValid===!1)delete l._isValid;else return;l._strict?l._isValid=!1:e.createFromInputFallback(l)}e.createFromInputFallback=E("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(l){l._d=new Date(l._i+(l._useUTC?" UTC":""))});function oi(l,u,p){return l??u??p}function cw(l){var u=new Date(e.now());return l._useUTC?[u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()]:[u.getFullYear(),u.getMonth(),u.getDate()]}function Ka(l){var u,p,b=[],w,C,P;if(!l._d){for(w=cw(l),l._w&&l._a[wt]==null&&l._a[Mt]==null&&dw(l),l._dayOfYear!=null&&(P=oi(l._a[Fe],w[Fe]),(l._dayOfYear>es(P)||l._dayOfYear===0)&&(m(l)._overflowDayOfYear=!0),p=ts(P,0,l._dayOfYear),l._a[Mt]=p.getUTCMonth(),l._a[wt]=p.getUTCDate()),u=0;u<3&&l._a[u]==null;++u)l._a[u]=b[u]=w[u];for(;u<7;u++)l._a[u]=b[u]=l._a[u]==null?u===2?1:0:l._a[u];l._a[Oe]===24&&l._a[ht]===0&&l._a[Et]===0&&l._a[Dn]===0&&(l._nextDay=!0,l._a[Oe]=0),l._d=(l._useUTC?ts:mb).apply(null,b),C=l._useUTC?l._d.getUTCDay():l._d.getDay(),l._tzm!=null&&l._d.setUTCMinutes(l._d.getUTCMinutes()-l._tzm),l._nextDay&&(l._a[Oe]=24),l._w&&typeof l._w.d<"u"&&l._w.d!==C&&(m(l).weekdayMismatch=!0)}}function dw(l){var u,p,b,w,C,P,U,X,de;u=l._w,u.GG!=null||u.W!=null||u.E!=null?(C=1,P=4,p=oi(u.GG,l._a[Fe],ns(ge(),1,4).year),b=oi(u.W,1),w=oi(u.E,1),(w<1||w>7)&&(X=!0)):(C=l._locale._week.dow,P=l._locale._week.doy,de=ns(ge(),C,P),p=oi(u.gg,l._a[Fe],de.year),b=oi(u.w,de.week),u.d!=null?(w=u.d,(w<0||w>6)&&(X=!0)):u.e!=null?(w=u.e+C,(u.e<0||u.e>6)&&(X=!0)):w=C),b<1||b>Pt(p,C,P)?m(l)._overflowWeeks=!0:X!=null?m(l)._overflowWeekday=!0:(U=Fd(p,b,w,C,P),l._a[Fe]=U.year,l._dayOfYear=U.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function qa(l){if(l._f===e.ISO_8601){Vd(l);return}if(l._f===e.RFC_2822){jd(l);return}l._a=[],m(l).empty=!0;var u=""+l._i,p,b,w,C,P,U=u.length,X=0,de,ze;for(w=kd(l._f,l._locale).match(le)||[],ze=w.length,p=0;p<ze;p++)C=w[p],b=(u.match(Qy(C,l))||[])[0],b&&(P=u.substr(0,u.indexOf(b)),P.length>0&&m(l).unusedInput.push(P),u=u.slice(u.indexOf(b)+b.length),X+=b.length),De[C]?(b?m(l).empty=!1:m(l).unusedTokens.push(C),tb(C,b,l)):l._strict&&!b&&m(l).unusedTokens.push(C);m(l).charsLeftOver=U-X,u.length>0&&m(l).unusedInput.push(u),l._a[Oe]<=12&&m(l).bigHour===!0&&l._a[Oe]>0&&(m(l).bigHour=void 0),m(l).parsedDateParts=l._a.slice(0),m(l).meridiem=l._meridiem,l._a[Oe]=uw(l._locale,l._a[Oe],l._meridiem),de=m(l).era,de!==null&&(l._a[Fe]=l._locale.erasConvertYear(de,l._a[Fe])),Ka(l),$a(l)}function uw(l,u,p){var b;return p==null?u:l.meridiemHour!=null?l.meridiemHour(u,p):(l.isPM!=null&&(b=l.isPM(p),b&&u<12&&(u+=12),!b&&u===12&&(u=0)),u)}function hw(l){var u,p,b,w,C,P,U=!1,X=l._f.length;if(X===0){m(l).invalidFormat=!0,l._d=new Date(NaN);return}for(w=0;w<X;w++)C=0,P=!1,u=D({},l),l._useUTC!=null&&(u._useUTC=l._useUTC),u._f=l._f[w],qa(u),x(u)&&(P=!0),C+=m(u).charsLeftOver,C+=m(u).unusedTokens.length*10,m(u).score=C,U?C<b&&(b=C,p=u):(b==null||C<b||P)&&(b=C,p=u,P&&(U=!0));f(l,p||u)}function fw(l){if(!l._d){var u=Ba(l._i),p=u.day===void 0?u.date:u.day;l._a=h([u.year,u.month,p,u.hour,u.minute,u.second,u.millisecond],function(b){return b&&parseInt(b,10)}),Ka(l)}}function pw(l){var u=new T($a(Ud(l)));return u._nextDay&&(u.add(1,"d"),u._nextDay=void 0),u}function Ud(l){var u=l._i,p=l._f;return l._locale=l._locale||At(l._l),u===null||p===void 0&&u===""?_({nullInput:!0}):(typeof u=="string"&&(l._i=u=l._locale.preparse(u)),M(u)?new T($a(u)):(d(u)?l._d=u:i(p)?hw(l):p?qa(l):gw(l),x(l)||(l._d=null),l))}function gw(l){var u=l._i;a(u)?l._d=new Date(e.now()):d(u)?l._d=new Date(u.valueOf()):typeof u=="string"?lw(l):i(u)?(l._a=h(u.slice(0),function(p){return parseInt(p,10)}),Ka(l)):s(u)?fw(l):c(u)?l._d=new Date(u):e.createFromInputFallback(l)}function $d(l,u,p,b,w){var C={};return(u===!0||u===!1)&&(b=u,u=void 0),(p===!0||p===!1)&&(b=p,p=void 0),(s(l)&&o(l)||i(l)&&l.length===0)&&(l=void 0),C._isAMomentObject=!0,C._useUTC=C._isUTC=w,C._l=p,C._i=l,C._f=u,C._strict=b,pw(C)}function ge(l,u,p,b){return $d(l,u,p,b,!1)}var mw=E("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var l=ge.apply(null,arguments);return this.isValid()&&l.isValid()?l<this?this:l:_()}),yw=E("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var l=ge.apply(null,arguments);return this.isValid()&&l.isValid()?l>this?this:l:_()});function Gd(l,u){var p,b;if(u.length===1&&i(u[0])&&(u=u[0]),!u.length)return ge();for(p=u[0],b=1;b<u.length;++b)(!u[b].isValid()||u[b][l](p))&&(p=u[b]);return p}function bw(){var l=[].slice.call(arguments,0);return Gd("isBefore",l)}function ww(){var l=[].slice.call(arguments,0);return Gd("isAfter",l)}var vw=function(){return Date.now?Date.now():+new Date},rs=["year","quarter","month","week","day","hour","minute","second","millisecond"];function xw(l){var u,p=!1,b,w=rs.length;for(u in l)if(r(l,u)&&!(Se.call(rs,u)!==-1&&(l[u]==null||!isNaN(l[u]))))return!1;for(b=0;b<w;++b)if(l[rs[b]]){if(p)return!1;parseFloat(l[rs[b]])!==Z(l[rs[b]])&&(p=!0)}return!0}function _w(){return this._isValid}function Sw(){return ft(NaN)}function wr(l){var u=Ba(l),p=u.year||0,b=u.quarter||0,w=u.month||0,C=u.week||u.isoWeek||0,P=u.day||0,U=u.hour||0,X=u.minute||0,de=u.second||0,ze=u.millisecond||0;this._isValid=xw(u),this._milliseconds=+ze+de*1e3+X*6e4+U*1e3*60*60,this._days=+P+C*7,this._months=+w+b*3+p*12,this._data={},this._locale=At(),this._bubble()}function vr(l){return l instanceof wr}function Xa(l){return l<0?Math.round(-1*l)*-1:Math.round(l)}function kw(l,u,p){var b=Math.min(l.length,u.length),w=Math.abs(l.length-u.length),C=0,P;for(P=0;P<b;P++)(p&&l[P]!==u[P]||!p&&Z(l[P])!==Z(u[P]))&&C++;return C+w}function Kd(l,u){H(l,0,0,function(){var p=this.utcOffset(),b="+";return p<0&&(p=-p,b="-"),b+G(~~(p/60),2)+u+G(~~p%60,2)})}Kd("Z",":"),Kd("ZZ",""),W("Z",fr),W("ZZ",fr),ce(["Z","ZZ"],function(l,u,p){p._useUTC=!0,p._tzm=Za(fr,l)});var Cw=/([\+\-]|\d\d)/gi;function Za(l,u){var p=(u||"").match(l),b,w,C;return p===null?null:(b=p[p.length-1]||[],w=(b+"").match(Cw)||["-",0,0],C=+(w[1]*60)+Z(w[2]),C===0?0:w[0]==="+"?C:-C)}function Ja(l,u){var p,b;return u._isUTC?(p=u.clone(),b=(M(l)||d(l)?l.valueOf():ge(l).valueOf())-p.valueOf(),p._d.setTime(p._d.valueOf()+b),e.updateOffset(p,!1),p):ge(l).local()}function Qa(l){return-Math.round(l._d.getTimezoneOffset())}e.updateOffset=function(){};function Tw(l,u,p){var b=this._offset||0,w;if(!this.isValid())return l!=null?this:NaN;if(l!=null){if(typeof l=="string"){if(l=Za(fr,l),l===null)return this}else Math.abs(l)<16&&!p&&(l=l*60);return!this._isUTC&&u&&(w=Qa(this)),this._offset=l,this._isUTC=!0,w!=null&&this.add(w,"m"),b!==l&&(!u||this._changeInProgress?Jd(this,ft(l-b,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?b:Qa(this)}function Dw(l,u){return l!=null?(typeof l!="string"&&(l=-l),this.utcOffset(l,u),this):-this.utcOffset()}function Ow(l){return this.utcOffset(0,l)}function Mw(l){return this._isUTC&&(this.utcOffset(0,l),this._isUTC=!1,l&&this.subtract(Qa(this),"m")),this}function Ew(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var l=Za(Zy,this._i);l!=null?this.utcOffset(l):this.utcOffset(0,!0)}return this}function Pw(l){return this.isValid()?(l=l?ge(l).utcOffset():0,(this.utcOffset()-l)%60===0):!1}function Aw(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Nw(){if(!a(this._isDSTShifted))return this._isDSTShifted;var l={},u;return D(l,this),l=Ud(l),l._a?(u=l._isUTC?y(l._a):ge(l._a),this._isDSTShifted=this.isValid()&&kw(l._a,u.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Rw(){return this.isValid()?!this._isUTC:!1}function Iw(){return this.isValid()?this._isUTC:!1}function qd(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Lw=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Fw=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ft(l,u){var p=l,b=null,w,C,P;return vr(l)?p={ms:l._milliseconds,d:l._days,M:l._months}:c(l)||!isNaN(+l)?(p={},u?p[u]=+l:p.milliseconds=+l):(b=Lw.exec(l))?(w=b[1]==="-"?-1:1,p={y:0,d:Z(b[wt])*w,h:Z(b[Oe])*w,m:Z(b[ht])*w,s:Z(b[Et])*w,ms:Z(Xa(b[Dn]*1e3))*w}):(b=Fw.exec(l))?(w=b[1]==="-"?-1:1,p={y:On(b[2],w),M:On(b[3],w),w:On(b[4],w),d:On(b[5],w),h:On(b[6],w),m:On(b[7],w),s:On(b[8],w)}):p==null?p={}:typeof p=="object"&&("from"in p||"to"in p)&&(P=Bw(ge(p.from),ge(p.to)),p={},p.ms=P.milliseconds,p.M=P.months),C=new wr(p),vr(l)&&r(l,"_locale")&&(C._locale=l._locale),vr(l)&&r(l,"_isValid")&&(C._isValid=l._isValid),C}ft.fn=wr.prototype,ft.invalid=Sw;function On(l,u){var p=l&&parseFloat(l.replace(",","."));return(isNaN(p)?0:p)*u}function Xd(l,u){var p={};return p.months=u.month()-l.month()+(u.year()-l.year())*12,l.clone().add(p.months,"M").isAfter(u)&&--p.months,p.milliseconds=+u-+l.clone().add(p.months,"M"),p}function Bw(l,u){var p;return l.isValid()&&u.isValid()?(u=Ja(u,l),l.isBefore(u)?p=Xd(l,u):(p=Xd(u,l),p.milliseconds=-p.milliseconds,p.months=-p.months),p):{milliseconds:0,months:0}}function Zd(l,u){return function(p,b){var w,C;return b!==null&&!isNaN(+b)&&(N(u,"moment()."+u+"(period, number) is deprecated. Please use moment()."+u+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),C=p,p=b,b=C),w=ft(p,b),Jd(this,w,l),this}}function Jd(l,u,p,b){var w=u._milliseconds,C=Xa(u._days),P=Xa(u._months);!l.isValid()||(b=b??!0,P&&Nd(l,lr(l,"Month")+P*p),C&&Td(l,"Date",lr(l,"Date")+C*p),w&&l._d.setTime(l._d.valueOf()+w*p),b&&e.updateOffset(l,C||P))}var zw=Zd(1,"add"),Ww=Zd(-1,"subtract");function Qd(l){return typeof l=="string"||l instanceof String}function Hw(l){return M(l)||d(l)||Qd(l)||c(l)||Vw(l)||Yw(l)||l===null||l===void 0}function Yw(l){var u=s(l)&&!o(l),p=!1,b=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],w,C,P=b.length;for(w=0;w<P;w+=1)C=b[w],p=p||r(l,C);return u&&p}function Vw(l){var u=i(l),p=!1;return u&&(p=l.filter(function(b){return!c(b)&&Qd(l)}).length===0),u&&p}function jw(l){var u=s(l)&&!o(l),p=!1,b=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],w,C;for(w=0;w<b.length;w+=1)C=b[w],p=p||r(l,C);return u&&p}function Uw(l,u){var p=l.diff(u,"days",!0);return p<-6?"sameElse":p<-1?"lastWeek":p<0?"lastDay":p<1?"sameDay":p<2?"nextDay":p<7?"nextWeek":"sameElse"}function $w(l,u){arguments.length===1&&(arguments[0]?Hw(arguments[0])?(l=arguments[0],u=void 0):jw(arguments[0])&&(u=arguments[0],l=void 0):(l=void 0,u=void 0));var p=l||ge(),b=Ja(p,this).startOf("day"),w=e.calendarFormat(this,b)||"sameElse",C=u&&(I(u[w])?u[w].call(this,p):u[w]);return this.format(C||this.localeData().calendar(w,this,ge(p)))}function Gw(){return new T(this)}function Kw(l,u){var p=M(l)?l:ge(l);return this.isValid()&&p.isValid()?(u=nt(u)||"millisecond",u==="millisecond"?this.valueOf()>p.valueOf():p.valueOf()<this.clone().startOf(u).valueOf()):!1}function qw(l,u){var p=M(l)?l:ge(l);return this.isValid()&&p.isValid()?(u=nt(u)||"millisecond",u==="millisecond"?this.valueOf()<p.valueOf():this.clone().endOf(u).valueOf()<p.valueOf()):!1}function Xw(l,u,p,b){var w=M(l)?l:ge(l),C=M(u)?u:ge(u);return this.isValid()&&w.isValid()&&C.isValid()?(b=b||"()",(b[0]==="("?this.isAfter(w,p):!this.isBefore(w,p))&&(b[1]===")"?this.isBefore(C,p):!this.isAfter(C,p))):!1}function Zw(l,u){var p=M(l)?l:ge(l),b;return this.isValid()&&p.isValid()?(u=nt(u)||"millisecond",u==="millisecond"?this.valueOf()===p.valueOf():(b=p.valueOf(),this.clone().startOf(u).valueOf()<=b&&b<=this.clone().endOf(u).valueOf())):!1}function Jw(l,u){return this.isSame(l,u)||this.isAfter(l,u)}function Qw(l,u){return this.isSame(l,u)||this.isBefore(l,u)}function e0(l,u,p){var b,w,C;if(!this.isValid())return NaN;if(b=Ja(l,this),!b.isValid())return NaN;switch(w=(b.utcOffset()-this.utcOffset())*6e4,u=nt(u),u){case"year":C=xr(this,b)/12;break;case"month":C=xr(this,b);break;case"quarter":C=xr(this,b)/3;break;case"second":C=(this-b)/1e3;break;case"minute":C=(this-b)/6e4;break;case"hour":C=(this-b)/36e5;break;case"day":C=(this-b-w)/864e5;break;case"week":C=(this-b-w)/6048e5;break;default:C=this-b}return p?C:it(C)}function xr(l,u){if(l.date()<u.date())return-xr(u,l);var p=(u.year()-l.year())*12+(u.month()-l.month()),b=l.clone().add(p,"months"),w,C;return u-b<0?(w=l.clone().add(p-1,"months"),C=(u-b)/(b-w)):(w=l.clone().add(p+1,"months"),C=(u-b)/(w-b)),-(p+C)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function t0(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function n0(l){if(!this.isValid())return null;var u=l!==!0,p=u?this.clone().utc():this;return p.year()<0||p.year()>9999?tt(p,u?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):I(Date.prototype.toISOString)?u?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",tt(p,"Z")):tt(p,u?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function i0(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var l="moment",u="",p,b,w,C;return this.isLocal()||(l=this.utcOffset()===0?"moment.utc":"moment.parseZone",u="Z"),p="["+l+'("]',b=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",w="-MM-DD[T]HH:mm:ss.SSS",C=u+'[")]',this.format(p+b+w+C)}function s0(l){l||(l=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var u=tt(this,l);return this.localeData().postformat(u)}function r0(l,u){return this.isValid()&&(M(l)&&l.isValid()||ge(l).isValid())?ft({to:this,from:l}).locale(this.locale()).humanize(!u):this.localeData().invalidDate()}function o0(l){return this.from(ge(),l)}function a0(l,u){return this.isValid()&&(M(l)&&l.isValid()||ge(l).isValid())?ft({from:this,to:l}).locale(this.locale()).humanize(!u):this.localeData().invalidDate()}function l0(l){return this.to(ge(),l)}function eu(l){var u;return l===void 0?this._locale._abbr:(u=At(l),u!=null&&(this._locale=u),this)}var tu=E("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(l){return l===void 0?this.localeData():this.locale(l)});function nu(){return this._locale}var _r=1e3,ai=60*_r,Sr=60*ai,iu=(365*400+97)*24*Sr;function li(l,u){return(l%u+u)%u}function su(l,u,p){return l<100&&l>=0?new Date(l+400,u,p)-iu:new Date(l,u,p).valueOf()}function ru(l,u,p){return l<100&&l>=0?Date.UTC(l+400,u,p)-iu:Date.UTC(l,u,p)}function c0(l){var u,p;if(l=nt(l),l===void 0||l==="millisecond"||!this.isValid())return this;switch(p=this._isUTC?ru:su,l){case"year":u=p(this.year(),0,1);break;case"quarter":u=p(this.year(),this.month()-this.month()%3,1);break;case"month":u=p(this.year(),this.month(),1);break;case"week":u=p(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":u=p(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":u=p(this.year(),this.month(),this.date());break;case"hour":u=this._d.valueOf(),u-=li(u+(this._isUTC?0:this.utcOffset()*ai),Sr);break;case"minute":u=this._d.valueOf(),u-=li(u,ai);break;case"second":u=this._d.valueOf(),u-=li(u,_r);break}return this._d.setTime(u),e.updateOffset(this,!0),this}function d0(l){var u,p;if(l=nt(l),l===void 0||l==="millisecond"||!this.isValid())return this;switch(p=this._isUTC?ru:su,l){case"year":u=p(this.year()+1,0,1)-1;break;case"quarter":u=p(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":u=p(this.year(),this.month()+1,1)-1;break;case"week":u=p(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":u=p(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":u=p(this.year(),this.month(),this.date()+1)-1;break;case"hour":u=this._d.valueOf(),u+=Sr-li(u+(this._isUTC?0:this.utcOffset()*ai),Sr)-1;break;case"minute":u=this._d.valueOf(),u+=ai-li(u,ai)-1;break;case"second":u=this._d.valueOf(),u+=_r-li(u,_r)-1;break}return this._d.setTime(u),e.updateOffset(this,!0),this}function u0(){return this._d.valueOf()-(this._offset||0)*6e4}function h0(){return Math.floor(this.valueOf()/1e3)}function f0(){return new Date(this.valueOf())}function p0(){var l=this;return[l.year(),l.month(),l.date(),l.hour(),l.minute(),l.second(),l.millisecond()]}function g0(){var l=this;return{years:l.year(),months:l.month(),date:l.date(),hours:l.hours(),minutes:l.minutes(),seconds:l.seconds(),milliseconds:l.milliseconds()}}function m0(){return this.isValid()?this.toISOString():null}function y0(){return x(this)}function b0(){return f({},m(this))}function w0(){return m(this).overflow}function v0(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),W("N",el),W("NN",el),W("NNN",el),W("NNNN",P0),W("NNNNN",A0),ce(["N","NN","NNN","NNNN","NNNNN"],function(l,u,p,b){var w=p._locale.erasParse(l,b,p._strict);w?m(p).era=w:m(p).invalidEra=l}),W("y",ri),W("yy",ri),W("yyy",ri),W("yyyy",ri),W("yo",N0),ce(["y","yy","yyy","yyyy"],Fe),ce(["yo"],function(l,u,p,b){var w;p._locale._eraYearOrdinalRegex&&(w=l.match(p._locale._eraYearOrdinalRegex)),p._locale.eraYearOrdinalParse?u[Fe]=p._locale.eraYearOrdinalParse(l,w):u[Fe]=parseInt(l,10)});function x0(l,u){var p,b,w,C=this._eras||At("en")._eras;for(p=0,b=C.length;p<b;++p){switch(typeof C[p].since){case"string":w=e(C[p].since).startOf("day"),C[p].since=w.valueOf();break}switch(typeof C[p].until){case"undefined":C[p].until=1/0;break;case"string":w=e(C[p].until).startOf("day").valueOf(),C[p].until=w.valueOf();break}}return C}function _0(l,u,p){var b,w,C=this.eras(),P,U,X;for(l=l.toUpperCase(),b=0,w=C.length;b<w;++b)if(P=C[b].name.toUpperCase(),U=C[b].abbr.toUpperCase(),X=C[b].narrow.toUpperCase(),p)switch(u){case"N":case"NN":case"NNN":if(U===l)return C[b];break;case"NNNN":if(P===l)return C[b];break;case"NNNNN":if(X===l)return C[b];break}else if([P,U,X].indexOf(l)>=0)return C[b]}function S0(l,u){var p=l.since<=l.until?1:-1;return u===void 0?e(l.since).year():e(l.since).year()+(u-l.offset)*p}function k0(){var l,u,p,b=this.localeData().eras();for(l=0,u=b.length;l<u;++l)if(p=this.clone().startOf("day").valueOf(),b[l].since<=p&&p<=b[l].until||b[l].until<=p&&p<=b[l].since)return b[l].name;return""}function C0(){var l,u,p,b=this.localeData().eras();for(l=0,u=b.length;l<u;++l)if(p=this.clone().startOf("day").valueOf(),b[l].since<=p&&p<=b[l].until||b[l].until<=p&&p<=b[l].since)return b[l].narrow;return""}function T0(){var l,u,p,b=this.localeData().eras();for(l=0,u=b.length;l<u;++l)if(p=this.clone().startOf("day").valueOf(),b[l].since<=p&&p<=b[l].until||b[l].until<=p&&p<=b[l].since)return b[l].abbr;return""}function D0(){var l,u,p,b,w=this.localeData().eras();for(l=0,u=w.length;l<u;++l)if(p=w[l].since<=w[l].until?1:-1,b=this.clone().startOf("day").valueOf(),w[l].since<=b&&b<=w[l].until||w[l].until<=b&&b<=w[l].since)return(this.year()-e(w[l].since).year())*p+w[l].offset;return this.year()}function O0(l){return r(this,"_erasNameRegex")||tl.call(this),l?this._erasNameRegex:this._erasRegex}function M0(l){return r(this,"_erasAbbrRegex")||tl.call(this),l?this._erasAbbrRegex:this._erasRegex}function E0(l){return r(this,"_erasNarrowRegex")||tl.call(this),l?this._erasNarrowRegex:this._erasRegex}function el(l,u){return u.erasAbbrRegex(l)}function P0(l,u){return u.erasNameRegex(l)}function A0(l,u){return u.erasNarrowRegex(l)}function N0(l,u){return u._eraYearOrdinalRegex||ri}function tl(){var l=[],u=[],p=[],b=[],w,C,P=this.eras();for(w=0,C=P.length;w<C;++w)u.push(Ge(P[w].name)),l.push(Ge(P[w].abbr)),p.push(Ge(P[w].narrow)),b.push(Ge(P[w].name)),b.push(Ge(P[w].abbr)),b.push(Ge(P[w].narrow));this._erasRegex=new RegExp("^("+b.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+u.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+l.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+p.join("|")+")","i")}H(0,["gg",2],0,function(){return this.weekYear()%100}),H(0,["GG",2],0,function(){return this.isoWeekYear()%100});function kr(l,u){H(0,[l,l.length],0,u)}kr("gggg","weekYear"),kr("ggggg","weekYear"),kr("GGGG","isoWeekYear"),kr("GGGGG","isoWeekYear"),Ie("weekYear","gg"),Ie("isoWeekYear","GG"),Le("weekYear",1),Le("isoWeekYear",1),W("G",hr),W("g",hr),W("GG",pe,$e),W("gg",pe,$e),W("GGGG",Wa,za),W("gggg",Wa,za),W("GGGGG",ur,cr),W("ggggg",ur,cr),Qi(["gggg","ggggg","GGGG","GGGGG"],function(l,u,p,b){u[b.substr(0,2)]=Z(l)}),Qi(["gg","GG"],function(l,u,p,b){u[b]=e.parseTwoDigitYear(l)});function R0(l){return ou.call(this,l,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function I0(l){return ou.call(this,l,this.isoWeek(),this.isoWeekday(),1,4)}function L0(){return Pt(this.year(),1,4)}function F0(){return Pt(this.isoWeekYear(),1,4)}function B0(){var l=this.localeData()._week;return Pt(this.year(),l.dow,l.doy)}function z0(){var l=this.localeData()._week;return Pt(this.weekYear(),l.dow,l.doy)}function ou(l,u,p,b,w){var C;return l==null?ns(this,b,w).year:(C=Pt(l,b,w),u>C&&(u=C),W0.call(this,l,u,p,b,w))}function W0(l,u,p,b,w){var C=Fd(l,u,p,b,w),P=ts(C.year,0,C.dayOfYear);return this.year(P.getUTCFullYear()),this.month(P.getUTCMonth()),this.date(P.getUTCDate()),this}H("Q",0,"Qo","quarter"),Ie("quarter","Q"),Le("quarter",7),W("Q",Dd),ce("Q",function(l,u){u[Mt]=(Z(l)-1)*3});function H0(l){return l==null?Math.ceil((this.month()+1)/3):this.month((l-1)*3+this.month()%3)}H("D",["DD",2],"Do","date"),Ie("date","D"),Le("date",9),W("D",pe),W("DD",pe,$e),W("Do",function(l,u){return l?u._dayOfMonthOrdinalParse||u._ordinalParse:u._dayOfMonthOrdinalParseLenient}),ce(["D","DD"],wt),ce("Do",function(l,u){u[wt]=Z(l.match(pe)[0])});var au=si("Date",!0);H("DDD",["DDDD",3],"DDDo","dayOfYear"),Ie("dayOfYear","DDD"),Le("dayOfYear",4),W("DDD",dr),W("DDDD",Od),ce(["DDD","DDDD"],function(l,u,p){p._dayOfYear=Z(l)});function Y0(l){var u=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return l==null?u:this.add(l-u,"d")}H("m",["mm",2],0,"minute"),Ie("minute","m"),Le("minute",14),W("m",pe),W("mm",pe,$e),ce(["m","mm"],ht);var V0=si("Minutes",!1);H("s",["ss",2],0,"second"),Ie("second","s"),Le("second",15),W("s",pe),W("ss",pe,$e),ce(["s","ss"],Et);var j0=si("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return this.millisecond()*10}),H(0,["SSSSS",5],0,function(){return this.millisecond()*100}),H(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),H(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),H(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),H(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Ie("millisecond","ms"),Le("millisecond",16),W("S",dr,Dd),W("SS",dr,$e),W("SSS",dr,Od);var sn,lu;for(sn="SSSS";sn.length<=9;sn+="S")W(sn,ri);function U0(l,u){u[Dn]=Z(("0."+l)*1e3)}for(sn="S";sn.length<=9;sn+="S")ce(sn,U0);lu=si("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");function $0(){return this._isUTC?"UTC":""}function G0(){return this._isUTC?"Coordinated Universal Time":""}var R=T.prototype;R.add=zw,R.calendar=$w,R.clone=Gw,R.diff=e0,R.endOf=d0,R.format=s0,R.from=r0,R.fromNow=o0,R.to=a0,R.toNow=l0,R.get=qy,R.invalidAt=w0,R.isAfter=Kw,R.isBefore=qw,R.isBetween=Xw,R.isSame=Zw,R.isSameOrAfter=Jw,R.isSameOrBefore=Qw,R.isValid=y0,R.lang=tu,R.locale=eu,R.localeData=nu,R.max=yw,R.min=mw,R.parsingFlags=b0,R.set=Xy,R.startOf=c0,R.subtract=Ww,R.toArray=p0,R.toObject=g0,R.toDate=f0,R.toISOString=n0,R.inspect=i0,typeof Symbol<"u"&&Symbol.for!=null&&(R[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),R.toJSON=m0,R.toString=t0,R.unix=h0,R.valueOf=u0,R.creationData=v0,R.eraName=k0,R.eraNarrow=C0,R.eraAbbr=T0,R.eraYear=D0,R.year=Ld,R.isLeapYear=gb,R.weekYear=R0,R.isoWeekYear=I0,R.quarter=R.quarters=H0,R.month=Rd,R.daysInMonth=hb,R.week=R.weeks=xb,R.isoWeek=R.isoWeeks=_b,R.weeksInYear=B0,R.weeksInWeekYear=z0,R.isoWeeksInYear=L0,R.isoWeeksInISOWeekYear=F0,R.date=au,R.day=R.days=Ib,R.weekday=Lb,R.isoWeekday=Fb,R.dayOfYear=Y0,R.hour=R.hours=jb,R.minute=R.minutes=V0,R.second=R.seconds=j0,R.millisecond=R.milliseconds=lu,R.utcOffset=Tw,R.utc=Ow,R.local=Mw,R.parseZone=Ew,R.hasAlignedHourOffset=Pw,R.isDST=Aw,R.isLocal=Rw,R.isUtcOffset=Iw,R.isUtc=qd,R.isUTC=qd,R.zoneAbbr=$0,R.zoneName=G0,R.dates=E("dates accessor is deprecated. Use date instead.",au),R.months=E("months accessor is deprecated. Use month instead",Rd),R.years=E("years accessor is deprecated. Use year instead",Ld),R.zone=E("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Dw),R.isDSTShifted=E("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Nw);function K0(l){return ge(l*1e3)}function q0(){return ge.apply(null,arguments).parseZone()}function cu(l){return l}var se=L.prototype;se.calendar=V,se.longDateFormat=zy,se.invalidDate=Hy,se.ordinal=jy,se.preparse=cu,se.postformat=cu,se.relativeTime=$y,se.pastFuture=Gy,se.set=B,se.eras=x0,se.erasParse=_0,se.erasConvertYear=S0,se.erasAbbrRegex=M0,se.erasNameRegex=O0,se.erasNarrowRegex=E0,se.months=lb,se.monthsShort=cb,se.monthsParse=ub,se.monthsRegex=pb,se.monthsShortRegex=fb,se.week=yb,se.firstDayOfYear=vb,se.firstDayOfWeek=wb,se.weekdays=Eb,se.weekdaysMin=Ab,se.weekdaysShort=Pb,se.weekdaysParse=Rb,se.weekdaysRegex=Bb,se.weekdaysShortRegex=zb,se.weekdaysMinRegex=Wb,se.isPM=Yb,se.meridiem=Ub;function Cr(l,u,p,b){var w=At(),C=y().set(b,u);return w[p](C,l)}function du(l,u,p){if(c(l)&&(u=l,l=void 0),l=l||"",u!=null)return Cr(l,u,p,"month");var b,w=[];for(b=0;b<12;b++)w[b]=Cr(l,b,p,"month");return w}function nl(l,u,p,b){typeof l=="boolean"?(c(u)&&(p=u,u=void 0),u=u||""):(u=l,p=u,l=!1,c(u)&&(p=u,u=void 0),u=u||"");var w=At(),C=l?w._week.dow:0,P,U=[];if(p!=null)return Cr(u,(p+C)%7,b,"day");for(P=0;P<7;P++)U[P]=Cr(u,(P+C)%7,b,"day");return U}function X0(l,u){return du(l,u,"months")}function Z0(l,u){return du(l,u,"monthsShort")}function J0(l,u,p){return nl(l,u,p,"weekdays")}function Q0(l,u,p){return nl(l,u,p,"weekdaysShort")}function ev(l,u,p){return nl(l,u,p,"weekdaysMin")}nn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(l){var u=l%10,p=Z(l%100/10)===1?"th":u===1?"st":u===2?"nd":u===3?"rd":"th";return l+p}}),e.lang=E("moment.lang is deprecated. Use moment.locale instead.",nn),e.langData=E("moment.langData is deprecated. Use moment.localeData instead.",At);var Nt=Math.abs;function tv(){var l=this._data;return this._milliseconds=Nt(this._milliseconds),this._days=Nt(this._days),this._months=Nt(this._months),l.milliseconds=Nt(l.milliseconds),l.seconds=Nt(l.seconds),l.minutes=Nt(l.minutes),l.hours=Nt(l.hours),l.months=Nt(l.months),l.years=Nt(l.years),this}function uu(l,u,p,b){var w=ft(u,p);return l._milliseconds+=b*w._milliseconds,l._days+=b*w._days,l._months+=b*w._months,l._bubble()}function nv(l,u){return uu(this,l,u,1)}function iv(l,u){return uu(this,l,u,-1)}function hu(l){return l<0?Math.floor(l):Math.ceil(l)}function sv(){var l=this._milliseconds,u=this._days,p=this._months,b=this._data,w,C,P,U,X;return l>=0&&u>=0&&p>=0||l<=0&&u<=0&&p<=0||(l+=hu(il(p)+u)*864e5,u=0,p=0),b.milliseconds=l%1e3,w=it(l/1e3),b.seconds=w%60,C=it(w/60),b.minutes=C%60,P=it(C/60),b.hours=P%24,u+=it(P/24),X=it(fu(u)),p+=X,u-=hu(il(X)),U=it(p/12),p%=12,b.days=u,b.months=p,b.years=U,this}function fu(l){return l*4800/146097}function il(l){return l*146097/4800}function rv(l){if(!this.isValid())return NaN;var u,p,b=this._milliseconds;if(l=nt(l),l==="month"||l==="quarter"||l==="year")switch(u=this._days+b/864e5,p=this._months+fu(u),l){case"month":return p;case"quarter":return p/3;case"year":return p/12}else switch(u=this._days+Math.round(il(this._months)),l){case"week":return u/7+b/6048e5;case"day":return u+b/864e5;case"hour":return u*24+b/36e5;case"minute":return u*1440+b/6e4;case"second":return u*86400+b/1e3;case"millisecond":return Math.floor(u*864e5)+b;default:throw new Error("Unknown unit "+l)}}function ov(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+Z(this._months/12)*31536e6:NaN}function Rt(l){return function(){return this.as(l)}}var av=Rt("ms"),lv=Rt("s"),cv=Rt("m"),dv=Rt("h"),uv=Rt("d"),hv=Rt("w"),fv=Rt("M"),pv=Rt("Q"),gv=Rt("y");function mv(){return ft(this)}function yv(l){return l=nt(l),this.isValid()?this[l+"s"]():NaN}function Mn(l){return function(){return this.isValid()?this._data[l]:NaN}}var bv=Mn("milliseconds"),wv=Mn("seconds"),vv=Mn("minutes"),xv=Mn("hours"),_v=Mn("days"),Sv=Mn("months"),kv=Mn("years");function Cv(){return it(this.days()/7)}var It=Math.round,ci={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Tv(l,u,p,b,w){return w.relativeTime(u||1,!!p,l,b)}function Dv(l,u,p,b){var w=ft(l).abs(),C=It(w.as("s")),P=It(w.as("m")),U=It(w.as("h")),X=It(w.as("d")),de=It(w.as("M")),ze=It(w.as("w")),Lt=It(w.as("y")),rn=C<=p.ss&&["s",C]||C<p.s&&["ss",C]||P<=1&&["m"]||P<p.m&&["mm",P]||U<=1&&["h"]||U<p.h&&["hh",U]||X<=1&&["d"]||X<p.d&&["dd",X];return p.w!=null&&(rn=rn||ze<=1&&["w"]||ze<p.w&&["ww",ze]),rn=rn||de<=1&&["M"]||de<p.M&&["MM",de]||Lt<=1&&["y"]||["yy",Lt],rn[2]=u,rn[3]=+l>0,rn[4]=b,Tv.apply(null,rn)}function Ov(l){return l===void 0?It:typeof l=="function"?(It=l,!0):!1}function Mv(l,u){return ci[l]===void 0?!1:u===void 0?ci[l]:(ci[l]=u,l==="s"&&(ci.ss=u-1),!0)}function Ev(l,u){if(!this.isValid())return this.localeData().invalidDate();var p=!1,b=ci,w,C;return typeof l=="object"&&(u=l,l=!1),typeof l=="boolean"&&(p=l),typeof u=="object"&&(b=Object.assign({},ci,u),u.s!=null&&u.ss==null&&(b.ss=u.s-1)),w=this.localeData(),C=Dv(this,!p,b,w),p&&(C=w.pastFuture(+this,C)),w.postformat(C)}var sl=Math.abs;function di(l){return(l>0)-(l<0)||+l}function Tr(){if(!this.isValid())return this.localeData().invalidDate();var l=sl(this._milliseconds)/1e3,u=sl(this._days),p=sl(this._months),b,w,C,P,U=this.asSeconds(),X,de,ze,Lt;return U?(b=it(l/60),w=it(b/60),l%=60,b%=60,C=it(p/12),p%=12,P=l?l.toFixed(3).replace(/\.?0+$/,""):"",X=U<0?"-":"",de=di(this._months)!==di(U)?"-":"",ze=di(this._days)!==di(U)?"-":"",Lt=di(this._milliseconds)!==di(U)?"-":"",X+"P"+(C?de+C+"Y":"")+(p?de+p+"M":"")+(u?ze+u+"D":"")+(w||b||l?"T":"")+(w?Lt+w+"H":"")+(b?Lt+b+"M":"")+(l?Lt+P+"S":"")):"P0D"}var ee=wr.prototype;ee.isValid=_w,ee.abs=tv,ee.add=nv,ee.subtract=iv,ee.as=rv,ee.asMilliseconds=av,ee.asSeconds=lv,ee.asMinutes=cv,ee.asHours=dv,ee.asDays=uv,ee.asWeeks=hv,ee.asMonths=fv,ee.asQuarters=pv,ee.asYears=gv,ee.valueOf=ov,ee._bubble=sv,ee.clone=mv,ee.get=yv,ee.milliseconds=bv,ee.seconds=wv,ee.minutes=vv,ee.hours=xv,ee.days=_v,ee.weeks=Cv,ee.months=Sv,ee.years=kv,ee.humanize=Ev,ee.toISOString=Tr,ee.toString=Tr,ee.toJSON=Tr,ee.locale=eu,ee.localeData=nu,ee.toIsoString=E("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Tr),ee.lang=tu,H("X",0,0,"unix"),H("x",0,0,"valueOf"),W("x",hr),W("X",Jy),ce("X",function(l,u,p){p._d=new Date(parseFloat(l)*1e3)}),ce("x",function(l,u,p){p._d=new Date(Z(l))});return e.version="2.29.4",t(ge),e.fn=R,e.min=bw,e.max=ww,e.now=vw,e.utc=y,e.unix=K0,e.months=X0,e.isDate=d,e.locale=nn,e.invalid=_,e.duration=ft,e.isMoment=M,e.weekdays=J0,e.parseZone=q0,e.localeData=At,e.isDuration=vr,e.monthsShort=Z0,e.weekdaysMin=ev,e.defineLocale=Ua,e.updateLocale=qb,e.locales=Xb,e.weekdaysShort=Q0,e.normalizeUnits=nt,e.relativeTimeRounding=Ov,e.relativeTimeThreshold=Mv,e.calendarFormat=Uw,e.prototype=R,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})});var Te=vt((QE,Pf)=>{Pf.exports=window.React});var Mp=vt((MN,Op)=>{"use strict";var Dp=Object.getOwnPropertySymbols,RT=Object.prototype.hasOwnProperty,IT=Object.prototype.propertyIsEnumerable;function LT(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function FT(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var i=Object.getOwnPropertyNames(e).map(function(r){return e[r]});if(i.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(r){s[r]=r}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Op.exports=FT()?Object.assign:function(n,e){for(var t,i=LT(n),s,r=1;r<arguments.length;r++){t=Object(arguments[r]);for(var o in t)RT.call(t,o)&&(i[o]=t[o]);if(Dp){s=Dp(t);for(var a=0;a<s.length;a++)IT.call(t,s[a])&&(i[s[a]]=t[s[a]])}}return i}});var Ap=vt(Vs=>{"use strict";Mp();var BT=Te(),Ep=60103;Vs.Fragment=60107;typeof Symbol=="function"&&Symbol.for&&(Bc=Symbol.for,Ep=Bc("react.element"),Vs.Fragment=Bc("react.fragment"));var Bc,zT=BT.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,WT=Object.prototype.hasOwnProperty,HT={key:!0,ref:!0,__self:!0,__source:!0};function Pp(n,e,t){var i,s={},r=null,o=null;t!==void 0&&(r=""+t),e.key!==void 0&&(r=""+e.key),e.ref!==void 0&&(o=e.ref);for(i in e)WT.call(e,i)&&!HT.hasOwnProperty(i)&&(s[i]=e[i]);if(n&&n.defaultProps)for(i in e=n.defaultProps,e)s[i]===void 0&&(s[i]=e[i]);return{$$typeof:Ep,type:n,key:r,ref:o,props:s,_owner:zT.current}}Vs.jsx=Pp;Vs.jsxs=Pp});var Rp=vt((PN,Np)=>{"use strict";Np.exports=Ap()});var Tg=vt((WI,Cg)=>{"use strict";Cg.exports=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var i,s,r;if(Array.isArray(e)){if(i=e.length,i!=t.length)return!1;for(s=i;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(r=Object.keys(e),i=r.length,i!==Object.keys(t).length)return!1;for(s=i;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[s]))return!1;for(s=i;s--!==0;){var o=r[s];if(!n(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}});var wm=vt((Ot,bm)=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});function bt(n){return typeof n=="object"&&!("toString"in n)?Object.prototype.toString.call(n).slice(8,-1):n}var HD=typeof process=="object"&&!0;function ut(n,e){if(!n)throw HD?new Error("Invariant failed"):new Error(e())}Ot.invariant=ut;var nd=Object.prototype.hasOwnProperty,YD=Array.prototype.splice,VD=Object.prototype.toString;function Jn(n){return VD.call(n).slice(8,-1)}var Da=Object.assign||function(n,e){return id(e).forEach(function(t){nd.call(e,t)&&(n[t]=e[t])}),n},id=typeof Object.getOwnPropertySymbols=="function"?function(n){return Object.keys(n).concat(Object.getOwnPropertySymbols(n))}:function(n){return Object.keys(n)};function _n(n){return Array.isArray(n)?Da(n.constructor(n.length),n):Jn(n)==="Map"?new Map(n):Jn(n)==="Set"?new Set(n):n&&typeof n=="object"?Da(Object.create(Object.getPrototypeOf(n)),n):n}var mm=function(){function n(){this.commands=Da({},jD),this.update=this.update.bind(this),this.update.extend=this.extend=this.extend.bind(this),this.update.isEquals=function(e,t){return e===t},this.update.newContext=function(){return new n().update}}return Object.defineProperty(n.prototype,"isEquals",{get:function(){return this.update.isEquals},set:function(e){this.update.isEquals=e},enumerable:!0,configurable:!0}),n.prototype.extend=function(e,t){this.commands[e]=t},n.prototype.update=function(e,t){var i=this,s=typeof t=="function"?{$apply:t}:t;Array.isArray(e)&&Array.isArray(s)||ut(!Array.isArray(s),function(){return"update(): You provided an invalid spec to update(). The spec may not contain an array except as the value of $set, $push, $unshift, $splice or any custom command allowing an array value."}),ut(typeof s=="object"&&s!==null,function(){return"update(): You provided an invalid spec to update(). The spec and every included key path must be plain objects containing one of the "+("following commands: "+Object.keys(i.commands).join(", ")+".")});var r=e;return id(s).forEach(function(o){if(nd.call(i.commands,o)){var a=e===r;r=i.commands[o](s[o],r,s,e),a&&i.isEquals(r,e)&&(r=e)}else{var c=Jn(e)==="Map"?i.update(e.get(o),s[o]):i.update(e[o],s[o]),d=Jn(r)==="Map"?r.get(o):r[o];(!i.isEquals(c,d)||typeof c>"u"&&!nd.call(e,o))&&(r===e&&(r=_n(e)),Jn(r)==="Map"?r.set(o,c):r[o]=c)}}),r},n}();Ot.Context=mm;var jD={$push:function(n,e,t){return pm(e,t,"$push"),n.length?e.concat(n):e},$unshift:function(n,e,t){return pm(e,t,"$unshift"),n.length?n.concat(e):e},$splice:function(n,e,t,i){return UD(e,t),n.forEach(function(s){ym(s),e===i&&s.length&&(e=_n(i)),YD.apply(e,s)}),e},$set:function(n,e,t){return GD(t),n},$toggle:function(n,e){er(n,"$toggle");var t=n.length?_n(e):e;return n.forEach(function(i){t[i]=!e[i]}),t},$unset:function(n,e,t,i){return er(n,"$unset"),n.forEach(function(s){Object.hasOwnProperty.call(e,s)&&(e===i&&(e=_n(i)),delete e[s])}),e},$add:function(n,e,t,i){return gm(e,"$add"),er(n,"$add"),Jn(e)==="Map"?n.forEach(function(s){var r=s[0],o=s[1];e===i&&e.get(r)!==o&&(e=_n(i)),e.set(r,o)}):n.forEach(function(s){e===i&&!e.has(s)&&(e=_n(i)),e.add(s)}),e},$remove:function(n,e,t,i){return gm(e,"$remove"),er(n,"$remove"),n.forEach(function(s){e===i&&e.has(s)&&(e=_n(i)),e.delete(s)}),e},$merge:function(n,e,t,i){return KD(e,n),id(n).forEach(function(s){n[s]!==e[s]&&(e===i&&(e=_n(i)),e[s]=n[s])}),e},$apply:function(n,e){return $D(n),n(e)}},sd=new mm;Ot.isEquals=sd.update.isEquals;Ot.extend=sd.extend;Ot.default=sd.update;Ot.default.default=bm.exports=Da(Ot.default,Ot);function pm(n,e,t){ut(Array.isArray(n),function(){return"update(): expected target of "+bt(t)+" to be an array; got "+bt(n)+"."}),er(e[t],t)}function er(n,e){ut(Array.isArray(n),function(){return"update(): expected spec of "+bt(e)+" to be an array; got "+bt(n)+". Did you forget to wrap your parameter in an array?"})}function UD(n,e){ut(Array.isArray(n),function(){return"Expected $splice target to be an array; got "+bt(n)}),ym(e.$splice)}function ym(n){ut(Array.isArray(n),function(){return"update(): expected spec of $splice to be an array of arrays; got "+bt(n)+". Did you forget to wrap your parameters in an array?"})}function $D(n){ut(typeof n=="function",function(){return"update(): expected spec of $apply to be a function; got "+bt(n)+"."})}function GD(n){ut(Object.keys(n).length===1,function(){return"Cannot have more than one key in an object with $set"})}function KD(n,e){ut(e&&typeof e=="object",function(){return"update(): $merge expects a spec of type 'object'; got "+bt(e)}),ut(n&&typeof n=="object",function(){return"update(): $merge expects a target of type 'object'; got "+bt(n)})}function gm(n,e){var t=Jn(n);ut(t==="Map"||t==="Set",function(){return"update(): "+bt(e)+" expects a target of type Set or Map; got "+bt(t)})}});var Fv={calculateEventPosition:(n,e)=>{if(e==="viewport")return n.target.getBoundingClientRect();if(e==="body"){let t=function(s,r){var o=0;do isNaN(s?.["offset"+r])||(o+=s?.["offset"+r]);while(s=s?.offsetParent);return o};return{top:t(n.target,"Top"),left:t(n.target,"Left"),right:t(n.target,"Right"),bottom:t(n.target,"Bottom"),width:n.target.getBoundingClientRect().width,height:n.target.getBoundingClientRect().height}}},insertContextMenu:n=>{let e=!wp.data.select("getgenie").contextMenu().open;wp.data.dispatch("getgenie").setContextMenu({open:e,buttonEvent:n})},showSidebar:n=>{let e=wp.data.select("getgenie").sidebar().existingInputValue||"",t="WriteTemplatesScreen",i=n.slug;i==="list"&&(t="TemplateListScreen"),wp.data.dispatch("getgenie").setContextMenu({open:!1}),wp.data.dispatch("getgenie").setSidebar({open:!0,currentWritingMode:n?.mode,component:t,currentTemplate:i,existingInputValue:e.replace(/<br\s*[\/]?>/g,"")})}},ol=Fv;var{Toolbar:Bv,Icon:zv}=wp.components?wp.components:{Toolbar:()=>null,Icon:()=>null,ToolbarGroup:()=>null},{BlockControls:Wv}=wp.blockEditor?wp.blockEditor:{BlockControls:()=>null,BlockEdit:()=>null},{registerFormatType:Hv,insert:pu,getTextContent:Yv,slice:Vv}=wp.richText?wp.richText:{registerFormatType:()=>null,insert:()=>null,getTextContent:()=>null,slice:()=>null},jv=wp.data.select("getgenie").sidebar(),gu=`${window.getGenie.config.assetsUrl}dist/admin/images/genie-head.svg`,al=null;function Uv(n,e){if(!n)return;let t=document.createElement("div");t.className="getgenie";let i=document.createElement("div"),s=document.createElement("img");s.src=gu,s.style.width="19px",s.style.cursor="pointer",s.style.marginBlock="auto",s.style.marginInline="8px",s.style.marginTop="11px",s.onclick=r=>e(r),i.appendChild(s),t.appendChild(i),n.appendChild(t)}Hv("genie/context-menu",{title:jv.__("Context Menu","getgenie"),tagName:"a",className:"getgenie-context-menu",edit:({isActive:n,value:e,onChange:t})=>{let i=Yv(Vv(e)),s=r=>{let o=ol.calculateEventPosition(r,"viewport"),a=wp.data.select("getgenie").contextMenu().open;ol.insertContextMenu(o,!a)};return wp?.components?(setTimeout(()=>{if(document.querySelector(".editor-styles-wrapper.has-multi-selection")){let r=0,o=setInterval(()=>{let a=document.querySelector(".block-editor-block-toolbar > .components-toolbar-group ");if(r++,r>=30&&clearInterval(o),!a)return;clearInterval(o),i="";let c=wp.data.select("core/block-editor").getMultiSelectedBlocks();for(let h of c)if(h.attributes.content)i+=h.attributes.content;else for(let f of h.innerBlocks)i+=f.attributes.content;i=window.getSelection().toString(),i=i.replace(/\n/g,". "),wp.data.dispatch("getgenie").setContextMenu({isDisable:{expandOutline:!0}}),a?.querySelector(".getgenie")||Uv(a,s)},500)}else wp.data.select("getgenie")?.contextMenu()?.isDisable?.expandOutline&&wp.data.dispatch("getgenie").setContextMenu({isDisable:{expandOutline:!1}})},500),al&&clearTimeout(al),al=setTimeout(()=>{let r=wp.data.select("core/editor")?.getEditedPostContent(),o=wp.data.select("core/editor")?.getEditedPostAttribute("title");o&&(r=`<h1>${o}</h1>`+r);let a=wp.data.select("core/block-editor"),c=a.getBlocks(),d=a.getSelectedBlockClientId(),h="",f,y,g,m="";for(let v of c)if(h+=v.attributes.content,v.clientId===d){f=e.formats.length-e.end,y=h.length-f,g=h.substring(0,y),m=g.slice(-1e3);break}wp.data.dispatch("getgenie").setSidebar({existingInputValue:i,insertTextField:e,currentPostContent:r}),wp.data.dispatch("getgenie").setContextMenu({inputContent:{beforeCaret:m,selectedText:i,afterCaret:""},insertionField:e,contextMenuCallback:{continueWriting:(v,x,{selectedText:_})=>{let S=v.replace(/(\<br[\s]*\/?\>[\s]*)+/g,`
`);S=" "+_+" "+S,t(pu(x,S))},expandOutline:v=>{let x=wp.data.select("core/block-editor"),_=x.getBlocks(),S=x.getSelectedBlockClientId(),k=_.findIndex(M=>M.clientId===S),T=v.replace(/(\<br[\s]*\/?\>[\s]*)+/g,"<br>").split("<br>");for(let M of T)wp.data.dispatch("core/block-editor").insertBlocks(wp.blocks.createBlock("core/paragraph",{content:M}),k+1),k++},rewrite:(v,x)=>{let _=v.replace(/(\<br[\s]*\/?\>[\s]*)+/g,`
`);t(pu(x,_))}}})},2e3),React.createElement(Wv,null,React.createElement(Bv,{className:"getgenie",label:"GetGenie"},React.createElement("div",{style:{position:"relative",display:"inline-flex"}},React.createElement(zv,{onClick:r=>s(r),icon:React.createElement("img",{style:{width:"19px",cursor:"pointer",marginBlock:"auto",marginInline:"8px"},src:gu}),size:28}))))):""}});var pi={};ui(pi,{ColorByStatScore:()=>Au,ContentAnalysis:()=>En,KeywordFinder:()=>ke,WPEditorTopButtons:()=>Pu,WebSourceAnalysis:()=>An});var xu=be(mu(),1),_u=be(wu(),1);var os={abalone:4,abare:3,abbruzzese:4,abed:2,aborigine:5,abruzzese:4,acreage:3,adame:3,adieu:2,adobe:3,anemone:4,anyone:3,apache:3,aphrodite:4,apostrophe:4,ariadne:4,cafe:2,calliope:4,catastrophe:4,chile:2,chloe:2,circe:2,coyote:3,daphne:2,epitome:4,eurydice:4,euterpe:3,every:2,everywhere:3,forever:3,gethsemane:4,guacamole:4,hermione:4,hyperbole:4,jesse:2,jukebox:2,karate:3,machete:3,maybe:2,naive:2,newlywed:3,penelope:4,people:2,persephone:4,phoebe:2,pulse:1,queue:1,recipe:3,riverbed:3,sesame:3,shoreline:2,simile:3,snuffleupagus:5,sometimes:2,syncope:3,tamale:3,waterbed:3,wednesday:2,yosemite:4,zoe:2};var vu={}.hasOwnProperty,Gv=new RegExp(["awe($|d|so)","cia(?:l|$)","tia","cius","cious","[^aeiou]giu","[aeiouy][^aeiouy]ion","iou","sia$","eous$","[oa]gue$",".[^aeiuoycgltdb]{2,}ed$",".ely$","^jua","uai","eau","^busi$","(?:[aeiouy](?:"+["[bcfgklmnprsvwxyz]","ch","dg","g[hn]","lch","l[lv]","mm","nch","n[cgn]","r[bcnsv]","squ","s[chkls]","th"].join("|")+")ed$)","(?:[aeiouy](?:"+["[bdfklmnprstvy]","ch","g[hn]","lch","l[lv]","mm","nch","nn","r[nsv]","squ","s[cklst]","th"].join("|")+")es$)"].join("|"),"g"),Kv=new RegExp("[aeiouy](?:"+["[bcdfgklmnprstvyz]","ch","dg","g[hn]","l[lv]","mm","n[cgns]","r[cnsv]","squ","s[cklst]","th"].join("|")+")e$","g"),qv=new RegExp("(?:"+["([^aeiouy])\\1l","[^aeiouy]ie(?:r|s?t)","[aeiouym]bl","eo","ism","asm","thm","dnt","snt","uity","dea","gean","oa","ua","react?","orbed","shred","eings?","[aeiouy]sh?e[rs]"].join("|")+")$","g"),Xv=new RegExp(["creat(?!u)","[^gq]ua[^auieo]","[aeiou]{3}","^(?:ia|mc|coa[dglx].)","^re(app|es|im|us)","(th|d)eist"].join("|"),"g"),Zv=new RegExp(["[^aeiou]y[ae]","[^l]lien","riet","dien","iu","io","ii","uen","[aeilotu]real","real[aeilotu]","iell","eo[^aeiou]","[aeiou]y[aeiou]"].join("|"),"g"),Jv=/[^s]ia/,Qv=new RegExp(["^(?:"+["un","fore","ware","none?","out","post","sub","pre","pro","dis","side","some"].join("|")+")","(?:"+["ly","less","some","ful","ers?","ness","cians?","ments?","ettes?","villes?","ships?","sides?","ports?","shires?","[gnst]ion(?:ed|s)?"].join("|")+")$"].join("|"),"g"),ex=new RegExp(["^(?:"+["above","anti","ante","counter","hyper","afore","agri","infra","intra","inter","over","semi","ultra","under","extra","dia","micro","mega","kilo","pico","nano","macro","somer"].join("|")+")","(?:fully|berry|woman|women|edly|union|((?:[bcdfghjklmnpqrstvwxz])|[aeiou])ye?ing)$"].join("|"),"g"),tx=/(creations?|ology|ologist|onomy|onomist)$/g;function Su(n){let e=(0,_u.default)(String(n)).toLowerCase().replace(/['’]/g,"").split(/\b/g),t=-1,i=0;for(;++t<e.length;)i+=nx(e[t].replace(/[^a-z]/g,""));return i}function nx(n){let e=0;if(n.length===0)return e;if(n.length<3)return 1;if(vu.call(os,n))return os[n];let t=(0,xu.default)(n,1);if(vu.call(os,t))return os[t];let i=c(1),s=c(-1);n=n.replace(tx,a(3)).replace(ex,a(2)).replace(Qv,a(1));let r=n.split(/[^aeiouy]+/),o=-1;for(;++o<r.length;)r[o]!==""&&e++;return n.replace(Gv,s).replace(Kv,s),n.replace(qv,i).replace(Xv,i).replace(Zv,i).replace(Jv,i),e||1;function a(d){return h;function h(){return e+=d,""}}function c(d){return h;function h(f){return e+=d,f}}}var ku=n=>{let e=[],t=n.trim().split(/[\s/]/);for(let i in t){let s=t[i].trim();s.length>0&&s!=="."&&(s.match(/[\w\d][.?!]$/)&&(s=s.replace(/[.?!]/,"")),e.push(s))}return e},ix=n=>(n=n.trim(),n.replace(/([.?!])\s+(?=\w)/g,"$1|").split("|").length),sx=n=>{let e=ku(n),t=0;for(let i in e)t+=rx(e[i]);return t},rx=n=>Su(n),ox=n=>(n=n.replace(/\s(prof{1,2})\./g," professor"),n=n.replace(/\s(rev)\./g," reverend"),n=n.replace(/\s(rt\.\shon)\./g," right honorary"),n=n.replace(/\s(msgr)\./g," monsignor"),n.replace(/\s(dr|mr|mrs|jr|sr|esq|messrs|mmes)\./g," title")),ax=n=>(n=n.replace(/(\(|\)|;|:|,|-|—)/g,""),n=n.replace(/^\s*[\r\n]/gm,""),n),lx=(n,e,t)=>206.835-1.015*(n/e)-84.6*(t/n),cx=(n,e,t)=>.39*(n/e)+11.8*(t/n)-15.59,Mr=n=>{if(typeof n!="string")throw new Error("text is not of type string");if(!n.length)throw new Error("text must not be an empty string");n=n.toLowerCase().trim(),n=ox(n),n=ax(n);let t=ku(n).length,i=ix(n),s=sx(n);return{grade_level:parseFloat(cx(t,i,s).toFixed(2)),reading_ease:parseFloat(lx(t,i,s).toFixed(2)),word_count:t,syllable_count:s,sentence_count:i}};var ke=class{content="";constructor(e=""){this.content=e}escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}findAllMatch(e=this.content,t=[]){let i=[];for(let s=0;s<t.length;s++){let r=t[s],o=this.findSingleMatch(e,r);i.push({keyword:r,count:o})}return i}findSingleMatch(e=this.content,t=""){let r=this.escapeRegExp(t).split(" ").join(String.raw`(\s+\w+\s+|\s+)`),o=e?.match(new RegExp(r,"gmi"));return o&&o.length>0?o.length:0}};var En=class{feedbacks={problems:[],results:[],improvements:[]};statistics={word:{},heading:{},focusKeyword:{score:{heading:0,content:0,metaDescription:0,metaTitle:0,imgAltText:0}},secondaryKeywords:{score:{heading:0,content:0}},keywords:{},image:{},internalLink:{},externalLink:{},imgAltText:{},nlp:{}};contentStats={totalScore:0,readabilityScore:0,readabilityTooltipText:""};constructor(e={},t={}){this.recommendation=t,this.url=e.url,this.title=e?.title||"",this.description=e?.description||"";let i=document.createElement("div");i.innerHTML=e.content,this.sourceContent=i.outerHTML}getStat=()=>!this.sourceContent||Object.keys(this.recommendation||{}).length===0?!1:(this.initScoreStats(),this.calculateTotalContent(),{statistics:this.statistics,feedbacks:this.feedbacks,contentStats:this.contentStats});getReadabilityText=e=>{let t=parseInt(e);switch(!0){case t>=90:return"Very easy to read. Easily understood by an average 11-year-old student.";case t>=80:return"Easy to read. Conversational English for consumers.";case t>=70:return"Fairly easy to read.";case t>=60:return"Plain English. Easily understood by 13- to 15-year-old students.";case t>=50:return"Fairly difficult to read.";case t>=30:return"Difficult to read.";case t>=0:return"Very difficult to read. Best understood by university graduates."}};initScoreStats=()=>{let e=Mr(this.sourceContent.replace(/<[^>]*>/gmi," "));this.contentStats.readabilityScore=Math.max(0,Math.ceil(e?.reading_ease)),this.contentStats.readabilityScore=Math.min(100,this.contentStats.readabilityScore),this.contentStats.readabilityTooltipText=this.getReadabilityText(this.contentStats.readabilityScore);let t=this.recommendation?.HtmlTagUsage,i=t?.wordUsage,s=t?.headingUsage,r=t?.imageUsage,o=t?.internalLinkUsage,a=t?.externalLinkUsage,c=this.sourceContent.match(/<img [^>]*src="[^"]*"[^>]*>/gi)?.length||0,d=e?.word_count||0,h=this.sourceContent.match(/<h[1-6][^>]*>/gm)?.length||0,f=0,y=0,g=this.sourceContent.match(/<a\s+(?:[^>]*?\s+)?href=(["'])(.*?)\1/gmi);g&&this.url&&(f=g.filter(v=>v.includes(this.url)).length,y=g.length-f);let m=[1,1];this.statistics.word={analyzedRecommendation:i||m,count:d,title:"Words"},this.statistics.heading={analyzedRecommendation:s||m,count:h||0,title:"Headings"},this.statistics.image={analyzedRecommendation:r||m,count:c||0,title:"Images"},this.statistics.internalLink={analyzedRecommendation:o||m,count:f||0,title:"Internal Links"},this.statistics.externalLink={analyzedRecommendation:a||m,count:y||0,title:"External Links"},this.statistics.imgAltText={analyzedRecommendation:m,count:0,title:"Img Alt Text"},this.statistics.nlp={analyzedRecommendation:m,count:0,scoreRecommendation:80,title:"NLP"},this.#e(),this.#t()};#e=()=>{let e=["secondaryKeywords","focusKeyword","keywords","imgAltText","nlp"];Object.keys(this.statistics).forEach(t=>{let i=this.statistics[t];if(e.indexOf(t)===-1){this.statistics[t]={...this.statistics[t],score:this.measureScore(i.analyzedRecommendation,i.count,["word","image"].includes(t))};let s=i?.analyzedRecommendation||[0,0],r=i?.count,o=s[0],a=s[1];this[t+"Callback"]&&this[t+"Callback"](r,o,a)}})};wordCallback=(e,t,i)=>{if(e<t){let s=`You need to write at least ${t} words to improve your content quality and the score`;this.addFeedback(s,"problems")}else if(e<=i){let s=`You have successfully covered ${e} number of words, according to the suggested range`;this.addFeedback(s,"results")}};paragraphCallback=(e,t,i)=>{if(e<t){let s=`You need to have at least ${t-e} paragraph in the content`;this.addFeedback(s,"problems")}if(e>=t&&e<=i){let s="Number of paragraphs matches recommendation to get good results";this.addFeedback(s,"results")}};imageCallback=(e,t,i)=>{if(e<t){let s=`Include at least ${t} images inside the content to improve the content score`;this.addFeedback(s,"problems")}else if(e<=i){let s=`You have successfully added ${e} number of images`;this.addFeedback(s,"results")}};internalLinkCallback=(e,t,i)=>{if(e<t){let s="Add internal links to improve the content score";this.addFeedback(s,"improvements")}if(e>t){let s=`You have successfully added ${e} internal link(s) inside your content`;this.addFeedback(s,"results")}};externalLinkCallback=(e,t,i)=>{if(e<1){let s="Add at least 1 external link to improve the content score";this.addFeedback(s,"improvements")}else{let s=`You have successfully added ${e} external link(s) inside your content`;this.addFeedback(s,"results")}};#t=()=>{let e=this.recommendation?.keywords||{},i=new DOMParser().parseFromString(this.sourceContent,"text/html"),s="h1, h2, h3, h4, h5, h6",r=jQuery(i).find(s),o=this.sourceContent.replace(/<h[1-6].*?>(.*?)<\/h[1-6]>/gm,"").replace(/<[^>]*>/gmi," "),a={count:0,score:{heading:0,content:0}};if(Object.keys(e)===0)return;let c=new ke,d={},h=0,f=0,y=0,g=0,m={};for(let[_,S]of Object.entries(e)){let k=0,D=0,T=[];k=c.findSingleMatch(r.text(),_),D=c.findSingleMatch(o,_);let M=k+D,O={},E={heading:k,content:D,all:M};if(S?.heading&&(O.heading=S?.heading,T.push("heading")),S?.content&&(T.push("content"),O.content=S.content),S?.total&&(O.all=S.total),S?.type==="nlp"&&(g++,M>=S?.total?.[0]&&M<=S?.total?.[1]&&y++),S?.type==="focus"){E.metaTitle=c.findSingleMatch(this.title,_),E.metaDescription=c.findSingleMatch(this.description,_);let A=(this.sourceContent.match(/<img\s+(?:[^>]*?\s+)?alt=(["'])(.*?)\1/gi)||[]).join(" ");E.imgAltText=c.findSingleMatch(A,_),T.push("metaTitle"),O.metaTitle=S?.metaTitle||[1,1],T.push("metaDescription"),O.metaDescription=S?.metaDescription||[1,1],T.push("imgAltText"),O.imgAltText=S?.imgAltText||[1,1];let N={};N.heading=this.measureScore(O?.heading||[1,1],E.heading),N.content=this.measureScore(O?.content||[1,1],E.content),N.metaTitle=this.measureScore(O?.metaTitle,E.metaTitle),N.metaDescription=this.measureScore(O?.metaDescription,E.metaDescription),N.imgAltText=this.measureScore(O.imgAltText,E.imgAltText),this.statistics.imgAltText.analyzedRecommendation=O.imgAltText,this.statistics.imgAltText.count=E.imgAltText,this.statistics.focusKeyword={keyword:_,score:N},m={keyword:_,usage:E,recommendation:O}}else a.count++,O?.heading&&(h++,a.score.heading+=this.measureScore(O.heading,E.heading)),O?.content&&(f++,a.score.content+=this.measureScore(O.content,E.content));d[S?.type]||(d[S?.type]=[]),d[S?.type].push({keyword:_,usage:E,recommendation:O,foundIn:T})}let{usage:v,recommendation:x}=m;x?.heading&&(v.heading<x.heading?.[0]?this.addFeedback(`Include the focus keyword ${x.heading?.[0]} times in the headings to increase the score`,"problems"):v.heading>x.heading?.[1]?this.addFeedback(`You have overused the focus keyword inside the headings. Decrease the keywords to at most 
                ${x.heading?.[1]-v.heading} number of keywords.`,"problems"):this.addFeedback(`You have successfully added the focus keyword ${v.heading} times inside your headings, well within the suggested range`,"results")),x?.content&&(v.content<x.content?.[0]?this.addFeedback(`Include the focus keyword ${x.content?.[0]} times in the content to increase the score`,"problems"):v.content>x.content?.[1]?this.addFeedback(`You have overused the focus keyword inside the content. Decrease the keywords to at most
                    ${x.content?.[1]-v.content} number of keywords.`,"problems"):this.addFeedback(`You have successfully added the focus keyword ${v.content} times inside your content, well within the suggested range`,"results")),x?.metaTitle&&(v.metaTitle<1?this.addFeedback("Include the focus keyword at least once in your meta title to increase the score","problems"):this.addFeedback("You have successfully added the focus keyword in the meta title","results")),x?.metaDescription&&(v.metaDescription<1?this.addFeedback("Include the focus keyword at least once in your meta description to increase the score","problems"):this.addFeedback("You have successfully added the focus keyword in the meta description","results")),this.statistics.keywords=d,this.statistics.secondaryKeywords={count:a.count,score:{heading:Math.ceil(a.score.heading/h),content:Math.ceil(a.score.content/f)}},this.statistics.nlp.count=isNaN(y/g)||g==0?0:Math.ceil(y/g*100),this.statistics.nlp.count<this.statistics.nlp?.scoreRecommendation,this.addFeedback("Please utilize more NLP keywords according to the recommended usage to improve your content quality.","improvements")};addFeedback=(e,t)=>{if(!e||!t||!this.feedbacks?.[t])return!1;this.feedbacks[t].includes(e)||this.feedbacks[t].push(e)};calculateTotalContent=()=>{let e={word:15,image:10,internalLink:5,externalLink:2,focusKeywordInAltText:3,focusKeywordInMetaTitle:5,focusKeywordInMetaDescription:5,focusKeywordInHeading:10,focusKeywordInContent:12,secondaryKeywordsInHeading:10,secondaryKeywordsInContent:23},t={word:this.statistics.word.score,image:this.statistics.image.score,internalLink:this.statistics.internalLink.score,externalLink:this.statistics.externalLink.score,focusKeywordInAltText:this.statistics.focusKeyword.score.imgAltText,focusKeywordInMetaTitle:this.statistics.focusKeyword.score.metaTitle,focusKeywordInMetaDescription:this.statistics.focusKeyword.score.metaDescription,focusKeywordInHeading:this.statistics.focusKeyword.score.heading,focusKeywordInContent:this.statistics.focusKeyword.score.content,secondaryKeywordsInHeading:this.statistics.secondaryKeywords.score.heading,secondaryKeywordsInContent:this.statistics.secondaryKeywords.score.content},i=0;for(let[s,r]of Object.entries(e))i+=(t[s]||0)/100*r;this.contentStats.totalScore=Math.min(100,Math.ceil(i))};measureScore=(e,t=0,i=!1)=>{if(!e||e?.length!==2)return 0;let s=e[0]||0,r=e[1]||0,o=100;if(r===0&&t>=0)return 100;if(t<=r)o=t/(r*.8)*100;else if(t>r)if(i)o=100;else{let a=t/r;o=Math.abs(100-a)}return Math.min(100,o)}};var hi={};ui(hi,{clearHistoryUrl:()=>ux,competitorData:()=>vx,contentFeedback:()=>Tx,continueWriting:()=>_x,createHistoryUrl:()=>Tu,expandOutline:()=>Sx,filterNlpKeywordsUrl:()=>bx,genieChat:()=>Rx,genieChatClear:()=>Fx,genieChatList:()=>Lx,genieChatSave:()=>Ix,genieImage:()=>Ax,genieImageSave:()=>Nx,genieMode:()=>kx,getLicenseToken:()=>Ox,historyData:()=>dx,keywordsData:()=>wx,limitUsage:()=>Ex,nlpKeywords:()=>Vx,nlpKeywordsUrl:()=>yx,oneClickBlog:()=>Cx,outlines:()=>mx,plagiarismData:()=>xx,relatedKeywords:()=>Yx,removeLicenseToken:()=>Mx,semanticKeywords:()=>jx,storeApiUrl:()=>Dx,subscriptionUpdateUrl:()=>Px,topicalMap:()=>Ux,updateUsageUrl:()=>hx,webviewDataCreate:()=>Bx,webviewDataList:()=>Wx,webviewDeletePost:()=>zx,webviewGetBlogWizardData:()=>Hx,writeIntro:()=>px,writeTemplates:()=>fx,writeTitle:()=>gx});var Ee=window.getGenie.config,Me=Ee.parserApi,Cu=Ee.licenseApi,dx=Ee.historyApi+"list",Tu=Ee.historyApi+"create",ux=Ee.historyApi+"clear",hx=Ee.baseApi+"user_usage_log",fx=Me+"writer-default/generate-templates-content",px=Me+"writer-wizard/generate-intro",gx=Me+"writer-wizard/generate-title",mx=Me+"writer-wizard/generate-outline",yx=Me+"writer-wizard/keyword-cluster",bx=Me+"writer-wizard/filter-nlp-keyword",wx=Me+"writer-wizard/keyword-doctor",vx=Me+"writer-wizard/serp-data",xx=Me+"writer-wizard/plagiarism-checker",_x=Me+"advanced-writing/continue-writing",Sx=Me+"advanced-writing/outline-expand",kx=Me+"advanced-writing/genie-mode",Cx=Me+"writer-wizard/generate-one-click-blog",Tx=Ee.feedbackApi,Dx=Ee.storeApi+window.getGenie.blogWizardData?.post_id,Ox=Cu+"get-token",Mx=Cu+"remove-token",Ex=Ee.usageLimitStatsApi,Px=Ee.subscriptionUpgradeUrlApi,Ax=Me+"genie-image/generate-image",Nx=Ee.baseApi+"genie-image/upload",Rx=Me+"chat/default",Ix=Ee.genieChatApi+"create",Lx=Ee.genieChatApi+"list",Fx=Ee.genieChatApi+"clear",Bx=Ee.webviewBaseApi+"save",zx=Ee.webviewBaseApi+"delete",Wx=Ee.webviewBaseApi+"list",Hx=Ee.webviewBaseApi+"doc_meta",Yx=Me+"writer-wizard/related-keywords",Vx=Me+"writer-wizard/nlp-keywords",jx=Me+"writer-wizard/semantic-keywords",Ux=Me+"writer-wizard/topical-map";var{notification:dE}=window.antd;var{Modal:fE}=window.antd;var Ou=be(Du()),ul=class{storeTimeout={};callStoreApi(e,t){if(!!window.getGenie.blogWizardData?.post_id)if(window.getGenie.config.saveData)window.getGenie.config.saveData(e,t);else{let i=hi.storeApiUrl+"/"+e+"/";fetch(i,{method:"POST",body:JSON.stringify(t),headers:{"Content-type":"application/json; charset=UTF-8","X-WP-Nonce":window.getGenie.config?.restNonce||""}})}}storeData=e=>{this.storeTimeout[e]&&clearTimeout(this.storeTimeout[e]),this.storeTimeout[e]=setTimeout(()=>{let t=wp.data.select("getgenie").getInputs();this.callStoreApi(e,t[e]||"")},3e3)};copyToClipboard(e){if(navigator?.clipboard&&window?.isSecureContext)return navigator.clipboard.writeText(e);{let t=document.createElement("textarea");return t.value=e,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select(),new Promise((i,s)=>{document.execCommand("copy")?i():s(),t.remove()})}}formatLargeNumber(e){if(e<1e3)return e;if(e>=1e3&&e<1e6)return+(e/1e3).toFixed(1)+"K";if(e>=1e6&&e<1e9)return+(e/1e6).toFixed(1)+"M";if(e>=1e9&&e<1e12)return+(e/1e9).toFixed(1)+"B";if(e>=1e12)return+(e/1e12).toFixed(1)+"T"}getDomainName(e){try{return new URL(e).hostname.split(".").slice(-2).join(".")}catch{return""}}saveSidebarControllerOption(e,t){!e||!t||(localStorage.setItem(e,JSON.stringify(t)),e=="getgenie-language"&&wp.data.dispatch("getgenie").setSidebar({currentLanguage:t}))}snakeToTitleCase=e=>e.replace(/^[_]*(.)/,(s,r)=>r.toUpperCase()).replace(/[_]+(.)/g,(s,r)=>" "+r.toUpperCase());camelCaseToTitleCase(e){let t=e.replace(/([A-Z])/g," $1").trim();return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}hyphenatedToCamelCase(e){return e.replace(/-([a-z])/g,t=>t[1].toUpperCase())}joinArray(e,t="-"){return e&&e.length>1?e.join(t):""}sortObjArray(e,t){return e.last_nom<t.last_nom?-1:e.last_nom>t.last_nom?1:0}convertToSlug(e){return e?.toLowerCase().replace(/[^\w ]+/g,"").replace(/ +/g,"-")}getCurrentDateTime=e=>window.getGenie?.isPlayground?(0,Ou.default)(e,"YYYY-MM-DD HH:mm:ssZ").format("YYYY-MM-DD, h:mm:ss A"):e;isExistDomain=e=>["shopify","wikipedia","youtube","amazon","aliexpress","walmart","alibaba","bookshop","etsy","flipkart","netflix","reddit","quora"].some(i=>e?.includes(i))},Pn=new ul;var An=class{focusKeyword="";scrapping(e,t=""){let i=e?.html||"",s=e?.rank||"",r=e?.pageContent||{};this.focusKeyword=t.trim();let o={};o.content=[];let c=new DOMParser().parseFromString(i,"text/html").querySelector("link[rel~='icon']")?.href||"";c.startsWith(location?.origin)&&(c="");let d={},h=(r?.content||"").replace(/<(\/?(ul|ol|li|div|br|hr)|>)[^>]*>/gim,`
`).replace(/<(?!\/?(h1|h2|h3|h4|h5|h6|a|p|div)|>)[^>]*>/gim,"");h=this.cleanText(h);let f=this.getHeadings(h);if(f.count>50)return;let y=this.getContents(f.headings)||[],g=r?.content?.match(/<img [^>]*src="[^"]*"[^>]*>/gi)?.length||0;if(g>50)return;let m=r?.content?.match(/<a\s+(?:[^>]*?\s+)?href=(["'])(.*?)\1/gmi),v=0,x=0,_=Pn.getDomainName(r?.url);m&&_&&(v=m.filter(O=>O.includes(_)).length,x=m.filter(O=>!O.includes(_)).length);let S=1,k=new ke,D=r?.content?.match(/<img\s+(?:[^>]*?\s+)?alt=(["'])(.*?)\1/gi);if(D){let O=D.join(" ");S=k.findSingleMatch(O,this.focusKeyword),S=S?0:1}let T=Mr((h||" ").replace(/<[^>]*>/gmi," "))?.word_count||0;if(T>8e3)return;let M=Pn.isExistDomain(_);return d={rank:s,url:e?.url,keySlug:e?.keySlug,title:r?.title,description:r?.excerpt,favicon:c,content:y,source:h,textContent:(h||"").replace(/<[^>]*>/gim," ")},d.stat={images:M?0:g,internalLinks:M?0:v,externalLinks:M?0:x,focusKeywordInAltText:M?0:S,headings:M?0:f.count,words:M?0:T},d}getHeadings=(e,t=5,i=50)=>{let s=document.createElement("div");s.innerHTML=e;let r="h2, h3",o=jQuery(s).find(r);for(let a of["h4","h5","h6"])if(o?.length<t&&o?.length<i)r+=", "+a,o=jQuery(s).find(r);else break;return{headings:o,count:o?.length||0}};getContents(e){if(!e||e?.length===0)return;let t=this.cleanText,i=[];return e.each(function(s){let r=jQuery(this).prop("tagName").toLowerCase(),o=jQuery(this).text();if(o=t(o.replace(/<(\/?(a)|>)[^>]*>/gim,"")),o=o.replace(/\&nbsp;/g," "),o==""||o.match(/\d*(,|\/)\d*/gis)||o.match(/(\w+)/gis)?.length<2)return;let a="",c=d=>{let h=d?.textContent||"";h.trim()===""||h.match(/(\w+)/gis)?.length<5||(a+=jQuery(d).html())};s===e.length-1?jQuery(this).nextAll("div, p").each(function(d,h){c(h)}):jQuery(this).nextUntil(e[s+1]).each(function(d,h){c(h)}),a=t(a.replace(/<(\/?(p)|>)[^>]*>/gim,`
`)),a!=""&&i.push({tag:r,title:o,text:a})}),i}cleanText=e=>(e=e.replace(/\s\s+/gm," "),e=e.replace(/  +/gm," "),e=e.replace(/\n+/gm,`
`),e.trim());getStat=(e,t=[])=>{let i={},s={},r=new ke,o={total:{},max:{}};for(let[d,h]of t.entries()){let f=h?.keyword||"",y=f.trim().toLowerCase(),g=0,m=0,v=0,x=0,_=0,S=0,k=0,D=1,T=1,M=0,O=0,E=0,A=0;if(e.map(N=>{if(d===0)for(let[L,F]of Object.entries(N?.stat||{}))o?.total?.[L]||(o.total[L]=0),o?.max?.[L]||(o.max[L]=0),o.total[L]+=F,o.max[L]<F&&(o.max[L]=F);let I=0,B=0,z=0;if(N.content.map(L=>{let F=(L?.title||"").toLowerCase(),Y=(L?.text||"").toLowerCase();F&&(x++,B+=r.findSingleMatch(F,y)),Y&&(_++,z+=r.findSingleMatch(Y,y))}),m<B&&(m=B),v<z&&(v=z),I=B+z,g<I&&(g=I),S+=B,k+=z,h.type==="focus"){let L=r.findSingleMatch(N.title,y),F=r.findSingleMatch(N.description,y);L>0&&(E+=N.title.split(y)?.length-1,M++,D=D<E?E:D),F>0&&(A+=N.description.split(y)?.length-1,O++,T=T<A?A:T),s[f]={type:"focus"},g===0&&(g=1)}}),h.type==="focus"&&(s[f]||(s[f]={type:"focus"}),s[f].metaTitle=[Math.ceil(E/M)||1,D],s[f].metaDescription=[Math.ceil(A/O)||1,T]),g!==0&&(s[f]||(s[f]={type:h.type}),m>0&&(s[f].heading=[Math.ceil(S/x),m]),v>0&&(s[f].content=[Math.ceil(k/_),v]),g>0)){let N=Math.ceil((S+k)/(x+_));s[f].total=[N<1?1:N,g]}}s?.[this.focusKeyword]&&(s[this.focusKeyword].imgAltText=[Math.ceil(o.total.focusKeywordInAltText/o.total.images),o.max.focusKeywordInAltText]),i.keywords=s,i.HtmlTagUsage={},i.HtmlTagUsage.paragraphUsage=[0,0],i.HtmlTagUsage.headingUsage=[Math.ceil(o.total.headings/e.length)||0,o.max.headings],i.HtmlTagUsage.imageUsage=[Math.ceil(o.total.images/e.length)||0,o.max.images],i.HtmlTagUsage.wordUsage=[Math.round(o.total.words/e.length)||0,o.max.words];let a=[1,1];o.max.internalLinks>0&&(a=[Math.ceil(o.total.internalLinks/e.length)||0,o.max.internalLinks]);let c=[1,1];return o.max.externalLinks>0&&(c=[Math.ceil(o.total.externalLinks/e.length)||0,o.max.externalLinks]),i.HtmlTagUsage.internalLinkUsage=a,i.HtmlTagUsage.externalLinkUsage=c,i}};var{Button:hl,Tooltip:$x,Modal:fl}=window.antd,{useEffect:Mu,useState:pl}=window.React,{Libs:TE}=window.getGenie.Components.Common,{ComposeComponents:Gx}=window.getGenie.Components.Common.ReduxManager,Eu=["BlogScreen"],gl=["ScoreAnalysis"],Kx=["GenieChat"],qx=["UserHistory","UserHistoryDetails"],Xx=Gx(({setSidebar:n,sidebar:e,getInputs:t,setInput:i,getTemplateInputs:s,setContextMenu:r})=>{let o=e.currentPostContent&&e.analyzedContent?.contentStats?.totalScore||0,[a,c]=pl({}),[d,h]=pl(""),[f,y]=pl(!1),{component:g,currentTemplate:m}=e;Mu(()=>{if(!e.toolbarWriting)if([...Eu,"WriteTemplatesScreen"].includes(g)){let T=Eu.includes(g)?"blogWizard":e.currentTemplate;c({component:g,template:T})}else gl.includes(g)&&h(g)},[e.component,e.currentTemplate]),Mu(()=>{window.location.hash==="#getgenie-open-blogwizard"&&(x(),n({component:"BlogScreen",currentTemplate:"blogWizard"}))},[]);let v=()=>{i("competitorData",null),i("seoDataTab","competitor"),n({open:!0,component:"BlogScreen",analyzeKeyword:{...e.analyzeKeyword,open:!0},statisticsScreen:{...e.statisticsScreen,triggered:!0}})},x=()=>{let T=!e.open;if(i("headTohead",!1),i("serpVisualize",!1),[...gl,...qx,...Kx,"WriteTemplatesScreen"].includes(g)){n({open:!0,component:a?.component||"TemplateListScreen",currentTemplate:a?.template||e.currentTemplate});return}n({open:T,component:g||"TemplateListScreen"})},_=()=>{n({open:!0,component:"BlogScreen",analyzeKeyword:{open:!0,triggered:!0}})},S=(T,M)=>{let{competitorData:O,keyword:E,searchVolume:A}=M?.blogWizard||{};if(!E&&!O&&!A||E&&!O&&!A){fl.warning({title:"Score not generated",content:"Please Fetch keyword and competitor data for content score.",className:"getgenie-confirm-modal",getContainer:()=>T.rootContainer,zIndex:99999,maskClosable:!0,...E?{okText:React.createElement("div",null,"Analyze Keyword ",React.createElement("span",{className:"getgenie-icon-arrow-right fetch"})),onOk:_}:{}});return}if(T.analyzingCompetitors){fl.warning({title:"Fetching competitors data to provide the updated content score.",className:"getgenie-confirm-modal",getContainer:()=>T.rootContainer,zIndex:99999,maskClosable:!0});return}if(Array.isArray(T.statisticsData?.keywords)||!O&&!T.analyzingCompetitors){fl.warning({title:"The score will need some updating!",onOk:v,content:"Please click the button below and re- fetch the SERP competitor data to get updated content score for your content.",okText:React.createElement("div",null,"Fetch ",React.createElement("span",{className:"getgenie-icon-arrow-right fetch"})),className:"getgenie-confirm-modal",getContainer:()=>T.rootContainer,zIndex:99999,maskClosable:!0});return}if(window.rankMathEditor||window.YoastSEO){let z,L;if(window.rankMathEditor){let F=window.rankMathEditor?.assessor?.analyzer?.researcher?.paper?.args||{};z=F.title,L=F.description}else{let F=window.YoastSEO?.app?.callbacks?.getData()||{};z=F.metaTitle,L=F.snippetMeta}n({currentPostTitle:z||"",currentPostDescription:L||"",currentPostContent:T.currentPostContent+" "})}let I=wp.data.select("core/editor")?.getEditedPostAttribute("title");if(I&&!T.currentPostContent.includes(I)){let z=`<h1>${I}</h1>`+T.currentPostContent;n({currentPostContent:z})}if(!T.currentPostContent&&O&&(y(!0),setTimeout(()=>{y(!1)},2e3)),Object.keys(T.statisticsData).length===0||!T.currentPostContent)return!1;let B=!T.open;gl.includes(g)||(B=!0),n({open:B,component:d||"ScoreAnalysis",currentTemplate:"blogWizard",analyzeKeyword:{...T.analyzeKeyword,open:!1},generatedOutlines:{...T.generatedOutlines,open:!1}})},k=T=>{let M=g=="GenieChat"?!T.open:!0;n({open:M,component:"GenieChat",currentTemplate:"genieChat",analyzeKeyword:{...T.analyzeKeyword,open:!1},generatedOutlines:{...T.generatedOutlines,open:!1}})},D=`${window.getGenie.config.assetsUrl}dist/admin/images/genie-chat.svg`;return React.createElement(React.Fragment,null,window.getGenie?.config?.isBlockEditor?React.createElement(React.Fragment,null,React.createElement(hl,{onClick:x,type:"primary",icon:React.createElement("span",{className:"getgenie-icon-edit ant-btn-icon"})},e.__("Write for me","getgenie")),React.createElement(hl,{onClick:()=>k(e),className:"genie-chat-opener-btn"},React.createElement("img",{src:D,alt:"genie-chat",width:"25"}),e.__("Chat","getgenie"))):"",React.createElement($x,{placement:"bottom",trigger:"click",getPopupContainer:T=>window.getGenie.shadow||document.body,title:"No post content found!",visible:f},React.createElement(hl,{onClick:()=>S(e,s),style:{backgroundColor:pi.ColorByStatScore(o||0)},loading:e.statisticsScreen.loading,type:"primary",className:"getgenie-toolbar-write-btn stat"},React.createElement("span",{className:"getgenie-icon-meter score ant-btn-icon"}),o,"/100")))},["setSidebar","setInput","sidebar","getInputs","getTemplateInputs","setContextMenu"]),Pu=Xx;var Zx=(n,e=[],t=!1,i=!1)=>{let s="#FF4131";return t?n<e[0]?s="#F5B008":!i&&n>=e[0]||i&&n>e[0]&&n<e[1]?s="#14A645":i&&n>=e[1]&&(s="#F02F54"):n>25&&n<=50?s="#FDC500":n>50&&n<80?s="#f5b008":n>=80&&(s="#00B81D"),s},Au=Zx;var Ft=class{insertionField=null;editorName=null;currentDocument=document;constructor(e){e?(this.editorName="gutenberg",this.insertionField=document.querySelector(".is-root-container.wp-block-post-content")):this.findInsertionField()}findInsertionField=()=>{let e=document.getElementById("wp-content-editor-container"),t=document.querySelector(".wp-editor-area"),i="none";t&&(i=window.getComputedStyle(t).display);let s=document.getElementById("content_ifr"),r=s?.contentDocument||s?.contentWindow?.document;if(e&&r){this.editorName="classic",this.currentDocument=r;let o=r.body;this.insertionField=o}e&&i==="block"&&(this.editorName="classic",this.currentDocument=document,this.insertionField=t),document.querySelector("#web-view-editor .ql-editor")&&(this.insertionField=document.querySelector("#web-view-editor .ql-editor"),this.editorName="classic")};insertInClassicEditor=(e,t,i,s)=>{if(this.insertionField.innerHTML="",document.getElementById("post-body-content")&&document.getElementById("title")){let r=document.getElementById("title");r.value=e,document.getElementById("title-prompt-text").classList.add("screen-reader-text")}if(document.querySelector("#web-view-editor .ql-editor")){let r=this.currentDocument.createElement("h1");r.classList.add("blog-title"),r.innerHTML=e,this.insertionField.appendChild(r)}if(t=t.replace(/\n+/gm,`
`).replace(/\n/gm,"<br/> <br/>"),this.insertionField?.tagName==="TEXTAREA")this.insertionField.value=this.insertionField.value+t;else{let r=this.currentDocument.createElement("p");r.innerHTML=t,this.insertionField.appendChild(r)}this.appendInClassicEditor(i,s)};appendInClassicEditor=(e,t)=>{let i=[],s=[];Array.from(this.insertionField.children).forEach(o=>{s.push(o?.textContent)}),i=e.filter(o=>s.indexOf(o)===-1);for(let o of i){let a=this.currentDocument.createElement("h2");a.innerHTML=o,this.insertionField?.tagName==="TEXTAREA"?this.insertionField.value=this.insertionField.value+a.outerHTML:this.insertionField.appendChild(a);let c=t[o];if(!c)continue;let d=this.currentDocument.createElement("p");d.innerHTML=c?.paragraph,this.insertionField?.tagName==="TEXTAREA"?this.insertionField.value=this.insertionField.value+d.outerHTML:this.insertionField.appendChild(d)}};insertInGutenbergBlock=(e,t,i,s)=>{t=t.replace(/\n+/gm,`
`).replace(/\n/gm,"<br/> <br/>"),wp.data.dispatch("core/editor").editPost({title:e}),wp.data.dispatch("core/editor").editPost({excerpt:t}),wp.data.dispatch("core/block-editor").resetBlocks(wp.blocks.parse("")),wp.data.dispatch("core/block-editor").insertBlocks(wp.blocks.createBlock("core/paragraph",{content:t})),this.appendInGutenbergBlock(i,s)};appendInGutenbergBlock=(e,t)=>{let i=[],s=[],r=wp.data.select("core/block-editor").getBlocks();for(let o of r)o?.name=="core/heading"&&(o?.originalContent?i.push(o?.originalContent.replace(/<\/?[^>]+(>|$)/g,"")):i.push(o?.attributes?.content?.replace(/<\/?[^>]+(>|$)/g,"")));s=e.filter(o=>i.indexOf(o)===-1);for(let o of s){wp.data.dispatch("core/block-editor").insertBlocks(wp.blocks.createBlock("core/heading",{content:o}));let a=t[o];!a||wp.data.dispatch("core/block-editor").insertBlocks(wp.blocks.createBlock("core/paragraph",{content:a?.paragraph}))}};appendOutlines=(e,t)=>{this.editorName==="classic"?this.appendInClassicEditor(e,t):this.editorName==="gutenberg"&&this.appendInGutenbergBlock(e,t),this.closeSidebar()};closeSidebar=()=>{window.getGenie?.isPlayground?wp.data.dispatch("getgenie").setSidebar({open:!0,component:"TemplateListScreen",currentTemplate:"list"}):wp.data.dispatch("getgenie").setSidebar({open:!1})};insertContent=(e,t,i,s)=>{this.editorName==="classic"?this.insertInClassicEditor(e,t,i,s):this.editorName==="gutenberg"&&this.insertInGutenbergBlock(e,t,i,s),this.closeSidebar()};insertCompetitorContentGutenberg=(e,t,i,s)=>{let r=wp.data.select("core/block-editor"),o=r.getBlocks(),a=r.getSelectedBlockClientId(),c=o.findIndex(d=>d.clientId===a);wp.data.dispatch("core/block-editor").insertBlocks(wp.blocks.createBlock("core/heading",{content:i}),c+1),wp.data.dispatch("core/block-editor").insertBlocks(wp.blocks.createBlock("core/paragraph",{content:s}),c+2),e(t)};insertCompetitorContentIframe=(e,t,i,s,r)=>{let o=document.getElementById(e),a=o.contentDocument||o.contentWindow.document,c=a.getSelection().focusNode?.parentElement,d=a.createElement("h2");d.innerHTML=s;let h=a.createElement("p");h.innerHTML=r,c.insertAdjacentElement("afterend",d),d.insertAdjacentElement("afterend",h),t(i)};insertCompetitorContentWebview=(e,t,i,s)=>{let r=document.querySelector("#web-view-editor .ql-editor"),o=document.createElement("h2");o.innerHTML=i;let a=document.createElement("p");a.innerHTML=s,r.appendChild(o),r.appendChild(a),e(t)}};var{Libs:Nn,Utilities:Jx}=window.getGenie.Components.Common,{GenieHelpers:Qx}=Jx,{Button:Nu,Card:e_,Checkbox:t_,Col:Er,Divider:n_,Row:i_,Typography:as,Tooltip:ml}=window.antd,{ComposeComponents:s_}=window.getGenie.Components.Common.ReduxManager,{useState:Ru}=window.React,Pr=s_(({data:n,loading:e=!1,loadingText:t="",page:i=0,getInputs:s,limitUsage:r,setInput:o,sidebar:a,fetchData:c=null,setSidebar:d})=>{let[h,f]=Ru(""),[y,g]=Ru(""),m=new Ft(window.getGenie.config.isBlockEditor),v=s.selectedOutlines||[],x=n,_=(N,I)=>{let B=[...v];B.indexOf(I)!=-1?B.splice(B.indexOf(I),1):B.push(I),o("selectedOutlines",B)},S=N=>{let I=document.createElement("div");return I.innerHTML=N,I.querySelectorAll("a").forEach(B=>{B.setAttribute("target","_blank")}),I.innerHTML},k=(N,I)=>{N.stopPropagation(),y!==I&&Nn.ConfirmModal("Insert Content?",`To avoid plagiarism from using someone else's content, 
							you're advised to either edit the content to add unique value or use GetGenie's 
							"text rewriter" template.`,()=>{let B=I.split(/<br\s*\/?>/gi);B=B.filter(F=>F!=="");let z=B[0],L=B.slice(1).join(`
`);window.getGenie.config.isBlockEditor&&m.insertCompetitorContentGutenberg(g,I,z,L),document.getElementById("post-body-content")&&m.insertCompetitorContentIframe("content_ifr",g,I,z,L),document.querySelector("#web-view-editor .ql-editor")&&m.insertCompetitorContentWebview(g,I,z,L)})},D=(N,I)=>{N.stopPropagation();let B=I.replace(/<br\s*\/?>/gi,`
`);B=B.replace(/<\/?[^>]+(>|$)/g,""),Qx.copyToClipboard(B).then(()=>{f(I)}).catch(()=>console.log("error"))},T=N=>{try{return new URL(N),!0}catch{return!1}},M=()=>{c()},O=x||[];Array.isArray(O)||(O=[]);let E=(i<3||e)&&c&&s.competitorData?.length>0,A=()=>{o("competitorData",""),d({analyzingCompetitors:!0}),c()};return React.createElement(React.Fragment,null,e?React.createElement("h5",{className:"getgenie-loading-state"},React.createElement("span",null,t),React.createElement(Nn.Loading,{size:22})," "):Array.isArray(s.competitorData)?E?React.createElement("div",{className:"refetch-icon",onClick:A},React.createElement(ml,{placement:"topLeft",title:"Refetch the competitor list"},React.createElement("span",{className:"refetch-text"},"Refetch")),React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},React.createElement("circle",{cx:"11",cy:"11",r:"11",fill:"#031233",fillOpacity:"0.1"}),React.createElement("path",{d:"M16.3793 10.3795H16.3787C16.2972 10.3796 16.2165 10.3957 16.1412 10.4269C16.066 10.4582 15.9976 10.504 15.94 10.5617C15.8824 10.6194 15.8367 10.6878 15.8056 10.7632C15.7745 10.8385 15.7585 10.9192 15.7586 11.0007C15.7578 11.871 15.5185 12.7243 15.0667 13.4681C14.6149 14.2118 13.9678 14.8175 13.1959 15.2192C12.424 15.621 11.5567 15.8034 10.6883 15.7468C9.81997 15.6902 8.98373 15.3966 8.27053 14.898C6.12132 13.3931 5.5971 10.4202 7.10202 8.27094C8.60693 6.1217 11.5798 5.59743 13.7291 7.1024C14.0542 7.32948 14.3497 7.59629 14.6087 7.89665H12.8619C12.6973 7.89665 12.5394 7.96205 12.423 8.07845C12.3066 8.19486 12.2412 8.35274 12.2412 8.51736C12.2412 8.68198 12.3066 8.83986 12.423 8.95627C12.5394 9.07268 12.6973 9.13807 12.8619 9.13807H15.7586C15.9232 9.13807 16.0811 9.07268 16.1975 8.95627C16.3139 8.83986 16.3793 8.68198 16.3793 8.51736V5.62071C16.3793 5.45609 16.3139 5.29821 16.1975 5.1818C16.0811 5.0654 15.9232 5 15.7586 5C15.594 5 15.4361 5.0654 15.3197 5.1818C15.2033 5.29821 15.1379 5.45609 15.1379 5.62071V6.65438C14.92 6.4477 14.6872 6.25752 14.4411 6.08539C13.7957 5.63347 13.0676 5.3131 12.2984 5.14257C11.5291 4.97204 10.7339 4.95469 9.95793 5.09151C9.182 5.22833 8.44061 5.51665 7.7761 5.93999C7.1116 6.36333 6.53698 6.91341 6.08506 7.55883C5.17237 8.8623 4.81486 10.475 5.09118 12.042C5.3675 13.6091 6.25502 15.0022 7.5585 15.9149C8.56207 16.6218 9.75954 17.0013 10.9871 17.0015C11.3406 17.0014 11.6935 16.9703 12.0417 16.9088C13.4309 16.6637 14.6893 15.9371 15.5961 14.8565C16.5028 13.7758 16.9999 12.4103 17 10.9997C16.9999 10.8351 16.9344 10.6774 16.818 10.5611C16.7016 10.4448 16.5438 10.3795 16.3793 10.3795Z",fill:"#57595F"}))):"":React.createElement(Nu,{className:"getgenie-fetch-competitor-btn",onClick:c},a.__("Fetch Data","getgenie")),React.createElement("div",{className:"getgenie-competitor-tab"},x?.length===0?React.createElement(as.Title,{level:5,className:"getgenie-not-found-title"},a.__("No related data was found.","getgenie")):"",React.createElement(Nn.BlurElement,{show:O?.length>3&&r.subscription_type!=="pro",top:960,text:"Analyze competitors for insights to stay ahead of them.",btnText:"Upgrade Now",href:"https://getgenie.ai/pricing/",textMargin:0},O?.map((N,I,B)=>React.createElement("div",{key:I},React.createElement("div",null,React.createElement(i_,{className:"getgenie-competitor-overview",gutter:8},React.createElement(Er,{className:"gutter-row"},e?"":React.createElement("div",{className:"getgenie-text"},a.__("Rank:","getgenie")," ",I+1)),React.createElement(Er,{className:"gutter-row"},React.createElement("div",{className:"getgenie-text"},a.__("Words:","getgenie")," ",N?.stat?.words)),React.createElement(Er,{className:"gutter-row"},React.createElement("div",{className:"getgenie-text"},a.__("Heading:","getgenie")," ",N?.stat?.headings)),React.createElement(Er,{className:"gutter-row"},React.createElement("div",{className:"getgenie-text"},a.__("Images:","getgenie")," ",N?.stat?.images))),React.createElement(e_,{className:"getgenie-competitor-card"},React.createElement("a",{href:N?.url,className:"getgenie-competitor-link",target:"_blank"},T(N?.favicon)?React.createElement("img",{className:"page-favicon",src:N?.favicon}):React.createElement("span",{className:"page-url getgenie-icon-earth"}),React.createElement(as.Text,{className:"page-url",ellipsis:{tooltip:N?.url}},N?.url)),React.createElement(as.Title,{level:5,className:"getgenie-competitor-title"},N.title),React.createElement("p",{className:"getgenie-competitor-text",dangerouslySetInnerHTML:{__html:S(N?.description||"")}}),React.createElement(Nn.Popover,{content:React.createElement("div",{className:"getgenie-tags-popover"},React.createElement(Nn.Collapse,{showArrow:!1,accordion:!0},N?.content?.map((z,L)=>React.createElement(Nn.Collapse.Panel,{key:L,header:React.createElement("div",{className:"getgenie-competitor-tag-container"},a.currentScreen==="outlineScreen"?React.createElement("div",{onClick:F=>F.stopPropagation()},React.createElement(t_,{checked:v.indexOf(z.title)!=-1,onChange:F=>_(F,z?.title)},React.createElement("div",{className:"tag-content"},React.createElement("h5",{className:"tag-name"},z?.tag),React.createElement("h5",{className:"tag-title"},z?.title)))):React.createElement("div",{className:"tag-content"},React.createElement("h5",{className:"tag-name"},z?.tag),React.createElement("h5",{className:"tag-title"},z?.title)),React.createElement("div",{className:"actions"},a.currentScreen!=="outlineScreen"?React.createElement("div",{className:"item-button"},React.createElement("div",{className:"copy"},React.createElement(ml,{placement:"bottom",zIndex:99999,title:h===z?.title+" "+z?.text?"Copied":"Copy this content"},React.createElement("span",{className:"copy-icon getgenie-icon-copy",onClick:F=>D(F,z?.title+" "+z?.text)}))),React.createElement("div",{className:"insert"},React.createElement(ml,{title:y!==z?.title+"<br>"+z?.text?"Insert into the editor":"Already inserted",placement:"bottom",zIndex:99999},React.createElement("span",{className:`insert-icon ${y===z?.title+"<br>"+z?.text?"getgenie-icon-check":"getgenie-icon-insert"}`,onClick:F=>k(F,z?.title+"<br>"+z?.text)})))):" ",React.createElement("span",{className:"custom-collapse-icon getgenie-icon-arrow_down"})))},React.createElement("p",{dangerouslySetInnerHTML:{__html:S(z?.text)}}))))),overlayStyle:{width:"500px",height:"350px"},overlayClassName:"getgenie-competitor-popover",placement:"left"},React.createElement("div",{className:"getgenie-competitor-tag"},React.createElement("div",{className:"getgenie-competitor-tag-list"},React.createElement(as.Title,{level:5,className:"getgenie-competitor-tag-name"},N?.content[0]?.tag),React.createElement(as.Title,{level:5,className:"getgenie-competitor-tag-content"},N?.content[0]?.title)),React.createElement(Nu,{disabled:N?.content?.length===0,className:"getgenie-competitor-tag-moreBtn",type:"link"},a.__("more contents","getgenie"),React.createElement("span",{className:"getgenie-icon-arrow-up-right"})))))),I!=B.length-1&&React.createElement(n_,null))),E?React.createElement(Nn.Button,{loading:e,onClick:M},"Load More"):"")))},["sidebar","getInputs","setInput","limitUsage","setSidebar"]);var{Col:yl,Row:r_,Typography:xt,Divider:o_}=window.antd,{ComposeComponents:a_}=window.getGenie.Components.Common.ReduxManager,Iu=a_(({getInputs:n,sidebar:e})=>{let t=n.searchVolume,i=[{title:"Last Month",value:t?.searchVolume?.lastMonth},{title:"Average 12 month",value:t?.searchVolume?.avg12Month},{title:"Highest",value:t?.searchVolume?.highest},{title:"Lowest",value:t?.searchVolume?.lowest}];return React.createElement("div",{className:"getgenie-keyword-analysis"},React.createElement(xt.Title,{level:4,className:"getgenie-title"},e.__("Keyword Analysis","getgenie")),t?React.createElement(React.Fragment,null,React.createElement(r_,{gutter:6},React.createElement(yl,{className:"gutter-row",flex:"auto"},React.createElement("div",{className:"getgenie-keyword-result volume"},React.createElement(xt.Title,{level:5,className:"getgenie-title"},e.__("Search Volume","getgenie")),React.createElement("div",{className:"getgenie-result-item"},React.createElement(xt.Text,{className:"getgenie-text"},t?.searchVolume?.total||"-"),React.createElement("span",{className:"getgenie-icon-search"})))),React.createElement(yl,{className:"gutter-row",flex:"auto"},React.createElement("div",{className:"getgenie-keyword-result competition"},React.createElement(xt.Title,{level:5,className:"getgenie-title"},e.__("Competition","getgenie")),React.createElement("div",{className:"getgenie-result-item"},React.createElement(xt.Text,{className:"getgenie-text"},t?.searchVolume?.competition||"-"),React.createElement("span",{className:"getgenie-icon-competition_icon"})))),React.createElement(yl,{className:"gutter-row",flex:"auto"},React.createElement("div",{className:"getgenie-keyword-result cpc"},React.createElement(xt.Title,{level:5,className:"getgenie-title"},"CPC"),React.createElement("div",{className:"getgenie-result-item"},React.createElement(xt.Text,{className:"getgenie-text"},t?.searchVolume?.cpc?.currency||"-"," ",t?.searchVolume?.cpc?.value),React.createElement("span",{className:"getgenie-icon-cpc_icon"}))))),i?.[1]?.value?React.createElement("div",{className:"getgenie-list-data"},i.map((s,r)=>React.createElement("div",{key:r},React.createElement("div",{className:"getgenie-list-data-container"},React.createElement(xt.Title,{level:5,className:"getgenie-list-data-title"},s.title),React.createElement(xt.Title,{level:5,className:"getgenie-list-data-value"},s.value)),r!==i.length-1&&React.createElement(o_,null)))):""):React.createElement(xt.Title,{level:5,className:"getgenie-not-found-title"},e.__("No magic found for this keyword. Maybe try a different one?","getgenie")))},["getInputs","sidebar"]);var{Libs:l_}=window.getGenie.Components.Common,{useState:Lu,memo:c_,useEffect:d_}=window.React,u_=c_(({data:n})=>{let[e,t]=Lu(null),[i,s]=Lu(!0);return d_(()=>{if(!n)return;let o=encodeURIComponent(n),a="https://trends.google.com:443/trends/embed/explore/TIMESERIES?req=%7B%22comparisonItem%22%3A%5B%7B%22keyword%22%3A%22#ENCODED_KEYWORD#%22%2C%22geo%22%3A%22%22%2C%22time%22%3A%22today%2012-m%22%7D%5D%2C%22category%22%3A0%2C%22property%22%3A%22%22%7D&tz=-360&eq=q%3D#DOUBLE_ENCODED_KEYWORD#%26date%3Dtoday%2012-m";a=a.replace("#ENCODED_KEYWORD#",o),a=a.replace("#DOUBLE_ENCODED_KEYWORD#",encodeURIComponent(o)),t(a)},[n]),e&&React.createElement(React.Fragment,null,React.createElement("iframe",{onLoad:o=>{o.target.style.display="block",s(!1)},id:"trends-widget-1",title:"trends-widget-1",src:e,className:"getgenie-chart",frameBorder:"0",scrolling:"0",style:{height:"370px",width:"300px",padding:0,display:"none"}}),i?React.createElement(l_.Loading,null):"")}),Fu=u_;function pt(){}var kl=function(){let n=0;return function(){return n++}}();function J(n){return n===null||typeof n>"u"}function oe(n){if(Array.isArray&&Array.isArray(n))return!0;let e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function K(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}var _e=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function He(n,e){return _e(n)?n:e}function $(n,e){return typeof n>"u"?e:n}var Cl=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,zr=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function ne(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ie(n,e,t,i){let s,r,o;if(oe(n))if(r=n.length,i)for(s=r-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<r;s++)e.call(t,n[s],s);else if(K(n))for(o=Object.keys(n),r=o.length,s=0;s<r;s++)e.call(t,n[o[s]],o[s])}function vi(n,e){let t,i,s,r;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],r=e[t],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function ds(n){if(oe(n))return n.map(ds);if(K(n)){let e=Object.create(null),t=Object.keys(n),i=t.length,s=0;for(;s<i;++s)e[t[s]]=ds(n[t[s]]);return e}return n}function Zu(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Ju(n,e,t,i){if(!Zu(n))return;let s=e[n],r=t[n];K(s)&&K(r)?qe(s,r,i):e[n]=ds(r)}function qe(n,e,t){let i=oe(e)?e:[e],s=i.length;if(!K(n))return n;t=t||{};let r=t.merger||Ju;for(let o=0;o<s;++o){if(e=i[o],!K(e))continue;let a=Object.keys(e);for(let c=0,d=a.length;c<d;++c)r(a[c],n,e,t)}return n}function Fn(n,e){return qe(n,e,{merger:Qu})}function Qu(n,e,t){if(!Zu(n))return;let i=e[n],s=t[n];K(i)&&K(s)?Fn(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=ds(s))}var Bu={"":n=>n,x:n=>n.x,y:n=>n.y};function St(n,e){return(Bu[e]||(Bu[e]=h_(e)))(n)}function h_(n){let e=eh(n);return t=>{for(let i of e){if(i==="")break;t=t&&t[i]}return t}}function eh(n){let e=n.split("."),t=[],i="";for(let s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function hs(n){return n.charAt(0).toUpperCase()+n.slice(1)}var ve=n=>typeof n<"u",_t=n=>typeof n=="function",Wr=(n,e)=>{if(n.size!==e.size)return!1;for(let t of n)if(!e.has(t))return!1;return!0};function Tl(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}var te=Math.PI,ae=2*te,th=ae+te,us=Number.POSITIVE_INFINITY,Hr=te/180,we=te/2,mi=te/4,xl=te*2/3,Ye=Math.log10,rt=Math.sign;function Yr(n){let e=Math.round(n);n=Bn(n,e,n/1e3)?e:n;let t=Math.pow(10,Math.floor(Ye(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Dl(n){let e=[],t=Math.sqrt(n),i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,r)=>s-r).pop(),e}function dn(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Bn(n,e,t){return Math.abs(n-e)<t}function Ol(n,e){let t=Math.round(n);return t-e<=n&&t+e>=n}function Vr(n,e,t){let i,s,r;for(i=0,s=n.length;i<s;i++)r=n[i][t],isNaN(r)||(e.min=Math.min(e.min,r),e.max=Math.max(e.max,r))}function xe(n){return n*(te/180)}function zn(n){return n*(180/te)}function jr(n){if(!_e(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function Ur(n,e){let t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i),r=Math.atan2(i,t);return r<-.5*te&&(r+=ae),{angle:r,distance:s}}function ln(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function nh(n,e){return(n-e+th)%ae-te}function Ke(n){return(n%ae+ae)%ae}function Wn(n,e,t,i){let s=Ke(n),r=Ke(e),o=Ke(t),a=Ke(r-s),c=Ke(o-s),d=Ke(s-r),h=Ke(s-o);return s===r||s===o||i&&r===o||a>c&&d<h}function Pe(n,e,t){return Math.max(e,Math.min(t,n))}function Ml(n){return Pe(n,-32768,32767)}function kt(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function fs(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,t(r)?s=r:i=r;return{lo:s,hi:i}}var Wt=(n,e,t,i)=>fs(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),El=(n,e,t)=>fs(n,t,i=>n[i][e]>=t);function Pl(n,e,t){let i=0,s=n.length;for(;i<s&&n[i]<e;)i++;for(;s>i&&n[s-1]>t;)s--;return i>0||s<n.length?n.slice(i,s):n}var ih=["push","pop","shift","splice","unshift"];function Al(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),ih.forEach(t=>{let i="_onData"+hs(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...r){let o=s.apply(this,r);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function $r(n,e){let t=n._chartjs;if(!t)return;let i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(ih.forEach(r=>{delete n[r]}),delete n._chartjs)}function Gr(n){let e=new Set,t,i;for(t=0,i=n.length;t<i;++t)e.add(n[t]);return e.size===i?n:Array.from(e)}var Kr=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function qr(n,e,t){let i=t||(o=>Array.prototype.slice.call(o)),s=!1,r=[];return function(...o){r=i(o),s||(s=!0,Kr.call(window,()=>{s=!1,n.apply(e,r)}))}}function Nl(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}var ps=n=>n==="start"?"left":n==="end"?"right":"center",Ae=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2,Rl=(n,e,t,i)=>n===(i?"left":"right")?t:n==="center"?(e+t)/2:e;function Xr(n,e,t){let i=e.length,s=0,r=i;if(n._sorted){let{iScale:o,_parsed:a}=n,c=o.axis,{min:d,max:h,minDefined:f,maxDefined:y}=o.getUserBounds();f&&(s=Pe(Math.min(Wt(a,o.axis,d).lo,t?i:Wt(e,c,o.getPixelForValue(d)).lo),0,i-1)),y?r=Pe(Math.max(Wt(a,o.axis,h,!0).hi+1,t?0:Wt(e,c,o.getPixelForValue(h),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function Zr(n){let{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;let r=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),r}var Ar=n=>n===0||n===1,zu=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*ae/t)),Wu=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*ae/t)+1,Rn={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*we)+1,easeOutSine:n=>Math.sin(n*we),easeInOutSine:n=>-.5*(Math.cos(te*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Ar(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Ar(n)?n:zu(n,.075,.3),easeOutElastic:n=>Ar(n)?n:Wu(n,.075,.3),easeInOutElastic(n){return Ar(n)?n:n<.5?.5*zu(n*2,.1125,.45):.5+.5*Wu(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-Rn.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Rn.easeInBounce(n*2)*.5:Rn.easeOutBounce(n*2-1)*.5+.5};function gs(n){return n+.5|0}var on=(n,e,t)=>Math.max(Math.min(n,t),e);function ls(n){return on(gs(n*2.55),0,255)}function an(n){return on(gs(n*255),0,255)}function Bt(n){return on(gs(n/2.55)/100,0,1)}function Hu(n){return on(gs(n*100),0,100)}var st={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},_l=[..."0123456789ABCDEF"],f_=n=>_l[n&15],p_=n=>_l[(n&240)>>4]+_l[n&15],Nr=n=>(n&240)>>4===(n&15),g_=n=>Nr(n.r)&&Nr(n.g)&&Nr(n.b)&&Nr(n.a);function m_(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&st[n[1]]*17,g:255&st[n[2]]*17,b:255&st[n[3]]*17,a:e===5?st[n[4]]*17:255}:(e===7||e===9)&&(t={r:st[n[1]]<<4|st[n[2]],g:st[n[3]]<<4|st[n[4]],b:st[n[5]]<<4|st[n[6]],a:e===9?st[n[7]]<<4|st[n[8]]:255})),t}var y_=(n,e)=>n<255?e(n):"";function b_(n){var e=g_(n)?f_:p_;return n?"#"+e(n.r)+e(n.g)+e(n.b)+y_(n.a,e):void 0}var w_=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function sh(n,e,t){let i=e*Math.min(t,1-t),s=(r,o=(r+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function v_(n,e,t){let i=(s,r=(s+n/60)%6)=>t-t*e*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function x_(n,e,t){let i=sh(n,1,.5),s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function __(n,e,t,i,s){return n===s?(e-t)/i+(e<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function Il(n){let t=n.r/255,i=n.g/255,s=n.b/255,r=Math.max(t,i,s),o=Math.min(t,i,s),a=(r+o)/2,c,d,h;return r!==o&&(h=r-o,d=a>.5?h/(2-r-o):h/(r+o),c=__(t,i,s,h,r),c=c*60+.5),[c|0,d||0,a]}function Ll(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(an)}function Fl(n,e,t){return Ll(sh,n,e,t)}function S_(n,e,t){return Ll(x_,n,e,t)}function k_(n,e,t){return Ll(v_,n,e,t)}function rh(n){return(n%360+360)%360}function C_(n){let e=w_.exec(n),t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?ls(+e[5]):an(+e[5]));let s=rh(+e[2]),r=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=S_(s,r,o):e[1]==="hsv"?i=k_(s,r,o):i=Fl(s,r,o),{r:i[0],g:i[1],b:i[2],a:t}}function T_(n,e){var t=Il(n);t[0]=rh(t[0]+e),t=Fl(t),n.r=t[0],n.g=t[1],n.b=t[2]}function D_(n){if(!n)return;let e=Il(n),t=e[0],i=Hu(e[1]),s=Hu(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${Bt(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}var Yu={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Vu={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function O_(){let n={},e=Object.keys(Vu),t=Object.keys(Yu),i,s,r,o,a;for(i=0;i<e.length;i++){for(o=a=e[i],s=0;s<t.length;s++)r=t[s],a=a.replace(r,Yu[r]);r=parseInt(Vu[o],16),n[a]=[r>>16&255,r>>8&255,r&255]}return n}var Rr;function M_(n){Rr||(Rr=O_(),Rr.transparent=[0,0,0,0]);let e=Rr[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}var E_=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function P_(n){let e=E_.exec(n),t=255,i,s,r;if(!!e){if(e[7]!==i){let o=+e[7];t=e[8]?ls(o):on(o*255,0,255)}return i=+e[1],s=+e[3],r=+e[5],i=255&(e[2]?ls(i):on(i,0,255)),s=255&(e[4]?ls(s):on(s,0,255)),r=255&(e[6]?ls(r):on(r,0,255)),{r:i,g:s,b:r,a:t}}}function A_(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Bt(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}var bl=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,gi=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function N_(n,e,t){let i=gi(Bt(n.r)),s=gi(Bt(n.g)),r=gi(Bt(n.b));return{r:an(bl(i+t*(gi(Bt(e.r))-i))),g:an(bl(s+t*(gi(Bt(e.g))-s))),b:an(bl(r+t*(gi(Bt(e.b))-r))),a:n.a+t*(e.a-n.a)}}function Ir(n,e,t){if(n){let i=Il(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Fl(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function oh(n,e){return n&&Object.assign(e||{},n)}function ju(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=an(n[3]))):(e=oh(n,{r:0,g:0,b:0,a:1}),e.a=an(e.a)),e}function R_(n){return n.charAt(0)==="r"?P_(n):C_(n)}var yi=class{constructor(e){if(e instanceof yi)return e;let t=typeof e,i;t==="object"?i=ju(e):t==="string"&&(i=m_(e)||M_(e)||R_(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=oh(this._rgb);return e&&(e.a=Bt(e.a)),e}set rgb(e){this._rgb=ju(e)}rgbString(){return this._valid?A_(this._rgb):void 0}hexString(){return this._valid?b_(this._rgb):void 0}hslString(){return this._valid?D_(this._rgb):void 0}mix(e,t){if(e){let i=this.rgb,s=e.rgb,r,o=t===r?.5:t,a=2*o-1,c=i.a-s.a,d=((a*c===-1?a:(a+c)/(1+a*c))+1)/2;r=1-d,i.r=255&d*i.r+r*s.r+.5,i.g=255&d*i.g+r*s.g+.5,i.b=255&d*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=N_(this._rgb,e._rgb,t)),this}clone(){return new yi(this.rgb)}alpha(e){return this._rgb.a=an(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb,t=gs(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Ir(this._rgb,2,e),this}darken(e){return Ir(this._rgb,2,-e),this}saturate(e){return Ir(this._rgb,1,e),this}desaturate(e){return Ir(this._rgb,1,-e),this}rotate(e){return T_(this._rgb,e),this}};function ah(n){return new yi(n)}function Bl(n){if(n&&typeof n=="object"){let e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Jr(n){return Bl(n)?n:ah(n)}function Fr(n){return Bl(n)?n:ah(n).saturate(.5).darken(.1).hexString()}var un=Object.create(null),Qr=Object.create(null);function cs(n,e){if(!e)return n;let t=e.split(".");for(let i=0,s=t.length;i<s;++i){let r=t[i];n=n[r]||(n[r]=Object.create(null))}return n}function wl(n,e,t){return typeof e=="string"?qe(cs(n,e),t):qe(cs(n,""),e)}var Sl=class{constructor(e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,i)=>Fr(i.backgroundColor),this.hoverBorderColor=(t,i)=>Fr(i.borderColor),this.hoverColor=(t,i)=>Fr(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e)}set(e,t){return wl(this,e,t)}get(e){return cs(this,e)}describe(e,t){return wl(Qr,e,t)}override(e,t){return wl(un,e,t)}route(e,t,i,s){let r=cs(this,e),o=cs(this,i),a="_"+t;Object.defineProperties(r,{[a]:{value:r[t],writable:!0},[t]:{enumerable:!0,get(){let c=this[a],d=o[s];return K(c)?Object.assign({},d,c):$(c,d)},set(c){this[a]=c}}})}},q=new Sl({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function lh(n){return!n||J(n.size)||J(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function bi(n,e,t,i,s){let r=e[s];return r||(r=e[s]=n.measureText(s).width,t.push(s)),r>i&&(i=r),i}function zl(n,e,t,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},r=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let o=0,a=t.length,c,d,h,f,y;for(c=0;c<a;c++)if(f=t[c],f!=null&&oe(f)!==!0)o=bi(n,s,r,o,f);else if(oe(f))for(d=0,h=f.length;d<h;d++)y=f[d],y!=null&&!oe(y)&&(o=bi(n,s,r,o,y));n.restore();let g=r.length/2;if(g>t.length){for(c=0;c<g;c++)delete s[r[c]];r.splice(0,g)}return o}function Ht(n,e,t){let i=n.currentDevicePixelRatio,s=t!==0?Math.max(t/2,.5):0;return Math.round((e-s)*i)/i+s}function eo(n,e){e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore()}function Hn(n,e,t,i){to(n,e,t,i,null)}function to(n,e,t,i,s){let r,o,a,c,d,h,f=e.pointStyle,y=e.rotation,g=e.radius,m=(y||0)*Hr;if(f&&typeof f=="object"&&(r=f.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(m),n.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),n.restore();return}if(!(isNaN(g)||g<=0)){switch(n.beginPath(),f){default:s?n.ellipse(t,i,s/2,g,0,0,ae):n.arc(t,i,g,0,ae),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(m)*g,i-Math.cos(m)*g),m+=xl,n.lineTo(t+Math.sin(m)*g,i-Math.cos(m)*g),m+=xl,n.lineTo(t+Math.sin(m)*g,i-Math.cos(m)*g),n.closePath();break;case"rectRounded":d=g*.516,c=g-d,o=Math.cos(m+mi)*c,a=Math.sin(m+mi)*c,n.arc(t-o,i-a,d,m-te,m-we),n.arc(t+a,i-o,d,m-we,m),n.arc(t+o,i+a,d,m,m+we),n.arc(t-a,i+o,d,m+we,m+te),n.closePath();break;case"rect":if(!y){c=Math.SQRT1_2*g,h=s?s/2:c,n.rect(t-h,i-c,2*h,2*c);break}m+=mi;case"rectRot":o=Math.cos(m)*g,a=Math.sin(m)*g,n.moveTo(t-o,i-a),n.lineTo(t+a,i-o),n.lineTo(t+o,i+a),n.lineTo(t-a,i+o),n.closePath();break;case"crossRot":m+=mi;case"cross":o=Math.cos(m)*g,a=Math.sin(m)*g,n.moveTo(t-o,i-a),n.lineTo(t+o,i+a),n.moveTo(t+a,i-o),n.lineTo(t-a,i+o);break;case"star":o=Math.cos(m)*g,a=Math.sin(m)*g,n.moveTo(t-o,i-a),n.lineTo(t+o,i+a),n.moveTo(t+a,i-o),n.lineTo(t-a,i+o),m+=mi,o=Math.cos(m)*g,a=Math.sin(m)*g,n.moveTo(t-o,i-a),n.lineTo(t+o,i+a),n.moveTo(t+a,i-o),n.lineTo(t-a,i+o);break;case"line":o=s?s/2:Math.cos(m)*g,a=Math.sin(m)*g,n.moveTo(t-o,i-a),n.lineTo(t+o,i+a);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(m)*g,i+Math.sin(m)*g);break}n.fill(),e.borderWidth>0&&n.stroke()}}function Ln(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.x<e.right+t&&n.y>e.top-t&&n.y<e.bottom+t}function Yn(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function Vn(n){n.restore()}function Wl(n,e,t,i,s){if(!e)return n.lineTo(t.x,t.y);if(s==="middle"){let r=(e.x+t.x)/2;n.lineTo(r,e.y),n.lineTo(r,t.y)}else s==="after"!=!!i?n.lineTo(e.x,t.y):n.lineTo(t.x,e.y);n.lineTo(t.x,t.y)}function Hl(n,e,t,i){if(!e)return n.lineTo(t.x,t.y);n.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?t.cp2x:t.cp1x,i?t.cp2y:t.cp1y,t.x,t.y)}function Yt(n,e,t,i,s,r={}){let o=oe(e)?e:[e],a=r.strokeWidth>0&&r.strokeColor!=="",c,d;for(n.save(),n.font=s.string,I_(n,r),c=0;c<o.length;++c)d=o[c],a&&(r.strokeColor&&(n.strokeStyle=r.strokeColor),J(r.strokeWidth)||(n.lineWidth=r.strokeWidth),n.strokeText(d,t,i,r.maxWidth)),n.fillText(d,t,i,r.maxWidth),L_(n,t,i,d,r),i+=s.lineHeight;n.restore()}function I_(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),J(e.rotation)||n.rotate(e.rotation),e.color&&(n.fillStyle=e.color),e.textAlign&&(n.textAlign=e.textAlign),e.textBaseline&&(n.textBaseline=e.textBaseline)}function L_(n,e,t,i,s){if(s.strikethrough||s.underline){let r=n.measureText(i),o=e-r.actualBoundingBoxLeft,a=e+r.actualBoundingBoxRight,c=t-r.actualBoundingBoxAscent,d=t+r.actualBoundingBoxDescent,h=s.strikethrough?(c+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(o,h),n.lineTo(a,h),n.stroke()}}function Vt(n,e){let{x:t,y:i,w:s,h:r,radius:o}=e;n.arc(t+o.topLeft,i+o.topLeft,o.topLeft,-we,te,!0),n.lineTo(t,i+r-o.bottomLeft),n.arc(t+o.bottomLeft,i+r-o.bottomLeft,o.bottomLeft,te,we,!0),n.lineTo(t+s-o.bottomRight,i+r),n.arc(t+s-o.bottomRight,i+r-o.bottomRight,o.bottomRight,we,0,!0),n.lineTo(t+s,i+o.topRight),n.arc(t+s-o.topRight,i+o.topRight,o.topRight,0,-we,!0),n.lineTo(t+o.topLeft,i)}var F_=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),B_=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function ch(n,e){let t=(""+n).match(F_);if(!t||t[1]==="normal")return e*1.2;switch(n=+t[2],t[3]){case"px":return n;case"%":n/=100;break}return e*n}var z_=n=>+n||0;function ms(n,e){let t={},i=K(e),s=i?Object.keys(e):e,r=K(n)?i?o=>$(n[o],n[e[o]]):o=>n[o]:()=>n;for(let o of s)t[o]=z_(r(o));return t}function no(n){return ms(n,{top:"y",right:"x",bottom:"y",left:"x"})}function gt(n){return ms(n,["topLeft","topRight","bottomLeft","bottomRight"])}function me(n){let e=no(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function he(n,e){n=n||{},e=e||q.font;let t=$(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=$(n.style,e.style);i&&!(""+i).match(B_)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");let s={family:$(n.family,e.family),lineHeight:ch($(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:$(n.weight,e.weight),string:""};return s.string=lh(s),s}function ue(n,e,t,i){let s=!0,r,o,a;for(r=0,o=n.length;r<o;++r)if(a=n[r],a!==void 0&&(e!==void 0&&typeof a=="function"&&(a=a(e),s=!1),t!==void 0&&oe(a)&&(a=a[t%a.length],s=!1),a!==void 0))return i&&!s&&(i.cacheable=!1),a}function Yl(n,e,t){let{min:i,max:s}=n,r=zr(e,(s-i)/2),o=(a,c)=>t&&a===0?0:a+c;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function Ct(n,e){return Object.assign(Object.create(n),e)}function ys(n,e=[""],t=n,i,s=()=>n[0]){ve(i)||(i=hh("_fallback",n));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>ys([o,...n],e,t,i)};return new Proxy(r,{deleteProperty(o,a){return delete o[a],delete o._keys,delete n[0][a],!0},get(o,a){return dh(o,a,()=>G_(a,e,n,o))},getOwnPropertyDescriptor(o,a){return Reflect.getOwnPropertyDescriptor(o._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,a){return $u(o).includes(a)},ownKeys(o){return $u(o)},set(o,a,c){let d=o._storage||(o._storage=s());return o[a]=d[a]=c,delete o._keys,!0}})}function cn(n,e,t,i){let s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:io(n,i),setContext:r=>cn(n,r,t,i),override:r=>cn(n.override(r),e,t,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete n[o],!0},get(r,o,a){return dh(r,o,()=>H_(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(r,o,a){return n[o]=a,delete r[o],!0}})}function io(n,e={scriptable:!0,indexable:!0}){let{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=n;return{allKeys:s,scriptable:t,indexable:i,isScriptable:_t(t)?t:()=>t,isIndexable:_t(i)?i:()=>i}}var W_=(n,e)=>n?n+hs(e):e,Vl=(n,e)=>K(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function dh(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];let i=t();return n[e]=i,i}function H_(n,e,t){let{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=n,a=i[e];return _t(a)&&o.isScriptable(e)&&(a=Y_(e,a,n,t)),oe(a)&&a.length&&(a=V_(e,a,n,o.isIndexable)),Vl(e,a)&&(a=cn(a,s,r&&r[e],o)),a}function Y_(n,e,t,i){let{_proxy:s,_context:r,_subProxy:o,_stack:a}=t;if(a.has(n))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+n);return a.add(n),e=e(r,o||i),a.delete(n),Vl(n,e)&&(e=jl(s._scopes,s,n,e)),e}function V_(n,e,t,i){let{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=t;if(ve(r.index)&&i(n))e=e[r.index%e.length];else if(K(e[0])){let c=e,d=s._scopes.filter(h=>h!==c);e=[];for(let h of c){let f=jl(d,s,n,h);e.push(cn(f,r,o&&o[n],a))}}return e}function uh(n,e,t){return _t(n)?n(e,t):n}var j_=(n,e)=>n===!0?e:typeof n=="string"?St(e,n):void 0;function U_(n,e,t,i,s){for(let r of e){let o=j_(t,r);if(o){n.add(o);let a=uh(o._fallback,t,s);if(ve(a)&&a!==t&&a!==i)return a}else if(o===!1&&ve(i)&&t!==i)return null}return!1}function jl(n,e,t,i){let s=e._rootScopes,r=uh(e._fallback,t,i),o=[...n,...s],a=new Set;a.add(i);let c=Uu(a,o,t,r||t,i);return c===null||ve(r)&&r!==t&&(c=Uu(a,o,r,c,i),c===null)?!1:ys(Array.from(a),[""],s,r,()=>$_(e,t,i))}function Uu(n,e,t,i,s){for(;t;)t=U_(n,e,t,i,s);return t}function $_(n,e,t){let i=n._getTarget();e in i||(i[e]={});let s=i[e];return oe(s)&&K(t)?t:s}function G_(n,e,t,i){let s;for(let r of e)if(s=hh(W_(r,n),t),ve(s))return Vl(n,s)?jl(t,i,n,s):s}function hh(n,e){for(let t of e){if(!t)continue;let i=t[n];if(ve(i))return i}}function $u(n){let e=n._keys;return e||(e=n._keys=K_(n._scopes)),e}function K_(n){let e=new Set;for(let t of n)for(let i of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function so(n,e,t,i){let{iScale:s}=n,{key:r="r"}=this._parsing,o=new Array(i),a,c,d,h;for(a=0,c=i;a<c;++a)d=a+t,h=e[d],o[a]={r:s.parse(St(h,r),d)};return o}var q_=Number.EPSILON||1e-14,wi=(n,e)=>e<n.length&&!n[e].skip&&n[e],fh=n=>n==="x"?"y":"x";function ph(n,e,t,i){let s=n.skip?e:n,r=e,o=t.skip?e:t,a=ln(r,s),c=ln(o,r),d=a/(a+c),h=c/(a+c);d=isNaN(d)?0:d,h=isNaN(h)?0:h;let f=i*d,y=i*h;return{previous:{x:r.x-f*(o.x-s.x),y:r.y-f*(o.y-s.y)},next:{x:r.x+y*(o.x-s.x),y:r.y+y*(o.y-s.y)}}}function X_(n,e,t){let i=n.length,s,r,o,a,c,d=wi(n,0);for(let h=0;h<i-1;++h)if(c=d,d=wi(n,h+1),!(!c||!d)){if(Bn(e[h],0,q_)){t[h]=t[h+1]=0;continue}s=t[h]/e[h],r=t[h+1]/e[h],a=Math.pow(s,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),t[h]=s*o*e[h],t[h+1]=r*o*e[h])}}function Z_(n,e,t="x"){let i=fh(t),s=n.length,r,o,a,c=wi(n,0);for(let d=0;d<s;++d){if(o=a,a=c,c=wi(n,d+1),!a)continue;let h=a[t],f=a[i];o&&(r=(h-o[t])/3,a[`cp1${t}`]=h-r,a[`cp1${i}`]=f-r*e[d]),c&&(r=(c[t]-h)/3,a[`cp2${t}`]=h+r,a[`cp2${i}`]=f+r*e[d])}}function gh(n,e="x"){let t=fh(e),i=n.length,s=Array(i).fill(0),r=Array(i),o,a,c,d=wi(n,0);for(o=0;o<i;++o)if(a=c,c=d,d=wi(n,o+1),!!c){if(d){let h=d[e]-c[e];s[o]=h!==0?(d[t]-c[t])/h:0}r[o]=a?d?rt(s[o-1])!==rt(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}X_(n,s,r),Z_(n,r,e)}function Lr(n,e,t){return Math.max(Math.min(n,t),e)}function J_(n,e){let t,i,s,r,o,a=Ln(n[0],e);for(t=0,i=n.length;t<i;++t)o=r,r=a,a=t<i-1&&Ln(n[t+1],e),r&&(s=n[t],o&&(s.cp1x=Lr(s.cp1x,e.left,e.right),s.cp1y=Lr(s.cp1y,e.top,e.bottom)),a&&(s.cp2x=Lr(s.cp2x,e.left,e.right),s.cp2y=Lr(s.cp2y,e.top,e.bottom)))}function Ul(n,e,t,i,s){let r,o,a,c;if(e.spanGaps&&(n=n.filter(d=>!d.skip)),e.cubicInterpolationMode==="monotone")gh(n,s);else{let d=i?n[n.length-1]:n[0];for(r=0,o=n.length;r<o;++r)a=n[r],c=ph(d,a,n[Math.min(r+1,o-(i?0:1))%o],e.tension),a.cp1x=c.previous.x,a.cp1y=c.previous.y,a.cp2x=c.next.x,a.cp2y=c.next.y,d=a}e.capBezierPoints&&J_(n,t)}function ro(){return typeof window<"u"&&typeof document<"u"}function bs(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Br(n,e,t){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*e.parentNode[t])):i=n,i}var oo=n=>window.getComputedStyle(n,null);function mh(n,e){return oo(n).getPropertyValue(e)}var Q_=["top","right","bottom","left"];function In(n,e,t){let i={};t=t?"-"+t:"";for(let s=0;s<4;s++){let r=Q_[s];i[r]=parseFloat(n[e+"-"+r+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}var eS=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function tS(n,e){let t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:r}=i,o=!1,a,c;if(eS(s,r,n.target))a=s,c=r;else{let d=e.getBoundingClientRect();a=i.clientX-d.left,c=i.clientY-d.top,o=!0}return{x:a,y:c,box:o}}function jt(n,e){if("native"in n)return n;let{canvas:t,currentDevicePixelRatio:i}=e,s=oo(t),r=s.boxSizing==="border-box",o=In(s,"padding"),a=In(s,"border","width"),{x:c,y:d,box:h}=tS(n,t),f=o.left+(h&&a.left),y=o.top+(h&&a.top),{width:g,height:m}=e;return r&&(g-=o.width+a.width,m-=o.height+a.height),{x:Math.round((c-f)/g*t.width/i),y:Math.round((d-y)/m*t.height/i)}}function nS(n,e,t){let i,s;if(e===void 0||t===void 0){let r=bs(n);if(!r)e=n.clientWidth,t=n.clientHeight;else{let o=r.getBoundingClientRect(),a=oo(r),c=In(a,"border","width"),d=In(a,"padding");e=o.width-d.width-c.width,t=o.height-d.height-c.height,i=Br(a.maxWidth,r,"clientWidth"),s=Br(a.maxHeight,r,"clientHeight")}}return{width:e,height:t,maxWidth:i||us,maxHeight:s||us}}var vl=n=>Math.round(n*10)/10;function $l(n,e,t,i){let s=oo(n),r=In(s,"margin"),o=Br(s.maxWidth,n,"clientWidth")||us,a=Br(s.maxHeight,n,"clientHeight")||us,c=nS(n,e,t),{width:d,height:h}=c;if(s.boxSizing==="content-box"){let f=In(s,"border","width"),y=In(s,"padding");d-=y.width+f.width,h-=y.height+f.height}return d=Math.max(0,d-r.width),h=Math.max(0,i?Math.floor(d/i):h-r.height),d=vl(Math.min(d,o,c.maxWidth)),h=vl(Math.min(h,a,c.maxHeight)),d&&!h&&(h=vl(d/2)),{width:d,height:h}}function ao(n,e,t){let i=e||1,s=Math.floor(n.height*i),r=Math.floor(n.width*i);n.height=s/i,n.width=r/i;let o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==r?(n.currentDevicePixelRatio=i,o.height=s,o.width=r,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}var Gl=function(){let n=!1;try{let e={get passive(){return n=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return n}();function lo(n,e){let t=mh(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function zt(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function Kl(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function ql(n,e,t,i){let s={x:n.cp2x,y:n.cp2y},r={x:e.cp1x,y:e.cp1y},o=zt(n,s,t),a=zt(s,r,t),c=zt(r,e,t),d=zt(o,a,t),h=zt(a,c,t);return zt(d,h,t)}var Gu=new Map;function iS(n,e){e=e||{};let t=n+JSON.stringify(e),i=Gu.get(t);return i||(i=new Intl.NumberFormat(n,e),Gu.set(t,i)),i}function jn(n,e,t){return iS(e,t).format(n)}var sS=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},rS=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function hn(n,e,t){return n?sS(e,t):rS()}function co(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function uo(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function yh(n){return n==="angle"?{between:Wn,compare:nh,normalize:Ke}:{between:kt,compare:(e,t)=>e-t,normalize:e=>e}}function Ku({start:n,end:e,count:t,loop:i,style:s}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:s}}function oS(n,e,t){let{property:i,start:s,end:r}=t,{between:o,normalize:a}=yh(i),c=e.length,{start:d,end:h,loop:f}=n,y,g;if(f){for(d+=c,h+=c,y=0,g=c;y<g&&o(a(e[d%c][i]),s,r);++y)d--,h--;d%=c,h%=c}return h<d&&(h+=c),{start:d,end:h,loop:f,style:n.style}}function Xl(n,e,t){if(!t)return[n];let{property:i,start:s,end:r}=t,o=e.length,{compare:a,between:c,normalize:d}=yh(i),{start:h,end:f,loop:y,style:g}=oS(n,e,t),m=[],v=!1,x=null,_,S,k,D=()=>c(s,k,_)&&a(s,k)!==0,T=()=>a(r,_)===0||c(r,k,_),M=()=>v||D(),O=()=>!v||T();for(let E=h,A=h;E<=f;++E)S=e[E%o],!S.skip&&(_=d(S[i]),_!==k&&(v=c(_,s,r),x===null&&M()&&(x=a(_,s)===0?E:A),x!==null&&O()&&(m.push(Ku({start:x,end:E,loop:y,count:o,style:g})),x=null),A=E,k=_));return x!==null&&m.push(Ku({start:x,end:f,loop:y,count:o,style:g})),m}function Zl(n,e){let t=[],i=n.segments;for(let s=0;s<i.length;s++){let r=Xl(i[s],n.points,e);r.length&&t.push(...r)}return t}function aS(n,e,t,i){let s=0,r=e-1;if(t&&!i)for(;s<e&&!n[s].skip;)s++;for(;s<e&&n[s].skip;)s++;for(s%=e,t&&(r+=s);r>s&&n[r%e].skip;)r--;return r%=e,{start:s,end:r}}function lS(n,e,t,i){let s=n.length,r=[],o=e,a=n[e],c;for(c=e+1;c<=t;++c){let d=n[c%s];d.skip||d.stop?a.skip||(i=!1,r.push({start:e%s,end:(c-1)%s,loop:i}),e=o=d.stop?c:null):(o=c,a.skip&&(e=c)),a=d}return o!==null&&r.push({start:e%s,end:o%s,loop:i}),r}function Jl(n,e){let t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];let r=!!n._loop,{start:o,end:a}=aS(t,s,r,i);if(i===!0)return qu(n,[{start:o,end:a,loop:r}],t,e);let c=a<o?a+s:a,d=!!n._fullLoop&&o===0&&a===s-1;return qu(n,lS(t,o,c,d),t,e)}function qu(n,e,t,i){return!i||!i.setContext||!t?e:cS(n,e,t,i)}function cS(n,e,t,i){let s=n._chart.getContext(),r=Xu(n.options),{_datasetIndex:o,options:{spanGaps:a}}=n,c=t.length,d=[],h=r,f=e[0].start,y=f;function g(m,v,x,_){let S=a?-1:1;if(m!==v){for(m+=c;t[m%c].skip;)m-=S;for(;t[v%c].skip;)v+=S;m%c!==v%c&&(d.push({start:m%c,end:v%c,loop:x,style:_}),h=_,f=v%c)}}for(let m of e){f=a?f:m.start;let v=t[f%c],x;for(y=f+1;y<=m.end;y++){let _=t[y%c];x=Xu(i.setContext(Ct(s,{type:"segment",p0:v,p1:_,p0DataIndex:(y-1)%c,p1DataIndex:y%c,datasetIndex:o}))),dS(x,h)&&g(f,y-1,m.loop,h),v=_,h=x}f<y-1&&g(f,y-1,m.loop,h)}return d}function Xu(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function dS(n,e){return e&&JSON.stringify(n)!==JSON.stringify(e)}var ac=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){let r=t.listeners[s],o=t.duration;r.forEach(a=>a({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Kr.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;let r=i.items,o=r.length-1,a=!1,c;for(;o>=0;--o)c=r[o],c._active?(c._total>i.duration&&(i.duration=c._total),c.tick(e),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,e,"progress")),r.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=r.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);!t||(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let i=t.items,s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}},Ut=new ac,bh="transparent",uS={boolean(n,e,t){return t>.5?e:n},color(n,e,t){let i=Jr(n||bh),s=i.valid&&Jr(e||bh);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}},lc=class{constructor(e,t,i,s){let r=t[i];s=ue([e.to,s,r,e.from]);let o=ue([e.from,r,s]);this._active=!0,this._fn=e.fn||uS[e.type||typeof o],this._easing=Rn[e.easing]||Rn.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);let s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=r,this._loop=!!e.loop,this._to=ue([e.to,t,s,e.from]),this._from=ue([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to,c;if(this._active=r!==a&&(o||t<i),!this._active){this._target[s]=a,this._notify(!0);return}if(t<0){this._target[s]=r;return}c=t/i%2,c=o&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[s]=this._fn(r,a,c)}wait(){let e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){let t=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][t]()}},hS=["x","y","borderWidth","radius","tension"],fS=["color","borderColor","backgroundColor"];q.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});var pS=Object.keys(q.animation);q.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});q.set("animations",{colors:{type:"color",properties:fS},numbers:{type:"number",properties:hS}});q.describe("animations",{_fallback:"animation"});q.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});var Si=class{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!K(e))return;let t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{let s=e[i];if(!K(s))return;let r={};for(let o of pS)r[o]=s[o];(oe(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,r)})})}_animateOptions(e,t){let i=t.options,s=mS(e,i);if(!s)return[];let r=this._createAnimations(s,i);return i.$shared&&gS(e.options.$animations,i).then(()=>{e.options=i},()=>{}),r}_createAnimations(e,t){let i=this._properties,s=[],r=e.$animations||(e.$animations={}),o=Object.keys(t),a=Date.now(),c;for(c=o.length-1;c>=0;--c){let d=o[c];if(d.charAt(0)==="$")continue;if(d==="options"){s.push(...this._animateOptions(e,t));continue}let h=t[d],f=r[d],y=i.get(d);if(f)if(y&&f.active()){f.update(y,h,a);continue}else f.cancel();if(!y||!y.duration){e[d]=h;continue}r[d]=f=new lc(y,e,d,h),s.push(f)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let i=this._createAnimations(e,t);if(i.length)return Ut.add(this._chart,i),!0}};function gS(n,e){let t=[],i=Object.keys(e);for(let s=0;s<i.length;s++){let r=n[i[s]];r&&r.active()&&t.push(r.wait())}return Promise.all(t)}function mS(n,e){if(!e)return;let t=n.options;if(!t){n.options=e;return}return t.$shared&&(n.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function wh(n,e){let t=n&&n.options||{},i=t.reverse,s=t.min===void 0?e:0,r=t.max===void 0?e:0;return{start:i?r:s,end:i?s:r}}function yS(n,e,t){if(t===!1)return!1;let i=wh(n,t),s=wh(e,t);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function bS(n){let e,t,i,s;return K(n)?(e=n.top,t=n.right,i=n.bottom,s=n.left):e=t=i=s=n,{top:e,right:t,bottom:i,left:s,disabled:n===!1}}function sf(n,e){let t=[],i=n._getSortedDatasetMetas(e),s,r;for(s=0,r=i.length;s<r;++s)t.push(i[s].index);return t}function vh(n,e,t,i={}){let s=n.keys,r=i.mode==="single",o,a,c,d;if(e!==null){for(o=0,a=s.length;o<a;++o){if(c=+s[o],c===t){if(i.all)continue;break}d=n.values[c],_e(d)&&(r||e===0||rt(e)===rt(d))&&(e+=d)}return e}}function wS(n){let e=Object.keys(n),t=new Array(e.length),i,s,r;for(i=0,s=e.length;i<s;++i)r=e[i],t[i]={x:r,y:n[r]};return t}function xh(n,e){let t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function vS(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function xS(n){let{min:e,max:t,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:s?t:Number.POSITIVE_INFINITY}}function _S(n,e,t){let i=n[e]||(n[e]={});return i[t]||(i[t]={})}function _h(n,e,t,i){for(let s of e.getMatchingVisibleMetas(i).reverse()){let r=n[s.index];if(t&&r>0||!t&&r<0)return s.index}return null}function Sh(n,e){let{chart:t,_cachedMeta:i}=n,s=t._stacks||(t._stacks={}),{iScale:r,vScale:o,index:a}=i,c=r.axis,d=o.axis,h=vS(r,o,i),f=e.length,y;for(let g=0;g<f;++g){let m=e[g],{[c]:v,[d]:x}=m,_=m._stacks||(m._stacks={});y=_[d]=_S(s,h,v),y[a]=x,y._top=_h(y,o,!0,i.type),y._bottom=_h(y,o,!1,i.type)}}function Ql(n,e){let t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function SS(n,e){return Ct(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function kS(n,e,t){return Ct(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function ws(n,e){let t=n.controller.index,i=n.vScale&&n.vScale.axis;if(!!i){e=e||n._parsed;for(let s of e){let r=s._stacks;if(!r||r[i]===void 0||r[i][t]===void 0)return;delete r[i][t]}}}var ec=n=>n==="reset"||n==="none",kh=(n,e)=>e?n:Object.assign({},n),CS=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:sf(t,!0),values:null},Xe=class{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){let e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=xh(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&ws(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(f,y,g,m)=>f==="x"?y:f==="r"?m:g,r=t.xAxisID=$(i.xAxisID,Ql(e,"x")),o=t.yAxisID=$(i.yAxisID,Ql(e,"y")),a=t.rAxisID=$(i.rAxisID,Ql(e,"r")),c=t.indexAxis,d=t.iAxisID=s(c,r,o,a),h=t.vAxisID=s(c,o,r,a);t.xScale=this.getScaleForId(r),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(a),t.iScale=this.getScaleForId(d),t.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){let e=this._cachedMeta;this._data&&$r(this._data,this),e._stacked&&ws(e)}_dataCheck(){let e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(K(t))this._data=wS(t);else if(i!==t){if(i){$r(i,this);let s=this._cachedMeta;ws(s),s._parsed=[]}t&&Object.isExtensible(t)&&Al(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,i=this.getDataset(),s=!1;this._dataCheck();let r=t._stacked;t._stacked=xh(t.vScale,t),t.stack!==i.stack&&(s=!0,ws(t),t.stack=i.stack),this._resyncElements(e),(s||r!==t._stacked)&&Sh(this,t._parsed)}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis,c=e===0&&t===s.length?!0:i._sorted,d=e>0&&i._parsed[e-1],h,f,y;if(this._parsing===!1)i._parsed=s,i._sorted=!0,y=s;else{oe(s[e])?y=this.parseArrayData(i,s,e,t):K(s[e])?y=this.parseObjectData(i,s,e,t):y=this.parsePrimitiveData(i,s,e,t);let g=()=>f[a]===null||d&&f[a]<d[a];for(h=0;h<t;++h)i._parsed[h+e]=f=y[h],c&&(g()&&(c=!1),d=f);i._sorted=c}o&&Sh(this,y)}parsePrimitiveData(e,t,i,s){let{iScale:r,vScale:o}=e,a=r.axis,c=o.axis,d=r.getLabels(),h=r===o,f=new Array(s),y,g,m;for(y=0,g=s;y<g;++y)m=y+i,f[y]={[a]:h||r.parse(d[m],m),[c]:o.parse(t[m],m)};return f}parseArrayData(e,t,i,s){let{xScale:r,yScale:o}=e,a=new Array(s),c,d,h,f;for(c=0,d=s;c<d;++c)h=c+i,f=t[h],a[c]={x:r.parse(f[0],h),y:o.parse(f[1],h)};return a}parseObjectData(e,t,i,s){let{xScale:r,yScale:o}=e,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,d=new Array(s),h,f,y,g;for(h=0,f=s;h<f;++h)y=h+i,g=t[y],d[h]={x:r.parse(St(g,a),y),y:o.parse(St(g,c),y)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,i){let s=this.chart,r=this._cachedMeta,o=t[e.axis],a={keys:sf(s,!0),values:t._stacks[e.axis]};return vh(a,o,r.index,{mode:i})}updateRangeFromParsed(e,t,i,s){let r=i[t.axis],o=r===null?NaN:r,a=s&&i._stacks[t.axis];s&&a&&(s.values=a,o=vh(s,r,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,t){let i=this._cachedMeta,s=i._parsed,r=i._sorted&&e===i.iScale,o=s.length,a=this._getOtherScale(e),c=CS(t,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:f}=xS(a),y,g;function m(){g=s[y];let v=g[a.axis];return!_e(g[e.axis])||h>v||f<v}for(y=0;y<o&&!(!m()&&(this.updateRangeFromParsed(d,e,g,c),r));++y);if(r){for(y=o-1;y>=0;--y)if(!m()){this.updateRangeFromParsed(d,e,g,c);break}}return d}getAllParsedValues(e){let t=this._cachedMeta._parsed,i=[],s,r,o;for(s=0,r=t.length;s<r;++s)o=t[s][e.axis],_e(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(e){let t=this._cachedMeta,i=t.iScale,s=t.vScale,r=this.getParsed(e);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(e){let t=this._cachedMeta;this.update(e||"default"),t._clip=bS($(this.options.clip,yS(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){let e=this._ctx,t=this.chart,i=this._cachedMeta,s=i.data||[],r=t.chartArea,o=[],a=this._drawStart||0,c=this._drawCount||s.length-a,d=this.options.drawActiveElementsOnTop,h;for(i.dataset&&i.dataset.draw(e,r,a,c),h=a;h<a+c;++h){let f=s[h];f.hidden||(f.active&&d?o.push(f):f.draw(e,r))}for(h=0;h<o.length;++h)o[h].draw(e,r)}getStyle(e,t){let i=t?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,t,i){let s=this.getDataset(),r;if(e>=0&&e<this._cachedMeta.data.length){let o=this._cachedMeta.data[e];r=o.$context||(o.$context=kS(this.getContext(),e,o)),r.parsed=this.getParsed(e),r.raw=s.data[e],r.index=r.dataIndex=e}else r=this.$context||(this.$context=SS(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!t,r.mode=i,r}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",i){let s=t==="active",r=this._cachedDataOpts,o=e+"-"+t,a=r[o],c=this.enableOptionSharing&&ve(i);if(a)return kh(a,c);let d=this.chart.config,h=d.datasetElementScopeKeys(this._type,e),f=s?[`${e}Hover`,"hover",e,""]:[e,""],y=d.getOptionScopes(this.getDataset(),h),g=Object.keys(q.elements[e]),m=()=>this.getContext(i,s),v=d.resolveNamedOptions(y,g,m,f);return v.$shared&&(v.$shared=c,r[o]=Object.freeze(kh(v,c))),v}_resolveAnimations(e,t,i){let s=this.chart,r=this._cachedDataOpts,o=`animation-${t}`,a=r[o];if(a)return a;let c;if(s.options.animation!==!1){let h=this.chart.config,f=h.datasetAnimationScopeKeys(this._type,t),y=h.getOptionScopes(this.getDataset(),f);c=h.createResolver(y,this.getContext(e,i,t))}let d=new Si(s,c&&c.animations);return c&&c._cacheable&&(r[o]=Object.freeze(d)),d}getSharedOptions(e){if(!!e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||ec(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let i=this.resolveDataElementOptions(e,t),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(t,r)||r!==s;return this.updateSharedOptions(r,t,i),{sharedOptions:r,includeOptions:o}}updateElement(e,t,i,s){ec(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!ec(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;let r=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){let t=this._data,i=this._cachedMeta.data;for(let[a,c,d]of this._syncList)this[a](c,d);this._syncList=[];let s=i.length,r=t.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,e):r<s&&this._removeElements(r,s-r)}_insertElements(e,t,i=!0){let s=this._cachedMeta,r=s.data,o=e+t,a,c=d=>{for(d.length+=t,a=d.length-1;a>=o;a--)d[a]=d[a-t]};for(c(r),a=e;a<o;++a)r[a]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(e,t),i&&this.updateElements(r,e,t,"reset")}updateElements(e,t,i,s){}_removeElements(e,t){let i=this._cachedMeta;if(this._parsing){let s=i._parsed.splice(e,t);i._stacked&&ws(i,s)}i.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{let[t,i,s]=e;this[t](i,s)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){let e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);let i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};Xe.defaults={};Xe.prototype.datasetElementType=null;Xe.prototype.dataElementType=null;function TS(n,e){if(!n._cache.$bar){let t=n.getMatchingVisibleMetas(e),i=[];for(let s=0,r=t.length;s<r;s++)i=i.concat(t[s].controller.getAllParsedValues(n));n._cache.$bar=Gr(i.sort((s,r)=>s-r))}return n._cache.$bar}function DS(n){let e=n.iScale,t=TS(e,n.type),i=e._length,s,r,o,a,c=()=>{o===32767||o===-32768||(ve(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=t.length;s<r;++s)o=e.getPixelForValue(t[s]),c();for(a=void 0,s=0,r=e.ticks.length;s<r;++s)o=e.getPixelForTick(s),c();return i}function OS(n,e,t,i){let s=t.barThickness,r,o;return J(s)?(r=e.min*t.categoryPercentage,o=t.barPercentage):(r=s*i,o=1),{chunk:r/i,ratio:o,start:e.pixels[n]-r/2}}function MS(n,e,t,i){let s=e.pixels,r=s[n],o=n>0?s[n-1]:null,a=n<s.length-1?s[n+1]:null,c=t.categoryPercentage;o===null&&(o=r-(a===null?e.end-e.start:a-r)),a===null&&(a=r+r-o);let d=r-(r-Math.min(o,a))/2*c;return{chunk:Math.abs(a-o)/2*c/i,ratio:t.barPercentage,start:d}}function ES(n,e,t,i){let s=t.parse(n[0],i),r=t.parse(n[1],i),o=Math.min(s,r),a=Math.max(s,r),c=o,d=a;Math.abs(o)>Math.abs(a)&&(c=a,d=o),e[t.axis]=d,e._custom={barStart:c,barEnd:d,start:s,end:r,min:o,max:a}}function rf(n,e,t,i){return oe(n)?ES(n,e,t,i):e[t.axis]=t.parse(n,i),e}function Ch(n,e,t,i){let s=n.iScale,r=n.vScale,o=s.getLabels(),a=s===r,c=[],d,h,f,y;for(d=t,h=t+i;d<h;++d)y=e[d],f={},f[s.axis]=a||s.parse(o[d],d),c.push(rf(y,f,r,d));return c}function tc(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function PS(n,e,t){return n!==0?rt(n):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function AS(n){let e,t,i,s,r;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.base<n.y,t="bottom",i="top"),e?(s="end",r="start"):(s="start",r="end"),{start:t,end:i,reverse:e,top:s,bottom:r}}function NS(n,e,t,i){let s=e.borderSkipped,r={};if(!s){n.borderSkipped=r;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:o,end:a,reverse:c,top:d,bottom:h}=AS(n);s==="middle"&&t&&(n.enableBorderRadius=!0,(t._top||0)===i?s=d:(t._bottom||0)===i?s=h:(r[Th(h,o,a,c)]=!0,s=d)),r[Th(s,o,a,c)]=!0,n.borderSkipped=r}function Th(n,e,t,i){return i?(n=RS(n,e,t),n=Dh(n,t,e)):n=Dh(n,e,t),n}function RS(n,e,t){return n===e?t:n===t?e:n}function Dh(n,e,t){return n==="start"?e:n==="end"?t:n}function IS(n,{inflateAmount:e},t){n.inflateAmount=e==="auto"?t===1?.33:0:e}var $n=class extends Xe{parsePrimitiveData(e,t,i,s){return Ch(e,t,i,s)}parseArrayData(e,t,i,s){return Ch(e,t,i,s)}parseObjectData(e,t,i,s){let{iScale:r,vScale:o}=e,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,d=r.axis==="x"?a:c,h=o.axis==="x"?a:c,f=[],y,g,m,v;for(y=i,g=i+s;y<g;++y)v=t[y],m={},m[r.axis]=r.parse(St(v,d),y),f.push(rf(St(v,h),m,o,y));return f}updateRangeFromParsed(e,t,i,s){super.updateRangeFromParsed(e,t,i,s);let r=i._custom;r&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,r.min),e.max=Math.max(e.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(e){let t=this._cachedMeta,{iScale:i,vScale:s}=t,r=this.getParsed(e),o=r._custom,a=tc(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();let e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){let t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,i,s){let r=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,c=a.getBasePixel(),d=a.isHorizontal(),h=this._getRuler(),{sharedOptions:f,includeOptions:y}=this._getSharedOptions(t,s);for(let g=t;g<t+i;g++){let m=this.getParsed(g),v=r||J(m[a.axis])?{base:c,head:c}:this._calculateBarValuePixels(g),x=this._calculateBarIndexPixels(g,h),_=(m._stacks||{})[a.axis],S={horizontal:d,base:v.base,enableBorderRadius:!_||tc(m._custom)||o===_._top||o===_._bottom,x:d?v.head:x.center,y:d?x.center:v.head,height:d?x.size:Math.abs(v.size),width:d?Math.abs(v.size):x.size};y&&(S.options=f||this.resolveDataElementOptions(g,e[g].active?"active":s));let k=S.options||e[g].options;NS(S,k,_,o),IS(S,k,h.ratio),this.updateElement(e[g],g,S,s)}}_getStacks(e,t){let{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),r=i.options.stacked,o=[],a=c=>{let d=c.controller.getParsed(t),h=d&&d[c.vScale.axis];if(J(h)||isNaN(h))return!0};for(let c of s)if(!(t!==void 0&&a(c))&&((r===!1||o.indexOf(c.stack)===-1||r===void 0&&c.stack===void 0)&&o.push(c.stack),c.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){let s=this._getStacks(e,i),r=t!==void 0?s.indexOf(t):-1;return r===-1?s.length-1:r}_getRuler(){let e=this.options,t=this._cachedMeta,i=t.iScale,s=[],r,o;for(r=0,o=t.data.length;r<o;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));let a=e.barThickness;return{min:a||DS(t),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){let{_cachedMeta:{vScale:t,_stacked:i},options:{base:s,minBarLength:r}}=this,o=s||0,a=this.getParsed(e),c=a._custom,d=tc(c),h=a[t.axis],f=0,y=i?this.applyStack(t,a,i):h,g,m;y!==h&&(f=y-h,y=h),d&&(h=c.barStart,y=c.barEnd-c.barStart,h!==0&&rt(h)!==rt(c.barEnd)&&(f=0),f+=h);let v=!J(s)&&!d?s:f,x=t.getPixelForValue(v);if(this.chart.getDataVisibility(e)?g=t.getPixelForValue(f+y):g=x,m=g-x,Math.abs(m)<r){m=PS(m,t,o)*r,h===o&&(x-=m/2);let _=t.getPixelForDecimal(0),S=t.getPixelForDecimal(1),k=Math.min(_,S),D=Math.max(_,S);x=Math.max(Math.min(x,D),k),g=x+m}if(x===t.getPixelForValue(o)){let _=rt(m)*t.getLineWidthForValue(o)/2;x+=_,m-=_}return{size:m,base:x,head:g,center:g+m/2}}_calculateBarIndexPixels(e,t){let i=t.scale,s=this.options,r=s.skipNull,o=$(s.maxBarThickness,1/0),a,c;if(t.grouped){let d=r?this._getStackCount(e):t.stackCount,h=s.barThickness==="flex"?MS(e,t,s,d):OS(e,t,s,d),f=this._getStackIndex(this.index,this._cachedMeta.stack,r?e:void 0);a=h.start+h.chunk*f+h.chunk/2,c=Math.min(o,h.chunk*h.ratio)}else a=i.getPixelForValue(this.getParsed(e)[i.axis],e),c=Math.min(o,t.min*t.ratio);return{base:a-c/2,head:a+c/2,center:a,size:c}}draw(){let e=this._cachedMeta,t=e.vScale,i=e.data,s=i.length,r=0;for(;r<s;++r)this.getParsed(r)[t.axis]!==null&&i[r].draw(this._ctx)}};$n.id="bar";$n.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};$n.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};var ki=class extends Xe{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,i,s){let r=super.parsePrimitiveData(e,t,i,s);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+i).radius;return r}parseArrayData(e,t,i,s){let r=super.parseArrayData(e,t,i,s);for(let o=0;o<r.length;o++){let a=t[i+o];r[o]._custom=$(a[2],this.resolveDataElementOptions(o+i).radius)}return r}parseObjectData(e,t,i,s){let r=super.parseObjectData(e,t,i,s);for(let o=0;o<r.length;o++){let a=t[i+o];r[o]._custom=$(a&&a.r&&+a.r,this.resolveDataElementOptions(o+i).radius)}return r}getMaxOverflow(){let e=this._cachedMeta.data,t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){let t=this._cachedMeta,{xScale:i,yScale:s}=t,r=this.getParsed(e),o=i.getLabelForValue(r.x),a=s.getLabelForValue(r.y),c=r._custom;return{label:t.label,value:"("+o+", "+a+(c?", "+c:"")+")"}}update(e){let t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){let r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(t,s),h=o.axis,f=a.axis;for(let y=t;y<t+i;y++){let g=e[y],m=!r&&this.getParsed(y),v={},x=v[h]=r?o.getPixelForDecimal(.5):o.getPixelForValue(m[h]),_=v[f]=r?a.getBasePixel():a.getPixelForValue(m[f]);v.skip=isNaN(x)||isNaN(_),d&&(v.options=c||this.resolveDataElementOptions(y,g.active?"active":s),r&&(v.options.radius=0)),this.updateElement(g,y,v,s)}}resolveDataElementOptions(e,t){let i=this.getParsed(e),s=super.resolveDataElementOptions(e,t);s.$shared&&(s=Object.assign({},s,{$shared:!1}));let r=s.radius;return t!=="active"&&(s.radius=0),s.radius+=$(i&&i._custom,r),s}};ki.id="bubble";ki.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};ki.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function LS(n,e,t){let i=1,s=1,r=0,o=0;if(e<ae){let a=n,c=a+e,d=Math.cos(a),h=Math.sin(a),f=Math.cos(c),y=Math.sin(c),g=(k,D,T)=>Wn(k,a,c,!0)?1:Math.max(D,D*t,T,T*t),m=(k,D,T)=>Wn(k,a,c,!0)?-1:Math.min(D,D*t,T,T*t),v=g(0,d,f),x=g(we,h,y),_=m(te,d,f),S=m(te+we,h,y);i=(v-_)/2,s=(x-S)/2,r=-(v+_)/2,o=-(x+S)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}var Gt=class extends Xe{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){let i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=c=>+i[c];if(K(i[e])){let{key:c="value"}=this._parsing;r=d=>+St(i[d],c)}let o,a;for(o=e,a=e+t;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return xe(this.options.rotation-90)}_getCircumference(){return xe(this.options.circumference)}_getRotationExtents(){let e=ae,t=-ae;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){let s=this.chart.getDatasetMeta(i).controller,r=s._getRotation(),o=s._getCircumference();e=Math.min(e,r),t=Math.max(t,r+o)}return{rotation:e,circumference:t-e}}update(e){let t=this.chart,{chartArea:i}=t,s=this._cachedMeta,r=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),c=Math.min(Cl(this.options.cutout,a),1),d=this._getRingWeight(this.index),{circumference:h,rotation:f}=this._getRotationExtents(),{ratioX:y,ratioY:g,offsetX:m,offsetY:v}=LS(f,h,c),x=(i.width-o)/y,_=(i.height-o)/g,S=Math.max(Math.min(x,_)/2,0),k=zr(this.options.radius,S),D=Math.max(k*c,0),T=(k-D)/this._getVisibleDatasetWeightTotal();this.offsetX=m*k,this.offsetY=v*k,s.total=this.calculateTotal(),this.outerRadius=k-T*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-T*d,0),this.updateElements(r,0,r.length,e)}_circumference(e,t){let i=this.options,s=this._cachedMeta,r=this._getCircumference();return t&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||s._parsed[e]===null||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*r/ae)}updateElements(e,t,i,s){let r=s==="reset",o=this.chart,a=o.chartArea,d=o.options.animation,h=(a.left+a.right)/2,f=(a.top+a.bottom)/2,y=r&&d.animateScale,g=y?0:this.innerRadius,m=y?0:this.outerRadius,{sharedOptions:v,includeOptions:x}=this._getSharedOptions(t,s),_=this._getRotation(),S;for(S=0;S<t;++S)_+=this._circumference(S,r);for(S=t;S<t+i;++S){let k=this._circumference(S,r),D=e[S],T={x:h+this.offsetX,y:f+this.offsetY,startAngle:_,endAngle:_+k,circumference:k,outerRadius:m,innerRadius:g};x&&(T.options=v||this.resolveDataElementOptions(S,D.active?"active":s)),_+=k,this.updateElement(D,S,T,s)}}calculateTotal(){let e=this._cachedMeta,t=e.data,i=0,s;for(s=0;s<t.length;s++){let r=e._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!t[s].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(e){let t=this._cachedMeta.total;return t>0&&!isNaN(e)?ae*(Math.abs(e)/t):0}getLabelAndValue(e){let t=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=jn(t._parsed[e],i.options.locale);return{label:s[e]||"",value:r}}getMaxBorderWidth(e){let t=0,i=this.chart,s,r,o,a,c;if(!e){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),e=o.data,a=o.controller;break}}if(!e)return 0;for(s=0,r=e.length;s<r;++s)c=a.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(t=Math.max(t,c.borderWidth||0,c.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let i=0,s=e.length;i<s;++i){let r=this.resolveDataElementOptions(i);t=Math.max(t,r.offset||0,r.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let i=0;i<e;++i)this.chart.isDatasetVisible(i)&&(t+=this._getRingWeight(i));return t}_getRingWeight(e){return Math.max($(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};Gt.id="doughnut";Gt.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};Gt.descriptors={_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"};Gt.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){let e=n.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{let o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){let e=n.label,t=": "+n.formattedValue;return oe(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};var Ci=class extends Xe{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){let t=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=t,o=this.chart._animationsDisabled,{start:a,count:c}=Xr(t,s,o);this._drawStart=a,this._drawCount=c,Zr(t)&&(a=0,c=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;let d=this.resolveDatasetElementOptions(e);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:d},e),this.updateElements(s,a,c,e)}updateElements(e,t,i,s){let r=s==="reset",{iScale:o,vScale:a,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:h,includeOptions:f}=this._getSharedOptions(t,s),y=o.axis,g=a.axis,{spanGaps:m,segment:v}=this.options,x=dn(m)?m:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||r||s==="none",S=t>0&&this.getParsed(t-1);for(let k=t;k<t+i;++k){let D=e[k],T=this.getParsed(k),M=_?D:{},O=J(T[g]),E=M[y]=o.getPixelForValue(T[y],k),A=M[g]=r||O?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,T,c):T[g],k);M.skip=isNaN(E)||isNaN(A)||O,M.stop=k>0&&Math.abs(T[y]-S[y])>x,v&&(M.parsed=T,M.raw=d.data[k]),f&&(M.options=h||this.resolveDataElementOptions(k,D.active?"active":s)),_||this.updateElement(D,k,M,s),S=T}}getMaxOverflow(){let e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;let r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){let e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}};Ci.id="line";Ci.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Ci.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var Ti=class extends Xe{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){let t=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=jn(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:r}}parseObjectData(e,t,i,s){return so.bind(this)(e,t,i,s)}update(e){let t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){let e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{let r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<t.min&&(t.min=r),r>t.max&&(t.max=r))}),t}_updateRadius(){let e=this.chart,t=e.chartArea,i=e.options,s=Math.min(t.right-t.left,t.bottom-t.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/e.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,t,i,s){let r=s==="reset",o=this.chart,c=o.options.animation,d=this._cachedMeta.rScale,h=d.xCenter,f=d.yCenter,y=d.getIndexAngle(0)-.5*te,g=y,m,v=360/this.countVisibleElements();for(m=0;m<t;++m)g+=this._computeAngle(m,s,v);for(m=t;m<t+i;m++){let x=e[m],_=g,S=g+this._computeAngle(m,s,v),k=o.getDataVisibility(m)?d.getDistanceFromCenterForValue(this.getParsed(m).r):0;g=S,r&&(c.animateScale&&(k=0),c.animateRotate&&(_=S=y));let D={x:h,y:f,innerRadius:0,outerRadius:k,startAngle:_,endAngle:S,options:this.resolveDataElementOptions(m,x.active?"active":s)};this.updateElement(x,m,D,s)}}countVisibleElements(){let e=this._cachedMeta,t=0;return e.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?xe(this.resolveDataElementOptions(e,t).angle||i):0}};Ti.id="polarArea";Ti.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Ti.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){let e=n.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{let o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){return n.chart.data.labels[n.dataIndex]+": "+n.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};var Ts=class extends Gt{};Ts.id="pie";Ts.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};var Di=class extends Xe{getLabelAndValue(e){let t=this._cachedMeta.vScale,i=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(i[t.axis])}}parseObjectData(e,t,i,s){return so.bind(this)(e,t,i,s)}update(e){let t=this._cachedMeta,i=t.dataset,s=t.data||[],r=t.iScale.getLabels();if(i.points=s,e!=="resize"){let o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);let a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,e)}this.updateElements(s,0,s.length,e)}updateElements(e,t,i,s){let r=this._cachedMeta.rScale,o=s==="reset";for(let a=t;a<t+i;a++){let c=e[a],d=this.resolveDataElementOptions(a,c.active?"active":s),h=r.getPointPositionForValue(a,this.getParsed(a).r),f=o?r.xCenter:h.x,y=o?r.yCenter:h.y,g={x:f,y,angle:h.angle,skip:isNaN(f)||isNaN(y),options:d};this.updateElement(c,a,g,s)}}};Di.id="radar";Di.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};Di.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};var Ce=class{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(e){let{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return dn(this.x)&&dn(this.y)}getProps(e,t){let i=this.$animations;if(!t||!i)return this;let s={};return e.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}};Ce.defaults={};Ce.defaultRoutes=void 0;var of={values(n){return oe(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";let i=this.chart.options.locale,s,r=n;if(t.length>1){let d=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(d<1e-4||d>1e15)&&(s="scientific"),r=FS(n,t)}let o=Ye(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),jn(n,i,c)},logarithmic(n,e,t){if(n===0)return"0";let i=n/Math.pow(10,Math.floor(Ye(n)));return i===1||i===2||i===5?of.numeric.call(this,n,e,t):""}};function FS(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var Co={formatters:of};q.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,e)=>e.lineWidth,tickColor:(n,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Co.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});q.route("scale.ticks","color","","color");q.route("scale.grid","color","","borderColor");q.route("scale.grid","borderColor","","borderColor");q.route("scale.title","color","","color");q.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});q.describe("scales",{_fallback:"scale"});q.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function BS(n,e){let t=n.options.ticks,i=t.maxTicksLimit||zS(n),s=t.major.enabled?HS(e):[],r=s.length,o=s[0],a=s[r-1],c=[];if(r>i)return YS(e,c,s,r/i),c;let d=WS(s,e,i);if(r>0){let h,f,y=r>1?Math.round((a-o)/(r-1)):null;for(ho(e,c,d,J(y)?0:o-y,o),h=0,f=r-1;h<f;h++)ho(e,c,d,s[h],s[h+1]);return ho(e,c,d,a,J(y)?e.length:a+y),c}return ho(e,c,d),c}function zS(n){let e=n.options.offset,t=n._tickSize(),i=n._length/t+(e?0:1),s=n._maxLength/t;return Math.floor(Math.min(i,s))}function WS(n,e,t){let i=VS(n),s=e.length/t;if(!i)return Math.max(s,1);let r=Dl(i);for(let o=0,a=r.length-1;o<a;o++){let c=r[o];if(c>s)return c}return Math.max(s,1)}function HS(n){let e=[],t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function YS(n,e,t,i){let s=0,r=t[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===r&&(e.push(n[o]),s++,r=t[s*i])}function ho(n,e,t,i,s){let r=$(i,0),o=Math.min($(s,n.length),n.length),a=0,c,d,h;for(t=Math.ceil(t),s&&(c=s-i,t=c/Math.floor(c/t)),h=r;h<0;)a++,h=Math.round(r+a*t);for(d=Math.max(r,0);d<o;d++)d===h&&(e.push(n[d]),a++,h=Math.round(r+a*t))}function VS(n){let e=n.length,t,i;if(e<2)return!1;for(i=n[0],t=1;t<e;++t)if(n[t]-n[t-1]!==i)return!1;return i}var jS=n=>n==="left"?"right":n==="right"?"left":n,Oh=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function Mh(n,e){let t=[],i=n.length/e,s=n.length,r=0;for(;r<s;r+=i)t.push(n[Math.floor(r)]);return t}function US(n,e,t){let i=n.ticks.length,s=Math.min(e,i-1),r=n._startPixel,o=n._endPixel,a=1e-6,c=n.getPixelForTick(s),d;if(!(t&&(i===1?d=Math.max(c-r,o-c):e===0?d=(n.getPixelForTick(1)-c)/2:d=(c-n.getPixelForTick(s-1))/2,c+=s<e?d:-d,c<r-a||c>o+a)))return c}function $S(n,e){ie(n,t=>{let i=t.gc,s=i.length/2,r;if(s>e){for(r=0;r<s;++r)delete t.data[i[r]];i.splice(0,s)}})}function vs(n){return n.drawTicks?n.tickLength:0}function Eh(n,e){if(!n.display)return 0;let t=he(n.font,e),i=me(n.padding);return(oe(n.text)?n.text.length:1)*t.lineHeight+i.height}function GS(n,e){return Ct(n,{scale:e,type:"scale"})}function KS(n,e,t){return Ct(n,{tick:t,index:e,type:"tick"})}function qS(n,e,t){let i=ps(n);return(t&&e!=="right"||!t&&e==="right")&&(i=jS(i)),i}function XS(n,e,t,i){let{top:s,left:r,bottom:o,right:a,chart:c}=n,{chartArea:d,scales:h}=c,f=0,y,g,m,v=o-s,x=a-r;if(n.isHorizontal()){if(g=Ae(i,r,a),K(t)){let _=Object.keys(t)[0],S=t[_];m=h[_].getPixelForValue(S)+v-e}else t==="center"?m=(d.bottom+d.top)/2+v-e:m=Oh(n,t,e);y=a-r}else{if(K(t)){let _=Object.keys(t)[0],S=t[_];g=h[_].getPixelForValue(S)-x+e}else t==="center"?g=(d.left+d.right)/2-x+e:g=Oh(n,t,e);m=Ae(i,o,s),f=t==="left"?-we:we}return{titleX:g,titleY:m,maxWidth:y,rotation:f}}var Kt=class extends Ce{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:i,_suggestedMax:s}=this;return e=He(e,Number.POSITIVE_INFINITY),t=He(t,Number.NEGATIVE_INFINITY),i=He(i,Number.POSITIVE_INFINITY),s=He(s,Number.NEGATIVE_INFINITY),{min:He(e,i),max:He(t,s),minDefined:_e(e),maxDefined:_e(t)}}getMinMax(e){let{min:t,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),o;if(s&&r)return{min:t,max:i};let a=this.getMatchingVisibleMetas();for(let c=0,d=a.length;c<d;++c)o=a[c].controller.getMinMax(this,e),s||(t=Math.min(t,o.min)),r||(i=Math.max(i,o.max));return t=r&&t>i?i:t,i=s&&t>i?t:i,{min:He(t,He(i,t)),max:He(i,He(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ne(this.options.beforeUpdate,[this])}update(e,t,i){let{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Yl(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let c=a<this.ticks.length;this._convertTicksToLabels(c?Mh(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=BS(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,i;this.isHorizontal()?(t=this.left,i=this.right):(t=this.top,i=this.bottom,e=!e),this._startPixel=t,this._endPixel=i,this._reversePixels=e,this._length=i-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ne(this.options.afterUpdate,[this])}beforeSetDimensions(){ne(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){ne(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),ne(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ne(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){let t=this.options.ticks,i,s,r;for(i=0,s=e.length;i<s;i++)r=e[i],r.label=ne(t.callback,[r.value,i,e],this)}afterTickToLabelConversion(){ne(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ne(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let e=this.options,t=e.ticks,i=this.ticks.length,s=t.minRotation||0,r=t.maxRotation,o=s,a,c,d;if(!this._isVisible()||!t.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}let h=this._getLabelSizes(),f=h.widest.width,y=h.highest.height,g=Pe(this.chart.width-f,0,this.maxWidth);a=e.offset?this.maxWidth/i:g/(i-1),f+6>a&&(a=g/(i-(e.offset?.5:1)),c=this.maxHeight-vs(e.grid)-t.padding-Eh(e.title,this.chart.options.font),d=Math.sqrt(f*f+y*y),o=zn(Math.min(Math.asin(Pe((h.highest.height+6)/a,-1,1)),Math.asin(Pe(c/d,-1,1))-Math.asin(Pe(y/d,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){ne(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ne(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){let c=Eh(s,t.options.font);if(a?(e.width=this.maxWidth,e.height=vs(r)+c):(e.height=this.maxHeight,e.width=vs(r)+c),i.display&&this.ticks.length){let{first:d,last:h,widest:f,highest:y}=this._getLabelSizes(),g=i.padding*2,m=xe(this.labelRotation),v=Math.cos(m),x=Math.sin(m);if(a){let _=i.mirror?0:x*f.width+v*y.height;e.height=Math.min(this.maxHeight,e.height+_+g)}else{let _=i.mirror?0:v*f.width+x*y.height;e.width=Math.min(this.maxWidth,e.width+_+g)}this._calculatePadding(d,h,x,v)}}this._handleMargins(),a?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){let{ticks:{align:r,padding:o},position:a}=this.options,c=this.labelRotation!==0,d=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let h=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1),y=0,g=0;c?d?(y=s*e.width,g=i*t.height):(y=i*e.height,g=s*t.width):r==="start"?g=t.width:r==="end"?y=e.width:r!=="inner"&&(y=e.width/2,g=t.width/2),this.paddingLeft=Math.max((y-h+o)*this.width/(this.width-h),0),this.paddingRight=Math.max((g-f+o)*this.width/(this.width-f),0)}else{let h=t.height/2,f=e.height/2;r==="start"?(h=0,f=e.height):r==="end"&&(h=t.height,f=0),this.paddingTop=h+o,this.paddingBottom=f+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ne(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t<i;t++)J(e[t].label)&&(e.splice(t,1),i--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){let t=this.options.ticks.sampleSize,i=this.ticks;t<i.length&&(i=Mh(i,t)),this._labelSizes=e=this._computeLabelSizes(i,i.length)}return e}_computeLabelSizes(e,t){let{ctx:i,_longestTextCache:s}=this,r=[],o=[],a=0,c=0,d,h,f,y,g,m,v,x,_,S,k;for(d=0;d<t;++d){if(y=e[d].label,g=this._resolveTickFontOptions(d),i.font=m=g.string,v=s[m]=s[m]||{data:{},gc:[]},x=g.lineHeight,_=S=0,!J(y)&&!oe(y))_=bi(i,v.data,v.gc,_,y),S=x;else if(oe(y))for(h=0,f=y.length;h<f;++h)k=y[h],!J(k)&&!oe(k)&&(_=bi(i,v.data,v.gc,_,k),S+=x);r.push(_),o.push(S),a=Math.max(_,a),c=Math.max(S,c)}$S(s,t);let D=r.indexOf(a),T=o.indexOf(c),M=O=>({width:r[O]||0,height:o[O]||0});return{first:M(0),last:M(t-1),widest:M(D),highest:M(T),widths:r,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return Ml(this._alignToPixels?Ht(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&e<t.length){let i=t[e];return i.$context||(i.$context=KS(this.getContext(),e,i))}return this.$context||(this.$context=GS(this.chart.getContext(),this))}_tickSize(){let e=this.options.ticks,t=xe(this.labelRotation),i=Math.abs(Math.cos(t)),s=Math.abs(Math.sin(t)),r=this._getLabelSizes(),o=e.autoSkipPadding||0,a=r?r.widest.width+o:0,c=r?r.highest.height+o:0;return this.isHorizontal()?c*i>a*s?a/i:c/s:c*s<a*i?c/i:a/s}_isVisible(){let e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){let t=this.axis,i=this.chart,s=this.options,{grid:r,position:o}=s,a=r.offset,c=this.isHorizontal(),h=this.ticks.length+(a?1:0),f=vs(r),y=[],g=r.setContext(this.getContext()),m=g.drawBorder?g.borderWidth:0,v=m/2,x=function(F){return Ht(i,F,m)},_,S,k,D,T,M,O,E,A,N,I,B;if(o==="top")_=x(this.bottom),M=this.bottom-f,E=_-v,N=x(e.top)+v,B=e.bottom;else if(o==="bottom")_=x(this.top),N=e.top,B=x(e.bottom)-v,M=_+v,E=this.top+f;else if(o==="left")_=x(this.right),T=this.right-f,O=_-v,A=x(e.left)+v,I=e.right;else if(o==="right")_=x(this.left),A=e.left,I=x(e.right)-v,T=_+v,O=this.left+f;else if(t==="x"){if(o==="center")_=x((e.top+e.bottom)/2+.5);else if(K(o)){let F=Object.keys(o)[0],Y=o[F];_=x(this.chart.scales[F].getPixelForValue(Y))}N=e.top,B=e.bottom,M=_+v,E=M+f}else if(t==="y"){if(o==="center")_=x((e.left+e.right)/2);else if(K(o)){let F=Object.keys(o)[0],Y=o[F];_=x(this.chart.scales[F].getPixelForValue(Y))}T=_-v,O=T-f,A=e.left,I=e.right}let z=$(s.ticks.maxTicksLimit,h),L=Math.max(1,Math.ceil(h/z));for(S=0;S<h;S+=L){let F=r.setContext(this.getContext(S)),Y=F.lineWidth,V=F.color,G=F.borderDash||[],le=F.borderDashOffset,re=F.tickWidth,Re=F.tickColor,De=F.tickBorderDash||[],H=F.tickBorderDashOffset;k=US(this,S,a),k!==void 0&&(D=Ht(i,k,Y),c?T=O=A=I=D:M=E=N=B=D,y.push({tx1:T,ty1:M,tx2:O,ty2:E,x1:A,y1:N,x2:I,y2:B,width:Y,color:V,borderDash:G,borderDashOffset:le,tickWidth:re,tickColor:Re,tickBorderDash:De,tickBorderDashOffset:H}))}return this._ticksLength=h,this._borderValue=_,y}_computeLabelItems(e){let t=this.axis,i=this.options,{position:s,ticks:r}=i,o=this.isHorizontal(),a=this.ticks,{align:c,crossAlign:d,padding:h,mirror:f}=r,y=vs(i.grid),g=y+h,m=f?-h:g,v=-xe(this.labelRotation),x=[],_,S,k,D,T,M,O,E,A,N,I,B,z="middle";if(s==="top")M=this.bottom-m,O=this._getXAxisLabelAlignment();else if(s==="bottom")M=this.top+m,O=this._getXAxisLabelAlignment();else if(s==="left"){let F=this._getYAxisLabelAlignment(y);O=F.textAlign,T=F.x}else if(s==="right"){let F=this._getYAxisLabelAlignment(y);O=F.textAlign,T=F.x}else if(t==="x"){if(s==="center")M=(e.top+e.bottom)/2+g;else if(K(s)){let F=Object.keys(s)[0],Y=s[F];M=this.chart.scales[F].getPixelForValue(Y)+g}O=this._getXAxisLabelAlignment()}else if(t==="y"){if(s==="center")T=(e.left+e.right)/2-g;else if(K(s)){let F=Object.keys(s)[0],Y=s[F];T=this.chart.scales[F].getPixelForValue(Y)}O=this._getYAxisLabelAlignment(y).textAlign}t==="y"&&(c==="start"?z="top":c==="end"&&(z="bottom"));let L=this._getLabelSizes();for(_=0,S=a.length;_<S;++_){k=a[_],D=k.label;let F=r.setContext(this.getContext(_));E=this.getPixelForTick(_)+r.labelOffset,A=this._resolveTickFontOptions(_),N=A.lineHeight,I=oe(D)?D.length:1;let Y=I/2,V=F.color,G=F.textStrokeColor,le=F.textStrokeWidth,re=O;o?(T=E,O==="inner"&&(_===S-1?re=this.options.reverse?"left":"right":_===0?re=this.options.reverse?"right":"left":re="center"),s==="top"?d==="near"||v!==0?B=-I*N+N/2:d==="center"?B=-L.highest.height/2-Y*N+N:B=-L.highest.height+N/2:d==="near"||v!==0?B=N/2:d==="center"?B=L.highest.height/2-Y*N:B=L.highest.height-I*N,f&&(B*=-1)):(M=E,B=(1-I)*N/2);let Re;if(F.showLabelBackdrop){let De=me(F.backdropPadding),H=L.heights[_],tn=L.widths[_],Ue=M+B-De.top,tt=T-De.left;switch(z){case"middle":Ue-=H/2;break;case"bottom":Ue-=H;break}switch(O){case"center":tt-=tn/2;break;case"right":tt-=tn;break}Re={left:tt,top:Ue,width:tn+De.width,height:H+De.height,color:F.backdropColor}}x.push({rotation:v,label:D,font:A,color:V,strokeColor:G,strokeWidth:le,textOffset:B,textAlign:re,textBaseline:z,translation:[T,M],backdrop:Re})}return x}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-xe(this.labelRotation))return e==="top"?"left":"right";let s="center";return t.align==="start"?s="left":t.align==="end"?s="right":t.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=e+r,c=o.widest.width,d,h;return t==="left"?s?(h=this.right+r,i==="near"?d="left":i==="center"?(d="center",h+=c/2):(d="right",h+=c)):(h=this.right-a,i==="near"?d="right":i==="center"?(d="center",h-=c/2):(d="left",h=this.left)):t==="right"?s?(h=this.left+r,i==="near"?d="right":i==="center"?(d="center",h-=c/2):(d="left",h-=c)):(h=this.left+a,i==="near"?d="left":i==="center"?(d="center",h+=c/2):(d="right",h=this.right)):d="right",{textAlign:d,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:i,top:s,width:r,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,s,r,o),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let s=this.ticks.findIndex(r=>r.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){let t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e)),r,o,a=(c,d,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(c.x,c.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(t.display)for(r=0,o=s.length;r<o;++r){let c=s[r];t.drawOnChartArea&&a({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),t.drawTicks&&a({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){let{chart:e,ctx:t,options:{grid:i}}=this,s=i.setContext(this.getContext()),r=i.drawBorder?s.borderWidth:0;if(!r)return;let o=i.setContext(this.getContext(0)).lineWidth,a=this._borderValue,c,d,h,f;this.isHorizontal()?(c=Ht(e,this.left,r)-r/2,d=Ht(e,this.right,o)+o/2,h=f=a):(h=Ht(e,this.top,r)-r/2,f=Ht(e,this.bottom,o)+o/2,c=d=a),t.save(),t.lineWidth=s.borderWidth,t.strokeStyle=s.borderColor,t.beginPath(),t.moveTo(c,h),t.lineTo(d,f),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;let i=this.ctx,s=this._computeLabelArea();s&&Yn(i,s);let r=this._labelItems||(this._labelItems=this._computeLabelItems(e)),o,a;for(o=0,a=r.length;o<a;++o){let c=r[o],d=c.font,h=c.label;c.backdrop&&(i.fillStyle=c.backdrop.color,i.fillRect(c.backdrop.left,c.backdrop.top,c.backdrop.width,c.backdrop.height));let f=c.textOffset;Yt(i,h,0,f,d,c)}s&&Vn(i)}drawTitle(){let{ctx:e,options:{position:t,title:i,reverse:s}}=this;if(!i.display)return;let r=he(i.font),o=me(i.padding),a=i.align,c=r.lineHeight/2;t==="bottom"||t==="center"||K(t)?(c+=o.bottom,oe(i.text)&&(c+=r.lineHeight*(i.text.length-1))):c+=o.top;let{titleX:d,titleY:h,maxWidth:f,rotation:y}=XS(this,c,t,a);Yt(e,i.text,0,0,r,{color:i.color,maxWidth:f,rotation:y,textAlign:qS(a,t,s),textBaseline:"middle",translation:[d,h]})}draw(e){!this._isVisible()||(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){let e=this.options,t=e.ticks&&e.ticks.z||0,i=$(e.grid&&e.grid.z,-1);return!this._isVisible()||this.draw!==Kt.prototype.draw?[{z:t,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[],r,o;for(r=0,o=t.length;r<o;++r){let a=t[r];a[i]===this.id&&(!e||a.type===e)&&s.push(a)}return s}_resolveTickFontOptions(e){let t=this.options.ticks.setContext(this.getContext(e));return he(t.font)}_maxDigits(){let e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}},_i=class{constructor(e,t,i){this.type=e,this.scope=t,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){let t=Object.getPrototypeOf(e),i;QS(t)&&(i=this.register(t));let s=this.items,r=e.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+e);return r in s||(s[r]=e,ZS(e,o,i),this.override&&q.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){let t=this.items,i=e.id,s=this.scope;i in t&&delete t[i],s&&i in q[s]&&(delete q[s][i],this.override&&delete un[i])}};function ZS(n,e,t){let i=qe(Object.create(null),[t?q.get(t):{},q.get(e),n.defaults]);q.set(e,i),n.defaultRoutes&&JS(e,n.defaultRoutes),n.descriptors&&q.describe(e,n.descriptors)}function JS(n,e){Object.keys(e).forEach(t=>{let i=t.split("."),s=i.pop(),r=[n].concat(i).join("."),o=e[t].split("."),a=o.pop(),c=o.join(".");q.route(r,s,c,a)})}function QS(n){return"id"in n&&"defaults"in n}var cc=class{constructor(){this.controllers=new _i(Xe,"datasets",!0),this.elements=new _i(Ce,"elements"),this.plugins=new _i(Object,"plugins"),this.scales=new _i(Kt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(s=>{let r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(e,r,s):ie(s,o=>{let a=i||this._getRegistryForType(o);this._exec(e,a,o)})})}_exec(e,t,i){let s=hs(e);ne(i["before"+s],[],i),t[e](i),ne(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){let i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(e,t,i){let s=t.get(e);if(s===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return s}},Dt=new cc,Oi=class extends Xe{update(e){let t=this._cachedMeta,{data:i=[]}=t,s=this.chart._animationsDisabled,{start:r,count:o}=Xr(t,i,s);if(this._drawStart=r,this._drawCount=o,Zr(t)&&(r=0,o=i.length),this.options.showLine){let{dataset:a,_dataset:c}=t;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!c._decimated,a.points=i;let d=this.resolveDatasetElementOptions(e);d.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:d},e)}this.updateElements(i,r,o,e)}addElements(){let{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=Dt.getElement("line")),super.addElements()}updateElements(e,t,i,s){let r=s==="reset",{iScale:o,vScale:a,_stacked:c,_dataset:d}=this._cachedMeta,h=this.resolveDataElementOptions(t,s),f=this.getSharedOptions(h),y=this.includeOptions(s,f),g=o.axis,m=a.axis,{spanGaps:v,segment:x}=this.options,_=dn(v)?v:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||r||s==="none",k=t>0&&this.getParsed(t-1);for(let D=t;D<t+i;++D){let T=e[D],M=this.getParsed(D),O=S?T:{},E=J(M[m]),A=O[g]=o.getPixelForValue(M[g],D),N=O[m]=r||E?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,M,c):M[m],D);O.skip=isNaN(A)||isNaN(N)||E,O.stop=D>0&&Math.abs(M[g]-k[g])>_,x&&(O.parsed=M,O.raw=d.data[D]),y&&(O.options=f||this.resolveDataElementOptions(D,T.active?"active":s)),S||this.updateElement(T,D,O,s),k=M}this.updateSharedOptions(f,s,h)}getMaxOverflow(){let e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let a=0;for(let c=t.length-1;c>=0;--c)a=Math.max(a,t[c].size(this.resolveDataElementOptions(c))/2);return a>0&&a}let i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;let r=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,r,o)/2}};Oi.id="scatter";Oi.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Oi.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Un(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var Ds=class{constructor(e){this.options=e||{}}init(e){}formats(){return Un()}parse(e,t){return Un()}format(e,t){return Un()}add(e,t,i){return Un()}diff(e,t,i){return Un()}startOf(e,t,i){return Un()}endOf(e,t){return Un()}};Ds.override=function(n){Object.assign(Ds.prototype,n)};var ek={_date:Ds};function tk(n,e,t,i){let{controller:s,data:r,_sorted:o}=n,a=s._cachedMeta.iScale;if(a&&e===a.axis&&e!=="r"&&o&&r.length){let c=a._reversePixels?El:Wt;if(i){if(s._sharedOptions){let d=r[0],h=typeof d.getRange=="function"&&d.getRange(e);if(h){let f=c(r,e,t-h),y=c(r,e,t+h);return{lo:f.lo,hi:y.hi}}}}else return c(r,e,t)}return{lo:0,hi:r.length-1}}function Es(n,e,t,i,s){let r=n.getSortedVisibleDatasetMetas(),o=t[e];for(let a=0,c=r.length;a<c;++a){let{index:d,data:h}=r[a],{lo:f,hi:y}=tk(r[a],e,o,s);for(let g=f;g<=y;++g){let m=h[g];m.skip||i(m,d,g)}}}function nk(n){let e=n.indexOf("x")!==-1,t=n.indexOf("y")!==-1;return function(i,s){let r=e?Math.abs(i.x-s.x):0,o=t?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function nc(n,e,t,i,s){let r=[];return!s&&!n.isPointInArea(e)||Es(n,t,e,function(a,c,d){!s&&!Ln(a,n.chartArea,0)||a.inRange(e.x,e.y,i)&&r.push({element:a,datasetIndex:c,index:d})},!0),r}function ik(n,e,t,i){let s=[];function r(o,a,c){let{startAngle:d,endAngle:h}=o.getProps(["startAngle","endAngle"],i),{angle:f}=Ur(o,{x:e.x,y:e.y});Wn(f,d,h)&&s.push({element:o,datasetIndex:a,index:c})}return Es(n,t,e,r),s}function sk(n,e,t,i,s,r){let o=[],a=nk(t),c=Number.POSITIVE_INFINITY;function d(h,f,y){let g=h.inRange(e.x,e.y,s);if(i&&!g)return;let m=h.getCenterPoint(s);if(!(!!r||n.isPointInArea(m))&&!g)return;let x=a(e,m);x<c?(o=[{element:h,datasetIndex:f,index:y}],c=x):x===c&&o.push({element:h,datasetIndex:f,index:y})}return Es(n,t,e,d),o}function ic(n,e,t,i,s,r){return!r&&!n.isPointInArea(e)?[]:t==="r"&&!i?ik(n,e,t,s):sk(n,e,t,i,s,r)}function Ph(n,e,t,i,s){let r=[],o=t==="x"?"inXRange":"inYRange",a=!1;return Es(n,t,e,(c,d,h)=>{c[o](e[t],s)&&(r.push({element:c,datasetIndex:d,index:h}),a=a||c.inRange(e.x,e.y,s))}),i&&!a?[]:r}var rk={evaluateInteractionItems:Es,modes:{index(n,e,t,i){let s=jt(e,n),r=t.axis||"x",o=t.includeInvisible||!1,a=t.intersect?nc(n,s,r,i,o):ic(n,s,r,!1,i,o),c=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{let h=a[0].index,f=d.data[h];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:h})}),c):[]},dataset(n,e,t,i){let s=jt(e,n),r=t.axis||"xy",o=t.includeInvisible||!1,a=t.intersect?nc(n,s,r,i,o):ic(n,s,r,!1,i,o);if(a.length>0){let c=a[0].datasetIndex,d=n.getDatasetMeta(c).data;a=[];for(let h=0;h<d.length;++h)a.push({element:d[h],datasetIndex:c,index:h})}return a},point(n,e,t,i){let s=jt(e,n),r=t.axis||"xy",o=t.includeInvisible||!1;return nc(n,s,r,i,o)},nearest(n,e,t,i){let s=jt(e,n),r=t.axis||"xy",o=t.includeInvisible||!1;return ic(n,s,r,t.intersect,i,o)},x(n,e,t,i){let s=jt(e,n);return Ph(n,s,"x",t.intersect,i)},y(n,e,t,i){let s=jt(e,n);return Ph(n,s,"y",t.intersect,i)}}},af=["left","top","right","bottom"];function xs(n,e){return n.filter(t=>t.pos===e)}function Ah(n,e){return n.filter(t=>af.indexOf(t.pos)===-1&&t.box.axis===e)}function _s(n,e){return n.sort((t,i)=>{let s=e?i:t,r=e?t:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function ok(n){let e=[],t,i,s,r,o,a;for(t=0,i=(n||[]).length;t<i;++t)s=n[t],{position:r,options:{stack:o,stackWeight:a=1}}=s,e.push({index:t,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&r+o,stackWeight:a});return e}function ak(n){let e={};for(let t of n){let{stack:i,pos:s,stackWeight:r}=t;if(!i||!af.includes(s))continue;let o=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return e}function lk(n,e){let t=ak(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=e,r,o,a;for(r=0,o=n.length;r<o;++r){a=n[r];let{fullSize:c}=a.box,d=t[a.stack],h=d&&a.stackWeight/d.weight;a.horizontal?(a.width=h?h*i:c&&e.availableWidth,a.height=s):(a.width=i,a.height=h?h*s:c&&e.availableHeight)}return t}function ck(n){let e=ok(n),t=_s(e.filter(d=>d.box.fullSize),!0),i=_s(xs(e,"left"),!0),s=_s(xs(e,"right")),r=_s(xs(e,"top"),!0),o=_s(xs(e,"bottom")),a=Ah(e,"x"),c=Ah(e,"y");return{fullSize:t,leftAndTop:i.concat(r),rightAndBottom:s.concat(c).concat(o).concat(a),chartArea:xs(e,"chartArea"),vertical:i.concat(s).concat(c),horizontal:r.concat(o).concat(a)}}function Nh(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function lf(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function dk(n,e,t,i){let{pos:s,box:r}=t,o=n.maxPadding;if(!K(s)){t.size&&(n[s]-=t.size);let f=i[t.stack]||{size:0,count:1};f.size=Math.max(f.size,t.horizontal?r.height:r.width),t.size=f.size/f.count,n[s]+=t.size}r.getPadding&&lf(o,r.getPadding());let a=Math.max(0,e.outerWidth-Nh(o,n,"left","right")),c=Math.max(0,e.outerHeight-Nh(o,n,"top","bottom")),d=a!==n.w,h=c!==n.h;return n.w=a,n.h=c,t.horizontal?{same:d,other:h}:{same:h,other:d}}function uk(n){let e=n.maxPadding;function t(i){let s=Math.max(e[i]-n[i],0);return n[i]+=s,s}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function hk(n,e){let t=e.maxPadding;function i(s){let r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(e[o],t[o])}),r}return i(n?["left","right"]:["top","bottom"])}function ks(n,e,t,i){let s=[],r,o,a,c,d,h;for(r=0,o=n.length,d=0;r<o;++r){a=n[r],c=a.box,c.update(a.width||e.w,a.height||e.h,hk(a.horizontal,e));let{same:f,other:y}=dk(e,t,a,i);d|=f&&s.length,h=h||y,c.fullSize||s.push(a)}return d&&ks(s,e,t,i)||h}function fo(n,e,t,i,s){n.top=t,n.left=e,n.right=e+i,n.bottom=t+s,n.width=i,n.height=s}function Rh(n,e,t,i){let s=t.padding,{x:r,y:o}=e;for(let a of n){let c=a.box,d=i[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/d.weight||1;if(a.horizontal){let f=e.w*h,y=d.size||c.height;ve(d.start)&&(o=d.start),c.fullSize?fo(c,s.left,o,t.outerWidth-s.right-s.left,y):fo(c,e.left+d.placed,o,f,y),d.start=o,d.placed+=f,o=c.bottom}else{let f=e.h*h,y=d.size||c.width;ve(d.start)&&(r=d.start),c.fullSize?fo(c,r,s.top,y,t.outerHeight-s.bottom-s.top):fo(c,r,e.top+d.placed,y,f),d.start=r,d.placed+=f,r=c.right}}e.x=r,e.y=o}q.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var ot={addBox(n,e){n.boxes||(n.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},n.boxes.push(e)},removeBox(n,e){let t=n.boxes?n.boxes.indexOf(e):-1;t!==-1&&n.boxes.splice(t,1)},configure(n,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(n,e,t,i){if(!n)return;let s=me(n.options.layout.padding),r=Math.max(e-s.width,0),o=Math.max(t-s.height,0),a=ck(n.boxes),c=a.vertical,d=a.horizontal;ie(n.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});let h=c.reduce((v,x)=>x.box.options&&x.box.options.display===!1?v:v+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/h,hBoxMaxHeight:o/2}),y=Object.assign({},s);lf(y,me(i));let g=Object.assign({maxPadding:y,w:r,h:o,x:s.left,y:s.top},s),m=lk(c.concat(d),f);ks(a.fullSize,g,f,m),ks(c,g,f,m),ks(d,g,f,m)&&ks(c,g,f,m),uk(g),Rh(a.leftAndTop,g,f,m),g.x+=g.w,g.y+=g.h,Rh(a.rightAndBottom,g,f,m),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},ie(a.chartArea,v=>{let x=v.box;Object.assign(x,n.chartArea),x.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}},bo=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}},dc=class extends bo{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}},yo="$chartjs",fk={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ih=n=>n===null||n==="";function pk(n,e){let t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[yo]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Ih(s)){let r=lo(n,"width");r!==void 0&&(n.width=r)}if(Ih(i))if(n.style.height==="")n.height=n.width/(e||2);else{let r=lo(n,"height");r!==void 0&&(n.height=r)}return n}var cf=Gl?{passive:!0}:!1;function gk(n,e,t){n.addEventListener(e,t,cf)}function mk(n,e,t){n.canvas.removeEventListener(e,t,cf)}function yk(n,e){let t=fk[n.type]||n.type,{x:i,y:s}=jt(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function wo(n,e){for(let t of n)if(t===e||t.contains(e))return!0}function bk(n,e,t){let i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(let a of r)o=o||wo(a.addedNodes,i),o=o&&!wo(a.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function wk(n,e,t){let i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(let a of r)o=o||wo(a.removedNodes,i),o=o&&!wo(a.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}var Os=new Map,Lh=0;function df(){let n=window.devicePixelRatio;n!==Lh&&(Lh=n,Os.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function vk(n,e){Os.size||window.addEventListener("resize",df),Os.set(n,e)}function xk(n){Os.delete(n),Os.size||window.removeEventListener("resize",df)}function _k(n,e,t){let i=n.canvas,s=i&&bs(i);if(!s)return;let r=qr((a,c)=>{let d=s.clientWidth;t(a,c),d<s.clientWidth&&t()},window),o=new ResizeObserver(a=>{let c=a[0],d=c.contentRect.width,h=c.contentRect.height;d===0&&h===0||r(d,h)});return o.observe(s),vk(n,r),o}function sc(n,e,t){t&&t.disconnect(),e==="resize"&&xk(n)}function Sk(n,e,t){let i=n.canvas,s=qr(r=>{n.ctx!==null&&t(yk(r,n))},n,r=>{let o=r[0];return[o,o.offsetX,o.offsetY]});return gk(i,e,s),s}var uc=class extends bo{acquireContext(e,t){let i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(pk(e,t),i):null}releaseContext(e){let t=e.canvas;if(!t[yo])return!1;let i=t[yo].initial;["height","width"].forEach(r=>{let o=i[r];J(o)?t.removeAttribute(r):t.setAttribute(r,o)});let s=i.style||{};return Object.keys(s).forEach(r=>{t.style[r]=s[r]}),t.width=t.width,delete t[yo],!0}addEventListener(e,t,i){this.removeEventListener(e,t);let s=e.$proxies||(e.$proxies={}),o={attach:bk,detach:wk,resize:_k}[t]||Sk;s[t]=o(e,t,i)}removeEventListener(e,t){let i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:sc,detach:sc,resize:sc}[t]||mk)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return $l(e,t,i,s)}isAttached(e){let t=bs(e);return!!(t&&t.isConnected)}};function kk(n){return!ro()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?dc:uc}var hc=class{constructor(){this._init=[]}notify(e,t,i,s){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));let r=s?this._descriptors(e).filter(s):this._descriptors(e),o=this._notify(r,e,t,i);return t==="afterDestroy"&&(this._notify(r,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,i,s){s=s||{};for(let r of e){let o=r.plugin,a=o[i],c=[t,s,r.options];if(ne(a,c,o)===!1&&s.cancelable)return!1}return!0}invalidate(){J(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;let t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){let i=e&&e.config,s=$(i.options&&i.options.plugins,{}),r=Ck(i);return s===!1&&!t?[]:Dk(e,r,s,t)}_notifyStateChanges(e){let t=this._oldCache||[],i=this._cache,s=(r,o)=>r.filter(a=>!o.some(c=>a.plugin.id===c.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}};function Ck(n){let e={},t=[],i=Object.keys(Dt.plugins.items);for(let r=0;r<i.length;r++)t.push(Dt.getPlugin(i[r]));let s=n.plugins||[];for(let r=0;r<s.length;r++){let o=s[r];t.indexOf(o)===-1&&(t.push(o),e[o.id]=!0)}return{plugins:t,localIds:e}}function Tk(n,e){return!e&&n===!1?null:n===!0?{}:n}function Dk(n,{plugins:e,localIds:t},i,s){let r=[],o=n.getContext();for(let a of e){let c=a.id,d=Tk(i[c],s);d!==null&&r.push({plugin:a,options:Ok(n.config,{plugin:a,local:t[c]},d,o)})}return r}function Ok(n,{plugin:e,local:t},i,s){let r=n.pluginScopeKeys(e),o=n.getOptionScopes(i,r);return t&&e.defaults&&o.push(e.defaults),n.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function fc(n,e){let t=q.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function Mk(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function Ek(n,e){return n===e?"_index_":"_value_"}function Pk(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function pc(n,e){return n==="x"||n==="y"?n:e.axis||Pk(e.position)||n.charAt(0).toLowerCase()}function Ak(n,e){let t=un[n.type]||{scales:{}},i=e.scales||{},s=fc(n.type,e),r=Object.create(null),o=Object.create(null);return Object.keys(i).forEach(a=>{let c=i[a];if(!K(c))return console.error(`Invalid scale configuration for scale: ${a}`);if(c._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);let d=pc(a,c),h=Ek(d,s),f=t.scales||{};r[d]=r[d]||a,o[a]=Fn(Object.create(null),[{axis:d},c,f[d],f[h]])}),n.data.datasets.forEach(a=>{let c=a.type||n.type,d=a.indexAxis||fc(c,e),f=(un[c]||{}).scales||{};Object.keys(f).forEach(y=>{let g=Mk(y,d),m=a[g+"AxisID"]||r[g]||g;o[m]=o[m]||Object.create(null),Fn(o[m],[{axis:g},i[m],f[y]])})}),Object.keys(o).forEach(a=>{let c=o[a];Fn(c,[q.scales[c.type],q.scale])}),o}function uf(n){let e=n.options||(n.options={});e.plugins=$(e.plugins,{}),e.scales=Ak(n,e)}function hf(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Nk(n){return n=n||{},n.data=hf(n.data),uf(n),n}var Fh=new Map,ff=new Set;function po(n,e){let t=Fh.get(n);return t||(t=e(),Fh.set(n,t),ff.add(t)),t}var Ss=(n,e,t)=>{let i=St(e,t);i!==void 0&&n.add(i)},gc=class{constructor(e){this._config=Nk(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=hf(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),uf(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return po(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return po(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return po(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){let t=e.id,i=this.type;return po(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let i=this._scopeCache,s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){let{options:s,type:r}=this,o=this._cachedScopes(e,i),a=o.get(t);if(a)return a;let c=new Set;t.forEach(h=>{e&&(c.add(e),h.forEach(f=>Ss(c,e,f))),h.forEach(f=>Ss(c,s,f)),h.forEach(f=>Ss(c,un[r]||{},f)),h.forEach(f=>Ss(c,q,f)),h.forEach(f=>Ss(c,Qr,f))});let d=Array.from(c);return d.length===0&&d.push(Object.create(null)),ff.has(t)&&o.set(t,d),d}chartOptionScopes(){let{options:e,type:t}=this;return[e,un[t]||{},q.datasets[t]||{},{type:t},q,Qr]}resolveNamedOptions(e,t,i,s=[""]){let r={$shared:!0},{resolver:o,subPrefixes:a}=Bh(this._resolverCache,e,s),c=o;if(Ik(o,t)){r.$shared=!1,i=_t(i)?i():i;let d=this.createResolver(e,i,a);c=cn(o,i,d)}for(let d of t)r[d]=c[d];return r}createResolver(e,t,i=[""],s){let{resolver:r}=Bh(this._resolverCache,e,i);return K(t)?cn(r,t,void 0,s):r}};function Bh(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));let s=t.join(),r=i.get(s);return r||(r={resolver:ys(e,t),subPrefixes:t.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}var Rk=n=>K(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||_t(n[t]),!1);function Ik(n,e){let{isScriptable:t,isIndexable:i}=io(n);for(let s of e){let r=t(s),o=i(s),a=(o||r)&&n[s];if(r&&(_t(a)||Rk(a))||o&&oe(a))return!0}return!1}var Lk="3.9.1",Fk=["top","bottom","left","right","chartArea"];function zh(n,e){return n==="top"||n==="bottom"||Fk.indexOf(n)===-1&&e==="x"}function Wh(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Hh(n){let e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),ne(t&&t.onComplete,[n],e)}function Bk(n){let e=n.chart,t=e.options.animation;ne(t&&t.onProgress,[n],e)}function pf(n){return ro()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}var vo={},gf=n=>{let e=pf(n);return Object.values(vo).filter(t=>t.canvas===e).pop()};function zk(n,e,t){let i=Object.keys(n);for(let s of i){let r=+s;if(r>=e){let o=n[s];delete n[s],(t>0||r>e)&&(n[r+t]=o)}}}function Wk(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}var Ne=class{constructor(e,t){let i=this.config=new gc(t),s=pf(e),r=gf(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");let o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||kk(s)),this.platform.updateConfig(i);let a=this.platform.acquireContext(s,o.aspectRatio),c=a&&a.canvas,d=c&&c.height,h=c&&c.width;if(this.id=kl(),this.ctx=a,this.canvas=c,this.width=h,this.height=d,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new hc,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Nl(f=>this.update(f),o.resizeDelay||0),this._dataChanges=[],vo[this.id]=this,!a||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Ut.listen(this,"complete",Hh),Ut.listen(this,"progress",Bk),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:r}=this;return J(e)?t&&r?r:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ao(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return eo(this.canvas,this.ctx),this}stop(){return Ut.stop(this),this}resize(e,t){Ut.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,e,t,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,ao(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),ne(i.onResize,[this,o],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){let t=this.options.scales||{};ie(t,(i,s)=>{i.id=s})}buildOrUpdateScales(){let e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{}),r=[];t&&(r=r.concat(Object.keys(t).map(o=>{let a=t[o],c=pc(o,a),d=c==="r",h=c==="x";return{options:a,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),ie(r,o=>{let a=o.options,c=a.id,d=pc(c,a),h=$(a.type,o.dtype);(a.position===void 0||zh(a.position,d)!==zh(o.dposition))&&(a.position=o.dposition),s[c]=!0;let f=null;if(c in i&&i[c].type===h)f=i[c];else{let y=Dt.getScale(h);f=new y({id:c,type:h,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(a,e)}),ie(s,(o,a)=>{o||delete i[a]}),ie(i,o=>{ot.configure(this,o,o.options),ot.addBox(this,o)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,r)=>s.index-r.index),i>t){for(let s=t;s<i;++s)this._destroyDatasetMeta(s);e.splice(t,i-t)}this._sortedMetasets=e.slice(0).sort(Wh("order","index"))}_removeUnreferencedMetasets(){let{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,i,s;for(this._removeUnreferencedMetasets(),i=0,s=t.length;i<s;i++){let r=t[i],o=this.getDatasetMeta(i),a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=a,o.indexAxis=r.indexAxis||fc(a,this.options),o.order=r.order||0,o.index=i,o.label=""+r.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{let c=Dt.getController(a),{datasetElementType:d,dataElementType:h}=q.datasets[a];Object.assign(c.prototype,{dataElementType:Dt.getElement(h),datasetElementType:d&&Dt.getElement(d)}),o.controller=new c(this,i),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){ie(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){let t=this.config;t.update();let i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;let r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let d=0,h=this.data.datasets.length;d<h;d++){let{controller:f}=this.getDatasetMeta(d),y=!s&&r.indexOf(f)===-1;f.buildOrUpdateElements(y),o=Math.max(+f.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||ie(r,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Wh("z","_idx"));let{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){ie(this.scales,e=>{ot.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!Wr(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:i,start:s,count:r}of t){let o=i==="_removeElements"?-r:r;zk(e,s,o)}}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,i=r=>new Set(e.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;r<t;r++)if(!Wr(s,i(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ot.update(this,this.width,this.height,e);let t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],ie(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t<i;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,i=this.data.datasets.length;t<i;++t)this._updateDataset(t,_t(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){let i=this.getDatasetMeta(e),s={meta:i,index:e,mode:t,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(t),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ut.has(this)?this.attached&&!Ut.running(this)&&Ut.start(this):(this.draw(),Hh({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){let{width:i,height:s}=this._resizeBeforeDraw;this._resize(i,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){let t=this._sortedMetasets,i=[],s,r;for(s=0,r=t.length;s<r;++s){let o=t[s];(!e||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){let t=this.ctx,i=e._clip,s=!i.disabled,r=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Yn(t,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),e.controller.draw(),s&&Vn(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return Ln(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){let r=rk.modes[t];return typeof r=="function"?r(this,e,i,s):[]}getDatasetMeta(e){let t=this.data.datasets[e],i=this._metasets,s=i.filter(r=>r&&r._dataset===t).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Ct(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){let i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){let s=i?"show":"hide",r=this.getDatasetMeta(e),o=r.controller._resolveAnimations(void 0,s);ve(t)?(r.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===e?s:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Ut.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),eo(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete vo[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let e=this._listeners,t=this.platform,i=(r,o)=>{t.addEventListener(this,r,o),e[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};ie(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let e=this._responsiveListeners,t=this.platform,i=(c,d)=>{t.addEventListener(this,c,d),e[c]=d},s=(c,d)=>{e[c]&&(t.removeEventListener(this,c,d),delete e[c])},r=(c,d)=>{this.canvas&&this.resize(c,d)},o,a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},t.isAttached(this.canvas)?a():o()}unbindEvents(){ie(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},ie(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){let s=i?"set":"remove",r,o,a,c;for(t==="dataset"&&(r=this.getDatasetMeta(e[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,c=e.length;a<c;++a){o=e[a];let d=o&&this.getDatasetMeta(o.datasetIndex).controller;d&&d[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){let t=this._active||[],i=e.map(({datasetIndex:r,index:o})=>{let a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!vi(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}_updateHoverStyles(e,t,i){let s=this.options.hover,r=(c,d)=>c.filter(h=>!d.some(f=>h.datasetIndex===f.datasetIndex&&h.index===f.index)),o=r(t,e),a=i?e:r(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(e,t){let i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;let r=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(e,t,i){let{_active:s=[],options:r}=this,o=t,a=this._getActiveElements(e,s,i,o),c=Tl(e),d=Wk(e,this._lastEvent,i,c);i&&(this._lastEvent=null,ne(r.onHover,[e,a,this],this),c&&ne(r.onClick,[e,a,this],this));let h=!vi(a,s);return(h||t)&&(this._active=a,this._updateHoverStyles(a,s,t)),this._lastEvent=d,h}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;let r=this.options.hover;return this.getElementsAtEventForMode(e,r.mode,r,s)}},Yh=()=>ie(Ne.instances,n=>n._plugins.invalidate()),fn=!0;Object.defineProperties(Ne,{defaults:{enumerable:fn,value:q},instances:{enumerable:fn,value:vo},overrides:{enumerable:fn,value:un},registry:{enumerable:fn,value:Dt},version:{enumerable:fn,value:Lk},getChart:{enumerable:fn,value:gf},register:{enumerable:fn,value:(...n)=>{Dt.add(...n),Yh()}},unregister:{enumerable:fn,value:(...n)=>{Dt.remove(...n),Yh()}}});function mf(n,e,t){let{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:c}=e,d=s/a;n.beginPath(),n.arc(r,o,a,i-d,t+d),c>s?(d=s/c,n.arc(r,o,c,t+d,i-d,!0)):n.arc(r,o,s,t+we,i-we),n.closePath(),n.clip()}function Hk(n){return ms(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Yk(n,e,t,i){let s=Hk(n.options.borderRadius),r=(t-e)/2,o=Math.min(r,i*e/2),a=c=>{let d=(t-Math.min(r,c))*i/2;return Pe(c,0,Math.min(r,d))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Pe(s.innerStart,0,o),innerEnd:Pe(s.innerEnd,0,o)}}function xi(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function mc(n,e,t,i,s,r){let{x:o,y:a,startAngle:c,pixelMargin:d,innerRadius:h}=e,f=Math.max(e.outerRadius+i+t-d,0),y=h>0?h+i+t+d:0,g=0,m=s-c;if(i){let F=h>0?h-i:0,Y=f>0?f-i:0,V=(F+Y)/2,G=V!==0?m*V/(V+i):m;g=(m-G)/2}let v=Math.max(.001,m*f-t/te)/f,x=(m-v)/2,_=c+x+g,S=s-x-g,{outerStart:k,outerEnd:D,innerStart:T,innerEnd:M}=Yk(e,y,f,S-_),O=f-k,E=f-D,A=_+k/O,N=S-D/E,I=y+T,B=y+M,z=_+T/I,L=S-M/B;if(n.beginPath(),r){if(n.arc(o,a,f,A,N),D>0){let V=xi(E,N,o,a);n.arc(V.x,V.y,D,N,S+we)}let F=xi(B,S,o,a);if(n.lineTo(F.x,F.y),M>0){let V=xi(B,L,o,a);n.arc(V.x,V.y,M,S+we,L+Math.PI)}if(n.arc(o,a,y,S-M/y,_+T/y,!0),T>0){let V=xi(I,z,o,a);n.arc(V.x,V.y,T,z+Math.PI,_-we)}let Y=xi(O,_,o,a);if(n.lineTo(Y.x,Y.y),k>0){let V=xi(O,A,o,a);n.arc(V.x,V.y,k,_-we,A)}}else{n.moveTo(o,a);let F=Math.cos(A)*f+o,Y=Math.sin(A)*f+a;n.lineTo(F,Y);let V=Math.cos(N)*f+o,G=Math.sin(N)*f+a;n.lineTo(V,G)}n.closePath()}function Vk(n,e,t,i,s){let{fullCircles:r,startAngle:o,circumference:a}=e,c=e.endAngle;if(r){mc(n,e,t,i,o+ae,s);for(let d=0;d<r;++d)n.fill();isNaN(a)||(c=o+a%ae,a%ae===0&&(c+=ae))}return mc(n,e,t,i,c,s),n.fill(),c}function jk(n,e,t){let{x:i,y:s,startAngle:r,pixelMargin:o,fullCircles:a}=e,c=Math.max(e.outerRadius-o,0),d=e.innerRadius+o,h;for(t&&mf(n,e,r+ae),n.beginPath(),n.arc(i,s,d,r+ae,r,!0),h=0;h<a;++h)n.stroke();for(n.beginPath(),n.arc(i,s,c,r,r+ae),h=0;h<a;++h)n.stroke()}function Uk(n,e,t,i,s,r){let{options:o}=e,{borderWidth:a,borderJoinStyle:c}=o,d=o.borderAlign==="inner";!a||(d?(n.lineWidth=a*2,n.lineJoin=c||"round"):(n.lineWidth=a,n.lineJoin=c||"bevel"),e.fullCircles&&jk(n,e,d),d&&mf(n,e,s),mc(n,e,t,i,s,r),n.stroke())}var qt=class extends Ce{constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,i){let s=this.getProps(["x","y"],i),{angle:r,distance:o}=Ur(s,{x:e,y:t}),{startAngle:a,endAngle:c,innerRadius:d,outerRadius:h,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),y=this.options.spacing/2,m=$(f,c-a)>=ae||Wn(r,a,c),v=kt(o,d+y,h+y);return m&&v}getCenterPoint(e){let{x:t,y:i,startAngle:s,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:c,spacing:d}=this.options,h=(s+r)/2,f=(o+a+d+c)/2;return{x:t+Math.cos(h)*f,y:i+Math.sin(h)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:i}=this,s=(t.offset||0)/2,r=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>ae?Math.floor(i/ae):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let a=0;if(s){a=s/2;let d=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(d)*a,Math.sin(d)*a),this.circumference>=te&&(a=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;let c=Vk(e,this,a,r,o);Uk(e,this,a,r,c,o),e.restore()}};qt.id="arc";qt.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};qt.defaultRoutes={backgroundColor:"backgroundColor"};function yf(n,e,t=e){n.lineCap=$(t.borderCapStyle,e.borderCapStyle),n.setLineDash($(t.borderDash,e.borderDash)),n.lineDashOffset=$(t.borderDashOffset,e.borderDashOffset),n.lineJoin=$(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=$(t.borderWidth,e.borderWidth),n.strokeStyle=$(t.borderColor,e.borderColor)}function $k(n,e,t){n.lineTo(t.x,t.y)}function Gk(n){return n.stepped?Wl:n.tension||n.cubicInterpolationMode==="monotone"?Hl:$k}function bf(n,e,t={}){let i=n.length,{start:s=0,end:r=i-1}=t,{start:o,end:a}=e,c=Math.max(s,o),d=Math.min(r,a),h=s<o&&r<o||s>a&&r>a;return{count:i,start:c,loop:e.loop,ilen:d<c&&!h?i+d-c:d-c}}function Kk(n,e,t,i){let{points:s,options:r}=e,{count:o,start:a,loop:c,ilen:d}=bf(s,t,i),h=Gk(r),{move:f=!0,reverse:y}=i||{},g,m,v;for(g=0;g<=d;++g)m=s[(a+(y?d-g:g))%o],!m.skip&&(f?(n.moveTo(m.x,m.y),f=!1):h(n,v,m,y,r.stepped),v=m);return c&&(m=s[(a+(y?d:0))%o],h(n,v,m,y,r.stepped)),!!c}function qk(n,e,t,i){let s=e.points,{count:r,start:o,ilen:a}=bf(s,t,i),{move:c=!0,reverse:d}=i||{},h=0,f=0,y,g,m,v,x,_,S=D=>(o+(d?a-D:D))%r,k=()=>{v!==x&&(n.lineTo(h,x),n.lineTo(h,v),n.lineTo(h,_))};for(c&&(g=s[S(0)],n.moveTo(g.x,g.y)),y=0;y<=a;++y){if(g=s[S(y)],g.skip)continue;let D=g.x,T=g.y,M=D|0;M===m?(T<v?v=T:T>x&&(x=T),h=(f*h+D)/++f):(k(),n.lineTo(D,T),m=M,f=0,v=x=T),_=T}k()}function yc(n){let e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?qk:Kk}function Xk(n){return n.stepped?Kl:n.tension||n.cubicInterpolationMode==="monotone"?ql:zt}function Zk(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),yf(n,e.options),n.stroke(s)}function Jk(n,e,t,i){let{segments:s,options:r}=e,o=yc(e);for(let a of s)yf(n,r,a.style),n.beginPath(),o(n,e,a,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}var Qk=typeof Path2D=="function";function e1(n,e,t,i){Qk&&!e.options.segment?Zk(n,e,t,i):Jk(n,e,t,i)}var Mi=class extends Ce{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){let i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){let s=i.spanGaps?this._loop:this._fullLoop;Ul(this._points,i,e,s,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Jl(this,this.options.segment))}first(){let e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){let e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){let i=this.options,s=e[t],r=this.points,o=Zl(this,{property:t,start:s,end:s});if(!o.length)return;let a=[],c=Xk(i),d,h;for(d=0,h=o.length;d<h;++d){let{start:f,end:y}=o[d],g=r[f],m=r[y];if(g===m){a.push(g);continue}let v=Math.abs((s-g[t])/(m[t]-g[t])),x=c(g,m,v,i.stepped);x[t]=e[t],a.push(x)}return a.length===1?a[0]:a}pathSegment(e,t,i){return yc(this)(e,this,t,i)}path(e,t,i){let s=this.segments,r=yc(this),o=this._loop;t=t||0,i=i||this.points.length-t;for(let a of s)o&=r(e,this,a,{start:t,end:t+i-1});return!!o}draw(e,t,i,s){let r=this.options||{};(this.points||[]).length&&r.borderWidth&&(e.save(),e1(e,this,i,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};Mi.id="line";Mi.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};Mi.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};Mi.descriptors={_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"};function Vh(n,e,t,i){let s=n.options,{[t]:r}=n.getProps([t],i);return Math.abs(e-r)<s.radius+s.hitRadius}var Gn=class extends Ce{constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,i){let s=this.options,{x:r,y:o}=this.getProps(["x","y"],i);return Math.pow(e-r,2)+Math.pow(t-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(e,t){return Vh(this,e,"x",t)}inYRange(e,t){return Vh(this,e,"y",t)}getCenterPoint(e){let{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}size(e){e=e||this.options||{};let t=e.radius||0;t=Math.max(t,t&&e.hoverRadius||0);let i=t&&e.borderWidth||0;return(t+i)*2}draw(e,t){let i=this.options;this.skip||i.radius<.1||!Ln(this,t,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,Hn(e,i,this.x,this.y))}getRange(){let e=this.options||{};return e.radius+e.hitRadius}};Gn.id="point";Gn.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};Gn.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function wf(n,e){let{x:t,y:i,base:s,width:r,height:o}=n.getProps(["x","y","base","width","height"],e),a,c,d,h,f;return n.horizontal?(f=o/2,a=Math.min(t,s),c=Math.max(t,s),d=i-f,h=i+f):(f=r/2,a=t-f,c=t+f,d=Math.min(i,s),h=Math.max(i,s)),{left:a,top:d,right:c,bottom:h}}function pn(n,e,t,i){return n?0:Pe(e,t,i)}function t1(n,e,t){let i=n.options.borderWidth,s=n.borderSkipped,r=no(i);return{t:pn(s.top,r.top,0,t),r:pn(s.right,r.right,0,e),b:pn(s.bottom,r.bottom,0,t),l:pn(s.left,r.left,0,e)}}function n1(n,e,t){let{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=gt(s),o=Math.min(e,t),a=n.borderSkipped,c=i||K(s);return{topLeft:pn(!c||a.top||a.left,r.topLeft,0,o),topRight:pn(!c||a.top||a.right,r.topRight,0,o),bottomLeft:pn(!c||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:pn(!c||a.bottom||a.right,r.bottomRight,0,o)}}function i1(n){let e=wf(n),t=e.right-e.left,i=e.bottom-e.top,s=t1(n,t/2,i/2),r=n1(n,t/2,i/2);return{outer:{x:e.left,y:e.top,w:t,h:i,radius:r},inner:{x:e.left+s.l,y:e.top+s.t,w:t-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function rc(n,e,t,i){let s=e===null,r=t===null,a=n&&!(s&&r)&&wf(n,i);return a&&(s||kt(e,a.left,a.right))&&(r||kt(t,a.top,a.bottom))}function s1(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function r1(n,e){n.rect(e.x,e.y,e.w,e.h)}function oc(n,e,t={}){let i=n.x!==t.x?-e:0,s=n.y!==t.y?-e:0,r=(n.x+n.w!==t.x+t.w?e:0)-i,o=(n.y+n.h!==t.y+t.h?e:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+r,h:n.h+o,radius:n.radius}}var mt=class extends Ce{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){let{inflateAmount:t,options:{borderColor:i,backgroundColor:s}}=this,{inner:r,outer:o}=i1(this),a=s1(o.radius)?Vt:r1;e.save(),(o.w!==r.w||o.h!==r.h)&&(e.beginPath(),a(e,oc(o,t,r)),e.clip(),a(e,oc(r,-t,o)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),a(e,oc(r,t)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,t,i){return rc(this,e,t,i)}inXRange(e,t){return rc(this,e,null,t)}inYRange(e,t){return rc(this,null,e,t)}getCenterPoint(e){let{x:t,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],e);return{x:r?(t+s)/2:t,y:r?i:(i+s)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}};mt.id="bar";mt.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};mt.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var jh=(n,e)=>{let{boxHeight:t=e,boxWidth:i=e}=n;return n.usePointStyle&&(t=Math.min(t,e),i=n.pointStyleWidth||Math.min(i,e)),{boxWidth:i,boxHeight:t,itemHeight:Math.max(e,t)}},o1=(n,e)=>n!==null&&e!==null&&n.datasetIndex===e.datasetIndex&&n.index===e.index,xo=class extends Ce{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,i){this.maxWidth=e,this.maxHeight=t,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=ne(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(i=>e.filter(i,this.chart.data))),e.sort&&(t=t.sort((i,s)=>e.sort(i,s,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let i=e.labels,s=he(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:c}=jh(i,r),d,h;t.font=s.string,this.isHorizontal()?(d=this.maxWidth,h=this._fitRows(o,r,a,c)+10):(h=this.maxHeight,d=this._fitCols(o,r,a,c)+10),this.width=Math.min(d,e.maxWidth||this.maxWidth),this.height=Math.min(h,e.maxHeight||this.maxHeight)}_fitRows(e,t,i,s){let{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],h=s+a,f=e;r.textAlign="left",r.textBaseline="middle";let y=-1,g=-h;return this.legendItems.forEach((m,v)=>{let x=i+t/2+r.measureText(m.text).width;(v===0||d[d.length-1]+x+2*a>o)&&(f+=h,d[d.length-(v>0?0:1)]=0,g+=h,y++),c[v]={left:0,top:g,row:y,width:x,height:s},d[d.length-1]+=x+a}),f}_fitCols(e,t,i,s){let{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],h=o-e,f=a,y=0,g=0,m=0,v=0;return this.legendItems.forEach((x,_)=>{let S=i+t/2+r.measureText(x.text).width;_>0&&g+s+2*a>h&&(f+=y+a,d.push({width:y,height:g}),m+=y+a,v++,y=g=0),c[_]={left:m,top:g,col:v,width:S,height:s},y=Math.max(y,S),g+=s+a}),f+=y,d.push({width:y,height:g}),f}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:i,labels:{padding:s},rtl:r}}=this,o=hn(r,this.left,this.width);if(this.isHorizontal()){let a=0,c=Ae(i,this.left+s,this.right-this.lineWidths[a]);for(let d of t)a!==d.row&&(a=d.row,c=Ae(i,this.left+s,this.right-this.lineWidths[a])),d.top+=this.top+e+s,d.left=o.leftForLtr(o.x(c),d.width),c+=d.width+s}else{let a=0,c=Ae(i,this.top+e+s,this.bottom-this.columnSizes[a].height);for(let d of t)d.col!==a&&(a=d.col,c=Ae(i,this.top+e+s,this.bottom-this.columnSizes[a].height)),d.top=c,d.left+=this.left+s,d.left=o.leftForLtr(o.x(d.left),d.width),c+=d.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let e=this.ctx;Yn(e,this),this._draw(),Vn(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:i,ctx:s}=this,{align:r,labels:o}=e,a=q.color,c=hn(e.rtl,this.left,this.width),d=he(o.font),{color:h,padding:f}=o,y=d.size,g=y/2,m;this.drawTitle(),s.textAlign=c.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=d.string;let{boxWidth:v,boxHeight:x,itemHeight:_}=jh(o,y),S=function(O,E,A){if(isNaN(v)||v<=0||isNaN(x)||x<0)return;s.save();let N=$(A.lineWidth,1);if(s.fillStyle=$(A.fillStyle,a),s.lineCap=$(A.lineCap,"butt"),s.lineDashOffset=$(A.lineDashOffset,0),s.lineJoin=$(A.lineJoin,"miter"),s.lineWidth=N,s.strokeStyle=$(A.strokeStyle,a),s.setLineDash($(A.lineDash,[])),o.usePointStyle){let I={radius:x*Math.SQRT2/2,pointStyle:A.pointStyle,rotation:A.rotation,borderWidth:N},B=c.xPlus(O,v/2),z=E+g;to(s,I,B,z,o.pointStyleWidth&&v)}else{let I=E+Math.max((y-x)/2,0),B=c.leftForLtr(O,v),z=gt(A.borderRadius);s.beginPath(),Object.values(z).some(L=>L!==0)?Vt(s,{x:B,y:I,w:v,h:x,radius:z}):s.rect(B,I,v,x),s.fill(),N!==0&&s.stroke()}s.restore()},k=function(O,E,A){Yt(s,A.text,O,E+_/2,d,{strikethrough:A.hidden,textAlign:c.textAlign(A.textAlign)})},D=this.isHorizontal(),T=this._computeTitleHeight();D?m={x:Ae(r,this.left+f,this.right-i[0]),y:this.top+f+T,line:0}:m={x:this.left+f,y:Ae(r,this.top+T+f,this.bottom-t[0].height),line:0},co(this.ctx,e.textDirection);let M=_+f;this.legendItems.forEach((O,E)=>{s.strokeStyle=O.fontColor||h,s.fillStyle=O.fontColor||h;let A=s.measureText(O.text).width,N=c.textAlign(O.textAlign||(O.textAlign=o.textAlign)),I=v+g+A,B=m.x,z=m.y;c.setWidth(this.width),D?E>0&&B+I+f>this.right&&(z=m.y+=M,m.line++,B=m.x=Ae(r,this.left+f,this.right-i[m.line])):E>0&&z+M>this.bottom&&(B=m.x=B+t[m.line].width+f,m.line++,z=m.y=Ae(r,this.top+T+f,this.bottom-t[m.line].height));let L=c.x(B);S(L,z,O),B=Rl(N,B+v+g,D?B+I:this.right,e.rtl),k(c.x(B),z,O),D?m.x+=I+f:m.y+=M}),uo(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,i=he(t.font),s=me(t.padding);if(!t.display)return;let r=hn(e.rtl,this.left,this.width),o=this.ctx,a=t.position,c=i.size/2,d=s.top+c,h,f=this.left,y=this.width;if(this.isHorizontal())y=Math.max(...this.lineWidths),h=this.top+d,f=Ae(e.align,f,this.right-y);else{let m=this.columnSizes.reduce((v,x)=>Math.max(v,x.height),0);h=d+Ae(e.align,this.top,this.bottom-m-e.labels.padding-this._computeTitleHeight())}let g=Ae(a,f,f+y);o.textAlign=r.textAlign(ps(a)),o.textBaseline="middle",o.strokeStyle=t.color,o.fillStyle=t.color,o.font=i.string,Yt(o,t.text,g,h,i)}_computeTitleHeight(){let e=this.options.title,t=he(e.font),i=me(e.padding);return e.display?t.lineHeight+i.height:0}_getLegendItemAt(e,t){let i,s,r;if(kt(e,this.left,this.right)&&kt(t,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],kt(e,s.left,s.left+s.width)&&kt(t,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(e){let t=this.options;if(!a1(e.type,t))return;let i=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){let s=this._hoveredItem,r=o1(s,i);s&&!r&&ne(t.onLeave,[e,s,this],this),this._hoveredItem=i,i&&!r&&ne(t.onHover,[e,i,this],this)}else i&&ne(t.onClick,[e,i,this],this)}};function a1(n,e){return!!((n==="mousemove"||n==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(n==="click"||n==="mouseup"))}var Ni={id:"legend",_element:xo,start(n,e,t){let i=n.legend=new xo({ctx:n.ctx,options:t,chart:n});ot.configure(n,i,t),ot.addBox(n,i)},stop(n){ot.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,e,t){let i=n.legend;ot.configure(n,i,t),i.options=t},afterUpdate(n){let e=n.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(n,e){e.replay||n.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,e,t){let i=e.datasetIndex,s=t.chart;s.isDatasetVisible(i)?(s.hide(i),e.hidden=!0):(s.show(i),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){let e=n.data.datasets,{labels:{usePointStyle:t,pointStyle:i,textAlign:s,color:r}}=n.legend.options;return n._getSortedDatasetMetas().map(o=>{let a=o.controller.getStyle(t?0:void 0),c=me(a.borderWidth);return{text:e[o.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!o.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:a.borderColor,pointStyle:i||a.pointStyle,rotation:a.rotation,textAlign:s||a.textAlign,borderRadius:0,datasetIndex:o.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}},_o=class extends Ce{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){let i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;let s=oe(i.text)?i.text.length:1;this._padding=me(i.padding);let r=s*he(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){let e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){let{top:t,left:i,bottom:s,right:r,options:o}=this,a=o.align,c=0,d,h,f;return this.isHorizontal()?(h=Ae(a,i,r),f=t+e,d=r-i):(o.position==="left"?(h=i+e,f=Ae(a,s,t),c=te*-.5):(h=r-e,f=Ae(a,t,s),c=te*.5),d=s-t),{titleX:h,titleY:f,maxWidth:d,rotation:c}}draw(){let e=this.ctx,t=this.options;if(!t.display)return;let i=he(t.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:c,rotation:d}=this._drawArgs(r);Yt(e,t.text,0,0,i,{color:t.color,maxWidth:c,rotation:d,textAlign:ps(t.align),textBaseline:"middle",translation:[o,a]})}};function l1(n,e){let t=new _o({ctx:n.ctx,options:e,chart:n});ot.configure(n,t,e),ot.addBox(n,t),n.titleBlock=t}var To={id:"title",_element:_o,start(n,e,t){l1(n,t)},stop(n){let e=n.titleBlock;ot.removeBox(n,e),delete n.titleBlock},beforeUpdate(n,e,t){let i=n.titleBlock;ot.configure(n,i,t),i.options=t},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};var Cs={average(n){if(!n.length)return!1;let e,t,i=0,s=0,r=0;for(e=0,t=n.length;e<t;++e){let o=n[e].element;if(o&&o.hasValue()){let a=o.tooltipPosition();i+=a.x,s+=a.y,++r}}return{x:i/r,y:s/r}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=n.length;r<o;++r){let c=n[r].element;if(c&&c.hasValue()){let d=c.getCenterPoint(),h=ln(e,d);h<s&&(s=h,a=c)}}if(a){let c=a.tooltipPosition();t=c.x,i=c.y}return{x:t,y:i}}};function Tt(n,e){return e&&(oe(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function $t(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
`)>-1?n.split(`
`):n}function c1(n,e){let{element:t,datasetIndex:i,index:s}=e,r=n.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:n,label:o,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function Uh(n,e){let t=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:o,boxHeight:a}=e,c=he(e.bodyFont),d=he(e.titleFont),h=he(e.footerFont),f=r.length,y=s.length,g=i.length,m=me(e.padding),v=m.height,x=0,_=i.reduce((D,T)=>D+T.before.length+T.lines.length+T.after.length,0);if(_+=n.beforeBody.length+n.afterBody.length,f&&(v+=f*d.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),_){let D=e.displayColors?Math.max(a,c.lineHeight):c.lineHeight;v+=g*D+(_-g)*c.lineHeight+(_-1)*e.bodySpacing}y&&(v+=e.footerMarginTop+y*h.lineHeight+(y-1)*e.footerSpacing);let S=0,k=function(D){x=Math.max(x,t.measureText(D).width+S)};return t.save(),t.font=d.string,ie(n.title,k),t.font=c.string,ie(n.beforeBody.concat(n.afterBody),k),S=e.displayColors?o+2+e.boxPadding:0,ie(i,D=>{ie(D.before,k),ie(D.lines,k),ie(D.after,k)}),S=0,t.font=h.string,ie(n.footer,k),t.restore(),x+=m.width,{width:x,height:v}}function d1(n,e){let{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function u1(n,e,t,i){let{x:s,width:r}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+r+o>e.width||n==="right"&&s-r-o<0)return!0}function h1(n,e,t,i){let{x:s,width:r}=t,{width:o,chartArea:{left:a,right:c}}=n,d="center";return i==="center"?d=s<=(a+c)/2?"left":"right":s<=r/2?d="left":s>=o-r/2&&(d="right"),u1(d,n,e,t)&&(d="center"),d}function $h(n,e,t){let i=t.yAlign||e.yAlign||d1(n,t);return{xAlign:t.xAlign||e.xAlign||h1(n,e,t,i),yAlign:i}}function f1(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function p1(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function Gh(n,e,t,i){let{caretSize:s,caretPadding:r,cornerRadius:o}=n,{xAlign:a,yAlign:c}=t,d=s+r,{topLeft:h,topRight:f,bottomLeft:y,bottomRight:g}=gt(o),m=f1(e,a),v=p1(e,c,d);return c==="center"?a==="left"?m+=d:a==="right"&&(m-=d):a==="left"?m-=Math.max(h,y)+s:a==="right"&&(m+=Math.max(f,g)+s),{x:Pe(m,0,i.width-e.width),y:Pe(v,0,i.height-e.height)}}function go(n,e,t){let i=me(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Kh(n){return Tt([],$t(n))}function g1(n,e,t){return Ct(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function qh(n,e){let t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}var Ms=class extends Ce{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let e=this._cachedAnimations;if(e)return e;let t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,r=new Si(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=g1(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){let{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),r=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]),a=[];return a=Tt(a,$t(s)),a=Tt(a,$t(r)),a=Tt(a,$t(o)),a}getBeforeBody(e,t){return Kh(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){let{callbacks:i}=t,s=[];return ie(e,r=>{let o={before:[],lines:[],after:[]},a=qh(i,r);Tt(o.before,$t(a.beforeLabel.call(this,r))),Tt(o.lines,a.label.call(this,r)),Tt(o.after,$t(a.afterLabel.call(this,r))),s.push(o)}),s}getAfterBody(e,t){return Kh(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){let{callbacks:i}=t,s=i.beforeFooter.apply(this,[e]),r=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]),a=[];return a=Tt(a,$t(s)),a=Tt(a,$t(r)),a=Tt(a,$t(o)),a}_createItems(e){let t=this._active,i=this.chart.data,s=[],r=[],o=[],a=[],c,d;for(c=0,d=t.length;c<d;++c)a.push(c1(this.chart,t[c]));return e.filter&&(a=a.filter((h,f,y)=>e.filter(h,f,y,i))),e.itemSort&&(a=a.sort((h,f)=>e.itemSort(h,f,i))),ie(a,h=>{let f=qh(e.callbacks,h);s.push(f.labelColor.call(this,h)),r.push(f.labelPointStyle.call(this,h)),o.push(f.labelTextColor.call(this,h))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(e,t){let i=this.options.setContext(this.getContext()),s=this._active,r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{let a=Cs[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);let c=this._size=Uh(this,i),d=Object.assign({},a,c),h=$h(this.chart,i,d),f=Gh(i,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,r={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){let r=this.getCaretPosition(e,i,s);t.lineTo(r.x1,r.y1),t.lineTo(r.x2,r.y2),t.lineTo(r.x3,r.y3)}getCaretPosition(e,t,i){let{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:c,topRight:d,bottomLeft:h,bottomRight:f}=gt(a),{x:y,y:g}=e,{width:m,height:v}=t,x,_,S,k,D,T;return r==="center"?(D=g+v/2,s==="left"?(x=y,_=x-o,k=D+o,T=D-o):(x=y+m,_=x+o,k=D-o,T=D+o),S=x):(s==="left"?_=y+Math.max(c,h)+o:s==="right"?_=y+m-Math.max(d,f)-o:_=this.caretX,r==="top"?(k=g,D=k-o,x=_-o,S=_+o):(k=g+v,D=k+o,x=_+o,S=_-o),T=k),{x1:x,x2:_,x3:S,y1:k,y2:D,y3:T}}drawTitle(e,t,i){let s=this.title,r=s.length,o,a,c;if(r){let d=hn(i.rtl,this.x,this.width);for(e.x=go(this,i.titleAlign,i),t.textAlign=d.textAlign(i.titleAlign),t.textBaseline="middle",o=he(i.titleFont),a=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,c=0;c<r;++c)t.fillText(s[c],d.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+a,c+1===r&&(e.y+=i.titleMarginBottom-a)}}_drawColorBox(e,t,i,s,r){let o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:c,boxWidth:d,boxPadding:h}=r,f=he(r.bodyFont),y=go(this,"left",r),g=s.x(y),m=c<f.lineHeight?(f.lineHeight-c)/2:0,v=t.y+m;if(r.usePointStyle){let x={radius:Math.min(d,c)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},_=s.leftForLtr(g,d)+d/2,S=v+c/2;e.strokeStyle=r.multiKeyBackground,e.fillStyle=r.multiKeyBackground,Hn(e,x,_,S),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Hn(e,x,_,S)}else{e.lineWidth=K(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;let x=s.leftForLtr(g,d-h),_=s.leftForLtr(s.xPlus(g,1),d-h-2),S=gt(o.borderRadius);Object.values(S).some(k=>k!==0)?(e.beginPath(),e.fillStyle=r.multiKeyBackground,Vt(e,{x,y:v,w:d,h:c,radius:S}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Vt(e,{x:_,y:v+1,w:d-2,h:c-2,radius:S}),e.fill()):(e.fillStyle=r.multiKeyBackground,e.fillRect(x,v,d,c),e.strokeRect(x,v,d,c),e.fillStyle=o.backgroundColor,e.fillRect(_,v+1,d-2,c-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){let{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:c,boxWidth:d,boxPadding:h}=i,f=he(i.bodyFont),y=f.lineHeight,g=0,m=hn(i.rtl,this.x,this.width),v=function(E){t.fillText(E,m.x(e.x+g),e.y+y/2),e.y+=y+r},x=m.textAlign(o),_,S,k,D,T,M,O;for(t.textAlign=o,t.textBaseline="middle",t.font=f.string,e.x=go(this,x,i),t.fillStyle=i.bodyColor,ie(this.beforeBody,v),g=a&&x!=="right"?o==="center"?d/2+h:d+2+h:0,D=0,M=s.length;D<M;++D){for(_=s[D],S=this.labelTextColors[D],t.fillStyle=S,ie(_.before,v),k=_.lines,a&&k.length&&(this._drawColorBox(t,e,D,m,i),y=Math.max(f.lineHeight,c)),T=0,O=k.length;T<O;++T)v(k[T]),y=f.lineHeight;ie(_.after,v)}g=0,y=f.lineHeight,ie(this.afterBody,v),e.y-=r}drawFooter(e,t,i){let s=this.footer,r=s.length,o,a;if(r){let c=hn(i.rtl,this.x,this.width);for(e.x=go(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=c.textAlign(i.footerAlign),t.textBaseline="middle",o=he(i.footerFont),t.fillStyle=i.footerColor,t.font=o.string,a=0;a<r;++a)t.fillText(s[a],c.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+i.footerSpacing}}drawBackground(e,t,i,s){let{xAlign:r,yAlign:o}=this,{x:a,y:c}=e,{width:d,height:h}=i,{topLeft:f,topRight:y,bottomLeft:g,bottomRight:m}=gt(s.cornerRadius);t.fillStyle=s.backgroundColor,t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.beginPath(),t.moveTo(a+f,c),o==="top"&&this.drawCaret(e,t,i,s),t.lineTo(a+d-y,c),t.quadraticCurveTo(a+d,c,a+d,c+y),o==="center"&&r==="right"&&this.drawCaret(e,t,i,s),t.lineTo(a+d,c+h-m),t.quadraticCurveTo(a+d,c+h,a+d-m,c+h),o==="bottom"&&this.drawCaret(e,t,i,s),t.lineTo(a+g,c+h),t.quadraticCurveTo(a,c+h,a,c+h-g),o==="center"&&r==="left"&&this.drawCaret(e,t,i,s),t.lineTo(a,c+f),t.quadraticCurveTo(a,c,a+f,c),t.closePath(),t.fill(),s.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){let t=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){let o=Cs[e.position].call(this,this._active,this._eventPosition);if(!o)return;let a=this._size=Uh(this,e),c=Object.assign({},o,this._size),d=$h(t,e,c),h=Gh(e,c,d,t);(s._to!==h.x||r._to!==h.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(e){let t=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(t);let s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let o=me(t.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&a&&(e.save(),e.globalAlpha=i,this.drawBackground(r,e,s,t),co(e,t.textDirection),r.y+=o.top,this.drawTitle(r,e,t),this.drawBody(r,e,t),this.drawFooter(r,e,t),uo(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){let i=this._active,s=e.map(({datasetIndex:a,index:c})=>{let d=this.chart.getDatasetMeta(a);if(!d)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:d.data[c],index:c}}),r=!vi(i,s),o=this._positionChanged(s,t);(r||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let s=this.options,r=this._active||[],o=this._getActiveElements(e,r,t,i),a=this._positionChanged(o,e),c=t||!vi(o,r)||a;return c&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),c}_getActiveElements(e,t,i,s){let r=this.options;if(e.type==="mouseout")return[];if(!s)return t;let o=this.chart.getElementsAtEventForMode(e,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(e,t){let{caretX:i,caretY:s,options:r}=this,o=Cs[r.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}};Ms.positioners=Cs;var Do={id:"tooltip",_element:Ms,positioners:Cs,afterInit(n,e,t){t&&(n.tooltip=new Ms({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){let e=n.tooltip;if(e&&e._willRender()){let t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",t)===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){let t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:pt,title(n){if(n.length>0){let e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return t[e.dataIndex]}return""},afterTitle:pt,beforeBody:pt,beforeLabel:pt,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let e=n.dataset.label||"";e&&(e+=": ");let t=n.formattedValue;return J(t)||(e+=t),e},labelColor(n){let t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){let t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:pt,afterBody:pt,beforeFooter:pt,footer:pt,afterFooter:pt}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};var m1=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function y1(n,e,t,i){let s=n.indexOf(e);if(s===-1)return m1(n,e,t,i);let r=n.lastIndexOf(e);return s!==r?t:s}var b1=(n,e)=>n===null?null:Pe(Math.round(n),0,e),Xt=class extends Kt{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){let t=this._addedLabels;if(t.length){let i=this.getLabels();for(let{index:s,label:r}of t)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(J(e))return null;let i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:y1(i,e,$(t,e),this._addedLabels),b1(t,i.length-1)}determineDataLimits(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){let e=this.min,t=this.max,i=this.options.offset,s=[],r=this.getLabels();r=e===0&&t===r.length-1?r:r.slice(e,t+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=e;o<=t;o++)s.push({value:o});return s}getLabelForValue(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}};Xt.id="category";Xt.defaults={ticks:{callback:Xt.prototype.getLabelForValue}};function w1(n,e){let t=[],{bounds:s,step:r,min:o,max:a,precision:c,count:d,maxTicks:h,maxDigits:f,includeBounds:y}=n,g=r||1,m=h-1,{min:v,max:x}=e,_=!J(o),S=!J(a),k=!J(d),D=(x-v)/(f+1),T=Yr((x-v)/m/g)*g,M,O,E,A;if(T<1e-14&&!_&&!S)return[{value:v},{value:x}];A=Math.ceil(x/T)-Math.floor(v/T),A>m&&(T=Yr(A*T/m/g)*g),J(c)||(M=Math.pow(10,c),T=Math.ceil(T*M)/M),s==="ticks"?(O=Math.floor(v/T)*T,E=Math.ceil(x/T)*T):(O=v,E=x),_&&S&&r&&Ol((a-o)/r,T/1e3)?(A=Math.round(Math.min((a-o)/T,h)),T=(a-o)/A,O=o,E=a):k?(O=_?o:O,E=S?a:E,A=d-1,T=(E-O)/A):(A=(E-O)/T,Bn(A,Math.round(A),T/1e3)?A=Math.round(A):A=Math.ceil(A));let N=Math.max(jr(T),jr(O));M=Math.pow(10,J(c)?N:c),O=Math.round(O*M)/M,E=Math.round(E*M)/M;let I=0;for(_&&(y&&O!==o?(t.push({value:o}),O<o&&I++,Bn(Math.round((O+I*T)*M)/M,o,Xh(o,D,n))&&I++):O<o&&I++);I<A;++I)t.push({value:Math.round((O+I*T)*M)/M});return S&&y&&E!==a?t.length&&Bn(t[t.length-1].value,a,Xh(a,D,n))?t[t.length-1].value=a:t.push({value:a}):(!S||E===a)&&t.push({value:E}),t}function Xh(n,e,{horizontal:t,minRotation:i}){let s=xe(i),r=(t?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+n).length;return Math.min(e/r,o)}var Ei=class extends Kt{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return J(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds(),{min:s,max:r}=this,o=c=>s=t?s:c,a=c=>r=i?r:c;if(e){let c=rt(s),d=rt(r);c<0&&d<0?a(0):c>0&&d>0&&o(0)}if(s===r){let c=1;(r>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(c=Math.abs(r*.05)),a(r+c),e||o(s-c)}this.min=s,this.max=r}getTickLimit(){let e=this.options.ticks,{maxTicksLimit:t,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let e=this.options,t=e.ticks,i=this.getTickLimit();i=Math.max(2,i);let s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},r=this._range||this,o=w1(s,r);return e.bounds==="ticks"&&Vr(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){let e=this.ticks,t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){let s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return jn(e,this.chart.options.locale,this.options.ticks.format)}},gn=class extends Ei{determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=_e(e)?e:0,this.max=_e(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,i=xe(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,r.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}};gn.id="linear";gn.defaults={ticks:{callback:Co.formatters.numeric}};function Zh(n){return n/Math.pow(10,Math.floor(Ye(n)))===1}function v1(n,e){let t=Math.floor(Ye(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[],r=He(n.min,Math.pow(10,Math.floor(Ye(e.min)))),o=Math.floor(Ye(r)),a=Math.floor(r/Math.pow(10,o)),c=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:r,major:Zh(r)}),++a,a===10&&(a=1,++o,c=o>=0?1:c),r=Math.round(a*Math.pow(10,o)*c)/c;while(o<t||o===t&&a<i);let d=He(n.max,r);return s.push({value:d,major:Zh(r)}),s}var So=class extends Kt{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let i=Ei.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return _e(i)&&i>0?i:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=_e(e)?Math.max(0,e):null,this.max=_e(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),i=this.min,s=this.max,r=c=>i=e?i:c,o=c=>s=t?s:c,a=(c,d)=>Math.pow(10,Math.floor(Ye(c))+d);i===s&&(i<=0?(r(1),o(10)):(r(a(i,-1)),o(a(s,1)))),i<=0&&r(a(s,-1)),s<=0&&o(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&r(a(i,-1)),this.min=i,this.max=s}buildTicks(){let e=this.options,t={min:this._userMin,max:this._userMax},i=v1(t,this);return e.bounds==="ticks"&&Vr(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":jn(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=Ye(e),this._valueRange=Ye(this.max)-Ye(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Ye(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}};So.id="logarithmic";So.defaults={ticks:{callback:Co.formatters.logarithmic,major:{enabled:!0}}};function bc(n){let e=n.ticks;if(e.display&&n.display){let t=me(e.backdropPadding);return $(e.font&&e.font.size,q.font.size)+t.height}return 0}function x1(n,e,t){return t=oe(t)?t:[t],{w:zl(n,e.string,t),h:t.length*e.lineHeight}}function Jh(n,e,t,i,s){return n===i||n===s?{start:e-t/2,end:e+t/2}:n<i||n>s?{start:e-t,end:e}:{start:e,end:e+t}}function _1(n){let e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],s=[],r=n._pointLabels.length,o=n.options.pointLabels,a=o.centerPointLabels?te/r:0;for(let c=0;c<r;c++){let d=o.setContext(n.getPointLabelContext(c));s[c]=d.padding;let h=n.getPointPosition(c,n.drawingArea+s[c],a),f=he(d.font),y=x1(n.ctx,f,n._pointLabels[c]);i[c]=y;let g=Ke(n.getIndexAngle(c)+a),m=Math.round(zn(g)),v=Jh(m,h.x,y.w,0,180),x=Jh(m,h.y,y.h,90,270);S1(t,e,g,v,x)}n.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),n._pointLabelItems=k1(n,i,s)}function S1(n,e,t,i,s){let r=Math.abs(Math.sin(t)),o=Math.abs(Math.cos(t)),a=0,c=0;i.start<e.l?(a=(e.l-i.start)/r,n.l=Math.min(n.l,e.l-a)):i.end>e.r&&(a=(i.end-e.r)/r,n.r=Math.max(n.r,e.r+a)),s.start<e.t?(c=(e.t-s.start)/o,n.t=Math.min(n.t,e.t-c)):s.end>e.b&&(c=(s.end-e.b)/o,n.b=Math.max(n.b,e.b+c))}function k1(n,e,t){let i=[],s=n._pointLabels.length,r=n.options,o=bc(r)/2,a=n.drawingArea,c=r.pointLabels.centerPointLabels?te/s:0;for(let d=0;d<s;d++){let h=n.getPointPosition(d,a+o+t[d],c),f=Math.round(zn(Ke(h.angle+we))),y=e[d],g=D1(h.y,y.h,f),m=C1(f),v=T1(h.x,y.w,m);i.push({x:h.x,y:g,textAlign:m,left:v,top:g,right:v+y.w,bottom:g+y.h})}return i}function C1(n){return n===0||n===180?"center":n<180?"left":"right"}function T1(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function D1(n,e,t){return t===90||t===270?n-=e/2:(t>270||t<90)&&(n-=e),n}function O1(n,e){let{ctx:t,options:{pointLabels:i}}=n;for(let s=e-1;s>=0;s--){let r=i.setContext(n.getPointLabelContext(s)),o=he(r.font),{x:a,y:c,textAlign:d,left:h,top:f,right:y,bottom:g}=n._pointLabelItems[s],{backdropColor:m}=r;if(!J(m)){let v=gt(r.borderRadius),x=me(r.backdropPadding);t.fillStyle=m;let _=h-x.left,S=f-x.top,k=y-h+x.width,D=g-f+x.height;Object.values(v).some(T=>T!==0)?(t.beginPath(),Vt(t,{x:_,y:S,w:k,h:D,radius:v}),t.fill()):t.fillRect(_,S,k,D)}Yt(t,n._pointLabels[s],a,c+o.lineHeight/2,o,{color:r.color,textAlign:d,textBaseline:"middle"})}}function vf(n,e,t,i){let{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,ae);else{let r=n.getPointPosition(0,e);s.moveTo(r.x,r.y);for(let o=1;o<i;o++)r=n.getPointPosition(o,e),s.lineTo(r.x,r.y)}}function M1(n,e,t,i){let s=n.ctx,r=e.circular,{color:o,lineWidth:a}=e;!r&&!i||!o||!a||t<0||(s.save(),s.strokeStyle=o,s.lineWidth=a,s.setLineDash(e.borderDash),s.lineDashOffset=e.borderDashOffset,s.beginPath(),vf(n,t,r,i),s.closePath(),s.stroke(),s.restore())}function E1(n,e,t){return Ct(n,{label:t,index:e,type:"pointLabel"})}var Pi=class extends Ei{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let e=this._padding=me(bc(this.options)/2),t=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(t,i)/2)}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!1);this.min=_e(e)&&!isNaN(e)?e:0,this.max=_e(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/bc(this.options))}generateTickLabels(e){Ei.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,i)=>{let s=ne(this.options.pointLabels.callback,[t,i],this);return s||s===0?s:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){let e=this.options;e.display&&e.pointLabels.display?_1(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,s){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,s))}getIndexAngle(e){let t=ae/(this._pointLabels.length||1),i=this.options.startAngle||0;return Ke(e*t+xe(i))}getDistanceFromCenterForValue(e){if(J(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(J(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e<t.length){let i=t[e];return E1(this.getContext(),e,i)}}getPointPosition(e,t,i=0){let s=this.getIndexAngle(e)-we+i;return{x:Math.cos(s)*t+this.xCenter,y:Math.sin(s)*t+this.yCenter,angle:s}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){let{left:t,top:i,right:s,bottom:r}=this._pointLabelItems[e];return{left:t,top:i,right:s,bottom:r}}drawBackground(){let{backgroundColor:e,grid:{circular:t}}=this.options;if(e){let i=this.ctx;i.save(),i.beginPath(),vf(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){let e=this.ctx,t=this.options,{angleLines:i,grid:s}=t,r=this._pointLabels.length,o,a,c;if(t.pointLabels.display&&O1(this,r),s.display&&this.ticks.forEach((d,h)=>{if(h!==0){a=this.getDistanceFromCenterForValue(d.value);let f=s.setContext(this.getContext(h-1));M1(this,f,a,r)}}),i.display){for(e.save(),o=r-1;o>=0;o--){let d=i.setContext(this.getPointLabelContext(o)),{color:h,lineWidth:f}=d;!f||!h||(e.lineWidth=f,e.strokeStyle=h,e.setLineDash(d.borderDash),e.lineDashOffset=d.borderDashOffset,a=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),c=this.getPointPosition(o,a),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;let s=this.getIndexAngle(0),r,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,c)=>{if(c===0&&!t.reverse)return;let d=i.setContext(this.getContext(c)),h=he(d.font);if(r=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){e.font=h.string,o=e.measureText(a.label).width,e.fillStyle=d.backdropColor;let f=me(d.backdropPadding);e.fillRect(-o/2-f.left,-r-h.size/2-f.top,o+f.width,h.size+f.height)}Yt(e,a.label,0,-r,h,{color:d.color})}),e.restore()}drawTitle(){}};Pi.id="radialLinear";Pi.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Co.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Pi.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Pi.descriptors={angleLines:{_fallback:"grid"}};var Oo={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Ve=Object.keys(Oo);function P1(n,e){return n-e}function Qh(n,e){if(J(e))return null;let t=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts,o=e;return typeof i=="function"&&(o=i(o)),_e(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(dn(r)||r===!0)?t.startOf(o,"isoWeek",r):t.startOf(o,s)),+o)}function ef(n,e,t,i){let s=Ve.length;for(let r=Ve.indexOf(n);r<s-1;++r){let o=Oo[Ve[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(a*o.size))<=i)return Ve[r]}return Ve[s-1]}function A1(n,e,t,i,s){for(let r=Ve.length-1;r>=Ve.indexOf(t);r--){let o=Ve[r];if(Oo[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return Ve[t?Ve.indexOf(t):0]}function N1(n){for(let e=Ve.indexOf(n)+1,t=Ve.length;e<t;++e)if(Oo[Ve[e]].common)return Ve[e]}function tf(n,e,t){if(!t)n[e]=!0;else if(t.length){let{lo:i,hi:s}=fs(t,e),r=t[i]>=e?t[i]:t[s];n[r]=!0}}function R1(n,e,t,i){let s=n._adapter,r=+s.startOf(e[0].value,i),o=e[e.length-1].value,a,c;for(a=r;a<=o;a=+s.add(a,1,i))c=t[a],c>=0&&(e[c].major=!0);return e}function nf(n,e,t){let i=[],s={},r=e.length,o,a;for(o=0;o<r;++o)a=e[o],s[a]=o,i.push({value:a,major:!1});return r===0||!t?i:R1(n,i,s,t)}var Ai=class extends Kt{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t){let i=e.time||(e.time={}),s=this._adapter=new ek._date(e.adapters.date);s.init(t),Fn(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:Qh(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let e=this.options,t=this._adapter,i=e.time.unit||"day",{min:s,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function c(d){!o&&!isNaN(d.min)&&(s=Math.min(s,d.min)),!a&&!isNaN(d.max)&&(r=Math.max(r,d.max))}(!o||!a)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=_e(s)&&!isNaN(s)?s:+t.startOf(Date.now(),i),r=_e(r)&&!isNaN(r)?r:+t.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){let e=this.getLabelTimestamps(),t=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],i=e[e.length-1]),{min:t,max:i}}buildTicks(){let e=this.options,t=e.time,i=e.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let r=this.min,o=this.max,a=Pl(s,r,o);return this._unit=t.unit||(i.autoSkip?ef(t.minUnit,this.min,this.max,this._getLabelCapacity(r)):A1(this,a.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:N1(this._unit),this.initOffsets(s),e.reverse&&a.reverse(),nf(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e){let t=0,i=0,s,r;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,r=this.getDecimalForValue(e[e.length-1]),e.length===1?i=r:i=(r-this.getDecimalForValue(e[e.length-2]))/2);let o=e.length<3?.5:.25;t=Pe(t,0,o),i=Pe(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){let e=this._adapter,t=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||ef(r.minUnit,t,i,this._getLabelCapacity(t)),a=$(r.stepSize,1),c=o==="week"?r.isoWeekday:!1,d=dn(c)||c===!0,h={},f=t,y,g;if(d&&(f=+e.startOf(f,"isoWeek",c)),f=+e.startOf(f,d?"day":o),e.diff(i,t,o)>1e5*a)throw new Error(t+" and "+i+" are too far apart with stepSize of "+a+" "+o);let m=s.ticks.source==="data"&&this.getDataTimestamps();for(y=f,g=0;y<i;y=+e.add(y,a,o),g++)tf(h,y,m);return(y===i||s.bounds==="ticks"||g===1)&&tf(h,y,m),Object.keys(h).sort((v,x)=>v-x).map(v=>+v)}getLabelForValue(e){let t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,t,i,s){let r=this.options,o=r.time.displayFormats,a=this._unit,c=this._majorUnit,d=a&&o[a],h=c&&o[c],f=i[t],y=c&&h&&f&&f.major,g=this._adapter.format(e,s||(y?h:d)),m=r.ticks.callback;return m?ne(m,[g,t,i],this):g}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t<i;++t)s=e[t],s.label=this._tickFormatFunction(s.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){let t=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+i)*t.factor)}getValueForPixel(e){let t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){let t=this.options.ticks,i=this.ctx.measureText(e).width,s=xe(this.isHorizontal()?t.maxRotation:t.minRotation),r=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*r+a*o,h:i*o+a*r}}_getLabelCapacity(e){let t=this.options.time,i=t.displayFormats,s=i[t.unit]||i.millisecond,r=this._tickFormatFunction(e,0,nf(this,[e],this._majorUnit),s),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t<i;++t)e=e.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){let e=this._cache.labels||[],t,i;if(e.length)return e;let s=this.getLabels();for(t=0,i=s.length;t<i;++t)e.push(Qh(this,s[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Gr(e.sort(P1))}};Ai.id="time";Ai.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};function mo(n,e,t){let i=0,s=n.length-1,r,o,a,c;t?(e>=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=Wt(n,"pos",e)),{pos:r,time:a}=n[i],{pos:o,time:c}=n[s]):(e>=n[i].time&&e<=n[s].time&&({lo:i,hi:s}=Wt(n,"time",e)),{time:r,pos:a}=n[i],{time:o,pos:c}=n[s]);let d=o-r;return d?a+(c-a)*(e-r)/d:a}var ko=class extends Ai{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=mo(t,this.min),this._tableRange=mo(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:i}=this,s=[],r=[],o,a,c,d,h;for(o=0,a=e.length;o<a;++o)d=e[o],d>=t&&d<=i&&s.push(d);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)h=s[o+1],c=s[o-1],d=s[o],Math.round((h+c)/2)!==d&&r.push({time:d,pos:o/(a-1)});return r}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(mo(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return mo(this._table,i*this._tableRange+this._minPos,!0)}};ko.id="timeseries";ko.defaults=Ai.defaults;var xf=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var n=window.screen;if(n)return(n.deviceXDPI||1)/(n.logicalXDPI||1)}return 1}(),As={toTextLines:function(n){var e=[],t;for(n=[].concat(n);n.length;)t=n.pop(),typeof t=="string"?e.unshift.apply(e,t.split(`
`)):Array.isArray(t)?n.push.apply(n,t):J(n)||e.unshift(""+t);return e},textSize:function(n,e,t){var i=[].concat(e),s=i.length,r=n.font,o=0,a;for(n.font=t.string,a=0;a<s;++a)o=Math.max(n.measureText(i[a]).width,o);return n.font=r,{height:s*t.lineHeight,width:o}},bound:function(n,e,t){return Math.max(n,Math.min(e,t))},arrayDiff:function(n,e){var t=n.slice(),i=[],s,r,o,a;for(s=0,o=e.length;s<o;++s)a=e[s],r=t.indexOf(a),r===-1?i.push([a,1]):t.splice(r,1);for(s=0,o=t.length;s<o;++s)i.push([t[s],-1]);return i},rasterize:function(n){return Math.round(n*xf)/xf}};function wc(n,e){var t=e.x,i=e.y;if(t===null)return{x:0,y:-1};if(i===null)return{x:1,y:0};var s=n.x-t,r=n.y-i,o=Math.sqrt(s*s+r*r);return{x:o?s/o:0,y:o?r/o:-1}}function I1(n,e,t,i,s){switch(s){case"center":t=i=0;break;case"bottom":t=0,i=1;break;case"right":t=1,i=0;break;case"left":t=-1,i=0;break;case"top":t=0,i=-1;break;case"start":t=-t,i=-i;break;case"end":break;default:s*=Math.PI/180,t=Math.cos(s),i=Math.sin(s);break}return{x:n,y:e,vx:t,vy:i}}var L1=0,Sf=1,kf=2,Cf=4,Tf=8;function Mo(n,e,t){var i=L1;return n<t.left?i|=Sf:n>t.right&&(i|=kf),e<t.top?i|=Tf:e>t.bottom&&(i|=Cf),i}function F1(n,e){for(var t=n.x0,i=n.y0,s=n.x1,r=n.y1,o=Mo(t,i,e),a=Mo(s,r,e),c,d,h;!(!(o|a)||o&a);)c=o||a,c&Tf?(d=t+(s-t)*(e.top-i)/(r-i),h=e.top):c&Cf?(d=t+(s-t)*(e.bottom-i)/(r-i),h=e.bottom):c&kf?(h=i+(r-i)*(e.right-t)/(s-t),d=e.right):c&Sf&&(h=i+(r-i)*(e.left-t)/(s-t),d=e.left),c===o?(t=d,i=h,o=Mo(t,i,e)):(s=d,r=h,a=Mo(s,r,e));return{x0:t,x1:s,y0:i,y1:r}}function Eo(n,e){var t=e.anchor,i=n,s,r;return e.clamp&&(i=F1(i,e.area)),t==="start"?(s=i.x0,r=i.y0):t==="end"?(s=i.x1,r=i.y1):(s=(i.x0+i.x1)/2,r=(i.y0+i.y1)/2),I1(s,r,n.vx,n.vy,e.align)}var Po={arc:function(n,e){var t=(n.startAngle+n.endAngle)/2,i=Math.cos(t),s=Math.sin(t),r=n.innerRadius,o=n.outerRadius;return Eo({x0:n.x+i*r,y0:n.y+s*r,x1:n.x+i*o,y1:n.y+s*o,vx:i,vy:s},e)},point:function(n,e){var t=wc(n,e.origin),i=t.x*n.options.radius,s=t.y*n.options.radius;return Eo({x0:n.x-i,y0:n.y-s,x1:n.x+i,y1:n.y+s,vx:t.x,vy:t.y},e)},bar:function(n,e){var t=wc(n,e.origin),i=n.x,s=n.y,r=0,o=0;return n.horizontal?(i=Math.min(n.x,n.base),r=Math.abs(n.base-n.x)):(s=Math.min(n.y,n.base),o=Math.abs(n.base-n.y)),Eo({x0:i,y0:s+o,x1:i+r,y1:s,vx:t.x,vy:t.y},e)},fallback:function(n,e){var t=wc(n,e.origin);return Eo({x0:n.x,y0:n.y,x1:n.x+(n.width||0),y1:n.y+(n.height||0),vx:t.x,vy:t.y},e)}},Zt=As.rasterize;function B1(n){var e=n.borderWidth||0,t=n.padding,i=n.size.height,s=n.size.width,r=-s/2,o=-i/2;return{frame:{x:r-t.left-e,y:o-t.top-e,w:s+t.width+e*2,h:i+t.height+e*2},text:{x:r,y:o,w:s,h:i}}}function z1(n,e){var t=e.chart.getDatasetMeta(e.datasetIndex).vScale;if(!t)return null;if(t.xCenter!==void 0&&t.yCenter!==void 0)return{x:t.xCenter,y:t.yCenter};var i=t.getBasePixel();return n.horizontal?{x:i,y:null}:{x:null,y:i}}function W1(n){return n instanceof qt?Po.arc:n instanceof Gn?Po.point:n instanceof mt?Po.bar:Po.fallback}function H1(n,e,t,i,s,r){var o=Math.PI/2;if(r){var a=Math.min(r,s/2,i/2),c=e+a,d=t+a,h=e+i-a,f=t+s-a;n.moveTo(e,d),c<h&&d<f?(n.arc(c,d,a,-Math.PI,-o),n.arc(h,d,a,-o,0),n.arc(h,f,a,0,o),n.arc(c,f,a,o,Math.PI)):c<h?(n.moveTo(c,t),n.arc(h,d,a,-o,o),n.arc(c,d,a,o,Math.PI+o)):d<f?(n.arc(c,d,a,-Math.PI,0),n.arc(c,f,a,0,Math.PI)):n.arc(c,d,a,-Math.PI,Math.PI),n.closePath(),n.moveTo(e,t)}else n.rect(e,t,i,s)}function Y1(n,e,t){var i=t.backgroundColor,s=t.borderColor,r=t.borderWidth;!i&&(!s||!r)||(n.beginPath(),H1(n,Zt(e.x)+r/2,Zt(e.y)+r/2,Zt(e.w)-r,Zt(e.h)-r,t.borderRadius),n.closePath(),i&&(n.fillStyle=i,n.fill()),s&&r&&(n.strokeStyle=s,n.lineWidth=r,n.lineJoin="miter",n.stroke()))}function V1(n,e,t){var i=t.lineHeight,s=n.w,r=n.x,o=n.y+i/2;return e==="center"?r+=s/2:(e==="end"||e==="right")&&(r+=s),{h:i,w:s,x:r,y:o}}function j1(n,e,t){var i=n.shadowBlur,s=t.stroked,r=Zt(t.x),o=Zt(t.y),a=Zt(t.w);s&&n.strokeText(e,r,o,a),t.filled&&(i&&s&&(n.shadowBlur=0),n.fillText(e,r,o,a),i&&s&&(n.shadowBlur=i))}function U1(n,e,t,i){var s=i.textAlign,r=i.color,o=!!r,a=i.font,c=e.length,d=i.textStrokeColor,h=i.textStrokeWidth,f=d&&h,y;if(!(!c||!o&&!f))for(t=V1(t,s,a),n.font=a.string,n.textAlign=s,n.textBaseline="middle",n.shadowBlur=i.textShadowBlur,n.shadowColor=i.textShadowColor,o&&(n.fillStyle=r),f&&(n.lineJoin="round",n.lineWidth=h,n.strokeStyle=d),y=0,c=e.length;y<c;++y)j1(n,e[y],{stroked:f,filled:o,w:t.w,x:t.x,y:t.y+t.h*y})}var Df=function(n,e,t,i){var s=this;s._config=n,s._index=i,s._model=null,s._rects=null,s._ctx=e,s._el=t};qe(Df.prototype,{_modelize:function(n,e,t,i){var s=this,r=s._index,o=he(ue([t.font,{}],i,r)),a=ue([t.color,q.color],i,r);return{align:ue([t.align,"center"],i,r),anchor:ue([t.anchor,"center"],i,r),area:i.chart.chartArea,backgroundColor:ue([t.backgroundColor,null],i,r),borderColor:ue([t.borderColor,null],i,r),borderRadius:ue([t.borderRadius,0],i,r),borderWidth:ue([t.borderWidth,0],i,r),clamp:ue([t.clamp,!1],i,r),clip:ue([t.clip,!1],i,r),color:a,display:n,font:o,lines:e,offset:ue([t.offset,4],i,r),opacity:ue([t.opacity,1],i,r),origin:z1(s._el,i),padding:me(ue([t.padding,4],i,r)),positioner:W1(s._el),rotation:ue([t.rotation,0],i,r)*(Math.PI/180),size:As.textSize(s._ctx,e,o),textAlign:ue([t.textAlign,"start"],i,r),textShadowBlur:ue([t.textShadowBlur,0],i,r),textShadowColor:ue([t.textShadowColor,a],i,r),textStrokeColor:ue([t.textStrokeColor,a],i,r),textStrokeWidth:ue([t.textStrokeWidth,0],i,r)}},update:function(n){var e=this,t=null,i=null,s=e._index,r=e._config,o,a,c,d=ue([r.display,!0],n,s);d&&(o=n.dataset.data[s],a=$(ne(r.formatter,[o,n]),o),c=J(a)?[]:As.toTextLines(a),c.length&&(t=e._modelize(d,c,r,n),i=B1(t))),e._model=t,e._rects=i},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(n,e){var t=this,i=n.ctx,s=t._model,r=t._rects,o;!this.visible()||(i.save(),s.clip&&(o=s.area,i.beginPath(),i.rect(o.left,o.top,o.right-o.left,o.bottom-o.top),i.clip()),i.globalAlpha=As.bound(0,s.opacity,1),i.translate(Zt(e.x),Zt(e.y)),i.rotate(s.rotation),Y1(i,r.frame,s),U1(i,s.lines,r.text,s),i.restore())}});var $1=Number.MIN_SAFE_INTEGER||-9007199254740991,G1=Number.MAX_SAFE_INTEGER||9007199254740991;function Ps(n,e,t){var i=Math.cos(t),s=Math.sin(t),r=e.x,o=e.y;return{x:r+i*(n.x-r)-s*(n.y-o),y:o+s*(n.x-r)+i*(n.y-o)}}function _f(n,e){var t=G1,i=$1,s=e.origin,r,o,a,c,d;for(r=0;r<n.length;++r)o=n[r],a=o.x-s.x,c=o.y-s.y,d=e.vx*a+e.vy*c,t=Math.min(t,d),i=Math.max(i,d);return{min:t,max:i}}function Ao(n,e){var t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);return{vx:(e.x-n.x)/s,vy:(e.y-n.y)/s,origin:n,ln:s}}var Of=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};qe(Of.prototype,{center:function(){var n=this._rect;return{x:n.x+n.w/2,y:n.y+n.h/2}},update:function(n,e,t){this._rotation=t,this._rect={x:e.x+n.x,y:e.y+n.y,w:e.w,h:e.h}},contains:function(n){var e=this,t=1,i=e._rect;return n=Ps(n,e.center(),-e._rotation),!(n.x<i.x-t||n.y<i.y-t||n.x>i.x+i.w+t*2||n.y>i.y+i.h+t*2)},intersects:function(n){var e=this._points(),t=n._points(),i=[Ao(e[0],e[1]),Ao(e[0],e[3])],s,r,o;for(this._rotation!==n._rotation&&i.push(Ao(t[0],t[1]),Ao(t[0],t[3])),s=0;s<i.length;++s)if(r=_f(e,i[s]),o=_f(t,i[s]),r.max<o.min||o.max<r.min)return!1;return!0},_points:function(){var n=this,e=n._rect,t=n._rotation,i=n.center();return[Ps({x:e.x,y:e.y},i,t),Ps({x:e.x+e.w,y:e.y},i,t),Ps({x:e.x+e.w,y:e.y+e.h},i,t),Ps({x:e.x,y:e.y+e.h},i,t)]}});function Mf(n,e,t){var i=e.positioner(n,e),s=i.vx,r=i.vy;if(!s&&!r)return{x:i.x,y:i.y};var o=t.w,a=t.h,c=e.rotation,d=Math.abs(o/2*Math.cos(c))+Math.abs(a/2*Math.sin(c)),h=Math.abs(o/2*Math.sin(c))+Math.abs(a/2*Math.cos(c)),f=1/Math.max(Math.abs(s),Math.abs(r));return d*=s*f,h*=r*f,d+=e.offset*s,h+=e.offset*r,{x:i.x+d,y:i.y+h}}function K1(n,e){var t,i,s,r;for(t=n.length-1;t>=0;--t)for(s=n[t].$layout,i=t-1;i>=0&&s._visible;--i)r=n[i].$layout,r._visible&&s._box.intersects(r._box)&&e(s,r);return n}function q1(n){var e,t,i,s,r,o,a;for(e=0,t=n.length;e<t;++e)i=n[e],s=i.$layout,s._visible&&(a=new Proxy(i._el,{get:(c,d)=>c.getProps([d],!0)[d]}),r=i.geometry(),o=Mf(a,i.model(),r),s._box.update(o,r,i.rotation()));return K1(n,function(c,d){var h=c._hidable,f=d._hidable;h&&f||f?d._visible=!1:h&&(c._visible=!1)})}var Ns={prepare:function(n){var e=[],t,i,s,r,o;for(t=0,s=n.length;t<s;++t)for(i=0,r=n[t].length;i<r;++i)o=n[t][i],e.push(o),o.$layout={_box:new Of,_hidable:!1,_visible:!0,_set:t,_idx:o._index};return e.sort(function(a,c){var d=a.$layout,h=c.$layout;return d._idx===h._idx?h._set-d._set:h._idx-d._idx}),this.update(e),e},update:function(n){var e=!1,t,i,s,r,o;for(t=0,i=n.length;t<i;++t)s=n[t],r=s.model(),o=s.$layout,o._hidable=r&&r.display==="auto",o._visible=s.visible(),e|=o._hidable;e&&q1(n)},lookup:function(n,e){var t,i;for(t=n.length-1;t>=0;--t)if(i=n[t].$layout,i&&i._visible&&i._box.contains(e))return n[t];return null},draw:function(n,e){var t,i,s,r,o,a;for(t=0,i=e.length;t<i;++t)s=e[t],r=s.$layout,r._visible&&(o=s.geometry(),a=Mf(s._el,s.model(),o),r._box.update(a,o,s.rotation()),s.draw(n,a))}},X1=function(n){if(J(n))return null;var e=n,t,i,s;if(K(n))if(!J(n.label))e=n.label;else if(!J(n.r))e=n.r;else for(e="",t=Object.keys(n),s=0,i=t.length;s<i;++s)e+=(s!==0?", ":"")+t[s]+": "+n[t[s]];return""+e},Z1={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:X1,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},je="$datalabels",Ef="$default";function J1(n,e){var t=n.datalabels,i={},s=[],r,o;return t===!1?null:(t===!0&&(t={}),e=qe({},[e,t]),r=e.labels||{},o=Object.keys(r),delete e.labels,o.length?o.forEach(function(a){r[a]&&s.push(qe({},[e,r[a],{_key:a}]))}):s.push(e),i=s.reduce(function(a,c){return ie(c.listeners||{},function(d,h){a[h]=a[h]||{},a[h][c._key||Ef]=d}),delete c.listeners,a},{}),{labels:s,listeners:i})}function vc(n,e,t,i){if(!!e){var s=t.$context,r=t.$groups,o;!e[r._set]||(o=e[r._set][r._key],!!o&&ne(o,[s,i])===!0&&(n[je]._dirty=!0,t.update(s)))}}function Q1(n,e,t,i,s){var r,o;!t&&!i||(t?i?t!==i&&(o=r=!0):o=!0:r=!0,o&&vc(n,e.leave,t,s),r&&vc(n,e.enter,i,s))}function eC(n,e){var t=n[je],i=t._listeners,s,r;if(!(!i.enter&&!i.leave)){if(e.type==="mousemove")r=Ns.lookup(t._labels,e);else if(e.type!=="mouseout")return;s=t._hovered,t._hovered=r,Q1(n,i,s,r,e)}}function tC(n,e){var t=n[je],i=t._listeners.click,s=i&&Ns.lookup(t._labels,e);s&&vc(n,i,s,e)}var No={id:"datalabels",defaults:Z1,beforeInit:function(n){n[je]={_actives:[]}},beforeUpdate:function(n){var e=n[je];e._listened=!1,e._listeners={},e._datasets=[],e._labels=[]},afterDatasetUpdate:function(n,e,t){var i=e.index,s=n[je],r=s._datasets[i]=[],o=n.isDatasetVisible(i),a=n.data.datasets[i],c=J1(a,t),d=e.meta.data||[],h=n.ctx,f,y,g,m,v,x,_,S;for(h.save(),f=0,g=d.length;f<g;++f)if(_=d[f],_[je]=[],o&&_&&n.getDataVisibility(f)&&!_.skip)for(y=0,m=c.labels.length;y<m;++y)v=c.labels[y],x=v._key,S=new Df(v,h,_,f),S.$groups={_set:i,_key:x||Ef},S.$context={active:!1,chart:n,dataIndex:f,dataset:a,datasetIndex:i},S.update(S.$context),_[je].push(S),r.push(S);h.restore(),qe(s._listeners,c.listeners,{merger:function(k,D,T){D[k]=D[k]||{},D[k][e.index]=T[k],s._listened=!0}})},afterUpdate:function(n){n[je]._labels=Ns.prepare(n[je]._datasets)},afterDatasetsDraw:function(n){Ns.draw(n,n[je]._labels)},beforeEvent:function(n,e){if(n[je]._listened){var t=e.event;switch(t.type){case"mousemove":case"mouseout":eC(n,t);break;case"click":tC(n,t);break}}},afterEvent:function(n){var e=n[je],t=e._actives,i=e._actives=n.getActiveElements(),s=As.arrayDiff(t,i),r,o,a,c,d,h,f;for(r=0,o=s.length;r<o;++r)if(d=s[r],d[1])for(f=d[0].element[je]||[],a=0,c=f.length;a<c;++a)h=f[a],h.$context.active=d[1]===1,h.update(h.$context);(e._dirty||s.length)&&(Ns.update(e._labels),n.render()),delete e._dirty}};var Be=be(Te());var Nf="label";function Af(n,e){typeof n=="function"?n(e):n&&(n.current=e)}function nC(n,e){Object.assign(n.options,e)}function Rf(n,e){n.labels=e}function If(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Nf,i=[];n.datasets=e.map(s=>{let r=n.datasets.find(o=>o[t]===s[t]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function iC(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Nf,t={labels:[],datasets:[]};return Rf(t,n.labels),If(t,n.datasets,e),t}function sC(n,e){let{height:t=150,width:i=300,redraw:s=!1,datasetIdKey:r,type:o,data:a,options:c,plugins:d=[],fallbackContent:h,updateMode:f,...y}=n,g=(0,Be.useRef)(null),m=(0,Be.useRef)(),v=()=>{!g.current||(m.current=new Ne(g.current,{type:o,data:iC(a,r),options:c&&{...c},plugins:d}),Af(e,m.current))},x=()=>{Af(e,null),m.current&&(m.current.destroy(),m.current=null)};return(0,Be.useEffect)(()=>{!s&&m.current&&c&&nC(m.current,c)},[s,c]),(0,Be.useEffect)(()=>{!s&&m.current&&Rf(m.current.config.data,a.labels)},[s,a.labels]),(0,Be.useEffect)(()=>{!s&&m.current&&a.datasets&&If(m.current.config.data,a.datasets,r)},[s,a.datasets]),(0,Be.useEffect)(()=>{!m.current||(s?(x(),setTimeout(v)):m.current.update(f))},[s,c,a.labels,a.datasets,f]),(0,Be.useEffect)(()=>{!m.current||(x(),setTimeout(v))},[o]),(0,Be.useEffect)(()=>(v(),()=>x()),[]),Be.default.createElement("canvas",Object.assign({ref:g,role:"img",height:t,width:i},y),h)}var rC=(0,Be.forwardRef)(sC);function Lf(n,e){return Ne.register(e),(0,Be.forwardRef)((t,i)=>Be.default.createElement(rC,Object.assign({},t,{ref:i,type:n})))}var Ro=Lf("bar",$n);var xc=Lf("doughnut",Gt);var{Empty:oC}=window.antd,{memo:aC}=window.React,Ff=wp.data.select("getgenie").sidebar();Ne.register(Xt,gn,mt,To,Do,Ni,No);var Bf=aC(({data:n})=>{let e={responsive:!1,layout:{padding:{top:25,right:0,left:0,bottom:0}},plugins:{datalabels:{display:!0,color:"#7999D0",align:"end",rotation:270,anchor:"end",font:{size:"10"},formatter:function(s){if(s<1e3)return s;if(s>=1e3&&s<1e6)return+(s/1e3).toFixed(1)+"K";if(s>=1e6&&s<1e9)return+(s/1e6).toFixed(1)+"M";if(s>=1e9&&s<1e12)return+(s/1e9).toFixed(1)+"B";if(s>=1e12)return+(s/1e12).toFixed(1)+"T"}},legend:{display:!1}},scales:{x:{grid:{display:!1},ticks:{autoSkip:!0,maxRotation:0,minRotation:0}},y:{grid:{borderWidth:0},ticks:{callback:function(s){if(s<1e3)return s;if(s>=1e3&&s<1e6)return+(s/1e3).toFixed(1)+"K";if(s>=1e6&&s<1e9)return+(s/1e6).toFixed(1)+"M";if(s>=1e9&&s<1e12)return+(s/1e9).toFixed(1)+"B";if(s>=1e12)return+(s/1e12).toFixed(1)+"T"}}}}},i={labels:n.map(s=>s?.date),datasets:[{label:Ff.__("Volume","getgenie"),data:n.map(s=>s?.volume),backgroundColor:"#DBE7FD"}]};return n.length===0?React.createElement(oC,{description:Ff.__("No Search Volume Trend data found","getgenie"),className:"getgenie-chart empty"}):React.createElement(Ro,{className:"getgenie-chart",width:"298",height:"300",options:e,data:i})});var{Typography:lC}=window.antd,{Libs:cC}=window.getGenie.Components.Common,{useState:dC,useEffect:oP}=window.React,{ComposeComponents:uC}=window.getGenie.Components.Common.ReduxManager,zf=uC(({setInput:n,getInputs:e,sidebar:t})=>{let[i,s]=dC("searchVolTrend"),r=[{label:t.__("Search Vol. Trend","getgenie"),key:"searchVolTrend",children:React.createElement(Bf,{data:e.searchVolume?.chart?.searchVolTrend||[]})},{label:t.__("Google Trends","getgenie"),key:"googleTrend",children:React.createElement(Fu,{data:e.searchVolume?.keyword||""})}];return React.createElement("div",{className:"getgenie-seo-result-chart-container"},React.createElement(lC.Title,{level:5,className:"getgenie-title"},t.__("Overview Chart","getgenie")),React.createElement(cC.Navbar,{tabPaneList:r,activeKey:i,handleActiveKey:s,destroyInactiveTabPane:!1,className:"keyword-analysis-chart"}))},["setInput","getInputs","sidebar"]);var{Libs:dP}=window.getGenie.Components.Common;var{Libs:_c,Utilities:hC}=window.getGenie.Components.Common,{HandleFetch:fC,HandleResponse:pC}=window.getGenie.Components.Common.RequestManager,{ComposeComponents:gC}=window.getGenie.Components.Common.ReduxManager,{Typography:Io,Tooltip:mC,notification:hP}=window.antd,{useEffect:yC}=window.React,bC=new ke,Wf=gC(({getInputs:n,setInput:e,sidebar:t,setSidebar:i,limitUsage:s})=>{let r=n.relatedKeywords||[],o=n.customKeywords||[],a=Object.keys(t.statisticsData?.keywords||{});yC(()=>{if(t.analyzingSearchVolume){let g=(n.keyword||"").replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/g,"").toLowerCase();c(g,n.inputContext)}},[t.analyzingSearchVolume]);let c=(g,m)=>{let v={input:{keyword:g,context:m},location:n.seoCountry,templateSlug:"keyword-analysis"};fC(x=>{pC(x,()=>{let _=x?.data||[];e("relatedKeywords",_);let S=_.find(k=>(k?.keyword||"").trim()===g.trim());if(S){let k={...S,keyword:n.keyword||"",country:n.seoCountry||"usa"};e("searchVolume",k),hC.GenieHelpers.callStoreApi("keywordData",{searchVolume:k,relatedKeywords:_})}}),i({analyzingSearchVolume:!1})},"keywordsData",v)},d=(g,m)=>{let v=o;if(m)v=o.filter(x=>x.keyword!==g);else{let x=bC.findSingleMatch(t.currentPostContent,g);v=[...o,{keyword:g,usage:x}]}e("customKeywords",v)},h=g=>!!o?.find(m=>m?.keyword===g),f=g=>!a.find(m=>m===g)&&n.competitorData,y=g=>{let m=g?.searchVolume||{},{cpc:v,total:x="-"}=m,{currency:_="$",value:S=0}=v||{};return React.createElement("div",{className:"getgenie-data-column"},React.createElement(Io.Title,{className:"getgenie-data-value"},"CPC: ",_,parseFloat(S).toFixed(3)),React.createElement(Io.Title,{className:"getgenie-data-value"},"Search: ",x))};return React.createElement("div",{className:"getgenie-seo-result-related-keyword",style:{paddingBottom:n.peopleAlsoSearched?0:"150px"}},React.createElement(Io.Title,{level:5,className:"getgenie-title"},t.__("Related Keyword","getgenie")),t.analyzingSearchVolume?React.createElement("div",{style:{padding:"8px"}},React.createElement(_c.SkeletonSingle,{count:10})):React.createElement(React.Fragment,null,React.createElement("span",{className:"getgenie-related-keywords"},r.length),r.length===0?React.createElement(Io.Title,{level:5,className:"getgenie-not-found-title"},t.__("No related keyword found","getgenie")):React.createElement(_c.BlurElement,{show:s.subscription_type!=="pro",top:360,text:"Go Pro, Reveal Untapped Keywords!",btnText:"Upgrade for Success",href:"https://getgenie.ai/pricing/"},React.createElement(_c.Card,{list:r,column:1},(g,m)=>{let v=h(g?.keyword),x=v?"getgenie-icon-minus remove":"getgenie-icon-plus add",_=f(g?.keyword);return React.createElement("div",{className:"getgenie-data-container"},_?React.createElement(mC,{title:t.__("Add/remove this keyword for SEO analysis","getgenie"),placement:"topLeft"},React.createElement("span",{className:`getgenie-related-keyword-card-button ${x}`,onClick:()=>d(g?.keyword,v)})):"",React.createElement("h5",{className:"getgenie-data-title"},g?.keyword),y(g))}))))},["getInputs","sidebar","setInput","setSidebar","limitUsage"]);var{Libs:wC}=window.getGenie.Components.Common,{ComposeComponents:vC}=window.getGenie.Components.Common.ReduxManager,{Typography:xC,Tooltip:_C}=window.antd,SC=new ke,Hf=vC(({getInputs:n,sidebar:e,setInput:t})=>{let i=n.customKeywords||[],s=Object.keys(e.statisticsData?.keywords||{}),r=n.peopleAlsoSearched;if(!r)return"";r=r.map(h=>({...h,keyword:h?.title}));let o=r.findIndex(h=>h?.title&&h?.title.toLowerCase()==="see more");o!==-1&&(r=r.slice(o+1,r.length));let a=(h,f)=>{if(!h)return;let y=i;if(f)y=i.filter(g=>g.keyword!==h);else{let g=SC.findSingleMatch(e.currentPostContent,h);y=[...i,{keyword:h,usage:g}]}t("customKeywords",y)},c=h=>!!i?.find(f=>f?.keyword===h),d=h=>!s.find(f=>f===h)&&n.competitorData;return React.createElement("div",{className:"getgenie-seo-result-related-keyword getgenie-seo-result-people-also-searched-keyword"},React.createElement(xC.Title,{level:5,className:"getgenie-title"},e.__("People also searched for","getgenie")),React.createElement("span",{className:"getgenie-related-keywords"},r.length),React.createElement(wC.Card,{list:r,column:1},h=>{let f=c(h?.keyword),y=f?"getgenie-icon-minus remove":"getgenie-icon-plus add",g=d(h?.keyword);return React.createElement("div",{className:"getgenie-data-container"},g?React.createElement(_C,{title:e.__("Add/remove this keyword for SEO analysis","getgenie"),placement:"topLeft"},React.createElement("span",{className:`getgenie-related-keyword-card-button ${y}`,onClick:()=>a(h?.keyword,f)})):"",React.createElement("h5",{className:"getgenie-data-title"},typeof h=="string"?h:h?.title))}))},["getInputs","sidebar","setSidebar","setInput"]);var{ComposeComponents:kC}=window.getGenie.Components.Common.ReduxManager,{Libs:CC}=window.getGenie.Components.Common,{useEffect:TC}=window.React,DC=new ke,Yf=kC(({sidebar:n,setInput:e,getInputs:t})=>{let i=t.customKeywords||[];return TC(()=>{let s=i.map(r=>{let o=DC.findSingleMatch(n.currentPostContent,r?.keyword);return{...r,usage:o}});e("customKeywords",s)},[n.currentPostContent]),React.createElement(React.Fragment,null,n.analyzingSearchVolume?React.createElement(CC.SkeletonCard,{count:2}):React.createElement("div",{style:{backgroundColor:"#fff",paddingBottom:"10px"}}," ",React.createElement(Iu,null),React.createElement(zf,null)),React.createElement(Wf,null),React.createElement(Hf,null))},["sidebar","getInputs","setInput"]);var{Checkbox:OC,Typography:MC,Tooltip:Sc,Button:EC}=window.antd,{Utilities:PC,Libs:AC}=window.getGenie.Components.Common,{GenieHelpers:NC}=PC,{ComposeComponents:RC}=window.getGenie.Components.Common.ReduxManager,{useState:Vf}=window.React,jf=RC(({loading:n,loadingText:e,setInput:t,fetchData:i,getInputs:s,sidebar:r})=>{let o=s.questionsAsked,a=s.selectedOutlines||[],[c,d]=Vf(""),[h,f]=Vf(""),y=(v,x)=>{if(r.currentScreen!=="outlineScreen")return;let _=[...a];_.indexOf(x)!=-1?_.splice(_.indexOf(x),1):_.push(x),t("selectedOutlines",_)},g=(v,x)=>{if(v.stopPropagation(),h!==x){if(window.getGenie.config.isBlockEditor){let _=wp.data.select("core/block-editor"),S=_.getBlocks(),k=_.getSelectedBlockClientId(),D=S.findIndex(T=>T.clientId===k);wp.data.dispatch("core/block-editor").insertBlocks(wp.blocks.createBlock("core/heading",{content:x}),D+1),f(x)}if(document.getElementById("post-body-content")){let _=document.getElementById("content_ifr"),S=_.contentDocument||_.contentWindow.document,k=S.getSelection().focusNode?.parentElement,D=S.createElement("h2");D.textContent=x,k.parentNode.insertBefore(D,k.nextSibling),f(x)}if(document.querySelector("#web-view-editor .ql-editor")){let _=document.querySelector("#web-view-editor .ql-editor"),S=document.createElement("h2");S.textContent=x,_.appendChild(S),f(x)}}},m=(v,x)=>{v.stopPropagation();let _=x.replace(/<br\s*\/?>/gi,`
`);NC.copyToClipboard(_).then(()=>{d(x)}).catch(()=>console.log("error"))};return React.createElement(React.Fragment,null,n?React.createElement("h5",{className:"getgenie-loading-state"},React.createElement("span",null,e),React.createElement(AC.Loading,{size:25})," "):o?"":React.createElement(EC,{className:"getgenie-fetch-competitor-btn",onClick:i},r.__("Fetch Data","getgenie")),React.createElement("div",{className:"getgenie-questions-tab"},React.createElement("div",{className:`getgenie-checkbox ${r.currentScreen==="outlineScreen"?"":"disable"}`},o?o?.length===0?React.createElement(MC.Title,{level:5,className:"getgenie-not-found-title"},r.__("No questions are found.","getgenie")):o?.map((v,x)=>{let _=(v?.title||"").replace(/[0-9]/g,"");return React.createElement("div",{key:x,className:`getgenie-checkbox-container${a.indexOf(_)!=-1?" active":""}`},React.createElement("div",{className:"actions"},React.createElement("div",{className:"copy"},React.createElement(Sc,{placement:"bottom",zIndex:9999,title:c===_?"Copied":"Copy this content"},React.createElement("span",{className:"copy-icon getgenie-icon-copy",onClick:S=>m(S,_)}))),React.createElement("div",{className:"insert"},React.createElement(Sc,{title:h!==_?"Insert into the editor":"Already inserted",placement:"bottom",zIndex:9999},React.createElement("span",{className:`insert-icon ${h===_?"getgenie-icon-check":"getgenie-icon-insert"}`,onClick:S=>g(S,_)}))),React.createElement("div",{className:"link"},React.createElement(Sc,{title:"Go to the link",placement:"bottom",zIndex:9999},React.createElement("a",{target:"_blank",href:v?.url},React.createElement("span",{className:"link-icon getgenie-icon-link"}))))),React.createElement(OC,{checked:a.indexOf(v.title)>-1,onChange:S=>y(S,v.title)},React.createElement("h4",{className:"question-title"},_)))}):"")))},["setInput","getInputs","sidebar"]);var yt=Object.create(null);yt.open="0";yt.close="1";yt.ping="2";yt.pong="3";yt.message="4";yt.upgrade="5";yt.noop="6";var Rs=Object.create(null);Object.keys(yt).forEach(n=>{Rs[yt[n]]=n});var Uf={type:"error",data:"parser error"};var IC=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",LC=typeof ArrayBuffer=="function",FC=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,BC=({type:n,data:e},t,i)=>IC&&e instanceof Blob?t?i(e):$f(e,i):LC&&(e instanceof ArrayBuffer||FC(e))?t?i(e):$f(new Blob([e]),i):i(yt[n]+(e||"")),$f=(n,e)=>{let t=new FileReader;return t.onload=function(){let i=t.result.split(",")[1];e("b"+i)},t.readAsDataURL(n)},Lo=BC;var Gf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Is=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<Gf.length;n++)Is[Gf.charCodeAt(n)]=n;var Kf=n=>{let e=n.length*.75,t=n.length,i,s=0,r,o,a,c;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);let d=new ArrayBuffer(e),h=new Uint8Array(d);for(i=0;i<t;i+=4)r=Is[n.charCodeAt(i)],o=Is[n.charCodeAt(i+1)],a=Is[n.charCodeAt(i+2)],c=Is[n.charCodeAt(i+3)],h[s++]=r<<2|o>>4,h[s++]=(o&15)<<4|a>>2,h[s++]=(a&3)<<6|c&63;return d};var zC=typeof ArrayBuffer=="function",WC=(n,e)=>{if(typeof n!="string")return{type:"message",data:qf(n,e)};let t=n.charAt(0);return t==="b"?{type:"message",data:HC(n.substring(1),e)}:Rs[t]?n.length>1?{type:Rs[t],data:n.substring(1)}:{type:Rs[t]}:Uf},HC=(n,e)=>{if(zC){let t=Kf(n);return qf(t,e)}else return{base64:!0,data:n}},qf=(n,e)=>{switch(e){case"blob":return n instanceof ArrayBuffer?new Blob([n]):n;case"arraybuffer":default:return n}},Fo=WC;var Xf=String.fromCharCode(30),Zf=(n,e)=>{let t=n.length,i=new Array(t),s=0;n.forEach((r,o)=>{Lo(r,!1,a=>{i[o]=a,++s===t&&e(i.join(Xf))})})},Jf=(n,e)=>{let t=n.split(Xf),i=[];for(let s=0;s<t.length;s++){let r=Fo(t[s],e);if(i.push(r),r.type==="error")break}return i},kc=4;function fe(n){if(n)return YC(n)}function YC(n){for(var e in fe.prototype)n[e]=fe.prototype[e];return n}fe.prototype.on=fe.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};fe.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};fe.prototype.off=fe.prototype.removeListener=fe.prototype.removeAllListeners=fe.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var i,s=0;s<t.length;s++)if(i=t[s],i===e||i.fn===e){t.splice(s,1);break}return t.length===0&&delete this._callbacks["$"+n],this};fe.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(t){t=t.slice(0);for(var i=0,s=t.length;i<s;++i)t[i].apply(this,e)}return this};fe.prototype.emitReserved=fe.prototype.emit;fe.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};fe.prototype.hasListeners=function(n){return!!this.listeners(n).length};var at=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function Bo(n,...e){return e.reduce((t,i)=>(n.hasOwnProperty(i)&&(t[i]=n[i]),t),{})}var VC=setTimeout,jC=clearTimeout;function Jt(n,e){e.useNativeTimers?(n.setTimeoutFn=VC.bind(at),n.clearTimeoutFn=jC.bind(at)):(n.setTimeoutFn=setTimeout.bind(at),n.clearTimeoutFn=clearTimeout.bind(at))}var UC=1.33;function Qf(n){return typeof n=="string"?$C(n):Math.ceil((n.byteLength||n.size)*UC)}function $C(n){let e=0,t=0;for(let i=0,s=n.length;i<s;i++)e=n.charCodeAt(i),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(i++,t+=4);return t}var Cc=class extends Error{constructor(e,t,i){super(e),this.description=t,this.context=i,this.type="TransportError"}},Kn=class extends fe{constructor(e){super(),this.writable=!1,Jt(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,t,i){return super.emitReserved("error",new Cc(e,t,i)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=Fo(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}};var ip="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Tc=64,GC={},ep=0,zo=0,tp;function np(n){let e="";do e=ip[n%Tc]+e,n=Math.floor(n/Tc);while(n>0);return e}function Wo(){let n=np(+new Date);return n!==tp?(ep=0,tp=n):n+"."+np(ep++)}for(;zo<Tc;zo++)GC[ip[zo]]=zo;function Ho(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function sp(n){let e={},t=n.split("&");for(let i=0,s=t.length;i<s;i++){let r=t[i].split("=");e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e}var rp=!1;try{rp=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var op=rp;function Dc(n){let e=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||op))return new XMLHttpRequest}catch{}if(!e)try{return new at[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function KC(){}var qC=function(){return new Dc({xdomain:!1}).responseType!=null}(),Yo=class extends Kn{constructor(e){if(super(e),this.polling=!1,typeof location<"u"){let i=location.protocol==="https:",s=location.port;s||(s=i?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port,this.xs=e.secure!==i}let t=e&&e.forceBase64;this.supportsBinary=qC&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";let t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let i=0;this.polling&&(i++,this.once("pollComplete",function(){--i||t()})),this.writable||(i++,this.once("drain",function(){--i||t()}))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let t=i=>{if(this.readyState==="opening"&&i.type==="open"&&this.onOpen(),i.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(i)};Jf(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){let e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Zf(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.query||{},t=this.opts.secure?"https":"http",i="";this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=Wo()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.opts.port&&(t==="https"&&Number(this.opts.port)!==443||t==="http"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port);let s=Ho(e),r=this.opts.hostname.indexOf(":")!==-1;return t+"://"+(r?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(s.length?"?"+s:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new lt(this.uri(),e)}doWrite(e,t){let i=this.request({method:"POST",data:e});i.on("success",t),i.on("error",(s,r)=>{this.onError("xhr post error",s,r)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,i)=>{this.onError("xhr poll error",t,i)}),this.pollXhr=e}},lt=class extends fe{constructor(e,t){super(),Jt(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=t.async!==!1,this.data=t.data!==void 0?t.data:null,this.create()}create(){let e=Bo(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;let t=this.xhr=new Dc(e);try{t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&t.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{t.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{t.readyState===4&&(t.status===200||t.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof t.status=="number"?t.status:0)},0))},t.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=lt.requestsCount++,lt.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=KC,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete lt.requests[this.index],this.xhr=null}}onLoad(){let e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};lt.requestsCount=0;lt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ap);else if(typeof addEventListener=="function"){let n="onpagehide"in at?"pagehide":"unload";addEventListener(n,ap,!1)}}function ap(){for(let n in lt.requests)lt.requests.hasOwnProperty(n)&&lt.requests[n].abort()}var lp=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0))(),Ls=at.WebSocket||at.MozWebSocket,Vo=!0,cp="arraybuffer";var dp=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",jo=class extends Kn{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;let e=this.uri(),t=this.opts.protocols,i=dp?{}:Bo(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=Vo&&!dp?t?new Ls(e,t):new Ls(e):new Ls(e,t,i)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType||cp,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let i=e[t],s=t===e.length-1;Lo(i,this.supportsBinary,r=>{let o={};Vo||(i.options&&(o.compress=i.options.compress),this.opts.perMessageDeflate&&(typeof r=="string"?Buffer.byteLength(r):r.length)<this.opts.perMessageDeflate.threshold&&(o.compress=!1));try{Vo?this.ws.send(r):this.ws.send(r,o)}catch{}s&&lp(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{},t=this.opts.secure?"wss":"ws",i="";this.opts.port&&(t==="wss"&&Number(this.opts.port)!==443||t==="ws"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=Wo()),this.supportsBinary||(e.b64=1);let s=Ho(e),r=this.opts.hostname.indexOf(":")!==-1;return t+"://"+(r?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(s.length?"?"+s:"")}check(){return!!Ls}};var Oc={websocket:jo,polling:Yo};var XC=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ZC=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ri(n){let e=n,t=n.indexOf("["),i=n.indexOf("]");t!=-1&&i!=-1&&(n=n.substring(0,t)+n.substring(t,i).replace(/:/g,";")+n.substring(i,n.length));let s=XC.exec(n||""),r={},o=14;for(;o--;)r[ZC[o]]=s[o]||"";return t!=-1&&i!=-1&&(r.source=e,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r.pathNames=JC(r,r.path),r.queryKey=QC(r,r.query),r}function JC(n,e){let t=/\/{2,9}/g,i=e.replace(t,"/").split("/");return(e.substr(0,1)=="/"||e.length===0)&&i.splice(0,1),e.substr(e.length-1,1)=="/"&&i.splice(i.length-1,1),i}function QC(n,e){let t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,s,r){s&&(t[s]=r)}),t}var Ze=class extends fe{constructor(e,t={}){super(),e&&typeof e=="object"&&(t=e,e=null),e?(e=Ri(e),t.hostname=e.host,t.secure=e.protocol==="https"||e.protocol==="wss",t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=Ri(t.host).host),Jt(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=sp(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},!1),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=kc,t.transport=e,this.id&&(t.sid=this.id);let i=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new Oc[e](i)}open(){let e;if(this.opts.rememberUpgrade&&Ze.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",t=>this.onClose("transport close",t))}probe(e){let t=this.createTransport(e),i=!1;Ze.priorWebsocketSuccess=!1;let s=()=>{i||(t.send([{type:"ping",data:"probe"}]),t.once("packet",f=>{if(!i)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;Ze.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{i||this.readyState!=="closed"&&(h(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{let y=new Error("probe error");y.transport=t.name,this.emitReserved("upgradeError",y)}}))};function r(){i||(i=!0,h(),t.close(),t=null)}let o=f=>{let y=new Error("probe error: "+f);y.transport=t.name,r(),this.emitReserved("upgradeError",y)};function a(){o("transport closed")}function c(){o("socket closed")}function d(f){t&&f.name!==t.name&&r()}let h=()=>{t.removeListener("open",s),t.removeListener("error",o),t.removeListener("close",a),this.off("close",c),this.off("upgrading",d)};t.once("open",s),t.once("error",o),t.once("close",a),this.once("close",c),this.once("upgrading",d),t.open()}onOpen(){if(this.readyState="open",Ze.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let e=0,t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":let t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let i=0;i<this.writeBuffer.length;i++){let s=this.writeBuffer[i].data;if(s&&(t+=Qf(s)),i>0&&t>this.maxPayload)return this.writeBuffer.slice(0,i);t+=2}return this.writeBuffer}write(e,t,i){return this.sendPacket("message",e,t,i),this}send(e,t,i){return this.sendPacket("message",e,t,i),this}sendPacket(e,t,i,s){if(typeof t=="function"&&(s=t,t=void 0),typeof i=="function"&&(s=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;let r={type:e,data:t,options:i};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),s&&this.once("flush",s),this.flush()}close(){let e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},i=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():e()}):this.upgrading?i():e()),this}onError(e){Ze.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){let t=[],i=0,s=e.length;for(;i<s;i++)~this.transports.indexOf(e[i])&&t.push(e[i]);return t}};Ze.protocol=kc;var OA=Ze.protocol;function up(n,e="",t){let i=n;t=t||typeof location<"u"&&location,n==null&&(n=t.protocol+"//"+t.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=t.protocol+n:n=t.host+n),/^(https?|wss?):\/\//.test(n)||(typeof t<"u"?n=t.protocol+"//"+n:n="https://"+n),i=Ri(n)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";let r=i.host.indexOf(":")!==-1?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+r+":"+i.port+e,i.href=i.protocol+"://"+r+(t&&t.port===i.port?"":":"+i.port),i}var Nc={};ui(Nc,{Decoder:()=>zs,Encoder:()=>Pc,PacketType:()=>Q,protocol:()=>gp});var eT=typeof ArrayBuffer=="function",tT=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,hp=Object.prototype.toString,nT=typeof Blob=="function"||typeof Blob<"u"&&hp.call(Blob)==="[object BlobConstructor]",iT=typeof File=="function"||typeof File<"u"&&hp.call(File)==="[object FileConstructor]";function Bs(n){return eT&&(n instanceof ArrayBuffer||tT(n))||nT&&n instanceof Blob||iT&&n instanceof File}function Fs(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,i=n.length;t<i;t++)if(Fs(n[t]))return!0;return!1}if(Bs(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return Fs(n.toJSON(),!0);for(let t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&Fs(n[t]))return!0;return!1}function fp(n){let e=[],t=n.data,i=n;return i.data=Mc(t,e),i.attachments=e.length,{packet:i,buffers:e}}function Mc(n,e){if(!n)return n;if(Bs(n)){let t={_placeholder:!0,num:e.length};return e.push(n),t}else if(Array.isArray(n)){let t=new Array(n.length);for(let i=0;i<n.length;i++)t[i]=Mc(n[i],e);return t}else if(typeof n=="object"&&!(n instanceof Date)){let t={};for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=Mc(n[i],e));return t}return n}function pp(n,e){return n.data=Ec(n.data,e),n.attachments=void 0,n}function Ec(n,e){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<e.length)return e[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let t=0;t<n.length;t++)n[t]=Ec(n[t],e);else if(typeof n=="object")for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(n[t]=Ec(n[t],e));return n}var gp=5,Q;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(Q||(Q={}));var Pc=class{constructor(e){this.replacer=e}encode(e){return(e.type===Q.EVENT||e.type===Q.ACK)&&Fs(e)?(e.type=e.type===Q.EVENT?Q.BINARY_EVENT:Q.BINARY_ACK,this.encodeAsBinary(e)):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===Q.BINARY_EVENT||e.type===Q.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=fp(e),i=this.encodeAsString(t.packet),s=t.buffers;return s.unshift(i),s}},zs=class extends fe{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e),t.type===Q.BINARY_EVENT||t.type===Q.BINARY_ACK?(this.reconstructor=new Ac(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(Bs(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,i={type:Number(e.charAt(0))};if(Q[i.type]===void 0)throw new Error("unknown packet type "+i.type);if(i.type===Q.BINARY_EVENT||i.type===Q.BINARY_ACK){let r=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(r,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");i.attachments=Number(o)}if(e.charAt(t+1)==="/"){let r=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););i.nsp=e.substring(r,t)}else i.nsp="/";let s=e.charAt(t+1);if(s!==""&&Number(s)==s){let r=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}i.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){let r=this.tryParse(e.substr(t));if(zs.isPayloadValid(i.type,r))i.data=r;else throw new Error("invalid payload")}return i}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case Q.CONNECT:return typeof t=="object";case Q.DISCONNECT:return t===void 0;case Q.CONNECT_ERROR:return typeof t=="string"||typeof t=="object";case Q.EVENT:case Q.BINARY_EVENT:return Array.isArray(t)&&t.length>0;case Q.ACK:case Q.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}},Ac=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=pp(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function Je(n,e,t){return n.on(e,t),function(){n.off(e,t)}}var sT=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Ii=class extends fe{constructor(e,t,i){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,i&&i.auth&&(this.auth=i.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[Je(e,"open",this.onopen.bind(this)),Je(e,"packet",this.onpacket.bind(this)),Je(e,"error",this.onerror.bind(this)),Je(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(sT.hasOwnProperty(e))throw new Error('"'+e+'" is a reserved event name');t.unshift(e);let i={type:Q.EVENT,data:t};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){let o=this.ids++,a=t.pop();this._registerAckCallback(o,a),i.id=o}let s=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!s||!this.connected)||(this.connected?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(e,t){let i=this.flags.timeout;if(i===void 0){this.acks[e]=t;return}let s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let r=0;r<this.sendBuffer.length;r++)this.sendBuffer[r].id===e&&this.sendBuffer.splice(r,1);t.call(this,new Error("operation has timed out"))},i);this.acks[e]=(...r)=>{this.io.clearTimeoutFn(s),t.apply(this,[null,...r])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this.packet({type:Q.CONNECT,data:e})}):this.packet({type:Q.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Q.CONNECT:if(e.data&&e.data.sid){let s=e.data.sid;this.onconnect(s)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Q.EVENT:case Q.BINARY_EVENT:this.onevent(e);break;case Q.ACK:case Q.BINARY_ACK:this.onack(e);break;case Q.DISCONNECT:this.ondisconnect();break;case Q.CONNECT_ERROR:this.destroy();let i=new Error(e.data.message);i.data=e.data.data,this.emitReserved("connect_error",i);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let i of t)i.apply(this,e)}super.emit.apply(this,e)}ack(e){let t=this,i=!1;return function(...s){i||(i=!0,t.packet({type:Q.ACK,id:e,data:s}))}}onack(e){let t=this.acks[e.id];typeof t=="function"&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e){this.id=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Q.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let i=0;i<t.length;i++)if(e===t[i])return t.splice(i,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let i=0;i<t.length;i++)if(e===t[i])return t.splice(i,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let i of t)i.apply(this,e.data)}}};function qn(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}qn.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=(Math.floor(e*10)&1)==0?n-t:n+t}return Math.min(n,this.max)|0};qn.prototype.reset=function(){this.attempts=0};qn.prototype.setMin=function(n){this.ms=n};qn.prototype.setMax=function(n){this.max=n};qn.prototype.setJitter=function(n){this.jitter=n};var Li=class extends fe{constructor(e,t){var i;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,Jt(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((i=t.randomizationFactor)!==null&&i!==void 0?i:.5),this.backoff=new qn({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;let s=t.parser||Nc;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Ze(this.uri,this.opts);let t=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;let s=Je(t,"open",function(){i.onopen(),e&&e()}),r=Je(t,"error",o=>{i.cleanup(),i._readyState="closed",this.emitReserved("error",o),e?e(o):i.maybeReconnectOnOpen()});if(this._timeout!==!1){let o=this._timeout;o===0&&s();let a=this.setTimeoutFn(()=>{s(),t.close(),t.emit("error",new Error("timeout"))},o);this.opts.autoUnref&&a.unref(),this.subs.push(function(){clearTimeout(a)})}return this.subs.push(s),this.subs.push(r),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(Je(e,"ping",this.onping.bind(this)),Je(e,"data",this.ondata.bind(this)),Je(e,"error",this.onerror.bind(this)),Je(e,"close",this.onclose.bind(this)),Je(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){this.decoder.add(e)}ondecoded(e){this.emitReserved("packet",e)}onerror(e){this.emitReserved("error",e)}socket(e,t){let i=this.nsps[e];return i||(i=new Ii(this,e,t),this.nsps[e]=i),i}_destroy(e){let t=Object.keys(this.nsps);for(let i of t)if(this.nsps[i].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let i=0;i<t.length;i++)this.engine.write(t[i],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let i=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(s=>{s?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",s)):e.onreconnect()}))},t);this.opts.autoUnref&&i.unref(),this.subs.push(function(){clearTimeout(i)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};var Ws={};function Xn(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};let t=up(n,e.path||"/socket.io"),i=t.source,s=t.id,r=t.path,o=Ws[s]&&r in Ws[s].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o,c;return a?c=new Li(i,e):(Ws[s]||(Ws[s]=new Li(i,e)),c=Ws[s]),t.query&&!e.query&&(e.query=t.queryKey),c.socket(t.path,e)}Object.assign(Xn,{Manager:Li,Socket:Ii,io:Xn,connect:Xn});var Hs=class{constructor(e,t,i){this.ContentAnalysis=e,this.KeywordFinder=t,this.GenieHelpers=i}getDomainName(e){try{return new URL(e).hostname.split(".").slice(-2).join(".")}catch{return""}}saveCompetitor=e=>{this.GenieHelpers.callStoreApi("serpData",{competitorData:e})};getNlpKeywords=async(e,t,i,s)=>new Promise((r,o)=>{let a=window.getGenie.config,c={method:"POST",headers:{"Content-type":"application/json; charset=UTF-8","Site-Token":a?.siteToken||"","Auth-Token":a?.authToken||"","X-WP-Nonce":a?.restNonce||"","Plugin-Version":a?.version}};(async()=>{let d=i||[],h=[];for(let g of t){c.body=JSON.stringify({textContent:g?.textContent,requestId:g?.requestId});let v=await(await fetch(s,c)).json();for(let x of v?.data||[])h.push(x[0].toLowerCase())}h=[...new Set(h)],c.body=JSON.stringify({mainKeywords:i.length===0?[e]:i.map(g=>g?.keyword||"").slice(0,10),nlpKeywords:h});let f=await fetch(hi.filterNlpKeywordsUrl,c).catch(g=>r(d));if(!f.ok){r(d);return}let y=await f.json();try{let g=(y?.data||h)?.map(m=>({keyword:Array.isArray(m)?m[0]:m,type:"nlp"}));d=[...d,...g||[]],d=d.filter((m,v,x)=>v===x.findIndex(_=>_?.keyword===m?.keyword)),r(d)}catch(g){r(d),console.log(g)}})()});analyze=async(e,t)=>new Promise((i,s)=>{let r=[],o={},a={},c=new this.KeywordFinder,d=0,h=0,f=0,y=0;for(let m of e){let v=this.getDomainName(m?.url),_=new this.ContentAnalysis({content:m?.source,url:v,title:m?.title,description:m?.description},t).getStat(),S=c.findAllMatch(m?.source,Object.keys(t.keywords));a[m.keySlug]={url:m.url,title:m.title,rank:y,favicon:m.favicon};for(let D of S)!t.keywords?.[D.keyword]?.total||(o[D.keyword]?o[D.keyword].heatMap[m.keySlug]={matchedKeyPhrase:D.count}:o[D.keyword]={keyPhrase:D.keyword,recommendation:t.keywords?.[D.keyword]?.total,heatMap:{[m.keySlug]:{matchedKeyPhrase:D.count}}});if(y++,m.title==="myContent")continue;let k=parseFloat(_.contentStats.totalScore);r.push({url:m.url,statistics:_.statistics,score:parseInt(Math.ceil(k))||0}),h<k&&(h=parseInt(Math.ceil(k))||0),f+=k}d=Math.ceil(f/r.length-1),d=parseInt(d)||0;let g={headToHeadData:{serpDomains:a,statistics:o},analyzedCompetitors:r,avgScore:d,maxScore:h,firstCompetitorScore:r?.[1]?.score||0};i(g)})};var{useEffect:Ys,useState:Uo}=window.React,{HandleResponse:mp,EndPoints:rT}=window.getGenie.Components.Common.RequestManager,{ComposeComponents:oT}=window.getGenie.Components.Common.ReduxManager,{Libs:aT,Utilities:lT}=window.getGenie.Components.Common,{GenieHelpers:$o}=lT,Go=!1,yp=!1,cT=oT(({sidebar:n,getInputs:e,setInput:t,setSidebar:i})=>{let[s,r]=Uo(""),[o,a]=Uo(e.competitorData),[c,d]=Uo(getGenie.blogWizardData?.serpData?.pageCount||0),[h,f]=Uo(!1),y=e.seoDataTab||"keywords",g=e.searchVolume;Ys(()=>{h||r("")},[h]),Ys(()=>{e.competitorData?a(e.competitorData):(a(null),d(0))},[e.competitorData]),Ys(()=>{Object.keys(e.searchVolume||{})?.length&&n.component==="OutlineScreen"&&t("seoDataTab","competitor")},[e.generatedOutlines]),Ys(()=>{n.statisticsScreen.triggered&&!e.competitorData&&(t("seoDataTab","competitor"),x())},[n.statisticsScreen.triggered,e.competitorData]),Ys(()=>{e.searchVolume||t("seoDataTab","keywords"),r("")},[e.searchVolume]);let m=S=>new Promise(k=>{setTimeout(k,S)});async function v(){r(n.__("Getting competitor list ","getgenie")),await m(15e3),!e.questionsAsked&&!Go&&r(n.__("Fetching competitor websites ","getgenie"))}let x=()=>{let S=wp.data.select("getgenie").getInputs()?.competitorData;if(h)return;f(!0),i({analyzingCompetitors:!0}),v();let k=e.relatedKeywords||[],D=(e.peopleAlsoSearched||[]).map(Y=>Y.title);k=[...k,...D].map((Y,V)=>{let G=typeof Y=="string"?Y.toLowerCase():Y.keyword.toLowerCase(),le=(e.keyword||"").toLowerCase();G=G.trim(),le=le.trim();let re=G==le?"focus":"common";return{keyword:G,type:re}});let T=Xn(window.getGenie.config?.parserApi,{extraHeaders:{"Site-Token":window.getGenie.config?.siteToken,"Auth-Token":window.getGenie.config?.authToken,"Plugin-Version":window.getGenie.config?.version,"Plugin-Name":"getgenie"},query:{location:e.seoCountry,keyword:e.keyword,page:c},reconnection:!1});window.getGenie?.isPlayground&&(window.getGenie.socket=T),T.io.engine.on("close",Y=>{window.getGenie.webview?.isDocumentClicked&&(f(!1),i({analyzingCompetitors:!1}))});let O=new An,E=[],A=[],N=[...k],I,B=0,z=[];T.on("connect",()=>{T.on("DATASET_DETAIL",Y=>{z=z.map(V=>V?.datasetId===Y.datasetDetail.datasetId?{...V,offset:Y.datasetDetail.offset,rank:Y.datasetDetail.rank}:V)}),T.on("DATASETS",Y=>{z=Y}),T.emit("TRANSPORT_DATA",{datasetDetail:z,datasetLogs:{}}),T.on("COMPETITOR_LIST",Y=>{if(mp(Y,()=>{A=Y.data?.question||[],t("questionsAsked",[...e.questionsAsked||[],...A]),t("peopleAlsoSearched",Y.data?.peopleAlsoSearched),$o.callStoreApi("keywordData",{searchVolume:e.searchVolume,relatedKeywords:e.relatedKeywords,peopleAlsoSearched:Y.data?.peopleAlsoSearched})}),Y?.status==="fail"){r(""),f(!1),i({analyzingCompetitors:!1}),Go=!0;return}r(n.__("Analyzing and fetching data ","getgenie"))}),T.on("SCRAPED_URLS",Y=>{I&&clearTimeout(I),r(n.__("Analyzing and fetching data ","getgenie")),mp(Y,async()=>{let V=O.scrapping(Y.data,(e.keyword||"").trim());if(!!V&&!E.find(G=>G?.url===V?.url)){let G={...V,requestId:Y?.requestId,url:Y.data?.url,keySlug:Y.data?.keySlug};E.push(G),a([...o||[],...E]),$o.callStoreApi("serpData",{competitorData:[G]})}}),Y?.status==="fail"&&(Go=!0,f(!1),i({analyzingCompetitors:!1}))})});let L=["ping timeout","transport close","transport error"],F=0;T.on("disconnect",async Y=>{if(console.log(Y),L.includes(Y)&&F<4){z=z.sort((V,G)=>V?.offset-G?.offset),z=z.slice(-2),z=z.reduce((V,G)=>V.find(re=>re?.datasetId===G?.datasetId)?V:V.concat([G]),[]),F++,f(!0),i({analyzingCompetitors:!1}),T.connect();return}else yp=!1,z=[],window.getGenie?.isPlayground&&(window.getGenie.socket=null);if(E.length===0){f(!1);return}try{let V=[...S||[],...E];V=V.sort((le,re)=>le.rank-re.rank),V=V.reduce((le,re)=>le.find(De=>De.url===re.url)?le:le.concat([re]),[]);let G=c+1;if(!S){N=await new Hs(En,ke,$o).getNlpKeywords(e.keyword,V.slice(0,10),N,rT.nlpKeywordsUrl);let re=O.getStat(V,N);i({statisticsData:re,statisticsScreen:{loading:!1}}),$o.callStoreApi("serpData",{pageCount:G,questionsAsked:A,statisticsData:re})}t("competitorData",V),yp=!1,d(G),f(!1),r(""),i({analyzingCompetitors:!1})}catch(V){f(!1),console.log(V)}}),T.on("connect_error",()=>{console.log("error"),B++,B>2?(f(!1),r(""),Go=!0):(f(!0),T.connect())})},_=[{label:n.__("Keywords","getgenie"),key:"keywords",children:React.createElement(Yf,null)},{label:n.__("Competitor","getgenie"),key:"competitor",children:React.createElement(Pr,{loadingText:s,page:c,loading:h,data:o,fetchData:x}),disabled:!g},{label:n.__("Questions Asked","getgenie"),key:"questionsAsked",children:React.createElement(jf,{loadingText:s,loading:!e.questionsAsked&&h,fetchData:x}),disabled:!g}];return React.createElement("div",{className:"getgenie-seo-keyword-tab"},React.createElement("div",{className:"getgenie-seo-container"},React.createElement(aT.Navbar,{tabPaneList:_,activeKey:y,destroyInactiveTabPane:!1,handleActiveKey:S=>t("seoDataTab",S),className:"keyword-analysis-navbar"})))},["getInputs","sidebar","setInput","setSidebar"]),Rc=cT;var uT=({visible:n,width:e})=>React.createElement("div",{className:`getgenie-analyzeKeywordScreen ${n?"":"d-none"}`,style:{width:`${e}px`}},React.createElement("div",{className:"getgenie-empty-tag"}),React.createElement(Rc,null)),Ic=uT;var{Radio:bp}=window.antd,{ComposeComponents:hT}=window.getGenie.Components.Common.ReduxManager,yN=hT(({sidebar:n,navigation:e="title",setSidebar:t,getInputs:i})=>{let s={title:{title:"Title",screen:"TitleScreen",selected:!!i.generatedTitles},intro:{title:"Intro",screen:"IntroScreen",selected:!!i.generatedIntros},outline:{title:"Outline",screen:"OutlineScreen",selected:!!(i.selectedOutlines||i.generatedOutlines)}},r=o=>{let a=o.target,c=a.value,d=a.screen;if(!s[c].selected)return!1;t({component:d}),d!=="OutlineScreen"&&t({generatedOutlines:{...n.generatedOutlines,open:!1}})};return React.createElement("div",{className:"genie-nav-container"},React.createElement(bp.Group,{onChange:r,value:e},Object.keys(s).map((o,a)=>{let c=s[o];return React.createElement(bp.Button,{key:a,className:c.selected?"selected":"",value:o,screen:c.screen},c.title)})))},["sidebar","setSidebar","getInputs"]);var Aa={};ui(Aa,{BlogScreen:()=>Pm,OutlineScreen:()=>Ma,ParagraphGenerator:()=>Lm});var fT={countries:[{label:"Global",value:"global"},{label:"Australia",value:2036},{label:"Canada",value:2124},{label:"India",value:2356},{label:"New Zealand",value:2554},{label:"South Africa",value:2710},{label:"United States (USA)",value:2840},{label:"United Kingdom",value:2826},{label:"Germany",value:2276},{label:"Portugal",value:2620},{label:"Spain",value:2724},{label:"Vietnam",value:2704},{label:"Indonesia",value:2360},{label:"Malaysia",value:2458},{label:"South Korea",value:2410},{label:"Japan",value:2392},{label:"China",value:2156},{label:"Turkey",value:2792},{label:"Ukraine",value:2804},{label:"Italy",value:2380},{label:"France",value:2250},{label:"Poland",value:2616},{label:"Netherland",value:2528},{label:"Lithuania",value:2440},{label:"Hungary",value:2348},{label:"Denmark",value:2208},{label:"Czechia",value:2203},{label:"Thailand",value:2764},{label:"Latvia",value:2428},{label:"Slovakia",value:2703},{label:"Greece",value:2300},{label:"Sweden",value:2752},{label:"Saudi Arabia",value:2682},{label:"Russia",value:2643},{label:"Bulgaria",value:2100},{label:"Mexico",value:2484},{label:"Norway",value:2578},{label:"Pakistan",value:2586},{label:"Israel",value:2376}],languages:[{value:"en",label:"English"},{value:"es",label:"Spanish"},{value:"de",label:"German"}],outputSizes:[{label:"Small",value:"sm"},{label:"Medium",value:"md"},{label:"Large",value:"lg"}],maxToken:[{label:"Small",value:200},{label:"Medium",value:400},{label:"Large",value:1200}],chatCharacters:[{label:"Professional Writer",value:"professional-writer"},{label:"General Purpose",value:"general-purpose"},{label:"Standup Comedian",value:"standup-comedian"},{label:"Life Coach",value:"life-coach"},{label:"Career Counselor",value:"career-counselor"},{label:"Nutritionist",value:"nutritionist"},{label:"Product Manager",value:"product-manager"},{label:"Personal Trainer",value:"personal-trainer"},{label:"Life Hacker",value:"life-hacker"},{label:"Travel Advisor",value:"travel-advisor"},{label:"Mindfulness Coach",value:"mindfulness-coach"},{label:"Financial Advisor",value:"financial-advisor"},{label:"Language Tutor",value:"language-tutor"},{label:"Travel Guide",value:"travel-guide"},{label:"Marketing Expert",value:"marketing-expert"},{label:"Software Developer",value:"software-developer"},{label:"Dating Coach",value:"dating-coach"},{label:"DIY Expert",value:"diy-expert"},{label:"Journalist",value:"journalist"},{label:"Tech Writer",value:"tech-writer"},{label:"Pro Chef",value:"professional-chef"},{label:"Pro Salesperson",value:"professional-salesperson"},{label:"Startup Tech Lawyer",value:"startup-tech-lawyer"},{label:"Email Copywriter",value:"email-copywriter"}]},vp=fT;var{Row:xp,Col:Ko}=window.antd,{Libs:mn,Utilities:_p,PromotionalNotice:pT}=window.getGenie.Components.Common,{ComposeComponents:gT}=window.getGenie.Components.Common.ReduxManager,{useEffect:Sp}=window.React,mT=gT(({unsupportedLanguages:n,setSidebar:e,sidebar:t,getInputs:i,className:s="",language:r=!0,tone:o=!0,creativity:a=!0,result:c=!0,outputSize:d=!1})=>{if(!_p)return;let{GenieHelpers:h}=_p;Sp(()=>{h.storeData("creativity")},[i.creativity]),Sp(()=>{h.storeData("numberOfResult")},[i.numberOfResult]);let f=Object.values(window.getGenie.config?.templateAssets?.toneOfVoice||{});return f=f.map(y=>({label:y,value:y})),f=f.sort(),f=f.reverse(),React.createElement(React.Fragment,null,React.createElement(xp,{gutter:16,className:s},r&&React.createElement(Ko,{span:24},React.createElement(mn.Select,{handleOnChange:y=>h.saveSidebarControllerOption("getgenie-language",y),name:"selectedLanguage",except:n,label:React.createElement(React.Fragment,null,t.__("Language","getgenie"),React.createElement(mn.Tooltip,{title:t.__("Choose the desired language of your input and the outputs","getgenie"),placement:"top"})),options:t.languages,defaultValue:t.currentLanguage})),d&&React.createElement(Ko,{span:12},React.createElement(mn.Select,{handleOnChange:y=>h.saveSidebarControllerOption("getgenie-outputSize",y),name:"outputSize",label:React.createElement(React.Fragment,null,t.__("Output Size","getgenie"),React.createElement(mn.Tooltip,{title:t.__("Define what type of size you want the outputs to have","getgenie"),placement:"top"})),options:vp.outputSizes,defaultValue:t.outputSize}))),React.createElement(xp,{style:{marginTop:"10px"},gutter:16,className:s},a&&React.createElement(Ko,{span:12},React.createElement(mn.Slider,{name:"creativity",handleOnChange:y=>h.saveSidebarControllerOption("getgenie-creativity",y),label:React.createElement(React.Fragment,null,t.__("Creativity","getgenie")," ",React.createElement(mn.Tooltip,{title:t.__("How much creative you want genie to be","getgenie"),placement:"top"})),message:!1,defaultValue:t?.creativityLevel})),c&&React.createElement(Ko,{span:12},React.createElement(mn.NumberInput,{name:"numberOfResult",handleOnChange:y=>h.saveSidebarControllerOption("getgenie-numberOfResult",y),className:"ResultLimitNumberInput",max:6,type:"text",defaultValue:t?.numberOfResult,label:React.createElement(React.Fragment,null,t.__("Max Results","getgenie")," ",React.createElement(mn.Tooltip,{title:t.__("Maximum content you want to generate","getgenie"),placement:"top"})),required:!0,errorMessage:t.__("Please choose valid limit","getgenie")}))),React.createElement(pT,{type:"promotionalNotice",names:["word_generate"]}))},["sidebar","getInputs","setSidebar"]),Fi=mT;var{Libs:We,Utilities:yT,ContentFeedback:bT,StaticData:wT,PromotionalNotice:_N}=window.getGenie.Components.Common,{Form:vT,Divider:Lc,Button:SN}=window.antd,{GenieHelpers:yn}=yT,{ComposeComponents:xT}=window.getGenie.Components.Common.ReduxManager,{HandleFetch:_T,HandleResponse:ST}=window.getGenie.Components.Common.RequestManager,{useEffect:Bi,useState:Fc}=window.React,kT=xT(({sidebar:n,setSidebar:e,getInputs:t,setInput:i})=>{let[s,r]=Fc(wT.countries),[o,a]=Fc(!1),c=t.generatedTitles||[],d=t.seoEnabled||!1,[h,f]=Fc(!1),y=n.analyzingSearchVolume||n.analyzingRelatedKeyword;Bi(()=>{t.searchVolume||i("seoEnabled",!0)},[]),Bi(()=>{n.analyzeKeyword?.triggered&&t.keyword&&m()},[n.analyzeKeyword?.triggered]);let g=()=>{a(!0);let _={input:{keyword:(t.keyword||"").replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/g,""),context:t.inputContext},templateSlug:"blog-wizard-title"};i("generatedTitles",[]),_T(S=>{a(!1),ST(S,()=>{let k=S.data.map(D=>({title:D,like:!1,dislike:!1}));i("generatedTitles",k),yn.callStoreApi("generatedTitles",k)})},"writeTitle",_)},m=()=>{(t.keyword!==t.searchVolume?.keyword||t.seoCountry!==t.searchVolume?.country)&&(i("searchVolume",""),i("relatedKeywords",""),i("competitorData",""),i("questionsAsked",""),i("peopleAlsoSearched",""),yn.callStoreApi("serpData",{competitorData:"",pageCount:0,questionsAsked:"",statisticsData:"",restStatisticsKeyword:"",selectedKeywordList:"",nlpKeywordList:""}),e({statisticsData:"",analyzeKeyword:{open:!0,triggered:!1},analyzingSearchVolume:!0}))},v=(_,S)=>{i("selectedTitle",S.title)},x=()=>{e({component:"TemplateListScreen"})};return Bi(()=>{yn.storeData("keyword"),document.getElementsByClassName("block-editor__container").length&&wp.data.dispatch("core/editor").editPost({excerpt:" "})},[t.keyword]),Bi(()=>{yn.storeData("seoEnabled")},[t.seoEnabled]),Bi(()=>{yn.storeData("seoCountry")},[t.seoCountry]),Bi(()=>{yn.storeData("selectedTitle")},[t.selectedTitle]),React.createElement(React.Fragment,null,React.createElement("div",{className:"getgenie-title-form getgenie-wrapper-screen"},React.createElement(vT,{layout:"vertical",onFinish:g},React.createElement("div",{className:"getgenie-screen-content title"},React.createElement(We.Input,{name:"keyword",type:"text",label:React.createElement(React.Fragment,null,n.__("Keyword","getgenie"),React.createElement(We.Tooltip,{title:n.__("Enter the focus keyword or topic of your blog post.","getgenie"),placement:"top"})),placeholder:n.__("e.g. bean coffee, best coffee maker, how to make coffee, etc.","getgenie"),required:!0,errorMessage:n.__("Keyword is missing. Please enter keyword.","getgenie")}),React.createElement(We.Select,{handleOnChange:_=>yn.saveSidebarControllerOption("getgenie-language",_),name:"selectedLanguage",label:React.createElement(React.Fragment,null,n.__("Language","getgenie"),React.createElement(We.Tooltip,{title:n.__("Choose the desired language of your input and the outputs","getgenie"),placement:"top"})),options:n.languages,defaultValue:n.currentLanguage}),React.createElement(Lc,null),React.createElement(We.Switch,{label:React.createElement(React.Fragment,null,n.__("SEO Mode","getgenie"),React.createElement(We.Tooltip,{title:n.__("Turn on the SEO mode for better search engine optimization.","getgenie"),placement:"top"})),defaultChecked:d,name:"seoEnabled"}),d&&React.createElement(We.Select,{name:"seoCountry",handleOnChange:_=>yn.saveSidebarControllerOption("getgenie-seoCountry",_),loading:h,className:"seoCountry",options:s,defaultValue:n?.seoCountry}),d&&React.createElement(React.Fragment,null,React.createElement(We.Button,{onClick:m,className:"getgenie-analyze-btn",type:"primary",loading:y,disabled:!t.keyword},n.__("Analyze keyword","getgenie"))),React.createElement(Lc,null),React.createElement(We.Textarea,{label:React.createElement(React.Fragment,null,n.__("Context (Optional)","getgenie"),React.createElement(We.Tooltip,{title:n.__("Let the genie know the context of your blog post.","getgenie"),placement:"top"})),name:"inputContext",rows:4,placeholder:n.__("Enter a context for this keyword. e.g. a list of best selling coffee maker on amazon, step-by-step process to make coffee at home. etc.","getgenie"),errorMessage:n.__("Please enter the context here","getgenie")}),React.createElement(Lc,null),React.createElement(Fi,{language:!1,className:"getgenie-sidebar-controller-options"}),React.createElement(We.Button,{htmlType:"submit",className:"submit-btn",type:"primary",loading:o,disabled:!t.keyword},React.createElement("span",{className:"getgenie-icon-edit"}),n.__("Generate title","getgenie"))),React.createElement(We.TitleMsg,{list:c,loading:o,title:"title"}),React.createElement("div",{className:"getgenie-card-container getgenie-title-cards",style:{backgroundColor:c.length===0&&"transparent"}},React.createElement(We.Card,{showActiveItem:!0,value:t.selectedTitle,list:c,handleClick:v,column:1,skeleton:o?()=>React.createElement(We.SkeletonSingle,{count:10}):""},_=>React.createElement(React.Fragment,null,React.createElement("h5",{className:"generated-content"},_.title),React.createElement(bT,{content:_,input:t.keyword,contentType:"blogWizard-title",creativityLevel:t.creativity,listName:"generatedTitles"}))))),React.createElement(We.DrawerFooter,{handleNext:()=>i("writingScreen","introScreen"),handlePrev:x,enableNextBtn:!!c.find(_=>_.title===t.selectedTitle)})))},["setSidebar","getInputs","setInput","sidebar"]),kp=kT;var{Form:CT,Divider:TT}=window.antd,{ContentFeedback:DT,Libs:Qt,Utilities:OT}=window.getGenie.Components.Common,{HandleFetch:MT,HandleResponse:ET}=window.getGenie.Components.Common.RequestManager,{ComposeComponents:PT}=window.getGenie.Components.Common.ReduxManager,{useState:AT}=window.React,NT=PT(({getInputs:n,setInput:e,setSidebar:t,sidebar:i})=>{let[s,r]=AT(!1),o=n.generatedIntros||[],a=()=>{r(!0);let f={input:{keyword:n.keyword||"",title:n.selectedTitle,context:n.inputContext},templateSlug:"blog-wizard-intro"};e("generatedIntros",[]),MT(y=>{r(!1),ET(y,()=>{let g=y.data.map(m=>({title:m,like:!1,dislike:!1}));e("generatedIntros",g),OT.GenieHelpers.callStoreApi("generatedIntros",g)})},"writeIntro",f)},c=(f,y)=>{e("selectedIntro",y.title)},d=()=>{e("writingScreen","outlineScreen")},h=()=>{e("writingScreen","titleScreen"),t({generatedOutlines:{...i.generatedOutlines,open:!1}})};return React.createElement(React.Fragment,null,React.createElement("div",{className:"getgenie-title-form getgenie-wrapper-screen"},React.createElement(CT,{layout:"vertical",onFinish:a},React.createElement("div",{className:"getgenie-screen-content intro"},React.createElement(Qt.Collapse,{defaultActiveKey:["generated-content"],className:"getgenie-collapse"},React.createElement(Qt.Collapse.Panel,{header:React.createElement("div",{className:"getgenie-collapse-header"},React.createElement("span",{className:"getgenie-collapse-header-title"},"Title"),React.createElement(Qt.Tooltip,{title:i.__("Edit or change the blog post title","getgenie"),placement:"top"})," "),key:"generated-content"},React.createElement(Qt.Textarea,{name:"selectedTitle",type:"text",placeholder:i.__("Enter the blog post title here.","getgenie"),required:!0,errorMessage:i.__("Please enter the title here","getgenie")}))),React.createElement(TT,null),React.createElement(Fi,{className:"getgenie-sidebar-controller-options"}),React.createElement(Qt.Button,{htmlType:"submit",type:"primary",className:"submit-btn",loading:s},React.createElement("span",{className:"getgenie-icon-edit"}),i.__("Generate Intro","getgenie"))),React.createElement(Qt.TitleMsg,{list:o,loading:s,title:"intro"}),React.createElement("div",{className:"getgenie-card-container getgenie-title-cards",style:{backgroundColor:o.length===0&&"transparent"}},React.createElement(Qt.Card,{showActiveItem:!0,value:n.selectedIntro,list:o,handleClick:c,skeleton:s?()=>React.createElement(Qt.SkeletonSingle,{count:10}):""},f=>React.createElement(React.Fragment,null,React.createElement("h5",{className:"generated-content"},f.title),React.createElement(DT,{content:f,input:n.selectedTitle,contentType:"blogWizard-intro",creativityLevel:n.creativity,listName:"generatedIntros"}))))),React.createElement(Qt.DrawerFooter,{handleNext:d,handlePrev:h,enableNextBtn:!!o.find(f=>f.title===n.selectedIntro)})))},["getInputs","setInput","setSidebar","sidebar"]),Cp=NT;var Tp=be(Te(),1),qo=(0,Tp.createContext)({dragDropManager:void 0});var _g=be(Rp(),1);function ct(n){return"Minified Redux error #"+n+"; visit https://redux.js.org/Errors?code="+n+" for the full message or use the non-minified dev environment for full errors. "}var Ip=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),zc=function(){return Math.random().toString(36).substring(7).split("").join(".")},Lp={INIT:"@@redux/INIT"+zc(),REPLACE:"@@redux/REPLACE"+zc(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+zc()}};function VT(n){if(typeof n!="object"||n===null)return!1;for(var e=n;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(n)===e}function Wc(n,e,t){var i;if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(ct(0));if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(ct(1));return t(Wc)(n,e)}if(typeof n!="function")throw new Error(ct(2));var s=n,r=e,o=[],a=o,c=!1;function d(){a===o&&(a=o.slice())}function h(){if(c)throw new Error(ct(3));return r}function f(v){if(typeof v!="function")throw new Error(ct(4));if(c)throw new Error(ct(5));var x=!0;return d(),a.push(v),function(){if(!!x){if(c)throw new Error(ct(6));x=!1,d();var S=a.indexOf(v);a.splice(S,1),o=null}}}function y(v){if(!VT(v))throw new Error(ct(7));if(typeof v.type>"u")throw new Error(ct(8));if(c)throw new Error(ct(9));try{c=!0,r=s(r,v)}finally{c=!1}for(var x=o=a,_=0;_<x.length;_++){var S=x[_];S()}return v}function g(v){if(typeof v!="function")throw new Error(ct(10));s=v,y({type:Lp.REPLACE})}function m(){var v,x=f;return v={subscribe:function(S){if(typeof S!="object"||S===null)throw new Error(ct(11));function k(){S.next&&S.next(h())}k();var D=x(k);return{unsubscribe:D}}},v[Ip]=function(){return this},v}return y({type:Lp.INIT}),i={dispatch:y,subscribe:f,getState:h,replaceReducer:g},i[Ip]=m,i}function j(n,e,...t){if(jT()&&e===void 0)throw new Error("invariant requires an error message argument");if(!n){let i;if(e===void 0)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let s=0;i=new Error(e.replace(/%s/g,function(){return t[s++]})),i.name="Invariant Violation"}throw i.framesToPop=1,i}}function jT(){return typeof process<"u"&&!0}function Fp(n,e,t){return e.split(".").reduce((i,s)=>i&&i[s]?i[s]:t||null,n)}function Bp(n,e){return n.filter(t=>t!==e)}function Xo(n){return typeof n=="object"}function zp(n,e){let t=new Map,i=r=>{t.set(r,t.has(r)?t.get(r)+1:1)};n.forEach(i),e.forEach(i);let s=[];return t.forEach((r,o)=>{r===1&&s.push(o)}),s}function Wp(n,e){return n.filter(t=>e.indexOf(t)>-1)}var zi="dnd-core/INIT_COORDS",bn="dnd-core/BEGIN_DRAG",Wi="dnd-core/PUBLISH_DRAG_SOURCE",wn="dnd-core/HOVER",vn="dnd-core/DROP",xn="dnd-core/END_DRAG";function Hc(n,e){return{type:zi,payload:{sourceClientOffset:e||null,clientOffset:n||null}}}var UT={type:zi,payload:{clientOffset:null,sourceClientOffset:null}};function Hp(n){return function(t=[],i={publishSource:!0}){let{publishSource:s=!0,clientOffset:r,getSourceClientOffset:o}=i,a=n.getMonitor(),c=n.getRegistry();n.dispatch(Hc(r)),$T(t,a,c);let d=qT(t,a);if(d==null){n.dispatch(UT);return}let h=null;if(r){if(!o)throw new Error("getSourceClientOffset must be defined");GT(o),h=o(d)}n.dispatch(Hc(r,h));let y=c.getSource(d).beginDrag(a,d);if(y==null)return;KT(y),c.pinSource(d);let g=c.getSourceType(d);return{type:bn,payload:{itemType:g,item:y,sourceId:d,clientOffset:r||null,sourceClientOffset:h||null,isSourcePublic:!!s}}}}function $T(n,e,t){j(!e.isDragging(),"Cannot call beginDrag while dragging."),n.forEach(function(i){j(t.getSource(i),"Expected sourceIds to be registered.")})}function GT(n){j(typeof n=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function KT(n){j(Xo(n),"Item must be an object.")}function qT(n,e){let t=null;for(let i=n.length-1;i>=0;i--)if(e.canDragSource(n[i])){t=n[i];break}return t}function XT(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ZT(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable}))),i.forEach(function(s){XT(n,s,t[s])})}return n}function Yp(n){return function(t={}){let i=n.getMonitor(),s=n.getRegistry();JT(i),tD(i).forEach((o,a)=>{let c=QT(o,a,s,i),d={type:vn,payload:{dropResult:ZT({},t,c)}};n.dispatch(d)})}}function JT(n){j(n.isDragging(),"Cannot call drop while not dragging."),j(!n.didDrop(),"Cannot call drop twice during one drag operation.")}function QT(n,e,t,i){let s=t.getTarget(n),r=s?s.drop(i,n):void 0;return eD(r),typeof r>"u"&&(r=e===0?{}:i.getDropResult()),r}function eD(n){j(typeof n>"u"||Xo(n),"Drop result must either be an object or undefined.")}function tD(n){let e=n.getTargetIds().filter(n.canDropOnTarget,n);return e.reverse(),e}function Vp(n){return function(){let t=n.getMonitor(),i=n.getRegistry();nD(t);let s=t.getSourceId();return s!=null&&(i.getSource(s,!0).endDrag(t,s),i.unpinSource()),{type:xn}}}function nD(n){j(n.isDragging(),"Cannot call endDrag while not dragging.")}function js(n,e){return e===null?n===null:Array.isArray(n)?n.some(t=>t===e):n===e}function jp(n){return function(t,{clientOffset:i}={}){iD(t);let s=t.slice(0),r=n.getMonitor(),o=n.getRegistry(),a=r.getItemType();return rD(s,o,a),sD(s,r,o),oD(s,r,o),{type:wn,payload:{targetIds:s,clientOffset:i||null}}}}function iD(n){j(Array.isArray(n),"Expected targetIds to be an array.")}function sD(n,e,t){j(e.isDragging(),"Cannot call hover while not dragging."),j(!e.didDrop(),"Cannot call hover after drop.");for(let i=0;i<n.length;i++){let s=n[i];j(n.lastIndexOf(s)===i,"Expected targetIds to be unique in the passed array.");let r=t.getTarget(s);j(r,"Expected targetIds to be registered.")}}function rD(n,e,t){for(let i=n.length-1;i>=0;i--){let s=n[i],r=e.getTargetType(s);js(r,t)||n.splice(i,1)}}function oD(n,e,t){n.forEach(function(i){t.getTarget(i).hover(e,i)})}function Up(n){return function(){if(n.getMonitor().isDragging())return{type:Wi}}}function $p(n){return{beginDrag:Hp(n),publishDragSource:Up(n),hover:jp(n),drop:Yp(n),endDrag:Vp(n)}}var Zo=class{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){let e=this,{dispatch:t}=this.store;function i(r){return(...o)=>{let a=r.apply(e,o);typeof a<"u"&&t(a)}}let s=$p(this);return Object.keys(s).reduce((r,o)=>{let a=s[o];return r[o]=i(a),r},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{let i=this.store.getState().refCount>0;this.backend&&(i&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!i&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}};function aD(n,e){return{x:n.x+e.x,y:n.y+e.y}}function Gp(n,e){return{x:n.x-e.x,y:n.y-e.y}}function Kp(n){let{clientOffset:e,initialClientOffset:t,initialSourceClientOffset:i}=n;return!e||!t||!i?null:Gp(aD(e,i),t)}function qp(n){let{clientOffset:e,initialClientOffset:t}=n;return!e||!t?null:Gp(e,t)}var Hi=[],Jo=[];Hi.__IS_NONE__=!0;Jo.__IS_ALL__=!0;function Xp(n,e){return n===Hi?!1:n===Jo||typeof e>"u"?!0:Wp(e,n).length>0}var Qo=class{subscribeToStateChange(e,t={}){let{handlerIds:i}=t;j(typeof e=="function","listener must be a function."),j(typeof i>"u"||Array.isArray(i),"handlerIds, when specified, must be an array of strings.");let s=this.store.getState().stateId,r=()=>{let o=this.store.getState(),a=o.stateId;try{a===s||a===s+1&&!Xp(o.dirtyHandlerIds,i)||e()}finally{s=a}};return this.store.subscribe(r)}subscribeToOffsetChange(e){j(typeof e=="function","listener must be a function.");let t=this.store.getState().dragOffset,i=()=>{let s=this.store.getState().dragOffset;s!==t&&(t=s,e())};return this.store.subscribe(i)}canDragSource(e){if(!e)return!1;let t=this.registry.getSource(e);return j(t,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;let t=this.registry.getTarget(e);if(j(t,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;let i=this.registry.getTargetType(e),s=this.getItemType();return js(i,s)&&t.canDrop(this,e)}isDragging(){return Boolean(this.getItemType())}isDraggingSource(e){if(!e)return!1;let t=this.registry.getSource(e,!0);if(j(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;let i=this.registry.getSourceType(e),s=this.getItemType();return i!==s?!1:t.isDragging(this,e)}isOverTarget(e,t={shallow:!1}){if(!e)return!1;let{shallow:i}=t;if(!this.isDragging())return!1;let s=this.registry.getTargetType(e),r=this.getItemType();if(r&&!js(s,r))return!1;let o=this.getTargetIds();if(!o.length)return!1;let a=o.indexOf(e);return i?a===o.length-1:a>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Kp(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return qp(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}};var Zp=typeof global<"u"?global:self,Jp=Zp.MutationObserver||Zp.WebKitMutationObserver;function Yc(n){return function(){let t=setTimeout(s,0),i=setInterval(s,50);function s(){clearTimeout(t),clearInterval(i),n()}}}function lD(n){let e=1,t=new Jp(n),i=document.createTextNode("");return t.observe(i,{characterData:!0}),function(){e=-e,i.data=e}}var Qp=typeof Jp=="function"?lD:Yc;var ea=class{enqueueTask(e){let{queue:t,requestFlush:i}=this;t.length||(i(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{let{queue:e}=this;for(;this.index<e.length;){let t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let i=0,s=e.length-this.index;i<s;i++)e[i]=e[i+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=Qp(this.flush),this.requestErrorThrow=Yc(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}};var ta=class{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}};var na=class{create(e){let t=this.freeTasks,i=t.length?t.pop():new ta(this.onError,s=>t[t.length]=s);return i.task=e,i}constructor(e){this.onError=e,this.freeTasks=[]}};var eg=new ea,cD=new na(eg.registerPendingError);function tg(n){eg.enqueueTask(cD.create(n))}var Us="dnd-core/ADD_SOURCE",$s="dnd-core/ADD_TARGET",Gs="dnd-core/REMOVE_SOURCE",Zn="dnd-core/REMOVE_TARGET";function ng(n){return{type:Us,payload:{sourceId:n}}}function ig(n){return{type:$s,payload:{targetId:n}}}function sg(n){return{type:Gs,payload:{sourceId:n}}}function rg(n){return{type:Zn,payload:{targetId:n}}}function og(n){j(typeof n.canDrag=="function","Expected canDrag to be a function."),j(typeof n.beginDrag=="function","Expected beginDrag to be a function."),j(typeof n.endDrag=="function","Expected endDrag to be a function.")}function ag(n){j(typeof n.canDrop=="function","Expected canDrop to be a function."),j(typeof n.hover=="function","Expected hover to be a function."),j(typeof n.drop=="function","Expected beginDrag to be a function.")}function ia(n,e){if(e&&Array.isArray(n)){n.forEach(t=>ia(t,!1));return}j(typeof n=="string"||typeof n=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Qe;(function(n){n.SOURCE="SOURCE",n.TARGET="TARGET"})(Qe||(Qe={}));var dD=0;function lg(){return dD++}function uD(n){let e=lg().toString();switch(n){case Qe.SOURCE:return`S${e}`;case Qe.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${n}`)}}function cg(n){switch(n[0]){case"S":return Qe.SOURCE;case"T":return Qe.TARGET;default:throw new Error(`Cannot parse handler ID: ${n}`)}}function dg(n,e){let t=n.entries(),i=!1;do{let{done:s,value:[,r]}=t.next();if(r===e)return!0;i=!!s}while(!i);return!1}var sa=class{addSource(e,t){ia(e),og(t);let i=this.addHandler(Qe.SOURCE,e,t);return this.store.dispatch(ng(i)),i}addTarget(e,t){ia(e,!0),ag(t);let i=this.addHandler(Qe.TARGET,e,t);return this.store.dispatch(ig(i)),i}containsHandler(e){return dg(this.dragSources,e)||dg(this.dropTargets,e)}getSource(e,t=!1){return j(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return j(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return j(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return j(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return cg(e)===Qe.SOURCE}isTargetId(e){return cg(e)===Qe.TARGET}removeSource(e){j(this.getSource(e),"Expected an existing source."),this.store.dispatch(sg(e)),tg(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){j(this.getTarget(e),"Expected an existing target."),this.store.dispatch(rg(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){let t=this.getSource(e);j(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){j(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,i){let s=uD(e);return this.types.set(s,t),e===Qe.SOURCE?this.dragSources.set(s,i):e===Qe.TARGET&&this.dropTargets.set(s,i),s}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}};var hD=(n,e)=>n===e;function ug(n,e){return!n&&!e?!0:!n||!e?!1:n.x===e.x&&n.y===e.y}function hg(n,e,t=hD){if(n.length!==e.length)return!1;for(let i=0;i<n.length;++i)if(!t(n[i],e[i]))return!1;return!0}function fg(n=Hi,e){switch(e.type){case wn:break;case Us:case $s:case Zn:case Gs:return Hi;case bn:case Wi:case xn:case vn:default:return Jo}let{targetIds:t=[],prevTargetIds:i=[]}=e.payload,s=zp(t,i);if(!(s.length>0||!hg(t,i)))return Hi;let o=i[i.length-1],a=t[t.length-1];return o!==a&&(o&&s.push(o),a&&s.push(a)),s}function fD(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pD(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable}))),i.forEach(function(s){fD(n,s,t[s])})}return n}var pg={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function gg(n=pg,e){let{payload:t}=e;switch(e.type){case zi:case bn:return{initialSourceClientOffset:t.sourceClientOffset,initialClientOffset:t.clientOffset,clientOffset:t.clientOffset};case wn:return ug(n.clientOffset,t.clientOffset)?n:pD({},n,{clientOffset:t.clientOffset});case xn:case vn:return pg;default:return n}}function gD(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Yi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable}))),i.forEach(function(s){gD(n,s,t[s])})}return n}var mD={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function mg(n=mD,e){let{payload:t}=e;switch(e.type){case bn:return Yi({},n,{itemType:t.itemType,item:t.item,sourceId:t.sourceId,isSourcePublic:t.isSourcePublic,dropResult:null,didDrop:!1});case Wi:return Yi({},n,{isSourcePublic:!0});case wn:return Yi({},n,{targetIds:t.targetIds});case Zn:return n.targetIds.indexOf(t.targetId)===-1?n:Yi({},n,{targetIds:Bp(n.targetIds,t.targetId)});case vn:return Yi({},n,{dropResult:t.dropResult,didDrop:!0,targetIds:[]});case xn:return Yi({},n,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return n}}function yg(n=0,e){switch(e.type){case Us:case $s:return n+1;case Gs:case Zn:return n-1;default:return n}}function bg(n=0){return n+1}function yD(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bD(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable}))),i.forEach(function(s){yD(n,s,t[s])})}return n}function wg(n={},e){return{dirtyHandlerIds:fg(n.dirtyHandlerIds,{type:e.type,payload:bD({},e.payload,{prevTargetIds:Fp(n,"dragOperation.targetIds",[])})}),dragOffset:gg(n.dragOffset,e),refCount:yg(n.refCount,e),dragOperation:mg(n.dragOperation,e),stateId:bg(n.stateId)}}function vg(n,e=void 0,t={},i=!1){let s=wD(i),r=new Qo(s,new sa(s)),o=new Zo(s,r),a=n(o,e,t);return o.receiveBackend(a),o}function wD(n){let e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Wc(wg,n&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}var oa=be(Te(),1);function vD(n,e){if(n==null)return{};var t=xD(n,e),i,s;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,i)||(t[i]=n[i]))}return t}function xD(n,e){if(n==null)return{};var t={},i=Object.keys(n),s,r;for(r=0;r<i.length;r++)s=i[r],!(e.indexOf(s)>=0)&&(t[s]=n[s]);return t}var xg=0,ra=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),Sg=(0,oa.memo)(function(e){var{children:t}=e,i=vD(e,["children"]);let[s,r]=_D(i);return(0,oa.useEffect)(()=>{if(r){let o=kg();return++xg,()=>{--xg===0&&(o[ra]=null)}}},[]),(0,_g.jsx)(qo.Provider,{value:s,children:t})});function _D(n){if("manager"in n)return[{dragDropManager:n.manager},!1];let e=SD(n.backend,n.context,n.options,n.debugMode),t=!n.context;return[e,t]}function SD(n,e=kg(),t,i){let s=e;return s[ra]||(s[ra]={dragDropManager:vg(n,e,t,i)}),s[ra]}function kg(){return typeof global<"u"?global:window}var Dg=be(Tg(),1),la=be(Te(),1);var aa=be(Te(),1),et=typeof window<"u"?aa.useLayoutEffect:aa.useEffect;function Og(n,e,t){let[i,s]=(0,la.useState)(()=>e(n)),r=(0,la.useCallback)(()=>{let o=e(n);(0,Dg.default)(i,o)||(s(o),t&&t())},[i,n,t]);return et(r),[i,r]}function Mg(n,e,t){let[i,s]=Og(n,e,t);return et(function(){let o=n.getHandlerId();if(o!=null)return n.subscribeToStateChange(s,{handlerIds:[o]})},[n,s]),i}function ca(n,e,t){return Mg(e,n||(()=>({})),()=>t.reconnect())}var Eg=be(Te(),1);function da(n,e){let t=[...e||[]];return e==null&&typeof n!="function"&&t.push(n),(0,Eg.useMemo)(()=>typeof n=="function"?n():n,t)}var Vc=be(Te(),1);function Pg(n){return(0,Vc.useMemo)(()=>n.hooks.dragSource(),[n])}function Ag(n){return(0,Vc.useMemo)(()=>n.hooks.dragPreview(),[n])}var Fg=be(Te(),1);var jc=!1,Uc=!1,ua=class{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){j(!jc,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return jc=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{jc=!1}}isDragging(){if(!this.sourceId)return!1;j(!Uc,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Uc=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Uc=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}};var $c=!1,ha=class{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;j(!$c,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return $c=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{$c=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}};function Ng(n,e,t){let i=t.getRegistry(),s=i.addTarget(n,e);return[s,()=>i.removeTarget(s)]}function Rg(n,e,t){let i=t.getRegistry(),s=i.addSource(n,e);return[s,()=>i.removeSource(s)]}function Ks(n,e,t,i){let s=t?t.call(i,n,e):void 0;if(s!==void 0)return!!s;if(n===e)return!0;if(typeof n!="object"||!n||typeof e!="object"||!e)return!1;let r=Object.keys(n),o=Object.keys(e);if(r.length!==o.length)return!1;let a=Object.prototype.hasOwnProperty.bind(e);for(let c=0;c<r.length;c++){let d=r[c];if(!a(d))return!1;let h=n[d],f=e[d];if(s=t?t.call(i,h,f,d):void 0,s===!1||s===void 0&&h!==f)return!1}return!0}function qs(n){return n!==null&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}var Xs=be(Te(),1);function kD(n){if(typeof n.type=="string")return;let e=n.type.displayName||n.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function CD(n){return(e=null,t=null)=>{if(!(0,Xs.isValidElement)(e)){let r=e;return n(r,t),r}let i=e;return kD(i),TD(i,t?r=>n(r,t):n)}}function fa(n){let e={};return Object.keys(n).forEach(t=>{let i=n[t];if(t.endsWith("Ref"))e[t]=n[t];else{let s=CD(i);e[t]=()=>s}}),e}function Ig(n,e){typeof n=="function"?n(e):n.current=e}function TD(n,e){let t=n.ref;return j(typeof t!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),t?(0,Xs.cloneElement)(n,{ref:i=>{Ig(t,i),Ig(e,i)}}):(0,Xs.cloneElement)(n,{ref:e})}var pa=class{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){let e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){let e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){let t=this.dragPreview,i=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(i&&this.disconnectDragPreview(),!!this.handlerId){if(!t){this.lastConnectedDragPreview=t;return}i&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Ks(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Ks(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=fa({dragSource:(t,i)=>{this.clearDragSource(),this.dragSourceOptions=i||null,qs(t)?this.dragSourceRef=t:this.dragSourceNode=t,this.reconnectDragSource()},dragPreview:(t,i)=>{this.clearDragPreview(),this.dragPreviewOptions=i||null,qs(t)?this.dragPreviewRef=t:this.dragPreviewNode=t,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}};var ga=class{get connectTarget(){return this.dropTarget}reconnect(){let e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();let t=this.dropTarget;if(!!this.handlerId){if(!t){this.lastConnectedDropTarget=t;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Ks(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=fa({dropTarget:(t,i)=>{this.clearDropTarget(),this.dropTargetOptions=i,qs(t)?this.dropTargetRef=t:this.dropTargetNode=t,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}};var Lg=be(Te(),1);function dt(){let{dragDropManager:n}=(0,Lg.useContext)(qo);return j(n!=null,"Expected drag drop context"),n}function Bg(n,e){let t=dt(),i=(0,Fg.useMemo)(()=>new pa(t.getBackend()),[t]);return et(()=>(i.dragSourceOptions=n||null,i.reconnect(),()=>i.disconnectDragSource()),[i,n]),et(()=>(i.dragPreviewOptions=e||null,i.reconnect(),()=>i.disconnectDragPreview()),[i,e]),i}var zg=be(Te(),1);function Wg(){let n=dt();return(0,zg.useMemo)(()=>new ua(n),[n])}var ya=be(Te(),1);var ma=class{beginDrag(){let e=this.spec,t=this.monitor,i=null;return typeof e.item=="object"?i=e.item:typeof e.item=="function"?i=e.item(t):i={},i??null}canDrag(){let e=this.spec,t=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(t):!0}isDragging(e,t){let i=this.spec,s=this.monitor,{isDragging:r}=i;return r?r(s):t===e.getSourceId()}endDrag(){let e=this.spec,t=this.monitor,i=this.connector,{end:s}=e;s&&s(t.getItem(),t),i.reconnect()}constructor(e,t,i){this.spec=e,this.monitor=t,this.connector=i}};function Hg(n,e,t){let i=(0,ya.useMemo)(()=>new ma(n,e,t),[e,t]);return(0,ya.useEffect)(()=>{i.spec=n},[n]),i}var Yg=be(Te(),1);function Vg(n){return(0,Yg.useMemo)(()=>{let e=n.type;return j(e!=null,"spec.type must be defined"),e},[n])}function jg(n,e,t){let i=dt(),s=Hg(n,e,t),r=Vg(n);et(function(){if(r!=null){let[a,c]=Rg(r,s,i);return e.receiveHandlerId(a),t.receiveHandlerId(a),c}},[i,e,t,s,r])}function Ug(n,e){let t=da(n,e);j(!t.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");let i=Wg(),s=Bg(t.options,t.previewOptions);return jg(t,i,s),[ca(t.collect,i,s),Pg(s),Ag(s)]}var $g=be(Te(),1);function Gg(n){return(0,$g.useMemo)(()=>n.hooks.dropTarget(),[n])}var Kg=be(Te(),1);function qg(n){let e=dt(),t=(0,Kg.useMemo)(()=>new ga(e.getBackend()),[e]);return et(()=>(t.dropTargetOptions=n||null,t.reconnect(),()=>t.disconnectDropTarget()),[n]),t}var Xg=be(Te(),1);function Zg(){let n=dt();return(0,Xg.useMemo)(()=>new ha(n),[n])}var Jg=be(Te(),1);function Qg(n){let{accept:e}=n;return(0,Jg.useMemo)(()=>(j(n.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}var wa=be(Te(),1);var ba=class{canDrop(){let e=this.spec,t=this.monitor;return e.canDrop?e.canDrop(t.getItem(),t):!0}hover(){let e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){let e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}};function em(n,e){let t=(0,wa.useMemo)(()=>new ba(n,e),[e]);return(0,wa.useEffect)(()=>{t.spec=n},[n]),t}function tm(n,e,t){let i=dt(),s=em(n,e),r=Qg(n);et(function(){let[a,c]=Ng(r,s,i);return e.receiveHandlerId(a),t.receiveHandlerId(a),c},[i,e,s,t,r.map(o=>o.toString()).join("|")])}function nm(n,e){let t=da(n,e),i=Zg(),s=qg(t.options);return tm(t,i,s),[ca(t.collect,i,s),Gg(s)]}function Gc(n){let e=null;return()=>(e==null&&(e=n()),e)}function im(n,e){return n.filter(t=>t!==e)}function sm(n,e){let t=new Set,i=r=>t.add(r);n.forEach(i),e.forEach(i);let s=[];return t.forEach(r=>s.push(r)),s}var va=class{enter(e){let t=this.entered.length,i=s=>this.isNodeInDocument(s)&&(!s.contains||s.contains(e));return this.entered=sm(this.entered.filter(i),[e]),t===0&&this.entered.length>0}leave(e){let t=this.entered.length;return this.entered=im(this.entered.filter(this.isNodeInDocument),e),t>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}};var xa=class{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){let t={};Object.keys(this.config.exposeProperties).forEach(i=>{let s=this.config.exposeProperties[i];s!=null&&(t[i]={value:s(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}};var Zs={};ui(Zs,{FILE:()=>Kc,HTML:()=>Zc,TEXT:()=>Xc,URL:()=>qc});var Kc="__NATIVE_FILE__",qc="__NATIVE_URL__",Xc="__NATIVE_TEXT__",Zc="__NATIVE_HTML__";function _a(n,e,t){let i=e.reduce((s,r)=>s||n.getData(r),"");return i??t}var Sa={[Kc]:{exposeProperties:{files:n=>Array.prototype.slice.call(n.files),items:n=>n.items,dataTransfer:n=>n},matchesTypes:["Files"]},[Zc]:{exposeProperties:{html:(n,e)=>_a(n,e,""),dataTransfer:n=>n},matchesTypes:["Html","text/html"]},[qc]:{exposeProperties:{urls:(n,e)=>_a(n,e,"").split(`
`),dataTransfer:n=>n},matchesTypes:["Url","text/uri-list"]},[Xc]:{exposeProperties:{text:(n,e)=>_a(n,e,""),dataTransfer:n=>n},matchesTypes:["Text","text/plain"]}};function rm(n,e){let t=Sa[n];if(!t)throw new Error(`native type ${n} has no configuration`);let i=new xa(t);return i.loadDataTransfer(e),i}function ka(n){if(!n)return null;let e=Array.prototype.slice.call(n.types||[]);return Object.keys(Sa).filter(t=>{let i=Sa[t];return i?.matchesTypes?i.matchesTypes.some(s=>e.indexOf(s)>-1):!1})[0]||null}var om=Gc(()=>/firefox/i.test(navigator.userAgent)),Jc=Gc(()=>Boolean(window.safari));var Js=class{interpolate(e){let{xs:t,ys:i,c1s:s,c2s:r,c3s:o}=this,a=t.length-1;if(e===t[a])return i[a];let c=0,d=o.length-1,h;for(;c<=d;){h=Math.floor(.5*(c+d));let g=t[h];if(g<e)c=h+1;else if(g>e)d=h-1;else return i[h]}a=Math.max(0,d);let f=e-t[a],y=f*f;return i[a]+s[a]*f+r[a]*y+o[a]*f*y}constructor(e,t){let{length:i}=e,s=[];for(let m=0;m<i;m++)s.push(m);s.sort((m,v)=>e[m]<e[v]?-1:1);let r=[],o=[],a=[],c,d;for(let m=0;m<i-1;m++)c=e[m+1]-e[m],d=t[m+1]-t[m],o.push(c),r.push(d),a.push(d/c);let h=[a[0]];for(let m=0;m<o.length-1;m++){let v=a[m],x=a[m+1];if(v*x<=0)h.push(0);else{c=o[m];let _=o[m+1],S=c+_;h.push(3*S/((S+_)/v+(S+c)/x))}}h.push(a[a.length-1]);let f=[],y=[],g;for(let m=0;m<h.length-1;m++){g=a[m];let v=h[m],x=1/o[m],_=v+h[m+1]-g-g;f.push((g-v-_)*x),y.push(_*x*x)}this.xs=e,this.ys=t,this.c1s=h,this.c2s=f,this.c3s=y}};var DD=1;function Qc(n){let e=n.nodeType===DD?n:n.parentElement;if(!e)return null;let{top:t,left:i}=e.getBoundingClientRect();return{x:i,y:t}}function Qs(n){return{x:n.clientX,y:n.clientY}}function OD(n){var e;return n.nodeName==="IMG"&&(om()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(n)))}function MD(n,e,t,i){let s=n?e.width:t,r=n?e.height:i;return Jc()&&n&&(r/=window.devicePixelRatio,s/=window.devicePixelRatio),{dragPreviewWidth:s,dragPreviewHeight:r}}function am(n,e,t,i,s){let r=OD(e),a=Qc(r?n:e),c={x:t.x-a.x,y:t.y-a.y},{offsetWidth:d,offsetHeight:h}=n,{anchorX:f,anchorY:y}=i,{dragPreviewWidth:g,dragPreviewHeight:m}=MD(r,e,d,h),v=()=>{let M=new Js([0,.5,1],[c.y,c.y/h*m,c.y+m-h]).interpolate(y);return Jc()&&r&&(M+=(window.devicePixelRatio-1)*m),M},x=()=>new Js([0,.5,1],[c.x,c.x/d*g,c.x+g-d]).interpolate(f),{offsetX:_,offsetY:S}=s,k=_===0||_,D=S===0||S;return{x:k?_:x(),y:D?S:v()}}var Ca=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,t){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=t}};function ED(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lm(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable}))),i.forEach(function(s){ED(n,s,t[s])})}return n}var Ta=class{profile(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((t=this.dragOverTargetIds)===null||t===void 0?void 0:t.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){let e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){let e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var t;(t=this.window)===null||t===void 0||t.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,t,i){return this.sourcePreviewNodeOptions.set(e,i),this.sourcePreviewNodes.set(e,t),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,i){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,i);let s=o=>this.handleDragStart(o,e),r=o=>this.handleSelectStart(o);return t.setAttribute("draggable","true"),t.addEventListener("dragstart",s),t.addEventListener("selectstart",r),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",s),t.removeEventListener("selectstart",r),t.setAttribute("draggable","false")}}connectDropTarget(e,t){let i=o=>this.handleDragEnter(o,e),s=o=>this.handleDragOver(o,e),r=o=>this.handleDrop(o,e);return t.addEventListener("dragenter",i),t.addEventListener("dragover",s),t.addEventListener("drop",r),()=>{t.removeEventListener("dragenter",i),t.removeEventListener("dragover",s),t.removeEventListener("drop",r)}}addEventListeners(e){!e.addEventListener||(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){!e.removeEventListener||(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){let e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return lm({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){let e=this.monitor.getSourceId(),t=this.sourcePreviewNodeOptions.get(e);return lm({anchorX:.5,anchorY:.5,captureDraggingState:!1},t||{})}isDraggingNativeItem(){let e=this.monitor.getItemType();return Object.keys(Zs).some(t=>Zs[t]===e)}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=rm(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;let t=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var i;return(i=this.rootElement)===null||i===void 0?void 0:i.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},t)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,i){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=s=>{let r=this.sourceNodes.get(s);return r&&Qc(r)||null},this.endDragNativeItem=()=>{!this.isDraggingNativeItem()||(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=s=>Boolean(s&&this.document&&this.document.body&&this.document.body.contains(s)),this.endDragIfSourceWasRemovedFromDOM=()=>{let s=this.currentDragSourceNode;s==null||this.isNodeInDocument(s)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=s=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(s||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=s=>{if(s.defaultPrevented)return;let{dragStartSourceIds:r}=this;this.dragStartSourceIds=null;let o=Qs(s);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(r||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:o});let{dataTransfer:a}=s,c=ka(a);if(this.monitor.isDragging()){if(a&&typeof a.setDragImage=="function"){let h=this.monitor.getSourceId(),f=this.sourceNodes.get(h),y=this.sourcePreviewNodes.get(h)||f;if(y){let{anchorX:g,anchorY:m,offsetX:v,offsetY:x}=this.getCurrentSourcePreviewNodeOptions(),k=am(f,y,o,{anchorX:g,anchorY:m},{offsetX:v,offsetY:x});a.setDragImage(y,k.x,k.y)}}try{a?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(s.target);let{captureDraggingState:d}=this.getCurrentSourcePreviewNodeOptions();d?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);else{if(a&&!a.types&&(s.target&&!s.target.hasAttribute||!s.target.hasAttribute("draggable")))return;s.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=s=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var r;(r=this.currentNativeSource)===null||r===void 0||r.loadDataTransfer(s.dataTransfer)}if(!this.enterLeaveCounter.enter(s.target)||this.monitor.isDragging())return;let{dataTransfer:a}=s,c=ka(a);c&&this.beginDragNativeItem(c,a)},this.handleTopDragEnter=s=>{let{dragEnterTargetIds:r}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=s.altKey,r.length>0&&this.actions.hover(r,{clientOffset:Qs(s)}),r.some(a=>this.monitor.canDropOnTarget(a))&&(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=s=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var r;(r=this.currentNativeSource)===null||r===void 0||r.loadDataTransfer(s.dataTransfer)}},this.handleTopDragOver=s=>{let{dragOverTargetIds:r}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect="none");return}this.altKeyPressed=s.altKey,this.lastClientOffset=Qs(s),this.scheduleHover(r),(r||[]).some(a=>this.monitor.canDropOnTarget(a))?(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?s.preventDefault():(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=s=>{this.isDraggingNativeItem()&&s.preventDefault(),this.enterLeaveCounter.leave(s.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=s=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var r;s.preventDefault(),(r=this.currentNativeSource)===null||r===void 0||r.loadDataTransfer(s.dataTransfer)}else ka(s.dataTransfer)&&s.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=s=>{let{dropTargetIds:r}=this;this.dropTargetIds=[],this.actions.hover(r,{clientOffset:Qs(s)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=s=>{let r=s.target;typeof r.dragDrop=="function"&&(r.tagName==="INPUT"||r.tagName==="SELECT"||r.tagName==="TEXTAREA"||r.isContentEditable||(s.preventDefault(),r.dragDrop()))},this.options=new Ca(t,i),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new va(this.isNodeInDocument)}};var cm=function(e,t,i){return new Ta(e,t,i)};var{Libs:PD}=window.getGenie.Components.Common,{Button:AD,Card:ND,Checkbox:RD,Typography:dm,Tooltip:ID}=window.antd,{ComposeComponents:LD}=window.getGenie.Components.Common.ReduxManager,um=LD(({setInput:n,getInputs:e,sidebar:t,visible:i,width:s})=>{let r=e.selectedOutlines||[],o=e.generatedOutlines||[],a=t.generatedOutlines.loading,c=f=>{let y=[...r];y.indexOf(f)!=-1?y.splice(y.indexOf(f),1):y.push(f),n("selectedOutlines",y)},d=(f=[])=>[...f].filter(y=>r.includes(y)).length===f.length,h=(f,y)=>{let g=[...r];if(y){let m=[];r.forEach((v,x)=>{f.indexOf(v)==-1&&m.indexOf(v)===-1&&m.push(v)}),g=m}else g=[...r,...f];n("selectedOutlines",g)};return React.createElement("div",{className:`getgenie-generated-outlines ${i?"":"d-none"}`,style:{width:`${s}px`}},React.createElement("div",{className:"getgenie-empty-tag"}),React.createElement("h5",{className:"getgenie-generated-outlines-title"},React.createElement(ID,{title:t.__("Select subheadings to create your content outline.","getgenie"),placement:"top"},t.__("Generated Outlines","getgenie")),React.createElement(dm.Text,{className:"generateMsg outline"},React.createElement("span",{className:"resultNumber"},o.length))),a?React.createElement(PD.SkeletonCard,{count:5}):o.length===0?React.createElement(dm.Title,{level:5,className:"getgenie-not-found-title"}," ",t.__("Something Went Wrong! Please Try Again.","getgenie")," "):React.createElement("div",{className:"getgenie-generated-outlines-cards"},o.map((f,y)=>React.createElement(ND,{key:y,className:"getgenie-generated-outlines-card"},React.createElement(AD,{className:"getgenie-generated-outlines-card-select-btn",type:"link",onClick:()=>h(f,d(f))},d(f)?t.__("Unselect All","getgenie"):t.__("Select All","getgenie")),React.createElement("div",{className:"getgenie-checkbox"},f.map((g,m)=>React.createElement("div",{key:m,className:`getgenie-checkbox-container${r.indexOf(g)!=-1?t.__(" active","getgenie"):""}`},React.createElement(RD,{checked:r.indexOf(g)!=-1,onChange:()=>c(g)},g))))))))},["setInput","getInputs","sidebar"]);var{useRef:FD,useState:hm}=window.React,{Button:ed,Dropdown:BD,Menu:td}=window.antd,{ComposeComponents:zD}=window.getGenie.Components.Common.ReduxManager,{GenieHelpers:WD}=window.getGenie.Components.Common.Utilities,fm=zD(({outlines:n,setOutlines:e,swapOutlines:t,id:i,text:s,index:r,setInput:o,getInputs:a,sidebar:c})=>{let[d,h]=hm(""),[f,y]=hm(""),g=FD(null),[{handlerId:m},v]=nm({accept:"card",collect(O){return{handlerId:O.getHandlerId()}},hover(O,E){if(!g.current)return;let A=O.index,N=r;if(A===N)return;let I=g.current?.getBoundingClientRect(),B=(I.bottom-I.top)/2,L=E.getClientOffset().y-I.top;A<N&&L<B||A>N&&L>B||(t(A,N),O.index=N)}}),[{isDragging:x},_]=Ug({type:"card",item:()=>({id:i,index:r}),collect:O=>({isDragging:O.isDragging()})}),S=x?0:1;_(v(g));let k=(O,E)=>{if(O.type==="keyup"&&(O.key!=="Enter"||O?.which!==13)){y(O.target.value);return}let A=n.map((N,I)=>I===E?{...N,text:f}:N);A=A.filter(N=>N.text),e(A),o("selectedOutlines",A.map(N=>N.text)),h(""),O.type==="keyup"&&y("")},D=O=>{h(O),y(O)},T=O=>{let E=n.filter(N=>N.text!==O),A=a.generatedParagraphs;delete A?.[O],o("generatedParagraphs",A),WD.callStoreApi("generatedParagraphs",A),e(E)};return React.createElement("div",{ref:g,"data-handler-id":m,style:{cursor:"grab",opacity:S},className:`getgenie-single-outline ${d===s?"outline-input":"outline-content"}`},React.createElement("div",{className:"getgenie-outline-cards-content"},d===s?React.createElement("textarea",{autoFocus:!0,onFocus:O=>O.target.selectionStart=s.length,onBlur:O=>k(O,r),className:"getgenie-outline-cards-input",defaultValue:s,onKeyDown:O=>O.stopPropagation(),onKeyUp:O=>k(O,r)}):React.createElement(React.Fragment,null,React.createElement("h5",{onDoubleClick:()=>D(s),className:"generated-content"},s),React.createElement(BD,{overlay:(O=>React.createElement(td,{className:"getgenie-outline-menu"},React.createElement(td.Item,{key:"0"},React.createElement(ed,{type:"text",onClick:()=>D(O)},React.createElement("span",{className:"getgenie-icon-edit icon"}),c.__("Edit","getgenie"))),React.createElement(td.Item,{key:"1"},React.createElement(ed,{type:"text",onClick:()=>T(O)},React.createElement("span",{className:"getgenie-icon-trash icon"}),c.__("Delete","getgenie")))))(s),trigger:["click"],zIndex:9999},React.createElement(ed,{type:"text",className:"getgenie-outline-cards-menuBtn"},React.createElement("span",{className:"getgenie-icon-more-vertical"}))))))},["getInputs","setInput","sidebar"]);var xm=be(wm()),{useState:qD,useCallback:XD,useEffect:vm}=window.React,{ComposeComponents:ZD}=window.getGenie.Components.Common.ReduxManager,{Button:JD}=window.antd,_m=ZD(({getInputs:n,setInput:e,sidebar:t})=>{let i=n.selectedOutlines?[...new Set(n.selectedOutlines)]:[],s=()=>{o(d=>[...d,{text:"",id:""}])},[r,o]=qD(i.map((d,h)=>({text:d,id:h+1})));vm(()=>{let d=r.map(h=>h.text);i.length>=r.length&&e("selectedOutlines",d)},[r]),vm(()=>{i.length!==r.length&&o(i.map((d,h)=>({text:d,id:h+1})))},[n.selectedOutlines]);let a=XD((d,h)=>{o(f=>(0,xm.default)(f,{$splice:[[d,1],[h,0,f[d]]]}))},[]),c=t.languages.find(d=>d.value===t.currentLanguage)?.writingDirection;return React.createElement("div",{className:`getgenie-card ${c}`},r.map((d,h)=>React.createElement(fm,{key:d.id,index:h,id:d.id,text:d.text,swapOutlines:a,outlines:r,setOutlines:o})),React.createElement(JD,{onClick:s,type:"primary",className:"add-outline-btn"},t.__("Add Outline","getgenie")))},["getInputs","setInput","sidebar"]);var{Libs:en,Utilities:Vi}=window.getGenie.Components.Common,{Alert:QD,Form:eO,Modal:tO,Steps:km,Divider:nO}=window.antd,{Step:iO}=km,{ComposeComponents:sO}=window.getGenie.Components.Common.ReduxManager,{HandleFetch:rO,HandleResponse:Sm}=window.getGenie.Components.Common.RequestManager,{useEffect:tr,useState:nr}=window.React,Oa,Cm=sO(({setSidebar:n,sidebar:e,getInputs:t,setInput:i})=>{let s=e.generatedOutlines.loading,r=t.selectedOutlines?[...new Set(t.selectedOutlines)]:[],[o,a]=nr(!1),[c,d]=nr(!1),[h,f]=nr(!1),y="Do you want to create the entire blog with just one click, or would you prefer to generate the content step-by-step?",[g,m]=nr(y),[v,x]=nr(0),_=new Ft(window.getGenie.config.isBlockEditor),S=e.languages.find(L=>L.value===e.currentLanguage)?.oneClick,k=["Researching","Getting data","Adding keywords","Cooking content"];tr(()=>{Vi.GenieHelpers.callStoreApi("selectedTitle",t.selectedTitle),Vi.GenieHelpers.callStoreApi("selectedIntro",t.selectedIntro)},[]),tr(()=>{h?Oa=setInterval(()=>{x(L=>L===3?(clearInterval(Oa),L):L+1)},5e3):(Oa&&clearInterval(Oa),x(0))},[h]);let D=()=>{let L={input:{title:t.selectedTitle,intro:t.selectedIntro,context:t.inputContext},templateSlug:"blog-wizard-outline"};i("generatedOutlines",""),n({generatedOutlines:{open:!0,loading:!0}}),rO(F=>{n({generatedOutlines:{open:!0,loading:!1}}),Sm(F,()=>{i("generatedOutlines",F.data),i("seoEnabled",!0),a(!0),Vi.GenieHelpers.callStoreApi("generatedOutlines",F.data)})},"outlines",L)};function T(L){return(L.startsWith("<br>")||L.startsWith("<br/>")||L.startsWith("<br />"))&&(L=L.substring(4)),(L.endsWith("<br>")||L.endsWith("<br/>")||L.endsWith("<br />"))&&(L=L.substring(0,L.length-4)),L}function M(L){return L=L.replace(/<br\/?>/g,`
`),L=L.replace(/<\/?p>/g,"<br>"),L=L.replace(/\n\s*\n/g,`
`),L=L.trim(),L=L.replace(/\s\s+/g,""),T(L)}function O(L,F){for(let Y=0;Y<L.length;Y++){let V=L[Y];Y===0?F=F.replace(V,`<h2>${V}</h2><p>`):F=F.replace(V,`</p><h2>${V}</h2><p>`)}return F+"</p>"}tr(()=>{t.generatedOutlines&&(n({generatedOutlines:{...e.generatedOutlines,open:!0}}),i("seoEnabled",!0))},[]);let E=()=>{i("writingScreen","introScreen"),n({generatedOutlines:{...e.generatedOutlines,open:!1}})};tr(()=>{Vi.GenieHelpers.storeData("selectedIntro")},[t.selectedIntro]);let A;tr(()=>{r.length>1&&o&&(A=setTimeout(()=>{a(!1)},1e4)),Vi.GenieHelpers.storeData("selectedOutlines")},[t.selectedOutlines]);let N=()=>{if(t.selectedOutlines.length<=1){m(" Add at least two headings to generate the blog");return}f(!0);let L=`<p>${t.selectedIntro}</p>`,F=t.selectedOutlines.map(G=>`<h2>${G}</h2>`).join(""),Y=0,V=Xn(window.getGenie.config?.parserApi,{query:{"Site-Token":window.getGenie.config?.siteToken,"Auth-Token":window.getGenie.config?.authToken,"Plugin-Version":window.getGenie.config?.version,"Plugin-Name":"getgenie"},transports:["websocket"],reconnection:!1});V.on("connect",()=>{V.emit("ONE_CLICK_BLOG_PAYLOAD",{keyword:t.keyword,title:t.selectedTitle,context:t.inputContext,intro:L,outline:F,selectedLanguage:e.currentLanguage}),V.on("ONE_CLICK_BLOG_RESPONSE",G=>{Sm(G,()=>{let le=G?.data?.[0];if(typeof le!="string")return;le=le.replace(/(<h(?!(>|\s))[^<]+?>)|(\s(?!(direction|text-align|)\b)[\w])/gm,"<h2>");let re=le?.match(/<h2>([^\<]*?)<\/h2>/g)||[],Re={};re?.length||(le=O(t.selectedOutlines,le),re=le.match(/<h2>([^\<]*?)<\/h2>/g));for(let Ue=0;Ue<re.length;Ue++){let tt=le.split(re[Ue])[1].split(re[Ue+1])[0].replace(/ *\[[^\]]*]/,"");tt=M(tt),Re[re[Ue].replace(/<\/?h2>/gi,"")]={paragraph:tt}}let De=re?.map(Ue=>Ue.replace(/<\/?h2>/gi,""));i("generatedParagraphs",Re),Vi.GenieHelpers.callStoreApi("generatedParagraphs",Re);let H=(t.selectedIntro||"").replace(/<br\s*[\/]?>/g,""),tn=t.selectedTitle||"";e.currentPostContent?.trim().length>0?en.ConfirmModal("This page has some content","Do you want to replace that?",()=>{_.insertContent(tn,H,De,Re)},()=>{_.appendOutlines(De,Re)}):_.insertContent(tn,H,De,Re)})})}),V.on("disconnect",async G=>{f(!1),d(!1)}),V.on("connect_error",G=>{Y++,Y>2?(f(!1),d(!1)):(x(0),f(!0),V.connect())})},I=()=>{S?d(!0):(i("writingScreen","paragraphScreen"),z())},B=L=>{if(L.target.className.includes("getgenie-icon-close1")){d(!1);return}m(y),d(!1),z()},z=()=>{i("writingScreen","paragraphScreen"),n({generatedOutlines:{...e.generatedOutlines,open:!1}})};return React.createElement(React.Fragment,null,React.createElement("div",{className:"getgenie-sidebar-outline getgenie-wrapper-screen"},React.createElement(eO,{layout:"vertical",onFinish:D},React.createElement("div",{className:"getgenie-screen-content intro"},React.createElement(en.Collapse,{defaultActiveKey:["Title-Intro"],className:"getgenie-collapse"},React.createElement(en.Collapse.Panel,{header:React.createElement("div",{className:"getgenie-collapse-header"},React.createElement("span",{className:"getgenie-collapse-header-title"},"Title & Intro"),React.createElement(en.Tooltip,{title:e.__("Edit or change the blog title & intro","getgenie"),placement:"top"})),key:"Title-Intro"},React.createElement(en.Textarea,{rows:2,name:"selectedTitle",type:"text",placeholder:e.__("Enter blog post title here.","getgenie")}),React.createElement(en.Textarea,{rows:6,name:"selectedIntro",placeholder:e.__("Enter blog intro here.","getgenie")}))),React.createElement(nO,null),React.createElement(Fi,{className:"getgenie-sidebar-controller-options"}),React.createElement(en.Button,{htmlType:"submit",type:"primary",className:"submit-btn",loading:s},React.createElement("span",{className:"getgenie-icon-edit"}),e.__("Generate Outline","getgenie"))),React.createElement(en.TitleMsg,{list:r,loading:s,title:"outline"}),React.createElement("div",{className:"getgenie-card-container getgenie-outline-cards"},r.length===0&&e.generatedOutlines.open&&React.createElement("span",{className:"getgenie-outline-loading-text"},e.__("Selected Outlines will Appear here","getgenie")),React.createElement(Sg,{backend:cm,debugMode:!0},React.createElement(_m,null)),r.length>1&&o&&React.createElement(QD,{className:"getgenie-outline-cards-alert",message:e.__("You can also Edit, Delete & Rearrange these Selected Outlines","getgenie"),closeText:e.__("Okay","getgenie"),closable:!0}))),React.createElement(tO,{className:"getgenie-one-click-modal",title:React.createElement(React.Fragment,null,React.createElement("span",{className:"getgenie-icon-alert"}),React.createElement("span",{className:"title"}," ",h?"Content in progress\u2026":"Generate the entire blog with a single click")),visible:c,closeIcon:React.createElement("span",{className:"getgenie-icon-close1"}),closable:!h,maskClosable:!1,zIndex:9999,onOk:N,confirmLoading:h,onCancel:B,okText:"One-click blog",cancelText:"Customized content",cancelButtonProps:{disabled:h},getContainer:()=>e.rootContainer},h?React.createElement(km,{progressDot:(L,{status:F})=>F==="process"?React.createElement("span",{className:"ant-steps-icon-dot border-spinner"}):L,current:v,direction:"vertical"},k.map((L,F)=>React.createElement(iO,{key:F,title:L}))):g),React.createElement(en.DrawerFooter,{handlePrev:E,handleNext:I,nextScreen:!0,enableNextBtn:r.length>0})))},["setSidebar","sidebar","getInputs","setInput"]);Cm.GeneratedOutlines=um;var Ma=Cm;var{Libs:Tm}=window.getGenie.Components.Common,{Tooltip:oO,Button:Dm}=window.antd,{ComposeComponents:aO}=window.getGenie.Components.Common.ReduxManager,{useEffect:lO}=window.React,cO=aO(({sidebar:n,setSidebar:e,getInputs:t,setInput:i})=>{let s=new Ft(window.getGenie.config.isBlockEditor),r=t.generatedParagraphs||{},o=t.selectedOutlines?[...new Set(t.selectedOutlines)]:[];lO(()=>{e({paragraphEditorScreen:{...n.paragraphEditorScreen,currentOutline:o[0],currentOutlineIndex:0}})},[]);let a=()=>{i("writingScreen","outlineScreen"),e({generatedOutlines:{...n.generatedOutlines,open:!0}})},c=()=>{let y=(t.selectedIntro||"").replace(/<br\s*[\/]?>/g,""),g=t.selectedTitle||"";n.currentPostContent?.trim().length>0?Tm.ConfirmModal("This page has some content","Do you want to replace that?",()=>{s.insertContent(g,y,o,r)},()=>{s.appendOutlines(o,r)}):s.insertContent(g,y,o,r)},d=React.createElement(oO,{title:n.__("Insert all paragraphs","getgenie"),placement:"topLeft"},React.createElement(Dm,{type:"primary",onClick:c,size:"small",disabled:!1,className:"insertBtn"},n.__("Insert","getgenie"))),h=(y,g)=>{e({paragraphEditorScreen:{...n.paragraphEditorScreen,currentOutline:y,currentOutlineIndex:g}})},f=n.paragraphEditorScreen?.currentOutlineIndex||0;return React.createElement("div",{className:"getgenie-wrapper-screen"},React.createElement("div",{className:"getgenie-paragraph-screen-container"},o.map((y,g)=>React.createElement(Dm,{onClick:()=>h(y,g),key:g,className:`paragraph-outline-header ${f===g?"active-outline":""} ${r[o[g]]?.paragraph?"generated-outline":""}`},y))),React.createElement(Tm.DrawerFooter,{nextScreen:!1,insertData:c,insertBtn:d,handlePrev:a}))},["setSidebar","setInput","getInputs","sidebar"]),Om=cO;var dO="keyword_research",Ea="keywords_data_store";var uO=()=>new Promise((n,e)=>{let t=window.indexedDB.open(dO,2);t.onupgradeneeded=i=>{let s=i.target.result;s.objectStoreNames.contains(Ea)||s.createObjectStore(Ea,{keyPath:"key"})},t.onsuccess=i=>{n(i.target.result)},t.onerror=i=>{e(i.target.error)}});var rd=async n=>{try{let e=await uO();return new Promise((t,i)=>{let o=e.transaction(Ea,"readonly").objectStore(Ea).get(n);o.onsuccess=a=>{t(a.target.result)},o.onerror=a=>{i(a.target.error)}})}catch(e){console.error("Error getting data:",e)}};var{Libs:Mm,Utilities:t7}=window.getGenie.Components.Common,{ComposeComponents:hO}=window.getGenie.Components.Common.ReduxManager,{useState:n7,useEffect:Em}=window.React,fO=hO(({setSidebar:n,sidebar:e,setInput:t,getInputs:i})=>{let s=i.generatedTitles||[],r=i.generatedIntros||[],o=i.writingScreen||"titleScreen",a=new URLSearchParams(window.location.search).get("keyword");Em(()=>{o!=="outlineScreen"?n({generatedOutlines:{...e.generatedOutlines,open:!1}}):i.generatedOutlines&&(n({generatedOutlines:{...e.generatedOutlines,open:!0}}),t("seoEnabled",!0)),n({currentScreen:o})},[o]),Em(()=>{if(!a)return;(async()=>{let g=await rd("searchVolume")||{},m=await rd("wizardRelatedKeywords")||[];t("keyword",a),t("relatedKeywords",m?.data),t("searchVolume",g?.data)})()},[]);let c=!s.find(y=>y.title===i.selectedTitle),d=!r.find(y=>y.title===i.selectedIntro),h=(i.selectedOutlines||[]).length===0,f=[{label:e.__("Title","getgenie"),key:"titleScreen",children:React.createElement(kp,null)},{label:e.__("Intro","getgenie"),key:"introScreen",children:React.createElement(Cp,null),disabled:c},{label:e.__("Outline","getgenie"),key:"outlineScreen",children:React.createElement(Ma,null),disabled:c||d},{label:e.__("Content","getgenie"),key:"paragraphScreen",children:React.createElement(Om,null),disabled:c||d||h}];return React.createElement(React.Fragment,null,React.createElement(Mm.DrawerHeader,{screenName:o}),React.createElement(Mm.Navbar,{tabPaneList:f,activeKey:o,destroyInactiveTabPane:!1,handleActiveKey:y=>t("writingScreen",y),className:"getgenie-blog-screen-navbar"}))},["setSidebar","sidebar","setInput","getInputs"]),Pm=fO;var{Libs:Am}=window.getGenie.Components.Common,{ComposeComponents:pO}=window.getGenie.Components.Common.ReduxManager,{Select:gO,Input:mO,Form:od}=window.antd,yO=pO(({getInputs:n,sidebar:e,setInput:t})=>{let i=(n.relatedKeywords||[]).map(g=>g.keyword),s=(n.peopleAlsoSearched||[]).map(g=>g.title),r=n.selectedOutlines?[...new Set(n.selectedOutlines)]:[],o=n.generatedParagraphs||{},a=e.paragraphEditorScreen?.currentOutline||r[0],c=[...i,...s];c=[...new Set(c)];let d=c.map(g=>({label:g,value:g})),h=g=>{let m=n.generatedParagraphs||{};m[a]={...m[a],...g},t("generatedParagraphs",m)},f=g=>{h({paragraphInstruction:g.target.value})},y=g=>{h({headingKeywords:g})};return React.createElement(od,{layout:"vertical",className:"getgenie-instruction-container"},React.createElement(od.Item,{label:React.createElement(React.Fragment,null,e.__("Context (Optional)","getgenie"),React.createElement(Am.Tooltip,{title:e.__("Let the genie know the context of this outline","getgenie"),zIndex:999999,placement:"left"})),className:"genie-input paragraph-instruction-textarea"},React.createElement(mO.TextArea,{value:o?.[a]?.paragraphInstruction,placeholder:"Type instruction here.",onChange:f})),React.createElement(od.Item,{label:React.createElement(React.Fragment,null,e.__("Keywords (Optional)","getgenie"),React.createElement(Am.Tooltip,{title:e.__("Select/Add keywords for better result.","getgenie"),zIndex:999999,placement:"left"}))},React.createElement(gO,{showSearch:!0,suffixIcon:null,onChange:y,value:o?.[a]?.headingKeywords||[],mode:"tags",style:{width:"100%"},placeholder:"Keywords...",options:d,getPopupContainer:()=>e.rootContainer,placement:"bottomLeft"})))},["getInputs","setInput","sidebar"]),Nm=yO;var{Libs:ir,Utilities:bO,StaticData:wO}=window.getGenie.Components.Common,{Popover:vO,Tooltip:xO,Form:Rm,Input:_O,Alert:SO}=window.antd,{GenieHelpers:Pa}=bO,{ComposeComponents:kO}=window.getGenie.Components.Common.ReduxManager,{HandleFetch:CO,HandleResponse:TO}=window.getGenie.Components.Common.RequestManager,{useState:Im}=window.React,DO=`${window.getGenie.config.assetsUrl}dist/admin/images/empty-content.svg`,OO=`${window.getGenie.config.assetsUrl}dist/admin/images/scroll-down.svg`,MO=kO(({setInput:n,getInputs:e,sidebar:t,setSidebar:i,getTemplateInputs:s,visible:r,width:o})=>{let a=e.selectedOutlines?[...new Set(e.selectedOutlines)]:[],c=e.generatedParagraphs||{},d=t.paragraphEditorScreen?.currentOutline||a[0],h=t.paragraphEditorScreen?.currentOutlineIndex||0,[f,y]=Im(!1),[g,m]=Im(""),v=d;d?.length>30&&(v=d.substring(0,30).concat("..."));let x=(E,A,N,I)=>{let B=I;N=="paragraph"&&(B=I||" "),A[E]={...A[E],[N]:B},n("generatedParagraphs",A),N=="alert"&&I==!1&&Pa.callStoreApi("generatedParagraphs",A)},_=(E,A)=>{let N="expandOutline";x(E,A,"loading",!0);let I={title:wp.data.select("core/editor")?.getCurrentPost()?.title||s?.blogWizard?.selectedTitle||"",keyword:s?.blogWizard?.keyword||"",context:A[E]?.paragraphInstruction||"",instructionKeywords:A[E]?.headingKeywords||"",textContent:E},B={numberOfResult:1,templateSlug:t.currentTemplate,outputSize:e.outputSize,input:I};CO(z=>{x(E,A,"loading",!1),TO(z,()=>{A[E]={paragraph:z.data?.[0],paragraphInstruction:A[E]?.paragraphInstruction||"",headingKeywords:A[E]?.headingKeywords||""},n("generatedParagraphs",A),Pa.callStoreApi("generatedParagraphs",A),x(E,A,"alert",!0)})},N,B)},S=()=>{let E=(t.paragraphEditorScreen?.currentOutlineIndex||0)+1,A=a.find((N,I)=>I===E);i({paragraphEditorScreen:{...t.paragraphEditorScreen,currentOutline:A,currentOutlineIndex:E}})},k=(E,A)=>{E.stopPropagation(),Pa.copyToClipboard(A).then(()=>{m(A)}).catch(()=>console.log("error"))},D=(c?.[d]?.paragraph||"").replace(/(<([^>]+)>)/g,`
`),T=c?.[d]?.paragraph,M=c?.[d]?.loading,O=c?.[d]?.alert;return React.createElement("div",{className:`getgenie-paragraph-editor ${r?"":"d-none"}`,style:{width:`${o}px`}},React.createElement("div",{className:"getgenie-empty-tag"}),React.createElement("h5",{className:"getgenie-generated-outlines-title"},t.__(`${v}`,"getgenie")),React.createElement("div",{className:"getgenie-paragraph-result-container"},React.createElement("div",{className:"paragraph-instruction-keyword-header"},React.createElement("p",{className:"paragraph-instruction-keyword-header-title"},"Instructions or Keywords",React.createElement("span",{className:"option-text"}," (Optional)"),React.createElement("span",{className:"option-title"}," Add instruction or keywords to consider")),React.createElement(vO,{content:React.createElement(React.Fragment,null,React.createElement("span",{className:"getgenie-icon-close1 popover-close",onClick:()=>y(!1)}),React.createElement(Nm,null)),overlayClassName:"instruction-keyword-popover",overlayStyle:{width:"352px",position:"fixed",top:"20%",left:"40%"},placement:"left",trigger:"click",zIndex:9999,visible:f,align:{offset:[-330,50]},destroyTooltipOnHide:!0,onVisibleChange:E=>y(E)},React.createElement("div",{style:{width:"2rem",height:"1rem",visibility:f?"hidden":"visible"}},React.createElement("span",{className:"getgenie-icon-edit1 edit-icon"})))),React.createElement(Rm,{layout:"vertical",className:"paragraph-generate-form"},React.createElement("div",{className:"instruction-keyword-selected-label"},React.createElement("label",{htmlFor:"instruction-label"},"Length:",React.createElement(ir.Tooltip,{title:"Set output length of your paragraph",placement:"top"})),React.createElement(ir.Select,{name:"outputSize",handleOnChange:E=>Pa.saveSidebarControllerOption("getgenie-outputSize",E),className:"outputSize",options:wO.outputSizes,defaultValue:t.outputSize,disableList:["more"]})),M&&React.createElement(ir.SkeletonCard,{count:1}),!T&&!M&&React.createElement("div",{className:"paragraph-generate-icon"},React.createElement("img",{src:DO,alt:"empty-content"}),React.createElement("p",{className:"generate-outline-content-text"},"Click the ",React.createElement("span",null,"Generate")," button below to get content for this heading"),React.createElement("img",{src:OO,alt:"scroll-down"})),T&&React.createElement("div",{style:{display:M?"none":"block"}},React.createElement(Rm.Item,{className:"genie-input paragraph-generate-textarea"},React.createElement(_O.TextArea,{value:D,placeholder:"Your Text",onChange:E=>x(d,c,"paragraph",E.target.value),autoSize:!0}),React.createElement("div",{className:"copy-generate-paragraph"},React.createElement(xO,{placement:"bottom",zIndex:9999,title:g===D?"Copied":"Copy this content"},React.createElement("span",{className:"copy-icon getgenie-icon-copy",onClick:E=>k(E,D)})))),O&&React.createElement(SO,{className:"outline-paragraph-output-alert",message:t.__("Looking for something different?","getgenie"),description:t.__("You can regenerate the content by clicking the button below.","getgenie"),type:"info",showIcon:!0,closable:!0,onClose:()=>x(d,c,"alert",!1)})))),React.createElement("div",{className:`paragraph-generate-btnGrp ${T?"generated-btnGrp":""}`},T&&h!=a.length-1?React.createElement(ir.Button,{htmlType:"submit",className:"getgenie-continue-btn",type:"primary",onClick:S},"Continue"):"",React.createElement(ir.Button,{htmlType:"submit",className:"getgenie-generate-btn",onClick:()=>_(d,c),loading:M,type:"primary"},T?"Regenerate":"Generate")))},["setInput","getInputs","sidebar","setSidebar","getTemplateInputs"]),Lm=MO;var Fa={};ui(Fa,{KeywordHeatMap:()=>Ay,ScoreAnalysis:()=>H2});var{Libs:y7}=window.getGenie.Components.Common,{Row:EO,Col:PO}=window.antd,{ComposeComponents:AO}=window.getGenie.Components.Common.ReduxManager,NO=AO(({sidebar:n})=>{if(!n.analyzedContent?.statistics)return"";let{nlp:e,heading:t,image:i,imgAltText:s,word:r,internalLink:o}=n.analyzedContent?.statistics,a={word:r,heading:t,nlp:e,image:i,imgAltText:s,internalLink:o},c=h=>h>=70?"#14A645":h>=40?"#F5B008":"#F02F54",d=(h,f)=>{let y="#F5B008";return h>=f[0]&&(y="#14A645"),y};return React.createElement("div",{className:"getgenie-statistics-score-details"},React.createElement(EO,{gutter:[0,38]},Object.keys(a).map((h,f)=>React.createElement(PO,{key:f,span:8},React.createElement("div",{className:"getgenie-statistics-score-content"},React.createElement("div",{className:"sc-container"},React.createElement("div",{className:"item"},React.createElement("div",{className:"output"},React.createElement("h6",{className:"title"},a[h]?.title),React.createElement("h5",{className:"value",style:{color:h==="nlp"?c(a[h].count):d(a[h].count,a[h].analyzedRecommendation)}},a[h].count,h==="nlp"?"%":React.createElement("span",{className:"icon"},a[h].analyzedRecommendation&&a[h].count>=a[h].analyzedRecommendation[0]?React.createElement("i",{className:"getgenie-icon-check"}):React.createElement("i",{className:"getgenie-icon-arrow-right"}))))),a[h].analyzedRecommendation&&React.createElement("div",{className:`label ${(h||"").toLowerCase()}`},React.createElement("div",{className:"output"},React.createElement("h6",{className:"title"},n.__("Recommended","getgenie")),React.createElement("span",{className:"value"},h==="nlp"?a[h]?.scoreRecommendation+"%":Pn.joinArray(a[h].analyzedRecommendation))))))))))},["sidebar"]),Fm=NO;var{Alert:RO}=window.antd,{ComposeComponents:IO}=window.getGenie.Components.Common.ReduxManager,LO=IO(({sidebar:n})=>{let{feedbacks:e}=n.analyzedContent,t=i=>i==="problems"?"error":i==="results"?"success":"warning";return React.createElement("div",{className:"getgenie-statistics-score-analysis"},React.createElement("div",{className:"getgenie-statistics-score-analysis-heading"},React.createElement("h5",{className:"title"},n.__("Score Analysis","getgenie"))),Object.keys(e).map((i,s)=>e[i].length!==0?React.createElement("div",{key:s,className:`getgenie-statistics-score-analysis-info ${i}`},React.createElement("h5",{className:"title"},i),React.createElement("div",{className:"analyzed-list"},e[i].map((r,o)=>React.createElement(RO,{key:o,description:r,type:t(i),showIcon:!0})))):""))},["sidebar"]),Bm=LO;var{Typography:zm,Button:FO,Row:C7,Col:Wm}=window.antd,{useEffect:BO,useState:sr}=window.React,{Libs:Hm}=window.getGenie.Components.Common,{memo:zO}=window.React,Na=wp.data.select("getgenie").sidebar();Ne.register(qt,Ni);var WO=zO(({totalContentStats:n,competitorStat:e,handleShowAnalysis:t,showAnalysis:i})=>{let s=n?.totalScore||0,r="#F5B008",o="#14A645",a="#F02F54",[c,d]=sr(0),[h,f]=sr(0),[y,g]=sr(0),[m,v]=sr(0),[x,_]=sr(0);BO(()=>{_(s),s<=25&&d(s),s>25&&s<=45&&(f(s-25),d(25)),s>45&&s<=65&&(g(s-45),f(20),d(25)),s>65&&(v(s-65),g(20),f(20),d(25))},[s]);let S={labels:["Red","Orange","Green"],datasets:[{label:"# of Votes",data:[c,25-c,h,20-h,y,20-y,m,35-m],backgroundColor:["rgba(201, 62, 39, 1)","#EAECEF","rgba(235, 107, 67, 1)","#EAECEF","rgba(248, 191, 28, 1)","#EAECEF","rgba(46, 204, 113, 1)","#EAECEF"],borderWidth:2}]},k={rotation:270,circumference:180,plugins:{datalabels:{display:!1},legend:{display:!1},tooltip:{enabled:!1}},cutout:"80%"},D={labels:["","Purple",""],datasets:[{data:[x,.2,99.8-x],backgroundColor:["rgba(0,0,0,0)","#000","rgba(0,0,0,0)"],borderColor:["rgba(0, 0, 0 ,0)","#000","rgba(0, 0, 0 ,0)"],borderWidth:2}]},T={rotation:270,circumference:180,plugins:{datalabels:{display:!1},legend:{display:!1},tooltip:{enabled:!1}},cutout:"80%"};function M(E){if(E>69)return o;if(E<70&&E>49)return r;if(E<50)return a}let O=React.createElement("div",{className:"competitor-tooltip"},React.createElement("div",{className:"competitor-tooltip-item"},React.createElement("i",null,React.createElement("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M7.09033 9.73494V11",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("path",{d:"M4.07837 13.0482H10.1025V12.4458C10.1025 11.7831 9.5603 11.241 8.89765 11.241H5.28319C4.62054 11.241 4.07837 11.7831 4.07837 12.4458V13.0482V13.0482Z",stroke:"white",strokeWidth:"1.2",strokeMiterlimit:"10"}),React.createElement("path",{d:"M3.47607 13.0482H10.705",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("path",{d:"M6.99983 9.43373C4.6685 9.43373 2.78296 7.54819 2.78296 5.21687V3.40964C2.78296 2.07831 3.86127 1 5.1926 1H8.80705C10.1384 1 11.2167 2.07831 11.2167 3.40964V5.21687C11.2167 7.54819 9.33115 9.43373 6.99983 9.43373Z",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("path",{d:"M3.06626 6.81325C2.61446 6.66867 2.21687 6.40361 1.90361 6.09036C1.36145 5.48795 1 4.76505 1 3.92168C1 3.07831 1.66265 2.41566 2.50602 2.41566H2.89759C2.77711 2.69277 2.71687 2.99999 2.71687 3.31927V5.1265C2.71687 5.72891 2.84337 6.29517 3.06626 6.81325Z",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("path",{d:"M10.9336 6.81325C11.3854 6.66867 11.783 6.40361 12.0962 6.09036C12.6384 5.48795 12.9999 4.76505 12.9999 3.92168C12.9999 3.07831 12.3372 2.41566 11.4938 2.41566H11.1023C11.2227 2.69277 11.283 2.99999 11.283 3.31927V5.1265C11.283 5.72891 11.1565 6.29517 10.9336 6.81325Z",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}))),React.createElement("p",null,"Competitor's Highest Score: ",React.createElement("span",null,e?.maxScore))),React.createElement("div",{className:"competitor-tooltip-item"},React.createElement("i",null,React.createElement("svg",{width:"12",height:"18",viewBox:"0 0 12 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M6 11C8.76142 11 11 8.76142 11 6C11 3.23858 8.76142 1 6 1C3.23858 1 1 3.23858 1 6C1 8.76142 3.23858 11 6 11Z",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("path",{d:"M3.293 10.2072L2.42871 16.7143L6.00014 14.5714L9.57157 16.7143L8.70728 10.2",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}))),React.createElement("p",null,"Average score from SERP: ",React.createElement("span",null,e?.avgScore))),React.createElement("div",{className:"competitor-tooltip-item"},React.createElement("i",null,React.createElement("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M9.82906 11.1514H4.2143C3.96343 11.1514 3.68269 10.9543 3.59907 10.7153L1.12619 3.79842C0.773769 2.80688 1.18592 2.50225 2.0341 3.11151L4.36363 4.77802C4.75189 5.04681 5.1939 4.90943 5.36115 4.47339L6.41242 1.67198C6.74692 0.776007 7.30242 0.776007 7.63692 1.67198L8.68819 4.47339C8.85544 4.90943 9.29745 5.04681 9.67974 4.77802L11.8659 3.21903C12.7977 2.55003 13.2457 2.8905 12.8634 3.97164L10.4503 10.7273C10.3607 10.9543 10.0799 11.1514 9.82906 11.1514Z",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("path",{d:"M3.73657 12.9553H10.307",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),React.createElement("path",{d:"M5.52832 8.17674H8.51489",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}))),React.createElement("p",null,"SERP's #1 Competitor's Score: ",React.createElement("span",null,e?.firstCompetitorScore))));return React.createElement("div",{className:"getgenie-statistics-score-meter"},React.createElement("div",{className:"chart-label"},React.createElement(xc,{data:S,options:k}),React.createElement(xc,{data:D,options:T}),React.createElement("div",{className:"meter-text"},React.createElement(zm.Text,null,s,"/"),React.createElement(zm.Text,null,Na.__("100","getgenie"))),React.createElement("div",{className:"getgenie-statistics-score-heading"},React.createElement(FO,{onClick:t,type:"link"},i?Na.__("Hide Analysis","getgenie"):Na.__("Details Analysis","getgenie")))),React.createElement("div",{className:"side-info"},React.createElement(Wm,null,React.createElement("div",{className:"side-info-content"},React.createElement("p",{className:"readability-score"},"Competitor's Best: ",React.createElement("span",{className:"result",style:{color:M(e?.maxScore)}},e?.maxScore)),React.createElement(Hm.Tooltip,{className:"getgenie-statistics-score-tooltip",placement:"top",title:O,color:"#031233"}))),React.createElement(Wm,null,React.createElement("div",{className:"side-info-content"},React.createElement("p",null,"Readability Score:",React.createElement("span",{className:"result",style:{color:M(n.readabilityScore)}}," "+n.readabilityScore)),React.createElement(Hm.Tooltip,{className:"getgenie-statistics-score-tooltip",placement:"top",title:Na.__(`${n.readabilityTooltipText}`),color:"#031233"})))))}),Ym=WO;var{ComposeComponents:HO}=window.getGenie.Components.Common.ReduxManager,{Libs:YO,Utilities:VO}=window.getGenie.Components.Common,{GenieHelpers:jO}=VO,{useState:UO,useEffect:$O}=window.React,{Tooltip:GO}=window.antd,KO=HO(({category:n,keyword:e=[],screenName:t,tooltipText:i="",sidebar:s,setSidebar:r,getInputs:o,setInput:a})=>{let[c,d]=UO(!1),h=o.selectedKeywordList||[],f=o.nlpKeywordList||[],y=o.restStatisticsKeyword||{},g=s.statisticsData,m=g.keywords,v=n==="NLP Keywords";if($O(()=>{jO.callStoreApi("serpData",{statisticsData:g,restStatisticsKeyword:y,selectedKeywordList:h,nlpKeywordList:f})},[c]),e.length===0)return"";let x=[];!t||t==="all"?(x=e,v&&(x=[...e,...h])):(x=e.filter(M=>M.foundIn.includes(t)),v&&(x=[...e,...h].filter(M=>M.foundIn.includes(t))));let _=M=>{if(M?.recommendation?.[t]){let O=M.usage[t],E=M.recommendation[t][0],A=M.recommendation[t][1];return O<E?"yellow":O>A?"red":"green"}else return"yellow"},S=M=>{a("nlpKeywordList",[...f,M]);let O=m[M];a("restStatisticsKeyword",{...y,[M]:O});let E=e.find(({keyword:N})=>N===M);a("selectedKeywordList",[...h,E]),delete m[M];let A={...s.statisticsData,keywords:{...m}};r({statisticsData:A}),d(N=>!N)},k=M=>{a("nlpKeywordList",f.filter(A=>A!==M)),a("selectedKeywordList",h.filter(({keyword:A})=>A!==M));let O=y[M],E={...s.statisticsData,keywords:{...m,[M]:O}};delete y[M],r({statisticsData:E}),d(A=>!A)},D=M=>{let O=v?"nlp-keywords":"";return f.includes(M)&&v?`inactive-el ${O}`:`active-el ${O}`},T=M=>{v&&(h.find(({keyword:O})=>O===M)?k(M):S(M))};return React.createElement("div",{className:"getgenie-statistics-keyword-analysis-category-container"},["NLP Keywords","Custom Keywords"].includes(n)?React.createElement("h5",{className:"getgenie-statistics-keyword-analysis-category-title"},n,":",React.createElement(YO.Tooltip,{title:s.__(i,"getgenie"),placement:"top"})):"",React.createElement("div",{className:"getgenie-statistics-keyword-analysis-category-keywords"},x.map((M,O)=>React.createElement("div",{key:O,className:`getgenie-statistics-keyword-analysis-category-keyword ${_(M)} ${D(M.keyword)} `},React.createElement("div",{className:`getgenie-statistics-keyword-analysis-category-keyword-title ${_(M)}`},M.keyword),React.createElement("div",{className:"getgenie-statistics-keyword-analysis-category-keyword-usage"},typeof M?.usage=="object"?M?.usage[t]:M?.usage,M?.recommendation?.[t]&&" / "+M.recommendation[t][0]+" - "+M?.recommendation?.[t][1]),v&&React.createElement("div",{onClick:()=>T(M.keyword),className:"select-deselect-btn"},React.createElement(GO,{placement:"top",zIndex:9999,title:"Select/Deselect this keyword from analysis."},React.createElement("span",{className:`select-deselect-common ${h.find(({keyword:E})=>E===M.keyword)?"getgenie-icon-plus add":" getgenie-icon-minus remove"}`})))))))},["sidebar","setSidebar","getInputs","setInput"]),Ra=KO;var{useState:Vm,useEffect:ad}=window.React,{ComposeComponents:qO}=window.getGenie.Components.Common.ReduxManager,XO=qO(({sidebar:n,getInputs:e,screenName:t="AllKeyword"})=>{let[i,s]=Vm({}),[r,o]=Vm([]),a={nlp:"The AI-filtered NLP keyword suggestions for further optimization.",custom:"The keywords you inputted or selected manually for adding to your content."},c;n.analyzedContent.statistics.keywords?.focus?n.analyzedContent.statistics.keywords?.common?c={...n.analyzedContent.statistics.keywords,common:[...n.analyzedContent.statistics.keywords.focus,...n.analyzedContent.statistics.keywords.common]}:c={...n.analyzedContent.statistics.keywords,common:[...n.analyzedContent.statistics.keywords.focus]}:c=n.analyzedContent.statistics.keywords;let d={common:"Common Keywords",nlp:"NLP Keywords",focus:"Focus Keywords"};return ad(()=>{n.analyzedContent.statistics.keywords?.focus?n.analyzedContent.statistics.keywords?.common?s({...n.analyzedContent.statistics.keywords,common:[...n.analyzedContent.statistics.keywords.common,...n.analyzedContent.statistics.keywords.focus]}):s({...n.analyzedContent.statistics.keywords,common:[...n.analyzedContent.statistics.keywords.focus]}):s(n.analyzedContent.statistics.keywords)},[n.analyzedContent.statistics.keywords]),ad(()=>{if(n.contentScoreSearchKeyword!==""){let h={};for(let[f,y]of Object.entries(c))h[f]=y.filter(g=>g.keyword.toLowerCase().includes(n.contentScoreSearchKeyword.toLowerCase()));s(h),o(e.customKeywords.filter(f=>f.keyword.toLowerCase().includes(n.contentScoreSearchKeyword.toLowerCase())))}else s(c),o(e.customKeywords)},[n.contentScoreSearchKeyword]),ad(()=>{o(e.customKeywords||[])},[e.customKeywords]),React.createElement("div",{className:"getgenie-statistics-keyword-analysis"},["metaTitle","metaDescription"].includes(t)?React.createElement(Ra,{category:d.focus,keyword:i.focus,screenName:t}):React.createElement(React.Fragment,null,Object.keys(d).map((h,f)=>{if(h!=="focus")return React.createElement(Ra,{key:f,category:d[h],keyword:i[h],screenName:t,tooltipText:a[h]})}),React.createElement(Ra,{category:"Custom Keywords",keyword:r,tooltipText:a.custom})))},["sidebar","setSidebar","getInputs"]),rr=XO;var{ComposeComponents:ZO}=window.getGenie.Components.Common.ReduxManager,JO=ZO(({sidebar:n,setSidebar:e})=>React.createElement("div",{className:"getgenie-statistics-keyword-analysis-meta-keyword"},React.createElement("h4",{className:"getgenie-statistics-keyword-analysis-meta-title"},"Meta Title:"),React.createElement(rr,{screenName:"metaTitle"}),React.createElement("h4",{className:"getgenie-statistics-keyword-analysis-meta-description"},"Meta Description:"),React.createElement(rr,{screenName:"metaDescription"})),["sidebar","setSidebar"]),jm=JO;var{ComposeComponents:QO}=window.getGenie.Components.Common.ReduxManager,{Utilities:eM}=window.getGenie.Components.Common,{GenieHelpers:tM}=eM,{useState:ld,useEffect:nM}=window.React,{Button:iM,Input:sM}=window.antd,rM=new ke,oM=QO(({sidebar:n,setSidebar:e,getInputs:t,setInput:i})=>{let[s,r]=ld(!1),[o,a]=ld(""),[c,d]=ld(!1),h=g=>{e({...n,contentScoreSearchKeyword:g.target.value})},f=()=>{d(!1),e({...n,contentScoreSearchKeyword:""})},y=g=>{if(g.type==="keyup"&&(g.key!=="Shift"&&g.key==="Enter"||g?.which===13)){a("");let m=t.customKeywords||[],v=rM.findSingleMatch(n.currentPostContent,o),x=[...m,{keyword:o,usage:v}];i("customKeywords",x),r(!1)}};return nM(()=>{tM.storeData("customKeywords")},[t.customKeywords]),React.createElement("div",{className:"getgenie-statistics-keyword-analysis-category-custom-button"},React.createElement("div",{className:"getgenie-statistics-keyword-analysis-category-custom-button-container"},!c&&React.createElement(iM,{className:"add-outline-btn",onMouseDown:g=>{g.preventDefault(),r(!s)}},n.__("Add Custom Keyword","getgenie")),c&&React.createElement(sM,{bordered:!1,className:"getgenie-input-search-bar",placeholder:n.__("Search...","getgenie"),autoFocus:!0,onBlur:f,onChange:g=>h(g),prefix:React.createElement("span",{className:"getgenie-icon-search"})}),!c&&React.createElement("div",{onClick:()=>{d(!0)},className:"getgenie-search-icon"},React.createElement("span",{className:"getgenie-icon-search"}))),s&&React.createElement(React.Fragment,null,React.createElement("textarea",{autoFocus:!0,onChange:g=>{a(g.target.value.replace(`
`,""))},onBlur:()=>r(!1),className:"getgenie-outline-cards-input",value:o,style:{display:"block",marginTop:"4px"},placeholder:n.__("Please enter your custom keyword","getgenie"),onKeyUp:g=>y(g)})))},["sidebar","setSidebar","setInput","getInputs"]),Um=oM;var{Button:aM}=window.antd,{Libs:R7}=window.getGenie.Components.Common,{ComposeComponents:lM}=window.getGenie.Components.Common.ReduxManager,{useEffect:cM,useState:$m}=window.React,dM=lM(({setSidebar:n,sidebar:e})=>{let[t,i]=$m({currentScreen:"all",activeIndex:0}),{contentStats:s}=e?.analyzedContent,{competitorStats:r}=e,[o,a]=$m(!1),{imageUrl:c}=e;cM(()=>{n({analyzeKeyword:{...e.analyzeKeyword,open:!1},generatedOutlines:{...e.generatedOutlines,open:!1}})},[]);let d=()=>{a(!o)},h=[{keywordName:"All",screen:"all"},{keywordName:"Heading",screen:"heading"},{keywordName:"Content",screen:"content"},{keywordName:"Meta",screen:"meta"}],f=(y,g)=>{i({currentScreen:y,activeIndex:g})};return React.createElement("div",{className:"getgenie-statistics"},React.createElement("div",{className:"getgenie-statistics-container"},React.createElement("div",{className:"getgenie-statistics-container-data"},React.createElement("div",{className:"getgenie-statistics-score"},React.createElement(Ym,{imageUrl:c,totalContentStats:s,handleShowAnalysis:d,showAnalysis:o,competitorStat:r}),!o&&React.createElement("div",{className:"getgenie-statistics-score-detail-container"},React.createElement(Fm,null),React.createElement(Um,null),React.createElement("div",{className:"keyword-tab-container"},h.map((y,g)=>React.createElement(aM,{key:g,onClick:()=>f(y.screen,g),className:`keyword-btn-tab ${t.activeIndex===g?"active-keyword-tab":"in-active-keyword-tab"}`},y.keywordName))),React.createElement("h6",{className:"help-text-statistics-keyword"},"Used / Average - Highest"),t.currentScreen!=="meta"?React.createElement(rr,{screenName:t.currentScreen}):React.createElement(jm,null)),o&&React.createElement(Bm,null)))))},["setSidebar","sidebar"]),Gm=dM;var Km={modes:{point(n,e){return La(n,e,{intersect:!0})},nearest(n,e,t){return fM(n,e,t)},x(n,e,t){return La(n,e,{intersect:t.intersect,axis:"x"})},y(n,e,t){return La(n,e,{intersect:t.intersect,axis:"y"})}}};function fd(n,e,t){return(Km.modes[t.mode]||Km.modes.nearest)(n,e,t)}function uM(n,e,t){return t!=="x"&&t!=="y"?n.inRange(e.x,e.y,"x",!0)||n.inRange(e.x,e.y,"y",!0):n.inRange(e.x,e.y,t,!0)}function hM(n,e,t){return t==="x"?{x:n.x,y:e.y}:t==="y"?{x:e.x,y:n.y}:e}function La(n,e,t){return n.visibleElements.filter(i=>t.intersect?i.inRange(e.x,e.y):uM(i,e,t.axis))}function fM(n,e,t){let i=Number.POSITIVE_INFINITY;return La(n,e,t).reduce((s,r)=>{let o=r.getCenterPoint(),a=hM(e,o,t.axis),c=ln(e,a);return c<i?(s=[r],i=c):c===i&&s.push(r),s},[]).sort((s,r)=>s._index-r._index).slice(0,1)}var dd=["enter","leave"],pd=dd.concat("click");function pM(n,e,t){e.listened=!1,e.moveListened=!1,e._getElements=fd,pd.forEach(i=>{typeof t[i]=="function"?(e.listened=!0,e.listeners[i]=t[i]):ve(e.listeners[i])&&delete e.listeners[i]}),dd.forEach(i=>{typeof t[i]=="function"&&(e.moveListened=!0)}),(!e.listened||!e.moveListened)&&e.annotations.forEach(i=>{!e.listened&&typeof i.click=="function"&&(e.listened=!0),e.moveListened||dd.forEach(s=>{typeof i[s]=="function"&&(e.listened=!0,e.moveListened=!0)})})}function gM(n,e,t){if(n.listened)switch(e.type){case"mousemove":case"mouseout":return mM(n,e,t);case"click":return yM(n,e,t)}}function mM(n,e,t){if(!n.moveListened)return;let i;e.type==="mousemove"?i=fd(n,e,t.interaction):i=[];let s=n.hovered;n.hovered=i;let r={state:n,event:e},o=qm(r,"leave",s,i);return qm(r,"enter",i,s)||o}function qm({state:n,event:e},t,i,s){let r;for(let o of i)s.indexOf(o)<0&&(r=cy(o.options[t]||n.listeners[t],o,e)||r);return r}function yM(n,e,t){let i=n.listeners,s=fd(n,e,t.interaction),r;for(let o of s)r=cy(o.options.click||i.click,o,e)||r;return r}function cy(n,e,t){return ne(n,[e.$context,t])===!0}var bM=(n,e)=>e>n||n.length>e.length&&n.slice(0,e.length)===e,Qn=.001,gd=(n,e,t)=>Math.min(t,Math.max(e,n));function wM(n,e,t){for(let i of Object.keys(n))n[i]=gd(n[i],e,t);return n}function vM(n,e,t,i){if(!n||!e||t<=0)return!1;let s=i/2;return Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2)<=Math.pow(t+s,2)}function dy(n,{x:e,y:t,x2:i,y2:s},r,o){let a=o/2,c=n.x>=e-a-Qn&&n.x<=i+a+Qn,d=n.y>=t-a-Qn&&n.y<=s+a+Qn;return r==="x"?c:(r==="y"||c)&&d}function Ki(n,e){let{centerX:t,centerY:i}=n.getProps(["centerX","centerY"],e);return{x:t,y:i}}function xM(n,e,t,i=!0){let s=t.split("."),r=0;for(let o of e.split(".")){let a=s[r++];if(parseInt(o,10)<parseInt(a,10))break;if(bM(a,o)){if(i)throw new Error(`${n} v${t} is not supported. v${e} or newer is required.`);return!1}}return!0}var uy=n=>typeof n=="string"&&n.endsWith("%"),hy=n=>gd(parseFloat(n)/100,0,1);function md(n,e){return e==="start"?0:e==="end"?n:uy(e)?hy(e)*n:n/2}function ji(n,e){return typeof e=="number"?e:uy(e)?hy(e)*n:n}function _M(n,e){let{x:t,width:i}=n,s=e.textAlign;return s==="center"?t+i/2:s==="end"||s==="right"?t+i:t}function fy(n){return K(n)?{x:$(n.x,"center"),y:$(n.y,"center")}:(n=$(n,"center"),{x:n,y:n})}function py(n){return n&&(ve(n.xValue)||ve(n.yValue))}var cd=new Map;function yd(n){if(n&&typeof n=="object"){let e=n.toString();return e==="[object HTMLImageElement]"||e==="[object HTMLCanvasElement]"}}function bd(n,{x:e,y:t},i){i&&(n.translate(e,t),n.rotate(xe(i)),n.translate(-e,-t))}function ii(n,e){if(e&&e.borderWidth)return n.lineCap=e.borderCapStyle,n.setLineDash(e.borderDash),n.lineDashOffset=e.borderDashOffset,n.lineJoin=e.borderJoinStyle,n.lineWidth=e.borderWidth,n.strokeStyle=e.borderColor,!0}function qi(n,e){n.shadowColor=e.backgroundShadowColor,n.shadowBlur=e.shadowBlur,n.shadowOffsetX=e.shadowOffsetX,n.shadowOffsetY=e.shadowOffsetY}function wd(n,e){let t=e.content;if(yd(t))return{width:ji(t.width,e.width),height:ji(t.height,e.height)};let i=he(e.font),s=e.textStrokeWidth,r=oe(t)?t:[t],o=r.join()+i.string+s+(n._measureText?"-spriting":"");if(!cd.has(o)){n.save(),n.font=i.string;let a=r.length,c=0;for(let h=0;h<a;h++){let f=r[h];c=Math.max(c,n.measureText(f).width+s)}n.restore();let d=a*i.lineHeight+s;cd.set(o,{width:c,height:d})}return cd.get(o)}function gy(n,e,t){let{x:i,y:s,width:r,height:o}=e;n.save(),qi(n,t);let a=ii(n,t);n.fillStyle=t.backgroundColor,n.beginPath(),Vt(n,{x:i,y:s,w:r,h:o,radius:wM(gt(t.borderRadius),0,Math.min(r,o)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=t.borderShadowColor,n.stroke()),n.restore()}function SM(n,e,t){let i=t.content;if(yd(i)){n.drawImage(i,e.x,e.y,e.width,e.height);return}let s=oe(i)?i:[i],r=he(t.font),o=r.lineHeight,a=_M(e,t),c=e.y+o/2+t.textStrokeWidth/2;n.save(),n.font=r.string,n.textBaseline="middle",n.textAlign=t.textAlign,kM(n,t)&&s.forEach((d,h)=>n.strokeText(d,a,c+h*o)),n.fillStyle=t.color,s.forEach((d,h)=>n.fillText(d,a,c+h*o)),n.restore()}function kM(n,e){if(e.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=e.textStrokeWidth,n.strokeStyle=e.textStrokeColor,!0}function Ui(n,e,t){return e=typeof e=="number"?e:n.parse(e),_e(e)?n.getPixelForValue(e):t}function Cn(n,e,t){let i=e[t];if(i||t==="scaleID")return i;let s=t.charAt(0),r=Object.values(n).filter(o=>o.axis&&o.axis===s);return r.length?r[0].id:s}function my(n,e){if(n){let t=n.options.reverse,i=Ui(n,e.min,t?e.end:e.start),s=Ui(n,e.max,t?e.start:e.end);return{start:i,end:s}}}function yy(n,e){let{chartArea:t,scales:i}=n,s=i[Cn(i,e,"xScaleID")],r=i[Cn(i,e,"yScaleID")],o=t.width/2,a=t.height/2;return s&&(o=Ui(s,e.xValue,s.left+s.width/2)),r&&(a=Ui(r,e.yValue,r.top+r.height/2)),{x:o,y:a}}function vd(n,e){let t=n.scales,i=t[Cn(t,e,"xScaleID")],s=t[Cn(t,e,"yScaleID")];if(!i&&!s)return{};let{left:r,right:o}=i||n.chartArea,{top:a,bottom:c}=s||n.chartArea,d=Xm(i,{min:e.xMin,max:e.xMax,start:r,end:o});r=d.start,o=d.end;let h=Xm(s,{min:e.yMin,max:e.yMax,start:c,end:a});return a=h.start,c=h.end,{x:r,y:a,x2:o,y2:c,width:o-r,height:c-a,centerX:r+(o-r)/2,centerY:a+(c-a)/2}}function by(n,e){if(!py(e)){let t=vd(n,e),i=e.radius;(!i||isNaN(i))&&(i=Math.min(t.width,t.height)/2,e.radius=i);let s=i*2;return{x:t.x+e.xAdjust,y:t.y+e.yAdjust,x2:t.x+s+e.xAdjust,y2:t.y+s+e.yAdjust,centerX:t.centerX+e.xAdjust,centerY:t.centerY+e.yAdjust,width:s,height:s}}return CM(n,e)}function wy(n,e){let t=vd(n,e),{x:i,y:s}=t;return t.elements=[{type:"label",optionScope:"label",properties:OM(n,t,e)}],t.initProperties={x:i,y:s},t}function CM(n,e){let t=yy(n,e),i=e.radius*2;return{x:t.x-e.radius+e.xAdjust,y:t.y-e.radius+e.yAdjust,x2:t.x+e.radius+e.xAdjust,y2:t.y+e.radius+e.yAdjust,centerX:t.x+e.xAdjust,centerY:t.y+e.yAdjust,width:i,height:i}}function Xm(n,e){let t=my(n,e)||e;return{start:Math.min(t.start,t.end),end:Math.max(t.start,t.end)}}function TM({properties:n,options:e},t,i,s){let{x:r,x2:o,width:a}=n;return vy({start:r,end:o,size:a,borderWidth:e.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:e.label.xAdjust,size:t.width})}function DM({properties:n,options:e},t,i,s){let{y:r,y2:o,height:a}=n;return vy({start:r,end:o,size:a,borderWidth:e.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:e.label.yAdjust,size:t.height})}function vy(n,e){let{start:t,end:i,borderWidth:s}=n,{position:r,padding:{start:o,end:a},adjust:c}=e,d=i-s-t-o-a-e.size;return t+s/2+c+md(d,r)}function OM(n,e,t){let i=t.label;i.backgroundColor="transparent",i.callout.display=!1;let s=fy(i.position),r=me(i.padding),o=wd(n.ctx,i),a=TM({properties:e,options:t},o,s,r),c=DM({properties:e,options:t},o,s,r),d=o.width+r.width,h=o.height+r.height;return{x:a,y:c,x2:a+d,y2:c+h,width:d,height:h,centerX:a+d/2,centerY:c+h/2,rotation:i.rotation}}function Xi(n,e,t){let i=Math.cos(t),s=Math.sin(t),r=e.x,o=e.y;return{x:r+i*(n.x-r)-s*(n.y-o),y:o+s*(n.x-r)+i*(n.y-o)}}function MM(n,e,t){let i=RM(n.scales,e,t),s=Zm(e,i,"min","suggestedMin");s=Zm(e,i,"max","suggestedMax")||s,s&&typeof e.handleTickRangeOptions=="function"&&e.handleTickRangeOptions()}function EM(n,e){for(let t of n)AM(t,e)}function Zm(n,e,t,i){if(_e(e[t])&&!PM(n.options,t,i)){let s=n[t]!==e[t];return n[t]=e[t],s}}function PM(n,e,t){return ve(n[e])||ve(n[t])}function AM(n,e){for(let t of["scaleID","xScaleID","yScaleID"]){let i=Cn(e,n,t);i&&!e[i]&&NM(n,t)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function NM(n,e){if(e==="scaleID")return!0;let t=e.charAt(0);for(let i of["Min","Max","Value"])if(ve(n[t+i]))return!0;return!1}function RM(n,e,t){let i=e.axis,s=e.id,r=i+"ScaleID",o={min:$(e.min,Number.NEGATIVE_INFINITY),max:$(e.max,Number.POSITIVE_INFINITY)};for(let a of t)a.scaleID===s?Jm(a,e,["value","endValue"],o):Cn(n,a,r)===s&&Jm(a,e,[i+"Min",i+"Max",i+"Value"],o);return o}function Jm(n,e,t,i){for(let s of t){let r=n[s];if(ve(r)){let o=e.parse(r);i.min=Math.min(i.min,o),i.max=Math.max(i.max,o)}}}var Tn=class extends Ce{inRange(e,t,i,s){let{x:r,y:o}=Xi({x:e,y:t},this.getCenterPoint(s),xe(-this.options.rotation));return dy({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options.borderWidth)}getCenterPoint(e){return Ki(this,e)}draw(e){e.save(),bd(e,this.getCenterPoint(),this.options.rotation),gy(e,this,this.options),e.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(e,t){return wy(e,t)}};Tn.id="boxAnnotation";Tn.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};Tn.defaultRoutes={borderColor:"color",backgroundColor:"color"};Tn.descriptors={label:{_fallback:!0}};var xy=["left","bottom","top","right"],ei=class extends Ce{inRange(e,t,i,s){let{x:r,y:o}=Xi({x:e,y:t},this.getCenterPoint(s),xe(-this.rotation));return dy({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options.borderWidth)}getCenterPoint(e){return Ki(this,e)}draw(e){let t=this.options,i=!ve(this._visible)||this._visible;!t.display||!t.content||!i||(e.save(),bd(e,this.getCenterPoint(),this.rotation),LM(e,this),gy(e,this,t),SM(e,VM(this),t),e.restore())}resolveElementProperties(e,t){let i;if(py(t))i=yy(e,t);else{let{centerX:a,centerY:c}=vd(e,t);i={x:a,y:c}}let s=me(t.padding),r=wd(e.ctx,t),o=IM(i,r,t,s);return{pointX:i.x,pointY:i.y,...o,rotation:t.rotation}}};ei.id="labelAnnotation";ei.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};ei.defaultRoutes={borderColor:"color"};function IM(n,e,t,i){let s=e.width+i.width+t.borderWidth,r=e.height+i.height+t.borderWidth,o=fy(t.position),a=Qm(n.x,s,t.xAdjust,o.x),c=Qm(n.y,r,t.yAdjust,o.y);return{x:a,y:c,x2:a+s,y2:c+r,width:s,height:r,centerX:a+s/2,centerY:c+r/2}}function Qm(n,e,t=0,i){return n-md(e,i)+t}function LM(n,e){let{pointX:t,pointY:i,options:s}=e,r=s.callout,o=r&&r.display&&HM(e,r);if(!o||jM(e,r,o))return;if(n.save(),n.beginPath(),!ii(n,r))return n.restore();let{separatorStart:c,separatorEnd:d}=FM(e,o),{sideStart:h,sideEnd:f}=zM(e,o,c);(r.margin>0||s.borderWidth===0)&&(n.moveTo(c.x,c.y),n.lineTo(d.x,d.y)),n.moveTo(h.x,h.y),n.lineTo(f.x,f.y);let y=Xi({x:t,y:i},e.getCenterPoint(),xe(-e.rotation));n.lineTo(y.x,y.y),n.stroke(),n.restore()}function FM(n,e){let{x:t,y:i,x2:s,y2:r}=n,o=BM(n,e),a,c;return e==="left"||e==="right"?(a={x:t+o,y:i},c={x:a.x,y:r}):(a={x:t,y:i+o},c={x:s,y:a.y}),{separatorStart:a,separatorEnd:c}}function BM(n,e){let{width:t,height:i,options:s}=n,r=s.callout.margin+s.borderWidth/2;return e==="right"?t+r:e==="bottom"?i+r:-r}function zM(n,e,t){let{y:i,width:s,height:r,options:o}=n,a=o.callout.start,c=WM(e,o.callout),d,h;return e==="left"||e==="right"?(d={x:t.x,y:i+ji(r,a)},h={x:d.x+c,y:d.y}):(d={x:t.x+ji(s,a),y:t.y},h={x:d.x,y:d.y+c}),{sideStart:d,sideEnd:h}}function WM(n,e){let t=e.side;return n==="left"||n==="top"?-t:t}function HM(n,e){let t=e.position;return xy.includes(t)?t:YM(n,e)}function YM(n,e){let{x:t,y:i,x2:s,y2:r,width:o,height:a,pointX:c,pointY:d,centerX:h,centerY:f,rotation:y}=n,g={x:h,y:f},m=e.start,v=ji(o,m),x=ji(a,m),_=[t,t+v,t+v,s],S=[i+x,r,i,r],k=[];for(let D=0;D<4;D++){let T=Xi({x:_[D],y:S[D]},g,xe(y));k.push({position:xy[D],distance:ln(T,{x:c,y:d})})}return k.sort((D,T)=>D.distance-T.distance)[0].position}function VM({x:n,y:e,width:t,height:i,options:s}){let r=s.borderWidth/2,o=me(s.padding);return{x:n+o.left+r,y:e+o.top+r,width:t-o.left-o.right-s.borderWidth,height:i-o.top-o.bottom-s.borderWidth}}function jM(n,e,t){let{pointX:i,pointY:s}=n,r=e.margin,o=i,a=s;return t==="left"?o+=r:t==="right"?o-=r:t==="top"?a+=r:t==="bottom"&&(a-=r),n.inRange(o,a)}var xd=(n,e,t)=>({x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}),ud=(n,e,t)=>xd(e,t,Math.abs((n-e.y)/(t.y-e.y))).x,ey=(n,e,t)=>xd(e,t,Math.abs((n-e.x)/(t.x-e.x))).y,or=n=>n*n,UM=(n,e,{x:t,y:i,x2:s,y2:r},o)=>o==="y"?{start:Math.min(i,r),end:Math.max(i,r),value:e}:{start:Math.min(t,s),end:Math.max(t,s),value:n},ti=class extends Ce{inRange(e,t,i,s){let r=this.options.borderWidth/2;if(i!=="x"&&i!=="y"){let a=or(r),c={mouseX:e,mouseY:t};return KM(this,c,a,s)||iy(this,c,s)}let o=UM(e,t,this.getProps(["x","y","x2","y2"],s),i);return o.value>=o.start-r&&o.value<=o.end+r||iy(this,{mouseX:e,mouseY:t},s,i)}getCenterPoint(e){return Ki(this,e)}draw(e){let{x:t,y:i,x2:s,y2:r,options:o}=this;if(e.save(),!ii(e,o))return e.restore();qi(e,o);let a=Math.atan2(r-i,s-t),c=Math.sqrt(Math.pow(s-t,2)+Math.pow(r-i,2)),{startOpts:d,endOpts:h,startAdjust:f,endAdjust:y}=t2(this);e.translate(t,i),e.rotate(a),e.beginPath(),e.moveTo(0+f,0),e.lineTo(c-y,0),e.shadowColor=o.borderShadowColor,e.stroke(),ly(e,0,f,d),ly(e,c,-y,h),e.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(e,t){let{scales:i,chartArea:s}=e,r=i[t.scaleID],o={x:s.left,y:s.top,x2:s.right,y2:s.bottom},a,c;if(r)a=Ui(r,t.value,NaN),c=Ui(r,t.endValue,a),r.isHorizontal()?(o.x=a,o.x2=c):(o.y=a,o.y2=c);else{let x=i[Cn(i,t,"xScaleID")],_=i[Cn(i,t,"yScaleID")];x&&sy(o,x,{min:t.xMin,max:t.xMax,start:x.left,end:x.right,startProp:"x",endProp:"x2"}),_&&sy(o,_,{min:t.yMin,max:t.yMax,start:_.bottom,end:_.top,startProp:"y",endProp:"y2"})}let{x:d,y:h,x2:f,y2:y}=o,g=$M(o,e.chartArea),m=g?GM({x:d,y:h},{x:f,y},e.chartArea):{x:d,y:h,x2:f,y2:y,width:Math.abs(f-d),height:Math.abs(y-h)};m.centerX=(f+d)/2,m.centerY=(y+h)/2;let v=qM(e,m,t.label);return v._visible=g,m.elements=[{type:"label",optionScope:"label",properties:v}],m}};ti.id="lineAnnotation";var ty={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};ti.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},ty),fill:!1,length:12,start:Object.assign({},ty),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,display:!0,endValue:void 0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},ei.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};ti.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}};ti.defaultRoutes={borderColor:"color"};function $M({x:n,y:e,x2:t,y2:i},{top:s,right:r,bottom:o,left:a}){return!(n<a&&t<a||n>r&&t>r||e<s&&i<s||e>o&&i>o)}function ny({x:n,y:e},t,{top:i,right:s,bottom:r,left:o}){return n<o&&(e=ey(o,{x:n,y:e},t),n=o),n>s&&(e=ey(s,{x:n,y:e},t),n=s),e<i&&(n=ud(i,{x:n,y:e},t),e=i),e>r&&(n=ud(r,{x:n,y:e},t),e=r),{x:n,y:e}}function GM(n,e,t){let{x:i,y:s}=ny(n,e,t),{x:r,y:o}=ny(e,n,t);return{x:i,y:s,x2:r,y2:o,width:Math.abs(r-i),height:Math.abs(o-s)}}function KM(n,{mouseX:e,mouseY:t},i=Qn,s){let{x:r,y:o,x2:a,y2:c}=n.getProps(["x","y","x2","y2"],s),d=a-r,h=c-o,f=or(d)+or(h),y=f===0?-1:((e-r)*d+(t-o)*h)/f,g,m;return y<0?(g=r,m=o):y>1?(g=a,m=c):(g=r+y*d,m=o+y*h),or(e-g)+or(t-m)<=i}function iy(n,{mouseX:e,mouseY:t},i,s){let r=n.label;return r.options.display&&r.inRange(e,t,s,i)}function sy(n,e,t){let i=my(e,t);n[t.startProp]=i.start,n[t.endProp]=i.end}function qM(n,e,t){let i=t.borderWidth,s=me(t.padding),r=wd(n.ctx,t),o=r.width+s.width+i,a=r.height+s.height+i;return ZM(e,t,{width:o,height:a,padding:s},n.chartArea)}function XM(n){let{x:e,y:t,x2:i,y2:s}=n,r=Math.atan2(s-t,i-e);return r>te/2?r-te:r<te/-2?r+te:r}function ZM(n,e,t,i){let{width:s,height:r,padding:o}=t,{xAdjust:a,yAdjust:c}=e,d={x:n.x,y:n.y},h={x:n.x2,y:n.y2},f=e.rotation==="auto"?XM(n):xe(e.rotation),y=JM(s,r,f),g=QM(n,e,{labelSize:y,padding:o},i),m=xd(d,h,g),v={size:y.w,min:i.left,max:i.right,padding:o.left},x={size:y.h,min:i.top,max:i.bottom,padding:o.top},_=oy(m.x,v)+a,S=oy(m.y,x)+c;return{x:_-s/2,y:S-r/2,x2:_+s/2,y2:S+r/2,centerX:_,centerY:S,pointX:m.x,pointY:m.y,width:s,height:r,rotation:zn(f)}}function JM(n,e,t){let i=Math.cos(t),s=Math.sin(t);return{w:Math.abs(n*i)+Math.abs(e*s),h:Math.abs(n*s)+Math.abs(e*i)}}function QM(n,e,t,i){let s,r=e2(n,i);return e.position==="start"?s=ry({w:n.x2-n.x,h:n.y2-n.y},t,e,r):e.position==="end"?s=1-ry({w:n.x-n.x2,h:n.y-n.y2},t,e,r):s=md(1,e.position),s}function ry(n,e,t,i){let{labelSize:s,padding:r}=e,o=n.w*i.dx,a=n.h*i.dy,c=o>0&&(s.w/2+r.left-i.x)/o,d=a>0&&(s.h/2+r.top-i.y)/a;return gd(Math.max(c,d),0,.25)}function e2(n,e){let{x:t,x2:i,y:s,y2:r}=n,o=Math.min(s,r)-e.top,a=Math.min(t,i)-e.left,c=e.bottom-Math.max(s,r),d=e.right-Math.max(t,i);return{x:Math.min(a,d),y:Math.min(o,c),dx:a<=d?1:-1,dy:o<=c?1:-1}}function oy(n,e){let{size:t,min:i,max:s,padding:r}=e,o=t/2;return t>s-i?(s+i)/2:(i>=n-r-o&&(n=i+r+o),s<=n+r+o&&(n=s-r-o),n)}function t2(n){let e=n.options,t=e.arrowHeads&&e.arrowHeads.start,i=e.arrowHeads&&e.arrowHeads.end;return{startOpts:t,endOpts:i,startAdjust:ay(n,t),endAdjust:ay(n,i)}}function ay(n,e){if(!e||!e.display)return 0;let{length:t,width:i}=e,s=n.options.borderWidth/2,r={x:t,y:i+s};return Math.abs(ud(0,r,{x:0,y:s}))}function ly(n,e,t,i){if(!i||!i.display)return;let{length:s,width:r,fill:o,backgroundColor:a,borderColor:c}=i,d=Math.abs(e-s)+t;n.beginPath(),qi(n,i),ii(n,i),n.moveTo(d,-r),n.lineTo(e+t,0),n.lineTo(d,r),o===!0?(n.fillStyle=a||c,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}var ni=class extends Ce{inRange(e,t,i,s){let r=this.options.rotation,o=this.options.borderWidth;if(i!=="x"&&i!=="y")return n2({x:e,y:t},this.getProps(["width","height","centerX","centerY"],s),r,o);let{x:a,y:c,x2:d,y2:h}=this.getProps(["x","y","x2","y2"],s),f=o/2,y=i==="y"?{start:c,end:h}:{start:a,end:d},g=Xi({x:e,y:t},this.getCenterPoint(s),xe(-r));return g[i]>=y.start-f-Qn&&g[i]<=y.end+f+Qn}getCenterPoint(e){return Ki(this,e)}draw(e){let{width:t,height:i,centerX:s,centerY:r,options:o}=this;e.save(),bd(e,this.getCenterPoint(),o.rotation),qi(e,this.options),e.beginPath(),e.fillStyle=o.backgroundColor;let a=ii(e,o);e.ellipse(s,r,i/2,t/2,te/2,0,2*te),e.fill(),a&&(e.shadowColor=o.borderShadowColor,e.stroke()),e.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(e,t){return wy(e,t)}};ni.id="ellipseAnnotation";ni.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,label:Object.assign({},Tn.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};ni.defaultRoutes={borderColor:"color",backgroundColor:"color"};ni.descriptors={label:{_fallback:!0}};function n2(n,e,t,i){let{width:s,height:r,centerX:o,centerY:a}=e,c=s/2,d=r/2;if(c<=0||d<=0)return!1;let h=xe(t||0),f=i/2||0,y=Math.cos(h),g=Math.sin(h),m=Math.pow(y*(n.x-o)+g*(n.y-a),2),v=Math.pow(g*(n.x-o)-y*(n.y-a),2);return m/Math.pow(c+f,2)+v/Math.pow(d+f,2)<=1.0001}var $i=class extends Ce{inRange(e,t,i,s){let{x:r,y:o,x2:a,y2:c,width:d}=this.getProps(["x","y","x2","y2","width"],s),h=this.options.borderWidth;if(i!=="x"&&i!=="y")return vM({x:e,y:t},this.getCenterPoint(s),d/2,h);let f=h/2,y=i==="y"?{start:o,end:c,value:t}:{start:r,end:a,value:e};return y.value>=y.start-f&&y.value<=y.end+f}getCenterPoint(e){return Ki(this,e)}draw(e){let t=this.options,i=t.borderWidth;if(t.radius<.1)return;e.save(),e.fillStyle=t.backgroundColor,qi(e,t);let s=ii(e,t);t.borderWidth=0,Hn(e,t,this.centerX,this.centerY),s&&!yd(t.pointStyle)&&(e.shadowColor=t.borderShadowColor,e.stroke()),e.restore(),t.borderWidth=i}resolveElementProperties(e,t){return by(e,t)}};$i.id="pointAnnotation";$i.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};$i.defaultRoutes={borderColor:"color",backgroundColor:"color"};var Gi=class extends Ce{inRange(e,t,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&s2(this.elements,e,t,s);let r=Xi({x:e,y:t},this.getCenterPoint(s),xe(-this.options.rotation)),o=this.elements.map(d=>i==="y"?d.bY:d.bX),a=Math.min(...o),c=Math.max(...o);return r[i]>=a&&r[i]<=c}getCenterPoint(e){return Ki(this,e)}draw(e){let{elements:t,options:i}=this;e.save(),e.beginPath(),e.fillStyle=i.backgroundColor,qi(e,i);let s=ii(e,i),r=!0;for(let o of t)r?(e.moveTo(o.x,o.y),r=!1):e.lineTo(o.x,o.y);e.closePath(),e.fill(),s&&(e.shadowColor=i.borderShadowColor,e.stroke()),e.restore()}resolveElementProperties(e,t){let i=by(e,t),{x:s,y:r}=i,{sides:o,rotation:a}=t,c=[],d=2*te/o,h=a*Hr;for(let f=0;f<o;f++,h+=d)c.push(i2(i,t,h));return i.elements=c,i.initProperties={x:s,y:r},i}};Gi.id="polygonAnnotation";Gi.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};Gi.defaultRoutes={borderColor:"color",backgroundColor:"color"};function i2({centerX:n,centerY:e},{radius:t,borderWidth:i},s){let r=i/2,o=Math.sin(s),a=Math.cos(s),c={x:n+o*t,y:e-a*t};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:n+o*(t+r),bY:e-a*(t+r)}}}function s2(n,e,t,i){let s=!1,r=n[n.length-1].getProps(["bX","bY"],i);for(let o of n){let a=o.getProps(["bX","bY"],i);a.bY>t!=r.bY>t&&e<(r.bX-a.bX)*(t-a.bY)/(r.bY-a.bY)+a.bX&&(s=!s),r=a}return s}var kn={box:Tn,ellipse:ni,label:ei,line:ti,point:$i,polygon:Gi};Object.keys(kn).forEach(n=>{q.describe(`elements.${kn[n].id}`,{_fallback:"plugins.annotation.common"})});var r2={update:Object.assign};function _d(n="line"){return kn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function o2(n,e,t,i){let s=l2(n,t.animations,i),r=e.annotations,o=u2(e.elements,r);for(let a=0;a<r.length;a++){let c=r[a],d=_y(o,a,c.type),h=c.setContext(d2(n,d,c)),f=d.resolveElementProperties(n,h);f.skip=a2(f),"elements"in f&&(c2(d,f,h,s),delete f.elements),ve(d.x)||Object.assign(d,f),f.options=Sy(h),s.update(d,f)}}function a2(n){return isNaN(n.x)||isNaN(n.y)}function l2(n,e,t){return t==="reset"||t==="none"||t==="resize"?r2:new Si(n,e)}function c2(n,{elements:e,initProperties:t},i,s){let r=n.elements||(n.elements=[]);r.length=e.length;for(let o=0;o<e.length;o++){let a=e[o],c=a.properties,d=_y(r,o,a.type,t),h=i[a.optionScope].override(a);c.options=Sy(h),s.update(d,c)}}function _y(n,e,t,i){let s=kn[_d(t)],r=n[e];return(!r||!(r instanceof s))&&(r=n[e]=new s,K(i)&&Object.assign(r,i)),r}function Sy(n){let e=kn[_d(n.type)],t={};t.id=n.id,t.type=n.type,t.drawTime=n.drawTime,Object.assign(t,hd(n,e.defaults),hd(n,e.defaultRoutes));for(let i of pd)t[i]=n[i];return t}function hd(n,e){let t={};for(let i of Object.keys(e)){let s=e[i],r=n[i];t[i]=K(s)?hd(r,s):r}return t}function d2(n,e,t){return e.$context||(e.$context=Object.assign(Object.create(n.getContext()),{element:e,id:t.id,type:"annotation"}))}function u2(n,e){let t=e.length,i=n.length;if(i<t){let s=t-i;n.splice(i,0,...new Array(s))}else i>t&&n.splice(t,i-t);return n}var h2="2.1.1",Sn=new Map,ky={id:"annotation",version:h2,beforeRegister(){xM("chart.js","3.7",Ne.version)},afterRegister(){Ne.register(kn)},afterUnregister(){Ne.unregister(kn)},beforeInit(n){Sn.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hovered:[]})},beforeUpdate(n,e,t){let i=Sn.get(n),s=i.annotations=[],r=t.annotations;K(r)?Object.keys(r).forEach(o=>{let a=r[o];K(a)&&(a.id=o,s.push(a))}):oe(r)&&s.push(...r),EM(s,n.scales)},afterDataLimits(n,e){let t=Sn.get(n);MM(n,e.scale,t.annotations.filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,e,t){let i=Sn.get(n);pM(n,i,t),o2(n,i,t,e.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display)},beforeDatasetsDraw(n,e,t){Ia(n,"beforeDatasetsDraw",t.clip)},afterDatasetsDraw(n,e,t){Ia(n,"afterDatasetsDraw",t.clip)},beforeDraw(n,e,t){Ia(n,"beforeDraw",t.clip)},afterDraw(n,e,t){Ia(n,"afterDraw",t.clip)},beforeEvent(n,e,t){let i=Sn.get(n);gM(i,e.event,t)&&(e.changed=!0)},afterDestroy(n){Sn.delete(n)},_getState(n){return Sn.get(n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!pd.includes(n),annotations:{_allKeys:!1,_fallback:(n,e)=>`elements.${kn[_d(e.type)].id}`},interaction:{_fallback:!0},common:{label:{_fallback:!0}}},additionalOptionScopes:[""]};function Ia(n,e,t){let{ctx:i,chartArea:s}=n,{visibleElements:r}=Sn.get(n);t&&Yn(i,s);let o=f2(r,e).sort((a,c)=>a.options.z-c.options.z);for(let a of o)a.draw(n.ctx,s);t&&Vn(i)}function f2(n,e){let t=[];for(let i of n)if(i.options.drawTime===e&&t.push(i),i.elements&&i.elements.length)for(let s of i.elements)s.options.display&&s.options.drawTime===e&&t.push(s);return t}var{useEffect:p2,useState:Cy}=window.React,{HandleFetch:U7,HandleResponse:$7}=window.getGenie.Components.Common.RequestManager,{Libs:G7,Utilities:g2}=window.getGenie.Components.Common,{ComposeComponents:m2}=window.getGenie.Components.Common.ReduxManager,{Empty:y2,Popover:b2}=window.antd,{isExistDomain:w2}=g2.GenieHelpers;Ne.register(Xt,gn,mt,To,Do,Ni,No,ky);var v2=m2(({setSidebar:n,sidebar:e,getInputs:t})=>{let[i,s]=Cy({name:"Word count",dataName:"words",activeTabIndex:0}),r=(t.competitorData||[]).filter(k=>!w2(k?.url)).slice(0,10),o=t.serpVisualize,a={words:[],headings:[],images:[],internalLinks:[],externalLinks:[]};for(let k of r)for(let[D,T]of Object.entries(k?.stat||{}))!a[D]||a[D].push(T);let[c,d]=Cy([]);p2(()=>{let k=a[i.dataName];d(k)},[i]);let h=0,f=0,y=0;c.length>0&&(h=c?.reduce((k,D)=>k+D,0),h=Math.ceil(h/c?.length),f=c?.reduce((k,D)=>Math.min(k,D)),y=c?.reduce((k,D)=>Math.max(k,D),0));let g=k=>{let D=k.chart.data.datasets[0].data;return D.reduce((M,O)=>M+O,0)/D.length},m=[{name:"word count",dataName:"words"},{name:"headings",dataName:"headings"},{name:"images",dataName:"images"},{name:"internal links",dataName:"internalLinks"},{name:"external links",dataName:"externalLinks"}],v=(k,D)=>{s({...k,activeTabIndex:D})},x={responsive:!0,layout:{padding:{top:25,right:0,left:0,bottom:0}},plugins:{datalabels:{display:!1,color:"#97ACFF",align:"end",rotation:270,anchor:"end",font:{size:"10"},formatter:function(k){if(k<1e3)return k;if(k>=1e3&&k<1e6)return+(k/1e3).toFixed(1)+"K";if(k>=1e6&&k<1e9)return+(k/1e6).toFixed(1)+"M";if(k>=1e9&&k<1e12)return+(k/1e9).toFixed(1)+"B";if(k>=1e12)return+(k/1e12).toFixed(1)+"T"}},legend:{display:!1},tooltip:{enabled:!0,rtl:!1,backgroundColor:"#031233",callback:{}},annotation:{annotations:{line1:{type:"line",borderColor:"#14A645",borderDash:[4,4],borderDashOffset:0,borderWidth:1,scaleID:"y",value:k=>g(k)}}}},scales:{x:{grid:{display:!0},ticks:{callback:function(k,D,T){return(r[D]?.keySlug||"").replace(/www.|\.[^.]+$/gm,"")}}},y:{grid:{borderWidth:0},ticks:{callback:function(k){if(k<1e3)return k;if(k>=1e3&&k<1e6)return+(k/1e3).toFixed(1)+"K";if(k>=1e6&&k<1e9)return+(k/1e6).toFixed(1)+"M";if(k>=1e9&&k<1e12)return+(k/1e9).toFixed(1)+"B";if(k>=1e12)return+(k/1e12).toFixed(1)+"T"}}}}},S={labels:c.map(k=>k),datasets:[{label:e.__("Content","getgenie"),data:c.map(k=>k),backgroundColor:"#97ACFF",barPercentage:.2,borderRadius:10}]};return React.createElement("div",{className:"getgenie-serp-visualization"},React.createElement(b2,{content:React.createElement("div",{className:"getgenie-serpVisualization-container"},React.createElement("h5",{className:"serpVisualization-header"},"SERP Visualizer"),React.createElement("h6",{className:"serpVisualization-sub-header"},"Metrics"),React.createElement("div",{className:"getgenie-serpVisualization-tab-container"},m.map((k,D)=>React.createElement("p",{key:D,className:`tab-name ${i.activeTabIndex===D?"active-tab":""}`,onClick:()=>v(k,D)},k.name))),c?.length===0||c?.every(k=>k==0)?React.createElement(y2,{description:e.__("No data found.","getgenie"),className:"getgenie-chart empty"}):React.createElement(React.Fragment,null,React.createElement("div",{className:"visualization-data-highlights"},React.createElement("p",null," ",React.createElement("span",{className:"data-name average-data"},"Average : ")," ",React.createElement("span",{className:"data-count"},h)," "),React.createElement("p",null," ",React.createElement("span",{className:"data-name"},"Min : ")," ",React.createElement("span",{className:"data-count"},f)," "),React.createElement("p",null," ",React.createElement("span",{className:"data-name"},"Max : ")," ",React.createElement("span",{className:"data-count"},y)," ")),React.createElement(Ro,{options:x,data:S}))),overlayClassName:"getgenie-serpVisualization-popover",overlayStyle:{width:"700px",height:"494px"},placement:"left",visible:o,zIndex:9999}))},["setSidebar","sidebar","getInputs"]),Ty=v2;var{Libs:Dy}=window.getGenie.Components.Common,{Col:Oy,Divider:x2,Row:_2}=window.antd,{ComposeComponents:S2}=window.getGenie.Components.Common.ReduxManager,{useEffect:My}=window.React,k2=S2(({getInputs:n,setInput:e,setSidebar:t,sidebar:i})=>{let s=n.headTohead||!1,r=n.serpVisualize||!1;return My(()=>{n.serpVisualize&&e("headTohead",!1)},[n.serpVisualize]),My(()=>{n.headTohead&&e("serpVisualize",!1)},[n.headTohead]),React.createElement(React.Fragment,null,React.createElement("div",{className:"getgenie-scoreanalysis-competitor-screen"},React.createElement("div",{className:"getgenie-headtohead"},React.createElement(_2,{justify:"space-between",align:"middle"},React.createElement(Oy,{order:2,span:10,className:"comparison-switch"},React.createElement(Dy.Switch,{label:"SERP Visualizer",defaultChecked:r,name:"serpVisualize"})),React.createElement(Oy,{order:1,span:10,className:"comparison-switch"},React.createElement(Dy.Switch,{className:"h2h-comparison",label:"H2H Comparison",defaultChecked:s,name:"headTohead"})))),React.createElement(Ty,null),React.createElement(x2,{className:"genie-divider"}),React.createElement("div",{className:"getgenie-statistics-container"},React.createElement(Pr,{data:n.competitorData}))))},["sidebar","getInputs","setInput","setSidebar"]),Ey=k2;var{ComposeComponents:C2}=window.getGenie.Components.Common.ReduxManager,{Libs:T2}=window.getGenie.Components.Common,{useState:D2,useEffect:Py}=window.React,O2=C2(({sidebar:n,visible:e,width:t,limitUsage:i})=>{let[s,r]=D2({});Py(()=>{r(n.competitorStats?.headToHeadData||{})},[n.competitorStats]);let o=(m,v)=>{if(m==0||!v||v?.length<2)return"";if(m>=v[0]&&m<=parseInt(v[1]))return"heatmap-green";if(m>=parseInt(v[1]))return"heatmap-red";if(m<v[0])return"heatmap-yellow"},a=m=>{var v=/^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/;return!!v.test(m)},c="",d="";if(Object.keys(s).length>0){var h="",f=!1;c+=`<div class="header-statistic">
        <div><p>Google Rank:</p></div></div>`;for(let[m,v]of Object.entries(s.serpDomains)){if(c+=`<div class="domain-content statistic statistic-url domain-content-url ${m=="myContent_0"?"my_content_el":""}">
      <div class="url-text">
      `,c+=`<span class='text-content'>
        ${v?.rank!==0?a(v?.favicon)?`<img class="favicon" src="${v?.favicon}" />`:'<span class="getgenie-icon-earth favicon"></span>':""}
        ${v?.rank==0?"My Content":(v?.url||"").replace(/http(s)?(:)?(\/\/)?|(\/\/)?(www\.)?/g,"")}
        </span></div>${v?.rank==0?`<span class="google-rank"> 
              <img src="${window.getGenie.config.assetsUrl}dist/admin/images/myContent.svg" />
            </span>`:`<span class="google-rank">${v?.rank}</span>`}
        </div>`,v.rank<4)var y='<div  class="statistic statistic-heatmap-col">';else var y='<div class="statistic statistic-heatmap-col blur-element">';for(let[x,_]of Object.entries(s.statistics))f===!1&&(h+='<div style="display: flex;">',h+=`<div class="keyPhrase"> <span class="getgenie-icon-copy"></span> 
          <p class="keyPhrase-keyword">${_?.keyPhrase}</p> 
          <p class="getgenie-custom-tooltip"></p> 
          <p class="getgenie-hover-tooltip"></p>
          </div>`,h+='<div class="keyword-recommendation">'+(_?.recommendation||[]).join("-")+'<span class="getgenie-hover-tooltip">Ideal range of keyword count</span></div> </div>'),y+=`<div class="statisticData ${o(_?.heatMap[m]?.matchedKeyPhrase||0,_?.recommendation)}">${_?.heatMap[m]?.matchedKeyPhrase||0}</div>`;y+="</div>",f===!1&&(d+='<div class="statistic">'+h+"</div>",f=!0),d+=y}}let g=(m,v,x,_)=>{m.forEach((S,k)=>{let D=_[k],T=v[k];T&&(T.scrollWidth>T.clientWidth?D=_[k]:_[k].classList.add("d-none"));let M=T?.innerText,O="";typeof M=="string"?O=M.replace(/<br\s*[\/]?>/g,`
`):Array.isArray(M)&&(O=M.join(",").replace(/<br\s*[\/]?>/g,`
`)),D.innerText=O,S.addEventListener("click",()=>{let E=x[k];E.style.display="block",E.innerText="Copied",setTimeout(()=>{E.style.display="none",E.innerText=""},1500),Pn.copyToClipboard(O).then(()=>{}).catch(()=>console.log("error"))})})};return Py(()=>{let m=document.getElementById("getgenie-container"),v=m.shadowRoot?.querySelector(".keyword-heatmap-wrapper");var x=new MutationObserver(function(_,S){for(let k of _)if(k.target.className.includes("keyword-heatmap-wrapper")===!0){let D=m.shadowRoot.querySelectorAll(".keyPhrase"),T=m.shadowRoot.querySelectorAll(".keyPhrase .keyPhrase-keyword"),M=m.shadowRoot.querySelectorAll(".keyPhrase .getgenie-custom-tooltip"),O=m.shadowRoot.querySelectorAll(".keyPhrase .getgenie-hover-tooltip");g(D,T,M,O)}});x.observe(v,{subtree:!0,attributes:!0,childList:!0})},[s]),React.createElement("div",{className:`keyword-heatmap-wrapper ${e?"":"d-none"}`,style:{width:`${t}px`}},React.createElement(T2.BlurElement,{top:730,show:i.subscription_type!=="pro",text:"Reveal NLP keywords, optimize, and rank better.",btnText:"Upgrade and optimize now",href:"https://getgenie.ai/pricing/",textMargin:0},React.createElement("div",{id:"header",dangerouslySetInnerHTML:{__html:c}}),React.createElement("div",{id:"body",dangerouslySetInnerHTML:{__html:d}})))},["sidebar","limitUsage"]),Ay=O2;var{useEffect:M2,useState:Sd}=window.React,{HandleFetch:E2,HandleResponse:P2}=window.getGenie.Components.Common.RequestManager,{Libs:Ny,Utilities:A2}=window.getGenie.Components.Common,{ComposeComponents:N2}=window.getGenie.Components.Common.ReduxManager,{Collapse:Ry,Button:R2}=window.antd,{Panel:I2}=Ry,L2=N2(({setSidebar:n,sidebar:e})=>{let t=window.getGenie.blogWizardData.plagiarismStat?.plagiarismData,[i,s]=Sd(t||[]),[r,o]=Sd(!1),[a,c]=Sd(!1);return M2(()=>{window.getGenie.blogWizardData.PlagiarismStat={plagiarismData:i},A2.GenieHelpers.callStoreApi("plagiarismStat",{plagiarismData:i})},[i]),React.createElement("div",{className:"getgenie-Plagiarism"},React.createElement("div",{className:"getgenie-Plagiarism-container"},React.createElement("div",{className:"getgenie-Plagiarism-container-child"},React.createElement("div",{className:"getgenie-Plagiarism-data-fetchBtn"},r?React.createElement("h5",{className:"getgenie-loading-state"},React.createElement("span",null,"Scanning your content"),React.createElement(Ny.Loading,{size:25})," "):React.createElement(R2,{className:"getgenie-fetch-competitor-btn",onClick:()=>{let h=e.currentPostContent;h=h.replace(/<\/?[^>]+(>|$)/g,""),h=h.split(/\r?\n/).filter(f=>f.trim()!=="").join(`
`),o(!0),c(!1),E2(f=>{o(!1),P2(f,()=>{let y=f.data?.result||[];if(s(y),y.length===0){c(!0);return}})},"plagiarismData",{input:{textContent:h}})}},e.__("Check Plagiarism","getgenie"))),r&&[...Array(5).keys()].map((h,f)=>React.createElement(Ny.SkeletonCard,{count:1,key:f})),i.length>0&&React.createElement(Ry,{expandIconPosition:"right",accordion:!0,expandIcon:()=>React.createElement("span",{className:"getgenie-icon-arrow_down"})},i.map((h,f)=>React.createElement(I2,{header:React.createElement("h5",{className:"getgenie-Plagiarism-accordian-heading"},h.title),key:f},React.createElement("div",{className:"getgenie-Plagiarism-link-container"},React.createElement("p",null,React.createElement("span",null,`${h.minwordsmatched}+`)," Words Matched"),React.createElement("a",{href:h.viewurl,className:"getgenie-Plagiarism-link",target:"_blank"},React.createElement("span",null,"See Details"),React.createElement("img",{src:e.imageUrl+"/new_tab.png",alt:""}))),React.createElement("p",{className:"getgenie-content-container"},h.textsnippet)))),a&&React.createElement("p",{className:"getgenie-Plagiarism-notfound"},"No match found!"))))},["setSidebar","sidebar"]),Iy=L2;var{Libs:Ly,Utilities:rF}=window.getGenie.Components.Common,{ComposeComponents:F2}=window.getGenie.Components.Common.ReduxManager,{Tabs:B2}=window.antd,{TabPane:oF}=B2,{useState:z2,useEffect:W2}=window.React,H2=F2(({setSidebar:n,sidebar:e,setInput:t})=>{let[i,s]=z2("blogAnalysis");W2(()=>{t("headTohead",!1),t("serpVisualize",!1)},[i,e.open]);let r=a=>{s(a)},o=[{label:"Content Score",key:"blogAnalysis",children:React.createElement(Gm,null)},{label:"Competitor",key:"competitor",children:React.createElement(Ey,null)},{label:"Plagiarism",key:"plagiarism",children:React.createElement(Iy,null)}];return React.createElement(React.Fragment,null,React.createElement(Ly.DrawerHeader,null),React.createElement(Ly.Navbar,{tabPaneList:o,activeKey:i,handleActiveKey:r,className:"getgenie-statistics-navbar"}))},["setSidebar","sidebar","setInput"]);var{Libs:gF}=window.getGenie.Components.Common,mF=wp.data.select("getgenie").sidebar();var{useEffect:Y2}=window.React,{ComposeComponents:V2}=window.getGenie.Components.Common.ReduxManager,j2=V2(({templates:n,setSidebar:e,sidebar:t,setInput:i})=>(Y2(()=>{e({toolbarWriting:!1}),i("updateContent",""),n.list.length&&wp.hooks.addFilter("editor.BlockEdit","getgenie/blockeditautocomplete",wp.compose.createHigherOrderComponent(s=>{let r={name:"Autocomplete",triggerPrefix:"\\",options:n.list,getOptionLabel:a=>React.createElement("span",null,a.title),getOptionKeywords:a=>[a.templateSlug,a.title],getOptionCompletion:a=>(e({open:!0,currentTemplate:a.templateSlug,component:"WriteTemplatesScreen",analyzeKeyword:{...t.analyzeKeyword,open:!1},generatedOutlines:{...t.generatedOutlines,open:!1},currentWritingMode:"template"}),"")},o=(a,c)=>c==="core/paragraph"?a.concat(r):a;return wp.hooks.addFilter("editor.Autocomplete.completers","genieai/autocompleteTemplates",o),a=>React.createElement(s,{...a})},"withClientIdClassName"))},[n]),""),["templates","setSidebar","sidebar","setInput"]),Fy=j2;var{BlogScreen:U2,OutlineScreen:$2,ParagraphGenerator:G2}=Aa,{ScoreAnalysis:K2,KeywordHeatMap:q2}=Fa;window.getGenie.Components={...window.getGenie.Components,AutocompleteTemplates:Fy,BlogWizardUtils:pi,Sidebar:{...window.getGenie.Components.Sidebar||{},BlogScreen:U2,OutlineScreen:$2,AnalyzeKeywordScreen:Ic,ScoreAnalysis:K2,KeywordHeatMap:q2,ParagraphGenerator:G2}};})();
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/*!
 * @kurkle/color v0.2.1
 * https://github.com/kurkle/color#readme
 * (c) 2022 Jukka Kurkela
 * Released under the MIT License
 */
/*!
 * Chart.js v3.9.1
 * https://www.chartjs.org
 * (c) 2022 Chart.js Contributors
 * Released under the MIT License
 */
/*!
 * chartjs-plugin-datalabels v2.1.0
 * https://chartjs-plugin-datalabels.netlify.app
 * (c) 2017-2022 chartjs-plugin-datalabels contributors
 * Released under the MIT license
 */
/*!
* chartjs-plugin-annotation v2.1.1
* https://www.chartjs.org/chartjs-plugin-annotation/index
 * (c) 2022 chartjs-plugin-annotation Contributors
 * Released under the MIT License
 */
/** @license React v17.0.2
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! moment.js
//! momentjs.com
//! version : 2.29.4