@cimulate/copilot-widget 1.33.1 → 1.33.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,29 +1,29 @@
1
1
  (function(He,We){typeof exports=="object"&&typeof module!="undefined"?We(exports):typeof define=="function"&&define.amd?define(["exports"],We):(He=typeof globalThis!="undefined"?globalThis:He||self,We(He.CimulateMessaging={}))})(this,(function(He){"use strict";var Z7=Object.defineProperty,eU=Object.defineProperties;var tU=Object.getOwnPropertyDescriptors;var md=Object.getOwnPropertySymbols;var A2=Object.prototype.hasOwnProperty,k2=Object.prototype.propertyIsEnumerable;var Wo=(He,We)=>(We=Symbol[He])?We:Symbol.for("Symbol."+He),nU=He=>{throw TypeError(He)},gd=Math.pow,c0=(He,We,it)=>We in He?Z7(He,We,{enumerable:!0,configurable:!0,writable:!0,value:it}):He[We]=it,j=(He,We)=>{for(var it in We||(We={}))A2.call(We,it)&&c0(He,it,We[it]);if(md)for(var it of md(We))k2.call(We,it)&&c0(He,it,We[it]);return He},ce=(He,We)=>eU(He,tU(We));var Sn=(He,We)=>{var it={};for(var Et in He)A2.call(He,Et)&&We.indexOf(Et)<0&&(it[Et]=He[Et]);if(He!=null&&md)for(var Et of md(He))We.indexOf(Et)<0&&k2.call(He,Et)&&(it[Et]=He[Et]);return it};var Qe=(He,We,it)=>c0(He,typeof We!="symbol"?We+"":We,it);var Be=(He,We,it)=>new Promise((Et,Rt)=>{var _t=xt=>{try{rn(it.next(xt))}catch(Tn){Rt(Tn)}},je=xt=>{try{rn(it.throw(xt))}catch(Tn){Rt(Tn)}},rn=xt=>xt.done?Et(xt.value):Promise.resolve(xt.value).then(_t,je);rn((it=it.apply(He,We)).next())}),Ps=function(He,We){this[0]=He,this[1]=We},d0=(He,We,it)=>{var Et=(rn,xt,Tn,sr)=>{try{var zi=it[rn](xt),Rs=(xt=zi.value)instanceof Ps,Ls=zi.done;Promise.resolve(Rs?xt[0]:xt).then(vn=>Rs?Et(rn==="return"?rn:"next",xt[1]?{done:vn.done,value:vn.value}:vn,Tn,sr):Tn({value:vn,done:Ls})).catch(vn=>Et("throw",vn,Tn,sr))}catch(vn){sr(vn)}},Rt=(rn,xt,Tn,sr)=>je[rn]=zi=>(xt=new Promise((Rs,Ls,vn)=>(vn=()=>Et(rn,zi,Rs,Ls),_t?_t.then(vn):vn())),sr=()=>_t===Tn&&(_t=0),_t=Tn=xt.then(sr,sr),xt),_t,je={};return it=it.apply(He,We),je[Wo("asyncIterator")]=()=>je,Rt("next"),Rt("throw"),Rt("return"),je},f0=He=>{var We=He[Wo("asyncIterator")],it=!1,Et,Rt={};return We==null?(We=He[Wo("iterator")](),Et=_t=>Rt[_t]=je=>We[_t](je)):(We=We.call(He),Et=_t=>Rt[_t]=je=>{if(it){if(it=!1,_t==="throw")throw je;return je}return it=!0,{done:!1,value:new Ps(new Promise(rn=>{var xt=We[_t](je);xt instanceof Object||nU("Object expected"),rn(xt)}),1)}}),Rt[Wo("iterator")]=()=>Rt,Et("next"),"throw"in We?Et("throw"):Rt.throw=_t=>{throw _t},"return"in We&&Et("return"),Rt},C2=(He,We,it)=>(We=He[Wo("asyncIterator")])?We.call(He):(He=He[Wo("iterator")](),We={},it=(Et,Rt)=>(Rt=He[Et])&&(We[Et]=_t=>new Promise((je,rn,xt)=>(_t=Rt.call(He,_t),xt=_t.done,Promise.resolve(_t.value).then(Tn=>je({value:Tn,done:xt}),rn)))),it("next"),it("return"),We);var We=document.createElement("style");We.textContent=`.cim-widget-icon-button{display:inline-flex;align-items:center;justify-content:center;min-width:32px;min-height:32px;height:auto;line-height:normal;background-color:transparent;border:1px solid transparent;border-radius:var(--cim-widget-border-radius);padding:0;cursor:pointer;color:#333;font-size:18px;svg{padding:6px;height:100%;width:100%}&:hover{background-color:#f0f0f0}&:disabled,&[disabled]{opacity:.6;background-color:#f9f9f9;cursor:not-allowed}}.cim-widget-icon-image{object-fit:contain;padding:6px;width:.875em;height:.875em}.cim-widget-minimized-container{--base-color: var(--cim-widget-primary-color, #3182ce);--base-color-darken: color-mix(in srgb, var(--base-color), black 20%);position:fixed;z-index:9999;bottom:1rem;right:1rem;display:flex;align-items:center;justify-content:center;.cim-widget-minimized-button{height:3rem;width:3rem;border-radius:var(--cim-widget-border-radius);padding:.25rem;color:#fff;box-shadow:0 4px 6px #00000040,0 1px 3px #00000050;background-color:var(--base-color);transition:background-color .1s ease-in-out;&:active{transform:translateY(1px);box-shadow:0 4px 6px #00000020,0 1px 3px #00000030}&:hover{background-color:var(--base-color-darken)}}.cim-widget-minimized-icon-img{object-fit:contain;width:stretch;height:stretch}}.cim-widget-button{--base-color: var(--cim-widget-primary-color, #3182ce);padding:.25rem .5rem;min-height:32px;height:auto;line-height:normal;background-color:var(--base-color);border-radius:var(--cim-widget-border-radius);border-color:var(--base-color);border-style:solid;color:#fff;font-family:var(--cim-widget-font-family, inherit);cursor:pointer;&:disabled,&[disabled]{cursor:not-allowed;opacity:.6}&:hover{background-color:color-mix(in srgb,var(--base-color),black 20%);border-color:color-mix(in srgb,var(--base-color),black 20%)}&:focus-visible{outline:2px solid color-mix(in srgb,var(--base-color),white 25%)}}.cim-widget-disclaimer{display:flex;flex-direction:column;padding:0 .5rem .5rem;gap:.5rem}.cim-widget-disclaimer-text{font-size:.75rem;color:#00000090;margin:0}.cim-widget-disclaimer-image{object-fit:contain;height:100%;width:100%}.cim-widget-search-bar-wrapper{display:flex;flex-direction:column;padding:.5rem;gap:.5rem;&.with-attachments{border-top:1px solid var(--cim-widget-border-color)}}.cim-widget-search-bar{display:flex;align-items:center;gap:4px;font-family:var(--cim-widget-font-family)}.cim-widget-image-file-preview{display:inline-flex;align-items:center;gap:8px;padding-left:.5rem}.cim-widget-image-preview{object-fit:contain;max-height:2.5rem;&.cim-modal-component{max-height:3.5rem}}.cim-widget-image-file-name{width:100%;font-size:.8rem;color:#00000090;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;line-clamp:3;overflow:hidden}.cim-widget-close-button.clear-attachment{padding:.15rem;color:#00000090}input.cim-widget-search-input{width:100%;height:stretch;min-width:0;min-height:2rem;padding:0 8px;font-size:.875rem;background-color:transparent;border:1px solid #00000040;border-radius:var(--cim-widget-border-radius)}@media(max-width:576px){input.cim-widget-search-input{font-size:16px}}.cim-widget-connection-status-icon{display:inline-block;min-width:8px;width:.6rem;height:.5rem;border-radius:50%;margin:.35rem;vertical-align:middle;&.connected{background-color:#00d60080}&.disconnected{background-color:#c9c7c7}}.cim-widget-image-upload-button{display:inline-flex;height:100%;border-radius:var(--cim-widget-border-radius);cursor:pointer;&:hover{background-color:#f0f0f0}&.disabled{opacity:.6;background-color:#f9f9f9;cursor:not-allowed}}.cim-widget-image-upload-label{display:inline-flex;justify-content:center;align-items:center;padding:8px;margin-bottom:0;cursor:pointer;&.disabled{cursor:not-allowed}}.cim-widget-search-button{display:inline-flex;align-items:center;white-space:nowrap;gap:.25rem}.cim-widget-search-button-icon{--base-color: var(--cim-widget-primary-color, #3182ce);background-color:var(--base-color);border-color:var(--base-color);color:#fff;&:disabled,&[disabled]{background-color:var(--base-color);border-color:var(--base-color);opacity:.6}&:hover{background-color:color-mix(in srgb,var(--base-color),black 20%);border-color:color-mix(in srgb,var(--base-color),black 20%)}}.cim-widget-search-button-icon-image{object-fit:contain;width:1.25em;height:1.25em}.cim-widget-file-input{display:none}.cim-widget-overflow-menu{position:relative;height:auto;width:auto}.cim-widget-overflow-menu-list{width:170px;background:#fff;border-radius:var(--cim-widget-border-radius);border:1px solid var(--cim-widget-border-color)}.cim-widget-overflow-menu-button{background-color:#fff}.cim-widget-overflow-menu-button-trigger,.cim-widget-overflow-menu-button{display:inline-flex;align-items:center;width:100%;border:1px solid transparent;border-radius:var(--cim-widget-border-radius);cursor:pointer;color:#333;&:hover{background-color:#f0f0f0}}.cim-widget-overflow-menu-button{gap:.5rem;padding:.5rem .75rem;background-color:#f0f0f080;svg{font-size:.75rem}}.cim-widget-carousel{position:relative;width:100%}.cim-widget-carousel__item-group{padding:4px 0;justify-content:flex-start;&.carousel-row-container{display:flex!important}}.cim-widget-carousel__item{flex-shrink:0;>*{height:100%}}.cim-widget-carousel__control{position:absolute;top:50%;left:0;right:0;transform:translateY(-50%);display:flex;justify-content:space-between;pointer-events:none;padding:0 4px}.cim-widget-carousel__prev-trigger,.cim-widget-carousel__next-trigger{pointer-events:auto;display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:1rem 0;border-radius:var(--cim-widget-border-radius);border:1px solid var(--cim-widget-border-color, #d1d5db);background-color:var(--cim-widget-background-color, #ffffff);color:var(--cim-widget-font-color, #3f3f46);cursor:pointer;box-shadow:0 1px 3px #0000001a;transition:background-color .15s ease,box-shadow .15s ease;&:hover{color:var(--cim-widget-font-color, #1a202c)}}.cim-widget-carousel__prev-trigger:hover,.cim-widget-carousel__next-trigger:hover{background-color:#f9fafb;box-shadow:0 2px 6px #0000001f}.cim-widget-carousel__prev-trigger:disabled,.cim-widget-carousel__next-trigger:disabled{opacity:.4;cursor:not-allowed}.cim-widget-carousel__indicator-group{display:flex;justify-content:center;gap:6px;padding-top:12px}.cim-widget-carousel__indicator{width:8px;height:8px;border-radius:50%;border:none;background-color:var(--cim-widget-border-color, #d1d5db);cursor:pointer;padding:0;transition:background-color .2s ease,transform .2s ease}.cim-widget-carousel__indicator[data-current]{background-color:var(--cim-widget-font-color, #1a202c);transform:scale(1.25)}.cim-widget-carousel__indicator:hover:not([data-current]){background-color:var(--cim-widget-font-color, #1a202c);opacity:.5}.cim-widget-close-button{display:flex;align-items:center;justify-content:center;padding:.5rem;height:auto;line-height:normal;border-radius:var(--cim-widget-border-radius);border:1px solid transparent;background-color:transparent;cursor:pointer;&:hover{background-color:#f0f0f0}}.cim-widget-overflow-panel{position:absolute;top:100%;left:0;right:0;display:flex;flex-direction:column;gap:.5rem;padding:.5rem;background:#fff;border-bottom:1px solid var(--cim-widget-border-color);z-index:10}.cim-widget-overflow-panel .cim-widget-overflow-menu-button{width:100%;justify-content:center;gap:.75rem;font-size:.875rem}.cim-widget-left-right-toggle-button{display:none}@media(min-width:576px){.cim-widget-left-right-toggle-button{display:inline-flex}}.cim-widget-price{display:flex;align-items:baseline;gap:.4em;flex-wrap:wrap;font-family:var(--cim-widget-font-family, sans-serif)}.cim-widget-price__amount{font-weight:700;font-size:1em;line-height:1.2;letter-spacing:-.3px;color:var(--cim-widget-font-color, #3f3f46)}.cim-widget-price__compare{font-weight:400;font-size:.85em;line-height:1.2;color:var(--cim-widget-font-color, #3f3f46);opacity:.6;text-decoration:line-through}.cim-widget-toggle-modal-button.cim-dialog-component{display:none}@media(min-width:576px){.cim-widget-toggle-modal-button.cim-dialog-component{display:inline-flex}}.cim-widget-connecting-indicator{--cim-loader-color: var(--cim-widget-primary-color);--cim-loader-size: 8px;--cim-loader-speed: 1.4s;--cim-loader-gap: .5rem;display:flex;align-items:center;gap:var(--cim-loader-gap)}.cim-widget-connecting-indicator.embedded{padding:12px 4px}.cim-widget-connecting-indicator.standalone{padding:12px 1rem}.cim-widget-connecting-pulse-wrapper{position:relative;width:calc(var(--cim-loader-size) * 2);height:calc(var(--cim-loader-size) * 2);display:flex;align-items:center;justify-content:center}.cim-widget-connecting-pulse{width:var(--cim-loader-size);height:var(--cim-loader-size);border-radius:50%;background-color:var(--cim-loader-color);animation:cim-widget-pulse var(--cim-loader-speed) ease-in-out infinite}.cim-widget-connecting-ring{position:absolute;width:var(--cim-loader-size);height:var(--cim-loader-size);border-radius:50%;border:1.5px solid var(--cim-loader-color);animation:cim-widget-ring-expand var(--cim-loader-speed) ease-out infinite}.cim-widget-connecting-text{font-size:12px;color:var(--cim-widget-font-color);font-family:var(--cim-widget-font-family, inherit);opacity:0;transform:translateY(4px);transition:opacity .4s ease,transform .4s ease}.cim-widget-connecting-text--visible{opacity:1;transform:translateY(0)}@keyframes cim-widget-pulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.6);opacity:.4}}@keyframes cim-widget-ring-expand{0%{transform:scale(1);opacity:.6}to{transform:scale(2.8);opacity:0}}@media(prefers-reduced-motion:reduce){.cim-widget-connecting-pulse,.cim-widget-connecting-ring{animation:none!important}.cim-widget-connecting-pulse{opacity:.6}.cim-widget-connecting-text{animation:none!important;transition:none!important}}.cim-widget-processing-indicator{--cim-loader-color: var(--cim-widget-primary-color);--cim-loader-speed: 1.8s;display:flex;flex-direction:column;gap:8px}.cim-widget-processing-indicator.embedded{max-width:80%;min-height:2.5rem;padding:.5rem 0}.cim-widget-processing-indicator.standalone{padding:0 1rem;min-height:3rem}.cim-widget-processing-text{font-size:.875rem;font-style:italic;color:color-mix(in srgb,var(--cim-widget-secondary-color) 70%,var(--cim-loader-color));opacity:.75}.cim-widget-processing-shimmer-bar{height:10px;min-height:10px;border-radius:4px;background:linear-gradient(90deg,var(--cim-widget-border-color) 25%,color-mix(in srgb,var(--cim-loader-color) 15%,var(--cim-widget-background-color)) 50%,var(--cim-widget-border-color) 75%);background-size:200% 100%;animation:cim-widget-shimmer var(--cim-loader-speed) ease-in-out infinite}.cim-widget-processing-shimmer-bar:nth-child(2){width:75%;animation-delay:.15s}.cim-widget-processing-shimmer-bar:nth-child(3){width:50%;animation-delay:.3s}@keyframes cim-widget-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}@media(prefers-reduced-motion:reduce){.cim-widget-processing-shimmer-bar{animation:none!important;background:var(--cim-widget-border-color)!important}}.cim-widget-blinking-cursor{display:inline-flex;margin-left:2px;line-height:0;animation:cursor-blink 1.5s steps(2) infinite}@keyframes cursor-blink{0%{opacity:0}}.cim-widget-ul{list-style-type:disc;padding-left:1.5rem}.cim-widget-ol{list-style-type:decimal;padding-left:1.5rem}.cim-widget-table-container{margin-top:1rem;margin-bottom:1rem;margin-right:.5rem;overflow-x:auto}.cim-widget-table{border-radius:.5rem;border-width:1px;border-style:solid;border-color:var(--cim-widget-border-color);border-collapse:collapse;width:100%}.cim-widget-thead{background-color:color-mix(in hsl decreasing hue,var(--cim-widget-secondary-color) 5%,transparent);border-bottom-width:2px;border-color:var(--cim-widget-border-color)}.cim-widget-tbody{border-width:0px;box-sizing:border-box;background-color:#ffffff90;overflow-wrap:break-word}.cim-widget-tr{border-style:solid;border-bottom-width:1px;border-color:var(--cim-widget-border-color)}.cim-widget-th{padding:.5rem 1rem;text-align:left;font-weight:700;border-bottom-width:1px;border-color:var(--cim-widget-border-color)}.cim-widget-td{padding:.5rem 1rem;border-bottom-width:1px;border-color:var(--cim-widget-border-color)}.cim-widget-message-container pre{margin:0}.cim-widget-msg-product-card{display:flex;flex-direction:column;width:180px;min-width:180px;height:100%;background-color:var(--cim-widget-background-color, #ffffff);border:1px solid var(--cim-widget-border-color, #d1d5db);border-radius:var(--cim-widget-border-radius);overflow:hidden;transition:box-shadow .2s ease}.cim-widget-msg-product-card:hover{box-shadow:0 2px 8px #0000001f}.cim-widget-msg-product-card__image-wrapper{position:relative;width:100%;height:100%;aspect-ratio:1 / 1;overflow:hidden}.cim-widget-msg-product-card__image{width:100%;height:100%;object-fit:contain;display:block}.cim-widget-msg-product-card__image-placeholder{width:100%;height:100%;display:flex;align-items:center;justify-content:center;background-color:var(--cim-widget-background-color, #ffffff);color:var(--cim-widget-border-color, #d1d5db)}.cim-widget-msg-product-card__image-placeholder svg{width:40%;height:40%}button.cim-widget-msg-product-card__image-button{width:100%;height:100%;padding:0;margin:0;border:none;background:none;cursor:pointer;display:block}button.cim-widget-msg-product-card__image-button:disabled{cursor:default}.cim-widget-msg-product-card__content{display:flex;flex-direction:column;justify-content:space-between;gap:1rem;padding:12px;height:50%}.cim-widget-msg-product-card__content-header{display:grid;gap:8px}.cim-widget-msg-product-card__title,.cim-widget-msg-product-card__title-link{font-family:var(--cim-widget-font-family, sans-serif);font-weight:700;font-size:1rem;line-height:1.3;letter-spacing:-.3px;color:var(--cim-widget-font-color, #3f3f46);margin:0;display:-webkit-box;line-clamp:2;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.cim-widget-msg-product-card__title-link{text-decoration:none;cursor:pointer}button.cim-widget-msg-product-card__title-link{padding:0;border:none;background:none;text-align:left;width:100%}.cim-widget-msg-product-card__title-link:hover{text-decoration:underline}button.cim-widget-msg-product-card__title-link:disabled{cursor:default;text-decoration:none}.cim-widget-msg-product-card__description{font-size:12px}@media(min-width:576px){.cim-widget-msg-product-card__description{display:-webkit-box;line-clamp:4;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}}.cim-widget-msg-product-card__price-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.cim-widget-msg-product-card__prices{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap}.cim-widget-msg-product-card__price{font-family:var(--cim-widget-font-family, sans-serif);font-weight:700;font-size:14px;line-height:1.2;letter-spacing:-.3px;color:var(--cim-widget-font-color, #3f3f46)}.cim-widget-msg-product-card__compare-price{font-family:var(--cim-widget-font-family, sans-serif);font-weight:400;font-size:13px;line-height:1.2;color:var(--cim-widget-font-color, #3f3f46);opacity:.6;text-decoration:line-through}.cim-widget-msg-product-card__add-btn{display:flex;align-items:center;justify-content:center;width:28px;height:28px;min-width:28px;border:none;border-radius:var(--cim-widget-border-radius);background-color:var(--cim-widget-primary-color, #141415);color:#fff;cursor:pointer;transition:opacity .15s ease}.cim-widget-msg-product-card__add-btn:hover{opacity:.85}.cim-widget-msg-product-card__add-btn svg{width:14px;height:14px}.cim-widget-product-carousel-title{font-weight:800}.cim-widget-product-carousel-item{display:flex;flex-direction:column;p.cim-widget-product-carousel-caption{font-size:11px;line-height:1.3;color:color-mix(in hsl decreasing hue,var(--cim-widget-font-color) 80%,white);margin:.25rem .5rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}.cim-widget-cart-express{width:100%;height:0;overflow:hidden;transition:height .15s ease}.cim-widget-cart-express-frame{display:block;width:100%;height:100%;border:0;background:transparent;color-scheme:normal}.cim-widget-cart-express:not(.cim-widget-cart-express-ready) .cim-widget-cart-express-frame{visibility:hidden;pointer-events:none}.cim-widget-cart{display:flex;flex-direction:column;gap:12px;width:100%;padding:16px;background-color:var(--cim-widget-background-color, #ffffff);border:1px solid var(--cim-widget-border-color, #d1d5db);border-radius:var(--cim-widget-border-radius);font-family:var(--cim-widget-font-family, sans-serif);color:var(--cim-widget-font-color, #3f3f46);box-sizing:border-box}.cim-widget-cart *{box-sizing:border-box}.cim-widget-cart-banner{display:flex;align-items:flex-start;gap:10px}.cim-widget-cart-banner-icon{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;background-color:#2e844a;color:#fff}.cim-widget-cart-banner-icon svg{width:16px;height:16px}.cim-widget-cart-banner-text{margin:0;font-size:.875rem;font-weight:500;line-height:1.4}.cim-widget-cart-summary{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:12px 16px;border:none;background-color:transparent;font-family:inherit;color:inherit;text-align:left;cursor:pointer}.cim-widget-cart-summary-text{flex:1 1 auto;min-width:0;font-size:.875rem;line-height:1.4}.cim-widget-cart-summary-text p{margin:0}.cim-widget-cart-summary-toggle{flex:0 0 auto;display:flex;align-items:center;justify-content:center;opacity:.6}.cim-widget-cart-summary-toggle svg{width:20px;height:20px}.cim-widget-cart-box{display:flex;flex-direction:column;border:1px solid var(--cim-widget-border-color, #e4e4e7);border-radius:var(--cim-widget-border-radius)}.cim-widget-cart-expanded{display:flex;flex-direction:column;padding:0 16px;border-top:1px solid var(--cim-widget-border-color, #e4e4e7)}@media(min-width:768px){.cim-widget-embedded-chat .cim-widget-cart-expanded,.cim-widget-modal.standalone .cim-widget-cart-expanded{flex-direction:row;gap:32px;align-items:flex-start}.cim-widget-embedded-chat .cim-widget-cart-expanded .cim-widget-cart-items-section,.cim-widget-modal.standalone .cim-widget-cart-expanded .cim-widget-cart-items-section{flex:1 1 auto;min-width:0}.cim-widget-embedded-chat .cim-widget-cart-expanded .cim-widget-cart-totals,.cim-widget-modal.standalone .cim-widget-cart-expanded .cim-widget-cart-totals{flex:0 0 auto;width:280px;padding-top:64px;padding-bottom:0;gap:14px}.cim-widget-embedded-chat .cim-widget-cart-expanded .cim-widget-cart-total-row,.cim-widget-modal.standalone .cim-widget-cart-expanded .cim-widget-cart-total-row{gap:12px}}.cim-widget-cart-items{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}.cim-widget-cart-item{display:flex;align-items:flex-start;gap:12px;padding:12px 0;border-top:1px solid var(--cim-widget-border-color, #e4e4e7)}.cim-widget-cart-item:first-child{border-top:none}.cim-widget-cart-item-image{flex:0 0 auto;width:64px;height:64px;border-radius:4px;overflow:hidden;background-color:#f4f4f5}.cim-widget-cart-item-image img{width:100%;height:100%;object-fit:cover;display:block}.cim-widget-cart-item-details{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:6px}.cim-widget-cart-item-name{margin:0;font-size:1rem;font-weight:600;line-height:1.3;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}.cim-widget-cart-item-attrs{display:flex;flex-direction:column;gap:6px;margin-top:-3px}.cim-widget-cart-item-attrs p.cim-widget-cart-item-attr,.cim-widget-cart-item-attr{margin:0;font-size:.875rem;line-height:1.3;opacity:.7}.cim-widget-cart-item-attrs p.cim-widget-cart-item-attr+p.cim-widget-cart-item-attr{margin-top:0}.cim-widget-cart-item-price{display:flex;flex-direction:column;align-items:flex-start;gap:2px;white-space:nowrap}.cim-widget-cart-item-original-price{font-size:1rem;opacity:.55;text-decoration:line-through}.cim-widget-cart-item-final-price{font-size:1rem;font-weight:700}.cim-widget-cart-item-footer{display:flex;flex-direction:column;align-items:flex-start;gap:6px}.cim-widget-cart-qty-heading{font-size:.9375rem;font-weight:400;margin-bottom:0}.cim-widget-cart-qty-input-wrapper{display:flex;align-items:center;justify-content:flex-start}.cim-widget-cart-qty-input{width:45px;height:36px;padding:6px 8px;border:1px solid var(--cim-widget-border-color, #d1d5db);border-radius:var(--cim-widget-border-radius);background-color:var(--cim-widget-background-color, #ffffff);color:var(--cim-widget-font-color, #3f3f46);font-family:inherit;font-size:.9375rem;font-weight:400;text-align:center;transition:border-color .15s ease;box-sizing:border-box}.cim-widget-cart-qty-input:hover:not(:disabled){border-color:color-mix(in srgb,var(--cim-widget-font-color, #3f3f46) 40%,var(--cim-widget-border-color, #d1d5db))}.cim-widget-cart-qty-input:focus{outline:none;border-color:var(--cim-widget-primary-color, #2563eb);box-shadow:0 0 0 2px color-mix(in srgb,var(--cim-widget-primary-color, #2563eb) 20%,transparent)}.cim-widget-cart-qty-input:disabled{opacity:.5;cursor:not-allowed}.cim-widget-cart-qty-spinner{width:18px;height:18px;animation:cim-widget-spin 1s linear infinite}@keyframes cim-widget-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.cim-widget-cart-item-remove{padding:0;border:none;background:transparent;font-family:inherit;font-size:.875rem;font-weight:700;color:var(--cim-widget-font-color, #3f3f46);white-space:nowrap;cursor:pointer;transition:opacity .15s ease;text-decoration:underline}.cim-widget-cart-item-remove:hover:not(:disabled){opacity:.7}.cim-widget-cart-item-remove:disabled{opacity:.4;cursor:not-allowed}.cim-widget-cart-chips{display:flex;flex-wrap:wrap;gap:6px}.cim-widget-cart-applied-coupons{padding-top:12px;border-top:1px solid var(--cim-widget-border-color, #e4e4e7)}.cim-widget-cart-chip{display:inline-flex;align-items:center;gap:4px;padding:3px 8px;border:1px solid var(--cim-widget-border-color, #d1d5db);border-radius:var(--cim-widget-border-radius);background-color:#f4f4f5;font-size:.6875rem;font-weight:500;line-height:1.2;letter-spacing:.02em}.cim-widget-cart-chip svg{width:12px;height:12px;opacity:.7}.cim-widget-cart-chip.inactive{opacity:.5}.cim-widget-cart-totals{display:flex;flex-direction:column;gap:6px;padding-top:12px;padding-bottom:16px}.cim-widget-cart-total-shimmer{display:inline-block;height:1em;width:60px;background:linear-gradient(90deg,var(--cim-widget-border-color, #e4e4e7) 25%,color-mix(in srgb,var(--cim-widget-border-color, #e4e4e7) 50%,transparent) 50%,var(--cim-widget-border-color, #e4e4e7) 75%);background-size:200% 100%;border-radius:var(--cim-widget-border-radius);animation:cim-widget-shimmer 1.5s ease-in-out infinite}@keyframes cim-widget-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.cim-widget-cart-total-row{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:.9375rem;line-height:1.3}.cim-widget-cart-total-label{display:inline-flex;align-items:center;gap:8px;opacity:.85}.cim-widget-cart-total-badge{font-weight:700;opacity:1}.cim-widget-cart-total-row.emphasized{margin-top:4px;font-size:1.125rem;font-weight:700}.cim-widget-cart-total-row.emphasized .cim-widget-cart-total-label{opacity:1}.cim-widget-cart-coupon{display:flex;align-items:stretch;gap:8px}.cim-widget-cart-coupon-field{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:8px;padding:0 10px;border:1px solid var(--cim-widget-border-color, #d1d5db);border-radius:var(--cim-widget-border-radius)}.cim-widget-cart-coupon-icon{flex:0 0 auto;display:flex;align-items:center;opacity:.55}.cim-widget-cart-coupon-icon svg{width:16px;height:16px}.cim-widget-cart-coupon-input{flex:1 1 auto;min-width:0;padding:11px 0;border:none;outline:none;background:transparent;font-family:inherit;font-size:.8125rem;color:inherit}.cim-widget-cart-coupon-input::placeholder{opacity:.5}.cim-widget-cart-coupon-input:disabled{cursor:not-allowed}.cim-widget-cart-coupon-submit{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:44px;border:1px solid var(--cim-widget-border-color, #d1d5db);border-radius:var(--cim-widget-border-radius);background-color:transparent;color:inherit;cursor:pointer;transition:background-color .15s ease}.cim-widget-cart-coupon-submit svg{width:16px;height:16px}.cim-widget-cart-coupon-submit:hover:not(:disabled){background-color:color-mix(in srgb,var(--cim-widget-font-color, #3f3f46) 8%,transparent)}.cim-widget-cart-coupon-submit:disabled{opacity:.4;cursor:not-allowed}.cim-widget-cart-checkout-button{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:11px 16px;border:1px solid var(--cim-widget-primary-color, #3182ce);border-radius:var(--cim-widget-border-radius);background-color:transparent;color:var(--cim-widget-primary-color, #3182ce);font-family:inherit;font-size:.9375rem;font-weight:600;text-align:center;text-decoration:none;cursor:pointer;transition:background-color .15s ease}.cim-widget-cart-checkout-button svg{width:16px;height:16px}.cim-widget-cart-checkout-button:hover{background-color:color-mix(in srgb,var(--cim-widget-primary-color, #3182ce) 6%,transparent);text-decoration:none}.cim-widget-cart-footer{margin:0;font-size:.75rem;line-height:1.3;opacity:.6;text-align:center}.cim-widget-order-confirmation-meta{display:flex;flex-direction:column;gap:2px;font-size:.8125rem;opacity:.85}.cim-widget-pdp-gallery{position:relative;width:100%}.cim-widget-pdp-gallery__item-group{display:flex}.cim-widget-pdp-gallery__item{flex-shrink:0;width:100%}.cim-widget-pdp-gallery__image{width:100%;height:100%;aspect-ratio:1 / 1;object-fit:contain;display:block;opacity:0;transition:opacity .2s ease}.cim-widget-pdp-gallery__image--loaded{opacity:1}.cim-widget-pdp-gallery__control{position:absolute;top:50%;left:0;right:0;transform:translateY(-50%);display:flex;justify-content:space-between;pointer-events:none;padding:0 8px}.cim-widget-pdp-gallery__prev-trigger,.cim-widget-pdp-gallery__next-trigger{pointer-events:auto;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:var(--cim-widget-border-radius);border:1px solid var(--cim-widget-border-color, #d1d5db);background-color:var(--cim-widget-background-color, #ffffff);color:var(--cim-widget-font-color, #3f3f46);cursor:pointer;box-shadow:0 1px 3px #00000026;transition:background-color .15s ease,box-shadow .15s ease}.cim-widget-pdp-gallery__prev-trigger:hover,.cim-widget-pdp-gallery__next-trigger:hover{box-shadow:0 2px 6px #0003}.cim-widget-pdp-gallery__indicator-group{display:flex;justify-content:center;gap:6px;padding-top:12px}.cim-widget-pdp-gallery__indicator{width:8px;height:8px;border-radius:50%;border:none;background-color:var(--cim-widget-border-color, #d1d5db);cursor:pointer;padding:0;transition:background-color .2s ease,transform .2s ease}.cim-widget-pdp-gallery__indicator[data-current]{background-color:var(--cim-widget-font-color, #1a202c);transform:scale(1.25)}.cim-widget-pdp-gallery__indicator:hover:not([data-current]){background-color:var(--cim-widget-font-color, #1a202c);opacity:.5}.cim-widget-msg-pdp{width:100%;margin:.5rem 0;font-family:var(--cim-widget-font-family, sans-serif);container:cim-pdp / inline-size}.cim-widget-msg-pdp__card{display:flex;flex-direction:column;background-color:var(--cim-widget-background-color, #ffffff);border:1px solid var(--cim-widget-border-color, #d1d5db);border-radius:var(--cim-widget-border-radius);overflow:hidden}.cim-widget-msg-pdp__content{display:flex;flex-direction:column;gap:1rem;padding:16px}.cim-widget-msg-pdp__title,.cim-widget-msg-pdp__title-link{font-weight:700;font-size:1rem;line-height:1.3;letter-spacing:-.3px;color:var(--cim-widget-font-color, #3f3f46);margin:0}.cim-widget-msg-pdp__title-link{text-decoration:none}.cim-widget-msg-pdp__title-link:hover{text-decoration:underline}.cim-widget-msg-pdp__description{font-size:.75rem;line-height:1.4;color:var(--cim-widget-font-color, #3f3f46);opacity:.85;margin:0}.cim-widget-msg-pdp__variant{display:flex;flex-direction:column;gap:.75rem}.cim-widget-msg-pdp__variant-label{display:flex;align-items:baseline;gap:1rem;font-size:.875rem}.cim-widget-msg-pdp__variant-name{opacity:.7;color:var(--cim-widget-font-color, #3f3f46);white-space:nowrap}.cim-widget-msg-pdp__variant-value{color:var(--cim-widget-font-color, #3f3f46);font-weight:700}.cim-widget-msg-pdp__swatches,.cim-widget-msg-pdp__chips{display:flex;flex-wrap:wrap;gap:.25rem}input[type=radio].cim-widget-msg-pdp__radio-input{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;border-radius:inherit;opacity:0;cursor:pointer}input[type=radio].cim-widget-msg-pdp__radio-input:focus-visible{outline:2px solid var(--cim-widget-primary-color, #3182ce);outline-offset:2px}label.cim-widget-msg-pdp__chip{position:relative;display:inline-flex;align-items:center;justify-content:center;min-width:34px;min-height:34px;padding:.25rem .75rem;background-color:transparent;border:1px solid var(--cim-widget-border-color, #d1d5db);border-radius:var(--cim-widget-border-radius);color:var(--cim-widget-font-color, #3f3f46);font-size:.875rem;box-sizing:border-box;cursor:pointer;user-select:none}label.cim-widget-msg-pdp__chip:hover{background-color:#0000000a;border-color:var(--cim-widget-primary-color, #3182ce)}label.cim-widget-msg-pdp__chip.selected{background-color:var(--cim-widget-primary-color, #3182ce);border-color:var(--cim-widget-primary-color, #3182ce);color:#fff}label.cim-widget-msg-pdp__chip.selected:hover{background-color:color-mix(in srgb,var(--cim-widget-primary-color, #3182ce),black 15%);border-color:color-mix(in srgb,var(--cim-widget-primary-color, #3182ce),black 15%);color:#fff}label.cim-widget-msg-pdp__chip.unavailable{opacity:.4;text-decoration:line-through}label.cim-widget-msg-pdp__swatch{display:inline-flex;position:relative;width:36px;height:36px;min-width:36px;min-height:36px;padding:2px;border-radius:50%;background-color:transparent;border:1px solid var(--cim-widget-border-color, #d1d5db);box-sizing:border-box;overflow:hidden;cursor:pointer;user-select:none}label.cim-widget-msg-pdp__swatch:hover{border-color:var(--cim-widget-font-color, #3f3f46)}label.cim-widget-msg-pdp__swatch.selected{border-width:2px;border-color:var(--cim-widget-font-color, #141415)}label.cim-widget-msg-pdp__swatch.unavailable{opacity:.3}.cim-widget-msg-pdp__swatch-image{width:100%;height:100%;border-radius:50%;object-fit:cover;display:block}.cim-widget-msg-pdp__stepper{display:flex;align-items:center;gap:.25rem}button.cim-widget-msg-pdp__stepper-btn{border:1px solid var(--cim-widget-border-color, #d1d5db);border-radius:var(--cim-widget-border-radius);color:var(--cim-widget-font-color, #3f3f46)}.cim-widget-msg-pdp__quantity{min-width:1.5rem;text-align:center;font-size:.95rem;font-weight:700;color:var(--cim-widget-font-color, #3f3f46)}.cim-widget-msg-pdp__actions{display:flex;flex-direction:column;gap:.5rem;margin-top:.25rem}button.cim-widget-msg-pdp__add-to-cart{min-height:34px;background-color:transparent;border:1px solid var(--cim-widget-primary-color, #3182ce);color:var(--cim-widget-primary-color, #3182ce);font-weight:700;&:hover:disabled{background-color:transparent}}button.cim-widget-msg-pdp__add-to-cart:hover:not(:disabled){background-color:#0000000a}@container cim-pdp (max-width: 340px){.cim-widget-msg-pdp__content{padding:12px}.cim-widget-msg-pdp__title,.cim-widget-msg-pdp__title-link{font-size:.95rem}label.cim-widget-msg-pdp__chip{font-size:.75rem}label.cim-widget-msg-pdp__swatch,button.cim-widget-msg-pdp__stepper-btn{width:28px;height:28px;min-width:28px;min-height:28px}.cim-widget-msg-pdp__quantity{font-size:.85rem}button.cim-widget-msg-pdp__express-pay,button.cim-widget-msg-pdp__add-to-cart{min-height:36px;height:36px;font-size:.8rem}}@container cim-pdp (min-width: 480px){.cim-widget-msg-pdp__card{flex-direction:row;align-items:center;gap:.5rem}.cim-widget-msg-pdp__gallery{flex:0 0 50%;min-width:0;padding-bottom:1.5rem}.cim-widget-msg-pdp__content{flex:1 1 0;min-width:0}}.cim-widget-product-comparison{overflow-x:auto;border:1px solid var(--cim-widget-border-color, #d1d5db);border-radius:var(--cim-widget-border-radius, .5rem);background-color:var(--cim-widget-background-color, #ffffff);margin-bottom:1rem}.cim-widget-product-comparison__grid{display:grid}.cim-widget-product-comparison__header{display:contents}.cim-widget-product-comparison__product-col{display:flex;flex-direction:column;align-items:flex-start;padding:12px 8px 8px;min-width:0;overflow:hidden}.cim-widget-product-comparison__image{width:100%;max-width:100%;max-height:180px;aspect-ratio:1 / 1;object-fit:contain;border-radius:4px;background-color:#fff}.cim-widget-product-comparison__name{font-family:var(--cim-widget-font-family, sans-serif);font-size:.875rem;font-weight:700;line-height:1.3;color:var(--cim-widget-primary-color, #3182ce);text-decoration:none;margin-top:8px;text-align:left;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cim-widget-product-comparison__name:hover{text-decoration:underline}.cim-widget-product-comparison__table,.cim-widget-product-comparison__row{display:contents}.cim-widget-product-comparison__row-label,.cim-widget-product-comparison__row-value{padding:10px 12px;font-family:var(--cim-widget-font-family, sans-serif);font-size:.8125rem;line-height:1.4;color:var(--cim-widget-font-color, #1a202c);border-top:1px solid var(--cim-widget-border-color, #d1d5db)}.cim-widget-product-comparison__row-label{font-weight:700;white-space:nowrap}.cim-widget-product-comparison__row-value{font-weight:400}.cim-widget-message-group,.cim-widget-message{display:flex;flex-direction:column}.cim-widget-message-group{gap:.5rem;padding:.5rem 1rem;margin-bottom:1rem;border-radius:var(--cim-widget-border-radius);&.standalone{padding:0 1rem}.cim-widget-message-group-child{max-width:100%;margin-bottom:.25rem}}.cim-widget-message-group.embedded{max-width:80%;background-color:color-mix(in hsl decreasing hue,var(--cim-widget-secondary-color) 5%,transparent)}.cim-widget-message{margin-bottom:1rem}.cim-widget-message.standalone{border-radius:0;background-color:transparent;padding:0 1rem}.cim-widget-message.embedded{margin-bottom:1rem}.message{border-radius:.5rem}.widget-message{display:flex;align-self:flex-start}.user-message{display:flex;align-self:flex-end;padding:1rem}.cim-widget-reset-message{font-size:.75rem;font-style:italic;color:color-mix(in hsl decreasing hue,var(--cim-widget-font-color) 75%,white)}.cim-widget-start-search-message{font-size:.875rem;font-weight:700;color:var(--cim-widget-font-color)}.cim-widget-user-message{display:flex;flex-direction:column;gap:.5rem;.cim-widget-user-message-row{display:inline-flex;align-items:center;gap:.5rem}}.cim-widget-user-message.embedded{display:inline-flex;align-self:flex-end;padding:.5rem 1rem;border-radius:var(--cim-widget-border-radius);background-color:color-mix(in hsl decreasing hue,var(--cim-widget-primary-color) 10%,transparent);max-width:80%;min-width:50%}.cim-widget-user-message.standalone{margin:.5rem 0}.cim-widget-user-message-image{object-fit:contain;border-radius:8px;&.embedded{max-height:2.5rem}&.standalone{max-height:3.5rem}}.cim-widget-user-message-text{font-weight:700}.cim-widget-user-message-text.standalone{font-size:1.125rem;margin:0}.cim-widget-user-message-text.embedded{margin:0}.cim-widget-message-icon.user-message-icon.embedded{color:var(--cim-widget-primary-color)}.cim-widget-message-group-child{display:flex;flex-direction:column;gap:.25rem}.cim-widget-send-error{display:flex;flex-direction:column;align-items:flex-end;gap:.5rem;padding:.25rem 0;font-family:var(--cim-widget-font-family)}.cim-widget-send-error .cim-widget-send-error-text{font-size:.875rem;line-height:1.4;color:#4a5568;text-align:right}.cim-widget-modal .cim-widget-send-error{align-items:flex-start;padding:0 1rem}.cim-widget-modal .cim-widget-send-error .cim-widget-send-error-text{text-align:left}.cim-widget-retry-button{--base-color: var(--cim-widget-primary-color, #3182ce);display:inline-flex;align-items:center;gap:.3rem;padding:.25rem 0;color:var(--base-color);background:transparent;border:none;font-family:inherit;font-size:.875rem;font-weight:600;cursor:pointer}.cim-widget-retry-button:hover{text-decoration:underline}.cim-widget-retry-button svg{width:1rem;height:1rem}.cim-widget-progress-steps-panel{border-top:1px solid var(--cim-widget-border-color);background-color:var(--cim-widget-background-color);padding:.75rem 1rem}.cim-widget-progress-steps{display:flex;flex-direction:column;gap:6px}.cim-widget-progress-steps-header{font-size:.8125rem;font-weight:700;color:var(--cim-widget-font-color, #1a1a1a)}.cim-widget-progress-steps-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.cim-widget-progress-step{display:flex;align-items:center;gap:8px;font-size:.8125rem;color:var(--cim-widget-secondary-color)}.cim-widget-progress-step.active{font-weight:700;color:var(--cim-widget-font-color, #1a1a1a)}.cim-widget-progress-step-arc{display:inline-block;width:14px;height:14px;flex-shrink:0;border:2px solid transparent;border-top-color:var(--cim-widget-secondary-color);border-left-color:var(--cim-widget-secondary-color);border-radius:50%;animation:cim-widget-step-spin .8s linear infinite}.cim-widget-progress-step-text{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cim-widget-progress-step-icon{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0;margin-left:auto}.cim-widget-progress-step-icon.done{color:var(--cim-widget-secondary-color);opacity:.6}.cim-widget-progress-step-icon.active{color:var(--cim-widget-secondary-color)}.cim-widget-progress-step-check{width:14px;height:14px}.cim-widget-progress-step-starburst{width:14px;height:14px;animation:cim-widget-step-spin 2s linear infinite}@keyframes cim-widget-step-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.cim-widget-progress-step-arc,.cim-widget-progress-step-starburst{animation:none!important}}.cim-widget-embedded-chat{position:relative;width:100%;height:100%;margin:0 auto;border-radius:var(--cim-widget-border-radius);border:1px solid var(--cim-widget-border-color)}.cim-widget-embedded-chat>.cim-widget-message-container{padding-top:2rem;padding-left:1rem;padding-right:1rem}.cim-widget-embedded-chat-menu{position:absolute;top:.25rem;right:.25rem}.cim-widget-overflow-menu-button-trigger.cim-chat-component{border:1px solid var(--cim-widget-border-color);border-radius:var(--cim-widget-border-radius);background-color:#fff}.cim-widget-overflow-menu-button.cim-chat-component{background-color:#fff;border-radius:var(--cim-widget-border-radius);&:hover{background-color:#f0f0f0}}.cim-widget-dialog{box-sizing:border-box;position:fixed;width:35dvw;max-width:100dvw;height:55dvh;border-radius:var(--cim-widget-border-radius);border:1px solid var(--cim-widget-border-color);font-size:.875rem;z-index:9999;&.full-height{height:100%}&.full-height.bottom-left{bottom:0;left:0}&.full-height.bottom-right{bottom:0;right:0}&.bottom-left{bottom:.5rem;left:.5rem;animation:cim-widget-dialog-slide-in-left .25s ease-out}&.bottom-right{bottom:.5rem;right:.5rem;animation:cim-widget-dialog-slide-in-right .25s ease-out}.cim-widget-message-group.embedded{max-width:100%}}.cim-widget-dialog-content{display:flex;flex-direction:column;height:100%}.cim-widget-dialog-header{display:inline-flex;align-items:center;padding:.5rem 1rem;gap:8px;border-bottom:1px solid var(--cim-widget-border-color);background-color:var(--cim-widget-header-background-color)}.cim-widget-dialog-controls{position:absolute;top:4px;right:4px;display:inline-flex;align-items:center}.cim-widget-dialog-logo{object-fit:contain;max-width:50%;max-height:3rem}.cim-widget-dialog-title{width:100%;margin-top:0;margin-bottom:0;line-height:normal;color:var(--cim-widget-header-text-color, inherit);font-size:var(--cim-widget-header-text-font-size);font-weight:var(--cim-widget-header-text-font-weight, bold);font-family:var(--cim-widget-header-text-font-family, inherit);text-align:var(--cim-widget-header-text-text-align, left)}@media(min-width:576px)and (max-width:768px){.cim-widget-dialog{width:50%}}@media(max-width:576px){.cim-widget-dialog{height:100%;width:100dvw!important;max-width:100dvw;border-radius:0;&.full-height{height:100%}&.bottom-left{bottom:0;left:0}&.bottom-right{bottom:0;right:0}}.cim-widget-dialog.bottom-left,.cim-widget-dialog.bottom-right{animation:none}}@media(prefers-reduced-motion:reduce){.cim-widget-dialog.bottom-left,.cim-widget-dialog.bottom-right{animation:none}}@keyframes cim-widget-dialog-slide-in-right{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes cim-widget-dialog-slide-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}.cim-widget-modal-container{display:flex;align-items:center;justify-content:center;position:fixed;top:0;left:0;height:100dvh;width:100dvw;z-index:9999}.cim-widget-modal-backdrop{position:absolute;top:0;left:0;height:100%;width:100%;background:#00000080}.cim-widget-modal{position:fixed;width:70dvw;height:80dvh;border-radius:var(--cim-widget-border-radius);border:1px solid var(--cim-widget-border-color);overflow-y:hidden;&.fullscreen{height:100%;width:100%;border-radius:0}}.cim-widget-modal-content{display:flex;flex-direction:column;height:100%}.cim-widget-modal-header{display:inline-flex;align-items:center;padding:.5rem 1rem;gap:8px;border-bottom:1px solid var(--cim-widget-border-color);background-color:var(--cim-widget-header-background-color)}.cim-widget-modal-controls{position:absolute;top:4px;right:4px;display:inline-flex;align-items:center}.cim-widget-modal-logo{object-fit:contain;max-width:50%;max-height:3rem}.cim-widget-modal-title{width:100%;margin-top:0;margin-bottom:0;line-height:normal;color:var(--cim-widget-header-text-color, inherit);font-size:var(--cim-widget-header-text-font-size);font-weight:var(--cim-widget-header-text-font-weight, bold);font-family:var(--cim-widget-header-text-font-family, inherit);text-align:var(--cim-widget-header-text-text-align, left)}.cim-widget-modal-fullscreen-button,.cim-widget-modal-toggle-dialog-button{display:none}@media(max-width:576px){.cim-widget-modal{height:100%;width:100%;border-radius:0}}@media(min-width:576px){.cim-widget-modal-fullscreen-button,.cim-widget-modal-toggle-dialog-button{display:inline-flex}}.cim-widget-container{box-sizing:border-box;display:flex;flex-direction:column;background-color:var(--cim-widget-background-color);font-family:var(--cim-widget-font-family, inherit);color:var(--cim-widget-font-color, inherit)}.cim-widget-message-container p{margin:.25rem 0;padding:0;+p{margin-top:.5rem}}.cim-widget-message-container span{line-height:1}.cim-widget-header{font-weight:700;color:inherit}.cim-widget-header.h1{margin-top:2rem;margin-bottom:2rem;font-size:1rem}.cim-widget-header.h2{margin-top:1.5rem;margin-bottom:1.5rem;font-size:1rem}.cim-widget-header.h3{margin-top:1rem;margin-bottom:1rem;font-size:1rem}.cim-widget-link{color:var(--cim-widget-primary-color);text-decoration:underline;cursor:pointer}.cim-widget-link:hover{color:var(--cim-widget-secondary-color);text-decoration:none}.cim-widget-text{line-height:1.5;color:inherit;margin-bottom:.25rem}.cim-widget-text.italic{font-style:italic}.cim-widget-text.bold{font-weight:700}.cim-widget-message-container{display:flex;flex-direction:column;flex:1;min-width:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;overflow-wrap:anywhere;padding:1rem;&.container-end{>:first-child{margin-top:auto}}}.cim-widget-message-icon{display:inline-flex;align-items:center;margin-right:.25rem}.cim-widget-message-icon.embedded{font-size:1rem;color:var(--cim-widget-secondary-color)}.cim-widget-message-icon.standalone{font-size:1.5rem;color:var(--cim-widget-primary-color)}.cim-widget-suggestion-container.embedded{display:inline-flex;flex-wrap:wrap;gap:.5rem}.cim-widget-suggestion-button.embedded{height:auto;padding:.2rem .5rem;border:1px solid var(--cim-widget-primary-color);border-radius:var(--cim-widget-border-radius);background-color:transparent;font-size:.875rem;font-weight:600;font-family:inherit;line-height:normal;text-transform:none;color:var(--cim-widget-primary-color);white-space:normal;word-break:break-word;text-align:left;cursor:pointer}.cim-widget-suggestion-button.embedded:hover{background-color:#fff;color:color-mix(in hsl decreasing hue,var(--cim-widget-primary-color) 85%,black)}.cim-widget-suggestion-container.standalone{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:.5rem;padding:.5rem 0}@media(max-width:768px){.cim-widget-suggestion-container.standalone{grid-template-columns:repeat(1,1fr)}}.cim-widget-suggestion-button.standalone{display:inline-flex;align-items:center;padding:.5rem 1rem;border:1px solid var(--cim-widget-primary-color);border-radius:var(--cim-widget-border-radius);background-color:color-mix(in hsl decreasing hue,var(--cim-widget-primary-color) 5%,transparent);font-weight:700;line-height:normal;color:var(--cim-widget-primary-color);text-align:left;white-space:normal;word-break:break-word}.cim-widget-suggestion-button.standalone:hover{background-color:color-mix(in hsl decreasing hue,var(--cim-widget-primary-color) 15%,transparent);color:color-mix(in hsl decreasing hue,var(--cim-widget-primary-color) 85%,black)}.cim-widget-suggestion-button.has-icon{display:inline-flex;align-items:center;gap:.35rem}.cim-widget-suggestion-button.icon-right{flex-direction:row-reverse;justify-content:start}.cim-widget-suggestion-button-icon{flex-shrink:0}.cim-widget-suggestion-button:disabled{border-color:#8a8a8a;background-color:#f9f9f9;color:#8a8a8a;cursor:not-allowed}.cim-widget-suggestion-button:disabled:hover{border-color:#8a8a8a;background-color:#f9f9f9;color:#8a8a8a}.cim-widget-prompts-extension-container{height:100%;width:100%;display:flex;flex-direction:column;align-items:flex-start;padding:1rem .5rem 1rem 1.25rem;gap:.75rem;font-size:.875rem;font-family:var(--cim-widget-font-family, inherit);background-color:var(--cim-widget-background-color);color:var(--cim-widget-font-color, inherit);border:1px solid var(--cim-widget-border-color);border-radius:var(--cim-widget-border-radius);box-sizing:border-box}.cim-widget-prompts-input-container{display:flex;align-items:center;justify-content:center;gap:.5rem;width:100%;.cim-widget-prompts-input-icon{width:20px;height:20px;color:var(--cim-widget-primary-color)}input.cim-widget-prompts-input{width:100%;padding:.25rem 0;outline:none;border-color:transparent;background-color:transparent;border-bottom-width:1px;border-bottom-color:var(--cim-widget-border-color);font-family:var(--cim-widget-font-family, inherit);color:var(--cim-widget-font-color, inherit);&:disabled{opacity:.6;cursor:not-allowed}}input.cim-widget-prompts-input:focus{border-bottom-color:color-mix(in srgb,var(--cim-widget-primary-color),white 25%)}.cim-widget-prompts-input-submit-button:disabled{opacity:.6;background-color:#f9f9f9;cursor:not-allowed}}.cim-widget-prompts-header{display:flex;align-items:center;gap:.5rem;width:100%;.cim-widget-prompts-input-icon{width:20px;height:20px;color:var(--cim-widget-primary-color);flex-shrink:0}.cim-widget-prompts-header-text{color:var(--cim-widget-font-color, inherit)}}.cim-widget-prompts-button-group{display:inline-flex;flex-wrap:wrap;gap:.5rem;width:100%}.cim-widget-prompts-button{height:auto;padding:.2rem .5rem;border:1px solid var(--cim-widget-primary-color);border-radius:var(--cim-widget-border-radius);background-color:transparent;font-size:.875rem;font-weight:700;font-family:inherit;color:var(--cim-widget-primary-color);white-space:normal;word-break:break-word;text-align:left;cursor:pointer}.cim-widget-prompts-button.has-icon{display:inline-flex;align-items:center;gap:.35rem}.cim-widget-prompts-button.icon-right{flex-direction:row-reverse;justify-content:start}.cim-widget-prompts-button:hover{background-color:#fff;color:color-mix(in hsl decreasing hue,var(--cim-widget-primary-color) 85%,black)}.cim-widget-prompts-button:disabled{border-color:#8a8a8a;background-color:#f9f9f9;color:#8a8a8a;cursor:not-allowed}.cim-widget-prompts-button:disabled:hover{border-color:#8a8a8a;background-color:#f9f9f9;color:#8a8a8a}.cim-widget-prompts-extension-messages-container{display:flex;flex-direction:column;gap:1rem;height:100%;width:100%;scrollbar-gutter:stable;overflow-y:auto}.cim-widget-prompts-user-message-container{display:flex;align-items:center;justify-content:flex-end;width:100%}.cim-widget-prompts-user-message{margin:0;max-width:85%;padding:.25rem 1rem;color:#fff;border-radius:var(--cim-widget-border-radius);border:1px solid var(--cim-widget-primary-color);background-color:var(--cim-widget-primary-color)}.cim-widget-prompts-response-container{display:flex;flex:none;flex-direction:column;justify-content:flex-start;padding:.5rem 1rem;border-radius:var(--cim-widget-border-radius);background-color:color-mix(in hsl decreasing hue,var(--cim-widget-secondary-color) 5%,transparent);overscroll-behavior:auto;max-width:85%}.cim-widget-prompts-connecting-message,.cim-widget-prompts-error-message{opacity:.6;margin:0 1rem;font-size:.75rem;font-family:var(--cim-widget-font-family, inherit)}
2
- /*$vite$:1*/`,document.head.appendChild(We);function it(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Et={exports:{}},Rt={},_t={exports:{}},je={};var rn;function xt(){if(rn)return je;rn=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.iterator;function b(M){return M===null||typeof M!="object"?null:(M=p&&M[p]||M["@@iterator"],typeof M=="function"?M:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,x={};function A(M,Z,P){this.props=M,this.context=Z,this.refs=x,this.updater=P||y}A.prototype.isReactComponent={},A.prototype.setState=function(M,Z){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,Z,"setState")},A.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function S(){}S.prototype=A.prototype;function C(M,Z,P){this.props=M,this.context=Z,this.refs=x,this.updater=P||y}var O=C.prototype=new S;O.constructor=C,_(O,A.prototype),O.isPureReactComponent=!0;var z=Array.isArray,G=Object.prototype.hasOwnProperty,D={current:null},V={key:!0,ref:!0,__self:!0,__source:!0};function J(M,Z,P){var xe,Ie={},he=null,ve=null;if(Z!=null)for(xe in Z.ref!==void 0&&(ve=Z.ref),Z.key!==void 0&&(he=""+Z.key),Z)G.call(Z,xe)&&!V.hasOwnProperty(xe)&&(Ie[xe]=Z[xe]);var Fe=arguments.length-2;if(Fe===1)Ie.children=P;else if(1<Fe){for(var Ge=Array(Fe),et=0;et<Fe;et++)Ge[et]=arguments[et+2];Ie.children=Ge}if(M&&M.defaultProps)for(xe in Fe=M.defaultProps,Fe)Ie[xe]===void 0&&(Ie[xe]=Fe[xe]);return{$$typeof:e,type:M,key:he,ref:ve,props:Ie,_owner:D.current}}function se(M,Z){return{$$typeof:e,type:M.type,key:Z,ref:M.ref,props:M.props,_owner:M._owner}}function H(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function ie(M){var Z={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(P){return Z[P]})}var te=/\/+/g;function le(M,Z){return typeof M=="object"&&M!==null&&M.key!=null?ie(""+M.key):Z.toString(36)}function fe(M,Z,P,xe,Ie){var he=typeof M;(he==="undefined"||he==="boolean")&&(M=null);var ve=!1;if(M===null)ve=!0;else switch(he){case"string":case"number":ve=!0;break;case"object":switch(M.$$typeof){case e:case t:ve=!0}}if(ve)return ve=M,Ie=Ie(ve),M=xe===""?"."+le(ve,0):xe,z(Ie)?(P="",M!=null&&(P=M.replace(te,"$&/")+"/"),fe(Ie,Z,P,"",function(et){return et})):Ie!=null&&(H(Ie)&&(Ie=se(Ie,P+(!Ie.key||ve&&ve.key===Ie.key?"":(""+Ie.key).replace(te,"$&/")+"/")+M)),Z.push(Ie)),1;if(ve=0,xe=xe===""?".":xe+":",z(M))for(var Fe=0;Fe<M.length;Fe++){he=M[Fe];var Ge=xe+le(he,Fe);ve+=fe(he,Z,P,Ge,Ie)}else if(Ge=b(M),typeof Ge=="function")for(M=Ge.call(M),Fe=0;!(he=M.next()).done;)he=he.value,Ge=xe+le(he,Fe++),ve+=fe(he,Z,P,Ge,Ie);else if(he==="object")throw Z=String(M),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.");return ve}function ue(M,Z,P){if(M==null)return M;var xe=[],Ie=0;return fe(M,xe,"","",function(he){return Z.call(P,he,Ie++)}),xe}function Se(M){if(M._status===-1){var Z=M._result;Z=Z(),Z.then(function(P){(M._status===0||M._status===-1)&&(M._status=1,M._result=P)},function(P){(M._status===0||M._status===-1)&&(M._status=2,M._result=P)}),M._status===-1&&(M._status=0,M._result=Z)}if(M._status===1)return M._result.default;throw M._result}var de={current:null},W={transition:null},oe={ReactCurrentDispatcher:de,ReactCurrentBatchConfig:W,ReactCurrentOwner:D};function k(){throw Error("act(...) is not supported in production builds of React.")}return je.Children={map:ue,forEach:function(M,Z,P){ue(M,function(){Z.apply(this,arguments)},P)},count:function(M){var Z=0;return ue(M,function(){Z++}),Z},toArray:function(M){return ue(M,function(Z){return Z})||[]},only:function(M){if(!H(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},je.Component=A,je.Fragment=n,je.Profiler=s,je.PureComponent=C,je.StrictMode=r,je.Suspense=d,je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oe,je.act=k,je.cloneElement=function(M,Z,P){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var xe=_({},M.props),Ie=M.key,he=M.ref,ve=M._owner;if(Z!=null){if(Z.ref!==void 0&&(he=Z.ref,ve=D.current),Z.key!==void 0&&(Ie=""+Z.key),M.type&&M.type.defaultProps)var Fe=M.type.defaultProps;for(Ge in Z)G.call(Z,Ge)&&!V.hasOwnProperty(Ge)&&(xe[Ge]=Z[Ge]===void 0&&Fe!==void 0?Fe[Ge]:Z[Ge])}var Ge=arguments.length-2;if(Ge===1)xe.children=P;else if(1<Ge){Fe=Array(Ge);for(var et=0;et<Ge;et++)Fe[et]=arguments[et+2];xe.children=Fe}return{$$typeof:e,type:M.type,key:Ie,ref:he,props:xe,_owner:ve}},je.createContext=function(M){return M={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:a,_context:M},M.Consumer=M},je.createElement=J,je.createFactory=function(M){var Z=J.bind(null,M);return Z.type=M,Z},je.createRef=function(){return{current:null}},je.forwardRef=function(M){return{$$typeof:l,render:M}},je.isValidElement=H,je.lazy=function(M){return{$$typeof:m,_payload:{_status:-1,_result:M},_init:Se}},je.memo=function(M,Z){return{$$typeof:f,type:M,compare:Z===void 0?null:Z}},je.startTransition=function(M){var Z=W.transition;W.transition={};try{M()}finally{W.transition=Z}},je.unstable_act=k,je.useCallback=function(M,Z){return de.current.useCallback(M,Z)},je.useContext=function(M){return de.current.useContext(M)},je.useDebugValue=function(){},je.useDeferredValue=function(M){return de.current.useDeferredValue(M)},je.useEffect=function(M,Z){return de.current.useEffect(M,Z)},je.useId=function(){return de.current.useId()},je.useImperativeHandle=function(M,Z,P){return de.current.useImperativeHandle(M,Z,P)},je.useInsertionEffect=function(M,Z){return de.current.useInsertionEffect(M,Z)},je.useLayoutEffect=function(M,Z){return de.current.useLayoutEffect(M,Z)},je.useMemo=function(M,Z){return de.current.useMemo(M,Z)},je.useReducer=function(M,Z,P){return de.current.useReducer(M,Z,P)},je.useRef=function(M){return de.current.useRef(M)},je.useState=function(M){return de.current.useState(M)},je.useSyncExternalStore=function(M,Z,P){return de.current.useSyncExternalStore(M,Z,P)},je.useTransition=function(){return de.current.useTransition()},je.version="18.3.1",je}var Tn;function sr(){return Tn||(Tn=1,_t.exports=xt()),_t.exports}var zi;function Rs(){if(zi)return Rt;zi=1;var e=sr(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function u(l,d,f){var m,p={},b=null,y=null;f!==void 0&&(b=""+f),d.key!==void 0&&(b=""+d.key),d.ref!==void 0&&(y=d.ref);for(m in d)r.call(d,m)&&!a.hasOwnProperty(m)&&(p[m]=d[m]);if(l&&l.defaultProps)for(m in d=l.defaultProps,d)p[m]===void 0&&(p[m]=d[m]);return{$$typeof:t,type:l,key:b,ref:y,props:p,_owner:s.current}}return Rt.Fragment=n,Rt.jsx=u,Rt.jsxs=u,Rt}var Ls;function vn(){return Ls||(Ls=1,Et.exports=Rs()),Et.exports}var w=vn(),R=sr();const $i=it(R),_r=Object.create(null);_r.open="0",_r.close="1",_r.ping="2",_r.pong="3",_r.message="4",_r.upgrade="5",_r.noop="6";const ku=Object.create(null);Object.keys(_r).forEach(e=>{ku[_r[e]]=e});const Ed={type:"error",data:"parser error"},h0=typeof Blob=="function"||typeof Blob!="undefined"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",p0=typeof ArrayBuffer=="function",m0=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,yd=({type:e,data:t},n,r)=>h0&&t instanceof Blob?n?r(t):g0(t,r):p0&&(t instanceof ArrayBuffer||m0(t))?n?r(t):g0(new Blob([t]),r):r(_r[e]+(t||"")),g0=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function E0(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Td;function P2(e,t){if(h0&&e.data instanceof Blob)return e.data.arrayBuffer().then(E0).then(t);if(p0&&(e.data instanceof ArrayBuffer||m0(e.data)))return t(E0(e.data));yd(e,!1,n=>{Td||(Td=new TextEncoder),t(Td.encode(n))})}const y0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Go=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(let e=0;e<y0.length;e++)Go[y0.charCodeAt(e)]=e;const R2=e=>{let t=e.length*.75,n=e.length,r,s=0,a,u,l,d;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),m=new Uint8Array(f);for(r=0;r<n;r+=4)a=Go[e.charCodeAt(r)],u=Go[e.charCodeAt(r+1)],l=Go[e.charCodeAt(r+2)],d=Go[e.charCodeAt(r+3)],m[s++]=a<<2|u>>4,m[s++]=(u&15)<<4|l>>2,m[s++]=(l&3)<<6|d&63;return f},L2=typeof ArrayBuffer=="function",bd=(e,t)=>{if(typeof e!="string")return{type:"message",data:T0(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:D2(e.substring(1),t)}:ku[n]?e.length>1?{type:ku[n],data:e.substring(1)}:{type:ku[n]}:Ed},D2=(e,t)=>{if(L2){const n=R2(e);return T0(n,t)}else return{base64:!0,data:e}},T0=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,b0="",M2=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((a,u)=>{yd(a,!1,l=>{r[u]=l,++s===n&&t(r.join(b0))})})},F2=(e,t)=>{const n=e.split(b0),r=[];for(let s=0;s<n.length;s++){const a=bd(n[s],t);if(r.push(a),a.type==="error")break}return r};function B2(){return new TransformStream({transform(e,t){P2(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const a=new DataView(s.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{s=new Uint8Array(9);const a=new DataView(s.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let wd;function Cu(e){return e.reduce((t,n)=>t+n.length,0)}function Nu(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function U2(e,t){wd||(wd=new TextDecoder);const n=[];let r=0,s=-1,a=!1;return new TransformStream({transform(u,l){for(n.push(u);;){if(r===0){if(Cu(n)<1)break;const d=Nu(n,1);a=(d[0]&128)===128,s=d[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(Cu(n)<2)break;const d=Nu(n,2);s=new DataView(d.buffer,d.byteOffset,d.length).getUint16(0),r=3}else if(r===2){if(Cu(n)<8)break;const d=Nu(n,8),f=new DataView(d.buffer,d.byteOffset,d.length),m=f.getUint32(0);if(m>Math.pow(2,21)-1){l.enqueue(Ed);break}s=m*Math.pow(2,32)+f.getUint32(4),r=3}else{if(Cu(n)<s)break;const d=Nu(n,s);l.enqueue(bd(a?d:wd.decode(d),t)),r=0}if(s===0||s>e){l.enqueue(Ed);break}}}})}const w0=4;function zt(e){if(e)return H2(e)}function H2(e){for(var t in zt.prototype)e[t]=zt.prototype[t];return e}zt.prototype.on=zt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},zt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},zt.prototype.off=zt.prototype.removeListener=zt.prototype.removeAllListeners=zt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this},zt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this},zt.prototype.emitReserved=zt.prototype.emit,zt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},zt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Ou=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Xn=typeof self!="undefined"?self:typeof window!="undefined"?window:Function("return this")(),j2="arraybuffer";function rU(){}function _0(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const z2=Xn.setTimeout,$2=Xn.clearTimeout;function Iu(e,t){t.useNativeTimers?(e.setTimeoutFn=z2.bind(Xn),e.clearTimeoutFn=$2.bind(Xn)):(e.setTimeoutFn=Xn.setTimeout.bind(Xn),e.clearTimeoutFn=Xn.clearTimeout.bind(Xn))}const V2=1.33;function q2(e){return typeof e=="string"?Y2(e):Math.ceil((e.byteLength||e.size)*V2)}function Y2(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function x0(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function W2(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function G2(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class X2 extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class _d extends zt{constructor(t){super(),this.writable=!1,Iu(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new X2(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=bd(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=W2(t);return n.length?"?"+n:""}}class K2 extends _d{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};F2(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,M2(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=x0()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let S0=!1;try{S0=typeof XMLHttpRequest!="undefined"&&"withCredentials"in new XMLHttpRequest}catch(e){}const Q2=S0;function J2(){}class Z2 extends K2{constructor(t){if(super(t),typeof location!="undefined"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location!="undefined"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,a)=>{this.onError("xhr post error",s,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class xr extends zt{constructor(t,n,r){super(),this.createRequest=t,Iu(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=_0(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch(s){}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(s){}try{r.setRequestHeader("Accept","*/*")}catch(s){}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document!="undefined"&&(this._index=xr.requestsCount++,xr.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr=="undefined"||this._xhr===null)){if(this._xhr.onreadystatechange=J2,t)try{this._xhr.abort()}catch(n){}typeof document!="undefined"&&delete xr.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(xr.requestsCount=0,xr.requests={},typeof document!="undefined"){if(typeof attachEvent=="function")attachEvent("onunload",v0);else if(typeof addEventListener=="function"){const e="onpagehide"in Xn?"pagehide":"unload";addEventListener(e,v0,!1)}}function v0(){for(let e in xr.requests)xr.requests.hasOwnProperty(e)&&xr.requests[e].abort()}const eS=(function(){const e=A0({xdomain:!1});return e&&e.responseType!==null})();class tS extends Z2{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=eS&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new xr(A0,this.uri(),t)}}function A0(e){const t=e.xdomain;try{if(typeof XMLHttpRequest!="undefined"&&(!t||Q2))return new XMLHttpRequest}catch(n){}if(!t)try{return new Xn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(n){}}const k0=typeof navigator!="undefined"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class nS extends _d{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=k0?{}:_0(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;yd(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch(u){}s&&Ou(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws!="undefined"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=x0()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const xd=Xn.WebSocket||Xn.MozWebSocket;class rS extends nS{createSocket(t,n,r){return k0?new xd(t,n,r):n?new xd(t,n):new xd(t)}doWrite(t,n){this.ws.send(n)}}class iS extends _d{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=U2(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=B2();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const a=()=>{r.read().then(({done:l,value:d})=>{l||(this.onPacket(d),a())}).catch(l=>{})};a();const u={type:"open"};this.query.sid&&(u.data=`{"sid":"${this.query.sid}"}`),this._writer.write(u).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&Ou(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const sS={websocket:rS,webtransport:iS,polling:tS},oS=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,aS=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Sd(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=oS.exec(e||""),a={},u=14;for(;u--;)a[aS[u]]=s[u]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=uS(a,a.path),a.queryKey=lS(a,a.query),a}function uS(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function lS(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,a){s&&(n[s]=a)}),n}const vd=typeof addEventListener=="function"&&typeof removeEventListener=="function",Pu=[];vd&&addEventListener("offline",()=>{Pu.forEach(e=>e())},!1);class ui extends zt{constructor(t,n){if(super(),this.binaryType=j2,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Sd(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Sd(n.host).host);Iu(this,n),this.secure=n.secure!=null?n.secure:typeof location!="undefined"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location!="undefined"?location.hostname:"localhost"),this.port=n.port||(typeof location!="undefined"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=G2(this.opts.query)),vd&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Pu.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=w0,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&ui.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",ui.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=q2(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Ou(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(ui.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),vd&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Pu.indexOf(this._offlineEventListener);r!==-1&&Pu.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}ui.protocol=w0;class cS extends ui{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;ui.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ui.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(m(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const b=new Error("probe error");b.transport=n.name,this.emitReserved("upgradeError",b)}}))};function a(){r||(r=!0,m(),n.close(),n=null)}const u=p=>{const b=new Error("probe error: "+p);b.transport=n.name,a(),this.emitReserved("upgradeError",b)};function l(){u("transport closed")}function d(){u("socket closed")}function f(p){n&&p.name!==n.name&&a()}const m=()=>{n.removeListener("open",s),n.removeListener("error",u),n.removeListener("close",l),this.off("close",d),this.off("upgrading",f)};n.once("open",s),n.once("error",u),n.once("close",l),this.once("close",d),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let dS=class extends cS{constructor(t,n={}){const r=typeof t=="object",s=r?j({},t):j({},n);(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(a=>sS[a]).filter(a=>!!a)),super(r?s:t,s)}};function fS(e,t="",n){let r=e;n=n||typeof location!="undefined"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n!="undefined"?e=n.protocol+"//"+e:e="https://"+e),r=Sd(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const hS=typeof ArrayBuffer=="function",pS=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,C0=Object.prototype.toString,mS=typeof Blob=="function"||typeof Blob!="undefined"&&C0.call(Blob)==="[object BlobConstructor]",gS=typeof File=="function"||typeof File!="undefined"&&C0.call(File)==="[object FileConstructor]";function Ad(e){return hS&&(e instanceof ArrayBuffer||pS(e))||mS&&e instanceof Blob||gS&&e instanceof File}function Ru(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Ru(e[n]))return!0;return!1}if(Ad(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Ru(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Ru(e[n]))return!0;return!1}function ES(e){const t=[],n=e.data,r=e;return r.data=Lu(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Lu(e,t,n){if(!e)return e;if(Ad(e)){const r={_placeholder:!0,num:t.length};return t.push(e),r}else if(Array.isArray(e)){const r=new Array(e.length);for(let s=0;s<e.length;s++)r[s]=Lu(e[s],t);return r}else if(typeof e=="object"&&!(e instanceof Date)){if(e.toJSON&&typeof e.toJSON=="function"&&!n)return Lu(e.toJSON(),t,!0);const r={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=Lu(e[s],t));return r}return e}function yS(e,t){return e.data=kd(e.data,t),delete e.attachments,e}function kd(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=kd(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=kd(e[n],t));return e}const TS=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var ot;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(ot||(ot={}));class bS{constructor(t){this.replacer=t}encode(t){return(t.type===ot.EVENT||t.type===ot.ACK)&&Ru(t)?this.encodeAsBinary({type:t.type===ot.EVENT?ot.BINARY_EVENT:ot.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===ot.BINARY_EVENT||t.type===ot.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=ES(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}class Cd extends zt{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===ot.BINARY_EVENT;r||n.type===ot.BINARY_ACK?(n.type=r?ot.EVENT:ot.ACK,this.reconstructor=new wS(n)):super.emitReserved("decoded",n)}else if(Ad(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(ot[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ot.BINARY_EVENT||r.type===ot.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const u=t.substring(a,n);if(u!=Number(u)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const l=Number(u);if(!_S(l)||l<1)throw new Error("Illegal attachments");if(l>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=l}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(a,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const a=n+1;for(;++n;){const u=t.charAt(n);if(u==null||Number(u)!=u){--n;break}if(n===t.length)break}r.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(Cd.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch(n){return!1}}static isPayloadValid(t,n){switch(t){case ot.CONNECT:return N0(n);case ot.DISCONNECT:return n===void 0;case ot.CONNECT_ERROR:return typeof n=="string"||N0(n);case ot.EVENT:case ot.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&TS.indexOf(n[0])===-1);case ot.ACK:case ot.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class wS{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=yS(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const _S=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function N0(e){return Object.prototype.toString.call(e)==="[object Object]"}const xS=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Cd,Encoder:bS,get PacketType(){return ot}},Symbol.toStringTag,{value:"Module"}));function or(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const SS=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class O0 extends zt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[or(t,"open",this.onopen.bind(this)),or(t,"packet",this.onpacket.bind(this)),or(t,"error",this.onerror.bind(this)),or(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,a;if(SS.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const u={type:ot.EVENT,data:n};if(u.options={},u.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const m=this.ids++,p=n.pop();this._registerAckCallback(m,p),u.id=m}const l=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,d=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!l||(d?(this.notifyOutgoingListeners(u),this.packet(u)):this.sendBuffer.push(u)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);n.call(this,new Error("operation has timed out"))},s),u=(...l)=>{this.io.clearTimeoutFn(a),n.apply(this,l)};u.withError=!0,this.acks[t]=u}emitWithAck(t,...n){return new Promise((r,s)=>{const a=(u,l)=>u?s(u):r(l);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...a)=>(this._queue[0],s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:ot.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case ot.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ot.EVENT:case ot.BINARY_EVENT:this.onevent(t);break;case ot.ACK:case ot.BINARY_ACK:this.onack(t);break;case ot.DISCONNECT:this.ondisconnect();break;case ot.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:ot.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ot.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ds(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ds.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0},Ds.prototype.reset=function(){this.attempts=0},Ds.prototype.setMin=function(e){this.ms=e},Ds.prototype.setMax=function(e){this.max=e},Ds.prototype.setJitter=function(e){this.jitter=e};class Nd extends zt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Iu(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ds({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||xS;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new dS(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=or(n,"open",function(){r.onopen(),t&&t()}),a=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},u=or(n,"error",a);if(this._timeout!==!1){const l=this._timeout,d=this.setTimeoutFn(()=>{s(),a(new Error("timeout")),n.close()},l);this.opts.autoUnref&&d.unref(),this.subs.push(()=>{this.clearTimeoutFn(d)})}return this.subs.push(s),this.subs.push(u),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(or(t,"ping",this.onping.bind(this)),or(t,"data",this.ondata.bind(this)),or(t,"error",this.onerror.bind(this)),or(t,"close",this.onclose.bind(this)),or(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Ou(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new O0(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Xo={};function Od(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=fS(e,t.path||"/socket.io"),r=n.source,s=n.id,a=n.path,u=Xo[s]&&a in Xo[s].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||u;let d;return l?d=new Nd(r,t):(Xo[s]||(Xo[s]=new Nd(r,t)),d=Xo[s]),n.query&&!t.query&&(t.query=n.queryKey),d.socket(n.path,t)}Object.assign(Od,{Manager:Nd,Socket:O0,io:Od,connect:Od});const I0=Object.prototype.toString;typeof Blob=="function"||typeof Blob!="undefined"&&I0.call(Blob),typeof File=="function"||typeof File!="undefined"&&I0.call(File);var P0;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(P0||(P0={}));const Id="cimulate",Pd=`${Id}:pdp-update`,Rd=`${Id}:ui-state-update`,Ld=`${Id}:prompts-state-update`,vS=e=>{window.addEventListener(Pd,e)},AS=e=>{window.removeEventListener(Pd,e)},kS=(e,t,n)=>{const r=new CustomEvent(Pd,{detail:{property:e,value:t,event:n}});window.dispatchEvent(r)};class CS{constructor(){Qe(this,"initialParams",{productId:"",productName:"",pdpLink:""});Qe(this,"proxy");Qe(this,"_fullGet",(t,n)=>Reflect.get(t,n));Qe(this,"_fullSet",(t,n,r)=>(kS(n,r),Reflect.set(t,n,r)));Qe(this,"updateProxy",t=>{t.productId&&(this.proxy=new Proxy({productId:t.productId,productName:t.productName||"",pdpLink:t.pdpLink||""},{get:this._fullGet,set:this._fullSet}))});this.proxy=new Proxy({productId:this.initialParams.productId,productName:this.initialParams.productName,pdpLink:this.initialParams.pdpLink},{get:this._fullGet,set:this._fullSet})}get productId(){return this.proxy.productId}get pdpLink(){return this.proxy.pdpLink}get state(){return{productId:this.productId,productName:this.proxy.productName,pdpLink:this.pdpLink}}}const Ko=new CS,R0=["ask_cim","search","browse","pdp"],L0=e=>R0.includes(e),D0={ask_cim:"ask_cim",search:"copilot_search",browse:"copilot_browse",pdp:"product_view"};new Set(Object.values(D0)),new Map(Object.entries(D0).map(([e,t])=>[t,e]));const St=(e,t,n,...r)=>{if(!e)return;const s=["background: linear-gradient(90deg,rgba(253, 99, 99, 1) 0%, rgba(245, 139, 35, 1) 65%)","font-weight: bold","color: transparent","background-clip: text","text-fill-color: transparent"].join(";");console[t]("%c[cimulate-widget]",s,n,...r)};class NS{constructor(t=!1){Qe(this,"isDevelopment");Qe(this,"_log",(t,n,...r)=>{St(this.isDevelopment,t,n,...r)});this.isDevelopment=t}log(t,...n){this._log("log",t,...n)}warn(t,...n){this._log("warn",t,...n)}error(t,...n){this._log("error",t,...n)}info(t,...n){this._log("info",t,...n)}debug(t,...n){this._log("debug",t,...n)}}const OS=({initialEntry:e,entryType:t,isDevelopment:n=!1})=>{var r;if(e){if(!L0(e.type)){St(n,"warn",`initialEntry.type "${e.type}" is not a valid entry type; ignoring.`);return}if(t&&t!==e.type&&St(n,"warn",`initialEntry.type "${e.type}" conflicts with the deprecated entryType "${t}". entryType wins for the UI entry type; initialEntry params are still seeded. Prefer initialEntry on its own.`),e.type==="pdp"){if(!((r=e.params)!=null&&r.productId)){St(n,"warn","initialEntry pdp params must include a productId; skipping proxy seed.");return}Ko.updateProxy(e.params);return}St(n,"info",`initialEntry.type "${e.type}" is not applied yet; only "pdp" is supported in this release.`)}};let IS=class{constructor(){this.listeners=new Map,this.onceListeners=new Map}on(t,n){this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(n)}once(t,n){this.onceListeners.has(t)||this.onceListeners.set(t,new Set),this.onceListeners.get(t).add(n)}off(t,n){var r,s;return t?n?((r=this.listeners.get(t))==null||r.delete(n),void((s=this.onceListeners.get(t))==null?void 0:s.delete(n))):(this.listeners.delete(t),void this.onceListeners.delete(t)):(this.listeners.clear(),void this.onceListeners.clear())}emit(t,...n){const r=this.listeners.get(t);if(r)for(const a of r)try{a(...n)}catch(u){}const s=this.onceListeners.get(t);if(s){for(const a of s)try{a(...n)}catch(u){}this.onceListeners.delete(t)}}};class PS{constructor(t,n,r,s,a){this.url=t,this.headers=n,this.onEvent=r,this.onClose=s,this.logger=a,this.controller=null,this.reading=!1}connect(){return Be(this,null,function*(){if(this.reading)return void this.logger.warn("SSE already connected, ignoring duplicate connect()");this.controller=new AbortController,this.reading=!0;const t=yield fetch(this.url,{method:"GET",headers:ce(j({},this.headers),{Accept:"text/event-stream","Cache-Control":"no-cache"}),signal:this.controller.signal});if(!t.ok){this.reading=!1;const n=yield t.text().catch(()=>t.statusText);throw new Error(`SSE connection failed (${t.status}): ${n}`)}if(!t.body)throw this.reading=!1,new Error("SSE response has no body stream");this.readStream(t.body)})}disconnect(){this.reading=!1,this.controller&&(this.controller.abort(),this.controller=null)}get isConnected(){return this.reading}readStream(t){return Be(this,null,function*(){const n=t.getReader(),r=new TextDecoder;let s="";try{for(;this.reading;){const{value:a,done:u}=yield n.read();if(u)break;let l;for(s+=r.decode(a,{stream:!0}),s=s.replace(/\r\n/g,`
2
+ /*$vite$:1*/`,document.head.appendChild(We);function it(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Et={exports:{}},Rt={},_t={exports:{}},je={};var rn;function xt(){if(rn)return je;rn=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.iterator;function b(D){return D===null||typeof D!="object"?null:(D=p&&D[p]||D["@@iterator"],typeof D=="function"?D:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,x={};function A(D,Z,P){this.props=D,this.context=Z,this.refs=x,this.updater=P||y}A.prototype.isReactComponent={},A.prototype.setState=function(D,Z){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,Z,"setState")},A.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function S(){}S.prototype=A.prototype;function C(D,Z,P){this.props=D,this.context=Z,this.refs=x,this.updater=P||y}var O=C.prototype=new S;O.constructor=C,_(O,A.prototype),O.isPureReactComponent=!0;var z=Array.isArray,G=Object.prototype.hasOwnProperty,M={current:null},V={key:!0,ref:!0,__self:!0,__source:!0};function J(D,Z,P){var xe,Ie={},he=null,ve=null;if(Z!=null)for(xe in Z.ref!==void 0&&(ve=Z.ref),Z.key!==void 0&&(he=""+Z.key),Z)G.call(Z,xe)&&!V.hasOwnProperty(xe)&&(Ie[xe]=Z[xe]);var Fe=arguments.length-2;if(Fe===1)Ie.children=P;else if(1<Fe){for(var Ge=Array(Fe),et=0;et<Fe;et++)Ge[et]=arguments[et+2];Ie.children=Ge}if(D&&D.defaultProps)for(xe in Fe=D.defaultProps,Fe)Ie[xe]===void 0&&(Ie[xe]=Fe[xe]);return{$$typeof:e,type:D,key:he,ref:ve,props:Ie,_owner:M.current}}function se(D,Z){return{$$typeof:e,type:D.type,key:Z,ref:D.ref,props:D.props,_owner:D._owner}}function H(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function ie(D){var Z={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(P){return Z[P]})}var te=/\/+/g;function le(D,Z){return typeof D=="object"&&D!==null&&D.key!=null?ie(""+D.key):Z.toString(36)}function fe(D,Z,P,xe,Ie){var he=typeof D;(he==="undefined"||he==="boolean")&&(D=null);var ve=!1;if(D===null)ve=!0;else switch(he){case"string":case"number":ve=!0;break;case"object":switch(D.$$typeof){case e:case t:ve=!0}}if(ve)return ve=D,Ie=Ie(ve),D=xe===""?"."+le(ve,0):xe,z(Ie)?(P="",D!=null&&(P=D.replace(te,"$&/")+"/"),fe(Ie,Z,P,"",function(et){return et})):Ie!=null&&(H(Ie)&&(Ie=se(Ie,P+(!Ie.key||ve&&ve.key===Ie.key?"":(""+Ie.key).replace(te,"$&/")+"/")+D)),Z.push(Ie)),1;if(ve=0,xe=xe===""?".":xe+":",z(D))for(var Fe=0;Fe<D.length;Fe++){he=D[Fe];var Ge=xe+le(he,Fe);ve+=fe(he,Z,P,Ge,Ie)}else if(Ge=b(D),typeof Ge=="function")for(D=Ge.call(D),Fe=0;!(he=D.next()).done;)he=he.value,Ge=xe+le(he,Fe++),ve+=fe(he,Z,P,Ge,Ie);else if(he==="object")throw Z=String(D),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.");return ve}function ue(D,Z,P){if(D==null)return D;var xe=[],Ie=0;return fe(D,xe,"","",function(he){return Z.call(P,he,Ie++)}),xe}function Se(D){if(D._status===-1){var Z=D._result;Z=Z(),Z.then(function(P){(D._status===0||D._status===-1)&&(D._status=1,D._result=P)},function(P){(D._status===0||D._status===-1)&&(D._status=2,D._result=P)}),D._status===-1&&(D._status=0,D._result=Z)}if(D._status===1)return D._result.default;throw D._result}var de={current:null},W={transition:null},oe={ReactCurrentDispatcher:de,ReactCurrentBatchConfig:W,ReactCurrentOwner:M};function k(){throw Error("act(...) is not supported in production builds of React.")}return je.Children={map:ue,forEach:function(D,Z,P){ue(D,function(){Z.apply(this,arguments)},P)},count:function(D){var Z=0;return ue(D,function(){Z++}),Z},toArray:function(D){return ue(D,function(Z){return Z})||[]},only:function(D){if(!H(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},je.Component=A,je.Fragment=n,je.Profiler=s,je.PureComponent=C,je.StrictMode=r,je.Suspense=d,je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oe,je.act=k,je.cloneElement=function(D,Z,P){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var xe=_({},D.props),Ie=D.key,he=D.ref,ve=D._owner;if(Z!=null){if(Z.ref!==void 0&&(he=Z.ref,ve=M.current),Z.key!==void 0&&(Ie=""+Z.key),D.type&&D.type.defaultProps)var Fe=D.type.defaultProps;for(Ge in Z)G.call(Z,Ge)&&!V.hasOwnProperty(Ge)&&(xe[Ge]=Z[Ge]===void 0&&Fe!==void 0?Fe[Ge]:Z[Ge])}var Ge=arguments.length-2;if(Ge===1)xe.children=P;else if(1<Ge){Fe=Array(Ge);for(var et=0;et<Ge;et++)Fe[et]=arguments[et+2];xe.children=Fe}return{$$typeof:e,type:D.type,key:Ie,ref:he,props:xe,_owner:ve}},je.createContext=function(D){return D={$$typeof:u,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:a,_context:D},D.Consumer=D},je.createElement=J,je.createFactory=function(D){var Z=J.bind(null,D);return Z.type=D,Z},je.createRef=function(){return{current:null}},je.forwardRef=function(D){return{$$typeof:l,render:D}},je.isValidElement=H,je.lazy=function(D){return{$$typeof:m,_payload:{_status:-1,_result:D},_init:Se}},je.memo=function(D,Z){return{$$typeof:f,type:D,compare:Z===void 0?null:Z}},je.startTransition=function(D){var Z=W.transition;W.transition={};try{D()}finally{W.transition=Z}},je.unstable_act=k,je.useCallback=function(D,Z){return de.current.useCallback(D,Z)},je.useContext=function(D){return de.current.useContext(D)},je.useDebugValue=function(){},je.useDeferredValue=function(D){return de.current.useDeferredValue(D)},je.useEffect=function(D,Z){return de.current.useEffect(D,Z)},je.useId=function(){return de.current.useId()},je.useImperativeHandle=function(D,Z,P){return de.current.useImperativeHandle(D,Z,P)},je.useInsertionEffect=function(D,Z){return de.current.useInsertionEffect(D,Z)},je.useLayoutEffect=function(D,Z){return de.current.useLayoutEffect(D,Z)},je.useMemo=function(D,Z){return de.current.useMemo(D,Z)},je.useReducer=function(D,Z,P){return de.current.useReducer(D,Z,P)},je.useRef=function(D){return de.current.useRef(D)},je.useState=function(D){return de.current.useState(D)},je.useSyncExternalStore=function(D,Z,P){return de.current.useSyncExternalStore(D,Z,P)},je.useTransition=function(){return de.current.useTransition()},je.version="18.3.1",je}var Tn;function sr(){return Tn||(Tn=1,_t.exports=xt()),_t.exports}var zi;function Rs(){if(zi)return Rt;zi=1;var e=sr(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function u(l,d,f){var m,p={},b=null,y=null;f!==void 0&&(b=""+f),d.key!==void 0&&(b=""+d.key),d.ref!==void 0&&(y=d.ref);for(m in d)r.call(d,m)&&!a.hasOwnProperty(m)&&(p[m]=d[m]);if(l&&l.defaultProps)for(m in d=l.defaultProps,d)p[m]===void 0&&(p[m]=d[m]);return{$$typeof:t,type:l,key:b,ref:y,props:p,_owner:s.current}}return Rt.Fragment=n,Rt.jsx=u,Rt.jsxs=u,Rt}var Ls;function vn(){return Ls||(Ls=1,Et.exports=Rs()),Et.exports}var w=vn(),R=sr();const $i=it(R),_r=Object.create(null);_r.open="0",_r.close="1",_r.ping="2",_r.pong="3",_r.message="4",_r.upgrade="5",_r.noop="6";const ku=Object.create(null);Object.keys(_r).forEach(e=>{ku[_r[e]]=e});const Ed={type:"error",data:"parser error"},h0=typeof Blob=="function"||typeof Blob!="undefined"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",p0=typeof ArrayBuffer=="function",m0=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,yd=({type:e,data:t},n,r)=>h0&&t instanceof Blob?n?r(t):g0(t,r):p0&&(t instanceof ArrayBuffer||m0(t))?n?r(t):g0(new Blob([t]),r):r(_r[e]+(t||"")),g0=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function E0(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Td;function P2(e,t){if(h0&&e.data instanceof Blob)return e.data.arrayBuffer().then(E0).then(t);if(p0&&(e.data instanceof ArrayBuffer||m0(e.data)))return t(E0(e.data));yd(e,!1,n=>{Td||(Td=new TextEncoder),t(Td.encode(n))})}const y0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Go=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(let e=0;e<y0.length;e++)Go[y0.charCodeAt(e)]=e;const R2=e=>{let t=e.length*.75,n=e.length,r,s=0,a,u,l,d;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),m=new Uint8Array(f);for(r=0;r<n;r+=4)a=Go[e.charCodeAt(r)],u=Go[e.charCodeAt(r+1)],l=Go[e.charCodeAt(r+2)],d=Go[e.charCodeAt(r+3)],m[s++]=a<<2|u>>4,m[s++]=(u&15)<<4|l>>2,m[s++]=(l&3)<<6|d&63;return f},L2=typeof ArrayBuffer=="function",bd=(e,t)=>{if(typeof e!="string")return{type:"message",data:T0(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:D2(e.substring(1),t)}:ku[n]?e.length>1?{type:ku[n],data:e.substring(1)}:{type:ku[n]}:Ed},D2=(e,t)=>{if(L2){const n=R2(e);return T0(n,t)}else return{base64:!0,data:e}},T0=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,b0="",M2=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((a,u)=>{yd(a,!1,l=>{r[u]=l,++s===n&&t(r.join(b0))})})},F2=(e,t)=>{const n=e.split(b0),r=[];for(let s=0;s<n.length;s++){const a=bd(n[s],t);if(r.push(a),a.type==="error")break}return r};function B2(){return new TransformStream({transform(e,t){P2(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const a=new DataView(s.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{s=new Uint8Array(9);const a=new DataView(s.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let wd;function Cu(e){return e.reduce((t,n)=>t+n.length,0)}function Nu(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function U2(e,t){wd||(wd=new TextDecoder);const n=[];let r=0,s=-1,a=!1;return new TransformStream({transform(u,l){for(n.push(u);;){if(r===0){if(Cu(n)<1)break;const d=Nu(n,1);a=(d[0]&128)===128,s=d[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(Cu(n)<2)break;const d=Nu(n,2);s=new DataView(d.buffer,d.byteOffset,d.length).getUint16(0),r=3}else if(r===2){if(Cu(n)<8)break;const d=Nu(n,8),f=new DataView(d.buffer,d.byteOffset,d.length),m=f.getUint32(0);if(m>Math.pow(2,21)-1){l.enqueue(Ed);break}s=m*Math.pow(2,32)+f.getUint32(4),r=3}else{if(Cu(n)<s)break;const d=Nu(n,s);l.enqueue(bd(a?d:wd.decode(d),t)),r=0}if(s===0||s>e){l.enqueue(Ed);break}}}})}const w0=4;function zt(e){if(e)return H2(e)}function H2(e){for(var t in zt.prototype)e[t]=zt.prototype[t];return e}zt.prototype.on=zt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},zt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},zt.prototype.off=zt.prototype.removeListener=zt.prototype.removeAllListeners=zt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this},zt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this},zt.prototype.emitReserved=zt.prototype.emit,zt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},zt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Ou=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Xn=typeof self!="undefined"?self:typeof window!="undefined"?window:Function("return this")(),j2="arraybuffer";function rU(){}function _0(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const z2=Xn.setTimeout,$2=Xn.clearTimeout;function Iu(e,t){t.useNativeTimers?(e.setTimeoutFn=z2.bind(Xn),e.clearTimeoutFn=$2.bind(Xn)):(e.setTimeoutFn=Xn.setTimeout.bind(Xn),e.clearTimeoutFn=Xn.clearTimeout.bind(Xn))}const V2=1.33;function q2(e){return typeof e=="string"?Y2(e):Math.ceil((e.byteLength||e.size)*V2)}function Y2(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function x0(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function W2(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function G2(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class X2 extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class _d extends zt{constructor(t){super(),this.writable=!1,Iu(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new X2(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=bd(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=W2(t);return n.length?"?"+n:""}}class K2 extends _d{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};F2(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,M2(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=x0()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let S0=!1;try{S0=typeof XMLHttpRequest!="undefined"&&"withCredentials"in new XMLHttpRequest}catch(e){}const Q2=S0;function J2(){}class Z2 extends K2{constructor(t){if(super(t),typeof location!="undefined"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location!="undefined"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,a)=>{this.onError("xhr post error",s,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class xr extends zt{constructor(t,n,r){super(),this.createRequest=t,Iu(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=_0(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch(s){}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(s){}try{r.setRequestHeader("Accept","*/*")}catch(s){}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document!="undefined"&&(this._index=xr.requestsCount++,xr.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr=="undefined"||this._xhr===null)){if(this._xhr.onreadystatechange=J2,t)try{this._xhr.abort()}catch(n){}typeof document!="undefined"&&delete xr.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(xr.requestsCount=0,xr.requests={},typeof document!="undefined"){if(typeof attachEvent=="function")attachEvent("onunload",v0);else if(typeof addEventListener=="function"){const e="onpagehide"in Xn?"pagehide":"unload";addEventListener(e,v0,!1)}}function v0(){for(let e in xr.requests)xr.requests.hasOwnProperty(e)&&xr.requests[e].abort()}const eS=(function(){const e=A0({xdomain:!1});return e&&e.responseType!==null})();class tS extends Z2{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=eS&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new xr(A0,this.uri(),t)}}function A0(e){const t=e.xdomain;try{if(typeof XMLHttpRequest!="undefined"&&(!t||Q2))return new XMLHttpRequest}catch(n){}if(!t)try{return new Xn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(n){}}const k0=typeof navigator!="undefined"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class nS extends _d{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=k0?{}:_0(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;yd(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch(u){}s&&Ou(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws!="undefined"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=x0()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const xd=Xn.WebSocket||Xn.MozWebSocket;class rS extends nS{createSocket(t,n,r){return k0?new xd(t,n,r):n?new xd(t,n):new xd(t)}doWrite(t,n){this.ws.send(n)}}class iS extends _d{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=U2(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=B2();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const a=()=>{r.read().then(({done:l,value:d})=>{l||(this.onPacket(d),a())}).catch(l=>{})};a();const u={type:"open"};this.query.sid&&(u.data=`{"sid":"${this.query.sid}"}`),this._writer.write(u).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&Ou(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const sS={websocket:rS,webtransport:iS,polling:tS},oS=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,aS=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Sd(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=oS.exec(e||""),a={},u=14;for(;u--;)a[aS[u]]=s[u]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=uS(a,a.path),a.queryKey=lS(a,a.query),a}function uS(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function lS(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,a){s&&(n[s]=a)}),n}const vd=typeof addEventListener=="function"&&typeof removeEventListener=="function",Pu=[];vd&&addEventListener("offline",()=>{Pu.forEach(e=>e())},!1);class ui extends zt{constructor(t,n){if(super(),this.binaryType=j2,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Sd(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Sd(n.host).host);Iu(this,n),this.secure=n.secure!=null?n.secure:typeof location!="undefined"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location!="undefined"?location.hostname:"localhost"),this.port=n.port||(typeof location!="undefined"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=G2(this.opts.query)),vd&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Pu.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=w0,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&ui.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",ui.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=q2(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Ou(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(ui.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),vd&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Pu.indexOf(this._offlineEventListener);r!==-1&&Pu.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}ui.protocol=w0;class cS extends ui{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;ui.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ui.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(m(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const b=new Error("probe error");b.transport=n.name,this.emitReserved("upgradeError",b)}}))};function a(){r||(r=!0,m(),n.close(),n=null)}const u=p=>{const b=new Error("probe error: "+p);b.transport=n.name,a(),this.emitReserved("upgradeError",b)};function l(){u("transport closed")}function d(){u("socket closed")}function f(p){n&&p.name!==n.name&&a()}const m=()=>{n.removeListener("open",s),n.removeListener("error",u),n.removeListener("close",l),this.off("close",d),this.off("upgrading",f)};n.once("open",s),n.once("error",u),n.once("close",l),this.once("close",d),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let dS=class extends cS{constructor(t,n={}){const r=typeof t=="object",s=r?j({},t):j({},n);(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(a=>sS[a]).filter(a=>!!a)),super(r?s:t,s)}};function fS(e,t="",n){let r=e;n=n||typeof location!="undefined"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n!="undefined"?e=n.protocol+"//"+e:e="https://"+e),r=Sd(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const hS=typeof ArrayBuffer=="function",pS=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,C0=Object.prototype.toString,mS=typeof Blob=="function"||typeof Blob!="undefined"&&C0.call(Blob)==="[object BlobConstructor]",gS=typeof File=="function"||typeof File!="undefined"&&C0.call(File)==="[object FileConstructor]";function Ad(e){return hS&&(e instanceof ArrayBuffer||pS(e))||mS&&e instanceof Blob||gS&&e instanceof File}function Ru(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Ru(e[n]))return!0;return!1}if(Ad(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Ru(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Ru(e[n]))return!0;return!1}function ES(e){const t=[],n=e.data,r=e;return r.data=Lu(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Lu(e,t,n){if(!e)return e;if(Ad(e)){const r={_placeholder:!0,num:t.length};return t.push(e),r}else if(Array.isArray(e)){const r=new Array(e.length);for(let s=0;s<e.length;s++)r[s]=Lu(e[s],t);return r}else if(typeof e=="object"&&!(e instanceof Date)){if(e.toJSON&&typeof e.toJSON=="function"&&!n)return Lu(e.toJSON(),t,!0);const r={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=Lu(e[s],t));return r}return e}function yS(e,t){return e.data=kd(e.data,t),delete e.attachments,e}function kd(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=kd(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=kd(e[n],t));return e}const TS=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var ot;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(ot||(ot={}));class bS{constructor(t){this.replacer=t}encode(t){return(t.type===ot.EVENT||t.type===ot.ACK)&&Ru(t)?this.encodeAsBinary({type:t.type===ot.EVENT?ot.BINARY_EVENT:ot.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===ot.BINARY_EVENT||t.type===ot.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=ES(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}class Cd extends zt{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===ot.BINARY_EVENT;r||n.type===ot.BINARY_ACK?(n.type=r?ot.EVENT:ot.ACK,this.reconstructor=new wS(n)):super.emitReserved("decoded",n)}else if(Ad(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(ot[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ot.BINARY_EVENT||r.type===ot.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const u=t.substring(a,n);if(u!=Number(u)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const l=Number(u);if(!_S(l)||l<1)throw new Error("Illegal attachments");if(l>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=l}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(a,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const a=n+1;for(;++n;){const u=t.charAt(n);if(u==null||Number(u)!=u){--n;break}if(n===t.length)break}r.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(Cd.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch(n){return!1}}static isPayloadValid(t,n){switch(t){case ot.CONNECT:return N0(n);case ot.DISCONNECT:return n===void 0;case ot.CONNECT_ERROR:return typeof n=="string"||N0(n);case ot.EVENT:case ot.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&TS.indexOf(n[0])===-1);case ot.ACK:case ot.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class wS{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=yS(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const _S=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function N0(e){return Object.prototype.toString.call(e)==="[object Object]"}const xS=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Cd,Encoder:bS,get PacketType(){return ot}},Symbol.toStringTag,{value:"Module"}));function or(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const SS=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class O0 extends zt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[or(t,"open",this.onopen.bind(this)),or(t,"packet",this.onpacket.bind(this)),or(t,"error",this.onerror.bind(this)),or(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,a;if(SS.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const u={type:ot.EVENT,data:n};if(u.options={},u.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const m=this.ids++,p=n.pop();this._registerAckCallback(m,p),u.id=m}const l=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,d=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!l||(d?(this.notifyOutgoingListeners(u),this.packet(u)):this.sendBuffer.push(u)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);n.call(this,new Error("operation has timed out"))},s),u=(...l)=>{this.io.clearTimeoutFn(a),n.apply(this,l)};u.withError=!0,this.acks[t]=u}emitWithAck(t,...n){return new Promise((r,s)=>{const a=(u,l)=>u?s(u):r(l);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...a)=>(this._queue[0],s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:ot.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case ot.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ot.EVENT:case ot.BINARY_EVENT:this.onevent(t);break;case ot.ACK:case ot.BINARY_ACK:this.onack(t);break;case ot.DISCONNECT:this.ondisconnect();break;case ot.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:ot.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ot.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ds(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ds.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0},Ds.prototype.reset=function(){this.attempts=0},Ds.prototype.setMin=function(e){this.ms=e},Ds.prototype.setMax=function(e){this.max=e},Ds.prototype.setJitter=function(e){this.jitter=e};class Nd extends zt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Iu(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ds({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||xS;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new dS(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=or(n,"open",function(){r.onopen(),t&&t()}),a=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},u=or(n,"error",a);if(this._timeout!==!1){const l=this._timeout,d=this.setTimeoutFn(()=>{s(),a(new Error("timeout")),n.close()},l);this.opts.autoUnref&&d.unref(),this.subs.push(()=>{this.clearTimeoutFn(d)})}return this.subs.push(s),this.subs.push(u),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(or(t,"ping",this.onping.bind(this)),or(t,"data",this.ondata.bind(this)),or(t,"error",this.onerror.bind(this)),or(t,"close",this.onclose.bind(this)),or(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Ou(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new O0(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Xo={};function Od(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=fS(e,t.path||"/socket.io"),r=n.source,s=n.id,a=n.path,u=Xo[s]&&a in Xo[s].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||u;let d;return l?d=new Nd(r,t):(Xo[s]||(Xo[s]=new Nd(r,t)),d=Xo[s]),n.query&&!t.query&&(t.query=n.queryKey),d.socket(n.path,t)}Object.assign(Od,{Manager:Nd,Socket:O0,io:Od,connect:Od});const I0=Object.prototype.toString;typeof Blob=="function"||typeof Blob!="undefined"&&I0.call(Blob),typeof File=="function"||typeof File!="undefined"&&I0.call(File);var P0;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(P0||(P0={}));const Id="cimulate",Pd=`${Id}:pdp-update`,Rd=`${Id}:ui-state-update`,Ld=`${Id}:prompts-state-update`,vS=e=>{window.addEventListener(Pd,e)},AS=e=>{window.removeEventListener(Pd,e)},kS=(e,t,n)=>{const r=new CustomEvent(Pd,{detail:{property:e,value:t,event:n}});window.dispatchEvent(r)};class CS{constructor(){Qe(this,"initialParams",{productId:"",productName:"",pdpLink:""});Qe(this,"proxy");Qe(this,"_fullGet",(t,n)=>Reflect.get(t,n));Qe(this,"_fullSet",(t,n,r)=>(kS(n,r),Reflect.set(t,n,r)));Qe(this,"updateProxy",t=>{t.productId&&(this.proxy=new Proxy({productId:t.productId,productName:t.productName||"",pdpLink:t.pdpLink||""},{get:this._fullGet,set:this._fullSet}))});this.proxy=new Proxy({productId:this.initialParams.productId,productName:this.initialParams.productName,pdpLink:this.initialParams.pdpLink},{get:this._fullGet,set:this._fullSet})}get productId(){return this.proxy.productId}get pdpLink(){return this.proxy.pdpLink}get state(){return{productId:this.productId,productName:this.proxy.productName,pdpLink:this.pdpLink}}}const Ko=new CS,R0=["ask_cim","search","browse","pdp"],L0=e=>R0.includes(e),D0={ask_cim:"ask_cim",search:"copilot_search",browse:"copilot_browse",pdp:"product_view"};new Set(Object.values(D0)),new Map(Object.entries(D0).map(([e,t])=>[t,e]));const St=(e,t,n,...r)=>{if(!e)return;const s=["background: linear-gradient(90deg,rgba(253, 99, 99, 1) 0%, rgba(245, 139, 35, 1) 65%)","font-weight: bold","color: transparent","background-clip: text","text-fill-color: transparent"].join(";");console[t]("%c[cimulate-widget]",s,n,...r)};class NS{constructor(t=!1){Qe(this,"isDevelopment");Qe(this,"_log",(t,n,...r)=>{St(this.isDevelopment,t,n,...r)});this.isDevelopment=t}log(t,...n){this._log("log",t,...n)}warn(t,...n){this._log("warn",t,...n)}error(t,...n){this._log("error",t,...n)}info(t,...n){this._log("info",t,...n)}debug(t,...n){this._log("debug",t,...n)}}const OS=({initialEntry:e,entryType:t,isDevelopment:n=!1})=>{var r;if(e){if(!L0(e.type)){St(n,"warn",`initialEntry.type "${e.type}" is not a valid entry type; ignoring.`);return}if(t&&t!==e.type&&St(n,"warn",`initialEntry.type "${e.type}" conflicts with the deprecated entryType "${t}". entryType wins for the UI entry type; initialEntry params are still seeded. Prefer initialEntry on its own.`),e.type==="pdp"){if(!((r=e.params)!=null&&r.productId)){St(n,"warn","initialEntry pdp params must include a productId; skipping proxy seed.");return}Ko.updateProxy(e.params);return}St(n,"info",`initialEntry.type "${e.type}" is not applied yet; only "pdp" is supported in this release.`)}};let IS=class{constructor(){this.listeners=new Map,this.onceListeners=new Map}on(t,n){this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(n)}once(t,n){this.onceListeners.has(t)||this.onceListeners.set(t,new Set),this.onceListeners.get(t).add(n)}off(t,n){var r,s;return t?n?((r=this.listeners.get(t))==null||r.delete(n),void((s=this.onceListeners.get(t))==null?void 0:s.delete(n))):(this.listeners.delete(t),void this.onceListeners.delete(t)):(this.listeners.clear(),void this.onceListeners.clear())}emit(t,...n){const r=this.listeners.get(t);if(r)for(const a of r)try{a(...n)}catch(u){}const s=this.onceListeners.get(t);if(s){for(const a of s)try{a(...n)}catch(u){}this.onceListeners.delete(t)}}};class PS{constructor(t,n,r,s,a){this.url=t,this.headers=n,this.onEvent=r,this.onClose=s,this.logger=a,this.controller=null,this.reading=!1}connect(){return Be(this,null,function*(){if(this.reading)return void this.logger.warn("SSE already connected, ignoring duplicate connect()");this.controller=new AbortController,this.reading=!0;const t=yield fetch(this.url,{method:"GET",headers:ce(j({},this.headers),{Accept:"text/event-stream","Cache-Control":"no-cache"}),signal:this.controller.signal});if(!t.ok){this.reading=!1;const n=yield t.text().catch(()=>t.statusText);throw new Error(`SSE connection failed (${t.status}): ${n}`)}if(!t.body)throw this.reading=!1,new Error("SSE response has no body stream");this.readStream(t.body)})}disconnect(){this.reading=!1,this.controller&&(this.controller.abort(),this.controller=null)}get isConnected(){return this.reading}readStream(t){return Be(this,null,function*(){const n=t.getReader(),r=new TextDecoder;let s="";try{for(;this.reading;){const{value:a,done:u}=yield n.read();if(u)break;let l;for(s+=r.decode(a,{stream:!0}),s=s.replace(/\r\n/g,`
3
3
  `).replace(/\r/g,`
4
4
  `);(l=s.indexOf(`
5
5
 
6
6
  `))>=0;){const d=s.slice(0,l);s=s.slice(l+2),this.parseFrame(d)}}}catch(a){return a instanceof DOMException&&a.name==="AbortError"?void this.logger.debug("SSE stream aborted (intentional disconnect)"):(this.logger.error("SSE stream error:",a),this.reading=!1,void this.onClose(a instanceof Error?a.message:"Unknown stream error"))}finally{n.releaseLock()}this.reading=!1,this.logger.info("SSE stream ended"),this.onClose("stream_ended")})}parseFrame(t){let n="message";const r=[];for(const a of t.split(`
7
7
  `))if(a.startsWith("event:"))n=a.slice(6).trim();else if(a.startsWith("data:")){const u=a.slice(5);r.push(u.startsWith(" ")?u.slice(1):u)}else a.startsWith(":");if(r.length===0)return;const s=r.join(`
8
- `);this.logger.debug(`SSE event: ${n}`,s.slice(0,200)),this.onEvent(n,s)}}class zr extends Error{constructor(t,n="unknown",r){super(t,r),this.name="AgentforceClientError",this.type=n}}let M0=class extends zr{constructor(t,n,r,s){super(t,"api",s),this.name="AgentforceApiError",this.statusCode=n,this.responseBody=r}};class F0 extends zr{constructor(t,n=1,r){super(t,"network",r),this.name="AgentforceNetworkError",this.attemptsMade=n}}let Dd=class extends zr{constructor(t,n){super(t,"auth",n),this.name="AgentforceAuthError"}};class RS{constructor(t){this.prefix="[Agentforce]",this.enabled=t}info(t,...n){this.enabled&&console.log(`${this.prefix} ${t}`,...n)}warn(t,...n){this.enabled&&console.warn(`${this.prefix} ${t}`,...n)}error(t,...n){this.enabled&&console.error(`${this.prefix} ${t}`,...n)}debug(t,...n){this.enabled&&console.debug(`${this.prefix} ${t}`,...n)}}const LS="0Mw";let DS=class extends IS{constructor({baseURL:t,orgId:n,esDeveloperName:r,options:s={}}){var u,l,d,f,m,p,b;super(),this._accessToken=null,this._tokenExpiresAt=0,this._conversationId=null,this._isConnected=!1,this._usingContinuationToken=!1,this.sseReader=null,this.reconnectAttempts=0,this.reconnectTimeout=null,this.intentionalDisconnect=!1,this.baseURL=t.replace(/\/+$/,""),this.orgId=n,this.esDeveloperName=r;const a={maxRetries:(u=s.maxRetries)!=null?u:3,timeout:(l=s.timeout)!=null?l:15e3,maxReconnectAttempts:(d=s.maxReconnectAttempts)!=null?d:5,reconnectDelay:(f=s.reconnectDelay)!=null?f:2e3,enableLogging:(m=s.enableLogging)!=null?m:!1,platform:(p=s.platform)!=null?p:"Web",capabilitiesVersion:(b=s.capabilitiesVersion)!=null?b:"1"};this.maxRetries=a.maxRetries,this.timeout=a.timeout,this.maxReconnectAttempts=a.maxReconnectAttempts,this.reconnectDelay=a.reconnectDelay,this.platform=a.platform,this.capabilitiesVersion=a.capabilitiesVersion,this.logger=new RS(a.enableLogging),this.logger.info(`Client initialized for ${this.baseURL}`)}get isConnected(){return this._isConnected}get conversationId(){return this._conversationId}get accessToken(){return this._accessToken}connect(t){return Be(this,null,function*(){this.intentionalDisconnect=!1,this.reconnectAttempts=0,this.logger.info("Connecting..."),t!=null&&t.continuationToken?(this._accessToken=t.continuationToken,this._tokenExpiresAt=this.getTokenExpiry(t.continuationToken),this._usingContinuationToken=!0,this.logger.info("Using continuation token")):(this._accessToken=yield this.fetchAccessToken(),this._usingContinuationToken=!1,this.logger.info("Access token acquired")),yield this.openSSE(t==null?void 0:t.lastEventId)})}disconnect(){this.intentionalDisconnect=!0,this.clearReconnectTimer(),this.closeSSE(),this._isConnected=!1,this.logger.info("Disconnected")}reconnect(){this._isConnected||(this.intentionalDisconnect=!1,this.reconnectAttempts=0,this.attemptReconnect())}createConversation(t){return Be(this,null,function*(){this.assertConnected();const n=crypto.randomUUID(),r={conversationId:n,esDeveloperName:this.esDeveloperName,routingAttributes:t!=null?t:{}};return yield this.executeRequest("POST","/iamessage/api/v2/conversation",r),this._conversationId=n,this.logger.info(`Conversation created: ${n}`),n})}sendMessage(t){return Be(this,null,function*(){if(this.assertConnected(),!this._conversationId)throw new zr("No active conversation. Call createConversation() first.","unknown");const n=crypto.randomUUID(),r={message:{id:n,messageType:"StaticContentMessage",staticContent:{formatType:"Text",text:t}},esDeveloperName:this.esDeveloperName};yield this.executeRequest("POST",`/iamessage/api/v2/conversation/${this._conversationId}/message`,r),this.logger.debug(`Message sent: ${n}`)})}endConversation(){return Be(this,null,function*(){if(!this._conversationId||!this._accessToken)return;const t=this._conversationId;this._conversationId=null;try{yield this.executeRequest("DELETE",`/iamessage/api/v2/conversation/${t}?esDeveloperName=${encodeURIComponent(this.esDeveloperName)}`),this.logger.info(`Conversation ended: ${t}`)}catch(n){this.logger.warn(`Failed to end conversation (best effort): ${n instanceof Error?n.message:String(n)}`)}})}listConversations(t){return Be(this,null,function*(){var u,l,d;this.assertConnected();const n=new URLSearchParams;(t==null?void 0:t.inclClosedConvs)!=null&&n.set("inclClosedConvs",String(t.inclClosedConvs)),(t==null?void 0:t.limit)!=null&&n.set("limit",String(t.limit)),t!=null&&t.conversationId&&n.set("conversationId",t.conversationId),(t==null?void 0:t.startTimestamp)!=null&&n.set("startTimestamp",String(t.startTimestamp)),(t==null?void 0:t.endTimestamp)!=null&&n.set("endTimestamp",String(t.endTimestamp));const r=n.toString(),s="/iamessage/api/v2/conversation/list"+(r?`?${r}`:""),a=yield this.executeRequest("GET",s);return{conversations:(u=a.conversations)!=null?u:[],openConversationsFound:(l=a.openConversationsFound)!=null?l:0,closedConversationsFound:(d=a.closedConversationsFound)!=null?d:0}})}listConversationEntries(t,n){return Be(this,null,function*(){var u;this.assertConnected();const r=new URLSearchParams;(n==null?void 0:n.limit)!=null&&r.set("limit",String(n.limit)),(n==null?void 0:n.startTimestamp)!=null&&r.set("startTimestamp",String(n.startTimestamp)),(n==null?void 0:n.endTimestamp)!=null&&r.set("endTimestamp",String(n.endTimestamp)),n!=null&&n.direction&&r.set("direction",n.direction),n!=null&&n.entryTypeFilter&&n.entryTypeFilter.length>0&&r.set("entryTypeFilter",n.entryTypeFilter.join(","));const s=r.toString(),a=`/iamessage/api/v2/conversation/${t}/entries${s?`?${s}`:""}`;return{conversationEntries:(u=(yield this.executeRequest("GET",a)).conversationEntries)!=null?u:[]}})}retrieveConversationTranscript(t){return Be(this,null,function*(){this.assertConnected();const n=t!=null?t:this._conversationId;if(!n)throw new zr("No active conversation. Call createConversation() first or pass a conversationId.","unknown");const r=`/iamessage/api/v2/conversation/${n}/transcript?esDeveloperName=${encodeURIComponent(this.esDeveloperName)}`;return this.executeRequest("GET",r,void 0,{responseType:"blob"})})}resumeConversation(t){if(this.assertConnected(),!t)throw new zr("conversationId is required to resume a conversation.","unknown");this._conversationId=t,this.logger.info(`Conversation resumed: ${t}`)}generateContinuationToken(){return Be(this,null,function*(){this.assertConnected();const t=yield this.executeRequest("GET","/iamessage/api/v2/authorization/continuation-access-token");return this.logger.info("Continuation token generated"),t})}getAuthLinkKey(){return Be(this,null,function*(){this.assertConnected();const t=yield this.executeRequest("GET","/iamessage/api/v2/authorization/authlink");if(!t||!t.authLinkKey)throw new M0("Auth link response did not contain an authLinkKey",200,t);return this.logger.info("Auth link key retrieved"),t.authLinkKey})}openSSE(t){return Be(this,null,function*(){this.closeSSE();const n=`${this.baseURL}/eventrouter/v1/sse`,r={Authorization:`Bearer ${this._accessToken}`,"X-Org-Id":this.orgId};t&&(r["Last-Event-ID"]=t),this.sseReader=new PS(n,r,(s,a)=>this.handleSSEEvent(s,a),s=>this.handleSSEClose(s),this.logger),yield this.sseReader.connect(),this._isConnected=!0,this.emit("connected"),this.logger.info("SSE stream connected")})}closeSSE(){this.sseReader&&(this.sseReader.disconnect(),this.sseReader=null)}handleSSEClose(t){this._isConnected=!1,this.emit("disconnected",{reason:t}),this.intentionalDisconnect||this.attemptReconnect()}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts)return this.logger.error(`Max reconnect attempts (${this.maxReconnectAttempts}) reached.`),void this.emit("error",{code:"MAX_RECONNECT",message:`Failed to reconnect after ${this.maxReconnectAttempts} attempts`,recoverable:!1});this.reconnectAttempts++;const t=500*Math.random(),n=Math.min(this.reconnectDelay*Math.pow(2,this.reconnectAttempts-1)+t,3e4);this.logger.info(`Reconnecting in ${n.toFixed(0)}ms (attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts})...`),this.emit("reconnecting",{attempt:this.reconnectAttempts,maxAttempts:this.maxReconnectAttempts}),this.reconnectTimeout=setTimeout(()=>Be(this,null,function*(){try{if(this.intentionalDisconnect)return;if(!(this._accessToken&&Date.now()<this._tokenExpiresAt))return this.logger.error("Access token expired — session cannot be resumed"),this.emit("error",{code:"SESSION_EXPIRED",message:"Session expired. Call connect() to start a new session.",recoverable:!1}),void(this._conversationId=null);if(this.logger.info("Reusing existing access token for SSE reconnection"),this.intentionalDisconnect)return;yield this.openSSE(),this.reconnectAttempts=0,this.logger.info("Reconnected successfully")}catch(r){if(this.intentionalDisconnect)return;const s=r instanceof Error?r.message:String(r);if(s.includes("(401)"))return this.logger.error("SSE rejected token (401) — session expired"),this.emit("error",{code:"SESSION_EXPIRED",message:"Session expired. Call connect() to start a new session.",recoverable:!1}),void(this._conversationId=null);this.logger.error(`Reconnect attempt ${this.reconnectAttempts} failed: ${s}`),this.attemptReconnect()}}),n)}clearReconnectTimer(){this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null)}handleSSEEvent(t,n){if(t==="ping")return;let r;try{r=JSON.parse(n)}catch(s){return void this.logger.debug(`Non-JSON SSE event (${t}): ${n.slice(0,100)}`)}switch(t){case"CONVERSATION_ROUTING_RESULT":this.handleRoutingResult(r);break;case"CONVERSATION_MESSAGE":this.handleConversationMessage(r);break;case"CONVERSATION_STREAMING_TOKEN":this.handleStreamingToken(r);break;case"CONVERSATION_TYPING_STARTED_INDICATOR":this.handleTypingStarted(r);break;case"CONVERSATION_TYPING_STOPPED_INDICATOR":this.handleTypingStopped(r);break;case"CONVERSATION_PROGRESS_INDICATOR":this.handleProgressIndicator(r);break;case"CONVERSATION_PARTICIPANT_CHANGED":this.handleParticipantChanged(r);break;case"CONVERSATION_CLOSE_CONVERSATION":this.handleConversationClosed(r);break;default:this.logger.debug(`Unhandled SSE event type: ${t}`)}}handleRoutingResult(t){let n=t;t.conversationEntry&&(n=this.parseEntryPayload(t.conversationEntry));const r=n.failureType||n.routingFailureType||"",s=!r||r==="None"||r==="NO_ERROR";this.emit("routing_result",{conversationId:this._conversationId||"",isSuccessful:s,failureType:s?void 0:r,raw:n}),s||this.emit("error",{code:"ROUTING_FAILED",message:`Routing failed: ${r}`,recoverable:!1})}handleConversationMessage(t){var l;const n=t.conversationEntry;if(!n)return;const r=((l=n.sender)==null?void 0:l.role)||"";if(r==="EndUser"||r==="Customer")return;const s=this.parseEntryPayload(n),a=this.getNestedValue(s,"abstractMessage"),u=this.getNestedString(a,"staticContent","text")||this.getNestedString(a,"content","text")||"";u&&this.emit("message",{conversationId:this._conversationId||"",messageId:n.identifier||"",content:u,sender:{role:r,name:n.senderDisplayName},timestamp:n.transcriptedTimestamp||new Date().toISOString(),raw:s,messagingSessionId:this.extractMessagingSessionId(n)})}handleStreamingToken(t){let n,r,s,a="";if(t.conversationEntry){const u=this.parseEntryPayload(t.conversationEntry),l=this.getNestedValue(u,"streamingToken");a=this.getNestedString(l,"token","text")||this.getNestedString(l,"token","content")||"";const d=this.getNestedValue(l,"sequenceNumber");typeof d=="number"&&(n=d);const f=this.getNestedString(l,"targetMessageIdentifier");f&&(r=f);const m=this.getNestedString(l,"tokenType");m&&(s=m)}a||(a=t.token||t.text||""),a?this.emit("streaming_token",j(j(j({conversationId:this._conversationId||"",token:String(a)},n!==void 0?{sequenceNumber:n}:{}),r?{targetMessageId:r}:{}),s?{tokenType:s}:{})):this.logger.warn("STREAMING_TOKEN received but no token text could be extracted — payload shape may have changed")}handleTypingStarted(t){var n;this.emit("typing_started",{conversationId:this._conversationId||"",participant:(n=t.conversationEntry)!=null&&n.sender?{role:t.conversationEntry.sender.role||"",name:t.conversationEntry.senderDisplayName}:void 0})}handleTypingStopped(t){var n;this.emit("typing_stopped",{conversationId:this._conversationId||"",participant:(n=t.conversationEntry)!=null&&n.sender?{role:t.conversationEntry.sender.role||"",name:t.conversationEntry.senderDisplayName}:void 0})}handleProgressIndicator(t){const n=t.conversationEntry;if(!n)return;const r=this.parseEntryPayload(n),s=this.getNestedValue(r,"progressIndicator"),a=this.getNestedString(s,"progressMessage","text")||this.getNestedString(s,"progressMessage","content")||t.text||"";if(!a)return;const u=this.getNestedString(s,"indicatorType")||void 0;this.emit("progress_indicator",{conversationId:this._conversationId||"",message:String(a),indicatorType:u,raw:r})}handleParticipantChanged(t){var a,u,l,d,f;let n=t;t.conversationEntry&&(n=this.parseEntryPayload(t.conversationEntry));const r=n.entries,s=(a=t.conversationEntry)==null?void 0:a.identifier;if(r&&r.length>0)r.forEach((m,p)=>{var A,S,C;const b=m.participant,y=m.displayName||(b==null?void 0:b.displayName)||((A=t.conversationEntry)==null?void 0:A.senderDisplayName)||"Agent",_=(b==null?void 0:b.role)||((C=(S=t.conversationEntry)==null?void 0:S.sender)==null?void 0:C.role)||"",x=m.operation||m.event||"";this.emit("participant_changed",j({conversationId:this._conversationId||"",participant:{role:_,name:y},action:this.normalizeParticipantAction(x)},s?{entryId:r.length>1?`${s}:${p}`:s}:{}))});else{const m=((u=t.conversationEntry)==null?void 0:u.senderDisplayName)||n.participantName||((l=n.participant)==null?void 0:l.displayName)||"Agent",p=n.operation||n.event||"";this.emit("participant_changed",j({conversationId:this._conversationId||"",participant:{role:((f=(d=t.conversationEntry)==null?void 0:d.sender)==null?void 0:f.role)||"",name:m},action:this.normalizeParticipantAction(p)},s?{entryId:s}:{}))}}normalizeParticipantAction(t){const n=t.toLowerCase();return n&&n!=="add"&&n!=="join"&&n!=="joined"&&n!=="transfer"?n==="remove"||n==="left"||n==="leave"?"remove":t:"add"}handleConversationClosed(t){this.emit("conversation_closed",{conversationId:t.conversationId||this._conversationId||""}),this._conversationId=null}fetchAccessToken(){return Be(this,null,function*(){const t={orgId:this.orgId,esDeveloperName:this.esDeveloperName,capabilitiesVersion:this.capabilitiesVersion,platform:this.platform},n=yield this.executeRequest("POST","/iamessage/api/v2/authorization/unauthenticated/access-token",t,{useAuth:!1});if(!n.accessToken)throw new Dd("Token response missing accessToken field");return this._tokenExpiresAt=this.getTokenExpiry(n.accessToken),n.accessToken})}executeRequest(t,n,r,s){return Be(this,null,function*(){const a=(s==null?void 0:s.useAuth)!==!1;let u=0;for(;;){let l;try{const d=new AbortController;l=setTimeout(()=>d.abort(),(s==null?void 0:s.timeout)||this.timeout);const f=j({"Content-Type":"application/json"},s==null?void 0:s.headers);a&&this._accessToken&&(f.Authorization=`Bearer ${this._accessToken}`);const m={method:t,headers:f,signal:(s==null?void 0:s.signal)||d.signal};r&&t==="POST"&&(m.body=JSON.stringify(r));const p=yield fetch(`${this.baseURL}${n}`,m);if(clearTimeout(l),!p.ok){const b=yield p.text().catch(()=>p.statusText);if(p.status===401&&a&&u===0){if(this._usingContinuationToken)throw this.logger.warn("Got 401 with continuation token — cannot auto-refresh"),new Dd(`Request ${t} ${n} failed (401): continuation token expired or invalid. Reconnect without a continuation token to create a new session.`);if(this._conversationId)throw this.logger.warn("Got 401 with active conversation — cannot auto-refresh (would orphan conversation)"),new Dd(`Request ${t} ${n} failed (401): session expired. Call connect() to start a new session.`);this.logger.info("Got 401 — refreshing token and retrying..."),this._accessToken=yield this.fetchAccessToken(),u++;continue}throw new M0(`Request ${t} ${n} failed (${p.status}): ${b}`,p.status,b)}return p.status===204||t==="DELETE"?{}:(s==null?void 0:s.responseType)==="blob"?yield p.blob():p.text().then(b=>b?JSON.parse(b):null)}catch(d){if(clearTimeout(l),d instanceof zr)throw d;if(d instanceof DOMException&&d.name==="AbortError")throw new F0("Request timeout exceeded",u+1,{cause:d});if(d instanceof TypeError){if(u<this.maxRetries){u++;const f=100*Math.random(),m=300*Math.pow(2,u-1)+f;this.logger.info(`Network error, retrying (${u}/${this.maxRetries}) in ${m.toFixed(0)}ms...`),yield new Promise(p=>setTimeout(p,m));continue}throw new F0(`Network error: ${d.message}`,u,{cause:d})}throw new zr(`Unexpected error: ${d instanceof Error?d.message:String(d)}`,"unknown",{cause:d instanceof Error?d:void 0})}}})}assertConnected(){if(!this._isConnected||!this._accessToken)throw new zr("Client is not connected. Call connect() first.","unknown")}getTokenExpiry(t){var n;try{const r=t.split(".")[1];return 1e3*((n=JSON.parse(atob(r)).exp)!=null?n:0)}catch(r){return 0}}extractMessagingSessionId(t){var n;return(n=t.relatedRecords)==null?void 0:n.find(r=>r.startsWith(LS))}parseEntryPayload(t){if(!t.entryPayload)return{};if(typeof t.entryPayload=="string")try{return JSON.parse(t.entryPayload)}catch(n){return{}}return t.entryPayload}getNestedValue(t,...n){let r=t;for(const s of n){if(r==null||typeof r!="object")return;r=r[s]}return r}getNestedString(t,...n){const r=this.getNestedValue(t,...n);return typeof r=="string"?r:""}};const B0="onCimulateWidgetReady",N="cim-widget",Hn=`--${N}`,li={primaryColor:"#3182ce",secondaryColor:"#2c5282",fontColor:"#1a202c",fontFamily:"inherit",backgroundColor:"#ffffff",borderColor:"#dddddd",borderRadius:"0.25rem"},MS=(e=li)=>({[`${Hn}-primary-color`]:e.primaryColor||li.primaryColor,[`${Hn}-secondary-color`]:e.secondaryColor||li.secondaryColor,[`${Hn}-font-color`]:e.fontColor||li.fontColor,[`${Hn}-font-family`]:e.fontFamily||li.fontFamily,[`${Hn}-background-color`]:e.backgroundColor||li.backgroundColor,[`${Hn}-border-color`]:e.borderColor||li.borderColor,[`${Hn}-border-radius`]:e.borderRadius||li.borderRadius});class FS{constructor(){Qe(this,"initialState",{connected:!1,mode:"embedded",entryType:"search",status:{type:"dialog",isOpen:!1,isMinimized:!1},dialog:{position:"bottom-left",isFullHeight:!1,width:""},modal:{isFullscreen:!1}});Qe(this,"connectedProxy");Qe(this,"modeProxy");Qe(this,"entryTypeProxy");Qe(this,"statusProxy");Qe(this,"dialogProxy");Qe(this,"modalProxy",{isFullscreen:!1});Qe(this,"_fullGet",(t,n)=>Reflect.get(t,n));Qe(this,"_fullSet",(t,n,r)=>{if(!(n in t))throw new Error(`Property ${n} does not exist on UIState`);return $S(n,r),Reflect.set(t,n,r)});this.connectedProxy=new Proxy({connected:this.initialState.connected},{get:this._fullGet,set:this._fullSet}),this.modeProxy=new Proxy({mode:this.initialState.mode},{get:this._fullGet,set:this._fullSet}),this.entryTypeProxy=new Proxy({entryType:this.initialState.entryType},{get:this._fullGet,set:this._fullSet}),this.statusProxy=new Proxy({type:this.initialState.status.type,isOpen:this.initialState.status.isOpen,isMinimized:this.initialState.status.isMinimized},{get:this._fullGet,set:this._fullSet}),this.dialogProxy=new Proxy({position:this.initialState.dialog.position,isFullHeight:this.initialState.dialog.isFullHeight,width:this.initialState.dialog.width},{get:this._fullGet,set:this._fullSet}),this.modalProxy=new Proxy({isFullscreen:this.initialState.modal.isFullscreen},{get:this._fullGet,set:this._fullSet})}get connected(){return this.connectedProxy.connected}get mode(){return this.modeProxy.mode}get isOpen(){return!!this.statusProxy.isOpen}get isMinimized(){return!!this.statusProxy.isMinimized}get type(){return this.statusProxy.type}get entryType(){return this.entryTypeProxy.entryType}get position(){return this.dialogProxy.position}get state(){return{connected:this.connected,mode:this.mode,entryType:this.entryType,status:{type:this.type,isOpen:this.isOpen,isMinimized:this.isMinimized},dialog:{position:this.position,isFullHeight:this.dialogProxy.isFullHeight,width:this.dialogProxy.width},modal:{isFullscreen:this.modalProxy.isFullscreen}}}}const ct=new FS,Du="cimulate.widget.minimizedOnNav";function BS(){try{sessionStorage.setItem(Du,"1")}catch(e){return}}function US(){try{const e=sessionStorage.getItem(Du)==="1";return sessionStorage.removeItem(Du),e}catch(e){return!1}}function HS(){try{sessionStorage.removeItem(Du)}catch(e){return}}const jS=e=>{window.addEventListener(Rd,e)},zS=e=>{window.removeEventListener(Rd,e)},$S=(e,t)=>{const n=new CustomEvent(Rd,{detail:{property:e,value:t}});window.dispatchEvent(n)},U0=e=>{ct.connectedProxy.connected=e},H0=e=>{if(!L0(e)){const t=R0.map(r=>`'${r}'`),n=`${t.slice(0,-1).join(", ")}, or ${t[t.length-1]}`;throw new Error(`Invalid entryType: "${e}". Must be ${n}.`)}ct.entryTypeProxy.entryType=e},$r=e=>{const t=ct.statusProxy.isOpen,n=typeof e=="boolean"?e:!t;ct.statusProxy.isOpen=n,n&&(ct.statusProxy.isMinimized=!1,HS())},Ms=e=>{const t=ct.statusProxy.isMinimized,n=typeof e=="boolean"?e:!t;ct.statusProxy.isMinimized=n,n&&(ct.statusProxy.isOpen=!1)},Md=e=>{ct.modalProxy.isFullscreen=e},Mu=e=>{if(!["chat","dialog","modal"].includes(e))throw new Error(`Invalid type: ${e}. Must be 'chat', 'dialog', or 'modal'.`);ct.statusProxy.type=e,e==="dialog"||e==="chat"?ct.modeProxy.mode="embedded":ct.modeProxy.mode="standalone"},Fd=e=>{const t=["top","top-left","top-right","bottom","bottom-left","bottom-right","left","right","center"];if(!t.includes(e))throw new Error(`Invalid position: ${e}. Must be one of ${t.join(", ")}.`);ct.dialogProxy.position=e},VS=e=>{const t=ct.dialogProxy.isFullHeight,n=typeof e=="boolean"?e:!t;ct.dialogProxy.isFullHeight=n};function qS(){var e=R.useRef(!0);return e.current?(e.current=!1,!0):e.current}function YS(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function WS(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var Bd=typeof window!="undefined",Fu=function(e){R.useEffect(e,[])},GS=function(e){var t=R.useRef(e);t.current=e,Fu(function(){return function(){return t.current()}})},XS=function(e){var t=R.useRef(0),n=R.useState(e),r=n[0],s=n[1],a=R.useCallback(function(u){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){s(u)})},[]);return GS(function(){cancelAnimationFrame(t.current)}),[r,a]},KS=function(e,t){return e===t};function QS(e,t){t===void 0&&(t=KS);var n=R.useRef(),r=R.useRef(e),s=qS();return!s&&!t(r.current,e)&&(n.current=r.current,r.current=e),n.current}var JS=function(e){var t={},n=t.initialWidth,r=n===void 0?1/0:n,s=t.initialHeight,a=s===void 0?1/0:s,u=t.onChange,l=XS({width:Bd?window.innerWidth:r,height:Bd?window.innerHeight:a}),d=l[0],f=l[1];return R.useEffect(function(){if(Bd){var m=function(){var p=window.innerWidth,b=window.innerHeight;f({width:p,height:b}),u&&u(p,b)};return YS(window,"resize",m),function(){WS(window,"resize",m)}}},[]),d};const j0=R.createContext({mode:ct.modeProxy.mode,entryType:ct.entryType,status:ct.statusProxy,dialogPosition:ct.dialogProxy.position,isDialogFullHeight:ct.dialogProxy.isFullHeight,dialogWidth:ct.dialogProxy.width,isModalFullscreen:ct.modalProxy.isFullscreen,previousComponentType:ct.statusProxy.type}),ZS=({entryType:e,componentConfig:t,componentType:n,children:r})=>{const[s,a]=R.useState(e!=null?e:ct.entryTypeProxy.entryType),[u,l]=R.useState(ct.modeProxy.mode),[d,f]=R.useState({type:n||ct.statusProxy.type,isOpen:t&&"isOpen"in t?!!t.isOpen:ct.statusProxy.isOpen,isMinimized:t&&"isMinimized"in t?!!t.isMinimized:ct.statusProxy.isMinimized}),[m,p]=R.useState(ct.dialogProxy.position),[b,y]=R.useState(ct.dialogProxy.isFullHeight),[_,x]=R.useState(ct.dialogProxy.width),[A,S]=R.useState(ct.modalProxy.isFullscreen),C=R.useRef(!1),O=QS(d.type);R.useEffect(()=>{const G=D=>{const{property:V,value:J}=D.detail||{};if(!(!V||J===void 0)){if(V==="mode"){l(J);return}if(V==="entryType"){a(J);return}if(V==="isMinimized"){f(se=>ce(j({},se),{isMinimized:J}));return}if(V==="isOpen"){f(se=>ce(j({},se),{isOpen:J}));return}if(V==="type"){f(se=>ce(j({},se),{type:J}));return}if(V==="position"){p(J);return}if(V==="isFullHeight"){y(J);return}if(V==="width"){x(J);return}if(V==="isFullscreen"){S(J);return}}};return jS(G),()=>{zS(G)}},[]),Fu(()=>{e&&H0(e)}),Fu(()=>{if(C.current)return;C.current=!0;const G=n||(t==null?void 0:t.type);G&&Mu(G);const D=US();t&&"isOpen"in t&&$r(!!t.isOpen),t&&"isMinimized"in t&&Ms(!!t.isMinimized),D&&Ms(!0)}),Fu(()=>{if(!(t!=null&&t.options))return;const{dialogPosition:G}=t.options;G&&Fd(G),"dialogFullHeight"in t.options&&VS(!!t.options.dialogFullHeight),"dialogWidth"in t.options&&t.options.dialogWidth&&x(t.options.dialogWidth),"isModalFullscreen"in t.options&&Md(!!t.options.isModalFullscreen)});const z=R.useMemo(()=>({mode:u,entryType:s,status:d,previousComponentType:O||"dialog",dialogPosition:m,isDialogFullHeight:b,dialogWidth:_,isModalFullscreen:A}),[u,s,d,O,m,b,_,A]);return w.jsx(j0.Provider,{value:z,children:r})},Vr=()=>{const e=R.useContext(j0);if(!e)throw new Error("useUIState must be used within a UIStateProvider");return e},bt={SET_PROMPTS_EXTENSION_INITIALIZED:"SET_PROMPTS_EXTENSION_INITIALIZED",SET_PROMPTS_EXTENSION_OPEN:"SET_PROMPTS_EXTENSION_OPEN",SET_PROMPTS_EXTENSION_INLINE:"SET_PROMPTS_EXTENSION_INLINE",SET_PROMPTS_EXTENSION_ELEMENT_ID:"SET_PROMPTS_EXTENSION_ELEMENT_ID",SET_PROMPTS_EXTENSION_ENTRY_TYPE:"SET_PROMPTS_EXTENSION_ENTRY_TYPE",SET_PROMPTS_EXTENSION_PARAMS:"SET_PROMPTS_EXTENSION_PARAMS",RESET_PROMPTS_EXTENSION_PARAMS:"RESET_PROMPTS_EXTENSION_PARAMS",SET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID:"SET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID",RESET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID:"RESET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID",SET_PROMPTS_EXTENSION_USER_PROMPT:"SET_PROMPTS_EXTENSION_USER_PROMPT",SET_PROMPTS_EXTENSION_PROMPTS_MESSAGE:"SET_PROMPTS_EXTENSION_PROMPTS_MESSAGE",RESET_PROMPTS_EXTENSION_PROMPTS_MESSAGE:"RESET_PROMPTS_EXTENSION_PROMPTS_MESSAGE",SET_PROMPTS_EXTENSION_RESPONSE_MESSAGE:"SET_PROMPTS_EXTENSION_RESPONSE_MESSAGE",RESET_PROMPTS_EXTENSION_RESPONSE_MESSAGE:"RESET_PROMPTS_EXTENSION_RESPONSE_MESSAGE",SET_PROMPTS_EXTENSION_RESPONSE_LOADING:"SET_PROMPTS_EXTENSION_RESPONSE_LOADING"},z0={isInitialized:!1,isOpen:!1,isInline:!1,elementId:null,placeholder:null,askElseButtonLabel:null,entryType:null,params:null,activePromptsId:null,userPrompt:null,promptsMessage:null,isResponseLoading:!1,responseMessage:null,promptsDisplay:"both",staticQuestions:[],staticQuestionsStrategy:"append",disableAskElseButton:!1};function $0(e,t){return function(){return e.apply(t,arguments)}}const{toString:ev}=Object.prototype,{getPrototypeOf:Fs}=Object,{iterator:Qo,toStringTag:V0}=Symbol,Bu=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Jo=(e,t)=>{let n=e;const r=[];for(;n!=null&&n!==Object.prototype;){if(r.indexOf(n)!==-1)return!1;if(r.push(n),Bu(n,t))return!0;n=Fs(n)}return!1},tv=(e,t)=>e!=null&&Jo(e,t)?e[t]:void 0,Ud=(e=>t=>{const n=ev.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ar=e=>(e=e.toLowerCase(),t=>Ud(t)===e),Uu=e=>t=>typeof t===e,{isArray:Vi}=Array,Bs=Uu("undefined");function Us(e){return e!==null&&!Bs(e)&&e.constructor!==null&&!Bs(e.constructor)&&An(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const q0=ar("ArrayBuffer");function nv(e){let t;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&q0(e.buffer),t}const rv=Uu("string"),An=Uu("function"),Y0=Uu("number"),Hs=e=>e!==null&&typeof e=="object",iv=e=>e===!0||e===!1,Hu=e=>{if(!Hs(e))return!1;const t=Fs(e);return(t===null||t===Object.prototype||Fs(t)===null)&&!Jo(e,V0)&&!Jo(e,Qo)},sv=e=>{if(!Hs(e)||Us(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},ov=ar("Date"),av=ar("File"),uv=e=>!!(e&&typeof e.uri!="undefined"),lv=e=>e&&typeof e.getParts!="undefined",cv=ar("Blob"),dv=ar("FileList"),fv=e=>Hs(e)&&An(e.pipe);function hv(){return typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{}}const W0=hv(),G0=typeof W0.FormData!="undefined"?W0.FormData:void 0,pv=e=>{if(!e)return!1;if(G0&&e instanceof G0)return!0;const t=Fs(e);if(!t||t===Object.prototype||!An(e.append))return!1;const n=Ud(e);return n==="formdata"||n==="object"&&An(e.toString)&&e.toString()==="[object FormData]"},mv=ar("URLSearchParams"),[gv,Ev,yv,Tv]=["ReadableStream","Request","Response","Headers"].map(ar),bv=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Zo(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e=="undefined")return;let r,s;if(typeof e!="object"&&(e=[e]),Vi(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Us(e))return;const a=n?Object.getOwnPropertyNames(e):Object.keys(e),u=a.length;let l;for(r=0;r<u;r++)l=a[r],t.call(null,e[l],l,e)}}function X0(e,t){if(Us(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const qi=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,K0=e=>!Bs(e)&&e!==qi;function Hd(...e){const{caseless:t,skipUndefined:n}=K0(this)&&this||{},r={},s=(a,u)=>{if(u==="__proto__"||u==="constructor"||u==="prototype")return;const l=t&&typeof u=="string"&&X0(r,u)||u,d=Bu(r,l)?r[l]:void 0;Hu(d)&&Hu(a)?r[l]=Hd(d,a):Hu(a)?r[l]=Hd({},a):Vi(a)?r[l]=a.slice():(!n||!Bs(a))&&(r[l]=a)};for(let a=0,u=e.length;a<u;a++){const l=e[a];if(!l||Us(l)||(Zo(l,s),typeof l!="object"||Vi(l)))continue;const d=Object.getOwnPropertySymbols(l);for(let f=0;f<d.length;f++){const m=d[f];Pv.call(l,m)&&s(l[m],m)}}return r}const wv=(e,t,n,{allOwnKeys:r}={})=>(Zo(t,(s,a)=>{n&&An(s)?Object.defineProperty(e,a,{__proto__:null,value:$0(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,a,{__proto__:null,value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),_v=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),xv=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},Sv=(e,t,n,r)=>{let s,a,u;const l={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),a=s.length;a-- >0;)u=s[a],(!r||r(u,e,t))&&!l[u]&&(t[u]=e[u],l[u]=!0);e=n!==!1&&Fs(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},vv=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Av=e=>{if(!e)return null;if(Vi(e))return e;let t=e.length;if(!Y0(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},kv=(e=>t=>e&&t instanceof e)(typeof Uint8Array!="undefined"&&Fs(Uint8Array)),Cv=(e,t)=>{const r=(e&&e[Qo]).call(e);let s;for(;(s=r.next())&&!s.done;){const a=s.value;t.call(e,a[0],a[1])}},Nv=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Ov=ar("HTMLFormElement"),Iv=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),{propertyIsEnumerable:Pv}=Object.prototype,Rv=ar("RegExp"),Q0=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Zo(n,(s,a)=>{let u;(u=t(s,a,e))!==!1&&(r[a]=u||s)}),Object.defineProperties(e,r)},Lv=e=>{Q0(e,(t,n)=>{if(An(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];if(An(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Dv=(e,t)=>{const n={},r=s=>{s.forEach(a=>{n[a]=!0})};return Vi(e)?r(e):r(String(e).split(t)),n},Mv=()=>{},Fv=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Bv(e){return!!(e&&An(e.append)&&e[V0]==="FormData"&&e[Qo])}const Uv=e=>{const t=new WeakSet,n=r=>{if(Hs(r)){if(t.has(r))return;if(Us(r))return r;if(!("toJSON"in r)){t.add(r);const s=Vi(r)?[]:{};return Zo(r,(a,u)=>{const l=n(a);!Bs(l)&&(s[u]=l)}),t.delete(r),s}}return r};return n(e)},Hv=ar("AsyncFunction"),jv=e=>e&&(Hs(e)||An(e))&&An(e.then)&&An(e.catch),J0=((e,t)=>e?setImmediate:t?((n,r)=>(qi.addEventListener("message",({source:s,data:a})=>{s===qi&&a===n&&r.length&&r.shift()()},!1),s=>{r.push(s),qi.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",An(qi.postMessage)),zv=typeof queueMicrotask!="undefined"?queueMicrotask.bind(qi):typeof process!="undefined"&&process.nextTick||J0,Z0=e=>e!=null&&An(e[Qo]),Y={isArray:Vi,isArrayBuffer:q0,isBuffer:Us,isFormData:pv,isArrayBufferView:nv,isString:rv,isNumber:Y0,isBoolean:iv,isObject:Hs,isPlainObject:Hu,isEmptyObject:sv,isReadableStream:gv,isRequest:Ev,isResponse:yv,isHeaders:Tv,isUndefined:Bs,isDate:ov,isFile:av,isReactNativeBlob:uv,isReactNative:lv,isBlob:cv,isRegExp:Rv,isFunction:An,isStream:fv,isURLSearchParams:mv,isTypedArray:kv,isFileList:dv,forEach:Zo,merge:Hd,extend:wv,trim:bv,stripBOM:_v,inherits:xv,toFlatObject:Sv,kindOf:Ud,kindOfTest:ar,endsWith:vv,toArray:Av,forEachEntry:Cv,matchAll:Nv,isHTMLForm:Ov,hasOwnProperty:Bu,hasOwnProp:Bu,hasOwnInPrototypeChain:Jo,getSafeProp:tv,reduceDescriptors:Q0,freezeMethods:Lv,toObjectSet:Dv,toCamelCase:Iv,noop:Mv,toFiniteNumber:Fv,findKey:X0,global:qi,isContextDefined:K0,isSpecCompliantForm:Bv,toJSONObject:Uv,isAsyncFn:Hv,isThenable:jv,setImmediate:J0,asap:zv,isIterable:Z0,isSafeIterable:e=>e!=null&&Jo(e,Qo)&&Z0(e)},$v=Y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Vv=e=>{const t={};let n,r,s;return e&&e.split(`
8
+ `);this.logger.debug(`SSE event: ${n}`,s.slice(0,200)),this.onEvent(n,s)}}class zr extends Error{constructor(t,n="unknown",r){super(t,r),this.name="AgentforceClientError",this.type=n}}let M0=class extends zr{constructor(t,n,r,s){super(t,"api",s),this.name="AgentforceApiError",this.statusCode=n,this.responseBody=r}};class F0 extends zr{constructor(t,n=1,r){super(t,"network",r),this.name="AgentforceNetworkError",this.attemptsMade=n}}let Dd=class extends zr{constructor(t,n){super(t,"auth",n),this.name="AgentforceAuthError"}};class RS{constructor(t){this.prefix="[Agentforce]",this.enabled=t}info(t,...n){this.enabled&&console.log(`${this.prefix} ${t}`,...n)}warn(t,...n){this.enabled&&console.warn(`${this.prefix} ${t}`,...n)}error(t,...n){this.enabled&&console.error(`${this.prefix} ${t}`,...n)}debug(t,...n){this.enabled&&console.debug(`${this.prefix} ${t}`,...n)}}const LS="0Mw";let DS=class extends IS{constructor({baseURL:t,orgId:n,esDeveloperName:r,options:s={}}){var u,l,d,f,m,p,b;super(),this._accessToken=null,this._tokenExpiresAt=0,this._conversationId=null,this._isConnected=!1,this._usingContinuationToken=!1,this.sseReader=null,this.reconnectAttempts=0,this.reconnectTimeout=null,this.intentionalDisconnect=!1,this.baseURL=t.replace(/\/+$/,""),this.orgId=n,this.esDeveloperName=r;const a={maxRetries:(u=s.maxRetries)!=null?u:3,timeout:(l=s.timeout)!=null?l:15e3,maxReconnectAttempts:(d=s.maxReconnectAttempts)!=null?d:5,reconnectDelay:(f=s.reconnectDelay)!=null?f:2e3,enableLogging:(m=s.enableLogging)!=null?m:!1,platform:(p=s.platform)!=null?p:"Web",capabilitiesVersion:(b=s.capabilitiesVersion)!=null?b:"1"};this.maxRetries=a.maxRetries,this.timeout=a.timeout,this.maxReconnectAttempts=a.maxReconnectAttempts,this.reconnectDelay=a.reconnectDelay,this.platform=a.platform,this.capabilitiesVersion=a.capabilitiesVersion,this.logger=new RS(a.enableLogging),this.logger.info(`Client initialized for ${this.baseURL}`)}get isConnected(){return this._isConnected}get conversationId(){return this._conversationId}get accessToken(){return this._accessToken}connect(t){return Be(this,null,function*(){this.intentionalDisconnect=!1,this.reconnectAttempts=0,this.logger.info("Connecting..."),t!=null&&t.continuationToken?(this._accessToken=t.continuationToken,this._tokenExpiresAt=this.getTokenExpiry(t.continuationToken),this._usingContinuationToken=!0,this.logger.info("Using continuation token")):(this._accessToken=yield this.fetchAccessToken(),this._usingContinuationToken=!1,this.logger.info("Access token acquired")),yield this.openSSE(t==null?void 0:t.lastEventId)})}disconnect(){this.intentionalDisconnect=!0,this.clearReconnectTimer(),this.closeSSE(),this._isConnected=!1,this.logger.info("Disconnected")}reconnect(){this._isConnected||(this.intentionalDisconnect=!1,this.reconnectAttempts=0,this.attemptReconnect())}createConversation(t){return Be(this,null,function*(){this.assertConnected();const n=crypto.randomUUID(),r={conversationId:n,esDeveloperName:this.esDeveloperName,routingAttributes:t!=null?t:{}};return yield this.executeRequest("POST","/iamessage/api/v2/conversation",r),this._conversationId=n,this.logger.info(`Conversation created: ${n}`),n})}sendMessage(t){return Be(this,null,function*(){if(this.assertConnected(),!this._conversationId)throw new zr("No active conversation. Call createConversation() first.","unknown");const n=crypto.randomUUID(),r={message:{id:n,messageType:"StaticContentMessage",staticContent:{formatType:"Text",text:t}},esDeveloperName:this.esDeveloperName};yield this.executeRequest("POST",`/iamessage/api/v2/conversation/${this._conversationId}/message`,r),this.logger.debug(`Message sent: ${n}`)})}endConversation(){return Be(this,null,function*(){if(!this._conversationId||!this._accessToken)return;const t=this._conversationId;this._conversationId=null;try{yield this.executeRequest("DELETE",`/iamessage/api/v2/conversation/${t}?esDeveloperName=${encodeURIComponent(this.esDeveloperName)}`),this.logger.info(`Conversation ended: ${t}`)}catch(n){this.logger.warn(`Failed to end conversation (best effort): ${n instanceof Error?n.message:String(n)}`)}})}listConversations(t){return Be(this,null,function*(){var u,l,d;this.assertConnected();const n=new URLSearchParams;(t==null?void 0:t.inclClosedConvs)!=null&&n.set("inclClosedConvs",String(t.inclClosedConvs)),(t==null?void 0:t.limit)!=null&&n.set("limit",String(t.limit)),t!=null&&t.conversationId&&n.set("conversationId",t.conversationId),(t==null?void 0:t.startTimestamp)!=null&&n.set("startTimestamp",String(t.startTimestamp)),(t==null?void 0:t.endTimestamp)!=null&&n.set("endTimestamp",String(t.endTimestamp));const r=n.toString(),s="/iamessage/api/v2/conversation/list"+(r?`?${r}`:""),a=yield this.executeRequest("GET",s);return{conversations:(u=a.conversations)!=null?u:[],openConversationsFound:(l=a.openConversationsFound)!=null?l:0,closedConversationsFound:(d=a.closedConversationsFound)!=null?d:0}})}listConversationEntries(t,n){return Be(this,null,function*(){var u;this.assertConnected();const r=new URLSearchParams;(n==null?void 0:n.limit)!=null&&r.set("limit",String(n.limit)),(n==null?void 0:n.startTimestamp)!=null&&r.set("startTimestamp",String(n.startTimestamp)),(n==null?void 0:n.endTimestamp)!=null&&r.set("endTimestamp",String(n.endTimestamp)),n!=null&&n.direction&&r.set("direction",n.direction),n!=null&&n.entryTypeFilter&&n.entryTypeFilter.length>0&&r.set("entryTypeFilter",n.entryTypeFilter.join(","));const s=r.toString(),a=`/iamessage/api/v2/conversation/${t}/entries${s?`?${s}`:""}`;return{conversationEntries:(u=(yield this.executeRequest("GET",a)).conversationEntries)!=null?u:[]}})}retrieveConversationTranscript(t){return Be(this,null,function*(){this.assertConnected();const n=t!=null?t:this._conversationId;if(!n)throw new zr("No active conversation. Call createConversation() first or pass a conversationId.","unknown");const r=`/iamessage/api/v2/conversation/${n}/transcript?esDeveloperName=${encodeURIComponent(this.esDeveloperName)}`;return this.executeRequest("GET",r,void 0,{responseType:"blob"})})}resumeConversation(t){if(this.assertConnected(),!t)throw new zr("conversationId is required to resume a conversation.","unknown");this._conversationId=t,this.logger.info(`Conversation resumed: ${t}`)}generateContinuationToken(){return Be(this,null,function*(){this.assertConnected();const t=yield this.executeRequest("GET","/iamessage/api/v2/authorization/continuation-access-token");return this.logger.info("Continuation token generated"),t})}getAuthLinkKey(){return Be(this,null,function*(){this.assertConnected();const t=yield this.executeRequest("GET","/iamessage/api/v2/authorization/authlink");if(!t||!t.authLinkKey)throw new M0("Auth link response did not contain an authLinkKey",200,t);return this.logger.info("Auth link key retrieved"),t.authLinkKey})}openSSE(t){return Be(this,null,function*(){this.closeSSE();const n=`${this.baseURL}/eventrouter/v1/sse`,r={Authorization:`Bearer ${this._accessToken}`,"X-Org-Id":this.orgId};t&&(r["Last-Event-ID"]=t),this.sseReader=new PS(n,r,(s,a)=>this.handleSSEEvent(s,a),s=>this.handleSSEClose(s),this.logger),yield this.sseReader.connect(),this._isConnected=!0,this.emit("connected"),this.logger.info("SSE stream connected")})}closeSSE(){this.sseReader&&(this.sseReader.disconnect(),this.sseReader=null)}handleSSEClose(t){this._isConnected=!1,this.emit("disconnected",{reason:t}),this.intentionalDisconnect||this.attemptReconnect()}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts)return this.logger.error(`Max reconnect attempts (${this.maxReconnectAttempts}) reached.`),void this.emit("error",{code:"MAX_RECONNECT",message:`Failed to reconnect after ${this.maxReconnectAttempts} attempts`,recoverable:!1});this.reconnectAttempts++;const t=500*Math.random(),n=Math.min(this.reconnectDelay*Math.pow(2,this.reconnectAttempts-1)+t,3e4);this.logger.info(`Reconnecting in ${n.toFixed(0)}ms (attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts})...`),this.emit("reconnecting",{attempt:this.reconnectAttempts,maxAttempts:this.maxReconnectAttempts}),this.reconnectTimeout=setTimeout(()=>Be(this,null,function*(){try{if(this.intentionalDisconnect)return;if(!(this._accessToken&&Date.now()<this._tokenExpiresAt))return this.logger.error("Access token expired — session cannot be resumed"),this.emit("error",{code:"SESSION_EXPIRED",message:"Session expired. Call connect() to start a new session.",recoverable:!1}),void(this._conversationId=null);if(this.logger.info("Reusing existing access token for SSE reconnection"),this.intentionalDisconnect)return;yield this.openSSE(),this.reconnectAttempts=0,this.logger.info("Reconnected successfully")}catch(r){if(this.intentionalDisconnect)return;const s=r instanceof Error?r.message:String(r);if(s.includes("(401)"))return this.logger.error("SSE rejected token (401) — session expired"),this.emit("error",{code:"SESSION_EXPIRED",message:"Session expired. Call connect() to start a new session.",recoverable:!1}),void(this._conversationId=null);this.logger.error(`Reconnect attempt ${this.reconnectAttempts} failed: ${s}`),this.attemptReconnect()}}),n)}clearReconnectTimer(){this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null)}handleSSEEvent(t,n){if(t==="ping")return;let r;try{r=JSON.parse(n)}catch(s){return void this.logger.debug(`Non-JSON SSE event (${t}): ${n.slice(0,100)}`)}switch(t){case"CONVERSATION_ROUTING_RESULT":this.handleRoutingResult(r);break;case"CONVERSATION_MESSAGE":this.handleConversationMessage(r);break;case"CONVERSATION_STREAMING_TOKEN":this.handleStreamingToken(r);break;case"CONVERSATION_TYPING_STARTED_INDICATOR":this.handleTypingStarted(r);break;case"CONVERSATION_TYPING_STOPPED_INDICATOR":this.handleTypingStopped(r);break;case"CONVERSATION_PROGRESS_INDICATOR":this.handleProgressIndicator(r);break;case"CONVERSATION_PARTICIPANT_CHANGED":this.handleParticipantChanged(r);break;case"CONVERSATION_CLOSE_CONVERSATION":this.handleConversationClosed(r);break;default:this.logger.debug(`Unhandled SSE event type: ${t}`)}}handleRoutingResult(t){let n=t;t.conversationEntry&&(n=this.parseEntryPayload(t.conversationEntry));const r=n.failureType||n.routingFailureType||"",s=!r||r==="None"||r==="NO_ERROR";this.emit("routing_result",{conversationId:this._conversationId||"",isSuccessful:s,failureType:s?void 0:r,raw:n}),s||this.emit("error",{code:"ROUTING_FAILED",message:`Routing failed: ${r}`,recoverable:!1})}handleConversationMessage(t){var l;const n=t.conversationEntry;if(!n)return;const r=((l=n.sender)==null?void 0:l.role)||"";if(r==="EndUser"||r==="Customer")return;const s=this.parseEntryPayload(n),a=this.getNestedValue(s,"abstractMessage"),u=this.getNestedString(a,"staticContent","text")||this.getNestedString(a,"content","text")||"";u&&this.emit("message",{conversationId:this._conversationId||"",messageId:n.identifier||"",content:u,sender:{role:r,name:n.senderDisplayName},timestamp:n.transcriptedTimestamp||new Date().toISOString(),raw:s,messagingSessionId:this.extractMessagingSessionId(n)})}handleStreamingToken(t){let n,r,s,a="";if(t.conversationEntry){const u=this.parseEntryPayload(t.conversationEntry),l=this.getNestedValue(u,"streamingToken");a=this.getNestedString(l,"token","text")||this.getNestedString(l,"token","content")||"";const d=this.getNestedValue(l,"sequenceNumber");typeof d=="number"&&(n=d);const f=this.getNestedString(l,"targetMessageIdentifier");f&&(r=f);const m=this.getNestedString(l,"tokenType");m&&(s=m)}a||(a=t.token||t.text||""),a?this.emit("streaming_token",j(j(j({conversationId:this._conversationId||"",token:String(a)},n!==void 0?{sequenceNumber:n}:{}),r?{targetMessageId:r}:{}),s?{tokenType:s}:{})):this.logger.warn("STREAMING_TOKEN received but no token text could be extracted — payload shape may have changed")}handleTypingStarted(t){var n;this.emit("typing_started",{conversationId:this._conversationId||"",participant:(n=t.conversationEntry)!=null&&n.sender?{role:t.conversationEntry.sender.role||"",name:t.conversationEntry.senderDisplayName}:void 0})}handleTypingStopped(t){var n;this.emit("typing_stopped",{conversationId:this._conversationId||"",participant:(n=t.conversationEntry)!=null&&n.sender?{role:t.conversationEntry.sender.role||"",name:t.conversationEntry.senderDisplayName}:void 0})}handleProgressIndicator(t){const n=t.conversationEntry;if(!n)return;const r=this.parseEntryPayload(n),s=this.getNestedValue(r,"progressIndicator"),a=this.getNestedString(s,"progressMessage","text")||this.getNestedString(s,"progressMessage","content")||t.text||"";if(!a)return;const u=this.getNestedString(s,"indicatorType")||void 0;this.emit("progress_indicator",{conversationId:this._conversationId||"",message:String(a),indicatorType:u,raw:r})}handleParticipantChanged(t){var a,u,l,d,f;let n=t;t.conversationEntry&&(n=this.parseEntryPayload(t.conversationEntry));const r=n.entries,s=(a=t.conversationEntry)==null?void 0:a.identifier;if(r&&r.length>0)r.forEach((m,p)=>{var A,S,C;const b=m.participant,y=m.displayName||(b==null?void 0:b.displayName)||((A=t.conversationEntry)==null?void 0:A.senderDisplayName)||"Agent",_=(b==null?void 0:b.role)||((C=(S=t.conversationEntry)==null?void 0:S.sender)==null?void 0:C.role)||"",x=m.operation||m.event||"";this.emit("participant_changed",j({conversationId:this._conversationId||"",participant:{role:_,name:y},action:this.normalizeParticipantAction(x)},s?{entryId:r.length>1?`${s}:${p}`:s}:{}))});else{const m=((u=t.conversationEntry)==null?void 0:u.senderDisplayName)||n.participantName||((l=n.participant)==null?void 0:l.displayName)||"Agent",p=n.operation||n.event||"";this.emit("participant_changed",j({conversationId:this._conversationId||"",participant:{role:((f=(d=t.conversationEntry)==null?void 0:d.sender)==null?void 0:f.role)||"",name:m},action:this.normalizeParticipantAction(p)},s?{entryId:s}:{}))}}normalizeParticipantAction(t){const n=t.toLowerCase();return n&&n!=="add"&&n!=="join"&&n!=="joined"&&n!=="transfer"?n==="remove"||n==="left"||n==="leave"?"remove":t:"add"}handleConversationClosed(t){this.emit("conversation_closed",{conversationId:t.conversationId||this._conversationId||""}),this._conversationId=null}fetchAccessToken(){return Be(this,null,function*(){const t={orgId:this.orgId,esDeveloperName:this.esDeveloperName,capabilitiesVersion:this.capabilitiesVersion,platform:this.platform},n=yield this.executeRequest("POST","/iamessage/api/v2/authorization/unauthenticated/access-token",t,{useAuth:!1});if(!n.accessToken)throw new Dd("Token response missing accessToken field");return this._tokenExpiresAt=this.getTokenExpiry(n.accessToken),n.accessToken})}executeRequest(t,n,r,s){return Be(this,null,function*(){const a=(s==null?void 0:s.useAuth)!==!1;let u=0;for(;;){let l;try{const d=new AbortController;l=setTimeout(()=>d.abort(),(s==null?void 0:s.timeout)||this.timeout);const f=j({"Content-Type":"application/json"},s==null?void 0:s.headers);a&&this._accessToken&&(f.Authorization=`Bearer ${this._accessToken}`);const m={method:t,headers:f,signal:(s==null?void 0:s.signal)||d.signal};r&&t==="POST"&&(m.body=JSON.stringify(r));const p=yield fetch(`${this.baseURL}${n}`,m);if(clearTimeout(l),!p.ok){const b=yield p.text().catch(()=>p.statusText);if(p.status===401&&a&&u===0){if(this._usingContinuationToken)throw this.logger.warn("Got 401 with continuation token — cannot auto-refresh"),new Dd(`Request ${t} ${n} failed (401): continuation token expired or invalid. Reconnect without a continuation token to create a new session.`);if(this._conversationId)throw this.logger.warn("Got 401 with active conversation — cannot auto-refresh (would orphan conversation)"),new Dd(`Request ${t} ${n} failed (401): session expired. Call connect() to start a new session.`);this.logger.info("Got 401 — refreshing token and retrying..."),this._accessToken=yield this.fetchAccessToken(),u++;continue}throw new M0(`Request ${t} ${n} failed (${p.status}): ${b}`,p.status,b)}return p.status===204||t==="DELETE"?{}:(s==null?void 0:s.responseType)==="blob"?yield p.blob():p.text().then(b=>b?JSON.parse(b):null)}catch(d){if(clearTimeout(l),d instanceof zr)throw d;if(d instanceof DOMException&&d.name==="AbortError")throw new F0("Request timeout exceeded",u+1,{cause:d});if(d instanceof TypeError){if(u<this.maxRetries){u++;const f=100*Math.random(),m=300*Math.pow(2,u-1)+f;this.logger.info(`Network error, retrying (${u}/${this.maxRetries}) in ${m.toFixed(0)}ms...`),yield new Promise(p=>setTimeout(p,m));continue}throw new F0(`Network error: ${d.message}`,u,{cause:d})}throw new zr(`Unexpected error: ${d instanceof Error?d.message:String(d)}`,"unknown",{cause:d instanceof Error?d:void 0})}}})}assertConnected(){if(!this._isConnected||!this._accessToken)throw new zr("Client is not connected. Call connect() first.","unknown")}getTokenExpiry(t){var n;try{const r=t.split(".")[1];return 1e3*((n=JSON.parse(atob(r)).exp)!=null?n:0)}catch(r){return 0}}extractMessagingSessionId(t){var n;return(n=t.relatedRecords)==null?void 0:n.find(r=>r.startsWith(LS))}parseEntryPayload(t){if(!t.entryPayload)return{};if(typeof t.entryPayload=="string")try{return JSON.parse(t.entryPayload)}catch(n){return{}}return t.entryPayload}getNestedValue(t,...n){let r=t;for(const s of n){if(r==null||typeof r!="object")return;r=r[s]}return r}getNestedString(t,...n){const r=this.getNestedValue(t,...n);return typeof r=="string"?r:""}};const B0="onCimulateWidgetReady",N="cim-widget",Hn=`--${N}`,li={primaryColor:"#3182ce",secondaryColor:"#2c5282",fontColor:"#1a202c",fontFamily:"inherit",backgroundColor:"#ffffff",borderColor:"#dddddd",borderRadius:"0.25rem"},MS=(e=li)=>({[`${Hn}-primary-color`]:e.primaryColor||li.primaryColor,[`${Hn}-secondary-color`]:e.secondaryColor||li.secondaryColor,[`${Hn}-font-color`]:e.fontColor||li.fontColor,[`${Hn}-font-family`]:e.fontFamily||li.fontFamily,[`${Hn}-background-color`]:e.backgroundColor||li.backgroundColor,[`${Hn}-border-color`]:e.borderColor||li.borderColor,[`${Hn}-border-radius`]:e.borderRadius||li.borderRadius});class FS{constructor(){Qe(this,"initialState",{connected:!1,mode:"embedded",entryType:"search",status:{type:"dialog",isOpen:!1,isMinimized:!1},dialog:{position:"bottom-left",isFullHeight:!1,width:""},modal:{isFullscreen:!1}});Qe(this,"connectedProxy");Qe(this,"modeProxy");Qe(this,"entryTypeProxy");Qe(this,"statusProxy");Qe(this,"dialogProxy");Qe(this,"modalProxy",{isFullscreen:!1});Qe(this,"_fullGet",(t,n)=>Reflect.get(t,n));Qe(this,"_fullSet",(t,n,r)=>{if(!(n in t))throw new Error(`Property ${n} does not exist on UIState`);return $S(n,r),Reflect.set(t,n,r)});this.connectedProxy=new Proxy({connected:this.initialState.connected},{get:this._fullGet,set:this._fullSet}),this.modeProxy=new Proxy({mode:this.initialState.mode},{get:this._fullGet,set:this._fullSet}),this.entryTypeProxy=new Proxy({entryType:this.initialState.entryType},{get:this._fullGet,set:this._fullSet}),this.statusProxy=new Proxy({type:this.initialState.status.type,isOpen:this.initialState.status.isOpen,isMinimized:this.initialState.status.isMinimized},{get:this._fullGet,set:this._fullSet}),this.dialogProxy=new Proxy({position:this.initialState.dialog.position,isFullHeight:this.initialState.dialog.isFullHeight,width:this.initialState.dialog.width},{get:this._fullGet,set:this._fullSet}),this.modalProxy=new Proxy({isFullscreen:this.initialState.modal.isFullscreen},{get:this._fullGet,set:this._fullSet})}get connected(){return this.connectedProxy.connected}get mode(){return this.modeProxy.mode}get isOpen(){return!!this.statusProxy.isOpen}get isMinimized(){return!!this.statusProxy.isMinimized}get type(){return this.statusProxy.type}get entryType(){return this.entryTypeProxy.entryType}get position(){return this.dialogProxy.position}get state(){return{connected:this.connected,mode:this.mode,entryType:this.entryType,status:{type:this.type,isOpen:this.isOpen,isMinimized:this.isMinimized},dialog:{position:this.position,isFullHeight:this.dialogProxy.isFullHeight,width:this.dialogProxy.width},modal:{isFullscreen:this.modalProxy.isFullscreen}}}}const ct=new FS,Du="cimulate.widget.minimizedOnNav";function BS(){try{sessionStorage.setItem(Du,"1")}catch(e){return}}function US(){try{const e=sessionStorage.getItem(Du)==="1";return sessionStorage.removeItem(Du),e}catch(e){return!1}}function HS(){try{sessionStorage.removeItem(Du)}catch(e){return}}const jS=e=>{window.addEventListener(Rd,e)},zS=e=>{window.removeEventListener(Rd,e)},$S=(e,t)=>{const n=new CustomEvent(Rd,{detail:{property:e,value:t}});window.dispatchEvent(n)},U0=e=>{ct.connectedProxy.connected=e},H0=e=>{if(!L0(e)){const t=R0.map(r=>`'${r}'`),n=`${t.slice(0,-1).join(", ")}, or ${t[t.length-1]}`;throw new Error(`Invalid entryType: "${e}". Must be ${n}.`)}ct.entryTypeProxy.entryType=e},$r=e=>{const t=ct.statusProxy.isOpen,n=typeof e=="boolean"?e:!t;ct.statusProxy.isOpen=n,n&&(ct.statusProxy.isMinimized=!1,HS())},Ms=e=>{const t=ct.statusProxy.isMinimized,n=typeof e=="boolean"?e:!t;ct.statusProxy.isMinimized=n,n&&(ct.statusProxy.isOpen=!1)},Md=e=>{ct.modalProxy.isFullscreen=e},Mu=e=>{if(!["chat","dialog","modal"].includes(e))throw new Error(`Invalid type: ${e}. Must be 'chat', 'dialog', or 'modal'.`);ct.statusProxy.type=e,e==="dialog"||e==="chat"?ct.modeProxy.mode="embedded":ct.modeProxy.mode="standalone"},Fd=e=>{const t=["top","top-left","top-right","bottom","bottom-left","bottom-right","left","right","center"];if(!t.includes(e))throw new Error(`Invalid position: ${e}. Must be one of ${t.join(", ")}.`);ct.dialogProxy.position=e},VS=e=>{const t=ct.dialogProxy.isFullHeight,n=typeof e=="boolean"?e:!t;ct.dialogProxy.isFullHeight=n};function qS(){var e=R.useRef(!0);return e.current?(e.current=!1,!0):e.current}function YS(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function WS(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var Bd=typeof window!="undefined",Fu=function(e){R.useEffect(e,[])},GS=function(e){var t=R.useRef(e);t.current=e,Fu(function(){return function(){return t.current()}})},XS=function(e){var t=R.useRef(0),n=R.useState(e),r=n[0],s=n[1],a=R.useCallback(function(u){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){s(u)})},[]);return GS(function(){cancelAnimationFrame(t.current)}),[r,a]},KS=function(e,t){return e===t};function QS(e,t){t===void 0&&(t=KS);var n=R.useRef(),r=R.useRef(e),s=qS();return!s&&!t(r.current,e)&&(n.current=r.current,r.current=e),n.current}var JS=function(e){var t={},n=t.initialWidth,r=n===void 0?1/0:n,s=t.initialHeight,a=s===void 0?1/0:s,u=t.onChange,l=XS({width:Bd?window.innerWidth:r,height:Bd?window.innerHeight:a}),d=l[0],f=l[1];return R.useEffect(function(){if(Bd){var m=function(){var p=window.innerWidth,b=window.innerHeight;f({width:p,height:b}),u&&u(p,b)};return YS(window,"resize",m),function(){WS(window,"resize",m)}}},[]),d};const j0=R.createContext({mode:ct.modeProxy.mode,entryType:ct.entryType,status:ct.statusProxy,dialogPosition:ct.dialogProxy.position,isDialogFullHeight:ct.dialogProxy.isFullHeight,dialogWidth:ct.dialogProxy.width,isModalFullscreen:ct.modalProxy.isFullscreen,previousComponentType:ct.statusProxy.type}),ZS=({entryType:e,componentConfig:t,componentType:n,children:r})=>{const[s,a]=R.useState(e!=null?e:ct.entryTypeProxy.entryType),[u,l]=R.useState(ct.modeProxy.mode),[d,f]=R.useState({type:n||ct.statusProxy.type,isOpen:t&&"isOpen"in t?!!t.isOpen:ct.statusProxy.isOpen,isMinimized:t&&"isMinimized"in t?!!t.isMinimized:ct.statusProxy.isMinimized}),[m,p]=R.useState(ct.dialogProxy.position),[b,y]=R.useState(ct.dialogProxy.isFullHeight),[_,x]=R.useState(ct.dialogProxy.width),[A,S]=R.useState(ct.modalProxy.isFullscreen),C=R.useRef(!1),O=QS(d.type);R.useEffect(()=>{const G=M=>{const{property:V,value:J}=M.detail||{};if(!(!V||J===void 0)){if(V==="mode"){l(J);return}if(V==="entryType"){a(J);return}if(V==="isMinimized"){f(se=>ce(j({},se),{isMinimized:J}));return}if(V==="isOpen"){f(se=>ce(j({},se),{isOpen:J}));return}if(V==="type"){f(se=>ce(j({},se),{type:J}));return}if(V==="position"){p(J);return}if(V==="isFullHeight"){y(J);return}if(V==="width"){x(J);return}if(V==="isFullscreen"){S(J);return}}};return jS(G),()=>{zS(G)}},[]),Fu(()=>{e&&H0(e)}),Fu(()=>{if(C.current)return;C.current=!0;const G=n||(t==null?void 0:t.type);G&&Mu(G);const M=US();t&&"isOpen"in t&&$r(!!t.isOpen),t&&"isMinimized"in t&&Ms(!!t.isMinimized),M&&Ms(!0)}),Fu(()=>{if(!(t!=null&&t.options))return;const{dialogPosition:G}=t.options;G&&Fd(G),"dialogFullHeight"in t.options&&VS(!!t.options.dialogFullHeight),"dialogWidth"in t.options&&t.options.dialogWidth&&x(t.options.dialogWidth),"isModalFullscreen"in t.options&&Md(!!t.options.isModalFullscreen)});const z=R.useMemo(()=>({mode:u,entryType:s,status:d,previousComponentType:O||"dialog",dialogPosition:m,isDialogFullHeight:b,dialogWidth:_,isModalFullscreen:A}),[u,s,d,O,m,b,_,A]);return w.jsx(j0.Provider,{value:z,children:r})},Vr=()=>{const e=R.useContext(j0);if(!e)throw new Error("useUIState must be used within a UIStateProvider");return e},bt={SET_PROMPTS_EXTENSION_INITIALIZED:"SET_PROMPTS_EXTENSION_INITIALIZED",SET_PROMPTS_EXTENSION_OPEN:"SET_PROMPTS_EXTENSION_OPEN",SET_PROMPTS_EXTENSION_INLINE:"SET_PROMPTS_EXTENSION_INLINE",SET_PROMPTS_EXTENSION_ELEMENT_ID:"SET_PROMPTS_EXTENSION_ELEMENT_ID",SET_PROMPTS_EXTENSION_ENTRY_TYPE:"SET_PROMPTS_EXTENSION_ENTRY_TYPE",SET_PROMPTS_EXTENSION_PARAMS:"SET_PROMPTS_EXTENSION_PARAMS",RESET_PROMPTS_EXTENSION_PARAMS:"RESET_PROMPTS_EXTENSION_PARAMS",SET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID:"SET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID",RESET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID:"RESET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID",SET_PROMPTS_EXTENSION_USER_PROMPT:"SET_PROMPTS_EXTENSION_USER_PROMPT",SET_PROMPTS_EXTENSION_PROMPTS_MESSAGE:"SET_PROMPTS_EXTENSION_PROMPTS_MESSAGE",RESET_PROMPTS_EXTENSION_PROMPTS_MESSAGE:"RESET_PROMPTS_EXTENSION_PROMPTS_MESSAGE",SET_PROMPTS_EXTENSION_RESPONSE_MESSAGE:"SET_PROMPTS_EXTENSION_RESPONSE_MESSAGE",RESET_PROMPTS_EXTENSION_RESPONSE_MESSAGE:"RESET_PROMPTS_EXTENSION_RESPONSE_MESSAGE",SET_PROMPTS_EXTENSION_RESPONSE_LOADING:"SET_PROMPTS_EXTENSION_RESPONSE_LOADING"},z0={isInitialized:!1,isOpen:!1,isInline:!1,elementId:null,placeholder:null,askElseButtonLabel:null,entryType:null,params:null,activePromptsId:null,userPrompt:null,promptsMessage:null,isResponseLoading:!1,responseMessage:null,promptsDisplay:"both",staticQuestions:[],staticQuestionsStrategy:"append",disableAskElseButton:!1};function $0(e,t){return function(){return e.apply(t,arguments)}}const{toString:ev}=Object.prototype,{getPrototypeOf:Fs}=Object,{iterator:Qo,toStringTag:V0}=Symbol,Bu=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Jo=(e,t)=>{let n=e;const r=[];for(;n!=null&&n!==Object.prototype;){if(r.indexOf(n)!==-1)return!1;if(r.push(n),Bu(n,t))return!0;n=Fs(n)}return!1},tv=(e,t)=>e!=null&&Jo(e,t)?e[t]:void 0,Ud=(e=>t=>{const n=ev.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ar=e=>(e=e.toLowerCase(),t=>Ud(t)===e),Uu=e=>t=>typeof t===e,{isArray:Vi}=Array,Bs=Uu("undefined");function Us(e){return e!==null&&!Bs(e)&&e.constructor!==null&&!Bs(e.constructor)&&An(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const q0=ar("ArrayBuffer");function nv(e){let t;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&q0(e.buffer),t}const rv=Uu("string"),An=Uu("function"),Y0=Uu("number"),Hs=e=>e!==null&&typeof e=="object",iv=e=>e===!0||e===!1,Hu=e=>{if(!Hs(e))return!1;const t=Fs(e);return(t===null||t===Object.prototype||Fs(t)===null)&&!Jo(e,V0)&&!Jo(e,Qo)},sv=e=>{if(!Hs(e)||Us(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},ov=ar("Date"),av=ar("File"),uv=e=>!!(e&&typeof e.uri!="undefined"),lv=e=>e&&typeof e.getParts!="undefined",cv=ar("Blob"),dv=ar("FileList"),fv=e=>Hs(e)&&An(e.pipe);function hv(){return typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{}}const W0=hv(),G0=typeof W0.FormData!="undefined"?W0.FormData:void 0,pv=e=>{if(!e)return!1;if(G0&&e instanceof G0)return!0;const t=Fs(e);if(!t||t===Object.prototype||!An(e.append))return!1;const n=Ud(e);return n==="formdata"||n==="object"&&An(e.toString)&&e.toString()==="[object FormData]"},mv=ar("URLSearchParams"),[gv,Ev,yv,Tv]=["ReadableStream","Request","Response","Headers"].map(ar),bv=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Zo(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e=="undefined")return;let r,s;if(typeof e!="object"&&(e=[e]),Vi(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Us(e))return;const a=n?Object.getOwnPropertyNames(e):Object.keys(e),u=a.length;let l;for(r=0;r<u;r++)l=a[r],t.call(null,e[l],l,e)}}function X0(e,t){if(Us(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const qi=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,K0=e=>!Bs(e)&&e!==qi;function Hd(...e){const{caseless:t,skipUndefined:n}=K0(this)&&this||{},r={},s=(a,u)=>{if(u==="__proto__"||u==="constructor"||u==="prototype")return;const l=t&&typeof u=="string"&&X0(r,u)||u,d=Bu(r,l)?r[l]:void 0;Hu(d)&&Hu(a)?r[l]=Hd(d,a):Hu(a)?r[l]=Hd({},a):Vi(a)?r[l]=a.slice():(!n||!Bs(a))&&(r[l]=a)};for(let a=0,u=e.length;a<u;a++){const l=e[a];if(!l||Us(l)||(Zo(l,s),typeof l!="object"||Vi(l)))continue;const d=Object.getOwnPropertySymbols(l);for(let f=0;f<d.length;f++){const m=d[f];Pv.call(l,m)&&s(l[m],m)}}return r}const wv=(e,t,n,{allOwnKeys:r}={})=>(Zo(t,(s,a)=>{n&&An(s)?Object.defineProperty(e,a,{__proto__:null,value:$0(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,a,{__proto__:null,value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),_v=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),xv=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},Sv=(e,t,n,r)=>{let s,a,u;const l={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),a=s.length;a-- >0;)u=s[a],(!r||r(u,e,t))&&!l[u]&&(t[u]=e[u],l[u]=!0);e=n!==!1&&Fs(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},vv=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Av=e=>{if(!e)return null;if(Vi(e))return e;let t=e.length;if(!Y0(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},kv=(e=>t=>e&&t instanceof e)(typeof Uint8Array!="undefined"&&Fs(Uint8Array)),Cv=(e,t)=>{const r=(e&&e[Qo]).call(e);let s;for(;(s=r.next())&&!s.done;){const a=s.value;t.call(e,a[0],a[1])}},Nv=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Ov=ar("HTMLFormElement"),Iv=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),{propertyIsEnumerable:Pv}=Object.prototype,Rv=ar("RegExp"),Q0=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Zo(n,(s,a)=>{let u;(u=t(s,a,e))!==!1&&(r[a]=u||s)}),Object.defineProperties(e,r)},Lv=e=>{Q0(e,(t,n)=>{if(An(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];if(An(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Dv=(e,t)=>{const n={},r=s=>{s.forEach(a=>{n[a]=!0})};return Vi(e)?r(e):r(String(e).split(t)),n},Mv=()=>{},Fv=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Bv(e){return!!(e&&An(e.append)&&e[V0]==="FormData"&&e[Qo])}const Uv=e=>{const t=new WeakSet,n=r=>{if(Hs(r)){if(t.has(r))return;if(Us(r))return r;if(!("toJSON"in r)){t.add(r);const s=Vi(r)?[]:{};return Zo(r,(a,u)=>{const l=n(a);!Bs(l)&&(s[u]=l)}),t.delete(r),s}}return r};return n(e)},Hv=ar("AsyncFunction"),jv=e=>e&&(Hs(e)||An(e))&&An(e.then)&&An(e.catch),J0=((e,t)=>e?setImmediate:t?((n,r)=>(qi.addEventListener("message",({source:s,data:a})=>{s===qi&&a===n&&r.length&&r.shift()()},!1),s=>{r.push(s),qi.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",An(qi.postMessage)),zv=typeof queueMicrotask!="undefined"?queueMicrotask.bind(qi):typeof process!="undefined"&&process.nextTick||J0,Z0=e=>e!=null&&An(e[Qo]),Y={isArray:Vi,isArrayBuffer:q0,isBuffer:Us,isFormData:pv,isArrayBufferView:nv,isString:rv,isNumber:Y0,isBoolean:iv,isObject:Hs,isPlainObject:Hu,isEmptyObject:sv,isReadableStream:gv,isRequest:Ev,isResponse:yv,isHeaders:Tv,isUndefined:Bs,isDate:ov,isFile:av,isReactNativeBlob:uv,isReactNative:lv,isBlob:cv,isRegExp:Rv,isFunction:An,isStream:fv,isURLSearchParams:mv,isTypedArray:kv,isFileList:dv,forEach:Zo,merge:Hd,extend:wv,trim:bv,stripBOM:_v,inherits:xv,toFlatObject:Sv,kindOf:Ud,kindOfTest:ar,endsWith:vv,toArray:Av,forEachEntry:Cv,matchAll:Nv,isHTMLForm:Ov,hasOwnProperty:Bu,hasOwnProp:Bu,hasOwnInPrototypeChain:Jo,getSafeProp:tv,reduceDescriptors:Q0,freezeMethods:Lv,toObjectSet:Dv,toCamelCase:Iv,noop:Mv,toFiniteNumber:Fv,findKey:X0,global:qi,isContextDefined:K0,isSpecCompliantForm:Bv,toJSONObject:Uv,isAsyncFn:Hv,isThenable:jv,setImmediate:J0,asap:zv,isIterable:Z0,isSafeIterable:e=>e!=null&&Jo(e,Qo)&&Z0(e)},$v=Y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Vv=e=>{const t={};let n,r,s;return e&&e.split(`
9
9
  `).forEach(function(u){s=u.indexOf(":"),n=u.substring(0,s).trim().toLowerCase(),r=u.substring(s+1).trim(),!(!n||t[n]&&$v[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t};function qv(e){let t=0,n=e.length;for(;t<n;){const r=e.charCodeAt(t);if(r!==9&&r!==32)break;t+=1}for(;n>t;){const r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}const Yv=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Wv=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function jd(e,t){return Y.isArray(e)?e.map(n=>jd(n,t)):qv(String(e).replace(t,""))}const Gv=e=>jd(e,Yv),Xv=e=>jd(e,Wv);function eg(e){const t=Object.create(null);return Y.forEach(e.toJSON(),(n,r)=>{t[r]=Xv(n)}),t}const tg=Symbol("internals");function ea(e){return e&&String(e).trim().toLowerCase()}function ju(e){return e===!1||e==null?e:Y.isArray(e)?e.map(ju):Gv(String(e))}function Kv(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Qv=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function zd(e,t,n,r,s){if(Y.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!Y.isString(t)){if(Y.isString(r))return t.indexOf(r)!==-1;if(Y.isRegExp(r))return r.test(t)}}function Jv(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Zv(e,t){const n=Y.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(s,a,u){return this[r].call(this,t,s,a,u)},configurable:!0})})}let un=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function a(l,d,f){const m=ea(d);if(!m)return;const p=Y.findKey(s,m);(!p||s[p]===void 0||f===!0||f===void 0&&s[p]!==!1)&&(s[p||d]=ju(l))}const u=(l,d)=>Y.forEach(l,(f,m)=>a(f,m,d));if(Y.isPlainObject(t)||t instanceof this.constructor)u(t,n);else if(Y.isString(t)&&(t=t.trim())&&!Qv(t))u(Vv(t),n);else if(Y.isObject(t)&&Y.isSafeIterable(t)){let l=Object.create(null),d,f;for(const m of t){if(!Y.isArray(m))throw new TypeError("Object iterator must return a key-value pair");f=m[0],Y.hasOwnProp(l,f)?(d=l[f],l[f]=Y.isArray(d)?[...d,m[1]]:[d,m[1]]):l[f]=m[1]}u(l,n)}else t!=null&&a(n,t,r);return this}get(t,n){if(t=ea(t),t){const r=Y.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Kv(s);if(Y.isFunction(n))return n.call(this,s,r);if(Y.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=ea(t),t){const r=Y.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||zd(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function a(u){if(u=ea(u),u){const l=Y.findKey(r,u);l&&(!n||zd(r,r[l],l,n))&&(delete r[l],s=!0)}}return Y.isArray(t)?t.forEach(a):a(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const a=n[r];(!t||zd(this,this[a],a,t,!0))&&(delete this[a],s=!0)}return s}normalize(t){const n=this,r={};return Y.forEach(this,(s,a)=>{const u=Y.findKey(r,a);if(u){n[u]=ju(s),delete n[a];return}const l=t?Jv(a):String(a).trim();l!==a&&delete n[a],n[l]=ju(s),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Y.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&Y.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
10
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[tg]=this[tg]={accessors:{}}).accessors,s=this.prototype;function a(u){const l=ea(u);r[l]||(Zv(s,u),r[l]=!0)}return Y.isArray(t)?t.forEach(a):a(t),this}};un.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Y.reduceDescriptors(un.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),Y.freezeMethods(un);const eA="[REDACTED ****]";function tA(e){if(Y.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Y.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function nA(e,t){const n=new Set(t.map(a=>String(a).toLowerCase())),r=[],s=a=>{if(a===null||typeof a!="object"||Y.isBuffer(a))return a;if(r.indexOf(a)!==-1)return;a instanceof un&&(a=a.toJSON()),r.push(a);let u;if(Y.isArray(a))u=[],a.forEach((l,d)=>{const f=s(l);Y.isUndefined(f)||(u[d]=f)});else{if(!Y.isPlainObject(a)&&tA(a))return r.pop(),a;u=Object.create(null);for(const[l,d]of Object.entries(a)){const f=n.has(l.toLowerCase())?eA:s(d);Y.isUndefined(f)||(u[l]=f)}}return r.pop(),u};return s(e)}let Oe=class N2 extends Error{static from(t,n,r,s,a,u){const l=new N2(t.message,n||t.code,r,s,a);return Object.defineProperty(l,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),l.name=t.name,t.status!=null&&l.status==null&&(l.status=t.status),u&&Object.assign(l,u),l}constructor(t,n,r,s,a){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),s&&(this.request=s),a&&(this.response=a,this.status=a.status)}toJSON(){const t=this.config,n=t&&Y.hasOwnProp(t,"redact")?t.redact:void 0,r=Y.isArray(n)&&n.length>0?nA(t,n):Y.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};Oe.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Oe.ERR_BAD_OPTION="ERR_BAD_OPTION",Oe.ECONNABORTED="ECONNABORTED",Oe.ETIMEDOUT="ETIMEDOUT",Oe.ECONNREFUSED="ECONNREFUSED",Oe.ERR_NETWORK="ERR_NETWORK",Oe.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Oe.ERR_DEPRECATED="ERR_DEPRECATED",Oe.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Oe.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Oe.ERR_CANCELED="ERR_CANCELED",Oe.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Oe.ERR_INVALID_URL="ERR_INVALID_URL",Oe.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const rA=null,ng=100;function $d(e){return Y.isPlainObject(e)||Y.isArray(e)}function rg(e){return Y.endsWith(e,"[]")?e.slice(0,-2):e}function Vd(e,t,n){return e?e.concat(t).map(function(s,a){return s=rg(s),!n&&a?"["+s+"]":s}).join(n?".":""):t}function iA(e){return Y.isArray(e)&&!e.some($d)}const sA=Y.toFlatObject(Y,{},null,function(t){return/^is[A-Z]/.test(t)});function zu(e,t,n){if(!Y.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Y.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,O){return!Y.isUndefined(O[C])});const r=n.metaTokens,s=n.visitor||_,a=n.dots,u=n.indexes,l=n.Blob||typeof Blob!="undefined"&&Blob,d=n.maxDepth===void 0?ng:n.maxDepth,f=l&&Y.isSpecCompliantForm(t),m=[];if(!Y.isFunction(s))throw new TypeError("visitor must be a function");function p(S){if(S===null)return"";if(Y.isDate(S))return S.toISOString();if(Y.isBoolean(S))return S.toString();if(!f&&Y.isBlob(S))throw new Oe("Blob is not supported. Use a Buffer instead.");if(Y.isArrayBuffer(S)||Y.isTypedArray(S)){if(f&&typeof l=="function")return new l([S]);if(typeof Buffer!="undefined")return Buffer.from(S);throw new Oe("Blob is not supported. Use a Buffer instead.",Oe.ERR_NOT_SUPPORT)}return S}function b(S){if(S>d)throw new Oe("Object is too deeply nested ("+S+" levels). Max depth: "+d,Oe.ERR_FORM_DATA_DEPTH_EXCEEDED)}function y(S,C){if(d===1/0)return JSON.stringify(S);const O=[];return JSON.stringify(S,function(G,D){if(!Y.isObject(D))return D;for(;O.length&&O[O.length-1]!==this;)O.pop();return O.push(D),b(C+O.length-1),D})}function _(S,C,O){let z=S;if(Y.isReactNative(t)&&Y.isReactNativeBlob(S))return t.append(Vd(O,C,a),p(S)),!1;if(S&&!O&&typeof S=="object"){if(Y.endsWith(C,"{}"))C=r?C:C.slice(0,-2),S=y(S,1);else if(Y.isArray(S)&&iA(S)||(Y.isFileList(S)||Y.endsWith(C,"[]"))&&(z=Y.toArray(S)))return C=rg(C),z.forEach(function(D,V){!(Y.isUndefined(D)||D===null)&&t.append(u===!0?Vd([C],V,a):u===null?C:C+"[]",p(D))}),!1}return $d(S)?!0:(t.append(Vd(O,C,a),p(S)),!1)}const x=Object.assign(sA,{defaultVisitor:_,convertValue:p,isVisitable:$d});function A(S,C,O=0){if(!Y.isUndefined(S)){if(b(O),m.indexOf(S)!==-1)throw new Error("Circular reference detected in "+C.join("."));m.push(S),Y.forEach(S,function(G,D){(!(Y.isUndefined(G)||G===null)&&s.call(t,G,Y.isString(D)?D.trim():D,C,x))===!0&&A(G,C?C.concat(D):[D],O+1)}),m.pop()}}if(!Y.isObject(e))throw new TypeError("data must be an object");return A(e),t}function ig(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(r){return t[r]})}function qd(e,t){this._pairs=[],e&&zu(e,this,t)}const sg=qd.prototype;sg.append=function(t,n){this._pairs.push([t,n])},sg.toString=function(t){const n=t?r=>t.call(this,r,ig):ig;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function oA(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function og(e,t,n){if(!t)return e;e=e||"";const r=Y.isFunction(n)?{serialize:n}:n,s=Y.getSafeProp(r,"encode")||oA,a=Y.getSafeProp(r,"serialize");let u;if(a?u=a(t,r):u=Y.isURLSearchParams(t)?t.toString():new qd(t,r).toString(s),u){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+u}return e}class ag{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Y.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Yd={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},aA={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams!="undefined"?URLSearchParams:qd,FormData:typeof FormData!="undefined"?FormData:null,Blob:typeof Blob!="undefined"?Blob:null},protocols:["http","https","file","blob","url","data"]},Wd=typeof window!="undefined"&&typeof document!="undefined",Gd=typeof navigator=="object"&&navigator||void 0,uA=Wd&&(!Gd||["ReactNative","NativeScript","NS"].indexOf(Gd.product)<0),lA=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",cA=Wd&&window.location.href||"http://localhost",sn=j(j({},Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Wd,hasStandardBrowserEnv:uA,hasStandardBrowserWebWorkerEnv:lA,navigator:Gd,origin:cA},Symbol.toStringTag,{value:"Module"}))),aA);function dA(e,t){return zu(e,new sn.classes.URLSearchParams,j({visitor:function(n,r,s,a){return sn.isNode&&Y.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}const ug=ng;function lg(e){if(e>ug)throw new Oe("FormData field is too deeply nested ("+e+" levels). Max depth: "+ug,Oe.ERR_FORM_DATA_DEPTH_EXCEEDED)}function fA(e){const t=[],n=/\w+|\[(\w*)]/g;let r;for(;(r=n.exec(e))!==null;)lg(t.length),t.push(r[0]==="[]"?"":r[1]||r[0]);return t}function hA(e){const t={},n=Object.keys(e);let r;const s=n.length;let a;for(r=0;r<s;r++)a=n[r],t[a]=e[a];return t}function cg(e){function t(n,r,s,a){lg(a);let u=n[a++];if(u==="__proto__")return!0;const l=Number.isFinite(+u),d=a>=n.length;return u=!u&&Y.isArray(s)?s.length:u,d?(Y.hasOwnProp(s,u)?s[u]=Y.isArray(s[u])?s[u].concat(r):[s[u],r]:s[u]=r,!l):((!Y.hasOwnProp(s,u)||!Y.isObject(s[u]))&&(s[u]=[]),t(n,r,s[u],a)&&Y.isArray(s[u])&&(s[u]=hA(s[u])),!l)}if(Y.isFormData(e)&&Y.isFunction(e.entries)){const n={};return Y.forEachEntry(e,(r,s)=>{t(fA(r),s,n,0)}),n}return null}const js=(e,t)=>e!=null&&Y.hasOwnProp(e,t)?e[t]:void 0;function pA(e,t,n){if(Y.isString(e))try{return(t||JSON.parse)(e),Y.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ta={transitional:Yd,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,a=Y.isObject(t);if(a&&Y.isHTMLForm(t)&&(t=new FormData(t)),Y.isFormData(t))return s?JSON.stringify(cg(t)):t;if(Y.isArrayBuffer(t)||Y.isBuffer(t)||Y.isStream(t)||Y.isFile(t)||Y.isBlob(t)||Y.isReadableStream(t))return t;if(Y.isArrayBufferView(t))return t.buffer;if(Y.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(a){const d=js(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return dA(t,d).toString();if((l=Y.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=js(this,"env"),m=f&&f.FormData;return zu(l?{"files[]":t}:t,m&&new m,d)}}return a||s?(n.setContentType("application/json",!1),pA(t)):t}],transformResponse:[function(t){const n=js(this,"transitional")||ta.transitional,r=n&&n.forcedJSONParsing,s=js(this,"responseType"),a=s==="json";if(Y.isResponse(t)||Y.isReadableStream(t))return t;if(t&&Y.isString(t)&&(r&&!s||a)){const l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t,js(this,"parseReviver"))}catch(d){if(l)throw d.name==="SyntaxError"?Oe.from(d,Oe.ERR_BAD_RESPONSE,this,null,js(this,"response")):d}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:sn.classes.FormData,Blob:sn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Y.forEach(["delete","get","head","post","put","patch","query"],e=>{ta.headers[e]={}});function Xd(e,t){const n=this||ta,r=t||n,s=un.from(r.headers);let a=r.data;return Y.forEach(e,function(l){a=l.call(n,a,s.normalize(),t?t.status:void 0)}),s.normalize(),a}function dg(e){return!!(e&&e.__CANCEL__)}let na=class extends Oe{constructor(t,n,r){super(t==null?"canceled":t,Oe.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function fg(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Oe("Request failed with status code "+n.status,n.status>=400&&n.status<500?Oe.ERR_BAD_REQUEST:Oe.ERR_BAD_RESPONSE,n.config,n.request,n))}function mA(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function gA(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,a=0,u;return t=t!==void 0?t:1e3,function(d){const f=Date.now(),m=r[a];u||(u=f),n[s]=d,r[s]=f;let p=a,b=0;for(;p!==s;)b+=n[p++],p=p%e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),f-u<t)return;const y=m&&f-m;return y?Math.round(b*1e3/y):void 0}}function EA(e,t){let n=0,r=1e3/t,s,a;const u=(f,m=Date.now())=>{n=m,s=null,a&&(clearTimeout(a),a=null),e(...f)};return[(...f)=>{const m=Date.now(),p=m-n;p>=r?u(f,m):(s=f,a||(a=setTimeout(()=>{a=null,u(s)},r-p)))},()=>s&&u(s)]}const $u=(e,t,n=3)=>{let r=0;const s=gA(50,250);return EA(a=>{if(!a||typeof a.loaded!="number")return;const u=a.loaded,l=a.lengthComputable?a.total:void 0,d=l!=null?Math.min(u,l):u,f=Math.max(0,d-r),m=s(f);r=Math.max(r,d);const p={loaded:d,total:l,progress:l?d/l:void 0,bytes:f,rate:m||void 0,estimated:m&&l?(l-d)/m:void 0,event:a,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},n)},hg=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},pg=e=>(...t)=>Y.asap(()=>e(...t)),yA=sn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,sn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(sn.origin),sn.navigator&&/(msie|trident)/i.test(sn.navigator.userAgent)):()=>!0,TA=sn.hasStandardBrowserEnv?{write(e,t,n,r,s,a,u){if(typeof document=="undefined")return;const l=[`${e}=${encodeURIComponent(t)}`];Y.isNumber(n)&&l.push(`expires=${new Date(n).toUTCString()}`),Y.isString(r)&&l.push(`path=${r}`),Y.isString(s)&&l.push(`domain=${s}`),a===!0&&l.push("secure"),Y.isString(u)&&l.push(`SameSite=${u}`),document.cookie=l.join("; ")},read(e){if(typeof document=="undefined")return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const r=t[n].replace(/^\s+/,""),s=r.indexOf("=");if(s!==-1&&r.slice(0,s)===e)try{return decodeURIComponent(r.slice(s+1))}catch(a){return r.slice(s+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function bA(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function wA(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const _A=/^https?:(?!\/\/)/i,xA=/[\t\n\r]/g;function SA(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function vA(e){return SA(e).replace(xA,"")}function mg(e,t){if(typeof e=="string"&&_A.test(vA(e)))throw new Oe('Invalid URL: missing "//" after protocol',Oe.ERR_INVALID_URL,t)}function gg(e,t,n,r){mg(t,r);let s=!bA(t);return e&&(s||n===!1)?(mg(e,r),wA(e,t)):t}const Eg=e=>e instanceof un?j({},e):e;function Yi(e,t){e=e||{},t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(m,p,b,y){return Y.isPlainObject(m)&&Y.isPlainObject(p)?Y.merge.call({caseless:y},m,p):Y.isPlainObject(p)?Y.merge({},p):Y.isArray(p)?p.slice():p}function s(m,p,b,y){if(Y.isUndefined(p)){if(!Y.isUndefined(m))return r(void 0,m,b,y)}else return r(m,p,b,y)}function a(m,p){if(!Y.isUndefined(p))return r(void 0,p)}function u(m,p){if(Y.isUndefined(p)){if(!Y.isUndefined(m))return r(void 0,m)}else return r(void 0,p)}function l(m){const p=Y.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Y.isUndefined(p))if(Y.isPlainObject(p)){if(Y.hasOwnProp(p,m))return p[m]}else return;const b=Y.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Y.isPlainObject(b)&&Y.hasOwnProp(b,m))return b[m]}function d(m,p,b){if(Y.hasOwnProp(t,b))return r(m,p);if(Y.hasOwnProp(e,b))return r(void 0,m)}const f={url:a,method:a,data:a,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,allowedSocketPaths:u,responseEncoding:u,validateStatus:d,headers:(m,p,b)=>s(Eg(m),Eg(p),b,!0)};return Y.forEach(Object.keys(j(j({},e),t)),function(p){if(p==="__proto__"||p==="constructor"||p==="prototype")return;const b=Y.hasOwnProp(f,p)?f[p]:s,y=Y.hasOwnProp(e,p)?e[p]:void 0,_=Y.hasOwnProp(t,p)?t[p]:void 0,x=b(y,_,p);Y.isUndefined(x)&&b!==d||(n[p]=x)}),Y.hasOwnProp(t,"validateStatus")&&Y.isUndefined(t.validateStatus)&&l("validateStatusUndefinedResolves")===!1&&(Y.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}const AA=["content-type","content-length"];function kA(e,t,n){if(n!=="content-only"){e.set(t);return}Object.entries(t||{}).forEach(([r,s])=>{AA.includes(r.toLowerCase())&&e.set(r,s)})}const CA=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16)));function yg(e){const t=Yi({},e),n=b=>Y.hasOwnProp(t,b)?t[b]:void 0,r=n("data");let s=n("withXSRFToken");const a=n("xsrfHeaderName"),u=n("xsrfCookieName");let l=n("headers");const d=n("auth"),f=n("baseURL"),m=n("allowAbsoluteUrls"),p=n("url");if(t.headers=l=un.from(l),t.url=og(gg(f,p,m,t),n("params"),n("paramsSerializer")),d){const b=Y.getSafeProp(d,"username")||"",y=Y.getSafeProp(d,"password")||"";try{l.set("Authorization","Basic "+btoa(b+":"+(y?CA(y):"")))}catch(_){throw Oe.from(_,Oe.ERR_BAD_OPTION_VALUE,e)}}if(Y.isFormData(r)&&(sn.hasStandardBrowserEnv||sn.hasStandardBrowserWebWorkerEnv||Y.isReactNative(r)?l.setContentType(void 0):Y.isFunction(r.getHeaders)&&kA(l,r.getHeaders(),n("formDataHeaderPolicy"))),sn.hasStandardBrowserEnv&&(Y.isFunction(s)&&(s=s(t)),s===!0||s==null&&yA(t.url))){const y=a&&u&&TA.read(u);y&&l.set(a,y)}return t}const NA=typeof XMLHttpRequest!="undefined"&&function(e){return new Promise(function(n,r){const s=yg(e);let a=s.data;const u=un.from(s.headers).normalize();let{responseType:l,onUploadProgress:d,onDownloadProgress:f}=s,m,p,b,y,_;function x(){y&&y(),_&&_(),s.cancelToken&&s.cancelToken.unsubscribe(m),s.signal&&s.signal.removeEventListener("abort",m)}let A=new XMLHttpRequest;A.open(s.method.toUpperCase(),s.url,!0),A.timeout=s.timeout;function S(){if(!A)return;const O=un.from("getAllResponseHeaders"in A&&A.getAllResponseHeaders()),G={data:!l||l==="text"||l==="json"?A.responseText:A.response,status:A.status,statusText:A.statusText,headers:O,config:e,request:A};fg(function(V){n(V),x()},function(V){r(V),x()},G),A=null}"onloadend"in A?A.onloadend=S:A.onreadystatechange=function(){!A||A.readyState!==4||A.status===0&&!(A.responseURL&&A.responseURL.startsWith("file:"))||setTimeout(S)},A.onabort=function(){A&&(r(new Oe("Request aborted",Oe.ECONNABORTED,e,A)),x(),A=null)},A.onerror=function(z){const G=z&&z.message?z.message:"Network Error",D=new Oe(G,Oe.ERR_NETWORK,e,A);D.event=z||null,r(D),x(),A=null},A.ontimeout=function(){let z=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const G=s.transitional||Yd;s.timeoutErrorMessage&&(z=s.timeoutErrorMessage),r(new Oe(z,G.clarifyTimeoutError?Oe.ETIMEDOUT:Oe.ECONNABORTED,e,A)),x(),A=null},a===void 0&&u.setContentType(null),"setRequestHeader"in A&&Y.forEach(eg(u),function(z,G){A.setRequestHeader(G,z)}),Y.isUndefined(s.withCredentials)||(A.withCredentials=!!s.withCredentials),l&&l!=="json"&&(A.responseType=s.responseType),f&&([b,_]=$u(f,!0),A.addEventListener("progress",b)),d&&A.upload&&([p,y]=$u(d),A.upload.addEventListener("progress",p),A.upload.addEventListener("loadend",y)),(s.cancelToken||s.signal)&&(m=O=>{A&&(r(!O||O.type?new na(null,e,A):O),A.abort(),x(),A=null)},s.cancelToken&&s.cancelToken.subscribe(m),s.signal&&(s.signal.aborted?m():s.signal.addEventListener("abort",m)));const C=mA(s.url);if(C&&!sn.protocols.includes(C)){r(new Oe("Unsupported protocol "+C+":",Oe.ERR_BAD_REQUEST,e)),x();return}A.send(a||null)})},OA=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const s=function(d){if(!r){r=!0,u();const f=d instanceof Error?d:this.reason;n.abort(f instanceof Oe?f:new na(f instanceof Error?f.message:f))}};let a=t&&setTimeout(()=>{a=null,s(new Oe(`timeout of ${t}ms exceeded`,Oe.ETIMEDOUT))},t);const u=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(s):d.removeEventListener("abort",s)}),e=null)};e.forEach(d=>d.addEventListener("abort",s,{once:!0}));const{signal:l}=n;return l.unsubscribe=()=>Y.asap(u),l},IA=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},PA=function(e,t){return d0(this,null,function*(){try{for(var n=C2(RA(e)),r,s,a;r=!(s=yield new Ps(n.next())).done;r=!1){const u=s.value;yield*f0(IA(u,t))}}catch(s){a=[s]}finally{try{r&&(s=n.return)&&(yield new Ps(s.call(n)))}finally{if(a)throw a[0]}}})},RA=function(e){return d0(this,null,function*(){if(e[Symbol.asyncIterator]){yield*f0(e);return}const t=e.getReader();try{for(;;){const{done:n,value:r}=yield new Ps(t.read());if(n)break;yield r}}finally{yield new Ps(t.cancel())}})},Tg=(e,t,n,r)=>{const s=PA(e,t);let a=0,u,l=f=>{u||(u=!0,r&&r(f))};return new ReadableStream({pull(f){return Be(this,null,function*(){try{const{done:m,value:p}=yield s.next();if(m){l(),f.close();return}let b=p.byteLength;if(n){let y=a+=b;n(y)}f.enqueue(new Uint8Array(p))}catch(m){throw l(m),m}})},cancel(f){return l(f),s.return()}},{highWaterMark:2})},Vu=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,LA=(e,t,n)=>t+2<n&&Vu(e.charCodeAt(t+1))&&Vu(e.charCodeAt(t+2));function DA(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let u=r.length;const l=r.length;for(let y=0;y<l;y++)if(r.charCodeAt(y)===37&&y+2<l){const _=r.charCodeAt(y+1),x=r.charCodeAt(y+2);Vu(_)&&Vu(x)&&(u-=2,y+=2)}let d=0,f=l-1;const m=y=>y>=2&&r.charCodeAt(y-2)===37&&r.charCodeAt(y-1)===51&&(r.charCodeAt(y)===68||r.charCodeAt(y)===100);f>=0&&(r.charCodeAt(f)===61?(d++,f--):m(f)&&(d++,f-=3)),d===1&&f>=0&&(r.charCodeAt(f)===61||m(f))&&d++;const b=Math.floor(u/4)*3-(d||0);return b>0?b:0}let a=0;for(let u=0,l=r.length;u<l;u++){const d=r.charCodeAt(u);if(d===37&&LA(r,u,l))a+=1,u+=2;else if(d<128)a+=1;else if(d<2048)a+=2;else if(d>=55296&&d<=56319&&u+1<l){const f=r.charCodeAt(u+1);f>=56320&&f<=57343?(a+=4,u++):a+=3}else a+=3}return a}const Kd="1.18.1",bg=64*1024,{isFunction:qu}=Y,MA=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))),wg=e=>{if(!Y.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},_g=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},FA=e=>{const t=e.indexOf("://");let n=e;return t!==-1&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},BA=e=>{const t=Y.global!==void 0&&Y.global!==null?Y.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=Y.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:s,Request:a,Response:u}=e,l=s?qu(s):typeof fetch=="function",d=qu(a),f=qu(u);if(!l)return!1;const m=l&&qu(n),p=l&&(typeof r=="function"?(S=>C=>S.encode(C))(new r):S=>Be(null,null,function*(){return new Uint8Array(yield new a(S).arrayBuffer())})),b=d&&m&&_g(()=>{let S=!1;const C=new a(sn.origin,{body:new n,method:"POST",get duplex(){return S=!0,"half"}}),O=C.headers.has("Content-Type");return C.body!=null&&C.body.cancel(),S&&!O}),y=f&&m&&_g(()=>Y.isReadableStream(new u("").body)),_={stream:y&&(S=>S.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!_[S]&&(_[S]=(C,O)=>{let z=C&&C[S];if(z)return z.call(C);throw new Oe(`Response type '${S}' is not supported`,Oe.ERR_NOT_SUPPORT,O)})});const x=S=>Be(null,null,function*(){if(S==null)return 0;if(Y.isBlob(S))return S.size;if(Y.isSpecCompliantForm(S))return(yield new a(sn.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(Y.isArrayBufferView(S)||Y.isArrayBuffer(S))return S.byteLength;if(Y.isURLSearchParams(S)&&(S=S+""),Y.isString(S))return(yield p(S)).byteLength}),A=(S,C)=>Be(null,null,function*(){const O=Y.toFiniteNumber(S.getContentLength());return O==null?x(C):O});return S=>Be(null,null,function*(){let{url:C,method:O,data:z,signal:G,cancelToken:D,timeout:V,onDownloadProgress:J,onUploadProgress:se,responseType:H,headers:ie,withCredentials:te="same-origin",fetchOptions:le,maxContentLength:fe,maxBodyLength:ue}=yg(S);const Se=Y.isNumber(fe)&&fe>-1,de=Y.isNumber(ue)&&ue>-1,W=he=>Y.hasOwnProp(S,he)?S[he]:void 0;let oe=s||fetch;H=H?(H+"").toLowerCase():"text";let k=OA([G,D&&D.toAbortSignal()],V),M=null;const Z=k&&k.unsubscribe&&(()=>{k.unsubscribe()});let P,xe=null;const Ie=()=>new Oe("Request body larger than maxBodyLength limit",Oe.ERR_BAD_REQUEST,S,M);try{let he;const ve=W("auth");if(ve){const ze=Y.getSafeProp(ve,"username")||"",Ce=Y.getSafeProp(ve,"password")||"";he={username:ze,password:Ce}}if(FA(C)){const ze=new URL(C,sn.origin);if(!he&&(ze.username||ze.password)){const Ce=wg(ze.username),Xe=wg(ze.password);he={username:Ce,password:Xe}}(ze.username||ze.password)&&(ze.username="",ze.password="",C=ze.href)}if(he&&(ie.delete("authorization"),ie.set("Authorization","Basic "+btoa(MA((he.username||"")+":"+(he.password||""))))),Se&&typeof C=="string"&&C.startsWith("data:")&&DA(C)>fe)throw new Oe("maxContentLength size of "+fe+" exceeded",Oe.ERR_BAD_RESPONSE,S,M);if(de&&O!=="get"&&O!=="head"){const ze=yield x(z);if(typeof ze=="number"&&isFinite(ze)&&(P=ze,ze>ue))throw Ie()}const Fe=de&&(Y.isReadableStream(z)||Y.isStream(z)),Ge=(ze,Ce,Xe)=>Tg(ze,bg,nt=>{if(de&&nt>ue)throw xe=Ie();Ce&&Ce(nt)},Xe);if(b&&O!=="get"&&O!=="head"&&(se||Fe)){if(P=P==null?yield A(ie,z):P,P!==0||Fe){let ze=new a(C,{method:"POST",body:z,duplex:"half"}),Ce;if(Y.isFormData(z)&&(Ce=ze.headers.get("content-type"))&&ie.setContentType(Ce),ze.body){const[Xe,nt]=se&&hg(P,$u(pg(se)))||[];z=Ge(ze.body,Xe,nt)}}}else if(Fe&&!d&&m&&O!=="get"&&O!=="head")z=Ge(z);else if(Fe&&d&&!b&&O!=="get"&&O!=="head")throw new Oe("Stream request bodies are not supported by the current fetch implementation",Oe.ERR_NOT_SUPPORT,S,M);Y.isString(te)||(te=te?"include":"omit");const et=d&&"credentials"in a.prototype;if(Y.isFormData(z)){const ze=ie.getContentType();ze&&/^multipart\/form-data/i.test(ze)&&!/boundary=/i.test(ze)&&ie.delete("content-type")}ie.set("User-Agent","axios/"+Kd,!1);const mt=ce(j({},le),{signal:k,method:O.toUpperCase(),headers:eg(ie.normalize()),body:z,duplex:"half",credentials:et?te:void 0});M=d&&new a(C,mt);let Lt=yield d?oe(M,le):oe(C,mt);const pn=un.from(Lt.headers);if(Se){const ze=Y.toFiniteNumber(pn.getContentLength());if(ze!=null&&ze>fe)throw new Oe("maxContentLength size of "+fe+" exceeded",Oe.ERR_BAD_RESPONSE,S,M)}const wn=y&&(H==="stream"||H==="response");if(y&&Lt.body&&(J||Se||wn&&Z)){const ze={};["status","statusText","headers"].forEach(Ln=>{ze[Ln]=Lt[Ln]});const Ce=Y.toFiniteNumber(pn.getContentLength()),[Xe,nt]=J&&hg(Ce,$u(pg(J),!0))||[];let pt=0;const Mt=Ln=>{if(Se&&(pt=Ln,pt>fe))throw new Oe("maxContentLength size of "+fe+" exceeded",Oe.ERR_BAD_RESPONSE,S,M);Xe&&Xe(Ln)};Lt=new u(Tg(Lt.body,bg,Mt,()=>{nt&&nt(),Z&&Z()}),ze)}H=H||"text";let Dt=yield _[Y.findKey(_,H)||"text"](Lt,S);if(Se&&!y&&!wn){let ze;if(Dt!=null&&(typeof Dt.byteLength=="number"?ze=Dt.byteLength:typeof Dt.size=="number"?ze=Dt.size:typeof Dt=="string"&&(ze=typeof r=="function"?new r().encode(Dt).byteLength:Dt.length)),typeof ze=="number"&&ze>fe)throw new Oe("maxContentLength size of "+fe+" exceeded",Oe.ERR_BAD_RESPONSE,S,M)}return!wn&&Z&&Z(),yield new Promise((ze,Ce)=>{fg(ze,Ce,{data:Dt,headers:un.from(Lt.headers),status:Lt.status,statusText:Lt.statusText,config:S,request:M})})}catch(he){if(Z&&Z(),k&&k.aborted&&k.reason instanceof Oe){const ve=k.reason;throw ve.config=S,M&&(ve.request=M),he!==ve&&Object.defineProperty(ve,"cause",{__proto__:null,value:he,writable:!0,enumerable:!1,configurable:!0}),ve}if(xe)throw M&&!xe.request&&(xe.request=M),xe;if(he instanceof Oe)throw M&&!he.request&&(he.request=M),he;if(he&&he.name==="TypeError"&&/Load failed|fetch/i.test(he.message)){const ve=new Oe("Network Error",Oe.ERR_NETWORK,S,M,he&&he.response);throw Object.defineProperty(ve,"cause",{__proto__:null,value:he.cause||he,writable:!0,enumerable:!1,configurable:!0}),ve}throw Oe.from(he,he&&he.code,S,M,he&&he.response)}})},UA=new Map,xg=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,a=[r,s,n];let u=a.length,l=u,d,f,m=UA;for(;l--;)d=a[l],f=m.get(d),f===void 0&&m.set(d,f=l?new Map:BA(t)),m=f;return f};xg();const Qd={http:rA,xhr:NA,fetch:{get:xg}};Y.forEach(Qd,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(n){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Sg=e=>`- ${e}`,HA=e=>Y.isFunction(e)||e===null||e===!1;function jA(e,t){e=Y.isArray(e)?e:[e];const{length:n}=e;let r,s;const a={};for(let u=0;u<n;u++){r=e[u];let l;if(s=r,!HA(r)&&(s=Qd[(l=String(r)).toLowerCase()],s===void 0))throw new Oe(`Unknown adapter '${l}'`);if(s&&(Y.isFunction(s)||(s=s.get(t))))break;a[l||"#"+u]=s}if(!s){const u=Object.entries(a).map(([d,f])=>`adapter ${d} `+(f===!1?"is not supported by the environment":"is not available in the build"));let l=n?u.length>1?`since :
10
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[tg]=this[tg]={accessors:{}}).accessors,s=this.prototype;function a(u){const l=ea(u);r[l]||(Zv(s,u),r[l]=!0)}return Y.isArray(t)?t.forEach(a):a(t),this}};un.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Y.reduceDescriptors(un.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),Y.freezeMethods(un);const eA="[REDACTED ****]";function tA(e){if(Y.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Y.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function nA(e,t){const n=new Set(t.map(a=>String(a).toLowerCase())),r=[],s=a=>{if(a===null||typeof a!="object"||Y.isBuffer(a))return a;if(r.indexOf(a)!==-1)return;a instanceof un&&(a=a.toJSON()),r.push(a);let u;if(Y.isArray(a))u=[],a.forEach((l,d)=>{const f=s(l);Y.isUndefined(f)||(u[d]=f)});else{if(!Y.isPlainObject(a)&&tA(a))return r.pop(),a;u=Object.create(null);for(const[l,d]of Object.entries(a)){const f=n.has(l.toLowerCase())?eA:s(d);Y.isUndefined(f)||(u[l]=f)}}return r.pop(),u};return s(e)}let Oe=class N2 extends Error{static from(t,n,r,s,a,u){const l=new N2(t.message,n||t.code,r,s,a);return Object.defineProperty(l,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),l.name=t.name,t.status!=null&&l.status==null&&(l.status=t.status),u&&Object.assign(l,u),l}constructor(t,n,r,s,a){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),s&&(this.request=s),a&&(this.response=a,this.status=a.status)}toJSON(){const t=this.config,n=t&&Y.hasOwnProp(t,"redact")?t.redact:void 0,r=Y.isArray(n)&&n.length>0?nA(t,n):Y.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};Oe.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Oe.ERR_BAD_OPTION="ERR_BAD_OPTION",Oe.ECONNABORTED="ECONNABORTED",Oe.ETIMEDOUT="ETIMEDOUT",Oe.ECONNREFUSED="ECONNREFUSED",Oe.ERR_NETWORK="ERR_NETWORK",Oe.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Oe.ERR_DEPRECATED="ERR_DEPRECATED",Oe.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Oe.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Oe.ERR_CANCELED="ERR_CANCELED",Oe.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Oe.ERR_INVALID_URL="ERR_INVALID_URL",Oe.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const rA=null,ng=100;function $d(e){return Y.isPlainObject(e)||Y.isArray(e)}function rg(e){return Y.endsWith(e,"[]")?e.slice(0,-2):e}function Vd(e,t,n){return e?e.concat(t).map(function(s,a){return s=rg(s),!n&&a?"["+s+"]":s}).join(n?".":""):t}function iA(e){return Y.isArray(e)&&!e.some($d)}const sA=Y.toFlatObject(Y,{},null,function(t){return/^is[A-Z]/.test(t)});function zu(e,t,n){if(!Y.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Y.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,O){return!Y.isUndefined(O[C])});const r=n.metaTokens,s=n.visitor||_,a=n.dots,u=n.indexes,l=n.Blob||typeof Blob!="undefined"&&Blob,d=n.maxDepth===void 0?ng:n.maxDepth,f=l&&Y.isSpecCompliantForm(t),m=[];if(!Y.isFunction(s))throw new TypeError("visitor must be a function");function p(S){if(S===null)return"";if(Y.isDate(S))return S.toISOString();if(Y.isBoolean(S))return S.toString();if(!f&&Y.isBlob(S))throw new Oe("Blob is not supported. Use a Buffer instead.");if(Y.isArrayBuffer(S)||Y.isTypedArray(S)){if(f&&typeof l=="function")return new l([S]);if(typeof Buffer!="undefined")return Buffer.from(S);throw new Oe("Blob is not supported. Use a Buffer instead.",Oe.ERR_NOT_SUPPORT)}return S}function b(S){if(S>d)throw new Oe("Object is too deeply nested ("+S+" levels). Max depth: "+d,Oe.ERR_FORM_DATA_DEPTH_EXCEEDED)}function y(S,C){if(d===1/0)return JSON.stringify(S);const O=[];return JSON.stringify(S,function(G,M){if(!Y.isObject(M))return M;for(;O.length&&O[O.length-1]!==this;)O.pop();return O.push(M),b(C+O.length-1),M})}function _(S,C,O){let z=S;if(Y.isReactNative(t)&&Y.isReactNativeBlob(S))return t.append(Vd(O,C,a),p(S)),!1;if(S&&!O&&typeof S=="object"){if(Y.endsWith(C,"{}"))C=r?C:C.slice(0,-2),S=y(S,1);else if(Y.isArray(S)&&iA(S)||(Y.isFileList(S)||Y.endsWith(C,"[]"))&&(z=Y.toArray(S)))return C=rg(C),z.forEach(function(M,V){!(Y.isUndefined(M)||M===null)&&t.append(u===!0?Vd([C],V,a):u===null?C:C+"[]",p(M))}),!1}return $d(S)?!0:(t.append(Vd(O,C,a),p(S)),!1)}const x=Object.assign(sA,{defaultVisitor:_,convertValue:p,isVisitable:$d});function A(S,C,O=0){if(!Y.isUndefined(S)){if(b(O),m.indexOf(S)!==-1)throw new Error("Circular reference detected in "+C.join("."));m.push(S),Y.forEach(S,function(G,M){(!(Y.isUndefined(G)||G===null)&&s.call(t,G,Y.isString(M)?M.trim():M,C,x))===!0&&A(G,C?C.concat(M):[M],O+1)}),m.pop()}}if(!Y.isObject(e))throw new TypeError("data must be an object");return A(e),t}function ig(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(r){return t[r]})}function qd(e,t){this._pairs=[],e&&zu(e,this,t)}const sg=qd.prototype;sg.append=function(t,n){this._pairs.push([t,n])},sg.toString=function(t){const n=t?r=>t.call(this,r,ig):ig;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function oA(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function og(e,t,n){if(!t)return e;e=e||"";const r=Y.isFunction(n)?{serialize:n}:n,s=Y.getSafeProp(r,"encode")||oA,a=Y.getSafeProp(r,"serialize");let u;if(a?u=a(t,r):u=Y.isURLSearchParams(t)?t.toString():new qd(t,r).toString(s),u){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+u}return e}class ag{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Y.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Yd={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},aA={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams!="undefined"?URLSearchParams:qd,FormData:typeof FormData!="undefined"?FormData:null,Blob:typeof Blob!="undefined"?Blob:null},protocols:["http","https","file","blob","url","data"]},Wd=typeof window!="undefined"&&typeof document!="undefined",Gd=typeof navigator=="object"&&navigator||void 0,uA=Wd&&(!Gd||["ReactNative","NativeScript","NS"].indexOf(Gd.product)<0),lA=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",cA=Wd&&window.location.href||"http://localhost",sn=j(j({},Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Wd,hasStandardBrowserEnv:uA,hasStandardBrowserWebWorkerEnv:lA,navigator:Gd,origin:cA},Symbol.toStringTag,{value:"Module"}))),aA);function dA(e,t){return zu(e,new sn.classes.URLSearchParams,j({visitor:function(n,r,s,a){return sn.isNode&&Y.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}const ug=ng;function lg(e){if(e>ug)throw new Oe("FormData field is too deeply nested ("+e+" levels). Max depth: "+ug,Oe.ERR_FORM_DATA_DEPTH_EXCEEDED)}function fA(e){const t=[],n=/\w+|\[(\w*)]/g;let r;for(;(r=n.exec(e))!==null;)lg(t.length),t.push(r[0]==="[]"?"":r[1]||r[0]);return t}function hA(e){const t={},n=Object.keys(e);let r;const s=n.length;let a;for(r=0;r<s;r++)a=n[r],t[a]=e[a];return t}function cg(e){function t(n,r,s,a){lg(a);let u=n[a++];if(u==="__proto__")return!0;const l=Number.isFinite(+u),d=a>=n.length;return u=!u&&Y.isArray(s)?s.length:u,d?(Y.hasOwnProp(s,u)?s[u]=Y.isArray(s[u])?s[u].concat(r):[s[u],r]:s[u]=r,!l):((!Y.hasOwnProp(s,u)||!Y.isObject(s[u]))&&(s[u]=[]),t(n,r,s[u],a)&&Y.isArray(s[u])&&(s[u]=hA(s[u])),!l)}if(Y.isFormData(e)&&Y.isFunction(e.entries)){const n={};return Y.forEachEntry(e,(r,s)=>{t(fA(r),s,n,0)}),n}return null}const js=(e,t)=>e!=null&&Y.hasOwnProp(e,t)?e[t]:void 0;function pA(e,t,n){if(Y.isString(e))try{return(t||JSON.parse)(e),Y.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ta={transitional:Yd,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,a=Y.isObject(t);if(a&&Y.isHTMLForm(t)&&(t=new FormData(t)),Y.isFormData(t))return s?JSON.stringify(cg(t)):t;if(Y.isArrayBuffer(t)||Y.isBuffer(t)||Y.isStream(t)||Y.isFile(t)||Y.isBlob(t)||Y.isReadableStream(t))return t;if(Y.isArrayBufferView(t))return t.buffer;if(Y.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(a){const d=js(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return dA(t,d).toString();if((l=Y.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=js(this,"env"),m=f&&f.FormData;return zu(l?{"files[]":t}:t,m&&new m,d)}}return a||s?(n.setContentType("application/json",!1),pA(t)):t}],transformResponse:[function(t){const n=js(this,"transitional")||ta.transitional,r=n&&n.forcedJSONParsing,s=js(this,"responseType"),a=s==="json";if(Y.isResponse(t)||Y.isReadableStream(t))return t;if(t&&Y.isString(t)&&(r&&!s||a)){const l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t,js(this,"parseReviver"))}catch(d){if(l)throw d.name==="SyntaxError"?Oe.from(d,Oe.ERR_BAD_RESPONSE,this,null,js(this,"response")):d}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:sn.classes.FormData,Blob:sn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Y.forEach(["delete","get","head","post","put","patch","query"],e=>{ta.headers[e]={}});function Xd(e,t){const n=this||ta,r=t||n,s=un.from(r.headers);let a=r.data;return Y.forEach(e,function(l){a=l.call(n,a,s.normalize(),t?t.status:void 0)}),s.normalize(),a}function dg(e){return!!(e&&e.__CANCEL__)}let na=class extends Oe{constructor(t,n,r){super(t==null?"canceled":t,Oe.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function fg(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Oe("Request failed with status code "+n.status,n.status>=400&&n.status<500?Oe.ERR_BAD_REQUEST:Oe.ERR_BAD_RESPONSE,n.config,n.request,n))}function mA(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function gA(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,a=0,u;return t=t!==void 0?t:1e3,function(d){const f=Date.now(),m=r[a];u||(u=f),n[s]=d,r[s]=f;let p=a,b=0;for(;p!==s;)b+=n[p++],p=p%e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),f-u<t)return;const y=m&&f-m;return y?Math.round(b*1e3/y):void 0}}function EA(e,t){let n=0,r=1e3/t,s,a;const u=(f,m=Date.now())=>{n=m,s=null,a&&(clearTimeout(a),a=null),e(...f)};return[(...f)=>{const m=Date.now(),p=m-n;p>=r?u(f,m):(s=f,a||(a=setTimeout(()=>{a=null,u(s)},r-p)))},()=>s&&u(s)]}const $u=(e,t,n=3)=>{let r=0;const s=gA(50,250);return EA(a=>{if(!a||typeof a.loaded!="number")return;const u=a.loaded,l=a.lengthComputable?a.total:void 0,d=l!=null?Math.min(u,l):u,f=Math.max(0,d-r),m=s(f);r=Math.max(r,d);const p={loaded:d,total:l,progress:l?d/l:void 0,bytes:f,rate:m||void 0,estimated:m&&l?(l-d)/m:void 0,event:a,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},n)},hg=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},pg=e=>(...t)=>Y.asap(()=>e(...t)),yA=sn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,sn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(sn.origin),sn.navigator&&/(msie|trident)/i.test(sn.navigator.userAgent)):()=>!0,TA=sn.hasStandardBrowserEnv?{write(e,t,n,r,s,a,u){if(typeof document=="undefined")return;const l=[`${e}=${encodeURIComponent(t)}`];Y.isNumber(n)&&l.push(`expires=${new Date(n).toUTCString()}`),Y.isString(r)&&l.push(`path=${r}`),Y.isString(s)&&l.push(`domain=${s}`),a===!0&&l.push("secure"),Y.isString(u)&&l.push(`SameSite=${u}`),document.cookie=l.join("; ")},read(e){if(typeof document=="undefined")return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const r=t[n].replace(/^\s+/,""),s=r.indexOf("=");if(s!==-1&&r.slice(0,s)===e)try{return decodeURIComponent(r.slice(s+1))}catch(a){return r.slice(s+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function bA(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function wA(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const _A=/^https?:(?!\/\/)/i,xA=/[\t\n\r]/g;function SA(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function vA(e){return SA(e).replace(xA,"")}function mg(e,t){if(typeof e=="string"&&_A.test(vA(e)))throw new Oe('Invalid URL: missing "//" after protocol',Oe.ERR_INVALID_URL,t)}function gg(e,t,n,r){mg(t,r);let s=!bA(t);return e&&(s||n===!1)?(mg(e,r),wA(e,t)):t}const Eg=e=>e instanceof un?j({},e):e;function Yi(e,t){e=e||{},t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(m,p,b,y){return Y.isPlainObject(m)&&Y.isPlainObject(p)?Y.merge.call({caseless:y},m,p):Y.isPlainObject(p)?Y.merge({},p):Y.isArray(p)?p.slice():p}function s(m,p,b,y){if(Y.isUndefined(p)){if(!Y.isUndefined(m))return r(void 0,m,b,y)}else return r(m,p,b,y)}function a(m,p){if(!Y.isUndefined(p))return r(void 0,p)}function u(m,p){if(Y.isUndefined(p)){if(!Y.isUndefined(m))return r(void 0,m)}else return r(void 0,p)}function l(m){const p=Y.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Y.isUndefined(p))if(Y.isPlainObject(p)){if(Y.hasOwnProp(p,m))return p[m]}else return;const b=Y.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Y.isPlainObject(b)&&Y.hasOwnProp(b,m))return b[m]}function d(m,p,b){if(Y.hasOwnProp(t,b))return r(m,p);if(Y.hasOwnProp(e,b))return r(void 0,m)}const f={url:a,method:a,data:a,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,allowedSocketPaths:u,responseEncoding:u,validateStatus:d,headers:(m,p,b)=>s(Eg(m),Eg(p),b,!0)};return Y.forEach(Object.keys(j(j({},e),t)),function(p){if(p==="__proto__"||p==="constructor"||p==="prototype")return;const b=Y.hasOwnProp(f,p)?f[p]:s,y=Y.hasOwnProp(e,p)?e[p]:void 0,_=Y.hasOwnProp(t,p)?t[p]:void 0,x=b(y,_,p);Y.isUndefined(x)&&b!==d||(n[p]=x)}),Y.hasOwnProp(t,"validateStatus")&&Y.isUndefined(t.validateStatus)&&l("validateStatusUndefinedResolves")===!1&&(Y.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}const AA=["content-type","content-length"];function kA(e,t,n){if(n!=="content-only"){e.set(t);return}Object.entries(t||{}).forEach(([r,s])=>{AA.includes(r.toLowerCase())&&e.set(r,s)})}const CA=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16)));function yg(e){const t=Yi({},e),n=b=>Y.hasOwnProp(t,b)?t[b]:void 0,r=n("data");let s=n("withXSRFToken");const a=n("xsrfHeaderName"),u=n("xsrfCookieName");let l=n("headers");const d=n("auth"),f=n("baseURL"),m=n("allowAbsoluteUrls"),p=n("url");if(t.headers=l=un.from(l),t.url=og(gg(f,p,m,t),n("params"),n("paramsSerializer")),d){const b=Y.getSafeProp(d,"username")||"",y=Y.getSafeProp(d,"password")||"";try{l.set("Authorization","Basic "+btoa(b+":"+(y?CA(y):"")))}catch(_){throw Oe.from(_,Oe.ERR_BAD_OPTION_VALUE,e)}}if(Y.isFormData(r)&&(sn.hasStandardBrowserEnv||sn.hasStandardBrowserWebWorkerEnv||Y.isReactNative(r)?l.setContentType(void 0):Y.isFunction(r.getHeaders)&&kA(l,r.getHeaders(),n("formDataHeaderPolicy"))),sn.hasStandardBrowserEnv&&(Y.isFunction(s)&&(s=s(t)),s===!0||s==null&&yA(t.url))){const y=a&&u&&TA.read(u);y&&l.set(a,y)}return t}const NA=typeof XMLHttpRequest!="undefined"&&function(e){return new Promise(function(n,r){const s=yg(e);let a=s.data;const u=un.from(s.headers).normalize();let{responseType:l,onUploadProgress:d,onDownloadProgress:f}=s,m,p,b,y,_;function x(){y&&y(),_&&_(),s.cancelToken&&s.cancelToken.unsubscribe(m),s.signal&&s.signal.removeEventListener("abort",m)}let A=new XMLHttpRequest;A.open(s.method.toUpperCase(),s.url,!0),A.timeout=s.timeout;function S(){if(!A)return;const O=un.from("getAllResponseHeaders"in A&&A.getAllResponseHeaders()),G={data:!l||l==="text"||l==="json"?A.responseText:A.response,status:A.status,statusText:A.statusText,headers:O,config:e,request:A};fg(function(V){n(V),x()},function(V){r(V),x()},G),A=null}"onloadend"in A?A.onloadend=S:A.onreadystatechange=function(){!A||A.readyState!==4||A.status===0&&!(A.responseURL&&A.responseURL.startsWith("file:"))||setTimeout(S)},A.onabort=function(){A&&(r(new Oe("Request aborted",Oe.ECONNABORTED,e,A)),x(),A=null)},A.onerror=function(z){const G=z&&z.message?z.message:"Network Error",M=new Oe(G,Oe.ERR_NETWORK,e,A);M.event=z||null,r(M),x(),A=null},A.ontimeout=function(){let z=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const G=s.transitional||Yd;s.timeoutErrorMessage&&(z=s.timeoutErrorMessage),r(new Oe(z,G.clarifyTimeoutError?Oe.ETIMEDOUT:Oe.ECONNABORTED,e,A)),x(),A=null},a===void 0&&u.setContentType(null),"setRequestHeader"in A&&Y.forEach(eg(u),function(z,G){A.setRequestHeader(G,z)}),Y.isUndefined(s.withCredentials)||(A.withCredentials=!!s.withCredentials),l&&l!=="json"&&(A.responseType=s.responseType),f&&([b,_]=$u(f,!0),A.addEventListener("progress",b)),d&&A.upload&&([p,y]=$u(d),A.upload.addEventListener("progress",p),A.upload.addEventListener("loadend",y)),(s.cancelToken||s.signal)&&(m=O=>{A&&(r(!O||O.type?new na(null,e,A):O),A.abort(),x(),A=null)},s.cancelToken&&s.cancelToken.subscribe(m),s.signal&&(s.signal.aborted?m():s.signal.addEventListener("abort",m)));const C=mA(s.url);if(C&&!sn.protocols.includes(C)){r(new Oe("Unsupported protocol "+C+":",Oe.ERR_BAD_REQUEST,e)),x();return}A.send(a||null)})},OA=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const s=function(d){if(!r){r=!0,u();const f=d instanceof Error?d:this.reason;n.abort(f instanceof Oe?f:new na(f instanceof Error?f.message:f))}};let a=t&&setTimeout(()=>{a=null,s(new Oe(`timeout of ${t}ms exceeded`,Oe.ETIMEDOUT))},t);const u=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(s):d.removeEventListener("abort",s)}),e=null)};e.forEach(d=>d.addEventListener("abort",s,{once:!0}));const{signal:l}=n;return l.unsubscribe=()=>Y.asap(u),l},IA=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},PA=function(e,t){return d0(this,null,function*(){try{for(var n=C2(RA(e)),r,s,a;r=!(s=yield new Ps(n.next())).done;r=!1){const u=s.value;yield*f0(IA(u,t))}}catch(s){a=[s]}finally{try{r&&(s=n.return)&&(yield new Ps(s.call(n)))}finally{if(a)throw a[0]}}})},RA=function(e){return d0(this,null,function*(){if(e[Symbol.asyncIterator]){yield*f0(e);return}const t=e.getReader();try{for(;;){const{done:n,value:r}=yield new Ps(t.read());if(n)break;yield r}}finally{yield new Ps(t.cancel())}})},Tg=(e,t,n,r)=>{const s=PA(e,t);let a=0,u,l=f=>{u||(u=!0,r&&r(f))};return new ReadableStream({pull(f){return Be(this,null,function*(){try{const{done:m,value:p}=yield s.next();if(m){l(),f.close();return}let b=p.byteLength;if(n){let y=a+=b;n(y)}f.enqueue(new Uint8Array(p))}catch(m){throw l(m),m}})},cancel(f){return l(f),s.return()}},{highWaterMark:2})},Vu=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,LA=(e,t,n)=>t+2<n&&Vu(e.charCodeAt(t+1))&&Vu(e.charCodeAt(t+2));function DA(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let u=r.length;const l=r.length;for(let y=0;y<l;y++)if(r.charCodeAt(y)===37&&y+2<l){const _=r.charCodeAt(y+1),x=r.charCodeAt(y+2);Vu(_)&&Vu(x)&&(u-=2,y+=2)}let d=0,f=l-1;const m=y=>y>=2&&r.charCodeAt(y-2)===37&&r.charCodeAt(y-1)===51&&(r.charCodeAt(y)===68||r.charCodeAt(y)===100);f>=0&&(r.charCodeAt(f)===61?(d++,f--):m(f)&&(d++,f-=3)),d===1&&f>=0&&(r.charCodeAt(f)===61||m(f))&&d++;const b=Math.floor(u/4)*3-(d||0);return b>0?b:0}let a=0;for(let u=0,l=r.length;u<l;u++){const d=r.charCodeAt(u);if(d===37&&LA(r,u,l))a+=1,u+=2;else if(d<128)a+=1;else if(d<2048)a+=2;else if(d>=55296&&d<=56319&&u+1<l){const f=r.charCodeAt(u+1);f>=56320&&f<=57343?(a+=4,u++):a+=3}else a+=3}return a}const Kd="1.18.1",bg=64*1024,{isFunction:qu}=Y,MA=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))),wg=e=>{if(!Y.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},_g=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},FA=e=>{const t=e.indexOf("://");let n=e;return t!==-1&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},BA=e=>{const t=Y.global!==void 0&&Y.global!==null?Y.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=Y.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:s,Request:a,Response:u}=e,l=s?qu(s):typeof fetch=="function",d=qu(a),f=qu(u);if(!l)return!1;const m=l&&qu(n),p=l&&(typeof r=="function"?(S=>C=>S.encode(C))(new r):S=>Be(null,null,function*(){return new Uint8Array(yield new a(S).arrayBuffer())})),b=d&&m&&_g(()=>{let S=!1;const C=new a(sn.origin,{body:new n,method:"POST",get duplex(){return S=!0,"half"}}),O=C.headers.has("Content-Type");return C.body!=null&&C.body.cancel(),S&&!O}),y=f&&m&&_g(()=>Y.isReadableStream(new u("").body)),_={stream:y&&(S=>S.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!_[S]&&(_[S]=(C,O)=>{let z=C&&C[S];if(z)return z.call(C);throw new Oe(`Response type '${S}' is not supported`,Oe.ERR_NOT_SUPPORT,O)})});const x=S=>Be(null,null,function*(){if(S==null)return 0;if(Y.isBlob(S))return S.size;if(Y.isSpecCompliantForm(S))return(yield new a(sn.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(Y.isArrayBufferView(S)||Y.isArrayBuffer(S))return S.byteLength;if(Y.isURLSearchParams(S)&&(S=S+""),Y.isString(S))return(yield p(S)).byteLength}),A=(S,C)=>Be(null,null,function*(){const O=Y.toFiniteNumber(S.getContentLength());return O==null?x(C):O});return S=>Be(null,null,function*(){let{url:C,method:O,data:z,signal:G,cancelToken:M,timeout:V,onDownloadProgress:J,onUploadProgress:se,responseType:H,headers:ie,withCredentials:te="same-origin",fetchOptions:le,maxContentLength:fe,maxBodyLength:ue}=yg(S);const Se=Y.isNumber(fe)&&fe>-1,de=Y.isNumber(ue)&&ue>-1,W=he=>Y.hasOwnProp(S,he)?S[he]:void 0;let oe=s||fetch;H=H?(H+"").toLowerCase():"text";let k=OA([G,M&&M.toAbortSignal()],V),D=null;const Z=k&&k.unsubscribe&&(()=>{k.unsubscribe()});let P,xe=null;const Ie=()=>new Oe("Request body larger than maxBodyLength limit",Oe.ERR_BAD_REQUEST,S,D);try{let he;const ve=W("auth");if(ve){const ze=Y.getSafeProp(ve,"username")||"",Ce=Y.getSafeProp(ve,"password")||"";he={username:ze,password:Ce}}if(FA(C)){const ze=new URL(C,sn.origin);if(!he&&(ze.username||ze.password)){const Ce=wg(ze.username),Xe=wg(ze.password);he={username:Ce,password:Xe}}(ze.username||ze.password)&&(ze.username="",ze.password="",C=ze.href)}if(he&&(ie.delete("authorization"),ie.set("Authorization","Basic "+btoa(MA((he.username||"")+":"+(he.password||""))))),Se&&typeof C=="string"&&C.startsWith("data:")&&DA(C)>fe)throw new Oe("maxContentLength size of "+fe+" exceeded",Oe.ERR_BAD_RESPONSE,S,D);if(de&&O!=="get"&&O!=="head"){const ze=yield x(z);if(typeof ze=="number"&&isFinite(ze)&&(P=ze,ze>ue))throw Ie()}const Fe=de&&(Y.isReadableStream(z)||Y.isStream(z)),Ge=(ze,Ce,Xe)=>Tg(ze,bg,nt=>{if(de&&nt>ue)throw xe=Ie();Ce&&Ce(nt)},Xe);if(b&&O!=="get"&&O!=="head"&&(se||Fe)){if(P=P==null?yield A(ie,z):P,P!==0||Fe){let ze=new a(C,{method:"POST",body:z,duplex:"half"}),Ce;if(Y.isFormData(z)&&(Ce=ze.headers.get("content-type"))&&ie.setContentType(Ce),ze.body){const[Xe,nt]=se&&hg(P,$u(pg(se)))||[];z=Ge(ze.body,Xe,nt)}}}else if(Fe&&!d&&m&&O!=="get"&&O!=="head")z=Ge(z);else if(Fe&&d&&!b&&O!=="get"&&O!=="head")throw new Oe("Stream request bodies are not supported by the current fetch implementation",Oe.ERR_NOT_SUPPORT,S,D);Y.isString(te)||(te=te?"include":"omit");const et=d&&"credentials"in a.prototype;if(Y.isFormData(z)){const ze=ie.getContentType();ze&&/^multipart\/form-data/i.test(ze)&&!/boundary=/i.test(ze)&&ie.delete("content-type")}ie.set("User-Agent","axios/"+Kd,!1);const mt=ce(j({},le),{signal:k,method:O.toUpperCase(),headers:eg(ie.normalize()),body:z,duplex:"half",credentials:et?te:void 0});D=d&&new a(C,mt);let Lt=yield d?oe(D,le):oe(C,mt);const pn=un.from(Lt.headers);if(Se){const ze=Y.toFiniteNumber(pn.getContentLength());if(ze!=null&&ze>fe)throw new Oe("maxContentLength size of "+fe+" exceeded",Oe.ERR_BAD_RESPONSE,S,D)}const wn=y&&(H==="stream"||H==="response");if(y&&Lt.body&&(J||Se||wn&&Z)){const ze={};["status","statusText","headers"].forEach(Ln=>{ze[Ln]=Lt[Ln]});const Ce=Y.toFiniteNumber(pn.getContentLength()),[Xe,nt]=J&&hg(Ce,$u(pg(J),!0))||[];let pt=0;const Mt=Ln=>{if(Se&&(pt=Ln,pt>fe))throw new Oe("maxContentLength size of "+fe+" exceeded",Oe.ERR_BAD_RESPONSE,S,D);Xe&&Xe(Ln)};Lt=new u(Tg(Lt.body,bg,Mt,()=>{nt&&nt(),Z&&Z()}),ze)}H=H||"text";let Dt=yield _[Y.findKey(_,H)||"text"](Lt,S);if(Se&&!y&&!wn){let ze;if(Dt!=null&&(typeof Dt.byteLength=="number"?ze=Dt.byteLength:typeof Dt.size=="number"?ze=Dt.size:typeof Dt=="string"&&(ze=typeof r=="function"?new r().encode(Dt).byteLength:Dt.length)),typeof ze=="number"&&ze>fe)throw new Oe("maxContentLength size of "+fe+" exceeded",Oe.ERR_BAD_RESPONSE,S,D)}return!wn&&Z&&Z(),yield new Promise((ze,Ce)=>{fg(ze,Ce,{data:Dt,headers:un.from(Lt.headers),status:Lt.status,statusText:Lt.statusText,config:S,request:D})})}catch(he){if(Z&&Z(),k&&k.aborted&&k.reason instanceof Oe){const ve=k.reason;throw ve.config=S,D&&(ve.request=D),he!==ve&&Object.defineProperty(ve,"cause",{__proto__:null,value:he,writable:!0,enumerable:!1,configurable:!0}),ve}if(xe)throw D&&!xe.request&&(xe.request=D),xe;if(he instanceof Oe)throw D&&!he.request&&(he.request=D),he;if(he&&he.name==="TypeError"&&/Load failed|fetch/i.test(he.message)){const ve=new Oe("Network Error",Oe.ERR_NETWORK,S,D,he&&he.response);throw Object.defineProperty(ve,"cause",{__proto__:null,value:he.cause||he,writable:!0,enumerable:!1,configurable:!0}),ve}throw Oe.from(he,he&&he.code,S,D,he&&he.response)}})},UA=new Map,xg=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,a=[r,s,n];let u=a.length,l=u,d,f,m=UA;for(;l--;)d=a[l],f=m.get(d),f===void 0&&m.set(d,f=l?new Map:BA(t)),m=f;return f};xg();const Qd={http:rA,xhr:NA,fetch:{get:xg}};Y.forEach(Qd,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(n){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Sg=e=>`- ${e}`,HA=e=>Y.isFunction(e)||e===null||e===!1;function jA(e,t){e=Y.isArray(e)?e:[e];const{length:n}=e;let r,s;const a={};for(let u=0;u<n;u++){r=e[u];let l;if(s=r,!HA(r)&&(s=Qd[(l=String(r)).toLowerCase()],s===void 0))throw new Oe(`Unknown adapter '${l}'`);if(s&&(Y.isFunction(s)||(s=s.get(t))))break;a[l||"#"+u]=s}if(!s){const u=Object.entries(a).map(([d,f])=>`adapter ${d} `+(f===!1?"is not supported by the environment":"is not available in the build"));let l=n?u.length>1?`since :
11
11
  `+u.map(Sg).join(`
12
12
  `):" "+Sg(u[0]):"as no adapter specified";throw new Oe("There is no suitable adapter to dispatch the request "+l,Oe.ERR_NOT_SUPPORT)}return s}const vg={getAdapter:jA,adapters:Qd};function Jd(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new na(null,e)}function Ag(e){return Jd(e),e.headers=un.from(e.headers),e.data=Xd.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),vg.getAdapter(e.adapter||ta.adapter,e)(e).then(function(r){Jd(e),e.response=r;try{r.data=Xd.call(e,e.transformResponse,r)}finally{delete e.response}return r.headers=un.from(r.headers),r},function(r){if(!dg(r)&&(Jd(e),r&&r.response)){e.response=r.response;try{r.response.data=Xd.call(e,e.transformResponse,r.response)}finally{delete e.response}r.response.headers=un.from(r.response.headers)}return Promise.reject(r)})}const Yu={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Yu[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const kg={};Yu.transitional=function(t,n,r){function s(a,u){return"[Axios v"+Kd+"] Transitional option '"+a+"'"+u+(r?". "+r:"")}return(a,u,l)=>{if(t===!1)throw new Oe(s(u," has been removed"+(n?" in "+n:"")),Oe.ERR_DEPRECATED);return n&&!kg[u]&&(kg[u]=!0,console.warn(s(u," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,u,l):!0}},Yu.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function zA(e,t,n){if(typeof e!="object"||e===null)throw new Oe("options must be an object",Oe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const a=r[s],u=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(u){const l=e[a],d=l===void 0||u(l,a,e);if(d!==!0)throw new Oe("option "+a+" must be "+d,Oe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Oe("Unknown option "+a,Oe.ERR_BAD_OPTION)}}const Wu={assertOptions:zA,validators:Yu},ln=Wu.validators;let Wi=class{constructor(t){this.defaults=t||{},this.interceptors={request:new ag,response:new ag}}request(t,n){return Be(this,null,function*(){try{return yield this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const a=(()=>{if(!s.stack)return"";const u=s.stack.indexOf(`
13
13
  `);return u===-1?"":s.stack.slice(u+1)})();try{if(!r.stack)r.stack=a;else if(a){const u=a.indexOf(`
14
14
  `),l=u===-1?-1:a.indexOf(`
15
15
  `,u+1),d=l===-1?"":a.slice(l+1);String(r.stack).endsWith(d)||(r.stack+=`
16
- `+a)}}catch(u){}}throw r}})}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Yi(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:a}=n;r!==void 0&&Wu.assertOptions(r,{silentJSONParsing:ln.transitional(ln.boolean),forcedJSONParsing:ln.transitional(ln.boolean),clarifyTimeoutError:ln.transitional(ln.boolean),legacyInterceptorReqResOrdering:ln.transitional(ln.boolean),advertiseZstdAcceptEncoding:ln.transitional(ln.boolean),validateStatusUndefinedResolves:ln.transitional(ln.boolean)},!1),s!=null&&(Y.isFunction(s)?n.paramsSerializer={serialize:s}:Wu.assertOptions(s,{encode:ln.function,serialize:ln.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Wu.assertOptions(n,{baseUrl:ln.spelling("baseURL"),withXsrfToken:ln.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let u=a&&Y.merge(a.common,a[n.method]);a&&Y.forEach(["delete","get","head","post","put","patch","query","common"],_=>{delete a[_]}),n.headers=un.concat(u,a);const l=[];let d=!0;this.interceptors.request.forEach(function(x){if(typeof x.runWhen=="function"&&x.runWhen(n)===!1)return;d=d&&x.synchronous;const A=n.transitional||Yd;A&&A.legacyInterceptorReqResOrdering?l.unshift(x.fulfilled,x.rejected):l.push(x.fulfilled,x.rejected)});const f=[];this.interceptors.response.forEach(function(x){f.push(x.fulfilled,x.rejected)});let m,p=0,b;if(!d){const _=[Ag.bind(this),void 0];for(_.unshift(...l),_.push(...f),b=_.length,m=Promise.resolve(n);p<b;)m=m.then(_[p++],_[p++]);return m}b=l.length;let y=n;for(;p<b;){const _=l[p++],x=l[p++];try{y=_(y)}catch(A){x.call(this,A);break}}try{m=Ag.call(this,y)}catch(_){return Promise.reject(_)}for(p=0,b=f.length;p<b;)m=m.then(f[p++],f[p++]);return m}getUri(t){t=Yi(this.defaults,t);const n=gg(t.baseURL,t.url,t.allowAbsoluteUrls,t);return og(n,t.params,t.paramsSerializer)}};Y.forEach(["delete","get","head","options"],function(t){Wi.prototype[t]=function(n,r){return this.request(Yi(r||{},{method:t,url:n,data:r&&Y.hasOwnProp(r,"data")?r.data:void 0}))}}),Y.forEach(["post","put","patch","query"],function(t){function n(r){return function(a,u,l){return this.request(Yi(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:u}))}}Wi.prototype[t]=n(),t!=="query"&&(Wi.prototype[t+"Form"]=n(!0))});let $A=class O2{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(s=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](s);r._listeners=null}),this.promise.then=s=>{let a;const u=new Promise(l=>{r.subscribe(l),a=l}).then(s);return u.cancel=function(){r.unsubscribe(a)},u},t(function(a,u,l){r.reason||(r.reason=new na(a,u,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new O2(function(s){t=s}),cancel:t}}};function VA(e){return function(n){return e.apply(null,n)}}function qA(e){return Y.isObject(e)&&e.isAxiosError===!0}const Zd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Zd).forEach(([e,t])=>{Zd[t]=e});function Cg(e){const t=new Wi(e),n=$0(Wi.prototype.request,t);return Y.extend(n,Wi.prototype,t,{allOwnKeys:!0}),Y.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Cg(Yi(e,s))},n}const Bt=Cg(ta);Bt.Axios=Wi,Bt.CanceledError=na,Bt.CancelToken=$A,Bt.isCancel=dg,Bt.VERSION=Kd,Bt.toFormData=zu,Bt.AxiosError=Oe,Bt.Cancel=Bt.CanceledError,Bt.all=function(t){return Promise.all(t)},Bt.spread=VA,Bt.isAxiosError=qA,Bt.mergeConfig=Yi,Bt.AxiosHeaders=un,Bt.formToJSON=e=>cg(Y.isHTMLForm(e)?new FormData(e):e),Bt.getAdapter=vg.getAdapter,Bt.HttpStatusCode=Zd,Bt.default=Bt;const{Axios:cU,AxiosError:dU,CanceledError:fU,isCancel:hU,CancelToken:pU,VERSION:mU,all:gU,Cancel:EU,isAxiosError:yU,spread:TU,toFormData:bU,AxiosHeaders:wU,HttpStatusCode:_U,formToJSON:xU,getAdapter:SU,mergeConfig:vU,create:AU}=Bt;class YA{constructor(t,n,r,s=!1,a,u){Qe(this,"CIMULATE_API_HEADER","x-cimulate-api-key");Qe(this,"CIMULATE_SEARCH_API_HOST","search.cimulate");Qe(this,"CIMULATE_SEARCH_API_PATH","api/v1");Qe(this,"baseApiUrl");Qe(this,"headers",{});Qe(this,"fetchConfig",()=>Be(this,null,function*(){try{const t=yield Bt.get(`${this.apiUrl}/configs/copilot`,{headers:this.headers}),{customer_config:n}=t.data,r=atob(n);return JSON.parse(r)}catch(t){throw console.error("Error fetching customer config:",t),t}}));Qe(this,"_mapCopilotUrlToSearchUrl",(t="",n=!1)=>{if(t.endsWith("io")){const s=new URL(t);return s.hostname=s.hostname.replace(/^copilot\./,"api."),s.origin}return n?`https://staging.${this.CIMULATE_SEARCH_API_HOST}.ai`:`https://prod.${this.CIMULATE_SEARCH_API_HOST}.ai`});if(n&&r||!n&&!r)throw new Error("Provide exactly one authentication method: either 'apiKey' or 'apiToken', but not both.");n?this.headers[this.CIMULATE_API_HEADER]=n:r&&(this.headers.Authorization=`Bearer ${r}`),a&&(this.headers["x-cimulate-customer-id"]=a),u&&(this.headers["Tenant-ID"]=u),this.baseApiUrl=this._mapCopilotUrlToSearchUrl(t,s)}get apiUrl(){return`${this.baseApiUrl}/${this.CIMULATE_SEARCH_API_PATH}`}}class WA{constructor(t,n,r,s=!1,a,u){Qe(this,"apiService");Qe(this,"config",null);Qe(this,"getConfig",()=>Be(this,null,function*(){if(this.config)return this.config;try{const t=yield this.apiService.fetchConfig();return this.config=t,this.config}catch(t){throw console.error("Failed to fetch customer config:",t),t}}));Qe(this,"getPid",t=>this.getProductFieldValue(t,"pidCol"));Qe(this,"getName",t=>this.getProductFieldValue(t,"nameCol"));Qe(this,"getDescription",t=>this.getProductFieldValue(t,"description"));Qe(this,"getBrand",t=>this.getProductFieldValue(t,"productBrandCol"));Qe(this,"getPrice",t=>this.getProductFieldValue(t,"priceCol"));Qe(this,"getRelativePdp",t=>this.getProductFieldValue(t,"relativePdpCol"));Qe(this,"getPdp",t=>this.getProductFieldValue(t,"pdpCol"));Qe(this,"getImage",t=>this.getProductFieldValue(t,"imageCol"));Qe(this,"getProductHiddenFields",()=>{const t=this.getProductField("productHiddenFields");return Array.isArray(t)?t:[]});Qe(this,"getProductField",t=>this.config?this.config[t]:"");Qe(this,"getProductFieldValue",(t,n)=>{const r=this.getProductField(n);return r&&t[r]||""});this.apiService=new YA(t,n,r,s,a,u)}getPriceDisplay(t){const n=this.getPrice(t);return n?typeof n=="string"?n.includes("$")?n:`$${n}`:typeof n=="number"?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(n):n:""}}const GA={copilot:"Your Search Assistant",messaging:"Commerce Client"},Ng=R.createContext(null),XA=({mode:e,logoUrl:t,headerText:n,headerConfig:r,globalClassName:s="",entryMessage:a,openLinksInNewTab:u=!1,disclaimerText:l,disclaimerMarkdown:d,clientContext:f,baseCatalogParams:m,searchPlaceholder:p,searchButtonLabel:b,searchConfig:y,suggestionButtonConfig:_,progressStepsLimit:x=3,messageAlignment:A="start",autoScroll:S=!0,showProductDescription:C=!1,componentConfig:O,conversationHistory:z,resetConversationMessage:G="",apiKey:D,apiToken:V,baseUrl:J,customerId:se,tenantId:H,theme:ie,isDevelopment:te,__features:le,routingAttributes:fe,enableDownloadTranscript:ue=!0,enableEscalationToAgent:Se=!1,showProductCaptions:de=!1,staticQuestions:W,staticQuestionsStrategy:oe="append",children:k})=>{const M=e==="messaging",Z=R.useMemo(()=>{const Ge=fe==null?void 0:fe.isCartMgmtSupported;return Ge===!0||Ge==="true"},[fe]),P=R.useMemo(()=>M?{config:null}:new WA(J,D,V,te,se,H),[M,J,D,V,te,se,H]),xe=R.useMemo(()=>new NS(te),[te]);R.useEffect(()=>{M||!P||P.config||P.getConfig()},[P,M]);const Ie=R.useMemo(()=>MS(ie),[ie]),he=R.useMemo(()=>{const Ge=(y==null?void 0:y.placeholder)||p,et=(y==null?void 0:y.buttonLabel)||b;let mt="icon";return y!=null&&y.buttonType?mt=y.buttonType:b&&(mt="text"),ce(j({},y||{}),{placeholder:Ge,buttonLabel:et,buttonType:mt})},[y,p,b]),ve=R.useMemo(()=>ce(j({},r||{}),{logoUrl:t||(r==null?void 0:r.logoUrl),headerText:(r==null?void 0:r.headerText)||n||GA[e!=null?e:"copilot"]}),[r,t,n,e]),Fe=R.useMemo(()=>({configModule:P,mode:e!=null?e:"copilot",headerConfig:ve,entryMessage:a,staticQuestions:W||[],staticQuestionsStrategy:oe,globalClassName:s,openLinksInNewTab:u,disclaimerText:l,disclaimerMarkdown:d,clientContext:f,baseCatalogParams:m,themeVariables:Ie,logger:xe,searchConfig:he,suggestionButtonConfig:_,progressStepsLimit:x,messageAlignment:A,autoScroll:S,showProductDescription:!!C,enableMinimize:!!(O!=null&&O.enableMinimize),enableDownloadTranscript:ue,enableEscalationToAgent:Se,showProductCaptions:!!de,resetConversationMessage:G,conversationHistory:{sinceHours:typeof(z==null?void 0:z.sinceHours)=="number"?z.sinceHours:1,limit:z==null?void 0:z.limit},features:le,isCartMgmtSupported:Z}),[P,e,ve,a,W,oe,s,f,m,l,d,u,he,_,A,S,C,O,ue,Se,x,de,G,xe,Ie,z,le,Z]);return w.jsx(Ng.Provider,{value:Fe,children:k})},ft=()=>{const e=R.useContext(Ng);if(!e)throw new Error("useConfig must be used within a ConfigProvider");return e},Og=["markdown","product_carousel","product_tile","product_comparison","suggestions","cart","order_confirmation","tool_results"],ci=-1;function Ig(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=typeof t.text=="string"?t.text:"",r=typeof t.message=="string"?t.message:"";return n||r||null}function Pg(e){if(!e||!e.trim())return null;try{const t=JSON.parse(e);if(t&&typeof t=="object"){if(!Array.isArray(t)&&typeof t.type=="string"&&typeof t.index=="number"&&Og.includes(t.type))return t;const n=Ig(t);return n?{type:"markdown",index:ci,data:{content:n}}:null}}catch(t){}return{type:"markdown",index:ci,data:{content:e}}}function Rg(e){let t;try{t=JSON.parse(e)}catch(s){return null}if(!t||typeof t!="object"||Array.isArray(t))return null;const n=t;if(typeof n.type!="string"||!Og.includes(n.type))return null;const r=typeof n.index=="number"?n.index:0;return ce(j({},n),{type:n.type,index:r})}function Gu(e){let t;try{t=JSON.parse(e)}catch(n){return null}return t&&typeof t=="object"&&Array.isArray(t.response)?t:null}function KA(e){var s,a;if(e.type!=="markdown")return[e];const t=(a=(s=e.data)==null?void 0:s.content)!=null?a:"",n=Gu(t);if(n)return n.response;const r=Rg(t);return[r&&r.type!=="markdown"?r:e]}function QA(e,t){var n,r;return(r=(n=Gu(e))==null?void 0:n.response.some(s=>s.type===t))!=null?r:!1}function Lg(e){const t=e.trimStart();if(!t.startsWith("{")&&!t.startsWith("["))return!1;try{return JSON.parse(e),!1}catch(n){return!0}}function JA(e){return e.type==="markdown"&&e.index===ci?!Lg(e.data.content):!0}function ZA(e){var s;const t=(s=Gu(e))==null?void 0:s.response;if(!t)return null;const n=t.find(a=>a.type==="product_carousel");if(n)return{kind:"search",productIds:n.data.products.map(a=>a.id)};const r=t.find(a=>a.type==="product_tile");return r?{kind:"detail",productIds:[r.data.id]}:null}function ek(e,t){if(t.index===ci){const s=e[e.length-1];if(s&&s.type==="markdown"&&s.index===ci&&t.type==="markdown"){const a={type:"markdown",index:ci,data:{content:s.data.content+t.data.content}};return[...e.slice(0,-1),a]}return[...e,t]}const n=e.findIndex(s=>s.index===t.index);return[...n>=0?e.map((s,a)=>a===n?t:s):[...e,t]].sort((s,a)=>s.index-a.index)}function Dg(e,t){return t.serverId!==void 0&&e.some(n=>n.serverId===t.serverId)}const Mg={connectionStatus:"disconnected",loading:!1,conversationId:null,messages:[],streamingBlocks:[],isAgentTyping:!1,progressMessage:"",progressSteps:[],routingResult:null,error:null,sendError:null,sessionExpired:!1,cartUpdating:!1};function tk(e,t){switch(t.type){case"SET_CONNECTION_STATUS":return j(ce(j({},e),{connectionStatus:t.status}),t.status==="connected"||t.status==="connecting"?{error:null}:{});case"SET_LOADING":return ce(j({},e),{loading:t.isLoading});case"SET_CONVERSATION_ID":return ce(j({},e),{conversationId:t.id});case"ADD_MESSAGE":return Dg(e.messages,t.message)?e:ce(j({},e),{messages:[...e.messages,ce(j({},t.message),{type:"ADD_MESSAGE"})]});case"APPEND_STREAMING_TOKEN":{const n=Pg(t.token);return n?ce(j({},e),{streamingBlocks:ek(e.streamingBlocks,n)}):e}case"FLUSH_STREAMING":{const n={streamingBlocks:[],isAgentTyping:!1,loading:!1,progressMessage:"",progressSteps:[],sendError:null};if(Dg(e.messages,t.message))return j(j({},e),n);const r=ce(j({},t.message),{type:"FLUSH_STREAMING"}),s=t.replaceMessageId?e.messages.findIndex(a=>a.id===t.replaceMessageId):-1;if(s>=0){const a=[...e.messages];return a[s]=ce(j({},r),{id:e.messages[s].id}),j(ce(j({},e),{messages:a}),n)}return j(ce(j({},e),{messages:[...e.messages,r]}),n)}case"SET_AGENT_TYPING":return ce(j({},e),{isAgentTyping:t.isTyping,loading:t.isTyping});case"SET_PROGRESS_MESSAGE":return j(ce(j({},e),{progressMessage:t.message}),t.message===""?{progressSteps:[]}:{});case"ADD_PROGRESS_STEP":return e.progressSteps[e.progressSteps.length-1]===t.message?e:ce(j({},e),{progressSteps:[...e.progressSteps,t.message],progressMessage:t.message});case"SET_ROUTING_RESULT":return ce(j({},e),{routingResult:t.result});case"SET_ERROR":return ce(j({},e),{error:t.error,loading:!1,progressMessage:"",progressSteps:[]});case"SET_SEND_ERROR":return ce(j({},e),{sendError:t.error,loading:!1,progressMessage:"",progressSteps:[]});case"CLEAR_SEND_ERROR":return ce(j({},e),{sendError:null});case"LOAD_HISTORY":return ce(j({},e),{messages:t.messages,loading:!1});case"SET_SESSION_EXPIRED":return ce(j({},e),{sessionExpired:t.expired});case"SET_CART_UPDATING":return ce(j({},e),{cartUpdating:t.isUpdating});case"RESET":return ce(j({},Mg),{connectionStatus:e.connectionStatus});default:return e}}const Fg=R.createContext({connectionStatus:"disconnected",isConnected:!1,isAgentTyping:!1,conversationId:null,messages:[],streamingBlocks:[],progressMessage:"",progressSteps:[],loading:!0,cartUpdating:!1,error:null,sendError:null,sessionExpired:!1,canInitialize:!0,sendMessage:()=>Be(null,null,function*(){return{outcome:"failure",message:"Messaging is unavailable"}}),addToCart:()=>{},resetConversation:()=>Be(null,null,function*(){}),retryLastMessage:()=>{},retryConnection:()=>{},downloadTranscript:()=>Be(null,null,function*(){}),getAuthLinkKey:()=>Be(null,null,function*(){throw new Error("getAuthLinkKey called without a MessagingProvider")})}),nk=4320*60*1e3;function ef(e,t){return`cim_af_conv_${e}_${t}`}function tf(e,t){return Date.now()-e>t}function rk(e,t,n){try{const r=ef(e,t),s=sessionStorage.getItem(r);if(!s)return null;const a=JSON.parse(s);if(!a||typeof a!="object"||!("conversationId"in a)||!("storedAt"in a))return null;const u=a;return typeof u.conversationId!="string"||!u.conversationId?null:typeof u.storedAt!="number"||tf(u.storedAt,n)?(sessionStorage.removeItem(r),null):u}catch(r){return null}}function Xu(e,t,n){try{const r=ef(e,t),s={conversationId:n,storedAt:Date.now()};sessionStorage.setItem(r,JSON.stringify(s))}catch(r){}}function nf(e,t){try{const n=ef(e,t);sessionStorage.removeItem(n)}catch(n){}}function rf(e,t){return`cim_af_ct_${e}_${t}`}function ik(e){try{const t=e.split(".")[1];if(!t)return null;const n=JSON.parse(ok(t));return typeof n.exp=="number"?n.exp*1e3:null}catch(t){return null}}function sk(e){const t=ik(e);return t===null?"unknown":Date.now()>=t?"expired":"valid"}function ok(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(t.length+(4-t.length%4)%4,"=");return atob(n)}function Bg(e,t){try{const n=rf(e,t),r=sessionStorage.getItem(n);if(!r)return null;const s=JSON.parse(r);if(!s||typeof s!="object"||!("accessToken"in s)||!("lastEventId"in s)||!("storedAt"in s))return null;const a=s;return typeof a.accessToken!="string"||!a.accessToken||typeof a.lastEventId!="string"||!a.lastEventId||typeof a.storedAt!="number"?null:sk(a.accessToken)==="expired"?(sessionStorage.removeItem(n),null):a}catch(n){return null}}function ak(e,t,n,r){try{const s=rf(e,t),a={accessToken:n,lastEventId:r,storedAt:Date.now()};sessionStorage.setItem(s,JSON.stringify(a))}catch(s){}}function uk(e,t){try{const n=rf(e,t);sessionStorage.removeItem(n)}catch(n){}}function lk(e,t){return`cim_af_conv_${e}_${t}`}function ck(e,t){try{if(typeof BroadcastChannel=="undefined")return null;const n=lk(e,t);return new BroadcastChannel(n)}catch(n){return null}}function dk(e,t=500){return e?new Promise(n=>{let r=!1;const s=setTimeout(()=>{r||(r=!0,e.removeEventListener("message",a),n(null))},t);function a(u){var l;r||((l=u.data)==null?void 0:l.type)==="conversation_response"&&(r=!0,clearTimeout(s),e.removeEventListener("message",a),n({conversationId:u.data.conversationId,storedAt:u.data.storedAt,continuationToken:u.data.continuationToken,lastEventId:u.data.lastEventId}))}e.addEventListener("message",a);try{e.postMessage({type:"request_conversation"})}catch(u){r||(r=!0,clearTimeout(s),e.removeEventListener("message",a),n(null))}}):Promise.resolve(null)}function fk(e,t,n){if(!e)return()=>{};function r(s){var a;if((a=s.data)!=null&&a.type)switch(s.data.type){case"request_conversation":{const u=t();if(u!=null&&u.conversationId)try{e.postMessage({type:"conversation_response",conversationId:u.conversationId,storedAt:Date.now(),continuationToken:u.continuationToken,lastEventId:u.lastEventId})}catch(l){}break}case"conversation_cleared":{n==null||n();break}}}return e.addEventListener("message",r),()=>{e.removeEventListener("message",r)}}function hk(e){if(e)try{e.postMessage({type:"conversation_cleared"})}catch(t){}}function pk(e){if(e)try{e.close()}catch(t){}}function mk(e){switch(e){case"EndUser":case"Customer":return"user";case"Agent":case"Chatbot":return"agent";default:return"system"}}function gk(e){if(!e)return{};if(typeof e=="string")try{return JSON.parse(e)}catch(t){return{}}return e}function Ug(e,...t){let n=e;for(const r of t){if(n==null||typeof n!="object")return"";n=n[r]}return typeof n=="string"?n:""}function Ek(e){if(e.entryType!=="Message")return null;const n=gk(e.entryPayload).abstractMessage;if(!n)return null;const r=Ug(n,"staticContent","text")||Ug(n,"content","text")||"";if(!r)return null;const s=mk(e.sender.role);return{id:e.identifier,serverId:e.identifier,role:s,content:r,timestamp:new Date(e.transcriptedTimestamp).toISOString(),sender:{role:e.sender.role,name:e.senderDisplayName}}}function yk(e){const t=[];for(const n of e){const r=Ek(n);r&&t.push(r)}return t}const Tk=5e3;function Ku(e={}){const{routingAttributes:t,timeoutMs:n=Tk}=e;if(typeof window=="undefined"||typeof window.dispatchEvent!="function")return Promise.resolve(t);const r=j({},t!=null?t:{});return new Promise(s=>{const a={settled:!1},u=()=>{if(a.settled)return;a.settled=!0,a.timer!==void 0&&clearTimeout(a.timer);const m=Object.keys(r).length>0;s(m?r:t)},l={routingAttributes:t,setHiddenPrechatFields:m=>{a.settled||!m||Object.assign(r,m)},done:u},d=new CustomEvent(B0,{detail:l,cancelable:!0});if(!!window.dispatchEvent(d)){u();return}a.timer=setTimeout(u,n)})}const bk=200,wk=1e3;function _k(e){const{orgId:t,esDeveloperName:n,routingAttributes:r,conversationHistory:s}=e,a=R.useRef(null),u=R.useRef(null),l=R.useRef(null),d=s.sinceHours*60*60*1e3,f=nk,m=R.useCallback(()=>(l.current||(l.current=dk(a.current)),l.current),[]);R.useEffect(()=>{const S=ck(t,n);a.current=S,l.current=null;const C=fk(S,()=>{const O=u.current;if(!O)return null;const z=Bg(t,n);return{conversationId:O,continuationToken:z==null?void 0:z.accessToken,lastEventId:z==null?void 0:z.lastEventId}},()=>{nf(t,n),u.current=null});return()=>{C(),pk(S),a.current=null}},[t,n]);const p=R.useCallback((S,C)=>Be(null,null,function*(){var D,V,J;const O=(D=C==null?void 0:C.createIfMissing)!=null?D:!0,z=(V=C==null?void 0:C.isCurrent)!=null?V:(()=>!0);let G=rk(t,n,f);if(!G){const se=yield m();se&&!tf(se.storedAt,f)&&(G=se)}if(!G){if(!O)return{conversationId:null,restoredMessages:[],resumed:!1,outcome:"not-found-or-closed"};const se=yield Ku({routingAttributes:r});if(!z())return{conversationId:null,restoredMessages:[],resumed:!1,outcome:"unverified-error"};const H=yield S.createConversation(se);return z()?(Xu(t,n,H),u.current=H,{conversationId:H,restoredMessages:[],resumed:!1,outcome:"created"}):(yield S.endConversation(),{conversationId:null,restoredMessages:[],resumed:!1,outcome:"unverified-error"})}try{const se=yield S.listConversations({conversationId:G.conversationId,startTimestamp:Date.now()-f});if(!z())return{conversationId:null,restoredMessages:[],resumed:!1,outcome:"unverified-error"};const H=se.conversations.find(te=>te.conversationId===G.conversationId&&!te.isConversationClosed);if(!H){if(nf(t,n),!O)return{conversationId:null,restoredMessages:[],resumed:!1,outcome:"not-found-or-closed"};const te=yield Ku({routingAttributes:r});if(!z())return{conversationId:null,restoredMessages:[],resumed:!1,outcome:"unverified-error"};const le=yield S.createConversation(te);return z()?(Xu(t,n,le),u.current=le,{conversationId:le,restoredMessages:[],resumed:!1,outcome:"not-found-or-closed"}):(yield S.endConversation(),{conversationId:null,restoredMessages:[],resumed:!1,outcome:"unverified-error"})}S.resumeConversation(H.conversationId),u.current=H.conversationId,Xu(t,n,H.conversationId);let ie=[];try{const te=yield S.listConversationEntries(H.conversationId,{limit:Math.min((J=s.limit)!=null?J:bk,wk),startTimestamp:Date.now()-d,direction:"FromEnd"});ie=yk(te.conversationEntries).reverse()}catch(te){}return{conversationId:H.conversationId,restoredMessages:ie,resumed:!0,outcome:"resumed"}}catch(se){return{conversationId:G.conversationId,restoredMessages:[],resumed:!1,outcome:"unverified-error",error:se}}}),[t,n,r,s,d,f,m]),b=R.useCallback(S=>{Xu(t,n,S),u.current=S},[t,n]),y=R.useCallback(()=>{nf(t,n),uk(t,n),hk(a.current),u.current=null},[t,n]),_=R.useCallback(()=>{const S=Bg(t,n);return S?{continuationToken:S.accessToken,lastEventId:S.lastEventId}:null},[t,n]),x=R.useCallback(()=>Be(null,null,function*(){const S=yield m();return!(S!=null&&S.continuationToken)||tf(S.storedAt,f)?null:{continuationToken:S.continuationToken,lastEventId:S.lastEventId}}),[f,m]),A=R.useCallback((S,C=()=>!0)=>Be(null,null,function*(){try{const{accessToken:O,lastEventId:z}=yield S.generateContinuationToken();if(!C())return;ak(t,n,O,z)}catch(O){}}),[t,n]);return{initializeConversation:p,persistConversationId:b,clearPersistedConversation:y,getStoredConnectOptions:_,getPeerConnectOptions:x,persistContinuationToken:A}}const xk="Your session ended due to inactivity. Starting a new session…",Sk=300*1e3,vk=2e3,Ak=1e4,kk=15e3,Ck=2;function Hg(e,t,n){return e||t||n===!0}function ra(e){const t=e.find(r=>!r.timedOut),n=e[e.length-1];return t!=null?t:n}function Nk(e){const t=!e.timedOut,n=!!e.options.silent,r=!!e.options.reconcileMessageId;return t&&n&&r}function jg(e){if(!e||typeof e!="object")return!1;const t=e,n=t.type==="auth",r=t.type==="api"&&(t.statusCode===401||t.statusCode===403);return n||r}function sf(e){if(jg(e))return!0;const t=e instanceof Error?e.message:"";return/\(401\)/.test(t)}function Ok(e){var b;const t=e.productName||"this product",n=e.quantity&&e.quantity>1?e.quantity:void 0,r=((b=e.variants)!=null?b:[]).filter(y=>y.value),s=r.map(y=>`${y.label}: ${y.value}`).join(", "),a=r.map(y=>y.value).join(", "),u=s?` (${s})`:"",l=a?` (${a})`:"",d=n?`Add ${n} of`:"Add",f=e.sku?` [SKU: ${e.sku}]`:"",m=`${d} ${t} to my cart${u}${f}`,p=`Add ${n?`${n} × `:""}${t} to cart${l}`;return{prompt:m,display:p}}function Ik({connectionStatus:e,loading:t,hasMessages:n,sessionExpired:r,bootstrapSettled:s,resumeUsedLastEventId:a,recoverySteps:u,onExhausted:l,timeoutMs:d=kk,logger:f,isRecoveryInFlight:m}){const p=R.useRef(u);p.current=u;const b=R.useRef(l);b.current=l;const y=R.useRef(f);y.current=f;const _=R.useRef(m);_.current=m;const x=R.useRef(0),A=R.useRef(!1),S=R.useRef(0),[C,O]=R.useState(0);R.useEffect(()=>{if(!t||n){x.current=0,A.current=!1,S.current=0;return}const z=a||x.current>0;if(!(s&&z&&e==="connected"&&!r&&!A.current))return;const D=setTimeout(()=>{Be(null,null,function*(){var H,ie;if((H=_.current)!=null&&H.call(_)){if(S.current+=1,S.current>Ck){A.current=!0,b.current();return}O(te=>te+1);return}const V=x.current,J=p.current;if(V>=J.length){A.current=!0,b.current();return}S.current=0,(ie=y.current)==null||ie.warn("🦜 connect bootstrap stalled",{attempt:V});let se;try{yield Promise.race([Promise.resolve(J[V]()),new Promise((te,le)=>{se=setTimeout(()=>{le(new Error("connect bootstrap step timed out"))},d)})])}catch(te){}finally{se!==void 0&&clearTimeout(se),x.current=V+1,O(te=>te+1)}})},d);return()=>{clearTimeout(D)}},[e,t,n,r,s,a,d,C])}const Sr={default:"Something went wrong. Please try again.",server:"Something went wrong. Please try again.",rateLimit:"We are getting a lot of requests right now. Please try again in a moment.",network:"You are offline or we couldn't reach the assistant. Check connection and try again.",interrupted:"Something went wrong. Please try again.",connect:"You are offline or we couldn't reach the assistant. Check connection and try again.",lost:"You are offline or we couldn't reach the assistant. Check connection and try again.",routing:"Something went wrong. Please try again."};function Pk(e){if(!e||typeof e!="object")return{};const t=e;return{type:typeof t.type=="string"?t.type:void 0,statusCode:typeof t.statusCode=="number"?t.statusCode:void 0}}function di(e){const{type:t,statusCode:n}=Pk(e);if(t==="api"&&typeof n=="number")return n===429?Sr.rateLimit:n>=500?Sr.server:Sr.default;switch(t){case"network":return Sr.network;case"sse":return Sr.interrupted;case"auth":return Sr.connect;default:return Sr.default}}function zg(e){switch(e.code){case"MAX_RECONNECT":return Sr.lost;case"ROUTING_FAILED":return Sr.routing;default:return Sr.connect}}let Gi=null;function Rk(e){Gi&&Gi!==e&&console.warn("[CimulateMessaging] A messaging API is already registered; overwriting it. Mounting more than one messaging widget per page is not supported."),Gi=e}function Lk(e){Gi===e&&(Gi=null)}function Dk(){if(!Gi)throw new Error("Cimulate messaging widget is not ready. Call this after injectMessagingWidget() has run and the widget has mounted.");return Gi}const ia=Symbol("initialization-cancelled"),$g=({scrt2Url:e,orgId:t,esDeveloperName:n,routingAttributes:r,capabilitiesVersion:s,enableLogging:a=!1,onConnect:u,onMessage:l,onError:d,onProductResult:f,children:m})=>{const{logger:p,conversationHistory:b}=ft(),{status:{isOpen:y}}=Vr(),[_,x]=R.useReducer(tk,Mg),[A,S]=R.useState(!1),[C,O]=R.useState(!1),[z,G]=R.useState(!1),D=R.useRef(_);D.current=_;const V=_k({orgId:t,esDeveloperName:n,routingAttributes:r,conversationHistory:b}),J=R.useRef(null),se=R.useRef(l),H=R.useRef(d),ie=R.useRef(u),te=R.useRef(f),le=R.useRef(!1),fe=R.useRef(!1),ue=R.useRef(!1),Se=R.useRef(0),de=R.useRef(0),W=R.useRef(0),oe=R.useRef(null),k=R.useRef(null),M=R.useRef(null),Z=R.useRef(0),P=R.useRef(!1),xe=R.useRef(0),Ie=R.useRef(0),he=R.useRef(()=>Promise.reject(new Error("Messaging is unavailable"))),ve=R.useRef([]),Fe=R.useRef(null),Ge=R.useCallback(()=>{x({type:"SET_CART_UPDATING",isUpdating:ve.current.some(Nk)})},[]),et=R.useCallback((re,Ae)=>{Ae.outcome==="timeout"?(re.timedOut=!0,ve.current=ve.current.filter(ke=>ke===re||!ke.timedOut)):ve.current=ve.current.filter(ke=>ke!==re),clearTimeout(re.timeoutId),Ge(),re.resolve(Ae)},[Ge]);se.current=l,H.current=d,ie.current=u,te.current=f,R.useEffect(()=>{const re=new DS({baseURL:e,orgId:t,esDeveloperName:n,options:j({enableLogging:a},s?{capabilitiesVersion:s}:{})});J.current=re,P.current=!1,G(!1),S(!1),O(!1),x({type:"RESET"}),re.on("connected",()=>{var ye;x({type:"SET_CONNECTION_STATUS",status:"connected"}),(ye=ie.current)==null||ye.call(ie)}),re.on("disconnected",()=>{x({type:"SET_CONNECTION_STATUS",status:"disconnected"})}),re.on("reconnecting",()=>{x({type:"SET_CONNECTION_STATUS",status:"reconnecting"})}),re.on("message",ye=>{var Jr,Zr;const Le=ce(j({id:ye.messageId||crypto.randomUUID()},ye.messageId?{serverId:ye.messageId}:{}),{role:"agent",content:ye.content,timestamp:ye.timestamp,sender:ye.sender,raw:ye});p==null||p.log("🦜 MessagingProvider message received (FLUSH_STREAMING)",{messageId:Le.id,tokensBeforeFlush:Se.current,streamedFinalOnly:Se.current===0}),Se.current=0;const tt=ra(ve.current),Ot=tt==null?void 0:tt.options.reconcileMessageId;x({type:"FLUSH_STREAMING",message:Le,replaceMessageId:Ot}),(Jr=se.current)==null||Jr.call(se,Le),tt&&et(tt,{outcome:"success"});const{messagingSessionId:Wt}=ye,Mr=Wt?ZA(ye.content):null;Wt&&Mr&&((Zr=te.current)==null||Zr.call(te,{agentSessionId:Wt,kind:Mr.kind,productIds:Mr.productIds}))}),re.on("streaming_token",ye=>{var Le;if(!((Le=ra(ve.current))!=null&&Le.options.silent)){if(Se.current+=1,p!=null&&p.isDevelopment){const tt=Pg(ye.token);tt?tt.index===ci?p.debug("🦜 streaming_token → markdown fallback",{token:ye.token}):p.debug("🦜 streaming_token parsed",{type:tt.type,index:tt.index,outputName:tt.type==="tool_results"?tt.output_name:void 0}):p.debug("🦜 streaming_token dropped (empty or unrecognized payload shape)",{token:ye.token})}x({type:"APPEND_STREAMING_TOKEN",token:ye.token})}}),re.on("typing_started",()=>{var ye;(ye=ra(ve.current))!=null&&ye.options.silent||x({type:"SET_AGENT_TYPING",isTyping:!0})}),re.on("typing_stopped",()=>{var ye;(ye=ra(ve.current))!=null&&ye.options.silent||x({type:"SET_AGENT_TYPING",isTyping:!1})}),re.on("progress_indicator",ye=>{var Le;(Le=ra(ve.current))!=null&&Le.options.silent||x({type:"ADD_PROGRESS_STEP",message:ye.message})}),re.on("routing_result",ye=>{var Le;if(x({type:"SET_ROUTING_RESULT",result:ye}),!ye.isSuccessful){const tt=`Routing failed: ${ye.failureType||"unknown"}`;x({type:"SET_ERROR",error:zg({code:"ROUTING_FAILED"})}),x({type:"SET_CONNECTION_STATUS",status:"error"}),(Le=H.current)==null||Le.call(H,tt)}}),re.on("participant_changed",ye=>{if(ye.participant.name==="Automated Process")return;const Le=ce(j({id:crypto.randomUUID()},ye.entryId?{serverId:ye.entryId}:{}),{role:"system",content:ye.action==="add"?`${ye.participant.name||"Agent"} joined the conversation`:`${ye.participant.name||"Agent"} left the conversation`,timestamp:new Date().toISOString()});p==null||p.log("🦜 MessagingProvider participant_changed event received",{event:ye}),x({type:"ADD_MESSAGE",message:Le})}),re.on("conversation_closed",()=>{const ye={id:crypto.randomUUID(),role:"system",content:"Conversation reset",timestamp:new Date().toISOString()};x({type:"ADD_MESSAGE",message:ye}),x({type:"SET_CONVERSATION_ID",id:null}),V.clearPersistedConversation()}),re.on("error",ye=>{var Le;if(p==null||p.log("🦜 MessagingProvider ERROR event received",{event:ye}),ye.code==="SESSION_EXPIRED"){ue.current=!0,x({type:"SET_SESSION_EXPIRED",expired:!0}),x({type:"SET_CONNECTION_STATUS",status:"disconnected"}),x({type:"SET_LOADING",isLoading:!1});return}x({type:"SET_ERROR",error:zg(ye)}),ye.recoverable||x({type:"SET_CONNECTION_STATUS",status:"error"}),(Le=H.current)==null||Le.call(H,ye.message)});const Ae=ye=>{if(ye!==xe.current)throw ia},ke=ye=>ye===xe.current,Ne=ye=>Be(null,null,function*(){S(!1);let Le=V.getStoredConnectOptions(),tt=!1;Le||(Le=yield V.getPeerConnectOptions(),Ae(ye),tt=!!Le);let Ot=!1;try{if(yield re.connect(Le!=null?Le:void 0),!ke(ye))throw re.disconnect(),ia;Ot=!!(Le!=null&&Le.lastEventId)}catch(Mr){if(Ae(ye),Le&&sf(Mr)){if(p==null||p.log("Stored token expired on connect — falling back to fresh connect"),tt||V.clearPersistedConversation(),yield re.connect(),!ke(ye))throw re.disconnect(),ia;Ot=!1}else throw Mr}O(Ot),yield V.persistContinuationToken(re,()=>ke(ye)),Ae(ye);const Wt=yield V.initializeConversation(re,{isCurrent:()=>ke(ye)});if(Ae(ye),p==null||p.log("🦜 initial connect complete",{conversationId:Wt.conversationId,resumed:Wt.resumed,outcome:Wt.outcome,restoredMessages:Wt.restoredMessages.length}),Wt.outcome==="unverified-error"){Wt.conversationId&&(re.resumeConversation(Wt.conversationId),x({type:"SET_CONVERSATION_ID",id:Wt.conversationId})),S(!0);return}x({type:"SET_CONVERSATION_ID",id:Wt.conversationId}),Wt.resumed&&x({type:"LOAD_HISTORY",messages:Wt.restoredMessages}),S(!0),x({type:"SET_LOADING",isLoading:!1})});return k.current=Ne,()=>{xe.current+=1,Ie.current+=1,re.disconnect(),re.off(),J.current=null,k.current=null,M.current=null,P.current=!1}},[e,t,n,s,et]);const mt=R.useCallback(()=>{if(P.current)return Promise.resolve();if(M.current)return Z.current===xe.current?M.current:M.current.catch(Ne=>{if(Ne!==ia)throw Ne}).then(()=>he.current());const re=k.current;if(!re)return Promise.reject(new Error("Messaging is unavailable"));x({type:"SET_LOADING",isLoading:!0}),x({type:"SET_CONNECTION_STATUS",status:"connecting"});const Ae=++xe.current;Z.current=Ae;const ke=re(Ae).then(()=>{P.current=!0,G(!0)}).catch(Ne=>{var Le;if(Ne===ia)throw Ne;const ye=Ne instanceof Error?Ne.message:String(Ne);throw x({type:"SET_CONNECTION_STATUS",status:"error"}),x({type:"SET_ERROR",error:di(Ne)}),(Le=H.current)==null||Le.call(H,ye),Ne}).finally(()=>{M.current===ke&&(M.current=null)});return M.current=ke,ke},[]);he.current=mt,R.useEffect(()=>{y&&mt().catch(()=>{})},[y,e,t,n,s,mt]);const Lt=R.useCallback(()=>Be(null,null,function*(){const re=J.current;if(!re)return!1;const Ae=V.getStoredConnectOptions();if(!Ae)return p==null||p.log("🦜 attemptResume: no stored identity — cannot resume, will start fresh"),!1;p==null||p.log("🦜 attemptResume: reconnecting on stored identity via continuation token");try{re.disconnect(),yield re.connect(Ae)}catch(Ne){if(sf(Ne))return p==null||p.log("🦜 attemptResume: token expired (401) — will start fresh",{error:Ne instanceof Error?Ne.message:String(Ne)}),!1;throw p==null||p.log("🦜 attemptResume: transient connect failure — rethrowing, session kept",{error:Ne instanceof Error?Ne.message:String(Ne)}),Ne}yield V.persistContinuationToken(re);const ke=yield V.initializeConversation(re,{createIfMissing:!1});return ke.outcome==="not-found-or-closed"||!ke.conversationId?(p==null||p.log("🦜 attemptResume: conversation no longer resumable (closed/not found) — will start fresh"),!1):(ke.outcome==="unverified-error"&&(p==null||p.log("🦜 attemptResume: resume validation failed transiently — keeping live session, resuming optimistically",{conversationId:ke.conversationId}),re.resumeConversation(ke.conversationId)),p==null||p.log("🦜 attemptResume: resumed conversation on same identity",{conversationId:ke.conversationId}),x({type:"SET_CONVERSATION_ID",id:ke.conversationId}),x({type:"SET_CONNECTION_STATUS",status:"connected"}),V.persistConversationId(ke.conversationId),ue.current=!1,x({type:"SET_SESSION_EXPIRED",expired:!1}),!0)}),[V,p]),pn=R.useCallback(re=>Be(null,null,function*(){var ke;const Ae=J.current;if(Ae){re.options.silent||(x({type:"SET_LOADING",isLoading:!0}),x({type:"SET_PROGRESS_MESSAGE",message:""}));try{yield Ae.sendMessage(re.text)}catch(Ne){const ye=di(Ne);x({type:"SET_SEND_ERROR",error:{text:re.text,displayContent:re.displayContent,options:re.options,message:ye}}),(ke=H.current)==null||ke.call(H,Ne instanceof Error?Ne.message:String(Ne)),et(re,{outcome:"failure",message:ye})}}}),[et]),wn=R.useCallback(re=>Be(null,null,function*(){var ke;const Ae=J.current;if(!(!Ae||le.current)){le.current=!0,fe.current=!0;try{if(yield Lt()){re&&(yield pn(re));return}p==null||p.log("🦜 recoverExpiredSession: resume failed — starting a new session + conversation"),ue.current=!1,x({type:"SET_SESSION_EXPIRED",expired:!1}),x({type:"ADD_MESSAGE",message:{id:crypto.randomUUID(),role:"system",content:xk,timestamp:new Date().toISOString()}}),V.clearPersistedConversation(),x({type:"SET_CONNECTION_STATUS",status:"connecting"}),Ae.disconnect(),yield Ae.connect(),yield V.persistContinuationToken(Ae);const Ne=yield Ae.createConversation(yield Ku({routingAttributes:r}));p==null||p.log("🦜 recoverExpiredSession: new conversation created",{conversationId:Ne}),x({type:"SET_CONVERSATION_ID",id:Ne}),x({type:"SET_CONNECTION_STATUS",status:"connected"}),V.persistConversationId(Ne),re&&(yield pn(re))}catch(Ne){const ye=Ne instanceof Error?Ne.message:String(Ne);x({type:"SET_ERROR",error:di(Ne)}),x({type:"SET_CONNECTION_STATUS",status:"error"}),(ke=H.current)==null||ke.call(H,ye),re&&et(re,{outcome:"failure",message:di(Ne)})}finally{le.current=!1,fe.current=!1}}}),[r,V,Lt,pn,p,et]),Dt=R.useRef(wn);Dt.current=wn;const ze=R.useCallback(()=>Be(null,null,function*(){const re=J.current;if(!re||!P.current||le.current)return;if(!D.current.conversationId&&!ue.current){re.reconnect();return}le.current=!0;const Ae=Be(null,null,function*(){try{(yield Lt())||(ue.current=!0,x({type:"SET_SESSION_EXPIRED",expired:!0}),x({type:"SET_CONNECTION_STATUS",status:"disconnected"}))}catch(ke){ue.current=!0,x({type:"SET_SESSION_EXPIRED",expired:!0}),x({type:"SET_CONNECTION_STATUS",status:"disconnected"})}finally{le.current=!1,oe.current=null}});oe.current=Ae,yield Ae}),[Lt]),Ce=R.useRef(ze);Ce.current=ze;const Xe=R.useCallback(()=>Be(null,null,function*(){const re=J.current;if(!re||le.current)return;const Ae=V.getStoredConnectOptions(),ke=Ae==null?void 0:Ae.continuationToken;if(ke){le.current=!0;try{re.disconnect(),yield re.connect({continuationToken:ke}),yield V.persistContinuationToken(re);const Ne=D.current.conversationId;Ne&&re.resumeConversation(Ne)}catch(Ne){if(sf(Ne)){ue.current=!0,x({type:"SET_SESSION_EXPIRED",expired:!0}),x({type:"SET_CONNECTION_STATUS",status:"disconnected"}),x({type:"SET_LOADING",isLoading:!1});return}p==null||p.log("🦜 reconnectOmittingLastEventId: transient connect failure — session kept",{error:Ne instanceof Error?Ne.message:String(Ne)})}finally{le.current=!1}}}),[V,p]);R.useEffect(()=>{const re=()=>{const tt=Date.now();tt-W.current<vk||(W.current=tt,Ce.current())},Ae=()=>{if(document.visibilityState==="hidden"){de.current=Date.now();return}const tt=J.current;if(!tt)return;const Ot=de.current?Date.now()-de.current:0;de.current=0,(ue.current||!tt.isConnected||Ot>Sk)&&re()},ke=tt=>{tt.persisted&&re()},Ne=()=>{de.current=Date.now()},ye=()=>re(),Le=()=>re();return document.addEventListener("visibilitychange",Ae),window.addEventListener("pageshow",ke),window.addEventListener("pagehide",Ne),document.addEventListener("resume",ye),window.addEventListener("online",Le),()=>{document.removeEventListener("visibilitychange",Ae),window.removeEventListener("pageshow",ke),window.removeEventListener("pagehide",Ne),document.removeEventListener("resume",ye),window.removeEventListener("online",Le)}},[]);const nt=R.useCallback((re,Ae)=>Be(null,null,function*(){var Ne;const ke=J.current;if(!ke){et(re,{outcome:"failure",message:"Messaging is unavailable"});return}if(ue.current){yield Dt.current(re);return}try{yield ke.sendMessage(re.text)}catch(ye){if(jg(ye)){yield Dt.current(re);return}const Le=di(ye);x({type:"SET_SEND_ERROR",error:Ae(Le)}),(Ne=H.current)==null||Ne.call(H,ye instanceof Error?ye.message:String(ye)),et(re,{outcome:"failure",message:Le})}}),[et]),pt=R.useCallback(re=>Be(null,null,function*(){const Ae=oe.current;Ae&&(yield Ae),yield re()}),[]),Mt=R.useCallback((re,Ae,ke={})=>new Promise(Ne=>{if(!J.current){Ne({outcome:"failure",message:"Messaging is unavailable"});return}const Le={};Object.assign(Le,{text:re,displayContent:Ae,options:ke,resolve:Ne,timeoutId:setTimeout(()=>{x({type:"SET_LOADING",isLoading:!1}),et(Le,{outcome:"timeout"})},Ak)}),ve.current.push(Le),Ge(),x({type:"CLEAR_SEND_ERROR"}),ke.silent||(x({type:"ADD_MESSAGE",message:{id:crypto.randomUUID(),role:"user",content:Ae!=null?Ae:re,timestamp:new Date().toISOString()}}),x({type:"SET_LOADING",isLoading:!0}),x({type:"SET_PROGRESS_MESSAGE",message:""})),pt(()=>nt(Le,tt=>({text:re,displayContent:Ae,options:ke,message:tt})))}),[nt,pt,et,Ge]),Ln=R.useCallback((re,Ae)=>{if(!re.trim())return Promise.resolve({outcome:"failure",message:"Message is empty"});const ke=Ie.current,Ne=()=>{const tt=()=>ke!==Ie.current?Promise.resolve({outcome:"failure",message:"Message cancelled"}):Mt(re,Ae==null?void 0:Ae.displayContent,Ae);return P.current?tt():mt().then(tt,Ot=>({outcome:"failure",message:di(Ot)}))},ye=Fe.current?Fe.current.then(Ne):Ne(),Le=ye.then(()=>{});return Fe.current=Le,Le.finally(()=>{Fe.current===Le&&(Fe.current=null)}),ye},[Mt,mt]),gs=R.useCallback(re=>{if(!J.current)return;const Ae=Ie.current,{prompt:ke,display:Ne}=Ok(re);mt().then(()=>{if(Ae===Ie.current)return Mt(ke,Ne)}).catch(()=>{})},[Mt,mt]),Es=R.useCallback(()=>{const re=J.current,Ae=D.current.sendError;if(!re||!Ae)return;const ke=()=>fe.current?Promise.resolve({outcome:"failure",message:Ae.message}):Mt(Ae.text,Ae.displayContent,Ae.options),Ne=Fe.current?Fe.current.then(ke):ke(),ye=Ne.then(()=>{});return Fe.current=ye,ye.finally(()=>{Fe.current===ye&&(Fe.current=null)}),Ne},[Mt]),ys=R.useCallback(()=>{const re=J.current;re&&(M.current||(ue.current=!1,P.current=!1,G(!1),re.disconnect(),x({type:"SET_CONNECTION_STATUS",status:"connecting"}),mt().catch(()=>{})))},[mt]),ae=R.useCallback(()=>{const re=J.current;if(!re)return Promise.resolve();if(!P.current)return xe.current+=1,Ie.current+=1,re.disconnect(),V.clearPersistedConversation(),x({type:"RESET"}),Promise.resolve();const Ae=++Ie.current;return ue.current=!1,O(!1),V.clearPersistedConversation(),x({type:"RESET"}),x({type:"SET_LOADING",isLoading:!0}),x({type:"SET_CONNECTION_STATUS",status:"connecting"}),re.endConversation().then(()=>Ae!==Ie.current||J.current!==re?null:(re.disconnect(),re.connect().then(()=>re))).then(ke=>Be(null,null,function*(){return!ke||Ae!==Ie.current||(yield V.persistContinuationToken(ke,()=>Ae===Ie.current&&J.current===ke),Ae!==Ie.current||J.current!==ke)?null:re.createConversation(yield Ku({routingAttributes:r}))})).then(ke=>{!ke||Ae!==Ie.current||J.current!==re||(x({type:"SET_CONVERSATION_ID",id:ke}),x({type:"SET_CONNECTION_STATUS",status:"connected"}),V.persistConversationId(ke))}).catch(ke=>{var Ne;Ae!==Ie.current||J.current!==re||(x({type:"SET_ERROR",error:di(ke)}),x({type:"SET_CONNECTION_STATUS",status:"error"}),(Ne=H.current)==null||Ne.call(H,ke.message))})},[r,V]);Ik({connectionStatus:_.connectionStatus,loading:_.loading,hasMessages:_.messages.length>0,sessionExpired:_.sessionExpired,bootstrapSettled:A,resumeUsedLastEventId:C,recoverySteps:[Xe,ae],onExhausted:()=>{var Ae;const re=di({type:"network"});x({type:"SET_ERROR",error:re}),x({type:"SET_CONNECTION_STATUS",status:"error"}),(Ae=H.current)==null||Ae.call(H,re)},logger:p,isRecoveryInFlight:()=>le.current||oe.current!==null});const _e=R.useCallback(()=>Be(null,null,function*(){var Ne;const re=J.current;if(!re||!D.current.conversationId)return;const Ae=yield re.retrieveConversationTranscript(),ke=URL.createObjectURL(Ae);try{const ye=document.createElement("a");ye.href=ke,ye.download=`transcript-${(Ne=re.conversationId)!=null?Ne:"conversation"}.pdf`,document.body.appendChild(ye),ye.click(),ye.remove()}finally{URL.revokeObjectURL(ke)}}),[]),$e=R.useCallback(()=>Be(null,null,function*(){const re=J.current;if(!re)throw new Error("getAuthLinkKey called before the messaging client connected");return p==null||p.debug("🦜 getAuthLinkKey: requesting single-use auth link key"),re.getAuthLinkKey()}),[p]);R.useEffect(()=>{const re={getAuthLinkKey:$e};return Rk(re),()=>Lk(re)},[$e]);const Ze=_.connectionStatus==="connected"&&_.conversationId!==null;R.useEffect(()=>{U0(Ze)},[Ze]),R.useEffect(()=>()=>U0(!1),[]);const at=R.useMemo(()=>({connectionStatus:_.connectionStatus,isConnected:Ze,isAgentTyping:_.isAgentTyping,conversationId:_.conversationId,messages:_.messages,streamingBlocks:_.streamingBlocks,progressMessage:_.progressMessage,progressSteps:_.progressSteps,error:_.error,sendError:_.sendError,canInitialize:!z&&_.error===null,loading:_.loading,sessionExpired:_.sessionExpired,cartUpdating:_.cartUpdating,sendMessage:Ln,addToCart:gs,resetConversation:ae,retryLastMessage:Es,retryConnection:ys,downloadTranscript:_e,getAuthLinkKey:$e}),[_,Ze,z,Ln,gs,ae,Es,ys,_e,$e]);return w.jsx(Fg.Provider,{value:at,children:m})};var Vg=Symbol.for("immer-nothing"),qg=Symbol.for("immer-draftable"),jn=Symbol.for("immer-state");function ur(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var zs=Object.getPrototypeOf;function $s(e){return!!e&&!!e[jn]}function Xi(e){var t;return e?Yg(e)||Array.isArray(e)||!!e[qg]||!!((t=e.constructor)!=null&&t[qg])||sa(e)||Zu(e):!1}var Mk=Object.prototype.constructor.toString();function Yg(e){if(!e||typeof e!="object")return!1;const t=zs(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Mk}function Qu(e,t){Ju(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Ju(e){const t=e[jn];return t?t.type_:Array.isArray(e)?1:sa(e)?2:Zu(e)?3:0}function of(e,t){return Ju(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Wg(e,t,n){const r=Ju(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Fk(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function sa(e){return e instanceof Map}function Zu(e){return e instanceof Set}function Ki(e){return e.copy_||e.base_}function af(e,t){if(sa(e))return new Map(e);if(Zu(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Yg(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[jn];let s=Reflect.ownKeys(r);for(let a=0;a<s.length;a++){const u=s[a],l=r[u];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(r[u]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[u]})}return Object.create(zs(e),r)}else{const r=zs(e);if(r!==null&&n)return j({},e);const s=Object.create(r);return Object.assign(s,e)}}function uf(e,t=!1){return tl(e)||$s(e)||!Xi(e)||(Ju(e)>1&&Object.defineProperties(e,{set:{value:el},add:{value:el},clear:{value:el},delete:{value:el}}),Object.freeze(e),t&&Object.values(e).forEach(n=>uf(n,!0))),e}function el(){ur(2)}function tl(e){return Object.isFrozen(e)}var Bk={};function Qi(e){const t=Bk[e];return t||ur(0,e),t}var oa;function Gg(){return oa}function Uk(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Xg(e,t){t&&(Qi("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function lf(e){cf(e),e.drafts_.forEach(Hk),e.drafts_=null}function cf(e){e===oa&&(oa=e.parent_)}function Kg(e){return oa=Uk(oa,e)}function Hk(e){const t=e[jn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Qg(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[jn].modified_&&(lf(t),ur(4)),Xi(e)&&(e=nl(t,e),t.parent_||rl(t,e)),t.patches_&&Qi("Patches").generateReplacementPatches_(n[jn].base_,e,t.patches_,t.inversePatches_)):e=nl(t,n,[]),lf(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Vg?e:void 0}function nl(e,t,n){if(tl(t))return t;const r=t[jn];if(!r)return Qu(t,(s,a)=>Jg(e,r,t,s,a,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return rl(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const s=r.copy_;let a=s,u=!1;r.type_===3&&(a=new Set(s),s.clear(),u=!0),Qu(a,(l,d)=>Jg(e,r,s,l,d,n,u)),rl(e,s,!1),n&&e.patches_&&Qi("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Jg(e,t,n,r,s,a,u){if($s(s)){const l=a&&t&&t.type_!==3&&!of(t.assigned_,r)?a.concat(r):void 0,d=nl(e,s,l);if(Wg(n,r,d),$s(d))e.canAutoFreeze_=!1;else return}else u&&n.add(s);if(Xi(s)&&!tl(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;nl(e,s),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(sa(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&rl(e,s)}}function rl(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&uf(t,n)}function jk(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Gg(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=r,a=df;n&&(s=[r],a=aa);const{revoke:u,proxy:l}=Proxy.revocable(s,a);return r.draft_=l,r.revoke_=u,l}var df={get(e,t){if(t===jn)return e;const n=Ki(e);if(!of(n,t))return zk(e,n,t);const r=n[t];return e.finalized_||!Xi(r)?r:r===ff(e.base_,t)?(pf(e),e.copy_[t]=mf(r,e)):r},has(e,t){return t in Ki(e)},ownKeys(e){return Reflect.ownKeys(Ki(e))},set(e,t,n){const r=Zg(Ki(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const s=ff(Ki(e),t),a=s==null?void 0:s[jn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Fk(n,s)&&(n!==void 0||of(e.base_,t)))return!0;pf(e),hf(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return ff(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,pf(e),hf(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Ki(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ur(11)},getPrototypeOf(e){return zs(e.base_)},setPrototypeOf(){ur(12)}},aa={};Qu(df,(e,t)=>{aa[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),aa.deleteProperty=function(e,t){return aa.set.call(this,e,t,void 0)},aa.set=function(e,t,n){return df.set.call(this,e[0],t,n,e[0])};function ff(e,t){const n=e[jn];return(n?Ki(n):e)[t]}function zk(e,t,n){var s;const r=Zg(t,n);return r?"value"in r?r.value:(s=r.get)==null?void 0:s.call(e.draft_):void 0}function Zg(e,t){if(!(t in e))return;let n=zs(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=zs(n)}}function hf(e){e.modified_||(e.modified_=!0,e.parent_&&hf(e.parent_))}function pf(e){e.copy_||(e.copy_=af(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var $k=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const u=this;return function(d=a,...f){return u.produce(d,m=>n.call(this,m,...f))}}typeof n!="function"&&ur(6),r!==void 0&&typeof r!="function"&&ur(7);let s;if(Xi(t)){const a=Kg(this),u=mf(t,void 0);let l=!0;try{s=n(u),l=!1}finally{l?lf(a):cf(a)}return Xg(a,r),Qg(s,a)}else if(!t||typeof t!="object"){if(s=n(t),s===void 0&&(s=t),s===Vg&&(s=void 0),this.autoFreeze_&&uf(s,!0),r){const a=[],u=[];Qi("Patches").generateReplacementPatches_(t,s,a,u),r(a,u)}return s}else ur(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(u,...l)=>this.produceWithPatches(u,d=>t(d,...l));let r,s;return[this.produce(t,n,(u,l)=>{r=u,s=l}),r,s]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Xi(e)||ur(8),$s(e)&&(e=Vk(e));const t=Kg(this),n=mf(e,void 0);return n[jn].isManual_=!0,cf(t),n}finishDraft(e,t){const n=e&&e[jn];(!n||!n.isManual_)&&ur(9);const{scope_:r}=n;return Xg(r,t),Qg(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const s=t[n];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}n>-1&&(t=t.slice(n+1));const r=Qi("Patches").applyPatches_;return $s(e)?r(e,t):this.produce(e,s=>r(s,t))}};function mf(e,t){const n=sa(e)?Qi("MapSet").proxyMap_(e,t):Zu(e)?Qi("MapSet").proxySet_(e,t):jk(e,t);return(t?t.scope_:Gg()).drafts_.push(n),n}function Vk(e){return $s(e)||ur(10,e),e1(e)}function e1(e){if(!Xi(e)||tl(e))return e;const t=e[jn];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=af(e,t.scope_.immer_.useStrictShallowCopy_)}else n=af(e,!0);return Qu(n,(r,s)=>{Wg(n,r,e1(s))}),t&&(t.finalized_=!1),n}var qk=new $k,Yk=qk.produce;function Wk(e,t,n){var r=R.useMemo(function(){return Yk(e)},[e]);return R.useReducer(r,t,n)}const Gk=e=>Array.from(new Set((e!=null?e:[]).map(t=>t.trim()).filter(Boolean))),t1=R.createContext(null),n1=R.createContext(null),Xk=({children:e,dispatch:t})=>{const n=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_INITIALIZED,payload:_})},[t]),r=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_OPEN,payload:_})},[t]),s=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_INLINE,payload:_})},[t]),a=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_ELEMENT_ID,payload:_})},[t]),u=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_ENTRY_TYPE,payload:_})},[t]),l=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID,payload:_})},[t]),d=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_USER_PROMPT,payload:_})},[t]),f=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_PARAMS,payload:_})},[t]),m=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_PROMPTS_MESSAGE,payload:_})},[t]),p=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_RESPONSE_MESSAGE,payload:_})},[t]),b=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_RESPONSE_LOADING,payload:_})},[t]),y=R.useMemo(()=>({setIsInitialized:n,setIsOpen:r,setIsInline:s,setElementId:a,setEntryType:u,setActivePromptsId:l,setUserPrompt:d,setParams:f,setPromptsMessage:m,setResponseMessage:p,setIsResponseLoading:b}),[n,r,s,a,u,l,d,f,m,p,b]);return w.jsx(n1.Provider,{value:y,children:e})},Kk=(e,t)=>{const{type:n,payload:r}=t;switch(n){case bt.SET_PROMPTS_EXTENSION_INITIALIZED:e.isInitialized=r;break;case bt.SET_PROMPTS_EXTENSION_OPEN:e.isOpen=r;break;case bt.SET_PROMPTS_EXTENSION_INLINE:e.isInline=r;break;case bt.SET_PROMPTS_EXTENSION_ELEMENT_ID:e.elementId=r;break;case bt.SET_PROMPTS_EXTENSION_ENTRY_TYPE:e.entryType=r;break;case bt.SET_PROMPTS_EXTENSION_PARAMS:e.params=r;break;case bt.RESET_PROMPTS_EXTENSION_PARAMS:e.params=null;break;case bt.SET_PROMPTS_EXTENSION_USER_PROMPT:e.userPrompt=r;break;case bt.SET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID:e.activePromptsId=r;break;case bt.RESET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID:e.activePromptsId=null;break;case bt.SET_PROMPTS_EXTENSION_PROMPTS_MESSAGE:e.promptsMessage=r;break;case bt.RESET_PROMPTS_EXTENSION_PROMPTS_MESSAGE:e.promptsMessage=null;break;case bt.SET_PROMPTS_EXTENSION_RESPONSE_MESSAGE:e.responseMessage=r;break;case bt.RESET_PROMPTS_EXTENSION_RESPONSE_MESSAGE:e.responseMessage=null;break;case bt.SET_PROMPTS_EXTENSION_RESPONSE_LOADING:e.isResponseLoading=r;break}},Qk=({promptsConfig:e,children:t})=>{const[n,r]=Wk(Kk,ce(j(j({},z0),e||{}),{staticQuestions:Gk((e==null?void 0:e.staticQuestions)||[])}));return w.jsx(t1.Provider,{value:n,children:w.jsx(Xk,{dispatch:r,children:t})})},Jk={productId:Ko.productId,pdpLink:Ko.pdpLink},r1=R.createContext(Jk),Zk=({children:e})=>{const[t,n]=R.useState(Ko.productId),[r,s]=R.useState(Ko.pdpLink);R.useEffect(()=>{const u=({detail:l})=>{if((l==null?void 0:l.property)==="pdp-context"){const d=l.value;n(d.productId),s(d.pdpLink);return}(l==null?void 0:l.property)==="productId"&&n(l.value),(l==null?void 0:l.property)==="pdpLink"&&s(l.value)};return vS(u),()=>{AS(u)}},[]);const a=R.useMemo(()=>({productId:t,pdpLink:r}),[t,r]);return w.jsx(r1.Provider,{value:a,children:e})},eC=e=>new Promise(t=>{let r;try{r=new URL(e)}catch(d){St(!0,"error",`[CimulateOverrides] Invalid URL provided: ${e}. Using default components.`),t({});return}if(r.protocol!=="https:"){St(!0,"error",`[CimulateOverrides] Override URL must use HTTPS, got ${r.protocol}. Using default components.`),t({});return}const s=document.createElement("script");s.src=e,s.async=!0,s.crossOrigin="anonymous";let a=!1;const u=()=>{a=!0,clearTimeout(l)};s.onload=()=>{if(a)return;u();const d=window.CimulateOverrides;d&&typeof d=="object"?(St(!0,"log","[CimulateOverrides] Override script loaded successfully."),t(d)):(St(!0,"warn","[CimulateOverrides] Override script loaded but window.CimulateOverrides is not set. Using default components."),t({}))},s.onerror=()=>{a||(u(),St(!0,"warn",`[CimulateOverrides] Failed to load override script from: ${e}. Using default components.`),t({}))};const l=setTimeout(()=>{a||(a=!0,St(!0,"warn",`[CimulateOverrides] Override script timed out after 5000ms: ${e}. Using default components.`),t({}))},5e3);document.head.appendChild(s)}),i1=R.createContext({overrides:{},isInitialized:!1}),tC=({overridesUrl:e,inlineOverrides:t,children:n})=>{const[r,s]=R.useState({}),[a,u]=R.useState(!1);R.useEffect(()=>{Be(null,null,function*(){let f={};e?(St(!0,"log","[CimulateOverrides] Loading overrides from URL..."),f=yield eC(e)):t&&typeof t=="object"?(St(!0,"log","[CimulateOverrides] Using inline overrides."),f=t):window.CimulateOverrides&&typeof window.CimulateOverrides=="object"&&(St(!0,"log","[CimulateOverrides] Using window.CimulateOverrides."),f=window.CimulateOverrides),s(f),u(!0)})},[e,t]);const l=R.useMemo(()=>({overrides:r,isInitialized:a}),[r,a]);return w.jsx(i1.Provider,{value:l,children:n})},s1=({mode:e,apiKey:t,apiToken:n,baseUrl:r,logoUrl:s,headerText:a,headerConfig:u,theme:l,openLinksInNewTab:d,globalClassName:f,isDevelopment:m=!1,componentType:p,componentConfig:b,entryType:y,initialEntry:_,entryMessage:x,disclaimerText:A,disclaimerMarkdown:S,clientContext:C,searchPlaceholder:O,searchButtonLabel:z,searchConfig:G,suggestionButtonConfig:D,messageAlignment:V,autoScroll:J,promptsConfig:se,showProductDescription:H,resetConversationMessage:ie,conversationHistory:te,messagingConfig:le,overrides:fe,overridesUrl:ue,inlineOverrides:Se,__features:de,children:W})=>{const oe=R.useRef(!1);return oe.current||(oe.current=!0,OS({initialEntry:_,entryType:y,isDevelopment:m})),w.jsx(XA,{mode:e,baseUrl:r,apiKey:t,apiToken:n,logoUrl:s,headerText:a,headerConfig:u,entryMessage:x,theme:l,globalClassName:f,openLinksInNewTab:d,searchPlaceholder:O,searchButtonLabel:z,searchConfig:G,suggestionButtonConfig:D,messageAlignment:V,autoScroll:J,showProductDescription:H,componentConfig:b,clientContext:C,disclaimerMarkdown:S,disclaimerText:A,resetConversationMessage:ie,conversationHistory:te,isDevelopment:m,__features:de,progressStepsLimit:le==null?void 0:le.progressStepsLimit,routingAttributes:le==null?void 0:le.routingAttributes,enableDownloadTranscript:le==null?void 0:le.enableDownloadTranscript,enableEscalationToAgent:le==null?void 0:le.enableEscalationToAgent,showProductCaptions:le==null?void 0:le.showProductCaptions,children:w.jsx(ZS,{entryType:y!=null?y:_==null?void 0:_.type,componentConfig:b,componentType:p,children:w.jsx(Zk,{children:w.jsx(Qk,{promptsConfig:se,children:w.jsx(tC,{overridesUrl:ue,inlineOverrides:Se||fe,children:w.jsx($g,{scrt2Url:(le==null?void 0:le.scrt2Url)||"",orgId:(le==null?void 0:le.orgId)||"",esDeveloperName:(le==null?void 0:le.esDeveloperName)||"",routingAttributes:(le==null?void 0:le.routingAttributes)||{},capabilitiesVersion:le==null?void 0:le.capabilitiesVersion,enableLogging:m,onProductResult:le==null?void 0:le.onProductResult,children:W})})})})})})};var gf={exports:{}},kn={},Ef={exports:{}},yf={};var o1;function nC(){return o1||(o1=1,(function(e){function t(W,oe){var k=W.length;W.push(oe);e:for(;0<k;){var M=k-1>>>1,Z=W[M];if(0<s(Z,oe))W[M]=oe,W[k]=Z,k=M;else break e}}function n(W){return W.length===0?null:W[0]}function r(W){if(W.length===0)return null;var oe=W[0],k=W.pop();if(k!==oe){W[0]=k;e:for(var M=0,Z=W.length,P=Z>>>1;M<P;){var xe=2*(M+1)-1,Ie=W[xe],he=xe+1,ve=W[he];if(0>s(Ie,k))he<Z&&0>s(ve,Ie)?(W[M]=ve,W[he]=k,M=he):(W[M]=Ie,W[xe]=k,M=xe);else if(he<Z&&0>s(ve,k))W[M]=ve,W[he]=k,M=he;else break e}}return oe}function s(W,oe){var k=W.sortIndex-oe.sortIndex;return k!==0?k:W.id-oe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var u=Date,l=u.now();e.unstable_now=function(){return u.now()-l}}var d=[],f=[],m=1,p=null,b=3,y=!1,_=!1,x=!1,A=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(W){for(var oe=n(f);oe!==null;){if(oe.callback===null)r(f);else if(oe.startTime<=W)r(f),oe.sortIndex=oe.expirationTime,t(d,oe);else break;oe=n(f)}}function z(W){if(x=!1,O(W),!_)if(n(d)!==null)_=!0,Se(G);else{var oe=n(f);oe!==null&&de(z,oe.startTime-W)}}function G(W,oe){_=!1,x&&(x=!1,S(J),J=-1),y=!0;var k=b;try{for(O(oe),p=n(d);p!==null&&(!(p.expirationTime>oe)||W&&!ie());){var M=p.callback;if(typeof M=="function"){p.callback=null,b=p.priorityLevel;var Z=M(p.expirationTime<=oe);oe=e.unstable_now(),typeof Z=="function"?p.callback=Z:p===n(d)&&r(d),O(oe)}else r(d);p=n(d)}if(p!==null)var P=!0;else{var xe=n(f);xe!==null&&de(z,xe.startTime-oe),P=!1}return P}finally{p=null,b=k,y=!1}}var D=!1,V=null,J=-1,se=5,H=-1;function ie(){return!(e.unstable_now()-H<se)}function te(){if(V!==null){var W=e.unstable_now();H=W;var oe=!0;try{oe=V(!0,W)}finally{oe?le():(D=!1,V=null)}}else D=!1}var le;if(typeof C=="function")le=function(){C(te)};else if(typeof MessageChannel!="undefined"){var fe=new MessageChannel,ue=fe.port2;fe.port1.onmessage=te,le=function(){ue.postMessage(null)}}else le=function(){A(te,0)};function Se(W){V=W,D||(D=!0,le())}function de(W,oe){J=A(function(){W(e.unstable_now())},oe)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(W){W.callback=null},e.unstable_continueExecution=function(){_||y||(_=!0,Se(G))},e.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):se=0<W?Math.floor(1e3/W):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(W){switch(b){case 1:case 2:case 3:var oe=3;break;default:oe=b}var k=b;b=oe;try{return W()}finally{b=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(W,oe){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var k=b;b=W;try{return oe()}finally{b=k}},e.unstable_scheduleCallback=function(W,oe,k){var M=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?M+k:M):k=M,W){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=k+Z,W={id:m++,callback:oe,priorityLevel:W,startTime:k,expirationTime:Z,sortIndex:-1},k>M?(W.sortIndex=k,t(f,W),n(d)===null&&W===n(f)&&(x?(S(J),J=-1):x=!0,de(z,k-M))):(W.sortIndex=Z,t(d,W),_||y||(_=!0,Se(G))),W},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(W){var oe=b;return function(){var k=b;b=oe;try{return W.apply(this,arguments)}finally{b=k}}}})(yf)),yf}var a1;function rC(){return a1||(a1=1,Ef.exports=nC()),Ef.exports}var u1;function iC(){if(u1)return kn;u1=1;var e=sr(),t=rC();function n(i){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+i,c=1;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function a(i,o){u(i,o),u(i+"Capture",o)}function u(i,o){for(s[i]=o,i=0;i<o.length;i++)r.add(o[i])}var l=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},p={};function b(i){return d.call(p,i)?!0:d.call(m,i)?!1:f.test(i)?p[i]=!0:(m[i]=!0,!1)}function y(i,o,c,h){if(c!==null&&c.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return h?!1:c!==null?!c.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function _(i,o,c,h){if(o===null||typeof o=="undefined"||y(i,o,c,h))return!0;if(h)return!1;if(c!==null)switch(c.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function x(i,o,c,h,E,T,v){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=h,this.attributeNamespace=E,this.mustUseProperty=c,this.propertyName=i,this.type=o,this.sanitizeURL=T,this.removeEmptyString=v}var A={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){A[i]=new x(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var o=i[0];A[o]=new x(o,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){A[i]=new x(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){A[i]=new x(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){A[i]=new x(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){A[i]=new x(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){A[i]=new x(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){A[i]=new x(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){A[i]=new x(i,5,!1,i.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function C(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var o=i.replace(S,C);A[o]=new x(o,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var o=i.replace(S,C);A[o]=new x(o,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var o=i.replace(S,C);A[o]=new x(o,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){A[i]=new x(i,1,!1,i.toLowerCase(),null,!1,!1)}),A.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){A[i]=new x(i,1,!1,i.toLowerCase(),null,!0,!0)});function O(i,o,c,h){var E=A.hasOwnProperty(o)?A[o]:null;(E!==null?E.type!==0:h||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(_(o,c,E,h)&&(c=null),h||E===null?b(o)&&(c===null?i.removeAttribute(o):i.setAttribute(o,""+c)):E.mustUseProperty?i[E.propertyName]=c===null?E.type===3?!1:"":c:(o=E.attributeName,h=E.attributeNamespace,c===null?i.removeAttribute(o):(E=E.type,c=E===3||E===4&&c===!0?"":""+c,h?i.setAttributeNS(h,o,c):i.setAttribute(o,c))))}var z=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,G=Symbol.for("react.element"),D=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),J=Symbol.for("react.strict_mode"),se=Symbol.for("react.profiler"),H=Symbol.for("react.provider"),ie=Symbol.for("react.context"),te=Symbol.for("react.forward_ref"),le=Symbol.for("react.suspense"),fe=Symbol.for("react.suspense_list"),ue=Symbol.for("react.memo"),Se=Symbol.for("react.lazy"),de=Symbol.for("react.offscreen"),W=Symbol.iterator;function oe(i){return i===null||typeof i!="object"?null:(i=W&&i[W]||i["@@iterator"],typeof i=="function"?i:null)}var k=Object.assign,M;function Z(i){if(M===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);M=o&&o[1]||""}return`
17
- `+M+i}var P=!1;function xe(i,o){if(!i||P)return"";P=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(ee){var h=ee}Reflect.construct(i,[],o)}else{try{o.call()}catch(ee){h=ee}i.call(o.prototype)}else{try{throw Error()}catch(ee){h=ee}i()}}catch(ee){if(ee&&h&&typeof ee.stack=="string"){for(var E=ee.stack.split(`
16
+ `+a)}}catch(u){}}throw r}})}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Yi(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:a}=n;r!==void 0&&Wu.assertOptions(r,{silentJSONParsing:ln.transitional(ln.boolean),forcedJSONParsing:ln.transitional(ln.boolean),clarifyTimeoutError:ln.transitional(ln.boolean),legacyInterceptorReqResOrdering:ln.transitional(ln.boolean),advertiseZstdAcceptEncoding:ln.transitional(ln.boolean),validateStatusUndefinedResolves:ln.transitional(ln.boolean)},!1),s!=null&&(Y.isFunction(s)?n.paramsSerializer={serialize:s}:Wu.assertOptions(s,{encode:ln.function,serialize:ln.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Wu.assertOptions(n,{baseUrl:ln.spelling("baseURL"),withXsrfToken:ln.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let u=a&&Y.merge(a.common,a[n.method]);a&&Y.forEach(["delete","get","head","post","put","patch","query","common"],_=>{delete a[_]}),n.headers=un.concat(u,a);const l=[];let d=!0;this.interceptors.request.forEach(function(x){if(typeof x.runWhen=="function"&&x.runWhen(n)===!1)return;d=d&&x.synchronous;const A=n.transitional||Yd;A&&A.legacyInterceptorReqResOrdering?l.unshift(x.fulfilled,x.rejected):l.push(x.fulfilled,x.rejected)});const f=[];this.interceptors.response.forEach(function(x){f.push(x.fulfilled,x.rejected)});let m,p=0,b;if(!d){const _=[Ag.bind(this),void 0];for(_.unshift(...l),_.push(...f),b=_.length,m=Promise.resolve(n);p<b;)m=m.then(_[p++],_[p++]);return m}b=l.length;let y=n;for(;p<b;){const _=l[p++],x=l[p++];try{y=_(y)}catch(A){x.call(this,A);break}}try{m=Ag.call(this,y)}catch(_){return Promise.reject(_)}for(p=0,b=f.length;p<b;)m=m.then(f[p++],f[p++]);return m}getUri(t){t=Yi(this.defaults,t);const n=gg(t.baseURL,t.url,t.allowAbsoluteUrls,t);return og(n,t.params,t.paramsSerializer)}};Y.forEach(["delete","get","head","options"],function(t){Wi.prototype[t]=function(n,r){return this.request(Yi(r||{},{method:t,url:n,data:r&&Y.hasOwnProp(r,"data")?r.data:void 0}))}}),Y.forEach(["post","put","patch","query"],function(t){function n(r){return function(a,u,l){return this.request(Yi(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:u}))}}Wi.prototype[t]=n(),t!=="query"&&(Wi.prototype[t+"Form"]=n(!0))});let $A=class O2{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(s=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](s);r._listeners=null}),this.promise.then=s=>{let a;const u=new Promise(l=>{r.subscribe(l),a=l}).then(s);return u.cancel=function(){r.unsubscribe(a)},u},t(function(a,u,l){r.reason||(r.reason=new na(a,u,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new O2(function(s){t=s}),cancel:t}}};function VA(e){return function(n){return e.apply(null,n)}}function qA(e){return Y.isObject(e)&&e.isAxiosError===!0}const Zd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Zd).forEach(([e,t])=>{Zd[t]=e});function Cg(e){const t=new Wi(e),n=$0(Wi.prototype.request,t);return Y.extend(n,Wi.prototype,t,{allOwnKeys:!0}),Y.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Cg(Yi(e,s))},n}const Bt=Cg(ta);Bt.Axios=Wi,Bt.CanceledError=na,Bt.CancelToken=$A,Bt.isCancel=dg,Bt.VERSION=Kd,Bt.toFormData=zu,Bt.AxiosError=Oe,Bt.Cancel=Bt.CanceledError,Bt.all=function(t){return Promise.all(t)},Bt.spread=VA,Bt.isAxiosError=qA,Bt.mergeConfig=Yi,Bt.AxiosHeaders=un,Bt.formToJSON=e=>cg(Y.isHTMLForm(e)?new FormData(e):e),Bt.getAdapter=vg.getAdapter,Bt.HttpStatusCode=Zd,Bt.default=Bt;const{Axios:cU,AxiosError:dU,CanceledError:fU,isCancel:hU,CancelToken:pU,VERSION:mU,all:gU,Cancel:EU,isAxiosError:yU,spread:TU,toFormData:bU,AxiosHeaders:wU,HttpStatusCode:_U,formToJSON:xU,getAdapter:SU,mergeConfig:vU,create:AU}=Bt;class YA{constructor(t,n,r,s=!1,a,u){Qe(this,"CIMULATE_API_HEADER","x-cimulate-api-key");Qe(this,"CIMULATE_SEARCH_API_HOST","search.cimulate");Qe(this,"CIMULATE_SEARCH_API_PATH","api/v1");Qe(this,"baseApiUrl");Qe(this,"headers",{});Qe(this,"fetchConfig",()=>Be(this,null,function*(){try{const t=yield Bt.get(`${this.apiUrl}/configs/copilot`,{headers:this.headers}),{customer_config:n}=t.data,r=atob(n);return JSON.parse(r)}catch(t){throw console.error("Error fetching customer config:",t),t}}));Qe(this,"_mapCopilotUrlToSearchUrl",(t="",n=!1)=>{if(t.endsWith("io")){const s=new URL(t);return s.hostname=s.hostname.replace(/^copilot\./,"api."),s.origin}return n?`https://staging.${this.CIMULATE_SEARCH_API_HOST}.ai`:`https://prod.${this.CIMULATE_SEARCH_API_HOST}.ai`});if(n&&r||!n&&!r)throw new Error("Provide exactly one authentication method: either 'apiKey' or 'apiToken', but not both.");n?this.headers[this.CIMULATE_API_HEADER]=n:r&&(this.headers.Authorization=`Bearer ${r}`),a&&(this.headers["x-cimulate-customer-id"]=a),u&&(this.headers["Tenant-ID"]=u),this.baseApiUrl=this._mapCopilotUrlToSearchUrl(t,s)}get apiUrl(){return`${this.baseApiUrl}/${this.CIMULATE_SEARCH_API_PATH}`}}class WA{constructor(t,n,r,s=!1,a,u){Qe(this,"apiService");Qe(this,"config",null);Qe(this,"getConfig",()=>Be(this,null,function*(){if(this.config)return this.config;try{const t=yield this.apiService.fetchConfig();return this.config=t,this.config}catch(t){throw console.error("Failed to fetch customer config:",t),t}}));Qe(this,"getPid",t=>this.getProductFieldValue(t,"pidCol"));Qe(this,"getName",t=>this.getProductFieldValue(t,"nameCol"));Qe(this,"getDescription",t=>this.getProductFieldValue(t,"description"));Qe(this,"getBrand",t=>this.getProductFieldValue(t,"productBrandCol"));Qe(this,"getPrice",t=>this.getProductFieldValue(t,"priceCol"));Qe(this,"getRelativePdp",t=>this.getProductFieldValue(t,"relativePdpCol"));Qe(this,"getPdp",t=>this.getProductFieldValue(t,"pdpCol"));Qe(this,"getImage",t=>this.getProductFieldValue(t,"imageCol"));Qe(this,"getProductHiddenFields",()=>{const t=this.getProductField("productHiddenFields");return Array.isArray(t)?t:[]});Qe(this,"getProductField",t=>this.config?this.config[t]:"");Qe(this,"getProductFieldValue",(t,n)=>{const r=this.getProductField(n);return r&&t[r]||""});this.apiService=new YA(t,n,r,s,a,u)}getPriceDisplay(t){const n=this.getPrice(t);return n?typeof n=="string"?n.includes("$")?n:`$${n}`:typeof n=="number"?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(n):n:""}}const GA={copilot:"Your Search Assistant",messaging:"Commerce Client"},Ng=R.createContext(null),XA=({mode:e,logoUrl:t,headerText:n,headerConfig:r,globalClassName:s="",entryMessage:a,openLinksInNewTab:u=!1,disclaimerText:l,disclaimerMarkdown:d,clientContext:f,baseCatalogParams:m,searchPlaceholder:p,searchButtonLabel:b,searchConfig:y,suggestionButtonConfig:_,progressStepsLimit:x=3,messageAlignment:A="start",autoScroll:S=!0,showProductDescription:C=!1,componentConfig:O,conversationHistory:z,resetConversationMessage:G="",apiKey:M,apiToken:V,baseUrl:J,customerId:se,tenantId:H,theme:ie,isDevelopment:te,__features:le,routingAttributes:fe,enableDownloadTranscript:ue=!0,enableEscalationToAgent:Se=!1,showProductCaptions:de=!1,staticQuestions:W,staticQuestionsStrategy:oe="append",children:k})=>{const D=e==="messaging",Z=R.useMemo(()=>{const Ge=fe==null?void 0:fe.isCartMgmtSupported;return Ge===!0||Ge==="true"},[fe]),P=R.useMemo(()=>D?{config:null}:new WA(J,M,V,te,se,H),[D,J,M,V,te,se,H]),xe=R.useMemo(()=>new NS(te),[te]);R.useEffect(()=>{D||!P||P.config||P.getConfig()},[P,D]);const Ie=R.useMemo(()=>MS(ie),[ie]),he=R.useMemo(()=>{const Ge=(y==null?void 0:y.placeholder)||p,et=(y==null?void 0:y.buttonLabel)||b;let mt="icon";return y!=null&&y.buttonType?mt=y.buttonType:b&&(mt="text"),ce(j({},y||{}),{placeholder:Ge,buttonLabel:et,buttonType:mt})},[y,p,b]),ve=R.useMemo(()=>ce(j({},r||{}),{logoUrl:t||(r==null?void 0:r.logoUrl),headerText:(r==null?void 0:r.headerText)||n||GA[e!=null?e:"copilot"]}),[r,t,n,e]),Fe=R.useMemo(()=>({configModule:P,mode:e!=null?e:"copilot",headerConfig:ve,entryMessage:a,staticQuestions:W||[],staticQuestionsStrategy:oe,globalClassName:s,openLinksInNewTab:u,disclaimerText:l,disclaimerMarkdown:d,clientContext:f,baseCatalogParams:m,themeVariables:Ie,logger:xe,searchConfig:he,suggestionButtonConfig:_,progressStepsLimit:x,messageAlignment:A,autoScroll:S,showProductDescription:!!C,enableMinimize:!!(O!=null&&O.enableMinimize),enableDownloadTranscript:ue,enableEscalationToAgent:Se,showProductCaptions:!!de,resetConversationMessage:G,conversationHistory:{sinceHours:typeof(z==null?void 0:z.sinceHours)=="number"?z.sinceHours:D?24:1,limit:z==null?void 0:z.limit},features:le,isCartMgmtSupported:Z}),[P,e,ve,a,W,oe,s,f,m,l,d,u,he,_,A,S,C,O,ue,Se,x,de,G,xe,Ie,z,le,Z]);return w.jsx(Ng.Provider,{value:Fe,children:k})},ft=()=>{const e=R.useContext(Ng);if(!e)throw new Error("useConfig must be used within a ConfigProvider");return e},Og=["markdown","product_carousel","product_tile","product_comparison","suggestions","cart","order_confirmation","tool_results"],ci=-1;function Ig(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=typeof t.text=="string"?t.text:"",r=typeof t.message=="string"?t.message:"";return n||r||null}function Pg(e){if(!e||!e.trim())return null;try{const t=JSON.parse(e);if(t&&typeof t=="object"){if(!Array.isArray(t)&&typeof t.type=="string"&&typeof t.index=="number"&&Og.includes(t.type))return t;const n=Ig(t);return n?{type:"markdown",index:ci,data:{content:n}}:null}}catch(t){}return{type:"markdown",index:ci,data:{content:e}}}function Rg(e){let t;try{t=JSON.parse(e)}catch(s){return null}if(!t||typeof t!="object"||Array.isArray(t))return null;const n=t;if(typeof n.type!="string"||!Og.includes(n.type))return null;const r=typeof n.index=="number"?n.index:0;return ce(j({},n),{type:n.type,index:r})}function Gu(e){let t;try{t=JSON.parse(e)}catch(n){return null}return t&&typeof t=="object"&&Array.isArray(t.response)?t:null}function KA(e){var s,a;if(e.type!=="markdown")return[e];const t=(a=(s=e.data)==null?void 0:s.content)!=null?a:"",n=Gu(t);if(n)return n.response;const r=Rg(t);return[r&&r.type!=="markdown"?r:e]}function QA(e,t){var n,r;return(r=(n=Gu(e))==null?void 0:n.response.some(s=>s.type===t))!=null?r:!1}function Lg(e){const t=e.trimStart();if(!t.startsWith("{")&&!t.startsWith("["))return!1;try{return JSON.parse(e),!1}catch(n){return!0}}function JA(e){return e.type==="markdown"&&e.index===ci?!Lg(e.data.content):!0}function ZA(e){var s;const t=(s=Gu(e))==null?void 0:s.response;if(!t)return null;const n=t.find(a=>a.type==="product_carousel");if(n)return{kind:"search",productIds:n.data.products.map(a=>a.id)};const r=t.find(a=>a.type==="product_tile");return r?{kind:"detail",productIds:[r.data.id]}:null}function ek(e,t){if(t.index===ci){const s=e[e.length-1];if(s&&s.type==="markdown"&&s.index===ci&&t.type==="markdown"){const a={type:"markdown",index:ci,data:{content:s.data.content+t.data.content}};return[...e.slice(0,-1),a]}return[...e,t]}const n=e.findIndex(s=>s.index===t.index);return[...n>=0?e.map((s,a)=>a===n?t:s):[...e,t]].sort((s,a)=>s.index-a.index)}function Dg(e,t){return t.serverId!==void 0&&e.some(n=>n.serverId===t.serverId)}const Mg={connectionStatus:"disconnected",loading:!1,conversationId:null,messages:[],streamingBlocks:[],isAgentTyping:!1,progressMessage:"",progressSteps:[],routingResult:null,error:null,sendError:null,sessionExpired:!1,cartUpdating:!1};function tk(e,t){switch(t.type){case"SET_CONNECTION_STATUS":return j(ce(j({},e),{connectionStatus:t.status}),t.status==="connected"||t.status==="connecting"?{error:null}:{});case"SET_LOADING":return ce(j({},e),{loading:t.isLoading});case"SET_CONVERSATION_ID":return ce(j({},e),{conversationId:t.id});case"ADD_MESSAGE":return Dg(e.messages,t.message)?e:ce(j({},e),{messages:[...e.messages,ce(j({},t.message),{type:"ADD_MESSAGE"})]});case"APPEND_STREAMING_TOKEN":{const n=Pg(t.token);return n?ce(j({},e),{streamingBlocks:ek(e.streamingBlocks,n)}):e}case"FLUSH_STREAMING":{const n={streamingBlocks:[],isAgentTyping:!1,loading:!1,progressMessage:"",progressSteps:[],sendError:null};if(Dg(e.messages,t.message))return j(j({},e),n);const r=ce(j({},t.message),{type:"FLUSH_STREAMING"}),s=t.replaceMessageId?e.messages.findIndex(a=>a.id===t.replaceMessageId):-1;if(s>=0){const a=[...e.messages];return a[s]=ce(j({},r),{id:e.messages[s].id}),j(ce(j({},e),{messages:a}),n)}return j(ce(j({},e),{messages:[...e.messages,r]}),n)}case"SET_AGENT_TYPING":return ce(j({},e),{isAgentTyping:t.isTyping,loading:t.isTyping});case"SET_PROGRESS_MESSAGE":return j(ce(j({},e),{progressMessage:t.message}),t.message===""?{progressSteps:[]}:{});case"ADD_PROGRESS_STEP":return e.progressSteps[e.progressSteps.length-1]===t.message?e:ce(j({},e),{progressSteps:[...e.progressSteps,t.message],progressMessage:t.message});case"SET_ROUTING_RESULT":return ce(j({},e),{routingResult:t.result});case"SET_ERROR":return ce(j({},e),{error:t.error,loading:!1,progressMessage:"",progressSteps:[]});case"SET_SEND_ERROR":return ce(j({},e),{sendError:t.error,loading:!1,progressMessage:"",progressSteps:[]});case"CLEAR_SEND_ERROR":return ce(j({},e),{sendError:null});case"LOAD_HISTORY":return ce(j({},e),{messages:t.messages,loading:!1});case"SET_SESSION_EXPIRED":return ce(j({},e),{sessionExpired:t.expired});case"SET_CART_UPDATING":return ce(j({},e),{cartUpdating:t.isUpdating});case"RESET":return ce(j({},Mg),{connectionStatus:e.connectionStatus});default:return e}}const Fg=R.createContext({connectionStatus:"disconnected",isConnected:!1,isAgentTyping:!1,conversationId:null,messages:[],streamingBlocks:[],progressMessage:"",progressSteps:[],loading:!0,cartUpdating:!1,error:null,sendError:null,sessionExpired:!1,canInitialize:!0,sendMessage:()=>Be(null,null,function*(){return{outcome:"failure",message:"Messaging is unavailable"}}),addToCart:()=>{},resetConversation:()=>Be(null,null,function*(){}),retryLastMessage:()=>{},retryConnection:()=>{},downloadTranscript:()=>Be(null,null,function*(){}),getAuthLinkKey:()=>Be(null,null,function*(){throw new Error("getAuthLinkKey called without a MessagingProvider")})}),nk=4320*60*1e3;function ef(e,t){return`cim_af_conv_${e}_${t}`}function tf(e,t){return Date.now()-e>t}function rk(e,t,n){try{const r=ef(e,t),s=sessionStorage.getItem(r);if(!s)return null;const a=JSON.parse(s);if(!a||typeof a!="object"||!("conversationId"in a)||!("storedAt"in a))return null;const u=a;return typeof u.conversationId!="string"||!u.conversationId?null:typeof u.storedAt!="number"||tf(u.storedAt,n)?(sessionStorage.removeItem(r),null):u}catch(r){return null}}function Xu(e,t,n){try{const r=ef(e,t),s={conversationId:n,storedAt:Date.now()};sessionStorage.setItem(r,JSON.stringify(s))}catch(r){}}function nf(e,t){try{const n=ef(e,t);sessionStorage.removeItem(n)}catch(n){}}function rf(e,t){return`cim_af_ct_${e}_${t}`}function ik(e){try{const t=e.split(".")[1];if(!t)return null;const n=JSON.parse(ok(t));return typeof n.exp=="number"?n.exp*1e3:null}catch(t){return null}}function sk(e){const t=ik(e);return t===null?"unknown":Date.now()>=t?"expired":"valid"}function ok(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(t.length+(4-t.length%4)%4,"=");return atob(n)}function Bg(e,t){try{const n=rf(e,t),r=sessionStorage.getItem(n);if(!r)return null;const s=JSON.parse(r);if(!s||typeof s!="object"||!("accessToken"in s)||!("lastEventId"in s)||!("storedAt"in s))return null;const a=s;return typeof a.accessToken!="string"||!a.accessToken||typeof a.lastEventId!="string"||!a.lastEventId||typeof a.storedAt!="number"?null:sk(a.accessToken)==="expired"?(sessionStorage.removeItem(n),null):a}catch(n){return null}}function ak(e,t,n,r){try{const s=rf(e,t),a={accessToken:n,lastEventId:r,storedAt:Date.now()};sessionStorage.setItem(s,JSON.stringify(a))}catch(s){}}function uk(e,t){try{const n=rf(e,t);sessionStorage.removeItem(n)}catch(n){}}function lk(e,t){return`cim_af_conv_${e}_${t}`}function ck(e,t){try{if(typeof BroadcastChannel=="undefined")return null;const n=lk(e,t);return new BroadcastChannel(n)}catch(n){return null}}function dk(e,t=500){return e?new Promise(n=>{let r=!1;const s=setTimeout(()=>{r||(r=!0,e.removeEventListener("message",a),n(null))},t);function a(u){var l;r||((l=u.data)==null?void 0:l.type)==="conversation_response"&&(r=!0,clearTimeout(s),e.removeEventListener("message",a),n({conversationId:u.data.conversationId,storedAt:u.data.storedAt,continuationToken:u.data.continuationToken,lastEventId:u.data.lastEventId}))}e.addEventListener("message",a);try{e.postMessage({type:"request_conversation"})}catch(u){r||(r=!0,clearTimeout(s),e.removeEventListener("message",a),n(null))}}):Promise.resolve(null)}function fk(e,t,n){if(!e)return()=>{};function r(s){var a;if((a=s.data)!=null&&a.type)switch(s.data.type){case"request_conversation":{const u=t();if(u!=null&&u.conversationId)try{e.postMessage({type:"conversation_response",conversationId:u.conversationId,storedAt:Date.now(),continuationToken:u.continuationToken,lastEventId:u.lastEventId})}catch(l){}break}case"conversation_cleared":{n==null||n();break}}}return e.addEventListener("message",r),()=>{e.removeEventListener("message",r)}}function hk(e){if(e)try{e.postMessage({type:"conversation_cleared"})}catch(t){}}function pk(e){if(e)try{e.close()}catch(t){}}function mk(e){switch(e){case"EndUser":case"Customer":return"user";case"Agent":case"Chatbot":return"agent";default:return"system"}}function gk(e){if(!e)return{};if(typeof e=="string")try{return JSON.parse(e)}catch(t){return{}}return e}function Ug(e,...t){let n=e;for(const r of t){if(n==null||typeof n!="object")return"";n=n[r]}return typeof n=="string"?n:""}function Ek(e){if(e.entryType!=="Message")return null;const n=gk(e.entryPayload).abstractMessage;if(!n)return null;const r=Ug(n,"staticContent","text")||Ug(n,"content","text")||"";if(!r)return null;const s=mk(e.sender.role);return{id:e.identifier,serverId:e.identifier,role:s,content:r,timestamp:new Date(e.transcriptedTimestamp).toISOString(),sender:{role:e.sender.role,name:e.senderDisplayName}}}function yk(e){const t=[];for(const n of e){const r=Ek(n);r&&t.push(r)}return t}const Tk=5e3;function Ku(e={}){const{routingAttributes:t,timeoutMs:n=Tk}=e;if(typeof window=="undefined"||typeof window.dispatchEvent!="function")return Promise.resolve(t);const r=j({},t!=null?t:{});return new Promise(s=>{const a={settled:!1},u=()=>{if(a.settled)return;a.settled=!0,a.timer!==void 0&&clearTimeout(a.timer);const m=Object.keys(r).length>0;s(m?r:t)},l={routingAttributes:t,setHiddenPrechatFields:m=>{a.settled||!m||Object.assign(r,m)},done:u},d=new CustomEvent(B0,{detail:l,cancelable:!0});if(!!window.dispatchEvent(d)){u();return}a.timer=setTimeout(u,n)})}const bk=200,wk=1e3;function _k(e){const{orgId:t,esDeveloperName:n,routingAttributes:r,conversationHistory:s}=e,a=R.useRef(null),u=R.useRef(null),l=R.useRef(null),d=s.sinceHours*60*60*1e3,f=nk,m=R.useCallback(()=>(l.current||(l.current=dk(a.current)),l.current),[]);R.useEffect(()=>{const S=ck(t,n);a.current=S,l.current=null;const C=fk(S,()=>{const O=u.current;if(!O)return null;const z=Bg(t,n);return{conversationId:O,continuationToken:z==null?void 0:z.accessToken,lastEventId:z==null?void 0:z.lastEventId}},()=>{nf(t,n),u.current=null});return()=>{C(),pk(S),a.current=null}},[t,n]);const p=R.useCallback((S,C)=>Be(null,null,function*(){var M,V,J;const O=(M=C==null?void 0:C.createIfMissing)!=null?M:!0,z=(V=C==null?void 0:C.isCurrent)!=null?V:(()=>!0);let G=rk(t,n,f);if(!G){const se=yield m();se&&!tf(se.storedAt,f)&&(G=se)}if(!G){if(!O)return{conversationId:null,restoredMessages:[],resumed:!1,outcome:"not-found-or-closed"};const se=yield Ku({routingAttributes:r});if(!z())return{conversationId:null,restoredMessages:[],resumed:!1,outcome:"unverified-error"};const H=yield S.createConversation(se);return z()?(Xu(t,n,H),u.current=H,{conversationId:H,restoredMessages:[],resumed:!1,outcome:"created"}):(yield S.endConversation(),{conversationId:null,restoredMessages:[],resumed:!1,outcome:"unverified-error"})}try{const se=yield S.listConversations({conversationId:G.conversationId,startTimestamp:Date.now()-f});if(!z())return{conversationId:null,restoredMessages:[],resumed:!1,outcome:"unverified-error"};const H=se.conversations.find(te=>te.conversationId===G.conversationId&&!te.isConversationClosed);if(!H){if(nf(t,n),!O)return{conversationId:null,restoredMessages:[],resumed:!1,outcome:"not-found-or-closed"};const te=yield Ku({routingAttributes:r});if(!z())return{conversationId:null,restoredMessages:[],resumed:!1,outcome:"unverified-error"};const le=yield S.createConversation(te);return z()?(Xu(t,n,le),u.current=le,{conversationId:le,restoredMessages:[],resumed:!1,outcome:"not-found-or-closed"}):(yield S.endConversation(),{conversationId:null,restoredMessages:[],resumed:!1,outcome:"unverified-error"})}S.resumeConversation(H.conversationId),u.current=H.conversationId,Xu(t,n,H.conversationId);let ie=[];try{const te=yield S.listConversationEntries(H.conversationId,{limit:Math.min((J=s.limit)!=null?J:bk,wk),startTimestamp:Date.now()-d,direction:"FromEnd"});ie=yk(te.conversationEntries).reverse()}catch(te){}return{conversationId:H.conversationId,restoredMessages:ie,resumed:!0,outcome:"resumed"}}catch(se){return{conversationId:G.conversationId,restoredMessages:[],resumed:!1,outcome:"unverified-error",error:se}}}),[t,n,r,s,d,f,m]),b=R.useCallback(S=>{Xu(t,n,S),u.current=S},[t,n]),y=R.useCallback(()=>{nf(t,n),uk(t,n),hk(a.current),u.current=null},[t,n]),_=R.useCallback(()=>{const S=Bg(t,n);return S?{continuationToken:S.accessToken,lastEventId:S.lastEventId}:null},[t,n]),x=R.useCallback(()=>Be(null,null,function*(){const S=yield m();return!(S!=null&&S.continuationToken)||tf(S.storedAt,f)?null:{continuationToken:S.continuationToken,lastEventId:S.lastEventId}}),[f,m]),A=R.useCallback((S,C=()=>!0)=>Be(null,null,function*(){try{const{accessToken:O,lastEventId:z}=yield S.generateContinuationToken();if(!C())return;ak(t,n,O,z)}catch(O){}}),[t,n]);return{initializeConversation:p,persistConversationId:b,clearPersistedConversation:y,getStoredConnectOptions:_,getPeerConnectOptions:x,persistContinuationToken:A}}const xk="Your session ended due to inactivity. Starting a new session…",Sk=300*1e3,vk=2e3,Ak=1e4,kk=15e3,Ck=2;function Hg(e,t,n){return e||t||n===!0}function ra(e){const t=e.find(r=>!r.timedOut),n=e[e.length-1];return t!=null?t:n}function Nk(e){const t=!e.timedOut,n=!!e.options.silent,r=!!e.options.reconcileMessageId;return t&&n&&r}function jg(e){if(!e||typeof e!="object")return!1;const t=e,n=t.type==="auth",r=t.type==="api"&&(t.statusCode===401||t.statusCode===403);return n||r}function sf(e){if(jg(e))return!0;const t=e instanceof Error?e.message:"";return/\(401\)/.test(t)}function Ok(e){var b;const t=e.productName||"this product",n=e.quantity&&e.quantity>1?e.quantity:void 0,r=((b=e.variants)!=null?b:[]).filter(y=>y.value),s=r.map(y=>`${y.label}: ${y.value}`).join(", "),a=r.map(y=>y.value).join(", "),u=s?` (${s})`:"",l=a?` (${a})`:"",d=n?`Add ${n} of`:"Add",f=e.sku?` [SKU: ${e.sku}]`:"",m=`${d} ${t} to my cart${u}${f}`,p=`Add ${n?`${n} × `:""}${t} to cart${l}`;return{prompt:m,display:p}}function Ik({connectionStatus:e,loading:t,hasMessages:n,sessionExpired:r,bootstrapSettled:s,resumeUsedLastEventId:a,recoverySteps:u,onExhausted:l,timeoutMs:d=kk,logger:f,isRecoveryInFlight:m}){const p=R.useRef(u);p.current=u;const b=R.useRef(l);b.current=l;const y=R.useRef(f);y.current=f;const _=R.useRef(m);_.current=m;const x=R.useRef(0),A=R.useRef(!1),S=R.useRef(0),[C,O]=R.useState(0);R.useEffect(()=>{if(!t||n){x.current=0,A.current=!1,S.current=0;return}const z=a||x.current>0;if(!(s&&z&&e==="connected"&&!r&&!A.current))return;const M=setTimeout(()=>{Be(null,null,function*(){var H,ie;if((H=_.current)!=null&&H.call(_)){if(S.current+=1,S.current>Ck){A.current=!0,b.current();return}O(te=>te+1);return}const V=x.current,J=p.current;if(V>=J.length){A.current=!0,b.current();return}S.current=0,(ie=y.current)==null||ie.warn("🦜 connect bootstrap stalled",{attempt:V});let se;try{yield Promise.race([Promise.resolve(J[V]()),new Promise((te,le)=>{se=setTimeout(()=>{le(new Error("connect bootstrap step timed out"))},d)})])}catch(te){}finally{se!==void 0&&clearTimeout(se),x.current=V+1,O(te=>te+1)}})},d);return()=>{clearTimeout(M)}},[e,t,n,r,s,a,d,C])}const Sr={default:"Something went wrong. Please try again.",server:"Something went wrong. Please try again.",rateLimit:"We are getting a lot of requests right now. Please try again in a moment.",network:"You are offline or we couldn't reach the assistant. Check connection and try again.",interrupted:"Something went wrong. Please try again.",connect:"You are offline or we couldn't reach the assistant. Check connection and try again.",lost:"You are offline or we couldn't reach the assistant. Check connection and try again.",routing:"Something went wrong. Please try again."};function Pk(e){if(!e||typeof e!="object")return{};const t=e;return{type:typeof t.type=="string"?t.type:void 0,statusCode:typeof t.statusCode=="number"?t.statusCode:void 0}}function di(e){const{type:t,statusCode:n}=Pk(e);if(t==="api"&&typeof n=="number")return n===429?Sr.rateLimit:n>=500?Sr.server:Sr.default;switch(t){case"network":return Sr.network;case"sse":return Sr.interrupted;case"auth":return Sr.connect;default:return Sr.default}}function zg(e){switch(e.code){case"MAX_RECONNECT":return Sr.lost;case"ROUTING_FAILED":return Sr.routing;default:return Sr.connect}}let Gi=null;function Rk(e){Gi&&Gi!==e&&console.warn("[CimulateMessaging] A messaging API is already registered; overwriting it. Mounting more than one messaging widget per page is not supported."),Gi=e}function Lk(e){Gi===e&&(Gi=null)}function Dk(){if(!Gi)throw new Error("Cimulate messaging widget is not ready. Call this after injectMessagingWidget() has run and the widget has mounted.");return Gi}const ia=Symbol("initialization-cancelled"),$g=({scrt2Url:e,orgId:t,esDeveloperName:n,routingAttributes:r,capabilitiesVersion:s,enableLogging:a=!1,onConnect:u,onMessage:l,onError:d,onProductResult:f,children:m})=>{const{logger:p,conversationHistory:b}=ft(),{status:{isOpen:y}}=Vr(),[_,x]=R.useReducer(tk,Mg),[A,S]=R.useState(!1),[C,O]=R.useState(!1),[z,G]=R.useState(!1),M=R.useRef(_);M.current=_;const V=_k({orgId:t,esDeveloperName:n,routingAttributes:r,conversationHistory:b}),J=R.useRef(null),se=R.useRef(l),H=R.useRef(d),ie=R.useRef(u),te=R.useRef(f),le=R.useRef(!1),fe=R.useRef(!1),ue=R.useRef(!1),Se=R.useRef(0),de=R.useRef(0),W=R.useRef(0),oe=R.useRef(null),k=R.useRef(null),D=R.useRef(null),Z=R.useRef(0),P=R.useRef(!1),xe=R.useRef(0),Ie=R.useRef(0),he=R.useRef(()=>Promise.reject(new Error("Messaging is unavailable"))),ve=R.useRef([]),Fe=R.useRef(null),Ge=R.useCallback(()=>{x({type:"SET_CART_UPDATING",isUpdating:ve.current.some(Nk)})},[]),et=R.useCallback((re,Ae)=>{Ae.outcome==="timeout"?(re.timedOut=!0,ve.current=ve.current.filter(ke=>ke===re||!ke.timedOut)):ve.current=ve.current.filter(ke=>ke!==re),clearTimeout(re.timeoutId),Ge(),re.resolve(Ae)},[Ge]);se.current=l,H.current=d,ie.current=u,te.current=f,R.useEffect(()=>{const re=new DS({baseURL:e,orgId:t,esDeveloperName:n,options:j({enableLogging:a},s?{capabilitiesVersion:s}:{})});J.current=re,P.current=!1,G(!1),S(!1),O(!1),x({type:"RESET"}),re.on("connected",()=>{var ye;x({type:"SET_CONNECTION_STATUS",status:"connected"}),(ye=ie.current)==null||ye.call(ie)}),re.on("disconnected",()=>{x({type:"SET_CONNECTION_STATUS",status:"disconnected"})}),re.on("reconnecting",()=>{x({type:"SET_CONNECTION_STATUS",status:"reconnecting"})}),re.on("message",ye=>{var Jr,Zr;const Le=ce(j({id:ye.messageId||crypto.randomUUID()},ye.messageId?{serverId:ye.messageId}:{}),{role:"agent",content:ye.content,timestamp:ye.timestamp,sender:ye.sender,raw:ye});p==null||p.log("🦜 MessagingProvider message received (FLUSH_STREAMING)",{messageId:Le.id,tokensBeforeFlush:Se.current,streamedFinalOnly:Se.current===0}),Se.current=0;const tt=ra(ve.current),Ot=tt==null?void 0:tt.options.reconcileMessageId;x({type:"FLUSH_STREAMING",message:Le,replaceMessageId:Ot}),(Jr=se.current)==null||Jr.call(se,Le),tt&&et(tt,{outcome:"success"});const{messagingSessionId:Wt}=ye,Mr=Wt?ZA(ye.content):null;Wt&&Mr&&((Zr=te.current)==null||Zr.call(te,{agentSessionId:Wt,kind:Mr.kind,productIds:Mr.productIds}))}),re.on("streaming_token",ye=>{var Le;if(!((Le=ra(ve.current))!=null&&Le.options.silent)){if(Se.current+=1,p!=null&&p.isDevelopment){const tt=Pg(ye.token);tt?tt.index===ci?p.debug("🦜 streaming_token → markdown fallback",{token:ye.token}):p.debug("🦜 streaming_token parsed",{type:tt.type,index:tt.index,outputName:tt.type==="tool_results"?tt.output_name:void 0}):p.debug("🦜 streaming_token dropped (empty or unrecognized payload shape)",{token:ye.token})}x({type:"APPEND_STREAMING_TOKEN",token:ye.token})}}),re.on("typing_started",()=>{var ye;(ye=ra(ve.current))!=null&&ye.options.silent||x({type:"SET_AGENT_TYPING",isTyping:!0})}),re.on("typing_stopped",()=>{var ye;(ye=ra(ve.current))!=null&&ye.options.silent||x({type:"SET_AGENT_TYPING",isTyping:!1})}),re.on("progress_indicator",ye=>{var Le;(Le=ra(ve.current))!=null&&Le.options.silent||x({type:"ADD_PROGRESS_STEP",message:ye.message})}),re.on("routing_result",ye=>{var Le;if(x({type:"SET_ROUTING_RESULT",result:ye}),!ye.isSuccessful){const tt=`Routing failed: ${ye.failureType||"unknown"}`;x({type:"SET_ERROR",error:zg({code:"ROUTING_FAILED"})}),x({type:"SET_CONNECTION_STATUS",status:"error"}),(Le=H.current)==null||Le.call(H,tt)}}),re.on("participant_changed",ye=>{if(ye.participant.name==="Automated Process")return;const Le=ce(j({id:crypto.randomUUID()},ye.entryId?{serverId:ye.entryId}:{}),{role:"system",content:ye.action==="add"?`${ye.participant.name||"Agent"} joined the conversation`:`${ye.participant.name||"Agent"} left the conversation`,timestamp:new Date().toISOString()});p==null||p.log("🦜 MessagingProvider participant_changed event received",{event:ye}),x({type:"ADD_MESSAGE",message:Le})}),re.on("conversation_closed",()=>{const ye={id:crypto.randomUUID(),role:"system",content:"Conversation reset",timestamp:new Date().toISOString()};x({type:"ADD_MESSAGE",message:ye}),x({type:"SET_CONVERSATION_ID",id:null}),V.clearPersistedConversation()}),re.on("error",ye=>{var Le;if(p==null||p.log("🦜 MessagingProvider ERROR event received",{event:ye}),ye.code==="SESSION_EXPIRED"){ue.current=!0,x({type:"SET_SESSION_EXPIRED",expired:!0}),x({type:"SET_CONNECTION_STATUS",status:"disconnected"}),x({type:"SET_LOADING",isLoading:!1});return}x({type:"SET_ERROR",error:zg(ye)}),ye.recoverable||x({type:"SET_CONNECTION_STATUS",status:"error"}),(Le=H.current)==null||Le.call(H,ye.message)});const Ae=ye=>{if(ye!==xe.current)throw ia},ke=ye=>ye===xe.current,Ne=ye=>Be(null,null,function*(){S(!1);let Le=V.getStoredConnectOptions(),tt=!1;Le||(Le=yield V.getPeerConnectOptions(),Ae(ye),tt=!!Le);let Ot=!1;try{if(yield re.connect(Le!=null?Le:void 0),!ke(ye))throw re.disconnect(),ia;Ot=!!(Le!=null&&Le.lastEventId)}catch(Mr){if(Ae(ye),Le&&sf(Mr)){if(p==null||p.log("Stored token expired on connect — falling back to fresh connect"),tt||V.clearPersistedConversation(),yield re.connect(),!ke(ye))throw re.disconnect(),ia;Ot=!1}else throw Mr}O(Ot),yield V.persistContinuationToken(re,()=>ke(ye)),Ae(ye);const Wt=yield V.initializeConversation(re,{isCurrent:()=>ke(ye)});if(Ae(ye),p==null||p.log("🦜 initial connect complete",{conversationId:Wt.conversationId,resumed:Wt.resumed,outcome:Wt.outcome,restoredMessages:Wt.restoredMessages.length}),Wt.outcome==="unverified-error"){Wt.conversationId&&(re.resumeConversation(Wt.conversationId),x({type:"SET_CONVERSATION_ID",id:Wt.conversationId})),S(!0);return}x({type:"SET_CONVERSATION_ID",id:Wt.conversationId}),Wt.resumed&&x({type:"LOAD_HISTORY",messages:Wt.restoredMessages}),S(!0),x({type:"SET_LOADING",isLoading:!1})});return k.current=Ne,()=>{xe.current+=1,Ie.current+=1,re.disconnect(),re.off(),J.current=null,k.current=null,D.current=null,P.current=!1}},[e,t,n,s,et]);const mt=R.useCallback(()=>{if(P.current)return Promise.resolve();if(D.current)return Z.current===xe.current?D.current:D.current.catch(Ne=>{if(Ne!==ia)throw Ne}).then(()=>he.current());const re=k.current;if(!re)return Promise.reject(new Error("Messaging is unavailable"));x({type:"SET_LOADING",isLoading:!0}),x({type:"SET_CONNECTION_STATUS",status:"connecting"});const Ae=++xe.current;Z.current=Ae;const ke=re(Ae).then(()=>{P.current=!0,G(!0)}).catch(Ne=>{var Le;if(Ne===ia)throw Ne;const ye=Ne instanceof Error?Ne.message:String(Ne);throw x({type:"SET_CONNECTION_STATUS",status:"error"}),x({type:"SET_ERROR",error:di(Ne)}),(Le=H.current)==null||Le.call(H,ye),Ne}).finally(()=>{D.current===ke&&(D.current=null)});return D.current=ke,ke},[]);he.current=mt,R.useEffect(()=>{y&&mt().catch(()=>{})},[y,e,t,n,s,mt]);const Lt=R.useCallback(()=>Be(null,null,function*(){const re=J.current;if(!re)return!1;const Ae=V.getStoredConnectOptions();if(!Ae)return p==null||p.log("🦜 attemptResume: no stored identity — cannot resume, will start fresh"),!1;p==null||p.log("🦜 attemptResume: reconnecting on stored identity via continuation token");try{re.disconnect(),yield re.connect(Ae)}catch(Ne){if(sf(Ne))return p==null||p.log("🦜 attemptResume: token expired (401) — will start fresh",{error:Ne instanceof Error?Ne.message:String(Ne)}),!1;throw p==null||p.log("🦜 attemptResume: transient connect failure — rethrowing, session kept",{error:Ne instanceof Error?Ne.message:String(Ne)}),Ne}yield V.persistContinuationToken(re);const ke=yield V.initializeConversation(re,{createIfMissing:!1});return ke.outcome==="not-found-or-closed"||!ke.conversationId?(p==null||p.log("🦜 attemptResume: conversation no longer resumable (closed/not found) — will start fresh"),!1):(ke.outcome==="unverified-error"&&(p==null||p.log("🦜 attemptResume: resume validation failed transiently — keeping live session, resuming optimistically",{conversationId:ke.conversationId}),re.resumeConversation(ke.conversationId)),p==null||p.log("🦜 attemptResume: resumed conversation on same identity",{conversationId:ke.conversationId}),x({type:"SET_CONVERSATION_ID",id:ke.conversationId}),x({type:"SET_CONNECTION_STATUS",status:"connected"}),V.persistConversationId(ke.conversationId),ue.current=!1,x({type:"SET_SESSION_EXPIRED",expired:!1}),!0)}),[V,p]),pn=R.useCallback(re=>Be(null,null,function*(){var ke;const Ae=J.current;if(Ae){re.options.silent||(x({type:"SET_LOADING",isLoading:!0}),x({type:"SET_PROGRESS_MESSAGE",message:""}));try{yield Ae.sendMessage(re.text)}catch(Ne){const ye=di(Ne);x({type:"SET_SEND_ERROR",error:{text:re.text,displayContent:re.displayContent,options:re.options,message:ye}}),(ke=H.current)==null||ke.call(H,Ne instanceof Error?Ne.message:String(Ne)),et(re,{outcome:"failure",message:ye})}}}),[et]),wn=R.useCallback(re=>Be(null,null,function*(){var ke;const Ae=J.current;if(!(!Ae||le.current)){le.current=!0,fe.current=!0;try{if(yield Lt()){re&&(yield pn(re));return}p==null||p.log("🦜 recoverExpiredSession: resume failed — starting a new session + conversation"),ue.current=!1,x({type:"SET_SESSION_EXPIRED",expired:!1}),x({type:"ADD_MESSAGE",message:{id:crypto.randomUUID(),role:"system",content:xk,timestamp:new Date().toISOString()}}),V.clearPersistedConversation(),x({type:"SET_CONNECTION_STATUS",status:"connecting"}),Ae.disconnect(),yield Ae.connect(),yield V.persistContinuationToken(Ae);const Ne=yield Ae.createConversation(yield Ku({routingAttributes:r}));p==null||p.log("🦜 recoverExpiredSession: new conversation created",{conversationId:Ne}),x({type:"SET_CONVERSATION_ID",id:Ne}),x({type:"SET_CONNECTION_STATUS",status:"connected"}),V.persistConversationId(Ne),re&&(yield pn(re))}catch(Ne){const ye=Ne instanceof Error?Ne.message:String(Ne);x({type:"SET_ERROR",error:di(Ne)}),x({type:"SET_CONNECTION_STATUS",status:"error"}),(ke=H.current)==null||ke.call(H,ye),re&&et(re,{outcome:"failure",message:di(Ne)})}finally{le.current=!1,fe.current=!1}}}),[r,V,Lt,pn,p,et]),Dt=R.useRef(wn);Dt.current=wn;const ze=R.useCallback(()=>Be(null,null,function*(){const re=J.current;if(!re||!P.current||le.current)return;if(!M.current.conversationId&&!ue.current){re.reconnect();return}le.current=!0;const Ae=Be(null,null,function*(){try{(yield Lt())||(ue.current=!0,x({type:"SET_SESSION_EXPIRED",expired:!0}),x({type:"SET_CONNECTION_STATUS",status:"disconnected"}))}catch(ke){ue.current=!0,x({type:"SET_SESSION_EXPIRED",expired:!0}),x({type:"SET_CONNECTION_STATUS",status:"disconnected"})}finally{le.current=!1,oe.current=null}});oe.current=Ae,yield Ae}),[Lt]),Ce=R.useRef(ze);Ce.current=ze;const Xe=R.useCallback(()=>Be(null,null,function*(){const re=J.current;if(!re||le.current)return;const Ae=V.getStoredConnectOptions(),ke=Ae==null?void 0:Ae.continuationToken;if(ke){le.current=!0;try{re.disconnect(),yield re.connect({continuationToken:ke}),yield V.persistContinuationToken(re);const Ne=M.current.conversationId;Ne&&re.resumeConversation(Ne)}catch(Ne){if(sf(Ne)){ue.current=!0,x({type:"SET_SESSION_EXPIRED",expired:!0}),x({type:"SET_CONNECTION_STATUS",status:"disconnected"}),x({type:"SET_LOADING",isLoading:!1});return}p==null||p.log("🦜 reconnectOmittingLastEventId: transient connect failure — session kept",{error:Ne instanceof Error?Ne.message:String(Ne)})}finally{le.current=!1}}}),[V,p]);R.useEffect(()=>{const re=()=>{const tt=Date.now();tt-W.current<vk||(W.current=tt,Ce.current())},Ae=()=>{if(document.visibilityState==="hidden"){de.current=Date.now();return}const tt=J.current;if(!tt)return;const Ot=de.current?Date.now()-de.current:0;de.current=0,(ue.current||!tt.isConnected||Ot>Sk)&&re()},ke=tt=>{tt.persisted&&re()},Ne=()=>{de.current=Date.now()},ye=()=>re(),Le=()=>re();return document.addEventListener("visibilitychange",Ae),window.addEventListener("pageshow",ke),window.addEventListener("pagehide",Ne),document.addEventListener("resume",ye),window.addEventListener("online",Le),()=>{document.removeEventListener("visibilitychange",Ae),window.removeEventListener("pageshow",ke),window.removeEventListener("pagehide",Ne),document.removeEventListener("resume",ye),window.removeEventListener("online",Le)}},[]);const nt=R.useCallback((re,Ae)=>Be(null,null,function*(){var Ne;const ke=J.current;if(!ke){et(re,{outcome:"failure",message:"Messaging is unavailable"});return}if(ue.current){yield Dt.current(re);return}try{yield ke.sendMessage(re.text)}catch(ye){if(jg(ye)){yield Dt.current(re);return}const Le=di(ye);x({type:"SET_SEND_ERROR",error:Ae(Le)}),(Ne=H.current)==null||Ne.call(H,ye instanceof Error?ye.message:String(ye)),et(re,{outcome:"failure",message:Le})}}),[et]),pt=R.useCallback(re=>Be(null,null,function*(){const Ae=oe.current;Ae&&(yield Ae),yield re()}),[]),Mt=R.useCallback((re,Ae,ke={})=>new Promise(Ne=>{if(!J.current){Ne({outcome:"failure",message:"Messaging is unavailable"});return}const Le={};Object.assign(Le,{text:re,displayContent:Ae,options:ke,resolve:Ne,timeoutId:setTimeout(()=>{x({type:"SET_LOADING",isLoading:!1}),et(Le,{outcome:"timeout"})},Ak)}),ve.current.push(Le),Ge(),x({type:"CLEAR_SEND_ERROR"}),ke.silent||(x({type:"ADD_MESSAGE",message:{id:crypto.randomUUID(),role:"user",content:Ae!=null?Ae:re,timestamp:new Date().toISOString()}}),x({type:"SET_LOADING",isLoading:!0}),x({type:"SET_PROGRESS_MESSAGE",message:""})),pt(()=>nt(Le,tt=>({text:re,displayContent:Ae,options:ke,message:tt})))}),[nt,pt,et,Ge]),Ln=R.useCallback((re,Ae)=>{if(!re.trim())return Promise.resolve({outcome:"failure",message:"Message is empty"});const ke=Ie.current,Ne=()=>{const tt=()=>ke!==Ie.current?Promise.resolve({outcome:"failure",message:"Message cancelled"}):Mt(re,Ae==null?void 0:Ae.displayContent,Ae);return P.current?tt():mt().then(tt,Ot=>({outcome:"failure",message:di(Ot)}))},ye=Fe.current?Fe.current.then(Ne):Ne(),Le=ye.then(()=>{});return Fe.current=Le,Le.finally(()=>{Fe.current===Le&&(Fe.current=null)}),ye},[Mt,mt]),gs=R.useCallback(re=>{if(!J.current)return;const Ae=Ie.current,{prompt:ke,display:Ne}=Ok(re);mt().then(()=>{if(Ae===Ie.current)return Mt(ke,Ne)}).catch(()=>{})},[Mt,mt]),Es=R.useCallback(()=>{const re=J.current,Ae=M.current.sendError;if(!re||!Ae)return;const ke=()=>fe.current?Promise.resolve({outcome:"failure",message:Ae.message}):Mt(Ae.text,Ae.displayContent,Ae.options),Ne=Fe.current?Fe.current.then(ke):ke(),ye=Ne.then(()=>{});return Fe.current=ye,ye.finally(()=>{Fe.current===ye&&(Fe.current=null)}),Ne},[Mt]),ys=R.useCallback(()=>{const re=J.current;re&&(D.current||(ue.current=!1,P.current=!1,G(!1),re.disconnect(),x({type:"SET_CONNECTION_STATUS",status:"connecting"}),mt().catch(()=>{})))},[mt]),ae=R.useCallback(()=>{const re=J.current;if(!re)return Promise.resolve();if(!P.current)return xe.current+=1,Ie.current+=1,re.disconnect(),V.clearPersistedConversation(),x({type:"RESET"}),Promise.resolve();const Ae=++Ie.current;return ue.current=!1,O(!1),V.clearPersistedConversation(),x({type:"RESET"}),x({type:"SET_LOADING",isLoading:!0}),x({type:"SET_CONNECTION_STATUS",status:"connecting"}),re.endConversation().then(()=>Ae!==Ie.current||J.current!==re?null:(re.disconnect(),re.connect().then(()=>re))).then(ke=>Be(null,null,function*(){return!ke||Ae!==Ie.current||(yield V.persistContinuationToken(ke,()=>Ae===Ie.current&&J.current===ke),Ae!==Ie.current||J.current!==ke)?null:re.createConversation(yield Ku({routingAttributes:r}))})).then(ke=>{!ke||Ae!==Ie.current||J.current!==re||(x({type:"SET_CONVERSATION_ID",id:ke}),x({type:"SET_CONNECTION_STATUS",status:"connected"}),V.persistConversationId(ke))}).catch(ke=>{var Ne;Ae!==Ie.current||J.current!==re||(x({type:"SET_ERROR",error:di(ke)}),x({type:"SET_CONNECTION_STATUS",status:"error"}),(Ne=H.current)==null||Ne.call(H,ke.message))})},[r,V]);Ik({connectionStatus:_.connectionStatus,loading:_.loading,hasMessages:_.messages.length>0,sessionExpired:_.sessionExpired,bootstrapSettled:A,resumeUsedLastEventId:C,recoverySteps:[Xe,ae],onExhausted:()=>{var Ae;const re=di({type:"network"});x({type:"SET_ERROR",error:re}),x({type:"SET_CONNECTION_STATUS",status:"error"}),(Ae=H.current)==null||Ae.call(H,re)},logger:p,isRecoveryInFlight:()=>le.current||oe.current!==null});const _e=R.useCallback(()=>Be(null,null,function*(){var Ne;const re=J.current;if(!re||!M.current.conversationId)return;const Ae=yield re.retrieveConversationTranscript(),ke=URL.createObjectURL(Ae);try{const ye=document.createElement("a");ye.href=ke,ye.download=`transcript-${(Ne=re.conversationId)!=null?Ne:"conversation"}.pdf`,document.body.appendChild(ye),ye.click(),ye.remove()}finally{URL.revokeObjectURL(ke)}}),[]),$e=R.useCallback(()=>Be(null,null,function*(){const re=J.current;if(!re)throw new Error("getAuthLinkKey called before the messaging client connected");return p==null||p.debug("🦜 getAuthLinkKey: requesting single-use auth link key"),re.getAuthLinkKey()}),[p]);R.useEffect(()=>{const re={getAuthLinkKey:$e};return Rk(re),()=>Lk(re)},[$e]);const Ze=_.connectionStatus==="connected"&&_.conversationId!==null;R.useEffect(()=>{U0(Ze)},[Ze]),R.useEffect(()=>()=>U0(!1),[]);const at=R.useMemo(()=>({connectionStatus:_.connectionStatus,isConnected:Ze,isAgentTyping:_.isAgentTyping,conversationId:_.conversationId,messages:_.messages,streamingBlocks:_.streamingBlocks,progressMessage:_.progressMessage,progressSteps:_.progressSteps,error:_.error,sendError:_.sendError,canInitialize:!z&&_.error===null,loading:_.loading,sessionExpired:_.sessionExpired,cartUpdating:_.cartUpdating,sendMessage:Ln,addToCart:gs,resetConversation:ae,retryLastMessage:Es,retryConnection:ys,downloadTranscript:_e,getAuthLinkKey:$e}),[_,Ze,z,Ln,gs,ae,Es,ys,_e,$e]);return w.jsx(Fg.Provider,{value:at,children:m})};var Vg=Symbol.for("immer-nothing"),qg=Symbol.for("immer-draftable"),jn=Symbol.for("immer-state");function ur(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var zs=Object.getPrototypeOf;function $s(e){return!!e&&!!e[jn]}function Xi(e){var t;return e?Yg(e)||Array.isArray(e)||!!e[qg]||!!((t=e.constructor)!=null&&t[qg])||sa(e)||Zu(e):!1}var Mk=Object.prototype.constructor.toString();function Yg(e){if(!e||typeof e!="object")return!1;const t=zs(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Mk}function Qu(e,t){Ju(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Ju(e){const t=e[jn];return t?t.type_:Array.isArray(e)?1:sa(e)?2:Zu(e)?3:0}function of(e,t){return Ju(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Wg(e,t,n){const r=Ju(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Fk(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function sa(e){return e instanceof Map}function Zu(e){return e instanceof Set}function Ki(e){return e.copy_||e.base_}function af(e,t){if(sa(e))return new Map(e);if(Zu(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Yg(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[jn];let s=Reflect.ownKeys(r);for(let a=0;a<s.length;a++){const u=s[a],l=r[u];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(r[u]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[u]})}return Object.create(zs(e),r)}else{const r=zs(e);if(r!==null&&n)return j({},e);const s=Object.create(r);return Object.assign(s,e)}}function uf(e,t=!1){return tl(e)||$s(e)||!Xi(e)||(Ju(e)>1&&Object.defineProperties(e,{set:{value:el},add:{value:el},clear:{value:el},delete:{value:el}}),Object.freeze(e),t&&Object.values(e).forEach(n=>uf(n,!0))),e}function el(){ur(2)}function tl(e){return Object.isFrozen(e)}var Bk={};function Qi(e){const t=Bk[e];return t||ur(0,e),t}var oa;function Gg(){return oa}function Uk(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Xg(e,t){t&&(Qi("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function lf(e){cf(e),e.drafts_.forEach(Hk),e.drafts_=null}function cf(e){e===oa&&(oa=e.parent_)}function Kg(e){return oa=Uk(oa,e)}function Hk(e){const t=e[jn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Qg(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[jn].modified_&&(lf(t),ur(4)),Xi(e)&&(e=nl(t,e),t.parent_||rl(t,e)),t.patches_&&Qi("Patches").generateReplacementPatches_(n[jn].base_,e,t.patches_,t.inversePatches_)):e=nl(t,n,[]),lf(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Vg?e:void 0}function nl(e,t,n){if(tl(t))return t;const r=t[jn];if(!r)return Qu(t,(s,a)=>Jg(e,r,t,s,a,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return rl(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const s=r.copy_;let a=s,u=!1;r.type_===3&&(a=new Set(s),s.clear(),u=!0),Qu(a,(l,d)=>Jg(e,r,s,l,d,n,u)),rl(e,s,!1),n&&e.patches_&&Qi("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Jg(e,t,n,r,s,a,u){if($s(s)){const l=a&&t&&t.type_!==3&&!of(t.assigned_,r)?a.concat(r):void 0,d=nl(e,s,l);if(Wg(n,r,d),$s(d))e.canAutoFreeze_=!1;else return}else u&&n.add(s);if(Xi(s)&&!tl(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;nl(e,s),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(sa(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&rl(e,s)}}function rl(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&uf(t,n)}function jk(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Gg(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=r,a=df;n&&(s=[r],a=aa);const{revoke:u,proxy:l}=Proxy.revocable(s,a);return r.draft_=l,r.revoke_=u,l}var df={get(e,t){if(t===jn)return e;const n=Ki(e);if(!of(n,t))return zk(e,n,t);const r=n[t];return e.finalized_||!Xi(r)?r:r===ff(e.base_,t)?(pf(e),e.copy_[t]=mf(r,e)):r},has(e,t){return t in Ki(e)},ownKeys(e){return Reflect.ownKeys(Ki(e))},set(e,t,n){const r=Zg(Ki(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const s=ff(Ki(e),t),a=s==null?void 0:s[jn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Fk(n,s)&&(n!==void 0||of(e.base_,t)))return!0;pf(e),hf(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return ff(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,pf(e),hf(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Ki(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ur(11)},getPrototypeOf(e){return zs(e.base_)},setPrototypeOf(){ur(12)}},aa={};Qu(df,(e,t)=>{aa[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),aa.deleteProperty=function(e,t){return aa.set.call(this,e,t,void 0)},aa.set=function(e,t,n){return df.set.call(this,e[0],t,n,e[0])};function ff(e,t){const n=e[jn];return(n?Ki(n):e)[t]}function zk(e,t,n){var s;const r=Zg(t,n);return r?"value"in r?r.value:(s=r.get)==null?void 0:s.call(e.draft_):void 0}function Zg(e,t){if(!(t in e))return;let n=zs(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=zs(n)}}function hf(e){e.modified_||(e.modified_=!0,e.parent_&&hf(e.parent_))}function pf(e){e.copy_||(e.copy_=af(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var $k=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const u=this;return function(d=a,...f){return u.produce(d,m=>n.call(this,m,...f))}}typeof n!="function"&&ur(6),r!==void 0&&typeof r!="function"&&ur(7);let s;if(Xi(t)){const a=Kg(this),u=mf(t,void 0);let l=!0;try{s=n(u),l=!1}finally{l?lf(a):cf(a)}return Xg(a,r),Qg(s,a)}else if(!t||typeof t!="object"){if(s=n(t),s===void 0&&(s=t),s===Vg&&(s=void 0),this.autoFreeze_&&uf(s,!0),r){const a=[],u=[];Qi("Patches").generateReplacementPatches_(t,s,a,u),r(a,u)}return s}else ur(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(u,...l)=>this.produceWithPatches(u,d=>t(d,...l));let r,s;return[this.produce(t,n,(u,l)=>{r=u,s=l}),r,s]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Xi(e)||ur(8),$s(e)&&(e=Vk(e));const t=Kg(this),n=mf(e,void 0);return n[jn].isManual_=!0,cf(t),n}finishDraft(e,t){const n=e&&e[jn];(!n||!n.isManual_)&&ur(9);const{scope_:r}=n;return Xg(r,t),Qg(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const s=t[n];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}n>-1&&(t=t.slice(n+1));const r=Qi("Patches").applyPatches_;return $s(e)?r(e,t):this.produce(e,s=>r(s,t))}};function mf(e,t){const n=sa(e)?Qi("MapSet").proxyMap_(e,t):Zu(e)?Qi("MapSet").proxySet_(e,t):jk(e,t);return(t?t.scope_:Gg()).drafts_.push(n),n}function Vk(e){return $s(e)||ur(10,e),e1(e)}function e1(e){if(!Xi(e)||tl(e))return e;const t=e[jn];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=af(e,t.scope_.immer_.useStrictShallowCopy_)}else n=af(e,!0);return Qu(n,(r,s)=>{Wg(n,r,e1(s))}),t&&(t.finalized_=!1),n}var qk=new $k,Yk=qk.produce;function Wk(e,t,n){var r=R.useMemo(function(){return Yk(e)},[e]);return R.useReducer(r,t,n)}const Gk=e=>Array.from(new Set((e!=null?e:[]).map(t=>t.trim()).filter(Boolean))),t1=R.createContext(null),n1=R.createContext(null),Xk=({children:e,dispatch:t})=>{const n=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_INITIALIZED,payload:_})},[t]),r=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_OPEN,payload:_})},[t]),s=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_INLINE,payload:_})},[t]),a=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_ELEMENT_ID,payload:_})},[t]),u=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_ENTRY_TYPE,payload:_})},[t]),l=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID,payload:_})},[t]),d=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_USER_PROMPT,payload:_})},[t]),f=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_PARAMS,payload:_})},[t]),m=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_PROMPTS_MESSAGE,payload:_})},[t]),p=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_RESPONSE_MESSAGE,payload:_})},[t]),b=R.useCallback(_=>{t({type:bt.SET_PROMPTS_EXTENSION_RESPONSE_LOADING,payload:_})},[t]),y=R.useMemo(()=>({setIsInitialized:n,setIsOpen:r,setIsInline:s,setElementId:a,setEntryType:u,setActivePromptsId:l,setUserPrompt:d,setParams:f,setPromptsMessage:m,setResponseMessage:p,setIsResponseLoading:b}),[n,r,s,a,u,l,d,f,m,p,b]);return w.jsx(n1.Provider,{value:y,children:e})},Kk=(e,t)=>{const{type:n,payload:r}=t;switch(n){case bt.SET_PROMPTS_EXTENSION_INITIALIZED:e.isInitialized=r;break;case bt.SET_PROMPTS_EXTENSION_OPEN:e.isOpen=r;break;case bt.SET_PROMPTS_EXTENSION_INLINE:e.isInline=r;break;case bt.SET_PROMPTS_EXTENSION_ELEMENT_ID:e.elementId=r;break;case bt.SET_PROMPTS_EXTENSION_ENTRY_TYPE:e.entryType=r;break;case bt.SET_PROMPTS_EXTENSION_PARAMS:e.params=r;break;case bt.RESET_PROMPTS_EXTENSION_PARAMS:e.params=null;break;case bt.SET_PROMPTS_EXTENSION_USER_PROMPT:e.userPrompt=r;break;case bt.SET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID:e.activePromptsId=r;break;case bt.RESET_PROMPTS_EXTENSION_ACTIVE_PROMPTS_ID:e.activePromptsId=null;break;case bt.SET_PROMPTS_EXTENSION_PROMPTS_MESSAGE:e.promptsMessage=r;break;case bt.RESET_PROMPTS_EXTENSION_PROMPTS_MESSAGE:e.promptsMessage=null;break;case bt.SET_PROMPTS_EXTENSION_RESPONSE_MESSAGE:e.responseMessage=r;break;case bt.RESET_PROMPTS_EXTENSION_RESPONSE_MESSAGE:e.responseMessage=null;break;case bt.SET_PROMPTS_EXTENSION_RESPONSE_LOADING:e.isResponseLoading=r;break}},Qk=({promptsConfig:e,children:t})=>{const[n,r]=Wk(Kk,ce(j(j({},z0),e||{}),{staticQuestions:Gk((e==null?void 0:e.staticQuestions)||[])}));return w.jsx(t1.Provider,{value:n,children:w.jsx(Xk,{dispatch:r,children:t})})},Jk={productId:Ko.productId,pdpLink:Ko.pdpLink},r1=R.createContext(Jk),Zk=({children:e})=>{const[t,n]=R.useState(Ko.productId),[r,s]=R.useState(Ko.pdpLink);R.useEffect(()=>{const u=({detail:l})=>{if((l==null?void 0:l.property)==="pdp-context"){const d=l.value;n(d.productId),s(d.pdpLink);return}(l==null?void 0:l.property)==="productId"&&n(l.value),(l==null?void 0:l.property)==="pdpLink"&&s(l.value)};return vS(u),()=>{AS(u)}},[]);const a=R.useMemo(()=>({productId:t,pdpLink:r}),[t,r]);return w.jsx(r1.Provider,{value:a,children:e})},eC=e=>new Promise(t=>{let r;try{r=new URL(e)}catch(d){St(!0,"error",`[CimulateOverrides] Invalid URL provided: ${e}. Using default components.`),t({});return}if(r.protocol!=="https:"){St(!0,"error",`[CimulateOverrides] Override URL must use HTTPS, got ${r.protocol}. Using default components.`),t({});return}const s=document.createElement("script");s.src=e,s.async=!0,s.crossOrigin="anonymous";let a=!1;const u=()=>{a=!0,clearTimeout(l)};s.onload=()=>{if(a)return;u();const d=window.CimulateOverrides;d&&typeof d=="object"?(St(!0,"log","[CimulateOverrides] Override script loaded successfully."),t(d)):(St(!0,"warn","[CimulateOverrides] Override script loaded but window.CimulateOverrides is not set. Using default components."),t({}))},s.onerror=()=>{a||(u(),St(!0,"warn",`[CimulateOverrides] Failed to load override script from: ${e}. Using default components.`),t({}))};const l=setTimeout(()=>{a||(a=!0,St(!0,"warn",`[CimulateOverrides] Override script timed out after 5000ms: ${e}. Using default components.`),t({}))},5e3);document.head.appendChild(s)}),i1=R.createContext({overrides:{},isInitialized:!1}),tC=({overridesUrl:e,inlineOverrides:t,children:n})=>{const[r,s]=R.useState({}),[a,u]=R.useState(!1);R.useEffect(()=>{Be(null,null,function*(){let f={};e?(St(!0,"log","[CimulateOverrides] Loading overrides from URL..."),f=yield eC(e)):t&&typeof t=="object"?(St(!0,"log","[CimulateOverrides] Using inline overrides."),f=t):window.CimulateOverrides&&typeof window.CimulateOverrides=="object"&&(St(!0,"log","[CimulateOverrides] Using window.CimulateOverrides."),f=window.CimulateOverrides),s(f),u(!0)})},[e,t]);const l=R.useMemo(()=>({overrides:r,isInitialized:a}),[r,a]);return w.jsx(i1.Provider,{value:l,children:n})},s1=({mode:e,apiKey:t,apiToken:n,baseUrl:r,logoUrl:s,headerText:a,headerConfig:u,theme:l,openLinksInNewTab:d,globalClassName:f,isDevelopment:m=!1,componentType:p,componentConfig:b,entryType:y,initialEntry:_,entryMessage:x,disclaimerText:A,disclaimerMarkdown:S,clientContext:C,searchPlaceholder:O,searchButtonLabel:z,searchConfig:G,suggestionButtonConfig:M,messageAlignment:V,autoScroll:J,promptsConfig:se,showProductDescription:H,resetConversationMessage:ie,conversationHistory:te,messagingConfig:le,overrides:fe,overridesUrl:ue,inlineOverrides:Se,__features:de,children:W})=>{const oe=R.useRef(!1);return oe.current||(oe.current=!0,OS({initialEntry:_,entryType:y,isDevelopment:m})),w.jsx(XA,{mode:e,baseUrl:r,apiKey:t,apiToken:n,logoUrl:s,headerText:a,headerConfig:u,entryMessage:x,theme:l,globalClassName:f,openLinksInNewTab:d,searchPlaceholder:O,searchButtonLabel:z,searchConfig:G,suggestionButtonConfig:M,messageAlignment:V,autoScroll:J,showProductDescription:H,componentConfig:b,clientContext:C,disclaimerMarkdown:S,disclaimerText:A,resetConversationMessage:ie,conversationHistory:te,isDevelopment:m,__features:de,progressStepsLimit:le==null?void 0:le.progressStepsLimit,routingAttributes:le==null?void 0:le.routingAttributes,enableDownloadTranscript:le==null?void 0:le.enableDownloadTranscript,enableEscalationToAgent:le==null?void 0:le.enableEscalationToAgent,showProductCaptions:le==null?void 0:le.showProductCaptions,children:w.jsx(ZS,{entryType:y!=null?y:_==null?void 0:_.type,componentConfig:b,componentType:p,children:w.jsx(Zk,{children:w.jsx(Qk,{promptsConfig:se,children:w.jsx(tC,{overridesUrl:ue,inlineOverrides:Se||fe,children:w.jsx($g,{scrt2Url:(le==null?void 0:le.scrt2Url)||"",orgId:(le==null?void 0:le.orgId)||"",esDeveloperName:(le==null?void 0:le.esDeveloperName)||"",routingAttributes:(le==null?void 0:le.routingAttributes)||{},capabilitiesVersion:le==null?void 0:le.capabilitiesVersion,enableLogging:m,onProductResult:le==null?void 0:le.onProductResult,children:W})})})})})})};var gf={exports:{}},kn={},Ef={exports:{}},yf={};var o1;function nC(){return o1||(o1=1,(function(e){function t(W,oe){var k=W.length;W.push(oe);e:for(;0<k;){var D=k-1>>>1,Z=W[D];if(0<s(Z,oe))W[D]=oe,W[k]=Z,k=D;else break e}}function n(W){return W.length===0?null:W[0]}function r(W){if(W.length===0)return null;var oe=W[0],k=W.pop();if(k!==oe){W[0]=k;e:for(var D=0,Z=W.length,P=Z>>>1;D<P;){var xe=2*(D+1)-1,Ie=W[xe],he=xe+1,ve=W[he];if(0>s(Ie,k))he<Z&&0>s(ve,Ie)?(W[D]=ve,W[he]=k,D=he):(W[D]=Ie,W[xe]=k,D=xe);else if(he<Z&&0>s(ve,k))W[D]=ve,W[he]=k,D=he;else break e}}return oe}function s(W,oe){var k=W.sortIndex-oe.sortIndex;return k!==0?k:W.id-oe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var u=Date,l=u.now();e.unstable_now=function(){return u.now()-l}}var d=[],f=[],m=1,p=null,b=3,y=!1,_=!1,x=!1,A=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(W){for(var oe=n(f);oe!==null;){if(oe.callback===null)r(f);else if(oe.startTime<=W)r(f),oe.sortIndex=oe.expirationTime,t(d,oe);else break;oe=n(f)}}function z(W){if(x=!1,O(W),!_)if(n(d)!==null)_=!0,Se(G);else{var oe=n(f);oe!==null&&de(z,oe.startTime-W)}}function G(W,oe){_=!1,x&&(x=!1,S(J),J=-1),y=!0;var k=b;try{for(O(oe),p=n(d);p!==null&&(!(p.expirationTime>oe)||W&&!ie());){var D=p.callback;if(typeof D=="function"){p.callback=null,b=p.priorityLevel;var Z=D(p.expirationTime<=oe);oe=e.unstable_now(),typeof Z=="function"?p.callback=Z:p===n(d)&&r(d),O(oe)}else r(d);p=n(d)}if(p!==null)var P=!0;else{var xe=n(f);xe!==null&&de(z,xe.startTime-oe),P=!1}return P}finally{p=null,b=k,y=!1}}var M=!1,V=null,J=-1,se=5,H=-1;function ie(){return!(e.unstable_now()-H<se)}function te(){if(V!==null){var W=e.unstable_now();H=W;var oe=!0;try{oe=V(!0,W)}finally{oe?le():(M=!1,V=null)}}else M=!1}var le;if(typeof C=="function")le=function(){C(te)};else if(typeof MessageChannel!="undefined"){var fe=new MessageChannel,ue=fe.port2;fe.port1.onmessage=te,le=function(){ue.postMessage(null)}}else le=function(){A(te,0)};function Se(W){V=W,M||(M=!0,le())}function de(W,oe){J=A(function(){W(e.unstable_now())},oe)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(W){W.callback=null},e.unstable_continueExecution=function(){_||y||(_=!0,Se(G))},e.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):se=0<W?Math.floor(1e3/W):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(W){switch(b){case 1:case 2:case 3:var oe=3;break;default:oe=b}var k=b;b=oe;try{return W()}finally{b=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(W,oe){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var k=b;b=W;try{return oe()}finally{b=k}},e.unstable_scheduleCallback=function(W,oe,k){var D=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?D+k:D):k=D,W){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=k+Z,W={id:m++,callback:oe,priorityLevel:W,startTime:k,expirationTime:Z,sortIndex:-1},k>D?(W.sortIndex=k,t(f,W),n(d)===null&&W===n(f)&&(x?(S(J),J=-1):x=!0,de(z,k-D))):(W.sortIndex=Z,t(d,W),_||y||(_=!0,Se(G))),W},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(W){var oe=b;return function(){var k=b;b=oe;try{return W.apply(this,arguments)}finally{b=k}}}})(yf)),yf}var a1;function rC(){return a1||(a1=1,Ef.exports=nC()),Ef.exports}var u1;function iC(){if(u1)return kn;u1=1;var e=sr(),t=rC();function n(i){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+i,c=1;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function a(i,o){u(i,o),u(i+"Capture",o)}function u(i,o){for(s[i]=o,i=0;i<o.length;i++)r.add(o[i])}var l=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},p={};function b(i){return d.call(p,i)?!0:d.call(m,i)?!1:f.test(i)?p[i]=!0:(m[i]=!0,!1)}function y(i,o,c,h){if(c!==null&&c.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return h?!1:c!==null?!c.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function _(i,o,c,h){if(o===null||typeof o=="undefined"||y(i,o,c,h))return!0;if(h)return!1;if(c!==null)switch(c.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function x(i,o,c,h,E,T,v){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=h,this.attributeNamespace=E,this.mustUseProperty=c,this.propertyName=i,this.type=o,this.sanitizeURL=T,this.removeEmptyString=v}var A={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){A[i]=new x(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var o=i[0];A[o]=new x(o,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){A[i]=new x(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){A[i]=new x(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){A[i]=new x(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){A[i]=new x(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){A[i]=new x(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){A[i]=new x(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){A[i]=new x(i,5,!1,i.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function C(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var o=i.replace(S,C);A[o]=new x(o,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var o=i.replace(S,C);A[o]=new x(o,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var o=i.replace(S,C);A[o]=new x(o,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){A[i]=new x(i,1,!1,i.toLowerCase(),null,!1,!1)}),A.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){A[i]=new x(i,1,!1,i.toLowerCase(),null,!0,!0)});function O(i,o,c,h){var E=A.hasOwnProperty(o)?A[o]:null;(E!==null?E.type!==0:h||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(_(o,c,E,h)&&(c=null),h||E===null?b(o)&&(c===null?i.removeAttribute(o):i.setAttribute(o,""+c)):E.mustUseProperty?i[E.propertyName]=c===null?E.type===3?!1:"":c:(o=E.attributeName,h=E.attributeNamespace,c===null?i.removeAttribute(o):(E=E.type,c=E===3||E===4&&c===!0?"":""+c,h?i.setAttributeNS(h,o,c):i.setAttribute(o,c))))}var z=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,G=Symbol.for("react.element"),M=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),J=Symbol.for("react.strict_mode"),se=Symbol.for("react.profiler"),H=Symbol.for("react.provider"),ie=Symbol.for("react.context"),te=Symbol.for("react.forward_ref"),le=Symbol.for("react.suspense"),fe=Symbol.for("react.suspense_list"),ue=Symbol.for("react.memo"),Se=Symbol.for("react.lazy"),de=Symbol.for("react.offscreen"),W=Symbol.iterator;function oe(i){return i===null||typeof i!="object"?null:(i=W&&i[W]||i["@@iterator"],typeof i=="function"?i:null)}var k=Object.assign,D;function Z(i){if(D===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);D=o&&o[1]||""}return`
17
+ `+D+i}var P=!1;function xe(i,o){if(!i||P)return"";P=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(ee){var h=ee}Reflect.construct(i,[],o)}else{try{o.call()}catch(ee){h=ee}i.call(o.prototype)}else{try{throw Error()}catch(ee){h=ee}i()}}catch(ee){if(ee&&h&&typeof ee.stack=="string"){for(var E=ee.stack.split(`
18
18
  `),T=h.stack.split(`
19
19
  `),v=E.length-1,F=T.length-1;1<=v&&0<=F&&E[v]!==T[F];)F--;for(;1<=v&&0<=F;v--,F--)if(E[v]!==T[F]){if(v!==1||F!==1)do if(v--,F--,0>F||E[v]!==T[F]){var $=`
20
- `+E[v].replace(" at new "," at ");return i.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",i.displayName)),$}while(1<=v&&0<=F);break}}}finally{P=!1,Error.prepareStackTrace=c}return(i=i?i.displayName||i.name:"")?Z(i):""}function Ie(i){switch(i.tag){case 5:return Z(i.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return i=xe(i.type,!1),i;case 11:return i=xe(i.type.render,!1),i;case 1:return i=xe(i.type,!0),i;default:return""}}function he(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case V:return"Fragment";case D:return"Portal";case se:return"Profiler";case J:return"StrictMode";case le:return"Suspense";case fe:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case ie:return(i.displayName||"Context")+".Consumer";case H:return(i._context.displayName||"Context")+".Provider";case te:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case ue:return o=i.displayName||null,o!==null?o:he(i.type)||"Memo";case Se:o=i._payload,i=i._init;try{return he(i(o))}catch(c){}}return null}function ve(i){var o=i.type;switch(i.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=o.render,i=i.displayName||i.name||"",o.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return he(o);case 8:return o===J?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function Fe(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Ge(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function et(i){var o=Ge(i)?"checked":"value",c=Object.getOwnPropertyDescriptor(i.constructor.prototype,o),h=""+i[o];if(!i.hasOwnProperty(o)&&typeof c!="undefined"&&typeof c.get=="function"&&typeof c.set=="function"){var E=c.get,T=c.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return E.call(this)},set:function(v){h=""+v,T.call(this,v)}}),Object.defineProperty(i,o,{enumerable:c.enumerable}),{getValue:function(){return h},setValue:function(v){h=""+v},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function mt(i){i._valueTracker||(i._valueTracker=et(i))}function Lt(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var c=o.getValue(),h="";return i&&(h=Ge(i)?i.checked?"true":"false":i.value),i=h,i!==c?(o.setValue(i),!0):!1}function pn(i){if(i=i||(typeof document!="undefined"?document:void 0),typeof i=="undefined")return null;try{return i.activeElement||i.body}catch(o){return i.body}}function wn(i,o){var c=o.checked;return k({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:c!=null?c:i._wrapperState.initialChecked})}function Dt(i,o){var c=o.defaultValue==null?"":o.defaultValue,h=o.checked!=null?o.checked:o.defaultChecked;c=Fe(o.value!=null?o.value:c),i._wrapperState={initialChecked:h,initialValue:c,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function ze(i,o){o=o.checked,o!=null&&O(i,"checked",o,!1)}function Ce(i,o){ze(i,o);var c=Fe(o.value),h=o.type;if(c!=null)h==="number"?(c===0&&i.value===""||i.value!=c)&&(i.value=""+c):i.value!==""+c&&(i.value=""+c);else if(h==="submit"||h==="reset"){i.removeAttribute("value");return}o.hasOwnProperty("value")?nt(i,o.type,c):o.hasOwnProperty("defaultValue")&&nt(i,o.type,Fe(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(i.defaultChecked=!!o.defaultChecked)}function Xe(i,o,c){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var h=o.type;if(!(h!=="submit"&&h!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+i._wrapperState.initialValue,c||o===i.value||(i.value=o),i.defaultValue=o}c=i.name,c!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,c!==""&&(i.name=c)}function nt(i,o,c){(o!=="number"||pn(i.ownerDocument)!==i)&&(c==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+c&&(i.defaultValue=""+c))}var pt=Array.isArray;function Mt(i,o,c,h){if(i=i.options,o){o={};for(var E=0;E<c.length;E++)o["$"+c[E]]=!0;for(c=0;c<i.length;c++)E=o.hasOwnProperty("$"+i[c].value),i[c].selected!==E&&(i[c].selected=E),E&&h&&(i[c].defaultSelected=!0)}else{for(c=""+Fe(c),o=null,E=0;E<i.length;E++){if(i[E].value===c){i[E].selected=!0,h&&(i[E].defaultSelected=!0);return}o!==null||i[E].disabled||(o=i[E])}o!==null&&(o.selected=!0)}}function Ln(i,o){if(o.dangerouslySetInnerHTML!=null)throw Error(n(91));return k({},o,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function gs(i,o){var c=o.value;if(c==null){if(c=o.children,o=o.defaultValue,c!=null){if(o!=null)throw Error(n(92));if(pt(c)){if(1<c.length)throw Error(n(93));c=c[0]}o=c}o==null&&(o=""),c=o}i._wrapperState={initialValue:Fe(c)}}function Es(i,o){var c=Fe(o.value),h=Fe(o.defaultValue);c!=null&&(c=""+c,c!==i.value&&(i.value=c),o.defaultValue==null&&i.defaultValue!==c&&(i.defaultValue=c)),h!=null&&(i.defaultValue=""+h)}function ys(i){var o=i.textContent;o===i._wrapperState.initialValue&&o!==""&&o!==null&&(i.value=o)}function ae(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function _e(i,o){return i==null||i==="http://www.w3.org/1999/xhtml"?ae(o):i==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var $e,Ze=(function(i){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(o,c,h,E){MSApp.execUnsafeLocalFunction(function(){return i(o,c,h,E)})}:i})(function(i,o){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=o;else{for($e=$e||document.createElement("div"),$e.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=$e.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;o.firstChild;)i.appendChild(o.firstChild)}});function at(i,o){if(o){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=o;return}}i.textContent=o}var re={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ae=["Webkit","ms","Moz","O"];Object.keys(re).forEach(function(i){Ae.forEach(function(o){o=o+i.charAt(0).toUpperCase()+i.substring(1),re[o]=re[i]})});function ke(i,o,c){return o==null||typeof o=="boolean"||o===""?"":c||typeof o!="number"||o===0||re.hasOwnProperty(i)&&re[i]?(""+o).trim():o+"px"}function Ne(i,o){i=i.style;for(var c in o)if(o.hasOwnProperty(c)){var h=c.indexOf("--")===0,E=ke(c,o[c],h);c==="float"&&(c="cssFloat"),h?i.setProperty(c,E):i[c]=E}}var ye=k({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Le(i,o){if(o){if(ye[i]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(n(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(n(61))}if(o.style!=null&&typeof o.style!="object")throw Error(n(62))}}function tt(i,o){if(i.indexOf("-")===-1)return typeof o.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ot=null;function Wt(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Mr=null,Jr=null,Zr=null;function $w(i){if(i=fu(i)){if(typeof Mr!="function")throw Error(n(280));var o=i.stateNode;o&&(o=Oc(o),Mr(i.stateNode,i.type,o))}}function Vw(i){Jr?Zr?Zr.push(i):Zr=[i]:Jr=i}function qw(){if(Jr){var i=Jr,o=Zr;if(Zr=Jr=null,$w(i),o)for(i=0;i<o.length;i++)$w(o[i])}}function Yw(i,o){return i(o)}function Ww(){}var kp=!1;function Gw(i,o,c){if(kp)return i(o,c);kp=!0;try{return Yw(i,o,c)}finally{kp=!1,(Jr!==null||Zr!==null)&&(Ww(),qw())}}function qa(i,o){var c=i.stateNode;if(c===null)return null;var h=Oc(c);if(h===null)return null;c=h[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(i=i.type,h=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!h;break e;default:i=!1}if(i)return null;if(c&&typeof c!="function")throw Error(n(231,o,typeof c));return c}var Cp=!1;if(l)try{var Ya={};Object.defineProperty(Ya,"passive",{get:function(){Cp=!0}}),window.addEventListener("test",Ya,Ya),window.removeEventListener("test",Ya,Ya)}catch(i){Cp=!1}function sB(i,o,c,h,E,T,v,F,$){var ee=Array.prototype.slice.call(arguments,3);try{o.apply(c,ee)}catch(ge){this.onError(ge)}}var Wa=!1,uc=null,lc=!1,Np=null,oB={onError:function(i){Wa=!0,uc=i}};function aB(i,o,c,h,E,T,v,F,$){Wa=!1,uc=null,sB.apply(oB,arguments)}function uB(i,o,c,h,E,T,v,F,$){if(aB.apply(this,arguments),Wa){if(Wa){var ee=uc;Wa=!1,uc=null}else throw Error(n(198));lc||(lc=!0,Np=ee)}}function Ts(i){var o=i,c=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(c=o.return),i=o.return;while(i)}return o.tag===3?c:null}function Xw(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function Kw(i){if(Ts(i)!==i)throw Error(n(188))}function lB(i){var o=i.alternate;if(!o){if(o=Ts(i),o===null)throw Error(n(188));return o!==i?null:i}for(var c=i,h=o;;){var E=c.return;if(E===null)break;var T=E.alternate;if(T===null){if(h=E.return,h!==null){c=h;continue}break}if(E.child===T.child){for(T=E.child;T;){if(T===c)return Kw(E),i;if(T===h)return Kw(E),o;T=T.sibling}throw Error(n(188))}if(c.return!==h.return)c=E,h=T;else{for(var v=!1,F=E.child;F;){if(F===c){v=!0,c=E,h=T;break}if(F===h){v=!0,h=E,c=T;break}F=F.sibling}if(!v){for(F=T.child;F;){if(F===c){v=!0,c=T,h=E;break}if(F===h){v=!0,h=T,c=E;break}F=F.sibling}if(!v)throw Error(n(189))}}if(c.alternate!==h)throw Error(n(190))}if(c.tag!==3)throw Error(n(188));return c.stateNode.current===c?i:o}function Qw(i){return i=lB(i),i!==null?Jw(i):null}function Jw(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var o=Jw(i);if(o!==null)return o;i=i.sibling}return null}var Zw=t.unstable_scheduleCallback,e_=t.unstable_cancelCallback,cB=t.unstable_shouldYield,dB=t.unstable_requestPaint,Ht=t.unstable_now,fB=t.unstable_getCurrentPriorityLevel,Op=t.unstable_ImmediatePriority,t_=t.unstable_UserBlockingPriority,cc=t.unstable_NormalPriority,hB=t.unstable_LowPriority,n_=t.unstable_IdlePriority,dc=null,Fr=null;function pB(i){if(Fr&&typeof Fr.onCommitFiberRoot=="function")try{Fr.onCommitFiberRoot(dc,i,void 0,(i.current.flags&128)===128)}catch(o){}}var mr=Math.clz32?Math.clz32:EB,mB=Math.log,gB=Math.LN2;function EB(i){return i>>>=0,i===0?32:31-(mB(i)/gB|0)|0}var fc=64,hc=4194304;function Ga(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function pc(i,o){var c=i.pendingLanes;if(c===0)return 0;var h=0,E=i.suspendedLanes,T=i.pingedLanes,v=c&268435455;if(v!==0){var F=v&~E;F!==0?h=Ga(F):(T&=v,T!==0&&(h=Ga(T)))}else v=c&~E,v!==0?h=Ga(v):T!==0&&(h=Ga(T));if(h===0)return 0;if(o!==0&&o!==h&&(o&E)===0&&(E=h&-h,T=o&-o,E>=T||E===16&&(T&4194240)!==0))return o;if((h&4)!==0&&(h|=c&16),o=i.entangledLanes,o!==0)for(i=i.entanglements,o&=h;0<o;)c=31-mr(o),E=1<<c,h|=i[c],o&=~E;return h}function yB(i,o){switch(i){case 1:case 2:case 4:return o+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function TB(i,o){for(var c=i.suspendedLanes,h=i.pingedLanes,E=i.expirationTimes,T=i.pendingLanes;0<T;){var v=31-mr(T),F=1<<v,$=E[v];$===-1?((F&c)===0||(F&h)!==0)&&(E[v]=yB(F,o)):$<=o&&(i.expiredLanes|=F),T&=~F}}function Ip(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function r_(){var i=fc;return fc<<=1,(fc&4194240)===0&&(fc=64),i}function Pp(i){for(var o=[],c=0;31>c;c++)o.push(i);return o}function Xa(i,o,c){i.pendingLanes|=o,o!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,o=31-mr(o),i[o]=c}function bB(i,o){var c=i.pendingLanes&~o;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=o,i.mutableReadLanes&=o,i.entangledLanes&=o,o=i.entanglements;var h=i.eventTimes;for(i=i.expirationTimes;0<c;){var E=31-mr(c),T=1<<E;o[E]=0,h[E]=-1,i[E]=-1,c&=~T}}function Rp(i,o){var c=i.entangledLanes|=o;for(i=i.entanglements;c;){var h=31-mr(c),E=1<<h;E&o|i[h]&o&&(i[h]|=o),c&=~E}}var gt=0;function i_(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var s_,Lp,o_,a_,u_,Dp=!1,mc=[],xi=null,Si=null,vi=null,Ka=new Map,Qa=new Map,Ai=[],wB="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function l_(i,o){switch(i){case"focusin":case"focusout":xi=null;break;case"dragenter":case"dragleave":Si=null;break;case"mouseover":case"mouseout":vi=null;break;case"pointerover":case"pointerout":Ka.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qa.delete(o.pointerId)}}function Ja(i,o,c,h,E,T){return i===null||i.nativeEvent!==T?(i={blockedOn:o,domEventName:c,eventSystemFlags:h,nativeEvent:T,targetContainers:[E]},o!==null&&(o=fu(o),o!==null&&Lp(o)),i):(i.eventSystemFlags|=h,o=i.targetContainers,E!==null&&o.indexOf(E)===-1&&o.push(E),i)}function _B(i,o,c,h,E){switch(o){case"focusin":return xi=Ja(xi,i,o,c,h,E),!0;case"dragenter":return Si=Ja(Si,i,o,c,h,E),!0;case"mouseover":return vi=Ja(vi,i,o,c,h,E),!0;case"pointerover":var T=E.pointerId;return Ka.set(T,Ja(Ka.get(T)||null,i,o,c,h,E)),!0;case"gotpointercapture":return T=E.pointerId,Qa.set(T,Ja(Qa.get(T)||null,i,o,c,h,E)),!0}return!1}function c_(i){var o=bs(i.target);if(o!==null){var c=Ts(o);if(c!==null){if(o=c.tag,o===13){if(o=Xw(c),o!==null){i.blockedOn=o,u_(i.priority,function(){o_(c)});return}}else if(o===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function gc(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var c=Fp(i.domEventName,i.eventSystemFlags,o[0],i.nativeEvent);if(c===null){c=i.nativeEvent;var h=new c.constructor(c.type,c);Ot=h,c.target.dispatchEvent(h),Ot=null}else return o=fu(c),o!==null&&Lp(o),i.blockedOn=c,!1;o.shift()}return!0}function d_(i,o,c){gc(i)&&c.delete(o)}function xB(){Dp=!1,xi!==null&&gc(xi)&&(xi=null),Si!==null&&gc(Si)&&(Si=null),vi!==null&&gc(vi)&&(vi=null),Ka.forEach(d_),Qa.forEach(d_)}function Za(i,o){i.blockedOn===o&&(i.blockedOn=null,Dp||(Dp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,xB)))}function eu(i){function o(E){return Za(E,i)}if(0<mc.length){Za(mc[0],i);for(var c=1;c<mc.length;c++){var h=mc[c];h.blockedOn===i&&(h.blockedOn=null)}}for(xi!==null&&Za(xi,i),Si!==null&&Za(Si,i),vi!==null&&Za(vi,i),Ka.forEach(o),Qa.forEach(o),c=0;c<Ai.length;c++)h=Ai[c],h.blockedOn===i&&(h.blockedOn=null);for(;0<Ai.length&&(c=Ai[0],c.blockedOn===null);)c_(c),c.blockedOn===null&&Ai.shift()}var vo=z.ReactCurrentBatchConfig,Ec=!0;function SB(i,o,c,h){var E=gt,T=vo.transition;vo.transition=null;try{gt=1,Mp(i,o,c,h)}finally{gt=E,vo.transition=T}}function vB(i,o,c,h){var E=gt,T=vo.transition;vo.transition=null;try{gt=4,Mp(i,o,c,h)}finally{gt=E,vo.transition=T}}function Mp(i,o,c,h){if(Ec){var E=Fp(i,o,c,h);if(E===null)em(i,o,h,yc,c),l_(i,h);else if(_B(E,i,o,c,h))h.stopPropagation();else if(l_(i,h),o&4&&-1<wB.indexOf(i)){for(;E!==null;){var T=fu(E);if(T!==null&&s_(T),T=Fp(i,o,c,h),T===null&&em(i,o,h,yc,c),T===E)break;E=T}E!==null&&h.stopPropagation()}else em(i,o,h,null,c)}}var yc=null;function Fp(i,o,c,h){if(yc=null,i=Wt(h),i=bs(i),i!==null)if(o=Ts(i),o===null)i=null;else if(c=o.tag,c===13){if(i=Xw(o),i!==null)return i;i=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null);return yc=i,null}function f_(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(fB()){case Op:return 1;case t_:return 4;case cc:case hB:return 16;case n_:return 536870912;default:return 16}default:return 16}}var ki=null,Bp=null,Tc=null;function h_(){if(Tc)return Tc;var i,o=Bp,c=o.length,h,E="value"in ki?ki.value:ki.textContent,T=E.length;for(i=0;i<c&&o[i]===E[i];i++);var v=c-i;for(h=1;h<=v&&o[c-h]===E[T-h];h++);return Tc=E.slice(i,1<h?1-h:void 0)}function bc(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function wc(){return!0}function p_(){return!1}function qn(i){function o(c,h,E,T,v){this._reactName=c,this._targetInst=E,this.type=h,this.nativeEvent=T,this.target=v,this.currentTarget=null;for(var F in i)i.hasOwnProperty(F)&&(c=i[F],this[F]=c?c(T):T[F]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?wc:p_,this.isPropagationStopped=p_,this}return k(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=wc)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=wc)},persist:function(){},isPersistent:wc}),o}var Ao={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Up=qn(Ao),tu=k({},Ao,{view:0,detail:0}),AB=qn(tu),Hp,jp,nu,_c=k({},tu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$p,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==nu&&(nu&&i.type==="mousemove"?(Hp=i.screenX-nu.screenX,jp=i.screenY-nu.screenY):jp=Hp=0,nu=i),Hp)},movementY:function(i){return"movementY"in i?i.movementY:jp}}),m_=qn(_c),kB=k({},_c,{dataTransfer:0}),CB=qn(kB),NB=k({},tu,{relatedTarget:0}),zp=qn(NB),OB=k({},Ao,{animationName:0,elapsedTime:0,pseudoElement:0}),IB=qn(OB),PB=k({},Ao,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),RB=qn(PB),LB=k({},Ao,{data:0}),g_=qn(LB),DB={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},MB={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},FB={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function BB(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=FB[i])?!!o[i]:!1}function $p(){return BB}var UB=k({},tu,{key:function(i){if(i.key){var o=DB[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=bc(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?MB[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$p,charCode:function(i){return i.type==="keypress"?bc(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?bc(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),HB=qn(UB),jB=k({},_c,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),E_=qn(jB),zB=k({},tu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$p}),$B=qn(zB),VB=k({},Ao,{propertyName:0,elapsedTime:0,pseudoElement:0}),qB=qn(VB),YB=k({},_c,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),WB=qn(YB),GB=[9,13,27,32],Vp=l&&"CompositionEvent"in window,ru=null;l&&"documentMode"in document&&(ru=document.documentMode);var XB=l&&"TextEvent"in window&&!ru,y_=l&&(!Vp||ru&&8<ru&&11>=ru),T_=" ",b_=!1;function w_(i,o){switch(i){case"keyup":return GB.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function __(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ko=!1;function KB(i,o){switch(i){case"compositionend":return __(o);case"keypress":return o.which!==32?null:(b_=!0,T_);case"textInput":return i=o.data,i===T_&&b_?null:i;default:return null}}function QB(i,o){if(ko)return i==="compositionend"||!Vp&&w_(i,o)?(i=h_(),Tc=Bp=ki=null,ko=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return y_&&o.locale!=="ko"?null:o.data;default:return null}}var JB={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function x_(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!JB[i.type]:o==="textarea"}function S_(i,o,c,h){Vw(h),o=kc(o,"onChange"),0<o.length&&(c=new Up("onChange","change",null,c,h),i.push({event:c,listeners:o}))}var iu=null,su=null;function ZB(i){z_(i,0)}function xc(i){var o=Po(i);if(Lt(o))return i}function e7(i,o){if(i==="change")return o}var v_=!1;if(l){var qp;if(l){var Yp="oninput"in document;if(!Yp){var A_=document.createElement("div");A_.setAttribute("oninput","return;"),Yp=typeof A_.oninput=="function"}qp=Yp}else qp=!1;v_=qp&&(!document.documentMode||9<document.documentMode)}function k_(){iu&&(iu.detachEvent("onpropertychange",C_),su=iu=null)}function C_(i){if(i.propertyName==="value"&&xc(su)){var o=[];S_(o,su,i,Wt(i)),Gw(ZB,o)}}function t7(i,o,c){i==="focusin"?(k_(),iu=o,su=c,iu.attachEvent("onpropertychange",C_)):i==="focusout"&&k_()}function n7(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return xc(su)}function r7(i,o){if(i==="click")return xc(o)}function i7(i,o){if(i==="input"||i==="change")return xc(o)}function s7(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var gr=typeof Object.is=="function"?Object.is:s7;function ou(i,o){if(gr(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var c=Object.keys(i),h=Object.keys(o);if(c.length!==h.length)return!1;for(h=0;h<c.length;h++){var E=c[h];if(!d.call(o,E)||!gr(i[E],o[E]))return!1}return!0}function N_(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function O_(i,o){var c=N_(i);i=0;for(var h;c;){if(c.nodeType===3){if(h=i+c.textContent.length,i<=o&&h>=o)return{node:c,offset:o-i};i=h}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=N_(c)}}function I_(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?I_(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function P_(){for(var i=window,o=pn();o instanceof i.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch(h){c=!1}if(c)i=o.contentWindow;else break;o=pn(i.document)}return o}function Wp(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}function o7(i){var o=P_(),c=i.focusedElem,h=i.selectionRange;if(o!==c&&c&&c.ownerDocument&&I_(c.ownerDocument.documentElement,c)){if(h!==null&&Wp(c)){if(o=h.start,i=h.end,i===void 0&&(i=o),"selectionStart"in c)c.selectionStart=o,c.selectionEnd=Math.min(i,c.value.length);else if(i=(o=c.ownerDocument||document)&&o.defaultView||window,i.getSelection){i=i.getSelection();var E=c.textContent.length,T=Math.min(h.start,E);h=h.end===void 0?T:Math.min(h.end,E),!i.extend&&T>h&&(E=h,h=T,T=E),E=O_(c,T);var v=O_(c,h);E&&v&&(i.rangeCount!==1||i.anchorNode!==E.node||i.anchorOffset!==E.offset||i.focusNode!==v.node||i.focusOffset!==v.offset)&&(o=o.createRange(),o.setStart(E.node,E.offset),i.removeAllRanges(),T>h?(i.addRange(o),i.extend(v.node,v.offset)):(o.setEnd(v.node,v.offset),i.addRange(o)))}}for(o=[],i=c;i=i.parentNode;)i.nodeType===1&&o.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;c<o.length;c++)i=o[c],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var a7=l&&"documentMode"in document&&11>=document.documentMode,Co=null,Gp=null,au=null,Xp=!1;function R_(i,o,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Xp||Co==null||Co!==pn(h)||(h=Co,"selectionStart"in h&&Wp(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),au&&ou(au,h)||(au=h,h=kc(Gp,"onSelect"),0<h.length&&(o=new Up("onSelect","select",null,o,c),i.push({event:o,listeners:h}),o.target=Co)))}function Sc(i,o){var c={};return c[i.toLowerCase()]=o.toLowerCase(),c["Webkit"+i]="webkit"+o,c["Moz"+i]="moz"+o,c}var No={animationend:Sc("Animation","AnimationEnd"),animationiteration:Sc("Animation","AnimationIteration"),animationstart:Sc("Animation","AnimationStart"),transitionend:Sc("Transition","TransitionEnd")},Kp={},L_={};l&&(L_=document.createElement("div").style,"AnimationEvent"in window||(delete No.animationend.animation,delete No.animationiteration.animation,delete No.animationstart.animation),"TransitionEvent"in window||delete No.transitionend.transition);function vc(i){if(Kp[i])return Kp[i];if(!No[i])return i;var o=No[i],c;for(c in o)if(o.hasOwnProperty(c)&&c in L_)return Kp[i]=o[c];return i}var D_=vc("animationend"),M_=vc("animationiteration"),F_=vc("animationstart"),B_=vc("transitionend"),U_=new Map,H_="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ci(i,o){U_.set(i,o),a(o,[i])}for(var Qp=0;Qp<H_.length;Qp++){var Jp=H_[Qp],u7=Jp.toLowerCase(),l7=Jp[0].toUpperCase()+Jp.slice(1);Ci(u7,"on"+l7)}Ci(D_,"onAnimationEnd"),Ci(M_,"onAnimationIteration"),Ci(F_,"onAnimationStart"),Ci("dblclick","onDoubleClick"),Ci("focusin","onFocus"),Ci("focusout","onBlur"),Ci(B_,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var uu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),c7=new Set("cancel close invalid load scroll toggle".split(" ").concat(uu));function j_(i,o,c){var h=i.type||"unknown-event";i.currentTarget=c,uB(h,o,void 0,i),i.currentTarget=null}function z_(i,o){o=(o&4)!==0;for(var c=0;c<i.length;c++){var h=i[c],E=h.event;h=h.listeners;e:{var T=void 0;if(o)for(var v=h.length-1;0<=v;v--){var F=h[v],$=F.instance,ee=F.currentTarget;if(F=F.listener,$!==T&&E.isPropagationStopped())break e;j_(E,F,ee),T=$}else for(v=0;v<h.length;v++){if(F=h[v],$=F.instance,ee=F.currentTarget,F=F.listener,$!==T&&E.isPropagationStopped())break e;j_(E,F,ee),T=$}}}if(lc)throw i=Np,lc=!1,Np=null,i}function vt(i,o){var c=o[om];c===void 0&&(c=o[om]=new Set);var h=i+"__bubble";c.has(h)||($_(o,i,2,!1),c.add(h))}function Zp(i,o,c){var h=0;o&&(h|=4),$_(c,i,h,o)}var Ac="_reactListening"+Math.random().toString(36).slice(2);function lu(i){if(!i[Ac]){i[Ac]=!0,r.forEach(function(c){c!=="selectionchange"&&(c7.has(c)||Zp(c,!1,i),Zp(c,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[Ac]||(o[Ac]=!0,Zp("selectionchange",!1,o))}}function $_(i,o,c,h){switch(f_(o)){case 1:var E=SB;break;case 4:E=vB;break;default:E=Mp}c=E.bind(null,o,c,i),E=void 0,!Cp||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(E=!0),h?E!==void 0?i.addEventListener(o,c,{capture:!0,passive:E}):i.addEventListener(o,c,!0):E!==void 0?i.addEventListener(o,c,{passive:E}):i.addEventListener(o,c,!1)}function em(i,o,c,h,E){var T=h;if((o&1)===0&&(o&2)===0&&h!==null)e:for(;;){if(h===null)return;var v=h.tag;if(v===3||v===4){var F=h.stateNode.containerInfo;if(F===E||F.nodeType===8&&F.parentNode===E)break;if(v===4)for(v=h.return;v!==null;){var $=v.tag;if(($===3||$===4)&&($=v.stateNode.containerInfo,$===E||$.nodeType===8&&$.parentNode===E))return;v=v.return}for(;F!==null;){if(v=bs(F),v===null)return;if($=v.tag,$===5||$===6){h=T=v;continue e}F=F.parentNode}}h=h.return}Gw(function(){var ee=T,ge=Wt(c),Te=[];e:{var pe=U_.get(i);if(pe!==void 0){var Pe=Up,De=i;switch(i){case"keypress":if(bc(c)===0)break e;case"keydown":case"keyup":Pe=HB;break;case"focusin":De="focus",Pe=zp;break;case"focusout":De="blur",Pe=zp;break;case"beforeblur":case"afterblur":Pe=zp;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Pe=m_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Pe=CB;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Pe=$B;break;case D_:case M_:case F_:Pe=IB;break;case B_:Pe=qB;break;case"scroll":Pe=AB;break;case"wheel":Pe=WB;break;case"copy":case"cut":case"paste":Pe=RB;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Pe=E_}var Me=(o&4)!==0,jt=!Me&&i==="scroll",X=Me?pe!==null?pe+"Capture":null:pe;Me=[];for(var q=ee,Q;q!==null;){Q=q;var we=Q.stateNode;if(Q.tag===5&&we!==null&&(Q=we,X!==null&&(we=qa(q,X),we!=null&&Me.push(cu(q,we,Q)))),jt)break;q=q.return}0<Me.length&&(pe=new Pe(pe,De,null,c,ge),Te.push({event:pe,listeners:Me}))}}if((o&7)===0){e:{if(pe=i==="mouseover"||i==="pointerover",Pe=i==="mouseout"||i==="pointerout",pe&&c!==Ot&&(De=c.relatedTarget||c.fromElement)&&(bs(De)||De[ei]))break e;if((Pe||pe)&&(pe=ge.window===ge?ge:(pe=ge.ownerDocument)?pe.defaultView||pe.parentWindow:window,Pe?(De=c.relatedTarget||c.toElement,Pe=ee,De=De?bs(De):null,De!==null&&(jt=Ts(De),De!==jt||De.tag!==5&&De.tag!==6)&&(De=null)):(Pe=null,De=ee),Pe!==De)){if(Me=m_,we="onMouseLeave",X="onMouseEnter",q="mouse",(i==="pointerout"||i==="pointerover")&&(Me=E_,we="onPointerLeave",X="onPointerEnter",q="pointer"),jt=Pe==null?pe:Po(Pe),Q=De==null?pe:Po(De),pe=new Me(we,q+"leave",Pe,c,ge),pe.target=jt,pe.relatedTarget=Q,we=null,bs(ge)===ee&&(Me=new Me(X,q+"enter",De,c,ge),Me.target=Q,Me.relatedTarget=jt,we=Me),jt=we,Pe&&De)t:{for(Me=Pe,X=De,q=0,Q=Me;Q;Q=Oo(Q))q++;for(Q=0,we=X;we;we=Oo(we))Q++;for(;0<q-Q;)Me=Oo(Me),q--;for(;0<Q-q;)X=Oo(X),Q--;for(;q--;){if(Me===X||X!==null&&Me===X.alternate)break t;Me=Oo(Me),X=Oo(X)}Me=null}else Me=null;Pe!==null&&V_(Te,pe,Pe,Me,!1),De!==null&&jt!==null&&V_(Te,jt,De,Me,!0)}}e:{if(pe=ee?Po(ee):window,Pe=pe.nodeName&&pe.nodeName.toLowerCase(),Pe==="select"||Pe==="input"&&pe.type==="file")var Ue=e7;else if(x_(pe))if(v_)Ue=i7;else{Ue=n7;var qe=t7}else(Pe=pe.nodeName)&&Pe.toLowerCase()==="input"&&(pe.type==="checkbox"||pe.type==="radio")&&(Ue=r7);if(Ue&&(Ue=Ue(i,ee))){S_(Te,Ue,c,ge);break e}qe&&qe(i,pe,ee),i==="focusout"&&(qe=pe._wrapperState)&&qe.controlled&&pe.type==="number"&&nt(pe,"number",pe.value)}switch(qe=ee?Po(ee):window,i){case"focusin":(x_(qe)||qe.contentEditable==="true")&&(Co=qe,Gp=ee,au=null);break;case"focusout":au=Gp=Co=null;break;case"mousedown":Xp=!0;break;case"contextmenu":case"mouseup":case"dragend":Xp=!1,R_(Te,c,ge);break;case"selectionchange":if(a7)break;case"keydown":case"keyup":R_(Te,c,ge)}var Ye;if(Vp)e:{switch(i){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else ko?w_(i,c)&&(Ke="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(Ke="onCompositionStart");Ke&&(y_&&c.locale!=="ko"&&(ko||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&ko&&(Ye=h_()):(ki=ge,Bp="value"in ki?ki.value:ki.textContent,ko=!0)),qe=kc(ee,Ke),0<qe.length&&(Ke=new g_(Ke,i,null,c,ge),Te.push({event:Ke,listeners:qe}),Ye?Ke.data=Ye:(Ye=__(c),Ye!==null&&(Ke.data=Ye)))),(Ye=XB?KB(i,c):QB(i,c))&&(ee=kc(ee,"onBeforeInput"),0<ee.length&&(ge=new g_("onBeforeInput","beforeinput",null,c,ge),Te.push({event:ge,listeners:ee}),ge.data=Ye))}z_(Te,o)})}function cu(i,o,c){return{instance:i,listener:o,currentTarget:c}}function kc(i,o){for(var c=o+"Capture",h=[];i!==null;){var E=i,T=E.stateNode;E.tag===5&&T!==null&&(E=T,T=qa(i,c),T!=null&&h.unshift(cu(i,T,E)),T=qa(i,o),T!=null&&h.push(cu(i,T,E))),i=i.return}return h}function Oo(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function V_(i,o,c,h,E){for(var T=o._reactName,v=[];c!==null&&c!==h;){var F=c,$=F.alternate,ee=F.stateNode;if($!==null&&$===h)break;F.tag===5&&ee!==null&&(F=ee,E?($=qa(c,T),$!=null&&v.unshift(cu(c,$,F))):E||($=qa(c,T),$!=null&&v.push(cu(c,$,F)))),c=c.return}v.length!==0&&i.push({event:o,listeners:v})}var d7=/\r\n?/g,f7=/\u0000|\uFFFD/g;function q_(i){return(typeof i=="string"?i:""+i).replace(d7,`
21
- `).replace(f7,"")}function Cc(i,o,c){if(o=q_(o),q_(i)!==o&&c)throw Error(n(425))}function Nc(){}var tm=null,nm=null;function rm(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var im=typeof setTimeout=="function"?setTimeout:void 0,h7=typeof clearTimeout=="function"?clearTimeout:void 0,Y_=typeof Promise=="function"?Promise:void 0,p7=typeof queueMicrotask=="function"?queueMicrotask:typeof Y_!="undefined"?function(i){return Y_.resolve(null).then(i).catch(m7)}:im;function m7(i){setTimeout(function(){throw i})}function sm(i,o){var c=o,h=0;do{var E=c.nextSibling;if(i.removeChild(c),E&&E.nodeType===8)if(c=E.data,c==="/$"){if(h===0){i.removeChild(E),eu(o);return}h--}else c!=="$"&&c!=="$?"&&c!=="$!"||h++;c=E}while(c);eu(o)}function Ni(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?")break;if(o==="/$")return null}}return i}function W_(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"){if(o===0)return i;o--}else c==="/$"&&o++}i=i.previousSibling}return null}var Io=Math.random().toString(36).slice(2),Br="__reactFiber$"+Io,du="__reactProps$"+Io,ei="__reactContainer$"+Io,om="__reactEvents$"+Io,g7="__reactListeners$"+Io,E7="__reactHandles$"+Io;function bs(i){var o=i[Br];if(o)return o;for(var c=i.parentNode;c;){if(o=c[ei]||c[Br]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(i=W_(i);i!==null;){if(c=i[Br])return c;i=W_(i)}return o}i=c,c=i.parentNode}return null}function fu(i){return i=i[Br]||i[ei],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function Po(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function Oc(i){return i[du]||null}var am=[],Ro=-1;function Oi(i){return{current:i}}function At(i){0>Ro||(i.current=am[Ro],am[Ro]=null,Ro--)}function wt(i,o){Ro++,am[Ro]=i.current,i.current=o}var Ii={},mn=Oi(Ii),Dn=Oi(!1),ws=Ii;function Lo(i,o){var c=i.type.contextTypes;if(!c)return Ii;var h=i.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===o)return h.__reactInternalMemoizedMaskedChildContext;var E={},T;for(T in c)E[T]=o[T];return h&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=o,i.__reactInternalMemoizedMaskedChildContext=E),E}function Mn(i){return i=i.childContextTypes,i!=null}function Ic(){At(Dn),At(mn)}function G_(i,o,c){if(mn.current!==Ii)throw Error(n(168));wt(mn,o),wt(Dn,c)}function X_(i,o,c){var h=i.stateNode;if(o=o.childContextTypes,typeof h.getChildContext!="function")return c;h=h.getChildContext();for(var E in h)if(!(E in o))throw Error(n(108,ve(i)||"Unknown",E));return k({},c,h)}function Pc(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Ii,ws=mn.current,wt(mn,i),wt(Dn,Dn.current),!0}function K_(i,o,c){var h=i.stateNode;if(!h)throw Error(n(169));c?(i=X_(i,o,ws),h.__reactInternalMemoizedMergedChildContext=i,At(Dn),At(mn),wt(mn,i)):At(Dn),wt(Dn,c)}var ti=null,Rc=!1,um=!1;function Q_(i){ti===null?ti=[i]:ti.push(i)}function y7(i){Rc=!0,Q_(i)}function Pi(){if(!um&&ti!==null){um=!0;var i=0,o=gt;try{var c=ti;for(gt=1;i<c.length;i++){var h=c[i];do h=h(!0);while(h!==null)}ti=null,Rc=!1}catch(E){throw ti!==null&&(ti=ti.slice(i+1)),Zw(Op,Pi),E}finally{gt=o,um=!1}}return null}var Do=[],Mo=0,Lc=null,Dc=0,Zn=[],er=0,_s=null,ni=1,ri="";function xs(i,o){Do[Mo++]=Dc,Do[Mo++]=Lc,Lc=i,Dc=o}function J_(i,o,c){Zn[er++]=ni,Zn[er++]=ri,Zn[er++]=_s,_s=i;var h=ni;i=ri;var E=32-mr(h)-1;h&=~(1<<E),c+=1;var T=32-mr(o)+E;if(30<T){var v=E-E%5;T=(h&(1<<v)-1).toString(32),h>>=v,E-=v,ni=1<<32-mr(o)+E|c<<E|h,ri=T+i}else ni=1<<T|c<<E|h,ri=i}function lm(i){i.return!==null&&(xs(i,1),J_(i,1,0))}function cm(i){for(;i===Lc;)Lc=Do[--Mo],Do[Mo]=null,Dc=Do[--Mo],Do[Mo]=null;for(;i===_s;)_s=Zn[--er],Zn[er]=null,ri=Zn[--er],Zn[er]=null,ni=Zn[--er],Zn[er]=null}var Yn=null,Wn=null,Nt=!1,Er=null;function Z_(i,o){var c=ir(5,null,null,0);c.elementType="DELETED",c.stateNode=o,c.return=i,o=i.deletions,o===null?(i.deletions=[c],i.flags|=16):o.push(c)}function ex(i,o){switch(i.tag){case 5:var c=i.type;return o=o.nodeType!==1||c.toLowerCase()!==o.nodeName.toLowerCase()?null:o,o!==null?(i.stateNode=o,Yn=i,Wn=Ni(o.firstChild),!0):!1;case 6:return o=i.pendingProps===""||o.nodeType!==3?null:o,o!==null?(i.stateNode=o,Yn=i,Wn=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(c=_s!==null?{id:ni,overflow:ri}:null,i.memoizedState={dehydrated:o,treeContext:c,retryLane:1073741824},c=ir(18,null,null,0),c.stateNode=o,c.return=i,i.child=c,Yn=i,Wn=null,!0):!1;default:return!1}}function dm(i){return(i.mode&1)!==0&&(i.flags&128)===0}function fm(i){if(Nt){var o=Wn;if(o){var c=o;if(!ex(i,o)){if(dm(i))throw Error(n(418));o=Ni(c.nextSibling);var h=Yn;o&&ex(i,o)?Z_(h,c):(i.flags=i.flags&-4097|2,Nt=!1,Yn=i)}}else{if(dm(i))throw Error(n(418));i.flags=i.flags&-4097|2,Nt=!1,Yn=i}}}function tx(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;Yn=i}function Mc(i){if(i!==Yn)return!1;if(!Nt)return tx(i),Nt=!0,!1;var o;if((o=i.tag!==3)&&!(o=i.tag!==5)&&(o=i.type,o=o!=="head"&&o!=="body"&&!rm(i.type,i.memoizedProps)),o&&(o=Wn)){if(dm(i))throw nx(),Error(n(418));for(;o;)Z_(i,o),o=Ni(o.nextSibling)}if(tx(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"){if(o===0){Wn=Ni(i.nextSibling);break e}o--}else c!=="$"&&c!=="$!"&&c!=="$?"||o++}i=i.nextSibling}Wn=null}}else Wn=Yn?Ni(i.stateNode.nextSibling):null;return!0}function nx(){for(var i=Wn;i;)i=Ni(i.nextSibling)}function Fo(){Wn=Yn=null,Nt=!1}function hm(i){Er===null?Er=[i]:Er.push(i)}var T7=z.ReactCurrentBatchConfig;function hu(i,o,c){if(i=c.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(c._owner){if(c=c._owner,c){if(c.tag!==1)throw Error(n(309));var h=c.stateNode}if(!h)throw Error(n(147,i));var E=h,T=""+i;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===T?o.ref:(o=function(v){var F=E.refs;v===null?delete F[T]:F[T]=v},o._stringRef=T,o)}if(typeof i!="string")throw Error(n(284));if(!c._owner)throw Error(n(290,i))}return i}function Fc(i,o){throw i=Object.prototype.toString.call(o),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i))}function rx(i){var o=i._init;return o(i._payload)}function ix(i){function o(X,q){if(i){var Q=X.deletions;Q===null?(X.deletions=[q],X.flags|=16):Q.push(q)}}function c(X,q){if(!i)return null;for(;q!==null;)o(X,q),q=q.sibling;return null}function h(X,q){for(X=new Map;q!==null;)q.key!==null?X.set(q.key,q):X.set(q.index,q),q=q.sibling;return X}function E(X,q){return X=Hi(X,q),X.index=0,X.sibling=null,X}function T(X,q,Q){return X.index=Q,i?(Q=X.alternate,Q!==null?(Q=Q.index,Q<q?(X.flags|=2,q):Q):(X.flags|=2,q)):(X.flags|=1048576,q)}function v(X){return i&&X.alternate===null&&(X.flags|=2),X}function F(X,q,Q,we){return q===null||q.tag!==6?(q=i0(Q,X.mode,we),q.return=X,q):(q=E(q,Q),q.return=X,q)}function $(X,q,Q,we){var Ue=Q.type;return Ue===V?ge(X,q,Q.props.children,we,Q.key):q!==null&&(q.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===Se&&rx(Ue)===q.type)?(we=E(q,Q.props),we.ref=hu(X,q,Q),we.return=X,we):(we=ad(Q.type,Q.key,Q.props,null,X.mode,we),we.ref=hu(X,q,Q),we.return=X,we)}function ee(X,q,Q,we){return q===null||q.tag!==4||q.stateNode.containerInfo!==Q.containerInfo||q.stateNode.implementation!==Q.implementation?(q=s0(Q,X.mode,we),q.return=X,q):(q=E(q,Q.children||[]),q.return=X,q)}function ge(X,q,Q,we,Ue){return q===null||q.tag!==7?(q=Is(Q,X.mode,we,Ue),q.return=X,q):(q=E(q,Q),q.return=X,q)}function Te(X,q,Q){if(typeof q=="string"&&q!==""||typeof q=="number")return q=i0(""+q,X.mode,Q),q.return=X,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case G:return Q=ad(q.type,q.key,q.props,null,X.mode,Q),Q.ref=hu(X,null,q),Q.return=X,Q;case D:return q=s0(q,X.mode,Q),q.return=X,q;case Se:var we=q._init;return Te(X,we(q._payload),Q)}if(pt(q)||oe(q))return q=Is(q,X.mode,Q,null),q.return=X,q;Fc(X,q)}return null}function pe(X,q,Q,we){var Ue=q!==null?q.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number")return Ue!==null?null:F(X,q,""+Q,we);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case G:return Q.key===Ue?$(X,q,Q,we):null;case D:return Q.key===Ue?ee(X,q,Q,we):null;case Se:return Ue=Q._init,pe(X,q,Ue(Q._payload),we)}if(pt(Q)||oe(Q))return Ue!==null?null:ge(X,q,Q,we,null);Fc(X,Q)}return null}function Pe(X,q,Q,we,Ue){if(typeof we=="string"&&we!==""||typeof we=="number")return X=X.get(Q)||null,F(q,X,""+we,Ue);if(typeof we=="object"&&we!==null){switch(we.$$typeof){case G:return X=X.get(we.key===null?Q:we.key)||null,$(q,X,we,Ue);case D:return X=X.get(we.key===null?Q:we.key)||null,ee(q,X,we,Ue);case Se:var qe=we._init;return Pe(X,q,Q,qe(we._payload),Ue)}if(pt(we)||oe(we))return X=X.get(Q)||null,ge(q,X,we,Ue,null);Fc(q,we)}return null}function De(X,q,Q,we){for(var Ue=null,qe=null,Ye=q,Ke=q=0,nn=null;Ye!==null&&Ke<Q.length;Ke++){Ye.index>Ke?(nn=Ye,Ye=null):nn=Ye.sibling;var dt=pe(X,Ye,Q[Ke],we);if(dt===null){Ye===null&&(Ye=nn);break}i&&Ye&&dt.alternate===null&&o(X,Ye),q=T(dt,q,Ke),qe===null?Ue=dt:qe.sibling=dt,qe=dt,Ye=nn}if(Ke===Q.length)return c(X,Ye),Nt&&xs(X,Ke),Ue;if(Ye===null){for(;Ke<Q.length;Ke++)Ye=Te(X,Q[Ke],we),Ye!==null&&(q=T(Ye,q,Ke),qe===null?Ue=Ye:qe.sibling=Ye,qe=Ye);return Nt&&xs(X,Ke),Ue}for(Ye=h(X,Ye);Ke<Q.length;Ke++)nn=Pe(Ye,X,Ke,Q[Ke],we),nn!==null&&(i&&nn.alternate!==null&&Ye.delete(nn.key===null?Ke:nn.key),q=T(nn,q,Ke),qe===null?Ue=nn:qe.sibling=nn,qe=nn);return i&&Ye.forEach(function(ji){return o(X,ji)}),Nt&&xs(X,Ke),Ue}function Me(X,q,Q,we){var Ue=oe(Q);if(typeof Ue!="function")throw Error(n(150));if(Q=Ue.call(Q),Q==null)throw Error(n(151));for(var qe=Ue=null,Ye=q,Ke=q=0,nn=null,dt=Q.next();Ye!==null&&!dt.done;Ke++,dt=Q.next()){Ye.index>Ke?(nn=Ye,Ye=null):nn=Ye.sibling;var ji=pe(X,Ye,dt.value,we);if(ji===null){Ye===null&&(Ye=nn);break}i&&Ye&&ji.alternate===null&&o(X,Ye),q=T(ji,q,Ke),qe===null?Ue=ji:qe.sibling=ji,qe=ji,Ye=nn}if(dt.done)return c(X,Ye),Nt&&xs(X,Ke),Ue;if(Ye===null){for(;!dt.done;Ke++,dt=Q.next())dt=Te(X,dt.value,we),dt!==null&&(q=T(dt,q,Ke),qe===null?Ue=dt:qe.sibling=dt,qe=dt);return Nt&&xs(X,Ke),Ue}for(Ye=h(X,Ye);!dt.done;Ke++,dt=Q.next())dt=Pe(Ye,X,Ke,dt.value,we),dt!==null&&(i&&dt.alternate!==null&&Ye.delete(dt.key===null?Ke:dt.key),q=T(dt,q,Ke),qe===null?Ue=dt:qe.sibling=dt,qe=dt);return i&&Ye.forEach(function(J7){return o(X,J7)}),Nt&&xs(X,Ke),Ue}function jt(X,q,Q,we){if(typeof Q=="object"&&Q!==null&&Q.type===V&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case G:e:{for(var Ue=Q.key,qe=q;qe!==null;){if(qe.key===Ue){if(Ue=Q.type,Ue===V){if(qe.tag===7){c(X,qe.sibling),q=E(qe,Q.props.children),q.return=X,X=q;break e}}else if(qe.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===Se&&rx(Ue)===qe.type){c(X,qe.sibling),q=E(qe,Q.props),q.ref=hu(X,qe,Q),q.return=X,X=q;break e}c(X,qe);break}else o(X,qe);qe=qe.sibling}Q.type===V?(q=Is(Q.props.children,X.mode,we,Q.key),q.return=X,X=q):(we=ad(Q.type,Q.key,Q.props,null,X.mode,we),we.ref=hu(X,q,Q),we.return=X,X=we)}return v(X);case D:e:{for(qe=Q.key;q!==null;){if(q.key===qe)if(q.tag===4&&q.stateNode.containerInfo===Q.containerInfo&&q.stateNode.implementation===Q.implementation){c(X,q.sibling),q=E(q,Q.children||[]),q.return=X,X=q;break e}else{c(X,q);break}else o(X,q);q=q.sibling}q=s0(Q,X.mode,we),q.return=X,X=q}return v(X);case Se:return qe=Q._init,jt(X,q,qe(Q._payload),we)}if(pt(Q))return De(X,q,Q,we);if(oe(Q))return Me(X,q,Q,we);Fc(X,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"?(Q=""+Q,q!==null&&q.tag===6?(c(X,q.sibling),q=E(q,Q),q.return=X,X=q):(c(X,q),q=i0(Q,X.mode,we),q.return=X,X=q),v(X)):c(X,q)}return jt}var Bo=ix(!0),sx=ix(!1),Bc=Oi(null),Uc=null,Uo=null,pm=null;function mm(){pm=Uo=Uc=null}function gm(i){var o=Bc.current;At(Bc),i._currentValue=o}function Em(i,o,c){for(;i!==null;){var h=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,h!==null&&(h.childLanes|=o)):h!==null&&(h.childLanes&o)!==o&&(h.childLanes|=o),i===c)break;i=i.return}}function Ho(i,o){Uc=i,pm=Uo=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&o)!==0&&(Fn=!0),i.firstContext=null)}function tr(i){var o=i._currentValue;if(pm!==i)if(i={context:i,memoizedValue:o,next:null},Uo===null){if(Uc===null)throw Error(n(308));Uo=i,Uc.dependencies={lanes:0,firstContext:i}}else Uo=Uo.next=i;return o}var Ss=null;function ym(i){Ss===null?Ss=[i]:Ss.push(i)}function ox(i,o,c,h){var E=o.interleaved;return E===null?(c.next=c,ym(o)):(c.next=E.next,E.next=c),o.interleaved=c,ii(i,h)}function ii(i,o){i.lanes|=o;var c=i.alternate;for(c!==null&&(c.lanes|=o),c=i,i=i.return;i!==null;)i.childLanes|=o,c=i.alternate,c!==null&&(c.childLanes|=o),c=i,i=i.return;return c.tag===3?c.stateNode:null}var Ri=!1;function Tm(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ax(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function si(i,o){return{eventTime:i,lane:o,tag:0,payload:null,callback:null,next:null}}function Li(i,o,c){var h=i.updateQueue;if(h===null)return null;if(h=h.shared,(lt&2)!==0){var E=h.pending;return E===null?o.next=o:(o.next=E.next,E.next=o),h.pending=o,ii(i,c)}return E=h.interleaved,E===null?(o.next=o,ym(h)):(o.next=E.next,E.next=o),h.interleaved=o,ii(i,c)}function Hc(i,o,c){if(o=o.updateQueue,o!==null&&(o=o.shared,(c&4194240)!==0)){var h=o.lanes;h&=i.pendingLanes,c|=h,o.lanes=c,Rp(i,c)}}function ux(i,o){var c=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var E=null,T=null;if(c=c.firstBaseUpdate,c!==null){do{var v={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};T===null?E=T=v:T=T.next=v,c=c.next}while(c!==null);T===null?E=T=o:T=T.next=o}else E=T=o;c={baseState:h.baseState,firstBaseUpdate:E,lastBaseUpdate:T,shared:h.shared,effects:h.effects},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=o:i.next=o,c.lastBaseUpdate=o}function jc(i,o,c,h){var E=i.updateQueue;Ri=!1;var T=E.firstBaseUpdate,v=E.lastBaseUpdate,F=E.shared.pending;if(F!==null){E.shared.pending=null;var $=F,ee=$.next;$.next=null,v===null?T=ee:v.next=ee,v=$;var ge=i.alternate;ge!==null&&(ge=ge.updateQueue,F=ge.lastBaseUpdate,F!==v&&(F===null?ge.firstBaseUpdate=ee:F.next=ee,ge.lastBaseUpdate=$))}if(T!==null){var Te=E.baseState;v=0,ge=ee=$=null,F=T;do{var pe=F.lane,Pe=F.eventTime;if((h&pe)===pe){ge!==null&&(ge=ge.next={eventTime:Pe,lane:0,tag:F.tag,payload:F.payload,callback:F.callback,next:null});e:{var De=i,Me=F;switch(pe=o,Pe=c,Me.tag){case 1:if(De=Me.payload,typeof De=="function"){Te=De.call(Pe,Te,pe);break e}Te=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Me.payload,pe=typeof De=="function"?De.call(Pe,Te,pe):De,pe==null)break e;Te=k({},Te,pe);break e;case 2:Ri=!0}}F.callback!==null&&F.lane!==0&&(i.flags|=64,pe=E.effects,pe===null?E.effects=[F]:pe.push(F))}else Pe={eventTime:Pe,lane:pe,tag:F.tag,payload:F.payload,callback:F.callback,next:null},ge===null?(ee=ge=Pe,$=Te):ge=ge.next=Pe,v|=pe;if(F=F.next,F===null){if(F=E.shared.pending,F===null)break;pe=F,F=pe.next,pe.next=null,E.lastBaseUpdate=pe,E.shared.pending=null}}while(!0);if(ge===null&&($=Te),E.baseState=$,E.firstBaseUpdate=ee,E.lastBaseUpdate=ge,o=E.shared.interleaved,o!==null){E=o;do v|=E.lane,E=E.next;while(E!==o)}else T===null&&(E.shared.lanes=0);ks|=v,i.lanes=v,i.memoizedState=Te}}function lx(i,o,c){if(i=o.effects,o.effects=null,i!==null)for(o=0;o<i.length;o++){var h=i[o],E=h.callback;if(E!==null){if(h.callback=null,h=c,typeof E!="function")throw Error(n(191,E));E.call(h)}}}var pu={},Ur=Oi(pu),mu=Oi(pu),gu=Oi(pu);function vs(i){if(i===pu)throw Error(n(174));return i}function bm(i,o){switch(wt(gu,o),wt(mu,i),wt(Ur,pu),i=o.nodeType,i){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:_e(null,"");break;default:i=i===8?o.parentNode:o,o=i.namespaceURI||null,i=i.tagName,o=_e(o,i)}At(Ur),wt(Ur,o)}function jo(){At(Ur),At(mu),At(gu)}function cx(i){vs(gu.current);var o=vs(Ur.current),c=_e(o,i.type);o!==c&&(wt(mu,i),wt(Ur,c))}function wm(i){mu.current===i&&(At(Ur),At(mu))}var It=Oi(0);function zc(i){for(var o=i;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||c.data==="$?"||c.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var _m=[];function xm(){for(var i=0;i<_m.length;i++)_m[i]._workInProgressVersionPrimary=null;_m.length=0}var $c=z.ReactCurrentDispatcher,Sm=z.ReactCurrentBatchConfig,As=0,Pt=null,Gt=null,en=null,Vc=!1,Eu=!1,yu=0,b7=0;function gn(){throw Error(n(321))}function vm(i,o){if(o===null)return!1;for(var c=0;c<o.length&&c<i.length;c++)if(!gr(i[c],o[c]))return!1;return!0}function Am(i,o,c,h,E,T){if(As=T,Pt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,$c.current=i===null||i.memoizedState===null?S7:v7,i=c(h,E),Eu){T=0;do{if(Eu=!1,yu=0,25<=T)throw Error(n(301));T+=1,en=Gt=null,o.updateQueue=null,$c.current=A7,i=c(h,E)}while(Eu)}if($c.current=Wc,o=Gt!==null&&Gt.next!==null,As=0,en=Gt=Pt=null,Vc=!1,o)throw Error(n(300));return i}function km(){var i=yu!==0;return yu=0,i}function Hr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return en===null?Pt.memoizedState=en=i:en=en.next=i,en}function nr(){if(Gt===null){var i=Pt.alternate;i=i!==null?i.memoizedState:null}else i=Gt.next;var o=en===null?Pt.memoizedState:en.next;if(o!==null)en=o,Gt=i;else{if(i===null)throw Error(n(310));Gt=i,i={memoizedState:Gt.memoizedState,baseState:Gt.baseState,baseQueue:Gt.baseQueue,queue:Gt.queue,next:null},en===null?Pt.memoizedState=en=i:en=en.next=i}return en}function Tu(i,o){return typeof o=="function"?o(i):o}function Cm(i){var o=nr(),c=o.queue;if(c===null)throw Error(n(311));c.lastRenderedReducer=i;var h=Gt,E=h.baseQueue,T=c.pending;if(T!==null){if(E!==null){var v=E.next;E.next=T.next,T.next=v}h.baseQueue=E=T,c.pending=null}if(E!==null){T=E.next,h=h.baseState;var F=v=null,$=null,ee=T;do{var ge=ee.lane;if((As&ge)===ge)$!==null&&($=$.next={lane:0,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),h=ee.hasEagerState?ee.eagerState:i(h,ee.action);else{var Te={lane:ge,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null};$===null?(F=$=Te,v=h):$=$.next=Te,Pt.lanes|=ge,ks|=ge}ee=ee.next}while(ee!==null&&ee!==T);$===null?v=h:$.next=F,gr(h,o.memoizedState)||(Fn=!0),o.memoizedState=h,o.baseState=v,o.baseQueue=$,c.lastRenderedState=h}if(i=c.interleaved,i!==null){E=i;do T=E.lane,Pt.lanes|=T,ks|=T,E=E.next;while(E!==i)}else E===null&&(c.lanes=0);return[o.memoizedState,c.dispatch]}function Nm(i){var o=nr(),c=o.queue;if(c===null)throw Error(n(311));c.lastRenderedReducer=i;var h=c.dispatch,E=c.pending,T=o.memoizedState;if(E!==null){c.pending=null;var v=E=E.next;do T=i(T,v.action),v=v.next;while(v!==E);gr(T,o.memoizedState)||(Fn=!0),o.memoizedState=T,o.baseQueue===null&&(o.baseState=T),c.lastRenderedState=T}return[T,h]}function dx(){}function fx(i,o){var c=Pt,h=nr(),E=o(),T=!gr(h.memoizedState,E);if(T&&(h.memoizedState=E,Fn=!0),h=h.queue,Om(mx.bind(null,c,h,i),[i]),h.getSnapshot!==o||T||en!==null&&en.memoizedState.tag&1){if(c.flags|=2048,bu(9,px.bind(null,c,h,E,o),void 0,null),tn===null)throw Error(n(349));(As&30)!==0||hx(c,o,E)}return E}function hx(i,o,c){i.flags|=16384,i={getSnapshot:o,value:c},o=Pt.updateQueue,o===null?(o={lastEffect:null,stores:null},Pt.updateQueue=o,o.stores=[i]):(c=o.stores,c===null?o.stores=[i]:c.push(i))}function px(i,o,c,h){o.value=c,o.getSnapshot=h,gx(o)&&Ex(i)}function mx(i,o,c){return c(function(){gx(o)&&Ex(i)})}function gx(i){var o=i.getSnapshot;i=i.value;try{var c=o();return!gr(i,c)}catch(h){return!0}}function Ex(i){var o=ii(i,1);o!==null&&wr(o,i,1,-1)}function yx(i){var o=Hr();return typeof i=="function"&&(i=i()),o.memoizedState=o.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Tu,lastRenderedState:i},o.queue=i,i=i.dispatch=x7.bind(null,Pt,i),[o.memoizedState,i]}function bu(i,o,c,h){return i={tag:i,create:o,destroy:c,deps:h,next:null},o=Pt.updateQueue,o===null?(o={lastEffect:null,stores:null},Pt.updateQueue=o,o.lastEffect=i.next=i):(c=o.lastEffect,c===null?o.lastEffect=i.next=i:(h=c.next,c.next=i,i.next=h,o.lastEffect=i)),i}function Tx(){return nr().memoizedState}function qc(i,o,c,h){var E=Hr();Pt.flags|=i,E.memoizedState=bu(1|o,c,void 0,h===void 0?null:h)}function Yc(i,o,c,h){var E=nr();h=h===void 0?null:h;var T=void 0;if(Gt!==null){var v=Gt.memoizedState;if(T=v.destroy,h!==null&&vm(h,v.deps)){E.memoizedState=bu(o,c,T,h);return}}Pt.flags|=i,E.memoizedState=bu(1|o,c,T,h)}function bx(i,o){return qc(8390656,8,i,o)}function Om(i,o){return Yc(2048,8,i,o)}function wx(i,o){return Yc(4,2,i,o)}function _x(i,o){return Yc(4,4,i,o)}function xx(i,o){if(typeof o=="function")return i=i(),o(i),function(){o(null)};if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function Sx(i,o,c){return c=c!=null?c.concat([i]):null,Yc(4,4,xx.bind(null,o,i),c)}function Im(){}function vx(i,o){var c=nr();o=o===void 0?null:o;var h=c.memoizedState;return h!==null&&o!==null&&vm(o,h[1])?h[0]:(c.memoizedState=[i,o],i)}function Ax(i,o){var c=nr();o=o===void 0?null:o;var h=c.memoizedState;return h!==null&&o!==null&&vm(o,h[1])?h[0]:(i=i(),c.memoizedState=[i,o],i)}function kx(i,o,c){return(As&21)===0?(i.baseState&&(i.baseState=!1,Fn=!0),i.memoizedState=c):(gr(c,o)||(c=r_(),Pt.lanes|=c,ks|=c,i.baseState=!0),o)}function w7(i,o){var c=gt;gt=c!==0&&4>c?c:4,i(!0);var h=Sm.transition;Sm.transition={};try{i(!1),o()}finally{gt=c,Sm.transition=h}}function Cx(){return nr().memoizedState}function _7(i,o,c){var h=Bi(i);if(c={lane:h,action:c,hasEagerState:!1,eagerState:null,next:null},Nx(i))Ox(o,c);else if(c=ox(i,o,c,h),c!==null){var E=xn();wr(c,i,h,E),Ix(c,o,h)}}function x7(i,o,c){var h=Bi(i),E={lane:h,action:c,hasEagerState:!1,eagerState:null,next:null};if(Nx(i))Ox(o,E);else{var T=i.alternate;if(i.lanes===0&&(T===null||T.lanes===0)&&(T=o.lastRenderedReducer,T!==null))try{var v=o.lastRenderedState,F=T(v,c);if(E.hasEagerState=!0,E.eagerState=F,gr(F,v)){var $=o.interleaved;$===null?(E.next=E,ym(o)):(E.next=$.next,$.next=E),o.interleaved=E;return}}catch(ee){}c=ox(i,o,E,h),c!==null&&(E=xn(),wr(c,i,h,E),Ix(c,o,h))}}function Nx(i){var o=i.alternate;return i===Pt||o!==null&&o===Pt}function Ox(i,o){Eu=Vc=!0;var c=i.pending;c===null?o.next=o:(o.next=c.next,c.next=o),i.pending=o}function Ix(i,o,c){if((c&4194240)!==0){var h=o.lanes;h&=i.pendingLanes,c|=h,o.lanes=c,Rp(i,c)}}var Wc={readContext:tr,useCallback:gn,useContext:gn,useEffect:gn,useImperativeHandle:gn,useInsertionEffect:gn,useLayoutEffect:gn,useMemo:gn,useReducer:gn,useRef:gn,useState:gn,useDebugValue:gn,useDeferredValue:gn,useTransition:gn,useMutableSource:gn,useSyncExternalStore:gn,useId:gn,unstable_isNewReconciler:!1},S7={readContext:tr,useCallback:function(i,o){return Hr().memoizedState=[i,o===void 0?null:o],i},useContext:tr,useEffect:bx,useImperativeHandle:function(i,o,c){return c=c!=null?c.concat([i]):null,qc(4194308,4,xx.bind(null,o,i),c)},useLayoutEffect:function(i,o){return qc(4194308,4,i,o)},useInsertionEffect:function(i,o){return qc(4,2,i,o)},useMemo:function(i,o){var c=Hr();return o=o===void 0?null:o,i=i(),c.memoizedState=[i,o],i},useReducer:function(i,o,c){var h=Hr();return o=c!==void 0?c(o):o,h.memoizedState=h.baseState=o,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:o},h.queue=i,i=i.dispatch=_7.bind(null,Pt,i),[h.memoizedState,i]},useRef:function(i){var o=Hr();return i={current:i},o.memoizedState=i},useState:yx,useDebugValue:Im,useDeferredValue:function(i){return Hr().memoizedState=i},useTransition:function(){var i=yx(!1),o=i[0];return i=w7.bind(null,i[1]),Hr().memoizedState=i,[o,i]},useMutableSource:function(){},useSyncExternalStore:function(i,o,c){var h=Pt,E=Hr();if(Nt){if(c===void 0)throw Error(n(407));c=c()}else{if(c=o(),tn===null)throw Error(n(349));(As&30)!==0||hx(h,o,c)}E.memoizedState=c;var T={value:c,getSnapshot:o};return E.queue=T,bx(mx.bind(null,h,T,i),[i]),h.flags|=2048,bu(9,px.bind(null,h,T,c,o),void 0,null),c},useId:function(){var i=Hr(),o=tn.identifierPrefix;if(Nt){var c=ri,h=ni;c=(h&~(1<<32-mr(h)-1)).toString(32)+c,o=":"+o+"R"+c,c=yu++,0<c&&(o+="H"+c.toString(32)),o+=":"}else c=b7++,o=":"+o+"r"+c.toString(32)+":";return i.memoizedState=o},unstable_isNewReconciler:!1},v7={readContext:tr,useCallback:vx,useContext:tr,useEffect:Om,useImperativeHandle:Sx,useInsertionEffect:wx,useLayoutEffect:_x,useMemo:Ax,useReducer:Cm,useRef:Tx,useState:function(){return Cm(Tu)},useDebugValue:Im,useDeferredValue:function(i){var o=nr();return kx(o,Gt.memoizedState,i)},useTransition:function(){var i=Cm(Tu)[0],o=nr().memoizedState;return[i,o]},useMutableSource:dx,useSyncExternalStore:fx,useId:Cx,unstable_isNewReconciler:!1},A7={readContext:tr,useCallback:vx,useContext:tr,useEffect:Om,useImperativeHandle:Sx,useInsertionEffect:wx,useLayoutEffect:_x,useMemo:Ax,useReducer:Nm,useRef:Tx,useState:function(){return Nm(Tu)},useDebugValue:Im,useDeferredValue:function(i){var o=nr();return Gt===null?o.memoizedState=i:kx(o,Gt.memoizedState,i)},useTransition:function(){var i=Nm(Tu)[0],o=nr().memoizedState;return[i,o]},useMutableSource:dx,useSyncExternalStore:fx,useId:Cx,unstable_isNewReconciler:!1};function yr(i,o){if(i&&i.defaultProps){o=k({},o),i=i.defaultProps;for(var c in i)o[c]===void 0&&(o[c]=i[c]);return o}return o}function Pm(i,o,c,h){o=i.memoizedState,c=c(h,o),c=c==null?o:k({},o,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var Gc={isMounted:function(i){return(i=i._reactInternals)?Ts(i)===i:!1},enqueueSetState:function(i,o,c){i=i._reactInternals;var h=xn(),E=Bi(i),T=si(h,E);T.payload=o,c!=null&&(T.callback=c),o=Li(i,T,E),o!==null&&(wr(o,i,E,h),Hc(o,i,E))},enqueueReplaceState:function(i,o,c){i=i._reactInternals;var h=xn(),E=Bi(i),T=si(h,E);T.tag=1,T.payload=o,c!=null&&(T.callback=c),o=Li(i,T,E),o!==null&&(wr(o,i,E,h),Hc(o,i,E))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var c=xn(),h=Bi(i),E=si(c,h);E.tag=2,o!=null&&(E.callback=o),o=Li(i,E,h),o!==null&&(wr(o,i,h,c),Hc(o,i,h))}};function Px(i,o,c,h,E,T,v){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(h,T,v):o.prototype&&o.prototype.isPureReactComponent?!ou(c,h)||!ou(E,T):!0}function Rx(i,o,c){var h=!1,E=Ii,T=o.contextType;return typeof T=="object"&&T!==null?T=tr(T):(E=Mn(o)?ws:mn.current,h=o.contextTypes,T=(h=h!=null)?Lo(i,E):Ii),o=new o(c,T),i.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Gc,i.stateNode=o,o._reactInternals=i,h&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=E,i.__reactInternalMemoizedMaskedChildContext=T),o}function Lx(i,o,c,h){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(c,h),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(c,h),o.state!==i&&Gc.enqueueReplaceState(o,o.state,null)}function Rm(i,o,c,h){var E=i.stateNode;E.props=c,E.state=i.memoizedState,E.refs={},Tm(i);var T=o.contextType;typeof T=="object"&&T!==null?E.context=tr(T):(T=Mn(o)?ws:mn.current,E.context=Lo(i,T)),E.state=i.memoizedState,T=o.getDerivedStateFromProps,typeof T=="function"&&(Pm(i,o,T,c),E.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(o=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),o!==E.state&&Gc.enqueueReplaceState(E,E.state,null),jc(i,c,E,h),E.state=i.memoizedState),typeof E.componentDidMount=="function"&&(i.flags|=4194308)}function zo(i,o){try{var c="",h=o;do c+=Ie(h),h=h.return;while(h);var E=c}catch(T){E=`
20
+ `+E[v].replace(" at new "," at ");return i.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",i.displayName)),$}while(1<=v&&0<=F);break}}}finally{P=!1,Error.prepareStackTrace=c}return(i=i?i.displayName||i.name:"")?Z(i):""}function Ie(i){switch(i.tag){case 5:return Z(i.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return i=xe(i.type,!1),i;case 11:return i=xe(i.type.render,!1),i;case 1:return i=xe(i.type,!0),i;default:return""}}function he(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case V:return"Fragment";case M:return"Portal";case se:return"Profiler";case J:return"StrictMode";case le:return"Suspense";case fe:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case ie:return(i.displayName||"Context")+".Consumer";case H:return(i._context.displayName||"Context")+".Provider";case te:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case ue:return o=i.displayName||null,o!==null?o:he(i.type)||"Memo";case Se:o=i._payload,i=i._init;try{return he(i(o))}catch(c){}}return null}function ve(i){var o=i.type;switch(i.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=o.render,i=i.displayName||i.name||"",o.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return he(o);case 8:return o===J?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function Fe(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Ge(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function et(i){var o=Ge(i)?"checked":"value",c=Object.getOwnPropertyDescriptor(i.constructor.prototype,o),h=""+i[o];if(!i.hasOwnProperty(o)&&typeof c!="undefined"&&typeof c.get=="function"&&typeof c.set=="function"){var E=c.get,T=c.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return E.call(this)},set:function(v){h=""+v,T.call(this,v)}}),Object.defineProperty(i,o,{enumerable:c.enumerable}),{getValue:function(){return h},setValue:function(v){h=""+v},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function mt(i){i._valueTracker||(i._valueTracker=et(i))}function Lt(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var c=o.getValue(),h="";return i&&(h=Ge(i)?i.checked?"true":"false":i.value),i=h,i!==c?(o.setValue(i),!0):!1}function pn(i){if(i=i||(typeof document!="undefined"?document:void 0),typeof i=="undefined")return null;try{return i.activeElement||i.body}catch(o){return i.body}}function wn(i,o){var c=o.checked;return k({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:c!=null?c:i._wrapperState.initialChecked})}function Dt(i,o){var c=o.defaultValue==null?"":o.defaultValue,h=o.checked!=null?o.checked:o.defaultChecked;c=Fe(o.value!=null?o.value:c),i._wrapperState={initialChecked:h,initialValue:c,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function ze(i,o){o=o.checked,o!=null&&O(i,"checked",o,!1)}function Ce(i,o){ze(i,o);var c=Fe(o.value),h=o.type;if(c!=null)h==="number"?(c===0&&i.value===""||i.value!=c)&&(i.value=""+c):i.value!==""+c&&(i.value=""+c);else if(h==="submit"||h==="reset"){i.removeAttribute("value");return}o.hasOwnProperty("value")?nt(i,o.type,c):o.hasOwnProperty("defaultValue")&&nt(i,o.type,Fe(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(i.defaultChecked=!!o.defaultChecked)}function Xe(i,o,c){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var h=o.type;if(!(h!=="submit"&&h!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+i._wrapperState.initialValue,c||o===i.value||(i.value=o),i.defaultValue=o}c=i.name,c!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,c!==""&&(i.name=c)}function nt(i,o,c){(o!=="number"||pn(i.ownerDocument)!==i)&&(c==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+c&&(i.defaultValue=""+c))}var pt=Array.isArray;function Mt(i,o,c,h){if(i=i.options,o){o={};for(var E=0;E<c.length;E++)o["$"+c[E]]=!0;for(c=0;c<i.length;c++)E=o.hasOwnProperty("$"+i[c].value),i[c].selected!==E&&(i[c].selected=E),E&&h&&(i[c].defaultSelected=!0)}else{for(c=""+Fe(c),o=null,E=0;E<i.length;E++){if(i[E].value===c){i[E].selected=!0,h&&(i[E].defaultSelected=!0);return}o!==null||i[E].disabled||(o=i[E])}o!==null&&(o.selected=!0)}}function Ln(i,o){if(o.dangerouslySetInnerHTML!=null)throw Error(n(91));return k({},o,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function gs(i,o){var c=o.value;if(c==null){if(c=o.children,o=o.defaultValue,c!=null){if(o!=null)throw Error(n(92));if(pt(c)){if(1<c.length)throw Error(n(93));c=c[0]}o=c}o==null&&(o=""),c=o}i._wrapperState={initialValue:Fe(c)}}function Es(i,o){var c=Fe(o.value),h=Fe(o.defaultValue);c!=null&&(c=""+c,c!==i.value&&(i.value=c),o.defaultValue==null&&i.defaultValue!==c&&(i.defaultValue=c)),h!=null&&(i.defaultValue=""+h)}function ys(i){var o=i.textContent;o===i._wrapperState.initialValue&&o!==""&&o!==null&&(i.value=o)}function ae(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function _e(i,o){return i==null||i==="http://www.w3.org/1999/xhtml"?ae(o):i==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var $e,Ze=(function(i){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(o,c,h,E){MSApp.execUnsafeLocalFunction(function(){return i(o,c,h,E)})}:i})(function(i,o){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=o;else{for($e=$e||document.createElement("div"),$e.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=$e.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;o.firstChild;)i.appendChild(o.firstChild)}});function at(i,o){if(o){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=o;return}}i.textContent=o}var re={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ae=["Webkit","ms","Moz","O"];Object.keys(re).forEach(function(i){Ae.forEach(function(o){o=o+i.charAt(0).toUpperCase()+i.substring(1),re[o]=re[i]})});function ke(i,o,c){return o==null||typeof o=="boolean"||o===""?"":c||typeof o!="number"||o===0||re.hasOwnProperty(i)&&re[i]?(""+o).trim():o+"px"}function Ne(i,o){i=i.style;for(var c in o)if(o.hasOwnProperty(c)){var h=c.indexOf("--")===0,E=ke(c,o[c],h);c==="float"&&(c="cssFloat"),h?i.setProperty(c,E):i[c]=E}}var ye=k({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Le(i,o){if(o){if(ye[i]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(n(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(n(61))}if(o.style!=null&&typeof o.style!="object")throw Error(n(62))}}function tt(i,o){if(i.indexOf("-")===-1)return typeof o.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ot=null;function Wt(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Mr=null,Jr=null,Zr=null;function $w(i){if(i=fu(i)){if(typeof Mr!="function")throw Error(n(280));var o=i.stateNode;o&&(o=Oc(o),Mr(i.stateNode,i.type,o))}}function Vw(i){Jr?Zr?Zr.push(i):Zr=[i]:Jr=i}function qw(){if(Jr){var i=Jr,o=Zr;if(Zr=Jr=null,$w(i),o)for(i=0;i<o.length;i++)$w(o[i])}}function Yw(i,o){return i(o)}function Ww(){}var kp=!1;function Gw(i,o,c){if(kp)return i(o,c);kp=!0;try{return Yw(i,o,c)}finally{kp=!1,(Jr!==null||Zr!==null)&&(Ww(),qw())}}function qa(i,o){var c=i.stateNode;if(c===null)return null;var h=Oc(c);if(h===null)return null;c=h[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(i=i.type,h=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!h;break e;default:i=!1}if(i)return null;if(c&&typeof c!="function")throw Error(n(231,o,typeof c));return c}var Cp=!1;if(l)try{var Ya={};Object.defineProperty(Ya,"passive",{get:function(){Cp=!0}}),window.addEventListener("test",Ya,Ya),window.removeEventListener("test",Ya,Ya)}catch(i){Cp=!1}function sB(i,o,c,h,E,T,v,F,$){var ee=Array.prototype.slice.call(arguments,3);try{o.apply(c,ee)}catch(ge){this.onError(ge)}}var Wa=!1,uc=null,lc=!1,Np=null,oB={onError:function(i){Wa=!0,uc=i}};function aB(i,o,c,h,E,T,v,F,$){Wa=!1,uc=null,sB.apply(oB,arguments)}function uB(i,o,c,h,E,T,v,F,$){if(aB.apply(this,arguments),Wa){if(Wa){var ee=uc;Wa=!1,uc=null}else throw Error(n(198));lc||(lc=!0,Np=ee)}}function Ts(i){var o=i,c=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(c=o.return),i=o.return;while(i)}return o.tag===3?c:null}function Xw(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function Kw(i){if(Ts(i)!==i)throw Error(n(188))}function lB(i){var o=i.alternate;if(!o){if(o=Ts(i),o===null)throw Error(n(188));return o!==i?null:i}for(var c=i,h=o;;){var E=c.return;if(E===null)break;var T=E.alternate;if(T===null){if(h=E.return,h!==null){c=h;continue}break}if(E.child===T.child){for(T=E.child;T;){if(T===c)return Kw(E),i;if(T===h)return Kw(E),o;T=T.sibling}throw Error(n(188))}if(c.return!==h.return)c=E,h=T;else{for(var v=!1,F=E.child;F;){if(F===c){v=!0,c=E,h=T;break}if(F===h){v=!0,h=E,c=T;break}F=F.sibling}if(!v){for(F=T.child;F;){if(F===c){v=!0,c=T,h=E;break}if(F===h){v=!0,h=T,c=E;break}F=F.sibling}if(!v)throw Error(n(189))}}if(c.alternate!==h)throw Error(n(190))}if(c.tag!==3)throw Error(n(188));return c.stateNode.current===c?i:o}function Qw(i){return i=lB(i),i!==null?Jw(i):null}function Jw(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var o=Jw(i);if(o!==null)return o;i=i.sibling}return null}var Zw=t.unstable_scheduleCallback,e_=t.unstable_cancelCallback,cB=t.unstable_shouldYield,dB=t.unstable_requestPaint,Ht=t.unstable_now,fB=t.unstable_getCurrentPriorityLevel,Op=t.unstable_ImmediatePriority,t_=t.unstable_UserBlockingPriority,cc=t.unstable_NormalPriority,hB=t.unstable_LowPriority,n_=t.unstable_IdlePriority,dc=null,Fr=null;function pB(i){if(Fr&&typeof Fr.onCommitFiberRoot=="function")try{Fr.onCommitFiberRoot(dc,i,void 0,(i.current.flags&128)===128)}catch(o){}}var mr=Math.clz32?Math.clz32:EB,mB=Math.log,gB=Math.LN2;function EB(i){return i>>>=0,i===0?32:31-(mB(i)/gB|0)|0}var fc=64,hc=4194304;function Ga(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function pc(i,o){var c=i.pendingLanes;if(c===0)return 0;var h=0,E=i.suspendedLanes,T=i.pingedLanes,v=c&268435455;if(v!==0){var F=v&~E;F!==0?h=Ga(F):(T&=v,T!==0&&(h=Ga(T)))}else v=c&~E,v!==0?h=Ga(v):T!==0&&(h=Ga(T));if(h===0)return 0;if(o!==0&&o!==h&&(o&E)===0&&(E=h&-h,T=o&-o,E>=T||E===16&&(T&4194240)!==0))return o;if((h&4)!==0&&(h|=c&16),o=i.entangledLanes,o!==0)for(i=i.entanglements,o&=h;0<o;)c=31-mr(o),E=1<<c,h|=i[c],o&=~E;return h}function yB(i,o){switch(i){case 1:case 2:case 4:return o+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function TB(i,o){for(var c=i.suspendedLanes,h=i.pingedLanes,E=i.expirationTimes,T=i.pendingLanes;0<T;){var v=31-mr(T),F=1<<v,$=E[v];$===-1?((F&c)===0||(F&h)!==0)&&(E[v]=yB(F,o)):$<=o&&(i.expiredLanes|=F),T&=~F}}function Ip(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function r_(){var i=fc;return fc<<=1,(fc&4194240)===0&&(fc=64),i}function Pp(i){for(var o=[],c=0;31>c;c++)o.push(i);return o}function Xa(i,o,c){i.pendingLanes|=o,o!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,o=31-mr(o),i[o]=c}function bB(i,o){var c=i.pendingLanes&~o;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=o,i.mutableReadLanes&=o,i.entangledLanes&=o,o=i.entanglements;var h=i.eventTimes;for(i=i.expirationTimes;0<c;){var E=31-mr(c),T=1<<E;o[E]=0,h[E]=-1,i[E]=-1,c&=~T}}function Rp(i,o){var c=i.entangledLanes|=o;for(i=i.entanglements;c;){var h=31-mr(c),E=1<<h;E&o|i[h]&o&&(i[h]|=o),c&=~E}}var gt=0;function i_(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var s_,Lp,o_,a_,u_,Dp=!1,mc=[],xi=null,Si=null,vi=null,Ka=new Map,Qa=new Map,Ai=[],wB="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function l_(i,o){switch(i){case"focusin":case"focusout":xi=null;break;case"dragenter":case"dragleave":Si=null;break;case"mouseover":case"mouseout":vi=null;break;case"pointerover":case"pointerout":Ka.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qa.delete(o.pointerId)}}function Ja(i,o,c,h,E,T){return i===null||i.nativeEvent!==T?(i={blockedOn:o,domEventName:c,eventSystemFlags:h,nativeEvent:T,targetContainers:[E]},o!==null&&(o=fu(o),o!==null&&Lp(o)),i):(i.eventSystemFlags|=h,o=i.targetContainers,E!==null&&o.indexOf(E)===-1&&o.push(E),i)}function _B(i,o,c,h,E){switch(o){case"focusin":return xi=Ja(xi,i,o,c,h,E),!0;case"dragenter":return Si=Ja(Si,i,o,c,h,E),!0;case"mouseover":return vi=Ja(vi,i,o,c,h,E),!0;case"pointerover":var T=E.pointerId;return Ka.set(T,Ja(Ka.get(T)||null,i,o,c,h,E)),!0;case"gotpointercapture":return T=E.pointerId,Qa.set(T,Ja(Qa.get(T)||null,i,o,c,h,E)),!0}return!1}function c_(i){var o=bs(i.target);if(o!==null){var c=Ts(o);if(c!==null){if(o=c.tag,o===13){if(o=Xw(c),o!==null){i.blockedOn=o,u_(i.priority,function(){o_(c)});return}}else if(o===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function gc(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var c=Fp(i.domEventName,i.eventSystemFlags,o[0],i.nativeEvent);if(c===null){c=i.nativeEvent;var h=new c.constructor(c.type,c);Ot=h,c.target.dispatchEvent(h),Ot=null}else return o=fu(c),o!==null&&Lp(o),i.blockedOn=c,!1;o.shift()}return!0}function d_(i,o,c){gc(i)&&c.delete(o)}function xB(){Dp=!1,xi!==null&&gc(xi)&&(xi=null),Si!==null&&gc(Si)&&(Si=null),vi!==null&&gc(vi)&&(vi=null),Ka.forEach(d_),Qa.forEach(d_)}function Za(i,o){i.blockedOn===o&&(i.blockedOn=null,Dp||(Dp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,xB)))}function eu(i){function o(E){return Za(E,i)}if(0<mc.length){Za(mc[0],i);for(var c=1;c<mc.length;c++){var h=mc[c];h.blockedOn===i&&(h.blockedOn=null)}}for(xi!==null&&Za(xi,i),Si!==null&&Za(Si,i),vi!==null&&Za(vi,i),Ka.forEach(o),Qa.forEach(o),c=0;c<Ai.length;c++)h=Ai[c],h.blockedOn===i&&(h.blockedOn=null);for(;0<Ai.length&&(c=Ai[0],c.blockedOn===null);)c_(c),c.blockedOn===null&&Ai.shift()}var vo=z.ReactCurrentBatchConfig,Ec=!0;function SB(i,o,c,h){var E=gt,T=vo.transition;vo.transition=null;try{gt=1,Mp(i,o,c,h)}finally{gt=E,vo.transition=T}}function vB(i,o,c,h){var E=gt,T=vo.transition;vo.transition=null;try{gt=4,Mp(i,o,c,h)}finally{gt=E,vo.transition=T}}function Mp(i,o,c,h){if(Ec){var E=Fp(i,o,c,h);if(E===null)em(i,o,h,yc,c),l_(i,h);else if(_B(E,i,o,c,h))h.stopPropagation();else if(l_(i,h),o&4&&-1<wB.indexOf(i)){for(;E!==null;){var T=fu(E);if(T!==null&&s_(T),T=Fp(i,o,c,h),T===null&&em(i,o,h,yc,c),T===E)break;E=T}E!==null&&h.stopPropagation()}else em(i,o,h,null,c)}}var yc=null;function Fp(i,o,c,h){if(yc=null,i=Wt(h),i=bs(i),i!==null)if(o=Ts(i),o===null)i=null;else if(c=o.tag,c===13){if(i=Xw(o),i!==null)return i;i=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null);return yc=i,null}function f_(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(fB()){case Op:return 1;case t_:return 4;case cc:case hB:return 16;case n_:return 536870912;default:return 16}default:return 16}}var ki=null,Bp=null,Tc=null;function h_(){if(Tc)return Tc;var i,o=Bp,c=o.length,h,E="value"in ki?ki.value:ki.textContent,T=E.length;for(i=0;i<c&&o[i]===E[i];i++);var v=c-i;for(h=1;h<=v&&o[c-h]===E[T-h];h++);return Tc=E.slice(i,1<h?1-h:void 0)}function bc(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function wc(){return!0}function p_(){return!1}function qn(i){function o(c,h,E,T,v){this._reactName=c,this._targetInst=E,this.type=h,this.nativeEvent=T,this.target=v,this.currentTarget=null;for(var F in i)i.hasOwnProperty(F)&&(c=i[F],this[F]=c?c(T):T[F]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?wc:p_,this.isPropagationStopped=p_,this}return k(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=wc)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=wc)},persist:function(){},isPersistent:wc}),o}var Ao={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Up=qn(Ao),tu=k({},Ao,{view:0,detail:0}),AB=qn(tu),Hp,jp,nu,_c=k({},tu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$p,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==nu&&(nu&&i.type==="mousemove"?(Hp=i.screenX-nu.screenX,jp=i.screenY-nu.screenY):jp=Hp=0,nu=i),Hp)},movementY:function(i){return"movementY"in i?i.movementY:jp}}),m_=qn(_c),kB=k({},_c,{dataTransfer:0}),CB=qn(kB),NB=k({},tu,{relatedTarget:0}),zp=qn(NB),OB=k({},Ao,{animationName:0,elapsedTime:0,pseudoElement:0}),IB=qn(OB),PB=k({},Ao,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),RB=qn(PB),LB=k({},Ao,{data:0}),g_=qn(LB),DB={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},MB={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},FB={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function BB(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=FB[i])?!!o[i]:!1}function $p(){return BB}var UB=k({},tu,{key:function(i){if(i.key){var o=DB[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=bc(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?MB[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$p,charCode:function(i){return i.type==="keypress"?bc(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?bc(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),HB=qn(UB),jB=k({},_c,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),E_=qn(jB),zB=k({},tu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$p}),$B=qn(zB),VB=k({},Ao,{propertyName:0,elapsedTime:0,pseudoElement:0}),qB=qn(VB),YB=k({},_c,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),WB=qn(YB),GB=[9,13,27,32],Vp=l&&"CompositionEvent"in window,ru=null;l&&"documentMode"in document&&(ru=document.documentMode);var XB=l&&"TextEvent"in window&&!ru,y_=l&&(!Vp||ru&&8<ru&&11>=ru),T_=" ",b_=!1;function w_(i,o){switch(i){case"keyup":return GB.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function __(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ko=!1;function KB(i,o){switch(i){case"compositionend":return __(o);case"keypress":return o.which!==32?null:(b_=!0,T_);case"textInput":return i=o.data,i===T_&&b_?null:i;default:return null}}function QB(i,o){if(ko)return i==="compositionend"||!Vp&&w_(i,o)?(i=h_(),Tc=Bp=ki=null,ko=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return y_&&o.locale!=="ko"?null:o.data;default:return null}}var JB={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function x_(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!JB[i.type]:o==="textarea"}function S_(i,o,c,h){Vw(h),o=kc(o,"onChange"),0<o.length&&(c=new Up("onChange","change",null,c,h),i.push({event:c,listeners:o}))}var iu=null,su=null;function ZB(i){z_(i,0)}function xc(i){var o=Po(i);if(Lt(o))return i}function e7(i,o){if(i==="change")return o}var v_=!1;if(l){var qp;if(l){var Yp="oninput"in document;if(!Yp){var A_=document.createElement("div");A_.setAttribute("oninput","return;"),Yp=typeof A_.oninput=="function"}qp=Yp}else qp=!1;v_=qp&&(!document.documentMode||9<document.documentMode)}function k_(){iu&&(iu.detachEvent("onpropertychange",C_),su=iu=null)}function C_(i){if(i.propertyName==="value"&&xc(su)){var o=[];S_(o,su,i,Wt(i)),Gw(ZB,o)}}function t7(i,o,c){i==="focusin"?(k_(),iu=o,su=c,iu.attachEvent("onpropertychange",C_)):i==="focusout"&&k_()}function n7(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return xc(su)}function r7(i,o){if(i==="click")return xc(o)}function i7(i,o){if(i==="input"||i==="change")return xc(o)}function s7(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var gr=typeof Object.is=="function"?Object.is:s7;function ou(i,o){if(gr(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var c=Object.keys(i),h=Object.keys(o);if(c.length!==h.length)return!1;for(h=0;h<c.length;h++){var E=c[h];if(!d.call(o,E)||!gr(i[E],o[E]))return!1}return!0}function N_(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function O_(i,o){var c=N_(i);i=0;for(var h;c;){if(c.nodeType===3){if(h=i+c.textContent.length,i<=o&&h>=o)return{node:c,offset:o-i};i=h}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=N_(c)}}function I_(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?I_(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function P_(){for(var i=window,o=pn();o instanceof i.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch(h){c=!1}if(c)i=o.contentWindow;else break;o=pn(i.document)}return o}function Wp(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}function o7(i){var o=P_(),c=i.focusedElem,h=i.selectionRange;if(o!==c&&c&&c.ownerDocument&&I_(c.ownerDocument.documentElement,c)){if(h!==null&&Wp(c)){if(o=h.start,i=h.end,i===void 0&&(i=o),"selectionStart"in c)c.selectionStart=o,c.selectionEnd=Math.min(i,c.value.length);else if(i=(o=c.ownerDocument||document)&&o.defaultView||window,i.getSelection){i=i.getSelection();var E=c.textContent.length,T=Math.min(h.start,E);h=h.end===void 0?T:Math.min(h.end,E),!i.extend&&T>h&&(E=h,h=T,T=E),E=O_(c,T);var v=O_(c,h);E&&v&&(i.rangeCount!==1||i.anchorNode!==E.node||i.anchorOffset!==E.offset||i.focusNode!==v.node||i.focusOffset!==v.offset)&&(o=o.createRange(),o.setStart(E.node,E.offset),i.removeAllRanges(),T>h?(i.addRange(o),i.extend(v.node,v.offset)):(o.setEnd(v.node,v.offset),i.addRange(o)))}}for(o=[],i=c;i=i.parentNode;)i.nodeType===1&&o.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;c<o.length;c++)i=o[c],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var a7=l&&"documentMode"in document&&11>=document.documentMode,Co=null,Gp=null,au=null,Xp=!1;function R_(i,o,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Xp||Co==null||Co!==pn(h)||(h=Co,"selectionStart"in h&&Wp(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),au&&ou(au,h)||(au=h,h=kc(Gp,"onSelect"),0<h.length&&(o=new Up("onSelect","select",null,o,c),i.push({event:o,listeners:h}),o.target=Co)))}function Sc(i,o){var c={};return c[i.toLowerCase()]=o.toLowerCase(),c["Webkit"+i]="webkit"+o,c["Moz"+i]="moz"+o,c}var No={animationend:Sc("Animation","AnimationEnd"),animationiteration:Sc("Animation","AnimationIteration"),animationstart:Sc("Animation","AnimationStart"),transitionend:Sc("Transition","TransitionEnd")},Kp={},L_={};l&&(L_=document.createElement("div").style,"AnimationEvent"in window||(delete No.animationend.animation,delete No.animationiteration.animation,delete No.animationstart.animation),"TransitionEvent"in window||delete No.transitionend.transition);function vc(i){if(Kp[i])return Kp[i];if(!No[i])return i;var o=No[i],c;for(c in o)if(o.hasOwnProperty(c)&&c in L_)return Kp[i]=o[c];return i}var D_=vc("animationend"),M_=vc("animationiteration"),F_=vc("animationstart"),B_=vc("transitionend"),U_=new Map,H_="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ci(i,o){U_.set(i,o),a(o,[i])}for(var Qp=0;Qp<H_.length;Qp++){var Jp=H_[Qp],u7=Jp.toLowerCase(),l7=Jp[0].toUpperCase()+Jp.slice(1);Ci(u7,"on"+l7)}Ci(D_,"onAnimationEnd"),Ci(M_,"onAnimationIteration"),Ci(F_,"onAnimationStart"),Ci("dblclick","onDoubleClick"),Ci("focusin","onFocus"),Ci("focusout","onBlur"),Ci(B_,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var uu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),c7=new Set("cancel close invalid load scroll toggle".split(" ").concat(uu));function j_(i,o,c){var h=i.type||"unknown-event";i.currentTarget=c,uB(h,o,void 0,i),i.currentTarget=null}function z_(i,o){o=(o&4)!==0;for(var c=0;c<i.length;c++){var h=i[c],E=h.event;h=h.listeners;e:{var T=void 0;if(o)for(var v=h.length-1;0<=v;v--){var F=h[v],$=F.instance,ee=F.currentTarget;if(F=F.listener,$!==T&&E.isPropagationStopped())break e;j_(E,F,ee),T=$}else for(v=0;v<h.length;v++){if(F=h[v],$=F.instance,ee=F.currentTarget,F=F.listener,$!==T&&E.isPropagationStopped())break e;j_(E,F,ee),T=$}}}if(lc)throw i=Np,lc=!1,Np=null,i}function vt(i,o){var c=o[om];c===void 0&&(c=o[om]=new Set);var h=i+"__bubble";c.has(h)||($_(o,i,2,!1),c.add(h))}function Zp(i,o,c){var h=0;o&&(h|=4),$_(c,i,h,o)}var Ac="_reactListening"+Math.random().toString(36).slice(2);function lu(i){if(!i[Ac]){i[Ac]=!0,r.forEach(function(c){c!=="selectionchange"&&(c7.has(c)||Zp(c,!1,i),Zp(c,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[Ac]||(o[Ac]=!0,Zp("selectionchange",!1,o))}}function $_(i,o,c,h){switch(f_(o)){case 1:var E=SB;break;case 4:E=vB;break;default:E=Mp}c=E.bind(null,o,c,i),E=void 0,!Cp||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(E=!0),h?E!==void 0?i.addEventListener(o,c,{capture:!0,passive:E}):i.addEventListener(o,c,!0):E!==void 0?i.addEventListener(o,c,{passive:E}):i.addEventListener(o,c,!1)}function em(i,o,c,h,E){var T=h;if((o&1)===0&&(o&2)===0&&h!==null)e:for(;;){if(h===null)return;var v=h.tag;if(v===3||v===4){var F=h.stateNode.containerInfo;if(F===E||F.nodeType===8&&F.parentNode===E)break;if(v===4)for(v=h.return;v!==null;){var $=v.tag;if(($===3||$===4)&&($=v.stateNode.containerInfo,$===E||$.nodeType===8&&$.parentNode===E))return;v=v.return}for(;F!==null;){if(v=bs(F),v===null)return;if($=v.tag,$===5||$===6){h=T=v;continue e}F=F.parentNode}}h=h.return}Gw(function(){var ee=T,ge=Wt(c),Te=[];e:{var pe=U_.get(i);if(pe!==void 0){var Pe=Up,De=i;switch(i){case"keypress":if(bc(c)===0)break e;case"keydown":case"keyup":Pe=HB;break;case"focusin":De="focus",Pe=zp;break;case"focusout":De="blur",Pe=zp;break;case"beforeblur":case"afterblur":Pe=zp;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Pe=m_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Pe=CB;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Pe=$B;break;case D_:case M_:case F_:Pe=IB;break;case B_:Pe=qB;break;case"scroll":Pe=AB;break;case"wheel":Pe=WB;break;case"copy":case"cut":case"paste":Pe=RB;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Pe=E_}var Me=(o&4)!==0,jt=!Me&&i==="scroll",X=Me?pe!==null?pe+"Capture":null:pe;Me=[];for(var q=ee,Q;q!==null;){Q=q;var we=Q.stateNode;if(Q.tag===5&&we!==null&&(Q=we,X!==null&&(we=qa(q,X),we!=null&&Me.push(cu(q,we,Q)))),jt)break;q=q.return}0<Me.length&&(pe=new Pe(pe,De,null,c,ge),Te.push({event:pe,listeners:Me}))}}if((o&7)===0){e:{if(pe=i==="mouseover"||i==="pointerover",Pe=i==="mouseout"||i==="pointerout",pe&&c!==Ot&&(De=c.relatedTarget||c.fromElement)&&(bs(De)||De[ei]))break e;if((Pe||pe)&&(pe=ge.window===ge?ge:(pe=ge.ownerDocument)?pe.defaultView||pe.parentWindow:window,Pe?(De=c.relatedTarget||c.toElement,Pe=ee,De=De?bs(De):null,De!==null&&(jt=Ts(De),De!==jt||De.tag!==5&&De.tag!==6)&&(De=null)):(Pe=null,De=ee),Pe!==De)){if(Me=m_,we="onMouseLeave",X="onMouseEnter",q="mouse",(i==="pointerout"||i==="pointerover")&&(Me=E_,we="onPointerLeave",X="onPointerEnter",q="pointer"),jt=Pe==null?pe:Po(Pe),Q=De==null?pe:Po(De),pe=new Me(we,q+"leave",Pe,c,ge),pe.target=jt,pe.relatedTarget=Q,we=null,bs(ge)===ee&&(Me=new Me(X,q+"enter",De,c,ge),Me.target=Q,Me.relatedTarget=jt,we=Me),jt=we,Pe&&De)t:{for(Me=Pe,X=De,q=0,Q=Me;Q;Q=Oo(Q))q++;for(Q=0,we=X;we;we=Oo(we))Q++;for(;0<q-Q;)Me=Oo(Me),q--;for(;0<Q-q;)X=Oo(X),Q--;for(;q--;){if(Me===X||X!==null&&Me===X.alternate)break t;Me=Oo(Me),X=Oo(X)}Me=null}else Me=null;Pe!==null&&V_(Te,pe,Pe,Me,!1),De!==null&&jt!==null&&V_(Te,jt,De,Me,!0)}}e:{if(pe=ee?Po(ee):window,Pe=pe.nodeName&&pe.nodeName.toLowerCase(),Pe==="select"||Pe==="input"&&pe.type==="file")var Ue=e7;else if(x_(pe))if(v_)Ue=i7;else{Ue=n7;var qe=t7}else(Pe=pe.nodeName)&&Pe.toLowerCase()==="input"&&(pe.type==="checkbox"||pe.type==="radio")&&(Ue=r7);if(Ue&&(Ue=Ue(i,ee))){S_(Te,Ue,c,ge);break e}qe&&qe(i,pe,ee),i==="focusout"&&(qe=pe._wrapperState)&&qe.controlled&&pe.type==="number"&&nt(pe,"number",pe.value)}switch(qe=ee?Po(ee):window,i){case"focusin":(x_(qe)||qe.contentEditable==="true")&&(Co=qe,Gp=ee,au=null);break;case"focusout":au=Gp=Co=null;break;case"mousedown":Xp=!0;break;case"contextmenu":case"mouseup":case"dragend":Xp=!1,R_(Te,c,ge);break;case"selectionchange":if(a7)break;case"keydown":case"keyup":R_(Te,c,ge)}var Ye;if(Vp)e:{switch(i){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else ko?w_(i,c)&&(Ke="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(Ke="onCompositionStart");Ke&&(y_&&c.locale!=="ko"&&(ko||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&ko&&(Ye=h_()):(ki=ge,Bp="value"in ki?ki.value:ki.textContent,ko=!0)),qe=kc(ee,Ke),0<qe.length&&(Ke=new g_(Ke,i,null,c,ge),Te.push({event:Ke,listeners:qe}),Ye?Ke.data=Ye:(Ye=__(c),Ye!==null&&(Ke.data=Ye)))),(Ye=XB?KB(i,c):QB(i,c))&&(ee=kc(ee,"onBeforeInput"),0<ee.length&&(ge=new g_("onBeforeInput","beforeinput",null,c,ge),Te.push({event:ge,listeners:ee}),ge.data=Ye))}z_(Te,o)})}function cu(i,o,c){return{instance:i,listener:o,currentTarget:c}}function kc(i,o){for(var c=o+"Capture",h=[];i!==null;){var E=i,T=E.stateNode;E.tag===5&&T!==null&&(E=T,T=qa(i,c),T!=null&&h.unshift(cu(i,T,E)),T=qa(i,o),T!=null&&h.push(cu(i,T,E))),i=i.return}return h}function Oo(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function V_(i,o,c,h,E){for(var T=o._reactName,v=[];c!==null&&c!==h;){var F=c,$=F.alternate,ee=F.stateNode;if($!==null&&$===h)break;F.tag===5&&ee!==null&&(F=ee,E?($=qa(c,T),$!=null&&v.unshift(cu(c,$,F))):E||($=qa(c,T),$!=null&&v.push(cu(c,$,F)))),c=c.return}v.length!==0&&i.push({event:o,listeners:v})}var d7=/\r\n?/g,f7=/\u0000|\uFFFD/g;function q_(i){return(typeof i=="string"?i:""+i).replace(d7,`
21
+ `).replace(f7,"")}function Cc(i,o,c){if(o=q_(o),q_(i)!==o&&c)throw Error(n(425))}function Nc(){}var tm=null,nm=null;function rm(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var im=typeof setTimeout=="function"?setTimeout:void 0,h7=typeof clearTimeout=="function"?clearTimeout:void 0,Y_=typeof Promise=="function"?Promise:void 0,p7=typeof queueMicrotask=="function"?queueMicrotask:typeof Y_!="undefined"?function(i){return Y_.resolve(null).then(i).catch(m7)}:im;function m7(i){setTimeout(function(){throw i})}function sm(i,o){var c=o,h=0;do{var E=c.nextSibling;if(i.removeChild(c),E&&E.nodeType===8)if(c=E.data,c==="/$"){if(h===0){i.removeChild(E),eu(o);return}h--}else c!=="$"&&c!=="$?"&&c!=="$!"||h++;c=E}while(c);eu(o)}function Ni(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?")break;if(o==="/$")return null}}return i}function W_(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"){if(o===0)return i;o--}else c==="/$"&&o++}i=i.previousSibling}return null}var Io=Math.random().toString(36).slice(2),Br="__reactFiber$"+Io,du="__reactProps$"+Io,ei="__reactContainer$"+Io,om="__reactEvents$"+Io,g7="__reactListeners$"+Io,E7="__reactHandles$"+Io;function bs(i){var o=i[Br];if(o)return o;for(var c=i.parentNode;c;){if(o=c[ei]||c[Br]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(i=W_(i);i!==null;){if(c=i[Br])return c;i=W_(i)}return o}i=c,c=i.parentNode}return null}function fu(i){return i=i[Br]||i[ei],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function Po(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function Oc(i){return i[du]||null}var am=[],Ro=-1;function Oi(i){return{current:i}}function At(i){0>Ro||(i.current=am[Ro],am[Ro]=null,Ro--)}function wt(i,o){Ro++,am[Ro]=i.current,i.current=o}var Ii={},mn=Oi(Ii),Dn=Oi(!1),ws=Ii;function Lo(i,o){var c=i.type.contextTypes;if(!c)return Ii;var h=i.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===o)return h.__reactInternalMemoizedMaskedChildContext;var E={},T;for(T in c)E[T]=o[T];return h&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=o,i.__reactInternalMemoizedMaskedChildContext=E),E}function Mn(i){return i=i.childContextTypes,i!=null}function Ic(){At(Dn),At(mn)}function G_(i,o,c){if(mn.current!==Ii)throw Error(n(168));wt(mn,o),wt(Dn,c)}function X_(i,o,c){var h=i.stateNode;if(o=o.childContextTypes,typeof h.getChildContext!="function")return c;h=h.getChildContext();for(var E in h)if(!(E in o))throw Error(n(108,ve(i)||"Unknown",E));return k({},c,h)}function Pc(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Ii,ws=mn.current,wt(mn,i),wt(Dn,Dn.current),!0}function K_(i,o,c){var h=i.stateNode;if(!h)throw Error(n(169));c?(i=X_(i,o,ws),h.__reactInternalMemoizedMergedChildContext=i,At(Dn),At(mn),wt(mn,i)):At(Dn),wt(Dn,c)}var ti=null,Rc=!1,um=!1;function Q_(i){ti===null?ti=[i]:ti.push(i)}function y7(i){Rc=!0,Q_(i)}function Pi(){if(!um&&ti!==null){um=!0;var i=0,o=gt;try{var c=ti;for(gt=1;i<c.length;i++){var h=c[i];do h=h(!0);while(h!==null)}ti=null,Rc=!1}catch(E){throw ti!==null&&(ti=ti.slice(i+1)),Zw(Op,Pi),E}finally{gt=o,um=!1}}return null}var Do=[],Mo=0,Lc=null,Dc=0,Zn=[],er=0,_s=null,ni=1,ri="";function xs(i,o){Do[Mo++]=Dc,Do[Mo++]=Lc,Lc=i,Dc=o}function J_(i,o,c){Zn[er++]=ni,Zn[er++]=ri,Zn[er++]=_s,_s=i;var h=ni;i=ri;var E=32-mr(h)-1;h&=~(1<<E),c+=1;var T=32-mr(o)+E;if(30<T){var v=E-E%5;T=(h&(1<<v)-1).toString(32),h>>=v,E-=v,ni=1<<32-mr(o)+E|c<<E|h,ri=T+i}else ni=1<<T|c<<E|h,ri=i}function lm(i){i.return!==null&&(xs(i,1),J_(i,1,0))}function cm(i){for(;i===Lc;)Lc=Do[--Mo],Do[Mo]=null,Dc=Do[--Mo],Do[Mo]=null;for(;i===_s;)_s=Zn[--er],Zn[er]=null,ri=Zn[--er],Zn[er]=null,ni=Zn[--er],Zn[er]=null}var Yn=null,Wn=null,Nt=!1,Er=null;function Z_(i,o){var c=ir(5,null,null,0);c.elementType="DELETED",c.stateNode=o,c.return=i,o=i.deletions,o===null?(i.deletions=[c],i.flags|=16):o.push(c)}function ex(i,o){switch(i.tag){case 5:var c=i.type;return o=o.nodeType!==1||c.toLowerCase()!==o.nodeName.toLowerCase()?null:o,o!==null?(i.stateNode=o,Yn=i,Wn=Ni(o.firstChild),!0):!1;case 6:return o=i.pendingProps===""||o.nodeType!==3?null:o,o!==null?(i.stateNode=o,Yn=i,Wn=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(c=_s!==null?{id:ni,overflow:ri}:null,i.memoizedState={dehydrated:o,treeContext:c,retryLane:1073741824},c=ir(18,null,null,0),c.stateNode=o,c.return=i,i.child=c,Yn=i,Wn=null,!0):!1;default:return!1}}function dm(i){return(i.mode&1)!==0&&(i.flags&128)===0}function fm(i){if(Nt){var o=Wn;if(o){var c=o;if(!ex(i,o)){if(dm(i))throw Error(n(418));o=Ni(c.nextSibling);var h=Yn;o&&ex(i,o)?Z_(h,c):(i.flags=i.flags&-4097|2,Nt=!1,Yn=i)}}else{if(dm(i))throw Error(n(418));i.flags=i.flags&-4097|2,Nt=!1,Yn=i}}}function tx(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;Yn=i}function Mc(i){if(i!==Yn)return!1;if(!Nt)return tx(i),Nt=!0,!1;var o;if((o=i.tag!==3)&&!(o=i.tag!==5)&&(o=i.type,o=o!=="head"&&o!=="body"&&!rm(i.type,i.memoizedProps)),o&&(o=Wn)){if(dm(i))throw nx(),Error(n(418));for(;o;)Z_(i,o),o=Ni(o.nextSibling)}if(tx(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"){if(o===0){Wn=Ni(i.nextSibling);break e}o--}else c!=="$"&&c!=="$!"&&c!=="$?"||o++}i=i.nextSibling}Wn=null}}else Wn=Yn?Ni(i.stateNode.nextSibling):null;return!0}function nx(){for(var i=Wn;i;)i=Ni(i.nextSibling)}function Fo(){Wn=Yn=null,Nt=!1}function hm(i){Er===null?Er=[i]:Er.push(i)}var T7=z.ReactCurrentBatchConfig;function hu(i,o,c){if(i=c.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(c._owner){if(c=c._owner,c){if(c.tag!==1)throw Error(n(309));var h=c.stateNode}if(!h)throw Error(n(147,i));var E=h,T=""+i;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===T?o.ref:(o=function(v){var F=E.refs;v===null?delete F[T]:F[T]=v},o._stringRef=T,o)}if(typeof i!="string")throw Error(n(284));if(!c._owner)throw Error(n(290,i))}return i}function Fc(i,o){throw i=Object.prototype.toString.call(o),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i))}function rx(i){var o=i._init;return o(i._payload)}function ix(i){function o(X,q){if(i){var Q=X.deletions;Q===null?(X.deletions=[q],X.flags|=16):Q.push(q)}}function c(X,q){if(!i)return null;for(;q!==null;)o(X,q),q=q.sibling;return null}function h(X,q){for(X=new Map;q!==null;)q.key!==null?X.set(q.key,q):X.set(q.index,q),q=q.sibling;return X}function E(X,q){return X=Hi(X,q),X.index=0,X.sibling=null,X}function T(X,q,Q){return X.index=Q,i?(Q=X.alternate,Q!==null?(Q=Q.index,Q<q?(X.flags|=2,q):Q):(X.flags|=2,q)):(X.flags|=1048576,q)}function v(X){return i&&X.alternate===null&&(X.flags|=2),X}function F(X,q,Q,we){return q===null||q.tag!==6?(q=i0(Q,X.mode,we),q.return=X,q):(q=E(q,Q),q.return=X,q)}function $(X,q,Q,we){var Ue=Q.type;return Ue===V?ge(X,q,Q.props.children,we,Q.key):q!==null&&(q.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===Se&&rx(Ue)===q.type)?(we=E(q,Q.props),we.ref=hu(X,q,Q),we.return=X,we):(we=ad(Q.type,Q.key,Q.props,null,X.mode,we),we.ref=hu(X,q,Q),we.return=X,we)}function ee(X,q,Q,we){return q===null||q.tag!==4||q.stateNode.containerInfo!==Q.containerInfo||q.stateNode.implementation!==Q.implementation?(q=s0(Q,X.mode,we),q.return=X,q):(q=E(q,Q.children||[]),q.return=X,q)}function ge(X,q,Q,we,Ue){return q===null||q.tag!==7?(q=Is(Q,X.mode,we,Ue),q.return=X,q):(q=E(q,Q),q.return=X,q)}function Te(X,q,Q){if(typeof q=="string"&&q!==""||typeof q=="number")return q=i0(""+q,X.mode,Q),q.return=X,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case G:return Q=ad(q.type,q.key,q.props,null,X.mode,Q),Q.ref=hu(X,null,q),Q.return=X,Q;case M:return q=s0(q,X.mode,Q),q.return=X,q;case Se:var we=q._init;return Te(X,we(q._payload),Q)}if(pt(q)||oe(q))return q=Is(q,X.mode,Q,null),q.return=X,q;Fc(X,q)}return null}function pe(X,q,Q,we){var Ue=q!==null?q.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number")return Ue!==null?null:F(X,q,""+Q,we);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case G:return Q.key===Ue?$(X,q,Q,we):null;case M:return Q.key===Ue?ee(X,q,Q,we):null;case Se:return Ue=Q._init,pe(X,q,Ue(Q._payload),we)}if(pt(Q)||oe(Q))return Ue!==null?null:ge(X,q,Q,we,null);Fc(X,Q)}return null}function Pe(X,q,Q,we,Ue){if(typeof we=="string"&&we!==""||typeof we=="number")return X=X.get(Q)||null,F(q,X,""+we,Ue);if(typeof we=="object"&&we!==null){switch(we.$$typeof){case G:return X=X.get(we.key===null?Q:we.key)||null,$(q,X,we,Ue);case M:return X=X.get(we.key===null?Q:we.key)||null,ee(q,X,we,Ue);case Se:var qe=we._init;return Pe(X,q,Q,qe(we._payload),Ue)}if(pt(we)||oe(we))return X=X.get(Q)||null,ge(q,X,we,Ue,null);Fc(q,we)}return null}function De(X,q,Q,we){for(var Ue=null,qe=null,Ye=q,Ke=q=0,nn=null;Ye!==null&&Ke<Q.length;Ke++){Ye.index>Ke?(nn=Ye,Ye=null):nn=Ye.sibling;var dt=pe(X,Ye,Q[Ke],we);if(dt===null){Ye===null&&(Ye=nn);break}i&&Ye&&dt.alternate===null&&o(X,Ye),q=T(dt,q,Ke),qe===null?Ue=dt:qe.sibling=dt,qe=dt,Ye=nn}if(Ke===Q.length)return c(X,Ye),Nt&&xs(X,Ke),Ue;if(Ye===null){for(;Ke<Q.length;Ke++)Ye=Te(X,Q[Ke],we),Ye!==null&&(q=T(Ye,q,Ke),qe===null?Ue=Ye:qe.sibling=Ye,qe=Ye);return Nt&&xs(X,Ke),Ue}for(Ye=h(X,Ye);Ke<Q.length;Ke++)nn=Pe(Ye,X,Ke,Q[Ke],we),nn!==null&&(i&&nn.alternate!==null&&Ye.delete(nn.key===null?Ke:nn.key),q=T(nn,q,Ke),qe===null?Ue=nn:qe.sibling=nn,qe=nn);return i&&Ye.forEach(function(ji){return o(X,ji)}),Nt&&xs(X,Ke),Ue}function Me(X,q,Q,we){var Ue=oe(Q);if(typeof Ue!="function")throw Error(n(150));if(Q=Ue.call(Q),Q==null)throw Error(n(151));for(var qe=Ue=null,Ye=q,Ke=q=0,nn=null,dt=Q.next();Ye!==null&&!dt.done;Ke++,dt=Q.next()){Ye.index>Ke?(nn=Ye,Ye=null):nn=Ye.sibling;var ji=pe(X,Ye,dt.value,we);if(ji===null){Ye===null&&(Ye=nn);break}i&&Ye&&ji.alternate===null&&o(X,Ye),q=T(ji,q,Ke),qe===null?Ue=ji:qe.sibling=ji,qe=ji,Ye=nn}if(dt.done)return c(X,Ye),Nt&&xs(X,Ke),Ue;if(Ye===null){for(;!dt.done;Ke++,dt=Q.next())dt=Te(X,dt.value,we),dt!==null&&(q=T(dt,q,Ke),qe===null?Ue=dt:qe.sibling=dt,qe=dt);return Nt&&xs(X,Ke),Ue}for(Ye=h(X,Ye);!dt.done;Ke++,dt=Q.next())dt=Pe(Ye,X,Ke,dt.value,we),dt!==null&&(i&&dt.alternate!==null&&Ye.delete(dt.key===null?Ke:dt.key),q=T(dt,q,Ke),qe===null?Ue=dt:qe.sibling=dt,qe=dt);return i&&Ye.forEach(function(J7){return o(X,J7)}),Nt&&xs(X,Ke),Ue}function jt(X,q,Q,we){if(typeof Q=="object"&&Q!==null&&Q.type===V&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case G:e:{for(var Ue=Q.key,qe=q;qe!==null;){if(qe.key===Ue){if(Ue=Q.type,Ue===V){if(qe.tag===7){c(X,qe.sibling),q=E(qe,Q.props.children),q.return=X,X=q;break e}}else if(qe.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===Se&&rx(Ue)===qe.type){c(X,qe.sibling),q=E(qe,Q.props),q.ref=hu(X,qe,Q),q.return=X,X=q;break e}c(X,qe);break}else o(X,qe);qe=qe.sibling}Q.type===V?(q=Is(Q.props.children,X.mode,we,Q.key),q.return=X,X=q):(we=ad(Q.type,Q.key,Q.props,null,X.mode,we),we.ref=hu(X,q,Q),we.return=X,X=we)}return v(X);case M:e:{for(qe=Q.key;q!==null;){if(q.key===qe)if(q.tag===4&&q.stateNode.containerInfo===Q.containerInfo&&q.stateNode.implementation===Q.implementation){c(X,q.sibling),q=E(q,Q.children||[]),q.return=X,X=q;break e}else{c(X,q);break}else o(X,q);q=q.sibling}q=s0(Q,X.mode,we),q.return=X,X=q}return v(X);case Se:return qe=Q._init,jt(X,q,qe(Q._payload),we)}if(pt(Q))return De(X,q,Q,we);if(oe(Q))return Me(X,q,Q,we);Fc(X,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"?(Q=""+Q,q!==null&&q.tag===6?(c(X,q.sibling),q=E(q,Q),q.return=X,X=q):(c(X,q),q=i0(Q,X.mode,we),q.return=X,X=q),v(X)):c(X,q)}return jt}var Bo=ix(!0),sx=ix(!1),Bc=Oi(null),Uc=null,Uo=null,pm=null;function mm(){pm=Uo=Uc=null}function gm(i){var o=Bc.current;At(Bc),i._currentValue=o}function Em(i,o,c){for(;i!==null;){var h=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,h!==null&&(h.childLanes|=o)):h!==null&&(h.childLanes&o)!==o&&(h.childLanes|=o),i===c)break;i=i.return}}function Ho(i,o){Uc=i,pm=Uo=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&o)!==0&&(Fn=!0),i.firstContext=null)}function tr(i){var o=i._currentValue;if(pm!==i)if(i={context:i,memoizedValue:o,next:null},Uo===null){if(Uc===null)throw Error(n(308));Uo=i,Uc.dependencies={lanes:0,firstContext:i}}else Uo=Uo.next=i;return o}var Ss=null;function ym(i){Ss===null?Ss=[i]:Ss.push(i)}function ox(i,o,c,h){var E=o.interleaved;return E===null?(c.next=c,ym(o)):(c.next=E.next,E.next=c),o.interleaved=c,ii(i,h)}function ii(i,o){i.lanes|=o;var c=i.alternate;for(c!==null&&(c.lanes|=o),c=i,i=i.return;i!==null;)i.childLanes|=o,c=i.alternate,c!==null&&(c.childLanes|=o),c=i,i=i.return;return c.tag===3?c.stateNode:null}var Ri=!1;function Tm(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ax(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function si(i,o){return{eventTime:i,lane:o,tag:0,payload:null,callback:null,next:null}}function Li(i,o,c){var h=i.updateQueue;if(h===null)return null;if(h=h.shared,(lt&2)!==0){var E=h.pending;return E===null?o.next=o:(o.next=E.next,E.next=o),h.pending=o,ii(i,c)}return E=h.interleaved,E===null?(o.next=o,ym(h)):(o.next=E.next,E.next=o),h.interleaved=o,ii(i,c)}function Hc(i,o,c){if(o=o.updateQueue,o!==null&&(o=o.shared,(c&4194240)!==0)){var h=o.lanes;h&=i.pendingLanes,c|=h,o.lanes=c,Rp(i,c)}}function ux(i,o){var c=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var E=null,T=null;if(c=c.firstBaseUpdate,c!==null){do{var v={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};T===null?E=T=v:T=T.next=v,c=c.next}while(c!==null);T===null?E=T=o:T=T.next=o}else E=T=o;c={baseState:h.baseState,firstBaseUpdate:E,lastBaseUpdate:T,shared:h.shared,effects:h.effects},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=o:i.next=o,c.lastBaseUpdate=o}function jc(i,o,c,h){var E=i.updateQueue;Ri=!1;var T=E.firstBaseUpdate,v=E.lastBaseUpdate,F=E.shared.pending;if(F!==null){E.shared.pending=null;var $=F,ee=$.next;$.next=null,v===null?T=ee:v.next=ee,v=$;var ge=i.alternate;ge!==null&&(ge=ge.updateQueue,F=ge.lastBaseUpdate,F!==v&&(F===null?ge.firstBaseUpdate=ee:F.next=ee,ge.lastBaseUpdate=$))}if(T!==null){var Te=E.baseState;v=0,ge=ee=$=null,F=T;do{var pe=F.lane,Pe=F.eventTime;if((h&pe)===pe){ge!==null&&(ge=ge.next={eventTime:Pe,lane:0,tag:F.tag,payload:F.payload,callback:F.callback,next:null});e:{var De=i,Me=F;switch(pe=o,Pe=c,Me.tag){case 1:if(De=Me.payload,typeof De=="function"){Te=De.call(Pe,Te,pe);break e}Te=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Me.payload,pe=typeof De=="function"?De.call(Pe,Te,pe):De,pe==null)break e;Te=k({},Te,pe);break e;case 2:Ri=!0}}F.callback!==null&&F.lane!==0&&(i.flags|=64,pe=E.effects,pe===null?E.effects=[F]:pe.push(F))}else Pe={eventTime:Pe,lane:pe,tag:F.tag,payload:F.payload,callback:F.callback,next:null},ge===null?(ee=ge=Pe,$=Te):ge=ge.next=Pe,v|=pe;if(F=F.next,F===null){if(F=E.shared.pending,F===null)break;pe=F,F=pe.next,pe.next=null,E.lastBaseUpdate=pe,E.shared.pending=null}}while(!0);if(ge===null&&($=Te),E.baseState=$,E.firstBaseUpdate=ee,E.lastBaseUpdate=ge,o=E.shared.interleaved,o!==null){E=o;do v|=E.lane,E=E.next;while(E!==o)}else T===null&&(E.shared.lanes=0);ks|=v,i.lanes=v,i.memoizedState=Te}}function lx(i,o,c){if(i=o.effects,o.effects=null,i!==null)for(o=0;o<i.length;o++){var h=i[o],E=h.callback;if(E!==null){if(h.callback=null,h=c,typeof E!="function")throw Error(n(191,E));E.call(h)}}}var pu={},Ur=Oi(pu),mu=Oi(pu),gu=Oi(pu);function vs(i){if(i===pu)throw Error(n(174));return i}function bm(i,o){switch(wt(gu,o),wt(mu,i),wt(Ur,pu),i=o.nodeType,i){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:_e(null,"");break;default:i=i===8?o.parentNode:o,o=i.namespaceURI||null,i=i.tagName,o=_e(o,i)}At(Ur),wt(Ur,o)}function jo(){At(Ur),At(mu),At(gu)}function cx(i){vs(gu.current);var o=vs(Ur.current),c=_e(o,i.type);o!==c&&(wt(mu,i),wt(Ur,c))}function wm(i){mu.current===i&&(At(Ur),At(mu))}var It=Oi(0);function zc(i){for(var o=i;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||c.data==="$?"||c.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var _m=[];function xm(){for(var i=0;i<_m.length;i++)_m[i]._workInProgressVersionPrimary=null;_m.length=0}var $c=z.ReactCurrentDispatcher,Sm=z.ReactCurrentBatchConfig,As=0,Pt=null,Gt=null,en=null,Vc=!1,Eu=!1,yu=0,b7=0;function gn(){throw Error(n(321))}function vm(i,o){if(o===null)return!1;for(var c=0;c<o.length&&c<i.length;c++)if(!gr(i[c],o[c]))return!1;return!0}function Am(i,o,c,h,E,T){if(As=T,Pt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,$c.current=i===null||i.memoizedState===null?S7:v7,i=c(h,E),Eu){T=0;do{if(Eu=!1,yu=0,25<=T)throw Error(n(301));T+=1,en=Gt=null,o.updateQueue=null,$c.current=A7,i=c(h,E)}while(Eu)}if($c.current=Wc,o=Gt!==null&&Gt.next!==null,As=0,en=Gt=Pt=null,Vc=!1,o)throw Error(n(300));return i}function km(){var i=yu!==0;return yu=0,i}function Hr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return en===null?Pt.memoizedState=en=i:en=en.next=i,en}function nr(){if(Gt===null){var i=Pt.alternate;i=i!==null?i.memoizedState:null}else i=Gt.next;var o=en===null?Pt.memoizedState:en.next;if(o!==null)en=o,Gt=i;else{if(i===null)throw Error(n(310));Gt=i,i={memoizedState:Gt.memoizedState,baseState:Gt.baseState,baseQueue:Gt.baseQueue,queue:Gt.queue,next:null},en===null?Pt.memoizedState=en=i:en=en.next=i}return en}function Tu(i,o){return typeof o=="function"?o(i):o}function Cm(i){var o=nr(),c=o.queue;if(c===null)throw Error(n(311));c.lastRenderedReducer=i;var h=Gt,E=h.baseQueue,T=c.pending;if(T!==null){if(E!==null){var v=E.next;E.next=T.next,T.next=v}h.baseQueue=E=T,c.pending=null}if(E!==null){T=E.next,h=h.baseState;var F=v=null,$=null,ee=T;do{var ge=ee.lane;if((As&ge)===ge)$!==null&&($=$.next={lane:0,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),h=ee.hasEagerState?ee.eagerState:i(h,ee.action);else{var Te={lane:ge,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null};$===null?(F=$=Te,v=h):$=$.next=Te,Pt.lanes|=ge,ks|=ge}ee=ee.next}while(ee!==null&&ee!==T);$===null?v=h:$.next=F,gr(h,o.memoizedState)||(Fn=!0),o.memoizedState=h,o.baseState=v,o.baseQueue=$,c.lastRenderedState=h}if(i=c.interleaved,i!==null){E=i;do T=E.lane,Pt.lanes|=T,ks|=T,E=E.next;while(E!==i)}else E===null&&(c.lanes=0);return[o.memoizedState,c.dispatch]}function Nm(i){var o=nr(),c=o.queue;if(c===null)throw Error(n(311));c.lastRenderedReducer=i;var h=c.dispatch,E=c.pending,T=o.memoizedState;if(E!==null){c.pending=null;var v=E=E.next;do T=i(T,v.action),v=v.next;while(v!==E);gr(T,o.memoizedState)||(Fn=!0),o.memoizedState=T,o.baseQueue===null&&(o.baseState=T),c.lastRenderedState=T}return[T,h]}function dx(){}function fx(i,o){var c=Pt,h=nr(),E=o(),T=!gr(h.memoizedState,E);if(T&&(h.memoizedState=E,Fn=!0),h=h.queue,Om(mx.bind(null,c,h,i),[i]),h.getSnapshot!==o||T||en!==null&&en.memoizedState.tag&1){if(c.flags|=2048,bu(9,px.bind(null,c,h,E,o),void 0,null),tn===null)throw Error(n(349));(As&30)!==0||hx(c,o,E)}return E}function hx(i,o,c){i.flags|=16384,i={getSnapshot:o,value:c},o=Pt.updateQueue,o===null?(o={lastEffect:null,stores:null},Pt.updateQueue=o,o.stores=[i]):(c=o.stores,c===null?o.stores=[i]:c.push(i))}function px(i,o,c,h){o.value=c,o.getSnapshot=h,gx(o)&&Ex(i)}function mx(i,o,c){return c(function(){gx(o)&&Ex(i)})}function gx(i){var o=i.getSnapshot;i=i.value;try{var c=o();return!gr(i,c)}catch(h){return!0}}function Ex(i){var o=ii(i,1);o!==null&&wr(o,i,1,-1)}function yx(i){var o=Hr();return typeof i=="function"&&(i=i()),o.memoizedState=o.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Tu,lastRenderedState:i},o.queue=i,i=i.dispatch=x7.bind(null,Pt,i),[o.memoizedState,i]}function bu(i,o,c,h){return i={tag:i,create:o,destroy:c,deps:h,next:null},o=Pt.updateQueue,o===null?(o={lastEffect:null,stores:null},Pt.updateQueue=o,o.lastEffect=i.next=i):(c=o.lastEffect,c===null?o.lastEffect=i.next=i:(h=c.next,c.next=i,i.next=h,o.lastEffect=i)),i}function Tx(){return nr().memoizedState}function qc(i,o,c,h){var E=Hr();Pt.flags|=i,E.memoizedState=bu(1|o,c,void 0,h===void 0?null:h)}function Yc(i,o,c,h){var E=nr();h=h===void 0?null:h;var T=void 0;if(Gt!==null){var v=Gt.memoizedState;if(T=v.destroy,h!==null&&vm(h,v.deps)){E.memoizedState=bu(o,c,T,h);return}}Pt.flags|=i,E.memoizedState=bu(1|o,c,T,h)}function bx(i,o){return qc(8390656,8,i,o)}function Om(i,o){return Yc(2048,8,i,o)}function wx(i,o){return Yc(4,2,i,o)}function _x(i,o){return Yc(4,4,i,o)}function xx(i,o){if(typeof o=="function")return i=i(),o(i),function(){o(null)};if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function Sx(i,o,c){return c=c!=null?c.concat([i]):null,Yc(4,4,xx.bind(null,o,i),c)}function Im(){}function vx(i,o){var c=nr();o=o===void 0?null:o;var h=c.memoizedState;return h!==null&&o!==null&&vm(o,h[1])?h[0]:(c.memoizedState=[i,o],i)}function Ax(i,o){var c=nr();o=o===void 0?null:o;var h=c.memoizedState;return h!==null&&o!==null&&vm(o,h[1])?h[0]:(i=i(),c.memoizedState=[i,o],i)}function kx(i,o,c){return(As&21)===0?(i.baseState&&(i.baseState=!1,Fn=!0),i.memoizedState=c):(gr(c,o)||(c=r_(),Pt.lanes|=c,ks|=c,i.baseState=!0),o)}function w7(i,o){var c=gt;gt=c!==0&&4>c?c:4,i(!0);var h=Sm.transition;Sm.transition={};try{i(!1),o()}finally{gt=c,Sm.transition=h}}function Cx(){return nr().memoizedState}function _7(i,o,c){var h=Bi(i);if(c={lane:h,action:c,hasEagerState:!1,eagerState:null,next:null},Nx(i))Ox(o,c);else if(c=ox(i,o,c,h),c!==null){var E=xn();wr(c,i,h,E),Ix(c,o,h)}}function x7(i,o,c){var h=Bi(i),E={lane:h,action:c,hasEagerState:!1,eagerState:null,next:null};if(Nx(i))Ox(o,E);else{var T=i.alternate;if(i.lanes===0&&(T===null||T.lanes===0)&&(T=o.lastRenderedReducer,T!==null))try{var v=o.lastRenderedState,F=T(v,c);if(E.hasEagerState=!0,E.eagerState=F,gr(F,v)){var $=o.interleaved;$===null?(E.next=E,ym(o)):(E.next=$.next,$.next=E),o.interleaved=E;return}}catch(ee){}c=ox(i,o,E,h),c!==null&&(E=xn(),wr(c,i,h,E),Ix(c,o,h))}}function Nx(i){var o=i.alternate;return i===Pt||o!==null&&o===Pt}function Ox(i,o){Eu=Vc=!0;var c=i.pending;c===null?o.next=o:(o.next=c.next,c.next=o),i.pending=o}function Ix(i,o,c){if((c&4194240)!==0){var h=o.lanes;h&=i.pendingLanes,c|=h,o.lanes=c,Rp(i,c)}}var Wc={readContext:tr,useCallback:gn,useContext:gn,useEffect:gn,useImperativeHandle:gn,useInsertionEffect:gn,useLayoutEffect:gn,useMemo:gn,useReducer:gn,useRef:gn,useState:gn,useDebugValue:gn,useDeferredValue:gn,useTransition:gn,useMutableSource:gn,useSyncExternalStore:gn,useId:gn,unstable_isNewReconciler:!1},S7={readContext:tr,useCallback:function(i,o){return Hr().memoizedState=[i,o===void 0?null:o],i},useContext:tr,useEffect:bx,useImperativeHandle:function(i,o,c){return c=c!=null?c.concat([i]):null,qc(4194308,4,xx.bind(null,o,i),c)},useLayoutEffect:function(i,o){return qc(4194308,4,i,o)},useInsertionEffect:function(i,o){return qc(4,2,i,o)},useMemo:function(i,o){var c=Hr();return o=o===void 0?null:o,i=i(),c.memoizedState=[i,o],i},useReducer:function(i,o,c){var h=Hr();return o=c!==void 0?c(o):o,h.memoizedState=h.baseState=o,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:o},h.queue=i,i=i.dispatch=_7.bind(null,Pt,i),[h.memoizedState,i]},useRef:function(i){var o=Hr();return i={current:i},o.memoizedState=i},useState:yx,useDebugValue:Im,useDeferredValue:function(i){return Hr().memoizedState=i},useTransition:function(){var i=yx(!1),o=i[0];return i=w7.bind(null,i[1]),Hr().memoizedState=i,[o,i]},useMutableSource:function(){},useSyncExternalStore:function(i,o,c){var h=Pt,E=Hr();if(Nt){if(c===void 0)throw Error(n(407));c=c()}else{if(c=o(),tn===null)throw Error(n(349));(As&30)!==0||hx(h,o,c)}E.memoizedState=c;var T={value:c,getSnapshot:o};return E.queue=T,bx(mx.bind(null,h,T,i),[i]),h.flags|=2048,bu(9,px.bind(null,h,T,c,o),void 0,null),c},useId:function(){var i=Hr(),o=tn.identifierPrefix;if(Nt){var c=ri,h=ni;c=(h&~(1<<32-mr(h)-1)).toString(32)+c,o=":"+o+"R"+c,c=yu++,0<c&&(o+="H"+c.toString(32)),o+=":"}else c=b7++,o=":"+o+"r"+c.toString(32)+":";return i.memoizedState=o},unstable_isNewReconciler:!1},v7={readContext:tr,useCallback:vx,useContext:tr,useEffect:Om,useImperativeHandle:Sx,useInsertionEffect:wx,useLayoutEffect:_x,useMemo:Ax,useReducer:Cm,useRef:Tx,useState:function(){return Cm(Tu)},useDebugValue:Im,useDeferredValue:function(i){var o=nr();return kx(o,Gt.memoizedState,i)},useTransition:function(){var i=Cm(Tu)[0],o=nr().memoizedState;return[i,o]},useMutableSource:dx,useSyncExternalStore:fx,useId:Cx,unstable_isNewReconciler:!1},A7={readContext:tr,useCallback:vx,useContext:tr,useEffect:Om,useImperativeHandle:Sx,useInsertionEffect:wx,useLayoutEffect:_x,useMemo:Ax,useReducer:Nm,useRef:Tx,useState:function(){return Nm(Tu)},useDebugValue:Im,useDeferredValue:function(i){var o=nr();return Gt===null?o.memoizedState=i:kx(o,Gt.memoizedState,i)},useTransition:function(){var i=Nm(Tu)[0],o=nr().memoizedState;return[i,o]},useMutableSource:dx,useSyncExternalStore:fx,useId:Cx,unstable_isNewReconciler:!1};function yr(i,o){if(i&&i.defaultProps){o=k({},o),i=i.defaultProps;for(var c in i)o[c]===void 0&&(o[c]=i[c]);return o}return o}function Pm(i,o,c,h){o=i.memoizedState,c=c(h,o),c=c==null?o:k({},o,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var Gc={isMounted:function(i){return(i=i._reactInternals)?Ts(i)===i:!1},enqueueSetState:function(i,o,c){i=i._reactInternals;var h=xn(),E=Bi(i),T=si(h,E);T.payload=o,c!=null&&(T.callback=c),o=Li(i,T,E),o!==null&&(wr(o,i,E,h),Hc(o,i,E))},enqueueReplaceState:function(i,o,c){i=i._reactInternals;var h=xn(),E=Bi(i),T=si(h,E);T.tag=1,T.payload=o,c!=null&&(T.callback=c),o=Li(i,T,E),o!==null&&(wr(o,i,E,h),Hc(o,i,E))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var c=xn(),h=Bi(i),E=si(c,h);E.tag=2,o!=null&&(E.callback=o),o=Li(i,E,h),o!==null&&(wr(o,i,h,c),Hc(o,i,h))}};function Px(i,o,c,h,E,T,v){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(h,T,v):o.prototype&&o.prototype.isPureReactComponent?!ou(c,h)||!ou(E,T):!0}function Rx(i,o,c){var h=!1,E=Ii,T=o.contextType;return typeof T=="object"&&T!==null?T=tr(T):(E=Mn(o)?ws:mn.current,h=o.contextTypes,T=(h=h!=null)?Lo(i,E):Ii),o=new o(c,T),i.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Gc,i.stateNode=o,o._reactInternals=i,h&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=E,i.__reactInternalMemoizedMaskedChildContext=T),o}function Lx(i,o,c,h){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(c,h),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(c,h),o.state!==i&&Gc.enqueueReplaceState(o,o.state,null)}function Rm(i,o,c,h){var E=i.stateNode;E.props=c,E.state=i.memoizedState,E.refs={},Tm(i);var T=o.contextType;typeof T=="object"&&T!==null?E.context=tr(T):(T=Mn(o)?ws:mn.current,E.context=Lo(i,T)),E.state=i.memoizedState,T=o.getDerivedStateFromProps,typeof T=="function"&&(Pm(i,o,T,c),E.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(o=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),o!==E.state&&Gc.enqueueReplaceState(E,E.state,null),jc(i,c,E,h),E.state=i.memoizedState),typeof E.componentDidMount=="function"&&(i.flags|=4194308)}function zo(i,o){try{var c="",h=o;do c+=Ie(h),h=h.return;while(h);var E=c}catch(T){E=`
22
22
  Error generating stack: `+T.message+`
23
- `+T.stack}return{value:i,source:o,stack:E,digest:null}}function Lm(i,o,c){return{value:i,source:null,stack:c!=null?c:null,digest:o!=null?o:null}}function Dm(i,o){try{console.error(o.value)}catch(c){setTimeout(function(){throw c})}}var k7=typeof WeakMap=="function"?WeakMap:Map;function Dx(i,o,c){c=si(-1,c),c.tag=3,c.payload={element:null};var h=o.value;return c.callback=function(){td||(td=!0,Km=h),Dm(i,o)},c}function Mx(i,o,c){c=si(-1,c),c.tag=3;var h=i.type.getDerivedStateFromError;if(typeof h=="function"){var E=o.value;c.payload=function(){return h(E)},c.callback=function(){Dm(i,o)}}var T=i.stateNode;return T!==null&&typeof T.componentDidCatch=="function"&&(c.callback=function(){Dm(i,o),typeof h!="function"&&(Mi===null?Mi=new Set([this]):Mi.add(this));var v=o.stack;this.componentDidCatch(o.value,{componentStack:v!==null?v:""})}),c}function Fx(i,o,c){var h=i.pingCache;if(h===null){h=i.pingCache=new k7;var E=new Set;h.set(o,E)}else E=h.get(o),E===void 0&&(E=new Set,h.set(o,E));E.has(c)||(E.add(c),i=j7.bind(null,i,o,c),o.then(i,i))}function Bx(i){do{var o;if((o=i.tag===13)&&(o=i.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return i;i=i.return}while(i!==null);return null}function Ux(i,o,c,h,E){return(i.mode&1)===0?(i===o?i.flags|=65536:(i.flags|=128,c.flags|=131072,c.flags&=-52805,c.tag===1&&(c.alternate===null?c.tag=17:(o=si(-1,1),o.tag=2,Li(c,o,1))),c.lanes|=1),i):(i.flags|=65536,i.lanes=E,i)}var C7=z.ReactCurrentOwner,Fn=!1;function _n(i,o,c,h){o.child=i===null?sx(o,null,c,h):Bo(o,i.child,c,h)}function Hx(i,o,c,h,E){c=c.render;var T=o.ref;return Ho(o,E),h=Am(i,o,c,h,T,E),c=km(),i!==null&&!Fn?(o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~E,oi(i,o,E)):(Nt&&c&&lm(o),o.flags|=1,_n(i,o,h,E),o.child)}function jx(i,o,c,h,E){if(i===null){var T=c.type;return typeof T=="function"&&!r0(T)&&T.defaultProps===void 0&&c.compare===null&&c.defaultProps===void 0?(o.tag=15,o.type=T,zx(i,o,T,h,E)):(i=ad(c.type,null,h,o,o.mode,E),i.ref=o.ref,i.return=o,o.child=i)}if(T=i.child,(i.lanes&E)===0){var v=T.memoizedProps;if(c=c.compare,c=c!==null?c:ou,c(v,h)&&i.ref===o.ref)return oi(i,o,E)}return o.flags|=1,i=Hi(T,h),i.ref=o.ref,i.return=o,o.child=i}function zx(i,o,c,h,E){if(i!==null){var T=i.memoizedProps;if(ou(T,h)&&i.ref===o.ref)if(Fn=!1,o.pendingProps=h=T,(i.lanes&E)!==0)(i.flags&131072)!==0&&(Fn=!0);else return o.lanes=i.lanes,oi(i,o,E)}return Mm(i,o,c,h,E)}function $x(i,o,c){var h=o.pendingProps,E=h.children,T=i!==null?i.memoizedState:null;if(h.mode==="hidden")if((o.mode&1)===0)o.memoizedState={baseLanes:0,cachePool:null,transitions:null},wt(Vo,Gn),Gn|=c;else{if((c&1073741824)===0)return i=T!==null?T.baseLanes|c:c,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:i,cachePool:null,transitions:null},o.updateQueue=null,wt(Vo,Gn),Gn|=i,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=T!==null?T.baseLanes:c,wt(Vo,Gn),Gn|=h}else T!==null?(h=T.baseLanes|c,o.memoizedState=null):h=c,wt(Vo,Gn),Gn|=h;return _n(i,o,E,c),o.child}function Vx(i,o){var c=o.ref;(i===null&&c!==null||i!==null&&i.ref!==c)&&(o.flags|=512,o.flags|=2097152)}function Mm(i,o,c,h,E){var T=Mn(c)?ws:mn.current;return T=Lo(o,T),Ho(o,E),c=Am(i,o,c,h,T,E),h=km(),i!==null&&!Fn?(o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~E,oi(i,o,E)):(Nt&&h&&lm(o),o.flags|=1,_n(i,o,c,E),o.child)}function qx(i,o,c,h,E){if(Mn(c)){var T=!0;Pc(o)}else T=!1;if(Ho(o,E),o.stateNode===null)Kc(i,o),Rx(o,c,h),Rm(o,c,h,E),h=!0;else if(i===null){var v=o.stateNode,F=o.memoizedProps;v.props=F;var $=v.context,ee=c.contextType;typeof ee=="object"&&ee!==null?ee=tr(ee):(ee=Mn(c)?ws:mn.current,ee=Lo(o,ee));var ge=c.getDerivedStateFromProps,Te=typeof ge=="function"||typeof v.getSnapshotBeforeUpdate=="function";Te||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(F!==h||$!==ee)&&Lx(o,v,h,ee),Ri=!1;var pe=o.memoizedState;v.state=pe,jc(o,h,v,E),$=o.memoizedState,F!==h||pe!==$||Dn.current||Ri?(typeof ge=="function"&&(Pm(o,c,ge,h),$=o.memoizedState),(F=Ri||Px(o,c,F,h,pe,$,ee))?(Te||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(o.flags|=4194308)):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=h,o.memoizedState=$),v.props=h,v.state=$,v.context=ee,h=F):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),h=!1)}else{v=o.stateNode,ax(i,o),F=o.memoizedProps,ee=o.type===o.elementType?F:yr(o.type,F),v.props=ee,Te=o.pendingProps,pe=v.context,$=c.contextType,typeof $=="object"&&$!==null?$=tr($):($=Mn(c)?ws:mn.current,$=Lo(o,$));var Pe=c.getDerivedStateFromProps;(ge=typeof Pe=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(F!==Te||pe!==$)&&Lx(o,v,h,$),Ri=!1,pe=o.memoizedState,v.state=pe,jc(o,h,v,E);var De=o.memoizedState;F!==Te||pe!==De||Dn.current||Ri?(typeof Pe=="function"&&(Pm(o,c,Pe,h),De=o.memoizedState),(ee=Ri||Px(o,c,ee,h,pe,De,$)||!1)?(ge||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(h,De,$),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(h,De,$)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||F===i.memoizedProps&&pe===i.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||F===i.memoizedProps&&pe===i.memoizedState||(o.flags|=1024),o.memoizedProps=h,o.memoizedState=De),v.props=h,v.state=De,v.context=$,h=ee):(typeof v.componentDidUpdate!="function"||F===i.memoizedProps&&pe===i.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||F===i.memoizedProps&&pe===i.memoizedState||(o.flags|=1024),h=!1)}return Fm(i,o,c,h,T,E)}function Fm(i,o,c,h,E,T){Vx(i,o);var v=(o.flags&128)!==0;if(!h&&!v)return E&&K_(o,c,!1),oi(i,o,T);h=o.stateNode,C7.current=o;var F=v&&typeof c.getDerivedStateFromError!="function"?null:h.render();return o.flags|=1,i!==null&&v?(o.child=Bo(o,i.child,null,T),o.child=Bo(o,null,F,T)):_n(i,o,F,T),o.memoizedState=h.state,E&&K_(o,c,!0),o.child}function Yx(i){var o=i.stateNode;o.pendingContext?G_(i,o.pendingContext,o.pendingContext!==o.context):o.context&&G_(i,o.context,!1),bm(i,o.containerInfo)}function Wx(i,o,c,h,E){return Fo(),hm(E),o.flags|=256,_n(i,o,c,h),o.child}var Bm={dehydrated:null,treeContext:null,retryLane:0};function Um(i){return{baseLanes:i,cachePool:null,transitions:null}}function Gx(i,o,c){var h=o.pendingProps,E=It.current,T=!1,v=(o.flags&128)!==0,F;if((F=v)||(F=i!==null&&i.memoizedState===null?!1:(E&2)!==0),F?(T=!0,o.flags&=-129):(i===null||i.memoizedState!==null)&&(E|=1),wt(It,E&1),i===null)return fm(o),i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((o.mode&1)===0?o.lanes=1:i.data==="$!"?o.lanes=8:o.lanes=1073741824,null):(v=h.children,i=h.fallback,T?(h=o.mode,T=o.child,v={mode:"hidden",children:v},(h&1)===0&&T!==null?(T.childLanes=0,T.pendingProps=v):T=ud(v,h,0,null),i=Is(i,h,c,null),T.return=o,i.return=o,T.sibling=i,o.child=T,o.child.memoizedState=Um(c),o.memoizedState=Bm,i):Hm(o,v));if(E=i.memoizedState,E!==null&&(F=E.dehydrated,F!==null))return N7(i,o,v,h,F,E,c);if(T){T=h.fallback,v=o.mode,E=i.child,F=E.sibling;var $={mode:"hidden",children:h.children};return(v&1)===0&&o.child!==E?(h=o.child,h.childLanes=0,h.pendingProps=$,o.deletions=null):(h=Hi(E,$),h.subtreeFlags=E.subtreeFlags&14680064),F!==null?T=Hi(F,T):(T=Is(T,v,c,null),T.flags|=2),T.return=o,h.return=o,h.sibling=T,o.child=h,h=T,T=o.child,v=i.child.memoizedState,v=v===null?Um(c):{baseLanes:v.baseLanes|c,cachePool:null,transitions:v.transitions},T.memoizedState=v,T.childLanes=i.childLanes&~c,o.memoizedState=Bm,h}return T=i.child,i=T.sibling,h=Hi(T,{mode:"visible",children:h.children}),(o.mode&1)===0&&(h.lanes=c),h.return=o,h.sibling=null,i!==null&&(c=o.deletions,c===null?(o.deletions=[i],o.flags|=16):c.push(i)),o.child=h,o.memoizedState=null,h}function Hm(i,o){return o=ud({mode:"visible",children:o},i.mode,0,null),o.return=i,i.child=o}function Xc(i,o,c,h){return h!==null&&hm(h),Bo(o,i.child,null,c),i=Hm(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function N7(i,o,c,h,E,T,v){if(c)return o.flags&256?(o.flags&=-257,h=Lm(Error(n(422))),Xc(i,o,v,h)):o.memoizedState!==null?(o.child=i.child,o.flags|=128,null):(T=h.fallback,E=o.mode,h=ud({mode:"visible",children:h.children},E,0,null),T=Is(T,E,v,null),T.flags|=2,h.return=o,T.return=o,h.sibling=T,o.child=h,(o.mode&1)!==0&&Bo(o,i.child,null,v),o.child.memoizedState=Um(v),o.memoizedState=Bm,T);if((o.mode&1)===0)return Xc(i,o,v,null);if(E.data==="$!"){if(h=E.nextSibling&&E.nextSibling.dataset,h)var F=h.dgst;return h=F,T=Error(n(419)),h=Lm(T,h,void 0),Xc(i,o,v,h)}if(F=(v&i.childLanes)!==0,Fn||F){if(h=tn,h!==null){switch(v&-v){case 4:E=2;break;case 16:E=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:E=32;break;case 536870912:E=268435456;break;default:E=0}E=(E&(h.suspendedLanes|v))!==0?0:E,E!==0&&E!==T.retryLane&&(T.retryLane=E,ii(i,E),wr(h,i,E,-1))}return n0(),h=Lm(Error(n(421))),Xc(i,o,v,h)}return E.data==="$?"?(o.flags|=128,o.child=i.child,o=z7.bind(null,i),E._reactRetry=o,null):(i=T.treeContext,Wn=Ni(E.nextSibling),Yn=o,Nt=!0,Er=null,i!==null&&(Zn[er++]=ni,Zn[er++]=ri,Zn[er++]=_s,ni=i.id,ri=i.overflow,_s=o),o=Hm(o,h.children),o.flags|=4096,o)}function Xx(i,o,c){i.lanes|=o;var h=i.alternate;h!==null&&(h.lanes|=o),Em(i.return,o,c)}function jm(i,o,c,h,E){var T=i.memoizedState;T===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:E}:(T.isBackwards=o,T.rendering=null,T.renderingStartTime=0,T.last=h,T.tail=c,T.tailMode=E)}function Kx(i,o,c){var h=o.pendingProps,E=h.revealOrder,T=h.tail;if(_n(i,o,h.children,c),h=It.current,(h&2)!==0)h=h&1|2,o.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Xx(i,c,o);else if(i.tag===19)Xx(i,c,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}h&=1}if(wt(It,h),(o.mode&1)===0)o.memoizedState=null;else switch(E){case"forwards":for(c=o.child,E=null;c!==null;)i=c.alternate,i!==null&&zc(i)===null&&(E=c),c=c.sibling;c=E,c===null?(E=o.child,o.child=null):(E=c.sibling,c.sibling=null),jm(o,!1,E,c,T);break;case"backwards":for(c=null,E=o.child,o.child=null;E!==null;){if(i=E.alternate,i!==null&&zc(i)===null){o.child=E;break}i=E.sibling,E.sibling=c,c=E,E=i}jm(o,!0,c,null,T);break;case"together":jm(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function Kc(i,o){(o.mode&1)===0&&i!==null&&(i.alternate=null,o.alternate=null,o.flags|=2)}function oi(i,o,c){if(i!==null&&(o.dependencies=i.dependencies),ks|=o.lanes,(c&o.childLanes)===0)return null;if(i!==null&&o.child!==i.child)throw Error(n(153));if(o.child!==null){for(i=o.child,c=Hi(i,i.pendingProps),o.child=c,c.return=o;i.sibling!==null;)i=i.sibling,c=c.sibling=Hi(i,i.pendingProps),c.return=o;c.sibling=null}return o.child}function O7(i,o,c){switch(o.tag){case 3:Yx(o),Fo();break;case 5:cx(o);break;case 1:Mn(o.type)&&Pc(o);break;case 4:bm(o,o.stateNode.containerInfo);break;case 10:var h=o.type._context,E=o.memoizedProps.value;wt(Bc,h._currentValue),h._currentValue=E;break;case 13:if(h=o.memoizedState,h!==null)return h.dehydrated!==null?(wt(It,It.current&1),o.flags|=128,null):(c&o.child.childLanes)!==0?Gx(i,o,c):(wt(It,It.current&1),i=oi(i,o,c),i!==null?i.sibling:null);wt(It,It.current&1);break;case 19:if(h=(c&o.childLanes)!==0,(i.flags&128)!==0){if(h)return Kx(i,o,c);o.flags|=128}if(E=o.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),wt(It,It.current),h)break;return null;case 22:case 23:return o.lanes=0,$x(i,o,c)}return oi(i,o,c)}var Qx,zm,Jx,Zx;Qx=function(i,o){for(var c=o.child;c!==null;){if(c.tag===5||c.tag===6)i.appendChild(c.stateNode);else if(c.tag!==4&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return;c=c.return}c.sibling.return=c.return,c=c.sibling}},zm=function(){},Jx=function(i,o,c,h){var E=i.memoizedProps;if(E!==h){i=o.stateNode,vs(Ur.current);var T=null;switch(c){case"input":E=wn(i,E),h=wn(i,h),T=[];break;case"select":E=k({},E,{value:void 0}),h=k({},h,{value:void 0}),T=[];break;case"textarea":E=Ln(i,E),h=Ln(i,h),T=[];break;default:typeof E.onClick!="function"&&typeof h.onClick=="function"&&(i.onclick=Nc)}Le(c,h);var v;c=null;for(ee in E)if(!h.hasOwnProperty(ee)&&E.hasOwnProperty(ee)&&E[ee]!=null)if(ee==="style"){var F=E[ee];for(v in F)F.hasOwnProperty(v)&&(c||(c={}),c[v]="")}else ee!=="dangerouslySetInnerHTML"&&ee!=="children"&&ee!=="suppressContentEditableWarning"&&ee!=="suppressHydrationWarning"&&ee!=="autoFocus"&&(s.hasOwnProperty(ee)?T||(T=[]):(T=T||[]).push(ee,null));for(ee in h){var $=h[ee];if(F=E!=null?E[ee]:void 0,h.hasOwnProperty(ee)&&$!==F&&($!=null||F!=null))if(ee==="style")if(F){for(v in F)!F.hasOwnProperty(v)||$&&$.hasOwnProperty(v)||(c||(c={}),c[v]="");for(v in $)$.hasOwnProperty(v)&&F[v]!==$[v]&&(c||(c={}),c[v]=$[v])}else c||(T||(T=[]),T.push(ee,c)),c=$;else ee==="dangerouslySetInnerHTML"?($=$?$.__html:void 0,F=F?F.__html:void 0,$!=null&&F!==$&&(T=T||[]).push(ee,$)):ee==="children"?typeof $!="string"&&typeof $!="number"||(T=T||[]).push(ee,""+$):ee!=="suppressContentEditableWarning"&&ee!=="suppressHydrationWarning"&&(s.hasOwnProperty(ee)?($!=null&&ee==="onScroll"&&vt("scroll",i),T||F===$||(T=[])):(T=T||[]).push(ee,$))}c&&(T=T||[]).push("style",c);var ee=T;(o.updateQueue=ee)&&(o.flags|=4)}},Zx=function(i,o,c,h){c!==h&&(o.flags|=4)};function wu(i,o){if(!Nt)switch(i.tailMode){case"hidden":o=i.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:h.sibling=null}}function En(i){var o=i.alternate!==null&&i.alternate.child===i.child,c=0,h=0;if(o)for(var E=i.child;E!==null;)c|=E.lanes|E.childLanes,h|=E.subtreeFlags&14680064,h|=E.flags&14680064,E.return=i,E=E.sibling;else for(E=i.child;E!==null;)c|=E.lanes|E.childLanes,h|=E.subtreeFlags,h|=E.flags,E.return=i,E=E.sibling;return i.subtreeFlags|=h,i.childLanes=c,o}function I7(i,o,c){var h=o.pendingProps;switch(cm(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return En(o),null;case 1:return Mn(o.type)&&Ic(),En(o),null;case 3:return h=o.stateNode,jo(),At(Dn),At(mn),xm(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(i===null||i.child===null)&&(Mc(o)?o.flags|=4:i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Er!==null&&(Zm(Er),Er=null))),zm(i,o),En(o),null;case 5:wm(o);var E=vs(gu.current);if(c=o.type,i!==null&&o.stateNode!=null)Jx(i,o,c,h,E),i.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!h){if(o.stateNode===null)throw Error(n(166));return En(o),null}if(i=vs(Ur.current),Mc(o)){h=o.stateNode,c=o.type;var T=o.memoizedProps;switch(h[Br]=o,h[du]=T,i=(o.mode&1)!==0,c){case"dialog":vt("cancel",h),vt("close",h);break;case"iframe":case"object":case"embed":vt("load",h);break;case"video":case"audio":for(E=0;E<uu.length;E++)vt(uu[E],h);break;case"source":vt("error",h);break;case"img":case"image":case"link":vt("error",h),vt("load",h);break;case"details":vt("toggle",h);break;case"input":Dt(h,T),vt("invalid",h);break;case"select":h._wrapperState={wasMultiple:!!T.multiple},vt("invalid",h);break;case"textarea":gs(h,T),vt("invalid",h)}Le(c,T),E=null;for(var v in T)if(T.hasOwnProperty(v)){var F=T[v];v==="children"?typeof F=="string"?h.textContent!==F&&(T.suppressHydrationWarning!==!0&&Cc(h.textContent,F,i),E=["children",F]):typeof F=="number"&&h.textContent!==""+F&&(T.suppressHydrationWarning!==!0&&Cc(h.textContent,F,i),E=["children",""+F]):s.hasOwnProperty(v)&&F!=null&&v==="onScroll"&&vt("scroll",h)}switch(c){case"input":mt(h),Xe(h,T,!0);break;case"textarea":mt(h),ys(h);break;case"select":case"option":break;default:typeof T.onClick=="function"&&(h.onclick=Nc)}h=E,o.updateQueue=h,h!==null&&(o.flags|=4)}else{v=E.nodeType===9?E:E.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=ae(c)),i==="http://www.w3.org/1999/xhtml"?c==="script"?(i=v.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof h.is=="string"?i=v.createElement(c,{is:h.is}):(i=v.createElement(c),c==="select"&&(v=i,h.multiple?v.multiple=!0:h.size&&(v.size=h.size))):i=v.createElementNS(i,c),i[Br]=o,i[du]=h,Qx(i,o,!1,!1),o.stateNode=i;e:{switch(v=tt(c,h),c){case"dialog":vt("cancel",i),vt("close",i),E=h;break;case"iframe":case"object":case"embed":vt("load",i),E=h;break;case"video":case"audio":for(E=0;E<uu.length;E++)vt(uu[E],i);E=h;break;case"source":vt("error",i),E=h;break;case"img":case"image":case"link":vt("error",i),vt("load",i),E=h;break;case"details":vt("toggle",i),E=h;break;case"input":Dt(i,h),E=wn(i,h),vt("invalid",i);break;case"option":E=h;break;case"select":i._wrapperState={wasMultiple:!!h.multiple},E=k({},h,{value:void 0}),vt("invalid",i);break;case"textarea":gs(i,h),E=Ln(i,h),vt("invalid",i);break;default:E=h}Le(c,E),F=E;for(T in F)if(F.hasOwnProperty(T)){var $=F[T];T==="style"?Ne(i,$):T==="dangerouslySetInnerHTML"?($=$?$.__html:void 0,$!=null&&Ze(i,$)):T==="children"?typeof $=="string"?(c!=="textarea"||$!=="")&&at(i,$):typeof $=="number"&&at(i,""+$):T!=="suppressContentEditableWarning"&&T!=="suppressHydrationWarning"&&T!=="autoFocus"&&(s.hasOwnProperty(T)?$!=null&&T==="onScroll"&&vt("scroll",i):$!=null&&O(i,T,$,v))}switch(c){case"input":mt(i),Xe(i,h,!1);break;case"textarea":mt(i),ys(i);break;case"option":h.value!=null&&i.setAttribute("value",""+Fe(h.value));break;case"select":i.multiple=!!h.multiple,T=h.value,T!=null?Mt(i,!!h.multiple,T,!1):h.defaultValue!=null&&Mt(i,!!h.multiple,h.defaultValue,!0);break;default:typeof E.onClick=="function"&&(i.onclick=Nc)}switch(c){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}}h&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return En(o),null;case 6:if(i&&o.stateNode!=null)Zx(i,o,i.memoizedProps,h);else{if(typeof h!="string"&&o.stateNode===null)throw Error(n(166));if(c=vs(gu.current),vs(Ur.current),Mc(o)){if(h=o.stateNode,c=o.memoizedProps,h[Br]=o,(T=h.nodeValue!==c)&&(i=Yn,i!==null))switch(i.tag){case 3:Cc(h.nodeValue,c,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&Cc(h.nodeValue,c,(i.mode&1)!==0)}T&&(o.flags|=4)}else h=(c.nodeType===9?c:c.ownerDocument).createTextNode(h),h[Br]=o,o.stateNode=h}return En(o),null;case 13:if(At(It),h=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Nt&&Wn!==null&&(o.mode&1)!==0&&(o.flags&128)===0)nx(),Fo(),o.flags|=98560,T=!1;else if(T=Mc(o),h!==null&&h.dehydrated!==null){if(i===null){if(!T)throw Error(n(318));if(T=o.memoizedState,T=T!==null?T.dehydrated:null,!T)throw Error(n(317));T[Br]=o}else Fo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;En(o),T=!1}else Er!==null&&(Zm(Er),Er=null),T=!0;if(!T)return o.flags&65536?o:null}return(o.flags&128)!==0?(o.lanes=c,o):(h=h!==null,h!==(i!==null&&i.memoizedState!==null)&&h&&(o.child.flags|=8192,(o.mode&1)!==0&&(i===null||(It.current&1)!==0?Xt===0&&(Xt=3):n0())),o.updateQueue!==null&&(o.flags|=4),En(o),null);case 4:return jo(),zm(i,o),i===null&&lu(o.stateNode.containerInfo),En(o),null;case 10:return gm(o.type._context),En(o),null;case 17:return Mn(o.type)&&Ic(),En(o),null;case 19:if(At(It),T=o.memoizedState,T===null)return En(o),null;if(h=(o.flags&128)!==0,v=T.rendering,v===null)if(h)wu(T,!1);else{if(Xt!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(v=zc(i),v!==null){for(o.flags|=128,wu(T,!1),h=v.updateQueue,h!==null&&(o.updateQueue=h,o.flags|=4),o.subtreeFlags=0,h=c,c=o.child;c!==null;)T=c,i=h,T.flags&=14680066,v=T.alternate,v===null?(T.childLanes=0,T.lanes=i,T.child=null,T.subtreeFlags=0,T.memoizedProps=null,T.memoizedState=null,T.updateQueue=null,T.dependencies=null,T.stateNode=null):(T.childLanes=v.childLanes,T.lanes=v.lanes,T.child=v.child,T.subtreeFlags=0,T.deletions=null,T.memoizedProps=v.memoizedProps,T.memoizedState=v.memoizedState,T.updateQueue=v.updateQueue,T.type=v.type,i=v.dependencies,T.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),c=c.sibling;return wt(It,It.current&1|2),o.child}i=i.sibling}T.tail!==null&&Ht()>qo&&(o.flags|=128,h=!0,wu(T,!1),o.lanes=4194304)}else{if(!h)if(i=zc(v),i!==null){if(o.flags|=128,h=!0,c=i.updateQueue,c!==null&&(o.updateQueue=c,o.flags|=4),wu(T,!0),T.tail===null&&T.tailMode==="hidden"&&!v.alternate&&!Nt)return En(o),null}else 2*Ht()-T.renderingStartTime>qo&&c!==1073741824&&(o.flags|=128,h=!0,wu(T,!1),o.lanes=4194304);T.isBackwards?(v.sibling=o.child,o.child=v):(c=T.last,c!==null?c.sibling=v:o.child=v,T.last=v)}return T.tail!==null?(o=T.tail,T.rendering=o,T.tail=o.sibling,T.renderingStartTime=Ht(),o.sibling=null,c=It.current,wt(It,h?c&1|2:c&1),o):(En(o),null);case 22:case 23:return t0(),h=o.memoizedState!==null,i!==null&&i.memoizedState!==null!==h&&(o.flags|=8192),h&&(o.mode&1)!==0?(Gn&1073741824)!==0&&(En(o),o.subtreeFlags&6&&(o.flags|=8192)):En(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function P7(i,o){switch(cm(o),o.tag){case 1:return Mn(o.type)&&Ic(),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return jo(),At(Dn),At(mn),xm(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 5:return wm(o),null;case 13:if(At(It),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(n(340));Fo()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return At(It),null;case 4:return jo(),null;case 10:return gm(o.type._context),null;case 22:case 23:return t0(),null;case 24:return null;default:return null}}var Qc=!1,yn=!1,R7=typeof WeakSet=="function"?WeakSet:Set,Re=null;function $o(i,o){var c=i.ref;if(c!==null)if(typeof c=="function")try{c(null)}catch(h){Ft(i,o,h)}else c.current=null}function $m(i,o,c){try{c()}catch(h){Ft(i,o,h)}}var e2=!1;function L7(i,o){if(tm=Ec,i=P_(),Wp(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var h=c.getSelection&&c.getSelection();if(h&&h.rangeCount!==0){c=h.anchorNode;var E=h.anchorOffset,T=h.focusNode;h=h.focusOffset;try{c.nodeType,T.nodeType}catch(we){c=null;break e}var v=0,F=-1,$=-1,ee=0,ge=0,Te=i,pe=null;t:for(;;){for(var Pe;Te!==c||E!==0&&Te.nodeType!==3||(F=v+E),Te!==T||h!==0&&Te.nodeType!==3||($=v+h),Te.nodeType===3&&(v+=Te.nodeValue.length),(Pe=Te.firstChild)!==null;)pe=Te,Te=Pe;for(;;){if(Te===i)break t;if(pe===c&&++ee===E&&(F=v),pe===T&&++ge===h&&($=v),(Pe=Te.nextSibling)!==null)break;Te=pe,pe=Te.parentNode}Te=Pe}c=F===-1||$===-1?null:{start:F,end:$}}else c=null}c=c||{start:0,end:0}}else c=null;for(nm={focusedElem:i,selectionRange:c},Ec=!1,Re=o;Re!==null;)if(o=Re,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,Re=i;else for(;Re!==null;){o=Re;try{var De=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(De!==null){var Me=De.memoizedProps,jt=De.memoizedState,X=o.stateNode,q=X.getSnapshotBeforeUpdate(o.elementType===o.type?Me:yr(o.type,Me),jt);X.__reactInternalSnapshotBeforeUpdate=q}break;case 3:var Q=o.stateNode.containerInfo;Q.nodeType===1?Q.textContent="":Q.nodeType===9&&Q.documentElement&&Q.removeChild(Q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(we){Ft(o,o.return,we)}if(i=o.sibling,i!==null){i.return=o.return,Re=i;break}Re=o.return}return De=e2,e2=!1,De}function _u(i,o,c){var h=o.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var E=h=h.next;do{if((E.tag&i)===i){var T=E.destroy;E.destroy=void 0,T!==void 0&&$m(o,c,T)}E=E.next}while(E!==h)}}function Jc(i,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var c=o=o.next;do{if((c.tag&i)===i){var h=c.create;c.destroy=h()}c=c.next}while(c!==o)}}function Vm(i){var o=i.ref;if(o!==null){var c=i.stateNode;i.tag,i=c,typeof o=="function"?o(i):o.current=i}}function t2(i){var o=i.alternate;o!==null&&(i.alternate=null,t2(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&(delete o[Br],delete o[du],delete o[om],delete o[g7],delete o[E7])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function n2(i){return i.tag===5||i.tag===3||i.tag===4}function r2(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||n2(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function qm(i,o,c){var h=i.tag;if(h===5||h===6)i=i.stateNode,o?c.nodeType===8?c.parentNode.insertBefore(i,o):c.insertBefore(i,o):(c.nodeType===8?(o=c.parentNode,o.insertBefore(i,c)):(o=c,o.appendChild(i)),c=c._reactRootContainer,c!=null||o.onclick!==null||(o.onclick=Nc));else if(h!==4&&(i=i.child,i!==null))for(qm(i,o,c),i=i.sibling;i!==null;)qm(i,o,c),i=i.sibling}function Ym(i,o,c){var h=i.tag;if(h===5||h===6)i=i.stateNode,o?c.insertBefore(i,o):c.appendChild(i);else if(h!==4&&(i=i.child,i!==null))for(Ym(i,o,c),i=i.sibling;i!==null;)Ym(i,o,c),i=i.sibling}var on=null,Tr=!1;function Di(i,o,c){for(c=c.child;c!==null;)i2(i,o,c),c=c.sibling}function i2(i,o,c){if(Fr&&typeof Fr.onCommitFiberUnmount=="function")try{Fr.onCommitFiberUnmount(dc,c)}catch(F){}switch(c.tag){case 5:yn||$o(c,o);case 6:var h=on,E=Tr;on=null,Di(i,o,c),on=h,Tr=E,on!==null&&(Tr?(i=on,c=c.stateNode,i.nodeType===8?i.parentNode.removeChild(c):i.removeChild(c)):on.removeChild(c.stateNode));break;case 18:on!==null&&(Tr?(i=on,c=c.stateNode,i.nodeType===8?sm(i.parentNode,c):i.nodeType===1&&sm(i,c),eu(i)):sm(on,c.stateNode));break;case 4:h=on,E=Tr,on=c.stateNode.containerInfo,Tr=!0,Di(i,o,c),on=h,Tr=E;break;case 0:case 11:case 14:case 15:if(!yn&&(h=c.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){E=h=h.next;do{var T=E,v=T.destroy;T=T.tag,v!==void 0&&((T&2)!==0||(T&4)!==0)&&$m(c,o,v),E=E.next}while(E!==h)}Di(i,o,c);break;case 1:if(!yn&&($o(c,o),h=c.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=c.memoizedProps,h.state=c.memoizedState,h.componentWillUnmount()}catch(F){Ft(c,o,F)}Di(i,o,c);break;case 21:Di(i,o,c);break;case 22:c.mode&1?(yn=(h=yn)||c.memoizedState!==null,Di(i,o,c),yn=h):Di(i,o,c);break;default:Di(i,o,c)}}function s2(i){var o=i.updateQueue;if(o!==null){i.updateQueue=null;var c=i.stateNode;c===null&&(c=i.stateNode=new R7),o.forEach(function(h){var E=$7.bind(null,i,h);c.has(h)||(c.add(h),h.then(E,E))})}}function br(i,o){var c=o.deletions;if(c!==null)for(var h=0;h<c.length;h++){var E=c[h];try{var T=i,v=o,F=v;e:for(;F!==null;){switch(F.tag){case 5:on=F.stateNode,Tr=!1;break e;case 3:on=F.stateNode.containerInfo,Tr=!0;break e;case 4:on=F.stateNode.containerInfo,Tr=!0;break e}F=F.return}if(on===null)throw Error(n(160));i2(T,v,E),on=null,Tr=!1;var $=E.alternate;$!==null&&($.return=null),E.return=null}catch(ee){Ft(E,o,ee)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)o2(o,i),o=o.sibling}function o2(i,o){var c=i.alternate,h=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(br(o,i),jr(i),h&4){try{_u(3,i,i.return),Jc(3,i)}catch(Me){Ft(i,i.return,Me)}try{_u(5,i,i.return)}catch(Me){Ft(i,i.return,Me)}}break;case 1:br(o,i),jr(i),h&512&&c!==null&&$o(c,c.return);break;case 5:if(br(o,i),jr(i),h&512&&c!==null&&$o(c,c.return),i.flags&32){var E=i.stateNode;try{at(E,"")}catch(Me){Ft(i,i.return,Me)}}if(h&4&&(E=i.stateNode,E!=null)){var T=i.memoizedProps,v=c!==null?c.memoizedProps:T,F=i.type,$=i.updateQueue;if(i.updateQueue=null,$!==null)try{F==="input"&&T.type==="radio"&&T.name!=null&&ze(E,T),tt(F,v);var ee=tt(F,T);for(v=0;v<$.length;v+=2){var ge=$[v],Te=$[v+1];ge==="style"?Ne(E,Te):ge==="dangerouslySetInnerHTML"?Ze(E,Te):ge==="children"?at(E,Te):O(E,ge,Te,ee)}switch(F){case"input":Ce(E,T);break;case"textarea":Es(E,T);break;case"select":var pe=E._wrapperState.wasMultiple;E._wrapperState.wasMultiple=!!T.multiple;var Pe=T.value;Pe!=null?Mt(E,!!T.multiple,Pe,!1):pe!==!!T.multiple&&(T.defaultValue!=null?Mt(E,!!T.multiple,T.defaultValue,!0):Mt(E,!!T.multiple,T.multiple?[]:"",!1))}E[du]=T}catch(Me){Ft(i,i.return,Me)}}break;case 6:if(br(o,i),jr(i),h&4){if(i.stateNode===null)throw Error(n(162));E=i.stateNode,T=i.memoizedProps;try{E.nodeValue=T}catch(Me){Ft(i,i.return,Me)}}break;case 3:if(br(o,i),jr(i),h&4&&c!==null&&c.memoizedState.isDehydrated)try{eu(o.containerInfo)}catch(Me){Ft(i,i.return,Me)}break;case 4:br(o,i),jr(i);break;case 13:br(o,i),jr(i),E=i.child,E.flags&8192&&(T=E.memoizedState!==null,E.stateNode.isHidden=T,!T||E.alternate!==null&&E.alternate.memoizedState!==null||(Xm=Ht())),h&4&&s2(i);break;case 22:if(ge=c!==null&&c.memoizedState!==null,i.mode&1?(yn=(ee=yn)||ge,br(o,i),yn=ee):br(o,i),jr(i),h&8192){if(ee=i.memoizedState!==null,(i.stateNode.isHidden=ee)&&!ge&&(i.mode&1)!==0)for(Re=i,ge=i.child;ge!==null;){for(Te=Re=ge;Re!==null;){switch(pe=Re,Pe=pe.child,pe.tag){case 0:case 11:case 14:case 15:_u(4,pe,pe.return);break;case 1:$o(pe,pe.return);var De=pe.stateNode;if(typeof De.componentWillUnmount=="function"){h=pe,c=pe.return;try{o=h,De.props=o.memoizedProps,De.state=o.memoizedState,De.componentWillUnmount()}catch(Me){Ft(h,c,Me)}}break;case 5:$o(pe,pe.return);break;case 22:if(pe.memoizedState!==null){l2(Te);continue}}Pe!==null?(Pe.return=pe,Re=Pe):l2(Te)}ge=ge.sibling}e:for(ge=null,Te=i;;){if(Te.tag===5){if(ge===null){ge=Te;try{E=Te.stateNode,ee?(T=E.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none"):(F=Te.stateNode,$=Te.memoizedProps.style,v=$!=null&&$.hasOwnProperty("display")?$.display:null,F.style.display=ke("display",v))}catch(Me){Ft(i,i.return,Me)}}}else if(Te.tag===6){if(ge===null)try{Te.stateNode.nodeValue=ee?"":Te.memoizedProps}catch(Me){Ft(i,i.return,Me)}}else if((Te.tag!==22&&Te.tag!==23||Te.memoizedState===null||Te===i)&&Te.child!==null){Te.child.return=Te,Te=Te.child;continue}if(Te===i)break e;for(;Te.sibling===null;){if(Te.return===null||Te.return===i)break e;ge===Te&&(ge=null),Te=Te.return}ge===Te&&(ge=null),Te.sibling.return=Te.return,Te=Te.sibling}}break;case 19:br(o,i),jr(i),h&4&&s2(i);break;case 21:break;default:br(o,i),jr(i)}}function jr(i){var o=i.flags;if(o&2){try{e:{for(var c=i.return;c!==null;){if(n2(c)){var h=c;break e}c=c.return}throw Error(n(160))}switch(h.tag){case 5:var E=h.stateNode;h.flags&32&&(at(E,""),h.flags&=-33);var T=r2(i);Ym(i,T,E);break;case 3:case 4:var v=h.stateNode.containerInfo,F=r2(i);qm(i,F,v);break;default:throw Error(n(161))}}catch($){Ft(i,i.return,$)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function D7(i,o,c){Re=i,a2(i)}function a2(i,o,c){for(var h=(i.mode&1)!==0;Re!==null;){var E=Re,T=E.child;if(E.tag===22&&h){var v=E.memoizedState!==null||Qc;if(!v){var F=E.alternate,$=F!==null&&F.memoizedState!==null||yn;F=Qc;var ee=yn;if(Qc=v,(yn=$)&&!ee)for(Re=E;Re!==null;)v=Re,$=v.child,v.tag===22&&v.memoizedState!==null?c2(E):$!==null?($.return=v,Re=$):c2(E);for(;T!==null;)Re=T,a2(T),T=T.sibling;Re=E,Qc=F,yn=ee}u2(i)}else(E.subtreeFlags&8772)!==0&&T!==null?(T.return=E,Re=T):u2(i)}}function u2(i){for(;Re!==null;){var o=Re;if((o.flags&8772)!==0){var c=o.alternate;try{if((o.flags&8772)!==0)switch(o.tag){case 0:case 11:case 15:yn||Jc(5,o);break;case 1:var h=o.stateNode;if(o.flags&4&&!yn)if(c===null)h.componentDidMount();else{var E=o.elementType===o.type?c.memoizedProps:yr(o.type,c.memoizedProps);h.componentDidUpdate(E,c.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var T=o.updateQueue;T!==null&&lx(o,T,h);break;case 3:var v=o.updateQueue;if(v!==null){if(c=null,o.child!==null)switch(o.child.tag){case 5:c=o.child.stateNode;break;case 1:c=o.child.stateNode}lx(o,v,c)}break;case 5:var F=o.stateNode;if(c===null&&o.flags&4){c=F;var $=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":$.autoFocus&&c.focus();break;case"img":$.src&&(c.src=$.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var ee=o.alternate;if(ee!==null){var ge=ee.memoizedState;if(ge!==null){var Te=ge.dehydrated;Te!==null&&eu(Te)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}yn||o.flags&512&&Vm(o)}catch(pe){Ft(o,o.return,pe)}}if(o===i){Re=null;break}if(c=o.sibling,c!==null){c.return=o.return,Re=c;break}Re=o.return}}function l2(i){for(;Re!==null;){var o=Re;if(o===i){Re=null;break}var c=o.sibling;if(c!==null){c.return=o.return,Re=c;break}Re=o.return}}function c2(i){for(;Re!==null;){var o=Re;try{switch(o.tag){case 0:case 11:case 15:var c=o.return;try{Jc(4,o)}catch($){Ft(o,c,$)}break;case 1:var h=o.stateNode;if(typeof h.componentDidMount=="function"){var E=o.return;try{h.componentDidMount()}catch($){Ft(o,E,$)}}var T=o.return;try{Vm(o)}catch($){Ft(o,T,$)}break;case 5:var v=o.return;try{Vm(o)}catch($){Ft(o,v,$)}}}catch($){Ft(o,o.return,$)}if(o===i){Re=null;break}var F=o.sibling;if(F!==null){F.return=o.return,Re=F;break}Re=o.return}}var M7=Math.ceil,Zc=z.ReactCurrentDispatcher,Wm=z.ReactCurrentOwner,rr=z.ReactCurrentBatchConfig,lt=0,tn=null,Vt=null,an=0,Gn=0,Vo=Oi(0),Xt=0,xu=null,ks=0,ed=0,Gm=0,Su=null,Bn=null,Xm=0,qo=1/0,ai=null,td=!1,Km=null,Mi=null,nd=!1,Fi=null,rd=0,vu=0,Qm=null,id=-1,sd=0;function xn(){return(lt&6)!==0?Ht():id!==-1?id:id=Ht()}function Bi(i){return(i.mode&1)===0?1:(lt&2)!==0&&an!==0?an&-an:T7.transition!==null?(sd===0&&(sd=r_()),sd):(i=gt,i!==0||(i=window.event,i=i===void 0?16:f_(i.type)),i)}function wr(i,o,c,h){if(50<vu)throw vu=0,Qm=null,Error(n(185));Xa(i,c,h),((lt&2)===0||i!==tn)&&(i===tn&&((lt&2)===0&&(ed|=c),Xt===4&&Ui(i,an)),Un(i,h),c===1&&lt===0&&(o.mode&1)===0&&(qo=Ht()+500,Rc&&Pi()))}function Un(i,o){var c=i.callbackNode;TB(i,o);var h=pc(i,i===tn?an:0);if(h===0)c!==null&&e_(c),i.callbackNode=null,i.callbackPriority=0;else if(o=h&-h,i.callbackPriority!==o){if(c!=null&&e_(c),o===1)i.tag===0?y7(f2.bind(null,i)):Q_(f2.bind(null,i)),p7(function(){(lt&6)===0&&Pi()}),c=null;else{switch(i_(h)){case 1:c=Op;break;case 4:c=t_;break;case 16:c=cc;break;case 536870912:c=n_;break;default:c=cc}c=b2(c,d2.bind(null,i))}i.callbackPriority=o,i.callbackNode=c}}function d2(i,o){if(id=-1,sd=0,(lt&6)!==0)throw Error(n(327));var c=i.callbackNode;if(Yo()&&i.callbackNode!==c)return null;var h=pc(i,i===tn?an:0);if(h===0)return null;if((h&30)!==0||(h&i.expiredLanes)!==0||o)o=od(i,h);else{o=h;var E=lt;lt|=2;var T=p2();(tn!==i||an!==o)&&(ai=null,qo=Ht()+500,Ns(i,o));do try{U7();break}catch(F){h2(i,F)}while(!0);mm(),Zc.current=T,lt=E,Vt!==null?o=0:(tn=null,an=0,o=Xt)}if(o!==0){if(o===2&&(E=Ip(i),E!==0&&(h=E,o=Jm(i,E))),o===1)throw c=xu,Ns(i,0),Ui(i,h),Un(i,Ht()),c;if(o===6)Ui(i,h);else{if(E=i.current.alternate,(h&30)===0&&!F7(E)&&(o=od(i,h),o===2&&(T=Ip(i),T!==0&&(h=T,o=Jm(i,T))),o===1))throw c=xu,Ns(i,0),Ui(i,h),Un(i,Ht()),c;switch(i.finishedWork=E,i.finishedLanes=h,o){case 0:case 1:throw Error(n(345));case 2:Os(i,Bn,ai);break;case 3:if(Ui(i,h),(h&130023424)===h&&(o=Xm+500-Ht(),10<o)){if(pc(i,0)!==0)break;if(E=i.suspendedLanes,(E&h)!==h){xn(),i.pingedLanes|=i.suspendedLanes&E;break}i.timeoutHandle=im(Os.bind(null,i,Bn,ai),o);break}Os(i,Bn,ai);break;case 4:if(Ui(i,h),(h&4194240)===h)break;for(o=i.eventTimes,E=-1;0<h;){var v=31-mr(h);T=1<<v,v=o[v],v>E&&(E=v),h&=~T}if(h=E,h=Ht()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*M7(h/1960))-h,10<h){i.timeoutHandle=im(Os.bind(null,i,Bn,ai),h);break}Os(i,Bn,ai);break;case 5:Os(i,Bn,ai);break;default:throw Error(n(329))}}}return Un(i,Ht()),i.callbackNode===c?d2.bind(null,i):null}function Jm(i,o){var c=Su;return i.current.memoizedState.isDehydrated&&(Ns(i,o).flags|=256),i=od(i,o),i!==2&&(o=Bn,Bn=c,o!==null&&Zm(o)),i}function Zm(i){Bn===null?Bn=i:Bn.push.apply(Bn,i)}function F7(i){for(var o=i;;){if(o.flags&16384){var c=o.updateQueue;if(c!==null&&(c=c.stores,c!==null))for(var h=0;h<c.length;h++){var E=c[h],T=E.getSnapshot;E=E.value;try{if(!gr(T(),E))return!1}catch(v){return!1}}}if(c=o.child,o.subtreeFlags&16384&&c!==null)c.return=o,o=c;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Ui(i,o){for(o&=~Gm,o&=~ed,i.suspendedLanes|=o,i.pingedLanes&=~o,i=i.expirationTimes;0<o;){var c=31-mr(o),h=1<<c;i[c]=-1,o&=~h}}function f2(i){if((lt&6)!==0)throw Error(n(327));Yo();var o=pc(i,0);if((o&1)===0)return Un(i,Ht()),null;var c=od(i,o);if(i.tag!==0&&c===2){var h=Ip(i);h!==0&&(o=h,c=Jm(i,h))}if(c===1)throw c=xu,Ns(i,0),Ui(i,o),Un(i,Ht()),c;if(c===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=o,Os(i,Bn,ai),Un(i,Ht()),null}function e0(i,o){var c=lt;lt|=1;try{return i(o)}finally{lt=c,lt===0&&(qo=Ht()+500,Rc&&Pi())}}function Cs(i){Fi!==null&&Fi.tag===0&&(lt&6)===0&&Yo();var o=lt;lt|=1;var c=rr.transition,h=gt;try{if(rr.transition=null,gt=1,i)return i()}finally{gt=h,rr.transition=c,lt=o,(lt&6)===0&&Pi()}}function t0(){Gn=Vo.current,At(Vo)}function Ns(i,o){i.finishedWork=null,i.finishedLanes=0;var c=i.timeoutHandle;if(c!==-1&&(i.timeoutHandle=-1,h7(c)),Vt!==null)for(c=Vt.return;c!==null;){var h=c;switch(cm(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&Ic();break;case 3:jo(),At(Dn),At(mn),xm();break;case 5:wm(h);break;case 4:jo();break;case 13:At(It);break;case 19:At(It);break;case 10:gm(h.type._context);break;case 22:case 23:t0()}c=c.return}if(tn=i,Vt=i=Hi(i.current,null),an=Gn=o,Xt=0,xu=null,Gm=ed=ks=0,Bn=Su=null,Ss!==null){for(o=0;o<Ss.length;o++)if(c=Ss[o],h=c.interleaved,h!==null){c.interleaved=null;var E=h.next,T=c.pending;if(T!==null){var v=T.next;T.next=E,h.next=v}c.pending=h}Ss=null}return i}function h2(i,o){do{var c=Vt;try{if(mm(),$c.current=Wc,Vc){for(var h=Pt.memoizedState;h!==null;){var E=h.queue;E!==null&&(E.pending=null),h=h.next}Vc=!1}if(As=0,en=Gt=Pt=null,Eu=!1,yu=0,Wm.current=null,c===null||c.return===null){Xt=1,xu=o,Vt=null;break}e:{var T=i,v=c.return,F=c,$=o;if(o=an,F.flags|=32768,$!==null&&typeof $=="object"&&typeof $.then=="function"){var ee=$,ge=F,Te=ge.tag;if((ge.mode&1)===0&&(Te===0||Te===11||Te===15)){var pe=ge.alternate;pe?(ge.updateQueue=pe.updateQueue,ge.memoizedState=pe.memoizedState,ge.lanes=pe.lanes):(ge.updateQueue=null,ge.memoizedState=null)}var Pe=Bx(v);if(Pe!==null){Pe.flags&=-257,Ux(Pe,v,F,T,o),Pe.mode&1&&Fx(T,ee,o),o=Pe,$=ee;var De=o.updateQueue;if(De===null){var Me=new Set;Me.add($),o.updateQueue=Me}else De.add($);break e}else{if((o&1)===0){Fx(T,ee,o),n0();break e}$=Error(n(426))}}else if(Nt&&F.mode&1){var jt=Bx(v);if(jt!==null){(jt.flags&65536)===0&&(jt.flags|=256),Ux(jt,v,F,T,o),hm(zo($,F));break e}}T=$=zo($,F),Xt!==4&&(Xt=2),Su===null?Su=[T]:Su.push(T),T=v;do{switch(T.tag){case 3:T.flags|=65536,o&=-o,T.lanes|=o;var X=Dx(T,$,o);ux(T,X);break e;case 1:F=$;var q=T.type,Q=T.stateNode;if((T.flags&128)===0&&(typeof q.getDerivedStateFromError=="function"||Q!==null&&typeof Q.componentDidCatch=="function"&&(Mi===null||!Mi.has(Q)))){T.flags|=65536,o&=-o,T.lanes|=o;var we=Mx(T,F,o);ux(T,we);break e}}T=T.return}while(T!==null)}g2(c)}catch(Ue){o=Ue,Vt===c&&c!==null&&(Vt=c=c.return);continue}break}while(!0)}function p2(){var i=Zc.current;return Zc.current=Wc,i===null?Wc:i}function n0(){(Xt===0||Xt===3||Xt===2)&&(Xt=4),tn===null||(ks&268435455)===0&&(ed&268435455)===0||Ui(tn,an)}function od(i,o){var c=lt;lt|=2;var h=p2();(tn!==i||an!==o)&&(ai=null,Ns(i,o));do try{B7();break}catch(E){h2(i,E)}while(!0);if(mm(),lt=c,Zc.current=h,Vt!==null)throw Error(n(261));return tn=null,an=0,Xt}function B7(){for(;Vt!==null;)m2(Vt)}function U7(){for(;Vt!==null&&!cB();)m2(Vt)}function m2(i){var o=T2(i.alternate,i,Gn);i.memoizedProps=i.pendingProps,o===null?g2(i):Vt=o,Wm.current=null}function g2(i){var o=i;do{var c=o.alternate;if(i=o.return,(o.flags&32768)===0){if(c=I7(c,o,Gn),c!==null){Vt=c;return}}else{if(c=P7(c,o),c!==null){c.flags&=32767,Vt=c;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{Xt=6,Vt=null;return}}if(o=o.sibling,o!==null){Vt=o;return}Vt=o=i}while(o!==null);Xt===0&&(Xt=5)}function Os(i,o,c){var h=gt,E=rr.transition;try{rr.transition=null,gt=1,H7(i,o,c,h)}finally{rr.transition=E,gt=h}return null}function H7(i,o,c,h){do Yo();while(Fi!==null);if((lt&6)!==0)throw Error(n(327));c=i.finishedWork;var E=i.finishedLanes;if(c===null)return null;if(i.finishedWork=null,i.finishedLanes=0,c===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var T=c.lanes|c.childLanes;if(bB(i,T),i===tn&&(Vt=tn=null,an=0),(c.subtreeFlags&2064)===0&&(c.flags&2064)===0||nd||(nd=!0,b2(cc,function(){return Yo(),null})),T=(c.flags&15990)!==0,(c.subtreeFlags&15990)!==0||T){T=rr.transition,rr.transition=null;var v=gt;gt=1;var F=lt;lt|=4,Wm.current=null,L7(i,c),o2(c,i),o7(nm),Ec=!!tm,nm=tm=null,i.current=c,D7(c),dB(),lt=F,gt=v,rr.transition=T}else i.current=c;if(nd&&(nd=!1,Fi=i,rd=E),T=i.pendingLanes,T===0&&(Mi=null),pB(c.stateNode),Un(i,Ht()),o!==null)for(h=i.onRecoverableError,c=0;c<o.length;c++)E=o[c],h(E.value,{componentStack:E.stack,digest:E.digest});if(td)throw td=!1,i=Km,Km=null,i;return(rd&1)!==0&&i.tag!==0&&Yo(),T=i.pendingLanes,(T&1)!==0?i===Qm?vu++:(vu=0,Qm=i):vu=0,Pi(),null}function Yo(){if(Fi!==null){var i=i_(rd),o=rr.transition,c=gt;try{if(rr.transition=null,gt=16>i?16:i,Fi===null)var h=!1;else{if(i=Fi,Fi=null,rd=0,(lt&6)!==0)throw Error(n(331));var E=lt;for(lt|=4,Re=i.current;Re!==null;){var T=Re,v=T.child;if((Re.flags&16)!==0){var F=T.deletions;if(F!==null){for(var $=0;$<F.length;$++){var ee=F[$];for(Re=ee;Re!==null;){var ge=Re;switch(ge.tag){case 0:case 11:case 15:_u(8,ge,T)}var Te=ge.child;if(Te!==null)Te.return=ge,Re=Te;else for(;Re!==null;){ge=Re;var pe=ge.sibling,Pe=ge.return;if(t2(ge),ge===ee){Re=null;break}if(pe!==null){pe.return=Pe,Re=pe;break}Re=Pe}}}var De=T.alternate;if(De!==null){var Me=De.child;if(Me!==null){De.child=null;do{var jt=Me.sibling;Me.sibling=null,Me=jt}while(Me!==null)}}Re=T}}if((T.subtreeFlags&2064)!==0&&v!==null)v.return=T,Re=v;else e:for(;Re!==null;){if(T=Re,(T.flags&2048)!==0)switch(T.tag){case 0:case 11:case 15:_u(9,T,T.return)}var X=T.sibling;if(X!==null){X.return=T.return,Re=X;break e}Re=T.return}}var q=i.current;for(Re=q;Re!==null;){v=Re;var Q=v.child;if((v.subtreeFlags&2064)!==0&&Q!==null)Q.return=v,Re=Q;else e:for(v=q;Re!==null;){if(F=Re,(F.flags&2048)!==0)try{switch(F.tag){case 0:case 11:case 15:Jc(9,F)}}catch(Ue){Ft(F,F.return,Ue)}if(F===v){Re=null;break e}var we=F.sibling;if(we!==null){we.return=F.return,Re=we;break e}Re=F.return}}if(lt=E,Pi(),Fr&&typeof Fr.onPostCommitFiberRoot=="function")try{Fr.onPostCommitFiberRoot(dc,i)}catch(Ue){}h=!0}return h}finally{gt=c,rr.transition=o}}return!1}function E2(i,o,c){o=zo(c,o),o=Dx(i,o,1),i=Li(i,o,1),o=xn(),i!==null&&(Xa(i,1,o),Un(i,o))}function Ft(i,o,c){if(i.tag===3)E2(i,i,c);else for(;o!==null;){if(o.tag===3){E2(o,i,c);break}else if(o.tag===1){var h=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Mi===null||!Mi.has(h))){i=zo(c,i),i=Mx(o,i,1),o=Li(o,i,1),i=xn(),o!==null&&(Xa(o,1,i),Un(o,i));break}}o=o.return}}function j7(i,o,c){var h=i.pingCache;h!==null&&h.delete(o),o=xn(),i.pingedLanes|=i.suspendedLanes&c,tn===i&&(an&c)===c&&(Xt===4||Xt===3&&(an&130023424)===an&&500>Ht()-Xm?Ns(i,0):Gm|=c),Un(i,o)}function y2(i,o){o===0&&((i.mode&1)===0?o=1:(o=hc,hc<<=1,(hc&130023424)===0&&(hc=4194304)));var c=xn();i=ii(i,o),i!==null&&(Xa(i,o,c),Un(i,c))}function z7(i){var o=i.memoizedState,c=0;o!==null&&(c=o.retryLane),y2(i,c)}function $7(i,o){var c=0;switch(i.tag){case 13:var h=i.stateNode,E=i.memoizedState;E!==null&&(c=E.retryLane);break;case 19:h=i.stateNode;break;default:throw Error(n(314))}h!==null&&h.delete(o),y2(i,c)}var T2;T2=function(i,o,c){if(i!==null)if(i.memoizedProps!==o.pendingProps||Dn.current)Fn=!0;else{if((i.lanes&c)===0&&(o.flags&128)===0)return Fn=!1,O7(i,o,c);Fn=(i.flags&131072)!==0}else Fn=!1,Nt&&(o.flags&1048576)!==0&&J_(o,Dc,o.index);switch(o.lanes=0,o.tag){case 2:var h=o.type;Kc(i,o),i=o.pendingProps;var E=Lo(o,mn.current);Ho(o,c),E=Am(null,o,h,i,E,c);var T=km();return o.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,Mn(h)?(T=!0,Pc(o)):T=!1,o.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,Tm(o),E.updater=Gc,o.stateNode=E,E._reactInternals=o,Rm(o,h,i,c),o=Fm(null,o,h,!0,T,c)):(o.tag=0,Nt&&T&&lm(o),_n(null,o,E,c),o=o.child),o;case 16:h=o.elementType;e:{switch(Kc(i,o),i=o.pendingProps,E=h._init,h=E(h._payload),o.type=h,E=o.tag=q7(h),i=yr(h,i),E){case 0:o=Mm(null,o,h,i,c);break e;case 1:o=qx(null,o,h,i,c);break e;case 11:o=Hx(null,o,h,i,c);break e;case 14:o=jx(null,o,h,yr(h.type,i),c);break e}throw Error(n(306,h,""))}return o;case 0:return h=o.type,E=o.pendingProps,E=o.elementType===h?E:yr(h,E),Mm(i,o,h,E,c);case 1:return h=o.type,E=o.pendingProps,E=o.elementType===h?E:yr(h,E),qx(i,o,h,E,c);case 3:e:{if(Yx(o),i===null)throw Error(n(387));h=o.pendingProps,T=o.memoizedState,E=T.element,ax(i,o),jc(o,h,null,c);var v=o.memoizedState;if(h=v.element,T.isDehydrated)if(T={element:h,isDehydrated:!1,cache:v.cache,pendingSuspenseBoundaries:v.pendingSuspenseBoundaries,transitions:v.transitions},o.updateQueue.baseState=T,o.memoizedState=T,o.flags&256){E=zo(Error(n(423)),o),o=Wx(i,o,h,c,E);break e}else if(h!==E){E=zo(Error(n(424)),o),o=Wx(i,o,h,c,E);break e}else for(Wn=Ni(o.stateNode.containerInfo.firstChild),Yn=o,Nt=!0,Er=null,c=sx(o,null,h,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Fo(),h===E){o=oi(i,o,c);break e}_n(i,o,h,c)}o=o.child}return o;case 5:return cx(o),i===null&&fm(o),h=o.type,E=o.pendingProps,T=i!==null?i.memoizedProps:null,v=E.children,rm(h,E)?v=null:T!==null&&rm(h,T)&&(o.flags|=32),Vx(i,o),_n(i,o,v,c),o.child;case 6:return i===null&&fm(o),null;case 13:return Gx(i,o,c);case 4:return bm(o,o.stateNode.containerInfo),h=o.pendingProps,i===null?o.child=Bo(o,null,h,c):_n(i,o,h,c),o.child;case 11:return h=o.type,E=o.pendingProps,E=o.elementType===h?E:yr(h,E),Hx(i,o,h,E,c);case 7:return _n(i,o,o.pendingProps,c),o.child;case 8:return _n(i,o,o.pendingProps.children,c),o.child;case 12:return _n(i,o,o.pendingProps.children,c),o.child;case 10:e:{if(h=o.type._context,E=o.pendingProps,T=o.memoizedProps,v=E.value,wt(Bc,h._currentValue),h._currentValue=v,T!==null)if(gr(T.value,v)){if(T.children===E.children&&!Dn.current){o=oi(i,o,c);break e}}else for(T=o.child,T!==null&&(T.return=o);T!==null;){var F=T.dependencies;if(F!==null){v=T.child;for(var $=F.firstContext;$!==null;){if($.context===h){if(T.tag===1){$=si(-1,c&-c),$.tag=2;var ee=T.updateQueue;if(ee!==null){ee=ee.shared;var ge=ee.pending;ge===null?$.next=$:($.next=ge.next,ge.next=$),ee.pending=$}}T.lanes|=c,$=T.alternate,$!==null&&($.lanes|=c),Em(T.return,c,o),F.lanes|=c;break}$=$.next}}else if(T.tag===10)v=T.type===o.type?null:T.child;else if(T.tag===18){if(v=T.return,v===null)throw Error(n(341));v.lanes|=c,F=v.alternate,F!==null&&(F.lanes|=c),Em(v,c,o),v=T.sibling}else v=T.child;if(v!==null)v.return=T;else for(v=T;v!==null;){if(v===o){v=null;break}if(T=v.sibling,T!==null){T.return=v.return,v=T;break}v=v.return}T=v}_n(i,o,E.children,c),o=o.child}return o;case 9:return E=o.type,h=o.pendingProps.children,Ho(o,c),E=tr(E),h=h(E),o.flags|=1,_n(i,o,h,c),o.child;case 14:return h=o.type,E=yr(h,o.pendingProps),E=yr(h.type,E),jx(i,o,h,E,c);case 15:return zx(i,o,o.type,o.pendingProps,c);case 17:return h=o.type,E=o.pendingProps,E=o.elementType===h?E:yr(h,E),Kc(i,o),o.tag=1,Mn(h)?(i=!0,Pc(o)):i=!1,Ho(o,c),Rx(o,h,E),Rm(o,h,E,c),Fm(null,o,h,!0,i,c);case 19:return Kx(i,o,c);case 22:return $x(i,o,c)}throw Error(n(156,o.tag))};function b2(i,o){return Zw(i,o)}function V7(i,o,c,h){this.tag=i,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ir(i,o,c,h){return new V7(i,o,c,h)}function r0(i){return i=i.prototype,!(!i||!i.isReactComponent)}function q7(i){if(typeof i=="function")return r0(i)?1:0;if(i!=null){if(i=i.$$typeof,i===te)return 11;if(i===ue)return 14}return 2}function Hi(i,o){var c=i.alternate;return c===null?(c=ir(i.tag,o,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=o,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=i.flags&14680064,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,o=i.dependencies,c.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c}function ad(i,o,c,h,E,T){var v=2;if(h=i,typeof i=="function")r0(i)&&(v=1);else if(typeof i=="string")v=5;else e:switch(i){case V:return Is(c.children,E,T,o);case J:v=8,E|=8;break;case se:return i=ir(12,c,o,E|2),i.elementType=se,i.lanes=T,i;case le:return i=ir(13,c,o,E),i.elementType=le,i.lanes=T,i;case fe:return i=ir(19,c,o,E),i.elementType=fe,i.lanes=T,i;case de:return ud(c,E,T,o);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case H:v=10;break e;case ie:v=9;break e;case te:v=11;break e;case ue:v=14;break e;case Se:v=16,h=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return o=ir(v,c,o,E),o.elementType=i,o.type=h,o.lanes=T,o}function Is(i,o,c,h){return i=ir(7,i,h,o),i.lanes=c,i}function ud(i,o,c,h){return i=ir(22,i,h,o),i.elementType=de,i.lanes=c,i.stateNode={isHidden:!1},i}function i0(i,o,c){return i=ir(6,i,null,o),i.lanes=c,i}function s0(i,o,c){return o=ir(4,i.children!==null?i.children:[],i.key,o),o.lanes=c,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}function Y7(i,o,c,h,E){this.tag=o,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Pp(0),this.expirationTimes=Pp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pp(0),this.identifierPrefix=h,this.onRecoverableError=E,this.mutableSourceEagerHydrationData=null}function o0(i,o,c,h,E,T,v,F,$){return i=new Y7(i,o,c,F,$),o===1?(o=1,T===!0&&(o|=8)):o=0,T=ir(3,null,null,o),i.current=T,T.stateNode=i,T.memoizedState={element:h,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null},Tm(T),i}function W7(i,o,c){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:D,key:h==null?null:""+h,children:i,containerInfo:o,implementation:c}}function w2(i){if(!i)return Ii;i=i._reactInternals;e:{if(Ts(i)!==i||i.tag!==1)throw Error(n(170));var o=i;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(Mn(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(n(171))}if(i.tag===1){var c=i.type;if(Mn(c))return X_(i,c,o)}return o}function _2(i,o,c,h,E,T,v,F,$){return i=o0(c,h,!0,i,E,T,v,F,$),i.context=w2(null),c=i.current,h=xn(),E=Bi(c),T=si(h,E),T.callback=o!=null?o:null,Li(c,T,E),i.current.lanes=E,Xa(i,E,h),Un(i,h),i}function ld(i,o,c,h){var E=o.current,T=xn(),v=Bi(E);return c=w2(c),o.context===null?o.context=c:o.pendingContext=c,o=si(T,v),o.payload={element:i},h=h===void 0?null:h,h!==null&&(o.callback=h),i=Li(E,o,v),i!==null&&(wr(i,E,v,T),Hc(i,E,v)),v}function cd(i){return i=i.current,i.child?(i.child.tag===5,i.child.stateNode):null}function x2(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<o?c:o}}function a0(i,o){x2(i,o),(i=i.alternate)&&x2(i,o)}function G7(){return null}var S2=typeof reportError=="function"?reportError:function(i){console.error(i)};function u0(i){this._internalRoot=i}dd.prototype.render=u0.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(n(409));ld(i,o,null,null)},dd.prototype.unmount=u0.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;Cs(function(){ld(null,i,null,null)}),o[ei]=null}};function dd(i){this._internalRoot=i}dd.prototype.unstable_scheduleHydration=function(i){if(i){var o=a_();i={blockedOn:null,target:i,priority:o};for(var c=0;c<Ai.length&&o!==0&&o<Ai[c].priority;c++);Ai.splice(c,0,i),c===0&&c_(i)}};function l0(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function fd(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function v2(){}function X7(i,o,c,h,E){if(E){if(typeof h=="function"){var T=h;h=function(){var ee=cd(v);T.call(ee)}}var v=_2(o,h,i,0,null,!1,!1,"",v2);return i._reactRootContainer=v,i[ei]=v.current,lu(i.nodeType===8?i.parentNode:i),Cs(),v}for(;E=i.lastChild;)i.removeChild(E);if(typeof h=="function"){var F=h;h=function(){var ee=cd($);F.call(ee)}}var $=o0(i,0,!1,null,null,!1,!1,"",v2);return i._reactRootContainer=$,i[ei]=$.current,lu(i.nodeType===8?i.parentNode:i),Cs(function(){ld(o,$,c,h)}),$}function hd(i,o,c,h,E){var T=c._reactRootContainer;if(T){var v=T;if(typeof E=="function"){var F=E;E=function(){var $=cd(v);F.call($)}}ld(o,v,i,E)}else v=X7(c,o,i,E,h);return cd(v)}s_=function(i){switch(i.tag){case 3:var o=i.stateNode;if(o.current.memoizedState.isDehydrated){var c=Ga(o.pendingLanes);c!==0&&(Rp(o,c|1),Un(o,Ht()),(lt&6)===0&&(qo=Ht()+500,Pi()))}break;case 13:Cs(function(){var h=ii(i,1);if(h!==null){var E=xn();wr(h,i,1,E)}}),a0(i,1)}},Lp=function(i){if(i.tag===13){var o=ii(i,134217728);if(o!==null){var c=xn();wr(o,i,134217728,c)}a0(i,134217728)}},o_=function(i){if(i.tag===13){var o=Bi(i),c=ii(i,o);if(c!==null){var h=xn();wr(c,i,o,h)}a0(i,o)}},a_=function(){return gt},u_=function(i,o){var c=gt;try{return gt=i,o()}finally{gt=c}},Mr=function(i,o,c){switch(o){case"input":if(Ce(i,c),o=c.name,c.type==="radio"&&o!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),o=0;o<c.length;o++){var h=c[o];if(h!==i&&h.form===i.form){var E=Oc(h);if(!E)throw Error(n(90));Lt(h),Ce(h,E)}}}break;case"textarea":Es(i,c);break;case"select":o=c.value,o!=null&&Mt(i,!!c.multiple,o,!1)}},Yw=e0,Ww=Cs;var K7={usingClientEntryPoint:!1,Events:[fu,Po,Oc,Vw,qw,e0]},Au={findFiberByHostInstance:bs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Q7={bundleType:Au.bundleType,version:Au.version,rendererPackageName:Au.rendererPackageName,rendererConfig:Au.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:z.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Qw(i),i===null?null:i.stateNode},findFiberByHostInstance:Au.findFiberByHostInstance||G7,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"){var pd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pd.isDisabled&&pd.supportsFiber)try{dc=pd.inject(Q7),Fr=pd}catch(i){}}return kn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=K7,kn.createPortal=function(i,o){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!l0(o))throw Error(n(200));return W7(i,o,null,c)},kn.createRoot=function(i,o){if(!l0(i))throw Error(n(299));var c=!1,h="",E=S2;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(h=o.identifierPrefix),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),o=o0(i,1,!1,null,null,c,!1,h,E),i[ei]=o.current,lu(i.nodeType===8?i.parentNode:i),new u0(o)},kn.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=Qw(o),i=i===null?null:i.stateNode,i},kn.flushSync=function(i){return Cs(i)},kn.hydrate=function(i,o,c){if(!fd(o))throw Error(n(200));return hd(null,i,o,!0,c)},kn.hydrateRoot=function(i,o,c){if(!l0(i))throw Error(n(405));var h=c!=null&&c.hydratedSources||null,E=!1,T="",v=S2;if(c!=null&&(c.unstable_strictMode===!0&&(E=!0),c.identifierPrefix!==void 0&&(T=c.identifierPrefix),c.onRecoverableError!==void 0&&(v=c.onRecoverableError)),o=_2(o,null,i,1,c!=null?c:null,E,!1,T,v),i[ei]=o.current,lu(i),h)for(i=0;i<h.length;i++)c=h[i],E=c._getVersion,E=E(c._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[c,E]:o.mutableSourceEagerHydrationData.push(c,E);return new dd(o)},kn.render=function(i,o,c){if(!fd(o))throw Error(n(200));return hd(null,i,o,!1,c)},kn.unmountComponentAtNode=function(i){if(!fd(i))throw Error(n(40));return i._reactRootContainer?(Cs(function(){hd(null,null,i,!1,function(){i._reactRootContainer=null,i[ei]=null})}),!0):!1},kn.unstable_batchedUpdates=e0,kn.unstable_renderSubtreeIntoContainer=function(i,o,c,h){if(!fd(c))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return hd(i,o,c,!1,h)},kn.version="18.3.1-next-f1338f8080-20240426",kn}var l1;function c1(){if(l1)return gf.exports;l1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),gf.exports=iC(),gf.exports}var Vs=c1();function d1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=d1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function B(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=d1(e))&&(r&&(r+=" "),r+=t);return r}var f1={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},h1=$i.createContext&&$i.createContext(f1),sC=["attr","size","title"];function oC(e,t){if(e==null)return{};var n=aC(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function aC(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function il(){return il=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},il.apply(this,arguments)}function p1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function sl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p1(Object(n),!0).forEach(function(r){uC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uC(e,t,n){return t=lC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lC(e){var t=cC(e,"string");return typeof t=="symbol"?t:t+""}function cC(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function m1(e){return e&&e.map((t,n)=>$i.createElement(t.tag,sl({key:n},t.attr),m1(t.child)))}function ht(e){return t=>$i.createElement(dC,il({attr:sl({},e.attr)},t),m1(e.child))}function dC(e){var t=n=>{var{attr:r,size:s,title:a}=e,u=oC(e,sC),l=s||n.size||"1em",d;return n.className&&(d=n.className),e.className&&(d=(d?d+" ":"")+e.className),$i.createElement("svg",il({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,u,{className:d,style:sl(sl({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),a&&$i.createElement("title",null,a),e.children)};return h1!==void 0?$i.createElement(h1.Consumer,null,n=>t(n)):t(f1)}function fC(e){return ht({attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5.25 12a.75.75 0 0 1 .75-.75h12a.75.75 0 0 1 0 1.5H6a.75.75 0 0 1-.75-.75Z",clipRule:"evenodd"},child:[]}]})(e)}function hC(e){return ht({attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M12 5.25a.75.75 0 0 1 .75.75v5.25H18a.75.75 0 0 1 0 1.5h-5.25V18a.75.75 0 0 1-1.5 0v-5.25H6a.75.75 0 0 1 0-1.5h5.25V6a.75.75 0 0 1 .75-.75Z",clipRule:"evenodd"},child:[]}]})(e)}function pC(e){return ht({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"},child:[]}]})(e)}const lr=({className:e,iconUrl:t,icon:n,type:r="button",ariaLabel:s,title:a,disabled:u=!1,onClick:l})=>!n&&!t?null:w.jsx("button",{className:B(e,`${N}-icon-button`),type:r,"aria-label":s,title:a,onClick:l,disabled:u,children:t?w.jsx("img",{className:B(`${N}-icon-image`),src:t,alt:s,loading:"lazy"}):n}),mC="data:image/svg+xml,%3csvg%20width='140'%20height='137'%20viewBox='0%200%20140%20137'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M140%2034.5C140%2040.8513%20135.075%2046%20129%2046C122.925%2046%20118%2040.8513%20118%2034.5C118%2028.1487%20122.925%2023%20129%2023C135.075%2023%20140%2028.1487%20140%2034.5Z'%20fill='%23F3F2EB'/%3e%3cpath%20d='M85%2011.3028C85%205.06042%2090.1487%200%2096.5%200C102.851%200%20108%205.06042%20108%2011.3028V21.6972C108%2027.9396%20102.851%2033%2096.5%2033C90.1487%2033%2085%2027.9396%2085%2021.6972V11.3028Z'%20fill='%23F3F2EB'/%3e%3cpath%20d='M41.3868%2030.0986C36.9601%2025.6719%2036.9601%2018.4948%2041.3868%2014.0682C45.8134%209.64151%2052.9905%209.6415%2057.4172%2014.0682L71.3628%2028.0138C75.7894%2032.4404%2075.7894%2039.6175%2071.3628%2044.0442C66.9361%2048.4708%2059.759%2048.4708%2055.3324%2044.0442L41.3868%2030.0986Z'%20fill='%23F3F2EB'/%3e%3cpath%20d='M140%20101C140%2094.9249%20135.075%2090%20129%2090C122.925%2090%20118%2094.9249%20118%20101C118%20107.075%20122.925%20112%20129%20112C135.075%20112%20140%20107.075%20140%20101Z'%20fill='%23F3F2EB'/%3e%3cpath%20d='M85%20125.697C85%20131.94%2090.1487%20137%2096.5%20137C102.851%20137%20108%20131.94%20108%20125.697V115.303C108%20109.06%20102.851%20104%2096.5%20104C90.1487%20104%2085%20109.06%2085%20115.303V125.697Z'%20fill='%23F3F2EB'/%3e%3cpath%20d='M41.3868%20106.932C36.9601%20111.359%2036.9601%20118.536%2041.3868%20122.963C45.8134%20127.389%2052.9905%20127.39%2057.4172%20122.963L71.3628%20109.017C75.7894%20104.591%2075.7894%2097.4135%2071.3628%2092.9868C66.9361%2088.5602%2059.759%2088.5602%2055.3324%2092.9868L41.3868%20106.932Z'%20fill='%23F3F2EB'/%3e%3cpath%20d='M11.259%2080C5.04084%2080%200%2074.8513%200%2068.5C0%2062.1487%205.04084%2057%2011.259%2057H49.741C55.9592%2057%2061%2062.1487%2061%2068.5C61%2074.8513%2055.9592%2080%2049.741%2080H11.259Z'%20fill='%23F3F2EB'/%3e%3c/svg%3e",gC=({onClick:e})=>{const{globalClassName:t,headerConfig:n,mode:r}=ft(),s=r==="messaging",a=s?"Open Commerce Client":"Open Copilot",u=s?w.jsx(pC,{className:B(t,`${N}-minimized-icon`)}):w.jsx("img",{src:(n==null?void 0:n.logoUrl)||mC,alt:"Copilot",className:B(t,`${N}-minimized-icon-img`)});return w.jsx(lr,{className:B(t,`${N}-minimized-button`),ariaLabel:a,title:a,icon:u,onClick:e})},EC=()=>{const{globalClassName:e,themeVariables:t}=ft(),n=()=>{Ms(!1),$r(!0)};return Vs.createPortal(w.jsx("div",{className:B(e,`${N}-minimized-container`),style:t,children:w.jsx(gC,{onClick:n})}),document.body)};function yC(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3.5 8a5.5 5.5 0 1 1 8.596 4.547 9.005 9.005 0 0 1 5.9 8.18.751.751 0 0 1-1.5.045 7.5 7.5 0 0 0-14.993 0 .75.75 0 0 1-1.499-.044 9.005 9.005 0 0 1 5.9-8.181A5.496 5.496 0 0 1 3.5 8ZM9 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm8.29 4c-.148 0-.292.01-.434.03a.75.75 0 1 1-.212-1.484 4.53 4.53 0 0 1 3.38 8.097 6.69 6.69 0 0 1 3.956 6.107.75.75 0 0 1-1.5 0 5.193 5.193 0 0 0-3.696-4.972l-.534-.16v-1.676l.41-.209A3.03 3.03 0 0 0 17.29 8Z"},child:[]}]})(e)}function Cn(){const e=R.useContext(Fg);if(!e)throw new Error("useMessaging must be used within a MessagingProvider");return e}const TC=e=>({[`${Hn}-header-background-color`]:(e==null?void 0:e.headerBackgroundColor)||"transparent",[`${Hn}-header-text-color`]:(e==null?void 0:e.headerTextColor)||"inherit",[`${Hn}-header-text-font-size`]:(e==null?void 0:e.headerTextFontSize)||"1.25rem",[`${Hn}-header-text-font-weight`]:(e==null?void 0:e.headerTextFontWeight)!=null?String(e.headerTextFontWeight):"bold",[`${Hn}-header-text-font-family`]:(e==null?void 0:e.headerTextFontFamily)||"inherit",[`${Hn}-header-text-text-align`]:(e==null?void 0:e.headerTextTextAlign)||"left"});function bC(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8A5.87 5.87 0 0 1 6 12c0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z"},child:[]}]})(e)}function g1(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19h12v2H6z"},child:[]}]})(e)}function wC(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"},child:[]}]})(e)}function Tf(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"},child:[]}]})(e)}function _C(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM6 9h12v2H6V9zm8 5H6v-2h8v2zm4-6H6V6h12v2z"},child:[]}]})(e)}function xC(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"},child:[]}]})(e)}function SC(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"},child:[]}]})(e)}function E1(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"},child:[]}]})(e)}function y1(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"},child:[]}]})(e)}function vC(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"},child:[]}]})(e)}function AC(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"},child:[]}]})(e)}function kC(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"},child:[]}]})(e)}function T1(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"m21.41 11.58-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42zM13 20.01 4 11V4h7v-.01l9 9-7 7.02z"},child:[]},{tag:"circle",attr:{cx:"6.5",cy:"6.5",r:"1.5"},child:[]}]})(e)}const bf=({className:e,children:t,type:n,disabled:r=!1,onClick:s})=>w.jsx("button",{className:B(`${N}-button`,e,{disabled:r}),type:n||"button",disabled:r,onClick:s,children:t}),CC=({searchConfig:e,globalClassName:t})=>{const n=e.buttonIconUrl;return n?w.jsx("img",{className:B(`${N}-search-button-icon-image`,t),src:n,alt:"",loading:"lazy"}):w.jsx(Tf,{size:"16px"})},NC=({className:e,searchConfig:t,globalClassName:n,componentType:r,isLoading:s})=>{if((t==null?void 0:t.buttonType)==="icon")return w.jsx(lr,{className:B(e,n,`cim-${r}-component`,`${N}-search-button-icon`),type:"submit",disabled:s,ariaLabel:(t==null?void 0:t.buttonAriaLabel)||(t==null?void 0:t.buttonLabel)||"Search Copilot",icon:t!=null&&t.buttonIconUrl?null:w.jsx(Tf,{size:"16px"}),iconUrl:t==null?void 0:t.buttonIconUrl});const a=(t==null?void 0:t.buttonType)==="icon-text";return w.jsxs(bf,{className:B(e,n,`cim-${r}-component`,`${N}-search-button`),type:"submit","aria-label":(t==null?void 0:t.buttonAriaLabel)||"",disabled:s,children:[a&&w.jsx(CC,{globalClassName:n,searchConfig:t}),(t==null?void 0:t.buttonLabel)||"Search"]})};function kU(){}function CU(){}function b1(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const u=n.slice(s,r).trim();(u||!a)&&t.push(u),s=r+1,r=n.indexOf(",",s)}return t}function w1(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const OC=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,IC=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,PC={};function _1(e,t){return(PC.jsx?IC:OC).test(e)}const RC=/[ \t\n\f\r]/g;function LC(e){return typeof e=="object"?e.type==="text"?x1(e.value):!1:x1(e)}function x1(e){return e.replace(RC,"")===""}class ua{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ua.prototype.normal={},ua.prototype.property={},ua.prototype.space=void 0;function S1(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new ua(n,r,t)}function la(e){return e.toLowerCase()}class Nn{constructor(t,n){this.attribute=n,this.property=t}}Nn.prototype.attribute="",Nn.prototype.booleanish=!1,Nn.prototype.boolean=!1,Nn.prototype.commaOrSpaceSeparated=!1,Nn.prototype.commaSeparated=!1,Nn.prototype.defined=!1,Nn.prototype.mustUseProperty=!1,Nn.prototype.number=!1,Nn.prototype.overloadedBoolean=!1,Nn.prototype.property="",Nn.prototype.spaceSeparated=!1,Nn.prototype.space=void 0;let DC=0;const Je=Zi(),$t=Zi(),wf=Zi(),be=Zi(),yt=Zi(),Ji=Zi(),zn=Zi();function Zi(){return gd(2,++DC)}const _f=Object.freeze(Object.defineProperty({__proto__:null,boolean:Je,booleanish:$t,commaOrSpaceSeparated:zn,commaSeparated:Ji,number:be,overloadedBoolean:wf,spaceSeparated:yt},Symbol.toStringTag,{value:"Module"})),xf=Object.keys(_f);class Sf extends Nn{constructor(t,n,r,s){let a=-1;if(super(t,n),v1(this,"space",s),typeof r=="number")for(;++a<xf.length;){const u=xf[a];v1(this,xf[a],(r&_f[u])===_f[u])}}}Sf.prototype.defined=!0;function v1(e,t,n){n&&(e[t]=n)}function qs(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const a=new Sf(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[la(r)]=r,n[la(a.attribute)]=r}return new ua(t,n,e.space)}const A1=qs({properties:{ariaActiveDescendant:null,ariaAtomic:$t,ariaAutoComplete:null,ariaBusy:$t,ariaChecked:$t,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:yt,ariaCurrent:null,ariaDescribedBy:yt,ariaDetails:null,ariaDisabled:$t,ariaDropEffect:yt,ariaErrorMessage:null,ariaExpanded:$t,ariaFlowTo:yt,ariaGrabbed:$t,ariaHasPopup:null,ariaHidden:$t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:yt,ariaLevel:be,ariaLive:null,ariaModal:$t,ariaMultiLine:$t,ariaMultiSelectable:$t,ariaOrientation:null,ariaOwns:yt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:$t,ariaReadOnly:$t,ariaRelevant:null,ariaRequired:$t,ariaRoleDescription:yt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:$t,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function k1(e,t){return t in e?e[t]:t}function C1(e,t){return k1(e,t.toLowerCase())}const MC=qs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ji,acceptCharset:yt,accessKey:yt,action:null,allow:null,allowFullScreen:Je,allowPaymentRequest:Je,allowUserMedia:Je,alpha:Je,alt:null,as:null,async:Je,autoCapitalize:null,autoComplete:yt,autoFocus:Je,autoPlay:Je,blocking:yt,capture:null,charSet:null,checked:Je,cite:null,className:yt,closedBy:null,colorSpace:null,cols:be,colSpan:be,command:null,commandFor:null,content:null,contentEditable:$t,controls:Je,controlsList:yt,coords:be|Ji,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Je,defer:Je,dir:null,dirName:null,disabled:Je,download:wf,draggable:$t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Je,formTarget:null,headers:yt,height:be,hidden:wf,high:be,href:null,hrefLang:null,htmlFor:yt,httpEquiv:yt,id:null,imageSizes:null,imageSrcSet:null,inert:Je,inputMode:null,integrity:null,is:null,isMap:Je,itemId:null,itemProp:yt,itemRef:yt,itemScope:Je,itemType:yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Je,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Je,muted:Je,name:null,nonce:null,noModule:Je,noValidate:Je,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Je,optimum:be,pattern:null,ping:yt,placeholder:null,playsInline:Je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Je,referrerPolicy:null,rel:yt,required:Je,reversed:Je,rows:be,rowSpan:be,sandbox:yt,scope:null,scoped:Je,seamless:Je,selected:Je,shadowRootClonable:Je,shadowRootCustomElementRegistry:Je,shadowRootDelegatesFocus:Je,shadowRootMode:null,shadowRootSerializable:Je,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:$t,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Je,useMap:null,value:$t,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:yt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Je,declare:Je,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Je,noHref:Je,noShade:Je,noWrap:Je,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:$t,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Je,disablePictureInPicture:Je,disableRemotePlayback:Je,exportParts:Ji,part:yt,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:C1}),FC=qs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:zn,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:yt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Je,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ji,g2:Ji,glyphName:Ji,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:zn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zn,rev:zn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zn,requiredFeatures:zn,requiredFonts:zn,requiredFormats:zn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:zn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zn,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:k1}),N1=qs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),O1=qs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:C1}),I1=qs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),BC={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},UC=/[A-Z]/g,P1=/-[a-z]/g,HC=/^data[-\w.:]+$/i;function ol(e,t){const n=la(t);let r=t,s=Nn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&HC.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(P1,zC);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!P1.test(a)){let u=a.replace(UC,jC);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}s=Sf}return new s(r,t)}function jC(e){return"-"+e.toLowerCase()}function zC(e){return e.charAt(1).toUpperCase()}const ca=S1([A1,MC,N1,O1,I1],"html"),fi=S1([A1,FC,N1,O1,I1],"svg");function R1(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function L1(e){return e.join(" ").trim()}var Ys={},vf,D1;function $C(){if(D1)return vf;D1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,l=/^\s+|\s+$/g,d=`
24
- `,f="/",m="*",p="",b="comment",y="declaration";function _(A,S){if(typeof A!="string")throw new TypeError("First argument must be a string");if(!A)return[];S=S||{};var C=1,O=1;function z(fe){var ue=fe.match(t);ue&&(C+=ue.length);var Se=fe.lastIndexOf(d);O=~Se?fe.length-Se:O+fe.length}function G(){var fe={line:C,column:O};return function(ue){return ue.position=new D(fe),se(),ue}}function D(fe){this.start=fe,this.end={line:C,column:O},this.source=S.source}D.prototype.content=A;function V(fe){var ue=new Error(S.source+":"+C+":"+O+": "+fe);if(ue.reason=fe,ue.filename=S.source,ue.line=C,ue.column=O,ue.source=A,!S.silent)throw ue}function J(fe){var ue=fe.exec(A);if(ue){var Se=ue[0];return z(Se),A=A.slice(Se.length),ue}}function se(){J(n)}function H(fe){var ue;for(fe=fe||[];ue=ie();)ue!==!1&&fe.push(ue);return fe}function ie(){var fe=G();if(!(f!=A.charAt(0)||m!=A.charAt(1))){for(var ue=2;p!=A.charAt(ue)&&(m!=A.charAt(ue)||f!=A.charAt(ue+1));)++ue;if(ue+=2,p===A.charAt(ue-1))return V("End of comment missing");var Se=A.slice(2,ue-2);return O+=2,z(Se),A=A.slice(ue),O+=2,fe({type:b,comment:Se})}}function te(){var fe=G(),ue=J(r);if(ue){if(ie(),!J(s))return V("property missing ':'");var Se=J(a),de=fe({type:y,property:x(ue[0].replace(e,p)),value:Se?x(Se[0].replace(e,p)):p});return J(u),de}}function le(){var fe=[];H(fe);for(var ue;ue=te();)ue!==!1&&(fe.push(ue),H(fe));return fe}return se(),le()}function x(A){return A?A.replace(l,p):p}return vf=_,vf}var M1;function VC(){if(M1)return Ys;M1=1;var e=Ys&&Ys.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.default=n;const t=e($C());function n(r,s){let a=null;if(!r||typeof r!="string")return a;const u=(0,t.default)(r),l=typeof s=="function";return u.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:m}=d;l?s(f,m,d):m&&(a=a||{},a[f]=m)}),a}return Ys}var da={},F1;function qC(){if(F1)return da;F1=1,Object.defineProperty(da,"__esModule",{value:!0}),da.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},u=function(f,m){return m.toUpperCase()},l=function(f,m){return"".concat(m,"-")},d=function(f,m){return m===void 0&&(m={}),a(f)?f:(f=f.toLowerCase(),m.reactCompat?f=f.replace(s,l):f=f.replace(r,l),f.replace(t,u))};return da.camelCase=d,da}var fa,B1;function YC(){if(B1)return fa;B1=1;var e=fa&&fa.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(VC()),n=qC();function r(s,a){var u={};return!s||typeof s!="string"||(0,t.default)(s,function(l,d){l&&d&&(u[(0,n.camelCase)(l,a)]=d)}),u}return r.default=r,fa=r,fa}var WC=YC();const GC=it(WC),al=U1("end"),vr=U1("start");function U1(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function H1(e){const t=vr(e),n=al(e);if(t&&n)return{start:t,end:n}}function ha(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?j1(e.position):"start"in e||"end"in e?j1(e):"line"in e||"column"in e?Af(e):""}function Af(e){return z1(e&&e.line)+":"+z1(e&&e.column)}function j1(e){return Af(e&&e.start)+"-"+Af(e&&e.end)}function z1(e){return e&&typeof e=="number"?e:1}class cn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},u=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a=j({},n)),typeof t=="string"?s=t:!a.cause&&t&&(u=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=ha(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=u&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}cn.prototype.file="",cn.prototype.name="",cn.prototype.reason="",cn.prototype.message="",cn.prototype.stack="",cn.prototype.column=void 0,cn.prototype.line=void 0,cn.prototype.ancestors=void 0,cn.prototype.cause=void 0,cn.prototype.fatal=void 0,cn.prototype.place=void 0,cn.prototype.ruleId=void 0,cn.prototype.source=void 0;const kf={}.hasOwnProperty,XC=new Map,KC=/[A-Z]/g,QC=new Set(["table","tbody","thead","tfoot","tr"]),JC=new Set(["td","th"]),$1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ZC(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=aN(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=oN(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?fi:ca,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=V1(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function V1(e,t,n){if(t.type==="element")return eN(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return tN(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return rN(e,t,n);if(t.type==="mdxjsEsm")return nN(e,t);if(t.type==="root")return iN(e,t,n);if(t.type==="text")return sN(e,t)}function eN(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=fi,e.schema=s),e.ancestors.push(t);const a=Y1(e,t.tagName,!1),u=uN(e,t);let l=Nf(e,t);return QC.has(t.tagName)&&(l=l.filter(function(d){return typeof d=="string"?!LC(d):!0})),q1(e,u,a,t),Cf(u,l),e.ancestors.pop(),e.schema=r,e.create(t,a,u,n)}function tN(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}pa(e,t.position)}function nN(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);pa(e,t.position)}function rN(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=fi,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:Y1(e,t.name,!0),u=lN(e,t),l=Nf(e,t);return q1(e,u,a,t),Cf(u,l),e.ancestors.pop(),e.schema=r,e.create(t,a,u,n)}function iN(e,t,n){const r={};return Cf(r,Nf(e,t)),e.create(t,e.Fragment,r,n)}function sN(e,t){return t.value}function q1(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Cf(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function oN(e,t,n){return r;function r(s,a,u,l){const f=Array.isArray(u.children)?n:t;return l?f(a,u,l):f(a,u)}}function aN(e,t){return n;function n(r,s,a,u){const l=Array.isArray(a.children),d=vr(r);return t(s,a,u,l,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function uN(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&kf.call(t.properties,s)){const a=cN(e,s,t.properties[s]);if(a){const[u,l]=a;e.tableCellAlignToStyle&&u==="align"&&typeof l=="string"&&JC.has(t.tagName)?r=l:n[u]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function lN(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const u=a.expression;u.type;const l=u.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else pa(e,t.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else pa(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function Nf(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:XC;for(;++r<t.children.length;){const a=t.children[r];let u;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const f=s.get(d)||0;u=d+"-"+f,s.set(d,f+1)}}const l=V1(e,a,u);l!==void 0&&n.push(l)}return n}function cN(e,t,n){const r=ol(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?w1(n):L1(n)),r.property==="style"){let s=typeof n=="object"?n:dN(e,String(n));return e.stylePropertyNameCase==="css"&&(s=fN(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?BC[r.property]||r.property:r.attribute,n]}}function dN(e,t){try{return GC(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new cn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=$1+"#cannot-parse-style-attribute",s}}function Y1(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let a=-1,u;for(;++a<s.length;){const l=_1(s[a])?{type:"Identifier",name:s[a]}:{type:"Literal",value:s[a]};u=u?{type:"MemberExpression",object:u,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}r=u}else r=_1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return kf.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);pa(e)}function pa(e,t){const n=new cn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=$1+"#cannot-handle-mdx-estrees-without-createevaluater",n}function fN(e){const t={};let n;for(n in e)kf.call(e,n)&&(t[hN(n)]=e[n]);return t}function hN(e){let t=e.replace(KC,pN);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function pN(e){return"-"+e.toLowerCase()}const Of={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},mN={};function If(e,t){const n=mN,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return W1(e,r,s)}function W1(e,t,n){if(gN(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return G1(e.children,t,n)}return Array.isArray(e)?G1(e,t,n):""}function G1(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=W1(e[s],t,n);return r.join("")}function gN(e){return!!(e&&typeof e=="object")}const X1=document.createElement("i");function Pf(e){const t="&"+e+";";X1.innerHTML=t;const n=X1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function $n(e,t,n,r){const s=e.length;let a=0,u;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)u=Array.from(r),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);a<r.length;)u=r.slice(a,a+1e4),u.unshift(t,0),e.splice(...u),a+=1e4,t+=1e4}function Kn(e,t){return e.length>0?($n(e,e.length,0,t),e):t}const K1={}.hasOwnProperty;function Q1(e){const t={};let n=-1;for(;++n<e.length;)EN(t,e[n]);return t}function EN(e,t){let n;for(n in t){const s=(K1.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let u;if(a)for(u in a){K1.call(s,u)||(s[u]=[]);const l=a[u];yN(s[u],Array.isArray(l)?l:l?[l]:[])}}}function yN(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);$n(e,0,0,r)}function J1(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function cr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const bn=hi(/[A-Za-z]/),dn=hi(/[\dA-Za-z]/),TN=hi(/[#-'*+\--9=?A-Z^-~]/);function ul(e){return e!==null&&(e<32||e===127)}const Rf=hi(/\d/),bN=hi(/[\dA-Fa-f]/),wN=hi(/[!-/:-@[-`{-~]/);function Ve(e){return e!==null&&e<-2}function Tt(e){return e!==null&&(e<0||e===32)}function st(e){return e===-2||e===-1||e===32}const ll=hi(new RegExp("\\p{P}|\\p{S}","u")),es=hi(/\s/);function hi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ws(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let u="";if(a===37&&dn(e.charCodeAt(n+1))&&dn(e.charCodeAt(n+2)))s=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(u=String.fromCharCode(a));else if(a>55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(u=String.fromCharCode(a,l),s=1):u="�"}else u=String.fromCharCode(a);u&&(t.push(e.slice(r,n),encodeURIComponent(u)),r=n+s+1,u=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function ut(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return u;function u(d){return st(d)?(e.enter(n),l(d)):t(d)}function l(d){return st(d)&&a++<s?(e.consume(d),l):(e.exit(n),t(d))}}const _N={tokenize:xN};function xN(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ut(e,t,"linePrefix")}function s(l){return e.enter("paragraph"),a(l)}function a(l){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,u(l)}function u(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Ve(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),u)}}const SN={tokenize:vN},Z1={tokenize:AN};function vN(e){const t=this,n=[];let r=0,s,a,u;return l;function l(O){if(r<n.length){const z=n[r];return t.containerState=z[1],e.attempt(z[0].continuation,d,f)(O)}return f(O)}function d(O){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&C();const z=t.events.length;let G=z,D;for(;G--;)if(t.events[G][0]==="exit"&&t.events[G][1].type==="chunkFlow"){D=t.events[G][1].end;break}S(r);let V=z;for(;V<t.events.length;)t.events[V][1].end=j({},D),V++;return $n(t.events,G+1,0,t.events.slice(z)),t.events.length=V,f(O)}return l(O)}function f(O){if(r===n.length){if(!s)return b(O);if(s.currentConstruct&&s.currentConstruct.concrete)return _(O);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Z1,m,p)(O)}function m(O){return s&&C(),S(r),b(O)}function p(O){return t.parser.lazy[t.now().line]=r!==n.length,u=t.now().offset,_(O)}function b(O){return t.containerState={},e.attempt(Z1,y,_)(O)}function y(O){return r++,n.push([t.currentConstruct,t.containerState]),b(O)}function _(O){if(O===null){s&&C(),S(0),e.consume(O);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),x(O)}function x(O){if(O===null){A(e.exit("chunkFlow"),!0),S(0),e.consume(O);return}return Ve(O)?(e.consume(O),A(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(O),x)}function A(O,z){const G=t.sliceStream(O);if(z&&G.push(null),O.previous=a,a&&(a.next=O),a=O,s.defineSkip(O.start),s.write(G),t.parser.lazy[O.start.line]){let D=s.events.length;for(;D--;)if(s.events[D][1].start.offset<u&&(!s.events[D][1].end||s.events[D][1].end.offset>u))return;const V=t.events.length;let J=V,se,H;for(;J--;)if(t.events[J][0]==="exit"&&t.events[J][1].type==="chunkFlow"){if(se){H=t.events[J][1].end;break}se=!0}for(S(r),D=V;D<t.events.length;)t.events[D][1].end=j({},H),D++;$n(t.events,J+1,0,t.events.slice(V)),t.events.length=D}}function S(O){let z=n.length;for(;z-- >O;){const G=n[z];t.containerState=G[1],G[0].exit.call(t,e)}n.length=O}function C(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function AN(e,t,n){return ut(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Gs(e){if(e===null||Tt(e)||es(e))return 1;if(ll(e))return 2}function cl(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const a=e[s].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Lf={name:"attention",resolveAll:kN,tokenize:CN};function kN(e,t){let n=-1,r,s,a,u,l,d,f,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p=j({},e[r][1].end),b=j({},e[n][1].start);eE(p,-d),eE(b,d),u={type:d>1?"strongSequence":"emphasisSequence",start:p,end:j({},e[r][1].end)},l={type:d>1?"strongSequence":"emphasisSequence",start:j({},e[n][1].start),end:b},a={type:d>1?"strongText":"emphasisText",start:j({},e[r][1].end),end:j({},e[n][1].start)},s={type:d>1?"strong":"emphasis",start:j({},u.start),end:j({},l.end)},e[r][1].end=j({},u.start),e[n][1].start=j({},l.end),f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Kn(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Kn(f,[["enter",s,t],["enter",u,t],["exit",u,t],["enter",a,t]]),f=Kn(f,cl(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Kn(f,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,f=Kn(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,$n(e,r-1,n-r+3,f),n=r+f.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function CN(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=Gs(r);let a;return u;function u(d){return a=d,e.enter("attentionSequence"),l(d)}function l(d){if(d===a)return e.consume(d),l;const f=e.exit("attentionSequence"),m=Gs(d),p=!m||m===2&&s||n.includes(d),b=!s||s===2&&m||n.includes(r);return f._open=!!(a===42?p:p&&(s||!b)),f._close=!!(a===42?b:b&&(m||!p)),t(d)}}function eE(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const NN={name:"autolink",tokenize:ON};function ON(e,t,n){let r=0;return s;function s(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(y){return bn(y)?(e.consume(y),u):y===64?n(y):f(y)}function u(y){return y===43||y===45||y===46||dn(y)?(r=1,l(y)):f(y)}function l(y){return y===58?(e.consume(y),r=0,d):(y===43||y===45||y===46||dn(y))&&r++<32?(e.consume(y),l):(r=0,f(y))}function d(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||ul(y)?n(y):(e.consume(y),d)}function f(y){return y===64?(e.consume(y),m):TN(y)?(e.consume(y),f):n(y)}function m(y){return dn(y)?p(y):n(y)}function p(y){return y===46?(e.consume(y),r=0,m):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):b(y)}function b(y){if((y===45||dn(y))&&r++<63){const _=y===45?b:p;return e.consume(y),_}return n(y)}}const ma={partial:!0,tokenize:IN};function IN(e,t,n){return r;function r(a){return st(a)?ut(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||Ve(a)?t(a):n(a)}}const tE={continuation:{tokenize:RN},exit:LN,name:"blockQuote",tokenize:PN};function PN(e,t,n){const r=this;return s;function s(u){if(u===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),a}return n(u)}function a(u){return st(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function RN(e,t,n){const r=this;return s;function s(u){return st(u)?ut(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):a(u)}function a(u){return e.attempt(tE,t,n)(u)}}function LN(e){e.exit("blockQuote")}const nE={name:"characterEscape",tokenize:DN};function DN(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),s}function s(a){return wN(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const rE={name:"characterReference",tokenize:MN};function MN(e,t,n){const r=this;let s=0,a,u;return l;function l(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),d}function d(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,u=dn,m(p))}function f(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,u=bN,m):(e.enter("characterReferenceValue"),a=7,u=Rf,m(p))}function m(p){if(p===59&&s){const b=e.exit("characterReferenceValue");return u===dn&&!Pf(r.sliceSerialize(b))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(p)&&s++<a?(e.consume(p),m):n(p)}}const iE={partial:!0,tokenize:BN},sE={concrete:!0,name:"codeFenced",tokenize:FN};function FN(e,t,n){const r=this,s={partial:!0,tokenize:G};let a=0,u=0,l;return d;function d(D){return f(D)}function f(D){const V=r.events[r.events.length-1];return a=V&&V[1].type==="linePrefix"?V[2].sliceSerialize(V[1],!0).length:0,l=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(D)}function m(D){return D===l?(u++,e.consume(D),m):u<3?n(D):(e.exit("codeFencedFenceSequence"),st(D)?ut(e,p,"whitespace")(D):p(D))}function p(D){return D===null||Ve(D)?(e.exit("codeFencedFence"),r.interrupt?t(D):e.check(iE,x,z)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(D))}function b(D){return D===null||Ve(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(D)):st(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ut(e,y,"whitespace")(D)):D===96&&D===l?n(D):(e.consume(D),b)}function y(D){return D===null||Ve(D)?p(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),_(D))}function _(D){return D===null||Ve(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(D)):D===96&&D===l?n(D):(e.consume(D),_)}function x(D){return e.attempt(s,z,A)(D)}function A(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),S}function S(D){return a>0&&st(D)?ut(e,C,"linePrefix",a+1)(D):C(D)}function C(D){return D===null||Ve(D)?e.check(iE,x,z)(D):(e.enter("codeFlowValue"),O(D))}function O(D){return D===null||Ve(D)?(e.exit("codeFlowValue"),C(D)):(e.consume(D),O)}function z(D){return e.exit("codeFenced"),t(D)}function G(D,V,J){let se=0;return H;function H(ue){return D.enter("lineEnding"),D.consume(ue),D.exit("lineEnding"),ie}function ie(ue){return D.enter("codeFencedFence"),st(ue)?ut(D,te,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ue):te(ue)}function te(ue){return ue===l?(D.enter("codeFencedFenceSequence"),le(ue)):J(ue)}function le(ue){return ue===l?(se++,D.consume(ue),le):se>=u?(D.exit("codeFencedFenceSequence"),st(ue)?ut(D,fe,"whitespace")(ue):fe(ue)):J(ue)}function fe(ue){return ue===null||Ve(ue)?(D.exit("codeFencedFence"),V(ue)):J(ue)}}}function BN(e,t,n){const r=this;return s;function s(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a)}function a(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}const Df={name:"codeIndented",tokenize:HN},UN={partial:!0,tokenize:jN};function HN(e,t,n){const r=this;return s;function s(f){return e.enter("codeIndented"),ut(e,a,"linePrefix",5)(f)}function a(f){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?u(f):n(f)}function u(f){return f===null?d(f):Ve(f)?e.attempt(UN,u,d)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||Ve(f)?(e.exit("codeFlowValue"),u(f)):(e.consume(f),l)}function d(f){return e.exit("codeIndented"),t(f)}}function jN(e,t,n){const r=this;return s;function s(u){return r.parser.lazy[r.now().line]?n(u):Ve(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):ut(e,a,"linePrefix",5)(u)}function a(u){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(u):Ve(u)?s(u):n(u)}}const zN={name:"codeText",previous:VN,resolve:$N,tokenize:qN};function $N(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function VN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function qN(e,t,n){let r=0,s,a;return u;function u(p){return e.enter("codeText"),e.enter("codeTextSequence"),l(p)}function l(p){return p===96?(e.consume(p),r++,l):(e.exit("codeTextSequence"),d(p))}function d(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),d):p===96?(a=e.enter("codeTextSequence"),s=0,m(p)):Ve(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(p))}function f(p){return p===null||p===32||p===96||Ve(p)?(e.exit("codeTextData"),d(p)):(e.consume(p),f)}function m(p){return p===96?(e.consume(p),s++,m):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(a.type="codeTextData",f(p))}}class YN{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n==null?Number.POSITIVE_INFINITY:n;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&ga(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ga(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ga(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ga(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ga(this.left,n.reverse())}}}function ga(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function oE(e){const t={};let n=-1,r,s,a,u,l,d,f;const m=new YN(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,WN(m,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,s=void 0;a--;)if(u=m.get(a),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(s&&(m.get(s)[1].type="lineEndingBlank"),u[1].type="lineEnding",s=a);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;s&&(r[1].end=j({},m.get(s)[1].start),l=m.slice(s,n),l.unshift(r),m.splice(s,n-s+1,l))}}return $n(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!f}function WN(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const a=[];let u=n._tokenizer;u||(u=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const l=u.events,d=[],f={};let m,p,b=-1,y=n,_=0,x=0;const A=[x];for(;y;){for(;e.get(++s)[1]!==y;);a.push(s),y._tokenizer||(m=r.sliceStream(y),y.next||m.push(null),p&&u.defineSkip(y.start),y._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(m),y._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),p=y,y=y.next}for(y=n;++b<l.length;)l[b][0]==="exit"&&l[b-1][0]==="enter"&&l[b][1].type===l[b-1][1].type&&l[b][1].start.line!==l[b][1].end.line&&(x=b+1,A.push(x),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(u.events=[],y?(y._tokenizer=void 0,y.previous=void 0):A.pop(),b=A.length;b--;){const S=l.slice(A[b],A[b+1]),C=a.pop();d.push([C,C+S.length-1]),e.splice(C,2,S)}for(d.reverse(),b=-1;++b<d.length;)f[_+d[b][0]]=_+d[b][1],_+=d[b][1]-d[b][0]-1;return f}const GN={resolve:KN,tokenize:QN},XN={partial:!0,tokenize:JN};function KN(e){return oE(e),e}function QN(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(l)}function s(l){return l===null?a(l):Ve(l)?e.check(XN,u,a)(l):(e.consume(l),s)}function a(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function u(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function JN(e,t,n){const r=this;return s;function s(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),ut(e,a,"linePrefix")}function a(u){if(u===null||Ve(u))return n(u);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(u):e.interrupt(r.parser.constructs.flow,n,t)(u)}}function aE(e,t,n,r,s,a,u,l,d){const f=d||Number.POSITIVE_INFINITY;let m=0;return p;function p(S){return S===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(S),e.exit(a),b):S===null||S===32||S===41||ul(S)?n(S):(e.enter(r),e.enter(u),e.enter(l),e.enter("chunkString",{contentType:"string"}),x(S))}function b(S){return S===62?(e.enter(a),e.consume(S),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===62?(e.exit("chunkString"),e.exit(l),b(S)):S===null||S===60||Ve(S)?n(S):(e.consume(S),S===92?_:y)}function _(S){return S===60||S===62||S===92?(e.consume(S),y):y(S)}function x(S){return!m&&(S===null||S===41||Tt(S))?(e.exit("chunkString"),e.exit(l),e.exit(u),e.exit(r),t(S)):m<f&&S===40?(e.consume(S),m++,x):S===41?(e.consume(S),m--,x):S===null||S===32||S===40||ul(S)?n(S):(e.consume(S),S===92?A:x)}function A(S){return S===40||S===41||S===92?(e.consume(S),x):x(S)}}function uE(e,t,n,r,s,a){const u=this;let l=0,d;return f;function f(y){return e.enter(r),e.enter(s),e.consume(y),e.exit(s),e.enter(a),m}function m(y){return l>999||y===null||y===91||y===93&&!d||y===94&&!l&&"_hiddenFootnoteSupport"in u.parser.constructs?n(y):y===93?(e.exit(a),e.enter(s),e.consume(y),e.exit(s),e.exit(r),t):Ve(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||y===91||y===93||Ve(y)||l++>999?(e.exit("chunkString"),m(y)):(e.consume(y),d||(d=!st(y)),y===92?b:p)}function b(y){return y===91||y===92||y===93?(e.consume(y),l++,p):p(y)}}function lE(e,t,n,r,s,a){let u;return l;function l(b){return b===34||b===39||b===40?(e.enter(r),e.enter(s),e.consume(b),e.exit(s),u=b===40?41:b,d):n(b)}function d(b){return b===u?(e.enter(s),e.consume(b),e.exit(s),e.exit(r),t):(e.enter(a),f(b))}function f(b){return b===u?(e.exit(a),d(u)):b===null?n(b):Ve(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),ut(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===u||b===null||Ve(b)?(e.exit("chunkString"),f(b)):(e.consume(b),b===92?p:m)}function p(b){return b===u||b===92?(e.consume(b),m):m(b)}}function Ea(e,t){let n;return r;function r(s){return Ve(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):st(s)?ut(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const ZN={name:"definition",tokenize:t3},e3={partial:!0,tokenize:n3};function t3(e,t,n){const r=this;let s;return a;function a(y){return e.enter("definition"),u(y)}function u(y){return uE.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function l(y){return s=cr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),d):n(y)}function d(y){return Tt(y)?Ea(e,f)(y):f(y)}function f(y){return aE(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function m(y){return e.attempt(e3,p,p)(y)}function p(y){return st(y)?ut(e,b,"whitespace")(y):b(y)}function b(y){return y===null||Ve(y)?(e.exit("definition"),r.parser.defined.push(s),t(y)):n(y)}}function n3(e,t,n){return r;function r(l){return Tt(l)?Ea(e,s)(l):n(l)}function s(l){return lE(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return st(l)?ut(e,u,"whitespace")(l):u(l)}function u(l){return l===null||Ve(l)?t(l):n(l)}}const r3={name:"hardBreakEscape",tokenize:i3};function i3(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return Ve(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const s3={name:"headingAtx",resolve:o3,tokenize:a3};function o3(e,t){let n=e.length-2,r=3,s,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},$n(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function a3(e,t,n){let r=0;return s;function s(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),u(m)}function u(m){return m===35&&r++<6?(e.consume(m),u):m===null||Tt(m)?(e.exit("atxHeadingSequence"),l(m)):n(m)}function l(m){return m===35?(e.enter("atxHeadingSequence"),d(m)):m===null||Ve(m)?(e.exit("atxHeading"),t(m)):st(m)?ut(e,l,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function d(m){return m===35?(e.consume(m),d):(e.exit("atxHeadingSequence"),l(m))}function f(m){return m===null||m===35||Tt(m)?(e.exit("atxHeadingText"),l(m)):(e.consume(m),f)}}const u3=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],cE=["pre","script","style","textarea"],l3={concrete:!0,name:"htmlFlow",resolveTo:f3,tokenize:h3},c3={partial:!0,tokenize:m3},d3={partial:!0,tokenize:p3};function f3(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function h3(e,t,n){const r=this;let s,a,u,l,d;return f;function f(P){return m(P)}function m(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),p}function p(P){return P===33?(e.consume(P),b):P===47?(e.consume(P),a=!0,x):P===63?(e.consume(P),s=3,r.interrupt?t:k):bn(P)?(e.consume(P),u=String.fromCharCode(P),A):n(P)}function b(P){return P===45?(e.consume(P),s=2,y):P===91?(e.consume(P),s=5,l=0,_):bn(P)?(e.consume(P),s=4,r.interrupt?t:k):n(P)}function y(P){return P===45?(e.consume(P),r.interrupt?t:k):n(P)}function _(P){const xe="CDATA[";return P===xe.charCodeAt(l++)?(e.consume(P),l===xe.length?r.interrupt?t:te:_):n(P)}function x(P){return bn(P)?(e.consume(P),u=String.fromCharCode(P),A):n(P)}function A(P){if(P===null||P===47||P===62||Tt(P)){const xe=P===47,Ie=u.toLowerCase();return!xe&&!a&&cE.includes(Ie)?(s=1,r.interrupt?t(P):te(P)):u3.includes(u.toLowerCase())?(s=6,xe?(e.consume(P),S):r.interrupt?t(P):te(P)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):a?C(P):O(P))}return P===45||dn(P)?(e.consume(P),u+=String.fromCharCode(P),A):n(P)}function S(P){return P===62?(e.consume(P),r.interrupt?t:te):n(P)}function C(P){return st(P)?(e.consume(P),C):H(P)}function O(P){return P===47?(e.consume(P),H):P===58||P===95||bn(P)?(e.consume(P),z):st(P)?(e.consume(P),O):H(P)}function z(P){return P===45||P===46||P===58||P===95||dn(P)?(e.consume(P),z):G(P)}function G(P){return P===61?(e.consume(P),D):st(P)?(e.consume(P),G):O(P)}function D(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),d=P,V):st(P)?(e.consume(P),D):J(P)}function V(P){return P===d?(e.consume(P),d=null,se):P===null||Ve(P)?n(P):(e.consume(P),V)}function J(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Tt(P)?G(P):(e.consume(P),J)}function se(P){return P===47||P===62||st(P)?O(P):n(P)}function H(P){return P===62?(e.consume(P),ie):n(P)}function ie(P){return P===null||Ve(P)?te(P):st(P)?(e.consume(P),ie):n(P)}function te(P){return P===45&&s===2?(e.consume(P),Se):P===60&&s===1?(e.consume(P),de):P===62&&s===4?(e.consume(P),M):P===63&&s===3?(e.consume(P),k):P===93&&s===5?(e.consume(P),oe):Ve(P)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(c3,Z,le)(P)):P===null||Ve(P)?(e.exit("htmlFlowData"),le(P)):(e.consume(P),te)}function le(P){return e.check(d3,fe,Z)(P)}function fe(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),ue}function ue(P){return P===null||Ve(P)?le(P):(e.enter("htmlFlowData"),te(P))}function Se(P){return P===45?(e.consume(P),k):te(P)}function de(P){return P===47?(e.consume(P),u="",W):te(P)}function W(P){if(P===62){const xe=u.toLowerCase();return cE.includes(xe)?(e.consume(P),M):te(P)}return bn(P)&&u.length<8?(e.consume(P),u+=String.fromCharCode(P),W):te(P)}function oe(P){return P===93?(e.consume(P),k):te(P)}function k(P){return P===62?(e.consume(P),M):P===45&&s===2?(e.consume(P),k):te(P)}function M(P){return P===null||Ve(P)?(e.exit("htmlFlowData"),Z(P)):(e.consume(P),M)}function Z(P){return e.exit("htmlFlow"),t(P)}}function p3(e,t,n){const r=this;return s;function s(u){return Ve(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a):n(u)}function a(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}function m3(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(ma,t,n)}}const g3={name:"htmlText",tokenize:E3};function E3(e,t,n){const r=this;let s,a,u;return l;function l(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),d}function d(k){return k===33?(e.consume(k),f):k===47?(e.consume(k),G):k===63?(e.consume(k),O):bn(k)?(e.consume(k),J):n(k)}function f(k){return k===45?(e.consume(k),m):k===91?(e.consume(k),a=0,_):bn(k)?(e.consume(k),C):n(k)}function m(k){return k===45?(e.consume(k),y):n(k)}function p(k){return k===null?n(k):k===45?(e.consume(k),b):Ve(k)?(u=p,de(k)):(e.consume(k),p)}function b(k){return k===45?(e.consume(k),y):p(k)}function y(k){return k===62?Se(k):k===45?b(k):p(k)}function _(k){const M="CDATA[";return k===M.charCodeAt(a++)?(e.consume(k),a===M.length?x:_):n(k)}function x(k){return k===null?n(k):k===93?(e.consume(k),A):Ve(k)?(u=x,de(k)):(e.consume(k),x)}function A(k){return k===93?(e.consume(k),S):x(k)}function S(k){return k===62?Se(k):k===93?(e.consume(k),S):x(k)}function C(k){return k===null||k===62?Se(k):Ve(k)?(u=C,de(k)):(e.consume(k),C)}function O(k){return k===null?n(k):k===63?(e.consume(k),z):Ve(k)?(u=O,de(k)):(e.consume(k),O)}function z(k){return k===62?Se(k):O(k)}function G(k){return bn(k)?(e.consume(k),D):n(k)}function D(k){return k===45||dn(k)?(e.consume(k),D):V(k)}function V(k){return Ve(k)?(u=V,de(k)):st(k)?(e.consume(k),V):Se(k)}function J(k){return k===45||dn(k)?(e.consume(k),J):k===47||k===62||Tt(k)?se(k):n(k)}function se(k){return k===47?(e.consume(k),Se):k===58||k===95||bn(k)?(e.consume(k),H):Ve(k)?(u=se,de(k)):st(k)?(e.consume(k),se):Se(k)}function H(k){return k===45||k===46||k===58||k===95||dn(k)?(e.consume(k),H):ie(k)}function ie(k){return k===61?(e.consume(k),te):Ve(k)?(u=ie,de(k)):st(k)?(e.consume(k),ie):se(k)}function te(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),s=k,le):Ve(k)?(u=te,de(k)):st(k)?(e.consume(k),te):(e.consume(k),fe)}function le(k){return k===s?(e.consume(k),s=void 0,ue):k===null?n(k):Ve(k)?(u=le,de(k)):(e.consume(k),le)}function fe(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||Tt(k)?se(k):(e.consume(k),fe)}function ue(k){return k===47||k===62||Tt(k)?se(k):n(k)}function Se(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function de(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),W}function W(k){return st(k)?ut(e,oe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):oe(k)}function oe(k){return e.enter("htmlTextData"),u(k)}}const Mf={name:"labelEnd",resolveAll:w3,resolveTo:_3,tokenize:x3},y3={tokenize:S3},T3={tokenize:v3},b3={tokenize:A3};function w3(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&$n(e,0,e.length,n),e}function _3(e,t){let n=e.length,r=0,s,a,u,l;for(;n--;)if(s=e[n][1],a){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(a=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(u=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:j({},e[a][1].start),end:j({},e[e.length-1][1].end)},f={type:"label",start:j({},e[a][1].start),end:j({},e[u][1].end)},m={type:"labelText",start:j({},e[a+r+2][1].end),end:j({},e[u-2][1].start)};return l=[["enter",d,t],["enter",f,t]],l=Kn(l,e.slice(a+1,a+r+3)),l=Kn(l,[["enter",m,t]]),l=Kn(l,cl(t.parser.constructs.insideSpan.null,e.slice(a+r+4,u-3),t)),l=Kn(l,[["exit",m,t],e[u-2],e[u-1],["exit",f,t]]),l=Kn(l,e.slice(u+1)),l=Kn(l,[["exit",d,t]]),$n(e,a,e.length,l),e}function x3(e,t,n){const r=this;let s=r.events.length,a,u;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){a=r.events[s][1];break}return l;function l(b){return a?a._inactive?p(b):(u=r.parser.defined.includes(cr(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),d):n(b)}function d(b){return b===40?e.attempt(y3,m,u?m:p)(b):b===91?e.attempt(T3,m,u?f:p)(b):u?m(b):p(b)}function f(b){return e.attempt(b3,m,p)(b)}function m(b){return t(b)}function p(b){return a._balanced=!0,n(b)}}function S3(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),s}function s(p){return Tt(p)?Ea(e,a)(p):a(p)}function a(p){return p===41?m(p):aE(e,u,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function u(p){return Tt(p)?Ea(e,d)(p):m(p)}function l(p){return n(p)}function d(p){return p===34||p===39||p===40?lE(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function f(p){return Tt(p)?Ea(e,m)(p):m(p)}function m(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function v3(e,t,n){const r=this;return s;function s(l){return uE.call(r,e,a,u,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(cr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function u(l){return n(l)}}function A3(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),s}function s(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const k3={name:"labelStartImage",resolveAll:Mf.resolveAll,tokenize:C3};function C3(e,t,n){const r=this;return s;function s(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),a}function a(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),u):n(l)}function u(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const N3={name:"labelStartLink",resolveAll:Mf.resolveAll,tokenize:O3};function O3(e,t,n){const r=this;return s;function s(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),a}function a(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const Ff={name:"lineEnding",tokenize:I3};function I3(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ut(e,t,"linePrefix")}}const dl={name:"thematicBreak",tokenize:P3};function P3(e,t,n){let r=0,s;return a;function a(f){return e.enter("thematicBreak"),u(f)}function u(f){return s=f,l(f)}function l(f){return f===s?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||Ve(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===s?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),st(f)?ut(e,l,"whitespace")(f):l(f))}}const On={continuation:{tokenize:M3},exit:B3,name:"list",tokenize:D3},R3={partial:!0,tokenize:U3},L3={partial:!0,tokenize:F3};function D3(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,u=0;return l;function l(y){const _=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:Rf(y)){if(r.containerState.type||(r.containerState.type=_,e.enter(_,{_container:!0})),_==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(dl,n,f)(y):f(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(y)}return n(y)}function d(y){return Rf(y)&&++u<10?(e.consume(y),d):(!r.interrupt||u<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),f(y)):n(y)}function f(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(ma,r.interrupt?n:m,e.attempt(R3,b,p))}function m(y){return r.containerState.initialBlankLine=!0,a++,b(y)}function p(y){return st(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),b):n(y)}function b(y){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function M3(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ma,s,a);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ut(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!st(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,u(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(L3,t,u)(l))}function u(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,ut(e,e.attempt(On,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function F3(e,t,n){const r=this;return ut(e,s,"listItemIndent",r.containerState.size+1);function s(a){const u=r.events[r.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===r.containerState.size?t(a):n(a)}}function B3(e){e.exit(this.containerState.type)}function U3(e,t,n){const r=this;return ut(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const u=r.events[r.events.length-1];return!st(a)&&u&&u[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const dE={name:"setextUnderline",resolveTo:H3,tokenize:j3};function H3(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const u={type:"setextHeading",start:j({},e[r][1].start),end:j({},e[e.length-1][1].end)};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",u,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end=j({},e[a][1].end)):e[r][1]=u,e.push(["exit",u,t]),e}function j3(e,t,n){const r=this;let s;return a;function a(f){let m=r.events.length,p;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){p=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),s=f,u(f)):n(f)}function u(f){return e.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===s?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),st(f)?ut(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||Ve(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const z3={tokenize:$3};function $3(e){const t=this,n=e.attempt(ma,r,e.attempt(this.parser.constructs.flowInitial,s,ut(e,e.attempt(this.parser.constructs.flow,s,e.attempt(GN,s)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const V3={resolveAll:hE()},q3=fE("string"),Y3=fE("text");function fE(e){return{resolveAll:hE(e==="text"?W3:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,u,l);return u;function u(m){return f(m)?a(m):l(m)}function l(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return f(m)?(n.exit("data"),a(m)):(n.consume(m),d)}function f(m){if(m===null)return!0;const p=s[m];let b=-1;if(p)for(;++b<p.length;){const y=p[b];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function hE(e){return t;function t(n,r){let s=-1,a;for(;++s<=n.length;)a===void 0?n[s]&&n[s][1].type==="data"&&(a=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==a+2&&(n[a][1].end=n[s-1][1].end,n.splice(a+2,s-a-2),s=a+2),a=void 0);return e?e(n,r):n}}function W3(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let a=s.length,u=-1,l=0,d;for(;a--;){const f=s[a];if(typeof f=="string"){for(u=f.length;f.charCodeAt(u-1)===32;)l++,u--;if(u)break;u=-1}else if(f===-2)d=!0,l++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const f={type:n===e.length||d||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?u:r.start._bufferIndex+u,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:j({},r.end)};r.end=j({},f.start),r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const G3=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:ZN},disable:{null:[]},document:{42:On,43:On,45:On,48:On,49:On,50:On,51:On,52:On,53:On,54:On,55:On,56:On,57:On,62:tE},flow:{35:s3,42:dl,45:[dE,dl],60:l3,61:dE,95:dl,96:sE,126:sE},flowInitial:{[-2]:Df,[-1]:Df,32:Df},insideSpan:{null:[Lf,V3]},string:{38:rE,92:nE},text:{[-5]:Ff,[-4]:Ff,[-3]:Ff,33:k3,38:rE,42:Lf,60:[NN,g3],91:N3,92:[r3,nE],93:Mf,95:Lf,96:zN}},Symbol.toStringTag,{value:"Module"}));function X3(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},a=[];let u=[],l=[];const d={attempt:V(G),check:V(D),consume:C,enter:O,exit:z,interrupt:V(D,{interrupt:!0})},f={code:null,containerState:{},defineSkip:x,events:[],now:_,parser:e,previous:null,sliceSerialize:b,sliceStream:y,write:p};let m=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function p(ie){return u=Kn(u,ie),A(),u[u.length-1]!==null?[]:(J(t,0),f.events=cl(a,f.events,f),f.events)}function b(ie,te){return Q3(y(ie),te)}function y(ie){return K3(u,ie)}function _(){const{_bufferIndex:ie,_index:te,line:le,column:fe,offset:ue}=r;return{_bufferIndex:ie,_index:te,line:le,column:fe,offset:ue}}function x(ie){s[ie.line]=ie.column,H()}function A(){let ie;for(;r._index<u.length;){const te=u[r._index];if(typeof te=="string")for(ie=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===ie&&r._bufferIndex<te.length;)S(te.charCodeAt(r._bufferIndex));else S(te)}}function S(ie){m=m(ie)}function C(ie){Ve(ie)?(r.line++,r.column=1,r.offset+=ie===-3?2:1,H()):ie!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===u[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=ie}function O(ie,te){const le=te||{};return le.type=ie,le.start=_(),f.events.push(["enter",le,f]),l.push(le),le}function z(ie){const te=l.pop();return te.end=_(),f.events.push(["exit",te,f]),te}function G(ie,te){J(ie,te.from)}function D(ie,te){te.restore()}function V(ie,te){return le;function le(fe,ue,Se){let de,W,oe,k;return Array.isArray(fe)?Z(fe):"tokenize"in fe?Z([fe]):M(fe);function M(he){return ve;function ve(Fe){const Ge=Fe!==null&&he[Fe],et=Fe!==null&&he.null,mt=[...Array.isArray(Ge)?Ge:Ge?[Ge]:[],...Array.isArray(et)?et:et?[et]:[]];return Z(mt)(Fe)}}function Z(he){return de=he,W=0,he.length===0?Se:P(he[W])}function P(he){return ve;function ve(Fe){return k=se(),oe=he,he.partial||(f.currentConstruct=he),he.name&&f.parser.constructs.disable.null.includes(he.name)?Ie():he.tokenize.call(te?Object.assign(Object.create(f),te):f,d,xe,Ie)(Fe)}}function xe(he){return ie(oe,k),ue}function Ie(he){return k.restore(),++W<de.length?P(de[W]):Se}}}function J(ie,te){ie.resolveAll&&!a.includes(ie)&&a.push(ie),ie.resolve&&$n(f.events,te,f.events.length-te,ie.resolve(f.events.slice(te),f)),ie.resolveTo&&(f.events=ie.resolveTo(f.events,f))}function se(){const ie=_(),te=f.previous,le=f.currentConstruct,fe=f.events.length,ue=Array.from(l);return{from:fe,restore:Se};function Se(){r=ie,f.previous=te,f.currentConstruct=le,f.events.length=fe,l=ue,H()}}function H(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function K3(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,a=t.end._bufferIndex;let u;if(n===s)u=[e[n].slice(r,a)];else{if(u=e.slice(n,s),r>-1){const l=u[0];typeof l=="string"?u[0]=l.slice(r):u.shift()}a>0&&u.push(e[s].slice(0,a))}return u}function Q3(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const a=e[n];let u;if(typeof a=="string")u=a;else switch(a){case-5:{u="\r";break}case-4:{u=`
23
+ `+T.stack}return{value:i,source:o,stack:E,digest:null}}function Lm(i,o,c){return{value:i,source:null,stack:c!=null?c:null,digest:o!=null?o:null}}function Dm(i,o){try{console.error(o.value)}catch(c){setTimeout(function(){throw c})}}var k7=typeof WeakMap=="function"?WeakMap:Map;function Dx(i,o,c){c=si(-1,c),c.tag=3,c.payload={element:null};var h=o.value;return c.callback=function(){td||(td=!0,Km=h),Dm(i,o)},c}function Mx(i,o,c){c=si(-1,c),c.tag=3;var h=i.type.getDerivedStateFromError;if(typeof h=="function"){var E=o.value;c.payload=function(){return h(E)},c.callback=function(){Dm(i,o)}}var T=i.stateNode;return T!==null&&typeof T.componentDidCatch=="function"&&(c.callback=function(){Dm(i,o),typeof h!="function"&&(Mi===null?Mi=new Set([this]):Mi.add(this));var v=o.stack;this.componentDidCatch(o.value,{componentStack:v!==null?v:""})}),c}function Fx(i,o,c){var h=i.pingCache;if(h===null){h=i.pingCache=new k7;var E=new Set;h.set(o,E)}else E=h.get(o),E===void 0&&(E=new Set,h.set(o,E));E.has(c)||(E.add(c),i=j7.bind(null,i,o,c),o.then(i,i))}function Bx(i){do{var o;if((o=i.tag===13)&&(o=i.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return i;i=i.return}while(i!==null);return null}function Ux(i,o,c,h,E){return(i.mode&1)===0?(i===o?i.flags|=65536:(i.flags|=128,c.flags|=131072,c.flags&=-52805,c.tag===1&&(c.alternate===null?c.tag=17:(o=si(-1,1),o.tag=2,Li(c,o,1))),c.lanes|=1),i):(i.flags|=65536,i.lanes=E,i)}var C7=z.ReactCurrentOwner,Fn=!1;function _n(i,o,c,h){o.child=i===null?sx(o,null,c,h):Bo(o,i.child,c,h)}function Hx(i,o,c,h,E){c=c.render;var T=o.ref;return Ho(o,E),h=Am(i,o,c,h,T,E),c=km(),i!==null&&!Fn?(o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~E,oi(i,o,E)):(Nt&&c&&lm(o),o.flags|=1,_n(i,o,h,E),o.child)}function jx(i,o,c,h,E){if(i===null){var T=c.type;return typeof T=="function"&&!r0(T)&&T.defaultProps===void 0&&c.compare===null&&c.defaultProps===void 0?(o.tag=15,o.type=T,zx(i,o,T,h,E)):(i=ad(c.type,null,h,o,o.mode,E),i.ref=o.ref,i.return=o,o.child=i)}if(T=i.child,(i.lanes&E)===0){var v=T.memoizedProps;if(c=c.compare,c=c!==null?c:ou,c(v,h)&&i.ref===o.ref)return oi(i,o,E)}return o.flags|=1,i=Hi(T,h),i.ref=o.ref,i.return=o,o.child=i}function zx(i,o,c,h,E){if(i!==null){var T=i.memoizedProps;if(ou(T,h)&&i.ref===o.ref)if(Fn=!1,o.pendingProps=h=T,(i.lanes&E)!==0)(i.flags&131072)!==0&&(Fn=!0);else return o.lanes=i.lanes,oi(i,o,E)}return Mm(i,o,c,h,E)}function $x(i,o,c){var h=o.pendingProps,E=h.children,T=i!==null?i.memoizedState:null;if(h.mode==="hidden")if((o.mode&1)===0)o.memoizedState={baseLanes:0,cachePool:null,transitions:null},wt(Vo,Gn),Gn|=c;else{if((c&1073741824)===0)return i=T!==null?T.baseLanes|c:c,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:i,cachePool:null,transitions:null},o.updateQueue=null,wt(Vo,Gn),Gn|=i,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=T!==null?T.baseLanes:c,wt(Vo,Gn),Gn|=h}else T!==null?(h=T.baseLanes|c,o.memoizedState=null):h=c,wt(Vo,Gn),Gn|=h;return _n(i,o,E,c),o.child}function Vx(i,o){var c=o.ref;(i===null&&c!==null||i!==null&&i.ref!==c)&&(o.flags|=512,o.flags|=2097152)}function Mm(i,o,c,h,E){var T=Mn(c)?ws:mn.current;return T=Lo(o,T),Ho(o,E),c=Am(i,o,c,h,T,E),h=km(),i!==null&&!Fn?(o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~E,oi(i,o,E)):(Nt&&h&&lm(o),o.flags|=1,_n(i,o,c,E),o.child)}function qx(i,o,c,h,E){if(Mn(c)){var T=!0;Pc(o)}else T=!1;if(Ho(o,E),o.stateNode===null)Kc(i,o),Rx(o,c,h),Rm(o,c,h,E),h=!0;else if(i===null){var v=o.stateNode,F=o.memoizedProps;v.props=F;var $=v.context,ee=c.contextType;typeof ee=="object"&&ee!==null?ee=tr(ee):(ee=Mn(c)?ws:mn.current,ee=Lo(o,ee));var ge=c.getDerivedStateFromProps,Te=typeof ge=="function"||typeof v.getSnapshotBeforeUpdate=="function";Te||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(F!==h||$!==ee)&&Lx(o,v,h,ee),Ri=!1;var pe=o.memoizedState;v.state=pe,jc(o,h,v,E),$=o.memoizedState,F!==h||pe!==$||Dn.current||Ri?(typeof ge=="function"&&(Pm(o,c,ge,h),$=o.memoizedState),(F=Ri||Px(o,c,F,h,pe,$,ee))?(Te||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(o.flags|=4194308)):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=h,o.memoizedState=$),v.props=h,v.state=$,v.context=ee,h=F):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),h=!1)}else{v=o.stateNode,ax(i,o),F=o.memoizedProps,ee=o.type===o.elementType?F:yr(o.type,F),v.props=ee,Te=o.pendingProps,pe=v.context,$=c.contextType,typeof $=="object"&&$!==null?$=tr($):($=Mn(c)?ws:mn.current,$=Lo(o,$));var Pe=c.getDerivedStateFromProps;(ge=typeof Pe=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(F!==Te||pe!==$)&&Lx(o,v,h,$),Ri=!1,pe=o.memoizedState,v.state=pe,jc(o,h,v,E);var De=o.memoizedState;F!==Te||pe!==De||Dn.current||Ri?(typeof Pe=="function"&&(Pm(o,c,Pe,h),De=o.memoizedState),(ee=Ri||Px(o,c,ee,h,pe,De,$)||!1)?(ge||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(h,De,$),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(h,De,$)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||F===i.memoizedProps&&pe===i.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||F===i.memoizedProps&&pe===i.memoizedState||(o.flags|=1024),o.memoizedProps=h,o.memoizedState=De),v.props=h,v.state=De,v.context=$,h=ee):(typeof v.componentDidUpdate!="function"||F===i.memoizedProps&&pe===i.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||F===i.memoizedProps&&pe===i.memoizedState||(o.flags|=1024),h=!1)}return Fm(i,o,c,h,T,E)}function Fm(i,o,c,h,E,T){Vx(i,o);var v=(o.flags&128)!==0;if(!h&&!v)return E&&K_(o,c,!1),oi(i,o,T);h=o.stateNode,C7.current=o;var F=v&&typeof c.getDerivedStateFromError!="function"?null:h.render();return o.flags|=1,i!==null&&v?(o.child=Bo(o,i.child,null,T),o.child=Bo(o,null,F,T)):_n(i,o,F,T),o.memoizedState=h.state,E&&K_(o,c,!0),o.child}function Yx(i){var o=i.stateNode;o.pendingContext?G_(i,o.pendingContext,o.pendingContext!==o.context):o.context&&G_(i,o.context,!1),bm(i,o.containerInfo)}function Wx(i,o,c,h,E){return Fo(),hm(E),o.flags|=256,_n(i,o,c,h),o.child}var Bm={dehydrated:null,treeContext:null,retryLane:0};function Um(i){return{baseLanes:i,cachePool:null,transitions:null}}function Gx(i,o,c){var h=o.pendingProps,E=It.current,T=!1,v=(o.flags&128)!==0,F;if((F=v)||(F=i!==null&&i.memoizedState===null?!1:(E&2)!==0),F?(T=!0,o.flags&=-129):(i===null||i.memoizedState!==null)&&(E|=1),wt(It,E&1),i===null)return fm(o),i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((o.mode&1)===0?o.lanes=1:i.data==="$!"?o.lanes=8:o.lanes=1073741824,null):(v=h.children,i=h.fallback,T?(h=o.mode,T=o.child,v={mode:"hidden",children:v},(h&1)===0&&T!==null?(T.childLanes=0,T.pendingProps=v):T=ud(v,h,0,null),i=Is(i,h,c,null),T.return=o,i.return=o,T.sibling=i,o.child=T,o.child.memoizedState=Um(c),o.memoizedState=Bm,i):Hm(o,v));if(E=i.memoizedState,E!==null&&(F=E.dehydrated,F!==null))return N7(i,o,v,h,F,E,c);if(T){T=h.fallback,v=o.mode,E=i.child,F=E.sibling;var $={mode:"hidden",children:h.children};return(v&1)===0&&o.child!==E?(h=o.child,h.childLanes=0,h.pendingProps=$,o.deletions=null):(h=Hi(E,$),h.subtreeFlags=E.subtreeFlags&14680064),F!==null?T=Hi(F,T):(T=Is(T,v,c,null),T.flags|=2),T.return=o,h.return=o,h.sibling=T,o.child=h,h=T,T=o.child,v=i.child.memoizedState,v=v===null?Um(c):{baseLanes:v.baseLanes|c,cachePool:null,transitions:v.transitions},T.memoizedState=v,T.childLanes=i.childLanes&~c,o.memoizedState=Bm,h}return T=i.child,i=T.sibling,h=Hi(T,{mode:"visible",children:h.children}),(o.mode&1)===0&&(h.lanes=c),h.return=o,h.sibling=null,i!==null&&(c=o.deletions,c===null?(o.deletions=[i],o.flags|=16):c.push(i)),o.child=h,o.memoizedState=null,h}function Hm(i,o){return o=ud({mode:"visible",children:o},i.mode,0,null),o.return=i,i.child=o}function Xc(i,o,c,h){return h!==null&&hm(h),Bo(o,i.child,null,c),i=Hm(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function N7(i,o,c,h,E,T,v){if(c)return o.flags&256?(o.flags&=-257,h=Lm(Error(n(422))),Xc(i,o,v,h)):o.memoizedState!==null?(o.child=i.child,o.flags|=128,null):(T=h.fallback,E=o.mode,h=ud({mode:"visible",children:h.children},E,0,null),T=Is(T,E,v,null),T.flags|=2,h.return=o,T.return=o,h.sibling=T,o.child=h,(o.mode&1)!==0&&Bo(o,i.child,null,v),o.child.memoizedState=Um(v),o.memoizedState=Bm,T);if((o.mode&1)===0)return Xc(i,o,v,null);if(E.data==="$!"){if(h=E.nextSibling&&E.nextSibling.dataset,h)var F=h.dgst;return h=F,T=Error(n(419)),h=Lm(T,h,void 0),Xc(i,o,v,h)}if(F=(v&i.childLanes)!==0,Fn||F){if(h=tn,h!==null){switch(v&-v){case 4:E=2;break;case 16:E=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:E=32;break;case 536870912:E=268435456;break;default:E=0}E=(E&(h.suspendedLanes|v))!==0?0:E,E!==0&&E!==T.retryLane&&(T.retryLane=E,ii(i,E),wr(h,i,E,-1))}return n0(),h=Lm(Error(n(421))),Xc(i,o,v,h)}return E.data==="$?"?(o.flags|=128,o.child=i.child,o=z7.bind(null,i),E._reactRetry=o,null):(i=T.treeContext,Wn=Ni(E.nextSibling),Yn=o,Nt=!0,Er=null,i!==null&&(Zn[er++]=ni,Zn[er++]=ri,Zn[er++]=_s,ni=i.id,ri=i.overflow,_s=o),o=Hm(o,h.children),o.flags|=4096,o)}function Xx(i,o,c){i.lanes|=o;var h=i.alternate;h!==null&&(h.lanes|=o),Em(i.return,o,c)}function jm(i,o,c,h,E){var T=i.memoizedState;T===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:E}:(T.isBackwards=o,T.rendering=null,T.renderingStartTime=0,T.last=h,T.tail=c,T.tailMode=E)}function Kx(i,o,c){var h=o.pendingProps,E=h.revealOrder,T=h.tail;if(_n(i,o,h.children,c),h=It.current,(h&2)!==0)h=h&1|2,o.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Xx(i,c,o);else if(i.tag===19)Xx(i,c,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}h&=1}if(wt(It,h),(o.mode&1)===0)o.memoizedState=null;else switch(E){case"forwards":for(c=o.child,E=null;c!==null;)i=c.alternate,i!==null&&zc(i)===null&&(E=c),c=c.sibling;c=E,c===null?(E=o.child,o.child=null):(E=c.sibling,c.sibling=null),jm(o,!1,E,c,T);break;case"backwards":for(c=null,E=o.child,o.child=null;E!==null;){if(i=E.alternate,i!==null&&zc(i)===null){o.child=E;break}i=E.sibling,E.sibling=c,c=E,E=i}jm(o,!0,c,null,T);break;case"together":jm(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function Kc(i,o){(o.mode&1)===0&&i!==null&&(i.alternate=null,o.alternate=null,o.flags|=2)}function oi(i,o,c){if(i!==null&&(o.dependencies=i.dependencies),ks|=o.lanes,(c&o.childLanes)===0)return null;if(i!==null&&o.child!==i.child)throw Error(n(153));if(o.child!==null){for(i=o.child,c=Hi(i,i.pendingProps),o.child=c,c.return=o;i.sibling!==null;)i=i.sibling,c=c.sibling=Hi(i,i.pendingProps),c.return=o;c.sibling=null}return o.child}function O7(i,o,c){switch(o.tag){case 3:Yx(o),Fo();break;case 5:cx(o);break;case 1:Mn(o.type)&&Pc(o);break;case 4:bm(o,o.stateNode.containerInfo);break;case 10:var h=o.type._context,E=o.memoizedProps.value;wt(Bc,h._currentValue),h._currentValue=E;break;case 13:if(h=o.memoizedState,h!==null)return h.dehydrated!==null?(wt(It,It.current&1),o.flags|=128,null):(c&o.child.childLanes)!==0?Gx(i,o,c):(wt(It,It.current&1),i=oi(i,o,c),i!==null?i.sibling:null);wt(It,It.current&1);break;case 19:if(h=(c&o.childLanes)!==0,(i.flags&128)!==0){if(h)return Kx(i,o,c);o.flags|=128}if(E=o.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),wt(It,It.current),h)break;return null;case 22:case 23:return o.lanes=0,$x(i,o,c)}return oi(i,o,c)}var Qx,zm,Jx,Zx;Qx=function(i,o){for(var c=o.child;c!==null;){if(c.tag===5||c.tag===6)i.appendChild(c.stateNode);else if(c.tag!==4&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return;c=c.return}c.sibling.return=c.return,c=c.sibling}},zm=function(){},Jx=function(i,o,c,h){var E=i.memoizedProps;if(E!==h){i=o.stateNode,vs(Ur.current);var T=null;switch(c){case"input":E=wn(i,E),h=wn(i,h),T=[];break;case"select":E=k({},E,{value:void 0}),h=k({},h,{value:void 0}),T=[];break;case"textarea":E=Ln(i,E),h=Ln(i,h),T=[];break;default:typeof E.onClick!="function"&&typeof h.onClick=="function"&&(i.onclick=Nc)}Le(c,h);var v;c=null;for(ee in E)if(!h.hasOwnProperty(ee)&&E.hasOwnProperty(ee)&&E[ee]!=null)if(ee==="style"){var F=E[ee];for(v in F)F.hasOwnProperty(v)&&(c||(c={}),c[v]="")}else ee!=="dangerouslySetInnerHTML"&&ee!=="children"&&ee!=="suppressContentEditableWarning"&&ee!=="suppressHydrationWarning"&&ee!=="autoFocus"&&(s.hasOwnProperty(ee)?T||(T=[]):(T=T||[]).push(ee,null));for(ee in h){var $=h[ee];if(F=E!=null?E[ee]:void 0,h.hasOwnProperty(ee)&&$!==F&&($!=null||F!=null))if(ee==="style")if(F){for(v in F)!F.hasOwnProperty(v)||$&&$.hasOwnProperty(v)||(c||(c={}),c[v]="");for(v in $)$.hasOwnProperty(v)&&F[v]!==$[v]&&(c||(c={}),c[v]=$[v])}else c||(T||(T=[]),T.push(ee,c)),c=$;else ee==="dangerouslySetInnerHTML"?($=$?$.__html:void 0,F=F?F.__html:void 0,$!=null&&F!==$&&(T=T||[]).push(ee,$)):ee==="children"?typeof $!="string"&&typeof $!="number"||(T=T||[]).push(ee,""+$):ee!=="suppressContentEditableWarning"&&ee!=="suppressHydrationWarning"&&(s.hasOwnProperty(ee)?($!=null&&ee==="onScroll"&&vt("scroll",i),T||F===$||(T=[])):(T=T||[]).push(ee,$))}c&&(T=T||[]).push("style",c);var ee=T;(o.updateQueue=ee)&&(o.flags|=4)}},Zx=function(i,o,c,h){c!==h&&(o.flags|=4)};function wu(i,o){if(!Nt)switch(i.tailMode){case"hidden":o=i.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:h.sibling=null}}function En(i){var o=i.alternate!==null&&i.alternate.child===i.child,c=0,h=0;if(o)for(var E=i.child;E!==null;)c|=E.lanes|E.childLanes,h|=E.subtreeFlags&14680064,h|=E.flags&14680064,E.return=i,E=E.sibling;else for(E=i.child;E!==null;)c|=E.lanes|E.childLanes,h|=E.subtreeFlags,h|=E.flags,E.return=i,E=E.sibling;return i.subtreeFlags|=h,i.childLanes=c,o}function I7(i,o,c){var h=o.pendingProps;switch(cm(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return En(o),null;case 1:return Mn(o.type)&&Ic(),En(o),null;case 3:return h=o.stateNode,jo(),At(Dn),At(mn),xm(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(i===null||i.child===null)&&(Mc(o)?o.flags|=4:i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Er!==null&&(Zm(Er),Er=null))),zm(i,o),En(o),null;case 5:wm(o);var E=vs(gu.current);if(c=o.type,i!==null&&o.stateNode!=null)Jx(i,o,c,h,E),i.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!h){if(o.stateNode===null)throw Error(n(166));return En(o),null}if(i=vs(Ur.current),Mc(o)){h=o.stateNode,c=o.type;var T=o.memoizedProps;switch(h[Br]=o,h[du]=T,i=(o.mode&1)!==0,c){case"dialog":vt("cancel",h),vt("close",h);break;case"iframe":case"object":case"embed":vt("load",h);break;case"video":case"audio":for(E=0;E<uu.length;E++)vt(uu[E],h);break;case"source":vt("error",h);break;case"img":case"image":case"link":vt("error",h),vt("load",h);break;case"details":vt("toggle",h);break;case"input":Dt(h,T),vt("invalid",h);break;case"select":h._wrapperState={wasMultiple:!!T.multiple},vt("invalid",h);break;case"textarea":gs(h,T),vt("invalid",h)}Le(c,T),E=null;for(var v in T)if(T.hasOwnProperty(v)){var F=T[v];v==="children"?typeof F=="string"?h.textContent!==F&&(T.suppressHydrationWarning!==!0&&Cc(h.textContent,F,i),E=["children",F]):typeof F=="number"&&h.textContent!==""+F&&(T.suppressHydrationWarning!==!0&&Cc(h.textContent,F,i),E=["children",""+F]):s.hasOwnProperty(v)&&F!=null&&v==="onScroll"&&vt("scroll",h)}switch(c){case"input":mt(h),Xe(h,T,!0);break;case"textarea":mt(h),ys(h);break;case"select":case"option":break;default:typeof T.onClick=="function"&&(h.onclick=Nc)}h=E,o.updateQueue=h,h!==null&&(o.flags|=4)}else{v=E.nodeType===9?E:E.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=ae(c)),i==="http://www.w3.org/1999/xhtml"?c==="script"?(i=v.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof h.is=="string"?i=v.createElement(c,{is:h.is}):(i=v.createElement(c),c==="select"&&(v=i,h.multiple?v.multiple=!0:h.size&&(v.size=h.size))):i=v.createElementNS(i,c),i[Br]=o,i[du]=h,Qx(i,o,!1,!1),o.stateNode=i;e:{switch(v=tt(c,h),c){case"dialog":vt("cancel",i),vt("close",i),E=h;break;case"iframe":case"object":case"embed":vt("load",i),E=h;break;case"video":case"audio":for(E=0;E<uu.length;E++)vt(uu[E],i);E=h;break;case"source":vt("error",i),E=h;break;case"img":case"image":case"link":vt("error",i),vt("load",i),E=h;break;case"details":vt("toggle",i),E=h;break;case"input":Dt(i,h),E=wn(i,h),vt("invalid",i);break;case"option":E=h;break;case"select":i._wrapperState={wasMultiple:!!h.multiple},E=k({},h,{value:void 0}),vt("invalid",i);break;case"textarea":gs(i,h),E=Ln(i,h),vt("invalid",i);break;default:E=h}Le(c,E),F=E;for(T in F)if(F.hasOwnProperty(T)){var $=F[T];T==="style"?Ne(i,$):T==="dangerouslySetInnerHTML"?($=$?$.__html:void 0,$!=null&&Ze(i,$)):T==="children"?typeof $=="string"?(c!=="textarea"||$!=="")&&at(i,$):typeof $=="number"&&at(i,""+$):T!=="suppressContentEditableWarning"&&T!=="suppressHydrationWarning"&&T!=="autoFocus"&&(s.hasOwnProperty(T)?$!=null&&T==="onScroll"&&vt("scroll",i):$!=null&&O(i,T,$,v))}switch(c){case"input":mt(i),Xe(i,h,!1);break;case"textarea":mt(i),ys(i);break;case"option":h.value!=null&&i.setAttribute("value",""+Fe(h.value));break;case"select":i.multiple=!!h.multiple,T=h.value,T!=null?Mt(i,!!h.multiple,T,!1):h.defaultValue!=null&&Mt(i,!!h.multiple,h.defaultValue,!0);break;default:typeof E.onClick=="function"&&(i.onclick=Nc)}switch(c){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}}h&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return En(o),null;case 6:if(i&&o.stateNode!=null)Zx(i,o,i.memoizedProps,h);else{if(typeof h!="string"&&o.stateNode===null)throw Error(n(166));if(c=vs(gu.current),vs(Ur.current),Mc(o)){if(h=o.stateNode,c=o.memoizedProps,h[Br]=o,(T=h.nodeValue!==c)&&(i=Yn,i!==null))switch(i.tag){case 3:Cc(h.nodeValue,c,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&Cc(h.nodeValue,c,(i.mode&1)!==0)}T&&(o.flags|=4)}else h=(c.nodeType===9?c:c.ownerDocument).createTextNode(h),h[Br]=o,o.stateNode=h}return En(o),null;case 13:if(At(It),h=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Nt&&Wn!==null&&(o.mode&1)!==0&&(o.flags&128)===0)nx(),Fo(),o.flags|=98560,T=!1;else if(T=Mc(o),h!==null&&h.dehydrated!==null){if(i===null){if(!T)throw Error(n(318));if(T=o.memoizedState,T=T!==null?T.dehydrated:null,!T)throw Error(n(317));T[Br]=o}else Fo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;En(o),T=!1}else Er!==null&&(Zm(Er),Er=null),T=!0;if(!T)return o.flags&65536?o:null}return(o.flags&128)!==0?(o.lanes=c,o):(h=h!==null,h!==(i!==null&&i.memoizedState!==null)&&h&&(o.child.flags|=8192,(o.mode&1)!==0&&(i===null||(It.current&1)!==0?Xt===0&&(Xt=3):n0())),o.updateQueue!==null&&(o.flags|=4),En(o),null);case 4:return jo(),zm(i,o),i===null&&lu(o.stateNode.containerInfo),En(o),null;case 10:return gm(o.type._context),En(o),null;case 17:return Mn(o.type)&&Ic(),En(o),null;case 19:if(At(It),T=o.memoizedState,T===null)return En(o),null;if(h=(o.flags&128)!==0,v=T.rendering,v===null)if(h)wu(T,!1);else{if(Xt!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(v=zc(i),v!==null){for(o.flags|=128,wu(T,!1),h=v.updateQueue,h!==null&&(o.updateQueue=h,o.flags|=4),o.subtreeFlags=0,h=c,c=o.child;c!==null;)T=c,i=h,T.flags&=14680066,v=T.alternate,v===null?(T.childLanes=0,T.lanes=i,T.child=null,T.subtreeFlags=0,T.memoizedProps=null,T.memoizedState=null,T.updateQueue=null,T.dependencies=null,T.stateNode=null):(T.childLanes=v.childLanes,T.lanes=v.lanes,T.child=v.child,T.subtreeFlags=0,T.deletions=null,T.memoizedProps=v.memoizedProps,T.memoizedState=v.memoizedState,T.updateQueue=v.updateQueue,T.type=v.type,i=v.dependencies,T.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),c=c.sibling;return wt(It,It.current&1|2),o.child}i=i.sibling}T.tail!==null&&Ht()>qo&&(o.flags|=128,h=!0,wu(T,!1),o.lanes=4194304)}else{if(!h)if(i=zc(v),i!==null){if(o.flags|=128,h=!0,c=i.updateQueue,c!==null&&(o.updateQueue=c,o.flags|=4),wu(T,!0),T.tail===null&&T.tailMode==="hidden"&&!v.alternate&&!Nt)return En(o),null}else 2*Ht()-T.renderingStartTime>qo&&c!==1073741824&&(o.flags|=128,h=!0,wu(T,!1),o.lanes=4194304);T.isBackwards?(v.sibling=o.child,o.child=v):(c=T.last,c!==null?c.sibling=v:o.child=v,T.last=v)}return T.tail!==null?(o=T.tail,T.rendering=o,T.tail=o.sibling,T.renderingStartTime=Ht(),o.sibling=null,c=It.current,wt(It,h?c&1|2:c&1),o):(En(o),null);case 22:case 23:return t0(),h=o.memoizedState!==null,i!==null&&i.memoizedState!==null!==h&&(o.flags|=8192),h&&(o.mode&1)!==0?(Gn&1073741824)!==0&&(En(o),o.subtreeFlags&6&&(o.flags|=8192)):En(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function P7(i,o){switch(cm(o),o.tag){case 1:return Mn(o.type)&&Ic(),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return jo(),At(Dn),At(mn),xm(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 5:return wm(o),null;case 13:if(At(It),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(n(340));Fo()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return At(It),null;case 4:return jo(),null;case 10:return gm(o.type._context),null;case 22:case 23:return t0(),null;case 24:return null;default:return null}}var Qc=!1,yn=!1,R7=typeof WeakSet=="function"?WeakSet:Set,Re=null;function $o(i,o){var c=i.ref;if(c!==null)if(typeof c=="function")try{c(null)}catch(h){Ft(i,o,h)}else c.current=null}function $m(i,o,c){try{c()}catch(h){Ft(i,o,h)}}var e2=!1;function L7(i,o){if(tm=Ec,i=P_(),Wp(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var h=c.getSelection&&c.getSelection();if(h&&h.rangeCount!==0){c=h.anchorNode;var E=h.anchorOffset,T=h.focusNode;h=h.focusOffset;try{c.nodeType,T.nodeType}catch(we){c=null;break e}var v=0,F=-1,$=-1,ee=0,ge=0,Te=i,pe=null;t:for(;;){for(var Pe;Te!==c||E!==0&&Te.nodeType!==3||(F=v+E),Te!==T||h!==0&&Te.nodeType!==3||($=v+h),Te.nodeType===3&&(v+=Te.nodeValue.length),(Pe=Te.firstChild)!==null;)pe=Te,Te=Pe;for(;;){if(Te===i)break t;if(pe===c&&++ee===E&&(F=v),pe===T&&++ge===h&&($=v),(Pe=Te.nextSibling)!==null)break;Te=pe,pe=Te.parentNode}Te=Pe}c=F===-1||$===-1?null:{start:F,end:$}}else c=null}c=c||{start:0,end:0}}else c=null;for(nm={focusedElem:i,selectionRange:c},Ec=!1,Re=o;Re!==null;)if(o=Re,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,Re=i;else for(;Re!==null;){o=Re;try{var De=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(De!==null){var Me=De.memoizedProps,jt=De.memoizedState,X=o.stateNode,q=X.getSnapshotBeforeUpdate(o.elementType===o.type?Me:yr(o.type,Me),jt);X.__reactInternalSnapshotBeforeUpdate=q}break;case 3:var Q=o.stateNode.containerInfo;Q.nodeType===1?Q.textContent="":Q.nodeType===9&&Q.documentElement&&Q.removeChild(Q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(we){Ft(o,o.return,we)}if(i=o.sibling,i!==null){i.return=o.return,Re=i;break}Re=o.return}return De=e2,e2=!1,De}function _u(i,o,c){var h=o.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var E=h=h.next;do{if((E.tag&i)===i){var T=E.destroy;E.destroy=void 0,T!==void 0&&$m(o,c,T)}E=E.next}while(E!==h)}}function Jc(i,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var c=o=o.next;do{if((c.tag&i)===i){var h=c.create;c.destroy=h()}c=c.next}while(c!==o)}}function Vm(i){var o=i.ref;if(o!==null){var c=i.stateNode;i.tag,i=c,typeof o=="function"?o(i):o.current=i}}function t2(i){var o=i.alternate;o!==null&&(i.alternate=null,t2(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&(delete o[Br],delete o[du],delete o[om],delete o[g7],delete o[E7])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function n2(i){return i.tag===5||i.tag===3||i.tag===4}function r2(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||n2(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function qm(i,o,c){var h=i.tag;if(h===5||h===6)i=i.stateNode,o?c.nodeType===8?c.parentNode.insertBefore(i,o):c.insertBefore(i,o):(c.nodeType===8?(o=c.parentNode,o.insertBefore(i,c)):(o=c,o.appendChild(i)),c=c._reactRootContainer,c!=null||o.onclick!==null||(o.onclick=Nc));else if(h!==4&&(i=i.child,i!==null))for(qm(i,o,c),i=i.sibling;i!==null;)qm(i,o,c),i=i.sibling}function Ym(i,o,c){var h=i.tag;if(h===5||h===6)i=i.stateNode,o?c.insertBefore(i,o):c.appendChild(i);else if(h!==4&&(i=i.child,i!==null))for(Ym(i,o,c),i=i.sibling;i!==null;)Ym(i,o,c),i=i.sibling}var on=null,Tr=!1;function Di(i,o,c){for(c=c.child;c!==null;)i2(i,o,c),c=c.sibling}function i2(i,o,c){if(Fr&&typeof Fr.onCommitFiberUnmount=="function")try{Fr.onCommitFiberUnmount(dc,c)}catch(F){}switch(c.tag){case 5:yn||$o(c,o);case 6:var h=on,E=Tr;on=null,Di(i,o,c),on=h,Tr=E,on!==null&&(Tr?(i=on,c=c.stateNode,i.nodeType===8?i.parentNode.removeChild(c):i.removeChild(c)):on.removeChild(c.stateNode));break;case 18:on!==null&&(Tr?(i=on,c=c.stateNode,i.nodeType===8?sm(i.parentNode,c):i.nodeType===1&&sm(i,c),eu(i)):sm(on,c.stateNode));break;case 4:h=on,E=Tr,on=c.stateNode.containerInfo,Tr=!0,Di(i,o,c),on=h,Tr=E;break;case 0:case 11:case 14:case 15:if(!yn&&(h=c.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){E=h=h.next;do{var T=E,v=T.destroy;T=T.tag,v!==void 0&&((T&2)!==0||(T&4)!==0)&&$m(c,o,v),E=E.next}while(E!==h)}Di(i,o,c);break;case 1:if(!yn&&($o(c,o),h=c.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=c.memoizedProps,h.state=c.memoizedState,h.componentWillUnmount()}catch(F){Ft(c,o,F)}Di(i,o,c);break;case 21:Di(i,o,c);break;case 22:c.mode&1?(yn=(h=yn)||c.memoizedState!==null,Di(i,o,c),yn=h):Di(i,o,c);break;default:Di(i,o,c)}}function s2(i){var o=i.updateQueue;if(o!==null){i.updateQueue=null;var c=i.stateNode;c===null&&(c=i.stateNode=new R7),o.forEach(function(h){var E=$7.bind(null,i,h);c.has(h)||(c.add(h),h.then(E,E))})}}function br(i,o){var c=o.deletions;if(c!==null)for(var h=0;h<c.length;h++){var E=c[h];try{var T=i,v=o,F=v;e:for(;F!==null;){switch(F.tag){case 5:on=F.stateNode,Tr=!1;break e;case 3:on=F.stateNode.containerInfo,Tr=!0;break e;case 4:on=F.stateNode.containerInfo,Tr=!0;break e}F=F.return}if(on===null)throw Error(n(160));i2(T,v,E),on=null,Tr=!1;var $=E.alternate;$!==null&&($.return=null),E.return=null}catch(ee){Ft(E,o,ee)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)o2(o,i),o=o.sibling}function o2(i,o){var c=i.alternate,h=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(br(o,i),jr(i),h&4){try{_u(3,i,i.return),Jc(3,i)}catch(Me){Ft(i,i.return,Me)}try{_u(5,i,i.return)}catch(Me){Ft(i,i.return,Me)}}break;case 1:br(o,i),jr(i),h&512&&c!==null&&$o(c,c.return);break;case 5:if(br(o,i),jr(i),h&512&&c!==null&&$o(c,c.return),i.flags&32){var E=i.stateNode;try{at(E,"")}catch(Me){Ft(i,i.return,Me)}}if(h&4&&(E=i.stateNode,E!=null)){var T=i.memoizedProps,v=c!==null?c.memoizedProps:T,F=i.type,$=i.updateQueue;if(i.updateQueue=null,$!==null)try{F==="input"&&T.type==="radio"&&T.name!=null&&ze(E,T),tt(F,v);var ee=tt(F,T);for(v=0;v<$.length;v+=2){var ge=$[v],Te=$[v+1];ge==="style"?Ne(E,Te):ge==="dangerouslySetInnerHTML"?Ze(E,Te):ge==="children"?at(E,Te):O(E,ge,Te,ee)}switch(F){case"input":Ce(E,T);break;case"textarea":Es(E,T);break;case"select":var pe=E._wrapperState.wasMultiple;E._wrapperState.wasMultiple=!!T.multiple;var Pe=T.value;Pe!=null?Mt(E,!!T.multiple,Pe,!1):pe!==!!T.multiple&&(T.defaultValue!=null?Mt(E,!!T.multiple,T.defaultValue,!0):Mt(E,!!T.multiple,T.multiple?[]:"",!1))}E[du]=T}catch(Me){Ft(i,i.return,Me)}}break;case 6:if(br(o,i),jr(i),h&4){if(i.stateNode===null)throw Error(n(162));E=i.stateNode,T=i.memoizedProps;try{E.nodeValue=T}catch(Me){Ft(i,i.return,Me)}}break;case 3:if(br(o,i),jr(i),h&4&&c!==null&&c.memoizedState.isDehydrated)try{eu(o.containerInfo)}catch(Me){Ft(i,i.return,Me)}break;case 4:br(o,i),jr(i);break;case 13:br(o,i),jr(i),E=i.child,E.flags&8192&&(T=E.memoizedState!==null,E.stateNode.isHidden=T,!T||E.alternate!==null&&E.alternate.memoizedState!==null||(Xm=Ht())),h&4&&s2(i);break;case 22:if(ge=c!==null&&c.memoizedState!==null,i.mode&1?(yn=(ee=yn)||ge,br(o,i),yn=ee):br(o,i),jr(i),h&8192){if(ee=i.memoizedState!==null,(i.stateNode.isHidden=ee)&&!ge&&(i.mode&1)!==0)for(Re=i,ge=i.child;ge!==null;){for(Te=Re=ge;Re!==null;){switch(pe=Re,Pe=pe.child,pe.tag){case 0:case 11:case 14:case 15:_u(4,pe,pe.return);break;case 1:$o(pe,pe.return);var De=pe.stateNode;if(typeof De.componentWillUnmount=="function"){h=pe,c=pe.return;try{o=h,De.props=o.memoizedProps,De.state=o.memoizedState,De.componentWillUnmount()}catch(Me){Ft(h,c,Me)}}break;case 5:$o(pe,pe.return);break;case 22:if(pe.memoizedState!==null){l2(Te);continue}}Pe!==null?(Pe.return=pe,Re=Pe):l2(Te)}ge=ge.sibling}e:for(ge=null,Te=i;;){if(Te.tag===5){if(ge===null){ge=Te;try{E=Te.stateNode,ee?(T=E.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none"):(F=Te.stateNode,$=Te.memoizedProps.style,v=$!=null&&$.hasOwnProperty("display")?$.display:null,F.style.display=ke("display",v))}catch(Me){Ft(i,i.return,Me)}}}else if(Te.tag===6){if(ge===null)try{Te.stateNode.nodeValue=ee?"":Te.memoizedProps}catch(Me){Ft(i,i.return,Me)}}else if((Te.tag!==22&&Te.tag!==23||Te.memoizedState===null||Te===i)&&Te.child!==null){Te.child.return=Te,Te=Te.child;continue}if(Te===i)break e;for(;Te.sibling===null;){if(Te.return===null||Te.return===i)break e;ge===Te&&(ge=null),Te=Te.return}ge===Te&&(ge=null),Te.sibling.return=Te.return,Te=Te.sibling}}break;case 19:br(o,i),jr(i),h&4&&s2(i);break;case 21:break;default:br(o,i),jr(i)}}function jr(i){var o=i.flags;if(o&2){try{e:{for(var c=i.return;c!==null;){if(n2(c)){var h=c;break e}c=c.return}throw Error(n(160))}switch(h.tag){case 5:var E=h.stateNode;h.flags&32&&(at(E,""),h.flags&=-33);var T=r2(i);Ym(i,T,E);break;case 3:case 4:var v=h.stateNode.containerInfo,F=r2(i);qm(i,F,v);break;default:throw Error(n(161))}}catch($){Ft(i,i.return,$)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function D7(i,o,c){Re=i,a2(i)}function a2(i,o,c){for(var h=(i.mode&1)!==0;Re!==null;){var E=Re,T=E.child;if(E.tag===22&&h){var v=E.memoizedState!==null||Qc;if(!v){var F=E.alternate,$=F!==null&&F.memoizedState!==null||yn;F=Qc;var ee=yn;if(Qc=v,(yn=$)&&!ee)for(Re=E;Re!==null;)v=Re,$=v.child,v.tag===22&&v.memoizedState!==null?c2(E):$!==null?($.return=v,Re=$):c2(E);for(;T!==null;)Re=T,a2(T),T=T.sibling;Re=E,Qc=F,yn=ee}u2(i)}else(E.subtreeFlags&8772)!==0&&T!==null?(T.return=E,Re=T):u2(i)}}function u2(i){for(;Re!==null;){var o=Re;if((o.flags&8772)!==0){var c=o.alternate;try{if((o.flags&8772)!==0)switch(o.tag){case 0:case 11:case 15:yn||Jc(5,o);break;case 1:var h=o.stateNode;if(o.flags&4&&!yn)if(c===null)h.componentDidMount();else{var E=o.elementType===o.type?c.memoizedProps:yr(o.type,c.memoizedProps);h.componentDidUpdate(E,c.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var T=o.updateQueue;T!==null&&lx(o,T,h);break;case 3:var v=o.updateQueue;if(v!==null){if(c=null,o.child!==null)switch(o.child.tag){case 5:c=o.child.stateNode;break;case 1:c=o.child.stateNode}lx(o,v,c)}break;case 5:var F=o.stateNode;if(c===null&&o.flags&4){c=F;var $=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":$.autoFocus&&c.focus();break;case"img":$.src&&(c.src=$.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var ee=o.alternate;if(ee!==null){var ge=ee.memoizedState;if(ge!==null){var Te=ge.dehydrated;Te!==null&&eu(Te)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}yn||o.flags&512&&Vm(o)}catch(pe){Ft(o,o.return,pe)}}if(o===i){Re=null;break}if(c=o.sibling,c!==null){c.return=o.return,Re=c;break}Re=o.return}}function l2(i){for(;Re!==null;){var o=Re;if(o===i){Re=null;break}var c=o.sibling;if(c!==null){c.return=o.return,Re=c;break}Re=o.return}}function c2(i){for(;Re!==null;){var o=Re;try{switch(o.tag){case 0:case 11:case 15:var c=o.return;try{Jc(4,o)}catch($){Ft(o,c,$)}break;case 1:var h=o.stateNode;if(typeof h.componentDidMount=="function"){var E=o.return;try{h.componentDidMount()}catch($){Ft(o,E,$)}}var T=o.return;try{Vm(o)}catch($){Ft(o,T,$)}break;case 5:var v=o.return;try{Vm(o)}catch($){Ft(o,v,$)}}}catch($){Ft(o,o.return,$)}if(o===i){Re=null;break}var F=o.sibling;if(F!==null){F.return=o.return,Re=F;break}Re=o.return}}var M7=Math.ceil,Zc=z.ReactCurrentDispatcher,Wm=z.ReactCurrentOwner,rr=z.ReactCurrentBatchConfig,lt=0,tn=null,Vt=null,an=0,Gn=0,Vo=Oi(0),Xt=0,xu=null,ks=0,ed=0,Gm=0,Su=null,Bn=null,Xm=0,qo=1/0,ai=null,td=!1,Km=null,Mi=null,nd=!1,Fi=null,rd=0,vu=0,Qm=null,id=-1,sd=0;function xn(){return(lt&6)!==0?Ht():id!==-1?id:id=Ht()}function Bi(i){return(i.mode&1)===0?1:(lt&2)!==0&&an!==0?an&-an:T7.transition!==null?(sd===0&&(sd=r_()),sd):(i=gt,i!==0||(i=window.event,i=i===void 0?16:f_(i.type)),i)}function wr(i,o,c,h){if(50<vu)throw vu=0,Qm=null,Error(n(185));Xa(i,c,h),((lt&2)===0||i!==tn)&&(i===tn&&((lt&2)===0&&(ed|=c),Xt===4&&Ui(i,an)),Un(i,h),c===1&&lt===0&&(o.mode&1)===0&&(qo=Ht()+500,Rc&&Pi()))}function Un(i,o){var c=i.callbackNode;TB(i,o);var h=pc(i,i===tn?an:0);if(h===0)c!==null&&e_(c),i.callbackNode=null,i.callbackPriority=0;else if(o=h&-h,i.callbackPriority!==o){if(c!=null&&e_(c),o===1)i.tag===0?y7(f2.bind(null,i)):Q_(f2.bind(null,i)),p7(function(){(lt&6)===0&&Pi()}),c=null;else{switch(i_(h)){case 1:c=Op;break;case 4:c=t_;break;case 16:c=cc;break;case 536870912:c=n_;break;default:c=cc}c=b2(c,d2.bind(null,i))}i.callbackPriority=o,i.callbackNode=c}}function d2(i,o){if(id=-1,sd=0,(lt&6)!==0)throw Error(n(327));var c=i.callbackNode;if(Yo()&&i.callbackNode!==c)return null;var h=pc(i,i===tn?an:0);if(h===0)return null;if((h&30)!==0||(h&i.expiredLanes)!==0||o)o=od(i,h);else{o=h;var E=lt;lt|=2;var T=p2();(tn!==i||an!==o)&&(ai=null,qo=Ht()+500,Ns(i,o));do try{U7();break}catch(F){h2(i,F)}while(!0);mm(),Zc.current=T,lt=E,Vt!==null?o=0:(tn=null,an=0,o=Xt)}if(o!==0){if(o===2&&(E=Ip(i),E!==0&&(h=E,o=Jm(i,E))),o===1)throw c=xu,Ns(i,0),Ui(i,h),Un(i,Ht()),c;if(o===6)Ui(i,h);else{if(E=i.current.alternate,(h&30)===0&&!F7(E)&&(o=od(i,h),o===2&&(T=Ip(i),T!==0&&(h=T,o=Jm(i,T))),o===1))throw c=xu,Ns(i,0),Ui(i,h),Un(i,Ht()),c;switch(i.finishedWork=E,i.finishedLanes=h,o){case 0:case 1:throw Error(n(345));case 2:Os(i,Bn,ai);break;case 3:if(Ui(i,h),(h&130023424)===h&&(o=Xm+500-Ht(),10<o)){if(pc(i,0)!==0)break;if(E=i.suspendedLanes,(E&h)!==h){xn(),i.pingedLanes|=i.suspendedLanes&E;break}i.timeoutHandle=im(Os.bind(null,i,Bn,ai),o);break}Os(i,Bn,ai);break;case 4:if(Ui(i,h),(h&4194240)===h)break;for(o=i.eventTimes,E=-1;0<h;){var v=31-mr(h);T=1<<v,v=o[v],v>E&&(E=v),h&=~T}if(h=E,h=Ht()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*M7(h/1960))-h,10<h){i.timeoutHandle=im(Os.bind(null,i,Bn,ai),h);break}Os(i,Bn,ai);break;case 5:Os(i,Bn,ai);break;default:throw Error(n(329))}}}return Un(i,Ht()),i.callbackNode===c?d2.bind(null,i):null}function Jm(i,o){var c=Su;return i.current.memoizedState.isDehydrated&&(Ns(i,o).flags|=256),i=od(i,o),i!==2&&(o=Bn,Bn=c,o!==null&&Zm(o)),i}function Zm(i){Bn===null?Bn=i:Bn.push.apply(Bn,i)}function F7(i){for(var o=i;;){if(o.flags&16384){var c=o.updateQueue;if(c!==null&&(c=c.stores,c!==null))for(var h=0;h<c.length;h++){var E=c[h],T=E.getSnapshot;E=E.value;try{if(!gr(T(),E))return!1}catch(v){return!1}}}if(c=o.child,o.subtreeFlags&16384&&c!==null)c.return=o,o=c;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Ui(i,o){for(o&=~Gm,o&=~ed,i.suspendedLanes|=o,i.pingedLanes&=~o,i=i.expirationTimes;0<o;){var c=31-mr(o),h=1<<c;i[c]=-1,o&=~h}}function f2(i){if((lt&6)!==0)throw Error(n(327));Yo();var o=pc(i,0);if((o&1)===0)return Un(i,Ht()),null;var c=od(i,o);if(i.tag!==0&&c===2){var h=Ip(i);h!==0&&(o=h,c=Jm(i,h))}if(c===1)throw c=xu,Ns(i,0),Ui(i,o),Un(i,Ht()),c;if(c===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=o,Os(i,Bn,ai),Un(i,Ht()),null}function e0(i,o){var c=lt;lt|=1;try{return i(o)}finally{lt=c,lt===0&&(qo=Ht()+500,Rc&&Pi())}}function Cs(i){Fi!==null&&Fi.tag===0&&(lt&6)===0&&Yo();var o=lt;lt|=1;var c=rr.transition,h=gt;try{if(rr.transition=null,gt=1,i)return i()}finally{gt=h,rr.transition=c,lt=o,(lt&6)===0&&Pi()}}function t0(){Gn=Vo.current,At(Vo)}function Ns(i,o){i.finishedWork=null,i.finishedLanes=0;var c=i.timeoutHandle;if(c!==-1&&(i.timeoutHandle=-1,h7(c)),Vt!==null)for(c=Vt.return;c!==null;){var h=c;switch(cm(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&Ic();break;case 3:jo(),At(Dn),At(mn),xm();break;case 5:wm(h);break;case 4:jo();break;case 13:At(It);break;case 19:At(It);break;case 10:gm(h.type._context);break;case 22:case 23:t0()}c=c.return}if(tn=i,Vt=i=Hi(i.current,null),an=Gn=o,Xt=0,xu=null,Gm=ed=ks=0,Bn=Su=null,Ss!==null){for(o=0;o<Ss.length;o++)if(c=Ss[o],h=c.interleaved,h!==null){c.interleaved=null;var E=h.next,T=c.pending;if(T!==null){var v=T.next;T.next=E,h.next=v}c.pending=h}Ss=null}return i}function h2(i,o){do{var c=Vt;try{if(mm(),$c.current=Wc,Vc){for(var h=Pt.memoizedState;h!==null;){var E=h.queue;E!==null&&(E.pending=null),h=h.next}Vc=!1}if(As=0,en=Gt=Pt=null,Eu=!1,yu=0,Wm.current=null,c===null||c.return===null){Xt=1,xu=o,Vt=null;break}e:{var T=i,v=c.return,F=c,$=o;if(o=an,F.flags|=32768,$!==null&&typeof $=="object"&&typeof $.then=="function"){var ee=$,ge=F,Te=ge.tag;if((ge.mode&1)===0&&(Te===0||Te===11||Te===15)){var pe=ge.alternate;pe?(ge.updateQueue=pe.updateQueue,ge.memoizedState=pe.memoizedState,ge.lanes=pe.lanes):(ge.updateQueue=null,ge.memoizedState=null)}var Pe=Bx(v);if(Pe!==null){Pe.flags&=-257,Ux(Pe,v,F,T,o),Pe.mode&1&&Fx(T,ee,o),o=Pe,$=ee;var De=o.updateQueue;if(De===null){var Me=new Set;Me.add($),o.updateQueue=Me}else De.add($);break e}else{if((o&1)===0){Fx(T,ee,o),n0();break e}$=Error(n(426))}}else if(Nt&&F.mode&1){var jt=Bx(v);if(jt!==null){(jt.flags&65536)===0&&(jt.flags|=256),Ux(jt,v,F,T,o),hm(zo($,F));break e}}T=$=zo($,F),Xt!==4&&(Xt=2),Su===null?Su=[T]:Su.push(T),T=v;do{switch(T.tag){case 3:T.flags|=65536,o&=-o,T.lanes|=o;var X=Dx(T,$,o);ux(T,X);break e;case 1:F=$;var q=T.type,Q=T.stateNode;if((T.flags&128)===0&&(typeof q.getDerivedStateFromError=="function"||Q!==null&&typeof Q.componentDidCatch=="function"&&(Mi===null||!Mi.has(Q)))){T.flags|=65536,o&=-o,T.lanes|=o;var we=Mx(T,F,o);ux(T,we);break e}}T=T.return}while(T!==null)}g2(c)}catch(Ue){o=Ue,Vt===c&&c!==null&&(Vt=c=c.return);continue}break}while(!0)}function p2(){var i=Zc.current;return Zc.current=Wc,i===null?Wc:i}function n0(){(Xt===0||Xt===3||Xt===2)&&(Xt=4),tn===null||(ks&268435455)===0&&(ed&268435455)===0||Ui(tn,an)}function od(i,o){var c=lt;lt|=2;var h=p2();(tn!==i||an!==o)&&(ai=null,Ns(i,o));do try{B7();break}catch(E){h2(i,E)}while(!0);if(mm(),lt=c,Zc.current=h,Vt!==null)throw Error(n(261));return tn=null,an=0,Xt}function B7(){for(;Vt!==null;)m2(Vt)}function U7(){for(;Vt!==null&&!cB();)m2(Vt)}function m2(i){var o=T2(i.alternate,i,Gn);i.memoizedProps=i.pendingProps,o===null?g2(i):Vt=o,Wm.current=null}function g2(i){var o=i;do{var c=o.alternate;if(i=o.return,(o.flags&32768)===0){if(c=I7(c,o,Gn),c!==null){Vt=c;return}}else{if(c=P7(c,o),c!==null){c.flags&=32767,Vt=c;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{Xt=6,Vt=null;return}}if(o=o.sibling,o!==null){Vt=o;return}Vt=o=i}while(o!==null);Xt===0&&(Xt=5)}function Os(i,o,c){var h=gt,E=rr.transition;try{rr.transition=null,gt=1,H7(i,o,c,h)}finally{rr.transition=E,gt=h}return null}function H7(i,o,c,h){do Yo();while(Fi!==null);if((lt&6)!==0)throw Error(n(327));c=i.finishedWork;var E=i.finishedLanes;if(c===null)return null;if(i.finishedWork=null,i.finishedLanes=0,c===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var T=c.lanes|c.childLanes;if(bB(i,T),i===tn&&(Vt=tn=null,an=0),(c.subtreeFlags&2064)===0&&(c.flags&2064)===0||nd||(nd=!0,b2(cc,function(){return Yo(),null})),T=(c.flags&15990)!==0,(c.subtreeFlags&15990)!==0||T){T=rr.transition,rr.transition=null;var v=gt;gt=1;var F=lt;lt|=4,Wm.current=null,L7(i,c),o2(c,i),o7(nm),Ec=!!tm,nm=tm=null,i.current=c,D7(c),dB(),lt=F,gt=v,rr.transition=T}else i.current=c;if(nd&&(nd=!1,Fi=i,rd=E),T=i.pendingLanes,T===0&&(Mi=null),pB(c.stateNode),Un(i,Ht()),o!==null)for(h=i.onRecoverableError,c=0;c<o.length;c++)E=o[c],h(E.value,{componentStack:E.stack,digest:E.digest});if(td)throw td=!1,i=Km,Km=null,i;return(rd&1)!==0&&i.tag!==0&&Yo(),T=i.pendingLanes,(T&1)!==0?i===Qm?vu++:(vu=0,Qm=i):vu=0,Pi(),null}function Yo(){if(Fi!==null){var i=i_(rd),o=rr.transition,c=gt;try{if(rr.transition=null,gt=16>i?16:i,Fi===null)var h=!1;else{if(i=Fi,Fi=null,rd=0,(lt&6)!==0)throw Error(n(331));var E=lt;for(lt|=4,Re=i.current;Re!==null;){var T=Re,v=T.child;if((Re.flags&16)!==0){var F=T.deletions;if(F!==null){for(var $=0;$<F.length;$++){var ee=F[$];for(Re=ee;Re!==null;){var ge=Re;switch(ge.tag){case 0:case 11:case 15:_u(8,ge,T)}var Te=ge.child;if(Te!==null)Te.return=ge,Re=Te;else for(;Re!==null;){ge=Re;var pe=ge.sibling,Pe=ge.return;if(t2(ge),ge===ee){Re=null;break}if(pe!==null){pe.return=Pe,Re=pe;break}Re=Pe}}}var De=T.alternate;if(De!==null){var Me=De.child;if(Me!==null){De.child=null;do{var jt=Me.sibling;Me.sibling=null,Me=jt}while(Me!==null)}}Re=T}}if((T.subtreeFlags&2064)!==0&&v!==null)v.return=T,Re=v;else e:for(;Re!==null;){if(T=Re,(T.flags&2048)!==0)switch(T.tag){case 0:case 11:case 15:_u(9,T,T.return)}var X=T.sibling;if(X!==null){X.return=T.return,Re=X;break e}Re=T.return}}var q=i.current;for(Re=q;Re!==null;){v=Re;var Q=v.child;if((v.subtreeFlags&2064)!==0&&Q!==null)Q.return=v,Re=Q;else e:for(v=q;Re!==null;){if(F=Re,(F.flags&2048)!==0)try{switch(F.tag){case 0:case 11:case 15:Jc(9,F)}}catch(Ue){Ft(F,F.return,Ue)}if(F===v){Re=null;break e}var we=F.sibling;if(we!==null){we.return=F.return,Re=we;break e}Re=F.return}}if(lt=E,Pi(),Fr&&typeof Fr.onPostCommitFiberRoot=="function")try{Fr.onPostCommitFiberRoot(dc,i)}catch(Ue){}h=!0}return h}finally{gt=c,rr.transition=o}}return!1}function E2(i,o,c){o=zo(c,o),o=Dx(i,o,1),i=Li(i,o,1),o=xn(),i!==null&&(Xa(i,1,o),Un(i,o))}function Ft(i,o,c){if(i.tag===3)E2(i,i,c);else for(;o!==null;){if(o.tag===3){E2(o,i,c);break}else if(o.tag===1){var h=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Mi===null||!Mi.has(h))){i=zo(c,i),i=Mx(o,i,1),o=Li(o,i,1),i=xn(),o!==null&&(Xa(o,1,i),Un(o,i));break}}o=o.return}}function j7(i,o,c){var h=i.pingCache;h!==null&&h.delete(o),o=xn(),i.pingedLanes|=i.suspendedLanes&c,tn===i&&(an&c)===c&&(Xt===4||Xt===3&&(an&130023424)===an&&500>Ht()-Xm?Ns(i,0):Gm|=c),Un(i,o)}function y2(i,o){o===0&&((i.mode&1)===0?o=1:(o=hc,hc<<=1,(hc&130023424)===0&&(hc=4194304)));var c=xn();i=ii(i,o),i!==null&&(Xa(i,o,c),Un(i,c))}function z7(i){var o=i.memoizedState,c=0;o!==null&&(c=o.retryLane),y2(i,c)}function $7(i,o){var c=0;switch(i.tag){case 13:var h=i.stateNode,E=i.memoizedState;E!==null&&(c=E.retryLane);break;case 19:h=i.stateNode;break;default:throw Error(n(314))}h!==null&&h.delete(o),y2(i,c)}var T2;T2=function(i,o,c){if(i!==null)if(i.memoizedProps!==o.pendingProps||Dn.current)Fn=!0;else{if((i.lanes&c)===0&&(o.flags&128)===0)return Fn=!1,O7(i,o,c);Fn=(i.flags&131072)!==0}else Fn=!1,Nt&&(o.flags&1048576)!==0&&J_(o,Dc,o.index);switch(o.lanes=0,o.tag){case 2:var h=o.type;Kc(i,o),i=o.pendingProps;var E=Lo(o,mn.current);Ho(o,c),E=Am(null,o,h,i,E,c);var T=km();return o.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,Mn(h)?(T=!0,Pc(o)):T=!1,o.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,Tm(o),E.updater=Gc,o.stateNode=E,E._reactInternals=o,Rm(o,h,i,c),o=Fm(null,o,h,!0,T,c)):(o.tag=0,Nt&&T&&lm(o),_n(null,o,E,c),o=o.child),o;case 16:h=o.elementType;e:{switch(Kc(i,o),i=o.pendingProps,E=h._init,h=E(h._payload),o.type=h,E=o.tag=q7(h),i=yr(h,i),E){case 0:o=Mm(null,o,h,i,c);break e;case 1:o=qx(null,o,h,i,c);break e;case 11:o=Hx(null,o,h,i,c);break e;case 14:o=jx(null,o,h,yr(h.type,i),c);break e}throw Error(n(306,h,""))}return o;case 0:return h=o.type,E=o.pendingProps,E=o.elementType===h?E:yr(h,E),Mm(i,o,h,E,c);case 1:return h=o.type,E=o.pendingProps,E=o.elementType===h?E:yr(h,E),qx(i,o,h,E,c);case 3:e:{if(Yx(o),i===null)throw Error(n(387));h=o.pendingProps,T=o.memoizedState,E=T.element,ax(i,o),jc(o,h,null,c);var v=o.memoizedState;if(h=v.element,T.isDehydrated)if(T={element:h,isDehydrated:!1,cache:v.cache,pendingSuspenseBoundaries:v.pendingSuspenseBoundaries,transitions:v.transitions},o.updateQueue.baseState=T,o.memoizedState=T,o.flags&256){E=zo(Error(n(423)),o),o=Wx(i,o,h,c,E);break e}else if(h!==E){E=zo(Error(n(424)),o),o=Wx(i,o,h,c,E);break e}else for(Wn=Ni(o.stateNode.containerInfo.firstChild),Yn=o,Nt=!0,Er=null,c=sx(o,null,h,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Fo(),h===E){o=oi(i,o,c);break e}_n(i,o,h,c)}o=o.child}return o;case 5:return cx(o),i===null&&fm(o),h=o.type,E=o.pendingProps,T=i!==null?i.memoizedProps:null,v=E.children,rm(h,E)?v=null:T!==null&&rm(h,T)&&(o.flags|=32),Vx(i,o),_n(i,o,v,c),o.child;case 6:return i===null&&fm(o),null;case 13:return Gx(i,o,c);case 4:return bm(o,o.stateNode.containerInfo),h=o.pendingProps,i===null?o.child=Bo(o,null,h,c):_n(i,o,h,c),o.child;case 11:return h=o.type,E=o.pendingProps,E=o.elementType===h?E:yr(h,E),Hx(i,o,h,E,c);case 7:return _n(i,o,o.pendingProps,c),o.child;case 8:return _n(i,o,o.pendingProps.children,c),o.child;case 12:return _n(i,o,o.pendingProps.children,c),o.child;case 10:e:{if(h=o.type._context,E=o.pendingProps,T=o.memoizedProps,v=E.value,wt(Bc,h._currentValue),h._currentValue=v,T!==null)if(gr(T.value,v)){if(T.children===E.children&&!Dn.current){o=oi(i,o,c);break e}}else for(T=o.child,T!==null&&(T.return=o);T!==null;){var F=T.dependencies;if(F!==null){v=T.child;for(var $=F.firstContext;$!==null;){if($.context===h){if(T.tag===1){$=si(-1,c&-c),$.tag=2;var ee=T.updateQueue;if(ee!==null){ee=ee.shared;var ge=ee.pending;ge===null?$.next=$:($.next=ge.next,ge.next=$),ee.pending=$}}T.lanes|=c,$=T.alternate,$!==null&&($.lanes|=c),Em(T.return,c,o),F.lanes|=c;break}$=$.next}}else if(T.tag===10)v=T.type===o.type?null:T.child;else if(T.tag===18){if(v=T.return,v===null)throw Error(n(341));v.lanes|=c,F=v.alternate,F!==null&&(F.lanes|=c),Em(v,c,o),v=T.sibling}else v=T.child;if(v!==null)v.return=T;else for(v=T;v!==null;){if(v===o){v=null;break}if(T=v.sibling,T!==null){T.return=v.return,v=T;break}v=v.return}T=v}_n(i,o,E.children,c),o=o.child}return o;case 9:return E=o.type,h=o.pendingProps.children,Ho(o,c),E=tr(E),h=h(E),o.flags|=1,_n(i,o,h,c),o.child;case 14:return h=o.type,E=yr(h,o.pendingProps),E=yr(h.type,E),jx(i,o,h,E,c);case 15:return zx(i,o,o.type,o.pendingProps,c);case 17:return h=o.type,E=o.pendingProps,E=o.elementType===h?E:yr(h,E),Kc(i,o),o.tag=1,Mn(h)?(i=!0,Pc(o)):i=!1,Ho(o,c),Rx(o,h,E),Rm(o,h,E,c),Fm(null,o,h,!0,i,c);case 19:return Kx(i,o,c);case 22:return $x(i,o,c)}throw Error(n(156,o.tag))};function b2(i,o){return Zw(i,o)}function V7(i,o,c,h){this.tag=i,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ir(i,o,c,h){return new V7(i,o,c,h)}function r0(i){return i=i.prototype,!(!i||!i.isReactComponent)}function q7(i){if(typeof i=="function")return r0(i)?1:0;if(i!=null){if(i=i.$$typeof,i===te)return 11;if(i===ue)return 14}return 2}function Hi(i,o){var c=i.alternate;return c===null?(c=ir(i.tag,o,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=o,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=i.flags&14680064,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,o=i.dependencies,c.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c}function ad(i,o,c,h,E,T){var v=2;if(h=i,typeof i=="function")r0(i)&&(v=1);else if(typeof i=="string")v=5;else e:switch(i){case V:return Is(c.children,E,T,o);case J:v=8,E|=8;break;case se:return i=ir(12,c,o,E|2),i.elementType=se,i.lanes=T,i;case le:return i=ir(13,c,o,E),i.elementType=le,i.lanes=T,i;case fe:return i=ir(19,c,o,E),i.elementType=fe,i.lanes=T,i;case de:return ud(c,E,T,o);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case H:v=10;break e;case ie:v=9;break e;case te:v=11;break e;case ue:v=14;break e;case Se:v=16,h=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return o=ir(v,c,o,E),o.elementType=i,o.type=h,o.lanes=T,o}function Is(i,o,c,h){return i=ir(7,i,h,o),i.lanes=c,i}function ud(i,o,c,h){return i=ir(22,i,h,o),i.elementType=de,i.lanes=c,i.stateNode={isHidden:!1},i}function i0(i,o,c){return i=ir(6,i,null,o),i.lanes=c,i}function s0(i,o,c){return o=ir(4,i.children!==null?i.children:[],i.key,o),o.lanes=c,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}function Y7(i,o,c,h,E){this.tag=o,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Pp(0),this.expirationTimes=Pp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pp(0),this.identifierPrefix=h,this.onRecoverableError=E,this.mutableSourceEagerHydrationData=null}function o0(i,o,c,h,E,T,v,F,$){return i=new Y7(i,o,c,F,$),o===1?(o=1,T===!0&&(o|=8)):o=0,T=ir(3,null,null,o),i.current=T,T.stateNode=i,T.memoizedState={element:h,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null},Tm(T),i}function W7(i,o,c){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:h==null?null:""+h,children:i,containerInfo:o,implementation:c}}function w2(i){if(!i)return Ii;i=i._reactInternals;e:{if(Ts(i)!==i||i.tag!==1)throw Error(n(170));var o=i;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(Mn(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(n(171))}if(i.tag===1){var c=i.type;if(Mn(c))return X_(i,c,o)}return o}function _2(i,o,c,h,E,T,v,F,$){return i=o0(c,h,!0,i,E,T,v,F,$),i.context=w2(null),c=i.current,h=xn(),E=Bi(c),T=si(h,E),T.callback=o!=null?o:null,Li(c,T,E),i.current.lanes=E,Xa(i,E,h),Un(i,h),i}function ld(i,o,c,h){var E=o.current,T=xn(),v=Bi(E);return c=w2(c),o.context===null?o.context=c:o.pendingContext=c,o=si(T,v),o.payload={element:i},h=h===void 0?null:h,h!==null&&(o.callback=h),i=Li(E,o,v),i!==null&&(wr(i,E,v,T),Hc(i,E,v)),v}function cd(i){return i=i.current,i.child?(i.child.tag===5,i.child.stateNode):null}function x2(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<o?c:o}}function a0(i,o){x2(i,o),(i=i.alternate)&&x2(i,o)}function G7(){return null}var S2=typeof reportError=="function"?reportError:function(i){console.error(i)};function u0(i){this._internalRoot=i}dd.prototype.render=u0.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(n(409));ld(i,o,null,null)},dd.prototype.unmount=u0.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;Cs(function(){ld(null,i,null,null)}),o[ei]=null}};function dd(i){this._internalRoot=i}dd.prototype.unstable_scheduleHydration=function(i){if(i){var o=a_();i={blockedOn:null,target:i,priority:o};for(var c=0;c<Ai.length&&o!==0&&o<Ai[c].priority;c++);Ai.splice(c,0,i),c===0&&c_(i)}};function l0(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function fd(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function v2(){}function X7(i,o,c,h,E){if(E){if(typeof h=="function"){var T=h;h=function(){var ee=cd(v);T.call(ee)}}var v=_2(o,h,i,0,null,!1,!1,"",v2);return i._reactRootContainer=v,i[ei]=v.current,lu(i.nodeType===8?i.parentNode:i),Cs(),v}for(;E=i.lastChild;)i.removeChild(E);if(typeof h=="function"){var F=h;h=function(){var ee=cd($);F.call(ee)}}var $=o0(i,0,!1,null,null,!1,!1,"",v2);return i._reactRootContainer=$,i[ei]=$.current,lu(i.nodeType===8?i.parentNode:i),Cs(function(){ld(o,$,c,h)}),$}function hd(i,o,c,h,E){var T=c._reactRootContainer;if(T){var v=T;if(typeof E=="function"){var F=E;E=function(){var $=cd(v);F.call($)}}ld(o,v,i,E)}else v=X7(c,o,i,E,h);return cd(v)}s_=function(i){switch(i.tag){case 3:var o=i.stateNode;if(o.current.memoizedState.isDehydrated){var c=Ga(o.pendingLanes);c!==0&&(Rp(o,c|1),Un(o,Ht()),(lt&6)===0&&(qo=Ht()+500,Pi()))}break;case 13:Cs(function(){var h=ii(i,1);if(h!==null){var E=xn();wr(h,i,1,E)}}),a0(i,1)}},Lp=function(i){if(i.tag===13){var o=ii(i,134217728);if(o!==null){var c=xn();wr(o,i,134217728,c)}a0(i,134217728)}},o_=function(i){if(i.tag===13){var o=Bi(i),c=ii(i,o);if(c!==null){var h=xn();wr(c,i,o,h)}a0(i,o)}},a_=function(){return gt},u_=function(i,o){var c=gt;try{return gt=i,o()}finally{gt=c}},Mr=function(i,o,c){switch(o){case"input":if(Ce(i,c),o=c.name,c.type==="radio"&&o!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),o=0;o<c.length;o++){var h=c[o];if(h!==i&&h.form===i.form){var E=Oc(h);if(!E)throw Error(n(90));Lt(h),Ce(h,E)}}}break;case"textarea":Es(i,c);break;case"select":o=c.value,o!=null&&Mt(i,!!c.multiple,o,!1)}},Yw=e0,Ww=Cs;var K7={usingClientEntryPoint:!1,Events:[fu,Po,Oc,Vw,qw,e0]},Au={findFiberByHostInstance:bs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Q7={bundleType:Au.bundleType,version:Au.version,rendererPackageName:Au.rendererPackageName,rendererConfig:Au.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:z.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Qw(i),i===null?null:i.stateNode},findFiberByHostInstance:Au.findFiberByHostInstance||G7,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"){var pd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pd.isDisabled&&pd.supportsFiber)try{dc=pd.inject(Q7),Fr=pd}catch(i){}}return kn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=K7,kn.createPortal=function(i,o){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!l0(o))throw Error(n(200));return W7(i,o,null,c)},kn.createRoot=function(i,o){if(!l0(i))throw Error(n(299));var c=!1,h="",E=S2;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(h=o.identifierPrefix),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),o=o0(i,1,!1,null,null,c,!1,h,E),i[ei]=o.current,lu(i.nodeType===8?i.parentNode:i),new u0(o)},kn.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=Qw(o),i=i===null?null:i.stateNode,i},kn.flushSync=function(i){return Cs(i)},kn.hydrate=function(i,o,c){if(!fd(o))throw Error(n(200));return hd(null,i,o,!0,c)},kn.hydrateRoot=function(i,o,c){if(!l0(i))throw Error(n(405));var h=c!=null&&c.hydratedSources||null,E=!1,T="",v=S2;if(c!=null&&(c.unstable_strictMode===!0&&(E=!0),c.identifierPrefix!==void 0&&(T=c.identifierPrefix),c.onRecoverableError!==void 0&&(v=c.onRecoverableError)),o=_2(o,null,i,1,c!=null?c:null,E,!1,T,v),i[ei]=o.current,lu(i),h)for(i=0;i<h.length;i++)c=h[i],E=c._getVersion,E=E(c._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[c,E]:o.mutableSourceEagerHydrationData.push(c,E);return new dd(o)},kn.render=function(i,o,c){if(!fd(o))throw Error(n(200));return hd(null,i,o,!1,c)},kn.unmountComponentAtNode=function(i){if(!fd(i))throw Error(n(40));return i._reactRootContainer?(Cs(function(){hd(null,null,i,!1,function(){i._reactRootContainer=null,i[ei]=null})}),!0):!1},kn.unstable_batchedUpdates=e0,kn.unstable_renderSubtreeIntoContainer=function(i,o,c,h){if(!fd(c))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return hd(i,o,c,!1,h)},kn.version="18.3.1-next-f1338f8080-20240426",kn}var l1;function c1(){if(l1)return gf.exports;l1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),gf.exports=iC(),gf.exports}var Vs=c1();function d1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=d1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function B(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=d1(e))&&(r&&(r+=" "),r+=t);return r}var f1={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},h1=$i.createContext&&$i.createContext(f1),sC=["attr","size","title"];function oC(e,t){if(e==null)return{};var n=aC(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function aC(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function il(){return il=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},il.apply(this,arguments)}function p1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function sl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p1(Object(n),!0).forEach(function(r){uC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uC(e,t,n){return t=lC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lC(e){var t=cC(e,"string");return typeof t=="symbol"?t:t+""}function cC(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function m1(e){return e&&e.map((t,n)=>$i.createElement(t.tag,sl({key:n},t.attr),m1(t.child)))}function ht(e){return t=>$i.createElement(dC,il({attr:sl({},e.attr)},t),m1(e.child))}function dC(e){var t=n=>{var{attr:r,size:s,title:a}=e,u=oC(e,sC),l=s||n.size||"1em",d;return n.className&&(d=n.className),e.className&&(d=(d?d+" ":"")+e.className),$i.createElement("svg",il({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,u,{className:d,style:sl(sl({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),a&&$i.createElement("title",null,a),e.children)};return h1!==void 0?$i.createElement(h1.Consumer,null,n=>t(n)):t(f1)}function fC(e){return ht({attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5.25 12a.75.75 0 0 1 .75-.75h12a.75.75 0 0 1 0 1.5H6a.75.75 0 0 1-.75-.75Z",clipRule:"evenodd"},child:[]}]})(e)}function hC(e){return ht({attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M12 5.25a.75.75 0 0 1 .75.75v5.25H18a.75.75 0 0 1 0 1.5h-5.25V18a.75.75 0 0 1-1.5 0v-5.25H6a.75.75 0 0 1 0-1.5h5.25V6a.75.75 0 0 1 .75-.75Z",clipRule:"evenodd"},child:[]}]})(e)}function pC(e){return ht({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"},child:[]}]})(e)}const lr=({className:e,iconUrl:t,icon:n,type:r="button",ariaLabel:s,title:a,disabled:u=!1,onClick:l})=>!n&&!t?null:w.jsx("button",{className:B(e,`${N}-icon-button`),type:r,"aria-label":s,title:a,onClick:l,disabled:u,children:t?w.jsx("img",{className:B(`${N}-icon-image`),src:t,alt:s,loading:"lazy"}):n}),mC="data:image/svg+xml,%3csvg%20width='140'%20height='137'%20viewBox='0%200%20140%20137'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M140%2034.5C140%2040.8513%20135.075%2046%20129%2046C122.925%2046%20118%2040.8513%20118%2034.5C118%2028.1487%20122.925%2023%20129%2023C135.075%2023%20140%2028.1487%20140%2034.5Z'%20fill='%23F3F2EB'/%3e%3cpath%20d='M85%2011.3028C85%205.06042%2090.1487%200%2096.5%200C102.851%200%20108%205.06042%20108%2011.3028V21.6972C108%2027.9396%20102.851%2033%2096.5%2033C90.1487%2033%2085%2027.9396%2085%2021.6972V11.3028Z'%20fill='%23F3F2EB'/%3e%3cpath%20d='M41.3868%2030.0986C36.9601%2025.6719%2036.9601%2018.4948%2041.3868%2014.0682C45.8134%209.64151%2052.9905%209.6415%2057.4172%2014.0682L71.3628%2028.0138C75.7894%2032.4404%2075.7894%2039.6175%2071.3628%2044.0442C66.9361%2048.4708%2059.759%2048.4708%2055.3324%2044.0442L41.3868%2030.0986Z'%20fill='%23F3F2EB'/%3e%3cpath%20d='M140%20101C140%2094.9249%20135.075%2090%20129%2090C122.925%2090%20118%2094.9249%20118%20101C118%20107.075%20122.925%20112%20129%20112C135.075%20112%20140%20107.075%20140%20101Z'%20fill='%23F3F2EB'/%3e%3cpath%20d='M85%20125.697C85%20131.94%2090.1487%20137%2096.5%20137C102.851%20137%20108%20131.94%20108%20125.697V115.303C108%20109.06%20102.851%20104%2096.5%20104C90.1487%20104%2085%20109.06%2085%20115.303V125.697Z'%20fill='%23F3F2EB'/%3e%3cpath%20d='M41.3868%20106.932C36.9601%20111.359%2036.9601%20118.536%2041.3868%20122.963C45.8134%20127.389%2052.9905%20127.39%2057.4172%20122.963L71.3628%20109.017C75.7894%20104.591%2075.7894%2097.4135%2071.3628%2092.9868C66.9361%2088.5602%2059.759%2088.5602%2055.3324%2092.9868L41.3868%20106.932Z'%20fill='%23F3F2EB'/%3e%3cpath%20d='M11.259%2080C5.04084%2080%200%2074.8513%200%2068.5C0%2062.1487%205.04084%2057%2011.259%2057H49.741C55.9592%2057%2061%2062.1487%2061%2068.5C61%2074.8513%2055.9592%2080%2049.741%2080H11.259Z'%20fill='%23F3F2EB'/%3e%3c/svg%3e",gC=({onClick:e})=>{const{globalClassName:t,headerConfig:n,mode:r}=ft(),s=r==="messaging",a=s?"Open Commerce Client":"Open Copilot",u=s?w.jsx(pC,{className:B(t,`${N}-minimized-icon`)}):w.jsx("img",{src:(n==null?void 0:n.logoUrl)||mC,alt:"Copilot",className:B(t,`${N}-minimized-icon-img`)});return w.jsx(lr,{className:B(t,`${N}-minimized-button`),ariaLabel:a,title:a,icon:u,onClick:e})},EC=()=>{const{globalClassName:e,themeVariables:t}=ft(),n=()=>{Ms(!1),$r(!0)};return Vs.createPortal(w.jsx("div",{className:B(e,`${N}-minimized-container`),style:t,children:w.jsx(gC,{onClick:n})}),document.body)};function yC(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3.5 8a5.5 5.5 0 1 1 8.596 4.547 9.005 9.005 0 0 1 5.9 8.18.751.751 0 0 1-1.5.045 7.5 7.5 0 0 0-14.993 0 .75.75 0 0 1-1.499-.044 9.005 9.005 0 0 1 5.9-8.181A5.496 5.496 0 0 1 3.5 8ZM9 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm8.29 4c-.148 0-.292.01-.434.03a.75.75 0 1 1-.212-1.484 4.53 4.53 0 0 1 3.38 8.097 6.69 6.69 0 0 1 3.956 6.107.75.75 0 0 1-1.5 0 5.193 5.193 0 0 0-3.696-4.972l-.534-.16v-1.676l.41-.209A3.03 3.03 0 0 0 17.29 8Z"},child:[]}]})(e)}function Cn(){const e=R.useContext(Fg);if(!e)throw new Error("useMessaging must be used within a MessagingProvider");return e}const TC=e=>({[`${Hn}-header-background-color`]:(e==null?void 0:e.headerBackgroundColor)||"transparent",[`${Hn}-header-text-color`]:(e==null?void 0:e.headerTextColor)||"inherit",[`${Hn}-header-text-font-size`]:(e==null?void 0:e.headerTextFontSize)||"1.25rem",[`${Hn}-header-text-font-weight`]:(e==null?void 0:e.headerTextFontWeight)!=null?String(e.headerTextFontWeight):"bold",[`${Hn}-header-text-font-family`]:(e==null?void 0:e.headerTextFontFamily)||"inherit",[`${Hn}-header-text-text-align`]:(e==null?void 0:e.headerTextTextAlign)||"left"});function bC(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8A5.87 5.87 0 0 1 6 12c0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z"},child:[]}]})(e)}function g1(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19h12v2H6z"},child:[]}]})(e)}function wC(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"},child:[]}]})(e)}function Tf(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"},child:[]}]})(e)}function _C(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM6 9h12v2H6V9zm8 5H6v-2h8v2zm4-6H6V6h12v2z"},child:[]}]})(e)}function xC(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"},child:[]}]})(e)}function SC(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"},child:[]}]})(e)}function E1(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"},child:[]}]})(e)}function y1(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"},child:[]}]})(e)}function vC(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"},child:[]}]})(e)}function AC(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"},child:[]}]})(e)}function kC(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"},child:[]}]})(e)}function T1(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"m21.41 11.58-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42zM13 20.01 4 11V4h7v-.01l9 9-7 7.02z"},child:[]},{tag:"circle",attr:{cx:"6.5",cy:"6.5",r:"1.5"},child:[]}]})(e)}const bf=({className:e,children:t,type:n,disabled:r=!1,onClick:s})=>w.jsx("button",{className:B(`${N}-button`,e,{disabled:r}),type:n||"button",disabled:r,onClick:s,children:t}),CC=({searchConfig:e,globalClassName:t})=>{const n=e.buttonIconUrl;return n?w.jsx("img",{className:B(`${N}-search-button-icon-image`,t),src:n,alt:"",loading:"lazy"}):w.jsx(Tf,{size:"16px"})},NC=({className:e,searchConfig:t,globalClassName:n,componentType:r,isLoading:s})=>{if((t==null?void 0:t.buttonType)==="icon")return w.jsx(lr,{className:B(e,n,`cim-${r}-component`,`${N}-search-button-icon`),type:"submit",disabled:s,ariaLabel:(t==null?void 0:t.buttonAriaLabel)||(t==null?void 0:t.buttonLabel)||"Search Copilot",icon:t!=null&&t.buttonIconUrl?null:w.jsx(Tf,{size:"16px"}),iconUrl:t==null?void 0:t.buttonIconUrl});const a=(t==null?void 0:t.buttonType)==="icon-text";return w.jsxs(bf,{className:B(e,n,`cim-${r}-component`,`${N}-search-button`),type:"submit","aria-label":(t==null?void 0:t.buttonAriaLabel)||"",disabled:s,children:[a&&w.jsx(CC,{globalClassName:n,searchConfig:t}),(t==null?void 0:t.buttonLabel)||"Search"]})};function kU(){}function CU(){}function b1(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const u=n.slice(s,r).trim();(u||!a)&&t.push(u),s=r+1,r=n.indexOf(",",s)}return t}function w1(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const OC=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,IC=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,PC={};function _1(e,t){return(PC.jsx?IC:OC).test(e)}const RC=/[ \t\n\f\r]/g;function LC(e){return typeof e=="object"?e.type==="text"?x1(e.value):!1:x1(e)}function x1(e){return e.replace(RC,"")===""}class ua{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ua.prototype.normal={},ua.prototype.property={},ua.prototype.space=void 0;function S1(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new ua(n,r,t)}function la(e){return e.toLowerCase()}class Nn{constructor(t,n){this.attribute=n,this.property=t}}Nn.prototype.attribute="",Nn.prototype.booleanish=!1,Nn.prototype.boolean=!1,Nn.prototype.commaOrSpaceSeparated=!1,Nn.prototype.commaSeparated=!1,Nn.prototype.defined=!1,Nn.prototype.mustUseProperty=!1,Nn.prototype.number=!1,Nn.prototype.overloadedBoolean=!1,Nn.prototype.property="",Nn.prototype.spaceSeparated=!1,Nn.prototype.space=void 0;let DC=0;const Je=Zi(),$t=Zi(),wf=Zi(),be=Zi(),yt=Zi(),Ji=Zi(),zn=Zi();function Zi(){return gd(2,++DC)}const _f=Object.freeze(Object.defineProperty({__proto__:null,boolean:Je,booleanish:$t,commaOrSpaceSeparated:zn,commaSeparated:Ji,number:be,overloadedBoolean:wf,spaceSeparated:yt},Symbol.toStringTag,{value:"Module"})),xf=Object.keys(_f);class Sf extends Nn{constructor(t,n,r,s){let a=-1;if(super(t,n),v1(this,"space",s),typeof r=="number")for(;++a<xf.length;){const u=xf[a];v1(this,xf[a],(r&_f[u])===_f[u])}}}Sf.prototype.defined=!0;function v1(e,t,n){n&&(e[t]=n)}function qs(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const a=new Sf(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[la(r)]=r,n[la(a.attribute)]=r}return new ua(t,n,e.space)}const A1=qs({properties:{ariaActiveDescendant:null,ariaAtomic:$t,ariaAutoComplete:null,ariaBusy:$t,ariaChecked:$t,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:yt,ariaCurrent:null,ariaDescribedBy:yt,ariaDetails:null,ariaDisabled:$t,ariaDropEffect:yt,ariaErrorMessage:null,ariaExpanded:$t,ariaFlowTo:yt,ariaGrabbed:$t,ariaHasPopup:null,ariaHidden:$t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:yt,ariaLevel:be,ariaLive:null,ariaModal:$t,ariaMultiLine:$t,ariaMultiSelectable:$t,ariaOrientation:null,ariaOwns:yt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:$t,ariaReadOnly:$t,ariaRelevant:null,ariaRequired:$t,ariaRoleDescription:yt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:$t,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function k1(e,t){return t in e?e[t]:t}function C1(e,t){return k1(e,t.toLowerCase())}const MC=qs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ji,acceptCharset:yt,accessKey:yt,action:null,allow:null,allowFullScreen:Je,allowPaymentRequest:Je,allowUserMedia:Je,alpha:Je,alt:null,as:null,async:Je,autoCapitalize:null,autoComplete:yt,autoFocus:Je,autoPlay:Je,blocking:yt,capture:null,charSet:null,checked:Je,cite:null,className:yt,closedBy:null,colorSpace:null,cols:be,colSpan:be,command:null,commandFor:null,content:null,contentEditable:$t,controls:Je,controlsList:yt,coords:be|Ji,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Je,defer:Je,dir:null,dirName:null,disabled:Je,download:wf,draggable:$t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Je,formTarget:null,headers:yt,height:be,hidden:wf,high:be,href:null,hrefLang:null,htmlFor:yt,httpEquiv:yt,id:null,imageSizes:null,imageSrcSet:null,inert:Je,inputMode:null,integrity:null,is:null,isMap:Je,itemId:null,itemProp:yt,itemRef:yt,itemScope:Je,itemType:yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Je,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Je,muted:Je,name:null,nonce:null,noModule:Je,noValidate:Je,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Je,optimum:be,pattern:null,ping:yt,placeholder:null,playsInline:Je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Je,referrerPolicy:null,rel:yt,required:Je,reversed:Je,rows:be,rowSpan:be,sandbox:yt,scope:null,scoped:Je,seamless:Je,selected:Je,shadowRootClonable:Je,shadowRootCustomElementRegistry:Je,shadowRootDelegatesFocus:Je,shadowRootMode:null,shadowRootSerializable:Je,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:$t,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Je,useMap:null,value:$t,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:yt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Je,declare:Je,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Je,noHref:Je,noShade:Je,noWrap:Je,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:$t,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Je,disablePictureInPicture:Je,disableRemotePlayback:Je,exportParts:Ji,part:yt,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:C1}),FC=qs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:zn,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:yt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Je,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ji,g2:Ji,glyphName:Ji,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:zn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zn,rev:zn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zn,requiredFeatures:zn,requiredFonts:zn,requiredFormats:zn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:zn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zn,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:k1}),N1=qs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),O1=qs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:C1}),I1=qs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),BC={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},UC=/[A-Z]/g,P1=/-[a-z]/g,HC=/^data[-\w.:]+$/i;function ol(e,t){const n=la(t);let r=t,s=Nn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&HC.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(P1,zC);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!P1.test(a)){let u=a.replace(UC,jC);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}s=Sf}return new s(r,t)}function jC(e){return"-"+e.toLowerCase()}function zC(e){return e.charAt(1).toUpperCase()}const ca=S1([A1,MC,N1,O1,I1],"html"),fi=S1([A1,FC,N1,O1,I1],"svg");function R1(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function L1(e){return e.join(" ").trim()}var Ys={},vf,D1;function $C(){if(D1)return vf;D1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,l=/^\s+|\s+$/g,d=`
24
+ `,f="/",m="*",p="",b="comment",y="declaration";function _(A,S){if(typeof A!="string")throw new TypeError("First argument must be a string");if(!A)return[];S=S||{};var C=1,O=1;function z(fe){var ue=fe.match(t);ue&&(C+=ue.length);var Se=fe.lastIndexOf(d);O=~Se?fe.length-Se:O+fe.length}function G(){var fe={line:C,column:O};return function(ue){return ue.position=new M(fe),se(),ue}}function M(fe){this.start=fe,this.end={line:C,column:O},this.source=S.source}M.prototype.content=A;function V(fe){var ue=new Error(S.source+":"+C+":"+O+": "+fe);if(ue.reason=fe,ue.filename=S.source,ue.line=C,ue.column=O,ue.source=A,!S.silent)throw ue}function J(fe){var ue=fe.exec(A);if(ue){var Se=ue[0];return z(Se),A=A.slice(Se.length),ue}}function se(){J(n)}function H(fe){var ue;for(fe=fe||[];ue=ie();)ue!==!1&&fe.push(ue);return fe}function ie(){var fe=G();if(!(f!=A.charAt(0)||m!=A.charAt(1))){for(var ue=2;p!=A.charAt(ue)&&(m!=A.charAt(ue)||f!=A.charAt(ue+1));)++ue;if(ue+=2,p===A.charAt(ue-1))return V("End of comment missing");var Se=A.slice(2,ue-2);return O+=2,z(Se),A=A.slice(ue),O+=2,fe({type:b,comment:Se})}}function te(){var fe=G(),ue=J(r);if(ue){if(ie(),!J(s))return V("property missing ':'");var Se=J(a),de=fe({type:y,property:x(ue[0].replace(e,p)),value:Se?x(Se[0].replace(e,p)):p});return J(u),de}}function le(){var fe=[];H(fe);for(var ue;ue=te();)ue!==!1&&(fe.push(ue),H(fe));return fe}return se(),le()}function x(A){return A?A.replace(l,p):p}return vf=_,vf}var M1;function VC(){if(M1)return Ys;M1=1;var e=Ys&&Ys.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.default=n;const t=e($C());function n(r,s){let a=null;if(!r||typeof r!="string")return a;const u=(0,t.default)(r),l=typeof s=="function";return u.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:m}=d;l?s(f,m,d):m&&(a=a||{},a[f]=m)}),a}return Ys}var da={},F1;function qC(){if(F1)return da;F1=1,Object.defineProperty(da,"__esModule",{value:!0}),da.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},u=function(f,m){return m.toUpperCase()},l=function(f,m){return"".concat(m,"-")},d=function(f,m){return m===void 0&&(m={}),a(f)?f:(f=f.toLowerCase(),m.reactCompat?f=f.replace(s,l):f=f.replace(r,l),f.replace(t,u))};return da.camelCase=d,da}var fa,B1;function YC(){if(B1)return fa;B1=1;var e=fa&&fa.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(VC()),n=qC();function r(s,a){var u={};return!s||typeof s!="string"||(0,t.default)(s,function(l,d){l&&d&&(u[(0,n.camelCase)(l,a)]=d)}),u}return r.default=r,fa=r,fa}var WC=YC();const GC=it(WC),al=U1("end"),vr=U1("start");function U1(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function H1(e){const t=vr(e),n=al(e);if(t&&n)return{start:t,end:n}}function ha(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?j1(e.position):"start"in e||"end"in e?j1(e):"line"in e||"column"in e?Af(e):""}function Af(e){return z1(e&&e.line)+":"+z1(e&&e.column)}function j1(e){return Af(e&&e.start)+"-"+Af(e&&e.end)}function z1(e){return e&&typeof e=="number"?e:1}class cn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},u=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a=j({},n)),typeof t=="string"?s=t:!a.cause&&t&&(u=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=ha(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=u&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}cn.prototype.file="",cn.prototype.name="",cn.prototype.reason="",cn.prototype.message="",cn.prototype.stack="",cn.prototype.column=void 0,cn.prototype.line=void 0,cn.prototype.ancestors=void 0,cn.prototype.cause=void 0,cn.prototype.fatal=void 0,cn.prototype.place=void 0,cn.prototype.ruleId=void 0,cn.prototype.source=void 0;const kf={}.hasOwnProperty,XC=new Map,KC=/[A-Z]/g,QC=new Set(["table","tbody","thead","tfoot","tr"]),JC=new Set(["td","th"]),$1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ZC(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=aN(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=oN(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?fi:ca,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=V1(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function V1(e,t,n){if(t.type==="element")return eN(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return tN(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return rN(e,t,n);if(t.type==="mdxjsEsm")return nN(e,t);if(t.type==="root")return iN(e,t,n);if(t.type==="text")return sN(e,t)}function eN(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=fi,e.schema=s),e.ancestors.push(t);const a=Y1(e,t.tagName,!1),u=uN(e,t);let l=Nf(e,t);return QC.has(t.tagName)&&(l=l.filter(function(d){return typeof d=="string"?!LC(d):!0})),q1(e,u,a,t),Cf(u,l),e.ancestors.pop(),e.schema=r,e.create(t,a,u,n)}function tN(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}pa(e,t.position)}function nN(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);pa(e,t.position)}function rN(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=fi,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:Y1(e,t.name,!0),u=lN(e,t),l=Nf(e,t);return q1(e,u,a,t),Cf(u,l),e.ancestors.pop(),e.schema=r,e.create(t,a,u,n)}function iN(e,t,n){const r={};return Cf(r,Nf(e,t)),e.create(t,e.Fragment,r,n)}function sN(e,t){return t.value}function q1(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Cf(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function oN(e,t,n){return r;function r(s,a,u,l){const f=Array.isArray(u.children)?n:t;return l?f(a,u,l):f(a,u)}}function aN(e,t){return n;function n(r,s,a,u){const l=Array.isArray(a.children),d=vr(r);return t(s,a,u,l,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function uN(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&kf.call(t.properties,s)){const a=cN(e,s,t.properties[s]);if(a){const[u,l]=a;e.tableCellAlignToStyle&&u==="align"&&typeof l=="string"&&JC.has(t.tagName)?r=l:n[u]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function lN(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const u=a.expression;u.type;const l=u.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else pa(e,t.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else pa(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function Nf(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:XC;for(;++r<t.children.length;){const a=t.children[r];let u;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const f=s.get(d)||0;u=d+"-"+f,s.set(d,f+1)}}const l=V1(e,a,u);l!==void 0&&n.push(l)}return n}function cN(e,t,n){const r=ol(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?w1(n):L1(n)),r.property==="style"){let s=typeof n=="object"?n:dN(e,String(n));return e.stylePropertyNameCase==="css"&&(s=fN(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?BC[r.property]||r.property:r.attribute,n]}}function dN(e,t){try{return GC(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new cn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=$1+"#cannot-parse-style-attribute",s}}function Y1(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let a=-1,u;for(;++a<s.length;){const l=_1(s[a])?{type:"Identifier",name:s[a]}:{type:"Literal",value:s[a]};u=u?{type:"MemberExpression",object:u,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}r=u}else r=_1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return kf.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);pa(e)}function pa(e,t){const n=new cn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=$1+"#cannot-handle-mdx-estrees-without-createevaluater",n}function fN(e){const t={};let n;for(n in e)kf.call(e,n)&&(t[hN(n)]=e[n]);return t}function hN(e){let t=e.replace(KC,pN);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function pN(e){return"-"+e.toLowerCase()}const Of={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},mN={};function If(e,t){const n=mN,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return W1(e,r,s)}function W1(e,t,n){if(gN(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return G1(e.children,t,n)}return Array.isArray(e)?G1(e,t,n):""}function G1(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=W1(e[s],t,n);return r.join("")}function gN(e){return!!(e&&typeof e=="object")}const X1=document.createElement("i");function Pf(e){const t="&"+e+";";X1.innerHTML=t;const n=X1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function $n(e,t,n,r){const s=e.length;let a=0,u;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)u=Array.from(r),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);a<r.length;)u=r.slice(a,a+1e4),u.unshift(t,0),e.splice(...u),a+=1e4,t+=1e4}function Kn(e,t){return e.length>0?($n(e,e.length,0,t),e):t}const K1={}.hasOwnProperty;function Q1(e){const t={};let n=-1;for(;++n<e.length;)EN(t,e[n]);return t}function EN(e,t){let n;for(n in t){const s=(K1.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let u;if(a)for(u in a){K1.call(s,u)||(s[u]=[]);const l=a[u];yN(s[u],Array.isArray(l)?l:l?[l]:[])}}}function yN(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);$n(e,0,0,r)}function J1(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function cr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const bn=hi(/[A-Za-z]/),dn=hi(/[\dA-Za-z]/),TN=hi(/[#-'*+\--9=?A-Z^-~]/);function ul(e){return e!==null&&(e<32||e===127)}const Rf=hi(/\d/),bN=hi(/[\dA-Fa-f]/),wN=hi(/[!-/:-@[-`{-~]/);function Ve(e){return e!==null&&e<-2}function Tt(e){return e!==null&&(e<0||e===32)}function st(e){return e===-2||e===-1||e===32}const ll=hi(new RegExp("\\p{P}|\\p{S}","u")),es=hi(/\s/);function hi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ws(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let u="";if(a===37&&dn(e.charCodeAt(n+1))&&dn(e.charCodeAt(n+2)))s=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(u=String.fromCharCode(a));else if(a>55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(u=String.fromCharCode(a,l),s=1):u="�"}else u=String.fromCharCode(a);u&&(t.push(e.slice(r,n),encodeURIComponent(u)),r=n+s+1,u=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function ut(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return u;function u(d){return st(d)?(e.enter(n),l(d)):t(d)}function l(d){return st(d)&&a++<s?(e.consume(d),l):(e.exit(n),t(d))}}const _N={tokenize:xN};function xN(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ut(e,t,"linePrefix")}function s(l){return e.enter("paragraph"),a(l)}function a(l){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,u(l)}function u(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Ve(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),u)}}const SN={tokenize:vN},Z1={tokenize:AN};function vN(e){const t=this,n=[];let r=0,s,a,u;return l;function l(O){if(r<n.length){const z=n[r];return t.containerState=z[1],e.attempt(z[0].continuation,d,f)(O)}return f(O)}function d(O){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&C();const z=t.events.length;let G=z,M;for(;G--;)if(t.events[G][0]==="exit"&&t.events[G][1].type==="chunkFlow"){M=t.events[G][1].end;break}S(r);let V=z;for(;V<t.events.length;)t.events[V][1].end=j({},M),V++;return $n(t.events,G+1,0,t.events.slice(z)),t.events.length=V,f(O)}return l(O)}function f(O){if(r===n.length){if(!s)return b(O);if(s.currentConstruct&&s.currentConstruct.concrete)return _(O);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Z1,m,p)(O)}function m(O){return s&&C(),S(r),b(O)}function p(O){return t.parser.lazy[t.now().line]=r!==n.length,u=t.now().offset,_(O)}function b(O){return t.containerState={},e.attempt(Z1,y,_)(O)}function y(O){return r++,n.push([t.currentConstruct,t.containerState]),b(O)}function _(O){if(O===null){s&&C(),S(0),e.consume(O);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),x(O)}function x(O){if(O===null){A(e.exit("chunkFlow"),!0),S(0),e.consume(O);return}return Ve(O)?(e.consume(O),A(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(O),x)}function A(O,z){const G=t.sliceStream(O);if(z&&G.push(null),O.previous=a,a&&(a.next=O),a=O,s.defineSkip(O.start),s.write(G),t.parser.lazy[O.start.line]){let M=s.events.length;for(;M--;)if(s.events[M][1].start.offset<u&&(!s.events[M][1].end||s.events[M][1].end.offset>u))return;const V=t.events.length;let J=V,se,H;for(;J--;)if(t.events[J][0]==="exit"&&t.events[J][1].type==="chunkFlow"){if(se){H=t.events[J][1].end;break}se=!0}for(S(r),M=V;M<t.events.length;)t.events[M][1].end=j({},H),M++;$n(t.events,J+1,0,t.events.slice(V)),t.events.length=M}}function S(O){let z=n.length;for(;z-- >O;){const G=n[z];t.containerState=G[1],G[0].exit.call(t,e)}n.length=O}function C(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function AN(e,t,n){return ut(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Gs(e){if(e===null||Tt(e)||es(e))return 1;if(ll(e))return 2}function cl(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const a=e[s].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Lf={name:"attention",resolveAll:kN,tokenize:CN};function kN(e,t){let n=-1,r,s,a,u,l,d,f,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p=j({},e[r][1].end),b=j({},e[n][1].start);eE(p,-d),eE(b,d),u={type:d>1?"strongSequence":"emphasisSequence",start:p,end:j({},e[r][1].end)},l={type:d>1?"strongSequence":"emphasisSequence",start:j({},e[n][1].start),end:b},a={type:d>1?"strongText":"emphasisText",start:j({},e[r][1].end),end:j({},e[n][1].start)},s={type:d>1?"strong":"emphasis",start:j({},u.start),end:j({},l.end)},e[r][1].end=j({},u.start),e[n][1].start=j({},l.end),f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Kn(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Kn(f,[["enter",s,t],["enter",u,t],["exit",u,t],["enter",a,t]]),f=Kn(f,cl(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Kn(f,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,f=Kn(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,$n(e,r-1,n-r+3,f),n=r+f.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function CN(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=Gs(r);let a;return u;function u(d){return a=d,e.enter("attentionSequence"),l(d)}function l(d){if(d===a)return e.consume(d),l;const f=e.exit("attentionSequence"),m=Gs(d),p=!m||m===2&&s||n.includes(d),b=!s||s===2&&m||n.includes(r);return f._open=!!(a===42?p:p&&(s||!b)),f._close=!!(a===42?b:b&&(m||!p)),t(d)}}function eE(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const NN={name:"autolink",tokenize:ON};function ON(e,t,n){let r=0;return s;function s(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(y){return bn(y)?(e.consume(y),u):y===64?n(y):f(y)}function u(y){return y===43||y===45||y===46||dn(y)?(r=1,l(y)):f(y)}function l(y){return y===58?(e.consume(y),r=0,d):(y===43||y===45||y===46||dn(y))&&r++<32?(e.consume(y),l):(r=0,f(y))}function d(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||ul(y)?n(y):(e.consume(y),d)}function f(y){return y===64?(e.consume(y),m):TN(y)?(e.consume(y),f):n(y)}function m(y){return dn(y)?p(y):n(y)}function p(y){return y===46?(e.consume(y),r=0,m):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):b(y)}function b(y){if((y===45||dn(y))&&r++<63){const _=y===45?b:p;return e.consume(y),_}return n(y)}}const ma={partial:!0,tokenize:IN};function IN(e,t,n){return r;function r(a){return st(a)?ut(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||Ve(a)?t(a):n(a)}}const tE={continuation:{tokenize:RN},exit:LN,name:"blockQuote",tokenize:PN};function PN(e,t,n){const r=this;return s;function s(u){if(u===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),a}return n(u)}function a(u){return st(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function RN(e,t,n){const r=this;return s;function s(u){return st(u)?ut(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):a(u)}function a(u){return e.attempt(tE,t,n)(u)}}function LN(e){e.exit("blockQuote")}const nE={name:"characterEscape",tokenize:DN};function DN(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),s}function s(a){return wN(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const rE={name:"characterReference",tokenize:MN};function MN(e,t,n){const r=this;let s=0,a,u;return l;function l(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),d}function d(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,u=dn,m(p))}function f(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,u=bN,m):(e.enter("characterReferenceValue"),a=7,u=Rf,m(p))}function m(p){if(p===59&&s){const b=e.exit("characterReferenceValue");return u===dn&&!Pf(r.sliceSerialize(b))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(p)&&s++<a?(e.consume(p),m):n(p)}}const iE={partial:!0,tokenize:BN},sE={concrete:!0,name:"codeFenced",tokenize:FN};function FN(e,t,n){const r=this,s={partial:!0,tokenize:G};let a=0,u=0,l;return d;function d(M){return f(M)}function f(M){const V=r.events[r.events.length-1];return a=V&&V[1].type==="linePrefix"?V[2].sliceSerialize(V[1],!0).length:0,l=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(M)}function m(M){return M===l?(u++,e.consume(M),m):u<3?n(M):(e.exit("codeFencedFenceSequence"),st(M)?ut(e,p,"whitespace")(M):p(M))}function p(M){return M===null||Ve(M)?(e.exit("codeFencedFence"),r.interrupt?t(M):e.check(iE,x,z)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(M))}function b(M){return M===null||Ve(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(M)):st(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ut(e,y,"whitespace")(M)):M===96&&M===l?n(M):(e.consume(M),b)}function y(M){return M===null||Ve(M)?p(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),_(M))}function _(M){return M===null||Ve(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(M)):M===96&&M===l?n(M):(e.consume(M),_)}function x(M){return e.attempt(s,z,A)(M)}function A(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),S}function S(M){return a>0&&st(M)?ut(e,C,"linePrefix",a+1)(M):C(M)}function C(M){return M===null||Ve(M)?e.check(iE,x,z)(M):(e.enter("codeFlowValue"),O(M))}function O(M){return M===null||Ve(M)?(e.exit("codeFlowValue"),C(M)):(e.consume(M),O)}function z(M){return e.exit("codeFenced"),t(M)}function G(M,V,J){let se=0;return H;function H(ue){return M.enter("lineEnding"),M.consume(ue),M.exit("lineEnding"),ie}function ie(ue){return M.enter("codeFencedFence"),st(ue)?ut(M,te,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ue):te(ue)}function te(ue){return ue===l?(M.enter("codeFencedFenceSequence"),le(ue)):J(ue)}function le(ue){return ue===l?(se++,M.consume(ue),le):se>=u?(M.exit("codeFencedFenceSequence"),st(ue)?ut(M,fe,"whitespace")(ue):fe(ue)):J(ue)}function fe(ue){return ue===null||Ve(ue)?(M.exit("codeFencedFence"),V(ue)):J(ue)}}}function BN(e,t,n){const r=this;return s;function s(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a)}function a(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}const Df={name:"codeIndented",tokenize:HN},UN={partial:!0,tokenize:jN};function HN(e,t,n){const r=this;return s;function s(f){return e.enter("codeIndented"),ut(e,a,"linePrefix",5)(f)}function a(f){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?u(f):n(f)}function u(f){return f===null?d(f):Ve(f)?e.attempt(UN,u,d)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||Ve(f)?(e.exit("codeFlowValue"),u(f)):(e.consume(f),l)}function d(f){return e.exit("codeIndented"),t(f)}}function jN(e,t,n){const r=this;return s;function s(u){return r.parser.lazy[r.now().line]?n(u):Ve(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):ut(e,a,"linePrefix",5)(u)}function a(u){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(u):Ve(u)?s(u):n(u)}}const zN={name:"codeText",previous:VN,resolve:$N,tokenize:qN};function $N(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function VN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function qN(e,t,n){let r=0,s,a;return u;function u(p){return e.enter("codeText"),e.enter("codeTextSequence"),l(p)}function l(p){return p===96?(e.consume(p),r++,l):(e.exit("codeTextSequence"),d(p))}function d(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),d):p===96?(a=e.enter("codeTextSequence"),s=0,m(p)):Ve(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(p))}function f(p){return p===null||p===32||p===96||Ve(p)?(e.exit("codeTextData"),d(p)):(e.consume(p),f)}function m(p){return p===96?(e.consume(p),s++,m):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(a.type="codeTextData",f(p))}}class YN{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n==null?Number.POSITIVE_INFINITY:n;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&ga(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ga(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ga(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ga(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ga(this.left,n.reverse())}}}function ga(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function oE(e){const t={};let n=-1,r,s,a,u,l,d,f;const m=new YN(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,WN(m,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,s=void 0;a--;)if(u=m.get(a),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(s&&(m.get(s)[1].type="lineEndingBlank"),u[1].type="lineEnding",s=a);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;s&&(r[1].end=j({},m.get(s)[1].start),l=m.slice(s,n),l.unshift(r),m.splice(s,n-s+1,l))}}return $n(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!f}function WN(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const a=[];let u=n._tokenizer;u||(u=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const l=u.events,d=[],f={};let m,p,b=-1,y=n,_=0,x=0;const A=[x];for(;y;){for(;e.get(++s)[1]!==y;);a.push(s),y._tokenizer||(m=r.sliceStream(y),y.next||m.push(null),p&&u.defineSkip(y.start),y._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(m),y._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),p=y,y=y.next}for(y=n;++b<l.length;)l[b][0]==="exit"&&l[b-1][0]==="enter"&&l[b][1].type===l[b-1][1].type&&l[b][1].start.line!==l[b][1].end.line&&(x=b+1,A.push(x),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(u.events=[],y?(y._tokenizer=void 0,y.previous=void 0):A.pop(),b=A.length;b--;){const S=l.slice(A[b],A[b+1]),C=a.pop();d.push([C,C+S.length-1]),e.splice(C,2,S)}for(d.reverse(),b=-1;++b<d.length;)f[_+d[b][0]]=_+d[b][1],_+=d[b][1]-d[b][0]-1;return f}const GN={resolve:KN,tokenize:QN},XN={partial:!0,tokenize:JN};function KN(e){return oE(e),e}function QN(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(l)}function s(l){return l===null?a(l):Ve(l)?e.check(XN,u,a)(l):(e.consume(l),s)}function a(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function u(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function JN(e,t,n){const r=this;return s;function s(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),ut(e,a,"linePrefix")}function a(u){if(u===null||Ve(u))return n(u);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(u):e.interrupt(r.parser.constructs.flow,n,t)(u)}}function aE(e,t,n,r,s,a,u,l,d){const f=d||Number.POSITIVE_INFINITY;let m=0;return p;function p(S){return S===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(S),e.exit(a),b):S===null||S===32||S===41||ul(S)?n(S):(e.enter(r),e.enter(u),e.enter(l),e.enter("chunkString",{contentType:"string"}),x(S))}function b(S){return S===62?(e.enter(a),e.consume(S),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===62?(e.exit("chunkString"),e.exit(l),b(S)):S===null||S===60||Ve(S)?n(S):(e.consume(S),S===92?_:y)}function _(S){return S===60||S===62||S===92?(e.consume(S),y):y(S)}function x(S){return!m&&(S===null||S===41||Tt(S))?(e.exit("chunkString"),e.exit(l),e.exit(u),e.exit(r),t(S)):m<f&&S===40?(e.consume(S),m++,x):S===41?(e.consume(S),m--,x):S===null||S===32||S===40||ul(S)?n(S):(e.consume(S),S===92?A:x)}function A(S){return S===40||S===41||S===92?(e.consume(S),x):x(S)}}function uE(e,t,n,r,s,a){const u=this;let l=0,d;return f;function f(y){return e.enter(r),e.enter(s),e.consume(y),e.exit(s),e.enter(a),m}function m(y){return l>999||y===null||y===91||y===93&&!d||y===94&&!l&&"_hiddenFootnoteSupport"in u.parser.constructs?n(y):y===93?(e.exit(a),e.enter(s),e.consume(y),e.exit(s),e.exit(r),t):Ve(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||y===91||y===93||Ve(y)||l++>999?(e.exit("chunkString"),m(y)):(e.consume(y),d||(d=!st(y)),y===92?b:p)}function b(y){return y===91||y===92||y===93?(e.consume(y),l++,p):p(y)}}function lE(e,t,n,r,s,a){let u;return l;function l(b){return b===34||b===39||b===40?(e.enter(r),e.enter(s),e.consume(b),e.exit(s),u=b===40?41:b,d):n(b)}function d(b){return b===u?(e.enter(s),e.consume(b),e.exit(s),e.exit(r),t):(e.enter(a),f(b))}function f(b){return b===u?(e.exit(a),d(u)):b===null?n(b):Ve(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),ut(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===u||b===null||Ve(b)?(e.exit("chunkString"),f(b)):(e.consume(b),b===92?p:m)}function p(b){return b===u||b===92?(e.consume(b),m):m(b)}}function Ea(e,t){let n;return r;function r(s){return Ve(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):st(s)?ut(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const ZN={name:"definition",tokenize:t3},e3={partial:!0,tokenize:n3};function t3(e,t,n){const r=this;let s;return a;function a(y){return e.enter("definition"),u(y)}function u(y){return uE.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function l(y){return s=cr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),d):n(y)}function d(y){return Tt(y)?Ea(e,f)(y):f(y)}function f(y){return aE(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function m(y){return e.attempt(e3,p,p)(y)}function p(y){return st(y)?ut(e,b,"whitespace")(y):b(y)}function b(y){return y===null||Ve(y)?(e.exit("definition"),r.parser.defined.push(s),t(y)):n(y)}}function n3(e,t,n){return r;function r(l){return Tt(l)?Ea(e,s)(l):n(l)}function s(l){return lE(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return st(l)?ut(e,u,"whitespace")(l):u(l)}function u(l){return l===null||Ve(l)?t(l):n(l)}}const r3={name:"hardBreakEscape",tokenize:i3};function i3(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return Ve(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const s3={name:"headingAtx",resolve:o3,tokenize:a3};function o3(e,t){let n=e.length-2,r=3,s,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},$n(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function a3(e,t,n){let r=0;return s;function s(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),u(m)}function u(m){return m===35&&r++<6?(e.consume(m),u):m===null||Tt(m)?(e.exit("atxHeadingSequence"),l(m)):n(m)}function l(m){return m===35?(e.enter("atxHeadingSequence"),d(m)):m===null||Ve(m)?(e.exit("atxHeading"),t(m)):st(m)?ut(e,l,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function d(m){return m===35?(e.consume(m),d):(e.exit("atxHeadingSequence"),l(m))}function f(m){return m===null||m===35||Tt(m)?(e.exit("atxHeadingText"),l(m)):(e.consume(m),f)}}const u3=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],cE=["pre","script","style","textarea"],l3={concrete:!0,name:"htmlFlow",resolveTo:f3,tokenize:h3},c3={partial:!0,tokenize:m3},d3={partial:!0,tokenize:p3};function f3(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function h3(e,t,n){const r=this;let s,a,u,l,d;return f;function f(P){return m(P)}function m(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),p}function p(P){return P===33?(e.consume(P),b):P===47?(e.consume(P),a=!0,x):P===63?(e.consume(P),s=3,r.interrupt?t:k):bn(P)?(e.consume(P),u=String.fromCharCode(P),A):n(P)}function b(P){return P===45?(e.consume(P),s=2,y):P===91?(e.consume(P),s=5,l=0,_):bn(P)?(e.consume(P),s=4,r.interrupt?t:k):n(P)}function y(P){return P===45?(e.consume(P),r.interrupt?t:k):n(P)}function _(P){const xe="CDATA[";return P===xe.charCodeAt(l++)?(e.consume(P),l===xe.length?r.interrupt?t:te:_):n(P)}function x(P){return bn(P)?(e.consume(P),u=String.fromCharCode(P),A):n(P)}function A(P){if(P===null||P===47||P===62||Tt(P)){const xe=P===47,Ie=u.toLowerCase();return!xe&&!a&&cE.includes(Ie)?(s=1,r.interrupt?t(P):te(P)):u3.includes(u.toLowerCase())?(s=6,xe?(e.consume(P),S):r.interrupt?t(P):te(P)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):a?C(P):O(P))}return P===45||dn(P)?(e.consume(P),u+=String.fromCharCode(P),A):n(P)}function S(P){return P===62?(e.consume(P),r.interrupt?t:te):n(P)}function C(P){return st(P)?(e.consume(P),C):H(P)}function O(P){return P===47?(e.consume(P),H):P===58||P===95||bn(P)?(e.consume(P),z):st(P)?(e.consume(P),O):H(P)}function z(P){return P===45||P===46||P===58||P===95||dn(P)?(e.consume(P),z):G(P)}function G(P){return P===61?(e.consume(P),M):st(P)?(e.consume(P),G):O(P)}function M(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),d=P,V):st(P)?(e.consume(P),M):J(P)}function V(P){return P===d?(e.consume(P),d=null,se):P===null||Ve(P)?n(P):(e.consume(P),V)}function J(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Tt(P)?G(P):(e.consume(P),J)}function se(P){return P===47||P===62||st(P)?O(P):n(P)}function H(P){return P===62?(e.consume(P),ie):n(P)}function ie(P){return P===null||Ve(P)?te(P):st(P)?(e.consume(P),ie):n(P)}function te(P){return P===45&&s===2?(e.consume(P),Se):P===60&&s===1?(e.consume(P),de):P===62&&s===4?(e.consume(P),D):P===63&&s===3?(e.consume(P),k):P===93&&s===5?(e.consume(P),oe):Ve(P)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(c3,Z,le)(P)):P===null||Ve(P)?(e.exit("htmlFlowData"),le(P)):(e.consume(P),te)}function le(P){return e.check(d3,fe,Z)(P)}function fe(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),ue}function ue(P){return P===null||Ve(P)?le(P):(e.enter("htmlFlowData"),te(P))}function Se(P){return P===45?(e.consume(P),k):te(P)}function de(P){return P===47?(e.consume(P),u="",W):te(P)}function W(P){if(P===62){const xe=u.toLowerCase();return cE.includes(xe)?(e.consume(P),D):te(P)}return bn(P)&&u.length<8?(e.consume(P),u+=String.fromCharCode(P),W):te(P)}function oe(P){return P===93?(e.consume(P),k):te(P)}function k(P){return P===62?(e.consume(P),D):P===45&&s===2?(e.consume(P),k):te(P)}function D(P){return P===null||Ve(P)?(e.exit("htmlFlowData"),Z(P)):(e.consume(P),D)}function Z(P){return e.exit("htmlFlow"),t(P)}}function p3(e,t,n){const r=this;return s;function s(u){return Ve(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a):n(u)}function a(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}function m3(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(ma,t,n)}}const g3={name:"htmlText",tokenize:E3};function E3(e,t,n){const r=this;let s,a,u;return l;function l(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),d}function d(k){return k===33?(e.consume(k),f):k===47?(e.consume(k),G):k===63?(e.consume(k),O):bn(k)?(e.consume(k),J):n(k)}function f(k){return k===45?(e.consume(k),m):k===91?(e.consume(k),a=0,_):bn(k)?(e.consume(k),C):n(k)}function m(k){return k===45?(e.consume(k),y):n(k)}function p(k){return k===null?n(k):k===45?(e.consume(k),b):Ve(k)?(u=p,de(k)):(e.consume(k),p)}function b(k){return k===45?(e.consume(k),y):p(k)}function y(k){return k===62?Se(k):k===45?b(k):p(k)}function _(k){const D="CDATA[";return k===D.charCodeAt(a++)?(e.consume(k),a===D.length?x:_):n(k)}function x(k){return k===null?n(k):k===93?(e.consume(k),A):Ve(k)?(u=x,de(k)):(e.consume(k),x)}function A(k){return k===93?(e.consume(k),S):x(k)}function S(k){return k===62?Se(k):k===93?(e.consume(k),S):x(k)}function C(k){return k===null||k===62?Se(k):Ve(k)?(u=C,de(k)):(e.consume(k),C)}function O(k){return k===null?n(k):k===63?(e.consume(k),z):Ve(k)?(u=O,de(k)):(e.consume(k),O)}function z(k){return k===62?Se(k):O(k)}function G(k){return bn(k)?(e.consume(k),M):n(k)}function M(k){return k===45||dn(k)?(e.consume(k),M):V(k)}function V(k){return Ve(k)?(u=V,de(k)):st(k)?(e.consume(k),V):Se(k)}function J(k){return k===45||dn(k)?(e.consume(k),J):k===47||k===62||Tt(k)?se(k):n(k)}function se(k){return k===47?(e.consume(k),Se):k===58||k===95||bn(k)?(e.consume(k),H):Ve(k)?(u=se,de(k)):st(k)?(e.consume(k),se):Se(k)}function H(k){return k===45||k===46||k===58||k===95||dn(k)?(e.consume(k),H):ie(k)}function ie(k){return k===61?(e.consume(k),te):Ve(k)?(u=ie,de(k)):st(k)?(e.consume(k),ie):se(k)}function te(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),s=k,le):Ve(k)?(u=te,de(k)):st(k)?(e.consume(k),te):(e.consume(k),fe)}function le(k){return k===s?(e.consume(k),s=void 0,ue):k===null?n(k):Ve(k)?(u=le,de(k)):(e.consume(k),le)}function fe(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||Tt(k)?se(k):(e.consume(k),fe)}function ue(k){return k===47||k===62||Tt(k)?se(k):n(k)}function Se(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function de(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),W}function W(k){return st(k)?ut(e,oe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):oe(k)}function oe(k){return e.enter("htmlTextData"),u(k)}}const Mf={name:"labelEnd",resolveAll:w3,resolveTo:_3,tokenize:x3},y3={tokenize:S3},T3={tokenize:v3},b3={tokenize:A3};function w3(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&$n(e,0,e.length,n),e}function _3(e,t){let n=e.length,r=0,s,a,u,l;for(;n--;)if(s=e[n][1],a){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(a=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(u=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:j({},e[a][1].start),end:j({},e[e.length-1][1].end)},f={type:"label",start:j({},e[a][1].start),end:j({},e[u][1].end)},m={type:"labelText",start:j({},e[a+r+2][1].end),end:j({},e[u-2][1].start)};return l=[["enter",d,t],["enter",f,t]],l=Kn(l,e.slice(a+1,a+r+3)),l=Kn(l,[["enter",m,t]]),l=Kn(l,cl(t.parser.constructs.insideSpan.null,e.slice(a+r+4,u-3),t)),l=Kn(l,[["exit",m,t],e[u-2],e[u-1],["exit",f,t]]),l=Kn(l,e.slice(u+1)),l=Kn(l,[["exit",d,t]]),$n(e,a,e.length,l),e}function x3(e,t,n){const r=this;let s=r.events.length,a,u;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){a=r.events[s][1];break}return l;function l(b){return a?a._inactive?p(b):(u=r.parser.defined.includes(cr(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),d):n(b)}function d(b){return b===40?e.attempt(y3,m,u?m:p)(b):b===91?e.attempt(T3,m,u?f:p)(b):u?m(b):p(b)}function f(b){return e.attempt(b3,m,p)(b)}function m(b){return t(b)}function p(b){return a._balanced=!0,n(b)}}function S3(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),s}function s(p){return Tt(p)?Ea(e,a)(p):a(p)}function a(p){return p===41?m(p):aE(e,u,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function u(p){return Tt(p)?Ea(e,d)(p):m(p)}function l(p){return n(p)}function d(p){return p===34||p===39||p===40?lE(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function f(p){return Tt(p)?Ea(e,m)(p):m(p)}function m(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function v3(e,t,n){const r=this;return s;function s(l){return uE.call(r,e,a,u,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(cr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function u(l){return n(l)}}function A3(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),s}function s(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const k3={name:"labelStartImage",resolveAll:Mf.resolveAll,tokenize:C3};function C3(e,t,n){const r=this;return s;function s(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),a}function a(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),u):n(l)}function u(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const N3={name:"labelStartLink",resolveAll:Mf.resolveAll,tokenize:O3};function O3(e,t,n){const r=this;return s;function s(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),a}function a(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const Ff={name:"lineEnding",tokenize:I3};function I3(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ut(e,t,"linePrefix")}}const dl={name:"thematicBreak",tokenize:P3};function P3(e,t,n){let r=0,s;return a;function a(f){return e.enter("thematicBreak"),u(f)}function u(f){return s=f,l(f)}function l(f){return f===s?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||Ve(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===s?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),st(f)?ut(e,l,"whitespace")(f):l(f))}}const On={continuation:{tokenize:M3},exit:B3,name:"list",tokenize:D3},R3={partial:!0,tokenize:U3},L3={partial:!0,tokenize:F3};function D3(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,u=0;return l;function l(y){const _=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:Rf(y)){if(r.containerState.type||(r.containerState.type=_,e.enter(_,{_container:!0})),_==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(dl,n,f)(y):f(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(y)}return n(y)}function d(y){return Rf(y)&&++u<10?(e.consume(y),d):(!r.interrupt||u<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),f(y)):n(y)}function f(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(ma,r.interrupt?n:m,e.attempt(R3,b,p))}function m(y){return r.containerState.initialBlankLine=!0,a++,b(y)}function p(y){return st(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),b):n(y)}function b(y){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function M3(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ma,s,a);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ut(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!st(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,u(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(L3,t,u)(l))}function u(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,ut(e,e.attempt(On,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function F3(e,t,n){const r=this;return ut(e,s,"listItemIndent",r.containerState.size+1);function s(a){const u=r.events[r.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===r.containerState.size?t(a):n(a)}}function B3(e){e.exit(this.containerState.type)}function U3(e,t,n){const r=this;return ut(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const u=r.events[r.events.length-1];return!st(a)&&u&&u[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const dE={name:"setextUnderline",resolveTo:H3,tokenize:j3};function H3(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const u={type:"setextHeading",start:j({},e[r][1].start),end:j({},e[e.length-1][1].end)};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",u,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end=j({},e[a][1].end)):e[r][1]=u,e.push(["exit",u,t]),e}function j3(e,t,n){const r=this;let s;return a;function a(f){let m=r.events.length,p;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){p=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),s=f,u(f)):n(f)}function u(f){return e.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===s?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),st(f)?ut(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||Ve(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const z3={tokenize:$3};function $3(e){const t=this,n=e.attempt(ma,r,e.attempt(this.parser.constructs.flowInitial,s,ut(e,e.attempt(this.parser.constructs.flow,s,e.attempt(GN,s)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const V3={resolveAll:hE()},q3=fE("string"),Y3=fE("text");function fE(e){return{resolveAll:hE(e==="text"?W3:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,u,l);return u;function u(m){return f(m)?a(m):l(m)}function l(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return f(m)?(n.exit("data"),a(m)):(n.consume(m),d)}function f(m){if(m===null)return!0;const p=s[m];let b=-1;if(p)for(;++b<p.length;){const y=p[b];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function hE(e){return t;function t(n,r){let s=-1,a;for(;++s<=n.length;)a===void 0?n[s]&&n[s][1].type==="data"&&(a=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==a+2&&(n[a][1].end=n[s-1][1].end,n.splice(a+2,s-a-2),s=a+2),a=void 0);return e?e(n,r):n}}function W3(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let a=s.length,u=-1,l=0,d;for(;a--;){const f=s[a];if(typeof f=="string"){for(u=f.length;f.charCodeAt(u-1)===32;)l++,u--;if(u)break;u=-1}else if(f===-2)d=!0,l++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const f={type:n===e.length||d||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?u:r.start._bufferIndex+u,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:j({},r.end)};r.end=j({},f.start),r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const G3=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:ZN},disable:{null:[]},document:{42:On,43:On,45:On,48:On,49:On,50:On,51:On,52:On,53:On,54:On,55:On,56:On,57:On,62:tE},flow:{35:s3,42:dl,45:[dE,dl],60:l3,61:dE,95:dl,96:sE,126:sE},flowInitial:{[-2]:Df,[-1]:Df,32:Df},insideSpan:{null:[Lf,V3]},string:{38:rE,92:nE},text:{[-5]:Ff,[-4]:Ff,[-3]:Ff,33:k3,38:rE,42:Lf,60:[NN,g3],91:N3,92:[r3,nE],93:Mf,95:Lf,96:zN}},Symbol.toStringTag,{value:"Module"}));function X3(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},a=[];let u=[],l=[];const d={attempt:V(G),check:V(M),consume:C,enter:O,exit:z,interrupt:V(M,{interrupt:!0})},f={code:null,containerState:{},defineSkip:x,events:[],now:_,parser:e,previous:null,sliceSerialize:b,sliceStream:y,write:p};let m=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function p(ie){return u=Kn(u,ie),A(),u[u.length-1]!==null?[]:(J(t,0),f.events=cl(a,f.events,f),f.events)}function b(ie,te){return Q3(y(ie),te)}function y(ie){return K3(u,ie)}function _(){const{_bufferIndex:ie,_index:te,line:le,column:fe,offset:ue}=r;return{_bufferIndex:ie,_index:te,line:le,column:fe,offset:ue}}function x(ie){s[ie.line]=ie.column,H()}function A(){let ie;for(;r._index<u.length;){const te=u[r._index];if(typeof te=="string")for(ie=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===ie&&r._bufferIndex<te.length;)S(te.charCodeAt(r._bufferIndex));else S(te)}}function S(ie){m=m(ie)}function C(ie){Ve(ie)?(r.line++,r.column=1,r.offset+=ie===-3?2:1,H()):ie!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===u[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=ie}function O(ie,te){const le=te||{};return le.type=ie,le.start=_(),f.events.push(["enter",le,f]),l.push(le),le}function z(ie){const te=l.pop();return te.end=_(),f.events.push(["exit",te,f]),te}function G(ie,te){J(ie,te.from)}function M(ie,te){te.restore()}function V(ie,te){return le;function le(fe,ue,Se){let de,W,oe,k;return Array.isArray(fe)?Z(fe):"tokenize"in fe?Z([fe]):D(fe);function D(he){return ve;function ve(Fe){const Ge=Fe!==null&&he[Fe],et=Fe!==null&&he.null,mt=[...Array.isArray(Ge)?Ge:Ge?[Ge]:[],...Array.isArray(et)?et:et?[et]:[]];return Z(mt)(Fe)}}function Z(he){return de=he,W=0,he.length===0?Se:P(he[W])}function P(he){return ve;function ve(Fe){return k=se(),oe=he,he.partial||(f.currentConstruct=he),he.name&&f.parser.constructs.disable.null.includes(he.name)?Ie():he.tokenize.call(te?Object.assign(Object.create(f),te):f,d,xe,Ie)(Fe)}}function xe(he){return ie(oe,k),ue}function Ie(he){return k.restore(),++W<de.length?P(de[W]):Se}}}function J(ie,te){ie.resolveAll&&!a.includes(ie)&&a.push(ie),ie.resolve&&$n(f.events,te,f.events.length-te,ie.resolve(f.events.slice(te),f)),ie.resolveTo&&(f.events=ie.resolveTo(f.events,f))}function se(){const ie=_(),te=f.previous,le=f.currentConstruct,fe=f.events.length,ue=Array.from(l);return{from:fe,restore:Se};function Se(){r=ie,f.previous=te,f.currentConstruct=le,f.events.length=fe,l=ue,H()}}function H(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function K3(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,a=t.end._bufferIndex;let u;if(n===s)u=[e[n].slice(r,a)];else{if(u=e.slice(n,s),r>-1){const l=u[0];typeof l=="string"?u[0]=l.slice(r):u.shift()}a>0&&u.push(e[s].slice(0,a))}return u}function Q3(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const a=e[n];let u;if(typeof a=="string")u=a;else switch(a){case-5:{u="\r";break}case-4:{u=`
25
25
  `;break}case-3:{u=`\r
26
- `;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&s)continue;u=" ";break}default:u=String.fromCharCode(a)}s=a===-2,r.push(u)}return r.join("")}function J3(e){const r={constructs:Q1([G3,...(e||{}).extensions||[]]),content:s(_N),defined:[],document:s(SN),flow:s(z3),lazy:{},string:s(q3),text:s(Y3)};return r;function s(a){return u;function u(l){return X3(r,a,l)}}}function Z3(e){for(;!oE(e););return e}const pE=/[\0\t\n\r]/g;function eO(){let e=1,t="",n=!0,r;return s;function s(a,u,l){const d=[];let f,m,p,b,y;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(u||void 0).decode(a)),p=0,t="",n&&(a.charCodeAt(0)===65279&&p++,n=void 0);p<a.length;){if(pE.lastIndex=p,f=pE.exec(a),b=f&&f.index!==void 0?f.index:a.length,y=a.charCodeAt(b),!f){t=a.slice(p);break}if(y===10&&p===b&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),p<b&&(d.push(a.slice(p,b)),e+=b-p),y){case 0:{d.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,d.push(-2);e++<m;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}p=b+1}return l&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const tO=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function nO(e){return e.replace(tO,rO)}function rO(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return J1(n.slice(a?2:1),a?16:10)}return Pf(n)||e}const mE={}.hasOwnProperty;function iO(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),sO(n)(Z3(J3(n).document().write(eO()(e,t,!0))))}function sO(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(nt),autolinkProtocol:se,autolinkEmail:se,atxHeading:a(Dt),blockQuote:a(et),characterEscape:se,characterReference:se,codeFenced:a(mt),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:a(mt,u),codeText:a(Lt,u),codeTextData:se,data:se,codeFlowValue:se,definition:a(pn),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:a(wn),hardBreakEscape:a(ze),hardBreakTrailing:a(ze),htmlFlow:a(Ce,u),htmlFlowData:se,htmlText:a(Ce,u),htmlTextData:se,image:a(Xe),label:u,link:a(nt),listItem:a(Mt),listItemValue:b,listOrdered:a(pt,p),listUnordered:a(pt),paragraph:a(Ln),reference:P,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:a(Dt),strong:a(gs),thematicBreak:a(ys)},exit:{atxHeading:d(),atxHeadingSequence:G,autolink:d(),autolinkEmail:Ge,autolinkProtocol:Fe,blockQuote:d(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:Ie,characterReferenceMarkerNumeric:Ie,characterReferenceValue:he,characterReference:ve,codeFenced:d(A),codeFencedFence:x,codeFencedFenceInfo:y,codeFencedFenceMeta:_,codeFlowValue:H,codeIndented:d(S),codeText:d(ue),codeTextData:H,data:H,definition:d(),definitionDestinationString:z,definitionLabelString:C,definitionTitleString:O,emphasis:d(),hardBreakEscape:d(te),hardBreakTrailing:d(te),htmlFlow:d(le),htmlFlowData:H,htmlText:d(fe),htmlTextData:H,image:d(de),label:oe,labelText:W,lineEnding:ie,link:d(Se),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:xe,resourceDestinationString:k,resourceTitleString:M,resource:Z,setextHeading:d(J),setextHeadingLineSequence:V,setextHeadingText:D,strong:d(),thematicBreak:d()}};gE(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ae){let _e={type:"root",children:[]};const $e={stack:[_e],tokenStack:[],config:t,enter:l,exit:f,buffer:u,resume:m,data:n},Ze=[];let at=-1;for(;++at<ae.length;)if(ae[at][1].type==="listOrdered"||ae[at][1].type==="listUnordered")if(ae[at][0]==="enter")Ze.push(at);else{const re=Ze.pop();at=s(ae,re,at)}for(at=-1;++at<ae.length;){const re=t[ae[at][0]];mE.call(re,ae[at][1].type)&&re[ae[at][1].type].call(Object.assign({sliceSerialize:ae[at][2].sliceSerialize},$e),ae[at][1])}if($e.tokenStack.length>0){const re=$e.tokenStack[$e.tokenStack.length-1];(re[1]||EE).call($e,void 0,re[0])}for(_e.position={start:pi(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:pi(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at<t.transforms.length;)_e=t.transforms[at](_e)||_e;return _e}function s(ae,_e,$e){let Ze=_e-1,at=-1,re=!1,Ae,ke,Ne,ye;for(;++Ze<=$e;){const Le=ae[Ze];switch(Le[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Le[0]==="enter"?at++:at--,ye=void 0;break}case"lineEndingBlank":{Le[0]==="enter"&&(Ae&&!ye&&!at&&!Ne&&(Ne=Ze),ye=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ye=void 0}if(!at&&Le[0]==="enter"&&Le[1].type==="listItemPrefix"||at===-1&&Le[0]==="exit"&&(Le[1].type==="listUnordered"||Le[1].type==="listOrdered")){if(Ae){let tt=Ze;for(ke=void 0;tt--;){const Ot=ae[tt];if(Ot[1].type==="lineEnding"||Ot[1].type==="lineEndingBlank"){if(Ot[0]==="exit")continue;ke&&(ae[ke][1].type="lineEndingBlank",re=!0),Ot[1].type="lineEnding",ke=tt}else if(!(Ot[1].type==="linePrefix"||Ot[1].type==="blockQuotePrefix"||Ot[1].type==="blockQuotePrefixWhitespace"||Ot[1].type==="blockQuoteMarker"||Ot[1].type==="listItemIndent"))break}Ne&&(!ke||Ne<ke)&&(Ae._spread=!0),Ae.end=Object.assign({},ke?ae[ke][1].start:Le[1].end),ae.splice(ke||Ze,0,["exit",Ae,Le[2]]),Ze++,$e++}if(Le[1].type==="listItemPrefix"){const tt={type:"listItem",_spread:!1,start:Object.assign({},Le[1].start),end:void 0};Ae=tt,ae.splice(Ze,0,["enter",tt,Le[2]]),Ze++,$e++,Ne=void 0,ye=!0}}}return ae[_e][1]._spread=re,$e}function a(ae,_e){return $e;function $e(Ze){l.call(this,ae(Ze),Ze),_e&&_e.call(this,Ze)}}function u(){this.stack.push({type:"fragment",children:[]})}function l(ae,_e,$e){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([_e,$e||void 0]),ae.position={start:pi(_e.start),end:void 0}}function d(ae){return _e;function _e($e){ae&&ae.call(this,$e),f.call(this,$e)}}function f(ae,_e){const $e=this.stack.pop(),Ze=this.tokenStack.pop();if(Ze)Ze[0].type!==ae.type&&(_e?_e.call(this,ae,Ze[0]):(Ze[1]||EE).call(this,ae,Ze[0]));else throw new Error("Cannot close `"+ae.type+"` ("+ha({start:ae.start,end:ae.end})+"): it’s not open");$e.position.end=pi(ae.end)}function m(){return If(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function b(ae){if(this.data.expectingFirstListItemValue){const _e=this.stack[this.stack.length-2];_e.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function y(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.lang=ae}function _(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.meta=ae}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function A(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ae.replace(/(\r?\n|\r)$/g,"")}function C(ae){const _e=this.resume(),$e=this.stack[this.stack.length-1];$e.label=_e,$e.identifier=cr(this.sliceSerialize(ae)).toLowerCase()}function O(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.title=ae}function z(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.url=ae}function G(ae){const _e=this.stack[this.stack.length-1];if(!_e.depth){const $e=this.sliceSerialize(ae).length;_e.depth=$e}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function V(ae){const _e=this.stack[this.stack.length-1];_e.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function J(){this.data.setextHeadingSlurpLineEnding=void 0}function se(ae){const $e=this.stack[this.stack.length-1].children;let Ze=$e[$e.length-1];(!Ze||Ze.type!=="text")&&(Ze=Es(),Ze.position={start:pi(ae.start),end:void 0},$e.push(Ze)),this.stack.push(Ze)}function H(ae){const _e=this.stack.pop();_e.value+=this.sliceSerialize(ae),_e.position.end=pi(ae.end)}function ie(ae){const _e=this.stack[this.stack.length-1];if(this.data.atHardBreak){const $e=_e.children[_e.children.length-1];$e.position.end=pi(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(_e.type)&&(se.call(this,ae),H.call(this,ae))}function te(){this.data.atHardBreak=!0}function le(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ae}function fe(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ae}function ue(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ae}function Se(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const _e=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=_e,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function de(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const _e=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=_e,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function W(ae){const _e=this.sliceSerialize(ae),$e=this.stack[this.stack.length-2];$e.label=nO(_e),$e.identifier=cr(_e).toLowerCase()}function oe(){const ae=this.stack[this.stack.length-1],_e=this.resume(),$e=this.stack[this.stack.length-1];if(this.data.inReference=!0,$e.type==="link"){const Ze=ae.children;$e.children=Ze}else $e.alt=_e}function k(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.url=ae}function M(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.title=ae}function Z(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function xe(ae){const _e=this.resume(),$e=this.stack[this.stack.length-1];$e.label=_e,$e.identifier=cr(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function Ie(ae){this.data.characterReferenceType=ae.type}function he(ae){const _e=this.sliceSerialize(ae),$e=this.data.characterReferenceType;let Ze;$e?(Ze=J1(_e,$e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ze=Pf(_e);const at=this.stack[this.stack.length-1];at.value+=Ze}function ve(ae){const _e=this.stack.pop();_e.position.end=pi(ae.end)}function Fe(ae){H.call(this,ae);const _e=this.stack[this.stack.length-1];_e.url=this.sliceSerialize(ae)}function Ge(ae){H.call(this,ae);const _e=this.stack[this.stack.length-1];_e.url="mailto:"+this.sliceSerialize(ae)}function et(){return{type:"blockquote",children:[]}}function mt(){return{type:"code",lang:null,meta:null,value:""}}function Lt(){return{type:"inlineCode",value:""}}function pn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function wn(){return{type:"emphasis",children:[]}}function Dt(){return{type:"heading",depth:0,children:[]}}function ze(){return{type:"break"}}function Ce(){return{type:"html",value:""}}function Xe(){return{type:"image",title:null,url:"",alt:null}}function nt(){return{type:"link",title:null,url:"",children:[]}}function pt(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function Mt(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function Ln(){return{type:"paragraph",children:[]}}function gs(){return{type:"strong",children:[]}}function Es(){return{type:"text",value:""}}function ys(){return{type:"thematicBreak"}}}function pi(e){return{line:e.line,column:e.column,offset:e.offset}}function gE(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?gE(e,r):oO(e,r)}}function oO(e,t){let n;for(n in t)if(mE.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function EE(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ha({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ha({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ha({start:t.start,end:t.end})+") is still open")}function aO(e){const t=this;t.parser=n;function n(r){return iO(r,ce(j(j({},t.data("settings")),e),{extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]}))}}function uO(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function lO(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
26
+ `;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&s)continue;u=" ";break}default:u=String.fromCharCode(a)}s=a===-2,r.push(u)}return r.join("")}function J3(e){const r={constructs:Q1([G3,...(e||{}).extensions||[]]),content:s(_N),defined:[],document:s(SN),flow:s(z3),lazy:{},string:s(q3),text:s(Y3)};return r;function s(a){return u;function u(l){return X3(r,a,l)}}}function Z3(e){for(;!oE(e););return e}const pE=/[\0\t\n\r]/g;function eO(){let e=1,t="",n=!0,r;return s;function s(a,u,l){const d=[];let f,m,p,b,y;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(u||void 0).decode(a)),p=0,t="",n&&(a.charCodeAt(0)===65279&&p++,n=void 0);p<a.length;){if(pE.lastIndex=p,f=pE.exec(a),b=f&&f.index!==void 0?f.index:a.length,y=a.charCodeAt(b),!f){t=a.slice(p);break}if(y===10&&p===b&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),p<b&&(d.push(a.slice(p,b)),e+=b-p),y){case 0:{d.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,d.push(-2);e++<m;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}p=b+1}return l&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const tO=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function nO(e){return e.replace(tO,rO)}function rO(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return J1(n.slice(a?2:1),a?16:10)}return Pf(n)||e}const mE={}.hasOwnProperty;function iO(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),sO(n)(Z3(J3(n).document().write(eO()(e,t,!0))))}function sO(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(nt),autolinkProtocol:se,autolinkEmail:se,atxHeading:a(Dt),blockQuote:a(et),characterEscape:se,characterReference:se,codeFenced:a(mt),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:a(mt,u),codeText:a(Lt,u),codeTextData:se,data:se,codeFlowValue:se,definition:a(pn),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:a(wn),hardBreakEscape:a(ze),hardBreakTrailing:a(ze),htmlFlow:a(Ce,u),htmlFlowData:se,htmlText:a(Ce,u),htmlTextData:se,image:a(Xe),label:u,link:a(nt),listItem:a(Mt),listItemValue:b,listOrdered:a(pt,p),listUnordered:a(pt),paragraph:a(Ln),reference:P,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:a(Dt),strong:a(gs),thematicBreak:a(ys)},exit:{atxHeading:d(),atxHeadingSequence:G,autolink:d(),autolinkEmail:Ge,autolinkProtocol:Fe,blockQuote:d(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:Ie,characterReferenceMarkerNumeric:Ie,characterReferenceValue:he,characterReference:ve,codeFenced:d(A),codeFencedFence:x,codeFencedFenceInfo:y,codeFencedFenceMeta:_,codeFlowValue:H,codeIndented:d(S),codeText:d(ue),codeTextData:H,data:H,definition:d(),definitionDestinationString:z,definitionLabelString:C,definitionTitleString:O,emphasis:d(),hardBreakEscape:d(te),hardBreakTrailing:d(te),htmlFlow:d(le),htmlFlowData:H,htmlText:d(fe),htmlTextData:H,image:d(de),label:oe,labelText:W,lineEnding:ie,link:d(Se),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:xe,resourceDestinationString:k,resourceTitleString:D,resource:Z,setextHeading:d(J),setextHeadingLineSequence:V,setextHeadingText:M,strong:d(),thematicBreak:d()}};gE(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ae){let _e={type:"root",children:[]};const $e={stack:[_e],tokenStack:[],config:t,enter:l,exit:f,buffer:u,resume:m,data:n},Ze=[];let at=-1;for(;++at<ae.length;)if(ae[at][1].type==="listOrdered"||ae[at][1].type==="listUnordered")if(ae[at][0]==="enter")Ze.push(at);else{const re=Ze.pop();at=s(ae,re,at)}for(at=-1;++at<ae.length;){const re=t[ae[at][0]];mE.call(re,ae[at][1].type)&&re[ae[at][1].type].call(Object.assign({sliceSerialize:ae[at][2].sliceSerialize},$e),ae[at][1])}if($e.tokenStack.length>0){const re=$e.tokenStack[$e.tokenStack.length-1];(re[1]||EE).call($e,void 0,re[0])}for(_e.position={start:pi(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:pi(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at<t.transforms.length;)_e=t.transforms[at](_e)||_e;return _e}function s(ae,_e,$e){let Ze=_e-1,at=-1,re=!1,Ae,ke,Ne,ye;for(;++Ze<=$e;){const Le=ae[Ze];switch(Le[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Le[0]==="enter"?at++:at--,ye=void 0;break}case"lineEndingBlank":{Le[0]==="enter"&&(Ae&&!ye&&!at&&!Ne&&(Ne=Ze),ye=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ye=void 0}if(!at&&Le[0]==="enter"&&Le[1].type==="listItemPrefix"||at===-1&&Le[0]==="exit"&&(Le[1].type==="listUnordered"||Le[1].type==="listOrdered")){if(Ae){let tt=Ze;for(ke=void 0;tt--;){const Ot=ae[tt];if(Ot[1].type==="lineEnding"||Ot[1].type==="lineEndingBlank"){if(Ot[0]==="exit")continue;ke&&(ae[ke][1].type="lineEndingBlank",re=!0),Ot[1].type="lineEnding",ke=tt}else if(!(Ot[1].type==="linePrefix"||Ot[1].type==="blockQuotePrefix"||Ot[1].type==="blockQuotePrefixWhitespace"||Ot[1].type==="blockQuoteMarker"||Ot[1].type==="listItemIndent"))break}Ne&&(!ke||Ne<ke)&&(Ae._spread=!0),Ae.end=Object.assign({},ke?ae[ke][1].start:Le[1].end),ae.splice(ke||Ze,0,["exit",Ae,Le[2]]),Ze++,$e++}if(Le[1].type==="listItemPrefix"){const tt={type:"listItem",_spread:!1,start:Object.assign({},Le[1].start),end:void 0};Ae=tt,ae.splice(Ze,0,["enter",tt,Le[2]]),Ze++,$e++,Ne=void 0,ye=!0}}}return ae[_e][1]._spread=re,$e}function a(ae,_e){return $e;function $e(Ze){l.call(this,ae(Ze),Ze),_e&&_e.call(this,Ze)}}function u(){this.stack.push({type:"fragment",children:[]})}function l(ae,_e,$e){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([_e,$e||void 0]),ae.position={start:pi(_e.start),end:void 0}}function d(ae){return _e;function _e($e){ae&&ae.call(this,$e),f.call(this,$e)}}function f(ae,_e){const $e=this.stack.pop(),Ze=this.tokenStack.pop();if(Ze)Ze[0].type!==ae.type&&(_e?_e.call(this,ae,Ze[0]):(Ze[1]||EE).call(this,ae,Ze[0]));else throw new Error("Cannot close `"+ae.type+"` ("+ha({start:ae.start,end:ae.end})+"): it’s not open");$e.position.end=pi(ae.end)}function m(){return If(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function b(ae){if(this.data.expectingFirstListItemValue){const _e=this.stack[this.stack.length-2];_e.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function y(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.lang=ae}function _(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.meta=ae}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function A(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ae.replace(/(\r?\n|\r)$/g,"")}function C(ae){const _e=this.resume(),$e=this.stack[this.stack.length-1];$e.label=_e,$e.identifier=cr(this.sliceSerialize(ae)).toLowerCase()}function O(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.title=ae}function z(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.url=ae}function G(ae){const _e=this.stack[this.stack.length-1];if(!_e.depth){const $e=this.sliceSerialize(ae).length;_e.depth=$e}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function V(ae){const _e=this.stack[this.stack.length-1];_e.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function J(){this.data.setextHeadingSlurpLineEnding=void 0}function se(ae){const $e=this.stack[this.stack.length-1].children;let Ze=$e[$e.length-1];(!Ze||Ze.type!=="text")&&(Ze=Es(),Ze.position={start:pi(ae.start),end:void 0},$e.push(Ze)),this.stack.push(Ze)}function H(ae){const _e=this.stack.pop();_e.value+=this.sliceSerialize(ae),_e.position.end=pi(ae.end)}function ie(ae){const _e=this.stack[this.stack.length-1];if(this.data.atHardBreak){const $e=_e.children[_e.children.length-1];$e.position.end=pi(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(_e.type)&&(se.call(this,ae),H.call(this,ae))}function te(){this.data.atHardBreak=!0}function le(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ae}function fe(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ae}function ue(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ae}function Se(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const _e=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=_e,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function de(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const _e=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=_e,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function W(ae){const _e=this.sliceSerialize(ae),$e=this.stack[this.stack.length-2];$e.label=nO(_e),$e.identifier=cr(_e).toLowerCase()}function oe(){const ae=this.stack[this.stack.length-1],_e=this.resume(),$e=this.stack[this.stack.length-1];if(this.data.inReference=!0,$e.type==="link"){const Ze=ae.children;$e.children=Ze}else $e.alt=_e}function k(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.url=ae}function D(){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.title=ae}function Z(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function xe(ae){const _e=this.resume(),$e=this.stack[this.stack.length-1];$e.label=_e,$e.identifier=cr(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function Ie(ae){this.data.characterReferenceType=ae.type}function he(ae){const _e=this.sliceSerialize(ae),$e=this.data.characterReferenceType;let Ze;$e?(Ze=J1(_e,$e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ze=Pf(_e);const at=this.stack[this.stack.length-1];at.value+=Ze}function ve(ae){const _e=this.stack.pop();_e.position.end=pi(ae.end)}function Fe(ae){H.call(this,ae);const _e=this.stack[this.stack.length-1];_e.url=this.sliceSerialize(ae)}function Ge(ae){H.call(this,ae);const _e=this.stack[this.stack.length-1];_e.url="mailto:"+this.sliceSerialize(ae)}function et(){return{type:"blockquote",children:[]}}function mt(){return{type:"code",lang:null,meta:null,value:""}}function Lt(){return{type:"inlineCode",value:""}}function pn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function wn(){return{type:"emphasis",children:[]}}function Dt(){return{type:"heading",depth:0,children:[]}}function ze(){return{type:"break"}}function Ce(){return{type:"html",value:""}}function Xe(){return{type:"image",title:null,url:"",alt:null}}function nt(){return{type:"link",title:null,url:"",children:[]}}function pt(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function Mt(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function Ln(){return{type:"paragraph",children:[]}}function gs(){return{type:"strong",children:[]}}function Es(){return{type:"text",value:""}}function ys(){return{type:"thematicBreak"}}}function pi(e){return{line:e.line,column:e.column,offset:e.offset}}function gE(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?gE(e,r):oO(e,r)}}function oO(e,t){let n;for(n in t)if(mE.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function EE(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ha({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ha({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ha({start:t.start,end:t.end})+") is still open")}function aO(e){const t=this;t.parser=n;function n(r){return iO(r,ce(j(j({},t.data("settings")),e),{extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]}))}}function uO(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function lO(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
27
27
  `}]}function cO(e,t){const n=t.value?t.value+`
28
28
  `:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function dO(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fO(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hO(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Ws(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let u,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),u=e.footnoteOrder.length):u=a+1,l+=1,e.footnoteCounts.set(r,l);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function pO(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mO(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function yE(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const u=s[s.length-1];return u&&u.type==="text"?u.value+=r:s.push({type:"text",value:r}),s}function gO(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yE(e,t);const s={src:Ws(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function EO(e,t){const n={src:Ws(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function yO(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function TO(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yE(e,t);const s={href:Ws(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function bO(e,t){const n={href:Ws(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function wO(e,t,n){const r=e.all(t),s=n?_O(n):TE(t),a={},u=[];if(typeof t.checked=="boolean"){const m=r[0];let p;m&&m.type==="element"&&m.tagName==="p"?p=m:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const m=r[l];(s||l!==0||m.type!=="element"||m.tagName!=="p")&&u.push({type:"text",value:`
29
29
  `}),m.type==="element"&&m.tagName==="p"&&!s?u.push(...m.children):u.push(m)}const d=r[r.length-1];d&&(s||d.type!=="element"||d.tagName!=="p")&&u.push({type:"text",value:`
@@ -34,8 +34,8 @@ Error generating stack: `+T.message+`
34
34
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
35
35
  `}),n}function PE(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function RE(e,t){const n=KO(e,t),r=n.one(e,void 0),s=HO(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:`
36
36
  `},s),a}function tI(e,t){return e&&"run"in e?function(n,r){return Be(this,null,function*(){const s=RE(n,j({file:r},t));yield e.run(s,r)})}:function(n,r){return RE(n,j({file:r},e||t))}}function LE(e){if(e)throw e}var Vf,DE;function nI(){if(DE)return Vf;DE=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var m=e.call(f,"constructor"),p=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!m&&!p)return!1;var b;for(b in f);return typeof b=="undefined"||e.call(f,b)},u=function(f,m){n&&m.name==="__proto__"?n(f,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):f[m.name]=m.newValue},l=function(f,m){if(m==="__proto__")if(e.call(f,m)){if(r)return r(f,m).value}else return;return f[m]};return Vf=function d(){var f,m,p,b,y,_,x=arguments[0],A=1,S=arguments.length,C=!1;for(typeof x=="boolean"&&(C=x,x=arguments[1]||{},A=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});A<S;++A)if(f=arguments[A],f!=null)for(m in f)p=l(x,m),b=l(f,m),x!==b&&(C&&b&&(a(b)||(y=s(b)))?(y?(y=!1,_=p&&s(p)?p:[]):_=p&&a(p)?p:{},u(x,{name:m,newValue:d(C,_,b)})):typeof b!="undefined"&&u(x,{name:m,newValue:b}));return x},Vf}var rI=nI();const qf=it(rI);function Yf(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function iI(){const e=[],t={run:n,use:r};return t;function n(...s){let a=-1;const u=s.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);l(null,...s);function l(d,...f){const m=e[++a];let p=-1;if(d){u(d);return}for(;++p<s.length;)(f[p]===null||f[p]===void 0)&&(f[p]=s[p]);s=f,m?sI(m,l)(...f):u(null,...f)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function sI(e,t){let n;return r;function r(...u){const l=e.length>u.length;let d;l&&u.push(s);try{d=e.apply(this,u)}catch(f){const m=f;if(l&&n)throw m;return s(m)}l||(d&&d.then&&typeof d.then=="function"?d.then(a,s):d instanceof Error?s(d):a(d))}function s(u,...l){n||(n=!0,t(u,...l))}function a(u){s(null,u)}}const Ar={basename:oI,dirname:aI,extname:uI,join:lI,sep:"/"};function oI(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ba(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let u=-1,l=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else u<0&&(a=!0,u=s+1),l>-1&&(e.codePointAt(s)===t.codePointAt(l--)?l<0&&(r=s):(l=-1,r=u));return n===r?r=u:r<0&&(r=e.length),e.slice(n,r)}function aI(e){if(ba(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function uI(e){ba(e);let t=e.length,n=-1,r=0,s=-1,a=0,u;for(;t--;){const l=e.codePointAt(t);if(l===47){if(u){r=t+1;break}continue}n<0&&(u=!0,n=t+1),l===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function lI(...e){let t=-1,n;for(;++t<e.length;)ba(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":cI(n)}function cI(e){ba(e);const t=e.codePointAt(0)===47;let n=dI(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function dI(e,t){let n="",r=0,s=-1,a=0,u=-1,l,d;for(;++u<=e.length;){if(u<e.length)l=e.codePointAt(u);else{if(l===47)break;l=47}if(l===47){if(!(s===u-1||a===1))if(s!==u-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),s=u,a=0;continue}}else if(n.length>0){n="",r=0,s=u,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,u):n=e.slice(s+1,u),r=u-s-1;s=u,a=0}else l===46&&a>-1?a++:a=-1}return n}function ba(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const fI={cwd:hI};function hI(){return"/"}function Wf(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function pI(e){if(typeof e=="string")e=new URL(e);else if(!Wf(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return mI(e)}function mI(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Gf=["history","path","basename","stem","extname","dirname"];class ME{constructor(t){let n;t?Wf(t)?n={path:t}:typeof t=="string"||gI(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":fI.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Gf.length;){const a=Gf[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let s;for(s in n)Gf.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Ar.basename(this.path):void 0}set basename(t){Kf(t,"basename"),Xf(t,"basename"),this.path=Ar.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ar.dirname(this.path):void 0}set dirname(t){FE(this.basename,"dirname"),this.path=Ar.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ar.extname(this.path):void 0}set extname(t){if(Xf(t,"extname"),FE(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ar.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Wf(t)&&(t=pI(t)),Kf(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ar.basename(this.path,this.extname):void 0}set stem(t){Kf(t,"stem"),Xf(t,"stem"),this.path=Ar.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new cn(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Xf(e,t){if(e&&e.includes(Ar.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ar.sep+"`")}function Kf(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function FE(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function gI(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const EI=(function(e){const r=this.constructor.prototype,s=r[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),yI={}.hasOwnProperty;class Qf extends EI{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=iI()}copy(){const t=new Qf;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(qf(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(eh("data",this.frozen),this.namespace[t]=n,this):yI.call(this.namespace,t)&&this.namespace[t]||void 0:t?(eh("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Tl(t),r=this.parser||this.Parser;return Jf("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Jf("process",this.parser||this.Parser),Zf("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,u){const l=Tl(t),d=r.parse(l);r.run(d,l,function(m,p,b){if(m||!p||!b)return f(m);const y=p,_=r.stringify(y,b);wI(_)?b.value=_:b.result=_,f(m,b)});function f(m,p){m||!p?u(m):a?a(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),Jf("processSync",this.parser||this.Parser),Zf("processSync",this.compiler||this.Compiler),this.process(t,s),UE("processSync","process",n),r;function s(a,u){n=!0,LE(a),r=u}}run(t,n,r){BE(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(u,l){const d=Tl(n);s.run(t,d,f);function f(m,p,b){const y=p||t;m?l(m):u?u(y):r(void 0,y,b)}}}runSync(t,n){let r=!1,s;return this.run(t,n,a),UE("runSync","run",r),s;function a(u,l){LE(u),s=l,r=!0}}stringify(t,n){this.freeze();const r=Tl(n),s=this.compiler||this.Compiler;return Zf("stringify",s),BE(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(eh("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[m,...p]=f;d(m,p)}else u(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function u(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(f.plugins),f.settings&&(s.settings=qf(!0,s.settings,f.settings))}function l(f){let m=-1;if(f!=null)if(Array.isArray(f))for(;++m<f.length;){const p=f[m];a(p)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,m){let p=-1,b=-1;for(;++p<r.length;)if(r[p][0]===f){b=p;break}if(b===-1)r.push([f,...m]);else if(m.length>0){let[y,..._]=m;const x=r[b][1];Yf(x)&&Yf(y)&&(y=qf(!0,x,y)),r[b]=[f,y,..._]}}}}const TI=new Qf().freeze();function Jf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Zf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function eh(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function BE(e){if(!Yf(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function UE(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Tl(e){return bI(e)?e:new ME(e)}function bI(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function wI(e){return typeof e=="string"||_I(e)}function _I(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const xI="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",HE=[],jE={allowDangerousHtml:!0},SI=/^(https?|ircs?|mailto|xmpp)$/i,vI=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function zE(e){const t=AI(e),n=kI(e);return CI(t.runSync(t.parse(n),n),e)}function AI(e){const t=e.rehypePlugins||HE,n=e.remarkPlugins||HE,r=e.remarkRehypeOptions?j(j({},e.remarkRehypeOptions),jE):jE;return TI().use(aO).use(n).use(tI,r).use(t)}function kI(e){const t=e.children||"",n=new ME;return typeof t=="string"&&(n.value=t),n}function CI(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,a=t.disallowedElements,u=t.skipHtml,l=t.unwrapDisallowed,d=t.urlTransform||NI;for(const m of vI)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+xI+m.id,void 0);return yl(e,f),ZC(e,{Fragment:w.Fragment,components:s,ignoreInvalidStyle:!0,jsx:w.jsx,jsxs:w.jsxs,passKeys:!0,passNode:!0});function f(m,p,b){if(m.type==="raw"&&b&&typeof p=="number")return u?b.children.splice(p,1):b.children[p]={type:"text",value:m.value},p;if(m.type==="element"){let y;for(y in Of)if(Object.hasOwn(Of,y)&&Object.hasOwn(m.properties,y)){const _=m.properties[y],x=Of[y];(x===null||x.includes(m.tagName))&&(m.properties[y]=d(String(_||""),y,m))}}if(m.type==="element"){let y=n?!n.includes(m.tagName):a?a.includes(m.tagName):!1;if(!y&&r&&typeof p=="number"&&(y=!r(m,p,b)),y&&b&&typeof p=="number")return l&&m.children?b.children.splice(p,1,...m.children):b.children.splice(p,1),p}}}function NI(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||SI.test(e.slice(0,t))?e:""}const $E=/[#.]/g;function OI(e,t){const n=e||"",r={};let s=0,a,u;for(;s<n.length;){$E.lastIndex=s;const l=$E.exec(n),d=n.slice(s,l?l.index:n.length);d&&(a?a==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:u=d,s+=d.length),l&&(a=l[0],s++)}return{type:"element",tagName:u||t||"div",properties:r,children:[]}}function VE(e,t,n){const r=n?LI(n):void 0;function s(a,u,...l){let d;if(a==null){d={type:"root",children:[]};const f=u;l.unshift(f)}else{d=OI(a,t);const f=d.tagName.toLowerCase(),m=r?r.get(f):void 0;if(d.tagName=m||f,II(u))l.unshift(u);else for(const[p,b]of Object.entries(u))PI(e,d.properties,p,b)}for(const f of l)th(d.children,f);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return s}function II(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const s=t[r];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const a=s;for(const u of a)if(typeof u!="number"&&typeof u!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function PI(e,t,n,r){const s=ol(e,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?s.spaceSeparated?a=R1(r):s.commaSeparated?a=b1(r):s.commaOrSpaceSeparated?a=R1(b1(r).join(" ")):a=qE(s,s.property,r):Array.isArray(r)?a=[...r]:a=s.property==="style"?RI(r):String(r);if(Array.isArray(a)){const u=[];for(const l of a)u.push(qE(s,s.property,l));a=u}s.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[s.property]=a}}function th(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)th(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?th(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function qE(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||la(n)===la(t)))return!0}return n}function RI(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function LI(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const DI=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],MI=VE(ca,"div"),FI=VE(fi,"g",DI);function BI(e){const t=String(e),n=[];return{toOffset:s,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let u=0;for(;;){let l=n[u];if(l===void 0){const d=YE(t,n[u-1]);l=d===-1?t.length+1:d+1,n[u]=l}if(l>a)return{line:u+1,column:a-(u>0?n[u-1]:0)+1,offset:a};u++}}}function s(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const l=n[n.length-1],d=YE(t,l),f=d===-1?t.length+1:d+1;if(l===f)break;n.push(f)}const u=(a.line>1?n[a.line-2]:0)+a.column-1;if(u<n[a.line-1])return u}}}function YE(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
37
- `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const rs={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},WE={}.hasOwnProperty,UI=Object.prototype;function HI(e,t){const n=t||{};return nh({file:n.file||void 0,location:!1,schema:n.space==="svg"?fi:ca,verbose:n.verbose||!1},e)}function nh(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},bl(e,r,n),n}case"#document":case"#document-fragment":{const r=t,s="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:GE(e,t.childNodes),data:{quirksMode:s}},e.file&&e.location){const a=String(e.file),u=BI(a),l=u.toPoint(0),d=u.toPoint(a.length);n.position={start:l,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},bl(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},bl(e,r,n),n}default:return n=jI(e,t),n}}function GE(e,t){let n=-1;const r=[];for(;++n<t.length;){const s=nh(e,t[n]);r.push(s)}return r}function jI(e,t){const n=e.schema;e.schema=t.namespaceURI===rs.svg?fi:ca;let r=-1;const s={};for(;++r<t.attrs.length;){const l=t.attrs[r],d=(l.prefix?l.prefix+":":"")+l.name;WE.call(UI,d)||(s[d]=l.value)}const u=(e.schema.space==="svg"?FI:MI)(t.tagName,s,GE(e,t.childNodes));if(bl(e,t,u),u.tagName==="template"){const l=t,d=l.sourceCodeLocation,f=d&&d.startTag&&Xs(d.startTag),m=d&&d.endTag&&Xs(d.endTag),p=nh(e,l.content);f&&m&&e.file&&(p.position={start:f.end,end:m.start}),u.content=p}return e.schema=n,u}function bl(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=zI(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function zI(e,t,n){const r=Xs(n);if(t.type==="element"){const s=t.children[t.children.length-1];if(r&&!n.endTag&&s&&s.position&&s.position.end&&(r.end=Object.assign({},s.position.end)),e.verbose){const a={};let u;if(n.attrs)for(u in n.attrs)WE.call(n.attrs,u)&&(a[ol(e.schema,u).property]=Xs(n.attrs[u]));n.startTag;const l=Xs(n.startTag),d=n.endTag?Xs(n.endTag):void 0,f={opening:l};d&&(f.closing=d),f.properties=a,t.data={position:f}}}return r}function Xs(e){const t=XE({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=XE({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function XE(e){return e.line&&e.column?e:void 0}const KE={}.hasOwnProperty;function QE(e,t){const n=t||{};function r(s,...a){let u=r.invalid;const l=r.handlers;if(s&&KE.call(s,e)){const d=String(s[e]);u=KE.call(l,d)?l[d]:r.unknown}if(u)return u.call(this,s,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const $I={},VI={}.hasOwnProperty,JE=QE("type",{handlers:{root:YI,element:QI,text:XI,comment:KI,doctype:GI}});function qI(e,t){const r=(t||$I).space;return JE(e,r==="svg"?fi:ca)}function YI(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=rh(e.children,n,t),Ks(e,n),n}function WI(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=rh(e.children,n,t),Ks(e,n),n}function GI(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Ks(e,t),t}function XI(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Ks(e,t),t}function KI(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Ks(e,t),t}function QI(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=fi);const s=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&VI.call(e.properties,a)){const d=JI(r,a,e.properties[a]);d&&s.push(d)}}const u=r.space,l={nodeName:e.tagName,tagName:e.tagName,attrs:s,namespaceURI:rs[u],childNodes:[],parentNode:null};return l.childNodes=rh(e.children,l,r),Ks(e,l),e.tagName==="template"&&e.content&&(l.content=WI(e.content,r)),l}function JI(e,t,n){const r=ol(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?w1(n):L1(n));const s={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=s.name.indexOf(":");a<0?s.prefix="":(s.name=s.name.slice(a+1),s.prefix=r.attribute.slice(0,a)),s.namespace=rs[r.space]}return s}function rh(e,t,n){let r=-1;const s=[];if(e)for(;++r<e.length;){const a=JE(e[r],n);a.parentNode=t,s.push(a)}return s}function Ks(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const ZI=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],eP=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),kt="�";var I;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(I||(I={}));const In={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function ZE(e){return e>=55296&&e<=57343}function tP(e){return e>=56320&&e<=57343}function nP(e,t){return(e-55296)*1024+9216+t}function ey(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function ty(e){return e>=64976&&e<=65007||eP.has(e)}var ne;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ne||(ne={}));const rP=65536;class iP{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=rP,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:s,offset:a}=this,u=s+n,l=a+n;return{code:t,startLine:r,endLine:r,startCol:u,endCol:u,startOffset:l,endOffset:l}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(tP(n))return this.pos++,this._addGap(),nP(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,I.EOF;return this._err(ne.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;const r=this.html.charCodeAt(n);return r===I.CARRIAGE_RETURN?I.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;let t=this.html.charCodeAt(this.pos);return t===I.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,I.LINE_FEED):t===I.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,ZE(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===I.LINE_FEED||t===I.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){ey(t)?this._err(ne.controlCharacterInInputStream):ty(t)&&this._err(ne.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var rt;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(rt||(rt={}));function ny(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const sP=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),oP=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function aP(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=oP.get(e))!==null&&t!==void 0?t:e}var Kt;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Kt||(Kt={}));const uP=32;var mi;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(mi||(mi={}));function ih(e){return e>=Kt.ZERO&&e<=Kt.NINE}function lP(e){return e>=Kt.UPPER_A&&e<=Kt.UPPER_F||e>=Kt.LOWER_A&&e<=Kt.LOWER_F}function cP(e){return e>=Kt.UPPER_A&&e<=Kt.UPPER_Z||e>=Kt.LOWER_A&&e<=Kt.LOWER_Z||ih(e)}function dP(e){return e===Kt.EQUALS||cP(e)}var Qt;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Qt||(Qt={}));var qr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(qr||(qr={}));class fP{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Qt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=qr.Strict}startEntity(t){this.decodeMode=t,this.state=Qt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Qt.EntityStart:return t.charCodeAt(n)===Kt.NUM?(this.state=Qt.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Qt.NamedEntity,this.stateNamedEntity(t,n));case Qt.NumericStart:return this.stateNumericStart(t,n);case Qt.NumericDecimal:return this.stateNumericDecimal(t,n);case Qt.NumericHex:return this.stateNumericHex(t,n);case Qt.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|uP)===Kt.LOWER_X?(this.state=Qt.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Qt.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,s){if(n!==r){const a=r-n;this.result=this.result*Math.pow(s,a)+Number.parseInt(t.substr(n,a),s),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(ih(s)||lP(s))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(ih(s))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Kt.SEMI)this.consumed+=1;else if(this.decodeMode===qr.Strict)return 0;return this.emitCodePoint(aP(this.result),this.consumed),this.errors&&(t!==Kt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let s=r[this.treeIndex],a=(s&mi.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const u=t.charCodeAt(n);if(this.treeIndex=hP(r,s,this.treeIndex+Math.max(1,a),u),this.treeIndex<0)return this.result===0||this.decodeMode===qr.Attribute&&(a===0||dP(u))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&mi.VALUE_LENGTH)>>14,a!==0){if(u===Kt.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==qr.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,s=(r[n]&mi.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[t]&~mi.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case Qt.NamedEntity:return this.result!==0&&(this.decodeMode!==qr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Qt.NumericDecimal:return this.emitNumericEntity(0,2);case Qt.NumericHex:return this.emitNumericEntity(0,3);case Qt.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Qt.EntityStart:return 0}}}function hP(e,t,n,r){const s=(t&mi.BRANCH_LENGTH)>>7,a=t&mi.JUMP_TABLE;if(s===0)return a!==0&&r===a?n:-1;if(a){const d=r-a;return d<0||d>=s?-1:e[n+d]-1}let u=n,l=u+s-1;for(;u<=l;){const d=u+l>>>1,f=e[d];if(f<r)u=d+1;else if(f>r)l=d-1;else return e[d+s]}return-1}var me;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(me||(me={}));var is;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(is||(is={}));var Qn;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Qn||(Qn={}));var K;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(K||(K={}));var g;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(g||(g={}));const pP=new Map([[K.A,g.A],[K.ADDRESS,g.ADDRESS],[K.ANNOTATION_XML,g.ANNOTATION_XML],[K.APPLET,g.APPLET],[K.AREA,g.AREA],[K.ARTICLE,g.ARTICLE],[K.ASIDE,g.ASIDE],[K.B,g.B],[K.BASE,g.BASE],[K.BASEFONT,g.BASEFONT],[K.BGSOUND,g.BGSOUND],[K.BIG,g.BIG],[K.BLOCKQUOTE,g.BLOCKQUOTE],[K.BODY,g.BODY],[K.BR,g.BR],[K.BUTTON,g.BUTTON],[K.CAPTION,g.CAPTION],[K.CENTER,g.CENTER],[K.CODE,g.CODE],[K.COL,g.COL],[K.COLGROUP,g.COLGROUP],[K.DD,g.DD],[K.DESC,g.DESC],[K.DETAILS,g.DETAILS],[K.DIALOG,g.DIALOG],[K.DIR,g.DIR],[K.DIV,g.DIV],[K.DL,g.DL],[K.DT,g.DT],[K.EM,g.EM],[K.EMBED,g.EMBED],[K.FIELDSET,g.FIELDSET],[K.FIGCAPTION,g.FIGCAPTION],[K.FIGURE,g.FIGURE],[K.FONT,g.FONT],[K.FOOTER,g.FOOTER],[K.FOREIGN_OBJECT,g.FOREIGN_OBJECT],[K.FORM,g.FORM],[K.FRAME,g.FRAME],[K.FRAMESET,g.FRAMESET],[K.H1,g.H1],[K.H2,g.H2],[K.H3,g.H3],[K.H4,g.H4],[K.H5,g.H5],[K.H6,g.H6],[K.HEAD,g.HEAD],[K.HEADER,g.HEADER],[K.HGROUP,g.HGROUP],[K.HR,g.HR],[K.HTML,g.HTML],[K.I,g.I],[K.IMG,g.IMG],[K.IMAGE,g.IMAGE],[K.INPUT,g.INPUT],[K.IFRAME,g.IFRAME],[K.KEYGEN,g.KEYGEN],[K.LABEL,g.LABEL],[K.LI,g.LI],[K.LINK,g.LINK],[K.LISTING,g.LISTING],[K.MAIN,g.MAIN],[K.MALIGNMARK,g.MALIGNMARK],[K.MARQUEE,g.MARQUEE],[K.MATH,g.MATH],[K.MENU,g.MENU],[K.META,g.META],[K.MGLYPH,g.MGLYPH],[K.MI,g.MI],[K.MO,g.MO],[K.MN,g.MN],[K.MS,g.MS],[K.MTEXT,g.MTEXT],[K.NAV,g.NAV],[K.NOBR,g.NOBR],[K.NOFRAMES,g.NOFRAMES],[K.NOEMBED,g.NOEMBED],[K.NOSCRIPT,g.NOSCRIPT],[K.OBJECT,g.OBJECT],[K.OL,g.OL],[K.OPTGROUP,g.OPTGROUP],[K.OPTION,g.OPTION],[K.P,g.P],[K.PARAM,g.PARAM],[K.PLAINTEXT,g.PLAINTEXT],[K.PRE,g.PRE],[K.RB,g.RB],[K.RP,g.RP],[K.RT,g.RT],[K.RTC,g.RTC],[K.RUBY,g.RUBY],[K.S,g.S],[K.SCRIPT,g.SCRIPT],[K.SEARCH,g.SEARCH],[K.SECTION,g.SECTION],[K.SELECT,g.SELECT],[K.SOURCE,g.SOURCE],[K.SMALL,g.SMALL],[K.SPAN,g.SPAN],[K.STRIKE,g.STRIKE],[K.STRONG,g.STRONG],[K.STYLE,g.STYLE],[K.SUB,g.SUB],[K.SUMMARY,g.SUMMARY],[K.SUP,g.SUP],[K.TABLE,g.TABLE],[K.TBODY,g.TBODY],[K.TEMPLATE,g.TEMPLATE],[K.TEXTAREA,g.TEXTAREA],[K.TFOOT,g.TFOOT],[K.TD,g.TD],[K.TH,g.TH],[K.THEAD,g.THEAD],[K.TITLE,g.TITLE],[K.TR,g.TR],[K.TRACK,g.TRACK],[K.TT,g.TT],[K.U,g.U],[K.UL,g.UL],[K.SVG,g.SVG],[K.VAR,g.VAR],[K.WBR,g.WBR],[K.XMP,g.XMP]]);function Qs(e){var t;return(t=pP.get(e))!==null&&t!==void 0?t:g.UNKNOWN}const Ee=g,mP={[me.HTML]:new Set([Ee.ADDRESS,Ee.APPLET,Ee.AREA,Ee.ARTICLE,Ee.ASIDE,Ee.BASE,Ee.BASEFONT,Ee.BGSOUND,Ee.BLOCKQUOTE,Ee.BODY,Ee.BR,Ee.BUTTON,Ee.CAPTION,Ee.CENTER,Ee.COL,Ee.COLGROUP,Ee.DD,Ee.DETAILS,Ee.DIR,Ee.DIV,Ee.DL,Ee.DT,Ee.EMBED,Ee.FIELDSET,Ee.FIGCAPTION,Ee.FIGURE,Ee.FOOTER,Ee.FORM,Ee.FRAME,Ee.FRAMESET,Ee.H1,Ee.H2,Ee.H3,Ee.H4,Ee.H5,Ee.H6,Ee.HEAD,Ee.HEADER,Ee.HGROUP,Ee.HR,Ee.HTML,Ee.IFRAME,Ee.IMG,Ee.INPUT,Ee.LI,Ee.LINK,Ee.LISTING,Ee.MAIN,Ee.MARQUEE,Ee.MENU,Ee.META,Ee.NAV,Ee.NOEMBED,Ee.NOFRAMES,Ee.NOSCRIPT,Ee.OBJECT,Ee.OL,Ee.P,Ee.PARAM,Ee.PLAINTEXT,Ee.PRE,Ee.SCRIPT,Ee.SECTION,Ee.SELECT,Ee.SOURCE,Ee.STYLE,Ee.SUMMARY,Ee.TABLE,Ee.TBODY,Ee.TD,Ee.TEMPLATE,Ee.TEXTAREA,Ee.TFOOT,Ee.TH,Ee.THEAD,Ee.TITLE,Ee.TR,Ee.TRACK,Ee.UL,Ee.WBR,Ee.XMP]),[me.MATHML]:new Set([Ee.MI,Ee.MO,Ee.MN,Ee.MS,Ee.MTEXT,Ee.ANNOTATION_XML]),[me.SVG]:new Set([Ee.TITLE,Ee.FOREIGN_OBJECT,Ee.DESC]),[me.XLINK]:new Set,[me.XML]:new Set,[me.XMLNS]:new Set},sh=new Set([Ee.H1,Ee.H2,Ee.H3,Ee.H4,Ee.H5,Ee.H6]);K.STYLE,K.SCRIPT,K.XMP,K.IFRAME,K.NOEMBED,K.NOFRAMES,K.PLAINTEXT;var L;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(L||(L={}));const Ut={DATA:L.DATA,RCDATA:L.RCDATA,RAWTEXT:L.RAWTEXT,SCRIPT_DATA:L.SCRIPT_DATA,PLAINTEXT:L.PLAINTEXT,CDATA_SECTION:L.CDATA_SECTION};function gP(e){return e>=I.DIGIT_0&&e<=I.DIGIT_9}function wa(e){return e>=I.LATIN_CAPITAL_A&&e<=I.LATIN_CAPITAL_Z}function EP(e){return e>=I.LATIN_SMALL_A&&e<=I.LATIN_SMALL_Z}function gi(e){return EP(e)||wa(e)}function ry(e){return gi(e)||gP(e)}function wl(e){return e+32}function iy(e){return e===I.SPACE||e===I.LINE_FEED||e===I.TABULATION||e===I.FORM_FEED}function sy(e){return iy(e)||e===I.SOLIDUS||e===I.GREATER_THAN_SIGN}function yP(e){return e===I.NULL?ne.nullCharacterReference:e>1114111?ne.characterReferenceOutsideUnicodeRange:ZE(e)?ne.surrogateCharacterReference:ty(e)?ne.noncharacterCharacterReference:ey(e)||e===I.CARRIAGE_RETURN?ne.controlCharacterReference:null}class TP{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=L.DATA,this.returnState=L.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new iP(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new fP(sP,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ne.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ne.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=yP(r);s&&this._err(s,1)}}:void 0)}_err(t,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:rt.START_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:rt.END_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:rt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:rt.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(ny(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(ne.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Qs(t.tagName),t.type===rt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(ne.endTagWithAttributes),t.selfClosing&&this._err(ne.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case rt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case rt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case rt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:rt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=iy(t)?rt.WHITESPACE_CHARACTER:t===I.NULL?rt.NULL_CHARACTER:rt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(rt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=L.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?qr.Attribute:qr.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===L.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===L.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===L.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case L.DATA:{this._stateData(t);break}case L.RCDATA:{this._stateRcdata(t);break}case L.RAWTEXT:{this._stateRawtext(t);break}case L.SCRIPT_DATA:{this._stateScriptData(t);break}case L.PLAINTEXT:{this._statePlaintext(t);break}case L.TAG_OPEN:{this._stateTagOpen(t);break}case L.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case L.TAG_NAME:{this._stateTagName(t);break}case L.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case L.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case L.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case L.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case L.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case L.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case L.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case L.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case L.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case L.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case L.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case L.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case L.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case L.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case L.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case L.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case L.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case L.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case L.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case L.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case L.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case L.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case L.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case L.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case L.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case L.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case L.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case L.BOGUS_COMMENT:{this._stateBogusComment(t);break}case L.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case L.COMMENT_START:{this._stateCommentStart(t);break}case L.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case L.COMMENT:{this._stateComment(t);break}case L.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case L.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case L.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case L.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case L.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case L.COMMENT_END:{this._stateCommentEnd(t);break}case L.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case L.DOCTYPE:{this._stateDoctype(t);break}case L.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case L.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case L.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case L.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case L.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case L.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case L.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case L.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case L.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case L.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case L.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case L.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case L.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case L.CDATA_SECTION:{this._stateCdataSection(t);break}case L.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case L.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case L.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case L.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case I.LESS_THAN_SIGN:{this.state=L.TAG_OPEN;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitCodePoint(t);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case I.AMPERSAND:{this._startCharacterReference();break}case I.LESS_THAN_SIGN:{this.state=L.RCDATA_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(kt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case I.LESS_THAN_SIGN:{this.state=L.RAWTEXT_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(kt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case I.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(kt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(kt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(gi(t))this._createStartTagToken(),this.state=L.TAG_NAME,this._stateTagName(t);else switch(t){case I.EXCLAMATION_MARK:{this.state=L.MARKUP_DECLARATION_OPEN;break}case I.SOLIDUS:{this.state=L.END_TAG_OPEN;break}case I.QUESTION_MARK:{this._err(ne.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=L.BOGUS_COMMENT,this._stateBogusComment(t);break}case I.EOF:{this._err(ne.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ne.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=L.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(gi(t))this._createEndTagToken(),this.state=L.TAG_NAME,this._stateTagName(t);else switch(t){case I.GREATER_THAN_SIGN:{this._err(ne.missingEndTagName),this.state=L.DATA;break}case I.EOF:{this._err(ne.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ne.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=L.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=L.BEFORE_ATTRIBUTE_NAME;break}case I.SOLIDUS:{this.state=L.SELF_CLOSING_START_TAG;break}case I.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentTagToken();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.tagName+=kt;break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(wa(t)?wl(t):t)}}_stateRcdataLessThanSign(t){t===I.SOLIDUS?this.state=L.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=L.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){gi(t)?(this.state=L.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=L.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=L.BEFORE_ATTRIBUTE_NAME,!1;case I.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=L.SELF_CLOSING_START_TAG,!1;case I.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=L.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=L.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===I.SOLIDUS?this.state=L.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=L.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){gi(t)?(this.state=L.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=L.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=L.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case I.SOLIDUS:{this.state=L.SCRIPT_DATA_END_TAG_OPEN;break}case I.EXCLAMATION_MARK:{this.state=L.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=L.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){gi(t)?(this.state=L.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=L.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=L.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===I.HYPHEN_MINUS?(this.state=L.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=L.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===I.HYPHEN_MINUS?(this.state=L.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=L.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case I.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(kt);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case I.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_ESCAPED,this._emitChars(kt);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case I.HYPHEN_MINUS:{this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.GREATER_THAN_SIGN:{this.state=L.SCRIPT_DATA,this._emitChars(">");break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_ESCAPED,this._emitChars(kt);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===I.SOLIDUS?this.state=L.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:gi(t)?(this._emitChars("<"),this.state=L.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){gi(t)?(this.state=L.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(In.SCRIPT,!1)&&sy(this.preprocessor.peek(In.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<In.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case I.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(kt);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case I.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(kt);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case I.HYPHEN_MINUS:{this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.GREATER_THAN_SIGN:{this.state=L.SCRIPT_DATA,this._emitChars(">");break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(kt);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===I.SOLIDUS?(this.state=L.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(In.SCRIPT,!1)&&sy(this.preprocessor.peek(In.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<In.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=L.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.SOLIDUS:case I.GREATER_THAN_SIGN:case I.EOF:{this.state=L.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case I.EQUALS_SIGN:{this._err(ne.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=L.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=L.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:case I.SOLIDUS:case I.GREATER_THAN_SIGN:case I.EOF:{this._leaveAttrName(),this.state=L.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case I.EQUALS_SIGN:{this._leaveAttrName(),this.state=L.BEFORE_ATTRIBUTE_VALUE;break}case I.QUOTATION_MARK:case I.APOSTROPHE:case I.LESS_THAN_SIGN:{this._err(ne.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.name+=kt;break}default:this.currentAttr.name+=String.fromCodePoint(wa(t)?wl(t):t)}}_stateAfterAttributeName(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.SOLIDUS:{this.state=L.SELF_CLOSING_START_TAG;break}case I.EQUALS_SIGN:{this.state=L.BEFORE_ATTRIBUTE_VALUE;break}case I.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=L.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{this.state=L.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this.state=L.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingAttributeValue),this.state=L.DATA,this.emitCurrentTagToken();break}default:this.state=L.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case I.QUOTATION_MARK:{this.state=L.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=kt;break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case I.APOSTROPHE:{this.state=L.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=kt;break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this._leaveAttrValue(),this.state=L.BEFORE_ATTRIBUTE_NAME;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=L.DATA,this.emitCurrentTagToken();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=kt;break}case I.QUOTATION_MARK:case I.APOSTROPHE:case I.LESS_THAN_SIGN:case I.EQUALS_SIGN:case I.GRAVE_ACCENT:{this._err(ne.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this._leaveAttrValue(),this.state=L.BEFORE_ATTRIBUTE_NAME;break}case I.SOLIDUS:{this._leaveAttrValue(),this.state=L.SELF_CLOSING_START_TAG;break}case I.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=L.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._err(ne.missingWhitespaceBetweenAttributes),this.state=L.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case I.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=L.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._err(ne.unexpectedSolidusInTag),this.state=L.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case I.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentComment(n);break}case I.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.data+=kt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(In.DASH_DASH,!0)?(this._createCommentToken(In.DASH_DASH.length+1),this.state=L.COMMENT_START):this._consumeSequenceIfMatch(In.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(In.DOCTYPE.length+1),this.state=L.DOCTYPE):this._consumeSequenceIfMatch(In.CDATA_START,!0)?this.inForeignNode?this.state=L.CDATA_SECTION:(this._err(ne.cdataInHtmlContent),this._createCommentToken(In.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=L.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ne.incorrectlyOpenedComment),this._createCommentToken(2),this.state=L.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case I.HYPHEN_MINUS:{this.state=L.COMMENT_START_DASH;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptClosingOfEmptyComment),this.state=L.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=L.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case I.HYPHEN_MINUS:{this.state=L.COMMENT_END;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptClosingOfEmptyComment),this.state=L.DATA,this.emitCurrentComment(n);break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=L.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case I.HYPHEN_MINUS:{this.state=L.COMMENT_END_DASH;break}case I.LESS_THAN_SIGN:{n.data+="<",this.state=L.COMMENT_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.data+=kt;break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case I.EXCLAMATION_MARK:{n.data+="!",this.state=L.COMMENT_LESS_THAN_SIGN_BANG;break}case I.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=L.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===I.HYPHEN_MINUS?this.state=L.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=L.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===I.HYPHEN_MINUS?this.state=L.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=L.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==I.GREATER_THAN_SIGN&&t!==I.EOF&&this._err(ne.nestedComment),this.state=L.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case I.HYPHEN_MINUS:{this.state=L.COMMENT_END;break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=L.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case I.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentComment(n);break}case I.EXCLAMATION_MARK:{this.state=L.COMMENT_END_BANG;break}case I.HYPHEN_MINUS:{n.data+="-";break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=L.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case I.HYPHEN_MINUS:{n.data+="--!",this.state=L.COMMENT_END_DASH;break}case I.GREATER_THAN_SIGN:{this._err(ne.incorrectlyClosedComment),this.state=L.DATA,this.emitCurrentComment(n);break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=L.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=L.BEFORE_DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this.state=L.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case I.EOF:{this._err(ne.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingWhitespaceBeforeDoctypeName),this.state=L.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(wa(t))this._createDoctypeToken(String.fromCharCode(wl(t))),this.state=L.DOCTYPE_NAME;else switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.NULL:{this._err(ne.unexpectedNullCharacter),this._createDoctypeToken(kt),this.state=L.DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=L.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=L.AFTER_DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentDoctype(n);break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.name+=kt;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(wa(t)?wl(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(In.PUBLIC,!1)?this.state=L.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(In.SYSTEM,!1)?this.state=L.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ne.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=L.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.QUOTATION_MARK:{this._err(ne.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(ne.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case I.QUOTATION_MARK:{this.state=L.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.publicId+=kt;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case I.APOSTROPHE:{this.state=L.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.publicId+=kt;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=L.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case I.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentDoctype(n);break}case I.QUOTATION_MARK:{this._err(ne.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(ne.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=L.DATA;break}case I.QUOTATION_MARK:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=L.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.QUOTATION_MARK:{this._err(ne.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(ne.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case I.QUOTATION_MARK:{this.state=L.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.systemId+=kt;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case I.APOSTROPHE:{this.state=L.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.systemId+=kt;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=L.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=L.DATA;break}case I.NULL:{this._err(ne.unexpectedNullCharacter);break}case I.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case I.RIGHT_SQUARE_BRACKET:{this.state=L.CDATA_SECTION_BRACKET;break}case I.EOF:{this._err(ne.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===I.RIGHT_SQUARE_BRACKET?this.state=L.CDATA_SECTION_END:(this._emitChars("]"),this.state=L.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case I.GREATER_THAN_SIGN:{this.state=L.DATA;break}case I.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=L.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(I.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&ry(this.preprocessor.peek(1))?L.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){ry(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===I.SEMICOLON&&this._err(ne.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const oy=new Set([g.DD,g.DT,g.LI,g.OPTGROUP,g.OPTION,g.P,g.RB,g.RP,g.RT,g.RTC]),ay=new Set([...oy,g.CAPTION,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]),_l=new Set([g.APPLET,g.CAPTION,g.HTML,g.MARQUEE,g.OBJECT,g.TABLE,g.TD,g.TEMPLATE,g.TH]),bP=new Set([..._l,g.OL,g.UL]),wP=new Set([..._l,g.BUTTON]),uy=new Set([g.ANNOTATION_XML,g.MI,g.MN,g.MO,g.MS,g.MTEXT]),ly=new Set([g.DESC,g.FOREIGN_OBJECT,g.TITLE]),_P=new Set([g.TR,g.TEMPLATE,g.HTML]),xP=new Set([g.TBODY,g.TFOOT,g.THEAD,g.TEMPLATE,g.HTML]),SP=new Set([g.TABLE,g.TEMPLATE,g.HTML]),vP=new Set([g.TD,g.TH]);class AP{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=g.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===g.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===me.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const s=this._indexOf(t)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==me.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(sh,me.HTML)}popUntilTableCellPopped(){this.popUntilPopped(vP,me.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(SP,me.HTML)}clearBackToTableBodyContext(){this.clearBackTo(xP,me.HTML)}clearBackToTableRowContext(){this.clearBackTo(_P,me.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===g.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===g.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case me.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case me.SVG:{if(ly.has(s))return!1;break}case me.MATHML:{if(uy.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,_l)}hasInListItemScope(t){return this.hasInDynamicScope(t,bP)}hasInButtonScope(t){return this.hasInDynamicScope(t,wP)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case me.HTML:{if(sh.has(n))return!0;if(_l.has(n))return!1;break}case me.SVG:{if(ly.has(n))return!1;break}case me.MATHML:{if(uy.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===me.HTML)switch(this.tagIDs[n]){case t:return!0;case g.TABLE:case g.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===me.HTML)switch(this.tagIDs[t]){case g.TBODY:case g.THEAD:case g.TFOOT:return!0;case g.TABLE:case g.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===me.HTML)switch(this.tagIDs[n]){case t:return!0;case g.OPTION:case g.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&oy.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&ay.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&ay.has(this.currentTagId);)this.pop()}}const oh=3;var kr;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(kr||(kr={}));const cy={type:kr.Marker};class kP{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],s=n.length,a=this.treeAdapter.getTagName(t),u=this.treeAdapter.getNamespaceURI(t);for(let l=0;l<this.entries.length;l++){const d=this.entries[l];if(d.type===kr.Marker)break;const{element:f}=d;if(this.treeAdapter.getTagName(f)===a&&this.treeAdapter.getNamespaceURI(f)===u){const m=this.treeAdapter.getAttrList(f);m.length===s&&r.push({idx:l,attrs:m})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<oh)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<oh)return;const s=new Map(n.map(u=>[u.name,u.value]));let a=0;for(let u=0;u<r.length;u++){const l=r[u];l.attrs.every(d=>s.get(d.name)===d.value)&&(a+=1,a>=oh&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(cy)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:kr.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:kr.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(cy);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===kr.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===kr.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===kr.Element&&n.element===t)}}const Ei={createDocument(){return{nodeName:"#document",mode:Qn.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const s=e.childNodes.find(a=>a.nodeName==="#documentType");if(s)s.name=t,s.publicId=n,s.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Ei.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Ei.isTextNode(n)){n.value+=t;return}}Ei.appendChild(e,Ei.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Ei.isTextNode(r)?r.value+=t:Ei.insertBefore(e,Ei.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation=j(j({},e.sourceCodeLocation),t)}},dy="html",CP="about:legacy-compat",NP="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",fy=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],OP=[...fy,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],IP=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),hy=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],PP=[...hy,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function py(e,t){return t.some(n=>e.startsWith(n))}function RP(e){return e.name===dy&&e.publicId===null&&(e.systemId===null||e.systemId===CP)}function LP(e){if(e.name!==dy)return Qn.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===NP)return Qn.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),IP.has(n))return Qn.QUIRKS;let r=t===null?OP:fy;if(py(n,r))return Qn.QUIRKS;if(r=t===null?hy:PP,py(n,r))return Qn.LIMITED_QUIRKS}return Qn.NO_QUIRKS}const my={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},DP="definitionurl",MP="definitionURL",FP=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),BP=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:me.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:me.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:me.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:me.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:me.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:me.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:me.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:me.XML}],["xml:space",{prefix:"xml",name:"space",namespace:me.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:me.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:me.XMLNS}]]),UP=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),HP=new Set([g.B,g.BIG,g.BLOCKQUOTE,g.BODY,g.BR,g.CENTER,g.CODE,g.DD,g.DIV,g.DL,g.DT,g.EM,g.EMBED,g.H1,g.H2,g.H3,g.H4,g.H5,g.H6,g.HEAD,g.HR,g.I,g.IMG,g.LI,g.LISTING,g.MENU,g.META,g.NOBR,g.OL,g.P,g.PRE,g.RUBY,g.S,g.SMALL,g.SPAN,g.STRONG,g.STRIKE,g.SUB,g.SUP,g.TABLE,g.TT,g.U,g.UL,g.VAR]);function jP(e){const t=e.tagID;return t===g.FONT&&e.attrs.some(({name:r})=>r===is.COLOR||r===is.SIZE||r===is.FACE)||HP.has(t)}function gy(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===DP){e.attrs[t].name=MP;break}}function Ey(e){for(let t=0;t<e.attrs.length;t++){const n=FP.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function ah(e){for(let t=0;t<e.attrs.length;t++){const n=BP.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function zP(e){const t=UP.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Qs(e.tagName))}function $P(e,t){return t===me.MATHML&&(e===g.MI||e===g.MO||e===g.MN||e===g.MS||e===g.MTEXT)}function VP(e,t,n){if(t===me.MATHML&&e===g.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===is.ENCODING){const s=n[r].value.toLowerCase();return s===my.TEXT_HTML||s===my.APPLICATION_XML}}return t===me.SVG&&(e===g.FOREIGN_OBJECT||e===g.DESC||e===g.TITLE)}function qP(e,t,n,r){return(!r||r===me.HTML)&&VP(e,t,n)||(!r||r===me.MATHML)&&$P(e,t)}const YP="hidden",WP=8,GP=3;var U;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(U||(U={}));const XP={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},yy=new Set([g.TABLE,g.TBODY,g.TFOOT,g.THEAD,g.TR]),Ty={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Ei,onParseError:null};class by{constructor(t,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=U.INITIAL,this.originalInsertionMode=U.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options=j(j({},Ty),t),this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n!=null?n:this.treeAdapter.createDocument(),this.tokenizer=new TP(this.options,this),this.activeFormattingElements=new kP(this.treeAdapter),this.fragmentContextID=r?Qs(this.treeAdapter.getTagName(r)):g.UNKNOWN,this._setContextModes(r!=null?r:this.document,this.fragmentContextID),this.openElements=new AP(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r=j(j({},Ty),n);t!=null||(t=r.treeAdapter.createElement(K.TEMPLATE,me.HTML,[]));const s=r.treeAdapter.createElement("documentmock",me.HTML,[]),a=new this(r,s,t);return a.fragmentContextID===g.TEMPLATE&&a.tmplInsertionModeStack.unshift(U.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var s;if(!this.onParseError)return;const a=(s=t.location)!==null&&s!==void 0?s:XP,u={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(u)}onItemPush(t,n,r){var s,a;(a=(s=this.treeAdapter).onItemPush)===null||a===void 0||a.call(s,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,t,this.openElements.current),n){let a,u;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,u=this.fragmentContextID):{current:a,currentTagId:u}=this.openElements,this._setContextModes(a,u)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===me.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,me.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=U.TEXT}switchToPlaintextParsing(){this.insertionMode=U.TEXT,this.originalInsertionMode=U.IN_BODY,this.tokenizer.state=Ut.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===K.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==me.HTML))switch(this.fragmentContextID){case g.TITLE:case g.TEXTAREA:{this.tokenizer.state=Ut.RCDATA;break}case g.STYLE:case g.XMP:case g.IFRAME:case g.NOEMBED:case g.NOFRAMES:case g.NOSCRIPT:{this.tokenizer.state=Ut.RAWTEXT;break}case g.SCRIPT:{this.tokenizer.state=Ut.SCRIPT_DATA;break}case g.PLAINTEXT:{this.tokenizer.state=Ut.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),t.location){const u=this.treeAdapter.getChildNodes(this.document).find(l=>this.treeAdapter.isDocumentTypeNode(l));u&&this.treeAdapter.setNodeSourceCodeLocation(u,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&ce(j({},n),{startTag:n});this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r!=null?r:this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,me.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,me.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(K.HTML,me.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,g.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const s=this.treeAdapter.getChildNodes(n),a=r?s.lastIndexOf(r):s.length,u=s[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(u)){const{endLine:d,endCol:f,endOffset:m}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(u,{endLine:d,endCol:f,endOffset:m})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(u,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(t),a=n.type===rt.END_TAG&&s===n.tagName?{endTag:j({},r),endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===g.SVG&&this.treeAdapter.getTagName(n)===K.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===me.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===g.MGLYPH||t.tagID===g.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,me.HTML)}_processToken(t){switch(t.type){case rt.CHARACTER:{this.onCharacter(t);break}case rt.NULL_CHARACTER:{this.onNullCharacter(t);break}case rt.COMMENT:{this.onComment(t);break}case rt.DOCTYPE:{this.onDoctype(t);break}case rt.START_TAG:{this._processStartTag(t);break}case rt.END_TAG:{this.onEndTag(t);break}case rt.EOF:{this.onEof(t);break}case rt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return qP(t,s,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===kr.Marker||this.openElements.contains(s.element)),r=n===-1?t-1:n-1;for(let s=r;s>=0;s--){const a=this.activeFormattingElements.entries[s];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=U.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(g.P),this.openElements.popUntilTagNamePopped(g.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case g.TR:{this.insertionMode=U.IN_ROW;return}case g.TBODY:case g.THEAD:case g.TFOOT:{this.insertionMode=U.IN_TABLE_BODY;return}case g.CAPTION:{this.insertionMode=U.IN_CAPTION;return}case g.COLGROUP:{this.insertionMode=U.IN_COLUMN_GROUP;return}case g.TABLE:{this.insertionMode=U.IN_TABLE;return}case g.BODY:{this.insertionMode=U.IN_BODY;return}case g.FRAMESET:{this.insertionMode=U.IN_FRAMESET;return}case g.SELECT:{this._resetInsertionModeForSelect(t);return}case g.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case g.HTML:{this.insertionMode=this.headElement?U.AFTER_HEAD:U.BEFORE_HEAD;return}case g.TD:case g.TH:{if(t>0){this.insertionMode=U.IN_CELL;return}break}case g.HEAD:{if(t>0){this.insertionMode=U.IN_HEAD;return}break}}this.insertionMode=U.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===g.TEMPLATE)break;if(r===g.TABLE){this.insertionMode=U.IN_SELECT_IN_TABLE;return}}this.insertionMode=U.IN_SELECT}_isElementCausesFosterParenting(t){return yy.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case g.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===me.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case g.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return mP[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){v6(this,t);return}switch(this.insertionMode){case U.INITIAL:{_a(this,t);break}case U.BEFORE_HTML:{xa(this,t);break}case U.BEFORE_HEAD:{Sa(this,t);break}case U.IN_HEAD:{va(this,t);break}case U.IN_HEAD_NO_SCRIPT:{Aa(this,t);break}case U.AFTER_HEAD:{ka(this,t);break}case U.IN_BODY:case U.IN_CAPTION:case U.IN_CELL:case U.IN_TEMPLATE:{_y(this,t);break}case U.TEXT:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:{dh(this,t);break}case U.IN_TABLE_TEXT:{Oy(this,t);break}case U.IN_COLUMN_GROUP:{vl(this,t);break}case U.AFTER_BODY:{Cl(this,t);break}case U.AFTER_AFTER_BODY:{Nl(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){S6(this,t);return}switch(this.insertionMode){case U.INITIAL:{_a(this,t);break}case U.BEFORE_HTML:{xa(this,t);break}case U.BEFORE_HEAD:{Sa(this,t);break}case U.IN_HEAD:{va(this,t);break}case U.IN_HEAD_NO_SCRIPT:{Aa(this,t);break}case U.AFTER_HEAD:{ka(this,t);break}case U.TEXT:{this._insertCharacters(t);break}case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:{dh(this,t);break}case U.IN_COLUMN_GROUP:{vl(this,t);break}case U.AFTER_BODY:{Cl(this,t);break}case U.AFTER_AFTER_BODY:{Nl(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){lh(this,t);return}switch(this.insertionMode){case U.INITIAL:case U.BEFORE_HTML:case U.BEFORE_HEAD:case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:case U.IN_BODY:case U.IN_TABLE:case U.IN_CAPTION:case U.IN_COLUMN_GROUP:case U.IN_TABLE_BODY:case U.IN_ROW:case U.IN_CELL:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:case U.IN_TEMPLATE:case U.IN_FRAMESET:case U.AFTER_FRAMESET:{lh(this,t);break}case U.IN_TABLE_TEXT:{Oa(this,t);break}case U.AFTER_BODY:{nR(this,t);break}case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:{rR(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case U.INITIAL:{iR(this,t);break}case U.BEFORE_HEAD:case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:{this._err(t,ne.misplacedDoctype);break}case U.IN_TABLE_TEXT:{Oa(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ne.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?A6(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case U.INITIAL:{_a(this,t);break}case U.BEFORE_HTML:{sR(this,t);break}case U.BEFORE_HEAD:{aR(this,t);break}case U.IN_HEAD:{dr(this,t);break}case U.IN_HEAD_NO_SCRIPT:{cR(this,t);break}case U.AFTER_HEAD:{fR(this,t);break}case U.IN_BODY:{fn(this,t);break}case U.IN_TABLE:{Js(this,t);break}case U.IN_TABLE_TEXT:{Oa(this,t);break}case U.IN_CAPTION:{u6(this,t);break}case U.IN_COLUMN_GROUP:{fh(this,t);break}case U.IN_TABLE_BODY:{Al(this,t);break}case U.IN_ROW:{kl(this,t);break}case U.IN_CELL:{d6(this,t);break}case U.IN_SELECT:{Ry(this,t);break}case U.IN_SELECT_IN_TABLE:{h6(this,t);break}case U.IN_TEMPLATE:{m6(this,t);break}case U.AFTER_BODY:{E6(this,t);break}case U.IN_FRAMESET:{y6(this,t);break}case U.AFTER_FRAMESET:{b6(this,t);break}case U.AFTER_AFTER_BODY:{_6(this,t);break}case U.AFTER_AFTER_FRAMESET:{x6(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?k6(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case U.INITIAL:{_a(this,t);break}case U.BEFORE_HTML:{oR(this,t);break}case U.BEFORE_HEAD:{uR(this,t);break}case U.IN_HEAD:{lR(this,t);break}case U.IN_HEAD_NO_SCRIPT:{dR(this,t);break}case U.AFTER_HEAD:{hR(this,t);break}case U.IN_BODY:{Sl(this,t);break}case U.TEXT:{JR(this,t);break}case U.IN_TABLE:{Ca(this,t);break}case U.IN_TABLE_TEXT:{Oa(this,t);break}case U.IN_CAPTION:{l6(this,t);break}case U.IN_COLUMN_GROUP:{c6(this,t);break}case U.IN_TABLE_BODY:{hh(this,t);break}case U.IN_ROW:{Py(this,t);break}case U.IN_CELL:{f6(this,t);break}case U.IN_SELECT:{Ly(this,t);break}case U.IN_SELECT_IN_TABLE:{p6(this,t);break}case U.IN_TEMPLATE:{g6(this,t);break}case U.AFTER_BODY:{My(this,t);break}case U.IN_FRAMESET:{T6(this,t);break}case U.AFTER_FRAMESET:{w6(this,t);break}case U.AFTER_AFTER_BODY:{Nl(this,t);break}}}onEof(t){switch(this.insertionMode){case U.INITIAL:{_a(this,t);break}case U.BEFORE_HTML:{xa(this,t);break}case U.BEFORE_HEAD:{Sa(this,t);break}case U.IN_HEAD:{va(this,t);break}case U.IN_HEAD_NO_SCRIPT:{Aa(this,t);break}case U.AFTER_HEAD:{ka(this,t);break}case U.IN_BODY:case U.IN_TABLE:case U.IN_CAPTION:case U.IN_COLUMN_GROUP:case U.IN_TABLE_BODY:case U.IN_ROW:case U.IN_CELL:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:{Cy(this,t);break}case U.TEXT:{ZR(this,t);break}case U.IN_TABLE_TEXT:{Oa(this,t);break}case U.IN_TEMPLATE:{Dy(this,t);break}case U.AFTER_BODY:case U.IN_FRAMESET:case U.AFTER_FRAMESET:case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:{ch(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===I.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:case U.TEXT:case U.IN_COLUMN_GROUP:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:case U.IN_FRAMESET:case U.AFTER_FRAMESET:{this._insertCharacters(t);break}case U.IN_BODY:case U.IN_CAPTION:case U.IN_CELL:case U.IN_TEMPLATE:case U.AFTER_BODY:case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:{wy(this,t);break}case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:{dh(this,t);break}case U.IN_TABLE_TEXT:{Ny(this,t);break}}}}function KP(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):ky(e,t),n}function QP(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const s=e.openElements.items[r];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[r])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function JP(e,t,n){let r=t,s=e.openElements.getCommonAncestor(t);for(let a=0,u=s;u!==n;a++,u=s){s=e.openElements.getCommonAncestor(u);const l=e.activeFormattingElements.getElementEntry(u),d=l&&a>=GP;!l||d?(d&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(u)):(u=ZP(e,l),r===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(u,r),r=u)}return r}function ZP(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function eR(e,t,n){const r=e.treeAdapter.getTagName(t),s=Qs(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);s===g.TEMPLATE&&a===me.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function tR(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,a=e.treeAdapter.createElement(s.tagName,r,s.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,s.tagID)}function uh(e,t){for(let n=0;n<WP;n++){const r=KP(e,t);if(!r)break;const s=QP(e,r);if(!s)break;e.activeFormattingElements.bookmark=r;const a=JP(e,s,r.element),u=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),u&&eR(e,u,a),tR(e,s,r)}}function lh(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function nR(e,t){e._appendCommentNode(t,e.openElements.items[0])}function rR(e,t){e._appendCommentNode(t,e.document)}function ch(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],u=e.treeAdapter.getNodeSourceCodeLocation(a);u&&!u.endTag&&e._setEndLocation(a,t)}}}}function iR(e,t){e._setDocumentType(t);const n=t.forceQuirks?Qn.QUIRKS:LP(t);RP(t)||e._err(t,ne.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=U.BEFORE_HTML}function _a(e,t){e._err(t,ne.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Qn.QUIRKS),e.insertionMode=U.BEFORE_HTML,e._processToken(t)}function sR(e,t){t.tagID===g.HTML?(e._insertElement(t,me.HTML),e.insertionMode=U.BEFORE_HEAD):xa(e,t)}function oR(e,t){const n=t.tagID;(n===g.HTML||n===g.HEAD||n===g.BODY||n===g.BR)&&xa(e,t)}function xa(e,t){e._insertFakeRootElement(),e.insertionMode=U.BEFORE_HEAD,e._processToken(t)}function aR(e,t){switch(t.tagID){case g.HTML:{fn(e,t);break}case g.HEAD:{e._insertElement(t,me.HTML),e.headElement=e.openElements.current,e.insertionMode=U.IN_HEAD;break}default:Sa(e,t)}}function uR(e,t){const n=t.tagID;n===g.HEAD||n===g.BODY||n===g.HTML||n===g.BR?Sa(e,t):e._err(t,ne.endTagWithoutMatchingOpenElement)}function Sa(e,t){e._insertFakeElement(K.HEAD,g.HEAD),e.headElement=e.openElements.current,e.insertionMode=U.IN_HEAD,e._processToken(t)}function dr(e,t){switch(t.tagID){case g.HTML:{fn(e,t);break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:{e._appendElement(t,me.HTML),t.ackSelfClosing=!0;break}case g.TITLE:{e._switchToTextParsing(t,Ut.RCDATA);break}case g.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Ut.RAWTEXT):(e._insertElement(t,me.HTML),e.insertionMode=U.IN_HEAD_NO_SCRIPT);break}case g.NOFRAMES:case g.STYLE:{e._switchToTextParsing(t,Ut.RAWTEXT);break}case g.SCRIPT:{e._switchToTextParsing(t,Ut.SCRIPT_DATA);break}case g.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=U.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(U.IN_TEMPLATE);break}case g.HEAD:{e._err(t,ne.misplacedStartTagForHeadElement);break}default:va(e,t)}}function lR(e,t){switch(t.tagID){case g.HEAD:{e.openElements.pop(),e.insertionMode=U.AFTER_HEAD;break}case g.BODY:case g.BR:case g.HTML:{va(e,t);break}case g.TEMPLATE:{ss(e,t);break}default:e._err(t,ne.endTagWithoutMatchingOpenElement)}}function ss(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==g.TEMPLATE&&e._err(t,ne.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ne.endTagWithoutMatchingOpenElement)}function va(e,t){e.openElements.pop(),e.insertionMode=U.AFTER_HEAD,e._processToken(t)}function cR(e,t){switch(t.tagID){case g.HTML:{fn(e,t);break}case g.BASEFONT:case g.BGSOUND:case g.HEAD:case g.LINK:case g.META:case g.NOFRAMES:case g.STYLE:{dr(e,t);break}case g.NOSCRIPT:{e._err(t,ne.nestedNoscriptInHead);break}default:Aa(e,t)}}function dR(e,t){switch(t.tagID){case g.NOSCRIPT:{e.openElements.pop(),e.insertionMode=U.IN_HEAD;break}case g.BR:{Aa(e,t);break}default:e._err(t,ne.endTagWithoutMatchingOpenElement)}}function Aa(e,t){const n=t.type===rt.EOF?ne.openElementsLeftAfterEof:ne.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=U.IN_HEAD,e._processToken(t)}function fR(e,t){switch(t.tagID){case g.HTML:{fn(e,t);break}case g.BODY:{e._insertElement(t,me.HTML),e.framesetOk=!1,e.insertionMode=U.IN_BODY;break}case g.FRAMESET:{e._insertElement(t,me.HTML),e.insertionMode=U.IN_FRAMESET;break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:case g.NOFRAMES:case g.SCRIPT:case g.STYLE:case g.TEMPLATE:case g.TITLE:{e._err(t,ne.abandonedHeadElementChild),e.openElements.push(e.headElement,g.HEAD),dr(e,t),e.openElements.remove(e.headElement);break}case g.HEAD:{e._err(t,ne.misplacedStartTagForHeadElement);break}default:ka(e,t)}}function hR(e,t){switch(t.tagID){case g.BODY:case g.HTML:case g.BR:{ka(e,t);break}case g.TEMPLATE:{ss(e,t);break}default:e._err(t,ne.endTagWithoutMatchingOpenElement)}}function ka(e,t){e._insertFakeElement(K.BODY,g.BODY),e.insertionMode=U.IN_BODY,xl(e,t)}function xl(e,t){switch(t.type){case rt.CHARACTER:{_y(e,t);break}case rt.WHITESPACE_CHARACTER:{wy(e,t);break}case rt.COMMENT:{lh(e,t);break}case rt.START_TAG:{fn(e,t);break}case rt.END_TAG:{Sl(e,t);break}case rt.EOF:{Cy(e,t);break}}}function wy(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function _y(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function pR(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function mR(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function gR(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,me.HTML),e.insertionMode=U.IN_FRAMESET)}function ER(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,me.HTML)}function yR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&sh.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,me.HTML)}function TR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,me.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function bR(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,me.HTML),n||(e.formElement=e.openElements.current))}function wR(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const s=e.openElements.tagIDs[r];if(n===g.LI&&s===g.LI||(n===g.DD||n===g.DT)&&(s===g.DD||s===g.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==g.ADDRESS&&s!==g.DIV&&s!==g.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,me.HTML)}function _R(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,me.HTML),e.tokenizer.state=Ut.PLAINTEXT}function xR(e,t){e.openElements.hasInScope(g.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,me.HTML),e.framesetOk=!1}function SR(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(K.A);n&&(uh(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,me.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function vR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,me.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function AR(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(g.NOBR)&&(uh(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,me.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function kR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,me.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function CR(e,t){e.treeAdapter.getDocumentMode(e.document)!==Qn.QUIRKS&&e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,me.HTML),e.framesetOk=!1,e.insertionMode=U.IN_TABLE}function xy(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,me.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Sy(e){const t=ny(e,is.TYPE);return t!=null&&t.toLowerCase()===YP}function NR(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,me.HTML),Sy(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function OR(e,t){e._appendElement(t,me.HTML),t.ackSelfClosing=!0}function IR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._appendElement(t,me.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function PR(e,t){t.tagName=K.IMG,t.tagID=g.IMG,xy(e,t)}function RR(e,t){e._insertElement(t,me.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Ut.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=U.TEXT}function LR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Ut.RAWTEXT)}function DR(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Ut.RAWTEXT)}function vy(e,t){e._switchToTextParsing(t,Ut.RAWTEXT)}function MR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,me.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===U.IN_TABLE||e.insertionMode===U.IN_CAPTION||e.insertionMode===U.IN_TABLE_BODY||e.insertionMode===U.IN_ROW||e.insertionMode===U.IN_CELL?U.IN_SELECT_IN_TABLE:U.IN_SELECT}function FR(e,t){e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,me.HTML)}function BR(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,me.HTML)}function UR(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(g.RTC),e._insertElement(t,me.HTML)}function HR(e,t){e._reconstructActiveFormattingElements(),gy(t),ah(t),t.selfClosing?e._appendElement(t,me.MATHML):e._insertElement(t,me.MATHML),t.ackSelfClosing=!0}function jR(e,t){e._reconstructActiveFormattingElements(),Ey(t),ah(t),t.selfClosing?e._appendElement(t,me.SVG):e._insertElement(t,me.SVG),t.ackSelfClosing=!0}function Ay(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,me.HTML)}function fn(e,t){switch(t.tagID){case g.I:case g.S:case g.B:case g.U:case g.EM:case g.TT:case g.BIG:case g.CODE:case g.FONT:case g.SMALL:case g.STRIKE:case g.STRONG:{vR(e,t);break}case g.A:{SR(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{yR(e,t);break}case g.P:case g.DL:case g.OL:case g.UL:case g.DIV:case g.DIR:case g.NAV:case g.MAIN:case g.MENU:case g.ASIDE:case g.CENTER:case g.FIGURE:case g.FOOTER:case g.HEADER:case g.HGROUP:case g.DIALOG:case g.DETAILS:case g.ADDRESS:case g.ARTICLE:case g.SEARCH:case g.SECTION:case g.SUMMARY:case g.FIELDSET:case g.BLOCKQUOTE:case g.FIGCAPTION:{ER(e,t);break}case g.LI:case g.DD:case g.DT:{wR(e,t);break}case g.BR:case g.IMG:case g.WBR:case g.AREA:case g.EMBED:case g.KEYGEN:{xy(e,t);break}case g.HR:{IR(e,t);break}case g.RB:case g.RTC:{BR(e,t);break}case g.RT:case g.RP:{UR(e,t);break}case g.PRE:case g.LISTING:{TR(e,t);break}case g.XMP:{LR(e,t);break}case g.SVG:{jR(e,t);break}case g.HTML:{pR(e,t);break}case g.BASE:case g.LINK:case g.META:case g.STYLE:case g.TITLE:case g.SCRIPT:case g.BGSOUND:case g.BASEFONT:case g.TEMPLATE:{dr(e,t);break}case g.BODY:{mR(e,t);break}case g.FORM:{bR(e,t);break}case g.NOBR:{AR(e,t);break}case g.MATH:{HR(e,t);break}case g.TABLE:{CR(e,t);break}case g.INPUT:{NR(e,t);break}case g.PARAM:case g.TRACK:case g.SOURCE:{OR(e,t);break}case g.IMAGE:{PR(e,t);break}case g.BUTTON:{xR(e,t);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{kR(e,t);break}case g.IFRAME:{DR(e,t);break}case g.SELECT:{MR(e,t);break}case g.OPTION:case g.OPTGROUP:{FR(e,t);break}case g.NOEMBED:case g.NOFRAMES:{vy(e,t);break}case g.FRAMESET:{gR(e,t);break}case g.TEXTAREA:{RR(e,t);break}case g.NOSCRIPT:{e.options.scriptingEnabled?vy(e,t):Ay(e,t);break}case g.PLAINTEXT:{_R(e,t);break}case g.COL:case g.TH:case g.TD:case g.TR:case g.HEAD:case g.FRAME:case g.TBODY:case g.TFOOT:case g.THEAD:case g.CAPTION:case g.COLGROUP:break;default:Ay(e,t)}}function zR(e,t){if(e.openElements.hasInScope(g.BODY)&&(e.insertionMode=U.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function $R(e,t){e.openElements.hasInScope(g.BODY)&&(e.insertionMode=U.AFTER_BODY,My(e,t))}function VR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function qR(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(g.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(g.FORM):n&&e.openElements.remove(n))}function YR(e){e.openElements.hasInButtonScope(g.P)||e._insertFakeElement(K.P,g.P),e._closePElement()}function WR(e){e.openElements.hasInListItemScope(g.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(g.LI),e.openElements.popUntilTagNamePopped(g.LI))}function GR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function XR(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function KR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function QR(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(K.BR,g.BR),e.openElements.pop(),e.framesetOk=!1}function ky(e,t){const n=t.tagName,r=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){const a=e.openElements.items[s],u=e.openElements.tagIDs[s];if(r===u&&(r!==g.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(a,u))break}}function Sl(e,t){switch(t.tagID){case g.A:case g.B:case g.I:case g.S:case g.U:case g.EM:case g.TT:case g.BIG:case g.CODE:case g.FONT:case g.NOBR:case g.SMALL:case g.STRIKE:case g.STRONG:{uh(e,t);break}case g.P:{YR(e);break}case g.DL:case g.UL:case g.OL:case g.DIR:case g.DIV:case g.NAV:case g.PRE:case g.MAIN:case g.MENU:case g.ASIDE:case g.BUTTON:case g.CENTER:case g.FIGURE:case g.FOOTER:case g.HEADER:case g.HGROUP:case g.DIALOG:case g.ADDRESS:case g.ARTICLE:case g.DETAILS:case g.SEARCH:case g.SECTION:case g.SUMMARY:case g.LISTING:case g.FIELDSET:case g.BLOCKQUOTE:case g.FIGCAPTION:{VR(e,t);break}case g.LI:{WR(e);break}case g.DD:case g.DT:{GR(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{XR(e);break}case g.BR:{QR(e);break}case g.BODY:{zR(e,t);break}case g.HTML:{$R(e,t);break}case g.FORM:{qR(e);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{KR(e,t);break}case g.TEMPLATE:{ss(e,t);break}default:ky(e,t)}}function Cy(e,t){e.tmplInsertionModeStack.length>0?Dy(e,t):ch(e,t)}function JR(e,t){var n;t.tagID===g.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function ZR(e,t){e._err(t,ne.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function dh(e,t){if(e.openElements.currentTagId!==void 0&&yy.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=U.IN_TABLE_TEXT,t.type){case rt.CHARACTER:{Oy(e,t);break}case rt.WHITESPACE_CHARACTER:{Ny(e,t);break}}else Na(e,t)}function e6(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,me.HTML),e.insertionMode=U.IN_CAPTION}function t6(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,me.HTML),e.insertionMode=U.IN_COLUMN_GROUP}function n6(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(K.COLGROUP,g.COLGROUP),e.insertionMode=U.IN_COLUMN_GROUP,fh(e,t)}function r6(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,me.HTML),e.insertionMode=U.IN_TABLE_BODY}function i6(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(K.TBODY,g.TBODY),e.insertionMode=U.IN_TABLE_BODY,Al(e,t)}function s6(e,t){e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function o6(e,t){Sy(t)?e._appendElement(t,me.HTML):Na(e,t),t.ackSelfClosing=!0}function a6(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,me.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Js(e,t){switch(t.tagID){case g.TD:case g.TH:case g.TR:{i6(e,t);break}case g.STYLE:case g.SCRIPT:case g.TEMPLATE:{dr(e,t);break}case g.COL:{n6(e,t);break}case g.FORM:{a6(e,t);break}case g.TABLE:{s6(e,t);break}case g.TBODY:case g.TFOOT:case g.THEAD:{r6(e,t);break}case g.INPUT:{o6(e,t);break}case g.CAPTION:{e6(e,t);break}case g.COLGROUP:{t6(e,t);break}default:Na(e,t)}}function Ca(e,t){switch(t.tagID){case g.TABLE:{e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode());break}case g.TEMPLATE:{ss(e,t);break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TBODY:case g.TD:case g.TFOOT:case g.TH:case g.THEAD:case g.TR:break;default:Na(e,t)}}function Na(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,xl(e,t),e.fosterParentingEnabled=n}function Ny(e,t){e.pendingCharacterTokens.push(t)}function Oy(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Oa(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Na(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const Iy=new Set([g.CAPTION,g.COL,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]);function u6(e,t){const n=t.tagID;Iy.has(n)?e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_TABLE,Js(e,t)):fn(e,t)}function l6(e,t){const n=t.tagID;switch(n){case g.CAPTION:case g.TABLE:{e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_TABLE,n===g.TABLE&&Ca(e,t));break}case g.BODY:case g.COL:case g.COLGROUP:case g.HTML:case g.TBODY:case g.TD:case g.TFOOT:case g.TH:case g.THEAD:case g.TR:break;default:Sl(e,t)}}function fh(e,t){switch(t.tagID){case g.HTML:{fn(e,t);break}case g.COL:{e._appendElement(t,me.HTML),t.ackSelfClosing=!0;break}case g.TEMPLATE:{dr(e,t);break}default:vl(e,t)}}function c6(e,t){switch(t.tagID){case g.COLGROUP:{e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=U.IN_TABLE);break}case g.TEMPLATE:{ss(e,t);break}case g.COL:break;default:vl(e,t)}}function vl(e,t){e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=U.IN_TABLE,e._processToken(t))}function Al(e,t){switch(t.tagID){case g.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,me.HTML),e.insertionMode=U.IN_ROW;break}case g.TH:case g.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(K.TR,g.TR),e.insertionMode=U.IN_ROW,kl(e,t);break}case g.CAPTION:case g.COL:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE,Js(e,t));break}default:Js(e,t)}}function hh(e,t){const n=t.tagID;switch(t.tagID){case g.TBODY:case g.TFOOT:case g.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE);break}case g.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE,Ca(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TD:case g.TH:case g.TR:break;default:Ca(e,t)}}function kl(e,t){switch(t.tagID){case g.TH:case g.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,me.HTML),e.insertionMode=U.IN_CELL,e.activeFormattingElements.insertMarker();break}case g.CAPTION:case g.COL:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,Al(e,t));break}default:Js(e,t)}}function Py(e,t){switch(t.tagID){case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY);break}case g.TABLE:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,hh(e,t));break}case g.TBODY:case g.TFOOT:case g.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(g.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,hh(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TD:case g.TH:break;default:Ca(e,t)}}function d6(e,t){const n=t.tagID;Iy.has(n)?(e.openElements.hasInTableScope(g.TD)||e.openElements.hasInTableScope(g.TH))&&(e._closeTableCell(),kl(e,t)):fn(e,t)}function f6(e,t){const n=t.tagID;switch(n){case g.TD:case g.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_ROW);break}case g.TABLE:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),Py(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:break;default:Sl(e,t)}}function Ry(e,t){switch(t.tagID){case g.HTML:{fn(e,t);break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._insertElement(t,me.HTML);break}case g.OPTGROUP:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._insertElement(t,me.HTML);break}case g.HR:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._appendElement(t,me.HTML),t.ackSelfClosing=!0;break}case g.INPUT:case g.KEYGEN:case g.TEXTAREA:case g.SELECT:{e.openElements.hasInSelectScope(g.SELECT)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),t.tagID!==g.SELECT&&e._processStartTag(t));break}case g.SCRIPT:case g.TEMPLATE:{dr(e,t);break}}}function Ly(e,t){switch(t.tagID){case g.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===g.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===g.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop();break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop();break}case g.SELECT:{e.openElements.hasInSelectScope(g.SELECT)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode());break}case g.TEMPLATE:{ss(e,t);break}}}function h6(e,t){const n=t.tagID;n===g.CAPTION||n===g.TABLE||n===g.TBODY||n===g.TFOOT||n===g.THEAD||n===g.TR||n===g.TD||n===g.TH?(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Ry(e,t)}function p6(e,t){const n=t.tagID;n===g.CAPTION||n===g.TABLE||n===g.TBODY||n===g.TFOOT||n===g.THEAD||n===g.TR||n===g.TD||n===g.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Ly(e,t)}function m6(e,t){switch(t.tagID){case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:case g.NOFRAMES:case g.SCRIPT:case g.STYLE:case g.TEMPLATE:case g.TITLE:{dr(e,t);break}case g.CAPTION:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.tmplInsertionModeStack[0]=U.IN_TABLE,e.insertionMode=U.IN_TABLE,Js(e,t);break}case g.COL:{e.tmplInsertionModeStack[0]=U.IN_COLUMN_GROUP,e.insertionMode=U.IN_COLUMN_GROUP,fh(e,t);break}case g.TR:{e.tmplInsertionModeStack[0]=U.IN_TABLE_BODY,e.insertionMode=U.IN_TABLE_BODY,Al(e,t);break}case g.TD:case g.TH:{e.tmplInsertionModeStack[0]=U.IN_ROW,e.insertionMode=U.IN_ROW,kl(e,t);break}default:e.tmplInsertionModeStack[0]=U.IN_BODY,e.insertionMode=U.IN_BODY,fn(e,t)}}function g6(e,t){t.tagID===g.TEMPLATE&&ss(e,t)}function Dy(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):ch(e,t)}function E6(e,t){t.tagID===g.HTML?fn(e,t):Cl(e,t)}function My(e,t){var n;if(t.tagID===g.HTML){if(e.fragmentContext||(e.insertionMode=U.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===g.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else Cl(e,t)}function Cl(e,t){e.insertionMode=U.IN_BODY,xl(e,t)}function y6(e,t){switch(t.tagID){case g.HTML:{fn(e,t);break}case g.FRAMESET:{e._insertElement(t,me.HTML);break}case g.FRAME:{e._appendElement(t,me.HTML),t.ackSelfClosing=!0;break}case g.NOFRAMES:{dr(e,t);break}}}function T6(e,t){t.tagID===g.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==g.FRAMESET&&(e.insertionMode=U.AFTER_FRAMESET))}function b6(e,t){switch(t.tagID){case g.HTML:{fn(e,t);break}case g.NOFRAMES:{dr(e,t);break}}}function w6(e,t){t.tagID===g.HTML&&(e.insertionMode=U.AFTER_AFTER_FRAMESET)}function _6(e,t){t.tagID===g.HTML?fn(e,t):Nl(e,t)}function Nl(e,t){e.insertionMode=U.IN_BODY,xl(e,t)}function x6(e,t){switch(t.tagID){case g.HTML:{fn(e,t);break}case g.NOFRAMES:{dr(e,t);break}}}function S6(e,t){t.chars=kt,e._insertCharacters(t)}function v6(e,t){e._insertCharacters(t),e.framesetOk=!1}function Fy(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==me.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function A6(e,t){if(jP(t))Fy(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===me.MATHML?gy(t):r===me.SVG&&(zP(t),Ey(t)),ah(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function k6(e,t){if(t.tagID===g.P||t.tagID===g.BR){Fy(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===me.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}K.AREA,K.BASE,K.BASEFONT,K.BGSOUND,K.BR,K.COL,K.EMBED,K.FRAME,K.HR,K.IMG,K.INPUT,K.KEYGEN,K.LINK,K.META,K.PARAM,K.SOURCE,K.TRACK,K.WBR;const C6=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,N6=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),By={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Uy(e,t){const n=U6(e),r=QE("type",{handlers:{root:O6,element:I6,text:P6,comment:jy,doctype:R6,raw:D6},unknown:M6}),s={parser:n?new by(By):by.getFragmentParser(void 0,By),handle(l){r(l,s)},stitches:!1,options:t||{}};r(e,s),Zs(s,vr());const a=n?s.parser.document:s.parser.getFragment(),u=HI(a,{file:s.options.file});return s.stitches&&yl(u,"comment",function(l,d,f){const m=l;if(m.value.stitch&&f&&d!==void 0){const p=f.children;return p[d]=m.value.stitch,d}}),u.type==="root"&&u.children.length===1&&u.children[0].type===e.type?u.children[0]:u}function Hy(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function O6(e,t){Hy(e.children,t)}function I6(e,t){F6(e,t),Hy(e.children,t),B6(e,t)}function P6(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:rt.CHARACTER,chars:e.value,location:Ia(e)};Zs(t,vr(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function R6(e,t){const n={type:rt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Ia(e)};Zs(t,vr(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function L6(e,t){t.stitches=!0;const n=H6(e);if("children"in e&&"children"in n){const r=Uy({type:"root",children:e.children},t.options);n.children=r.children}jy({type:"comment",value:{stitch:n}},t)}function jy(e,t){const n=e.value,r={type:rt.COMMENT,data:n,location:Ia(e)};Zs(t,vr(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function D6(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,zy(t,vr(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(C6,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function M6(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))L6(n,t);else{let r="";throw N6.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Zs(e,t){zy(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Ut.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function zy(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function F6(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Ut.PLAINTEXT)return;Zs(t,vr(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:rs.html;s===rs.html&&n==="svg"&&(s=rs.svg);const a=qI(ce(j({},e),{children:[]}),{space:s===rs.svg?"svg":"html"}),u={type:rt.START_TAG,tagName:n,tagID:Qs(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:Ia(e)};t.parser.currentToken=u,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function B6(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&ZI.includes(n)||t.parser.tokenizer.state===Ut.PLAINTEXT)return;Zs(t,al(e));const r={type:rt.END_TAG,tagName:n,tagID:Qs(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Ia(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Ut.RCDATA||t.parser.tokenizer.state===Ut.RAWTEXT||t.parser.tokenizer.state===Ut.SCRIPT_DATA)&&(t.parser.tokenizer.state=Ut.DATA)}function U6(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Ia(e){const t=vr(e)||{line:void 0,column:void 0,offset:void 0},n=al(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function H6(e){return"children"in e?ns(ce(j({},e),{children:[]})):ns(e)}function $y(e){return function(t,n){return Uy(t,ce(j({},e),{file:n}))}}const os=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Vy={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...os,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...os],h2:[["className","sr-only"]],img:[...os,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...os,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...os],table:[...os],ul:[...os,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},yi={}.hasOwnProperty;function j6(e,t){let n={type:"root",children:[]};const r={schema:t?j(j({},Vy),t):Vy,stack:[]},s=qy(r,e);return s&&(Array.isArray(s)?s.length===1?n=s[0]:n.children=s:n=s),n}function qy(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return z6(e,n);case"doctype":return $6(e,n);case"element":return V6(e,n);case"root":return q6(e,n);case"text":return Y6(e,n)}}}function z6(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),a={type:"comment",value:r<0?n:n.slice(0,r)};return Pa(a,t),a}}function $6(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Pa(n,t),n}}function V6(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=Yy(e,t.children),s=W6(e,t.properties);e.stack.pop();let a=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&yi.call(e.schema.ancestors,n))){const l=e.schema.ancestors[n];let d=-1;for(a=!1;++d<l.length;)e.stack.includes(l[d])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const u={type:"element",tagName:n,properties:s,children:r};return Pa(u,t),u}function q6(e,t){const r={type:"root",children:Yy(e,t.children)};return Pa(r,t),r}function Y6(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Pa(r,t),r}function Yy(e,t){const n=[];if(Array.isArray(t)){const r=t;let s=-1;for(;++s<r.length;){const a=qy(e,r[s]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function W6(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,s=e.schema.required,a=r&&yi.call(r,n)?r[n]:void 0,u=r&&yi.call(r,"*")?r["*"]:void 0,l=t&&typeof t=="object"?t:{},d={};let f;for(f in l)if(yi.call(l,f)){const m=l[f];let p=Wy(e,Xy(a,f),f,m);p==null&&(p=Wy(e,Xy(u,f),f,m)),p!=null&&(d[f]=p)}if(s&&yi.call(s,n)){const m=s[n];for(f in m)yi.call(m,f)&&!yi.call(d,f)&&(d[f]=m[f])}return d}function Wy(e,t,n,r){return t?Array.isArray(r)?G6(e,t,n,r):Gy(e,t,n,r):void 0}function G6(e,t,n,r){let s=-1;const a=[];for(;++s<r.length;){const u=Gy(e,t,n,r[s]);(typeof u=="number"||typeof u=="string")&&a.push(u)}return a}function Gy(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&X6(e,n,r)){if(typeof t=="object"&&t.length>1){let s=!1,a=0;for(;++a<t.length;){const u=t[a];if(u&&typeof u=="object"&&"flags"in u){if(u.test(String(r))){s=!0;break}}else if(u===r){s=!0;break}}if(!s)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function X6(e,t,n){const r=e.schema.protocols&&yi.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const s=String(n),a=s.indexOf(":"),u=s.indexOf("?"),l=s.indexOf("#"),d=s.indexOf("/");if(a<0||d>-1&&a>d||u>-1&&a>u||l>-1&&a>l)return!0;let f=-1;for(;++f<r.length;){const m=r[f];if(a===m.length&&s.slice(0,m.length)===m)return!0}return!1}function Pa(e,t){const n=H1(t);t.data&&(e.data=ns(t.data)),n&&(e.position=n)}function Xy(e,t){let n,r=-1;if(e)for(;++r<e.length;){const s=e[r],a=typeof s=="string"?s:s[0];if(a===t)return s;a==="data*"&&(n=s)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function K6(e){return function(t){return j6(t,e)}}const Ky=({globalClassName:e,openLinksInNewTab:t,href:n,title:r,children:s})=>{const a=n?t?"_blank":"_self":void 0;return w.jsx("a",ce(j(j({className:B(e,`${N}-link`)},n?{href:n,target:a}:{}),r?{title:r}:{}),{rel:"noopener noreferrer",children:s}))},Q6=()=>{const{disclaimerText:e,disclaimerMarkdown:t,globalClassName:n}=ft();return!e&&!t?null:w.jsx("div",{className:B(n,`${N}-disclaimer`),children:t?w.jsx(zE,{rehypePlugins:[$y,K6],components:{ul:({children:r})=>w.jsx("ul",{className:B(n,`${N}-ul`),children:r}),ol:({children:r})=>w.jsx("ol",{className:B(n,`${N}-ol`),children:r}),li:({children:r})=>w.jsx("li",{className:B(n,`${N}-li`),children:r}),a:({href:r,title:s,children:a})=>w.jsx(Ky,{globalClassName:n,openLinksInNewTab:!0,href:r,title:s,children:a}),img:({src:r,alt:s})=>w.jsx("img",{className:B(n,`${N}-disclaimer-image`),src:r,alt:s}),p:({children:r})=>w.jsx("p",{className:B(n,`${N}-disclaimer-text`),children:r}),span:({children:r})=>w.jsx("span",{className:B(n,`${N}-disclaimer-text-span`),children:r})},children:t}):w.jsx("p",{className:B(n,`${N}-disclaimer-text`),children:e})})},ph=({className:e,isLoading:t,componentType:n,onSubmit:r})=>{const{isConnected:s,sessionExpired:a,canInitialize:u,messages:l}=Cn(),{globalClassName:d,searchConfig:f,enableEscalationToAgent:m}=ft(),p=R.useRef(null),b=R.useRef(l);b.current=l;const y=t||!Hg(s,a,u),_=R.useRef(t);R.useEffect(()=>{var C;const S=_.current&&!t;_.current=t,S&&!y&&((C=p.current)==null||C.focus({preventScroll:!0}))},[t,y]);const x=S=>Be(null,null,function*(){var O,z;S.preventDefault();const C=(((O=p.current)==null?void 0:O.value)||"").trim();if(C){const G=!s&&!a&&u===!0,D=b.current.length;p.current.value="";const V=yield r(C);G&&V.outcome!=="success"&&b.current.length===D&&((z=p.current)==null?void 0:z.value)===""&&(p.current.value=C,p.current.disabled||p.current.focus({preventScroll:!0}))}}),A=()=>{r("Can you connect me to a human?")};return w.jsxs("div",{className:B(d,e,`cim-${n}-component`,`${N}-search-bar-wrapper`),children:[w.jsxs("form",{className:B(d,e,`cim-${n}-component`,`${N}-search-bar`),name:`${N}-search-form`,onSubmit:x,children:[w.jsx("input",{className:B(d,e,`cim-${n}-component`,`${N}-search-input`),type:"text",ref:p,placeholder:(f==null?void 0:f.placeholder)||"Ask us anything",name:`${N}-user-input`,disabled:y}),w.jsx(NC,{className:e,globalClassName:d,searchConfig:f,componentType:n,isLoading:y}),m&&w.jsx(lr,{className:B(d,`${N}-escalate-btn`),ariaLabel:"Connect to a human agent",title:"Connect to a human agent",disabled:y,onClick:A,icon:w.jsx(yC,{})})]}),w.jsx(Q6,{})]})};function J6(e){return ht({attr:{version:"1.1",viewBox:"0 0 17 17"},child:[{tag:"g",attr:{},child:[]},{tag:"path",attr:{d:"M17 16v1h-17v-1h17zM13.354 8.854l-0.707-0.707-3.646 3.646v-11.793h-1v11.794l-3.647-3.648-0.708 0.708 4.854 4.853 4.854-4.853z"},child:[]}]})(e)}function Z6(e){return ht({attr:{version:"1.1",viewBox:"0 0 17 17"},child:[{tag:"g",attr:{},child:[]},{tag:"path",attr:{d:"M6 8h-6v-6h1v4.109c1.013-3.193 4.036-5.484 7.5-5.484 3.506 0 6.621 2.36 7.574 5.739l-0.963 0.271c-0.832-2.95-3.551-5.011-6.611-5.011-3.226 0.001-6.016 2.276-6.708 5.376h4.208v1zM11 9v1h4.208c-0.693 3.101-3.479 5.375-6.708 5.375-3.062 0-5.78-2.061-6.611-5.011l-0.963 0.271c0.952 3.379 4.067 5.739 7.574 5.739 3.459 0 6.475-2.28 7.5-5.482v4.108h1v-6h-6z"},child:[]}]})(e)}const Qy=R.createContext({isOpen:!1}),mh=R.createContext(null),Jy=R.createContext(null),eo=()=>{var n,r;const e=R.useContext(mh),t=R.useContext(Jy);return(r=(n=e==null?void 0:e.closeMenu)!=null?n:t==null?void 0:t.closeMenu)!=null?r:(()=>{})},Zy=({onClearChat:e,componentType:t})=>{const n=eo(),r=()=>{e(),n()};return w.jsxs("button",{className:B(`${N}-overflow-menu-button`,"clear-chat-button",`cim-${t}-component`),onClick:r,children:[w.jsx(Z6,{}),"Clear chat"]})},eT=({onDownloadTranscript:e,componentType:t})=>{const{logger:n}=ft(),r=eo(),[s,a]=R.useState(!1),u=()=>Be(null,null,function*(){if(!s){a(!0);try{yield e(),r()}catch(l){n==null||n.error("Error downloading transcript:",l)}finally{a(!1)}}});return w.jsxs("button",{className:B(`${N}-overflow-menu-button`,"download-transcript-button",`cim-${t}-component`),onClick:u,disabled:s,children:[w.jsx(J6,{}),"Download transcript"]})};function e4(e){return e==null?[]:Array.isArray(e)?e:[e]}var t4=(e,...t)=>e.concat(t),n4=(e,...t)=>e.filter(n=>!t.includes(n)),r4=e=>Array.from(new Set(e));function tT(e,t,n={}){const{step:r=1,loop:s=!0}=n,a=t+r,u=e.length,l=u-1;return t===-1?r>0?0:l:a<0?s?l:0:a>=u?s?0:t>u?u:t:a}function i4(e,t,n={}){const{step:r=1,loop:s=!0}=n;return tT(e,t,{step:-r,loop:s})}var s4=e=>Array.isArray(e),nT=e=>e!=null&&typeof e=="object",o4=e=>nT(e)&&!s4(e),Ol=e=>typeof e=="string",to=e=>typeof e=="function",a4=e=>e==null,u4=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l4=e=>Object.prototype.toString.call(e),rT=Function.prototype.toString,c4=rT.call(Object),d4=e=>{if(!nT(e)||l4(e)!="[object Object]"||p4(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=u4(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&rT.call(n)==c4},f4=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,h4=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,p4=e=>f4(e)||h4(e),m4=e=>e(),g4=()=>{},gh=(...e)=>(...t)=>{e.forEach(function(n){n==null||n(...t)})};function E4(e,t=0){let n=0,r=null;return((...s)=>{const a=Date.now(),u=a-n;u>=t?(r&&(clearTimeout(r),r=null),e(...s),n=a):r||(r=setTimeout(()=>{e(...s),n=Date.now(),r=null},t-u))})}var{min:y4,max:T4}=Math,b4=e=>Number.isNaN(e),w4=e=>b4(e)?0:e,iT=(e,t,n)=>y4(T4(w4(e),t),n);function Eh(e){if(!d4(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const s=e[r];s!==void 0&&(n[r]=Eh(s))}return n}function yh(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function _4(e,t){if(e==null)throw new Error(t())}function x4(e,t,n){let r=[];for(const s of t)e[s]==null&&r.push(s);if(r.length>0)throw new Error(`[zag-js${` > ${n}`}] missing required props: ${r.join(", ")}`)}var S4=Object.defineProperty,v4=(e,t,n)=>t in e?S4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Th=(e,t,n)=>v4(e,typeof t!="symbol"?t+"":t,n),sT=()=>{},Il=e=>typeof e=="object"&&e!==null,no=e=>e?"":void 0,oT=e=>e?"true":void 0,A4=1,k4=9,C4=11,Jt=e=>Il(e)&&e.nodeType===A4&&typeof e.nodeName=="string",Pl=e=>Il(e)&&e.nodeType===k4,N4=e=>Il(e)&&e===e.window,aT=e=>Jt(e)?e.localName||"":"#document";function O4(e){return["html","body","#document"].includes(aT(e))}var I4=e=>Il(e)&&e.nodeType!==void 0,as=e=>I4(e)&&e.nodeType===C4&&"host"in e,P4=e=>Jt(e)&&e.localName==="input",R4=e=>Jt(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function Ra(e){if(!e)return!1;const t=e.getRootNode();return so(t)===e}var L4=/(textarea|select)/;function D4(e){if(e==null||!Jt(e))return!1;try{return P4(e)&&e.selectionStart!=null||L4.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch(t){return!1}}function ro(e,t){var r;if(!e||!t||!Jt(e)||!Jt(t))return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e===t||e.contains(t))return!0;if(n&&as(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Cr(e){var t;return Pl(e)?e:N4(e)?e.document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function M4(e){return Cr(e).documentElement}function io(e){var t,n,r;return as(e)?io(e.host):Pl(e)?(t=e.defaultView)!=null?t:window:Jt(e)&&(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window}function so(e){let t=e.activeElement;for(;t!=null&&t.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n||n===t)break;t=n}return t}function F4(e){if(aT(e)==="html")return e;const t=e.assignedSlot||e.parentNode||as(e)&&e.host||M4(e);return as(t)?t.host:t}function bh(e){var n;let t;try{if(t=e.getRootNode({composed:!0}),Pl(t)||as(t))return t}catch(r){}return(n=e.ownerDocument)!=null?n:document}var wh=new WeakMap;function oo(e){return wh.has(e)||wh.set(e,io(e).getComputedStyle(e)),wh.get(e)}var _h=new Set(["menu","listbox","dialog","grid","tree","region"]),B4=e=>_h.has(e),uT=e=>{var t;return((t=e.getAttribute("aria-controls"))==null?void 0:t.split(" "))||[]};function lT(e,t){const n=new Set,r=bh(e),s=a=>{const u=a.querySelectorAll("[aria-controls]");for(const l of u){if(l.getAttribute("aria-expanded")!=="true")continue;const d=uT(l);for(const f of d){if(!f||n.has(f))continue;n.add(f);const m=r.getElementById(f);if(m){const p=m.getAttribute("role"),b=m.getAttribute("aria-modal")==="true";if(p&&B4(p)&&!b&&(m===t||m.contains(t)||s(m)))return!0}}}return!1};return s(e)}function cT(e,t){const n=bh(e),r=new Set,s=a=>{const u=a.querySelectorAll("[aria-controls]");for(const l of u){if(l.getAttribute("aria-expanded")!=="true")continue;const d=uT(l);for(const f of d){if(!f||r.has(f))continue;r.add(f);const m=n.getElementById(f);if(m){const p=m.getAttribute("role"),b=m.getAttribute("aria-modal")==="true";p&&_h.has(p)&&!b&&(t(m),s(m))}}}};s(e)}function U4(e){const t=new Set;return cT(e,n=>{e.contains(n)||t.add(n)}),Array.from(t)}function H4(e){const t=e.getAttribute("role");return!!(t&&_h.has(t))}function j4(e){return e.hasAttribute("aria-controls")&&e.getAttribute("aria-expanded")==="true"}function z4(e){var t;return j4(e)?!0:!!((t=e.querySelector)!=null&&t.call(e,'[aria-controls][aria-expanded="true"]'))}function $4(e){if(!e.id)return!1;const t=bh(e),n=CSS.escape(e.id),r=`[aria-controls~="${n}"][aria-expanded="true"], [aria-controls="${n}"][aria-expanded="true"]`;return!!(t.querySelector(r)&&H4(e))}var xh=()=>typeof document!="undefined";function V4(){var t;const e=navigator.userAgentData;return(t=e==null?void 0:e.platform)!=null?t:navigator.platform}var Sh=e=>xh()&&e.test(V4()),q4=e=>xh()&&e.test(navigator.vendor),dT=()=>xh()&&!!navigator.maxTouchPoints,Y4=()=>Sh(/^iPhone/i),W4=()=>Sh(/^iPad/i)||vh()&&navigator.maxTouchPoints>1,Rl=()=>Y4()||W4(),G4=()=>vh()||Rl(),vh=()=>Sh(/^Mac/i),X4=()=>G4()&&q4(/apple/i);function K4(e){var t,n,r,s;return(s=(t=e.composedPath)==null?void 0:t.call(e))!=null?s:(r=(n=e.nativeEvent)==null?void 0:n.composedPath)==null?void 0:r.call(n)}function fr(e){var n;const t=K4(e);return(n=t==null?void 0:t[0])!=null?n:e.target}var fT=e=>e.button===0,Q4=e=>e.button===2||vh()&&e.ctrlKey&&e.button===0,J4=e=>"touches"in e&&e.touches.length>0,Z4={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},hT={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function eL(e,t={}){var u;const{dir:n="ltr",orientation:r="horizontal"}=t;let s=e.key;return s=(u=Z4[s])!=null?u:s,n==="rtl"&&r==="horizontal"&&s in hT&&(s=hT[s]),s}function pT(e,t="client"){const n=J4(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var Zt=(e,t,n,r)=>{const s=typeof e=="function"?e():e;return s==null||s.addEventListener(t,n,r),()=>{s==null||s.removeEventListener(t,n,r)}},mT=e=>Jt(e)&&e.tagName==="IFRAME",tL=/^(audio|video|details)$/;function gT(e){const t=e.getAttribute("tabindex");return t?parseInt(t,10):NaN}var nL=e=>!Number.isNaN(gT(e)),rL=e=>gT(e)<0;function iL(e,t){if(!t)return null;if(t===!0)return e.shadowRoot||null;const n=t(e);return(n===!0?e.shadowRoot:n)||null}function ET(e,t,n){const r=[...e],s=[...e],a=new Set,u=new Map;e.forEach((d,f)=>u.set(d,f));let l=0;for(;l<s.length;){const d=s[l++];if(!d||a.has(d))continue;a.add(d);const f=iL(d,t);if(f){const m=Array.from(f.querySelectorAll(Ll)).filter(n),p=u.get(d);if(p!==void 0){const b=p+1;r.splice(b,0,...m),m.forEach((y,_)=>{u.set(y,b+_)});for(let y=b+m.length;y<r.length;y++)u.set(r[y],y)}else{const b=r.length;r.push(...m),m.forEach((y,_)=>{u.set(y,b+_)})}s.push(...m)}}return r}var Ll="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type",yT=(e,t={})=>{if(!e)return[];const{includeContainer:n=!1,getShadowRoot:r}=t,s=Array.from(e.querySelectorAll(Ll));(n==!0||n=="if-empty"&&s.length===0)&&Jt(e)&&Nr(e)&&s.unshift(e);const u=[];for(const l of s)if(Nr(l)){if(mT(l)&&l.contentDocument){const d=l.contentDocument.body;u.push(...yT(d,{getShadowRoot:r}));continue}u.push(l)}return r?ET(u,r,Nr):u};function Nr(e){return!Jt(e)||e.closest("[inert]")?!1:e.matches(Ll)&&R4(e)}function ao(e,t={}){if(!e)return[];const{includeContainer:n,getShadowRoot:r}=t,s=Array.from(e.querySelectorAll(Ll));n&&us(e)&&s.unshift(e);const a=[];for(const u of s)if(us(u)){if(mT(u)&&u.contentDocument){const l=u.contentDocument.body;a.push(...ao(l,{getShadowRoot:r}));continue}a.push(u)}if(r){const u=ET(a,r,us);return!u.length&&n?s:u}return!a.length&&n?s:a}function us(e){return Jt(e)&&e.tabIndex>0?!0:Nr(e)&&!rL(e)}function sL(e,t={}){const n=ao(e,t),r=n[0]||null,s=n[n.length-1]||null;return[r,s]}function oL(e,t={}){const{current:n,getShadowRoot:r}=t,s=ao(e,{getShadowRoot:r}),a=(e==null?void 0:e.ownerDocument)||document,u=n!=null?n:so(a);if(!u)return null;const l=s.indexOf(u);return s[l+1]||null}function La(e){return e.tabIndex<0&&(tL.test(e.localName)||D4(e))&&!nL(e)?0:e.tabIndex}function TT(e){const{root:t,getInitialEl:n,filter:r,enabled:s=!0}=e;if(!s)return;let a=null;if(a||(a=typeof n=="function"?n():n),a||(a=t==null?void 0:t.querySelector("[data-autofocus],[autofocus]")),!a){const u=ao(t);a=r?u.filter(r)[0]:u[0]}return a||t||void 0}var aL=class I2{constructor(){Th(this,"id",null),Th(this,"fn_cleanup"),Th(this,"cleanup",()=>{this.cancel()})}static create(){return new I2}request(t){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=t==null?void 0:t()})}cancel(){var t;this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),(t=this.fn_cleanup)==null||t.call(this),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function qt(e){const t=aL.create();return t.request(e),t.cleanup}function bT(e){const t=new Set;function n(r){const s=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(s))}return n(()=>n(e)),function(){t.forEach(s=>s())}}function Ah(e){const t=F4(e);return O4(t)?Cr(t).body:Jt(t)&&cL(t)?t:Ah(t)}var uL=/auto|scroll|overlay|hidden|clip/,lL=new Set(["inline","contents"]);function cL(e){const t=io(e),{overflow:n,overflowX:r,overflowY:s,display:a}=t.getComputedStyle(e);return uL.test(n+s+r)&&!lL.has(a)}var uo="default",kh="",Dl=new WeakMap;function dL(e={}){const{target:t,doc:n}=e,r=n!=null?n:document,s=r.documentElement;return Rl()?(uo==="default"&&(kh=s.style.webkitUserSelect,s.style.webkitUserSelect="none"),uo="disabled"):t&&(Dl.set(t,t.style.userSelect),t.style.userSelect="none"),()=>fL({target:t,doc:r})}function fL(e={}){const{target:t,doc:n}=e,s=(n!=null?n:document).documentElement;if(Rl()){if(uo!=="disabled")return;uo="restoring",setTimeout(()=>{bT(()=>{uo==="restoring"&&(s.style.webkitUserSelect==="none"&&(s.style.webkitUserSelect=kh||""),kh="",uo="default")})},300)}else if(t&&Dl.has(t)){const a=Dl.get(t);t.style.userSelect==="none"&&(t.style.userSelect=a!=null?a:""),t.getAttribute("style")===""&&t.removeAttribute("style"),Dl.delete(t)}}function hL(e={}){const u=e,{defer:t,target:n}=u,r=Sn(u,["defer","target"]),s=t?qt:l=>l(),a=[];return a.push(s(()=>{const l=typeof n=="function"?n():n;a.push(dL(ce(j({},r),{target:l})))})),()=>{a.forEach(l=>l==null?void 0:l())}}function pL(e,t){const{onPointerMove:n,onPointerUp:r}=t,s=l=>{const d=pT(l),f=Math.sqrt(gd(d.x,2)+gd(d.y,2)),m=l.pointerType==="touch"?10:5;if(!(f<m)){if(l.pointerType==="mouse"&&l.button===0){a(l);return}n({point:d,event:l})}},a=l=>{const d=pT(l);r({point:d,event:l})},u=[Zt(e,"pointermove",s,!1),Zt(e,"pointerup",a,!1),Zt(e,"pointercancel",a,!1),Zt(e,"contextmenu",a,!1),hL({doc:e})];return()=>{u.forEach(l=>l())}}function mL(e,t={}){const{triggerElement:n,onFocus:r,onFocusEnter:s,getShadowRoot:a}=t,u=(e==null?void 0:e.ownerDocument)||document,l=u.body;function d(f){if(f.key!=="Tab")return;let m=null;const[p,b]=sL(e,{includeContainer:!0,getShadowRoot:a}),y=oL(l,{current:n,getShadowRoot:a}),_=!p&&!b;f.shiftKey&&Ra(y)?(s==null||s(),m=b):f.shiftKey&&(Ra(p)||_)?m=n:!f.shiftKey&&Ra(n)?(s==null||s(),m=p):!f.shiftKey&&(Ra(b)||_)&&(m=y),m&&(f.preventDefault(),typeof r=="function"?r(m):m.focus())}return Zt(u,"keydown",d,!0)}function gL(e,t){const l=t,{defer:n,triggerElement:r}=l,s=Sn(l,["defer","triggerElement"]),a=n?qt:d=>d(),u=[];return u.push(a(()=>{const d=typeof e=="function"?e():e,f=typeof r=="function"?r():r;u.push(mL(d,j({triggerElement:f},s)))})),()=>{u.forEach(d=>d==null?void 0:d())}}function EL(e,t){var n;return Array.from((n=e==null?void 0:e.querySelectorAll(t))!=null?n:[])}function Ml(e,t){if(!e)return sT;const n=Object.keys(t).reduce((r,s)=>(r[s]=e.style.getPropertyValue(s),r),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")}}function yL(e,t,n){if(!e)return sT;const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r),e.style.length===0&&e.removeAttribute("style")}}function TL(e,t,n){const{signal:r}=t;return[new Promise((u,l)=>{const d=setTimeout(()=>{l(new Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener("abort",()=>{clearTimeout(d),l(new Error("Promise aborted"))}),e.then(f=>{r.aborted||(clearTimeout(d),u(f))}).catch(f=>{r.aborted||(clearTimeout(d),l(f))})}),()=>t.abort()]}function bL(e,t){const{timeout:n,rootNode:r}=t,s=io(r),a=Cr(r),u=new s.AbortController;return TL(new Promise(l=>{const d=e();if(d){l(d);return}const f=new s.MutationObserver(()=>{const m=e();m&&m.isConnected&&(f.disconnect(),l(m))});f.observe(a.body,{childList:!0,subtree:!0})}),u,n)}var wL=(...e)=>e.map(t=>{var n;return(n=t==null?void 0:t.trim)==null?void 0:n.call(t)}).filter(Boolean).join(" "),_L=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,wT=e=>{const t={};let n;for(;n=_L.exec(e);)t[n[1]]=n[2];return t},xL=(e,t)=>{if(Ol(e)){if(Ol(t))return`${e};${t}`;e=wT(e)}else Ol(t)&&(t=wT(t));return Object.assign({},e!=null?e:{},t!=null?t:{})};function Yt(...e){let t={};for(let n of e){if(!n)continue;for(let s in t){if(s.startsWith("on")&&typeof t[s]=="function"&&typeof n[s]=="function"){t[s]=gh(n[s],t[s]);continue}if(s==="className"||s==="class"){t[s]=wL(t[s],n[s]);continue}if(s==="style"){t[s]=xL(t[s],n[s]);continue}t[s]=n[s]!==void 0?n[s]:t[s]}for(let s in n)t[s]===void 0&&(t[s]=n[s]);const r=Object.getOwnPropertySymbols(n);for(let s of r)t[s]=n[s]}return t}function UU(e){return e}var lo=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(lo||{}),Ch="__init__";function SL(e){const t=()=>{var u,l;return(l=(u=e.getRootNode)==null?void 0:u.call(e))!=null?l:document},n=()=>Cr(t()),r=()=>{var u;return(u=n().defaultView)!=null?u:window},s=()=>so(t()),a=u=>t().getElementById(u);return ce(j({},e),{getRootNode:t,getDoc:n,getWin:r,getActiveElement:s,isActiveElement:Ra,getById:a})}function vL(e){return new Proxy({},{get(t,n){return n==="style"?r=>e({style:r}).style:e}})}var co=()=>e=>Array.from(new Set(e)),_T=typeof globalThis.document!="undefined"?R.useLayoutEffect:R.useEffect;function Fl(e){var p,b;const t=(p=e().value)!=null?p:e().defaultValue,n=(b=e().isEqual)!=null?b:Object.is,[r]=R.useState(t),[s,a]=R.useState(r),u=e().value!==void 0,l=R.useRef(s);l.current=u?e().value:s;const d=R.useRef(l.current);_T(()=>{d.current=l.current},[s,e().value]);const f=y=>{var A,S;const _=d.current,x=to(y)?y(_):y;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:x,prev:_}),u||a(x),n(x,_)||(S=(A=e()).onChange)==null||S.call(A,x,_)};function m(){return u?e().value:s}return{initial:r,ref:l,get:m,set(y){(e().sync?Vs.flushSync:m4)(()=>f(y))},invoke(y,_){var x,A;(A=(x=e()).onChange)==null||A.call(x,y,_)},hash(y){var _,x,A;return(A=(x=(_=e()).hash)==null?void 0:x.call(_,y))!=null?A:String(y)}}}Fl.cleanup=e=>{R.useEffect(()=>e,[])},Fl.ref=e=>{const t=R.useRef(e);return{get:()=>t.current,set:n=>{t.current=n}}};function AL(e){const t=R.useRef(e);return{get(n){return t.current[n]},set(n,r){t.current[n]=r}}}var kL=(e,t)=>{const n=R.useRef(!1),r=R.useRef(!1);R.useEffect(()=>{if(n.current&&r.current)return t();r.current=!0},[...(e!=null?e:[]).map(s=>typeof s=="function"?s():s)]),R.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function Bl(e,t={}){var ie,te,le,fe,ue,Se;const n=R.useMemo(()=>{const{id:de,ids:W,getRootNode:oe}=t;return SL({id:de,ids:W,getRootNode:oe})},[t]),r=(...de)=>{e.debug&&console.log(...de)},s=(te=(ie=e.props)==null?void 0:ie.call(e,{props:Eh(t),scope:n}))!=null?te:t,a=CL(s),u=(le=e.context)==null?void 0:le.call(e,{prop:a,bindable:Fl,scope:n,flush:ST,getContext(){return d},getComputed(){return G},getRefs(){return x},getEvent(){return y()}}),l=xT(u),d={get(de){var W;return(W=l.current)==null?void 0:W[de].ref.current},set(de,W){var oe;(oe=l.current)==null||oe[de].set(W)},initial(de){var W;return(W=l.current)==null?void 0:W[de].initial},hash(de){var oe,k;const W=(oe=l.current)==null?void 0:oe[de].get();return(k=l.current)==null?void 0:k[de].hash(W)}},f=R.useRef(new Map),m=R.useRef(null),p=R.useRef(null),b=R.useRef({type:""}),y=()=>ce(j({},b.current),{current(){return b.current},previous(){return p.current}}),_=()=>ce(j({},D),{matches(...de){return de.includes(D.ref.current)},hasTag(de){var W,oe;return!!((oe=(W=e.states[D.ref.current])==null?void 0:W.tags)!=null&&oe.includes(de))}}),x=AL((ue=(fe=e.refs)==null?void 0:fe.call(e,{prop:a,context:d}))!=null?ue:{}),A=()=>({state:_(),context:d,event:y(),prop:a,send:H,action:S,guard:C,track:kL,refs:x,computed:G,flush:ST,scope:n,choose:z}),S=de=>{const W=to(de)?de(A()):de;if(!W)return;const oe=W.map(k=>{var Z,P;const M=(P=(Z=e.implementations)==null?void 0:Z.actions)==null?void 0:P[k];return M||yh(`[zag-js] No implementation found for action "${JSON.stringify(k)}"`),M});for(const k of oe)k==null||k(A())},C=de=>{var W,oe;return to(de)?de(A()):(oe=(W=e.implementations)==null?void 0:W.guards)==null?void 0:oe[de](A())},O=de=>{const W=to(de)?de(A()):de;if(!W)return;const oe=W.map(M=>{var P,xe;const Z=(xe=(P=e.implementations)==null?void 0:P.effects)==null?void 0:xe[M];return Z||yh(`[zag-js] No implementation found for effect "${JSON.stringify(M)}"`),Z}),k=[];for(const M of oe){const Z=M==null?void 0:M(A());Z&&k.push(Z)}return()=>k.forEach(M=>M==null?void 0:M())},z=de=>e4(de).find(W=>{let oe=!W.guard;return Ol(W.guard)?oe=!!C(W.guard):to(W.guard)&&(oe=W.guard(A())),oe}),G=de=>{_4(e.computed,()=>"[zag-js] No computed object found on machine");const W=e.computed[de];return W({context:d,event:y(),prop:a,refs:x,scope:n,computed:G})},D=Fl(()=>({defaultValue:e.initialState({prop:a}),onChange(de,W){var k,M,Z,P;if(W){const xe=f.current.get(W);xe==null||xe(),f.current.delete(W)}W&&S((k=e.states[W])==null?void 0:k.exit),S((M=m.current)==null?void 0:M.actions);const oe=O((Z=e.states[de])==null?void 0:Z.effects);if(oe&&f.current.set(de,oe),W===Ch){S(e.entry);const xe=O(e.effects);xe&&f.current.set(Ch,xe)}S((P=e.states[de])==null?void 0:P.entry)}})),V=R.useRef(void 0),J=R.useRef(lo.NotStarted);_T(()=>{queueMicrotask(()=>{var M;const oe=J.current===lo.Started;J.current=lo.Started,r(oe?"rehydrating...":"initializing...");const k=(M=V.current)!=null?M:D.initial;D.invoke(k,oe?D.get():Ch)});const de=f.current,W=D.ref.current;return()=>{r("unmounting..."),V.current=W,J.current=lo.Stopped,de.forEach(oe=>oe==null?void 0:oe()),f.current=new Map,m.current=null,queueMicrotask(()=>{S(e.exit)})}},[]);const se=()=>"ref"in D?D.ref.current:D.get(),H=de=>{queueMicrotask(()=>{var P,xe,Ie,he,ve;if(J.current!==lo.Started)return;p.current=b.current,b.current=de;let W=se();const oe=(Ie=(P=e.states[W].on)==null?void 0:P[de.type])!=null?Ie:(xe=e.on)==null?void 0:xe[de.type],k=z(oe);if(!k)return;m.current=k;const M=(he=k.target)!=null?he:W;r("transition",de.type,k.target||W,`(${k.actions})`);const Z=M!==W;Z?Vs.flushSync(()=>D.set(M)):k.reenter&&!Z?D.invoke(W,W):S((ve=k.actions)!=null?ve:[])})};return(Se=e.watch)==null||Se.call(e,A()),{state:_(),send:H,context:d,prop:a,scope:n,refs:x,computed:G,event:y(),getStatus:()=>J.current}}function xT(e){const t=R.useRef(e);return t.current=e,t}function CL(e){const t=xT(e);return function(r){return t.current[r]}}function ST(e){queueMicrotask(()=>{Vs.flushSync(()=>e())})}var Nh=vL(e=>e);function Ul(...e){return t=>{const n=[];for(const r of e)if(typeof r=="function"){const s=r(t);typeof s=="function"&&n.push(s)}else r&&(r.current=t);if(n.length)return()=>{for(const r of n)r()}}}function NL(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Oh=e=>{const t=R.memo(R.forwardRef((n,r)=>{const f=n,{asChild:s,children:a}=f,u=Sn(f,["asChild","children"]);if(!s)return R.createElement(e,ce(j({},u),{ref:r}),a);if(!R.isValidElement(a))return null;const l=R.Children.only(a),d=NL(l);return R.cloneElement(l,ce(j({},Yt(u,l.props)),{ref:r?Ul(r,d):d}))}));return t.displayName=e.displayName||e.name,t},hn=(()=>{const e=new Map;return new Proxy(Oh,{apply(t,n,r){return Oh(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,Oh(r)),e.get(r)}})})();function OL(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function ls(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:s="Provider",errorMessage:a,defaultValue:u}=e,l=R.createContext(u);l.displayName=t;function d(){var m;const f=R.useContext(l);if(!f&&n){const p=new Error(a!=null?a:OL(r,s));throw p.name="ContextError",(m=Error.captureStackTrace)==null||m.call(Error,p,d),p}return f}return[l.Provider,d,l]}const[IL,Ih]=ls({name:"PopoverContext",hookName:"usePopoverContext",providerName:"<PopoverProvider />"}),[vT,Da]=ls({name:"PresenceContext",hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),AT=R.forwardRef((e,t)=>{const n=Ih(),r=Da(),s=Yt(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:w.jsx(hn.div,ce(j({},s),{ref:Ul(r.ref,t)}))});AT.displayName="PopoverContent";const kT=R.forwardRef((e,t)=>{const n=Ih(),r=Da(),s=Yt(n.getPositionerProps(),e);return r.unmounted?null:w.jsx(hn.div,ce(j({},s),{ref:t}))});kT.displayName="PopoverPositioner";const Ma=()=>(e,t)=>t.reduce((n,r)=>{const[s,a]=n,u=r;return a[u]!==void 0&&(s[u]=a[u]),delete a[u],[s,a]},[{},j({},e)]),CT=e=>Ma()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]);function PL(e,t){const{state:n,send:r,context:s}=e,a=n.matches("mounted","unmountSuspended");return{skip:!s.get("initial"),present:a,setNode(u){u&&r({type:"NODE.SET",node:u})},unmount(){r({type:"UNMOUNT"})}}}var RL={props({props:e}){return ce(j({},e),{present:!!e.present})},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["clearInitial","cleanupNode"],watch({track:e,prop:t,send:n}){e([()=>t("present")],()=>{n({type:"PRESENCE.CHANGED"})})},on:{"NODE.SET":{actions:["setupNode"]},"PRESENCE.CHANGED":{actions:["setInitial","syncPresence"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},clearInitial:({context:e})=>{e.set("initial",!1)},invokeOnExitComplete:({prop:e})=>{var t;(t=e("onExitComplete"))==null||t()},setupNode:({refs:e,event:t})=>{e.get("node")!==t.node&&(e.set("node",t.node),e.set("styles",oo(t.node)))},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{const s=r("present");if(s)return n({type:"MOUNT",src:"presence.changed"});const a=t.get("node");if(!s&&(a==null?void 0:a.ownerDocument.visibilityState)==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});qt(()=>{var l,d;const u=Hl(t.get("styles"));e.set("unmountAnimationName",u),u==="none"||u===e.get("prevAnimationName")||((l=t.get("styles"))==null?void 0:l.display)==="none"||((d=t.get("styles"))==null?void 0:d.animationDuration)==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{qt(()=>{e.set("prevAnimationName",Hl(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:r})=>{const s=t.get("node");if(!s)return;const a=d=>{var m,p,b;((b=(p=(m=d.composedPath)==null?void 0:m.call(d))==null?void 0:p[0])!=null?b:d.target)===s&&e.set("prevAnimationName",Hl(t.get("styles")))},u=d=>{const f=Hl(t.get("styles"));fr(d)===s&&f===e.get("unmountAnimationName")&&!r("present")&&n({type:"UNMOUNT",src:"animationend"})};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",u),s.addEventListener("animationend",u);const l=Ml(s,{animationFillMode:"forwards"});return()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",u),s.removeEventListener("animationend",u),bT(()=>l())}}}}};function Hl(e){return(e==null?void 0:e.animationName)||"none"}co()(["onExitComplete","present","immediate"]);function LL(e,t={}){const{sync:n=!1}=t,r=DL(e);return R.useCallback((...s)=>{var a;return n?queueMicrotask(()=>{var u;return(u=r.current)==null?void 0:u.call(r,...s)}):(a=r.current)==null?void 0:a.call(r,...s)},[n,r])}function DL(e){const t=R.useRef(e);return t.current=e,t}const Ph=(e={})=>{const b=e,{lazyMount:t,unmountOnExit:n,present:r,skipAnimationOnMount:s=!1}=b,a=Sn(b,["lazyMount","unmountOnExit","present","skipAnimationOnMount"]),u=R.useRef(!1),l=ce(j({},a),{present:r,onExitComplete:LL(e.onExitComplete)}),d=Bl(RL,l),f=PL(d);f.present&&(u.current=!0);const m=!f.present&&!u.current&&t||n&&!f.present&&u.current,p=()=>({"data-state":f.skip&&s?void 0:r?"open":"closed",hidden:!f.present});return{ref:f.setNode,getPresenceProps:p,present:f.present,unmounted:m}};var cs=(e,t=[])=>({parts:(...n)=>{if(ML(t))return cs(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>cs(e,[...t,...n]),omit:(...n)=>cs(e,t.filter(r=>!n.includes(r))),rename:n=>cs(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${fo(e)}"][data-part="${fo(r)}"]`,`& [data-scope="${fo(e)}"][data-part="${fo(r)}"]`].join(", "),attrs:{"data-scope":fo(e),"data-part":fo(r)}}}),{})}),fo=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),ML=e=>e.length===0;const FL=["top","right","bottom","left"],Ti=Math.min,Yr=Math.max,jl=Math.round,zl=Math.floor,Or=e=>({x:e,y:e}),BL={left:"right",right:"left",bottom:"top",top:"bottom"};function NT(e,t,n){return Yr(e,Ti(t,n))}function Wr(e,t){return typeof e=="function"?e(t):e}function bi(e){return e.split("-")[0]}function ho(e){return e.split("-")[1]}function Rh(e){return e==="x"?"y":"x"}function Lh(e){return e==="y"?"height":"width"}function Ir(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Dh(e){return Rh(Ir(e))}function UL(e,t,n){n===void 0&&(n=!1);const r=ho(e),s=Dh(e),a=Lh(s);let u=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(u=$l(u)),[u,$l(u)]}function HL(e){const t=$l(e);return[Mh(e),t,Mh(t)]}function Mh(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const OT=["left","right"],IT=["right","left"],jL=["top","bottom"],zL=["bottom","top"];function $L(e,t,n){switch(e){case"top":case"bottom":return n?t?IT:OT:t?OT:IT;case"left":case"right":return t?jL:zL;default:return[]}}function VL(e,t,n,r){const s=ho(e);let a=$L(bi(e),n==="start",r);return s&&(a=a.map(u=>u+"-"+s),t&&(a=a.concat(a.map(Mh)))),a}function $l(e){const t=bi(e);return BL[t]+e.slice(t.length)}function qL(e){var t,n,r,s;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(s=e.left)!=null?s:0}}function PT(e){return typeof e!="number"?qL(e):{top:e,right:e,bottom:e,left:e}}function Vl(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function RT(e,t,n){let{reference:r,floating:s}=e;const a=Ir(t),u=Dh(t),l=Lh(u),d=bi(t),f=a==="y",m=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,b=r[l]/2-s[l]/2;let y;switch(d){case"top":y={x:m,y:r.y-s.height};break;case"bottom":y={x:m,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-s.width,y:p};break;default:y={x:r.x,y:r.y}}const _=ho(t);return _&&(y[u]+=b*(_==="end"?1:-1)*(n&&f?-1:1)),y}function YL(e,t){return Be(this,null,function*(){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:u,elements:l,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:b=!1,padding:y=0}=Wr(t,e),_=PT(y),A=l[b?p==="floating"?"reference":"floating":p],S=Vl(yield a.getClippingRect({element:(n=yield a.isElement==null?void 0:a.isElement(A))==null||n?A:A.contextElement||(yield a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:f,rootBoundary:m,strategy:d})),C=p==="floating"?{x:r,y:s,width:u.floating.width,height:u.floating.height}:u.reference,O=yield a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating),z=(yield a.isElement==null?void 0:a.isElement(O))&&(yield a.getScale==null?void 0:a.getScale(O))||{x:1,y:1},G=Vl(a.convertOffsetParentRelativeRectToViewportRelativeRect?yield a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:C,offsetParent:O,strategy:d}):C);return{top:(S.top-G.top+_.top)/z.y,bottom:(G.bottom-S.bottom+_.bottom)/z.y,left:(S.left-G.left+_.left)/z.x,right:(G.right-S.right+_.right)/z.x}})}const WL=50,GL=(e,t,n)=>Be(null,null,function*(){const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:u}=n,l=u.detectOverflow?u:ce(j({},u),{detectOverflow:YL}),d=yield u.isRTL==null?void 0:u.isRTL(t);let f=yield u.getElementRects({reference:e,floating:t,strategy:s}),{x:m,y:p}=RT(f,r,d),b=r,y=0;const _={};for(let x=0;x<a.length;x++){const A=a[x];if(!A)continue;const{name:S,fn:C}=A,{x:O,y:z,data:G,reset:D}=yield C({x:m,y:p,initialPlacement:r,placement:b,strategy:s,middlewareData:_,rects:f,platform:l,elements:{reference:e,floating:t}});m=O!=null?O:m,p=z!=null?z:p,_[S]=j(j({},_[S]),G),D&&y<WL&&(y++,typeof D=="object"&&(D.placement&&(b=D.placement),D.rects&&(f=D.rects===!0?yield u.getElementRects({reference:e,floating:t,strategy:s}):D.rects),{x:m,y:p}=RT(f,b,d)),x=-1)}return{x:m,y:p,placement:b,strategy:s,middlewareData:_}}),XL=e=>({name:"arrow",options:e,fn(n){return Be(this,null,function*(){const{x:r,y:s,placement:a,rects:u,platform:l,elements:d,middlewareData:f}=n,{element:m,padding:p=0}=Wr(e,n)||{};if(m==null)return{};const b=PT(p),y={x:r,y:s},_=Dh(a),x=Lh(_),A=yield l.getDimensions(m),S=_==="y",C=S?"top":"left",O=S?"bottom":"right",z=S?"clientHeight":"clientWidth",G=u.reference[x]+u.reference[_]-y[_]-u.floating[x],D=y[_]-u.reference[_],V=yield l.getOffsetParent==null?void 0:l.getOffsetParent(m);let J=V?V[z]:0;(!J||!(yield l.isElement==null?void 0:l.isElement(V)))&&(J=d.floating[z]||u.floating[x]);const se=G/2-D/2,H=J/2-A[x]/2-1,ie=Ti(b[C],H),te=Ti(b[O],H),le=J-A[x]-te,fe=J/2-A[x]/2+se,ue=NT(ie,fe,le),Se=!f.arrow&&ho(a)!=null&&fe!==ue&&u.reference[x]/2-(fe<ie?ie:te)-A[x]/2<0,de=Se?fe<ie?fe-ie:fe-le:0;return{[_]:y[_]+de,data:j({[_]:ue,centerOffset:fe-ue-de},Se&&{alignmentOffset:de}),reset:Se}})}}),KL=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(n){return Be(this,null,function*(){var r,s;const{placement:a,middlewareData:u,rects:l,initialPlacement:d,platform:f,elements:m}=n,ue=Wr(e,n),{mainAxis:p=!0,crossAxis:b=!0,fallbackPlacements:y,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:A=!0}=ue,S=Sn(ue,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((r=u.arrow)!=null&&r.alignmentOffset)return{};const C=bi(a),O=Ir(d),z=bi(d)===d,G=yield f.isRTL==null?void 0:f.isRTL(m.floating),D=y||(z||!A?[$l(d)]:HL(d)),V=x!=="none";!y&&V&&D.push(...VL(d,A,x,G));const J=[d,...D],se=yield f.detectOverflow(n,S),H=[];let ie=((s=u.flip)==null?void 0:s.overflows)||[];if(p&&H.push(se[C]),b){const Se=UL(a,l,G);H.push(se[Se[0]],se[Se[1]])}if(ie=[...ie,{placement:a,overflows:H}],!H.every(Se=>Se<=0)){var te,le;const Se=(((te=u.flip)==null?void 0:te.index)||0)+1,de=J[Se];if(de&&(!(b==="alignment"?O!==Ir(de):!1)||ie.every(k=>Ir(k.placement)===O?k.overflows[0]>0:!0)))return{data:{index:Se,overflows:ie},reset:{placement:de}};let W=(le=ie.filter(oe=>oe.overflows[0]<=0).sort((oe,k)=>oe.overflows[1]-k.overflows[1])[0])==null?void 0:le.placement;if(!W)switch(_){case"bestFit":{var fe;const oe=(fe=ie.filter(k=>{if(V){const M=Ir(k.placement);return M===O||M==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(M=>M>0).reduce((M,Z)=>M+Z,0)]).sort((k,M)=>k[1]-M[1])[0])==null?void 0:fe[0];oe&&(W=oe);break}case"initialPlacement":W=d;break}if(a!==W)return{reset:{placement:W}}}return{}})}}};function LT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function DT(e){return FL.some(t=>e[t]>=0)}const QL=function(e){return e===void 0&&(e={}),{name:"hide",options:e,fn(n){return Be(this,null,function*(){const{rects:r,platform:s}=n,l=Wr(e,n),{strategy:a="referenceHidden"}=l,u=Sn(l,["strategy"]);switch(a){case"referenceHidden":{const d=yield s.detectOverflow(n,ce(j({},u),{elementContext:"reference"})),f=LT(d,r.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:DT(f)}}}case"escaped":{const d=yield s.detectOverflow(n,ce(j({},u),{altBoundary:!0})),f=LT(d,r.floating);return{data:{escapedOffsets:f,escaped:DT(f)}}}default:return{}}})}}},MT=new Set(["left","top"]);function JL(e,t){return Be(this,null,function*(){const{placement:n,platform:r,elements:s}=e,a=yield r.isRTL==null?void 0:r.isRTL(s.floating),u=bi(n),l=ho(n),d=Ir(n)==="y",f=MT.has(u)?-1:1,m=a&&d?-1:1,p=Wr(t,e);let{mainAxis:b,crossAxis:y,alignmentAxis:_}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof _=="number"&&(y=l==="end"?_*-1:_),d?{x:y*m,y:b*f}:{x:b*f,y:y*m}})}const ZL=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(n){return Be(this,null,function*(){var r,s;const{x:a,y:u,placement:l,middlewareData:d}=n,f=yield JL(n,e);return l===((r=d.offset)==null?void 0:r.placement)&&(s=d.arrow)!=null&&s.alignmentOffset?{}:{x:a+f.x,y:u+f.y,data:ce(j({},f),{placement:l})}})}}},e5=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(n){return Be(this,null,function*(){const{x:r,y:s,placement:a,platform:u}=n,O=Wr(e,n),{mainAxis:l=!0,crossAxis:d=!1,limiter:f={fn:z=>{let{x:G,y:D}=z;return{x:G,y:D}}}}=O,m=Sn(O,["mainAxis","crossAxis","limiter"]),p={x:r,y:s},b=yield u.detectOverflow(n,m),y=Ir(a),_=Rh(y);let x=p[_],A=p[y];const S=(z,G)=>NT(G+b[z==="y"?"top":"left"],G,G-b[z==="y"?"bottom":"right"]);l&&(x=S(_,x)),d&&(A=S(y,A));const C=f.fn(ce(j({},n),{[_]:x,[y]:A}));return ce(j({},C),{data:{x:C.x-r,y:C.y-s,enabled:{[_]:l,[y]:d}}})})}}},t5=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:a,placement:u,rects:l,middlewareData:d}=t,{offset:f=0,mainAxis:m=!0,crossAxis:p=!0}=Wr(e,t),b={x:s,y:a},y=Ir(u),_=Rh(y);let x=b[_],A=b[y];const S=Wr(f,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(m){const G=_==="y"?"height":"width",D=l.reference[_]-l.floating[G]+C.mainAxis,V=l.reference[_]+l.reference[G]-C.mainAxis;x<D?x=D:x>V&&(x=V)}if(p){var O,z;const G=_==="y"?"width":"height",D=MT.has(bi(u)),V=l.reference[y]-l.floating[G]+(D&&((O=d.offset)==null?void 0:O[y])||0)+(D?0:C.crossAxis),J=l.reference[y]+l.reference[G]+(D?0:((z=d.offset)==null?void 0:z[y])||0)-(D?C.crossAxis:0);A<V?A=V:A>J&&(A=J)}return{[_]:x,[y]:A}}}},n5=function(e){return e===void 0&&(e={}),{name:"size",options:e,fn(n){return Be(this,null,function*(){const{placement:r,rects:s,platform:a,elements:u}=n,H=Wr(e,n),{apply:l=()=>{}}=H,d=Sn(H,["apply"]),f=yield a.detectOverflow(n,d),m=bi(r),p=ho(r),b=Ir(r)==="y",{width:y,height:_}=s.floating;let x,A;m==="top"||m==="bottom"?(x=m,A=p===((yield a.isRTL==null?void 0:a.isRTL(u.floating))?"start":"end")?"left":"right"):(A=m,x=p==="end"?"top":"bottom");const S=_-f.top-f.bottom,C=y-f.left-f.right,O=Ti(_-f[x],S),z=Ti(y-f[A],C),G=n.middlewareData.shift,D=!G;let V=O,J=z;G!=null&&G.enabled.x&&(J=C),G!=null&&G.enabled.y&&(V=S),D&&!p&&(b?J=y-2*Yr(f.left,f.right):V=_-2*Yr(f.top,f.bottom)),yield l(ce(j({},n),{availableWidth:J,availableHeight:V}));const se=yield a.getDimensions(u.floating);return y!==se.width||_!==se.height?{reset:{rects:!0}}:{}})}}};function ql(){return typeof window!="undefined"}function po(e){return FT(e)?(e.nodeName||"").toLowerCase():"#document"}function Vn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pr(e){var t;return(t=(FT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function FT(e){return ql()?e instanceof Node||e instanceof Vn(e).Node:!1}function hr(e){return ql()?e instanceof Element||e instanceof Vn(e).Element:!1}function Rr(e){return ql()?e instanceof HTMLElement||e instanceof Vn(e).HTMLElement:!1}function BT(e){return!ql()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof Vn(e).ShadowRoot}function Fa(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=pr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function r5(e){return/^(table|td|th)$/.test(po(e))}function Yl(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}const i5=/transform|translate|scale|rotate|perspective|filter/,s5=/paint|layout|strict|content/,ds=e=>!!e&&e!=="none";let Fh;function Bh(e){const t=hr(e)?pr(e):e;return ds(t.transform)||ds(t.translate)||ds(t.scale)||ds(t.rotate)||ds(t.perspective)||!Uh()&&(ds(t.backdropFilter)||ds(t.filter))||i5.test(t.willChange||"")||s5.test(t.contain||"")}function o5(e){let t=wi(e);for(;Rr(t)&&!mo(t);){if(Bh(t))return t;if(Yl(t))return null;t=wi(t)}return null}function Uh(){return Fh==null&&(Fh=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Fh}function mo(e){return/^(html|body|#document)$/.test(po(e))}function pr(e){return Vn(e).getComputedStyle(e)}function Wl(e){return hr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wi(e){if(po(e)==="html")return e;const t=e.assignedSlot||e.parentNode||BT(e)&&e.host||Pr(e);return BT(t)?t.host:t}function UT(e){const t=wi(e);return mo(t)?(e.ownerDocument||e).body:Rr(t)&&Fa(t)?t:UT(t)}function Ba(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=UT(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),u=Vn(s);if(a){const l=Hh(u);return t.concat(u,u.visualViewport||[],Fa(s)?s:[],l&&n?Ba(l):[])}else return t.concat(s,Ba(s,[],n))}function Hh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function HT(e){const t=pr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Rr(e),a=s?e.offsetWidth:n,u=s?e.offsetHeight:r,l=jl(n)!==a||jl(r)!==u;return l&&(n=a,r=u),{width:n,height:r,$:l}}function jh(e){return hr(e)?e:e.contextElement}function go(e){const t=jh(e);if(!Rr(t))return Or(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=HT(t);let u=(a?jl(n.width):n.width)/r,l=(a?jl(n.height):n.height)/s;return(!u||!Number.isFinite(u))&&(u=1),(!l||!Number.isFinite(l))&&(l=1),{x:u,y:l}}const a5=Or(0);function jT(e){const t=Vn(e);return!Uh()||!t.visualViewport?a5:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function u5(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Vn(e)?!1:t}function fs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=jh(e);let u=Or(1);t&&(r?hr(r)&&(u=go(r)):u=go(e));const l=u5(a,n,r)?jT(a):Or(0);let d=(s.left+l.x)/u.x,f=(s.top+l.y)/u.y,m=s.width/u.x,p=s.height/u.y;if(a){const b=Vn(a),y=r&&hr(r)?Vn(r):r;let _=b,x=Hh(_);for(;x&&r&&y!==_;){const A=go(x),S=x.getBoundingClientRect(),C=pr(x),O=S.left+(x.clientLeft+parseFloat(C.paddingLeft))*A.x,z=S.top+(x.clientTop+parseFloat(C.paddingTop))*A.y;d*=A.x,f*=A.y,m*=A.x,p*=A.y,d+=O,f+=z,_=Vn(x),x=Hh(_)}}return Vl({width:m,height:p,x:d,y:f})}function Gl(e,t){const n=Wl(e).scrollLeft;return t?t.left+n:fs(Pr(e)).left+n}function zT(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Gl(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function l5(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",u=Pr(r),l=t?Yl(t.floating):!1;if(r===u||l&&a)return n;let d={scrollLeft:0,scrollTop:0},f=Or(1);const m=Or(0),p=Rr(r);if((p||!p&&!a)&&((po(r)!=="body"||Fa(u))&&(d=Wl(r)),Rr(r))){const y=fs(r);f=go(r),m.x=y.x+r.clientLeft,m.y=y.y+r.clientTop}const b=u&&!p&&!a?zT(u,d):Or(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+m.x+b.x,y:n.y*f.y-d.scrollTop*f.y+m.y+b.y}}function c5(e){return Array.from(e.getClientRects())}function d5(e){const t=Pr(e),n=Wl(e),r=e.ownerDocument.body,s=Yr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Yr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+Gl(e);const l=-n.scrollTop;return pr(r).direction==="rtl"&&(u+=Yr(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:u,y:l}}const $T=25;function f5(e,t){const n=Vn(e),r=Pr(e),s=n.visualViewport;let a=r.clientWidth,u=r.clientHeight,l=0,d=0;if(s){a=s.width,u=s.height;const m=Uh();(!m||m&&t==="fixed")&&(l=s.offsetLeft,d=s.offsetTop)}const f=Gl(r);if(f<=0){const m=r.ownerDocument,p=m.body,b=getComputedStyle(p),y=m.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,_=Math.abs(r.clientWidth-p.clientWidth-y);_<=$T&&(a-=_)}else f<=$T&&(a+=f);return{width:a,height:u,x:l,y:d}}const h5=new Set(["absolute","fixed"]);function p5(e,t){const n=fs(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=Rr(e)?go(e):Or(1),u=e.clientWidth*a.x,l=e.clientHeight*a.y,d=s*a.x,f=r*a.y;return{width:u,height:l,x:d,y:f}}function VT(e,t,n){let r;if(t==="viewport")r=f5(e,n);else if(t==="document")r=d5(Pr(e));else if(hr(t))r=p5(t,n);else{const s=jT(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Vl(r)}function qT(e,t){const n=wi(e);return n===t||!hr(n)||mo(n)?!1:pr(n).position==="fixed"||qT(n,t)}function m5(e,t){const n=t.get(e);if(n)return n;let r=Ba(e,[],!1).filter(l=>hr(l)&&po(l)!=="body"),s=null;const a=pr(e).position==="fixed";let u=a?wi(e):e;for(;hr(u)&&!mo(u);){const l=pr(u),d=Bh(u);!d&&l.position==="fixed"&&(s=null),(a?!d&&!s:!d&&l.position==="static"&&!!s&&h5.has(s.position)||Fa(u)&&!d&&qT(e,u))?r=r.filter(m=>m!==u):s=l,u=wi(u)}return t.set(e,r),r}function g5(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const u=[...n==="clippingAncestors"?Yl(t)?[]:m5(t,this._c):[].concat(n),r],l=u[0],d=u.reduce((f,m)=>{const p=VT(t,m,s);return f.top=Yr(p.top,f.top),f.right=Ti(p.right,f.right),f.bottom=Ti(p.bottom,f.bottom),f.left=Yr(p.left,f.left),f},VT(t,l,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function E5(e){const{width:t,height:n}=HT(e);return{width:t,height:n}}function y5(e,t,n){const r=Rr(t),s=Pr(t),a=n==="fixed",u=fs(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const d=Or(0);function f(){d.x=Gl(s)}if(r||!r&&!a)if((po(t)!=="body"||Fa(s))&&(l=Wl(t)),r){const y=fs(t,!0,a,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else s&&f();a&&!r&&s&&f();const m=s&&!r&&!a?zT(s,l):Or(0),p=u.left+l.scrollLeft-d.x-m.x,b=u.top+l.scrollTop-d.y-m.y;return{x:p,y:b,width:u.width,height:u.height}}function zh(e){return pr(e).position==="static"}function YT(e,t){if(!Rr(e)||pr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Pr(e)===n&&(n=n.ownerDocument.body),n}function WT(e,t){const n=Vn(e);if(Yl(e))return n;if(!Rr(e)){let s=wi(e);for(;s&&!mo(s);){if(hr(s)&&!zh(s))return s;s=wi(s)}return n}let r=YT(e,t);for(;r&&r5(r)&&zh(r);)r=YT(r,t);return r&&mo(r)&&zh(r)&&!Bh(r)?n:r||o5(e)||n}const T5=function(e){return Be(this,null,function*(){const t=this.getOffsetParent||WT,n=this.getDimensions,r=yield n(e.floating);return{reference:y5(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})};function b5(e){return pr(e).direction==="rtl"}const w5={convertOffsetParentRelativeRectToViewportRelativeRect:l5,getDocumentElement:Pr,getClippingRect:g5,getOffsetParent:WT,getElementRects:T5,getClientRects:c5,getDimensions:E5,getScale:go,isElement:hr,isRTL:b5};function GT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _5(e,t){let n=null,r;const s=Pr(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function u(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),a();const f=e.getBoundingClientRect(),{left:m,top:p,width:b,height:y}=f;if(l||t(),!b||!y)return;const _=zl(p),x=zl(s.clientWidth-(m+b)),A=zl(s.clientHeight-(p+y)),S=zl(m),O={rootMargin:-_+"px "+-x+"px "+-A+"px "+-S+"px",threshold:Yr(0,Ti(1,d))||1};let z=!0;function G(D){const V=D[0].intersectionRatio;if(V!==d){if(!z)return u();V?u(!1,V):r=setTimeout(()=>{u(!1,1e-7)},1e3)}V===1&&!GT(f,e.getBoundingClientRect())&&u(),z=!1}try{n=new IntersectionObserver(G,ce(j({},O),{root:s.ownerDocument}))}catch(D){n=new IntersectionObserver(G,O)}n.observe(e)}return u(!0),a}function x5(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=jh(e),m=s||a?[...f?Ba(f):[],...Ba(t)]:[];m.forEach(S=>{s&&S.addEventListener("scroll",n,{passive:!0}),a&&S.addEventListener("resize",n)});const p=f&&l?_5(f,n):null;let b=-1,y=null;u&&(y=new ResizeObserver(S=>{let[C]=S;C&&C.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var O;(O=y)==null||O.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let _,x=d?fs(e):null;d&&A();function A(){const S=fs(e);x&&!GT(x,S)&&n(),x=S,_=requestAnimationFrame(A)}return n(),()=>{var S;m.forEach(C=>{s&&C.removeEventListener("scroll",n),a&&C.removeEventListener("resize",n)}),p==null||p(),(S=y)==null||S.disconnect(),y=null,d&&cancelAnimationFrame(_)}}const S5=ZL,v5=e5,A5=KL,k5=n5,C5=QL,N5=XL,O5=t5,I5=(e,t,n)=>{const r=new Map,s=j({platform:w5},n),a=ce(j({},s.platform),{_c:r});return GL(e,t,ce(j({},s),{platform:a}))};function XT(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const s={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return ce(j({},s),{toJSON:()=>s})}function P5(e){if(!e)return XT();const{x:t,y:n,width:r,height:s}=e;return XT(t,n,r,s)}function R5(e,t){return{contextElement:Jt(e)?e:void 0,getBoundingClientRect:()=>{const n=e,r=t==null?void 0:t(n);return r||!n?P5(r):n.getBoundingClientRect()}}}var Ua=e=>({variable:e,reference:`var(${e})`}),Gr={arrowSize:Ua("--arrow-size"),arrowSizeHalf:Ua("--arrow-size-half"),arrowBg:Ua("--arrow-background"),transformOrigin:Ua("--transform-origin"),arrowOffset:Ua("--arrow-offset")},L5=e=>e==="top"||e==="bottom"?"y":"x";function D5(e,t){return{name:"transformOrigin",fn(n){var se,H,ie,te,le;const{elements:r,middlewareData:s,placement:a,rects:u,y:l}=n,d=a.split("-")[0],f=L5(d),m=((se=s.arrow)==null?void 0:se.x)||0,p=((H=s.arrow)==null?void 0:H.y)||0,b=(t==null?void 0:t.clientWidth)||0,y=(t==null?void 0:t.clientHeight)||0,_=m+b/2,x=p+y/2,A=Math.abs(((ie=s.shift)==null?void 0:ie.y)||0),S=u.reference.height/2,C=y/2,O=(le=(te=e.offset)==null?void 0:te.mainAxis)!=null?le:e.gutter,z=typeof O=="number"?O+C:O!=null?O:C,G=A>z,D={top:`${_}px calc(100% + ${z}px)`,bottom:`${_}px ${-z}px`,left:`calc(100% + ${z}px) ${x}px`,right:`${-z}px ${x}px`}[d],V=`${_}px ${u.reference.y+S-l}px`,J=!!e.overlap&&f==="y"&&G;return r.floating.style.setProperty(Gr.transformOrigin.variable,J?V:D),{data:{transformOrigin:J?V:D}}}}}var M5={name:"rects",fn({rects:e}){return{data:e}}},F5=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:s}=n.arrow,a=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:s!=null?`${s}px`:"",[a]:`calc(100% + ${Gr.arrowOffset.reference})`}),{}}}};function B5(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}var U5={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function KT(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function $h(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function H5(e,t,n){const r=e||t.createElement("div");return N5({element:r,padding:n.arrowPadding})}function j5(e,t){var n;if(!a4((n=t.offset)!=null?n:t.gutter))return S5(({placement:r})=>{var m,p,b,y;const s=((e==null?void 0:e.clientHeight)||0)/2,a=(p=(m=t.offset)==null?void 0:m.mainAxis)!=null?p:t.gutter,u=typeof a=="number"?a+s:a!=null?a:s,{hasAlign:l}=B5(r),d=l?void 0:t.shift,f=(y=(b=t.offset)==null?void 0:b.crossAxis)!=null?y:d;return Eh({crossAxis:f,mainAxis:u,alignmentAxis:t.shift})})}function z5(e){if(!e.flip)return;const t=$h(e.boundary);return A5(ce(j({},t?{boundary:t}:void 0),{padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}))}function $5(e){if(!e.slide&&!e.overlap)return;const t=$h(e.boundary);return v5(ce(j({},t?{boundary:t}:void 0),{mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:O5()}))}function V5(e){return k5({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:r,availableWidth:s}){const a=t.floating,u=Math.round(n.reference.width),l=Math.round(n.reference.height);s=Math.floor(s),r=Math.floor(r),a.style.setProperty("--reference-width",`${u}px`),a.style.setProperty("--reference-height",`${l}px`),a.style.setProperty("--available-width",`${s}px`),a.style.setProperty("--available-height",`${r}px`)}})}function q5(e){var t;if(e.hideWhenDetached)return C5({strategy:"referenceHidden",boundary:(t=$h(e.boundary))!=null?t:"clippingAncestors"})}function Y5(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function W5(e,t,n={}){const r=R5(e,n.getAnchorRect);if(!t||!r)return;const s=Object.assign({},U5,n),a=t.querySelector("[data-part=arrow]"),u=[j5(a,s),z5(s),$5(s),H5(a,t.ownerDocument,s),F5(a),D5({gutter:s.gutter,offset:s.offset,overlap:s.overlap},a),V5(s),q5(s),M5],{placement:l,strategy:d,onComplete:f,onPositioned:m}=s,p=()=>Be(null,null,function*(){var z;if(!r||!t)return;const x=yield I5(r,t,{placement:l,middleware:u,strategy:d});f==null||f(x),m==null||m({placed:!0});const A=io(t),S=KT(A,x.x),C=KT(A,x.y);t.style.setProperty("--x",`${S}px`),t.style.setProperty("--y",`${C}px`),s.hideWhenDetached&&(((z=x.middlewareData.hide)==null?void 0:z.referenceHidden)?(t.style.setProperty("visibility","hidden"),t.style.setProperty("pointer-events","none")):(t.style.removeProperty("visibility"),t.style.removeProperty("pointer-events")));const O=t.firstElementChild;if(O){const G=oo(O);t.style.setProperty("--z-index",G.zIndex)}}),b=()=>Be(null,null,function*(){n.updatePosition?(yield n.updatePosition({updatePosition:p,floatingElement:t}),m==null||m({placed:!0})):yield p()}),y=Y5(s.listeners),_=s.listeners?x5(r,t,b,y):g4;return b(),()=>{_==null||_(),m==null||m({placed:!1})}}function QT(e,t,n={}){const l=n,{defer:r}=l,s=Sn(l,["defer"]),a=r?qt:d=>d(),u=[];return u.push(a(()=>{const d=typeof e=="function"?e():e,f=typeof t=="function"?t():t;u.push(W5(d,f,s))})),()=>{u.forEach(d=>d==null?void 0:d())}}var G5={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function X5(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:s="absolute"}=e;return{arrow:{position:"absolute",width:Gr.arrowSize.reference,height:Gr.arrowSize.reference,[Gr.arrowSizeHalf.variable]:`calc(${Gr.arrowSize.reference} / 2)`,[Gr.arrowOffset.variable]:`calc(${Gr.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?G5[t.split("-")[0]]:void 0,background:Gr.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:s,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}var Eo=new WeakMap,Xl=new WeakMap,Kl={},Vh=0,JT=e=>e&&(e.host||JT(e.parentNode)),K5=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=JT(n);return r&&e.contains(r)?r:(console.error("[zag-js > ariaHidden] target",n,"in not contained inside",e,". Doing nothing"),null)}).filter(n=>!!n),Q5=new Set(["script","output","status","next-route-announcer"]),J5=e=>Q5.has(e.localName)||e.role==="status"||e.hasAttribute("aria-live")?!0:e.matches("[data-live-announcer]"),Z5=(e,t)=>{const{parentNode:n,markerName:r,controlAttribute:s,followControlledElements:a=!0}=t,u=K5(n,Array.isArray(e)?e:[e]);Kl[r]||(Kl[r]=new WeakMap);const l=Kl[r],d=[],f=new Set,m=new Set(u),p=y=>{!y||f.has(y)||(f.add(y),p(y.parentNode))};u.forEach(y=>{p(y),a&&Jt(y)&&cT(y,_=>{p(_)})});const b=y=>{!y||m.has(y)||Array.prototype.forEach.call(y.children,_=>{if(f.has(_))b(_);else try{if(J5(_))return;const A=_.getAttribute(s)==="true",S=(Eo.get(_)||0)+1,C=(l.get(_)||0)+1;Eo.set(_,S),l.set(_,C),d.push(_),S===1&&A&&Xl.set(_,!0),C===1&&_.setAttribute(r,""),A||_.setAttribute(s,"true")}catch(x){console.error("[zag-js > ariaHidden] cannot operate on ",_,x)}})};return b(n),f.clear(),Vh++,()=>{d.forEach(y=>{const _=Eo.get(y)-1,x=l.get(y)-1;Eo.set(y,_),l.set(y,x),_||(Xl.has(y)||y.removeAttribute(s),Xl.delete(y)),x||y.removeAttribute(r)}),Vh--,Vh||(Eo=new WeakMap,Eo=new WeakMap,Xl=new WeakMap,Kl={})}},eD=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,tD=(e,t=eD(e),n="data-aria-hidden",r=!0)=>{if(t)return Z5(e,{parentNode:t,markerName:n,controlAttribute:"aria-hidden",followControlledElements:r})},nD=e=>{const t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function ZT(e,t={}){const{defer:n=!0}=t,r=n?nD:a=>a(),s=[];return s.push(r(()=>{const u=(typeof e=="function"?e():e).filter(Boolean);u.length!==0&&s.push(tD(u))})),()=>{s.forEach(a=>a==null?void 0:a())}}function rD(e){const t={each(n){var r;for(let s=0;s<((r=e.frames)==null?void 0:r.length);s+=1){const a=e.frames[s];a&&n(a)}},addEventListener(n,r,s){return t.each(a=>{try{a.document.addEventListener(n,r,s)}catch(u){}}),()=>{try{t.removeEventListener(n,r,s)}catch(a){}}},removeEventListener(n,r,s){t.each(a=>{try{a.document.removeEventListener(n,r,s)}catch(u){}})}};return t}function iD(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,s)=>{try{t==null||t.addEventListener(n,r,s)}catch(a){}return()=>{try{t==null||t.removeEventListener(n,r,s)}catch(a){}}},removeEventListener:(n,r,s)=>{try{t==null||t.removeEventListener(n,r,s)}catch(a){}}}}var eb="pointerdown.outside",tb="focus.outside";function sD(e){for(const t of e)if(Jt(t)&&Nr(t))return!0;return!1}var nb=e=>"clientY"in e;function oD(e,t){if(!nb(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function aD(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function rb(e,t){if(!t||!nb(e))return!1;const n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,s=t.scrollWidth>t.clientWidth,a=s&&e.clientY>t.offsetTop+t.clientHeight,u={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(s?16:0)},l={x:e.clientX,y:e.clientY};return aD(u,l)?r||a:!1}function uD(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:s,onInteractOutside:a,defer:u,followControlledElements:l=!0}=t;if(!e)return;const d=Cr(e),f=io(e),m=rD(f),p=iD(f);function b(O,z){if(!Jt(z)||!z.isConnected||ro(e,z)||oD(e,O)||l&&lT(e,z))return!1;const G=d.querySelector(`[aria-controls="${e.id}"]`);if(G){const V=Ah(G);if(rb(O,V))return!1}const D=Ah(e);return rb(O,D)?!1:!(n!=null&&n(z))}const y=new Set,_=as(e==null?void 0:e.getRootNode());function x(O){function z(G){var se,H;const D=u&&!dT()?qt:ie=>ie(),V=G!=null?G:O,J=(H=(se=V==null?void 0:V.composedPath)==null?void 0:se.call(V))!=null?H:[V==null?void 0:V.target];D(()=>{const ie=_?J[0]:fr(O);if(!(!e||!b(O,ie))){if(s||a){const te=gh(s,a);e.addEventListener(eb,te,{once:!0})}ib(e,eb,{bubbles:!1,cancelable:!0,detail:{originalEvent:V,contextmenu:Q4(V),focusable:sD(J),target:ie}})}})}O.pointerType==="touch"?(y.forEach(G=>G()),y.add(Zt(d,"click",z,{once:!0})),y.add(p.addEventListener("click",z,{once:!0})),y.add(m.addEventListener("click",z,{once:!0}))):z()}const A=new Set,S=setTimeout(()=>{A.add(Zt(d,"pointerdown",x,!0)),A.add(p.addEventListener("pointerdown",x,!0)),A.add(m.addEventListener("pointerdown",x,!0))},0);function C(O){(u?qt:G=>G())(()=>{var V,J;const G=(J=(V=O==null?void 0:O.composedPath)==null?void 0:V.call(O))!=null?J:[O==null?void 0:O.target],D=_?G[0]:fr(O);if(!(!e||!b(O,D))){if(r||a){const se=gh(r,a);e.addEventListener(tb,se,{once:!0})}ib(e,tb,{bubbles:!1,cancelable:!0,detail:{originalEvent:O,contextmenu:!1,focusable:Nr(D),target:D}})}})}return dT()||(A.add(Zt(d,"focusin",C,!0)),A.add(p.addEventListener("focusin",C,!0)),A.add(m.addEventListener("focusin",C,!0))),()=>{clearTimeout(S),y.forEach(O=>O()),A.forEach(O=>O())}}function lD(e,t){const{defer:n}=t,r=n?qt:a=>a(),s=[];return s.push(r(()=>{const a=typeof e=="function"?e():e;s.push(uD(a,t))})),()=>{s.forEach(a=>a==null?void 0:a())}}function ib(e,t,n){const r=e.ownerDocument.defaultView||window,s=new r.CustomEvent(t,n);return e.dispatchEvent(s)}function cD(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t==null||t(r))};return Zt(Cr(e),"keydown",n,{capture:!0})}var sb="layer:request-dismiss",Jn={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){var r;const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf((r=this.topMostPointerBlockingLayer())==null?void 0:r.node):-1;return t<n},isTopMost(e){const t=this.layers[this.count()-1];return(t==null?void 0:t.node)===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){const n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(r=>r.type===t)},getParentLayerOfType(e,t){const n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(r=>r.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return this.getNestedLayers(e).some(n=>ro(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>ro(t,e))},add(e){this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(r=>Jn.dismiss(r.node,e)),this.layers.splice(t,1),this.syncLayers())},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{e.node.style.setProperty("--layer-index",`${t}`),e.node.removeAttribute("data-nested"),e.node.removeAttribute("data-has-nested"),this.getParentLayerOfType(e.node,e.type)&&e.node.setAttribute("data-nested",e.type);const r=this.countNestedLayersOfType(e.node,e.type);r>0&&e.node.setAttribute("data-has-nested",e.type),e.node.style.setProperty("--nested-layer-count",`${r}`)})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const n=this.indexOf(e);if(n===-1)return;const r=this.layers[n];fD(e,sb,s=>{var a;(a=r.requestDismiss)==null||a.call(r,s),s.defaultPrevented||r==null||r.dismiss()}),dD(e,sb,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function dD(e,t,n){const r=e.ownerDocument.defaultView||window,s=new r.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(s)}function fD(e,t,n){e.addEventListener(t,n,{once:!0})}var ob;function ab(){Jn.layers.forEach(({node:e})=>{e.style.pointerEvents=Jn.isBelowPointerBlockingLayer(e)?"none":"auto"})}function hD(e){e.style.pointerEvents=""}function pD(e,t){const n=Cr(e),r=[];return Jn.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(ob=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t==null||t.forEach(s=>{const[a,u]=bL(()=>{const l=s();return Jt(l)?l:null},{timeout:1e3});a.then(l=>r.push(Ml(l,{pointerEvents:"auto"}))),r.push(u)}),()=>{Jn.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=ob,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(s=>s()))}}function mD(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){yh("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:r,onRequestDismiss:s,pointerBlocking:a,exclude:u,debug:l,type:d="dialog"}=t,f={dismiss:r,node:e,type:d,pointerBlocking:a,requestDismiss:s};Jn.add(f),ab();function m(x){var S,C;const A=fr(x.detail.originalEvent);Jn.isBelowPointerBlockingLayer(e)||Jn.isInBranch(A)||((S=t.onPointerDownOutside)==null||S.call(t,x),(C=t.onInteractOutside)==null||C.call(t,x),!x.defaultPrevented&&(l&&console.log("onPointerDownOutside:",x.detail.originalEvent),r==null||r()))}function p(x){var S,C;const A=fr(x.detail.originalEvent);Jn.isInBranch(A)||((S=t.onFocusOutside)==null||S.call(t,x),(C=t.onInteractOutside)==null||C.call(t,x),!x.defaultPrevented&&(l&&console.log("onFocusOutside:",x.detail.originalEvent),r==null||r()))}function b(x){var A;Jn.isTopMost(e)&&((A=t.onEscapeKeyDown)==null||A.call(t,x),!x.defaultPrevented&&r&&(x.preventDefault(),r()))}function y(x){var O;if(!e)return!1;const A=typeof u=="function"?u():u,S=Array.isArray(A)?A:[A],C=(O=t.persistentElements)==null?void 0:O.map(z=>z()).filter(Jt);return C&&S.push(...C),S.some(z=>ro(z,x))||Jn.isInNestedLayer(e,x)}const _=[a?pD(e,t.persistentElements):void 0,cD(e,b),lD(e,{exclude:y,onFocusOutside:p,onPointerDownOutside:m,defer:t.defer})];return()=>{Jn.remove(e),ab(),hD(e),_.forEach(x=>x==null?void 0:x())}}function ub(e,t){const{defer:n}=t,r=n?qt:a=>a(),s=[];return s.push(r(()=>{const a=to(e)?e():e;s.push(mD(a,t))})),()=>{s.forEach(a=>a==null?void 0:a())}}var gD=Object.defineProperty,ED=(e,t,n)=>t in e?gD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ct=(e,t,n)=>ED(e,typeof t!="symbol"?t+"":t,n),lb={activateTrap(e,t){if(e.length>0){const r=e[e.length-1];r!==t&&r.pause()}const n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap(e,t){const n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},yD=[],TD=class{constructor(e,t){Ct(this,"trapStack"),Ct(this,"config"),Ct(this,"doc"),Ct(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),Ct(this,"portalContainers",new Set),Ct(this,"listenerCleanups",[]),Ct(this,"handleFocus",r=>{const s=fr(r),a=this.findContainerIndex(s,r)>=0;if(a||Pl(s))a&&(this.state.mostRecentlyFocusedNode=s);else{r.stopImmediatePropagation();let u,l=!0;if(this.state.mostRecentlyFocusedNode)if(La(this.state.mostRecentlyFocusedNode)>0){const d=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:f}=this.state.containerGroups[d];if(f.length>0){const m=f.findIndex(p=>p===this.state.mostRecentlyFocusedNode);m>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?m+1<f.length&&(u=f[m+1],l=!1):m-1>=0&&(u=f[m-1],l=!1))}}else this.state.containerGroups.some(d=>d.tabbableNodes.some(f=>La(f)>0))||(l=!1);else l=!1;l&&(u=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),u?this.tryFocus(u):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),Ct(this,"handlePointerDown",r=>{const s=fr(r);if(!(this.findContainerIndex(s,r)>=0)){if(ja(this.config.clickOutsideDeactivates,r)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}ja(this.config.allowOutsideClick,r)||r.preventDefault()}}),Ct(this,"handleClick",r=>{const s=fr(r);this.findContainerIndex(s,r)>=0||ja(this.config.clickOutsideDeactivates,r)||ja(this.config.allowOutsideClick,r)||(r.preventDefault(),r.stopImmediatePropagation())}),Ct(this,"handleTabKey",r=>{if(this.config.isKeyForward(r)||this.config.isKeyBackward(r)){this.state.recentNavEvent=r;const s=this.config.isKeyBackward(r),a=this.findNextNavNode({event:r,isBackward:s});if(!a)return;Ha(r)&&r.preventDefault(),this.tryFocus(a)}}),Ct(this,"handleEscapeKey",r=>{bD(r)&&ja(this.config.escapeDeactivates,r)!==!1&&(r.preventDefault(),this.deactivate())}),Ct(this,"_mutationObserver"),Ct(this,"setupMutationObserver",()=>{const r=this.doc.defaultView||window;this._mutationObserver=new r.MutationObserver(s=>{s.some(l=>Array.from(l.removedNodes).some(f=>f===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode()),s.some(l=>l.type==="attributes"&&(l.attributeName==="aria-controls"||l.attributeName==="aria-expanded")?!0:l.type==="childList"&&l.addedNodes.length>0?Array.from(l.addedNodes).some(d=>{if(d.nodeType!==Node.ELEMENT_NODE)return!1;const f=d;return z4(f)?!0:f.id&&!this.state.containers.some(m=>m.contains(f))?$4(f):!1}):!1)&&this.state.active&&!this.state.paused&&(this.updateTabbableNodes(),this.updatePortalContainers())})}),Ct(this,"updateObservedNodes",()=>{var r;(r=this._mutationObserver)==null||r.disconnect(),this.state.active&&!this.state.paused&&(this.state.containers.map(s=>{var a;(a=this._mutationObserver)==null||a.observe(s,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}),this.portalContainers.forEach(s=>{this.observePortalContainer(s)}))}),Ct(this,"getInitialFocusNode",()=>{let r=this.getNodeForOption("initialFocus",{hasFallback:!0});if(r===!1)return!1;if(r===void 0||r&&!Nr(r)){const s=so(this.doc);if(s&&this.findContainerIndex(s)>=0)r=s;else{const a=this.state.tabbableGroups[0];r=a&&a.firstTabbableNode||this.getNodeForOption("fallbackFocus")}}else r===null&&(r=this.getNodeForOption("fallbackFocus"));if(!r)throw new Error("Your focus-trap needs to have at least one focusable element");return r.isConnected||(r=this.getNodeForOption("fallbackFocus")),r}),Ct(this,"tryFocus",r=>{if(r!==!1&&r!==so(this.doc)){if(!r||!r.focus){this.tryFocus(this.getInitialFocusNode());return}r.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=r,wD(r)&&r.select()}}),Ct(this,"deactivate",r=>{if(!this.state.active)return this;const s=j({onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus},r);clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),lb.deactivateTrap(this.trapStack,this),this.portalContainers.clear();const a=this.getOption(s,"onDeactivate"),u=this.getOption(s,"onPostDeactivate"),l=this.getOption(s,"checkCanReturnFocus"),d=this.getOption(s,"returnFocus","returnFocusOnDeactivate");a==null||a();const f=()=>{cb(()=>{if(d){const m=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(m)}u==null||u()})};if(d&&l){const m=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return l(m).then(f,f),this}return f(),this}),Ct(this,"pause",r=>{if(this.state.paused||!this.state.active)return this;const s=this.getOption(r,"onPause"),a=this.getOption(r,"onPostPause");return this.state.paused=!0,s==null||s(),this.removeListeners(),this.updateObservedNodes(),a==null||a(),this}),Ct(this,"unpause",r=>{if(!this.state.paused||!this.state.active)return this;const s=this.getOption(r,"onUnpause"),a=this.getOption(r,"onPostUnpause");return this.state.paused=!1,s==null||s(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),a==null||a(),this}),Ct(this,"updateContainerElements",r=>(this.state.containers=Array.isArray(r)?r.filter(Boolean):[r].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),Ct(this,"getReturnFocusNode",r=>{const s=this.getNodeForOption("setReturnFocus",{params:[r]});return s||(s===!1?!1:r)}),Ct(this,"getOption",(r,s,a)=>r&&r[s]!==void 0?r[s]:this.config[a||s]),Ct(this,"getNodeForOption",(r,{hasFallback:s=!1,params:a=[]}={})=>{let u=this.config[r];if(typeof u=="function"&&(u=u(...a)),u===!0&&(u=void 0),!u){if(u===void 0||u===!1)return u;throw new Error(`\`${r}\` was specified but was not a node, or did not return a node`)}let l=u;if(typeof u=="string"){try{l=this.doc.querySelector(u)}catch(d){throw new Error(`\`${r}\` appears to be an invalid selector; error="${d.message}"`)}if(!l&&!s)throw new Error(`\`${r}\` as selector refers to no known node`)}return l}),Ct(this,"findNextNavNode",r=>{const{event:s,isBackward:a=!1}=r,u=r.target||fr(s);this.updateTabbableNodes();let l=null;if(this.state.tabbableGroups.length>0){const d=this.findContainerIndex(u,s),f=d>=0?this.state.containerGroups[d]:void 0;if(d<0)a?l=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:l=this.state.tabbableGroups[0].firstTabbableNode;else if(a){let m=this.state.tabbableGroups.findIndex(({firstTabbableNode:p})=>u===p);if(m<0&&((f==null?void 0:f.container)===u||Nr(u)&&!us(u)&&!(f!=null&&f.nextTabbableNode(u,!1)))&&(m=d),m>=0){const p=m===0?this.state.tabbableGroups.length-1:m-1,b=this.state.tabbableGroups[p];l=La(u)>=0?b.lastTabbableNode:b.lastDomTabbableNode}else Ha(s)||(l=f==null?void 0:f.nextTabbableNode(u,!1))}else{let m=this.state.tabbableGroups.findIndex(({lastTabbableNode:p})=>u===p);if(m<0&&((f==null?void 0:f.container)===u||Nr(u)&&!us(u)&&!(f!=null&&f.nextTabbableNode(u)))&&(m=d),m>=0){const p=m===this.state.tabbableGroups.length-1?0:m+1,b=this.state.tabbableGroups[p];l=La(u)>=0?b.firstTabbableNode:b.firstDomTabbableNode}else Ha(s)||(l=f==null?void 0:f.nextTabbableNode(u))}}else l=this.getNodeForOption("fallbackFocus");return l}),this.trapStack=t.trapStack||yD;const n=j({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,followControlledElements:!0,isKeyForward(r){return Ha(r)&&!r.shiftKey},isKeyBackward(r){return Ha(r)&&r.shiftKey}},t);this.doc=n.document||Cr(Array.isArray(e)?e[0]:e),this.config=n,this.updateContainerElements(e),this.setupMutationObserver()}addPortalContainer(e){const t=e.parentElement;t&&!this.portalContainers.has(t)&&(this.portalContainers.add(t),this.state.active&&!this.state.paused&&this.observePortalContainer(t))}observePortalContainer(e){var t;(t=this._mutationObserver)==null||t.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}updatePortalContainers(){this.config.followControlledElements&&this.state.containers.forEach(e=>{U4(e).forEach(n=>{this.addPortalContainer(n)})})}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){const n=typeof(t==null?void 0:t.composedPath)=="function"?t.composedPath():void 0;return this.state.containerGroups.findIndex(({container:r,tabbableNodes:s})=>r.contains(e)||(n==null?void 0:n.includes(r))||s.find(a=>a===e)||this.isControlledElement(r,e))}isControlledElement(e,t){return this.config.followControlledElements?lT(e,t):!1}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{const t=ao(e,{getShadowRoot:this.config.getShadowRoot}),n=yT(e,{getShadowRoot:this.config.getShadowRoot}),r=t[0],s=t[t.length-1],a=r,u=s;let l=!1;for(let f=0;f<t.length;f++)if(La(t[f])>0){l=!0;break}function d(f,m=!0){const p=t.indexOf(f);if(p>=0)return t[p+(m?1:-1)];const b=n.indexOf(f);if(!(b<0)){if(m){for(let y=b+1;y<n.length;y++)if(us(n[y]))return n[y]}else for(let y=b-1;y>=0;y--)if(us(n[y]))return n[y]}}return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:l,firstTabbableNode:r,lastTabbableNode:s,firstDomTabbableNode:a,lastDomTabbableNode:u,nextTabbableNode:d}}),this.state.tabbableGroups=this.state.containerGroups.filter(e=>e.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(e=>e.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return lb.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?cb(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(Zt(this.doc,"focusin",this.handleFocus,!0),Zt(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),Zt(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),Zt(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),Zt(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),Zt(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(e=>e()),this.listenerCleanups=[],this}activate(e){if(this.state.active)return this;const t=this.getOption(e,"onActivate"),n=this.getOption(e,"onPostActivate"),r=this.getOption(e,"checkCanFocusTrap");r||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=so(this.doc),t==null||t();const s=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),n==null||n()};return r?(r(this.state.containers.concat()).then(s,s),this):(s(),this)}},Ha=e=>e.key==="Tab",ja=(e,...t)=>typeof e=="function"?e(...t):e,bD=e=>!e.isComposing&&e.key==="Escape",cb=e=>setTimeout(e,0),wD=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function db(e,t={}){let n;const r=qt(()=>{const s=typeof e=="function"?e():e;if(s){n=new TD(s,ce(j({escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:s},t),{document:Cr(s)}));try{n.activate()}catch(a){}}});return function(){n==null||n.deactivate(),r()}}var qh="data-scroll-lock";function _D(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function fb(e){const t=oo(e),n=t==null?void 0:t.scrollbarGutter;return n==="stable"||(n==null?void 0:n.startsWith("stable "))===!0}function hb(e){var y;const t=e!=null?e:document,n=(y=t.defaultView)!=null?y:window,{documentElement:r,body:s}=t;if(s.hasAttribute(qh))return;const u=fb(r)||fb(s),l=n.innerWidth-r.clientWidth;s.setAttribute(qh,"");const d=()=>yL(r,"--scrollbar-width",`${l}px`),f=_D(r),m=()=>{const _={overflow:"hidden"};return!u&&l>0&&(_[f]=`${l}px`),Ml(s,_)},p=()=>{var G,D;const{scrollX:_,scrollY:x,visualViewport:A}=n,S=(G=A==null?void 0:A.offsetLeft)!=null?G:0,C=(D=A==null?void 0:A.offsetTop)!=null?D:0,O={position:"fixed",overflow:"hidden",top:`${-(x-Math.floor(C))}px`,left:`${-(_-Math.floor(S))}px`,right:"0"};!u&&l>0&&(O[f]=`${l}px`);const z=Ml(s,O);return()=>{z==null||z(),n.scrollTo({left:_,top:x,behavior:"instant"})}},b=[d(),Rl()?p():m()];return()=>{b.forEach(_=>_==null?void 0:_()),s.removeAttribute(qh)}}var xD=cs("popover").parts("arrow","arrowTip","anchor","trigger","indicator","positioner","content","title","description","closeTrigger"),Lr=xD.build(),pb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.anchor)!=null?n:`popover:${e.id}:anchor`},mb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`popover:${e.id}:trigger`},Yh=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`popover:${e.id}:content`},gb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`popover:${e.id}:popper`},SD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.arrow)!=null?n:`popover:${e.id}:arrow`},Wh=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`popover:${e.id}:title`},Gh=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`popover:${e.id}:desc`},vD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`popover:${e.id}:close`},Eb=e=>e.getById(pb(e)),yo=e=>e.getById(mb(e)),To=e=>e.getById(Yh(e)),yb=e=>e.getById(gb(e)),AD=e=>e.getById(Wh(e)),kD=e=>e.getById(Gh(e));function CD(e,t){const{state:n,context:r,send:s,computed:a,prop:u,scope:l}=e,d=n.matches("open"),f=r.get("currentPlacement"),m=a("currentPortalled"),p=r.get("renderedElements"),b=X5(ce(j({},u("positioning")),{placement:f}));return{portalled:m,open:d,setOpen(y){n.matches("open")!==y&&s({type:y?"OPEN":"CLOSE"})},reposition(y={}){s({type:"POSITIONING.SET",options:y})},getArrowProps(){return t.element(ce(j({id:SD(l)},Lr.arrow.attrs),{dir:u("dir"),style:b.arrow}))},getArrowTipProps(){return t.element(ce(j({},Lr.arrowTip.attrs),{dir:u("dir"),style:b.arrowTip}))},getAnchorProps(){return t.element(ce(j({},Lr.anchor.attrs),{dir:u("dir"),id:pb(l)}))},getTriggerProps(){return t.button(ce(j({},Lr.trigger.attrs),{dir:u("dir"),type:"button","data-placement":f,id:mb(l),"aria-haspopup":"dialog","aria-expanded":d,"data-state":d?"open":"closed","aria-controls":Yh(l),onPointerDown(y){fT(y)&&X4()&&y.currentTarget.focus()},onClick(y){y.defaultPrevented||s({type:"TOGGLE"})},onBlur(y){s({type:"TRIGGER_BLUR",target:y.relatedTarget})}}))},getIndicatorProps(){return t.element(ce(j({},Lr.indicator.attrs),{dir:u("dir"),"data-state":d?"open":"closed"}))},getPositionerProps(){return t.element(ce(j({id:gb(l)},Lr.positioner.attrs),{dir:u("dir"),style:b.floating}))},getContentProps(){return t.element(ce(j({},Lr.content.attrs),{dir:u("dir"),id:Yh(l),tabIndex:-1,role:"dialog","aria-modal":oT(u("modal")),hidden:!d,"data-state":d?"open":"closed","data-expanded":no(d),"aria-labelledby":p.title?Wh(l):void 0,"aria-describedby":p.description?Gh(l):void 0,"data-placement":f}))},getTitleProps(){return t.element(ce(j({},Lr.title.attrs),{id:Wh(l),dir:u("dir")}))},getDescriptionProps(){return t.element(ce(j({},Lr.description.attrs),{id:Gh(l),dir:u("dir")}))},getCloseTriggerProps(){return t.button(ce(j({},Lr.closeTrigger.attrs),{dir:u("dir"),id:vD(l),type:"button","aria-label":"close",onClick(y){y.defaultPrevented||(y.stopPropagation(),s({type:"CLOSE"}))}}))}}}var ND={props({props:e}){return ce(j({closeOnInteractOutside:!0,closeOnEscape:!0,autoFocus:!0,modal:!1,portalled:!0},e),{positioning:j({placement:"bottom"},e.positioning)})},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{currentPlacement:e(()=>({defaultValue:void 0})),renderedElements:e(()=>({defaultValue:{title:!0,description:!0}}))}},computed:{currentPortalled:({prop:e})=>!!e("modal")||!!e("portalled")},watch({track:e,prop:t,action:n}){e([()=>t("open")],()=>{n(["toggleVisibility"])})},entry:["checkRenderedElements"],states:{closed:{on:{"CONTROLLED.OPEN":{target:"open",actions:["setInitialFocus"]},TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus"]}]}},open:{effects:["trapFocus","preventScroll","hideContentBelow","trackPositioning","trackDismissableElement","proxyTabFocus"],on:{"CONTROLLED.CLOSE":{target:"closed",actions:["setFinalFocus"]},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose","setFinalFocus"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"POSITIONING.SET":{actions:["reposition"]}}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackPositioning({context:e,prop:t,scope:n}){var a;e.set("currentPlacement",t("positioning").placement);const r=(a=Eb(n))!=null?a:yo(n);return QT(r,()=>yb(n),ce(j({},t("positioning")),{defer:!0,onComplete(u){e.set("currentPlacement",u.placement)}}))},trackDismissableElement({send:e,prop:t,scope:n}){const r=()=>To(n);let s=!0;return ub(r,{type:"popover",pointerBlocking:t("modal"),exclude:yo(n),defer:!0,onEscapeKeyDown(a){var u;(u=t("onEscapeKeyDown"))==null||u(a),!t("closeOnEscape")&&a.preventDefault()},onInteractOutside(a){var u;(u=t("onInteractOutside"))==null||u(a),!a.defaultPrevented&&(s=!(a.detail.focusable||a.detail.contextmenu),t("closeOnInteractOutside")||a.preventDefault())},onPointerDownOutside:t("onPointerDownOutside"),onFocusOutside:t("onFocusOutside"),persistentElements:t("persistentElements"),onRequestDismiss:t("onRequestDismiss"),onDismiss(){e({type:"CLOSE",src:"interact-outside",restoreFocus:s})}})},proxyTabFocus({prop:e,scope:t}){return e("modal")||!e("portalled")?void 0:gL(()=>To(t),{triggerElement:yo(t),defer:!0,getShadowRoot:!0,onFocus(r){r.focus({preventScroll:!0})}})},hideContentBelow({prop:e,scope:t}){return e("modal")?ZT(()=>[To(t),yo(t)],{defer:!0}):void 0},preventScroll({prop:e,scope:t}){if(e("modal"))return hb(t.getDoc())},trapFocus({prop:e,scope:t}){return e("modal")?db(()=>To(t),{initialFocus:()=>TT({root:To(t),getInitialEl:e("initialFocusEl"),enabled:e("autoFocus")}),getShadowRoot:!0}):void 0}},actions:{reposition({event:e,prop:t,scope:n,context:r}){var u;const s=(u=Eb(n))!=null?u:yo(n);QT(s,()=>yb(n),ce(j(j({},t("positioning")),e.options),{defer:!0,listeners:!1,onComplete(l){r.set("currentPlacement",l.placement)}}))},checkRenderedElements({context:e,scope:t}){qt(()=>{Object.assign(e.get("renderedElements"),{title:!!AD(t),description:!!kD(t)})})},setInitialFocus({prop:e,scope:t}){e("modal")||qt(()=>{const n=TT({root:To(t),getInitialEl:e("initialFocusEl"),enabled:e("autoFocus")});n==null||n.focus({preventScroll:!0})})},setFinalFocus({event:e,scope:t}){var r,s;const n=(s=e.restoreFocus)!=null?s:(r=e.previousEvent)==null?void 0:r.restoreFocus;n!=null&&!n||qt(()=>{const a=yo(t);a==null||a.focus({preventScroll:!0})})},invokeOnOpen({prop:e,flush:t}){t(()=>{var n;(n=e("onOpenChange"))==null||n({open:!0})})},invokeOnClose({prop:e,flush:t}){t(()=>{var n;(n=e("onOpenChange"))==null||n({open:!1})})},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}};co()(["autoFocus","closeOnEscape","closeOnInteractOutside","dir","getRootNode","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","portalled","positioning"]);const[jU,Ql]=ls({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}}),[zU,Xh]=ls({name:"LocaleContext",hookName:"useLocaleContext",providerName:"<LocaleProvider />",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}}),OD=e=>{const t=R.useId(),{getRootNode:n}=Ql(),{dir:r}=Xh(),s=j({id:t,dir:r,getRootNode:n},e),a=Bl(ND,s);return CD(a,Nh)},ID=e=>{const[t,u]=CT(e),l=u,{children:n}=l,r=Sn(l,["children"]),s=OD(r),a=Ph(Yt({present:s.open},t));return w.jsx(IL,{value:s,children:w.jsx(vT,{value:a,children:n})})},Tb=R.forwardRef((e,t)=>{const n=Ih(),r=Da(),s=Yt(ce(j({},n.getTriggerProps()),{"aria-controls":r.unmounted?void 0:n.getTriggerProps()["aria-controls"]}),e);return w.jsx(hn.button,ce(j({},s),{ref:t}))});Tb.displayName="PopoverTrigger";function PD(e){return ht({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M11.854 3.646a.5.5 0 0 1 0 .708L8.207 8l3.647 3.646a.5.5 0 0 1-.708.708l-4-4a.5.5 0 0 1 0-.708l4-4a.5.5 0 0 1 .708 0M4.5 1a.5.5 0 0 0-.5.5v13a.5.5 0 0 0 1 0v-13a.5.5 0 0 0-.5-.5"},child:[]}]})(e)}function RD(e){return ht({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.146 3.646a.5.5 0 0 0 0 .708L7.793 8l-3.647 3.646a.5.5 0 0 0 .708.708l4-4a.5.5 0 0 0 0-.708l-4-4a.5.5 0 0 0-.708 0M11.5 1a.5.5 0 0 1 .5.5v13a.5.5 0 0 1-1 0v-13a.5.5 0 0 1 .5-.5"},child:[]}]})(e)}function bb(e){return ht({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0"},child:[]}]})(e)}function wb(e){return ht({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708"},child:[]}]})(e)}function LD(e){return ht({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8 2a.5.5 0 0 1 .5.5v5h5a.5.5 0 0 1 0 1h-5v5a.5.5 0 0 1-1 0v-5h-5a.5.5 0 0 1 0-1h5v-5A.5.5 0 0 1 8 2"},child:[]}]})(e)}function DD(e){return ht({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576zm6.787-8.201L1.591 6.602l4.339 2.76z"},child:[]}]})(e)}function Kh(e){return ht({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M7.657 6.247c.11-.33.576-.33.686 0l.645 1.937a2.89 2.89 0 0 0 1.829 1.828l1.936.645c.33.11.33.576 0 .686l-1.937.645a2.89 2.89 0 0 0-1.828 1.829l-.645 1.936a.361.361 0 0 1-.686 0l-.645-1.937a2.89 2.89 0 0 0-1.828-1.828l-1.937-.645a.361.361 0 0 1 0-.686l1.937-.645a2.89 2.89 0 0 0 1.828-1.828zM3.794 1.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387A1.73 1.73 0 0 0 4.593 5.69l-.387 1.162a.217.217 0 0 1-.412 0L3.407 5.69A1.73 1.73 0 0 0 2.31 4.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387A1.73 1.73 0 0 0 3.407 2.31zM10.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.16 1.16 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.16 1.16 0 0 0-.732-.732L9.1 2.137a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732z"},child:[]}]})(e)}function _b(e){return ht({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"},child:[]}]})(e)}const MD=({className:e,componentType:t,children:n})=>{const[r,s]=R.useState(!1),{globalClassName:a}=ft(),u=f=>{s(f.open)},l=R.useCallback(()=>{s(!1)},[]),d=R.useMemo(()=>({closeMenu:l}),[l]);return w.jsxs(ID,{open:r,onOpenChange:u,positioning:{placement:"bottom-end"},children:[w.jsx(Tb,{"aria-label":`Overflow menu for ${t}`,className:B(`${N}-overflow-menu-button-trigger`,`${N}-icon-button`,a,e,`cim-${t}-component`),children:w.jsx(_b,{})}),w.jsx(kT,{children:w.jsx(AT,{className:B(`${N}-overflow-menu-list`,a,`cim-${t}-component`),children:w.jsx(Jy.Provider,{value:d,children:n})})})]})};function xb(e){return ht({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M15 4.00008H13V11.0001H20V9.00008H16.4142L20.7071 4.70718L19.2929 3.29297L15 7.58586V4.00008ZM4.00008 15H7.58586L3.29297 19.2929L4.70718 20.7071L9.00008 16.4142V20H11.0001V13H4.00008V15Z"},child:[]}]})(e)}function Sb(e){return ht({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17.5858 5H14V3H21V10H19V6.41421L14.7071 10.7071L13.2929 9.29289L17.5858 5ZM3 14H5V17.5858L9.29289 13.2929L10.7071 14.7071L6.41421 19H10V21H3V14Z"},child:[]}]})(e)}const[FD,hs]=ls({name:"CarouselContext",hookName:"useCarouselContext",providerName:"<CarouselProvider />"}),Qh=R.forwardRef((e,t)=>{const n=hs(),r=Yt(n.getControlProps(),e);return w.jsx(hn.div,ce(j(j({},r),e),{ref:t}))});Qh.displayName="CarouselControl";const Jh=R.forwardRef((e,t)=>{const[n,r]=Ma()(e,["readOnly","index"]),s=hs(),a=Yt(s.getIndicatorProps(n),r);return w.jsx(hn.button,ce(j({},a),{ref:t}))});Jh.displayName="CarouselIndicator";const Zh=R.forwardRef((e,t)=>{const n=hs(),r=Yt(n.getIndicatorGroupProps(),e);return w.jsx(hn.div,ce(j({},r),{ref:t}))});Zh.displayName="CarouselIndicatorGroup";const ep=R.forwardRef((e,t)=>{const[n,r]=Ma()(e,["index","snapAlign"]),s=hs(),a=Yt(s.getItemProps(n),r);return w.jsx(hn.div,ce(j({},a),{ref:t}))});ep.displayName="CarouselItem";const tp=R.forwardRef((e,t)=>{const n=hs(),r=Yt(n.getItemGroupProps(),e);return w.jsx(hn.div,ce(j({},r),{ref:t}))});tp.displayName="CarouselItemGroup";const np=R.forwardRef((e,t)=>{const n=hs(),r=Yt(n.getNextTriggerProps(),e);return w.jsx(hn.button,ce(j({},r),{ref:t}))});np.displayName="CarouselNextTrigger";const rp=R.forwardRef((e,t)=>{const n=hs(),r=Yt(n.getPrevTriggerProps(),e);return w.jsx(hn.button,ce(j({},r),{ref:t}))});rp.displayName="CarouselPrevTrigger";function BD(e){const t=oo(e),n=e.getBoundingClientRect();let r=t.getPropertyValue("scroll-padding-left").replace("auto","0px"),s=t.getPropertyValue("scroll-padding-top").replace("auto","0px"),a=t.getPropertyValue("scroll-padding-right").replace("auto","0px"),u=t.getPropertyValue("scroll-padding-bottom").replace("auto","0px");function l(b,y){let _=parseFloat(b);return/%/.test(b)&&(_/=100,_*=y),Number.isNaN(_)?0:_}let d=l(r,n.width),f=l(s,n.height),m=l(a,n.width),p=l(u,n.height);return{x:{before:d,after:m},y:{before:f,after:p}}}function UD(e,t,n="both"){return n==="x"&&e.right>=t.left&&e.left<=t.right||n==="y"&&e.bottom>=t.top&&e.top<=t.bottom||n==="both"&&e.right>=t.left&&e.left<=t.right&&e.bottom>=t.top&&e.top<=t.bottom}function vb(e){let t=[];for(const n of e.children)t=t.concat(n,vb(n));return t}function Ab(e,t=!1){const n=e.getBoundingClientRect(),r={x:{start:[],center:[],end:[]},y:{start:[],center:[],end:[]}},s=t?vb(e):e.children;for(const a of["x","y"]){const u=a==="x"?"y":"x",l=a==="x"?"left":"top",d=a==="x"?"width":"height",f=a==="x"?"scrollLeft":"scrollTop";for(const m of s){const p=m.getBoundingClientRect();if(!UD(n,p,u))continue;const b=oo(m);let[y,_]=b.getPropertyValue("scroll-snap-align").split(" ");typeof _=="undefined"&&(_=y);const x=a==="x"?_:y,A=p[l]-n[l]+e[f];switch(x){case"none":break;case"start":r[a].start.push({node:m,position:A});break;case"center":r[a].center.push({node:m,position:A+p[d]/2});break;case"end":r[a].end.push({node:m,position:A+p[d]});break}}}return r}function kb(e){const t=e.getBoundingClientRect(),n=BD(e),r=Ab(e),s={x:e.scrollWidth-e.offsetWidth,y:e.scrollHeight-e.offsetHeight};return{x:Cb([...r.x.start.map(a=>a.position-n.x.before),...r.x.center.map(a=>a.position-t.width/2),...r.x.end.map(a=>a.position-t.width+n.x.after)].map(Nb(0,s.x))),y:Cb([...r.y.start.map(a=>a.position-n.y.before),...r.y.center.map(a=>a.position-t.height/2),...r.y.end.map(a=>a.position-t.height+n.y.after)].map(Nb(0,s.y)))}}function HD(e,t,n){const r=Ab(e),s=[...r[t].start,...r[t].center,...r[t].end];for(const a of s)if(n(a.node))return a.position}var Cb=e=>[...new Set(e)],Nb=(e,t)=>n=>Math.max(e,Math.min(t,n)),jD=cs("carousel").parts("root","itemGroup","item","control","nextTrigger","prevTrigger","indicatorGroup","indicator","autoplayTrigger"),Xr=jD.build(),zD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.root)!=null?n:`carousel:${e.id}`},$D=(e,t)=>{var n,r,s;return(s=(r=(n=e.ids)==null?void 0:n.item)==null?void 0:r.call(n,t))!=null?s:`carousel:${e.id}:item:${t}`},Jl=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.itemGroup)!=null?n:`carousel:${e.id}:item-group`},VD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.nextTrigger)!=null?n:`carousel:${e.id}:next-trigger`},qD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.prevTrigger)!=null?n:`carousel:${e.id}:prev-trigger`},YD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.indicatorGroup)!=null?n:`carousel:${e.id}:indicator-group`},Ob=(e,t)=>{var n,r,s;return(s=(r=(n=e.ids)==null?void 0:n.indicator)==null?void 0:r.call(n,t))!=null?s:`carousel:${e.id}:indicator:${t}`},Pn=e=>e.getById(Jl(e)),Ib=e=>EL(Pn(e),"[data-part=item]"),WD=(e,t)=>e.getById(Ob(e,t)),Pb=e=>{const t=Pn(e);if(!t)return;const n=ao(t);t.setAttribute("tabindex",n.length>0?"-1":"0")};function GD(e,t){const{state:n,context:r,computed:s,send:a,scope:u,prop:l}=e,d=n.matches("autoplay"),f=n.matches("dragging"),m=s("canScrollNext"),p=s("canScrollPrev"),b=s("isHorizontal"),y=Array.from(r.get("pageSnapPoints")),_=r.get("page"),x=l("slidesPerPage"),A=l("padding"),S=l("translations");return{isPlaying:d,isDragging:f,page:_,pageSnapPoints:y,canScrollNext:m,canScrollPrev:p,getProgress(){return _/y.length},scrollToIndex(C,O){a({type:"INDEX.SET",index:C,instant:O})},scrollTo(C,O){a({type:"PAGE.SET",index:C,instant:O})},scrollNext(C){a({type:"PAGE.NEXT",instant:C})},scrollPrev(C){a({type:"PAGE.PREV",instant:C})},play(){a({type:"AUTOPLAY.START"})},pause(){a({type:"AUTOPLAY.PAUSE"})},isInView(C){return Array.from(r.get("slidesInView")).includes(C)},refresh(){a({type:"SNAP.REFRESH"})},getRootProps(){return t.element(ce(j({},Xr.root.attrs),{id:zD(u),role:"region","aria-roledescription":"carousel","data-orientation":l("orientation"),dir:l("dir"),style:{"--slides-per-page":x,"--slide-spacing":l("spacing"),"--slide-item-size":"calc(100% / var(--slides-per-page) - var(--slide-spacing) * (var(--slides-per-page) - 1) / var(--slides-per-page))"}}))},getItemGroupProps(){return t.element(ce(j({},Xr.itemGroup.attrs),{id:Jl(u),"data-orientation":l("orientation"),"data-dragging":no(f),dir:l("dir"),"aria-live":d?"off":"polite",onFocus(C){ro(C.currentTarget,fr(C))&&a({type:"VIEWPORT.FOCUS"})},onBlur(C){ro(C.currentTarget,C.relatedTarget)||a({type:"VIEWPORT.BLUR"})},onMouseDown(C){if(C.defaultPrevented||!l("allowMouseDrag")||!fT(C))return;const O=fr(C);Nr(O)&&O!==C.currentTarget||(C.preventDefault(),a({type:"DRAGGING.START"}))},onWheel:E4(C=>{const O=l("orientation")==="horizontal"?"deltaX":"deltaY";C[O]<0&&!s("canScrollPrev")||C[O]>0&&!s("canScrollNext")||a({type:"USER.SCROLL"})},150),onTouchStart(){a({type:"USER.SCROLL"})},style:{display:"grid",gap:"var(--slide-spacing)",scrollSnapType:[b?"x":"y",l("snapType")].join(" "),gridAutoFlow:b?"column":"row",scrollbarWidth:"none",overscrollBehaviorX:"contain",[b?"gridAutoColumns":"gridAutoRows"]:"var(--slide-item-size)",[b?"scrollPaddingInline":"scrollPaddingBlock"]:A,[b?"paddingInline":"paddingBlock"]:A,[b?"overflowX":"overflowY"]:"auto"}}))},getItemProps(C){const O=r.get("slidesInView").includes(C.index);return t.element(ce(j({},Xr.item.attrs),{id:$D(u,C.index),dir:l("dir"),role:"group","data-index":C.index,"data-inview":no(O),"aria-roledescription":"slide","data-orientation":l("orientation"),"aria-label":S.item(C.index,l("slideCount")),"aria-hidden":oT(!O),style:{scrollSnapAlign:(()=>{var J;const z=(J=C.snapAlign)!=null?J:"start",G=l("slidesPerMove"),D=G==="auto"?Math.floor(l("slidesPerPage")):G;return(C.index+D)%D===0?z:void 0})()}}))},getControlProps(){return t.element(ce(j({},Xr.control.attrs),{"data-orientation":l("orientation")}))},getPrevTriggerProps(){return t.button(ce(j({},Xr.prevTrigger.attrs),{id:qD(u),type:"button",disabled:!p,dir:l("dir"),"aria-label":S.prevTrigger,"data-orientation":l("orientation"),"aria-controls":Jl(u),onClick(C){C.defaultPrevented||a({type:"PAGE.PREV",src:"trigger"})}}))},getNextTriggerProps(){return t.button(ce(j({},Xr.nextTrigger.attrs),{dir:l("dir"),id:VD(u),type:"button","aria-label":S.nextTrigger,"data-orientation":l("orientation"),"aria-controls":Jl(u),disabled:!m,onClick(C){C.defaultPrevented||a({type:"PAGE.NEXT",src:"trigger"})}}))},getIndicatorGroupProps(){return t.element(ce(j({},Xr.indicatorGroup.attrs),{dir:l("dir"),id:YD(u),"data-orientation":l("orientation"),onKeyDown(C){if(C.defaultPrevented)return;const O="indicator",z={ArrowDown(V){b||(a({type:"PAGE.NEXT",src:O}),V.preventDefault())},ArrowUp(V){b||(a({type:"PAGE.PREV",src:O}),V.preventDefault())},ArrowRight(V){b&&(a({type:"PAGE.NEXT",src:O}),V.preventDefault())},ArrowLeft(V){b&&(a({type:"PAGE.PREV",src:O}),V.preventDefault())},Home(V){a({type:"PAGE.SET",index:0,src:O}),V.preventDefault()},End(V){a({type:"PAGE.SET",index:y.length-1,src:O}),V.preventDefault()}},G=eL(C,{dir:l("dir"),orientation:l("orientation")}),D=z[G];D==null||D(C)}}))},getIndicatorProps(C){return t.button(ce(j({},Xr.indicator.attrs),{dir:l("dir"),id:Ob(u,C.index),type:"button","data-orientation":l("orientation"),"data-index":C.index,"data-readonly":no(C.readOnly),"data-current":no(C.index===_),"aria-label":S.indicator(C.index),onClick(O){O.defaultPrevented||C.readOnly||a({type:"PAGE.SET",index:C.index,src:"indicator"})}}))},getAutoplayTriggerProps(){return t.button(ce(j({},Xr.autoplayTrigger.attrs),{type:"button","data-orientation":l("orientation"),"data-pressed":no(d),"aria-label":d?S.autoplayStop:S.autoplayStart,onClick(C){C.defaultPrevented||a({type:d?"AUTOPLAY.PAUSE":"AUTOPLAY.START"})}}))}}}var XD={props({props:e}){return x4(e,["slideCount"],"carousel"),ce(j({dir:"ltr",defaultPage:0,orientation:"horizontal",snapType:"mandatory",loop:!!e.autoplay,slidesPerPage:1,slidesPerMove:"auto",spacing:"0px",autoplay:!1,allowMouseDrag:!1,inViewThreshold:.6},e),{translations:j({nextTrigger:"Next slide",prevTrigger:"Previous slide",indicator:t=>`Go to slide ${t+1}`,item:(t,n)=>`${t+1} of ${n}`,autoplayStart:"Start slide rotation",autoplayStop:"Stop slide rotation"},e.translations)})},refs(){return{timeoutRef:void 0}},initialState({prop:e}){return e("autoplay")?"autoplay":"idle"},context({prop:e,bindable:t,getContext:n}){return{page:t(()=>({defaultValue:e("defaultPage"),value:e("page"),onChange(r){var u;const a=n().get("pageSnapPoints");(u=e("onPageChange"))==null||u({page:r,pageSnapPoint:a[r]})}})),pageSnapPoints:t(()=>({defaultValue:KD(e("slideCount"),e("slidesPerMove"),e("slidesPerPage"))})),slidesInView:t(()=>({defaultValue:[]}))}},computed:{isRtl:({prop:e})=>e("dir")==="rtl",isHorizontal:({prop:e})=>e("orientation")==="horizontal",canScrollNext:({prop:e,context:t})=>e("loop")||t.get("page")<t.get("pageSnapPoints").length-1,canScrollPrev:({prop:e,context:t})=>e("loop")||t.get("page")>0,autoplayInterval:({prop:e})=>{const t=e("autoplay");return o4(t)?t.delay:4e3}},watch({track:e,action:t,context:n,prop:r,send:s}){e([()=>r("slidesPerPage"),()=>r("slidesPerMove")],()=>{t(["setSnapPoints"])}),e([()=>n.get("page")],()=>{t(["scrollToPage","focusIndicatorEl"])}),e([()=>r("orientation")],()=>{t(["setSnapPoints","scrollToPage"])}),e([()=>r("slideCount")],()=>{s({type:"SNAP.REFRESH",src:"slide.count"})}),e([()=>!!r("autoplay")],()=>{s({type:r("autoplay")?"AUTOPLAY.START":"AUTOPLAY.PAUSE",src:"autoplay.prop.change"})})},on:{"PAGE.NEXT":{target:"idle",actions:["clearScrollEndTimer","setNextPage"]},"PAGE.PREV":{target:"idle",actions:["clearScrollEndTimer","setPrevPage"]},"PAGE.SET":{target:"idle",actions:["clearScrollEndTimer","setPage"]},"INDEX.SET":{target:"idle",actions:["clearScrollEndTimer","setMatchingPage"]},"SNAP.REFRESH":{actions:["setSnapPoints","clampPage"]},"PAGE.SCROLL":{actions:["scrollToPage"]}},effects:["trackSlideMutation","trackSlideIntersections","trackSlideResize"],entry:["setSnapPoints","setPage"],exit:["clearScrollEndTimer"],states:{idle:{on:{"DRAGGING.START":{target:"dragging",actions:["invokeDragStart"]},"AUTOPLAY.START":{target:"autoplay",actions:["invokeAutoplayStart"]},"USER.SCROLL":{target:"userScroll"},"VIEWPORT.FOCUS":{target:"focus"}}},focus:{effects:["trackKeyboardScroll"],on:{"VIEWPORT.BLUR":{target:"idle"},"PAGE.NEXT":{actions:["clearScrollEndTimer","setNextPage"]},"PAGE.PREV":{actions:["clearScrollEndTimer","setPrevPage"]},"PAGE.SET":{actions:["clearScrollEndTimer","setPage"]},"INDEX.SET":{actions:["clearScrollEndTimer","setMatchingPage"]},"USER.SCROLL":{target:"userScroll"}}},dragging:{effects:["trackPointerMove"],entry:["disableScrollSnap"],on:{DRAGGING:{actions:["scrollSlides","invokeDragging"]},"DRAGGING.END":{target:"idle",actions:["endDragging","invokeDraggingEnd"]}}},userScroll:{effects:["trackScroll"],on:{"SCROLL.END":[{guard:"isFocused",target:"focus",actions:["setClosestPage"]},{target:"idle",actions:["setClosestPage"]}]}},autoplay:{effects:["trackDocumentVisibility","trackScroll","autoUpdateSlide"],exit:["invokeAutoplayEnd"],on:{"AUTOPLAY.TICK":{actions:["setNextPage","invokeAutoplay"]},"DRAGGING.START":{target:"dragging",actions:["invokeDragStart"]},"AUTOPLAY.PAUSE":{target:"idle"}}}},implementations:{guards:{isFocused:({scope:e})=>e.isActiveElement(Pn(e))},effects:{autoUpdateSlide({computed:e,send:t}){const n=setInterval(()=>{t({type:e("canScrollNext")?"AUTOPLAY.TICK":"AUTOPLAY.PAUSE",src:"autoplay.interval"})},e("autoplayInterval"));return()=>clearInterval(n)},trackSlideMutation({scope:e,send:t}){const n=Pn(e);if(!n)return;const r=e.getWin(),s=new r.MutationObserver(()=>{t({type:"SNAP.REFRESH",src:"slide.mutation"}),Pb(e)});return Pb(e),s.observe(n,{childList:!0,subtree:!0}),()=>s.disconnect()},trackSlideResize({scope:e,send:t}){if(!Pn(e))return;const r=e.getWin(),s=()=>{t({type:"SNAP.REFRESH",src:"slide.resize"})};qt(()=>{s(),qt(()=>{t({type:"PAGE.SCROLL",instant:!0})})});const a=new r.ResizeObserver(s);return Ib(e).forEach(u=>a.observe(u)),()=>a.disconnect()},trackSlideIntersections({scope:e,prop:t,context:n}){const r=Pn(e),s=e.getWin(),a=new s.IntersectionObserver(u=>{const l=u.reduce((d,f)=>{var b;const m=f.target,p=Number((b=m.dataset.index)!=null?b:"-1");return p==null||Number.isNaN(p)||p===-1?d:f.isIntersecting?t4(d,p):n4(d,p)},n.get("slidesInView"));n.set("slidesInView",r4(l))},{root:r,threshold:t("inViewThreshold")});return Ib(e).forEach(u=>a.observe(u)),()=>a.disconnect()},trackScroll({send:e,refs:t,scope:n}){const r=Pn(n);return r?Zt(r,"scroll",()=>{clearTimeout(t.get("timeoutRef")),t.set("timeoutRef",void 0),t.set("timeoutRef",setTimeout(()=>{e({type:"SCROLL.END"})},150))},{passive:!0}):void 0},trackDocumentVisibility({scope:e,send:t}){const n=e.getDoc();return Zt(n,"visibilitychange",()=>{n.visibilityState!=="visible"&&t({type:"AUTOPLAY.PAUSE",src:"doc.hidden"})})},trackPointerMove({scope:e,send:t}){const n=e.getDoc();return pL(n,{onPointerMove({event:r}){t({type:"DRAGGING",left:-r.movementX,top:-r.movementY})},onPointerUp(){t({type:"DRAGGING.END"})}})},trackKeyboardScroll({scope:e,send:t,context:n}){const r=e.getWin();return Zt(r,"keydown",a=>{switch(a.key){case"ArrowRight":a.preventDefault(),t({type:"PAGE.NEXT"});break;case"ArrowLeft":a.preventDefault(),t({type:"PAGE.PREV"});break;case"Home":a.preventDefault(),t({type:"PAGE.SET",index:0});break;case"End":a.preventDefault(),t({type:"PAGE.SET",index:n.get("pageSnapPoints").length-1})}},{capture:!0})}},actions:{clearScrollEndTimer({refs:e}){e.get("timeoutRef")!=null&&(clearTimeout(e.get("timeoutRef")),e.set("timeoutRef",void 0))},scrollToPage({context:e,event:t,scope:n,computed:r,flush:s}){var f;const a=t.instant?"instant":"smooth",u=iT((f=t.index)!=null?f:e.get("page"),0,e.get("pageSnapPoints").length-1),l=Pn(n);if(!l)return;const d=r("isHorizontal")?"left":"top";s(()=>{l.scrollTo({[d]:e.get("pageSnapPoints")[u],behavior:a})})},setClosestPage({context:e,scope:t,computed:n}){const r=Pn(t);if(!r)return;const s=n("isHorizontal")?r.scrollLeft:r.scrollTop,a=e.get("pageSnapPoints").findIndex(u=>Math.abs(u-s)<1);a!==-1&&e.set("page",a)},setNextPage({context:e,prop:t,state:n}){const r=n.matches("autoplay")||t("loop"),s=tT(e.get("pageSnapPoints"),e.get("page"),{loop:r});e.set("page",s)},setPrevPage({context:e,prop:t,state:n}){const r=n.matches("autoplay")||t("loop"),s=i4(e.get("pageSnapPoints"),e.get("page"),{loop:r});e.set("page",s)},setMatchingPage({context:e,event:t,computed:n,scope:r}){const s=Pn(r);if(!s)return;const a=HD(s,n("isHorizontal")?"x":"y",l=>l.dataset.index===t.index.toString());if(a==null)return;const u=e.get("pageSnapPoints").findIndex(l=>Math.abs(l-a)<1);e.set("page",u)},setPage({context:e,event:t}){var r;const n=(r=t.index)!=null?r:e.get("page");e.set("page",n)},clampPage({context:e}){const t=iT(e.get("page"),0,e.get("pageSnapPoints").length-1);e.set("page",t)},setSnapPoints({context:e,computed:t,scope:n}){const r=Pn(n);if(!r)return;const s=kb(r);e.set("pageSnapPoints",t("isHorizontal")?s.x:s.y)},disableScrollSnap({scope:e}){const t=Pn(e);if(!t)return;const n=getComputedStyle(t);t.dataset.scrollSnapType=n.getPropertyValue("scroll-snap-type"),t.style.setProperty("scroll-snap-type","none")},scrollSlides({scope:e,event:t}){const n=Pn(e);n==null||n.scrollBy({left:t.left,top:t.top,behavior:"instant"})},endDragging({scope:e,context:t,computed:n}){const r=Pn(e);if(!r)return;const s=r.scrollLeft,a=r.scrollTop,u=kb(r),l=u.x.reduce((f,m)=>Math.abs(m-s)<Math.abs(f-s)?m:f,u.x[0]),d=u.y.reduce((f,m)=>Math.abs(m-a)<Math.abs(f-a)?m:f,u.y[0]);qt(()=>{r.scrollTo({left:l,top:d,behavior:"smooth"});const f=n("isHorizontal")?l:d;t.set("page",t.get("pageSnapPoints").indexOf(f));const m=r.dataset.scrollSnapType;m&&(r.style.setProperty("scroll-snap-type",m),delete r.dataset.scrollSnapType)})},focusIndicatorEl({context:e,event:t,scope:n}){if(t.src!=="indicator")return;const r=WD(n,e.get("page"));r&&qt(()=>r.focus({preventScroll:!0}))},invokeDragStart({context:e,prop:t}){var n;(n=t("onDragStatusChange"))==null||n({type:"dragging.start",isDragging:!0,page:e.get("page")})},invokeDragging({context:e,prop:t}){var n;(n=t("onDragStatusChange"))==null||n({type:"dragging",isDragging:!0,page:e.get("page")})},invokeDraggingEnd({context:e,prop:t}){var n;(n=t("onDragStatusChange"))==null||n({type:"dragging.end",isDragging:!1,page:e.get("page")})},invokeAutoplay({context:e,prop:t}){var n;(n=t("onAutoplayStatusChange"))==null||n({type:"autoplay",isPlaying:!0,page:e.get("page")})},invokeAutoplayStart({context:e,prop:t}){var n;(n=t("onAutoplayStatusChange"))==null||n({type:"autoplay.start",isPlaying:!0,page:e.get("page")})},invokeAutoplayEnd({context:e,prop:t}){var n;(n=t("onAutoplayStatusChange"))==null||n({type:"autoplay.stop",isPlaying:!1,page:e.get("page")})}}}};function KD(e,t,n){if(e==null||n<=0)return[];const r=[],s=t==="auto"?Math.floor(n):t;if(s<=0)return[];for(let a=0;a<e&&!(a+n>e);a+=s)r.push(a);return r}co()(["dir","getRootNode","id","ids","loop","page","defaultPage","onPageChange","orientation","slideCount","slidesPerPage","slidesPerMove","spacing","padding","autoplay","allowMouseDrag","inViewThreshold","translations","snapType","onDragStatusChange","onAutoplayStatusChange"]),co()(["index","readOnly"]),co()(["index","snapAlign"]);const QD=e=>{const t=R.useId(),{getRootNode:n}=Ql(),{dir:r}=Xh(),s=j({id:t,dir:r,getRootNode:n},e),a=Bl(XD,s);return GD(a,Nh)},ip=R.forwardRef((e,t)=>{const[n,r]=Ma()(e,["allowMouseDrag","autoplay","defaultPage","id","ids","inViewThreshold","loop","onAutoplayStatusChange","onDragStatusChange","onPageChange","orientation","padding","page","slideCount","slidesPerMove","slidesPerPage","snapType","spacing","translations"]),s=QD(n),a=Yt(s.getRootProps(),r);return w.jsx(FD,{value:s,children:w.jsx(hn.div,ce(j({},a),{ref:t}))})});ip.displayName="CarouselRoot";const JD=180,ZD=e=>{const t=e.trim(),n=parseFloat(t);return Number.isNaN(n)?0:t.endsWith("rem")?n*16:n},e8=({globalClassName:e,className:t,itemMinWidth:n=JD,spacing:r="0.5rem",loop:s=!1,allowMouseDrag:a=!0,showIndicators:u=!0,showNavigation:l=!0,onPageChange:d,ariaLabel:f="Product carousel",children:m})=>{const p=Array.from(m).map((J,se)=>({node:J,key:R.isValidElement(J)&&J.key!=null?J.key:`carousel-item-${se}`})),b=p.length,y=R.useRef(null),[_,x]=R.useState(0),{width:A}=JS();R.useLayoutEffect(()=>{y.current&&x(y.current.getBoundingClientRect().width)},[A,b]);const S=ZD(r),C=n+S,O=_>0?(_+S)/C:1,z=Math.max(1,Math.floor(O));if(b===0)return null;const G=b>z,D=Math.ceil(b/z),V=G?Math.max(1,O):z;return w.jsxs(ip,{ref:y,className:B(e,t,`${N}-carousel`),slidesPerPage:V,slidesPerMove:z,spacing:r,loop:s,allowMouseDrag:a,slideCount:b,onPageChange:d,"aria-label":f,children:[w.jsx(tp,{className:B(e,`${N}-carousel__item-group`,{"carousel-row-container":!G}),children:p.map(({node:J,key:se},H)=>w.jsx(ep,{index:H,className:B(e,`${N}-carousel__item`),children:J},se))}),l&&G&&w.jsxs(Qh,{className:B(e,`${N}-carousel__control`),children:[w.jsx(rp,{className:B(e,`${N}-carousel__prev-trigger`),"aria-label":"Previous slide",children:w.jsx(bb,{size:"16px"})}),w.jsx(np,{className:B(e,`${N}-carousel__next-trigger`),"aria-label":"Next slide",children:w.jsx(wb,{size:"16px"})})]}),u&&G&&w.jsx(Zh,{className:B(e,`${N}-carousel__indicator-group`),children:Array.from({length:D},(J,se)=>w.jsx(Jh,{index:se,className:B(e,`${N}-carousel__indicator`),"aria-label":`Go to slide group ${se+1}`},se))})]})},t8=({className:e,label:t="Close",onClick:n,disabled:r=!1})=>w.jsx("button",{"aria-label":t,title:t,className:B(e,`${N}-close-button`),disabled:r,onClick:n,children:w.jsx("svg",{role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 20",width:"16",height:"16",fill:"currentColor",children:w.jsx("path",{d:"M18.3 5.7a1 1 0 0 0-1.4-1.4L12 9.6 7.1 4.7a1 1 0 1 0-1.4 1.4l4.9 4.9-4.9 4.9a1 1 0 1 0 1.4 1.4l4.9-4.9 4.9 4.9a1 1 0 0 0 1.4-1.4l-4.9-4.9 4.9-4.9z"})})}),[n8,r8]=ls({name:"RenderStrategyContext",hookName:"useRenderStrategyContext",providerName:"<RenderStrategyPropsProvider />"}),i8=e=>Ma()(e,["lazyMount","unmountOnExit"]),[s8,za]=ls({name:"DialogContext",hookName:"useDialogContext",providerName:"<DialogProvider />"}),Rb=R.forwardRef((e,t)=>{const n=za(),r=r8(),s=Ph(ce(j({},r),{present:n.open})),a=Yt(n.getBackdropProps(),s.getPresenceProps(),e);return s.unmounted?null:w.jsx(hn.div,ce(j({},a),{ref:Ul(s.ref,t)}))});Rb.displayName="DialogBackdrop";const sp=R.forwardRef((e,t)=>{const n=za(),r=Da(),s=Yt(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:w.jsx(hn.div,ce(j({},s),{ref:Ul(r.ref,t)}))});sp.displayName="DialogContent";const op=R.forwardRef((e,t)=>{const n=za(),r=Yt(n.getDescriptionProps(),e);return w.jsx(hn.div,ce(j({},r),{ref:t}))});op.displayName="DialogDescription";const ap=R.forwardRef((e,t)=>{const n=za(),r=Yt(n.getPositionerProps(),e);return Da().unmounted?null:w.jsx(hn.div,ce(j({},r),{ref:t}))});ap.displayName="DialogPositioner";var o8=cs("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),ps=o8.build(),Lb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`dialog:${e.id}:positioner`},Db=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.backdrop)!=null?n:`dialog:${e.id}:backdrop`},up=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`dialog:${e.id}:content`},Mb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`dialog:${e.id}:trigger`},lp=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`dialog:${e.id}:title`},cp=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`dialog:${e.id}:description`},Fb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`dialog:${e.id}:close`},Zl=e=>e.getById(up(e)),a8=e=>e.getById(Lb(e)),u8=e=>e.getById(Db(e)),l8=e=>e.getById(Mb(e)),c8=e=>e.getById(lp(e)),d8=e=>e.getById(cp(e)),f8=e=>e.getById(Fb(e));function h8(e,t){const{state:n,send:r,context:s,prop:a,scope:u}=e,l=a("aria-label"),d=n.matches("open");return{open:d,setOpen(f){n.matches("open")!==f&&r({type:f?"OPEN":"CLOSE"})},getTriggerProps(){return t.button(ce(j({},ps.trigger.attrs),{dir:a("dir"),id:Mb(u),"aria-haspopup":"dialog",type:"button","aria-expanded":d,"data-state":d?"open":"closed","aria-controls":up(u),onClick(f){f.defaultPrevented||r({type:"TOGGLE"})}}))},getBackdropProps(){return t.element(ce(j({},ps.backdrop.attrs),{dir:a("dir"),hidden:!d,id:Db(u),"data-state":d?"open":"closed"}))},getPositionerProps(){return t.element(ce(j({},ps.positioner.attrs),{dir:a("dir"),id:Lb(u),style:{pointerEvents:d?void 0:"none"}}))},getContentProps(){const f=s.get("rendered");return t.element(ce(j({},ps.content.attrs),{dir:a("dir"),role:a("role"),hidden:!d,id:up(u),tabIndex:-1,"data-state":d?"open":"closed","aria-modal":!0,"aria-label":l||void 0,"aria-labelledby":l||!f.title?void 0:lp(u),"aria-describedby":f.description?cp(u):void 0}))},getTitleProps(){return t.element(ce(j({},ps.title.attrs),{dir:a("dir"),id:lp(u)}))},getDescriptionProps(){return t.element(ce(j({},ps.description.attrs),{dir:a("dir"),id:cp(u)}))},getCloseTriggerProps(){return t.button(ce(j({},ps.closeTrigger.attrs),{dir:a("dir"),id:Fb(u),type:"button",onClick(f){f.defaultPrevented||(f.stopPropagation(),r({type:"CLOSE"}))}}))}}}var p8={props({props:e,scope:t}){const n=e.role==="alertdialog",r=n?()=>f8(t):void 0,s=typeof e.modal=="boolean"?e.modal:!0;return j({role:"dialog",modal:s,trapFocus:s,preventScroll:s,closeOnInteractOutside:!n,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:r},e)},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{rendered:e(()=>({defaultValue:{title:!0,description:!0}}))}},watch({track:e,action:t,prop:n}){e([()=>n("open")],()=>{t(["toggleVisibility"])})},states:{open:{entry:["checkRenderedElements","syncZIndex"],effects:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackDismissableElement({scope:e,send:t,prop:n}){return ub(()=>Zl(e),{type:"dialog",defer:!0,pointerBlocking:n("modal"),exclude:[l8(e)],onInteractOutside(s){var a;(a=n("onInteractOutside"))==null||a(s),n("closeOnInteractOutside")||s.preventDefault()},persistentElements:n("persistentElements"),onFocusOutside:n("onFocusOutside"),onPointerDownOutside:n("onPointerDownOutside"),onRequestDismiss:n("onRequestDismiss"),onEscapeKeyDown(s){var a;(a=n("onEscapeKeyDown"))==null||a(s),n("closeOnEscape")||s.preventDefault()},onDismiss(){t({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:e,prop:t}){if(t("preventScroll"))return hb(e.getDoc())},trapFocus({scope:e,prop:t}){return t("trapFocus")?db(()=>Zl(e),{preventScroll:!0,returnFocusOnDeactivate:!!t("restoreFocus"),initialFocus:t("initialFocusEl"),setReturnFocus:r=>{var s,a;return(a=(s=t("finalFocusEl"))==null?void 0:s())!=null?a:r},getShadowRoot:!0}):void 0},hideContentBelow({scope:e,prop:t}){return t("modal")?ZT(()=>[Zl(e)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:e,scope:t}){qt(()=>{e.set("rendered",{title:!!c8(t),description:!!d8(t)})})},syncZIndex({scope:e}){qt(()=>{const t=Zl(e);if(!t)return;const n=oo(t);[a8(e),u8(e)].forEach(s=>{s==null||s.style.setProperty("--z-index",n.zIndex),s==null||s.style.setProperty("--layer-index",n.getPropertyValue("--layer-index"))})})},invokeOnClose({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!1})},invokeOnOpen({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!0})},toggleVisibility({prop:e,send:t,event:n}){t({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:n})}}}};co()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);const m8=e=>{const t=R.useId(),{getRootNode:n}=Ql(),{dir:r}=Xh(),s=j({id:t,getRootNode:n,dir:r},e),a=Bl(p8,s);return h8(a,Nh)},Bb=e=>{const[t,l]=CT(e),d=l,{children:n}=d,r=Sn(d,["children"]),[s]=i8(t),a=m8(r),u=Ph(Yt({present:a.open},t));return w.jsx(s8,{value:a,children:w.jsx(n8,{value:s,children:w.jsx(vT,{value:u,children:n})})})},Ub=R.forwardRef((e,t)=>{const n=za(),r=Yt(n.getTitleProps(),e);return w.jsx(hn.h2,ce(j({},r),{ref:t}))});Ub.displayName="DialogTitle";const g8=({children:e})=>{const[t,n]=R.useState(!1),r=R.useMemo(()=>({toggleMenu:()=>n(a=>!a),closeMenu:()=>n(!1)}),[]),s=R.useMemo(()=>({isOpen:t}),[t]);return w.jsx(mh.Provider,{value:r,children:w.jsx(Qy.Provider,{value:s,children:e})})},Hb=()=>R.useContext(Qy),jb=()=>{const e=R.useContext(mh);if(!e)throw new Error("useOverflowMenuDispatch must be used within an OverflowMenuProvider");return e},E8=`${N}-overflow-menu-button-trigger`,y8=({componentType:e,children:t})=>{const{isOpen:n}=Hb(),{closeMenu:r}=jb(),{globalClassName:s}=ft(),a=R.useRef(null);return R.useEffect(()=>{if(!n)return;const u=d=>{d.key==="Escape"&&r()},l=d=>{const f=d.target;f instanceof Element&&f.closest(`.${E8}`)||a.current&&!a.current.contains(f)&&r()};return document.addEventListener("keydown",u),document.addEventListener("mousedown",l),()=>{document.removeEventListener("keydown",u),document.removeEventListener("mousedown",l)}},[n,r]),n?w.jsx("div",{ref:a,role:"menu","aria-label":`Overflow menu for ${e}`,className:B(`${N}-overflow-panel`,s,`cim-${e}-component`),children:t}):null},T8=({componentType:e,className:t})=>{const{toggleMenu:n}=jb(),{isOpen:r}=Hb(),{globalClassName:s}=ft();return w.jsx("button",{"aria-label":`Overflow menu for ${e}`,title:"More options","aria-expanded":r,"aria-haspopup":"menu",className:B(`${N}-overflow-menu-button-trigger`,`${N}-icon-button`,s,t,`cim-${e}-component`),onClick:n,children:w.jsx(_b,{})})};class b8{constructor(){Qe(this,"initialState",z0);Qe(this,"promptsStateProxy");Qe(this,"promptsParamsProxy");Qe(this,"_fullGet",(t,n)=>Reflect.get(t,n));Qe(this,"_fullSet",(t,n,r)=>{if(!(n in t))throw new Error(`Property ${n} does not exist on PromptsExtensionState`);return x8(n,r),Reflect.set(t,n,r)});Qe(this,"_paramsFullGet",(t,n)=>Reflect.get(t,n));Qe(this,"_paramsFullSet",(t,n,r)=>Reflect.set(t,n,r));Qe(this,"updatePromptsParamsProxy",t=>new Proxy(j({},t),{get:this._paramsFullGet,set:this._paramsFullSet}));this.promptsStateProxy=new Proxy({isOpen:this.initialState.isOpen,isInline:this.initialState.isInline,elementId:this.initialState.elementId,entryType:this.initialState.entryType},{get:this._fullGet,set:this._fullSet}),this.promptsParamsProxy=this.updatePromptsParamsProxy({})}get isOpen(){return this.promptsStateProxy.isOpen}get isInline(){return this.promptsStateProxy.isInline}get state(){return{isOpen:this.isOpen,isInline:this.isInline}}get params(){return this.promptsParamsProxy}}const _i=new b8,w8=e=>{window.addEventListener(Ld,e)},_8=e=>{window.removeEventListener(Ld,e)},x8=(e,t)=>{const n=new CustomEvent(Ld,{detail:{property:e,value:t}});window.dispatchEvent(n)},zb=e=>{const t=_i.isOpen,n=typeof e=="boolean"?e:!t;_i.promptsStateProxy.isOpen=n},S8=e=>{const t=_i.isInline,n=typeof e=="boolean"?e:!t;_i.promptsStateProxy.isInline=n},v8=({elementId:e,entryType:t,params:n,isInline:r})=>{_i.promptsStateProxy.elementId=e,t&&(_i.promptsStateProxy.entryType=t),typeof r=="boolean"&&S8(r),n&&_i.updatePromptsParamsProxy(n),_i.isOpen||zb(!0)},A8=()=>{const e=R.useContext(r1);if(!e)throw new Error("usePdp must be used within a PdpProvider");return e},k8=()=>{const e=R.useContext(n1);if(!e)throw new Error("usePromptsExtensionDispatch must be used within a PromptsExtensionProvider");return e||{}},ec=()=>{const e=R.useContext(t1);if(!e)throw new Error("usePromptsExtensionState must be used within a PromptsExtensionProvider");return e||{}},C8=({componentType:e,isIcon:t})=>{const{globalClassName:n}=ft(),{previousComponentType:r}=Vr(),s=eo(),a=()=>{Mu(r||"dialog"),s()};return t?w.jsx(lr,{className:B(n,`${N}-toggle-dialog-button`,`cim-${e}-component`),ariaLabel:"Collapse",title:"Collapse",onClick:a,icon:w.jsx(xb,{})}):w.jsxs("button",{className:B(n,`${N}-overflow-menu-button`,`${N}-toggle-dialog-button`,`cim-${e}-component`),onClick:a,children:[w.jsx(xb,{}),"Show ",r||"dialog"]})},N8=({componentType:e,isIcon:t})=>{const{globalClassName:n}=ft(),{isModalFullscreen:r}=Vr(),s=eo(),a=()=>{Md(!r),s()},u=r?vC:AC,l="Toggle Fullscreen";return t?w.jsx(lr,{ariaLabel:l,title:l,className:B(n,`${N}-modal-fullscreen-button`,`cim-${e}-component`),icon:w.jsx(u,{}),onClick:a}):w.jsxs("button",{className:B(n,`${N}-overflow-menu-button`,`${N}-modal-fullscreen-button`,`cim-${e}-component`),onClick:a,children:[w.jsx(u,{}),l]})},O8=({componentType:e,isIcon:t})=>{const{globalClassName:n}=ft(),{dialogPosition:r}=Vr(),s=eo(),a=r==="bottom-left",u=()=>{Fd(a?"bottom-right":"bottom-left"),s()},l=a?RD:PD,d=a?"Move right":"Move left";return t?w.jsx(lr,{className:B(n,`${N}-left-right-toggle-button`,`cim-${e}-component`),ariaLabel:d,title:d,onClick:u,icon:w.jsx(l,{})}):w.jsxs("button",{className:B(n,`${N}-overflow-menu-button`,`${N}-left-right-toggle-button`,`cim-${e}-component`),onClick:u,children:[w.jsx(l,{}),d]})},$b=({componentType:e,onClearChat:t,onClose:n,onDownloadTranscript:r})=>{const{headerConfig:s,globalClassName:a,mode:u,enableDownloadTranscript:l}=ft(),{mode:d}=Vr(),f=u==="messaging"&&l&&!!r,m=d==="standalone",p=e==="modal",b=p?C8:Yb,y=p?N8:O8,_=R.useMemo(()=>s?TC(s):{},[s]);return w.jsx(g8,{children:w.jsxs("div",{className:B(a,`${N}-${e}-header-wrapper`),style:{display:"flex",flexDirection:"column",position:"relative"},children:[w.jsxs("div",{className:B(a,`${N}-${e}-header`,{standalone:m,embedded:!m}),style:_,children:[(s==null?void 0:s.logoUrl)&&w.jsx("img",{alt:"",role:"img",className:B(a,`${N}-${e}-logo`,{standalone:m,embedded:!m}),src:s.logoUrl}),w.jsx(Ub,{className:B(a,`${N}-${e}-title`,{standalone:m,embedded:!m}),children:s==null?void 0:s.headerText}),w.jsxs("div",{className:B(a,`${N}-${e}-controls`),children:[w.jsx(b,{componentType:e,isIcon:!0}),w.jsx(T8,{componentType:e}),w.jsx(t8,{className:B(a,`cim-${e}-component`),onClick:n})]})]}),w.jsxs(y8,{componentType:e,children:[w.jsx(y,{componentType:e}),w.jsx(D8,{componentType:e}),w.jsx(Zy,{componentType:e,onClearChat:t}),f&&w.jsx(eT,{componentType:e,onDownloadTranscript:r})]})]})})},tc="USD",Kr=(e,t)=>{if(typeof e!="number"||Number.isNaN(e))return null;try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(e)}catch(n){return`${e}`}},I8=({retailPrice:e,discountPrice:t,currencyCode:n=tc})=>{const r=n||tc,s=typeof t=="number"&&typeof e=="number"&&t<e,a=s?t:e||t||null,u=s?e:null;return{price:Kr(a,r),comparePrice:Kr(u,r),hasDiscount:s}},Vb=e=>typeof e=="number"&&Number.isFinite(e),P8=({priceBreakdown:e,currencyCode:t=tc})=>{if(!e)return null;const n=t||tc,r=[e.sales,e.original],s=r.map(m=>m==null?void 0:m.min).filter(Vb),a=r.map(m=>m==null?void 0:m.max).filter(Vb);if(s.length===0||a.length===0)return null;const u=Math.min(...s),l=Math.max(...a);if(u===l)return null;const d=Kr(u,n),f=Kr(l,n);return d===null||f===null?null:{range:`${d} – ${f}`,low:d,high:f}},dp=({retailPrice:e,discountPrice:t,currencyCode:n,fontSize:r,globalClassName:s,className:a})=>{const{price:u,comparePrice:l,hasDiscount:d}=I8({retailPrice:e,discountPrice:t,currencyCode:n});if(!u)return null;const f=typeof r=="string"?{fontSize:r}:{};return w.jsxs("div",{className:B(s,a,`${N}-price`),style:f,children:[w.jsx("span",{className:B(s,`${N}-price__amount`),children:u}),d&&l&&w.jsx("span",{className:B(s,`${N}-price__compare`),children:l})]})},R8={sparkle:Kh,plus:LD,"paper-plane":DD},qb=({icon:e,className:t})=>{const n=R8[e];return n?w.jsx(n,{className:t,"aria-hidden":"true"}):null},L8=({className:e,globalClassName:t,suggestions:n,disabled:r,isWidgetStandalone:s,onSuggestionClick:a})=>{var y;const{suggestionButtonConfig:u}=ft(),l=u==null?void 0:u.icon,d=(y=u==null?void 0:u.iconPosition)!=null?y:"left",f=s?"standalone":"embedded",m=_=>()=>{a(_)},p={"has-icon":!!l,"icon-right":!!l&&d==="right"},b=_=>w.jsxs(w.Fragment,{children:[l&&w.jsx(qb,{icon:l,className:`${N}-suggestion-button-icon`}),w.jsx("span",{children:_})]});return w.jsx("div",{className:B(t,`${N}-suggestion-container ${f}`,e),children:n.map(_=>s?w.jsx(bf,{disabled:r,className:B(t,`${N}-suggestion-button standalone`,p),onClick:m(_),children:b(_)},_):w.jsx("button",{disabled:r,className:B(t,`${N}-suggestion-button embedded`,p),onClick:m(_),children:b(_)},_))})},D8=({componentType:e,isIcon:t})=>{const{globalClassName:n,enableMinimize:r}=ft();if(!r)return null;const s=()=>{$r(!1),Ms(!0)};return t?w.jsx(lr,{className:B(n,`${N}-toggle-minimize-button`,`cim-${e}-component`),ariaLabel:"Toggle Minimize",title:"Minimize",onClick:s,icon:w.jsx(g1,{})}):w.jsxs("button",{className:B(n,`${N}-overflow-menu-button`,`${N}-toggle-minimize-button`,`cim-${e}-component`),onClick:s,children:[w.jsx(g1,{}),"Minimize"]})},Yb=({componentType:e,isIcon:t})=>{const{globalClassName:n}=ft(),r=eo(),s=()=>{Mu("modal"),r()};return t?w.jsx(lr,{className:B(n,`${N}-toggle-modal-button`,`cim-${e}-component`),ariaLabel:"Expand",title:"Expand",onClick:s,icon:w.jsx(Sb,{})}):w.jsxs("button",{className:B(n,`${N}-overflow-menu-button`,`${N}-toggle-modal-button`,`cim-${e}-component`),onClick:s,children:[w.jsx(Sb,{}),"Show modal"]})},M8=["Hey there! 👋 What can I find for you today?","Shopping for a gift? Tell me your budget and preferences","Need help? Connect to an agent"],F8=3e3,B8=400,U8=({globalClassName:e,isWidgetStandalone:t,messages:n=M8})=>{const[r,s]=R.useState(0),[a,u]=R.useState(!0);return R.useEffect(()=>{let l;const d=setInterval(()=>{u(!1),l=setTimeout(()=>{s(f=>(f+1)%n.length),u(!0)},B8)},F8);return()=>{clearInterval(d),clearTimeout(l)}},[n.length]),w.jsxs("div",{className:B(e,`${N}-connecting-indicator`,t?"standalone":"embedded"),role:"status","aria-label":"Connecting to assistant",children:[w.jsxs("div",{className:`${N}-connecting-pulse-wrapper`,children:[w.jsx("div",{className:`${N}-connecting-pulse`}),w.jsx("div",{className:`${N}-connecting-ring`})]}),w.jsx("span",{className:B(`${N}-connecting-text`,a&&`${N}-connecting-text--visible`),children:n[r]})]})},H8=({shouldShow:e,loadingText:t})=>e?w.jsx("span",{className:`${N}-processing-text`,children:t}):null,j8=({shouldShow:e})=>e?w.jsxs(w.Fragment,{children:[w.jsx("div",{className:`${N}-processing-shimmer-bar`}),w.jsx("div",{className:`${N}-processing-shimmer-bar`}),w.jsx("div",{className:`${N}-processing-shimmer-bar`})]}):null,fp=({globalClassName:e,isWidgetStandalone:t,loadingText:n})=>w.jsxs("div",{className:B(e,`${N}-processing-indicator`,t?"standalone":"embedded"),role:"status","aria-label":n||"Loading response",children:[w.jsx(H8,{shouldShow:!!n,loadingText:n}),w.jsx(j8,{shouldShow:!n})]});function Wb(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function z8(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function $8(e,t,n){const s=gl((n||{}).ignore||[]),a=V8(t);let u=-1;for(;++u<a.length;)IE(e,"text",l);function l(f,m){let p=-1,b;for(;++p<m.length;){const y=m[p],_=b?b.children:void 0;if(s(y,_?_.indexOf(y):void 0,b))return;b=y}if(b)return d(f,m)}function d(f,m){const p=m[m.length-1],b=a[u][0],y=a[u][1];let _=0;const A=p.children.indexOf(f);let S=!1,C=[];b.lastIndex=0;let O=b.exec(f.value);for(;O;){const z=O.index,G={index:O.index,input:O.input,stack:[...m,f]};let D=y(...O,G);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?b.lastIndex=z+1:(_!==z&&C.push({type:"text",value:f.value.slice(_,z)}),Array.isArray(D)?C.push(...D):D&&C.push(D),_=z+O[0].length,S=!0),!b.global)break;O=b.exec(f.value)}return S?(_<f.value.length&&C.push({type:"text",value:f.value.slice(_)}),p.children.splice(A,1,...C)):C=[f],A+C.length}}function V8(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([q8(s[0]),Y8(s[1])])}return t}function q8(e){return typeof e=="string"?new RegExp(z8(e),"g"):e}function Y8(e){return typeof e=="function"?e:function(){return e}}const hp="phrasing",pp=["autolink","link","image","label"];function W8(){return{transforms:[eM],enter:{literalAutolink:X8,literalAutolinkEmail:mp,literalAutolinkHttp:mp,literalAutolinkWww:mp},exit:{literalAutolink:Z8,literalAutolinkEmail:J8,literalAutolinkHttp:K8,literalAutolinkWww:Q8}}}function G8(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:hp,notInConstruct:pp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:hp,notInConstruct:pp},{character:":",before:"[ps]",after:"\\/",inConstruct:hp,notInConstruct:pp}]}}function X8(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function mp(e){this.config.enter.autolinkProtocol.call(this,e)}function K8(e){this.config.exit.autolinkProtocol.call(this,e)}function Q8(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function J8(e){this.config.exit.autolinkEmail.call(this,e)}function Z8(e){this.exit(e)}function eM(e){$8(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,tM],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),nM]],{ignore:["link","linkReference"]})}function tM(e,t,n,r,s){let a="";if(!Gb(s)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!rM(n)))return!1;const u=iM(n+r);if(!u[0])return!1;const l={type:"link",title:null,url:a+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[l,{type:"text",value:u[1]}]:l}function nM(e,t,n,r){return!Gb(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function rM(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function iM(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=Wb(e,"(");let a=Wb(e,")");for(;r!==-1&&s>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function Gb(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||es(n)||ll(n))&&(!t||n!==47)}Xb.peek=hM;function sM(){this.buffer()}function oM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function aM(){this.buffer()}function uM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function lM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=cr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cM(e){this.exit(e)}function dM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=cr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function fM(e){this.exit(e)}function hM(){return"["}function Xb(e,t,n,r){const s=n.createTracker(r);let a=s.move("[^");const u=n.enter("footnoteReference"),l=n.enter("reference");return a+=s.move(n.safe(n.associationId(e),{after:"]",before:a})),l(),u(),a+=s.move("]"),a}function pM(){return{enter:{gfmFootnoteCallString:sM,gfmFootnoteCall:oM,gfmFootnoteDefinitionLabelString:aM,gfmFootnoteDefinition:uM},exit:{gfmFootnoteCallString:lM,gfmFootnoteCall:cM,gfmFootnoteDefinitionLabelString:dM,gfmFootnoteDefinition:fM}}}function mM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Xb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,a,u){const l=a.createTracker(u);let d=l.move("[^");const f=a.enter("footnoteDefinition"),m=a.enter("label");return d+=l.move(a.safe(a.associationId(r),{before:d,after:"]"})),m(),d+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),d+=l.move((t?`
38
- `:" ")+a.indentLines(a.containerFlow(r,l.current()),t?Kb:gM))),f(),d}}function gM(e,t,n){return t===0?e:Kb(e,t,n)}function Kb(e,t,n){return(n?"":" ")+e}const EM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Qb.peek=_M;function yM(){return{canContainEols:["delete"],enter:{strikethrough:bM},exit:{strikethrough:wM}}}function TM(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:EM}],handlers:{delete:Qb}}}function bM(e){this.enter({type:"delete",children:[]},e)}function wM(e){this.exit(e)}function Qb(e,t,n,r){const s=n.createTracker(r),a=n.enter("strikethrough");let u=s.move("~~");return u+=n.containerPhrasing(e,ce(j({},s.current()),{before:u,after:"~"})),u+=s.move("~~"),a(),u}function _M(){return"~"}function xM(e){return e.length}function SM(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||xM,a=[],u=[],l=[],d=[];let f=0,m=-1;for(;++m<e.length;){const x=[],A=[];let S=-1;for(e[m].length>f&&(f=e[m].length);++S<e[m].length;){const C=vM(e[m][S]);if(n.alignDelimiters!==!1){const O=s(C);A[S]=O,(d[S]===void 0||O>d[S])&&(d[S]=O)}x.push(C)}u[m]=x,l[m]=A}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<f;)a[p]=Jb(r[p]);else{const x=Jb(r);for(;++p<f;)a[p]=x}p=-1;const b=[],y=[];for(;++p<f;){const x=a[p];let A="",S="";x===99?(A=":",S=":"):x===108?A=":":x===114&&(S=":");let C=n.alignDelimiters===!1?1:Math.max(1,d[p]-A.length-S.length);const O=A+"-".repeat(C)+S;n.alignDelimiters!==!1&&(C=A.length+C+S.length,C>d[p]&&(d[p]=C),y[p]=C),b[p]=O}u.splice(1,0,b),l.splice(1,0,y),m=-1;const _=[];for(;++m<u.length;){const x=u[m],A=l[m];p=-1;const S=[];for(;++p<f;){const C=x[p]||"";let O="",z="";if(n.alignDelimiters!==!1){const G=d[p]-(A[p]||0),D=a[p];D===114?O=" ".repeat(G):D===99?G%2?(O=" ".repeat(G/2+.5),z=" ".repeat(G/2-.5)):(O=" ".repeat(G/2),z=O):z=" ".repeat(G)}n.delimiterStart!==!1&&!p&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||p)&&S.push(" "),n.alignDelimiters!==!1&&S.push(O),S.push(C),n.alignDelimiters!==!1&&S.push(z),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||p!==f-1)&&S.push("|")}_.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return _.join(`
37
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const rs={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},WE={}.hasOwnProperty,UI=Object.prototype;function HI(e,t){const n=t||{};return nh({file:n.file||void 0,location:!1,schema:n.space==="svg"?fi:ca,verbose:n.verbose||!1},e)}function nh(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},bl(e,r,n),n}case"#document":case"#document-fragment":{const r=t,s="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:GE(e,t.childNodes),data:{quirksMode:s}},e.file&&e.location){const a=String(e.file),u=BI(a),l=u.toPoint(0),d=u.toPoint(a.length);n.position={start:l,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},bl(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},bl(e,r,n),n}default:return n=jI(e,t),n}}function GE(e,t){let n=-1;const r=[];for(;++n<t.length;){const s=nh(e,t[n]);r.push(s)}return r}function jI(e,t){const n=e.schema;e.schema=t.namespaceURI===rs.svg?fi:ca;let r=-1;const s={};for(;++r<t.attrs.length;){const l=t.attrs[r],d=(l.prefix?l.prefix+":":"")+l.name;WE.call(UI,d)||(s[d]=l.value)}const u=(e.schema.space==="svg"?FI:MI)(t.tagName,s,GE(e,t.childNodes));if(bl(e,t,u),u.tagName==="template"){const l=t,d=l.sourceCodeLocation,f=d&&d.startTag&&Xs(d.startTag),m=d&&d.endTag&&Xs(d.endTag),p=nh(e,l.content);f&&m&&e.file&&(p.position={start:f.end,end:m.start}),u.content=p}return e.schema=n,u}function bl(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=zI(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function zI(e,t,n){const r=Xs(n);if(t.type==="element"){const s=t.children[t.children.length-1];if(r&&!n.endTag&&s&&s.position&&s.position.end&&(r.end=Object.assign({},s.position.end)),e.verbose){const a={};let u;if(n.attrs)for(u in n.attrs)WE.call(n.attrs,u)&&(a[ol(e.schema,u).property]=Xs(n.attrs[u]));n.startTag;const l=Xs(n.startTag),d=n.endTag?Xs(n.endTag):void 0,f={opening:l};d&&(f.closing=d),f.properties=a,t.data={position:f}}}return r}function Xs(e){const t=XE({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=XE({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function XE(e){return e.line&&e.column?e:void 0}const KE={}.hasOwnProperty;function QE(e,t){const n=t||{};function r(s,...a){let u=r.invalid;const l=r.handlers;if(s&&KE.call(s,e)){const d=String(s[e]);u=KE.call(l,d)?l[d]:r.unknown}if(u)return u.call(this,s,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const $I={},VI={}.hasOwnProperty,JE=QE("type",{handlers:{root:YI,element:QI,text:XI,comment:KI,doctype:GI}});function qI(e,t){const r=(t||$I).space;return JE(e,r==="svg"?fi:ca)}function YI(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=rh(e.children,n,t),Ks(e,n),n}function WI(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=rh(e.children,n,t),Ks(e,n),n}function GI(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Ks(e,t),t}function XI(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Ks(e,t),t}function KI(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Ks(e,t),t}function QI(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=fi);const s=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&VI.call(e.properties,a)){const d=JI(r,a,e.properties[a]);d&&s.push(d)}}const u=r.space,l={nodeName:e.tagName,tagName:e.tagName,attrs:s,namespaceURI:rs[u],childNodes:[],parentNode:null};return l.childNodes=rh(e.children,l,r),Ks(e,l),e.tagName==="template"&&e.content&&(l.content=WI(e.content,r)),l}function JI(e,t,n){const r=ol(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?w1(n):L1(n));const s={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=s.name.indexOf(":");a<0?s.prefix="":(s.name=s.name.slice(a+1),s.prefix=r.attribute.slice(0,a)),s.namespace=rs[r.space]}return s}function rh(e,t,n){let r=-1;const s=[];if(e)for(;++r<e.length;){const a=JE(e[r],n);a.parentNode=t,s.push(a)}return s}function Ks(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const ZI=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],eP=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),kt="�";var I;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(I||(I={}));const In={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function ZE(e){return e>=55296&&e<=57343}function tP(e){return e>=56320&&e<=57343}function nP(e,t){return(e-55296)*1024+9216+t}function ey(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function ty(e){return e>=64976&&e<=65007||eP.has(e)}var ne;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ne||(ne={}));const rP=65536;class iP{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=rP,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:s,offset:a}=this,u=s+n,l=a+n;return{code:t,startLine:r,endLine:r,startCol:u,endCol:u,startOffset:l,endOffset:l}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(tP(n))return this.pos++,this._addGap(),nP(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,I.EOF;return this._err(ne.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;const r=this.html.charCodeAt(n);return r===I.CARRIAGE_RETURN?I.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;let t=this.html.charCodeAt(this.pos);return t===I.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,I.LINE_FEED):t===I.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,ZE(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===I.LINE_FEED||t===I.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){ey(t)?this._err(ne.controlCharacterInInputStream):ty(t)&&this._err(ne.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var rt;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(rt||(rt={}));function ny(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const sP=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),oP=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function aP(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=oP.get(e))!==null&&t!==void 0?t:e}var Kt;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Kt||(Kt={}));const uP=32;var mi;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(mi||(mi={}));function ih(e){return e>=Kt.ZERO&&e<=Kt.NINE}function lP(e){return e>=Kt.UPPER_A&&e<=Kt.UPPER_F||e>=Kt.LOWER_A&&e<=Kt.LOWER_F}function cP(e){return e>=Kt.UPPER_A&&e<=Kt.UPPER_Z||e>=Kt.LOWER_A&&e<=Kt.LOWER_Z||ih(e)}function dP(e){return e===Kt.EQUALS||cP(e)}var Qt;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Qt||(Qt={}));var qr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(qr||(qr={}));class fP{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Qt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=qr.Strict}startEntity(t){this.decodeMode=t,this.state=Qt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Qt.EntityStart:return t.charCodeAt(n)===Kt.NUM?(this.state=Qt.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Qt.NamedEntity,this.stateNamedEntity(t,n));case Qt.NumericStart:return this.stateNumericStart(t,n);case Qt.NumericDecimal:return this.stateNumericDecimal(t,n);case Qt.NumericHex:return this.stateNumericHex(t,n);case Qt.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|uP)===Kt.LOWER_X?(this.state=Qt.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Qt.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,s){if(n!==r){const a=r-n;this.result=this.result*Math.pow(s,a)+Number.parseInt(t.substr(n,a),s),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(ih(s)||lP(s))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(ih(s))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Kt.SEMI)this.consumed+=1;else if(this.decodeMode===qr.Strict)return 0;return this.emitCodePoint(aP(this.result),this.consumed),this.errors&&(t!==Kt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let s=r[this.treeIndex],a=(s&mi.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const u=t.charCodeAt(n);if(this.treeIndex=hP(r,s,this.treeIndex+Math.max(1,a),u),this.treeIndex<0)return this.result===0||this.decodeMode===qr.Attribute&&(a===0||dP(u))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&mi.VALUE_LENGTH)>>14,a!==0){if(u===Kt.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==qr.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,s=(r[n]&mi.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[t]&~mi.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case Qt.NamedEntity:return this.result!==0&&(this.decodeMode!==qr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Qt.NumericDecimal:return this.emitNumericEntity(0,2);case Qt.NumericHex:return this.emitNumericEntity(0,3);case Qt.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Qt.EntityStart:return 0}}}function hP(e,t,n,r){const s=(t&mi.BRANCH_LENGTH)>>7,a=t&mi.JUMP_TABLE;if(s===0)return a!==0&&r===a?n:-1;if(a){const d=r-a;return d<0||d>=s?-1:e[n+d]-1}let u=n,l=u+s-1;for(;u<=l;){const d=u+l>>>1,f=e[d];if(f<r)u=d+1;else if(f>r)l=d-1;else return e[d+s]}return-1}var me;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(me||(me={}));var is;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(is||(is={}));var Qn;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Qn||(Qn={}));var K;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(K||(K={}));var g;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(g||(g={}));const pP=new Map([[K.A,g.A],[K.ADDRESS,g.ADDRESS],[K.ANNOTATION_XML,g.ANNOTATION_XML],[K.APPLET,g.APPLET],[K.AREA,g.AREA],[K.ARTICLE,g.ARTICLE],[K.ASIDE,g.ASIDE],[K.B,g.B],[K.BASE,g.BASE],[K.BASEFONT,g.BASEFONT],[K.BGSOUND,g.BGSOUND],[K.BIG,g.BIG],[K.BLOCKQUOTE,g.BLOCKQUOTE],[K.BODY,g.BODY],[K.BR,g.BR],[K.BUTTON,g.BUTTON],[K.CAPTION,g.CAPTION],[K.CENTER,g.CENTER],[K.CODE,g.CODE],[K.COL,g.COL],[K.COLGROUP,g.COLGROUP],[K.DD,g.DD],[K.DESC,g.DESC],[K.DETAILS,g.DETAILS],[K.DIALOG,g.DIALOG],[K.DIR,g.DIR],[K.DIV,g.DIV],[K.DL,g.DL],[K.DT,g.DT],[K.EM,g.EM],[K.EMBED,g.EMBED],[K.FIELDSET,g.FIELDSET],[K.FIGCAPTION,g.FIGCAPTION],[K.FIGURE,g.FIGURE],[K.FONT,g.FONT],[K.FOOTER,g.FOOTER],[K.FOREIGN_OBJECT,g.FOREIGN_OBJECT],[K.FORM,g.FORM],[K.FRAME,g.FRAME],[K.FRAMESET,g.FRAMESET],[K.H1,g.H1],[K.H2,g.H2],[K.H3,g.H3],[K.H4,g.H4],[K.H5,g.H5],[K.H6,g.H6],[K.HEAD,g.HEAD],[K.HEADER,g.HEADER],[K.HGROUP,g.HGROUP],[K.HR,g.HR],[K.HTML,g.HTML],[K.I,g.I],[K.IMG,g.IMG],[K.IMAGE,g.IMAGE],[K.INPUT,g.INPUT],[K.IFRAME,g.IFRAME],[K.KEYGEN,g.KEYGEN],[K.LABEL,g.LABEL],[K.LI,g.LI],[K.LINK,g.LINK],[K.LISTING,g.LISTING],[K.MAIN,g.MAIN],[K.MALIGNMARK,g.MALIGNMARK],[K.MARQUEE,g.MARQUEE],[K.MATH,g.MATH],[K.MENU,g.MENU],[K.META,g.META],[K.MGLYPH,g.MGLYPH],[K.MI,g.MI],[K.MO,g.MO],[K.MN,g.MN],[K.MS,g.MS],[K.MTEXT,g.MTEXT],[K.NAV,g.NAV],[K.NOBR,g.NOBR],[K.NOFRAMES,g.NOFRAMES],[K.NOEMBED,g.NOEMBED],[K.NOSCRIPT,g.NOSCRIPT],[K.OBJECT,g.OBJECT],[K.OL,g.OL],[K.OPTGROUP,g.OPTGROUP],[K.OPTION,g.OPTION],[K.P,g.P],[K.PARAM,g.PARAM],[K.PLAINTEXT,g.PLAINTEXT],[K.PRE,g.PRE],[K.RB,g.RB],[K.RP,g.RP],[K.RT,g.RT],[K.RTC,g.RTC],[K.RUBY,g.RUBY],[K.S,g.S],[K.SCRIPT,g.SCRIPT],[K.SEARCH,g.SEARCH],[K.SECTION,g.SECTION],[K.SELECT,g.SELECT],[K.SOURCE,g.SOURCE],[K.SMALL,g.SMALL],[K.SPAN,g.SPAN],[K.STRIKE,g.STRIKE],[K.STRONG,g.STRONG],[K.STYLE,g.STYLE],[K.SUB,g.SUB],[K.SUMMARY,g.SUMMARY],[K.SUP,g.SUP],[K.TABLE,g.TABLE],[K.TBODY,g.TBODY],[K.TEMPLATE,g.TEMPLATE],[K.TEXTAREA,g.TEXTAREA],[K.TFOOT,g.TFOOT],[K.TD,g.TD],[K.TH,g.TH],[K.THEAD,g.THEAD],[K.TITLE,g.TITLE],[K.TR,g.TR],[K.TRACK,g.TRACK],[K.TT,g.TT],[K.U,g.U],[K.UL,g.UL],[K.SVG,g.SVG],[K.VAR,g.VAR],[K.WBR,g.WBR],[K.XMP,g.XMP]]);function Qs(e){var t;return(t=pP.get(e))!==null&&t!==void 0?t:g.UNKNOWN}const Ee=g,mP={[me.HTML]:new Set([Ee.ADDRESS,Ee.APPLET,Ee.AREA,Ee.ARTICLE,Ee.ASIDE,Ee.BASE,Ee.BASEFONT,Ee.BGSOUND,Ee.BLOCKQUOTE,Ee.BODY,Ee.BR,Ee.BUTTON,Ee.CAPTION,Ee.CENTER,Ee.COL,Ee.COLGROUP,Ee.DD,Ee.DETAILS,Ee.DIR,Ee.DIV,Ee.DL,Ee.DT,Ee.EMBED,Ee.FIELDSET,Ee.FIGCAPTION,Ee.FIGURE,Ee.FOOTER,Ee.FORM,Ee.FRAME,Ee.FRAMESET,Ee.H1,Ee.H2,Ee.H3,Ee.H4,Ee.H5,Ee.H6,Ee.HEAD,Ee.HEADER,Ee.HGROUP,Ee.HR,Ee.HTML,Ee.IFRAME,Ee.IMG,Ee.INPUT,Ee.LI,Ee.LINK,Ee.LISTING,Ee.MAIN,Ee.MARQUEE,Ee.MENU,Ee.META,Ee.NAV,Ee.NOEMBED,Ee.NOFRAMES,Ee.NOSCRIPT,Ee.OBJECT,Ee.OL,Ee.P,Ee.PARAM,Ee.PLAINTEXT,Ee.PRE,Ee.SCRIPT,Ee.SECTION,Ee.SELECT,Ee.SOURCE,Ee.STYLE,Ee.SUMMARY,Ee.TABLE,Ee.TBODY,Ee.TD,Ee.TEMPLATE,Ee.TEXTAREA,Ee.TFOOT,Ee.TH,Ee.THEAD,Ee.TITLE,Ee.TR,Ee.TRACK,Ee.UL,Ee.WBR,Ee.XMP]),[me.MATHML]:new Set([Ee.MI,Ee.MO,Ee.MN,Ee.MS,Ee.MTEXT,Ee.ANNOTATION_XML]),[me.SVG]:new Set([Ee.TITLE,Ee.FOREIGN_OBJECT,Ee.DESC]),[me.XLINK]:new Set,[me.XML]:new Set,[me.XMLNS]:new Set},sh=new Set([Ee.H1,Ee.H2,Ee.H3,Ee.H4,Ee.H5,Ee.H6]);K.STYLE,K.SCRIPT,K.XMP,K.IFRAME,K.NOEMBED,K.NOFRAMES,K.PLAINTEXT;var L;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(L||(L={}));const Ut={DATA:L.DATA,RCDATA:L.RCDATA,RAWTEXT:L.RAWTEXT,SCRIPT_DATA:L.SCRIPT_DATA,PLAINTEXT:L.PLAINTEXT,CDATA_SECTION:L.CDATA_SECTION};function gP(e){return e>=I.DIGIT_0&&e<=I.DIGIT_9}function wa(e){return e>=I.LATIN_CAPITAL_A&&e<=I.LATIN_CAPITAL_Z}function EP(e){return e>=I.LATIN_SMALL_A&&e<=I.LATIN_SMALL_Z}function gi(e){return EP(e)||wa(e)}function ry(e){return gi(e)||gP(e)}function wl(e){return e+32}function iy(e){return e===I.SPACE||e===I.LINE_FEED||e===I.TABULATION||e===I.FORM_FEED}function sy(e){return iy(e)||e===I.SOLIDUS||e===I.GREATER_THAN_SIGN}function yP(e){return e===I.NULL?ne.nullCharacterReference:e>1114111?ne.characterReferenceOutsideUnicodeRange:ZE(e)?ne.surrogateCharacterReference:ty(e)?ne.noncharacterCharacterReference:ey(e)||e===I.CARRIAGE_RETURN?ne.controlCharacterReference:null}class TP{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=L.DATA,this.returnState=L.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new iP(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new fP(sP,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ne.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ne.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=yP(r);s&&this._err(s,1)}}:void 0)}_err(t,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:rt.START_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:rt.END_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:rt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:rt.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(ny(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(ne.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Qs(t.tagName),t.type===rt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(ne.endTagWithAttributes),t.selfClosing&&this._err(ne.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case rt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case rt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case rt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:rt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=iy(t)?rt.WHITESPACE_CHARACTER:t===I.NULL?rt.NULL_CHARACTER:rt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(rt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=L.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?qr.Attribute:qr.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===L.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===L.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===L.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case L.DATA:{this._stateData(t);break}case L.RCDATA:{this._stateRcdata(t);break}case L.RAWTEXT:{this._stateRawtext(t);break}case L.SCRIPT_DATA:{this._stateScriptData(t);break}case L.PLAINTEXT:{this._statePlaintext(t);break}case L.TAG_OPEN:{this._stateTagOpen(t);break}case L.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case L.TAG_NAME:{this._stateTagName(t);break}case L.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case L.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case L.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case L.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case L.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case L.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case L.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case L.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case L.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case L.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case L.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case L.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case L.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case L.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case L.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case L.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case L.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case L.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case L.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case L.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case L.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case L.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case L.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case L.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case L.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case L.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case L.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case L.BOGUS_COMMENT:{this._stateBogusComment(t);break}case L.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case L.COMMENT_START:{this._stateCommentStart(t);break}case L.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case L.COMMENT:{this._stateComment(t);break}case L.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case L.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case L.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case L.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case L.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case L.COMMENT_END:{this._stateCommentEnd(t);break}case L.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case L.DOCTYPE:{this._stateDoctype(t);break}case L.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case L.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case L.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case L.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case L.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case L.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case L.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case L.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case L.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case L.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case L.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case L.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case L.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case L.CDATA_SECTION:{this._stateCdataSection(t);break}case L.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case L.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case L.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case L.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case I.LESS_THAN_SIGN:{this.state=L.TAG_OPEN;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitCodePoint(t);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case I.AMPERSAND:{this._startCharacterReference();break}case I.LESS_THAN_SIGN:{this.state=L.RCDATA_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(kt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case I.LESS_THAN_SIGN:{this.state=L.RAWTEXT_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(kt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case I.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(kt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(kt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(gi(t))this._createStartTagToken(),this.state=L.TAG_NAME,this._stateTagName(t);else switch(t){case I.EXCLAMATION_MARK:{this.state=L.MARKUP_DECLARATION_OPEN;break}case I.SOLIDUS:{this.state=L.END_TAG_OPEN;break}case I.QUESTION_MARK:{this._err(ne.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=L.BOGUS_COMMENT,this._stateBogusComment(t);break}case I.EOF:{this._err(ne.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ne.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=L.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(gi(t))this._createEndTagToken(),this.state=L.TAG_NAME,this._stateTagName(t);else switch(t){case I.GREATER_THAN_SIGN:{this._err(ne.missingEndTagName),this.state=L.DATA;break}case I.EOF:{this._err(ne.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ne.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=L.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=L.BEFORE_ATTRIBUTE_NAME;break}case I.SOLIDUS:{this.state=L.SELF_CLOSING_START_TAG;break}case I.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentTagToken();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.tagName+=kt;break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(wa(t)?wl(t):t)}}_stateRcdataLessThanSign(t){t===I.SOLIDUS?this.state=L.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=L.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){gi(t)?(this.state=L.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=L.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=L.BEFORE_ATTRIBUTE_NAME,!1;case I.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=L.SELF_CLOSING_START_TAG,!1;case I.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=L.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=L.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===I.SOLIDUS?this.state=L.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=L.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){gi(t)?(this.state=L.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=L.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=L.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case I.SOLIDUS:{this.state=L.SCRIPT_DATA_END_TAG_OPEN;break}case I.EXCLAMATION_MARK:{this.state=L.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=L.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){gi(t)?(this.state=L.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=L.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=L.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===I.HYPHEN_MINUS?(this.state=L.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=L.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===I.HYPHEN_MINUS?(this.state=L.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=L.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case I.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(kt);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case I.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_ESCAPED,this._emitChars(kt);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case I.HYPHEN_MINUS:{this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.GREATER_THAN_SIGN:{this.state=L.SCRIPT_DATA,this._emitChars(">");break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_ESCAPED,this._emitChars(kt);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===I.SOLIDUS?this.state=L.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:gi(t)?(this._emitChars("<"),this.state=L.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){gi(t)?(this.state=L.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(In.SCRIPT,!1)&&sy(this.preprocessor.peek(In.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<In.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case I.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(kt);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case I.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(kt);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case I.HYPHEN_MINUS:{this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.GREATER_THAN_SIGN:{this.state=L.SCRIPT_DATA,this._emitChars(">");break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(kt);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===I.SOLIDUS?(this.state=L.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(In.SCRIPT,!1)&&sy(this.preprocessor.peek(In.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<In.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=L.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.SOLIDUS:case I.GREATER_THAN_SIGN:case I.EOF:{this.state=L.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case I.EQUALS_SIGN:{this._err(ne.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=L.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=L.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:case I.SOLIDUS:case I.GREATER_THAN_SIGN:case I.EOF:{this._leaveAttrName(),this.state=L.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case I.EQUALS_SIGN:{this._leaveAttrName(),this.state=L.BEFORE_ATTRIBUTE_VALUE;break}case I.QUOTATION_MARK:case I.APOSTROPHE:case I.LESS_THAN_SIGN:{this._err(ne.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.name+=kt;break}default:this.currentAttr.name+=String.fromCodePoint(wa(t)?wl(t):t)}}_stateAfterAttributeName(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.SOLIDUS:{this.state=L.SELF_CLOSING_START_TAG;break}case I.EQUALS_SIGN:{this.state=L.BEFORE_ATTRIBUTE_VALUE;break}case I.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=L.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{this.state=L.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this.state=L.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingAttributeValue),this.state=L.DATA,this.emitCurrentTagToken();break}default:this.state=L.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case I.QUOTATION_MARK:{this.state=L.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=kt;break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case I.APOSTROPHE:{this.state=L.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=kt;break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this._leaveAttrValue(),this.state=L.BEFORE_ATTRIBUTE_NAME;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=L.DATA,this.emitCurrentTagToken();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=kt;break}case I.QUOTATION_MARK:case I.APOSTROPHE:case I.LESS_THAN_SIGN:case I.EQUALS_SIGN:case I.GRAVE_ACCENT:{this._err(ne.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this._leaveAttrValue(),this.state=L.BEFORE_ATTRIBUTE_NAME;break}case I.SOLIDUS:{this._leaveAttrValue(),this.state=L.SELF_CLOSING_START_TAG;break}case I.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=L.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._err(ne.missingWhitespaceBetweenAttributes),this.state=L.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case I.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=L.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._err(ne.unexpectedSolidusInTag),this.state=L.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case I.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentComment(n);break}case I.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.data+=kt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(In.DASH_DASH,!0)?(this._createCommentToken(In.DASH_DASH.length+1),this.state=L.COMMENT_START):this._consumeSequenceIfMatch(In.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(In.DOCTYPE.length+1),this.state=L.DOCTYPE):this._consumeSequenceIfMatch(In.CDATA_START,!0)?this.inForeignNode?this.state=L.CDATA_SECTION:(this._err(ne.cdataInHtmlContent),this._createCommentToken(In.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=L.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ne.incorrectlyOpenedComment),this._createCommentToken(2),this.state=L.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case I.HYPHEN_MINUS:{this.state=L.COMMENT_START_DASH;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptClosingOfEmptyComment),this.state=L.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=L.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case I.HYPHEN_MINUS:{this.state=L.COMMENT_END;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptClosingOfEmptyComment),this.state=L.DATA,this.emitCurrentComment(n);break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=L.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case I.HYPHEN_MINUS:{this.state=L.COMMENT_END_DASH;break}case I.LESS_THAN_SIGN:{n.data+="<",this.state=L.COMMENT_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.data+=kt;break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case I.EXCLAMATION_MARK:{n.data+="!",this.state=L.COMMENT_LESS_THAN_SIGN_BANG;break}case I.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=L.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===I.HYPHEN_MINUS?this.state=L.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=L.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===I.HYPHEN_MINUS?this.state=L.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=L.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==I.GREATER_THAN_SIGN&&t!==I.EOF&&this._err(ne.nestedComment),this.state=L.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case I.HYPHEN_MINUS:{this.state=L.COMMENT_END;break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=L.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case I.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentComment(n);break}case I.EXCLAMATION_MARK:{this.state=L.COMMENT_END_BANG;break}case I.HYPHEN_MINUS:{n.data+="-";break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=L.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case I.HYPHEN_MINUS:{n.data+="--!",this.state=L.COMMENT_END_DASH;break}case I.GREATER_THAN_SIGN:{this._err(ne.incorrectlyClosedComment),this.state=L.DATA,this.emitCurrentComment(n);break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=L.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=L.BEFORE_DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this.state=L.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case I.EOF:{this._err(ne.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingWhitespaceBeforeDoctypeName),this.state=L.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(wa(t))this._createDoctypeToken(String.fromCharCode(wl(t))),this.state=L.DOCTYPE_NAME;else switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.NULL:{this._err(ne.unexpectedNullCharacter),this._createDoctypeToken(kt),this.state=L.DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=L.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=L.AFTER_DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentDoctype(n);break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.name+=kt;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(wa(t)?wl(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(In.PUBLIC,!1)?this.state=L.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(In.SYSTEM,!1)?this.state=L.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ne.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=L.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.QUOTATION_MARK:{this._err(ne.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(ne.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case I.QUOTATION_MARK:{this.state=L.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.publicId+=kt;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case I.APOSTROPHE:{this.state=L.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.publicId+=kt;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=L.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case I.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentDoctype(n);break}case I.QUOTATION_MARK:{this._err(ne.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(ne.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=L.DATA;break}case I.QUOTATION_MARK:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=L.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.QUOTATION_MARK:{this._err(ne.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(ne.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case I.QUOTATION_MARK:{this.state=L.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.systemId+=kt;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case I.APOSTROPHE:{this.state=L.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.systemId+=kt;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=L.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=L.DATA;break}case I.NULL:{this._err(ne.unexpectedNullCharacter);break}case I.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case I.RIGHT_SQUARE_BRACKET:{this.state=L.CDATA_SECTION_BRACKET;break}case I.EOF:{this._err(ne.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===I.RIGHT_SQUARE_BRACKET?this.state=L.CDATA_SECTION_END:(this._emitChars("]"),this.state=L.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case I.GREATER_THAN_SIGN:{this.state=L.DATA;break}case I.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=L.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(I.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&ry(this.preprocessor.peek(1))?L.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){ry(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===I.SEMICOLON&&this._err(ne.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const oy=new Set([g.DD,g.DT,g.LI,g.OPTGROUP,g.OPTION,g.P,g.RB,g.RP,g.RT,g.RTC]),ay=new Set([...oy,g.CAPTION,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]),_l=new Set([g.APPLET,g.CAPTION,g.HTML,g.MARQUEE,g.OBJECT,g.TABLE,g.TD,g.TEMPLATE,g.TH]),bP=new Set([..._l,g.OL,g.UL]),wP=new Set([..._l,g.BUTTON]),uy=new Set([g.ANNOTATION_XML,g.MI,g.MN,g.MO,g.MS,g.MTEXT]),ly=new Set([g.DESC,g.FOREIGN_OBJECT,g.TITLE]),_P=new Set([g.TR,g.TEMPLATE,g.HTML]),xP=new Set([g.TBODY,g.TFOOT,g.THEAD,g.TEMPLATE,g.HTML]),SP=new Set([g.TABLE,g.TEMPLATE,g.HTML]),vP=new Set([g.TD,g.TH]);class AP{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=g.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===g.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===me.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const s=this._indexOf(t)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==me.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(sh,me.HTML)}popUntilTableCellPopped(){this.popUntilPopped(vP,me.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(SP,me.HTML)}clearBackToTableBodyContext(){this.clearBackTo(xP,me.HTML)}clearBackToTableRowContext(){this.clearBackTo(_P,me.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===g.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===g.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case me.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case me.SVG:{if(ly.has(s))return!1;break}case me.MATHML:{if(uy.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,_l)}hasInListItemScope(t){return this.hasInDynamicScope(t,bP)}hasInButtonScope(t){return this.hasInDynamicScope(t,wP)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case me.HTML:{if(sh.has(n))return!0;if(_l.has(n))return!1;break}case me.SVG:{if(ly.has(n))return!1;break}case me.MATHML:{if(uy.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===me.HTML)switch(this.tagIDs[n]){case t:return!0;case g.TABLE:case g.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===me.HTML)switch(this.tagIDs[t]){case g.TBODY:case g.THEAD:case g.TFOOT:return!0;case g.TABLE:case g.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===me.HTML)switch(this.tagIDs[n]){case t:return!0;case g.OPTION:case g.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&oy.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&ay.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&ay.has(this.currentTagId);)this.pop()}}const oh=3;var kr;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(kr||(kr={}));const cy={type:kr.Marker};class kP{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],s=n.length,a=this.treeAdapter.getTagName(t),u=this.treeAdapter.getNamespaceURI(t);for(let l=0;l<this.entries.length;l++){const d=this.entries[l];if(d.type===kr.Marker)break;const{element:f}=d;if(this.treeAdapter.getTagName(f)===a&&this.treeAdapter.getNamespaceURI(f)===u){const m=this.treeAdapter.getAttrList(f);m.length===s&&r.push({idx:l,attrs:m})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<oh)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<oh)return;const s=new Map(n.map(u=>[u.name,u.value]));let a=0;for(let u=0;u<r.length;u++){const l=r[u];l.attrs.every(d=>s.get(d.name)===d.value)&&(a+=1,a>=oh&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(cy)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:kr.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:kr.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(cy);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===kr.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===kr.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===kr.Element&&n.element===t)}}const Ei={createDocument(){return{nodeName:"#document",mode:Qn.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const s=e.childNodes.find(a=>a.nodeName==="#documentType");if(s)s.name=t,s.publicId=n,s.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Ei.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Ei.isTextNode(n)){n.value+=t;return}}Ei.appendChild(e,Ei.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Ei.isTextNode(r)?r.value+=t:Ei.insertBefore(e,Ei.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation=j(j({},e.sourceCodeLocation),t)}},dy="html",CP="about:legacy-compat",NP="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",fy=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],OP=[...fy,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],IP=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),hy=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],PP=[...hy,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function py(e,t){return t.some(n=>e.startsWith(n))}function RP(e){return e.name===dy&&e.publicId===null&&(e.systemId===null||e.systemId===CP)}function LP(e){if(e.name!==dy)return Qn.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===NP)return Qn.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),IP.has(n))return Qn.QUIRKS;let r=t===null?OP:fy;if(py(n,r))return Qn.QUIRKS;if(r=t===null?hy:PP,py(n,r))return Qn.LIMITED_QUIRKS}return Qn.NO_QUIRKS}const my={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},DP="definitionurl",MP="definitionURL",FP=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),BP=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:me.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:me.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:me.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:me.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:me.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:me.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:me.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:me.XML}],["xml:space",{prefix:"xml",name:"space",namespace:me.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:me.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:me.XMLNS}]]),UP=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),HP=new Set([g.B,g.BIG,g.BLOCKQUOTE,g.BODY,g.BR,g.CENTER,g.CODE,g.DD,g.DIV,g.DL,g.DT,g.EM,g.EMBED,g.H1,g.H2,g.H3,g.H4,g.H5,g.H6,g.HEAD,g.HR,g.I,g.IMG,g.LI,g.LISTING,g.MENU,g.META,g.NOBR,g.OL,g.P,g.PRE,g.RUBY,g.S,g.SMALL,g.SPAN,g.STRONG,g.STRIKE,g.SUB,g.SUP,g.TABLE,g.TT,g.U,g.UL,g.VAR]);function jP(e){const t=e.tagID;return t===g.FONT&&e.attrs.some(({name:r})=>r===is.COLOR||r===is.SIZE||r===is.FACE)||HP.has(t)}function gy(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===DP){e.attrs[t].name=MP;break}}function Ey(e){for(let t=0;t<e.attrs.length;t++){const n=FP.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function ah(e){for(let t=0;t<e.attrs.length;t++){const n=BP.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function zP(e){const t=UP.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Qs(e.tagName))}function $P(e,t){return t===me.MATHML&&(e===g.MI||e===g.MO||e===g.MN||e===g.MS||e===g.MTEXT)}function VP(e,t,n){if(t===me.MATHML&&e===g.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===is.ENCODING){const s=n[r].value.toLowerCase();return s===my.TEXT_HTML||s===my.APPLICATION_XML}}return t===me.SVG&&(e===g.FOREIGN_OBJECT||e===g.DESC||e===g.TITLE)}function qP(e,t,n,r){return(!r||r===me.HTML)&&VP(e,t,n)||(!r||r===me.MATHML)&&$P(e,t)}const YP="hidden",WP=8,GP=3;var U;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(U||(U={}));const XP={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},yy=new Set([g.TABLE,g.TBODY,g.TFOOT,g.THEAD,g.TR]),Ty={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Ei,onParseError:null};class by{constructor(t,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=U.INITIAL,this.originalInsertionMode=U.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options=j(j({},Ty),t),this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n!=null?n:this.treeAdapter.createDocument(),this.tokenizer=new TP(this.options,this),this.activeFormattingElements=new kP(this.treeAdapter),this.fragmentContextID=r?Qs(this.treeAdapter.getTagName(r)):g.UNKNOWN,this._setContextModes(r!=null?r:this.document,this.fragmentContextID),this.openElements=new AP(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r=j(j({},Ty),n);t!=null||(t=r.treeAdapter.createElement(K.TEMPLATE,me.HTML,[]));const s=r.treeAdapter.createElement("documentmock",me.HTML,[]),a=new this(r,s,t);return a.fragmentContextID===g.TEMPLATE&&a.tmplInsertionModeStack.unshift(U.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var s;if(!this.onParseError)return;const a=(s=t.location)!==null&&s!==void 0?s:XP,u={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(u)}onItemPush(t,n,r){var s,a;(a=(s=this.treeAdapter).onItemPush)===null||a===void 0||a.call(s,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,t,this.openElements.current),n){let a,u;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,u=this.fragmentContextID):{current:a,currentTagId:u}=this.openElements,this._setContextModes(a,u)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===me.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,me.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=U.TEXT}switchToPlaintextParsing(){this.insertionMode=U.TEXT,this.originalInsertionMode=U.IN_BODY,this.tokenizer.state=Ut.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===K.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==me.HTML))switch(this.fragmentContextID){case g.TITLE:case g.TEXTAREA:{this.tokenizer.state=Ut.RCDATA;break}case g.STYLE:case g.XMP:case g.IFRAME:case g.NOEMBED:case g.NOFRAMES:case g.NOSCRIPT:{this.tokenizer.state=Ut.RAWTEXT;break}case g.SCRIPT:{this.tokenizer.state=Ut.SCRIPT_DATA;break}case g.PLAINTEXT:{this.tokenizer.state=Ut.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),t.location){const u=this.treeAdapter.getChildNodes(this.document).find(l=>this.treeAdapter.isDocumentTypeNode(l));u&&this.treeAdapter.setNodeSourceCodeLocation(u,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&ce(j({},n),{startTag:n});this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r!=null?r:this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,me.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,me.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(K.HTML,me.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,g.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const s=this.treeAdapter.getChildNodes(n),a=r?s.lastIndexOf(r):s.length,u=s[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(u)){const{endLine:d,endCol:f,endOffset:m}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(u,{endLine:d,endCol:f,endOffset:m})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(u,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(t),a=n.type===rt.END_TAG&&s===n.tagName?{endTag:j({},r),endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===g.SVG&&this.treeAdapter.getTagName(n)===K.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===me.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===g.MGLYPH||t.tagID===g.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,me.HTML)}_processToken(t){switch(t.type){case rt.CHARACTER:{this.onCharacter(t);break}case rt.NULL_CHARACTER:{this.onNullCharacter(t);break}case rt.COMMENT:{this.onComment(t);break}case rt.DOCTYPE:{this.onDoctype(t);break}case rt.START_TAG:{this._processStartTag(t);break}case rt.END_TAG:{this.onEndTag(t);break}case rt.EOF:{this.onEof(t);break}case rt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return qP(t,s,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===kr.Marker||this.openElements.contains(s.element)),r=n===-1?t-1:n-1;for(let s=r;s>=0;s--){const a=this.activeFormattingElements.entries[s];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=U.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(g.P),this.openElements.popUntilTagNamePopped(g.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case g.TR:{this.insertionMode=U.IN_ROW;return}case g.TBODY:case g.THEAD:case g.TFOOT:{this.insertionMode=U.IN_TABLE_BODY;return}case g.CAPTION:{this.insertionMode=U.IN_CAPTION;return}case g.COLGROUP:{this.insertionMode=U.IN_COLUMN_GROUP;return}case g.TABLE:{this.insertionMode=U.IN_TABLE;return}case g.BODY:{this.insertionMode=U.IN_BODY;return}case g.FRAMESET:{this.insertionMode=U.IN_FRAMESET;return}case g.SELECT:{this._resetInsertionModeForSelect(t);return}case g.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case g.HTML:{this.insertionMode=this.headElement?U.AFTER_HEAD:U.BEFORE_HEAD;return}case g.TD:case g.TH:{if(t>0){this.insertionMode=U.IN_CELL;return}break}case g.HEAD:{if(t>0){this.insertionMode=U.IN_HEAD;return}break}}this.insertionMode=U.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===g.TEMPLATE)break;if(r===g.TABLE){this.insertionMode=U.IN_SELECT_IN_TABLE;return}}this.insertionMode=U.IN_SELECT}_isElementCausesFosterParenting(t){return yy.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case g.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===me.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case g.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return mP[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){v6(this,t);return}switch(this.insertionMode){case U.INITIAL:{_a(this,t);break}case U.BEFORE_HTML:{xa(this,t);break}case U.BEFORE_HEAD:{Sa(this,t);break}case U.IN_HEAD:{va(this,t);break}case U.IN_HEAD_NO_SCRIPT:{Aa(this,t);break}case U.AFTER_HEAD:{ka(this,t);break}case U.IN_BODY:case U.IN_CAPTION:case U.IN_CELL:case U.IN_TEMPLATE:{_y(this,t);break}case U.TEXT:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:{dh(this,t);break}case U.IN_TABLE_TEXT:{Oy(this,t);break}case U.IN_COLUMN_GROUP:{vl(this,t);break}case U.AFTER_BODY:{Cl(this,t);break}case U.AFTER_AFTER_BODY:{Nl(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){S6(this,t);return}switch(this.insertionMode){case U.INITIAL:{_a(this,t);break}case U.BEFORE_HTML:{xa(this,t);break}case U.BEFORE_HEAD:{Sa(this,t);break}case U.IN_HEAD:{va(this,t);break}case U.IN_HEAD_NO_SCRIPT:{Aa(this,t);break}case U.AFTER_HEAD:{ka(this,t);break}case U.TEXT:{this._insertCharacters(t);break}case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:{dh(this,t);break}case U.IN_COLUMN_GROUP:{vl(this,t);break}case U.AFTER_BODY:{Cl(this,t);break}case U.AFTER_AFTER_BODY:{Nl(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){lh(this,t);return}switch(this.insertionMode){case U.INITIAL:case U.BEFORE_HTML:case U.BEFORE_HEAD:case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:case U.IN_BODY:case U.IN_TABLE:case U.IN_CAPTION:case U.IN_COLUMN_GROUP:case U.IN_TABLE_BODY:case U.IN_ROW:case U.IN_CELL:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:case U.IN_TEMPLATE:case U.IN_FRAMESET:case U.AFTER_FRAMESET:{lh(this,t);break}case U.IN_TABLE_TEXT:{Oa(this,t);break}case U.AFTER_BODY:{nR(this,t);break}case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:{rR(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case U.INITIAL:{iR(this,t);break}case U.BEFORE_HEAD:case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:{this._err(t,ne.misplacedDoctype);break}case U.IN_TABLE_TEXT:{Oa(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ne.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?A6(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case U.INITIAL:{_a(this,t);break}case U.BEFORE_HTML:{sR(this,t);break}case U.BEFORE_HEAD:{aR(this,t);break}case U.IN_HEAD:{dr(this,t);break}case U.IN_HEAD_NO_SCRIPT:{cR(this,t);break}case U.AFTER_HEAD:{fR(this,t);break}case U.IN_BODY:{fn(this,t);break}case U.IN_TABLE:{Js(this,t);break}case U.IN_TABLE_TEXT:{Oa(this,t);break}case U.IN_CAPTION:{u6(this,t);break}case U.IN_COLUMN_GROUP:{fh(this,t);break}case U.IN_TABLE_BODY:{Al(this,t);break}case U.IN_ROW:{kl(this,t);break}case U.IN_CELL:{d6(this,t);break}case U.IN_SELECT:{Ry(this,t);break}case U.IN_SELECT_IN_TABLE:{h6(this,t);break}case U.IN_TEMPLATE:{m6(this,t);break}case U.AFTER_BODY:{E6(this,t);break}case U.IN_FRAMESET:{y6(this,t);break}case U.AFTER_FRAMESET:{b6(this,t);break}case U.AFTER_AFTER_BODY:{_6(this,t);break}case U.AFTER_AFTER_FRAMESET:{x6(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?k6(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case U.INITIAL:{_a(this,t);break}case U.BEFORE_HTML:{oR(this,t);break}case U.BEFORE_HEAD:{uR(this,t);break}case U.IN_HEAD:{lR(this,t);break}case U.IN_HEAD_NO_SCRIPT:{dR(this,t);break}case U.AFTER_HEAD:{hR(this,t);break}case U.IN_BODY:{Sl(this,t);break}case U.TEXT:{JR(this,t);break}case U.IN_TABLE:{Ca(this,t);break}case U.IN_TABLE_TEXT:{Oa(this,t);break}case U.IN_CAPTION:{l6(this,t);break}case U.IN_COLUMN_GROUP:{c6(this,t);break}case U.IN_TABLE_BODY:{hh(this,t);break}case U.IN_ROW:{Py(this,t);break}case U.IN_CELL:{f6(this,t);break}case U.IN_SELECT:{Ly(this,t);break}case U.IN_SELECT_IN_TABLE:{p6(this,t);break}case U.IN_TEMPLATE:{g6(this,t);break}case U.AFTER_BODY:{My(this,t);break}case U.IN_FRAMESET:{T6(this,t);break}case U.AFTER_FRAMESET:{w6(this,t);break}case U.AFTER_AFTER_BODY:{Nl(this,t);break}}}onEof(t){switch(this.insertionMode){case U.INITIAL:{_a(this,t);break}case U.BEFORE_HTML:{xa(this,t);break}case U.BEFORE_HEAD:{Sa(this,t);break}case U.IN_HEAD:{va(this,t);break}case U.IN_HEAD_NO_SCRIPT:{Aa(this,t);break}case U.AFTER_HEAD:{ka(this,t);break}case U.IN_BODY:case U.IN_TABLE:case U.IN_CAPTION:case U.IN_COLUMN_GROUP:case U.IN_TABLE_BODY:case U.IN_ROW:case U.IN_CELL:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:{Cy(this,t);break}case U.TEXT:{ZR(this,t);break}case U.IN_TABLE_TEXT:{Oa(this,t);break}case U.IN_TEMPLATE:{Dy(this,t);break}case U.AFTER_BODY:case U.IN_FRAMESET:case U.AFTER_FRAMESET:case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:{ch(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===I.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:case U.TEXT:case U.IN_COLUMN_GROUP:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:case U.IN_FRAMESET:case U.AFTER_FRAMESET:{this._insertCharacters(t);break}case U.IN_BODY:case U.IN_CAPTION:case U.IN_CELL:case U.IN_TEMPLATE:case U.AFTER_BODY:case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:{wy(this,t);break}case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:{dh(this,t);break}case U.IN_TABLE_TEXT:{Ny(this,t);break}}}}function KP(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):ky(e,t),n}function QP(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const s=e.openElements.items[r];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[r])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function JP(e,t,n){let r=t,s=e.openElements.getCommonAncestor(t);for(let a=0,u=s;u!==n;a++,u=s){s=e.openElements.getCommonAncestor(u);const l=e.activeFormattingElements.getElementEntry(u),d=l&&a>=GP;!l||d?(d&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(u)):(u=ZP(e,l),r===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(u,r),r=u)}return r}function ZP(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function eR(e,t,n){const r=e.treeAdapter.getTagName(t),s=Qs(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);s===g.TEMPLATE&&a===me.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function tR(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,a=e.treeAdapter.createElement(s.tagName,r,s.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,s.tagID)}function uh(e,t){for(let n=0;n<WP;n++){const r=KP(e,t);if(!r)break;const s=QP(e,r);if(!s)break;e.activeFormattingElements.bookmark=r;const a=JP(e,s,r.element),u=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),u&&eR(e,u,a),tR(e,s,r)}}function lh(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function nR(e,t){e._appendCommentNode(t,e.openElements.items[0])}function rR(e,t){e._appendCommentNode(t,e.document)}function ch(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],u=e.treeAdapter.getNodeSourceCodeLocation(a);u&&!u.endTag&&e._setEndLocation(a,t)}}}}function iR(e,t){e._setDocumentType(t);const n=t.forceQuirks?Qn.QUIRKS:LP(t);RP(t)||e._err(t,ne.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=U.BEFORE_HTML}function _a(e,t){e._err(t,ne.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Qn.QUIRKS),e.insertionMode=U.BEFORE_HTML,e._processToken(t)}function sR(e,t){t.tagID===g.HTML?(e._insertElement(t,me.HTML),e.insertionMode=U.BEFORE_HEAD):xa(e,t)}function oR(e,t){const n=t.tagID;(n===g.HTML||n===g.HEAD||n===g.BODY||n===g.BR)&&xa(e,t)}function xa(e,t){e._insertFakeRootElement(),e.insertionMode=U.BEFORE_HEAD,e._processToken(t)}function aR(e,t){switch(t.tagID){case g.HTML:{fn(e,t);break}case g.HEAD:{e._insertElement(t,me.HTML),e.headElement=e.openElements.current,e.insertionMode=U.IN_HEAD;break}default:Sa(e,t)}}function uR(e,t){const n=t.tagID;n===g.HEAD||n===g.BODY||n===g.HTML||n===g.BR?Sa(e,t):e._err(t,ne.endTagWithoutMatchingOpenElement)}function Sa(e,t){e._insertFakeElement(K.HEAD,g.HEAD),e.headElement=e.openElements.current,e.insertionMode=U.IN_HEAD,e._processToken(t)}function dr(e,t){switch(t.tagID){case g.HTML:{fn(e,t);break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:{e._appendElement(t,me.HTML),t.ackSelfClosing=!0;break}case g.TITLE:{e._switchToTextParsing(t,Ut.RCDATA);break}case g.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Ut.RAWTEXT):(e._insertElement(t,me.HTML),e.insertionMode=U.IN_HEAD_NO_SCRIPT);break}case g.NOFRAMES:case g.STYLE:{e._switchToTextParsing(t,Ut.RAWTEXT);break}case g.SCRIPT:{e._switchToTextParsing(t,Ut.SCRIPT_DATA);break}case g.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=U.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(U.IN_TEMPLATE);break}case g.HEAD:{e._err(t,ne.misplacedStartTagForHeadElement);break}default:va(e,t)}}function lR(e,t){switch(t.tagID){case g.HEAD:{e.openElements.pop(),e.insertionMode=U.AFTER_HEAD;break}case g.BODY:case g.BR:case g.HTML:{va(e,t);break}case g.TEMPLATE:{ss(e,t);break}default:e._err(t,ne.endTagWithoutMatchingOpenElement)}}function ss(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==g.TEMPLATE&&e._err(t,ne.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ne.endTagWithoutMatchingOpenElement)}function va(e,t){e.openElements.pop(),e.insertionMode=U.AFTER_HEAD,e._processToken(t)}function cR(e,t){switch(t.tagID){case g.HTML:{fn(e,t);break}case g.BASEFONT:case g.BGSOUND:case g.HEAD:case g.LINK:case g.META:case g.NOFRAMES:case g.STYLE:{dr(e,t);break}case g.NOSCRIPT:{e._err(t,ne.nestedNoscriptInHead);break}default:Aa(e,t)}}function dR(e,t){switch(t.tagID){case g.NOSCRIPT:{e.openElements.pop(),e.insertionMode=U.IN_HEAD;break}case g.BR:{Aa(e,t);break}default:e._err(t,ne.endTagWithoutMatchingOpenElement)}}function Aa(e,t){const n=t.type===rt.EOF?ne.openElementsLeftAfterEof:ne.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=U.IN_HEAD,e._processToken(t)}function fR(e,t){switch(t.tagID){case g.HTML:{fn(e,t);break}case g.BODY:{e._insertElement(t,me.HTML),e.framesetOk=!1,e.insertionMode=U.IN_BODY;break}case g.FRAMESET:{e._insertElement(t,me.HTML),e.insertionMode=U.IN_FRAMESET;break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:case g.NOFRAMES:case g.SCRIPT:case g.STYLE:case g.TEMPLATE:case g.TITLE:{e._err(t,ne.abandonedHeadElementChild),e.openElements.push(e.headElement,g.HEAD),dr(e,t),e.openElements.remove(e.headElement);break}case g.HEAD:{e._err(t,ne.misplacedStartTagForHeadElement);break}default:ka(e,t)}}function hR(e,t){switch(t.tagID){case g.BODY:case g.HTML:case g.BR:{ka(e,t);break}case g.TEMPLATE:{ss(e,t);break}default:e._err(t,ne.endTagWithoutMatchingOpenElement)}}function ka(e,t){e._insertFakeElement(K.BODY,g.BODY),e.insertionMode=U.IN_BODY,xl(e,t)}function xl(e,t){switch(t.type){case rt.CHARACTER:{_y(e,t);break}case rt.WHITESPACE_CHARACTER:{wy(e,t);break}case rt.COMMENT:{lh(e,t);break}case rt.START_TAG:{fn(e,t);break}case rt.END_TAG:{Sl(e,t);break}case rt.EOF:{Cy(e,t);break}}}function wy(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function _y(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function pR(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function mR(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function gR(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,me.HTML),e.insertionMode=U.IN_FRAMESET)}function ER(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,me.HTML)}function yR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&sh.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,me.HTML)}function TR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,me.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function bR(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,me.HTML),n||(e.formElement=e.openElements.current))}function wR(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const s=e.openElements.tagIDs[r];if(n===g.LI&&s===g.LI||(n===g.DD||n===g.DT)&&(s===g.DD||s===g.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==g.ADDRESS&&s!==g.DIV&&s!==g.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,me.HTML)}function _R(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,me.HTML),e.tokenizer.state=Ut.PLAINTEXT}function xR(e,t){e.openElements.hasInScope(g.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,me.HTML),e.framesetOk=!1}function SR(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(K.A);n&&(uh(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,me.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function vR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,me.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function AR(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(g.NOBR)&&(uh(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,me.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function kR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,me.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function CR(e,t){e.treeAdapter.getDocumentMode(e.document)!==Qn.QUIRKS&&e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,me.HTML),e.framesetOk=!1,e.insertionMode=U.IN_TABLE}function xy(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,me.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Sy(e){const t=ny(e,is.TYPE);return t!=null&&t.toLowerCase()===YP}function NR(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,me.HTML),Sy(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function OR(e,t){e._appendElement(t,me.HTML),t.ackSelfClosing=!0}function IR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._appendElement(t,me.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function PR(e,t){t.tagName=K.IMG,t.tagID=g.IMG,xy(e,t)}function RR(e,t){e._insertElement(t,me.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Ut.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=U.TEXT}function LR(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Ut.RAWTEXT)}function DR(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Ut.RAWTEXT)}function vy(e,t){e._switchToTextParsing(t,Ut.RAWTEXT)}function MR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,me.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===U.IN_TABLE||e.insertionMode===U.IN_CAPTION||e.insertionMode===U.IN_TABLE_BODY||e.insertionMode===U.IN_ROW||e.insertionMode===U.IN_CELL?U.IN_SELECT_IN_TABLE:U.IN_SELECT}function FR(e,t){e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,me.HTML)}function BR(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,me.HTML)}function UR(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(g.RTC),e._insertElement(t,me.HTML)}function HR(e,t){e._reconstructActiveFormattingElements(),gy(t),ah(t),t.selfClosing?e._appendElement(t,me.MATHML):e._insertElement(t,me.MATHML),t.ackSelfClosing=!0}function jR(e,t){e._reconstructActiveFormattingElements(),Ey(t),ah(t),t.selfClosing?e._appendElement(t,me.SVG):e._insertElement(t,me.SVG),t.ackSelfClosing=!0}function Ay(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,me.HTML)}function fn(e,t){switch(t.tagID){case g.I:case g.S:case g.B:case g.U:case g.EM:case g.TT:case g.BIG:case g.CODE:case g.FONT:case g.SMALL:case g.STRIKE:case g.STRONG:{vR(e,t);break}case g.A:{SR(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{yR(e,t);break}case g.P:case g.DL:case g.OL:case g.UL:case g.DIV:case g.DIR:case g.NAV:case g.MAIN:case g.MENU:case g.ASIDE:case g.CENTER:case g.FIGURE:case g.FOOTER:case g.HEADER:case g.HGROUP:case g.DIALOG:case g.DETAILS:case g.ADDRESS:case g.ARTICLE:case g.SEARCH:case g.SECTION:case g.SUMMARY:case g.FIELDSET:case g.BLOCKQUOTE:case g.FIGCAPTION:{ER(e,t);break}case g.LI:case g.DD:case g.DT:{wR(e,t);break}case g.BR:case g.IMG:case g.WBR:case g.AREA:case g.EMBED:case g.KEYGEN:{xy(e,t);break}case g.HR:{IR(e,t);break}case g.RB:case g.RTC:{BR(e,t);break}case g.RT:case g.RP:{UR(e,t);break}case g.PRE:case g.LISTING:{TR(e,t);break}case g.XMP:{LR(e,t);break}case g.SVG:{jR(e,t);break}case g.HTML:{pR(e,t);break}case g.BASE:case g.LINK:case g.META:case g.STYLE:case g.TITLE:case g.SCRIPT:case g.BGSOUND:case g.BASEFONT:case g.TEMPLATE:{dr(e,t);break}case g.BODY:{mR(e,t);break}case g.FORM:{bR(e,t);break}case g.NOBR:{AR(e,t);break}case g.MATH:{HR(e,t);break}case g.TABLE:{CR(e,t);break}case g.INPUT:{NR(e,t);break}case g.PARAM:case g.TRACK:case g.SOURCE:{OR(e,t);break}case g.IMAGE:{PR(e,t);break}case g.BUTTON:{xR(e,t);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{kR(e,t);break}case g.IFRAME:{DR(e,t);break}case g.SELECT:{MR(e,t);break}case g.OPTION:case g.OPTGROUP:{FR(e,t);break}case g.NOEMBED:case g.NOFRAMES:{vy(e,t);break}case g.FRAMESET:{gR(e,t);break}case g.TEXTAREA:{RR(e,t);break}case g.NOSCRIPT:{e.options.scriptingEnabled?vy(e,t):Ay(e,t);break}case g.PLAINTEXT:{_R(e,t);break}case g.COL:case g.TH:case g.TD:case g.TR:case g.HEAD:case g.FRAME:case g.TBODY:case g.TFOOT:case g.THEAD:case g.CAPTION:case g.COLGROUP:break;default:Ay(e,t)}}function zR(e,t){if(e.openElements.hasInScope(g.BODY)&&(e.insertionMode=U.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function $R(e,t){e.openElements.hasInScope(g.BODY)&&(e.insertionMode=U.AFTER_BODY,My(e,t))}function VR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function qR(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(g.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(g.FORM):n&&e.openElements.remove(n))}function YR(e){e.openElements.hasInButtonScope(g.P)||e._insertFakeElement(K.P,g.P),e._closePElement()}function WR(e){e.openElements.hasInListItemScope(g.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(g.LI),e.openElements.popUntilTagNamePopped(g.LI))}function GR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function XR(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function KR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function QR(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(K.BR,g.BR),e.openElements.pop(),e.framesetOk=!1}function ky(e,t){const n=t.tagName,r=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){const a=e.openElements.items[s],u=e.openElements.tagIDs[s];if(r===u&&(r!==g.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(a,u))break}}function Sl(e,t){switch(t.tagID){case g.A:case g.B:case g.I:case g.S:case g.U:case g.EM:case g.TT:case g.BIG:case g.CODE:case g.FONT:case g.NOBR:case g.SMALL:case g.STRIKE:case g.STRONG:{uh(e,t);break}case g.P:{YR(e);break}case g.DL:case g.UL:case g.OL:case g.DIR:case g.DIV:case g.NAV:case g.PRE:case g.MAIN:case g.MENU:case g.ASIDE:case g.BUTTON:case g.CENTER:case g.FIGURE:case g.FOOTER:case g.HEADER:case g.HGROUP:case g.DIALOG:case g.ADDRESS:case g.ARTICLE:case g.DETAILS:case g.SEARCH:case g.SECTION:case g.SUMMARY:case g.LISTING:case g.FIELDSET:case g.BLOCKQUOTE:case g.FIGCAPTION:{VR(e,t);break}case g.LI:{WR(e);break}case g.DD:case g.DT:{GR(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{XR(e);break}case g.BR:{QR(e);break}case g.BODY:{zR(e,t);break}case g.HTML:{$R(e,t);break}case g.FORM:{qR(e);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{KR(e,t);break}case g.TEMPLATE:{ss(e,t);break}default:ky(e,t)}}function Cy(e,t){e.tmplInsertionModeStack.length>0?Dy(e,t):ch(e,t)}function JR(e,t){var n;t.tagID===g.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function ZR(e,t){e._err(t,ne.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function dh(e,t){if(e.openElements.currentTagId!==void 0&&yy.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=U.IN_TABLE_TEXT,t.type){case rt.CHARACTER:{Oy(e,t);break}case rt.WHITESPACE_CHARACTER:{Ny(e,t);break}}else Na(e,t)}function e6(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,me.HTML),e.insertionMode=U.IN_CAPTION}function t6(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,me.HTML),e.insertionMode=U.IN_COLUMN_GROUP}function n6(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(K.COLGROUP,g.COLGROUP),e.insertionMode=U.IN_COLUMN_GROUP,fh(e,t)}function r6(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,me.HTML),e.insertionMode=U.IN_TABLE_BODY}function i6(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(K.TBODY,g.TBODY),e.insertionMode=U.IN_TABLE_BODY,Al(e,t)}function s6(e,t){e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function o6(e,t){Sy(t)?e._appendElement(t,me.HTML):Na(e,t),t.ackSelfClosing=!0}function a6(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,me.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Js(e,t){switch(t.tagID){case g.TD:case g.TH:case g.TR:{i6(e,t);break}case g.STYLE:case g.SCRIPT:case g.TEMPLATE:{dr(e,t);break}case g.COL:{n6(e,t);break}case g.FORM:{a6(e,t);break}case g.TABLE:{s6(e,t);break}case g.TBODY:case g.TFOOT:case g.THEAD:{r6(e,t);break}case g.INPUT:{o6(e,t);break}case g.CAPTION:{e6(e,t);break}case g.COLGROUP:{t6(e,t);break}default:Na(e,t)}}function Ca(e,t){switch(t.tagID){case g.TABLE:{e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode());break}case g.TEMPLATE:{ss(e,t);break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TBODY:case g.TD:case g.TFOOT:case g.TH:case g.THEAD:case g.TR:break;default:Na(e,t)}}function Na(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,xl(e,t),e.fosterParentingEnabled=n}function Ny(e,t){e.pendingCharacterTokens.push(t)}function Oy(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Oa(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Na(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const Iy=new Set([g.CAPTION,g.COL,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]);function u6(e,t){const n=t.tagID;Iy.has(n)?e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_TABLE,Js(e,t)):fn(e,t)}function l6(e,t){const n=t.tagID;switch(n){case g.CAPTION:case g.TABLE:{e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_TABLE,n===g.TABLE&&Ca(e,t));break}case g.BODY:case g.COL:case g.COLGROUP:case g.HTML:case g.TBODY:case g.TD:case g.TFOOT:case g.TH:case g.THEAD:case g.TR:break;default:Sl(e,t)}}function fh(e,t){switch(t.tagID){case g.HTML:{fn(e,t);break}case g.COL:{e._appendElement(t,me.HTML),t.ackSelfClosing=!0;break}case g.TEMPLATE:{dr(e,t);break}default:vl(e,t)}}function c6(e,t){switch(t.tagID){case g.COLGROUP:{e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=U.IN_TABLE);break}case g.TEMPLATE:{ss(e,t);break}case g.COL:break;default:vl(e,t)}}function vl(e,t){e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=U.IN_TABLE,e._processToken(t))}function Al(e,t){switch(t.tagID){case g.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,me.HTML),e.insertionMode=U.IN_ROW;break}case g.TH:case g.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(K.TR,g.TR),e.insertionMode=U.IN_ROW,kl(e,t);break}case g.CAPTION:case g.COL:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE,Js(e,t));break}default:Js(e,t)}}function hh(e,t){const n=t.tagID;switch(t.tagID){case g.TBODY:case g.TFOOT:case g.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE);break}case g.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE,Ca(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TD:case g.TH:case g.TR:break;default:Ca(e,t)}}function kl(e,t){switch(t.tagID){case g.TH:case g.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,me.HTML),e.insertionMode=U.IN_CELL,e.activeFormattingElements.insertMarker();break}case g.CAPTION:case g.COL:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,Al(e,t));break}default:Js(e,t)}}function Py(e,t){switch(t.tagID){case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY);break}case g.TABLE:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,hh(e,t));break}case g.TBODY:case g.TFOOT:case g.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(g.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,hh(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TD:case g.TH:break;default:Ca(e,t)}}function d6(e,t){const n=t.tagID;Iy.has(n)?(e.openElements.hasInTableScope(g.TD)||e.openElements.hasInTableScope(g.TH))&&(e._closeTableCell(),kl(e,t)):fn(e,t)}function f6(e,t){const n=t.tagID;switch(n){case g.TD:case g.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_ROW);break}case g.TABLE:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),Py(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:break;default:Sl(e,t)}}function Ry(e,t){switch(t.tagID){case g.HTML:{fn(e,t);break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._insertElement(t,me.HTML);break}case g.OPTGROUP:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._insertElement(t,me.HTML);break}case g.HR:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._appendElement(t,me.HTML),t.ackSelfClosing=!0;break}case g.INPUT:case g.KEYGEN:case g.TEXTAREA:case g.SELECT:{e.openElements.hasInSelectScope(g.SELECT)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),t.tagID!==g.SELECT&&e._processStartTag(t));break}case g.SCRIPT:case g.TEMPLATE:{dr(e,t);break}}}function Ly(e,t){switch(t.tagID){case g.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===g.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===g.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop();break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop();break}case g.SELECT:{e.openElements.hasInSelectScope(g.SELECT)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode());break}case g.TEMPLATE:{ss(e,t);break}}}function h6(e,t){const n=t.tagID;n===g.CAPTION||n===g.TABLE||n===g.TBODY||n===g.TFOOT||n===g.THEAD||n===g.TR||n===g.TD||n===g.TH?(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Ry(e,t)}function p6(e,t){const n=t.tagID;n===g.CAPTION||n===g.TABLE||n===g.TBODY||n===g.TFOOT||n===g.THEAD||n===g.TR||n===g.TD||n===g.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Ly(e,t)}function m6(e,t){switch(t.tagID){case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:case g.NOFRAMES:case g.SCRIPT:case g.STYLE:case g.TEMPLATE:case g.TITLE:{dr(e,t);break}case g.CAPTION:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.tmplInsertionModeStack[0]=U.IN_TABLE,e.insertionMode=U.IN_TABLE,Js(e,t);break}case g.COL:{e.tmplInsertionModeStack[0]=U.IN_COLUMN_GROUP,e.insertionMode=U.IN_COLUMN_GROUP,fh(e,t);break}case g.TR:{e.tmplInsertionModeStack[0]=U.IN_TABLE_BODY,e.insertionMode=U.IN_TABLE_BODY,Al(e,t);break}case g.TD:case g.TH:{e.tmplInsertionModeStack[0]=U.IN_ROW,e.insertionMode=U.IN_ROW,kl(e,t);break}default:e.tmplInsertionModeStack[0]=U.IN_BODY,e.insertionMode=U.IN_BODY,fn(e,t)}}function g6(e,t){t.tagID===g.TEMPLATE&&ss(e,t)}function Dy(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):ch(e,t)}function E6(e,t){t.tagID===g.HTML?fn(e,t):Cl(e,t)}function My(e,t){var n;if(t.tagID===g.HTML){if(e.fragmentContext||(e.insertionMode=U.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===g.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else Cl(e,t)}function Cl(e,t){e.insertionMode=U.IN_BODY,xl(e,t)}function y6(e,t){switch(t.tagID){case g.HTML:{fn(e,t);break}case g.FRAMESET:{e._insertElement(t,me.HTML);break}case g.FRAME:{e._appendElement(t,me.HTML),t.ackSelfClosing=!0;break}case g.NOFRAMES:{dr(e,t);break}}}function T6(e,t){t.tagID===g.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==g.FRAMESET&&(e.insertionMode=U.AFTER_FRAMESET))}function b6(e,t){switch(t.tagID){case g.HTML:{fn(e,t);break}case g.NOFRAMES:{dr(e,t);break}}}function w6(e,t){t.tagID===g.HTML&&(e.insertionMode=U.AFTER_AFTER_FRAMESET)}function _6(e,t){t.tagID===g.HTML?fn(e,t):Nl(e,t)}function Nl(e,t){e.insertionMode=U.IN_BODY,xl(e,t)}function x6(e,t){switch(t.tagID){case g.HTML:{fn(e,t);break}case g.NOFRAMES:{dr(e,t);break}}}function S6(e,t){t.chars=kt,e._insertCharacters(t)}function v6(e,t){e._insertCharacters(t),e.framesetOk=!1}function Fy(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==me.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function A6(e,t){if(jP(t))Fy(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===me.MATHML?gy(t):r===me.SVG&&(zP(t),Ey(t)),ah(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function k6(e,t){if(t.tagID===g.P||t.tagID===g.BR){Fy(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===me.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}K.AREA,K.BASE,K.BASEFONT,K.BGSOUND,K.BR,K.COL,K.EMBED,K.FRAME,K.HR,K.IMG,K.INPUT,K.KEYGEN,K.LINK,K.META,K.PARAM,K.SOURCE,K.TRACK,K.WBR;const C6=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,N6=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),By={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Uy(e,t){const n=U6(e),r=QE("type",{handlers:{root:O6,element:I6,text:P6,comment:jy,doctype:R6,raw:D6},unknown:M6}),s={parser:n?new by(By):by.getFragmentParser(void 0,By),handle(l){r(l,s)},stitches:!1,options:t||{}};r(e,s),Zs(s,vr());const a=n?s.parser.document:s.parser.getFragment(),u=HI(a,{file:s.options.file});return s.stitches&&yl(u,"comment",function(l,d,f){const m=l;if(m.value.stitch&&f&&d!==void 0){const p=f.children;return p[d]=m.value.stitch,d}}),u.type==="root"&&u.children.length===1&&u.children[0].type===e.type?u.children[0]:u}function Hy(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function O6(e,t){Hy(e.children,t)}function I6(e,t){F6(e,t),Hy(e.children,t),B6(e,t)}function P6(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:rt.CHARACTER,chars:e.value,location:Ia(e)};Zs(t,vr(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function R6(e,t){const n={type:rt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Ia(e)};Zs(t,vr(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function L6(e,t){t.stitches=!0;const n=H6(e);if("children"in e&&"children"in n){const r=Uy({type:"root",children:e.children},t.options);n.children=r.children}jy({type:"comment",value:{stitch:n}},t)}function jy(e,t){const n=e.value,r={type:rt.COMMENT,data:n,location:Ia(e)};Zs(t,vr(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function D6(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,zy(t,vr(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(C6,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function M6(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))L6(n,t);else{let r="";throw N6.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Zs(e,t){zy(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Ut.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function zy(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function F6(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Ut.PLAINTEXT)return;Zs(t,vr(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:rs.html;s===rs.html&&n==="svg"&&(s=rs.svg);const a=qI(ce(j({},e),{children:[]}),{space:s===rs.svg?"svg":"html"}),u={type:rt.START_TAG,tagName:n,tagID:Qs(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:Ia(e)};t.parser.currentToken=u,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function B6(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&ZI.includes(n)||t.parser.tokenizer.state===Ut.PLAINTEXT)return;Zs(t,al(e));const r={type:rt.END_TAG,tagName:n,tagID:Qs(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Ia(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Ut.RCDATA||t.parser.tokenizer.state===Ut.RAWTEXT||t.parser.tokenizer.state===Ut.SCRIPT_DATA)&&(t.parser.tokenizer.state=Ut.DATA)}function U6(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Ia(e){const t=vr(e)||{line:void 0,column:void 0,offset:void 0},n=al(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function H6(e){return"children"in e?ns(ce(j({},e),{children:[]})):ns(e)}function $y(e){return function(t,n){return Uy(t,ce(j({},e),{file:n}))}}const os=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Vy={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...os,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...os],h2:[["className","sr-only"]],img:[...os,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...os,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...os],table:[...os],ul:[...os,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},yi={}.hasOwnProperty;function j6(e,t){let n={type:"root",children:[]};const r={schema:t?j(j({},Vy),t):Vy,stack:[]},s=qy(r,e);return s&&(Array.isArray(s)?s.length===1?n=s[0]:n.children=s:n=s),n}function qy(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return z6(e,n);case"doctype":return $6(e,n);case"element":return V6(e,n);case"root":return q6(e,n);case"text":return Y6(e,n)}}}function z6(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),a={type:"comment",value:r<0?n:n.slice(0,r)};return Pa(a,t),a}}function $6(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Pa(n,t),n}}function V6(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=Yy(e,t.children),s=W6(e,t.properties);e.stack.pop();let a=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&yi.call(e.schema.ancestors,n))){const l=e.schema.ancestors[n];let d=-1;for(a=!1;++d<l.length;)e.stack.includes(l[d])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const u={type:"element",tagName:n,properties:s,children:r};return Pa(u,t),u}function q6(e,t){const r={type:"root",children:Yy(e,t.children)};return Pa(r,t),r}function Y6(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Pa(r,t),r}function Yy(e,t){const n=[];if(Array.isArray(t)){const r=t;let s=-1;for(;++s<r.length;){const a=qy(e,r[s]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function W6(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,s=e.schema.required,a=r&&yi.call(r,n)?r[n]:void 0,u=r&&yi.call(r,"*")?r["*"]:void 0,l=t&&typeof t=="object"?t:{},d={};let f;for(f in l)if(yi.call(l,f)){const m=l[f];let p=Wy(e,Xy(a,f),f,m);p==null&&(p=Wy(e,Xy(u,f),f,m)),p!=null&&(d[f]=p)}if(s&&yi.call(s,n)){const m=s[n];for(f in m)yi.call(m,f)&&!yi.call(d,f)&&(d[f]=m[f])}return d}function Wy(e,t,n,r){return t?Array.isArray(r)?G6(e,t,n,r):Gy(e,t,n,r):void 0}function G6(e,t,n,r){let s=-1;const a=[];for(;++s<r.length;){const u=Gy(e,t,n,r[s]);(typeof u=="number"||typeof u=="string")&&a.push(u)}return a}function Gy(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&X6(e,n,r)){if(typeof t=="object"&&t.length>1){let s=!1,a=0;for(;++a<t.length;){const u=t[a];if(u&&typeof u=="object"&&"flags"in u){if(u.test(String(r))){s=!0;break}}else if(u===r){s=!0;break}}if(!s)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function X6(e,t,n){const r=e.schema.protocols&&yi.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const s=String(n),a=s.indexOf(":"),u=s.indexOf("?"),l=s.indexOf("#"),d=s.indexOf("/");if(a<0||d>-1&&a>d||u>-1&&a>u||l>-1&&a>l)return!0;let f=-1;for(;++f<r.length;){const m=r[f];if(a===m.length&&s.slice(0,m.length)===m)return!0}return!1}function Pa(e,t){const n=H1(t);t.data&&(e.data=ns(t.data)),n&&(e.position=n)}function Xy(e,t){let n,r=-1;if(e)for(;++r<e.length;){const s=e[r],a=typeof s=="string"?s:s[0];if(a===t)return s;a==="data*"&&(n=s)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function K6(e){return function(t){return j6(t,e)}}const Ky=({globalClassName:e,openLinksInNewTab:t,href:n,title:r,children:s})=>{const a=n?t?"_blank":"_self":void 0;return w.jsx("a",ce(j(j({className:B(e,`${N}-link`)},n?{href:n,target:a}:{}),r?{title:r}:{}),{rel:"noopener noreferrer",children:s}))},Q6=()=>{const{disclaimerText:e,disclaimerMarkdown:t,globalClassName:n}=ft();return!e&&!t?null:w.jsx("div",{className:B(n,`${N}-disclaimer`),children:t?w.jsx(zE,{rehypePlugins:[$y,K6],components:{ul:({children:r})=>w.jsx("ul",{className:B(n,`${N}-ul`),children:r}),ol:({children:r})=>w.jsx("ol",{className:B(n,`${N}-ol`),children:r}),li:({children:r})=>w.jsx("li",{className:B(n,`${N}-li`),children:r}),a:({href:r,title:s,children:a})=>w.jsx(Ky,{globalClassName:n,openLinksInNewTab:!0,href:r,title:s,children:a}),img:({src:r,alt:s})=>w.jsx("img",{className:B(n,`${N}-disclaimer-image`),src:r,alt:s}),p:({children:r})=>w.jsx("p",{className:B(n,`${N}-disclaimer-text`),children:r}),span:({children:r})=>w.jsx("span",{className:B(n,`${N}-disclaimer-text-span`),children:r})},children:t}):w.jsx("p",{className:B(n,`${N}-disclaimer-text`),children:e})})},ph=({className:e,isLoading:t,componentType:n,onSubmit:r})=>{const{isConnected:s,sessionExpired:a,canInitialize:u,messages:l}=Cn(),{globalClassName:d,searchConfig:f,enableEscalationToAgent:m}=ft(),p=R.useRef(null),b=R.useRef(l);b.current=l;const y=t||!Hg(s,a,u),_=R.useRef(t);R.useEffect(()=>{var C;const S=_.current&&!t;_.current=t,S&&!y&&((C=p.current)==null||C.focus({preventScroll:!0}))},[t,y]);const x=S=>Be(null,null,function*(){var O,z;S.preventDefault();const C=(((O=p.current)==null?void 0:O.value)||"").trim();if(C){const G=!s&&!a&&u===!0,M=b.current.length;p.current.value="";const V=yield r(C);G&&V.outcome!=="success"&&b.current.length===M&&((z=p.current)==null?void 0:z.value)===""&&(p.current.value=C,p.current.disabled||p.current.focus({preventScroll:!0}))}}),A=()=>{r("Can you connect me to a human?")};return w.jsxs("div",{className:B(d,e,`cim-${n}-component`,`${N}-search-bar-wrapper`),children:[w.jsxs("form",{className:B(d,e,`cim-${n}-component`,`${N}-search-bar`),name:`${N}-search-form`,onSubmit:x,children:[w.jsx("input",{className:B(d,e,`cim-${n}-component`,`${N}-search-input`),type:"text",ref:p,placeholder:(f==null?void 0:f.placeholder)||"Ask us anything",name:`${N}-user-input`,disabled:y}),w.jsx(NC,{className:e,globalClassName:d,searchConfig:f,componentType:n,isLoading:y}),m&&w.jsx(lr,{className:B(d,`${N}-escalate-btn`),ariaLabel:"Connect to a human agent",title:"Connect to a human agent",disabled:y,onClick:A,icon:w.jsx(yC,{})})]}),w.jsx(Q6,{})]})};function J6(e){return ht({attr:{version:"1.1",viewBox:"0 0 17 17"},child:[{tag:"g",attr:{},child:[]},{tag:"path",attr:{d:"M17 16v1h-17v-1h17zM13.354 8.854l-0.707-0.707-3.646 3.646v-11.793h-1v11.794l-3.647-3.648-0.708 0.708 4.854 4.853 4.854-4.853z"},child:[]}]})(e)}function Z6(e){return ht({attr:{version:"1.1",viewBox:"0 0 17 17"},child:[{tag:"g",attr:{},child:[]},{tag:"path",attr:{d:"M6 8h-6v-6h1v4.109c1.013-3.193 4.036-5.484 7.5-5.484 3.506 0 6.621 2.36 7.574 5.739l-0.963 0.271c-0.832-2.95-3.551-5.011-6.611-5.011-3.226 0.001-6.016 2.276-6.708 5.376h4.208v1zM11 9v1h4.208c-0.693 3.101-3.479 5.375-6.708 5.375-3.062 0-5.78-2.061-6.611-5.011l-0.963 0.271c0.952 3.379 4.067 5.739 7.574 5.739 3.459 0 6.475-2.28 7.5-5.482v4.108h1v-6h-6z"},child:[]}]})(e)}const Qy=R.createContext({isOpen:!1}),mh=R.createContext(null),Jy=R.createContext(null),eo=()=>{var n,r;const e=R.useContext(mh),t=R.useContext(Jy);return(r=(n=e==null?void 0:e.closeMenu)!=null?n:t==null?void 0:t.closeMenu)!=null?r:(()=>{})},Zy=({onClearChat:e,componentType:t})=>{const n=eo(),r=()=>{e(),n()};return w.jsxs("button",{className:B(`${N}-overflow-menu-button`,"clear-chat-button",`cim-${t}-component`),onClick:r,children:[w.jsx(Z6,{}),"Clear chat"]})},eT=({onDownloadTranscript:e,componentType:t})=>{const{logger:n}=ft(),r=eo(),[s,a]=R.useState(!1),u=()=>Be(null,null,function*(){if(!s){a(!0);try{yield e(),r()}catch(l){n==null||n.error("Error downloading transcript:",l)}finally{a(!1)}}});return w.jsxs("button",{className:B(`${N}-overflow-menu-button`,"download-transcript-button",`cim-${t}-component`),onClick:u,disabled:s,children:[w.jsx(J6,{}),"Download transcript"]})};function e4(e){return e==null?[]:Array.isArray(e)?e:[e]}var t4=(e,...t)=>e.concat(t),n4=(e,...t)=>e.filter(n=>!t.includes(n)),r4=e=>Array.from(new Set(e));function tT(e,t,n={}){const{step:r=1,loop:s=!0}=n,a=t+r,u=e.length,l=u-1;return t===-1?r>0?0:l:a<0?s?l:0:a>=u?s?0:t>u?u:t:a}function i4(e,t,n={}){const{step:r=1,loop:s=!0}=n;return tT(e,t,{step:-r,loop:s})}var s4=e=>Array.isArray(e),nT=e=>e!=null&&typeof e=="object",o4=e=>nT(e)&&!s4(e),Ol=e=>typeof e=="string",to=e=>typeof e=="function",a4=e=>e==null,u4=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l4=e=>Object.prototype.toString.call(e),rT=Function.prototype.toString,c4=rT.call(Object),d4=e=>{if(!nT(e)||l4(e)!="[object Object]"||p4(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=u4(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&rT.call(n)==c4},f4=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,h4=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,p4=e=>f4(e)||h4(e),m4=e=>e(),g4=()=>{},gh=(...e)=>(...t)=>{e.forEach(function(n){n==null||n(...t)})};function E4(e,t=0){let n=0,r=null;return((...s)=>{const a=Date.now(),u=a-n;u>=t?(r&&(clearTimeout(r),r=null),e(...s),n=a):r||(r=setTimeout(()=>{e(...s),n=Date.now(),r=null},t-u))})}var{min:y4,max:T4}=Math,b4=e=>Number.isNaN(e),w4=e=>b4(e)?0:e,iT=(e,t,n)=>y4(T4(w4(e),t),n);function Eh(e){if(!d4(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const s=e[r];s!==void 0&&(n[r]=Eh(s))}return n}function yh(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function _4(e,t){if(e==null)throw new Error(t())}function x4(e,t,n){let r=[];for(const s of t)e[s]==null&&r.push(s);if(r.length>0)throw new Error(`[zag-js${` > ${n}`}] missing required props: ${r.join(", ")}`)}var S4=Object.defineProperty,v4=(e,t,n)=>t in e?S4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Th=(e,t,n)=>v4(e,typeof t!="symbol"?t+"":t,n),sT=()=>{},Il=e=>typeof e=="object"&&e!==null,no=e=>e?"":void 0,oT=e=>e?"true":void 0,A4=1,k4=9,C4=11,Jt=e=>Il(e)&&e.nodeType===A4&&typeof e.nodeName=="string",Pl=e=>Il(e)&&e.nodeType===k4,N4=e=>Il(e)&&e===e.window,aT=e=>Jt(e)?e.localName||"":"#document";function O4(e){return["html","body","#document"].includes(aT(e))}var I4=e=>Il(e)&&e.nodeType!==void 0,as=e=>I4(e)&&e.nodeType===C4&&"host"in e,P4=e=>Jt(e)&&e.localName==="input",R4=e=>Jt(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function Ra(e){if(!e)return!1;const t=e.getRootNode();return so(t)===e}var L4=/(textarea|select)/;function D4(e){if(e==null||!Jt(e))return!1;try{return P4(e)&&e.selectionStart!=null||L4.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch(t){return!1}}function ro(e,t){var r;if(!e||!t||!Jt(e)||!Jt(t))return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e===t||e.contains(t))return!0;if(n&&as(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Cr(e){var t;return Pl(e)?e:N4(e)?e.document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function M4(e){return Cr(e).documentElement}function io(e){var t,n,r;return as(e)?io(e.host):Pl(e)?(t=e.defaultView)!=null?t:window:Jt(e)&&(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window}function so(e){let t=e.activeElement;for(;t!=null&&t.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n||n===t)break;t=n}return t}function F4(e){if(aT(e)==="html")return e;const t=e.assignedSlot||e.parentNode||as(e)&&e.host||M4(e);return as(t)?t.host:t}function bh(e){var n;let t;try{if(t=e.getRootNode({composed:!0}),Pl(t)||as(t))return t}catch(r){}return(n=e.ownerDocument)!=null?n:document}var wh=new WeakMap;function oo(e){return wh.has(e)||wh.set(e,io(e).getComputedStyle(e)),wh.get(e)}var _h=new Set(["menu","listbox","dialog","grid","tree","region"]),B4=e=>_h.has(e),uT=e=>{var t;return((t=e.getAttribute("aria-controls"))==null?void 0:t.split(" "))||[]};function lT(e,t){const n=new Set,r=bh(e),s=a=>{const u=a.querySelectorAll("[aria-controls]");for(const l of u){if(l.getAttribute("aria-expanded")!=="true")continue;const d=uT(l);for(const f of d){if(!f||n.has(f))continue;n.add(f);const m=r.getElementById(f);if(m){const p=m.getAttribute("role"),b=m.getAttribute("aria-modal")==="true";if(p&&B4(p)&&!b&&(m===t||m.contains(t)||s(m)))return!0}}}return!1};return s(e)}function cT(e,t){const n=bh(e),r=new Set,s=a=>{const u=a.querySelectorAll("[aria-controls]");for(const l of u){if(l.getAttribute("aria-expanded")!=="true")continue;const d=uT(l);for(const f of d){if(!f||r.has(f))continue;r.add(f);const m=n.getElementById(f);if(m){const p=m.getAttribute("role"),b=m.getAttribute("aria-modal")==="true";p&&_h.has(p)&&!b&&(t(m),s(m))}}}};s(e)}function U4(e){const t=new Set;return cT(e,n=>{e.contains(n)||t.add(n)}),Array.from(t)}function H4(e){const t=e.getAttribute("role");return!!(t&&_h.has(t))}function j4(e){return e.hasAttribute("aria-controls")&&e.getAttribute("aria-expanded")==="true"}function z4(e){var t;return j4(e)?!0:!!((t=e.querySelector)!=null&&t.call(e,'[aria-controls][aria-expanded="true"]'))}function $4(e){if(!e.id)return!1;const t=bh(e),n=CSS.escape(e.id),r=`[aria-controls~="${n}"][aria-expanded="true"], [aria-controls="${n}"][aria-expanded="true"]`;return!!(t.querySelector(r)&&H4(e))}var xh=()=>typeof document!="undefined";function V4(){var t;const e=navigator.userAgentData;return(t=e==null?void 0:e.platform)!=null?t:navigator.platform}var Sh=e=>xh()&&e.test(V4()),q4=e=>xh()&&e.test(navigator.vendor),dT=()=>xh()&&!!navigator.maxTouchPoints,Y4=()=>Sh(/^iPhone/i),W4=()=>Sh(/^iPad/i)||vh()&&navigator.maxTouchPoints>1,Rl=()=>Y4()||W4(),G4=()=>vh()||Rl(),vh=()=>Sh(/^Mac/i),X4=()=>G4()&&q4(/apple/i);function K4(e){var t,n,r,s;return(s=(t=e.composedPath)==null?void 0:t.call(e))!=null?s:(r=(n=e.nativeEvent)==null?void 0:n.composedPath)==null?void 0:r.call(n)}function fr(e){var n;const t=K4(e);return(n=t==null?void 0:t[0])!=null?n:e.target}var fT=e=>e.button===0,Q4=e=>e.button===2||vh()&&e.ctrlKey&&e.button===0,J4=e=>"touches"in e&&e.touches.length>0,Z4={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},hT={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function eL(e,t={}){var u;const{dir:n="ltr",orientation:r="horizontal"}=t;let s=e.key;return s=(u=Z4[s])!=null?u:s,n==="rtl"&&r==="horizontal"&&s in hT&&(s=hT[s]),s}function pT(e,t="client"){const n=J4(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var Zt=(e,t,n,r)=>{const s=typeof e=="function"?e():e;return s==null||s.addEventListener(t,n,r),()=>{s==null||s.removeEventListener(t,n,r)}},mT=e=>Jt(e)&&e.tagName==="IFRAME",tL=/^(audio|video|details)$/;function gT(e){const t=e.getAttribute("tabindex");return t?parseInt(t,10):NaN}var nL=e=>!Number.isNaN(gT(e)),rL=e=>gT(e)<0;function iL(e,t){if(!t)return null;if(t===!0)return e.shadowRoot||null;const n=t(e);return(n===!0?e.shadowRoot:n)||null}function ET(e,t,n){const r=[...e],s=[...e],a=new Set,u=new Map;e.forEach((d,f)=>u.set(d,f));let l=0;for(;l<s.length;){const d=s[l++];if(!d||a.has(d))continue;a.add(d);const f=iL(d,t);if(f){const m=Array.from(f.querySelectorAll(Ll)).filter(n),p=u.get(d);if(p!==void 0){const b=p+1;r.splice(b,0,...m),m.forEach((y,_)=>{u.set(y,b+_)});for(let y=b+m.length;y<r.length;y++)u.set(r[y],y)}else{const b=r.length;r.push(...m),m.forEach((y,_)=>{u.set(y,b+_)})}s.push(...m)}}return r}var Ll="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type",yT=(e,t={})=>{if(!e)return[];const{includeContainer:n=!1,getShadowRoot:r}=t,s=Array.from(e.querySelectorAll(Ll));(n==!0||n=="if-empty"&&s.length===0)&&Jt(e)&&Nr(e)&&s.unshift(e);const u=[];for(const l of s)if(Nr(l)){if(mT(l)&&l.contentDocument){const d=l.contentDocument.body;u.push(...yT(d,{getShadowRoot:r}));continue}u.push(l)}return r?ET(u,r,Nr):u};function Nr(e){return!Jt(e)||e.closest("[inert]")?!1:e.matches(Ll)&&R4(e)}function ao(e,t={}){if(!e)return[];const{includeContainer:n,getShadowRoot:r}=t,s=Array.from(e.querySelectorAll(Ll));n&&us(e)&&s.unshift(e);const a=[];for(const u of s)if(us(u)){if(mT(u)&&u.contentDocument){const l=u.contentDocument.body;a.push(...ao(l,{getShadowRoot:r}));continue}a.push(u)}if(r){const u=ET(a,r,us);return!u.length&&n?s:u}return!a.length&&n?s:a}function us(e){return Jt(e)&&e.tabIndex>0?!0:Nr(e)&&!rL(e)}function sL(e,t={}){const n=ao(e,t),r=n[0]||null,s=n[n.length-1]||null;return[r,s]}function oL(e,t={}){const{current:n,getShadowRoot:r}=t,s=ao(e,{getShadowRoot:r}),a=(e==null?void 0:e.ownerDocument)||document,u=n!=null?n:so(a);if(!u)return null;const l=s.indexOf(u);return s[l+1]||null}function La(e){return e.tabIndex<0&&(tL.test(e.localName)||D4(e))&&!nL(e)?0:e.tabIndex}function TT(e){const{root:t,getInitialEl:n,filter:r,enabled:s=!0}=e;if(!s)return;let a=null;if(a||(a=typeof n=="function"?n():n),a||(a=t==null?void 0:t.querySelector("[data-autofocus],[autofocus]")),!a){const u=ao(t);a=r?u.filter(r)[0]:u[0]}return a||t||void 0}var aL=class I2{constructor(){Th(this,"id",null),Th(this,"fn_cleanup"),Th(this,"cleanup",()=>{this.cancel()})}static create(){return new I2}request(t){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=t==null?void 0:t()})}cancel(){var t;this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),(t=this.fn_cleanup)==null||t.call(this),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function qt(e){const t=aL.create();return t.request(e),t.cleanup}function bT(e){const t=new Set;function n(r){const s=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(s))}return n(()=>n(e)),function(){t.forEach(s=>s())}}function Ah(e){const t=F4(e);return O4(t)?Cr(t).body:Jt(t)&&cL(t)?t:Ah(t)}var uL=/auto|scroll|overlay|hidden|clip/,lL=new Set(["inline","contents"]);function cL(e){const t=io(e),{overflow:n,overflowX:r,overflowY:s,display:a}=t.getComputedStyle(e);return uL.test(n+s+r)&&!lL.has(a)}var uo="default",kh="",Dl=new WeakMap;function dL(e={}){const{target:t,doc:n}=e,r=n!=null?n:document,s=r.documentElement;return Rl()?(uo==="default"&&(kh=s.style.webkitUserSelect,s.style.webkitUserSelect="none"),uo="disabled"):t&&(Dl.set(t,t.style.userSelect),t.style.userSelect="none"),()=>fL({target:t,doc:r})}function fL(e={}){const{target:t,doc:n}=e,s=(n!=null?n:document).documentElement;if(Rl()){if(uo!=="disabled")return;uo="restoring",setTimeout(()=>{bT(()=>{uo==="restoring"&&(s.style.webkitUserSelect==="none"&&(s.style.webkitUserSelect=kh||""),kh="",uo="default")})},300)}else if(t&&Dl.has(t)){const a=Dl.get(t);t.style.userSelect==="none"&&(t.style.userSelect=a!=null?a:""),t.getAttribute("style")===""&&t.removeAttribute("style"),Dl.delete(t)}}function hL(e={}){const u=e,{defer:t,target:n}=u,r=Sn(u,["defer","target"]),s=t?qt:l=>l(),a=[];return a.push(s(()=>{const l=typeof n=="function"?n():n;a.push(dL(ce(j({},r),{target:l})))})),()=>{a.forEach(l=>l==null?void 0:l())}}function pL(e,t){const{onPointerMove:n,onPointerUp:r}=t,s=l=>{const d=pT(l),f=Math.sqrt(gd(d.x,2)+gd(d.y,2)),m=l.pointerType==="touch"?10:5;if(!(f<m)){if(l.pointerType==="mouse"&&l.button===0){a(l);return}n({point:d,event:l})}},a=l=>{const d=pT(l);r({point:d,event:l})},u=[Zt(e,"pointermove",s,!1),Zt(e,"pointerup",a,!1),Zt(e,"pointercancel",a,!1),Zt(e,"contextmenu",a,!1),hL({doc:e})];return()=>{u.forEach(l=>l())}}function mL(e,t={}){const{triggerElement:n,onFocus:r,onFocusEnter:s,getShadowRoot:a}=t,u=(e==null?void 0:e.ownerDocument)||document,l=u.body;function d(f){if(f.key!=="Tab")return;let m=null;const[p,b]=sL(e,{includeContainer:!0,getShadowRoot:a}),y=oL(l,{current:n,getShadowRoot:a}),_=!p&&!b;f.shiftKey&&Ra(y)?(s==null||s(),m=b):f.shiftKey&&(Ra(p)||_)?m=n:!f.shiftKey&&Ra(n)?(s==null||s(),m=p):!f.shiftKey&&(Ra(b)||_)&&(m=y),m&&(f.preventDefault(),typeof r=="function"?r(m):m.focus())}return Zt(u,"keydown",d,!0)}function gL(e,t){const l=t,{defer:n,triggerElement:r}=l,s=Sn(l,["defer","triggerElement"]),a=n?qt:d=>d(),u=[];return u.push(a(()=>{const d=typeof e=="function"?e():e,f=typeof r=="function"?r():r;u.push(mL(d,j({triggerElement:f},s)))})),()=>{u.forEach(d=>d==null?void 0:d())}}function EL(e,t){var n;return Array.from((n=e==null?void 0:e.querySelectorAll(t))!=null?n:[])}function Ml(e,t){if(!e)return sT;const n=Object.keys(t).reduce((r,s)=>(r[s]=e.style.getPropertyValue(s),r),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")}}function yL(e,t,n){if(!e)return sT;const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r),e.style.length===0&&e.removeAttribute("style")}}function TL(e,t,n){const{signal:r}=t;return[new Promise((u,l)=>{const d=setTimeout(()=>{l(new Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener("abort",()=>{clearTimeout(d),l(new Error("Promise aborted"))}),e.then(f=>{r.aborted||(clearTimeout(d),u(f))}).catch(f=>{r.aborted||(clearTimeout(d),l(f))})}),()=>t.abort()]}function bL(e,t){const{timeout:n,rootNode:r}=t,s=io(r),a=Cr(r),u=new s.AbortController;return TL(new Promise(l=>{const d=e();if(d){l(d);return}const f=new s.MutationObserver(()=>{const m=e();m&&m.isConnected&&(f.disconnect(),l(m))});f.observe(a.body,{childList:!0,subtree:!0})}),u,n)}var wL=(...e)=>e.map(t=>{var n;return(n=t==null?void 0:t.trim)==null?void 0:n.call(t)}).filter(Boolean).join(" "),_L=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,wT=e=>{const t={};let n;for(;n=_L.exec(e);)t[n[1]]=n[2];return t},xL=(e,t)=>{if(Ol(e)){if(Ol(t))return`${e};${t}`;e=wT(e)}else Ol(t)&&(t=wT(t));return Object.assign({},e!=null?e:{},t!=null?t:{})};function Yt(...e){let t={};for(let n of e){if(!n)continue;for(let s in t){if(s.startsWith("on")&&typeof t[s]=="function"&&typeof n[s]=="function"){t[s]=gh(n[s],t[s]);continue}if(s==="className"||s==="class"){t[s]=wL(t[s],n[s]);continue}if(s==="style"){t[s]=xL(t[s],n[s]);continue}t[s]=n[s]!==void 0?n[s]:t[s]}for(let s in n)t[s]===void 0&&(t[s]=n[s]);const r=Object.getOwnPropertySymbols(n);for(let s of r)t[s]=n[s]}return t}function UU(e){return e}var lo=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(lo||{}),Ch="__init__";function SL(e){const t=()=>{var u,l;return(l=(u=e.getRootNode)==null?void 0:u.call(e))!=null?l:document},n=()=>Cr(t()),r=()=>{var u;return(u=n().defaultView)!=null?u:window},s=()=>so(t()),a=u=>t().getElementById(u);return ce(j({},e),{getRootNode:t,getDoc:n,getWin:r,getActiveElement:s,isActiveElement:Ra,getById:a})}function vL(e){return new Proxy({},{get(t,n){return n==="style"?r=>e({style:r}).style:e}})}var co=()=>e=>Array.from(new Set(e)),_T=typeof globalThis.document!="undefined"?R.useLayoutEffect:R.useEffect;function Fl(e){var p,b;const t=(p=e().value)!=null?p:e().defaultValue,n=(b=e().isEqual)!=null?b:Object.is,[r]=R.useState(t),[s,a]=R.useState(r),u=e().value!==void 0,l=R.useRef(s);l.current=u?e().value:s;const d=R.useRef(l.current);_T(()=>{d.current=l.current},[s,e().value]);const f=y=>{var A,S;const _=d.current,x=to(y)?y(_):y;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:x,prev:_}),u||a(x),n(x,_)||(S=(A=e()).onChange)==null||S.call(A,x,_)};function m(){return u?e().value:s}return{initial:r,ref:l,get:m,set(y){(e().sync?Vs.flushSync:m4)(()=>f(y))},invoke(y,_){var x,A;(A=(x=e()).onChange)==null||A.call(x,y,_)},hash(y){var _,x,A;return(A=(x=(_=e()).hash)==null?void 0:x.call(_,y))!=null?A:String(y)}}}Fl.cleanup=e=>{R.useEffect(()=>e,[])},Fl.ref=e=>{const t=R.useRef(e);return{get:()=>t.current,set:n=>{t.current=n}}};function AL(e){const t=R.useRef(e);return{get(n){return t.current[n]},set(n,r){t.current[n]=r}}}var kL=(e,t)=>{const n=R.useRef(!1),r=R.useRef(!1);R.useEffect(()=>{if(n.current&&r.current)return t();r.current=!0},[...(e!=null?e:[]).map(s=>typeof s=="function"?s():s)]),R.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function Bl(e,t={}){var ie,te,le,fe,ue,Se;const n=R.useMemo(()=>{const{id:de,ids:W,getRootNode:oe}=t;return SL({id:de,ids:W,getRootNode:oe})},[t]),r=(...de)=>{e.debug&&console.log(...de)},s=(te=(ie=e.props)==null?void 0:ie.call(e,{props:Eh(t),scope:n}))!=null?te:t,a=CL(s),u=(le=e.context)==null?void 0:le.call(e,{prop:a,bindable:Fl,scope:n,flush:ST,getContext(){return d},getComputed(){return G},getRefs(){return x},getEvent(){return y()}}),l=xT(u),d={get(de){var W;return(W=l.current)==null?void 0:W[de].ref.current},set(de,W){var oe;(oe=l.current)==null||oe[de].set(W)},initial(de){var W;return(W=l.current)==null?void 0:W[de].initial},hash(de){var oe,k;const W=(oe=l.current)==null?void 0:oe[de].get();return(k=l.current)==null?void 0:k[de].hash(W)}},f=R.useRef(new Map),m=R.useRef(null),p=R.useRef(null),b=R.useRef({type:""}),y=()=>ce(j({},b.current),{current(){return b.current},previous(){return p.current}}),_=()=>ce(j({},M),{matches(...de){return de.includes(M.ref.current)},hasTag(de){var W,oe;return!!((oe=(W=e.states[M.ref.current])==null?void 0:W.tags)!=null&&oe.includes(de))}}),x=AL((ue=(fe=e.refs)==null?void 0:fe.call(e,{prop:a,context:d}))!=null?ue:{}),A=()=>({state:_(),context:d,event:y(),prop:a,send:H,action:S,guard:C,track:kL,refs:x,computed:G,flush:ST,scope:n,choose:z}),S=de=>{const W=to(de)?de(A()):de;if(!W)return;const oe=W.map(k=>{var Z,P;const D=(P=(Z=e.implementations)==null?void 0:Z.actions)==null?void 0:P[k];return D||yh(`[zag-js] No implementation found for action "${JSON.stringify(k)}"`),D});for(const k of oe)k==null||k(A())},C=de=>{var W,oe;return to(de)?de(A()):(oe=(W=e.implementations)==null?void 0:W.guards)==null?void 0:oe[de](A())},O=de=>{const W=to(de)?de(A()):de;if(!W)return;const oe=W.map(D=>{var P,xe;const Z=(xe=(P=e.implementations)==null?void 0:P.effects)==null?void 0:xe[D];return Z||yh(`[zag-js] No implementation found for effect "${JSON.stringify(D)}"`),Z}),k=[];for(const D of oe){const Z=D==null?void 0:D(A());Z&&k.push(Z)}return()=>k.forEach(D=>D==null?void 0:D())},z=de=>e4(de).find(W=>{let oe=!W.guard;return Ol(W.guard)?oe=!!C(W.guard):to(W.guard)&&(oe=W.guard(A())),oe}),G=de=>{_4(e.computed,()=>"[zag-js] No computed object found on machine");const W=e.computed[de];return W({context:d,event:y(),prop:a,refs:x,scope:n,computed:G})},M=Fl(()=>({defaultValue:e.initialState({prop:a}),onChange(de,W){var k,D,Z,P;if(W){const xe=f.current.get(W);xe==null||xe(),f.current.delete(W)}W&&S((k=e.states[W])==null?void 0:k.exit),S((D=m.current)==null?void 0:D.actions);const oe=O((Z=e.states[de])==null?void 0:Z.effects);if(oe&&f.current.set(de,oe),W===Ch){S(e.entry);const xe=O(e.effects);xe&&f.current.set(Ch,xe)}S((P=e.states[de])==null?void 0:P.entry)}})),V=R.useRef(void 0),J=R.useRef(lo.NotStarted);_T(()=>{queueMicrotask(()=>{var D;const oe=J.current===lo.Started;J.current=lo.Started,r(oe?"rehydrating...":"initializing...");const k=(D=V.current)!=null?D:M.initial;M.invoke(k,oe?M.get():Ch)});const de=f.current,W=M.ref.current;return()=>{r("unmounting..."),V.current=W,J.current=lo.Stopped,de.forEach(oe=>oe==null?void 0:oe()),f.current=new Map,m.current=null,queueMicrotask(()=>{S(e.exit)})}},[]);const se=()=>"ref"in M?M.ref.current:M.get(),H=de=>{queueMicrotask(()=>{var P,xe,Ie,he,ve;if(J.current!==lo.Started)return;p.current=b.current,b.current=de;let W=se();const oe=(Ie=(P=e.states[W].on)==null?void 0:P[de.type])!=null?Ie:(xe=e.on)==null?void 0:xe[de.type],k=z(oe);if(!k)return;m.current=k;const D=(he=k.target)!=null?he:W;r("transition",de.type,k.target||W,`(${k.actions})`);const Z=D!==W;Z?Vs.flushSync(()=>M.set(D)):k.reenter&&!Z?M.invoke(W,W):S((ve=k.actions)!=null?ve:[])})};return(Se=e.watch)==null||Se.call(e,A()),{state:_(),send:H,context:d,prop:a,scope:n,refs:x,computed:G,event:y(),getStatus:()=>J.current}}function xT(e){const t=R.useRef(e);return t.current=e,t}function CL(e){const t=xT(e);return function(r){return t.current[r]}}function ST(e){queueMicrotask(()=>{Vs.flushSync(()=>e())})}var Nh=vL(e=>e);function Ul(...e){return t=>{const n=[];for(const r of e)if(typeof r=="function"){const s=r(t);typeof s=="function"&&n.push(s)}else r&&(r.current=t);if(n.length)return()=>{for(const r of n)r()}}}function NL(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Oh=e=>{const t=R.memo(R.forwardRef((n,r)=>{const f=n,{asChild:s,children:a}=f,u=Sn(f,["asChild","children"]);if(!s)return R.createElement(e,ce(j({},u),{ref:r}),a);if(!R.isValidElement(a))return null;const l=R.Children.only(a),d=NL(l);return R.cloneElement(l,ce(j({},Yt(u,l.props)),{ref:r?Ul(r,d):d}))}));return t.displayName=e.displayName||e.name,t},hn=(()=>{const e=new Map;return new Proxy(Oh,{apply(t,n,r){return Oh(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,Oh(r)),e.get(r)}})})();function OL(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function ls(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:s="Provider",errorMessage:a,defaultValue:u}=e,l=R.createContext(u);l.displayName=t;function d(){var m;const f=R.useContext(l);if(!f&&n){const p=new Error(a!=null?a:OL(r,s));throw p.name="ContextError",(m=Error.captureStackTrace)==null||m.call(Error,p,d),p}return f}return[l.Provider,d,l]}const[IL,Ih]=ls({name:"PopoverContext",hookName:"usePopoverContext",providerName:"<PopoverProvider />"}),[vT,Da]=ls({name:"PresenceContext",hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),AT=R.forwardRef((e,t)=>{const n=Ih(),r=Da(),s=Yt(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:w.jsx(hn.div,ce(j({},s),{ref:Ul(r.ref,t)}))});AT.displayName="PopoverContent";const kT=R.forwardRef((e,t)=>{const n=Ih(),r=Da(),s=Yt(n.getPositionerProps(),e);return r.unmounted?null:w.jsx(hn.div,ce(j({},s),{ref:t}))});kT.displayName="PopoverPositioner";const Ma=()=>(e,t)=>t.reduce((n,r)=>{const[s,a]=n,u=r;return a[u]!==void 0&&(s[u]=a[u]),delete a[u],[s,a]},[{},j({},e)]),CT=e=>Ma()(e,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]);function PL(e,t){const{state:n,send:r,context:s}=e,a=n.matches("mounted","unmountSuspended");return{skip:!s.get("initial"),present:a,setNode(u){u&&r({type:"NODE.SET",node:u})},unmount(){r({type:"UNMOUNT"})}}}var RL={props({props:e}){return ce(j({},e),{present:!!e.present})},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["clearInitial","cleanupNode"],watch({track:e,prop:t,send:n}){e([()=>t("present")],()=>{n({type:"PRESENCE.CHANGED"})})},on:{"NODE.SET":{actions:["setupNode"]},"PRESENCE.CHANGED":{actions:["setInitial","syncPresence"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},clearInitial:({context:e})=>{e.set("initial",!1)},invokeOnExitComplete:({prop:e})=>{var t;(t=e("onExitComplete"))==null||t()},setupNode:({refs:e,event:t})=>{e.get("node")!==t.node&&(e.set("node",t.node),e.set("styles",oo(t.node)))},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{const s=r("present");if(s)return n({type:"MOUNT",src:"presence.changed"});const a=t.get("node");if(!s&&(a==null?void 0:a.ownerDocument.visibilityState)==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});qt(()=>{var l,d;const u=Hl(t.get("styles"));e.set("unmountAnimationName",u),u==="none"||u===e.get("prevAnimationName")||((l=t.get("styles"))==null?void 0:l.display)==="none"||((d=t.get("styles"))==null?void 0:d.animationDuration)==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{qt(()=>{e.set("prevAnimationName",Hl(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:r})=>{const s=t.get("node");if(!s)return;const a=d=>{var m,p,b;((b=(p=(m=d.composedPath)==null?void 0:m.call(d))==null?void 0:p[0])!=null?b:d.target)===s&&e.set("prevAnimationName",Hl(t.get("styles")))},u=d=>{const f=Hl(t.get("styles"));fr(d)===s&&f===e.get("unmountAnimationName")&&!r("present")&&n({type:"UNMOUNT",src:"animationend"})};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",u),s.addEventListener("animationend",u);const l=Ml(s,{animationFillMode:"forwards"});return()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",u),s.removeEventListener("animationend",u),bT(()=>l())}}}}};function Hl(e){return(e==null?void 0:e.animationName)||"none"}co()(["onExitComplete","present","immediate"]);function LL(e,t={}){const{sync:n=!1}=t,r=DL(e);return R.useCallback((...s)=>{var a;return n?queueMicrotask(()=>{var u;return(u=r.current)==null?void 0:u.call(r,...s)}):(a=r.current)==null?void 0:a.call(r,...s)},[n,r])}function DL(e){const t=R.useRef(e);return t.current=e,t}const Ph=(e={})=>{const b=e,{lazyMount:t,unmountOnExit:n,present:r,skipAnimationOnMount:s=!1}=b,a=Sn(b,["lazyMount","unmountOnExit","present","skipAnimationOnMount"]),u=R.useRef(!1),l=ce(j({},a),{present:r,onExitComplete:LL(e.onExitComplete)}),d=Bl(RL,l),f=PL(d);f.present&&(u.current=!0);const m=!f.present&&!u.current&&t||n&&!f.present&&u.current,p=()=>({"data-state":f.skip&&s?void 0:r?"open":"closed",hidden:!f.present});return{ref:f.setNode,getPresenceProps:p,present:f.present,unmounted:m}};var cs=(e,t=[])=>({parts:(...n)=>{if(ML(t))return cs(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>cs(e,[...t,...n]),omit:(...n)=>cs(e,t.filter(r=>!n.includes(r))),rename:n=>cs(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${fo(e)}"][data-part="${fo(r)}"]`,`& [data-scope="${fo(e)}"][data-part="${fo(r)}"]`].join(", "),attrs:{"data-scope":fo(e),"data-part":fo(r)}}}),{})}),fo=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),ML=e=>e.length===0;const FL=["top","right","bottom","left"],Ti=Math.min,Yr=Math.max,jl=Math.round,zl=Math.floor,Or=e=>({x:e,y:e}),BL={left:"right",right:"left",bottom:"top",top:"bottom"};function NT(e,t,n){return Yr(e,Ti(t,n))}function Wr(e,t){return typeof e=="function"?e(t):e}function bi(e){return e.split("-")[0]}function ho(e){return e.split("-")[1]}function Rh(e){return e==="x"?"y":"x"}function Lh(e){return e==="y"?"height":"width"}function Ir(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Dh(e){return Rh(Ir(e))}function UL(e,t,n){n===void 0&&(n=!1);const r=ho(e),s=Dh(e),a=Lh(s);let u=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(u=$l(u)),[u,$l(u)]}function HL(e){const t=$l(e);return[Mh(e),t,Mh(t)]}function Mh(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const OT=["left","right"],IT=["right","left"],jL=["top","bottom"],zL=["bottom","top"];function $L(e,t,n){switch(e){case"top":case"bottom":return n?t?IT:OT:t?OT:IT;case"left":case"right":return t?jL:zL;default:return[]}}function VL(e,t,n,r){const s=ho(e);let a=$L(bi(e),n==="start",r);return s&&(a=a.map(u=>u+"-"+s),t&&(a=a.concat(a.map(Mh)))),a}function $l(e){const t=bi(e);return BL[t]+e.slice(t.length)}function qL(e){var t,n,r,s;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(s=e.left)!=null?s:0}}function PT(e){return typeof e!="number"?qL(e):{top:e,right:e,bottom:e,left:e}}function Vl(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function RT(e,t,n){let{reference:r,floating:s}=e;const a=Ir(t),u=Dh(t),l=Lh(u),d=bi(t),f=a==="y",m=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,b=r[l]/2-s[l]/2;let y;switch(d){case"top":y={x:m,y:r.y-s.height};break;case"bottom":y={x:m,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-s.width,y:p};break;default:y={x:r.x,y:r.y}}const _=ho(t);return _&&(y[u]+=b*(_==="end"?1:-1)*(n&&f?-1:1)),y}function YL(e,t){return Be(this,null,function*(){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:u,elements:l,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:b=!1,padding:y=0}=Wr(t,e),_=PT(y),A=l[b?p==="floating"?"reference":"floating":p],S=Vl(yield a.getClippingRect({element:(n=yield a.isElement==null?void 0:a.isElement(A))==null||n?A:A.contextElement||(yield a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:f,rootBoundary:m,strategy:d})),C=p==="floating"?{x:r,y:s,width:u.floating.width,height:u.floating.height}:u.reference,O=yield a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating),z=(yield a.isElement==null?void 0:a.isElement(O))&&(yield a.getScale==null?void 0:a.getScale(O))||{x:1,y:1},G=Vl(a.convertOffsetParentRelativeRectToViewportRelativeRect?yield a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:C,offsetParent:O,strategy:d}):C);return{top:(S.top-G.top+_.top)/z.y,bottom:(G.bottom-S.bottom+_.bottom)/z.y,left:(S.left-G.left+_.left)/z.x,right:(G.right-S.right+_.right)/z.x}})}const WL=50,GL=(e,t,n)=>Be(null,null,function*(){const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:u}=n,l=u.detectOverflow?u:ce(j({},u),{detectOverflow:YL}),d=yield u.isRTL==null?void 0:u.isRTL(t);let f=yield u.getElementRects({reference:e,floating:t,strategy:s}),{x:m,y:p}=RT(f,r,d),b=r,y=0;const _={};for(let x=0;x<a.length;x++){const A=a[x];if(!A)continue;const{name:S,fn:C}=A,{x:O,y:z,data:G,reset:M}=yield C({x:m,y:p,initialPlacement:r,placement:b,strategy:s,middlewareData:_,rects:f,platform:l,elements:{reference:e,floating:t}});m=O!=null?O:m,p=z!=null?z:p,_[S]=j(j({},_[S]),G),M&&y<WL&&(y++,typeof M=="object"&&(M.placement&&(b=M.placement),M.rects&&(f=M.rects===!0?yield u.getElementRects({reference:e,floating:t,strategy:s}):M.rects),{x:m,y:p}=RT(f,b,d)),x=-1)}return{x:m,y:p,placement:b,strategy:s,middlewareData:_}}),XL=e=>({name:"arrow",options:e,fn(n){return Be(this,null,function*(){const{x:r,y:s,placement:a,rects:u,platform:l,elements:d,middlewareData:f}=n,{element:m,padding:p=0}=Wr(e,n)||{};if(m==null)return{};const b=PT(p),y={x:r,y:s},_=Dh(a),x=Lh(_),A=yield l.getDimensions(m),S=_==="y",C=S?"top":"left",O=S?"bottom":"right",z=S?"clientHeight":"clientWidth",G=u.reference[x]+u.reference[_]-y[_]-u.floating[x],M=y[_]-u.reference[_],V=yield l.getOffsetParent==null?void 0:l.getOffsetParent(m);let J=V?V[z]:0;(!J||!(yield l.isElement==null?void 0:l.isElement(V)))&&(J=d.floating[z]||u.floating[x]);const se=G/2-M/2,H=J/2-A[x]/2-1,ie=Ti(b[C],H),te=Ti(b[O],H),le=J-A[x]-te,fe=J/2-A[x]/2+se,ue=NT(ie,fe,le),Se=!f.arrow&&ho(a)!=null&&fe!==ue&&u.reference[x]/2-(fe<ie?ie:te)-A[x]/2<0,de=Se?fe<ie?fe-ie:fe-le:0;return{[_]:y[_]+de,data:j({[_]:ue,centerOffset:fe-ue-de},Se&&{alignmentOffset:de}),reset:Se}})}}),KL=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(n){return Be(this,null,function*(){var r,s;const{placement:a,middlewareData:u,rects:l,initialPlacement:d,platform:f,elements:m}=n,ue=Wr(e,n),{mainAxis:p=!0,crossAxis:b=!0,fallbackPlacements:y,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:A=!0}=ue,S=Sn(ue,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((r=u.arrow)!=null&&r.alignmentOffset)return{};const C=bi(a),O=Ir(d),z=bi(d)===d,G=yield f.isRTL==null?void 0:f.isRTL(m.floating),M=y||(z||!A?[$l(d)]:HL(d)),V=x!=="none";!y&&V&&M.push(...VL(d,A,x,G));const J=[d,...M],se=yield f.detectOverflow(n,S),H=[];let ie=((s=u.flip)==null?void 0:s.overflows)||[];if(p&&H.push(se[C]),b){const Se=UL(a,l,G);H.push(se[Se[0]],se[Se[1]])}if(ie=[...ie,{placement:a,overflows:H}],!H.every(Se=>Se<=0)){var te,le;const Se=(((te=u.flip)==null?void 0:te.index)||0)+1,de=J[Se];if(de&&(!(b==="alignment"?O!==Ir(de):!1)||ie.every(k=>Ir(k.placement)===O?k.overflows[0]>0:!0)))return{data:{index:Se,overflows:ie},reset:{placement:de}};let W=(le=ie.filter(oe=>oe.overflows[0]<=0).sort((oe,k)=>oe.overflows[1]-k.overflows[1])[0])==null?void 0:le.placement;if(!W)switch(_){case"bestFit":{var fe;const oe=(fe=ie.filter(k=>{if(V){const D=Ir(k.placement);return D===O||D==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(D=>D>0).reduce((D,Z)=>D+Z,0)]).sort((k,D)=>k[1]-D[1])[0])==null?void 0:fe[0];oe&&(W=oe);break}case"initialPlacement":W=d;break}if(a!==W)return{reset:{placement:W}}}return{}})}}};function LT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function DT(e){return FL.some(t=>e[t]>=0)}const QL=function(e){return e===void 0&&(e={}),{name:"hide",options:e,fn(n){return Be(this,null,function*(){const{rects:r,platform:s}=n,l=Wr(e,n),{strategy:a="referenceHidden"}=l,u=Sn(l,["strategy"]);switch(a){case"referenceHidden":{const d=yield s.detectOverflow(n,ce(j({},u),{elementContext:"reference"})),f=LT(d,r.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:DT(f)}}}case"escaped":{const d=yield s.detectOverflow(n,ce(j({},u),{altBoundary:!0})),f=LT(d,r.floating);return{data:{escapedOffsets:f,escaped:DT(f)}}}default:return{}}})}}},MT=new Set(["left","top"]);function JL(e,t){return Be(this,null,function*(){const{placement:n,platform:r,elements:s}=e,a=yield r.isRTL==null?void 0:r.isRTL(s.floating),u=bi(n),l=ho(n),d=Ir(n)==="y",f=MT.has(u)?-1:1,m=a&&d?-1:1,p=Wr(t,e);let{mainAxis:b,crossAxis:y,alignmentAxis:_}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof _=="number"&&(y=l==="end"?_*-1:_),d?{x:y*m,y:b*f}:{x:b*f,y:y*m}})}const ZL=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(n){return Be(this,null,function*(){var r,s;const{x:a,y:u,placement:l,middlewareData:d}=n,f=yield JL(n,e);return l===((r=d.offset)==null?void 0:r.placement)&&(s=d.arrow)!=null&&s.alignmentOffset?{}:{x:a+f.x,y:u+f.y,data:ce(j({},f),{placement:l})}})}}},e5=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(n){return Be(this,null,function*(){const{x:r,y:s,placement:a,platform:u}=n,O=Wr(e,n),{mainAxis:l=!0,crossAxis:d=!1,limiter:f={fn:z=>{let{x:G,y:M}=z;return{x:G,y:M}}}}=O,m=Sn(O,["mainAxis","crossAxis","limiter"]),p={x:r,y:s},b=yield u.detectOverflow(n,m),y=Ir(a),_=Rh(y);let x=p[_],A=p[y];const S=(z,G)=>NT(G+b[z==="y"?"top":"left"],G,G-b[z==="y"?"bottom":"right"]);l&&(x=S(_,x)),d&&(A=S(y,A));const C=f.fn(ce(j({},n),{[_]:x,[y]:A}));return ce(j({},C),{data:{x:C.x-r,y:C.y-s,enabled:{[_]:l,[y]:d}}})})}}},t5=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:a,placement:u,rects:l,middlewareData:d}=t,{offset:f=0,mainAxis:m=!0,crossAxis:p=!0}=Wr(e,t),b={x:s,y:a},y=Ir(u),_=Rh(y);let x=b[_],A=b[y];const S=Wr(f,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(m){const G=_==="y"?"height":"width",M=l.reference[_]-l.floating[G]+C.mainAxis,V=l.reference[_]+l.reference[G]-C.mainAxis;x<M?x=M:x>V&&(x=V)}if(p){var O,z;const G=_==="y"?"width":"height",M=MT.has(bi(u)),V=l.reference[y]-l.floating[G]+(M&&((O=d.offset)==null?void 0:O[y])||0)+(M?0:C.crossAxis),J=l.reference[y]+l.reference[G]+(M?0:((z=d.offset)==null?void 0:z[y])||0)-(M?C.crossAxis:0);A<V?A=V:A>J&&(A=J)}return{[_]:x,[y]:A}}}},n5=function(e){return e===void 0&&(e={}),{name:"size",options:e,fn(n){return Be(this,null,function*(){const{placement:r,rects:s,platform:a,elements:u}=n,H=Wr(e,n),{apply:l=()=>{}}=H,d=Sn(H,["apply"]),f=yield a.detectOverflow(n,d),m=bi(r),p=ho(r),b=Ir(r)==="y",{width:y,height:_}=s.floating;let x,A;m==="top"||m==="bottom"?(x=m,A=p===((yield a.isRTL==null?void 0:a.isRTL(u.floating))?"start":"end")?"left":"right"):(A=m,x=p==="end"?"top":"bottom");const S=_-f.top-f.bottom,C=y-f.left-f.right,O=Ti(_-f[x],S),z=Ti(y-f[A],C),G=n.middlewareData.shift,M=!G;let V=O,J=z;G!=null&&G.enabled.x&&(J=C),G!=null&&G.enabled.y&&(V=S),M&&!p&&(b?J=y-2*Yr(f.left,f.right):V=_-2*Yr(f.top,f.bottom)),yield l(ce(j({},n),{availableWidth:J,availableHeight:V}));const se=yield a.getDimensions(u.floating);return y!==se.width||_!==se.height?{reset:{rects:!0}}:{}})}}};function ql(){return typeof window!="undefined"}function po(e){return FT(e)?(e.nodeName||"").toLowerCase():"#document"}function Vn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pr(e){var t;return(t=(FT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function FT(e){return ql()?e instanceof Node||e instanceof Vn(e).Node:!1}function hr(e){return ql()?e instanceof Element||e instanceof Vn(e).Element:!1}function Rr(e){return ql()?e instanceof HTMLElement||e instanceof Vn(e).HTMLElement:!1}function BT(e){return!ql()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof Vn(e).ShadowRoot}function Fa(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=pr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function r5(e){return/^(table|td|th)$/.test(po(e))}function Yl(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}const i5=/transform|translate|scale|rotate|perspective|filter/,s5=/paint|layout|strict|content/,ds=e=>!!e&&e!=="none";let Fh;function Bh(e){const t=hr(e)?pr(e):e;return ds(t.transform)||ds(t.translate)||ds(t.scale)||ds(t.rotate)||ds(t.perspective)||!Uh()&&(ds(t.backdropFilter)||ds(t.filter))||i5.test(t.willChange||"")||s5.test(t.contain||"")}function o5(e){let t=wi(e);for(;Rr(t)&&!mo(t);){if(Bh(t))return t;if(Yl(t))return null;t=wi(t)}return null}function Uh(){return Fh==null&&(Fh=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Fh}function mo(e){return/^(html|body|#document)$/.test(po(e))}function pr(e){return Vn(e).getComputedStyle(e)}function Wl(e){return hr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wi(e){if(po(e)==="html")return e;const t=e.assignedSlot||e.parentNode||BT(e)&&e.host||Pr(e);return BT(t)?t.host:t}function UT(e){const t=wi(e);return mo(t)?(e.ownerDocument||e).body:Rr(t)&&Fa(t)?t:UT(t)}function Ba(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=UT(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),u=Vn(s);if(a){const l=Hh(u);return t.concat(u,u.visualViewport||[],Fa(s)?s:[],l&&n?Ba(l):[])}else return t.concat(s,Ba(s,[],n))}function Hh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function HT(e){const t=pr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Rr(e),a=s?e.offsetWidth:n,u=s?e.offsetHeight:r,l=jl(n)!==a||jl(r)!==u;return l&&(n=a,r=u),{width:n,height:r,$:l}}function jh(e){return hr(e)?e:e.contextElement}function go(e){const t=jh(e);if(!Rr(t))return Or(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=HT(t);let u=(a?jl(n.width):n.width)/r,l=(a?jl(n.height):n.height)/s;return(!u||!Number.isFinite(u))&&(u=1),(!l||!Number.isFinite(l))&&(l=1),{x:u,y:l}}const a5=Or(0);function jT(e){const t=Vn(e);return!Uh()||!t.visualViewport?a5:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function u5(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Vn(e)?!1:t}function fs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=jh(e);let u=Or(1);t&&(r?hr(r)&&(u=go(r)):u=go(e));const l=u5(a,n,r)?jT(a):Or(0);let d=(s.left+l.x)/u.x,f=(s.top+l.y)/u.y,m=s.width/u.x,p=s.height/u.y;if(a){const b=Vn(a),y=r&&hr(r)?Vn(r):r;let _=b,x=Hh(_);for(;x&&r&&y!==_;){const A=go(x),S=x.getBoundingClientRect(),C=pr(x),O=S.left+(x.clientLeft+parseFloat(C.paddingLeft))*A.x,z=S.top+(x.clientTop+parseFloat(C.paddingTop))*A.y;d*=A.x,f*=A.y,m*=A.x,p*=A.y,d+=O,f+=z,_=Vn(x),x=Hh(_)}}return Vl({width:m,height:p,x:d,y:f})}function Gl(e,t){const n=Wl(e).scrollLeft;return t?t.left+n:fs(Pr(e)).left+n}function zT(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Gl(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function l5(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",u=Pr(r),l=t?Yl(t.floating):!1;if(r===u||l&&a)return n;let d={scrollLeft:0,scrollTop:0},f=Or(1);const m=Or(0),p=Rr(r);if((p||!p&&!a)&&((po(r)!=="body"||Fa(u))&&(d=Wl(r)),Rr(r))){const y=fs(r);f=go(r),m.x=y.x+r.clientLeft,m.y=y.y+r.clientTop}const b=u&&!p&&!a?zT(u,d):Or(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+m.x+b.x,y:n.y*f.y-d.scrollTop*f.y+m.y+b.y}}function c5(e){return Array.from(e.getClientRects())}function d5(e){const t=Pr(e),n=Wl(e),r=e.ownerDocument.body,s=Yr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Yr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+Gl(e);const l=-n.scrollTop;return pr(r).direction==="rtl"&&(u+=Yr(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:u,y:l}}const $T=25;function f5(e,t){const n=Vn(e),r=Pr(e),s=n.visualViewport;let a=r.clientWidth,u=r.clientHeight,l=0,d=0;if(s){a=s.width,u=s.height;const m=Uh();(!m||m&&t==="fixed")&&(l=s.offsetLeft,d=s.offsetTop)}const f=Gl(r);if(f<=0){const m=r.ownerDocument,p=m.body,b=getComputedStyle(p),y=m.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,_=Math.abs(r.clientWidth-p.clientWidth-y);_<=$T&&(a-=_)}else f<=$T&&(a+=f);return{width:a,height:u,x:l,y:d}}const h5=new Set(["absolute","fixed"]);function p5(e,t){const n=fs(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=Rr(e)?go(e):Or(1),u=e.clientWidth*a.x,l=e.clientHeight*a.y,d=s*a.x,f=r*a.y;return{width:u,height:l,x:d,y:f}}function VT(e,t,n){let r;if(t==="viewport")r=f5(e,n);else if(t==="document")r=d5(Pr(e));else if(hr(t))r=p5(t,n);else{const s=jT(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Vl(r)}function qT(e,t){const n=wi(e);return n===t||!hr(n)||mo(n)?!1:pr(n).position==="fixed"||qT(n,t)}function m5(e,t){const n=t.get(e);if(n)return n;let r=Ba(e,[],!1).filter(l=>hr(l)&&po(l)!=="body"),s=null;const a=pr(e).position==="fixed";let u=a?wi(e):e;for(;hr(u)&&!mo(u);){const l=pr(u),d=Bh(u);!d&&l.position==="fixed"&&(s=null),(a?!d&&!s:!d&&l.position==="static"&&!!s&&h5.has(s.position)||Fa(u)&&!d&&qT(e,u))?r=r.filter(m=>m!==u):s=l,u=wi(u)}return t.set(e,r),r}function g5(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const u=[...n==="clippingAncestors"?Yl(t)?[]:m5(t,this._c):[].concat(n),r],l=u[0],d=u.reduce((f,m)=>{const p=VT(t,m,s);return f.top=Yr(p.top,f.top),f.right=Ti(p.right,f.right),f.bottom=Ti(p.bottom,f.bottom),f.left=Yr(p.left,f.left),f},VT(t,l,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function E5(e){const{width:t,height:n}=HT(e);return{width:t,height:n}}function y5(e,t,n){const r=Rr(t),s=Pr(t),a=n==="fixed",u=fs(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const d=Or(0);function f(){d.x=Gl(s)}if(r||!r&&!a)if((po(t)!=="body"||Fa(s))&&(l=Wl(t)),r){const y=fs(t,!0,a,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else s&&f();a&&!r&&s&&f();const m=s&&!r&&!a?zT(s,l):Or(0),p=u.left+l.scrollLeft-d.x-m.x,b=u.top+l.scrollTop-d.y-m.y;return{x:p,y:b,width:u.width,height:u.height}}function zh(e){return pr(e).position==="static"}function YT(e,t){if(!Rr(e)||pr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Pr(e)===n&&(n=n.ownerDocument.body),n}function WT(e,t){const n=Vn(e);if(Yl(e))return n;if(!Rr(e)){let s=wi(e);for(;s&&!mo(s);){if(hr(s)&&!zh(s))return s;s=wi(s)}return n}let r=YT(e,t);for(;r&&r5(r)&&zh(r);)r=YT(r,t);return r&&mo(r)&&zh(r)&&!Bh(r)?n:r||o5(e)||n}const T5=function(e){return Be(this,null,function*(){const t=this.getOffsetParent||WT,n=this.getDimensions,r=yield n(e.floating);return{reference:y5(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})};function b5(e){return pr(e).direction==="rtl"}const w5={convertOffsetParentRelativeRectToViewportRelativeRect:l5,getDocumentElement:Pr,getClippingRect:g5,getOffsetParent:WT,getElementRects:T5,getClientRects:c5,getDimensions:E5,getScale:go,isElement:hr,isRTL:b5};function GT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _5(e,t){let n=null,r;const s=Pr(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function u(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),a();const f=e.getBoundingClientRect(),{left:m,top:p,width:b,height:y}=f;if(l||t(),!b||!y)return;const _=zl(p),x=zl(s.clientWidth-(m+b)),A=zl(s.clientHeight-(p+y)),S=zl(m),O={rootMargin:-_+"px "+-x+"px "+-A+"px "+-S+"px",threshold:Yr(0,Ti(1,d))||1};let z=!0;function G(M){const V=M[0].intersectionRatio;if(V!==d){if(!z)return u();V?u(!1,V):r=setTimeout(()=>{u(!1,1e-7)},1e3)}V===1&&!GT(f,e.getBoundingClientRect())&&u(),z=!1}try{n=new IntersectionObserver(G,ce(j({},O),{root:s.ownerDocument}))}catch(M){n=new IntersectionObserver(G,O)}n.observe(e)}return u(!0),a}function x5(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=jh(e),m=s||a?[...f?Ba(f):[],...Ba(t)]:[];m.forEach(S=>{s&&S.addEventListener("scroll",n,{passive:!0}),a&&S.addEventListener("resize",n)});const p=f&&l?_5(f,n):null;let b=-1,y=null;u&&(y=new ResizeObserver(S=>{let[C]=S;C&&C.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var O;(O=y)==null||O.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let _,x=d?fs(e):null;d&&A();function A(){const S=fs(e);x&&!GT(x,S)&&n(),x=S,_=requestAnimationFrame(A)}return n(),()=>{var S;m.forEach(C=>{s&&C.removeEventListener("scroll",n),a&&C.removeEventListener("resize",n)}),p==null||p(),(S=y)==null||S.disconnect(),y=null,d&&cancelAnimationFrame(_)}}const S5=ZL,v5=e5,A5=KL,k5=n5,C5=QL,N5=XL,O5=t5,I5=(e,t,n)=>{const r=new Map,s=j({platform:w5},n),a=ce(j({},s.platform),{_c:r});return GL(e,t,ce(j({},s),{platform:a}))};function XT(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const s={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return ce(j({},s),{toJSON:()=>s})}function P5(e){if(!e)return XT();const{x:t,y:n,width:r,height:s}=e;return XT(t,n,r,s)}function R5(e,t){return{contextElement:Jt(e)?e:void 0,getBoundingClientRect:()=>{const n=e,r=t==null?void 0:t(n);return r||!n?P5(r):n.getBoundingClientRect()}}}var Ua=e=>({variable:e,reference:`var(${e})`}),Gr={arrowSize:Ua("--arrow-size"),arrowSizeHalf:Ua("--arrow-size-half"),arrowBg:Ua("--arrow-background"),transformOrigin:Ua("--transform-origin"),arrowOffset:Ua("--arrow-offset")},L5=e=>e==="top"||e==="bottom"?"y":"x";function D5(e,t){return{name:"transformOrigin",fn(n){var se,H,ie,te,le;const{elements:r,middlewareData:s,placement:a,rects:u,y:l}=n,d=a.split("-")[0],f=L5(d),m=((se=s.arrow)==null?void 0:se.x)||0,p=((H=s.arrow)==null?void 0:H.y)||0,b=(t==null?void 0:t.clientWidth)||0,y=(t==null?void 0:t.clientHeight)||0,_=m+b/2,x=p+y/2,A=Math.abs(((ie=s.shift)==null?void 0:ie.y)||0),S=u.reference.height/2,C=y/2,O=(le=(te=e.offset)==null?void 0:te.mainAxis)!=null?le:e.gutter,z=typeof O=="number"?O+C:O!=null?O:C,G=A>z,M={top:`${_}px calc(100% + ${z}px)`,bottom:`${_}px ${-z}px`,left:`calc(100% + ${z}px) ${x}px`,right:`${-z}px ${x}px`}[d],V=`${_}px ${u.reference.y+S-l}px`,J=!!e.overlap&&f==="y"&&G;return r.floating.style.setProperty(Gr.transformOrigin.variable,J?V:M),{data:{transformOrigin:J?V:M}}}}}var M5={name:"rects",fn({rects:e}){return{data:e}}},F5=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:s}=n.arrow,a=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:s!=null?`${s}px`:"",[a]:`calc(100% + ${Gr.arrowOffset.reference})`}),{}}}};function B5(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}var U5={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function KT(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function $h(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function H5(e,t,n){const r=e||t.createElement("div");return N5({element:r,padding:n.arrowPadding})}function j5(e,t){var n;if(!a4((n=t.offset)!=null?n:t.gutter))return S5(({placement:r})=>{var m,p,b,y;const s=((e==null?void 0:e.clientHeight)||0)/2,a=(p=(m=t.offset)==null?void 0:m.mainAxis)!=null?p:t.gutter,u=typeof a=="number"?a+s:a!=null?a:s,{hasAlign:l}=B5(r),d=l?void 0:t.shift,f=(y=(b=t.offset)==null?void 0:b.crossAxis)!=null?y:d;return Eh({crossAxis:f,mainAxis:u,alignmentAxis:t.shift})})}function z5(e){if(!e.flip)return;const t=$h(e.boundary);return A5(ce(j({},t?{boundary:t}:void 0),{padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}))}function $5(e){if(!e.slide&&!e.overlap)return;const t=$h(e.boundary);return v5(ce(j({},t?{boundary:t}:void 0),{mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:O5()}))}function V5(e){return k5({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:r,availableWidth:s}){const a=t.floating,u=Math.round(n.reference.width),l=Math.round(n.reference.height);s=Math.floor(s),r=Math.floor(r),a.style.setProperty("--reference-width",`${u}px`),a.style.setProperty("--reference-height",`${l}px`),a.style.setProperty("--available-width",`${s}px`),a.style.setProperty("--available-height",`${r}px`)}})}function q5(e){var t;if(e.hideWhenDetached)return C5({strategy:"referenceHidden",boundary:(t=$h(e.boundary))!=null?t:"clippingAncestors"})}function Y5(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function W5(e,t,n={}){const r=R5(e,n.getAnchorRect);if(!t||!r)return;const s=Object.assign({},U5,n),a=t.querySelector("[data-part=arrow]"),u=[j5(a,s),z5(s),$5(s),H5(a,t.ownerDocument,s),F5(a),D5({gutter:s.gutter,offset:s.offset,overlap:s.overlap},a),V5(s),q5(s),M5],{placement:l,strategy:d,onComplete:f,onPositioned:m}=s,p=()=>Be(null,null,function*(){var z;if(!r||!t)return;const x=yield I5(r,t,{placement:l,middleware:u,strategy:d});f==null||f(x),m==null||m({placed:!0});const A=io(t),S=KT(A,x.x),C=KT(A,x.y);t.style.setProperty("--x",`${S}px`),t.style.setProperty("--y",`${C}px`),s.hideWhenDetached&&(((z=x.middlewareData.hide)==null?void 0:z.referenceHidden)?(t.style.setProperty("visibility","hidden"),t.style.setProperty("pointer-events","none")):(t.style.removeProperty("visibility"),t.style.removeProperty("pointer-events")));const O=t.firstElementChild;if(O){const G=oo(O);t.style.setProperty("--z-index",G.zIndex)}}),b=()=>Be(null,null,function*(){n.updatePosition?(yield n.updatePosition({updatePosition:p,floatingElement:t}),m==null||m({placed:!0})):yield p()}),y=Y5(s.listeners),_=s.listeners?x5(r,t,b,y):g4;return b(),()=>{_==null||_(),m==null||m({placed:!1})}}function QT(e,t,n={}){const l=n,{defer:r}=l,s=Sn(l,["defer"]),a=r?qt:d=>d(),u=[];return u.push(a(()=>{const d=typeof e=="function"?e():e,f=typeof t=="function"?t():t;u.push(W5(d,f,s))})),()=>{u.forEach(d=>d==null?void 0:d())}}var G5={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function X5(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:s="absolute"}=e;return{arrow:{position:"absolute",width:Gr.arrowSize.reference,height:Gr.arrowSize.reference,[Gr.arrowSizeHalf.variable]:`calc(${Gr.arrowSize.reference} / 2)`,[Gr.arrowOffset.variable]:`calc(${Gr.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?G5[t.split("-")[0]]:void 0,background:Gr.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:s,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}var Eo=new WeakMap,Xl=new WeakMap,Kl={},Vh=0,JT=e=>e&&(e.host||JT(e.parentNode)),K5=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=JT(n);return r&&e.contains(r)?r:(console.error("[zag-js > ariaHidden] target",n,"in not contained inside",e,". Doing nothing"),null)}).filter(n=>!!n),Q5=new Set(["script","output","status","next-route-announcer"]),J5=e=>Q5.has(e.localName)||e.role==="status"||e.hasAttribute("aria-live")?!0:e.matches("[data-live-announcer]"),Z5=(e,t)=>{const{parentNode:n,markerName:r,controlAttribute:s,followControlledElements:a=!0}=t,u=K5(n,Array.isArray(e)?e:[e]);Kl[r]||(Kl[r]=new WeakMap);const l=Kl[r],d=[],f=new Set,m=new Set(u),p=y=>{!y||f.has(y)||(f.add(y),p(y.parentNode))};u.forEach(y=>{p(y),a&&Jt(y)&&cT(y,_=>{p(_)})});const b=y=>{!y||m.has(y)||Array.prototype.forEach.call(y.children,_=>{if(f.has(_))b(_);else try{if(J5(_))return;const A=_.getAttribute(s)==="true",S=(Eo.get(_)||0)+1,C=(l.get(_)||0)+1;Eo.set(_,S),l.set(_,C),d.push(_),S===1&&A&&Xl.set(_,!0),C===1&&_.setAttribute(r,""),A||_.setAttribute(s,"true")}catch(x){console.error("[zag-js > ariaHidden] cannot operate on ",_,x)}})};return b(n),f.clear(),Vh++,()=>{d.forEach(y=>{const _=Eo.get(y)-1,x=l.get(y)-1;Eo.set(y,_),l.set(y,x),_||(Xl.has(y)||y.removeAttribute(s),Xl.delete(y)),x||y.removeAttribute(r)}),Vh--,Vh||(Eo=new WeakMap,Eo=new WeakMap,Xl=new WeakMap,Kl={})}},eD=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,tD=(e,t=eD(e),n="data-aria-hidden",r=!0)=>{if(t)return Z5(e,{parentNode:t,markerName:n,controlAttribute:"aria-hidden",followControlledElements:r})},nD=e=>{const t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function ZT(e,t={}){const{defer:n=!0}=t,r=n?nD:a=>a(),s=[];return s.push(r(()=>{const u=(typeof e=="function"?e():e).filter(Boolean);u.length!==0&&s.push(tD(u))})),()=>{s.forEach(a=>a==null?void 0:a())}}function rD(e){const t={each(n){var r;for(let s=0;s<((r=e.frames)==null?void 0:r.length);s+=1){const a=e.frames[s];a&&n(a)}},addEventListener(n,r,s){return t.each(a=>{try{a.document.addEventListener(n,r,s)}catch(u){}}),()=>{try{t.removeEventListener(n,r,s)}catch(a){}}},removeEventListener(n,r,s){t.each(a=>{try{a.document.removeEventListener(n,r,s)}catch(u){}})}};return t}function iD(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,s)=>{try{t==null||t.addEventListener(n,r,s)}catch(a){}return()=>{try{t==null||t.removeEventListener(n,r,s)}catch(a){}}},removeEventListener:(n,r,s)=>{try{t==null||t.removeEventListener(n,r,s)}catch(a){}}}}var eb="pointerdown.outside",tb="focus.outside";function sD(e){for(const t of e)if(Jt(t)&&Nr(t))return!0;return!1}var nb=e=>"clientY"in e;function oD(e,t){if(!nb(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function aD(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function rb(e,t){if(!t||!nb(e))return!1;const n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,s=t.scrollWidth>t.clientWidth,a=s&&e.clientY>t.offsetTop+t.clientHeight,u={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(s?16:0)},l={x:e.clientX,y:e.clientY};return aD(u,l)?r||a:!1}function uD(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:s,onInteractOutside:a,defer:u,followControlledElements:l=!0}=t;if(!e)return;const d=Cr(e),f=io(e),m=rD(f),p=iD(f);function b(O,z){if(!Jt(z)||!z.isConnected||ro(e,z)||oD(e,O)||l&&lT(e,z))return!1;const G=d.querySelector(`[aria-controls="${e.id}"]`);if(G){const V=Ah(G);if(rb(O,V))return!1}const M=Ah(e);return rb(O,M)?!1:!(n!=null&&n(z))}const y=new Set,_=as(e==null?void 0:e.getRootNode());function x(O){function z(G){var se,H;const M=u&&!dT()?qt:ie=>ie(),V=G!=null?G:O,J=(H=(se=V==null?void 0:V.composedPath)==null?void 0:se.call(V))!=null?H:[V==null?void 0:V.target];M(()=>{const ie=_?J[0]:fr(O);if(!(!e||!b(O,ie))){if(s||a){const te=gh(s,a);e.addEventListener(eb,te,{once:!0})}ib(e,eb,{bubbles:!1,cancelable:!0,detail:{originalEvent:V,contextmenu:Q4(V),focusable:sD(J),target:ie}})}})}O.pointerType==="touch"?(y.forEach(G=>G()),y.add(Zt(d,"click",z,{once:!0})),y.add(p.addEventListener("click",z,{once:!0})),y.add(m.addEventListener("click",z,{once:!0}))):z()}const A=new Set,S=setTimeout(()=>{A.add(Zt(d,"pointerdown",x,!0)),A.add(p.addEventListener("pointerdown",x,!0)),A.add(m.addEventListener("pointerdown",x,!0))},0);function C(O){(u?qt:G=>G())(()=>{var V,J;const G=(J=(V=O==null?void 0:O.composedPath)==null?void 0:V.call(O))!=null?J:[O==null?void 0:O.target],M=_?G[0]:fr(O);if(!(!e||!b(O,M))){if(r||a){const se=gh(r,a);e.addEventListener(tb,se,{once:!0})}ib(e,tb,{bubbles:!1,cancelable:!0,detail:{originalEvent:O,contextmenu:!1,focusable:Nr(M),target:M}})}})}return dT()||(A.add(Zt(d,"focusin",C,!0)),A.add(p.addEventListener("focusin",C,!0)),A.add(m.addEventListener("focusin",C,!0))),()=>{clearTimeout(S),y.forEach(O=>O()),A.forEach(O=>O())}}function lD(e,t){const{defer:n}=t,r=n?qt:a=>a(),s=[];return s.push(r(()=>{const a=typeof e=="function"?e():e;s.push(uD(a,t))})),()=>{s.forEach(a=>a==null?void 0:a())}}function ib(e,t,n){const r=e.ownerDocument.defaultView||window,s=new r.CustomEvent(t,n);return e.dispatchEvent(s)}function cD(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t==null||t(r))};return Zt(Cr(e),"keydown",n,{capture:!0})}var sb="layer:request-dismiss",Jn={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){var r;const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf((r=this.topMostPointerBlockingLayer())==null?void 0:r.node):-1;return t<n},isTopMost(e){const t=this.layers[this.count()-1];return(t==null?void 0:t.node)===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){const n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(r=>r.type===t)},getParentLayerOfType(e,t){const n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(r=>r.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return this.getNestedLayers(e).some(n=>ro(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>ro(t,e))},add(e){this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(r=>Jn.dismiss(r.node,e)),this.layers.splice(t,1),this.syncLayers())},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{e.node.style.setProperty("--layer-index",`${t}`),e.node.removeAttribute("data-nested"),e.node.removeAttribute("data-has-nested"),this.getParentLayerOfType(e.node,e.type)&&e.node.setAttribute("data-nested",e.type);const r=this.countNestedLayersOfType(e.node,e.type);r>0&&e.node.setAttribute("data-has-nested",e.type),e.node.style.setProperty("--nested-layer-count",`${r}`)})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const n=this.indexOf(e);if(n===-1)return;const r=this.layers[n];fD(e,sb,s=>{var a;(a=r.requestDismiss)==null||a.call(r,s),s.defaultPrevented||r==null||r.dismiss()}),dD(e,sb,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function dD(e,t,n){const r=e.ownerDocument.defaultView||window,s=new r.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(s)}function fD(e,t,n){e.addEventListener(t,n,{once:!0})}var ob;function ab(){Jn.layers.forEach(({node:e})=>{e.style.pointerEvents=Jn.isBelowPointerBlockingLayer(e)?"none":"auto"})}function hD(e){e.style.pointerEvents=""}function pD(e,t){const n=Cr(e),r=[];return Jn.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(ob=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t==null||t.forEach(s=>{const[a,u]=bL(()=>{const l=s();return Jt(l)?l:null},{timeout:1e3});a.then(l=>r.push(Ml(l,{pointerEvents:"auto"}))),r.push(u)}),()=>{Jn.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=ob,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(s=>s()))}}function mD(e,t){const{warnOnMissingNode:n=!0}=t;if(n&&!e){yh("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:r,onRequestDismiss:s,pointerBlocking:a,exclude:u,debug:l,type:d="dialog"}=t,f={dismiss:r,node:e,type:d,pointerBlocking:a,requestDismiss:s};Jn.add(f),ab();function m(x){var S,C;const A=fr(x.detail.originalEvent);Jn.isBelowPointerBlockingLayer(e)||Jn.isInBranch(A)||((S=t.onPointerDownOutside)==null||S.call(t,x),(C=t.onInteractOutside)==null||C.call(t,x),!x.defaultPrevented&&(l&&console.log("onPointerDownOutside:",x.detail.originalEvent),r==null||r()))}function p(x){var S,C;const A=fr(x.detail.originalEvent);Jn.isInBranch(A)||((S=t.onFocusOutside)==null||S.call(t,x),(C=t.onInteractOutside)==null||C.call(t,x),!x.defaultPrevented&&(l&&console.log("onFocusOutside:",x.detail.originalEvent),r==null||r()))}function b(x){var A;Jn.isTopMost(e)&&((A=t.onEscapeKeyDown)==null||A.call(t,x),!x.defaultPrevented&&r&&(x.preventDefault(),r()))}function y(x){var O;if(!e)return!1;const A=typeof u=="function"?u():u,S=Array.isArray(A)?A:[A],C=(O=t.persistentElements)==null?void 0:O.map(z=>z()).filter(Jt);return C&&S.push(...C),S.some(z=>ro(z,x))||Jn.isInNestedLayer(e,x)}const _=[a?pD(e,t.persistentElements):void 0,cD(e,b),lD(e,{exclude:y,onFocusOutside:p,onPointerDownOutside:m,defer:t.defer})];return()=>{Jn.remove(e),ab(),hD(e),_.forEach(x=>x==null?void 0:x())}}function ub(e,t){const{defer:n}=t,r=n?qt:a=>a(),s=[];return s.push(r(()=>{const a=to(e)?e():e;s.push(mD(a,t))})),()=>{s.forEach(a=>a==null?void 0:a())}}var gD=Object.defineProperty,ED=(e,t,n)=>t in e?gD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ct=(e,t,n)=>ED(e,typeof t!="symbol"?t+"":t,n),lb={activateTrap(e,t){if(e.length>0){const r=e[e.length-1];r!==t&&r.pause()}const n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap(e,t){const n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},yD=[],TD=class{constructor(e,t){Ct(this,"trapStack"),Ct(this,"config"),Ct(this,"doc"),Ct(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),Ct(this,"portalContainers",new Set),Ct(this,"listenerCleanups",[]),Ct(this,"handleFocus",r=>{const s=fr(r),a=this.findContainerIndex(s,r)>=0;if(a||Pl(s))a&&(this.state.mostRecentlyFocusedNode=s);else{r.stopImmediatePropagation();let u,l=!0;if(this.state.mostRecentlyFocusedNode)if(La(this.state.mostRecentlyFocusedNode)>0){const d=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:f}=this.state.containerGroups[d];if(f.length>0){const m=f.findIndex(p=>p===this.state.mostRecentlyFocusedNode);m>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?m+1<f.length&&(u=f[m+1],l=!1):m-1>=0&&(u=f[m-1],l=!1))}}else this.state.containerGroups.some(d=>d.tabbableNodes.some(f=>La(f)>0))||(l=!1);else l=!1;l&&(u=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),u?this.tryFocus(u):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),Ct(this,"handlePointerDown",r=>{const s=fr(r);if(!(this.findContainerIndex(s,r)>=0)){if(ja(this.config.clickOutsideDeactivates,r)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}ja(this.config.allowOutsideClick,r)||r.preventDefault()}}),Ct(this,"handleClick",r=>{const s=fr(r);this.findContainerIndex(s,r)>=0||ja(this.config.clickOutsideDeactivates,r)||ja(this.config.allowOutsideClick,r)||(r.preventDefault(),r.stopImmediatePropagation())}),Ct(this,"handleTabKey",r=>{if(this.config.isKeyForward(r)||this.config.isKeyBackward(r)){this.state.recentNavEvent=r;const s=this.config.isKeyBackward(r),a=this.findNextNavNode({event:r,isBackward:s});if(!a)return;Ha(r)&&r.preventDefault(),this.tryFocus(a)}}),Ct(this,"handleEscapeKey",r=>{bD(r)&&ja(this.config.escapeDeactivates,r)!==!1&&(r.preventDefault(),this.deactivate())}),Ct(this,"_mutationObserver"),Ct(this,"setupMutationObserver",()=>{const r=this.doc.defaultView||window;this._mutationObserver=new r.MutationObserver(s=>{s.some(l=>Array.from(l.removedNodes).some(f=>f===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode()),s.some(l=>l.type==="attributes"&&(l.attributeName==="aria-controls"||l.attributeName==="aria-expanded")?!0:l.type==="childList"&&l.addedNodes.length>0?Array.from(l.addedNodes).some(d=>{if(d.nodeType!==Node.ELEMENT_NODE)return!1;const f=d;return z4(f)?!0:f.id&&!this.state.containers.some(m=>m.contains(f))?$4(f):!1}):!1)&&this.state.active&&!this.state.paused&&(this.updateTabbableNodes(),this.updatePortalContainers())})}),Ct(this,"updateObservedNodes",()=>{var r;(r=this._mutationObserver)==null||r.disconnect(),this.state.active&&!this.state.paused&&(this.state.containers.map(s=>{var a;(a=this._mutationObserver)==null||a.observe(s,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}),this.portalContainers.forEach(s=>{this.observePortalContainer(s)}))}),Ct(this,"getInitialFocusNode",()=>{let r=this.getNodeForOption("initialFocus",{hasFallback:!0});if(r===!1)return!1;if(r===void 0||r&&!Nr(r)){const s=so(this.doc);if(s&&this.findContainerIndex(s)>=0)r=s;else{const a=this.state.tabbableGroups[0];r=a&&a.firstTabbableNode||this.getNodeForOption("fallbackFocus")}}else r===null&&(r=this.getNodeForOption("fallbackFocus"));if(!r)throw new Error("Your focus-trap needs to have at least one focusable element");return r.isConnected||(r=this.getNodeForOption("fallbackFocus")),r}),Ct(this,"tryFocus",r=>{if(r!==!1&&r!==so(this.doc)){if(!r||!r.focus){this.tryFocus(this.getInitialFocusNode());return}r.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=r,wD(r)&&r.select()}}),Ct(this,"deactivate",r=>{if(!this.state.active)return this;const s=j({onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus},r);clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),lb.deactivateTrap(this.trapStack,this),this.portalContainers.clear();const a=this.getOption(s,"onDeactivate"),u=this.getOption(s,"onPostDeactivate"),l=this.getOption(s,"checkCanReturnFocus"),d=this.getOption(s,"returnFocus","returnFocusOnDeactivate");a==null||a();const f=()=>{cb(()=>{if(d){const m=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(m)}u==null||u()})};if(d&&l){const m=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return l(m).then(f,f),this}return f(),this}),Ct(this,"pause",r=>{if(this.state.paused||!this.state.active)return this;const s=this.getOption(r,"onPause"),a=this.getOption(r,"onPostPause");return this.state.paused=!0,s==null||s(),this.removeListeners(),this.updateObservedNodes(),a==null||a(),this}),Ct(this,"unpause",r=>{if(!this.state.paused||!this.state.active)return this;const s=this.getOption(r,"onUnpause"),a=this.getOption(r,"onPostUnpause");return this.state.paused=!1,s==null||s(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),a==null||a(),this}),Ct(this,"updateContainerElements",r=>(this.state.containers=Array.isArray(r)?r.filter(Boolean):[r].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),Ct(this,"getReturnFocusNode",r=>{const s=this.getNodeForOption("setReturnFocus",{params:[r]});return s||(s===!1?!1:r)}),Ct(this,"getOption",(r,s,a)=>r&&r[s]!==void 0?r[s]:this.config[a||s]),Ct(this,"getNodeForOption",(r,{hasFallback:s=!1,params:a=[]}={})=>{let u=this.config[r];if(typeof u=="function"&&(u=u(...a)),u===!0&&(u=void 0),!u){if(u===void 0||u===!1)return u;throw new Error(`\`${r}\` was specified but was not a node, or did not return a node`)}let l=u;if(typeof u=="string"){try{l=this.doc.querySelector(u)}catch(d){throw new Error(`\`${r}\` appears to be an invalid selector; error="${d.message}"`)}if(!l&&!s)throw new Error(`\`${r}\` as selector refers to no known node`)}return l}),Ct(this,"findNextNavNode",r=>{const{event:s,isBackward:a=!1}=r,u=r.target||fr(s);this.updateTabbableNodes();let l=null;if(this.state.tabbableGroups.length>0){const d=this.findContainerIndex(u,s),f=d>=0?this.state.containerGroups[d]:void 0;if(d<0)a?l=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:l=this.state.tabbableGroups[0].firstTabbableNode;else if(a){let m=this.state.tabbableGroups.findIndex(({firstTabbableNode:p})=>u===p);if(m<0&&((f==null?void 0:f.container)===u||Nr(u)&&!us(u)&&!(f!=null&&f.nextTabbableNode(u,!1)))&&(m=d),m>=0){const p=m===0?this.state.tabbableGroups.length-1:m-1,b=this.state.tabbableGroups[p];l=La(u)>=0?b.lastTabbableNode:b.lastDomTabbableNode}else Ha(s)||(l=f==null?void 0:f.nextTabbableNode(u,!1))}else{let m=this.state.tabbableGroups.findIndex(({lastTabbableNode:p})=>u===p);if(m<0&&((f==null?void 0:f.container)===u||Nr(u)&&!us(u)&&!(f!=null&&f.nextTabbableNode(u)))&&(m=d),m>=0){const p=m===this.state.tabbableGroups.length-1?0:m+1,b=this.state.tabbableGroups[p];l=La(u)>=0?b.firstTabbableNode:b.firstDomTabbableNode}else Ha(s)||(l=f==null?void 0:f.nextTabbableNode(u))}}else l=this.getNodeForOption("fallbackFocus");return l}),this.trapStack=t.trapStack||yD;const n=j({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,followControlledElements:!0,isKeyForward(r){return Ha(r)&&!r.shiftKey},isKeyBackward(r){return Ha(r)&&r.shiftKey}},t);this.doc=n.document||Cr(Array.isArray(e)?e[0]:e),this.config=n,this.updateContainerElements(e),this.setupMutationObserver()}addPortalContainer(e){const t=e.parentElement;t&&!this.portalContainers.has(t)&&(this.portalContainers.add(t),this.state.active&&!this.state.paused&&this.observePortalContainer(t))}observePortalContainer(e){var t;(t=this._mutationObserver)==null||t.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}updatePortalContainers(){this.config.followControlledElements&&this.state.containers.forEach(e=>{U4(e).forEach(n=>{this.addPortalContainer(n)})})}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){const n=typeof(t==null?void 0:t.composedPath)=="function"?t.composedPath():void 0;return this.state.containerGroups.findIndex(({container:r,tabbableNodes:s})=>r.contains(e)||(n==null?void 0:n.includes(r))||s.find(a=>a===e)||this.isControlledElement(r,e))}isControlledElement(e,t){return this.config.followControlledElements?lT(e,t):!1}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{const t=ao(e,{getShadowRoot:this.config.getShadowRoot}),n=yT(e,{getShadowRoot:this.config.getShadowRoot}),r=t[0],s=t[t.length-1],a=r,u=s;let l=!1;for(let f=0;f<t.length;f++)if(La(t[f])>0){l=!0;break}function d(f,m=!0){const p=t.indexOf(f);if(p>=0)return t[p+(m?1:-1)];const b=n.indexOf(f);if(!(b<0)){if(m){for(let y=b+1;y<n.length;y++)if(us(n[y]))return n[y]}else for(let y=b-1;y>=0;y--)if(us(n[y]))return n[y]}}return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:l,firstTabbableNode:r,lastTabbableNode:s,firstDomTabbableNode:a,lastDomTabbableNode:u,nextTabbableNode:d}}),this.state.tabbableGroups=this.state.containerGroups.filter(e=>e.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(e=>e.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return lb.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?cb(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(Zt(this.doc,"focusin",this.handleFocus,!0),Zt(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),Zt(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),Zt(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),Zt(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),Zt(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(e=>e()),this.listenerCleanups=[],this}activate(e){if(this.state.active)return this;const t=this.getOption(e,"onActivate"),n=this.getOption(e,"onPostActivate"),r=this.getOption(e,"checkCanFocusTrap");r||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=so(this.doc),t==null||t();const s=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),n==null||n()};return r?(r(this.state.containers.concat()).then(s,s),this):(s(),this)}},Ha=e=>e.key==="Tab",ja=(e,...t)=>typeof e=="function"?e(...t):e,bD=e=>!e.isComposing&&e.key==="Escape",cb=e=>setTimeout(e,0),wD=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function db(e,t={}){let n;const r=qt(()=>{const s=typeof e=="function"?e():e;if(s){n=new TD(s,ce(j({escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:s},t),{document:Cr(s)}));try{n.activate()}catch(a){}}});return function(){n==null||n.deactivate(),r()}}var qh="data-scroll-lock";function _D(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function fb(e){const t=oo(e),n=t==null?void 0:t.scrollbarGutter;return n==="stable"||(n==null?void 0:n.startsWith("stable "))===!0}function hb(e){var y;const t=e!=null?e:document,n=(y=t.defaultView)!=null?y:window,{documentElement:r,body:s}=t;if(s.hasAttribute(qh))return;const u=fb(r)||fb(s),l=n.innerWidth-r.clientWidth;s.setAttribute(qh,"");const d=()=>yL(r,"--scrollbar-width",`${l}px`),f=_D(r),m=()=>{const _={overflow:"hidden"};return!u&&l>0&&(_[f]=`${l}px`),Ml(s,_)},p=()=>{var G,M;const{scrollX:_,scrollY:x,visualViewport:A}=n,S=(G=A==null?void 0:A.offsetLeft)!=null?G:0,C=(M=A==null?void 0:A.offsetTop)!=null?M:0,O={position:"fixed",overflow:"hidden",top:`${-(x-Math.floor(C))}px`,left:`${-(_-Math.floor(S))}px`,right:"0"};!u&&l>0&&(O[f]=`${l}px`);const z=Ml(s,O);return()=>{z==null||z(),n.scrollTo({left:_,top:x,behavior:"instant"})}},b=[d(),Rl()?p():m()];return()=>{b.forEach(_=>_==null?void 0:_()),s.removeAttribute(qh)}}var xD=cs("popover").parts("arrow","arrowTip","anchor","trigger","indicator","positioner","content","title","description","closeTrigger"),Lr=xD.build(),pb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.anchor)!=null?n:`popover:${e.id}:anchor`},mb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`popover:${e.id}:trigger`},Yh=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`popover:${e.id}:content`},gb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`popover:${e.id}:popper`},SD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.arrow)!=null?n:`popover:${e.id}:arrow`},Wh=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`popover:${e.id}:title`},Gh=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`popover:${e.id}:desc`},vD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`popover:${e.id}:close`},Eb=e=>e.getById(pb(e)),yo=e=>e.getById(mb(e)),To=e=>e.getById(Yh(e)),yb=e=>e.getById(gb(e)),AD=e=>e.getById(Wh(e)),kD=e=>e.getById(Gh(e));function CD(e,t){const{state:n,context:r,send:s,computed:a,prop:u,scope:l}=e,d=n.matches("open"),f=r.get("currentPlacement"),m=a("currentPortalled"),p=r.get("renderedElements"),b=X5(ce(j({},u("positioning")),{placement:f}));return{portalled:m,open:d,setOpen(y){n.matches("open")!==y&&s({type:y?"OPEN":"CLOSE"})},reposition(y={}){s({type:"POSITIONING.SET",options:y})},getArrowProps(){return t.element(ce(j({id:SD(l)},Lr.arrow.attrs),{dir:u("dir"),style:b.arrow}))},getArrowTipProps(){return t.element(ce(j({},Lr.arrowTip.attrs),{dir:u("dir"),style:b.arrowTip}))},getAnchorProps(){return t.element(ce(j({},Lr.anchor.attrs),{dir:u("dir"),id:pb(l)}))},getTriggerProps(){return t.button(ce(j({},Lr.trigger.attrs),{dir:u("dir"),type:"button","data-placement":f,id:mb(l),"aria-haspopup":"dialog","aria-expanded":d,"data-state":d?"open":"closed","aria-controls":Yh(l),onPointerDown(y){fT(y)&&X4()&&y.currentTarget.focus()},onClick(y){y.defaultPrevented||s({type:"TOGGLE"})},onBlur(y){s({type:"TRIGGER_BLUR",target:y.relatedTarget})}}))},getIndicatorProps(){return t.element(ce(j({},Lr.indicator.attrs),{dir:u("dir"),"data-state":d?"open":"closed"}))},getPositionerProps(){return t.element(ce(j({id:gb(l)},Lr.positioner.attrs),{dir:u("dir"),style:b.floating}))},getContentProps(){return t.element(ce(j({},Lr.content.attrs),{dir:u("dir"),id:Yh(l),tabIndex:-1,role:"dialog","aria-modal":oT(u("modal")),hidden:!d,"data-state":d?"open":"closed","data-expanded":no(d),"aria-labelledby":p.title?Wh(l):void 0,"aria-describedby":p.description?Gh(l):void 0,"data-placement":f}))},getTitleProps(){return t.element(ce(j({},Lr.title.attrs),{id:Wh(l),dir:u("dir")}))},getDescriptionProps(){return t.element(ce(j({},Lr.description.attrs),{id:Gh(l),dir:u("dir")}))},getCloseTriggerProps(){return t.button(ce(j({},Lr.closeTrigger.attrs),{dir:u("dir"),id:vD(l),type:"button","aria-label":"close",onClick(y){y.defaultPrevented||(y.stopPropagation(),s({type:"CLOSE"}))}}))}}}var ND={props({props:e}){return ce(j({closeOnInteractOutside:!0,closeOnEscape:!0,autoFocus:!0,modal:!1,portalled:!0},e),{positioning:j({placement:"bottom"},e.positioning)})},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{currentPlacement:e(()=>({defaultValue:void 0})),renderedElements:e(()=>({defaultValue:{title:!0,description:!0}}))}},computed:{currentPortalled:({prop:e})=>!!e("modal")||!!e("portalled")},watch({track:e,prop:t,action:n}){e([()=>t("open")],()=>{n(["toggleVisibility"])})},entry:["checkRenderedElements"],states:{closed:{on:{"CONTROLLED.OPEN":{target:"open",actions:["setInitialFocus"]},TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus"]}]}},open:{effects:["trapFocus","preventScroll","hideContentBelow","trackPositioning","trackDismissableElement","proxyTabFocus"],on:{"CONTROLLED.CLOSE":{target:"closed",actions:["setFinalFocus"]},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose","setFinalFocus"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"POSITIONING.SET":{actions:["reposition"]}}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackPositioning({context:e,prop:t,scope:n}){var a;e.set("currentPlacement",t("positioning").placement);const r=(a=Eb(n))!=null?a:yo(n);return QT(r,()=>yb(n),ce(j({},t("positioning")),{defer:!0,onComplete(u){e.set("currentPlacement",u.placement)}}))},trackDismissableElement({send:e,prop:t,scope:n}){const r=()=>To(n);let s=!0;return ub(r,{type:"popover",pointerBlocking:t("modal"),exclude:yo(n),defer:!0,onEscapeKeyDown(a){var u;(u=t("onEscapeKeyDown"))==null||u(a),!t("closeOnEscape")&&a.preventDefault()},onInteractOutside(a){var u;(u=t("onInteractOutside"))==null||u(a),!a.defaultPrevented&&(s=!(a.detail.focusable||a.detail.contextmenu),t("closeOnInteractOutside")||a.preventDefault())},onPointerDownOutside:t("onPointerDownOutside"),onFocusOutside:t("onFocusOutside"),persistentElements:t("persistentElements"),onRequestDismiss:t("onRequestDismiss"),onDismiss(){e({type:"CLOSE",src:"interact-outside",restoreFocus:s})}})},proxyTabFocus({prop:e,scope:t}){return e("modal")||!e("portalled")?void 0:gL(()=>To(t),{triggerElement:yo(t),defer:!0,getShadowRoot:!0,onFocus(r){r.focus({preventScroll:!0})}})},hideContentBelow({prop:e,scope:t}){return e("modal")?ZT(()=>[To(t),yo(t)],{defer:!0}):void 0},preventScroll({prop:e,scope:t}){if(e("modal"))return hb(t.getDoc())},trapFocus({prop:e,scope:t}){return e("modal")?db(()=>To(t),{initialFocus:()=>TT({root:To(t),getInitialEl:e("initialFocusEl"),enabled:e("autoFocus")}),getShadowRoot:!0}):void 0}},actions:{reposition({event:e,prop:t,scope:n,context:r}){var u;const s=(u=Eb(n))!=null?u:yo(n);QT(s,()=>yb(n),ce(j(j({},t("positioning")),e.options),{defer:!0,listeners:!1,onComplete(l){r.set("currentPlacement",l.placement)}}))},checkRenderedElements({context:e,scope:t}){qt(()=>{Object.assign(e.get("renderedElements"),{title:!!AD(t),description:!!kD(t)})})},setInitialFocus({prop:e,scope:t}){e("modal")||qt(()=>{const n=TT({root:To(t),getInitialEl:e("initialFocusEl"),enabled:e("autoFocus")});n==null||n.focus({preventScroll:!0})})},setFinalFocus({event:e,scope:t}){var r,s;const n=(s=e.restoreFocus)!=null?s:(r=e.previousEvent)==null?void 0:r.restoreFocus;n!=null&&!n||qt(()=>{const a=yo(t);a==null||a.focus({preventScroll:!0})})},invokeOnOpen({prop:e,flush:t}){t(()=>{var n;(n=e("onOpenChange"))==null||n({open:!0})})},invokeOnClose({prop:e,flush:t}){t(()=>{var n;(n=e("onOpenChange"))==null||n({open:!1})})},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}};co()(["autoFocus","closeOnEscape","closeOnInteractOutside","dir","getRootNode","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","portalled","positioning"]);const[jU,Ql]=ls({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}}),[zU,Xh]=ls({name:"LocaleContext",hookName:"useLocaleContext",providerName:"<LocaleProvider />",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}}),OD=e=>{const t=R.useId(),{getRootNode:n}=Ql(),{dir:r}=Xh(),s=j({id:t,dir:r,getRootNode:n},e),a=Bl(ND,s);return CD(a,Nh)},ID=e=>{const[t,u]=CT(e),l=u,{children:n}=l,r=Sn(l,["children"]),s=OD(r),a=Ph(Yt({present:s.open},t));return w.jsx(IL,{value:s,children:w.jsx(vT,{value:a,children:n})})},Tb=R.forwardRef((e,t)=>{const n=Ih(),r=Da(),s=Yt(ce(j({},n.getTriggerProps()),{"aria-controls":r.unmounted?void 0:n.getTriggerProps()["aria-controls"]}),e);return w.jsx(hn.button,ce(j({},s),{ref:t}))});Tb.displayName="PopoverTrigger";function PD(e){return ht({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M11.854 3.646a.5.5 0 0 1 0 .708L8.207 8l3.647 3.646a.5.5 0 0 1-.708.708l-4-4a.5.5 0 0 1 0-.708l4-4a.5.5 0 0 1 .708 0M4.5 1a.5.5 0 0 0-.5.5v13a.5.5 0 0 0 1 0v-13a.5.5 0 0 0-.5-.5"},child:[]}]})(e)}function RD(e){return ht({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.146 3.646a.5.5 0 0 0 0 .708L7.793 8l-3.647 3.646a.5.5 0 0 0 .708.708l4-4a.5.5 0 0 0 0-.708l-4-4a.5.5 0 0 0-.708 0M11.5 1a.5.5 0 0 1 .5.5v13a.5.5 0 0 1-1 0v-13a.5.5 0 0 1 .5-.5"},child:[]}]})(e)}function bb(e){return ht({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0"},child:[]}]})(e)}function wb(e){return ht({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708"},child:[]}]})(e)}function LD(e){return ht({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8 2a.5.5 0 0 1 .5.5v5h5a.5.5 0 0 1 0 1h-5v5a.5.5 0 0 1-1 0v-5h-5a.5.5 0 0 1 0-1h5v-5A.5.5 0 0 1 8 2"},child:[]}]})(e)}function DD(e){return ht({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576zm6.787-8.201L1.591 6.602l4.339 2.76z"},child:[]}]})(e)}function Kh(e){return ht({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M7.657 6.247c.11-.33.576-.33.686 0l.645 1.937a2.89 2.89 0 0 0 1.829 1.828l1.936.645c.33.11.33.576 0 .686l-1.937.645a2.89 2.89 0 0 0-1.828 1.829l-.645 1.936a.361.361 0 0 1-.686 0l-.645-1.937a2.89 2.89 0 0 0-1.828-1.828l-1.937-.645a.361.361 0 0 1 0-.686l1.937-.645a2.89 2.89 0 0 0 1.828-1.828zM3.794 1.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387A1.73 1.73 0 0 0 4.593 5.69l-.387 1.162a.217.217 0 0 1-.412 0L3.407 5.69A1.73 1.73 0 0 0 2.31 4.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387A1.73 1.73 0 0 0 3.407 2.31zM10.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.16 1.16 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.16 1.16 0 0 0-.732-.732L9.1 2.137a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732z"},child:[]}]})(e)}function _b(e){return ht({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"},child:[]}]})(e)}const MD=({className:e,componentType:t,children:n})=>{const[r,s]=R.useState(!1),{globalClassName:a}=ft(),u=f=>{s(f.open)},l=R.useCallback(()=>{s(!1)},[]),d=R.useMemo(()=>({closeMenu:l}),[l]);return w.jsxs(ID,{open:r,onOpenChange:u,positioning:{placement:"bottom-end"},children:[w.jsx(Tb,{"aria-label":`Overflow menu for ${t}`,className:B(`${N}-overflow-menu-button-trigger`,`${N}-icon-button`,a,e,`cim-${t}-component`),children:w.jsx(_b,{})}),w.jsx(kT,{children:w.jsx(AT,{className:B(`${N}-overflow-menu-list`,a,`cim-${t}-component`),children:w.jsx(Jy.Provider,{value:d,children:n})})})]})};function xb(e){return ht({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M15 4.00008H13V11.0001H20V9.00008H16.4142L20.7071 4.70718L19.2929 3.29297L15 7.58586V4.00008ZM4.00008 15H7.58586L3.29297 19.2929L4.70718 20.7071L9.00008 16.4142V20H11.0001V13H4.00008V15Z"},child:[]}]})(e)}function Sb(e){return ht({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17.5858 5H14V3H21V10H19V6.41421L14.7071 10.7071L13.2929 9.29289L17.5858 5ZM3 14H5V17.5858L9.29289 13.2929L10.7071 14.7071L6.41421 19H10V21H3V14Z"},child:[]}]})(e)}const[FD,hs]=ls({name:"CarouselContext",hookName:"useCarouselContext",providerName:"<CarouselProvider />"}),Qh=R.forwardRef((e,t)=>{const n=hs(),r=Yt(n.getControlProps(),e);return w.jsx(hn.div,ce(j(j({},r),e),{ref:t}))});Qh.displayName="CarouselControl";const Jh=R.forwardRef((e,t)=>{const[n,r]=Ma()(e,["readOnly","index"]),s=hs(),a=Yt(s.getIndicatorProps(n),r);return w.jsx(hn.button,ce(j({},a),{ref:t}))});Jh.displayName="CarouselIndicator";const Zh=R.forwardRef((e,t)=>{const n=hs(),r=Yt(n.getIndicatorGroupProps(),e);return w.jsx(hn.div,ce(j({},r),{ref:t}))});Zh.displayName="CarouselIndicatorGroup";const ep=R.forwardRef((e,t)=>{const[n,r]=Ma()(e,["index","snapAlign"]),s=hs(),a=Yt(s.getItemProps(n),r);return w.jsx(hn.div,ce(j({},a),{ref:t}))});ep.displayName="CarouselItem";const tp=R.forwardRef((e,t)=>{const n=hs(),r=Yt(n.getItemGroupProps(),e);return w.jsx(hn.div,ce(j({},r),{ref:t}))});tp.displayName="CarouselItemGroup";const np=R.forwardRef((e,t)=>{const n=hs(),r=Yt(n.getNextTriggerProps(),e);return w.jsx(hn.button,ce(j({},r),{ref:t}))});np.displayName="CarouselNextTrigger";const rp=R.forwardRef((e,t)=>{const n=hs(),r=Yt(n.getPrevTriggerProps(),e);return w.jsx(hn.button,ce(j({},r),{ref:t}))});rp.displayName="CarouselPrevTrigger";function BD(e){const t=oo(e),n=e.getBoundingClientRect();let r=t.getPropertyValue("scroll-padding-left").replace("auto","0px"),s=t.getPropertyValue("scroll-padding-top").replace("auto","0px"),a=t.getPropertyValue("scroll-padding-right").replace("auto","0px"),u=t.getPropertyValue("scroll-padding-bottom").replace("auto","0px");function l(b,y){let _=parseFloat(b);return/%/.test(b)&&(_/=100,_*=y),Number.isNaN(_)?0:_}let d=l(r,n.width),f=l(s,n.height),m=l(a,n.width),p=l(u,n.height);return{x:{before:d,after:m},y:{before:f,after:p}}}function UD(e,t,n="both"){return n==="x"&&e.right>=t.left&&e.left<=t.right||n==="y"&&e.bottom>=t.top&&e.top<=t.bottom||n==="both"&&e.right>=t.left&&e.left<=t.right&&e.bottom>=t.top&&e.top<=t.bottom}function vb(e){let t=[];for(const n of e.children)t=t.concat(n,vb(n));return t}function Ab(e,t=!1){const n=e.getBoundingClientRect(),r={x:{start:[],center:[],end:[]},y:{start:[],center:[],end:[]}},s=t?vb(e):e.children;for(const a of["x","y"]){const u=a==="x"?"y":"x",l=a==="x"?"left":"top",d=a==="x"?"width":"height",f=a==="x"?"scrollLeft":"scrollTop";for(const m of s){const p=m.getBoundingClientRect();if(!UD(n,p,u))continue;const b=oo(m);let[y,_]=b.getPropertyValue("scroll-snap-align").split(" ");typeof _=="undefined"&&(_=y);const x=a==="x"?_:y,A=p[l]-n[l]+e[f];switch(x){case"none":break;case"start":r[a].start.push({node:m,position:A});break;case"center":r[a].center.push({node:m,position:A+p[d]/2});break;case"end":r[a].end.push({node:m,position:A+p[d]});break}}}return r}function kb(e){const t=e.getBoundingClientRect(),n=BD(e),r=Ab(e),s={x:e.scrollWidth-e.offsetWidth,y:e.scrollHeight-e.offsetHeight};return{x:Cb([...r.x.start.map(a=>a.position-n.x.before),...r.x.center.map(a=>a.position-t.width/2),...r.x.end.map(a=>a.position-t.width+n.x.after)].map(Nb(0,s.x))),y:Cb([...r.y.start.map(a=>a.position-n.y.before),...r.y.center.map(a=>a.position-t.height/2),...r.y.end.map(a=>a.position-t.height+n.y.after)].map(Nb(0,s.y)))}}function HD(e,t,n){const r=Ab(e),s=[...r[t].start,...r[t].center,...r[t].end];for(const a of s)if(n(a.node))return a.position}var Cb=e=>[...new Set(e)],Nb=(e,t)=>n=>Math.max(e,Math.min(t,n)),jD=cs("carousel").parts("root","itemGroup","item","control","nextTrigger","prevTrigger","indicatorGroup","indicator","autoplayTrigger"),Xr=jD.build(),zD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.root)!=null?n:`carousel:${e.id}`},$D=(e,t)=>{var n,r,s;return(s=(r=(n=e.ids)==null?void 0:n.item)==null?void 0:r.call(n,t))!=null?s:`carousel:${e.id}:item:${t}`},Jl=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.itemGroup)!=null?n:`carousel:${e.id}:item-group`},VD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.nextTrigger)!=null?n:`carousel:${e.id}:next-trigger`},qD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.prevTrigger)!=null?n:`carousel:${e.id}:prev-trigger`},YD=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.indicatorGroup)!=null?n:`carousel:${e.id}:indicator-group`},Ob=(e,t)=>{var n,r,s;return(s=(r=(n=e.ids)==null?void 0:n.indicator)==null?void 0:r.call(n,t))!=null?s:`carousel:${e.id}:indicator:${t}`},Pn=e=>e.getById(Jl(e)),Ib=e=>EL(Pn(e),"[data-part=item]"),WD=(e,t)=>e.getById(Ob(e,t)),Pb=e=>{const t=Pn(e);if(!t)return;const n=ao(t);t.setAttribute("tabindex",n.length>0?"-1":"0")};function GD(e,t){const{state:n,context:r,computed:s,send:a,scope:u,prop:l}=e,d=n.matches("autoplay"),f=n.matches("dragging"),m=s("canScrollNext"),p=s("canScrollPrev"),b=s("isHorizontal"),y=Array.from(r.get("pageSnapPoints")),_=r.get("page"),x=l("slidesPerPage"),A=l("padding"),S=l("translations");return{isPlaying:d,isDragging:f,page:_,pageSnapPoints:y,canScrollNext:m,canScrollPrev:p,getProgress(){return _/y.length},scrollToIndex(C,O){a({type:"INDEX.SET",index:C,instant:O})},scrollTo(C,O){a({type:"PAGE.SET",index:C,instant:O})},scrollNext(C){a({type:"PAGE.NEXT",instant:C})},scrollPrev(C){a({type:"PAGE.PREV",instant:C})},play(){a({type:"AUTOPLAY.START"})},pause(){a({type:"AUTOPLAY.PAUSE"})},isInView(C){return Array.from(r.get("slidesInView")).includes(C)},refresh(){a({type:"SNAP.REFRESH"})},getRootProps(){return t.element(ce(j({},Xr.root.attrs),{id:zD(u),role:"region","aria-roledescription":"carousel","data-orientation":l("orientation"),dir:l("dir"),style:{"--slides-per-page":x,"--slide-spacing":l("spacing"),"--slide-item-size":"calc(100% / var(--slides-per-page) - var(--slide-spacing) * (var(--slides-per-page) - 1) / var(--slides-per-page))"}}))},getItemGroupProps(){return t.element(ce(j({},Xr.itemGroup.attrs),{id:Jl(u),"data-orientation":l("orientation"),"data-dragging":no(f),dir:l("dir"),"aria-live":d?"off":"polite",onFocus(C){ro(C.currentTarget,fr(C))&&a({type:"VIEWPORT.FOCUS"})},onBlur(C){ro(C.currentTarget,C.relatedTarget)||a({type:"VIEWPORT.BLUR"})},onMouseDown(C){if(C.defaultPrevented||!l("allowMouseDrag")||!fT(C))return;const O=fr(C);Nr(O)&&O!==C.currentTarget||(C.preventDefault(),a({type:"DRAGGING.START"}))},onWheel:E4(C=>{const O=l("orientation")==="horizontal"?"deltaX":"deltaY";C[O]<0&&!s("canScrollPrev")||C[O]>0&&!s("canScrollNext")||a({type:"USER.SCROLL"})},150),onTouchStart(){a({type:"USER.SCROLL"})},style:{display:"grid",gap:"var(--slide-spacing)",scrollSnapType:[b?"x":"y",l("snapType")].join(" "),gridAutoFlow:b?"column":"row",scrollbarWidth:"none",overscrollBehaviorX:"contain",[b?"gridAutoColumns":"gridAutoRows"]:"var(--slide-item-size)",[b?"scrollPaddingInline":"scrollPaddingBlock"]:A,[b?"paddingInline":"paddingBlock"]:A,[b?"overflowX":"overflowY"]:"auto"}}))},getItemProps(C){const O=r.get("slidesInView").includes(C.index);return t.element(ce(j({},Xr.item.attrs),{id:$D(u,C.index),dir:l("dir"),role:"group","data-index":C.index,"data-inview":no(O),"aria-roledescription":"slide","data-orientation":l("orientation"),"aria-label":S.item(C.index,l("slideCount")),"aria-hidden":oT(!O),style:{scrollSnapAlign:(()=>{var J;const z=(J=C.snapAlign)!=null?J:"start",G=l("slidesPerMove"),M=G==="auto"?Math.floor(l("slidesPerPage")):G;return(C.index+M)%M===0?z:void 0})()}}))},getControlProps(){return t.element(ce(j({},Xr.control.attrs),{"data-orientation":l("orientation")}))},getPrevTriggerProps(){return t.button(ce(j({},Xr.prevTrigger.attrs),{id:qD(u),type:"button",disabled:!p,dir:l("dir"),"aria-label":S.prevTrigger,"data-orientation":l("orientation"),"aria-controls":Jl(u),onClick(C){C.defaultPrevented||a({type:"PAGE.PREV",src:"trigger"})}}))},getNextTriggerProps(){return t.button(ce(j({},Xr.nextTrigger.attrs),{dir:l("dir"),id:VD(u),type:"button","aria-label":S.nextTrigger,"data-orientation":l("orientation"),"aria-controls":Jl(u),disabled:!m,onClick(C){C.defaultPrevented||a({type:"PAGE.NEXT",src:"trigger"})}}))},getIndicatorGroupProps(){return t.element(ce(j({},Xr.indicatorGroup.attrs),{dir:l("dir"),id:YD(u),"data-orientation":l("orientation"),onKeyDown(C){if(C.defaultPrevented)return;const O="indicator",z={ArrowDown(V){b||(a({type:"PAGE.NEXT",src:O}),V.preventDefault())},ArrowUp(V){b||(a({type:"PAGE.PREV",src:O}),V.preventDefault())},ArrowRight(V){b&&(a({type:"PAGE.NEXT",src:O}),V.preventDefault())},ArrowLeft(V){b&&(a({type:"PAGE.PREV",src:O}),V.preventDefault())},Home(V){a({type:"PAGE.SET",index:0,src:O}),V.preventDefault()},End(V){a({type:"PAGE.SET",index:y.length-1,src:O}),V.preventDefault()}},G=eL(C,{dir:l("dir"),orientation:l("orientation")}),M=z[G];M==null||M(C)}}))},getIndicatorProps(C){return t.button(ce(j({},Xr.indicator.attrs),{dir:l("dir"),id:Ob(u,C.index),type:"button","data-orientation":l("orientation"),"data-index":C.index,"data-readonly":no(C.readOnly),"data-current":no(C.index===_),"aria-label":S.indicator(C.index),onClick(O){O.defaultPrevented||C.readOnly||a({type:"PAGE.SET",index:C.index,src:"indicator"})}}))},getAutoplayTriggerProps(){return t.button(ce(j({},Xr.autoplayTrigger.attrs),{type:"button","data-orientation":l("orientation"),"data-pressed":no(d),"aria-label":d?S.autoplayStop:S.autoplayStart,onClick(C){C.defaultPrevented||a({type:d?"AUTOPLAY.PAUSE":"AUTOPLAY.START"})}}))}}}var XD={props({props:e}){return x4(e,["slideCount"],"carousel"),ce(j({dir:"ltr",defaultPage:0,orientation:"horizontal",snapType:"mandatory",loop:!!e.autoplay,slidesPerPage:1,slidesPerMove:"auto",spacing:"0px",autoplay:!1,allowMouseDrag:!1,inViewThreshold:.6},e),{translations:j({nextTrigger:"Next slide",prevTrigger:"Previous slide",indicator:t=>`Go to slide ${t+1}`,item:(t,n)=>`${t+1} of ${n}`,autoplayStart:"Start slide rotation",autoplayStop:"Stop slide rotation"},e.translations)})},refs(){return{timeoutRef:void 0}},initialState({prop:e}){return e("autoplay")?"autoplay":"idle"},context({prop:e,bindable:t,getContext:n}){return{page:t(()=>({defaultValue:e("defaultPage"),value:e("page"),onChange(r){var u;const a=n().get("pageSnapPoints");(u=e("onPageChange"))==null||u({page:r,pageSnapPoint:a[r]})}})),pageSnapPoints:t(()=>({defaultValue:KD(e("slideCount"),e("slidesPerMove"),e("slidesPerPage"))})),slidesInView:t(()=>({defaultValue:[]}))}},computed:{isRtl:({prop:e})=>e("dir")==="rtl",isHorizontal:({prop:e})=>e("orientation")==="horizontal",canScrollNext:({prop:e,context:t})=>e("loop")||t.get("page")<t.get("pageSnapPoints").length-1,canScrollPrev:({prop:e,context:t})=>e("loop")||t.get("page")>0,autoplayInterval:({prop:e})=>{const t=e("autoplay");return o4(t)?t.delay:4e3}},watch({track:e,action:t,context:n,prop:r,send:s}){e([()=>r("slidesPerPage"),()=>r("slidesPerMove")],()=>{t(["setSnapPoints"])}),e([()=>n.get("page")],()=>{t(["scrollToPage","focusIndicatorEl"])}),e([()=>r("orientation")],()=>{t(["setSnapPoints","scrollToPage"])}),e([()=>r("slideCount")],()=>{s({type:"SNAP.REFRESH",src:"slide.count"})}),e([()=>!!r("autoplay")],()=>{s({type:r("autoplay")?"AUTOPLAY.START":"AUTOPLAY.PAUSE",src:"autoplay.prop.change"})})},on:{"PAGE.NEXT":{target:"idle",actions:["clearScrollEndTimer","setNextPage"]},"PAGE.PREV":{target:"idle",actions:["clearScrollEndTimer","setPrevPage"]},"PAGE.SET":{target:"idle",actions:["clearScrollEndTimer","setPage"]},"INDEX.SET":{target:"idle",actions:["clearScrollEndTimer","setMatchingPage"]},"SNAP.REFRESH":{actions:["setSnapPoints","clampPage"]},"PAGE.SCROLL":{actions:["scrollToPage"]}},effects:["trackSlideMutation","trackSlideIntersections","trackSlideResize"],entry:["setSnapPoints","setPage"],exit:["clearScrollEndTimer"],states:{idle:{on:{"DRAGGING.START":{target:"dragging",actions:["invokeDragStart"]},"AUTOPLAY.START":{target:"autoplay",actions:["invokeAutoplayStart"]},"USER.SCROLL":{target:"userScroll"},"VIEWPORT.FOCUS":{target:"focus"}}},focus:{effects:["trackKeyboardScroll"],on:{"VIEWPORT.BLUR":{target:"idle"},"PAGE.NEXT":{actions:["clearScrollEndTimer","setNextPage"]},"PAGE.PREV":{actions:["clearScrollEndTimer","setPrevPage"]},"PAGE.SET":{actions:["clearScrollEndTimer","setPage"]},"INDEX.SET":{actions:["clearScrollEndTimer","setMatchingPage"]},"USER.SCROLL":{target:"userScroll"}}},dragging:{effects:["trackPointerMove"],entry:["disableScrollSnap"],on:{DRAGGING:{actions:["scrollSlides","invokeDragging"]},"DRAGGING.END":{target:"idle",actions:["endDragging","invokeDraggingEnd"]}}},userScroll:{effects:["trackScroll"],on:{"SCROLL.END":[{guard:"isFocused",target:"focus",actions:["setClosestPage"]},{target:"idle",actions:["setClosestPage"]}]}},autoplay:{effects:["trackDocumentVisibility","trackScroll","autoUpdateSlide"],exit:["invokeAutoplayEnd"],on:{"AUTOPLAY.TICK":{actions:["setNextPage","invokeAutoplay"]},"DRAGGING.START":{target:"dragging",actions:["invokeDragStart"]},"AUTOPLAY.PAUSE":{target:"idle"}}}},implementations:{guards:{isFocused:({scope:e})=>e.isActiveElement(Pn(e))},effects:{autoUpdateSlide({computed:e,send:t}){const n=setInterval(()=>{t({type:e("canScrollNext")?"AUTOPLAY.TICK":"AUTOPLAY.PAUSE",src:"autoplay.interval"})},e("autoplayInterval"));return()=>clearInterval(n)},trackSlideMutation({scope:e,send:t}){const n=Pn(e);if(!n)return;const r=e.getWin(),s=new r.MutationObserver(()=>{t({type:"SNAP.REFRESH",src:"slide.mutation"}),Pb(e)});return Pb(e),s.observe(n,{childList:!0,subtree:!0}),()=>s.disconnect()},trackSlideResize({scope:e,send:t}){if(!Pn(e))return;const r=e.getWin(),s=()=>{t({type:"SNAP.REFRESH",src:"slide.resize"})};qt(()=>{s(),qt(()=>{t({type:"PAGE.SCROLL",instant:!0})})});const a=new r.ResizeObserver(s);return Ib(e).forEach(u=>a.observe(u)),()=>a.disconnect()},trackSlideIntersections({scope:e,prop:t,context:n}){const r=Pn(e),s=e.getWin(),a=new s.IntersectionObserver(u=>{const l=u.reduce((d,f)=>{var b;const m=f.target,p=Number((b=m.dataset.index)!=null?b:"-1");return p==null||Number.isNaN(p)||p===-1?d:f.isIntersecting?t4(d,p):n4(d,p)},n.get("slidesInView"));n.set("slidesInView",r4(l))},{root:r,threshold:t("inViewThreshold")});return Ib(e).forEach(u=>a.observe(u)),()=>a.disconnect()},trackScroll({send:e,refs:t,scope:n}){const r=Pn(n);return r?Zt(r,"scroll",()=>{clearTimeout(t.get("timeoutRef")),t.set("timeoutRef",void 0),t.set("timeoutRef",setTimeout(()=>{e({type:"SCROLL.END"})},150))},{passive:!0}):void 0},trackDocumentVisibility({scope:e,send:t}){const n=e.getDoc();return Zt(n,"visibilitychange",()=>{n.visibilityState!=="visible"&&t({type:"AUTOPLAY.PAUSE",src:"doc.hidden"})})},trackPointerMove({scope:e,send:t}){const n=e.getDoc();return pL(n,{onPointerMove({event:r}){t({type:"DRAGGING",left:-r.movementX,top:-r.movementY})},onPointerUp(){t({type:"DRAGGING.END"})}})},trackKeyboardScroll({scope:e,send:t,context:n}){const r=e.getWin();return Zt(r,"keydown",a=>{switch(a.key){case"ArrowRight":a.preventDefault(),t({type:"PAGE.NEXT"});break;case"ArrowLeft":a.preventDefault(),t({type:"PAGE.PREV"});break;case"Home":a.preventDefault(),t({type:"PAGE.SET",index:0});break;case"End":a.preventDefault(),t({type:"PAGE.SET",index:n.get("pageSnapPoints").length-1})}},{capture:!0})}},actions:{clearScrollEndTimer({refs:e}){e.get("timeoutRef")!=null&&(clearTimeout(e.get("timeoutRef")),e.set("timeoutRef",void 0))},scrollToPage({context:e,event:t,scope:n,computed:r,flush:s}){var f;const a=t.instant?"instant":"smooth",u=iT((f=t.index)!=null?f:e.get("page"),0,e.get("pageSnapPoints").length-1),l=Pn(n);if(!l)return;const d=r("isHorizontal")?"left":"top";s(()=>{l.scrollTo({[d]:e.get("pageSnapPoints")[u],behavior:a})})},setClosestPage({context:e,scope:t,computed:n}){const r=Pn(t);if(!r)return;const s=n("isHorizontal")?r.scrollLeft:r.scrollTop,a=e.get("pageSnapPoints").findIndex(u=>Math.abs(u-s)<1);a!==-1&&e.set("page",a)},setNextPage({context:e,prop:t,state:n}){const r=n.matches("autoplay")||t("loop"),s=tT(e.get("pageSnapPoints"),e.get("page"),{loop:r});e.set("page",s)},setPrevPage({context:e,prop:t,state:n}){const r=n.matches("autoplay")||t("loop"),s=i4(e.get("pageSnapPoints"),e.get("page"),{loop:r});e.set("page",s)},setMatchingPage({context:e,event:t,computed:n,scope:r}){const s=Pn(r);if(!s)return;const a=HD(s,n("isHorizontal")?"x":"y",l=>l.dataset.index===t.index.toString());if(a==null)return;const u=e.get("pageSnapPoints").findIndex(l=>Math.abs(l-a)<1);e.set("page",u)},setPage({context:e,event:t}){var r;const n=(r=t.index)!=null?r:e.get("page");e.set("page",n)},clampPage({context:e}){const t=iT(e.get("page"),0,e.get("pageSnapPoints").length-1);e.set("page",t)},setSnapPoints({context:e,computed:t,scope:n}){const r=Pn(n);if(!r)return;const s=kb(r);e.set("pageSnapPoints",t("isHorizontal")?s.x:s.y)},disableScrollSnap({scope:e}){const t=Pn(e);if(!t)return;const n=getComputedStyle(t);t.dataset.scrollSnapType=n.getPropertyValue("scroll-snap-type"),t.style.setProperty("scroll-snap-type","none")},scrollSlides({scope:e,event:t}){const n=Pn(e);n==null||n.scrollBy({left:t.left,top:t.top,behavior:"instant"})},endDragging({scope:e,context:t,computed:n}){const r=Pn(e);if(!r)return;const s=r.scrollLeft,a=r.scrollTop,u=kb(r),l=u.x.reduce((f,m)=>Math.abs(m-s)<Math.abs(f-s)?m:f,u.x[0]),d=u.y.reduce((f,m)=>Math.abs(m-a)<Math.abs(f-a)?m:f,u.y[0]);qt(()=>{r.scrollTo({left:l,top:d,behavior:"smooth"});const f=n("isHorizontal")?l:d;t.set("page",t.get("pageSnapPoints").indexOf(f));const m=r.dataset.scrollSnapType;m&&(r.style.setProperty("scroll-snap-type",m),delete r.dataset.scrollSnapType)})},focusIndicatorEl({context:e,event:t,scope:n}){if(t.src!=="indicator")return;const r=WD(n,e.get("page"));r&&qt(()=>r.focus({preventScroll:!0}))},invokeDragStart({context:e,prop:t}){var n;(n=t("onDragStatusChange"))==null||n({type:"dragging.start",isDragging:!0,page:e.get("page")})},invokeDragging({context:e,prop:t}){var n;(n=t("onDragStatusChange"))==null||n({type:"dragging",isDragging:!0,page:e.get("page")})},invokeDraggingEnd({context:e,prop:t}){var n;(n=t("onDragStatusChange"))==null||n({type:"dragging.end",isDragging:!1,page:e.get("page")})},invokeAutoplay({context:e,prop:t}){var n;(n=t("onAutoplayStatusChange"))==null||n({type:"autoplay",isPlaying:!0,page:e.get("page")})},invokeAutoplayStart({context:e,prop:t}){var n;(n=t("onAutoplayStatusChange"))==null||n({type:"autoplay.start",isPlaying:!0,page:e.get("page")})},invokeAutoplayEnd({context:e,prop:t}){var n;(n=t("onAutoplayStatusChange"))==null||n({type:"autoplay.stop",isPlaying:!1,page:e.get("page")})}}}};function KD(e,t,n){if(e==null||n<=0)return[];const r=[],s=t==="auto"?Math.floor(n):t;if(s<=0)return[];for(let a=0;a<e&&!(a+n>e);a+=s)r.push(a);return r}co()(["dir","getRootNode","id","ids","loop","page","defaultPage","onPageChange","orientation","slideCount","slidesPerPage","slidesPerMove","spacing","padding","autoplay","allowMouseDrag","inViewThreshold","translations","snapType","onDragStatusChange","onAutoplayStatusChange"]),co()(["index","readOnly"]),co()(["index","snapAlign"]);const QD=e=>{const t=R.useId(),{getRootNode:n}=Ql(),{dir:r}=Xh(),s=j({id:t,dir:r,getRootNode:n},e),a=Bl(XD,s);return GD(a,Nh)},ip=R.forwardRef((e,t)=>{const[n,r]=Ma()(e,["allowMouseDrag","autoplay","defaultPage","id","ids","inViewThreshold","loop","onAutoplayStatusChange","onDragStatusChange","onPageChange","orientation","padding","page","slideCount","slidesPerMove","slidesPerPage","snapType","spacing","translations"]),s=QD(n),a=Yt(s.getRootProps(),r);return w.jsx(FD,{value:s,children:w.jsx(hn.div,ce(j({},a),{ref:t}))})});ip.displayName="CarouselRoot";const JD=180,ZD=e=>{const t=e.trim(),n=parseFloat(t);return Number.isNaN(n)?0:t.endsWith("rem")?n*16:n},e8=({globalClassName:e,className:t,itemMinWidth:n=JD,spacing:r="0.5rem",loop:s=!1,allowMouseDrag:a=!0,showIndicators:u=!0,showNavigation:l=!0,onPageChange:d,ariaLabel:f="Product carousel",children:m})=>{const p=Array.from(m).map((J,se)=>({node:J,key:R.isValidElement(J)&&J.key!=null?J.key:`carousel-item-${se}`})),b=p.length,y=R.useRef(null),[_,x]=R.useState(0),{width:A}=JS();R.useLayoutEffect(()=>{y.current&&x(y.current.getBoundingClientRect().width)},[A,b]);const S=ZD(r),C=n+S,O=_>0?(_+S)/C:1,z=Math.max(1,Math.floor(O));if(b===0)return null;const G=b>z,M=Math.ceil(b/z),V=G?Math.max(1,O):z;return w.jsxs(ip,{ref:y,className:B(e,t,`${N}-carousel`),slidesPerPage:V,slidesPerMove:z,spacing:r,loop:s,allowMouseDrag:a,slideCount:b,onPageChange:d,"aria-label":f,children:[w.jsx(tp,{className:B(e,`${N}-carousel__item-group`,{"carousel-row-container":!G}),children:p.map(({node:J,key:se},H)=>w.jsx(ep,{index:H,className:B(e,`${N}-carousel__item`),children:J},se))}),l&&G&&w.jsxs(Qh,{className:B(e,`${N}-carousel__control`),children:[w.jsx(rp,{className:B(e,`${N}-carousel__prev-trigger`),"aria-label":"Previous slide",children:w.jsx(bb,{size:"16px"})}),w.jsx(np,{className:B(e,`${N}-carousel__next-trigger`),"aria-label":"Next slide",children:w.jsx(wb,{size:"16px"})})]}),u&&G&&w.jsx(Zh,{className:B(e,`${N}-carousel__indicator-group`),children:Array.from({length:M},(J,se)=>w.jsx(Jh,{index:se,className:B(e,`${N}-carousel__indicator`),"aria-label":`Go to slide group ${se+1}`},se))})]})},t8=({className:e,label:t="Close",onClick:n,disabled:r=!1})=>w.jsx("button",{"aria-label":t,title:t,className:B(e,`${N}-close-button`),disabled:r,onClick:n,children:w.jsx("svg",{role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 20",width:"16",height:"16",fill:"currentColor",children:w.jsx("path",{d:"M18.3 5.7a1 1 0 0 0-1.4-1.4L12 9.6 7.1 4.7a1 1 0 1 0-1.4 1.4l4.9 4.9-4.9 4.9a1 1 0 1 0 1.4 1.4l4.9-4.9 4.9 4.9a1 1 0 0 0 1.4-1.4l-4.9-4.9 4.9-4.9z"})})}),[n8,r8]=ls({name:"RenderStrategyContext",hookName:"useRenderStrategyContext",providerName:"<RenderStrategyPropsProvider />"}),i8=e=>Ma()(e,["lazyMount","unmountOnExit"]),[s8,za]=ls({name:"DialogContext",hookName:"useDialogContext",providerName:"<DialogProvider />"}),Rb=R.forwardRef((e,t)=>{const n=za(),r=r8(),s=Ph(ce(j({},r),{present:n.open})),a=Yt(n.getBackdropProps(),s.getPresenceProps(),e);return s.unmounted?null:w.jsx(hn.div,ce(j({},a),{ref:Ul(s.ref,t)}))});Rb.displayName="DialogBackdrop";const sp=R.forwardRef((e,t)=>{const n=za(),r=Da(),s=Yt(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:w.jsx(hn.div,ce(j({},s),{ref:Ul(r.ref,t)}))});sp.displayName="DialogContent";const op=R.forwardRef((e,t)=>{const n=za(),r=Yt(n.getDescriptionProps(),e);return w.jsx(hn.div,ce(j({},r),{ref:t}))});op.displayName="DialogDescription";const ap=R.forwardRef((e,t)=>{const n=za(),r=Yt(n.getPositionerProps(),e);return Da().unmounted?null:w.jsx(hn.div,ce(j({},r),{ref:t}))});ap.displayName="DialogPositioner";var o8=cs("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),ps=o8.build(),Lb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.positioner)!=null?n:`dialog:${e.id}:positioner`},Db=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.backdrop)!=null?n:`dialog:${e.id}:backdrop`},up=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.content)!=null?n:`dialog:${e.id}:content`},Mb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.trigger)!=null?n:`dialog:${e.id}:trigger`},lp=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.title)!=null?n:`dialog:${e.id}:title`},cp=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.description)!=null?n:`dialog:${e.id}:description`},Fb=e=>{var t,n;return(n=(t=e.ids)==null?void 0:t.closeTrigger)!=null?n:`dialog:${e.id}:close`},Zl=e=>e.getById(up(e)),a8=e=>e.getById(Lb(e)),u8=e=>e.getById(Db(e)),l8=e=>e.getById(Mb(e)),c8=e=>e.getById(lp(e)),d8=e=>e.getById(cp(e)),f8=e=>e.getById(Fb(e));function h8(e,t){const{state:n,send:r,context:s,prop:a,scope:u}=e,l=a("aria-label"),d=n.matches("open");return{open:d,setOpen(f){n.matches("open")!==f&&r({type:f?"OPEN":"CLOSE"})},getTriggerProps(){return t.button(ce(j({},ps.trigger.attrs),{dir:a("dir"),id:Mb(u),"aria-haspopup":"dialog",type:"button","aria-expanded":d,"data-state":d?"open":"closed","aria-controls":up(u),onClick(f){f.defaultPrevented||r({type:"TOGGLE"})}}))},getBackdropProps(){return t.element(ce(j({},ps.backdrop.attrs),{dir:a("dir"),hidden:!d,id:Db(u),"data-state":d?"open":"closed"}))},getPositionerProps(){return t.element(ce(j({},ps.positioner.attrs),{dir:a("dir"),id:Lb(u),style:{pointerEvents:d?void 0:"none"}}))},getContentProps(){const f=s.get("rendered");return t.element(ce(j({},ps.content.attrs),{dir:a("dir"),role:a("role"),hidden:!d,id:up(u),tabIndex:-1,"data-state":d?"open":"closed","aria-modal":!0,"aria-label":l||void 0,"aria-labelledby":l||!f.title?void 0:lp(u),"aria-describedby":f.description?cp(u):void 0}))},getTitleProps(){return t.element(ce(j({},ps.title.attrs),{dir:a("dir"),id:lp(u)}))},getDescriptionProps(){return t.element(ce(j({},ps.description.attrs),{dir:a("dir"),id:cp(u)}))},getCloseTriggerProps(){return t.button(ce(j({},ps.closeTrigger.attrs),{dir:a("dir"),id:Fb(u),type:"button",onClick(f){f.defaultPrevented||(f.stopPropagation(),r({type:"CLOSE"}))}}))}}}var p8={props({props:e,scope:t}){const n=e.role==="alertdialog",r=n?()=>f8(t):void 0,s=typeof e.modal=="boolean"?e.modal:!0;return j({role:"dialog",modal:s,trapFocus:s,preventScroll:s,closeOnInteractOutside:!n,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:r},e)},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{rendered:e(()=>({defaultValue:{title:!0,description:!0}}))}},watch({track:e,action:t,prop:n}){e([()=>n("open")],()=>{t(["toggleVisibility"])})},states:{open:{entry:["checkRenderedElements","syncZIndex"],effects:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackDismissableElement({scope:e,send:t,prop:n}){return ub(()=>Zl(e),{type:"dialog",defer:!0,pointerBlocking:n("modal"),exclude:[l8(e)],onInteractOutside(s){var a;(a=n("onInteractOutside"))==null||a(s),n("closeOnInteractOutside")||s.preventDefault()},persistentElements:n("persistentElements"),onFocusOutside:n("onFocusOutside"),onPointerDownOutside:n("onPointerDownOutside"),onRequestDismiss:n("onRequestDismiss"),onEscapeKeyDown(s){var a;(a=n("onEscapeKeyDown"))==null||a(s),n("closeOnEscape")||s.preventDefault()},onDismiss(){t({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:e,prop:t}){if(t("preventScroll"))return hb(e.getDoc())},trapFocus({scope:e,prop:t}){return t("trapFocus")?db(()=>Zl(e),{preventScroll:!0,returnFocusOnDeactivate:!!t("restoreFocus"),initialFocus:t("initialFocusEl"),setReturnFocus:r=>{var s,a;return(a=(s=t("finalFocusEl"))==null?void 0:s())!=null?a:r},getShadowRoot:!0}):void 0},hideContentBelow({scope:e,prop:t}){return t("modal")?ZT(()=>[Zl(e)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:e,scope:t}){qt(()=>{e.set("rendered",{title:!!c8(t),description:!!d8(t)})})},syncZIndex({scope:e}){qt(()=>{const t=Zl(e);if(!t)return;const n=oo(t);[a8(e),u8(e)].forEach(s=>{s==null||s.style.setProperty("--z-index",n.zIndex),s==null||s.style.setProperty("--layer-index",n.getPropertyValue("--layer-index"))})})},invokeOnClose({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!1})},invokeOnOpen({prop:e}){var t;(t=e("onOpenChange"))==null||t({open:!0})},toggleVisibility({prop:e,send:t,event:n}){t({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:n})}}}};co()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);const m8=e=>{const t=R.useId(),{getRootNode:n}=Ql(),{dir:r}=Xh(),s=j({id:t,getRootNode:n,dir:r},e),a=Bl(p8,s);return h8(a,Nh)},Bb=e=>{const[t,l]=CT(e),d=l,{children:n}=d,r=Sn(d,["children"]),[s]=i8(t),a=m8(r),u=Ph(Yt({present:a.open},t));return w.jsx(s8,{value:a,children:w.jsx(n8,{value:s,children:w.jsx(vT,{value:u,children:n})})})},Ub=R.forwardRef((e,t)=>{const n=za(),r=Yt(n.getTitleProps(),e);return w.jsx(hn.h2,ce(j({},r),{ref:t}))});Ub.displayName="DialogTitle";const g8=({children:e})=>{const[t,n]=R.useState(!1),r=R.useMemo(()=>({toggleMenu:()=>n(a=>!a),closeMenu:()=>n(!1)}),[]),s=R.useMemo(()=>({isOpen:t}),[t]);return w.jsx(mh.Provider,{value:r,children:w.jsx(Qy.Provider,{value:s,children:e})})},Hb=()=>R.useContext(Qy),jb=()=>{const e=R.useContext(mh);if(!e)throw new Error("useOverflowMenuDispatch must be used within an OverflowMenuProvider");return e},E8=`${N}-overflow-menu-button-trigger`,y8=({componentType:e,children:t})=>{const{isOpen:n}=Hb(),{closeMenu:r}=jb(),{globalClassName:s}=ft(),a=R.useRef(null);return R.useEffect(()=>{if(!n)return;const u=d=>{d.key==="Escape"&&r()},l=d=>{const f=d.target;f instanceof Element&&f.closest(`.${E8}`)||a.current&&!a.current.contains(f)&&r()};return document.addEventListener("keydown",u),document.addEventListener("mousedown",l),()=>{document.removeEventListener("keydown",u),document.removeEventListener("mousedown",l)}},[n,r]),n?w.jsx("div",{ref:a,role:"menu","aria-label":`Overflow menu for ${e}`,className:B(`${N}-overflow-panel`,s,`cim-${e}-component`),children:t}):null},T8=({componentType:e,className:t})=>{const{toggleMenu:n}=jb(),{isOpen:r}=Hb(),{globalClassName:s}=ft();return w.jsx("button",{"aria-label":`Overflow menu for ${e}`,title:"More options","aria-expanded":r,"aria-haspopup":"menu",className:B(`${N}-overflow-menu-button-trigger`,`${N}-icon-button`,s,t,`cim-${e}-component`),onClick:n,children:w.jsx(_b,{})})};class b8{constructor(){Qe(this,"initialState",z0);Qe(this,"promptsStateProxy");Qe(this,"promptsParamsProxy");Qe(this,"_fullGet",(t,n)=>Reflect.get(t,n));Qe(this,"_fullSet",(t,n,r)=>{if(!(n in t))throw new Error(`Property ${n} does not exist on PromptsExtensionState`);return x8(n,r),Reflect.set(t,n,r)});Qe(this,"_paramsFullGet",(t,n)=>Reflect.get(t,n));Qe(this,"_paramsFullSet",(t,n,r)=>Reflect.set(t,n,r));Qe(this,"updatePromptsParamsProxy",t=>new Proxy(j({},t),{get:this._paramsFullGet,set:this._paramsFullSet}));this.promptsStateProxy=new Proxy({isOpen:this.initialState.isOpen,isInline:this.initialState.isInline,elementId:this.initialState.elementId,entryType:this.initialState.entryType},{get:this._fullGet,set:this._fullSet}),this.promptsParamsProxy=this.updatePromptsParamsProxy({})}get isOpen(){return this.promptsStateProxy.isOpen}get isInline(){return this.promptsStateProxy.isInline}get state(){return{isOpen:this.isOpen,isInline:this.isInline}}get params(){return this.promptsParamsProxy}}const _i=new b8,w8=e=>{window.addEventListener(Ld,e)},_8=e=>{window.removeEventListener(Ld,e)},x8=(e,t)=>{const n=new CustomEvent(Ld,{detail:{property:e,value:t}});window.dispatchEvent(n)},zb=e=>{const t=_i.isOpen,n=typeof e=="boolean"?e:!t;_i.promptsStateProxy.isOpen=n},S8=e=>{const t=_i.isInline,n=typeof e=="boolean"?e:!t;_i.promptsStateProxy.isInline=n},v8=({elementId:e,entryType:t,params:n,isInline:r})=>{_i.promptsStateProxy.elementId=e,t&&(_i.promptsStateProxy.entryType=t),typeof r=="boolean"&&S8(r),n&&_i.updatePromptsParamsProxy(n),_i.isOpen||zb(!0)},A8=()=>{const e=R.useContext(r1);if(!e)throw new Error("usePdp must be used within a PdpProvider");return e},k8=()=>{const e=R.useContext(n1);if(!e)throw new Error("usePromptsExtensionDispatch must be used within a PromptsExtensionProvider");return e||{}},ec=()=>{const e=R.useContext(t1);if(!e)throw new Error("usePromptsExtensionState must be used within a PromptsExtensionProvider");return e||{}},C8=({componentType:e,isIcon:t})=>{const{globalClassName:n}=ft(),{previousComponentType:r}=Vr(),s=eo(),a=()=>{Mu(r||"dialog"),s()};return t?w.jsx(lr,{className:B(n,`${N}-toggle-dialog-button`,`cim-${e}-component`),ariaLabel:"Collapse",title:"Collapse",onClick:a,icon:w.jsx(xb,{})}):w.jsxs("button",{className:B(n,`${N}-overflow-menu-button`,`${N}-toggle-dialog-button`,`cim-${e}-component`),onClick:a,children:[w.jsx(xb,{}),"Show ",r||"dialog"]})},N8=({componentType:e,isIcon:t})=>{const{globalClassName:n}=ft(),{isModalFullscreen:r}=Vr(),s=eo(),a=()=>{Md(!r),s()},u=r?vC:AC,l="Toggle Fullscreen";return t?w.jsx(lr,{ariaLabel:l,title:l,className:B(n,`${N}-modal-fullscreen-button`,`cim-${e}-component`),icon:w.jsx(u,{}),onClick:a}):w.jsxs("button",{className:B(n,`${N}-overflow-menu-button`,`${N}-modal-fullscreen-button`,`cim-${e}-component`),onClick:a,children:[w.jsx(u,{}),l]})},O8=({componentType:e,isIcon:t})=>{const{globalClassName:n}=ft(),{dialogPosition:r}=Vr(),s=eo(),a=r==="bottom-left",u=()=>{Fd(a?"bottom-right":"bottom-left"),s()},l=a?RD:PD,d=a?"Move right":"Move left";return t?w.jsx(lr,{className:B(n,`${N}-left-right-toggle-button`,`cim-${e}-component`),ariaLabel:d,title:d,onClick:u,icon:w.jsx(l,{})}):w.jsxs("button",{className:B(n,`${N}-overflow-menu-button`,`${N}-left-right-toggle-button`,`cim-${e}-component`),onClick:u,children:[w.jsx(l,{}),d]})},$b=({componentType:e,onClearChat:t,onClose:n,onDownloadTranscript:r})=>{const{headerConfig:s,globalClassName:a,mode:u,enableDownloadTranscript:l}=ft(),{mode:d}=Vr(),f=u==="messaging"&&l&&!!r,m=d==="standalone",p=e==="modal",b=p?C8:Yb,y=p?N8:O8,_=R.useMemo(()=>s?TC(s):{},[s]);return w.jsx(g8,{children:w.jsxs("div",{className:B(a,`${N}-${e}-header-wrapper`),style:{display:"flex",flexDirection:"column",position:"relative"},children:[w.jsxs("div",{className:B(a,`${N}-${e}-header`,{standalone:m,embedded:!m}),style:_,children:[(s==null?void 0:s.logoUrl)&&w.jsx("img",{alt:"",role:"img",className:B(a,`${N}-${e}-logo`,{standalone:m,embedded:!m}),src:s.logoUrl}),w.jsx(Ub,{className:B(a,`${N}-${e}-title`,{standalone:m,embedded:!m}),children:s==null?void 0:s.headerText}),w.jsxs("div",{className:B(a,`${N}-${e}-controls`),children:[w.jsx(b,{componentType:e,isIcon:!0}),w.jsx(T8,{componentType:e}),w.jsx(t8,{className:B(a,`cim-${e}-component`),onClick:n})]})]}),w.jsxs(y8,{componentType:e,children:[w.jsx(y,{componentType:e}),w.jsx(D8,{componentType:e}),w.jsx(Zy,{componentType:e,onClearChat:t}),f&&w.jsx(eT,{componentType:e,onDownloadTranscript:r})]})]})})},tc="USD",Kr=(e,t)=>{if(typeof e!="number"||Number.isNaN(e))return null;try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(e)}catch(n){return`${e}`}},I8=({retailPrice:e,discountPrice:t,currencyCode:n=tc})=>{const r=n||tc,s=typeof t=="number"&&typeof e=="number"&&t<e,a=s?t:e||t||null,u=s?e:null;return{price:Kr(a,r),comparePrice:Kr(u,r),hasDiscount:s}},Vb=e=>typeof e=="number"&&Number.isFinite(e),P8=({priceBreakdown:e,currencyCode:t=tc})=>{if(!e)return null;const n=t||tc,r=[e.sales,e.original],s=r.map(m=>m==null?void 0:m.min).filter(Vb),a=r.map(m=>m==null?void 0:m.max).filter(Vb);if(s.length===0||a.length===0)return null;const u=Math.min(...s),l=Math.max(...a);if(u===l)return null;const d=Kr(u,n),f=Kr(l,n);return d===null||f===null?null:{range:`${d} – ${f}`,low:d,high:f}},dp=({retailPrice:e,discountPrice:t,currencyCode:n,fontSize:r,globalClassName:s,className:a})=>{const{price:u,comparePrice:l,hasDiscount:d}=I8({retailPrice:e,discountPrice:t,currencyCode:n});if(!u)return null;const f=typeof r=="string"?{fontSize:r}:{};return w.jsxs("div",{className:B(s,a,`${N}-price`),style:f,children:[w.jsx("span",{className:B(s,`${N}-price__amount`),children:u}),d&&l&&w.jsx("span",{className:B(s,`${N}-price__compare`),children:l})]})},R8={sparkle:Kh,plus:LD,"paper-plane":DD},qb=({icon:e,className:t})=>{const n=R8[e];return n?w.jsx(n,{className:t,"aria-hidden":"true"}):null},L8=({className:e,globalClassName:t,suggestions:n,disabled:r,isWidgetStandalone:s,onSuggestionClick:a})=>{var y;const{suggestionButtonConfig:u}=ft(),l=u==null?void 0:u.icon,d=(y=u==null?void 0:u.iconPosition)!=null?y:"left",f=s?"standalone":"embedded",m=_=>()=>{a(_)},p={"has-icon":!!l,"icon-right":!!l&&d==="right"},b=_=>w.jsxs(w.Fragment,{children:[l&&w.jsx(qb,{icon:l,className:`${N}-suggestion-button-icon`}),w.jsx("span",{children:_})]});return w.jsx("div",{className:B(t,`${N}-suggestion-container ${f}`,e),children:n.map(_=>s?w.jsx(bf,{disabled:r,className:B(t,`${N}-suggestion-button standalone`,p),onClick:m(_),children:b(_)},_):w.jsx("button",{disabled:r,className:B(t,`${N}-suggestion-button embedded`,p),onClick:m(_),children:b(_)},_))})},D8=({componentType:e,isIcon:t})=>{const{globalClassName:n,enableMinimize:r}=ft();if(!r)return null;const s=()=>{$r(!1),Ms(!0)};return t?w.jsx(lr,{className:B(n,`${N}-toggle-minimize-button`,`cim-${e}-component`),ariaLabel:"Toggle Minimize",title:"Minimize",onClick:s,icon:w.jsx(g1,{})}):w.jsxs("button",{className:B(n,`${N}-overflow-menu-button`,`${N}-toggle-minimize-button`,`cim-${e}-component`),onClick:s,children:[w.jsx(g1,{}),"Minimize"]})},Yb=({componentType:e,isIcon:t})=>{const{globalClassName:n}=ft(),r=eo(),s=()=>{Mu("modal"),r()};return t?w.jsx(lr,{className:B(n,`${N}-toggle-modal-button`,`cim-${e}-component`),ariaLabel:"Expand",title:"Expand",onClick:s,icon:w.jsx(Sb,{})}):w.jsxs("button",{className:B(n,`${N}-overflow-menu-button`,`${N}-toggle-modal-button`,`cim-${e}-component`),onClick:s,children:[w.jsx(Sb,{}),"Show modal"]})},M8=["Hey there! 👋 What can I find for you today?","Shopping for a gift? Tell me your budget and preferences","Need help? Connect to an agent"],F8=3e3,B8=400,U8=({globalClassName:e,isWidgetStandalone:t,messages:n=M8})=>{const[r,s]=R.useState(0),[a,u]=R.useState(!0);return R.useEffect(()=>{let l;const d=setInterval(()=>{u(!1),l=setTimeout(()=>{s(f=>(f+1)%n.length),u(!0)},B8)},F8);return()=>{clearInterval(d),clearTimeout(l)}},[n.length]),w.jsxs("div",{className:B(e,`${N}-connecting-indicator`,t?"standalone":"embedded"),role:"status","aria-label":"Connecting to assistant",children:[w.jsxs("div",{className:`${N}-connecting-pulse-wrapper`,children:[w.jsx("div",{className:`${N}-connecting-pulse`}),w.jsx("div",{className:`${N}-connecting-ring`})]}),w.jsx("span",{className:B(`${N}-connecting-text`,a&&`${N}-connecting-text--visible`),children:n[r]})]})},H8=({shouldShow:e,loadingText:t})=>e?w.jsx("span",{className:`${N}-processing-text`,children:t}):null,j8=({shouldShow:e})=>e?w.jsxs(w.Fragment,{children:[w.jsx("div",{className:`${N}-processing-shimmer-bar`}),w.jsx("div",{className:`${N}-processing-shimmer-bar`}),w.jsx("div",{className:`${N}-processing-shimmer-bar`})]}):null,fp=({globalClassName:e,isWidgetStandalone:t,loadingText:n})=>w.jsxs("div",{className:B(e,`${N}-processing-indicator`,t?"standalone":"embedded"),role:"status","aria-label":n||"Loading response",children:[w.jsx(H8,{shouldShow:!!n,loadingText:n}),w.jsx(j8,{shouldShow:!n})]});function Wb(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function z8(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function $8(e,t,n){const s=gl((n||{}).ignore||[]),a=V8(t);let u=-1;for(;++u<a.length;)IE(e,"text",l);function l(f,m){let p=-1,b;for(;++p<m.length;){const y=m[p],_=b?b.children:void 0;if(s(y,_?_.indexOf(y):void 0,b))return;b=y}if(b)return d(f,m)}function d(f,m){const p=m[m.length-1],b=a[u][0],y=a[u][1];let _=0;const A=p.children.indexOf(f);let S=!1,C=[];b.lastIndex=0;let O=b.exec(f.value);for(;O;){const z=O.index,G={index:O.index,input:O.input,stack:[...m,f]};let M=y(...O,G);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?b.lastIndex=z+1:(_!==z&&C.push({type:"text",value:f.value.slice(_,z)}),Array.isArray(M)?C.push(...M):M&&C.push(M),_=z+O[0].length,S=!0),!b.global)break;O=b.exec(f.value)}return S?(_<f.value.length&&C.push({type:"text",value:f.value.slice(_)}),p.children.splice(A,1,...C)):C=[f],A+C.length}}function V8(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([q8(s[0]),Y8(s[1])])}return t}function q8(e){return typeof e=="string"?new RegExp(z8(e),"g"):e}function Y8(e){return typeof e=="function"?e:function(){return e}}const hp="phrasing",pp=["autolink","link","image","label"];function W8(){return{transforms:[eM],enter:{literalAutolink:X8,literalAutolinkEmail:mp,literalAutolinkHttp:mp,literalAutolinkWww:mp},exit:{literalAutolink:Z8,literalAutolinkEmail:J8,literalAutolinkHttp:K8,literalAutolinkWww:Q8}}}function G8(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:hp,notInConstruct:pp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:hp,notInConstruct:pp},{character:":",before:"[ps]",after:"\\/",inConstruct:hp,notInConstruct:pp}]}}function X8(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function mp(e){this.config.enter.autolinkProtocol.call(this,e)}function K8(e){this.config.exit.autolinkProtocol.call(this,e)}function Q8(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function J8(e){this.config.exit.autolinkEmail.call(this,e)}function Z8(e){this.exit(e)}function eM(e){$8(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,tM],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),nM]],{ignore:["link","linkReference"]})}function tM(e,t,n,r,s){let a="";if(!Gb(s)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!rM(n)))return!1;const u=iM(n+r);if(!u[0])return!1;const l={type:"link",title:null,url:a+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[l,{type:"text",value:u[1]}]:l}function nM(e,t,n,r){return!Gb(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function rM(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function iM(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=Wb(e,"(");let a=Wb(e,")");for(;r!==-1&&s>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function Gb(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||es(n)||ll(n))&&(!t||n!==47)}Xb.peek=hM;function sM(){this.buffer()}function oM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function aM(){this.buffer()}function uM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function lM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=cr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cM(e){this.exit(e)}function dM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=cr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function fM(e){this.exit(e)}function hM(){return"["}function Xb(e,t,n,r){const s=n.createTracker(r);let a=s.move("[^");const u=n.enter("footnoteReference"),l=n.enter("reference");return a+=s.move(n.safe(n.associationId(e),{after:"]",before:a})),l(),u(),a+=s.move("]"),a}function pM(){return{enter:{gfmFootnoteCallString:sM,gfmFootnoteCall:oM,gfmFootnoteDefinitionLabelString:aM,gfmFootnoteDefinition:uM},exit:{gfmFootnoteCallString:lM,gfmFootnoteCall:cM,gfmFootnoteDefinitionLabelString:dM,gfmFootnoteDefinition:fM}}}function mM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Xb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,a,u){const l=a.createTracker(u);let d=l.move("[^");const f=a.enter("footnoteDefinition"),m=a.enter("label");return d+=l.move(a.safe(a.associationId(r),{before:d,after:"]"})),m(),d+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),d+=l.move((t?`
38
+ `:" ")+a.indentLines(a.containerFlow(r,l.current()),t?Kb:gM))),f(),d}}function gM(e,t,n){return t===0?e:Kb(e,t,n)}function Kb(e,t,n){return(n?"":" ")+e}const EM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Qb.peek=_M;function yM(){return{canContainEols:["delete"],enter:{strikethrough:bM},exit:{strikethrough:wM}}}function TM(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:EM}],handlers:{delete:Qb}}}function bM(e){this.enter({type:"delete",children:[]},e)}function wM(e){this.exit(e)}function Qb(e,t,n,r){const s=n.createTracker(r),a=n.enter("strikethrough");let u=s.move("~~");return u+=n.containerPhrasing(e,ce(j({},s.current()),{before:u,after:"~"})),u+=s.move("~~"),a(),u}function _M(){return"~"}function xM(e){return e.length}function SM(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||xM,a=[],u=[],l=[],d=[];let f=0,m=-1;for(;++m<e.length;){const x=[],A=[];let S=-1;for(e[m].length>f&&(f=e[m].length);++S<e[m].length;){const C=vM(e[m][S]);if(n.alignDelimiters!==!1){const O=s(C);A[S]=O,(d[S]===void 0||O>d[S])&&(d[S]=O)}x.push(C)}u[m]=x,l[m]=A}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<f;)a[p]=Jb(r[p]);else{const x=Jb(r);for(;++p<f;)a[p]=x}p=-1;const b=[],y=[];for(;++p<f;){const x=a[p];let A="",S="";x===99?(A=":",S=":"):x===108?A=":":x===114&&(S=":");let C=n.alignDelimiters===!1?1:Math.max(1,d[p]-A.length-S.length);const O=A+"-".repeat(C)+S;n.alignDelimiters!==!1&&(C=A.length+C+S.length,C>d[p]&&(d[p]=C),y[p]=C),b[p]=O}u.splice(1,0,b),l.splice(1,0,y),m=-1;const _=[];for(;++m<u.length;){const x=u[m],A=l[m];p=-1;const S=[];for(;++p<f;){const C=x[p]||"";let O="",z="";if(n.alignDelimiters!==!1){const G=d[p]-(A[p]||0),M=a[p];M===114?O=" ".repeat(G):M===99?G%2?(O=" ".repeat(G/2+.5),z=" ".repeat(G/2-.5)):(O=" ".repeat(G/2),z=O):z=" ".repeat(G)}n.delimiterStart!==!1&&!p&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||p)&&S.push(" "),n.alignDelimiters!==!1&&S.push(O),S.push(C),n.alignDelimiters!==!1&&S.push(z),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||p!==f-1)&&S.push("|")}_.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return _.join(`
39
39
  `)}function vM(e){return e==null?"":String(e)}function Jb(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function AM(e,t,n,r){const s=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const u=n.indentLines(n.containerFlow(e,a.current()),kM);return s(),u}function kM(e,t,n){return">"+(n?"":" ")+e}function CM(e,t){return Zb(e,t.inConstruct,!0)&&!Zb(e,t.notInConstruct,!1)}function Zb(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function ew(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
40
40
  `&&CM(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
41
41
  `}function NM(e,t){const n=String(e);let r=n.indexOf(t),s=r,a=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++a>u&&(u=a):a=1,s=r+t.length,r=n.indexOf(t,s);return u}function OM(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function IM(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function PM(e,t,n,r){const s=IM(n),a=e.value||"",u=s==="`"?"GraveAccent":"Tilde";if(OM(e,n)){const p=n.enter("codeIndented"),b=n.indentLines(a,RM);return p(),b}const l=n.createTracker(r),d=s.repeat(Math.max(NM(a,s)+1,3)),f=n.enter("codeFenced");let m=l.move(d);if(e.lang){const p=n.enter(`codeFencedLang${u}`);m+=l.move(n.safe(e.lang,j({before:m,after:" ",encode:["`"]},l.current()))),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${u}`);m+=l.move(" "),m+=l.move(n.safe(e.meta,j({before:m,after:`
@@ -49,4 +49,4 @@ Error generating stack: `+T.message+`
49
49
  `))+1))}const u="#".repeat(s),l=n.enter("headingAtx"),d=n.enter("phrasing");a.move(u+" ");let f=n.containerPhrasing(e,j({before:"# ",after:`
50
50
  `},a.current()));return/^[\t ]/.test(f)&&(f=$a(f.charCodeAt(0))+f.slice(1)),f=f?u+" "+f:u,n.options.closeAtx&&(f+=" "+u),d(),l(),f}nw.peek=UM;function nw(e){return e.value||""}function UM(){return"<"}rw.peek=HM;function rw(e,t,n,r){const s=gp(n),a=s==='"'?"Quote":"Apostrophe",u=n.enter("image");let l=n.enter("label");const d=n.createTracker(r);let f=d.move("![");return f+=d.move(n.safe(e.alt,j({before:f,after:"]"},d.current()))),f+=d.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,j({before:f,after:">"},d.current()))),f+=d.move(">")):(l=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,j({before:f,after:e.title?" ":")"},d.current())))),l(),e.title&&(l=n.enter(`title${a}`),f+=d.move(" "+s),f+=d.move(n.safe(e.title,j({before:f,after:s},d.current()))),f+=d.move(s),l()),f+=d.move(")"),u(),f}function HM(){return"!"}iw.peek=jM;function iw(e,t,n,r){const s=e.referenceType,a=n.enter("imageReference");let u=n.enter("label");const l=n.createTracker(r);let d=l.move("![");const f=n.safe(e.alt,j({before:d,after:"]"},l.current()));d+=l.move(f+"]["),u();const m=n.stack;n.stack=[],u=n.enter("reference");const p=n.safe(n.associationId(e),j({before:d,after:"]"},l.current()));return u(),n.stack=m,a(),s==="full"||!f||f!==p?d+=l.move(p+"]"):s==="shortcut"?d=d.slice(0,-1):d+=l.move("]"),d}function jM(){return"!"}sw.peek=zM;function sw(e,t,n){let r=e.value||"",s="`",a=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const u=n.unsafe[a],l=n.compilePattern(u);let d;if(u.atBreak)for(;d=l.exec(r);){let f=d.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(d.index+1)}}return s+r+s}function zM(){return"`"}function ow(e,t){const n=If(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}aw.peek=$M;function aw(e,t,n,r){const s=gp(n),a=s==='"'?"Quote":"Apostrophe",u=n.createTracker(r);let l,d;if(ow(e,n)){const m=n.stack;n.stack=[],l=n.enter("autolink");let p=u.move("<");return p+=u.move(n.containerPhrasing(e,j({before:p,after:">"},u.current()))),p+=u.move(">"),l(),n.stack=m,p}l=n.enter("link"),d=n.enter("label");let f=u.move("[");return f+=u.move(n.containerPhrasing(e,j({before:f,after:"]("},u.current()))),f+=u.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(n.safe(e.url,j({before:f,after:">"},u.current()))),f+=u.move(">")):(d=n.enter("destinationRaw"),f+=u.move(n.safe(e.url,j({before:f,after:e.title?" ":")"},u.current())))),d(),e.title&&(d=n.enter(`title${a}`),f+=u.move(" "+s),f+=u.move(n.safe(e.title,j({before:f,after:s},u.current()))),f+=u.move(s),d()),f+=u.move(")"),l(),f}function $M(e,t,n){return ow(e,n)?"<":"["}uw.peek=VM;function uw(e,t,n,r){const s=e.referenceType,a=n.enter("linkReference");let u=n.enter("label");const l=n.createTracker(r);let d=l.move("[");const f=n.containerPhrasing(e,j({before:d,after:"]"},l.current()));d+=l.move(f+"]["),u();const m=n.stack;n.stack=[],u=n.enter("reference");const p=n.safe(n.associationId(e),j({before:d,after:"]"},l.current()));return u(),n.stack=m,a(),s==="full"||!f||f!==p?d+=l.move(p+"]"):s==="shortcut"?d=d.slice(0,-1):d+=l.move("]"),d}function VM(){return"["}function Ep(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function qM(e){const t=Ep(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function YM(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function lw(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function WM(e,t,n,r){const s=n.enter("list"),a=n.bulletCurrent;let u=e.ordered?YM(n):Ep(n);const l=e.ordered?u==="."?")":".":qM(n);let d=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),lw(n)===u&&m){let p=-1;for(;++p<e.children.length;){const b=e.children[p];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(u=l),n.bulletCurrent=u;const f=n.containerFlow(e,r);return n.bulletLastUsed=u,n.bulletCurrent=a,s(),f}function GM(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function XM(e,t,n,r){const s=GM(n);let a=n.bulletCurrent||Ep(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let u=a.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const l=n.createTracker(r);l.move(a+" ".repeat(u-a.length)),l.shift(u);const d=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,l.current()),m);return d(),f;function m(p,b,y){return b?(y?"":" ".repeat(u))+p:(y?a:a+" ".repeat(u-a.length))+p}}function KM(e,t,n,r){const s=n.enter("paragraph"),a=n.enter("phrasing"),u=n.containerPhrasing(e,r);return a(),s(),u}const QM=gl(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function JM(e,t,n,r){return(e.children.some(function(u){return QM(u)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function ZM(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}cw.peek=e9;function cw(e,t,n,r){const s=ZM(n),a=n.enter("strong"),u=n.createTracker(r),l=u.move(s+s);let d=u.move(n.containerPhrasing(e,j({after:s,before:l},u.current())));const f=d.charCodeAt(0),m=nc(r.before.charCodeAt(r.before.length-1),f,s);m.inside&&(d=$a(f)+d.slice(1));const p=d.charCodeAt(d.length-1),b=nc(r.after.charCodeAt(0),p,s);b.inside&&(d=d.slice(0,-1)+$a(p));const y=u.move(s+s);return a(),n.attentionEncodeSurroundingInfo={after:b.outside,before:m.outside},l+d+y}function e9(e,t,n){return n.options.strong||"*"}function t9(e,t,n,r){return n.safe(e.value,r)}function n9(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function r9(e,t,n){const r=(lw(n)+(n.options.ruleSpaces?" ":"")).repeat(n9(n));return n.options.ruleSpaces?r.slice(0,-1):r}const dw={blockquote:AM,break:ew,code:PM,definition:LM,emphasis:tw,hardBreak:ew,heading:BM,html:nw,image:rw,imageReference:iw,inlineCode:sw,link:aw,linkReference:uw,list:WM,listItem:XM,paragraph:KM,root:JM,strong:cw,text:t9,thematicBreak:r9};function i9(){return{enter:{table:s9,tableData:fw,tableHeader:fw,tableRow:a9},exit:{codeText:u9,table:o9,tableData:yp,tableHeader:yp,tableRow:yp}}}function s9(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function o9(e){this.exit(e),this.data.inTable=void 0}function a9(e){this.enter({type:"tableRow",children:[]},e)}function yp(e){this.exit(e)}function fw(e){this.enter({type:"tableCell",children:[]},e)}function u9(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,l9));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function l9(e,t){return t==="|"?t:e}function c9(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
51
51
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:u,tableCell:d,tableRow:l}};function u(y,_,x,A){return f(m(y,x,A),y.align)}function l(y,_,x,A){const S=p(y,x,A),C=f([S]);return C.slice(0,C.indexOf(`
52
- `))}function d(y,_,x,A){const S=x.enter("tableCell"),C=x.enter("phrasing"),O=x.containerPhrasing(y,ce(j({},A),{before:a,after:a}));return C(),S(),O}function f(y,_){return SM(y,{align:_,alignDelimiters:r,padding:n,stringLength:s})}function m(y,_,x){const A=y.children;let S=-1;const C=[],O=_.enter("table");for(;++S<A.length;)C[S]=p(A[S],_,x);return O(),C}function p(y,_,x){const A=y.children;let S=-1;const C=[],O=_.enter("tableRow");for(;++S<A.length;)C[S]=d(A[S],y,_,x);return O(),C}function b(y,_,x){let A=dw.inlineCode(y,_,x);return x.stack.includes("tableCell")&&(A=A.replace(/\|/g,"\\$&")),A}}function d9(){return{exit:{taskListCheckValueChecked:hw,taskListCheckValueUnchecked:hw,paragraph:h9}}}function f9(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:p9}}}function hw(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function h9(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let a=-1,u;for(;++a<s.length;){const l=s[a];if(l.type==="paragraph"){u=l;break}}u===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function p9(e,t,n,r){const s=e.children[0],a=typeof e.checked=="boolean"&&s&&s.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);a&&l.move(u);let d=dw.listItem(e,t,n,j(j({},r),l.current()));return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),d;function f(m){return m+u}}function m9(){return[W8(),pM(),yM(),i9(),d9()]}function g9(e){return{extensions:[G8(),mM(e),TM(),c9(e),f9()]}}const E9={tokenize:x9,partial:!0},pw={tokenize:S9,partial:!0},mw={tokenize:v9,partial:!0},gw={tokenize:A9,partial:!0},y9={tokenize:k9,partial:!0},Ew={name:"wwwAutolink",tokenize:w9,previous:Tw},yw={name:"protocolAutolink",tokenize:_9,previous:bw},Qr={name:"emailAutolink",tokenize:b9,previous:ww},Dr={};function T9(){return{text:Dr}}let ms=48;for(;ms<123;)Dr[ms]=Qr,ms++,ms===58?ms=65:ms===91&&(ms=97);Dr[43]=Qr,Dr[45]=Qr,Dr[46]=Qr,Dr[95]=Qr,Dr[72]=[Qr,yw],Dr[104]=[Qr,yw],Dr[87]=[Qr,Ew],Dr[119]=[Qr,Ew];function b9(e,t,n){const r=this;let s,a;return u;function u(p){return!Tp(p)||!ww.call(r,r.previous)||bp(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(p))}function l(p){return Tp(p)?(e.consume(p),l):p===64?(e.consume(p),d):n(p)}function d(p){return p===46?e.check(y9,m,f)(p):p===45||p===95||dn(p)?(a=!0,e.consume(p),d):m(p)}function f(p){return e.consume(p),s=!0,d}function m(p){return a&&s&&bn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function w9(e,t,n){const r=this;return s;function s(u){return u!==87&&u!==119||!Tw.call(r,r.previous)||bp(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(E9,e.attempt(pw,e.attempt(mw,a),n),n)(u))}function a(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function _9(e,t,n){const r=this;let s="",a=!1;return u;function u(p){return(p===72||p===104)&&bw.call(r,r.previous)&&!bp(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),e.consume(p),l):n(p)}function l(p){if(bn(p)&&s.length<5)return s+=String.fromCodePoint(p),e.consume(p),l;if(p===58){const b=s.toLowerCase();if(b==="http"||b==="https")return e.consume(p),d}return n(p)}function d(p){return p===47?(e.consume(p),a?f:(a=!0,d)):n(p)}function f(p){return p===null||ul(p)||Tt(p)||es(p)||ll(p)?n(p):e.attempt(pw,e.attempt(mw,m),n)(p)}function m(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function x9(e,t,n){let r=0;return s;function s(u){return(u===87||u===119)&&r<3?(r++,e.consume(u),s):u===46&&r===3?(e.consume(u),a):n(u)}function a(u){return u===null?n(u):t(u)}}function S9(e,t,n){let r,s,a;return u;function u(f){return f===46||f===95?e.check(gw,d,l)(f):f===null||Tt(f)||es(f)||f!==45&&ll(f)?d(f):(a=!0,e.consume(f),u)}function l(f){return f===95?r=!0:(s=r,r=void 0),e.consume(f),u}function d(f){return s||r||!a?n(f):t(f)}}function v9(e,t){let n=0,r=0;return s;function s(u){return u===40?(n++,e.consume(u),s):u===41&&r<n?a(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(gw,t,a)(u):u===null||Tt(u)||es(u)?t(u):(e.consume(u),s)}function a(u){return u===41&&r++,e.consume(u),s}}function A9(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),a):l===93?(e.consume(l),s):l===60||l===null||Tt(l)||es(l)?t(l):n(l)}function s(l){return l===null||l===40||l===91||Tt(l)||es(l)?t(l):r(l)}function a(l){return bn(l)?u(l):n(l)}function u(l){return l===59?(e.consume(l),r):bn(l)?(e.consume(l),u):n(l)}}function k9(e,t,n){return r;function r(a){return e.consume(a),s}function s(a){return dn(a)?n(a):t(a)}}function Tw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Tt(e)}function bw(e){return!bn(e)}function ww(e){return!(e===47||Tp(e))}function Tp(e){return e===43||e===45||e===46||e===95||dn(e)}function bp(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const C9={tokenize:M9,partial:!0};function N9(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:R9,continuation:{tokenize:L9},exit:D9}},text:{91:{name:"gfmFootnoteCall",tokenize:P9},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:O9,resolveTo:I9}}}}function O9(e,t,n){const r=this;let s=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u;for(;s--;){const d=r.events[s][1];if(d.type==="labelImage"){u=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return l;function l(d){if(!u||!u._balanced)return n(d);const f=cr(r.sliceSerialize({start:u.end,end:r.now()}));return f.codePointAt(0)!==94||!a.includes(f.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function I9(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",a,t],["enter",u,t],["exit",u,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function P9(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,u;return l;function l(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),d}function d(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(p){if(a>999||p===93&&!u||p===null||p===91||Tt(p))return n(p);if(p===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return s.includes(cr(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return Tt(p)||(u=!0),a++,e.consume(p),p===92?m:f}function m(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function R9(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,u=0,l;return d;function d(_){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(_){return _===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(_)}function m(_){if(u>999||_===93&&!l||_===null||_===91||Tt(_))return n(_);if(_===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return a=cr(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return Tt(_)||(l=!0),u++,e.consume(_),_===92?p:m}function p(_){return _===91||_===92||_===93?(e.consume(_),u++,m):m(_)}function b(_){return _===58?(e.enter("definitionMarker"),e.consume(_),e.exit("definitionMarker"),s.includes(a)||s.push(a),ut(e,y,"gfmFootnoteDefinitionWhitespace")):n(_)}function y(_){return t(_)}}function L9(e,t,n){return e.check(ma,t,e.attempt(C9,t,n))}function D9(e){e.exit("gfmFootnoteDefinition")}function M9(e,t,n){const r=this;return ut(e,s,"gfmFootnoteDefinitionIndent",5);function s(a){const u=r.events[r.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(a):n(a)}}function F9(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(u,l){let d=-1;for(;++d<u.length;)if(u[d][0]==="enter"&&u[d][1].type==="strikethroughSequenceTemporary"&&u[d][1]._close){let f=d;for(;f--;)if(u[f][0]==="exit"&&u[f][1].type==="strikethroughSequenceTemporary"&&u[f][1]._open&&u[d][1].end.offset-u[d][1].start.offset===u[f][1].end.offset-u[f][1].start.offset){u[d][1].type="strikethroughSequence",u[f][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},u[f][1].start),end:Object.assign({},u[d][1].end)},p={type:"strikethroughText",start:Object.assign({},u[f][1].end),end:Object.assign({},u[d][1].start)},b=[["enter",m,l],["enter",u[f][1],l],["exit",u[f][1],l],["enter",p,l]],y=l.parser.constructs.insideSpan.null;y&&$n(b,b.length,0,cl(y,u.slice(f+1,d),l)),$n(b,b.length,0,[["exit",p,l],["enter",u[d][1],l],["exit",u[d][1],l],["exit",m,l]]),$n(u,f-1,d-f+3,b),d=f+b.length-2;break}}for(d=-1;++d<u.length;)u[d][1].type==="strikethroughSequenceTemporary"&&(u[d][1].type="data");return u}function a(u,l,d){const f=this.previous,m=this.events;let p=0;return b;function b(_){return f===126&&m[m.length-1][1].type!=="characterEscape"?d(_):(u.enter("strikethroughSequenceTemporary"),y(_))}function y(_){const x=Gs(f);if(_===126)return p>1?d(_):(u.consume(_),p++,y);if(p<2&&!n)return d(_);const A=u.exit("strikethroughSequenceTemporary"),S=Gs(_);return A._open=!S||S===2&&!!x,A._close=!x||x===2&&!!S,l(_)}}}class B9{constructor(){this.map=[]}add(t,n,r){U9(this,t,n,r)}consume(t){if(this.map.sort(function(a,u){return a[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const a of s)t.push(a);s=r.pop()}this.map.length=0}}function U9(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function H9(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function j9(){return{flow:{null:{name:"table",tokenize:z9,resolveAll:$9}}}}function z9(e,t,n){const r=this;let s=0,a=0,u;return l;function l(H){let ie=r.events.length-1;for(;ie>-1;){const fe=r.events[ie][1].type;if(fe==="lineEnding"||fe==="linePrefix")ie--;else break}const te=ie>-1?r.events[ie][1].type:null,le=te==="tableHead"||te==="tableRow"?D:d;return le===D&&r.parser.lazy[r.now().line]?n(H):le(H)}function d(H){return e.enter("tableHead"),e.enter("tableRow"),f(H)}function f(H){return H===124||(u=!0,a+=1),m(H)}function m(H){return H===null?n(H):Ve(H)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),y):n(H):st(H)?ut(e,m,"whitespace")(H):(a+=1,u&&(u=!1,s+=1),H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),u=!0,m):(e.enter("data"),p(H)))}function p(H){return H===null||H===124||Tt(H)?(e.exit("data"),m(H)):(e.consume(H),H===92?b:p)}function b(H){return H===92||H===124?(e.consume(H),p):p(H)}function y(H){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(H):(e.enter("tableDelimiterRow"),u=!1,st(H)?ut(e,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):_(H))}function _(H){return H===45||H===58?A(H):H===124?(u=!0,e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),x):G(H)}function x(H){return st(H)?ut(e,A,"whitespace")(H):A(H)}function A(H){return H===58?(a+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),S):H===45?(a+=1,S(H)):H===null||Ve(H)?z(H):G(H)}function S(H){return H===45?(e.enter("tableDelimiterFiller"),C(H)):G(H)}function C(H){return H===45?(e.consume(H),C):H===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O(H))}function O(H){return st(H)?ut(e,z,"whitespace")(H):z(H)}function z(H){return H===124?_(H):H===null||Ve(H)?!u||s!==a?G(H):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(H)):G(H)}function G(H){return n(H)}function D(H){return e.enter("tableRow"),V(H)}function V(H){return H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),V):H===null||Ve(H)?(e.exit("tableRow"),t(H)):st(H)?ut(e,V,"whitespace")(H):(e.enter("data"),J(H))}function J(H){return H===null||H===124||Tt(H)?(e.exit("data"),V(H)):(e.consume(H),H===92?se:J)}function se(H){return H===92||H===124?(e.consume(H),J):J(H)}}function $9(e,t){let n=-1,r=!0,s=0,a=[0,0,0,0],u=[0,0,0,0],l=!1,d=0,f,m,p;const b=new B9;for(;++n<e.length;){const y=e[n],_=y[1];y[0]==="enter"?_.type==="tableHead"?(l=!1,d!==0&&(_w(b,t,d,f,m),m=void 0,d=0),f={type:"table",start:Object.assign({},_.start),end:Object.assign({},_.end)},b.add(n,0,[["enter",f,t]])):_.type==="tableRow"||_.type==="tableDelimiterRow"?(r=!0,p=void 0,a=[0,0,0,0],u=[0,n+1,0,0],l&&(l=!1,m={type:"tableBody",start:Object.assign({},_.start),end:Object.assign({},_.end)},b.add(n,0,[["enter",m,t]])),s=_.type==="tableDelimiterRow"?2:m?3:1):s&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")?(r=!1,u[2]===0&&(a[1]!==0&&(u[0]=u[1],p=rc(b,t,a,s,void 0,p),a=[0,0,0,0]),u[2]=n)):_.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(u[0]=u[1],p=rc(b,t,a,s,void 0,p)),a=u,u=[a[1],n,0,0])):_.type==="tableHead"?(l=!0,d=n):_.type==="tableRow"||_.type==="tableDelimiterRow"?(d=n,a[1]!==0?(u[0]=u[1],p=rc(b,t,a,s,n,p)):u[1]!==0&&(p=rc(b,t,u,s,n,p)),s=0):s&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")&&(u[3]=n)}for(d!==0&&_w(b,t,d,f,m),b.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=H9(t.events,n))}return e}function rc(e,t,n,r,s,a){const u=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(a.end=Object.assign({},bo(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=bo(t.events,n[1]);if(a={type:u,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const f=bo(t.events,n[2]),m=bo(t.events,n[3]),p={type:l,start:Object.assign({},f),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const b=t.events[n[2]],y=t.events[n[3]];if(b[1].end=Object.assign({},y[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const _=n[2]+1,x=n[3]-n[2]-1;e.add(_,x,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return s!==void 0&&(a.end=Object.assign({},bo(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function _w(e,t,n,r,s){const a=[],u=bo(t.events,n);s&&(s.end=Object.assign({},u),a.push(["exit",s,t])),r.end=Object.assign({},u),a.push(["exit",r,t]),e.add(n+1,0,a)}function bo(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const V9={name:"tasklistCheck",tokenize:Y9};function q9(){return{text:{91:V9}}}function Y9(e,t,n){const r=this;return s;function s(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),a)}function a(d){return Tt(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),u):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),u):n(d)}function u(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(d)}function l(d){return Ve(d)?t(d):st(d)?e.check({tokenize:W9},t,n)(d):n(d)}}function W9(e,t,n){return ut(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function G9(e){return Q1([T9(),N9(),F9(e),j9(),q9()])}const X9={};function K9(e){const t=this,n=e||X9,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(G9(n)),a.push(m9()),u.push(g9(n))}const Q9=()=>w.jsx("span",{className:`${N}-blinking-cursor`,children:w.jsx("svg",{height:"16px",width:"16px",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("circle",{r:"0.45rem",cx:"0.5rem",cy:"0.55rem",fill:"black"})})}),wo=({globalClassName:e,openLinksInNewTab:t,showIsLoading:n,text:r})=>w.jsx(zE,{remarkPlugins:[K9],rehypePlugins:[$y],components:{h1:({children:s})=>w.jsx("h1",{className:B(e,`${N}-header h1`),children:s}),h2:({children:s})=>w.jsx("h2",{className:B(e,`${N}-header h2`),children:s}),h3:({children:s})=>w.jsx("h3",{className:B(e,`${N}-header h3`),children:s}),ul:({children:s})=>w.jsx("ul",{className:B(e,`${N}-ul`),children:s}),ol:({children:s})=>w.jsx("ol",{className:B(e,`${N}-ol`),children:s}),li:({children:s})=>w.jsx("li",{className:B(e,`${N}-li`),children:s}),a:({href:s,children:a})=>w.jsx(Ky,{globalClassName:e,openLinksInNewTab:t,href:s,children:a}),table:({children:s})=>w.jsx("div",{className:B(e,`${N}-table-container`),children:w.jsx("table",{className:B(e,`${N}-table`),children:s})}),thead:({children:s})=>w.jsx("thead",{className:B(e,`${N}-thead`),children:s}),tbody:({children:s})=>w.jsx("tbody",{className:B(e,`${N}-tbody`),children:s}),tr:({children:s})=>w.jsx("tr",{className:B(e,`${N}-tr`),children:s}),th:({children:s})=>w.jsx("th",{className:B(e,`${N}-th`),children:s}),td:({children:s})=>w.jsx("td",{className:B(e,`${N}-td`),children:s}),span:({className:s,children:a})=>s===`${N}-blinking-cursor`?w.jsx(Q9,{}):w.jsx("span",{children:a})},children:r+(n?`<span className='${N}-blinking-cursor'></span>`:"")}),_o=()=>R.useContext(i1),xo=()=>{const{sendMessage:e,loading:t,isConnected:n}=Cn(),{mode:r,status:s}=Vr();return R.useMemo(()=>({sendMessage:e,isLoading:t,isConnected:n,componentType:s.type,mode:r}),[e,t,n,s.type,r])};function J9(e){return e.includes("-")&&e===e.toLowerCase()}function So({tagName:e,props:t,label:n}){const r=R.useRef(null),s=R.useRef(null),a=R.useRef(e),u=R.useRef(null);return R.useEffect(()=>{const l=r.current;if(!l)return;if(a.current!==e&&(a.current=e,s.current=null),!J9(e)){u.current!==e&&(u.current=e,St(!0,"error",`[CimulateOverrides] ${n||"Override"} rejected: "${e}" is not a valid custom element name (must contain a hyphen and be lowercase, e.g. "product-card").`)),s.current=null,l.replaceChildren();return}const d=s.current;if(d&&d.isConnected)try{d.props=t;return}catch(f){St(!0,"error",`[CimulateOverrides] ${n||"Override"} threw an error during props update:`,f),s.current=null,l.replaceChildren();return}try{const f=document.createElement(e);f.props=t,l.replaceChildren(f);const m=f.localName;s.current=typeof customElements!="undefined"&&customElements.get(m)?f:null}catch(f){St(!0,"error",`[CimulateOverrides] ${n||"Override"} threw an error:`,f),s.current=null,l.replaceChildren()}},[e,t,n]),R.useEffect(()=>{const l=r.current;return()=>{s.current=null,l==null||l.replaceChildren()}},[]),w.jsx("div",{ref:r,"data-override":n||"custom"})}class Z9 extends R.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){St(!0,"error",`Override "${this.props.overrideName}" threw during render:`,t,n.componentStack)}render(){return this.state.hasError?null:this.props.children}}function eF(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Image_Off"},child:[{tag:"path",attr:{d:"M19.937,14.218l0,-8.654c0,-0.829 -0.672,-1.5 -1.5,-1.5l-10.628,-0c-0.276,-0 -0.5,-0.225 -0.5,-0.5c0,-0.276 0.224,-0.5 0.5,-0.5l10.628,-0c1.38,-0 2.5,1.118 2.5,2.5l0,10.624c0,0.276 -0.224,0.5 -0.5,0.501c-0.276,-0 -0.5,-0.225 -0.5,-0.5l0,-0.556l-4.583,-4.584c-0.456,-0.456 0.251,-1.163 0.707,-0.707c0.162,0.162 2.37,2.37 3.876,3.876Zm-0.121,6.304c-0.395,0.262 -0.869,0.415 -1.379,0.415l-12.874,-0c-1.381,-0 -2.5,-1.119 -2.5,-2.5l0,-12.873c0,-0.51 0.153,-0.984 0.414,-1.38l-0.263,-0.263c-0.456,-0.456 0.251,-1.163 0.707,-0.707c0.088,0.088 0.176,0.176 0.263,0.263c0.245,0.245 16.095,16.094 16.339,16.338l0.263,0.263c0.455,0.456 -0.252,1.163 -0.707,0.707c-0.088,-0.087 -0.175,-0.175 -0.263,-0.263Zm-11.104,-11.103l-2.001,-2.001c-0.094,0.196 -0.146,0.415 -0.146,0.647c-0,0.829 0.672,1.5 1.5,1.5c0.232,-0 0.451,-0.052 0.647,-0.146Zm-2.733,-2.733l-1.77,-1.77c-0.093,0.196 -0.146,0.416 -0.146,0.648l0,10.717l1.926,-1.926c0.587,-0.586 1.536,-0.586 2.122,-0l0.555,0.554c0.195,0.196 0.511,0.196 0.706,0l2.415,-2.415l-2.343,-2.343c-0.395,0.262 -0.869,0.414 -1.379,0.414c-1.38,-0 -2.5,-1.119 -2.5,-2.5c-0,-0.509 0.152,-0.983 0.414,-1.379Zm-1.916,11.009l0,0.741c0,0.829 0.671,1.5 1.5,1.5l12.874,0c0.232,0 0.451,-0.052 0.647,-0.145c-0.165,-0.165 -3.264,-3.263 -6.59,-6.59l-2.414,2.415c-0.585,0.586 -1.537,0.586 -2.122,0l-0.554,-0.554c-0.195,-0.196 -0.512,-0.196 -0.708,0l-2.633,2.633Z"},child:[]}]}]})(e)}const tF="(max-width: 576px)";function nF(e){return e?!e.defaultPrevented&&e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey:!0}function ic({event:e,openLinksInNewTab:t,isCartMgmtSupported:n=!1}={}){n||t||nF(e)&&typeof window!="undefined"&&window.matchMedia(tF).matches&&(Ms(!0),BS())}const rF=({imageUrl:e,globalClassName:t,isCartMgmtSupported:n,productPageUrl:r,openLinksInNewTab:s,ariaLabel:a,name:u,showInWidgetDetails:l})=>{const{loading:d}=Cn();return w.jsx("div",{className:B(t,`${N}-msg-product-card__image-wrapper`),children:e?n?w.jsx("button",{type:"button",className:B(t,`${N}-msg-product-card__image-button`),onClick:l,disabled:d,"aria-label":a,children:w.jsx("img",{className:B(t,`${N}-msg-product-card__image`),src:e,alt:u||"Product image",loading:"lazy"})}):r?w.jsx("a",{href:r,target:s?"_blank":"_self",rel:"noopener","aria-label":a,onClick:f=>ic({event:f,openLinksInNewTab:s,isCartMgmtSupported:n}),children:w.jsx("img",{className:B(t,`${N}-msg-product-card__image`),src:e,alt:u||"Product image",loading:"lazy"})}):w.jsx("img",{className:B(t,`${N}-msg-product-card__image`),src:e,alt:u||"Product image",loading:"lazy"}):w.jsx("div",{className:B(t,`${N}-msg-product-card__image-placeholder`),"aria-label":u?`No image for ${u}`:"No product image",role:"img",children:w.jsx(eF,{"aria-hidden":"true"})})})},iF=({name:e,globalClassName:t,isCartMgmtSupported:n,productPageUrl:r,openLinksInNewTab:s,ariaLabel:a,showInWidgetDetails:u})=>{const{loading:l}=Cn();return n?w.jsx("button",{type:"button",disabled:l,onClick:u,className:B(t,`${N}-msg-product-card__title-link`),"aria-label":a,children:e}):r?w.jsx("a",{href:r,target:s?"_blank":"_self",rel:"noopener",className:B(t,`${N}-msg-product-card__title-link`),"aria-label":a,onClick:d=>ic({event:d,openLinksInNewTab:s,isCartMgmtSupported:n}),children:e}):w.jsx("p",{className:B(t,`${N}-msg-product-card__title`),children:e})},sF=({product:e,globalClassName:t,openLinksInNewTab:n,isCartMgmtSupported:r=!1,rawProduct:s})=>{const{showProductDescription:a}=ft(),{overrides:u,isInitialized:l}=_o(),{sendMessage:d,loading:f}=Cn(),m=xo(),p=l?u.ProductTile:void 0;if(p){const H={name:"ProductTile",payload:s!=null?s:{},api:m};return w.jsx(So,{tagName:p,props:H,label:"ProductTile"})}const{id:b,name:y,imageUrl:_,description:x,productPageUrl:A,price:S,priceBreakdown:C,discountPrice:O,listPrice:z,currencyCode:G}=e,D=O!=null?O:S,V=P8({priceBreakdown:C,currencyCode:G}),J=()=>{if(f)return;const H=y||"this product",ie=b?` [SKU: ${b}]`:"";d(`Show me details for ${H}${ie}`)},se=r?`View details for ${y}`:`Go to product page for ${y}`;return w.jsxs("div",{className:B(t,`${N}-msg-product-card`),children:[w.jsx(rF,{imageUrl:_||"",globalClassName:t,isCartMgmtSupported:r,productPageUrl:A,openLinksInNewTab:n,ariaLabel:se,name:y,showInWidgetDetails:J}),w.jsxs("div",{className:B(t,`${N}-msg-product-card__content`),children:[w.jsxs("div",{className:B(t,`${N}-msg-product-card__content-header`),children:[w.jsx(iF,{name:y||b,globalClassName:t,isCartMgmtSupported:r,productPageUrl:A,openLinksInNewTab:n,ariaLabel:se,showInWidgetDetails:J}),a&&x&&w.jsx("div",{className:B(t,`${N}-msg-product-card__description`),title:x,children:w.jsx(wo,{globalClassName:t,text:x})})]}),w.jsx("div",{className:B(t,`${N}-msg-product-card__price-row`),children:V?w.jsx("span",{className:B(t,`${N}-msg-product-card__price`),"aria-label":`Price from ${V.low} to ${V.high}`,children:V.range}):w.jsx(dp,{globalClassName:t,retailPrice:z,discountPrice:D,currencyCode:G})})]})]})},oF=e=>{var t,n;return{id:e.id,name:e.data.name,label:e.caption,description:e.data.description,imageUrl:e.data.imageUrl,productPageUrl:e.data.productPageUrl,price:e.data.price,discountPrice:e.data.discountPrice,listPrice:(t=e.data.listPrice)!=null?t:void 0,priceBreakdown:(n=e.data.priceBreakdown)!=null?n:void 0,currencyCode:e.data.currencyCode}},aF=({title:e,products:t,globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s,isCartMgmtSupported:a=!1})=>{const{showProductCaptions:u}=ft(),{overrides:l,isInitialized:d}=_o(),f=xo(),m=d?l.ProductCarousel:void 0;if(m){const p={name:"ProductCarousel",payload:{title:e,products:t},api:f};return w.jsx(So,{tagName:m,props:p,label:"ProductCarousel"})}return w.jsxs("div",{style:{marginBottom:"1rem"},children:[e&&w.jsx("p",{className:B(n,`${N}-product-carousel-title`),children:e}),w.jsx(e8,{globalClassName:n,spacing:s?"0.5rem":"6px",ariaLabel:e||"Product recommendations",children:t.map(p=>w.jsxs("div",{className:B(n,`${N}-product-carousel-item`),children:[w.jsx(sF,{product:oF(p),rawProduct:p,globalClassName:n,openLinksInNewTab:r,isCartMgmtSupported:a}),u&&w.jsx("p",{className:B(n,`${N}-product-carousel-caption`),title:p.caption,children:p.caption})]},p.id))})]})},wp=44,uF=400,lF=e=>{const t=typeof e=="number"?e:Number(e);return!Number.isFinite(t)||t<=0?wp:Math.min(Math.max(Math.round(t),wp),uF)},cF=e=>{try{return new URL(e,window.location.href).origin}catch(t){return null}},dF="parentOrigin",fF=(e,t)=>{if(!t)return e;try{const n=new URL(e,window.location.href);return n.searchParams.set(dF,t),n.toString()}catch(n){return e}},hF=(e,t,n)=>{if(!e||!t)return null;try{const r=new URL(e,window.location.href);return r.origin!==window.location.origin||!/\/Payments-Express\/?$/.test(r.pathname)?null:(r.pathname=r.pathname.replace(/\/Payments-Express\/?$/,"/Payments-ExpressProduct"),r.searchParams.set("pid",t),r.searchParams.set("quantity",String(n)),r.toString())}catch(r){return null}},xw=({expressPaymentUrl:e,globalClassName:t,onOrderComplete:n})=>{const r=R.useRef(null),[s,a]=R.useState(!1),[u,l]=R.useState(wp),d=typeof window!="undefined"?window.location.origin:"",f=fF(e,d),m=cF(e);return R.useEffect(()=>{const p=b=>{var _,x,A;if(m&&b.origin!==m||r.current&&b.source!==r.current.contentWindow)return;const y=b.data;if(!(!y||typeof y.type!="string"))switch(y.type){case"express.payment.available":a(!0),l(lF((_=y.payload)==null?void 0:_.height));break;case"express.payment.unavailable":a(!1);break;case"express.payment.success":n==null||n((A=(x=y.payload)==null?void 0:x.orderId)!=null?A:null);break}};return window.addEventListener("message",p),()=>window.removeEventListener("message",p)},[m,n]),w.jsx("div",{className:B(t,`${N}-cart-express`,{[`${N}-cart-express-ready`]:s}),style:s?{height:u}:void 0,"data-testid":"express-payment","aria-hidden":!s,children:w.jsx("iframe",{ref:r,className:B(t,`${N}-cart-express-frame`),src:f,title:"Express payment",allow:"payment *",scrolling:"no"})})},sc=({code:e,globalClassName:t,inactive:n})=>w.jsxs("span",{className:B(t,`${N}-cart-chip`,{inactive:n}),title:n?"Not applied":void 0,children:[w.jsx(T1,{"aria-hidden":"true"}),w.jsx("span",{children:e})]}),Rn=({label:e,badge:t,value:n,currencyCode:r,globalClassName:s,emphasized:a,isDiscount:u,fallback:l,loading:d})=>{let f;if(typeof n=="number")n===0&&!u?f="Free":f=Kr(u?-Math.abs(n):n,r);else if(l)f=l;else return null;return w.jsxs("div",{className:B(s,`${N}-cart-total-row`,{emphasized:a}),children:[w.jsxs("span",{className:B(s,`${N}-cart-total-label`),children:[e,t&&w.jsx("span",{className:B(s,`${N}-cart-total-badge`),children:t})]}),w.jsx("span",{className:B(s,`${N}-cart-total-value`),children:d?w.jsx("span",{className:B(s,`${N}-cart-total-shimmer`)}):f})]})};function Sw(e){var a;const n=((a=e.variants)!=null?a:[]).filter(u=>u.value).map(u=>`${u.lbl}: ${u.value}`).join(", "),r=n?` (${n})`:"",s=e.productId?` [SKU: ${e.productId}]`:"";return`${e.name}${r}${s}`}function vw(e){var r;const n=((r=e.variants)!=null?r:[]).filter(s=>s.value).map(s=>s.value).join(", ");return n?`${e.name} (${n})`:e.name}function _p(e){return typeof e=="string"?e:e&&typeof e.code=="string"?e.code:null}function xp(e){return(e!=null?e:[]).map(_p).filter(t=>t!==null)}function Aw(e){return e&&typeof e=="object"&&typeof e.status=="string"?e.status:void 0}function pF(e,t){var s;const n=new Map;for(const a of t!=null?t:[]){const u=_p(a),l=Aw(a);u!==null&&l!==void 0&&n.set(u.toLowerCase(),l)}const r=[];for(const a of e!=null?e:[]){const u=_p(a);if(u===null)continue;const l=(s=Aw(a))!=null?s:n.get(u.toLowerCase());r.push({code:u,applied:l==null||l==="applied"})}return r}function kw(e,t,n){const r=new Set((e!=null?e:[]).flatMap(s=>xp(s.coupons)).map(s=>s.toLowerCase()));return pF(t,n).filter(s=>!r.has(s.code.toLowerCase()))}const mF=({quantity:e,loading:t,disabled:n,globalClassName:r,onChange:s})=>{const[a,u]=R.useState(e.toString());R.useEffect(()=>{u(e.toString())},[e]);const l=m=>{if(n)return;const p=m.target.value;/^\d*$/.test(p)&&u(p)},d=()=>{const m=parseInt(a,10);!n&&!isNaN(m)&&m>0&&m!==e?s(m):u(e.toString())},f=m=>{m.key==="Enter"&&(m.preventDefault(),d())};return w.jsx("div",{className:B(r,`${N}-cart-qty-input-wrapper`),children:t?w.jsx(bC,{className:B(r,`${N}-cart-qty-spinner`),"aria-hidden":"true"}):w.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:B(r,`${N}-cart-qty-input`),value:a,disabled:n,onChange:l,onBlur:d,onKeyDown:f,"aria-label":"Quantity"})})},gF=({item:e,currencyCode:t,loading:n,disabled:r,globalClassName:s,onRemove:a,onQuantityChange:u})=>{var f,m;const l=typeof e.originalSubtotal=="number"&&typeof e.itemSubtotal=="number"&&e.originalSubtotal>e.itemSubtotal,d=xp(e.coupons);return w.jsxs("li",{className:B(s,`${N}-cart-item`),children:[e.imageUrl&&w.jsx("div",{className:B(s,`${N}-cart-item-image`),children:w.jsx("img",{src:e.imageUrl,alt:e.name||"Product image",loading:"lazy"})}),w.jsxs("div",{className:B(s,`${N}-cart-item-details`),children:[w.jsx("p",{className:B(s,`${N}-cart-item-name`),children:e.name}),w.jsxs("div",{className:B(s,`${N}-cart-item-attrs`),children:[((f=e.variants)!=null?f:[]).map(p=>w.jsxs("p",{className:B(s,`${N}-cart-item-attr`),children:[p.lbl,": ",p.value]},`${p.type}-${p.value}`)),((m=e.promotions)!=null?m:[]).map(p=>w.jsxs("p",{className:B(s,`${N}-cart-item-attr`),children:["Promotion: ",p]},p))]}),d.length>0&&w.jsx("div",{className:B(s,`${N}-cart-chips`),children:d.map(p=>w.jsx(sc,{code:p,globalClassName:s},p))}),w.jsx("span",{className:B(s,`${N}-cart-item-price`),children:n?w.jsx("span",{className:B(s,`${N}-cart-total-shimmer`)}):w.jsxs(w.Fragment,{children:[l&&w.jsx("span",{className:B(s,`${N}-cart-item-original-price`),children:Kr(e.originalSubtotal,t)}),w.jsx("span",{className:B(s,`${N}-cart-item-final-price`),children:Kr(e.itemSubtotal,t)})]})}),w.jsxs("div",{className:B(s,`${N}-cart-item-footer`),children:[w.jsx("span",{className:B(s,`${N}-cart-qty-heading`),children:"Quantity"}),w.jsx(mF,{quantity:e.quantity,loading:n,disabled:r,globalClassName:s,onChange:p=>u(e,p)}),w.jsx("button",{type:"button",className:B(s,`${N}-cart-item-remove`),disabled:r,onClick:()=>a(e),children:"Remove"})]})]})]})},EF=({cart:e,messageId:t,globalClassName:n,openLinksInNewTab:r})=>{const{sendMessage:s,loading:a,cartUpdating:u}=Cn(),[l,d]=R.useState(!1),[f,m]=R.useState(""),[p,b]=R.useState(null),y=a||u,{items:_=[],currencyCode:x="USD",subtotal:A,total:S,taxes:C,shippingCost:O,shippingDiscount:z,shippingPromotions:G=[],promotionsDiscount:D,promotions:V=[],couponsDiscount:J,bodyMessage:se,footerMessage:H,checkoutButtonUrl:ie,expressPaymentUrl:te}=e,le=kw(_,e.couponsApplied,e.coupons),fe=W=>{y||s(`Remove ${Sw(W)} from my cart`,{displayContent:`Remove ${vw(W)} from cart`})},ue=W=>{s(W?`I completed express payment. Show my order confirmation for order ${W}.`:"I completed express payment. Show my order confirmation.")},Se=(W,oe)=>{y||p||oe<1||(b(W.itemId),s(`Update ${Sw(W)} quantity to ${oe}`,{silent:!0,reconcileMessageId:t,displayContent:`Update ${vw(W)} to qty ${oe}`}).then(k=>{k.outcome==="success"?setTimeout(()=>b(null),300):b(null)}))},de=()=>{const W=f.trim();!W||y||(s(`Apply coupon code ${W}`),m(""))};return w.jsxs("div",{className:B(n,`${N}-cart`),children:[w.jsxs("div",{className:B(n,`${N}-cart-box`),children:[se&&w.jsxs("button",{type:"button",className:B(n,`${N}-cart-summary`),"aria-expanded":l,onClick:()=>d(W=>!W),children:[w.jsx("span",{className:B(n,`${N}-cart-summary-text`),children:w.jsx(wo,{text:se,globalClassName:n,openLinksInNewTab:r,showIsLoading:!1})}),w.jsx("span",{className:B(n,`${N}-cart-summary-toggle`),"aria-hidden":"true",children:l?w.jsx(E1,{}):w.jsx(y1,{})})]}),l&&w.jsxs("div",{className:B(n,`${N}-cart-expanded`),children:[w.jsxs("div",{className:B(n,`${N}-cart-items-section`),children:[w.jsx("ul",{className:B(n,`${N}-cart-items`),children:_.map(W=>w.jsx(gF,{item:W,currencyCode:x,loading:p===W.itemId,disabled:y||p===W.itemId,globalClassName:n,onRemove:fe,onQuantityChange:Se},W.itemId))}),le.length>0&&w.jsx("div",{className:B(n,`${N}-cart-chips`,`${N}-cart-applied-coupons`),children:le.map(W=>w.jsx(sc,{code:W.code,inactive:!W.applied,globalClassName:n},W.code))})]}),w.jsxs("div",{className:B(n,`${N}-cart-totals`),children:[w.jsx(Rn,{label:"Subtotal",value:A,currencyCode:x,globalClassName:n,loading:!!p}),w.jsx(Rn,{label:"Coupon",value:J,currencyCode:x,globalClassName:n,isDiscount:!0,loading:!!p}),w.jsx(Rn,{label:"Promotions",badge:V[0],value:D,currencyCode:x,globalClassName:n,isDiscount:!0,loading:!!p}),w.jsx(Rn,{label:"Shipping",value:O,currencyCode:x,globalClassName:n,fallback:"TBD",loading:!!p}),w.jsx(Rn,{label:"Shipping Discount",badge:G[0],value:z,currencyCode:x,globalClassName:n,isDiscount:!0,loading:!!p}),w.jsx(Rn,{label:"Tax",value:C,currencyCode:x,globalClassName:n,fallback:"TBD",loading:!!p}),w.jsx(Rn,{label:"Total",value:S,currencyCode:x,globalClassName:n,emphasized:!0,loading:!!p})]})]})]}),w.jsxs("div",{className:B(n,`${N}-cart-coupon`),children:[w.jsxs("div",{className:B(n,`${N}-cart-coupon-field`),children:[w.jsx("span",{className:B(n,`${N}-cart-coupon-icon`),"aria-hidden":"true",children:w.jsx(T1,{})}),w.jsx("input",{type:"text",className:B(n,`${N}-cart-coupon-input`),placeholder:"Enter coupon code","aria-label":"Enter coupon code",value:f,disabled:y,onChange:W=>m(W.target.value),onKeyDown:W=>{W.key==="Enter"&&(W.preventDefault(),de())}})]}),w.jsx("button",{type:"button",className:B(n,`${N}-cart-coupon-submit`),"aria-label":"Apply coupon",disabled:y||!f.trim(),onClick:de,children:w.jsx(xC,{"aria-hidden":"true"})})]}),te&&w.jsx(xw,{expressPaymentUrl:te,globalClassName:n,onOrderComplete:ue}),ie&&w.jsxs("a",{className:B(n,`${N}-cart-checkout-button`),href:ie,target:r?"_blank":"_self",rel:"noopener noreferrer",children:[w.jsx(wC,{"aria-hidden":"true"}),w.jsx("span",{children:"Checkout"})]}),w.jsx("p",{className:B(n,`${N}-cart-footer`),children:H||"Shipping and taxes calculated at checkout."})]})},yF=({item:e,currencyCode:t,globalClassName:n})=>{var a,u;const r=typeof e.originalSubtotal=="number"&&typeof e.itemSubtotal=="number"&&e.originalSubtotal>e.itemSubtotal,s=xp(e.coupons);return w.jsxs("li",{className:B(n,`${N}-cart-item`),children:[e.imageUrl&&w.jsx("div",{className:B(n,`${N}-cart-item-image`),children:w.jsx("img",{src:e.imageUrl,alt:e.name||"Product image",loading:"lazy"})}),w.jsxs("div",{className:B(n,`${N}-cart-item-details`),children:[w.jsx("p",{className:B(n,`${N}-cart-item-name`),children:e.name}),w.jsxs("div",{className:B(n,`${N}-cart-item-attrs`),children:[((a=e.variants)!=null?a:[]).map(l=>w.jsxs("p",{className:B(n,`${N}-cart-item-attr`),children:[l.lbl,": ",l.value]},`${l.type}-${l.value}`)),((u=e.promotions)!=null?u:[]).map(l=>w.jsxs("p",{className:B(n,`${N}-cart-item-attr`),children:["Promotion: ",l]},l))]}),s.length>0&&w.jsx("div",{className:B(n,`${N}-cart-chips`),children:s.map(l=>w.jsx(sc,{code:l,globalClassName:n},l))}),w.jsxs("span",{className:B(n,`${N}-cart-item-price`),children:[r&&w.jsx("span",{className:B(n,`${N}-cart-item-original-price`),children:Kr(e.originalSubtotal,t)}),w.jsx("span",{className:B(n,`${N}-cart-item-final-price`),children:Kr(e.itemSubtotal,t)})]}),w.jsx("div",{className:B(n,`${N}-cart-item-footer`),children:w.jsxs("span",{className:B(n,`${N}-cart-item-qty`),children:["Qty: ",e.quantity]})})]})]})},TF=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})},bF=({order:e,globalClassName:t})=>{const[n,r]=R.useState(!0),{id:s,orderedOn:a,items:u=[],currencyCode:l="USD",subtotal:d,total:f,taxes:m,shippingCost:p,shippingDiscount:b,shippingPromotions:y=[],promotionsDiscount:_,promotions:x=[],couponsDiscount:A,bodyMessage:S,footerMessage:C}=e,O=kw(u,e.couponsApplied);return w.jsxs("div",{className:B(t,`${N}-cart`),children:[w.jsxs("div",{className:B(t,`${N}-cart-banner`),children:[w.jsx("span",{className:B(t,`${N}-cart-banner-icon`),"aria-hidden":"true",children:w.jsx(SC,{})}),w.jsx("p",{className:B(t,`${N}-cart-banner-text`),children:"Your order is confirmed!"})]}),w.jsxs("div",{className:B(t,`${N}-order-confirmation-meta`),children:[w.jsxs("span",{children:["Order No: ",s]}),w.jsxs("span",{children:["Ordered On: ",TF(a)]})]}),w.jsxs("div",{className:B(t,`${N}-cart-box`),children:[S&&w.jsxs("button",{type:"button",className:B(t,`${N}-cart-summary`),"aria-expanded":n,onClick:()=>r(z=>!z),children:[w.jsx("span",{className:B(t,`${N}-cart-summary-text`),children:w.jsx(wo,{text:S,globalClassName:t,showIsLoading:!1})}),w.jsx("span",{className:B(t,`${N}-cart-summary-toggle`),"aria-hidden":"true",children:n?w.jsx(E1,{}):w.jsx(y1,{})})]}),n&&w.jsxs("div",{className:B(t,`${N}-cart-expanded`),children:[w.jsx("ul",{className:B(t,`${N}-cart-items`),children:u.map(z=>w.jsx(yF,{item:z,currencyCode:l,globalClassName:t},z.itemId))}),O.length>0&&w.jsx("div",{className:B(t,`${N}-cart-chips`,`${N}-cart-applied-coupons`),children:O.map(z=>w.jsx(sc,{code:z.code,globalClassName:t},z.code))}),w.jsxs("div",{className:B(t,`${N}-cart-totals`),children:[w.jsx(Rn,{label:"Subtotal",value:d,currencyCode:l,globalClassName:t}),w.jsx(Rn,{label:"Coupon",value:A,currencyCode:l,globalClassName:t,isDiscount:!0}),w.jsx(Rn,{label:"Promotions",badge:x[0],value:_,currencyCode:l,globalClassName:t,isDiscount:!0}),w.jsx(Rn,{label:"Shipping",value:p,currencyCode:l,globalClassName:t,fallback:"TBD"}),w.jsx(Rn,{label:"Shipping Discount",badge:y[0],value:b,currencyCode:l,globalClassName:t,isDiscount:!0}),w.jsx(Rn,{label:"Tax",value:m,currencyCode:l,globalClassName:t,fallback:"TBD"}),w.jsx(Rn,{label:"Total",value:f,currencyCode:l,globalClassName:t,emphasized:!0})]})]})]}),w.jsx("p",{className:B(t,`${N}-cart-footer`),children:C||"Shipping and taxes calculated at checkout."})]})},wF=({image:e,alt:t,globalClassName:n})=>{const[r,s]=R.useState(e.src),[a,u]=R.useState(!1),l=()=>{e.fallbackSrc&&r!==e.fallbackSrc&&s(e.fallbackSrc)};return w.jsx("img",{className:B(n,`${N}-pdp-gallery__image`,{[`${N}-pdp-gallery__image--loaded`]:a}),src:r,alt:t,loading:"lazy",onLoad:()=>u(!0),onError:l})},_F=({images:e,altText:t,globalClassName:n})=>{if(e.length===0)return null;const r=e.length>1;return w.jsxs(ip,{className:B(n,`${N}-pdp-gallery`),slidesPerPage:1,slidesPerMove:1,slideCount:e.length,loop:!0,"aria-label":t||"Product images",children:[w.jsx(tp,{className:B(n,`${N}-pdp-gallery__item-group`),children:e.map((s,a)=>w.jsx(ep,{index:a,className:B(n,`${N}-pdp-gallery__item`),children:w.jsx(wF,{image:s,alt:t?`${t} (${a+1})`:`Product image ${a+1}`,globalClassName:n})},s.src))}),r&&w.jsxs(Qh,{className:B(n,`${N}-pdp-gallery__control`),children:[w.jsx(rp,{className:B(n,`${N}-pdp-gallery__prev-trigger`),"aria-label":"Previous image",children:w.jsx(bb,{size:"16px"})}),w.jsx(np,{className:B(n,`${N}-pdp-gallery__next-trigger`),"aria-label":"Next image",children:w.jsx(wb,{size:"16px"})})]}),r&&w.jsx(Zh,{className:B(n,`${N}-pdp-gallery__indicator-group`),children:Array.from({length:e.length},(s,a)=>w.jsx(Jh,{index:a,className:B(n,`${N}-pdp-gallery__indicator`),"aria-label":`Go to image ${a+1}`},a))})]})},Va="color",Sp=(e,t)=>/^https?:\/\//i.test(t)||!e?t:`${e}${t}`,xF=e=>e.replace(/(^|\/)large\//,"$1medium/"),Cw=(e,t)=>!e.vattr||!t?!1:e.vattr.some(n=>n.id===Va&&n.vals.includes(t)),Nw=(e,t)=>{const n=xF(t),r=Sp(e,n);return n===t?{src:r}:{src:r,fallbackSrc:Sp(e,t)}},SF=(e,t)=>{var l,d;const n=((l=e.imgGroups)!=null?l:[]).filter(f=>f.viewType==="large"),r=t&&n.find(f=>Cw(f,t)),s=n.find(f=>f.vattr===null),a=r||s||n[0],u=((d=a==null?void 0:a.imgs)!=null?d:[]).map(f=>Nw(e.baseUrl,f.url));return u.length>0?u:e.imageUrl?[Nw(e.baseUrl,e.imageUrl)]:[]},vF=(e,t)=>{var s,a,u;const n=((s=e.imgGroups)!=null?s:[]).find(l=>l.viewType==="swatch"&&Cw(l,t)),r=(u=(a=n==null?void 0:n.imgs)==null?void 0:a[0])==null?void 0:u.url;return r?Sp(e.baseUrl,r):""},oc=(e,t,n,r={})=>!e||e.length===0||!t||!n?!1:e.some(s=>{var a;return((a=s.vars)==null?void 0:a[t])!==n||s.ord===!1?!1:Object.entries(r).every(([u,l])=>{var d;return u===t||((d=s.vars)==null?void 0:d[u])===l})}),AF=(e,t)=>{const n=Object.keys(t);return n.length===0?!0:!e||e.length===0?!1:e.some(r=>r.ord!==!1&&n.every(s=>{var a;return((a=r.vars)==null?void 0:a[s])===t[s]}))},kF=(e,t,n,r,s)=>{if(!e||e.length===0)return ce(j({},s),{[n]:r});const a=e.find(l=>{var d;return((d=l.vars)==null?void 0:d[n])===r&&l.ord!==!1&&Object.keys(l.vars).length>=t.length&&Object.entries(s).every(([f,m])=>{var p;return f===n||((p=l.vars)==null?void 0:p[f])===m})});if(a)return j({},a.vars);const u=e.find(l=>{var d;return((d=l.vars)==null?void 0:d[n])===r&&l.ord!==!1&&Object.keys(l.vars).length>=t.length});return u?j({},u.vars):ce(j({},s),{[n]:r})},Ow=(e,t)=>{var s,a,u,l;if(!(Array.isArray(e.vattr)&&e.vattr.length>0))return(s=e.id)!=null?s:null;if(!e.vmat||e.vmat.length===0)return(a=e.id)!=null?a:null;const r=e.vmat.find(d=>d.ord!==!1&&Object.entries(t).every(([f,m])=>{var p;return((p=d.vars)==null?void 0:p[f])===m}));return(l=(u=r==null?void 0:r.pid)!=null?u:e.id)!=null?l:null},CF=(e,t)=>{if(!e.vmat||e.vmat.length===0||Object.keys(t).length===0)return e.pr;const n=e.vmat.find(r=>r.ord!==!1&&Object.entries(t).every(([s,a])=>{var u;return((u=r.vars)==null?void 0:u[s])===a}));return n!=null&&n.pr?n.pr:e.pr},NF=e=>{var n;const t={};for(const r of(n=e.vattr)!=null?n:[]){const s=r.opts.find(u=>oc(e.vmat,r.id,u.val)),a=s!=null?s:r.opts[0];a&&(t[r.id]=a.val)}return t},OF=300,IF=({product:e,globalClassName:t,openLinksInNewTab:n,isCartMgmtSupported:r=!1})=>{var et,mt,Lt,pn,wn,Dt,ze;const{addToCart:s,sendMessage:a,loading:u}=Cn(),{overrides:l,isInitialized:d}=_o(),f=xo(),m=e.data,p=(et=m.vattr)!=null?et:[],[b,y]=R.useState(()=>NF(m)),_=AF(m.vmat,b),x=(Lt=(mt=m.quantity)==null?void 0:mt.minQuantity)!=null?Lt:1,A=(wn=(pn=m.quantity)==null?void 0:pn.maxQuantity)!=null?wn:Number.POSITIVE_INFINITY,S=(ze=(Dt=m.quantity)==null?void 0:Dt.increment)!=null?ze:1,[C,O]=R.useState(x),[z,G]=R.useState(!1),D=R.useRef(!1);R.useEffect(()=>{z&&(u?D.current=!0:D.current&&(D.current=!1,G(!1)))},[z,u]);const V=b[Va],J=R.useMemo(()=>SF(m,V),[m,V]),se=R.useMemo(()=>CF(m,b),[m,b]),H=p.find(Ce=>Ce.id===Va),ie=p.filter(Ce=>Ce.id!==Va),te=Ow(m,b),[le,fe]=R.useState(C),ue=R.useRef(te),Se=ue.current===te?le:C;R.useEffect(()=>{if(ue.current!==te){ue.current=te,fe(C);return}const Ce=window.setTimeout(()=>fe(C),OF);return()=>window.clearTimeout(Ce)},[C,te]);const de=C===le,W=R.useMemo(()=>_&&(ue.current!==te||de)?hF(m.expressPaymentUrl,te,Se):null,[m.expressPaymentUrl,te,Se,_,de]),oe=R.useCallback(Ce=>{a(Ce?`I completed express payment. Show my order confirmation for order ${Ce}.`:"I completed express payment. Show my order confirmation.")},[a]),k=d?l.ProductDetailCard:void 0;if(k){const Ce={name:"ProductDetailCard",payload:e,api:f};return w.jsx(So,{tagName:k,props:Ce,label:"ProductDetailCard"})}const M=(Ce,Xe)=>()=>{y(nt=>{const pt=!oc(m.vmat,Ce,Xe,nt);return Ce===Va||pt?kF(m.vmat,p,Ce,Xe,nt):ce(j({},nt),{[Ce]:Xe})})},Z=()=>{if(u)return;const Ce=Ow(m,b);if(!Ce)return;const Xe=p.map(nt=>{const pt=nt.opts.find(Mt=>Mt.val===b[nt.id]);return pt?{label:nt.lbl||nt.id,value:pt.name||pt.val}:null}).filter(nt=>nt!==null);G(!0),s({productName:m.name,sku:Ce,quantity:C,variants:Xe})},P=!_||C-S<x,xe=!_||C+S>A,Ie=Ce=>{var nt;const Xe=b[Ce.id];return(nt=Ce.opts.find(pt=>pt.val===Xe))==null?void 0:nt.name},he=()=>O(Ce=>Math.max(x,Ce-S)),ve=()=>O(Ce=>Math.min(A,Ce+S)),Fe=Ce=>w.jsxs("div",{className:B(t,`${N}-msg-pdp__variant`),children:[w.jsxs("div",{className:B(t,`${N}-msg-pdp__variant-label`),children:[w.jsx("span",{id:`variant-label-${Ce.id}`,className:B(t,`${N}-msg-pdp__variant-name`),children:Ce.lbl||Ce.id}),Ie(Ce)&&w.jsx("span",{className:B(t,`${N}-msg-pdp__variant-value`),children:Ie(Ce)})]}),w.jsx("div",{role:"radiogroup","aria-labelledby":`variant-label-${Ce.id}`,className:B(t,`${N}-msg-pdp__chips`),children:Ce.opts.map(Xe=>{const nt=oc(m.vmat,Ce.id,Xe.val,b),pt=b[Ce.id]===Xe.val;return w.jsxs("label",{className:B(`${N}-msg-pdp__chip`,{selected:pt,unavailable:!nt}),children:[w.jsx("input",{type:"radio",name:`variant-${Ce.id}`,value:Xe.val,checked:pt,"aria-description":nt?void 0:"unavailable",onChange:M(Ce.id,Xe.val),className:`${N}-msg-pdp__radio-input`}),w.jsx("span",{children:Xe.name||Xe.val})]},Xe.val)})})]},Ce.id),Ge=Ce=>w.jsxs("div",{className:B(t,`${N}-msg-pdp__variant`),children:[w.jsxs("div",{className:B(t,`${N}-msg-pdp__variant-label`),children:[w.jsx("span",{id:`variant-label-${Ce.id}`,className:B(t,`${N}-msg-pdp__variant-name`),children:Ce.lbl||"Color"}),Ie(Ce)&&w.jsx("span",{className:B(t,`${N}-msg-pdp__variant-value`),children:Ie(Ce)})]}),w.jsx("div",{role:"radiogroup","aria-labelledby":`variant-label-${Ce.id}`,className:B(t,`${N}-msg-pdp__swatches`),children:Ce.opts.map(Xe=>{const nt=oc(m.vmat,Ce.id,Xe.val,b),pt=b[Ce.id]===Xe.val,Mt=vF(m,Xe.val);return Mt?w.jsxs("label",{className:B(`${N}-msg-pdp__swatch`,{selected:pt,unavailable:!nt}),children:[w.jsx("input",{type:"radio",name:`variant-${Ce.id}`,value:Xe.val,checked:pt,"aria-label":Xe.name||Xe.val,"aria-description":nt?void 0:"unavailable",onChange:M(Ce.id,Xe.val),className:`${N}-msg-pdp__radio-input`}),w.jsx("img",{className:B(t,`${N}-msg-pdp__swatch-image`),src:Mt,alt:Xe.name||Xe.val,loading:"lazy"})]},Xe.val):w.jsxs("label",{className:B(`${N}-msg-pdp__chip`,{selected:pt,unavailable:!nt}),children:[w.jsx("input",{type:"radio",name:`variant-${Ce.id}`,value:Xe.val,checked:pt,"aria-description":nt?void 0:"unavailable",onChange:M(Ce.id,Xe.val),className:`${N}-msg-pdp__radio-input`}),w.jsx("span",{children:Xe.name||Xe.val})]},Xe.val)})})]});return w.jsx("div",{className:B(t,`${N}-msg-pdp`),children:w.jsxs("div",{className:B(t,`${N}-msg-pdp__card`),children:[w.jsx("div",{className:B(t,`${N}-msg-pdp__gallery`),children:w.jsx(_F,{images:J,altText:m.name,globalClassName:t})}),w.jsxs("div",{className:B(t,`${N}-msg-pdp__content`),children:[m.slugUrl?w.jsx("a",{href:m.slugUrl,target:n?"_blank":"_self",rel:"noopener noreferrer",className:B(t,`${N}-msg-pdp__title-link`),"aria-label":`Go to product page for ${m.name}`,onClick:Ce=>ic({event:Ce,openLinksInNewTab:n,isCartMgmtSupported:r}),children:m.name}):w.jsx("p",{className:B(t,`${N}-msg-pdp__title`),children:m.name}),w.jsx(dp,{globalClassName:t,className:`${N}-msg-pdp__price`,retailPrice:se==null?void 0:se.orig,discountPrice:(se==null?void 0:se.cur)||(se==null?void 0:se.prom),currencyCode:m.ccy,fontSize:"14px"}),m.dscr&&w.jsx("div",{className:B(t,`${N}-msg-pdp__description`),children:w.jsx(wo,{globalClassName:t,text:m.dscr})}),H&&Ge(H),ie.map(Fe),r&&w.jsxs("div",{className:B(t,`${N}-msg-pdp__variant`),children:[w.jsxs("div",{className:B(t,`${N}-msg-pdp__variant-label`),children:[w.jsx("span",{className:B(t,`${N}-msg-pdp__variant-name`),children:"Quantity"}),w.jsx("span",{className:B(t,`${N}-msg-pdp__variant-value`),children:C})]}),w.jsxs("div",{className:B(t,`${N}-msg-pdp__stepper`),children:[w.jsx(lr,{className:`${N}-msg-pdp__stepper-btn`,ariaLabel:"Decrease quantity",icon:w.jsx(fC,{}),disabled:P,onClick:he}),w.jsx("span",{className:B(t,`${N}-msg-pdp__quantity`),children:C}),w.jsx(lr,{className:`${N}-msg-pdp__stepper-btn`,ariaLabel:"Increase quantity",icon:w.jsx(hC,{}),disabled:xe,onClick:ve})]})]}),r&&w.jsxs("div",{className:B(t,`${N}-msg-pdp__actions`),children:[W&&w.jsx(xw,{expressPaymentUrl:W,globalClassName:t,onOrderComplete:oe},W),w.jsx(bf,{className:`${N}-msg-pdp__add-to-cart`,disabled:!_||u||z,onClick:Z,children:z?"Adding...":"Add to cart"})]})]})]})})},PF=e=>{if(e.imageUrl)return e.baseUrl?e.baseUrl+e.imageUrl:e.imageUrl},RF=({products:e,table:t,globalClassName:n,openLinksInNewTab:r})=>{const{isCartMgmtSupported:s}=ft(),{overrides:a,isInitialized:u}=_o(),l=xo(),d=u?a.ProductComparison:void 0;if(d){const p={name:"ProductComparison",payload:{products:e,table:t},api:l};return w.jsx(So,{tagName:d,props:p,label:"ProductComparison"})}if(!e.length)return null;const f=`auto repeat(${e.length}, 1fr)`,m=`${90+e.length*140}px`;return w.jsx("div",{className:B(n,`${N}-product-comparison`),children:w.jsxs("div",{className:`${N}-product-comparison__grid`,style:{gridTemplateColumns:f,minWidth:m},children:[w.jsxs("div",{className:`${N}-product-comparison__header`,children:[w.jsx("div",{className:`${N}-product-comparison__header-spacer`}),e.map(p=>{var y,_,x,A;const b=PF(p);return w.jsxs("div",{className:B(n,`${N}-product-comparison__product-col`),children:[b&&w.jsx("img",{className:B(n,`${N}-product-comparison__image`),src:b,alt:p.name||"Product image",loading:"eager"}),p.slugUrl?w.jsx("a",{href:p.slugUrl,target:r?"_blank":"_self",rel:"noopener",className:B(n,`${N}-product-comparison__name`),"aria-label":`Go to product page for ${p.name}`,onClick:S=>ic({event:S,openLinksInNewTab:r,isCartMgmtSupported:s}),children:p.name}):w.jsx("span",{className:B(n,`${N}-product-comparison__name`),children:p.name}),w.jsx(dp,{globalClassName:n,retailPrice:(y=p.pr)==null?void 0:y.orig,discountPrice:(A=(_=p.pr)==null?void 0:_.prom)!=null?A:(x=p.pr)==null?void 0:x.cur,currencyCode:p.ccy,fontSize:"0.875rem"})]},p.id)})]}),w.jsx("div",{className:`${N}-product-comparison__table`,children:t.map(p=>w.jsxs("div",{className:`${N}-product-comparison__row`,children:[w.jsx("div",{className:B(n,`${N}-product-comparison__row-label`),children:p.row_name}),e.map((b,y)=>w.jsx("div",{className:B(n,`${N}-product-comparison__row-value`),children:p.values[y]},`${p.row_name}-${b.id}`))]},p.row_name))})]})})},Iw=({content:e,messageId:t,globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s})=>{const{sendMessage:a,loading:u,cartUpdating:l}=Cn(),{isCartMgmtSupported:d,logger:f}=ft(),{overrides:m,isInitialized:p}=_o(),b=xo(),y=R.useMemo(()=>e.response.flatMap(KA),[e.response]);return w.jsx(w.Fragment,{children:y.map((_,x)=>{var A,S,C,O,z,G,D,V,J,se,H,ie,te,le,fe,ue,Se,de,W,oe,k,M,Z,P,xe,Ie;switch(_.type){case"markdown":{const he=(S=(A=_.data)==null?void 0:A.content)!=null?S:"";return _.index===ci&&Lg(he)?null:w.jsx(wo,{text:he,globalClassName:n,openLinksInNewTab:r,showIsLoading:!1},`${_.type}-${(C=_.index)!=null?C:x}`)}case"product_carousel":return w.jsx(aF,{title:(z=(O=_.data)==null?void 0:O.title)!=null?z:"",products:(D=(G=_.data)==null?void 0:G.products)!=null?D:[],globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s,isCartMgmtSupported:d},`${_.type}-${(V=_.index)!=null?V:x}`);case"product_tile":return w.jsx(IF,{product:_.data,globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s,isCartMgmtSupported:d},`${_.type}-${(J=_.index)!=null?J:x}`);case"product_comparison":return w.jsx(RF,{products:(H=(se=_.data)==null?void 0:se.products)!=null?H:[],table:(te=(ie=_.data)==null?void 0:ie.table)!=null?te:[],globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s},`${_.type}-${(le=_.index)!=null?le:x}`);case"cart":{const he=(Se=(ue=(fe=_.data)==null?void 0:fe.cart)==null?void 0:ue.cartSummary)==null?void 0:Se.cartDetails;return he?w.jsx(EF,{cart:he,messageId:t,productsToHighlight:_.data.products_to_highlight,globalClassName:n,openLinksInNewTab:r},`${_.type}-${(de=_.index)!=null?de:x}`):null}case"order_confirmation":{const he=_.data,ve=(k=(W=he==null?void 0:he.order)==null?void 0:W.orderDetails)!=null?k:(oe=he==null?void 0:he.data)==null?void 0:oe.orderConfirmation;return ve?w.jsx(bF,{order:ve,globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s},`${_.type}-${(M=_.index)!=null?M:x}`):null}case"tool_results":{const he=_.data,ve=_.output_name,Fe=p&&ve&&Object.prototype.hasOwnProperty.call(m,ve)?m[ve]:void 0,Ge=typeof Fe=="string"?Fe:void 0;if(!Ge||!ve)return f!=null&&f.isDevelopment&&(ve?f.warn(`🦜 tool_results "${ve}" rendered nothing — no override registered for that key. Register one in the overrides map: { "${ve}": "<your-tag-name>" }.`,{registeredKeys:Object.keys(m),payload:he}):f.warn("🦜 tool_results block has no output_name — nothing to route on",{payload:he})),null;const et={name:ve,payload:he,api:b};return w.jsx(Z9,{overrideName:ve,children:w.jsx(So,{tagName:Ge,props:et,label:`toolResult:${ve}`})},`${_.type}-${ve}-${(Z=_.index)!=null?Z:x}`)}case"suggestions":return w.jsx("div",{style:{marginTop:"0.5rem"},children:w.jsx(L8,{disabled:u||l,suggestions:(xe=(P=_.data)==null?void 0:P.display_text)!=null?xe:[],globalClassName:n,isWidgetStandalone:s,onSuggestionClick:a})},`${_.type}-${(Ie=_.index)!=null?Ie:x}`);default:return null}})})};class Pw extends R.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){St(!0,"error","Message content threw during render:",t,n.componentStack)}render(){return this.state.hasError?w.jsx("p",{className:B(this.props.globalClassName,`${N}-reset-message`),children:"Oops, I had trouble displaying this response."}):this.props.children}}const LF=({message:e,globalClassName:t,openLinksInNewTab:n,isWidgetStandalone:r})=>{const{logger:s}=ft(),a=R.useMemo(()=>{if(typeof e.content!="string")return null;const l=Gu(e.content);if(l)return l;const d=Rg(e.content);return d?{response:[d]}:null},[e.content]),u=R.useMemo(()=>{var f;const l="Oops, I had trouble with your request.";if(typeof e.content!="string")return s==null||s.warn("Message content is not richtext format. Showing fallback text.",e.content),l;const d=e.content.trim();try{const m=JSON.parse(d);if(typeof m=="object"&&m!==null)return s==null||s.debug("Detected JSON object instead of array of responses in message content",e.content),(f=Ig(m))!=null?f:l}catch(m){if(d.startsWith("{")||d.startsWith("["))return s==null||s.warn("Failed to parse JSON-like message content. Showing fallback text.",e.content),l}return e.content||l},[s,e.content]);switch(e.role){case"user":return w.jsx("div",{className:B(t,`${N}-message`,r?"standalone":"embedded"),children:w.jsx("div",{className:B(t,`${N}-user-message`,r?"standalone":"embedded"),children:w.jsxs("div",{className:B(t,`${N}-user-message-row`,r?"standalone":"embedded"),children:[w.jsx("span",{className:B(t,`${N}-message-icon user-message-icon`,r?"standalone":"embedded"),children:w.jsx(_C,{})}),w.jsx("p",{className:B(t,`${N}-user-message-text`,r?"standalone":"embedded"),children:e.content})]})})});case"agent":return w.jsx("div",{className:B(t,`${N}-message-group`,r?"standalone":"embedded"),children:w.jsx("div",{className:`${N}-message-group-child`,children:a?w.jsx(Pw,{globalClassName:t,children:w.jsx(Iw,{content:a,messageId:e.id,globalClassName:t,openLinksInNewTab:n,isWidgetStandalone:r})}):w.jsx(wo,{text:u,globalClassName:t,openLinksInNewTab:n,showIsLoading:!1})})});case"system":return w.jsx("div",{className:B(t,`${N}-message`,r?"standalone":"embedded"),children:w.jsx("p",{className:B(t,`${N}-reset-message`),children:e.content})})}},DF=({message:e,onRetry:t,globalClassName:n,isWidgetStandalone:r})=>w.jsxs("div",{className:B(n,`${N}-send-error`,r?"standalone":"embedded"),role:"alert",children:[w.jsx("span",{className:B(n,`${N}-send-error-text`),children:e}),w.jsxs("button",{type:"button",className:B(n,`${N}-retry-button`),onClick:t,children:[w.jsx(kC,{"aria-hidden":"true"})," Retry"]})]}),MF="You are offline or we couldn't reach the assistant. Check connection and try again.",vp=({isWidgetStandalone:e})=>{var H,ie;const{globalClassName:t,openLinksInNewTab:n,logger:r,autoScroll:s}=ft(),{messages:a,streamingBlocks:u,isAgentTyping:l,loading:d,progressMessage:f,connectionStatus:m,error:p,sendError:b,retryLastMessage:y,retryConnection:_}=Cn(),x=R.useRef(null),A=a.length>0,S=u.some(JA),C=a[a.length-1],O=C?QA(C.content,"suggestions"):!1,z=A&&(d||l)&&!S&&!O,G=m==="reconnecting"&&!z,D=m==="error";let V=null;D?V={message:p!=null?p:MF,kind:"connection",onRetry:_}:b&&(V={message:b.message,kind:"send",onRetry:y}),R.useEffect(()=>{var te;(te=x.current)==null||te.scrollIntoView({behavior:"smooth"})},[]),R.useEffect(()=>{var te;s&&((te=x.current)==null||te.scrollIntoView({behavior:"smooth"}))},[a,u,b,p,s]);const J=(H=V==null?void 0:V.message)!=null?H:null,se=(ie=V==null?void 0:V.kind)!=null?ie:null;return R.useEffect(()=>{J&&(r==null||r.error("Error message shown to user",{message:J,kind:se}))},[J,se,r]),w.jsxs(w.Fragment,{children:[d&&!A&&w.jsx(U8,{globalClassName:t,isWidgetStandalone:e}),a.map(te=>w.jsx(LF,{message:te,globalClassName:t,openLinksInNewTab:n,isWidgetStandalone:e},te.id)),V&&w.jsx(DF,{message:V.message,onRetry:V.onRetry,globalClassName:t,isWidgetStandalone:e}),S&&w.jsxs("div",{className:B(t,`${N}-message-group`,e?"standalone":"embedded"),children:[w.jsx(Pw,{globalClassName:t,children:w.jsx(Iw,{content:{response:u},globalClassName:t,openLinksInNewTab:n,isWidgetStandalone:e})}),(d||l)&&w.jsx(fp,{globalClassName:t,isWidgetStandalone:e})]}),z&&w.jsx(fp,{globalClassName:t,isWidgetStandalone:e,loadingText:f}),G&&w.jsx(fp,{globalClassName:t,isWidgetStandalone:e,loadingText:"Reconnecting..."}),w.jsx("div",{ref:x})]})},FF=()=>w.jsxs("svg",{className:`${N}-progress-step-check`,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[w.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),w.jsx("path",{d:"M5 8.5L7 10.5L11 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),BF=()=>w.jsx("svg",{className:`${N}-progress-step-starburst`,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{d:"M8 1v3M8 12v3M1 8h3M12 8h3M3.05 3.05l2.12 2.12M10.83 10.83l2.12 2.12M3.05 12.95l2.12-2.12M10.83 5.17l2.12-2.12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),UF=(e,t)=>e===0?[]:e<0?t:t.slice(-e),Ap=({progressStepsLimit:e,steps:t,globalClassName:n})=>{const{progressStepsLimit:r}=ft(),s=e!=null?e:r,{overrides:a,isInitialized:u}=_o(),l=xo();if(t.length===0||s===0)return null;const d=UF(s,t),f=u?a.ProgressSteps:void 0;if(f){const m={name:"ProgressSteps",payload:{steps:d},api:l};return w.jsx(So,{tagName:f,props:m,label:"ProgressSteps"})}return w.jsx("div",{className:B(n,`${N}-progress-steps-panel`),children:w.jsx("div",{className:`${N}-progress-steps`,children:w.jsx("ul",{className:`${N}-progress-steps-list`,children:d.map((m,p)=>{const b=p<d.length-1,y=p===d.length-1;return w.jsxs("li",{className:B(`${N}-progress-step`,y&&"active"),children:[y&&w.jsx("span",{className:`${N}-progress-step-arc`}),w.jsx("span",{className:`${N}-progress-step-text`,children:m}),w.jsx("span",{className:B(`${N}-progress-step-icon`,b?"done":"active"),children:b?w.jsx(FF,{}):w.jsx(BF,{})})]},`${p}-${m}`)})})})})},Rw=()=>{const{globalClassName:e,themeVariables:t,messageAlignment:n,enableDownloadTranscript:r}=ft(),{isAgentTyping:s,sendMessage:a,resetConversation:u,progressSteps:l,downloadTranscript:d}=Cn(),f=s;return w.jsxs("div",{className:B(e,`${N}-container`,`${N}-embedded-chat`),style:t,children:[w.jsx("div",{className:B(e,`${N}-message-container`,`container-${n}`,"embedded"),children:w.jsx(vp,{isWidgetStandalone:!1})}),w.jsx(Ap,{steps:l,globalClassName:e}),w.jsx(ph,{componentType:"chat",className:"embedded-chat",isLoading:f,onSubmit:m=>a(m)}),w.jsx("div",{className:B(`${N}-embedded-chat-menu`),children:w.jsxs(MD,{componentType:"chat",children:[w.jsx(Yb,{componentType:"chat"}),w.jsx(Zy,{componentType:"chat",onClearChat:u}),r&&w.jsx(eT,{componentType:"chat",onDownloadTranscript:d})]})})]})},Lw=e=>{var d;const{children:t,disabled:n}=e,[r,s]=R.useState((d=e.container)==null?void 0:d.current),a=R.useSyncExternalStore(jF,()=>!1,()=>!0),{getRootNode:u}=Ql();if(R.useEffect(()=>{s(()=>{var f;return(f=e.container)==null?void 0:f.current})},[e.container]),a||n)return w.jsx(w.Fragment,{children:t});const l=r!=null?r:HF(u);return w.jsx(w.Fragment,{children:R.Children.map(t,f=>Vs.createPortal(f,l))})},HF=e=>{const t=e==null?void 0:e(),n=t.getRootNode();return as(n)?n:Cr(t).body},jF=()=>()=>{},Dw=()=>{const{globalClassName:e,themeVariables:t,messageAlignment:n}=ft(),{mode:r,status:s,dialogPosition:a,isDialogFullHeight:u,dialogWidth:l}=Vr(),{loading:d,isAgentTyping:f,sendMessage:m,resetConversation:p,progressSteps:b,downloadTranscript:y}=Cn(),{isOpen:_}=s||{},x=!!s.isOpen,A=r==="standalone",S=f||d,C=()=>{$r(!1)};return x?w.jsx(Bb,{lazyMount:!0,unmountOnExit:!0,modal:!1,closeOnEscape:!1,closeOnInteractOutside:!1,open:x,children:w.jsx(Lw,{children:w.jsx(ap,{className:B(e,`${N}-container`,`${N}-dialog`,a,u&&"full-height"),style:j(j({},t),l&&{width:l}),children:w.jsxs(sp,{className:B(e,`${N}-dialog-content`,{standalone:A,embedded:!A}),children:[w.jsx($b,{componentType:"dialog",onClearChat:p,onClose:C,onDownloadTranscript:y}),w.jsx(op,{className:B(e,`${N}-message-container`,`container-${n}`,{standalone:A,embedded:!A}),children:w.jsx(vp,{isWidgetStandalone:A,isOpen:_})}),w.jsx(Ap,{steps:b,globalClassName:e}),w.jsx(ph,{componentType:"dialog",isLoading:S,onSubmit:O=>m(O)})]})})})}):null},Mw=()=>{const{globalClassName:e,themeVariables:t,messageAlignment:n}=ft(),{mode:r,status:s,isModalFullscreen:a}=Vr(),{loading:u,isAgentTyping:l,sendMessage:d,resetConversation:f,progressSteps:m,downloadTranscript:p}=Cn(),{isOpen:b}=s||{},y=!!s.isOpen,_=r==="standalone",x=l||u,A=({open:C})=>{$r(C)},S=()=>{$r(!1)};return y?w.jsx(Bb,{lazyMount:!0,unmountOnExit:!0,open:y,onOpenChange:A,children:w.jsx(Lw,{children:w.jsxs("div",{className:B(e,`${N}-modal-container`),style:t,children:[w.jsx(Rb,{className:B(e,`${N}-modal-backdrop`)}),w.jsx(ap,{className:B(e,`${N}-container`,`${N}-modal`,{fullscreen:a,standalone:_,embedded:!_}),children:w.jsxs(sp,{className:B(e,`${N}-modal-content`,{standalone:_,embedded:!_}),children:[w.jsx($b,{componentType:"modal",onClearChat:f,onClose:S,onDownloadTranscript:p}),w.jsx(op,{className:B(e,`${N}-message-container`,`container-${n}`,{standalone:_,embedded:!_}),children:w.jsx(vp,{isWidgetStandalone:_,isOpen:b})}),w.jsx(Ap,{steps:m,globalClassName:e}),w.jsx(ph,{componentType:"modal",isLoading:x,onSubmit:C=>d(C)})]})})]})})}):null},zF=()=>{const e=Vr(),{status:{type:t,isMinimized:n}}=e||{status:{}};return n?w.jsx(EC,{}):t==="dialog"?w.jsx(Dw,{}):t==="modal"?w.jsx(Mw,{}):w.jsx(Rw,{})},$F=()=>{const{setIsOpen:e,setIsInline:t,setElementId:n,setEntryType:r,setParams:s}=k8();R.useEffect(()=>{const a=u=>{const{property:l,value:d}=u.detail||{};!l||d===void 0||(l==="isOpen"&&e(d),l==="isInline"&&t(d),l==="elementId"&&n(d),l==="entryType"&&r(d),l==="params"&&s(d))};return w8(a),()=>{_8(a)}},[e,t,n,r,s])},Fw=(e,t,n)=>{n!==void 0?e(t,n):e(t)};function VF({isReady:e,hasError:t,transmit:n}){const r=R.useRef([]),s=R.useRef(e);s.current=e;const a=R.useRef(n);a.current=n;const u=R.useCallback((l,d)=>{s.current?Fw(a.current,l,d):r.current.push({prompt:l,options:d})},[]);return R.useEffect(()=>{if(e&&r.current.length){const l=r.current;r.current=[],l.forEach(({prompt:d,options:f})=>Fw(a.current,d,f))}},[e]),R.useEffect(()=>{t&&(r.current=[])},[t]),u}const Bw={copilot:"Ask Copilot",messaging:"Ask a question"},qF=({onSubmit:e,disabled:t=!1})=>{const{globalClassName:n,mode:r}=ft(),{placeholder:s,isResponseLoading:a}=ec(),u=s||Bw[r],[l,d]=R.useState(""),f=t||a,m=p=>{const b=l.trim();b&&(p.preventDefault(),e(b),d(""))};return w.jsxs("form",{className:B(n,`${N}-prompts-input-container`),name:`${N}-prompts-form`,onSubmit:m,children:[w.jsx("label",{htmlFor:`${N}-prompts-input`,"aria-label":u,children:w.jsx(Kh,{className:B(n,`${N}-prompts-input-icon`)})}),w.jsx("input",{id:`${N}-prompts-input`,className:B(n,`${N}-prompts-input`),name:`${N}-prompts-input`,placeholder:u,type:"text",disabled:f,value:l,onChange:p=>d(p.target.value)}),w.jsx(lr,{className:B(n,`${N}-prompts-input-submit-button`),type:"submit",ariaLabel:"Submit Prompt",icon:w.jsx(Tf,{}),disabled:f})]})},YF=()=>{const{globalClassName:e,mode:t}=ft(),{placeholder:n}=ec(),r=n||Bw[t];return w.jsxs("div",{className:B(e,`${N}-prompts-header`),children:[w.jsx(Kh,{className:B(e,`${N}-prompts-input-icon`),"aria-hidden":"true"}),w.jsx("span",{className:B(e,`${N}-prompts-header-text`),children:r})]})},Uw=({label:e,disabled:t=!1,onClick:n})=>{var l;const{globalClassName:r,suggestionButtonConfig:s}=ft(),a=s==null?void 0:s.icon,u=(l=s==null?void 0:s.iconPosition)!=null?l:"left";return w.jsxs("button",{className:B(r,`${N}-prompts-button`,{"has-icon":!!a,"icon-right":!!a&&u==="right"}),disabled:t,onClick:n,children:[a&&w.jsx(qb,{icon:a,className:`${N}-suggestion-button-icon`}),w.jsx("span",{children:e})]})},WF="Ask me something else",GF=({label:e,disabled:t=!1})=>w.jsx(Uw,{label:e||WF,disabled:t,onClick:()=>$r(!0)}),XF=({onPromptClick:e,disabled:t=!1})=>{const{globalClassName:n}=ft(),{staticQuestions:r,askElseButtonLabel:s,disableAskElseButton:a}=ec();if(!(r!=null&&r.length))return null;const u=l=>()=>{const d=l.trim();d&&e(d)};return w.jsxs("div",{className:B(n,`${N}-prompts-button-group`),children:[r.map(l=>w.jsx(Uw,{label:l,disabled:t,onClick:u(l)},l)),!a&&w.jsx(GF,{label:s,disabled:t})]})},KF=()=>{const{globalClassName:e,themeVariables:t}=ft(),{isOpen:n,elementId:r,promptsDisplay:s}=ec(),{isConnected:a,sessionExpired:u,sendMessage:l,connectionStatus:d}=Cn(),{productId:f}=A8(),m=s!=="buttons",p=s!=="input",[b,y]=R.useState(null),_=d==="error",x=d==="connecting",A=Hg(a,u),S=VF({isReady:A,hasError:_,transmit:l});R.useEffect(()=>{if(!r||b)return;const O=document.getElementById(r);O&&y(O)},[r,b]);const C=R.useCallback(O=>{if($r(!0),f){S(`${O} (Viewing product details for: ${f})`,{displayContent:O});return}S(O)},[S,f]);return!n||!b?null:Vs.createPortal(w.jsxs("div",{className:B(e,`${N}-prompts-extension-container`),style:t,children:[m&&w.jsx(qF,{onSubmit:C,disabled:_}),!m&&w.jsx(YF,{}),p&&w.jsx(XF,{onPromptClick:C,disabled:_}),!_&&x&&w.jsx("p",{className:B(e,`${N}-prompts-connecting-message`),children:"Connecting to agent..."}),_&&w.jsx("p",{className:B(e,`${N}-prompts-error-message`),children:"Oops, an error occurred with our agent."})]}),b)},QF=()=>($F(),w.jsx(KF,{})),Hw=e=>w.jsxs(s1,ce(j({},e),{children:[w.jsx(zF,{}),w.jsx(QF,{})]}));var ac={},jw;function JF(){if(jw)return ac;jw=1;var e=c1();return ac.createRoot=e.createRoot,ac.hydrateRoot=e.hydrateRoot,ac}var ZF=JF();const zw=(e,t,n,r)=>{ZF.createRoot(e).render(w.jsx(Hw,ce(j({},t),{overridesUrl:n,inlineOverrides:r,mode:"messaging"})))},eB=a=>{var u=a,{elementId:e,timeout:t=5e3,overridesUrl:n,inlineOverrides:r}=u,s=Sn(u,["elementId","timeout","overridesUrl","inlineOverrides"]);let l;const d=(m,p)=>{for(const b of m)if(b.type==="childList"&&b.addedNodes.length)for(const y of b.addedNodes)y.nodeType===Node.ELEMENT_NODE&&y.id===e&&(St(!0,"log","Target element found, rendering Messaging Widget"),p.disconnect(),clearTimeout(l),zw(y,s,n,r))},f=new MutationObserver(d);return f.observe(document.body,{childList:!0,subtree:!0}),l=setTimeout(()=>{f.disconnect(),St(!0,"error",`Element with id: ${e} not found within ${t} milliseconds, stopping observation`)},t),f},tB=a=>{var u=a,{timeout:e,elementId:t,overridesUrl:n,overrides:r}=u,s=Sn(u,["timeout","elementId","overridesUrl","overrides"]);if(!s.messagingConfig){St(!0,"error","Messaging Widget requires messagingConfig");return}if(!s.messagingConfig.scrt2Url||!s.messagingConfig.orgId||!s.messagingConfig.esDeveloperName){St(!0,"error","Messaging Widget requires messagingConfig.scrt2Url, messagingConfig.orgId, and messagingConfig.esDeveloperName");return}const l=document.getElementById(t);if(!l){St(!0,"warn","Container element not found for id:",t),St(!0,"warn","Beginning observation for element"),eB(j({elementId:t,timeout:e,overridesUrl:n,inlineOverrides:r},s));return}zw(l,s,n,r)};class nB extends HTMLElement{constructor(){super(...arguments);Qe(this,"_props",null)}set props(n){this._props=n,this.render()}get props(){return this._props}connectedCallback(){this.render()}render(){}}const rB={components:{setEntryType:H0,toggleWidgetOpen:$r,toggleWidgetMinimized:Ms,toggleModalFullscreen:Md,setWidgetType:Mu,setWidgetDialogPosition:Fd,loadPromptsComponent:v8,togglePromptsExtensionOpen:zb}};function iB(){return Be(this,null,function*(){return Dk().getAuthLinkKey()})}He.AgentForceWidget=Hw,He.AgentforceWidgetProvider=s1,He.CIMULATE_WIDGET_READY_EVENT=B0,He.MessagingDialog=Dw,He.MessagingEmbed=Rw,He.MessagingModal=Mw,He.MessagingProvider=$g,He.OverrideElement=nB,He.eventHandlers=rB,He.getAuthLinkKey=iB,He.injectMessagingWidget=tB,He.useMessaging=Cn,Object.defineProperty(He,Symbol.toStringTag,{value:"Module"})}));
52
+ `))}function d(y,_,x,A){const S=x.enter("tableCell"),C=x.enter("phrasing"),O=x.containerPhrasing(y,ce(j({},A),{before:a,after:a}));return C(),S(),O}function f(y,_){return SM(y,{align:_,alignDelimiters:r,padding:n,stringLength:s})}function m(y,_,x){const A=y.children;let S=-1;const C=[],O=_.enter("table");for(;++S<A.length;)C[S]=p(A[S],_,x);return O(),C}function p(y,_,x){const A=y.children;let S=-1;const C=[],O=_.enter("tableRow");for(;++S<A.length;)C[S]=d(A[S],y,_,x);return O(),C}function b(y,_,x){let A=dw.inlineCode(y,_,x);return x.stack.includes("tableCell")&&(A=A.replace(/\|/g,"\\$&")),A}}function d9(){return{exit:{taskListCheckValueChecked:hw,taskListCheckValueUnchecked:hw,paragraph:h9}}}function f9(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:p9}}}function hw(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function h9(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let a=-1,u;for(;++a<s.length;){const l=s[a];if(l.type==="paragraph"){u=l;break}}u===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function p9(e,t,n,r){const s=e.children[0],a=typeof e.checked=="boolean"&&s&&s.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);a&&l.move(u);let d=dw.listItem(e,t,n,j(j({},r),l.current()));return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),d;function f(m){return m+u}}function m9(){return[W8(),pM(),yM(),i9(),d9()]}function g9(e){return{extensions:[G8(),mM(e),TM(),c9(e),f9()]}}const E9={tokenize:x9,partial:!0},pw={tokenize:S9,partial:!0},mw={tokenize:v9,partial:!0},gw={tokenize:A9,partial:!0},y9={tokenize:k9,partial:!0},Ew={name:"wwwAutolink",tokenize:w9,previous:Tw},yw={name:"protocolAutolink",tokenize:_9,previous:bw},Qr={name:"emailAutolink",tokenize:b9,previous:ww},Dr={};function T9(){return{text:Dr}}let ms=48;for(;ms<123;)Dr[ms]=Qr,ms++,ms===58?ms=65:ms===91&&(ms=97);Dr[43]=Qr,Dr[45]=Qr,Dr[46]=Qr,Dr[95]=Qr,Dr[72]=[Qr,yw],Dr[104]=[Qr,yw],Dr[87]=[Qr,Ew],Dr[119]=[Qr,Ew];function b9(e,t,n){const r=this;let s,a;return u;function u(p){return!Tp(p)||!ww.call(r,r.previous)||bp(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(p))}function l(p){return Tp(p)?(e.consume(p),l):p===64?(e.consume(p),d):n(p)}function d(p){return p===46?e.check(y9,m,f)(p):p===45||p===95||dn(p)?(a=!0,e.consume(p),d):m(p)}function f(p){return e.consume(p),s=!0,d}function m(p){return a&&s&&bn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function w9(e,t,n){const r=this;return s;function s(u){return u!==87&&u!==119||!Tw.call(r,r.previous)||bp(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(E9,e.attempt(pw,e.attempt(mw,a),n),n)(u))}function a(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function _9(e,t,n){const r=this;let s="",a=!1;return u;function u(p){return(p===72||p===104)&&bw.call(r,r.previous)&&!bp(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),e.consume(p),l):n(p)}function l(p){if(bn(p)&&s.length<5)return s+=String.fromCodePoint(p),e.consume(p),l;if(p===58){const b=s.toLowerCase();if(b==="http"||b==="https")return e.consume(p),d}return n(p)}function d(p){return p===47?(e.consume(p),a?f:(a=!0,d)):n(p)}function f(p){return p===null||ul(p)||Tt(p)||es(p)||ll(p)?n(p):e.attempt(pw,e.attempt(mw,m),n)(p)}function m(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function x9(e,t,n){let r=0;return s;function s(u){return(u===87||u===119)&&r<3?(r++,e.consume(u),s):u===46&&r===3?(e.consume(u),a):n(u)}function a(u){return u===null?n(u):t(u)}}function S9(e,t,n){let r,s,a;return u;function u(f){return f===46||f===95?e.check(gw,d,l)(f):f===null||Tt(f)||es(f)||f!==45&&ll(f)?d(f):(a=!0,e.consume(f),u)}function l(f){return f===95?r=!0:(s=r,r=void 0),e.consume(f),u}function d(f){return s||r||!a?n(f):t(f)}}function v9(e,t){let n=0,r=0;return s;function s(u){return u===40?(n++,e.consume(u),s):u===41&&r<n?a(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(gw,t,a)(u):u===null||Tt(u)||es(u)?t(u):(e.consume(u),s)}function a(u){return u===41&&r++,e.consume(u),s}}function A9(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),a):l===93?(e.consume(l),s):l===60||l===null||Tt(l)||es(l)?t(l):n(l)}function s(l){return l===null||l===40||l===91||Tt(l)||es(l)?t(l):r(l)}function a(l){return bn(l)?u(l):n(l)}function u(l){return l===59?(e.consume(l),r):bn(l)?(e.consume(l),u):n(l)}}function k9(e,t,n){return r;function r(a){return e.consume(a),s}function s(a){return dn(a)?n(a):t(a)}}function Tw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Tt(e)}function bw(e){return!bn(e)}function ww(e){return!(e===47||Tp(e))}function Tp(e){return e===43||e===45||e===46||e===95||dn(e)}function bp(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const C9={tokenize:M9,partial:!0};function N9(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:R9,continuation:{tokenize:L9},exit:D9}},text:{91:{name:"gfmFootnoteCall",tokenize:P9},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:O9,resolveTo:I9}}}}function O9(e,t,n){const r=this;let s=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u;for(;s--;){const d=r.events[s][1];if(d.type==="labelImage"){u=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return l;function l(d){if(!u||!u._balanced)return n(d);const f=cr(r.sliceSerialize({start:u.end,end:r.now()}));return f.codePointAt(0)!==94||!a.includes(f.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function I9(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",a,t],["enter",u,t],["exit",u,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function P9(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,u;return l;function l(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),d}function d(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(p){if(a>999||p===93&&!u||p===null||p===91||Tt(p))return n(p);if(p===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return s.includes(cr(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return Tt(p)||(u=!0),a++,e.consume(p),p===92?m:f}function m(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function R9(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,u=0,l;return d;function d(_){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(_){return _===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(_)}function m(_){if(u>999||_===93&&!l||_===null||_===91||Tt(_))return n(_);if(_===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return a=cr(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return Tt(_)||(l=!0),u++,e.consume(_),_===92?p:m}function p(_){return _===91||_===92||_===93?(e.consume(_),u++,m):m(_)}function b(_){return _===58?(e.enter("definitionMarker"),e.consume(_),e.exit("definitionMarker"),s.includes(a)||s.push(a),ut(e,y,"gfmFootnoteDefinitionWhitespace")):n(_)}function y(_){return t(_)}}function L9(e,t,n){return e.check(ma,t,e.attempt(C9,t,n))}function D9(e){e.exit("gfmFootnoteDefinition")}function M9(e,t,n){const r=this;return ut(e,s,"gfmFootnoteDefinitionIndent",5);function s(a){const u=r.events[r.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(a):n(a)}}function F9(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(u,l){let d=-1;for(;++d<u.length;)if(u[d][0]==="enter"&&u[d][1].type==="strikethroughSequenceTemporary"&&u[d][1]._close){let f=d;for(;f--;)if(u[f][0]==="exit"&&u[f][1].type==="strikethroughSequenceTemporary"&&u[f][1]._open&&u[d][1].end.offset-u[d][1].start.offset===u[f][1].end.offset-u[f][1].start.offset){u[d][1].type="strikethroughSequence",u[f][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},u[f][1].start),end:Object.assign({},u[d][1].end)},p={type:"strikethroughText",start:Object.assign({},u[f][1].end),end:Object.assign({},u[d][1].start)},b=[["enter",m,l],["enter",u[f][1],l],["exit",u[f][1],l],["enter",p,l]],y=l.parser.constructs.insideSpan.null;y&&$n(b,b.length,0,cl(y,u.slice(f+1,d),l)),$n(b,b.length,0,[["exit",p,l],["enter",u[d][1],l],["exit",u[d][1],l],["exit",m,l]]),$n(u,f-1,d-f+3,b),d=f+b.length-2;break}}for(d=-1;++d<u.length;)u[d][1].type==="strikethroughSequenceTemporary"&&(u[d][1].type="data");return u}function a(u,l,d){const f=this.previous,m=this.events;let p=0;return b;function b(_){return f===126&&m[m.length-1][1].type!=="characterEscape"?d(_):(u.enter("strikethroughSequenceTemporary"),y(_))}function y(_){const x=Gs(f);if(_===126)return p>1?d(_):(u.consume(_),p++,y);if(p<2&&!n)return d(_);const A=u.exit("strikethroughSequenceTemporary"),S=Gs(_);return A._open=!S||S===2&&!!x,A._close=!x||x===2&&!!S,l(_)}}}class B9{constructor(){this.map=[]}add(t,n,r){U9(this,t,n,r)}consume(t){if(this.map.sort(function(a,u){return a[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const a of s)t.push(a);s=r.pop()}this.map.length=0}}function U9(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function H9(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function j9(){return{flow:{null:{name:"table",tokenize:z9,resolveAll:$9}}}}function z9(e,t,n){const r=this;let s=0,a=0,u;return l;function l(H){let ie=r.events.length-1;for(;ie>-1;){const fe=r.events[ie][1].type;if(fe==="lineEnding"||fe==="linePrefix")ie--;else break}const te=ie>-1?r.events[ie][1].type:null,le=te==="tableHead"||te==="tableRow"?M:d;return le===M&&r.parser.lazy[r.now().line]?n(H):le(H)}function d(H){return e.enter("tableHead"),e.enter("tableRow"),f(H)}function f(H){return H===124||(u=!0,a+=1),m(H)}function m(H){return H===null?n(H):Ve(H)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),y):n(H):st(H)?ut(e,m,"whitespace")(H):(a+=1,u&&(u=!1,s+=1),H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),u=!0,m):(e.enter("data"),p(H)))}function p(H){return H===null||H===124||Tt(H)?(e.exit("data"),m(H)):(e.consume(H),H===92?b:p)}function b(H){return H===92||H===124?(e.consume(H),p):p(H)}function y(H){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(H):(e.enter("tableDelimiterRow"),u=!1,st(H)?ut(e,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):_(H))}function _(H){return H===45||H===58?A(H):H===124?(u=!0,e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),x):G(H)}function x(H){return st(H)?ut(e,A,"whitespace")(H):A(H)}function A(H){return H===58?(a+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),S):H===45?(a+=1,S(H)):H===null||Ve(H)?z(H):G(H)}function S(H){return H===45?(e.enter("tableDelimiterFiller"),C(H)):G(H)}function C(H){return H===45?(e.consume(H),C):H===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O(H))}function O(H){return st(H)?ut(e,z,"whitespace")(H):z(H)}function z(H){return H===124?_(H):H===null||Ve(H)?!u||s!==a?G(H):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(H)):G(H)}function G(H){return n(H)}function M(H){return e.enter("tableRow"),V(H)}function V(H){return H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),V):H===null||Ve(H)?(e.exit("tableRow"),t(H)):st(H)?ut(e,V,"whitespace")(H):(e.enter("data"),J(H))}function J(H){return H===null||H===124||Tt(H)?(e.exit("data"),V(H)):(e.consume(H),H===92?se:J)}function se(H){return H===92||H===124?(e.consume(H),J):J(H)}}function $9(e,t){let n=-1,r=!0,s=0,a=[0,0,0,0],u=[0,0,0,0],l=!1,d=0,f,m,p;const b=new B9;for(;++n<e.length;){const y=e[n],_=y[1];y[0]==="enter"?_.type==="tableHead"?(l=!1,d!==0&&(_w(b,t,d,f,m),m=void 0,d=0),f={type:"table",start:Object.assign({},_.start),end:Object.assign({},_.end)},b.add(n,0,[["enter",f,t]])):_.type==="tableRow"||_.type==="tableDelimiterRow"?(r=!0,p=void 0,a=[0,0,0,0],u=[0,n+1,0,0],l&&(l=!1,m={type:"tableBody",start:Object.assign({},_.start),end:Object.assign({},_.end)},b.add(n,0,[["enter",m,t]])),s=_.type==="tableDelimiterRow"?2:m?3:1):s&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")?(r=!1,u[2]===0&&(a[1]!==0&&(u[0]=u[1],p=rc(b,t,a,s,void 0,p),a=[0,0,0,0]),u[2]=n)):_.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(u[0]=u[1],p=rc(b,t,a,s,void 0,p)),a=u,u=[a[1],n,0,0])):_.type==="tableHead"?(l=!0,d=n):_.type==="tableRow"||_.type==="tableDelimiterRow"?(d=n,a[1]!==0?(u[0]=u[1],p=rc(b,t,a,s,n,p)):u[1]!==0&&(p=rc(b,t,u,s,n,p)),s=0):s&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")&&(u[3]=n)}for(d!==0&&_w(b,t,d,f,m),b.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=H9(t.events,n))}return e}function rc(e,t,n,r,s,a){const u=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(a.end=Object.assign({},bo(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=bo(t.events,n[1]);if(a={type:u,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const f=bo(t.events,n[2]),m=bo(t.events,n[3]),p={type:l,start:Object.assign({},f),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const b=t.events[n[2]],y=t.events[n[3]];if(b[1].end=Object.assign({},y[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const _=n[2]+1,x=n[3]-n[2]-1;e.add(_,x,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return s!==void 0&&(a.end=Object.assign({},bo(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function _w(e,t,n,r,s){const a=[],u=bo(t.events,n);s&&(s.end=Object.assign({},u),a.push(["exit",s,t])),r.end=Object.assign({},u),a.push(["exit",r,t]),e.add(n+1,0,a)}function bo(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const V9={name:"tasklistCheck",tokenize:Y9};function q9(){return{text:{91:V9}}}function Y9(e,t,n){const r=this;return s;function s(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),a)}function a(d){return Tt(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),u):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),u):n(d)}function u(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(d)}function l(d){return Ve(d)?t(d):st(d)?e.check({tokenize:W9},t,n)(d):n(d)}}function W9(e,t,n){return ut(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function G9(e){return Q1([T9(),N9(),F9(e),j9(),q9()])}const X9={};function K9(e){const t=this,n=e||X9,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(G9(n)),a.push(m9()),u.push(g9(n))}const Q9=()=>w.jsx("span",{className:`${N}-blinking-cursor`,children:w.jsx("svg",{height:"16px",width:"16px",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("circle",{r:"0.45rem",cx:"0.5rem",cy:"0.55rem",fill:"black"})})}),wo=({globalClassName:e,openLinksInNewTab:t,showIsLoading:n,text:r})=>w.jsx(zE,{remarkPlugins:[K9],rehypePlugins:[$y],components:{h1:({children:s})=>w.jsx("h1",{className:B(e,`${N}-header h1`),children:s}),h2:({children:s})=>w.jsx("h2",{className:B(e,`${N}-header h2`),children:s}),h3:({children:s})=>w.jsx("h3",{className:B(e,`${N}-header h3`),children:s}),ul:({children:s})=>w.jsx("ul",{className:B(e,`${N}-ul`),children:s}),ol:({children:s})=>w.jsx("ol",{className:B(e,`${N}-ol`),children:s}),li:({children:s})=>w.jsx("li",{className:B(e,`${N}-li`),children:s}),a:({href:s,children:a})=>w.jsx(Ky,{globalClassName:e,openLinksInNewTab:t,href:s,children:a}),table:({children:s})=>w.jsx("div",{className:B(e,`${N}-table-container`),children:w.jsx("table",{className:B(e,`${N}-table`),children:s})}),thead:({children:s})=>w.jsx("thead",{className:B(e,`${N}-thead`),children:s}),tbody:({children:s})=>w.jsx("tbody",{className:B(e,`${N}-tbody`),children:s}),tr:({children:s})=>w.jsx("tr",{className:B(e,`${N}-tr`),children:s}),th:({children:s})=>w.jsx("th",{className:B(e,`${N}-th`),children:s}),td:({children:s})=>w.jsx("td",{className:B(e,`${N}-td`),children:s}),span:({className:s,children:a})=>s===`${N}-blinking-cursor`?w.jsx(Q9,{}):w.jsx("span",{children:a})},children:r+(n?`<span className='${N}-blinking-cursor'></span>`:"")}),_o=()=>R.useContext(i1),xo=()=>{const{sendMessage:e,loading:t,isConnected:n}=Cn(),{mode:r,status:s}=Vr();return R.useMemo(()=>({sendMessage:e,isLoading:t,isConnected:n,componentType:s.type,mode:r}),[e,t,n,s.type,r])};function J9(e){return e.includes("-")&&e===e.toLowerCase()}function So({tagName:e,props:t,label:n}){const r=R.useRef(null),s=R.useRef(null),a=R.useRef(e),u=R.useRef(null);return R.useEffect(()=>{const l=r.current;if(!l)return;if(a.current!==e&&(a.current=e,s.current=null),!J9(e)){u.current!==e&&(u.current=e,St(!0,"error",`[CimulateOverrides] ${n||"Override"} rejected: "${e}" is not a valid custom element name (must contain a hyphen and be lowercase, e.g. "product-card").`)),s.current=null,l.replaceChildren();return}const d=s.current;if(d&&d.isConnected)try{d.props=t;return}catch(f){St(!0,"error",`[CimulateOverrides] ${n||"Override"} threw an error during props update:`,f),s.current=null,l.replaceChildren();return}try{const f=document.createElement(e);f.props=t,l.replaceChildren(f);const m=f.localName;s.current=typeof customElements!="undefined"&&customElements.get(m)?f:null}catch(f){St(!0,"error",`[CimulateOverrides] ${n||"Override"} threw an error:`,f),s.current=null,l.replaceChildren()}},[e,t,n]),R.useEffect(()=>{const l=r.current;return()=>{s.current=null,l==null||l.replaceChildren()}},[]),w.jsx("div",{ref:r,"data-override":n||"custom"})}class Z9 extends R.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){St(!0,"error",`Override "${this.props.overrideName}" threw during render:`,t,n.componentStack)}render(){return this.state.hasError?null:this.props.children}}function eF(e){return ht({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Image_Off"},child:[{tag:"path",attr:{d:"M19.937,14.218l0,-8.654c0,-0.829 -0.672,-1.5 -1.5,-1.5l-10.628,-0c-0.276,-0 -0.5,-0.225 -0.5,-0.5c0,-0.276 0.224,-0.5 0.5,-0.5l10.628,-0c1.38,-0 2.5,1.118 2.5,2.5l0,10.624c0,0.276 -0.224,0.5 -0.5,0.501c-0.276,-0 -0.5,-0.225 -0.5,-0.5l0,-0.556l-4.583,-4.584c-0.456,-0.456 0.251,-1.163 0.707,-0.707c0.162,0.162 2.37,2.37 3.876,3.876Zm-0.121,6.304c-0.395,0.262 -0.869,0.415 -1.379,0.415l-12.874,-0c-1.381,-0 -2.5,-1.119 -2.5,-2.5l0,-12.873c0,-0.51 0.153,-0.984 0.414,-1.38l-0.263,-0.263c-0.456,-0.456 0.251,-1.163 0.707,-0.707c0.088,0.088 0.176,0.176 0.263,0.263c0.245,0.245 16.095,16.094 16.339,16.338l0.263,0.263c0.455,0.456 -0.252,1.163 -0.707,0.707c-0.088,-0.087 -0.175,-0.175 -0.263,-0.263Zm-11.104,-11.103l-2.001,-2.001c-0.094,0.196 -0.146,0.415 -0.146,0.647c-0,0.829 0.672,1.5 1.5,1.5c0.232,-0 0.451,-0.052 0.647,-0.146Zm-2.733,-2.733l-1.77,-1.77c-0.093,0.196 -0.146,0.416 -0.146,0.648l0,10.717l1.926,-1.926c0.587,-0.586 1.536,-0.586 2.122,-0l0.555,0.554c0.195,0.196 0.511,0.196 0.706,0l2.415,-2.415l-2.343,-2.343c-0.395,0.262 -0.869,0.414 -1.379,0.414c-1.38,-0 -2.5,-1.119 -2.5,-2.5c-0,-0.509 0.152,-0.983 0.414,-1.379Zm-1.916,11.009l0,0.741c0,0.829 0.671,1.5 1.5,1.5l12.874,0c0.232,0 0.451,-0.052 0.647,-0.145c-0.165,-0.165 -3.264,-3.263 -6.59,-6.59l-2.414,2.415c-0.585,0.586 -1.537,0.586 -2.122,0l-0.554,-0.554c-0.195,-0.196 -0.512,-0.196 -0.708,0l-2.633,2.633Z"},child:[]}]}]})(e)}const tF="(max-width: 576px)";function nF(e){return e?!e.defaultPrevented&&e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey:!0}function ic({event:e,openLinksInNewTab:t,isCartMgmtSupported:n=!1}={}){n||t||nF(e)&&typeof window!="undefined"&&window.matchMedia(tF).matches&&(Ms(!0),BS())}const rF=({imageUrl:e,globalClassName:t,isCartMgmtSupported:n,productPageUrl:r,openLinksInNewTab:s,ariaLabel:a,name:u,showInWidgetDetails:l})=>{const{loading:d}=Cn();return w.jsx("div",{className:B(t,`${N}-msg-product-card__image-wrapper`),children:e?n?w.jsx("button",{type:"button",className:B(t,`${N}-msg-product-card__image-button`),onClick:l,disabled:d,"aria-label":a,children:w.jsx("img",{className:B(t,`${N}-msg-product-card__image`),src:e,alt:u||"Product image",loading:"lazy"})}):r?w.jsx("a",{href:r,target:s?"_blank":"_self",rel:"noopener","aria-label":a,onClick:f=>ic({event:f,openLinksInNewTab:s,isCartMgmtSupported:n}),children:w.jsx("img",{className:B(t,`${N}-msg-product-card__image`),src:e,alt:u||"Product image",loading:"lazy"})}):w.jsx("img",{className:B(t,`${N}-msg-product-card__image`),src:e,alt:u||"Product image",loading:"lazy"}):w.jsx("div",{className:B(t,`${N}-msg-product-card__image-placeholder`),"aria-label":u?`No image for ${u}`:"No product image",role:"img",children:w.jsx(eF,{"aria-hidden":"true"})})})},iF=({name:e,globalClassName:t,isCartMgmtSupported:n,productPageUrl:r,openLinksInNewTab:s,ariaLabel:a,showInWidgetDetails:u})=>{const{loading:l}=Cn();return n?w.jsx("button",{type:"button",disabled:l,onClick:u,className:B(t,`${N}-msg-product-card__title-link`),"aria-label":a,children:e}):r?w.jsx("a",{href:r,target:s?"_blank":"_self",rel:"noopener",className:B(t,`${N}-msg-product-card__title-link`),"aria-label":a,onClick:d=>ic({event:d,openLinksInNewTab:s,isCartMgmtSupported:n}),children:e}):w.jsx("p",{className:B(t,`${N}-msg-product-card__title`),children:e})},sF=({product:e,globalClassName:t,openLinksInNewTab:n,isCartMgmtSupported:r=!1,rawProduct:s})=>{const{showProductDescription:a}=ft(),{overrides:u,isInitialized:l}=_o(),{sendMessage:d,loading:f}=Cn(),m=xo(),p=l?u.ProductTile:void 0;if(p){const H={name:"ProductTile",payload:s!=null?s:{},api:m};return w.jsx(So,{tagName:p,props:H,label:"ProductTile"})}const{id:b,name:y,imageUrl:_,description:x,productPageUrl:A,price:S,priceBreakdown:C,discountPrice:O,listPrice:z,currencyCode:G}=e,M=O!=null?O:S,V=P8({priceBreakdown:C,currencyCode:G}),J=()=>{if(f)return;const H=y||"this product",ie=b?` [SKU: ${b}]`:"";d(`Show me details for ${H}${ie}`)},se=r?`View details for ${y}`:`Go to product page for ${y}`;return w.jsxs("div",{className:B(t,`${N}-msg-product-card`),children:[w.jsx(rF,{imageUrl:_||"",globalClassName:t,isCartMgmtSupported:r,productPageUrl:A,openLinksInNewTab:n,ariaLabel:se,name:y,showInWidgetDetails:J}),w.jsxs("div",{className:B(t,`${N}-msg-product-card__content`),children:[w.jsxs("div",{className:B(t,`${N}-msg-product-card__content-header`),children:[w.jsx(iF,{name:y||b,globalClassName:t,isCartMgmtSupported:r,productPageUrl:A,openLinksInNewTab:n,ariaLabel:se,showInWidgetDetails:J}),a&&x&&w.jsx("div",{className:B(t,`${N}-msg-product-card__description`),title:x,children:w.jsx(wo,{globalClassName:t,text:x})})]}),w.jsx("div",{className:B(t,`${N}-msg-product-card__price-row`),children:V?w.jsx("span",{className:B(t,`${N}-msg-product-card__price`),"aria-label":`Price from ${V.low} to ${V.high}`,children:V.range}):w.jsx(dp,{globalClassName:t,retailPrice:z,discountPrice:M,currencyCode:G})})]})]})},oF=e=>{var t,n;return{id:e.id,name:e.data.name,label:e.caption,description:e.data.description,imageUrl:e.data.imageUrl,productPageUrl:e.data.productPageUrl,price:e.data.price,discountPrice:e.data.discountPrice,listPrice:(t=e.data.listPrice)!=null?t:void 0,priceBreakdown:(n=e.data.priceBreakdown)!=null?n:void 0,currencyCode:e.data.currencyCode}},aF=({title:e,products:t,globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s,isCartMgmtSupported:a=!1})=>{const{showProductCaptions:u}=ft(),{overrides:l,isInitialized:d}=_o(),f=xo(),m=d?l.ProductCarousel:void 0;if(m){const p={name:"ProductCarousel",payload:{title:e,products:t},api:f};return w.jsx(So,{tagName:m,props:p,label:"ProductCarousel"})}return w.jsxs("div",{style:{marginBottom:"1rem"},children:[e&&w.jsx("p",{className:B(n,`${N}-product-carousel-title`),children:e}),w.jsx(e8,{globalClassName:n,spacing:s?"0.5rem":"6px",ariaLabel:e||"Product recommendations",children:t.map(p=>w.jsxs("div",{className:B(n,`${N}-product-carousel-item`),children:[w.jsx(sF,{product:oF(p),rawProduct:p,globalClassName:n,openLinksInNewTab:r,isCartMgmtSupported:a}),u&&w.jsx("p",{className:B(n,`${N}-product-carousel-caption`),title:p.caption,children:p.caption})]},p.id))})]})},wp=44,uF=400,lF=e=>{const t=typeof e=="number"?e:Number(e);return!Number.isFinite(t)||t<=0?wp:Math.min(Math.max(Math.round(t),wp),uF)},cF=e=>{try{return new URL(e,window.location.href).origin}catch(t){return null}},dF="parentOrigin",fF=(e,t)=>{if(!t)return e;try{const n=new URL(e,window.location.href);return n.searchParams.set(dF,t),n.toString()}catch(n){return e}},hF=(e,t,n)=>{if(!e||!t)return null;try{const r=new URL(e,window.location.href);return r.origin!==window.location.origin||!/\/Payments-Express\/?$/.test(r.pathname)?null:(r.pathname=r.pathname.replace(/\/Payments-Express\/?$/,"/Payments-ExpressProduct"),r.searchParams.set("pid",t),r.searchParams.set("quantity",String(n)),r.toString())}catch(r){return null}},xw=({expressPaymentUrl:e,globalClassName:t,onOrderComplete:n})=>{const r=R.useRef(null),[s,a]=R.useState(!1),[u,l]=R.useState(wp),d=typeof window!="undefined"?window.location.origin:"",f=fF(e,d),m=cF(e);return R.useEffect(()=>{const p=b=>{var _,x,A;if(m&&b.origin!==m||r.current&&b.source!==r.current.contentWindow)return;const y=b.data;if(!(!y||typeof y.type!="string"))switch(y.type){case"express.payment.available":a(!0),l(lF((_=y.payload)==null?void 0:_.height));break;case"express.payment.unavailable":a(!1);break;case"express.payment.success":n==null||n((A=(x=y.payload)==null?void 0:x.orderId)!=null?A:null);break}};return window.addEventListener("message",p),()=>window.removeEventListener("message",p)},[m,n]),w.jsx("div",{className:B(t,`${N}-cart-express`,{[`${N}-cart-express-ready`]:s}),style:s?{height:u}:void 0,"data-testid":"express-payment","aria-hidden":!s,children:w.jsx("iframe",{ref:r,className:B(t,`${N}-cart-express-frame`),src:f,title:"Express payment",allow:"payment *",scrolling:"no"})})},sc=({code:e,globalClassName:t,inactive:n})=>w.jsxs("span",{className:B(t,`${N}-cart-chip`,{inactive:n}),title:n?"Not applied":void 0,children:[w.jsx(T1,{"aria-hidden":"true"}),w.jsx("span",{children:e})]}),Rn=({label:e,badge:t,value:n,currencyCode:r,globalClassName:s,emphasized:a,isDiscount:u,fallback:l,loading:d})=>{let f;if(typeof n=="number")n===0&&!u?f="Free":f=Kr(u?-Math.abs(n):n,r);else if(l)f=l;else return null;return w.jsxs("div",{className:B(s,`${N}-cart-total-row`,{emphasized:a}),children:[w.jsxs("span",{className:B(s,`${N}-cart-total-label`),children:[e,t&&w.jsx("span",{className:B(s,`${N}-cart-total-badge`),children:t})]}),w.jsx("span",{className:B(s,`${N}-cart-total-value`),children:d?w.jsx("span",{className:B(s,`${N}-cart-total-shimmer`)}):f})]})};function Sw(e){var a;const n=((a=e.variants)!=null?a:[]).filter(u=>u.value).map(u=>`${u.lbl}: ${u.value}`).join(", "),r=n?` (${n})`:"",s=e.productId?` [SKU: ${e.productId}]`:"";return`${e.name}${r}${s}`}function vw(e){var r;const n=((r=e.variants)!=null?r:[]).filter(s=>s.value).map(s=>s.value).join(", ");return n?`${e.name} (${n})`:e.name}function _p(e){return typeof e=="string"?e:e&&typeof e.code=="string"?e.code:null}function xp(e){return(e!=null?e:[]).map(_p).filter(t=>t!==null)}function Aw(e){return e&&typeof e=="object"&&typeof e.status=="string"?e.status:void 0}function pF(e,t){var s;const n=new Map;for(const a of t!=null?t:[]){const u=_p(a),l=Aw(a);u!==null&&l!==void 0&&n.set(u.toLowerCase(),l)}const r=[];for(const a of e!=null?e:[]){const u=_p(a);if(u===null)continue;const l=(s=Aw(a))!=null?s:n.get(u.toLowerCase());r.push({code:u,applied:l==null||l==="applied"})}return r}function kw(e,t,n){const r=new Set((e!=null?e:[]).flatMap(s=>xp(s.coupons)).map(s=>s.toLowerCase()));return pF(t,n).filter(s=>!r.has(s.code.toLowerCase()))}const mF=({quantity:e,loading:t,disabled:n,globalClassName:r,onChange:s})=>{const[a,u]=R.useState(e.toString());R.useEffect(()=>{u(e.toString())},[e]);const l=m=>{if(n)return;const p=m.target.value;/^\d*$/.test(p)&&u(p)},d=()=>{const m=parseInt(a,10);!n&&!isNaN(m)&&m>0&&m!==e?s(m):u(e.toString())},f=m=>{m.key==="Enter"&&(m.preventDefault(),d())};return w.jsx("div",{className:B(r,`${N}-cart-qty-input-wrapper`),children:t?w.jsx(bC,{className:B(r,`${N}-cart-qty-spinner`),"aria-hidden":"true"}):w.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:B(r,`${N}-cart-qty-input`),value:a,disabled:n,onChange:l,onBlur:d,onKeyDown:f,"aria-label":"Quantity"})})},gF=({item:e,currencyCode:t,loading:n,disabled:r,globalClassName:s,onRemove:a,onQuantityChange:u})=>{var f,m;const l=typeof e.originalSubtotal=="number"&&typeof e.itemSubtotal=="number"&&e.originalSubtotal>e.itemSubtotal,d=xp(e.coupons);return w.jsxs("li",{className:B(s,`${N}-cart-item`),children:[e.imageUrl&&w.jsx("div",{className:B(s,`${N}-cart-item-image`),children:w.jsx("img",{src:e.imageUrl,alt:e.name||"Product image",loading:"lazy"})}),w.jsxs("div",{className:B(s,`${N}-cart-item-details`),children:[w.jsx("p",{className:B(s,`${N}-cart-item-name`),children:e.name}),w.jsxs("div",{className:B(s,`${N}-cart-item-attrs`),children:[((f=e.variants)!=null?f:[]).map(p=>w.jsxs("p",{className:B(s,`${N}-cart-item-attr`),children:[p.lbl,": ",p.value]},`${p.type}-${p.value}`)),((m=e.promotions)!=null?m:[]).map(p=>w.jsxs("p",{className:B(s,`${N}-cart-item-attr`),children:["Promotion: ",p]},p))]}),d.length>0&&w.jsx("div",{className:B(s,`${N}-cart-chips`),children:d.map(p=>w.jsx(sc,{code:p,globalClassName:s},p))}),w.jsx("span",{className:B(s,`${N}-cart-item-price`),children:n?w.jsx("span",{className:B(s,`${N}-cart-total-shimmer`)}):w.jsxs(w.Fragment,{children:[l&&w.jsx("span",{className:B(s,`${N}-cart-item-original-price`),children:Kr(e.originalSubtotal,t)}),w.jsx("span",{className:B(s,`${N}-cart-item-final-price`),children:Kr(e.itemSubtotal,t)})]})}),w.jsxs("div",{className:B(s,`${N}-cart-item-footer`),children:[w.jsx("span",{className:B(s,`${N}-cart-qty-heading`),children:"Quantity"}),w.jsx(mF,{quantity:e.quantity,loading:n,disabled:r,globalClassName:s,onChange:p=>u(e,p)}),w.jsx("button",{type:"button",className:B(s,`${N}-cart-item-remove`),disabled:r,onClick:()=>a(e),children:"Remove"})]})]})]})},EF=({cart:e,messageId:t,globalClassName:n,openLinksInNewTab:r})=>{const{sendMessage:s,loading:a,cartUpdating:u}=Cn(),[l,d]=R.useState(!1),[f,m]=R.useState(""),[p,b]=R.useState(null),y=a||u,{items:_=[],currencyCode:x="USD",subtotal:A,total:S,taxes:C,shippingCost:O,shippingDiscount:z,shippingPromotions:G=[],promotionsDiscount:M,promotions:V=[],couponsDiscount:J,bodyMessage:se,footerMessage:H,checkoutButtonUrl:ie,expressPaymentUrl:te}=e,le=kw(_,e.couponsApplied,e.coupons),fe=W=>{y||s(`Remove ${Sw(W)} from my cart`,{displayContent:`Remove ${vw(W)} from cart`})},ue=W=>{s(W?`I completed express payment. Show my order confirmation for order ${W}.`:"I completed express payment. Show my order confirmation.")},Se=(W,oe)=>{y||p||oe<1||(b(W.itemId),s(`Update ${Sw(W)} quantity to ${oe}`,{silent:!0,reconcileMessageId:t,displayContent:`Update ${vw(W)} to qty ${oe}`}).then(k=>{k.outcome==="success"?setTimeout(()=>b(null),300):b(null)}))},de=()=>{const W=f.trim();!W||y||(s(`Apply coupon code ${W}`),m(""))};return w.jsxs("div",{className:B(n,`${N}-cart`),children:[w.jsxs("div",{className:B(n,`${N}-cart-box`),children:[se&&w.jsxs("button",{type:"button",className:B(n,`${N}-cart-summary`),"aria-expanded":l,onClick:()=>d(W=>!W),children:[w.jsx("span",{className:B(n,`${N}-cart-summary-text`),children:w.jsx(wo,{text:se,globalClassName:n,openLinksInNewTab:r,showIsLoading:!1})}),w.jsx("span",{className:B(n,`${N}-cart-summary-toggle`),"aria-hidden":"true",children:l?w.jsx(E1,{}):w.jsx(y1,{})})]}),l&&w.jsxs("div",{className:B(n,`${N}-cart-expanded`),children:[w.jsxs("div",{className:B(n,`${N}-cart-items-section`),children:[w.jsx("ul",{className:B(n,`${N}-cart-items`),children:_.map(W=>w.jsx(gF,{item:W,currencyCode:x,loading:p===W.itemId,disabled:y||p===W.itemId,globalClassName:n,onRemove:fe,onQuantityChange:Se},W.itemId))}),le.length>0&&w.jsx("div",{className:B(n,`${N}-cart-chips`,`${N}-cart-applied-coupons`),children:le.map(W=>w.jsx(sc,{code:W.code,inactive:!W.applied,globalClassName:n},W.code))})]}),w.jsxs("div",{className:B(n,`${N}-cart-totals`),children:[w.jsx(Rn,{label:"Subtotal",value:A,currencyCode:x,globalClassName:n,loading:!!p}),w.jsx(Rn,{label:"Coupon",value:J,currencyCode:x,globalClassName:n,isDiscount:!0,loading:!!p}),w.jsx(Rn,{label:"Promotions",badge:V[0],value:M,currencyCode:x,globalClassName:n,isDiscount:!0,loading:!!p}),w.jsx(Rn,{label:"Shipping",value:O,currencyCode:x,globalClassName:n,fallback:"TBD",loading:!!p}),w.jsx(Rn,{label:"Shipping Discount",badge:G[0],value:z,currencyCode:x,globalClassName:n,isDiscount:!0,loading:!!p}),w.jsx(Rn,{label:"Tax",value:C,currencyCode:x,globalClassName:n,fallback:"TBD",loading:!!p}),w.jsx(Rn,{label:"Total",value:S,currencyCode:x,globalClassName:n,emphasized:!0,loading:!!p})]})]})]}),w.jsxs("div",{className:B(n,`${N}-cart-coupon`),children:[w.jsxs("div",{className:B(n,`${N}-cart-coupon-field`),children:[w.jsx("span",{className:B(n,`${N}-cart-coupon-icon`),"aria-hidden":"true",children:w.jsx(T1,{})}),w.jsx("input",{type:"text",className:B(n,`${N}-cart-coupon-input`),placeholder:"Enter coupon code","aria-label":"Enter coupon code",value:f,disabled:y,onChange:W=>m(W.target.value),onKeyDown:W=>{W.key==="Enter"&&(W.preventDefault(),de())}})]}),w.jsx("button",{type:"button",className:B(n,`${N}-cart-coupon-submit`),"aria-label":"Apply coupon",disabled:y||!f.trim(),onClick:de,children:w.jsx(xC,{"aria-hidden":"true"})})]}),te&&w.jsx(xw,{expressPaymentUrl:te,globalClassName:n,onOrderComplete:ue}),ie&&w.jsxs("a",{className:B(n,`${N}-cart-checkout-button`),href:ie,target:r?"_blank":"_self",rel:"noopener noreferrer",children:[w.jsx(wC,{"aria-hidden":"true"}),w.jsx("span",{children:"Checkout"})]}),w.jsx("p",{className:B(n,`${N}-cart-footer`),children:H||"Shipping and taxes calculated at checkout."})]})},yF=({item:e,currencyCode:t,globalClassName:n})=>{var a,u;const r=typeof e.originalSubtotal=="number"&&typeof e.itemSubtotal=="number"&&e.originalSubtotal>e.itemSubtotal,s=xp(e.coupons);return w.jsxs("li",{className:B(n,`${N}-cart-item`),children:[e.imageUrl&&w.jsx("div",{className:B(n,`${N}-cart-item-image`),children:w.jsx("img",{src:e.imageUrl,alt:e.name||"Product image",loading:"lazy"})}),w.jsxs("div",{className:B(n,`${N}-cart-item-details`),children:[w.jsx("p",{className:B(n,`${N}-cart-item-name`),children:e.name}),w.jsxs("div",{className:B(n,`${N}-cart-item-attrs`),children:[((a=e.variants)!=null?a:[]).map(l=>w.jsxs("p",{className:B(n,`${N}-cart-item-attr`),children:[l.lbl,": ",l.value]},`${l.type}-${l.value}`)),((u=e.promotions)!=null?u:[]).map(l=>w.jsxs("p",{className:B(n,`${N}-cart-item-attr`),children:["Promotion: ",l]},l))]}),s.length>0&&w.jsx("div",{className:B(n,`${N}-cart-chips`),children:s.map(l=>w.jsx(sc,{code:l,globalClassName:n},l))}),w.jsxs("span",{className:B(n,`${N}-cart-item-price`),children:[r&&w.jsx("span",{className:B(n,`${N}-cart-item-original-price`),children:Kr(e.originalSubtotal,t)}),w.jsx("span",{className:B(n,`${N}-cart-item-final-price`),children:Kr(e.itemSubtotal,t)})]}),w.jsx("div",{className:B(n,`${N}-cart-item-footer`),children:w.jsxs("span",{className:B(n,`${N}-cart-item-qty`),children:["Qty: ",e.quantity]})})]})]})},TF=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})},bF=({order:e,globalClassName:t})=>{const[n,r]=R.useState(!0),{id:s,orderedOn:a,items:u=[],currencyCode:l="USD",subtotal:d,total:f,taxes:m,shippingCost:p,shippingDiscount:b,shippingPromotions:y=[],promotionsDiscount:_,promotions:x=[],couponsDiscount:A,bodyMessage:S,footerMessage:C}=e,O=kw(u,e.couponsApplied);return w.jsxs("div",{className:B(t,`${N}-cart`),children:[w.jsxs("div",{className:B(t,`${N}-cart-banner`),children:[w.jsx("span",{className:B(t,`${N}-cart-banner-icon`),"aria-hidden":"true",children:w.jsx(SC,{})}),w.jsx("p",{className:B(t,`${N}-cart-banner-text`),children:"Your order is confirmed!"})]}),w.jsxs("div",{className:B(t,`${N}-order-confirmation-meta`),children:[w.jsxs("span",{children:["Order No: ",s]}),w.jsxs("span",{children:["Ordered On: ",TF(a)]})]}),w.jsxs("div",{className:B(t,`${N}-cart-box`),children:[S&&w.jsxs("button",{type:"button",className:B(t,`${N}-cart-summary`),"aria-expanded":n,onClick:()=>r(z=>!z),children:[w.jsx("span",{className:B(t,`${N}-cart-summary-text`),children:w.jsx(wo,{text:S,globalClassName:t,showIsLoading:!1})}),w.jsx("span",{className:B(t,`${N}-cart-summary-toggle`),"aria-hidden":"true",children:n?w.jsx(E1,{}):w.jsx(y1,{})})]}),n&&w.jsxs("div",{className:B(t,`${N}-cart-expanded`),children:[w.jsx("ul",{className:B(t,`${N}-cart-items`),children:u.map(z=>w.jsx(yF,{item:z,currencyCode:l,globalClassName:t},z.itemId))}),O.length>0&&w.jsx("div",{className:B(t,`${N}-cart-chips`,`${N}-cart-applied-coupons`),children:O.map(z=>w.jsx(sc,{code:z.code,globalClassName:t},z.code))}),w.jsxs("div",{className:B(t,`${N}-cart-totals`),children:[w.jsx(Rn,{label:"Subtotal",value:d,currencyCode:l,globalClassName:t}),w.jsx(Rn,{label:"Coupon",value:A,currencyCode:l,globalClassName:t,isDiscount:!0}),w.jsx(Rn,{label:"Promotions",badge:x[0],value:_,currencyCode:l,globalClassName:t,isDiscount:!0}),w.jsx(Rn,{label:"Shipping",value:p,currencyCode:l,globalClassName:t,fallback:"TBD"}),w.jsx(Rn,{label:"Shipping Discount",badge:y[0],value:b,currencyCode:l,globalClassName:t,isDiscount:!0}),w.jsx(Rn,{label:"Tax",value:m,currencyCode:l,globalClassName:t,fallback:"TBD"}),w.jsx(Rn,{label:"Total",value:f,currencyCode:l,globalClassName:t,emphasized:!0})]})]})]}),w.jsx("p",{className:B(t,`${N}-cart-footer`),children:C||"Shipping and taxes calculated at checkout."})]})},wF=({image:e,alt:t,globalClassName:n})=>{const[r,s]=R.useState(e.src),[a,u]=R.useState(!1),l=()=>{e.fallbackSrc&&r!==e.fallbackSrc&&s(e.fallbackSrc)};return w.jsx("img",{className:B(n,`${N}-pdp-gallery__image`,{[`${N}-pdp-gallery__image--loaded`]:a}),src:r,alt:t,loading:"lazy",onLoad:()=>u(!0),onError:l})},_F=({images:e,altText:t,globalClassName:n})=>{if(e.length===0)return null;const r=e.length>1;return w.jsxs(ip,{className:B(n,`${N}-pdp-gallery`),slidesPerPage:1,slidesPerMove:1,slideCount:e.length,loop:!0,"aria-label":t||"Product images",children:[w.jsx(tp,{className:B(n,`${N}-pdp-gallery__item-group`),children:e.map((s,a)=>w.jsx(ep,{index:a,className:B(n,`${N}-pdp-gallery__item`),children:w.jsx(wF,{image:s,alt:t?`${t} (${a+1})`:`Product image ${a+1}`,globalClassName:n})},s.src))}),r&&w.jsxs(Qh,{className:B(n,`${N}-pdp-gallery__control`),children:[w.jsx(rp,{className:B(n,`${N}-pdp-gallery__prev-trigger`),"aria-label":"Previous image",children:w.jsx(bb,{size:"16px"})}),w.jsx(np,{className:B(n,`${N}-pdp-gallery__next-trigger`),"aria-label":"Next image",children:w.jsx(wb,{size:"16px"})})]}),r&&w.jsx(Zh,{className:B(n,`${N}-pdp-gallery__indicator-group`),children:Array.from({length:e.length},(s,a)=>w.jsx(Jh,{index:a,className:B(n,`${N}-pdp-gallery__indicator`),"aria-label":`Go to image ${a+1}`},a))})]})},Va="color",Sp=(e,t)=>/^https?:\/\//i.test(t)||!e?t:`${e}${t}`,xF=e=>e.replace(/(^|\/)large\//,"$1medium/"),Cw=(e,t)=>!e.vattr||!t?!1:e.vattr.some(n=>n.id===Va&&n.vals.includes(t)),Nw=(e,t)=>{const n=xF(t),r=Sp(e,n);return n===t?{src:r}:{src:r,fallbackSrc:Sp(e,t)}},SF=(e,t)=>{var l,d;const n=((l=e.imgGroups)!=null?l:[]).filter(f=>f.viewType==="large"),r=t&&n.find(f=>Cw(f,t)),s=n.find(f=>f.vattr===null),a=r||s||n[0],u=((d=a==null?void 0:a.imgs)!=null?d:[]).map(f=>Nw(e.baseUrl,f.url));return u.length>0?u:e.imageUrl?[Nw(e.baseUrl,e.imageUrl)]:[]},vF=(e,t)=>{var s,a,u;const n=((s=e.imgGroups)!=null?s:[]).find(l=>l.viewType==="swatch"&&Cw(l,t)),r=(u=(a=n==null?void 0:n.imgs)==null?void 0:a[0])==null?void 0:u.url;return r?Sp(e.baseUrl,r):""},oc=(e,t,n,r={})=>!e||e.length===0||!t||!n?!1:e.some(s=>{var a;return((a=s.vars)==null?void 0:a[t])!==n||s.ord===!1?!1:Object.entries(r).every(([u,l])=>{var d;return u===t||((d=s.vars)==null?void 0:d[u])===l})}),AF=(e,t)=>{const n=Object.keys(t);return n.length===0?!0:!e||e.length===0?!1:e.some(r=>r.ord!==!1&&n.every(s=>{var a;return((a=r.vars)==null?void 0:a[s])===t[s]}))},kF=(e,t,n,r,s)=>{if(!e||e.length===0)return ce(j({},s),{[n]:r});const a=e.find(l=>{var d;return((d=l.vars)==null?void 0:d[n])===r&&l.ord!==!1&&Object.keys(l.vars).length>=t.length&&Object.entries(s).every(([f,m])=>{var p;return f===n||((p=l.vars)==null?void 0:p[f])===m})});if(a)return j({},a.vars);const u=e.find(l=>{var d;return((d=l.vars)==null?void 0:d[n])===r&&l.ord!==!1&&Object.keys(l.vars).length>=t.length});return u?j({},u.vars):ce(j({},s),{[n]:r})},Ow=(e,t)=>{var s,a,u,l;if(!(Array.isArray(e.vattr)&&e.vattr.length>0))return(s=e.id)!=null?s:null;if(!e.vmat||e.vmat.length===0)return(a=e.id)!=null?a:null;const r=e.vmat.find(d=>d.ord!==!1&&Object.entries(t).every(([f,m])=>{var p;return((p=d.vars)==null?void 0:p[f])===m}));return(l=(u=r==null?void 0:r.pid)!=null?u:e.id)!=null?l:null},CF=(e,t)=>{if(!e.vmat||e.vmat.length===0||Object.keys(t).length===0)return e.pr;const n=e.vmat.find(r=>r.ord!==!1&&Object.entries(t).every(([s,a])=>{var u;return((u=r.vars)==null?void 0:u[s])===a}));return n!=null&&n.pr?n.pr:e.pr},NF=e=>{var n;const t={};for(const r of(n=e.vattr)!=null?n:[]){const s=r.opts.find(u=>oc(e.vmat,r.id,u.val)),a=s!=null?s:r.opts[0];a&&(t[r.id]=a.val)}return t},OF=300,IF=({product:e,globalClassName:t,openLinksInNewTab:n,isCartMgmtSupported:r=!1})=>{var et,mt,Lt,pn,wn,Dt,ze;const{addToCart:s,sendMessage:a,loading:u}=Cn(),{overrides:l,isInitialized:d}=_o(),f=xo(),m=e.data,p=(et=m.vattr)!=null?et:[],[b,y]=R.useState(()=>NF(m)),_=AF(m.vmat,b),x=(Lt=(mt=m.quantity)==null?void 0:mt.minQuantity)!=null?Lt:1,A=(wn=(pn=m.quantity)==null?void 0:pn.maxQuantity)!=null?wn:Number.POSITIVE_INFINITY,S=(ze=(Dt=m.quantity)==null?void 0:Dt.increment)!=null?ze:1,[C,O]=R.useState(x),[z,G]=R.useState(!1),M=R.useRef(!1);R.useEffect(()=>{z&&(u?M.current=!0:M.current&&(M.current=!1,G(!1)))},[z,u]);const V=b[Va],J=R.useMemo(()=>SF(m,V),[m,V]),se=R.useMemo(()=>CF(m,b),[m,b]),H=p.find(Ce=>Ce.id===Va),ie=p.filter(Ce=>Ce.id!==Va),te=Ow(m,b),[le,fe]=R.useState(C),ue=R.useRef(te),Se=ue.current===te?le:C;R.useEffect(()=>{if(ue.current!==te){ue.current=te,fe(C);return}const Ce=window.setTimeout(()=>fe(C),OF);return()=>window.clearTimeout(Ce)},[C,te]);const de=C===le,W=R.useMemo(()=>_&&(ue.current!==te||de)?hF(m.expressPaymentUrl,te,Se):null,[m.expressPaymentUrl,te,Se,_,de]),oe=R.useCallback(Ce=>{a(Ce?`I completed express payment. Show my order confirmation for order ${Ce}.`:"I completed express payment. Show my order confirmation.")},[a]),k=d?l.ProductDetailCard:void 0;if(k){const Ce={name:"ProductDetailCard",payload:e,api:f};return w.jsx(So,{tagName:k,props:Ce,label:"ProductDetailCard"})}const D=(Ce,Xe)=>()=>{y(nt=>{const pt=!oc(m.vmat,Ce,Xe,nt);return Ce===Va||pt?kF(m.vmat,p,Ce,Xe,nt):ce(j({},nt),{[Ce]:Xe})})},Z=()=>{if(u)return;const Ce=Ow(m,b);if(!Ce)return;const Xe=p.map(nt=>{const pt=nt.opts.find(Mt=>Mt.val===b[nt.id]);return pt?{label:nt.lbl||nt.id,value:pt.name||pt.val}:null}).filter(nt=>nt!==null);G(!0),s({productName:m.name,sku:Ce,quantity:C,variants:Xe})},P=!_||C-S<x,xe=!_||C+S>A,Ie=Ce=>{var nt;const Xe=b[Ce.id];return(nt=Ce.opts.find(pt=>pt.val===Xe))==null?void 0:nt.name},he=()=>O(Ce=>Math.max(x,Ce-S)),ve=()=>O(Ce=>Math.min(A,Ce+S)),Fe=Ce=>w.jsxs("div",{className:B(t,`${N}-msg-pdp__variant`),children:[w.jsxs("div",{className:B(t,`${N}-msg-pdp__variant-label`),children:[w.jsx("span",{id:`variant-label-${Ce.id}`,className:B(t,`${N}-msg-pdp__variant-name`),children:Ce.lbl||Ce.id}),Ie(Ce)&&w.jsx("span",{className:B(t,`${N}-msg-pdp__variant-value`),children:Ie(Ce)})]}),w.jsx("div",{role:"radiogroup","aria-labelledby":`variant-label-${Ce.id}`,className:B(t,`${N}-msg-pdp__chips`),children:Ce.opts.map(Xe=>{const nt=oc(m.vmat,Ce.id,Xe.val,b),pt=b[Ce.id]===Xe.val;return w.jsxs("label",{className:B(`${N}-msg-pdp__chip`,{selected:pt,unavailable:!nt}),children:[w.jsx("input",{type:"radio",name:`variant-${Ce.id}`,value:Xe.val,checked:pt,"aria-description":nt?void 0:"unavailable",onChange:D(Ce.id,Xe.val),className:`${N}-msg-pdp__radio-input`}),w.jsx("span",{children:Xe.name||Xe.val})]},Xe.val)})})]},Ce.id),Ge=Ce=>w.jsxs("div",{className:B(t,`${N}-msg-pdp__variant`),children:[w.jsxs("div",{className:B(t,`${N}-msg-pdp__variant-label`),children:[w.jsx("span",{id:`variant-label-${Ce.id}`,className:B(t,`${N}-msg-pdp__variant-name`),children:Ce.lbl||"Color"}),Ie(Ce)&&w.jsx("span",{className:B(t,`${N}-msg-pdp__variant-value`),children:Ie(Ce)})]}),w.jsx("div",{role:"radiogroup","aria-labelledby":`variant-label-${Ce.id}`,className:B(t,`${N}-msg-pdp__swatches`),children:Ce.opts.map(Xe=>{const nt=oc(m.vmat,Ce.id,Xe.val,b),pt=b[Ce.id]===Xe.val,Mt=vF(m,Xe.val);return Mt?w.jsxs("label",{className:B(`${N}-msg-pdp__swatch`,{selected:pt,unavailable:!nt}),children:[w.jsx("input",{type:"radio",name:`variant-${Ce.id}`,value:Xe.val,checked:pt,"aria-label":Xe.name||Xe.val,"aria-description":nt?void 0:"unavailable",onChange:D(Ce.id,Xe.val),className:`${N}-msg-pdp__radio-input`}),w.jsx("img",{className:B(t,`${N}-msg-pdp__swatch-image`),src:Mt,alt:Xe.name||Xe.val,loading:"lazy"})]},Xe.val):w.jsxs("label",{className:B(`${N}-msg-pdp__chip`,{selected:pt,unavailable:!nt}),children:[w.jsx("input",{type:"radio",name:`variant-${Ce.id}`,value:Xe.val,checked:pt,"aria-description":nt?void 0:"unavailable",onChange:D(Ce.id,Xe.val),className:`${N}-msg-pdp__radio-input`}),w.jsx("span",{children:Xe.name||Xe.val})]},Xe.val)})})]});return w.jsx("div",{className:B(t,`${N}-msg-pdp`),children:w.jsxs("div",{className:B(t,`${N}-msg-pdp__card`),children:[w.jsx("div",{className:B(t,`${N}-msg-pdp__gallery`),children:w.jsx(_F,{images:J,altText:m.name,globalClassName:t})}),w.jsxs("div",{className:B(t,`${N}-msg-pdp__content`),children:[m.slugUrl?w.jsx("a",{href:m.slugUrl,target:n?"_blank":"_self",rel:"noopener noreferrer",className:B(t,`${N}-msg-pdp__title-link`),"aria-label":`Go to product page for ${m.name}`,onClick:Ce=>ic({event:Ce,openLinksInNewTab:n,isCartMgmtSupported:r}),children:m.name}):w.jsx("p",{className:B(t,`${N}-msg-pdp__title`),children:m.name}),w.jsx(dp,{globalClassName:t,className:`${N}-msg-pdp__price`,retailPrice:se==null?void 0:se.orig,discountPrice:(se==null?void 0:se.cur)||(se==null?void 0:se.prom),currencyCode:m.ccy,fontSize:"14px"}),m.dscr&&w.jsx("div",{className:B(t,`${N}-msg-pdp__description`),children:w.jsx(wo,{globalClassName:t,text:m.dscr})}),H&&Ge(H),ie.map(Fe),r&&w.jsxs("div",{className:B(t,`${N}-msg-pdp__variant`),children:[w.jsxs("div",{className:B(t,`${N}-msg-pdp__variant-label`),children:[w.jsx("span",{className:B(t,`${N}-msg-pdp__variant-name`),children:"Quantity"}),w.jsx("span",{className:B(t,`${N}-msg-pdp__variant-value`),children:C})]}),w.jsxs("div",{className:B(t,`${N}-msg-pdp__stepper`),children:[w.jsx(lr,{className:`${N}-msg-pdp__stepper-btn`,ariaLabel:"Decrease quantity",icon:w.jsx(fC,{}),disabled:P,onClick:he}),w.jsx("span",{className:B(t,`${N}-msg-pdp__quantity`),children:C}),w.jsx(lr,{className:`${N}-msg-pdp__stepper-btn`,ariaLabel:"Increase quantity",icon:w.jsx(hC,{}),disabled:xe,onClick:ve})]})]}),r&&w.jsxs("div",{className:B(t,`${N}-msg-pdp__actions`),children:[W&&w.jsx(xw,{expressPaymentUrl:W,globalClassName:t,onOrderComplete:oe},W),w.jsx(bf,{className:`${N}-msg-pdp__add-to-cart`,disabled:!_||u||z,onClick:Z,children:z?"Adding...":"Add to cart"})]})]})]})})},PF=e=>{if(e.imageUrl)return e.baseUrl?e.baseUrl+e.imageUrl:e.imageUrl},RF=({products:e,table:t,globalClassName:n,openLinksInNewTab:r})=>{const{isCartMgmtSupported:s}=ft(),{overrides:a,isInitialized:u}=_o(),l=xo(),d=u?a.ProductComparison:void 0;if(d){const p={name:"ProductComparison",payload:{products:e,table:t},api:l};return w.jsx(So,{tagName:d,props:p,label:"ProductComparison"})}if(!e.length)return null;const f=`auto repeat(${e.length}, 1fr)`,m=`${90+e.length*140}px`;return w.jsx("div",{className:B(n,`${N}-product-comparison`),children:w.jsxs("div",{className:`${N}-product-comparison__grid`,style:{gridTemplateColumns:f,minWidth:m},children:[w.jsxs("div",{className:`${N}-product-comparison__header`,children:[w.jsx("div",{className:`${N}-product-comparison__header-spacer`}),e.map(p=>{var y,_,x,A;const b=PF(p);return w.jsxs("div",{className:B(n,`${N}-product-comparison__product-col`),children:[b&&w.jsx("img",{className:B(n,`${N}-product-comparison__image`),src:b,alt:p.name||"Product image",loading:"eager"}),p.slugUrl?w.jsx("a",{href:p.slugUrl,target:r?"_blank":"_self",rel:"noopener",className:B(n,`${N}-product-comparison__name`),"aria-label":`Go to product page for ${p.name}`,onClick:S=>ic({event:S,openLinksInNewTab:r,isCartMgmtSupported:s}),children:p.name}):w.jsx("span",{className:B(n,`${N}-product-comparison__name`),children:p.name}),w.jsx(dp,{globalClassName:n,retailPrice:(y=p.pr)==null?void 0:y.orig,discountPrice:(A=(_=p.pr)==null?void 0:_.prom)!=null?A:(x=p.pr)==null?void 0:x.cur,currencyCode:p.ccy,fontSize:"0.875rem"})]},p.id)})]}),w.jsx("div",{className:`${N}-product-comparison__table`,children:t.map(p=>w.jsxs("div",{className:`${N}-product-comparison__row`,children:[w.jsx("div",{className:B(n,`${N}-product-comparison__row-label`),children:p.row_name}),e.map((b,y)=>w.jsx("div",{className:B(n,`${N}-product-comparison__row-value`),children:p.values[y]},`${p.row_name}-${b.id}`))]},p.row_name))})]})})},Iw=({content:e,messageId:t,globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s})=>{const{sendMessage:a,loading:u,cartUpdating:l}=Cn(),{isCartMgmtSupported:d,logger:f}=ft(),{overrides:m,isInitialized:p}=_o(),b=xo(),y=R.useMemo(()=>e.response.flatMap(KA),[e.response]);return w.jsx(w.Fragment,{children:y.map((_,x)=>{var A,S,C,O,z,G,M,V,J,se,H,ie,te,le,fe,ue,Se,de,W,oe,k,D,Z,P,xe,Ie;switch(_.type){case"markdown":{const he=(S=(A=_.data)==null?void 0:A.content)!=null?S:"";return _.index===ci&&Lg(he)?null:w.jsx(wo,{text:he,globalClassName:n,openLinksInNewTab:r,showIsLoading:!1},`${_.type}-${(C=_.index)!=null?C:x}`)}case"product_carousel":return w.jsx(aF,{title:(z=(O=_.data)==null?void 0:O.title)!=null?z:"",products:(M=(G=_.data)==null?void 0:G.products)!=null?M:[],globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s,isCartMgmtSupported:d},`${_.type}-${(V=_.index)!=null?V:x}`);case"product_tile":return w.jsx(IF,{product:_.data,globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s,isCartMgmtSupported:d},`${_.type}-${(J=_.index)!=null?J:x}`);case"product_comparison":return w.jsx(RF,{products:(H=(se=_.data)==null?void 0:se.products)!=null?H:[],table:(te=(ie=_.data)==null?void 0:ie.table)!=null?te:[],globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s},`${_.type}-${(le=_.index)!=null?le:x}`);case"cart":{const he=(Se=(ue=(fe=_.data)==null?void 0:fe.cart)==null?void 0:ue.cartSummary)==null?void 0:Se.cartDetails;return he?w.jsx(EF,{cart:he,messageId:t,productsToHighlight:_.data.products_to_highlight,globalClassName:n,openLinksInNewTab:r},`${_.type}-${(de=_.index)!=null?de:x}`):null}case"order_confirmation":{const he=_.data,ve=(k=(W=he==null?void 0:he.order)==null?void 0:W.orderDetails)!=null?k:(oe=he==null?void 0:he.data)==null?void 0:oe.orderConfirmation;return ve?w.jsx(bF,{order:ve,globalClassName:n,openLinksInNewTab:r,isWidgetStandalone:s},`${_.type}-${(D=_.index)!=null?D:x}`):null}case"tool_results":{const he=_.data,ve=_.output_name,Fe=p&&ve&&Object.prototype.hasOwnProperty.call(m,ve)?m[ve]:void 0,Ge=typeof Fe=="string"?Fe:void 0;if(!Ge||!ve)return f!=null&&f.isDevelopment&&(ve?f.warn(`🦜 tool_results "${ve}" rendered nothing — no override registered for that key. Register one in the overrides map: { "${ve}": "<your-tag-name>" }.`,{registeredKeys:Object.keys(m),payload:he}):f.warn("🦜 tool_results block has no output_name — nothing to route on",{payload:he})),null;const et={name:ve,payload:he,api:b};return w.jsx(Z9,{overrideName:ve,children:w.jsx(So,{tagName:Ge,props:et,label:`toolResult:${ve}`})},`${_.type}-${ve}-${(Z=_.index)!=null?Z:x}`)}case"suggestions":return w.jsx("div",{style:{marginTop:"0.5rem"},children:w.jsx(L8,{disabled:u||l,suggestions:(xe=(P=_.data)==null?void 0:P.display_text)!=null?xe:[],globalClassName:n,isWidgetStandalone:s,onSuggestionClick:a})},`${_.type}-${(Ie=_.index)!=null?Ie:x}`);default:return null}})})};class Pw extends R.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){St(!0,"error","Message content threw during render:",t,n.componentStack)}render(){return this.state.hasError?w.jsx("p",{className:B(this.props.globalClassName,`${N}-reset-message`),children:"Oops, I had trouble displaying this response."}):this.props.children}}const LF=({message:e,globalClassName:t,openLinksInNewTab:n,isWidgetStandalone:r})=>{const{logger:s}=ft(),a=R.useMemo(()=>{if(typeof e.content!="string")return null;const l=Gu(e.content);if(l)return l;const d=Rg(e.content);return d?{response:[d]}:null},[e.content]),u=R.useMemo(()=>{var f;const l="Oops, I had trouble with your request.";if(typeof e.content!="string")return s==null||s.warn("Message content is not richtext format. Showing fallback text.",e.content),l;const d=e.content.trim();try{const m=JSON.parse(d);if(typeof m=="object"&&m!==null)return s==null||s.debug("Detected JSON object instead of array of responses in message content",e.content),(f=Ig(m))!=null?f:l}catch(m){if(d.startsWith("{")||d.startsWith("["))return s==null||s.warn("Failed to parse JSON-like message content. Showing fallback text.",e.content),l}return e.content||l},[s,e.content]);switch(e.role){case"user":return w.jsx("div",{className:B(t,`${N}-message`,r?"standalone":"embedded"),children:w.jsx("div",{className:B(t,`${N}-user-message`,r?"standalone":"embedded"),children:w.jsxs("div",{className:B(t,`${N}-user-message-row`,r?"standalone":"embedded"),children:[w.jsx("span",{className:B(t,`${N}-message-icon user-message-icon`,r?"standalone":"embedded"),children:w.jsx(_C,{})}),w.jsx("p",{className:B(t,`${N}-user-message-text`,r?"standalone":"embedded"),children:e.content})]})})});case"agent":return w.jsx("div",{className:B(t,`${N}-message-group`,r?"standalone":"embedded"),children:w.jsx("div",{className:`${N}-message-group-child`,children:a?w.jsx(Pw,{globalClassName:t,children:w.jsx(Iw,{content:a,messageId:e.id,globalClassName:t,openLinksInNewTab:n,isWidgetStandalone:r})}):w.jsx(wo,{text:u,globalClassName:t,openLinksInNewTab:n,showIsLoading:!1})})});case"system":return w.jsx("div",{className:B(t,`${N}-message`,r?"standalone":"embedded"),children:w.jsx("p",{className:B(t,`${N}-reset-message`),children:e.content})})}},DF=({message:e,onRetry:t,globalClassName:n,isWidgetStandalone:r})=>w.jsxs("div",{className:B(n,`${N}-send-error`,r?"standalone":"embedded"),role:"alert",children:[w.jsx("span",{className:B(n,`${N}-send-error-text`),children:e}),w.jsxs("button",{type:"button",className:B(n,`${N}-retry-button`),onClick:t,children:[w.jsx(kC,{"aria-hidden":"true"})," Retry"]})]}),MF="You are offline or we couldn't reach the assistant. Check connection and try again.",vp=({isWidgetStandalone:e})=>{var H,ie;const{globalClassName:t,openLinksInNewTab:n,logger:r,autoScroll:s}=ft(),{messages:a,streamingBlocks:u,isAgentTyping:l,loading:d,progressMessage:f,connectionStatus:m,error:p,sendError:b,retryLastMessage:y,retryConnection:_}=Cn(),x=R.useRef(null),A=a.length>0,S=u.some(JA),C=a[a.length-1],O=C?QA(C.content,"suggestions"):!1,z=A&&(d||l)&&!S&&!O,G=m==="reconnecting"&&!z,M=m==="error";let V=null;M?V={message:p!=null?p:MF,kind:"connection",onRetry:_}:b&&(V={message:b.message,kind:"send",onRetry:y}),R.useEffect(()=>{var te;(te=x.current)==null||te.scrollIntoView({behavior:"smooth"})},[]),R.useEffect(()=>{var te;s&&((te=x.current)==null||te.scrollIntoView({behavior:"smooth"}))},[a,u,b,p,s]);const J=(H=V==null?void 0:V.message)!=null?H:null,se=(ie=V==null?void 0:V.kind)!=null?ie:null;return R.useEffect(()=>{J&&(r==null||r.error("Error message shown to user",{message:J,kind:se}))},[J,se,r]),w.jsxs(w.Fragment,{children:[d&&!A&&w.jsx(U8,{globalClassName:t,isWidgetStandalone:e}),a.map(te=>w.jsx(LF,{message:te,globalClassName:t,openLinksInNewTab:n,isWidgetStandalone:e},te.id)),V&&w.jsx(DF,{message:V.message,onRetry:V.onRetry,globalClassName:t,isWidgetStandalone:e}),S&&w.jsxs("div",{className:B(t,`${N}-message-group`,e?"standalone":"embedded"),children:[w.jsx(Pw,{globalClassName:t,children:w.jsx(Iw,{content:{response:u},globalClassName:t,openLinksInNewTab:n,isWidgetStandalone:e})}),(d||l)&&w.jsx(fp,{globalClassName:t,isWidgetStandalone:e})]}),z&&w.jsx(fp,{globalClassName:t,isWidgetStandalone:e,loadingText:f}),G&&w.jsx(fp,{globalClassName:t,isWidgetStandalone:e,loadingText:"Reconnecting..."}),w.jsx("div",{ref:x})]})},FF=()=>w.jsxs("svg",{className:`${N}-progress-step-check`,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[w.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),w.jsx("path",{d:"M5 8.5L7 10.5L11 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),BF=()=>w.jsx("svg",{className:`${N}-progress-step-starburst`,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{d:"M8 1v3M8 12v3M1 8h3M12 8h3M3.05 3.05l2.12 2.12M10.83 10.83l2.12 2.12M3.05 12.95l2.12-2.12M10.83 5.17l2.12-2.12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),UF=(e,t)=>e===0?[]:e<0?t:t.slice(-e),Ap=({progressStepsLimit:e,steps:t,globalClassName:n})=>{const{progressStepsLimit:r}=ft(),s=e!=null?e:r,{overrides:a,isInitialized:u}=_o(),l=xo();if(t.length===0||s===0)return null;const d=UF(s,t),f=u?a.ProgressSteps:void 0;if(f){const m={name:"ProgressSteps",payload:{steps:d},api:l};return w.jsx(So,{tagName:f,props:m,label:"ProgressSteps"})}return w.jsx("div",{className:B(n,`${N}-progress-steps-panel`),children:w.jsx("div",{className:`${N}-progress-steps`,children:w.jsx("ul",{className:`${N}-progress-steps-list`,children:d.map((m,p)=>{const b=p<d.length-1,y=p===d.length-1;return w.jsxs("li",{className:B(`${N}-progress-step`,y&&"active"),children:[y&&w.jsx("span",{className:`${N}-progress-step-arc`}),w.jsx("span",{className:`${N}-progress-step-text`,children:m}),w.jsx("span",{className:B(`${N}-progress-step-icon`,b?"done":"active"),children:b?w.jsx(FF,{}):w.jsx(BF,{})})]},`${p}-${m}`)})})})})},Rw=()=>{const{globalClassName:e,themeVariables:t,messageAlignment:n,enableDownloadTranscript:r}=ft(),{isAgentTyping:s,sendMessage:a,resetConversation:u,progressSteps:l,downloadTranscript:d}=Cn(),f=s;return w.jsxs("div",{className:B(e,`${N}-container`,`${N}-embedded-chat`),style:t,children:[w.jsx("div",{className:B(e,`${N}-message-container`,`container-${n}`,"embedded"),children:w.jsx(vp,{isWidgetStandalone:!1})}),w.jsx(Ap,{steps:l,globalClassName:e}),w.jsx(ph,{componentType:"chat",className:"embedded-chat",isLoading:f,onSubmit:m=>a(m)}),w.jsx("div",{className:B(`${N}-embedded-chat-menu`),children:w.jsxs(MD,{componentType:"chat",children:[w.jsx(Yb,{componentType:"chat"}),w.jsx(Zy,{componentType:"chat",onClearChat:u}),r&&w.jsx(eT,{componentType:"chat",onDownloadTranscript:d})]})})]})},Lw=e=>{var d;const{children:t,disabled:n}=e,[r,s]=R.useState((d=e.container)==null?void 0:d.current),a=R.useSyncExternalStore(jF,()=>!1,()=>!0),{getRootNode:u}=Ql();if(R.useEffect(()=>{s(()=>{var f;return(f=e.container)==null?void 0:f.current})},[e.container]),a||n)return w.jsx(w.Fragment,{children:t});const l=r!=null?r:HF(u);return w.jsx(w.Fragment,{children:R.Children.map(t,f=>Vs.createPortal(f,l))})},HF=e=>{const t=e==null?void 0:e(),n=t.getRootNode();return as(n)?n:Cr(t).body},jF=()=>()=>{},Dw=()=>{const{globalClassName:e,themeVariables:t,messageAlignment:n}=ft(),{mode:r,status:s,dialogPosition:a,isDialogFullHeight:u,dialogWidth:l}=Vr(),{loading:d,isAgentTyping:f,sendMessage:m,resetConversation:p,progressSteps:b,downloadTranscript:y}=Cn(),{isOpen:_}=s||{},x=!!s.isOpen,A=r==="standalone",S=f||d,C=()=>{$r(!1)};return x?w.jsx(Bb,{lazyMount:!0,unmountOnExit:!0,modal:!1,closeOnEscape:!1,closeOnInteractOutside:!1,open:x,children:w.jsx(Lw,{children:w.jsx(ap,{className:B(e,`${N}-container`,`${N}-dialog`,a,u&&"full-height"),style:j(j({},t),l&&{width:l}),children:w.jsxs(sp,{className:B(e,`${N}-dialog-content`,{standalone:A,embedded:!A}),children:[w.jsx($b,{componentType:"dialog",onClearChat:p,onClose:C,onDownloadTranscript:y}),w.jsx(op,{className:B(e,`${N}-message-container`,`container-${n}`,{standalone:A,embedded:!A}),children:w.jsx(vp,{isWidgetStandalone:A,isOpen:_})}),w.jsx(Ap,{steps:b,globalClassName:e}),w.jsx(ph,{componentType:"dialog",isLoading:S,onSubmit:O=>m(O)})]})})})}):null},Mw=()=>{const{globalClassName:e,themeVariables:t,messageAlignment:n}=ft(),{mode:r,status:s,isModalFullscreen:a}=Vr(),{loading:u,isAgentTyping:l,sendMessage:d,resetConversation:f,progressSteps:m,downloadTranscript:p}=Cn(),{isOpen:b}=s||{},y=!!s.isOpen,_=r==="standalone",x=l||u,A=({open:C})=>{$r(C)},S=()=>{$r(!1)};return y?w.jsx(Bb,{lazyMount:!0,unmountOnExit:!0,open:y,onOpenChange:A,children:w.jsx(Lw,{children:w.jsxs("div",{className:B(e,`${N}-modal-container`),style:t,children:[w.jsx(Rb,{className:B(e,`${N}-modal-backdrop`)}),w.jsx(ap,{className:B(e,`${N}-container`,`${N}-modal`,{fullscreen:a,standalone:_,embedded:!_}),children:w.jsxs(sp,{className:B(e,`${N}-modal-content`,{standalone:_,embedded:!_}),children:[w.jsx($b,{componentType:"modal",onClearChat:f,onClose:S,onDownloadTranscript:p}),w.jsx(op,{className:B(e,`${N}-message-container`,`container-${n}`,{standalone:_,embedded:!_}),children:w.jsx(vp,{isWidgetStandalone:_,isOpen:b})}),w.jsx(Ap,{steps:m,globalClassName:e}),w.jsx(ph,{componentType:"modal",isLoading:x,onSubmit:C=>d(C)})]})})]})})}):null},zF=()=>{const e=Vr(),{status:{type:t,isMinimized:n}}=e||{status:{}};return n?w.jsx(EC,{}):t==="dialog"?w.jsx(Dw,{}):t==="modal"?w.jsx(Mw,{}):w.jsx(Rw,{})},$F=()=>{const{setIsOpen:e,setIsInline:t,setElementId:n,setEntryType:r,setParams:s}=k8();R.useEffect(()=>{const a=u=>{const{property:l,value:d}=u.detail||{};!l||d===void 0||(l==="isOpen"&&e(d),l==="isInline"&&t(d),l==="elementId"&&n(d),l==="entryType"&&r(d),l==="params"&&s(d))};return w8(a),()=>{_8(a)}},[e,t,n,r,s])},Fw=(e,t,n)=>{n!==void 0?e(t,n):e(t)};function VF({isReady:e,hasError:t,transmit:n}){const r=R.useRef([]),s=R.useRef(e);s.current=e;const a=R.useRef(n);a.current=n;const u=R.useCallback((l,d)=>{s.current?Fw(a.current,l,d):r.current.push({prompt:l,options:d})},[]);return R.useEffect(()=>{if(e&&r.current.length){const l=r.current;r.current=[],l.forEach(({prompt:d,options:f})=>Fw(a.current,d,f))}},[e]),R.useEffect(()=>{t&&(r.current=[])},[t]),u}const Bw={copilot:"Ask Copilot",messaging:"Ask a question"},qF=({onSubmit:e,disabled:t=!1})=>{const{globalClassName:n,mode:r}=ft(),{placeholder:s,isResponseLoading:a}=ec(),u=s||Bw[r],[l,d]=R.useState(""),f=t||a,m=p=>{const b=l.trim();b&&(p.preventDefault(),e(b),d(""))};return w.jsxs("form",{className:B(n,`${N}-prompts-input-container`),name:`${N}-prompts-form`,onSubmit:m,children:[w.jsx("label",{htmlFor:`${N}-prompts-input`,"aria-label":u,children:w.jsx(Kh,{className:B(n,`${N}-prompts-input-icon`)})}),w.jsx("input",{id:`${N}-prompts-input`,className:B(n,`${N}-prompts-input`),name:`${N}-prompts-input`,placeholder:u,type:"text",disabled:f,value:l,onChange:p=>d(p.target.value)}),w.jsx(lr,{className:B(n,`${N}-prompts-input-submit-button`),type:"submit",ariaLabel:"Submit Prompt",icon:w.jsx(Tf,{}),disabled:f})]})},YF=()=>{const{globalClassName:e,mode:t}=ft(),{placeholder:n}=ec(),r=n||Bw[t];return w.jsxs("div",{className:B(e,`${N}-prompts-header`),children:[w.jsx(Kh,{className:B(e,`${N}-prompts-input-icon`),"aria-hidden":"true"}),w.jsx("span",{className:B(e,`${N}-prompts-header-text`),children:r})]})},Uw=({label:e,disabled:t=!1,onClick:n})=>{var l;const{globalClassName:r,suggestionButtonConfig:s}=ft(),a=s==null?void 0:s.icon,u=(l=s==null?void 0:s.iconPosition)!=null?l:"left";return w.jsxs("button",{className:B(r,`${N}-prompts-button`,{"has-icon":!!a,"icon-right":!!a&&u==="right"}),disabled:t,onClick:n,children:[a&&w.jsx(qb,{icon:a,className:`${N}-suggestion-button-icon`}),w.jsx("span",{children:e})]})},WF="Ask me something else",GF=({label:e,disabled:t=!1})=>w.jsx(Uw,{label:e||WF,disabled:t,onClick:()=>$r(!0)}),XF=({onPromptClick:e,disabled:t=!1})=>{const{globalClassName:n}=ft(),{staticQuestions:r,askElseButtonLabel:s,disableAskElseButton:a}=ec();if(!(r!=null&&r.length))return null;const u=l=>()=>{const d=l.trim();d&&e(d)};return w.jsxs("div",{className:B(n,`${N}-prompts-button-group`),children:[r.map(l=>w.jsx(Uw,{label:l,disabled:t,onClick:u(l)},l)),!a&&w.jsx(GF,{label:s,disabled:t})]})},KF=()=>{const{globalClassName:e,themeVariables:t}=ft(),{isOpen:n,elementId:r,promptsDisplay:s}=ec(),{isConnected:a,sessionExpired:u,sendMessage:l,connectionStatus:d}=Cn(),{productId:f}=A8(),m=s!=="buttons",p=s!=="input",[b,y]=R.useState(null),_=d==="error",x=d==="connecting",A=Hg(a,u),S=VF({isReady:A,hasError:_,transmit:l});R.useEffect(()=>{if(!r||b)return;const O=document.getElementById(r);O&&y(O)},[r,b]);const C=R.useCallback(O=>{if($r(!0),f){S(`${O} (Viewing product details for: ${f})`,{displayContent:O});return}S(O)},[S,f]);return!n||!b?null:Vs.createPortal(w.jsxs("div",{className:B(e,`${N}-prompts-extension-container`),style:t,children:[m&&w.jsx(qF,{onSubmit:C,disabled:_}),!m&&w.jsx(YF,{}),p&&w.jsx(XF,{onPromptClick:C,disabled:_}),!_&&x&&w.jsx("p",{className:B(e,`${N}-prompts-connecting-message`),children:"Connecting to agent..."}),_&&w.jsx("p",{className:B(e,`${N}-prompts-error-message`),children:"Oops, an error occurred with our agent."})]}),b)},QF=()=>($F(),w.jsx(KF,{})),Hw=e=>w.jsxs(s1,ce(j({},e),{children:[w.jsx(zF,{}),w.jsx(QF,{})]}));var ac={},jw;function JF(){if(jw)return ac;jw=1;var e=c1();return ac.createRoot=e.createRoot,ac.hydrateRoot=e.hydrateRoot,ac}var ZF=JF();const zw=(e,t,n,r)=>{ZF.createRoot(e).render(w.jsx(Hw,ce(j({},t),{overridesUrl:n,inlineOverrides:r,mode:"messaging"})))},eB=a=>{var u=a,{elementId:e,timeout:t=5e3,overridesUrl:n,inlineOverrides:r}=u,s=Sn(u,["elementId","timeout","overridesUrl","inlineOverrides"]);let l;const d=(m,p)=>{for(const b of m)if(b.type==="childList"&&b.addedNodes.length)for(const y of b.addedNodes)y.nodeType===Node.ELEMENT_NODE&&y.id===e&&(St(!0,"log","Target element found, rendering Messaging Widget"),p.disconnect(),clearTimeout(l),zw(y,s,n,r))},f=new MutationObserver(d);return f.observe(document.body,{childList:!0,subtree:!0}),l=setTimeout(()=>{f.disconnect(),St(!0,"error",`Element with id: ${e} not found within ${t} milliseconds, stopping observation`)},t),f},tB=a=>{var u=a,{timeout:e,elementId:t,overridesUrl:n,overrides:r}=u,s=Sn(u,["timeout","elementId","overridesUrl","overrides"]);if(!s.messagingConfig){St(!0,"error","Messaging Widget requires messagingConfig");return}if(!s.messagingConfig.scrt2Url||!s.messagingConfig.orgId||!s.messagingConfig.esDeveloperName){St(!0,"error","Messaging Widget requires messagingConfig.scrt2Url, messagingConfig.orgId, and messagingConfig.esDeveloperName");return}const l=document.getElementById(t);if(!l){St(!0,"warn","Container element not found for id:",t),St(!0,"warn","Beginning observation for element"),eB(j({elementId:t,timeout:e,overridesUrl:n,inlineOverrides:r},s));return}zw(l,s,n,r)};class nB extends HTMLElement{constructor(){super(...arguments);Qe(this,"_props",null)}set props(n){this._props=n,this.render()}get props(){return this._props}connectedCallback(){this.render()}render(){}}const rB={components:{setEntryType:H0,toggleWidgetOpen:$r,toggleWidgetMinimized:Ms,toggleModalFullscreen:Md,setWidgetType:Mu,setWidgetDialogPosition:Fd,loadPromptsComponent:v8,togglePromptsExtensionOpen:zb}};function iB(){return Be(this,null,function*(){return Dk().getAuthLinkKey()})}He.AgentForceWidget=Hw,He.AgentforceWidgetProvider=s1,He.CIMULATE_WIDGET_READY_EVENT=B0,He.MessagingDialog=Dw,He.MessagingEmbed=Rw,He.MessagingModal=Mw,He.MessagingProvider=$g,He.OverrideElement=nB,He.eventHandlers=rB,He.getAuthLinkKey=iB,He.injectMessagingWidget=tB,He.useMessaging=Cn,Object.defineProperty(He,Symbol.toStringTag,{value:"Module"})}));