From c6a41efdd95e183c06ff0301f4b7c70bcec78910 Mon Sep 17 00:00:00 2001 From: Abhijit Bhatnagar Date: Mon, 7 Oct 2024 18:18:49 +0530 Subject: [PATCH] checking for data in NewfoldRuntime object instead of calling the Hiive api --- build/index.asset.php | 2 +- build/index.js | 34 +++++++++++++++++----------------- src/utils.js | 16 ++++++---------- 3 files changed, 24 insertions(+), 28 deletions(-) diff --git a/build/index.asset.php b/build/index.asset.php index 74e8883..26323e3 100644 --- a/build/index.asset.php +++ b/build/index.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '9f695924420aef9082a5'); + array('lodash', 'react', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '9fef794e59bde79f9068'); diff --git a/build/index.js b/build/index.js index 0042a36..0c9b36c 100644 --- a/build/index.js +++ b/build/index.js @@ -1,30 +1,30 @@ -!function(){var e={251:function(e,t,n){"use strict";var r=n(196),i=Symbol.for("react.element"),s=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function a(e,t,n){var r,a={},o=null,p=null;for(r in void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),void 0!==t.ref&&(p=t.ref),t)s.call(t,r)&&!c.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:i,type:e,key:o,ref:p,props:a,_owner:l.current}}t.jsx=a,t.jsxs=a},893:function(e,t,n){"use strict";e.exports=n(251)},666:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",a=s.toStringTag||"@@toStringTag";function o(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var s=t&&t.prototype instanceof g?t:g,l=Object.create(s.prototype),c=new H(r||[]);return i(l,"_invoke",{value:E(e,n,c)}),l}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=p;var h="suspendedStart",A="suspendedYield",d="executing",I="completed",m={};function g(){}function b(){}function f(){}var w={};o(w,l,(function(){return this}));var k=Object.getPrototypeOf,y=k&&k(k(z([])));y&&y!==n&&r.call(y,l)&&(w=y);var S=f.prototype=g.prototype=Object.create(w);function v(e){["next","throw","return"].forEach((function(t){o(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function n(i,s,l,c){var a=u(e[i],e,s);if("throw"!==a.type){var o=a.arg,p=o.value;return p&&"object"==typeof p&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,l,c)}),(function(e){n("throw",e,l,c)})):t.resolve(p).then((function(e){o.value=e,l(o)}),(function(e){return n("throw",e,l,c)}))}c(a.arg)}var s;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return s=s?s.then(i,i):i()}})}function E(e,n,r){var i=h;return function(s,l){if(i===d)throw new Error("Generator is already running");if(i===I){if("throw"===s)throw l;return{value:t,done:!0}}for(r.method=s,r.arg=l;;){var c=r.delegate;if(c){var a=x(c,r);if(a){if(a===m)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=I,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var o=u(e,n,r);if("normal"===o.type){if(i=r.done?I:A,o.arg===m)continue;return{value:o.arg,done:r.done}}"throw"===o.type&&(i=I,r.method="throw",r.arg=o.arg)}}}function x(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var s=u(i,e.iterator,n.arg);if("throw"===s.type)return n.method="throw",n.arg=s.arg,n.delegate=null,m;var l=s.arg;return l?l.done?(n[e.resultName]=l.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):l:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function Z(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function H(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function z(e){if(null!=e){var n=e[l];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function n(){for(;++i=0;--s){var l=this.tryEntries[s],c=l.completion;if("root"===l.tryLoc)return i("end");if(l.tryLoc<=this.prev){var a=r.call(l,"catchLoc"),o=r.call(l,"finallyLoc");if(a&&o){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),Z(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;Z(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:z(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},774:function(e){e.exports=function(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(t),a=0;a{switch(t.type){case"INITIALIZE_NAMESPACE":return{...e,[t.namespace]:u};case"UPDATE_HIIVE_URLS":return{...e,[t.namespace]:{...e[t.namespace],urls:{single:t.urls.single,batch:t.urls.batch}}};case"UPDATE_HIIVE_EVENTS_QUEUE":return{...e,[t.namespace]:{...e[t.namespace],queue:{events:t.events,threshold:e[t.namespace].queue.threshold}}};case"UPDATE_HIIVE_EVENTS_QUEUE_THRESHOLD":return{...e,[t.namespace]:{...e[t.namespace],queue:{events:e[t.namespace].queue.events,threshold:t.threshold}}};case"UPDATE_HIIVE_DEBOUNCE_TIME":return{...e,[t.namespace]:{...e[t.namespace],debounce:{time:t.debounceTime,instance:e[t.namespace].debounce.instance}}};case"UPDATE_HIIVE_DEBOUNCE_INSTANCE":return{...e,[t.namespace]:{...e[t.namespace],debounce:{time:e[t.namespace].debounce.time,instance:t.instance}}}}return e}}),actions:e,selectors:t},v=(0,c.createReduxStore)("newfold/ui-analytics",S);(0,c.register)(v);var T=window.wp.apiFetch,E=n.n(T);const x=e=>!!window?.nfdUIAnalytics?.hiive&&e in window.nfdUIAnalytics.hiive,M=async e=>{if(!(e=>e instanceof p)(e)||!x(e.namespace))return!1;const t=e.namespace;delete e.namespace;const n=(0,c.select)(v).getHiiveSingleUrl(t);if(!n)return!1;try{await E()({url:n,method:"POST",data:e})}catch(e){return console.error(e),!1}};var Z,H,z=window.wp.i18n;function R(){return R=Object.assign?Object.assign.bind():function(e){for(var t=1;tE()({path:O+"/search",method:"POST",data:{user_prompt:e,identifier:t,extra:n}}),getDefaultSearchResult:()=>E()({path:O+"/search/default",method:"POST"})};var N,X,W=D;function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"algoliaResult",onClick:t},(0,i.createElement)("p",null,e),(0,i.createElement)("div",{className:"svg"},(0,i.createElement)(V,null)))),L="nfd-help-center/v1",F=()=>E()({path:L+"/capability/brand",method:"GET"}),q={updateHelpVisible:e=>{localStorage.setItem("helpVisible",e?"true":"false")},getHelpVisible:()=>"true"===localStorage.getItem("helpVisible"),persistResult:(e,t)=>{localStorage.setItem("helpResultContent",e),localStorage.setItem("helpPostId",t)},persistSearchInput:e=>{localStorage.setItem("searchInput",e)},clear:()=>{localStorage.removeItem("helpResultContent"),localStorage.removeItem("helpPostId"),localStorage.removeItem("searchInput")},getResultInfo:()=>({content:localStorage.getItem("helpResultContent"),postId:localStorage.getItem("helpPostId")}),getSearchInput:()=>localStorage.getItem("searchInput"),getFeatureFlag(e){return localStorage.getItem(e)},setFeatureFlag(e,t){localStorage.setItem(e,t)}},K=(e,t)=>{const n=new p("wonder_help",e,t,"wonder_help");M(n)};var _,$,ee=({postId:e,source:t})=>{const[n,r]=(0,l.useState)(""),s=(0,l.useRef)(null),c=(0,l.useRef)(null);return(0,l.useEffect)((()=>{r(""),c.current.className="feedback-button no",s.current.className="feedback-button yes"}),[e]),(0,l.useEffect)((()=>{(async()=>{"helpful"!==n&&"notHelpful"!==n||(((e,t)=>{E()({path:L+"/feedback",method:"POST",data:{post_id:e,status:t}})})(e,n),K("help_feedback_submitted",{label_key:"type",type:"helpful"===n?"positive":"negative",source:t,post_id:e,page:window.location.href.toString()}))})(),"helpful"===n&&(s.current.className="feedback-button yes selected-yes",c.current.className="feedback-button no"),"notHelpful"===n&&(c.current.className="feedback-button no selected-no",s.current.className="feedback-button yes")}),[n]),(0,i.createElement)("div",{className:"feedback-container"},(0,i.createElement)("div",{className:"feedback-question"},(0,i.createElement)("p",null,(0,i.createElement)("b",null,(0,z.__)("Did this result help you?","wp-module-help-center")))),(0,i.createElement)("div",{className:"icon"},(0,i.createElement)("button",{ref:s,onClick:()=>{r("helpful")},className:"feedback-button yes"},"helpful"===n&&(0,i.createElement)("span",{className:"feedback-button-emoji",role:"img","aria-label":"helpful"},"🥳"),(0,z.__)("Yes","wp-module-help-center")),(0,i.createElement)("button",{onClick:()=>{r("notHelpful")},ref:c,className:"feedback-button no"},"notHelpful"===n&&(0,i.createElement)("span",{className:"feedback-button-emoji",role:"img","aria-label":"not helpful"},"😭"),(0,z.__)("No","wp-module-help-center"))))};function te(){return te=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(window?.nfdHelpCenter?.resourceLink)return(0,i.createElement)("p",null,(0,z.__)("In the meantime, try searching our","wp-module-help-center")," ",(0,i.createElement)("a",{href:window?.nfdHelpCenter?.resourceLink},(0,z.__)("Resource center.","wp-module-help-center")))},ie=()=>(0,i.createElement)("div",null,(0,i.createElement)("p",null,(0,z.__)("Result based on your search:","wp-module-help-center")),(0,i.createElement)("h4",null,(0,z.__)("Sorry, we don't have any content for that yet.","wp-module-help-center")),(0,i.createElement)("hr",null),(0,i.createElement)(ne,null),(0,i.createElement)("p",null,(0,z.__)("This tool is being built and doesn't always have a match.","wp-module-help-center")),(0,i.createElement)(re,null),(0,i.createElement)("hr",null));let se={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function le(e){se=e}const ce=/[&<>"']/,ae=new RegExp(ce.source,"g"),oe=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,pe=new RegExp(oe.source,"g"),ue={"&":"&","<":"<",">":">",'"':""","'":"'"},he=e=>ue[e];function Ae(e,t){if(t){if(ce.test(e))return e.replace(ae,he)}else if(oe.test(e))return e.replace(pe,he);return e}const de=/(^|[^\[])\^/g;function Ie(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(de,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function me(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const ge={exec:()=>null};function be(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:fe(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=fe(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:fe(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=fe(t[0],"\n").split("\n"),n="",r="";const i=[];for(;e.length>0;){let t=!1;const s=[];let l;for(l=0;l/.test(e[l]))s.push(e[l]),t=!0;else{if(t)break;s.push(e[l])}e=e.slice(l);const c=s.join("\n"),a=c.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1").replace(/^ {0,3}>[ \t]?/gm,"");n=n?`${n}\n${c}`:c,r=r?`${r}\n${a}`:a;const o=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(a,i,!0),this.lexer.state.top=o,0===e.length)break;const p=i[i.length-1];if("code"===p?.type)break;if("blockquote"===p?.type){const t=p,s=t.raw+"\n"+e.join("\n"),l=this.blockquote(s);i[i.length-1]=l,n=n.substring(0,n.length-t.raw.length)+l.raw,r=r.substring(0,r.length-t.text.length)+l.text;break}if("list"!==p?.type);else{const t=p,s=t.raw+"\n"+e.join("\n"),l=this.list(s);i[i.length-1]=l,n=n.substring(0,n.length-p.raw.length)+l.raw,r=r.substring(0,r.length-t.raw.length)+l.raw,e=s.substring(i[i.length-1].raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const s=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let l=!1;for(;e;){let n=!1,r="",c="";if(!(t=s.exec(e)))break;if(this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let a=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),o=e.split("\n",1)[0],p=!a.trim(),u=0;if(this.options.pedantic?(u=2,c=a.trimStart()):p?u=t[1].length+1:(u=t[2].search(/[^ ]/),u=u>4?1:u,c=a.slice(u),u+=t[1].length),p&&/^ *$/.test(o)&&(r+=o+"\n",e=e.substring(o.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const l=e.split("\n",1)[0];if(o=l,this.options.pedantic&&(o=o.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),i.test(o))break;if(s.test(o))break;if(t.test(o))break;if(n.test(e))break;if(o.search(/[^ ]/)>=u||!o.trim())c+="\n"+o.slice(u);else{if(p)break;if(a.search(/[^ ]/)>=4)break;if(i.test(a))break;if(s.test(a))break;if(n.test(a))break;c+="\n"+o}p||o.trim()||(p=!0),r+=l+"\n",e=e.substring(l.length+1),a=o.slice(u)}}i.loose||(l?i.loose=!0:/\n *\n *$/.test(r)&&(l=!0));let h,A=null;this.options.gfm&&(A=/^\[[ xX]\] /.exec(c),A&&(h="[ ] "!==A[0],c=c.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:r,task:!!A,checked:h,loose:!1,text:c,tokens:[]}),i.raw+=r}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));i.loose=n}if(i.loose)for(let e=0;e$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=be(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?s.align.push("right"):/^ *:-+: *$/.test(e)?s.align.push("center"):/^ *:-+ *$/.test(e)?s.align.push("left"):s.align.push(null);for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:s.align[t]}))));return s}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Ae(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=fe(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),we(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return we(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&(!r[3]||!n.match(/[\p{L}\p{N}]/u))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){const n=[...r[0]].length-1;let i,s,l=n,c=0;const a="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=a.exec(t));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(s=[...i].length,r[3]||r[4]){l+=s;continue}if((r[5]||r[6])&&n%3&&!((n+s)%3)){c+=s;continue}if(l-=s,l>0)continue;s=Math.min(s,s+l+c);const t=[...r[0]][0].length,a=e.slice(0,n+r.index+t+s);if(Math.min(n,s)%2){const e=a.slice(1,-1);return{type:"em",raw:a,text:e,tokens:this.lexer.inlineTokens(e)}}const o=a.slice(2,-2);return{type:"strong",raw:a,text:o,tokens:this.lexer.inlineTokens(o)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=Ae(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=Ae(t[1]),n="mailto:"+e):(e=Ae(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=Ae(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=Ae(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:Ae(t[0]),{type:"text",raw:t[0],text:e}}}}const ye=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Se=/(?:[*+-]|\d{1,9}[.)])/,ve=Ie(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Se).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),Te=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ee=/(?!\s*\])(?:\\.|[^\[\]\\])+/,xe=Ie(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Ee).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Me=Ie(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Se).getRegex(),Ze="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",He=/|$))/,ze=Ie("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",He).replace("tag",Ze).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Re=Ie(Te).replace("hr",ye).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ze).getRegex(),Pe={blockquote:Ie(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Re).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:xe,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:ye,html:ze,lheading:ve,list:Me,newline:/^(?: *(?:\n|$))+/,paragraph:Re,table:ge,text:/^[^\n]+/},Be=Ie("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ye).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ze).getRegex(),Ge={...Pe,table:Be,paragraph:Ie(Te).replace("hr",ye).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Be).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ze).getRegex()},je={...Pe,html:Ie("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",He).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ge,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ie(Te).replace("hr",ye).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ve).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ue=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Oe=/^( {2,}|\\)\n(?!\s*$)/,De="\\p{P}\\p{S}",Ne=Ie(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,De).getRegex(),Xe=Ie(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,De).getRegex(),We=Ie("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,De).getRegex(),Qe=Ie("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,De).getRegex(),Je=Ie(/\\([punct])/,"gu").replace(/punct/g,De).getRegex(),Ce=Ie(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ve=Ie(He).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ye=Ie("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Ve).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Le=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Fe=Ie(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Le).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),qe=Ie(/^!?\[(label)\]\[(ref)\]/).replace("label",Le).replace("ref",Ee).getRegex(),Ke=Ie(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ee).getRegex(),_e={_backpedal:ge,anyPunctuation:Je,autolink:Ce,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:Oe,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:ge,emStrongLDelim:Xe,emStrongRDelimAst:We,emStrongRDelimUnd:Qe,escape:Ue,link:Fe,nolink:Ke,punctuation:Ne,reflink:qe,reflinkSearch:Ie("reflink|nolink(?!\\()","g").replace("reflink",qe).replace("nolink",Ke).getRegex(),tag:Ye,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),1===r.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),i=t[t.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?t.push(r):(i.raw+="\n"+r.raw,i.text+="\n"+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.list(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.html(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.def(e))e=e.substring(r.raw.length),i=t[t.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}):(i.raw+="\n"+r.raw,i.text+="\n"+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(r=this.tokenizer.table(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.lheading(e))e=e.substring(r.raw.length),t.push(r);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s)))i=t[t.length-1],n&&"paragraph"===i?.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r),n=s.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),i=t[t.length-1],i&&"text"===i.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,i,s,l,c,a=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(a));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.anyPunctuation.exec(a));)a=a.slice(0,s.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,a,c))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(c=n.raw.slice(-1)),l=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class st{options;parser;constructor(e){this.options=e||se}space(e){return""}code({text:e,lang:t,escaped:n}){const r=(t||"").match(/^\S*/)?.[0],i=e.replace(/\n$/,"")+"\n";return r?'
'+(n?i:Ae(i,!0))+"
\n":"
"+(n?i:Ae(i,!0))+"
\n"}blockquote({tokens:e}){return`
\n${this.parser.parse(e)}
\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)}\n`}hr(e){return"
\n"}list(e){const t=e.ordered,n=e.start;let r="";for(let t=0;t\n"+r+"\n"}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • \n`}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    \n`}table(e){let t="",n="";for(let t=0;t${r}`),"\n\n"+t+"\n"+r+"
    \n"}tablerow({text:e}){return`\n${e}\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`\n`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${e}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),i=me(e);if(null===i)return r;let s='
    ",s}image({href:e,title:t,text:n}){const r=me(e);if(null===r)return n;let i=`${n}{const i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new st(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n,i=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new ke(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,i=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new at;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,i=e.hooks[r],s=t[r];at.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then((e=>s.call(t,e)));const n=i.call(t,e);return s.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return it.lex(e,t??this.defaults)}parser(e,t){return ct.parse(e,t??this.defaults)}parseMarkdown(e,t){return(n,r)=>{const i={...r},s={...this.defaults,...i},l=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===i.async)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==n)return l(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then((t=>e(t,s))).then((e=>s.hooks?s.hooks.processAllTokens(e):e)).then((e=>s.walkTokens?Promise.all(this.walkTokens(e,s.walkTokens)).then((()=>e)):e)).then((e=>t(e,s))).then((e=>s.hooks?s.hooks.postprocess(e):e)).catch(l);try{s.hooks&&(n=s.hooks.preprocess(n));let r=e(n,s);s.hooks&&(r=s.hooks.processAllTokens(r)),s.walkTokens&&this.walkTokens(r,s.walkTokens);let i=t(r,s);return s.hooks&&(i=s.hooks.postprocess(i)),i}catch(e){return l(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+Ae(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function pt(e,t){return ot.parse(e,t)}pt.options=pt.setOptions=function(e){return ot.setOptions(e),pt.defaults=ot.defaults,le(pt.defaults),pt},pt.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},pt.defaults=se,pt.use=function(...e){return ot.use(...e),pt.defaults=ot.defaults,le(pt.defaults),pt},pt.walkTokens=function(e,t){return ot.walkTokens(e,t)},pt.parseInline=ot.parseInline,pt.Parser=ct,pt.parser=ct.parse,pt.Renderer=st,pt.TextRenderer=lt,pt.Lexer=it,pt.lexer=it.lex,pt.Tokenizer=ke,pt.Hooks=at,pt.parse=pt,pt.options,pt.setOptions,pt.use,pt.walkTokens,pt.parseInline,ct.parse,it.lex;const ut=({content:e,noResult:t,postId:n,source:r,showFeedbackSection:s})=>{if(t)return(0,i.createElement)(ie,null);return e&&e.length>0?(0,i.createElement)(i.Fragment,null,(0,i.createElement)((({markdownText:e})=>{const[t,n]=(0,i.useState)("");return(0,i.useEffect)((()=>{const t=pt(e);n(t)}),[e]),(0,i.createElement)("p",{dangerouslySetInnerHTML:{__html:t}})}),{markdownText:e}),s&&e&&e.length>0&&(0,i.createElement)(ee,{postId:n,source:r})):(0,i.createElement)(i.Fragment,null)};var ht,At,dt,It,mt,gt;function bt(){return bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.createElement)(i.Fragment,null,(0,i.createElement)(ft,null)," ",(0,i.createElement)(ft,null)," ",(0,i.createElement)(ft,null)),kt=n(893),yt=function(){return yt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?Wt($t,--Kt):0,Ft--,10===_t&&(Ft=1,Lt--),_t}function sn(){return _t=Kt2||on(_t)>3?"":" "}function hn(e,t){for(;--t&&sn()&&!(_t<48||_t>102||_t>57&&_t<65||_t>70&&_t<97););return an(e,cn()+(t<6&&32==ln()&&32==sn()))}function An(e){for(;sn();)switch(_t){case e:return Kt;case 34:case 39:34!==e&&39!==e&&An(_t);break;case 40:41===e&&An(e);break;case 92:sn()}return Kt}function dn(e,t){for(;sn()&&e+_t!==57&&(e+_t!==84||47!==ln()););return"/*"+an(t,Kt-1)+"*"+jt(47===e?e:sn())}function In(e){for(;!on(ln());)sn();return an(e,Kt)}function mn(e,t){for(var n="",r=0;r6)switch(Wt(e,t+1)){case 109:if(45!==Wt(e,t+4))break;case 102:return Nt(e,/(.+:)(.+)-([^]+)/,"$1"+Mt+"$2-$3$1"+xt+(108==Wt(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Xt(e,"stretch",0)?bn(Nt(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Nt(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,r,i,s,l,c){return Et+n+":"+r+c+(i?Et+n+"-span:"+(s?l:+l-+r)+c:"")+e}));case 4949:if(121===Wt(e,t+6))return Nt(e,":",":"+Mt)+e;break;case 6444:switch(Wt(e,45===Wt(e,14)?18:11)){case 120:return Nt(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Mt+(45===Wt(e,14)?"inline-":"")+"box$3$1"+Mt+"$2$3$1"+Et+"$2box$3")+e;case 100:return Nt(e,":",":"+Et)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Nt(e,"scroll-","scroll-snap-")+e}return e}function fn(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case zt:return void(e.return=bn(e.value,e.length,n));case Pt:return mn([tn(e,{value:Nt(e.value,"@","@"+Mt)})],r);case Ht:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,(function(t){switch(Dt(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":nn(tn(e,{props:[Nt(t,/:(read-\w+)/,":"+xt+"$1")]})),nn(tn(e,{props:[t]})),Ut(e,{props:Yt(n,r)});break;case"::placeholder":nn(tn(e,{props:[Nt(t,/:(plac\w+)/,":"+Mt+"input-$1")]})),nn(tn(e,{props:[Nt(t,/:(plac\w+)/,":"+xt+"$1")]})),nn(tn(e,{props:[Nt(t,/:(plac\w+)/,Et+"input-$1")]})),nn(tn(e,{props:[t]})),Ut(e,{props:Yt(n,r)})}return""}))}}function wn(e){return function(e){return $t="",e}(kn("",null,null,null,[""],e=function(e){return Lt=Ft=1,qt=Jt($t=e),Kt=0,[]}(e),0,[0],e))}function kn(e,t,n,r,i,s,l,c,a){for(var o=0,p=0,u=l,h=0,A=0,d=0,I=1,m=1,g=1,b=0,f="",w=i,k=s,y=r,S=f;m;)switch(d=b,b=sn()){case 40:if(108!=d&&58==Wt(S,u-1)){-1!=Xt(S+=Nt(pn(b),"&","&\f"),"&\f",Gt(o?c[o-1]:0))&&(g=-1);break}case 34:case 39:case 91:S+=pn(b);break;case 9:case 10:case 13:case 32:S+=un(d);break;case 92:S+=hn(cn()-1,7);continue;case 47:switch(ln()){case 42:case 47:Vt(Sn(dn(sn(),cn()),t,n,a),a);break;default:S+="/"}break;case 123*I:c[o++]=Jt(S)*g;case 125*I:case 59:case 0:switch(b){case 0:case 125:m=0;case 59+p:-1==g&&(S=Nt(S,/\f/g,"")),A>0&&Jt(S)-u&&Vt(A>32?vn(S+";",r,n,u-1,a):vn(Nt(S," ","")+";",r,n,u-2,a),a);break;case 59:S+=";";default:if(Vt(y=yn(S,t,n,o,p,i,c,f,w=[],k=[],u,s),s),123===b)if(0===p)kn(S,t,y,y,w,s,u,c,k);else switch(99===h&&110===Wt(S,3)?100:h){case 100:case 108:case 109:case 115:kn(e,y,y,r&&Vt(yn(e,y,y,0,0,i,c,f,i,w=[],u,k),k),i,k,u,c,r?w:k);break;default:kn(S,y,y,y,[""],k,0,c,k)}}o=p=A=0,I=g=1,f=S="",u=l;break;case 58:u=1+Jt(S),A=d;default:if(I<1)if(123==b)--I;else if(125==b&&0==I++&&125==rn())continue;switch(S+=jt(b),b*I){case 38:g=p>0?1:(S+="\f",-1);break;case 44:c[o++]=(Jt(S)-1)*g,g=1;break;case 64:45===ln()&&(S+=pn(sn())),h=ln(),p=u=Jt(f=S+=In(cn())),b++;break;case 45:45===d&&2==Jt(S)&&(I=0)}}return s}function yn(e,t,n,r,i,s,l,c,a,o,p,u){for(var h=i-1,A=0===i?s:[""],d=Ct(A),I=0,m=0,g=0;I0?A[b]+" "+f:Nt(f,/&\f/g,A[b])))&&(a[g++]=w);return en(e,t,n,0===i?Ht:c,a,o,p,u)}function Sn(e,t,n,r){return en(e,t,n,Zt,jt(_t),Qt(e,2,-2),0,r)}function vn(e,t,n,r,i){return en(e,t,n,zt,Qt(e,0,r),Qt(e,r+1,-1),r,i)}var Tn={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},En="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",xn="active",Mn="data-styled-version",Zn="6.1.12",Hn="/*!sc*/\n",zn="undefined"!=typeof window&&"HTMLElement"in window,Rn=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY),Pn=(new Set,Object.freeze([])),Bn=Object.freeze({});var Gn=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),jn=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Un=/(^-|-$)/g;function On(e){return e.replace(jn,"-").replace(Un,"")}var Dn=/(a)(d)/gi,Nn=52,Xn=function(e){return String.fromCharCode(e+(e>25?39:97))};function Wn(e){var t,n="";for(t=Math.abs(e);t>Nn;t=t/Nn|0)n=Xn(t%Nn)+n;return(Xn(t%Nn)+n).replace(Dn,"$1-$2")}var Qn,Jn=5381,Cn=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Vn=function(e){return Cn(Jn,e)};function Yn(e){return Wn(Vn(e)>>>0)}function Ln(e){return"string"==typeof e&&!0}var Fn="function"==typeof Symbol&&Symbol.for,qn=Fn?Symbol.for("react.memo"):60115,Kn=Fn?Symbol.for("react.forward_ref"):60112,$n={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},er={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},tr={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},nr=((Qn={})[Kn]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Qn[qn]=tr,Qn);function rr(e){return("type"in(t=e)&&t.type.$$typeof)===qn?tr:"$$typeof"in e?nr[e.$$typeof]:$n;var t}var ir=Object.defineProperty,sr=Object.getOwnPropertyNames,lr=Object.getOwnPropertySymbols,cr=Object.getOwnPropertyDescriptor,ar=Object.getPrototypeOf,or=Object.prototype;function pr(e,t,n){if("string"!=typeof t){if(or){var r=ar(t);r&&r!==or&&pr(e,r,n)}var i=sr(t);lr&&(i=i.concat(lr(t)));for(var s=rr(e),l=rr(t),c=0;c0?" Args: ".concat(t.join(", ")):""))}var fr=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)if((i<<=1)<0)throw br(16,"".concat(e));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var s=r;s=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,s=r;s=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e0&&(a+="".concat(e,","))})),r+="".concat(l).concat(c,'{content:"').concat(a,'"}').concat(Hn)},s=0;s0?".".concat(t):e},p=a.slice();p.push((function(e){e.type===Ht&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(Or,n).replace(r,o))})),l.prefix&&p.push(fn),p.push(gn);var u=function(e,i,s,c){void 0===i&&(i=""),void 0===s&&(s=""),void 0===c&&(c="&"),t=c,n=i,r=new RegExp("\\".concat(n,"\\b"),"g");var a=e.replace(Dr,""),o=wn(s||i?"".concat(s," ").concat(i," { ").concat(a," }"):a);l.namespace&&(o=Nr(o,l.namespace));var u,h,A,d=[];return mn(o,(u=p.concat((A=function(e){return d.push(e)},function(e){e.root||(e=e.return)&&A(e)})),h=Ct(u),function(e,t,n,r){for(var i="",s=0;s="A"&&e<="Z"};function qr(e){for(var t="",n=0;n>>0);if(!t.hasNameForId(this.componentId,s)){var l=n(i,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,l)}r=Ar(r,s),this.staticRulesId=s}else{for(var c=Cn(this.baseHash,n.hash),a="",o=0;o>>0);t.hasNameForId(this.componentId,h)||t.insertRules(this.componentId,h,n(a,".".concat(h),void 0,this.componentId)),r=Ar(r,h)}}return r},e}(),ri=s().createContext(void 0);ri.Consumer;var ii={};function si(e,t,n){var r=hr(e),l=e,c=!Ln(e),a=t.attrs,o=void 0===a?Pn:a,p=t.componentId,u=void 0===p?function(e,t){var n="string"!=typeof e?"sc":On(e);ii[n]=(ii[n]||0)+1;var r="".concat(n,"-").concat(Yn(Zn+n+ii[n]));return t?"".concat(t,"-").concat(r):r}(t.displayName,t.parentComponentId):p,h=t.displayName,A=void 0===h?function(e){return Ln(e)?"styled.".concat(e):"Styled(".concat(function(e){return e.displayName||e.name||"Component"}(e),")")}(e):h,d=t.displayName&&t.componentId?"".concat(On(t.displayName),"-").concat(t.componentId):t.componentId||u,I=r&&l.attrs?l.attrs.concat(o).filter(Boolean):o,m=t.shouldForwardProp;if(r&&l.shouldForwardProp){var g=l.shouldForwardProp;if(t.shouldForwardProp){var b=t.shouldForwardProp;m=function(e,t){return g(e,t)&&b(e,t)}}else m=g}var f=new ni(n,d,r?l.componentStyle:void 0);function w(e,t){return function(e,t,n){var r=e.attrs,l=e.componentStyle,c=e.defaultProps,a=e.foldedComponentIds,o=e.styledComponentId,p=e.target,u=s().useContext(ri),h=Vr(),A=e.shouldForwardProp||h.shouldForwardProp,d=function(e,t,n){return void 0===n&&(n=Bn),e.theme!==n.theme&&e.theme||t||n.theme}(t,u,c)||Bn,I=function(e,t,n){for(var r,i=yt(yt({},t),{className:void 0,theme:n}),s=0;s2&&Ur.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)}}(),function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var n=Hr(),r=dr([n&&'nonce="'.concat(n,'"'),"".concat(En,'="true"'),"".concat(Mn,'="').concat(Zn,'"')].filter(Boolean)," ");return"")},this.getStyleTags=function(){if(e.sealed)throw br(2);return e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)throw br(2);var n=e.instance.toString();if(!n)return[];var r=((t={})[En]="",t[Mn]=Zn,t.dangerouslySetInnerHTML={__html:n},t),i=Hr();return i&&(r.nonce=i),[s().createElement("style",yt({},r,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new Ur({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw br(2);return s().createElement(Yr,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw br(3)}}(),"__sc-".concat(En,"__");const Ai={"aria-busy":!0,role:"progressbar"},di=ui.div` +!function(){var e={251:function(e,t,n){"use strict";var r=n(196),i=Symbol.for("react.element"),s=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function a(e,t,n){var r,a={},o=null,p=null;for(r in void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),void 0!==t.ref&&(p=t.ref),t)s.call(t,r)&&!c.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:i,type:e,key:o,ref:p,props:a,_owner:l.current}}t.jsx=a,t.jsxs=a},893:function(e,t,n){"use strict";e.exports=n(251)},666:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",a=s.toStringTag||"@@toStringTag";function o(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var s=t&&t.prototype instanceof g?t:g,l=Object.create(s.prototype),c=new H(r||[]);return i(l,"_invoke",{value:E(e,n,c)}),l}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=p;var h="suspendedStart",A="suspendedYield",d="executing",I="completed",m={};function g(){}function b(){}function f(){}var w={};o(w,l,(function(){return this}));var k=Object.getPrototypeOf,y=k&&k(k(z([])));y&&y!==n&&r.call(y,l)&&(w=y);var S=f.prototype=g.prototype=Object.create(w);function v(e){["next","throw","return"].forEach((function(t){o(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function n(i,s,l,c){var a=u(e[i],e,s);if("throw"!==a.type){var o=a.arg,p=o.value;return p&&"object"==typeof p&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,l,c)}),(function(e){n("throw",e,l,c)})):t.resolve(p).then((function(e){o.value=e,l(o)}),(function(e){return n("throw",e,l,c)}))}c(a.arg)}var s;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return s=s?s.then(i,i):i()}})}function E(e,n,r){var i=h;return function(s,l){if(i===d)throw new Error("Generator is already running");if(i===I){if("throw"===s)throw l;return{value:t,done:!0}}for(r.method=s,r.arg=l;;){var c=r.delegate;if(c){var a=x(c,r);if(a){if(a===m)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=I,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var o=u(e,n,r);if("normal"===o.type){if(i=r.done?I:A,o.arg===m)continue;return{value:o.arg,done:r.done}}"throw"===o.type&&(i=I,r.method="throw",r.arg=o.arg)}}}function x(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var s=u(i,e.iterator,n.arg);if("throw"===s.type)return n.method="throw",n.arg=s.arg,n.delegate=null,m;var l=s.arg;return l?l.done?(n[e.resultName]=l.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):l:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function Z(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function H(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function z(e){if(null!=e){var n=e[l];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function n(){for(;++i=0;--s){var l=this.tryEntries[s],c=l.completion;if("root"===l.tryLoc)return i("end");if(l.tryLoc<=this.prev){var a=r.call(l,"catchLoc"),o=r.call(l,"finallyLoc");if(a&&o){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),Z(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;Z(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:z(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},774:function(e){e.exports=function(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(t),a=0;a{switch(t.type){case"INITIALIZE_NAMESPACE":return{...e,[t.namespace]:u};case"UPDATE_HIIVE_URLS":return{...e,[t.namespace]:{...e[t.namespace],urls:{single:t.urls.single,batch:t.urls.batch}}};case"UPDATE_HIIVE_EVENTS_QUEUE":return{...e,[t.namespace]:{...e[t.namespace],queue:{events:t.events,threshold:e[t.namespace].queue.threshold}}};case"UPDATE_HIIVE_EVENTS_QUEUE_THRESHOLD":return{...e,[t.namespace]:{...e[t.namespace],queue:{events:e[t.namespace].queue.events,threshold:t.threshold}}};case"UPDATE_HIIVE_DEBOUNCE_TIME":return{...e,[t.namespace]:{...e[t.namespace],debounce:{time:t.debounceTime,instance:e[t.namespace].debounce.instance}}};case"UPDATE_HIIVE_DEBOUNCE_INSTANCE":return{...e,[t.namespace]:{...e[t.namespace],debounce:{time:e[t.namespace].debounce.time,instance:t.instance}}}}return e}}),actions:e,selectors:t},v=(0,c.createReduxStore)("newfold/ui-analytics",S);(0,c.register)(v);var T=window.wp.apiFetch,E=n.n(T);const x=e=>!!window?.nfdUIAnalytics?.hiive&&e in window.nfdUIAnalytics.hiive,M=async e=>{if(!(e=>e instanceof p)(e)||!x(e.namespace))return!1;const t=e.namespace;delete e.namespace;const n=(0,c.select)(v).getHiiveSingleUrl(t);if(!n)return!1;try{await E()({url:n,method:"POST",data:e})}catch(e){return console.error(e),!1}};var Z,H,z=window.wp.i18n;function R(){return R=Object.assign?Object.assign.bind():function(e){for(var t=1;tE()({path:O+"/search",method:"POST",data:{user_prompt:e,identifier:t,extra:n}}),getDefaultSearchResult:()=>E()({path:O+"/search/default",method:"POST"})};var D,X,W=N;function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"algoliaResult",onClick:t},(0,i.createElement)("p",null,e),(0,i.createElement)("div",{className:"svg"},(0,i.createElement)(V,null)))),L=()=>window.NewfoldRuntime?.plugin?.brand||!1,F={updateHelpVisible:e=>{localStorage.setItem("helpVisible",e?"true":"false")},getHelpVisible:()=>"true"===localStorage.getItem("helpVisible"),persistResult:(e,t)=>{localStorage.setItem("helpResultContent",e),localStorage.setItem("helpPostId",t)},persistSearchInput:e=>{localStorage.setItem("searchInput",e)},clear:()=>{localStorage.removeItem("helpResultContent"),localStorage.removeItem("helpPostId"),localStorage.removeItem("searchInput")},getResultInfo:()=>({content:localStorage.getItem("helpResultContent"),postId:localStorage.getItem("helpPostId")}),getSearchInput:()=>localStorage.getItem("searchInput"),getFeatureFlag(e){return localStorage.getItem(e)},setFeatureFlag(e,t){localStorage.setItem(e,t)}},q=(e,t)=>{const n=new p("wonder_help",e,t,"wonder_help");M(n)};var K,_,$=({postId:e,source:t})=>{const[n,r]=(0,l.useState)(""),s=(0,l.useRef)(null),c=(0,l.useRef)(null);return(0,l.useEffect)((()=>{r(""),c.current.className="feedback-button no",s.current.className="feedback-button yes"}),[e]),(0,l.useEffect)((()=>{(async()=>{"helpful"!==n&&"notHelpful"!==n||(((e,t)=>{E()({path:"nfd-help-center/v1/feedback",method:"POST",data:{post_id:e,status:t}})})(e,n),q("help_feedback_submitted",{label_key:"type",type:"helpful"===n?"positive":"negative",source:t,post_id:e,page:window.location.href.toString()}))})(),"helpful"===n&&(s.current.className="feedback-button yes selected-yes",c.current.className="feedback-button no"),"notHelpful"===n&&(c.current.className="feedback-button no selected-no",s.current.className="feedback-button yes")}),[n]),(0,i.createElement)("div",{className:"feedback-container"},(0,i.createElement)("div",{className:"feedback-question"},(0,i.createElement)("p",null,(0,i.createElement)("b",null,(0,z.__)("Did this result help you?","wp-module-help-center")))),(0,i.createElement)("div",{className:"icon"},(0,i.createElement)("button",{ref:s,onClick:()=>{r("helpful")},className:"feedback-button yes"},"helpful"===n&&(0,i.createElement)("span",{className:"feedback-button-emoji",role:"img","aria-label":"helpful"},"🥳"),(0,z.__)("Yes","wp-module-help-center")),(0,i.createElement)("button",{onClick:()=>{r("notHelpful")},ref:c,className:"feedback-button no"},"notHelpful"===n&&(0,i.createElement)("span",{className:"feedback-button-emoji",role:"img","aria-label":"not helpful"},"😭"),(0,z.__)("No","wp-module-help-center"))))};function ee(){return ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(window?.nfdHelpCenter?.resourceLink)return(0,i.createElement)("p",null,(0,z.__)("In the meantime, try searching our","wp-module-help-center")," ",(0,i.createElement)("a",{href:window?.nfdHelpCenter?.resourceLink},(0,z.__)("Resource center.","wp-module-help-center")))},re=()=>(0,i.createElement)("div",null,(0,i.createElement)("p",null,(0,z.__)("Result based on your search:","wp-module-help-center")),(0,i.createElement)("h4",null,(0,z.__)("Sorry, we don't have any content for that yet.","wp-module-help-center")),(0,i.createElement)("hr",null),(0,i.createElement)(te,null),(0,i.createElement)("p",null,(0,z.__)("This tool is being built and doesn't always have a match.","wp-module-help-center")),(0,i.createElement)(ne,null),(0,i.createElement)("hr",null));let ie={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function se(e){ie=e}const le=/[&<>"']/,ce=new RegExp(le.source,"g"),ae=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,oe=new RegExp(ae.source,"g"),pe={"&":"&","<":"<",">":">",'"':""","'":"'"},ue=e=>pe[e];function he(e,t){if(t){if(le.test(e))return e.replace(ce,ue)}else if(ae.test(e))return e.replace(oe,ue);return e}const Ae=/(^|[^\[])\^/g;function de(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(Ae,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function Ie(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const me={exec:()=>null};function ge(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:be(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=be(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:be(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=be(t[0],"\n").split("\n"),n="",r="";const i=[];for(;e.length>0;){let t=!1;const s=[];let l;for(l=0;l/.test(e[l]))s.push(e[l]),t=!0;else{if(t)break;s.push(e[l])}e=e.slice(l);const c=s.join("\n"),a=c.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1").replace(/^ {0,3}>[ \t]?/gm,"");n=n?`${n}\n${c}`:c,r=r?`${r}\n${a}`:a;const o=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(a,i,!0),this.lexer.state.top=o,0===e.length)break;const p=i[i.length-1];if("code"===p?.type)break;if("blockquote"===p?.type){const t=p,s=t.raw+"\n"+e.join("\n"),l=this.blockquote(s);i[i.length-1]=l,n=n.substring(0,n.length-t.raw.length)+l.raw,r=r.substring(0,r.length-t.text.length)+l.text;break}if("list"!==p?.type);else{const t=p,s=t.raw+"\n"+e.join("\n"),l=this.list(s);i[i.length-1]=l,n=n.substring(0,n.length-p.raw.length)+l.raw,r=r.substring(0,r.length-t.raw.length)+l.raw,e=s.substring(i[i.length-1].raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const s=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let l=!1;for(;e;){let n=!1,r="",c="";if(!(t=s.exec(e)))break;if(this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let a=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),o=e.split("\n",1)[0],p=!a.trim(),u=0;if(this.options.pedantic?(u=2,c=a.trimStart()):p?u=t[1].length+1:(u=t[2].search(/[^ ]/),u=u>4?1:u,c=a.slice(u),u+=t[1].length),p&&/^ *$/.test(o)&&(r+=o+"\n",e=e.substring(o.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const l=e.split("\n",1)[0];if(o=l,this.options.pedantic&&(o=o.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),i.test(o))break;if(s.test(o))break;if(t.test(o))break;if(n.test(e))break;if(o.search(/[^ ]/)>=u||!o.trim())c+="\n"+o.slice(u);else{if(p)break;if(a.search(/[^ ]/)>=4)break;if(i.test(a))break;if(s.test(a))break;if(n.test(a))break;c+="\n"+o}p||o.trim()||(p=!0),r+=l+"\n",e=e.substring(l.length+1),a=o.slice(u)}}i.loose||(l?i.loose=!0:/\n *\n *$/.test(r)&&(l=!0));let h,A=null;this.options.gfm&&(A=/^\[[ xX]\] /.exec(c),A&&(h="[ ] "!==A[0],c=c.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:r,task:!!A,checked:h,loose:!1,text:c,tokens:[]}),i.raw+=r}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));i.loose=n}if(i.loose)for(let e=0;e$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=ge(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?s.align.push("right"):/^ *:-+: *$/.test(e)?s.align.push("center"):/^ *:-+ *$/.test(e)?s.align.push("left"):s.align.push(null);for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:s.align[t]}))));return s}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:he(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^
    /i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=be(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),fe(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return fe(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&(!r[3]||!n.match(/[\p{L}\p{N}]/u))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){const n=[...r[0]].length-1;let i,s,l=n,c=0;const a="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=a.exec(t));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(s=[...i].length,r[3]||r[4]){l+=s;continue}if((r[5]||r[6])&&n%3&&!((n+s)%3)){c+=s;continue}if(l-=s,l>0)continue;s=Math.min(s,s+l+c);const t=[...r[0]][0].length,a=e.slice(0,n+r.index+t+s);if(Math.min(n,s)%2){const e=a.slice(1,-1);return{type:"em",raw:a,text:e,tokens:this.lexer.inlineTokens(e)}}const o=a.slice(2,-2);return{type:"strong",raw:a,text:o,tokens:this.lexer.inlineTokens(o)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=he(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=he(t[1]),n="mailto:"+e):(e=he(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=he(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=he(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:he(t[0]),{type:"text",raw:t[0],text:e}}}}const ke=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ye=/(?:[*+-]|\d{1,9}[.)])/,Se=de(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,ye).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),ve=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Te=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ee=de(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),xe=de(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ye).getRegex(),Me="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ze=/|$))/,He=de("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",Ze).replace("tag",Me).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ze=de(ve).replace("hr",ke).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Me).getRegex(),Re={blockquote:de(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ze).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:Ee,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:ke,html:He,lheading:Se,list:xe,newline:/^(?: *(?:\n|$))+/,paragraph:ze,table:me,text:/^[^\n]+/},Pe=de("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ke).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Me).getRegex(),Be={...Re,table:Pe,paragraph:de(ve).replace("hr",ke).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Pe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Me).getRegex()},Ge={...Re,html:de("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Ze).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:me,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:de(ve).replace("hr",ke).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Se).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},je=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ue=/^( {2,}|\\)\n(?!\s*$)/,Oe="\\p{P}\\p{S}",Ne=de(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Oe).getRegex(),De=de(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Oe).getRegex(),Xe=de("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Oe).getRegex(),We=de("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Oe).getRegex(),Qe=de(/\\([punct])/,"gu").replace(/punct/g,Oe).getRegex(),Je=de(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ce=de(Ze).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ve=de("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Ce).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ye=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Le=de(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Ye).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Fe=de(/^!?\[(label)\]\[(ref)\]/).replace("label",Ye).replace("ref",Te).getRegex(),qe=de(/^!?\[(ref)\](?:\[\])?/).replace("ref",Te).getRegex(),Ke={_backpedal:me,anyPunctuation:Qe,autolink:Je,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:Ue,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:me,emStrongLDelim:De,emStrongRDelimAst:Xe,emStrongRDelimUnd:We,escape:je,link:Le,nolink:qe,punctuation:Ne,reflink:Fe,reflinkSearch:de("reflink|nolink(?!\\()","g").replace("reflink",Fe).replace("nolink",qe).getRegex(),tag:Ve,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),1===r.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),i=t[t.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?t.push(r):(i.raw+="\n"+r.raw,i.text+="\n"+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.list(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.html(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.def(e))e=e.substring(r.raw.length),i=t[t.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}):(i.raw+="\n"+r.raw,i.text+="\n"+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(r=this.tokenizer.table(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.lheading(e))e=e.substring(r.raw.length),t.push(r);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s)))i=t[t.length-1],n&&"paragraph"===i?.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r),n=s.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),i=t[t.length-1],i&&"text"===i.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,i,s,l,c,a=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(a));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.anyPunctuation.exec(a));)a=a.slice(0,s.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,a,c))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(c=n.raw.slice(-1)),l=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class it{options;parser;constructor(e){this.options=e||ie}space(e){return""}code({text:e,lang:t,escaped:n}){const r=(t||"").match(/^\S*/)?.[0],i=e.replace(/\n$/,"")+"\n";return r?'
    '+(n?i:he(i,!0))+"
    \n":"
    "+(n?i:he(i,!0))+"
    \n"}blockquote({tokens:e}){return`
    \n${this.parser.parse(e)}
    \n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)}\n`}hr(e){return"
    \n"}list(e){const t=e.ordered,n=e.start;let r="";for(let t=0;t\n"+r+"\n"}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • \n`}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    \n`}table(e){let t="",n="";for(let t=0;t${r}`),"\n\n"+t+"\n"+r+"
    \n"}tablerow({text:e}){return`\n${e}\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`\n`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${e}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),i=Ie(e);if(null===i)return r;let s='
    ",s}image({href:e,title:t,text:n}){const r=Ie(e);if(null===r)return n;let i=`${n}{const i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new it(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n,i=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new we(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,i=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new ct;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,i=e.hooks[r],s=t[r];ct.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then((e=>s.call(t,e)));const n=i.call(t,e);return s.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return rt.lex(e,t??this.defaults)}parser(e,t){return lt.parse(e,t??this.defaults)}parseMarkdown(e,t){return(n,r)=>{const i={...r},s={...this.defaults,...i},l=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===i.async)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==n)return l(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then((t=>e(t,s))).then((e=>s.hooks?s.hooks.processAllTokens(e):e)).then((e=>s.walkTokens?Promise.all(this.walkTokens(e,s.walkTokens)).then((()=>e)):e)).then((e=>t(e,s))).then((e=>s.hooks?s.hooks.postprocess(e):e)).catch(l);try{s.hooks&&(n=s.hooks.preprocess(n));let r=e(n,s);s.hooks&&(r=s.hooks.processAllTokens(r)),s.walkTokens&&this.walkTokens(r,s.walkTokens);let i=t(r,s);return s.hooks&&(i=s.hooks.postprocess(i)),i}catch(e){return l(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+he(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function ot(e,t){return at.parse(e,t)}ot.options=ot.setOptions=function(e){return at.setOptions(e),ot.defaults=at.defaults,se(ot.defaults),ot},ot.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},ot.defaults=ie,ot.use=function(...e){return at.use(...e),ot.defaults=at.defaults,se(ot.defaults),ot},ot.walkTokens=function(e,t){return at.walkTokens(e,t)},ot.parseInline=at.parseInline,ot.Parser=lt,ot.parser=lt.parse,ot.Renderer=it,ot.TextRenderer=st,ot.Lexer=rt,ot.lexer=rt.lex,ot.Tokenizer=we,ot.Hooks=ct,ot.parse=ot,ot.options,ot.setOptions,ot.use,ot.walkTokens,ot.parseInline,lt.parse,rt.lex;const pt=({content:e,noResult:t,postId:n,source:r,showFeedbackSection:s})=>{if(t)return(0,i.createElement)(re,null);return e&&e.length>0?(0,i.createElement)(i.Fragment,null,(0,i.createElement)((({markdownText:e})=>{const[t,n]=(0,i.useState)("");return(0,i.useEffect)((()=>{const t=ot(e);n(t)}),[e]),(0,i.createElement)("p",{dangerouslySetInnerHTML:{__html:t}})}),{markdownText:e}),s&&e&&e.length>0&&(0,i.createElement)($,{postId:n,source:r})):(0,i.createElement)(i.Fragment,null)};var ut,ht,At,dt,It,mt;function gt(){return gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.createElement)(i.Fragment,null,(0,i.createElement)(bt,null)," ",(0,i.createElement)(bt,null)," ",(0,i.createElement)(bt,null)),wt=n(893),kt=function(){return kt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?Xt(_t,--qt):0,Lt--,10===Kt&&(Lt=1,Yt--),Kt}function rn(){return Kt=qt2||an(Kt)>3?"":" "}function un(e,t){for(;--t&&rn()&&!(Kt<48||Kt>102||Kt>57&&Kt<65||Kt>70&&Kt<97););return cn(e,ln()+(t<6&&32==sn()&&32==rn()))}function hn(e){for(;rn();)switch(Kt){case e:return qt;case 34:case 39:34!==e&&39!==e&&hn(Kt);break;case 40:41===e&&hn(e);break;case 92:rn()}return qt}function An(e,t){for(;rn()&&e+Kt!==57&&(e+Kt!==84||47!==sn()););return"/*"+cn(t,qt-1)+"*"+Gt(47===e?e:rn())}function dn(e){for(;!an(sn());)rn();return cn(e,qt)}function In(e,t){for(var n="",r=0;r6)switch(Xt(e,t+1)){case 109:if(45!==Xt(e,t+4))break;case 102:return Nt(e,/(.+:)(.+)-([^]+)/,"$1"+xt+"$2-$3$1"+Et+(108==Xt(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Dt(e,"stretch",0)?gn(Nt(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Nt(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,r,i,s,l,c){return Tt+n+":"+r+c+(i?Tt+n+"-span:"+(s?l:+l-+r)+c:"")+e}));case 4949:if(121===Xt(e,t+6))return Nt(e,":",":"+xt)+e;break;case 6444:switch(Xt(e,45===Xt(e,14)?18:11)){case 120:return Nt(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+xt+(45===Xt(e,14)?"inline-":"")+"box$3$1"+xt+"$2$3$1"+Tt+"$2box$3")+e;case 100:return Nt(e,":",":"+Tt)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Nt(e,"scroll-","scroll-snap-")+e}return e}function bn(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Ht:return void(e.return=gn(e.value,e.length,n));case Rt:return In([en(e,{value:Nt(e.value,"@","@"+xt)})],r);case Zt:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,(function(t){switch(Ot(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":tn(en(e,{props:[Nt(t,/:(read-\w+)/,":"+Et+"$1")]})),tn(en(e,{props:[t]})),jt(e,{props:Vt(n,r)});break;case"::placeholder":tn(en(e,{props:[Nt(t,/:(plac\w+)/,":"+xt+"input-$1")]})),tn(en(e,{props:[Nt(t,/:(plac\w+)/,":"+Et+"$1")]})),tn(en(e,{props:[Nt(t,/:(plac\w+)/,Tt+"input-$1")]})),tn(en(e,{props:[t]})),jt(e,{props:Vt(n,r)})}return""}))}}function fn(e){return function(e){return _t="",e}(wn("",null,null,null,[""],e=function(e){return Yt=Lt=1,Ft=Qt(_t=e),qt=0,[]}(e),0,[0],e))}function wn(e,t,n,r,i,s,l,c,a){for(var o=0,p=0,u=l,h=0,A=0,d=0,I=1,m=1,g=1,b=0,f="",w=i,k=s,y=r,S=f;m;)switch(d=b,b=rn()){case 40:if(108!=d&&58==Xt(S,u-1)){-1!=Dt(S+=Nt(on(b),"&","&\f"),"&\f",Bt(o?c[o-1]:0))&&(g=-1);break}case 34:case 39:case 91:S+=on(b);break;case 9:case 10:case 13:case 32:S+=pn(d);break;case 92:S+=un(ln()-1,7);continue;case 47:switch(sn()){case 42:case 47:Ct(yn(An(rn(),ln()),t,n,a),a);break;default:S+="/"}break;case 123*I:c[o++]=Qt(S)*g;case 125*I:case 59:case 0:switch(b){case 0:case 125:m=0;case 59+p:-1==g&&(S=Nt(S,/\f/g,"")),A>0&&Qt(S)-u&&Ct(A>32?Sn(S+";",r,n,u-1,a):Sn(Nt(S," ","")+";",r,n,u-2,a),a);break;case 59:S+=";";default:if(Ct(y=kn(S,t,n,o,p,i,c,f,w=[],k=[],u,s),s),123===b)if(0===p)wn(S,t,y,y,w,s,u,c,k);else switch(99===h&&110===Xt(S,3)?100:h){case 100:case 108:case 109:case 115:wn(e,y,y,r&&Ct(kn(e,y,y,0,0,i,c,f,i,w=[],u,k),k),i,k,u,c,r?w:k);break;default:wn(S,y,y,y,[""],k,0,c,k)}}o=p=A=0,I=g=1,f=S="",u=l;break;case 58:u=1+Qt(S),A=d;default:if(I<1)if(123==b)--I;else if(125==b&&0==I++&&125==nn())continue;switch(S+=Gt(b),b*I){case 38:g=p>0?1:(S+="\f",-1);break;case 44:c[o++]=(Qt(S)-1)*g,g=1;break;case 64:45===sn()&&(S+=on(rn())),h=sn(),p=u=Qt(f=S+=dn(ln())),b++;break;case 45:45===d&&2==Qt(S)&&(I=0)}}return s}function kn(e,t,n,r,i,s,l,c,a,o,p,u){for(var h=i-1,A=0===i?s:[""],d=Jt(A),I=0,m=0,g=0;I0?A[b]+" "+f:Nt(f,/&\f/g,A[b])))&&(a[g++]=w);return $t(e,t,n,0===i?Zt:c,a,o,p,u)}function yn(e,t,n,r){return $t(e,t,n,Mt,Gt(Kt),Wt(e,2,-2),0,r)}function Sn(e,t,n,r,i){return $t(e,t,n,Ht,Wt(e,0,r),Wt(e,r+1,-1),r,i)}var vn={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Tn="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",En="active",xn="data-styled-version",Mn="6.1.12",Zn="/*!sc*/\n",Hn="undefined"!=typeof window&&"HTMLElement"in window,zn=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY),Rn=(new Set,Object.freeze([])),Pn=Object.freeze({});var Bn=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Gn=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,jn=/(^-|-$)/g;function Un(e){return e.replace(Gn,"-").replace(jn,"")}var On=/(a)(d)/gi,Nn=52,Dn=function(e){return String.fromCharCode(e+(e>25?39:97))};function Xn(e){var t,n="";for(t=Math.abs(e);t>Nn;t=t/Nn|0)n=Dn(t%Nn)+n;return(Dn(t%Nn)+n).replace(On,"$1-$2")}var Wn,Qn=5381,Jn=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Cn=function(e){return Jn(Qn,e)};function Vn(e){return Xn(Cn(e)>>>0)}function Yn(e){return"string"==typeof e&&!0}var Ln="function"==typeof Symbol&&Symbol.for,Fn=Ln?Symbol.for("react.memo"):60115,qn=Ln?Symbol.for("react.forward_ref"):60112,Kn={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},$n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},er={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},tr=((Wn={})[qn]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Wn[Fn]=er,Wn);function nr(e){return("type"in(t=e)&&t.type.$$typeof)===Fn?er:"$$typeof"in e?tr[e.$$typeof]:Kn;var t}var rr=Object.defineProperty,ir=Object.getOwnPropertyNames,sr=Object.getOwnPropertySymbols,lr=Object.getOwnPropertyDescriptor,cr=Object.getPrototypeOf,ar=Object.prototype;function or(e,t,n){if("string"!=typeof t){if(ar){var r=cr(t);r&&r!==ar&&or(e,r,n)}var i=ir(t);sr&&(i=i.concat(sr(t)));for(var s=nr(e),l=nr(t),c=0;c0?" Args: ".concat(t.join(", ")):""))}var br=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)if((i<<=1)<0)throw gr(16,"".concat(e));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var s=r;s=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,s=r;s=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e0&&(a+="".concat(e,","))})),r+="".concat(l).concat(c,'{content:"').concat(a,'"}').concat(Zn)},s=0;s0?".".concat(t):e},p=a.slice();p.push((function(e){e.type===Zt&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(Ur,n).replace(r,o))})),l.prefix&&p.push(bn),p.push(mn);var u=function(e,i,s,c){void 0===i&&(i=""),void 0===s&&(s=""),void 0===c&&(c="&"),t=c,n=i,r=new RegExp("\\".concat(n,"\\b"),"g");var a=e.replace(Or,""),o=fn(s||i?"".concat(s," ").concat(i," { ").concat(a," }"):a);l.namespace&&(o=Nr(o,l.namespace));var u,h,A,d=[];return In(o,(u=p.concat((A=function(e){return d.push(e)},function(e){e.root||(e=e.return)&&A(e)})),h=Jt(u),function(e,t,n,r){for(var i="",s=0;s="A"&&e<="Z"};function Fr(e){for(var t="",n=0;n>>0);if(!t.hasNameForId(this.componentId,s)){var l=n(i,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,l)}r=hr(r,s),this.staticRulesId=s}else{for(var c=Jn(this.baseHash,n.hash),a="",o=0;o>>0);t.hasNameForId(this.componentId,h)||t.insertRules(this.componentId,h,n(a,".".concat(h),void 0,this.componentId)),r=hr(r,h)}}return r},e}(),ni=s().createContext(void 0);ni.Consumer;var ri={};function ii(e,t,n){var r=ur(e),l=e,c=!Yn(e),a=t.attrs,o=void 0===a?Rn:a,p=t.componentId,u=void 0===p?function(e,t){var n="string"!=typeof e?"sc":Un(e);ri[n]=(ri[n]||0)+1;var r="".concat(n,"-").concat(Vn(Mn+n+ri[n]));return t?"".concat(t,"-").concat(r):r}(t.displayName,t.parentComponentId):p,h=t.displayName,A=void 0===h?function(e){return Yn(e)?"styled.".concat(e):"Styled(".concat(function(e){return e.displayName||e.name||"Component"}(e),")")}(e):h,d=t.displayName&&t.componentId?"".concat(Un(t.displayName),"-").concat(t.componentId):t.componentId||u,I=r&&l.attrs?l.attrs.concat(o).filter(Boolean):o,m=t.shouldForwardProp;if(r&&l.shouldForwardProp){var g=l.shouldForwardProp;if(t.shouldForwardProp){var b=t.shouldForwardProp;m=function(e,t){return g(e,t)&&b(e,t)}}else m=g}var f=new ti(n,d,r?l.componentStyle:void 0);function w(e,t){return function(e,t,n){var r=e.attrs,l=e.componentStyle,c=e.defaultProps,a=e.foldedComponentIds,o=e.styledComponentId,p=e.target,u=s().useContext(ni),h=Cr(),A=e.shouldForwardProp||h.shouldForwardProp,d=function(e,t,n){return void 0===n&&(n=Pn),e.theme!==n.theme&&e.theme||t||n.theme}(t,u,c)||Pn,I=function(e,t,n){for(var r,i=kt(kt({},t),{className:void 0,theme:n}),s=0;s2&&jr.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)}}(),function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var n=Zr(),r=Ar([n&&'nonce="'.concat(n,'"'),"".concat(Tn,'="true"'),"".concat(xn,'="').concat(Mn,'"')].filter(Boolean)," ");return"")},this.getStyleTags=function(){if(e.sealed)throw gr(2);return e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)throw gr(2);var n=e.instance.toString();if(!n)return[];var r=((t={})[Tn]="",t[xn]=Mn,t.dangerouslySetInnerHTML={__html:n},t),i=Zr();return i&&(r.nonce=i),[s().createElement("style",kt({},r,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new jr({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw gr(2);return s().createElement(Vr,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw gr(3)}}(),"__sc-".concat(Tn,"__");const hi={"aria-busy":!0,role:"progressbar"},Ai=pi.div` display: ${e=>e.$visible?"flex":"none"}; -`,Ii=242.776657104492,mi=hi` +`,di=242.776657104492,Ii=ui` 12.5% { - stroke-dasharray: ${33.98873199462888}px, ${Ii}px; + stroke-dasharray: ${33.98873199462888}px, ${di}px; stroke-dashoffset: -${26.70543228149412}px; } 43.75% { - stroke-dasharray: ${84.97182998657219}px, ${Ii}px; + stroke-dasharray: ${84.97182998657219}px, ${di}px; stroke-dashoffset: -${84.97182998657219}px; } 100% { - stroke-dasharray: ${2.42776657104492}px, ${Ii}px; + stroke-dasharray: ${2.42776657104492}px, ${di}px; stroke-dashoffset: -${240.34889053344708}px; } -`,gi=(ui.path` - stroke-dasharray: ${2.42776657104492}px, ${Ii}; +`,mi=(pi.path` + stroke-dasharray: ${2.42776657104492}px, ${di}; stroke-dashoffset: 0; - animation: ${mi} ${1.6}s linear infinite; -`,hi` + animation: ${Ii} ${1.6}s linear infinite; +`,ui` to { transform: rotate(360deg); } -`),bi=(ui.svg` - animation: ${gi} 0.75s steps(12, end) infinite; +`),gi=(pi.svg` + animation: ${mi} 0.75s steps(12, end) infinite; animation-duration: 0.75s; -`,ui.polyline` +`,pi.polyline` stroke-width: ${e=>e.width}px; stroke-linecap: round; @@ -71,13 +71,13 @@ to { &:nth-child(12n + 11) { stroke-opacity: 0.92; } -`,({height:e=80,width:t=80,radius:n=9,color:r="#4fa94d",ariaLabel:i="three-dots-loading",wrapperStyle:s,wrapperClass:l,visible:c=!0})=>(0,kt.jsx)(di,{style:s,$visible:c,className:l,"data-testid":"three-dots-loading","aria-label":i,...Ai,children:(0,kt.jsxs)("svg",{width:t,height:e,viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r,"data-testid":"three-dots-svg",children:[(0,kt.jsxs)("circle",{cx:"15",cy:"15",r:Number(n)+6,children:[(0,kt.jsx)("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),(0,kt.jsx)("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})]}),(0,kt.jsxs)("circle",{cx:"60",cy:"15",r:n,attributeName:"fill-opacity",from:"1",to:"0.3",children:[(0,kt.jsx)("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),(0,kt.jsx)("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})]}),(0,kt.jsxs)("circle",{cx:"105",cy:"15",r:Number(n)+6,children:[(0,kt.jsx)("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),(0,kt.jsx)("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})]})]})})),fi=hi` +`,({height:e=80,width:t=80,radius:n=9,color:r="#4fa94d",ariaLabel:i="three-dots-loading",wrapperStyle:s,wrapperClass:l,visible:c=!0})=>(0,wt.jsx)(Ai,{style:s,$visible:c,className:l,"data-testid":"three-dots-loading","aria-label":i,...hi,children:(0,wt.jsxs)("svg",{width:t,height:e,viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r,"data-testid":"three-dots-svg",children:[(0,wt.jsxs)("circle",{cx:"15",cy:"15",r:Number(n)+6,children:[(0,wt.jsx)("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),(0,wt.jsx)("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})]}),(0,wt.jsxs)("circle",{cx:"60",cy:"15",r:n,attributeName:"fill-opacity",from:"1",to:"0.3",children:[(0,wt.jsx)("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),(0,wt.jsx)("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})]}),(0,wt.jsxs)("circle",{cx:"105",cy:"15",r:Number(n)+6,children:[(0,wt.jsx)("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),(0,wt.jsx)("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})]})]})})),bi=ui` to { stroke-dashoffset: 136; } -`;ui.polygon` +`;pi.polygon` stroke-dasharray: 17; - animation: ${fi} 2.5s cubic-bezier(0.35, 0.04, 0.63, 0.95) infinite; -`,ui.svg` + animation: ${bi} 2.5s cubic-bezier(0.35, 0.04, 0.63, 0.95) infinite; +`,pi.svg` transform-origin: 50% 65%; -`;var wi,ki=e=>{const[t,n]=(0,l.useState)(!1),[r,s]=(0,l.useState)(!1),[c,a]=(0,l.useState)(""),[o,p]=(0,l.useState)(""),[u,h]=(0,l.useState)(),[A,d]=(0,l.useState)("kb"),[I,m]=(0,l.useState)({}),[g,b]=(0,l.useState)(!1),f=(e,t,n)=>{const r=e.replace(/\n/g,"
    ");p(r),h(t),q.persistResult(r,t),q.persistSearchInput(n),t&&K("help_search",{label_key:"term",term:n,page:window.location.href.toString()})},w=async(e,t)=>{try{return await E()({path:"/newfold-multi-search/v1/multi_search",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,brand:t})})}catch(e){return console.error("Error fetching multi-search results:",e),{}}};(0,l.useEffect)((()=>{a(""),p("")}),[e.refresh]),(0,l.useEffect)((()=>{(async()=>{try{const{content:e,postId:t}=q.getResultInfo();e&&p(e),t&&h(t);const n=q.getSearchInput()||"";a(n);const r=await F(),i=await w(n,r);m({hits:i?.results?.[0]?.grouped_hits})}catch(e){console.error("Error fetching initial data:",e)}})()}),[]);const k=(0,l.useMemo)((()=>(0,U.debounce)((async e=>{if(e&&0!==e.length){b(!0);try{const t=await F(),n=await w(e,t);n?.results?.[0]?.grouped_hits&&m({hits:n?.results?.[0]?.grouped_hits})}catch(e){console.error("Error fetching debounced results:",e)}finally{b(!1)}}else m({})}),500)),[]);return(0,l.useEffect)((()=>{k.cancel()}),[]),t?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(wt,null)):(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"search-container"},(0,i.createElement)("button",{onClick:()=>{document.getElementById("search-input-box").focus()}},(0,i.createElement)(J,null)),(0,i.createElement)("input",{type:"text",id:"search-input-box",style:{flexGrow:2},value:c,maxLength:"144",placeholder:(0,z.__)("Ask me anything…","wp-module-help-center"),onChange:e=>{a(e.target.value),f("",void 0,e.target.value),s(!1),k(e.target.value)},onKeyDown:async e=>{"Enter"===e.key&&await(async()=>{n(!0);try{const e=I.hits[0].hits;if(e.length>0&&((e,t,n)=>{const r=t/e.split(/\s+/).length;return n>=1&&r>=.99})(c,e[0].text_match_info?.tokens_matched,e[0].text_match_info?.fields_matched))return void f(e[0].document.post_content,e[0].document.post_id,c);d("ai");const t=await W.getSearchResult(c,"helpcenter");f(t.result[0].text,t.post_id,c)}catch(e){s(!0)}finally{n(!1)}})()}})),(0,i.createElement)("div",{className:"attribute"},(0,i.createElement)("p",null,(0,i.createElement)("span",null,c?c.length:0,"/144"))),g?(0,i.createElement)(bi,{height:"40",width:"40",radius:"4",color:"#196BDE",ariaLabel:"three-dots-loading",wrapperStyle:{},visible:!0}):(0,i.createElement)(ut,{content:o,noResult:r,postId:u,source:A,showFeedbackSection:!o.includes("do not possess the answer")}),I?.hits?.length>0&&(0,i.createElement)("p",null,(0,i.createElement)("b",null,o?.length>0?(0,z.__)("Other Resources","wp-module-help-center"):(0,z.__)("Search Suggestions","wp-module-help-center"))),I?.hits?.map(((e,t)=>{const n=document.createElement("span");n.setAttribute("display","none"),n.innerHTML=e?.group_key;const r=n.textContent||n.innerText;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Y,{key:t,searchTitle:r,onGo:()=>{a(r),f(e?.hits[0]?.document?.post_content,e?.hits[0]?.document?.id,r)}}))})))},yi=e=>{const[t,n]=(0,l.useState)(!1),[r,s]=(0,l.useState)(!1);return(0,l.useEffect)((()=>{(async()=>{try{const e=await E()({path:L+"/capability",method:"GET"});s(e)}catch(e){s(!1)}})()}),[]),(0,l.useEffect)((()=>{const e=()=>{n(q.getHelpVisible())};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}),[]),r&&t?(0,i.createElement)("div",{className:"nfd-help-center"},(0,i.createElement)(ki,{refresh:e.refresh})):(0,i.createElement)(i.Fragment,null)},Si=({onClose:e})=>{const[t,n]=(0,l.useState)("");(0,l.useEffect)((()=>{const e=q.getHelpVisible();xi(e),(async()=>{const e=await F();n(e.toLowerCase())})()}),[]);const[r,s]=(0,l.useState)(!1);return(0,i.createElement)("div",{className:"modal"},(0,i.createElement)("div",{className:"modal-header"},(0,i.createElement)("h3",{className:"heading"},(0,i.createElement)("span",{className:"icon"},(0,i.createElement)(j,null)),(0,z.__)("Help Center","wp-module-help-center")),(0,i.createElement)("button",{className:"close-button",onClick:()=>{e(),s(!r)}},(0,i.createElement)("div",{className:"icon-button"},(0,i.createElement)(B,null)))),(0,i.createElement)(yi,{closeHelp:()=>{e(),s(!r)},refresh:r,brand:t}))};function vi(){return vi=Object.assign?Object.assign.bind():function(e){for(var t=1;t{window?.nfdHelpCenter?.restUrl&&(async({namespace:e,urls:{single:t,batch:n}={},settings:{debounce:{time:r}={},queue:{threshold:i=100}={}}={}})=>{!e||!x(e)&&(!t&&!n||((0,c.dispatch)(v).initializeNamespace(e),(0,c.dispatch)(v).updateHiiveUrls({single:t,batch:n},e),(0,c.dispatch)(v).updateHiiveDebounceTime(r,e),(0,c.dispatch)(v).updateHiiveEventsQueueThreshold(i,e),window.nfdUIAnalytics?.hiive?window.nfdUIAnalytics.hiive[e]=!0:window.nfdUIAnalytics={hiive:{[e]:!0}}))})({namespace:"wonder_help",urls:{single:window.nfdHelpCenter.restUrl+"/newfold-data/v1/events"}})}));const Ei=document.getElementById("wpcontent"),xi=e=>{Ei.classList.toggle("wpcontent-container",e),document.getElementById("nfd-help-center").classList.toggle("help-container",e),q.updateHelpVisible(e),window.dispatchEvent(new Event("storage"))};window.newfoldEmbeddedHelp={toggleNFDLaunchedEmbeddedHelp:()=>{(()=>{const e=q.getHelpVisible();if(Object.is(e,void 0))return xi(!0),void K("help_sidebar_opened",{page:window.location.href.toString()});e||K("help_sidebar_opened",{page:window.location.href.toString()}),xi(!e)})()},renderEmbeddedHelp:()=>{const e=document.createElement("div");e.id="nfd-help-center",e.style.display="none",Ei.appendChild(e);const t=document.getElementById("nfd-help-center");null!==t&&("undefined"!==l.createRoot?(0,l.createRoot)(t).render((0,i.createElement)(Si,{onClose:()=>{xi(!1),q.clear()}})):"undefined"!==l.render&&(0,l.render)((0,i.createElement)(Si,{onClose:()=>{xi(!1),q.clear()}}),t))}};const Mi=(0,c.subscribe)((()=>{document.getElementById("nfd-help-menu-button-wrapper")?Mi():o()((()=>{const e=document.querySelector(".edit-post-header__settings");if(!e)return;const t=document.createElement("div");t.id="nfd-help-menu-button-wrapper",t.classList.add("nfd-help-menu-button-wrapper");const n=e.querySelector(".components-dropdown-menu.interface-more-menu-dropdown");n?e.insertBefore(t,n):e.appendChild(t);const r=(0,i.createElement)("button",{className:"components-button has-icon",onClick:()=>{window.newfoldEmbeddedHelp.toggleNFDLaunchedEmbeddedHelp()}},(0,i.createElement)(Ti,null));(0,l.render)(r,document.getElementById("nfd-help-menu-button-wrapper"))}))}));window.newfoldEmbeddedHelp.renderEmbeddedHelp(),window.newfoldEmbeddedHelp.launchNFDEmbeddedHelpQuery=function(e,t){const n=q.getHelpVisible();q.persistSearchInput(e),"true"!==n&&t&&(window.newfoldEmbeddedHelp.renderEmbeddedHelp(),xi(!0));const r=new KeyboardEvent("keydown",{bubbles:!0,cancelable:!0,key:"Enter",code:"Enter",keyCode:13}),i=document.getElementById("nfd-help-center");let s=0;const l=setInterval((()=>{if(s++,i&&(e=>{const t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility})(i)){const t=document.getElementById("search-input-box");t.value=e,t.focus(),t.setSelectionRange(t.value.length,t.value.length),t.dispatchEvent(r),clearInterval(l)}else s>=5&&clearInterval(l)}),500)},document.addEventListener("click",(e=>{try{e.target?.dataset?.nfdhelpcenterquery&&""!==e.target.dataset.nfdhelpcenterquery.trim()&&window.newfoldEmbeddedHelp.launchNFDEmbeddedHelpQuery(e.target.dataset.nfdhelpcenterquery,!0)}catch(e){console.error("Error launching help center via query:",e)}}))}()}(); \ No newline at end of file +`;var fi,wi=e=>{const[t,n]=(0,l.useState)(!1),[r,s]=(0,l.useState)(!1),[c,a]=(0,l.useState)(""),[o,p]=(0,l.useState)(""),[u,h]=(0,l.useState)(),[A,d]=(0,l.useState)("kb"),[I,m]=(0,l.useState)({}),[g,b]=(0,l.useState)(!1),f=(e,t,n)=>{const r=e.replace(/\n/g,"
    ");p(r),h(t),F.persistResult(r,t),F.persistSearchInput(n),t&&q("help_search",{label_key:"term",term:n,page:window.location.href.toString()})},w=async(e,t)=>{try{return await E()({path:"/newfold-multi-search/v1/multi_search",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,brand:t})})}catch(e){return console.error("Error fetching multi-search results:",e),{}}};(0,l.useEffect)((()=>{a(""),p("")}),[e.refresh]),(0,l.useEffect)((()=>{(async()=>{try{const{content:e,postId:t}=F.getResultInfo();e&&p(e),t&&h(t);const n=F.getSearchInput()||"";a(n);const r=await L(),i=await w(n,r);m({hits:i?.results?.[0]?.grouped_hits})}catch(e){console.error("Error fetching initial data:",e)}})()}),[]);const k=(0,l.useMemo)((()=>(0,U.debounce)((async e=>{if(e&&0!==e.length){b(!0);try{const t=await L(),n=await w(e,t);n?.results?.[0]?.grouped_hits&&m({hits:n?.results?.[0]?.grouped_hits})}catch(e){console.error("Error fetching debounced results:",e)}finally{b(!1)}}else m({})}),500)),[]);return(0,l.useEffect)((()=>{k.cancel()}),[]),t?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(ft,null)):(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"search-container"},(0,i.createElement)("button",{onClick:()=>{document.getElementById("search-input-box").focus()}},(0,i.createElement)(J,null)),(0,i.createElement)("input",{type:"text",id:"search-input-box",style:{flexGrow:2},value:c,maxLength:"144",placeholder:(0,z.__)("Ask me anything…","wp-module-help-center"),onChange:e=>{a(e.target.value),f("",void 0,e.target.value),s(!1),k(e.target.value)},onKeyDown:async e=>{"Enter"===e.key&&await(async()=>{n(!0);try{const e=I.hits[0].hits;if(e.length>0&&((e,t,n)=>{const r=t/e.split(/\s+/).length;return n>=1&&r>=.99})(c,e[0].text_match_info?.tokens_matched,e[0].text_match_info?.fields_matched))return void f(e[0].document.post_content,e[0].document.post_id,c);d("ai");const t=await W.getSearchResult(c,"helpcenter");f(t.result[0].text,t.post_id,c)}catch(e){s(!0)}finally{n(!1)}})()}})),(0,i.createElement)("div",{className:"attribute"},(0,i.createElement)("p",null,(0,i.createElement)("span",null,c?c.length:0,"/144"))),g?(0,i.createElement)(gi,{height:"40",width:"40",radius:"4",color:"#196BDE",ariaLabel:"three-dots-loading",wrapperStyle:{},visible:!0}):(0,i.createElement)(pt,{content:o,noResult:r,postId:u,source:A,showFeedbackSection:!o.includes("do not possess the answer")}),I?.hits?.length>0&&(0,i.createElement)("p",null,(0,i.createElement)("b",null,o?.length>0?(0,z.__)("Other Resources","wp-module-help-center"):(0,z.__)("Search Suggestions","wp-module-help-center"))),I?.hits?.map(((e,t)=>{const n=document.createElement("span");n.setAttribute("display","none"),n.innerHTML=e?.group_key;const r=n.textContent||n.innerText;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Y,{key:t,searchTitle:r,onGo:()=>{a(r),f(e?.hits[0]?.document?.post_content,e?.hits[0]?.document?.id,r)}}))})))},ki=e=>{const[t,n]=(0,l.useState)(!1),[r,s]=(0,l.useState)(!1);return(0,l.useEffect)((()=>{(async()=>{try{const e=await(window.NewfoldRuntime?.capabilities?.canAccessHelpCenter||!1);s(e)}catch(e){s(!1)}})()}),[]),(0,l.useEffect)((()=>{const e=()=>{n(F.getHelpVisible())};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}),[]),r&&t?(0,i.createElement)("div",{className:"nfd-help-center"},(0,i.createElement)(wi,{refresh:e.refresh})):(0,i.createElement)(i.Fragment,null)},yi=({onClose:e})=>{const[t,n]=(0,l.useState)("");(0,l.useEffect)((()=>{const e=F.getHelpVisible();Ei(e),(async()=>{const e=await L();n(e.toLowerCase())})()}),[]);const[r,s]=(0,l.useState)(!1);return(0,i.createElement)("div",{className:"modal"},(0,i.createElement)("div",{className:"modal-header"},(0,i.createElement)("h3",{className:"heading"},(0,i.createElement)("span",{className:"icon"},(0,i.createElement)(j,null)),(0,z.__)("Help Center","wp-module-help-center")),(0,i.createElement)("button",{className:"close-button",onClick:()=>{e(),s(!r)}},(0,i.createElement)("div",{className:"icon-button"},(0,i.createElement)(B,null)))),(0,i.createElement)(ki,{closeHelp:()=>{e(),s(!r)},refresh:r,brand:t}))};function Si(){return Si=Object.assign?Object.assign.bind():function(e){for(var t=1;t{window?.nfdHelpCenter?.restUrl&&(async({namespace:e,urls:{single:t,batch:n}={},settings:{debounce:{time:r}={},queue:{threshold:i=100}={}}={}})=>{!e||!x(e)&&(!t&&!n||((0,c.dispatch)(v).initializeNamespace(e),(0,c.dispatch)(v).updateHiiveUrls({single:t,batch:n},e),(0,c.dispatch)(v).updateHiiveDebounceTime(r,e),(0,c.dispatch)(v).updateHiiveEventsQueueThreshold(i,e),window.nfdUIAnalytics?.hiive?window.nfdUIAnalytics.hiive[e]=!0:window.nfdUIAnalytics={hiive:{[e]:!0}}))})({namespace:"wonder_help",urls:{single:window.nfdHelpCenter.restUrl+"/newfold-data/v1/events"}})}));const Ti=document.getElementById("wpcontent"),Ei=e=>{Ti.classList.toggle("wpcontent-container",e),document.getElementById("nfd-help-center").classList.toggle("help-container",e),F.updateHelpVisible(e),window.dispatchEvent(new Event("storage"))};window.newfoldEmbeddedHelp={toggleNFDLaunchedEmbeddedHelp:()=>{(()=>{const e=F.getHelpVisible();if(Object.is(e,void 0))return Ei(!0),void q("help_sidebar_opened",{page:window.location.href.toString()});e||q("help_sidebar_opened",{page:window.location.href.toString()}),Ei(!e)})()},renderEmbeddedHelp:()=>{const e=document.createElement("div");e.id="nfd-help-center",e.style.display="none",Ti.appendChild(e);const t=document.getElementById("nfd-help-center");null!==t&&("undefined"!==l.createRoot?(0,l.createRoot)(t).render((0,i.createElement)(yi,{onClose:()=>{Ei(!1),F.clear()}})):"undefined"!==l.render&&(0,l.render)((0,i.createElement)(yi,{onClose:()=>{Ei(!1),F.clear()}}),t))}};const xi=(0,c.subscribe)((()=>{document.getElementById("nfd-help-menu-button-wrapper")?xi():o()((()=>{const e=document.querySelector(".edit-post-header__settings");if(!e)return;const t=document.createElement("div");t.id="nfd-help-menu-button-wrapper",t.classList.add("nfd-help-menu-button-wrapper");const n=e.querySelector(".components-dropdown-menu.interface-more-menu-dropdown");n?e.insertBefore(t,n):e.appendChild(t);const r=(0,i.createElement)("button",{className:"components-button has-icon",onClick:()=>{window.newfoldEmbeddedHelp.toggleNFDLaunchedEmbeddedHelp()}},(0,i.createElement)(vi,null));(0,l.render)(r,document.getElementById("nfd-help-menu-button-wrapper"))}))}));window.newfoldEmbeddedHelp.renderEmbeddedHelp(),window.newfoldEmbeddedHelp.launchNFDEmbeddedHelpQuery=function(e,t){const n=F.getHelpVisible();F.persistSearchInput(e),"true"!==n&&t&&(window.newfoldEmbeddedHelp.renderEmbeddedHelp(),Ei(!0));const r=new KeyboardEvent("keydown",{bubbles:!0,cancelable:!0,key:"Enter",code:"Enter",keyCode:13}),i=document.getElementById("nfd-help-center");let s=0;const l=setInterval((()=>{if(s++,i&&(e=>{const t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility})(i)){const t=document.getElementById("search-input-box");t.value=e,t.focus(),t.setSelectionRange(t.value.length,t.value.length),t.dispatchEvent(r),clearInterval(l)}else s>=5&&clearInterval(l)}),500)},document.addEventListener("click",(e=>{try{e.target?.dataset?.nfdhelpcenterquery&&""!==e.target.dataset.nfdhelpcenterquery.trim()&&window.newfoldEmbeddedHelp.launchNFDEmbeddedHelpQuery(e.target.dataset.nfdhelpcenterquery,!0)}catch(e){console.error("Error launching help center via query:",e)}}))}()}(); \ No newline at end of file diff --git a/src/utils.js b/src/utils.js index f7a7aad..00b1f71 100644 --- a/src/utils.js +++ b/src/utils.js @@ -29,16 +29,12 @@ export const OnboardingAPIs = { }; export const CapabilityAPI = { - getHelpCenterCapability: () => - apiFetch( { - path: base + '/capability', - method: 'GET', - } ), - getBrand: () => - apiFetch( { - path: base + '/capability/brand', - method: 'GET', - } ), + getHelpCenterCapability: () => { + return window.NewfoldRuntime?.capabilities?.canAccessHelpCenter || false ; + }, + getBrand: () => { + return window.NewfoldRuntime?.plugin?.brand || false ; + }, }; // A wrapper to get and set things more easily