@inkeep/cxkit-fern 0.5.89 → 0.5.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ var __defProp=Object.defineProperty,__defNormalProp=(e,t,n)=>t in e?__defProp(e,
|
|
|
35
35
|
*
|
|
36
36
|
* This source code is licensed under the MIT license found in the
|
|
37
37
|
* LICENSE file in the root directory of this source tree.
|
|
38
|
-
*/function BT(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var zT=Symbol.for("react.transitional.element"),HT=Symbol.for("react.portal"),UT=Symbol.for("react.fragment"),$T=Symbol.for("react.strict_mode"),GT=Symbol.for("react.profiler"),VT=Symbol.for("react.provider"),qT=Symbol.for("react.consumer"),WT=Symbol.for("react.context"),YT=Symbol.for("react.forward_ref"),KT=Symbol.for("react.suspense"),XT=Symbol.for("react.suspense_list"),QT=Symbol.for("react.memo"),ZT=Symbol.for("react.lazy"),JT=Symbol.for("react.scope"),eC=Symbol.for("react.debug_trace_mode"),tC=Symbol.for("react.offscreen"),nC=Symbol.for("react.legacy_hidden"),rC=Symbol.for("react.memo_cache_sentinel"),aC=Symbol.iterator,oC=Array.isArray;function iC(e,t){var n=3&e.length,r=e.length-n,a=t;for(t=0;t<r;){var o=255&e.charCodeAt(t)|(255&e.charCodeAt(++t))<<8|(255&e.charCodeAt(++t))<<16|(255&e.charCodeAt(++t))<<24;++t,a=27492+(65535&(a=5*(65535&(a=(a^=o=461845907*(65535&(o=(o=3432918353*(65535&o)+((3432918353*(o>>>16)&65535)<<16)&4294967295)<<15|o>>>17))+((461845907*(o>>>16)&65535)<<16)&4294967295)<<13|a>>>19))+((5*(a>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16)}switch(o=0,n){case 3:o^=(255&e.charCodeAt(t+2))<<16;case 2:o^=(255&e.charCodeAt(t+1))<<8;case 1:a^=461845907*(65535&(o=(o=3432918353*(65535&(o^=255&e.charCodeAt(t)))+((3432918353*(o>>>16)&65535)<<16)&4294967295)<<15|o>>>17))+((461845907*(o>>>16)&65535)<<16)&4294967295}return a^=e.length,a=2246822507*(65535&(a^=a>>>16))+((2246822507*(a>>>16)&65535)<<16)&4294967295,((a=3266489909*(65535&(a^=a>>>13))+((3266489909*(a>>>16)&65535)<<16)&4294967295)^a>>>16)>>>0}var sC=new MessageChannel,lC=[];function cC(e){lC.push(e),sC.port2.postMessage(null)}function uC(e){setTimeout((function(){throw e}))}sC.port1.onmessage=function(){var e=lC.shift();e&&e()};var dC=Promise,pC="function"==typeof queueMicrotask?queueMicrotask:function(e){dC.resolve(null).then(e).catch(uC)},hC=null,fC=0;function mC(e,t){if(0!==t.byteLength)if(2048<t.byteLength)0<fC&&(e.enqueue(new Uint8Array(hC.buffer,0,fC)),hC=new Uint8Array(2048),fC=0),e.enqueue(t);else{var n=hC.length-fC;n<t.byteLength&&(0===n?e.enqueue(hC):(hC.set(t.subarray(0,n),fC),e.enqueue(hC),t=t.subarray(n)),hC=new Uint8Array(2048),fC=0),hC.set(t,fC),fC+=t.byteLength}}function gC(e,t){return mC(e,t),!0}function yC(e){hC&&0<fC&&(e.enqueue(new Uint8Array(hC.buffer,0,fC)),hC=null,fC=0)}var bC=new TextEncoder;function vC(e){return bC.encode(e)}function kC(e){return bC.encode(e)}function wC(e,t){"function"==typeof e.error?e.error(t):e.close()}var xC=Object.assign,EC=Object.prototype.hasOwnProperty,_C=RegExp("^[: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]*$"),SC={},TC={};function CC(e){return!!EC.call(TC,e)||!EC.call(SC,e)&&(_C.test(e)?TC[e]=!0:(SC[e]=!0,!1))}var AC=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")),NC=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),IC=/["'&<>]/;function RC(e){if("boolean"==typeof e||"number"==typeof e||"bigint"==typeof e)return""+e;e=""+e;var t=IC.exec(e);if(t){var n,r="",a=0;for(n=t.index;n<e.length;n++){switch(e.charCodeAt(n)){case 34:t=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}a!==n&&(r+=e.slice(a,n)),a=n+1,r+=t}e=a!==n?r+e.slice(a,n):r}return e}var OC=/([A-Z])/g,PC=/^ms-/,LC=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function DC(e){return LC.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var MC=FT.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,FC=jT.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,jC={pending:!1,data:null,method:null,action:null},BC=FC.d;FC.d={f:BC.f,r:BC.r,D:function(e){var t=HR||null;if(t){var n=t.resumableState,r=t.renderState;if("string"==typeof e&&e){var a,o;if(!n.dnsResources.hasOwnProperty(e))n.dnsResources[e]=null,(o=(n=r.headers)&&0<n.remainingCapacity)&&(a="<"+(""+e).replace(xI,EI)+">; rel=dns-prefetch",o=0<=(n.remainingCapacity-=a.length+2)),o?(r.resets.dns[e]=null,n.preconnects&&(n.preconnects+=", "),n.preconnects+=a):(OA(a=[],{href:e,rel:"dns-prefetch"}),r.preconnects.add(a));_O(t)}}else BC.D(e)},C:function(e,t){var n=HR||null;if(n){var r=n.resumableState,a=n.renderState;if("string"==typeof e&&e){var o="use-credentials"===t?"credentials":"string"==typeof t?"anonymous":"default";if(!r.connectResources[o].hasOwnProperty(e)){var i,s;if(r.connectResources[o][e]=null,s=(r=a.headers)&&0<r.remainingCapacity){if(s="<"+(""+e).replace(xI,EI)+">; rel=preconnect","string"==typeof t)s+='; crossorigin="'+(""+t).replace(_I,SI)+'"';i=s,s=0<=(r.remainingCapacity-=i.length+2)}s?(a.resets.connect[o][e]=null,r.preconnects&&(r.preconnects+=", "),r.preconnects+=i):(OA(o=[],{rel:"preconnect",href:e,crossOrigin:t}),a.preconnects.add(o))}_O(n)}}else BC.C(e,t)},L:function(e,t,n){var r=HR||null;if(r){var a=r.resumableState,o=r.renderState;if(t&&e){switch(t){case"image":if(n)var i=n.imageSrcSet,s=n.imageSizes,l=n.fetchPriority;var c,u=i?i+"\n"+(s||""):e;if(a.imageResources.hasOwnProperty(u))return;a.imageResources[u]=zC,(a=o.headers)&&0<a.remainingCapacity&&"high"===l&&(c=wI(e,t,n),0<=(a.remainingCapacity-=c.length+2))?(o.resets.image[u]=zC,a.highImagePreloads&&(a.highImagePreloads+=", "),a.highImagePreloads+=c):(OA(a=[],xC({rel:"preload",href:i?void 0:e,as:t},n)),"high"===l?o.highImagePreloads.add(a):(o.bulkPreloads.add(a),o.preloads.images.set(u,a)));break;case"style":if(a.styleResources.hasOwnProperty(e))return;OA(i=[],xC({rel:"preload",href:e,as:t},n)),a.styleResources[e]=!n||"string"!=typeof n.crossOrigin&&"string"!=typeof n.integrity?zC:[n.crossOrigin,n.integrity],o.preloads.stylesheets.set(e,i),o.bulkPreloads.add(i);break;case"script":if(a.scriptResources.hasOwnProperty(e))return;i=[],o.preloads.scripts.set(e,i),o.bulkPreloads.add(i),OA(i,xC({rel:"preload",href:e,as:t},n)),a.scriptResources[e]=!n||"string"!=typeof n.crossOrigin&&"string"!=typeof n.integrity?zC:[n.crossOrigin,n.integrity];break;default:if(a.unknownResources.hasOwnProperty(t)){if((i=a.unknownResources[t]).hasOwnProperty(e))return}else i={},a.unknownResources[t]=i;if(i[e]=zC,(a=o.headers)&&0<a.remainingCapacity&&"font"===t&&(u=wI(e,t,n),0<=(a.remainingCapacity-=u.length+2)))o.resets.font[e]=zC,a.fontPreloads&&(a.fontPreloads+=", "),a.fontPreloads+=u;else if("font"===(OA(a=[],e=xC({rel:"preload",href:e,as:t},n)),t))o.fontPreloads.add(a);else o.bulkPreloads.add(a)}_O(r)}}else BC.L(e,t,n)},m:function(e,t){var n=HR||null;if(n){var r=n.resumableState,a=n.renderState;if(e){var o=t&&"string"==typeof t.as?t.as:"script";if("script"===o){if(r.moduleScriptResources.hasOwnProperty(e))return;o=[],r.moduleScriptResources[e]=!t||"string"!=typeof t.crossOrigin&&"string"!=typeof t.integrity?zC:[t.crossOrigin,t.integrity],a.preloads.moduleScripts.set(e,o)}else{if(r.moduleUnknownResources.hasOwnProperty(o)){var i=r.unknownResources[o];if(i.hasOwnProperty(e))return}else i={},r.moduleUnknownResources[o]=i;o=[],i[e]=zC}OA(o,xC({rel:"modulepreload",href:e},t)),a.bulkPreloads.add(o),_O(n)}}else BC.m(e,t)},X:function(e,t){var n=HR||null;if(n){var r=n.resumableState,a=n.renderState;if(e){var o=r.scriptResources.hasOwnProperty(e)?r.scriptResources[e]:void 0;null!==o&&(r.scriptResources[e]=null,t=xC({src:e,async:!0},t),o&&(2===o.length&&kI(t,o),e=a.preloads.scripts.get(e))&&(e.length=0),e=[],a.scripts.add(e),FA(e,t),_O(n))}}else BC.X(e,t)},S:function(e,t,n){var r=HR||null;if(r){var a=r.resumableState,o=r.renderState;if(e){t=t||"default";var i=o.styles.get(t),s=a.styleResources.hasOwnProperty(e)?a.styleResources[e]:void 0;null!==s&&(a.styleResources[e]=null,i||(i={precedence:vC(RC(t)),rules:[],hrefs:[],sheets:new Map},o.styles.set(t,i)),t={state:0,props:xC({rel:"stylesheet",href:e,"data-precedence":t},n)},s&&(2===s.length&&kI(t.props,s),(o=o.preloads.stylesheets.get(e))&&0<o.length?o.length=0:t.state=1),i.sheets.set(e,t),_O(r))}}else BC.S(e,t,n)},M:function(e,t){var n=HR||null;if(n){var r=n.resumableState,a=n.renderState;if(e){var o=r.moduleScriptResources.hasOwnProperty(e)?r.moduleScriptResources[e]:void 0;null!==o&&(r.moduleScriptResources[e]=null,t=xC({src:e,type:"module",async:!0},t),o&&(2===o.length&&kI(t,o),e=a.preloads.moduleScripts.get(e))&&(e.length=0),e=[],a.scripts.add(e),FA(e,t),_O(n))}}else BC.M(e,t)}};var zC=[];kC('"></template>');var HC=kC("<script>"),UC=kC("<\/script>"),$C=kC('<script src="'),GC=kC('<script type="module" src="'),VC=kC('" nonce="'),qC=kC('" integrity="'),WC=kC('" crossorigin="'),YC=kC('" async=""><\/script>'),KC=/(<\/|<)(s)(cript)/gi;function XC(e,t,n,r){return t+("s"===n?"\\u0073":"\\u0053")+r}var QC=kC('<script type="importmap">'),ZC=kC("<\/script>");function JC(e,t,n,r,a,o){var i=void 0===t?HC:kC('<script nonce="'+RC(t)+'">'),s=e.idPrefix;n=[];var l=e.bootstrapScriptContent,c=e.bootstrapScripts,u=e.bootstrapModules;if(void 0!==l&&n.push(i,vC((""+l).replace(KC,XC)),UC),l=[],void 0!==r&&(l.push(QC),l.push(vC((""+JSON.stringify(r)).replace(KC,XC))),l.push(ZC)),r=a?{preconnects:"",fontPreloads:"",highImagePreloads:"",remainingCapacity:2+("number"==typeof o?o:2e3)}:null,a={placeholderPrefix:kC(s+"P:"),segmentPrefix:kC(s+"S:"),boundaryPrefix:kC(s+"B:"),startInlineScript:i,htmlChunks:null,headChunks:null,externalRuntimeScript:null,bootstrapChunks:n,importMapChunks:l,onHeaders:a,headers:r,resets:{font:{},dns:{},connect:{default:{},anonymous:{},credentials:{}},image:{},style:{}},charsetChunks:[],viewportChunks:[],hoistableChunks:[],preconnects:new Set,fontPreloads:new Set,highImagePreloads:new Set,styles:new Map,bootstrapScripts:new Set,scripts:new Set,bulkPreloads:new Set,preloads:{images:new Map,stylesheets:new Map,scripts:new Map,moduleScripts:new Map},nonce:t,hoistableState:null,stylesToHoist:!1},void 0!==c)for(r=0;r<c.length;r++){var d=c[r];s=i=void 0,l={rel:"preload",as:"script",fetchPriority:"low",nonce:t},"string"==typeof d?l.href=o=d:(l.href=o=d.src,l.integrity=s="string"==typeof d.integrity?d.integrity:void 0,l.crossOrigin=i="string"==typeof d||null==d.crossOrigin?void 0:"use-credentials"===d.crossOrigin?"use-credentials":"");var p=o;(d=e).scriptResources[p]=null,d.moduleScriptResources[p]=null,OA(d=[],l),a.bootstrapScripts.add(d),n.push($C,vC(RC(o))),t&&n.push(VC,vC(RC(t))),"string"==typeof s&&n.push(qC,vC(RC(s))),"string"==typeof i&&n.push(WC,vC(RC(i))),n.push(YC)}if(void 0!==u)for(c=0;c<u.length;c++)i=o=void 0,s={rel:"modulepreload",fetchPriority:"low",nonce:t},"string"==typeof(l=u[c])?s.href=r=l:(s.href=r=l.src,s.integrity=i="string"==typeof l.integrity?l.integrity:void 0,s.crossOrigin=o="string"==typeof l||null==l.crossOrigin?void 0:"use-credentials"===l.crossOrigin?"use-credentials":""),d=r,(l=e).scriptResources[d]=null,l.moduleScriptResources[d]=null,OA(l=[],s),a.bootstrapScripts.add(l),n.push(GC,vC(RC(r))),t&&n.push(VC,vC(RC(t))),"string"==typeof i&&n.push(qC,vC(RC(i))),"string"==typeof o&&n.push(WC,vC(RC(o))),n.push(YC);return a}function eA(e,t,n,r,a){return{idPrefix:void 0===e?"":e,nextFormID:0,streamingFormat:0,bootstrapScriptContent:n,bootstrapScripts:r,bootstrapModules:a,instructions:0,hasBody:!1,hasHtml:!1,unknownResources:{},dnsResources:{},connectResources:{default:{},anonymous:{},credentials:{}},imageResources:{},styleResources:{},scriptResources:{},moduleUnknownResources:{},moduleScriptResources:{}}}function tA(e,t,n){return{insertionMode:e,selectedValue:t,tagScope:n}}function nA(e){return tA("http://www.w3.org/2000/svg"===e?3:"http://www.w3.org/1998/Math/MathML"===e?4:0,null,0)}function rA(e,t,n){switch(t){case"noscript":return tA(2,null,1|e.tagScope);case"select":return tA(2,null!=n.value?n.value:n.defaultValue,e.tagScope);case"svg":return tA(3,null,e.tagScope);case"picture":return tA(2,null,2|e.tagScope);case"math":return tA(4,null,e.tagScope);case"foreignObject":return tA(2,null,e.tagScope);case"table":return tA(5,null,e.tagScope);case"thead":case"tbody":case"tfoot":return tA(6,null,e.tagScope);case"colgroup":return tA(8,null,e.tagScope);case"tr":return tA(7,null,e.tagScope)}return 5<=e.insertionMode?tA(2,null,e.tagScope):0===e.insertionMode?tA("html"===t?1:2,null,e.tagScope):1===e.insertionMode?tA(2,null,e.tagScope):e}var aA=kC("\x3c!-- --\x3e");function oA(e,t,n,r){return""===t?r:(r&&e.push(aA),e.push(vC(RC(t))),!0)}var iA=new Map,sA=kC(' style="'),lA=kC(":"),cA=kC(";");function uA(e,t){if("object"!=typeof t)throw Error(BT(62));var n,r=!0;for(n in t)if(EC.call(t,n)){var a=t[n];if(null!=a&&"boolean"!=typeof a&&""!==a){if(0===n.indexOf("--")){var o=vC(RC(n));a=vC(RC((""+a).trim()))}else void 0===(o=iA.get(n))&&(o=kC(RC(n.replace(OC,"-$1").toLowerCase().replace(PC,"-ms-"))),iA.set(n,o)),a="number"==typeof a?0===a||AC.has(n)?vC(""+a):vC(a+"px"):vC(RC((""+a).trim()));r?(r=!1,e.push(sA,o,lA,a)):e.push(cA,o,lA,a)}}r||e.push(hA)}var dA=kC(" "),pA=kC('="'),hA=kC('"'),fA=kC('=""');function mA(e,t,n){n&&"function"!=typeof n&&"symbol"!=typeof n&&e.push(dA,vC(t),fA)}function gA(e,t,n){"function"!=typeof n&&"symbol"!=typeof n&&"boolean"!=typeof n&&e.push(dA,vC(t),pA,vC(RC(n)),hA)}var yA=kC(RC("javascript:throw new Error('React form unexpectedly submitted.')")),bA=kC('<input type="hidden"');function vA(e,t){this.push(bA),kA(e),gA(this,"name",t),gA(this,"value",e),this.push(SA)}function kA(e){if("string"!=typeof e)throw Error(BT(480))}function wA(e,t){if("function"==typeof t.$$FORM_ACTION){var n=e.nextFormID++;e=e.idPrefix+n;try{var r=t.$$FORM_ACTION(e);if(r){var a=r.data;null!=a&&a.forEach(kA)}return r}catch(o){if("object"==typeof o&&null!==o&&"function"==typeof o.then)throw o}}return null}function xA(e,t,n,r,a,o,i,s){var l=null;if("function"==typeof r){var c=wA(t,r);null!==c?(s=c.name,r=c.action||"",a=c.encType,o=c.method,i=c.target,l=c.data):(e.push(dA,vC("formAction"),pA,yA,hA),i=o=a=r=s=null,NA(t,n))}return null!=s&&EA(e,"name",s),null!=r&&EA(e,"formAction",r),null!=a&&EA(e,"formEncType",a),null!=o&&EA(e,"formMethod",o),null!=i&&EA(e,"formTarget",i),l}function EA(e,t,n){switch(t){case"className":gA(e,"class",n);break;case"tabIndex":gA(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":gA(e,t,n);break;case"style":uA(e,n);break;case"src":case"href":if(""===n)break;case"action":case"formAction":if(null==n||"function"==typeof n||"symbol"==typeof n||"boolean"==typeof n)break;n=DC(""+n),e.push(dA,vC(t),pA,vC(RC(n)),hA);break;case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"ref":break;case"autoFocus":case"multiple":case"muted":mA(e,t.toLowerCase(),n);break;case"xlinkHref":if("function"==typeof n||"symbol"==typeof n||"boolean"==typeof n)break;n=DC(""+n),e.push(dA,vC("xlink:href"),pA,vC(RC(n)),hA);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":"function"!=typeof n&&"symbol"!=typeof n&&e.push(dA,vC(t),pA,vC(RC(n)),hA);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&"function"!=typeof n&&"symbol"!=typeof n&&e.push(dA,vC(t),fA);break;case"capture":case"download":!0===n?e.push(dA,vC(t),fA):!1!==n&&"function"!=typeof n&&"symbol"!=typeof n&&e.push(dA,vC(t),pA,vC(RC(n)),hA);break;case"cols":case"rows":case"size":case"span":"function"!=typeof n&&"symbol"!=typeof n&&!isNaN(n)&&1<=n&&e.push(dA,vC(t),pA,vC(RC(n)),hA);break;case"rowSpan":case"start":"function"==typeof n||"symbol"==typeof n||isNaN(n)||e.push(dA,vC(t),pA,vC(RC(n)),hA);break;case"xlinkActuate":gA(e,"xlink:actuate",n);break;case"xlinkArcrole":gA(e,"xlink:arcrole",n);break;case"xlinkRole":gA(e,"xlink:role",n);break;case"xlinkShow":gA(e,"xlink:show",n);break;case"xlinkTitle":gA(e,"xlink:title",n);break;case"xlinkType":gA(e,"xlink:type",n);break;case"xmlBase":gA(e,"xml:base",n);break;case"xmlLang":gA(e,"xml:lang",n);break;case"xmlSpace":gA(e,"xml:space",n);break;default:if((!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&CC(t=NC.get(t)||t)){switch(typeof n){case"function":case"symbol":return;case"boolean":var r=t.toLowerCase().slice(0,5);if("data-"!==r&&"aria-"!==r)return}e.push(dA,vC(t),pA,vC(RC(n)),hA)}}}var _A=kC(">"),SA=kC("/>");function TA(e,t,n){if(null!=t){if(null!=n)throw Error(BT(60));if("object"!=typeof t||!("__html"in t))throw Error(BT(61));null!=(t=t.__html)&&e.push(vC(""+t))}}var CA=kC(' selected=""'),AA=kC('addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});');function NA(e,t){!(16&e.instructions)&&(e.instructions|=16,t.bootstrapChunks.unshift(t.startInlineScript,AA,UC))}var IA=kC("\x3c!--F!--\x3e"),RA=kC("\x3c!--F--\x3e");function OA(e,t){for(var n in e.push(UA("link")),t)if(EC.call(t,n)){var r=t[n];if(null!=r)switch(n){case"children":case"dangerouslySetInnerHTML":throw Error(BT(399,"link"));default:EA(e,n,r)}}return e.push(SA),null}var PA=/(<\/|<)(s)(tyle)/gi;function LA(e,t,n,r){return t+("s"===n?"\\73 ":"\\53 ")+r}function DA(e,t,n){for(var r in e.push(UA(n)),t)if(EC.call(t,r)){var a=t[r];if(null!=a)switch(r){case"children":case"dangerouslySetInnerHTML":throw Error(BT(399,n));default:EA(e,r,a)}}return e.push(SA),null}function MA(e,t){e.push(UA("title"));var n,r=null,a=null;for(n in t)if(EC.call(t,n)){var o=t[n];if(null!=o)switch(n){case"children":r=o;break;case"dangerouslySetInnerHTML":a=o;break;default:EA(e,n,o)}}return e.push(_A),"function"!=typeof(t=Array.isArray(r)?2>r.length?r[0]:null:r)&&"symbol"!=typeof t&&null!=t&&e.push(vC(RC(""+t))),TA(e,a,r),e.push(qA("title")),null}function FA(e,t){e.push(UA("script"));var n,r=null,a=null;for(n in t)if(EC.call(t,n)){var o=t[n];if(null!=o)switch(n){case"children":r=o;break;case"dangerouslySetInnerHTML":a=o;break;default:EA(e,n,o)}}return e.push(_A),TA(e,a,r),"string"==typeof r&&e.push(vC((""+r).replace(KC,XC))),e.push(qA("script")),null}function jA(e,t,n){e.push(UA(n));var r,a=n=null;for(r in t)if(EC.call(t,r)){var o=t[r];if(null!=o)switch(r){case"children":n=o;break;case"dangerouslySetInnerHTML":a=o;break;default:EA(e,r,o)}}return e.push(_A),TA(e,a,n),"string"==typeof n?(e.push(vC(RC(n))),null):n}var BA=kC("\n"),zA=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,HA=new Map;function UA(e){var t=HA.get(e);if(void 0===t){if(!zA.test(e))throw Error(BT(65,e));t=kC("<"+e),HA.set(e,t)}return t}var $A=kC("<!DOCTYPE html>");function GA(e,t,n,r,a,o,i,s,l){switch(t){case"div":case"span":case"svg":case"path":case"g":case"p":case"li":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":break;case"a":e.push(UA("a"));var c,u=null,d=null;for(c in n)if(EC.call(n,c)){var p=n[c];if(null!=p)switch(c){case"children":u=p;break;case"dangerouslySetInnerHTML":d=p;break;case"href":""===p?gA(e,"href",""):EA(e,c,p);break;default:EA(e,c,p)}}if(e.push(_A),TA(e,d,u),"string"==typeof u){e.push(vC(RC(u)));var h=null}else h=u;return h;case"select":e.push(UA("select"));var f,m=null,g=null;for(f in n)if(EC.call(n,f)){var y=n[f];if(null!=y)switch(f){case"children":m=y;break;case"dangerouslySetInnerHTML":g=y;break;case"defaultValue":case"value":break;default:EA(e,f,y)}}return e.push(_A),TA(e,g,m),m;case"option":var b=i.selectedValue;e.push(UA("option"));var v,k=null,w=null,x=null,E=null;for(v in n)if(EC.call(n,v)){var _=n[v];if(null!=_)switch(v){case"children":k=_;break;case"selected":x=_;break;case"dangerouslySetInnerHTML":E=_;break;case"value":w=_;default:EA(e,v,_)}}if(null!=b){var S=null!==w?""+w:function(e){var t="";return FT.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(k);if(oC(b)){for(var T=0;T<b.length;T++)if(""+b[T]===S){e.push(CA);break}}else""+b===S&&e.push(CA)}else x&&e.push(CA);return e.push(_A),TA(e,E,k),k;case"textarea":e.push(UA("textarea"));var C,A=null,N=null,I=null;for(C in n)if(EC.call(n,C)){var R=n[C];if(null!=R)switch(C){case"children":I=R;break;case"value":A=R;break;case"defaultValue":N=R;break;case"dangerouslySetInnerHTML":throw Error(BT(91));default:EA(e,C,R)}}if(null===A&&null!==N&&(A=N),e.push(_A),null!=I){if(null!=A)throw Error(BT(92));if(oC(I)){if(1<I.length)throw Error(BT(93));A=""+I[0]}A=""+I}return"string"==typeof A&&"\n"===A[0]&&e.push(BA),null!==A&&e.push(vC(RC(""+A))),null;case"input":e.push(UA("input"));var O,P=null,L=null,D=null,M=null,F=null,j=null,B=null,z=null,H=null;for(O in n)if(EC.call(n,O)){var U=n[O];if(null!=U)switch(O){case"children":case"dangerouslySetInnerHTML":throw Error(BT(399,"input"));case"name":P=U;break;case"formAction":L=U;break;case"formEncType":D=U;break;case"formMethod":M=U;break;case"formTarget":F=U;break;case"defaultChecked":H=U;break;case"defaultValue":B=U;break;case"checked":z=U;break;case"value":j=U;break;default:EA(e,O,U)}}var $=xA(e,r,a,L,D,M,F,P);return null!==z?mA(e,"checked",z):null!==H&&mA(e,"checked",H),null!==j?EA(e,"value",j):null!==B&&EA(e,"value",B),e.push(SA),null!=$&&$.forEach(vA,e),null;case"button":e.push(UA("button"));var G,V=null,q=null,W=null,Y=null,K=null,X=null,Q=null;for(G in n)if(EC.call(n,G)){var Z=n[G];if(null!=Z)switch(G){case"children":V=Z;break;case"dangerouslySetInnerHTML":q=Z;break;case"name":W=Z;break;case"formAction":Y=Z;break;case"formEncType":K=Z;break;case"formMethod":X=Z;break;case"formTarget":Q=Z;break;default:EA(e,G,Z)}}var J=xA(e,r,a,Y,K,X,Q,W);if(e.push(_A),null!=J&&J.forEach(vA,e),TA(e,q,V),"string"==typeof V){e.push(vC(RC(V)));var ee=null}else ee=V;return ee;case"form":e.push(UA("form"));var te,ne=null,re=null,ae=null,oe=null,ie=null,se=null;for(te in n)if(EC.call(n,te)){var le=n[te];if(null!=le)switch(te){case"children":ne=le;break;case"dangerouslySetInnerHTML":re=le;break;case"action":ae=le;break;case"encType":oe=le;break;case"method":ie=le;break;case"target":se=le;break;default:EA(e,te,le)}}var ce=null,ue=null;if("function"==typeof ae){var de=wA(r,ae);null!==de?(ae=de.action||"",oe=de.encType,ie=de.method,se=de.target,ce=de.data,ue=de.name):(e.push(dA,vC("action"),pA,yA,hA),se=ie=oe=ae=null,NA(r,a))}if(null!=ae&&EA(e,"action",ae),null!=oe&&EA(e,"encType",oe),null!=ie&&EA(e,"method",ie),null!=se&&EA(e,"target",se),e.push(_A),null!==ue&&(e.push(bA),gA(e,"name",ue),e.push(SA),null!=ce&&ce.forEach(vA,e)),TA(e,re,ne),"string"==typeof ne){e.push(vC(RC(ne)));var pe=null}else pe=ne;return pe;case"menuitem":for(var he in e.push(UA("menuitem")),n)if(EC.call(n,he)){var fe=n[he];if(null!=fe)switch(he){case"children":case"dangerouslySetInnerHTML":throw Error(BT(400));default:EA(e,he,fe)}}return e.push(_A),null;case"object":e.push(UA("object"));var me,ge=null,ye=null;for(me in n)if(EC.call(n,me)){var be=n[me];if(null!=be)switch(me){case"children":ge=be;break;case"dangerouslySetInnerHTML":ye=be;break;case"data":var ve=DC(""+be);if(""===ve)break;e.push(dA,vC("data"),pA,vC(RC(ve)),hA);break;default:EA(e,me,be)}}if(e.push(_A),TA(e,ye,ge),"string"==typeof ge){e.push(vC(RC(ge)));var ke=null}else ke=ge;return ke;case"title":if(3===i.insertionMode||1&i.tagScope||null!=n.itemProp)var we=MA(e,n);else l?we=null:(MA(a.hoistableChunks,n),we=void 0);return we;case"link":var xe=n.rel,Ee=n.href,_e=n.precedence;if(3===i.insertionMode||1&i.tagScope||null!=n.itemProp||"string"!=typeof xe||"string"!=typeof Ee||""===Ee){OA(e,n);var Se=null}else if("stylesheet"===n.rel)if("string"!=typeof _e||null!=n.disabled||n.onLoad||n.onError)Se=OA(e,n);else{var Te=a.styles.get(_e),Ce=r.styleResources.hasOwnProperty(Ee)?r.styleResources[Ee]:void 0;if(null!==Ce){r.styleResources[Ee]=null,Te||(Te={precedence:vC(RC(_e)),rules:[],hrefs:[],sheets:new Map},a.styles.set(_e,Te));var Ae={state:0,props:xC({},n,{"data-precedence":n.precedence,precedence:null})};if(Ce){2===Ce.length&&kI(Ae.props,Ce);var Ne=a.preloads.stylesheets.get(Ee);Ne&&0<Ne.length?Ne.length=0:Ae.state=1}Te.sheets.set(Ee,Ae),o&&o.stylesheets.add(Ae)}else if(Te){var Ie=Te.sheets.get(Ee);Ie&&o&&o.stylesheets.add(Ie)}s&&e.push(aA),Se=null}else n.onLoad||n.onError?Se=OA(e,n):(s&&e.push(aA),Se=l?null:OA(a.hoistableChunks,n));return Se;case"script":var Re=n.async;if("string"!=typeof n.src||!n.src||!Re||"function"==typeof Re||"symbol"==typeof Re||n.onLoad||n.onError||3===i.insertionMode||1&i.tagScope||null!=n.itemProp)var Oe=FA(e,n);else{var Pe=n.src;if("module"===n.type)var Le=r.moduleScriptResources,De=a.preloads.moduleScripts;else Le=r.scriptResources,De=a.preloads.scripts;var Me=Le.hasOwnProperty(Pe)?Le[Pe]:void 0;if(null!==Me){Le[Pe]=null;var Fe=n;if(Me){2===Me.length&&kI(Fe=xC({},n),Me);var je=De.get(Pe);je&&(je.length=0)}var Be=[];a.scripts.add(Be),FA(Be,Fe)}s&&e.push(aA),Oe=null}return Oe;case"style":var ze=n.precedence,He=n.href;if(3===i.insertionMode||1&i.tagScope||null!=n.itemProp||"string"!=typeof ze||"string"!=typeof He||""===He){e.push(UA("style"));var Ue,$e=null,Ge=null;for(Ue in n)if(EC.call(n,Ue)){var Ve=n[Ue];if(null!=Ve)switch(Ue){case"children":$e=Ve;break;case"dangerouslySetInnerHTML":Ge=Ve;break;default:EA(e,Ue,Ve)}}e.push(_A);var qe=Array.isArray($e)?2>$e.length?$e[0]:null:$e;"function"!=typeof qe&&"symbol"!=typeof qe&&null!=qe&&e.push(vC((""+qe).replace(PA,LA))),TA(e,Ge,$e),e.push(qA("style"));var We=null}else{var Ye=a.styles.get(ze);if(null!==(r.styleResources.hasOwnProperty(He)?r.styleResources[He]:void 0)){r.styleResources[He]=null,Ye?Ye.hrefs.push(vC(RC(He))):(Ye={precedence:vC(RC(ze)),rules:[],hrefs:[vC(RC(He))],sheets:new Map},a.styles.set(ze,Ye));var Ke,Xe=Ye.rules,Qe=null,Ze=null;for(Ke in n)if(EC.call(n,Ke)){var Je=n[Ke];if(null!=Je)switch(Ke){case"children":Qe=Je;break;case"dangerouslySetInnerHTML":Ze=Je}}var et=Array.isArray(Qe)?2>Qe.length?Qe[0]:null:Qe;"function"!=typeof et&&"symbol"!=typeof et&&null!=et&&Xe.push(vC((""+et).replace(PA,LA))),TA(Xe,Ze,Qe)}Ye&&o&&o.styles.add(Ye),s&&e.push(aA),We=void 0}return We;case"meta":if(3===i.insertionMode||1&i.tagScope||null!=n.itemProp)var tt=DA(e,n,"meta");else s&&e.push(aA),tt=l?null:"string"==typeof n.charSet?DA(a.charsetChunks,n,"meta"):"viewport"===n.name?DA(a.viewportChunks,n,"meta"):DA(a.hoistableChunks,n,"meta");return tt;case"listing":case"pre":e.push(UA(t));var nt,rt=null,at=null;for(nt in n)if(EC.call(n,nt)){var ot=n[nt];if(null!=ot)switch(nt){case"children":rt=ot;break;case"dangerouslySetInnerHTML":at=ot;break;default:EA(e,nt,ot)}}if(e.push(_A),null!=at){if(null!=rt)throw Error(BT(60));if("object"!=typeof at||!("__html"in at))throw Error(BT(61));var it=at.__html;null!=it&&("string"==typeof it&&0<it.length&&"\n"===it[0]?e.push(BA,vC(it)):e.push(vC(""+it)))}return"string"==typeof rt&&"\n"===rt[0]&&e.push(BA),rt;case"img":var st=n.src,lt=n.srcSet;if(!("lazy"===n.loading||!st&&!lt||"string"!=typeof st&&null!=st||"string"!=typeof lt&&null!=lt)&&"low"!==n.fetchPriority&&!1==!!(3&i.tagScope)&&("string"!=typeof st||":"!==st[4]||"d"!==st[0]&&"D"!==st[0]||"a"!==st[1]&&"A"!==st[1]||"t"!==st[2]&&"T"!==st[2]||"a"!==st[3]&&"A"!==st[3])&&("string"!=typeof lt||":"!==lt[4]||"d"!==lt[0]&&"D"!==lt[0]||"a"!==lt[1]&&"A"!==lt[1]||"t"!==lt[2]&&"T"!==lt[2]||"a"!==lt[3]&&"A"!==lt[3])){var ct="string"==typeof n.sizes?n.sizes:void 0,ut=lt?lt+"\n"+(ct||""):st,dt=a.preloads.images,pt=dt.get(ut);if(pt)("high"===n.fetchPriority||10>a.highImagePreloads.size)&&(dt.delete(ut),a.highImagePreloads.add(pt));else if(!r.imageResources.hasOwnProperty(ut)){r.imageResources[ut]=zC;var ht,ft=n.crossOrigin,mt="string"==typeof ft?"use-credentials"===ft?ft:"":void 0,gt=a.headers;gt&&0<gt.remainingCapacity&&("high"===n.fetchPriority||500>gt.highImagePreloads.length)&&(ht=wI(st,"image",{imageSrcSet:n.srcSet,imageSizes:n.sizes,crossOrigin:mt,integrity:n.integrity,nonce:n.nonce,type:n.type,fetchPriority:n.fetchPriority,referrerPolicy:n.refererPolicy}),0<=(gt.remainingCapacity-=ht.length+2))?(a.resets.image[ut]=zC,gt.highImagePreloads&&(gt.highImagePreloads+=", "),gt.highImagePreloads+=ht):(OA(pt=[],{rel:"preload",as:"image",href:lt?void 0:st,imageSrcSet:lt,imageSizes:ct,crossOrigin:mt,integrity:n.integrity,type:n.type,fetchPriority:n.fetchPriority,referrerPolicy:n.referrerPolicy}),"high"===n.fetchPriority||10>a.highImagePreloads.size?a.highImagePreloads.add(pt):(a.bulkPreloads.add(pt),dt.set(ut,pt)))}}return DA(e,n,"img");case"base":case"area":case"br":case"col":case"embed":case"hr":case"keygen":case"param":case"source":case"track":case"wbr":return DA(e,n,t);case"head":if(2>i.insertionMode&&null===a.headChunks){a.headChunks=[];var yt=jA(a.headChunks,n,"head")}else yt=jA(e,n,"head");return yt;case"html":if(0===i.insertionMode&&null===a.htmlChunks){a.htmlChunks=[$A];var bt=jA(a.htmlChunks,n,"html")}else bt=jA(e,n,"html");return bt;default:if(-1!==t.indexOf("-")){e.push(UA(t));var vt,kt=null,wt=null;for(vt in n)if(EC.call(n,vt)){var xt=n[vt];if(null!=xt){var Et=vt;switch(vt){case"children":kt=xt;break;case"dangerouslySetInnerHTML":wt=xt;break;case"style":uA(e,xt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"ref":break;case"className":Et="class";default:if(CC(vt)&&"function"!=typeof xt&&"symbol"!=typeof xt&&!1!==xt){if(!0===xt)xt="";else if("object"==typeof xt)continue;e.push(dA,vC(Et),pA,vC(RC(xt)),hA)}}}}return e.push(_A),TA(e,wt,kt),kt}}return jA(e,n,t)}var VA=new Map;function qA(e){var t=VA.get(e);return void 0===t&&(t=kC("</"+e+">"),VA.set(e,t)),t}function WA(e,t){t=t.bootstrapChunks;for(var n=0;n<t.length-1;n++)mC(e,t[n]);return!(n<t.length)||(n=t[n],t.length=0,gC(e,n))}var YA=kC('<template id="'),KA=kC('"></template>'),XA=kC("\x3c!--$--\x3e"),QA=kC('\x3c!--$?--\x3e<template id="'),ZA=kC('"></template>'),JA=kC("\x3c!--$!--\x3e"),eN=kC("\x3c!--/$--\x3e"),tN=kC("<template"),nN=kC('"'),rN=kC(' data-dgst="');kC(' data-msg="'),kC(' data-stck="'),kC(' data-cstck="');var aN=kC("></template>");function oN(e,t,n){if(mC(e,QA),null===n)throw Error(BT(395));return mC(e,t.boundaryPrefix),mC(e,vC(n.toString(16))),gC(e,ZA)}var iN=kC('<div hidden id="'),sN=kC('">'),lN=kC("</div>"),cN=kC('<svg aria-hidden="true" style="display:none" id="'),uN=kC('">'),dN=kC("</svg>"),pN=kC('<math aria-hidden="true" style="display:none" id="'),hN=kC('">'),fN=kC("</math>"),mN=kC('<table hidden id="'),gN=kC('">'),yN=kC("</table>"),bN=kC('<table hidden><tbody id="'),vN=kC('">'),kN=kC("</tbody></table>"),wN=kC('<table hidden><tr id="'),xN=kC('">'),EN=kC("</tr></table>"),_N=kC('<table hidden><colgroup id="'),SN=kC('">'),TN=kC("</colgroup></table>");var CN=kC('$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'),AN=kC('$RS("'),NN=kC('","'),IN=kC('")<\/script>');kC('<template data-rsi="" data-sid="'),kC('" data-pid="');var RN=kC('$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RC("'),ON=kC('$RC("'),PN=kC('$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("'),LN=kC('$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("'),DN=kC('$RR("'),MN=kC('","'),FN=kC('",'),jN=kC('"'),BN=kC(")<\/script>");kC('<template data-rci="" data-bid="'),kC('<template data-rri="" data-bid="'),kC('" data-sid="'),kC('" data-sty="');var zN=kC('$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};;$RX("'),HN=kC('$RX("'),UN=kC('"'),$N=kC(","),GN=kC(")<\/script>");kC('<template data-rxi="" data-bid="'),kC('" data-dgst="'),kC('" data-msg="'),kC('" data-stck="'),kC('" data-cstck="');var VN=/[<\u2028\u2029]/g;var qN=/[&><\u2028\u2029]/g;function WN(e){return JSON.stringify(e).replace(qN,(function(e){switch(e){case"&":return"\\u0026";case">":return"\\u003e";case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSObjectForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}))}var YN=kC('<style media="not all" data-precedence="'),KN=kC('" data-href="'),XN=kC('">'),QN=kC("</style>"),ZN=!1,JN=!0;function eI(e){var t=e.rules,n=e.hrefs,r=0;if(n.length){for(mC(this,YN),mC(this,e.precedence),mC(this,KN);r<n.length-1;r++)mC(this,n[r]),mC(this,lI);for(mC(this,n[r]),mC(this,XN),r=0;r<t.length;r++)mC(this,t[r]);JN=gC(this,QN),ZN=!0,t.length=0,n.length=0}}function tI(e){return 2!==e.state&&(ZN=!0)}function nI(e,t,n){return ZN=!1,JN=!0,t.styles.forEach(eI,e),t.stylesheets.forEach(tI),ZN&&(n.stylesToHoist=!0),JN}function rI(e){for(var t=0;t<e.length;t++)mC(this,e[t]);e.length=0}var aI=[];function oI(e){OA(aI,e.props);for(var t=0;t<aI.length;t++)mC(this,aI[t]);aI.length=0,e.state=2}var iI=kC('<style data-precedence="'),sI=kC('" data-href="'),lI=kC(" "),cI=kC('">'),uI=kC("</style>");function dI(e){var t=0<e.sheets.size;e.sheets.forEach(oI,this),e.sheets.clear();var n=e.rules,r=e.hrefs;if(!t||r.length){if(mC(this,iI),mC(this,e.precedence),e=0,r.length){for(mC(this,sI);e<r.length-1;e++)mC(this,r[e]),mC(this,lI);mC(this,r[e])}for(mC(this,cI),e=0;e<n.length;e++)mC(this,n[e]);mC(this,uI),n.length=0,r.length=0}}function pI(e){if(0===e.state){e.state=1;var t=e.props;for(OA(aI,{rel:"preload",as:"style",href:e.props.href,crossOrigin:t.crossOrigin,fetchPriority:t.fetchPriority,integrity:t.integrity,media:t.media,hrefLang:t.hrefLang,referrerPolicy:t.referrerPolicy}),e=0;e<aI.length;e++)mC(this,aI[e]);aI.length=0}}function hI(e){e.sheets.forEach(pI,this),e.sheets.clear()}var fI=kC("["),mI=kC(",["),gI=kC(","),yI=kC("]");function bI(e,t,n){var r=t.toLowerCase();switch(typeof n){case"function":case"symbol":return}switch(t){case"innerHTML":case"dangerouslySetInnerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"style":case"ref":return;case"className":r="class",t=""+n;break;case"hidden":if(!1===n)return;t="";break;case"src":case"href":t=""+(n=DC(n));break;default:if(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])||!CC(t))return;t=""+n}mC(e,gI),mC(e,vC(WN(r))),mC(e,gI),mC(e,vC(WN(t)))}function vI(){return{styles:new Set,stylesheets:new Set}}function kI(e,t){null==e.crossOrigin&&(e.crossOrigin=t[0]),null==e.integrity&&(e.integrity=t[1])}function wI(e,t,n){for(var r in t="<"+(e=(""+e).replace(xI,EI))+'>; rel=preload; as="'+(t=(""+t).replace(_I,SI))+'"',n)EC.call(n,r)&&("string"==typeof(e=n[r])&&(t+="; "+r.toLowerCase()+'="'+(""+e).replace(_I,SI)+'"'));return t}var xI=/[<>\r\n]/g;function EI(e){switch(e){case"<":return"%3C";case">":return"%3E";case"\n":return"%0A";case"\r":return"%0D";default:throw Error("escapeLinkHrefForHeaderContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}var _I=/["';,\r\n]/g;function SI(e){switch(e){case'"':return"%22";case"'":return"%27";case";":return"%3B";case",":return"%2C";case"\n":return"%0A";case"\r":return"%0D";default:throw Error("escapeStringForLinkHeaderQuotedParamValueContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}function TI(e){this.styles.add(e)}function CI(e){this.stylesheets.add(e)}var AI=Function.prototype.bind,NI=Symbol.for("react.client.reference");function II(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===NI?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case UT:return"Fragment";case HT:return"Portal";case GT:return"Profiler";case $T:return"StrictMode";case KT:return"Suspense";case XT:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case WT:return(e.displayName||"Context")+".Provider";case qT:return(e._context.displayName||"Context")+".Consumer";case YT:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case QT:return null!==(t=e.displayName||null)?t:II(e.type)||"Memo";case ZT:t=e._payload,e=e._init;try{return II(e(t))}catch(n){}}return null}var RI={},OI=null;function PI(e,t){if(e!==t){e.context._currentValue=e.parentValue,e=e.parent;var n=t.parent;if(null===e){if(null!==n)throw Error(BT(401))}else{if(null===n)throw Error(BT(401));PI(e,n)}t.context._currentValue=t.value}}function LI(e){e.context._currentValue=e.parentValue,null!==(e=e.parent)&&LI(e)}function DI(e){var t=e.parent;null!==t&&DI(t),e.context._currentValue=e.value}function MI(e,t){if(e.context._currentValue=e.parentValue,null===(e=e.parent))throw Error(BT(402));e.depth===t.depth?PI(e,t):MI(e,t)}function FI(e,t){var n=t.parent;if(null===n)throw Error(BT(402));e.depth===n.depth?PI(e,n):FI(e,n),t.context._currentValue=t.value}function jI(e){var t=OI;t!==e&&(null===t?DI(e):null===e?LI(t):t.depth===e.depth?PI(t,e):t.depth>e.depth?MI(t,e):FI(t,e),OI=e)}var BI={isMounted:function(){return!1},enqueueSetState:function(e,t){null!==(e=e._reactInternals).queue&&e.queue.push(t)},enqueueReplaceState:function(e,t){(e=e._reactInternals).replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}},zI={id:1,overflow:""};function HI(e,t,n){var r=e.id;e=e.overflow;var a=32-UI(r)-1;r&=~(1<<a),n+=1;var o=32-UI(t)+a;if(30<o){var i=a-a%5;return o=(r&(1<<i)-1).toString(32),r>>=i,a-=i,{id:1<<32-UI(t)+a|n<<a|r,overflow:o+e}}return{id:1<<o|n<<a|r,overflow:e}}var UI=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-($I(e)/GI|0)|0},$I=Math.log,GI=Math.LN2;var VI=Error(BT(460));function qI(){}var WI=null;function YI(){if(null===WI)throw Error(BT(459));var e=WI;return WI=null,e}var KI="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},XI=null,QI=null,ZI=null,JI=null,eR=null,tR=null,nR=!1,rR=!1,aR=0,oR=0,iR=-1,sR=0,lR=null,cR=null,uR=0;function dR(){if(null===XI)throw Error(BT(321));return XI}function pR(){if(0<uR)throw Error(BT(312));return{memoizedState:null,queue:null,next:null}}function hR(){return null===tR?null===eR?(nR=!1,eR=tR=pR()):(nR=!0,tR=eR):null===tR.next?(nR=!1,tR=tR.next=pR()):(nR=!0,tR=tR.next),tR}function fR(){var e=lR;return lR=null,e}function mR(){JI=ZI=QI=XI=null,rR=!1,eR=null,uR=0,tR=cR=null}function gR(e,t){return"function"==typeof t?t(e):t}function yR(e,t,n){if(XI=dR(),tR=hR(),nR){var r=tR.queue;if(t=r.dispatch,null!==cR&&void 0!==(n=cR.get(r))){cR.delete(r),r=tR.memoizedState;do{r=e(r,n.action),n=n.next}while(null!==n);return tR.memoizedState=r,[r,t]}return[tR.memoizedState,t]}return e=e===gR?"function"==typeof t?t():t:void 0!==n?n(t):t,tR.memoizedState=e,e=(e=tR.queue={last:null,dispatch:null}).dispatch=vR.bind(null,XI,e),[tR.memoizedState,e]}function bR(e,t){if(XI=dR(),t=void 0===t?null:t,null!==(tR=hR())){var n=tR.memoizedState;if(null!==n&&null!==t){var r=n[1];e:if(null===r)r=!1;else{for(var a=0;a<r.length&&a<t.length;a++)if(!KI(t[a],r[a])){r=!1;break e}r=!0}if(r)return n[0]}}return e=e(),tR.memoizedState=[e,t],e}function vR(e,t,n){if(25<=uR)throw Error(BT(301));if(e===XI)if(rR=!0,e={action:n,next:null},null===cR&&(cR=new Map),void 0===(n=cR.get(t)))cR.set(t,e);else{for(t=n;null!==t.next;)t=t.next;t.next=e}}function kR(){throw Error(BT(394))}function wR(){throw Error(BT(479))}function xR(e,t,n){dR();var r=oR++,a=ZI;if("function"==typeof e.$$FORM_ACTION){var o=null,i=JI;a=a.formState;var s=e.$$IS_SIGNATURE_EQUAL;if(null!==a&&"function"==typeof s){var l=a[1];s.call(e,a[2],a[3])&&(l===(o=void 0!==n?"p"+n:"k"+iC(JSON.stringify([i,null,r]),0))&&(iR=r,t=a[0]))}var c=e.bind(null,t);return e=function(e){c(e)},"function"==typeof c.$$FORM_ACTION&&(e.$$FORM_ACTION=function(e){e=c.$$FORM_ACTION(e),void 0!==n&&(n+="",e.action=n);var t=e.data;return t&&(null===o&&(o=void 0!==n?"p"+n:"k"+iC(JSON.stringify([i,null,r]),0)),t.append("$ACTION_KEY",o)),e}),[t,e,!1]}var u=e.bind(null,t);return[t,function(e){u(e)},!1]}function ER(e){var t=sR;return sR+=1,null===lR&&(lR=[]),function(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(qI,qI),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch("string"==typeof t.status?t.then(qI,qI):((e=t).status="pending",e.then((function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}}),(function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}}))),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}throw WI=t,VI}}(lR,e,t)}function _R(){throw Error(BT(393))}function SR(){}var TR={readContext:function(e){return e._currentValue},use:function(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return ER(e);if(e.$$typeof===WT)return e._currentValue}throw Error(BT(438,String(e)))},useContext:function(e){return dR(),e._currentValue},useMemo:bR,useReducer:yR,useRef:function(e){XI=dR();var t=(tR=hR()).memoizedState;return null===t?(e={current:e},tR.memoizedState=e):t},useState:function(e){return yR(gR,e)},useInsertionEffect:SR,useLayoutEffect:SR,useCallback:function(e,t){return bR((function(){return e}),t)},useImperativeHandle:SR,useEffect:SR,useDebugValue:SR,useDeferredValue:function(e,t){return dR(),void 0!==t?t:e},useTransition:function(){return dR(),[!1,kR]},useId:function(){var e=QI.treeContext,t=e.overflow;e=((e=e.id)&~(1<<32-UI(e)-1)).toString(32)+t;var n=NR;if(null===n)throw Error(BT(404));return t=aR++,e=":"+n.idPrefix+"R"+e,0<t&&(e+="H"+t.toString(32)),e+":"},useSyncExternalStore:function(e,t,n){if(void 0===n)throw Error(BT(407));return n()},useCacheRefresh:function(){return _R},useMemoCache:function(e){for(var t=Array(e),n=0;n<e;n++)t[n]=rC;return t},useHostTransitionStatus:function(){return dR(),jC},useOptimistic:function(e){return dR(),[e,wR]}};TR.useFormState=xR,TR.useActionState=xR;var CR,AR,NR=null,IR={getCacheForType:function(){throw Error(BT(248))}};function RR(e){if(void 0===CR)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);CR=t&&t[1]||"",AR=-1<n.stack.indexOf("\n at")?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+CR+e+AR}var OR=!1;function PR(e,t){if(!e||OR)return"";OR=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(a){var r=a}Reflect.construct(e,[],n)}else{try{n.call()}catch(o){r=o}e.call(n.prototype)}}else{try{throw Error()}catch(i){r=i}(n=e())&&"function"==typeof n.catch&&n.catch((function(){}))}}catch(s){if(s&&r&&"string"==typeof s.stack)return[s.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=r.DetermineComponentFrameRoot(),i=o[0],s=o[1];if(i&&s){var l=i.split("\n"),c=s.split("\n");for(a=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;a<c.length&&!c[a].includes("DetermineComponentFrameRoot");)a++;if(r===l.length||a===c.length)for(r=l.length-1,a=c.length-1;1<=r&&0<=a&&l[r]!==c[a];)a--;for(;1<=r&&0<=a;r--,a--)if(l[r]!==c[a]){if(1!==r||1!==a)do{if(r--,0>--a||l[r]!==c[a]){var u="\n"+l[r].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}}while(1<=r&&0<=a);break}}}finally{OR=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?RR(n):""}function LR(e){if("string"==typeof e)return RR(e);if("function"==typeof e)return e.prototype&&e.prototype.isReactComponent?e=PR(e,!0):PR(e,!1);if("object"==typeof e&&null!==e){switch(e.$$typeof){case YT:return PR(e.render,!1);case QT:return PR(e.type,!1);case ZT:var t=e,n=t._payload;t=t._init;try{e=t(n)}catch(r){return RR("Lazy")}return LR(e)}if("string"==typeof e.name)return n=e.env,RR(e.name+(n?" ["+n+"]":""))}switch(e){case XT:return RR("SuspenseList");case KT:return RR("Suspense")}return""}function DR(e){if("object"==typeof e&&null!==e&&"string"==typeof e.environmentName){var t=e.environmentName;"string"==typeof(e=[e].slice(0))[0]?e.splice(0,1,"%c%s%c "+e[0],"background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px"," "+t+" ",""):e.splice(0,0,"%c%s%c ","background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px"," "+t+" ",""),e.unshift(console),(t=AI.apply(console.error,e))()}else console.error(e);return null}function MR(){}function FR(e,t,n,r,a,o,i,s,l,c,u){var d=new Set;this.destination=null,this.flushScheduled=!1,this.resumableState=e,this.renderState=t,this.rootFormatContext=n,this.progressiveChunkSize=void 0===r?12800:r,this.status=10,this.fatalError=null,this.pendingRootTasks=this.allPendingTasks=this.nextSegmentId=0,this.completedRootSegment=null,this.abortableTasks=d,this.pingedTasks=[],this.clientRenderedBoundaries=[],this.completedBoundaries=[],this.partialBoundaries=[],this.trackedPostpones=null,this.onError=void 0===a?DR:a,this.onPostpone=void 0===c?MR:c,this.onAllReady=void 0===o?MR:o,this.onShellReady=void 0===i?MR:i,this.onShellError=void 0===s?MR:s,this.onFatalError=void 0===l?MR:l,this.formState=void 0===u?null:u}function jR(e,t,n,r,a,o,i,s,l,c,u,d){return(n=qR(t=new FR(t,n,r,a,o,i,s,l,c,u,d),0,null,r,!1,!1)).parentFlushed=!0,WR(e=GR(t,null,e,-1,null,n,null,t.abortableTasks,null,r,null,zI,null,!1)),t.pingedTasks.push(e),t}var BR,zR,HR=null;function UR(e,t){e.pingedTasks.push(t),1===e.pingedTasks.length&&(e.flushScheduled=null!==e.destination,null!==e.trackedPostpones||10===e.status?pC((function(){return gO(e)})):cC((function(){return gO(e)})))}function $R(e,t){return{status:0,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,completedSegments:[],byteSize:0,fallbackAbortableTasks:t,errorDigest:null,contentState:vI(),fallbackState:vI(),trackedContentKeyPath:null,trackedFallbackNode:null}}function GR(e,t,n,r,a,o,i,s,l,c,u,d,p,h){e.allPendingTasks++,null===a?e.pendingRootTasks++:a.pendingTasks++;var f={replay:null,node:n,childIndex:r,ping:function(){return UR(e,f)},blockedBoundary:a,blockedSegment:o,hoistableState:i,abortSet:s,keyPath:l,formatContext:c,context:u,treeContext:d,componentStack:p,thenableState:t,isFallback:h};return s.add(f),f}function VR(e,t,n,r,a,o,i,s,l,c,u,d,p,h){e.allPendingTasks++,null===o?e.pendingRootTasks++:o.pendingTasks++,n.pendingTasks++;var f={replay:n,node:r,childIndex:a,ping:function(){return UR(e,f)},blockedBoundary:o,blockedSegment:null,hoistableState:i,abortSet:s,keyPath:l,formatContext:c,context:u,treeContext:d,componentStack:p,thenableState:t,isFallback:h};return s.add(f),f}function qR(e,t,n,r,a,o){return{status:0,id:-1,index:t,parentFlushed:!1,chunks:[],children:[],parentFormatContext:r,boundary:n,lastPushedText:a,textEmbedded:o}}function WR(e){var t=e.node;if("object"==typeof t&&null!==t&&t.$$typeof===zT)e.componentStack={parent:e.componentStack,type:t.type}}function YR(e){var t={};return e&&Object.defineProperty(t,"componentStack",{configurable:!0,enumerable:!0,get:function(){try{var n="",r=e;do{n+=LR(r.type),r=r.parent}while(r);var a=n}catch(o){a="\nError generating stack: "+o.message+"\n"+o.stack}return Object.defineProperty(t,"componentStack",{value:a}),a}}),t}function KR(e,t,n){if(null==(t=(e=e.onError)(t,n))||"string"==typeof t)return t}function XR(e,t){var n=e.onShellError,r=e.onFatalError;n(t),r(t),null!==e.destination?(e.status=14,wC(e.destination,t)):(e.status=13,e.fatalError=t)}function QR(e,t,n,r,a,o){var i=t.thenableState;for(t.thenableState=null,XI={},QI=t,ZI=e,JI=n,oR=aR=0,iR=-1,sR=0,lR=i,e=r(a,o);rR;)rR=!1,oR=aR=0,iR=-1,sR=0,uR+=1,tR=null,e=r(a,o);return mR(),e}function ZR(e,t,n,r,a,o,i){var s=!1;if(0!==o&&null!==e.formState){var l=t.blockedSegment;if(null!==l){s=!0,l=l.chunks;for(var c=0;c<o;c++)c===i?l.push(IA):l.push(RA)}}o=t.keyPath,t.keyPath=n,a?(n=t.treeContext,t.treeContext=HI(n,1,0),sO(e,t,r,-1),t.treeContext=n):s?sO(e,t,r,-1):tO(e,t,r,-1),t.keyPath=o}function JR(e,t,n,r,a,o){if("function"==typeof r)if(r.prototype&&r.prototype.isReactComponent){var i=a;if("ref"in a)for(var s in i={},a)"ref"!==s&&(i[s]=a[s]);var l=r.defaultProps;if(l)for(var c in i===a&&(i=xC({},i,a)),l)void 0===i[c]&&(i[c]=l[c]);a=i,i=RI,"object"==typeof(l=r.contextType)&&null!==l&&(i=l._currentValue);var u=void 0!==(i=new r(a,i)).state?i.state:null;if(i.updater=BI,i.props=a,i.state=u,l={queue:[],replace:!1},i._reactInternals=l,o=r.contextType,i.context="object"==typeof o&&null!==o?o._currentValue:RI,"function"==typeof(o=r.getDerivedStateFromProps)&&(u=null==(o=o(a,u))?u:xC({},u,o),i.state=u),"function"!=typeof r.getDerivedStateFromProps&&"function"!=typeof i.getSnapshotBeforeUpdate&&("function"==typeof i.UNSAFE_componentWillMount||"function"==typeof i.componentWillMount))if(r=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),r!==i.state&&BI.enqueueReplaceState(i,i.state,null),null!==l.queue&&0<l.queue.length)if(r=l.queue,o=l.replace,l.queue=null,l.replace=!1,o&&1===r.length)i.state=r[0];else{for(l=o?r[0]:i.state,u=!0,o=o?1:0;o<r.length;o++)null!=(c="function"==typeof(c=r[o])?c.call(i,l,a,void 0):c)&&(u?(u=!1,l=xC({},l,c)):xC(l,c));i.state=l}else l.queue=null;if(r=i.render(),12===e.status)throw null;a=t.keyPath,t.keyPath=n,tO(e,t,r,-1),t.keyPath=a}else{if(r=QR(e,t,n,r,a,void 0),12===e.status)throw null;ZR(e,t,n,r,0!==aR,oR,iR)}else{if("string"!=typeof r){switch(r){case nC:case eC:case $T:case GT:case UT:return r=t.keyPath,t.keyPath=n,tO(e,t,a.children,-1),void(t.keyPath=r);case tC:return void("hidden"!==a.mode&&(r=t.keyPath,t.keyPath=n,tO(e,t,a.children,-1),t.keyPath=r));case XT:return r=t.keyPath,t.keyPath=n,tO(e,t,a.children,-1),void(t.keyPath=r);case JT:throw Error(BT(343));case KT:e:if(null!==t.replay){r=t.keyPath,t.keyPath=n,n=a.children;try{sO(e,t,n,-1)}finally{t.keyPath=r}}else{r=t.keyPath;var d=t.blockedBoundary,p=t.hoistableState;o=t.blockedSegment,c=a.fallback,a=a.children;var h=new Set;s=$R(0,h),null!==e.trackedPostpones&&(s.trackedContentKeyPath=n);var f=qR(0,o.chunks.length,s,t.formatContext,!1,!1);o.children.push(f),o.lastPushedText=!1;var m=qR(0,0,null,t.formatContext,!1,!1);if(m.parentFlushed=!0,null!==e.trackedPostpones){l=[(i=[n[0],"Suspense Fallback",n[2]])[1],i[2],[],null],e.trackedPostpones.workingMap.set(i,l),s.trackedFallbackNode=l,t.blockedSegment=f,t.keyPath=i,f.status=6;try{sO(e,t,c,-1),f.lastPushedText&&f.textEmbedded&&f.chunks.push(aA),f.status=1}catch(g){throw f.status=12===e.status?3:4,g}finally{t.blockedSegment=o,t.keyPath=r}WR(t=GR(e,null,a,-1,s,m,s.contentState,t.abortSet,n,t.formatContext,t.context,t.treeContext,t.componentStack,t.isFallback)),e.pingedTasks.push(t)}else{t.blockedBoundary=s,t.hoistableState=s.contentState,t.blockedSegment=m,t.keyPath=n,m.status=6;try{if(sO(e,t,a,-1),m.lastPushedText&&m.textEmbedded&&m.chunks.push(aA),m.status=1,fO(s,m),0===s.pendingTasks&&0===s.status){s.status=1;break e}}catch(y){s.status=4,12===e.status?(m.status=3,i=e.fatalError):(m.status=4,i=y),u=KR(e,i,l=YR(t.componentStack)),s.errorDigest=u,aO(e,s)}finally{t.blockedBoundary=d,t.hoistableState=p,t.blockedSegment=o,t.keyPath=r}WR(t=GR(e,null,c,-1,d,f,s.fallbackState,h,[n[0],"Suspense Fallback",n[2]],t.formatContext,t.context,t.treeContext,t.componentStack,!0)),e.pingedTasks.push(t)}}return}if("object"==typeof r&&null!==r)switch(r.$$typeof){case YT:if("ref"in a)for(f in i={},a)"ref"!==f&&(i[f]=a[f]);else i=a;return void ZR(e,t,n,r=QR(e,t,n,r.render,i,o),0!==aR,oR,iR);case QT:return void JR(e,t,n,r.type,a,o);case VT:case WT:if(l=a.children,i=t.keyPath,a=a.value,u=r._currentValue,r._currentValue=a,OI=r={parent:o=OI,depth:null===o?0:o.depth+1,context:r,parentValue:u,value:a},t.context=r,t.keyPath=n,tO(e,t,l,-1),null===(e=OI))throw Error(BT(403));return e.context._currentValue=e.parentValue,e=OI=e.parent,t.context=e,void(t.keyPath=i);case qT:return r=(a=a.children)(r._context._currentValue),a=t.keyPath,t.keyPath=n,tO(e,t,r,-1),void(t.keyPath=a);case ZT:if(r=(i=r._init)(r._payload),12===e.status)throw null;return void JR(e,t,n,r,a,o)}throw Error(BT(130,null==r?r:typeof r,""))}if(null===(i=t.blockedSegment))i=a.children,l=t.formatContext,u=t.keyPath,t.formatContext=rA(l,r,a),t.keyPath=n,sO(e,t,i,-1),t.formatContext=l,t.keyPath=u;else{u=GA(i.chunks,r,a,e.resumableState,e.renderState,t.hoistableState,t.formatContext,i.lastPushedText,t.isFallback),i.lastPushedText=!1,l=t.formatContext,o=t.keyPath,t.formatContext=rA(l,r,a),t.keyPath=n,sO(e,t,u,-1),t.formatContext=l,t.keyPath=o;e:{switch(t=i.chunks,e=e.resumableState,r){case"title":case"style":case"script":case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break e;case"body":if(1>=l.insertionMode){e.hasBody=!0;break e}break;case"html":if(0===l.insertionMode){e.hasHtml=!0;break e}}t.push(qA(r))}i.lastPushedText=!1}}}function eO(e,t,n,r,a){var o=t.replay,i=t.blockedBoundary,s=qR(0,0,null,t.formatContext,!1,!1);s.id=n,s.parentFlushed=!0;try{t.replay=null,t.blockedSegment=s,sO(e,t,r,a),s.status=1,null===i?e.completedRootSegment=s:(fO(i,s),i.parentFlushed&&e.partialBoundaries.push(i))}finally{t.replay=o,t.blockedSegment=null}}function tO(e,t,n,r){null!==t.replay&&"number"==typeof t.replay.slots?eO(e,t,t.replay.slots,n,r):(t.node=n,t.childIndex=r,n=t.componentStack,WR(t),nO(e,t),t.componentStack=n)}function nO(e,t){var n=t.node,r=t.childIndex;if(null!==n){if("object"==typeof n){switch(n.$$typeof){case zT:var a=n.type,o=n.key,i=n.props,s=void 0!==(n=i.ref)?n:null,l=II(a),c=null==o?-1===r?0:r:o;if(o=[t.keyPath,l,c],null!==t.replay)e:{var u=t.replay;for(r=u.nodes,n=0;n<r.length;n++){var d=r[n];if(c===d[1]){if(4===d.length){if(null!==l&&l!==d[0])throw Error(BT(490,d[0],l));var p=d[2];l=d[3],c=t.node,t.replay={nodes:p,slots:l,pendingTasks:1};try{if(JR(e,t,o,a,i,s),1===t.replay.pendingTasks&&0<t.replay.nodes.length)throw Error(BT(488));t.replay.pendingTasks--}catch(k){if("object"==typeof k&&null!==k&&(k===VI||"function"==typeof k.then))throw t.node===c&&(t.replay=u),k;t.replay.pendingTasks--,i=YR(t.componentStack),cO(e,o=t.blockedBoundary,p,l,a=k,i=KR(e,a,i))}t.replay=u}else{if(a!==KT)throw Error(BT(490,"Suspense",II(a)||"Unknown"));t:{u=void 0,a=d[5],s=d[2],l=d[3],c=null===d[4]?[]:d[4][2],d=null===d[4]?null:d[4][3];var h=t.keyPath,f=t.replay,m=t.blockedBoundary,g=t.hoistableState,y=i.children;i=i.fallback;var b=new Set,v=$R(0,b);v.parentFlushed=!0,v.rootSegmentID=a,t.blockedBoundary=v,t.hoistableState=v.contentState,t.keyPath=o,t.replay={nodes:s,slots:l,pendingTasks:1};try{if(sO(e,t,y,-1),1===t.replay.pendingTasks&&0<t.replay.nodes.length)throw Error(BT(488));if(t.replay.pendingTasks--,0===v.pendingTasks&&0===v.status){v.status=1,e.completedBoundaries.push(v);break t}}catch(w){v.status=4,u=KR(e,w,p=YR(t.componentStack)),v.errorDigest=u,t.replay.pendingTasks--,e.clientRenderedBoundaries.push(v)}finally{t.blockedBoundary=m,t.hoistableState=g,t.replay=f,t.keyPath=h}WR(t=VR(e,null,{nodes:c,slots:d,pendingTasks:0},i,-1,m,v.fallbackState,b,[o[0],"Suspense Fallback",o[2]],t.formatContext,t.context,t.treeContext,t.componentStack,!0)),e.pingedTasks.push(t)}}r.splice(n,1);break e}}}else JR(e,t,o,a,i,s);return;case HT:throw Error(BT(257));case ZT:if(n=(p=n._init)(n._payload),12===e.status)throw null;return void tO(e,t,n,r)}if(oC(n))return void rO(e,t,n,r);if(null===n||"object"!=typeof n?p=null:p="function"==typeof(p=aC&&n[aC]||n["@@iterator"])?p:null,p&&(p=p.call(n))){if(!(n=p.next()).done){i=[];do{i.push(n.value),n=p.next()}while(!n.done);rO(e,t,i,r)}return}if("function"==typeof n.then)return t.thenableState=null,tO(e,t,ER(n),r);if(n.$$typeof===WT)return tO(e,t,n._currentValue,r);throw r=Object.prototype.toString.call(n),Error(BT(31,"[object Object]"===r?"object with keys {"+Object.keys(n).join(", ")+"}":r))}"string"==typeof n?null!==(r=t.blockedSegment)&&(r.lastPushedText=oA(r.chunks,n,e.renderState,r.lastPushedText)):"number"!=typeof n&&"bigint"!=typeof n||null!==(r=t.blockedSegment)&&(r.lastPushedText=oA(r.chunks,""+n,e.renderState,r.lastPushedText))}}function rO(e,t,n,r){var a=t.keyPath;if(-1===r||(t.keyPath=[t.keyPath,"Fragment",r],null===t.replay)){if(o=t.treeContext,i=n.length,null!==t.replay&&(null!==(s=t.replay.slots)&&"object"==typeof s)){for(r=0;r<i;r++)l=n[r],t.treeContext=HI(o,i,r),"number"==typeof(c=s[r])?(eO(e,t,c,l,r),delete s[r]):sO(e,t,l,r);return t.treeContext=o,void(t.keyPath=a)}for(s=0;s<i;s++)r=n[s],t.treeContext=HI(o,i,s),sO(e,t,r,s);t.treeContext=o,t.keyPath=a}else{for(var o=t.replay,i=o.nodes,s=0;s<i.length;s++){var l=i[s];if(l[1]===r){r=l[2],l=l[3],t.replay={nodes:r,slots:l,pendingTasks:1};try{if(rO(e,t,n,-1),1===t.replay.pendingTasks&&0<t.replay.nodes.length)throw Error(BT(488));t.replay.pendingTasks--}catch(u){if("object"==typeof u&&null!==u&&(u===VI||"function"==typeof u.then))throw u;t.replay.pendingTasks--,n=YR(t.componentStack);var c=t.blockedBoundary;cO(e,c,r,l,u,n=KR(e,u,n))}t.replay=o,i.splice(s,1);break}}t.keyPath=a}}function aO(e,t){null!==(e=e.trackedPostpones)&&(null!==(t=t.trackedContentKeyPath)&&(void 0!==(t=e.workingMap.get(t))&&(t.length=4,t[2]=[],t[3]=null)))}function oO(e,t,n){return VR(e,n,t.replay,t.node,t.childIndex,t.blockedBoundary,t.hoistableState,t.abortSet,t.keyPath,t.formatContext,t.context,t.treeContext,t.componentStack,t.isFallback)}function iO(e,t,n){var r=t.blockedSegment,a=qR(0,r.chunks.length,null,t.formatContext,r.lastPushedText,!0);return r.children.push(a),r.lastPushedText=!1,GR(e,n,t.node,t.childIndex,t.blockedBoundary,a,t.hoistableState,t.abortSet,t.keyPath,t.formatContext,t.context,t.treeContext,t.componentStack,t.isFallback)}function sO(e,t,n,r){var a=t.formatContext,o=t.context,i=t.keyPath,s=t.treeContext,l=t.componentStack,c=t.blockedSegment;if(null===c)try{return tO(e,t,n,r)}catch(p){if(mR(),"object"==typeof(n=p===VI?YI():p)&&null!==n){if("function"==typeof n.then)return e=oO(e,t,r=fR()).ping,n.then(e,e),t.formatContext=a,t.context=o,t.keyPath=i,t.treeContext=s,t.componentStack=l,void jI(o);if("Maximum call stack size exceeded"===n.message)return n=oO(e,t,n=fR()),e.pingedTasks.push(n),t.formatContext=a,t.context=o,t.keyPath=i,t.treeContext=s,t.componentStack=l,void jI(o)}}else{var u=c.children.length,d=c.chunks.length;try{return tO(e,t,n,r)}catch(h){if(mR(),c.children.length=u,c.chunks.length=d,"object"==typeof(n=h===VI?YI():h)&&null!==n){if("function"==typeof n.then)return e=iO(e,t,r=fR()).ping,n.then(e,e),t.formatContext=a,t.context=o,t.keyPath=i,t.treeContext=s,t.componentStack=l,void jI(o);if("Maximum call stack size exceeded"===n.message)return n=iO(e,t,n=fR()),e.pingedTasks.push(n),t.formatContext=a,t.context=o,t.keyPath=i,t.treeContext=s,t.componentStack=l,void jI(o)}}}throw t.formatContext=a,t.context=o,t.keyPath=i,t.treeContext=s,jI(o),n}function lO(e){var t=e.blockedBoundary;null!==(e=e.blockedSegment)&&(e.status=3,mO(this,t,e))}function cO(e,t,n,r,a,o){for(var i=0;i<n.length;i++){var s=n[i];if(4===s.length)cO(e,t,s[2],s[3],a,o);else{s=s[5];var l=e,c=o,u=$R(0,new Set);u.parentFlushed=!0,u.rootSegmentID=s,u.status=4,u.errorDigest=c,u.parentFlushed&&l.clientRenderedBoundaries.push(u)}}if(n.length=0,null!==r){if(null===t)throw Error(BT(487));if(4!==t.status&&(t.status=4,t.errorDigest=o,t.parentFlushed&&e.clientRenderedBoundaries.push(t)),"object"==typeof r)for(var d in r)delete r[d]}}function uO(e,t,n){var r=e.blockedBoundary,a=e.blockedSegment;if(null!==a){if(6===a.status)return;a.status=3}if(a=YR(e.componentStack),null===r){if(13!==t.status&&14!==t.status){if(null===(r=e.replay))return KR(t,n,a),void XR(t,n);r.pendingTasks--,0===r.pendingTasks&&0<r.nodes.length&&(e=KR(t,n,a),cO(t,null,r.nodes,r.slots,n,e)),t.pendingRootTasks--,0===t.pendingRootTasks&&pO(t)}}else r.pendingTasks--,4!==r.status&&(r.status=4,e=KR(t,n,a),r.status=4,r.errorDigest=e,aO(t,r),r.parentFlushed&&t.clientRenderedBoundaries.push(r)),r.fallbackAbortableTasks.forEach((function(e){return uO(e,t,n)})),r.fallbackAbortableTasks.clear();t.allPendingTasks--,0===t.allPendingTasks&&hO(t)}function dO(e,t){try{var n=e.renderState,r=n.onHeaders;if(r){var a=n.headers;if(a){n.headers=null;var o=a.preconnects;if(a.fontPreloads&&(o&&(o+=", "),o+=a.fontPreloads),a.highImagePreloads&&(o&&(o+=", "),o+=a.highImagePreloads),!t){var i=n.styles.values(),s=i.next();e:for(;0<a.remainingCapacity&&!s.done;s=i.next())for(var l=s.value.sheets.values(),c=l.next();0<a.remainingCapacity&&!c.done;c=l.next()){var u=c.value,d=u.props,p=d.href,h=u.props,f=wI(h.href,"style",{crossOrigin:h.crossOrigin,integrity:h.integrity,nonce:h.nonce,type:h.type,fetchPriority:h.fetchPriority,referrerPolicy:h.referrerPolicy,media:h.media});if(!(0<=(a.remainingCapacity-=f.length+2)))break e;n.resets.style[p]=zC,o&&(o+=", "),o+=f,n.resets.style[p]="string"==typeof d.crossOrigin||"string"==typeof d.integrity?[d.crossOrigin,d.integrity]:zC}}r(o?{Link:o}:{})}}}catch(m){KR(e,m,{})}}function pO(e){null===e.trackedPostpones&&dO(e,!0),e.onShellError=MR,(e=e.onShellReady)()}function hO(e){dO(e,null===e.trackedPostpones||(null===e.completedRootSegment||5!==e.completedRootSegment.status)),(e=e.onAllReady)()}function fO(e,t){if(0===t.chunks.length&&1===t.children.length&&null===t.children[0].boundary&&-1===t.children[0].id){var n=t.children[0];n.id=t.id,n.parentFlushed=!0,1===n.status&&fO(e,n)}else e.completedSegments.push(t)}function mO(e,t,n){if(null===t){if(null!==n&&n.parentFlushed){if(null!==e.completedRootSegment)throw Error(BT(389));e.completedRootSegment=n}e.pendingRootTasks--,0===e.pendingRootTasks&&pO(e)}else t.pendingTasks--,4!==t.status&&(0===t.pendingTasks?(0===t.status&&(t.status=1),null!==n&&n.parentFlushed&&1===n.status&&fO(t,n),t.parentFlushed&&e.completedBoundaries.push(t),1===t.status&&(t.fallbackAbortableTasks.forEach(lO,e),t.fallbackAbortableTasks.clear())):null!==n&&n.parentFlushed&&1===n.status&&(fO(t,n),1===t.completedSegments.length&&t.parentFlushed&&e.partialBoundaries.push(t)));e.allPendingTasks--,0===e.allPendingTasks&&hO(e)}function gO(e){if(14!==e.status&&13!==e.status){var t=OI,n=MC.H;MC.H=TR;var r=MC.A;MC.A=IR;var a=HR;HR=e;var o=NR;NR=e.resumableState;try{var i,s=e.pingedTasks;for(i=0;i<s.length;i++){var l=s[i],c=e,u=l.blockedSegment;if(null===u){var d=c;if(0!==l.replay.pendingTasks){jI(l.context);try{if("number"==typeof l.replay.slots?eO(d,l,l.replay.slots,l.node,l.childIndex):nO(d,l),1===l.replay.pendingTasks&&0<l.replay.nodes.length)throw Error(BT(488));l.replay.pendingTasks--,l.abortSet.delete(l),mO(d,l.blockedBoundary,null)}catch(_){mR();var p=_===VI?YI():_;if("object"==typeof p&&null!==p&&"function"==typeof p.then){var h=l.ping;p.then(h,h),l.thenableState=fR()}else{l.replay.pendingTasks--,l.abortSet.delete(l);var f=YR(l.componentStack);c=void 0;var m=d,g=l.blockedBoundary,y=12===d.status?d.fatalError:p;cO(m,g,l.replay.nodes,l.replay.slots,y,c=KR(m,y,f)),d.pendingRootTasks--,0===d.pendingRootTasks&&pO(d),d.allPendingTasks--,0===d.allPendingTasks&&hO(d)}}}}else if(d=void 0,0===(m=u).status){m.status=6,jI(l.context);var b=m.children.length,v=m.chunks.length;try{nO(c,l),m.lastPushedText&&m.textEmbedded&&m.chunks.push(aA),l.abortSet.delete(l),m.status=1,mO(c,l.blockedBoundary,m)}catch(_){mR(),m.children.length=b,m.chunks.length=v;var k=_===VI?YI():12===c.status?c.fatalError:_;if("object"==typeof k&&null!==k&&"function"==typeof k.then){m.status=0,l.thenableState=fR();var w=l.ping;k.then(w,w)}else{var x=YR(l.componentStack);l.abortSet.delete(l),m.status=4;var E=l.blockedBoundary;d=KR(c,k,x),null===E?XR(c,k):(E.pendingTasks--,4!==E.status&&(E.status=4,E.errorDigest=d,aO(c,E),E.parentFlushed&&c.clientRenderedBoundaries.push(E))),c.allPendingTasks--,0===c.allPendingTasks&&hO(c)}}}}s.splice(0,i),null!==e.destination&&xO(e,e.destination)}catch(S){KR(e,S,{}),XR(e,S)}finally{NR=o,MC.H=n,MC.A=r,n===TR&&jI(t),HR=a}}}function yO(e,t,n,r){switch(n.parentFlushed=!0,n.status){case 0:n.id=e.nextSegmentId++;case 5:return r=n.id,n.lastPushedText=!1,n.textEmbedded=!1,e=e.renderState,mC(t,YA),mC(t,e.placeholderPrefix),mC(t,e=vC(r.toString(16))),gC(t,KA);case 1:n.status=2;var a=!0,o=n.chunks,i=0;n=n.children;for(var s=0;s<n.length;s++){for(a=n[s];i<a.index;i++)mC(t,o[i]);a=bO(e,t,a,r)}for(;i<o.length-1;i++)mC(t,o[i]);return i<o.length&&(a=gC(t,o[i])),a;default:throw Error(BT(390))}}function bO(e,t,n,r){var a=n.boundary;if(null===a)return yO(e,t,n,r);if(a.parentFlushed=!0,4===a.status)a=a.errorDigest,gC(t,JA),mC(t,tN),a&&(mC(t,rN),mC(t,vC(RC(a))),mC(t,nN)),gC(t,aN),yO(e,t,n,r);else if(1!==a.status)0===a.status&&(a.rootSegmentID=e.nextSegmentId++),0<a.completedSegments.length&&e.partialBoundaries.push(a),oN(t,e.renderState,a.rootSegmentID),r&&((a=a.fallbackState).styles.forEach(TI,r),a.stylesheets.forEach(CI,r)),yO(e,t,n,r);else if(a.byteSize>e.progressiveChunkSize)a.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(a),oN(t,e.renderState,a.rootSegmentID),yO(e,t,n,r);else{if(r&&((n=a.contentState).styles.forEach(TI,r),n.stylesheets.forEach(CI,r)),gC(t,XA),1!==(n=a.completedSegments).length)throw Error(BT(391));bO(e,t,n[0],r)}return gC(t,eN)}function vO(e,t,n,r){return function(e,t,n,r){switch(n.insertionMode){case 0:case 1:case 2:return mC(e,iN),mC(e,t.segmentPrefix),mC(e,vC(r.toString(16))),gC(e,sN);case 3:return mC(e,cN),mC(e,t.segmentPrefix),mC(e,vC(r.toString(16))),gC(e,uN);case 4:return mC(e,pN),mC(e,t.segmentPrefix),mC(e,vC(r.toString(16))),gC(e,hN);case 5:return mC(e,mN),mC(e,t.segmentPrefix),mC(e,vC(r.toString(16))),gC(e,gN);case 6:return mC(e,bN),mC(e,t.segmentPrefix),mC(e,vC(r.toString(16))),gC(e,vN);case 7:return mC(e,wN),mC(e,t.segmentPrefix),mC(e,vC(r.toString(16))),gC(e,xN);case 8:return mC(e,_N),mC(e,t.segmentPrefix),mC(e,vC(r.toString(16))),gC(e,SN);default:throw Error(BT(397))}}(t,e.renderState,n.parentFormatContext,n.id),bO(e,t,n,r),function(e,t){switch(t.insertionMode){case 0:case 1:case 2:return gC(e,lN);case 3:return gC(e,dN);case 4:return gC(e,fN);case 5:return gC(e,yN);case 6:return gC(e,kN);case 7:return gC(e,EN);case 8:return gC(e,TN);default:throw Error(BT(397))}}(t,n.parentFormatContext)}function kO(e,t,n){for(var r=n.completedSegments,a=0;a<r.length;a++)wO(e,t,n,r[a]);r.length=0,nI(t,n.contentState,e.renderState),r=e.resumableState,e=e.renderState,a=n.rootSegmentID,n=n.contentState;var o=e.stylesToHoist;return e.stylesToHoist=!1,mC(t,e.startInlineScript),o?2&r.instructions?8&r.instructions?mC(t,DN):(r.instructions|=8,mC(t,LN)):(r.instructions|=10,mC(t,PN)):2&r.instructions?mC(t,ON):(r.instructions|=2,mC(t,RN)),r=vC(a.toString(16)),mC(t,e.boundaryPrefix),mC(t,r),mC(t,MN),mC(t,e.segmentPrefix),mC(t,r),o?(mC(t,FN),function(e,t){mC(e,fI);var n=fI;t.stylesheets.forEach((function(t){if(2!==t.state)if(3===t.state)mC(e,n),mC(e,vC(WN(""+t.props.href))),mC(e,yI),n=mI;else{mC(e,n);var r=t.props["data-precedence"],a=t.props,o=DC(""+t.props.href);for(var i in mC(e,vC(WN(o))),r=""+r,mC(e,gI),mC(e,vC(WN(r))),a)if(EC.call(a,i)&&null!=(r=a[i]))switch(i){case"href":case"rel":case"precedence":case"data-precedence":break;case"children":case"dangerouslySetInnerHTML":throw Error(BT(399,"link"));default:bI(e,i,r)}mC(e,yI),n=mI,t.state=3}})),mC(e,yI)}(t,n)):mC(t,jN),n=gC(t,BN),WA(t,e)&&n}function wO(e,t,n,r){if(2===r.status)return!0;var a=n.contentState,o=r.id;if(-1===o){if(-1===(r.id=n.rootSegmentID))throw Error(BT(392));return vO(e,t,r,a)}return o===n.rootSegmentID?vO(e,t,r,a):(vO(e,t,r,a),n=e.resumableState,mC(t,(e=e.renderState).startInlineScript),1&n.instructions?mC(t,AN):(n.instructions|=1,mC(t,CN)),mC(t,e.segmentPrefix),mC(t,o=vC(o.toString(16))),mC(t,NN),mC(t,e.placeholderPrefix),mC(t,o),t=gC(t,IN))}function xO(e,t){hC=new Uint8Array(2048),fC=0;try{if(!(0<e.pendingRootTasks)){var n,r=e.completedRootSegment;if(null!==r){if(5===r.status)return;var a,o=e.renderState,i=o.htmlChunks,s=o.headChunks;if(i){for(a=0;a<i.length;a++)mC(t,i[a]);if(s)for(a=0;a<s.length;a++)mC(t,s[a]);else mC(t,UA("head")),mC(t,_A)}else if(s)for(a=0;a<s.length;a++)mC(t,s[a]);var l=o.charsetChunks;for(a=0;a<l.length;a++)mC(t,l[a]);l.length=0,o.preconnects.forEach(rI,t),o.preconnects.clear();var c=o.viewportChunks;for(a=0;a<c.length;a++)mC(t,c[a]);c.length=0,o.fontPreloads.forEach(rI,t),o.fontPreloads.clear(),o.highImagePreloads.forEach(rI,t),o.highImagePreloads.clear(),o.styles.forEach(dI,t);var u=o.importMapChunks;for(a=0;a<u.length;a++)mC(t,u[a]);u.length=0,o.bootstrapScripts.forEach(rI,t),o.scripts.forEach(rI,t),o.scripts.clear(),o.bulkPreloads.forEach(rI,t),o.bulkPreloads.clear();var d=o.hoistableChunks;for(a=0;a<d.length;a++)mC(t,d[a]);d.length=0,i&&null===s&&mC(t,qA("head")),bO(e,t,r,null),e.completedRootSegment=null,WA(t,e.renderState)}var p=e.renderState;r=0;var h=p.viewportChunks;for(r=0;r<h.length;r++)mC(t,h[r]);h.length=0,p.preconnects.forEach(rI,t),p.preconnects.clear(),p.fontPreloads.forEach(rI,t),p.fontPreloads.clear(),p.highImagePreloads.forEach(rI,t),p.highImagePreloads.clear(),p.styles.forEach(hI,t),p.scripts.forEach(rI,t),p.scripts.clear(),p.bulkPreloads.forEach(rI,t),p.bulkPreloads.clear();var f=p.hoistableChunks;for(r=0;r<f.length;r++)mC(t,f[r]);f.length=0;var m=e.clientRenderedBoundaries;for(n=0;n<m.length;n++){var g=m[n];p=t;var y=e.resumableState,b=e.renderState,v=g.rootSegmentID,k=g.errorDigest;mC(p,b.startInlineScript),4&y.instructions?mC(p,HN):(y.instructions|=4,mC(p,zN)),mC(p,b.boundaryPrefix),mC(p,vC(v.toString(16))),mC(p,UN),k&&(mC(p,$N),mC(p,vC((A=k||"",JSON.stringify(A).replace(VN,(function(e){switch(e){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}))))));var w=gC(p,GN);if(!w)return e.destination=null,n++,void m.splice(0,n)}m.splice(0,n);var x=e.completedBoundaries;for(n=0;n<x.length;n++)if(!kO(e,t,x[n]))return e.destination=null,n++,void x.splice(0,n);x.splice(0,n),yC(t),hC=new Uint8Array(2048),fC=0;var E=e.partialBoundaries;for(n=0;n<E.length;n++){var _=E[n];e:{m=e,g=t;var S=_.completedSegments;for(w=0;w<S.length;w++)if(!wO(m,g,_,S[w])){w++,S.splice(0,w);var T=!1;break e}S.splice(0,w),T=nI(g,_.contentState,m.renderState)}if(!T)return e.destination=null,n++,void E.splice(0,n)}E.splice(0,n);var C=e.completedBoundaries;for(n=0;n<C.length;n++)if(!kO(e,t,C[n]))return e.destination=null,n++,void C.splice(0,n);C.splice(0,n)}}finally{0===e.allPendingTasks&&0===e.pingedTasks.length&&0===e.clientRenderedBoundaries.length&&0===e.completedBoundaries.length?(e.flushScheduled=!1,(n=e.resumableState).hasBody&&mC(t,qA("body")),n.hasHtml&&mC(t,qA("html")),yC(t),e.status=14,t.close(),e.destination=null):yC(t)}var A}function EO(e){e.flushScheduled=null!==e.destination,pC((function(){return gO(e)})),cC((function(){10===e.status&&(e.status=11),null===e.trackedPostpones&&dO(e,0===e.pendingRootTasks)}))}function _O(e){!1===e.flushScheduled&&0===e.pingedTasks.length&&null!==e.destination&&(e.flushScheduled=!0,cC((function(){var t=e.destination;t?xO(e,t):e.flushScheduled=!1})))}function SO(e,t){if(13===e.status)e.status=14,wC(t,e.fatalError);else if(14!==e.status&&null===e.destination){e.destination=t;try{xO(e,t)}catch(n){KR(e,n,{}),XR(e,n)}}}function TO(e,t){11!==e.status&&10!==e.status||(e.status=12);try{var n=e.abortableTasks;if(0<n.size){var r=void 0===t?Error(BT(432)):"object"==typeof t&&null!==t&&"function"==typeof t.then?Error(BT(530)):t;e.fatalError=r,n.forEach((function(t){return uO(t,e,r)})),n.clear()}null!==e.destination&&xO(e,e.destination)}catch(a){KR(e,a,{}),XR(e,a)}}function CO(){var e=FT.version;if("19.0.0"!==e)throw Error(BT(527,e,"19.0.0"))}CO(),CO(),MT.prerender=function(e,t){return new Promise((function(n,r){var a,o=t?t.onHeaders:void 0;o&&(a=function(e){o(new Headers(e))});var i=eA(t?t.identifierPrefix:void 0,t&&t.unstable_externalRuntimeSrc,t?t.bootstrapScriptContent:void 0,t?t.bootstrapScripts:void 0,t?t.bootstrapModules:void 0),s=function(e,t,n,r,a,o,i,s,l,c,u){return(e=jR(e,t,n,r,a,o,i,s,l,c,u,void 0)).trackedPostpones={workingMap:new Map,rootNodes:[],rootSlots:null},e}(e,i,JC(i,void 0,t?t.unstable_externalRuntimeSrc:void 0,t?t.importMap:void 0,a,t?t.maxHeadersLength:void 0),nA(t?t.namespaceURI:void 0),t?t.progressiveChunkSize:void 0,t?t.onError:void 0,(function(){var e={prelude:new ReadableStream({type:"bytes",pull:function(e){SO(s,e)},cancel:function(e){s.destination=null,TO(s,e)}},{highWaterMark:0})};n(e)}),void 0,void 0,r,t?t.onPostpone:void 0);if(t&&t.signal){var l=t.signal;if(l.aborted)TO(s,l.reason);else{var c=function(){TO(s,l.reason),l.removeEventListener("abort",c)};l.addEventListener("abort",c)}}EO(s)}))},MT.renderToReadableStream=function(e,t){return new Promise((function(n,r){var a,o,i,s=new Promise((function(e,t){o=e,a=t})),l=t?t.onHeaders:void 0;l&&(i=function(e){l(new Headers(e))});var c=eA(t?t.identifierPrefix:void 0,t&&t.unstable_externalRuntimeSrc,t?t.bootstrapScriptContent:void 0,t?t.bootstrapScripts:void 0,t?t.bootstrapModules:void 0),u=jR(e,c,JC(c,t?t.nonce:void 0,t?t.unstable_externalRuntimeSrc:void 0,t?t.importMap:void 0,i,t?t.maxHeadersLength:void 0),nA(t?t.namespaceURI:void 0),t?t.progressiveChunkSize:void 0,t?t.onError:void 0,o,(function(){var e=new ReadableStream({type:"bytes",pull:function(e){SO(u,e)},cancel:function(e){u.destination=null,TO(u,e)}},{highWaterMark:0});e.allReady=s,n(e)}),(function(e){s.catch((function(){})),r(e)}),a,t?t.onPostpone:void 0,t?t.formState:void 0);if(t&&t.signal){var d=t.signal;if(d.aborted)TO(u,d.reason);else{var p=function(){TO(u,d.reason),d.removeEventListener("abort",p)};d.addEventListener("abort",p)}}EO(u)}))},MT.version="19.0.0",zR=MT,(BR=Wx).version;var AO=BR.renderToString;function NO({children:e="",...t}){let n="";return J.isValidElement(e)?n=AO(e):"string"==typeof e&&(n=e),Gh.jsx("template",{...t,dangerouslySetInnerHTML:{__html:n}})}function IO({root:e,children:t=null}){return ue.createPortal(t,e)}function RO(e){return Z.forwardRef((({mode:t="open",delegatesFocus:n=!1,styleSheets:r=[],ssr:a=!1,children:o=null,...i},s)=>{const l=function(e){const t=Z.useRef(null==e?void 0:e.current);return Z.useEffect((()=>{e&&(e.current=t.current)}),[e]),t}(s),[c,u]=Z.useState(null),d=`node_${t}${n}`;return Z.useLayoutEffect((()=>{if(l.current)try{if("function"==typeof s&&s(l.current),a){const{shadowRoot:e}=l.current;return void u(e)}const e=l.current.attachShadow({mode:t,delegatesFocus:n});r.length>0&&(e.adoptedStyleSheets=r),u(e)}catch(e){!function({error:e,styleSheets:t,root:n}){if("NotSupportedError"!==(null==e?void 0:e.name))throw e;t.length>0&&n&&(n.adoptedStyleSheets=t)}({error:e,styleSheets:r,root:c})}}),[s,l,r]),Gh.jsx(e.tag,{ref:l,...i,children:(c||a)&&Gh.jsx(qx.Provider,{value:c,children:a?Gh.jsx(NO,{shadowroot:t,shadowrootmode:t,children:e.render({root:c,ssr:a,children:o})}):Gh.jsx(IO,{root:c,children:e.render({root:c,ssr:a,children:o})})})},d)}))}BR.renderToStaticMarkup,zR.renderToReadableStream,zR.resume&&zR.resume;const OO=new Map;const PO=function(e={},t="core",n=({children:e})=>e){return new Proxy(e,{get:function(e,r){const a=Vx.decamelize(r,{separator:"-"}),o=`${t}-${a}`;if(!OO.has(o)){const e=RO({tag:a,render:n});OO.set(o,e)}return OO.get(o)}})}();var LO=(null==globalThis?void 0:globalThis.document)?Z.useLayoutEffect:()=>{},DO=ee[" useId ".trim().toString()]||(()=>{}),MO=0;function FO(e){const[t,n]=Z.useState(DO());return LO((()=>{n((e=>e??String(MO++)))}),[e]),t?`radix-${t}`:""}const jO=Z.createContext(void 0),BO=()=>Z.useContext(jO);function zO({wrapperStyles:e={},children:t,customStyles:n,styles:r}){const[a,o]=Z.useState(null),[i,s]=Z.useState(null),l=Z.useMemo((()=>({shadowHost:a,rootElement:i})),[a,i]),c=FO(),u=PO.div;return Gh.jsxs(u,{id:`inkeep-shadow${c}`,ref:e=>{e&&o(e)},style:e,children:[Gh.jsx("style",{type:"text/css",dangerouslySetInnerHTML:{__html:`@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&display=swap');\n ${r}`}}),n,Gh.jsx("div",{id:"inkeep-widget-root",ref:e=>{e&&s(e)},style:e,children:Gh.jsx(jO.Provider,{value:l,children:a&&i&&t})})]})}const HO=e=>BO()?e.children:Gh.jsx(zO,{...e}),UO="ChatButton",$O="CustomTrigger",GO="SearchBar",VO="EmbeddedChat",qO="EmbeddedSearch",WO="EmbeddedSearchAndChat",YO="IntelligentForm",KO="SidebarChat",XO={prefix:"ikp",aiChatSettings:{model:"inkeep-qa-expert",placeholder:"How do I get started?",aiAssistantName:void 0,shouldOpenLinksInNewTab:!0,disclaimerSettings:{isEnabled:!1,label:"Usage policy"},isShareButtonVisible:!1,isViewOnly:!1,exampleQuestionsLabel:"Example questions",exampleQuestions:[],isFirstExampleQuestionHighlighted:!0,isCopyChatButtonVisible:!1,getHelpOptions:[],workflowsHeader:"Workflows",workflows:[],toolbarButtonLabels:{clear:"Clear",share:"Share",getHelp:"Get help",stop:"Stop",copyChat:"Copy"},prompts:[]},baseSettings:Cx,searchSettings:{shouldOpenLinksInNewTab:!1,maxResults:40,defaultQuery:"",debounceTimeMs:0,tabs:["All","Publications","PDFs","GitHub","Forums","Discord","Slack","StackOverflow"],placeholder:"Search for anything...",view:"single-pane"},componentType:VO},QO=Z.createContext(XO),ZO=({children:e,value:t})=>{const n=BO(),r=(e,t,n)=>["baseSettings","searchSettings","aiChatSettings"].includes(n)&&!t?e:t,a={baseSettings:n??{}},o=Z.useMemo((()=>{const e=function(e,t,...n){return n.reduce(((t,n)=>c(t,n,e)),t)}(r,XO,a,t??{});return e.baseSettings.apiKey||console.warn("Inkeep API key is missing."),e}),[t]);return Gh.jsx(QO.Provider,{value:o,children:e})},JO=()=>{const e=Z.useContext(QO);if(!e)throw new Error("useInkeepConfig must be used within a ConfigProvider");return e},eP="conversationId",tP=Z.createContext(null),nP=({children:e})=>{const t=function(){const[e,t]=Z.useState(void 0),{aiChatSettings:n}=JO(),{shareChatUrlBasePath:r}=n;return Z.useEffect((()=>{if(!r||"undefined"==typeof window)return;const e=e=>e.endsWith("/")?e.slice(0,-1):e,n=()=>{const{origin:n,pathname:a,search:o}=window.location,i=new URL(r),s=e(a),l=e(i.pathname);if(n===i.origin&&s===l){const e=new URLSearchParams(o).get(eP);e&&t(e)}};n();const a=()=>n();return window.addEventListener("popstate",a),()=>{window.removeEventListener("popstate",a)}}),[r]),e}(),{aiChatSettings:n}=JO(),r=n.chatId||t,[a,o]=Z.useState(r);Z.useEffect((()=>{o(r)}),[r]);const i={id:"",messages:[]},[s,l]=Z.useState(i),c=()=>{l(i),o(void 0)},u=Z.useMemo((()=>({conversation:s,setConversation:l,chatId:a,resetConversation:c,setExternalChatId:o})),[s,a]);return Gh.jsx(tP.Provider,{value:u,children:e})},rP=()=>{const e=Z.useContext(tP);if(!e)throw new Error("useInkeepConversation must be used within an InkeepConversationProvider");return e};async function aP(e,t,n,r){try{const a=`${r}/conversations`,o={id:e||void 0,type:"openai",...t},i=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(o)});if(!i.ok){const e=await i.text();throw new Error(`Failed to log conversation: ${e}`)}return i.json()}catch(a){console.warn("Error in logConversation:",a)}}const oP="inkeepUsagePreferences",iP={defaultView:null,inkeepChatSessionId:null},sP={hasSwitchModeButtonJiggled:!1,userId:null,...iP},lP={set(e,t,n,r=365){try{if("cookie"===e){const e=new Date;void 0===n?(e.setTime(e.getTime()-1),document.cookie=`${oP}_${t}=; expires=${e.toUTCString()}; path=/`):(e.setTime(e.getTime()+24*r*60*60*1e3),document.cookie=`${oP}_${t}=${n}; expires=${e.toUTCString()}; path=/`)}else"undefined"!=typeof sessionStorage&&sessionStorage.setItem(`${oP}_${t}`,n?JSON.stringify(n):"")}catch(a){return null}},get(e,t){if("cookie"===e){const e=`${oP}_${t}=`,n=document.cookie.split(";");for(const t of n){const n=t.trim();if(n.startsWith(e))return n.substring(e.length)}return null}try{if("undefined"!=typeof sessionStorage){const e=sessionStorage.getItem(`${oP}_${t}`);return e?JSON.parse(e):null}}catch(n){return null}return null}},cP=()=>{const e=(()=>{try{if("undefined"==typeof localStorage)return!1;const e="__df709c5b-6651-43dc-94e7-d8dc899bf4e8__";return localStorage.setItem(e,"test_value"),localStorage.removeItem(e),!0}catch{return!1}})(),t=(()=>{if("undefined"==typeof document)return!1;document.cookie="testcookie=true; Path=/; Max-Age=1000";const e=document.cookie.includes("testcookie=true");return document.cookie="testcookie=; Path=/; Max-Age=-1000",e})();return e&&t},uP=Z.createContext(void 0),dP=({children:e})=>{const{baseSettings:{userProperties:t,privacyPreferences:n}}=JO(),{optOutAllAnalytics:r,optOutAnalyticalCookies:a}=n,{browserStorage:o,setBrowserStorage:i}=(()=>{const{baseSettings:e,componentType:t}=JO(),{optOutAllAnalytics:n,optOutFunctionalCookies:r}=e.privacyPreferences,a=n||r||!cP()?"sessionStorage":"cookie",o=`${e.apiKey}-${t}`,i=e=>e in iP?`${e}-${o}`:e,s=Object.keys(sP).reduce(((e,t)=>{const n=i(t),r=lP.get(a,n);return{...e,[t]:r}}),{...sP}),[l,c]=Z.useState(s);return Z.useEffect((()=>{if(r)for(const e of Object.keys(sP)){const t=i(e);lP.set("cookie",t,null,-1)}}),[r]),{browserStorage:l,setBrowserStorage:(e,t,n=365)=>{const r=i(e);lP.set(a,r,t,n),c((n=>({...n,[e]:t})))}}})(),s=Z.useMemo((()=>cP()),[]),l=Z.useMemo((()=>!r&&!a&&s),[r,a,s]),c=Z.useMemo((()=>{const e=r?"ANONYMOUS":t.id?"ID_PROVIDED":l?"COOKIED":"ANONYMOUS",n=r?void 0:t.id||l&&o.userId||Kh();return{identificationType:e,...r?{}:t,id:n}}),[t,r,l,o.userId]);return Z.useEffect((()=>{i("userId",l?c.id:void 0)}),[l,c.id]),Gh.jsx(uP.Provider,{value:{userProperties:c},children:e})},pP=()=>{const e=Z.useContext(uP);if(!e)throw new Error("useUser must be used within a UserProvider");return e};const hP=Z.createContext(void 0),fP=({children:e})=>{const{baseSettings:t,componentType:n}=JO(),{apiKey:r,analyticsApiBaseUrl:a,tags:o,privacyPreferences:i,env:s,analyticsProperties:l}=t,{userProperties:c}=pP(),u=Z.useMemo((()=>({widgetLibraryVersion:"0.5.89",componentType:n,tags:o})),[n,o]),d=!i.optOutAllAnalytics&&"development"!==s,p={logEvent:Z.useCallback((async e=>{var n,o;const i={...u,...e.properties,...l},s={eventName:e.eventName,properties:i,userProperties:c},p=["modal_opened","modal_closed"].includes(e.eventName);if(d&&!p){if("conversation"in i&&!(null==(n=i.conversation)?void 0:n.id))return;!async function(e,t,n){try{const r=`${n}/events`,a={...e,type:e.eventName};if("searchQuery"in e.properties)a.entityType="search",a.searchQuery=e.properties.searchQuery;else if("messageId"in e.properties)a.entityType="message",a.messageId=e.properties.messageId;else{if(a.entityType="conversation",!e.properties.conversation)return;a.conversationId=e.properties.conversation.id}const o=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(a)});if(!o.ok){const e=await o.text();throw new Error(`Failed to log event: ${e}`)}}catch(r){console.warn("Error in logEvent:",r)}}(s,r,a)}null==(o=t.onEvent)||o.call(t,s)}),[d,t,r,a,c,u,l])};return Gh.jsx(hP.Provider,{value:p,children:e})},mP=()=>{const e=Z.useContext(hP);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e},gP=Z.createContext(void 0),yP=({children:e})=>{const{baseSettings:t}=JO(),{apiKey:n,analyticsApiBaseUrl:r,tags:a,privacyPreferences:{optOutAllAnalytics:o},env:i,analyticsProperties:s}=t,{userProperties:l}=pP(),{logEvent:c}=mP(),{conversation:u,setConversation:d,chatId:p,setExternalChatId:h}=rP(),f=Z.useRef(u),m=Z.useRef(p);Z.useEffect((()=>{f.current=u}),[u]),Z.useEffect((()=>{m.current=p}),[p]);const g=Z.useCallback((async e=>{const t=f.current;m.current&&(t.id="",h(void 0),m.current=void 0);const c=!o&&"development"!==i;let u=Object.assign({},t,{messages:e});if(c){const o=await aP(t.id,{messages:e,tags:a,userProperties:l,properties:s},n,r);o&&(u=o)}else u.id="conv_"+Kh(16);return u}),[r,n,a,l,o,i,s,h]),y={logEvent:Z.useCallback((async(e,t)=>{let n=f.current;t&&(n=await g(t),d(n),f.current=n);const r={...e,properties:{conversation:n,...e.properties}};c(r)}),[c,g,o,i,s]),logConversation:g};return Gh.jsx(gP.Provider,{value:y,children:e})},bP=()=>{const e=Z.useContext(gP);if(!e)throw new Error("useChatEvents must be used within a ChatEventsProvider");return e};function vP(e){const{displayName:t,goals:n,informationToCollect:r,guidance:a,botPersona:o,context:i}=e,s=xP({title:"Guidance",content:[kP(a)],note:o,depth:2}),l=wP(null==r?void 0:r.filter((e=>e.required)).map((e=>e.description))),c=wP(null==r?void 0:r.filter((e=>!e.required)).map((e=>e.description))),u=xP({title:"Required",content:[l],note:"IMPORTANT: This information is REQUIRED for this workflow. If not provided in the conversation, prompt the user to provide it and don't otherwise answer their question.",depth:3}),d=xP({title:"Optional",content:[c],depth:3}),p=xP({title:"Information to collect",content:[u,d],note:"This is information that should be collected from the user.",depth:2}),h=xP({title:"Context",content:[wP(i)],depth:2}),f=xP({title:"Workflow Name",content:[t],depth:2}),m=xP({title:"Goals",content:[kP(n)],depth:2});return xP({title:"Workflow",content:["I am a user being guided through a “workflow” defined by the organization that provides this chat experience.","**IMPORTANT: Follow the instructions outlined in this workflow. Follow the instructions in the workflow configuration below. Do not answer questions unrelated to the workflow.**",f,m,h,p,s],depth:1})}function kP(e){if(CP(e))return e.filter((e=>null!=e)).map(((e,t)=>`${t+1}. ${e}`)).join("\n")}function wP(e){if(CP(e))return e.filter((e=>null!=e)).map((e=>`- ${e}`)).join("\n")}function xP({title:e,content:t,note:n,depth:r=2}){const a=TP(t);if(!a&&!n)return;const o=`${"#".repeat(r)} ${e}\n`,i=TP([n,a]);return i?`${o}${i}\n`:void 0}function EP(e){if(!e)return;if(!CP(e))return;const t=e.map(((e,t)=>function({attachment:e,index:t}){const{title:n,content:r,contentType:a,context:o}=e,{contentInputLabel:i,type:s}=a,l=function(e){if("CODE"===(null==e?void 0:e.type))return e.language||"";return}(a),c=function(e,t){return t?`\`\`\`${t}\n${e}\n\`\`\``:e}(r,l),u=CP(o)?["\nAdditional Context:",TP(o)]:[],d=[`#### ATTACHMENT #${t+1}`,`Title: ${n}`,`Label: ${i}`,`Type: ${s}`,"Content:",c,...u].join("\n");return d}({attachment:e,index:t})));return TP(t)}function _P(e){return xP({title:"User-provided Attachments",content:["The user has provided the following attachments to their message:",EP(e)],depth:1})}function SP(e){if(!e.supportedInputs)return e;const t={...e};return t.supportedInputs=e.supportedInputs.map((e=>{const t={...e};return"MODAL"===t.type&&(t.workflowModalProps=void 0),t})),t}function TP(e){if(CP(e))return e.filter((e=>null!=e)).join("\n")}function CP(e){return Array.isArray(e)&&e.length>0}const AP=()=>{const e="undefined"==typeof window?new URL(""):new URL(window.location.href),t=new URLSearchParams(e.search);if(t.has(eP)){t.delete(eP);const n=t.toString(),r=n?`${e.origin}${e.pathname}?${n}`:`${e.origin}${e.pathname}`;"undefined"!=typeof window&&window.history.pushState({},"",r)}};var NP=e=>"checkbox"===e.type,IP=e=>e instanceof Date,RP=e=>null==e;const OP=e=>"object"==typeof e;var PP=e=>!RP(e)&&!Array.isArray(e)&&OP(e)&&!IP(e),LP=e=>PP(e)&&e.target?NP(e.target)?e.target.checked:e.target.value:e,DP=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),MP="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function FP(e){let t;const n=Array.isArray(e),r="undefined"!=typeof FileList&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(MP&&(e instanceof Blob||r)||!n&&!PP(e))return e;if(t=n?[]:{},n||(e=>{const t=e.constructor&&e.constructor.prototype;return PP(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const n in e)e.hasOwnProperty(n)&&(t[n]=FP(e[n]));else t=e}return t}var jP=e=>Array.isArray(e)?e.filter(Boolean):[],BP=e=>void 0===e,zP=(e,t,n)=>{if(!t||!PP(e))return n;const r=jP(t.split(/[,[\].]+?/)).reduce(((e,t)=>RP(e)?e:e[t]),e);return BP(r)||r===e?BP(e[t])?n:e[t]:r},HP=e=>"boolean"==typeof e,UP=e=>/^\w*$/.test(e),$P=e=>jP(e.replace(/["|']|\]/g,"").split(/\.|\[/)),GP=(e,t,n)=>{let r=-1;const a=UP(t)?[t]:$P(t),o=a.length,i=o-1;for(;++r<o;){const t=a[r];let o=n;if(r!==i){const n=e[t];o=PP(n)||Array.isArray(n)?n:isNaN(+a[r+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=o,e=e[t]}return e};const VP="blur",qP="focusout",WP="change",YP="onBlur",KP="onChange",XP="onSubmit",QP="onTouched",ZP="all",JP="max",eL="min",tL="maxLength",nL="minLength",rL="pattern",aL="required",oL="validate",iL=J.createContext(null),sL=()=>J.useContext(iL);var lL=(e,t,n,r=!0)=>{const a={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(a,o,{get:()=>{const a=o;return t._proxyFormState[a]!==ZP&&(t._proxyFormState[a]=!r||ZP),n&&(n[a]=!0),e[a]}});return a},cL=e=>PP(e)&&!Object.keys(e).length,uL=(e,t,n,r)=>{n(e);const{name:a,...o}=e;return cL(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find((e=>t[e]===(!r||ZP)))},dL=e=>Array.isArray(e)?e:[e],pL=(e,t,n)=>!e||!t||e===t||dL(e).some((e=>e&&(n?e===t:e.startsWith(t)||t.startsWith(e))));function hL(e){const t=J.useRef(e);t.current=e,J.useEffect((()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}}),[e.disabled])}var fL=e=>"string"==typeof e,mL=(e,t,n,r,a)=>fL(e)?(r&&t.watch.add(e),zP(n,e,a)):Array.isArray(e)?e.map((e=>(r&&t.watch.add(e),zP(n,e)))):(r&&(t.watchAll=!0),n);function gL(e){const t=sL(),{name:n,disabled:r,control:a=t.control,shouldUnregister:o}=e,i=DP(a._names.array,n),s=function(e){const t=sL(),{control:n=t.control,name:r,defaultValue:a,disabled:o,exact:i}=e||{},s=J.useRef(r);s.current=r,hL({disabled:o,subject:n._subjects.values,next:e=>{pL(s.current,e.name,i)&&c(FP(mL(s.current,n._names,e.values||n._formValues,!1,a)))}});const[l,c]=J.useState(n._getWatch(r,a));return J.useEffect((()=>n._removeUnmounted())),l}({control:a,name:n,defaultValue:zP(a._formValues,n,zP(a._defaultValues,n,e.defaultValue)),exact:!0}),l=function(e){const t=sL(),{control:n=t.control,disabled:r,name:a,exact:o}=e||{},[i,s]=J.useState(n._formState),l=J.useRef(!0),c=J.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=J.useRef(a);return u.current=a,hL({disabled:r,next:e=>l.current&&pL(u.current,e.name,o)&&uL(e,c.current,n._updateFormState)&&s({...n._formState,...e}),subject:n._subjects.state}),J.useEffect((()=>(l.current=!0,c.current.isValid&&n._updateValid(!0),()=>{l.current=!1})),[n]),J.useMemo((()=>lL(i,n,c.current,!1)),[i,n])}({control:a,name:n,exact:!0}),c=J.useRef(a.register(n,{...e.rules,value:s,...HP(e.disabled)?{disabled:e.disabled}:{}})),u=J.useMemo((()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!zP(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!zP(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!zP(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!zP(l.validatingFields,n)},error:{enumerable:!0,get:()=>zP(l.errors,n)}})),[l,n]),d=J.useMemo((()=>({name:n,value:s,...HP(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:e=>c.current.onChange({target:{value:LP(e),name:n},type:WP}),onBlur:()=>c.current.onBlur({target:{value:zP(a._formValues,n),name:n},type:VP}),ref:e=>{const t=zP(a._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}})),[n,a._formValues,r,l.disabled,s,a._fields]);return J.useEffect((()=>{const e=a._options.shouldUnregister||o,t=(e,t)=>{const n=zP(a._fields,e);n&&n._f&&(n._f.mount=t)};if(t(n,!0),e){const e=FP(zP(a._options.defaultValues,n));GP(a._defaultValues,n,e),BP(zP(a._formValues,n))&&GP(a._formValues,n,e)}return!i&&a.register(n),()=>{(i?e&&!a._state.action:e)?a.unregister(n):t(n,!1)}}),[n,a,i,o]),J.useEffect((()=>{a._updateDisabledField({disabled:r,fields:a._fields,name:n})}),[r,n,a]),J.useMemo((()=>({field:d,formState:l,fieldState:u})),[d,l,u])}const yL=e=>e.render(gL(e));var bL=(e,t,n,r,a)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:a||!0}}:{},vL=e=>({isOnSubmit:!e||e===XP,isOnBlur:e===YP,isOnChange:e===KP,isOnAll:e===ZP,isOnTouch:e===QP}),kL=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))));const wL=(e,t,n,r)=>{for(const a of n||Object.keys(e)){const n=zP(e,a);if(n){const{_f:e,...o}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],a)&&!r)return!0;if(e.ref&&t(e.ref,e.name)&&!r)return!0;if(wL(o,t))break}else if(PP(o)&&wL(o,t))break}}};var xL=(e,t,n)=>{const r=dL(zP(e,n));return GP(r,"root",t[n]),GP(e,n,r),e},EL=e=>"file"===e.type,_L=e=>"function"==typeof e,SL=e=>{if(!MP)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},TL=e=>fL(e),CL=e=>"radio"===e.type,AL=e=>e instanceof RegExp;const NL={value:!1,isValid:!1},IL={value:!0,isValid:!0};var RL=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!BP(e[0].attributes.value)?BP(e[0].value)||""===e[0].value?IL:{value:e[0].value,isValid:!0}:IL:NL}return NL};const OL={isValid:!1,value:null};var PL=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),OL):OL;function LL(e,t,n="validate"){if(TL(e)||Array.isArray(e)&&e.every(TL)||HP(e)&&!e)return{type:n,message:TL(e)?e:"",ref:t}}var DL=e=>PP(e)&&!AL(e)?e:{value:e,message:""},ML=async(e,t,n,r,a,o)=>{const{ref:i,refs:s,required:l,maxLength:c,minLength:u,min:d,max:p,pattern:h,validate:f,name:m,valueAsNumber:g,mount:y}=e._f,b=zP(n,m);if(!y||t.has(m))return{};const v=s?s[0]:i,k=e=>{a&&v.reportValidity&&(v.setCustomValidity(HP(e)?"":e||""),v.reportValidity())},w={},x=CL(i),E=NP(i),_=x||E,S=(g||EL(i))&&BP(i.value)&&BP(b)||SL(i)&&""===i.value||""===b||Array.isArray(b)&&!b.length,T=bL.bind(null,m,r,w),C=(e,t,n,r=tL,a=nL)=>{const o=e?t:n;w[m]={type:e?r:a,message:o,ref:i,...T(e?r:a,o)}};if(o?!Array.isArray(b)||!b.length:l&&(!_&&(S||RP(b))||HP(b)&&!b||E&&!RL(s).isValid||x&&!PL(s).isValid)){const{value:e,message:t}=TL(l)?{value:!!l,message:l}:DL(l);if(e&&(w[m]={type:aL,message:t,ref:v,...T(aL,t)},!r))return k(t),w}if(!(S||RP(d)&&RP(p))){let e,t;const n=DL(p),a=DL(d);if(RP(b)||isNaN(b)){const r=i.valueAsDate||new Date(b),o=e=>new Date((new Date).toDateString()+" "+e),s="time"==i.type,l="week"==i.type;fL(n.value)&&b&&(e=s?o(b)>o(n.value):l?b>n.value:r>new Date(n.value)),fL(a.value)&&b&&(t=s?o(b)<o(a.value):l?b<a.value:r<new Date(a.value))}else{const r=i.valueAsNumber||(b?+b:b);RP(n.value)||(e=r>n.value),RP(a.value)||(t=r<a.value)}if((e||t)&&(C(!!e,n.message,a.message,JP,eL),!r))return k(w[m].message),w}if((c||u)&&!S&&(fL(b)||o&&Array.isArray(b))){const e=DL(c),t=DL(u),n=!RP(e.value)&&b.length>+e.value,a=!RP(t.value)&&b.length<+t.value;if((n||a)&&(C(n,e.message,t.message),!r))return k(w[m].message),w}if(h&&!S&&fL(b)){const{value:e,message:t}=DL(h);if(AL(e)&&!b.match(e)&&(w[m]={type:rL,message:t,ref:i,...T(rL,t)},!r))return k(t),w}if(f)if(_L(f)){const e=LL(await f(b,n),v);if(e&&(w[m]={...e,...T(oL,e.message)},!r))return k(e.message),w}else if(PP(f)){let e={};for(const t in f){if(!cL(e)&&!r)break;const a=LL(await f[t](b,n),v,t);a&&(e={...a,...T(t,a.message)},k(a.message),r&&(w[m]=e))}if(!cL(e)&&(w[m]={ref:v,...e},!r))return w}return k(!0),w};function FL(e,t){const n=Array.isArray(t)?t:UP(t)?[t]:$P(t),r=1===n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=BP(e)?r++:e[t[r++]];return e}(e,n),a=n.length-1,o=n[a];return r&&delete r[o],0!==a&&(PP(r)&&cL(r)||Array.isArray(r)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!BP(e[t]))return!1;return!0}(r))&&FL(e,n.slice(0,-1)),e}var jL=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}},BL=e=>RP(e)||!OP(e);function zL(e,t){if(BL(e)||BL(t))return e===t;if(IP(e)&&IP(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const a of n){const n=e[a];if(!r.includes(a))return!1;if("ref"!==a){const e=t[a];if(IP(n)&&IP(e)||PP(n)&&PP(e)||Array.isArray(n)&&Array.isArray(e)?!zL(n,e):n!==e)return!1}}return!0}var HL=e=>"select-multiple"===e.type,UL=e=>SL(e)&&e.isConnected,$L=e=>{for(const t in e)if(_L(e[t]))return!0;return!1};function GL(e,t={}){const n=Array.isArray(e);if(PP(e)||n)for(const r in e)Array.isArray(e[r])||PP(e[r])&&!$L(e[r])?(t[r]=Array.isArray(e[r])?[]:{},GL(e[r],t[r])):RP(e[r])||(t[r]=!0);return t}function VL(e,t,n){const r=Array.isArray(e);if(PP(e)||r)for(const a in e)Array.isArray(e[a])||PP(e[a])&&!$L(e[a])?BP(t)||BL(n[a])?n[a]=Array.isArray(e[a])?GL(e[a],[]):{...GL(e[a])}:VL(e[a],RP(t)?{}:t[a],n[a]):n[a]=!zL(e[a],t[a]);return n}var qL=(e,t)=>VL(e,t,GL(t)),WL=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>BP(e)?e:t?""===e?NaN:e?+e:e:n&&fL(e)?new Date(e):r?r(e):e;function YL(e){const t=e.ref;return EL(t)?t.files:CL(t)?PL(e.refs).value:HL(t)?[...t.selectedOptions].map((({value:e})=>e)):NP(t)?RL(e.refs).value:WL(BP(t.value)?e.ref.value:t.value,e)}var KL=e=>BP(e)?e:AL(e)?e.source:PP(e)?AL(e.value)?e.value.source:e.value:e;const XL="AsyncFunction";function QL(e,t,n){const r=zP(e,n);if(r||UP(n))return{error:r,name:n};const a=n.split(".");for(;a.length;){const r=a.join("."),o=zP(t,r),i=zP(e,r);if(o&&!Array.isArray(o)&&n!==r)return{name:n};if(i&&i.type)return{name:r,error:i};a.pop()}return{name:n}}const ZL={mode:XP,reValidateMode:KP,shouldFocusError:!0};function JL(e={}){let t,n={...ZL,...e},r={submitCount:0,isDirty:!1,isLoading:_L(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1},a={},o=(PP(n.defaultValues)||PP(n.values))&&FP(n.defaultValues||n.values)||{},i=n.shouldUnregister?{}:FP(o),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:jL(),array:jL(),state:jL()},p=vL(n.mode),h=vL(n.reValidateMode),f=n.criteriaMode===ZP,m=async e=>{if(!n.disabled&&(u.isValid||e)){const e=n.resolver?cL((await k()).errors):await w(a,!0);e!==r.isValid&&d.state.next({isValid:e})}},g=(e,t)=>{n.disabled||!u.isValidating&&!u.validatingFields||((e||Array.from(l.mount)).forEach((e=>{e&&(t?GP(r.validatingFields,e,t):FL(r.validatingFields,e))})),d.state.next({validatingFields:r.validatingFields,isValidating:!cL(r.validatingFields)}))},y=(e,t,n,r)=>{const l=zP(a,e);if(l){const a=zP(i,e,BP(n)?zP(o,e):n);BP(a)||r&&r.defaultChecked||t?GP(i,e,t?a:YL(l._f)):_(e,a),s.mount&&m()}},b=(e,t,i,s,l)=>{let c=!1,p=!1;const h={name:e};if(!n.disabled){const n=!!(zP(a,e)&&zP(a,e)._f&&zP(a,e)._f.disabled);if(!i||s){u.isDirty&&(p=r.isDirty,r.isDirty=h.isDirty=x(),c=p!==h.isDirty);const a=n||zL(zP(o,e),t);p=!(n||!zP(r.dirtyFields,e)),a||n?FL(r.dirtyFields,e):GP(r.dirtyFields,e,!0),h.dirtyFields=r.dirtyFields,c=c||u.dirtyFields&&p!==!a}if(i){const t=zP(r.touchedFields,e);t||(GP(r.touchedFields,e,i),h.touchedFields=r.touchedFields,c=c||u.touchedFields&&t!==i)}c&&l&&d.state.next(h)}return c?h:{}},v=(e,a,o,i)=>{const s=zP(r.errors,e),l=u.isValid&&HP(a)&&r.isValid!==a;var p;if(n.delayError&&o?(p=()=>((e,t)=>{GP(r.errors,e,t),d.state.next({errors:r.errors})})(e,o),t=e=>{clearTimeout(c),c=setTimeout(p,e)},t(n.delayError)):(clearTimeout(c),t=null,o?GP(r.errors,e,o):FL(r.errors,e)),(o?!zL(s,o):s)||!cL(i)||l){const t={...i,...l&&HP(a)?{isValid:a}:{},errors:r.errors,name:e};r={...r,...t},d.state.next(t)}},k=async e=>{g(e,!0);const t=await n.resolver(i,n.context,((e,t,n,r)=>{const a={};for(const o of e){const e=zP(t,o);e&&GP(a,o,e._f)}return{criteriaMode:n,names:[...e],fields:a,shouldUseNativeValidation:r}})(e||l.mount,a,n.criteriaMode,n.shouldUseNativeValidation));return g(e),t},w=async(e,t,a={valid:!0})=>{for(const s in e){const c=e[s];if(c){const{_f:e,...d}=c;if(e){const d=l.array.has(e.name),p=c._f&&(!!(o=c._f)&&!!o.validate&&!!(_L(o.validate)&&o.validate.constructor.name===XL||PP(o.validate)&&Object.values(o.validate).find((e=>e.constructor.name===XL))));p&&u.validatingFields&&g([s],!0);const h=await ML(c,l.disabled,i,f,n.shouldUseNativeValidation&&!t,d);if(p&&u.validatingFields&&g([s]),h[e.name]&&(a.valid=!1,t))break;!t&&(zP(h,e.name)?d?xL(r.errors,h,e.name):GP(r.errors,e.name,h[e.name]):FL(r.errors,e.name))}!cL(d)&&await w(d,t,a)}}var o;return a.valid},x=(e,t)=>!n.disabled&&(e&&t&&GP(i,e,t),!zL(I(),o)),E=(e,t,n)=>mL(e,l,{...s.mount?i:BP(t)?o:fL(e)?{[e]:t}:t},n,t),_=(e,t,n={})=>{const r=zP(a,e);let o=t;if(r){const n=r._f;n&&(!n.disabled&&GP(i,e,WL(t,n)),o=SL(n.ref)&&RP(t)?"":t,HL(n.ref)?[...n.ref.options].forEach((e=>e.selected=o.includes(e.value))):n.refs?NP(n.ref)?n.refs.length>1?n.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(o)?!!o.find((t=>t===e.value)):o===e.value))):n.refs[0]&&(n.refs[0].checked=!!o):n.refs.forEach((e=>e.checked=e.value===o)):EL(n.ref)?n.ref.value="":(n.ref.value=o,n.ref.type||d.values.next({name:e,values:{...i}})))}(n.shouldDirty||n.shouldTouch)&&b(e,o,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&N(e)},S=(e,t,n)=>{for(const r in t){const o=t[r],i=`${e}.${r}`,s=zP(a,i);(l.array.has(e)||PP(o)||s&&!s._f)&&!IP(o)?S(i,o,n):_(i,o,n)}},T=(e,t,n={})=>{const c=zP(a,e),p=l.array.has(e),h=FP(t);GP(i,e,h),p?(d.array.next({name:e,values:{...i}}),(u.isDirty||u.dirtyFields)&&n.shouldDirty&&d.state.next({name:e,dirtyFields:qL(o,i),isDirty:x(e,h)})):!c||c._f||RP(h)?_(e,h,n):S(e,h,n),kL(e,l)&&d.state.next({...r}),d.values.next({name:s.mount?e:void 0,values:{...i}})},C=async e=>{s.mount=!0;const o=e.target;let c=o.name,y=!0;const x=zP(a,c),E=e=>{y=Number.isNaN(e)||IP(e)&&isNaN(e.getTime())||zL(e,zP(i,c,e))};if(x){let s,S;const T=o.type?YL(x._f):LP(e),C=e.type===VP||e.type===qP,A=!((_=x._f).mount&&(_.required||_.min||_.max||_.maxLength||_.minLength||_.pattern||_.validate)||n.resolver||zP(r.errors,c)||x._f.deps)||((e,t,n,r,a)=>!a.isOnAll&&(!n&&a.isOnTouch?!(t||e):(n?r.isOnBlur:a.isOnBlur)?!e:!(n?r.isOnChange:a.isOnChange)||e))(C,zP(r.touchedFields,c),r.isSubmitted,h,p),I=kL(c,l,C);GP(i,c,T),C?(x._f.onBlur&&x._f.onBlur(e),t&&t(0)):x._f.onChange&&x._f.onChange(e);const R=b(c,T,C,!1),O=!cL(R)||I;if(!C&&d.values.next({name:c,type:e.type,values:{...i}}),A)return u.isValid&&("onBlur"===n.mode&&C?m():C||m()),O&&d.state.next({name:c,...I?{}:R});if(!C&&I&&d.state.next({...r}),n.resolver){const{errors:e}=await k([c]);if(E(T),y){const t=QL(r.errors,a,c),n=QL(e,a,t.name||c);s=n.error,c=n.name,S=cL(e)}}else g([c],!0),s=(await ML(x,l.disabled,i,f,n.shouldUseNativeValidation))[c],g([c]),E(T),y&&(s?S=!1:u.isValid&&(S=await w(a,!0)));y&&(x._f.deps&&N(x._f.deps),v(c,S,s,R))}var _},A=(e,t)=>{if(zP(r.errors,t)&&e.focus)return e.focus(),1},N=async(e,t={})=>{let o,i;const s=dL(e);if(n.resolver){const t=await(async e=>{const{errors:t}=await k(e);if(e)for(const n of e){const e=zP(t,n);e?GP(r.errors,n,e):FL(r.errors,n)}else r.errors=t;return t})(BP(e)?e:s);o=cL(t),i=e?!s.some((e=>zP(t,e))):o}else e?(i=(await Promise.all(s.map((async e=>{const t=zP(a,e);return await w(t&&t._f?{[e]:t}:t)})))).every(Boolean),(i||r.isValid)&&m()):i=o=await w(a);return d.state.next({...!fL(e)||u.isValid&&o!==r.isValid?{}:{name:e},...n.resolver||!e?{isValid:o}:{},errors:r.errors}),t.shouldFocus&&!i&&wL(a,A,e?s:l.mount),i},I=e=>{const t={...s.mount?i:o};return BP(e)?t:fL(e)?zP(t,e):e.map((e=>zP(t,e)))},R=(e,t)=>({invalid:!!zP((t||r).errors,e),isDirty:!!zP((t||r).dirtyFields,e),error:zP((t||r).errors,e),isValidating:!!zP(r.validatingFields,e),isTouched:!!zP((t||r).touchedFields,e)}),O=(e,t,n)=>{const o=(zP(a,e,{_f:{}})._f||{}).ref,i=zP(r.errors,e)||{},{ref:s,message:l,type:c,...u}=i;GP(r.errors,e,{...u,...t,ref:o}),d.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&o&&o.focus&&o.focus()},P=(e,t={})=>{for(const s of e?dL(e):l.mount)l.mount.delete(s),l.array.delete(s),t.keepValue||(FL(a,s),FL(i,s)),!t.keepError&&FL(r.errors,s),!t.keepDirty&&FL(r.dirtyFields,s),!t.keepTouched&&FL(r.touchedFields,s),!t.keepIsValidating&&FL(r.validatingFields,s),!n.shouldUnregister&&!t.keepDefaultValue&&FL(o,s);d.values.next({values:{...i}}),d.state.next({...r,...t.keepDirty?{isDirty:x()}:{}}),!t.keepIsValid&&m()},L=({disabled:e,name:t,field:n,fields:r})=>{(HP(e)&&s.mount||e||l.disabled.has(t))&&(e?l.disabled.add(t):l.disabled.delete(t),b(t,YL(n?n._f:zP(r,t)._f),!1,!1,!0))},D=(e,t={})=>{let r=zP(a,e);const i=HP(t.disabled)||HP(n.disabled);return GP(a,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),r?L({field:r,disabled:HP(t.disabled)?t.disabled:n.disabled,name:e}):y(e,!0,t.value),{...i?{disabled:t.disabled||n.disabled}:{},...n.progressive?{required:!!t.required,min:KL(t.min),max:KL(t.max),minLength:KL(t.minLength),maxLength:KL(t.maxLength),pattern:KL(t.pattern)}:{},name:e,onChange:C,onBlur:C,ref:i=>{if(i){D(e,t),r=zP(a,e);const n=BP(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=(e=>CL(e)||NP(e))(n),l=r._f.refs||[];if(s?l.find((e=>e===n)):n===r._f.ref)return;GP(a,e,{_f:{...r._f,...s?{refs:[...l.filter(UL),n,...Array.isArray(zP(o,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),y(e,!1,void 0,n)}else r=zP(a,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!DP(l.array,e)||!s.action)&&l.unMount.add(e)}}},M=()=>n.shouldFocusError&&wL(a,A,l.mount),F=(e,t)=>async o=>{let s;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let c=FP(i);if(l.disabled.size)for(const e of l.disabled)GP(c,e,void 0);if(d.state.next({isSubmitting:!0}),n.resolver){const{errors:e,values:t}=await k();r.errors=e,c=t}else await w(a);if(FL(r.errors,"root"),cL(r.errors)){d.state.next({errors:{}});try{await e(c,o)}catch(u){s=u}}else t&&await t({...r.errors},o),M(),setTimeout(M);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:cL(r.errors)&&!s,submitCount:r.submitCount+1,errors:r.errors}),s)throw s},j=(e,t={})=>{const c=e?FP(e):o,p=FP(c),h=cL(e),f=h?o:p;if(t.keepDefaultValues||(o=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...l.mount,...Object.keys(qL(o,i))]);for(const t of Array.from(e))zP(r.dirtyFields,t)?GP(f,t,zP(i,t)):T(t,zP(f,t))}else{if(MP&&BP(e))for(const e of l.mount){const t=zP(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(SL(e)){const t=e.closest("form");if(t){t.reset();break}}}}a={}}i=n.shouldUnregister?t.keepDefaultValues?FP(o):{}:FP(f),d.array.next({values:{...f}}),d.values.next({values:{...f}})}l={mount:t.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!u.isValid||!!t.keepIsValid||!!t.keepDirtyValues,s.watch=!!n.shouldUnregister,d.state.next({submitCount:t.keepSubmitCount?r.submitCount:0,isDirty:!h&&(t.keepDirty?r.isDirty:!(!t.keepDefaultValues||zL(e,o))),isSubmitted:!!t.keepIsSubmitted&&r.isSubmitted,dirtyFields:h?{}:t.keepDirtyValues?t.keepDefaultValues&&i?qL(o,i):r.dirtyFields:t.keepDefaultValues&&e?qL(o,e):t.keepDirty?r.dirtyFields:{},touchedFields:t.keepTouched?r.touchedFields:{},errors:t.keepErrors?r.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&r.isSubmitSuccessful,isSubmitting:!1})},B=(e,t)=>j(_L(e)?e(i):e,t);return{control:{register:D,unregister:P,getFieldState:R,handleSubmit:F,setError:O,_executeSchema:k,_getWatch:E,_getDirty:x,_updateValid:m,_removeUnmounted:()=>{for(const e of l.unMount){const t=zP(a,e);t&&(t._f.refs?t._f.refs.every((e=>!UL(e))):!UL(t._f.ref))&&P(e)}l.unMount=new Set},_updateFieldArray:(e,t=[],l,c,p=!0,h=!0)=>{if(c&&l&&!n.disabled){if(s.action=!0,h&&Array.isArray(zP(a,e))){const t=l(zP(a,e),c.argA,c.argB);p&&GP(a,e,t)}if(h&&Array.isArray(zP(r.errors,e))){const t=l(zP(r.errors,e),c.argA,c.argB);p&&GP(r.errors,e,t),((e,t)=>{!jP(zP(e,t)).length&&FL(e,t)})(r.errors,e)}if(u.touchedFields&&h&&Array.isArray(zP(r.touchedFields,e))){const t=l(zP(r.touchedFields,e),c.argA,c.argB);p&&GP(r.touchedFields,e,t)}u.dirtyFields&&(r.dirtyFields=qL(o,i)),d.state.next({name:e,isDirty:x(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else GP(i,e,t)},_updateDisabledField:L,_getFieldArray:e=>jP(zP(s.mount?i:o,e,n.shouldUnregister?zP(o,e,[]):[])),_reset:j,_resetDefaultValues:()=>_L(n.defaultValues)&&n.defaultValues().then((e=>{B(e,n.resetOptions),d.state.next({isLoading:!1})})),_updateFormState:e=>{r={...r,...e}},_disableForm:e=>{HP(e)&&(d.state.next({disabled:e}),wL(a,((t,n)=>{const r=zP(a,n);r&&(t.disabled=r._f.disabled||e,Array.isArray(r._f.refs)&&r._f.refs.forEach((t=>{t.disabled=r._f.disabled||e})))}),0,!1))},_subjects:d,_proxyFormState:u,_setErrors:e=>{r.errors=e,d.state.next({errors:r.errors,isValid:!1})},get _fields(){return a},get _formValues(){return i},get _state(){return s},set _state(e){s=e},get _defaultValues(){return o},get _names(){return l},set _names(e){l=e},get _formState(){return r},set _formState(e){r=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:N,register:D,handleSubmit:F,watch:(e,t)=>_L(e)?d.values.subscribe({next:n=>e(E(void 0,t),n)}):E(e,t,!0),setValue:T,getValues:I,reset:B,resetField:(e,t={})=>{zP(a,e)&&(BP(t.defaultValue)?T(e,FP(zP(o,e))):(T(e,t.defaultValue),GP(o,e,FP(t.defaultValue))),t.keepTouched||FL(r.touchedFields,e),t.keepDirty||(FL(r.dirtyFields,e),r.isDirty=t.defaultValue?x(e,FP(zP(o,e))):x()),t.keepError||(FL(r.errors,e),u.isValid&&m()),d.state.next({...r}))},clearErrors:e=>{e&&dL(e).forEach((e=>FL(r.errors,e))),d.state.next({errors:e?r.errors:{}})},unregister:P,setError:O,setFocus:(e,t={})=>{const n=zP(a,e),r=n&&n._f;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&(e.focus(),t.shouldSelect&&_L(e.select)&&e.select())}},getFieldState:R}}function eD(e={}){const t=J.useRef(void 0),n=J.useRef(void 0),[r,a]=J.useState({isDirty:!1,isValidating:!1,isLoading:_L(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:_L(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...JL(e),formState:r});const o=t.current.control;return o._options=e,hL({subject:o._subjects.state,next:e=>{uL(e,o._proxyFormState,o._updateFormState,!0)&&a({...o._formState})}}),J.useEffect((()=>o._disableForm(e.disabled)),[o,e.disabled]),J.useEffect((()=>{if(o._proxyFormState.isDirty){const e=o._getDirty();e!==r.isDirty&&o._subjects.state.next({isDirty:e})}}),[o,r.isDirty]),J.useEffect((()=>{e.values&&!zL(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,a((e=>({...e})))):o._resetDefaultValues()}),[e.values,o]),J.useEffect((()=>{e.errors&&o._setErrors(e.errors)}),[e.errors,o]),J.useEffect((()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()})),J.useEffect((()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})}),[e.shouldUnregister,o]),t.current.formState=lL(r,o),t.current}const tD=Z.createContext(void 0),nD=({children:e,modal:t})=>Gh.jsx(tD.Provider,{value:t,children:e}),rD=()=>Z.useContext(tD),aD={text:"",email:"",checkbox:!1,textarea:"",file:void 0,select:""};function oD(e){return e?null==e?void 0:e.reduce(((e,t)=>("defaultValue"in t&&t.defaultValue?e[t.name]=t.defaultValue:t.inputType&&(e[t.name]=aD[t.inputType]),e)),{}):{}}const iD=Z.createContext(void 0);const sD=({children:e})=>{const t=function(){var e;const[t,n]=Z.useState(null),[r,a]=Z.useState(!1),{conversation:o}=rP(),i=rD(),s=()=>{var e;n(null),a(!1),"close_modal"===(null==(e=null==t?void 0:t.buttons.close)?void 0:e.action)&&(null==i||i.setOpen(!1))},l=Z.useMemo((()=>null==t?void 0:t.fields.map((e=>{const t=e;return"_type"in e&&"include_chat_session"===e._type&&(t.isRequired=!1,t.inputType="checkbox",o.id||(t.isHidden=!0)),t}))),[null==t?void 0:t.fields,o.id]),c=null==l?void 0:l.find((e=>"_type"in e&&"include_chat_session"===e._type)),u=Z.useMemo((()=>oD(l)),[l]),{control:d,handleSubmit:p,formState:{errors:h,isSubmitting:f},setError:m,reset:g}=eD({defaultValues:u});Z.useEffect((()=>{u&&g(u)}),[g,u]);const y=p((async e=>{const n=o.id&&c&&e[c.name]?o:null;try{await(null==t?void 0:t.buttons.submit.onSubmit({values:e,conversation:n})),a(!0),(null==t?void 0:t.successView)||s()}catch(r){m("root.serverError",{message:r instanceof Error?r.message:"Something went wrong."})}})),b=null==(e=null==h?void 0:h.root)?void 0:e.serverError;return{form:t,openForm:e=>{n(e)},closeForm:s,handleSubmit:y,isSuccess:r,isSubmitting:f,formError:b,fields:l,errors:h,control:d,defaultValues:u}}();return Gh.jsx(iD.Provider,{value:t,children:e})},lD=()=>{const e=Z.useContext(iD);if(!e)throw new Error("useChatForm must be used within a ChatFormProvider");return e},cD=Z.createContext(void 0),uD=({children:e,widget:t})=>Gh.jsx(cD.Provider,{value:t,children:e}),dD=()=>Z.useContext(cD),pD=e=>{const[t,n]=Z.useState(!1);return Z.useEffect((()=>{const t=window.matchMedia(e);n(t.matches);const r=e=>n(e.matches);return t.addEventListener("change",r),()=>t.removeEventListener("change",r)}),[e]),t},hD=new TextEncoder;async function fD(e,t){return n=await async function(e,t){return crypto.subtle.digest(e.toUpperCase(),"string"==typeof t?hD.encode(t):new Uint8Array(t))}(e,t),[...new Uint8Array(n)].map((e=>e.toString(16).padStart(2,"0"))).join("");var n}const mD={getSolution:async()=>{},prefetchSolution:()=>{},invalidateSolution:()=>{}},gD=async e=>{try{const t=await fetch(e,{method:"GET"});if(!t.ok)throw new Error(`Failed to fetch challenge: ${t.statusText}`);const n=await t.json(),{challenge:r,algorithm:a,salt:o,maxnumber:i}=n,{promise:s}=await function(e,t,n="SHA-256",r=1e6,a=0){const o=new AbortController,i=Date.now();return{promise:(async()=>{for(let s=a;s<=r;s+=1){if(o.signal.aborted)return null;if(await fD(n,t+s)===e)return{number:s,took:Date.now()-i}}return null})(),controller:o}}(r,o,a,i),l=await s||void 0;if(!l)throw new Error("Challenge not solved");return{number:l.number,...n}}catch(t){console.warn("Error solving captcha:",t)}},yD={type:"function",function:{name:"provideLinks",description:"Provides links",parameters:{type:"object",properties:{links:{anyOf:[{type:"array",items:{type:"object",properties:{label:{type:["string","null"]},url:{type:"string"},title:{type:["string","null"]},description:{type:["string","null"]},type:{anyOf:[{anyOf:[{type:"string",enum:["documentation","site","discourse_post","github_issue","github_discussion","stackoverflow_question","discord_forum_post","discord_message","custom_question_answer"]},{type:"string"}]},{type:"null"}]},breadcrumbs:{anyOf:[{type:"array",items:{type:"string"}},{type:"null"}]}},required:["url"],additionalProperties:!0}},{type:"null"}]},text:{type:"string"}},required:["text"],additionalProperties:!1,$schema:"http://json-schema.org/draft-07/schema#"},function:e=>e,parse:JSON.parse}},bD=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(V4){return e}return e},vD=(...e)=>(...t)=>{for(const n of e)null==n||n(...t)},kD=e=>"string"==typeof e;function wD(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").replace(/__/g,"__").toLowerCase()}const xD=e=>e?"":void 0;function ED(e){const t=e.split(" "),n=t[0]??"",r=t.length>1?t[t.length-1]:"";return n&&r?`${n.charAt(0)}${r.charAt(0)}`:n.charAt(0)}function _D(e,t){return"function"==typeof e?e(t):e}const SD=e=>"string"==typeof e.content?e.content:e.content[0].text,TD=()=>{const{chatId:e,setConversation:t,conversation:n,resetConversation:r}=rP(),{baseSettings:a,aiChatSettings:o}=JO(),{aiApiBaseUrl:i,shouldBypassCaptcha:s,filters:l}=a,c=rD(),{getSolution:u,prefetchSolution:d,invalidateSolution:p}=(({fetchUrl:e,shouldBypassCaptcha:t=!1,shouldMakeInitialRequest:n=!0})=>{if(t)return mD;const r=Z.useRef(null),a=Z.useCallback((()=>{r.current||(r.current=gD(e))}),[e]),o=Z.useCallback((async()=>{let t=await r.current;return t||(r.current=gD(e),t=await r.current),r.current=null,t}),[e]),i=Z.useCallback((()=>{r.current=null}),[]);return Z.useEffect((()=>{n&&a()}),[a,n]),{getSolution:o,prefetchSolution:a,invalidateSolution:i}})({fetchUrl:`${i}/v1/challenge`,shouldBypassCaptcha:s,shouldMakeInitialRequest:!c||c.isOpen}),h=new db({baseURL:`${i}/v1`,apiKey:a.apiKey??"",dangerouslyAllowBrowser:!0}),{onInputMessageChange:f,getTools:m,prompts:g,model:y,filters:b,onToolCall:v}=o,[k,w]=Z.useState(""),x=Z.useRef(null);Z.useEffect((()=>{null==f||f(k)}),[k]);const[E,_]=Z.useState([]),[S,T]=Z.useState(!1),[C,A]=Z.useState(!1),[N,I]=Z.useState(null),[R,O]=Z.useState(null),[P,L]=Z.useState([]),[D,M]=Z.useState({}),F=Z.useRef([]),j=Z.useRef(null),{logEvent:B}=bP(),z=null==g?void 0:g.map(((e,t)=>({id:`system-${Date.now().toString()}-${Kh(4)}-${t}`,role:"system",content:e}))),[H,U]=Z.useState(!!e);Z.useEffect((()=>{if(e){const{apiKey:n,analyticsApiBaseUrl:r}=a;(async function(e,t,n){try{const r=`${n}/conversations/${e}`,a=await fetch(r,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!a.ok){const e=await a.text();throw new Error(`Failed to get conversation: ${e}`)}return a.json()}catch(N){console.warn("Error in getConversation:",N)}})(e,n,r).then((e=>{if(e){B({eventName:"shared_chat_loaded",properties:{conversation:e}}),U(!1),t({...e});const n=e.messages.map((e=>({...e,content:bD(e.content)})));_(n),F.current=n}}))}}),[e]);const $=e=>{I(e),_((t=>{const n=[...t],r=n[n.length-1];return r&&(r.content=(e=>{switch(e.code){case 400:return e.message;case 403:return`There seems to be a configuration error. Please contact ${a.organizationDisplayName??"Administrator"}`;default:return"Hmm.. \n\nIt seems I might be having some issues right now. Please clear the chat and try again."}})(e)),n})),T(!1),A(!1),p(),d()},G=!k.trim()&&!P.length||S,V=async(t=k)=>{if(G&&(!t||0===t.trim().length))return;T(!0);const r=R?2===E.length:0===E.length,a=function(e,t,n){if(!e)return;const r=n?vP(e):"",a=_P(t),o={workflow:SP(e),attachments:t};return{context:TP([r,a]),attributes:o}}(R,P,r);let o;const i=_P(P);o=P.length&&i?[{type:"text",text:i}]:t;const c={id:`${Date.now().toString()}-${Kh(4)}-1`,role:"user",content:o,metadata:a},p=[...E.length?[]:z,c];if(e){AP();const e=F.current.map(((e,t)=>({id:`${e.id}-${Kh(6)}-${t}`,role:e.role,..."assistant"===e.role?{links:e.links??[]}:{},content:e.content,metadata:e.metadata,tool_calls:e.tool_calls})));_([...e,...p]),F.current=[...e,...p]}else _((e=>[...e,...p])),F.current=[...F.current,...p];L([]),w(""),B({eventName:"user_message_submitted",properties:{}},F.current);const f=[yD,...(null==m?void 0:m({conversation:n}))||[]];try{const e={model:y,messages:F.current,stream:!0,tools:f,tool_choice:"auto"},t=await u(),r=t?btoa(JSON.stringify(t)):null,a=l||b?JSON.stringify({...l,...b}):void 0,o={};!s&&r&&(o["X-INKEEP-CHALLENGE-SOLUTION"]=r),a&&(o["inkeep-filters"]=a);const i=h.beta.chat.completions.stream(e,Object.keys(o).length>0?{headers:o}:void 0),c={id:`${Date.now().toString()}-${Kh(4)}-2`,role:"assistant",content:"",links:[],tool_calls:[]};_((e=>[...e,c])),i.on("content",((e,t)=>{A(!0),c.content=t,_((e=>{const t=[...e],n=t.findIndex((e=>e.id===c.id));return-1===n?[...t,c]:(t[n]={...c},t)}))})),i.on("tool_calls.function.arguments.done",(async e=>{var t,r,a,o;const{name:s,arguments:l}=e,u=null==f?void 0:f.find((e=>e.function.name===s));if(!u)return;const d=("parse"in u.function?u.function.parse:JSON.parse)(l),p=null==(r=(t=u.function).function)?void 0:r.call(t,d,i),h=(null==(a=u.renderMessageButtons)?void 0:a.call(u,{args:d,execution:p}))??[];"provideLinks"===s?c.links=d.links??[]:M((e=>({...e,[c.id]:[...e[c.id]??[],...h]}))),null==(o=c.tool_calls)||o.push({id:"call_"+Kh(24),type:"function",function:{name:s,arguments:l}}),_((e=>{const t=[...e],n=t.findIndex((e=>e.id===c.id));return t[n]={...c},t})),null==v||v(e,{conversation:{...n,messages:[...F.current,c]}})})),i.on("error",$),i.finalChatCompletion().then((()=>{F.current=[...F.current,c],j.current=null,T(!1),A(!1),d(),B({eventName:"assistant_message_received",properties:{}},F.current)})).catch((e=>{e instanceof Nf||console.warn(e)})),j.current=i.controller}catch(g){$(g),T(!1),A(!1)}},q=()=>{I(null),_([]),F.current=[],r(),M({}),L([]),AP(),O(null),p(),d(),B({eventName:"chat_clear_button_clicked",properties:{conversation:n}})},{openForm:W}=lD(),Y=dD();Z.useImperativeHandle(o.chatFunctionsRef,(()=>({submitMessage:V,updateInputMessage(e){w(e)},clearChat:q,openForm:e=>{null==Y||Y.setView("chat"),W(e)},focusInput:()=>{var e;null==(e=x.current)||e.focus()}})));const K=pD("(max-width: 768px)");return{messages:E,input:k,isLoading:S,isStreaming:C,isLoadingConversation:H,error:N,isSubmitDisabled:G,handleInputChange:e=>{const t=e.target.value;w(t)},handleInputKeyDown:e=>{"Enter"!==e.key||e.shiftKey||G||e.nativeEvent.isComposing||(e.preventDefault(),V())},handleSubmit:V,stop:()=>{j.current&&(j.current.abort(),j.current=null),T(!1),A(!1),d()},clear:q,handleWorkflow:e=>{O(e);const{initialReplyMessage:t,displayName:n}=e,r={id:E.length.toString()+Kh(4),role:"user",content:n},a={id:(E.length+1).toString()+Kh(4),role:"assistant",content:t,links:[]},o=[{id:`system-${Date.now().toString()}-${Kh(4)}-${e.id}`,role:"system",content:`Company has asked user to follow this guided workflow:\n${vP(e)}`},...z,r,a];_(o),L([])},selectedWorkflow:R,messageAttachments:P,setMessageAttachments:L,addAttachment:e=>{L((t=>[...t,e]))},messageButtons:D,isEmpty:0===E.length,inputRef:x,isMobile:K}};const CD=Z.createContext(void 0);function AD(){const{baseSettings:e}=JO(),{apiKey:t,analyticsApiBaseUrl:n,analyticsProperties:r}=e,[a,o]=Z.useState(null),[i,s]=Z.useState({}),{conversation:l}=rP(),{messages:c,selectedWorkflow:u}=zj(),{userProperties:d}=pP(),{logEvent:p}=bP(),h=Z.useCallback((async(e,a,o=[])=>{const i=await async function(e){try{const{type:t,messageId:n,reasons:r=[],apiKey:a,apiUrl:o,userProperties:i,properties:s}=e,l=`${o}/feedback`,c={type:t,messageId:n,createdAt:(new Date).toISOString(),userProperties:i,properties:s};"negative"===t&&(c.reasons=r);const u=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(c)});if(!u.ok){const e=await u.text();throw new Error(`Failed to send feedback: ${e}`)}return u.json()}catch(t){console.warn("Error in submitFeedback:",t)}}({type:a,messageId:e,reasons:o,apiKey:t,apiUrl:n,userProperties:d,properties:r});i&&s((t=>({...t,[e]:{type:i.type,reasons:i.reasons}})));const h=c.findIndex((t=>t.id===e)),f=c[h],m={conversationId:l.id,question:SD(c[h-1]),answer:SD(f),messageId:e,reasons:o,workflowId:null==u?void 0:u.id};p({eventName:"positive"===a?"assistant_positive_feedback_submitted":"assistant_negative_feedback_submitted",properties:m})}),[c,l]);return{feedback:i,currentFeedback:a,setCurrentFeedback:o,submitPositiveFeedback:Z.useCallback((async e=>{h(e,"positive")}),[h]),submitNegativeFeedback:Z.useCallback((async(e,t)=>{const n=function(e){const t=[];for(const n in e){"on"===e[n]&&t.push({label:n,details:e[`${n}:description`]||""})}return t.length>0?t:[]}(t);h(e,"negative",n)}),[h])}}const ND=({children:e})=>{const t=AD();return Gh.jsx(CD.Provider,{value:t,children:e})},ID=()=>{const e=Z.useContext(CD);if(!e)throw new Error("useFeedback must be used within a FeedbackProvider");return e};function RD(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function OD(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function PD(...e){return t=>{let n=!1;const r=e.map((e=>{const r=OD(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():OD(e[t],null)}}}}function LD(...e){return Z.useCallback(PD(...e),e)}function DD(e,t=[]){let n=[];const r=()=>{const t=n.map((e=>Z.createContext(e)));return function(n){const r=(null==n?void 0:n[e])||t;return Z.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const a=Z.createContext(r),o=n.length;n=[...n,r];const i=t=>{var n;const{scope:r,children:i,...s}=t,l=(null==(n=null==r?void 0:r[e])?void 0:n[o])||a,c=Z.useMemo((()=>s),Object.values(s));return Gh.jsx(l.Provider,{value:c,children:i})};return i.displayName=t+"Provider",[i,function(n,i){var s;const l=(null==(s=null==i?void 0:i[e])?void 0:s[o])||a,c=Z.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},MD(r,...t)]}function MD(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return Z.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}var FD=Z.forwardRef(((e,t)=>{const{children:n,...r}=e,a=Z.Children.toArray(n),o=a.find(zD);if(o){const e=o.props.children,n=a.map((t=>t===o?Z.Children.count(e)>1?Z.Children.only(null):Z.isValidElement(e)?e.props.children:null:t));return Gh.jsx(jD,{...r,ref:t,children:Z.isValidElement(e)?Z.cloneElement(e,void 0,n):null})}return Gh.jsx(jD,{...r,ref:t,children:n})}));FD.displayName="Slot";var jD=Z.forwardRef(((e,t)=>{const{children:n,...r}=e;if(Z.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;if(a)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a)return e.props.ref;return e.props.ref||e.ref}(n);return Z.cloneElement(n,{...HD(r,n.props),ref:t?PD(t,e):e})}return Z.Children.count(n)>1?Z.Children.only(null):null}));jD.displayName="SlotClone";var BD=({children:e})=>Gh.jsx(Gh.Fragment,{children:e});function zD(e){return Z.isValidElement(e)&&e.type===BD}function HD(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...e)=>{o(...e),a(...e)}:a&&(n[r]=a):"style"===r?n[r]={...a,...o}:"className"===r&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}var UD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=Z.forwardRef(((e,n)=>{const{asChild:r,...a}=e,o=r?FD:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),Gh.jsx(o,{...a,ref:n})}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function $D(e){const t=Z.useRef(e);return Z.useEffect((()=>{t.current=e})),Z.useMemo((()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)}),[])}function GD(e,t=(null==globalThis?void 0:globalThis.document)){const n=$D(e);Z.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}var VD,qD="dismissableLayer.update",WD="dismissableLayer.pointerDownOutside",YD="dismissableLayer.focusOutside",KD=Z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),XD=Z.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:i,onDismiss:s,...l}=e,c=Z.useContext(KD),[u,d]=Z.useState(null),p=(null==u?void 0:u.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,h]=Z.useState({}),f=LD(t,(e=>d(e))),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(g),b=u?m.indexOf(u):-1,v=c.layersWithOutsidePointerEventsDisabled.size>0,k=b>=y,w=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=$D(e),r=Z.useRef(!1),a=Z.useRef((()=>{}));return Z.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){JD(WD,n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=r,t.addEventListener("click",a.current,{once:!0})):r()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...c.branches].some((e=>e.contains(t)));k&&!n&&(null==a||a(e),null==i||i(e),e.defaultPrevented||null==s||s())}),p),x=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=$D(e),r=Z.useRef(!1);return Z.useEffect((()=>{const e=e=>{if(e.target&&!r.current){JD(YD,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...c.branches].some((e=>e.contains(t)))||(null==o||o(e),null==i||i(e),e.defaultPrevented||null==s||s())}),p);return GD((e=>{b===c.layers.size-1&&(null==r||r(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),p),Z.useEffect((()=>{if(u)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(VD=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),ZD(),()=>{n&&1===c.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=VD)}}),[u,p,n,c]),Z.useEffect((()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),ZD())}),[u,c]),Z.useEffect((()=>{const e=()=>h({});return document.addEventListener(qD,e),()=>document.removeEventListener(qD,e)}),[]),Gh.jsx(UD.div,{...l,ref:f,style:{pointerEvents:v?k?"auto":"none":void 0,...e.style},onFocusCapture:RD(e.onFocusCapture,x.onFocusCapture),onBlurCapture:RD(e.onBlurCapture,x.onBlurCapture),onPointerDownCapture:RD(e.onPointerDownCapture,w.onPointerDownCapture)})}));XD.displayName="DismissableLayer";var QD=Z.forwardRef(((e,t)=>{const n=Z.useContext(KD),r=Z.useRef(null),a=LD(t,r);return Z.useEffect((()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),Gh.jsx(UD.div,{...e,ref:a})}));function ZD(){const e=new CustomEvent(qD);document.dispatchEvent(e)}function JD(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?function(e,t){e&&ue.flushSync((()=>e.dispatchEvent(t)))}(a,o):a.dispatchEvent(o)}QD.displayName="DismissableLayerBranch";var eM=Boolean(null==globalThis?void 0:globalThis.document)?Z.useLayoutEffect:()=>{},tM=ee["useId".toString()]||(()=>{}),nM=0;function rM(e){const[t,n]=Z.useState(tM());return eM((()=>{n((e=>e??String(nM++)))}),[e]),e||(t?`radix-${t}`:"")}const aM=["top","right","bottom","left"],oM=Math.min,iM=Math.max,sM=Math.round,lM=Math.floor,cM=e=>({x:e,y:e}),uM={left:"right",right:"left",bottom:"top",top:"bottom"},dM={start:"end",end:"start"};function pM(e,t,n){return iM(e,oM(t,n))}function hM(e,t){return"function"==typeof e?e(t):e}function fM(e){return e.split("-")[0]}function mM(e){return e.split("-")[1]}function gM(e){return"x"===e?"y":"x"}function yM(e){return"y"===e?"height":"width"}function bM(e){return["top","bottom"].includes(fM(e))?"y":"x"}function vM(e){return gM(bM(e))}function kM(e){return e.replace(/start|end/g,(e=>dM[e]))}function wM(e){return e.replace(/left|right|bottom|top/g,(e=>uM[e]))}function xM(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function EM(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function _M(e,t,n){let{reference:r,floating:a}=e;const o=bM(t),i=vM(t),s=yM(i),l=fM(t),c="y"===o,u=r.x+r.width/2-a.width/2,d=r.y+r.height/2-a.height/2,p=r[s]/2-a[s]/2;let h;switch(l){case"top":h={x:u,y:r.y-a.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-a.width,y:d};break;default:h={x:r.x,y:r.y}}switch(mM(t)){case"start":h[i]-=p*(n&&c?-1:1);break;case"end":h[i]+=p*(n&&c?-1:1)}return h}async function SM(e,t){var n;void 0===t&&(t={});const{x:r,y:a,platform:o,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=hM(t,e),f=xM(h),m=s[p?"floating"===d?"reference":"floating":d],g=EM(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(m)))||n?m:m.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,b=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),v=await(null==o.isElement?void 0:o.isElement(b))&&await(null==o.getScale?void 0:o.getScale(b))||{x:1,y:1},k=EM(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:b,strategy:l}):y);return{top:(g.top-k.top+f.top)/v.y,bottom:(k.bottom-g.bottom+f.bottom)/v.y,left:(g.left-k.left+f.left)/v.x,right:(k.right-g.right+f.right)/v.x}}function TM(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function CM(e){return aM.some((t=>e[t]>=0))}function AM(){return"undefined"!=typeof window}function NM(e){return OM(e)?(e.nodeName||"").toLowerCase():"#document"}function IM(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function RM(e){var t;return null==(t=(OM(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function OM(e){return!!AM()&&(e instanceof Node||e instanceof IM(e).Node)}function PM(e){return!!AM()&&(e instanceof Element||e instanceof IM(e).Element)}function LM(e){return!!AM()&&(e instanceof HTMLElement||e instanceof IM(e).HTMLElement)}function DM(e){return!(!AM()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof IM(e).ShadowRoot)}function MM(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=UM(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function FM(e){return["table","td","th"].includes(NM(e))}function jM(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(V4){return!1}}))}function BM(e){const t=zM(),n=PM(e)?UM(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function zM(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function HM(e){return["html","body","#document"].includes(NM(e))}function UM(e){return IM(e).getComputedStyle(e)}function $M(e){return PM(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function GM(e){if("html"===NM(e))return e;const t=e.assignedSlot||e.parentNode||DM(e)&&e.host||RM(e);return DM(t)?t.host:t}function VM(e){const t=GM(e);return HM(t)?e.ownerDocument?e.ownerDocument.body:e.body:LM(t)&&MM(t)?t:VM(t)}function qM(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const a=VM(e),o=a===(null==(r=e.ownerDocument)?void 0:r.body),i=IM(a);if(o){const e=WM(i);return t.concat(i,i.visualViewport||[],MM(a)?a:[],e&&n?qM(e):[])}return t.concat(a,qM(a,[],n))}function WM(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function YM(e){const t=UM(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=LM(e),o=a?e.offsetWidth:n,i=a?e.offsetHeight:r,s=sM(n)!==o||sM(r)!==i;return s&&(n=o,r=i),{width:n,height:r,$:s}}function KM(e){return PM(e)?e:e.contextElement}function XM(e){const t=KM(e);if(!LM(t))return cM(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=YM(t);let i=(o?sM(n.width):n.width)/r,s=(o?sM(n.height):n.height)/a;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const QM=cM(0);function ZM(e){const t=IM(e);return zM()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:QM}function JM(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect(),o=KM(e);let i=cM(1);t&&(r?PM(r)&&(i=XM(r)):i=XM(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==IM(e))&&t}(o,n,r)?ZM(o):cM(0);let l=(a.left+s.x)/i.x,c=(a.top+s.y)/i.y,u=a.width/i.x,d=a.height/i.y;if(o){const e=IM(o),t=r&&PM(r)?IM(r):r;let n=e,a=WM(n);for(;a&&r&&t!==n;){const e=XM(a),t=a.getBoundingClientRect(),r=UM(a),o=t.left+(a.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(a.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=i,n=IM(a),a=WM(n)}}return EM({width:u,height:d,x:l,y:c})}function eF(e,t){const n=$M(e).scrollLeft;return t?t.left+n:JM(RM(e)).left+n}function tF(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:eF(e,r)),y:r.top+t.scrollTop}}function nF(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=IM(e),r=RM(e),a=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,s=0,l=0;if(a){o=a.width,i=a.height;const e=zM();(!e||e&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}return{width:o,height:i,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=RM(e),n=$M(e),r=e.ownerDocument.body,a=iM(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=iM(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+eF(e);const s=-n.scrollTop;return"rtl"===UM(r).direction&&(i+=iM(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:i,y:s}}(RM(e));else if(PM(t))r=function(e,t){const n=JM(e,!0,"fixed"===t),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=LM(e)?XM(e):cM(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:r*o.y}}(t,n);else{const n=ZM(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return EM(r)}function rF(e,t){const n=GM(e);return!(n===t||!PM(n)||HM(n))&&("fixed"===UM(n).position||rF(n,t))}function aF(e,t,n){const r=LM(t),a=RM(t),o="fixed"===n,i=JM(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=cM(0);if(r||!r&&!o)if(("body"!==NM(t)||MM(a))&&(s=$M(t)),r){const e=JM(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&(l.x=eF(a));const c=!a||r||o?cM(0):tF(a,s);return{x:i.left+s.scrollLeft-l.x-c.x,y:i.top+s.scrollTop-l.y-c.y,width:i.width,height:i.height}}function oF(e){return"static"===UM(e).position}function iF(e,t){if(!LM(e)||"fixed"===UM(e).position)return null;if(t)return t(e);let n=e.offsetParent;return RM(e)===n&&(n=n.ownerDocument.body),n}function sF(e,t){const n=IM(e);if(jM(e))return n;if(!LM(e)){let t=GM(e);for(;t&&!HM(t);){if(PM(t)&&!oF(t))return t;t=GM(t)}return n}let r=iF(e,t);for(;r&&FM(r)&&oF(r);)r=iF(r,t);return r&&HM(r)&&oF(r)&&!BM(r)?n:r||function(e){let t=GM(e);for(;LM(t)&&!HM(t);){if(BM(t))return t;if(jM(t))return null;t=GM(t)}return null}(e)||n}const lF={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o="fixed"===a,i=RM(r),s=!!t&&jM(t.floating);if(r===i||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=cM(1);const u=cM(0),d=LM(r);if((d||!d&&!o)&&(("body"!==NM(r)||MM(i))&&(l=$M(r)),LM(r))){const e=JM(r);c=XM(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!i||d||o?cM(0):tF(i,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}},getDocumentElement:RM,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[..."clippingAncestors"===n?jM(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=qM(e,[],!1).filter((e=>PM(e)&&"body"!==NM(e))),a=null;const o="fixed"===UM(e).position;let i=o?GM(e):e;for(;PM(i)&&!HM(i);){const t=UM(i),n=BM(i);n||"fixed"!==t.position||(a=null),(o?!n&&!a:!n&&"static"===t.position&&a&&["absolute","fixed"].includes(a.position)||MM(i)&&!n&&rF(e,i))?r=r.filter((e=>e!==i)):a=t,i=GM(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=o[0],s=o.reduce(((e,n)=>{const r=nF(t,n,a);return e.top=iM(r.top,e.top),e.right=oM(r.right,e.right),e.bottom=oM(r.bottom,e.bottom),e.left=iM(r.left,e.left),e}),nF(t,i,a));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:sF,getElementRects:async function(e){const t=this.getOffsetParent||sF,n=this.getDimensions,r=await n(e.floating);return{reference:aF(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=YM(e);return{width:t,height:n}},getScale:XM,isElement:PM,isRTL:function(e){return"rtl"===UM(e).direction}};function cF(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uF(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=KM(e),u=a||o?[...c?qM(c):[],...qM(t)]:[];u.forEach((e=>{a&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)}));const d=c&&s?function(e,t){let n,r=null;const a=RM(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:h}=c;if(s||t(),!p||!h)return;const f={rootMargin:-lM(d)+"px "+-lM(a.clientWidth-(u+p))+"px "+-lM(a.clientHeight-(d+h))+"px "+-lM(u)+"px",threshold:iM(0,oM(1,l))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return i();r?i(!1,r):n=setTimeout((()=>{i(!1,1e-7)}),1e3)}1!==r||cF(c,e.getBoundingClientRect())||i(),m=!1}try{r=new IntersectionObserver(g,{...f,root:a.ownerDocument})}catch(V4){r=new IntersectionObserver(g,f)}r.observe(e)}(!0),o}(c,n):null;let p,h=-1,f=null;i&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=f)||e.observe(t)}))),n()})),c&&!l&&f.observe(c),f.observe(t));let m=l?JM(e):null;return l&&function t(){const r=JM(e);m&&!cF(m,r)&&n();m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{a&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const dF=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:a}=e,o=await(null==r.isRTL?void 0:r.isRTL(a.floating)),i=fM(n),s=mM(n),l="y"===bM(n),c=["left","top"].includes(i)?-1:1,u=o&&l?-1:1,d=hM(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:a+l.x,y:o+l.y,data:{...l,placement:i}}}}},pF=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=hM(e,t),c={x:n,y:r},u=await SM(t,l),d=bM(fM(a)),p=gM(d);let h=c[p],f=c[d];if(o){const e="y"===p?"bottom":"right";h=pM(h+u["y"===p?"top":"left"],h,h-u[e])}if(i){const e="y"===d?"bottom":"right";f=pM(f+u["y"===d?"top":"left"],f,f-u[e])}const m=s.fn({...t,[p]:h,[d]:f});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:o,[d]:i}}}}}},hF=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=hM(e,t);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const y=fM(a),b=bM(s),v=fM(s)===s,k=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(v||!m?[wM(s)]:function(e){const t=wM(e);return[kM(e),t,kM(t)]}(s)),x="none"!==f;!p&&x&&w.push(...function(e,t,n,r){const a=mM(e);let o=function(e,t,n){const r=["left","right"],a=["right","left"],o=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?o:i;default:return[]}}(fM(e),"start"===n,r);return a&&(o=o.map((e=>e+"-"+a)),t&&(o=o.concat(o.map(kM)))),o}(s,m,f,k));const E=[s,...w],_=await SM(t,g),S=[];let T=(null==(r=o.flip)?void 0:r.overflows)||[];if(u&&S.push(_[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=mM(e),a=vM(e),o=yM(a);let i="x"===a?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=wM(i)),[i,wM(i)]}(a,i,k);S.push(_[e[0]],_[e[1]])}if(T=[...T,{placement:a,overflows:S}],!S.every((e=>e<=0))){var C,A;const e=((null==(C=o.flip)?void 0:C.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:T},reset:{placement:t}};let n=null==(A=T.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:A.placement;if(!n)switch(h){case"bestFit":{var N;const e=null==(N=T.filter((e=>{if(x){const t=bM(e.placement);return t===b||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:N[0];e&&(n=e);break}case"initialPlacement":n=s}if(a!==n)return{reset:{placement:n}}}return{}}}},fF=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:i,elements:s}=t,{apply:l=()=>{},...c}=hM(e,t),u=await SM(t,c),d=fM(a),p=mM(a),h="y"===bM(a),{width:f,height:m}=o.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=p===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,g="end"===p?"top":"bottom");const b=m-u.top-u.bottom,v=f-u.left-u.right,k=oM(m-u[g],b),w=oM(f-u[y],v),x=!t.middlewareData.shift;let E=k,_=w;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(_=v),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=b),x&&!p){const e=iM(u.left,0),t=iM(u.right,0),n=iM(u.top,0),r=iM(u.bottom,0);h?_=f-2*(0!==e||0!==t?e+t:iM(u.left,u.right)):E=m-2*(0!==n||0!==r?n+r:iM(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:E});const S=await i.getDimensions(s.floating);return f!==S.width||m!==S.height?{reset:{rects:!0}}:{}}}},mF=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=hM(e,t);switch(r){case"referenceHidden":{const e=TM(await SM(t,{...a,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:CM(e)}}}case"escaped":{const e=TM(await SM(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:CM(e)}}}default:return{}}}}},gF=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=hM(e,t)||{};if(null==c)return{};const d=xM(u),p={x:n,y:r},h=vM(a),f=yM(h),m=await i.getDimensions(c),g="y"===h,y=g?"top":"left",b=g?"bottom":"right",v=g?"clientHeight":"clientWidth",k=o.reference[f]+o.reference[h]-p[h]-o.floating[f],w=p[h]-o.reference[h],x=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let E=x?x[v]:0;E&&await(null==i.isElement?void 0:i.isElement(x))||(E=s.floating[v]||o.floating[f]);const _=k/2-w/2,S=E/2-m[f]/2-1,T=oM(d[y],S),C=oM(d[b],S),A=T,N=E-m[f]-C,I=E/2-m[f]/2+_,R=pM(A,I,N),O=!l.arrow&&null!=mM(a)&&I!==R&&o.reference[f]/2-(I<A?T:C)-m[f]/2<0,P=O?I<A?I-A:I-N:0;return{[h]:p[h]+P,data:{[h]:R,centerOffset:I-R-P,...O&&{alignmentOffset:P}},reset:O}}}),yF=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=hM(e,t),u={x:n,y:r},d=bM(a),p=gM(d);let h=u[p],f=u[d];const m=hM(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===p?"height":"width",t=o.reference[p]-o.floating[e]+g.mainAxis,n=o.reference[p]+o.reference[e]-g.mainAxis;h<t?h=t:h>n&&(h=n)}if(c){var y,b;const e="y"===p?"width":"height",t=["top","left"].includes(fM(a)),n=o.reference[d]-o.floating[e]+(t&&(null==(y=i.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),r=o.reference[d]+o.reference[e]+(t?0:(null==(b=i.offset)?void 0:b[d])||0)-(t?g.crossAxis:0);f<n?f=n:f>r&&(f=r)}return{[p]:h,[d]:f}}}},bF=(e,t,n)=>{const r=new Map,a={platform:lF,...n},o={...a.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:i}=n,s=o.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=_M(c,r,l),p=r,h={},f=0;for(let m=0;m<s.length;m++){const{name:n,fn:o}=s[m],{x:g,y:y,data:b,reset:v}=await o({x:u,y:d,initialPlacement:r,placement:p,strategy:a,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,h={...h,[n]:{...h[n],...b}},v&&f<=50&&(f++,"object"==typeof v&&(v.placement&&(p=v.placement),v.rects&&(c=!0===v.rects?await i.getElementRects({reference:e,floating:t,strategy:a}):v.rects),({x:u,y:d}=_M(c,p,l))),m=-1)}return{x:u,y:d,placement:p,strategy:a,middlewareData:h}})(e,t,{...a,platform:o})};var vF="undefined"!=typeof document?Z.useLayoutEffect:Z.useEffect;function kF(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!kF(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;0!=r--;){const n=a[r];if(("_owner"!==n||!e.$$typeof)&&!kF(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function wF(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xF(e,t){const n=wF(e);return Math.round(t*n)/n}function EF(e){const t=Z.useRef(e);return vF((()=>{t.current=e})),t}function _F(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:i}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,d]=Z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=Z.useState(r);kF(p,r)||h(r);const[f,m]=Z.useState(null),[g,y]=Z.useState(null),b=Z.useCallback((e=>{e!==x.current&&(x.current=e,m(e))}),[]),v=Z.useCallback((e=>{e!==E.current&&(E.current=e,y(e))}),[]),k=o||f,w=i||g,x=Z.useRef(null),E=Z.useRef(null),_=Z.useRef(u),S=null!=l,T=EF(l),C=EF(a),A=EF(c),N=Z.useCallback((()=>{if(!x.current||!E.current)return;const e={placement:t,strategy:n,middleware:p};C.current&&(e.platform=C.current),bF(x.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==A.current};I.current&&!kF(_.current,t)&&(_.current=t,ue.flushSync((()=>{d(t)})))}))}),[p,t,n,C,A]);vF((()=>{!1===c&&_.current.isPositioned&&(_.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[c]);const I=Z.useRef(!1);vF((()=>(I.current=!0,()=>{I.current=!1})),[]),vF((()=>{if(k&&(x.current=k),w&&(E.current=w),k&&w){if(T.current)return T.current(k,w,N);N()}}),[k,w,N,T,S]);const R=Z.useMemo((()=>({reference:x,floating:E,setReference:b,setFloating:v})),[b,v]),O=Z.useMemo((()=>({reference:k,floating:w})),[k,w]),P=Z.useMemo((()=>{const e={position:n,left:0,top:0};if(!O.floating)return e;const t=xF(O.floating,u.x),r=xF(O.floating,u.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...wF(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,s,O.floating,u.x,u.y]);return Z.useMemo((()=>({...u,update:N,refs:R,elements:O,floatingStyles:P})),[u,N,R,O,P])}const SF=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(a=n,{}.hasOwnProperty.call(a,"current"))?null!=n.current?gF({element:n.current,padding:r}).fn(t):{}:n?gF({element:n,padding:r}).fn(t):{};var a}}),TF=(e,t)=>({...dF(e),options:[e,t]}),CF=(e,t)=>({...pF(e),options:[e,t]}),AF=(e,t)=>({...yF(e),options:[e,t]}),NF=(e,t)=>({...hF(e),options:[e,t]}),IF=(e,t)=>({...fF(e),options:[e,t]}),RF=(e,t)=>({...mF(e),options:[e,t]}),OF=(e,t)=>({...SF(e),options:[e,t]});var PF=Z.forwardRef(((e,t)=>{const{children:n,width:r=10,height:a=5,...o}=e;return Gh.jsx(UD.svg,{...o,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:Gh.jsx("polygon",{points:"0,0 30,0 15,10"})})}));PF.displayName="Arrow";var LF=PF;function DF(e){const[t,n]=Z.useState(void 0);return eM((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let a,o;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,o=t.blockSize}else a=e.offsetWidth,o=e.offsetHeight;n({width:a,height:o})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}var MF="Popper",[FF,jF]=DD(MF),[BF,zF]=FF(MF),HF=e=>{const{__scopePopper:t,children:n}=e,[r,a]=Z.useState(null);return Gh.jsx(BF,{scope:t,anchor:r,onAnchorChange:a,children:n})};HF.displayName=MF;var UF="PopperAnchor",$F=Z.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=zF(UF,n),i=Z.useRef(null),s=LD(t,i);return Z.useEffect((()=>{o.onAnchorChange((null==r?void 0:r.current)||i.current)})),r?null:Gh.jsx(UD.div,{...a,ref:s})}));$F.displayName=UF;var GF="PopperContent",[VF,qF]=FF(GF),WF=Z.forwardRef(((e,t)=>{var n,r,a,o,i,s;const{__scopePopper:l,side:c="bottom",sideOffset:u=0,align:d="center",alignOffset:p=0,arrowPadding:h=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:b=!1,updatePositionStrategy:v="optimized",onPlaced:k,...w}=e,x=zF(GF,l),[E,_]=Z.useState(null),S=LD(t,(e=>_(e))),[T,C]=Z.useState(null),A=DF(T),N=(null==A?void 0:A.width)??0,I=(null==A?void 0:A.height)??0,R=c+("center"!==d?"-"+d:""),O="number"==typeof g?g:{top:0,right:0,bottom:0,left:0,...g},P=Array.isArray(m)?m:[m],L=P.length>0,D={padding:O,boundary:P.filter(QF),altBoundary:L},{refs:M,floatingStyles:F,placement:j,isPositioned:B,middlewareData:z}=_F({strategy:"fixed",placement:R,whileElementsMounted:(...e)=>uF(...e,{animationFrame:"always"===v}),elements:{reference:x.anchor},middleware:[TF({mainAxis:u+I,alignmentAxis:p}),f&&CF({mainAxis:!0,crossAxis:!1,limiter:"partial"===y?AF():void 0,...D}),f&&NF({...D}),IF({...D,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:a,height:o}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${a}px`),i.setProperty("--radix-popper-anchor-height",`${o}px`)}}),T&&OF({element:T,padding:h}),ZF({arrowWidth:N,arrowHeight:I}),b&&RF({strategy:"referenceHidden",...D})]}),[H,U]=JF(j),$=$D(k);eM((()=>{B&&(null==$||$())}),[B,$]);const G=null==(n=z.arrow)?void 0:n.x,V=null==(r=z.arrow)?void 0:r.y,q=0!==(null==(a=z.arrow)?void 0:a.centerOffset),[W,Y]=Z.useState();return eM((()=>{E&&Y(window.getComputedStyle(E).zIndex)}),[E]),Gh.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:B?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[null==(o=z.transformOrigin)?void 0:o.x,null==(i=z.transformOrigin)?void 0:i.y].join(" "),...(null==(s=z.hide)?void 0:s.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:Gh.jsx(VF,{scope:l,placedSide:H,onArrowChange:C,arrowX:G,arrowY:V,shouldHideArrow:q,children:Gh.jsx(UD.div,{"data-side":H,"data-align":U,...w,ref:S,style:{...w.style,animation:B?void 0:"none"}})})})}));WF.displayName=GF;var YF="PopperArrow",KF={top:"bottom",right:"left",bottom:"top",left:"right"},XF=Z.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,a=qF(YF,n),o=KF[a.placedSide];return Gh.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:Gh.jsx(LF,{...r,ref:t,style:{...r.style,display:"block"}})})}));function QF(e){return null!==e}XF.displayName=YF;var ZF=e=>({name:"transformOrigin",options:e,fn(t){var n,r,a;const{placement:o,rects:i,middlewareData:s}=t,l=0!==(null==(n=s.arrow)?void 0:n.centerOffset),c=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[d,p]=JF(o),h={start:"0%",center:"50%",end:"100%"}[p],f=((null==(r=s.arrow)?void 0:r.x)??0)+c/2,m=((null==(a=s.arrow)?void 0:a.y)??0)+u/2;let g="",y="";return"bottom"===d?(g=l?h:`${f}px`,y=-u+"px"):"top"===d?(g=l?h:`${f}px`,y=`${i.floating.height+u}px`):"right"===d?(g=-u+"px",y=l?h:`${m}px`):"left"===d&&(g=`${i.floating.width+u}px`,y=l?h:`${m}px`),{data:{x:g,y:y}}}});function JF(e){const[t,n="center"]=e.split("-");return[t,n]}var ej=HF,tj=$F,nj=WF,rj=XF;var aj=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=Z.useState(),r=Z.useRef({}),a=Z.useRef(e),o=Z.useRef("none"),i=e?"mounted":"unmounted",[s,l]=function(e,t){return Z.useReducer(((e,n)=>t[e][n]??e),e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Z.useEffect((()=>{const e=oj(r.current);o.current="mounted"===s?e:"none"}),[s]),eM((()=>{const t=r.current,n=a.current;if(n!==e){const r=o.current,i=oj(t);if(e)l("MOUNT");else if("none"===i||"none"===(null==t?void 0:t.display))l("UNMOUNT");else{l(n&&r!==i?"ANIMATION_OUT":"UNMOUNT")}a.current=e}}),[e,l]),eM((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,i=o=>{const i=oj(r.current).includes(o.animationName);if(o.target===t&&i&&(l("ANIMATION_END"),!a.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},s=e=>{e.target===t&&(o.current=oj(r.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}l("ANIMATION_END")}),[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:Z.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),a="function"==typeof n?n({present:r.isPresent}):Z.Children.only(n),o=LD(r.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;if(a)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof n||r.isPresent?Z.cloneElement(a,{ref:o}):null};function oj(e){return(null==e?void 0:e.animationName)||"none"}function ij({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,a]=function({defaultProp:e,onChange:t}){const n=Z.useState(e),[r]=n,a=Z.useRef(r),o=$D(t);return Z.useEffect((()=>{a.current!==r&&(o(r),a.current=r)}),[r,a,o]),n}({defaultProp:t,onChange:n}),o=void 0!==e,i=o?e:r,s=$D(n);return[i,Z.useCallback((t=>{if(o){const n="function"==typeof t?t(e):t;n!==e&&s(n)}else a(t)}),[o,e,a,s])]}aj.displayName="Presence";var sj=Z.forwardRef(((e,t)=>Gh.jsx(UD.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));sj.displayName="VisuallyHidden";var lj=sj,[cj,uj]=DD("Tooltip",[jF]),dj=jF(),pj="TooltipProvider",hj=700,fj="tooltip.open",[mj,gj]=cj(pj),yj=e=>{const{__scopeTooltip:t,delayDuration:n=hj,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:o}=e,[i,s]=Z.useState(!0),l=Z.useRef(!1),c=Z.useRef(0);return Z.useEffect((()=>{const e=c.current;return()=>window.clearTimeout(e)}),[]),Gh.jsx(mj,{scope:t,isOpenDelayed:i,delayDuration:n,onOpen:Z.useCallback((()=>{window.clearTimeout(c.current),s(!1)}),[]),onClose:Z.useCallback((()=>{window.clearTimeout(c.current),c.current=window.setTimeout((()=>s(!0)),r)}),[r]),isPointerInTransitRef:l,onPointerInTransitChange:Z.useCallback((e=>{l.current=e}),[]),disableHoverableContent:a,children:o})};yj.displayName=pj;var bj="Tooltip",[vj,kj]=cj(bj),wj=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a=!1,onOpenChange:o,disableHoverableContent:i,delayDuration:s}=e,l=gj(bj,e.__scopeTooltip),c=dj(t),[u,d]=Z.useState(null),p=rM(),h=Z.useRef(0),f=i??l.disableHoverableContent,m=s??l.delayDuration,g=Z.useRef(!1),[y=!1,b]=ij({prop:r,defaultProp:a,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(fj))):l.onClose(),null==o||o(e)}}),v=Z.useMemo((()=>y?g.current?"delayed-open":"instant-open":"closed"),[y]),k=Z.useCallback((()=>{window.clearTimeout(h.current),h.current=0,g.current=!1,b(!0)}),[b]),w=Z.useCallback((()=>{window.clearTimeout(h.current),h.current=0,b(!1)}),[b]),x=Z.useCallback((()=>{window.clearTimeout(h.current),h.current=window.setTimeout((()=>{g.current=!0,b(!0),h.current=0}),m)}),[m,b]);return Z.useEffect((()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)}),[]),Gh.jsx(ej,{...c,children:Gh.jsx(vj,{scope:t,contentId:p,open:y,stateAttribute:v,trigger:u,onTriggerChange:d,onTriggerEnter:Z.useCallback((()=>{l.isOpenDelayed?x():k()}),[l.isOpenDelayed,x,k]),onTriggerLeave:Z.useCallback((()=>{f?w():(window.clearTimeout(h.current),h.current=0)}),[w,f]),onOpen:k,onClose:w,disableHoverableContent:f,children:n})})};wj.displayName=bj;var xj="TooltipTrigger",Ej=Z.forwardRef(((e,t)=>{const{__scopeTooltip:n,...r}=e,a=kj(xj,n),o=gj(xj,n),i=dj(n),s=LD(t,Z.useRef(null),a.onTriggerChange),l=Z.useRef(!1),c=Z.useRef(!1),u=Z.useCallback((()=>l.current=!1),[]);return Z.useEffect((()=>()=>document.removeEventListener("pointerup",u)),[u]),Gh.jsx(tj,{asChild:!0,...i,children:Gh.jsx(UD.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:s,onPointerMove:RD(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(c.current||o.isPointerInTransitRef.current||(a.onTriggerEnter(),c.current=!0))})),onPointerLeave:RD(e.onPointerLeave,(()=>{a.onTriggerLeave(),c.current=!1})),onPointerDown:RD(e.onPointerDown,(()=>{l.current=!0,document.addEventListener("pointerup",u,{once:!0})})),onFocus:RD(e.onFocus,(()=>{l.current||a.onOpen()})),onBlur:RD(e.onBlur,a.onClose),onClick:RD(e.onClick,a.onClose)})})}));Ej.displayName=xj;var[_j,Sj]=cj("TooltipPortal",{forceMount:void 0}),Tj="TooltipContent",Cj=Z.forwardRef(((e,t)=>{const n=Sj(Tj,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...o}=e,i=kj(Tj,e.__scopeTooltip);return Gh.jsx(aj,{present:r||i.open,children:i.disableHoverableContent?Gh.jsx(Rj,{side:a,...o,ref:t}):Gh.jsx(Aj,{side:a,...o,ref:t})})})),Aj=Z.forwardRef(((e,t)=>{const n=kj(Tj,e.__scopeTooltip),r=gj(Tj,e.__scopeTooltip),a=Z.useRef(null),o=LD(t,a),[i,s]=Z.useState(null),{trigger:l,onClose:c}=n,u=a.current,{onPointerInTransitChange:d}=r,p=Z.useCallback((()=>{s(null),d(!1)}),[d]),h=Z.useCallback(((e,t)=>{const n=e.currentTarget,r={x:e.clientX,y:e.clientY},a=function(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(r,function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,a,o)){case o:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(r,n.getBoundingClientRect())),o=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const t=e[r];for(;n.length>=2;){const e=n[n.length-1],r=n[n.length-2];if(!((e.x-r.x)*(t.y-r.y)>=(e.y-r.y)*(t.x-r.x)))break;n.pop()}n.push(t)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...a,...function(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}(t.getBoundingClientRect())]);s(o),d(!0)}),[d]);return Z.useEffect((()=>()=>p()),[p]),Z.useEffect((()=>{if(l&&u){const e=e=>h(e,u),t=e=>h(e,l);return l.addEventListener("pointerleave",e),u.addEventListener("pointerleave",t),()=>{l.removeEventListener("pointerleave",e),u.removeEventListener("pointerleave",t)}}}),[l,u,h,p]),Z.useEffect((()=>{if(i){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=(null==l?void 0:l.contains(t))||(null==u?void 0:u.contains(t)),a=!function(e,t){const{x:n,y:r}=e;let a=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const e=t[o].x,s=t[o].y,l=t[i].x,c=t[i].y;s>r!=c>r&&n<(l-e)*(r-s)/(c-s)+e&&(a=!a)}return a}(n,i);r?p():a&&(p(),c())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[l,u,i,c,p]),Gh.jsx(Rj,{...e,ref:o})})),[Nj,Ij]=cj(bj,{isInside:!1}),Rj=Z.forwardRef(((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:i,...s}=e,l=kj(Tj,n),c=dj(n),{onClose:u}=l;return Z.useEffect((()=>(document.addEventListener(fj,u),()=>document.removeEventListener(fj,u))),[u]),Z.useEffect((()=>{if(l.trigger){const e=e=>{const t=e.target;(null==t?void 0:t.contains(l.trigger))&&u()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[l.trigger,u]),Gh.jsx(XD,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:Gh.jsxs(nj,{"data-state":l.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[Gh.jsx(BD,{children:r}),Gh.jsx(Nj,{scope:n,isInside:!0,children:Gh.jsx(lj,{id:l.contentId,role:"tooltip",children:a||r})})]})})}));Cj.displayName=Tj;var Oj="TooltipArrow",Pj=Z.forwardRef(((e,t)=>{const{__scopeTooltip:n,...r}=e,a=dj(n);return Ij(Oj,n).isInside?null:Gh.jsx(rj,{...a,...r,ref:t})}));Pj.displayName=Oj;var Lj=yj,Dj=Ej,Mj=Cj,Fj=Pj;const jj=Z.createContext(void 0),Bj=({children:e,...t})=>{const n=TD();return Gh.jsx(jj.Provider,{value:{...n,...t},children:Gh.jsx(ND,{children:Gh.jsx(Lj,{children:e})})})},zj=()=>{const e=Z.useContext(jj);if(!e)throw new Error("useChat must be used within a ChatProvider");return e},Hj=Z.createContext(void 0);function Uj({children:e}){const t=function(){var e;const[t,n]=Z.useState(null),{value:r,setTrue:a,setFalse:o}=Yh(!1),[i,s]=Z.useState({title:"",content:""}),[l,c]=Z.useState({title:void 0,content:void 0}),{addAttachment:u}=zj(),d={data:i,errors:l,labels:{title:(null==(e=null==t?void 0:t.workflowModalProps)?void 0:e.titleInputLabel)||"Title",content:(null==t?void 0:t.contentType.contentInputLabel)||"Content"},validate(){const e={};return i.title.trim()||(e.title=`${d.labels.title} is required`),i.content.trim()||(e.content=`${d.labels.content} is required`),e},onChange(e){const{name:t,value:n}=e.target;s((e=>({...e,[t]:n})))},onSubmit(e){if(e.preventDefault(),!(null==t?void 0:t.contentType))return;const n=d.validate();if(Object.values(n).some((e=>!!e)))return void c(n);const r={...i,id:Kh(),contentType:t.contentType};u(r),o(),s({title:"",content:""}),c({title:void 0,content:void 0})}};return{selectedInput:t,selectInput:n,isOpen:r,onOpen:a,onClose:o,form:d}}();return Gh.jsx(Hj.Provider,{value:t,children:e})}const $j=()=>{const e=Z.useContext(Hj);if(!e)throw new Error("useAttachmentsBar must be used within a AttachmentsBarProvider");return e},Gj=Z.createContext(void 0),Vj=({children:e,name:t})=>{const n=Z.useRef(null);return Gh.jsx(Gj.Provider,{value:{name:t,focusItem:n},children:e})},qj=()=>{const e=Z.useContext(Gj);if(!e)throw new Error("useFeedbackItem must be used within a FeedbackItemProvider");return e},Wj=Z.createContext(void 0),Yj=({children:e,field:t,fieldProps:n,autoFocus:r})=>{const{errors:a}=lD(),o=a[t.name];return Gh.jsx(Wj.Provider,{value:{field:t,fieldProps:n,error:o,autoFocus:r},children:e})},Kj=()=>{const e=Z.useContext(Wj);if(!e)throw new Error("useFormField must be used within a FormFieldProvider");return e},Xj=Z.createContext(void 0);const Qj=({children:e,value:t})=>Gh.jsx(Xj.Provider,{value:t,children:e}),Zj=Z.createContext(void 0),Jj=({children:e,componentStyles:t})=>Gh.jsx(Zj.Provider,{value:{componentStyles:t},children:e}),eB=Z.createContext(void 0);function tB({children:e}){const[t,n]=J.useState(null),{value:r,setTrue:a,setFalse:o}=Yh(!1);return Gh.jsx(eB.Provider,{value:{selectedItem:t,selectItem:n,isOpen:r,onOpen:a,onClose:o},children:e})}const nB=()=>{const e=Z.useContext(eB);if(!e)throw new Error("useMessageAttachments must be used within a MessageAttachmentsProvider");return e},rB=Z.createContext(void 0),aB=({children:e,message:t})=>Gh.jsx(rB.Provider,{value:{message:t},children:e}),oB=()=>{const e=Z.useContext(rB);if(!e)throw new Error("useMessage must be used within a MessageProvider");return e},iB=["light","dark"],sB="(prefers-color-scheme: dark)",lB="undefined"==typeof window,cB=Z.createContext(void 0),uB={setColorMode:e=>{},colorModes:[]};function dB(e,t){const n=Z.useContext(cB)??uB;return"dark"===(n.forcedColorMode??n.resolvedColorMode)?t:e}const pB=e=>(Z.useContext(cB),Gh.jsx(fB,{...e})),hB=["light","dark"],fB=({forcedColorMode:e,disableTransitionOnChange:t=!1,enableSystem:n=!1,enableColorScheme:r=!0,storageKey:a="inkeep-colorMode",colorModes:o=hB,defaultColorMode:i=(n?"system":"light"),attribute:s="data-theme",value:l,children:c,nonce:u,shadowHostId:d,rootId:p})=>{const[h,f]=Z.useState((()=>gB(a,i))),[m,g]=Z.useState((()=>gB(a))),y=l?Object.values(l):o,b=Z.useCallback((e=>{var a;let o=e;if(!o)return;"system"===e&&n&&(o=bB());const c=l?l[o]:o,u=t?yB():null,h=d&&p&&(null==(a=document.getElementById(d))?void 0:a.shadowRoot),f=h?h.getElementById(p)??document.documentElement:document.documentElement;if("class"===s?(f.classList.remove(...y),c&&f.classList.add(c)):c?f.setAttribute(s,c):f.removeAttribute(s),r){const e=iB.includes(i)?i:null,t=iB.includes(o)?o:e;f.style.colorScheme=t}null==u||u()}),[]),v=Z.useCallback((e=>{f(e);try{localStorage.setItem(a,e)}catch(V4){}}),[e]),k=Z.useCallback((t=>{const r=bB(t);g(r),"system"===h&&n&&!e&&b("system")}),[h,e]);Z.useEffect((()=>{const e=window.matchMedia(sB);return e.addListener(k),k(e),()=>e.removeListener(k)}),[k]),Z.useEffect((()=>{const e=e=>{if(e.key!==a)return;const t=e.newValue||i;v(t)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[v]),Z.useEffect((()=>{b(e??h)}),[e,h]);const w=Z.useMemo((()=>({colorMode:h,setColorMode:v,forcedColorMode:e,resolvedColorMode:"system"===h?m:h,colorModes:n?[...o,"system"]:o,systemColorMode:n?m:void 0})),[h,v,e,m,n,o]);return Gh.jsxs(cB.Provider,{value:w,children:[Gh.jsx(mB,{forcedColorMode:e,disableTransitionOnChange:t,enableSystem:n,enableColorScheme:r,storageKey:a,colorModes:o,defaultColorMode:i,attribute:s,value:l,children:c,attrs:y,nonce:u,shadowHostId:d,rootId:p}),c]})},mB=Z.memo((({forcedColorMode:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultColorMode:o,value:i,attrs:s,nonce:l,shadowHostId:c,rootId:u})=>{const d="system"===o,p=(()=>{const e=c&&u?`document.getElementById('${c}').shadowRoot.getElementById('${u}')`:"document.documentElement";if("class"===n){return`var d=${e},c=d.classList;${`c.remove(${s.map((e=>`'${e}'`)).join(",")})`};`}return`var d=${e},n='${n}',s='setAttribute';`})(),h=(()=>{if(!a)return"";return(iB.includes(o)?o:null)?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e"})(),f=(e,t=!1,r=!0)=>{const o=i?i[e]:e,s=t?`${e}|| ''`:`'${o}'`;let l="";return a&&r&&!t&&iB.includes(e)&&(l+=`d.style.colorScheme = '${e}';`),"class"===n?l+=t||o?`c.add(${s})`:"null":o&&(l+=`d[s](n,${s})`),l},m=e?`!function(){${p}${f(e)}}()`:r?`!function(){try{${p}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${d})){var t='${sB}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${f(i?"x[e]":"e",!0)}}${d?"":`else{${f(o,!1,!1)}}`}${h}}catch(e){}}()`:`!function(){try{${p}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${f(i?"x[e]":"e",!0)}}else{${f(o,!1,!1)};}${h}}catch(t){}}();`;return Gh.jsx("script",{nonce:l,dangerouslySetInnerHTML:{__html:m}})}),(()=>!0)),gB=(e,t)=>{if(lB)return;let n;try{n=localStorage.getItem(e)||void 0}catch(V4){}return n||t},yB=()=>{const e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout((()=>{document.head.removeChild(e)}),1)}},bB=e=>{e||(e=window.matchMedia(sB));return e.matches?"dark":"light"};var vB=Object.prototype.hasOwnProperty;function kB(e,t,n){for(n of e.keys())if(wB(n,t))return n}function wB(e,t){var n,r,a;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&wB(e[r],t[r]););return-1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e){if((a=r)&&"object"==typeof a&&!(a=kB(t,a)))return!1;if(!t.has(a))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e){if((a=r[0])&&"object"==typeof a&&!(a=kB(t,a)))return!1;if(!wB(r[1],t.get(a)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return-1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}if(!n||"object"==typeof e){for(n in r=0,e){if(vB.call(e,n)&&++r&&!vB.call(t,n))return!1;if(!(n in t)||!wB(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}function xB(){const{baseSettings:e}=JO(),[t,n]=Z.useState([]),r=function(e){const t=Z.useRef(void 0);wB(t.current,e)||(t.current=e);return t.current}(e.theme.styles),{customStyles:a,linksCount:o}=Z.useMemo((()=>{if(!r||!Array.isArray(r))return{customStyles:null,loaded:!0};const{links:e,styleSheets:t}=r.reduce(((e,t)=>("link"===t.type?e.links.push(t):"style"===t.type&&e.styleSheets.push(t),e)),{links:[],styleSheets:[]}),a=t.map((e=>Gh.jsx("style",{type:"text/css",dangerouslySetInnerHTML:{__html:e.value}},e.key??Qh("link_")))),o=e.map((e=>{const t=e.key??Qh("stylesheet_");return Gh.jsx("link",{id:t,rel:"stylesheet",type:"text/css",href:e.value,onLoad:()=>{n((t=>[...new Set([...t,e.value])]))}},t)}));return{customStyles:Gh.jsxs(Gh.Fragment,{children:[o,a]}),linksCount:e.length}}),[r]);return{customStyles:a,loaded:t.length>=(o??0)}}const EB=({children:e})=>{const{baseSettings:t}=JO(),{theme:n,primaryBrandColor:r,shadowHost:a,rootElement:o,colorMode:i}=t,{primaryColors:s,varsClassName:l}=n,{fontFamily:c,fontSize:d,zIndex:p}=n,h=_x(s,r),f=function(e){const t={};for(const[n,r]of Object.entries(e)){const e=Tx[n]||n,a=(n,r=[])=>{for(const[o,i]of Object.entries(n)){const n=[...r,o];if("object"==typeof i&&null!==i)a(i,n);else{const r=n.map((e=>e.replace(/([A-Z])/g,"-$1").toLowerCase())).join("-");t[`--ikp-${e}-${r}`]=i}}};a(r)}return t}({colors:u(n.colors,h),fontFamily:c,fontSize:d,zIndex:p}),{customStyles:m,loaded:g}=xB(),{sync:y,forcedColorMode:b,...v}=i??{},[k,w]=Z.useState(),x=Z.useRef(null);return Z.useEffect((()=>{var e,t;if(!(null==y?void 0:y.target))return;const n="string"==typeof y.target?document.querySelector(y.target):y.target;if(!n)return;function r(e,t){return t.reduce(((t,n)=>({...t,[n]:e.getAttribute(n)})),{})}const a=new MutationObserver((()=>{var e,t;const a=r(n,y.attributes),o=(null==(e=y.isDarkMode)?void 0:e.call(y,a))?"dark":"light";null==(t=y.onChange)||t.call(y,o),w(o)}));a.observe(n,{attributes:!0,attributeFilter:y.attributes,childList:!1,subtree:!1}),x.current=a;const o=(null==(e=y.isDarkMode)?void 0:e.call(y,r(n,null==y?void 0:y.attributes)))?"dark":"light";return null==(t=y.onChange)||t.call(y,o),w(o),()=>a.disconnect()}),[y]),Gh.jsxs(Gh.Fragment,{children:[m,g&&Gh.jsx(pB,{forcedColorMode:b??k,...v,shadowHostId:null==a?void 0:a.id,rootId:null==o?void 0:o.id,children:Gh.jsx("div",{className:l,style:{display:"contents",...f},children:e})})]})};function _B(e){const{children:t,config:n,componentType:r}=e;return Gh.jsx(ZO,{value:{...n,componentType:r},children:Gh.jsx(EB,{children:Gh.jsx(dP,{children:Gh.jsx(fP,{children:t})})})})}const SB=Z.createContext(void 0),TB=({children:e,source:t})=>Gh.jsx(SB.Provider,{value:{source:t},children:e}),CB=()=>{const e=Z.useContext(SB);if(!e)throw new Error("useSourceItem must be used within a SourceItemProvider");return e};function AB(e){const t=Z.useRef(e);return Z.useEffect((()=>{t.current=e})),Z.useMemo((()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)}),[])}function NB({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,a]=function({defaultProp:e,onChange:t}){const n=Z.useState(e),[r]=n,a=Z.useRef(r),o=AB(t);return Z.useEffect((()=>{a.current!==r&&(o(r),a.current=r)}),[r,a,o]),n}({defaultProp:t,onChange:n}),o=void 0!==e,i=o?e:r,s=AB(n);return[i,Z.useCallback((t=>{if(o){const n="function"==typeof t?t(e):t;n!==e&&s(n)}else a(t)}),[o,e,a,s])]}const IB=Z.createContext(void 0),RB=({children:e,value:t})=>Gh.jsx(IB.Provider,{value:t,children:e}),OB=()=>{const e=Z.useContext(IB);if(!e)throw new Error("useSidebarChat must be used within a SidebarChatProvider");return e};function PB(e,t){var n;const{prefix:r}=JO(),a=Z.useContext(Zj),o=function(e,t){return!!(null==t?void 0:t.componentStyles)&&e in t.componentStyles}(e,a);return[t,o?null==(n=null==a?void 0:a.componentStyles)?void 0:n[e]:void 0,`${r}-${wD(e)}`].filter(Boolean).join(" ")}function LB(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function DB(...e){return t=>{let n=!1;const r=e.map((e=>{const r=LB(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():LB(e[t],null)}}}}function MB(...e){return Z.useCallback(DB(...e),e)}const FB=(...e)=>e.map((e=>{var t;return null==(t=null==e?void 0:e.trim)?void 0:t.call(e)})).filter(Boolean).join(" "),jB=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,BB=e=>{const t={};let n;for(;n=jB.exec(e);)t[n[1]]=n[2];return t},zB=(e,t)=>{if(kD(e)){if(kD(t))return`${e};${t}`;e=BB(e)}else kD(t)&&(t=BB(t));return Object.assign({},e??{},t??{})};function HB(...e){let t={};for(let n of e){for(let e in t)e.startsWith("on")&&"function"==typeof t[e]&&"function"==typeof n[e]?t[e]=vD(n[e],t[e]):t[e]="className"!==e&&"class"!==e?"style"!==e?void 0!==n[e]?n[e]:t[e]:zB(t[e],n[e]):FB(t[e],n[e]);for(let e in n)void 0===t[e]&&(t[e]=n[e])}return t}const UB=(e,t)=>{const n=Z.memo(Z.forwardRef(((n,r)=>{const{_id:a,className:o,children:i,...s}=t,{asChild:l,children:c,...u}=n,d=c||i,p=HB(s,u,{className:PB(a,o),"data-part":wD(a)});if(!l)return Z.createElement(e,{...p,ref:r},d);const h=Z.Children.only(d);if(!Z.isValidElement(h))return null;const f=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}(h);return Z.cloneElement(h,{...HB(p,h.props),ref:r?DB(r,f):f})})));return n.displayName=e.displayName||e.name,n},$B=new Proxy(UB,{apply(e,t,n){const r=n[0],a=n[1];return UB(r,a)}});function GB(){return GB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},GB.apply(null,arguments)}function VB(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}var qB=Z.useLayoutEffect,WB=function(e,t){"function"!=typeof e?e.current=t:e(t)},YB={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},KB=function(e){Object.keys(YB).forEach((function(t){e.style.setProperty(t,YB[t],"important")}))},XB=null,QB=function(e,t){var n=e.scrollHeight;return"border-box"===t.sizingStyle.boxSizing?n+t.borderSize:n-t.paddingSize};var ZB=function(){},JB=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],ez=!!document.documentElement.currentStyle,tz=function(e){var t=window.getComputedStyle(e);if(null===t)return null;var n,r=(n=t,JB.reduce((function(e,t){return e[t]=n[t],e}),{})),a=r.boxSizing;return""===a?null:(ez&&"border-box"===a&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px"),{sizingStyle:r,paddingSize:parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),borderSize:parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth)})};function nz(e,t,n){var r,a,o=(r=n,a=J.useRef(r),qB((function(){a.current=r})),a);Z.useLayoutEffect((function(){var n=function(e){return o.current(e)};if(e)return e.addEventListener(t,n),function(){return e.removeEventListener(t,n)}}),[])}var rz=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],az=function(e,t){var n=e.cacheMeasurements,r=e.maxRows,a=e.minRows,o=e.onChange,i=void 0===o?ZB:o,s=e.onHeightChange,l=void 0===s?ZB:s,c=VB(e,rz),u=void 0!==c.value,d=Z.useRef(null),p=function(e,t){var n=J.useRef();return J.useCallback((function(r){e.current=r,n.current&&WB(n.current,null),n.current=t,t&&WB(t,r)}),[t])}(d,t),h=Z.useRef(0),f=Z.useRef(),m=function(){var e=d.current,t=n&&f.current?f.current:tz(e);if(t){f.current=t;var o=function(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=1/0),XB||((XB=document.createElement("textarea")).setAttribute("tabindex","-1"),XB.setAttribute("aria-hidden","true"),KB(XB)),null===XB.parentNode&&document.body.appendChild(XB);var a=e.paddingSize,o=e.borderSize,i=e.sizingStyle,s=i.boxSizing;Object.keys(i).forEach((function(e){var t=e;XB.style[t]=i[t]})),KB(XB),XB.value=t;var l=QB(XB,e);XB.value=t,l=QB(XB,e),XB.value="x";var c=XB.scrollHeight-a,u=c*n;"border-box"===s&&(u=u+a+o),l=Math.max(u,l);var d=c*r;return"border-box"===s&&(d=d+a+o),[l=Math.min(d,l),c]}(t,e.value||e.placeholder||"x",a,r),i=o[0],s=o[1];h.current!==i&&(h.current=i,e.style.setProperty("height",i+"px","important"),l(i,{rowHeight:s}))}};return Z.useLayoutEffect(m),function(e,t){nz(document.body,"reset",(function(n){e.current.form===n.target&&t(n)}))}(d,(function(){if(!u){var e=d.current,t=e.value;requestAnimationFrame((function(){t!==e.value&&m()}))}})),nz(window,"resize",m),function(e){nz(document.fonts,"loadingdone",e)}(m),Z.createElement("textarea",GB({},c,{onChange:function(e){u||m(),i(e)},ref:p}))},oz=Z.forwardRef(az),iz="Avatar",[sz,lz]=DD(iz),[cz,uz]=sz(iz),dz=Z.forwardRef(((e,t)=>{const{__scopeAvatar:n,...r}=e,[a,o]=Z.useState("idle");return Gh.jsx(cz,{scope:n,imageLoadingStatus:a,onImageLoadingStatusChange:o,children:Gh.jsx(UD.span,{...r,ref:t})})}));dz.displayName=iz;var pz="AvatarImage",hz=Z.forwardRef(((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:a=()=>{},...o}=e,i=uz(pz,n),s=function(e,t){const[n,r]=Z.useState("idle");return eM((()=>{if(!e)return void r("error");let n=!0;const a=new window.Image,o=e=>()=>{n&&r(e)};return r("loading"),a.onload=o("loaded"),a.onerror=o("error"),a.src=e,t&&(a.referrerPolicy=t),()=>{n=!1}}),[e,t]),n}(r,o.referrerPolicy),l=$D((e=>{a(e),i.onImageLoadingStatusChange(e)}));return eM((()=>{"idle"!==s&&l(s)}),[s,l]),"loaded"===s?Gh.jsx(UD.img,{...o,ref:t,src:r}):null}));hz.displayName=pz;var fz="AvatarFallback",mz=Z.forwardRef(((e,t)=>{const{__scopeAvatar:n,delayMs:r,...a}=e,o=uz(fz,n),[i,s]=Z.useState(void 0===r);return Z.useEffect((()=>{if(void 0!==r){const e=window.setTimeout((()=>s(!0)),r);return()=>window.clearTimeout(e)}}),[r]),i&&"loaded"!==o.imageLoadingStatus?Gh.jsx(UD.span,{...a,ref:t}):null}));mz.displayName=fz;var gz=dz,yz=hz,bz=mz;var vz="Checkbox",[kz,wz]=DD(vz),[xz,Ez]=kz(vz),_z=Z.forwardRef(((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:o,required:i,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=e,[p,h]=Z.useState(null),f=LD(t,(e=>h(e))),m=Z.useRef(!1),g=!p||(u||!!p.closest("form")),[y=!1,b]=ij({prop:a,defaultProp:o,onChange:c}),v=Z.useRef(y);return Z.useEffect((()=>{const e=null==p?void 0:p.form;if(e){const t=()=>b(v.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}}),[p,b]),Gh.jsxs(xz,{scope:n,state:y,disabled:s,children:[Gh.jsx(UD.button,{type:"button",role:"checkbox","aria-checked":Az(y)?"mixed":y,"aria-required":i,"data-state":Nz(y),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:f,onKeyDown:RD(e.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:RD(e.onClick,(e=>{b((e=>!!Az(e)||!e)),g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())}))}),g&&Gh.jsx(Cz,{control:p,bubbles:!m.current,name:r,value:l,checked:y,required:i,disabled:s,form:u,style:{transform:"translateX(-100%)"},defaultChecked:!Az(o)&&o})]})}));_z.displayName=vz;var Sz="CheckboxIndicator",Tz=Z.forwardRef(((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,o=Ez(Sz,n);return Gh.jsx(aj,{present:r||Az(o.state)||!0===o.state,children:Gh.jsx(UD.span,{"data-state":Nz(o.state),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})}));Tz.displayName=Sz;var Cz=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:a,...o}=e,i=Z.useRef(null),s=function(e){const t=Z.useRef({value:e,previous:e});return Z.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}(n),l=DF(t);Z.useEffect((()=>{const e=i.current,t=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(t,"checked").set;if(s!==n&&a){const t=new Event("click",{bubbles:r});e.indeterminate=Az(n),a.call(e,!Az(n)&&n),e.dispatchEvent(t)}}),[s,n,r]);const c=Z.useRef(!Az(n)&&n);return Gh.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a??c.current,...o,tabIndex:-1,ref:i,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Az(e){return"indeterminate"===e}function Nz(e){return Az(e)?"indeterminate":e?"checked":"unchecked"}var Iz=_z,Rz=Tz,Oz=Z.forwardRef(((e,t)=>{const{children:n,...r}=e,a=Z.Children.toArray(n),o=a.find(Dz);if(o){const e=o.props.children,n=a.map((t=>t===o?Z.Children.count(e)>1?Z.Children.only(null):Z.isValidElement(e)?e.props.children:null:t));return Gh.jsx(Pz,{...r,ref:t,children:Z.isValidElement(e)?Z.cloneElement(e,void 0,n):null})}return Gh.jsx(Pz,{...r,ref:t,children:n})}));Oz.displayName="Slot";var Pz=Z.forwardRef(((e,t)=>{const{children:n,...r}=e;if(Z.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;if(a)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a)return e.props.ref;return e.props.ref||e.ref}(n),a=function(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...e)=>{o(...e),a(...e)}:a&&(n[r]=a):"style"===r?n[r]={...a,...o}:"className"===r&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==Z.Fragment&&(a.ref=t?PD(t,e):e),Z.cloneElement(n,a)}return Z.Children.count(n)>1?Z.Children.only(null):null}));Pz.displayName="SlotClone";var Lz=({children:e})=>Gh.jsx(Gh.Fragment,{children:e});function Dz(e){return Z.isValidElement(e)&&e.type===Lz}var Mz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=Z.forwardRef(((e,n)=>{const{asChild:r,...a}=e,o=r?Oz:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),Gh.jsx(o,{...a,ref:n})}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});var Fz,jz="dismissableLayer.update",Bz="dismissableLayer.pointerDownOutside",zz="dismissableLayer.focusOutside",Hz=Z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Uz=Z.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:i,onDismiss:s,...l}=e,c=Z.useContext(Hz),[u,d]=Z.useState(null),p=(null==u?void 0:u.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,h]=Z.useState({}),f=LD(t,(e=>d(e))),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(g),b=u?m.indexOf(u):-1,v=c.layersWithOutsidePointerEventsDisabled.size>0,k=b>=y,w=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=$D(e),r=Z.useRef(!1),a=Z.useRef((()=>{}));return Z.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){Vz(Bz,n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=r,t.addEventListener("click",a.current,{once:!0})):r()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...c.branches].some((e=>e.contains(t)));k&&!n&&(null==a||a(e),null==i||i(e),e.defaultPrevented||null==s||s())}),p),x=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=$D(e),r=Z.useRef(!1);return Z.useEffect((()=>{const e=e=>{if(e.target&&!r.current){Vz(zz,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...c.branches].some((e=>e.contains(t)))||(null==o||o(e),null==i||i(e),e.defaultPrevented||null==s||s())}),p);return GD((e=>{b===c.layers.size-1&&(null==r||r(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),p),Z.useEffect((()=>{if(u)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(Fz=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Gz(),()=>{n&&1===c.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=Fz)}}),[u,p,n,c]),Z.useEffect((()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Gz())}),[u,c]),Z.useEffect((()=>{const e=()=>h({});return document.addEventListener(jz,e),()=>document.removeEventListener(jz,e)}),[]),Gh.jsx(Mz.div,{...l,ref:f,style:{pointerEvents:v?k?"auto":"none":void 0,...e.style},onFocusCapture:RD(e.onFocusCapture,x.onFocusCapture),onBlurCapture:RD(e.onBlurCapture,x.onBlurCapture),onPointerDownCapture:RD(e.onPointerDownCapture,w.onPointerDownCapture)})}));Uz.displayName="DismissableLayer";var $z=Z.forwardRef(((e,t)=>{const n=Z.useContext(Hz),r=Z.useRef(null),a=LD(t,r);return Z.useEffect((()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),Gh.jsx(Mz.div,{...e,ref:a})}));function Gz(){const e=new CustomEvent(jz);document.dispatchEvent(e)}function Vz(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?function(e,t){e&&ue.flushSync((()=>e.dispatchEvent(t)))}(a,o):a.dispatchEvent(o)}$z.displayName="DismissableLayerBranch";var qz=0;function Wz(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Yz="focusScope.autoFocusOnMount",Kz="focusScope.autoFocusOnUnmount",Xz={bubbles:!1,cancelable:!0},Qz=Z.forwardRef(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...i}=e,[s,l]=Z.useState(null),c=$D(a),u=$D(o),d=Z.useRef(null),p=LD(t,(e=>l(e))),h=Z.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Z.useEffect((()=>{if(r){let e=function(e){if(h.paused||!s)return;const t=e.target;s.contains(t)?d.current=t:tH(d.current,{select:!0})},t=function(e){if(h.paused||!s)return;const t=e.relatedTarget;null!==t&&(s.contains(t)||tH(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&tH(s)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[r,s,h.paused]),Z.useEffect((()=>{if(s){nH.add(h);const t=document.activeElement;if(!s.contains(t)){const n=new CustomEvent(Yz,Xz);s.addEventListener(Yz,c),s.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(tH(r,{select:t}),document.activeElement!==n)return}((e=Zz(s),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&tH(s))}return()=>{s.removeEventListener(Yz,c),setTimeout((()=>{const e=new CustomEvent(Kz,Xz);s.addEventListener(Kz,u),s.dispatchEvent(e),e.defaultPrevented||tH(t??document.body,{select:!0}),s.removeEventListener(Kz,u),nH.remove(h)}),0)}}var e}),[s,c,u,h]);const f=Z.useCallback((e=>{if(!n&&!r)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,a=document.activeElement;if(t&&a){const t=e.currentTarget,[r,o]=function(e){const t=Zz(e),n=Jz(t,e),r=Jz(t.reverse(),e);return[n,r]}(t);r&&o?e.shiftKey||a!==o?e.shiftKey&&a===r&&(e.preventDefault(),n&&tH(o,{select:!0})):(e.preventDefault(),n&&tH(r,{select:!0})):a===t&&e.preventDefault()}}),[n,r,h.paused]);return Gh.jsx(Mz.div,{tabIndex:-1,...i,ref:p,onKeyDown:f})}));function Zz(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Jz(e,t){for(const n of e)if(!eH(n,{upTo:t}))return n}function eH(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function tH(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}Qz.displayName="FocusScope";var nH=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=rH(e,t),e.unshift(t)},remove(t){var n;e=rH(e,t),null==(n=e[0])||n.resume()}}}();function rH(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var aH=Z.forwardRef(((e,t)=>{const{children:n,width:r=10,height:a=5,...o}=e;return Gh.jsx(Mz.svg,{...o,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:Gh.jsx("polygon",{points:"0,0 30,0 15,10"})})}));aH.displayName="Arrow";var oH=aH,iH="Popper",[sH,lH]=DD(iH),[cH,uH]=sH(iH),dH=e=>{const{__scopePopper:t,children:n}=e,[r,a]=Z.useState(null);return Gh.jsx(cH,{scope:t,anchor:r,onAnchorChange:a,children:n})};dH.displayName=iH;var pH="PopperAnchor",hH=Z.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=uH(pH,n),i=Z.useRef(null),s=LD(t,i);return Z.useEffect((()=>{o.onAnchorChange((null==r?void 0:r.current)||i.current)})),r?null:Gh.jsx(Mz.div,{...a,ref:s})}));hH.displayName=pH;var fH="PopperContent",[mH,gH]=sH(fH),yH=Z.forwardRef(((e,t)=>{var n,r,a,o,i,s;const{__scopePopper:l,side:c="bottom",sideOffset:u=0,align:d="center",alignOffset:p=0,arrowPadding:h=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:b=!1,updatePositionStrategy:v="optimized",onPlaced:k,...w}=e,x=uH(fH,l),[E,_]=Z.useState(null),S=LD(t,(e=>_(e))),[T,C]=Z.useState(null),A=DF(T),N=(null==A?void 0:A.width)??0,I=(null==A?void 0:A.height)??0,R=c+("center"!==d?"-"+d:""),O="number"==typeof g?g:{top:0,right:0,bottom:0,left:0,...g},P=Array.isArray(m)?m:[m],L=P.length>0,D={padding:O,boundary:P.filter(wH),altBoundary:L},{refs:M,floatingStyles:F,placement:j,isPositioned:B,middlewareData:z}=_F({strategy:"fixed",placement:R,whileElementsMounted:(...e)=>uF(...e,{animationFrame:"always"===v}),elements:{reference:x.anchor},middleware:[TF({mainAxis:u+I,alignmentAxis:p}),f&&CF({mainAxis:!0,crossAxis:!1,limiter:"partial"===y?AF():void 0,...D}),f&&NF({...D}),IF({...D,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:a,height:o}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${a}px`),i.setProperty("--radix-popper-anchor-height",`${o}px`)}}),T&&OF({element:T,padding:h}),xH({arrowWidth:N,arrowHeight:I}),b&&RF({strategy:"referenceHidden",...D})]}),[H,U]=EH(j),$=$D(k);eM((()=>{B&&(null==$||$())}),[B,$]);const G=null==(n=z.arrow)?void 0:n.x,V=null==(r=z.arrow)?void 0:r.y,q=0!==(null==(a=z.arrow)?void 0:a.centerOffset),[W,Y]=Z.useState();return eM((()=>{E&&Y(window.getComputedStyle(E).zIndex)}),[E]),Gh.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:B?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[null==(o=z.transformOrigin)?void 0:o.x,null==(i=z.transformOrigin)?void 0:i.y].join(" "),...(null==(s=z.hide)?void 0:s.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:Gh.jsx(mH,{scope:l,placedSide:H,onArrowChange:C,arrowX:G,arrowY:V,shouldHideArrow:q,children:Gh.jsx(Mz.div,{"data-side":H,"data-align":U,...w,ref:S,style:{...w.style,animation:B?void 0:"none"}})})})}));yH.displayName=fH;var bH="PopperArrow",vH={top:"bottom",right:"left",bottom:"top",left:"right"},kH=Z.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,a=gH(bH,n),o=vH[a.placedSide];return Gh.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:Gh.jsx(oH,{...r,ref:t,style:{...r.style,display:"block"}})})}));function wH(e){return null!==e}kH.displayName=bH;var xH=e=>({name:"transformOrigin",options:e,fn(t){var n,r,a;const{placement:o,rects:i,middlewareData:s}=t,l=0!==(null==(n=s.arrow)?void 0:n.centerOffset),c=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[d,p]=EH(o),h={start:"0%",center:"50%",end:"100%"}[p],f=((null==(r=s.arrow)?void 0:r.x)??0)+c/2,m=((null==(a=s.arrow)?void 0:a.y)??0)+u/2;let g="",y="";return"bottom"===d?(g=l?h:`${f}px`,y=-u+"px"):"top"===d?(g=l?h:`${f}px`,y=`${i.floating.height+u}px`):"right"===d?(g=-u+"px",y=l?h:`${m}px`):"left"===d&&(g=`${i.floating.width+u}px`,y=l?h:`${m}px`),{data:{x:g,y:y}}}});function EH(e){const[t,n="center"]=e.split("-");return[t,n]}var _H=dH,SH=hH,TH=yH,CH=kH,AH=new WeakMap,NH=new WeakMap,IH={},RH=0,OH=function(e){return e&&(e.host||OH(e.parentNode))},PH=function(e,t,n,r){var a=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=OH(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);IH[n]||(IH[n]=new WeakMap);var o=IH[n],i=[],s=new Set,l=new Set(a),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};a.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),a=null!==t&&"false"!==t,l=(AH.get(e)||0)+1,c=(o.get(e)||0)+1;AH.set(e,l),o.set(e,c),i.push(e),1===l&&a&&NH.set(e,!0),1===c&&e.setAttribute(n,"true"),a||e.setAttribute(r,"true")}catch(V4){console.error("aria-hidden: cannot operate on ",e,V4)}}))};return u(t),s.clear(),RH++,function(){i.forEach((function(e){var t=AH.get(e)-1,a=o.get(e)-1;AH.set(e,t),o.set(e,a),t||(NH.has(e)||e.removeAttribute(r),NH.delete(e)),a||e.removeAttribute(n)})),--RH||(AH=new WeakMap,AH=new WeakMap,NH=new WeakMap,IH={})}},LH=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),PH(r,a,n,"aria-hidden")):function(){return null}},DH=function(){return DH=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},DH.apply(this,arguments)};function MH(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}function FH(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a<o;a++)!r&&a in t||(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var jH="right-scroll-bar-position",BH="width-before-scroll-bar";function zH(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var HH="undefined"!=typeof window?Z.useLayoutEffect:Z.useEffect,UH=new WeakMap;function $H(e,t){var n,r,a,o=(n=null,r=function(t){return e.forEach((function(e){return zH(e,t)}))},(a=Z.useState((function(){return{value:n,callback:r,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}}))[0]).callback=r,a.facade);return HH((function(){var t=UH.get(o);if(t){var n=new Set(t),r=new Set(e),a=o.current;n.forEach((function(e){r.has(e)||zH(e,null)})),r.forEach((function(e){n.has(e)||zH(e,a)}))}UH.set(o,e)}),[e]),o}function GH(e){return e}var VH=function(e){var t=e.sideCar,n=MH(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return Z.createElement(r,DH({},n))};VH.isSideCarExport=!0;var qH=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=GH);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var a=t(e,r);return n.push(a),function(){n=n.filter((function(e){return e!==a}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var a=n;n=[],a.forEach(e),t=n}var o=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(o)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=DH({async:!0,ssr:!1},e),t}(),WH=function(){},YH=Z.forwardRef((function(e,t){var n=Z.useRef(null),r=Z.useState({onScrollCapture:WH,onWheelCapture:WH,onTouchMoveCapture:WH}),a=r[0],o=r[1],i=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,p=e.sideCar,h=e.noRelative,f=e.noIsolation,m=e.inert,g=e.allowPinchZoom,y=e.as,b=void 0===y?"div":y,v=e.gapMode,k=MH(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=p,x=$H([n,t]),E=DH(DH({},k),a);return Z.createElement(Z.Fragment,null,u&&Z.createElement(w,{sideCar:qH,removeScrollBar:c,shards:d,noRelative:h,noIsolation:f,inert:m,setCallbacks:o,allowPinchZoom:!!g,lockRef:n,gapMode:v}),i?Z.cloneElement(Z.Children.only(s),DH(DH({},E),{ref:x})):Z.createElement(b,DH({},E,{className:l,ref:x}),s))}));YH.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},YH.classNames={fullWidth:BH,zeroRight:jH};function KH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var XH=function(){var e=0,t=null;return{add:function(n){var r,a;0==e&&(t=KH())&&(a=n,(r=t).styleSheet?r.styleSheet.cssText=a:r.appendChild(document.createTextNode(a)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},QH=function(){var e,t=(e=XH(),function(t,n){Z.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},ZH={left:0,top:0,right:0,gap:0},JH=function(e){return parseInt(e||"",10)||0},eU=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return ZH;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[JH(n),JH(r),JH(a)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},tU=QH(),nU="data-scroll-locked",rU=function(e,t,n,r){var a=e.left,o=e.top,i=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(nU,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(jH," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(BH," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(jH," .").concat(jH," {\n right: 0 ").concat(r,";\n }\n \n .").concat(BH," .").concat(BH," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(nU,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},aU=function(){var e=parseInt(document.body.getAttribute(nU)||"0",10);return isFinite(e)?e:0},oU=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=void 0===r?"margin":r;Z.useEffect((function(){return document.body.setAttribute(nU,(aU()+1).toString()),function(){var e=aU()-1;e<=0?document.body.removeAttribute(nU):document.body.setAttribute(nU,e.toString())}}),[]);var o=Z.useMemo((function(){return eU(a)}),[a]);return Z.createElement(tU,{styles:rU(o,!t,a,n?"":"!important")})},iU=!1;if("undefined"!=typeof window)try{var sU=Object.defineProperty({},"passive",{get:function(){return iU=!0,!0}});window.addEventListener("test",sU,sU),window.removeEventListener("test",sU,sU)}catch(kbe){iU=!1}var lU=!!iU&&{passive:!1},cU=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},uU=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),dU(e,r)){var a=pU(e,r);if(a[1]>a[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},dU=function(e,t){return"v"===e?function(e){return cU(e,"overflowY")}(t):function(e){return cU(e,"overflowX")}(t)},pU=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},hU=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fU=function(e){return[e.deltaX,e.deltaY]},mU=function(e){return e&&"current"in e?e.current:e},gU=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},yU=0,bU=[];function vU(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const kU=(wU=function(e){var t=Z.useRef([]),n=Z.useRef([0,0]),r=Z.useRef(),a=Z.useState(yU++)[0],o=Z.useState(QH)[0],i=Z.useRef(e);Z.useEffect((function(){i.current=e}),[e]),Z.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=FH([e.lockRef.current],(e.shards||[]).map(mU),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(a))})),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(a))}))}}}),[e.inert,e.lockRef.current,e.shards]);var s=Z.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var a,o=hU(e),s=n.current,l="deltaX"in e?e.deltaX:s[0]-o[0],c="deltaY"in e?e.deltaY:s[1]-o[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var p=uU(d,u);if(!p)return!0;if(p?a=d:(a="v"===d?"h":"v",p=uU(d,u)),!p)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=a),!a)return!0;var h=r.current||a;return function(e,t,n,r){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),o=a*r,i=n.target,s=t.contains(i),l=!1,c=o>0,u=0,d=0;do{if(!i)break;var p=pU(e,i),h=p[0],f=p[1]-p[2]-a*h;(h||f)&&dU(e,i)&&(u+=f,d+=h);var m=i.parentNode;i=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(c&&Math.abs(u)<1||!c&&Math.abs(d)<1)&&(l=!0),l}(h,t,e,"h"===h?l:c)}),[]),l=Z.useCallback((function(e){var n=e;if(bU.length&&bU[bU.length-1]===o){var r="deltaY"in n?fU(n):hU(n),a=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,a=r,t[0]===a[0]&&t[1]===a[1]);var t,a}))[0];if(a&&a.should)n.cancelable&&n.preventDefault();else if(!a){var l=(i.current.shards||[]).map(mU).filter(Boolean).filter((function(e){return e.contains(n.target)}));(l.length>0?s(n,l[0]):!i.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),c=Z.useCallback((function(e,n,r,a){var o={name:e,delta:n,target:r,should:a,shadowParent:vU(r)};t.current.push(o),setTimeout((function(){t.current=t.current.filter((function(e){return e!==o}))}),1)}),[]),u=Z.useCallback((function(e){n.current=hU(e),r.current=void 0}),[]),d=Z.useCallback((function(t){c(t.type,fU(t),t.target,s(t,e.lockRef.current))}),[]),p=Z.useCallback((function(t){c(t.type,hU(t),t.target,s(t,e.lockRef.current))}),[]);Z.useEffect((function(){return bU.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,lU),document.addEventListener("touchmove",l,lU),document.addEventListener("touchstart",u,lU),function(){bU=bU.filter((function(e){return e!==o})),document.removeEventListener("wheel",l,lU),document.removeEventListener("touchmove",l,lU),document.removeEventListener("touchstart",u,lU)}}),[]);var h=e.removeScrollBar,f=e.inert;return Z.createElement(Z.Fragment,null,f?Z.createElement(o,{styles:gU(a)}):null,h?Z.createElement(oU,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},qH.useMedium(wU),VH);var wU,xU=Z.forwardRef((function(e,t){return Z.createElement(YH,DH({},e,{ref:t,sideCar:kU}))}));xU.classNames=YH.classNames;var EU="Popover",[_U,SU]=DD(EU,[lH]),TU=lH(),[CU,AU]=_U(EU),NU=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:i=!1}=e,s=TU(t),l=Z.useRef(null),[c,u]=Z.useState(!1),[d=!1,p]=ij({prop:r,defaultProp:a,onChange:o});return Gh.jsx(_H,{...s,children:Gh.jsx(CU,{scope:t,contentId:rM(),triggerRef:l,open:d,onOpenChange:p,onOpenToggle:Z.useCallback((()=>p((e=>!e))),[p]),hasCustomAnchor:c,onCustomAnchorAdd:Z.useCallback((()=>u(!0)),[]),onCustomAnchorRemove:Z.useCallback((()=>u(!1)),[]),modal:i,children:n})})};NU.displayName=EU;var IU="PopoverAnchor",RU=Z.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,a=AU(IU,n),o=TU(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:s}=a;return Z.useEffect((()=>(i(),()=>s())),[i,s]),Gh.jsx(SH,{...o,...r,ref:t})}));RU.displayName=IU;var OU="PopoverTrigger",PU=Z.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,a=AU(OU,n),o=TU(n),i=LD(t,a.triggerRef),s=Gh.jsx(Mz.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":GU(a.open),...r,ref:i,onClick:RD(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?s:Gh.jsx(SH,{asChild:!0,...o,children:s})}));PU.displayName=OU;var[LU,DU]=_U("PopoverPortal",{forceMount:void 0}),MU="PopoverContent",FU=Z.forwardRef(((e,t)=>{const n=DU(MU,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,o=AU(MU,e.__scopePopover);return Gh.jsx(aj,{present:r||o.open,children:o.modal?Gh.jsx(jU,{...a,ref:t}):Gh.jsx(BU,{...a,ref:t})})}));FU.displayName=MU;var jU=Z.forwardRef(((e,t)=>{const n=AU(MU,e.__scopePopover),r=Z.useRef(null),a=LD(t,r),o=Z.useRef(!1);return Z.useEffect((()=>{const e=r.current;if(e)return LH(e)}),[]),Gh.jsx(xU,{as:Oz,allowPinchZoom:!0,children:Gh.jsx(zU,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:RD(e.onCloseAutoFocus,(e=>{var t;e.preventDefault(),o.current||null==(t=n.triggerRef.current)||t.focus()})),onPointerDownOutside:RD(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;o.current=r}),{checkForDefaultPrevented:!1}),onFocusOutside:RD(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})})})),BU=Z.forwardRef(((e,t)=>{const n=AU(MU,e.__scopePopover),r=Z.useRef(!1),a=Z.useRef(!1);return Gh.jsx(zU,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var o,i;null==(o=e.onCloseAutoFocus)||o.call(e,t),t.defaultPrevented||(r.current||null==(i=n.triggerRef.current)||i.focus(),t.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:t=>{var o,i;null==(o=e.onInteractOutside)||o.call(e,t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const s=t.target;(null==(i=n.triggerRef.current)?void 0:i.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})})),zU=Z.forwardRef(((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:i,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,p=AU(MU,n),h=TU(n);return Z.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Wz()),document.body.insertAdjacentElement("beforeend",e[1]??Wz()),qz++,()=>{1===qz&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),qz--}}),[]),Gh.jsx(Qz,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:Gh.jsx(Uz,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:Gh.jsx(TH,{"data-state":GU(p.open),role:"dialog",id:p.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})),HU="PopoverClose",UU=Z.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,a=AU(HU,n);return Gh.jsx(Mz.button,{type:"button",...r,ref:t,onClick:RD(e.onClick,(()=>a.onOpenChange(!1)))})}));UU.displayName=HU;var $U=Z.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,a=TU(n);return Gh.jsx(CH,{...a,...r,ref:t})}));function GU(e){return e?"open":"closed"}$U.displayName="PopoverArrow";var VU=NU,qU=PU,WU=FU,YU=$U,KU=Z.createContext(void 0);var XU="ScrollArea",[QU,ZU]=DD(XU),[JU,e$]=QU(XU),t$=Z.forwardRef(((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:o=600,...i}=e,[s,l]=Z.useState(null),[c,u]=Z.useState(null),[d,p]=Z.useState(null),[h,f]=Z.useState(null),[m,g]=Z.useState(null),[y,b]=Z.useState(0),[v,k]=Z.useState(0),[w,x]=Z.useState(!1),[E,_]=Z.useState(!1),S=LD(t,(e=>l(e))),T=function(e){const t=Z.useContext(KU);return e||t||"ltr"}(a);return Gh.jsx(JU,{scope:n,type:r,dir:T,scrollHideDelay:o,scrollArea:s,viewport:c,onViewportChange:u,content:d,onContentChange:p,scrollbarX:h,onScrollbarXChange:f,scrollbarXEnabled:w,onScrollbarXEnabledChange:x,scrollbarY:m,onScrollbarYChange:g,scrollbarYEnabled:E,onScrollbarYEnabledChange:_,onCornerWidthChange:b,onCornerHeightChange:k,children:Gh.jsx(UD.div,{dir:T,...i,ref:S,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":v+"px",...e.style}})})}));t$.displayName=XU;var n$="ScrollAreaViewport",r$=Z.forwardRef(((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...o}=e,i=e$(n$,n),s=LD(t,Z.useRef(null),i.onViewportChange);return Gh.jsxs(Gh.Fragment,{children:[Gh.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),Gh.jsx(UD.div,{"data-radix-scroll-area-viewport":"",...o,ref:s,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:Gh.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})}));r$.displayName=n$;var a$="ScrollAreaScrollbar",o$=Z.forwardRef(((e,t)=>{const{forceMount:n,...r}=e,a=e$(a$,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=a,s="horizontal"===e.orientation;return Z.useEffect((()=>(s?o(!0):i(!0),()=>{s?o(!1):i(!1)})),[s,o,i]),"hover"===a.type?Gh.jsx(i$,{...r,ref:t,forceMount:n}):"scroll"===a.type?Gh.jsx(s$,{...r,ref:t,forceMount:n}):"auto"===a.type?Gh.jsx(l$,{...r,ref:t,forceMount:n}):"always"===a.type?Gh.jsx(c$,{...r,ref:t}):null}));o$.displayName=a$;var i$=Z.forwardRef(((e,t)=>{const{forceMount:n,...r}=e,a=e$(a$,e.__scopeScrollArea),[o,i]=Z.useState(!1);return Z.useEffect((()=>{const e=a.scrollArea;let t=0;if(e){const n=()=>{window.clearTimeout(t),i(!0)},r=()=>{t=window.setTimeout((()=>i(!1)),a.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}}),[a.scrollArea,a.scrollHideDelay]),Gh.jsx(aj,{present:n||o,children:Gh.jsx(l$,{"data-state":o?"visible":"hidden",...r,ref:t})})})),s$=Z.forwardRef(((e,t)=>{const{forceMount:n,...r}=e,a=e$(a$,e.__scopeScrollArea),o="horizontal"===e.orientation,i=A$((()=>l("SCROLL_END")),100),[s,l]=(c="hidden",u={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},Z.useReducer(((e,t)=>u[e][t]??e),c));var c,u;return Z.useEffect((()=>{if("idle"===s){const e=window.setTimeout((()=>l("HIDE")),a.scrollHideDelay);return()=>window.clearTimeout(e)}}),[s,a.scrollHideDelay,l]),Z.useEffect((()=>{const e=a.viewport,t=o?"scrollLeft":"scrollTop";if(e){let n=e[t];const r=()=>{const r=e[t];n!==r&&(l("SCROLL"),i()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}}),[a.viewport,o,l,i]),Gh.jsx(aj,{present:n||"hidden"!==s,children:Gh.jsx(c$,{"data-state":"hidden"===s?"hidden":"visible",...r,ref:t,onPointerEnter:RD(e.onPointerEnter,(()=>l("POINTER_ENTER"))),onPointerLeave:RD(e.onPointerLeave,(()=>l("POINTER_LEAVE")))})})})),l$=Z.forwardRef(((e,t)=>{const n=e$(a$,e.__scopeScrollArea),{forceMount:r,...a}=e,[o,i]=Z.useState(!1),s="horizontal"===e.orientation,l=A$((()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;i(s?e:t)}}),10);return N$(n.viewport,l),N$(n.content,l),Gh.jsx(aj,{present:r||o,children:Gh.jsx(c$,{"data-state":o?"visible":"hidden",...a,ref:t})})})),c$=Z.forwardRef(((e,t)=>{const{orientation:n="vertical",...r}=e,a=e$(a$,e.__scopeScrollArea),o=Z.useRef(null),i=Z.useRef(0),[s,l]=Z.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=x$(s.viewport,s.content),u={...r,sizes:s,onSizesChange:l,hasThumb:Boolean(c>0&&c<1),onThumbChange:e=>o.current=e,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:e=>i.current=e};function d(e,t){return function(e,t,n,r="ltr"){const a=E$(n),o=a/2,i=t||o,s=a-i,l=n.scrollbar.paddingStart+i,c=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d="ltr"===r?[0,u]:[-1*u,0];return S$([l,c],d)(e)}(e,i.current,s,t)}return"horizontal"===n?Gh.jsx(u$,{...u,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const e=_$(a.viewport.scrollLeft,s,a.dir);o.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=d(e,a.dir))}}):"vertical"===n?Gh.jsx(d$,{...u,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const e=_$(a.viewport.scrollTop,s);o.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=d(e))}}):null})),u$=Z.forwardRef(((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=e$(a$,e.__scopeScrollArea),[i,s]=Z.useState(),l=Z.useRef(null),c=LD(t,l,o.onScrollbarXChange);return Z.useEffect((()=>{l.current&&s(getComputedStyle(l.current))}),[l]),Gh.jsx(f$,{"data-orientation":"horizontal",...a,ref:c,sizes:n,style:{bottom:0,left:"rtl"===o.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===o.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":E$(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(o.viewport){const r=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),T$(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:w$(i.paddingLeft),paddingEnd:w$(i.paddingRight)}})}})})),d$=Z.forwardRef(((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=e$(a$,e.__scopeScrollArea),[i,s]=Z.useState(),l=Z.useRef(null),c=LD(t,l,o.onScrollbarYChange);return Z.useEffect((()=>{l.current&&s(getComputedStyle(l.current))}),[l]),Gh.jsx(f$,{"data-orientation":"vertical",...a,ref:c,sizes:n,style:{top:0,right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":E$(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(o.viewport){const r=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),T$(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:w$(i.paddingTop),paddingEnd:w$(i.paddingBottom)}})}})})),[p$,h$]=QU(a$),f$=Z.forwardRef(((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...p}=e,h=e$(a$,n),[f,m]=Z.useState(null),g=LD(t,(e=>m(e))),y=Z.useRef(null),b=Z.useRef(""),v=h.viewport,k=r.content-r.viewport,w=$D(u),x=$D(l),E=A$(d,10);function _(e){if(y.current){const t=e.clientX-y.current.left,n=e.clientY-y.current.top;c({x:t,y:n})}}return Z.useEffect((()=>{const e=e=>{const t=e.target;(null==f?void 0:f.contains(t))&&w(e,k)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})}),[v,f,k,w]),Z.useEffect(x,[r,x]),N$(f,E),N$(h.content,E),Gh.jsx(p$,{scope:n,scrollbar:f,hasThumb:a,onThumbChange:$D(o),onThumbPointerUp:$D(i),onThumbPositionChange:x,onThumbPointerDown:$D(s),children:Gh.jsx(UD.div,{...p,ref:g,style:{position:"absolute",...p.style},onPointerDown:RD(e.onPointerDown,(e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),y.current=f.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),_(e)}})),onPointerMove:RD(e.onPointerMove,_),onPointerUp:RD(e.onPointerUp,(e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=b.current,h.viewport&&(h.viewport.style.scrollBehavior=""),y.current=null}))})})})),m$="ScrollAreaThumb",g$=Z.forwardRef(((e,t)=>{const{forceMount:n,...r}=e,a=h$(m$,e.__scopeScrollArea);return Gh.jsx(aj,{present:n||a.hasThumb,children:Gh.jsx(y$,{ref:t,...r})})})),y$=Z.forwardRef(((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,o=e$(m$,n),i=h$(m$,n),{onThumbPositionChange:s}=i,l=LD(t,(e=>i.onThumbChange(e))),c=Z.useRef(void 0),u=A$((()=>{c.current&&(c.current(),c.current=void 0)}),100);return Z.useEffect((()=>{const e=o.viewport;if(e){const t=()=>{if(u(),!c.current){const t=C$(e,s);c.current=t,s()}};return s(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}}),[o.viewport,u,s]),Gh.jsx(UD.div,{"data-state":i.hasThumb?"visible":"hidden",...a,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:RD(e.onPointerDownCapture,(e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;i.onThumbPointerDown({x:n,y:r})})),onPointerUp:RD(e.onPointerUp,i.onThumbPointerUp)})}));g$.displayName=m$;var b$="ScrollAreaCorner",v$=Z.forwardRef(((e,t)=>{const n=e$(b$,e.__scopeScrollArea),r=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&r?Gh.jsx(k$,{...e,ref:t}):null}));v$.displayName=b$;var k$=Z.forwardRef(((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=e$(b$,n),[o,i]=Z.useState(0),[s,l]=Z.useState(0),c=Boolean(o&&s);return N$(a.scrollbarX,(()=>{var e;const t=(null==(e=a.scrollbarX)?void 0:e.offsetHeight)||0;a.onCornerHeightChange(t),l(t)})),N$(a.scrollbarY,(()=>{var e;const t=(null==(e=a.scrollbarY)?void 0:e.offsetWidth)||0;a.onCornerWidthChange(t),i(t)})),c?Gh.jsx(UD.div,{...r,ref:t,style:{width:o,height:s,position:"absolute",right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:0,...e.style}}):null}));function w$(e){return e?parseInt(e,10):0}function x$(e,t){const n=e/t;return isNaN(n)?0:n}function E$(e){const t=x$(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function _$(e,t,n="ltr"){const r=E$(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,i=t.content-t.viewport,s=o-r,l=function(e,[t,n]){return Math.min(n,Math.max(t,e))}(e,"ltr"===n?[0,i]:[-1*i,0]);return S$([0,i],[0,s])(l)}function S$(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function T$(e,t){return e>0&&e<t}var C$=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function a(){const o={left:e.scrollLeft,top:e.scrollTop},i=n.left!==o.left,s=n.top!==o.top;(i||s)&&t(),n=o,r=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(r)};function A$(e,t){const n=$D(e),r=Z.useRef(0);return Z.useEffect((()=>()=>window.clearTimeout(r.current)),[]),Z.useCallback((()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)}),[n,t])}function N$(e,t){const n=$D(t);eM((()=>{let t=0;if(e){const r=new ResizeObserver((()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)}));return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}}),[e,n])}var I$=t$,R$=r$,O$=v$;function P$(e,[t,n]){return Math.min(n,Math.max(t,e))}function L$(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function D$(e,t=[]){let n=[];const r=()=>{const t=n.map((e=>Z.createContext(e)));return function(n){const r=(null==n?void 0:n[e])||t;return Z.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const a=Z.createContext(r),o=n.length;n=[...n,r];const i=t=>{var n;const{scope:r,children:i,...s}=t,l=(null==(n=null==r?void 0:r[e])?void 0:n[o])||a,c=Z.useMemo((()=>s),Object.values(s));return Gh.jsx(l.Provider,{value:c,children:i})};return i.displayName=t+"Provider",[i,function(n,i){var s;const l=(null==(s=null==i?void 0:i[e])?void 0:s[o])||a,c=Z.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},M$(r,...t)]}function M$(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return Z.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function F$(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function j$(...e){return t=>{let n=!1;const r=e.map((e=>{const r=F$(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():F$(e[t],null)}}}}function B$(...e){return Z.useCallback(j$(...e),e)}function z$(e){const t=U$(e),n=Z.forwardRef(((e,n)=>{const{children:r,...a}=e,o=Z.Children.toArray(r),i=o.find(G$);if(i){const e=i.props.children,r=o.map((t=>t===i?Z.Children.count(e)>1?Z.Children.only(null):Z.isValidElement(e)?e.props.children:null:t));return Gh.jsx(t,{...a,ref:n,children:Z.isValidElement(e)?Z.cloneElement(e,void 0,r):null})}return Gh.jsx(t,{...a,ref:n,children:r})}));return n.displayName=`${e}.Slot`,n}var H$=z$("Slot");function U$(e){const t=Z.forwardRef(((e,t)=>{const{children:n,...r}=e;if(Z.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;if(a)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a)return e.props.ref;return e.props.ref||e.ref}(n),a=function(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...e)=>{o(...e),a(...e)}:a&&(n[r]=a):"style"===r?n[r]={...a,...o}:"className"===r&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==Z.Fragment&&(a.ref=t?j$(t,e):e),Z.cloneElement(n,a)}return Z.Children.count(n)>1?Z.Children.only(null):null}));return t.displayName=`${e}.SlotClone`,t}var $$=Symbol("radix.slottable");function G$(e){return Z.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===$$}function V$(e){const t=e+"CollectionProvider",[n,r]=D$(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=e=>{const{scope:t,children:n}=e,r=J.useRef(null),o=J.useRef(new Map).current;return Gh.jsx(a,{scope:t,itemMap:o,collectionRef:r,children:n})};i.displayName=t;const s=e+"CollectionSlot",l=z$(s),c=J.forwardRef(((e,t)=>{const{scope:n,children:r}=e,a=B$(t,o(s,n).collectionRef);return Gh.jsx(l,{ref:a,children:r})}));c.displayName=s;const u=e+"CollectionItemSlot",d="data-radix-collection-item",p=z$(u),h=J.forwardRef(((e,t)=>{const{scope:n,children:r,...a}=e,i=J.useRef(null),s=B$(t,i),l=o(u,n);return J.useEffect((()=>(l.itemMap.set(i,{ref:i,...a}),()=>{l.itemMap.delete(i)}))),Gh.jsx(p,{[d]:"",ref:s,children:r})}));return h.displayName=u,[{Provider:i,Slot:c,ItemSlot:h},function(t){const n=o(e+"CollectionConsumer",t);return J.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)))}),[n.collectionRef,n.itemMap])},r]}var q$=Z.createContext(void 0);function W$(e){const t=Z.useContext(q$);return e||t||"ltr"}var Y$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=z$(`Primitive.${t}`),r=Z.forwardRef(((e,r)=>{const{asChild:a,...o}=e,i=a?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),Gh.jsx(i,{...o,ref:r})}));return r.displayName=`Primitive.${t}`,{...e,[t]:r}}),{});var K$,X$="dismissableLayer.update",Q$="dismissableLayer.pointerDownOutside",Z$="dismissableLayer.focusOutside",J$=Z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),eG=Z.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:i,onDismiss:s,...l}=e,c=Z.useContext(J$),[u,d]=Z.useState(null),p=(null==u?void 0:u.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,h]=Z.useState({}),f=B$(t,(e=>d(e))),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(g),b=u?m.indexOf(u):-1,v=c.layersWithOutsidePointerEventsDisabled.size>0,k=b>=y,w=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=AB(e),r=Z.useRef(!1),a=Z.useRef((()=>{}));return Z.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){rG(Q$,n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=r,t.addEventListener("click",a.current,{once:!0})):r()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...c.branches].some((e=>e.contains(t)));k&&!n&&(null==a||a(e),null==i||i(e),e.defaultPrevented||null==s||s())}),p),x=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=AB(e),r=Z.useRef(!1);return Z.useEffect((()=>{const e=e=>{if(e.target&&!r.current){rG(Z$,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...c.branches].some((e=>e.contains(t)))||(null==o||o(e),null==i||i(e),e.defaultPrevented||null==s||s())}),p);return function(e,t=(null==globalThis?void 0:globalThis.document)){const n=AB(e);Z.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}((e=>{b===c.layers.size-1&&(null==r||r(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),p),Z.useEffect((()=>{if(u)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(K$=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),nG(),()=>{n&&1===c.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=K$)}}),[u,p,n,c]),Z.useEffect((()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),nG())}),[u,c]),Z.useEffect((()=>{const e=()=>h({});return document.addEventListener(X$,e),()=>document.removeEventListener(X$,e)}),[]),Gh.jsx(Y$.div,{...l,ref:f,style:{pointerEvents:v?k?"auto":"none":void 0,...e.style},onFocusCapture:L$(e.onFocusCapture,x.onFocusCapture),onBlurCapture:L$(e.onBlurCapture,x.onBlurCapture),onPointerDownCapture:L$(e.onPointerDownCapture,w.onPointerDownCapture)})}));eG.displayName="DismissableLayer";var tG=Z.forwardRef(((e,t)=>{const n=Z.useContext(J$),r=Z.useRef(null),a=B$(t,r);return Z.useEffect((()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),Gh.jsx(Y$.div,{...e,ref:a})}));function nG(){const e=new CustomEvent(X$);document.dispatchEvent(e)}function rG(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?function(e,t){e&&ue.flushSync((()=>e.dispatchEvent(t)))}(a,o):a.dispatchEvent(o)}tG.displayName="DismissableLayerBranch";var aG=0;function oG(){Z.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??iG()),document.body.insertAdjacentElement("beforeend",e[1]??iG()),aG++,()=>{1===aG&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),aG--}}),[])}function iG(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var sG="focusScope.autoFocusOnMount",lG="focusScope.autoFocusOnUnmount",cG={bubbles:!1,cancelable:!0},uG=Z.forwardRef(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...i}=e,[s,l]=Z.useState(null),c=AB(a),u=AB(o),d=Z.useRef(null),p=B$(t,(e=>l(e))),h=Z.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Z.useEffect((()=>{if(r){let e=function(e){if(h.paused||!s)return;const t=e.target;s.contains(t)?d.current=t:fG(d.current,{select:!0})},t=function(e){if(h.paused||!s)return;const t=e.relatedTarget;null!==t&&(s.contains(t)||fG(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&fG(s)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[r,s,h.paused]),Z.useEffect((()=>{if(s){mG.add(h);const t=document.activeElement;if(!s.contains(t)){const n=new CustomEvent(sG,cG);s.addEventListener(sG,c),s.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(fG(r,{select:t}),document.activeElement!==n)return}((e=dG(s),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&fG(s))}return()=>{s.removeEventListener(sG,c),setTimeout((()=>{const e=new CustomEvent(lG,cG);s.addEventListener(lG,u),s.dispatchEvent(e),e.defaultPrevented||fG(t??document.body,{select:!0}),s.removeEventListener(lG,u),mG.remove(h)}),0)}}var e}),[s,c,u,h]);const f=Z.useCallback((e=>{if(!n&&!r)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,a=document.activeElement;if(t&&a){const t=e.currentTarget,[r,o]=function(e){const t=dG(e),n=pG(t,e),r=pG(t.reverse(),e);return[n,r]}(t);r&&o?e.shiftKey||a!==o?e.shiftKey&&a===r&&(e.preventDefault(),n&&fG(o,{select:!0})):(e.preventDefault(),n&&fG(r,{select:!0})):a===t&&e.preventDefault()}}),[n,r,h.paused]);return Gh.jsx(Y$.div,{tabIndex:-1,...i,ref:p,onKeyDown:f})}));function dG(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function pG(e,t){for(const n of e)if(!hG(n,{upTo:t}))return n}function hG(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function fG(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}uG.displayName="FocusScope";var mG=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=gG(e,t),e.unshift(t)},remove(t){var n;e=gG(e,t),null==(n=e[0])||n.resume()}}}();function gG(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var yG=Z.forwardRef(((e,t)=>{const{children:n,width:r=10,height:a=5,...o}=e;return Gh.jsx(Y$.svg,{...o,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:Gh.jsx("polygon",{points:"0,0 30,0 15,10"})})}));yG.displayName="Arrow";var bG=yG;var vG="Popper",[kG,wG]=D$(vG),[xG,EG]=kG(vG),_G=e=>{const{__scopePopper:t,children:n}=e,[r,a]=Z.useState(null);return Gh.jsx(xG,{scope:t,anchor:r,onAnchorChange:a,children:n})};_G.displayName=vG;var SG="PopperAnchor",TG=Z.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=EG(SG,n),i=Z.useRef(null),s=B$(t,i);return Z.useEffect((()=>{o.onAnchorChange((null==r?void 0:r.current)||i.current)})),r?null:Gh.jsx(Y$.div,{...a,ref:s})}));TG.displayName=SG;var CG="PopperContent",[AG,NG]=kG(CG),IG=Z.forwardRef(((e,t)=>{var n,r,a,o,i,s;const{__scopePopper:l,side:c="bottom",sideOffset:u=0,align:d="center",alignOffset:p=0,arrowPadding:h=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:b=!1,updatePositionStrategy:v="optimized",onPlaced:k,...w}=e,x=EG(CG,l),[E,_]=Z.useState(null),S=B$(t,(e=>_(e))),[T,C]=Z.useState(null),A=function(e){const[t,n]=Z.useState(void 0);return LO((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let a,o;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,o=t.blockSize}else a=e.offsetWidth,o=e.offsetHeight;n({width:a,height:o})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(T),N=(null==A?void 0:A.width)??0,I=(null==A?void 0:A.height)??0,R=c+("center"!==d?"-"+d:""),O="number"==typeof g?g:{top:0,right:0,bottom:0,left:0,...g},P=Array.isArray(m)?m:[m],L=P.length>0,D={padding:O,boundary:P.filter(LG),altBoundary:L},{refs:M,floatingStyles:F,placement:j,isPositioned:B,middlewareData:z}=_F({strategy:"fixed",placement:R,whileElementsMounted:(...e)=>uF(...e,{animationFrame:"always"===v}),elements:{reference:x.anchor},middleware:[TF({mainAxis:u+I,alignmentAxis:p}),f&&CF({mainAxis:!0,crossAxis:!1,limiter:"partial"===y?AF():void 0,...D}),f&&NF({...D}),IF({...D,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:a,height:o}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${a}px`),i.setProperty("--radix-popper-anchor-height",`${o}px`)}}),T&&OF({element:T,padding:h}),DG({arrowWidth:N,arrowHeight:I}),b&&RF({strategy:"referenceHidden",...D})]}),[H,U]=MG(j),$=AB(k);LO((()=>{B&&(null==$||$())}),[B,$]);const G=null==(n=z.arrow)?void 0:n.x,V=null==(r=z.arrow)?void 0:r.y,q=0!==(null==(a=z.arrow)?void 0:a.centerOffset),[W,Y]=Z.useState();return LO((()=>{E&&Y(window.getComputedStyle(E).zIndex)}),[E]),Gh.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:B?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[null==(o=z.transformOrigin)?void 0:o.x,null==(i=z.transformOrigin)?void 0:i.y].join(" "),...(null==(s=z.hide)?void 0:s.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:Gh.jsx(AG,{scope:l,placedSide:H,onArrowChange:C,arrowX:G,arrowY:V,shouldHideArrow:q,children:Gh.jsx(Y$.div,{"data-side":H,"data-align":U,...w,ref:S,style:{...w.style,animation:B?void 0:"none"}})})})}));IG.displayName=CG;var RG="PopperArrow",OG={top:"bottom",right:"left",bottom:"top",left:"right"},PG=Z.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,a=NG(RG,n),o=OG[a.placedSide];return Gh.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:Gh.jsx(bG,{...r,ref:t,style:{...r.style,display:"block"}})})}));function LG(e){return null!==e}PG.displayName=RG;var DG=e=>({name:"transformOrigin",options:e,fn(t){var n,r,a;const{placement:o,rects:i,middlewareData:s}=t,l=0!==(null==(n=s.arrow)?void 0:n.centerOffset),c=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[d,p]=MG(o),h={start:"0%",center:"50%",end:"100%"}[p],f=((null==(r=s.arrow)?void 0:r.x)??0)+c/2,m=((null==(a=s.arrow)?void 0:a.y)??0)+u/2;let g="",y="";return"bottom"===d?(g=l?h:`${f}px`,y=-u+"px"):"top"===d?(g=l?h:`${f}px`,y=`${i.floating.height+u}px`):"right"===d?(g=-u+"px",y=l?h:`${m}px`):"left"===d&&(g=`${i.floating.width+u}px`,y=l?h:`${m}px`),{data:{x:g,y:y}}}});function MG(e){const[t,n="center"]=e.split("-");return[t,n]}var FG=_G,jG=TG,BG=IG,zG=PG,HG=Z.forwardRef(((e,t)=>{var n;const{container:r,...a}=e,[o,i]=Z.useState(!1);LO((()=>i(!0)),[]);const s=r||o&&(null==(n=null==globalThis?void 0:globalThis.document)?void 0:n.body);return s?de.createPortal(Gh.jsx(Y$.div,{...a,ref:t}),s):null}));HG.displayName="Portal";var UG=Z.forwardRef(((e,t)=>Gh.jsx(Y$.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));UG.displayName="VisuallyHidden";var $G=[" ","Enter","ArrowUp","ArrowDown"],GG=[" ","Enter"],VG="Select",[qG,WG,YG]=V$(VG),[KG,XG]=D$(VG,[YG,wG]),QG=wG(),[ZG,JG]=KG(VG),[eV,tV]=KG(VG),nV=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:o,value:i,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:p,required:h,form:f}=e,m=QG(t),[g,y]=Z.useState(null),[b,v]=Z.useState(null),[k,w]=Z.useState(!1),x=W$(c),[E=!1,_]=NB({prop:r,defaultProp:a,onChange:o}),[S,T]=NB({prop:i,defaultProp:s,onChange:l}),C=Z.useRef(null),A=!g||(f||!!g.closest("form")),[N,I]=Z.useState(new Set),R=Array.from(N).map((e=>e.props.value)).join(";");return Gh.jsx(FG,{...m,children:Gh.jsxs(ZG,{required:h,scope:t,trigger:g,onTriggerChange:y,valueNode:b,onValueNodeChange:v,valueNodeHasChildren:k,onValueNodeHasChildrenChange:w,contentId:FO(),value:S,onValueChange:T,open:E,onOpenChange:_,dir:x,triggerPointerDownPosRef:C,disabled:p,children:[Gh.jsx(qG.Provider,{scope:t,children:Gh.jsx(eV,{scope:e.__scopeSelect,onNativeOptionAdd:Z.useCallback((e=>{I((t=>new Set(t).add(e)))}),[]),onNativeOptionRemove:Z.useCallback((e=>{I((t=>{const n=new Set(t);return n.delete(e),n}))}),[]),children:n})}),A?Gh.jsxs(GV,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:S,onChange:e=>T(e.target.value),disabled:p,form:f,children:[void 0===S?Gh.jsx("option",{value:""}):null,Array.from(N)]},R):null]})})};nV.displayName=VG;var rV="SelectTrigger",aV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,o=QG(n),i=JG(rV,n),s=i.disabled||r,l=B$(t,i.onTriggerChange),c=WG(n),u=Z.useRef("touch"),[d,p,h]=VV((e=>{const t=c().filter((e=>!e.disabled)),n=t.find((e=>e.value===i.value)),r=qV(t,e,n);void 0!==r&&i.onValueChange(r.value)})),f=e=>{s||(i.onOpenChange(!0),h()),e&&(i.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return Gh.jsx(jG,{asChild:!0,...o,children:Gh.jsx(Y$.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":$V(i.value)?"":void 0,...a,ref:l,onClick:L$(a.onClick,(e=>{e.currentTarget.focus(),"mouse"!==u.current&&f(e)})),onPointerDown:L$(a.onPointerDown,(e=>{u.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(f(e),e.preventDefault())})),onKeyDown:L$(a.onKeyDown,(e=>{const t=""!==d.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||$G.includes(e.key)&&(f(),e.preventDefault())}))})})}));aV.displayName=rV;var oV="SelectValue",iV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:o,placeholder:i="",...s}=e,l=JG(oV,n),{onValueNodeHasChildrenChange:c}=l,u=void 0!==o,d=B$(t,l.onValueNodeChange);return LO((()=>{c(u)}),[c,u]),Gh.jsx(Y$.span,{...s,ref:d,style:{pointerEvents:"none"},children:$V(l.value)?Gh.jsx(Gh.Fragment,{children:i}):o})}));iV.displayName=oV;var sV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return Gh.jsx(Y$.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})}));sV.displayName="SelectIcon";var lV="SelectContent",cV=Z.forwardRef(((e,t)=>{const n=JG(lV,e.__scopeSelect),[r,a]=Z.useState();if(LO((()=>{a(new DocumentFragment)}),[]),!n.open){const t=r;return t?ue.createPortal(Gh.jsx(dV,{scope:e.__scopeSelect,children:Gh.jsx(qG.Slot,{scope:e.__scopeSelect,children:Gh.jsx("div",{children:e.children})})}),t):null}return Gh.jsx(fV,{...e,ref:t})}));cV.displayName=lV;var uV=10,[dV,pV]=KG(lV),hV=z$("SelectContent.RemoveScroll"),fV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:i,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:f,hideWhenDetached:m,avoidCollisions:g,...y}=e,b=JG(lV,n),[v,k]=Z.useState(null),[w,x]=Z.useState(null),E=B$(t,(e=>k(e))),[_,S]=Z.useState(null),[T,C]=Z.useState(null),A=WG(n),[N,I]=Z.useState(!1),R=Z.useRef(!1);Z.useEffect((()=>{if(v)return LH(v)}),[v]),oG();const O=Z.useCallback((e=>{const[t,...n]=A().map((e=>e.ref.current)),[r]=n.slice(-1),a=document.activeElement;for(const o of e){if(o===a)return;if(null==o||o.scrollIntoView({block:"nearest"}),o===t&&w&&(w.scrollTop=0),o===r&&w&&(w.scrollTop=w.scrollHeight),null==o||o.focus(),document.activeElement!==a)return}}),[A,w]),P=Z.useCallback((()=>O([_,v])),[O,_,v]);Z.useEffect((()=>{N&&P()}),[N,P]);const{onOpenChange:L,triggerPointerDownPosRef:D}=b;Z.useEffect((()=>{if(v){let e={x:0,y:0};const t=t=>{var n,r;e={x:Math.abs(Math.round(t.pageX)-((null==(n=D.current)?void 0:n.x)??0)),y:Math.abs(Math.round(t.pageY)-((null==(r=D.current)?void 0:r.y)??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():v.contains(n.target)||L(!1),document.removeEventListener("pointermove",t),D.current=null};return null!==D.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}}),[v,L,D]),Z.useEffect((()=>{const e=()=>L(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}}),[L]);const[M,F]=VV((e=>{const t=A().filter((e=>!e.disabled)),n=t.find((e=>e.ref.current===document.activeElement)),r=qV(t,e,n);r&&setTimeout((()=>r.ref.current.focus()))})),j=Z.useCallback(((e,t,n)=>{const r=!R.current&&!n;(void 0!==b.value&&b.value===t||r)&&(S(e),r&&(R.current=!0))}),[b.value]),B=Z.useCallback((()=>null==v?void 0:v.focus()),[v]),z=Z.useCallback(((e,t,n)=>{const r=!R.current&&!n;(void 0!==b.value&&b.value===t||r)&&C(e)}),[b.value]),H="popper"===r?gV:mV,U=H===gV?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:f,hideWhenDetached:m,avoidCollisions:g}:{};return Gh.jsx(dV,{scope:n,content:v,viewport:w,onViewportChange:x,itemRefCallback:j,selectedItem:_,onItemLeave:B,itemTextRefCallback:z,focusSelectedItem:P,selectedItemText:T,position:r,isPositioned:N,searchRef:M,children:Gh.jsx(xU,{as:hV,allowPinchZoom:!0,children:Gh.jsx(uG,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:L$(a,(e=>{var t;null==(t=b.trigger)||t.focus({preventScroll:!0}),e.preventDefault()})),children:Gh.jsx(eG,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:Gh.jsx(H,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...y,...U,onPlaced:()=>I(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:L$(y.onKeyDown,(e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||F(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=A().filter((e=>!e.disabled)).map((e=>e.ref.current));if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout((()=>O(t))),e.preventDefault()}}))})})})})})}));fV.displayName="SelectContentImpl";var mV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,o=JG(lV,n),i=pV(lV,n),[s,l]=Z.useState(null),[c,u]=Z.useState(null),d=B$(t,(e=>u(e))),p=WG(n),h=Z.useRef(!1),f=Z.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:y,focusSelectedItem:b}=i,v=Z.useCallback((()=>{if(o.trigger&&o.valueNode&&s&&c&&m&&g&&y){const e=o.trigger.getBoundingClientRect(),t=c.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),a=y.getBoundingClientRect();if("rtl"!==o.dir){const r=a.left-t.left,o=n.left-r,i=e.left-o,l=e.width+i,c=Math.max(l,t.width),u=window.innerWidth-uV,d=P$(o,[uV,Math.max(uV,u-c)]);s.style.minWidth=l+"px",s.style.left=d+"px"}else{const r=t.right-a.right,o=window.innerWidth-n.right-r,i=window.innerWidth-e.right-o,l=e.width+i,c=Math.max(l,t.width),u=window.innerWidth-uV,d=P$(o,[uV,Math.max(uV,u-c)]);s.style.minWidth=l+"px",s.style.right=d+"px"}const i=p(),l=window.innerHeight-2*uV,u=m.scrollHeight,d=window.getComputedStyle(c),f=parseInt(d.borderTopWidth,10),b=parseInt(d.paddingTop,10),v=parseInt(d.borderBottomWidth,10),k=f+b+u+parseInt(d.paddingBottom,10)+v,w=Math.min(5*g.offsetHeight,k),x=window.getComputedStyle(m),E=parseInt(x.paddingTop,10),_=parseInt(x.paddingBottom,10),S=e.top+e.height/2-uV,T=l-S,C=g.offsetHeight/2,A=f+b+(g.offsetTop+C),N=k-A;if(A<=S){const e=i.length>0&&g===i[i.length-1].ref.current;s.style.bottom="0px";const t=c.clientHeight-m.offsetTop-m.offsetHeight,n=A+Math.max(T,C+(e?_:0)+t+v);s.style.height=n+"px"}else{const e=i.length>0&&g===i[0].ref.current;s.style.top="0px";const t=Math.max(S,f+m.offsetTop+(e?E:0)+C)+N;s.style.height=t+"px",m.scrollTop=A-S+m.offsetTop}s.style.margin=`${uV}px 0`,s.style.minHeight=w+"px",s.style.maxHeight=l+"px",null==r||r(),requestAnimationFrame((()=>h.current=!0))}}),[p,o.trigger,o.valueNode,s,c,m,g,y,o.dir,r]);LO((()=>v()),[v]);const[k,w]=Z.useState();LO((()=>{c&&w(window.getComputedStyle(c).zIndex)}),[c]);const x=Z.useCallback((e=>{e&&!0===f.current&&(v(),null==b||b(),f.current=!1)}),[v,b]);return Gh.jsx(yV,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:x,children:Gh.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:Gh.jsx(Y$.div,{...a,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})}));mV.displayName="SelectItemAlignedPosition";var gV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=uV,...o}=e,i=QG(n);return Gh.jsx(BG,{...i,...o,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})}));gV.displayName="SelectPopperPosition";var[yV,bV]=KG(lV,{}),vV="SelectViewport",kV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,o=pV(vV,n),i=bV(vV,n),s=B$(t,o.onViewportChange),l=Z.useRef(0);return Gh.jsxs(Gh.Fragment,{children:[Gh.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),Gh.jsx(qG.Slot,{scope:n,children:Gh.jsx(Y$.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:L$(a.onScroll,(e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=i;if((null==r?void 0:r.current)&&n){const e=Math.abs(l.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*uV,a=parseFloat(n.style.minHeight),o=parseFloat(n.style.height),i=Math.max(a,o);if(i<r){const a=i+e,o=Math.min(r,a),s=a-o;n.style.height=o+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}l.current=t.scrollTop}))})})]})}));kV.displayName=vV;var wV="SelectGroup",[xV,EV]=KG(wV),_V=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,...r}=e,a=FO();return Gh.jsx(xV,{scope:n,id:a,children:Gh.jsx(Y$.div,{role:"group","aria-labelledby":a,...r,ref:t})})}));_V.displayName=wV;var SV="SelectLabel",TV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,...r}=e,a=EV(SV,n);return Gh.jsx(Y$.div,{id:a.id,...r,ref:t})}));TV.displayName=SV;var CV="SelectItem",[AV,NV]=KG(CV),IV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...i}=e,s=JG(CV,n),l=pV(CV,n),c=s.value===r,[u,d]=Z.useState(o??""),[p,h]=Z.useState(!1),f=B$(t,(e=>{var t;return null==(t=l.itemRefCallback)?void 0:t.call(l,e,r,a)})),m=FO(),g=Z.useRef("touch"),y=()=>{a||(s.onValueChange(r),s.onOpenChange(!1))};if(""===r)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return Gh.jsx(AV,{scope:n,value:r,disabled:a,textId:m,isSelected:c,onItemTextChange:Z.useCallback((e=>{d((t=>t||((null==e?void 0:e.textContent)??"").trim()))}),[]),children:Gh.jsx(qG.ItemSlot,{scope:n,value:r,disabled:a,textValue:u,children:Gh.jsx(Y$.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...i,ref:f,onFocus:L$(i.onFocus,(()=>h(!0))),onBlur:L$(i.onBlur,(()=>h(!1))),onClick:L$(i.onClick,(()=>{"mouse"!==g.current&&y()})),onPointerUp:L$(i.onPointerUp,(()=>{"mouse"===g.current&&y()})),onPointerDown:L$(i.onPointerDown,(e=>{g.current=e.pointerType})),onPointerMove:L$(i.onPointerMove,(e=>{var t;g.current=e.pointerType,a?null==(t=l.onItemLeave)||t.call(l):"mouse"===g.current&&e.currentTarget.focus({preventScroll:!0})})),onPointerLeave:L$(i.onPointerLeave,(e=>{var t;e.currentTarget===document.activeElement&&(null==(t=l.onItemLeave)||t.call(l))})),onKeyDown:L$(i.onKeyDown,(e=>{var t;""!==(null==(t=l.searchRef)?void 0:t.current)&&" "===e.key||(GG.includes(e.key)&&y()," "===e.key&&e.preventDefault())}))})})})}));IV.displayName=CV;var RV="SelectItemText",OV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,className:r,style:a,...o}=e,i=JG(RV,n),s=pV(RV,n),l=NV(RV,n),c=tV(RV,n),[u,d]=Z.useState(null),p=B$(t,(e=>d(e)),l.onItemTextChange,(e=>{var t;return null==(t=s.itemTextRefCallback)?void 0:t.call(s,e,l.value,l.disabled)})),h=null==u?void 0:u.textContent,f=Z.useMemo((()=>Gh.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value)),[l.disabled,l.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=c;return LO((()=>(m(f),()=>g(f))),[m,g,f]),Gh.jsxs(Gh.Fragment,{children:[Gh.jsx(Y$.span,{id:l.textId,...o,ref:p}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?ue.createPortal(o.children,i.valueNode):null]})}));OV.displayName=RV;var PV="SelectItemIndicator",LV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,...r}=e;return NV(PV,n).isSelected?Gh.jsx(Y$.span,{"aria-hidden":!0,...r,ref:t}):null}));LV.displayName=PV;var DV="SelectScrollUpButton",MV=Z.forwardRef(((e,t)=>{const n=pV(DV,e.__scopeSelect),r=bV(DV,e.__scopeSelect),[a,o]=Z.useState(!1),i=B$(t,r.onScrollButtonChange);return LO((()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;o(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[n.viewport,n.isPositioned]),a?Gh.jsx(BV,{...e,ref:i,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}));MV.displayName=DV;var FV="SelectScrollDownButton",jV=Z.forwardRef(((e,t)=>{const n=pV(FV,e.__scopeSelect),r=bV(FV,e.__scopeSelect),[a,o]=Z.useState(!1),i=B$(t,r.onScrollButtonChange);return LO((()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;o(n)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[n.viewport,n.isPositioned]),a?Gh.jsx(BV,{...e,ref:i,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}));jV.displayName=FV;var BV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,o=pV("SelectScrollButton",n),i=Z.useRef(null),s=WG(n),l=Z.useCallback((()=>{null!==i.current&&(window.clearInterval(i.current),i.current=null)}),[]);return Z.useEffect((()=>()=>l()),[l]),LO((()=>{var e;const t=s().find((e=>e.ref.current===document.activeElement));null==(e=null==t?void 0:t.ref.current)||e.scrollIntoView({block:"nearest"})}),[s]),Gh.jsx(Y$.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:L$(a.onPointerDown,(()=>{null===i.current&&(i.current=window.setInterval(r,50))})),onPointerMove:L$(a.onPointerMove,(()=>{var e;null==(e=o.onItemLeave)||e.call(o),null===i.current&&(i.current=window.setInterval(r,50))})),onPointerLeave:L$(a.onPointerLeave,(()=>{l()}))})})),zV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,...r}=e;return Gh.jsx(Y$.div,{"aria-hidden":!0,...r,ref:t})}));zV.displayName="SelectSeparator";var HV="SelectArrow",UV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,...r}=e,a=QG(n),o=JG(HV,n),i=pV(HV,n);return o.open&&"popper"===i.position?Gh.jsx(zG,{...a,...r,ref:t}):null}));function $V(e){return""===e||void 0===e}UV.displayName=HV;var GV=Z.forwardRef(((e,t)=>{const{value:n,...r}=e,a=Z.useRef(null),o=B$(t,a),i=function(e){const t=Z.useRef({value:e,previous:e});return Z.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}(n);return Z.useEffect((()=>{const e=a.current,t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(i!==n&&r){const t=new Event("change",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}}),[i,n]),Gh.jsx(UG,{asChild:!0,children:Gh.jsx("select",{...r,ref:o,defaultValue:n})})}));function VV(e){const t=AB(e),n=Z.useRef(""),r=Z.useRef(0),a=Z.useCallback((e=>{const a=n.current+e;t(a),function e(t){n.current=t,window.clearTimeout(r.current),""!==t&&(r.current=window.setTimeout((()=>e("")),1e3))}(a)}),[t]),o=Z.useCallback((()=>{n.current="",window.clearTimeout(r.current)}),[]);return Z.useEffect((()=>()=>window.clearTimeout(r.current)),[]),[n,a,o]}function qV(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,a=n?e.indexOf(n):-1;let o=(i=e,s=Math.max(a,0),i.map(((e,t)=>i[(s+t)%i.length])));var i,s;1===r.length&&(o=o.filter((e=>e!==n)));const l=o.find((e=>e.textValue.toLowerCase().startsWith(r.toLowerCase())));return l!==n?l:void 0}GV.displayName="BubbleSelect";var WV=nV,YV=aV,KV=iV,XV=sV,QV=cV,ZV=kV,JV=IV,eq=OV,tq=LV,nq=e=>"object"==typeof e&&null!==e,rq=e=>nq(e)&&1===e.nodeType&&"string"==typeof e.nodeName,aq=e=>nq(e)&&9===e.nodeType,oq=/(textarea|select)/;function iq(e){if(null==e||!rq(e))return!1;try{return(e=>rq(e)&&"input"===e.localName)(e)&&null!=e.selectionStart||oq.test(e.localName)||e.isContentEditable||"true"===e.getAttribute("contenteditable")||""===e.getAttribute("contenteditable")}catch{return!1}}function sq(e){return aq(e)?e:(e=>nq(e)&&e===e.window)(e)?e.document:(null==e?void 0:e.ownerDocument)??document}function lq(e){const t=function(e){var t,n,r;return(null==(t=e.composedPath)?void 0:t.call(e))??(null==(r=null==(n=e.nativeEvent)?void 0:n.composedPath)?void 0:r.call(n))}(e);return(null==t?void 0:t[0])??e.target}var cq=(e,t,n,r)=>{const a="function"==typeof e?e():e;return null==a||a.addEventListener(t,n,r),()=>{null==a||a.removeEventListener(t,n,r)}},uq=e=>rq(e)&&"IFRAME"===e.tagName,dq="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",pq=(e,t=!1)=>{if(!e)return[];const n=Array.from(e.querySelectorAll(dq));(1==t||"if-empty"==t&&0===n.length)&&rq(e)&&hq(e)&&n.unshift(e);const r=n.filter(hq);return r.forEach(((e,t)=>{if(uq(e)&&e.contentDocument){const n=e.contentDocument.body;r.splice(t,1,...pq(n))}})),r};function hq(e){return!(!e||e.closest("[inert]"))&&(e.matches(dq)&&(!!rq(t=e)&&(t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0)));var t}function fq(e,t){if(!e)return[];const n=Array.from(e.querySelectorAll(dq)).filter(mq);return n.forEach(((e,t)=>{if(uq(e)&&e.contentDocument){const r=fq(e.contentDocument.body);n.splice(t,1,...r)}})),n.length,n}function mq(e){return null!=e&&e.tabIndex>0||hq(e)&&!(e=>parseInt(e.getAttribute("tabindex")||"0",10)<0)(e)}function gq(e){return e.tabIndex<0&&(/^(audio|video|details)$/.test(e.localName)||iq(e))&&(t=e,Number.isNaN(parseInt(t.getAttribute("tabindex")||"0",10)))?0:e.tabIndex;var t}var yq=Object.defineProperty,bq=(e,t,n)=>((e,t,n)=>t in e?yq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),vq={activateTrap(e,t){if(e.length>0){const n=e[e.length-1];n!==t&&n.pause()}const n=e.indexOf(t);-1===n||e.splice(n,1),e.push(t)},deactivateTrap(e,t){const n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},kq=[],wq=class{constructor(e,t){bq(this,"trapStack"),bq(this,"config"),bq(this,"doc"),bq(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),bq(this,"listenerCleanups",[]),bq(this,"handleFocus",(e=>{const t=lq(e),n=this.findContainerIndex(t,e)>=0;if(n||aq(t))n&&(this.state.mostRecentlyFocusedNode=t);else{let t;e.stopImmediatePropagation();let n=!0;if(this.state.mostRecentlyFocusedNode)if(gq(this.state.mostRecentlyFocusedNode)>0){const e=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:r}=this.state.containerGroups[e];if(r.length>0){const e=r.findIndex((e=>e===this.state.mostRecentlyFocusedNode));e>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?e+1<r.length&&(t=r[e+1],n=!1):e-1>=0&&(t=r[e-1],n=!1))}}else this.state.containerGroups.some((e=>e.tabbableNodes.some((e=>gq(e)>0))))||(n=!1);else n=!1;n&&(t=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),t?this.tryFocus(t):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0})),bq(this,"handlePointerDown",(e=>{const t=lq(e);this.findContainerIndex(t,e)>=0||(Eq(this.config.clickOutsideDeactivates,e)?this.deactivate({returnFocus:this.config.returnFocusOnDeactivate}):Eq(this.config.allowOutsideClick,e)||e.preventDefault())})),bq(this,"handleClick",(e=>{const t=lq(e);this.findContainerIndex(t,e)>=0||Eq(this.config.clickOutsideDeactivates,e)||Eq(this.config.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())})),bq(this,"handleTabKey",(e=>{if(this.config.isKeyForward(e)||this.config.isKeyBackward(e)){this.state.recentNavEvent=e;const t=this.config.isKeyBackward(e),n=this.findNextNavNode({event:e,isBackward:t});if(!n)return;xq(e)&&e.preventDefault(),this.tryFocus(n)}})),bq(this,"handleEscapeKey",(e=>{_q(e)&&!1!==Eq(this.config.escapeDeactivates,e)&&(e.preventDefault(),this.deactivate())})),bq(this,"_mutationObserver"),bq(this,"setupMutationObserver",(()=>{const e=this.doc.defaultView||window;this._mutationObserver=new e.MutationObserver((e=>{e.some((e=>Array.from(e.removedNodes).some((e=>e===this.state.mostRecentlyFocusedNode))))&&this.tryFocus(this.getInitialFocusNode())}))})),bq(this,"updateObservedNodes",(()=>{var e;null==(e=this._mutationObserver)||e.disconnect(),this.state.active&&!this.state.paused&&this.state.containers.map((e=>{var t;null==(t=this._mutationObserver)||t.observe(e,{subtree:!0,childList:!0})}))})),bq(this,"getInitialFocusNode",(()=>{let e=this.getNodeForOption("initialFocus",{hasFallback:!0});if(!1===e)return!1;if(void 0===e||e&&!hq(e))if(this.findContainerIndex(this.doc.activeElement)>=0)e=this.doc.activeElement;else{const t=this.state.tabbableGroups[0];e=t&&t.firstTabbableNode||this.getNodeForOption("fallbackFocus")}else null===e&&(e=this.getNodeForOption("fallbackFocus"));if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e.isConnected||(e=this.getNodeForOption("fallbackFocus")),e})),bq(this,"tryFocus",(e=>{!1!==e&&e!==function(e){let t=e.activeElement;for(;null==t?void 0:t.shadowRoot;){const e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}(this.doc)&&(e&&e.focus?(e.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=e,Tq(e)&&e.select()):this.tryFocus(this.getInitialFocusNode()))})),bq(this,"deactivate",(e=>{if(!this.state.active)return this;const t={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...e};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),vq.deactivateTrap(this.trapStack,this);const n=this.getOption(t,"onDeactivate"),r=this.getOption(t,"onPostDeactivate"),a=this.getOption(t,"checkCanReturnFocus"),o=this.getOption(t,"returnFocus","returnFocusOnDeactivate");null==n||n();const i=()=>{Sq((()=>{if(o){const e=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(e)}null==r||r()}))};if(o&&a){return a(this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation)).then(i,i),this}return i(),this})),bq(this,"pause",(e=>{if(this.state.paused||!this.state.active)return this;const t=this.getOption(e,"onPause"),n=this.getOption(e,"onPostPause");return this.state.paused=!0,null==t||t(),this.removeListeners(),this.updateObservedNodes(),null==n||n(),this})),bq(this,"unpause",(e=>{if(!this.state.paused||!this.state.active)return this;const t=this.getOption(e,"onUnpause"),n=this.getOption(e,"onPostUnpause");return this.state.paused=!1,null==t||t(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),null==n||n(),this})),bq(this,"updateContainerElements",(e=>(this.state.containers=Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this))),bq(this,"getReturnFocusNode",(e=>{const t=this.getNodeForOption("setReturnFocus",{params:[e]});return t||!1!==t&&e})),bq(this,"getOption",((e,t,n)=>e&&void 0!==e[t]?e[t]:this.config[n||t])),bq(this,"getNodeForOption",((e,{hasFallback:t=!1,params:n=[]}={})=>{let r=this.config[e];if("function"==typeof r&&(r=r(...n)),!0===r&&(r=void 0),!r){if(void 0===r||!1===r)return r;throw new Error(`\`${e}\` was specified but was not a node, or did not return a node`)}let a=r;if("string"==typeof r){try{a=this.doc.querySelector(r)}catch(kbe){throw new Error(`\`${e}\` appears to be an invalid selector; error="${kbe.message}"`)}if(!a&&!t)throw new Error(`\`${e}\` as selector refers to no known node`)}return a})),bq(this,"findNextNavNode",(e=>{const{event:t,isBackward:n=!1}=e,r=e.target||lq(t);this.updateTabbableNodes();let a=null;if(this.state.tabbableGroups.length>0){const e=this.findContainerIndex(r,t),o=e>=0?this.state.containerGroups[e]:void 0;if(e<0)a=n?this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:this.state.tabbableGroups[0].firstTabbableNode;else if(n){let n=this.state.tabbableGroups.findIndex((({firstTabbableNode:e})=>r===e));if(n<0&&((null==o?void 0:o.container)===r||hq(r)&&!mq(r)&&!(null==o?void 0:o.nextTabbableNode(r,!1)))&&(n=e),n>=0){const e=0===n?this.state.tabbableGroups.length-1:n-1,t=this.state.tabbableGroups[e];a=gq(r)>=0?t.lastTabbableNode:t.lastDomTabbableNode}else xq(t)||(a=null==o?void 0:o.nextTabbableNode(r,!1))}else{let n=this.state.tabbableGroups.findIndex((({lastTabbableNode:e})=>r===e));if(n<0&&((null==o?void 0:o.container)===r||hq(r)&&!mq(r)&&!(null==o?void 0:o.nextTabbableNode(r)))&&(n=e),n>=0){const e=n===this.state.tabbableGroups.length-1?0:n+1,t=this.state.tabbableGroups[e];a=gq(r)>=0?t.firstTabbableNode:t.firstDomTabbableNode}else xq(t)||(a=null==o?void 0:o.nextTabbableNode(r))}}else a=this.getNodeForOption("fallbackFocus");return a})),this.trapStack=t.trapStack||kq;const n={returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:e=>xq(e)&&!e.shiftKey,isKeyBackward:e=>xq(e)&&e.shiftKey,...t};this.doc=n.document||sq(Array.isArray(e)?e[0]:e),this.config=n,this.updateContainerElements(e),this.setupMutationObserver()}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){const n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return this.state.containerGroups.findIndex((({container:t,tabbableNodes:r})=>t.contains(e)||(null==n?void 0:n.includes(t))||r.find((t=>t===e))))}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map((e=>{const t=fq(e),n=pq(e),r=t.length>0?t[0]:void 0,a=t.length>0?t[t.length-1]:void 0,o=n.find((e=>mq(e))),i=n.slice().reverse().find((e=>mq(e))),s=!!t.find((e=>gq(e)>0));return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:s,firstTabbableNode:r,lastTabbableNode:a,firstDomTabbableNode:o,lastDomTabbableNode:i,nextTabbableNode:function(e,r=!0){const a=t.indexOf(e);return a<0?r?n.slice(n.indexOf(e)+1).find((e=>mq(e))):n.slice(0,n.indexOf(e)).reverse().find((e=>mq(e))):t[a+(r?1:-1)]}}})),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 vq.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?Sq((()=>{this.tryFocus(this.getInitialFocusNode())})):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(cq(this.doc,"focusin",this.handleFocus,!0),cq(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),cq(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),cq(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),cq(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),cq(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=this.doc.activeElement||null,null==t||t();const a=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),null==n||n()};return r?(r(this.state.containers.concat()).then(a,a),this):(a(),this)}},xq=e=>"Tab"===e.key,Eq=(e,...t)=>"function"==typeof e?e(...t):e,_q=e=>!e.isComposing&&"Escape"===e.key,Sq=e=>setTimeout(e,0),Tq=e=>"input"===e.localName&&"select"in e&&"function"==typeof e.select;function Cq(e,t={}){let n;const r=function(e){let t;const n=globalThis.requestAnimationFrame((()=>{t=e()}));return()=>{globalThis.cancelAnimationFrame(n),null==t||t()}}((()=>{const r="function"==typeof e?e():e;if(r){n=new wq(r,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:r,...t,document:sq(r)});try{n.activate()}catch{}}}));return function(){null==n||n.deactivate(),r()}}var Aq=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=Z.useState(),r=Z.useRef({}),a=Z.useRef(e),o=Z.useRef("none"),i=e?"mounted":"unmounted",[s,l]=function(e,t){return Z.useReducer(((e,n)=>t[e][n]??e),e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Z.useEffect((()=>{const e=Nq(r.current);o.current="mounted"===s?e:"none"}),[s]),LO((()=>{const t=r.current,n=a.current;if(n!==e){const r=o.current,i=Nq(t);if(e)l("MOUNT");else if("none"===i||"none"===(null==t?void 0:t.display))l("UNMOUNT");else{l(n&&r!==i?"ANIMATION_OUT":"UNMOUNT")}a.current=e}}),[e,l]),LO((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,i=o=>{const i=Nq(r.current).includes(o.animationName);if(o.target===t&&i&&(l("ANIMATION_END"),!a.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},s=e=>{e.target===t&&(o.current=Nq(r.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}l("ANIMATION_END")}),[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:Z.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),a="function"==typeof n?n({present:r.isPresent}):Z.Children.only(n),o=B$(r.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;if(a)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof n||r.isPresent?Z.cloneElement(a,{ref:o}):null};function Nq(e){return(null==e?void 0:e.animationName)||"none"}Aq.displayName="Presence";const Iq="Dialog",[Rq,Oq]=D$(Iq),[Pq,Lq]=Rq(Iq),Dq=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:i=!0}=e,s=Z.useRef(null),l=Z.useRef(null),[c=!1,u]=NB({prop:r,defaultProp:a,onChange:o});return Gh.jsx(Pq,{scope:t,triggerRef:s,contentRef:l,contentId:FO(),titleId:FO(),descriptionId:FO(),open:c,onOpenChange:u,onOpenToggle:Z.useCallback((()=>u((e=>!e))),[u]),modal:i,children:n})};Dq.displayName=Iq;const Mq="DialogTrigger",Fq=Z.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,a=Lq(Mq,n),o=B$(t,a.triggerRef);return Gh.jsx(Y$.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":nW(a.open),...r,ref:o,onClick:L$(e.onClick,a.onOpenToggle)})}));Fq.displayName=Mq;const jq="DialogPortal",[Bq,zq]=Rq(jq,{forceMount:void 0}),Hq=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,o=Lq(jq,t);return Gh.jsx(Bq,{scope:t,forceMount:n,children:Z.Children.map(r,(e=>Gh.jsx(Aq,{present:n||o.open,children:Gh.jsx(HG,{asChild:!0,container:a,children:e})})))})};Hq.displayName=jq;const Uq="DialogOverlay",$q=Z.forwardRef(((e,t)=>{const n=zq(Uq,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=Lq(Uq,e.__scopeDialog);return o.modal?Gh.jsx(Aq,{present:r||o.open,children:Gh.jsx(Gq,{...a,ref:t})}):null}));$q.displayName=Uq;const Gq=Z.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,a=Lq(Uq,n);return Gh.jsx(xU,{as:H$,allowPinchZoom:!0,shards:[a.contentRef],children:Gh.jsx(Y$.div,{"data-state":nW(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})})),Vq="DialogContent",qq=Z.forwardRef(((e,t)=>{const n=zq(Vq,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=Lq(Vq,e.__scopeDialog);return Gh.jsx(Aq,{present:r||o.open,children:o.modal?Gh.jsx(Wq,{...a,ref:t}):Gh.jsx(Yq,{...a,ref:t})})}));qq.displayName=Vq;const Wq=Z.forwardRef(((e,t)=>{const n=Lq(Vq,e.__scopeDialog),r=Z.useRef(null),a=B$(t,n.contentRef,r);return Z.useEffect((()=>{const e=r.current;if(e)return LH(e)}),[]),Gh.jsx(Kq,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onPointerDownOutside:L$(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()})),onFocusOutside:L$(e.onFocusOutside,(e=>e.preventDefault()))})})),Yq=Z.forwardRef(((e,t)=>{const n=Lq(Vq,e.__scopeDialog),r=Z.useRef(!1),a=Z.useRef(!1);return Gh.jsx(Kq,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onInteractOutside:t=>{var o,i;null==(o=e.onInteractOutside)||o.call(e,t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const s=t.target;(null==(i=n.triggerRef.current)?void 0:i.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})})),Kq=Z.forwardRef(((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...i}=e,s=Lq(Vq,n),l=Z.useRef(null),c=B$(t,l);return oG(),Z.useEffect((()=>{if(r)return Cq(l.current,{preventScroll:!0,onActivate:a,onDeactivate:o,initialFocus:!1})}),[]),Gh.jsx(eG,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":nW(s.open),...i,ref:c,onDismiss:()=>s.onOpenChange(!1)})})),Xq="DialogTitle",Qq=Z.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,a=Lq(Xq,n);return Gh.jsx(Y$.h2,{id:a.titleId,...r,ref:t})}));Qq.displayName=Xq;const Zq="DialogDescription",Jq=Z.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,a=Lq(Zq,n);return Gh.jsx(Y$.p,{id:a.descriptionId,...r,ref:t})}));Jq.displayName=Zq;const eW="DialogClose",tW=Z.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,a=Lq(eW,n);return Gh.jsx(Y$.button,{type:"button",...r,ref:t,onClick:L$(e.onClick,(()=>a.onOpenChange(!1)))})}));function nW(e){return e?"open":"closed"}tW.displayName=eW;const rW=Dq,aW=Hq,oW=$q,iW=qq,sW=Qq,lW=tW,cW=Z.forwardRef(((e,t)=>{const n=Z.useId();return Gh.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",height:"100%",width:"100%",ref:t,...e,children:[Gh.jsx("title",{children:"AI Avatar"}),Gh.jsx("path",{d:"M9.937 15.5002C9.84772 15.1542 9.66734 14.8384 9.41462 14.5856C9.1619 14.3329 8.84607 14.1525 8.5 14.0632L2.365 12.4812C2.26033 12.4515 2.16821 12.3885 2.10261 12.3017C2.03702 12.2149 2.00153 12.1091 2.00153 12.0002C2.00153 11.8914 2.03702 11.7856 2.10261 11.6988C2.16821 11.612 2.26033 11.549 2.365 11.5192L8.5 9.93625C8.84595 9.84706 9.16169 9.66682 9.4144 9.41429C9.66711 9.16175 9.84757 8.84614 9.937 8.50025L11.519 2.36525C11.5484 2.26017 11.6114 2.16759 11.6983 2.10164C11.7853 2.0357 11.8914 2 12.0005 2C12.1096 2 12.2157 2.0357 12.3027 2.10164C12.3896 2.16759 12.4526 2.26017 12.482 2.36525L14.063 8.50025C14.1523 8.84632 14.3327 9.16215 14.5854 9.41487C14.8381 9.66759 15.1539 9.84797 15.5 9.93725L21.635 11.5182C21.7405 11.5473 21.8335 11.6103 21.8998 11.6973C21.9661 11.7844 22.0021 11.8908 22.0021 12.0002C22.0021 12.1097 21.9661 12.2161 21.8998 12.3032C21.8335 12.3902 21.7405 12.4531 21.635 12.4822L15.5 14.0632C15.1539 14.1525 14.8381 14.3329 14.5854 14.5856C14.3327 14.8384 14.1523 15.1542 14.063 15.5002L12.481 21.6353C12.4516 21.7403 12.3886 21.8329 12.3017 21.8989C12.2147 21.9648 12.1086 22.0005 11.9995 22.0005C11.8904 22.0005 11.7843 21.9648 11.6973 21.8989C11.6104 21.8329 11.5474 21.7403 11.518 21.6353L9.937 15.5002Z",stroke:`url(#${n}-stroke1)`,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),Gh.jsx("path",{d:"M18.9838 5.37522C18.9615 5.28871 18.9164 5.20975 18.8532 5.14657C18.79 5.08339 18.7111 5.0383 18.6246 5.01598L17.0909 4.62049C17.0647 4.61306 17.0417 4.5973 17.0253 4.5756C17.0089 4.5539 17 4.52744 17 4.50024C17 4.47304 17.0089 4.44659 17.0253 4.42488C17.0417 4.40318 17.0647 4.38742 17.0909 4.38L18.6246 3.98426C18.7111 3.96196 18.79 3.9169 18.8532 3.85377C18.9163 3.79064 18.9615 3.71174 18.9838 3.62527L19.3793 2.09155C19.3867 2.06528 19.4024 2.04214 19.4241 2.02565C19.4459 2.00917 19.4724 2.00024 19.4997 2.00024C19.527 2.00024 19.5535 2.00917 19.5752 2.02565C19.597 2.04214 19.6127 2.06528 19.6201 2.09155L20.0153 3.62527C20.0376 3.71178 20.0827 3.79074 20.1459 3.85391C20.2091 3.91709 20.288 3.96219 20.3745 3.98451L21.9082 4.37975C21.9346 4.38702 21.9579 4.40275 21.9744 4.42452C21.991 4.44628 22 4.47288 22 4.50024C22 4.5276 21.991 4.55421 21.9744 4.57597C21.9579 4.59774 21.9346 4.61347 21.9082 4.62074L20.3745 5.01598C20.288 5.0383 20.2091 5.08339 20.1459 5.14657C20.0827 5.20975 20.0376 5.28871 20.0153 5.37522L19.6198 6.90893C19.6124 6.9352 19.5967 6.95835 19.575 6.97483C19.5532 6.99132 19.5267 7.00024 19.4994 7.00024C19.4721 7.00024 19.4456 6.99132 19.4239 6.97483C19.4022 6.95835 19.3864 6.9352 19.3791 6.90893L18.9838 5.37522Z",stroke:`url(#${n}-stroke2)`,strokeLinecap:"round",strokeLinejoin:"round"}),Gh.jsx("path",{d:"M3.98382 20.3752C3.9615 20.2887 3.9164 20.2098 3.85322 20.1466C3.79005 20.0834 3.71109 20.0383 3.62458 20.016L2.09087 19.6205C2.0647 19.6131 2.04167 19.5973 2.02527 19.5756C2.00887 19.5539 2 19.5274 2 19.5002C2 19.473 2.00887 19.4466 2.02527 19.4249C2.04167 19.4032 2.0647 19.3874 2.09087 19.38L3.62458 18.9843C3.71106 18.962 3.78999 18.9169 3.85317 18.8538C3.91635 18.7906 3.96146 18.7117 3.98382 18.6253L4.37931 17.0916C4.38666 17.0653 4.4024 17.0421 4.42414 17.0257C4.44587 17.0092 4.4724 17.0002 4.49968 17.0002C4.52696 17.0002 4.55349 17.0092 4.57522 17.0257C4.59695 17.0421 4.6127 17.0653 4.62005 17.0916L5.01529 18.6253C5.03761 18.7118 5.0827 18.7907 5.14588 18.8539C5.20906 18.9171 5.28801 18.9622 5.37453 18.9845L6.90824 19.3797C6.93461 19.387 6.95787 19.4027 6.97445 19.4245C6.99102 19.4463 7 19.4729 7 19.5002C7 19.5276 6.99102 19.5542 6.97445 19.576C6.95787 19.5977 6.93461 19.6135 6.90824 19.6207L5.37453 20.016C5.28801 20.0383 5.20906 20.0834 5.14588 20.1466C5.0827 20.2098 5.03761 20.2887 5.01529 20.3752L4.6198 21.9089C4.61245 21.9352 4.5967 21.9583 4.57497 21.9748C4.55324 21.9913 4.52671 22.0002 4.49943 22.0002C4.47215 22.0002 4.44562 21.9913 4.42389 21.9748C4.40215 21.9583 4.38641 21.9352 4.37906 21.9089L3.98382 20.3752Z",stroke:`url(#${n}-stroke3)`,strokeLinecap:"round",strokeLinejoin:"round"}),Gh.jsxs("defs",{children:[Gh.jsxs("linearGradient",{id:`${n}-stroke1`,x1:"0.149625",y1:"0.148102",x2:"23.8539",y2:"23.8524",gradientUnits:"userSpaceOnUse",children:[Gh.jsx("stop",{offset:"0.287444",stopColor:"var(--start-color)"}),Gh.jsx("stop",{offset:"0.728693",stopColor:"var(--end-color)"})]}),Gh.jsxs("linearGradient",{id:`${n}-stroke2`,x1:"16.537",y1:"1.53728",x2:"22.463",y2:"7.46321",gradientUnits:"userSpaceOnUse",children:[Gh.jsx("stop",{offset:"0.287444",stopColor:"var(--start-color)"}),Gh.jsx("stop",{offset:"0.728693",stopColor:"var(--end-color)"})]}),Gh.jsxs("linearGradient",{id:`${n}-stroke3`,x1:"1.53704",y1:"16.5373",x2:"7.46296",y2:"22.4632",gradientUnits:"userSpaceOnUse",children:[Gh.jsx("stop",{offset:"0.287444",stopColor:"var(--start-color)"}),Gh.jsx("stop",{offset:"0.728693",stopColor:"var(--end-color)"})]})]})]})})),uW=Z.forwardRef(((e,t)=>Gh.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",height:"32px",viewBox:"0 96 960 960",width:"32px",ref:t,...e,children:[Gh.jsx("title",{children:"User Avatar"}),Gh.jsx("path",{d:"M222 801q63-40 124.5-60.5T480 720q72 0 134 20.5T739 801q44-54 62.5-109T820 576q0-145-97.5-242.5T480 236q-145 0-242.5 97.5T140 576q0 61 19 116t63 109Zm257.814-195Q422 606 382.5 566.314q-39.5-39.686-39.5-97.5t39.686-97.314q39.686-39.5 97.5-39.5t97.314 39.686q39.5 39.686 39.5 97.5T577.314 566.5q-39.686 39.5-97.5 39.5Zm-.219 370q-83.146 0-156.275-31.5t-127.225-86Q142 804 111 731.159 80 658.319 80 575.5q0-82.819 31.5-155.659Q143 347 197.5 293t127.341-85.5Q397.681 176 480.5 176q82.819 0 155.659 31.5Q709 239 763 293t85.5 127Q880 493 880 575.734q0 82.734-31.5 155.5T763 858.5q-54 54.5-127.129 86T479.595 976Z",fill:"currentColor"})]})));function dW(e,t){return(dW=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}
|
|
38
|
+
*/function BT(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var zT=Symbol.for("react.transitional.element"),HT=Symbol.for("react.portal"),UT=Symbol.for("react.fragment"),$T=Symbol.for("react.strict_mode"),GT=Symbol.for("react.profiler"),VT=Symbol.for("react.provider"),qT=Symbol.for("react.consumer"),WT=Symbol.for("react.context"),YT=Symbol.for("react.forward_ref"),KT=Symbol.for("react.suspense"),XT=Symbol.for("react.suspense_list"),QT=Symbol.for("react.memo"),ZT=Symbol.for("react.lazy"),JT=Symbol.for("react.scope"),eC=Symbol.for("react.debug_trace_mode"),tC=Symbol.for("react.offscreen"),nC=Symbol.for("react.legacy_hidden"),rC=Symbol.for("react.memo_cache_sentinel"),aC=Symbol.iterator,oC=Array.isArray;function iC(e,t){var n=3&e.length,r=e.length-n,a=t;for(t=0;t<r;){var o=255&e.charCodeAt(t)|(255&e.charCodeAt(++t))<<8|(255&e.charCodeAt(++t))<<16|(255&e.charCodeAt(++t))<<24;++t,a=27492+(65535&(a=5*(65535&(a=(a^=o=461845907*(65535&(o=(o=3432918353*(65535&o)+((3432918353*(o>>>16)&65535)<<16)&4294967295)<<15|o>>>17))+((461845907*(o>>>16)&65535)<<16)&4294967295)<<13|a>>>19))+((5*(a>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16)}switch(o=0,n){case 3:o^=(255&e.charCodeAt(t+2))<<16;case 2:o^=(255&e.charCodeAt(t+1))<<8;case 1:a^=461845907*(65535&(o=(o=3432918353*(65535&(o^=255&e.charCodeAt(t)))+((3432918353*(o>>>16)&65535)<<16)&4294967295)<<15|o>>>17))+((461845907*(o>>>16)&65535)<<16)&4294967295}return a^=e.length,a=2246822507*(65535&(a^=a>>>16))+((2246822507*(a>>>16)&65535)<<16)&4294967295,((a=3266489909*(65535&(a^=a>>>13))+((3266489909*(a>>>16)&65535)<<16)&4294967295)^a>>>16)>>>0}var sC=new MessageChannel,lC=[];function cC(e){lC.push(e),sC.port2.postMessage(null)}function uC(e){setTimeout((function(){throw e}))}sC.port1.onmessage=function(){var e=lC.shift();e&&e()};var dC=Promise,pC="function"==typeof queueMicrotask?queueMicrotask:function(e){dC.resolve(null).then(e).catch(uC)},hC=null,fC=0;function mC(e,t){if(0!==t.byteLength)if(2048<t.byteLength)0<fC&&(e.enqueue(new Uint8Array(hC.buffer,0,fC)),hC=new Uint8Array(2048),fC=0),e.enqueue(t);else{var n=hC.length-fC;n<t.byteLength&&(0===n?e.enqueue(hC):(hC.set(t.subarray(0,n),fC),e.enqueue(hC),t=t.subarray(n)),hC=new Uint8Array(2048),fC=0),hC.set(t,fC),fC+=t.byteLength}}function gC(e,t){return mC(e,t),!0}function yC(e){hC&&0<fC&&(e.enqueue(new Uint8Array(hC.buffer,0,fC)),hC=null,fC=0)}var bC=new TextEncoder;function vC(e){return bC.encode(e)}function kC(e){return bC.encode(e)}function wC(e,t){"function"==typeof e.error?e.error(t):e.close()}var xC=Object.assign,EC=Object.prototype.hasOwnProperty,_C=RegExp("^[: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]*$"),SC={},TC={};function CC(e){return!!EC.call(TC,e)||!EC.call(SC,e)&&(_C.test(e)?TC[e]=!0:(SC[e]=!0,!1))}var AC=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")),NC=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),IC=/["'&<>]/;function RC(e){if("boolean"==typeof e||"number"==typeof e||"bigint"==typeof e)return""+e;e=""+e;var t=IC.exec(e);if(t){var n,r="",a=0;for(n=t.index;n<e.length;n++){switch(e.charCodeAt(n)){case 34:t=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}a!==n&&(r+=e.slice(a,n)),a=n+1,r+=t}e=a!==n?r+e.slice(a,n):r}return e}var OC=/([A-Z])/g,PC=/^ms-/,LC=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function DC(e){return LC.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var MC=FT.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,FC=jT.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,jC={pending:!1,data:null,method:null,action:null},BC=FC.d;FC.d={f:BC.f,r:BC.r,D:function(e){var t=HR||null;if(t){var n=t.resumableState,r=t.renderState;if("string"==typeof e&&e){var a,o;if(!n.dnsResources.hasOwnProperty(e))n.dnsResources[e]=null,(o=(n=r.headers)&&0<n.remainingCapacity)&&(a="<"+(""+e).replace(xI,EI)+">; rel=dns-prefetch",o=0<=(n.remainingCapacity-=a.length+2)),o?(r.resets.dns[e]=null,n.preconnects&&(n.preconnects+=", "),n.preconnects+=a):(OA(a=[],{href:e,rel:"dns-prefetch"}),r.preconnects.add(a));_O(t)}}else BC.D(e)},C:function(e,t){var n=HR||null;if(n){var r=n.resumableState,a=n.renderState;if("string"==typeof e&&e){var o="use-credentials"===t?"credentials":"string"==typeof t?"anonymous":"default";if(!r.connectResources[o].hasOwnProperty(e)){var i,s;if(r.connectResources[o][e]=null,s=(r=a.headers)&&0<r.remainingCapacity){if(s="<"+(""+e).replace(xI,EI)+">; rel=preconnect","string"==typeof t)s+='; crossorigin="'+(""+t).replace(_I,SI)+'"';i=s,s=0<=(r.remainingCapacity-=i.length+2)}s?(a.resets.connect[o][e]=null,r.preconnects&&(r.preconnects+=", "),r.preconnects+=i):(OA(o=[],{rel:"preconnect",href:e,crossOrigin:t}),a.preconnects.add(o))}_O(n)}}else BC.C(e,t)},L:function(e,t,n){var r=HR||null;if(r){var a=r.resumableState,o=r.renderState;if(t&&e){switch(t){case"image":if(n)var i=n.imageSrcSet,s=n.imageSizes,l=n.fetchPriority;var c,u=i?i+"\n"+(s||""):e;if(a.imageResources.hasOwnProperty(u))return;a.imageResources[u]=zC,(a=o.headers)&&0<a.remainingCapacity&&"high"===l&&(c=wI(e,t,n),0<=(a.remainingCapacity-=c.length+2))?(o.resets.image[u]=zC,a.highImagePreloads&&(a.highImagePreloads+=", "),a.highImagePreloads+=c):(OA(a=[],xC({rel:"preload",href:i?void 0:e,as:t},n)),"high"===l?o.highImagePreloads.add(a):(o.bulkPreloads.add(a),o.preloads.images.set(u,a)));break;case"style":if(a.styleResources.hasOwnProperty(e))return;OA(i=[],xC({rel:"preload",href:e,as:t},n)),a.styleResources[e]=!n||"string"!=typeof n.crossOrigin&&"string"!=typeof n.integrity?zC:[n.crossOrigin,n.integrity],o.preloads.stylesheets.set(e,i),o.bulkPreloads.add(i);break;case"script":if(a.scriptResources.hasOwnProperty(e))return;i=[],o.preloads.scripts.set(e,i),o.bulkPreloads.add(i),OA(i,xC({rel:"preload",href:e,as:t},n)),a.scriptResources[e]=!n||"string"!=typeof n.crossOrigin&&"string"!=typeof n.integrity?zC:[n.crossOrigin,n.integrity];break;default:if(a.unknownResources.hasOwnProperty(t)){if((i=a.unknownResources[t]).hasOwnProperty(e))return}else i={},a.unknownResources[t]=i;if(i[e]=zC,(a=o.headers)&&0<a.remainingCapacity&&"font"===t&&(u=wI(e,t,n),0<=(a.remainingCapacity-=u.length+2)))o.resets.font[e]=zC,a.fontPreloads&&(a.fontPreloads+=", "),a.fontPreloads+=u;else if("font"===(OA(a=[],e=xC({rel:"preload",href:e,as:t},n)),t))o.fontPreloads.add(a);else o.bulkPreloads.add(a)}_O(r)}}else BC.L(e,t,n)},m:function(e,t){var n=HR||null;if(n){var r=n.resumableState,a=n.renderState;if(e){var o=t&&"string"==typeof t.as?t.as:"script";if("script"===o){if(r.moduleScriptResources.hasOwnProperty(e))return;o=[],r.moduleScriptResources[e]=!t||"string"!=typeof t.crossOrigin&&"string"!=typeof t.integrity?zC:[t.crossOrigin,t.integrity],a.preloads.moduleScripts.set(e,o)}else{if(r.moduleUnknownResources.hasOwnProperty(o)){var i=r.unknownResources[o];if(i.hasOwnProperty(e))return}else i={},r.moduleUnknownResources[o]=i;o=[],i[e]=zC}OA(o,xC({rel:"modulepreload",href:e},t)),a.bulkPreloads.add(o),_O(n)}}else BC.m(e,t)},X:function(e,t){var n=HR||null;if(n){var r=n.resumableState,a=n.renderState;if(e){var o=r.scriptResources.hasOwnProperty(e)?r.scriptResources[e]:void 0;null!==o&&(r.scriptResources[e]=null,t=xC({src:e,async:!0},t),o&&(2===o.length&&kI(t,o),e=a.preloads.scripts.get(e))&&(e.length=0),e=[],a.scripts.add(e),FA(e,t),_O(n))}}else BC.X(e,t)},S:function(e,t,n){var r=HR||null;if(r){var a=r.resumableState,o=r.renderState;if(e){t=t||"default";var i=o.styles.get(t),s=a.styleResources.hasOwnProperty(e)?a.styleResources[e]:void 0;null!==s&&(a.styleResources[e]=null,i||(i={precedence:vC(RC(t)),rules:[],hrefs:[],sheets:new Map},o.styles.set(t,i)),t={state:0,props:xC({rel:"stylesheet",href:e,"data-precedence":t},n)},s&&(2===s.length&&kI(t.props,s),(o=o.preloads.stylesheets.get(e))&&0<o.length?o.length=0:t.state=1),i.sheets.set(e,t),_O(r))}}else BC.S(e,t,n)},M:function(e,t){var n=HR||null;if(n){var r=n.resumableState,a=n.renderState;if(e){var o=r.moduleScriptResources.hasOwnProperty(e)?r.moduleScriptResources[e]:void 0;null!==o&&(r.moduleScriptResources[e]=null,t=xC({src:e,type:"module",async:!0},t),o&&(2===o.length&&kI(t,o),e=a.preloads.moduleScripts.get(e))&&(e.length=0),e=[],a.scripts.add(e),FA(e,t),_O(n))}}else BC.M(e,t)}};var zC=[];kC('"></template>');var HC=kC("<script>"),UC=kC("<\/script>"),$C=kC('<script src="'),GC=kC('<script type="module" src="'),VC=kC('" nonce="'),qC=kC('" integrity="'),WC=kC('" crossorigin="'),YC=kC('" async=""><\/script>'),KC=/(<\/|<)(s)(cript)/gi;function XC(e,t,n,r){return t+("s"===n?"\\u0073":"\\u0053")+r}var QC=kC('<script type="importmap">'),ZC=kC("<\/script>");function JC(e,t,n,r,a,o){var i=void 0===t?HC:kC('<script nonce="'+RC(t)+'">'),s=e.idPrefix;n=[];var l=e.bootstrapScriptContent,c=e.bootstrapScripts,u=e.bootstrapModules;if(void 0!==l&&n.push(i,vC((""+l).replace(KC,XC)),UC),l=[],void 0!==r&&(l.push(QC),l.push(vC((""+JSON.stringify(r)).replace(KC,XC))),l.push(ZC)),r=a?{preconnects:"",fontPreloads:"",highImagePreloads:"",remainingCapacity:2+("number"==typeof o?o:2e3)}:null,a={placeholderPrefix:kC(s+"P:"),segmentPrefix:kC(s+"S:"),boundaryPrefix:kC(s+"B:"),startInlineScript:i,htmlChunks:null,headChunks:null,externalRuntimeScript:null,bootstrapChunks:n,importMapChunks:l,onHeaders:a,headers:r,resets:{font:{},dns:{},connect:{default:{},anonymous:{},credentials:{}},image:{},style:{}},charsetChunks:[],viewportChunks:[],hoistableChunks:[],preconnects:new Set,fontPreloads:new Set,highImagePreloads:new Set,styles:new Map,bootstrapScripts:new Set,scripts:new Set,bulkPreloads:new Set,preloads:{images:new Map,stylesheets:new Map,scripts:new Map,moduleScripts:new Map},nonce:t,hoistableState:null,stylesToHoist:!1},void 0!==c)for(r=0;r<c.length;r++){var d=c[r];s=i=void 0,l={rel:"preload",as:"script",fetchPriority:"low",nonce:t},"string"==typeof d?l.href=o=d:(l.href=o=d.src,l.integrity=s="string"==typeof d.integrity?d.integrity:void 0,l.crossOrigin=i="string"==typeof d||null==d.crossOrigin?void 0:"use-credentials"===d.crossOrigin?"use-credentials":"");var p=o;(d=e).scriptResources[p]=null,d.moduleScriptResources[p]=null,OA(d=[],l),a.bootstrapScripts.add(d),n.push($C,vC(RC(o))),t&&n.push(VC,vC(RC(t))),"string"==typeof s&&n.push(qC,vC(RC(s))),"string"==typeof i&&n.push(WC,vC(RC(i))),n.push(YC)}if(void 0!==u)for(c=0;c<u.length;c++)i=o=void 0,s={rel:"modulepreload",fetchPriority:"low",nonce:t},"string"==typeof(l=u[c])?s.href=r=l:(s.href=r=l.src,s.integrity=i="string"==typeof l.integrity?l.integrity:void 0,s.crossOrigin=o="string"==typeof l||null==l.crossOrigin?void 0:"use-credentials"===l.crossOrigin?"use-credentials":""),d=r,(l=e).scriptResources[d]=null,l.moduleScriptResources[d]=null,OA(l=[],s),a.bootstrapScripts.add(l),n.push(GC,vC(RC(r))),t&&n.push(VC,vC(RC(t))),"string"==typeof i&&n.push(qC,vC(RC(i))),"string"==typeof o&&n.push(WC,vC(RC(o))),n.push(YC);return a}function eA(e,t,n,r,a){return{idPrefix:void 0===e?"":e,nextFormID:0,streamingFormat:0,bootstrapScriptContent:n,bootstrapScripts:r,bootstrapModules:a,instructions:0,hasBody:!1,hasHtml:!1,unknownResources:{},dnsResources:{},connectResources:{default:{},anonymous:{},credentials:{}},imageResources:{},styleResources:{},scriptResources:{},moduleUnknownResources:{},moduleScriptResources:{}}}function tA(e,t,n){return{insertionMode:e,selectedValue:t,tagScope:n}}function nA(e){return tA("http://www.w3.org/2000/svg"===e?3:"http://www.w3.org/1998/Math/MathML"===e?4:0,null,0)}function rA(e,t,n){switch(t){case"noscript":return tA(2,null,1|e.tagScope);case"select":return tA(2,null!=n.value?n.value:n.defaultValue,e.tagScope);case"svg":return tA(3,null,e.tagScope);case"picture":return tA(2,null,2|e.tagScope);case"math":return tA(4,null,e.tagScope);case"foreignObject":return tA(2,null,e.tagScope);case"table":return tA(5,null,e.tagScope);case"thead":case"tbody":case"tfoot":return tA(6,null,e.tagScope);case"colgroup":return tA(8,null,e.tagScope);case"tr":return tA(7,null,e.tagScope)}return 5<=e.insertionMode?tA(2,null,e.tagScope):0===e.insertionMode?tA("html"===t?1:2,null,e.tagScope):1===e.insertionMode?tA(2,null,e.tagScope):e}var aA=kC("\x3c!-- --\x3e");function oA(e,t,n,r){return""===t?r:(r&&e.push(aA),e.push(vC(RC(t))),!0)}var iA=new Map,sA=kC(' style="'),lA=kC(":"),cA=kC(";");function uA(e,t){if("object"!=typeof t)throw Error(BT(62));var n,r=!0;for(n in t)if(EC.call(t,n)){var a=t[n];if(null!=a&&"boolean"!=typeof a&&""!==a){if(0===n.indexOf("--")){var o=vC(RC(n));a=vC(RC((""+a).trim()))}else void 0===(o=iA.get(n))&&(o=kC(RC(n.replace(OC,"-$1").toLowerCase().replace(PC,"-ms-"))),iA.set(n,o)),a="number"==typeof a?0===a||AC.has(n)?vC(""+a):vC(a+"px"):vC(RC((""+a).trim()));r?(r=!1,e.push(sA,o,lA,a)):e.push(cA,o,lA,a)}}r||e.push(hA)}var dA=kC(" "),pA=kC('="'),hA=kC('"'),fA=kC('=""');function mA(e,t,n){n&&"function"!=typeof n&&"symbol"!=typeof n&&e.push(dA,vC(t),fA)}function gA(e,t,n){"function"!=typeof n&&"symbol"!=typeof n&&"boolean"!=typeof n&&e.push(dA,vC(t),pA,vC(RC(n)),hA)}var yA=kC(RC("javascript:throw new Error('React form unexpectedly submitted.')")),bA=kC('<input type="hidden"');function vA(e,t){this.push(bA),kA(e),gA(this,"name",t),gA(this,"value",e),this.push(SA)}function kA(e){if("string"!=typeof e)throw Error(BT(480))}function wA(e,t){if("function"==typeof t.$$FORM_ACTION){var n=e.nextFormID++;e=e.idPrefix+n;try{var r=t.$$FORM_ACTION(e);if(r){var a=r.data;null!=a&&a.forEach(kA)}return r}catch(o){if("object"==typeof o&&null!==o&&"function"==typeof o.then)throw o}}return null}function xA(e,t,n,r,a,o,i,s){var l=null;if("function"==typeof r){var c=wA(t,r);null!==c?(s=c.name,r=c.action||"",a=c.encType,o=c.method,i=c.target,l=c.data):(e.push(dA,vC("formAction"),pA,yA,hA),i=o=a=r=s=null,NA(t,n))}return null!=s&&EA(e,"name",s),null!=r&&EA(e,"formAction",r),null!=a&&EA(e,"formEncType",a),null!=o&&EA(e,"formMethod",o),null!=i&&EA(e,"formTarget",i),l}function EA(e,t,n){switch(t){case"className":gA(e,"class",n);break;case"tabIndex":gA(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":gA(e,t,n);break;case"style":uA(e,n);break;case"src":case"href":if(""===n)break;case"action":case"formAction":if(null==n||"function"==typeof n||"symbol"==typeof n||"boolean"==typeof n)break;n=DC(""+n),e.push(dA,vC(t),pA,vC(RC(n)),hA);break;case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"ref":break;case"autoFocus":case"multiple":case"muted":mA(e,t.toLowerCase(),n);break;case"xlinkHref":if("function"==typeof n||"symbol"==typeof n||"boolean"==typeof n)break;n=DC(""+n),e.push(dA,vC("xlink:href"),pA,vC(RC(n)),hA);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":"function"!=typeof n&&"symbol"!=typeof n&&e.push(dA,vC(t),pA,vC(RC(n)),hA);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&"function"!=typeof n&&"symbol"!=typeof n&&e.push(dA,vC(t),fA);break;case"capture":case"download":!0===n?e.push(dA,vC(t),fA):!1!==n&&"function"!=typeof n&&"symbol"!=typeof n&&e.push(dA,vC(t),pA,vC(RC(n)),hA);break;case"cols":case"rows":case"size":case"span":"function"!=typeof n&&"symbol"!=typeof n&&!isNaN(n)&&1<=n&&e.push(dA,vC(t),pA,vC(RC(n)),hA);break;case"rowSpan":case"start":"function"==typeof n||"symbol"==typeof n||isNaN(n)||e.push(dA,vC(t),pA,vC(RC(n)),hA);break;case"xlinkActuate":gA(e,"xlink:actuate",n);break;case"xlinkArcrole":gA(e,"xlink:arcrole",n);break;case"xlinkRole":gA(e,"xlink:role",n);break;case"xlinkShow":gA(e,"xlink:show",n);break;case"xlinkTitle":gA(e,"xlink:title",n);break;case"xlinkType":gA(e,"xlink:type",n);break;case"xmlBase":gA(e,"xml:base",n);break;case"xmlLang":gA(e,"xml:lang",n);break;case"xmlSpace":gA(e,"xml:space",n);break;default:if((!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&CC(t=NC.get(t)||t)){switch(typeof n){case"function":case"symbol":return;case"boolean":var r=t.toLowerCase().slice(0,5);if("data-"!==r&&"aria-"!==r)return}e.push(dA,vC(t),pA,vC(RC(n)),hA)}}}var _A=kC(">"),SA=kC("/>");function TA(e,t,n){if(null!=t){if(null!=n)throw Error(BT(60));if("object"!=typeof t||!("__html"in t))throw Error(BT(61));null!=(t=t.__html)&&e.push(vC(""+t))}}var CA=kC(' selected=""'),AA=kC('addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'React form unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});');function NA(e,t){!(16&e.instructions)&&(e.instructions|=16,t.bootstrapChunks.unshift(t.startInlineScript,AA,UC))}var IA=kC("\x3c!--F!--\x3e"),RA=kC("\x3c!--F--\x3e");function OA(e,t){for(var n in e.push(UA("link")),t)if(EC.call(t,n)){var r=t[n];if(null!=r)switch(n){case"children":case"dangerouslySetInnerHTML":throw Error(BT(399,"link"));default:EA(e,n,r)}}return e.push(SA),null}var PA=/(<\/|<)(s)(tyle)/gi;function LA(e,t,n,r){return t+("s"===n?"\\73 ":"\\53 ")+r}function DA(e,t,n){for(var r in e.push(UA(n)),t)if(EC.call(t,r)){var a=t[r];if(null!=a)switch(r){case"children":case"dangerouslySetInnerHTML":throw Error(BT(399,n));default:EA(e,r,a)}}return e.push(SA),null}function MA(e,t){e.push(UA("title"));var n,r=null,a=null;for(n in t)if(EC.call(t,n)){var o=t[n];if(null!=o)switch(n){case"children":r=o;break;case"dangerouslySetInnerHTML":a=o;break;default:EA(e,n,o)}}return e.push(_A),"function"!=typeof(t=Array.isArray(r)?2>r.length?r[0]:null:r)&&"symbol"!=typeof t&&null!=t&&e.push(vC(RC(""+t))),TA(e,a,r),e.push(qA("title")),null}function FA(e,t){e.push(UA("script"));var n,r=null,a=null;for(n in t)if(EC.call(t,n)){var o=t[n];if(null!=o)switch(n){case"children":r=o;break;case"dangerouslySetInnerHTML":a=o;break;default:EA(e,n,o)}}return e.push(_A),TA(e,a,r),"string"==typeof r&&e.push(vC((""+r).replace(KC,XC))),e.push(qA("script")),null}function jA(e,t,n){e.push(UA(n));var r,a=n=null;for(r in t)if(EC.call(t,r)){var o=t[r];if(null!=o)switch(r){case"children":n=o;break;case"dangerouslySetInnerHTML":a=o;break;default:EA(e,r,o)}}return e.push(_A),TA(e,a,n),"string"==typeof n?(e.push(vC(RC(n))),null):n}var BA=kC("\n"),zA=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,HA=new Map;function UA(e){var t=HA.get(e);if(void 0===t){if(!zA.test(e))throw Error(BT(65,e));t=kC("<"+e),HA.set(e,t)}return t}var $A=kC("<!DOCTYPE html>");function GA(e,t,n,r,a,o,i,s,l){switch(t){case"div":case"span":case"svg":case"path":case"g":case"p":case"li":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":break;case"a":e.push(UA("a"));var c,u=null,d=null;for(c in n)if(EC.call(n,c)){var p=n[c];if(null!=p)switch(c){case"children":u=p;break;case"dangerouslySetInnerHTML":d=p;break;case"href":""===p?gA(e,"href",""):EA(e,c,p);break;default:EA(e,c,p)}}if(e.push(_A),TA(e,d,u),"string"==typeof u){e.push(vC(RC(u)));var h=null}else h=u;return h;case"select":e.push(UA("select"));var f,m=null,g=null;for(f in n)if(EC.call(n,f)){var y=n[f];if(null!=y)switch(f){case"children":m=y;break;case"dangerouslySetInnerHTML":g=y;break;case"defaultValue":case"value":break;default:EA(e,f,y)}}return e.push(_A),TA(e,g,m),m;case"option":var b=i.selectedValue;e.push(UA("option"));var v,k=null,w=null,x=null,E=null;for(v in n)if(EC.call(n,v)){var _=n[v];if(null!=_)switch(v){case"children":k=_;break;case"selected":x=_;break;case"dangerouslySetInnerHTML":E=_;break;case"value":w=_;default:EA(e,v,_)}}if(null!=b){var S=null!==w?""+w:function(e){var t="";return FT.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(k);if(oC(b)){for(var T=0;T<b.length;T++)if(""+b[T]===S){e.push(CA);break}}else""+b===S&&e.push(CA)}else x&&e.push(CA);return e.push(_A),TA(e,E,k),k;case"textarea":e.push(UA("textarea"));var C,A=null,N=null,I=null;for(C in n)if(EC.call(n,C)){var R=n[C];if(null!=R)switch(C){case"children":I=R;break;case"value":A=R;break;case"defaultValue":N=R;break;case"dangerouslySetInnerHTML":throw Error(BT(91));default:EA(e,C,R)}}if(null===A&&null!==N&&(A=N),e.push(_A),null!=I){if(null!=A)throw Error(BT(92));if(oC(I)){if(1<I.length)throw Error(BT(93));A=""+I[0]}A=""+I}return"string"==typeof A&&"\n"===A[0]&&e.push(BA),null!==A&&e.push(vC(RC(""+A))),null;case"input":e.push(UA("input"));var O,P=null,L=null,D=null,M=null,F=null,j=null,B=null,z=null,H=null;for(O in n)if(EC.call(n,O)){var U=n[O];if(null!=U)switch(O){case"children":case"dangerouslySetInnerHTML":throw Error(BT(399,"input"));case"name":P=U;break;case"formAction":L=U;break;case"formEncType":D=U;break;case"formMethod":M=U;break;case"formTarget":F=U;break;case"defaultChecked":H=U;break;case"defaultValue":B=U;break;case"checked":z=U;break;case"value":j=U;break;default:EA(e,O,U)}}var $=xA(e,r,a,L,D,M,F,P);return null!==z?mA(e,"checked",z):null!==H&&mA(e,"checked",H),null!==j?EA(e,"value",j):null!==B&&EA(e,"value",B),e.push(SA),null!=$&&$.forEach(vA,e),null;case"button":e.push(UA("button"));var G,V=null,q=null,W=null,Y=null,K=null,X=null,Q=null;for(G in n)if(EC.call(n,G)){var Z=n[G];if(null!=Z)switch(G){case"children":V=Z;break;case"dangerouslySetInnerHTML":q=Z;break;case"name":W=Z;break;case"formAction":Y=Z;break;case"formEncType":K=Z;break;case"formMethod":X=Z;break;case"formTarget":Q=Z;break;default:EA(e,G,Z)}}var J=xA(e,r,a,Y,K,X,Q,W);if(e.push(_A),null!=J&&J.forEach(vA,e),TA(e,q,V),"string"==typeof V){e.push(vC(RC(V)));var ee=null}else ee=V;return ee;case"form":e.push(UA("form"));var te,ne=null,re=null,ae=null,oe=null,ie=null,se=null;for(te in n)if(EC.call(n,te)){var le=n[te];if(null!=le)switch(te){case"children":ne=le;break;case"dangerouslySetInnerHTML":re=le;break;case"action":ae=le;break;case"encType":oe=le;break;case"method":ie=le;break;case"target":se=le;break;default:EA(e,te,le)}}var ce=null,ue=null;if("function"==typeof ae){var de=wA(r,ae);null!==de?(ae=de.action||"",oe=de.encType,ie=de.method,se=de.target,ce=de.data,ue=de.name):(e.push(dA,vC("action"),pA,yA,hA),se=ie=oe=ae=null,NA(r,a))}if(null!=ae&&EA(e,"action",ae),null!=oe&&EA(e,"encType",oe),null!=ie&&EA(e,"method",ie),null!=se&&EA(e,"target",se),e.push(_A),null!==ue&&(e.push(bA),gA(e,"name",ue),e.push(SA),null!=ce&&ce.forEach(vA,e)),TA(e,re,ne),"string"==typeof ne){e.push(vC(RC(ne)));var pe=null}else pe=ne;return pe;case"menuitem":for(var he in e.push(UA("menuitem")),n)if(EC.call(n,he)){var fe=n[he];if(null!=fe)switch(he){case"children":case"dangerouslySetInnerHTML":throw Error(BT(400));default:EA(e,he,fe)}}return e.push(_A),null;case"object":e.push(UA("object"));var me,ge=null,ye=null;for(me in n)if(EC.call(n,me)){var be=n[me];if(null!=be)switch(me){case"children":ge=be;break;case"dangerouslySetInnerHTML":ye=be;break;case"data":var ve=DC(""+be);if(""===ve)break;e.push(dA,vC("data"),pA,vC(RC(ve)),hA);break;default:EA(e,me,be)}}if(e.push(_A),TA(e,ye,ge),"string"==typeof ge){e.push(vC(RC(ge)));var ke=null}else ke=ge;return ke;case"title":if(3===i.insertionMode||1&i.tagScope||null!=n.itemProp)var we=MA(e,n);else l?we=null:(MA(a.hoistableChunks,n),we=void 0);return we;case"link":var xe=n.rel,Ee=n.href,_e=n.precedence;if(3===i.insertionMode||1&i.tagScope||null!=n.itemProp||"string"!=typeof xe||"string"!=typeof Ee||""===Ee){OA(e,n);var Se=null}else if("stylesheet"===n.rel)if("string"!=typeof _e||null!=n.disabled||n.onLoad||n.onError)Se=OA(e,n);else{var Te=a.styles.get(_e),Ce=r.styleResources.hasOwnProperty(Ee)?r.styleResources[Ee]:void 0;if(null!==Ce){r.styleResources[Ee]=null,Te||(Te={precedence:vC(RC(_e)),rules:[],hrefs:[],sheets:new Map},a.styles.set(_e,Te));var Ae={state:0,props:xC({},n,{"data-precedence":n.precedence,precedence:null})};if(Ce){2===Ce.length&&kI(Ae.props,Ce);var Ne=a.preloads.stylesheets.get(Ee);Ne&&0<Ne.length?Ne.length=0:Ae.state=1}Te.sheets.set(Ee,Ae),o&&o.stylesheets.add(Ae)}else if(Te){var Ie=Te.sheets.get(Ee);Ie&&o&&o.stylesheets.add(Ie)}s&&e.push(aA),Se=null}else n.onLoad||n.onError?Se=OA(e,n):(s&&e.push(aA),Se=l?null:OA(a.hoistableChunks,n));return Se;case"script":var Re=n.async;if("string"!=typeof n.src||!n.src||!Re||"function"==typeof Re||"symbol"==typeof Re||n.onLoad||n.onError||3===i.insertionMode||1&i.tagScope||null!=n.itemProp)var Oe=FA(e,n);else{var Pe=n.src;if("module"===n.type)var Le=r.moduleScriptResources,De=a.preloads.moduleScripts;else Le=r.scriptResources,De=a.preloads.scripts;var Me=Le.hasOwnProperty(Pe)?Le[Pe]:void 0;if(null!==Me){Le[Pe]=null;var Fe=n;if(Me){2===Me.length&&kI(Fe=xC({},n),Me);var je=De.get(Pe);je&&(je.length=0)}var Be=[];a.scripts.add(Be),FA(Be,Fe)}s&&e.push(aA),Oe=null}return Oe;case"style":var ze=n.precedence,He=n.href;if(3===i.insertionMode||1&i.tagScope||null!=n.itemProp||"string"!=typeof ze||"string"!=typeof He||""===He){e.push(UA("style"));var Ue,$e=null,Ge=null;for(Ue in n)if(EC.call(n,Ue)){var Ve=n[Ue];if(null!=Ve)switch(Ue){case"children":$e=Ve;break;case"dangerouslySetInnerHTML":Ge=Ve;break;default:EA(e,Ue,Ve)}}e.push(_A);var qe=Array.isArray($e)?2>$e.length?$e[0]:null:$e;"function"!=typeof qe&&"symbol"!=typeof qe&&null!=qe&&e.push(vC((""+qe).replace(PA,LA))),TA(e,Ge,$e),e.push(qA("style"));var We=null}else{var Ye=a.styles.get(ze);if(null!==(r.styleResources.hasOwnProperty(He)?r.styleResources[He]:void 0)){r.styleResources[He]=null,Ye?Ye.hrefs.push(vC(RC(He))):(Ye={precedence:vC(RC(ze)),rules:[],hrefs:[vC(RC(He))],sheets:new Map},a.styles.set(ze,Ye));var Ke,Xe=Ye.rules,Qe=null,Ze=null;for(Ke in n)if(EC.call(n,Ke)){var Je=n[Ke];if(null!=Je)switch(Ke){case"children":Qe=Je;break;case"dangerouslySetInnerHTML":Ze=Je}}var et=Array.isArray(Qe)?2>Qe.length?Qe[0]:null:Qe;"function"!=typeof et&&"symbol"!=typeof et&&null!=et&&Xe.push(vC((""+et).replace(PA,LA))),TA(Xe,Ze,Qe)}Ye&&o&&o.styles.add(Ye),s&&e.push(aA),We=void 0}return We;case"meta":if(3===i.insertionMode||1&i.tagScope||null!=n.itemProp)var tt=DA(e,n,"meta");else s&&e.push(aA),tt=l?null:"string"==typeof n.charSet?DA(a.charsetChunks,n,"meta"):"viewport"===n.name?DA(a.viewportChunks,n,"meta"):DA(a.hoistableChunks,n,"meta");return tt;case"listing":case"pre":e.push(UA(t));var nt,rt=null,at=null;for(nt in n)if(EC.call(n,nt)){var ot=n[nt];if(null!=ot)switch(nt){case"children":rt=ot;break;case"dangerouslySetInnerHTML":at=ot;break;default:EA(e,nt,ot)}}if(e.push(_A),null!=at){if(null!=rt)throw Error(BT(60));if("object"!=typeof at||!("__html"in at))throw Error(BT(61));var it=at.__html;null!=it&&("string"==typeof it&&0<it.length&&"\n"===it[0]?e.push(BA,vC(it)):e.push(vC(""+it)))}return"string"==typeof rt&&"\n"===rt[0]&&e.push(BA),rt;case"img":var st=n.src,lt=n.srcSet;if(!("lazy"===n.loading||!st&&!lt||"string"!=typeof st&&null!=st||"string"!=typeof lt&&null!=lt)&&"low"!==n.fetchPriority&&!1==!!(3&i.tagScope)&&("string"!=typeof st||":"!==st[4]||"d"!==st[0]&&"D"!==st[0]||"a"!==st[1]&&"A"!==st[1]||"t"!==st[2]&&"T"!==st[2]||"a"!==st[3]&&"A"!==st[3])&&("string"!=typeof lt||":"!==lt[4]||"d"!==lt[0]&&"D"!==lt[0]||"a"!==lt[1]&&"A"!==lt[1]||"t"!==lt[2]&&"T"!==lt[2]||"a"!==lt[3]&&"A"!==lt[3])){var ct="string"==typeof n.sizes?n.sizes:void 0,ut=lt?lt+"\n"+(ct||""):st,dt=a.preloads.images,pt=dt.get(ut);if(pt)("high"===n.fetchPriority||10>a.highImagePreloads.size)&&(dt.delete(ut),a.highImagePreloads.add(pt));else if(!r.imageResources.hasOwnProperty(ut)){r.imageResources[ut]=zC;var ht,ft=n.crossOrigin,mt="string"==typeof ft?"use-credentials"===ft?ft:"":void 0,gt=a.headers;gt&&0<gt.remainingCapacity&&("high"===n.fetchPriority||500>gt.highImagePreloads.length)&&(ht=wI(st,"image",{imageSrcSet:n.srcSet,imageSizes:n.sizes,crossOrigin:mt,integrity:n.integrity,nonce:n.nonce,type:n.type,fetchPriority:n.fetchPriority,referrerPolicy:n.refererPolicy}),0<=(gt.remainingCapacity-=ht.length+2))?(a.resets.image[ut]=zC,gt.highImagePreloads&&(gt.highImagePreloads+=", "),gt.highImagePreloads+=ht):(OA(pt=[],{rel:"preload",as:"image",href:lt?void 0:st,imageSrcSet:lt,imageSizes:ct,crossOrigin:mt,integrity:n.integrity,type:n.type,fetchPriority:n.fetchPriority,referrerPolicy:n.referrerPolicy}),"high"===n.fetchPriority||10>a.highImagePreloads.size?a.highImagePreloads.add(pt):(a.bulkPreloads.add(pt),dt.set(ut,pt)))}}return DA(e,n,"img");case"base":case"area":case"br":case"col":case"embed":case"hr":case"keygen":case"param":case"source":case"track":case"wbr":return DA(e,n,t);case"head":if(2>i.insertionMode&&null===a.headChunks){a.headChunks=[];var yt=jA(a.headChunks,n,"head")}else yt=jA(e,n,"head");return yt;case"html":if(0===i.insertionMode&&null===a.htmlChunks){a.htmlChunks=[$A];var bt=jA(a.htmlChunks,n,"html")}else bt=jA(e,n,"html");return bt;default:if(-1!==t.indexOf("-")){e.push(UA(t));var vt,kt=null,wt=null;for(vt in n)if(EC.call(n,vt)){var xt=n[vt];if(null!=xt){var Et=vt;switch(vt){case"children":kt=xt;break;case"dangerouslySetInnerHTML":wt=xt;break;case"style":uA(e,xt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"ref":break;case"className":Et="class";default:if(CC(vt)&&"function"!=typeof xt&&"symbol"!=typeof xt&&!1!==xt){if(!0===xt)xt="";else if("object"==typeof xt)continue;e.push(dA,vC(Et),pA,vC(RC(xt)),hA)}}}}return e.push(_A),TA(e,wt,kt),kt}}return jA(e,n,t)}var VA=new Map;function qA(e){var t=VA.get(e);return void 0===t&&(t=kC("</"+e+">"),VA.set(e,t)),t}function WA(e,t){t=t.bootstrapChunks;for(var n=0;n<t.length-1;n++)mC(e,t[n]);return!(n<t.length)||(n=t[n],t.length=0,gC(e,n))}var YA=kC('<template id="'),KA=kC('"></template>'),XA=kC("\x3c!--$--\x3e"),QA=kC('\x3c!--$?--\x3e<template id="'),ZA=kC('"></template>'),JA=kC("\x3c!--$!--\x3e"),eN=kC("\x3c!--/$--\x3e"),tN=kC("<template"),nN=kC('"'),rN=kC(' data-dgst="');kC(' data-msg="'),kC(' data-stck="'),kC(' data-cstck="');var aN=kC("></template>");function oN(e,t,n){if(mC(e,QA),null===n)throw Error(BT(395));return mC(e,t.boundaryPrefix),mC(e,vC(n.toString(16))),gC(e,ZA)}var iN=kC('<div hidden id="'),sN=kC('">'),lN=kC("</div>"),cN=kC('<svg aria-hidden="true" style="display:none" id="'),uN=kC('">'),dN=kC("</svg>"),pN=kC('<math aria-hidden="true" style="display:none" id="'),hN=kC('">'),fN=kC("</math>"),mN=kC('<table hidden id="'),gN=kC('">'),yN=kC("</table>"),bN=kC('<table hidden><tbody id="'),vN=kC('">'),kN=kC("</tbody></table>"),wN=kC('<table hidden><tr id="'),xN=kC('">'),EN=kC("</tr></table>"),_N=kC('<table hidden><colgroup id="'),SN=kC('">'),TN=kC("</colgroup></table>");var CN=kC('$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'),AN=kC('$RS("'),NN=kC('","'),IN=kC('")<\/script>');kC('<template data-rsi="" data-sid="'),kC('" data-pid="');var RN=kC('$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RC("'),ON=kC('$RC("'),PN=kC('$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("'),LN=kC('$RM=new Map;\n$RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=\nd;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,\nt,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("'),DN=kC('$RR("'),MN=kC('","'),FN=kC('",'),jN=kC('"'),BN=kC(")<\/script>");kC('<template data-rci="" data-bid="'),kC('<template data-rri="" data-bid="'),kC('" data-sid="'),kC('" data-sty="');var zN=kC('$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};;$RX("'),HN=kC('$RX("'),UN=kC('"'),$N=kC(","),GN=kC(")<\/script>");kC('<template data-rxi="" data-bid="'),kC('" data-dgst="'),kC('" data-msg="'),kC('" data-stck="'),kC('" data-cstck="');var VN=/[<\u2028\u2029]/g;var qN=/[&><\u2028\u2029]/g;function WN(e){return JSON.stringify(e).replace(qN,(function(e){switch(e){case"&":return"\\u0026";case">":return"\\u003e";case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSObjectForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}))}var YN=kC('<style media="not all" data-precedence="'),KN=kC('" data-href="'),XN=kC('">'),QN=kC("</style>"),ZN=!1,JN=!0;function eI(e){var t=e.rules,n=e.hrefs,r=0;if(n.length){for(mC(this,YN),mC(this,e.precedence),mC(this,KN);r<n.length-1;r++)mC(this,n[r]),mC(this,lI);for(mC(this,n[r]),mC(this,XN),r=0;r<t.length;r++)mC(this,t[r]);JN=gC(this,QN),ZN=!0,t.length=0,n.length=0}}function tI(e){return 2!==e.state&&(ZN=!0)}function nI(e,t,n){return ZN=!1,JN=!0,t.styles.forEach(eI,e),t.stylesheets.forEach(tI),ZN&&(n.stylesToHoist=!0),JN}function rI(e){for(var t=0;t<e.length;t++)mC(this,e[t]);e.length=0}var aI=[];function oI(e){OA(aI,e.props);for(var t=0;t<aI.length;t++)mC(this,aI[t]);aI.length=0,e.state=2}var iI=kC('<style data-precedence="'),sI=kC('" data-href="'),lI=kC(" "),cI=kC('">'),uI=kC("</style>");function dI(e){var t=0<e.sheets.size;e.sheets.forEach(oI,this),e.sheets.clear();var n=e.rules,r=e.hrefs;if(!t||r.length){if(mC(this,iI),mC(this,e.precedence),e=0,r.length){for(mC(this,sI);e<r.length-1;e++)mC(this,r[e]),mC(this,lI);mC(this,r[e])}for(mC(this,cI),e=0;e<n.length;e++)mC(this,n[e]);mC(this,uI),n.length=0,r.length=0}}function pI(e){if(0===e.state){e.state=1;var t=e.props;for(OA(aI,{rel:"preload",as:"style",href:e.props.href,crossOrigin:t.crossOrigin,fetchPriority:t.fetchPriority,integrity:t.integrity,media:t.media,hrefLang:t.hrefLang,referrerPolicy:t.referrerPolicy}),e=0;e<aI.length;e++)mC(this,aI[e]);aI.length=0}}function hI(e){e.sheets.forEach(pI,this),e.sheets.clear()}var fI=kC("["),mI=kC(",["),gI=kC(","),yI=kC("]");function bI(e,t,n){var r=t.toLowerCase();switch(typeof n){case"function":case"symbol":return}switch(t){case"innerHTML":case"dangerouslySetInnerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"style":case"ref":return;case"className":r="class",t=""+n;break;case"hidden":if(!1===n)return;t="";break;case"src":case"href":t=""+(n=DC(n));break;default:if(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])||!CC(t))return;t=""+n}mC(e,gI),mC(e,vC(WN(r))),mC(e,gI),mC(e,vC(WN(t)))}function vI(){return{styles:new Set,stylesheets:new Set}}function kI(e,t){null==e.crossOrigin&&(e.crossOrigin=t[0]),null==e.integrity&&(e.integrity=t[1])}function wI(e,t,n){for(var r in t="<"+(e=(""+e).replace(xI,EI))+'>; rel=preload; as="'+(t=(""+t).replace(_I,SI))+'"',n)EC.call(n,r)&&("string"==typeof(e=n[r])&&(t+="; "+r.toLowerCase()+'="'+(""+e).replace(_I,SI)+'"'));return t}var xI=/[<>\r\n]/g;function EI(e){switch(e){case"<":return"%3C";case">":return"%3E";case"\n":return"%0A";case"\r":return"%0D";default:throw Error("escapeLinkHrefForHeaderContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}var _I=/["';,\r\n]/g;function SI(e){switch(e){case'"':return"%22";case"'":return"%27";case";":return"%3B";case",":return"%2C";case"\n":return"%0A";case"\r":return"%0D";default:throw Error("escapeStringForLinkHeaderQuotedParamValueContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}function TI(e){this.styles.add(e)}function CI(e){this.stylesheets.add(e)}var AI=Function.prototype.bind,NI=Symbol.for("react.client.reference");function II(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===NI?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case UT:return"Fragment";case HT:return"Portal";case GT:return"Profiler";case $T:return"StrictMode";case KT:return"Suspense";case XT:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case WT:return(e.displayName||"Context")+".Provider";case qT:return(e._context.displayName||"Context")+".Consumer";case YT:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case QT:return null!==(t=e.displayName||null)?t:II(e.type)||"Memo";case ZT:t=e._payload,e=e._init;try{return II(e(t))}catch(n){}}return null}var RI={},OI=null;function PI(e,t){if(e!==t){e.context._currentValue=e.parentValue,e=e.parent;var n=t.parent;if(null===e){if(null!==n)throw Error(BT(401))}else{if(null===n)throw Error(BT(401));PI(e,n)}t.context._currentValue=t.value}}function LI(e){e.context._currentValue=e.parentValue,null!==(e=e.parent)&&LI(e)}function DI(e){var t=e.parent;null!==t&&DI(t),e.context._currentValue=e.value}function MI(e,t){if(e.context._currentValue=e.parentValue,null===(e=e.parent))throw Error(BT(402));e.depth===t.depth?PI(e,t):MI(e,t)}function FI(e,t){var n=t.parent;if(null===n)throw Error(BT(402));e.depth===n.depth?PI(e,n):FI(e,n),t.context._currentValue=t.value}function jI(e){var t=OI;t!==e&&(null===t?DI(e):null===e?LI(t):t.depth===e.depth?PI(t,e):t.depth>e.depth?MI(t,e):FI(t,e),OI=e)}var BI={isMounted:function(){return!1},enqueueSetState:function(e,t){null!==(e=e._reactInternals).queue&&e.queue.push(t)},enqueueReplaceState:function(e,t){(e=e._reactInternals).replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}},zI={id:1,overflow:""};function HI(e,t,n){var r=e.id;e=e.overflow;var a=32-UI(r)-1;r&=~(1<<a),n+=1;var o=32-UI(t)+a;if(30<o){var i=a-a%5;return o=(r&(1<<i)-1).toString(32),r>>=i,a-=i,{id:1<<32-UI(t)+a|n<<a|r,overflow:o+e}}return{id:1<<o|n<<a|r,overflow:e}}var UI=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-($I(e)/GI|0)|0},$I=Math.log,GI=Math.LN2;var VI=Error(BT(460));function qI(){}var WI=null;function YI(){if(null===WI)throw Error(BT(459));var e=WI;return WI=null,e}var KI="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},XI=null,QI=null,ZI=null,JI=null,eR=null,tR=null,nR=!1,rR=!1,aR=0,oR=0,iR=-1,sR=0,lR=null,cR=null,uR=0;function dR(){if(null===XI)throw Error(BT(321));return XI}function pR(){if(0<uR)throw Error(BT(312));return{memoizedState:null,queue:null,next:null}}function hR(){return null===tR?null===eR?(nR=!1,eR=tR=pR()):(nR=!0,tR=eR):null===tR.next?(nR=!1,tR=tR.next=pR()):(nR=!0,tR=tR.next),tR}function fR(){var e=lR;return lR=null,e}function mR(){JI=ZI=QI=XI=null,rR=!1,eR=null,uR=0,tR=cR=null}function gR(e,t){return"function"==typeof t?t(e):t}function yR(e,t,n){if(XI=dR(),tR=hR(),nR){var r=tR.queue;if(t=r.dispatch,null!==cR&&void 0!==(n=cR.get(r))){cR.delete(r),r=tR.memoizedState;do{r=e(r,n.action),n=n.next}while(null!==n);return tR.memoizedState=r,[r,t]}return[tR.memoizedState,t]}return e=e===gR?"function"==typeof t?t():t:void 0!==n?n(t):t,tR.memoizedState=e,e=(e=tR.queue={last:null,dispatch:null}).dispatch=vR.bind(null,XI,e),[tR.memoizedState,e]}function bR(e,t){if(XI=dR(),t=void 0===t?null:t,null!==(tR=hR())){var n=tR.memoizedState;if(null!==n&&null!==t){var r=n[1];e:if(null===r)r=!1;else{for(var a=0;a<r.length&&a<t.length;a++)if(!KI(t[a],r[a])){r=!1;break e}r=!0}if(r)return n[0]}}return e=e(),tR.memoizedState=[e,t],e}function vR(e,t,n){if(25<=uR)throw Error(BT(301));if(e===XI)if(rR=!0,e={action:n,next:null},null===cR&&(cR=new Map),void 0===(n=cR.get(t)))cR.set(t,e);else{for(t=n;null!==t.next;)t=t.next;t.next=e}}function kR(){throw Error(BT(394))}function wR(){throw Error(BT(479))}function xR(e,t,n){dR();var r=oR++,a=ZI;if("function"==typeof e.$$FORM_ACTION){var o=null,i=JI;a=a.formState;var s=e.$$IS_SIGNATURE_EQUAL;if(null!==a&&"function"==typeof s){var l=a[1];s.call(e,a[2],a[3])&&(l===(o=void 0!==n?"p"+n:"k"+iC(JSON.stringify([i,null,r]),0))&&(iR=r,t=a[0]))}var c=e.bind(null,t);return e=function(e){c(e)},"function"==typeof c.$$FORM_ACTION&&(e.$$FORM_ACTION=function(e){e=c.$$FORM_ACTION(e),void 0!==n&&(n+="",e.action=n);var t=e.data;return t&&(null===o&&(o=void 0!==n?"p"+n:"k"+iC(JSON.stringify([i,null,r]),0)),t.append("$ACTION_KEY",o)),e}),[t,e,!1]}var u=e.bind(null,t);return[t,function(e){u(e)},!1]}function ER(e){var t=sR;return sR+=1,null===lR&&(lR=[]),function(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(qI,qI),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch("string"==typeof t.status?t.then(qI,qI):((e=t).status="pending",e.then((function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}}),(function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}}))),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}throw WI=t,VI}}(lR,e,t)}function _R(){throw Error(BT(393))}function SR(){}var TR={readContext:function(e){return e._currentValue},use:function(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return ER(e);if(e.$$typeof===WT)return e._currentValue}throw Error(BT(438,String(e)))},useContext:function(e){return dR(),e._currentValue},useMemo:bR,useReducer:yR,useRef:function(e){XI=dR();var t=(tR=hR()).memoizedState;return null===t?(e={current:e},tR.memoizedState=e):t},useState:function(e){return yR(gR,e)},useInsertionEffect:SR,useLayoutEffect:SR,useCallback:function(e,t){return bR((function(){return e}),t)},useImperativeHandle:SR,useEffect:SR,useDebugValue:SR,useDeferredValue:function(e,t){return dR(),void 0!==t?t:e},useTransition:function(){return dR(),[!1,kR]},useId:function(){var e=QI.treeContext,t=e.overflow;e=((e=e.id)&~(1<<32-UI(e)-1)).toString(32)+t;var n=NR;if(null===n)throw Error(BT(404));return t=aR++,e=":"+n.idPrefix+"R"+e,0<t&&(e+="H"+t.toString(32)),e+":"},useSyncExternalStore:function(e,t,n){if(void 0===n)throw Error(BT(407));return n()},useCacheRefresh:function(){return _R},useMemoCache:function(e){for(var t=Array(e),n=0;n<e;n++)t[n]=rC;return t},useHostTransitionStatus:function(){return dR(),jC},useOptimistic:function(e){return dR(),[e,wR]}};TR.useFormState=xR,TR.useActionState=xR;var CR,AR,NR=null,IR={getCacheForType:function(){throw Error(BT(248))}};function RR(e){if(void 0===CR)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);CR=t&&t[1]||"",AR=-1<n.stack.indexOf("\n at")?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+CR+e+AR}var OR=!1;function PR(e,t){if(!e||OR)return"";OR=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(a){var r=a}Reflect.construct(e,[],n)}else{try{n.call()}catch(o){r=o}e.call(n.prototype)}}else{try{throw Error()}catch(i){r=i}(n=e())&&"function"==typeof n.catch&&n.catch((function(){}))}}catch(s){if(s&&r&&"string"==typeof s.stack)return[s.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=r.DetermineComponentFrameRoot(),i=o[0],s=o[1];if(i&&s){var l=i.split("\n"),c=s.split("\n");for(a=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;a<c.length&&!c[a].includes("DetermineComponentFrameRoot");)a++;if(r===l.length||a===c.length)for(r=l.length-1,a=c.length-1;1<=r&&0<=a&&l[r]!==c[a];)a--;for(;1<=r&&0<=a;r--,a--)if(l[r]!==c[a]){if(1!==r||1!==a)do{if(r--,0>--a||l[r]!==c[a]){var u="\n"+l[r].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}}while(1<=r&&0<=a);break}}}finally{OR=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?RR(n):""}function LR(e){if("string"==typeof e)return RR(e);if("function"==typeof e)return e.prototype&&e.prototype.isReactComponent?e=PR(e,!0):PR(e,!1);if("object"==typeof e&&null!==e){switch(e.$$typeof){case YT:return PR(e.render,!1);case QT:return PR(e.type,!1);case ZT:var t=e,n=t._payload;t=t._init;try{e=t(n)}catch(r){return RR("Lazy")}return LR(e)}if("string"==typeof e.name)return n=e.env,RR(e.name+(n?" ["+n+"]":""))}switch(e){case XT:return RR("SuspenseList");case KT:return RR("Suspense")}return""}function DR(e){if("object"==typeof e&&null!==e&&"string"==typeof e.environmentName){var t=e.environmentName;"string"==typeof(e=[e].slice(0))[0]?e.splice(0,1,"%c%s%c "+e[0],"background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px"," "+t+" ",""):e.splice(0,0,"%c%s%c ","background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px"," "+t+" ",""),e.unshift(console),(t=AI.apply(console.error,e))()}else console.error(e);return null}function MR(){}function FR(e,t,n,r,a,o,i,s,l,c,u){var d=new Set;this.destination=null,this.flushScheduled=!1,this.resumableState=e,this.renderState=t,this.rootFormatContext=n,this.progressiveChunkSize=void 0===r?12800:r,this.status=10,this.fatalError=null,this.pendingRootTasks=this.allPendingTasks=this.nextSegmentId=0,this.completedRootSegment=null,this.abortableTasks=d,this.pingedTasks=[],this.clientRenderedBoundaries=[],this.completedBoundaries=[],this.partialBoundaries=[],this.trackedPostpones=null,this.onError=void 0===a?DR:a,this.onPostpone=void 0===c?MR:c,this.onAllReady=void 0===o?MR:o,this.onShellReady=void 0===i?MR:i,this.onShellError=void 0===s?MR:s,this.onFatalError=void 0===l?MR:l,this.formState=void 0===u?null:u}function jR(e,t,n,r,a,o,i,s,l,c,u,d){return(n=qR(t=new FR(t,n,r,a,o,i,s,l,c,u,d),0,null,r,!1,!1)).parentFlushed=!0,WR(e=GR(t,null,e,-1,null,n,null,t.abortableTasks,null,r,null,zI,null,!1)),t.pingedTasks.push(e),t}var BR,zR,HR=null;function UR(e,t){e.pingedTasks.push(t),1===e.pingedTasks.length&&(e.flushScheduled=null!==e.destination,null!==e.trackedPostpones||10===e.status?pC((function(){return gO(e)})):cC((function(){return gO(e)})))}function $R(e,t){return{status:0,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,completedSegments:[],byteSize:0,fallbackAbortableTasks:t,errorDigest:null,contentState:vI(),fallbackState:vI(),trackedContentKeyPath:null,trackedFallbackNode:null}}function GR(e,t,n,r,a,o,i,s,l,c,u,d,p,h){e.allPendingTasks++,null===a?e.pendingRootTasks++:a.pendingTasks++;var f={replay:null,node:n,childIndex:r,ping:function(){return UR(e,f)},blockedBoundary:a,blockedSegment:o,hoistableState:i,abortSet:s,keyPath:l,formatContext:c,context:u,treeContext:d,componentStack:p,thenableState:t,isFallback:h};return s.add(f),f}function VR(e,t,n,r,a,o,i,s,l,c,u,d,p,h){e.allPendingTasks++,null===o?e.pendingRootTasks++:o.pendingTasks++,n.pendingTasks++;var f={replay:n,node:r,childIndex:a,ping:function(){return UR(e,f)},blockedBoundary:o,blockedSegment:null,hoistableState:i,abortSet:s,keyPath:l,formatContext:c,context:u,treeContext:d,componentStack:p,thenableState:t,isFallback:h};return s.add(f),f}function qR(e,t,n,r,a,o){return{status:0,id:-1,index:t,parentFlushed:!1,chunks:[],children:[],parentFormatContext:r,boundary:n,lastPushedText:a,textEmbedded:o}}function WR(e){var t=e.node;if("object"==typeof t&&null!==t&&t.$$typeof===zT)e.componentStack={parent:e.componentStack,type:t.type}}function YR(e){var t={};return e&&Object.defineProperty(t,"componentStack",{configurable:!0,enumerable:!0,get:function(){try{var n="",r=e;do{n+=LR(r.type),r=r.parent}while(r);var a=n}catch(o){a="\nError generating stack: "+o.message+"\n"+o.stack}return Object.defineProperty(t,"componentStack",{value:a}),a}}),t}function KR(e,t,n){if(null==(t=(e=e.onError)(t,n))||"string"==typeof t)return t}function XR(e,t){var n=e.onShellError,r=e.onFatalError;n(t),r(t),null!==e.destination?(e.status=14,wC(e.destination,t)):(e.status=13,e.fatalError=t)}function QR(e,t,n,r,a,o){var i=t.thenableState;for(t.thenableState=null,XI={},QI=t,ZI=e,JI=n,oR=aR=0,iR=-1,sR=0,lR=i,e=r(a,o);rR;)rR=!1,oR=aR=0,iR=-1,sR=0,uR+=1,tR=null,e=r(a,o);return mR(),e}function ZR(e,t,n,r,a,o,i){var s=!1;if(0!==o&&null!==e.formState){var l=t.blockedSegment;if(null!==l){s=!0,l=l.chunks;for(var c=0;c<o;c++)c===i?l.push(IA):l.push(RA)}}o=t.keyPath,t.keyPath=n,a?(n=t.treeContext,t.treeContext=HI(n,1,0),sO(e,t,r,-1),t.treeContext=n):s?sO(e,t,r,-1):tO(e,t,r,-1),t.keyPath=o}function JR(e,t,n,r,a,o){if("function"==typeof r)if(r.prototype&&r.prototype.isReactComponent){var i=a;if("ref"in a)for(var s in i={},a)"ref"!==s&&(i[s]=a[s]);var l=r.defaultProps;if(l)for(var c in i===a&&(i=xC({},i,a)),l)void 0===i[c]&&(i[c]=l[c]);a=i,i=RI,"object"==typeof(l=r.contextType)&&null!==l&&(i=l._currentValue);var u=void 0!==(i=new r(a,i)).state?i.state:null;if(i.updater=BI,i.props=a,i.state=u,l={queue:[],replace:!1},i._reactInternals=l,o=r.contextType,i.context="object"==typeof o&&null!==o?o._currentValue:RI,"function"==typeof(o=r.getDerivedStateFromProps)&&(u=null==(o=o(a,u))?u:xC({},u,o),i.state=u),"function"!=typeof r.getDerivedStateFromProps&&"function"!=typeof i.getSnapshotBeforeUpdate&&("function"==typeof i.UNSAFE_componentWillMount||"function"==typeof i.componentWillMount))if(r=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),r!==i.state&&BI.enqueueReplaceState(i,i.state,null),null!==l.queue&&0<l.queue.length)if(r=l.queue,o=l.replace,l.queue=null,l.replace=!1,o&&1===r.length)i.state=r[0];else{for(l=o?r[0]:i.state,u=!0,o=o?1:0;o<r.length;o++)null!=(c="function"==typeof(c=r[o])?c.call(i,l,a,void 0):c)&&(u?(u=!1,l=xC({},l,c)):xC(l,c));i.state=l}else l.queue=null;if(r=i.render(),12===e.status)throw null;a=t.keyPath,t.keyPath=n,tO(e,t,r,-1),t.keyPath=a}else{if(r=QR(e,t,n,r,a,void 0),12===e.status)throw null;ZR(e,t,n,r,0!==aR,oR,iR)}else{if("string"!=typeof r){switch(r){case nC:case eC:case $T:case GT:case UT:return r=t.keyPath,t.keyPath=n,tO(e,t,a.children,-1),void(t.keyPath=r);case tC:return void("hidden"!==a.mode&&(r=t.keyPath,t.keyPath=n,tO(e,t,a.children,-1),t.keyPath=r));case XT:return r=t.keyPath,t.keyPath=n,tO(e,t,a.children,-1),void(t.keyPath=r);case JT:throw Error(BT(343));case KT:e:if(null!==t.replay){r=t.keyPath,t.keyPath=n,n=a.children;try{sO(e,t,n,-1)}finally{t.keyPath=r}}else{r=t.keyPath;var d=t.blockedBoundary,p=t.hoistableState;o=t.blockedSegment,c=a.fallback,a=a.children;var h=new Set;s=$R(0,h),null!==e.trackedPostpones&&(s.trackedContentKeyPath=n);var f=qR(0,o.chunks.length,s,t.formatContext,!1,!1);o.children.push(f),o.lastPushedText=!1;var m=qR(0,0,null,t.formatContext,!1,!1);if(m.parentFlushed=!0,null!==e.trackedPostpones){l=[(i=[n[0],"Suspense Fallback",n[2]])[1],i[2],[],null],e.trackedPostpones.workingMap.set(i,l),s.trackedFallbackNode=l,t.blockedSegment=f,t.keyPath=i,f.status=6;try{sO(e,t,c,-1),f.lastPushedText&&f.textEmbedded&&f.chunks.push(aA),f.status=1}catch(g){throw f.status=12===e.status?3:4,g}finally{t.blockedSegment=o,t.keyPath=r}WR(t=GR(e,null,a,-1,s,m,s.contentState,t.abortSet,n,t.formatContext,t.context,t.treeContext,t.componentStack,t.isFallback)),e.pingedTasks.push(t)}else{t.blockedBoundary=s,t.hoistableState=s.contentState,t.blockedSegment=m,t.keyPath=n,m.status=6;try{if(sO(e,t,a,-1),m.lastPushedText&&m.textEmbedded&&m.chunks.push(aA),m.status=1,fO(s,m),0===s.pendingTasks&&0===s.status){s.status=1;break e}}catch(y){s.status=4,12===e.status?(m.status=3,i=e.fatalError):(m.status=4,i=y),u=KR(e,i,l=YR(t.componentStack)),s.errorDigest=u,aO(e,s)}finally{t.blockedBoundary=d,t.hoistableState=p,t.blockedSegment=o,t.keyPath=r}WR(t=GR(e,null,c,-1,d,f,s.fallbackState,h,[n[0],"Suspense Fallback",n[2]],t.formatContext,t.context,t.treeContext,t.componentStack,!0)),e.pingedTasks.push(t)}}return}if("object"==typeof r&&null!==r)switch(r.$$typeof){case YT:if("ref"in a)for(f in i={},a)"ref"!==f&&(i[f]=a[f]);else i=a;return void ZR(e,t,n,r=QR(e,t,n,r.render,i,o),0!==aR,oR,iR);case QT:return void JR(e,t,n,r.type,a,o);case VT:case WT:if(l=a.children,i=t.keyPath,a=a.value,u=r._currentValue,r._currentValue=a,OI=r={parent:o=OI,depth:null===o?0:o.depth+1,context:r,parentValue:u,value:a},t.context=r,t.keyPath=n,tO(e,t,l,-1),null===(e=OI))throw Error(BT(403));return e.context._currentValue=e.parentValue,e=OI=e.parent,t.context=e,void(t.keyPath=i);case qT:return r=(a=a.children)(r._context._currentValue),a=t.keyPath,t.keyPath=n,tO(e,t,r,-1),void(t.keyPath=a);case ZT:if(r=(i=r._init)(r._payload),12===e.status)throw null;return void JR(e,t,n,r,a,o)}throw Error(BT(130,null==r?r:typeof r,""))}if(null===(i=t.blockedSegment))i=a.children,l=t.formatContext,u=t.keyPath,t.formatContext=rA(l,r,a),t.keyPath=n,sO(e,t,i,-1),t.formatContext=l,t.keyPath=u;else{u=GA(i.chunks,r,a,e.resumableState,e.renderState,t.hoistableState,t.formatContext,i.lastPushedText,t.isFallback),i.lastPushedText=!1,l=t.formatContext,o=t.keyPath,t.formatContext=rA(l,r,a),t.keyPath=n,sO(e,t,u,-1),t.formatContext=l,t.keyPath=o;e:{switch(t=i.chunks,e=e.resumableState,r){case"title":case"style":case"script":case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break e;case"body":if(1>=l.insertionMode){e.hasBody=!0;break e}break;case"html":if(0===l.insertionMode){e.hasHtml=!0;break e}}t.push(qA(r))}i.lastPushedText=!1}}}function eO(e,t,n,r,a){var o=t.replay,i=t.blockedBoundary,s=qR(0,0,null,t.formatContext,!1,!1);s.id=n,s.parentFlushed=!0;try{t.replay=null,t.blockedSegment=s,sO(e,t,r,a),s.status=1,null===i?e.completedRootSegment=s:(fO(i,s),i.parentFlushed&&e.partialBoundaries.push(i))}finally{t.replay=o,t.blockedSegment=null}}function tO(e,t,n,r){null!==t.replay&&"number"==typeof t.replay.slots?eO(e,t,t.replay.slots,n,r):(t.node=n,t.childIndex=r,n=t.componentStack,WR(t),nO(e,t),t.componentStack=n)}function nO(e,t){var n=t.node,r=t.childIndex;if(null!==n){if("object"==typeof n){switch(n.$$typeof){case zT:var a=n.type,o=n.key,i=n.props,s=void 0!==(n=i.ref)?n:null,l=II(a),c=null==o?-1===r?0:r:o;if(o=[t.keyPath,l,c],null!==t.replay)e:{var u=t.replay;for(r=u.nodes,n=0;n<r.length;n++){var d=r[n];if(c===d[1]){if(4===d.length){if(null!==l&&l!==d[0])throw Error(BT(490,d[0],l));var p=d[2];l=d[3],c=t.node,t.replay={nodes:p,slots:l,pendingTasks:1};try{if(JR(e,t,o,a,i,s),1===t.replay.pendingTasks&&0<t.replay.nodes.length)throw Error(BT(488));t.replay.pendingTasks--}catch(k){if("object"==typeof k&&null!==k&&(k===VI||"function"==typeof k.then))throw t.node===c&&(t.replay=u),k;t.replay.pendingTasks--,i=YR(t.componentStack),cO(e,o=t.blockedBoundary,p,l,a=k,i=KR(e,a,i))}t.replay=u}else{if(a!==KT)throw Error(BT(490,"Suspense",II(a)||"Unknown"));t:{u=void 0,a=d[5],s=d[2],l=d[3],c=null===d[4]?[]:d[4][2],d=null===d[4]?null:d[4][3];var h=t.keyPath,f=t.replay,m=t.blockedBoundary,g=t.hoistableState,y=i.children;i=i.fallback;var b=new Set,v=$R(0,b);v.parentFlushed=!0,v.rootSegmentID=a,t.blockedBoundary=v,t.hoistableState=v.contentState,t.keyPath=o,t.replay={nodes:s,slots:l,pendingTasks:1};try{if(sO(e,t,y,-1),1===t.replay.pendingTasks&&0<t.replay.nodes.length)throw Error(BT(488));if(t.replay.pendingTasks--,0===v.pendingTasks&&0===v.status){v.status=1,e.completedBoundaries.push(v);break t}}catch(w){v.status=4,u=KR(e,w,p=YR(t.componentStack)),v.errorDigest=u,t.replay.pendingTasks--,e.clientRenderedBoundaries.push(v)}finally{t.blockedBoundary=m,t.hoistableState=g,t.replay=f,t.keyPath=h}WR(t=VR(e,null,{nodes:c,slots:d,pendingTasks:0},i,-1,m,v.fallbackState,b,[o[0],"Suspense Fallback",o[2]],t.formatContext,t.context,t.treeContext,t.componentStack,!0)),e.pingedTasks.push(t)}}r.splice(n,1);break e}}}else JR(e,t,o,a,i,s);return;case HT:throw Error(BT(257));case ZT:if(n=(p=n._init)(n._payload),12===e.status)throw null;return void tO(e,t,n,r)}if(oC(n))return void rO(e,t,n,r);if(null===n||"object"!=typeof n?p=null:p="function"==typeof(p=aC&&n[aC]||n["@@iterator"])?p:null,p&&(p=p.call(n))){if(!(n=p.next()).done){i=[];do{i.push(n.value),n=p.next()}while(!n.done);rO(e,t,i,r)}return}if("function"==typeof n.then)return t.thenableState=null,tO(e,t,ER(n),r);if(n.$$typeof===WT)return tO(e,t,n._currentValue,r);throw r=Object.prototype.toString.call(n),Error(BT(31,"[object Object]"===r?"object with keys {"+Object.keys(n).join(", ")+"}":r))}"string"==typeof n?null!==(r=t.blockedSegment)&&(r.lastPushedText=oA(r.chunks,n,e.renderState,r.lastPushedText)):"number"!=typeof n&&"bigint"!=typeof n||null!==(r=t.blockedSegment)&&(r.lastPushedText=oA(r.chunks,""+n,e.renderState,r.lastPushedText))}}function rO(e,t,n,r){var a=t.keyPath;if(-1===r||(t.keyPath=[t.keyPath,"Fragment",r],null===t.replay)){if(o=t.treeContext,i=n.length,null!==t.replay&&(null!==(s=t.replay.slots)&&"object"==typeof s)){for(r=0;r<i;r++)l=n[r],t.treeContext=HI(o,i,r),"number"==typeof(c=s[r])?(eO(e,t,c,l,r),delete s[r]):sO(e,t,l,r);return t.treeContext=o,void(t.keyPath=a)}for(s=0;s<i;s++)r=n[s],t.treeContext=HI(o,i,s),sO(e,t,r,s);t.treeContext=o,t.keyPath=a}else{for(var o=t.replay,i=o.nodes,s=0;s<i.length;s++){var l=i[s];if(l[1]===r){r=l[2],l=l[3],t.replay={nodes:r,slots:l,pendingTasks:1};try{if(rO(e,t,n,-1),1===t.replay.pendingTasks&&0<t.replay.nodes.length)throw Error(BT(488));t.replay.pendingTasks--}catch(u){if("object"==typeof u&&null!==u&&(u===VI||"function"==typeof u.then))throw u;t.replay.pendingTasks--,n=YR(t.componentStack);var c=t.blockedBoundary;cO(e,c,r,l,u,n=KR(e,u,n))}t.replay=o,i.splice(s,1);break}}t.keyPath=a}}function aO(e,t){null!==(e=e.trackedPostpones)&&(null!==(t=t.trackedContentKeyPath)&&(void 0!==(t=e.workingMap.get(t))&&(t.length=4,t[2]=[],t[3]=null)))}function oO(e,t,n){return VR(e,n,t.replay,t.node,t.childIndex,t.blockedBoundary,t.hoistableState,t.abortSet,t.keyPath,t.formatContext,t.context,t.treeContext,t.componentStack,t.isFallback)}function iO(e,t,n){var r=t.blockedSegment,a=qR(0,r.chunks.length,null,t.formatContext,r.lastPushedText,!0);return r.children.push(a),r.lastPushedText=!1,GR(e,n,t.node,t.childIndex,t.blockedBoundary,a,t.hoistableState,t.abortSet,t.keyPath,t.formatContext,t.context,t.treeContext,t.componentStack,t.isFallback)}function sO(e,t,n,r){var a=t.formatContext,o=t.context,i=t.keyPath,s=t.treeContext,l=t.componentStack,c=t.blockedSegment;if(null===c)try{return tO(e,t,n,r)}catch(p){if(mR(),"object"==typeof(n=p===VI?YI():p)&&null!==n){if("function"==typeof n.then)return e=oO(e,t,r=fR()).ping,n.then(e,e),t.formatContext=a,t.context=o,t.keyPath=i,t.treeContext=s,t.componentStack=l,void jI(o);if("Maximum call stack size exceeded"===n.message)return n=oO(e,t,n=fR()),e.pingedTasks.push(n),t.formatContext=a,t.context=o,t.keyPath=i,t.treeContext=s,t.componentStack=l,void jI(o)}}else{var u=c.children.length,d=c.chunks.length;try{return tO(e,t,n,r)}catch(h){if(mR(),c.children.length=u,c.chunks.length=d,"object"==typeof(n=h===VI?YI():h)&&null!==n){if("function"==typeof n.then)return e=iO(e,t,r=fR()).ping,n.then(e,e),t.formatContext=a,t.context=o,t.keyPath=i,t.treeContext=s,t.componentStack=l,void jI(o);if("Maximum call stack size exceeded"===n.message)return n=iO(e,t,n=fR()),e.pingedTasks.push(n),t.formatContext=a,t.context=o,t.keyPath=i,t.treeContext=s,t.componentStack=l,void jI(o)}}}throw t.formatContext=a,t.context=o,t.keyPath=i,t.treeContext=s,jI(o),n}function lO(e){var t=e.blockedBoundary;null!==(e=e.blockedSegment)&&(e.status=3,mO(this,t,e))}function cO(e,t,n,r,a,o){for(var i=0;i<n.length;i++){var s=n[i];if(4===s.length)cO(e,t,s[2],s[3],a,o);else{s=s[5];var l=e,c=o,u=$R(0,new Set);u.parentFlushed=!0,u.rootSegmentID=s,u.status=4,u.errorDigest=c,u.parentFlushed&&l.clientRenderedBoundaries.push(u)}}if(n.length=0,null!==r){if(null===t)throw Error(BT(487));if(4!==t.status&&(t.status=4,t.errorDigest=o,t.parentFlushed&&e.clientRenderedBoundaries.push(t)),"object"==typeof r)for(var d in r)delete r[d]}}function uO(e,t,n){var r=e.blockedBoundary,a=e.blockedSegment;if(null!==a){if(6===a.status)return;a.status=3}if(a=YR(e.componentStack),null===r){if(13!==t.status&&14!==t.status){if(null===(r=e.replay))return KR(t,n,a),void XR(t,n);r.pendingTasks--,0===r.pendingTasks&&0<r.nodes.length&&(e=KR(t,n,a),cO(t,null,r.nodes,r.slots,n,e)),t.pendingRootTasks--,0===t.pendingRootTasks&&pO(t)}}else r.pendingTasks--,4!==r.status&&(r.status=4,e=KR(t,n,a),r.status=4,r.errorDigest=e,aO(t,r),r.parentFlushed&&t.clientRenderedBoundaries.push(r)),r.fallbackAbortableTasks.forEach((function(e){return uO(e,t,n)})),r.fallbackAbortableTasks.clear();t.allPendingTasks--,0===t.allPendingTasks&&hO(t)}function dO(e,t){try{var n=e.renderState,r=n.onHeaders;if(r){var a=n.headers;if(a){n.headers=null;var o=a.preconnects;if(a.fontPreloads&&(o&&(o+=", "),o+=a.fontPreloads),a.highImagePreloads&&(o&&(o+=", "),o+=a.highImagePreloads),!t){var i=n.styles.values(),s=i.next();e:for(;0<a.remainingCapacity&&!s.done;s=i.next())for(var l=s.value.sheets.values(),c=l.next();0<a.remainingCapacity&&!c.done;c=l.next()){var u=c.value,d=u.props,p=d.href,h=u.props,f=wI(h.href,"style",{crossOrigin:h.crossOrigin,integrity:h.integrity,nonce:h.nonce,type:h.type,fetchPriority:h.fetchPriority,referrerPolicy:h.referrerPolicy,media:h.media});if(!(0<=(a.remainingCapacity-=f.length+2)))break e;n.resets.style[p]=zC,o&&(o+=", "),o+=f,n.resets.style[p]="string"==typeof d.crossOrigin||"string"==typeof d.integrity?[d.crossOrigin,d.integrity]:zC}}r(o?{Link:o}:{})}}}catch(m){KR(e,m,{})}}function pO(e){null===e.trackedPostpones&&dO(e,!0),e.onShellError=MR,(e=e.onShellReady)()}function hO(e){dO(e,null===e.trackedPostpones||(null===e.completedRootSegment||5!==e.completedRootSegment.status)),(e=e.onAllReady)()}function fO(e,t){if(0===t.chunks.length&&1===t.children.length&&null===t.children[0].boundary&&-1===t.children[0].id){var n=t.children[0];n.id=t.id,n.parentFlushed=!0,1===n.status&&fO(e,n)}else e.completedSegments.push(t)}function mO(e,t,n){if(null===t){if(null!==n&&n.parentFlushed){if(null!==e.completedRootSegment)throw Error(BT(389));e.completedRootSegment=n}e.pendingRootTasks--,0===e.pendingRootTasks&&pO(e)}else t.pendingTasks--,4!==t.status&&(0===t.pendingTasks?(0===t.status&&(t.status=1),null!==n&&n.parentFlushed&&1===n.status&&fO(t,n),t.parentFlushed&&e.completedBoundaries.push(t),1===t.status&&(t.fallbackAbortableTasks.forEach(lO,e),t.fallbackAbortableTasks.clear())):null!==n&&n.parentFlushed&&1===n.status&&(fO(t,n),1===t.completedSegments.length&&t.parentFlushed&&e.partialBoundaries.push(t)));e.allPendingTasks--,0===e.allPendingTasks&&hO(e)}function gO(e){if(14!==e.status&&13!==e.status){var t=OI,n=MC.H;MC.H=TR;var r=MC.A;MC.A=IR;var a=HR;HR=e;var o=NR;NR=e.resumableState;try{var i,s=e.pingedTasks;for(i=0;i<s.length;i++){var l=s[i],c=e,u=l.blockedSegment;if(null===u){var d=c;if(0!==l.replay.pendingTasks){jI(l.context);try{if("number"==typeof l.replay.slots?eO(d,l,l.replay.slots,l.node,l.childIndex):nO(d,l),1===l.replay.pendingTasks&&0<l.replay.nodes.length)throw Error(BT(488));l.replay.pendingTasks--,l.abortSet.delete(l),mO(d,l.blockedBoundary,null)}catch(_){mR();var p=_===VI?YI():_;if("object"==typeof p&&null!==p&&"function"==typeof p.then){var h=l.ping;p.then(h,h),l.thenableState=fR()}else{l.replay.pendingTasks--,l.abortSet.delete(l);var f=YR(l.componentStack);c=void 0;var m=d,g=l.blockedBoundary,y=12===d.status?d.fatalError:p;cO(m,g,l.replay.nodes,l.replay.slots,y,c=KR(m,y,f)),d.pendingRootTasks--,0===d.pendingRootTasks&&pO(d),d.allPendingTasks--,0===d.allPendingTasks&&hO(d)}}}}else if(d=void 0,0===(m=u).status){m.status=6,jI(l.context);var b=m.children.length,v=m.chunks.length;try{nO(c,l),m.lastPushedText&&m.textEmbedded&&m.chunks.push(aA),l.abortSet.delete(l),m.status=1,mO(c,l.blockedBoundary,m)}catch(_){mR(),m.children.length=b,m.chunks.length=v;var k=_===VI?YI():12===c.status?c.fatalError:_;if("object"==typeof k&&null!==k&&"function"==typeof k.then){m.status=0,l.thenableState=fR();var w=l.ping;k.then(w,w)}else{var x=YR(l.componentStack);l.abortSet.delete(l),m.status=4;var E=l.blockedBoundary;d=KR(c,k,x),null===E?XR(c,k):(E.pendingTasks--,4!==E.status&&(E.status=4,E.errorDigest=d,aO(c,E),E.parentFlushed&&c.clientRenderedBoundaries.push(E))),c.allPendingTasks--,0===c.allPendingTasks&&hO(c)}}}}s.splice(0,i),null!==e.destination&&xO(e,e.destination)}catch(S){KR(e,S,{}),XR(e,S)}finally{NR=o,MC.H=n,MC.A=r,n===TR&&jI(t),HR=a}}}function yO(e,t,n,r){switch(n.parentFlushed=!0,n.status){case 0:n.id=e.nextSegmentId++;case 5:return r=n.id,n.lastPushedText=!1,n.textEmbedded=!1,e=e.renderState,mC(t,YA),mC(t,e.placeholderPrefix),mC(t,e=vC(r.toString(16))),gC(t,KA);case 1:n.status=2;var a=!0,o=n.chunks,i=0;n=n.children;for(var s=0;s<n.length;s++){for(a=n[s];i<a.index;i++)mC(t,o[i]);a=bO(e,t,a,r)}for(;i<o.length-1;i++)mC(t,o[i]);return i<o.length&&(a=gC(t,o[i])),a;default:throw Error(BT(390))}}function bO(e,t,n,r){var a=n.boundary;if(null===a)return yO(e,t,n,r);if(a.parentFlushed=!0,4===a.status)a=a.errorDigest,gC(t,JA),mC(t,tN),a&&(mC(t,rN),mC(t,vC(RC(a))),mC(t,nN)),gC(t,aN),yO(e,t,n,r);else if(1!==a.status)0===a.status&&(a.rootSegmentID=e.nextSegmentId++),0<a.completedSegments.length&&e.partialBoundaries.push(a),oN(t,e.renderState,a.rootSegmentID),r&&((a=a.fallbackState).styles.forEach(TI,r),a.stylesheets.forEach(CI,r)),yO(e,t,n,r);else if(a.byteSize>e.progressiveChunkSize)a.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(a),oN(t,e.renderState,a.rootSegmentID),yO(e,t,n,r);else{if(r&&((n=a.contentState).styles.forEach(TI,r),n.stylesheets.forEach(CI,r)),gC(t,XA),1!==(n=a.completedSegments).length)throw Error(BT(391));bO(e,t,n[0],r)}return gC(t,eN)}function vO(e,t,n,r){return function(e,t,n,r){switch(n.insertionMode){case 0:case 1:case 2:return mC(e,iN),mC(e,t.segmentPrefix),mC(e,vC(r.toString(16))),gC(e,sN);case 3:return mC(e,cN),mC(e,t.segmentPrefix),mC(e,vC(r.toString(16))),gC(e,uN);case 4:return mC(e,pN),mC(e,t.segmentPrefix),mC(e,vC(r.toString(16))),gC(e,hN);case 5:return mC(e,mN),mC(e,t.segmentPrefix),mC(e,vC(r.toString(16))),gC(e,gN);case 6:return mC(e,bN),mC(e,t.segmentPrefix),mC(e,vC(r.toString(16))),gC(e,vN);case 7:return mC(e,wN),mC(e,t.segmentPrefix),mC(e,vC(r.toString(16))),gC(e,xN);case 8:return mC(e,_N),mC(e,t.segmentPrefix),mC(e,vC(r.toString(16))),gC(e,SN);default:throw Error(BT(397))}}(t,e.renderState,n.parentFormatContext,n.id),bO(e,t,n,r),function(e,t){switch(t.insertionMode){case 0:case 1:case 2:return gC(e,lN);case 3:return gC(e,dN);case 4:return gC(e,fN);case 5:return gC(e,yN);case 6:return gC(e,kN);case 7:return gC(e,EN);case 8:return gC(e,TN);default:throw Error(BT(397))}}(t,n.parentFormatContext)}function kO(e,t,n){for(var r=n.completedSegments,a=0;a<r.length;a++)wO(e,t,n,r[a]);r.length=0,nI(t,n.contentState,e.renderState),r=e.resumableState,e=e.renderState,a=n.rootSegmentID,n=n.contentState;var o=e.stylesToHoist;return e.stylesToHoist=!1,mC(t,e.startInlineScript),o?2&r.instructions?8&r.instructions?mC(t,DN):(r.instructions|=8,mC(t,LN)):(r.instructions|=10,mC(t,PN)):2&r.instructions?mC(t,ON):(r.instructions|=2,mC(t,RN)),r=vC(a.toString(16)),mC(t,e.boundaryPrefix),mC(t,r),mC(t,MN),mC(t,e.segmentPrefix),mC(t,r),o?(mC(t,FN),function(e,t){mC(e,fI);var n=fI;t.stylesheets.forEach((function(t){if(2!==t.state)if(3===t.state)mC(e,n),mC(e,vC(WN(""+t.props.href))),mC(e,yI),n=mI;else{mC(e,n);var r=t.props["data-precedence"],a=t.props,o=DC(""+t.props.href);for(var i in mC(e,vC(WN(o))),r=""+r,mC(e,gI),mC(e,vC(WN(r))),a)if(EC.call(a,i)&&null!=(r=a[i]))switch(i){case"href":case"rel":case"precedence":case"data-precedence":break;case"children":case"dangerouslySetInnerHTML":throw Error(BT(399,"link"));default:bI(e,i,r)}mC(e,yI),n=mI,t.state=3}})),mC(e,yI)}(t,n)):mC(t,jN),n=gC(t,BN),WA(t,e)&&n}function wO(e,t,n,r){if(2===r.status)return!0;var a=n.contentState,o=r.id;if(-1===o){if(-1===(r.id=n.rootSegmentID))throw Error(BT(392));return vO(e,t,r,a)}return o===n.rootSegmentID?vO(e,t,r,a):(vO(e,t,r,a),n=e.resumableState,mC(t,(e=e.renderState).startInlineScript),1&n.instructions?mC(t,AN):(n.instructions|=1,mC(t,CN)),mC(t,e.segmentPrefix),mC(t,o=vC(o.toString(16))),mC(t,NN),mC(t,e.placeholderPrefix),mC(t,o),t=gC(t,IN))}function xO(e,t){hC=new Uint8Array(2048),fC=0;try{if(!(0<e.pendingRootTasks)){var n,r=e.completedRootSegment;if(null!==r){if(5===r.status)return;var a,o=e.renderState,i=o.htmlChunks,s=o.headChunks;if(i){for(a=0;a<i.length;a++)mC(t,i[a]);if(s)for(a=0;a<s.length;a++)mC(t,s[a]);else mC(t,UA("head")),mC(t,_A)}else if(s)for(a=0;a<s.length;a++)mC(t,s[a]);var l=o.charsetChunks;for(a=0;a<l.length;a++)mC(t,l[a]);l.length=0,o.preconnects.forEach(rI,t),o.preconnects.clear();var c=o.viewportChunks;for(a=0;a<c.length;a++)mC(t,c[a]);c.length=0,o.fontPreloads.forEach(rI,t),o.fontPreloads.clear(),o.highImagePreloads.forEach(rI,t),o.highImagePreloads.clear(),o.styles.forEach(dI,t);var u=o.importMapChunks;for(a=0;a<u.length;a++)mC(t,u[a]);u.length=0,o.bootstrapScripts.forEach(rI,t),o.scripts.forEach(rI,t),o.scripts.clear(),o.bulkPreloads.forEach(rI,t),o.bulkPreloads.clear();var d=o.hoistableChunks;for(a=0;a<d.length;a++)mC(t,d[a]);d.length=0,i&&null===s&&mC(t,qA("head")),bO(e,t,r,null),e.completedRootSegment=null,WA(t,e.renderState)}var p=e.renderState;r=0;var h=p.viewportChunks;for(r=0;r<h.length;r++)mC(t,h[r]);h.length=0,p.preconnects.forEach(rI,t),p.preconnects.clear(),p.fontPreloads.forEach(rI,t),p.fontPreloads.clear(),p.highImagePreloads.forEach(rI,t),p.highImagePreloads.clear(),p.styles.forEach(hI,t),p.scripts.forEach(rI,t),p.scripts.clear(),p.bulkPreloads.forEach(rI,t),p.bulkPreloads.clear();var f=p.hoistableChunks;for(r=0;r<f.length;r++)mC(t,f[r]);f.length=0;var m=e.clientRenderedBoundaries;for(n=0;n<m.length;n++){var g=m[n];p=t;var y=e.resumableState,b=e.renderState,v=g.rootSegmentID,k=g.errorDigest;mC(p,b.startInlineScript),4&y.instructions?mC(p,HN):(y.instructions|=4,mC(p,zN)),mC(p,b.boundaryPrefix),mC(p,vC(v.toString(16))),mC(p,UN),k&&(mC(p,$N),mC(p,vC((A=k||"",JSON.stringify(A).replace(VN,(function(e){switch(e){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}))))));var w=gC(p,GN);if(!w)return e.destination=null,n++,void m.splice(0,n)}m.splice(0,n);var x=e.completedBoundaries;for(n=0;n<x.length;n++)if(!kO(e,t,x[n]))return e.destination=null,n++,void x.splice(0,n);x.splice(0,n),yC(t),hC=new Uint8Array(2048),fC=0;var E=e.partialBoundaries;for(n=0;n<E.length;n++){var _=E[n];e:{m=e,g=t;var S=_.completedSegments;for(w=0;w<S.length;w++)if(!wO(m,g,_,S[w])){w++,S.splice(0,w);var T=!1;break e}S.splice(0,w),T=nI(g,_.contentState,m.renderState)}if(!T)return e.destination=null,n++,void E.splice(0,n)}E.splice(0,n);var C=e.completedBoundaries;for(n=0;n<C.length;n++)if(!kO(e,t,C[n]))return e.destination=null,n++,void C.splice(0,n);C.splice(0,n)}}finally{0===e.allPendingTasks&&0===e.pingedTasks.length&&0===e.clientRenderedBoundaries.length&&0===e.completedBoundaries.length?(e.flushScheduled=!1,(n=e.resumableState).hasBody&&mC(t,qA("body")),n.hasHtml&&mC(t,qA("html")),yC(t),e.status=14,t.close(),e.destination=null):yC(t)}var A}function EO(e){e.flushScheduled=null!==e.destination,pC((function(){return gO(e)})),cC((function(){10===e.status&&(e.status=11),null===e.trackedPostpones&&dO(e,0===e.pendingRootTasks)}))}function _O(e){!1===e.flushScheduled&&0===e.pingedTasks.length&&null!==e.destination&&(e.flushScheduled=!0,cC((function(){var t=e.destination;t?xO(e,t):e.flushScheduled=!1})))}function SO(e,t){if(13===e.status)e.status=14,wC(t,e.fatalError);else if(14!==e.status&&null===e.destination){e.destination=t;try{xO(e,t)}catch(n){KR(e,n,{}),XR(e,n)}}}function TO(e,t){11!==e.status&&10!==e.status||(e.status=12);try{var n=e.abortableTasks;if(0<n.size){var r=void 0===t?Error(BT(432)):"object"==typeof t&&null!==t&&"function"==typeof t.then?Error(BT(530)):t;e.fatalError=r,n.forEach((function(t){return uO(t,e,r)})),n.clear()}null!==e.destination&&xO(e,e.destination)}catch(a){KR(e,a,{}),XR(e,a)}}function CO(){var e=FT.version;if("19.0.0"!==e)throw Error(BT(527,e,"19.0.0"))}CO(),CO(),MT.prerender=function(e,t){return new Promise((function(n,r){var a,o=t?t.onHeaders:void 0;o&&(a=function(e){o(new Headers(e))});var i=eA(t?t.identifierPrefix:void 0,t&&t.unstable_externalRuntimeSrc,t?t.bootstrapScriptContent:void 0,t?t.bootstrapScripts:void 0,t?t.bootstrapModules:void 0),s=function(e,t,n,r,a,o,i,s,l,c,u){return(e=jR(e,t,n,r,a,o,i,s,l,c,u,void 0)).trackedPostpones={workingMap:new Map,rootNodes:[],rootSlots:null},e}(e,i,JC(i,void 0,t?t.unstable_externalRuntimeSrc:void 0,t?t.importMap:void 0,a,t?t.maxHeadersLength:void 0),nA(t?t.namespaceURI:void 0),t?t.progressiveChunkSize:void 0,t?t.onError:void 0,(function(){var e={prelude:new ReadableStream({type:"bytes",pull:function(e){SO(s,e)},cancel:function(e){s.destination=null,TO(s,e)}},{highWaterMark:0})};n(e)}),void 0,void 0,r,t?t.onPostpone:void 0);if(t&&t.signal){var l=t.signal;if(l.aborted)TO(s,l.reason);else{var c=function(){TO(s,l.reason),l.removeEventListener("abort",c)};l.addEventListener("abort",c)}}EO(s)}))},MT.renderToReadableStream=function(e,t){return new Promise((function(n,r){var a,o,i,s=new Promise((function(e,t){o=e,a=t})),l=t?t.onHeaders:void 0;l&&(i=function(e){l(new Headers(e))});var c=eA(t?t.identifierPrefix:void 0,t&&t.unstable_externalRuntimeSrc,t?t.bootstrapScriptContent:void 0,t?t.bootstrapScripts:void 0,t?t.bootstrapModules:void 0),u=jR(e,c,JC(c,t?t.nonce:void 0,t?t.unstable_externalRuntimeSrc:void 0,t?t.importMap:void 0,i,t?t.maxHeadersLength:void 0),nA(t?t.namespaceURI:void 0),t?t.progressiveChunkSize:void 0,t?t.onError:void 0,o,(function(){var e=new ReadableStream({type:"bytes",pull:function(e){SO(u,e)},cancel:function(e){u.destination=null,TO(u,e)}},{highWaterMark:0});e.allReady=s,n(e)}),(function(e){s.catch((function(){})),r(e)}),a,t?t.onPostpone:void 0,t?t.formState:void 0);if(t&&t.signal){var d=t.signal;if(d.aborted)TO(u,d.reason);else{var p=function(){TO(u,d.reason),d.removeEventListener("abort",p)};d.addEventListener("abort",p)}}EO(u)}))},MT.version="19.0.0",zR=MT,(BR=Wx).version;var AO=BR.renderToString;function NO({children:e="",...t}){let n="";return J.isValidElement(e)?n=AO(e):"string"==typeof e&&(n=e),Gh.jsx("template",{...t,dangerouslySetInnerHTML:{__html:n}})}function IO({root:e,children:t=null}){return ue.createPortal(t,e)}function RO(e){return Z.forwardRef((({mode:t="open",delegatesFocus:n=!1,styleSheets:r=[],ssr:a=!1,children:o=null,...i},s)=>{const l=function(e){const t=Z.useRef(null==e?void 0:e.current);return Z.useEffect((()=>{e&&(e.current=t.current)}),[e]),t}(s),[c,u]=Z.useState(null),d=`node_${t}${n}`;return Z.useLayoutEffect((()=>{if(l.current)try{if("function"==typeof s&&s(l.current),a){const{shadowRoot:e}=l.current;return void u(e)}const e=l.current.attachShadow({mode:t,delegatesFocus:n});r.length>0&&(e.adoptedStyleSheets=r),u(e)}catch(e){!function({error:e,styleSheets:t,root:n}){if("NotSupportedError"!==(null==e?void 0:e.name))throw e;t.length>0&&n&&(n.adoptedStyleSheets=t)}({error:e,styleSheets:r,root:c})}}),[s,l,r]),Gh.jsx(e.tag,{ref:l,...i,children:(c||a)&&Gh.jsx(qx.Provider,{value:c,children:a?Gh.jsx(NO,{shadowroot:t,shadowrootmode:t,children:e.render({root:c,ssr:a,children:o})}):Gh.jsx(IO,{root:c,children:e.render({root:c,ssr:a,children:o})})})},d)}))}BR.renderToStaticMarkup,zR.renderToReadableStream,zR.resume&&zR.resume;const OO=new Map;const PO=function(e={},t="core",n=({children:e})=>e){return new Proxy(e,{get:function(e,r){const a=Vx.decamelize(r,{separator:"-"}),o=`${t}-${a}`;if(!OO.has(o)){const e=RO({tag:a,render:n});OO.set(o,e)}return OO.get(o)}})}();var LO=(null==globalThis?void 0:globalThis.document)?Z.useLayoutEffect:()=>{},DO=ee[" useId ".trim().toString()]||(()=>{}),MO=0;function FO(e){const[t,n]=Z.useState(DO());return LO((()=>{n((e=>e??String(MO++)))}),[e]),t?`radix-${t}`:""}const jO=Z.createContext(void 0),BO=()=>Z.useContext(jO);function zO({wrapperStyles:e={},children:t,customStyles:n,styles:r}){const[a,o]=Z.useState(null),[i,s]=Z.useState(null),l=Z.useMemo((()=>({shadowHost:a,rootElement:i})),[a,i]),c=FO(),u=PO.div;return Gh.jsxs(u,{id:`inkeep-shadow${c}`,ref:e=>{e&&o(e)},style:e,children:[Gh.jsx("style",{type:"text/css",dangerouslySetInnerHTML:{__html:`${r}`}}),n,Gh.jsx("div",{id:"inkeep-widget-root",ref:e=>{e&&s(e)},style:e,children:Gh.jsx(jO.Provider,{value:l,children:a&&i&&t})})]})}const HO=e=>BO()?e.children:Gh.jsx(zO,{...e}),UO="ChatButton",$O="CustomTrigger",GO="SearchBar",VO="EmbeddedChat",qO="EmbeddedSearch",WO="EmbeddedSearchAndChat",YO="IntelligentForm",KO="SidebarChat",XO={prefix:"ikp",aiChatSettings:{model:"inkeep-qa-expert",placeholder:"How do I get started?",aiAssistantName:void 0,shouldOpenLinksInNewTab:!0,disclaimerSettings:{isEnabled:!1,label:"Usage policy"},isShareButtonVisible:!1,isViewOnly:!1,exampleQuestionsLabel:"Example questions",exampleQuestions:[],isFirstExampleQuestionHighlighted:!0,isCopyChatButtonVisible:!1,getHelpOptions:[],workflowsHeader:"Workflows",workflows:[],toolbarButtonLabels:{clear:"Clear",share:"Share",getHelp:"Get help",stop:"Stop",copyChat:"Copy"},prompts:[]},baseSettings:Cx,searchSettings:{shouldOpenLinksInNewTab:!1,maxResults:40,defaultQuery:"",debounceTimeMs:0,tabs:["All","Publications","PDFs","GitHub","Forums","Discord","Slack","StackOverflow"],placeholder:"Search for anything...",view:"single-pane"},componentType:VO},QO=Z.createContext(XO),ZO=({children:e,value:t})=>{const n=BO(),r=(e,t,n)=>["baseSettings","searchSettings","aiChatSettings"].includes(n)&&!t?e:t,a={baseSettings:n??{}},o=Z.useMemo((()=>{const e=function(e,t,...n){return n.reduce(((t,n)=>c(t,n,e)),t)}(r,XO,a,t??{});return e.baseSettings.apiKey||console.warn("Inkeep API key is missing."),e}),[t]);return Gh.jsx(QO.Provider,{value:o,children:e})},JO=()=>{const e=Z.useContext(QO);if(!e)throw new Error("useInkeepConfig must be used within a ConfigProvider");return e},eP="conversationId",tP=Z.createContext(null),nP=({children:e})=>{const t=function(){const[e,t]=Z.useState(void 0),{aiChatSettings:n}=JO(),{shareChatUrlBasePath:r}=n;return Z.useEffect((()=>{if(!r||"undefined"==typeof window)return;const e=e=>e.endsWith("/")?e.slice(0,-1):e,n=()=>{const{origin:n,pathname:a,search:o}=window.location,i=new URL(r),s=e(a),l=e(i.pathname);if(n===i.origin&&s===l){const e=new URLSearchParams(o).get(eP);e&&t(e)}};n();const a=()=>n();return window.addEventListener("popstate",a),()=>{window.removeEventListener("popstate",a)}}),[r]),e}(),{aiChatSettings:n}=JO(),r=n.chatId||t,[a,o]=Z.useState(r);Z.useEffect((()=>{o(r)}),[r]);const i={id:"",messages:[]},[s,l]=Z.useState(i),c=()=>{l(i),o(void 0)},u=Z.useMemo((()=>({conversation:s,setConversation:l,chatId:a,resetConversation:c,setExternalChatId:o})),[s,a]);return Gh.jsx(tP.Provider,{value:u,children:e})},rP=()=>{const e=Z.useContext(tP);if(!e)throw new Error("useInkeepConversation must be used within an InkeepConversationProvider");return e};async function aP(e,t,n,r){try{const a=`${r}/conversations`,o={id:e||void 0,type:"openai",...t},i=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(o)});if(!i.ok){const e=await i.text();throw new Error(`Failed to log conversation: ${e}`)}return i.json()}catch(a){console.warn("Error in logConversation:",a)}}const oP="inkeepUsagePreferences",iP={defaultView:null,inkeepChatSessionId:null},sP={hasSwitchModeButtonJiggled:!1,userId:null,...iP},lP={set(e,t,n,r=365){try{if("cookie"===e){const e=new Date;void 0===n?(e.setTime(e.getTime()-1),document.cookie=`${oP}_${t}=; expires=${e.toUTCString()}; path=/`):(e.setTime(e.getTime()+24*r*60*60*1e3),document.cookie=`${oP}_${t}=${n}; expires=${e.toUTCString()}; path=/`)}else"undefined"!=typeof sessionStorage&&sessionStorage.setItem(`${oP}_${t}`,n?JSON.stringify(n):"")}catch(a){return null}},get(e,t){if("cookie"===e){const e=`${oP}_${t}=`,n=document.cookie.split(";");for(const t of n){const n=t.trim();if(n.startsWith(e))return n.substring(e.length)}return null}try{if("undefined"!=typeof sessionStorage){const e=sessionStorage.getItem(`${oP}_${t}`);return e?JSON.parse(e):null}}catch(n){return null}return null}},cP=()=>{const e=(()=>{try{if("undefined"==typeof localStorage)return!1;const e="__df709c5b-6651-43dc-94e7-d8dc899bf4e8__";return localStorage.setItem(e,"test_value"),localStorage.removeItem(e),!0}catch{return!1}})(),t=(()=>{if("undefined"==typeof document)return!1;document.cookie="testcookie=true; Path=/; Max-Age=1000";const e=document.cookie.includes("testcookie=true");return document.cookie="testcookie=; Path=/; Max-Age=-1000",e})();return e&&t},uP=Z.createContext(void 0),dP=({children:e})=>{const{baseSettings:{userProperties:t,privacyPreferences:n}}=JO(),{optOutAllAnalytics:r,optOutAnalyticalCookies:a}=n,{browserStorage:o,setBrowserStorage:i}=(()=>{const{baseSettings:e,componentType:t}=JO(),{optOutAllAnalytics:n,optOutFunctionalCookies:r}=e.privacyPreferences,a=n||r||!cP()?"sessionStorage":"cookie",o=`${e.apiKey}-${t}`,i=e=>e in iP?`${e}-${o}`:e,s=Object.keys(sP).reduce(((e,t)=>{const n=i(t),r=lP.get(a,n);return{...e,[t]:r}}),{...sP}),[l,c]=Z.useState(s);return Z.useEffect((()=>{if(r)for(const e of Object.keys(sP)){const t=i(e);lP.set("cookie",t,null,-1)}}),[r]),{browserStorage:l,setBrowserStorage:(e,t,n=365)=>{const r=i(e);lP.set(a,r,t,n),c((n=>({...n,[e]:t})))}}})(),s=Z.useMemo((()=>cP()),[]),l=Z.useMemo((()=>!r&&!a&&s),[r,a,s]),c=Z.useMemo((()=>{const e=r?"ANONYMOUS":t.id?"ID_PROVIDED":l?"COOKIED":"ANONYMOUS",n=r?void 0:t.id||l&&o.userId||Kh();return{identificationType:e,...r?{}:t,id:n}}),[t,r,l,o.userId]);return Z.useEffect((()=>{i("userId",l?c.id:void 0)}),[l,c.id]),Gh.jsx(uP.Provider,{value:{userProperties:c},children:e})},pP=()=>{const e=Z.useContext(uP);if(!e)throw new Error("useUser must be used within a UserProvider");return e};const hP=Z.createContext(void 0),fP=({children:e})=>{const{baseSettings:t,componentType:n}=JO(),{apiKey:r,analyticsApiBaseUrl:a,tags:o,privacyPreferences:i,env:s,analyticsProperties:l}=t,{userProperties:c}=pP(),u=Z.useMemo((()=>({widgetLibraryVersion:"0.5.91",componentType:n,tags:o})),[n,o]),d=!i.optOutAllAnalytics&&"development"!==s,p={logEvent:Z.useCallback((async e=>{var n,o;const i={...u,...e.properties,...l},s={eventName:e.eventName,properties:i,userProperties:c},p=["modal_opened","modal_closed"].includes(e.eventName);if(d&&!p){if("conversation"in i&&!(null==(n=i.conversation)?void 0:n.id))return;!async function(e,t,n){try{const r=`${n}/events`,a={...e,type:e.eventName};if("searchQuery"in e.properties)a.entityType="search",a.searchQuery=e.properties.searchQuery;else if("messageId"in e.properties)a.entityType="message",a.messageId=e.properties.messageId;else{if(a.entityType="conversation",!e.properties.conversation)return;a.conversationId=e.properties.conversation.id}const o=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(a)});if(!o.ok){const e=await o.text();throw new Error(`Failed to log event: ${e}`)}}catch(r){console.warn("Error in logEvent:",r)}}(s,r,a)}null==(o=t.onEvent)||o.call(t,s)}),[d,t,r,a,c,u,l])};return Gh.jsx(hP.Provider,{value:p,children:e})},mP=()=>{const e=Z.useContext(hP);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e},gP=Z.createContext(void 0),yP=({children:e})=>{const{baseSettings:t}=JO(),{apiKey:n,analyticsApiBaseUrl:r,tags:a,privacyPreferences:{optOutAllAnalytics:o},env:i,analyticsProperties:s}=t,{userProperties:l}=pP(),{logEvent:c}=mP(),{conversation:u,setConversation:d,chatId:p,setExternalChatId:h}=rP(),f=Z.useRef(u),m=Z.useRef(p);Z.useEffect((()=>{f.current=u}),[u]),Z.useEffect((()=>{m.current=p}),[p]);const g=Z.useCallback((async e=>{const t=f.current;m.current&&(t.id="",h(void 0),m.current=void 0);const c=!o&&"development"!==i;let u=Object.assign({},t,{messages:e});if(c){const o=await aP(t.id,{messages:e,tags:a,userProperties:l,properties:s},n,r);o&&(u=o)}else u.id="conv_"+Kh(16);return u}),[r,n,a,l,o,i,s,h]),y={logEvent:Z.useCallback((async(e,t)=>{let n=f.current;t&&(n=await g(t),d(n),f.current=n);const r={...e,properties:{conversation:n,...e.properties}};c(r)}),[c,g,o,i,s]),logConversation:g};return Gh.jsx(gP.Provider,{value:y,children:e})},bP=()=>{const e=Z.useContext(gP);if(!e)throw new Error("useChatEvents must be used within a ChatEventsProvider");return e};function vP(e){const{displayName:t,goals:n,informationToCollect:r,guidance:a,botPersona:o,context:i}=e,s=xP({title:"Guidance",content:[kP(a)],note:o,depth:2}),l=wP(null==r?void 0:r.filter((e=>e.required)).map((e=>e.description))),c=wP(null==r?void 0:r.filter((e=>!e.required)).map((e=>e.description))),u=xP({title:"Required",content:[l],note:"IMPORTANT: This information is REQUIRED for this workflow. If not provided in the conversation, prompt the user to provide it and don't otherwise answer their question.",depth:3}),d=xP({title:"Optional",content:[c],depth:3}),p=xP({title:"Information to collect",content:[u,d],note:"This is information that should be collected from the user.",depth:2}),h=xP({title:"Context",content:[wP(i)],depth:2}),f=xP({title:"Workflow Name",content:[t],depth:2}),m=xP({title:"Goals",content:[kP(n)],depth:2});return xP({title:"Workflow",content:["I am a user being guided through a “workflow” defined by the organization that provides this chat experience.","**IMPORTANT: Follow the instructions outlined in this workflow. Follow the instructions in the workflow configuration below. Do not answer questions unrelated to the workflow.**",f,m,h,p,s],depth:1})}function kP(e){if(CP(e))return e.filter((e=>null!=e)).map(((e,t)=>`${t+1}. ${e}`)).join("\n")}function wP(e){if(CP(e))return e.filter((e=>null!=e)).map((e=>`- ${e}`)).join("\n")}function xP({title:e,content:t,note:n,depth:r=2}){const a=TP(t);if(!a&&!n)return;const o=`${"#".repeat(r)} ${e}\n`,i=TP([n,a]);return i?`${o}${i}\n`:void 0}function EP(e){if(!e)return;if(!CP(e))return;const t=e.map(((e,t)=>function({attachment:e,index:t}){const{title:n,content:r,contentType:a,context:o}=e,{contentInputLabel:i,type:s}=a,l=function(e){if("CODE"===(null==e?void 0:e.type))return e.language||"";return}(a),c=function(e,t){return t?`\`\`\`${t}\n${e}\n\`\`\``:e}(r,l),u=CP(o)?["\nAdditional Context:",TP(o)]:[],d=[`#### ATTACHMENT #${t+1}`,`Title: ${n}`,`Label: ${i}`,`Type: ${s}`,"Content:",c,...u].join("\n");return d}({attachment:e,index:t})));return TP(t)}function _P(e){return xP({title:"User-provided Attachments",content:["The user has provided the following attachments to their message:",EP(e)],depth:1})}function SP(e){if(!e.supportedInputs)return e;const t={...e};return t.supportedInputs=e.supportedInputs.map((e=>{const t={...e};return"MODAL"===t.type&&(t.workflowModalProps=void 0),t})),t}function TP(e){if(CP(e))return e.filter((e=>null!=e)).join("\n")}function CP(e){return Array.isArray(e)&&e.length>0}const AP=()=>{const e="undefined"==typeof window?new URL(""):new URL(window.location.href),t=new URLSearchParams(e.search);if(t.has(eP)){t.delete(eP);const n=t.toString(),r=n?`${e.origin}${e.pathname}?${n}`:`${e.origin}${e.pathname}`;"undefined"!=typeof window&&window.history.pushState({},"",r)}};var NP=e=>"checkbox"===e.type,IP=e=>e instanceof Date,RP=e=>null==e;const OP=e=>"object"==typeof e;var PP=e=>!RP(e)&&!Array.isArray(e)&&OP(e)&&!IP(e),LP=e=>PP(e)&&e.target?NP(e.target)?e.target.checked:e.target.value:e,DP=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),MP="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function FP(e){let t;const n=Array.isArray(e),r="undefined"!=typeof FileList&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(MP&&(e instanceof Blob||r)||!n&&!PP(e))return e;if(t=n?[]:{},n||(e=>{const t=e.constructor&&e.constructor.prototype;return PP(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const n in e)e.hasOwnProperty(n)&&(t[n]=FP(e[n]));else t=e}return t}var jP=e=>Array.isArray(e)?e.filter(Boolean):[],BP=e=>void 0===e,zP=(e,t,n)=>{if(!t||!PP(e))return n;const r=jP(t.split(/[,[\].]+?/)).reduce(((e,t)=>RP(e)?e:e[t]),e);return BP(r)||r===e?BP(e[t])?n:e[t]:r},HP=e=>"boolean"==typeof e,UP=e=>/^\w*$/.test(e),$P=e=>jP(e.replace(/["|']|\]/g,"").split(/\.|\[/)),GP=(e,t,n)=>{let r=-1;const a=UP(t)?[t]:$P(t),o=a.length,i=o-1;for(;++r<o;){const t=a[r];let o=n;if(r!==i){const n=e[t];o=PP(n)||Array.isArray(n)?n:isNaN(+a[r+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=o,e=e[t]}return e};const VP="blur",qP="focusout",WP="change",YP="onBlur",KP="onChange",XP="onSubmit",QP="onTouched",ZP="all",JP="max",eL="min",tL="maxLength",nL="minLength",rL="pattern",aL="required",oL="validate",iL=J.createContext(null),sL=()=>J.useContext(iL);var lL=(e,t,n,r=!0)=>{const a={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(a,o,{get:()=>{const a=o;return t._proxyFormState[a]!==ZP&&(t._proxyFormState[a]=!r||ZP),n&&(n[a]=!0),e[a]}});return a},cL=e=>PP(e)&&!Object.keys(e).length,uL=(e,t,n,r)=>{n(e);const{name:a,...o}=e;return cL(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find((e=>t[e]===(!r||ZP)))},dL=e=>Array.isArray(e)?e:[e],pL=(e,t,n)=>!e||!t||e===t||dL(e).some((e=>e&&(n?e===t:e.startsWith(t)||t.startsWith(e))));function hL(e){const t=J.useRef(e);t.current=e,J.useEffect((()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}}),[e.disabled])}var fL=e=>"string"==typeof e,mL=(e,t,n,r,a)=>fL(e)?(r&&t.watch.add(e),zP(n,e,a)):Array.isArray(e)?e.map((e=>(r&&t.watch.add(e),zP(n,e)))):(r&&(t.watchAll=!0),n);function gL(e){const t=sL(),{name:n,disabled:r,control:a=t.control,shouldUnregister:o}=e,i=DP(a._names.array,n),s=function(e){const t=sL(),{control:n=t.control,name:r,defaultValue:a,disabled:o,exact:i}=e||{},s=J.useRef(r);s.current=r,hL({disabled:o,subject:n._subjects.values,next:e=>{pL(s.current,e.name,i)&&c(FP(mL(s.current,n._names,e.values||n._formValues,!1,a)))}});const[l,c]=J.useState(n._getWatch(r,a));return J.useEffect((()=>n._removeUnmounted())),l}({control:a,name:n,defaultValue:zP(a._formValues,n,zP(a._defaultValues,n,e.defaultValue)),exact:!0}),l=function(e){const t=sL(),{control:n=t.control,disabled:r,name:a,exact:o}=e||{},[i,s]=J.useState(n._formState),l=J.useRef(!0),c=J.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=J.useRef(a);return u.current=a,hL({disabled:r,next:e=>l.current&&pL(u.current,e.name,o)&&uL(e,c.current,n._updateFormState)&&s({...n._formState,...e}),subject:n._subjects.state}),J.useEffect((()=>(l.current=!0,c.current.isValid&&n._updateValid(!0),()=>{l.current=!1})),[n]),J.useMemo((()=>lL(i,n,c.current,!1)),[i,n])}({control:a,name:n,exact:!0}),c=J.useRef(a.register(n,{...e.rules,value:s,...HP(e.disabled)?{disabled:e.disabled}:{}})),u=J.useMemo((()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!zP(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!zP(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!zP(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!zP(l.validatingFields,n)},error:{enumerable:!0,get:()=>zP(l.errors,n)}})),[l,n]),d=J.useMemo((()=>({name:n,value:s,...HP(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:e=>c.current.onChange({target:{value:LP(e),name:n},type:WP}),onBlur:()=>c.current.onBlur({target:{value:zP(a._formValues,n),name:n},type:VP}),ref:e=>{const t=zP(a._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}})),[n,a._formValues,r,l.disabled,s,a._fields]);return J.useEffect((()=>{const e=a._options.shouldUnregister||o,t=(e,t)=>{const n=zP(a._fields,e);n&&n._f&&(n._f.mount=t)};if(t(n,!0),e){const e=FP(zP(a._options.defaultValues,n));GP(a._defaultValues,n,e),BP(zP(a._formValues,n))&&GP(a._formValues,n,e)}return!i&&a.register(n),()=>{(i?e&&!a._state.action:e)?a.unregister(n):t(n,!1)}}),[n,a,i,o]),J.useEffect((()=>{a._updateDisabledField({disabled:r,fields:a._fields,name:n})}),[r,n,a]),J.useMemo((()=>({field:d,formState:l,fieldState:u})),[d,l,u])}const yL=e=>e.render(gL(e));var bL=(e,t,n,r,a)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:a||!0}}:{},vL=e=>({isOnSubmit:!e||e===XP,isOnBlur:e===YP,isOnChange:e===KP,isOnAll:e===ZP,isOnTouch:e===QP}),kL=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))));const wL=(e,t,n,r)=>{for(const a of n||Object.keys(e)){const n=zP(e,a);if(n){const{_f:e,...o}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],a)&&!r)return!0;if(e.ref&&t(e.ref,e.name)&&!r)return!0;if(wL(o,t))break}else if(PP(o)&&wL(o,t))break}}};var xL=(e,t,n)=>{const r=dL(zP(e,n));return GP(r,"root",t[n]),GP(e,n,r),e},EL=e=>"file"===e.type,_L=e=>"function"==typeof e,SL=e=>{if(!MP)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},TL=e=>fL(e),CL=e=>"radio"===e.type,AL=e=>e instanceof RegExp;const NL={value:!1,isValid:!1},IL={value:!0,isValid:!0};var RL=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!BP(e[0].attributes.value)?BP(e[0].value)||""===e[0].value?IL:{value:e[0].value,isValid:!0}:IL:NL}return NL};const OL={isValid:!1,value:null};var PL=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),OL):OL;function LL(e,t,n="validate"){if(TL(e)||Array.isArray(e)&&e.every(TL)||HP(e)&&!e)return{type:n,message:TL(e)?e:"",ref:t}}var DL=e=>PP(e)&&!AL(e)?e:{value:e,message:""},ML=async(e,t,n,r,a,o)=>{const{ref:i,refs:s,required:l,maxLength:c,minLength:u,min:d,max:p,pattern:h,validate:f,name:m,valueAsNumber:g,mount:y}=e._f,b=zP(n,m);if(!y||t.has(m))return{};const v=s?s[0]:i,k=e=>{a&&v.reportValidity&&(v.setCustomValidity(HP(e)?"":e||""),v.reportValidity())},w={},x=CL(i),E=NP(i),_=x||E,S=(g||EL(i))&&BP(i.value)&&BP(b)||SL(i)&&""===i.value||""===b||Array.isArray(b)&&!b.length,T=bL.bind(null,m,r,w),C=(e,t,n,r=tL,a=nL)=>{const o=e?t:n;w[m]={type:e?r:a,message:o,ref:i,...T(e?r:a,o)}};if(o?!Array.isArray(b)||!b.length:l&&(!_&&(S||RP(b))||HP(b)&&!b||E&&!RL(s).isValid||x&&!PL(s).isValid)){const{value:e,message:t}=TL(l)?{value:!!l,message:l}:DL(l);if(e&&(w[m]={type:aL,message:t,ref:v,...T(aL,t)},!r))return k(t),w}if(!(S||RP(d)&&RP(p))){let e,t;const n=DL(p),a=DL(d);if(RP(b)||isNaN(b)){const r=i.valueAsDate||new Date(b),o=e=>new Date((new Date).toDateString()+" "+e),s="time"==i.type,l="week"==i.type;fL(n.value)&&b&&(e=s?o(b)>o(n.value):l?b>n.value:r>new Date(n.value)),fL(a.value)&&b&&(t=s?o(b)<o(a.value):l?b<a.value:r<new Date(a.value))}else{const r=i.valueAsNumber||(b?+b:b);RP(n.value)||(e=r>n.value),RP(a.value)||(t=r<a.value)}if((e||t)&&(C(!!e,n.message,a.message,JP,eL),!r))return k(w[m].message),w}if((c||u)&&!S&&(fL(b)||o&&Array.isArray(b))){const e=DL(c),t=DL(u),n=!RP(e.value)&&b.length>+e.value,a=!RP(t.value)&&b.length<+t.value;if((n||a)&&(C(n,e.message,t.message),!r))return k(w[m].message),w}if(h&&!S&&fL(b)){const{value:e,message:t}=DL(h);if(AL(e)&&!b.match(e)&&(w[m]={type:rL,message:t,ref:i,...T(rL,t)},!r))return k(t),w}if(f)if(_L(f)){const e=LL(await f(b,n),v);if(e&&(w[m]={...e,...T(oL,e.message)},!r))return k(e.message),w}else if(PP(f)){let e={};for(const t in f){if(!cL(e)&&!r)break;const a=LL(await f[t](b,n),v,t);a&&(e={...a,...T(t,a.message)},k(a.message),r&&(w[m]=e))}if(!cL(e)&&(w[m]={ref:v,...e},!r))return w}return k(!0),w};function FL(e,t){const n=Array.isArray(t)?t:UP(t)?[t]:$P(t),r=1===n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=BP(e)?r++:e[t[r++]];return e}(e,n),a=n.length-1,o=n[a];return r&&delete r[o],0!==a&&(PP(r)&&cL(r)||Array.isArray(r)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!BP(e[t]))return!1;return!0}(r))&&FL(e,n.slice(0,-1)),e}var jL=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}},BL=e=>RP(e)||!OP(e);function zL(e,t){if(BL(e)||BL(t))return e===t;if(IP(e)&&IP(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const a of n){const n=e[a];if(!r.includes(a))return!1;if("ref"!==a){const e=t[a];if(IP(n)&&IP(e)||PP(n)&&PP(e)||Array.isArray(n)&&Array.isArray(e)?!zL(n,e):n!==e)return!1}}return!0}var HL=e=>"select-multiple"===e.type,UL=e=>SL(e)&&e.isConnected,$L=e=>{for(const t in e)if(_L(e[t]))return!0;return!1};function GL(e,t={}){const n=Array.isArray(e);if(PP(e)||n)for(const r in e)Array.isArray(e[r])||PP(e[r])&&!$L(e[r])?(t[r]=Array.isArray(e[r])?[]:{},GL(e[r],t[r])):RP(e[r])||(t[r]=!0);return t}function VL(e,t,n){const r=Array.isArray(e);if(PP(e)||r)for(const a in e)Array.isArray(e[a])||PP(e[a])&&!$L(e[a])?BP(t)||BL(n[a])?n[a]=Array.isArray(e[a])?GL(e[a],[]):{...GL(e[a])}:VL(e[a],RP(t)?{}:t[a],n[a]):n[a]=!zL(e[a],t[a]);return n}var qL=(e,t)=>VL(e,t,GL(t)),WL=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>BP(e)?e:t?""===e?NaN:e?+e:e:n&&fL(e)?new Date(e):r?r(e):e;function YL(e){const t=e.ref;return EL(t)?t.files:CL(t)?PL(e.refs).value:HL(t)?[...t.selectedOptions].map((({value:e})=>e)):NP(t)?RL(e.refs).value:WL(BP(t.value)?e.ref.value:t.value,e)}var KL=e=>BP(e)?e:AL(e)?e.source:PP(e)?AL(e.value)?e.value.source:e.value:e;const XL="AsyncFunction";function QL(e,t,n){const r=zP(e,n);if(r||UP(n))return{error:r,name:n};const a=n.split(".");for(;a.length;){const r=a.join("."),o=zP(t,r),i=zP(e,r);if(o&&!Array.isArray(o)&&n!==r)return{name:n};if(i&&i.type)return{name:r,error:i};a.pop()}return{name:n}}const ZL={mode:XP,reValidateMode:KP,shouldFocusError:!0};function JL(e={}){let t,n={...ZL,...e},r={submitCount:0,isDirty:!1,isLoading:_L(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1},a={},o=(PP(n.defaultValues)||PP(n.values))&&FP(n.defaultValues||n.values)||{},i=n.shouldUnregister?{}:FP(o),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:jL(),array:jL(),state:jL()},p=vL(n.mode),h=vL(n.reValidateMode),f=n.criteriaMode===ZP,m=async e=>{if(!n.disabled&&(u.isValid||e)){const e=n.resolver?cL((await k()).errors):await w(a,!0);e!==r.isValid&&d.state.next({isValid:e})}},g=(e,t)=>{n.disabled||!u.isValidating&&!u.validatingFields||((e||Array.from(l.mount)).forEach((e=>{e&&(t?GP(r.validatingFields,e,t):FL(r.validatingFields,e))})),d.state.next({validatingFields:r.validatingFields,isValidating:!cL(r.validatingFields)}))},y=(e,t,n,r)=>{const l=zP(a,e);if(l){const a=zP(i,e,BP(n)?zP(o,e):n);BP(a)||r&&r.defaultChecked||t?GP(i,e,t?a:YL(l._f)):_(e,a),s.mount&&m()}},b=(e,t,i,s,l)=>{let c=!1,p=!1;const h={name:e};if(!n.disabled){const n=!!(zP(a,e)&&zP(a,e)._f&&zP(a,e)._f.disabled);if(!i||s){u.isDirty&&(p=r.isDirty,r.isDirty=h.isDirty=x(),c=p!==h.isDirty);const a=n||zL(zP(o,e),t);p=!(n||!zP(r.dirtyFields,e)),a||n?FL(r.dirtyFields,e):GP(r.dirtyFields,e,!0),h.dirtyFields=r.dirtyFields,c=c||u.dirtyFields&&p!==!a}if(i){const t=zP(r.touchedFields,e);t||(GP(r.touchedFields,e,i),h.touchedFields=r.touchedFields,c=c||u.touchedFields&&t!==i)}c&&l&&d.state.next(h)}return c?h:{}},v=(e,a,o,i)=>{const s=zP(r.errors,e),l=u.isValid&&HP(a)&&r.isValid!==a;var p;if(n.delayError&&o?(p=()=>((e,t)=>{GP(r.errors,e,t),d.state.next({errors:r.errors})})(e,o),t=e=>{clearTimeout(c),c=setTimeout(p,e)},t(n.delayError)):(clearTimeout(c),t=null,o?GP(r.errors,e,o):FL(r.errors,e)),(o?!zL(s,o):s)||!cL(i)||l){const t={...i,...l&&HP(a)?{isValid:a}:{},errors:r.errors,name:e};r={...r,...t},d.state.next(t)}},k=async e=>{g(e,!0);const t=await n.resolver(i,n.context,((e,t,n,r)=>{const a={};for(const o of e){const e=zP(t,o);e&&GP(a,o,e._f)}return{criteriaMode:n,names:[...e],fields:a,shouldUseNativeValidation:r}})(e||l.mount,a,n.criteriaMode,n.shouldUseNativeValidation));return g(e),t},w=async(e,t,a={valid:!0})=>{for(const s in e){const c=e[s];if(c){const{_f:e,...d}=c;if(e){const d=l.array.has(e.name),p=c._f&&(!!(o=c._f)&&!!o.validate&&!!(_L(o.validate)&&o.validate.constructor.name===XL||PP(o.validate)&&Object.values(o.validate).find((e=>e.constructor.name===XL))));p&&u.validatingFields&&g([s],!0);const h=await ML(c,l.disabled,i,f,n.shouldUseNativeValidation&&!t,d);if(p&&u.validatingFields&&g([s]),h[e.name]&&(a.valid=!1,t))break;!t&&(zP(h,e.name)?d?xL(r.errors,h,e.name):GP(r.errors,e.name,h[e.name]):FL(r.errors,e.name))}!cL(d)&&await w(d,t,a)}}var o;return a.valid},x=(e,t)=>!n.disabled&&(e&&t&&GP(i,e,t),!zL(I(),o)),E=(e,t,n)=>mL(e,l,{...s.mount?i:BP(t)?o:fL(e)?{[e]:t}:t},n,t),_=(e,t,n={})=>{const r=zP(a,e);let o=t;if(r){const n=r._f;n&&(!n.disabled&&GP(i,e,WL(t,n)),o=SL(n.ref)&&RP(t)?"":t,HL(n.ref)?[...n.ref.options].forEach((e=>e.selected=o.includes(e.value))):n.refs?NP(n.ref)?n.refs.length>1?n.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(o)?!!o.find((t=>t===e.value)):o===e.value))):n.refs[0]&&(n.refs[0].checked=!!o):n.refs.forEach((e=>e.checked=e.value===o)):EL(n.ref)?n.ref.value="":(n.ref.value=o,n.ref.type||d.values.next({name:e,values:{...i}})))}(n.shouldDirty||n.shouldTouch)&&b(e,o,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&N(e)},S=(e,t,n)=>{for(const r in t){const o=t[r],i=`${e}.${r}`,s=zP(a,i);(l.array.has(e)||PP(o)||s&&!s._f)&&!IP(o)?S(i,o,n):_(i,o,n)}},T=(e,t,n={})=>{const c=zP(a,e),p=l.array.has(e),h=FP(t);GP(i,e,h),p?(d.array.next({name:e,values:{...i}}),(u.isDirty||u.dirtyFields)&&n.shouldDirty&&d.state.next({name:e,dirtyFields:qL(o,i),isDirty:x(e,h)})):!c||c._f||RP(h)?_(e,h,n):S(e,h,n),kL(e,l)&&d.state.next({...r}),d.values.next({name:s.mount?e:void 0,values:{...i}})},C=async e=>{s.mount=!0;const o=e.target;let c=o.name,y=!0;const x=zP(a,c),E=e=>{y=Number.isNaN(e)||IP(e)&&isNaN(e.getTime())||zL(e,zP(i,c,e))};if(x){let s,S;const T=o.type?YL(x._f):LP(e),C=e.type===VP||e.type===qP,A=!((_=x._f).mount&&(_.required||_.min||_.max||_.maxLength||_.minLength||_.pattern||_.validate)||n.resolver||zP(r.errors,c)||x._f.deps)||((e,t,n,r,a)=>!a.isOnAll&&(!n&&a.isOnTouch?!(t||e):(n?r.isOnBlur:a.isOnBlur)?!e:!(n?r.isOnChange:a.isOnChange)||e))(C,zP(r.touchedFields,c),r.isSubmitted,h,p),I=kL(c,l,C);GP(i,c,T),C?(x._f.onBlur&&x._f.onBlur(e),t&&t(0)):x._f.onChange&&x._f.onChange(e);const R=b(c,T,C,!1),O=!cL(R)||I;if(!C&&d.values.next({name:c,type:e.type,values:{...i}}),A)return u.isValid&&("onBlur"===n.mode&&C?m():C||m()),O&&d.state.next({name:c,...I?{}:R});if(!C&&I&&d.state.next({...r}),n.resolver){const{errors:e}=await k([c]);if(E(T),y){const t=QL(r.errors,a,c),n=QL(e,a,t.name||c);s=n.error,c=n.name,S=cL(e)}}else g([c],!0),s=(await ML(x,l.disabled,i,f,n.shouldUseNativeValidation))[c],g([c]),E(T),y&&(s?S=!1:u.isValid&&(S=await w(a,!0)));y&&(x._f.deps&&N(x._f.deps),v(c,S,s,R))}var _},A=(e,t)=>{if(zP(r.errors,t)&&e.focus)return e.focus(),1},N=async(e,t={})=>{let o,i;const s=dL(e);if(n.resolver){const t=await(async e=>{const{errors:t}=await k(e);if(e)for(const n of e){const e=zP(t,n);e?GP(r.errors,n,e):FL(r.errors,n)}else r.errors=t;return t})(BP(e)?e:s);o=cL(t),i=e?!s.some((e=>zP(t,e))):o}else e?(i=(await Promise.all(s.map((async e=>{const t=zP(a,e);return await w(t&&t._f?{[e]:t}:t)})))).every(Boolean),(i||r.isValid)&&m()):i=o=await w(a);return d.state.next({...!fL(e)||u.isValid&&o!==r.isValid?{}:{name:e},...n.resolver||!e?{isValid:o}:{},errors:r.errors}),t.shouldFocus&&!i&&wL(a,A,e?s:l.mount),i},I=e=>{const t={...s.mount?i:o};return BP(e)?t:fL(e)?zP(t,e):e.map((e=>zP(t,e)))},R=(e,t)=>({invalid:!!zP((t||r).errors,e),isDirty:!!zP((t||r).dirtyFields,e),error:zP((t||r).errors,e),isValidating:!!zP(r.validatingFields,e),isTouched:!!zP((t||r).touchedFields,e)}),O=(e,t,n)=>{const o=(zP(a,e,{_f:{}})._f||{}).ref,i=zP(r.errors,e)||{},{ref:s,message:l,type:c,...u}=i;GP(r.errors,e,{...u,...t,ref:o}),d.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&o&&o.focus&&o.focus()},P=(e,t={})=>{for(const s of e?dL(e):l.mount)l.mount.delete(s),l.array.delete(s),t.keepValue||(FL(a,s),FL(i,s)),!t.keepError&&FL(r.errors,s),!t.keepDirty&&FL(r.dirtyFields,s),!t.keepTouched&&FL(r.touchedFields,s),!t.keepIsValidating&&FL(r.validatingFields,s),!n.shouldUnregister&&!t.keepDefaultValue&&FL(o,s);d.values.next({values:{...i}}),d.state.next({...r,...t.keepDirty?{isDirty:x()}:{}}),!t.keepIsValid&&m()},L=({disabled:e,name:t,field:n,fields:r})=>{(HP(e)&&s.mount||e||l.disabled.has(t))&&(e?l.disabled.add(t):l.disabled.delete(t),b(t,YL(n?n._f:zP(r,t)._f),!1,!1,!0))},D=(e,t={})=>{let r=zP(a,e);const i=HP(t.disabled)||HP(n.disabled);return GP(a,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),r?L({field:r,disabled:HP(t.disabled)?t.disabled:n.disabled,name:e}):y(e,!0,t.value),{...i?{disabled:t.disabled||n.disabled}:{},...n.progressive?{required:!!t.required,min:KL(t.min),max:KL(t.max),minLength:KL(t.minLength),maxLength:KL(t.maxLength),pattern:KL(t.pattern)}:{},name:e,onChange:C,onBlur:C,ref:i=>{if(i){D(e,t),r=zP(a,e);const n=BP(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=(e=>CL(e)||NP(e))(n),l=r._f.refs||[];if(s?l.find((e=>e===n)):n===r._f.ref)return;GP(a,e,{_f:{...r._f,...s?{refs:[...l.filter(UL),n,...Array.isArray(zP(o,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),y(e,!1,void 0,n)}else r=zP(a,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!DP(l.array,e)||!s.action)&&l.unMount.add(e)}}},M=()=>n.shouldFocusError&&wL(a,A,l.mount),F=(e,t)=>async o=>{let s;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let c=FP(i);if(l.disabled.size)for(const e of l.disabled)GP(c,e,void 0);if(d.state.next({isSubmitting:!0}),n.resolver){const{errors:e,values:t}=await k();r.errors=e,c=t}else await w(a);if(FL(r.errors,"root"),cL(r.errors)){d.state.next({errors:{}});try{await e(c,o)}catch(u){s=u}}else t&&await t({...r.errors},o),M(),setTimeout(M);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:cL(r.errors)&&!s,submitCount:r.submitCount+1,errors:r.errors}),s)throw s},j=(e,t={})=>{const c=e?FP(e):o,p=FP(c),h=cL(e),f=h?o:p;if(t.keepDefaultValues||(o=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...l.mount,...Object.keys(qL(o,i))]);for(const t of Array.from(e))zP(r.dirtyFields,t)?GP(f,t,zP(i,t)):T(t,zP(f,t))}else{if(MP&&BP(e))for(const e of l.mount){const t=zP(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(SL(e)){const t=e.closest("form");if(t){t.reset();break}}}}a={}}i=n.shouldUnregister?t.keepDefaultValues?FP(o):{}:FP(f),d.array.next({values:{...f}}),d.values.next({values:{...f}})}l={mount:t.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!u.isValid||!!t.keepIsValid||!!t.keepDirtyValues,s.watch=!!n.shouldUnregister,d.state.next({submitCount:t.keepSubmitCount?r.submitCount:0,isDirty:!h&&(t.keepDirty?r.isDirty:!(!t.keepDefaultValues||zL(e,o))),isSubmitted:!!t.keepIsSubmitted&&r.isSubmitted,dirtyFields:h?{}:t.keepDirtyValues?t.keepDefaultValues&&i?qL(o,i):r.dirtyFields:t.keepDefaultValues&&e?qL(o,e):t.keepDirty?r.dirtyFields:{},touchedFields:t.keepTouched?r.touchedFields:{},errors:t.keepErrors?r.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&r.isSubmitSuccessful,isSubmitting:!1})},B=(e,t)=>j(_L(e)?e(i):e,t);return{control:{register:D,unregister:P,getFieldState:R,handleSubmit:F,setError:O,_executeSchema:k,_getWatch:E,_getDirty:x,_updateValid:m,_removeUnmounted:()=>{for(const e of l.unMount){const t=zP(a,e);t&&(t._f.refs?t._f.refs.every((e=>!UL(e))):!UL(t._f.ref))&&P(e)}l.unMount=new Set},_updateFieldArray:(e,t=[],l,c,p=!0,h=!0)=>{if(c&&l&&!n.disabled){if(s.action=!0,h&&Array.isArray(zP(a,e))){const t=l(zP(a,e),c.argA,c.argB);p&&GP(a,e,t)}if(h&&Array.isArray(zP(r.errors,e))){const t=l(zP(r.errors,e),c.argA,c.argB);p&&GP(r.errors,e,t),((e,t)=>{!jP(zP(e,t)).length&&FL(e,t)})(r.errors,e)}if(u.touchedFields&&h&&Array.isArray(zP(r.touchedFields,e))){const t=l(zP(r.touchedFields,e),c.argA,c.argB);p&&GP(r.touchedFields,e,t)}u.dirtyFields&&(r.dirtyFields=qL(o,i)),d.state.next({name:e,isDirty:x(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else GP(i,e,t)},_updateDisabledField:L,_getFieldArray:e=>jP(zP(s.mount?i:o,e,n.shouldUnregister?zP(o,e,[]):[])),_reset:j,_resetDefaultValues:()=>_L(n.defaultValues)&&n.defaultValues().then((e=>{B(e,n.resetOptions),d.state.next({isLoading:!1})})),_updateFormState:e=>{r={...r,...e}},_disableForm:e=>{HP(e)&&(d.state.next({disabled:e}),wL(a,((t,n)=>{const r=zP(a,n);r&&(t.disabled=r._f.disabled||e,Array.isArray(r._f.refs)&&r._f.refs.forEach((t=>{t.disabled=r._f.disabled||e})))}),0,!1))},_subjects:d,_proxyFormState:u,_setErrors:e=>{r.errors=e,d.state.next({errors:r.errors,isValid:!1})},get _fields(){return a},get _formValues(){return i},get _state(){return s},set _state(e){s=e},get _defaultValues(){return o},get _names(){return l},set _names(e){l=e},get _formState(){return r},set _formState(e){r=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:N,register:D,handleSubmit:F,watch:(e,t)=>_L(e)?d.values.subscribe({next:n=>e(E(void 0,t),n)}):E(e,t,!0),setValue:T,getValues:I,reset:B,resetField:(e,t={})=>{zP(a,e)&&(BP(t.defaultValue)?T(e,FP(zP(o,e))):(T(e,t.defaultValue),GP(o,e,FP(t.defaultValue))),t.keepTouched||FL(r.touchedFields,e),t.keepDirty||(FL(r.dirtyFields,e),r.isDirty=t.defaultValue?x(e,FP(zP(o,e))):x()),t.keepError||(FL(r.errors,e),u.isValid&&m()),d.state.next({...r}))},clearErrors:e=>{e&&dL(e).forEach((e=>FL(r.errors,e))),d.state.next({errors:e?r.errors:{}})},unregister:P,setError:O,setFocus:(e,t={})=>{const n=zP(a,e),r=n&&n._f;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&(e.focus(),t.shouldSelect&&_L(e.select)&&e.select())}},getFieldState:R}}function eD(e={}){const t=J.useRef(void 0),n=J.useRef(void 0),[r,a]=J.useState({isDirty:!1,isValidating:!1,isLoading:_L(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:_L(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...JL(e),formState:r});const o=t.current.control;return o._options=e,hL({subject:o._subjects.state,next:e=>{uL(e,o._proxyFormState,o._updateFormState,!0)&&a({...o._formState})}}),J.useEffect((()=>o._disableForm(e.disabled)),[o,e.disabled]),J.useEffect((()=>{if(o._proxyFormState.isDirty){const e=o._getDirty();e!==r.isDirty&&o._subjects.state.next({isDirty:e})}}),[o,r.isDirty]),J.useEffect((()=>{e.values&&!zL(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,a((e=>({...e})))):o._resetDefaultValues()}),[e.values,o]),J.useEffect((()=>{e.errors&&o._setErrors(e.errors)}),[e.errors,o]),J.useEffect((()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()})),J.useEffect((()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})}),[e.shouldUnregister,o]),t.current.formState=lL(r,o),t.current}const tD=Z.createContext(void 0),nD=({children:e,modal:t})=>Gh.jsx(tD.Provider,{value:t,children:e}),rD=()=>Z.useContext(tD),aD={text:"",email:"",checkbox:!1,textarea:"",file:void 0,select:""};function oD(e){return e?null==e?void 0:e.reduce(((e,t)=>("defaultValue"in t&&t.defaultValue?e[t.name]=t.defaultValue:t.inputType&&(e[t.name]=aD[t.inputType]),e)),{}):{}}const iD=Z.createContext(void 0);const sD=({children:e})=>{const t=function(){var e;const[t,n]=Z.useState(null),[r,a]=Z.useState(!1),{conversation:o}=rP(),i=rD(),s=()=>{var e;n(null),a(!1),"close_modal"===(null==(e=null==t?void 0:t.buttons.close)?void 0:e.action)&&(null==i||i.setOpen(!1))},l=Z.useMemo((()=>null==t?void 0:t.fields.map((e=>{const t=e;return"_type"in e&&"include_chat_session"===e._type&&(t.isRequired=!1,t.inputType="checkbox",o.id||(t.isHidden=!0)),t}))),[null==t?void 0:t.fields,o.id]),c=null==l?void 0:l.find((e=>"_type"in e&&"include_chat_session"===e._type)),u=Z.useMemo((()=>oD(l)),[l]),{control:d,handleSubmit:p,formState:{errors:h,isSubmitting:f},setError:m,reset:g}=eD({defaultValues:u});Z.useEffect((()=>{u&&g(u)}),[g,u]);const y=p((async e=>{const n=o.id&&c&&e[c.name]?o:null;try{await(null==t?void 0:t.buttons.submit.onSubmit({values:e,conversation:n})),a(!0),(null==t?void 0:t.successView)||s()}catch(r){m("root.serverError",{message:r instanceof Error?r.message:"Something went wrong."})}})),b=null==(e=null==h?void 0:h.root)?void 0:e.serverError;return{form:t,openForm:e=>{n(e)},closeForm:s,handleSubmit:y,isSuccess:r,isSubmitting:f,formError:b,fields:l,errors:h,control:d,defaultValues:u}}();return Gh.jsx(iD.Provider,{value:t,children:e})},lD=()=>{const e=Z.useContext(iD);if(!e)throw new Error("useChatForm must be used within a ChatFormProvider");return e},cD=Z.createContext(void 0),uD=({children:e,widget:t})=>Gh.jsx(cD.Provider,{value:t,children:e}),dD=()=>Z.useContext(cD),pD=e=>{const[t,n]=Z.useState(!1);return Z.useEffect((()=>{const t=window.matchMedia(e);n(t.matches);const r=e=>n(e.matches);return t.addEventListener("change",r),()=>t.removeEventListener("change",r)}),[e]),t},hD=new TextEncoder;async function fD(e,t){return n=await async function(e,t){return crypto.subtle.digest(e.toUpperCase(),"string"==typeof t?hD.encode(t):new Uint8Array(t))}(e,t),[...new Uint8Array(n)].map((e=>e.toString(16).padStart(2,"0"))).join("");var n}const mD={getSolution:async()=>{},prefetchSolution:()=>{},invalidateSolution:()=>{}},gD=async e=>{try{const t=await fetch(e,{method:"GET"});if(!t.ok)throw new Error(`Failed to fetch challenge: ${t.statusText}`);const n=await t.json(),{challenge:r,algorithm:a,salt:o,maxnumber:i}=n,{promise:s}=await function(e,t,n="SHA-256",r=1e6,a=0){const o=new AbortController,i=Date.now();return{promise:(async()=>{for(let s=a;s<=r;s+=1){if(o.signal.aborted)return null;if(await fD(n,t+s)===e)return{number:s,took:Date.now()-i}}return null})(),controller:o}}(r,o,a,i),l=await s||void 0;if(!l)throw new Error("Challenge not solved");return{number:l.number,...n}}catch(t){console.warn("Error solving captcha:",t)}},yD={type:"function",function:{name:"provideLinks",description:"Provides links",parameters:{type:"object",properties:{links:{anyOf:[{type:"array",items:{type:"object",properties:{label:{type:["string","null"]},url:{type:"string"},title:{type:["string","null"]},description:{type:["string","null"]},type:{anyOf:[{anyOf:[{type:"string",enum:["documentation","site","discourse_post","github_issue","github_discussion","stackoverflow_question","discord_forum_post","discord_message","custom_question_answer"]},{type:"string"}]},{type:"null"}]},breadcrumbs:{anyOf:[{type:"array",items:{type:"string"}},{type:"null"}]}},required:["url"],additionalProperties:!0}},{type:"null"}]},text:{type:"string"}},required:["text"],additionalProperties:!1,$schema:"http://json-schema.org/draft-07/schema#"},function:e=>e,parse:JSON.parse}},bD=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(V4){return e}return e},vD=(...e)=>(...t)=>{for(const n of e)null==n||n(...t)},kD=e=>"string"==typeof e;function wD(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").replace(/__/g,"__").toLowerCase()}const xD=e=>e?"":void 0;function ED(e){const t=e.split(" "),n=t[0]??"",r=t.length>1?t[t.length-1]:"";return n&&r?`${n.charAt(0)}${r.charAt(0)}`:n.charAt(0)}function _D(e,t){return"function"==typeof e?e(t):e}const SD=e=>"string"==typeof e.content?e.content:e.content[0].text,TD=()=>{const{chatId:e,setConversation:t,conversation:n,resetConversation:r}=rP(),{baseSettings:a,aiChatSettings:o}=JO(),{aiApiBaseUrl:i,shouldBypassCaptcha:s,filters:l}=a,c=rD(),{getSolution:u,prefetchSolution:d,invalidateSolution:p}=(({fetchUrl:e,shouldBypassCaptcha:t=!1,shouldMakeInitialRequest:n=!0})=>{if(t)return mD;const r=Z.useRef(null),a=Z.useCallback((()=>{r.current||(r.current=gD(e))}),[e]),o=Z.useCallback((async()=>{let t=await r.current;return t||(r.current=gD(e),t=await r.current),r.current=null,t}),[e]),i=Z.useCallback((()=>{r.current=null}),[]);return Z.useEffect((()=>{n&&a()}),[a,n]),{getSolution:o,prefetchSolution:a,invalidateSolution:i}})({fetchUrl:`${i}/v1/challenge`,shouldBypassCaptcha:s,shouldMakeInitialRequest:!c||c.isOpen}),h=new db({baseURL:`${i}/v1`,apiKey:a.apiKey??"",dangerouslyAllowBrowser:!0}),{onInputMessageChange:f,getTools:m,prompts:g,model:y,filters:b,onToolCall:v}=o,[k,w]=Z.useState(""),x=Z.useRef(null);Z.useEffect((()=>{null==f||f(k)}),[k]);const[E,_]=Z.useState([]),[S,T]=Z.useState(!1),[C,A]=Z.useState(!1),[N,I]=Z.useState(null),[R,O]=Z.useState(null),[P,L]=Z.useState([]),[D,M]=Z.useState({}),F=Z.useRef([]),j=Z.useRef(null),{logEvent:B}=bP(),z=null==g?void 0:g.map(((e,t)=>({id:`system-${Date.now().toString()}-${Kh(4)}-${t}`,role:"system",content:e}))),[H,U]=Z.useState(!!e);Z.useEffect((()=>{if(e){const{apiKey:n,analyticsApiBaseUrl:r}=a;(async function(e,t,n){try{const r=`${n}/conversations/${e}`,a=await fetch(r,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!a.ok){const e=await a.text();throw new Error(`Failed to get conversation: ${e}`)}return a.json()}catch(N){console.warn("Error in getConversation:",N)}})(e,n,r).then((e=>{if(e){B({eventName:"shared_chat_loaded",properties:{conversation:e}}),U(!1),t({...e});const n=e.messages.map((e=>({...e,content:bD(e.content)})));_(n),F.current=n}}))}}),[e]);const $=e=>{I(e),_((t=>{const n=[...t],r=n[n.length-1];return r&&(r.content=(e=>{switch(e.code){case 400:return e.message;case 403:return`There seems to be a configuration error. Please contact ${a.organizationDisplayName??"Administrator"}`;default:return"Hmm.. \n\nIt seems I might be having some issues right now. Please clear the chat and try again."}})(e)),n})),T(!1),A(!1),p(),d()},G=!k.trim()&&!P.length||S,V=async(t=k)=>{if(G&&(!t||0===t.trim().length))return;T(!0);const r=R?2===E.length:0===E.length,a=function(e,t,n){if(!e)return;const r=n?vP(e):"",a=_P(t),o={workflow:SP(e),attachments:t};return{context:TP([r,a]),attributes:o}}(R,P,r);let o;const i=_P(P);o=P.length&&i?[{type:"text",text:i}]:t;const c={id:`${Date.now().toString()}-${Kh(4)}-1`,role:"user",content:o,metadata:a},p=[...E.length?[]:z,c];if(e){AP();const e=F.current.map(((e,t)=>({id:`${e.id}-${Kh(6)}-${t}`,role:e.role,..."assistant"===e.role?{links:e.links??[]}:{},content:e.content,metadata:e.metadata,tool_calls:e.tool_calls})));_([...e,...p]),F.current=[...e,...p]}else _((e=>[...e,...p])),F.current=[...F.current,...p];L([]),w(""),B({eventName:"user_message_submitted",properties:{}},F.current);const f=[yD,...(null==m?void 0:m({conversation:n}))||[]];try{const e={model:y,messages:F.current,stream:!0,tools:f,tool_choice:"auto"},t=await u(),r=t?btoa(JSON.stringify(t)):null,a=l||b?JSON.stringify({...l,...b}):void 0,o={};!s&&r&&(o["X-INKEEP-CHALLENGE-SOLUTION"]=r),a&&(o["inkeep-filters"]=a);const i=h.beta.chat.completions.stream(e,Object.keys(o).length>0?{headers:o}:void 0),c={id:`${Date.now().toString()}-${Kh(4)}-2`,role:"assistant",content:"",links:[],tool_calls:[]};_((e=>[...e,c])),i.on("content",((e,t)=>{A(!0),c.content=t,_((e=>{const t=[...e],n=t.findIndex((e=>e.id===c.id));return-1===n?[...t,c]:(t[n]={...c},t)}))})),i.on("tool_calls.function.arguments.done",(async e=>{var t,r,a,o;const{name:s,arguments:l}=e,u=null==f?void 0:f.find((e=>e.function.name===s));if(!u)return;const d=("parse"in u.function?u.function.parse:JSON.parse)(l),p=null==(r=(t=u.function).function)?void 0:r.call(t,d,i),h=(null==(a=u.renderMessageButtons)?void 0:a.call(u,{args:d,execution:p}))??[];"provideLinks"===s?c.links=d.links??[]:M((e=>({...e,[c.id]:[...e[c.id]??[],...h]}))),null==(o=c.tool_calls)||o.push({id:"call_"+Kh(24),type:"function",function:{name:s,arguments:l}}),_((e=>{const t=[...e],n=t.findIndex((e=>e.id===c.id));return t[n]={...c},t})),null==v||v(e,{conversation:{...n,messages:[...F.current,c]}})})),i.on("error",$),i.finalChatCompletion().then((()=>{F.current=[...F.current,c],j.current=null,T(!1),A(!1),d(),B({eventName:"assistant_message_received",properties:{}},F.current)})).catch((e=>{e instanceof Nf||console.warn(e)})),j.current=i.controller}catch(g){$(g),T(!1),A(!1)}},q=()=>{I(null),_([]),F.current=[],r(),M({}),L([]),AP(),O(null),p(),d(),B({eventName:"chat_clear_button_clicked",properties:{conversation:n}})},{openForm:W}=lD(),Y=dD();Z.useImperativeHandle(o.chatFunctionsRef,(()=>({submitMessage:V,updateInputMessage(e){w(e)},clearChat:q,openForm:e=>{null==Y||Y.setView("chat"),W(e)},focusInput:()=>{var e;null==(e=x.current)||e.focus()}})));const K=pD("(max-width: 768px)");return{messages:E,input:k,isLoading:S,isStreaming:C,isLoadingConversation:H,error:N,isSubmitDisabled:G,handleInputChange:e=>{const t=e.target.value;w(t)},handleInputKeyDown:e=>{"Enter"!==e.key||e.shiftKey||G||e.nativeEvent.isComposing||(e.preventDefault(),V())},handleSubmit:V,stop:()=>{j.current&&(j.current.abort(),j.current=null),T(!1),A(!1),d()},clear:q,handleWorkflow:e=>{O(e);const{initialReplyMessage:t,displayName:n}=e,r={id:E.length.toString()+Kh(4),role:"user",content:n},a={id:(E.length+1).toString()+Kh(4),role:"assistant",content:t,links:[]},o=[{id:`system-${Date.now().toString()}-${Kh(4)}-${e.id}`,role:"system",content:`Company has asked user to follow this guided workflow:\n${vP(e)}`},...z,r,a];_(o),L([])},selectedWorkflow:R,messageAttachments:P,setMessageAttachments:L,addAttachment:e=>{L((t=>[...t,e]))},messageButtons:D,isEmpty:0===E.length,inputRef:x,isMobile:K}};const CD=Z.createContext(void 0);function AD(){const{baseSettings:e}=JO(),{apiKey:t,analyticsApiBaseUrl:n,analyticsProperties:r}=e,[a,o]=Z.useState(null),[i,s]=Z.useState({}),{conversation:l}=rP(),{messages:c,selectedWorkflow:u}=zj(),{userProperties:d}=pP(),{logEvent:p}=bP(),h=Z.useCallback((async(e,a,o=[])=>{const i=await async function(e){try{const{type:t,messageId:n,reasons:r=[],apiKey:a,apiUrl:o,userProperties:i,properties:s}=e,l=`${o}/feedback`,c={type:t,messageId:n,createdAt:(new Date).toISOString(),userProperties:i,properties:s};"negative"===t&&(c.reasons=r);const u=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(c)});if(!u.ok){const e=await u.text();throw new Error(`Failed to send feedback: ${e}`)}return u.json()}catch(t){console.warn("Error in submitFeedback:",t)}}({type:a,messageId:e,reasons:o,apiKey:t,apiUrl:n,userProperties:d,properties:r});i&&s((t=>({...t,[e]:{type:i.type,reasons:i.reasons}})));const h=c.findIndex((t=>t.id===e)),f=c[h],m={conversationId:l.id,question:SD(c[h-1]),answer:SD(f),messageId:e,reasons:o,workflowId:null==u?void 0:u.id};p({eventName:"positive"===a?"assistant_positive_feedback_submitted":"assistant_negative_feedback_submitted",properties:m})}),[c,l]);return{feedback:i,currentFeedback:a,setCurrentFeedback:o,submitPositiveFeedback:Z.useCallback((async e=>{h(e,"positive")}),[h]),submitNegativeFeedback:Z.useCallback((async(e,t)=>{const n=function(e){const t=[];for(const n in e){"on"===e[n]&&t.push({label:n,details:e[`${n}:description`]||""})}return t.length>0?t:[]}(t);h(e,"negative",n)}),[h])}}const ND=({children:e})=>{const t=AD();return Gh.jsx(CD.Provider,{value:t,children:e})},ID=()=>{const e=Z.useContext(CD);if(!e)throw new Error("useFeedback must be used within a FeedbackProvider");return e};function RD(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function OD(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function PD(...e){return t=>{let n=!1;const r=e.map((e=>{const r=OD(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():OD(e[t],null)}}}}function LD(...e){return Z.useCallback(PD(...e),e)}function DD(e,t=[]){let n=[];const r=()=>{const t=n.map((e=>Z.createContext(e)));return function(n){const r=(null==n?void 0:n[e])||t;return Z.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const a=Z.createContext(r),o=n.length;n=[...n,r];const i=t=>{var n;const{scope:r,children:i,...s}=t,l=(null==(n=null==r?void 0:r[e])?void 0:n[o])||a,c=Z.useMemo((()=>s),Object.values(s));return Gh.jsx(l.Provider,{value:c,children:i})};return i.displayName=t+"Provider",[i,function(n,i){var s;const l=(null==(s=null==i?void 0:i[e])?void 0:s[o])||a,c=Z.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},MD(r,...t)]}function MD(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return Z.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}var FD=Z.forwardRef(((e,t)=>{const{children:n,...r}=e,a=Z.Children.toArray(n),o=a.find(zD);if(o){const e=o.props.children,n=a.map((t=>t===o?Z.Children.count(e)>1?Z.Children.only(null):Z.isValidElement(e)?e.props.children:null:t));return Gh.jsx(jD,{...r,ref:t,children:Z.isValidElement(e)?Z.cloneElement(e,void 0,n):null})}return Gh.jsx(jD,{...r,ref:t,children:n})}));FD.displayName="Slot";var jD=Z.forwardRef(((e,t)=>{const{children:n,...r}=e;if(Z.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;if(a)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a)return e.props.ref;return e.props.ref||e.ref}(n);return Z.cloneElement(n,{...HD(r,n.props),ref:t?PD(t,e):e})}return Z.Children.count(n)>1?Z.Children.only(null):null}));jD.displayName="SlotClone";var BD=({children:e})=>Gh.jsx(Gh.Fragment,{children:e});function zD(e){return Z.isValidElement(e)&&e.type===BD}function HD(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...e)=>{o(...e),a(...e)}:a&&(n[r]=a):"style"===r?n[r]={...a,...o}:"className"===r&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}var UD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=Z.forwardRef(((e,n)=>{const{asChild:r,...a}=e,o=r?FD:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),Gh.jsx(o,{...a,ref:n})}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function $D(e){const t=Z.useRef(e);return Z.useEffect((()=>{t.current=e})),Z.useMemo((()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)}),[])}function GD(e,t=(null==globalThis?void 0:globalThis.document)){const n=$D(e);Z.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}var VD,qD="dismissableLayer.update",WD="dismissableLayer.pointerDownOutside",YD="dismissableLayer.focusOutside",KD=Z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),XD=Z.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:i,onDismiss:s,...l}=e,c=Z.useContext(KD),[u,d]=Z.useState(null),p=(null==u?void 0:u.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,h]=Z.useState({}),f=LD(t,(e=>d(e))),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(g),b=u?m.indexOf(u):-1,v=c.layersWithOutsidePointerEventsDisabled.size>0,k=b>=y,w=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=$D(e),r=Z.useRef(!1),a=Z.useRef((()=>{}));return Z.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){JD(WD,n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=r,t.addEventListener("click",a.current,{once:!0})):r()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...c.branches].some((e=>e.contains(t)));k&&!n&&(null==a||a(e),null==i||i(e),e.defaultPrevented||null==s||s())}),p),x=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=$D(e),r=Z.useRef(!1);return Z.useEffect((()=>{const e=e=>{if(e.target&&!r.current){JD(YD,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...c.branches].some((e=>e.contains(t)))||(null==o||o(e),null==i||i(e),e.defaultPrevented||null==s||s())}),p);return GD((e=>{b===c.layers.size-1&&(null==r||r(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),p),Z.useEffect((()=>{if(u)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(VD=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),ZD(),()=>{n&&1===c.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=VD)}}),[u,p,n,c]),Z.useEffect((()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),ZD())}),[u,c]),Z.useEffect((()=>{const e=()=>h({});return document.addEventListener(qD,e),()=>document.removeEventListener(qD,e)}),[]),Gh.jsx(UD.div,{...l,ref:f,style:{pointerEvents:v?k?"auto":"none":void 0,...e.style},onFocusCapture:RD(e.onFocusCapture,x.onFocusCapture),onBlurCapture:RD(e.onBlurCapture,x.onBlurCapture),onPointerDownCapture:RD(e.onPointerDownCapture,w.onPointerDownCapture)})}));XD.displayName="DismissableLayer";var QD=Z.forwardRef(((e,t)=>{const n=Z.useContext(KD),r=Z.useRef(null),a=LD(t,r);return Z.useEffect((()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),Gh.jsx(UD.div,{...e,ref:a})}));function ZD(){const e=new CustomEvent(qD);document.dispatchEvent(e)}function JD(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?function(e,t){e&&ue.flushSync((()=>e.dispatchEvent(t)))}(a,o):a.dispatchEvent(o)}QD.displayName="DismissableLayerBranch";var eM=Boolean(null==globalThis?void 0:globalThis.document)?Z.useLayoutEffect:()=>{},tM=ee["useId".toString()]||(()=>{}),nM=0;function rM(e){const[t,n]=Z.useState(tM());return eM((()=>{n((e=>e??String(nM++)))}),[e]),e||(t?`radix-${t}`:"")}const aM=["top","right","bottom","left"],oM=Math.min,iM=Math.max,sM=Math.round,lM=Math.floor,cM=e=>({x:e,y:e}),uM={left:"right",right:"left",bottom:"top",top:"bottom"},dM={start:"end",end:"start"};function pM(e,t,n){return iM(e,oM(t,n))}function hM(e,t){return"function"==typeof e?e(t):e}function fM(e){return e.split("-")[0]}function mM(e){return e.split("-")[1]}function gM(e){return"x"===e?"y":"x"}function yM(e){return"y"===e?"height":"width"}function bM(e){return["top","bottom"].includes(fM(e))?"y":"x"}function vM(e){return gM(bM(e))}function kM(e){return e.replace(/start|end/g,(e=>dM[e]))}function wM(e){return e.replace(/left|right|bottom|top/g,(e=>uM[e]))}function xM(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function EM(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function _M(e,t,n){let{reference:r,floating:a}=e;const o=bM(t),i=vM(t),s=yM(i),l=fM(t),c="y"===o,u=r.x+r.width/2-a.width/2,d=r.y+r.height/2-a.height/2,p=r[s]/2-a[s]/2;let h;switch(l){case"top":h={x:u,y:r.y-a.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-a.width,y:d};break;default:h={x:r.x,y:r.y}}switch(mM(t)){case"start":h[i]-=p*(n&&c?-1:1);break;case"end":h[i]+=p*(n&&c?-1:1)}return h}async function SM(e,t){var n;void 0===t&&(t={});const{x:r,y:a,platform:o,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=hM(t,e),f=xM(h),m=s[p?"floating"===d?"reference":"floating":d],g=EM(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(m)))||n?m:m.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,b=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),v=await(null==o.isElement?void 0:o.isElement(b))&&await(null==o.getScale?void 0:o.getScale(b))||{x:1,y:1},k=EM(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:b,strategy:l}):y);return{top:(g.top-k.top+f.top)/v.y,bottom:(k.bottom-g.bottom+f.bottom)/v.y,left:(g.left-k.left+f.left)/v.x,right:(k.right-g.right+f.right)/v.x}}function TM(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function CM(e){return aM.some((t=>e[t]>=0))}function AM(){return"undefined"!=typeof window}function NM(e){return OM(e)?(e.nodeName||"").toLowerCase():"#document"}function IM(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function RM(e){var t;return null==(t=(OM(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function OM(e){return!!AM()&&(e instanceof Node||e instanceof IM(e).Node)}function PM(e){return!!AM()&&(e instanceof Element||e instanceof IM(e).Element)}function LM(e){return!!AM()&&(e instanceof HTMLElement||e instanceof IM(e).HTMLElement)}function DM(e){return!(!AM()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof IM(e).ShadowRoot)}function MM(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=UM(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function FM(e){return["table","td","th"].includes(NM(e))}function jM(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(V4){return!1}}))}function BM(e){const t=zM(),n=PM(e)?UM(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function zM(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function HM(e){return["html","body","#document"].includes(NM(e))}function UM(e){return IM(e).getComputedStyle(e)}function $M(e){return PM(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function GM(e){if("html"===NM(e))return e;const t=e.assignedSlot||e.parentNode||DM(e)&&e.host||RM(e);return DM(t)?t.host:t}function VM(e){const t=GM(e);return HM(t)?e.ownerDocument?e.ownerDocument.body:e.body:LM(t)&&MM(t)?t:VM(t)}function qM(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const a=VM(e),o=a===(null==(r=e.ownerDocument)?void 0:r.body),i=IM(a);if(o){const e=WM(i);return t.concat(i,i.visualViewport||[],MM(a)?a:[],e&&n?qM(e):[])}return t.concat(a,qM(a,[],n))}function WM(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function YM(e){const t=UM(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=LM(e),o=a?e.offsetWidth:n,i=a?e.offsetHeight:r,s=sM(n)!==o||sM(r)!==i;return s&&(n=o,r=i),{width:n,height:r,$:s}}function KM(e){return PM(e)?e:e.contextElement}function XM(e){const t=KM(e);if(!LM(t))return cM(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=YM(t);let i=(o?sM(n.width):n.width)/r,s=(o?sM(n.height):n.height)/a;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const QM=cM(0);function ZM(e){const t=IM(e);return zM()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:QM}function JM(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect(),o=KM(e);let i=cM(1);t&&(r?PM(r)&&(i=XM(r)):i=XM(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==IM(e))&&t}(o,n,r)?ZM(o):cM(0);let l=(a.left+s.x)/i.x,c=(a.top+s.y)/i.y,u=a.width/i.x,d=a.height/i.y;if(o){const e=IM(o),t=r&&PM(r)?IM(r):r;let n=e,a=WM(n);for(;a&&r&&t!==n;){const e=XM(a),t=a.getBoundingClientRect(),r=UM(a),o=t.left+(a.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(a.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=i,n=IM(a),a=WM(n)}}return EM({width:u,height:d,x:l,y:c})}function eF(e,t){const n=$M(e).scrollLeft;return t?t.left+n:JM(RM(e)).left+n}function tF(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:eF(e,r)),y:r.top+t.scrollTop}}function nF(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=IM(e),r=RM(e),a=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,s=0,l=0;if(a){o=a.width,i=a.height;const e=zM();(!e||e&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}return{width:o,height:i,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=RM(e),n=$M(e),r=e.ownerDocument.body,a=iM(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=iM(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+eF(e);const s=-n.scrollTop;return"rtl"===UM(r).direction&&(i+=iM(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:i,y:s}}(RM(e));else if(PM(t))r=function(e,t){const n=JM(e,!0,"fixed"===t),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=LM(e)?XM(e):cM(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:r*o.y}}(t,n);else{const n=ZM(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return EM(r)}function rF(e,t){const n=GM(e);return!(n===t||!PM(n)||HM(n))&&("fixed"===UM(n).position||rF(n,t))}function aF(e,t,n){const r=LM(t),a=RM(t),o="fixed"===n,i=JM(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=cM(0);if(r||!r&&!o)if(("body"!==NM(t)||MM(a))&&(s=$M(t)),r){const e=JM(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&(l.x=eF(a));const c=!a||r||o?cM(0):tF(a,s);return{x:i.left+s.scrollLeft-l.x-c.x,y:i.top+s.scrollTop-l.y-c.y,width:i.width,height:i.height}}function oF(e){return"static"===UM(e).position}function iF(e,t){if(!LM(e)||"fixed"===UM(e).position)return null;if(t)return t(e);let n=e.offsetParent;return RM(e)===n&&(n=n.ownerDocument.body),n}function sF(e,t){const n=IM(e);if(jM(e))return n;if(!LM(e)){let t=GM(e);for(;t&&!HM(t);){if(PM(t)&&!oF(t))return t;t=GM(t)}return n}let r=iF(e,t);for(;r&&FM(r)&&oF(r);)r=iF(r,t);return r&&HM(r)&&oF(r)&&!BM(r)?n:r||function(e){let t=GM(e);for(;LM(t)&&!HM(t);){if(BM(t))return t;if(jM(t))return null;t=GM(t)}return null}(e)||n}const lF={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o="fixed"===a,i=RM(r),s=!!t&&jM(t.floating);if(r===i||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=cM(1);const u=cM(0),d=LM(r);if((d||!d&&!o)&&(("body"!==NM(r)||MM(i))&&(l=$M(r)),LM(r))){const e=JM(r);c=XM(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!i||d||o?cM(0):tF(i,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}},getDocumentElement:RM,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[..."clippingAncestors"===n?jM(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=qM(e,[],!1).filter((e=>PM(e)&&"body"!==NM(e))),a=null;const o="fixed"===UM(e).position;let i=o?GM(e):e;for(;PM(i)&&!HM(i);){const t=UM(i),n=BM(i);n||"fixed"!==t.position||(a=null),(o?!n&&!a:!n&&"static"===t.position&&a&&["absolute","fixed"].includes(a.position)||MM(i)&&!n&&rF(e,i))?r=r.filter((e=>e!==i)):a=t,i=GM(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=o[0],s=o.reduce(((e,n)=>{const r=nF(t,n,a);return e.top=iM(r.top,e.top),e.right=oM(r.right,e.right),e.bottom=oM(r.bottom,e.bottom),e.left=iM(r.left,e.left),e}),nF(t,i,a));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:sF,getElementRects:async function(e){const t=this.getOffsetParent||sF,n=this.getDimensions,r=await n(e.floating);return{reference:aF(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=YM(e);return{width:t,height:n}},getScale:XM,isElement:PM,isRTL:function(e){return"rtl"===UM(e).direction}};function cF(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uF(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=KM(e),u=a||o?[...c?qM(c):[],...qM(t)]:[];u.forEach((e=>{a&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)}));const d=c&&s?function(e,t){let n,r=null;const a=RM(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:h}=c;if(s||t(),!p||!h)return;const f={rootMargin:-lM(d)+"px "+-lM(a.clientWidth-(u+p))+"px "+-lM(a.clientHeight-(d+h))+"px "+-lM(u)+"px",threshold:iM(0,oM(1,l))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return i();r?i(!1,r):n=setTimeout((()=>{i(!1,1e-7)}),1e3)}1!==r||cF(c,e.getBoundingClientRect())||i(),m=!1}try{r=new IntersectionObserver(g,{...f,root:a.ownerDocument})}catch(V4){r=new IntersectionObserver(g,f)}r.observe(e)}(!0),o}(c,n):null;let p,h=-1,f=null;i&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=f)||e.observe(t)}))),n()})),c&&!l&&f.observe(c),f.observe(t));let m=l?JM(e):null;return l&&function t(){const r=JM(e);m&&!cF(m,r)&&n();m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{a&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const dF=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:a}=e,o=await(null==r.isRTL?void 0:r.isRTL(a.floating)),i=fM(n),s=mM(n),l="y"===bM(n),c=["left","top"].includes(i)?-1:1,u=o&&l?-1:1,d=hM(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:a+l.x,y:o+l.y,data:{...l,placement:i}}}}},pF=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=hM(e,t),c={x:n,y:r},u=await SM(t,l),d=bM(fM(a)),p=gM(d);let h=c[p],f=c[d];if(o){const e="y"===p?"bottom":"right";h=pM(h+u["y"===p?"top":"left"],h,h-u[e])}if(i){const e="y"===d?"bottom":"right";f=pM(f+u["y"===d?"top":"left"],f,f-u[e])}const m=s.fn({...t,[p]:h,[d]:f});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:o,[d]:i}}}}}},hF=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=hM(e,t);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const y=fM(a),b=bM(s),v=fM(s)===s,k=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(v||!m?[wM(s)]:function(e){const t=wM(e);return[kM(e),t,kM(t)]}(s)),x="none"!==f;!p&&x&&w.push(...function(e,t,n,r){const a=mM(e);let o=function(e,t,n){const r=["left","right"],a=["right","left"],o=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?o:i;default:return[]}}(fM(e),"start"===n,r);return a&&(o=o.map((e=>e+"-"+a)),t&&(o=o.concat(o.map(kM)))),o}(s,m,f,k));const E=[s,...w],_=await SM(t,g),S=[];let T=(null==(r=o.flip)?void 0:r.overflows)||[];if(u&&S.push(_[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=mM(e),a=vM(e),o=yM(a);let i="x"===a?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=wM(i)),[i,wM(i)]}(a,i,k);S.push(_[e[0]],_[e[1]])}if(T=[...T,{placement:a,overflows:S}],!S.every((e=>e<=0))){var C,A;const e=((null==(C=o.flip)?void 0:C.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:T},reset:{placement:t}};let n=null==(A=T.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:A.placement;if(!n)switch(h){case"bestFit":{var N;const e=null==(N=T.filter((e=>{if(x){const t=bM(e.placement);return t===b||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:N[0];e&&(n=e);break}case"initialPlacement":n=s}if(a!==n)return{reset:{placement:n}}}return{}}}},fF=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:i,elements:s}=t,{apply:l=()=>{},...c}=hM(e,t),u=await SM(t,c),d=fM(a),p=mM(a),h="y"===bM(a),{width:f,height:m}=o.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=p===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,g="end"===p?"top":"bottom");const b=m-u.top-u.bottom,v=f-u.left-u.right,k=oM(m-u[g],b),w=oM(f-u[y],v),x=!t.middlewareData.shift;let E=k,_=w;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(_=v),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=b),x&&!p){const e=iM(u.left,0),t=iM(u.right,0),n=iM(u.top,0),r=iM(u.bottom,0);h?_=f-2*(0!==e||0!==t?e+t:iM(u.left,u.right)):E=m-2*(0!==n||0!==r?n+r:iM(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:E});const S=await i.getDimensions(s.floating);return f!==S.width||m!==S.height?{reset:{rects:!0}}:{}}}},mF=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=hM(e,t);switch(r){case"referenceHidden":{const e=TM(await SM(t,{...a,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:CM(e)}}}case"escaped":{const e=TM(await SM(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:CM(e)}}}default:return{}}}}},gF=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=hM(e,t)||{};if(null==c)return{};const d=xM(u),p={x:n,y:r},h=vM(a),f=yM(h),m=await i.getDimensions(c),g="y"===h,y=g?"top":"left",b=g?"bottom":"right",v=g?"clientHeight":"clientWidth",k=o.reference[f]+o.reference[h]-p[h]-o.floating[f],w=p[h]-o.reference[h],x=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let E=x?x[v]:0;E&&await(null==i.isElement?void 0:i.isElement(x))||(E=s.floating[v]||o.floating[f]);const _=k/2-w/2,S=E/2-m[f]/2-1,T=oM(d[y],S),C=oM(d[b],S),A=T,N=E-m[f]-C,I=E/2-m[f]/2+_,R=pM(A,I,N),O=!l.arrow&&null!=mM(a)&&I!==R&&o.reference[f]/2-(I<A?T:C)-m[f]/2<0,P=O?I<A?I-A:I-N:0;return{[h]:p[h]+P,data:{[h]:R,centerOffset:I-R-P,...O&&{alignmentOffset:P}},reset:O}}}),yF=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=hM(e,t),u={x:n,y:r},d=bM(a),p=gM(d);let h=u[p],f=u[d];const m=hM(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===p?"height":"width",t=o.reference[p]-o.floating[e]+g.mainAxis,n=o.reference[p]+o.reference[e]-g.mainAxis;h<t?h=t:h>n&&(h=n)}if(c){var y,b;const e="y"===p?"width":"height",t=["top","left"].includes(fM(a)),n=o.reference[d]-o.floating[e]+(t&&(null==(y=i.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),r=o.reference[d]+o.reference[e]+(t?0:(null==(b=i.offset)?void 0:b[d])||0)-(t?g.crossAxis:0);f<n?f=n:f>r&&(f=r)}return{[p]:h,[d]:f}}}},bF=(e,t,n)=>{const r=new Map,a={platform:lF,...n},o={...a.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:i}=n,s=o.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=_M(c,r,l),p=r,h={},f=0;for(let m=0;m<s.length;m++){const{name:n,fn:o}=s[m],{x:g,y:y,data:b,reset:v}=await o({x:u,y:d,initialPlacement:r,placement:p,strategy:a,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,h={...h,[n]:{...h[n],...b}},v&&f<=50&&(f++,"object"==typeof v&&(v.placement&&(p=v.placement),v.rects&&(c=!0===v.rects?await i.getElementRects({reference:e,floating:t,strategy:a}):v.rects),({x:u,y:d}=_M(c,p,l))),m=-1)}return{x:u,y:d,placement:p,strategy:a,middlewareData:h}})(e,t,{...a,platform:o})};var vF="undefined"!=typeof document?Z.useLayoutEffect:Z.useEffect;function kF(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!kF(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;0!=r--;){const n=a[r];if(("_owner"!==n||!e.$$typeof)&&!kF(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function wF(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xF(e,t){const n=wF(e);return Math.round(t*n)/n}function EF(e){const t=Z.useRef(e);return vF((()=>{t.current=e})),t}function _F(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:i}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,d]=Z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=Z.useState(r);kF(p,r)||h(r);const[f,m]=Z.useState(null),[g,y]=Z.useState(null),b=Z.useCallback((e=>{e!==x.current&&(x.current=e,m(e))}),[]),v=Z.useCallback((e=>{e!==E.current&&(E.current=e,y(e))}),[]),k=o||f,w=i||g,x=Z.useRef(null),E=Z.useRef(null),_=Z.useRef(u),S=null!=l,T=EF(l),C=EF(a),A=EF(c),N=Z.useCallback((()=>{if(!x.current||!E.current)return;const e={placement:t,strategy:n,middleware:p};C.current&&(e.platform=C.current),bF(x.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==A.current};I.current&&!kF(_.current,t)&&(_.current=t,ue.flushSync((()=>{d(t)})))}))}),[p,t,n,C,A]);vF((()=>{!1===c&&_.current.isPositioned&&(_.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[c]);const I=Z.useRef(!1);vF((()=>(I.current=!0,()=>{I.current=!1})),[]),vF((()=>{if(k&&(x.current=k),w&&(E.current=w),k&&w){if(T.current)return T.current(k,w,N);N()}}),[k,w,N,T,S]);const R=Z.useMemo((()=>({reference:x,floating:E,setReference:b,setFloating:v})),[b,v]),O=Z.useMemo((()=>({reference:k,floating:w})),[k,w]),P=Z.useMemo((()=>{const e={position:n,left:0,top:0};if(!O.floating)return e;const t=xF(O.floating,u.x),r=xF(O.floating,u.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...wF(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,s,O.floating,u.x,u.y]);return Z.useMemo((()=>({...u,update:N,refs:R,elements:O,floatingStyles:P})),[u,N,R,O,P])}const SF=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(a=n,{}.hasOwnProperty.call(a,"current"))?null!=n.current?gF({element:n.current,padding:r}).fn(t):{}:n?gF({element:n,padding:r}).fn(t):{};var a}}),TF=(e,t)=>({...dF(e),options:[e,t]}),CF=(e,t)=>({...pF(e),options:[e,t]}),AF=(e,t)=>({...yF(e),options:[e,t]}),NF=(e,t)=>({...hF(e),options:[e,t]}),IF=(e,t)=>({...fF(e),options:[e,t]}),RF=(e,t)=>({...mF(e),options:[e,t]}),OF=(e,t)=>({...SF(e),options:[e,t]});var PF=Z.forwardRef(((e,t)=>{const{children:n,width:r=10,height:a=5,...o}=e;return Gh.jsx(UD.svg,{...o,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:Gh.jsx("polygon",{points:"0,0 30,0 15,10"})})}));PF.displayName="Arrow";var LF=PF;function DF(e){const[t,n]=Z.useState(void 0);return eM((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let a,o;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,o=t.blockSize}else a=e.offsetWidth,o=e.offsetHeight;n({width:a,height:o})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}var MF="Popper",[FF,jF]=DD(MF),[BF,zF]=FF(MF),HF=e=>{const{__scopePopper:t,children:n}=e,[r,a]=Z.useState(null);return Gh.jsx(BF,{scope:t,anchor:r,onAnchorChange:a,children:n})};HF.displayName=MF;var UF="PopperAnchor",$F=Z.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=zF(UF,n),i=Z.useRef(null),s=LD(t,i);return Z.useEffect((()=>{o.onAnchorChange((null==r?void 0:r.current)||i.current)})),r?null:Gh.jsx(UD.div,{...a,ref:s})}));$F.displayName=UF;var GF="PopperContent",[VF,qF]=FF(GF),WF=Z.forwardRef(((e,t)=>{var n,r,a,o,i,s;const{__scopePopper:l,side:c="bottom",sideOffset:u=0,align:d="center",alignOffset:p=0,arrowPadding:h=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:b=!1,updatePositionStrategy:v="optimized",onPlaced:k,...w}=e,x=zF(GF,l),[E,_]=Z.useState(null),S=LD(t,(e=>_(e))),[T,C]=Z.useState(null),A=DF(T),N=(null==A?void 0:A.width)??0,I=(null==A?void 0:A.height)??0,R=c+("center"!==d?"-"+d:""),O="number"==typeof g?g:{top:0,right:0,bottom:0,left:0,...g},P=Array.isArray(m)?m:[m],L=P.length>0,D={padding:O,boundary:P.filter(QF),altBoundary:L},{refs:M,floatingStyles:F,placement:j,isPositioned:B,middlewareData:z}=_F({strategy:"fixed",placement:R,whileElementsMounted:(...e)=>uF(...e,{animationFrame:"always"===v}),elements:{reference:x.anchor},middleware:[TF({mainAxis:u+I,alignmentAxis:p}),f&&CF({mainAxis:!0,crossAxis:!1,limiter:"partial"===y?AF():void 0,...D}),f&&NF({...D}),IF({...D,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:a,height:o}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${a}px`),i.setProperty("--radix-popper-anchor-height",`${o}px`)}}),T&&OF({element:T,padding:h}),ZF({arrowWidth:N,arrowHeight:I}),b&&RF({strategy:"referenceHidden",...D})]}),[H,U]=JF(j),$=$D(k);eM((()=>{B&&(null==$||$())}),[B,$]);const G=null==(n=z.arrow)?void 0:n.x,V=null==(r=z.arrow)?void 0:r.y,q=0!==(null==(a=z.arrow)?void 0:a.centerOffset),[W,Y]=Z.useState();return eM((()=>{E&&Y(window.getComputedStyle(E).zIndex)}),[E]),Gh.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:B?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[null==(o=z.transformOrigin)?void 0:o.x,null==(i=z.transformOrigin)?void 0:i.y].join(" "),...(null==(s=z.hide)?void 0:s.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:Gh.jsx(VF,{scope:l,placedSide:H,onArrowChange:C,arrowX:G,arrowY:V,shouldHideArrow:q,children:Gh.jsx(UD.div,{"data-side":H,"data-align":U,...w,ref:S,style:{...w.style,animation:B?void 0:"none"}})})})}));WF.displayName=GF;var YF="PopperArrow",KF={top:"bottom",right:"left",bottom:"top",left:"right"},XF=Z.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,a=qF(YF,n),o=KF[a.placedSide];return Gh.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:Gh.jsx(LF,{...r,ref:t,style:{...r.style,display:"block"}})})}));function QF(e){return null!==e}XF.displayName=YF;var ZF=e=>({name:"transformOrigin",options:e,fn(t){var n,r,a;const{placement:o,rects:i,middlewareData:s}=t,l=0!==(null==(n=s.arrow)?void 0:n.centerOffset),c=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[d,p]=JF(o),h={start:"0%",center:"50%",end:"100%"}[p],f=((null==(r=s.arrow)?void 0:r.x)??0)+c/2,m=((null==(a=s.arrow)?void 0:a.y)??0)+u/2;let g="",y="";return"bottom"===d?(g=l?h:`${f}px`,y=-u+"px"):"top"===d?(g=l?h:`${f}px`,y=`${i.floating.height+u}px`):"right"===d?(g=-u+"px",y=l?h:`${m}px`):"left"===d&&(g=`${i.floating.width+u}px`,y=l?h:`${m}px`),{data:{x:g,y:y}}}});function JF(e){const[t,n="center"]=e.split("-");return[t,n]}var ej=HF,tj=$F,nj=WF,rj=XF;var aj=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=Z.useState(),r=Z.useRef({}),a=Z.useRef(e),o=Z.useRef("none"),i=e?"mounted":"unmounted",[s,l]=function(e,t){return Z.useReducer(((e,n)=>t[e][n]??e),e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Z.useEffect((()=>{const e=oj(r.current);o.current="mounted"===s?e:"none"}),[s]),eM((()=>{const t=r.current,n=a.current;if(n!==e){const r=o.current,i=oj(t);if(e)l("MOUNT");else if("none"===i||"none"===(null==t?void 0:t.display))l("UNMOUNT");else{l(n&&r!==i?"ANIMATION_OUT":"UNMOUNT")}a.current=e}}),[e,l]),eM((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,i=o=>{const i=oj(r.current).includes(o.animationName);if(o.target===t&&i&&(l("ANIMATION_END"),!a.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},s=e=>{e.target===t&&(o.current=oj(r.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}l("ANIMATION_END")}),[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:Z.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),a="function"==typeof n?n({present:r.isPresent}):Z.Children.only(n),o=LD(r.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;if(a)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof n||r.isPresent?Z.cloneElement(a,{ref:o}):null};function oj(e){return(null==e?void 0:e.animationName)||"none"}function ij({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,a]=function({defaultProp:e,onChange:t}){const n=Z.useState(e),[r]=n,a=Z.useRef(r),o=$D(t);return Z.useEffect((()=>{a.current!==r&&(o(r),a.current=r)}),[r,a,o]),n}({defaultProp:t,onChange:n}),o=void 0!==e,i=o?e:r,s=$D(n);return[i,Z.useCallback((t=>{if(o){const n="function"==typeof t?t(e):t;n!==e&&s(n)}else a(t)}),[o,e,a,s])]}aj.displayName="Presence";var sj=Z.forwardRef(((e,t)=>Gh.jsx(UD.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));sj.displayName="VisuallyHidden";var lj=sj,[cj,uj]=DD("Tooltip",[jF]),dj=jF(),pj="TooltipProvider",hj=700,fj="tooltip.open",[mj,gj]=cj(pj),yj=e=>{const{__scopeTooltip:t,delayDuration:n=hj,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:o}=e,[i,s]=Z.useState(!0),l=Z.useRef(!1),c=Z.useRef(0);return Z.useEffect((()=>{const e=c.current;return()=>window.clearTimeout(e)}),[]),Gh.jsx(mj,{scope:t,isOpenDelayed:i,delayDuration:n,onOpen:Z.useCallback((()=>{window.clearTimeout(c.current),s(!1)}),[]),onClose:Z.useCallback((()=>{window.clearTimeout(c.current),c.current=window.setTimeout((()=>s(!0)),r)}),[r]),isPointerInTransitRef:l,onPointerInTransitChange:Z.useCallback((e=>{l.current=e}),[]),disableHoverableContent:a,children:o})};yj.displayName=pj;var bj="Tooltip",[vj,kj]=cj(bj),wj=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a=!1,onOpenChange:o,disableHoverableContent:i,delayDuration:s}=e,l=gj(bj,e.__scopeTooltip),c=dj(t),[u,d]=Z.useState(null),p=rM(),h=Z.useRef(0),f=i??l.disableHoverableContent,m=s??l.delayDuration,g=Z.useRef(!1),[y=!1,b]=ij({prop:r,defaultProp:a,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(fj))):l.onClose(),null==o||o(e)}}),v=Z.useMemo((()=>y?g.current?"delayed-open":"instant-open":"closed"),[y]),k=Z.useCallback((()=>{window.clearTimeout(h.current),h.current=0,g.current=!1,b(!0)}),[b]),w=Z.useCallback((()=>{window.clearTimeout(h.current),h.current=0,b(!1)}),[b]),x=Z.useCallback((()=>{window.clearTimeout(h.current),h.current=window.setTimeout((()=>{g.current=!0,b(!0),h.current=0}),m)}),[m,b]);return Z.useEffect((()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)}),[]),Gh.jsx(ej,{...c,children:Gh.jsx(vj,{scope:t,contentId:p,open:y,stateAttribute:v,trigger:u,onTriggerChange:d,onTriggerEnter:Z.useCallback((()=>{l.isOpenDelayed?x():k()}),[l.isOpenDelayed,x,k]),onTriggerLeave:Z.useCallback((()=>{f?w():(window.clearTimeout(h.current),h.current=0)}),[w,f]),onOpen:k,onClose:w,disableHoverableContent:f,children:n})})};wj.displayName=bj;var xj="TooltipTrigger",Ej=Z.forwardRef(((e,t)=>{const{__scopeTooltip:n,...r}=e,a=kj(xj,n),o=gj(xj,n),i=dj(n),s=LD(t,Z.useRef(null),a.onTriggerChange),l=Z.useRef(!1),c=Z.useRef(!1),u=Z.useCallback((()=>l.current=!1),[]);return Z.useEffect((()=>()=>document.removeEventListener("pointerup",u)),[u]),Gh.jsx(tj,{asChild:!0,...i,children:Gh.jsx(UD.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:s,onPointerMove:RD(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(c.current||o.isPointerInTransitRef.current||(a.onTriggerEnter(),c.current=!0))})),onPointerLeave:RD(e.onPointerLeave,(()=>{a.onTriggerLeave(),c.current=!1})),onPointerDown:RD(e.onPointerDown,(()=>{l.current=!0,document.addEventListener("pointerup",u,{once:!0})})),onFocus:RD(e.onFocus,(()=>{l.current||a.onOpen()})),onBlur:RD(e.onBlur,a.onClose),onClick:RD(e.onClick,a.onClose)})})}));Ej.displayName=xj;var[_j,Sj]=cj("TooltipPortal",{forceMount:void 0}),Tj="TooltipContent",Cj=Z.forwardRef(((e,t)=>{const n=Sj(Tj,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...o}=e,i=kj(Tj,e.__scopeTooltip);return Gh.jsx(aj,{present:r||i.open,children:i.disableHoverableContent?Gh.jsx(Rj,{side:a,...o,ref:t}):Gh.jsx(Aj,{side:a,...o,ref:t})})})),Aj=Z.forwardRef(((e,t)=>{const n=kj(Tj,e.__scopeTooltip),r=gj(Tj,e.__scopeTooltip),a=Z.useRef(null),o=LD(t,a),[i,s]=Z.useState(null),{trigger:l,onClose:c}=n,u=a.current,{onPointerInTransitChange:d}=r,p=Z.useCallback((()=>{s(null),d(!1)}),[d]),h=Z.useCallback(((e,t)=>{const n=e.currentTarget,r={x:e.clientX,y:e.clientY},a=function(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(r,function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,a,o)){case o:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(r,n.getBoundingClientRect())),o=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const t=e[r];for(;n.length>=2;){const e=n[n.length-1],r=n[n.length-2];if(!((e.x-r.x)*(t.y-r.y)>=(e.y-r.y)*(t.x-r.x)))break;n.pop()}n.push(t)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...a,...function(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}(t.getBoundingClientRect())]);s(o),d(!0)}),[d]);return Z.useEffect((()=>()=>p()),[p]),Z.useEffect((()=>{if(l&&u){const e=e=>h(e,u),t=e=>h(e,l);return l.addEventListener("pointerleave",e),u.addEventListener("pointerleave",t),()=>{l.removeEventListener("pointerleave",e),u.removeEventListener("pointerleave",t)}}}),[l,u,h,p]),Z.useEffect((()=>{if(i){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=(null==l?void 0:l.contains(t))||(null==u?void 0:u.contains(t)),a=!function(e,t){const{x:n,y:r}=e;let a=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const e=t[o].x,s=t[o].y,l=t[i].x,c=t[i].y;s>r!=c>r&&n<(l-e)*(r-s)/(c-s)+e&&(a=!a)}return a}(n,i);r?p():a&&(p(),c())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[l,u,i,c,p]),Gh.jsx(Rj,{...e,ref:o})})),[Nj,Ij]=cj(bj,{isInside:!1}),Rj=Z.forwardRef(((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:i,...s}=e,l=kj(Tj,n),c=dj(n),{onClose:u}=l;return Z.useEffect((()=>(document.addEventListener(fj,u),()=>document.removeEventListener(fj,u))),[u]),Z.useEffect((()=>{if(l.trigger){const e=e=>{const t=e.target;(null==t?void 0:t.contains(l.trigger))&&u()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[l.trigger,u]),Gh.jsx(XD,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:Gh.jsxs(nj,{"data-state":l.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[Gh.jsx(BD,{children:r}),Gh.jsx(Nj,{scope:n,isInside:!0,children:Gh.jsx(lj,{id:l.contentId,role:"tooltip",children:a||r})})]})})}));Cj.displayName=Tj;var Oj="TooltipArrow",Pj=Z.forwardRef(((e,t)=>{const{__scopeTooltip:n,...r}=e,a=dj(n);return Ij(Oj,n).isInside?null:Gh.jsx(rj,{...a,...r,ref:t})}));Pj.displayName=Oj;var Lj=yj,Dj=Ej,Mj=Cj,Fj=Pj;const jj=Z.createContext(void 0),Bj=({children:e,...t})=>{const n=TD();return Gh.jsx(jj.Provider,{value:{...n,...t},children:Gh.jsx(ND,{children:Gh.jsx(Lj,{children:e})})})},zj=()=>{const e=Z.useContext(jj);if(!e)throw new Error("useChat must be used within a ChatProvider");return e},Hj=Z.createContext(void 0);function Uj({children:e}){const t=function(){var e;const[t,n]=Z.useState(null),{value:r,setTrue:a,setFalse:o}=Yh(!1),[i,s]=Z.useState({title:"",content:""}),[l,c]=Z.useState({title:void 0,content:void 0}),{addAttachment:u}=zj(),d={data:i,errors:l,labels:{title:(null==(e=null==t?void 0:t.workflowModalProps)?void 0:e.titleInputLabel)||"Title",content:(null==t?void 0:t.contentType.contentInputLabel)||"Content"},validate(){const e={};return i.title.trim()||(e.title=`${d.labels.title} is required`),i.content.trim()||(e.content=`${d.labels.content} is required`),e},onChange(e){const{name:t,value:n}=e.target;s((e=>({...e,[t]:n})))},onSubmit(e){if(e.preventDefault(),!(null==t?void 0:t.contentType))return;const n=d.validate();if(Object.values(n).some((e=>!!e)))return void c(n);const r={...i,id:Kh(),contentType:t.contentType};u(r),o(),s({title:"",content:""}),c({title:void 0,content:void 0})}};return{selectedInput:t,selectInput:n,isOpen:r,onOpen:a,onClose:o,form:d}}();return Gh.jsx(Hj.Provider,{value:t,children:e})}const $j=()=>{const e=Z.useContext(Hj);if(!e)throw new Error("useAttachmentsBar must be used within a AttachmentsBarProvider");return e},Gj=Z.createContext(void 0),Vj=({children:e,name:t})=>{const n=Z.useRef(null);return Gh.jsx(Gj.Provider,{value:{name:t,focusItem:n},children:e})},qj=()=>{const e=Z.useContext(Gj);if(!e)throw new Error("useFeedbackItem must be used within a FeedbackItemProvider");return e},Wj=Z.createContext(void 0),Yj=({children:e,field:t,fieldProps:n,autoFocus:r})=>{const{errors:a}=lD(),o=a[t.name];return Gh.jsx(Wj.Provider,{value:{field:t,fieldProps:n,error:o,autoFocus:r},children:e})},Kj=()=>{const e=Z.useContext(Wj);if(!e)throw new Error("useFormField must be used within a FormFieldProvider");return e},Xj=Z.createContext(void 0);const Qj=({children:e,value:t})=>Gh.jsx(Xj.Provider,{value:t,children:e}),Zj=Z.createContext(void 0),Jj=({children:e,componentStyles:t})=>Gh.jsx(Zj.Provider,{value:{componentStyles:t},children:e}),eB=Z.createContext(void 0);function tB({children:e}){const[t,n]=J.useState(null),{value:r,setTrue:a,setFalse:o}=Yh(!1);return Gh.jsx(eB.Provider,{value:{selectedItem:t,selectItem:n,isOpen:r,onOpen:a,onClose:o},children:e})}const nB=()=>{const e=Z.useContext(eB);if(!e)throw new Error("useMessageAttachments must be used within a MessageAttachmentsProvider");return e},rB=Z.createContext(void 0),aB=({children:e,message:t})=>Gh.jsx(rB.Provider,{value:{message:t},children:e}),oB=()=>{const e=Z.useContext(rB);if(!e)throw new Error("useMessage must be used within a MessageProvider");return e},iB=["light","dark"],sB="(prefers-color-scheme: dark)",lB="undefined"==typeof window,cB=Z.createContext(void 0),uB={setColorMode:e=>{},colorModes:[]};function dB(e,t){const n=Z.useContext(cB)??uB;return"dark"===(n.forcedColorMode??n.resolvedColorMode)?t:e}const pB=e=>(Z.useContext(cB),Gh.jsx(fB,{...e})),hB=["light","dark"],fB=({forcedColorMode:e,disableTransitionOnChange:t=!1,enableSystem:n=!1,enableColorScheme:r=!0,storageKey:a="inkeep-colorMode",colorModes:o=hB,defaultColorMode:i=(n?"system":"light"),attribute:s="data-theme",value:l,children:c,nonce:u,shadowHostId:d,rootId:p})=>{const[h,f]=Z.useState((()=>gB(a,i))),[m,g]=Z.useState((()=>gB(a))),y=l?Object.values(l):o,b=Z.useCallback((e=>{var a;let o=e;if(!o)return;"system"===e&&n&&(o=bB());const c=l?l[o]:o,u=t?yB():null,h=d&&p&&(null==(a=document.getElementById(d))?void 0:a.shadowRoot),f=h?h.getElementById(p)??document.documentElement:document.documentElement;if("class"===s?(f.classList.remove(...y),c&&f.classList.add(c)):c?f.setAttribute(s,c):f.removeAttribute(s),r){const e=iB.includes(i)?i:null,t=iB.includes(o)?o:e;f.style.colorScheme=t}null==u||u()}),[]),v=Z.useCallback((e=>{f(e);try{localStorage.setItem(a,e)}catch(V4){}}),[e]),k=Z.useCallback((t=>{const r=bB(t);g(r),"system"===h&&n&&!e&&b("system")}),[h,e]);Z.useEffect((()=>{const e=window.matchMedia(sB);return e.addListener(k),k(e),()=>e.removeListener(k)}),[k]),Z.useEffect((()=>{const e=e=>{if(e.key!==a)return;const t=e.newValue||i;v(t)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[v]),Z.useEffect((()=>{b(e??h)}),[e,h]);const w=Z.useMemo((()=>({colorMode:h,setColorMode:v,forcedColorMode:e,resolvedColorMode:"system"===h?m:h,colorModes:n?[...o,"system"]:o,systemColorMode:n?m:void 0})),[h,v,e,m,n,o]);return Gh.jsxs(cB.Provider,{value:w,children:[Gh.jsx(mB,{forcedColorMode:e,disableTransitionOnChange:t,enableSystem:n,enableColorScheme:r,storageKey:a,colorModes:o,defaultColorMode:i,attribute:s,value:l,children:c,attrs:y,nonce:u,shadowHostId:d,rootId:p}),c]})},mB=Z.memo((({forcedColorMode:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultColorMode:o,value:i,attrs:s,nonce:l,shadowHostId:c,rootId:u})=>{const d="system"===o,p=(()=>{const e=c&&u?`document.getElementById('${c}').shadowRoot.getElementById('${u}')`:"document.documentElement";if("class"===n){return`var d=${e},c=d.classList;${`c.remove(${s.map((e=>`'${e}'`)).join(",")})`};`}return`var d=${e},n='${n}',s='setAttribute';`})(),h=(()=>{if(!a)return"";return(iB.includes(o)?o:null)?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e"})(),f=(e,t=!1,r=!0)=>{const o=i?i[e]:e,s=t?`${e}|| ''`:`'${o}'`;let l="";return a&&r&&!t&&iB.includes(e)&&(l+=`d.style.colorScheme = '${e}';`),"class"===n?l+=t||o?`c.add(${s})`:"null":o&&(l+=`d[s](n,${s})`),l},m=e?`!function(){${p}${f(e)}}()`:r?`!function(){try{${p}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${d})){var t='${sB}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${f(i?"x[e]":"e",!0)}}${d?"":`else{${f(o,!1,!1)}}`}${h}}catch(e){}}()`:`!function(){try{${p}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${f(i?"x[e]":"e",!0)}}else{${f(o,!1,!1)};}${h}}catch(t){}}();`;return Gh.jsx("script",{nonce:l,dangerouslySetInnerHTML:{__html:m}})}),(()=>!0)),gB=(e,t)=>{if(lB)return;let n;try{n=localStorage.getItem(e)||void 0}catch(V4){}return n||t},yB=()=>{const e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout((()=>{document.head.removeChild(e)}),1)}},bB=e=>{e||(e=window.matchMedia(sB));return e.matches?"dark":"light"};var vB=Object.prototype.hasOwnProperty;function kB(e,t,n){for(n of e.keys())if(wB(n,t))return n}function wB(e,t){var n,r,a;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&wB(e[r],t[r]););return-1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e){if((a=r)&&"object"==typeof a&&!(a=kB(t,a)))return!1;if(!t.has(a))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e){if((a=r[0])&&"object"==typeof a&&!(a=kB(t,a)))return!1;if(!wB(r[1],t.get(a)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return-1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}if(!n||"object"==typeof e){for(n in r=0,e){if(vB.call(e,n)&&++r&&!vB.call(t,n))return!1;if(!(n in t)||!wB(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}function xB(){const{baseSettings:e}=JO(),[t,n]=Z.useState([]),r=function(e){const t=Z.useRef(void 0);wB(t.current,e)||(t.current=e);return t.current}(e.theme.styles),{customStyles:a,linksCount:o}=Z.useMemo((()=>{if(!r||!Array.isArray(r))return{customStyles:null,loaded:!0};const{links:e,styleSheets:t}=r.reduce(((e,t)=>("link"===t.type?e.links.push(t):"style"===t.type&&e.styleSheets.push(t),e)),{links:[],styleSheets:[]}),a=t.map((e=>Gh.jsx("style",{type:"text/css",dangerouslySetInnerHTML:{__html:e.value}},e.key??Qh("link_")))),o=e.map((e=>{const t=e.key??Qh("stylesheet_");return Gh.jsx("link",{id:t,rel:"stylesheet",type:"text/css",href:e.value,onLoad:()=>{n((t=>[...new Set([...t,e.value])]))}},t)}));return{customStyles:Gh.jsxs(Gh.Fragment,{children:[o,a]}),linksCount:e.length}}),[r]);return{customStyles:a,loaded:t.length>=(o??0)}}const EB=({children:e})=>{const{baseSettings:t}=JO(),{theme:n,primaryBrandColor:r,shadowHost:a,rootElement:o,colorMode:i}=t,{primaryColors:s,varsClassName:l}=n,{disableLoadingDefaultFont:c,fontFamily:d,fontSize:p,zIndex:h}=n,f=_x(s,r),m=function(e){const t={};for(const[n,r]of Object.entries(e)){const e=Tx[n]||n,a=(n,r=[])=>{for(const[o,i]of Object.entries(n)){const n=[...r,o];if("object"==typeof i&&null!==i)a(i,n);else{const r=n.map((e=>e.replace(/([A-Z])/g,"-$1").toLowerCase())).join("-");t[`--ikp-${e}-${r}`]=i}}};a(r)}return t}({colors:u(n.colors,f),fontFamily:d,fontSize:p,zIndex:h}),{customStyles:g,loaded:y}=xB(),{sync:b,forcedColorMode:v,...k}=i??{},[w,x]=Z.useState(),E=Z.useRef(null);return Z.useEffect((()=>{var e,t;if(!(null==b?void 0:b.target))return;const n="string"==typeof b.target?document.querySelector(b.target):b.target;if(!n)return;function r(e,t){return t.reduce(((t,n)=>({...t,[n]:e.getAttribute(n)})),{})}const a=new MutationObserver((()=>{var e,t;const a=r(n,b.attributes),o=(null==(e=b.isDarkMode)?void 0:e.call(b,a))?"dark":"light";null==(t=b.onChange)||t.call(b,o),x(o)}));a.observe(n,{attributes:!0,attributeFilter:b.attributes,childList:!1,subtree:!1}),E.current=a;const o=(null==(e=b.isDarkMode)?void 0:e.call(b,r(n,null==b?void 0:b.attributes)))?"dark":"light";return null==(t=b.onChange)||t.call(b,o),x(o),()=>a.disconnect()}),[b]),Gh.jsxs(Gh.Fragment,{children:[!c&&Gh.jsx("style",{type:"text/css",dangerouslySetInnerHTML:{__html:"\n @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&display=swap');\n "}}),g,y&&Gh.jsx(pB,{forcedColorMode:v??w,...k,shadowHostId:null==a?void 0:a.id,rootId:null==o?void 0:o.id,children:Gh.jsx("div",{className:l,style:{display:"contents",...m},children:e})})]})};function _B(e){const{children:t,config:n,componentType:r}=e;return Gh.jsx(ZO,{value:{...n,componentType:r},children:Gh.jsx(EB,{children:Gh.jsx(dP,{children:Gh.jsx(fP,{children:t})})})})}const SB=Z.createContext(void 0),TB=({children:e,source:t})=>Gh.jsx(SB.Provider,{value:{source:t},children:e}),CB=()=>{const e=Z.useContext(SB);if(!e)throw new Error("useSourceItem must be used within a SourceItemProvider");return e};function AB(e){const t=Z.useRef(e);return Z.useEffect((()=>{t.current=e})),Z.useMemo((()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)}),[])}function NB({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,a]=function({defaultProp:e,onChange:t}){const n=Z.useState(e),[r]=n,a=Z.useRef(r),o=AB(t);return Z.useEffect((()=>{a.current!==r&&(o(r),a.current=r)}),[r,a,o]),n}({defaultProp:t,onChange:n}),o=void 0!==e,i=o?e:r,s=AB(n);return[i,Z.useCallback((t=>{if(o){const n="function"==typeof t?t(e):t;n!==e&&s(n)}else a(t)}),[o,e,a,s])]}const IB=Z.createContext(void 0),RB=({children:e,value:t})=>Gh.jsx(IB.Provider,{value:t,children:e}),OB=()=>{const e=Z.useContext(IB);if(!e)throw new Error("useSidebarChat must be used within a SidebarChatProvider");return e};function PB(e,t){var n;const{prefix:r}=JO(),a=Z.useContext(Zj),o=function(e,t){return!!(null==t?void 0:t.componentStyles)&&e in t.componentStyles}(e,a);return[t,o?null==(n=null==a?void 0:a.componentStyles)?void 0:n[e]:void 0,`${r}-${wD(e)}`].filter(Boolean).join(" ")}function LB(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function DB(...e){return t=>{let n=!1;const r=e.map((e=>{const r=LB(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():LB(e[t],null)}}}}function MB(...e){return Z.useCallback(DB(...e),e)}const FB=(...e)=>e.map((e=>{var t;return null==(t=null==e?void 0:e.trim)?void 0:t.call(e)})).filter(Boolean).join(" "),jB=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,BB=e=>{const t={};let n;for(;n=jB.exec(e);)t[n[1]]=n[2];return t},zB=(e,t)=>{if(kD(e)){if(kD(t))return`${e};${t}`;e=BB(e)}else kD(t)&&(t=BB(t));return Object.assign({},e??{},t??{})};function HB(...e){let t={};for(let n of e){for(let e in t)e.startsWith("on")&&"function"==typeof t[e]&&"function"==typeof n[e]?t[e]=vD(n[e],t[e]):t[e]="className"!==e&&"class"!==e?"style"!==e?void 0!==n[e]?n[e]:t[e]:zB(t[e],n[e]):FB(t[e],n[e]);for(let e in n)void 0===t[e]&&(t[e]=n[e])}return t}const UB=(e,t)=>{const n=Z.memo(Z.forwardRef(((n,r)=>{const{_id:a,className:o,children:i,...s}=t,{asChild:l,children:c,...u}=n,d=c||i,p=HB(s,u,{className:PB(a,o),"data-part":wD(a)});if(!l)return Z.createElement(e,{...p,ref:r},d);const h=Z.Children.only(d);if(!Z.isValidElement(h))return null;const f=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}(h);return Z.cloneElement(h,{...HB(p,h.props),ref:r?DB(r,f):f})})));return n.displayName=e.displayName||e.name,n},$B=new Proxy(UB,{apply(e,t,n){const r=n[0],a=n[1];return UB(r,a)}});function GB(){return GB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},GB.apply(null,arguments)}function VB(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}var qB=Z.useLayoutEffect,WB=function(e,t){"function"!=typeof e?e.current=t:e(t)},YB={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},KB=function(e){Object.keys(YB).forEach((function(t){e.style.setProperty(t,YB[t],"important")}))},XB=null,QB=function(e,t){var n=e.scrollHeight;return"border-box"===t.sizingStyle.boxSizing?n+t.borderSize:n-t.paddingSize};var ZB=function(){},JB=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],ez=!!document.documentElement.currentStyle,tz=function(e){var t=window.getComputedStyle(e);if(null===t)return null;var n,r=(n=t,JB.reduce((function(e,t){return e[t]=n[t],e}),{})),a=r.boxSizing;return""===a?null:(ez&&"border-box"===a&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px"),{sizingStyle:r,paddingSize:parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),borderSize:parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth)})};function nz(e,t,n){var r,a,o=(r=n,a=J.useRef(r),qB((function(){a.current=r})),a);Z.useLayoutEffect((function(){var n=function(e){return o.current(e)};if(e)return e.addEventListener(t,n),function(){return e.removeEventListener(t,n)}}),[])}var rz=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],az=function(e,t){var n=e.cacheMeasurements,r=e.maxRows,a=e.minRows,o=e.onChange,i=void 0===o?ZB:o,s=e.onHeightChange,l=void 0===s?ZB:s,c=VB(e,rz),u=void 0!==c.value,d=Z.useRef(null),p=function(e,t){var n=J.useRef();return J.useCallback((function(r){e.current=r,n.current&&WB(n.current,null),n.current=t,t&&WB(t,r)}),[t])}(d,t),h=Z.useRef(0),f=Z.useRef(),m=function(){var e=d.current,t=n&&f.current?f.current:tz(e);if(t){f.current=t;var o=function(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=1/0),XB||((XB=document.createElement("textarea")).setAttribute("tabindex","-1"),XB.setAttribute("aria-hidden","true"),KB(XB)),null===XB.parentNode&&document.body.appendChild(XB);var a=e.paddingSize,o=e.borderSize,i=e.sizingStyle,s=i.boxSizing;Object.keys(i).forEach((function(e){var t=e;XB.style[t]=i[t]})),KB(XB),XB.value=t;var l=QB(XB,e);XB.value=t,l=QB(XB,e),XB.value="x";var c=XB.scrollHeight-a,u=c*n;"border-box"===s&&(u=u+a+o),l=Math.max(u,l);var d=c*r;return"border-box"===s&&(d=d+a+o),[l=Math.min(d,l),c]}(t,e.value||e.placeholder||"x",a,r),i=o[0],s=o[1];h.current!==i&&(h.current=i,e.style.setProperty("height",i+"px","important"),l(i,{rowHeight:s}))}};return Z.useLayoutEffect(m),function(e,t){nz(document.body,"reset",(function(n){e.current.form===n.target&&t(n)}))}(d,(function(){if(!u){var e=d.current,t=e.value;requestAnimationFrame((function(){t!==e.value&&m()}))}})),nz(window,"resize",m),function(e){nz(document.fonts,"loadingdone",e)}(m),Z.createElement("textarea",GB({},c,{onChange:function(e){u||m(),i(e)},ref:p}))},oz=Z.forwardRef(az),iz="Avatar",[sz,lz]=DD(iz),[cz,uz]=sz(iz),dz=Z.forwardRef(((e,t)=>{const{__scopeAvatar:n,...r}=e,[a,o]=Z.useState("idle");return Gh.jsx(cz,{scope:n,imageLoadingStatus:a,onImageLoadingStatusChange:o,children:Gh.jsx(UD.span,{...r,ref:t})})}));dz.displayName=iz;var pz="AvatarImage",hz=Z.forwardRef(((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:a=()=>{},...o}=e,i=uz(pz,n),s=function(e,t){const[n,r]=Z.useState("idle");return eM((()=>{if(!e)return void r("error");let n=!0;const a=new window.Image,o=e=>()=>{n&&r(e)};return r("loading"),a.onload=o("loaded"),a.onerror=o("error"),a.src=e,t&&(a.referrerPolicy=t),()=>{n=!1}}),[e,t]),n}(r,o.referrerPolicy),l=$D((e=>{a(e),i.onImageLoadingStatusChange(e)}));return eM((()=>{"idle"!==s&&l(s)}),[s,l]),"loaded"===s?Gh.jsx(UD.img,{...o,ref:t,src:r}):null}));hz.displayName=pz;var fz="AvatarFallback",mz=Z.forwardRef(((e,t)=>{const{__scopeAvatar:n,delayMs:r,...a}=e,o=uz(fz,n),[i,s]=Z.useState(void 0===r);return Z.useEffect((()=>{if(void 0!==r){const e=window.setTimeout((()=>s(!0)),r);return()=>window.clearTimeout(e)}}),[r]),i&&"loaded"!==o.imageLoadingStatus?Gh.jsx(UD.span,{...a,ref:t}):null}));mz.displayName=fz;var gz=dz,yz=hz,bz=mz;var vz="Checkbox",[kz,wz]=DD(vz),[xz,Ez]=kz(vz),_z=Z.forwardRef(((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:o,required:i,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=e,[p,h]=Z.useState(null),f=LD(t,(e=>h(e))),m=Z.useRef(!1),g=!p||(u||!!p.closest("form")),[y=!1,b]=ij({prop:a,defaultProp:o,onChange:c}),v=Z.useRef(y);return Z.useEffect((()=>{const e=null==p?void 0:p.form;if(e){const t=()=>b(v.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}}),[p,b]),Gh.jsxs(xz,{scope:n,state:y,disabled:s,children:[Gh.jsx(UD.button,{type:"button",role:"checkbox","aria-checked":Az(y)?"mixed":y,"aria-required":i,"data-state":Nz(y),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:f,onKeyDown:RD(e.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:RD(e.onClick,(e=>{b((e=>!!Az(e)||!e)),g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())}))}),g&&Gh.jsx(Cz,{control:p,bubbles:!m.current,name:r,value:l,checked:y,required:i,disabled:s,form:u,style:{transform:"translateX(-100%)"},defaultChecked:!Az(o)&&o})]})}));_z.displayName=vz;var Sz="CheckboxIndicator",Tz=Z.forwardRef(((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,o=Ez(Sz,n);return Gh.jsx(aj,{present:r||Az(o.state)||!0===o.state,children:Gh.jsx(UD.span,{"data-state":Nz(o.state),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})}));Tz.displayName=Sz;var Cz=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:a,...o}=e,i=Z.useRef(null),s=function(e){const t=Z.useRef({value:e,previous:e});return Z.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}(n),l=DF(t);Z.useEffect((()=>{const e=i.current,t=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(t,"checked").set;if(s!==n&&a){const t=new Event("click",{bubbles:r});e.indeterminate=Az(n),a.call(e,!Az(n)&&n),e.dispatchEvent(t)}}),[s,n,r]);const c=Z.useRef(!Az(n)&&n);return Gh.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a??c.current,...o,tabIndex:-1,ref:i,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Az(e){return"indeterminate"===e}function Nz(e){return Az(e)?"indeterminate":e?"checked":"unchecked"}var Iz=_z,Rz=Tz,Oz=Z.forwardRef(((e,t)=>{const{children:n,...r}=e,a=Z.Children.toArray(n),o=a.find(Dz);if(o){const e=o.props.children,n=a.map((t=>t===o?Z.Children.count(e)>1?Z.Children.only(null):Z.isValidElement(e)?e.props.children:null:t));return Gh.jsx(Pz,{...r,ref:t,children:Z.isValidElement(e)?Z.cloneElement(e,void 0,n):null})}return Gh.jsx(Pz,{...r,ref:t,children:n})}));Oz.displayName="Slot";var Pz=Z.forwardRef(((e,t)=>{const{children:n,...r}=e;if(Z.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;if(a)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a)return e.props.ref;return e.props.ref||e.ref}(n),a=function(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...e)=>{o(...e),a(...e)}:a&&(n[r]=a):"style"===r?n[r]={...a,...o}:"className"===r&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==Z.Fragment&&(a.ref=t?PD(t,e):e),Z.cloneElement(n,a)}return Z.Children.count(n)>1?Z.Children.only(null):null}));Pz.displayName="SlotClone";var Lz=({children:e})=>Gh.jsx(Gh.Fragment,{children:e});function Dz(e){return Z.isValidElement(e)&&e.type===Lz}var Mz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=Z.forwardRef(((e,n)=>{const{asChild:r,...a}=e,o=r?Oz:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),Gh.jsx(o,{...a,ref:n})}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});var Fz,jz="dismissableLayer.update",Bz="dismissableLayer.pointerDownOutside",zz="dismissableLayer.focusOutside",Hz=Z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Uz=Z.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:i,onDismiss:s,...l}=e,c=Z.useContext(Hz),[u,d]=Z.useState(null),p=(null==u?void 0:u.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,h]=Z.useState({}),f=LD(t,(e=>d(e))),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(g),b=u?m.indexOf(u):-1,v=c.layersWithOutsidePointerEventsDisabled.size>0,k=b>=y,w=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=$D(e),r=Z.useRef(!1),a=Z.useRef((()=>{}));return Z.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){Vz(Bz,n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=r,t.addEventListener("click",a.current,{once:!0})):r()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...c.branches].some((e=>e.contains(t)));k&&!n&&(null==a||a(e),null==i||i(e),e.defaultPrevented||null==s||s())}),p),x=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=$D(e),r=Z.useRef(!1);return Z.useEffect((()=>{const e=e=>{if(e.target&&!r.current){Vz(zz,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...c.branches].some((e=>e.contains(t)))||(null==o||o(e),null==i||i(e),e.defaultPrevented||null==s||s())}),p);return GD((e=>{b===c.layers.size-1&&(null==r||r(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),p),Z.useEffect((()=>{if(u)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(Fz=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Gz(),()=>{n&&1===c.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=Fz)}}),[u,p,n,c]),Z.useEffect((()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Gz())}),[u,c]),Z.useEffect((()=>{const e=()=>h({});return document.addEventListener(jz,e),()=>document.removeEventListener(jz,e)}),[]),Gh.jsx(Mz.div,{...l,ref:f,style:{pointerEvents:v?k?"auto":"none":void 0,...e.style},onFocusCapture:RD(e.onFocusCapture,x.onFocusCapture),onBlurCapture:RD(e.onBlurCapture,x.onBlurCapture),onPointerDownCapture:RD(e.onPointerDownCapture,w.onPointerDownCapture)})}));Uz.displayName="DismissableLayer";var $z=Z.forwardRef(((e,t)=>{const n=Z.useContext(Hz),r=Z.useRef(null),a=LD(t,r);return Z.useEffect((()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),Gh.jsx(Mz.div,{...e,ref:a})}));function Gz(){const e=new CustomEvent(jz);document.dispatchEvent(e)}function Vz(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?function(e,t){e&&ue.flushSync((()=>e.dispatchEvent(t)))}(a,o):a.dispatchEvent(o)}$z.displayName="DismissableLayerBranch";var qz=0;function Wz(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Yz="focusScope.autoFocusOnMount",Kz="focusScope.autoFocusOnUnmount",Xz={bubbles:!1,cancelable:!0},Qz=Z.forwardRef(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...i}=e,[s,l]=Z.useState(null),c=$D(a),u=$D(o),d=Z.useRef(null),p=LD(t,(e=>l(e))),h=Z.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Z.useEffect((()=>{if(r){let e=function(e){if(h.paused||!s)return;const t=e.target;s.contains(t)?d.current=t:tH(d.current,{select:!0})},t=function(e){if(h.paused||!s)return;const t=e.relatedTarget;null!==t&&(s.contains(t)||tH(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&tH(s)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[r,s,h.paused]),Z.useEffect((()=>{if(s){nH.add(h);const t=document.activeElement;if(!s.contains(t)){const n=new CustomEvent(Yz,Xz);s.addEventListener(Yz,c),s.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(tH(r,{select:t}),document.activeElement!==n)return}((e=Zz(s),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&tH(s))}return()=>{s.removeEventListener(Yz,c),setTimeout((()=>{const e=new CustomEvent(Kz,Xz);s.addEventListener(Kz,u),s.dispatchEvent(e),e.defaultPrevented||tH(t??document.body,{select:!0}),s.removeEventListener(Kz,u),nH.remove(h)}),0)}}var e}),[s,c,u,h]);const f=Z.useCallback((e=>{if(!n&&!r)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,a=document.activeElement;if(t&&a){const t=e.currentTarget,[r,o]=function(e){const t=Zz(e),n=Jz(t,e),r=Jz(t.reverse(),e);return[n,r]}(t);r&&o?e.shiftKey||a!==o?e.shiftKey&&a===r&&(e.preventDefault(),n&&tH(o,{select:!0})):(e.preventDefault(),n&&tH(r,{select:!0})):a===t&&e.preventDefault()}}),[n,r,h.paused]);return Gh.jsx(Mz.div,{tabIndex:-1,...i,ref:p,onKeyDown:f})}));function Zz(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Jz(e,t){for(const n of e)if(!eH(n,{upTo:t}))return n}function eH(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function tH(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}Qz.displayName="FocusScope";var nH=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=rH(e,t),e.unshift(t)},remove(t){var n;e=rH(e,t),null==(n=e[0])||n.resume()}}}();function rH(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var aH=Z.forwardRef(((e,t)=>{const{children:n,width:r=10,height:a=5,...o}=e;return Gh.jsx(Mz.svg,{...o,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:Gh.jsx("polygon",{points:"0,0 30,0 15,10"})})}));aH.displayName="Arrow";var oH=aH,iH="Popper",[sH,lH]=DD(iH),[cH,uH]=sH(iH),dH=e=>{const{__scopePopper:t,children:n}=e,[r,a]=Z.useState(null);return Gh.jsx(cH,{scope:t,anchor:r,onAnchorChange:a,children:n})};dH.displayName=iH;var pH="PopperAnchor",hH=Z.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=uH(pH,n),i=Z.useRef(null),s=LD(t,i);return Z.useEffect((()=>{o.onAnchorChange((null==r?void 0:r.current)||i.current)})),r?null:Gh.jsx(Mz.div,{...a,ref:s})}));hH.displayName=pH;var fH="PopperContent",[mH,gH]=sH(fH),yH=Z.forwardRef(((e,t)=>{var n,r,a,o,i,s;const{__scopePopper:l,side:c="bottom",sideOffset:u=0,align:d="center",alignOffset:p=0,arrowPadding:h=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:b=!1,updatePositionStrategy:v="optimized",onPlaced:k,...w}=e,x=uH(fH,l),[E,_]=Z.useState(null),S=LD(t,(e=>_(e))),[T,C]=Z.useState(null),A=DF(T),N=(null==A?void 0:A.width)??0,I=(null==A?void 0:A.height)??0,R=c+("center"!==d?"-"+d:""),O="number"==typeof g?g:{top:0,right:0,bottom:0,left:0,...g},P=Array.isArray(m)?m:[m],L=P.length>0,D={padding:O,boundary:P.filter(wH),altBoundary:L},{refs:M,floatingStyles:F,placement:j,isPositioned:B,middlewareData:z}=_F({strategy:"fixed",placement:R,whileElementsMounted:(...e)=>uF(...e,{animationFrame:"always"===v}),elements:{reference:x.anchor},middleware:[TF({mainAxis:u+I,alignmentAxis:p}),f&&CF({mainAxis:!0,crossAxis:!1,limiter:"partial"===y?AF():void 0,...D}),f&&NF({...D}),IF({...D,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:a,height:o}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${a}px`),i.setProperty("--radix-popper-anchor-height",`${o}px`)}}),T&&OF({element:T,padding:h}),xH({arrowWidth:N,arrowHeight:I}),b&&RF({strategy:"referenceHidden",...D})]}),[H,U]=EH(j),$=$D(k);eM((()=>{B&&(null==$||$())}),[B,$]);const G=null==(n=z.arrow)?void 0:n.x,V=null==(r=z.arrow)?void 0:r.y,q=0!==(null==(a=z.arrow)?void 0:a.centerOffset),[W,Y]=Z.useState();return eM((()=>{E&&Y(window.getComputedStyle(E).zIndex)}),[E]),Gh.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:B?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[null==(o=z.transformOrigin)?void 0:o.x,null==(i=z.transformOrigin)?void 0:i.y].join(" "),...(null==(s=z.hide)?void 0:s.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:Gh.jsx(mH,{scope:l,placedSide:H,onArrowChange:C,arrowX:G,arrowY:V,shouldHideArrow:q,children:Gh.jsx(Mz.div,{"data-side":H,"data-align":U,...w,ref:S,style:{...w.style,animation:B?void 0:"none"}})})})}));yH.displayName=fH;var bH="PopperArrow",vH={top:"bottom",right:"left",bottom:"top",left:"right"},kH=Z.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,a=gH(bH,n),o=vH[a.placedSide];return Gh.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:Gh.jsx(oH,{...r,ref:t,style:{...r.style,display:"block"}})})}));function wH(e){return null!==e}kH.displayName=bH;var xH=e=>({name:"transformOrigin",options:e,fn(t){var n,r,a;const{placement:o,rects:i,middlewareData:s}=t,l=0!==(null==(n=s.arrow)?void 0:n.centerOffset),c=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[d,p]=EH(o),h={start:"0%",center:"50%",end:"100%"}[p],f=((null==(r=s.arrow)?void 0:r.x)??0)+c/2,m=((null==(a=s.arrow)?void 0:a.y)??0)+u/2;let g="",y="";return"bottom"===d?(g=l?h:`${f}px`,y=-u+"px"):"top"===d?(g=l?h:`${f}px`,y=`${i.floating.height+u}px`):"right"===d?(g=-u+"px",y=l?h:`${m}px`):"left"===d&&(g=`${i.floating.width+u}px`,y=l?h:`${m}px`),{data:{x:g,y:y}}}});function EH(e){const[t,n="center"]=e.split("-");return[t,n]}var _H=dH,SH=hH,TH=yH,CH=kH,AH=new WeakMap,NH=new WeakMap,IH={},RH=0,OH=function(e){return e&&(e.host||OH(e.parentNode))},PH=function(e,t,n,r){var a=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=OH(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);IH[n]||(IH[n]=new WeakMap);var o=IH[n],i=[],s=new Set,l=new Set(a),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};a.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),a=null!==t&&"false"!==t,l=(AH.get(e)||0)+1,c=(o.get(e)||0)+1;AH.set(e,l),o.set(e,c),i.push(e),1===l&&a&&NH.set(e,!0),1===c&&e.setAttribute(n,"true"),a||e.setAttribute(r,"true")}catch(V4){console.error("aria-hidden: cannot operate on ",e,V4)}}))};return u(t),s.clear(),RH++,function(){i.forEach((function(e){var t=AH.get(e)-1,a=o.get(e)-1;AH.set(e,t),o.set(e,a),t||(NH.has(e)||e.removeAttribute(r),NH.delete(e)),a||e.removeAttribute(n)})),--RH||(AH=new WeakMap,AH=new WeakMap,NH=new WeakMap,IH={})}},LH=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),PH(r,a,n,"aria-hidden")):function(){return null}},DH=function(){return DH=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},DH.apply(this,arguments)};function MH(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}function FH(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a<o;a++)!r&&a in t||(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var jH="right-scroll-bar-position",BH="width-before-scroll-bar";function zH(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var HH="undefined"!=typeof window?Z.useLayoutEffect:Z.useEffect,UH=new WeakMap;function $H(e,t){var n,r,a,o=(n=null,r=function(t){return e.forEach((function(e){return zH(e,t)}))},(a=Z.useState((function(){return{value:n,callback:r,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}}))[0]).callback=r,a.facade);return HH((function(){var t=UH.get(o);if(t){var n=new Set(t),r=new Set(e),a=o.current;n.forEach((function(e){r.has(e)||zH(e,null)})),r.forEach((function(e){n.has(e)||zH(e,a)}))}UH.set(o,e)}),[e]),o}function GH(e){return e}var VH=function(e){var t=e.sideCar,n=MH(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return Z.createElement(r,DH({},n))};VH.isSideCarExport=!0;var qH=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=GH);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var a=t(e,r);return n.push(a),function(){n=n.filter((function(e){return e!==a}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var a=n;n=[],a.forEach(e),t=n}var o=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(o)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=DH({async:!0,ssr:!1},e),t}(),WH=function(){},YH=Z.forwardRef((function(e,t){var n=Z.useRef(null),r=Z.useState({onScrollCapture:WH,onWheelCapture:WH,onTouchMoveCapture:WH}),a=r[0],o=r[1],i=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,p=e.sideCar,h=e.noRelative,f=e.noIsolation,m=e.inert,g=e.allowPinchZoom,y=e.as,b=void 0===y?"div":y,v=e.gapMode,k=MH(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=p,x=$H([n,t]),E=DH(DH({},k),a);return Z.createElement(Z.Fragment,null,u&&Z.createElement(w,{sideCar:qH,removeScrollBar:c,shards:d,noRelative:h,noIsolation:f,inert:m,setCallbacks:o,allowPinchZoom:!!g,lockRef:n,gapMode:v}),i?Z.cloneElement(Z.Children.only(s),DH(DH({},E),{ref:x})):Z.createElement(b,DH({},E,{className:l,ref:x}),s))}));YH.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},YH.classNames={fullWidth:BH,zeroRight:jH};function KH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var XH=function(){var e=0,t=null;return{add:function(n){var r,a;0==e&&(t=KH())&&(a=n,(r=t).styleSheet?r.styleSheet.cssText=a:r.appendChild(document.createTextNode(a)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},QH=function(){var e,t=(e=XH(),function(t,n){Z.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},ZH={left:0,top:0,right:0,gap:0},JH=function(e){return parseInt(e||"",10)||0},eU=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return ZH;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[JH(n),JH(r),JH(a)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},tU=QH(),nU="data-scroll-locked",rU=function(e,t,n,r){var a=e.left,o=e.top,i=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(nU,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(jH," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(BH," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(jH," .").concat(jH," {\n right: 0 ").concat(r,";\n }\n \n .").concat(BH," .").concat(BH," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(nU,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},aU=function(){var e=parseInt(document.body.getAttribute(nU)||"0",10);return isFinite(e)?e:0},oU=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=void 0===r?"margin":r;Z.useEffect((function(){return document.body.setAttribute(nU,(aU()+1).toString()),function(){var e=aU()-1;e<=0?document.body.removeAttribute(nU):document.body.setAttribute(nU,e.toString())}}),[]);var o=Z.useMemo((function(){return eU(a)}),[a]);return Z.createElement(tU,{styles:rU(o,!t,a,n?"":"!important")})},iU=!1;if("undefined"!=typeof window)try{var sU=Object.defineProperty({},"passive",{get:function(){return iU=!0,!0}});window.addEventListener("test",sU,sU),window.removeEventListener("test",sU,sU)}catch(kbe){iU=!1}var lU=!!iU&&{passive:!1},cU=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},uU=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),dU(e,r)){var a=pU(e,r);if(a[1]>a[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},dU=function(e,t){return"v"===e?function(e){return cU(e,"overflowY")}(t):function(e){return cU(e,"overflowX")}(t)},pU=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},hU=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fU=function(e){return[e.deltaX,e.deltaY]},mU=function(e){return e&&"current"in e?e.current:e},gU=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},yU=0,bU=[];function vU(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const kU=(wU=function(e){var t=Z.useRef([]),n=Z.useRef([0,0]),r=Z.useRef(),a=Z.useState(yU++)[0],o=Z.useState(QH)[0],i=Z.useRef(e);Z.useEffect((function(){i.current=e}),[e]),Z.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=FH([e.lockRef.current],(e.shards||[]).map(mU),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(a))})),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(a))}))}}}),[e.inert,e.lockRef.current,e.shards]);var s=Z.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var a,o=hU(e),s=n.current,l="deltaX"in e?e.deltaX:s[0]-o[0],c="deltaY"in e?e.deltaY:s[1]-o[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var p=uU(d,u);if(!p)return!0;if(p?a=d:(a="v"===d?"h":"v",p=uU(d,u)),!p)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=a),!a)return!0;var h=r.current||a;return function(e,t,n,r){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),o=a*r,i=n.target,s=t.contains(i),l=!1,c=o>0,u=0,d=0;do{if(!i)break;var p=pU(e,i),h=p[0],f=p[1]-p[2]-a*h;(h||f)&&dU(e,i)&&(u+=f,d+=h);var m=i.parentNode;i=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(c&&Math.abs(u)<1||!c&&Math.abs(d)<1)&&(l=!0),l}(h,t,e,"h"===h?l:c)}),[]),l=Z.useCallback((function(e){var n=e;if(bU.length&&bU[bU.length-1]===o){var r="deltaY"in n?fU(n):hU(n),a=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,a=r,t[0]===a[0]&&t[1]===a[1]);var t,a}))[0];if(a&&a.should)n.cancelable&&n.preventDefault();else if(!a){var l=(i.current.shards||[]).map(mU).filter(Boolean).filter((function(e){return e.contains(n.target)}));(l.length>0?s(n,l[0]):!i.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),c=Z.useCallback((function(e,n,r,a){var o={name:e,delta:n,target:r,should:a,shadowParent:vU(r)};t.current.push(o),setTimeout((function(){t.current=t.current.filter((function(e){return e!==o}))}),1)}),[]),u=Z.useCallback((function(e){n.current=hU(e),r.current=void 0}),[]),d=Z.useCallback((function(t){c(t.type,fU(t),t.target,s(t,e.lockRef.current))}),[]),p=Z.useCallback((function(t){c(t.type,hU(t),t.target,s(t,e.lockRef.current))}),[]);Z.useEffect((function(){return bU.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,lU),document.addEventListener("touchmove",l,lU),document.addEventListener("touchstart",u,lU),function(){bU=bU.filter((function(e){return e!==o})),document.removeEventListener("wheel",l,lU),document.removeEventListener("touchmove",l,lU),document.removeEventListener("touchstart",u,lU)}}),[]);var h=e.removeScrollBar,f=e.inert;return Z.createElement(Z.Fragment,null,f?Z.createElement(o,{styles:gU(a)}):null,h?Z.createElement(oU,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},qH.useMedium(wU),VH);var wU,xU=Z.forwardRef((function(e,t){return Z.createElement(YH,DH({},e,{ref:t,sideCar:kU}))}));xU.classNames=YH.classNames;var EU="Popover",[_U,SU]=DD(EU,[lH]),TU=lH(),[CU,AU]=_U(EU),NU=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:i=!1}=e,s=TU(t),l=Z.useRef(null),[c,u]=Z.useState(!1),[d=!1,p]=ij({prop:r,defaultProp:a,onChange:o});return Gh.jsx(_H,{...s,children:Gh.jsx(CU,{scope:t,contentId:rM(),triggerRef:l,open:d,onOpenChange:p,onOpenToggle:Z.useCallback((()=>p((e=>!e))),[p]),hasCustomAnchor:c,onCustomAnchorAdd:Z.useCallback((()=>u(!0)),[]),onCustomAnchorRemove:Z.useCallback((()=>u(!1)),[]),modal:i,children:n})})};NU.displayName=EU;var IU="PopoverAnchor",RU=Z.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,a=AU(IU,n),o=TU(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:s}=a;return Z.useEffect((()=>(i(),()=>s())),[i,s]),Gh.jsx(SH,{...o,...r,ref:t})}));RU.displayName=IU;var OU="PopoverTrigger",PU=Z.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,a=AU(OU,n),o=TU(n),i=LD(t,a.triggerRef),s=Gh.jsx(Mz.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":GU(a.open),...r,ref:i,onClick:RD(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?s:Gh.jsx(SH,{asChild:!0,...o,children:s})}));PU.displayName=OU;var[LU,DU]=_U("PopoverPortal",{forceMount:void 0}),MU="PopoverContent",FU=Z.forwardRef(((e,t)=>{const n=DU(MU,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,o=AU(MU,e.__scopePopover);return Gh.jsx(aj,{present:r||o.open,children:o.modal?Gh.jsx(jU,{...a,ref:t}):Gh.jsx(BU,{...a,ref:t})})}));FU.displayName=MU;var jU=Z.forwardRef(((e,t)=>{const n=AU(MU,e.__scopePopover),r=Z.useRef(null),a=LD(t,r),o=Z.useRef(!1);return Z.useEffect((()=>{const e=r.current;if(e)return LH(e)}),[]),Gh.jsx(xU,{as:Oz,allowPinchZoom:!0,children:Gh.jsx(zU,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:RD(e.onCloseAutoFocus,(e=>{var t;e.preventDefault(),o.current||null==(t=n.triggerRef.current)||t.focus()})),onPointerDownOutside:RD(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;o.current=r}),{checkForDefaultPrevented:!1}),onFocusOutside:RD(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})})})),BU=Z.forwardRef(((e,t)=>{const n=AU(MU,e.__scopePopover),r=Z.useRef(!1),a=Z.useRef(!1);return Gh.jsx(zU,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var o,i;null==(o=e.onCloseAutoFocus)||o.call(e,t),t.defaultPrevented||(r.current||null==(i=n.triggerRef.current)||i.focus(),t.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:t=>{var o,i;null==(o=e.onInteractOutside)||o.call(e,t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const s=t.target;(null==(i=n.triggerRef.current)?void 0:i.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})})),zU=Z.forwardRef(((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:i,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,p=AU(MU,n),h=TU(n);return Z.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Wz()),document.body.insertAdjacentElement("beforeend",e[1]??Wz()),qz++,()=>{1===qz&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),qz--}}),[]),Gh.jsx(Qz,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:Gh.jsx(Uz,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:Gh.jsx(TH,{"data-state":GU(p.open),role:"dialog",id:p.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})),HU="PopoverClose",UU=Z.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,a=AU(HU,n);return Gh.jsx(Mz.button,{type:"button",...r,ref:t,onClick:RD(e.onClick,(()=>a.onOpenChange(!1)))})}));UU.displayName=HU;var $U=Z.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,a=TU(n);return Gh.jsx(CH,{...a,...r,ref:t})}));function GU(e){return e?"open":"closed"}$U.displayName="PopoverArrow";var VU=NU,qU=PU,WU=FU,YU=$U,KU=Z.createContext(void 0);var XU="ScrollArea",[QU,ZU]=DD(XU),[JU,e$]=QU(XU),t$=Z.forwardRef(((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:o=600,...i}=e,[s,l]=Z.useState(null),[c,u]=Z.useState(null),[d,p]=Z.useState(null),[h,f]=Z.useState(null),[m,g]=Z.useState(null),[y,b]=Z.useState(0),[v,k]=Z.useState(0),[w,x]=Z.useState(!1),[E,_]=Z.useState(!1),S=LD(t,(e=>l(e))),T=function(e){const t=Z.useContext(KU);return e||t||"ltr"}(a);return Gh.jsx(JU,{scope:n,type:r,dir:T,scrollHideDelay:o,scrollArea:s,viewport:c,onViewportChange:u,content:d,onContentChange:p,scrollbarX:h,onScrollbarXChange:f,scrollbarXEnabled:w,onScrollbarXEnabledChange:x,scrollbarY:m,onScrollbarYChange:g,scrollbarYEnabled:E,onScrollbarYEnabledChange:_,onCornerWidthChange:b,onCornerHeightChange:k,children:Gh.jsx(UD.div,{dir:T,...i,ref:S,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":v+"px",...e.style}})})}));t$.displayName=XU;var n$="ScrollAreaViewport",r$=Z.forwardRef(((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...o}=e,i=e$(n$,n),s=LD(t,Z.useRef(null),i.onViewportChange);return Gh.jsxs(Gh.Fragment,{children:[Gh.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),Gh.jsx(UD.div,{"data-radix-scroll-area-viewport":"",...o,ref:s,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:Gh.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})}));r$.displayName=n$;var a$="ScrollAreaScrollbar",o$=Z.forwardRef(((e,t)=>{const{forceMount:n,...r}=e,a=e$(a$,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=a,s="horizontal"===e.orientation;return Z.useEffect((()=>(s?o(!0):i(!0),()=>{s?o(!1):i(!1)})),[s,o,i]),"hover"===a.type?Gh.jsx(i$,{...r,ref:t,forceMount:n}):"scroll"===a.type?Gh.jsx(s$,{...r,ref:t,forceMount:n}):"auto"===a.type?Gh.jsx(l$,{...r,ref:t,forceMount:n}):"always"===a.type?Gh.jsx(c$,{...r,ref:t}):null}));o$.displayName=a$;var i$=Z.forwardRef(((e,t)=>{const{forceMount:n,...r}=e,a=e$(a$,e.__scopeScrollArea),[o,i]=Z.useState(!1);return Z.useEffect((()=>{const e=a.scrollArea;let t=0;if(e){const n=()=>{window.clearTimeout(t),i(!0)},r=()=>{t=window.setTimeout((()=>i(!1)),a.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}}),[a.scrollArea,a.scrollHideDelay]),Gh.jsx(aj,{present:n||o,children:Gh.jsx(l$,{"data-state":o?"visible":"hidden",...r,ref:t})})})),s$=Z.forwardRef(((e,t)=>{const{forceMount:n,...r}=e,a=e$(a$,e.__scopeScrollArea),o="horizontal"===e.orientation,i=A$((()=>l("SCROLL_END")),100),[s,l]=(c="hidden",u={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},Z.useReducer(((e,t)=>u[e][t]??e),c));var c,u;return Z.useEffect((()=>{if("idle"===s){const e=window.setTimeout((()=>l("HIDE")),a.scrollHideDelay);return()=>window.clearTimeout(e)}}),[s,a.scrollHideDelay,l]),Z.useEffect((()=>{const e=a.viewport,t=o?"scrollLeft":"scrollTop";if(e){let n=e[t];const r=()=>{const r=e[t];n!==r&&(l("SCROLL"),i()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}}),[a.viewport,o,l,i]),Gh.jsx(aj,{present:n||"hidden"!==s,children:Gh.jsx(c$,{"data-state":"hidden"===s?"hidden":"visible",...r,ref:t,onPointerEnter:RD(e.onPointerEnter,(()=>l("POINTER_ENTER"))),onPointerLeave:RD(e.onPointerLeave,(()=>l("POINTER_LEAVE")))})})})),l$=Z.forwardRef(((e,t)=>{const n=e$(a$,e.__scopeScrollArea),{forceMount:r,...a}=e,[o,i]=Z.useState(!1),s="horizontal"===e.orientation,l=A$((()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;i(s?e:t)}}),10);return N$(n.viewport,l),N$(n.content,l),Gh.jsx(aj,{present:r||o,children:Gh.jsx(c$,{"data-state":o?"visible":"hidden",...a,ref:t})})})),c$=Z.forwardRef(((e,t)=>{const{orientation:n="vertical",...r}=e,a=e$(a$,e.__scopeScrollArea),o=Z.useRef(null),i=Z.useRef(0),[s,l]=Z.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=x$(s.viewport,s.content),u={...r,sizes:s,onSizesChange:l,hasThumb:Boolean(c>0&&c<1),onThumbChange:e=>o.current=e,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:e=>i.current=e};function d(e,t){return function(e,t,n,r="ltr"){const a=E$(n),o=a/2,i=t||o,s=a-i,l=n.scrollbar.paddingStart+i,c=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d="ltr"===r?[0,u]:[-1*u,0];return S$([l,c],d)(e)}(e,i.current,s,t)}return"horizontal"===n?Gh.jsx(u$,{...u,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const e=_$(a.viewport.scrollLeft,s,a.dir);o.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=d(e,a.dir))}}):"vertical"===n?Gh.jsx(d$,{...u,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const e=_$(a.viewport.scrollTop,s);o.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=d(e))}}):null})),u$=Z.forwardRef(((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=e$(a$,e.__scopeScrollArea),[i,s]=Z.useState(),l=Z.useRef(null),c=LD(t,l,o.onScrollbarXChange);return Z.useEffect((()=>{l.current&&s(getComputedStyle(l.current))}),[l]),Gh.jsx(f$,{"data-orientation":"horizontal",...a,ref:c,sizes:n,style:{bottom:0,left:"rtl"===o.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===o.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":E$(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(o.viewport){const r=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),T$(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:w$(i.paddingLeft),paddingEnd:w$(i.paddingRight)}})}})})),d$=Z.forwardRef(((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=e$(a$,e.__scopeScrollArea),[i,s]=Z.useState(),l=Z.useRef(null),c=LD(t,l,o.onScrollbarYChange);return Z.useEffect((()=>{l.current&&s(getComputedStyle(l.current))}),[l]),Gh.jsx(f$,{"data-orientation":"vertical",...a,ref:c,sizes:n,style:{top:0,right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":E$(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(o.viewport){const r=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),T$(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:w$(i.paddingTop),paddingEnd:w$(i.paddingBottom)}})}})})),[p$,h$]=QU(a$),f$=Z.forwardRef(((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...p}=e,h=e$(a$,n),[f,m]=Z.useState(null),g=LD(t,(e=>m(e))),y=Z.useRef(null),b=Z.useRef(""),v=h.viewport,k=r.content-r.viewport,w=$D(u),x=$D(l),E=A$(d,10);function _(e){if(y.current){const t=e.clientX-y.current.left,n=e.clientY-y.current.top;c({x:t,y:n})}}return Z.useEffect((()=>{const e=e=>{const t=e.target;(null==f?void 0:f.contains(t))&&w(e,k)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})}),[v,f,k,w]),Z.useEffect(x,[r,x]),N$(f,E),N$(h.content,E),Gh.jsx(p$,{scope:n,scrollbar:f,hasThumb:a,onThumbChange:$D(o),onThumbPointerUp:$D(i),onThumbPositionChange:x,onThumbPointerDown:$D(s),children:Gh.jsx(UD.div,{...p,ref:g,style:{position:"absolute",...p.style},onPointerDown:RD(e.onPointerDown,(e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),y.current=f.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),_(e)}})),onPointerMove:RD(e.onPointerMove,_),onPointerUp:RD(e.onPointerUp,(e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=b.current,h.viewport&&(h.viewport.style.scrollBehavior=""),y.current=null}))})})})),m$="ScrollAreaThumb",g$=Z.forwardRef(((e,t)=>{const{forceMount:n,...r}=e,a=h$(m$,e.__scopeScrollArea);return Gh.jsx(aj,{present:n||a.hasThumb,children:Gh.jsx(y$,{ref:t,...r})})})),y$=Z.forwardRef(((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,o=e$(m$,n),i=h$(m$,n),{onThumbPositionChange:s}=i,l=LD(t,(e=>i.onThumbChange(e))),c=Z.useRef(void 0),u=A$((()=>{c.current&&(c.current(),c.current=void 0)}),100);return Z.useEffect((()=>{const e=o.viewport;if(e){const t=()=>{if(u(),!c.current){const t=C$(e,s);c.current=t,s()}};return s(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}}),[o.viewport,u,s]),Gh.jsx(UD.div,{"data-state":i.hasThumb?"visible":"hidden",...a,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:RD(e.onPointerDownCapture,(e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;i.onThumbPointerDown({x:n,y:r})})),onPointerUp:RD(e.onPointerUp,i.onThumbPointerUp)})}));g$.displayName=m$;var b$="ScrollAreaCorner",v$=Z.forwardRef(((e,t)=>{const n=e$(b$,e.__scopeScrollArea),r=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&r?Gh.jsx(k$,{...e,ref:t}):null}));v$.displayName=b$;var k$=Z.forwardRef(((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=e$(b$,n),[o,i]=Z.useState(0),[s,l]=Z.useState(0),c=Boolean(o&&s);return N$(a.scrollbarX,(()=>{var e;const t=(null==(e=a.scrollbarX)?void 0:e.offsetHeight)||0;a.onCornerHeightChange(t),l(t)})),N$(a.scrollbarY,(()=>{var e;const t=(null==(e=a.scrollbarY)?void 0:e.offsetWidth)||0;a.onCornerWidthChange(t),i(t)})),c?Gh.jsx(UD.div,{...r,ref:t,style:{width:o,height:s,position:"absolute",right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:0,...e.style}}):null}));function w$(e){return e?parseInt(e,10):0}function x$(e,t){const n=e/t;return isNaN(n)?0:n}function E$(e){const t=x$(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function _$(e,t,n="ltr"){const r=E$(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,i=t.content-t.viewport,s=o-r,l=function(e,[t,n]){return Math.min(n,Math.max(t,e))}(e,"ltr"===n?[0,i]:[-1*i,0]);return S$([0,i],[0,s])(l)}function S$(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function T$(e,t){return e>0&&e<t}var C$=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function a(){const o={left:e.scrollLeft,top:e.scrollTop},i=n.left!==o.left,s=n.top!==o.top;(i||s)&&t(),n=o,r=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(r)};function A$(e,t){const n=$D(e),r=Z.useRef(0);return Z.useEffect((()=>()=>window.clearTimeout(r.current)),[]),Z.useCallback((()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)}),[n,t])}function N$(e,t){const n=$D(t);eM((()=>{let t=0;if(e){const r=new ResizeObserver((()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)}));return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}}),[e,n])}var I$=t$,R$=r$,O$=v$;function P$(e,[t,n]){return Math.min(n,Math.max(t,e))}function L$(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function D$(e,t=[]){let n=[];const r=()=>{const t=n.map((e=>Z.createContext(e)));return function(n){const r=(null==n?void 0:n[e])||t;return Z.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const a=Z.createContext(r),o=n.length;n=[...n,r];const i=t=>{var n;const{scope:r,children:i,...s}=t,l=(null==(n=null==r?void 0:r[e])?void 0:n[o])||a,c=Z.useMemo((()=>s),Object.values(s));return Gh.jsx(l.Provider,{value:c,children:i})};return i.displayName=t+"Provider",[i,function(n,i){var s;const l=(null==(s=null==i?void 0:i[e])?void 0:s[o])||a,c=Z.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},M$(r,...t)]}function M$(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return Z.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function F$(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function j$(...e){return t=>{let n=!1;const r=e.map((e=>{const r=F$(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():F$(e[t],null)}}}}function B$(...e){return Z.useCallback(j$(...e),e)}function z$(e){const t=U$(e),n=Z.forwardRef(((e,n)=>{const{children:r,...a}=e,o=Z.Children.toArray(r),i=o.find(G$);if(i){const e=i.props.children,r=o.map((t=>t===i?Z.Children.count(e)>1?Z.Children.only(null):Z.isValidElement(e)?e.props.children:null:t));return Gh.jsx(t,{...a,ref:n,children:Z.isValidElement(e)?Z.cloneElement(e,void 0,r):null})}return Gh.jsx(t,{...a,ref:n,children:r})}));return n.displayName=`${e}.Slot`,n}var H$=z$("Slot");function U$(e){const t=Z.forwardRef(((e,t)=>{const{children:n,...r}=e;if(Z.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;if(a)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a)return e.props.ref;return e.props.ref||e.ref}(n),a=function(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...e)=>{o(...e),a(...e)}:a&&(n[r]=a):"style"===r?n[r]={...a,...o}:"className"===r&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==Z.Fragment&&(a.ref=t?j$(t,e):e),Z.cloneElement(n,a)}return Z.Children.count(n)>1?Z.Children.only(null):null}));return t.displayName=`${e}.SlotClone`,t}var $$=Symbol("radix.slottable");function G$(e){return Z.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===$$}function V$(e){const t=e+"CollectionProvider",[n,r]=D$(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=e=>{const{scope:t,children:n}=e,r=J.useRef(null),o=J.useRef(new Map).current;return Gh.jsx(a,{scope:t,itemMap:o,collectionRef:r,children:n})};i.displayName=t;const s=e+"CollectionSlot",l=z$(s),c=J.forwardRef(((e,t)=>{const{scope:n,children:r}=e,a=B$(t,o(s,n).collectionRef);return Gh.jsx(l,{ref:a,children:r})}));c.displayName=s;const u=e+"CollectionItemSlot",d="data-radix-collection-item",p=z$(u),h=J.forwardRef(((e,t)=>{const{scope:n,children:r,...a}=e,i=J.useRef(null),s=B$(t,i),l=o(u,n);return J.useEffect((()=>(l.itemMap.set(i,{ref:i,...a}),()=>{l.itemMap.delete(i)}))),Gh.jsx(p,{[d]:"",ref:s,children:r})}));return h.displayName=u,[{Provider:i,Slot:c,ItemSlot:h},function(t){const n=o(e+"CollectionConsumer",t);return J.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)))}),[n.collectionRef,n.itemMap])},r]}var q$=Z.createContext(void 0);function W$(e){const t=Z.useContext(q$);return e||t||"ltr"}var Y$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=z$(`Primitive.${t}`),r=Z.forwardRef(((e,r)=>{const{asChild:a,...o}=e,i=a?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),Gh.jsx(i,{...o,ref:r})}));return r.displayName=`Primitive.${t}`,{...e,[t]:r}}),{});var K$,X$="dismissableLayer.update",Q$="dismissableLayer.pointerDownOutside",Z$="dismissableLayer.focusOutside",J$=Z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),eG=Z.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:i,onDismiss:s,...l}=e,c=Z.useContext(J$),[u,d]=Z.useState(null),p=(null==u?void 0:u.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,h]=Z.useState({}),f=B$(t,(e=>d(e))),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(g),b=u?m.indexOf(u):-1,v=c.layersWithOutsidePointerEventsDisabled.size>0,k=b>=y,w=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=AB(e),r=Z.useRef(!1),a=Z.useRef((()=>{}));return Z.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){rG(Q$,n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=r,t.addEventListener("click",a.current,{once:!0})):r()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...c.branches].some((e=>e.contains(t)));k&&!n&&(null==a||a(e),null==i||i(e),e.defaultPrevented||null==s||s())}),p),x=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=AB(e),r=Z.useRef(!1);return Z.useEffect((()=>{const e=e=>{if(e.target&&!r.current){rG(Z$,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...c.branches].some((e=>e.contains(t)))||(null==o||o(e),null==i||i(e),e.defaultPrevented||null==s||s())}),p);return function(e,t=(null==globalThis?void 0:globalThis.document)){const n=AB(e);Z.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}((e=>{b===c.layers.size-1&&(null==r||r(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),p),Z.useEffect((()=>{if(u)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(K$=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),nG(),()=>{n&&1===c.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=K$)}}),[u,p,n,c]),Z.useEffect((()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),nG())}),[u,c]),Z.useEffect((()=>{const e=()=>h({});return document.addEventListener(X$,e),()=>document.removeEventListener(X$,e)}),[]),Gh.jsx(Y$.div,{...l,ref:f,style:{pointerEvents:v?k?"auto":"none":void 0,...e.style},onFocusCapture:L$(e.onFocusCapture,x.onFocusCapture),onBlurCapture:L$(e.onBlurCapture,x.onBlurCapture),onPointerDownCapture:L$(e.onPointerDownCapture,w.onPointerDownCapture)})}));eG.displayName="DismissableLayer";var tG=Z.forwardRef(((e,t)=>{const n=Z.useContext(J$),r=Z.useRef(null),a=B$(t,r);return Z.useEffect((()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),Gh.jsx(Y$.div,{...e,ref:a})}));function nG(){const e=new CustomEvent(X$);document.dispatchEvent(e)}function rG(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?function(e,t){e&&ue.flushSync((()=>e.dispatchEvent(t)))}(a,o):a.dispatchEvent(o)}tG.displayName="DismissableLayerBranch";var aG=0;function oG(){Z.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??iG()),document.body.insertAdjacentElement("beforeend",e[1]??iG()),aG++,()=>{1===aG&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),aG--}}),[])}function iG(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var sG="focusScope.autoFocusOnMount",lG="focusScope.autoFocusOnUnmount",cG={bubbles:!1,cancelable:!0},uG=Z.forwardRef(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...i}=e,[s,l]=Z.useState(null),c=AB(a),u=AB(o),d=Z.useRef(null),p=B$(t,(e=>l(e))),h=Z.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Z.useEffect((()=>{if(r){let e=function(e){if(h.paused||!s)return;const t=e.target;s.contains(t)?d.current=t:fG(d.current,{select:!0})},t=function(e){if(h.paused||!s)return;const t=e.relatedTarget;null!==t&&(s.contains(t)||fG(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&fG(s)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[r,s,h.paused]),Z.useEffect((()=>{if(s){mG.add(h);const t=document.activeElement;if(!s.contains(t)){const n=new CustomEvent(sG,cG);s.addEventListener(sG,c),s.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(fG(r,{select:t}),document.activeElement!==n)return}((e=dG(s),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&fG(s))}return()=>{s.removeEventListener(sG,c),setTimeout((()=>{const e=new CustomEvent(lG,cG);s.addEventListener(lG,u),s.dispatchEvent(e),e.defaultPrevented||fG(t??document.body,{select:!0}),s.removeEventListener(lG,u),mG.remove(h)}),0)}}var e}),[s,c,u,h]);const f=Z.useCallback((e=>{if(!n&&!r)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,a=document.activeElement;if(t&&a){const t=e.currentTarget,[r,o]=function(e){const t=dG(e),n=pG(t,e),r=pG(t.reverse(),e);return[n,r]}(t);r&&o?e.shiftKey||a!==o?e.shiftKey&&a===r&&(e.preventDefault(),n&&fG(o,{select:!0})):(e.preventDefault(),n&&fG(r,{select:!0})):a===t&&e.preventDefault()}}),[n,r,h.paused]);return Gh.jsx(Y$.div,{tabIndex:-1,...i,ref:p,onKeyDown:f})}));function dG(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function pG(e,t){for(const n of e)if(!hG(n,{upTo:t}))return n}function hG(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function fG(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}uG.displayName="FocusScope";var mG=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=gG(e,t),e.unshift(t)},remove(t){var n;e=gG(e,t),null==(n=e[0])||n.resume()}}}();function gG(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var yG=Z.forwardRef(((e,t)=>{const{children:n,width:r=10,height:a=5,...o}=e;return Gh.jsx(Y$.svg,{...o,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:Gh.jsx("polygon",{points:"0,0 30,0 15,10"})})}));yG.displayName="Arrow";var bG=yG;var vG="Popper",[kG,wG]=D$(vG),[xG,EG]=kG(vG),_G=e=>{const{__scopePopper:t,children:n}=e,[r,a]=Z.useState(null);return Gh.jsx(xG,{scope:t,anchor:r,onAnchorChange:a,children:n})};_G.displayName=vG;var SG="PopperAnchor",TG=Z.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=EG(SG,n),i=Z.useRef(null),s=B$(t,i);return Z.useEffect((()=>{o.onAnchorChange((null==r?void 0:r.current)||i.current)})),r?null:Gh.jsx(Y$.div,{...a,ref:s})}));TG.displayName=SG;var CG="PopperContent",[AG,NG]=kG(CG),IG=Z.forwardRef(((e,t)=>{var n,r,a,o,i,s;const{__scopePopper:l,side:c="bottom",sideOffset:u=0,align:d="center",alignOffset:p=0,arrowPadding:h=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:b=!1,updatePositionStrategy:v="optimized",onPlaced:k,...w}=e,x=EG(CG,l),[E,_]=Z.useState(null),S=B$(t,(e=>_(e))),[T,C]=Z.useState(null),A=function(e){const[t,n]=Z.useState(void 0);return LO((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let a,o;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,o=t.blockSize}else a=e.offsetWidth,o=e.offsetHeight;n({width:a,height:o})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(T),N=(null==A?void 0:A.width)??0,I=(null==A?void 0:A.height)??0,R=c+("center"!==d?"-"+d:""),O="number"==typeof g?g:{top:0,right:0,bottom:0,left:0,...g},P=Array.isArray(m)?m:[m],L=P.length>0,D={padding:O,boundary:P.filter(LG),altBoundary:L},{refs:M,floatingStyles:F,placement:j,isPositioned:B,middlewareData:z}=_F({strategy:"fixed",placement:R,whileElementsMounted:(...e)=>uF(...e,{animationFrame:"always"===v}),elements:{reference:x.anchor},middleware:[TF({mainAxis:u+I,alignmentAxis:p}),f&&CF({mainAxis:!0,crossAxis:!1,limiter:"partial"===y?AF():void 0,...D}),f&&NF({...D}),IF({...D,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:a,height:o}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${a}px`),i.setProperty("--radix-popper-anchor-height",`${o}px`)}}),T&&OF({element:T,padding:h}),DG({arrowWidth:N,arrowHeight:I}),b&&RF({strategy:"referenceHidden",...D})]}),[H,U]=MG(j),$=AB(k);LO((()=>{B&&(null==$||$())}),[B,$]);const G=null==(n=z.arrow)?void 0:n.x,V=null==(r=z.arrow)?void 0:r.y,q=0!==(null==(a=z.arrow)?void 0:a.centerOffset),[W,Y]=Z.useState();return LO((()=>{E&&Y(window.getComputedStyle(E).zIndex)}),[E]),Gh.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:B?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[null==(o=z.transformOrigin)?void 0:o.x,null==(i=z.transformOrigin)?void 0:i.y].join(" "),...(null==(s=z.hide)?void 0:s.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:Gh.jsx(AG,{scope:l,placedSide:H,onArrowChange:C,arrowX:G,arrowY:V,shouldHideArrow:q,children:Gh.jsx(Y$.div,{"data-side":H,"data-align":U,...w,ref:S,style:{...w.style,animation:B?void 0:"none"}})})})}));IG.displayName=CG;var RG="PopperArrow",OG={top:"bottom",right:"left",bottom:"top",left:"right"},PG=Z.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,a=NG(RG,n),o=OG[a.placedSide];return Gh.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:Gh.jsx(bG,{...r,ref:t,style:{...r.style,display:"block"}})})}));function LG(e){return null!==e}PG.displayName=RG;var DG=e=>({name:"transformOrigin",options:e,fn(t){var n,r,a;const{placement:o,rects:i,middlewareData:s}=t,l=0!==(null==(n=s.arrow)?void 0:n.centerOffset),c=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[d,p]=MG(o),h={start:"0%",center:"50%",end:"100%"}[p],f=((null==(r=s.arrow)?void 0:r.x)??0)+c/2,m=((null==(a=s.arrow)?void 0:a.y)??0)+u/2;let g="",y="";return"bottom"===d?(g=l?h:`${f}px`,y=-u+"px"):"top"===d?(g=l?h:`${f}px`,y=`${i.floating.height+u}px`):"right"===d?(g=-u+"px",y=l?h:`${m}px`):"left"===d&&(g=`${i.floating.width+u}px`,y=l?h:`${m}px`),{data:{x:g,y:y}}}});function MG(e){const[t,n="center"]=e.split("-");return[t,n]}var FG=_G,jG=TG,BG=IG,zG=PG,HG=Z.forwardRef(((e,t)=>{var n;const{container:r,...a}=e,[o,i]=Z.useState(!1);LO((()=>i(!0)),[]);const s=r||o&&(null==(n=null==globalThis?void 0:globalThis.document)?void 0:n.body);return s?de.createPortal(Gh.jsx(Y$.div,{...a,ref:t}),s):null}));HG.displayName="Portal";var UG=Z.forwardRef(((e,t)=>Gh.jsx(Y$.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));UG.displayName="VisuallyHidden";var $G=[" ","Enter","ArrowUp","ArrowDown"],GG=[" ","Enter"],VG="Select",[qG,WG,YG]=V$(VG),[KG,XG]=D$(VG,[YG,wG]),QG=wG(),[ZG,JG]=KG(VG),[eV,tV]=KG(VG),nV=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:o,value:i,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:p,required:h,form:f}=e,m=QG(t),[g,y]=Z.useState(null),[b,v]=Z.useState(null),[k,w]=Z.useState(!1),x=W$(c),[E=!1,_]=NB({prop:r,defaultProp:a,onChange:o}),[S,T]=NB({prop:i,defaultProp:s,onChange:l}),C=Z.useRef(null),A=!g||(f||!!g.closest("form")),[N,I]=Z.useState(new Set),R=Array.from(N).map((e=>e.props.value)).join(";");return Gh.jsx(FG,{...m,children:Gh.jsxs(ZG,{required:h,scope:t,trigger:g,onTriggerChange:y,valueNode:b,onValueNodeChange:v,valueNodeHasChildren:k,onValueNodeHasChildrenChange:w,contentId:FO(),value:S,onValueChange:T,open:E,onOpenChange:_,dir:x,triggerPointerDownPosRef:C,disabled:p,children:[Gh.jsx(qG.Provider,{scope:t,children:Gh.jsx(eV,{scope:e.__scopeSelect,onNativeOptionAdd:Z.useCallback((e=>{I((t=>new Set(t).add(e)))}),[]),onNativeOptionRemove:Z.useCallback((e=>{I((t=>{const n=new Set(t);return n.delete(e),n}))}),[]),children:n})}),A?Gh.jsxs(GV,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:S,onChange:e=>T(e.target.value),disabled:p,form:f,children:[void 0===S?Gh.jsx("option",{value:""}):null,Array.from(N)]},R):null]})})};nV.displayName=VG;var rV="SelectTrigger",aV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,o=QG(n),i=JG(rV,n),s=i.disabled||r,l=B$(t,i.onTriggerChange),c=WG(n),u=Z.useRef("touch"),[d,p,h]=VV((e=>{const t=c().filter((e=>!e.disabled)),n=t.find((e=>e.value===i.value)),r=qV(t,e,n);void 0!==r&&i.onValueChange(r.value)})),f=e=>{s||(i.onOpenChange(!0),h()),e&&(i.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return Gh.jsx(jG,{asChild:!0,...o,children:Gh.jsx(Y$.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":$V(i.value)?"":void 0,...a,ref:l,onClick:L$(a.onClick,(e=>{e.currentTarget.focus(),"mouse"!==u.current&&f(e)})),onPointerDown:L$(a.onPointerDown,(e=>{u.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(f(e),e.preventDefault())})),onKeyDown:L$(a.onKeyDown,(e=>{const t=""!==d.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||$G.includes(e.key)&&(f(),e.preventDefault())}))})})}));aV.displayName=rV;var oV="SelectValue",iV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:o,placeholder:i="",...s}=e,l=JG(oV,n),{onValueNodeHasChildrenChange:c}=l,u=void 0!==o,d=B$(t,l.onValueNodeChange);return LO((()=>{c(u)}),[c,u]),Gh.jsx(Y$.span,{...s,ref:d,style:{pointerEvents:"none"},children:$V(l.value)?Gh.jsx(Gh.Fragment,{children:i}):o})}));iV.displayName=oV;var sV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return Gh.jsx(Y$.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})}));sV.displayName="SelectIcon";var lV="SelectContent",cV=Z.forwardRef(((e,t)=>{const n=JG(lV,e.__scopeSelect),[r,a]=Z.useState();if(LO((()=>{a(new DocumentFragment)}),[]),!n.open){const t=r;return t?ue.createPortal(Gh.jsx(dV,{scope:e.__scopeSelect,children:Gh.jsx(qG.Slot,{scope:e.__scopeSelect,children:Gh.jsx("div",{children:e.children})})}),t):null}return Gh.jsx(fV,{...e,ref:t})}));cV.displayName=lV;var uV=10,[dV,pV]=KG(lV),hV=z$("SelectContent.RemoveScroll"),fV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:i,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:f,hideWhenDetached:m,avoidCollisions:g,...y}=e,b=JG(lV,n),[v,k]=Z.useState(null),[w,x]=Z.useState(null),E=B$(t,(e=>k(e))),[_,S]=Z.useState(null),[T,C]=Z.useState(null),A=WG(n),[N,I]=Z.useState(!1),R=Z.useRef(!1);Z.useEffect((()=>{if(v)return LH(v)}),[v]),oG();const O=Z.useCallback((e=>{const[t,...n]=A().map((e=>e.ref.current)),[r]=n.slice(-1),a=document.activeElement;for(const o of e){if(o===a)return;if(null==o||o.scrollIntoView({block:"nearest"}),o===t&&w&&(w.scrollTop=0),o===r&&w&&(w.scrollTop=w.scrollHeight),null==o||o.focus(),document.activeElement!==a)return}}),[A,w]),P=Z.useCallback((()=>O([_,v])),[O,_,v]);Z.useEffect((()=>{N&&P()}),[N,P]);const{onOpenChange:L,triggerPointerDownPosRef:D}=b;Z.useEffect((()=>{if(v){let e={x:0,y:0};const t=t=>{var n,r;e={x:Math.abs(Math.round(t.pageX)-((null==(n=D.current)?void 0:n.x)??0)),y:Math.abs(Math.round(t.pageY)-((null==(r=D.current)?void 0:r.y)??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():v.contains(n.target)||L(!1),document.removeEventListener("pointermove",t),D.current=null};return null!==D.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}}),[v,L,D]),Z.useEffect((()=>{const e=()=>L(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}}),[L]);const[M,F]=VV((e=>{const t=A().filter((e=>!e.disabled)),n=t.find((e=>e.ref.current===document.activeElement)),r=qV(t,e,n);r&&setTimeout((()=>r.ref.current.focus()))})),j=Z.useCallback(((e,t,n)=>{const r=!R.current&&!n;(void 0!==b.value&&b.value===t||r)&&(S(e),r&&(R.current=!0))}),[b.value]),B=Z.useCallback((()=>null==v?void 0:v.focus()),[v]),z=Z.useCallback(((e,t,n)=>{const r=!R.current&&!n;(void 0!==b.value&&b.value===t||r)&&C(e)}),[b.value]),H="popper"===r?gV:mV,U=H===gV?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:f,hideWhenDetached:m,avoidCollisions:g}:{};return Gh.jsx(dV,{scope:n,content:v,viewport:w,onViewportChange:x,itemRefCallback:j,selectedItem:_,onItemLeave:B,itemTextRefCallback:z,focusSelectedItem:P,selectedItemText:T,position:r,isPositioned:N,searchRef:M,children:Gh.jsx(xU,{as:hV,allowPinchZoom:!0,children:Gh.jsx(uG,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:L$(a,(e=>{var t;null==(t=b.trigger)||t.focus({preventScroll:!0}),e.preventDefault()})),children:Gh.jsx(eG,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:Gh.jsx(H,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...y,...U,onPlaced:()=>I(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:L$(y.onKeyDown,(e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||F(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=A().filter((e=>!e.disabled)).map((e=>e.ref.current));if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout((()=>O(t))),e.preventDefault()}}))})})})})})}));fV.displayName="SelectContentImpl";var mV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,o=JG(lV,n),i=pV(lV,n),[s,l]=Z.useState(null),[c,u]=Z.useState(null),d=B$(t,(e=>u(e))),p=WG(n),h=Z.useRef(!1),f=Z.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:y,focusSelectedItem:b}=i,v=Z.useCallback((()=>{if(o.trigger&&o.valueNode&&s&&c&&m&&g&&y){const e=o.trigger.getBoundingClientRect(),t=c.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),a=y.getBoundingClientRect();if("rtl"!==o.dir){const r=a.left-t.left,o=n.left-r,i=e.left-o,l=e.width+i,c=Math.max(l,t.width),u=window.innerWidth-uV,d=P$(o,[uV,Math.max(uV,u-c)]);s.style.minWidth=l+"px",s.style.left=d+"px"}else{const r=t.right-a.right,o=window.innerWidth-n.right-r,i=window.innerWidth-e.right-o,l=e.width+i,c=Math.max(l,t.width),u=window.innerWidth-uV,d=P$(o,[uV,Math.max(uV,u-c)]);s.style.minWidth=l+"px",s.style.right=d+"px"}const i=p(),l=window.innerHeight-2*uV,u=m.scrollHeight,d=window.getComputedStyle(c),f=parseInt(d.borderTopWidth,10),b=parseInt(d.paddingTop,10),v=parseInt(d.borderBottomWidth,10),k=f+b+u+parseInt(d.paddingBottom,10)+v,w=Math.min(5*g.offsetHeight,k),x=window.getComputedStyle(m),E=parseInt(x.paddingTop,10),_=parseInt(x.paddingBottom,10),S=e.top+e.height/2-uV,T=l-S,C=g.offsetHeight/2,A=f+b+(g.offsetTop+C),N=k-A;if(A<=S){const e=i.length>0&&g===i[i.length-1].ref.current;s.style.bottom="0px";const t=c.clientHeight-m.offsetTop-m.offsetHeight,n=A+Math.max(T,C+(e?_:0)+t+v);s.style.height=n+"px"}else{const e=i.length>0&&g===i[0].ref.current;s.style.top="0px";const t=Math.max(S,f+m.offsetTop+(e?E:0)+C)+N;s.style.height=t+"px",m.scrollTop=A-S+m.offsetTop}s.style.margin=`${uV}px 0`,s.style.minHeight=w+"px",s.style.maxHeight=l+"px",null==r||r(),requestAnimationFrame((()=>h.current=!0))}}),[p,o.trigger,o.valueNode,s,c,m,g,y,o.dir,r]);LO((()=>v()),[v]);const[k,w]=Z.useState();LO((()=>{c&&w(window.getComputedStyle(c).zIndex)}),[c]);const x=Z.useCallback((e=>{e&&!0===f.current&&(v(),null==b||b(),f.current=!1)}),[v,b]);return Gh.jsx(yV,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:x,children:Gh.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:Gh.jsx(Y$.div,{...a,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})}));mV.displayName="SelectItemAlignedPosition";var gV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=uV,...o}=e,i=QG(n);return Gh.jsx(BG,{...i,...o,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})}));gV.displayName="SelectPopperPosition";var[yV,bV]=KG(lV,{}),vV="SelectViewport",kV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,o=pV(vV,n),i=bV(vV,n),s=B$(t,o.onViewportChange),l=Z.useRef(0);return Gh.jsxs(Gh.Fragment,{children:[Gh.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),Gh.jsx(qG.Slot,{scope:n,children:Gh.jsx(Y$.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:L$(a.onScroll,(e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=i;if((null==r?void 0:r.current)&&n){const e=Math.abs(l.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*uV,a=parseFloat(n.style.minHeight),o=parseFloat(n.style.height),i=Math.max(a,o);if(i<r){const a=i+e,o=Math.min(r,a),s=a-o;n.style.height=o+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}l.current=t.scrollTop}))})})]})}));kV.displayName=vV;var wV="SelectGroup",[xV,EV]=KG(wV),_V=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,...r}=e,a=FO();return Gh.jsx(xV,{scope:n,id:a,children:Gh.jsx(Y$.div,{role:"group","aria-labelledby":a,...r,ref:t})})}));_V.displayName=wV;var SV="SelectLabel",TV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,...r}=e,a=EV(SV,n);return Gh.jsx(Y$.div,{id:a.id,...r,ref:t})}));TV.displayName=SV;var CV="SelectItem",[AV,NV]=KG(CV),IV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...i}=e,s=JG(CV,n),l=pV(CV,n),c=s.value===r,[u,d]=Z.useState(o??""),[p,h]=Z.useState(!1),f=B$(t,(e=>{var t;return null==(t=l.itemRefCallback)?void 0:t.call(l,e,r,a)})),m=FO(),g=Z.useRef("touch"),y=()=>{a||(s.onValueChange(r),s.onOpenChange(!1))};if(""===r)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return Gh.jsx(AV,{scope:n,value:r,disabled:a,textId:m,isSelected:c,onItemTextChange:Z.useCallback((e=>{d((t=>t||((null==e?void 0:e.textContent)??"").trim()))}),[]),children:Gh.jsx(qG.ItemSlot,{scope:n,value:r,disabled:a,textValue:u,children:Gh.jsx(Y$.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...i,ref:f,onFocus:L$(i.onFocus,(()=>h(!0))),onBlur:L$(i.onBlur,(()=>h(!1))),onClick:L$(i.onClick,(()=>{"mouse"!==g.current&&y()})),onPointerUp:L$(i.onPointerUp,(()=>{"mouse"===g.current&&y()})),onPointerDown:L$(i.onPointerDown,(e=>{g.current=e.pointerType})),onPointerMove:L$(i.onPointerMove,(e=>{var t;g.current=e.pointerType,a?null==(t=l.onItemLeave)||t.call(l):"mouse"===g.current&&e.currentTarget.focus({preventScroll:!0})})),onPointerLeave:L$(i.onPointerLeave,(e=>{var t;e.currentTarget===document.activeElement&&(null==(t=l.onItemLeave)||t.call(l))})),onKeyDown:L$(i.onKeyDown,(e=>{var t;""!==(null==(t=l.searchRef)?void 0:t.current)&&" "===e.key||(GG.includes(e.key)&&y()," "===e.key&&e.preventDefault())}))})})})}));IV.displayName=CV;var RV="SelectItemText",OV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,className:r,style:a,...o}=e,i=JG(RV,n),s=pV(RV,n),l=NV(RV,n),c=tV(RV,n),[u,d]=Z.useState(null),p=B$(t,(e=>d(e)),l.onItemTextChange,(e=>{var t;return null==(t=s.itemTextRefCallback)?void 0:t.call(s,e,l.value,l.disabled)})),h=null==u?void 0:u.textContent,f=Z.useMemo((()=>Gh.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value)),[l.disabled,l.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=c;return LO((()=>(m(f),()=>g(f))),[m,g,f]),Gh.jsxs(Gh.Fragment,{children:[Gh.jsx(Y$.span,{id:l.textId,...o,ref:p}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?ue.createPortal(o.children,i.valueNode):null]})}));OV.displayName=RV;var PV="SelectItemIndicator",LV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,...r}=e;return NV(PV,n).isSelected?Gh.jsx(Y$.span,{"aria-hidden":!0,...r,ref:t}):null}));LV.displayName=PV;var DV="SelectScrollUpButton",MV=Z.forwardRef(((e,t)=>{const n=pV(DV,e.__scopeSelect),r=bV(DV,e.__scopeSelect),[a,o]=Z.useState(!1),i=B$(t,r.onScrollButtonChange);return LO((()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;o(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[n.viewport,n.isPositioned]),a?Gh.jsx(BV,{...e,ref:i,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}));MV.displayName=DV;var FV="SelectScrollDownButton",jV=Z.forwardRef(((e,t)=>{const n=pV(FV,e.__scopeSelect),r=bV(FV,e.__scopeSelect),[a,o]=Z.useState(!1),i=B$(t,r.onScrollButtonChange);return LO((()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;o(n)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[n.viewport,n.isPositioned]),a?Gh.jsx(BV,{...e,ref:i,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}));jV.displayName=FV;var BV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,o=pV("SelectScrollButton",n),i=Z.useRef(null),s=WG(n),l=Z.useCallback((()=>{null!==i.current&&(window.clearInterval(i.current),i.current=null)}),[]);return Z.useEffect((()=>()=>l()),[l]),LO((()=>{var e;const t=s().find((e=>e.ref.current===document.activeElement));null==(e=null==t?void 0:t.ref.current)||e.scrollIntoView({block:"nearest"})}),[s]),Gh.jsx(Y$.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:L$(a.onPointerDown,(()=>{null===i.current&&(i.current=window.setInterval(r,50))})),onPointerMove:L$(a.onPointerMove,(()=>{var e;null==(e=o.onItemLeave)||e.call(o),null===i.current&&(i.current=window.setInterval(r,50))})),onPointerLeave:L$(a.onPointerLeave,(()=>{l()}))})})),zV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,...r}=e;return Gh.jsx(Y$.div,{"aria-hidden":!0,...r,ref:t})}));zV.displayName="SelectSeparator";var HV="SelectArrow",UV=Z.forwardRef(((e,t)=>{const{__scopeSelect:n,...r}=e,a=QG(n),o=JG(HV,n),i=pV(HV,n);return o.open&&"popper"===i.position?Gh.jsx(zG,{...a,...r,ref:t}):null}));function $V(e){return""===e||void 0===e}UV.displayName=HV;var GV=Z.forwardRef(((e,t)=>{const{value:n,...r}=e,a=Z.useRef(null),o=B$(t,a),i=function(e){const t=Z.useRef({value:e,previous:e});return Z.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}(n);return Z.useEffect((()=>{const e=a.current,t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(i!==n&&r){const t=new Event("change",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}}),[i,n]),Gh.jsx(UG,{asChild:!0,children:Gh.jsx("select",{...r,ref:o,defaultValue:n})})}));function VV(e){const t=AB(e),n=Z.useRef(""),r=Z.useRef(0),a=Z.useCallback((e=>{const a=n.current+e;t(a),function e(t){n.current=t,window.clearTimeout(r.current),""!==t&&(r.current=window.setTimeout((()=>e("")),1e3))}(a)}),[t]),o=Z.useCallback((()=>{n.current="",window.clearTimeout(r.current)}),[]);return Z.useEffect((()=>()=>window.clearTimeout(r.current)),[]),[n,a,o]}function qV(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,a=n?e.indexOf(n):-1;let o=(i=e,s=Math.max(a,0),i.map(((e,t)=>i[(s+t)%i.length])));var i,s;1===r.length&&(o=o.filter((e=>e!==n)));const l=o.find((e=>e.textValue.toLowerCase().startsWith(r.toLowerCase())));return l!==n?l:void 0}GV.displayName="BubbleSelect";var WV=nV,YV=aV,KV=iV,XV=sV,QV=cV,ZV=kV,JV=IV,eq=OV,tq=LV,nq=e=>"object"==typeof e&&null!==e,rq=e=>nq(e)&&1===e.nodeType&&"string"==typeof e.nodeName,aq=e=>nq(e)&&9===e.nodeType,oq=/(textarea|select)/;function iq(e){if(null==e||!rq(e))return!1;try{return(e=>rq(e)&&"input"===e.localName)(e)&&null!=e.selectionStart||oq.test(e.localName)||e.isContentEditable||"true"===e.getAttribute("contenteditable")||""===e.getAttribute("contenteditable")}catch{return!1}}function sq(e){return aq(e)?e:(e=>nq(e)&&e===e.window)(e)?e.document:(null==e?void 0:e.ownerDocument)??document}function lq(e){const t=function(e){var t,n,r;return(null==(t=e.composedPath)?void 0:t.call(e))??(null==(r=null==(n=e.nativeEvent)?void 0:n.composedPath)?void 0:r.call(n))}(e);return(null==t?void 0:t[0])??e.target}var cq=(e,t,n,r)=>{const a="function"==typeof e?e():e;return null==a||a.addEventListener(t,n,r),()=>{null==a||a.removeEventListener(t,n,r)}},uq=e=>rq(e)&&"IFRAME"===e.tagName,dq="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",pq=(e,t=!1)=>{if(!e)return[];const n=Array.from(e.querySelectorAll(dq));(1==t||"if-empty"==t&&0===n.length)&&rq(e)&&hq(e)&&n.unshift(e);const r=n.filter(hq);return r.forEach(((e,t)=>{if(uq(e)&&e.contentDocument){const n=e.contentDocument.body;r.splice(t,1,...pq(n))}})),r};function hq(e){return!(!e||e.closest("[inert]"))&&(e.matches(dq)&&(!!rq(t=e)&&(t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0)));var t}function fq(e,t){if(!e)return[];const n=Array.from(e.querySelectorAll(dq)).filter(mq);return n.forEach(((e,t)=>{if(uq(e)&&e.contentDocument){const r=fq(e.contentDocument.body);n.splice(t,1,...r)}})),n.length,n}function mq(e){return null!=e&&e.tabIndex>0||hq(e)&&!(e=>parseInt(e.getAttribute("tabindex")||"0",10)<0)(e)}function gq(e){return e.tabIndex<0&&(/^(audio|video|details)$/.test(e.localName)||iq(e))&&(t=e,Number.isNaN(parseInt(t.getAttribute("tabindex")||"0",10)))?0:e.tabIndex;var t}var yq=Object.defineProperty,bq=(e,t,n)=>((e,t,n)=>t in e?yq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),vq={activateTrap(e,t){if(e.length>0){const n=e[e.length-1];n!==t&&n.pause()}const n=e.indexOf(t);-1===n||e.splice(n,1),e.push(t)},deactivateTrap(e,t){const n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},kq=[],wq=class{constructor(e,t){bq(this,"trapStack"),bq(this,"config"),bq(this,"doc"),bq(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),bq(this,"listenerCleanups",[]),bq(this,"handleFocus",(e=>{const t=lq(e),n=this.findContainerIndex(t,e)>=0;if(n||aq(t))n&&(this.state.mostRecentlyFocusedNode=t);else{let t;e.stopImmediatePropagation();let n=!0;if(this.state.mostRecentlyFocusedNode)if(gq(this.state.mostRecentlyFocusedNode)>0){const e=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:r}=this.state.containerGroups[e];if(r.length>0){const e=r.findIndex((e=>e===this.state.mostRecentlyFocusedNode));e>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?e+1<r.length&&(t=r[e+1],n=!1):e-1>=0&&(t=r[e-1],n=!1))}}else this.state.containerGroups.some((e=>e.tabbableNodes.some((e=>gq(e)>0))))||(n=!1);else n=!1;n&&(t=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),t?this.tryFocus(t):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0})),bq(this,"handlePointerDown",(e=>{const t=lq(e);this.findContainerIndex(t,e)>=0||(Eq(this.config.clickOutsideDeactivates,e)?this.deactivate({returnFocus:this.config.returnFocusOnDeactivate}):Eq(this.config.allowOutsideClick,e)||e.preventDefault())})),bq(this,"handleClick",(e=>{const t=lq(e);this.findContainerIndex(t,e)>=0||Eq(this.config.clickOutsideDeactivates,e)||Eq(this.config.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())})),bq(this,"handleTabKey",(e=>{if(this.config.isKeyForward(e)||this.config.isKeyBackward(e)){this.state.recentNavEvent=e;const t=this.config.isKeyBackward(e),n=this.findNextNavNode({event:e,isBackward:t});if(!n)return;xq(e)&&e.preventDefault(),this.tryFocus(n)}})),bq(this,"handleEscapeKey",(e=>{_q(e)&&!1!==Eq(this.config.escapeDeactivates,e)&&(e.preventDefault(),this.deactivate())})),bq(this,"_mutationObserver"),bq(this,"setupMutationObserver",(()=>{const e=this.doc.defaultView||window;this._mutationObserver=new e.MutationObserver((e=>{e.some((e=>Array.from(e.removedNodes).some((e=>e===this.state.mostRecentlyFocusedNode))))&&this.tryFocus(this.getInitialFocusNode())}))})),bq(this,"updateObservedNodes",(()=>{var e;null==(e=this._mutationObserver)||e.disconnect(),this.state.active&&!this.state.paused&&this.state.containers.map((e=>{var t;null==(t=this._mutationObserver)||t.observe(e,{subtree:!0,childList:!0})}))})),bq(this,"getInitialFocusNode",(()=>{let e=this.getNodeForOption("initialFocus",{hasFallback:!0});if(!1===e)return!1;if(void 0===e||e&&!hq(e))if(this.findContainerIndex(this.doc.activeElement)>=0)e=this.doc.activeElement;else{const t=this.state.tabbableGroups[0];e=t&&t.firstTabbableNode||this.getNodeForOption("fallbackFocus")}else null===e&&(e=this.getNodeForOption("fallbackFocus"));if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e.isConnected||(e=this.getNodeForOption("fallbackFocus")),e})),bq(this,"tryFocus",(e=>{!1!==e&&e!==function(e){let t=e.activeElement;for(;null==t?void 0:t.shadowRoot;){const e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}(this.doc)&&(e&&e.focus?(e.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=e,Tq(e)&&e.select()):this.tryFocus(this.getInitialFocusNode()))})),bq(this,"deactivate",(e=>{if(!this.state.active)return this;const t={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...e};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),vq.deactivateTrap(this.trapStack,this);const n=this.getOption(t,"onDeactivate"),r=this.getOption(t,"onPostDeactivate"),a=this.getOption(t,"checkCanReturnFocus"),o=this.getOption(t,"returnFocus","returnFocusOnDeactivate");null==n||n();const i=()=>{Sq((()=>{if(o){const e=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(e)}null==r||r()}))};if(o&&a){return a(this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation)).then(i,i),this}return i(),this})),bq(this,"pause",(e=>{if(this.state.paused||!this.state.active)return this;const t=this.getOption(e,"onPause"),n=this.getOption(e,"onPostPause");return this.state.paused=!0,null==t||t(),this.removeListeners(),this.updateObservedNodes(),null==n||n(),this})),bq(this,"unpause",(e=>{if(!this.state.paused||!this.state.active)return this;const t=this.getOption(e,"onUnpause"),n=this.getOption(e,"onPostUnpause");return this.state.paused=!1,null==t||t(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),null==n||n(),this})),bq(this,"updateContainerElements",(e=>(this.state.containers=Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this))),bq(this,"getReturnFocusNode",(e=>{const t=this.getNodeForOption("setReturnFocus",{params:[e]});return t||!1!==t&&e})),bq(this,"getOption",((e,t,n)=>e&&void 0!==e[t]?e[t]:this.config[n||t])),bq(this,"getNodeForOption",((e,{hasFallback:t=!1,params:n=[]}={})=>{let r=this.config[e];if("function"==typeof r&&(r=r(...n)),!0===r&&(r=void 0),!r){if(void 0===r||!1===r)return r;throw new Error(`\`${e}\` was specified but was not a node, or did not return a node`)}let a=r;if("string"==typeof r){try{a=this.doc.querySelector(r)}catch(kbe){throw new Error(`\`${e}\` appears to be an invalid selector; error="${kbe.message}"`)}if(!a&&!t)throw new Error(`\`${e}\` as selector refers to no known node`)}return a})),bq(this,"findNextNavNode",(e=>{const{event:t,isBackward:n=!1}=e,r=e.target||lq(t);this.updateTabbableNodes();let a=null;if(this.state.tabbableGroups.length>0){const e=this.findContainerIndex(r,t),o=e>=0?this.state.containerGroups[e]:void 0;if(e<0)a=n?this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:this.state.tabbableGroups[0].firstTabbableNode;else if(n){let n=this.state.tabbableGroups.findIndex((({firstTabbableNode:e})=>r===e));if(n<0&&((null==o?void 0:o.container)===r||hq(r)&&!mq(r)&&!(null==o?void 0:o.nextTabbableNode(r,!1)))&&(n=e),n>=0){const e=0===n?this.state.tabbableGroups.length-1:n-1,t=this.state.tabbableGroups[e];a=gq(r)>=0?t.lastTabbableNode:t.lastDomTabbableNode}else xq(t)||(a=null==o?void 0:o.nextTabbableNode(r,!1))}else{let n=this.state.tabbableGroups.findIndex((({lastTabbableNode:e})=>r===e));if(n<0&&((null==o?void 0:o.container)===r||hq(r)&&!mq(r)&&!(null==o?void 0:o.nextTabbableNode(r)))&&(n=e),n>=0){const e=n===this.state.tabbableGroups.length-1?0:n+1,t=this.state.tabbableGroups[e];a=gq(r)>=0?t.firstTabbableNode:t.firstDomTabbableNode}else xq(t)||(a=null==o?void 0:o.nextTabbableNode(r))}}else a=this.getNodeForOption("fallbackFocus");return a})),this.trapStack=t.trapStack||kq;const n={returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:e=>xq(e)&&!e.shiftKey,isKeyBackward:e=>xq(e)&&e.shiftKey,...t};this.doc=n.document||sq(Array.isArray(e)?e[0]:e),this.config=n,this.updateContainerElements(e),this.setupMutationObserver()}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){const n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return this.state.containerGroups.findIndex((({container:t,tabbableNodes:r})=>t.contains(e)||(null==n?void 0:n.includes(t))||r.find((t=>t===e))))}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map((e=>{const t=fq(e),n=pq(e),r=t.length>0?t[0]:void 0,a=t.length>0?t[t.length-1]:void 0,o=n.find((e=>mq(e))),i=n.slice().reverse().find((e=>mq(e))),s=!!t.find((e=>gq(e)>0));return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:s,firstTabbableNode:r,lastTabbableNode:a,firstDomTabbableNode:o,lastDomTabbableNode:i,nextTabbableNode:function(e,r=!0){const a=t.indexOf(e);return a<0?r?n.slice(n.indexOf(e)+1).find((e=>mq(e))):n.slice(0,n.indexOf(e)).reverse().find((e=>mq(e))):t[a+(r?1:-1)]}}})),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 vq.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?Sq((()=>{this.tryFocus(this.getInitialFocusNode())})):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(cq(this.doc,"focusin",this.handleFocus,!0),cq(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),cq(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),cq(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),cq(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),cq(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=this.doc.activeElement||null,null==t||t();const a=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),null==n||n()};return r?(r(this.state.containers.concat()).then(a,a),this):(a(),this)}},xq=e=>"Tab"===e.key,Eq=(e,...t)=>"function"==typeof e?e(...t):e,_q=e=>!e.isComposing&&"Escape"===e.key,Sq=e=>setTimeout(e,0),Tq=e=>"input"===e.localName&&"select"in e&&"function"==typeof e.select;function Cq(e,t={}){let n;const r=function(e){let t;const n=globalThis.requestAnimationFrame((()=>{t=e()}));return()=>{globalThis.cancelAnimationFrame(n),null==t||t()}}((()=>{const r="function"==typeof e?e():e;if(r){n=new wq(r,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:r,...t,document:sq(r)});try{n.activate()}catch{}}}));return function(){null==n||n.deactivate(),r()}}var Aq=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=Z.useState(),r=Z.useRef({}),a=Z.useRef(e),o=Z.useRef("none"),i=e?"mounted":"unmounted",[s,l]=function(e,t){return Z.useReducer(((e,n)=>t[e][n]??e),e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Z.useEffect((()=>{const e=Nq(r.current);o.current="mounted"===s?e:"none"}),[s]),LO((()=>{const t=r.current,n=a.current;if(n!==e){const r=o.current,i=Nq(t);if(e)l("MOUNT");else if("none"===i||"none"===(null==t?void 0:t.display))l("UNMOUNT");else{l(n&&r!==i?"ANIMATION_OUT":"UNMOUNT")}a.current=e}}),[e,l]),LO((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,i=o=>{const i=Nq(r.current).includes(o.animationName);if(o.target===t&&i&&(l("ANIMATION_END"),!a.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},s=e=>{e.target===t&&(o.current=Nq(r.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}l("ANIMATION_END")}),[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:Z.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),a="function"==typeof n?n({present:r.isPresent}):Z.Children.only(n),o=B$(r.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,a=r&&"isReactWarning"in r&&r.isReactWarning;if(a)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof n||r.isPresent?Z.cloneElement(a,{ref:o}):null};function Nq(e){return(null==e?void 0:e.animationName)||"none"}Aq.displayName="Presence";const Iq="Dialog",[Rq,Oq]=D$(Iq),[Pq,Lq]=Rq(Iq),Dq=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:i=!0}=e,s=Z.useRef(null),l=Z.useRef(null),[c=!1,u]=NB({prop:r,defaultProp:a,onChange:o});return Gh.jsx(Pq,{scope:t,triggerRef:s,contentRef:l,contentId:FO(),titleId:FO(),descriptionId:FO(),open:c,onOpenChange:u,onOpenToggle:Z.useCallback((()=>u((e=>!e))),[u]),modal:i,children:n})};Dq.displayName=Iq;const Mq="DialogTrigger",Fq=Z.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,a=Lq(Mq,n),o=B$(t,a.triggerRef);return Gh.jsx(Y$.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":nW(a.open),...r,ref:o,onClick:L$(e.onClick,a.onOpenToggle)})}));Fq.displayName=Mq;const jq="DialogPortal",[Bq,zq]=Rq(jq,{forceMount:void 0}),Hq=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,o=Lq(jq,t);return Gh.jsx(Bq,{scope:t,forceMount:n,children:Z.Children.map(r,(e=>Gh.jsx(Aq,{present:n||o.open,children:Gh.jsx(HG,{asChild:!0,container:a,children:e})})))})};Hq.displayName=jq;const Uq="DialogOverlay",$q=Z.forwardRef(((e,t)=>{const n=zq(Uq,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=Lq(Uq,e.__scopeDialog);return o.modal?Gh.jsx(Aq,{present:r||o.open,children:Gh.jsx(Gq,{...a,ref:t})}):null}));$q.displayName=Uq;const Gq=Z.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,a=Lq(Uq,n);return Gh.jsx(xU,{as:H$,allowPinchZoom:!0,shards:[a.contentRef],children:Gh.jsx(Y$.div,{"data-state":nW(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})})),Vq="DialogContent",qq=Z.forwardRef(((e,t)=>{const n=zq(Vq,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=Lq(Vq,e.__scopeDialog);return Gh.jsx(Aq,{present:r||o.open,children:o.modal?Gh.jsx(Wq,{...a,ref:t}):Gh.jsx(Yq,{...a,ref:t})})}));qq.displayName=Vq;const Wq=Z.forwardRef(((e,t)=>{const n=Lq(Vq,e.__scopeDialog),r=Z.useRef(null),a=B$(t,n.contentRef,r);return Z.useEffect((()=>{const e=r.current;if(e)return LH(e)}),[]),Gh.jsx(Kq,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onPointerDownOutside:L$(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()})),onFocusOutside:L$(e.onFocusOutside,(e=>e.preventDefault()))})})),Yq=Z.forwardRef(((e,t)=>{const n=Lq(Vq,e.__scopeDialog),r=Z.useRef(!1),a=Z.useRef(!1);return Gh.jsx(Kq,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onInteractOutside:t=>{var o,i;null==(o=e.onInteractOutside)||o.call(e,t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const s=t.target;(null==(i=n.triggerRef.current)?void 0:i.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})})),Kq=Z.forwardRef(((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...i}=e,s=Lq(Vq,n),l=Z.useRef(null),c=B$(t,l);return oG(),Z.useEffect((()=>{if(r)return Cq(l.current,{preventScroll:!0,onActivate:a,onDeactivate:o,initialFocus:!1})}),[]),Gh.jsx(eG,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":nW(s.open),...i,ref:c,onDismiss:()=>s.onOpenChange(!1)})})),Xq="DialogTitle",Qq=Z.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,a=Lq(Xq,n);return Gh.jsx(Y$.h2,{id:a.titleId,...r,ref:t})}));Qq.displayName=Xq;const Zq="DialogDescription",Jq=Z.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,a=Lq(Zq,n);return Gh.jsx(Y$.p,{id:a.descriptionId,...r,ref:t})}));Jq.displayName=Zq;const eW="DialogClose",tW=Z.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,a=Lq(eW,n);return Gh.jsx(Y$.button,{type:"button",...r,ref:t,onClick:L$(e.onClick,(()=>a.onOpenChange(!1)))})}));function nW(e){return e?"open":"closed"}tW.displayName=eW;const rW=Dq,aW=Hq,oW=$q,iW=qq,sW=Qq,lW=tW,cW=Z.forwardRef(((e,t)=>{const n=Z.useId();return Gh.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",height:"100%",width:"100%",ref:t,...e,children:[Gh.jsx("title",{children:"AI Avatar"}),Gh.jsx("path",{d:"M9.937 15.5002C9.84772 15.1542 9.66734 14.8384 9.41462 14.5856C9.1619 14.3329 8.84607 14.1525 8.5 14.0632L2.365 12.4812C2.26033 12.4515 2.16821 12.3885 2.10261 12.3017C2.03702 12.2149 2.00153 12.1091 2.00153 12.0002C2.00153 11.8914 2.03702 11.7856 2.10261 11.6988C2.16821 11.612 2.26033 11.549 2.365 11.5192L8.5 9.93625C8.84595 9.84706 9.16169 9.66682 9.4144 9.41429C9.66711 9.16175 9.84757 8.84614 9.937 8.50025L11.519 2.36525C11.5484 2.26017 11.6114 2.16759 11.6983 2.10164C11.7853 2.0357 11.8914 2 12.0005 2C12.1096 2 12.2157 2.0357 12.3027 2.10164C12.3896 2.16759 12.4526 2.26017 12.482 2.36525L14.063 8.50025C14.1523 8.84632 14.3327 9.16215 14.5854 9.41487C14.8381 9.66759 15.1539 9.84797 15.5 9.93725L21.635 11.5182C21.7405 11.5473 21.8335 11.6103 21.8998 11.6973C21.9661 11.7844 22.0021 11.8908 22.0021 12.0002C22.0021 12.1097 21.9661 12.2161 21.8998 12.3032C21.8335 12.3902 21.7405 12.4531 21.635 12.4822L15.5 14.0632C15.1539 14.1525 14.8381 14.3329 14.5854 14.5856C14.3327 14.8384 14.1523 15.1542 14.063 15.5002L12.481 21.6353C12.4516 21.7403 12.3886 21.8329 12.3017 21.8989C12.2147 21.9648 12.1086 22.0005 11.9995 22.0005C11.8904 22.0005 11.7843 21.9648 11.6973 21.8989C11.6104 21.8329 11.5474 21.7403 11.518 21.6353L9.937 15.5002Z",stroke:`url(#${n}-stroke1)`,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),Gh.jsx("path",{d:"M18.9838 5.37522C18.9615 5.28871 18.9164 5.20975 18.8532 5.14657C18.79 5.08339 18.7111 5.0383 18.6246 5.01598L17.0909 4.62049C17.0647 4.61306 17.0417 4.5973 17.0253 4.5756C17.0089 4.5539 17 4.52744 17 4.50024C17 4.47304 17.0089 4.44659 17.0253 4.42488C17.0417 4.40318 17.0647 4.38742 17.0909 4.38L18.6246 3.98426C18.7111 3.96196 18.79 3.9169 18.8532 3.85377C18.9163 3.79064 18.9615 3.71174 18.9838 3.62527L19.3793 2.09155C19.3867 2.06528 19.4024 2.04214 19.4241 2.02565C19.4459 2.00917 19.4724 2.00024 19.4997 2.00024C19.527 2.00024 19.5535 2.00917 19.5752 2.02565C19.597 2.04214 19.6127 2.06528 19.6201 2.09155L20.0153 3.62527C20.0376 3.71178 20.0827 3.79074 20.1459 3.85391C20.2091 3.91709 20.288 3.96219 20.3745 3.98451L21.9082 4.37975C21.9346 4.38702 21.9579 4.40275 21.9744 4.42452C21.991 4.44628 22 4.47288 22 4.50024C22 4.5276 21.991 4.55421 21.9744 4.57597C21.9579 4.59774 21.9346 4.61347 21.9082 4.62074L20.3745 5.01598C20.288 5.0383 20.2091 5.08339 20.1459 5.14657C20.0827 5.20975 20.0376 5.28871 20.0153 5.37522L19.6198 6.90893C19.6124 6.9352 19.5967 6.95835 19.575 6.97483C19.5532 6.99132 19.5267 7.00024 19.4994 7.00024C19.4721 7.00024 19.4456 6.99132 19.4239 6.97483C19.4022 6.95835 19.3864 6.9352 19.3791 6.90893L18.9838 5.37522Z",stroke:`url(#${n}-stroke2)`,strokeLinecap:"round",strokeLinejoin:"round"}),Gh.jsx("path",{d:"M3.98382 20.3752C3.9615 20.2887 3.9164 20.2098 3.85322 20.1466C3.79005 20.0834 3.71109 20.0383 3.62458 20.016L2.09087 19.6205C2.0647 19.6131 2.04167 19.5973 2.02527 19.5756C2.00887 19.5539 2 19.5274 2 19.5002C2 19.473 2.00887 19.4466 2.02527 19.4249C2.04167 19.4032 2.0647 19.3874 2.09087 19.38L3.62458 18.9843C3.71106 18.962 3.78999 18.9169 3.85317 18.8538C3.91635 18.7906 3.96146 18.7117 3.98382 18.6253L4.37931 17.0916C4.38666 17.0653 4.4024 17.0421 4.42414 17.0257C4.44587 17.0092 4.4724 17.0002 4.49968 17.0002C4.52696 17.0002 4.55349 17.0092 4.57522 17.0257C4.59695 17.0421 4.6127 17.0653 4.62005 17.0916L5.01529 18.6253C5.03761 18.7118 5.0827 18.7907 5.14588 18.8539C5.20906 18.9171 5.28801 18.9622 5.37453 18.9845L6.90824 19.3797C6.93461 19.387 6.95787 19.4027 6.97445 19.4245C6.99102 19.4463 7 19.4729 7 19.5002C7 19.5276 6.99102 19.5542 6.97445 19.576C6.95787 19.5977 6.93461 19.6135 6.90824 19.6207L5.37453 20.016C5.28801 20.0383 5.20906 20.0834 5.14588 20.1466C5.0827 20.2098 5.03761 20.2887 5.01529 20.3752L4.6198 21.9089C4.61245 21.9352 4.5967 21.9583 4.57497 21.9748C4.55324 21.9913 4.52671 22.0002 4.49943 22.0002C4.47215 22.0002 4.44562 21.9913 4.42389 21.9748C4.40215 21.9583 4.38641 21.9352 4.37906 21.9089L3.98382 20.3752Z",stroke:`url(#${n}-stroke3)`,strokeLinecap:"round",strokeLinejoin:"round"}),Gh.jsxs("defs",{children:[Gh.jsxs("linearGradient",{id:`${n}-stroke1`,x1:"0.149625",y1:"0.148102",x2:"23.8539",y2:"23.8524",gradientUnits:"userSpaceOnUse",children:[Gh.jsx("stop",{offset:"0.287444",stopColor:"var(--start-color)"}),Gh.jsx("stop",{offset:"0.728693",stopColor:"var(--end-color)"})]}),Gh.jsxs("linearGradient",{id:`${n}-stroke2`,x1:"16.537",y1:"1.53728",x2:"22.463",y2:"7.46321",gradientUnits:"userSpaceOnUse",children:[Gh.jsx("stop",{offset:"0.287444",stopColor:"var(--start-color)"}),Gh.jsx("stop",{offset:"0.728693",stopColor:"var(--end-color)"})]}),Gh.jsxs("linearGradient",{id:`${n}-stroke3`,x1:"1.53704",y1:"16.5373",x2:"7.46296",y2:"22.4632",gradientUnits:"userSpaceOnUse",children:[Gh.jsx("stop",{offset:"0.287444",stopColor:"var(--start-color)"}),Gh.jsx("stop",{offset:"0.728693",stopColor:"var(--end-color)"})]})]})]})})),uW=Z.forwardRef(((e,t)=>Gh.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",height:"32px",viewBox:"0 96 960 960",width:"32px",ref:t,...e,children:[Gh.jsx("title",{children:"User Avatar"}),Gh.jsx("path",{d:"M222 801q63-40 124.5-60.5T480 720q72 0 134 20.5T739 801q44-54 62.5-109T820 576q0-145-97.5-242.5T480 236q-145 0-242.5 97.5T140 576q0 61 19 116t63 109Zm257.814-195Q422 606 382.5 566.314q-39.5-39.686-39.5-97.5t39.686-97.314q39.686-39.5 97.5-39.5t97.314 39.686q39.5 39.686 39.5 97.5T577.314 566.5q-39.686 39.5-97.5 39.5Zm-.219 370q-83.146 0-156.275-31.5t-127.225-86Q142 804 111 731.159 80 658.319 80 575.5q0-82.819 31.5-155.659Q143 347 197.5 293t127.341-85.5Q397.681 176 480.5 176q82.819 0 155.659 31.5Q709 239 763 293t85.5 127Q880 493 880 575.734q0 82.734-31.5 155.5T763 858.5q-54 54.5-127.129 86T479.595 976Z",fill:"currentColor"})]})));function dW(e,t){return(dW=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}
|
|
39
39
|
/*!
|
|
40
40
|
* content-type
|
|
41
41
|
* Copyright(c) 2015 Douglas Christopher Wilson
|